@crvouga/mockingbird-service-posthog 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-2X5264I2.js → chunk-IZLY3267.js} +355 -22
- package/dist/chunk-IZLY3267.js.map +7 -0
- package/dist/{chunk-Q3FOVA2A.js → chunk-IZQTAJ72.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-2X5264I2.js.map +0 -7
- /package/dist/{chunk-Q3FOVA2A.js.map → chunk-IZQTAJ72.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-posthog
|
|
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
|
|
|
@@ -1682,6 +1682,167 @@ function faultPresetList(value) {
|
|
|
1682
1682
|
})
|
|
1683
1683
|
};
|
|
1684
1684
|
}
|
|
1685
|
+
function mountSqlExplorer(root, api) {
|
|
1686
|
+
const cell = (value) => {
|
|
1687
|
+
if (value === null || value === void 0)
|
|
1688
|
+
return "";
|
|
1689
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
1690
|
+
return String(value);
|
|
1691
|
+
}
|
|
1692
|
+
return JSON.stringify(value) ?? "";
|
|
1693
|
+
};
|
|
1694
|
+
root.replaceChildren();
|
|
1695
|
+
const layout = document.createElement("div");
|
|
1696
|
+
layout.className = "sql-layout";
|
|
1697
|
+
const tables = document.createElement("div");
|
|
1698
|
+
tables.className = "sql-tables";
|
|
1699
|
+
const stack = document.createElement("div");
|
|
1700
|
+
stack.className = "stack";
|
|
1701
|
+
const banner = document.createElement("p");
|
|
1702
|
+
banner.className = "banner";
|
|
1703
|
+
const grid = document.createElement("div");
|
|
1704
|
+
const input = document.createElement("textarea");
|
|
1705
|
+
input.className = "sql-input";
|
|
1706
|
+
input.spellcheck = false;
|
|
1707
|
+
input.placeholder = "SELECT * FROM ...";
|
|
1708
|
+
const actions = document.createElement("div");
|
|
1709
|
+
actions.className = "row-actions";
|
|
1710
|
+
const run = document.createElement("button");
|
|
1711
|
+
run.type = "button";
|
|
1712
|
+
run.textContent = "Run";
|
|
1713
|
+
actions.append(run);
|
|
1714
|
+
const result = document.createElement("pre");
|
|
1715
|
+
stack.append(banner, grid, input, actions, result);
|
|
1716
|
+
layout.append(tables, stack);
|
|
1717
|
+
root.append(layout);
|
|
1718
|
+
const showError = (error2) => {
|
|
1719
|
+
banner.textContent = error2 instanceof Error ? error2.message : String(error2);
|
|
1720
|
+
banner.classList.add("show");
|
|
1721
|
+
};
|
|
1722
|
+
const clearError = () => {
|
|
1723
|
+
banner.textContent = "";
|
|
1724
|
+
banner.classList.remove("show");
|
|
1725
|
+
};
|
|
1726
|
+
const renderGrid = (columns, rows) => {
|
|
1727
|
+
grid.replaceChildren();
|
|
1728
|
+
if (columns.length === 0) {
|
|
1729
|
+
const empty = document.createElement("p");
|
|
1730
|
+
empty.className = "empty";
|
|
1731
|
+
empty.textContent = "No rows.";
|
|
1732
|
+
grid.append(empty);
|
|
1733
|
+
return;
|
|
1734
|
+
}
|
|
1735
|
+
const table = document.createElement("table");
|
|
1736
|
+
const head = document.createElement("thead");
|
|
1737
|
+
const headRow = document.createElement("tr");
|
|
1738
|
+
for (const column of columns) {
|
|
1739
|
+
const th = document.createElement("th");
|
|
1740
|
+
th.textContent = column;
|
|
1741
|
+
headRow.append(th);
|
|
1742
|
+
}
|
|
1743
|
+
head.append(headRow);
|
|
1744
|
+
const body = document.createElement("tbody");
|
|
1745
|
+
for (const row of rows) {
|
|
1746
|
+
const tr = document.createElement("tr");
|
|
1747
|
+
for (const column of columns) {
|
|
1748
|
+
const td = document.createElement("td");
|
|
1749
|
+
td.dataset.label = column;
|
|
1750
|
+
td.textContent = cell(row[column]);
|
|
1751
|
+
tr.append(td);
|
|
1752
|
+
}
|
|
1753
|
+
body.append(tr);
|
|
1754
|
+
}
|
|
1755
|
+
table.append(head, body);
|
|
1756
|
+
grid.append(table);
|
|
1757
|
+
};
|
|
1758
|
+
const rowsOf = (value) => {
|
|
1759
|
+
if (!isRecord2(value) || !Array.isArray(value.rows))
|
|
1760
|
+
return [];
|
|
1761
|
+
return value.rows.flatMap((row) => isRecord2(row) ? [row] : []);
|
|
1762
|
+
};
|
|
1763
|
+
const columnsOf = (value, rows) => {
|
|
1764
|
+
if (isRecord2(value) && Array.isArray(value.columns)) {
|
|
1765
|
+
const named = value.columns.flatMap((column) => typeof column === "string" ? [column] : []);
|
|
1766
|
+
if (named.length > 0)
|
|
1767
|
+
return named;
|
|
1768
|
+
}
|
|
1769
|
+
const first = rows[0];
|
|
1770
|
+
return first === void 0 ? [] : Object.keys(first);
|
|
1771
|
+
};
|
|
1772
|
+
let selected = "";
|
|
1773
|
+
const loadPage = async (schema, name) => {
|
|
1774
|
+
selected = `${schema}.${name}`;
|
|
1775
|
+
const page = await api.get(`/sql/tables/${encodeURIComponent(schema)}/${encodeURIComponent(name)}?limit=50`);
|
|
1776
|
+
const rows = rowsOf(page);
|
|
1777
|
+
renderGrid(columnsOf(page, rows), rows);
|
|
1778
|
+
const total = isRecord2(page) && typeof page.total === "number" ? page.total : rows.length;
|
|
1779
|
+
result.textContent = `${selected} \xB7 ${total} rows`;
|
|
1780
|
+
for (const button of tables.querySelectorAll("button")) {
|
|
1781
|
+
if (!(button instanceof HTMLButtonElement))
|
|
1782
|
+
continue;
|
|
1783
|
+
button.setAttribute("aria-current", button.dataset.schema === schema && button.dataset.table === name ? "true" : "false");
|
|
1784
|
+
}
|
|
1785
|
+
};
|
|
1786
|
+
const loadTables = async () => {
|
|
1787
|
+
const payload = await api.get("/sql/tables");
|
|
1788
|
+
const listed = isRecord2(payload) && Array.isArray(payload.tables) ? payload.tables : [];
|
|
1789
|
+
tables.replaceChildren();
|
|
1790
|
+
if (listed.length === 0) {
|
|
1791
|
+
const empty = document.createElement("p");
|
|
1792
|
+
empty.className = "empty";
|
|
1793
|
+
empty.textContent = "No tables.";
|
|
1794
|
+
tables.append(empty);
|
|
1795
|
+
return;
|
|
1796
|
+
}
|
|
1797
|
+
for (const item of listed) {
|
|
1798
|
+
if (!isRecord2(item) || typeof item.schema !== "string" || typeof item.name !== "string")
|
|
1799
|
+
continue;
|
|
1800
|
+
const button = document.createElement("button");
|
|
1801
|
+
button.type = "button";
|
|
1802
|
+
button.dataset.schema = item.schema;
|
|
1803
|
+
button.dataset.table = item.name;
|
|
1804
|
+
button.textContent = `${item.schema}.${item.name}`;
|
|
1805
|
+
tables.append(button);
|
|
1806
|
+
}
|
|
1807
|
+
};
|
|
1808
|
+
tables.addEventListener("click", (event) => {
|
|
1809
|
+
const target = event.target;
|
|
1810
|
+
if (!(target instanceof Element))
|
|
1811
|
+
return;
|
|
1812
|
+
const button = target.closest("button");
|
|
1813
|
+
if (!(button instanceof HTMLButtonElement))
|
|
1814
|
+
return;
|
|
1815
|
+
const schema = button.dataset.schema;
|
|
1816
|
+
const name = button.dataset.table;
|
|
1817
|
+
if (schema === void 0 || name === void 0)
|
|
1818
|
+
return;
|
|
1819
|
+
clearError();
|
|
1820
|
+
loadPage(schema, name).catch(showError);
|
|
1821
|
+
});
|
|
1822
|
+
run.addEventListener("click", () => {
|
|
1823
|
+
const sql = input.value.trim();
|
|
1824
|
+
if (sql === "") {
|
|
1825
|
+
showError(new Error("Enter a statement"));
|
|
1826
|
+
return;
|
|
1827
|
+
}
|
|
1828
|
+
clearError();
|
|
1829
|
+
api.send("POST", "/sql/query", { sql }).then((payload) => {
|
|
1830
|
+
const rows = rowsOf(payload);
|
|
1831
|
+
renderGrid(columnsOf(payload, rows), rows);
|
|
1832
|
+
const count = isRecord2(payload) && typeof payload.rowCount === "number" ? payload.rowCount : rows.length;
|
|
1833
|
+
const truncated = isRecord2(payload) && payload.truncated === true ? " (truncated)" : "";
|
|
1834
|
+
result.textContent = `${count} rows${truncated}`;
|
|
1835
|
+
}).catch(showError);
|
|
1836
|
+
});
|
|
1837
|
+
const namespace = document.getElementById("namespace");
|
|
1838
|
+
if (namespace) {
|
|
1839
|
+
namespace.addEventListener("change", () => {
|
|
1840
|
+
clearError();
|
|
1841
|
+
loadTables().catch(showError);
|
|
1842
|
+
});
|
|
1843
|
+
}
|
|
1844
|
+
loadTables().catch(showError);
|
|
1845
|
+
}
|
|
1685
1846
|
function bootAdmin(config) {
|
|
1686
1847
|
const fieldKinds = ["string", "number", "boolean", "null", "object", "array", "unknown"];
|
|
1687
1848
|
const sources = ["declared", "inferred", "mixed"];
|
|
@@ -2122,6 +2283,50 @@ function bootAdmin(config) {
|
|
|
2122
2283
|
if (render)
|
|
2123
2284
|
await render();
|
|
2124
2285
|
}
|
|
2286
|
+
const delay = (ms) => new Promise((resolve) => {
|
|
2287
|
+
window.setTimeout(resolve, ms);
|
|
2288
|
+
});
|
|
2289
|
+
const confirmAction = async (button, pending, done, work) => {
|
|
2290
|
+
if (button.dataset.pending === "1")
|
|
2291
|
+
return;
|
|
2292
|
+
const label = button.textContent ?? "";
|
|
2293
|
+
const width = button.offsetWidth;
|
|
2294
|
+
button.dataset.pending = "1";
|
|
2295
|
+
button.classList.add("pressed");
|
|
2296
|
+
button.setAttribute("aria-busy", "true");
|
|
2297
|
+
button.style.minWidth = `${width}px`;
|
|
2298
|
+
button.textContent = pending;
|
|
2299
|
+
try {
|
|
2300
|
+
await work();
|
|
2301
|
+
button.textContent = done;
|
|
2302
|
+
await delay(1e3);
|
|
2303
|
+
} catch (error2) {
|
|
2304
|
+
showError(error2);
|
|
2305
|
+
} finally {
|
|
2306
|
+
button.textContent = label;
|
|
2307
|
+
button.style.minWidth = "";
|
|
2308
|
+
button.classList.remove("pressed");
|
|
2309
|
+
button.removeAttribute("aria-busy");
|
|
2310
|
+
delete button.dataset.pending;
|
|
2311
|
+
}
|
|
2312
|
+
};
|
|
2313
|
+
document.addEventListener("click", (event) => {
|
|
2314
|
+
const target = event.target;
|
|
2315
|
+
if (!(target instanceof Element))
|
|
2316
|
+
return;
|
|
2317
|
+
const button = target.closest("button");
|
|
2318
|
+
if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
|
|
2319
|
+
return;
|
|
2320
|
+
button.classList.add("pressed");
|
|
2321
|
+
const token = String(Date.now());
|
|
2322
|
+
button.dataset.press = token;
|
|
2323
|
+
window.setTimeout(() => {
|
|
2324
|
+
if (button.dataset.press !== token || button.dataset.pending === "1")
|
|
2325
|
+
return;
|
|
2326
|
+
button.classList.remove("pressed");
|
|
2327
|
+
delete button.dataset.press;
|
|
2328
|
+
}, 450);
|
|
2329
|
+
});
|
|
2125
2330
|
el("namespace", HTMLSelectElement).addEventListener("change", () => {
|
|
2126
2331
|
state.namespace = el("namespace", HTMLSelectElement).value;
|
|
2127
2332
|
refresh().catch(showError);
|
|
@@ -2132,7 +2337,7 @@ function bootAdmin(config) {
|
|
|
2132
2337
|
refresh().catch(showError);
|
|
2133
2338
|
});
|
|
2134
2339
|
el("refresh", HTMLButtonElement).addEventListener("click", () => {
|
|
2135
|
-
refresh().catch(showError);
|
|
2340
|
+
confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
|
|
2136
2341
|
});
|
|
2137
2342
|
el("collections", HTMLElement).addEventListener("click", (event) => {
|
|
2138
2343
|
const target = event.target;
|
|
@@ -2255,10 +2460,10 @@ function bootAdmin(config) {
|
|
|
2255
2460
|
}).then(() => renderFaults()).catch(showError);
|
|
2256
2461
|
});
|
|
2257
2462
|
el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2258
|
-
api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
|
|
2463
|
+
confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
|
|
2259
2464
|
});
|
|
2260
2465
|
el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2261
|
-
api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
|
|
2466
|
+
confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
|
|
2262
2467
|
});
|
|
2263
2468
|
el("route-list", HTMLElement).addEventListener("click", (event) => {
|
|
2264
2469
|
const target = event.target;
|
|
@@ -2314,6 +2519,22 @@ function bootAdmin(config) {
|
|
|
2314
2519
|
panel.script = value.script;
|
|
2315
2520
|
return panel;
|
|
2316
2521
|
};
|
|
2522
|
+
const decodeExtension = (value) => {
|
|
2523
|
+
if (!isRecord2(value))
|
|
2524
|
+
return void 0;
|
|
2525
|
+
if (value.kind === "sql") {
|
|
2526
|
+
return {
|
|
2527
|
+
kind: "sql",
|
|
2528
|
+
id: typeof value.id === "string" && value.id !== "" ? value.id : "sql",
|
|
2529
|
+
title: typeof value.title === "string" && value.title !== "" ? value.title : "SQL",
|
|
2530
|
+
description: typeof value.description === "string" ? value.description : "Browse tables and run queries."
|
|
2531
|
+
};
|
|
2532
|
+
}
|
|
2533
|
+
if (value.kind !== "panel")
|
|
2534
|
+
return void 0;
|
|
2535
|
+
const panel = decodePanel(value);
|
|
2536
|
+
return panel === void 0 ? void 0 : { kind: "panel", ...panel };
|
|
2537
|
+
};
|
|
2317
2538
|
const mountPanels = (panels) => {
|
|
2318
2539
|
const nav = el("nav", HTMLElement);
|
|
2319
2540
|
const views = el("views", HTMLElement);
|
|
@@ -2367,15 +2588,57 @@ function bootAdmin(config) {
|
|
|
2367
2588
|
return decoded2 === void 0 ? [] : [decoded2];
|
|
2368
2589
|
});
|
|
2369
2590
|
mountPanels(panels);
|
|
2591
|
+
const extensions = requireList(isRecord2(manifest) ? manifest.extensions : void 0, "Extensions").flatMap((extension) => {
|
|
2592
|
+
const decoded2 = decodeExtension(extension);
|
|
2593
|
+
return decoded2 === void 0 ? [] : [decoded2];
|
|
2594
|
+
});
|
|
2595
|
+
const extensionPanels = extensions.flatMap((extension) => extension.kind === "panel" ? [extension] : []);
|
|
2596
|
+
mountPanels(extensionPanels);
|
|
2597
|
+
for (const extension of extensions) {
|
|
2598
|
+
if (extension.kind !== "sql")
|
|
2599
|
+
continue;
|
|
2600
|
+
const nav = el("nav", HTMLElement);
|
|
2601
|
+
const views = el("views", HTMLElement);
|
|
2602
|
+
const button = document.createElement("button");
|
|
2603
|
+
button.type = "button";
|
|
2604
|
+
button.dataset.view = extension.id;
|
|
2605
|
+
button.textContent = extension.title;
|
|
2606
|
+
nav.append(button);
|
|
2607
|
+
const section = document.createElement("section");
|
|
2608
|
+
section.className = "view";
|
|
2609
|
+
section.id = `view-${extension.id}`;
|
|
2610
|
+
section.hidden = true;
|
|
2611
|
+
const title = document.createElement("h2");
|
|
2612
|
+
title.textContent = extension.title;
|
|
2613
|
+
const lede = document.createElement("p");
|
|
2614
|
+
lede.className = "lede";
|
|
2615
|
+
lede.textContent = extension.description;
|
|
2616
|
+
const body = document.createElement("div");
|
|
2617
|
+
body.className = "panel-body";
|
|
2618
|
+
section.append(title, lede, body);
|
|
2619
|
+
views.append(section);
|
|
2620
|
+
mountSqlExplorer(body, panelApi);
|
|
2621
|
+
}
|
|
2370
2622
|
return refresh();
|
|
2371
2623
|
}).catch(showError);
|
|
2372
2624
|
}
|
|
2373
|
-
var clientPrelude = [
|
|
2625
|
+
var clientPrelude = [
|
|
2626
|
+
isRecord2,
|
|
2627
|
+
mountAdminBrand,
|
|
2628
|
+
startAdminBrand,
|
|
2629
|
+
faultPresetList,
|
|
2630
|
+
mountSqlExplorer,
|
|
2631
|
+
bootAdmin
|
|
2632
|
+
].map((fn) => fn.toString()).join("\n");
|
|
2374
2633
|
var adminClientSource = (config) => {
|
|
2375
2634
|
const payload = JSON.stringify(config).replace(/</g, "\\u003c");
|
|
2635
|
+
const entry = bootAdmin.name;
|
|
2636
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
|
|
2637
|
+
throw new Error("admin client cannot call its boot function");
|
|
2638
|
+
}
|
|
2376
2639
|
return `<script>
|
|
2377
2640
|
${clientPrelude}
|
|
2378
|
-
|
|
2641
|
+
${entry}(${payload});
|
|
2379
2642
|
</script>`;
|
|
2380
2643
|
};
|
|
2381
2644
|
|
|
@@ -2416,19 +2679,33 @@ var STANDARD_ADMIN_ROUTES = [
|
|
|
2416
2679
|
"GET /ui/manifest"
|
|
2417
2680
|
];
|
|
2418
2681
|
var PANEL_ID = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
|
|
2682
|
+
var RESERVED_VIEWS = /* @__PURE__ */ new Set(["overview", "state", "clock", "faults", "journal", "routes"]);
|
|
2683
|
+
var checkPanel = (panel, seen, label) => {
|
|
2684
|
+
if (!PANEL_ID.test(panel.id)) {
|
|
2685
|
+
throw new RangeError(`${label} id must match ${PANEL_ID}: ${JSON.stringify(panel.id)}`);
|
|
2686
|
+
}
|
|
2687
|
+
if (RESERVED_VIEWS.has(panel.id)) {
|
|
2688
|
+
throw new RangeError(`${label} id ${panel.id} is reserved by the admin shell`);
|
|
2689
|
+
}
|
|
2690
|
+
if (seen.has(panel.id))
|
|
2691
|
+
throw new RangeError(`duplicate admin view id ${panel.id}`);
|
|
2692
|
+
seen.add(panel.id);
|
|
2693
|
+
if (panel.title.trim() === "")
|
|
2694
|
+
throw new RangeError(`${label} ${panel.id} needs a title`);
|
|
2695
|
+
};
|
|
2419
2696
|
var assertAdminUi = (ui) => {
|
|
2420
|
-
if (!ui
|
|
2697
|
+
if (!ui)
|
|
2421
2698
|
return;
|
|
2422
2699
|
const seen = /* @__PURE__ */ new Set();
|
|
2423
|
-
for (const panel of ui.panels)
|
|
2424
|
-
|
|
2425
|
-
|
|
2700
|
+
for (const panel of ui.panels ?? [])
|
|
2701
|
+
checkPanel(panel, seen, "admin panel");
|
|
2702
|
+
for (const extension of ui.extensions ?? []) {
|
|
2703
|
+
if (extension.kind === "panel") {
|
|
2704
|
+
checkPanel(extension, seen, "admin extension");
|
|
2705
|
+
continue;
|
|
2426
2706
|
}
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
seen.add(panel.id);
|
|
2430
|
-
if (panel.title.trim() === "")
|
|
2431
|
-
throw new RangeError(`admin panel ${panel.id} needs a title`);
|
|
2707
|
+
const id = extension.id ?? "sql";
|
|
2708
|
+
checkPanel({ id, title: extension.title ?? "SQL" }, seen, "admin extension");
|
|
2432
2709
|
}
|
|
2433
2710
|
};
|
|
2434
2711
|
|
|
@@ -2589,9 +2866,24 @@ var renderAdminDocument = (service) => {
|
|
|
2589
2866
|
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
|
2590
2867
|
label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
|
|
2591
2868
|
label.field input, label.field select, .controls input[type="password"] {
|
|
2592
|
-
background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
2593
|
-
padding: 7px 8px; min-height: 36px;
|
|
2594
|
-
}
|
|
2869
|
+
background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
2870
|
+
padding: 7px 8px; min-height: 36px; line-height: 1.2;
|
|
2871
|
+
}
|
|
2872
|
+
/* A native menu ignores min-height, so Preset rendered about half as tall as
|
|
2873
|
+
the text fields in the same form. Paint it like those fields. */
|
|
2874
|
+
label.field select {
|
|
2875
|
+
-webkit-appearance: none; appearance: none;
|
|
2876
|
+
padding-right: 28px;
|
|
2877
|
+
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");
|
|
2878
|
+
background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
|
|
2879
|
+
}
|
|
2880
|
+
.stack > .field > input,
|
|
2881
|
+
.stack > .field > select,
|
|
2882
|
+
.stack > .field > textarea,
|
|
2883
|
+
dialog .field > input,
|
|
2884
|
+
dialog .field > select,
|
|
2885
|
+
dialog .field > textarea { width: 100%; }
|
|
2886
|
+
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
|
|
2595
2887
|
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
|
|
2596
2888
|
border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
|
|
2597
2889
|
background: var(--bg-elev);
|
|
@@ -2599,6 +2891,14 @@ var renderAdminDocument = (service) => {
|
|
|
2599
2891
|
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
|
|
2600
2892
|
.btn-quiet { background: transparent; }
|
|
2601
2893
|
.btn-danger { color: var(--err); }
|
|
2894
|
+
/* Held after mouseup. Clearing an empty journal changes nothing on screen,
|
|
2895
|
+
so the press itself has to stay visible. */
|
|
2896
|
+
.icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
|
|
2897
|
+
.icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
|
|
2898
|
+
background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
|
|
2899
|
+
}
|
|
2900
|
+
.btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
|
|
2901
|
+
.btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
|
|
2602
2902
|
/* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
|
|
2603
2903
|
record or the full nav row would widen the page past the viewport. */
|
|
2604
2904
|
.layout {
|
|
@@ -2639,6 +2939,12 @@ var renderAdminDocument = (service) => {
|
|
|
2639
2939
|
border-radius: 999px; padding: 4px 8px;
|
|
2640
2940
|
}
|
|
2641
2941
|
.chip i { color: var(--faint); font-style: normal; }
|
|
2942
|
+
.sql-layout {
|
|
2943
|
+
display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 16px;
|
|
2944
|
+
}
|
|
2945
|
+
.sql-tables { display: flex; flex-direction: column; gap: 4px; max-height: 28rem; overflow: auto; }
|
|
2946
|
+
.sql-tables button { text-align: left; }
|
|
2947
|
+
.sql-input { font-family: var(--mono); min-height: 7rem; width: 100%; }
|
|
2642
2948
|
table { width: 100%; border-collapse: collapse; font-size: 14px; }
|
|
2643
2949
|
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
|
|
2644
2950
|
th { color: var(--faint); font-weight: 600; font-size: 12px; }
|
|
@@ -2687,14 +2993,22 @@ var renderAdminDocument = (service) => {
|
|
|
2687
2993
|
input, select, textarea { font-size: 16px; }
|
|
2688
2994
|
.brand, .vendor, .controls { width: 100%; }
|
|
2689
2995
|
label.field, label.field select, label.field input { flex: 1; min-width: 0; }
|
|
2690
|
-
|
|
2996
|
+
/* The layout fills the screen. A single-column grid stretches every auto
|
|
2997
|
+
row, so the tab bar grew with the leftover height and the buttons floated
|
|
2998
|
+
in the middle of it. The bar stays one row; the page below takes the rest. */
|
|
2999
|
+
.layout {
|
|
3000
|
+
grid-template-columns: minmax(0, 1fr);
|
|
3001
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
3002
|
+
align-content: start;
|
|
3003
|
+
}
|
|
2691
3004
|
nav.side {
|
|
3005
|
+
align-self: start; height: auto;
|
|
2692
3006
|
flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
|
|
2693
3007
|
border-right: 0; border-bottom: 1px solid var(--line);
|
|
2694
3008
|
padding: 8px;
|
|
2695
3009
|
}
|
|
2696
3010
|
nav.side button { white-space: nowrap; flex: none; }
|
|
2697
|
-
.split { grid-template-columns: minmax(0, 1fr); }
|
|
3011
|
+
.split, .sql-layout { grid-template-columns: minmax(0, 1fr); }
|
|
2698
3012
|
main { padding: 14px; }
|
|
2699
3013
|
table, thead, tbody, tr, th, td { display: block; }
|
|
2700
3014
|
thead { display: none; }
|
|
@@ -2865,6 +3179,24 @@ var json2 = (body) => new Response(JSON.stringify(body), {
|
|
|
2865
3179
|
status: 200,
|
|
2866
3180
|
headers: { "content-type": "application/json; charset=utf-8" }
|
|
2867
3181
|
});
|
|
3182
|
+
var describeExtension = (extension) => {
|
|
3183
|
+
if (extension.kind === "sql") {
|
|
3184
|
+
return {
|
|
3185
|
+
kind: "sql",
|
|
3186
|
+
id: extension.id ?? "sql",
|
|
3187
|
+
title: extension.title ?? "SQL",
|
|
3188
|
+
...extension.description !== void 0 ? { description: extension.description } : {}
|
|
3189
|
+
};
|
|
3190
|
+
}
|
|
3191
|
+
return {
|
|
3192
|
+
kind: "panel",
|
|
3193
|
+
id: extension.id,
|
|
3194
|
+
title: extension.title,
|
|
3195
|
+
...extension.description !== void 0 ? { description: extension.description } : {},
|
|
3196
|
+
html: extension.html,
|
|
3197
|
+
...extension.script !== void 0 ? { script: extension.script } : {}
|
|
3198
|
+
};
|
|
3199
|
+
};
|
|
2868
3200
|
var adminUiRoutes = (service, ui) => {
|
|
2869
3201
|
const shell = () => renderAdminDocument(service);
|
|
2870
3202
|
const document3 = () => ui?.render ? ui.render({ service, defaultHtml: shell }) : shell();
|
|
@@ -2879,7 +3211,8 @@ var adminUiRoutes = (service, ui) => {
|
|
|
2879
3211
|
...panel.description !== void 0 ? { description: panel.description } : {},
|
|
2880
3212
|
html: panel.html,
|
|
2881
3213
|
...panel.script !== void 0 ? { script: panel.script } : {}
|
|
2882
|
-
}))
|
|
3214
|
+
})),
|
|
3215
|
+
extensions: (ui?.extensions ?? []).map(describeExtension)
|
|
2883
3216
|
})
|
|
2884
3217
|
};
|
|
2885
3218
|
};
|
|
@@ -3482,7 +3815,7 @@ var stateAdminRoutes = (routes) => {
|
|
|
3482
3815
|
};
|
|
3483
3816
|
|
|
3484
3817
|
// ../core/dist/version.js
|
|
3485
|
-
var PACKAGE_VERSION = true ? "1.
|
|
3818
|
+
var PACKAGE_VERSION = true ? "1.7.0" : UNRELEASED_VERSION;
|
|
3486
3819
|
|
|
3487
3820
|
// ../core/dist/signing.js
|
|
3488
3821
|
var encoder = new TextEncoder();
|
|
@@ -5153,4 +5486,4 @@ export {
|
|
|
5153
5486
|
scrubProperties,
|
|
5154
5487
|
PostHogAPI
|
|
5155
5488
|
};
|
|
5156
|
-
//# sourceMappingURL=chunk-
|
|
5489
|
+
//# sourceMappingURL=chunk-IZLY3267.js.map
|