@lunora/studio 1.0.0-alpha.5 → 1.0.0-alpha.51
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 +45 -23
- package/dist/index.js +31 -31
- 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} +55 -32
- package/dist/{packem_shared/FunctionRunner--fQJRPAD.js → packem_chunks/FunctionRunner.js} +15 -32
- 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} +179 -401
- package/dist/{packem_shared/TableEditor-ChfUOZec.js → packem_chunks/TableEditor.js} +13 -94
- package/dist/packem_chunks/agents-panel.js +326 -0
- 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 +261 -0
- package/dist/packem_chunks/dashboards-panel.js +781 -0
- package/dist/packem_chunks/fanout-panel.js +482 -0
- package/dist/packem_chunks/flags-panel.js +176 -0
- package/dist/packem_chunks/issues-panel.js +188 -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-DNeyYtUN.js} +8 -0
- package/dist/packem_shared/{ApiDocsPanel-C5-yJ1p7.js → ApiDocsPanel-_aEZxAMX.js} +2 -2
- package/dist/packem_shared/{ApiReferencePanel-1vubqG5s.js → ApiReferencePanel-Dd8pcswz.js} +2 -1
- package/dist/packem_shared/{CommandPalette-BtgkBzZI.js → CommandPalette-BXV4eKf5.js} +1 -1
- package/dist/packem_shared/{DataBrowser-CtBe1So9.js → DataBrowser-C8hejnub.js} +201 -250
- package/dist/packem_shared/{DataFilters-FNquMaiu.js → DataFilters-B1Q7mrt7.js} +6 -2
- package/dist/packem_shared/{GlobalDataBrowser-BTEmGrph.js → GlobalDataBrowser-f5Ll2AQK.js} +43 -68
- package/dist/packem_shared/HomePanel-Ye8PaqQL.js +14 -0
- package/dist/packem_shared/{OpenRpcReferencePanel-vbcYbv3V.js → OpenRpcReferencePanel-CWaf0ZtX.js} +2 -1
- package/dist/packem_shared/{ScheduledJobs-CabfKbyM.js → ScheduledJobs-dHMgnJbx.js} +163 -60
- package/dist/packem_shared/{ShardInput-gx_DZXXn.js → ShardInput-CZnpHILL.js} +1 -1
- package/dist/packem_shared/Studio-BNGjxLVo.js +16 -0
- package/dist/packem_shared/{StudioApp-D4azxYBu.js → StudioApp-K9dn1Q9d.js} +75 -24
- package/dist/packem_shared/{advisor-view-CGcfMiPq.js → advisor-view-Cx21PS_T.js} +6 -6
- package/dist/packem_shared/alert-CdAET2K_.js +68 -0
- package/dist/packem_shared/{app.d-CCmwDEVs.d.ts → app.d-CGdOmLTm.d.ts} +1 -1
- package/dist/packem_shared/{bar-chart-CzJAgqkp.js → bar-chart-DSwcWIRy.js} +5 -4
- package/dist/packem_shared/browser-storage-L4gOP5gJ.js +105 -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-C9I16KWr.js} +1 -1
- package/dist/packem_shared/data-view-params-Cd6yRVbv.js +96 -0
- package/dist/packem_shared/error-alert-vIPQoN3Y.js +114 -0
- package/dist/packem_shared/{grid-features-CzUfqgsM.js → grid-features-B_fZH4iQ.js} +133 -164
- package/dist/packem_shared/home-panel-D62G8108.js +1889 -0
- package/dist/packem_shared/internal-zwBoOv24.js +122 -0
- package/dist/packem_shared/modal-shell-hyaJvIJ6.js +100 -0
- package/dist/packem_shared/{reference-view-B4E49Lip.js → reference-view-DUULLuOi.js} +8 -61
- package/dist/packem_shared/result-chart-DZradBAS.js +119 -0
- package/dist/packem_shared/scroll-area-DLhcy-ml.js +93 -0
- package/dist/packem_shared/select-UkNYCT3s.js +273 -0
- package/dist/packem_shared/shard-history-AxiJ1WPP.js +16 -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-Cd21fp4v.js +4090 -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-huX4VmgI.js} +19 -9
- package/dist/packem_shared/use-admin-query-BGJ010yZ.js +106 -0
- package/dist/packem_shared/use-async-submit-DGCtuDyz.js +91 -0
- package/dist/standalone/chunk-22C6COGE.js +13 -0
- package/dist/standalone/chunk-2K47A3P6.js +1 -0
- package/dist/standalone/chunk-2MLA6WFH.js +1 -0
- package/dist/standalone/chunk-2NGUNNGW.js +1 -0
- package/dist/standalone/chunk-2ZL6MXBC.js +4 -0
- package/dist/standalone/chunk-3GXGLNKW.js +1 -0
- package/dist/standalone/chunk-3OA7PECS.js +6 -0
- package/dist/standalone/chunk-4PC7IXNY.js +1 -0
- package/dist/standalone/chunk-4QA5TWYJ.js +1 -0
- package/dist/standalone/chunk-4QHKBC77.js +1 -0
- package/dist/standalone/chunk-5OIBXYZM.js +1 -0
- package/dist/standalone/chunk-6TYT447C.js +1 -0
- package/dist/standalone/chunk-7SN6J4DZ.js +1 -0
- package/dist/standalone/chunk-7TJJXVSE.js +1 -0
- package/dist/standalone/chunk-A3ZJACVT.js +4 -0
- package/dist/standalone/chunk-AHILM3ZP.js +1 -0
- package/dist/standalone/chunk-AITOCPML.js +1 -0
- package/dist/standalone/chunk-AJ2B326V.js +1 -0
- package/dist/standalone/chunk-APSSZB6Z.js +1 -0
- package/dist/standalone/chunk-AVONJCNY.js +4 -0
- package/dist/standalone/chunk-BE24FXAK.js +1 -0
- package/dist/standalone/chunk-BJGBHGK3.js +1 -0
- package/dist/standalone/chunk-CKSHCYGC.js +2 -0
- package/dist/standalone/chunk-CP2EQVLU.js +1 -0
- package/dist/standalone/chunk-DTPFXYHG.js +1 -0
- package/dist/standalone/chunk-DWDILV2E.js +1 -0
- package/dist/standalone/chunk-E3FVNRH7.js +1 -0
- package/dist/standalone/chunk-EEWKIQUE.js +1 -0
- package/dist/standalone/chunk-EOE5NDMK.js +1 -0
- package/dist/standalone/chunk-FJV4UNYY.js +1 -0
- package/dist/standalone/chunk-FWTZYHX4.js +1 -0
- package/dist/standalone/chunk-G465LTLD.js +1 -0
- package/dist/standalone/chunk-G6URLCRC.js +3 -0
- package/dist/standalone/chunk-G7ZBM54M.js +1 -0
- package/dist/standalone/chunk-GTM65MVX.js +1 -0
- package/dist/standalone/chunk-HV7G6DFP.js +5 -0
- package/dist/standalone/chunk-IMZKGRPW.js +1 -0
- package/dist/standalone/chunk-ITQKVEP7.js +19 -0
- package/dist/standalone/chunk-IZN4TYMN.js +1 -0
- package/dist/standalone/chunk-J6J54MBP.js +1 -0
- package/dist/standalone/chunk-JM7XBQVK.js +1 -0
- package/dist/standalone/chunk-JPILGFXT.js +1 -0
- package/dist/standalone/chunk-JSEXCW5Q.js +1 -0
- package/dist/standalone/chunk-KDZJ5A3R.js +1 -0
- package/dist/standalone/chunk-KEGAWN6Y.js +1 -0
- package/dist/standalone/chunk-KGQGNJJ2.js +1 -0
- package/dist/standalone/chunk-KJJ3WM6H.js +4 -0
- package/dist/standalone/chunk-KKJZL75J.js +1 -0
- package/dist/standalone/chunk-KZ6INM5M.js +1 -0
- package/dist/standalone/chunk-L2YBC2BV.js +11 -0
- package/dist/standalone/chunk-L7SK4ZZD.js +1 -0
- package/dist/standalone/chunk-LAK5VSPI.js +1 -0
- package/dist/standalone/chunk-LDEVBRDZ.js +1 -0
- package/dist/standalone/chunk-LUP4YTBS.js +1 -0
- package/dist/standalone/chunk-LVH4KLXS.js +13 -0
- package/dist/standalone/chunk-MDTNVR3G.js +1 -0
- package/dist/standalone/chunk-N4NG7HGI.js +1 -0
- package/dist/standalone/chunk-O3NAGRTR.js +1 -0
- package/dist/standalone/chunk-ONSKQCYN.js +3 -0
- package/dist/standalone/chunk-OQE56NBE.js +1 -0
- package/dist/standalone/chunk-OSPEOESV.js +8 -0
- package/dist/standalone/chunk-Q7PYLDZU.js +1 -0
- package/dist/standalone/chunk-Q7TKOAGT.js +1 -0
- package/dist/standalone/chunk-QAFAJBAW.js +1 -0
- package/dist/standalone/chunk-RRCPZMC2.js +22 -0
- package/dist/standalone/chunk-RXVQJ4DO.js +1 -0
- package/dist/standalone/chunk-S5NTGHCG.js +1 -0
- package/dist/standalone/chunk-SDQE2IUJ.js +1 -0
- package/dist/standalone/chunk-SEU5V7I6.js +1 -0
- package/dist/standalone/chunk-SHERR7ZP.js +1 -0
- package/dist/standalone/chunk-T3UCZ5PJ.js +1 -0
- package/dist/standalone/chunk-TAD43CG5.js +1 -0
- package/dist/standalone/chunk-TAQM5WML.js +1 -0
- package/dist/standalone/chunk-TO6D2PJC.js +6 -0
- package/dist/standalone/chunk-TQ36RWOP.js +1 -0
- package/dist/standalone/chunk-TSLR3ZU2.js +1 -0
- package/dist/standalone/chunk-UK64ZSUW.js +1 -0
- package/dist/standalone/chunk-UX53GWGU.js +1 -0
- package/dist/standalone/chunk-V43BLH4J.js +1 -0
- package/dist/standalone/chunk-VC5RNEHU.js +1 -0
- package/dist/standalone/chunk-VL23Y44O.js +4 -0
- package/dist/standalone/chunk-VLIRTNLA.js +4 -0
- package/dist/standalone/chunk-VLXV72QE.js +1 -0
- package/dist/standalone/chunk-VN2PDOMK.js +1 -0
- package/dist/standalone/chunk-VZFJI6XE.js +1 -0
- package/dist/standalone/chunk-W6JKUZKD.js +1 -0
- package/dist/standalone/chunk-WI7GWFEG.js +1 -0
- package/dist/standalone/chunk-WJ6OBCUM.js +1 -0
- package/dist/standalone/chunk-WUFVFVHJ.js +1 -0
- package/dist/standalone/chunk-WVTPZ6CM.js +1 -0
- package/dist/standalone/chunk-X4QFAAZ5.js +76 -0
- package/dist/standalone/chunk-XNJNSCLM.js +1 -0
- package/dist/standalone/chunk-XOANGJJP.js +1 -0
- package/dist/standalone/chunk-YA6POZJD.js +1 -0
- package/dist/standalone/chunk-ZECNJ4FG.js +1 -0
- package/dist/standalone/chunk-ZETIKSQJ.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/chunk-ZZMGCPXE.js +2 -0
- package/dist/standalone/studio.js +104 -246
- package/dist/styles.css +2 -2
- package/package.json +17 -15
- 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-BmSGSIuY.js +0 -33
- package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
- package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
- package/dist/packem_shared/studio-H9fuQgSj.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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useState, useMemo } from 'react';
|
|
2
|
+
import { E as ErrorAlert } from './error-alert-vIPQoN3Y.js';
|
|
2
3
|
import { C as Card, a as CardContent } from './card-DURq3ElK.js';
|
|
3
|
-
import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from './table-
|
|
4
|
+
import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from './table-DsCa9Qp9.js';
|
|
4
5
|
import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
5
6
|
import { c as cn } from './utils-B05Dmz_H.js';
|
|
6
7
|
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
@@ -49,6 +50,7 @@ const emptyTitle = (t, level) => ({
|
|
|
49
50
|
})[level];
|
|
50
51
|
const AdvisorView = ({
|
|
51
52
|
error = null,
|
|
53
|
+
errorSource,
|
|
52
54
|
rows,
|
|
53
55
|
testId,
|
|
54
56
|
toolbar
|
|
@@ -98,11 +100,9 @@ const AdvisorView = ({
|
|
|
98
100
|
}, void 0, false), toolbar !== void 0 && /* @__PURE__ */ jsxDEV("div", {
|
|
99
101
|
className: "flex flex-wrap items-center gap-2",
|
|
100
102
|
children: toolbar
|
|
101
|
-
}, void 0, false), error !== null && /* @__PURE__ */ jsxDEV(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
role: "alert",
|
|
105
|
-
children: error
|
|
103
|
+
}, void 0, false), error !== null && /* @__PURE__ */ jsxDEV(ErrorAlert, {
|
|
104
|
+
error: errorSource ?? error,
|
|
105
|
+
testId: `${testId}-error`
|
|
106
106
|
}, void 0, false), /* @__PURE__ */ jsxDEV(Card, {
|
|
107
107
|
className: "overflow-hidden py-0",
|
|
108
108
|
children: /* @__PURE__ */ jsxDEV(CardContent, {
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import { c as cn } from './utils-B05Dmz_H.js';
|
|
4
|
+
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
5
|
+
|
|
6
|
+
const alertVariants = cva("flex items-start gap-2 rounded-md border px-3 py-2 text-sm [&>svg]:mt-0.5 [&>svg]:size-4 [&>svg]:shrink-0", {
|
|
7
|
+
defaultVariants: {
|
|
8
|
+
variant: "default"
|
|
9
|
+
},
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "border-border bg-muted/40 text-foreground",
|
|
13
|
+
destructive: "border-destructive/40 bg-destructive/5 text-destructive",
|
|
14
|
+
warning: "border-amber-500/40 bg-amber-500/5 text-amber-700 dark:text-amber-400"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
const Alert = (t0) => {
|
|
19
|
+
const $ = c(10);
|
|
20
|
+
const {
|
|
21
|
+
children,
|
|
22
|
+
className,
|
|
23
|
+
icon,
|
|
24
|
+
testId,
|
|
25
|
+
variant
|
|
26
|
+
} = t0;
|
|
27
|
+
let t1;
|
|
28
|
+
if ($[0] !== className || $[1] !== variant) {
|
|
29
|
+
t1 = cn(alertVariants({
|
|
30
|
+
variant
|
|
31
|
+
}), className);
|
|
32
|
+
$[0] = className;
|
|
33
|
+
$[1] = variant;
|
|
34
|
+
$[2] = t1;
|
|
35
|
+
} else {
|
|
36
|
+
t1 = $[2];
|
|
37
|
+
}
|
|
38
|
+
let t2;
|
|
39
|
+
if ($[3] !== children) {
|
|
40
|
+
t2 = /* @__PURE__ */ jsxDEV("div", {
|
|
41
|
+
className: "min-w-0 flex-1",
|
|
42
|
+
children
|
|
43
|
+
}, void 0, false);
|
|
44
|
+
$[3] = children;
|
|
45
|
+
$[4] = t2;
|
|
46
|
+
} else {
|
|
47
|
+
t2 = $[4];
|
|
48
|
+
}
|
|
49
|
+
let t3;
|
|
50
|
+
if ($[5] !== icon || $[6] !== t1 || $[7] !== t2 || $[8] !== testId) {
|
|
51
|
+
t3 = /* @__PURE__ */ jsxDEV("div", {
|
|
52
|
+
className: t1,
|
|
53
|
+
"data-testid": testId,
|
|
54
|
+
role: "alert",
|
|
55
|
+
children: [icon, t2]
|
|
56
|
+
}, void 0, true);
|
|
57
|
+
$[5] = icon;
|
|
58
|
+
$[6] = t1;
|
|
59
|
+
$[7] = t2;
|
|
60
|
+
$[8] = testId;
|
|
61
|
+
$[9] = t3;
|
|
62
|
+
} else {
|
|
63
|
+
t3 = $[9];
|
|
64
|
+
}
|
|
65
|
+
return t3;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export { Alert as A };
|
|
@@ -115,7 +115,7 @@ interface FunctionDescriptor {
|
|
|
115
115
|
/** Outcome of a single `FunctionRunner` invocation. */
|
|
116
116
|
type RunStatus = "error" | "idle" | "running" | "success";
|
|
117
117
|
/** Identifier for each built-in studio tab. */
|
|
118
|
-
type StudioTab = "analytics" | "api" | "audit" | "authConfig" | "authSessions" | "dashboards" | "data" | "drains" | "export" | "files" | "functions" | "health" | "home" | "insights" | "logs" | "mail" | "metrics" | "migrations" | "organizations" | "payments" | "permissions" | "pitr" | "realtime" | "rls" | "schedule" | "schema" | "security" | "settings" | "sql" | "storageRules" | "users" | "vectors" | "workflows";
|
|
118
|
+
type StudioTab = "agents" | "analytics" | "api" | "audit" | "authConfig" | "authSessions" | "containers" | "dashboards" | "data" | "drains" | "export" | "fanout" | "files" | "flags" | "functions" | "health" | "home" | "insights" | "issues" | "kv" | "logs" | "mail" | "metrics" | "migrations" | "organizations" | "payments" | "permissions" | "pitr" | "queues" | "realtime" | "rls" | "schedule" | "schema" | "security" | "settings" | "sql" | "storageRules" | "users" | "vectors" | "workflows";
|
|
119
119
|
interface StudioProps {
|
|
120
120
|
/**
|
|
121
121
|
* URL path prefix the studio is mounted under, passed to the router as its
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { c } from 'react/compiler-runtime';
|
|
3
|
+
import { LunoraError } from '@lunora/errors';
|
|
3
4
|
import { useMotionValue, useSpring, useTransform, useMotionValueEvent, motion, useReducedMotion } from 'motion/react';
|
|
4
5
|
import * as React from 'react';
|
|
5
6
|
import { useId, useEffect, useState, use, createContext, useRef } from 'react';
|
|
6
7
|
import * as RechartsPrimitive from 'recharts';
|
|
7
|
-
import { ZIndexLayer, ResponsiveContainer, LineChart, Line, BarChart, Bar as Bar$1, AreaChart, Area, XAxis as XAxis$1
|
|
8
|
+
import { ZIndexLayer, ResponsiveContainer, LineChart, Line, BarChart, Bar as Bar$1, AreaChart, Area, ReferenceLine, Rectangle, XAxis as XAxis$1 } from 'recharts';
|
|
8
9
|
import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
|
|
9
10
|
import { c as cn } from './utils-B05Dmz_H.js';
|
|
10
11
|
|
|
@@ -554,7 +555,7 @@ function validateChartConfigColors(config) {
|
|
|
554
555
|
if (value.colors) {
|
|
555
556
|
const hasValidThemeKey = VALID_THEME_KEYS.some((themeKey) => value.colors?.[themeKey] !== void 0);
|
|
556
557
|
if (!hasValidThemeKey) {
|
|
557
|
-
throw new
|
|
558
|
+
throw new LunoraError("INTERNAL", `[EvilCharts] Invalid chart config for "${key}": colors object must have at least one theme key (${VALID_THEME_KEYS.join(", ")}). Received empty object or invalid keys.`);
|
|
558
559
|
}
|
|
559
560
|
}
|
|
560
561
|
}
|
|
@@ -563,7 +564,7 @@ const ChartContext = /* @__PURE__ */ React.createContext(null);
|
|
|
563
564
|
function useChart() {
|
|
564
565
|
const context = React.useContext(ChartContext);
|
|
565
566
|
if (!context) {
|
|
566
|
-
throw new
|
|
567
|
+
throw new LunoraError("INTERNAL", "useChart must be used within a <ChartContainer />");
|
|
567
568
|
}
|
|
568
569
|
return context;
|
|
569
570
|
}
|
|
@@ -1521,7 +1522,7 @@ const BarChartContext = /* @__PURE__ */ createContext(null);
|
|
|
1521
1522
|
function useBarChart() {
|
|
1522
1523
|
const context = use(BarChartContext);
|
|
1523
1524
|
if (!context) {
|
|
1524
|
-
throw new
|
|
1525
|
+
throw new LunoraError("INTERNAL", "Bar chart parts (<Bar />, <XAxis />, …) must be used within <EvilBarChart />");
|
|
1525
1526
|
}
|
|
1526
1527
|
return context;
|
|
1527
1528
|
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
2
|
+
import { useState, useRef, useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
const storageOf = (kind = "local") => {
|
|
5
|
+
try {
|
|
6
|
+
return kind === "local" ? globalThis.localStorage : globalThis.sessionStorage;
|
|
7
|
+
} catch {
|
|
8
|
+
return void 0;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const loadJsonArray = function(key, kind = "local") {
|
|
12
|
+
try {
|
|
13
|
+
const raw = storageOf(kind)?.getItem(key) ?? void 0;
|
|
14
|
+
const parsed = raw === void 0 ? [] : JSON.parse(raw);
|
|
15
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
16
|
+
} catch {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const saveJson = (key, value, kind = "local") => {
|
|
21
|
+
const storage = storageOf(kind);
|
|
22
|
+
if (storage === void 0) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
storage.setItem(key, JSON.stringify(value));
|
|
27
|
+
} catch {
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const usePersistedList = function(key) {
|
|
31
|
+
const $ = c(8);
|
|
32
|
+
let t0;
|
|
33
|
+
if ($[0] !== key) {
|
|
34
|
+
t0 = () => loadJsonArray(key);
|
|
35
|
+
$[0] = key;
|
|
36
|
+
$[1] = t0;
|
|
37
|
+
} else {
|
|
38
|
+
t0 = $[1];
|
|
39
|
+
}
|
|
40
|
+
const [value, setValue] = useState(t0);
|
|
41
|
+
const keyRef = useRef(key);
|
|
42
|
+
let t1;
|
|
43
|
+
let t2;
|
|
44
|
+
if ($[2] !== key || $[3] !== value) {
|
|
45
|
+
t1 = () => {
|
|
46
|
+
if (keyRef.current !== key) {
|
|
47
|
+
keyRef.current = key;
|
|
48
|
+
setValue(loadJsonArray(key));
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
saveJson(key, value);
|
|
52
|
+
};
|
|
53
|
+
t2 = [key, value];
|
|
54
|
+
$[2] = key;
|
|
55
|
+
$[3] = value;
|
|
56
|
+
$[4] = t1;
|
|
57
|
+
$[5] = t2;
|
|
58
|
+
} else {
|
|
59
|
+
t1 = $[4];
|
|
60
|
+
t2 = $[5];
|
|
61
|
+
}
|
|
62
|
+
useEffect(t1, t2);
|
|
63
|
+
let t3;
|
|
64
|
+
if ($[6] !== value) {
|
|
65
|
+
t3 = [value, setValue];
|
|
66
|
+
$[6] = value;
|
|
67
|
+
$[7] = t3;
|
|
68
|
+
} else {
|
|
69
|
+
t3 = $[7];
|
|
70
|
+
}
|
|
71
|
+
return t3;
|
|
72
|
+
};
|
|
73
|
+
const usePersistedValue = function(key, fallback) {
|
|
74
|
+
const $ = c(6);
|
|
75
|
+
const [list, setList] = usePersistedList(key);
|
|
76
|
+
let t0;
|
|
77
|
+
if ($[0] !== fallback || $[1] !== setList) {
|
|
78
|
+
t0 = (action) => {
|
|
79
|
+
setList((current) => {
|
|
80
|
+
const previous = current[0] ?? fallback;
|
|
81
|
+
return [typeof action === "function" ? action(previous) : action];
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
$[0] = fallback;
|
|
85
|
+
$[1] = setList;
|
|
86
|
+
$[2] = t0;
|
|
87
|
+
} else {
|
|
88
|
+
t0 = $[2];
|
|
89
|
+
}
|
|
90
|
+
const setValue = t0;
|
|
91
|
+
const t1 = list[0] ?? fallback;
|
|
92
|
+
let t2;
|
|
93
|
+
if ($[3] !== setValue || $[4] !== t1) {
|
|
94
|
+
t2 = [t1, setValue];
|
|
95
|
+
$[3] = setValue;
|
|
96
|
+
$[4] = t1;
|
|
97
|
+
$[5] = t2;
|
|
98
|
+
} else {
|
|
99
|
+
t2 = $[5];
|
|
100
|
+
}
|
|
101
|
+
return t2;
|
|
102
|
+
};
|
|
103
|
+
const newId = (prefix) => globalThis.crypto?.randomUUID?.() ?? `${prefix}-${globalThis.performance.now().toString(36)}`;
|
|
104
|
+
|
|
105
|
+
export { storageOf as a, usePersistedValue as b, loadJsonArray as l, newId as n, saveJson as s, usePersistedList as u };
|
|
@@ -5,4 +5,4 @@ const CLOUDFLARE_R2_URL = `${CLOUDFLARE_DASH}/r2`;
|
|
|
5
5
|
const CLOUDFLARE_D1_URL = `${CLOUDFLARE_DASH}/workers/d1`;
|
|
6
6
|
const CLOUDFLARE_DURABLE_OBJECTS_URL = `${CLOUDFLARE_DASH}/workers/durable-objects`;
|
|
7
7
|
|
|
8
|
-
export {
|
|
8
|
+
export { CLOUDFLARE_D1_URL as C, CLOUDFLARE_OBSERVABILITY_URL as a, CLOUDFLARE_WORKERS_URL as b, CLOUDFLARE_DURABLE_OBJECTS_URL as c, CLOUDFLARE_R2_URL as d };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c } from 'react/compiler-runtime';
|
|
2
2
|
import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
3
|
-
import { h as formatCell } from './internal-
|
|
3
|
+
import { h as formatCell } from './internal-zwBoOv24.js';
|
|
4
4
|
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
5
5
|
|
|
6
6
|
const CellValue = (t0) => {
|
|
@@ -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-zwBoOv24.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 };
|