@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
@@ -2,115 +2,21 @@ 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 { c as cn } from './utils-B05Dmz_H.js';
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, f as fireAndForget } from './internal-rXJEAhXS.js';
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-zwBoOv24.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;
12
+ const CSV_FORMULA_RE = /^[=+\-@\t\r]/u;
107
13
  const csvCell = (value) => {
108
14
  if (value === null || value === void 0) {
109
15
  return "";
110
16
  }
111
17
  let text;
112
18
  if (typeof value === "string") {
113
- text = value;
19
+ text = CSV_FORMULA_RE.test(value) ? ` ${value}` : value;
114
20
  } else if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
115
21
  text = String(value);
116
22
  } else {
@@ -124,6 +30,37 @@ const toCsv = (columns, rows) => {
124
30
  return [header, ...body].join("\n");
125
31
  };
126
32
  const toJson = (rows) => JSON.stringify(rows, null, 2);
33
+ const SQL_INSERT_BATCH = 500;
34
+ const sqlIdentifier = (name) => `"${name.replaceAll('"', '""')}"`;
35
+ const sqlLiteral = (value) => {
36
+ if (value === null || value === void 0) {
37
+ return "NULL";
38
+ }
39
+ if (typeof value === "number") {
40
+ return Number.isFinite(value) ? String(value) : "NULL";
41
+ }
42
+ if (typeof value === "bigint") {
43
+ return String(value);
44
+ }
45
+ if (typeof value === "boolean") {
46
+ return value ? "1" : "0";
47
+ }
48
+ const text = typeof value === "string" ? value : JSON.stringify(value);
49
+ return `'${text.replaceAll("'", "''")}'`;
50
+ };
51
+ const toSql = (name, columns, rows) => {
52
+ if (columns.length === 0 || rows.length === 0) {
53
+ return "";
54
+ }
55
+ const columnList = columns.map((column) => sqlIdentifier(column)).join(", ");
56
+ const statements = [];
57
+ for (let start = 0; start < rows.length; start += SQL_INSERT_BATCH) {
58
+ const values = rows.slice(start, start + SQL_INSERT_BATCH).map((row) => ` (${columns.map((column) => sqlLiteral(row[column])).join(", ")})`).join(",\n");
59
+ statements.push(`INSERT INTO ${sqlIdentifier(name)} (${columnList}) VALUES
60
+ ${values};`);
61
+ }
62
+ return statements.join("\n\n");
63
+ };
127
64
  const downloadFile = (filename, content, mime) => {
128
65
  if (!("document" in globalThis)) {
129
66
  return;
@@ -140,7 +77,7 @@ const downloadFile = (filename, content, mime) => {
140
77
  globalThis.URL.revokeObjectURL(url);
141
78
  };
142
79
  const ExportMenu = (t0) => {
143
- const $ = c(26);
80
+ const $ = c(36);
144
81
  const {
145
82
  columns,
146
83
  name,
@@ -172,96 +109,131 @@ const ExportMenu = (t0) => {
172
109
  t2 = $[6];
173
110
  }
174
111
  const onJson = t2;
175
- const t3 = rows.length === 0;
176
- let t4;
177
- if ($[7] !== t3) {
178
- t4 = /* @__PURE__ */ jsxDEV(DropdownMenuTrigger, {
112
+ let t3;
113
+ if ($[7] !== columns || $[8] !== name || $[9] !== rows) {
114
+ t3 = () => {
115
+ downloadFile(`${name}.sql`, toSql(name, columns, rows), "application/sql;charset=utf-8");
116
+ };
117
+ $[7] = columns;
118
+ $[8] = name;
119
+ $[9] = rows;
120
+ $[10] = t3;
121
+ } else {
122
+ t3 = $[10];
123
+ }
124
+ const onSql = t3;
125
+ const t4 = rows.length === 0;
126
+ let t5;
127
+ if ($[11] !== t4) {
128
+ t5 = /* @__PURE__ */ jsxDEV(DropdownMenuTrigger, {
179
129
  className: CONTROL_BTN,
180
130
  "data-testid": "grid-export",
181
- disabled: t3,
131
+ disabled: t4,
182
132
  title: "Exports only the rows loaded on the current page, not the whole table",
183
133
  children: "Export page"
184
134
  }, void 0, false);
185
- $[7] = t3;
186
- $[8] = t4;
135
+ $[11] = t4;
136
+ $[12] = t5;
187
137
  } else {
188
- t4 = $[8];
138
+ t5 = $[12];
189
139
  }
190
- let t5;
191
- if ($[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
192
- t5 = /* @__PURE__ */ jsxDEV(DropdownMenuLabel, {
140
+ let t6;
141
+ if ($[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
142
+ t6 = /* @__PURE__ */ jsxDEV(DropdownMenuLabel, {
193
143
  children: "Export loaded rows"
194
144
  }, void 0, false);
195
- $[9] = t5;
145
+ $[13] = t6;
196
146
  } else {
197
- t5 = $[9];
147
+ t6 = $[13];
198
148
  }
199
- let t6;
200
- if ($[10] !== t) {
201
- t6 = t("CSV");
202
- $[10] = t;
203
- $[11] = t6;
149
+ let t7;
150
+ if ($[14] !== t) {
151
+ t7 = t("CSV");
152
+ $[14] = t;
153
+ $[15] = t7;
204
154
  } else {
205
- t6 = $[11];
155
+ t7 = $[15];
206
156
  }
207
- let t7;
208
- if ($[12] !== onCsv || $[13] !== t6) {
209
- t7 = /* @__PURE__ */ jsxDEV(DropdownMenuItem, {
157
+ let t8;
158
+ if ($[16] !== onCsv || $[17] !== t7) {
159
+ t8 = /* @__PURE__ */ jsxDEV(DropdownMenuItem, {
210
160
  "data-testid": "grid-export-csv",
211
161
  onClick: onCsv,
212
- children: t6
162
+ children: t7
213
163
  }, void 0, false);
214
- $[12] = onCsv;
215
- $[13] = t6;
216
- $[14] = t7;
164
+ $[16] = onCsv;
165
+ $[17] = t7;
166
+ $[18] = t8;
217
167
  } else {
218
- t7 = $[14];
168
+ t8 = $[18];
219
169
  }
220
- let t8;
221
- if ($[15] !== t) {
222
- t8 = t("JSON");
223
- $[15] = t;
224
- $[16] = t8;
170
+ let t9;
171
+ if ($[19] !== t) {
172
+ t9 = t("JSON");
173
+ $[19] = t;
174
+ $[20] = t9;
225
175
  } else {
226
- t8 = $[16];
176
+ t9 = $[20];
227
177
  }
228
- let t9;
229
- if ($[17] !== onJson || $[18] !== t8) {
230
- t9 = /* @__PURE__ */ jsxDEV(DropdownMenuItem, {
178
+ let t10;
179
+ if ($[21] !== onJson || $[22] !== t9) {
180
+ t10 = /* @__PURE__ */ jsxDEV(DropdownMenuItem, {
231
181
  "data-testid": "grid-export-json",
232
182
  onClick: onJson,
233
- children: t8
183
+ children: t9
234
184
  }, void 0, false);
235
- $[17] = onJson;
236
- $[18] = t8;
237
- $[19] = t9;
185
+ $[21] = onJson;
186
+ $[22] = t9;
187
+ $[23] = t10;
238
188
  } else {
239
- t9 = $[19];
189
+ t10 = $[23];
240
190
  }
241
- let t10;
242
- if ($[20] !== t7 || $[21] !== t9) {
243
- t10 = /* @__PURE__ */ jsxDEV(DropdownMenuContent, {
191
+ let t11;
192
+ if ($[24] !== t) {
193
+ t11 = t("SQL");
194
+ $[24] = t;
195
+ $[25] = t11;
196
+ } else {
197
+ t11 = $[25];
198
+ }
199
+ let t12;
200
+ if ($[26] !== onSql || $[27] !== t11) {
201
+ t12 = /* @__PURE__ */ jsxDEV(DropdownMenuItem, {
202
+ "data-testid": "grid-export-sql",
203
+ onClick: onSql,
204
+ children: t11
205
+ }, void 0, false);
206
+ $[26] = onSql;
207
+ $[27] = t11;
208
+ $[28] = t12;
209
+ } else {
210
+ t12 = $[28];
211
+ }
212
+ let t13;
213
+ if ($[29] !== t10 || $[30] !== t12 || $[31] !== t8) {
214
+ t13 = /* @__PURE__ */ jsxDEV(DropdownMenuContent, {
244
215
  align: "end",
245
- children: [t5, t7, t9]
216
+ children: [t6, t8, t10, t12]
246
217
  }, void 0, true);
247
- $[20] = t7;
248
- $[21] = t9;
249
- $[22] = t10;
218
+ $[29] = t10;
219
+ $[30] = t12;
220
+ $[31] = t8;
221
+ $[32] = t13;
250
222
  } else {
251
- t10 = $[22];
223
+ t13 = $[32];
252
224
  }
253
- let t11;
254
- if ($[23] !== t10 || $[24] !== t4) {
255
- t11 = /* @__PURE__ */ jsxDEV(DropdownMenu, {
256
- children: [t4, t10]
225
+ let t14;
226
+ if ($[33] !== t13 || $[34] !== t5) {
227
+ t14 = /* @__PURE__ */ jsxDEV(DropdownMenu, {
228
+ children: [t5, t13]
257
229
  }, void 0, true);
258
- $[23] = t10;
259
- $[24] = t4;
260
- $[25] = t11;
230
+ $[33] = t13;
231
+ $[34] = t5;
232
+ $[35] = t14;
261
233
  } else {
262
- t11 = $[25];
234
+ t14 = $[35];
263
235
  }
264
- return t11;
236
+ return t14;
265
237
  };
266
238
  const ColumnToggle = (t0) => {
267
239
  const $ = c(9);
@@ -553,12 +525,9 @@ const CellDetailDialog = (t0) => {
553
525
  let t2;
554
526
  if ($[2] !== text) {
555
527
  t2 = () => {
556
- const clipboard = "navigator" in globalThis ? globalThis.navigator.clipboard : void 0;
557
- if (clipboard === void 0) {
558
- return;
528
+ if (copyToClipboard(text)) {
529
+ setCopied(true);
559
530
  }
560
- fireAndForget(clipboard.writeText(text));
561
- setCopied(true);
562
531
  };
563
532
  $[2] = text;
564
533
  $[3] = t2;
@@ -837,4 +806,4 @@ function _temp2(row) {
837
806
  return row.id;
838
807
  }
839
808
 
840
- export { CellDetailDialog as C, ExportMenu as E, GridActionsBar as G, ModalShell as M, SelectionBar as S };
809
+ export { CellDetailDialog as C, ExportMenu as E, GridActionsBar as G, SelectionBar as S };