@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
@@ -1,28 +1,28 @@
1
1
  import 'react/compiler-runtime';
2
2
  import '@tanstack/react-router';
3
3
  import 'react';
4
- export { S as Studio } from './studio-9Mq0PdMi.js';
4
+ export { S as Studio } from './studio-DRWW__L9.js';
5
5
  import './ErrorBoundary-BzAApI7J.js';
6
6
  import './badge-B2PKA1-5.js';
7
7
  import './input-XH4r1Pt1.js';
8
8
  import './reference-view-B4E49Lip.js';
9
- import './InsightsPanel-CvXMoZuv.js';
10
- import './SecurityAdvisorPanel-DTmjUNqt.js';
9
+ import './InsightsPanel-BchgeeRx.js';
10
+ import './SecurityAdvisorPanel-PAx712Bd.js';
11
11
  import './ApiTab-rwttyQ1-.js';
12
- import './TableEditor-DzK3Z6rL.js';
13
- import './ExportImportPanel-BGJqFK9X.js';
14
- import './MigrationsPanel-DaZuUHje.js';
12
+ import './table-editor-CiyJi0Nm.js';
13
+ import './ExportImportPanel-NtZVqbOj.js';
14
+ import './MigrationsPanel-CaUpce-G.js';
15
15
  import './PitrPanel-LJGNP_IX.js';
16
16
  import './FunctionRunner-7NH3KcTg.js';
17
- import './FunctionStatsPanel-CXynSuqT.js';
18
- import './HomePanel-BOkFRbuj.js';
19
- import './AuditPanel-D9Eh7j7E.js';
20
- import './LogsPanel-BrUstOk6.js';
21
- import './MailPanel-GnnrNqL6.js';
22
- import './HealthPanel-CyLs7qZm.js';
23
- import './MetricsPanel-BN_uUU-_.js';
17
+ import './FunctionStatsPanel-n-6FrbOH.js';
18
+ import './HomePanel-CpFLsa64.js';
19
+ import './AuditPanel-SRilxyg0.js';
20
+ import './LogsPanel-DsPnKZ95.js';
21
+ import './MailPanel-Bmg781UW.js';
22
+ import './HealthPanel-Dpr6KTmV.js';
23
+ import './MetricsPanel-DaE8ZXrf.js';
24
24
  import './SchemaViewer-Bam6ylvw.js';
25
- import './SettingsPanel-C2wDK-8F.js';
25
+ import './SettingsPanel-C4tufQD5.js';
26
26
  import './sql-editor-panel-Smfl_FDF.js';
27
27
  import './FileBrowser-0pCpdKPE.js';
28
28
  import './DEFAULT_LOCALE-CiX4W7Kr.js';
@@ -3,7 +3,7 @@ import { LunoraClient } from '@lunora/client';
3
3
  import { LunoraProvider } from '@lunora/react';
4
4
  import { useState, useEffect } from 'react';
5
5
  import { ErrorBoundary } from './ErrorBoundary-BzAApI7J.js';
6
- import { u as useTheme, B as BrandMark, T as ThemeProvider, a as TooltipProvider, S as Studio } from './studio-9Mq0PdMi.js';
6
+ import { u as useTheme, B as BrandMark, T as ThemeProvider, a as TooltipProvider, S as Studio } from './studio-DRWW__L9.js';
7
7
  import useDebounced from './useDebounced-Dxncpg6z.js';
8
8
  import { useT, createStudioI18n } from './DEFAULT_LOCALE-CiX4W7Kr.js';
9
9
  import { StudioI18nProvider } from './StudioI18nProvider-B-tDCZIi.js';
@@ -0,0 +1,11 @@
1
+ import 'react/compiler-runtime';
2
+ import '@lunora/react';
3
+ import '@tanstack/react-router';
4
+ import 'react';
5
+ import './storage-tier-CL98eOvn.js';
6
+ import './DEFAULT_LOCALE-CiX4W7Kr.js';
7
+ export { T as TableEditor } from './table-editor-CiyJi0Nm.js';
8
+ import './internal-rXJEAhXS.js';
9
+ import './DataBrowser-B4v_9GiU.js';
10
+ import './GlobalDataBrowser-3X9uRfdO.js';
11
+ import 'react/jsx-dev-runtime';
@@ -20,13 +20,13 @@ import { B as Button } from './button-BhsN2uZH.js';
20
20
  import { Dialog } from '@base-ui/react/dialog';
