@lunora/studio 1.0.0-alpha.10 → 1.0.0-alpha.11

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 (26) hide show
  1. package/dist/index.d.ts +6 -3
  2. package/dist/index.js +18 -18
  3. package/dist/mount.js +1 -1
  4. package/dist/packem_shared/{AuditPanel-D9Eh7j7E.js → AuditPanel-SRilxyg0.js} +1 -1
  5. package/dist/packem_shared/{DataBrowser-CyckZRwj.js → DataBrowser-B4v_9GiU.js} +96 -101
  6. package/dist/packem_shared/{ExportImportPanel-BGJqFK9X.js → ExportImportPanel-NtZVqbOj.js} +1 -1
  7. package/dist/packem_shared/{FunctionStatsPanel-CXynSuqT.js → FunctionStatsPanel-n-6FrbOH.js} +1 -1
  8. package/dist/packem_shared/{GlobalDataBrowser-DAxzB-Br.js → GlobalDataBrowser-3X9uRfdO.js} +1 -1
  9. package/dist/packem_shared/{HealthPanel-CyLs7qZm.js → HealthPanel-Dpr6KTmV.js} +1 -1
  10. package/dist/packem_shared/{HomePanel-BOkFRbuj.js → HomePanel-CpFLsa64.js} +1 -1
  11. package/dist/packem_shared/{InsightsPanel-CvXMoZuv.js → InsightsPanel-BchgeeRx.js} +1 -1
  12. package/dist/packem_shared/{LogsPanel-BrUstOk6.js → LogsPanel-DsPnKZ95.js} +1 -1
  13. package/dist/packem_shared/{MailPanel-GnnrNqL6.js → MailPanel-Bmg781UW.js} +1 -1
  14. package/dist/packem_shared/{MetricsPanel-BN_uUU-_.js → MetricsPanel-DaE8ZXrf.js} +1 -1
  15. package/dist/packem_shared/{MigrationsPanel-DaZuUHje.js → MigrationsPanel-CaUpce-G.js} +1 -1
  16. package/dist/packem_shared/{ScheduledJobs-UmVaMbJy.js → ScheduledJobs-BWNwIN3I.js} +1 -1
  17. package/dist/packem_shared/{SecurityAdvisorPanel-DTmjUNqt.js → SecurityAdvisorPanel-PAx712Bd.js} +1 -1
  18. package/dist/packem_shared/{SettingsPanel-C2wDK-8F.js → SettingsPanel-C4tufQD5.js} +1 -1
  19. package/dist/packem_shared/{Studio-DpgYe4qt.js → Studio-BFg10lBc.js} +14 -14
  20. package/dist/packem_shared/{StudioApp-C7aaizqc.js → StudioApp-g8j3V6vA.js} +1 -1
  21. package/dist/packem_shared/TableEditor-0TYRqi6t.js +11 -0
  22. package/dist/packem_shared/{studio-9Mq0PdMi.js → studio-DRWW__L9.js} +46 -26
  23. package/dist/packem_shared/{TableEditor-DzK3Z6rL.js → table-editor-CiyJi0Nm.js} +41 -5
  24. package/dist/packem_shared/{use-admin-query-4JQW2rr1.js → use-admin-query-BkbdNFNz.js} +18 -1
  25. package/dist/standalone/studio.js +172 -172
  26. package/package.json +3 -3
