@lunora/studio 1.0.0-alpha.37 → 1.0.0-alpha.39

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 (140) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +10 -10
  3. package/dist/mount.js +1 -1
  4. package/dist/packem_chunks/ApiTab.js +3 -3
  5. package/dist/packem_chunks/AuditPanel.js +3 -3
  6. package/dist/packem_chunks/ExportImportPanel.js +2 -2
  7. package/dist/packem_chunks/FileBrowser.js +2 -2
  8. package/dist/packem_chunks/FunctionRunner.js +1 -1
  9. package/dist/packem_chunks/FunctionStatsPanel.js +3 -3
  10. package/dist/packem_chunks/HealthPanel.js +2 -2
  11. package/dist/packem_chunks/InsightsPanel.js +3 -3
  12. package/dist/packem_chunks/LogsPanel.js +2 -2
  13. package/dist/packem_chunks/MailPanel.js +3 -3
  14. package/dist/packem_chunks/MetricsPanel.js +2 -2
  15. package/dist/packem_chunks/MigrationsPanel.js +3 -3
  16. package/dist/packem_chunks/PitrPanel.js +1 -1
  17. package/dist/packem_chunks/SchemaViewer.js +1 -1
  18. package/dist/packem_chunks/SecurityAdvisorPanel.js +2 -2
  19. package/dist/packem_chunks/SettingsPanel.js +2 -2
  20. package/dist/packem_chunks/SqlEditorPanel.js +149 -139
  21. package/dist/packem_chunks/TableEditor.js +3 -3
  22. package/dist/packem_chunks/analytics-panel.js +1 -1
  23. package/dist/packem_chunks/auth-config-panel.js +291 -105
  24. package/dist/packem_chunks/auth-sessions-panel.js +2 -2
  25. package/dist/packem_chunks/containers-panel.js +1 -1
  26. package/dist/packem_chunks/dashboards-panel.js +2 -2
  27. package/dist/packem_chunks/fanout-panel.js +2 -2
  28. package/dist/packem_chunks/flags-panel.js +2 -2
  29. package/dist/packem_chunks/kv-browser.js +2 -2
  30. package/dist/packem_chunks/log-drains-panel.js +1 -1
  31. package/dist/packem_chunks/organizations-panel.js +3003 -495
  32. package/dist/packem_chunks/payments-panel.js +3 -3
  33. package/dist/packem_chunks/permissions-panel.js +3 -3
  34. package/dist/packem_chunks/queues-panel.js +242 -219
  35. package/dist/packem_chunks/rls-panel.js +2 -2
  36. package/dist/packem_chunks/schedule-panel.js +3 -3
  37. package/dist/packem_chunks/storage-rules-panel.js +2 -2
  38. package/dist/packem_chunks/subscriptions-panel.js +2 -2
  39. package/dist/packem_chunks/users-panel.js +577 -111
  40. package/dist/packem_chunks/vector-browser.js +1 -1
  41. package/dist/packem_chunks/workflows-panel.js +2 -2
  42. package/dist/packem_shared/{ApiDocsPanel-D4CJf2ad.js → ApiDocsPanel-CBma-lnp.js} +1 -1
  43. package/dist/packem_shared/{ApiReferencePanel-Co_wpRF2.js → ApiReferencePanel-CQM3pPN7.js} +1 -1
  44. package/dist/packem_shared/{CommandPalette-BUPpbpMc.js → CommandPalette-X2tkbyHk.js} +1 -1
  45. package/dist/packem_shared/{DataBrowser-BeVNxSVm.js → DataBrowser-D2ywrdId.js} +5 -5
  46. package/dist/packem_shared/{GlobalDataBrowser-ErfvIs1S.js → GlobalDataBrowser-BkTPLzAY.js} +3 -3
  47. package/dist/packem_shared/{HomePanel-D9MQk8I7.js → HomePanel-D1Q9LZgK.js} +3 -3
  48. package/dist/packem_shared/{OpenRpcReferencePanel-DLWzrIx9.js → OpenRpcReferencePanel-Dno-hfDb.js} +1 -1
  49. package/dist/packem_shared/{ScheduledJobs-ClaNpZsg.js → ScheduledJobs-Ctw4jYtU.js} +2 -2
  50. package/dist/packem_shared/{Studio-C48P1K5W.js → Studio-lJhzDAze.js} +4 -4
  51. package/dist/packem_shared/{StudioApp-Cqh-SYm2.js → StudioApp-DiMkupvZ.js} +3 -12
  52. package/dist/packem_shared/{advisor-view-D3-U4kRR.js → advisor-view-BX8OhG0w.js} +1 -1
  53. package/dist/packem_shared/{browser-storage-tLOxkIHd.js → browser-storage-BTrX4y3B.js} +32 -2
  54. package/dist/packem_shared/{data-grid-Jz8FqQ2C.js → data-grid-CdXztApG.js} +1 -1
  55. package/dist/packem_shared/{error-alert-BBT6D22d.js → error-alert-CXjqyGw9.js} +1 -1
  56. package/dist/packem_shared/{grid-features-CUr8Z1_O.js → grid-features-BF-KBDFz.js} +128 -65
  57. package/dist/packem_shared/{home-panel-CoGxi-oj.js → home-panel-TFcRf9Ui.js} +272 -22
  58. package/dist/packem_shared/{internal-DTsYVn-g.js → internal-CYcbqMjX.js} +15 -3
  59. package/dist/packem_shared/{reference-view-CSKyUyPl.js → reference-view-DUiJcILV.js} +1 -1
  60. package/dist/packem_shared/{studio-CPHA_-3I.js → studio-Dh9UlaF_.js} +3 -3
  61. package/dist/packem_shared/{table-list-sidebar-B5psdSV1.js → table-list-sidebar-UVIXQJdU.js} +1 -1
  62. package/dist/packem_shared/{use-admin-query-BHPKmPuj.js → use-admin-query-CfHYWx5n.js} +1 -1
  63. package/dist/packem_shared/use-async-submit-DJQiPc-_.js +91 -0
  64. package/dist/standalone/{chunk-M55U7NHO.js → chunk-23C4TCRO.js} +1 -1
  65. package/dist/standalone/{chunk-TO4JQX7W.js → chunk-5ZAA2PVR.js} +1 -1
  66. package/dist/standalone/{chunk-MPTM7ZU3.js → chunk-676HEBIR.js} +1 -1
  67. package/dist/standalone/{chunk-Y2ZPNDL7.js → chunk-6VO23MMW.js} +1 -1
  68. package/dist/standalone/{chunk-OIZ4CHPN.js → chunk-7RE5UW27.js} +1 -1
  69. package/dist/standalone/chunk-7YXOPTWI.js +1 -0
  70. package/dist/standalone/{chunk-QLM6FYZW.js → chunk-AAVIFQ4Y.js} +1 -1
  71. package/dist/standalone/{chunk-ATYUMPDM.js → chunk-AJFQ3LNM.js} +1 -1
  72. package/dist/standalone/chunk-AJULNB46.js +4 -0
  73. package/dist/standalone/{chunk-6GFEVKJP.js → chunk-BGXOXASQ.js} +1 -1
  74. package/dist/standalone/{chunk-2THHW7BC.js → chunk-BKW7FFEO.js} +1 -1
  75. package/dist/standalone/{chunk-YEVCU7TB.js → chunk-BXOYVWJR.js} +1 -1
  76. package/dist/standalone/{chunk-DVKPRFIJ.js → chunk-C7WTJLC3.js} +1 -1
  77. package/dist/standalone/{chunk-AJIUI7DD.js → chunk-CACB34RQ.js} +1 -1
  78. package/dist/standalone/{chunk-DVC6YWVP.js → chunk-CICVBMEN.js} +1 -1
  79. package/dist/standalone/{chunk-DWTBY343.js → chunk-CWEAJUHW.js} +1 -1
  80. package/dist/standalone/{chunk-TOJ3TC35.js → chunk-DECHEGIC.js} +1 -1
  81. package/dist/standalone/{chunk-PVZI3CXP.js → chunk-E75ANNWX.js} +7 -7
  82. package/dist/standalone/{chunk-OCHNCAXJ.js → chunk-ERJNDIXC.js} +1 -1
  83. package/dist/standalone/{chunk-RRAFQ5G2.js → chunk-FKACHRWO.js} +1 -1
  84. package/dist/standalone/{chunk-46K3NKPA.js → chunk-FSGCANAU.js} +1 -1
  85. package/dist/standalone/chunk-GLUNBZRI.js +1 -0
  86. package/dist/standalone/{chunk-5OH3VPZF.js → chunk-H6RKXQZU.js} +1 -1
  87. package/dist/standalone/chunk-HZTGDL4L.js +1 -0
  88. package/dist/standalone/{chunk-FCSPAJW4.js → chunk-I7ZZRM7I.js} +1 -1
  89. package/dist/standalone/{chunk-764T6X6X.js → chunk-IXDH4GL5.js} +1 -1
  90. package/dist/standalone/{chunk-ZU4DZ6NK.js → chunk-J46WXQYL.js} +1 -1
  91. package/dist/standalone/{chunk-PACH5AHG.js → chunk-JVODY4EP.js} +1 -1
  92. package/dist/standalone/chunk-KSKXW5PX.js +1 -0
  93. package/dist/standalone/chunk-L7SK4ZZD.js +1 -0
  94. package/dist/standalone/chunk-LNZIB2MD.js +1 -0
  95. package/dist/standalone/{chunk-LD2R263D.js → chunk-LYB5L53X.js} +1 -1
  96. package/dist/standalone/chunk-MJWVMKQ4.js +6 -0
  97. package/dist/standalone/chunk-MT2J3H7O.js +3 -0
  98. package/dist/standalone/{chunk-VTGBPW24.js → chunk-N746FOQP.js} +1 -1
  99. package/dist/standalone/{chunk-U4OAQPBT.js → chunk-NC6MBMSI.js} +1 -1
  100. package/dist/standalone/chunk-NN27EDQB.js +1 -0
  101. package/dist/standalone/chunk-NY6GDADQ.js +1 -0
  102. package/dist/standalone/{chunk-JE2YOAB7.js → chunk-OY3HD7BJ.js} +1 -1
  103. package/dist/standalone/{chunk-ILCTSAOB.js → chunk-P5HJXCZS.js} +1 -1
  104. package/dist/standalone/chunk-PTS5TW3J.js +1 -0
  105. package/dist/standalone/chunk-QDBOPDJ7.js +1 -0
  106. package/dist/standalone/{chunk-7SLSB2TS.js → chunk-QHFTGJPS.js} +2 -2
  107. package/dist/standalone/chunk-SSI4G2MY.js +1 -0
  108. package/dist/standalone/chunk-TH45YG6Q.js +1 -0
  109. package/dist/standalone/{chunk-WXPWVBIY.js → chunk-UGUEC6BC.js} +1 -1
  110. package/dist/standalone/{chunk-K3GNLVYK.js → chunk-UKDJ4H7I.js} +1 -1
  111. package/dist/standalone/chunk-V6IWFYAQ.js +1 -0
  112. package/dist/standalone/{chunk-BQUQS7QN.js → chunk-V7SRH36W.js} +1 -1
  113. package/dist/standalone/chunk-VON7JUPG.js +1 -0
  114. package/dist/standalone/{chunk-X5P2WRYI.js → chunk-WPNXY7IS.js} +1 -1
  115. package/dist/standalone/{chunk-PZ7HD5T2.js → chunk-X33MSJPP.js} +1 -1
  116. package/dist/standalone/{chunk-BI35RXKQ.js → chunk-XRNXOIVZ.js} +1 -1
  117. package/dist/standalone/{chunk-TDL7NEWA.js → chunk-YBGC4PPD.js} +1 -1
  118. package/dist/standalone/{chunk-XLQ4BHBD.js → chunk-YNZ7ARWW.js} +1 -1
  119. package/dist/standalone/{chunk-SLKF2L74.js → chunk-YTO65GHS.js} +1 -1
  120. package/dist/standalone/{chunk-6WRZP62V.js → chunk-ZE6FT5Z3.js} +1 -1
  121. package/dist/standalone/studio.js +31 -31
  122. package/dist/styles.css +1 -1
  123. package/package.json +4 -4
  124. package/dist/packem_shared/use-auth-capabilities-C-VH0oJJ.js +0 -32
  125. package/dist/standalone/chunk-22W5VKZ6.js +0 -1
  126. package/dist/standalone/chunk-2GGMGPEP.js +0 -1
  127. package/dist/standalone/chunk-7VF3IAAW.js +0 -2
  128. package/dist/standalone/chunk-BACPICH6.js +0 -1
  129. package/dist/standalone/chunk-DORBUITF.js +0 -1
  130. package/dist/standalone/chunk-EUIHTPKI.js +0 -1
  131. package/dist/standalone/chunk-IOFMK4D7.js +0 -1
  132. package/dist/standalone/chunk-LI43EKM6.js +0 -1
  133. package/dist/standalone/chunk-MPYFGAOW.js +0 -1
  134. package/dist/standalone/chunk-NKJDGOM3.js +0 -1
  135. package/dist/standalone/chunk-OY3GVYS7.js +0 -4
  136. package/dist/standalone/chunk-PN5NCZDX.js +0 -1
  137. package/dist/standalone/chunk-RSEEHNFI.js +0 -1
  138. package/dist/standalone/chunk-X7MMBSNW.js +0 -1
  139. package/dist/standalone/chunk-XUGSA2NG.js +0 -1
  140. package/dist/standalone/chunk-ZYRGPDZB.js +0 -1