21
21
  import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
22
22
  import { S as Skeleton } from './reference-view-B4E49Lip.js';
23
- import { InsightsPanel } from './InsightsPanel-CvXMoZuv.js';
23
+ import { InsightsPanel } from './InsightsPanel-BchgeeRx.js';
24
24
  import { a as CardContent, C as Card, b as CardHeader, c as CardTitle, d as CardDescription } from './card-DURq3ElK.js';
25
25
  import { E as EmptyState } from './empty-state-DY_oe0k6.js';
26
26
  import { T as Table, a as TableHeader, b as TableRow, c as TableHead, d as TableBody, e as TableCell } from './table-_RzNvy3R.js';
27
- import { u as useAdminQuery, b as useClientQuery } from './use-admin-query-4JQW2rr1.js';
27
+ import { u as useAdminQuery, b as useClientQuery } from './use-admin-query-BkbdNFNz.js';
28
28
  import { ADMIN_FUNCTIONS } from './ADMIN_FUNCTIONS-DjXgvJb6.js';
29
- import SecurityAdvisorPanel from './SecurityAdvisorPanel-DTmjUNqt.js';
29
+ import SecurityAdvisorPanel from './SecurityAdvisorPanel-PAx712Bd.js';
30
30
  import { createAnalyticsSqlClient } from '@lunora/bindings/analytics';
31
31
  import { e as errorMessage, f as fireAndForget, h as formatCell, b as formatTimestamp, g as copyToClipboard, c as callOptions, a as adminRef } from './internal-rXJEAhXS.js';
32
32
  import ApiTab from './ApiTab-rwttyQ1-.js';
@@ -35,27 +35,27 @@ import { useAutoRefresh } from './DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js';
35
35
  import useDebounced from './useDebounced-Dxncpg6z.js';
36
36
  import { L as Label } from './label-D8ykjn5J.js';
37
37
  import { M as ModalShell } from './grid-features-CzUfqgsM.js';
38
- import { TableEditor } from './TableEditor-DzK3Z6rL.js';
39
- import { ExportImportPanel } from './ExportImportPanel-BGJqFK9X.js';
40
- import { MigrationsPanel } from './MigrationsPanel-DaZuUHje.js';
38
+ import { v as validateDataViewSearch, T as TableEditor } from './table-editor-CiyJi0Nm.js';
39
+ import { ExportImportPanel } from './ExportImportPanel-NtZVqbOj.js';
40
+ import { MigrationsPanel } from './MigrationsPanel-CaUpce-G.js';
41
41
  import { PitrPanel } from './PitrPanel-LJGNP_IX.js';
42
42
  import { FunctionRunner } from './FunctionRunner-7NH3KcTg.js';
43
- import { FunctionStatsPanel } from './FunctionStatsPanel-CXynSuqT.js';
44
- import { HomePanel } from './HomePanel-BOkFRbuj.js';
45
- import { AuditPanel } from './AuditPanel-D9Eh7j7E.js';
43
+ import { FunctionStatsPanel } from './FunctionStatsPanel-n-6FrbOH.js';
44
+ import { HomePanel } from './HomePanel-CpFLsa64.js';
45
+ import { AuditPanel } from './AuditPanel-SRilxyg0.js';
46
46
  import { C as CLOUDFLARE_OBSERVABILITY_URL } from './cf-links-2cktDedA.js';
47
- import { LogsPanel } from './LogsPanel-BrUstOk6.js';
48
- import { MailPanel } from './MailPanel-GnnrNqL6.js';
47
+ import { LogsPanel } from './LogsPanel-DsPnKZ95.js';
48
+ import { MailPanel } from './MailPanel-Bmg781UW.js';
49
49
  import { ConfirmButton } from './ConfirmButton-C2eVi2Qv.js';
50
- import { ScheduledJobs } from './ScheduledJobs-UmVaMbJy.js';
50
+ import { ScheduledJobs } from './ScheduledJobs-BWNwIN3I.js';
51
51
  import { ShardInput } from './ShardInput-gx_DZXXn.js';
52
52
  import { L as LiveError } from './live-status-FZ0psC1z.js';
