@crvouga/mockingbird-service-caretalk 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-5H2PMMOJ.js → chunk-TK4SOSGE.js} +2 -2
- package/dist/{chunk-VBOYORPS.js → chunk-UVVPSQHN.js} +355 -22
- package/dist/chunk-UVVPSQHN.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-VBOYORPS.js.map +0 -7
- /package/dist/{chunk-5H2PMMOJ.js.map → chunk-TK4SOSGE.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-caretalk
|
|
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-UVVPSQHN.js";
|
|
4
4
|
|
|
5
5
|
// ../../adapters/node/dist/cli.js
|
|
6
6
|
import { readFile } from "node:fs/promises";
|
|
@@ -358,4 +358,4 @@ export {
|
|
|
358
358
|
createServer2 as createServer,
|
|
359
359
|
serveTarget
|
|
360
360
|
};
|
|
361
|
-
//# sourceMappingURL=chunk-
|
|
361
|
+
//# sourceMappingURL=chunk-TK4SOSGE.js.map
|
|
@@ -1846,6 +1846,167 @@ function faultPresetList(value) {
|
|
|
1846
1846
|
})
|
|
1847
1847
|
};
|
|
1848
1848
|
}
|
|
1849
|
+
function mountSqlExplorer(root, api) {
|
|
1850
|
+
const cell = (value) => {
|
|
1851
|
+
if (value === null || value === void 0)
|
|
1852
|
+
return "";
|
|
1853
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
1854
|
+
return String(value);
|
|
1855
|
+
}
|
|
1856
|
+
return JSON.stringify(value) ?? "";
|
|
1857
|
+
};
|
|
1858
|
+
root.replaceChildren();
|
|
1859
|
+
const layout = document.createElement("div");
|
|
1860
|
+
layout.className = "sql-layout";
|
|
1861
|
+
const tables = document.createElement("div");
|
|
1862
|
+
tables.className = "sql-tables";
|
|
1863
|
+
const stack = document.createElement("div");
|
|
1864
|
+
stack.className = "stack";
|
|
1865
|
+
const banner = document.createElement("p");
|
|
1866
|
+
banner.className = "banner";
|
|
1867
|
+
const grid = document.createElement("div");
|
|
1868
|
+
const input = document.createElement("textarea");
|
|
1869
|
+
input.className = "sql-input";
|
|
1870
|
+
input.spellcheck = false;
|
|
1871
|
+
input.placeholder = "SELECT * FROM ...";
|
|
1872
|
+
const actions = document.createElement("div");
|
|
1873
|
+
actions.className = "row-actions";
|
|
1874
|
+
const run = document.createElement("button");
|
|
1875
|
+
run.type = "button";
|
|
1876
|
+
run.textContent = "Run";
|
|
1877
|
+
actions.append(run);
|
|
1878
|
+
const result = document.createElement("pre");
|
|
1879
|
+
stack.append(banner, grid, input, actions, result);
|
|
1880
|
+
layout.append(tables, stack);
|
|
1881
|
+
root.append(layout);
|
|
1882
|
+
const showError = (error) => {
|
|
1883
|
+
banner.textContent = error instanceof Error ? error.message : String(error);
|
|
1884
|
+
banner.classList.add("show");
|
|
1885
|
+
};
|
|
1886
|
+
const clearError = () => {
|
|
1887
|
+
banner.textContent = "";
|
|
1888
|
+
banner.classList.remove("show");
|
|
1889
|
+
};
|
|
1890
|
+
const renderGrid = (columns, rows) => {
|
|
1891
|
+
grid.replaceChildren();
|
|
1892
|
+
if (columns.length === 0) {
|
|
1893
|
+
const empty = document.createElement("p");
|
|
1894
|
+
empty.className = "empty";
|
|
1895
|
+
empty.textContent = "No rows.";
|
|
1896
|
+
grid.append(empty);
|
|
1897
|
+
return;
|
|
1898
|
+
}
|
|
1899
|
+
const table = document.createElement("table");
|
|
1900
|
+
const head = document.createElement("thead");
|
|
1901
|
+
const headRow = document.createElement("tr");
|
|
1902
|
+
for (const column of columns) {
|
|
1903
|
+
const th = document.createElement("th");
|
|
1904
|
+
th.textContent = column;
|
|
1905
|
+
headRow.append(th);
|
|
1906
|
+
}
|
|
1907
|
+
head.append(headRow);
|
|
1908
|
+
const body = document.createElement("tbody");
|
|
1909
|
+
for (const row of rows) {
|
|
1910
|
+
const tr = document.createElement("tr");
|
|
1911
|
+
for (const column of columns) {
|
|
1912
|
+
const td = document.createElement("td");
|
|
1913
|
+
td.dataset.label = column;
|
|
1914
|
+
td.textContent = cell(row[column]);
|
|
1915
|
+
tr.append(td);
|
|
1916
|
+
}
|
|
1917
|
+
body.append(tr);
|
|
1918
|
+
}
|
|
1919
|
+
table.append(head, body);
|
|
1920
|
+
grid.append(table);
|
|
1921
|
+
};
|
|
1922
|
+
const rowsOf = (value) => {
|
|
1923
|
+
if (!isRecord2(value) || !Array.isArray(value.rows))
|
|
1924
|
+
return [];
|
|
1925
|
+
return value.rows.flatMap((row) => isRecord2(row) ? [row] : []);
|
|
1926
|
+
};
|
|
1927
|
+
const columnsOf = (value, rows) => {
|
|
1928
|
+
if (isRecord2(value) && Array.isArray(value.columns)) {
|
|
1929
|
+
const named = value.columns.flatMap((column) => typeof column === "string" ? [column] : []);
|
|
1930
|
+
if (named.length > 0)
|
|
1931
|
+
return named;
|
|
1932
|
+
}
|
|
1933
|
+
const first = rows[0];
|
|
1934
|
+
return first === void 0 ? [] : Object.keys(first);
|
|
1935
|
+
};
|
|
1936
|
+
let selected = "";
|
|
1937
|
+
const loadPage = async (schema, name) => {
|
|
1938
|
+
selected = `${schema}.${name}`;
|
|
1939
|
+
const page = await api.get(`/sql/tables/${encodeURIComponent(schema)}/${encodeURIComponent(name)}?limit=50`);
|
|
1940
|
+
const rows = rowsOf(page);
|
|
1941
|
+
renderGrid(columnsOf(page, rows), rows);
|
|
1942
|
+
const total = isRecord2(page) && typeof page.total === "number" ? page.total : rows.length;
|
|
1943
|
+
result.textContent = `${selected} \xB7 ${total} rows`;
|
|
1944
|
+
for (const button of tables.querySelectorAll("button")) {
|
|
1945
|
+
if (!(button instanceof HTMLButtonElement))
|
|
1946
|
+
continue;
|
|
1947
|
+
button.setAttribute("aria-current", button.dataset.schema === schema && button.dataset.table === name ? "true" : "false");
|
|
1948
|
+
}
|
|
1949
|
+
};
|
|
1950
|
+
const loadTables = async () => {
|
|
1951
|
+
const payload = await api.get("/sql/tables");
|
|
1952
|
+
const listed = isRecord2(payload) && Array.isArray(payload.tables) ? payload.tables : [];
|
|
1953
|
+
tables.replaceChildren();
|
|
1954
|
+
if (listed.length === 0) {
|
|
1955
|
+
const empty = document.createElement("p");
|
|
1956
|
+
empty.className = "empty";
|
|
1957
|
+
empty.textContent = "No tables.";
|
|
1958
|
+
tables.append(empty);
|
|
1959
|
+
return;
|
|
1960
|
+
}
|
|
1961
|
+
for (const item of listed) {
|
|
1962
|
+
if (!isRecord2(item) || typeof item.schema !== "string" || typeof item.name !== "string")
|
|
1963
|
+
continue;
|
|
1964
|
+
const button = document.createElement("button");
|
|
1965
|
+
button.type = "button";
|
|
1966
|
+
button.dataset.schema = item.schema;
|
|
1967
|
+
button.dataset.table = item.name;
|
|
1968
|
+
button.textContent = `${item.schema}.${item.name}`;
|
|
1969
|
+
tables.append(button);
|
|
1970
|
+
}
|
|
1971
|
+
};
|
|
1972
|
+
tables.addEventListener("click", (event) => {
|
|
1973
|
+
const target = event.target;
|
|
1974
|
+
if (!(target instanceof Element))
|
|
1975
|
+
return;
|
|
1976
|
+
const button = target.closest("button");
|
|
1977
|
+
if (!(button instanceof HTMLButtonElement))
|
|
1978
|
+
return;
|
|
1979
|
+
const schema = button.dataset.schema;
|
|
1980
|
+
const name = button.dataset.table;
|
|
1981
|
+
if (schema === void 0 || name === void 0)
|
|
1982
|
+
return;
|
|
1983
|
+
clearError();
|
|
1984
|
+
loadPage(schema, name).catch(showError);
|
|
1985
|
+
});
|
|
1986
|
+
run.addEventListener("click", () => {
|
|
1987
|
+
const sql = input.value.trim();
|
|
1988
|
+
if (sql === "") {
|
|
1989
|
+
showError(new Error("Enter a statement"));
|
|
1990
|
+
return;
|
|
1991
|
+
}
|
|
1992
|
+
clearError();
|
|
1993
|
+
api.send("POST", "/sql/query", { sql }).then((payload) => {
|
|
1994
|
+
const rows = rowsOf(payload);
|
|
1995
|
+
renderGrid(columnsOf(payload, rows), rows);
|
|
1996
|
+
const count = isRecord2(payload) && typeof payload.rowCount === "number" ? payload.rowCount : rows.length;
|
|
1997
|
+
const truncated = isRecord2(payload) && payload.truncated === true ? " (truncated)" : "";
|
|
1998
|
+
result.textContent = `${count} rows${truncated}`;
|
|
1999
|
+
}).catch(showError);
|
|
2000
|
+
});
|
|
2001
|
+
const namespace = document.getElementById("namespace");
|
|
2002
|
+
if (namespace) {
|
|
2003
|
+
namespace.addEventListener("change", () => {
|
|
2004
|
+
clearError();
|
|
2005
|
+
loadTables().catch(showError);
|
|
2006
|
+
});
|
|
2007
|
+
}
|
|
2008
|
+
loadTables().catch(showError);
|
|
2009
|
+
}
|
|
1849
2010
|
function bootAdmin(config) {
|
|
1850
2011
|
const fieldKinds = ["string", "number", "boolean", "null", "object", "array", "unknown"];
|
|
1851
2012
|
const sources = ["declared", "inferred", "mixed"];
|
|
@@ -2286,6 +2447,50 @@ function bootAdmin(config) {
|
|
|
2286
2447
|
if (render)
|
|
2287
2448
|
await render();
|
|
2288
2449
|
}
|
|
2450
|
+
const delay = (ms) => new Promise((resolve) => {
|
|
2451
|
+
window.setTimeout(resolve, ms);
|
|
2452
|
+
});
|
|
2453
|
+
const confirmAction = async (button, pending, done, work) => {
|
|
2454
|
+
if (button.dataset.pending === "1")
|
|
2455
|
+
return;
|
|
2456
|
+
const label = button.textContent ?? "";
|
|
2457
|
+
const width = button.offsetWidth;
|
|
2458
|
+
button.dataset.pending = "1";
|
|
2459
|
+
button.classList.add("pressed");
|
|
2460
|
+
button.setAttribute("aria-busy", "true");
|
|
2461
|
+
button.style.minWidth = `${width}px`;
|
|
2462
|
+
button.textContent = pending;
|
|
2463
|
+
try {
|
|
2464
|
+
await work();
|
|
2465
|
+
button.textContent = done;
|
|
2466
|
+
await delay(1e3);
|
|
2467
|
+
} catch (error) {
|
|
2468
|
+
showError(error);
|
|
2469
|
+
} finally {
|
|
2470
|
+
button.textContent = label;
|
|
2471
|
+
button.style.minWidth = "";
|
|
2472
|
+
button.classList.remove("pressed");
|
|
2473
|
+
button.removeAttribute("aria-busy");
|
|
2474
|
+
delete button.dataset.pending;
|
|
2475
|
+
}
|
|
2476
|
+
};
|
|
2477
|
+
document.addEventListener("click", (event) => {
|
|
2478
|
+
const target = event.target;
|
|
2479
|
+
if (!(target instanceof Element))
|
|
2480
|
+
return;
|
|
2481
|
+
const button = target.closest("button");
|
|
2482
|
+
if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
|
|
2483
|
+
return;
|
|
2484
|
+
button.classList.add("pressed");
|
|
2485
|
+
const token = String(Date.now());
|
|
2486
|
+
button.dataset.press = token;
|
|
2487
|
+
window.setTimeout(() => {
|
|
2488
|
+
if (button.dataset.press !== token || button.dataset.pending === "1")
|
|
2489
|
+
return;
|
|
2490
|
+
button.classList.remove("pressed");
|
|
2491
|
+
delete button.dataset.press;
|
|
2492
|
+
}, 450);
|
|
2493
|
+
});
|
|
2289
2494
|
el("namespace", HTMLSelectElement).addEventListener("change", () => {
|
|
2290
2495
|
state.namespace = el("namespace", HTMLSelectElement).value;
|
|
2291
2496
|
refresh().catch(showError);
|
|
@@ -2296,7 +2501,7 @@ function bootAdmin(config) {
|
|
|
2296
2501
|
refresh().catch(showError);
|
|
2297
2502
|
});
|
|
2298
2503
|
el("refresh", HTMLButtonElement).addEventListener("click", () => {
|
|
2299
|
-
refresh().catch(showError);
|
|
2504
|
+
confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
|
|
2300
2505
|
});
|
|
2301
2506
|
el("collections", HTMLElement).addEventListener("click", (event) => {
|
|
2302
2507
|
const target = event.target;
|
|
@@ -2419,10 +2624,10 @@ function bootAdmin(config) {
|
|
|
2419
2624
|
}).then(() => renderFaults()).catch(showError);
|
|
2420
2625
|
});
|
|
2421
2626
|
el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2422
|
-
api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
|
|
2627
|
+
confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
|
|
2423
2628
|
});
|
|
2424
2629
|
el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2425
|
-
api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
|
|
2630
|
+
confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
|
|
2426
2631
|
});
|
|
2427
2632
|
el("route-list", HTMLElement).addEventListener("click", (event) => {
|
|
2428
2633
|
const target = event.target;
|
|
@@ -2478,6 +2683,22 @@ function bootAdmin(config) {
|
|
|
2478
2683
|
panel.script = value.script;
|
|
2479
2684
|
return panel;
|
|
2480
2685
|
};
|
|
2686
|
+
const decodeExtension = (value) => {
|
|
2687
|
+
if (!isRecord2(value))
|
|
2688
|
+
return void 0;
|
|
2689
|
+
if (value.kind === "sql") {
|
|
2690
|
+
return {
|
|
2691
|
+
kind: "sql",
|
|
2692
|
+
id: typeof value.id === "string" && value.id !== "" ? value.id : "sql",
|
|
2693
|
+
title: typeof value.title === "string" && value.title !== "" ? value.title : "SQL",
|
|
2694
|
+
description: typeof value.description === "string" ? value.description : "Browse tables and run queries."
|
|
2695
|
+
};
|
|
2696
|
+
}
|
|
2697
|
+
if (value.kind !== "panel")
|
|
2698
|
+
return void 0;
|
|
2699
|
+
const panel = decodePanel(value);
|
|
2700
|
+
return panel === void 0 ? void 0 : { kind: "panel", ...panel };
|
|
2701
|
+
};
|
|
2481
2702
|
const mountPanels = (panels) => {
|
|
2482
2703
|
const nav = el("nav", HTMLElement);
|
|
2483
2704
|
const views = el("views", HTMLElement);
|
|
@@ -2531,15 +2752,57 @@ function bootAdmin(config) {
|
|
|
2531
2752
|
return decoded === void 0 ? [] : [decoded];
|
|
2532
2753
|
});
|
|
2533
2754
|
mountPanels(panels);
|
|
2755
|
+
const extensions = requireList(isRecord2(manifest) ? manifest.extensions : void 0, "Extensions").flatMap((extension) => {
|
|
2756
|
+
const decoded = decodeExtension(extension);
|
|
2757
|
+
return decoded === void 0 ? [] : [decoded];
|
|
2758
|
+
});
|
|
2759
|
+
const extensionPanels = extensions.flatMap((extension) => extension.kind === "panel" ? [extension] : []);
|
|
2760
|
+
mountPanels(extensionPanels);
|
|
2761
|
+
for (const extension of extensions) {
|
|
2762
|
+
if (extension.kind !== "sql")
|
|
2763
|
+
continue;
|
|
2764
|
+
const nav = el("nav", HTMLElement);
|
|
2765
|
+
const views = el("views", HTMLElement);
|
|
2766
|
+
const button = document.createElement("button");
|
|
2767
|
+
button.type = "button";
|
|
2768
|
+
button.dataset.view = extension.id;
|
|
2769
|
+
button.textContent = extension.title;
|
|
2770
|
+
nav.append(button);
|
|
2771
|
+
const section = document.createElement("section");
|
|
2772
|
+
section.className = "view";
|
|
2773
|
+
section.id = `view-${extension.id}`;
|
|
2774
|
+
section.hidden = true;
|
|
2775
|
+
const title = document.createElement("h2");
|
|
2776
|
+
title.textContent = extension.title;
|
|
2777
|
+
const lede = document.createElement("p");
|
|
2778
|
+
lede.className = "lede";
|
|
2779
|
+
lede.textContent = extension.description;
|
|
2780
|
+
const body = document.createElement("div");
|
|
2781
|
+
body.className = "panel-body";
|
|
2782
|
+
section.append(title, lede, body);
|
|
2783
|
+
views.append(section);
|
|
2784
|
+
mountSqlExplorer(body, panelApi);
|
|
2785
|
+
}
|
|
2534
2786
|
return refresh();
|
|
2535
2787
|
}).catch(showError);
|
|
2536
2788
|
}
|
|
2537
|
-
var clientPrelude = [
|
|
2789
|
+
var clientPrelude = [
|
|
2790
|
+
isRecord2,
|
|
2791
|
+
mountAdminBrand,
|
|
2792
|
+
startAdminBrand,
|
|
2793
|
+
faultPresetList,
|
|
2794
|
+
mountSqlExplorer,
|
|
2795
|
+
bootAdmin
|
|
2796
|
+
].map((fn) => fn.toString()).join("\n");
|
|
2538
2797
|
var adminClientSource = (config) => {
|
|
2539
2798
|
const payload = JSON.stringify(config).replace(/</g, "\\u003c");
|
|
2799
|
+
const entry = bootAdmin.name;
|
|
2800
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
|
|
2801
|
+
throw new Error("admin client cannot call its boot function");
|
|
2802
|
+
}
|
|
2540
2803
|
return `<script>
|
|
2541
2804
|
${clientPrelude}
|
|
2542
|
-
|
|
2805
|
+
${entry}(${payload});
|
|
2543
2806
|
</script>`;
|
|
2544
2807
|
};
|
|
2545
2808
|
|
|
@@ -2580,19 +2843,33 @@ var STANDARD_ADMIN_ROUTES = [
|
|
|
2580
2843
|
"GET /ui/manifest"
|
|
2581
2844
|
];
|
|
2582
2845
|
var PANEL_ID = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
|
|
2846
|
+
var RESERVED_VIEWS = /* @__PURE__ */ new Set(["overview", "state", "clock", "faults", "journal", "routes"]);
|
|
2847
|
+
var checkPanel = (panel, seen, label) => {
|
|
2848
|
+
if (!PANEL_ID.test(panel.id)) {
|
|
2849
|
+
throw new RangeError(`${label} id must match ${PANEL_ID}: ${JSON.stringify(panel.id)}`);
|
|
2850
|
+
}
|
|
2851
|
+
if (RESERVED_VIEWS.has(panel.id)) {
|
|
2852
|
+
throw new RangeError(`${label} id ${panel.id} is reserved by the admin shell`);
|
|
2853
|
+
}
|
|
2854
|
+
if (seen.has(panel.id))
|
|
2855
|
+
throw new RangeError(`duplicate admin view id ${panel.id}`);
|
|
2856
|
+
seen.add(panel.id);
|
|
2857
|
+
if (panel.title.trim() === "")
|
|
2858
|
+
throw new RangeError(`${label} ${panel.id} needs a title`);
|
|
2859
|
+
};
|
|
2583
2860
|
var assertAdminUi = (ui) => {
|
|
2584
|
-
if (!ui
|
|
2861
|
+
if (!ui)
|
|
2585
2862
|
return;
|
|
2586
2863
|
const seen = /* @__PURE__ */ new Set();
|
|
2587
|
-
for (const panel of ui.panels)
|
|
2588
|
-
|
|
2589
|
-
|
|
2864
|
+
for (const panel of ui.panels ?? [])
|
|
2865
|
+
checkPanel(panel, seen, "admin panel");
|
|
2866
|
+
for (const extension of ui.extensions ?? []) {
|
|
2867
|
+
if (extension.kind === "panel") {
|
|
2868
|
+
checkPanel(extension, seen, "admin extension");
|
|
2869
|
+
continue;
|
|
2590
2870
|
}
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
seen.add(panel.id);
|
|
2594
|
-
if (panel.title.trim() === "")
|
|
2595
|
-
throw new RangeError(`admin panel ${panel.id} needs a title`);
|
|
2871
|
+
const id = extension.id ?? "sql";
|
|
2872
|
+
checkPanel({ id, title: extension.title ?? "SQL" }, seen, "admin extension");
|
|
2596
2873
|
}
|
|
2597
2874
|
};
|
|
2598
2875
|
|
|
@@ -2753,9 +3030,24 @@ var renderAdminDocument = (service) => {
|
|
|
2753
3030
|
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
|
2754
3031
|
label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
|
|
2755
3032
|
label.field input, label.field select, .controls input[type="password"] {
|
|
2756
|
-
background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
2757
|
-
padding: 7px 8px; min-height: 36px;
|
|
2758
|
-
}
|
|
3033
|
+
background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
3034
|
+
padding: 7px 8px; min-height: 36px; line-height: 1.2;
|
|
3035
|
+
}
|
|
3036
|
+
/* A native menu ignores min-height, so Preset rendered about half as tall as
|
|
3037
|
+
the text fields in the same form. Paint it like those fields. */
|
|
3038
|
+
label.field select {
|
|
3039
|
+
-webkit-appearance: none; appearance: none;
|
|
3040
|
+
padding-right: 28px;
|
|
3041
|
+
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");
|
|
3042
|
+
background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
|
|
3043
|
+
}
|
|
3044
|
+
.stack > .field > input,
|
|
3045
|
+
.stack > .field > select,
|
|
3046
|
+
.stack > .field > textarea,
|
|
3047
|
+
dialog .field > input,
|
|
3048
|
+
dialog .field > select,
|
|
3049
|
+
dialog .field > textarea { width: 100%; }
|
|
3050
|
+
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
|
|
2759
3051
|
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
|
|
2760
3052
|
border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
|
|
2761
3053
|
background: var(--bg-elev);
|
|
@@ -2763,6 +3055,14 @@ var renderAdminDocument = (service) => {
|
|
|
2763
3055
|
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
|
|
2764
3056
|
.btn-quiet { background: transparent; }
|
|
2765
3057
|
.btn-danger { color: var(--err); }
|
|
3058
|
+
/* Held after mouseup. Clearing an empty journal changes nothing on screen,
|
|
3059
|
+
so the press itself has to stay visible. */
|
|
3060
|
+
.icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
|
|
3061
|
+
.icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
|
|
3062
|
+
background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
|
|
3063
|
+
}
|
|
3064
|
+
.btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
|
|
3065
|
+
.btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
|
|
2766
3066
|
/* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
|
|
2767
3067
|
record or the full nav row would widen the page past the viewport. */
|
|
2768
3068
|
.layout {
|
|
@@ -2803,6 +3103,12 @@ var renderAdminDocument = (service) => {
|
|
|
2803
3103
|
border-radius: 999px; padding: 4px 8px;
|
|
2804
3104
|
}
|
|
2805
3105
|
.chip i { color: var(--faint); font-style: normal; }
|
|
3106
|
+
.sql-layout {
|
|
3107
|
+
display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 16px;
|
|
3108
|
+
}
|
|
3109
|
+
.sql-tables { display: flex; flex-direction: column; gap: 4px; max-height: 28rem; overflow: auto; }
|
|
3110
|
+
.sql-tables button { text-align: left; }
|
|
3111
|
+
.sql-input { font-family: var(--mono); min-height: 7rem; width: 100%; }
|
|
2806
3112
|
table { width: 100%; border-collapse: collapse; font-size: 14px; }
|
|
2807
3113
|
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
|
|
2808
3114
|
th { color: var(--faint); font-weight: 600; font-size: 12px; }
|
|
@@ -2851,14 +3157,22 @@ var renderAdminDocument = (service) => {
|
|
|
2851
3157
|
input, select, textarea { font-size: 16px; }
|
|
2852
3158
|
.brand, .vendor, .controls { width: 100%; }
|
|
2853
3159
|
label.field, label.field select, label.field input { flex: 1; min-width: 0; }
|
|
2854
|
-
|
|
3160
|
+
/* The layout fills the screen. A single-column grid stretches every auto
|
|
3161
|
+
row, so the tab bar grew with the leftover height and the buttons floated
|
|
3162
|
+
in the middle of it. The bar stays one row; the page below takes the rest. */
|
|
3163
|
+
.layout {
|
|
3164
|
+
grid-template-columns: minmax(0, 1fr);
|
|
3165
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
3166
|
+
align-content: start;
|
|
3167
|
+
}
|
|
2855
3168
|
nav.side {
|
|
3169
|
+
align-self: start; height: auto;
|
|
2856
3170
|
flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
|
|
2857
3171
|
border-right: 0; border-bottom: 1px solid var(--line);
|
|
2858
3172
|
padding: 8px;
|
|
2859
3173
|
}
|
|
2860
3174
|
nav.side button { white-space: nowrap; flex: none; }
|
|
2861
|
-
.split { grid-template-columns: minmax(0, 1fr); }
|
|
3175
|
+
.split, .sql-layout { grid-template-columns: minmax(0, 1fr); }
|
|
2862
3176
|
main { padding: 14px; }
|
|
2863
3177
|
table, thead, tbody, tr, th, td { display: block; }
|
|
2864
3178
|
thead { display: none; }
|
|
@@ -3029,6 +3343,24 @@ var json2 = (body) => new Response(JSON.stringify(body), {
|
|
|
3029
3343
|
status: 200,
|
|
3030
3344
|
headers: { "content-type": "application/json; charset=utf-8" }
|
|
3031
3345
|
});
|
|
3346
|
+
var describeExtension = (extension) => {
|
|
3347
|
+
if (extension.kind === "sql") {
|
|
3348
|
+
return {
|
|
3349
|
+
kind: "sql",
|
|
3350
|
+
id: extension.id ?? "sql",
|
|
3351
|
+
title: extension.title ?? "SQL",
|
|
3352
|
+
...extension.description !== void 0 ? { description: extension.description } : {}
|
|
3353
|
+
};
|
|
3354
|
+
}
|
|
3355
|
+
return {
|
|
3356
|
+
kind: "panel",
|
|
3357
|
+
id: extension.id,
|
|
3358
|
+
title: extension.title,
|
|
3359
|
+
...extension.description !== void 0 ? { description: extension.description } : {},
|
|
3360
|
+
html: extension.html,
|
|
3361
|
+
...extension.script !== void 0 ? { script: extension.script } : {}
|
|
3362
|
+
};
|
|
3363
|
+
};
|
|
3032
3364
|
var adminUiRoutes = (service, ui) => {
|
|
3033
3365
|
const shell = () => renderAdminDocument(service);
|
|
3034
3366
|
const document3 = () => ui?.render ? ui.render({ service, defaultHtml: shell }) : shell();
|
|
@@ -3043,7 +3375,8 @@ var adminUiRoutes = (service, ui) => {
|
|
|
3043
3375
|
...panel.description !== void 0 ? { description: panel.description } : {},
|
|
3044
3376
|
html: panel.html,
|
|
3045
3377
|
...panel.script !== void 0 ? { script: panel.script } : {}
|
|
3046
|
-
}))
|
|
3378
|
+
})),
|
|
3379
|
+
extensions: (ui?.extensions ?? []).map(describeExtension)
|
|
3047
3380
|
})
|
|
3048
3381
|
};
|
|
3049
3382
|
};
|
|
@@ -3730,7 +4063,7 @@ var stateAdminRoutes = (routes) => {
|
|
|
3730
4063
|
};
|
|
3731
4064
|
|
|
3732
4065
|
// ../core/dist/version.js
|
|
3733
|
-
var PACKAGE_VERSION = true ? "1.
|
|
4066
|
+
var PACKAGE_VERSION = true ? "1.7.0" : UNRELEASED_VERSION;
|
|
3734
4067
|
|
|
3735
4068
|
// ../core/dist/signing.js
|
|
3736
4069
|
var encoder = new TextEncoder();
|
|
@@ -5306,4 +5639,4 @@ export {
|
|
|
5306
5639
|
normalizeDate,
|
|
5307
5640
|
CareTalkAPI
|
|
5308
5641
|
};
|
|
5309
|
-
//# sourceMappingURL=chunk-
|
|
5642
|
+
//# sourceMappingURL=chunk-UVVPSQHN.js.map
|