@lunora/studio 1.0.0-alpha.8 → 1.0.0-alpha.80
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.
- package/LICENSE.md +6 -0
- package/dist/index.d.ts +777 -780
- package/dist/index.js +1 -41
- package/dist/mount.d.ts +10 -10
- package/dist/mount.js +1 -26
- package/dist/packem_chunks/ApiTab.js +1 -0
- package/dist/packem_chunks/AuditPanel.js +1 -0
- package/dist/packem_chunks/DeploymentHealthPanel.js +1 -0
- package/dist/packem_chunks/ExportImportPanel.js +3 -0
- package/dist/packem_chunks/FileBrowser.js +4 -0
- package/dist/packem_chunks/FunctionRunner.js +1 -0
- package/dist/packem_chunks/FunctionStatsPanel.js +1 -0
- package/dist/packem_chunks/HealthPanel.js +1 -0
- package/dist/packem_chunks/InsightsPanel.js +1 -0
- package/dist/packem_chunks/LogsPanel.js +1 -0
- package/dist/packem_chunks/MailPanel.js +2 -0
- package/dist/packem_chunks/MetricsPanel.js +1 -0
- package/dist/packem_chunks/NotificationsPanel.js +1 -0
- package/dist/packem_chunks/PitrPanel.js +1 -0
- package/dist/packem_chunks/SchemaViewer.js +1 -0
- package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -0
- package/dist/packem_chunks/SettingsPanel.js +1 -0
- package/dist/packem_chunks/SqlEditorPanel.js +6 -0
- package/dist/packem_chunks/TableEditor.js +1 -0
- package/dist/packem_chunks/agents-panel.js +1 -0
- package/dist/packem_chunks/analytics-panel.js +1 -0
- package/dist/packem_chunks/auth-audit-panel.js +1 -0
- package/dist/packem_chunks/auth-config-panel.js +1 -0
- package/dist/packem_chunks/auth-sessions-panel.js +1 -0
- package/dist/packem_chunks/containers-panel.js +1 -0
- package/dist/packem_chunks/dashboards-panel.js +1 -0
- package/dist/packem_chunks/fanout-panel.js +1 -0
- package/dist/packem_chunks/flags-panel.js +1 -0
- package/dist/packem_chunks/issues-panel.js +1 -0
- package/dist/packem_chunks/kv-browser.js +1 -0
- package/dist/packem_chunks/log-drains-panel.js +4 -0
- package/dist/packem_chunks/migrations-route.js +1 -0
- package/dist/packem_chunks/organizations-panel.js +1 -0
- package/dist/packem_chunks/payments-panel.js +1 -0
- package/dist/packem_chunks/permissions-panel.js +1 -0
- package/dist/packem_chunks/queues-panel.js +1 -0
- package/dist/packem_chunks/rls-panel.js +1 -0
- package/dist/packem_chunks/schedule-panel.js +1 -0
- package/dist/packem_chunks/sparkline.js +1 -0
- package/dist/packem_chunks/storage-rules-panel.js +1 -0
- package/dist/packem_chunks/subscriptions-panel.js +1 -0
- package/dist/packem_chunks/sync-client-panel.js +1 -0
- package/dist/packem_chunks/traces-panel.js +1 -0
- package/dist/packem_chunks/users-panel.js +1 -0
- package/dist/packem_chunks/vector-browser.js +1 -0
- package/dist/packem_chunks/workflows-panel.js +1 -0
- package/dist/packem_shared/ADMIN_FUNCTIONS-BnD4aovm.js +1 -0
- package/dist/packem_shared/ApiDocsPanel-DfUQ1ZAF.js +2 -0
- package/dist/packem_shared/ApiReferencePanel-9q8BbJl-.js +1 -0
- package/dist/packem_shared/CommandPalette--SQwfTW1.js +1 -0
- package/dist/packem_shared/ConfirmButton-CTL3f3kr.js +1 -0
- package/dist/packem_shared/ConnectionBadge-DOk0CQWo.js +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-BCC8_4BQ.js +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-B-hcFVoi.js +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-BZ4NojpD.js +1 -0
- package/dist/packem_shared/DataBrowser-CuRlztBz.js +1 -0
- package/dist/packem_shared/DataFilters-B26ZeqBZ.js +1 -0
- package/dist/packem_shared/ErrorBoundary-DvzYskH7.js +1 -0
- package/dist/packem_shared/GlobalDataBrowser-DB-vQ2_H.js +1 -0
- package/dist/packem_shared/HomePanel-Dcs4a3Ax.js +1 -0
- package/dist/packem_shared/MigrationsPanel-C2OnsqRb.js +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-qOZcWXMs.js +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
- package/dist/packem_shared/ScheduledJobs-D8kBZWBu.js +1 -0
- package/dist/packem_shared/ShardInput-BVn2iCU0.js +1 -0
- package/dist/packem_shared/Studio-B26_pT8J.js +1 -0
- package/dist/packem_shared/StudioApp-bXhJeLlZ.js +1 -0
- package/dist/packem_shared/StudioI18nProvider-CZ5h4nrV.js +1 -0
- package/dist/packem_shared/advisor-view-Pa8HLtBv.js +1 -0
- package/dist/packem_shared/aggregateMetrics-BNfajLa2.js +1 -0
- package/dist/packem_shared/alert-CVcOFuDR.js +1 -0
- package/dist/packem_shared/app.d-DW7yZsfu.d.ts +252 -0
- package/dist/packem_shared/badge-BbuuAio7.js +1 -0
- package/dist/packem_shared/bar-chart-DraN_srt.js +9 -0
- package/dist/packem_shared/browser-storage-xjTyMKY0.js +1 -0
- package/dist/packem_shared/button-BkCrNcAs.js +1 -0
- package/dist/packem_shared/card-CIDGUN6K.js +1 -0
- package/dist/packem_shared/cf-links-gbDy51nR.js +1 -0
- package/dist/packem_shared/checkbox-StT4Gob6.js +1 -0
- package/dist/packem_shared/data-grid-DcxyIXwG.js +1 -0
- package/dist/packem_shared/data-view-params-ClrV7XgF.js +1 -0
- package/dist/packem_shared/dropdown-menu-C3RQ_HlW.js +2 -0
- package/dist/packem_shared/empty-state-Cg7t_8qu.js +1 -0
- package/dist/packem_shared/error-alert-t6cpEi0z.js +1 -0
- package/dist/packem_shared/grid-features-jnrD0SpX.js +6 -0
- package/dist/packem_shared/home-panel-CU6MWLHG.js +3 -0
- package/dist/packem_shared/input-JHu63lTv.js +1 -0
- package/dist/packem_shared/internal-BSIsQVC6.js +2 -0
- package/dist/packem_shared/label-6uP1obNF.js +1 -0
- package/dist/packem_shared/live-status-CmuRLFKf.js +1 -0
- package/dist/packem_shared/log-fields-CoL3hsIQ.js +1 -0
- package/dist/packem_shared/modal-shell-CUwwWC2o.js +1 -0
- package/dist/packem_shared/operation-console-provider-BMJNtiyB.js +1 -0
- package/dist/packem_shared/recording-client-DRAZEmzE.js +1 -0
- package/dist/packem_shared/reference-view-DnYYWr7I.js +12 -0
- package/dist/packem_shared/result-chart-DzJOVsaw.js +1 -0
- package/dist/packem_shared/schema-diagram-cg-bz_VL.js +2 -0
- package/dist/packem_shared/scroll-area-DTEq6Jec.js +2 -0
- package/dist/packem_shared/select-Bul-DeII.js +2 -0
- package/dist/packem_shared/shard-history-DMEW5VBE.js +1 -0
- package/dist/packem_shared/skeleton-C1wQ9M5t.js +1 -0
- package/dist/packem_shared/sparkline-CgjeUU2I.js +1 -0
- package/dist/packem_shared/storage-tier-DznqOf-q.js +1 -0
- package/dist/packem_shared/studio-q-C-acL7.js +2 -0
- package/dist/packem_shared/table-DdJBrClo.js +2 -0
- package/dist/packem_shared/table-list-sidebar-BFkSQwlB.js +1 -0
- package/dist/packem_shared/textarea-Bu2-jKAs.js +1 -0
- package/dist/packem_shared/trace-handoff-Dw7mwjxu.js +1 -0
- package/dist/packem_shared/use-admin-query-QJ-ibl5u.js +1 -0
- package/dist/packem_shared/use-async-submit-q3ymBJkD.js +1 -0
- package/dist/packem_shared/use-auth-config-BObBpdsi.js +1 -0
- package/dist/packem_shared/use-sql-assistant-CHEu2-Rk.js +1 -0
- package/dist/packem_shared/useDebounced-Ihdiid_k.js +1 -0
- package/dist/packem_shared/utils-bhneXptQ.js +1 -0
- package/dist/packem_shared/virtual-rect-1o1veP7R.js +1 -0
- package/dist/standalone/chunk-2GA4SHO7.js +1 -0
- package/dist/standalone/chunk-2OUPA2WJ.js +1 -0
- package/dist/standalone/chunk-2PJNAWB3.js +1 -0
- package/dist/standalone/chunk-2VDFV5TD.js +1 -0
- package/dist/standalone/chunk-2WOIRKEI.js +1 -0
- package/dist/standalone/chunk-33CL6OHR.js +1 -0
- package/dist/standalone/chunk-34D36UCW.js +1 -0
- package/dist/standalone/chunk-3C3CG7ZK.js +1 -0
- package/dist/standalone/chunk-3O3HAXW7.js +1 -0
- package/dist/standalone/chunk-3STOIE7Q.js +1 -0
- package/dist/standalone/chunk-3XIESWL4.js +1 -0
- package/dist/standalone/chunk-4UOFSGUS.js +1 -0
- package/dist/standalone/chunk-53WEPGUD.js +1 -0
- package/dist/standalone/chunk-54MMVNPT.js +1 -0
- package/dist/standalone/chunk-5CVJS7ON.js +1 -0
- package/dist/standalone/chunk-5Y3QLNWX.js +1 -0
- package/dist/standalone/chunk-6IKEW5LG.js +1 -0
- package/dist/standalone/chunk-6LNCYDZO.js +1 -0
- package/dist/standalone/chunk-6NY7SPDL.js +1 -0
- package/dist/standalone/chunk-6PNPIW6I.js +2 -0
- package/dist/standalone/chunk-6ST5ECQA.js +1 -0
- package/dist/standalone/chunk-6VAKZALJ.js +1 -0
- package/dist/standalone/chunk-6YI4WJO4.js +1 -0
- package/dist/standalone/chunk-6YTSSIEJ.js +3 -0
- package/dist/standalone/chunk-7LWMHTJ3.js +1 -0
- package/dist/standalone/chunk-7QIFDWQV.js +1 -0
- package/dist/standalone/chunk-7T7UOTYK.js +1 -0
- package/dist/standalone/chunk-A74VSSA2.js +4 -0
- package/dist/standalone/chunk-AADILRJW.js +14 -0
- package/dist/standalone/chunk-AVAC26HJ.js +1 -0
- package/dist/standalone/chunk-BGBLQ563.js +1 -0
- package/dist/standalone/chunk-CCVXYYPJ.js +1 -0
- package/dist/standalone/chunk-CFPZYHPY.js +2 -0
- package/dist/standalone/chunk-CT5MMH4O.js +1 -0
- package/dist/standalone/chunk-CTNB2KIA.js +1 -0
- package/dist/standalone/chunk-CU55Y5TV.js +62 -0
- package/dist/standalone/chunk-D2RKH6JK.js +1 -0
- package/dist/standalone/chunk-E3NMX2VU.js +4 -0
- package/dist/standalone/chunk-EN2QAEO4.js +11 -0
- package/dist/standalone/chunk-ESVP44Y3.js +1 -0
- package/dist/standalone/chunk-FNPJ7GJZ.js +1 -0
- package/dist/standalone/chunk-FOBRNWBG.js +3 -0
- package/dist/standalone/chunk-FXCBF4XT.js +1 -0
- package/dist/standalone/chunk-G6PSMGLD.js +1 -0
- package/dist/standalone/chunk-GAX5IZYG.js +8 -0
- package/dist/standalone/chunk-GB6U2BPU.js +1 -0
- package/dist/standalone/chunk-GEDMLM4A.js +6 -0
- package/dist/standalone/chunk-GMR677FL.js +1 -0
- package/dist/standalone/chunk-GRL5MG3Z.js +1 -0
- package/dist/standalone/chunk-GXSZH7VJ.js +13 -0
- package/dist/standalone/chunk-GYKVBKT5.js +1 -0
- package/dist/standalone/chunk-H6YOWRFB.js +1 -0
- package/dist/standalone/chunk-HJ3E4YF5.js +1 -0
- package/dist/standalone/chunk-HJD2YUQS.js +1 -0
- package/dist/standalone/chunk-HPFLBYRI.js +1 -0
- package/dist/standalone/chunk-IC4L6G56.js +1 -0
- package/dist/standalone/chunk-IHQC7J35.js +1 -0
- package/dist/standalone/chunk-ILNELDFC.js +1 -0
- package/dist/standalone/chunk-IVFHIQOT.js +1 -0
- package/dist/standalone/chunk-JLOWAJRR.js +1 -0
- package/dist/standalone/chunk-JN2Y24PY.js +1 -0
- package/dist/standalone/chunk-JRMMYIAF.js +1 -0
- package/dist/standalone/chunk-KC44QCN6.js +1 -0
- package/dist/standalone/chunk-KJB7YAKB.js +1 -0
- package/dist/standalone/chunk-KLQYC6CC.js +1 -0
- package/dist/standalone/chunk-KUVMORDQ.js +1 -0
- package/dist/standalone/chunk-KZ3ALMMP.js +1 -0
- package/dist/standalone/chunk-L7R74G63.js +1 -0
- package/dist/standalone/chunk-LEDWUPXM.js +1 -0
- package/dist/standalone/chunk-LFKCLLPT.js +1 -0
- package/dist/standalone/chunk-MIQTKZAR.js +1 -0
- package/dist/standalone/chunk-OG4N2XHD.js +19 -0
- package/dist/standalone/chunk-OY2RVUZL.js +1 -0
- package/dist/standalone/chunk-P4YLIBCN.js +1 -0
- package/dist/standalone/chunk-PZVU2QMX.js +1 -0
- package/dist/standalone/chunk-Q7O6B7WC.js +1 -0
- package/dist/standalone/chunk-QBWRC5YX.js +1 -0
- package/dist/standalone/chunk-QLQADHFE.js +1 -0
- package/dist/standalone/chunk-QWGT25SE.js +1 -0
- package/dist/standalone/chunk-QXXIJAD5.js +1 -0
- package/dist/standalone/chunk-QZGTH6WH.js +1 -0
- package/dist/standalone/chunk-RJP3WBZ4.js +1 -0
- package/dist/standalone/chunk-RNL6BSFM.js +1 -0
- package/dist/standalone/chunk-RNRJKBY3.js +4 -0
- package/dist/standalone/chunk-RQ7AFLIV.js +1 -0
- package/dist/standalone/chunk-S252DAFP.js +1 -0
- package/dist/standalone/chunk-S2VVR7HI.js +1 -0
- package/dist/standalone/chunk-SD4BERSA.js +1 -0
- package/dist/standalone/chunk-SFDOII3B.js +1 -0
- package/dist/standalone/chunk-SKHEGARW.js +1 -0
- package/dist/standalone/chunk-SKW6J4VW.js +1 -0
- package/dist/standalone/chunk-SMIESS7P.js +1 -0
- package/dist/standalone/chunk-T6VMSOBB.js +1 -0
- package/dist/standalone/chunk-T7IUZIF4.js +1 -0
- package/dist/standalone/chunk-THIXMMZD.js +1 -0
- package/dist/standalone/chunk-TTGOOYLF.js +1 -0
- package/dist/standalone/chunk-U6TNNM5U.js +1 -0
- package/dist/standalone/chunk-UZERI5YC.js +1 -0
- package/dist/standalone/chunk-V53KNYRN.js +1 -0
- package/dist/standalone/chunk-VHWOCPRK.js +1 -0
- package/dist/standalone/chunk-W6SAOXGH.js +6 -0
- package/dist/standalone/chunk-WBYSSCV2.js +1 -0
- package/dist/standalone/chunk-X665E2HU.js +1 -0
- package/dist/standalone/chunk-XBDKZZ67.js +1 -0
- package/dist/standalone/chunk-XDAT7LHC.js +1 -0
- package/dist/standalone/chunk-XQCVZAGU.js +1 -0
- package/dist/standalone/chunk-XS5LDR52.js +1 -0
- package/dist/standalone/chunk-XXQUMVWH.js +1 -0
- package/dist/standalone/chunk-Y5Y7DHFW.js +1 -0
- package/dist/standalone/chunk-YJYTMQJI.js +1 -0
- package/dist/standalone/chunk-Z2V42P7J.js +1 -0
- package/dist/standalone/chunk-ZJGP6EKR.js +1 -0
- package/dist/standalone/studio.js +9 -356
- package/dist/styles.css +2 -2
- package/package.json +16 -14
- package/dist/packem_shared/ADMIN_FUNCTIONS-DjXgvJb6.js +0 -46
- package/dist/packem_shared/ApiDocsPanel-yVSGHK3H.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
- package/dist/packem_shared/ApiTab-rwttyQ1-.js +0 -251
- package/dist/packem_shared/AuditPanel-BqXZAsu_.js +0 -212
- package/dist/packem_shared/CommandPalette-BtgkBzZI.js +0 -373
- package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
- package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
- package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
- package/dist/packem_shared/DataBrowser-Ck_7QwNK.js +0 -4542
- package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
- package/dist/packem_shared/ExportImportPanel-Dq6rj0tI.js +0 -193
- package/dist/packem_shared/FileBrowser-0pCpdKPE.js +0 -2932
- package/dist/packem_shared/FunctionRunner-7NH3KcTg.js +0 -343
- package/dist/packem_shared/FunctionStatsPanel-Cn_EBpDy.js +0 -432
- package/dist/packem_shared/GlobalDataBrowser-BTEmGrph.js +0 -318
- package/dist/packem_shared/HealthPanel-CQ4LzVET.js +0 -640
- package/dist/packem_shared/HomePanel-CP0lN1eF.js +0 -1273
- package/dist/packem_shared/InsightsPanel-DzNtoz7k.js +0 -423
- package/dist/packem_shared/LogsPanel-C3W0mabf.js +0 -839
- package/dist/packem_shared/MailPanel-CoEfWkCh.js +0 -447
- package/dist/packem_shared/MetricsPanel-CujtUfpl.js +0 -1625
- package/dist/packem_shared/MigrationsPanel-RX5qIFSr.js +0 -246
- package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
- package/dist/packem_shared/PitrPanel-LJGNP_IX.js +0 -252
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
- package/dist/packem_shared/ScheduledJobs-CabfKbyM.js +0 -159
- package/dist/packem_shared/SchemaViewer-Bam6ylvw.js +0 -2512
- package/dist/packem_shared/SecurityAdvisorPanel-DHr_bI38.js +0 -79
- package/dist/packem_shared/SettingsPanel-CBXQpYQA.js +0 -176
- package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
- package/dist/packem_shared/SqlEditorPanel-D5wMIxcg.js +0 -13
- package/dist/packem_shared/Studio-DkgODWD3.js +0 -33
- package/dist/packem_shared/StudioApp-ColQCvC_.js +0 -657
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/TableEditor-B8K5nUna.js +0 -371
- package/dist/packem_shared/advisor-view-CGcfMiPq.js +0 -159
- package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
- package/dist/packem_shared/app.d-Nbhpihxv.d.ts +0 -300
- package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
- package/dist/packem_shared/bar-chart-CzJAgqkp.js +0 -3245
- package/dist/packem_shared/button-BhsN2uZH.js +0 -49
- package/dist/packem_shared/card-DURq3ElK.js +0 -175
- package/dist/packem_shared/cf-links-2cktDedA.js +0 -8
- package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
- package/dist/packem_shared/data-grid-B5CaV3wS.js +0 -183
- package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
- package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
- package/dist/packem_shared/grid-features-CzUfqgsM.js +0 -840
- package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
- package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
- package/dist/packem_shared/label-D8ykjn5J.js +0 -46
- package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
- package/dist/packem_shared/reference-view-B4E49Lip.js +0 -2180
- package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
- package/dist/packem_shared/sparkline-10dG-_f0.js +0 -93
- package/dist/packem_shared/sql-editor-panel-Smfl_FDF.js +0 -2562
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-Be28OqIx.js +0 -10413
- package/dist/packem_shared/table-_RzNvy3R.js +0 -246
- package/dist/packem_shared/table-list-sidebar-Bg7uzbvC.js +0 -832
- package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
- package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
- package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
- package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
- package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
- package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
import { useLunora } from '@lunora/react';
|
|
2
|
-
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
3
|
-
import { E as EmptyState } from './empty-state-DY_oe0k6.js';
|
|
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 { useAutoRefresh } from './DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js';
|
|
6
|
-
import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
|
|
7
|
-
import { b as CLOUDFLARE_D1_URL } from './cf-links-2cktDedA.js';
|
|
8
|
-
import { e as errorMessage, f as fireAndForget } from './internal-rXJEAhXS.js';
|
|
9
|
-
import { u as useFacets, T as TableListSidebar, G as GridPagination, D as DataFacets } from './table-list-sidebar-Bg7uzbvC.js';
|
|
10
|
-
import { G as GridContainer, C as CellValue } from './data-grid-B5CaV3wS.js';
|
|
11
|
-
import { jsxDEV } from 'react/jsx-dev-runtime';
|
|
12
|
-
|
|
13
|
-
const DEFAULT_PAGE_SIZE = 50;
|
|
14
|
-
const NO_TABLES = [];
|
|
15
|
-
const NO_COLUMNS = [];
|
|
16
|
-
const rowKey = (row, index) => {
|
|
17
|
-
const id = row["_id"];
|
|
18
|
-
return typeof id === "string" || typeof id === "number" ? String(id) : `row-${index.toString()}`;
|
|
19
|
-
};
|
|
20
|
-
const chipValue = (value) => {
|
|
21
|
-
if (value === null || value === void 0) {
|
|
22
|
-
return "∅";
|
|
23
|
-
}
|
|
24
|
-
if (value === "") {
|
|
25
|
-
return "(empty)";
|
|
26
|
-
}
|
|
27
|
-
if (typeof value === "object") {
|
|
28
|
-
return JSON.stringify(value);
|
|
29
|
-
}
|
|
30
|
-
return String(value);
|
|
31
|
-
};
|
|
32
|
-
const GlobalDataBrowser = ({
|
|
33
|
-
initialTable,
|
|
34
|
-
onSelectTable,
|
|
35
|
-
pageSize: initialPageSize = DEFAULT_PAGE_SIZE,
|
|
36
|
-
schemaSwitch
|
|
37
|
-
} = {}) => {
|
|
38
|
-
const client = useLunora();
|
|
39
|
-
const t = useT();
|
|
40
|
-
const [tables, setTables] = useState(null);
|
|
41
|
-
const [tablesError, setTablesError] = useState(null);
|
|
42
|
-
const [selectedTable, setSelectedTable] = useState(initialTable ?? null);
|
|
43
|
-
const [offset, setOffset] = useState(0);
|
|
44
|
-
const [pageSize, setPageSize] = useState(initialPageSize);
|
|
45
|
-
const [page, setPage] = useState(null);
|
|
46
|
-
const [pageError, setPageError] = useState(null);
|
|
47
|
-
const [filters, setFilters] = useState([]);
|
|
48
|
-
const filtersRef = useRef(filters);
|
|
49
|
-
filtersRef.current = filters;
|
|
50
|
-
const {
|
|
51
|
-
clearFacets,
|
|
52
|
-
facets,
|
|
53
|
-
refetchFacets: refetchFacetsViaHook,
|
|
54
|
-
toggleFacet
|
|
55
|
-
} = useFacets();
|
|
56
|
-
const fetchTables = useCallback(async () => {
|
|
57
|
-
setTablesError(null);
|
|
58
|
-
try {
|
|
59
|
-
setTables(await client.listGlobalTables());
|
|
60
|
-
} catch (error) {
|
|
61
|
-
setTables(null);
|
|
62
|
-
setTablesError(errorMessage(error));
|
|
63
|
-
}
|
|
64
|
-
}, [client]);
|
|
65
|
-
const fetchSeqRef = useRef(0);
|
|
66
|
-
const fetchPage = useCallback(async (table, nextOffset, limit = pageSize, activeFilters = filtersRef.current) => {
|
|
67
|
-
fetchSeqRef.current += 1;
|
|
68
|
-
const seq = fetchSeqRef.current;
|
|
69
|
-
setPageError(null);
|
|
70
|
-
try {
|
|
71
|
-
const result = await client.readGlobalTablePage({
|
|
72
|
-
filters: activeFilters,
|
|
73
|
-
limit,
|
|
74
|
-
offset: nextOffset,
|
|
75
|
-
table
|
|
76
|
-
});
|
|
77
|
-
if (fetchSeqRef.current !== seq) {
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
setPage(result);
|
|
81
|
-
setOffset(nextOffset);
|
|
82
|
-
} catch (error_0) {
|
|
83
|
-
if (fetchSeqRef.current !== seq) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
setPage(null);
|
|
87
|
-
setPageError(errorMessage(error_0));
|
|
88
|
-
}
|
|
89
|
-
}, [client, pageSize]);
|
|
90
|
-
const facetFetcher = (table_0, activeFilters_0) => (column) => client.facetGlobalColumn({
|
|
91
|
-
column,
|
|
92
|
-
filters: activeFilters_0,
|
|
93
|
-
table: table_0
|
|
94
|
-
});
|
|
95
|
-
const refetchFacets = (table_1, activeFilters_1) => {
|
|
96
|
-
refetchFacetsViaHook(facetFetcher(table_1, activeFilters_1));
|
|
97
|
-
};
|
|
98
|
-
useEffect(() => {
|
|
99
|
-
fireAndForget(fetchTables());
|
|
100
|
-
}, [fetchTables]);
|
|
101
|
-
useAutoRefresh(() => {
|
|
102
|
-
fireAndForget(fetchTables());
|
|
103
|
-
if (selectedTable !== null) {
|
|
104
|
-
fireAndForget(fetchPage(selectedTable, offset));
|
|
105
|
-
refetchFacets(selectedTable, filtersRef.current);
|
|
106
|
-
}
|
|
107
|
-
}, true);
|
|
108
|
-
const appliedInitialTable = useRef(void 0);
|
|
109
|
-
const selectTable = useCallback((table_2) => {
|
|
110
|
-
setSelectedTable(table_2);
|
|
111
|
-
appliedInitialTable.current = table_2;
|
|
112
|
-
setFilters([]);
|
|
113
|
-
filtersRef.current = [];
|
|
114
|
-
clearFacets();
|
|
115
|
-
fireAndForget(fetchPage(table_2, 0, pageSize, []));
|
|
116
|
-
onSelectTable?.(table_2);
|
|
117
|
-
}, [clearFacets, fetchPage, onSelectTable, pageSize]);
|
|
118
|
-
const onToggleFacet = (column_0) => {
|
|
119
|
-
toggleFacet(column_0, selectedTable === null ? null : facetFetcher(selectedTable, filtersRef.current));
|
|
120
|
-
};
|
|
121
|
-
const applyFilters = (next) => {
|
|
122
|
-
setFilters(next);
|
|
123
|
-
filtersRef.current = next;
|
|
124
|
-
if (selectedTable !== null) {
|
|
125
|
-
fireAndForget(fetchPage(selectedTable, 0, pageSize, next));
|
|
126
|
-
refetchFacets(selectedTable, next);
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
const onFacetFilter = (column_1, value) => {
|
|
130
|
-
applyFilters([...filtersRef.current.filter((clause) => clause.column !== column_1), {
|
|
131
|
-
column: column_1,
|
|
132
|
-
value
|
|
133
|
-
}]);
|
|
134
|
-
};
|
|
135
|
-
const removeFilter = (event) => {
|
|
136
|
-
const index = Number(event.currentTarget.dataset["index"]);
|
|
137
|
-
applyFilters(filtersRef.current.filter((_, position) => position !== index));
|
|
138
|
-
};
|
|
139
|
-
useEffect(() => {
|
|
140
|
-
if (initialTable === void 0 || initialTable === "" || appliedInitialTable.current === initialTable) {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
appliedInitialTable.current = initialTable;
|
|
144
|
-
const target = initialTable;
|
|
145
|
-
queueMicrotask(() => {
|
|
146
|
-
selectTable(target);
|
|
147
|
-
});
|
|
148
|
-
}, [initialTable, selectTable]);
|
|
149
|
-
const goToPage = (nextOffset_0) => {
|
|
150
|
-
if (selectedTable === null) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
fireAndForget(fetchPage(selectedTable, Math.max(0, nextOffset_0)));
|
|
154
|
-
};
|
|
155
|
-
const total = page?.total ?? 0;
|
|
156
|
-
const hasPrevious = offset > 0;
|
|
157
|
-
const hasNext = page !== null && offset + page.rows.length < total;
|
|
158
|
-
const rangeStart = page === null || page.rows.length === 0 ? 0 : offset + 1;
|
|
159
|
-
const rangeEnd = page === null ? 0 : offset + page.rows.length;
|
|
160
|
-
const reloadTables = () => {
|
|
161
|
-
fireAndForget(fetchTables());
|
|
162
|
-
};
|
|
163
|
-
const goPrevious = () => {
|
|
164
|
-
goToPage(offset - pageSize);
|
|
165
|
-
};
|
|
166
|
-
const goNext = () => {
|
|
167
|
-
goToPage(offset + pageSize);
|
|
168
|
-
};
|
|
169
|
-
const jumpToPage = (targetPage) => {
|
|
170
|
-
goToPage(Math.max(0, (targetPage - 1) * pageSize));
|
|
171
|
-
};
|
|
172
|
-
const changePageSize = (size) => {
|
|
173
|
-
setPageSize(size);
|
|
174
|
-
if (selectedTable !== null) {
|
|
175
|
-
fireAndForget(fetchPage(selectedTable, 0, size));
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
179
|
-
className: "flex h-full min-w-0",
|
|
180
|
-
"data-testid": "lunora-global-data-browser",
|
|
181
|
-
children: [/* @__PURE__ */ jsxDEV(TableListSidebar, {
|
|
182
|
-
header: /* @__PURE__ */ jsxDEV("div", {
|
|
183
|
-
className: "flex shrink-0 flex-col items-stretch gap-2 border-b border-border p-3",
|
|
184
|
-
children: [schemaSwitch, /* @__PURE__ */ jsxDEV("a", {
|
|
185
|
-
className: "text-sm text-primary underline-offset-4 hover:underline",
|
|
186
|
-
"data-testid": "gdb-cf-link",
|
|
187
|
-
href: CLOUDFLARE_D1_URL,
|
|
188
|
-
rel: "noreferrer",
|
|
189
|
-
target: "_blank",
|
|
190
|
-
children: t("Open in Cloudflare")
|
|
191
|
-
}, void 0, false)]
|
|
192
|
-
}, void 0, true),
|
|
193
|
-
onReload: reloadTables,
|
|
194
|
-
onSelect: selectTable,
|
|
195
|
-
prefix: "gdb",
|
|
196
|
-
selected: selectedTable,
|
|
197
|
-
tables: tables ?? NO_TABLES
|
|
198
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("div", {
|
|
199
|
-
className: "flex min-w-0 flex-1 flex-col overflow-hidden",
|
|
200
|
-
children: [tablesError !== null && /* @__PURE__ */ jsxDEV("p", {
|
|
201
|
-
className: "shrink-0 border-b border-border px-4 py-2 text-sm text-destructive",
|
|
202
|
-
"data-testid": "gdb-tables-error",
|
|
203
|
-
role: "alert",
|
|
204
|
-
children: tablesError
|
|
205
|
-
}, void 0, false), tables !== null && tables.length === 0 && /* @__PURE__ */ jsxDEV("div", {
|
|
206
|
-
className: "flex flex-1 items-center justify-center p-6",
|
|
207
|
-
children: /* @__PURE__ */ jsxDEV(EmptyState, {
|
|
208
|
-
description: t("Tables marked .global() (D1-backed, region-replicated) will appear here."),
|
|
209
|
-
icon: /* @__PURE__ */ jsxDEV("svg", {
|
|
210
|
-
"aria-hidden": "true",
|
|
211
|
-
fill: "none",
|
|
212
|
-
stroke: "currentColor",
|
|
213
|
-
strokeLinecap: "round",
|
|
214
|
-
strokeLinejoin: "round",
|
|
215
|
-
strokeWidth: 1.6,
|
|
216
|
-
viewBox: "0 0 24 24",
|
|
217
|
-
children: [/* @__PURE__ */ jsxDEV("circle", {
|
|
218
|
-
cx: "12",
|
|
219
|
-
cy: "12",
|
|
220
|
-
r: "9"
|
|
221
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("path", {
|
|
222
|
-
d: "M3 12h18M12 3a14 14 0 0 1 0 18 14 14 0 0 1 0-18Z"
|
|
223
|
-
}, void 0, false)]
|
|
224
|
-
}, void 0, true),
|
|
225
|
-
testId: "gdb-empty",
|
|
226
|
-
title: t("No global tables.")
|
|
227
|
-
}, void 0, false)
|
|
228
|
-
}, void 0, false), pageError !== null && /* @__PURE__ */ jsxDEV("p", {
|
|
229
|
-
className: "shrink-0 border-b border-border px-4 py-2 text-sm text-destructive",
|
|
230
|
-
"data-testid": "gdb-page-error",
|
|
231
|
-
role: "alert",
|
|
232
|
-
children: pageError
|
|
233
|
-
}, void 0, false), tables !== null && tables.length > 0 && page === null && pageError === null && /* @__PURE__ */ jsxDEV("div", {
|
|
234
|
-
className: "flex flex-1 items-center justify-center p-6",
|
|
235
|
-
children: /* @__PURE__ */ jsxDEV("p", {
|
|
236
|
-
className: "text-sm text-muted-foreground",
|
|
237
|
-
children: t("Select a table to browse its rows.")
|
|
238
|
-
}, void 0, false)
|
|
239
|
-
}, void 0, false), page !== null && /* @__PURE__ */ jsxDEV("div", {
|
|
240
|
-
className: "flex min-h-0 flex-1 flex-col",
|
|
241
|
-
"data-testid": "gdb-page",
|
|
242
|
-
children: [filters.length > 0 && /* @__PURE__ */ jsxDEV("div", {
|
|
243
|
-
className: "flex shrink-0 flex-wrap items-center gap-1.5 border-b border-border px-4 py-2 text-xs",
|
|
244
|
-
"data-testid": "gdb-filters",
|
|
245
|
-
children: filters.map((filter, index_0) => /* @__PURE__ */ jsxDEV("span", {
|
|
246
|
-
className: "inline-flex items-center gap-1 rounded border border-border bg-muted px-1.5 py-0.5",
|
|
247
|
-
"data-testid": "gdb-filter-chip",
|
|
248
|
-
children: [/* @__PURE__ */ jsxDEV("span", {
|
|
249
|
-
className: "font-medium text-foreground",
|
|
250
|
-
children: filter.column
|
|
251
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("span", {
|
|
252
|
-
className: "text-muted-foreground",
|
|
253
|
-
children: "="
|
|
254
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("span", {
|
|
255
|
-
className: "font-mono text-foreground",
|
|
256
|
-
children: chipValue(filter.value)
|
|
257
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("button", {
|
|
258
|
-
"aria-label": t("Remove filter"),
|
|
259
|
-
className: "ml-0.5 text-muted-foreground hover:text-foreground",
|
|
260
|
-
"data-index": index_0,
|
|
261
|
-
"data-testid": "gdb-filter-remove",
|
|
262
|
-
onClick: removeFilter,
|
|
263
|
-
type: "button",
|
|
264
|
-
children: "✕"
|
|
265
|
-
}, void 0, false)]
|
|
266
|
-
}, `${filter.column}:${chipValue(filter.value)}`, true))
|
|
267
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(GridContainer, {
|
|
268
|
-
layout: "fill",
|
|
269
|
-
children: /* @__PURE__ */ jsxDEV("div", {
|
|
270
|
-
className: "min-h-0 flex-1 overflow-auto",
|
|
271
|
-
children: /* @__PURE__ */ jsxDEV(Table, {
|
|
272
|
-
"data-testid": "gdb-rows",
|
|
273
|
-
children: [/* @__PURE__ */ jsxDEV(TableHeader, {
|
|
274
|
-
children: /* @__PURE__ */ jsxDEV(TableRow, {
|
|
275
|
-
children: page.columns.map((column_2) => /* @__PURE__ */ jsxDEV(TableHead, {
|
|
276
|
-
children: column_2
|
|
277
|
-
}, column_2, false))
|
|
278
|
-
}, void 0, false)
|
|
279
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV(TableBody, {
|
|
280
|
-
children: page.rows.map((row, rowIndex) => /* @__PURE__ */ jsxDEV(TableRow, {
|
|
281
|
-
"data-testid": "gdb-row",
|
|
282
|
-
children: page.columns.map((column_3) => /* @__PURE__ */ jsxDEV(TableCell, {
|
|
283
|
-
className: "max-w-xs truncate font-mono text-xs",
|
|
284
|
-
children: /* @__PURE__ */ jsxDEV(CellValue, {
|
|
285
|
-
value: row[column_3]
|
|
286
|
-
}, void 0, false)
|
|
287
|
-
}, column_3, false))
|
|
288
|
-
}, rowKey(row, rowIndex), false))
|
|
289
|
-
}, void 0, false)]
|
|
290
|
-
}, void 0, true)
|
|
291
|
-
}, void 0, false)
|
|
292
|
-
}, void 0, false), /* @__PURE__ */ jsxDEV("div", {
|
|
293
|
-
className: "flex shrink-0 items-center border-t border-border px-4 py-2",
|
|
294
|
-
children: /* @__PURE__ */ jsxDEV(GridPagination, {
|
|
295
|
-
hasNext,
|
|
296
|
-
hasPrevious,
|
|
297
|
-
onJumpToPage: jumpToPage,
|
|
298
|
-
onNext: goNext,
|
|
299
|
-
onPageSizeChange: changePageSize,
|
|
300
|
-
onPrevious: goPrevious,
|
|
301
|
-
pageSize,
|
|
302
|
-
prefix: "gdb",
|
|
303
|
-
rangeEnd,
|
|
304
|
-
rangeStart,
|
|
305
|
-
total
|
|
306
|
-
}, void 0, false)
|
|
307
|
-
}, void 0, false)]
|
|
308
|
-
}, void 0, true)]
|
|
309
|
-
}, void 0, true), /* @__PURE__ */ jsxDEV(DataFacets, {
|
|
310
|
-
columns: page?.columns ?? NO_COLUMNS,
|
|
311
|
-
facets,
|
|
312
|
-
onFacetFilter,
|
|
313
|
-
onToggleFacet
|
|
314
|
-
}, void 0, false)]
|
|
315
|
-
}, void 0, true);
|
|
316
|
-
};
|
|
317
|
-
|
|
318
|
-
export { GlobalDataBrowser };
|