@@ -1,16 +1,16 @@
1
1
  import { c } from 'react/compiler-runtime';
2
2
  import { useLunora } from '@lunora/react';
3
3
  import { useState, useRef, useEffect, useId } from 'react';
4
- import { u as usePersistedList, n as newId, S as SqlResultChart } from '../packem_shared/browser-storage-tLOxkIHd.js';
4
+ import { u as usePersistedList, n as newId, a as usePersistedValue, S as SqlResultChart } from '../packem_shared/browser-storage-BTrX4y3B.js';
5
5
  import { ShardInput } from '../packem_shared/ShardInput-gx_DZXXn.js';
6
6
  import { A as Alert } from '../packem_shared/alert-CdAET2K_.js';
7
7
  import { c as TableHead, a as TableHeader, b as TableRow, e as TableCell, d as TableBody, T as Table } from '../packem_shared/table-DsCa9Qp9.js';
8
8
  import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
9
9
  import { ADMIN_FUNCTIONS } from '../packem_shared/ADMIN_FUNCTIONS-BHHJi3Gb.js';
10
- import { f as fireAndForget, c as callOptions, a as adminRef, e as errorMessage } from '../packem_shared/internal-DTsYVn-g.js';
10
+ import { f as fireAndForget, c as callOptions, a as adminRef, e as errorMessage } from '../packem_shared/internal-CYcbqMjX.js';
11
11
  import { r as recordShard } from '../packem_shared/shard-history-DyebH1R5.js';
