@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,21 @@
|
|
|
1
|
+
import type { RebasePlugin } from "@rebasepro/types";
|
|
2
|
+
import React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Wraps children with all provider components from plugins that match the given scope.
|
|
5
|
+
*
|
|
6
|
+
* Replaces the 3 copy-pasted `plugins.forEach(plugin => { if (plugin.form?.provider) ... })` patterns
|
|
7
|
+
* in Rebase.tsx, EntityEditView.tsx, and PopupFormField.tsx.
|
|
8
|
+
*
|
|
9
|
+
* @param plugins - Array of plugins to extract providers from.
|
|
10
|
+
* @param scope - `"root"` or `"form"` — which providers to apply.
|
|
11
|
+
* @param scopeProps - Additional props passed to each provider component.
|
|
12
|
+
* @param children - The content to wrap.
|
|
13
|
+
*
|
|
14
|
+
* @group Core
|
|
15
|
+
*/
|
|
16
|
+
export declare function PluginProviderStack({ plugins, scope, scopeProps, children }: {
|
|
17
|
+
plugins: RebasePlugin[];
|
|
18
|
+
scope: "root" | "form";
|
|
19
|
+
scopeProps?: Record<string, unknown>;
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
}): React.ReactNode;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RebaseProps } from "./RebaseProps";
|
|
2
|
+
import { User } from "@rebasepro/types";
|
|
3
|
+
/**
|
|
4
|
+
* If you are using independent components of the CMS
|
|
5
|
+
* you need to wrap them with this main component, so the internal hooks work.
|
|
6
|
+
*
|
|
7
|
+
* This is the main component of Rebase. It acts as the provider of all the
|
|
8
|
+
* internal contexts and hooks.
|
|
9
|
+
*
|
|
10
|
+
* You only need to use this component if you are building a custom app.
|
|
11
|
+
*
|
|
12
|
+
* @group Core
|
|
13
|
+
*/
|
|
14
|
+
export declare function Rebase<USER extends User>(props: RebaseProps<USER>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Locale, User, AuthController, AnalyticsEvent, DataDriver, StorageSource, UserConfigurationPersistence, DatabaseAdmin, RebaseData, RebaseClient, RebaseContext, UserManagementDelegate, EntityLinkBuilder, RebasePlugin, SlotContribution, PropertyConfig, EntityCustomView, EntityAction } from "@rebasepro/types";
|
|
3
|
+
/**
|
|
4
|
+
* Controller to simulate different roles when dev mode is active.
|
|
5
|
+
* @group Models
|
|
6
|
+
*/
|
|
7
|
+
export interface EffectiveRoleController {
|
|
8
|
+
effectiveRole: string | null;
|
|
9
|
+
setEffectiveRole: (role: string | null) => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @group Models
|
|
13
|
+
*/
|
|
14
|
+
export type RebaseProps<USER extends User> = {
|
|
15
|
+
/**
|
|
16
|
+
* The root components of your application. Use RebaseCMS, RebaseStudio, and RebaseShell.
|
|
17
|
+
* Alternatively, pass a render function that receives { context, loading }.
|
|
18
|
+
*/
|
|
19
|
+
children: React.ReactNode | ((props: {
|
|
20
|
+
context: RebaseContext;
|
|
21
|
+
loading: boolean;
|
|
22
|
+
}) => React.ReactNode);
|
|
23
|
+
/**
|
|
24
|
+
* Optional base path for the entire Rebase app.
|
|
25
|
+
* Defaults to "/"
|
|
26
|
+
*/
|
|
27
|
+
basePath?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Optional base path for the CMS collections.
|
|
30
|
+
* Defaults to "/c"
|
|
31
|
+
*/
|
|
32
|
+
baseCollectionPath?: string;
|
|
33
|
+
/**
|
|
34
|
+
* If you have a custom API key, you can use it here.
|
|
35
|
+
*/
|
|
36
|
+
apiKey?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Base URL for the backend API (e.g. "http://localhost:3001").
|
|
39
|
+
* When provided, this is available via `useApiConfig()` to any hook
|
|
40
|
+
* in the tree, reducing repetitive `apiUrl` threading.
|
|
41
|
+
*/
|
|
42
|
+
apiUrl?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Format of the dates in the CMS.
|
|
45
|
+
* Defaults to 'MMMM dd, yyyy, HH:mm:ss'
|
|
46
|
+
*/
|
|
47
|
+
dateTimeFormat?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Locale of the CMS, currently only affecting dates
|
|
50
|
+
*/
|
|
51
|
+
locale?: Locale;
|
|
52
|
+
/**
|
|
53
|
+
* Unified RebaseClient for data, auth, and storage.
|
|
54
|
+
*/
|
|
55
|
+
client?: RebaseClient;
|
|
56
|
+
/**
|
|
57
|
+
* Optional override for RebaseData if not using `client`
|
|
58
|
+
*/
|
|
59
|
+
data?: RebaseData;
|
|
60
|
+
/**
|
|
61
|
+
* Optional override for DataDriver if not using `client`
|
|
62
|
+
*/
|
|
63
|
+
driver?: DataDriver;
|
|
64
|
+
/**
|
|
65
|
+
* Optional override for AuthController if not using `client`
|
|
66
|
+
*/
|
|
67
|
+
authController?: AuthController<USER>;
|
|
68
|
+
/**
|
|
69
|
+
* Optional override for StorageSource if not using `client`
|
|
70
|
+
*/
|
|
71
|
+
storageSource?: StorageSource;
|
|
72
|
+
/**
|
|
73
|
+
* Administrative database operations (SQL, schema discovery).
|
|
74
|
+
* Only needed when the studio/admin features are enabled.
|
|
75
|
+
*/
|
|
76
|
+
databaseAdmin?: DatabaseAdmin;
|
|
77
|
+
/**
|
|
78
|
+
* Use this controller to access the configuration that is stored locally,
|
|
79
|
+
* and not defined in code
|
|
80
|
+
*/
|
|
81
|
+
userConfigPersistence?: UserConfigurationPersistence;
|
|
82
|
+
/**
|
|
83
|
+
* Callback used to get analytics events from the CMS
|
|
84
|
+
*/
|
|
85
|
+
onAnalyticsEvent?: (event: AnalyticsEvent, data?: object) => void;
|
|
86
|
+
/**
|
|
87
|
+
* Optional link builder you can add to generate a button in your entity forms.
|
|
88
|
+
* The function must return a URL that gets opened when the button is clicked
|
|
89
|
+
*/
|
|
90
|
+
entityLinkBuilder?: EntityLinkBuilder;
|
|
91
|
+
/**
|
|
92
|
+
* You can use this props to provide your own user management implementation.
|
|
93
|
+
* Note that this will not affect the UI, but it will be used to show user information
|
|
94
|
+
* in various places of the CMS, for example, to show who created or modified an entity,
|
|
95
|
+
* or to assign ownership of an entity.
|
|
96
|
+
*
|
|
97
|
+
* You can also use this data to be retrieved in your custom properties,
|
|
98
|
+
* for example, to show a list of users in a dropdown.
|
|
99
|
+
*
|
|
100
|
+
* If you are using the Rebase user management plugin, this
|
|
101
|
+
* prop will be implemented automatically.
|
|
102
|
+
*/
|
|
103
|
+
userManagement?: UserManagementDelegate<USER>;
|
|
104
|
+
/**
|
|
105
|
+
* Plugins loaded in the CMS
|
|
106
|
+
*/
|
|
107
|
+
plugins?: RebasePlugin[];
|
|
108
|
+
/**
|
|
109
|
+
* Extra slots for the CMS
|
|
110
|
+
*/
|
|
111
|
+
slots?: SlotContribution[];
|
|
112
|
+
/**
|
|
113
|
+
* Property configs (widgets)
|
|
114
|
+
*/
|
|
115
|
+
propertyConfigs?: Record<string, PropertyConfig>;
|
|
116
|
+
/**
|
|
117
|
+
* Entity Views
|
|
118
|
+
*/
|
|
119
|
+
entityViews?: EntityCustomView<any>[];
|
|
120
|
+
/**
|
|
121
|
+
* Entity Actions
|
|
122
|
+
*/
|
|
123
|
+
entityActions?: EntityAction[];
|
|
124
|
+
components?: {
|
|
125
|
+
/**
|
|
126
|
+
* Component to render when a reference is missing
|
|
127
|
+
*/
|
|
128
|
+
missingReference?: React.ComponentType<{
|
|
129
|
+
path: string;
|
|
130
|
+
}>;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Controller to simulate different roles when dev mode is active.
|
|
134
|
+
*/
|
|
135
|
+
effectiveRoleController?: EffectiveRoleController;
|
|
136
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* A drop-in replacement for react-router's `<Routes>` that preserves the
|
|
4
|
+
* underlying view when a side dialog navigates the URL to a different path.
|
|
5
|
+
*
|
|
6
|
+
* When opening a side dialog from e.g. `/posts` to `authors/123#side`,
|
|
7
|
+
* the `base_location` stored in router state is used so the route tree
|
|
8
|
+
* keeps rendering the original `/posts` view underneath the dialog overlay.
|
|
9
|
+
*
|
|
10
|
+
* Additionally, registered views from `useNavigationStateController()` are
|
|
11
|
+
* automatically routed — no need to manually map them to `<Route>` elements.
|
|
12
|
+
* Views with `nestedRoutes: true` get a wildcard route (slug/*) as well.
|
|
13
|
+
* Explicitly declared `children` routes take priority.
|
|
14
|
+
*/
|
|
15
|
+
export declare function RebaseRoutes({ children }: {
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for API connectivity. Passed once at the top level
|
|
4
|
+
* and available to any hook that needs `apiUrl` or `getAuthToken`.
|
|
5
|
+
*
|
|
6
|
+
* Individual hooks can still accept explicit overrides — this context
|
|
7
|
+
* serves as a fallback to eliminate repetitive threading.
|
|
8
|
+
*/
|
|
9
|
+
export interface ApiConfig {
|
|
10
|
+
apiUrl: string;
|
|
11
|
+
getAuthToken?: () => Promise<string | null>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Read the API config from context. Returns `undefined` if no provider is present,
|
|
15
|
+
* allowing hooks to fall back to their own props.
|
|
16
|
+
*/
|
|
17
|
+
export declare function useApiConfig(): ApiConfig | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Provide API configuration (apiUrl, getAuthToken) to the entire subtree.
|
|
20
|
+
* Typically rendered inside `<Rebase>` or at the app root.
|
|
21
|
+
*/
|
|
22
|
+
export declare function ApiConfigProvider({ apiUrl, getAuthToken, children }: ApiConfig & {
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { EntityCollection } from "@rebasepro/types";
|
|
2
|
+
import { DeleteEntityProps, Entity, EntityCallbacks, RebaseContext, User } from "@rebasepro/types";
|
|
3
|
+
import { RebaseData } from "@rebasepro/types";
|
|
4
|
+
/**
|
|
5
|
+
* @group Hooks and utilities
|
|
6
|
+
*/
|
|
7
|
+
export type DeleteEntityWithCallbacksProps<M extends Record<string, any>, USER extends User = User> = DeleteEntityProps<M> & {
|
|
8
|
+
callbacks?: EntityCallbacks<M, USER>;
|
|
9
|
+
onDeleteSuccess?: (entity: Entity<M>) => void;
|
|
10
|
+
onDeleteFailure?: (entity: Entity<M>, e: Error) => void;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* This function is in charge of deleting an entity.
|
|
14
|
+
* It will run all the delete callbacks specified in the collection.
|
|
15
|
+
* It is also possible to attach callbacks on save success or error, and callback
|
|
16
|
+
* errors.
|
|
17
|
+
*
|
|
18
|
+
* @param data
|
|
19
|
+
* @param entity
|
|
20
|
+
* @param collection
|
|
21
|
+
* @param callbacks
|
|
22
|
+
* @param onDeleteSuccess
|
|
23
|
+
* @param onDeleteFailure
|
|
24
|
+
* @param context
|
|
25
|
+
* @group Hooks and utilities
|
|
26
|
+
*/
|
|
27
|
+
export declare function deleteEntityWithCallbacks<M extends Record<string, any>, USER extends User>({ data, entity, collection, callbacks, onDeleteSuccess, onDeleteFailure, context }: DeleteEntityWithCallbacksProps<M> & {
|
|
28
|
+
collection: EntityCollection<M>;
|
|
29
|
+
data: RebaseData;
|
|
30
|
+
context: RebaseContext<USER>;
|
|
31
|
+
}): Promise<boolean>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { EntityCollection } from "@rebasepro/types";
|
|
2
|
+
import { Entity, RebaseContext, SaveEntityProps } from "@rebasepro/types";
|
|
3
|
+
import { RebaseData } from "@rebasepro/types";
|
|
4
|
+
/**
|
|
5
|
+
* @group Hooks and utilities
|
|
6
|
+
*/
|
|
7
|
+
export type SaveEntityWithCallbacksProps<M extends Record<string, any>> = SaveEntityProps<M> & {
|
|
8
|
+
afterSave?: (updatedEntity: Entity<M>) => void;
|
|
9
|
+
afterSaveError?: (e: Error) => void;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* This function is in charge of saving an entity.
|
|
13
|
+
* It will run all the save callbacks specified in the collection.
|
|
14
|
+
* It is also possible to attach callbacks on save success or error, and callback
|
|
15
|
+
* errors.
|
|
16
|
+
*
|
|
17
|
+
* @param collection
|
|
18
|
+
* @param path
|
|
19
|
+
* @param entityId
|
|
20
|
+
* @param callbacks
|
|
21
|
+
* @param values
|
|
22
|
+
* @param previousValues
|
|
23
|
+
* @param status
|
|
24
|
+
* @param data
|
|
25
|
+
* @param context
|
|
26
|
+
* @param afterSave
|
|
27
|
+
* @param afterSaveError
|
|
28
|
+
* @group Hooks and utilities
|
|
29
|
+
*/
|
|
30
|
+
export declare function saveEntityWithCallbacks<M extends Record<string, any>>({ collection, path, entityId, values, previousValues, status, data, context, afterSave, afterSaveError }: SaveEntityWithCallbacksProps<M> & {
|
|
31
|
+
collection: EntityCollection;
|
|
32
|
+
data: RebaseData;
|
|
33
|
+
context: RebaseContext;
|
|
34
|
+
}): Promise<Entity<M>>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { EntityCollection } from "@rebasepro/types";
|
|
2
|
+
import { Entity, FilterValues, User } from "@rebasepro/types";
|
|
3
|
+
/**
|
|
4
|
+
* @group Hooks and utilities
|
|
5
|
+
*/
|
|
6
|
+
export interface CollectionFetchProps<M extends Record<string, any>> {
|
|
7
|
+
/**
|
|
8
|
+
* Absolute collection path
|
|
9
|
+
*/
|
|
10
|
+
path: string;
|
|
11
|
+
/**
|
|
12
|
+
* collection of the entity displayed by this collection
|
|
13
|
+
*/
|
|
14
|
+
collection: EntityCollection<M>;
|
|
15
|
+
/**
|
|
16
|
+
* Number of entities to fetch
|
|
17
|
+
*/
|
|
18
|
+
itemCount?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Filter the fetched data by the property
|
|
21
|
+
*/
|
|
22
|
+
filterValues?: FilterValues<Extract<keyof M, string>>;
|
|
23
|
+
/**
|
|
24
|
+
* Sort the results by
|
|
25
|
+
*/
|
|
26
|
+
sortBy?: [Extract<keyof M, string>, "asc" | "desc"];
|
|
27
|
+
/**
|
|
28
|
+
* Search string
|
|
29
|
+
*/
|
|
30
|
+
searchString?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* @group Hooks and utilities
|
|
34
|
+
*/
|
|
35
|
+
export interface CollectionFetchResult<M extends Record<string, any>> {
|
|
36
|
+
data: Entity<M>[];
|
|
37
|
+
dataLoading: boolean;
|
|
38
|
+
noMoreToLoad: boolean;
|
|
39
|
+
dataLoadingError?: Error;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* This hook is used to fetch collections using a given collection
|
|
43
|
+
* @param path
|
|
44
|
+
* @param collection
|
|
45
|
+
* @param filterValues
|
|
46
|
+
* @param sortBy
|
|
47
|
+
* @param itemCount
|
|
48
|
+
* @param searchString
|
|
49
|
+
* @group Hooks and utilities
|
|
50
|
+
*/
|
|
51
|
+
export declare function useCollectionFetch<M extends Record<string, any>, USER extends User>({ path, collection, filterValues, sortBy, itemCount, searchString }: CollectionFetchProps<M>): CollectionFetchResult<M>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RebaseData } from "@rebasepro/types";
|
|
2
|
+
/**
|
|
3
|
+
* Use this hook to access the unified data API.
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* const data = useData();
|
|
7
|
+
* const { data: products } = await data.products.find({ where: { status: "eq.published" } });
|
|
8
|
+
* await data.products.create({ name: "Camera", price: 299 });
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* @group Hooks and utilities
|
|
12
|
+
*/
|
|
13
|
+
export declare const useData: () => RebaseData;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Entity } from "@rebasepro/types";
|
|
2
|
+
export interface DataOrderProps<M extends Record<string, any>> {
|
|
3
|
+
data: Entity<M>[];
|
|
4
|
+
entitiesDisplayedFirst?: Entity<M>[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* This hook is used to have some entities at the beginning of data.
|
|
8
|
+
* @param path
|
|
9
|
+
* @param entitiesDisplayedFirst
|
|
10
|
+
* @group Hooks and utilities
|
|
11
|
+
*/
|
|
12
|
+
export declare function useDataOrder<M extends Record<string, any>>({ data, entitiesDisplayedFirst }: DataOrderProps<M>): Entity<M>[];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { EntityCollection } from "@rebasepro/types";
|
|
2
|
+
import { Entity, User } from "@rebasepro/types";
|
|
3
|
+
/**
|
|
4
|
+
* @group Hooks and utilities
|
|
5
|
+
*/
|
|
6
|
+
export interface EntityFetchProps<M extends Record<string, any>, USER extends User = User> {
|
|
7
|
+
path: string;
|
|
8
|
+
entityId?: string | number;
|
|
9
|
+
databaseId?: string;
|
|
10
|
+
collection: EntityCollection<M, USER>;
|
|
11
|
+
useCache?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @group Hooks and utilities
|
|
15
|
+
*/
|
|
16
|
+
export interface EntityFetchResult<M extends Record<string, any>> {
|
|
17
|
+
entity?: Entity<M>;
|
|
18
|
+
dataLoading: boolean;
|
|
19
|
+
dataLoadingError?: Error;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Pre-populate the entity fetch cache with entities loaded from a collection.
|
|
23
|
+
* This allows entity detail views to render instantly using cached data,
|
|
24
|
+
* while the background fetch/listener brings in fresh data.
|
|
25
|
+
* @param path - The collection path (e.g. "products")
|
|
26
|
+
* @param entities - Array of entities to cache
|
|
27
|
+
*/
|
|
28
|
+
export declare function populateEntityFetchCache<M extends Record<string, any>>(path: string, entities: Entity<M>[]): void;
|
|
29
|
+
/**
|
|
30
|
+
* This hook is used to fetch an entity.
|
|
31
|
+
* It gives real time updates if the driver supports it.
|
|
32
|
+
* @param path
|
|
33
|
+
* @param collection
|
|
34
|
+
* @param entityId
|
|
35
|
+
* @param useCache
|
|
36
|
+
* @group Hooks and utilities
|
|
37
|
+
*/
|
|
38
|
+
export declare function useEntityFetch<M extends Record<string, any>, USER extends User = User>({ path, entityId, collection, databaseId, useCache }: EntityFetchProps<M, USER>): EntityFetchResult<M>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { EntityCollection } from "@rebasepro/types";
|
|
2
|
+
import { Entity, EntityRelation, FilterValues } from "@rebasepro/types";
|
|
3
|
+
export interface RelationItem {
|
|
4
|
+
id: string | number;
|
|
5
|
+
label: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
data: Entity<any>;
|
|
8
|
+
relation: EntityRelation;
|
|
9
|
+
}
|
|
10
|
+
export interface UseRelationSelectorProps<M extends Record<string, any> = any> {
|
|
11
|
+
/**
|
|
12
|
+
* Full path where the relation data is located
|
|
13
|
+
*/
|
|
14
|
+
path: string;
|
|
15
|
+
/**
|
|
16
|
+
* The collection that represents the relation entities
|
|
17
|
+
*/
|
|
18
|
+
collection: EntityCollection<M>;
|
|
19
|
+
/**
|
|
20
|
+
* Force filter to be applied to the relation search
|
|
21
|
+
*/
|
|
22
|
+
forceFilter?: FilterValues<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Page size for pagination
|
|
25
|
+
*/
|
|
26
|
+
pageSize?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Function to extract the label from an entity
|
|
29
|
+
*/
|
|
30
|
+
getLabelFromEntity?: (entity: Entity<M>) => string;
|
|
31
|
+
/**
|
|
32
|
+
* Function to extract the description from an entity
|
|
33
|
+
*/
|
|
34
|
+
getDescriptionFromEntity?: (entity: Entity<M>) => string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Property name to use as the secondary display field
|
|
37
|
+
*/
|
|
38
|
+
descriptionProperty?: keyof M;
|
|
39
|
+
}
|
|
40
|
+
export interface RelationSelectorController {
|
|
41
|
+
items: RelationItem[];
|
|
42
|
+
isLoading: boolean;
|
|
43
|
+
error: Error | undefined;
|
|
44
|
+
search: (searchString: string) => void;
|
|
45
|
+
loadMore: () => void;
|
|
46
|
+
hasMore: boolean;
|
|
47
|
+
entityToRelationItem: (entity: Entity<any>, relation: EntityRelation) => RelationItem;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Hook to manage relation selection with data fetching from Rebase data source
|
|
51
|
+
*/
|
|
52
|
+
export declare function useRelationSelector<M extends Record<string, any> = any>({ path, collection, forceFilter, pageSize, getLabelFromEntity, getDescriptionFromEntity, descriptionProperty }: UseRelationSelectorProps<M>): RelationSelectorController;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { User } from "@rebasepro/types";
|
|
2
|
+
export interface UserSelectorItem {
|
|
3
|
+
uid: string;
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
user: User;
|
|
7
|
+
}
|
|
8
|
+
export interface UseUserSelectorProps {
|
|
9
|
+
/**
|
|
10
|
+
* Page size for pagination. Defaults to 10.
|
|
11
|
+
*/
|
|
12
|
+
pageSize?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface UserSelectorController {
|
|
15
|
+
items: UserSelectorItem[];
|
|
16
|
+
isLoading: boolean;
|
|
17
|
+
error: Error | undefined;
|
|
18
|
+
search: (searchString: string) => void;
|
|
19
|
+
loadMore: () => void;
|
|
20
|
+
hasMore: boolean;
|
|
21
|
+
getUser: (uid: string) => User | null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Hook to manage user selection with server-side search and pagination.
|
|
25
|
+
* Similar to useRelationSelector but for the UserManagementDelegate.
|
|
26
|
+
*
|
|
27
|
+
* If the delegate provides `searchUsers`, this hook uses server-side
|
|
28
|
+
* search/pagination. Otherwise it falls back to client-side filtering
|
|
29
|
+
* over the in-memory `users` array.
|
|
30
|
+
*/
|
|
31
|
+
export declare function useUserSelector({ pageSize }?: UseUserSelectorProps): UserSelectorController;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export * from "./data/useData";
|
|
2
|
+
export * from "./data/useCollectionFetch";
|
|
3
|
+
export * from "./data/useEntityFetch";
|
|
4
|
+
export * from "./data/useRelationSelector";
|
|
5
|
+
export * from "./data/useUserSelector";
|
|
6
|
+
export * from "./data/save";
|
|
7
|
+
export * from "./data/delete";
|
|
8
|
+
export * from "./useUnsavedChangesDialog";
|
|
9
|
+
export * from "./useStorageSource";
|
|
10
|
+
export * from "./useAuthController";
|
|
11
|
+
export * from "./useAuthSubscription";
|
|
12
|
+
export * from "./useDialogsController";
|
|
13
|
+
export * from "./useAdminModeController";
|
|
14
|
+
export * from "./useBuildAdminModeController";
|
|
15
|
+
export * from "./useEffectiveRoleController";
|
|
16
|
+
export * from "./useBuildEffectiveRoleController";
|
|
17
|
+
export * from "./useRebaseContext";
|
|
18
|
+
export * from "./useSnackbarController";
|
|
19
|
+
export * from "./useModeController";
|
|
20
|
+
export * from "./useClipboard";
|
|
21
|
+
export * from "./useLargeLayout";
|
|
22
|
+
export * from "./useCollapsedGroups";
|
|
23
|
+
export * from "./useInternalUserManagementController";
|
|
24
|
+
export * from "./useBrowserTitleAndIcon";
|
|
25
|
+
export * from "./useSlot";
|
|
26
|
+
export * from "./useCustomizationController";
|
|
27
|
+
export * from "./useBuildLocalConfigurationPersistence";
|
|
28
|
+
export * from "./useBuildModeController";
|
|
29
|
+
export * from "./useValidateAuthenticator";
|
|
30
|
+
export * from "./useRebaseRegistry";
|
|
31
|
+
export * from "./useBackendStorageSource";
|
|
32
|
+
export * from "./usePermissions";
|
|
33
|
+
export * from "./ApiConfigContext";
|
|
34
|
+
export * from "./useTranslation";
|
|
35
|
+
export * from "./useRebaseClient";
|
|
36
|
+
export * from "./useAnalyticsController";
|
|
37
|
+
export * from "./useUserConfigurationPersistence";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Use this controller to change the admin mode (developer vs editor)
|
|
3
|
+
* @group Hooks and utilities
|
|
4
|
+
*/
|
|
5
|
+
export interface AdminModeController {
|
|
6
|
+
mode: "content" | "studio" | "settings";
|
|
7
|
+
setMode: (mode: "content" | "studio" | "settings") => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Hook to retrieve the current admin mode ("developer" | "editor"), and `setMode`
|
|
11
|
+
* to change it.
|
|
12
|
+
*
|
|
13
|
+
* Consider that in order to use this hook you need to have a parent
|
|
14
|
+
* `Rebase`
|
|
15
|
+
*
|
|
16
|
+
* @see AdminModeController
|
|
17
|
+
* @group Hooks and utilities
|
|
18
|
+
*/
|
|
19
|
+
export declare const useAdminModeController: () => AdminModeController;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AuthController, User } from "@rebasepro/types";
|
|
2
|
+
/**
|
|
3
|
+
* Hook to retrieve the AuthContext.
|
|
4
|
+
*
|
|
5
|
+
* Consider that in order to use this hook you need to have a parent
|
|
6
|
+
* `Rebase`
|
|
7
|
+
*
|
|
8
|
+
* @see AuthController
|
|
9
|
+
* @group Hooks and utilities
|
|
10
|
+
*/
|
|
11
|
+
export declare const useAuthController: <USER extends User = User, AuthControllerType extends AuthController<USER> = AuthController<USER>>() => AuthControllerType;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React hook for using backend storage API as a StorageSource
|
|
3
|
+
*/
|
|
4
|
+
import { StorageSource } from "@rebasepro/types";
|
|
5
|
+
export interface BackendStorageSourceProps {
|
|
6
|
+
/**
|
|
7
|
+
* Backend API URL (e.g., 'http://localhost:3001')
|
|
8
|
+
*/
|
|
9
|
+
apiUrl: string;
|
|
10
|
+
/**
|
|
11
|
+
* Function to get the current auth token
|
|
12
|
+
*/
|
|
13
|
+
getAuthToken: () => Promise<string>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Hook to create a StorageSource that uses the backend storage REST API.
|
|
17
|
+
* Use this for self-hosted Rebase with local or S3 storage.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const storageSource = useBackendStorageSource({
|
|
22
|
+
* apiUrl: 'http://localhost:3001',
|
|
23
|
+
* getAuthToken: authController.getAuthToken
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* // Then pass to Rebase:
|
|
27
|
+
* <Rebase storageSource={storageSource} ... />
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function useBackendStorageSource({ apiUrl, getAuthToken }: BackendStorageSourceProps): StorageSource;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { StudioBridge } from "./useStudioBridge";
|
|
2
|
+
/**
|
|
3
|
+
* Registers a value into the self-assembling Studio bridge.
|
|
4
|
+
*
|
|
5
|
+
* Each controller (collectionRegistry, sideEntity, url, navigation, breadcrumbs)
|
|
6
|
+
* calls this hook on mount to inject its real implementation into the bridge.
|
|
7
|
+
* On unmount the slice is automatically removed, reverting to the noop default.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* ```tsx
|
|
11
|
+
* function SomeProvider({ children }) {
|
|
12
|
+
* const controller = useBuildSomeController();
|
|
13
|
+
* useBridgeRegistration("sideEntityController", controller);
|
|
14
|
+
* return <SomeContext.Provider value={controller}>{children}</SomeContext.Provider>;
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function useBridgeRegistration<K extends keyof StudioBridge>(key: K, value: StudioBridge[K]): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EffectiveRoleController } from "@rebasepro/types";
|
|
2
|
+
/**
|
|
3
|
+
* Use this hook to build an effective role controller that determines
|
|
4
|
+
* what role is simulated in Editor mode when Dev mode is active.
|
|
5
|
+
*
|
|
6
|
+
* It uses localStorage to persist the simulated role across reloads.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useBuildEffectiveRoleController(): EffectiveRoleController;
|