@rebasepro/studio 0.0.1-canary.09e5ec5
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 +114 -0
- package/README.md +159 -0
- package/dist/ApiExplorer-gMJt5JrS.js +1053 -0
- package/dist/ApiExplorer-gMJt5JrS.js.map +1 -0
- package/dist/AuthSimulationSelector-BF4rkRGp.js +118 -0
- package/dist/AuthSimulationSelector-BF4rkRGp.js.map +1 -0
- package/dist/BranchesView-DcHZtvXo.js +292 -0
- package/dist/BranchesView-DcHZtvXo.js.map +1 -0
- package/dist/CronJobsView-CijCToeK.js +456 -0
- package/dist/CronJobsView-CijCToeK.js.map +1 -0
- package/dist/JSEditor-D8nVp3Lp.js +1308 -0
- package/dist/JSEditor-D8nVp3Lp.js.map +1 -0
- package/dist/MonacoEditor-CMYEjiRf.js +161 -0
- package/dist/MonacoEditor-CMYEjiRf.js.map +1 -0
- package/dist/RLSEditor-DBH09u9v.js +1831 -0
- package/dist/RLSEditor-DBH09u9v.js.map +1 -0
- package/dist/SQLEditor-CkVx9vgr.js +1792 -0
- package/dist/SQLEditor-CkVx9vgr.js.map +1 -0
- package/dist/SchemaVisualizer-BgD5Zb77.js +1069 -0
- package/dist/SchemaVisualizer-BgD5Zb77.js.map +1 -0
- package/dist/StorageView-CTqGFhY9.js +907 -0
- package/dist/StorageView-CTqGFhY9.js.map +1 -0
- package/dist/common/src/collections/CollectionRegistry.d.ts +56 -0
- package/dist/common/src/collections/index.d.ts +1 -0
- package/dist/common/src/data/buildRebaseData.d.ts +14 -0
- package/dist/common/src/index.d.ts +3 -0
- package/dist/common/src/util/builders.d.ts +57 -0
- package/dist/common/src/util/callbacks.d.ts +6 -0
- package/dist/common/src/util/collections.d.ts +11 -0
- package/dist/common/src/util/common.d.ts +2 -0
- package/dist/common/src/util/conditions.d.ts +26 -0
- package/dist/common/src/util/entities.d.ts +58 -0
- package/dist/common/src/util/enums.d.ts +3 -0
- package/dist/common/src/util/index.d.ts +16 -0
- package/dist/common/src/util/navigation_from_path.d.ts +34 -0
- package/dist/common/src/util/navigation_utils.d.ts +20 -0
- package/dist/common/src/util/parent_references_from_path.d.ts +6 -0
- package/dist/common/src/util/paths.d.ts +14 -0
- package/dist/common/src/util/permissions.d.ts +5 -0
- package/dist/common/src/util/references.d.ts +2 -0
- package/dist/common/src/util/relations.d.ts +22 -0
- package/dist/common/src/util/resolutions.d.ts +72 -0
- package/dist/common/src/util/storage.d.ts +24 -0
- package/dist/core/src/components/AIIcon.d.ts +16 -0
- package/dist/core/src/components/ConfirmationDialog.d.ts +9 -0
- package/dist/core/src/components/Debug/UIReferenceView.d.ts +1 -0
- package/dist/core/src/components/Debug/UIStyleGuide.d.ts +1 -0
- package/dist/core/src/components/ErrorTooltip.d.ts +2 -0
- package/dist/core/src/components/ErrorView.d.ts +21 -0
- package/dist/core/src/components/LanguageToggle.d.ts +1 -0
- package/dist/core/src/components/LoginView/LoginView.d.ts +68 -0
- package/dist/core/src/components/LoginView/index.d.ts +2 -0
- package/dist/core/src/components/NotFoundPage.d.ts +1 -0
- package/dist/core/src/components/RebaseAuth.d.ts +10 -0
- package/dist/core/src/components/RebaseLogo.d.ts +7 -0
- package/dist/core/src/components/UnsavedChangesDialog.d.ts +9 -0
- package/dist/core/src/components/UserDisplay.d.ts +7 -0
- package/dist/core/src/components/UserSelectPopover.d.ts +62 -0
- package/dist/core/src/components/UserSettingsView.d.ts +1 -0
- package/dist/core/src/components/common/index.d.ts +6 -0
- package/dist/core/src/components/common/table_height.d.ts +5 -0
- package/dist/core/src/components/common/types.d.ts +63 -0
- package/dist/core/src/components/common/useColumnsIds.d.ts +9 -0
- package/dist/core/src/components/common/useDataTableController.d.ts +45 -0
- package/dist/core/src/components/common/useDebouncedData.d.ts +9 -0
- package/dist/core/src/components/common/useScrollRestoration.d.ts +14 -0
- package/dist/core/src/components/index.d.ts +16 -0
- package/dist/core/src/contexts/AdminModeController.d.ts +4 -0
- package/dist/core/src/contexts/AnalyticsContext.d.ts +3 -0
- package/dist/core/src/contexts/AuthControllerContext.d.ts +3 -0
- package/dist/core/src/contexts/CustomizationControllerContext.d.ts +3 -0
- package/dist/core/src/contexts/DataDriverContext.d.ts +3 -0
- package/dist/core/src/contexts/DatabaseAdminContext.d.ts +3 -0
- package/dist/core/src/contexts/DialogsProvider.d.ts +4 -0
- package/dist/core/src/contexts/EffectiveRoleController.d.ts +4 -0
- package/dist/core/src/contexts/InternalUserManagementContext.d.ts +3 -0
- package/dist/core/src/contexts/ModeController.d.ts +4 -0
- package/dist/core/src/contexts/RebaseClientInstanceContext.d.ts +6 -0
- package/dist/core/src/contexts/RebaseDataContext.d.ts +3 -0
- package/dist/core/src/contexts/SnackbarProvider.d.ts +2 -0
- package/dist/core/src/contexts/StorageSourceContext.d.ts +3 -0
- package/dist/core/src/contexts/UserConfigurationPersistenceContext.d.ts +3 -0
- package/dist/core/src/contexts/index.d.ts +13 -0
- package/dist/core/src/core/PluginLifecycleManager.d.ts +17 -0
- package/dist/core/src/core/PluginProviderStack.d.ts +21 -0
- package/dist/core/src/core/Rebase.d.ts +14 -0
- package/dist/core/src/core/RebaseProps.d.ts +136 -0
- package/dist/core/src/core/RebaseRouter.d.ts +4 -0
- package/dist/core/src/core/RebaseRoutes.d.ts +17 -0
- package/dist/core/src/core/index.d.ts +4 -0
- package/dist/core/src/hooks/ApiConfigContext.d.ts +24 -0
- package/dist/core/src/hooks/data/delete.d.ts +31 -0
- package/dist/core/src/hooks/data/save.d.ts +34 -0
- package/dist/core/src/hooks/data/useCollectionFetch.d.ts +51 -0
- package/dist/core/src/hooks/data/useData.d.ts +13 -0
- package/dist/core/src/hooks/data/useDataOrder.d.ts +12 -0
- package/dist/core/src/hooks/data/useEntityFetch.d.ts +38 -0
- package/dist/core/src/hooks/data/useRelationSelector.d.ts +52 -0
- package/dist/core/src/hooks/data/useUserSelector.d.ts +31 -0
- package/dist/core/src/hooks/index.d.ts +37 -0
- package/dist/core/src/hooks/useAdminModeController.d.ts +19 -0
- package/dist/core/src/hooks/useAnalyticsController.d.ts +5 -0
- package/dist/core/src/hooks/useAuthController.d.ts +11 -0
- package/dist/core/src/hooks/useAuthSubscription.d.ts +2 -0
- package/dist/core/src/hooks/useBackendStorageSource.d.ts +30 -0
- package/dist/core/src/hooks/useBridgeRegistration.d.ts +18 -0
- package/dist/core/src/hooks/useBrowserTitleAndIcon.d.ts +6 -0
- package/dist/core/src/hooks/useBuildAdminModeController.d.ts +6 -0
- package/dist/core/src/hooks/useBuildEffectiveRoleController.d.ts +8 -0
- package/dist/core/src/hooks/useBuildLocalConfigurationPersistence.d.ts +2 -0
- package/dist/core/src/hooks/useBuildModeController.d.ts +6 -0
- package/dist/core/src/hooks/useClipboard.d.ts +57 -0
- package/dist/core/src/hooks/useCollapsedGroups.d.ts +12 -0
- package/dist/core/src/hooks/useCustomizationController.d.ts +11 -0
- package/dist/core/src/hooks/useDialogsController.d.ts +11 -0
- package/dist/core/src/hooks/useEffectiveRoleController.d.ts +7 -0
- package/dist/core/src/hooks/useInternalUserManagementController.d.ts +12 -0
- package/dist/core/src/hooks/useLargeLayout.d.ts +1 -0
- package/dist/core/src/hooks/useModeController.d.ts +19 -0
- package/dist/core/src/hooks/usePermissions.d.ts +12 -0
- package/dist/core/src/hooks/useRebaseClient.d.ts +5 -0
- package/dist/core/src/hooks/useRebaseContext.d.ts +11 -0
- package/dist/core/src/hooks/useRebaseRegistry.d.ts +34 -0
- package/dist/core/src/hooks/useSlot.d.ts +18 -0
- package/dist/core/src/hooks/useSnackbarController.d.ts +20 -0
- package/dist/core/src/hooks/useStorageSource.d.ts +7 -0
- package/dist/core/src/hooks/useStudioBridge.d.ts +91 -0
- package/dist/core/src/hooks/useTranslation.d.ts +17 -0
- package/dist/core/src/hooks/useUnsavedChangesDialog.d.ts +12 -0
- package/dist/core/src/hooks/useUserConfigurationPersistence.d.ts +8 -0
- package/dist/core/src/hooks/useValidateAuthenticator.d.ts +21 -0
- package/dist/core/src/i18n/RebaseI18nProvider.d.ts +33 -0
- package/dist/core/src/index.d.ts +15 -0
- package/dist/core/src/internal/common.d.ts +3 -0
- package/dist/core/src/internal/useRestoreScroll.d.ts +6 -0
- package/dist/core/src/locales/de.d.ts +2 -0
- package/dist/core/src/locales/en.d.ts +10 -0
- package/dist/core/src/locales/es.d.ts +10 -0
- package/dist/core/src/locales/fr.d.ts +2 -0
- package/dist/core/src/locales/hi.d.ts +2 -0
- package/dist/core/src/locales/it.d.ts +2 -0
- package/dist/core/src/locales/pt.d.ts +7 -0
- package/dist/core/src/util/constants.d.ts +1 -0
- package/dist/core/src/util/createFormexStub.d.ts +2 -0
- package/dist/core/src/util/entity_cache.d.ts +27 -0
- package/dist/core/src/util/enums.d.ts +5 -0
- package/dist/core/src/util/icon_list.d.ts +5 -0
- package/dist/core/src/util/icon_synonyms.d.ts +1 -0
- package/dist/core/src/util/icons.d.ts +20 -0
- package/dist/core/src/util/index.d.ts +10 -0
- package/dist/core/src/util/previews.d.ts +4 -0
- package/dist/core/src/util/useStorageUploadController.d.ts +38 -0
- package/dist/core/src/util/useTraceUpdate.d.ts +2 -0
- package/dist/formex/src/Field.d.ts +52 -0
- package/dist/formex/src/Formex.d.ts +7 -0
- package/dist/formex/src/index.d.ts +5 -0
- package/dist/formex/src/types.d.ts +40 -0
- package/dist/formex/src/useCreateFormex.d.ts +14 -0
- package/dist/formex/src/utils.d.ts +16 -0
- package/dist/index.es.js +726 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +9647 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/studio/src/components/ApiExplorer/ApiExplorer.d.ts +9 -0
- package/dist/studio/src/components/ApiExplorer/EndpointDetail.d.ts +9 -0
- package/dist/studio/src/components/ApiExplorer/TryItPanel.d.ts +15 -0
- package/dist/studio/src/components/ApiExplorer/parseSpec.d.ts +16 -0
- package/dist/studio/src/components/ApiExplorer/types.d.ts +90 -0
- package/dist/studio/src/components/AuthSimulationSelector.d.ts +11 -0
- package/dist/studio/src/components/Branches/BranchesView.d.ts +1 -0
- package/dist/studio/src/components/CronJobs/CronJobsView.d.ts +1 -0
- package/dist/studio/src/components/JSEditor/JSEditor.d.ts +1 -0
- package/dist/studio/src/components/JSEditor/JSEditorSidebar.d.ts +21 -0
- package/dist/studio/src/components/JSEditor/JSMonacoEditor.d.ts +18 -0
- package/dist/studio/src/components/RLSEditor/PolicyEditor.d.ts +9 -0
- package/dist/studio/src/components/RLSEditor/RLSEditor.d.ts +19 -0
- package/dist/studio/src/components/RLSEditor/index.d.ts +1 -0
- package/dist/studio/src/components/RebaseStudio.d.ts +2 -0
- package/dist/studio/src/components/SQLEditor/ExplainVisualizer.d.ts +24 -0
- package/dist/studio/src/components/SQLEditor/MonacoEditor.d.ts +17 -0
- package/dist/studio/src/components/SQLEditor/SQLEditor.d.ts +11 -0
- package/dist/studio/src/components/SQLEditor/SQLEditorSidebar.d.ts +21 -0
- package/dist/studio/src/components/SQLEditor/SchemaBrowser.d.ts +8 -0
- package/dist/studio/src/components/SchemaVisualizer/RelationEdge.d.ts +3 -0
- package/dist/studio/src/components/SchemaVisualizer/SchemaVisualizer.d.ts +2 -0
- package/dist/studio/src/components/SchemaVisualizer/TableNode.d.ts +3 -0
- package/dist/studio/src/components/SchemaVisualizer/index.d.ts +5 -0
- package/dist/studio/src/components/SchemaVisualizer/schema-visualizer.utils.d.ts +42 -0
- package/dist/studio/src/components/SchemaVisualizer/useSchemaGraph.d.ts +37 -0
- package/dist/studio/src/components/StorageView/StorageView.d.ts +1 -0
- package/dist/studio/src/components/StudioHomePage.d.ts +9 -0
- package/dist/studio/src/index.d.ts +4 -0
- package/dist/studio/src/utils/entities.d.ts +0 -0
- package/dist/studio/src/utils/pgColumnToProperty.d.ts +6 -0
- package/dist/studio/src/utils/sql_utils.d.ts +52 -0
- package/dist/types/src/controllers/analytics_controller.d.ts +7 -0
- package/dist/types/src/controllers/auth.d.ts +119 -0
- package/dist/types/src/controllers/client.d.ts +170 -0
- package/dist/types/src/controllers/collection_registry.d.ts +45 -0
- package/dist/types/src/controllers/customization_controller.d.ts +60 -0
- package/dist/types/src/controllers/data.d.ts +168 -0
- package/dist/types/src/controllers/data_driver.d.ts +160 -0
- package/dist/types/src/controllers/database_admin.d.ts +11 -0
- package/dist/types/src/controllers/dialogs_controller.d.ts +36 -0
- package/dist/types/src/controllers/effective_role.d.ts +4 -0
- package/dist/types/src/controllers/email.d.ts +34 -0
- package/dist/types/src/controllers/index.d.ts +18 -0
- package/dist/types/src/controllers/local_config_persistence.d.ts +20 -0
- package/dist/types/src/controllers/navigation.d.ts +213 -0
- package/dist/types/src/controllers/registry.d.ts +54 -0
- package/dist/types/src/controllers/side_dialogs_controller.d.ts +67 -0
- package/dist/types/src/controllers/side_entity_controller.d.ts +90 -0
- package/dist/types/src/controllers/snackbar.d.ts +24 -0
- package/dist/types/src/controllers/storage.d.ts +171 -0
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/rebase_context.d.ts +105 -0
- package/dist/types/src/types/backend.d.ts +536 -0
- package/dist/types/src/types/builders.d.ts +15 -0
- package/dist/types/src/types/chips.d.ts +5 -0
- package/dist/types/src/types/collections.d.ts +856 -0
- package/dist/types/src/types/cron.d.ts +102 -0
- package/dist/types/src/types/data_source.d.ts +64 -0
- package/dist/types/src/types/entities.d.ts +145 -0
- package/dist/types/src/types/entity_actions.d.ts +98 -0
- package/dist/types/src/types/entity_callbacks.d.ts +173 -0
- package/dist/types/src/types/entity_link_builder.d.ts +7 -0
- package/dist/types/src/types/entity_overrides.d.ts +10 -0
- package/dist/types/src/types/entity_views.d.ts +61 -0
- package/dist/types/src/types/export_import.d.ts +21 -0
- package/dist/types/src/types/index.d.ts +23 -0
- package/dist/types/src/types/locales.d.ts +4 -0
- package/dist/types/src/types/modify_collections.d.ts +5 -0
- package/dist/types/src/types/plugins.d.ts +279 -0
- package/dist/types/src/types/properties.d.ts +1176 -0
- package/dist/types/src/types/property_config.d.ts +70 -0
- package/dist/types/src/types/relations.d.ts +336 -0
- package/dist/types/src/types/slots.d.ts +252 -0
- package/dist/types/src/types/translations.d.ts +870 -0
- package/dist/types/src/types/user_management_delegate.d.ts +121 -0
- package/dist/types/src/types/websockets.d.ts +78 -0
- package/dist/types/src/users/index.d.ts +2 -0
- package/dist/types/src/users/roles.d.ts +22 -0
- package/dist/types/src/users/user.d.ts +46 -0
- package/dist/ui/src/components/Alert.d.ts +12 -0
- package/dist/ui/src/components/Autocomplete.d.ts +21 -0
- package/dist/ui/src/components/Avatar.d.ts +11 -0
- package/dist/ui/src/components/Badge.d.ts +8 -0
- package/dist/ui/src/components/BooleanSwitch.d.ts +14 -0
- package/dist/ui/src/components/BooleanSwitchWithLabel.d.ts +17 -0
- package/dist/ui/src/components/Button.d.ts +14 -0
- package/dist/ui/src/components/Card.d.ts +9 -0
- package/dist/ui/src/components/CenteredView.d.ts +9 -0
- package/dist/ui/src/components/Checkbox.d.ts +13 -0
- package/dist/ui/src/components/Chip.d.ts +26 -0
- package/dist/ui/src/components/CircularProgress.d.ts +5 -0
- package/dist/ui/src/components/CircularProgressCenter.d.ts +11 -0
- package/dist/ui/src/components/Collapse.d.ts +9 -0
- package/dist/ui/src/components/ColorPicker.d.ts +30 -0
- package/dist/ui/src/components/Container.d.ts +8 -0
- package/dist/ui/src/components/DateTimeField.d.ts +24 -0
- package/dist/ui/src/components/DebouncedTextField.d.ts +2 -0
- package/dist/ui/src/components/Dialog.d.ts +39 -0
- package/dist/ui/src/components/DialogActions.d.ts +7 -0
- package/dist/ui/src/components/DialogContent.d.ts +7 -0
- package/dist/ui/src/components/DialogTitle.d.ts +10 -0
- package/dist/ui/src/components/ErrorBoundary.d.ts +11 -0
- package/dist/ui/src/components/ExpandablePanel.d.ts +12 -0
- package/dist/ui/src/components/FileUpload.d.ts +23 -0
- package/dist/ui/src/components/IconButton.d.ts +12 -0
- package/dist/ui/src/components/InfoLabel.d.ts +5 -0
- package/dist/ui/src/components/InputLabel.d.ts +11 -0
- package/dist/ui/src/components/Label.d.ts +7 -0
- package/dist/ui/src/components/LoadingButton.d.ts +7 -0
- package/dist/ui/src/components/Markdown.d.ts +10 -0
- package/dist/ui/src/components/Menu.d.ts +23 -0
- package/dist/ui/src/components/Menubar.d.ts +80 -0
- package/dist/ui/src/components/MultiSelect.d.ts +48 -0
- package/dist/ui/src/components/Paper.d.ts +6 -0
- package/dist/ui/src/components/Popover.d.ts +24 -0
- package/dist/ui/src/components/RadioGroup.d.ts +28 -0
- package/dist/ui/src/components/ResizablePanels.d.ts +18 -0
- package/dist/ui/src/components/SearchBar.d.ts +22 -0
- package/dist/ui/src/components/Select.d.ts +43 -0
- package/dist/ui/src/components/Separator.d.ts +5 -0
- package/dist/ui/src/components/Sheet.d.ts +22 -0
- package/dist/ui/src/components/Skeleton.d.ts +6 -0
- package/dist/ui/src/components/Slider.d.ts +21 -0
- package/dist/ui/src/components/Table.d.ts +34 -0
- package/dist/ui/src/components/Tabs.d.ts +19 -0
- package/dist/ui/src/components/TextField.d.ts +58 -0
- package/dist/ui/src/components/TextareaAutosize.d.ts +43 -0
- package/dist/ui/src/components/ToggleButtonGroup.d.ts +30 -0
- package/dist/ui/src/components/Tooltip.d.ts +19 -0
- package/dist/ui/src/components/Typography.d.ts +36 -0
- package/dist/ui/src/components/VirtualTable/VirtualTable.d.ts +11 -0
- package/dist/ui/src/components/VirtualTable/VirtualTableCell.d.ts +21 -0
- package/dist/ui/src/components/VirtualTable/VirtualTableHeader.d.ts +29 -0
- package/dist/ui/src/components/VirtualTable/VirtualTableHeaderRow.d.ts +2 -0
- package/dist/ui/src/components/VirtualTable/VirtualTableProps.d.ts +243 -0
- package/dist/ui/src/components/VirtualTable/VirtualTableRow.d.ts +3 -0
- package/dist/ui/src/components/VirtualTable/index.d.ts +3 -0
- package/dist/ui/src/components/VirtualTable/types.d.ts +38 -0
- package/dist/ui/src/components/common/SelectInputLabel.d.ts +5 -0
- package/dist/ui/src/components/index.d.ts +53 -0
- package/dist/ui/src/hooks/PortalContainerContext.d.ts +31 -0
- package/dist/ui/src/hooks/index.d.ts +6 -0
- package/dist/ui/src/hooks/useDebounceCallback.d.ts +1 -0
- package/dist/ui/src/hooks/useDebounceValue.d.ts +1 -0
- package/dist/ui/src/hooks/useDebouncedCallback.d.ts +1 -0
- package/dist/ui/src/hooks/useInjectStyles.d.ts +7 -0
- package/dist/ui/src/hooks/useOutsideAlerter.d.ts +5 -0
- package/dist/ui/src/icons/GitHubIcon.d.ts +2 -0
- package/dist/ui/src/icons/HandleIcon.d.ts +1 -0
- package/dist/ui/src/icons/Icon.d.ts +20 -0
- package/dist/ui/src/icons/cool_icon_keys.d.ts +1 -0
- package/dist/ui/src/icons/icon_keys.d.ts +1 -0
- package/dist/ui/src/icons/index.d.ts +6 -0
- package/dist/ui/src/index.d.ts +5 -0
- package/dist/ui/src/styles.d.ts +12 -0
- package/dist/ui/src/util/chip_colors.d.ts +4 -0
- package/dist/ui/src/util/cls.d.ts +2 -0
- package/dist/ui/src/util/debounce.d.ts +10 -0
- package/dist/ui/src/util/hash.d.ts +1 -0
- package/dist/ui/src/util/index.d.ts +4 -0
- package/dist/ui/src/util/key_to_icon_component.d.ts +1 -0
- package/package.json +84 -0
- package/src/components/ApiExplorer/ApiExplorer.tsx +290 -0
- package/src/components/ApiExplorer/EndpointDetail.tsx +271 -0
- package/src/components/ApiExplorer/TryItPanel.tsx +510 -0
- package/src/components/ApiExplorer/parseSpec.ts +104 -0
- package/src/components/ApiExplorer/types.ts +84 -0
- package/src/components/AuthSimulationSelector.tsx +77 -0
- package/src/components/Branches/BranchesView.tsx +370 -0
- package/src/components/CronJobs/CronJobsView.tsx +346 -0
- package/src/components/JSEditor/JSEditor.tsx +1033 -0
- package/src/components/JSEditor/JSEditorSidebar.tsx +340 -0
- package/src/components/JSEditor/JSMonacoEditor.tsx +390 -0
- package/src/components/RLSEditor/PolicyEditor.tsx +444 -0
- package/src/components/RLSEditor/RLSEditor.tsx +692 -0
- package/src/components/RLSEditor/index.ts +1 -0
- package/src/components/RebaseStudio.tsx +121 -0
- package/src/components/SQLEditor/ExplainVisualizer.tsx +128 -0
- package/src/components/SQLEditor/MonacoEditor.tsx +203 -0
- package/src/components/SQLEditor/SQLEditor.tsx +1419 -0
- package/src/components/SQLEditor/SQLEditorSidebar.tsx +174 -0
- package/src/components/SQLEditor/SchemaBrowser.tsx +158 -0
- package/src/components/SchemaVisualizer/RelationEdge.tsx +102 -0
- package/src/components/SchemaVisualizer/SchemaVisualizer.tsx +665 -0
- package/src/components/SchemaVisualizer/TableNode.tsx +257 -0
- package/src/components/SchemaVisualizer/index.ts +5 -0
- package/src/components/SchemaVisualizer/schema-visualizer.utils.ts +140 -0
- package/src/components/SchemaVisualizer/useSchemaGraph.ts +397 -0
- package/src/components/StorageView/StorageView.tsx +1035 -0
- package/src/components/StudioHomePage.tsx +357 -0
- package/src/index.ts +31 -0
- package/src/utils/entities.ts +2 -0
- package/src/utils/pgColumnToProperty.test.ts +401 -0
- package/src/utils/pgColumnToProperty.ts +275 -0
- package/src/utils/sql_utils.test.ts +265 -0
- package/src/utils/sql_utils.ts +291 -0
- package/src/vite-env.d.ts +1 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import React, { memo, useMemo } from "react";
|
|
2
|
+
import { Handle, Position } from "@xyflow/react";
|
|
3
|
+
import type { NodeProps } from "@xyflow/react";
|
|
4
|
+
import { Typography, Chip, Tooltip, cls } from "@rebasepro/ui";
|
|
5
|
+
import { IconForView } from "@rebasepro/core";
|
|
6
|
+
import type { TableNodeData, ColumnInfo } from "./useSchemaGraph";
|
|
7
|
+
import { getColumnRowY, getHeaderHeight } from "./schema-visualizer.utils";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Custom React Flow node that renders a database table as a card.
|
|
11
|
+
*
|
|
12
|
+
* Every PK and FK column renders handles on BOTH Left and Right sides.
|
|
13
|
+
* The edge builder picks which side to use based on relative node position.
|
|
14
|
+
*/
|
|
15
|
+
const TableNodeInner = ({ data, selected }: NodeProps) => {
|
|
16
|
+
const {
|
|
17
|
+
tableName,
|
|
18
|
+
collectionName,
|
|
19
|
+
columns,
|
|
20
|
+
isJunction,
|
|
21
|
+
rlsEnabled,
|
|
22
|
+
historyEnabled,
|
|
23
|
+
icon
|
|
24
|
+
} = data as TableNodeData;
|
|
25
|
+
|
|
26
|
+
// Build handles: every PK/FK column gets Left + Right handles
|
|
27
|
+
const handles = useMemo(() => {
|
|
28
|
+
const result: { id: string; type: "source" | "target"; position: Position; top: number }[] = [];
|
|
29
|
+
const cols = columns as ColumnInfo[];
|
|
30
|
+
const headerH = getHeaderHeight({
|
|
31
|
+
isJunction: Boolean(isJunction),
|
|
32
|
+
collectionName: collectionName as string,
|
|
33
|
+
tableName: tableName as string
|
|
34
|
+
});
|
|
35
|
+
const midY = cols.length > 0 ? getColumnRowY(Math.floor(cols.length / 2), headerH) : 30;
|
|
36
|
+
|
|
37
|
+
cols.forEach((col, idx) => {
|
|
38
|
+
const y = getColumnRowY(idx, headerH);
|
|
39
|
+
|
|
40
|
+
if (col.isForeignKey && !col.isPrimaryKey) {
|
|
41
|
+
// FK: source handles on both sides
|
|
42
|
+
result.push({ id: `source-${col.name}-right`,
|
|
43
|
+
type: "source",
|
|
44
|
+
position: Position.Right,
|
|
45
|
+
top: y });
|
|
46
|
+
result.push({ id: `source-${col.name}-left`,
|
|
47
|
+
type: "source",
|
|
48
|
+
position: Position.Left,
|
|
49
|
+
top: y });
|
|
50
|
+
}
|
|
51
|
+
if (col.isPrimaryKey) {
|
|
52
|
+
// PK: target + source handles on both sides
|
|
53
|
+
result.push({ id: `target-${col.name}-right`,
|
|
54
|
+
type: "target",
|
|
55
|
+
position: Position.Right,
|
|
56
|
+
top: y });
|
|
57
|
+
result.push({ id: `target-${col.name}-left`,
|
|
58
|
+
type: "target",
|
|
59
|
+
position: Position.Left,
|
|
60
|
+
top: y });
|
|
61
|
+
result.push({ id: `source-${col.name}-right`,
|
|
62
|
+
type: "source",
|
|
63
|
+
position: Position.Right,
|
|
64
|
+
top: y });
|
|
65
|
+
result.push({ id: `source-${col.name}-left`,
|
|
66
|
+
type: "source",
|
|
67
|
+
position: Position.Left,
|
|
68
|
+
top: y });
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// Default handles on both sides
|
|
73
|
+
result.push({ id: "target-default-right",
|
|
74
|
+
type: "target",
|
|
75
|
+
position: Position.Right,
|
|
76
|
+
top: midY });
|
|
77
|
+
result.push({ id: "target-default-left",
|
|
78
|
+
type: "target",
|
|
79
|
+
position: Position.Left,
|
|
80
|
+
top: midY });
|
|
81
|
+
result.push({ id: "source-default-right",
|
|
82
|
+
type: "source",
|
|
83
|
+
position: Position.Right,
|
|
84
|
+
top: midY });
|
|
85
|
+
result.push({ id: "source-default-left",
|
|
86
|
+
type: "source",
|
|
87
|
+
position: Position.Left,
|
|
88
|
+
top: midY });
|
|
89
|
+
|
|
90
|
+
return result;
|
|
91
|
+
}, [columns, isJunction, collectionName, tableName]);
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<div
|
|
95
|
+
className={cls(
|
|
96
|
+
"relative rounded-lg border bg-white dark:bg-surface-900 shadow-sm transition-all duration-200 min-w-[240px] max-w-[320px]",
|
|
97
|
+
selected
|
|
98
|
+
? "border-primary ring-2 ring-primary/20 shadow-md"
|
|
99
|
+
: "border-surface-200/40 dark:border-surface-700/40 hover:shadow-md hover:border-surface-300 dark:hover:border-surface-600",
|
|
100
|
+
isJunction && "border-dashed"
|
|
101
|
+
)}
|
|
102
|
+
>
|
|
103
|
+
{/* ── Header ── */}
|
|
104
|
+
<div
|
|
105
|
+
className={cls(
|
|
106
|
+
"flex items-center gap-2 px-3 py-2 border-b rounded-t-lg",
|
|
107
|
+
isJunction
|
|
108
|
+
? "bg-surface-50 dark:bg-surface-950/50 border-surface-200/30 dark:border-surface-700/30"
|
|
109
|
+
: "bg-surface-50 dark:bg-surface-950 border-surface-200/40 dark:border-surface-700/40"
|
|
110
|
+
)}
|
|
111
|
+
>
|
|
112
|
+
{icon && !isJunction && (
|
|
113
|
+
<div className="text-primary shrink-0">
|
|
114
|
+
<IconForView
|
|
115
|
+
collectionOrView={{ slug: tableName,
|
|
116
|
+
name: collectionName,
|
|
117
|
+
icon }}
|
|
118
|
+
size="smallest"
|
|
119
|
+
/>
|
|
120
|
+
</div>
|
|
121
|
+
)}
|
|
122
|
+
{isJunction && (
|
|
123
|
+
<svg
|
|
124
|
+
className="w-3.5 h-3.5 text-text-disabled dark:text-text-disabled-dark shrink-0"
|
|
125
|
+
fill="none"
|
|
126
|
+
stroke="currentColor"
|
|
127
|
+
viewBox="0 0 24 24"
|
|
128
|
+
>
|
|
129
|
+
<path
|
|
130
|
+
strokeLinecap="round"
|
|
131
|
+
strokeLinejoin="round"
|
|
132
|
+
strokeWidth={2}
|
|
133
|
+
d="M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"
|
|
134
|
+
/>
|
|
135
|
+
</svg>
|
|
136
|
+
)}
|
|
137
|
+
<div className="flex flex-col min-w-0">
|
|
138
|
+
<Typography
|
|
139
|
+
variant="caption"
|
|
140
|
+
className={cls(
|
|
141
|
+
"font-semibold truncate text-[12px]",
|
|
142
|
+
isJunction
|
|
143
|
+
? "text-text-secondary dark:text-text-secondary-dark"
|
|
144
|
+
: "text-text-primary dark:text-text-primary-dark"
|
|
145
|
+
)}
|
|
146
|
+
>
|
|
147
|
+
{tableName}
|
|
148
|
+
</Typography>
|
|
149
|
+
{collectionName !== tableName && !isJunction && (
|
|
150
|
+
<Typography
|
|
151
|
+
variant="caption"
|
|
152
|
+
className="text-[10px] text-text-disabled dark:text-text-disabled-dark truncate"
|
|
153
|
+
>
|
|
154
|
+
{collectionName}
|
|
155
|
+
</Typography>
|
|
156
|
+
)}
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
{/* Badges */}
|
|
160
|
+
<div className="ml-auto flex items-center gap-1 shrink-0">
|
|
161
|
+
{rlsEnabled && (
|
|
162
|
+
<Tooltip title="RLS enabled">
|
|
163
|
+
<div className="w-1.5 h-1.5 rounded-full bg-green-500"/>
|
|
164
|
+
</Tooltip>
|
|
165
|
+
)}
|
|
166
|
+
{historyEnabled && (
|
|
167
|
+
<Tooltip title="History enabled">
|
|
168
|
+
<div className="w-1.5 h-1.5 rounded-full bg-blue-400"/>
|
|
169
|
+
</Tooltip>
|
|
170
|
+
)}
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
{/* ── Columns ── */}
|
|
175
|
+
<div className="divide-y divide-surface-100 dark:divide-surface-950/60">
|
|
176
|
+
{(columns as ColumnInfo[]).map((col: ColumnInfo) => (
|
|
177
|
+
<div
|
|
178
|
+
key={col.name}
|
|
179
|
+
className={cls(
|
|
180
|
+
"flex items-center gap-2 px-3 py-1.5 text-xs transition-colors",
|
|
181
|
+
col.isPrimaryKey && "bg-amber-50/50 dark:bg-amber-950/10",
|
|
182
|
+
col.isForeignKey &&
|
|
183
|
+
!col.isPrimaryKey &&
|
|
184
|
+
"bg-blue-50/40 dark:bg-blue-950/10"
|
|
185
|
+
)}
|
|
186
|
+
>
|
|
187
|
+
<span className="w-3 shrink-0 text-center">
|
|
188
|
+
{col.isPrimaryKey && (
|
|
189
|
+
<Tooltip title="Primary Key">
|
|
190
|
+
<span className="text-amber-500 text-[10px] font-bold">🔑</span>
|
|
191
|
+
</Tooltip>
|
|
192
|
+
)}
|
|
193
|
+
{col.isForeignKey && !col.isPrimaryKey && (
|
|
194
|
+
<Tooltip title={`FK → ${col.relationName ?? "?"}`}>
|
|
195
|
+
<span className="text-blue-400 text-[10px] font-bold">🔗</span>
|
|
196
|
+
</Tooltip>
|
|
197
|
+
)}
|
|
198
|
+
</span>
|
|
199
|
+
|
|
200
|
+
<Typography
|
|
201
|
+
variant="caption"
|
|
202
|
+
className={cls(
|
|
203
|
+
"font-mono text-[11px] truncate flex-1 min-w-0",
|
|
204
|
+
col.isPrimaryKey
|
|
205
|
+
? "font-semibold text-amber-700 dark:text-amber-400"
|
|
206
|
+
: col.isForeignKey
|
|
207
|
+
? "text-blue-600 dark:text-blue-400"
|
|
208
|
+
: "text-text-primary dark:text-text-primary-dark"
|
|
209
|
+
)}
|
|
210
|
+
>
|
|
211
|
+
{col.name}
|
|
212
|
+
</Typography>
|
|
213
|
+
|
|
214
|
+
{col.isEnum ? (
|
|
215
|
+
<Chip
|
|
216
|
+
size="smallest"
|
|
217
|
+
className="bg-violet-100 text-violet-700 dark:bg-violet-900/30 dark:text-violet-400 border-violet-200 dark:border-violet-800 text-[9px] py-0"
|
|
218
|
+
>
|
|
219
|
+
enum
|
|
220
|
+
</Chip>
|
|
221
|
+
) : (
|
|
222
|
+
<Typography
|
|
223
|
+
variant="caption"
|
|
224
|
+
className="text-[10px] text-text-disabled dark:text-text-disabled-dark font-mono shrink-0"
|
|
225
|
+
>
|
|
226
|
+
{col.typeLabel}
|
|
227
|
+
</Typography>
|
|
228
|
+
)}
|
|
229
|
+
|
|
230
|
+
{col.isRequired && !col.isPrimaryKey && (
|
|
231
|
+
<Tooltip title="Required">
|
|
232
|
+
<span className="text-red-400 text-[9px]">•</span>
|
|
233
|
+
</Tooltip>
|
|
234
|
+
)}
|
|
235
|
+
</div>
|
|
236
|
+
))}
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
{/* ── Handles at node root ── */}
|
|
240
|
+
{handles.map((h) => (
|
|
241
|
+
<Handle
|
|
242
|
+
key={h.id}
|
|
243
|
+
id={h.id}
|
|
244
|
+
type={h.type}
|
|
245
|
+
position={h.position}
|
|
246
|
+
style={{ top: h.top }}
|
|
247
|
+
className={cls(
|
|
248
|
+
"!w-2 !h-2 !border-2 !border-white dark:!border-surface-900",
|
|
249
|
+
h.type === "source" ? "!bg-blue-400" : "!bg-amber-400"
|
|
250
|
+
)}
|
|
251
|
+
/>
|
|
252
|
+
))}
|
|
253
|
+
</div>
|
|
254
|
+
);
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
export const TableNode = memo(TableNodeInner);
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import dagre from "dagre";
|
|
2
|
+
import type { Node, Edge } from "@xyflow/react";
|
|
3
|
+
|
|
4
|
+
// ─── Layout Constants ─────────────────────────────────────────────────
|
|
5
|
+
export const NODE_WIDTH = 280;
|
|
6
|
+
/** Header with a single line of text (junction tables or tableName === collectionName). */
|
|
7
|
+
export const HEADER_HEIGHT_SINGLE = 33;
|
|
8
|
+
/** Header with two lines (name + subtitle when collectionName !== tableName). */
|
|
9
|
+
export const HEADER_HEIGHT_DOUBLE = 47;
|
|
10
|
+
const ROW_HEIGHT = 28; // height per column row
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Compute the correct header height for a table node.
|
|
14
|
+
*/
|
|
15
|
+
export const getHeaderHeight = (opts: {
|
|
16
|
+
isJunction: boolean;
|
|
17
|
+
collectionName: string;
|
|
18
|
+
tableName: string;
|
|
19
|
+
}): number => {
|
|
20
|
+
if (opts.isJunction) return HEADER_HEIGHT_SINGLE;
|
|
21
|
+
return opts.collectionName !== opts.tableName
|
|
22
|
+
? HEADER_HEIGHT_DOUBLE
|
|
23
|
+
: HEADER_HEIGHT_SINGLE;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Estimate the pixel height of a table node based on column count.
|
|
28
|
+
*/
|
|
29
|
+
export const estimateNodeHeight = (columnCount: number, headerHeight: number = HEADER_HEIGHT_DOUBLE): number =>
|
|
30
|
+
headerHeight + Math.max(columnCount, 1) * ROW_HEIGHT + 4; // +4 for bottom padding
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Get the vertical center Y of a specific column row (0-indexed)
|
|
34
|
+
* relative to the top of the node.
|
|
35
|
+
*/
|
|
36
|
+
export const getColumnRowY = (rowIndex: number, headerHeight: number = HEADER_HEIGHT_DOUBLE): number =>
|
|
37
|
+
headerHeight + rowIndex * ROW_HEIGHT + ROW_HEIGHT / 2;
|
|
38
|
+
|
|
39
|
+
// ─── Auto-Layout via Dagre ────────────────────────────────────────────
|
|
40
|
+
|
|
41
|
+
export type LayoutDirection = "TB" | "LR";
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Compute node positions using the dagre graph layout engine.
|
|
45
|
+
* Returns a new array of nodes with updated `position`.
|
|
46
|
+
*/
|
|
47
|
+
export const getLayoutedElements = (
|
|
48
|
+
nodes: Node[],
|
|
49
|
+
edges: Edge[],
|
|
50
|
+
direction: LayoutDirection = "LR"
|
|
51
|
+
): { nodes: Node[]; edges: Edge[] } => {
|
|
52
|
+
const g = new dagre.graphlib.Graph();
|
|
53
|
+
g.setGraph({
|
|
54
|
+
rankdir: direction,
|
|
55
|
+
nodesep: 100,
|
|
56
|
+
ranksep: 180,
|
|
57
|
+
edgesep: 60,
|
|
58
|
+
marginx: 60,
|
|
59
|
+
marginy: 60
|
|
60
|
+
});
|
|
61
|
+
g.setDefaultEdgeLabel(() => ({}));
|
|
62
|
+
|
|
63
|
+
const nodeHeights = new Map<string, number>();
|
|
64
|
+
|
|
65
|
+
nodes.forEach((node) => {
|
|
66
|
+
const data = node.data as { columns?: unknown[]; isJunction?: boolean; collectionName?: string; tableName?: string };
|
|
67
|
+
const columnCount = data.columns?.length ?? 3;
|
|
68
|
+
const headerH = getHeaderHeight({
|
|
69
|
+
isJunction: Boolean(data.isJunction),
|
|
70
|
+
collectionName: data.collectionName ?? "",
|
|
71
|
+
tableName: data.tableName ?? ""
|
|
72
|
+
});
|
|
73
|
+
const h = estimateNodeHeight(columnCount, headerH);
|
|
74
|
+
nodeHeights.set(node.id, h);
|
|
75
|
+
g.setNode(node.id, {
|
|
76
|
+
width: NODE_WIDTH,
|
|
77
|
+
height: h
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
edges.forEach((edge) => {
|
|
82
|
+
g.setEdge(edge.source, edge.target);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
dagre.layout(g);
|
|
86
|
+
|
|
87
|
+
const layoutedNodes = nodes.map((node) => {
|
|
88
|
+
const nodeWithPosition = g.node(node.id);
|
|
89
|
+
const h = nodeHeights.get(node.id) ?? estimateNodeHeight(3);
|
|
90
|
+
return {
|
|
91
|
+
...node,
|
|
92
|
+
data: {
|
|
93
|
+
...node.data,
|
|
94
|
+
layoutDirection: direction
|
|
95
|
+
},
|
|
96
|
+
position: {
|
|
97
|
+
x: nodeWithPosition.x - NODE_WIDTH / 2,
|
|
98
|
+
y: nodeWithPosition.y - h / 2
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
return { nodes: layoutedNodes,
|
|
104
|
+
edges };
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// ─── Column type → display label ──────────────────────────────────────
|
|
108
|
+
|
|
109
|
+
const TYPE_LABELS: Record<string, string> = {
|
|
110
|
+
string: "varchar",
|
|
111
|
+
number: "integer",
|
|
112
|
+
boolean: "boolean",
|
|
113
|
+
date: "timestamp",
|
|
114
|
+
map: "jsonb",
|
|
115
|
+
array: "jsonb",
|
|
116
|
+
relation: "FK"
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export const getTypeLabel = (type: string): string =>
|
|
120
|
+
TYPE_LABELS[type] ?? type;
|
|
121
|
+
|
|
122
|
+
// ─── Edge styling by relation type ────────────────────────────────────
|
|
123
|
+
|
|
124
|
+
export interface RelationEdgeData {
|
|
125
|
+
cardinality: "one" | "many";
|
|
126
|
+
direction: "owning" | "inverse";
|
|
127
|
+
relationName: string;
|
|
128
|
+
hasJunction: boolean;
|
|
129
|
+
hasJoinPath: boolean;
|
|
130
|
+
label: string;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export const getCardinalityLabel = (
|
|
134
|
+
cardinality: "one" | "many",
|
|
135
|
+
direction: "owning" | "inverse"
|
|
136
|
+
): string => {
|
|
137
|
+
if (cardinality === "many") return "M:N";
|
|
138
|
+
if (direction === "inverse") return "1:1 ←";
|
|
139
|
+
return "N:1";
|
|
140
|
+
};
|