12
- import { C as CellValue } from '../packem_shared/data-grid-Jz8FqQ2C.js';
13
- import { E as ExportMenu } from '../packem_shared/grid-features-CUr8Z1_O.js';
12
+ import { C as CellValue } from '../packem_shared/data-grid-CdXztApG.js';
13
+ import { E as ExportMenu } from '../packem_shared/grid-features-BF-KBDFz.js';
14
14
  import { c as cn } from '../packem_shared/utils-B05Dmz_H.js';
15
15
  import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
16
16
 
@@ -1050,34 +1050,7 @@ const makeTab = (sql = "", name = "") => {
1050
1050
  };
1051
1051
  };
1052
1052
  const usePersistedActive = () => {
1053
- const $ = c(5);
1054
- const [list, setList] = usePersistedList(ACTIVE_KEY);
1055
- let t0;
1056
- if ($[0] !== setList) {
1057
- t0 = (action) => {
1058
- setList((current) => {
1059
- const previous = current[0] ?? "";
1060
- const next = typeof action === "function" ? action(previous) : action;
1061
- return [next];
1062
- });
1063
- };
1064
- $[0] = setList;
1065
- $[1] = t0;
1066
- } else {
1067
- t0 = $[1];
1068
- }
1069
- const setActive = t0;
1070
- const t1 = list[0] ?? "";
1071
- let t2;
1072
- if ($[2] !== setActive || $[3] !== t1) {
1073
- t2 = [t1, setActive];
1074
- $[2] = setActive;
1075
- $[3] = t1;
1076
- $[4] = t2;
1077
- } else {
1078
- t2 = $[4];
1079
- }
1080
- return t2;
1053
+ return usePersistedValue(ACTIVE_KEY, "");
1081
1054
  };
