@rebasepro/app 0.0.1-canary.4829d6e
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 +21 -0
- package/README.md +174 -0
- package/dist/auth/api.d.ts +66 -0
- package/dist/auth/index.d.ts +13 -0
- package/dist/auth/types.d.ts +127 -0
- package/dist/auth/useRebaseAuthController.d.ts +13 -0
- package/dist/components/AIIcon.d.ts +17 -0
- package/dist/components/AuthSimulationMenu.d.ts +0 -0
- package/dist/components/ConfirmationDialog.d.ts +9 -0
- package/dist/components/Debug/UIReferenceView.d.ts +13 -0
- package/dist/components/Debug/UIStyleGuide.d.ts +2 -0
- package/dist/components/Debug/collection-views/CardViewDemo.d.ts +2 -0
- package/dist/components/Debug/collection-views/CollectionTableDemo.d.ts +2 -0
- package/dist/components/Debug/collection-views/KanbanBoardDemo.d.ts +2 -0
- package/dist/components/Debug/collection-views/index.d.ts +3 -0
- package/dist/components/Debug/collection-views/sample_data.d.ts +23 -0
- package/dist/components/Debug/crm-dashboard/CalendarWidget.d.ts +22 -0
- package/dist/components/Debug/crm-dashboard/CrmDashboardDemo.d.ts +2 -0
- package/dist/components/Debug/crm-dashboard/DashboardMetrics.d.ts +15 -0
- package/dist/components/Debug/crm-dashboard/PipelineOverview.d.ts +34 -0
- package/dist/components/Debug/crm-dashboard/RecentActivity.d.ts +19 -0
- package/dist/components/Debug/crm-dashboard/TaskFilters.d.ts +30 -0
- package/dist/components/Debug/crm-dashboard/TaskTable.d.ts +50 -0
- package/dist/components/Debug/crm-dashboard/TasksView.d.ts +41 -0
- package/dist/components/ErrorTooltip.d.ts +3 -0
- package/dist/components/ErrorView.d.ts +21 -0
- package/dist/components/LanguageToggle.d.ts +2 -0
- package/dist/components/LoginView/LoginView.d.ts +113 -0
- package/dist/components/LoginView/index.d.ts +2 -0
- package/dist/components/NotFoundPage.d.ts +2 -0
- package/dist/components/RebaseAuth.d.ts +10 -0
- package/dist/components/RebaseLogo.d.ts +7 -0
- package/dist/components/SchemaDriftBanner.d.ts +27 -0
- package/dist/components/UnsavedChangesDialog.d.ts +9 -0
- package/dist/components/UserDisplay.d.ts +7 -0
- package/dist/components/UserSelectPopover.d.ts +63 -0
- package/dist/components/UserSettingsView.d.ts +2 -0
- package/dist/components/common/index.d.ts +6 -0
- package/dist/components/common/table_height.d.ts +5 -0
- package/dist/components/common/types.d.ts +66 -0
- package/dist/components/common/useColumnsIds.d.ts +9 -0
- package/dist/components/common/useDataTableController.d.ts +45 -0
- package/dist/components/common/useDebouncedData.d.ts +9 -0
- package/dist/components/common/useScrollRestoration.d.ts +14 -0
- package/dist/components/index.d.ts +18 -0
- package/dist/contexts/AdminModeController.d.ts +4 -0
- package/dist/contexts/AnalyticsContext.d.ts +3 -0
- package/dist/contexts/AuthControllerContext.d.ts +3 -0
- package/dist/contexts/CollectionScopeContext.d.ts +50 -0
- package/dist/contexts/ComponentOverrideContext.d.ts +42 -0
- package/dist/contexts/CustomizationControllerContext.d.ts +3 -0
- package/dist/contexts/DataDriverContext.d.ts +3 -0
- package/dist/contexts/DataSourcesContext.d.ts +31 -0
- package/dist/contexts/DatabaseAdminContext.d.ts +3 -0
- package/dist/contexts/DialogsProvider.d.ts +4 -0
- package/dist/contexts/EffectiveRoleController.d.ts +4 -0
- package/dist/contexts/ModeController.d.ts +4 -0
- package/dist/contexts/RebaseClientInstanceContext.d.ts +6 -0
- package/dist/contexts/RebaseDataContext.d.ts +3 -0
- package/dist/contexts/SnackbarProvider.d.ts +2 -0
- package/dist/contexts/StorageSourceContext.d.ts +3 -0
- package/dist/contexts/StorageSourcesContext.d.ts +25 -0
- package/dist/contexts/UserConfigurationPersistenceContext.d.ts +3 -0
- package/dist/contexts/index.d.ts +17 -0
- package/dist/core/PluginLifecycleManager.d.ts +17 -0
- package/dist/core/PluginProviderStack.d.ts +21 -0
- package/dist/core/Rebase.d.ts +15 -0
- package/dist/core/RebaseProps.d.ts +291 -0
- package/dist/core/RebaseRouter.d.ts +4 -0
- package/dist/core/RebaseRoutes.d.ts +17 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/hooks/ApiConfigContext.d.ts +24 -0
- package/dist/hooks/data/delete.d.ts +33 -0
- package/dist/hooks/data/save.d.ts +40 -0
- package/dist/hooks/data/useCollection.d.ts +62 -0
- package/dist/hooks/data/useData.d.ts +13 -0
- package/dist/hooks/data/useDataOrder.d.ts +12 -0
- package/dist/hooks/data/useFetch.d.ts +43 -0
- package/dist/hooks/data/useRelationSelector.d.ts +52 -0
- package/dist/hooks/index.d.ts +36 -0
- package/dist/hooks/useAdminModeController.d.ts +19 -0
- package/dist/hooks/useAnalyticsController.d.ts +5 -0
- package/dist/hooks/useAuthController.d.ts +11 -0
- package/dist/hooks/useAuthSubscription.d.ts +2 -0
- package/dist/hooks/useBackendStorageSource.d.ts +30 -0
- package/dist/hooks/useBridgeRegistration.d.ts +18 -0
- package/dist/hooks/useBrowserTitleAndIcon.d.ts +6 -0
- package/dist/hooks/useBuildAdminModeController.d.ts +6 -0
- package/dist/hooks/useBuildEffectiveRoleController.d.ts +8 -0
- package/dist/hooks/useBuildLocalConfigurationPersistence.d.ts +2 -0
- package/dist/hooks/useBuildModeController.d.ts +6 -0
- package/dist/hooks/useClipboard.d.ts +57 -0
- package/dist/hooks/useCollapsedGroups.d.ts +27 -0
- package/dist/hooks/useComponentOverride.d.ts +32 -0
- package/dist/hooks/useCustomizationController.d.ts +11 -0
- package/dist/hooks/useDialogsController.d.ts +11 -0
- package/dist/hooks/useEffectiveRoleController.d.ts +7 -0
- package/dist/hooks/useLargeLayout.d.ts +1 -0
- package/dist/hooks/useModeController.d.ts +19 -0
- package/dist/hooks/usePermissions.d.ts +12 -0
- package/dist/hooks/useRebaseClient.d.ts +5 -0
- package/dist/hooks/useRebaseContext.d.ts +11 -0
- package/dist/hooks/useRebaseRegistry.d.ts +34 -0
- package/dist/hooks/useResolvedComponent.d.ts +47 -0
- package/dist/hooks/useSlot.d.ts +18 -0
- package/dist/hooks/useSnackbarController.d.ts +20 -0
- package/dist/hooks/useStorageSource.d.ts +6 -0
- package/dist/hooks/useStudioBridge.d.ts +79 -0
- package/dist/hooks/useTranslation.d.ts +17 -0
- package/dist/hooks/useUnsavedChangesDialog.d.ts +12 -0
- package/dist/hooks/useUserConfigurationPersistence.d.ts +8 -0
- package/dist/i18n/RebaseI18nProvider.d.ts +33 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.es.js +16843 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +17021 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/internal/common.d.ts +14 -0
- package/dist/internal/useRestoreScroll.d.ts +15 -0
- package/dist/locales/de.d.ts +2 -0
- package/dist/locales/en.d.ts +10 -0
- package/dist/locales/es.d.ts +10 -0
- package/dist/locales/fr.d.ts +2 -0
- package/dist/locales/hi.d.ts +2 -0
- package/dist/locales/it.d.ts +2 -0
- package/dist/locales/pt.d.ts +7 -0
- package/dist/util/constants.d.ts +1 -0
- package/dist/util/createFormexStub.d.ts +2 -0
- package/dist/util/entity_cache.d.ts +22 -0
- package/dist/util/enums.d.ts +5 -0
- package/dist/util/icon_list.d.ts +5 -0
- package/dist/util/icons.d.ts +20 -0
- package/dist/util/index.d.ts +8 -0
- package/dist/util/previews.d.ts +4 -0
- package/dist/util/useStorageUploadController.d.ts +44 -0
- package/dist/vitePlugin.d.ts +60 -0
- package/dist/vitePlugin.js +113 -0
- package/package.json +145 -0
- package/src/auth/api.ts +148 -0
- package/src/auth/index.ts +25 -0
- package/src/auth/types.ts +115 -0
- package/src/auth/useRebaseAuthController.ts +328 -0
- package/src/components/AIIcon.tsx +47 -0
- package/src/components/AuthSimulationMenu.tsx +0 -0
- package/src/components/ConfirmationDialog.tsx +48 -0
- package/src/components/Debug/UIReferenceView.tsx +958 -0
- package/src/components/Debug/UIStyleGuide.tsx +156 -0
- package/src/components/Debug/collection-views/CardViewDemo.tsx +85 -0
- package/src/components/Debug/collection-views/CollectionTableDemo.tsx +107 -0
- package/src/components/Debug/collection-views/KanbanBoardDemo.tsx +90 -0
- package/src/components/Debug/collection-views/index.ts +3 -0
- package/src/components/Debug/collection-views/sample_data.ts +42 -0
- package/src/components/Debug/crm-dashboard/CalendarWidget.tsx +389 -0
- package/src/components/Debug/crm-dashboard/CrmDashboardDemo.tsx +1102 -0
- package/src/components/Debug/crm-dashboard/DashboardMetrics.tsx +133 -0
- package/src/components/Debug/crm-dashboard/PipelineOverview.tsx +290 -0
- package/src/components/Debug/crm-dashboard/RecentActivity.tsx +215 -0
- package/src/components/Debug/crm-dashboard/TaskFilters.tsx +184 -0
- package/src/components/Debug/crm-dashboard/TaskTable.tsx +427 -0
- package/src/components/Debug/crm-dashboard/TasksView.tsx +234 -0
- package/src/components/ErrorTooltip.tsx +12 -0
- package/src/components/ErrorView.tsx +94 -0
- package/src/components/LanguageToggle.tsx +59 -0
- package/src/components/LoginView/LoginView.tsx +932 -0
- package/src/components/LoginView/index.ts +2 -0
- package/src/components/NotFoundPage.tsx +27 -0
- package/src/components/RebaseAuth.tsx +27 -0
- package/src/components/RebaseLogo.tsx +29 -0
- package/src/components/SchemaDriftBanner.tsx +102 -0
- package/src/components/UnsavedChangesDialog.tsx +46 -0
- package/src/components/UserDisplay.tsx +54 -0
- package/src/components/UserSelectPopover.tsx +399 -0
- package/src/components/UserSettingsView.tsx +318 -0
- package/src/components/common/index.ts +6 -0
- package/src/components/common/table_height.tsx +21 -0
- package/src/components/common/types.tsx +66 -0
- package/src/components/common/useColumnsIds.tsx +222 -0
- package/src/components/common/useDataTableController.tsx +514 -0
- package/src/components/common/useDebouncedData.ts +49 -0
- package/src/components/common/useScrollRestoration.tsx +68 -0
- package/src/components/index.tsx +26 -0
- package/src/contexts/AdminModeController.tsx +11 -0
- package/src/contexts/AnalyticsContext.tsx +4 -0
- package/src/contexts/AuthControllerContext.tsx +4 -0
- package/src/contexts/CollectionScopeContext.tsx +67 -0
- package/src/contexts/ComponentOverrideContext.tsx +81 -0
- package/src/contexts/CustomizationControllerContext.tsx +4 -0
- package/src/contexts/DataDriverContext.tsx +4 -0
- package/src/contexts/DataSourcesContext.tsx +36 -0
- package/src/contexts/DatabaseAdminContext.tsx +4 -0
- package/src/contexts/DialogsProvider.tsx +56 -0
- package/src/contexts/EffectiveRoleController.tsx +12 -0
- package/src/contexts/ModeController.tsx +11 -0
- package/src/contexts/RebaseClientInstanceContext.tsx +7 -0
- package/src/contexts/RebaseDataContext.tsx +4 -0
- package/src/contexts/SnackbarProvider.tsx +15 -0
- package/src/contexts/StorageSourceContext.tsx +4 -0
- package/src/contexts/StorageSourcesContext.tsx +30 -0
- package/src/contexts/UserConfigurationPersistenceContext.tsx +4 -0
- package/src/contexts/index.ts +17 -0
- package/src/core/PluginLifecycleManager.tsx +95 -0
- package/src/core/PluginProviderStack.tsx +40 -0
- package/src/core/Rebase.tsx +439 -0
- package/src/core/RebaseProps.tsx +320 -0
- package/src/core/RebaseRouter.tsx +17 -0
- package/src/core/RebaseRoutes.tsx +24 -0
- package/src/core/index.tsx +5 -0
- package/src/hooks/ApiConfigContext.tsx +41 -0
- package/src/hooks/data/delete.ts +55 -0
- package/src/hooks/data/save.ts +77 -0
- package/src/hooks/data/useCollection.tsx +176 -0
- package/src/hooks/data/useData.tsx +18 -0
- package/src/hooks/data/useDataOrder.ts +26 -0
- package/src/hooks/data/useFetch.tsx +140 -0
- package/src/hooks/data/useRelationSelector.tsx +234 -0
- package/src/hooks/index.tsx +45 -0
- package/src/hooks/useAdminModeController.tsx +23 -0
- package/src/hooks/useAnalyticsController.tsx +8 -0
- package/src/hooks/useAuthController.tsx +14 -0
- package/src/hooks/useAuthSubscription.ts +87 -0
- package/src/hooks/useBackendStorageSource.ts +288 -0
- package/src/hooks/useBridgeRegistration.tsx +32 -0
- package/src/hooks/useBrowserTitleAndIcon.tsx +23 -0
- package/src/hooks/useBuildAdminModeController.tsx +24 -0
- package/src/hooks/useBuildEffectiveRoleController.tsx +31 -0
- package/src/hooks/useBuildLocalConfigurationPersistence.tsx +75 -0
- package/src/hooks/useBuildModeController.tsx +71 -0
- package/src/hooks/useClipboard.tsx +158 -0
- package/src/hooks/useCollapsedGroups.ts +116 -0
- package/src/hooks/useComponentOverride.tsx +59 -0
- package/src/hooks/useCustomizationController.tsx +14 -0
- package/src/hooks/useDialogsController.tsx +15 -0
- package/src/hooks/useEffectiveRoleController.tsx +10 -0
- package/src/hooks/useLargeLayout.tsx +65 -0
- package/src/hooks/useModeController.tsx +23 -0
- package/src/hooks/usePermissions.ts +44 -0
- package/src/hooks/useRebaseClient.tsx +10 -0
- package/src/hooks/useRebaseContext.tsx +83 -0
- package/src/hooks/useRebaseRegistry.tsx +91 -0
- package/src/hooks/useResolvedComponent.tsx +159 -0
- package/src/hooks/useSlot.tsx +64 -0
- package/src/hooks/useSnackbarController.tsx +52 -0
- package/src/hooks/useStorageSource.tsx +11 -0
- package/src/hooks/useStudioBridge.tsx +209 -0
- package/src/hooks/useTranslation.ts +33 -0
- package/src/hooks/useUnsavedChangesDialog.tsx +64 -0
- package/src/hooks/useUserConfigurationPersistence.tsx +11 -0
- package/src/i18n/RebaseI18nProvider.tsx +160 -0
- package/src/index.ts +25 -0
- package/src/internal/common.tsx +16 -0
- package/src/internal/useRestoreScroll.tsx +69 -0
- package/src/locales/de.ts +902 -0
- package/src/locales/en.ts +980 -0
- package/src/locales/es.ts +922 -0
- package/src/locales/fr.ts +901 -0
- package/src/locales/hi.ts +901 -0
- package/src/locales/it.ts +901 -0
- package/src/locales/pt.ts +909 -0
- package/src/util/constants.ts +7 -0
- package/src/util/createFormexStub.tsx +66 -0
- package/src/util/entity_cache.ts +239 -0
- package/src/util/enums.ts +32 -0
- package/src/util/icon_list.ts +22 -0
- package/src/util/icons.tsx +149 -0
- package/src/util/index.ts +12 -0
- package/src/util/previews.ts +105 -0
- package/src/util/useStorageUploadController.tsx +350 -0
- package/src/vitePlugin.ts +196 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SlotName, SlotRegistry } from "@rebasepro/types";
|
|
2
|
+
import React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Hook that retrieves and renders all slot contributions for a given slot name.
|
|
5
|
+
*
|
|
6
|
+
* @param slot - The slot name to render contributions for.
|
|
7
|
+
* @param props - Props passed to each slot component.
|
|
8
|
+
* @returns An array of rendered React nodes, each wrapped in an ErrorBoundary.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* const actions = useSlot("home.actions", { context });
|
|
13
|
+
* return <div>{actions}</div>;
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @group Hooks
|
|
17
|
+
*/
|
|
18
|
+
export declare function useSlot<K extends SlotName>(slot: K, props: SlotRegistry[K]): React.ReactNode[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SnackbarMessageType } from "@rebasepro/types";
|
|
2
|
+
import React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Hook to retrieve the SnackbarContext.
|
|
5
|
+
*
|
|
6
|
+
* Consider that in order to use this hook you need to have a parent
|
|
7
|
+
* `Rebase`
|
|
8
|
+
*
|
|
9
|
+
* @see SnackbarController
|
|
10
|
+
* @group Hooks and utilities
|
|
11
|
+
*/
|
|
12
|
+
export declare const useSnackbarController: () => {
|
|
13
|
+
open: (props: {
|
|
14
|
+
type: SnackbarMessageType;
|
|
15
|
+
title?: string;
|
|
16
|
+
message: React.ReactNode;
|
|
17
|
+
autoHideDuration?: number;
|
|
18
|
+
}) => void;
|
|
19
|
+
close: () => void;
|
|
20
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { CollectionRegistryController, SidePanelController, UrlController, NavigationStateController, BreadcrumbEntry, BreadcrumbsController } from "@rebasepro/types";
|
|
3
|
+
export type { BreadcrumbEntry, BreadcrumbsController };
|
|
4
|
+
/**
|
|
5
|
+
* StudioBridge provides optional CMS capabilities to Studio components.
|
|
6
|
+
* When CMS is present, a bridge provider injects real implementations.
|
|
7
|
+
* When CMS is absent, noop defaults ensure Studio works standalone.
|
|
8
|
+
*/
|
|
9
|
+
export interface StudioBridge {
|
|
10
|
+
collectionRegistry: CollectionRegistryController;
|
|
11
|
+
sidePanelController: SidePanelController;
|
|
12
|
+
urlController: UrlController;
|
|
13
|
+
navigationState: NavigationStateController;
|
|
14
|
+
breadcrumbs: BreadcrumbsController;
|
|
15
|
+
}
|
|
16
|
+
export declare const StudioBridgeContext: React.Context<StudioBridge>;
|
|
17
|
+
/**
|
|
18
|
+
* Provider that injects CMS capabilities into Studio.
|
|
19
|
+
* Accepts partial overrides — any field not provided falls back to noop.
|
|
20
|
+
*
|
|
21
|
+
* Usage (in app wiring, when CMS is present):
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <StudioBridgeProvider value={{
|
|
24
|
+
* collectionRegistry: useCollectionRegistryController(),
|
|
25
|
+
* sidePanelController: useSidePanel(),
|
|
26
|
+
* urlController: useUrlController(),
|
|
27
|
+
* navigationState: useNavigationStateController(),
|
|
28
|
+
* breadcrumbs: useBreadcrumbsController(),
|
|
29
|
+
* }}>
|
|
30
|
+
* <RebaseStudio ... />
|
|
31
|
+
* </StudioBridgeProvider>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare function StudioBridgeProvider({ value, children }: {
|
|
35
|
+
value: Partial<StudioBridge>;
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
}): React.JSX.Element;
|
|
38
|
+
/** Collection registry — returns noop if CMS is not present. */
|
|
39
|
+
export declare function useStudioCollectionRegistry(): CollectionRegistryController;
|
|
40
|
+
/** Side panel controller — returns noop if CMS is not present. */
|
|
41
|
+
export declare function useStudioSidePanelController(): SidePanelController;
|
|
42
|
+
/** URL controller — returns noop if CMS is not present. */
|
|
43
|
+
export declare function useStudioUrlController(): UrlController;
|
|
44
|
+
/** Navigation state — returns noop if CMS is not present. */
|
|
45
|
+
export declare function useStudioNavigationState(): NavigationStateController;
|
|
46
|
+
/** Breadcrumbs controller — returns noop if CMS is not present. */
|
|
47
|
+
export declare function useStudioBreadcrumbs(): BreadcrumbsController;
|
|
48
|
+
/**
|
|
49
|
+
* Registry that controllers use to self-register their implementations
|
|
50
|
+
* into the Studio bridge. Each controller calls `register(key, value)`
|
|
51
|
+
* on mount and `unregister(key)` on unmount.
|
|
52
|
+
*/
|
|
53
|
+
export interface StudioBridgeRegistry {
|
|
54
|
+
register: <K extends keyof StudioBridge>(key: K, value: StudioBridge[K]) => void;
|
|
55
|
+
unregister: (key: keyof StudioBridge) => void;
|
|
56
|
+
}
|
|
57
|
+
export declare const StudioBridgeRegistryContext: React.Context<StudioBridgeRegistry | null>;
|
|
58
|
+
/**
|
|
59
|
+
* Provider that creates a self-assembling bridge.
|
|
60
|
+
*
|
|
61
|
+
* Mount this above the controller providers. Each controller calls
|
|
62
|
+
* `useBridgeRegistration(key, value)` to inject its implementation.
|
|
63
|
+
* The bridge context value is automatically kept in sync.
|
|
64
|
+
*
|
|
65
|
+
* ```tsx
|
|
66
|
+
* <StudioBridgeRegistryProvider>
|
|
67
|
+
* <CollectionRegistryProvider> // auto-registers
|
|
68
|
+
* <SidePanelProvider> // auto-registers
|
|
69
|
+
* <UrlProvider> // auto-registers
|
|
70
|
+
* <RebaseStudio /> // consumes bridge
|
|
71
|
+
* </UrlProvider>
|
|
72
|
+
* </SidePanelProvider>
|
|
73
|
+
* </CollectionRegistryProvider>
|
|
74
|
+
* </StudioBridgeRegistryProvider>
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export declare function StudioBridgeRegistryProvider({ children }: {
|
|
78
|
+
children: React.ReactNode;
|
|
79
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal hook for translating Rebase UI strings.
|
|
3
|
+
*
|
|
4
|
+
* Uses the `rebase_core` i18next namespace that is initialised by
|
|
5
|
+
* `RebaseI18nProvider`. Do NOT use `react-i18next` directly in internal
|
|
6
|
+
* components — always go through this hook so the namespace is consistent.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const { t } = useTranslation();
|
|
10
|
+
* <Button>{t("save")}</Button>
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare function useTranslation(): {
|
|
15
|
+
t: (key: string, vars?: Record<string, string>) => string;
|
|
16
|
+
i18n: import("i18next").i18n;
|
|
17
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UnsavedChangesDialogProps } from "../components/UnsavedChangesDialog";
|
|
2
|
+
/**
|
|
3
|
+
* A single, unified hook to prevent navigation when there are unsaved changes.
|
|
4
|
+
*
|
|
5
|
+
* It automatically handles:
|
|
6
|
+
* 1. Internal React Router navigation using `useBlocker`.
|
|
7
|
+
* 2. External browser navigation (page refresh, tab close) using `beforeunload`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useUnsavedChangesDialog(when: boolean, onOk: () => void): {
|
|
10
|
+
dialogProps: UnsavedChangesDialogProps;
|
|
11
|
+
triggerDialog: () => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UserConfigurationPersistence } from "@rebasepro/types";
|
|
2
|
+
/**
|
|
3
|
+
* Use this controller to access the configuration that is stored externally,
|
|
4
|
+
* and not defined in code
|
|
5
|
+
*
|
|
6
|
+
* @group Hooks and utilities
|
|
7
|
+
*/
|
|
8
|
+
export declare const useUserConfigurationPersistence: () => UserConfigurationPersistence | undefined;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from "react";
|
|
2
|
+
import { RebaseTranslations } from "@rebasepro/types";
|
|
3
|
+
export declare const REBASE_LOCALE_STORAGE_KEY = "rebase_locale";
|
|
4
|
+
/** DeepPartial helper — allows partial overrides at any nesting level */
|
|
5
|
+
type DeepPartial<T> = T extends object ? {
|
|
6
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
7
|
+
} : T;
|
|
8
|
+
export interface RebaseI18nProviderProps {
|
|
9
|
+
/** BCP-47 locale tag, e.g. "en", "es", "fr". Defaults to "en". */
|
|
10
|
+
locale?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Override or extend any Rebase UI string, keyed by locale.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* translations={{
|
|
16
|
+
* en: { save: "Publish" },
|
|
17
|
+
* es: { save: "Publicar", discard: "Descartar" }
|
|
18
|
+
* }}
|
|
19
|
+
*/
|
|
20
|
+
translations?: {
|
|
21
|
+
[locale: string]: DeepPartial<RebaseTranslations>;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Initialises a dedicated i18next instance for Rebase's internal UI strings.
|
|
26
|
+
*
|
|
27
|
+
* This instance is isolated from any app-level i18next configuration the
|
|
28
|
+
* consumer may have. Mount this at the top of the Rebase component tree.
|
|
29
|
+
*
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export declare function RebaseI18nProvider({ locale, translations, children }: PropsWithChildren<RebaseI18nProviderProps>): React.JSX.Element | null;
|
|
33
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from "./core";
|
|
2
|
+
export * from "./hooks";
|
|
3
|
+
export * from "./auth";
|
|
4
|
+
export * from "./components";
|
|
5
|
+
export * from "./util";
|
|
6
|
+
export * from "./contexts";
|
|
7
|
+
export { CONTAINER_FULL_WIDTH, ADDITIONAL_TAB_WIDTH, FORM_CONTAINER_WIDTH } from "./internal/common";
|
|
8
|
+
export { useRestoreScroll } from "./internal/useRestoreScroll";
|
|
9
|
+
export { useUnsavedChangesDialog } from "./hooks/useUnsavedChangesDialog";
|
|
10
|
+
export type { UnsavedChangesDialogProps } from "./components/UnsavedChangesDialog";
|
|
11
|
+
export { UnsavedChangesDialog } from "./components/UnsavedChangesDialog";
|
|
12
|
+
export * from "./i18n/RebaseI18nProvider";
|
|
13
|
+
export * from "./locales/en";
|
|
14
|
+
export * from "./locales/es";
|
|
15
|
+
export * from "./hooks/useStudioBridge";
|
|
16
|
+
export { useBridgeRegistration } from "./hooks/useBridgeRegistration";
|