@lunora/studio 0.0.0 → 1.0.0-alpha.10

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 (80) hide show
  1. package/LICENSE.md +105 -0
  2. package/README.md +123 -9
  3. package/__assets__/package-og.svg +14 -0
  4. package/dist/index.d.ts +1403 -0
  5. package/dist/index.js +41 -0
  6. package/dist/mount.d.ts +21 -0
  7. package/dist/mount.js +26 -0
  8. package/dist/packem_shared/ADMIN_FUNCTIONS-DjXgvJb6.js +46 -0
  9. package/dist/packem_shared/ApiDocsPanel-yVSGHK3H.js +842 -0
  10. package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +229 -0
  11. package/dist/packem_shared/ApiTab-rwttyQ1-.js +251 -0
  12. package/dist/packem_shared/AuditPanel-D9Eh7j7E.js +200 -0
  13. package/dist/packem_shared/CommandPalette-BtgkBzZI.js +373 -0
  14. package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +59 -0
  15. package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +111 -0
  16. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +50 -0
  17. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +89 -0
  18. package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +27 -0
  19. package/dist/packem_shared/DataBrowser-CyckZRwj.js +4480 -0
  20. package/dist/packem_shared/DataFilters-FNquMaiu.js +249 -0
  21. package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +66 -0
  22. package/dist/packem_shared/ExportImportPanel-BGJqFK9X.js +197 -0
  23. package/dist/packem_shared/FileBrowser-0pCpdKPE.js +2932 -0
  24. package/dist/packem_shared/FunctionRunner-7NH3KcTg.js +343 -0
  25. package/dist/packem_shared/FunctionStatsPanel-CXynSuqT.js +375 -0
  26. package/dist/packem_shared/GlobalDataBrowser-DAxzB-Br.js +289 -0
  27. package/dist/packem_shared/HealthPanel-CyLs7qZm.js +648 -0
  28. package/dist/packem_shared/HomePanel-BOkFRbuj.js +1334 -0
  29. package/dist/packem_shared/InsightsPanel-CvXMoZuv.js +461 -0
  30. package/dist/packem_shared/LogsPanel-BrUstOk6.js +827 -0
  31. package/dist/packem_shared/MailPanel-GnnrNqL6.js +440 -0
  32. package/dist/packem_shared/MetricsPanel-BN_uUU-_.js +1611 -0
  33. package/dist/packem_shared/MigrationsPanel-DaZuUHje.js +239 -0
  34. package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +191 -0
  35. package/dist/packem_shared/PitrPanel-LJGNP_IX.js +252 -0
  36. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +3 -0
  37. package/dist/packem_shared/ScheduledJobs-UmVaMbJy.js +262 -0
  38. package/dist/packem_shared/SchemaViewer-Bam6ylvw.js +2512 -0
  39. package/dist/packem_shared/SecurityAdvisorPanel-DTmjUNqt.js +92 -0
  40. package/dist/packem_shared/SettingsPanel-C2wDK-8F.js +390 -0
  41. package/dist/packem_shared/ShardInput-gx_DZXXn.js +107 -0
  42. package/dist/packem_shared/SqlEditorPanel-D5wMIxcg.js +13 -0
  43. package/dist/packem_shared/Studio-DpgYe4qt.js +33 -0
  44. package/dist/packem_shared/StudioApp-C7aaizqc.js +657 -0
  45. package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +48 -0
  46. package/dist/packem_shared/TableEditor-DzK3Z6rL.js +371 -0
  47. package/dist/packem_shared/advisor-view-CGcfMiPq.js +159 -0
  48. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +108 -0
  49. package/dist/packem_shared/app.d-Nbhpihxv.d.ts +300 -0
  50. package/dist/packem_shared/badge-B2PKA1-5.js +49 -0
  51. package/dist/packem_shared/bar-chart-CzJAgqkp.js +3245 -0
  52. package/dist/packem_shared/button-BhsN2uZH.js +49 -0
  53. package/dist/packem_shared/card-DURq3ElK.js +175 -0
  54. package/dist/packem_shared/cf-links-2cktDedA.js +8 -0
  55. package/dist/packem_shared/checkbox-UNkzAxl-.js +63 -0
  56. package/dist/packem_shared/data-grid-B5CaV3wS.js +183 -0
  57. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +280 -0
  58. package/dist/packem_shared/empty-state-DY_oe0k6.js +98 -0
  59. package/dist/packem_shared/grid-features-CzUfqgsM.js +840 -0
  60. package/dist/packem_shared/input-XH4r1Pt1.js +53 -0
  61. package/dist/packem_shared/internal-rXJEAhXS.js +68 -0
  62. package/dist/packem_shared/label-D8ykjn5J.js +46 -0
  63. package/dist/packem_shared/live-status-FZ0psC1z.js +44 -0
  64. package/dist/packem_shared/reference-view-B4E49Lip.js +2180 -0
  65. package/dist/packem_shared/shard-history-DyebH1R5.js +38 -0
  66. package/dist/packem_shared/sparkline-10dG-_f0.js +93 -0
  67. package/dist/packem_shared/sql-editor-panel-Smfl_FDF.js +2562 -0
  68. package/dist/packem_shared/storage-tier-CL98eOvn.js +85 -0
  69. package/dist/packem_shared/studio-9Mq0PdMi.js +10831 -0
  70. package/dist/packem_shared/table-_RzNvy3R.js +246 -0
  71. package/dist/packem_shared/table-list-sidebar-Bg7uzbvC.js +832 -0
  72. package/dist/packem_shared/textarea-D3gaCU_-.js +46 -0
  73. package/dist/packem_shared/use-admin-query-4JQW2rr1.js +88 -0
  74. package/dist/packem_shared/useDebounced-Dxncpg6z.js +32 -0
  75. package/dist/packem_shared/utils-B05Dmz_H.js +8 -0
  76. package/dist/packem_shared/virtual-rect-CVMUskSm.js +10 -0
  77. package/dist/standalone/studio.js +378 -0
  78. package/dist/styles.css +2 -0
  79. package/package.json +78 -17
  80. package/src/theme.css +59 -0