1082
1055
  const usePersistedTabs = (seed) => {
1083
1056
  const [stored, setTabs] = usePersistedList(TABS_KEY);
@@ -1633,6 +1606,7 @@ function _temp$1(node) {
1633
1606
  const RUN_SQL = adminRef(ADMIN_FUNCTIONS.runSql);
1634
1607
  const STORAGE_KEY = "lunora-studio-sql-queries";
1635
1608
  const HISTORY_KEY = "lunora-studio-sql-history";
1609
+ const SPLIT_VIEW_KEY = "lunora-studio-sql-split-view";
1636
1610
  const HISTORY_LIMIT = 25;
1637
1611
  const GUTTER_STYLE = {
1638
1612
  minWidth: "2.75rem",
@@ -1751,6 +1725,7 @@ const SqlEditorPanel = ({
1751
1725
  const [outputs, setOutputs] = useState({});
1752
1726
  const [shardKey, setShardKey] = useState(initialShardKey ?? "");
1753
1727
  const [running, setRunning] = useState(false);
1728
+ const [splitView, setSplitView] = usePersistedValue(SPLIT_VIEW_KEY, false);
1754
1729
  const [tabMenu, setTabMenu] = useState(null);
1755
1730
  const [pendingBulk, setPendingBulk] = useState(null);
1756
1731
  const gutterRef = useRef(null);
@@ -2071,11 +2046,16 @@ const SqlEditorPanel = ({
2071
2046
  const showChart = () => {
2072
2047
  setActivePane("chart");
2073
2048
  };
2049
+ const toggleSplit = () => {
2050
+ setSplitView(!splitView);
2051
+ };
2074
2052
  const lineCount = draft.split("\n").length;
2075
2053
  const onSearchChange = (event_7) => {
2076
2054
  setSearch(event_7.target.value);
2077
2055
  };
2078
2056
  const tabClass = (selected) => `border-b-2 px-3 py-2 text-sm outline-none transition-colors ${selected ? "border-foreground font-medium text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"}`;
2057
+ const workspaceClass = splitView ? "flex min-h-0 flex-1 flex-row" : "flex min-h-0 flex-1 flex-col";
2058
+ const resultsClass = splitView ? "flex w-2/5 min-h-0 min-w-0 shrink-0 flex-col border-s border-border" : "flex h-2/5 min-h-0 shrink-0 flex-col border-t border-border";
2079
2059
  return /* @__PURE__ */ jsxDEV("div", {
2080
2060
  className: "flex h-full min-w-0",
2081
2061
  "data-testid": "lunora-sql-editor",
@@ -2193,122 +2173,152 @@ const SqlEditorPanel = ({
2193
2173
  )
2194
2174
  }, void 0, false)]
2195
2175
  }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
2196
- className: "flex min-h-0 flex-1",
2197
- children: [/* @__PURE__ */ jsxDEV("div", {
2198
- "aria-hidden": "true",
2199
- className: "shrink-0 select-none overflow-hidden border-e border-border bg-muted/30 py-3 text-end font-mono text-xs leading-5 text-muted-foreground/60",
2200
- ref: gutterRef,
2201
- style: GUTTER_STYLE,
2202
- children: Array.from({
2203
- length: lineCount
2204
- }, (_, index_0) => /* @__PURE__ */ jsxDEV("div", {
2205
- children: index_0 + 1
2206
- }, index_0, false))
2207
- }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
2208
- className: "relative min-w-0 flex-1",
2209
- children: [/* @__PURE__ */ jsxDEV("textarea", {
2210
- "aria-activedescendant": autocompleteState === null ? void 0 : `${listboxId}-opt-${autocompleteState.active.toString()}`,
2211
- "aria-autocomplete": "list",
2212
- "aria-controls": autocompleteState === null ? void 0 : listboxId,
2213
- "aria-expanded": autocompleteState !== null,
2214
- "aria-label": t("SQL query"),
2215
- className: "size-full resize-none bg-background p-3 font-mono text-xs leading-5 outline-none",
2216
- "data-testid": "sql-input",
2217
- onBlur: onEditorBlur,
2218
- onChange: onDraftChange,
2219
- onKeyDown: onEditorKeyDown,
2220
- onScroll: onEditorScroll,
2221
- onSelect: onEditorSelect,
2222
- placeholder: "SELECT * FROM …",
2223
- ref: editorRef,
2224
- role: "combobox",
2225
- spellCheck: false,
2226
- value: draft
2227
- }, void 0, false), /* @__PURE__ */ jsxDEV(AutocompletePopover, {
2228
- listboxId,
2229
- onPick: onPickSuggestion,
2230
- state: autocompleteState
2231
- }, void 0, false)]
2232
- }, void 0, true)]
2233
- }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
2234
- className: "flex h-2/5 min-h-0 shrink-0 flex-col border-t border-border",
2176
+ className: workspaceClass,
2235
2177
  children: [/* @__PURE__ */ jsxDEV("div", {
2236
- className: "flex shrink-0 items-center gap-2 border-b border-border pe-2",
2237
- children: [/* @__PURE__ */ jsxDEV("button", {
2238
- className: tabClass(tab === "results"),
2239
- "data-testid": "sql-tab-results",
2240
- onClick: showResults,
2241
- type: "button",
2242
- children: t("Results")
2243
- }, void 0, false), /* @__PURE__ */ jsxDEV("button", {
2244
- className: tabClass(tab === "chart"),
2245
- "data-testid": "sql-tab-chart",
2246
- onClick: showChart,
2247
- type: "button",
2248
- children: t("Chart")
2249
- }, void 0, false), /* @__PURE__ */ jsxDEV("button", {
2250
- className: tabClass(tab === "explain"),
2251
- "data-testid": "sql-tab-explain",
2252
- onClick: showExplain,
2253
- type: "button",
2254
- children: t("Explain")
2178
+ className: "flex min-h-0 min-w-0 flex-1",
2179
+ children: [/* @__PURE__ */ jsxDEV("div", {
2180
+ "aria-hidden": "true",
2181
+ className: "shrink-0 select-none overflow-hidden border-e border-border bg-muted/30 py-3 text-end font-mono text-xs leading-5 text-muted-foreground/60",
2182
+ ref: gutterRef,
2183
+ style: GUTTER_STYLE,
2184
+ children: Array.from({
2185
+ length: lineCount
2186
+ }, (_, index_0) => /* @__PURE__ */ jsxDEV("div", {
2187
+ children: index_0 + 1
2188
+ }, index_0, false))
2255
2189
  }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
2256
- className: "ms-auto flex items-center gap-2",
2257
- children: [result !== null && result.columns.length > 0 && /* @__PURE__ */ jsxDEV(ExportMenu, {
2258
- columns: result.columns,
2259
- name: "query-result",
2260
- rows: result.rows
2190
+ className: "relative min-w-0 flex-1",
2191
+ children: [/* @__PURE__ */ jsxDEV("textarea", {
2192
+ "aria-activedescendant": autocompleteState === null ? void 0 : `${listboxId}-opt-${autocompleteState.active.toString()}`,
2193
+ "aria-autocomplete": "list",
2194
+ "aria-controls": autocompleteState === null ? void 0 : listboxId,
2195
+ "aria-expanded": autocompleteState !== null,
2196
+ "aria-label": t("SQL query"),
2197
+ className: "size-full resize-none bg-background p-3 font-mono text-xs leading-5 outline-none",
2198
+ "data-testid": "sql-input",
2199
+ onBlur: onEditorBlur,
2200
+ onChange: onDraftChange,
2201
+ onKeyDown: onEditorKeyDown,
2202
+ onScroll: onEditorScroll,
2203
+ onSelect: onEditorSelect,
2204
+ placeholder: "SELECT * FROM …",
2205
+ ref: editorRef,
2206
+ role: "combobox",
2207
+ spellCheck: false,
2208
+ value: draft
2209
+ }, void 0, false), /* @__PURE__ */ jsxDEV(AutocompletePopover, {
2210
+ listboxId,
2211
+ onPick: onPickSuggestion,
2212
+ state: autocompleteState
2213
+ }, void 0, false)]
2214
+ }, void 0, true)]
2215
+ }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
2216
+ className: resultsClass,
2217
+ children: [/* @__PURE__ */ jsxDEV("div", {
2218
+ className: "flex shrink-0 items-center gap-2 border-b border-border pe-2",
2219
+ children: [/* @__PURE__ */ jsxDEV("button", {
2220
+ className: tabClass(tab === "results"),
2221
+ "data-testid": "sql-tab-results",
2222
+ onClick: showResults,
2223
+ type: "button",
2224
+ children: t("Results")
2261
2225
  }, void 0, false), /* @__PURE__ */ jsxDEV("button", {
2262
- className: "inline-flex items-center rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",
2263
- "data-testid": "sql-format",
2264
- disabled: running,
2265
- onClick: formatDraft,
2226
+ className: tabClass(tab === "chart"),
2227
+ "data-testid": "sql-tab-chart",
2228
+ onClick: showChart,
2266
2229
  type: "button",
2267
- children: t("Format")
2268
- }, void 0, false), /* @__PURE__ */ jsxDEV(ShardInput, {
2269
- onChange: setShardKey,
2270
- testId: "sql-shard-input",
2271
- value: shardKey
2230
+ children: t("Chart")
2272
2231
  }, void 0, false), /* @__PURE__ */ jsxDEV("button", {
2273
- className: "inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground outline-none transition-colors hover:bg-primary/90 focus-visible:bg-primary/90 disabled:pointer-events-none disabled:opacity-50",
2274
- "data-testid": "sql-run",
2275
- disabled: running,
2276
- onClick: onRun,
2232
+ className: tabClass(tab === "explain"),
2233
+ "data-testid": "sql-tab-explain",
2234
+ onClick: showExplain,
2277
2235
  type: "button",
2278
- children: [running ? t("Running…") : t("Run"), /* @__PURE__ */ jsxDEV("kbd", {
2279
- className: "rounded border border-primary-foreground/30 px-1 font-sans text-[10px]",
2280
- children: "⌘↵"
2236
+ children: t("Explain")
2237
+ }, void 0, false), /* @__PURE__ */ jsxDEV("div", {
2238
+ className: "ms-auto flex items-center gap-2",
2239
+ children: [/* @__PURE__ */ jsxDEV("button", {
2240
+ "aria-label": t("Split editor and results"),
2241
+ "aria-pressed": splitView,
2242
+ className: `inline-flex items-center rounded-md border border-border px-2 py-1.5 outline-none transition-colors hover:bg-accent focus-visible:bg-accent ${splitView ? "bg-accent text-foreground" : "text-muted-foreground"}`,
2243
+ "data-testid": "sql-split-toggle",
2244
+ onClick: toggleSplit,
2245
+ title: t("Split editor and results"),
2246
+ type: "button",
2247
+ children: /* @__PURE__ */ jsxDEV("svg", {
2248
+ "aria-hidden": "true",
2249
+ className: "size-4",
2250
+ fill: "none",
2251
+ stroke: "currentColor",
2252
+ strokeLinecap: "round",
2253
+ strokeLinejoin: "round",
2254
+ strokeWidth: 1.7,
2255
+ viewBox: "0 0 24 24",
2256
+ children: [/* @__PURE__ */ jsxDEV("rect", {
2257
+ height: "16",
2258
+ rx: "2",
2259
+ width: "18",
2260
+ x: "3",
2261
+ y: "4"
2262
+ }, void 0, false), /* @__PURE__ */ jsxDEV("path", {
2263
+ d: "M12 4v16"
2264
+ }, void 0, false)]
2265
+ }, void 0, true)
2266
+ }, void 0, false), result !== null && result.columns.length > 0 && /* @__PURE__ */ jsxDEV(ExportMenu, {
2267
+ columns: result.columns,
2268
+ name: "query-result",
2269
+ rows: result.rows
2270
+ }, void 0, false), /* @__PURE__ */ jsxDEV("button", {
2271
+ className: "inline-flex items-center rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50",
2272
+ "data-testid": "sql-format",
2273
+ disabled: running,
2274
+ onClick: formatDraft,
2275
+ type: "button",
2276
+ children: t("Format")
2277
+ }, void 0, false), /* @__PURE__ */ jsxDEV(ShardInput, {
2278
+ onChange: setShardKey,
2279
+ testId: "sql-shard-input",
2280
+ value: shardKey
2281
+ }, void 0, false), /* @__PURE__ */ jsxDEV("button", {
2282
+ className: "inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground outline-none transition-colors hover:bg-primary/90 focus-visible:bg-primary/90 disabled:pointer-events-none disabled:opacity-50",
2283
+ "data-testid": "sql-run",
2284
+ disabled: running,
2285
+ onClick: onRun,
2286
+ type: "button",
2287
+ children: [running ? t("Running…") : t("Run"), /* @__PURE__ */ jsxDEV("kbd", {
2288
+ className: "rounded border border-primary-foreground/30 px-1 font-sans text-[10px]",
2289
+ children: "⌘↵"
2290
+ }, void 0, false)]
2291
+ }, void 0, true)]
2292
+ }, void 0, true)]
2293
+ }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
2294
+ className: "min-h-0 flex-1 overflow-auto",
2295
+ children: [error !== null && /* @__PURE__ */ jsxDEV(Alert, {
2296
+ className: "m-3 font-mono text-xs",
2297
+ testId: "sql-error",
2298
+ variant: "destructive",
2299
+ children: error
2300
+ }, void 0, false), error === null && result === null && /* @__PURE__ */ jsxDEV("p", {
2301
+ className: "p-4 text-sm text-muted-foreground",
2302
+ "data-testid": "sql-empty",
2303
+ children: t("Click Run to execute your query.")
2304
+ }, void 0, false), error === null && result !== null && /* @__PURE__ */ jsxDEV("div", {
2305
+ "data-testid": "sql-result",
2306
+ children: [tab === "chart" ? /* @__PURE__ */ jsxDEV(SqlResultChart, {
2307
+ result
2308
+ }, void 0, false) : /* @__PURE__ */ jsxDEV(SqlResultTable, {
2309
+ result
2310
+ }, void 0, false), /* @__PURE__ */ jsxDEV("p", {
2311
+ className: "border-t border-border px-3 py-1.5 text-xs text-muted-foreground",
2312
+ "data-testid": "sql-count",
2313
+ children: result.truncated ? t("Showing the first {max} of {count} rows.", {
2314
+ count: result.rowCount,
2315
+ max: result.rows.length
2316
+ }) : t("{count} rows", {
2317
+ count: result.rowCount
2318
+ })
2281
2319
  }, void 0, false)]
2282
2320
  }, void 0, true)]
2283
2321
  }, void 0, true)]
2284
- }, void 0, true), /* @__PURE__ */ jsxDEV("div", {
2285
- className: "min-h-0 flex-1 overflow-auto",
2286
- children: [error !== null && /* @__PURE__ */ jsxDEV(Alert, {
2287
- className: "m-3 font-mono text-xs",
2288
- testId: "sql-error",
2289
- variant: "destructive",
2290
- children: error
2291
- }, void 0, false), error === null && result === null && /* @__PURE__ */ jsxDEV("p", {
2292
- className: "p-4 text-sm text-muted-foreground",
2293
- "data-testid": "sql-empty",
2294
- children: t("Click Run to execute your query.")
2295
- }, void 0, false), error === null && result !== null && /* @__PURE__ */ jsxDEV("div", {
2296
- "data-testid": "sql-result",
2297
- children: [tab === "chart" ? /* @__PURE__ */ jsxDEV(SqlResultChart, {
2298
- result
2299
- }, void 0, false) : /* @__PURE__ */ jsxDEV(SqlResultTable, {
2300
- result
2301
- }, void 0, false), /* @__PURE__ */ jsxDEV("p", {
2302
- className: "border-t border-border px-3 py-1.5 text-xs text-muted-foreground",
2303
- "data-testid": "sql-count",
2304
- children: result.truncated ? t("Showing the first {max} of {count} rows.", {
2305
- count: result.rowCount,
2306
- max: result.rows.length
2307
- }) : t("{count} rows", {
2308
- count: result.rowCount
2309
- })
2310
- }, void 0, false)]
2311
- }, void 0, true)]
2312
2322
  }, void 0, true)]
2313
2323
  }, void 0, true)]
2314
2324
  }, void 0, true)]
@@ -5,9 +5,9 @@ import { useRef, useState, useEffect } from 'react';
5
5
  import { T as TIER_META } from '../packem_shared/storage-tier-CL98eOvn.js';
6
6
  import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
7
7
  import { s as searchToDataView, d as dataViewToSearch } from '../packem_shared/data-view-params-Cd6yRVbv.js';
8
- import { f as fireAndForget } from '../packem_shared/internal-DTsYVn-g.js';
9
- import { DataBrowser } from '../packem_shared/DataBrowser-BeVNxSVm.js';
10
- import { GlobalDataBrowser } from '../packem_shared/GlobalDataBrowser-ErfvIs1S.js';
8
+ import { f as fireAndForget } from '../packem_shared/internal-CYcbqMjX.js';
9
+ import { DataBrowser } from '../packem_shared/DataBrowser-D2ywrdId.js';
10
+ import { GlobalDataBrowser } from '../packem_shared/GlobalDataBrowser-BkTPLzAY.js';
11
11
  import { jsxDEV } from 'react/jsx-dev-runtime';
12
12
 
13
13
  const STORAGE_KEY = "lunora-studio-saved-queries";
@@ -5,7 +5,7 @@ import { C as Card } from '../packem_shared/card-DURq3ElK.js';
5
5
  import { E as EmptyState } from '../packem_shared/empty-state-DY_oe0k6.js';
6
6
  import { T as Table, a as TableHeader, b as TableRow, d as TableBody, e as TableCell, c as TableHead } from '../packem_shared/table-DsCa9Qp9.js';
7
7
  import { useT } from '../packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js';
8
- import { e as errorMessage, f as fireAndForget, h as formatCell } from '../packem_shared/internal-DTsYVn-g.js';
8
+ import { e as errorMessage, f as fireAndForget, h as formatCell } from '../packem_shared/internal-CYcbqMjX.js';
9
9
  import { jsxDEV } from 'react/jsx-dev-runtime';
10
10
 
11
11
  const DEFAULT_DATASET = "ANALYTICS";