@crvouga/mockingbird-service-payload-cms 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-XOIML4HJ.js → chunk-GLSGZ74L.js} +355 -22
- package/dist/chunk-GLSGZ74L.js.map +7 -0
- package/dist/{chunk-OJEHJQZW.js → chunk-GTV3AI6Q.js} +2 -2
- package/dist/cli.js +2 -2
- package/dist/index.js +1 -1
- package/dist/server.js +2 -2
- package/package.json +2 -2
- package/dist/chunk-XOIML4HJ.js.map +0 -7
- /package/dist/{chunk-OJEHJQZW.js.map → chunk-GTV3AI6Q.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-payload-cms
|
|
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
|
|
|
@@ -1670,6 +1670,167 @@ function faultPresetList(value) {
|
|
|
1670
1670
|
})
|
|
1671
1671
|
};
|
|
1672
1672
|
}
|
|
1673
|
+
function mountSqlExplorer(root, api) {
|
|
1674
|
+
const cell = (value) => {
|
|
1675
|
+
if (value === null || value === void 0)
|
|
1676
|
+
return "";
|
|
1677
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
1678
|
+
return String(value);
|
|
1679
|
+
}
|
|
1680
|
+
return JSON.stringify(value) ?? "";
|
|
1681
|
+
};
|
|
1682
|
+
root.replaceChildren();
|
|
1683
|
+
const layout = document.createElement("div");
|
|
1684
|
+
layout.className = "sql-layout";
|
|
1685
|
+
const tables = document.createElement("div");
|
|
1686
|
+
tables.className = "sql-tables";
|
|
1687
|
+
const stack = document.createElement("div");
|
|
1688
|
+
stack.className = "stack";
|
|
1689
|
+
const banner = document.createElement("p");
|
|
1690
|
+
banner.className = "banner";
|
|
1691
|
+
const grid = document.createElement("div");
|
|
1692
|
+
const input = document.createElement("textarea");
|
|
1693
|
+
input.className = "sql-input";
|
|
1694
|
+
input.spellcheck = false;
|
|
1695
|
+
input.placeholder = "SELECT * FROM ...";
|
|
1696
|
+
const actions = document.createElement("div");
|
|
1697
|
+
actions.className = "row-actions";
|
|
1698
|
+
const run = document.createElement("button");
|
|
1699
|
+
run.type = "button";
|
|
1700
|
+
run.textContent = "Run";
|
|
1701
|
+
actions.append(run);
|
|
1702
|
+
const result = document.createElement("pre");
|
|
1703
|
+
stack.append(banner, grid, input, actions, result);
|
|
1704
|
+
layout.append(tables, stack);
|
|
1705
|
+
root.append(layout);
|
|
1706
|
+
const showError = (error) => {
|
|
1707
|
+
banner.textContent = error instanceof Error ? error.message : String(error);
|
|
1708
|
+
banner.classList.add("show");
|
|
1709
|
+
};
|
|
1710
|
+
const clearError = () => {
|
|
1711
|
+
banner.textContent = "";
|
|
1712
|
+
banner.classList.remove("show");
|
|
1713
|
+
};
|
|
1714
|
+
const renderGrid = (columns, rows) => {
|
|
1715
|
+
grid.replaceChildren();
|
|
1716
|
+
if (columns.length === 0) {
|
|
1717
|
+
const empty = document.createElement("p");
|
|
1718
|
+
empty.className = "empty";
|
|
1719
|
+
empty.textContent = "No rows.";
|
|
1720
|
+
grid.append(empty);
|
|
1721
|
+
return;
|
|
1722
|
+
}
|
|
1723
|
+
const table = document.createElement("table");
|
|
1724
|
+
const head = document.createElement("thead");
|
|
1725
|
+
const headRow = document.createElement("tr");
|
|
1726
|
+
for (const column of columns) {
|
|
1727
|
+
const th = document.createElement("th");
|
|
1728
|
+
th.textContent = column;
|
|
1729
|
+
headRow.append(th);
|
|
1730
|
+
}
|
|
1731
|
+
head.append(headRow);
|
|
1732
|
+
const body = document.createElement("tbody");
|
|
1733
|
+
for (const row of rows) {
|
|
1734
|
+
const tr = document.createElement("tr");
|
|
1735
|
+
for (const column of columns) {
|
|
1736
|
+
const td = document.createElement("td");
|
|
1737
|
+
td.dataset.label = column;
|
|
1738
|
+
td.textContent = cell(row[column]);
|
|
1739
|
+
tr.append(td);
|
|
1740
|
+
}
|
|
1741
|
+
body.append(tr);
|
|
1742
|
+
}
|
|
1743
|
+
table.append(head, body);
|
|
1744
|
+
grid.append(table);
|
|
1745
|
+
};
|
|
1746
|
+
const rowsOf = (value) => {
|
|
1747
|
+
if (!isRecord2(value) || !Array.isArray(value.rows))
|
|
1748
|
+
return [];
|
|
1749
|
+
return value.rows.flatMap((row) => isRecord2(row) ? [row] : []);
|
|
1750
|
+
};
|
|
1751
|
+
const columnsOf = (value, rows) => {
|
|
1752
|
+
if (isRecord2(value) && Array.isArray(value.columns)) {
|
|
1753
|
+
const named = value.columns.flatMap((column) => typeof column === "string" ? [column] : []);
|
|
1754
|
+
if (named.length > 0)
|
|
1755
|
+
return named;
|
|
1756
|
+
}
|
|
1757
|
+
const first = rows[0];
|
|
1758
|
+
return first === void 0 ? [] : Object.keys(first);
|
|
1759
|
+
};
|
|
1760
|
+
let selected = "";
|
|
1761
|
+
const loadPage = async (schema, name) => {
|
|
1762
|
+
selected = `${schema}.${name}`;
|
|
1763
|
+
const page = await api.get(`/sql/tables/${encodeURIComponent(schema)}/${encodeURIComponent(name)}?limit=50`);
|
|
1764
|
+
const rows = rowsOf(page);
|
|
1765
|
+
renderGrid(columnsOf(page, rows), rows);
|
|
1766
|
+
const total = isRecord2(page) && typeof page.total === "number" ? page.total : rows.length;
|
|
1767
|
+
result.textContent = `${selected} \xB7 ${total} rows`;
|
|
1768
|
+
for (const button of tables.querySelectorAll("button")) {
|
|
1769
|
+
if (!(button instanceof HTMLButtonElement))
|
|
1770
|
+
continue;
|
|
1771
|
+
button.setAttribute("aria-current", button.dataset.schema === schema && button.dataset.table === name ? "true" : "false");
|
|
1772
|
+
}
|
|
1773
|
+
};
|
|
1774
|
+
const loadTables = async () => {
|
|
1775
|
+
const payload = await api.get("/sql/tables");
|
|
1776
|
+
const listed = isRecord2(payload) && Array.isArray(payload.tables) ? payload.tables : [];
|
|
1777
|
+
tables.replaceChildren();
|
|
1778
|
+
if (listed.length === 0) {
|
|
1779
|
+
const empty = document.createElement("p");
|
|
1780
|
+
empty.className = "empty";
|
|
1781
|
+
empty.textContent = "No tables.";
|
|
1782
|
+
tables.append(empty);
|
|
1783
|
+
return;
|
|
1784
|
+
}
|
|
1785
|
+
for (const item of listed) {
|
|
1786
|
+
if (!isRecord2(item) || typeof item.schema !== "string" || typeof item.name !== "string")
|
|
1787
|
+
continue;
|
|
1788
|
+
const button = document.createElement("button");
|
|
1789
|
+
button.type = "button";
|
|
1790
|
+
button.dataset.schema = item.schema;
|
|
1791
|
+
button.dataset.table = item.name;
|
|
1792
|
+
button.textContent = `${item.schema}.${item.name}`;
|
|
1793
|
+
tables.append(button);
|
|
1794
|
+
}
|
|
1795
|
+
};
|
|
1796
|
+
tables.addEventListener("click", (event) => {
|
|
1797
|
+
const target = event.target;
|
|
1798
|
+
if (!(target instanceof Element))
|
|
1799
|
+
return;
|
|
1800
|
+
const button = target.closest("button");
|
|
1801
|
+
if (!(button instanceof HTMLButtonElement))
|
|
1802
|
+
return;
|
|
1803
|
+
const schema = button.dataset.schema;
|
|
1804
|
+
const name = button.dataset.table;
|
|
1805
|
+
if (schema === void 0 || name === void 0)
|
|
1806
|
+
return;
|
|
1807
|
+
clearError();
|
|
1808
|
+
loadPage(schema, name).catch(showError);
|
|
1809
|
+
});
|
|
1810
|
+
run.addEventListener("click", () => {
|
|
1811
|
+
const sql = input.value.trim();
|
|
1812
|
+
if (sql === "") {
|
|
1813
|
+
showError(new Error("Enter a statement"));
|
|
1814
|
+
return;
|
|
1815
|
+
}
|
|
1816
|
+
clearError();
|
|
1817
|
+
api.send("POST", "/sql/query", { sql }).then((payload) => {
|
|
1818
|
+
const rows = rowsOf(payload);
|
|
1819
|
+
renderGrid(columnsOf(payload, rows), rows);
|
|
1820
|
+
const count = isRecord2(payload) && typeof payload.rowCount === "number" ? payload.rowCount : rows.length;
|
|
1821
|
+
const truncated = isRecord2(payload) && payload.truncated === true ? " (truncated)" : "";
|
|
1822
|
+
result.textContent = `${count} rows${truncated}`;
|
|
1823
|
+
}).catch(showError);
|
|
1824
|
+
});
|
|
1825
|
+
const namespace = document.getElementById("namespace");
|
|
1826
|
+
if (namespace) {
|
|
1827
|
+
namespace.addEventListener("change", () => {
|
|
1828
|
+
clearError();
|
|
1829
|
+
loadTables().catch(showError);
|
|
1830
|
+
});
|
|
1831
|
+
}
|
|
1832
|
+
loadTables().catch(showError);
|
|
1833
|
+
}
|
|
1673
1834
|
function bootAdmin(config) {
|
|
1674
1835
|
const fieldKinds = ["string", "number", "boolean", "null", "object", "array", "unknown"];
|
|
1675
1836
|
const sources = ["declared", "inferred", "mixed"];
|
|
@@ -2110,6 +2271,50 @@ function bootAdmin(config) {
|
|
|
2110
2271
|
if (render)
|
|
2111
2272
|
await render();
|
|
2112
2273
|
}
|
|
2274
|
+
const delay = (ms) => new Promise((resolve) => {
|
|
2275
|
+
window.setTimeout(resolve, ms);
|
|
2276
|
+
});
|
|
2277
|
+
const confirmAction = async (button, pending, done, work) => {
|
|
2278
|
+
if (button.dataset.pending === "1")
|
|
2279
|
+
return;
|
|
2280
|
+
const label = button.textContent ?? "";
|
|
2281
|
+
const width = button.offsetWidth;
|
|
2282
|
+
button.dataset.pending = "1";
|
|
2283
|
+
button.classList.add("pressed");
|
|
2284
|
+
button.setAttribute("aria-busy", "true");
|
|
2285
|
+
button.style.minWidth = `${width}px`;
|
|
2286
|
+
button.textContent = pending;
|
|
2287
|
+
try {
|
|
2288
|
+
await work();
|
|
2289
|
+
button.textContent = done;
|
|
2290
|
+
await delay(1e3);
|
|
2291
|
+
} catch (error) {
|
|
2292
|
+
showError(error);
|
|
2293
|
+
} finally {
|
|
2294
|
+
button.textContent = label;
|
|
2295
|
+
button.style.minWidth = "";
|
|
2296
|
+
button.classList.remove("pressed");
|
|
2297
|
+
button.removeAttribute("aria-busy");
|
|
2298
|
+
delete button.dataset.pending;
|
|
2299
|
+
}
|
|
2300
|
+
};
|
|
2301
|
+
document.addEventListener("click", (event) => {
|
|
2302
|
+
const target = event.target;
|
|
2303
|
+
if (!(target instanceof Element))
|
|
2304
|
+
return;
|
|
2305
|
+
const button = target.closest("button");
|
|
2306
|
+
if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
|
|
2307
|
+
return;
|
|
2308
|
+
button.classList.add("pressed");
|
|
2309
|
+
const token = String(Date.now());
|
|
2310
|
+
button.dataset.press = token;
|
|
2311
|
+
window.setTimeout(() => {
|
|
2312
|
+
if (button.dataset.press !== token || button.dataset.pending === "1")
|
|
2313
|
+
return;
|
|
2314
|
+
button.classList.remove("pressed");
|
|
2315
|
+
delete button.dataset.press;
|
|
2316
|
+
}, 450);
|
|
2317
|
+
});
|
|
2113
2318
|
el("namespace", HTMLSelectElement).addEventListener("change", () => {
|
|
2114
2319
|
state.namespace = el("namespace", HTMLSelectElement).value;
|
|
2115
2320
|
refresh().catch(showError);
|
|
@@ -2120,7 +2325,7 @@ function bootAdmin(config) {
|
|
|
2120
2325
|
refresh().catch(showError);
|
|
2121
2326
|
});
|
|
2122
2327
|
el("refresh", HTMLButtonElement).addEventListener("click", () => {
|
|
2123
|
-
refresh().catch(showError);
|
|
2328
|
+
confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
|
|
2124
2329
|
});
|
|
2125
2330
|
el("collections", HTMLElement).addEventListener("click", (event) => {
|
|
2126
2331
|
const target = event.target;
|
|
@@ -2243,10 +2448,10 @@ function bootAdmin(config) {
|
|
|
2243
2448
|
}).then(() => renderFaults()).catch(showError);
|
|
2244
2449
|
});
|
|
2245
2450
|
el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2246
|
-
api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
|
|
2451
|
+
confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
|
|
2247
2452
|
});
|
|
2248
2453
|
el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2249
|
-
api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
|
|
2454
|
+
confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
|
|
2250
2455
|
});
|
|
2251
2456
|
el("route-list", HTMLElement).addEventListener("click", (event) => {
|
|
2252
2457
|
const target = event.target;
|
|
@@ -2302,6 +2507,22 @@ function bootAdmin(config) {
|
|
|
2302
2507
|
panel.script = value.script;
|
|
2303
2508
|
return panel;
|
|
2304
2509
|
};
|
|
2510
|
+
const decodeExtension = (value) => {
|
|
2511
|
+
if (!isRecord2(value))
|
|
2512
|
+
return void 0;
|
|
2513
|
+
if (value.kind === "sql") {
|
|
2514
|
+
return {
|
|
2515
|
+
kind: "sql",
|
|
2516
|
+
id: typeof value.id === "string" && value.id !== "" ? value.id : "sql",
|
|
2517
|
+
title: typeof value.title === "string" && value.title !== "" ? value.title : "SQL",
|
|
2518
|
+
description: typeof value.description === "string" ? value.description : "Browse tables and run queries."
|
|
2519
|
+
};
|
|
2520
|
+
}
|
|
2521
|
+
if (value.kind !== "panel")
|
|
2522
|
+
return void 0;
|
|
2523
|
+
const panel = decodePanel(value);
|
|
2524
|
+
return panel === void 0 ? void 0 : { kind: "panel", ...panel };
|
|
2525
|
+
};
|
|
2305
2526
|
const mountPanels = (panels) => {
|
|
2306
2527
|
const nav = el("nav", HTMLElement);
|
|
2307
2528
|
const views = el("views", HTMLElement);
|
|
@@ -2355,15 +2576,57 @@ function bootAdmin(config) {
|
|
|
2355
2576
|
return decoded === void 0 ? [] : [decoded];
|
|
2356
2577
|
});
|
|
2357
2578
|
mountPanels(panels);
|
|
2579
|
+
const extensions = requireList(isRecord2(manifest) ? manifest.extensions : void 0, "Extensions").flatMap((extension) => {
|
|
2580
|
+
const decoded = decodeExtension(extension);
|
|
2581
|
+
return decoded === void 0 ? [] : [decoded];
|
|
2582
|
+
});
|
|
2583
|
+
const extensionPanels = extensions.flatMap((extension) => extension.kind === "panel" ? [extension] : []);
|
|
2584
|
+
mountPanels(extensionPanels);
|
|
2585
|
+
for (const extension of extensions) {
|
|
2586
|
+
if (extension.kind !== "sql")
|
|
2587
|
+
continue;
|
|
2588
|
+
const nav = el("nav", HTMLElement);
|
|
2589
|
+
const views = el("views", HTMLElement);
|
|
2590
|
+
const button = document.createElement("button");
|
|
2591
|
+
button.type = "button";
|
|
2592
|
+
button.dataset.view = extension.id;
|
|
2593
|
+
button.textContent = extension.title;
|
|
2594
|
+
nav.append(button);
|
|
2595
|
+
const section = document.createElement("section");
|
|
2596
|
+
section.className = "view";
|
|
2597
|
+
section.id = `view-${extension.id}`;
|
|
2598
|
+
section.hidden = true;
|
|
2599
|
+
const title = document.createElement("h2");
|
|
2600
|
+
title.textContent = extension.title;
|
|
2601
|
+
const lede = document.createElement("p");
|
|
2602
|
+
lede.className = "lede";
|
|
2603
|
+
lede.textContent = extension.description;
|
|
2604
|
+
const body = document.createElement("div");
|
|
2605
|
+
body.className = "panel-body";
|
|
2606
|
+
section.append(title, lede, body);
|
|
2607
|
+
views.append(section);
|
|
2608
|
+
mountSqlExplorer(body, panelApi);
|
|
2609
|
+
}
|
|
2358
2610
|
return refresh();
|
|
2359
2611
|
}).catch(showError);
|
|
2360
2612
|
}
|
|
2361
|
-
var clientPrelude = [
|
|
2613
|
+
var clientPrelude = [
|
|
2614
|
+
isRecord2,
|
|
2615
|
+
mountAdminBrand,
|
|
2616
|
+
startAdminBrand,
|
|
2617
|
+
faultPresetList,
|
|
2618
|
+
mountSqlExplorer,
|
|
2619
|
+
bootAdmin
|
|
2620
|
+
].map((fn) => fn.toString()).join("\n");
|
|
2362
2621
|
var adminClientSource = (config) => {
|
|
2363
2622
|
const payload = JSON.stringify(config).replace(/</g, "\\u003c");
|
|
2623
|
+
const entry = bootAdmin.name;
|
|
2624
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
|
|
2625
|
+
throw new Error("admin client cannot call its boot function");
|
|
2626
|
+
}
|
|
2364
2627
|
return `<script>
|
|
2365
2628
|
${clientPrelude}
|
|
2366
|
-
|
|
2629
|
+
${entry}(${payload});
|
|
2367
2630
|
</script>`;
|
|
2368
2631
|
};
|
|
2369
2632
|
|
|
@@ -2404,19 +2667,33 @@ var STANDARD_ADMIN_ROUTES = [
|
|
|
2404
2667
|
"GET /ui/manifest"
|
|
2405
2668
|
];
|
|
2406
2669
|
var PANEL_ID = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
|
|
2670
|
+
var RESERVED_VIEWS = /* @__PURE__ */ new Set(["overview", "state", "clock", "faults", "journal", "routes"]);
|
|
2671
|
+
var checkPanel = (panel, seen, label) => {
|
|
2672
|
+
if (!PANEL_ID.test(panel.id)) {
|
|
2673
|
+
throw new RangeError(`${label} id must match ${PANEL_ID}: ${JSON.stringify(panel.id)}`);
|
|
2674
|
+
}
|
|
2675
|
+
if (RESERVED_VIEWS.has(panel.id)) {
|
|
2676
|
+
throw new RangeError(`${label} id ${panel.id} is reserved by the admin shell`);
|
|
2677
|
+
}
|
|
2678
|
+
if (seen.has(panel.id))
|
|
2679
|
+
throw new RangeError(`duplicate admin view id ${panel.id}`);
|
|
2680
|
+
seen.add(panel.id);
|
|
2681
|
+
if (panel.title.trim() === "")
|
|
2682
|
+
throw new RangeError(`${label} ${panel.id} needs a title`);
|
|
2683
|
+
};
|
|
2407
2684
|
var assertAdminUi = (ui) => {
|
|
2408
|
-
if (!ui
|
|
2685
|
+
if (!ui)
|
|
2409
2686
|
return;
|
|
2410
2687
|
const seen = /* @__PURE__ */ new Set();
|
|
2411
|
-
for (const panel of ui.panels)
|
|
2412
|
-
|
|
2413
|
-
|
|
2688
|
+
for (const panel of ui.panels ?? [])
|
|
2689
|
+
checkPanel(panel, seen, "admin panel");
|
|
2690
|
+
for (const extension of ui.extensions ?? []) {
|
|
2691
|
+
if (extension.kind === "panel") {
|
|
2692
|
+
checkPanel(extension, seen, "admin extension");
|
|
2693
|
+
continue;
|
|
2414
2694
|
}
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
seen.add(panel.id);
|
|
2418
|
-
if (panel.title.trim() === "")
|
|
2419
|
-
throw new RangeError(`admin panel ${panel.id} needs a title`);
|
|
2695
|
+
const id = extension.id ?? "sql";
|
|
2696
|
+
checkPanel({ id, title: extension.title ?? "SQL" }, seen, "admin extension");
|
|
2420
2697
|
}
|
|
2421
2698
|
};
|
|
2422
2699
|
|
|
@@ -2577,9 +2854,24 @@ var renderAdminDocument = (service) => {
|
|
|
2577
2854
|
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
|
2578
2855
|
label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
|
|
2579
2856
|
label.field input, label.field select, .controls input[type="password"] {
|
|
2580
|
-
background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
2581
|
-
padding: 7px 8px; min-height: 36px;
|
|
2582
|
-
}
|
|
2857
|
+
background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
2858
|
+
padding: 7px 8px; min-height: 36px; line-height: 1.2;
|
|
2859
|
+
}
|
|
2860
|
+
/* A native menu ignores min-height, so Preset rendered about half as tall as
|
|
2861
|
+
the text fields in the same form. Paint it like those fields. */
|
|
2862
|
+
label.field select {
|
|
2863
|
+
-webkit-appearance: none; appearance: none;
|
|
2864
|
+
padding-right: 28px;
|
|
2865
|
+
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");
|
|
2866
|
+
background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
|
|
2867
|
+
}
|
|
2868
|
+
.stack > .field > input,
|
|
2869
|
+
.stack > .field > select,
|
|
2870
|
+
.stack > .field > textarea,
|
|
2871
|
+
dialog .field > input,
|
|
2872
|
+
dialog .field > select,
|
|
2873
|
+
dialog .field > textarea { width: 100%; }
|
|
2874
|
+
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
|
|
2583
2875
|
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
|
|
2584
2876
|
border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
|
|
2585
2877
|
background: var(--bg-elev);
|
|
@@ -2587,6 +2879,14 @@ var renderAdminDocument = (service) => {
|
|
|
2587
2879
|
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
|
|
2588
2880
|
.btn-quiet { background: transparent; }
|
|
2589
2881
|
.btn-danger { color: var(--err); }
|
|
2882
|
+
/* Held after mouseup. Clearing an empty journal changes nothing on screen,
|
|
2883
|
+
so the press itself has to stay visible. */
|
|
2884
|
+
.icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
|
|
2885
|
+
.icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
|
|
2886
|
+
background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
|
|
2887
|
+
}
|
|
2888
|
+
.btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
|
|
2889
|
+
.btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
|
|
2590
2890
|
/* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
|
|
2591
2891
|
record or the full nav row would widen the page past the viewport. */
|
|
2592
2892
|
.layout {
|
|
@@ -2627,6 +2927,12 @@ var renderAdminDocument = (service) => {
|
|
|
2627
2927
|
border-radius: 999px; padding: 4px 8px;
|
|
2628
2928
|
}
|
|
2629
2929
|
.chip i { color: var(--faint); font-style: normal; }
|
|
2930
|
+
.sql-layout {
|
|
2931
|
+
display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 16px;
|
|
2932
|
+
}
|
|
2933
|
+
.sql-tables { display: flex; flex-direction: column; gap: 4px; max-height: 28rem; overflow: auto; }
|
|
2934
|
+
.sql-tables button { text-align: left; }
|
|
2935
|
+
.sql-input { font-family: var(--mono); min-height: 7rem; width: 100%; }
|
|
2630
2936
|
table { width: 100%; border-collapse: collapse; font-size: 14px; }
|
|
2631
2937
|
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
|
|
2632
2938
|
th { color: var(--faint); font-weight: 600; font-size: 12px; }
|
|
@@ -2675,14 +2981,22 @@ var renderAdminDocument = (service) => {
|
|
|
2675
2981
|
input, select, textarea { font-size: 16px; }
|
|
2676
2982
|
.brand, .vendor, .controls { width: 100%; }
|
|
2677
2983
|
label.field, label.field select, label.field input { flex: 1; min-width: 0; }
|
|
2678
|
-
|
|
2984
|
+
/* The layout fills the screen. A single-column grid stretches every auto
|
|
2985
|
+
row, so the tab bar grew with the leftover height and the buttons floated
|
|
2986
|
+
in the middle of it. The bar stays one row; the page below takes the rest. */
|
|
2987
|
+
.layout {
|
|
2988
|
+
grid-template-columns: minmax(0, 1fr);
|
|
2989
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
2990
|
+
align-content: start;
|
|
2991
|
+
}
|
|
2679
2992
|
nav.side {
|
|
2993
|
+
align-self: start; height: auto;
|
|
2680
2994
|
flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
|
|
2681
2995
|
border-right: 0; border-bottom: 1px solid var(--line);
|
|
2682
2996
|
padding: 8px;
|
|
2683
2997
|
}
|
|
2684
2998
|
nav.side button { white-space: nowrap; flex: none; }
|
|
2685
|
-
.split { grid-template-columns: minmax(0, 1fr); }
|
|
2999
|
+
.split, .sql-layout { grid-template-columns: minmax(0, 1fr); }
|
|
2686
3000
|
main { padding: 14px; }
|
|
2687
3001
|
table, thead, tbody, tr, th, td { display: block; }
|
|
2688
3002
|
thead { display: none; }
|
|
@@ -2853,6 +3167,24 @@ var json2 = (body) => new Response(JSON.stringify(body), {
|
|
|
2853
3167
|
status: 200,
|
|
2854
3168
|
headers: { "content-type": "application/json; charset=utf-8" }
|
|
2855
3169
|
});
|
|
3170
|
+
var describeExtension = (extension) => {
|
|
3171
|
+
if (extension.kind === "sql") {
|
|
3172
|
+
return {
|
|
3173
|
+
kind: "sql",
|
|
3174
|
+
id: extension.id ?? "sql",
|
|
3175
|
+
title: extension.title ?? "SQL",
|
|
3176
|
+
...extension.description !== void 0 ? { description: extension.description } : {}
|
|
3177
|
+
};
|
|
3178
|
+
}
|
|
3179
|
+
return {
|
|
3180
|
+
kind: "panel",
|
|
3181
|
+
id: extension.id,
|
|
3182
|
+
title: extension.title,
|
|
3183
|
+
...extension.description !== void 0 ? { description: extension.description } : {},
|
|
3184
|
+
html: extension.html,
|
|
3185
|
+
...extension.script !== void 0 ? { script: extension.script } : {}
|
|
3186
|
+
};
|
|
3187
|
+
};
|
|
2856
3188
|
var adminUiRoutes = (service, ui) => {
|
|
2857
3189
|
const shell = () => renderAdminDocument(service);
|
|
2858
3190
|
const document3 = () => ui?.render ? ui.render({ service, defaultHtml: shell }) : shell();
|
|
@@ -2867,7 +3199,8 @@ var adminUiRoutes = (service, ui) => {
|
|
|
2867
3199
|
...panel.description !== void 0 ? { description: panel.description } : {},
|
|
2868
3200
|
html: panel.html,
|
|
2869
3201
|
...panel.script !== void 0 ? { script: panel.script } : {}
|
|
2870
|
-
}))
|
|
3202
|
+
})),
|
|
3203
|
+
extensions: (ui?.extensions ?? []).map(describeExtension)
|
|
2871
3204
|
})
|
|
2872
3205
|
};
|
|
2873
3206
|
};
|
|
@@ -3470,7 +3803,7 @@ var stateAdminRoutes = (routes) => {
|
|
|
3470
3803
|
};
|
|
3471
3804
|
|
|
3472
3805
|
// ../core/dist/version.js
|
|
3473
|
-
var PACKAGE_VERSION = true ? "1.
|
|
3806
|
+
var PACKAGE_VERSION = true ? "1.7.0" : UNRELEASED_VERSION;
|
|
3474
3807
|
|
|
3475
3808
|
// ../core/dist/webhooks.js
|
|
3476
3809
|
var json4 = (status, body) => new Response(JSON.stringify(body), { status, headers: { "content-type": "application/json" } });
|
|
@@ -4637,4 +4970,4 @@ export {
|
|
|
4637
4970
|
compileWhere,
|
|
4638
4971
|
PayloadCmsAPI
|
|
4639
4972
|
};
|
|
4640
|
-
//# sourceMappingURL=chunk-
|
|
4973
|
+
//# sourceMappingURL=chunk-GLSGZ74L.js.map
|