@lunora/studio 1.0.0-alpha.5 → 1.0.0-alpha.50

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.
Files changed (198) hide show
  1. package/LICENSE.md +6 -0
  2. package/__assets__/package-og.svg +1 -1
  3. package/dist/index.d.ts +45 -23
  4. package/dist/index.js +31 -31
  5. package/dist/mount.d.ts +1 -1
  6. package/dist/mount.js +3 -2
  7. package/dist/{packem_shared/ApiTab-W3no0KOj.js → packem_chunks/ApiTab.js} +5 -5
  8. package/dist/{packem_shared/AuditPanel-Bq4o_IqT.js → packem_chunks/AuditPanel.js} +29 -41
  9. package/dist/{packem_shared/ExportImportPanel-dxY56TDF.js → packem_chunks/ExportImportPanel.js} +16 -11
  10. package/dist/{packem_shared/FileBrowser-Dhy4zES8.js → packem_chunks/FileBrowser.js} +55 -32
  11. package/dist/{packem_shared/FunctionRunner--fQJRPAD.js → packem_chunks/FunctionRunner.js} +15 -32
  12. package/dist/{packem_shared/FunctionStatsPanel-BjRUA_G3.js → packem_chunks/FunctionStatsPanel.js} +153 -208
  13. package/dist/{packem_shared/HealthPanel-PxclMWmA.js → packem_chunks/HealthPanel.js} +37 -29
  14. package/dist/{packem_shared/InsightsPanel-CWS_C-xW.js → packem_chunks/InsightsPanel.js} +108 -69
  15. package/dist/{packem_shared/LogsPanel-CTW8CFcM.js → packem_chunks/LogsPanel.js} +46 -58
  16. package/dist/{packem_shared/MailPanel-BwkvfIHF.js → packem_chunks/MailPanel.js} +45 -139
  17. package/dist/{packem_shared/MetricsPanel-BLuOhZQ4.js → packem_chunks/MetricsPanel.js} +41 -322
  18. package/dist/{packem_shared/MigrationsPanel-DT3lnwHF.js → packem_chunks/MigrationsPanel.js} +44 -51
  19. package/dist/{packem_shared/PitrPanel-CdErL7EJ.js → packem_chunks/PitrPanel.js} +9 -9
  20. package/dist/{packem_shared/SchemaViewer-LJDcmNIO.js → packem_chunks/SchemaViewer.js} +17 -16
  21. package/dist/{packem_shared/SecurityAdvisorPanel-C_ETsPih.js → packem_chunks/SecurityAdvisorPanel.js} +47 -31
  22. package/dist/packem_chunks/SettingsPanel.js +391 -0
  23. package/dist/{packem_shared/sql-editor-panel-BFRpzj6r.js → packem_chunks/SqlEditorPanel.js} +159 -387
  24. package/dist/{packem_shared/TableEditor-ChfUOZec.js → packem_chunks/TableEditor.js} +13 -94
  25. package/dist/packem_chunks/agents-panel.js +326 -0
  26. package/dist/packem_chunks/analytics-panel.js +261 -0
  27. package/dist/packem_chunks/auth-config-panel.js +365 -0
  28. package/dist/packem_chunks/auth-sessions-panel.js +175 -0
  29. package/dist/packem_chunks/containers-panel.js +261 -0
  30. package/dist/packem_chunks/dashboards-panel.js +781 -0
  31. package/dist/packem_chunks/fanout-panel.js +482 -0
  32. package/dist/packem_chunks/flags-panel.js +176 -0
  33. package/dist/packem_chunks/issues-panel.js +188 -0
  34. package/dist/packem_chunks/kv-browser.js +1896 -0
  35. package/dist/packem_chunks/log-drains-panel.js +273 -0
  36. package/dist/packem_chunks/organizations-panel.js +3178 -0
  37. package/dist/packem_chunks/payments-panel.js +186 -0
  38. package/dist/packem_chunks/permissions-panel.js +805 -0
  39. package/dist/packem_chunks/queues-panel.js +1075 -0
  40. package/dist/packem_chunks/rls-panel.js +315 -0
  41. package/dist/packem_chunks/schedule-panel.js +831 -0
  42. package/dist/packem_chunks/sparkline.js +79 -0
  43. package/dist/packem_chunks/storage-rules-panel.js +140 -0
  44. package/dist/packem_chunks/subscriptions-panel.js +238 -0
  45. package/dist/packem_chunks/users-panel.js +1731 -0
  46. package/dist/packem_chunks/vector-browser.js +281 -0
  47. package/dist/packem_chunks/workflows-panel.js +562 -0
  48. package/dist/packem_shared/{ADMIN_FUNCTIONS-DmBqMZ-z.js → ADMIN_FUNCTIONS-DNeyYtUN.js} +8 -0
  49. package/dist/packem_shared/{ApiDocsPanel-C5-yJ1p7.js → ApiDocsPanel-_aEZxAMX.js} +2 -2
  50. package/dist/packem_shared/{ApiReferencePanel-1vubqG5s.js → ApiReferencePanel-Dd8pcswz.js} +2 -1
  51. package/dist/packem_shared/{CommandPalette-BtgkBzZI.js → CommandPalette-BXV4eKf5.js} +1 -1
  52. package/dist/packem_shared/{DataBrowser-CtBe1So9.js → DataBrowser-C8hejnub.js} +201 -250
  53. package/dist/packem_shared/{DataFilters-FNquMaiu.js → DataFilters-B1Q7mrt7.js} +6 -2
  54. package/dist/packem_shared/{GlobalDataBrowser-BTEmGrph.js → GlobalDataBrowser-CxJxRRf2.js} +37 -66
  55. package/dist/packem_shared/HomePanel-Ye8PaqQL.js +14 -0
  56. package/dist/packem_shared/{OpenRpcReferencePanel-vbcYbv3V.js → OpenRpcReferencePanel-CWaf0ZtX.js} +2 -1
  57. package/dist/packem_shared/{ScheduledJobs-CabfKbyM.js → ScheduledJobs-dHMgnJbx.js} +163 -60
  58. package/dist/packem_shared/{ShardInput-gx_DZXXn.js → ShardInput-CZnpHILL.js} +1 -1
  59. package/dist/packem_shared/Studio-xJLTlLpf.js +16 -0
  60. package/dist/packem_shared/{StudioApp-D4azxYBu.js → StudioApp-oCQholCL.js} +6 -21
  61. package/dist/packem_shared/{advisor-view-CGcfMiPq.js → advisor-view-Cx21PS_T.js} +6 -6
  62. package/dist/packem_shared/alert-CdAET2K_.js +68 -0
  63. package/dist/packem_shared/{app.d-CCmwDEVs.d.ts → app.d-CGdOmLTm.d.ts} +1 -1
  64. package/dist/packem_shared/{bar-chart-CzJAgqkp.js → bar-chart-DSwcWIRy.js} +5 -4
  65. package/dist/packem_shared/browser-storage-L4gOP5gJ.js +105 -0
  66. package/dist/packem_shared/{cf-links-2cktDedA.js → cf-links-BZfRdxSE.js} +1 -1
  67. package/dist/packem_shared/{data-grid-B5CaV3wS.js → data-grid-C9I16KWr.js} +1 -1
  68. package/dist/packem_shared/data-view-params-Cd6yRVbv.js +96 -0
  69. package/dist/packem_shared/error-alert-vIPQoN3Y.js +114 -0
  70. package/dist/packem_shared/{grid-features-CzUfqgsM.js → grid-features-B_fZH4iQ.js} +133 -164
  71. package/dist/packem_shared/home-panel-D62G8108.js +1889 -0
  72. package/dist/packem_shared/internal-zwBoOv24.js +122 -0
  73. package/dist/packem_shared/modal-shell-hyaJvIJ6.js +100 -0
  74. package/dist/packem_shared/{reference-view-B4E49Lip.js → reference-view-DUULLuOi.js} +8 -61
  75. package/dist/packem_shared/result-chart-DZradBAS.js +119 -0
  76. package/dist/packem_shared/scroll-area-DLhcy-ml.js +93 -0
  77. package/dist/packem_shared/select-UkNYCT3s.js +273 -0
  78. package/dist/packem_shared/shard-history-AxiJ1WPP.js +16 -0
  79. package/dist/packem_shared/skeleton-CGhL0p20.js +45 -0
  80. package/dist/packem_shared/{sparkline-10dG-_f0.js → sparkline-BnA1kC9X.js} +1 -1
  81. package/dist/packem_shared/studio-WZUOecDv.js +4069 -0
  82. package/dist/packem_shared/{table-_RzNvy3R.js → table-DsCa9Qp9.js} +1 -1
  83. package/dist/packem_shared/{table-list-sidebar-Bg7uzbvC.js → table-list-sidebar-huX4VmgI.js} +19 -9
  84. package/dist/packem_shared/use-admin-query-BGJ010yZ.js +106 -0
  85. package/dist/packem_shared/use-async-submit-DGCtuDyz.js +91 -0
  86. package/dist/standalone/chunk-22C6COGE.js +13 -0
  87. package/dist/standalone/chunk-2CCWLKQW.js +1 -0
  88. package/dist/standalone/chunk-2JTPX3CV.js +1 -0
  89. package/dist/standalone/chunk-2K47A3P6.js +1 -0
  90. package/dist/standalone/chunk-2MLA6WFH.js +1 -0
  91. package/dist/standalone/chunk-2NGUNNGW.js +1 -0
  92. package/dist/standalone/chunk-3CPQ5IQU.js +1 -0
  93. package/dist/standalone/chunk-3GXGLNKW.js +1 -0
  94. package/dist/standalone/chunk-3OA7PECS.js +6 -0
  95. package/dist/standalone/chunk-4AXW2ECS.js +13 -0
  96. package/dist/standalone/chunk-4BVRLBEW.js +1 -0
  97. package/dist/standalone/chunk-4PC7IXNY.js +1 -0
  98. package/dist/standalone/chunk-4QHKBC77.js +1 -0
  99. package/dist/standalone/chunk-5OIBXYZM.js +1 -0
  100. package/dist/standalone/chunk-5OZQHQ26.js +1 -0
  101. package/dist/standalone/chunk-6RREMPQX.js +2 -0
  102. package/dist/standalone/chunk-6ZBU3JWR.js +3 -0
  103. package/dist/standalone/chunk-7LDYSHOU.js +1 -0
  104. package/dist/standalone/chunk-7TJJXVSE.js +1 -0
  105. package/dist/standalone/chunk-A2DBMISD.js +1 -0
  106. package/dist/standalone/chunk-A3ZJACVT.js +4 -0
  107. package/dist/standalone/chunk-A66LI6OV.js +4 -0
  108. package/dist/standalone/chunk-AHILM3ZP.js +1 -0
  109. package/dist/standalone/chunk-AITOCPML.js +1 -0
  110. package/dist/standalone/chunk-APSSZB6Z.js +1 -0
  111. package/dist/standalone/chunk-BGG56IF5.js +1 -0
  112. package/dist/standalone/chunk-BJGBHGK3.js +1 -0
  113. package/dist/standalone/chunk-CJXJIRSN.js +1 -0
  114. package/dist/standalone/chunk-CKSHCYGC.js +2 -0
  115. package/dist/standalone/chunk-DR6LGPXE.js +1 -0
  116. package/dist/standalone/chunk-DWDILV2E.js +1 -0
  117. package/dist/standalone/chunk-EEWKIQUE.js +1 -0
  118. package/dist/standalone/chunk-EOE5NDMK.js +1 -0
  119. package/dist/standalone/chunk-FAUN4Z72.js +1 -0
  120. package/dist/standalone/chunk-G7ZBM54M.js +1 -0
  121. package/dist/standalone/chunk-GTM65MVX.js +1 -0
  122. package/dist/standalone/chunk-HAJSYWFT.js +8 -0
  123. package/dist/standalone/chunk-HQM6MBPS.js +1 -0
  124. package/dist/standalone/chunk-HTQNZXDT.js +1 -0
  125. package/dist/standalone/chunk-HV7G6DFP.js +5 -0
  126. package/dist/standalone/chunk-IO2XEI6T.js +1 -0
  127. package/dist/standalone/chunk-ITQKVEP7.js +19 -0
  128. package/dist/standalone/chunk-IZN4TYMN.js +1 -0
  129. package/dist/standalone/chunk-J6J54MBP.js +1 -0
  130. package/dist/standalone/chunk-JM7XBQVK.js +1 -0
  131. package/dist/standalone/chunk-JPILGFXT.js +1 -0
  132. package/dist/standalone/chunk-JSEXCW5Q.js +1 -0
  133. package/dist/standalone/chunk-JUDPYSJZ.js +1 -0
  134. package/dist/standalone/chunk-K4S652EQ.js +4 -0
  135. package/dist/standalone/chunk-KEGAWN6Y.js +1 -0
  136. package/dist/standalone/chunk-KJFFID72.js +1 -0
  137. package/dist/standalone/chunk-KJJ3WM6H.js +4 -0
  138. package/dist/standalone/chunk-KZ6INM5M.js +1 -0
  139. package/dist/standalone/chunk-L7SK4ZZD.js +1 -0
  140. package/dist/standalone/chunk-LAK5VSPI.js +1 -0
  141. package/dist/standalone/chunk-LJAAZNQ6.js +1 -0
  142. package/dist/standalone/chunk-LUP4YTBS.js +1 -0
  143. package/dist/standalone/chunk-LX7KONE3.js +1 -0
  144. package/dist/standalone/chunk-MDTNVR3G.js +1 -0
  145. package/dist/standalone/chunk-NS23QR4W.js +1 -0
  146. package/dist/standalone/chunk-NW6SZZ5O.js +1 -0
  147. package/dist/standalone/chunk-O3NAGRTR.js +1 -0
  148. package/dist/standalone/chunk-P2ERTKMB.js +1 -0
  149. package/dist/standalone/chunk-PS3XCCZD.js +1 -0
  150. package/dist/standalone/chunk-QAFAJBAW.js +1 -0
  151. package/dist/standalone/chunk-RRCPZMC2.js +22 -0
  152. package/dist/standalone/chunk-RS7S7XVP.js +1 -0
  153. package/dist/standalone/chunk-S5NTGHCG.js +1 -0
  154. package/dist/standalone/chunk-S7AB7Y75.js +1 -0
  155. package/dist/standalone/chunk-SDMZKBTD.js +1 -0
  156. package/dist/standalone/chunk-SDQE2IUJ.js +1 -0
  157. package/dist/standalone/chunk-SEU5V7I6.js +1 -0
  158. package/dist/standalone/chunk-SHERR7ZP.js +1 -0
  159. package/dist/standalone/chunk-SHJUAHC6.js +1 -0
  160. package/dist/standalone/chunk-TAD43CG5.js +1 -0
  161. package/dist/standalone/chunk-TO6D2PJC.js +6 -0
  162. package/dist/standalone/chunk-TQ36RWOP.js +1 -0
  163. package/dist/standalone/chunk-TYN6SQ73.js +1 -0
  164. package/dist/standalone/chunk-U26QNHMO.js +1 -0
  165. package/dist/standalone/chunk-UK64ZSUW.js +1 -0
  166. package/dist/standalone/chunk-UTHHHJYS.js +1 -0
  167. package/dist/standalone/chunk-V43BLH4J.js +1 -0
  168. package/dist/standalone/chunk-VL23Y44O.js +4 -0
  169. package/dist/standalone/chunk-VL6HOZHF.js +1 -0
  170. package/dist/standalone/chunk-VLXV72QE.js +1 -0
  171. package/dist/standalone/chunk-W666BB6V.js +1 -0
  172. package/dist/standalone/chunk-W6JKUZKD.js +1 -0
  173. package/dist/standalone/chunk-WI7GWFEG.js +1 -0
  174. package/dist/standalone/chunk-WUFVFVHJ.js +1 -0
  175. package/dist/standalone/chunk-WVTPZ6CM.js +1 -0
  176. package/dist/standalone/chunk-X2TQRMQV.js +1 -0
  177. package/dist/standalone/chunk-X4676IX6.js +1 -0
  178. package/dist/standalone/chunk-X4QFAAZ5.js +76 -0
  179. package/dist/standalone/chunk-XJU5SRNL.js +4 -0
  180. package/dist/standalone/chunk-XNJNSCLM.js +1 -0
  181. package/dist/standalone/chunk-XWPZBZSZ.js +3 -0
  182. package/dist/standalone/chunk-YLHDKM2P.js +1 -0
  183. package/dist/standalone/chunk-ZHVTQ37P.js +1 -0
  184. package/dist/standalone/chunk-ZIGWVHCS.js +1 -0
  185. package/dist/standalone/chunk-ZPP2KOR4.js +1 -0
  186. package/dist/standalone/chunk-ZPUO7FNI.js +1 -0
  187. package/dist/standalone/studio.js +104 -246
  188. package/dist/styles.css +2 -2
  189. package/package.json +17 -15
  190. package/dist/packem_shared/HomePanel-Cw16stjq.js +0 -1273
  191. package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
  192. package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
  193. package/dist/packem_shared/Studio-BmSGSIuY.js +0 -33
  194. package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
  195. package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
  196. package/dist/packem_shared/studio-H9fuQgSj.js +0 -10303
  197. package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
  198. package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
