@rebasepro/core 0.4.0 → 0.6.0
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/README.md +142 -210
- package/dist/components/AIIcon.d.ts +3 -2
- package/dist/components/ConfirmationDialog.d.ts +1 -1
- package/dist/components/Debug/UIReferenceView.d.ts +13 -1
- package/dist/components/Debug/UIStyleGuide.d.ts +2 -1
- package/dist/components/ErrorTooltip.d.ts +2 -1
- package/dist/components/LanguageToggle.d.ts +2 -1
- package/dist/components/LoginView/LoginView.d.ts +2 -2
- package/dist/components/NotFoundPage.d.ts +2 -1
- package/dist/components/RebaseLogo.d.ts +1 -1
- package/dist/components/SchemaDriftBanner.d.ts +27 -0
- package/dist/components/UnsavedChangesDialog.d.ts +1 -1
- package/dist/components/UserDisplay.d.ts +1 -1
- package/dist/components/UserSelectPopover.d.ts +2 -1
- package/dist/components/UserSettingsView.d.ts +2 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/contexts/ComponentOverrideContext.d.ts +42 -0
- package/dist/contexts/RebaseClientInstanceContext.d.ts +1 -1
- package/dist/contexts/index.d.ts +1 -1
- package/dist/core/Rebase.d.ts +2 -1
- package/dist/core/RebaseProps.d.ts +23 -22
- package/dist/core/RebaseRouter.d.ts +1 -1
- package/dist/core/RebaseRoutes.d.ts +1 -1
- package/dist/hooks/ApiConfigContext.d.ts +1 -1
- package/dist/hooks/index.d.ts +1 -2
- package/dist/hooks/useComponentOverride.d.ts +32 -0
- package/dist/hooks/useRebaseRegistry.d.ts +1 -1
- package/dist/hooks/useStudioBridge.d.ts +4 -16
- package/dist/i18n/RebaseI18nProvider.d.ts +2 -2
- package/dist/index.es.js +12878 -15004
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +13192 -15144
- package/dist/index.umd.js.map +1 -1
- package/dist/util/icons.d.ts +2 -2
- package/dist/vitePlugin.js +4 -1
- package/package.json +21 -22
- package/src/components/ErrorView.tsx +16 -6
- package/src/components/LoginView/LoginView.tsx +14 -16
- package/src/components/SchemaDriftBanner.tsx +102 -0
- package/src/components/common/useDataTableController.tsx +3 -3
- package/src/components/index.tsx +1 -1
- package/src/contexts/ComponentOverrideContext.tsx +81 -0
- package/src/contexts/RebaseClientInstanceContext.tsx +1 -1
- package/src/contexts/index.ts +1 -1
- package/src/core/Rebase.tsx +16 -18
- package/src/core/RebaseProps.tsx +24 -25
- package/src/hooks/data/useCollectionFetch.tsx +10 -2
- package/src/hooks/data/useRelationSelector.tsx +4 -2
- package/src/hooks/index.tsx +1 -3
- package/src/hooks/useCollapsedGroups.ts +2 -1
- package/src/hooks/useComponentOverride.tsx +59 -0
- package/src/hooks/useRebaseContext.tsx +3 -5
- package/src/hooks/useResolvedComponent.tsx +1 -1
- package/src/hooks/useStudioBridge.tsx +5 -13
- package/src/locales/en.ts +3 -0
- package/src/util/entity_cache.ts +0 -2
- package/src/util/previews.ts +1 -1
- package/src/vitePlugin.ts +2 -1
- package/dist/components/BootstrapAdminBanner.d.ts +0 -4
- package/dist/contexts/InternalUserManagementContext.d.ts +0 -3
- package/dist/hooks/data/useUserSelector.d.ts +0 -31
- package/dist/hooks/useInternalUserManagementController.d.ts +0 -12
- package/src/components/BootstrapAdminBanner.tsx +0 -75
- package/src/contexts/InternalUserManagementContext.tsx +0 -4
- package/src/hooks/data/useUserSelector.tsx +0 -157
- package/src/hooks/useInternalUserManagementController.tsx +0 -17
package/README.md
CHANGED
|
@@ -1,242 +1,174 @@
|
|
|
1
|
-
|
|
2
|
-
<a href="https://rebase.pro">
|
|
3
|
-
<img src="https://rebase.pro/img/logo_small.png" width="240px" alt="Rebase logo" />
|
|
4
|
-
</a>
|
|
5
|
-
</p>
|
|
1
|
+
# @rebasepro/core
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
<h3 align="center">The Open-Source Headless CMS & Admin Panel for Postgres</h3>
|
|
9
|
-
<p align="center">
|
|
10
|
-
<strong>Ship production-ready backends and radically extensible back-office apps in minutes.</strong><br/>
|
|
11
|
-
Own your data, own your code. The absolute easiest way to build on PostgreSQL.
|
|
12
|
-
</p>
|
|
3
|
+
Framework-agnostic runtime for data-driven admin panels — React hooks, providers, contexts, and shared components used by `@rebasepro/admin` and `@rebasepro/studio`.
|
|
13
4
|
|
|
14
|
-
|
|
15
|
-
<a href="https://demo.rebase.pro">Live Demo</a> •
|
|
16
|
-
<a href="https://rebase.pro/docs">Documentation</a> •
|
|
17
|
-
<a href="https://rebase.pro/features">Features</a> •
|
|
18
|
-
<a href="https://github.com/rebasepro/rebase">GitHub</a> •
|
|
19
|
-
<a href="https://discord.gg/fxy7xsQm3m">Discord</a>
|
|
20
|
-
</p>
|
|
21
|
-
|
|
22
|
-
<p align="center">
|
|
23
|
-
<a href="https://www.npmjs.com/package/@rebasepro/core"><img src="https://img.shields.io/npm/v/@rebasepro/core.svg?style=flat-square&color=orange" alt="NPM Version" /></a>
|
|
24
|
-
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-purple.svg?style=flat-square" alt="License: MIT" /></a>
|
|
25
|
-
<a href="https://www.npmjs.com/package/@rebasepro/core"><img src="https://img.shields.io/npm/dw/@rebasepro/core?style=flat-square&color=blue" alt="NPM Downloads" /></a>
|
|
26
|
-
<a href="https://discord.gg/fxy7xsQm3m"><img src="https://img.shields.io/discord/1013768502458470442?style=flat-square&logo=discord&logoColor=white&label=Discord" alt="Discord" /></a>
|
|
27
|
-
</p>
|
|
28
|
-
|
|
29
|
-
<br/>
|
|
30
|
-
|
|
31
|
-
<p align="center">
|
|
32
|
-
<img src="https://rebase.pro/img/demo_products.png" width="800px" alt="Rebase Dashboard" />
|
|
33
|
-
</p>
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
## What is Rebase?
|
|
38
|
-
|
|
39
|
-
Rebase is a **developer-first**, open-source headless CMS and admin panel framework built with **React** and **TypeScript**. It gives you a complete backend-as-a-service layer on top of PostgreSQL — including authentication, S3-compatible storage, a full admin UI, and auto-generated APIs — while letting you extend every layer with custom React components, serverless functions, and scripts.
|
|
40
|
-
|
|
41
|
-
### ✨ Key Highlights
|
|
42
|
-
|
|
43
|
-
- 🔓 **No Vendor Lock-in** — Self-host anywhere. Full control over your infrastructure, code, and database.
|
|
44
|
-
- ⚡ **Instant Setup** — `npx @rebasepro/cli init` scaffolds a production-ready project in seconds.
|
|
45
|
-
- 🗄️ **PostgreSQL First** — First-class Postgres support with Drizzle ORM, schema introspection, and automatic migrations.
|
|
46
|
-
- 🧩 **Radical Extensibility** — Not constrained to pre-built widgets. If you can build it in React, you can build it in Rebase.
|
|
47
|
-
- 🎨 **Premium UI** — Fast, accessible design system built on Tailwind CSS v4 and Radix UI.
|
|
48
|
-
- 🤖 **AI-Ready** — MCP server for AI-assisted database management, plus data enhancement and insights plugins.
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## ⚡ Quick Start
|
|
53
|
-
|
|
54
|
-
Scaffold a complete, self-hosted Rebase application connected to your database:
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
npx @rebasepro/cli init my-rebase-app
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Configure your database in `.env`, then start everything:
|
|
5
|
+
## Installation
|
|
61
6
|
|
|
62
7
|
```bash
|
|
63
|
-
|
|
64
|
-
npm run dev
|
|
8
|
+
pnpm add @rebasepro/core
|
|
65
9
|
```
|
|
66
10
|
|
|
67
|
-
|
|
11
|
+
**Peer dependencies:** `react >= 19`, `react-dom >= 19`, `react-router ^7`, `react-router-dom ^7`
|
|
68
12
|
|
|
69
|
-
|
|
13
|
+
## What This Package Does
|
|
70
14
|
|
|
71
|
-
|
|
15
|
+
`@rebasepro/core` is the shared runtime layer that powers the Rebase CMS. It provides:
|
|
72
16
|
|
|
73
|
-
|
|
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`, `useCollectionFetch`, `useEntityFetch`), 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, entity 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
|
|
74
24
|
|
|
75
|
-
|
|
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.).
|
|
76
26
|
|
|
77
|
-
|
|
78
|
-
- **Card grid** — Visual overview with image previews
|
|
79
|
-
- **List view** — Compact, scannable layout
|
|
80
|
-
- **Custom views** — Build any React component as a collection view
|
|
27
|
+
## Key Exports
|
|
81
28
|
|
|
82
|
-
###
|
|
29
|
+
### App Bootstrapping
|
|
83
30
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
### 🔐 Authentication & Access Control
|
|
87
|
-
|
|
88
|
-
Built-in authentication with multiple providers:
|
|
89
|
-
|
|
90
|
-
- **Email/Password** — With password reset flow
|
|
91
|
-
- **Google OAuth** — One-click sign-in
|
|
92
|
-
- **Anonymous** — For guest access
|
|
93
|
-
|
|
94
|
-
Granular **role-based access control (RBAC)** with customizable permissions per collection, field, and action.
|
|
95
|
-
|
|
96
|
-
### 📦 S3-Compatible Storage
|
|
97
|
-
|
|
98
|
-
Native S3-compatible file storage with:
|
|
99
|
-
|
|
100
|
-
- Drag-and-drop uploads with progress tracking
|
|
101
|
-
- Automatic image resizing and optimization
|
|
102
|
-
- File metadata management
|
|
103
|
-
- Storage browser in Studio
|
|
104
|
-
|
|
105
|
-
### 🛠️ Studio — Developer Toolbox
|
|
106
|
-
|
|
107
|
-
A full developer environment built into the admin panel:
|
|
108
|
-
|
|
109
|
-
| Tool | Description |
|
|
31
|
+
| Export | Description |
|
|
110
32
|
|---|---|
|
|
111
|
-
|
|
|
112
|
-
|
|
|
113
|
-
|
|
|
114
|
-
|
|
|
115
|
-
| **API Explorer** | Browse and test your auto-generated REST API endpoints |
|
|
116
|
-
| **Cron Jobs** | Schedule and monitor recurring tasks |
|
|
117
|
-
| **Storage Browser** | Browse and manage files in your S3-compatible storage |
|
|
118
|
-
|
|
119
|
-
### ⚡ Extensible API & Edge Functions
|
|
120
|
-
|
|
121
|
-
Drop custom Hono routes or scheduled tasks into the `functions/` and `crons/` directories. Rebase auto-loads them with database access and JWT authentication middleware injected automatically.
|
|
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 |
|
|
122
37
|
|
|
123
|
-
###
|
|
38
|
+
### Hooks — Data
|
|
124
39
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
npx @rebasepro/cli generate-sdk
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### 🤖 MCP Server
|
|
132
|
-
|
|
133
|
-
A built-in **Model Context Protocol** server that enables AI assistants to:
|
|
134
|
-
|
|
135
|
-
- Query and manage your database schema
|
|
136
|
-
- Create, read, update, and delete documents
|
|
137
|
-
- Manage users and roles
|
|
138
|
-
- Introspect your data model
|
|
139
|
-
|
|
140
|
-
### 🔍 Schema Inference & Introspection
|
|
141
|
-
|
|
142
|
-
Point Rebase at an existing PostgreSQL database and automatically generate collection definitions from your tables — including types, relations, validation constraints, and more.
|
|
143
|
-
|
|
144
|
-
### 📥📤 Import & Export
|
|
145
|
-
|
|
146
|
-
Import data from **CSV, JSON, and Excel** with an intuitive field mapper. Export your data in multiple formats with configurable column selection.
|
|
147
|
-
|
|
148
|
-
### 🧩 Plugins
|
|
149
|
-
|
|
150
|
-
Extend the admin experience with first-party plugins:
|
|
151
|
-
|
|
152
|
-
- **Data Enhancement** — AI-powered field suggestions and auto-fill
|
|
153
|
-
- **Insights** — Analytics dashboards and usage metrics
|
|
154
|
-
|
|
155
|
-
### 📜 Standalone Scripting
|
|
156
|
-
|
|
157
|
-
Write standalone data manipulation scripts that connect directly to your running backend using the `@rebasepro/client` SDK. The CLI persists the dev server URL to `.rebase-dev-url` for zero-config local development.
|
|
158
|
-
|
|
159
|
-
### 🧩 Custom Views & React Extensibility
|
|
160
|
-
|
|
161
|
-
Build entirely custom views — dashboards, previews, charts — and drop them into the main navigation or as entity-level tabs. Use built-in hooks to interact with Rebase's internal state.
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
## 🛠️ Core Technologies
|
|
166
|
-
|
|
167
|
-
Built entirely on modern, battle-tested web standards:
|
|
168
|
-
|
|
169
|
-
| Technology | What we use it for |
|
|
40
|
+
| Export | Description |
|
|
170
41
|
|---|---|
|
|
171
|
-
|
|
|
172
|
-
|
|
|
173
|
-
|
|
|
174
|
-
|
|
|
175
|
-
|
|
|
176
|
-
|
|
|
177
|
-
|
|
|
178
|
-
| 🌐 **Hono** | Ultrafast HTTP server framework |
|
|
42
|
+
| `useData` | Access the data driver from context |
|
|
43
|
+
| `useCollectionFetch` | Fetch a collection with filters, pagination, and realtime |
|
|
44
|
+
| `useEntityFetch` | Fetch a single entity by ID |
|
|
45
|
+
| `useRelationSelector` | Relation field selector state |
|
|
46
|
+
| `useUserSelector` | User selector state |
|
|
47
|
+
| `save` utilities | Entity save helpers |
|
|
48
|
+
| `delete` utilities | Entity delete helpers |
|
|
179
49
|
|
|
180
|
-
|
|
50
|
+
### Hooks — Auth & Permissions
|
|
181
51
|
|
|
182
|
-
|
|
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 |
|
|
183
59
|
|
|
184
|
-
|
|
60
|
+
### Hooks — UI & State
|
|
185
61
|
|
|
186
|
-
|
|
|
62
|
+
| Export | Description |
|
|
187
63
|
|---|---|
|
|
188
|
-
|
|
|
189
|
-
|
|
|
190
|
-
|
|
|
191
|
-
|
|
|
192
|
-
|
|
|
193
|
-
|
|
|
194
|
-
|
|
|
195
|
-
|
|
|
196
|
-
|
|
|
197
|
-
|
|
|
198
|
-
|
|
|
199
|
-
|
|
|
200
|
-
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
|
205
|
-
|
|
206
|
-
|
|
|
207
|
-
|
|
|
208
|
-
| `@rebasepro/plugin-insights` | Analytics and insights plugin |
|
|
209
|
-
|
|
210
|
-
---
|
|
211
|
-
|
|
212
|
-
## 🎨 Standalone UI Library
|
|
213
|
-
|
|
214
|
-
Rebase exposes its design system as a completely independent library. Fully typed, accessible, and customizable via Tailwind CSS v4:
|
|
215
|
-
|
|
216
|
-
```bash
|
|
217
|
-
npm install @rebasepro/ui
|
|
218
|
-
```
|
|
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) |
|
|
219
84
|
|
|
220
|
-
|
|
85
|
+
### Components
|
|
221
86
|
|
|
222
|
-
|
|
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
|
+
| `entityCache` | Entity LRU cache |
|
|
125
|
+
| `useStorageUploadController` | File upload progress controller |
|
|
126
|
+
| `previews` | Preview rendering utilities |
|
|
127
|
+
| `enums` / `constants` | Shared enums and constant values |
|
|
223
128
|
|
|
224
|
-
|
|
129
|
+
### i18n
|
|
225
130
|
|
|
226
|
-
|
|
131
|
+
| Export | Description |
|
|
132
|
+
|---|---|
|
|
133
|
+
| `RebaseI18nProvider` | i18n context provider |
|
|
134
|
+
| `en` locale | English translations |
|
|
135
|
+
| `es` locale | Spanish translations |
|
|
227
136
|
|
|
228
|
-
|
|
137
|
+
### Vite Plugin
|
|
229
138
|
|
|
230
|
-
|
|
139
|
+
Available as a separate entry point:
|
|
231
140
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
- 📝 [Changelog](./CHANGELOG.md)
|
|
141
|
+
```ts
|
|
142
|
+
import { rebaseVitePlugin } from "@rebasepro/core/vitePlugin";
|
|
143
|
+
```
|
|
236
144
|
|
|
237
|
-
|
|
145
|
+
## Quick Start
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
import { Rebase, useAuthController, useCollectionFetch } from "@rebasepro/core";
|
|
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 } = useCollectionFetch("products", { limit: 20 });
|
|
163
|
+
// ...
|
|
164
|
+
}
|
|
165
|
+
```
|
|
238
166
|
|
|
239
|
-
##
|
|
167
|
+
## Related Packages
|
|
240
168
|
|
|
241
|
-
|
|
242
|
-
|
|
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/formex`](../formex) — Form state management
|
|
174
|
+
- [`@rebasepro/client`](../client) — HTTP client SDK
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
export interface AIIconProps {
|
|
2
3
|
size?: "smallest" | "small" | "medium" | "large";
|
|
3
4
|
className?: string;
|
|
@@ -6,11 +7,11 @@ export interface AIIconProps {
|
|
|
6
7
|
* AI-styled AutoAwesome icon with gradient coloring.
|
|
7
8
|
* Used consistently across AI features for visual identification.
|
|
8
9
|
*/
|
|
9
|
-
export declare function AIIcon({ size, className }: AIIconProps):
|
|
10
|
+
export declare function AIIcon({ size, className }: AIIconProps): React.JSX.Element;
|
|
10
11
|
/**
|
|
11
12
|
* Small animated dot indicator for AI-modified elements.
|
|
12
13
|
* Shows a pulsing gradient dot.
|
|
13
14
|
*/
|
|
14
15
|
export declare function AIModifiedIndicator({ className }: {
|
|
15
16
|
className?: string;
|
|
16
|
-
}):
|
|
17
|
+
}): React.JSX.Element;
|
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
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;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const UIStyleGuide: () => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare function LanguageToggle(): React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
/** Google Identity Services SDK — injected by the GIS <script> tag. */
|
|
3
3
|
declare global {
|
|
4
4
|
interface Window {
|
|
@@ -106,4 +106,4 @@ export interface LoginViewProps {
|
|
|
106
106
|
* Feature-detects capabilities to show/hide login methods.
|
|
107
107
|
* @group Core
|
|
108
108
|
*/
|
|
109
|
-
export declare function LoginView({ logo, authController, noUserComponent, disableSignupScreen, disabled, notAllowedError, googleClientId, githubClientId, linkedinClientId, title, subtitle, needsSetup, registrationEnabled, additionalComponent, defaultEmail, defaultPassword }: LoginViewProps):
|
|
109
|
+
export declare function LoginView({ logo, authController, noUserComponent, disableSignupScreen, disabled, notAllowedError, googleClientId, githubClientId, linkedinClientId, title, subtitle, needsSetup, registrationEnabled, additionalComponent, defaultEmail, defaultPassword }: LoginViewProps): React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare function NotFoundPage(): React.JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface SchemaDriftContextValue {
|
|
3
|
+
/** Report a schema drift error (call from any data-loading hook). */
|
|
4
|
+
reportSchemaDrift: (message: string) => void;
|
|
5
|
+
/** The most recent schema drift message, or null. */
|
|
6
|
+
schemaDriftMessage: string | null;
|
|
7
|
+
/** Dismiss the banner for this session. */
|
|
8
|
+
dismiss: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function useSchemaDriftContext(): SchemaDriftContextValue;
|
|
11
|
+
/**
|
|
12
|
+
* Detects schema drift from an error object.
|
|
13
|
+
* Checks both the error code (from `RebaseApiError`) and the message
|
|
14
|
+
* for schema drift indicators.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isSchemaDriftError(error: unknown): boolean;
|
|
17
|
+
export declare function SchemaDriftProvider({ children }: {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
}): React.JSX.Element;
|
|
20
|
+
export interface SchemaDriftBannerProps {
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Persistent banner shown when a schema drift error is detected.
|
|
25
|
+
*/
|
|
26
|
+
export declare function SchemaDriftBanner({ className }: SchemaDriftBannerProps): React.JSX.Element | null;
|
|
27
|
+
export {};
|
|
@@ -6,4 +6,4 @@ export interface UnsavedChangesDialogProps {
|
|
|
6
6
|
handleOk: () => void;
|
|
7
7
|
handleCancel: () => void;
|
|
8
8
|
}
|
|
9
|
-
export declare function UnsavedChangesDialog({ open, handleOk, handleCancel, body, title }: UnsavedChangesDialogProps):
|
|
9
|
+
export declare function UnsavedChangesDialog({ open, handleOk, handleCancel, body, title }: UnsavedChangesDialogProps): React.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
/**
|
|
2
3
|
* Represents a selectable user item with optional role information.
|
|
3
4
|
*/
|
|
@@ -59,4 +60,4 @@ export interface UserSelectPopoverProps {
|
|
|
59
60
|
*
|
|
60
61
|
* @group Components
|
|
61
62
|
*/
|
|
62
|
-
export declare function UserSelectPopover({ selectedUser, onUserSelected, users, loading, currentUser, defaultLabel, renderLimit, className, size }: UserSelectPopoverProps):
|
|
63
|
+
export declare function UserSelectPopover({ selectedUser, onUserSelected, users, loading, currentUser, defaultLabel, renderLimit, className, size }: UserSelectPopoverProps): React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare function UserSettingsView(): React.JSX.Element | null;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ComponentOverrideMap } from "@rebasepro/types";
|
|
3
|
+
/**
|
|
4
|
+
* Internal state for the component override resolution chain.
|
|
5
|
+
* Holds both global overrides (set on `<Rebase>`) and collection-scoped
|
|
6
|
+
* overrides (set on individual collections).
|
|
7
|
+
*
|
|
8
|
+
* Resolution priority: collection > global > default.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
interface ComponentOverrideState {
|
|
13
|
+
globalOverrides: ComponentOverrideMap;
|
|
14
|
+
collectionOverrides: ComponentOverrideMap;
|
|
15
|
+
}
|
|
16
|
+
export declare const ComponentOverrideContext: React.Context<ComponentOverrideState>;
|
|
17
|
+
/**
|
|
18
|
+
* Provider set at the `<Rebase>` root level to supply global component overrides.
|
|
19
|
+
*
|
|
20
|
+
* @internal — Used by the Rebase component. End users set overrides via
|
|
21
|
+
* the `components` prop on `<Rebase>`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function GlobalComponentOverrideProvider({ overrides, children }: {
|
|
24
|
+
overrides?: ComponentOverrideMap;
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
}): React.JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* Provider set at the collection level to layer collection-scoped overrides
|
|
29
|
+
* on top of global overrides.
|
|
30
|
+
*
|
|
31
|
+
* When a collection defines `components`, this provider is mounted
|
|
32
|
+
* around the collection's view subtree. Components within the subtree
|
|
33
|
+
* will resolve overrides in order: collection → global → default.
|
|
34
|
+
*
|
|
35
|
+
* @internal — Used by EntityCollectionView when a collection has
|
|
36
|
+
* `components` defined.
|
|
37
|
+
*/
|
|
38
|
+
export declare function CollectionComponentOverrideProvider({ overrides, children }: {
|
|
39
|
+
overrides?: ComponentOverrideMap;
|
|
40
|
+
children: React.ReactNode;
|
|
41
|
+
}): React.JSX.Element;
|
|
42
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
/**
|
|
3
|
-
* Context that exposes the full RebaseClient instance
|
|
3
|
+
* Context that exposes the full RebaseClient instance.
|
|
4
4
|
* Used by the JS Editor to give developer scripts access to `client.data`, `client.auth`, etc.
|
|
5
5
|
*/
|
|
6
6
|
export declare const RebaseClientInstanceContext: React.Context<any>;
|
package/dist/contexts/index.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ export * from "./AnalyticsContext";
|
|
|
8
8
|
export * from "./StorageSourceContext";
|
|
9
9
|
export * from "./UserConfigurationPersistenceContext";
|
|
10
10
|
export * from "./DialogsProvider";
|
|
11
|
-
export * from "./InternalUserManagementContext";
|
|
12
11
|
export * from "./RebaseClientInstanceContext";
|
|
13
12
|
export * from "./CustomizationControllerContext";
|
|
13
|
+
export * from "./ComponentOverrideContext";
|
package/dist/core/Rebase.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RebaseProps } from "./RebaseProps";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import { User } from "@rebasepro/types";
|
|
3
4
|
/**
|
|
4
5
|
* If you are using independent components of the CMS
|
|
@@ -11,4 +12,4 @@ import { User } from "@rebasepro/types";
|
|
|
11
12
|
*
|
|
12
13
|
* @group Core
|
|
13
14
|
*/
|
|
14
|
-
export declare function Rebase<USER extends User>(props: RebaseProps<USER>):
|
|
15
|
+
export declare function Rebase<USER extends User>(props: RebaseProps<USER>): React.JSX.Element;
|