@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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rebase
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# @rebasepro/app
|
|
2
|
+
|
|
3
|
+
Framework-agnostic runtime for data-driven admin panels — React hooks, providers, contexts, and shared components used by `@rebasepro/admin` and `@rebasepro/studio`.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @rebasepro/app
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Peer dependencies:** `react >= 19`, `react-dom >= 19`, `react-router ^7`, `react-router-dom ^7`
|
|
12
|
+
|
|
13
|
+
## What This Package Does
|
|
14
|
+
|
|
15
|
+
`@rebasepro/app` is the shared runtime layer that powers the Rebase CMS. It provides:
|
|
16
|
+
|
|
17
|
+
- **App bootstrapping** — `Rebase`, `RebaseRouter`, `RebaseRoutes`, `PluginProviderStack`
|
|
18
|
+
- **React contexts** — auth, data driver, storage, snackbar, dialogs, mode, admin mode, role, analytics, customization
|
|
19
|
+
- **Hooks** — data fetching (`useData`, `useCollection`, `useFetch`), data mutation (`save`, `delete`), auth (`useAuthController`), storage, permissions, i18n, and more
|
|
20
|
+
- **UI components** — `LoginView`, `RebaseAuth`, `ConfirmationDialog`, `ErrorView`, `UserSettingsView`, `BootstrapAdminBanner`, etc.
|
|
21
|
+
- **Utilities** — icon system, snapshot caching, storage upload controller, enums, constants
|
|
22
|
+
- **i18n** — built-in English and Spanish locales via `react-i18next`
|
|
23
|
+
- **Studio Bridge** — shared context for optional CMS↔Studio integration
|
|
24
|
+
|
|
25
|
+
This package is **framework-agnostic** in the sense that it doesn't depend on any specific data backend — it works with any `DataDriver` implementation (PostgreSQL, Firebase, MongoDB, etc.).
|
|
26
|
+
|
|
27
|
+
## Key Exports
|
|
28
|
+
|
|
29
|
+
### App Bootstrapping
|
|
30
|
+
|
|
31
|
+
| Export | Description |
|
|
32
|
+
|---|---|
|
|
33
|
+
| `Rebase` | Root component — accepts collections, auth, data source config and renders the app |
|
|
34
|
+
| `RebaseRouter` | Router wrapper for react-router integration |
|
|
35
|
+
| `RebaseRoutes` | Route definitions |
|
|
36
|
+
| `PluginProviderStack` | Wraps children with plugin-provided context providers |
|
|
37
|
+
|
|
38
|
+
### Hooks — Data
|
|
39
|
+
|
|
40
|
+
| Export | Description |
|
|
41
|
+
|---|---|
|
|
42
|
+
| `useData` | Access the data driver from context |
|
|
43
|
+
| `useCollection` | Fetch a collection with filters, pagination, and realtime |
|
|
44
|
+
| `useFetch` | Fetch a single snapshot by ID |
|
|
45
|
+
| `useRelationSelector` | Relation field selector state |
|
|
46
|
+
| `useUserSelector` | User selector state |
|
|
47
|
+
| `save` utilities | Snapshot save helpers |
|
|
48
|
+
| `delete` utilities | Snapshot delete helpers |
|
|
49
|
+
|
|
50
|
+
### Hooks — Auth & Permissions
|
|
51
|
+
|
|
52
|
+
| Export | Description |
|
|
53
|
+
|---|---|
|
|
54
|
+
| `useAuthController` | Access the current auth controller from context |
|
|
55
|
+
| `useAuthSubscription` | Subscribe to auth state changes |
|
|
56
|
+
| `usePermissions` | Check permissions for collections/actions |
|
|
57
|
+
| `useAdminModeController` / `useBuildAdminModeController` | Admin mode toggle |
|
|
58
|
+
| `useEffectiveRoleController` / `useBuildEffectiveRoleController` | Current user's effective role |
|
|
59
|
+
|
|
60
|
+
### Hooks — UI & State
|
|
61
|
+
|
|
62
|
+
| Export | Description |
|
|
63
|
+
|---|---|
|
|
64
|
+
| `useRebaseContext` | Access the top-level Rebase context |
|
|
65
|
+
| `useDialogsController` | Programmatic dialog management |
|
|
66
|
+
| `useSnackbarController` | Show snackbar notifications |
|
|
67
|
+
| `useModeController` / `useBuildModeController` | Light/dark mode |
|
|
68
|
+
| `useStorageSource` / `useBackendStorageSource` | Storage source from context |
|
|
69
|
+
| `useRebaseClient` | Access the `RebaseClient` instance |
|
|
70
|
+
| `useLargeLayout` | Responsive layout breakpoint hook |
|
|
71
|
+
| `useClipboard` | Copy-to-clipboard |
|
|
72
|
+
| `useUnsavedChangesDialog` | Prompt user about unsaved changes |
|
|
73
|
+
| `useCustomizationController` | UI customization overrides |
|
|
74
|
+
| `useRebaseRegistry` | Access the collection/plugin registry |
|
|
75
|
+
| `useTranslation` | i18n translation hook |
|
|
76
|
+
| `useAnalyticsController` | Analytics event tracking |
|
|
77
|
+
|
|
78
|
+
### Hooks — Studio Bridge
|
|
79
|
+
|
|
80
|
+
| Export | Description |
|
|
81
|
+
|---|---|
|
|
82
|
+
| `useStudioBridge` | Access bridge context for CMS↔Studio communication |
|
|
83
|
+
| `useBridgeRegistration` | Register bridge callbacks (self-assembling) |
|
|
84
|
+
|
|
85
|
+
### Components
|
|
86
|
+
|
|
87
|
+
| Export | Description |
|
|
88
|
+
|---|---|
|
|
89
|
+
| `LoginView` | Pre-built login/register form UI |
|
|
90
|
+
| `RebaseAuth` | Auth gate component — handles login flow rendering |
|
|
91
|
+
| `ErrorView` | Error display component |
|
|
92
|
+
| `ConfirmationDialog` | Configurable confirmation dialog |
|
|
93
|
+
| `UnsavedChangesDialog` | "Discard changes?" dialog |
|
|
94
|
+
| `NotFoundPage` | 404 page |
|
|
95
|
+
| `UserSettingsView` | User profile settings page |
|
|
96
|
+
| `UserSelectPopover` / `UserDisplay` | User avatar/name display |
|
|
97
|
+
| `LanguageToggle` | i18n language switcher |
|
|
98
|
+
| `BootstrapAdminBanner` | First-user setup banner |
|
|
99
|
+
| `RebaseLogo` | Rebase branding logo |
|
|
100
|
+
| `UIStyleGuide` / `UIReferenceView` | Debug/reference components |
|
|
101
|
+
|
|
102
|
+
### Contexts
|
|
103
|
+
|
|
104
|
+
| Export | Description |
|
|
105
|
+
|---|---|
|
|
106
|
+
| `SnackbarProvider` | Snackbar notification context |
|
|
107
|
+
| `ModeController` | Light/dark mode context |
|
|
108
|
+
| `AdminModeController` | Admin mode context |
|
|
109
|
+
| `EffectiveRoleController` | User role context |
|
|
110
|
+
| `AuthControllerContext` | Auth controller context |
|
|
111
|
+
| `DataDriverContext` | Data driver context |
|
|
112
|
+
| `StorageSourceContext` | Storage source context |
|
|
113
|
+
| `DialogsProvider` | Dialog management context |
|
|
114
|
+
| `RebaseClientInstanceContext` | Client instance context |
|
|
115
|
+
| `CustomizationControllerContext` | UI customization context |
|
|
116
|
+
| `AnalyticsContext` | Analytics context |
|
|
117
|
+
|
|
118
|
+
### Utilities
|
|
119
|
+
|
|
120
|
+
| Export | Description |
|
|
121
|
+
|---|---|
|
|
122
|
+
| `iconList` / icon helpers | Full icon set and lookup |
|
|
123
|
+
| `createFormexStub` | Create a form stub for testing |
|
|
124
|
+
| `snapshotCache` | Snapshot LRU cache |
|
|
125
|
+
| `useStorageUploadController` | File upload progress controller |
|
|
126
|
+
| `previews` | Preview rendering utilities |
|
|
127
|
+
| `enums` / `constants` | Shared enums and constant values |
|
|
128
|
+
|
|
129
|
+
### i18n
|
|
130
|
+
|
|
131
|
+
| Export | Description |
|
|
132
|
+
|---|---|
|
|
133
|
+
| `RebaseI18nProvider` | i18n context provider |
|
|
134
|
+
| `en` locale | English translations |
|
|
135
|
+
| `es` locale | Spanish translations |
|
|
136
|
+
|
|
137
|
+
### Vite Plugin
|
|
138
|
+
|
|
139
|
+
Available as a separate entry point:
|
|
140
|
+
|
|
141
|
+
```ts
|
|
142
|
+
import { rebaseVitePlugin } from "@rebasepro/app/vitePlugin";
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Quick Start
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
import { Rebase, useAuthController, useCollection } from "@rebasepro/app";
|
|
149
|
+
|
|
150
|
+
function App() {
|
|
151
|
+
return (
|
|
152
|
+
<Rebase
|
|
153
|
+
collections={collections}
|
|
154
|
+
authController={authController}
|
|
155
|
+
dataSource={dataSource}
|
|
156
|
+
/>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Inside any child component:
|
|
161
|
+
function ProductList() {
|
|
162
|
+
const { data, loading } = useCollection("products", { limit: 20 });
|
|
163
|
+
// ...
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Related Packages
|
|
168
|
+
|
|
169
|
+
- [`@rebasepro/admin`](../admin) — CMS views, forms, and routing (built on top of core)
|
|
170
|
+
- [`@rebasepro/ui`](../ui) — Design system components
|
|
171
|
+
- [`@rebasepro/common`](../common) — Shared utilities and collection registry
|
|
172
|
+
- [`@rebasepro/types`](../types) — TypeScript type definitions
|
|
173
|
+
- [`@rebasepro/forms`](../formex) — Form state management
|
|
174
|
+
- [`@rebasepro/client`](../client) — HTTP client SDK
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth-config fetch helper for the Rebase React frontend.
|
|
3
|
+
*
|
|
4
|
+
* The former per-endpoint auth client (login, register, refresh, OAuth,
|
|
5
|
+
* sessions, …) has been removed: `useRebaseAuthController` now delegates to
|
|
6
|
+
* the headless SDK's `client.auth` (from `@rebasepro/client`), which is the
|
|
7
|
+
* single source of truth for the auth session. The only piece that remains
|
|
8
|
+
* here is the unauthenticated `/api/auth/config` probe used to detect
|
|
9
|
+
* bootstrap mode and enabled providers before a session exists.
|
|
10
|
+
*/
|
|
11
|
+
import { RebaseApiError } from "@rebasepro/types";
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use {@link RebaseApiError} (from `@rebasepro/types`, re-exported by
|
|
14
|
+
* `@rebasepro/client`). Kept as an alias so `instanceof` / imports keep working;
|
|
15
|
+
* errors thrown here now carry `.code` and `.status` on the unified type.
|
|
16
|
+
*/
|
|
17
|
+
export declare const AuthApiError: typeof RebaseApiError;
|
|
18
|
+
/**
|
|
19
|
+
* Auth config response from the backend
|
|
20
|
+
*/
|
|
21
|
+
export interface AuthConfigResponse {
|
|
22
|
+
/** True when there are no users in the system and first user setup is needed */
|
|
23
|
+
needsSetup: boolean;
|
|
24
|
+
/** Whether new user registration is enabled */
|
|
25
|
+
registrationEnabled: boolean;
|
|
26
|
+
/** Whether email service is configured */
|
|
27
|
+
emailServiceEnabled?: boolean;
|
|
28
|
+
/** Whether the self-service password reset flow (email link) is supported */
|
|
29
|
+
passwordReset?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether an admin can reset another user's password, i.e. the adapter
|
|
32
|
+
* mounts `POST /admin/users/:userId/reset-password`. Absent on backends
|
|
33
|
+
* predating this field, which the frontend treats as supported.
|
|
34
|
+
*/
|
|
35
|
+
adminPasswordReset?: boolean;
|
|
36
|
+
/** Whether email verification is supported */
|
|
37
|
+
emailVerification?: boolean;
|
|
38
|
+
/** Complete list of enabled OAuth provider IDs (e.g. ["google", "github", "discord"]) */
|
|
39
|
+
enabledProviders: string[];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Cache container for `fetchAuthConfig` — holds both the inflight promise
|
|
43
|
+
* (to deduplicate concurrent calls) and the cached result.
|
|
44
|
+
*/
|
|
45
|
+
export interface AuthConfigCache {
|
|
46
|
+
cached: AuthConfigResponse | null;
|
|
47
|
+
inflight: Promise<AuthConfigResponse> | null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Create a fresh `AuthConfigCache` instance.
|
|
51
|
+
* Callers own the cache object and pass it into `fetchAuthConfig` / `clearAuthConfigCache`.
|
|
52
|
+
*/
|
|
53
|
+
export declare function createAuthConfigCache(): AuthConfigCache;
|
|
54
|
+
/**
|
|
55
|
+
* Fetch auth configuration / status from the backend
|
|
56
|
+
* This is an unauthenticated endpoint used to detect bootstrap mode.
|
|
57
|
+
*
|
|
58
|
+
* Results are cached for the session lifetime.
|
|
59
|
+
* Concurrent calls are deduplicated: only one network request is made
|
|
60
|
+
* and all callers share the same promise.
|
|
61
|
+
*/
|
|
62
|
+
export declare function fetchAuthConfig(apiUrl: string, cache: AuthConfigCache): Promise<AuthConfigResponse>;
|
|
63
|
+
/**
|
|
64
|
+
* Clear the cached auth config (e.g. on logout or for testing).
|
|
65
|
+
*/
|
|
66
|
+
export declare function clearAuthConfigCache(cache: AuthConfigCache): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @rebasepro/app
|
|
3
|
+
*
|
|
4
|
+
* React authentication controller for Rebase frontends.
|
|
5
|
+
* Provides the `useRebaseAuthController` hook and API utilities
|
|
6
|
+
* for communicating with a Rebase backend's JWT auth endpoints.
|
|
7
|
+
*
|
|
8
|
+
* For the generic LoginView and RebaseAuth components, see @rebasepro/app.
|
|
9
|
+
*/
|
|
10
|
+
export type { RebaseAuthController, RebaseAuthControllerProps, AuthTokens, DeviceSession, UserInfo, AuthResponse, RefreshResponse } from "./types";
|
|
11
|
+
export { useRebaseAuthController } from "./useRebaseAuthController";
|
|
12
|
+
export { fetchAuthConfig, clearAuthConfigCache, createAuthConfigCache, AuthApiError } from "./api";
|
|
13
|
+
export type { AuthConfigResponse, AuthConfigCache } from "./api";
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { AuthController, User, AuthTokens, DeviceSession, RebaseSession, AuthChangeEvent } from "@rebasepro/types";
|
|
2
|
+
import type { AuthConfigResponse } from "./api";
|
|
3
|
+
/** @deprecated Use `User` from `@rebasepro/types` instead. */
|
|
4
|
+
export type UserInfo = User;
|
|
5
|
+
/** @deprecated Use `DeviceSession` from `@rebasepro/types` instead. */
|
|
6
|
+
export type Session = DeviceSession;
|
|
7
|
+
export type { AuthTokens, DeviceSession };
|
|
8
|
+
/**
|
|
9
|
+
* Auth controller that extends the base AuthController
|
|
10
|
+
* with additional methods for email/password and Google login
|
|
11
|
+
*/
|
|
12
|
+
export type RebaseAuthController = AuthController & {
|
|
13
|
+
/** Login with Google — accepts an ID token, access token, or authorization code payload */
|
|
14
|
+
googleLogin: (payload: {
|
|
15
|
+
idToken: string;
|
|
16
|
+
} | {
|
|
17
|
+
accessToken: string;
|
|
18
|
+
} | {
|
|
19
|
+
code: string;
|
|
20
|
+
redirectUri: string;
|
|
21
|
+
}) => Promise<void>;
|
|
22
|
+
/** Generic OAuth login — works with any provider. Posts payload to /auth/{providerId}. */
|
|
23
|
+
oauthLogin: (providerId: string, payload: Record<string, unknown>) => Promise<void>;
|
|
24
|
+
/** Login with email and password */
|
|
25
|
+
emailPasswordLogin: (email: string, password: string) => Promise<void>;
|
|
26
|
+
/** Register a new user */
|
|
27
|
+
register: (email: string, password: string, displayName?: string) => Promise<void>;
|
|
28
|
+
/** Skip login (for anonymous access if enabled) */
|
|
29
|
+
skipLogin: () => void;
|
|
30
|
+
/** Whether login was skipped */
|
|
31
|
+
loginSkipped: boolean;
|
|
32
|
+
/** Error from auth provider (login failure details) */
|
|
33
|
+
authProviderError: Error | null;
|
|
34
|
+
/** True when there are no users in the system — first-user bootstrap mode */
|
|
35
|
+
needsSetup: boolean;
|
|
36
|
+
/** Whether new user registration is enabled (always true during setup) */
|
|
37
|
+
registrationEnabled: boolean;
|
|
38
|
+
/** Request password reset email */
|
|
39
|
+
forgotPassword: (email: string) => Promise<void>;
|
|
40
|
+
/** Reset password using token from email */
|
|
41
|
+
resetPassword: (token: string, password: string) => Promise<void>;
|
|
42
|
+
/** Change password for authenticated user */
|
|
43
|
+
changePassword: (oldPassword: string, newPassword: string) => Promise<void>;
|
|
44
|
+
/** Update user profile */
|
|
45
|
+
updateProfile: (displayName?: string, photoURL?: string) => Promise<User>;
|
|
46
|
+
/** Fetch active sessions */
|
|
47
|
+
fetchSessions: () => Promise<DeviceSession[]>;
|
|
48
|
+
/** Revoke a session */
|
|
49
|
+
revokeSession: (sessionId: string) => Promise<void>;
|
|
50
|
+
/** Revoke all active sessions */
|
|
51
|
+
revokeAllSessions: () => Promise<void>;
|
|
52
|
+
/** Get internal API URL */
|
|
53
|
+
getApiUrl?: () => string | undefined;
|
|
54
|
+
/** Clear the current auth provider error */
|
|
55
|
+
clearError: () => void;
|
|
56
|
+
/** Set or clear the auth provider error */
|
|
57
|
+
setAuthProviderError: (error: Error | null) => void;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Structural type for the subset of `client.auth` (from `@rebasepro/client`)
|
|
61
|
+
* that the React hook delegates to. Avoids a hard dependency on
|
|
62
|
+
* `@rebasepro/client` while remaining fully type-safe.
|
|
63
|
+
*/
|
|
64
|
+
export interface ClientAuth {
|
|
65
|
+
getSession(): RebaseSession | null;
|
|
66
|
+
onAuthStateChange(callback: (event: AuthChangeEvent, session: RebaseSession | null) => void): () => void;
|
|
67
|
+
isInitialized(): Promise<void>;
|
|
68
|
+
getAuthConfig(): Promise<AuthConfigResponse>;
|
|
69
|
+
signInWithEmail(email: string, password: string): Promise<unknown>;
|
|
70
|
+
signOut(): Promise<void>;
|
|
71
|
+
refreshSession(): Promise<RebaseSession>;
|
|
72
|
+
signUp(email: string, password: string, displayName?: string): Promise<unknown>;
|
|
73
|
+
signInWithGoogle(payload: {
|
|
74
|
+
idToken: string;
|
|
75
|
+
} | {
|
|
76
|
+
accessToken: string;
|
|
77
|
+
} | {
|
|
78
|
+
code: string;
|
|
79
|
+
redirectUri: string;
|
|
80
|
+
}): Promise<unknown>;
|
|
81
|
+
signInWithOAuth(providerId: string, payload: Record<string, unknown>): Promise<unknown>;
|
|
82
|
+
resetPasswordForEmail(email: string): Promise<unknown>;
|
|
83
|
+
resetPassword(token: string, password: string): Promise<unknown>;
|
|
84
|
+
changePassword(oldPassword: string, newPassword: string): Promise<unknown>;
|
|
85
|
+
updateUser(updates: {
|
|
86
|
+
displayName?: string;
|
|
87
|
+
photoURL?: string;
|
|
88
|
+
}): Promise<User>;
|
|
89
|
+
getSessions(): Promise<DeviceSession[]>;
|
|
90
|
+
revokeSession(sessionId: string): Promise<unknown>;
|
|
91
|
+
revokeAllSessions(): Promise<unknown>;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Props for useRebaseAuthController hook
|
|
95
|
+
*/
|
|
96
|
+
export interface RebaseAuthControllerProps {
|
|
97
|
+
/** The Rebase Client instance */
|
|
98
|
+
client?: {
|
|
99
|
+
baseUrl?: string;
|
|
100
|
+
resolveToken?: () => Promise<string | null>;
|
|
101
|
+
setAuthTokenGetter?: (getter: () => Promise<string | null>) => void;
|
|
102
|
+
setOnUnauthorized?: (handler: () => Promise<boolean>) => void;
|
|
103
|
+
ws?: {
|
|
104
|
+
setAuthTokenGetter: (getter: () => Promise<string | null>) => void;
|
|
105
|
+
};
|
|
106
|
+
auth?: ClientAuth;
|
|
107
|
+
};
|
|
108
|
+
/** Google OAuth client ID (optional, enables Google login) */
|
|
109
|
+
googleClientId?: string;
|
|
110
|
+
/** Callback when user signs out */
|
|
111
|
+
onSignOut?: () => void;
|
|
112
|
+
/** Define roles for a user after login */
|
|
113
|
+
defineRolesFor?: (user: User) => Promise<string[] | undefined> | string[] | undefined;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Auth response from backend login/register endpoints
|
|
117
|
+
*/
|
|
118
|
+
export interface AuthResponse {
|
|
119
|
+
user: User;
|
|
120
|
+
tokens: AuthTokens;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Response from token refresh endpoint
|
|
124
|
+
*/
|
|
125
|
+
export interface RefreshResponse {
|
|
126
|
+
tokens: AuthTokens;
|
|
127
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RebaseAuthController, RebaseAuthControllerProps } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Auth controller hook for JWT-based authentication.
|
|
4
|
+
*
|
|
5
|
+
* This is a thin React binding over the headless SDK `client.auth`.
|
|
6
|
+
* It synchronizes React state with the SDK's internal state and delegates
|
|
7
|
+
* all operations to the SDK to ensure a single source of truth for
|
|
8
|
+
* authentication sessions across the entire application.
|
|
9
|
+
*
|
|
10
|
+
* @param props Configuration options
|
|
11
|
+
* @returns RebaseAuthController instance
|
|
12
|
+
*/
|
|
13
|
+
export declare function useRebaseAuthController(props?: RebaseAuthControllerProps): RebaseAuthController;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface AIIconProps {
|
|
3
|
+
size?: "smallest" | "small" | "medium" | "large";
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* AI-styled AutoAwesome icon with gradient coloring.
|
|
8
|
+
* Used consistently across AI features for visual identification.
|
|
9
|
+
*/
|
|
10
|
+
export declare function AIIcon({ size, className }: AIIconProps): React.JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* Small animated dot indicator for AI-modified elements.
|
|
13
|
+
* Shows a pulsing gradient dot.
|
|
14
|
+
*/
|
|
15
|
+
export declare function AIModifiedIndicator({ className }: {
|
|
16
|
+
className?: string;
|
|
17
|
+
}): React.JSX.Element;
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare function ConfirmationDialog({ open, onAccept, onCancel, title, loading, body }: {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onAccept: () => void;
|
|
5
|
+
onCancel: () => void;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
title: React.ReactNode;
|
|
8
|
+
body?: React.ReactNode;
|
|
9
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UIReferenceView — hidden debug route at /debug/ui
|
|
3
|
+
*
|
|
4
|
+
* This file is a STATIC reference of the real UI patterns used across the app.
|
|
5
|
+
* All markup / styles are copied verbatim from source files.
|
|
6
|
+
* DO NOT add invented styles. Only copy from actual source files.
|
|
7
|
+
*
|
|
8
|
+
* Sources:
|
|
9
|
+
* DefaultDrawer.tsx, DefaultAppBar.tsx, DrawerNavigationItem.tsx,
|
|
10
|
+
* DrawerNavigationGroup.tsx, UsersView.tsx, RolesView.tsx
|
|
11
|
+
*/
|
|
12
|
+
import React from "react";
|
|
13
|
+
export declare function UIReferenceView(): React.JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type ProjectStatus = "backlog" | "in_progress" | "in_review" | "done";
|
|
2
|
+
export type ProjectPriority = "low" | "medium" | "high" | "critical";
|
|
3
|
+
export interface SampleProject {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
status: ProjectStatus;
|
|
8
|
+
priority: ProjectPriority;
|
|
9
|
+
assignee: string;
|
|
10
|
+
tags: string[];
|
|
11
|
+
dueDate: string;
|
|
12
|
+
progress: number;
|
|
13
|
+
createdAt: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const STATUS_CONFIG: Record<ProjectStatus, {
|
|
16
|
+
label: string;
|
|
17
|
+
color: string;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const PRIORITY_CONFIG: Record<ProjectPriority, {
|
|
20
|
+
label: string;
|
|
21
|
+
color: string;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const SAMPLE_PROJECTS: SampleProject[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface TaskEntity {
|
|
3
|
+
id: string;
|
|
4
|
+
values: {
|
|
5
|
+
title: string;
|
|
6
|
+
status: string;
|
|
7
|
+
dueDate: string | null;
|
|
8
|
+
stageId: string | null;
|
|
9
|
+
priority?: string | null;
|
|
10
|
+
clientId: string | null;
|
|
11
|
+
client?: {
|
|
12
|
+
name?: string;
|
|
13
|
+
} | null;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface CalendarWidgetProps {
|
|
17
|
+
loading: boolean;
|
|
18
|
+
tasks: TaskEntity[];
|
|
19
|
+
onOpenTask: (taskId: string) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare function CalendarWidget({ loading, tasks, onOpenTask }: CalendarWidgetProps): React.JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface InsightsData {
|
|
3
|
+
activeClients: number;
|
|
4
|
+
potentialRevenue: number;
|
|
5
|
+
contractedRevenue: number;
|
|
6
|
+
overdueTaskCount: number;
|
|
7
|
+
}
|
|
8
|
+
export interface DashboardMetricsProps {
|
|
9
|
+
loading: boolean;
|
|
10
|
+
insights: InsightsData | null;
|
|
11
|
+
totalInPipeline: number;
|
|
12
|
+
totalRevenue: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function DashboardMetrics({ loading, insights, totalInPipeline, totalRevenue }: DashboardMetricsProps): React.JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface PipelineStage {
|
|
3
|
+
stageKey: string;
|
|
4
|
+
label: string;
|
|
5
|
+
shortLabel: string;
|
|
6
|
+
color: string;
|
|
7
|
+
icon: string;
|
|
8
|
+
sortOrder: number;
|
|
9
|
+
isTerminal: boolean;
|
|
10
|
+
isLostStage: boolean;
|
|
11
|
+
count: number;
|
|
12
|
+
}
|
|
13
|
+
interface PipelineOption {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
isDefault: boolean;
|
|
17
|
+
color: string;
|
|
18
|
+
}
|
|
19
|
+
export interface PipelineOverviewProps {
|
|
20
|
+
loading: boolean;
|
|
21
|
+
insights: {
|
|
22
|
+
pipelines: PipelineOption[];
|
|
23
|
+
} | null;
|
|
24
|
+
selectedPipelineId: string | null;
|
|
25
|
+
onPipelineChange: (newPipelineId: string) => void;
|
|
26
|
+
onNavigate: (path: string) => void;
|
|
27
|
+
sortedStages: PipelineStage[];
|
|
28
|
+
activeStages: PipelineStage[];
|
|
29
|
+
closedStages: PipelineStage[];
|
|
30
|
+
totalInPipeline: number;
|
|
31
|
+
resolveColor: (colorName: string) => string;
|
|
32
|
+
}
|
|
33
|
+
export declare function PipelineOverview({ loading, insights, selectedPipelineId, onPipelineChange, onNavigate, sortedStages, activeStages, closedStages, totalInPipeline, resolveColor }: PipelineOverviewProps): React.JSX.Element;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface RecentActivityProps {
|
|
3
|
+
activities: any[];
|
|
4
|
+
activitiesLoading: boolean;
|
|
5
|
+
tasksMap: Map<string, any>;
|
|
6
|
+
onCompleteTask: (activity: any) => void;
|
|
7
|
+
onViewEmail: (activity: any) => void;
|
|
8
|
+
onOpenTask: (activity: any) => void;
|
|
9
|
+
emailViewerOpen: boolean;
|
|
10
|
+
onEmailViewerOpenChange: (open: boolean) => void;
|
|
11
|
+
selectedEmail: {
|
|
12
|
+
to: string;
|
|
13
|
+
subject: string;
|
|
14
|
+
body: string;
|
|
15
|
+
html?: string;
|
|
16
|
+
mode?: string;
|
|
17
|
+
} | null;
|
|
18
|
+
}
|
|
19
|
+
export declare function RecentActivity({ activities, activitiesLoading, tasksMap, onCompleteTask, onViewEmail, onOpenTask, emailViewerOpen, onEmailViewerOpenChange, selectedEmail }: RecentActivityProps): React.JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type QuickFilter = "all" | "overdue";
|
|
3
|
+
export interface TaskFiltersProps {
|
|
4
|
+
quickFilter: QuickFilter;
|
|
5
|
+
onQuickFilterChange: (filter: QuickFilter) => void;
|
|
6
|
+
stageFilter: string | null;
|
|
7
|
+
onStageFilterChange: (stage: string | null) => void;
|
|
8
|
+
clientFilter: string | null;
|
|
9
|
+
onClientFilterChange: (clientId: string | null) => void;
|
|
10
|
+
searchText: string;
|
|
11
|
+
onSearchTextChange: (text: string) => void;
|
|
12
|
+
hasActiveFilter: boolean;
|
|
13
|
+
onClearAllFilters: () => void;
|
|
14
|
+
overdueTasks: {
|
|
15
|
+
length: number;
|
|
16
|
+
};
|
|
17
|
+
pendingTasks: {
|
|
18
|
+
length: number;
|
|
19
|
+
};
|
|
20
|
+
stageLabels: Record<string, string>;
|
|
21
|
+
stageFilterOrder: string[];
|
|
22
|
+
stageCounts: Record<string, number>;
|
|
23
|
+
activeClientIds: string[];
|
|
24
|
+
clientsMap: Map<string, {
|
|
25
|
+
name: string;
|
|
26
|
+
picture?: string;
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
29
|
+
export declare function TaskFilters({ quickFilter, onQuickFilterChange, stageFilter, onStageFilterChange, clientFilter, onClientFilterChange, searchText, onSearchTextChange, hasActiveFilter, onClearAllFilters, overdueTasks, pendingTasks, stageLabels, stageFilterOrder, stageCounts, activeClientIds, clientsMap }: TaskFiltersProps): React.JSX.Element;
|
|
30
|
+
export {};
|