@@ -0,0 +1,122 @@
1
+ const dispatchByKind = (client, kind, reference, args, options) => {
2
+ switch (kind) {
3
+ case "action": {
4
+ return client.action(reference, args, options);
5
+ }
6
+ case "mutation": {
7
+ return client.mutation(reference, args, options);
8
+ }
9
+ default: {
10
+ return client.query(reference, args, options);
11
+ }
12
+ }
13
+ };
14
+ const adminRef = (path) => {
15
+ return {
16
+ __lunoraRef: path
17
+ };
18
+ };
19
+ const callOptions = (shardKey) => {
20
+ const trimmed = shardKey.trim();
21
+ return trimmed === "" ? {} : {
22
+ shardKey: trimmed
23
+ };
24
+ };
25
+ const errorMessage = (error) => error instanceof Error ? error.message : String(error);
26
+ const errorHint = (error) => {
27
+ if (error === null || typeof error !== "object" || !("hint" in error)) {
28
+ return void 0;
29
+ }
30
+ const {
31
+ hint
32
+ } = error;
33
+ if (typeof hint === "string") {
34
+ return hint;
35
+ }
36
+ return Array.isArray(hint) ? hint.filter((line) => typeof line === "string").join("\n") : void 0;
37
+ };
38
+ const errorDocumentationUrl = (error) => {
39
+ if (error === null || typeof error !== "object" || !("docsUrl" in error)) {
40
+ return void 0;
41
+ }
42
+ const value = error.docsUrl;
43
+ if (typeof value !== "string") {
44
+ return void 0;
45
+ }
46
+ try {
47
+ const {
48
+ protocol
49
+ } = new URL(value);
50
+ return protocol === "http:" || protocol === "https:" ? value : void 0;
51
+ } catch {
52
+ return void 0;
53
+ }
54
+ };
55
+ const formatCell = (value) => {
56
+ if (value === null || value === void 0) {
57
+ return "";
58
+ }
59
+ switch (typeof value) {
60
+ case "bigint":
61
+ case "boolean":
62
+ case "number": {
63
+ return value.toString();
64
+ }
65
+ case "string": {
66
+ return value;
67
+ }
68
+ case "symbol": {
69
+ return value.toString();
70
+ }
71
+ default: {
72
+ return JSON.stringify(value);
73
+ }
74
+ }
75
+ };
76
+ const fireAndForget = (promise, onError) => {
77
+ promise.catch((error) => {
78
+ });
79
+ };
80
+ const resolveOrigin = (explicit) => {
81
+ if (explicit !== void 0 && explicit !== "") {
82
+ return explicit;
83
+ }
84
+ const loc = globalThis.location;
85
+ if (loc?.origin !== void 0 && loc.origin !== "") {
86
+ return loc.origin;
87
+ }
88
+ return "http://localhost:5173";
89
+ };
90
+ const copyToClipboard = (text) => {
91
+ const clipboard = "navigator" in globalThis ? globalThis.navigator.clipboard : void 0;
92
+ if (clipboard === void 0) {
93
+ return false;
94
+ }
95
+ fireAndForget(clipboard.writeText(text));
96
+ return true;
97
+ };
98
+ const formatBytes = (bytes) => {
99
+ if (bytes === null || bytes === void 0) {
100
+ return "—";
101
+ }
102
+ if (bytes < 1024) {
103
+ return `${bytes.toString()} B`;
104
+ }
105
+ const units = ["KB", "MB", "GB", "TB"];
106
+ let value = bytes / 1024;
107
+ let unit = 0;
108
+ while (value >= 1024 && unit < units.length - 1) {
109
+ value /= 1024;
110
+ unit += 1;
111
+ }
112
+ return `${value.toFixed(1)} ${units[unit] ?? "TB"}`;
113
+ };
114
+ const formatTimestamp = (value, fallback = "") => {
115
+ if (value === null || value === void 0 || value === "") {
116
+ return fallback;
117
+ }
118
+ const date = new Date(value);
119
+ return Number.isNaN(date.getTime()) ? String(value) : date.toLocaleString();
120
+ };
121
+
122
+ export { adminRef as a, errorHint as b, callOptions as c, errorDocumentationUrl as d, errorMessage as e, fireAndForget as f, copyToClipboard as g, formatCell as h, formatTimestamp as i, dispatchByKind as j, formatBytes as k, resolveOrigin as r };
@@ -0,0 +1,100 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import { c as cn } from './utils-B05Dmz_H.js';
3
+ import { jsxDEV } from 'react/jsx-dev-runtime';
4
+
5
+ const OVERLAY_BY_VARIANT = {
6
+ dialog: "fixed inset-0 z-[1000] flex justify-center bg-black/20 pt-[10vh]",
7
+ drawer: "fixed inset-0 z-[1000] flex justify-end bg-black/20"
8
+ };
9
+ const PANEL_BY_VARIANT = {
10
+ dialog: "flex h-fit w-[min(28rem,92vw)] flex-col gap-3 rounded-lg border border-border bg-background p-4 shadow-xl",
11
+ drawer: "flex h-full w-[min(34rem,100vw)] flex-col gap-4 overflow-auto border-l border-border bg-background p-4 shadow-xl"
12
+ };
13
+ const ModalShell = (t0) => {
14
+ const $ = c(18);
15
+ const {
16
+ className,
17
+ children,
18
+ label,
19
+ onClose,
20
+ panelTestId,
21
+ testId,
22
+ variant
23
+ } = t0;
24
+ let t1;
25
+ if ($[0] !== onClose) {
26
+ t1 = (event) => {
27
+ if (event.target === event.currentTarget) {
28
+ onClose();
29
+ }
30
+ };
31
+ $[0] = onClose;
32
+ $[1] = t1;
33
+ } else {
34
+ t1 = $[1];
35
+ }
36
+ const onOverlayClick = t1;
37
+ let t2;
38
+ if ($[2] !== onClose) {
39
+ t2 = (event_0) => {
40
+ if (event_0.key === "Escape") {
41
+ onClose();
42
+ }
43
+ };
44
+ $[2] = onClose;
45
+ $[3] = t2;
46
+ } else {
47
+ t2 = $[3];
48
+ }
49
+ const onOverlayKeyDown = t2;
50
+ const t3 = OVERLAY_BY_VARIANT[variant];
51
+ const t4 = PANEL_BY_VARIANT[variant];
52
+ let t5;
53
+ if ($[4] !== className || $[5] !== t4) {
54
+ t5 = cn(t4, className);
55
+ $[4] = className;
56
+ $[5] = t4;
57
+ $[6] = t5;
58
+ } else {
59
+ t5 = $[6];
60
+ }
61
+ let t6;
62
+ if ($[7] !== children || $[8] !== label || $[9] !== panelTestId || $[10] !== t5) {
63
+ t6 = /* @__PURE__ */ jsxDEV("div", {
64
+ "aria-label": label,
65
+ className: t5,
66
+ "data-testid": panelTestId,
67
+ role: "dialog",
68
+ children
69
+ }, void 0, false);
70
+ $[7] = children;
71
+ $[8] = label;
72
+ $[9] = panelTestId;
73
+ $[10] = t5;
74
+ $[11] = t6;
75
+ } else {
76
+ t6 = $[11];
77
+ }
78
+ let t7;
79
+ if ($[12] !== onOverlayClick || $[13] !== onOverlayKeyDown || $[14] !== t3 || $[15] !== t6 || $[16] !== testId) {
80
+ t7 = /* @__PURE__ */ jsxDEV("div", {
81
+ className: t3,
82
+ "data-testid": testId,
83
+ onClick: onOverlayClick,
84
+ onKeyDown: onOverlayKeyDown,
85
+ role: "presentation",
86
+ children: t6
87
+ }, void 0, false);
88
+ $[12] = onOverlayClick;
89
+ $[13] = onOverlayKeyDown;
90
+ $[14] = t3;
91
+ $[15] = t6;
92
+ $[16] = testId;
93
+ $[17] = t7;
94
+ } else {
95
+ t7 = $[17];
96
+ }
97
+ return t7;
98
+ };
99
+
100
+ export { ModalShell as M };
@@ -1,58 +1,19 @@
1
1
  import { c } from 'react/compiler-runtime';