package/dist/index.d.ts CHANGED
@@ -740,10 +740,13 @@ interface DataBrowserProps {
740
740
  */
741
741
  readonly onNavigateToGlobal?: (table: string, id: string) => void;
742
742
  /**
743
- * Called whenever the open table changes, so the host can mirror it to the URL
744
- * (the Table editor pushes `?table=…`). Omitted in standalone use.
743
+ * Navigate the URL to a table (the Table editor pushes `?table=…`), opening it
744
+ * clean; `options.search` pre-fills the search for an FK-cell traversal.
745
+ * Omitted in standalone use.
745
746
  */
746
- readonly onSelectTable?: (table: string) => void;
747
+ readonly onSelectTable?: (table: string, options?: {
748
+ search?: string;
749
+ }) => void;
747
750
  /**
748
751
  * Called whenever the loaded view (shard / search / filters / sort) changes, so
749
752
  * the host can mirror it to the URL — making every view a shareable link.
package/dist/index.js CHANGED
@@ -1,36 +1,36 @@
1
- export { StudioApp } from './packem_shared/StudioApp-C7aaizqc.js';
1
+ export { StudioApp } from './packem_shared/StudioApp-g8j3V6vA.js';
2
2
  export { CommandPalette, openCommandPalette } from './packem_shared/CommandPalette-BtgkBzZI.js';
3
- export { S as Studio } from './packem_shared/studio-9Mq0PdMi.js';
3
+ export { S as Studio } from './packem_shared/studio-DRWW__L9.js';
4
4
  export { ConfirmButton } from './packem_shared/ConfirmButton-C2eVi2Qv.js';
5
5
  export { default as ConnectionBadge } from './packem_shared/ConnectionBadge-B2DDM2Tn.js';
6
6
  export { ErrorBoundary } from './packem_shared/ErrorBoundary-BzAApI7J.js';
7
7
  export { ShardInput } from './packem_shared/ShardInput-gx_DZXXn.js';
8
8
  export { DEFAULT_INSIGHT_THRESHOLDS, deriveInsights } from './packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js';
9
- export { InsightsPanel } from './packem_shared/InsightsPanel-CvXMoZuv.js';
10
- export { default as SecurityAdvisorPanel } from './packem_shared/SecurityAdvisorPanel-DTmjUNqt.js';
9
+ export { InsightsPanel } from './packem_shared/InsightsPanel-BchgeeRx.js';
10
+ export { default as SecurityAdvisorPanel } from './packem_shared/SecurityAdvisorPanel-PAx712Bd.js';
11
11
  export { default as ApiDocsPanel } from './packem_shared/ApiDocsPanel-yVSGHK3H.js';
12
12
  export { default as ApiReferencePanel } from './packem_shared/ApiReferencePanel-1vubqG5s.js';
13
13
  export { default as ApiTab } from './packem_shared/ApiTab-rwttyQ1-.js';
14
14
  export { default as OpenRpcReferencePanel } from './packem_shared/OpenRpcReferencePanel-vbcYbv3V.js';
15
- export { DataBrowser } from './packem_shared/DataBrowser-CyckZRwj.js';
15
+ export { DataBrowser } from './packem_shared/DataBrowser-B4v_9GiU.js';
16
16
  export { DataFilters, toFilterClauses } from './packem_shared/DataFilters-FNquMaiu.js';
17
- export { GlobalDataBrowser } from './packem_shared/GlobalDataBrowser-DAxzB-Br.js';
18
- export { TableEditor } from './packem_shared/TableEditor-DzK3Z6rL.js';
19
- export { ExportImportPanel } from './packem_shared/ExportImportPanel-BGJqFK9X.js';
20
- export { MigrationsPanel } from './packem_shared/MigrationsPanel-DaZuUHje.js';
17
+ export { GlobalDataBrowser } from './packem_shared/GlobalDataBrowser-3X9uRfdO.js';
18
+ export { T as TableEditor } from './packem_shared/table-editor-CiyJi0Nm.js';
19
+ export { ExportImportPanel } from './packem_shared/ExportImportPanel-NtZVqbOj.js';
20
+ export { MigrationsPanel } from './packem_shared/MigrationsPanel-CaUpce-G.js';
21
21
  export { PitrPanel } from './packem_shared/PitrPanel-LJGNP_IX.js';
22
22
  export { FunctionRunner } from './packem_shared/FunctionRunner-7NH3KcTg.js';
23
- export { FunctionStatsPanel } from './packem_shared/FunctionStatsPanel-CXynSuqT.js';
24
- export { HomePanel } from './packem_shared/HomePanel-BOkFRbuj.js';
25
- export { AuditPanel } from './packem_shared/AuditPanel-D9Eh7j7E.js';
26
- export { LogsPanel } from './packem_shared/LogsPanel-BrUstOk6.js';
27
- export { MailPanel } from './packem_shared/MailPanel-GnnrNqL6.js';
28
- export { ScheduledJobs } from './packem_shared/ScheduledJobs-UmVaMbJy.js';
29
- export { HealthPanel } from './packem_shared/HealthPanel-CyLs7qZm.js';
23
+ export { FunctionStatsPanel } from './packem_shared/FunctionStatsPanel-n-6FrbOH.js';
24
+ export { HomePanel } from './packem_shared/HomePanel-CpFLsa64.js';
25
+ export { AuditPanel } from './packem_shared/AuditPanel-SRilxyg0.js';
26
+ export { LogsPanel } from './packem_shared/LogsPanel-DsPnKZ95.js';
27
+ export { MailPanel } from './packem_shared/MailPanel-Bmg781UW.js';
28
+ export { ScheduledJobs } from './packem_shared/ScheduledJobs-BWNwIN3I.js';
29
+ export { HealthPanel } from './packem_shared/HealthPanel-Dpr6KTmV.js';
30
30
  export { aggregateMetrics, shardsToAggregate } from './packem_shared/aggregateMetrics-D4nUHEKU.js';
31
- export { MetricsPanel } from './packem_shared/MetricsPanel-BN_uUU-_.js';
31
+ export { MetricsPanel } from './packem_shared/MetricsPanel-DaE8ZXrf.js';
32
32
  export { SchemaViewer } from './packem_shared/SchemaViewer-Bam6ylvw.js';
33
- export { SettingsPanel } from './packem_shared/SettingsPanel-C2wDK-8F.js';
33
+ export { SettingsPanel } from './packem_shared/SettingsPanel-C4tufQD5.js';
34
34
  export { S as SqlEditorPanel } from './packem_shared/sql-editor-panel-Smfl_FDF.js';
35
35
  export { FileBrowser } from './packem_shared/FileBrowser-0pCpdKPE.js';
36
36
  export { DEFAULT_AUTO_REFRESH_MS, useAutoRefresh } from './packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js';
package/dist/mount.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createRoot } from 'react-dom/client';
2
- import { StudioApp } from './packem_shared/StudioApp-C7aaizqc.js';
2
+ import { StudioApp } from './packem_shared/StudioApp-g8j3V6vA.js';
3
3
  import { jsxDEV } from 'react/jsx-dev-runtime';
4
4
 
5
5
  const mountStudio = (options = {}) => {
@@ -7,7 +7,7 @@ import { C as Card, a as CardContent } from './card-DURq3ElK.js';
7
7
  import { E as EmptyState } from './empty-state-DY_oe0k6.js';
8
8
  import { I as Input } from './input-XH4r1Pt1.js';
9
9
  import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from './table-_RzNvy3R.js';
10
- import { u as useAdminQuery } from './use-admin-query-4JQW2rr1.js';
10
+ import { u as useAdminQuery } from './use-admin-query-BkbdNFNz.js';
11
11
  import useDebounced from './useDebounced-Dxncpg6z.js';
12
12
  import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
13
13
  import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DjXgvJb6.js';
@@ -17,7 +17,7 @@ import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
17
17
  import { u as useFacets, T as TableListSidebar, G as GridPagination, D as DataFacets } from './table-list-sidebar-Bg7uzbvC.js';
18
18
  import { toFilterClauses, DataFilters } from './DataFilters-FNquMaiu.js';
19
19
  import { M as ModalShell, G as GridActionsBar, C as CellDetailDialog } from './grid-features-CzUfqgsM.js';
20
- import { u as useAdminQuery } from './use-admin-query-4JQW2rr1.js';
20
+ import { u as useAdminQuery } from './use-admin-query-BkbdNFNz.js';
21
21
  import useDebounced from './useDebounced-Dxncpg6z.js';
22
22
  import { r as recordShard, l as loadRecentShards } from './shard-history-DyebH1R5.js';
23
23
 
@@ -1564,7 +1564,7 @@ const useDataBrowserTable = (page, sorting, onSortingChange) => {
1564
1564
  };
1565
1565
  });
1566
1566
  }, [columns, references]);
1567
- const data = rows ?? [];
1567
+ const data = useMemo(() => rows ?? [], [rows]);
1568
1568
  const [rowSelection, setRowSelection] = useState({});
1569
1569
  const [columnVisibility, setColumnVisibility] = useState({});
1570
1570
  const table = useReactTable({
@@ -2199,13 +2199,7 @@ const useDataBrowser = ({
2199
2199
  const client = useLunora();
2200
2200
  const [pageSize, setPageSize] = useState(initialPageSize);
2201
2201
  const [shardKey, setShardKey] = useState(initialShardKey ?? "");
2202
- const hydrationRef = useRef({
2203
- filters: initialFilters,
2204
- orderBy: initialOrderBy,
2205
- search: initialSearch,
2206
- table: tableParam
2207
- });
2208
- const [selectedTable, setSelectedTable] = useState(null);
2202
+ const selectedTable = tableParam === void 0 || tableParam === "" ? null : tableParam;
2209
2203
  const [offset, setOffset] = useState(0);
2210
2204
  const [viewMode, setViewMode] = useState("table");
2211
2205
  const [sorting, setSorting] = useState(() => fromOrderBy(initialOrderBy));
@@ -2258,105 +2252,106 @@ const useDataBrowser = ({
2258
2252
  recordShard(debouncedShard);
2259
2253
  }
2260
2254
  }, [tablesQuery.data, debouncedShard]);
2261
- const appliedTableRef = useRef(null);
2262
- const selectTable = useCallback((table) => {
2263
- const hydration = hydrationRef.current?.table === void 0 || hydrationRef.current.table === table ? hydrationRef.current : null;
2264
- hydrationRef.current = null;
2265
- const nextSorting = fromOrderBy(hydration?.orderBy);
2266
- const nextFilters = toEditableFilters(hydration?.filters ?? []);
2267
- const nextSearch = hydration?.search ?? "";
2268
- setSorting(nextSorting);
2269
- setFilter(nextSearch);
2270
- setFilters(nextFilters);
2271
- filtersRef.current = nextFilters;
2272
- clearFacets();
2273
- stagedEdits.clear();
2274
- setEditingCell(null);
2275
- setOffset(0);
2276
- setSelectedTable(table);
2277
- appliedTableRef.current = table;
2278
- onSelectTable?.(table);
2279
- }, [clearFacets, onSelectTable, stagedEdits]);
2255
+ const selectTable = useCallback((table2) => {
2256
+ onSelectTable?.(table2);
2257
+ }, [onSelectTable]);
2280
2258
  const navigateToRef = (targetTable, id) => {
2281
- setSorting([]);
2282
- setFilters([]);
2283
- filtersRef.current = [];
2284
- clearFacets();
2285
- setOffset(0);
2286
- setSelectedTable(targetTable);
2287
- appliedTableRef.current = targetTable;
2288
- setFilter(id);
2289
- onSelectTable?.(targetTable);
2259
+ onSelectTable?.(targetTable, {
2260
+ search: id
2261
+ });
2290
2262
  };
2291
- const previewRef = async (targetTable_0, id_0) => {
2263
+ const previewRef = async (targetTable, id) => {
2292
2264
  try {
2293
2265
  const result = await client.query(READ_TABLE_PAGE$1, {
2294
2266
  filters: [],
2295
2267
  limit: PREVIEW_CANDIDATES,
2296
2268
  offset: 0,
2297
- search: id_0,
2298
- table: targetTable_0
2269
+ search: id,
2270
+ table: targetTable
2299
2271
  }, callOptions(debouncedShard));
2300
- return result.rows.find((row) => rowId(row) === id_0) ?? null;
2272
+ return result.rows.find((row) => rowId(row) === id) ?? null;
2301
2273
  } catch {
2302
2274
  return null;
2303
2275
  }
2304
2276
  };
2305
- const facetFetcher = useCallback((shard, table_0, activeFilters, searchQuery) => (column) => client.query(FACET_COLUMN, {
2277
+ const facetFetcher = useCallback((shard, table2, activeFilters, searchQuery) => (column) => client.query(FACET_COLUMN, {
2306
2278
  column,
2307
2279
  filters: toFilterClauses(activeFilters),
2308
2280
  search: searchQuery,
2309
- table: table_0
2281
+ table: table2
2310
2282
  }, callOptions(shard)), [client]);
2311
- const toggleFacet = (column_0) => {
2312
- toggleFacetColumn(column_0, selectedTable === null ? null : facetFetcher(debouncedShard, selectedTable, filtersRef.current, search));
2283
+ const toggleFacet = (column) => {
2284
+ toggleFacetColumn(column, selectedTable === null ? null : facetFetcher(debouncedShard, selectedTable, filtersRef.current, search));
2313
2285
  };
2314
- const facetFilter = (column_1, value) => {
2286
+ const facetFilter = (column, value) => {
2315
2287
  const text = facetValueText(value);
2316
- setFilters((current) => [...current.filter((clause) => clause.column !== column_1), {
2317
- column: column_1,
2288
+ setFilters((current) => [...current.filter((clause) => clause.column !== column), {
2289
+ column,
2318
2290
  operator: "eq",
2319
2291
  value: text
2320
2292
  }]);
2321
2293
  setOffset(0);
2322
2294
  };
2295
+ const facetFetcherRef = useRef(facetFetcher);
2296
+ const refetchFacetsRef = useRef(refetchFacets);
2297
+ const onViewChangeRef = useRef(onViewChange);
2298
+ facetFetcherRef.current = facetFetcher;
2299
+ refetchFacetsRef.current = refetchFacets;
2300
+ onViewChangeRef.current = onViewChange;
2323
2301
  useEffect(() => {
2324
2302
  if (selectedTable === null) {
2325
2303
  return;
2326
2304
  }
2327
- refetchFacets(facetFetcher(debouncedShard, selectedTable, filters, search));
2328
- }, [debouncedShard, selectedTable, filters, search, facetFetcher, refetchFacets]);
2305
+ refetchFacetsRef.current(facetFetcherRef.current(debouncedShard, selectedTable, filters, search));
2306
+ }, [debouncedShard, selectedTable, filters, search]);
2307
+ const seededTableRef = useRef(tableParam);
2329
2308
  useEffect(() => {
2330
- if (selectedTable === null || onViewChange === void 0) {
2309
+ if (selectedTable === null || onViewChangeRef.current === void 0 || seededTableRef.current !== tableParam) {
2331
2310
  return;
2332
2311
  }
2333
- onViewChange({
2312
+ onViewChangeRef.current({
2334
2313
  filters: toFilterClauses(filters),
2335
2314
  orderBy: toOrderBy(sorting),
2336
2315
  search,
2337
2316
  shard: debouncedShard
2338
2317
  });
2339
- }, [selectedTable, filters, sorting, search, debouncedShard, onViewChange]);
2318
+ }, [selectedTable, tableParam, filters, sorting, search, debouncedShard]);
2319
+ const initialFiltersRef = useRef(initialFilters);
2320
+ const initialOrderByRef = useRef(initialOrderBy);
2321
+ const initialSearchRef = useRef(initialSearch);
2322
+ const initialShardKeyRef = useRef(initialShardKey);
2323
+ initialFiltersRef.current = initialFilters;
2324
+ initialOrderByRef.current = initialOrderBy;
2325
+ initialSearchRef.current = initialSearch;
2326
+ initialShardKeyRef.current = initialShardKey;
2340
2327
  useEffect(() => {
2341
- if (tableParam === void 0 || tableParam === "" || tableParam === appliedTableRef.current) {
2328
+ if (seededTableRef.current === tableParam) {
2342
2329
  return;
2343
2330
  }
2344
- appliedTableRef.current = tableParam;
2345
- const target = tableParam;
2331
+ seededTableRef.current = tableParam;
2346
2332
  queueMicrotask(() => {
2347
- selectTable(target);
2333
+ const nextFilters = toEditableFilters(initialFiltersRef.current ?? []);
2334
+ setSorting(fromOrderBy(initialOrderByRef.current));
2335
+ setFilter(initialSearchRef.current ?? "");
2336
+ setFilters(nextFilters);
2337
+ filtersRef.current = nextFilters;
2338
+ setShardKey(initialShardKeyRef.current ?? "");
2339
+ clearFacets();
2340
+ stagedEdits.clear();
2341
+ setEditingCell(null);
2342
+ setOffset(0);
2348
2343
  });
2349
- }, [tableParam, selectTable]);
2344
+ }, [tableParam]);
2350
2345
  const goToPage = (nextOffset) => {
2351
2346
  if (selectedTable === null) {
2352
2347
  return;
2353
2348
  }
2354
2349
  setOffset(Math.max(0, nextOffset));
2355
2350
  };
2356
- const editableColumn = (column_2) => !META_COLUMNS.has(column_2);
2357
- const startCellEdit = (targetRow, column_3) => {
2351
+ const editableColumn = (column) => !META_COLUMNS.has(column);
2352
+ const startCellEdit = (targetRow, column) => {
2358
2353
  setEditingCell({
2359
- column: column_3,
2354
+ column,
2360
2355
  rowId: targetRow
2361
2356
  });
2362
2357
  };
@@ -2370,10 +2365,10 @@ const useDataBrowser = ({
2370
2365
  setWriteError(null);
2371
2366
  setCommitting(true);
2372
2367
  try {
2373
- for (const [id_1, columns] of Object.entries(stagedEdits.staged)) {
2368
+ for (const [id, columns] of Object.entries(stagedEdits.staged)) {
2374
2369
  await client.query(WRITE_ROW$1, {
2375
2370
  doc: columns,
2376
- id: id_1,
2371
+ id,
2377
2372
  op: "patch",
2378
2373
  table: selectedTable
2379
2374
  }, callOptions(debouncedShard));
@@ -2393,26 +2388,26 @@ const useDataBrowser = ({
2393
2388
  };
2394
2389
  const stagedChanges = useMemo(() => {
2395
2390
  const rowsById = /* @__PURE__ */ new Map();
2396
- for (const row_0 of page?.rows ?? []) {
2397
- const id_2 = rowId(row_0);
2398
- if (id_2 !== null) {
2399
- rowsById.set(id_2, row_0);
2391
+ for (const row of page?.rows ?? []) {
2392
+ const id = rowId(row);
2393
+ if (id !== null) {
2394
+ rowsById.set(id, row);
2400
2395
  }
2401
2396
  }
2402
2397
  const changes = [];
2403
- for (const [id_3, columns_0] of Object.entries(stagedEdits.staged)) {
2404
- for (const [column_4, newValue] of Object.entries(columns_0)) {
2398
+ for (const [id, columns] of Object.entries(stagedEdits.staged)) {
2399
+ for (const [column, newValue] of Object.entries(columns)) {
2405
2400
  changes.push({
2406
- column: column_4,
2401
+ column,
2407
2402
  newValue,
2408
- oldValue: rowsById.get(id_3)?.[column_4],
2409
- rowId: id_3
2403
+ oldValue: rowsById.get(id)?.[column],
2404
+ rowId: id
2410
2405
  });
2411
2406
  }
2412
2407
  }
2413
2408
  return changes;
2414
2409
  }, [page, stagedEdits.staged]);
2415
- const writeRow = async (op, id_4, documentText) => {
2410
+ const writeRow = async (op, id, documentText) => {
2416
2411
  if (selectedTable === null) {
2417
2412
  return;
2418
2413
  }
@@ -2421,22 +2416,22 @@ const useDataBrowser = ({
2421
2416
  if (op !== "delete") {
2422
2417
  try {
2423
2418
  parsedDocument = documentText === void 0 || documentText.trim() === "" ? {} : JSON.parse(documentText);
2424
- } catch (error_0) {
2425
- setWriteError(`Invalid JSON: ${error_0.message}`);
2419
+ } catch (error) {
2420
+ setWriteError(`Invalid JSON: ${error.message}`);
2426
2421
  return;
2427
2422
  }
2428
2423
  }
2429
2424
  try {
2430
2425
  await client.query(WRITE_ROW$1, {
2431
2426
  doc: parsedDocument,
2432
- id: id_4 ?? void 0,
2427
+ id: id ?? void 0,
2433
2428
  op,
2434
2429
  table: selectedTable
2435
2430
  }, callOptions(debouncedShard));
2436
2431
  setEditing(null);
2437
2432
  pageQuery.refetch();
2438
- } catch (error_1) {
2439
- setWriteError(error_1.message);
2433
+ } catch (error) {
2434
+ setWriteError(error.message);
2440
2435
  }
2441
2436
  };
2442
2437
  const drainBulk = async (ref, args) => {
@@ -2446,22 +2441,22 @@ const useDataBrowser = ({
2446
2441
  setWriteError(null);
2447
2442
  try {
2448
2443
  for (let batch = 0; batch < MAX_BULK_DELETE_BATCHES; batch += 1) {
2449
- const result_0 = await client.query(ref, args, callOptions(debouncedShard));
2450
- if (!result_0.hasMore) {
2444
+ const result = await client.query(ref, args, callOptions(debouncedShard));
2445
+ if (!result.hasMore) {
2451
2446
  break;
2452
2447
  }
2453
2448
  }
2454
2449
  setOffset(0);
2455
2450
  pageQuery.refetch();
2456
- } catch (error_2) {
2457
- setWriteError(error_2.message);
2451
+ } catch (error) {
2452
+ setWriteError(error.message);
2458
2453
  }
2459
2454
  };
2460
2455
  const changeSorting = (updater) => {
2461
2456
  setSorting(updater);
2462
2457
  setOffset(0);
2463
2458
  };
2464
- const table_1 = useDataBrowserTable(page, sorting, changeSorting);
2459
+ const table = useDataBrowserTable(page, sorting, changeSorting);
2465
2460
  const currentView = {
2466
2461
  filters: toFilterClauses(filters),
2467
2462
  orderBy: toOrderBy(sorting),
@@ -2506,9 +2501,9 @@ const useDataBrowser = ({
2506
2501
  const addRow = () => {
2507
2502
  setWriteError(null);
2508
2503
  const seed = {};
2509
- for (const column_5 of page?.columns ?? []) {
2510
- if (!META_COLUMNS.has(column_5)) {
2511
- seed[column_5] = "";
2504
+ for (const column of page?.columns ?? []) {
2505
+ if (!META_COLUMNS.has(column)) {
2506
+ seed[column] = "";
2512
2507
  }
2513
2508
  }
2514
2509
  setEditing({
@@ -2516,10 +2511,10 @@ const useDataBrowser = ({
2516
2511
  id: ""
2517
2512
  });
2518
2513
  };
2519
- const setEditorDocumentText = (text_0) => {
2520
- setEditing((current_0) => current_0 === null ? current_0 : {
2521
- docText: text_0,
2522
- id: current_0.id
2514
+ const setEditorDocumentText = (text) => {
2515
+ setEditing((current) => current === null ? current : {
2516
+ docText: text,
2517
+ id: current.id
2523
2518
  });
2524
2519
  };
2525
2520
  const saveEdit = () => {
@@ -2545,15 +2540,15 @@ const useDataBrowser = ({
2545
2540
  setPageSize(size);
2546
2541
  setOffset(0);
2547
2542
  };
2548
- const onRowEdit = (id_5, original) => {
2543
+ const onRowEdit = (id, original) => {
2549
2544
  setWriteError(null);
2550
2545
  setEditing({
2551
2546
  docText: JSON.stringify(rowDocument(original), null, 2),
2552
- id: id_5
2547
+ id
2553
2548
  });
2554
2549
  };
2555
- const onRowDelete = (id_6) => {
2556
- fireAndForget(writeRow("delete", id_6));
2550
+ const onRowDelete = (id) => {
2551
+ fireAndForget(writeRow("delete", id));
2557
2552
  };
2558
2553
  const deleteSelected = async (ids) => {
2559
2554
  if (selectedTable === null || ids.length === 0) {
@@ -2561,20 +2556,20 @@ const useDataBrowser = ({
2561
2556
  }
2562
2557
  setWriteError(null);
2563
2558
  try {
2564
- for (const id_7 of ids) {
2559
+ for (const id of ids) {
2565
2560
  await client.query(WRITE_ROW$1, {
2566
- id: id_7,
2561
+ id,
2567
2562
  op: "delete",
2568
2563
  table: selectedTable
2569
2564
  }, callOptions(debouncedShard));
2570
2565
  }
2571
2566
  pageQuery.refetch();
2572
- } catch (error_3) {
2573
- setWriteError(error_3.message);
2567
+ } catch (error) {
2568
+ setWriteError(error.message);
2574
2569
  }
2575
2570
  };
2576
- const onBulkDeleteSelected = (ids_0) => {
2577
- fireAndForget(deleteSelected(ids_0));
2571
+ const onBulkDeleteSelected = (ids) => {
2572
+ fireAndForget(deleteSelected(ids));
2578
2573
  };
2579
2574
  const onCommitStaged = () => {
2580
2575
  fireAndForget(commitStaged());
@@ -2629,7 +2624,7 @@ const useDataBrowser = ({
2629
2624
  stagedChanges,
2630
2625
  stagedValue: stagedEdits.stagedValue,
2631
2626
  startCellEdit,
2632
- table: table_1,
2627
+ table,
2633
2628
  tables,
2634
2629
  tablesError,
2635
2630
  toggleFacet,
@@ -5,7 +5,7 @@ import { ShardInput } from './ShardInput-gx_DZXXn.js';
5
5
  import { B as Button } from './button-BhsN2uZH.js';
6
6
  import { C as Card, a as CardContent } from './card-DURq3ElK.js';
7
7
  import { T as Textarea } from './textarea-D3gaCU_-.js';
8
- import { a as useInvalidateAdmin } from './use-admin-query-4JQW2rr1.js';
8
+ import { a as useInvalidateAdmin } from './use-admin-query-BkbdNFNz.js';
9
9
  import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
10
10
  import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DjXgvJb6.js';
11
11
  import { f as fireAndForget, c as callOptions, e as errorMessage, a as adminRef } from './internal-rXJEAhXS.js';
@@ -7,7 +7,7 @@ import { B as Button } from './button-BhsN2uZH.js';
7
7
  import { C as Card, a as CardContent } from './card-DURq3ElK.js';
8
8
  import { E as EmptyState } from './empty-state-DY_oe0k6.js';
9
9
  import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from './table-_RzNvy3R.js';
10
- import { u as useAdminQuery } from './use-admin-query-4JQW2rr1.js';
10
+ import { u as useAdminQuery } from './use-admin-query-BkbdNFNz.js';
11
11
  import useDebounced from './useDebounced-Dxncpg6z.js';
12
12
  import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
13
13
  import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DjXgvJb6.js';
@@ -2,7 +2,7 @@ import { useLunora } from '@lunora/react';
2
2
  import { useState, useRef, useCallback, useEffect } from 'react';
3
3
  import { E as EmptyState } from './empty-state-DY_oe0k6.js';
4
4
  import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from './table-_RzNvy3R.js';
5
- import { b as useClientQuery } from './use-admin-query-4JQW2rr1.js';
5
+ import { b as useClientQuery } from './use-admin-query-BkbdNFNz.js';
6
6
  import { useAutoRefresh } from './DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js';
7
7
  import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
8
8
  import { b as CLOUDFLARE_D1_URL } from './cf-links-2cktDedA.js';
@@ -5,7 +5,7 @@ import ConnectionBadge from './ConnectionBadge-B2DDM2Tn.js';
5
5
  import { L as LiveError } from './live-status-FZ0psC1z.js';
6
6
  import { B as Badge } from './badge-B2PKA1-5.js';
7
7
  import { C as Card } from './card-DURq3ElK.js';
8
- import { u as useAdminQuery } from './use-admin-query-4JQW2rr1.js';
8
+ import { u as useAdminQuery } from './use-admin-query-BkbdNFNz.js';
9
9
  import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
10
10
  import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DjXgvJb6.js';
11
11
  import { f as fireAndForget, b as formatTimestamp, c as callOptions, e as errorMessage, a as adminRef } from './internal-rXJEAhXS.js';
@@ -4,7 +4,7 @@ import { B as Bar, E as EvilBarChart } from './bar-chart-CzJAgqkp.js';
4
4
  import { B as Badge } from './badge-B2PKA1-5.js';
5
5
  import { C as Card, a as CardContent } from './card-DURq3ElK.js';
6
6
  import { E as EmptyState } from './empty-state-DY_oe0k6.js';
7
- import { u as useAdminQuery } from './use-admin-query-4JQW2rr1.js';
7
+ import { u as useAdminQuery } from './use-admin-query-BkbdNFNz.js';
8
8
  import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
9
9
  import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DjXgvJb6.js';
10
10
  import { d as formatBytes, f as fireAndForget } from './internal-rXJEAhXS.js';
@@ -4,7 +4,7 @@ import { useNavigate } from '@tanstack/react-router';
4
4
  import { useState, useRef, useCallback, useEffect, useMemo } from 'react';
5
5
  import { ShardInput } from './ShardInput-gx_DZXXn.js';
6
6
  import { B as Button } from './button-BhsN2uZH.js';
7
- import { u as useAdminQuery } from './use-admin-query-4JQW2rr1.js';
7
+ import { u as useAdminQuery } from './use-admin-query-BkbdNFNz.js';
8
8
  import useDebounced from './useDebounced-Dxncpg6z.js';
9
9
  import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
10
10
  import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DjXgvJb6.js';
@@ -6,7 +6,7 @@ import { ShardInput } from './ShardInput-gx_DZXXn.js';
6
6
  import { B as Badge } from './badge-B2PKA1-5.js';
7
7
  import { E as EmptyState } from './empty-state-DY_oe0k6.js';
8
8
  import { I as Input } from './input-XH4r1Pt1.js';
9
- import { u as useAdminQuery } from './use-admin-query-4JQW2rr1.js';
9
+ import { u as useAdminQuery } from './use-admin-query-BkbdNFNz.js';
10
10
  import useDebounced from './useDebounced-Dxncpg6z.js';
11
11
  import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
12
12
  import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DjXgvJb6.js';
@@ -10,7 +10,7 @@ import { ScrollArea as ScrollArea$1 } from '@base-ui/react/scroll-area';
10
10
  import { c as cn } from './utils-B05Dmz_H.js';
11
11
  import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
12
12
  import { Separator as Separator$1 } from '@base-ui/react/separator';
13
- import { u as useAdminQuery } from './use-admin-query-4JQW2rr1.js';
13
+ import { u as useAdminQuery } from './use-admin-query-BkbdNFNz.js';
14
14
  import { useAutoRefresh } from './DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js';
15
15
  import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
16
16
  import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DjXgvJb6.js';
@@ -7,7 +7,7 @@ import { ShardInput } from './ShardInput-gx_DZXXn.js';
7
7
  import { B as Button } from './button-BhsN2uZH.js';
8
8
  import { a as CardContent, C as Card, b as CardHeader, c as CardTitle, d as CardDescription } from './card-DURq3ElK.js';
9
9
  import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from './table-_RzNvy3R.js';
10
- import { u as useAdminQuery } from './use-admin-query-4JQW2rr1.js';
10
+ import { u as useAdminQuery } from './use-admin-query-BkbdNFNz.js';
11
11
  import useDebounced from './useDebounced-Dxncpg6z.js';
12
12
  import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
13
13
  import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DjXgvJb6.js';
@@ -10,7 +10,7 @@ import { E as EmptyState } from './empty-state-DY_oe0k6.js';
10
10
  import { I as Input } from './input-XH4r1Pt1.js';
11
11
  import { L as Label } from './label-D8ykjn5J.js';
12
12
  import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from './table-_RzNvy3R.js';
13
- import { u as useAdminQuery } from './use-admin-query-4JQW2rr1.js';
13
+ import { u as useAdminQuery } from './use-admin-query-BkbdNFNz.js';
14
14
  import useDebounced from './useDebounced-Dxncpg6z.js';
15
15
  import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
16
16
  import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DjXgvJb6.js';
@@ -5,7 +5,7 @@ import { ConfirmButton } from './ConfirmButton-C2eVi2Qv.js';
5
5
  import { C as Card, a as CardContent } from './card-DURq3ElK.js';
6
6
  import { E as EmptyState } from './empty-state-DY_oe0k6.js';
7
7
  import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from './table-_RzNvy3R.js';
8
- import { b as useClientQuery } from './use-admin-query-4JQW2rr1.js';
8
+ import { b as useClientQuery } from './use-admin-query-BkbdNFNz.js';
9
9
  import { useAutoRefresh } from './DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js';
10
10
  import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
11
11
  import { f as fireAndForget, b as formatTimestamp, e as errorMessage } from './internal-rXJEAhXS.js';
@@ -1,5 +1,5 @@
1
1
  import { c } from 'react/compiler-runtime';
2
- import { u as useAdminQuery } from './use-admin-query-4JQW2rr1.js';
2
+ import { u as useAdminQuery } from './use-admin-query-BkbdNFNz.js';
3
3
  import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
4
4
  import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DjXgvJb6.js';
5
5
  import { A as AdvisorView } from './advisor-view-CGcfMiPq.js';
@@ -3,7 +3,7 @@ import 'react';
3
3
  import { B as Badge } from './badge-B2PKA1-5.js';
4
4
  import { C as Card, a as CardContent } from './card-DURq3ElK.js';
5
5
  import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from './table-_RzNvy3R.js';
6
- import { u as useAdminQuery } from './use-admin-query-4JQW2rr1.js';
6
+ import { u as useAdminQuery } from './use-admin-query-BkbdNFNz.js';
7
7
  import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
8
8
  import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DjXgvJb6.js';
9
9
  import { a as CLOUDFLARE_WORKERS_URL } from './cf-links-2cktDedA.js';