@lunora/studio 0.0.0 → 1.0.0-alpha.1

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 (81) 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 +1402 -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_FUNCTION_PREFIX-DmBqMZ-z.js +45 -0
  9. package/dist/packem_shared/ApiDocsPanel-DpRjJhG5.js +842 -0
  10. package/dist/packem_shared/ApiReferencePanel-DMIUp-kK.js +229 -0
  11. package/dist/packem_shared/ApiTab-DURGU15e.js +251 -0
  12. package/dist/packem_shared/AuditPanel-BC59Nhst.js +212 -0
  13. package/dist/packem_shared/CommandPalette-Dx_CoB9i.js +373 -0
  14. package/dist/packem_shared/ConfirmButton-WQVUoGFb.js +59 -0
  15. package/dist/packem_shared/ConnectionBadge-Bxagrip8.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/DataBrowser-Coz6jJE6.js +4542 -0
  19. package/dist/packem_shared/DataFilters-FNquMaiu.js +249 -0
  20. package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +66 -0
  21. package/dist/packem_shared/ExportImportPanel-WO34fJxy.js +193 -0
  22. package/dist/packem_shared/FileBrowser-Zcr-Qgxo.js +2932 -0
  23. package/dist/packem_shared/FunctionRunner-j0Rd5m9t.js +343 -0
  24. package/dist/packem_shared/FunctionStatsPanel-DboBl-XL.js +432 -0
  25. package/dist/packem_shared/GlobalDataBrowser-9MhPEfgN.js +318 -0
  26. package/dist/packem_shared/HealthPanel-DOIgbUtx.js +640 -0
  27. package/dist/packem_shared/HomePanel-bdOCNA-p.js +1273 -0
  28. package/dist/packem_shared/InsightsPanel-DaZPnSgt.js +423 -0
  29. package/dist/packem_shared/LogsPanel-CWdqAGpQ.js +839 -0
  30. package/dist/packem_shared/MailPanel-D_EGtDnS.js +447 -0
  31. package/dist/packem_shared/MetricsPanel-E4Gv6wTO.js +1625 -0
  32. package/dist/packem_shared/MigrationsPanel-DQdPY9io.js +246 -0
  33. package/dist/packem_shared/OpenRpcReferencePanel-j2p3HB0s.js +191 -0
  34. package/dist/packem_shared/PitrPanel-BbBkQR6t.js +252 -0
  35. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +3 -0
  36. package/dist/packem_shared/ScheduledJobs-Ok1CYYwI.js +159 -0
  37. package/dist/packem_shared/SchemaViewer-D8XGnp-X.js +2512 -0
  38. package/dist/packem_shared/SecurityAdvisorPanel-Cdm2IxLW.js +79 -0
  39. package/dist/packem_shared/SettingsPanel-D3WF2mBU.js +176 -0
  40. package/dist/packem_shared/ShardInput-DNCsT1KW.js +107 -0
  41. package/dist/packem_shared/SqlEditorPanel-BuQ7f2Hs.js +13 -0
  42. package/dist/packem_shared/Studio-D36od9Oz.js +33 -0
  43. package/dist/packem_shared/StudioApp-dvywkJ8I.js +383 -0
  44. package/dist/packem_shared/StudioI18nProvider-Dcajsznk.js +48 -0
  45. package/dist/packem_shared/TableEditor-DIVDk3vT.js +371 -0
  46. package/dist/packem_shared/advisor-view-DBlzJi6C.js +159 -0
  47. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +108 -0
  48. package/dist/packem_shared/app.d-CCmwDEVs.d.ts +300 -0
  49. package/dist/packem_shared/badge-B2PKA1-5.js +49 -0
  50. package/dist/packem_shared/bar-chart-CzJAgqkp.js +3245 -0
  51. package/dist/packem_shared/button-BhsN2uZH.js +49 -0
  52. package/dist/packem_shared/card-DURq3ElK.js +175 -0
  53. package/dist/packem_shared/cf-links-BZfRdxSE.js +8 -0
  54. package/dist/packem_shared/checkbox-UNkzAxl-.js +63 -0
  55. package/dist/packem_shared/createStudioI18n-CgvlmDkN.js +27 -0
  56. package/dist/packem_shared/data-grid-CCh2Couo.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-DTjG6Sex.js +840 -0
  60. package/dist/packem_shared/input-XH4r1Pt1.js +53 -0
  61. package/dist/packem_shared/internal-BBZYexre.js +68 -0
  62. package/dist/packem_shared/label-D8ykjn5J.js +46 -0
  63. package/dist/packem_shared/live-status-bPff1O7Y.js +44 -0
  64. package/dist/packem_shared/reference-view-BCKIoai7.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-CW2y2x9h.js +2562 -0
  68. package/dist/packem_shared/storage-tier-CL98eOvn.js +85 -0
  69. package/dist/packem_shared/studio-BDVd7rIV.js +10303 -0
  70. package/dist/packem_shared/table-_RzNvy3R.js +246 -0
  71. package/dist/packem_shared/table-list-sidebar-aZHLq70w.js +832 -0
  72. package/dist/packem_shared/textarea-D3gaCU_-.js +46 -0
  73. package/dist/packem_shared/use-live-admin-D1h1Fzsd.js +73 -0
  74. package/dist/packem_shared/use-live-shard-seed-B74RYcOy.js +76 -0
  75. package/dist/packem_shared/useDebounced-Dxncpg6z.js +32 -0
  76. package/dist/packem_shared/utils-B05Dmz_H.js +8 -0
  77. package/dist/packem_shared/virtual-rect-CVMUskSm.js +10 -0
  78. package/dist/standalone/studio.js +356 -0
  79. package/dist/styles.css +2 -0
  80. package/package.json +77 -17
  81. 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,73 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import { useLunora } from '@lunora/react';