2
- import { c as cn } from './utils-B05Dmz_H.js';
3
- import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
4
2
  import { useState, useEffect, createContext, use } from 'react';
5
- import { e as errorMessage, g as copyToClipboard, f as fireAndForget, c as callOptions, a as adminRef } from './internal-rXJEAhXS.js';
3
+ import { e as errorMessage, g as copyToClipboard, f as fireAndForget, j as dispatchByKind, c as callOptions, a as adminRef } from './internal-zwBoOv24.js';
6
4
  import { SentIcon, Copy01Icon, Search01Icon } from '@hugeicons/core-free-icons';
7
5
  import { HugeiconsIcon } from '@hugeicons/react';
8
6
  import { I as Input } from './input-XH4r1Pt1.js';
9
7
  import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
10
8
  import { B as Button } from './button-BhsN2uZH.js';
9
+ import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
11
10
  import { B as Badge$1 } from './badge-B2PKA1-5.js';
12
- import { ShardInput } from './ShardInput-gx_DZXXn.js';
11
+ import { ShardInput } from './ShardInput-CZnpHILL.js';
13
12
  import { L as Label } from './label-D8ykjn5J.js';
14
13
  import { T as Textarea } from './textarea-D3gaCU_-.js';
14
+ import { LunoraError } from '@lunora/errors';
15
15
  import { useLunora } from '@lunora/react';
