@lunora/studio 1.0.0-alpha.7 → 1.0.0-alpha.71
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 +762 -779
- 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/MigrationsPanel.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 +2 -0
- package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -0
- package/dist/packem_chunks/SettingsPanel.js +1 -0
- package/dist/packem_chunks/SqlEditorPanel.js +4 -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/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-BYNSbBVE.js +1 -0
- package/dist/packem_shared/ApiDocsPanel-eJYZlylw.js +2 -0
- package/dist/packem_shared/ApiReferencePanel-C42v1jr6.js +1 -0
- package/dist/packem_shared/CommandPalette-CVIaY3j8.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-B8J5lHjP.js +1 -0
- package/dist/packem_shared/DataFilters-Csb30F0C.js +1 -0
- package/dist/packem_shared/ErrorBoundary-DvzYskH7.js +1 -0
- package/dist/packem_shared/GlobalDataBrowser-RLJ6NvOs.js +1 -0
- package/dist/packem_shared/HomePanel-DL1HupAN.js +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-sGsIgYWj.js +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
- package/dist/packem_shared/ScheduledJobs-DUbo6epc.js +1 -0
- package/dist/packem_shared/ShardInput-BVn2iCU0.js +1 -0
- package/dist/packem_shared/Studio-BWBclm_C.js +1 -0
- package/dist/packem_shared/StudioApp-BFm73yVr.js +1 -0
- package/dist/packem_shared/StudioI18nProvider-CZ5h4nrV.js +1 -0
- package/dist/packem_shared/advisor-view-DaCX9Jy5.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-bRPJhby-.d.ts +254 -0
- package/dist/packem_shared/badge-BbuuAio7.js +1 -0
- package/dist/packem_shared/bar-chart-AryFCeoa.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-BMBKzMEJ.js +1 -0
- package/dist/packem_shared/data-view-params-C8T3bW1z.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-B59DnrDI.js +1 -0
- package/dist/packem_shared/grid-features-uZCUj955.js +6 -0
- package/dist/packem_shared/home-panel-B-8BCffw.js +3 -0
- package/dist/packem_shared/input-JHu63lTv.js +1 -0
- package/dist/packem_shared/internal-AtZ4bTal.js +2 -0
- package/dist/packem_shared/label-6uP1obNF.js +1 -0
- package/dist/packem_shared/live-status-CGW2JHf_.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/reference-view-KvhektwF.js +12 -0
- package/dist/packem_shared/result-chart-CwKhhKM0.js +1 -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-DtcZoU48.js +1 -0
- package/dist/packem_shared/storage-tier-DznqOf-q.js +1 -0
- package/dist/packem_shared/studio-BHA7hnI3.js +2 -0
- package/dist/packem_shared/table-DdJBrClo.js +2 -0
- package/dist/packem_shared/table-list-sidebar-CMCcNALK.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-Di3fLE8H.js +1 -0
- package/dist/packem_shared/use-async-submit-H68GHPz8.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-2F7G7IWQ.js +1 -0
- package/dist/standalone/chunk-2OUPA2WJ.js +1 -0
- package/dist/standalone/chunk-2PJNAWB3.js +1 -0
- package/dist/standalone/chunk-2Y36BVVM.js +4 -0
- package/dist/standalone/chunk-34UVAASH.js +1 -0
- package/dist/standalone/chunk-35II7U25.js +11 -0
- package/dist/standalone/chunk-3FUFEZ65.js +1 -0
- package/dist/standalone/chunk-3QRTYSSX.js +1 -0
- package/dist/standalone/chunk-3RTTXLMU.js +1 -0
- package/dist/standalone/chunk-3XIESWL4.js +1 -0
- package/dist/standalone/chunk-4CGALXS3.js +19 -0
- package/dist/standalone/chunk-4UOFSGUS.js +1 -0
- package/dist/standalone/chunk-4WLYA3XE.js +1 -0
- package/dist/standalone/chunk-54MMVNPT.js +1 -0
- package/dist/standalone/chunk-5L2MD6F6.js +1 -0
- package/dist/standalone/chunk-5OWIOACV.js +13 -0
- package/dist/standalone/chunk-5RF4QDDA.js +6 -0
- package/dist/standalone/chunk-5U2THBI7.js +1 -0
- package/dist/standalone/chunk-5Y3QLNWX.js +1 -0
- package/dist/standalone/chunk-65OTWFS3.js +1 -0
- package/dist/standalone/chunk-6DWCIIHE.js +1 -0
- package/dist/standalone/chunk-6ST5ECQA.js +1 -0
- package/dist/standalone/chunk-7J5N6DGQ.js +1 -0
- package/dist/standalone/chunk-7LQWFOEU.js +1 -0
- package/dist/standalone/chunk-7QIFDWQV.js +1 -0
- package/dist/standalone/chunk-7RXOPYR5.js +1 -0
- package/dist/standalone/chunk-7T7UOTYK.js +1 -0
- package/dist/standalone/chunk-7YEFOSPH.js +1 -0
- package/dist/standalone/chunk-AVAC26HJ.js +1 -0
- package/dist/standalone/chunk-B43FTQJ7.js +1 -0
- package/dist/standalone/chunk-BEH5N5ZA.js +1 -0
- package/dist/standalone/chunk-BGBLQ563.js +1 -0
- package/dist/standalone/chunk-BNUJ7QMG.js +3 -0
- package/dist/standalone/chunk-C43X4M5U.js +1 -0
- package/dist/standalone/chunk-CFPZYHPY.js +2 -0
- package/dist/standalone/chunk-D7XXWV4E.js +1 -0
- package/dist/standalone/chunk-DVOBKIUX.js +1 -0
- package/dist/standalone/chunk-EKRN4ZQM.js +1 -0
- package/dist/standalone/chunk-ESVP44Y3.js +1 -0
- package/dist/standalone/chunk-EVN46TVV.js +1 -0
- package/dist/standalone/chunk-EXFBIISG.js +2 -0
- package/dist/standalone/chunk-F5QWLENA.js +1 -0
- package/dist/standalone/chunk-F6GOKFMU.js +3 -0
- package/dist/standalone/chunk-FGTK44LR.js +1 -0
- package/dist/standalone/chunk-FXCBF4XT.js +1 -0
- package/dist/standalone/chunk-GMR677FL.js +1 -0
- package/dist/standalone/chunk-GRL5MG3Z.js +1 -0
- package/dist/standalone/chunk-GSPTEMYN.js +1 -0
- package/dist/standalone/chunk-GXZAXNZI.js +1 -0
- package/dist/standalone/chunk-H7NIIBHH.js +1 -0
- package/dist/standalone/chunk-HP2UCWND.js +1 -0
- package/dist/standalone/chunk-HPFLBYRI.js +1 -0
- package/dist/standalone/chunk-IC4L6G56.js +1 -0
- package/dist/standalone/chunk-IDNNI63H.js +1 -0
- package/dist/standalone/chunk-ILNELDFC.js +1 -0
- package/dist/standalone/chunk-IVFHIQOT.js +1 -0
- package/dist/standalone/chunk-JN2Y24PY.js +1 -0
- package/dist/standalone/chunk-KDOC2DP5.js +1 -0
- package/dist/standalone/chunk-KUVMORDQ.js +1 -0
- package/dist/standalone/chunk-KYF2E5CJ.js +1 -0
- package/dist/standalone/chunk-L7N7F3DA.js +1 -0
- package/dist/standalone/chunk-LE56LPNH.js +13 -0
- package/dist/standalone/chunk-LEDWUPXM.js +1 -0
- package/dist/standalone/chunk-LFKCLLPT.js +1 -0
- package/dist/standalone/chunk-LFXFP4IF.js +1 -0
- package/dist/standalone/chunk-LJDP7NRB.js +1 -0
- package/dist/standalone/chunk-LLXFYRGQ.js +1 -0
- package/dist/standalone/chunk-M536Y2KX.js +1 -0
- package/dist/standalone/chunk-MIQTKZAR.js +1 -0
- package/dist/standalone/chunk-OHKRN65U.js +1 -0
- package/dist/standalone/chunk-P24JBHEZ.js +4 -0
- package/dist/standalone/chunk-PF7V3G2Z.js +62 -0
- package/dist/standalone/chunk-PWWHP76O.js +1 -0
- package/dist/standalone/chunk-QBWRC5YX.js +1 -0
- package/dist/standalone/chunk-QGKAJTQQ.js +1 -0
- package/dist/standalone/chunk-QLJJ5YYZ.js +1 -0
- package/dist/standalone/chunk-QVEHPYA5.js +1 -0
- package/dist/standalone/chunk-QWGT25SE.js +1 -0
- package/dist/standalone/chunk-QWJ3NPE3.js +1 -0
- package/dist/standalone/chunk-RAA2RGG6.js +1 -0
- package/dist/standalone/chunk-RBU52M5T.js +1 -0
- package/dist/standalone/chunk-SA3MDZC3.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-SMIESS7P.js +1 -0
- package/dist/standalone/chunk-T2JIUFOD.js +4 -0
- package/dist/standalone/chunk-T6VMSOBB.js +1 -0
- package/dist/standalone/chunk-THIXMMZD.js +1 -0
- package/dist/standalone/chunk-TJ2WZ5OP.js +1 -0
- package/dist/standalone/chunk-TLHJRWNK.js +1 -0
- package/dist/standalone/chunk-UIS34ZPB.js +8 -0
- package/dist/standalone/chunk-UNUU7CJJ.js +1 -0
- package/dist/standalone/chunk-UZERI5YC.js +1 -0
- package/dist/standalone/chunk-V53KNYRN.js +1 -0
- package/dist/standalone/chunk-VPAXCQ2Y.js +4 -0
- package/dist/standalone/chunk-X2FQ6B5V.js +1 -0
- package/dist/standalone/chunk-XBDKZZ67.js +1 -0
- package/dist/standalone/chunk-XEDU5FO4.js +1 -0
- package/dist/standalone/chunk-XQBTNJUQ.js +1 -0
- package/dist/standalone/chunk-XQCVZAGU.js +1 -0
- package/dist/standalone/chunk-XQGANNLS.js +1 -0
- package/dist/standalone/chunk-XSD4Y6SQ.js +1 -0
- package/dist/standalone/chunk-XXQUMVWH.js +1 -0
- package/dist/standalone/chunk-YD5NF6UT.js +1 -0
- package/dist/standalone/chunk-YI3WYUXK.js +1 -0
- package/dist/standalone/chunk-ZJGP6EKR.js +1 -0
- package/dist/standalone/chunk-ZNNAGR6N.js +1 -0
- package/dist/standalone/studio.js +9 -356
- package/dist/styles.css +2 -2
- package/package.json +17 -15
- package/dist/packem_shared/ADMIN_FUNCTIONS-DmBqMZ-z.js +0 -45
- package/dist/packem_shared/ApiDocsPanel-C5-yJ1p7.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
- package/dist/packem_shared/ApiTab-W3no0KOj.js +0 -251
- package/dist/packem_shared/AuditPanel-Bq4o_IqT.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-CtBe1So9.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-dxY56TDF.js +0 -193
- package/dist/packem_shared/FileBrowser-Dhy4zES8.js +0 -2932
- package/dist/packem_shared/FunctionRunner--fQJRPAD.js +0 -343
- package/dist/packem_shared/FunctionStatsPanel-BjRUA_G3.js +0 -432
- package/dist/packem_shared/GlobalDataBrowser-BTEmGrph.js +0 -318
- package/dist/packem_shared/HealthPanel-PxclMWmA.js +0 -640
- package/dist/packem_shared/HomePanel-Cw16stjq.js +0 -1273
- package/dist/packem_shared/InsightsPanel-CWS_C-xW.js +0 -423
- package/dist/packem_shared/LogsPanel-CTW8CFcM.js +0 -839
- package/dist/packem_shared/MailPanel-BwkvfIHF.js +0 -447
- package/dist/packem_shared/MetricsPanel-BLuOhZQ4.js +0 -1625
- package/dist/packem_shared/MigrationsPanel-DT3lnwHF.js +0 -246
- package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
- package/dist/packem_shared/PitrPanel-CdErL7EJ.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-LJDcmNIO.js +0 -2512
- package/dist/packem_shared/SecurityAdvisorPanel-C_ETsPih.js +0 -79
- package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
- package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
- package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
- package/dist/packem_shared/Studio-BmSGSIuY.js +0 -33
- package/dist/packem_shared/StudioApp-D4azxYBu.js +0 -657
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/TableEditor-ChfUOZec.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-CCmwDEVs.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-BFRpzj6r.js +0 -2562
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-H9fuQgSj.js +0 -10303
- 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 };
|