53
53
  import { T as Textarea } from './textarea-D3gaCU_-.js';
54
54
  import { u as usePersistedList, A as Alert, a as SqlResultChart, n as newId, S as SqlEditorPanel } from './sql-editor-panel-Smfl_FDF.js';
55
- import { HealthPanel } from './HealthPanel-CyLs7qZm.js';
56
- import { MetricsPanel } from './MetricsPanel-BN_uUU-_.js';
55
+ import { HealthPanel } from './HealthPanel-Dpr6KTmV.js';
56
+ import { MetricsPanel } from './MetricsPanel-DaE8ZXrf.js';
57
57
  import { SchemaViewer } from './SchemaViewer-Bam6ylvw.js';
58
- import { SettingsPanel } from './SettingsPanel-C2wDK-8F.js';
58
+ import { SettingsPanel } from './SettingsPanel-C4tufQD5.js';
59
59
  import { FileBrowser } from './FileBrowser-0pCpdKPE.js';
60
60
  import { StudioI18nProvider } from './StudioI18nProvider-B-tDCZIi.js';
61
61
  import { CommandPalette, openCommandPalette } from './CommandPalette-BtgkBzZI.js';
@@ -8040,10 +8040,6 @@ const WorkflowInstanceHistory = ({
8040
8040
  const [error, setError] = useState(null);
8041
8041
  const [notConfigured, setNotConfigured] = useState(false);
8042
8042
  const [busyId, setBusyId] = useState(null);
8043
- const listImpl = loadInstances ?? (async (arguments_) => {
8044
- const page = await client.listWorkflowInstances(arguments_);
8045
- return page.instances;
8046
- });
8047
8043
  const detailImpl = loadDetail ?? ((arguments_) => client.getWorkflowInstance(arguments_));
8048
8044
  const clientOwned = loadInstances === void 0;
8049
8045
  const clientAction = clientOwned ? (arguments_) => client.setWorkflowInstanceStatus(arguments_) : void 0;
@@ -8051,10 +8047,24 @@ const WorkflowInstanceHistory = ({
8051
8047
  const load = async () => {
8052
8048
  setError(null);
8053
8049
  setNotConfigured(false);
8050
+ const status = statusFilter === "" ? void 0 : statusFilter;
8054
8051
  try {
8055
- setInstances(await listImpl({
8052
+ if (loadInstances === void 0) {
8053
+ const page = await client.listWorkflowInstances({
8054
+ name: workflowName,
8055
+ status
8056
+ });
8057
+ if (page.configured === false) {
8058
+ setInstances(null);
8059
+ setNotConfigured(true);
8060
+ return;
8061
+ }
8062
+ setInstances(page.instances);
8063
+ return;
8064
+ }
8065
+ setInstances(await loadInstances({
8056
8066
  name: workflowName,
8057
- status: statusFilter === "" ? void 0 : statusFilter
8067
+ status
8058
8068
  }));
8059
8069
  } catch (error_) {
8060
8070
  setInstances(null);
@@ -10654,11 +10664,21 @@ const buildRouter = ({
10654
10664
  getParentRoute: () => rootRoute,
10655
10665
  path: "/"
10656
10666
  });
10657
- const tabRoutes = TABS.map((tab) => createRoute({
10658
- component: () => panels[tab],
10659
- getParentRoute: () => rootRoute,
10660
- path: `/${tab}`
10661
- }));
10667
+ const tabRoutes = TABS.map((tab) => {
10668
+ if (tab === "data") {
10669
+ return createRoute({
10670
+ component: () => panels[tab],
10671
+ getParentRoute: () => rootRoute,
10672
+ path: `/${tab}`,
10673
+ validateSearch: validateDataViewSearch
10674
+ });
10675
+ }
10676
+ return createRoute({
10677
+ component: () => panels[tab],
10678
+ getParentRoute: () => rootRoute,
10679
+ path: `/${tab}`
10680
+ });
10681
+ });
10662
10682
  const routeTree = rootRoute.addChildren([indexRoute, ...tabRoutes]);
10663
10683
  const history = "window" in globalThis ? createBrowserHistory() : createMemoryHistory({
10664
10684
  initialEntries: ["/home"]
@@ -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-B4v_9GiU.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