@crvouga/mockingbird-service-customerio 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-YH4VUBB3.js → chunk-SZRCSAWA.js} +2 -2
- package/dist/{chunk-LKYGOY6Z.js → chunk-XHKPW7N3.js} +355 -22
- package/dist/chunk-XHKPW7N3.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-LKYGOY6Z.js.map +0 -7
- /package/dist/{chunk-YH4VUBB3.js.map → chunk-SZRCSAWA.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-customerio
|
|
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-XHKPW7N3.js";
|
|
4
4
|
|
|
5
5
|
// ../../adapters/node/dist/cli.js
|
|
6
6
|
import { readFile } from "node:fs/promises";
|
|
@@ -368,4 +368,4 @@ export {
|
|
|
368
368
|
createServer2 as createServer,
|
|
369
369
|
serveTarget
|
|
370
370
|
};
|
|
371
|
-
//# sourceMappingURL=chunk-
|
|
371
|
+
//# sourceMappingURL=chunk-SZRCSAWA.js.map
|
|
@@ -1960,6 +1960,167 @@ function faultPresetList(value) {
|
|
|
1960
1960
|
})
|
|
1961
1961
|
};
|
|
1962
1962
|
}
|
|
1963
|
+
function mountSqlExplorer(root, api) {
|
|
1964
|
+
const cell = (value) => {
|
|
1965
|
+
if (value === null || value === void 0)
|
|
1966
|
+
return "";
|
|
1967
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
1968
|
+
return String(value);
|
|
1969
|
+
}
|
|
1970
|
+
return JSON.stringify(value) ?? "";
|
|
1971
|
+
};
|
|
1972
|
+
root.replaceChildren();
|
|
1973
|
+
const layout = document.createElement("div");
|
|
1974
|
+
layout.className = "sql-layout";
|
|
1975
|
+
const tables = document.createElement("div");
|
|
1976
|
+
tables.className = "sql-tables";
|
|
1977
|
+
const stack = document.createElement("div");
|
|
1978
|
+
stack.className = "stack";
|
|
1979
|
+
const banner = document.createElement("p");
|
|
1980
|
+
banner.className = "banner";
|
|
1981
|
+
const grid = document.createElement("div");
|
|
1982
|
+
const input = document.createElement("textarea");
|
|
1983
|
+
input.className = "sql-input";
|
|
1984
|
+
input.spellcheck = false;
|
|
1985
|
+
input.placeholder = "SELECT * FROM ...";
|
|
1986
|
+
const actions = document.createElement("div");
|
|
1987
|
+
actions.className = "row-actions";
|
|
1988
|
+
const run = document.createElement("button");
|
|
1989
|
+
run.type = "button";
|
|
1990
|
+
run.textContent = "Run";
|
|
1991
|
+
actions.append(run);
|
|
1992
|
+
const result = document.createElement("pre");
|
|
1993
|
+
stack.append(banner, grid, input, actions, result);
|
|
1994
|
+
layout.append(tables, stack);
|
|
1995
|
+
root.append(layout);
|
|
1996
|
+
const showError = (error) => {
|
|
1997
|
+
banner.textContent = error instanceof Error ? error.message : String(error);
|
|
1998
|
+
banner.classList.add("show");
|
|
1999
|
+
};
|
|
2000
|
+
const clearError = () => {
|
|
2001
|
+
banner.textContent = "";
|
|
2002
|
+
banner.classList.remove("show");
|
|
2003
|
+
};
|
|
2004
|
+
const renderGrid = (columns, rows) => {
|
|
2005
|
+
grid.replaceChildren();
|
|
2006
|
+
if (columns.length === 0) {
|
|
2007
|
+
const empty = document.createElement("p");
|
|
2008
|
+
empty.className = "empty";
|
|
2009
|
+
empty.textContent = "No rows.";
|
|
2010
|
+
grid.append(empty);
|
|
2011
|
+
return;
|
|
2012
|
+
}
|
|
2013
|
+
const table = document.createElement("table");
|
|
2014
|
+
const head = document.createElement("thead");
|
|
2015
|
+
const headRow = document.createElement("tr");
|
|
2016
|
+
for (const column of columns) {
|
|
2017
|
+
const th = document.createElement("th");
|
|
2018
|
+
th.textContent = column;
|
|
2019
|
+
headRow.append(th);
|
|
2020
|
+
}
|
|
2021
|
+
head.append(headRow);
|
|
2022
|
+
const body = document.createElement("tbody");
|
|
2023
|
+
for (const row of rows) {
|
|
2024
|
+
const tr = document.createElement("tr");
|
|
2025
|
+
for (const column of columns) {
|
|
2026
|
+
const td = document.createElement("td");
|
|
2027
|
+
td.dataset.label = column;
|
|
2028
|
+
td.textContent = cell(row[column]);
|
|
2029
|
+
tr.append(td);
|
|
2030
|
+
}
|
|
2031
|
+
body.append(tr);
|
|
2032
|
+
}
|
|
2033
|
+
table.append(head, body);
|
|
2034
|
+
grid.append(table);
|
|
2035
|
+
};
|
|
2036
|
+
const rowsOf = (value) => {
|
|
2037
|
+
if (!isRecord2(value) || !Array.isArray(value.rows))
|
|
2038
|
+
return [];
|
|
2039
|
+
return value.rows.flatMap((row) => isRecord2(row) ? [row] : []);
|
|
2040
|
+
};
|
|
2041
|
+
const columnsOf = (value, rows) => {
|
|
2042
|
+
if (isRecord2(value) && Array.isArray(value.columns)) {
|
|
2043
|
+
const named = value.columns.flatMap((column) => typeof column === "string" ? [column] : []);
|
|
2044
|
+
if (named.length > 0)
|
|
2045
|
+
return named;
|
|
2046
|
+
}
|
|
2047
|
+
const first = rows[0];
|
|
2048
|
+
return first === void 0 ? [] : Object.keys(first);
|
|
2049
|
+
};
|
|
2050
|
+
let selected = "";
|
|
2051
|
+
const loadPage = async (schema, name) => {
|
|
2052
|
+
selected = `${schema}.${name}`;
|
|
2053
|
+
const page = await api.get(`/sql/tables/${encodeURIComponent(schema)}/${encodeURIComponent(name)}?limit=50`);
|
|
2054
|
+
const rows = rowsOf(page);
|
|
2055
|
+
renderGrid(columnsOf(page, rows), rows);
|
|
2056
|
+
const total = isRecord2(page) && typeof page.total === "number" ? page.total : rows.length;
|
|
2057
|
+
result.textContent = `${selected} \xB7 ${total} rows`;
|
|
2058
|
+
for (const button of tables.querySelectorAll("button")) {
|
|
2059
|
+
if (!(button instanceof HTMLButtonElement))
|
|
2060
|
+
continue;
|
|
2061
|
+
button.setAttribute("aria-current", button.dataset.schema === schema && button.dataset.table === name ? "true" : "false");
|
|
2062
|
+
}
|
|
2063
|
+
};
|
|
2064
|
+
const loadTables = async () => {
|
|
2065
|
+
const payload = await api.get("/sql/tables");
|
|
2066
|
+
const listed = isRecord2(payload) && Array.isArray(payload.tables) ? payload.tables : [];
|
|
2067
|
+
tables.replaceChildren();
|
|
2068
|
+
if (listed.length === 0) {
|
|
2069
|
+
const empty = document.createElement("p");
|
|
2070
|
+
empty.className = "empty";
|
|
2071
|
+
empty.textContent = "No tables.";
|
|
2072
|
+
tables.append(empty);
|
|
2073
|
+
return;
|
|
2074
|
+
}
|
|
2075
|
+
for (const item of listed) {
|
|
2076
|
+
if (!isRecord2(item) || typeof item.schema !== "string" || typeof item.name !== "string")
|
|
2077
|
+
continue;
|
|
2078
|
+
const button = document.createElement("button");
|
|
2079
|
+
button.type = "button";
|
|
2080
|
+
button.dataset.schema = item.schema;
|
|
2081
|
+
button.dataset.table = item.name;
|
|
2082
|
+
button.textContent = `${item.schema}.${item.name}`;
|
|
2083
|
+
tables.append(button);
|
|
2084
|
+
}
|
|
2085
|
+
};
|
|
2086
|
+
tables.addEventListener("click", (event) => {
|
|
2087
|
+
const target = event.target;
|
|
2088
|
+
if (!(target instanceof Element))
|
|
2089
|
+
return;
|
|
2090
|
+
const button = target.closest("button");
|
|
2091
|
+
if (!(button instanceof HTMLButtonElement))
|
|
2092
|
+
return;
|
|
2093
|
+
const schema = button.dataset.schema;
|
|
2094
|
+
const name = button.dataset.table;
|
|
2095
|
+
if (schema === void 0 || name === void 0)
|
|
2096
|
+
return;
|
|
2097
|
+
clearError();
|
|
2098
|
+
loadPage(schema, name).catch(showError);
|
|
2099
|
+
});
|
|
2100
|
+
run.addEventListener("click", () => {
|
|
2101
|
+
const sql = input.value.trim();
|
|
2102
|
+
if (sql === "") {
|
|
2103
|
+
showError(new Error("Enter a statement"));
|
|
2104
|
+
return;
|
|
2105
|
+
}
|
|
2106
|
+
clearError();
|
|
2107
|
+
api.send("POST", "/sql/query", { sql }).then((payload) => {
|
|
2108
|
+
const rows = rowsOf(payload);
|
|
2109
|
+
renderGrid(columnsOf(payload, rows), rows);
|
|
2110
|
+
const count = isRecord2(payload) && typeof payload.rowCount === "number" ? payload.rowCount : rows.length;
|
|
2111
|
+
const truncated = isRecord2(payload) && payload.truncated === true ? " (truncated)" : "";
|
|
2112
|
+
result.textContent = `${count} rows${truncated}`;
|
|
2113
|
+
}).catch(showError);
|
|
2114
|
+
});
|
|
2115
|
+
const namespace = document.getElementById("namespace");
|
|
2116
|
+
if (namespace) {
|
|
2117
|
+
namespace.addEventListener("change", () => {
|
|
2118
|
+
clearError();
|
|
2119
|
+
loadTables().catch(showError);
|
|
2120
|
+
});
|
|
2121
|
+
}
|
|
2122
|
+
loadTables().catch(showError);
|
|
2123
|
+
}
|
|
1963
2124
|
function bootAdmin(config) {
|
|
1964
2125
|
const fieldKinds = ["string", "number", "boolean", "null", "object", "array", "unknown"];
|
|
1965
2126
|
const sources = ["declared", "inferred", "mixed"];
|
|
@@ -2400,6 +2561,50 @@ function bootAdmin(config) {
|
|
|
2400
2561
|
if (render)
|
|
2401
2562
|
await render();
|
|
2402
2563
|
}
|
|
2564
|
+
const delay = (ms) => new Promise((resolve) => {
|
|
2565
|
+
window.setTimeout(resolve, ms);
|
|
2566
|
+
});
|
|
2567
|
+
const confirmAction = async (button, pending, done, work) => {
|
|
2568
|
+
if (button.dataset.pending === "1")
|
|
2569
|
+
return;
|
|
2570
|
+
const label = button.textContent ?? "";
|
|
2571
|
+
const width = button.offsetWidth;
|
|
2572
|
+
button.dataset.pending = "1";
|
|
2573
|
+
button.classList.add("pressed");
|
|
2574
|
+
button.setAttribute("aria-busy", "true");
|
|
2575
|
+
button.style.minWidth = `${width}px`;
|
|
2576
|
+
button.textContent = pending;
|
|
2577
|
+
try {
|
|
2578
|
+
await work();
|
|
2579
|
+
button.textContent = done;
|
|
2580
|
+
await delay(1e3);
|
|
2581
|
+
} catch (error) {
|
|
2582
|
+
showError(error);
|
|
2583
|
+
} finally {
|
|
2584
|
+
button.textContent = label;
|
|
2585
|
+
button.style.minWidth = "";
|
|
2586
|
+
button.classList.remove("pressed");
|
|
2587
|
+
button.removeAttribute("aria-busy");
|
|
2588
|
+
delete button.dataset.pending;
|
|
2589
|
+
}
|
|
2590
|
+
};
|
|
2591
|
+
document.addEventListener("click", (event) => {
|
|
2592
|
+
const target = event.target;
|
|
2593
|
+
if (!(target instanceof Element))
|
|
2594
|
+
return;
|
|
2595
|
+
const button = target.closest("button");
|
|
2596
|
+
if (!(button instanceof HTMLButtonElement) || button.dataset.pending === "1")
|
|
2597
|
+
return;
|
|
2598
|
+
button.classList.add("pressed");
|
|
2599
|
+
const token = String(Date.now());
|
|
2600
|
+
button.dataset.press = token;
|
|
2601
|
+
window.setTimeout(() => {
|
|
2602
|
+
if (button.dataset.press !== token || button.dataset.pending === "1")
|
|
2603
|
+
return;
|
|
2604
|
+
button.classList.remove("pressed");
|
|
2605
|
+
delete button.dataset.press;
|
|
2606
|
+
}, 450);
|
|
2607
|
+
});
|
|
2403
2608
|
el("namespace", HTMLSelectElement).addEventListener("change", () => {
|
|
2404
2609
|
state.namespace = el("namespace", HTMLSelectElement).value;
|
|
2405
2610
|
refresh().catch(showError);
|
|
@@ -2410,7 +2615,7 @@ function bootAdmin(config) {
|
|
|
2410
2615
|
refresh().catch(showError);
|
|
2411
2616
|
});
|
|
2412
2617
|
el("refresh", HTMLButtonElement).addEventListener("click", () => {
|
|
2413
|
-
refresh().catch(showError);
|
|
2618
|
+
confirmAction(el("refresh", HTMLButtonElement), "Refreshing...", "Updated", () => refresh()).catch(showError);
|
|
2414
2619
|
});
|
|
2415
2620
|
el("collections", HTMLElement).addEventListener("click", (event) => {
|
|
2416
2621
|
const target = event.target;
|
|
@@ -2533,10 +2738,10 @@ function bootAdmin(config) {
|
|
|
2533
2738
|
}).then(() => renderFaults()).catch(showError);
|
|
2534
2739
|
});
|
|
2535
2740
|
el("fault-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2536
|
-
api("DELETE", "/faults").then(() => renderFaults()).catch(showError);
|
|
2741
|
+
confirmAction(el("fault-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/faults").then(() => renderFaults())).catch(showError);
|
|
2537
2742
|
});
|
|
2538
2743
|
el("journal-clear", HTMLButtonElement).addEventListener("click", () => {
|
|
2539
|
-
api("DELETE", "/requests").then(() => renderJournal()).catch(showError);
|
|
2744
|
+
confirmAction(el("journal-clear", HTMLButtonElement), "Clearing...", "Cleared", () => api("DELETE", "/requests").then(() => renderJournal())).catch(showError);
|
|
2540
2745
|
});
|
|
2541
2746
|
el("route-list", HTMLElement).addEventListener("click", (event) => {
|
|
2542
2747
|
const target = event.target;
|
|
@@ -2592,6 +2797,22 @@ function bootAdmin(config) {
|
|
|
2592
2797
|
panel.script = value.script;
|
|
2593
2798
|
return panel;
|
|
2594
2799
|
};
|
|
2800
|
+
const decodeExtension = (value) => {
|
|
2801
|
+
if (!isRecord2(value))
|
|
2802
|
+
return void 0;
|
|
2803
|
+
if (value.kind === "sql") {
|
|
2804
|
+
return {
|
|
2805
|
+
kind: "sql",
|
|
2806
|
+
id: typeof value.id === "string" && value.id !== "" ? value.id : "sql",
|
|
2807
|
+
title: typeof value.title === "string" && value.title !== "" ? value.title : "SQL",
|
|
2808
|
+
description: typeof value.description === "string" ? value.description : "Browse tables and run queries."
|
|
2809
|
+
};
|
|
2810
|
+
}
|
|
2811
|
+
if (value.kind !== "panel")
|
|
2812
|
+
return void 0;
|
|
2813
|
+
const panel = decodePanel(value);
|
|
2814
|
+
return panel === void 0 ? void 0 : { kind: "panel", ...panel };
|
|
2815
|
+
};
|
|
2595
2816
|
const mountPanels = (panels) => {
|
|
2596
2817
|
const nav = el("nav", HTMLElement);
|
|
2597
2818
|
const views = el("views", HTMLElement);
|
|
@@ -2645,15 +2866,57 @@ function bootAdmin(config) {
|
|
|
2645
2866
|
return decoded === void 0 ? [] : [decoded];
|
|
2646
2867
|
});
|
|
2647
2868
|
mountPanels(panels);
|
|
2869
|
+
const extensions = requireList(isRecord2(manifest) ? manifest.extensions : void 0, "Extensions").flatMap((extension) => {
|
|
2870
|
+
const decoded = decodeExtension(extension);
|
|
2871
|
+
return decoded === void 0 ? [] : [decoded];
|
|
2872
|
+
});
|
|
2873
|
+
const extensionPanels = extensions.flatMap((extension) => extension.kind === "panel" ? [extension] : []);
|
|
2874
|
+
mountPanels(extensionPanels);
|
|
2875
|
+
for (const extension of extensions) {
|
|
2876
|
+
if (extension.kind !== "sql")
|
|
2877
|
+
continue;
|
|
2878
|
+
const nav = el("nav", HTMLElement);
|
|
2879
|
+
const views = el("views", HTMLElement);
|
|
2880
|
+
const button = document.createElement("button");
|
|
2881
|
+
button.type = "button";
|
|
2882
|
+
button.dataset.view = extension.id;
|
|
2883
|
+
button.textContent = extension.title;
|
|
2884
|
+
nav.append(button);
|
|
2885
|
+
const section = document.createElement("section");
|
|
2886
|
+
section.className = "view";
|
|
2887
|
+
section.id = `view-${extension.id}`;
|
|
2888
|
+
section.hidden = true;
|
|
2889
|
+
const title = document.createElement("h2");
|
|
2890
|
+
title.textContent = extension.title;
|
|
2891
|
+
const lede = document.createElement("p");
|
|
2892
|
+
lede.className = "lede";
|
|
2893
|
+
lede.textContent = extension.description;
|
|
2894
|
+
const body = document.createElement("div");
|
|
2895
|
+
body.className = "panel-body";
|
|
2896
|
+
section.append(title, lede, body);
|
|
2897
|
+
views.append(section);
|
|
2898
|
+
mountSqlExplorer(body, panelApi);
|
|
2899
|
+
}
|
|
2648
2900
|
return refresh();
|
|
2649
2901
|
}).catch(showError);
|
|
2650
2902
|
}
|
|
2651
|
-
var clientPrelude = [
|
|
2903
|
+
var clientPrelude = [
|
|
2904
|
+
isRecord2,
|
|
2905
|
+
mountAdminBrand,
|
|
2906
|
+
startAdminBrand,
|
|
2907
|
+
faultPresetList,
|
|
2908
|
+
mountSqlExplorer,
|
|
2909
|
+
bootAdmin
|
|
2910
|
+
].map((fn) => fn.toString()).join("\n");
|
|
2652
2911
|
var adminClientSource = (config) => {
|
|
2653
2912
|
const payload = JSON.stringify(config).replace(/</g, "\\u003c");
|
|
2913
|
+
const entry = bootAdmin.name;
|
|
2914
|
+
if (!/^[A-Za-z_$][\w$]*$/.test(entry)) {
|
|
2915
|
+
throw new Error("admin client cannot call its boot function");
|
|
2916
|
+
}
|
|
2654
2917
|
return `<script>
|
|
2655
2918
|
${clientPrelude}
|
|
2656
|
-
|
|
2919
|
+
${entry}(${payload});
|
|
2657
2920
|
</script>`;
|
|
2658
2921
|
};
|
|
2659
2922
|
|
|
@@ -2694,19 +2957,33 @@ var STANDARD_ADMIN_ROUTES = [
|
|
|
2694
2957
|
"GET /ui/manifest"
|
|
2695
2958
|
];
|
|
2696
2959
|
var PANEL_ID = /^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/;
|
|
2960
|
+
var RESERVED_VIEWS = /* @__PURE__ */ new Set(["overview", "state", "clock", "faults", "journal", "routes"]);
|
|
2961
|
+
var checkPanel = (panel, seen, label) => {
|
|
2962
|
+
if (!PANEL_ID.test(panel.id)) {
|
|
2963
|
+
throw new RangeError(`${label} id must match ${PANEL_ID}: ${JSON.stringify(panel.id)}`);
|
|
2964
|
+
}
|
|
2965
|
+
if (RESERVED_VIEWS.has(panel.id)) {
|
|
2966
|
+
throw new RangeError(`${label} id ${panel.id} is reserved by the admin shell`);
|
|
2967
|
+
}
|
|
2968
|
+
if (seen.has(panel.id))
|
|
2969
|
+
throw new RangeError(`duplicate admin view id ${panel.id}`);
|
|
2970
|
+
seen.add(panel.id);
|
|
2971
|
+
if (panel.title.trim() === "")
|
|
2972
|
+
throw new RangeError(`${label} ${panel.id} needs a title`);
|
|
2973
|
+
};
|
|
2697
2974
|
var assertAdminUi = (ui) => {
|
|
2698
|
-
if (!ui
|
|
2975
|
+
if (!ui)
|
|
2699
2976
|
return;
|
|
2700
2977
|
const seen = /* @__PURE__ */ new Set();
|
|
2701
|
-
for (const panel of ui.panels)
|
|
2702
|
-
|
|
2703
|
-
|
|
2978
|
+
for (const panel of ui.panels ?? [])
|
|
2979
|
+
checkPanel(panel, seen, "admin panel");
|
|
2980
|
+
for (const extension of ui.extensions ?? []) {
|
|
2981
|
+
if (extension.kind === "panel") {
|
|
2982
|
+
checkPanel(extension, seen, "admin extension");
|
|
2983
|
+
continue;
|
|
2704
2984
|
}
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
seen.add(panel.id);
|
|
2708
|
-
if (panel.title.trim() === "")
|
|
2709
|
-
throw new RangeError(`admin panel ${panel.id} needs a title`);
|
|
2985
|
+
const id = extension.id ?? "sql";
|
|
2986
|
+
checkPanel({ id, title: extension.title ?? "SQL" }, seen, "admin extension");
|
|
2710
2987
|
}
|
|
2711
2988
|
};
|
|
2712
2989
|
|
|
@@ -2867,9 +3144,24 @@ var renderAdminDocument = (service) => {
|
|
|
2867
3144
|
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
|
|
2868
3145
|
label.field { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--faint); }
|
|
2869
3146
|
label.field input, label.field select, .controls input[type="password"] {
|
|
2870
|
-
background: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
2871
|
-
padding: 7px 8px; min-height: 36px;
|
|
2872
|
-
}
|
|
3147
|
+
background-color: var(--bg-inset); border: 1px solid var(--line); border-radius: 8px;
|
|
3148
|
+
padding: 7px 8px; min-height: 36px; line-height: 1.2;
|
|
3149
|
+
}
|
|
3150
|
+
/* A native menu ignores min-height, so Preset rendered about half as tall as
|
|
3151
|
+
the text fields in the same form. Paint it like those fields. */
|
|
3152
|
+
label.field select {
|
|
3153
|
+
-webkit-appearance: none; appearance: none;
|
|
3154
|
+
padding-right: 28px;
|
|
3155
|
+
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");
|
|
3156
|
+
background-repeat: no-repeat; background-position: right 10px center; background-size: 12px 12px;
|
|
3157
|
+
}
|
|
3158
|
+
.stack > .field > input,
|
|
3159
|
+
.stack > .field > select,
|
|
3160
|
+
.stack > .field > textarea,
|
|
3161
|
+
dialog .field > input,
|
|
3162
|
+
dialog .field > select,
|
|
3163
|
+
dialog .field > textarea { width: 100%; }
|
|
3164
|
+
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger, nav.side button { cursor: pointer; }
|
|
2873
3165
|
.icon-btn, .btn, .btn-primary, .btn-quiet, .btn-danger {
|
|
2874
3166
|
border-radius: 9px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line);
|
|
2875
3167
|
background: var(--bg-elev);
|
|
@@ -2877,6 +3169,14 @@ var renderAdminDocument = (service) => {
|
|
|
2877
3169
|
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
|
|
2878
3170
|
.btn-quiet { background: transparent; }
|
|
2879
3171
|
.btn-danger { color: var(--err); }
|
|
3172
|
+
/* Held after mouseup. Clearing an empty journal changes nothing on screen,
|
|
3173
|
+
so the press itself has to stay visible. */
|
|
3174
|
+
.icon-btn:active, .btn:active, .btn-quiet:active, .btn-danger:active, nav.side button:active,
|
|
3175
|
+
.icon-btn.pressed, .btn.pressed, .btn-quiet.pressed, .btn-danger.pressed, nav.side button.pressed {
|
|
3176
|
+
background: var(--bg-inset); border-color: var(--line-strong); color: var(--ink);
|
|
3177
|
+
}
|
|
3178
|
+
.btn-danger:active, .btn-danger.pressed { background: var(--err-soft); color: var(--err); }
|
|
3179
|
+
.btn-primary:active, .btn-primary.pressed { filter: brightness(0.88); color: var(--accent-ink); }
|
|
2880
3180
|
/* minmax(0, 1fr): a 1fr column will not shrink below its content, so a long
|
|
2881
3181
|
record or the full nav row would widen the page past the viewport. */
|
|
2882
3182
|
.layout {
|
|
@@ -2917,6 +3217,12 @@ var renderAdminDocument = (service) => {
|
|
|
2917
3217
|
border-radius: 999px; padding: 4px 8px;
|
|
2918
3218
|
}
|
|
2919
3219
|
.chip i { color: var(--faint); font-style: normal; }
|
|
3220
|
+
.sql-layout {
|
|
3221
|
+
display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 16px;
|
|
3222
|
+
}
|
|
3223
|
+
.sql-tables { display: flex; flex-direction: column; gap: 4px; max-height: 28rem; overflow: auto; }
|
|
3224
|
+
.sql-tables button { text-align: left; }
|
|
3225
|
+
.sql-input { font-family: var(--mono); min-height: 7rem; width: 100%; }
|
|
2920
3226
|
table { width: 100%; border-collapse: collapse; font-size: 14px; }
|
|
2921
3227
|
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
|
|
2922
3228
|
th { color: var(--faint); font-weight: 600; font-size: 12px; }
|
|
@@ -2965,14 +3271,22 @@ var renderAdminDocument = (service) => {
|
|
|
2965
3271
|
input, select, textarea { font-size: 16px; }
|
|
2966
3272
|
.brand, .vendor, .controls { width: 100%; }
|
|
2967
3273
|
label.field, label.field select, label.field input { flex: 1; min-width: 0; }
|
|
2968
|
-
|
|
3274
|
+
/* The layout fills the screen. A single-column grid stretches every auto
|
|
3275
|
+
row, so the tab bar grew with the leftover height and the buttons floated
|
|
3276
|
+
in the middle of it. The bar stays one row; the page below takes the rest. */
|
|
3277
|
+
.layout {
|
|
3278
|
+
grid-template-columns: minmax(0, 1fr);
|
|
3279
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
3280
|
+
align-content: start;
|
|
3281
|
+
}
|
|
2969
3282
|
nav.side {
|
|
3283
|
+
align-self: start; height: auto;
|
|
2970
3284
|
flex-direction: row; align-items: center; overflow-x: auto; min-width: 0;
|
|
2971
3285
|
border-right: 0; border-bottom: 1px solid var(--line);
|
|
2972
3286
|
padding: 8px;
|
|
2973
3287
|
}
|
|
2974
3288
|
nav.side button { white-space: nowrap; flex: none; }
|
|
2975
|
-
.split { grid-template-columns: minmax(0, 1fr); }
|
|
3289
|
+
.split, .sql-layout { grid-template-columns: minmax(0, 1fr); }
|
|
2976
3290
|
main { padding: 14px; }
|
|
2977
3291
|
table, thead, tbody, tr, th, td { display: block; }
|
|
2978
3292
|
thead { display: none; }
|
|
@@ -3143,6 +3457,24 @@ var json3 = (body) => new Response(JSON.stringify(body), {
|
|
|
3143
3457
|
status: 200,
|
|
3144
3458
|
headers: { "content-type": "application/json; charset=utf-8" }
|
|
3145
3459
|
});
|
|
3460
|
+
var describeExtension = (extension) => {
|
|
3461
|
+
if (extension.kind === "sql") {
|
|
3462
|
+
return {
|
|
3463
|
+
kind: "sql",
|
|
3464
|
+
id: extension.id ?? "sql",
|
|
3465
|
+
title: extension.title ?? "SQL",
|
|
3466
|
+
...extension.description !== void 0 ? { description: extension.description } : {}
|
|
3467
|
+
};
|
|
3468
|
+
}
|
|
3469
|
+
return {
|
|
3470
|
+
kind: "panel",
|
|
3471
|
+
id: extension.id,
|
|
3472
|
+
title: extension.title,
|
|
3473
|
+
...extension.description !== void 0 ? { description: extension.description } : {},
|
|
3474
|
+
html: extension.html,
|
|
3475
|
+
...extension.script !== void 0 ? { script: extension.script } : {}
|
|
3476
|
+
};
|
|
3477
|
+
};
|
|
3146
3478
|
var adminUiRoutes = (service, ui) => {
|
|
3147
3479
|
const shell = () => renderAdminDocument(service);
|
|
3148
3480
|
const document3 = () => ui?.render ? ui.render({ service, defaultHtml: shell }) : shell();
|
|
@@ -3157,7 +3489,8 @@ var adminUiRoutes = (service, ui) => {
|
|
|
3157
3489
|
...panel.description !== void 0 ? { description: panel.description } : {},
|
|
3158
3490
|
html: panel.html,
|
|
3159
3491
|
...panel.script !== void 0 ? { script: panel.script } : {}
|
|
3160
|
-
}))
|
|
3492
|
+
})),
|
|
3493
|
+
extensions: (ui?.extensions ?? []).map(describeExtension)
|
|
3161
3494
|
})
|
|
3162
3495
|
};
|
|
3163
3496
|
};
|
|
@@ -3834,7 +4167,7 @@ var stateAdminRoutes = (routes) => {
|
|
|
3834
4167
|
};
|
|
3835
4168
|
|
|
3836
4169
|
// ../core/dist/version.js
|
|
3837
|
-
var PACKAGE_VERSION = true ? "1.
|
|
4170
|
+
var PACKAGE_VERSION = true ? "1.7.0" : UNRELEASED_VERSION;
|
|
3838
4171
|
|
|
3839
4172
|
// ../core/dist/signing.js
|
|
3840
4173
|
var encoder = new TextEncoder();
|
|
@@ -5868,4 +6201,4 @@ export {
|
|
|
5868
6201
|
customerIoCredential,
|
|
5869
6202
|
CustomerIoAPI
|
|
5870
6203
|
};
|
|
5871
|
-
//# sourceMappingURL=chunk-
|
|
6204
|
+
//# sourceMappingURL=chunk-XHKPW7N3.js.map
|