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