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

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 (38) hide show
  1. package/dist/index.d.ts +10 -6
  2. package/dist/index.js +26 -26
  3. package/dist/mount.d.ts +1 -1
  4. package/dist/mount.js +1 -1
  5. package/dist/packem_shared/{ADMIN_FUNCTIONS-DjXgvJb6.js → ADMIN_FUNCTIONS-CZJCZ4c7.js} +1 -0
  6. package/dist/packem_shared/{ApiDocsPanel-yVSGHK3H.js → ApiDocsPanel-yEz0fiof.js} +1 -1
  7. package/dist/packem_shared/{ApiTab-rwttyQ1-.js → ApiTab-DdubReQI.js} +1 -1
  8. package/dist/packem_shared/{AuditPanel-D9Eh7j7E.js → AuditPanel-CE5ofjCc.js} +2 -2
  9. package/dist/packem_shared/{DataBrowser-CyckZRwj.js → DataBrowser-DpL8U-Nf.js} +97 -102
  10. package/dist/packem_shared/{ExportImportPanel-BGJqFK9X.js → ExportImportPanel-ChsSUCYZ.js} +2 -2
  11. package/dist/packem_shared/{FileBrowser-0pCpdKPE.js → FileBrowser-DsRBnVhZ.js} +1 -1
  12. package/dist/packem_shared/{FunctionRunner-7NH3KcTg.js → FunctionRunner-D4cZ6fuA.js} +1 -1
  13. package/dist/packem_shared/{FunctionStatsPanel-CXynSuqT.js → FunctionStatsPanel-BVelWgNv.js} +2 -2
  14. package/dist/packem_shared/{GlobalDataBrowser-DAxzB-Br.js → GlobalDataBrowser-3X9uRfdO.js} +1 -1
  15. package/dist/packem_shared/{HealthPanel-CyLs7qZm.js → HealthPanel-CxUVKfvo.js} +2 -2
  16. package/dist/packem_shared/{HomePanel-BOkFRbuj.js → HomePanel-tfqpZxuu.js} +2 -2
  17. package/dist/packem_shared/{InsightsPanel-CvXMoZuv.js → InsightsPanel-DNg3K9XN.js} +2 -2
  18. package/dist/packem_shared/{LogsPanel-BrUstOk6.js → LogsPanel-B4LoSRj0.js} +2 -2
  19. package/dist/packem_shared/{MailPanel-GnnrNqL6.js → MailPanel-CcpdyWYs.js} +2 -2
  20. package/dist/packem_shared/{MetricsPanel-BN_uUU-_.js → MetricsPanel-CxoyWbNb.js} +2 -2
  21. package/dist/packem_shared/{MigrationsPanel-DaZuUHje.js → MigrationsPanel-DGwJGWDA.js} +2 -2
  22. package/dist/packem_shared/{PitrPanel-LJGNP_IX.js → PitrPanel-CKUzyyHi.js} +1 -1
  23. package/dist/packem_shared/{ScheduledJobs-UmVaMbJy.js → ScheduledJobs-BWNwIN3I.js} +1 -1
  24. package/dist/packem_shared/{SchemaViewer-Bam6ylvw.js → SchemaViewer-RclXFo9Q.js} +1 -1
  25. package/dist/packem_shared/{SecurityAdvisorPanel-DTmjUNqt.js → SecurityAdvisorPanel-Dqql1Z5O.js} +2 -2
  26. package/dist/packem_shared/{SettingsPanel-C2wDK-8F.js → SettingsPanel-D5iTY0YE.js} +2 -2
  27. package/dist/packem_shared/{SqlEditorPanel-D5wMIxcg.js → SqlEditorPanel-Dj-In-B3.js} +2 -2
  28. package/dist/packem_shared/Studio-VWvKNOw4.js +33 -0
  29. package/dist/packem_shared/{StudioApp-C7aaizqc.js → StudioApp-BhQ6T2pn.js} +1 -1
  30. package/dist/packem_shared/TableEditor-BY8bTpCl.js +11 -0
  31. package/dist/packem_shared/{app.d-Nbhpihxv.d.ts → app.d-BVJFkXyj.d.ts} +1 -1
  32. package/dist/packem_shared/{sql-editor-panel-Smfl_FDF.js → sql-editor-panel-CMdxstu5.js} +1 -1
  33. package/dist/packem_shared/{studio-9Mq0PdMi.js → studio-D8ry3tJR.js} +760 -548
  34. package/dist/packem_shared/{TableEditor-DzK3Z6rL.js → table-editor-CWx68ZCg.js} +41 -5
  35. package/dist/packem_shared/{use-admin-query-4JQW2rr1.js → use-admin-query-BkbdNFNz.js} +18 -1
  36. package/dist/standalone/studio.js +173 -173
  37. package/package.json +3 -3
  38. package/dist/packem_shared/Studio-DpgYe4qt.js +0 -33
@@ -5,11 +5,18 @@ import { useRef, useState, useEffect } from 'react';
5
5
  import { T as TIER_META } from './storage-tier-CL98eOvn.js';
6
6
  import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
7
7
  import { f as fireAndForget } from './internal-rXJEAhXS.js';
