@lunora/studio 1.0.0-alpha.4 → 1.0.0-alpha.41
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/LICENSE.md +6 -0
- package/__assets__/package-og.svg +1 -1
- package/dist/index.d.ts +33 -18
- package/dist/index.js +29 -29
- package/dist/mount.d.ts +1 -1
- package/dist/mount.js +3 -2
- package/dist/{packem_shared/ApiTab-W3no0KOj.js → packem_chunks/ApiTab.js} +5 -5
- package/dist/{packem_shared/AuditPanel-Bq4o_IqT.js → packem_chunks/AuditPanel.js} +29 -41
- package/dist/{packem_shared/ExportImportPanel-dxY56TDF.js → packem_chunks/ExportImportPanel.js} +16 -11
- package/dist/{packem_shared/FileBrowser-Dhy4zES8.js → packem_chunks/FileBrowser.js} +15 -15
- package/dist/{packem_shared/FunctionRunner--fQJRPAD.js → packem_chunks/FunctionRunner.js} +10 -10
- package/dist/{packem_shared/FunctionStatsPanel-BjRUA_G3.js → packem_chunks/FunctionStatsPanel.js} +153 -208
- package/dist/{packem_shared/HealthPanel-PxclMWmA.js → packem_chunks/HealthPanel.js} +37 -29
- package/dist/{packem_shared/InsightsPanel-CWS_C-xW.js → packem_chunks/InsightsPanel.js} +108 -69
- package/dist/{packem_shared/LogsPanel-CTW8CFcM.js → packem_chunks/LogsPanel.js} +46 -58
- package/dist/{packem_shared/MailPanel-BwkvfIHF.js → packem_chunks/MailPanel.js} +45 -139
- package/dist/{packem_shared/MetricsPanel-BLuOhZQ4.js → packem_chunks/MetricsPanel.js} +41 -322
- package/dist/{packem_shared/MigrationsPanel-DT3lnwHF.js → packem_chunks/MigrationsPanel.js} +44 -51
- package/dist/{packem_shared/PitrPanel-CdErL7EJ.js → packem_chunks/PitrPanel.js} +9 -9
- package/dist/{packem_shared/SchemaViewer-LJDcmNIO.js → packem_chunks/SchemaViewer.js} +17 -16
- package/dist/{packem_shared/SecurityAdvisorPanel-C_ETsPih.js → packem_chunks/SecurityAdvisorPanel.js} +47 -31
- package/dist/packem_chunks/SettingsPanel.js +391 -0
- package/dist/{packem_shared/sql-editor-panel-BFRpzj6r.js → packem_chunks/SqlEditorPanel.js} +158 -387
- package/dist/{packem_shared/TableEditor-ChfUOZec.js → packem_chunks/TableEditor.js} +10 -68
- package/dist/packem_chunks/analytics-panel.js +261 -0
- package/dist/packem_chunks/auth-config-panel.js +365 -0
- package/dist/packem_chunks/auth-sessions-panel.js +175 -0
- package/dist/packem_chunks/containers-panel.js +247 -0
- package/dist/packem_chunks/dashboards-panel.js +780 -0
- package/dist/packem_chunks/fanout-panel.js +482 -0
- package/dist/packem_chunks/flags-panel.js +176 -0
- package/dist/packem_chunks/kv-browser.js +1896 -0
- package/dist/packem_chunks/log-drains-panel.js +273 -0
- package/dist/packem_chunks/organizations-panel.js +3178 -0
- package/dist/packem_chunks/payments-panel.js +186 -0
- package/dist/packem_chunks/permissions-panel.js +805 -0
- package/dist/packem_chunks/queues-panel.js +1075 -0
- package/dist/packem_chunks/rls-panel.js +315 -0
- package/dist/packem_chunks/schedule-panel.js +831 -0
- package/dist/packem_chunks/sparkline.js +79 -0
- package/dist/packem_chunks/storage-rules-panel.js +140 -0
- package/dist/packem_chunks/subscriptions-panel.js +238 -0
- package/dist/packem_chunks/users-panel.js +1731 -0
- package/dist/packem_chunks/vector-browser.js +281 -0
- package/dist/packem_chunks/workflows-panel.js +562 -0
- package/dist/packem_shared/{ADMIN_FUNCTIONS-DmBqMZ-z.js → ADMIN_FUNCTIONS-BHHJi3Gb.js} +7 -0
- package/dist/packem_shared/{ApiDocsPanel-C5-yJ1p7.js → ApiDocsPanel-CBma-lnp.js} +2 -2
- package/dist/packem_shared/{ApiReferencePanel-1vubqG5s.js → ApiReferencePanel-CQM3pPN7.js} +2 -1
- package/dist/packem_shared/{CommandPalette-BtgkBzZI.js → CommandPalette-X2tkbyHk.js} +1 -1
- package/dist/packem_shared/{DataBrowser-CtBe1So9.js → DataBrowser-D2ywrdId.js} +198 -247
- package/dist/packem_shared/{GlobalDataBrowser-BTEmGrph.js → GlobalDataBrowser-BkTPLzAY.js} +37 -66
- package/dist/packem_shared/HomePanel-D1Q9LZgK.js +14 -0
- package/dist/packem_shared/{OpenRpcReferencePanel-vbcYbv3V.js → OpenRpcReferencePanel-Dno-hfDb.js} +2 -1
- package/dist/packem_shared/{ScheduledJobs-CabfKbyM.js → ScheduledJobs-Ctw4jYtU.js} +163 -60
- package/dist/packem_shared/Studio-lJhzDAze.js +16 -0
- package/dist/packem_shared/{StudioApp-CHOZA-z-.js → StudioApp-DiMkupvZ.js} +276 -11
- package/dist/packem_shared/{advisor-view-CGcfMiPq.js → advisor-view-BX8OhG0w.js} +6 -6
- package/dist/packem_shared/alert-CdAET2K_.js +68 -0
- package/dist/packem_shared/{app.d-CCmwDEVs.d.ts → app.d-CNLRTrWw.d.ts} +1 -1
- package/dist/packem_shared/{bar-chart-CzJAgqkp.js → bar-chart-DSwcWIRy.js} +5 -4
- package/dist/packem_shared/browser-storage-BTrX4y3B.js +215 -0
- package/dist/packem_shared/{cf-links-2cktDedA.js → cf-links-BZfRdxSE.js} +1 -1
- package/dist/packem_shared/{data-grid-B5CaV3wS.js → data-grid-CdXztApG.js} +1 -1
- package/dist/packem_shared/data-view-params-Cd6yRVbv.js +96 -0
- package/dist/packem_shared/error-alert-CXjqyGw9.js +114 -0
- package/dist/packem_shared/{grid-features-CzUfqgsM.js → grid-features-BF-KBDFz.js} +131 -163
- package/dist/packem_shared/home-panel-TFcRf9Ui.js +1889 -0
- package/dist/packem_shared/{internal-rXJEAhXS.js → internal-CYcbqMjX.js} +44 -3
- package/dist/packem_shared/modal-shell-hyaJvIJ6.js +100 -0
- package/dist/packem_shared/{reference-view-B4E49Lip.js → reference-view-DUiJcILV.js} +6 -45
- package/dist/packem_shared/scroll-area-DLhcy-ml.js +93 -0
- package/dist/packem_shared/select-UkNYCT3s.js +273 -0
- package/dist/packem_shared/skeleton-CGhL0p20.js +45 -0
- package/dist/packem_shared/{sparkline-10dG-_f0.js → sparkline-BnA1kC9X.js} +1 -1
- package/dist/packem_shared/studio-Dh9UlaF_.js +4015 -0
- package/dist/packem_shared/{table-_RzNvy3R.js → table-DsCa9Qp9.js} +1 -1
- package/dist/packem_shared/{table-list-sidebar-Bg7uzbvC.js → table-list-sidebar-UVIXQJdU.js} +1 -1
- package/dist/packem_shared/use-admin-query-CfHYWx5n.js +106 -0
- package/dist/packem_shared/use-async-submit-DJQiPc-_.js +91 -0
- package/dist/standalone/chunk-25AYY4H7.js +2 -0
- package/dist/standalone/chunk-2ANAF4ZM.js +1 -0
- package/dist/standalone/chunk-2K47A3P6.js +1 -0
- package/dist/standalone/chunk-2NGUNNGW.js +1 -0
- package/dist/standalone/chunk-3CJW6NWG.js +4 -0
- package/dist/standalone/chunk-3OA7PECS.js +6 -0
- package/dist/standalone/chunk-3OIHOXVV.js +1 -0
- package/dist/standalone/chunk-447TAUFD.js +1 -0
- package/dist/standalone/chunk-4QHKBC77.js +1 -0
- package/dist/standalone/chunk-5C4TSNE6.js +1 -0
- package/dist/standalone/chunk-5OIBXYZM.js +1 -0
- package/dist/standalone/chunk-6HSHEMZV.js +76 -0
- package/dist/standalone/chunk-6JIZ34MB.js +3 -0
- package/dist/standalone/chunk-6VO23MMW.js +4 -0
- package/dist/standalone/chunk-7MVSQS7B.js +1 -0
- package/dist/standalone/chunk-7TJJXVSE.js +1 -0
- package/dist/standalone/chunk-7YXOPTWI.js +1 -0
- package/dist/standalone/chunk-AHILM3ZP.js +1 -0
- package/dist/standalone/chunk-BGXOXASQ.js +1 -0
- package/dist/standalone/chunk-BJGBHGK3.js +1 -0
- package/dist/standalone/chunk-BOXSWNXZ.js +1 -0
- package/dist/standalone/chunk-BX5MKYOC.js +1 -0
- package/dist/standalone/chunk-CKSHCYGC.js +2 -0
- package/dist/standalone/chunk-DWDILV2E.js +1 -0
- package/dist/standalone/chunk-E75ANNWX.js +19 -0
- package/dist/standalone/chunk-EQZQOTJY.js +1 -0
- package/dist/standalone/chunk-GTLEWM5Y.js +1 -0
- package/dist/standalone/chunk-GTM65MVX.js +1 -0
- package/dist/standalone/chunk-GUI5GFFI.js +1 -0
- package/dist/standalone/chunk-HN6KJXYQ.js +1 -0
- package/dist/standalone/chunk-HV7G6DFP.js +5 -0
- package/dist/standalone/chunk-HYDJNCGW.js +1 -0
- package/dist/standalone/chunk-HZK5RQHG.js +1 -0
- package/dist/standalone/chunk-IN2SYVJB.js +1 -0
- package/dist/standalone/chunk-IOANPSJN.js +1 -0
- package/dist/standalone/chunk-ISDZPW3V.js +1 -0
- package/dist/standalone/chunk-IXDH4GL5.js +1 -0
- package/dist/standalone/chunk-J6J54MBP.js +1 -0
- package/dist/standalone/chunk-J73VHFCL.js +1 -0
- package/dist/standalone/chunk-JHKMUTIF.js +13 -0
- package/dist/standalone/chunk-JPRH6DPK.js +1 -0
- package/dist/standalone/chunk-JSEXCW5Q.js +1 -0
- package/dist/standalone/chunk-KA5YB3VP.js +1 -0
- package/dist/standalone/chunk-KBB75WNT.js +1 -0
- package/dist/standalone/chunk-KEGAWN6Y.js +1 -0
- package/dist/standalone/chunk-KJJ3WM6H.js +4 -0
- package/dist/standalone/chunk-KQV4NGH3.js +1 -0
- package/dist/standalone/chunk-KSKXW5PX.js +1 -0
- package/dist/standalone/chunk-KUH4P5F5.js +1 -0
- package/dist/standalone/chunk-KYJPPVGB.js +1 -0
- package/dist/standalone/chunk-KZ6INM5M.js +1 -0
- package/dist/standalone/chunk-L2TJVSDQ.js +1 -0
- package/dist/standalone/chunk-L7SK4ZZD.js +1 -0
- package/dist/standalone/chunk-LAK5VSPI.js +1 -0
- package/dist/standalone/chunk-LBN7LPVK.js +1 -0
- package/dist/standalone/chunk-LNZIB2MD.js +1 -0
- package/dist/standalone/chunk-MJWVMKQ4.js +6 -0
- package/dist/standalone/chunk-MLZYX5CQ.js +1 -0
- package/dist/standalone/chunk-N2X2OO4V.js +1 -0
- package/dist/standalone/chunk-NGKITPQP.js +13 -0
- package/dist/standalone/chunk-O3NAGRTR.js +1 -0
- package/dist/standalone/chunk-OZACQNKG.js +1 -0
- package/dist/standalone/chunk-PNDNXS5Z.js +1 -0
- package/dist/standalone/chunk-Q7DMUTUE.js +1 -0
- package/dist/standalone/chunk-QAFAJBAW.js +1 -0
- package/dist/standalone/chunk-QBAT52GB.js +1 -0
- package/dist/standalone/chunk-RHZ4M2NZ.js +1 -0
- package/dist/standalone/chunk-RRCPZMC2.js +22 -0
- package/dist/standalone/chunk-SEU5V7I6.js +1 -0
- package/dist/standalone/chunk-TAD43CG5.js +1 -0
- package/dist/standalone/chunk-TBMYIZIO.js +1 -0
- package/dist/standalone/chunk-TDZ44E5I.js +4 -0
- package/dist/standalone/chunk-THNBTMUF.js +1 -0
- package/dist/standalone/chunk-TIQISBGK.js +1 -0
- package/dist/standalone/chunk-TMYVNQ66.js +1 -0
- package/dist/standalone/chunk-TQ36RWOP.js +1 -0
- package/dist/standalone/chunk-UGUEC6BC.js +1 -0
- package/dist/standalone/chunk-UJB2LEI4.js +4 -0
- package/dist/standalone/chunk-UK64ZSUW.js +1 -0
- package/dist/standalone/chunk-UKDJ4H7I.js +1 -0
- package/dist/standalone/chunk-VLXV72QE.js +1 -0
- package/dist/standalone/chunk-VON7JUPG.js +1 -0
- package/dist/standalone/chunk-W3JK4YWR.js +1 -0
- package/dist/standalone/chunk-W3SHEIAL.js +3 -0
- package/dist/standalone/chunk-WI7GWFEG.js +1 -0
- package/dist/standalone/chunk-WIHXMNUY.js +1 -0
- package/dist/standalone/chunk-WLDVXVI2.js +1 -0
- package/dist/standalone/chunk-XLXNLJ4N.js +1 -0
- package/dist/standalone/chunk-XNJNSCLM.js +1 -0
- package/dist/standalone/chunk-YAECF5LW.js +1 -0
- package/dist/standalone/chunk-YBGC4PPD.js +1 -0
- package/dist/standalone/chunk-YJAPWSDC.js +4 -0
- package/dist/standalone/chunk-ZEJB6DXU.js +8 -0
- package/dist/standalone/chunk-ZFNBPAIZ.js +1 -0
- package/dist/standalone/chunk-ZHVTQ37P.js +1 -0
- package/dist/standalone/chunk-ZIGWVHCS.js +1 -0
- package/dist/standalone/chunk-ZPP2KOR4.js +1 -0
- package/dist/standalone/chunk-ZPUO7FNI.js +1 -0
- package/dist/standalone/studio.js +104 -246
- package/dist/styles.css +2 -2
- package/package.json +15 -13
- package/dist/packem_shared/HomePanel-Cw16stjq.js +0 -1273
- package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
- package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
- package/dist/packem_shared/Studio-DFWAlcuf.js +0 -33
- package/dist/packem_shared/studio-Bj8psK1c.js +0 -10303
- package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
- package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
const VALID_OPERATORS = /* @__PURE__ */ new Set(["contains", "eq", "gt", "gte", "lt", "lte", "ne"]);
|
|
2
|
+
const stringParameter = (raw) => {
|
|
3
|
+
if (typeof raw !== "string") {
|
|
4
|
+
return void 0;
|
|
5
|
+
}
|
|
6
|
+
const value = raw.trim();
|
|
7
|
+
return value === "" ? void 0 : value;
|
|
8
|
+
};
|
|
9
|
+
const isFilterClause = (entry) => {
|
|
10
|
+
if (entry === null || typeof entry !== "object") {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
const candidate = entry;
|
|
14
|
+
return typeof candidate.column === "string" && typeof candidate.operator === "string" && VALID_OPERATORS.has(candidate.operator);
|
|
15
|
+
};
|
|
16
|
+
const parseFilters = (raw) => {
|
|
17
|
+
if (typeof raw !== "string" || raw === "") {
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
const parsed = JSON.parse(raw);
|
|
22
|
+
return Array.isArray(parsed) ? parsed.filter(isFilterClause) : [];
|
|
23
|
+
} catch {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const parseOrder = (raw) => {
|
|
28
|
+
if (typeof raw !== "string" || raw === "") {
|
|
29
|
+
return void 0;
|
|
30
|
+
}
|
|
31
|
+
const separator = raw.lastIndexOf(":");
|
|
32
|
+
if (separator <= 0) {
|
|
33
|
+
return void 0;
|
|
34
|
+
}
|
|
35
|
+
const column = raw.slice(0, separator);
|
|
36
|
+
const direction = raw.slice(separator + 1);
|
|
37
|
+
if (direction !== "asc" && direction !== "desc") {
|
|
38
|
+
return void 0;
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
column,
|
|
42
|
+
direction
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
const validateDataViewSearch = (search) => {
|
|
46
|
+
const validated = {};
|
|
47
|
+
if (search["schema"] === "global") {
|
|
48
|
+
validated.schema = "global";
|
|
49
|
+
}
|
|
50
|
+
const table = stringParameter(search["table"]);
|
|
51
|
+
if (table !== void 0) {
|
|
52
|
+
validated.table = table;
|
|
53
|
+
}
|
|
54
|
+
const shard = stringParameter(search["shard"]);
|
|
55
|
+
if (shard !== void 0) {
|
|
56
|
+
validated.shard = shard;
|
|
57
|
+
}
|
|
58
|
+
const searchText = stringParameter(search["search"]);
|
|
59
|
+
if (searchText !== void 0) {
|
|
60
|
+
validated.search = searchText;
|
|
61
|
+
}
|
|
62
|
+
const order = stringParameter(search["order"]);
|
|
63
|
+
if (order !== void 0 && parseOrder(order) !== void 0) {
|
|
64
|
+
validated.order = order;
|
|
65
|
+
}
|
|
66
|
+
const filters = stringParameter(search["filters"]);
|
|
67
|
+
if (filters !== void 0 && parseFilters(filters).length > 0) {
|
|
68
|
+
validated.filters = filters;
|
|
69
|
+
}
|
|
70
|
+
return validated;
|
|
71
|
+
};
|
|
72
|
+
const searchToDataView = (search) => {
|
|
73
|
+
const filters = parseFilters(search["filters"]);
|
|
74
|
+
const orderBy = parseOrder(search["order"]);
|
|
75
|
+
return {
|
|
76
|
+
filters: filters.length > 0 ? filters : void 0,
|
|
77
|
+
orderBy,
|
|
78
|
+
search: typeof search["search"] === "string" && search["search"] !== "" ? search["search"] : void 0,
|
|
79
|
+
shard: typeof search["shard"] === "string" && search["shard"] !== "" ? search["shard"] : void 0,
|
|
80
|
+
table: typeof search["table"] === "string" && search["table"] !== "" ? search["table"] : void 0,
|
|
81
|
+
tier: search["schema"] === "global" ? "global" : "shard"
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
const dataViewToSearch = (view) => {
|
|
85
|
+
const filters = view.filters ?? [];
|
|
86
|
+
return {
|
|
87
|
+
filters: filters.length > 0 ? JSON.stringify(filters) : void 0,
|
|
88
|
+
order: view.orderBy === void 0 ? void 0 : `${view.orderBy.column}:${view.orderBy.direction}`,
|
|
89
|
+
schema: view.tier === "global" ? "global" : void 0,
|
|
90
|
+
search: view.search !== void 0 && view.search !== "" ? view.search : void 0,
|
|
91
|
+
shard: view.shard !== void 0 && view.shard !== "" ? view.shard : void 0,
|
|
92
|
+
table: view.table !== void 0 && view.table !== "" ? view.table : void 0
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export { dataViewToSearch as d, searchToDataView as s, validateDataViewSearch as v };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
|
+
import { flattenHint } from '@lunora/errors';
|
|
3
|
+
import { b as errorHint, d as errorDocumentationUrl, e as errorMessage } from './internal-CYcbqMjX.js';
|
|
4
|
+
import { A as Alert } from './alert-CdAET2K_.js';
|
|
5
|
+
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
6
|
+
|
|
7
|
+
const ErrorAlert = (t0) => {
|
|
8
|
+
const $ = c(26);
|
|
9
|
+
const {
|
|
10
|
+
className,
|
|
11
|
+
error,
|
|
12
|
+
testId
|
|
13
|
+
} = t0;
|
|
14
|
+
let T0;
|
|
15
|
+
let documentationUrl;
|
|
16
|
+
let t1;
|
|
17
|
+
let t2;
|
|
18
|
+
let t3;
|
|
19
|
+
let t4;
|
|
20
|
+
let t5;
|
|
21
|
+
if ($[0] !== className || $[1] !== error || $[2] !== testId) {
|
|
22
|
+
const hint = errorHint(error);
|
|
23
|
+
let t62;
|
|
24
|
+
if ($[10] !== error) {
|
|
25
|
+
t62 = errorDocumentationUrl(error);
|
|
26
|
+
$[10] = error;
|
|
27
|
+
$[11] = t62;
|
|
28
|
+
} else {
|
|
29
|
+
t62 = $[11];
|
|
30
|
+
}
|
|
31
|
+
documentationUrl = t62;
|
|
32
|
+
T0 = Alert;
|
|
33
|
+
t1 = className;
|
|
34
|
+
t2 = testId;
|
|
35
|
+
t3 = "destructive";
|
|
36
|
+
let t72;
|
|
37
|
+
if ($[12] !== error) {
|
|
38
|
+
t72 = errorMessage(error);
|
|
39
|
+
$[12] = error;
|
|
40
|
+
$[13] = t72;
|
|
41
|
+
} else {
|
|
42
|
+
t72 = $[13];
|
|
43
|
+
}
|
|
44
|
+
if ($[14] !== t72) {
|
|
45
|
+
t4 = /* @__PURE__ */ jsxDEV("p", {
|
|
46
|
+
className: "font-medium",
|
|
47
|
+
children: t72
|
|
48
|
+
}, void 0, false);
|
|
49
|
+
$[14] = t72;
|
|
50
|
+
$[15] = t4;
|
|
51
|
+
} else {
|
|
52
|
+
t4 = $[15];
|
|
53
|
+
}
|
|
54
|
+
t5 = hint === void 0 ? null : /* @__PURE__ */ jsxDEV("p", {
|
|
55
|
+
className: "mt-1 whitespace-pre-wrap text-xs opacity-90",
|
|
56
|
+
children: flattenHint(hint)
|
|
57
|
+
}, void 0, false);
|
|
58
|
+
$[0] = className;
|
|
59
|
+
$[1] = error;
|
|
60
|
+
$[2] = testId;
|
|
61
|
+
$[3] = T0;
|
|
62
|
+
$[4] = documentationUrl;
|
|
63
|
+
$[5] = t1;
|
|
64
|
+
$[6] = t2;
|
|
65
|
+
$[7] = t3;
|
|
66
|
+
$[8] = t4;
|
|
67
|
+
$[9] = t5;
|
|
68
|
+
} else {
|
|
69
|
+
T0 = $[3];
|
|
70
|
+
documentationUrl = $[4];
|
|
71
|
+
t1 = $[5];
|
|
72
|
+
t2 = $[6];
|
|
73
|
+
t3 = $[7];
|
|
74
|
+
t4 = $[8];
|
|
75
|
+
t5 = $[9];
|
|
76
|
+
}
|
|
77
|
+
let t6;
|
|
78
|
+
if ($[16] !== documentationUrl) {
|
|
79
|
+
t6 = documentationUrl === void 0 ? null : /* @__PURE__ */ jsxDEV("a", {
|
|
80
|
+
"aria-label": "View documentation for this error",
|
|
81
|
+
className: "mt-1 inline-block text-xs underline",
|
|
82
|
+
href: documentationUrl,
|
|
83
|
+
rel: "noreferrer",
|
|
84
|
+
target: "_blank",
|
|
85
|
+
children: "View error docs"
|
|
86
|
+
}, void 0, false);
|
|
87
|
+
$[16] = documentationUrl;
|
|
88
|
+
$[17] = t6;
|
|
89
|
+
} else {
|
|
90
|
+
t6 = $[17];
|
|
91
|
+
}
|
|
92
|
+
let t7;
|
|
93
|
+
if ($[18] !== T0 || $[19] !== t1 || $[20] !== t2 || $[21] !== t3 || $[22] !== t4 || $[23] !== t5 || $[24] !== t6) {
|
|
94
|
+
t7 = /* @__PURE__ */ jsxDEV(T0, {
|
|
95
|
+
className: t1,
|
|
96
|
+
testId: t2,
|
|
97
|
+
variant: t3,
|
|
98
|
+
children: [t4, t5, t6]
|
|
99
|
+
}, void 0, true);
|
|
100
|
+
$[18] = T0;
|
|
101
|
+
$[19] = t1;
|
|
102
|
+
$[20] = t2;
|
|
103
|
+
$[21] = t3;
|
|
104
|
+
$[22] = t4;
|
|
105
|
+
$[23] = t5;
|
|
106
|
+
$[24] = t6;
|
|
107
|
+
$[25] = t7;
|
|
108
|
+
} else {
|
|
109
|
+
t7 = $[25];
|
|
110
|
+
}
|
|
111
|
+
return t7;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export { ErrorAlert as E };
|
|
@@ -2,105 +2,10 @@ import { c } from 'react/compiler-runtime';
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { ConfirmButton } from './ConfirmButton-C2eVi2Qv.js';
|
|
4
4
|
import { D as DropdownMenuTrigger, a as DropdownMenuLabel, b as DropdownMenuItem, c as DropdownMenuContent, d as DropdownMenu, e as DropdownMenuCheckboxItem, f as DropdownMenuSeparator, g as DropdownMenuGroup } from './dropdown-menu-WY4B_eJO.js';
|
|
5
|
-
import {
|
|
6
|
-
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
5
|
+
import { M as ModalShell } from './modal-shell-hyaJvIJ6.js';
|
|
7
6
|
import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
8
|
-
import { h as formatCell,
|
|
9
|
-
|
|
10
|
-
const OVERLAY_BY_VARIANT = {
|
|
11
|
-
dialog: "fixed inset-0 z-[1000] flex justify-center bg-black/20 pt-[10vh]",
|
|
12
|
-
drawer: "fixed inset-0 z-[1000] flex justify-end bg-black/20"
|
|
13
|
-
};
|
|
14
|
-
const PANEL_BY_VARIANT = {
|
|
15
|
-
dialog: "flex h-fit w-[min(28rem,92vw)] flex-col gap-3 rounded-lg border border-border bg-background p-4 shadow-xl",
|
|
16
|
-
drawer: "flex h-full w-[min(34rem,100vw)] flex-col gap-4 overflow-auto border-l border-border bg-background p-4 shadow-xl"
|
|
17
|
-
};
|
|
18
|
-
const ModalShell = (t0) => {
|
|
19
|
-
const $ = c(18);
|
|
20
|
-
const {
|
|
21
|
-
className,
|
|
22
|
-
children,
|
|
23
|
-
label,
|
|
24
|
-
onClose,
|
|
25
|
-
panelTestId,
|
|
26
|
-
testId,
|
|
27
|
-
variant
|
|
28
|
-
} = t0;
|
|
29
|
-
let t1;
|
|
30
|
-
if ($[0] !== onClose) {
|
|
31
|
-
t1 = (event) => {
|
|
32
|
-
if (event.target === event.currentTarget) {
|
|
33
|
-
onClose();
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
$[0] = onClose;
|
|
37
|
-
$[1] = t1;
|
|
38
|
-
} else {
|
|
39
|
-
t1 = $[1];
|
|
40
|
-
}
|
|
41
|
-
const onOverlayClick = t1;
|
|
42
|
-
let t2;
|
|
43
|
-
if ($[2] !== onClose) {
|
|
44
|
-
t2 = (event_0) => {
|
|
45
|
-
if (event_0.key === "Escape") {
|
|
46
|
-
onClose();
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
$[2] = onClose;
|
|
50
|
-
$[3] = t2;
|
|
51
|
-
} else {
|
|
52
|
-
t2 = $[3];
|
|
53
|
-
}
|
|
54
|
-
const onOverlayKeyDown = t2;
|
|
55
|
-
const t3 = OVERLAY_BY_VARIANT[variant];
|
|
56
|
-
const t4 = PANEL_BY_VARIANT[variant];
|
|
57
|
-
let t5;
|
|
58
|
-
if ($[4] !== className || $[5] !== t4) {
|
|
59
|
-
t5 = cn(t4, className);
|
|
60
|
-
$[4] = className;
|
|
61
|
-
$[5] = t4;
|
|
62
|
-
$[6] = t5;
|
|
63
|
-
} else {
|
|
64
|
-
t5 = $[6];
|
|
65
|
-
}
|
|
66
|
-
let t6;
|
|
67
|
-
if ($[7] !== children || $[8] !== label || $[9] !== panelTestId || $[10] !== t5) {
|
|
68
|
-
t6 = /* @__PURE__ */ jsxDEV("div", {
|
|
69
|
-
"aria-label": label,
|
|
70
|
-
className: t5,
|
|
71
|
-
"data-testid": panelTestId,
|
|
72
|
-
role: "dialog",
|
|
73
|
-
children
|
|
74
|
-
}, void 0, false);
|
|
75
|
-
$[7] = children;
|
|
76
|
-
$[8] = label;
|
|
77
|
-
$[9] = panelTestId;
|
|
78
|
-
$[10] = t5;
|
|
79
|
-
$[11] = t6;
|
|
80
|
-
} else {
|
|
81
|
-
t6 = $[11];
|
|
82
|
-
}
|
|
83
|
-
let t7;
|
|
84
|
-
if ($[12] !== onOverlayClick || $[13] !== onOverlayKeyDown || $[14] !== t3 || $[15] !== t6 || $[16] !== testId) {
|
|
85
|
-
t7 = /* @__PURE__ */ jsxDEV("div", {
|
|
86
|
-
className: t3,
|
|
87
|
-
"data-testid": testId,
|
|
88
|
-
onClick: onOverlayClick,
|
|
89
|
-
onKeyDown: onOverlayKeyDown,
|
|
90
|
-
role: "presentation",
|
|
91
|
-
children: t6
|
|
92
|
-
}, void 0, false);
|
|
93
|
-
$[12] = onOverlayClick;
|
|
94
|
-
$[13] = onOverlayKeyDown;
|
|
95
|
-
$[14] = t3;
|
|
96
|
-
$[15] = t6;
|
|
97
|
-
$[16] = testId;
|
|
98
|
-
$[17] = t7;
|
|
99
|
-
} else {
|
|
100
|
-
t7 = $[17];
|
|
101
|
-
}
|
|
102
|
-
return t7;
|
|
103
|
-
};
|
|
7
|
+
import { h as formatCell, g as copyToClipboard } from './internal-CYcbqMjX.js';
|
|
8
|
+
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
104
9
|
|
|
105
10
|
const CONTROL_BTN = "inline-flex items-center gap-1 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50";
|
|
106
11
|
const CSV_QUOTE_RE = /["\n,]/u;
|
|
@@ -124,6 +29,37 @@ const toCsv = (columns, rows) => {
|
|
|
124
29
|
return [header, ...body].join("\n");
|
|
125
30
|
};
|
|
126
31
|
const toJson = (rows) => JSON.stringify(rows, null, 2);
|
|
32
|
+
const SQL_INSERT_BATCH = 500;
|
|
33
|
+
const sqlIdentifier = (name) => `"${name.replaceAll('"', '""')}"`;
|
|
34
|
+
const sqlLiteral = (value) => {
|
|
35
|
+
if (value === null || value === void 0) {
|
|
36
|
+
return "NULL";
|
|
37
|
+
}
|
|
38
|
+
if (typeof value === "number") {
|
|
39
|
+
return Number.isFinite(value) ? String(value) : "NULL";
|
|
40
|
+
}
|
|
41
|
+
if (typeof value === "bigint") {
|
|
42
|
+
return String(value);
|
|
43
|
+
}
|
|
44
|
+
if (typeof value === "boolean") {
|
|
45
|
+
return value ? "1" : "0";
|
|
46
|
+
}
|
|
47
|
+
const text = typeof value === "string" ? value : JSON.stringify(value);
|
|
48
|
+
return `'${text.replaceAll("'", "''")}'`;
|
|
49
|
+
};
|
|
50
|
+
const toSql = (name, columns, rows) => {
|
|
51
|
+
if (columns.length === 0 || rows.length === 0) {
|
|
52
|
+
return "";
|
|
53
|
+
}
|
|
54
|
+
const columnList = columns.map((column) => sqlIdentifier(column)).join(", ");
|
|
55
|
+
const statements = [];
|
|
56
|
+
for (let start = 0; start < rows.length; start += SQL_INSERT_BATCH) {
|
|
57
|
+
const values = rows.slice(start, start + SQL_INSERT_BATCH).map((row) => ` (${columns.map((column) => sqlLiteral(row[column])).join(", ")})`).join(",\n");
|
|
58
|
+
statements.push(`INSERT INTO ${sqlIdentifier(name)} (${columnList}) VALUES
|
|
59
|
+
${values};`);
|
|
60
|
+
}
|
|
61
|
+
return statements.join("\n\n");
|
|
62
|
+
};
|
|
127
63
|
const downloadFile = (filename, content, mime) => {
|
|
128
64
|
if (!("document" in globalThis)) {
|
|
129
65
|
return;
|
|
@@ -140,7 +76,7 @@ const downloadFile = (filename, content, mime) => {
|
|
|
140
76
|
globalThis.URL.revokeObjectURL(url);
|
|
141
77
|
};
|
|
142
78
|
const ExportMenu = (t0) => {
|
|
143
|
-
const $ = c(
|
|
79
|
+
const $ = c(36);
|
|
144
80
|
const {
|
|
145
81
|
columns,
|
|
146
82
|
name,
|
|
@@ -172,96 +108,131 @@ const ExportMenu = (t0) => {
|
|
|
172
108
|
t2 = $[6];
|
|
173
109
|
}
|
|
174
110
|
const onJson = t2;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
111
|
+
let t3;
|
|
112
|
+
if ($[7] !== columns || $[8] !== name || $[9] !== rows) {
|
|
113
|
+
t3 = () => {
|
|
114
|
+
downloadFile(`${name}.sql`, toSql(name, columns, rows), "application/sql;charset=utf-8");
|
|
115
|
+
};
|
|
116
|
+
$[7] = columns;
|
|
117
|
+
$[8] = name;
|
|
118
|
+
$[9] = rows;
|
|
119
|
+
$[10] = t3;
|
|
120
|
+
} else {
|
|
121
|
+
t3 = $[10];
|
|
122
|
+
}
|
|
123
|
+
const onSql = t3;
|
|
124
|
+
const t4 = rows.length === 0;
|
|
125
|
+
let t5;
|
|
126
|
+
if ($[11] !== t4) {
|
|
127
|
+
t5 = /* @__PURE__ */ jsxDEV(DropdownMenuTrigger, {
|
|
179
128
|
className: CONTROL_BTN,
|
|
180
129
|
"data-testid": "grid-export",
|
|
181
|
-
disabled:
|
|
130
|
+
disabled: t4,
|
|
182
131
|
title: "Exports only the rows loaded on the current page, not the whole table",
|
|
183
132
|
children: "Export page"
|
|
184
133
|
}, void 0, false);
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
134
|
+
$[11] = t4;
|
|
135
|
+
$[12] = t5;
|
|
187
136
|
} else {
|
|
188
|
-
|
|
137
|
+
t5 = $[12];
|
|
189
138
|
}
|
|
190
|
-
let
|
|
191
|
-
if ($[
|
|
192
|
-
|
|
139
|
+
let t6;
|
|
140
|
+
if ($[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
141
|
+
t6 = /* @__PURE__ */ jsxDEV(DropdownMenuLabel, {
|
|
193
142
|
children: "Export loaded rows"
|
|
194
143
|
}, void 0, false);
|
|
195
|
-
$[
|
|
144
|
+
$[13] = t6;
|
|
196
145
|
} else {
|
|
197
|
-
|
|
146
|
+
t6 = $[13];
|
|
198
147
|
}
|
|
199
|
-
let
|
|
200
|
-
if ($[
|
|
201
|
-
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
148
|
+
let t7;
|
|
149
|
+
if ($[14] !== t) {
|
|
150
|
+
t7 = t("CSV");
|
|
151
|
+
$[14] = t;
|
|
152
|
+
$[15] = t7;
|
|
204
153
|
} else {
|
|
205
|
-
|
|
154
|
+
t7 = $[15];
|
|
206
155
|
}
|
|
207
|
-
let
|
|
208
|
-
if ($[
|
|
209
|
-
|
|
156
|
+
let t8;
|
|
157
|
+
if ($[16] !== onCsv || $[17] !== t7) {
|
|
158
|
+
t8 = /* @__PURE__ */ jsxDEV(DropdownMenuItem, {
|
|
210
159
|
"data-testid": "grid-export-csv",
|
|
211
160
|
onClick: onCsv,
|
|
212
|
-
children:
|
|
161
|
+
children: t7
|
|
213
162
|
}, void 0, false);
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
163
|
+
$[16] = onCsv;
|
|
164
|
+
$[17] = t7;
|
|
165
|
+
$[18] = t8;
|
|
217
166
|
} else {
|
|
218
|
-
|
|
167
|
+
t8 = $[18];
|
|
219
168
|
}
|
|
220
|
-
let
|
|
221
|
-
if ($[
|
|
222
|
-
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
169
|
+
let t9;
|
|
170
|
+
if ($[19] !== t) {
|
|
171
|
+
t9 = t("JSON");
|
|
172
|
+
$[19] = t;
|
|
173
|
+
$[20] = t9;
|
|
225
174
|
} else {
|
|
226
|
-
|
|
175
|
+
t9 = $[20];
|
|
227
176
|
}
|
|
228
|
-
let
|
|
229
|
-
if ($[
|
|
230
|
-
|
|
177
|
+
let t10;
|
|
178
|
+
if ($[21] !== onJson || $[22] !== t9) {
|
|
179
|
+
t10 = /* @__PURE__ */ jsxDEV(DropdownMenuItem, {
|
|
231
180
|
"data-testid": "grid-export-json",
|
|
232
181
|
onClick: onJson,
|
|
233
|
-
children:
|
|
182
|
+
children: t9
|
|
234
183
|
}, void 0, false);
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
184
|
+
$[21] = onJson;
|
|
185
|
+
$[22] = t9;
|
|
186
|
+
$[23] = t10;
|
|
238
187
|
} else {
|
|
239
|
-
|
|
188
|
+
t10 = $[23];
|
|
240
189
|
}
|
|
241
|
-
let
|
|
242
|
-
if ($[
|
|
243
|
-
|
|
190
|
+
let t11;
|
|
191
|
+
if ($[24] !== t) {
|
|
192
|
+
t11 = t("SQL");
|
|
193
|
+
$[24] = t;
|
|
194
|
+
$[25] = t11;
|
|
195
|
+
} else {
|
|
196
|
+
t11 = $[25];
|
|
197
|
+
}
|
|
198
|
+
let t12;
|
|
199
|
+
if ($[26] !== onSql || $[27] !== t11) {
|
|
200
|
+
t12 = /* @__PURE__ */ jsxDEV(DropdownMenuItem, {
|
|
201
|
+
"data-testid": "grid-export-sql",
|
|
202
|
+
onClick: onSql,
|
|
203
|
+
children: t11
|
|
204
|
+
}, void 0, false);
|
|
205
|
+
$[26] = onSql;
|
|
206
|
+
$[27] = t11;
|
|
207
|
+
$[28] = t12;
|
|
208
|
+
} else {
|
|
209
|
+
t12 = $[28];
|
|
210
|
+
}
|
|
211
|
+
let t13;
|
|
212
|
+
if ($[29] !== t10 || $[30] !== t12 || $[31] !== t8) {
|
|
213
|
+
t13 = /* @__PURE__ */ jsxDEV(DropdownMenuContent, {
|
|
244
214
|
align: "end",
|
|
245
|
-
children: [
|
|
215
|
+
children: [t6, t8, t10, t12]
|
|
246
216
|
}, void 0, true);
|
|
247
|
-
$[
|
|
248
|
-
$[
|
|
249
|
-
$[
|
|
217
|
+
$[29] = t10;
|
|
218
|
+
$[30] = t12;
|
|
219
|
+
$[31] = t8;
|
|
220
|
+
$[32] = t13;
|
|
250
221
|
} else {
|
|
251
|
-
|
|
222
|
+
t13 = $[32];
|
|
252
223
|
}
|
|
253
|
-
let
|
|
254
|
-
if ($[
|
|
255
|
-
|
|
256
|
-
children: [
|
|
224
|
+
let t14;
|
|
225
|
+
if ($[33] !== t13 || $[34] !== t5) {
|
|
226
|
+
t14 = /* @__PURE__ */ jsxDEV(DropdownMenu, {
|
|
227
|
+
children: [t5, t13]
|
|
257
228
|
}, void 0, true);
|
|
258
|
-
$[
|
|
259
|
-
$[
|
|
260
|
-
$[
|
|
229
|
+
$[33] = t13;
|
|
230
|
+
$[34] = t5;
|
|
231
|
+
$[35] = t14;
|
|
261
232
|
} else {
|
|
262
|
-
|
|
233
|
+
t14 = $[35];
|
|
263
234
|
}
|
|
264
|
-
return
|
|
235
|
+
return t14;
|
|
265
236
|
};
|
|
266
237
|
const ColumnToggle = (t0) => {
|
|
267
238
|
const $ = c(9);
|
|
@@ -553,12 +524,9 @@ const CellDetailDialog = (t0) => {
|
|
|
553
524
|
let t2;
|
|
554
525
|
if ($[2] !== text) {
|
|
555
526
|
t2 = () => {
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
return;
|
|
527
|
+
if (copyToClipboard(text)) {
|
|
528
|
+
setCopied(true);
|
|
559
529
|
}
|
|
560
|
-
fireAndForget(clipboard.writeText(text));
|
|
561
|
-
setCopied(true);
|
|
562
530
|
};
|
|
563
531
|
$[2] = text;
|
|
564
532
|
$[3] = t2;
|
|
@@ -837,4 +805,4 @@ function _temp2(row) {
|
|
|
837
805
|
return row.id;
|
|
838
806
|
}
|
|
839
807
|
|
|
840
|
-
export { CellDetailDialog as C, ExportMenu as E, GridActionsBar as G,
|
|
808
|
+
export { CellDetailDialog as C, ExportMenu as E, GridActionsBar as G, SelectionBar as S };
|