3
+ import { useRef, useEffect } from 'react';
4
+ import { a as adminRef, c as callOptions } from './internal-BBZYexre.js';
5
+
6
+ const useLiveAdmin = (functionPath, args, shardKey, onValue, t0, onError) => {
7
+ const $ = c(17);
8
+ const enabled = t0 === void 0 ? true : t0;
9
+ const client = useLunora();
10
+ const callbackRef = useRef(onValue);
11
+ const errorRef = useRef(onError);
12
+ const argsRef = useRef(args);
13
+ let t1;
14
+ if ($[0] !== args || $[1] !== onError || $[2] !== onValue) {
15
+ t1 = () => {
16
+ callbackRef.current = onValue;
17
+ errorRef.current = onError;
18
+ argsRef.current = args;
19
+ };
20
+ $[0] = args;
21
+ $[1] = onError;
22
+ $[2] = onValue;
23
+ $[3] = t1;
24
+ } else {
25
+ t1 = $[3];
26
+ }
27
+ useEffect(t1);
28
+ let t2;
29
+ if ($[4] !== args) {
30
+ t2 = JSON.stringify(args);
31
+ $[4] = args;
32
+ $[5] = t2;
33
+ } else {
34
+ t2 = $[5];
35
+ }
36
+ const argsKey = t2;
37
+ let t3;
38
+ if ($[6] !== client || $[7] !== enabled || $[8] !== functionPath || $[9] !== shardKey) {
39
+ t3 = () => {
40
+ if (!enabled) {
41
+ return;
42
+ }
43
+ return client.subscribe(adminRef(functionPath), argsRef.current, (value) => {
44
+ callbackRef.current(value);
45
+ }, {
46
+ ...callOptions(shardKey),
47
+ onError: (error) => errorRef.current?.(error.message)
48
+ });
49
+ };
50
+ $[6] = client;
51
+ $[7] = enabled;
52
+ $[8] = functionPath;
53
+ $[9] = shardKey;
54
+ $[10] = t3;
55
+ } else {
56
+ t3 = $[10];
57
+ }
58
+ let t4;
59
+ if ($[11] !== argsKey || $[12] !== client || $[13] !== enabled || $[14] !== functionPath || $[15] !== shardKey) {
60
+ t4 = [client, functionPath, argsKey, shardKey, enabled];
61
+ $[11] = argsKey;
62
+ $[12] = client;
63
+ $[13] = enabled;
64
+ $[14] = functionPath;
65
+ $[15] = shardKey;
66
+ $[16] = t4;
67
+ } else {
68
+ t4 = $[16];
69
+ }
70
+ useEffect(t3, t4);
71
+ };
72
+
73
+ export { useLiveAdmin as u };
@@ -0,0 +1,76 @@
1
+ import { c } from 'react/compiler-runtime';
2
+ import { useState, useRef, useEffect } from 'react';
3
+ import useDebounced from './useDebounced-Dxncpg6z.js';
4
+ import { f as fireAndForget } from './internal-BBZYexre.js';
5
+
6
+ const useLiveShardSeed = (shardKey, seed, t0) => {
7
+ const $ = c(11);
8
+ let t1;
9
+ if ($[0] !== t0) {
10
+ t1 = t0 === void 0 ? [] : t0;
11
+ $[0] = t0;
12
+ $[1] = t1;
13
+ } else {
14
+ t1 = $[1];
15
+ }
16
+ const extraDeps = t1;
17
+ const [committedShard, setCommittedShard] = useState(void 0);
18
+ let t2;
19
+ if ($[2] !== shardKey) {
20
+ t2 = shardKey.trim();
21
+ $[2] = shardKey;
22
+ $[3] = t2;
23
+ } else {
24
+ t2 = $[3];
25
+ }
26
+ const debouncedShard = useDebounced(t2, 400);
27
+ const seedRef = useRef(seed);
28
+ let t3;
29
+ if ($[4] !== seed) {
30
+ t3 = () => {
31
+ seedRef.current = seed;
32
+ };
33
+ $[4] = seed;
34
+ $[5] = t3;
35
+ } else {
36
+ t3 = $[5];
37
+ }
38
+ useEffect(t3);
39
+ let t4;
40
+ if ($[6] !== debouncedShard) {
41
+ t4 = () => {
42
+ const live = {
43
+ current: true
44
+ };
45
+ fireAndForget((async () => {
46
+ try {
47
+ await seedRef.current(debouncedShard);
48
+ if (live.current) {
49
+ setCommittedShard(debouncedShard);
50
+ }
51
+ } catch {
52
+ }
53
+ })());
54
+ return () => {
55
+ live.current = false;
56
+ };
57
+ };
58
+ $[6] = debouncedShard;
59
+ $[7] = t4;
60
+ } else {
61
+ t4 = $[7];
62
+ }
63
+ let t5;
64
+ if ($[8] !== debouncedShard || $[9] !== extraDeps) {
65
+ t5 = [debouncedShard, ...extraDeps];
66
+ $[8] = debouncedShard;
67
+ $[9] = extraDeps;
68
+ $[10] = t5;
69
+ } else {
70
+ t5 = $[10];
71
+ }
72
+ useEffect(t4, t5);
73
+ return committedShard;
74
+ };
75
+
76
+ export { useLiveShardSeed 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 };