8
- import { DataBrowser } from './DataBrowser-CyckZRwj.js';
9
- import { GlobalDataBrowser } from './GlobalDataBrowser-DAxzB-Br.js';
8
+ import { DataBrowser } from './DataBrowser-DpL8U-Nf.js';
9
+ import { GlobalDataBrowser } from './GlobalDataBrowser-3X9uRfdO.js';
10
10
  import { jsxDEV } from 'react/jsx-dev-runtime';
11
11
 
12
12
  const VALID_OPERATORS = /* @__PURE__ */ new Set(["contains", "eq", "gt", "gte", "lt", "lte", "ne"]);
13
+ const stringParameter = (raw) => {
14
+ if (typeof raw !== "string") {
15
+ return void 0;
16
+ }
17
+ const value = raw.trim();
18
+ return value === "" ? void 0 : value;
19
+ };
13
20
  const isFilterClause = (entry) => {
14
21
  if (entry === null || typeof entry !== "object") {
15
22
  return false;
@@ -46,6 +53,33 @@ const parseOrder = (raw) => {
46
53
  direction
47
54
  };
48
55
  };
56
+ const validateDataViewSearch = (search) => {
57
+ const validated = {};
58
+ if (search["schema"] === "global") {
59
+ validated.schema = "global";
60
+ }
61
+ const table = stringParameter(search["table"]);
62
+ if (table !== void 0) {
63
+ validated.table = table;
64
+ }
65
+ const shard = stringParameter(search["shard"]);
66
+ if (shard !== void 0) {
67
+ validated.shard = shard;
68
+ }
69
+ const searchText = stringParameter(search["search"]);
70
+ if (searchText !== void 0) {
71
+ validated.search = searchText;
72
+ }
73
+ const order = stringParameter(search["order"]);
74
+ if (order !== void 0 && parseOrder(order) !== void 0) {
75
+ validated.order = order;
76
+ }
77
+ const filters = stringParameter(search["filters"]);
78
+ if (filters !== void 0 && parseFilters(filters).length > 0) {
79
+ validated.filters = filters;
80
+ }
81
+ return validated;
82
+ };
49
83
  const searchToDataView = (search) => {
50
84
  const filters = parseFilters(search["filters"]);
51
85
  const orderBy = parseOrder(search["order"]);
@@ -260,14 +294,16 @@ const TableEditor = ({
260
294
  to: "/data"
261
295
  }));
262
296
  };
263
- const onSelectTable = (table_0) => {
297
+ const onSelectTable = (table_0, options) => {
264
298
  if (!onDataRoute()) {
265
299
  return;
266
300
  }
267
301
  fireAndForget(navigate({
268
302
  search: (previous_1) => {
269
303
  return {
270
- ...previous_1,
304
+ schema: previous_1["schema"],
305
+ search: options?.search,
306
+ shard: previous_1["shard"],
271
307
  table: table_0
272
308
  };
273
309
  },
@@ -368,4 +404,4 @@ const TableEditor = ({
368
404
  }, void 0, false);
369
405
  };
370
406
 
371
- export { TableEditor };
407
+ export { TableEditor as T, validateDataViewSearch as v };
@@ -5,15 +5,32 @@ import { useState, useEffect } from 'react';
5
5
  import { a as adminRef, c as callOptions, f as fireAndForget, e as errorMessage } from './internal-rXJEAhXS.js';
6
6
 
7
7
  const adminQueryKey = (path, args, shardKey) => ["lunora-admin", path, args, shardKey.trim()];
8
+ const RPC_LOOP_WINDOW_MS = 1e3;
9
+ const RPC_LOOP_THRESHOLD = 25;
10
+ const rpcCallTimes = /* @__PURE__ */ new Map();
11
+ const noteQueryFetch = (key) => {
12
+ const now = Date.now();
13
+ const recent = (rpcCallTimes.get(key) ?? []).filter((time) => now - time < RPC_LOOP_WINDOW_MS);
14
+ recent.push(now);
15
+ rpcCallTimes.set(key, recent);
16
+ if (recent.length === RPC_LOOP_THRESHOLD) {
17
+ console.error(`[lunora-studio] possible request loop: ${key} fired ${String(RPC_LOOP_THRESHOLD)}× in <1s — a render/effect is re-issuing this read unbounded.`);
18
+ console.trace("[lunora-studio] request-loop call site");
19
+ }
20
+ };
8
21
  function useClientQuery(queryKey, queryFunction, options = {}) {
9
22
  const {
10
23
  enabled = true,
11
24
  keepPreviousData: keepPreviousData$1 = false,
12
25
  staleTime = 0
13
26
  } = options;
27
+ const trackedQueryFunction = () => {
28
+ noteQueryFetch(JSON.stringify(queryKey));
29
+ return queryFunction();
30
+ } ;
14
31
  const query = useQuery({
15
32
  enabled,
16
- queryFn: queryFunction,
33
+ queryFn: trackedQueryFunction,
17
34
  placeholderData: keepPreviousData$1 ? keepPreviousData : void 0,
18
35
  queryKey,
19
36
  staleTime