16
-
17
- function Skeleton(t0) {
18
- const $ = c(8);
19
- let className;
20
- let props;
21
- if ($[0] !== t0) {
22
- ({
23
- className,
24
- ...props
25
- } = t0);
26
- $[0] = t0;
27
- $[1] = className;
28
- $[2] = props;
29
- } else {
30
- className = $[1];
31
- props = $[2];
32
- }
33
- let t1;
34
- if ($[3] !== className) {
35
- t1 = cn("animate-pulse rounded-md bg-muted", className);
36
- $[3] = className;
37
- $[4] = t1;
38
- } else {
39
- t1 = $[4];
40
- }
41
- let t2;
42
- if ($[5] !== props || $[6] !== t1) {
43
- t2 = /* @__PURE__ */ jsxDEV("div", {
44
- "data-slot": "skeleton",
45
- className: t1,
46
- ...props
47
- }, void 0, false);
48
- $[5] = props;
49
- $[6] = t1;
50
- $[7] = t2;
51
- } else {
52
- t2 = $[7];
53
- }
54
- return t2;
55
- }
16
+ import { c as cn } from './utils-B05Dmz_H.js';
56
17
 
57
18
  const useAdminSpec = function(inlineSpec, fetcher, classify) {
58
19
  const $ = c(10);
@@ -855,7 +816,7 @@ const OperationRunContext = /* @__PURE__ */ createContext(null);
855
816
  const useOperationRun = () => {
856
817
  const value = use(OperationRunContext);
857
818
  if (value === null) {
858
- throw new Error("useOperationRun must be used within an OperationRunProvider");
819
+ throw new LunoraError("INTERNAL", "useOperationRun must be used within an OperationRunProvider");
859
820
  }
860
821
  return value;
861
822
  };
@@ -905,21 +866,7 @@ const OperationRunProvider = ({
905
866
  value = text;
906
867
  }
907
868
  } else {
908
- const reference = adminRef(operation.functionPath);
909
- const options = callOptions(shardKey);
910
- switch (operation.kind) {
911
- case "action": {
912
- value = await client.action(reference, parsedArgs, options);
913
- break;
914
- }
915
- case "mutation": {
916
- value = await client.mutation(reference, parsedArgs, options);
917
- break;
918
- }
919
- default: {
920
- value = await client.query(reference, parsedArgs, options);
921
- }
922
- }
869
+ value = await dispatchByKind(client, operation.kind, adminRef(operation.functionPath), parsedArgs, callOptions(shardKey));
923
870
  }
924
871
  setResponse(value);
925
872
  setDurationMs(Math.round(performance.now() - startedAt));
@@ -2177,4 +2124,4 @@ const ReferenceView = (t0) => {
2177
2124
  return t14;
2178
2125
  };
2179
2126
 
2180
- export { ReferenceView as R, Skeleton as S, useAdminSpec as u };
2127
+ export { ReferenceView as R, useAdminSpec as u };
@@ -0,0 +1,119 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
3
+ import { h as formatCell } from './internal-zwBoOv24.js';
4
+ import { X as XAxis, B as Bar, T as Tooltip, E as EvilBarChart } from './bar-chart-DSwcWIRy.js';
5
+ import { jsxDEV } from 'react/jsx-dev-runtime';
6
+
7
+ const MAX_BARS = 50;
8
+ const RESULT_CHART_CONFIG = {
9
+ value: {
10
+ colors: {
11
+ dark: ["var(--chart-1)"],
12
+ light: ["var(--chart-1)"]
13
+ },
14
+ label: "value"
15
+ }
16
+ };
17
+ const pickColumns = (result) => {
18
+ const value = result.columns.find((column) => result.rows.length > 0 && result.rows.every((row) => typeof row[column] === "number")) ?? null;
19
+ const label = result.columns.find((column) => column !== value) ?? null;
20
+ return {
21
+ label,
22
+ value
23
+ };
24
+ };
25
+ const SqlResultChart = (t0) => {
26
+ const $ = c(15);
27
+ const {
28
+ result
29
+ } = t0;
30
+ const t = useT();
31
+ let t1;
32
+ if ($[0] !== result) {
33
+ t1 = pickColumns(result);
34
+ $[0] = result;
35
+ $[1] = t1;
36
+ } else {
37
+ t1 = $[1];
38
+ }
39
+ const {
40
+ label,
41
+ value
42
+ } = t1;
43
+ let t2;
44
+ if ($[2] !== label || $[3] !== result || $[4] !== value) {
45
+ t2 = value === null ? [] : result.rows.slice(0, MAX_BARS).map((row, index) => ({
46
+ label: label === null ? `#${(index + 1).toString()}` : formatCell(row[label]),
47
+ value: Number(row[value]) || 0
48
+ }));
49
+ $[2] = label;
50
+ $[3] = result;
51
+ $[4] = value;
52
+ $[5] = t2;
53
+ } else {
54
+ t2 = $[5];
55
+ }
56
+ const data = t2;
57
+ if (value === null) {
58
+ let t32;
59
+ if ($[6] !== t) {
60
+ t32 = t("No numeric column to chart.");
61
+ $[6] = t;
62
+ $[7] = t32;
63
+ } else {
64
+ t32 = $[7];
65
+ }
66
+ let t42;
67
+ if ($[8] !== t32) {
68
+ t42 = /* @__PURE__ */ jsxDEV("p", {
69
+ className: "p-4 text-sm text-muted-foreground",
70
+ "data-testid": "sql-chart-empty",
71
+ children: t32
72
+ }, void 0, false);
73
+ $[8] = t32;
74
+ $[9] = t42;
75
+ } else {
76
+ t42 = $[9];
77
+ }
78
+ return t42;
79
+ }
80
+ let t3;
81
+ let t4;
82
+ let t5;
83
+ if ($[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
84
+ t3 = /* @__PURE__ */ jsxDEV(XAxis, {
85
+ dataKey: "label"
86
+ }, void 0, false);
87
+ t4 = /* @__PURE__ */ jsxDEV(Bar, {
88
+ dataKey: "value"
89
+ }, void 0, false);
90
+ t5 = /* @__PURE__ */ jsxDEV(Tooltip, {}, void 0, false);
91
+ $[10] = t3;
92
+ $[11] = t4;
93
+ $[12] = t5;
94
+ } else {
95
+ t3 = $[10];
96
+ t4 = $[11];
97
+ t5 = $[12];
98
+ }
99
+ let t6;
100
+ if ($[13] !== data) {
101
+ t6 = /* @__PURE__ */ jsxDEV("div", {
102
+ className: "h-80 w-full p-3",
103
+ "data-testid": "sql-chart",
104
+ children: /* @__PURE__ */ jsxDEV(EvilBarChart, {
105
+ className: "h-full w-full",
106
+ config: RESULT_CHART_CONFIG,
107
+ data,
108
+ children: [t3, t4, t5]
109
+ }, void 0, true)
110
+ }, void 0, false);
111
+ $[13] = data;
112
+ $[14] = t6;
113
+ } else {
114
+ t6 = $[14];
115
+ }
116
+ return t6;
117
+ };
118
+
119
+ export { SqlResultChart as S };
@@ -0,0 +1,93 @@
1
+ 'use client';
2
+ import { c } from 'react/compiler-runtime';
3
+ import { ScrollArea as ScrollArea$1 } from '@base-ui/react/scroll-area';
4
+ import { c as cn } from './utils-B05Dmz_H.js';
5
+ import { jsxDEV } from 'react/jsx-dev-runtime';
6
+
7
+ function ScrollArea(t0) {
8
+ const $ = c(14);
9
+ let children;
10
+ let className;
11
+ let props;
12
+ if ($[0] !== t0) {
13
+ ({
14
+ className,
15
+ children,
16
+ ...props
17
+ } = t0);
18
+ $[0] = t0;
19
+ $[1] = children;
20
+ $[2] = className;
21
+ $[3] = props;
22
+ } else {
23
+ children = $[1];
24
+ className = $[2];
25
+ props = $[3];
26
+ }
27
+ let t1;
28
+ if ($[4] !== className) {
29
+ t1 = cn("relative", className);
30
+ $[4] = className;
31
+ $[5] = t1;
32
+ } else {
33
+ t1 = $[5];
34
+ }
35
+ let t2;
36
+ if ($[6] !== children) {
37
+ t2 = /* @__PURE__ */ jsxDEV(ScrollArea$1.Viewport, {
38
+ "data-slot": "scroll-area-viewport",
39
+ className: "size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",
40
+ children
41
+ }, void 0, false);
42
+ $[6] = children;
43
+ $[7] = t2;
44
+ } else {
45
+ t2 = $[7];
46
+ }
47
+ let t3;
48
+ let t4;
49
+ if ($[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
50
+ t3 = /* @__PURE__ */ jsxDEV(ScrollBar, {}, void 0, false);
51
+ t4 = /* @__PURE__ */ jsxDEV(ScrollArea$1.Corner, {}, void 0, false);
52
+ $[8] = t3;
53
+ $[9] = t4;
54
+ } else {
55
+ t3 = $[8];
56
+ t4 = $[9];
57
+ }
58
+ let t5;
59
+ if ($[10] !== props || $[11] !== t1 || $[12] !== t2) {
60
+ t5 = /* @__PURE__ */ jsxDEV(ScrollArea$1.Root, {
61
+ "data-slot": "scroll-area",
62
+ className: t1,
63
+ ...props,
64
+ children: [t2, t3, t4]
65
+ }, void 0, true);
66
+ $[10] = props;
67
+ $[11] = t1;
68
+ $[12] = t2;
69
+ $[13] = t5;
70
+ } else {
71
+ t5 = $[13];
72
+ }
73
+ return t5;
74
+ }
75
+ function ScrollBar({
76
+ className,
77
+ orientation = "vertical",
78
+ ...props
79
+ }) {
80
+ return /* @__PURE__ */ jsxDEV(ScrollArea$1.Scrollbar, {
81
+ "data-slot": "scroll-area-scrollbar",
82
+ "data-orientation": orientation,
83
+ orientation,
84
+ className: cn("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-s data-vertical:border-s-transparent", className),
85
+ ...props,
86
+ children: /* @__PURE__ */ jsxDEV(ScrollArea$1.Thumb, {
87
+ "data-slot": "scroll-area-thumb",
88
+ className: "relative flex-1 rounded-md bg-border"
89
+ }, void 0, false)
90
+ }, void 0, false);
91
+ }
92
+
93
+ export { ScrollArea as S };