@@ -0,0 +1,46 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import 'react';
3
+ import { c as cn } from './utils-B05Dmz_H.js';
4
+ import { jsxDEV } from 'react/jsx-dev-runtime';
5
+
6
+ function Textarea(t0) {
7
+ const $ = c(8);
8
+ let className;
9
+ let props;
10
+ if ($[0] !== t0) {
11
+ ({
12
+ className,
13
+ ...props
14
+ } = t0);
15
+ $[0] = t0;
16
+ $[1] = className;
17
+ $[2] = props;
18
+ } else {
19
+ className = $[1];
20
+ props = $[2];
21
+ }
22
+ let t1;
23
+ if ($[3] !== className) {
24
+ t1 = cn("flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-2.5 py-2 text-xs transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40", className);
25
+ $[3] = className;
26
+ $[4] = t1;
27
+ } else {
28
+ t1 = $[4];
29
+ }
30
+ let t2;
31
+ if ($[5] !== props || $[6] !== t1) {
32
+ t2 = /* @__PURE__ */ jsxDEV("textarea", {
33
+ "data-slot": "textarea",
34
+ className: t1,
35
+ ...props
36
+ }, void 0, false);
37
+ $[5] = props;
38
+ $[6] = t1;
39
+ $[7] = t2;
40
+ } else {
41
+ t2 = $[7];
42
+ }
43
+ return t2;
44
+ }
45
+
46
+ export { Textarea as T };
@@ -0,0 +1,88 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import { useLunora } from '@lunora/react';
3
+ import { useQueryClient, useQuery, keepPreviousData } from '@tanstack/react-query';
4
+ import { useState, useEffect } from 'react';
5
+ import { a as adminRef, c as callOptions, f as fireAndForget, e as errorMessage } from './internal-rXJEAhXS.js';
6
+
7
+ const adminQueryKey = (path, args, shardKey) => ["lunora-admin", path, args, shardKey.trim()];
8
+ function useClientQuery(queryKey, queryFunction, options = {}) {
9
+ const {
10
+ enabled = true,
11
+ keepPreviousData: keepPreviousData$1 = false,
12
+ staleTime = 0
13
+ } = options;
14
+ const query = useQuery({
15
+ enabled,
16
+ queryFn: queryFunction,
17
+ placeholderData: keepPreviousData$1 ? keepPreviousData : void 0,
18
+ queryKey,
19
+ staleTime
20
+ });
21
+ return {
22
+ data: query.data,
23
+ error: query.error ? errorMessage(query.error) : query.error,
24
+ isLoading: query.isLoading,
25
+ liveError: void 0,
26
+ refetch: () => {
27
+ fireAndForget(query.refetch());
28
+ }
29
+ };
30
+ }
31
+ function useAdminQuery(path, args, options = {}) {
32
+ const client = useLunora();
33
+ const queryClient = useQueryClient();
34
+ const {
35
+ enabled = true,
36
+ keepPreviousData = false,
37
+ live = false,
38
+ shardKey = "",
39
+ staleTime
40
+ } = options;
41
+ const queryKey = adminQueryKey(path, args, shardKey);
42
+ const base = useClientQuery(queryKey, () => client.query(adminRef(path), args, callOptions(shardKey)), {
43
+ enabled,
44
+ keepPreviousData,
45
+ staleTime: staleTime ?? (live ? Number.POSITIVE_INFINITY : 0)
46
+ });
47
+ const [liveError, setLiveError] = useState(void 0);
48
+ const keySignature = JSON.stringify(queryKey);
49
+ useEffect(() => {
50
+ if (!enabled || !live) {
51
+ return void 0;
52
+ }
53
+ setLiveError(void 0);
54
+ return client.subscribe(adminRef(path), args, (value) => {
55
+ setLiveError(void 0);
56
+ queryClient.setQueryData(queryKey, value);
57
+ }, {
58
+ ...callOptions(shardKey),
59
+ onError: (error) => {
60
+ setLiveError(error.message);
61
+ }
62
+ });
63
+ }, [keySignature, enabled, live]);
64
+ return {
65
+ ...base,
66
+ liveError: enabled && live ? liveError : void 0
67
+ };
68
+ }
69
+ const useInvalidateAdmin = () => {
70
+ const $ = c(2);
71
+ const queryClient = useQueryClient();
72
+ let t0;
73
+ if ($[0] !== queryClient) {
74
+ t0 = (path, args, shardKey) => {
75
+ const queryKey = args === void 0 ? ["lunora-admin", path] : adminQueryKey(path, args, shardKey ?? "");
76
+ fireAndForget(queryClient.invalidateQueries({
77
+ queryKey
78
+ }));
79
+ };
80
+ $[0] = queryClient;
81
+ $[1] = t0;
82
+ } else {
83
+ t0 = $[1];
84
+ }
85
+ return t0;
86
+ };
87
+
88
+ export { useInvalidateAdmin as a, useClientQuery as b, useAdminQuery as u };
@@ -0,0 +1,32 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import { useState, useEffect } from 'react';
3
+
4
+ const useDebounced = function(value, t0) {
5
+ const $ = c(4);
6
+ const delayMs = t0 === void 0 ? 300 : t0;
7
+ const [debounced, setDebounced] = useState(value);
8
+ let t1;
9
+ let t2;
10
+ if ($[0] !== delayMs || $[1] !== value) {
11
+ t1 = () => {
12
+ const id = setTimeout(() => {
13
+ setDebounced(value);
14
+ }, delayMs);
15
+ return () => {
16
+ clearTimeout(id);
17
+ };
18
+ };
19
+ t2 = [value, delayMs];
20
+ $[0] = delayMs;
21
+ $[1] = value;
22
+ $[2] = t1;
23
+ $[3] = t2;
24
+ } else {
25
+ t1 = $[2];
26
+ t2 = $[3];
27
+ }
28
+ useEffect(t1, t2);
29
+ return debounced;
30
+ };
31
+
32
+ export { useDebounced as default };
@@ -0,0 +1,8 @@
1
+ import { clsx } from 'clsx';
2
+ import { twMerge } from 'tailwind-merge';
3
+
4
+ function cn(...inputs) {
5
+ return twMerge(clsx(inputs));
6
+ }
7
+
8
+ export { cn as c };
@@ -0,0 +1,10 @@
1
+ import { observeElementRect } from '@tanstack/react-virtual';
2
+
3
+ const flooredRectObserver = (instance, callback, fallbackHeight) => observeElementRect(instance, (rect) => {
4
+ callback(rect.height > 0 ? rect : {
5
+ height: fallbackHeight,
6
+ width: rect.width
7
+ });
8
+ });
9
+
10
+ export { flooredRectObserver as f };