@rebasepro/types 0.0.1-canary.f81da60 → 0.1.2
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 +178 -110
- package/dist/controllers/auth.d.ts +8 -2
- package/dist/controllers/client.d.ts +13 -0
- package/dist/controllers/navigation.d.ts +18 -6
- package/dist/controllers/registry.d.ts +9 -1
- package/dist/controllers/side_entity_controller.d.ts +7 -0
- package/dist/index.es.js +4 -0
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +4 -0
- package/dist/index.umd.js.map +1 -1
- package/dist/rebase_context.d.ts +17 -0
- package/dist/types/collections.d.ts +20 -1
- package/dist/types/component_ref.d.ts +47 -0
- package/dist/types/entity_views.d.ts +2 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/properties.d.ts +15 -3
- package/dist/types/translations.d.ts +2 -0
- package/package.json +1 -1
- package/src/controllers/auth.tsx +5 -2
- package/src/controllers/client.ts +15 -0
- package/src/controllers/navigation.ts +19 -7
- package/src/controllers/registry.ts +10 -1
- package/src/controllers/side_entity_controller.tsx +8 -0
- package/src/rebase_context.tsx +18 -0
- package/src/types/collections.ts +21 -1
- package/src/types/component_ref.ts +57 -0
- package/src/types/entity_views.tsx +2 -1
- package/src/types/index.ts +1 -0
- package/src/types/properties.ts +17 -2
- package/src/types/translations.ts +2 -0
package/README.md
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="https://rebase.pro/img/dark_mode.webp" alt="Intro video" style="max-width: 100%;"/>
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
1
|
<p align="center">
|
|
6
2
|
<a href="https://rebase.pro">
|
|
7
3
|
<img src="https://rebase.pro/img/logo_small.png" width="240px" alt="Rebase logo" />
|
|
@@ -9,166 +5,238 @@
|
|
|
9
5
|
</p>
|
|
10
6
|
|
|
11
7
|
<h1 align="center">Rebase</h1>
|
|
12
|
-
<h3 align="center">
|
|
13
|
-
<p align="center"
|
|
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>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
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>
|
|
14
21
|
|
|
15
|
-
<
|
|
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>
|
|
16
34
|
|
|
35
|
+
---
|
|
17
36
|
|
|
18
|
-
|
|
37
|
+
## What is Rebase?
|
|
19
38
|
|
|
20
|
-
|
|
21
|
-
that seamlessly integrates with **Firebase and Firestore** by default, but is
|
|
22
|
-
also
|
|
23
|
-
compatible with any backend.
|
|
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.
|
|
24
40
|
|
|
25
|
-
|
|
26
|
-
simple
|
|
27
|
-
to set up for standard cases and easy to extend and customize for more specific
|
|
28
|
-
needs.
|
|
41
|
+
### ✨ Key Highlights
|
|
29
42
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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.
|
|
34
49
|
|
|
35
|
-
|
|
36
|
-
out-of-the-box experience for any project.
|
|
50
|
+
---
|
|
37
51
|
|
|
38
|
-
|
|
52
|
+
## ⚡ Quick Start
|
|
39
53
|
|
|
40
|
-
Rebase
|
|
54
|
+
Scaffold a complete, self-hosted Rebase application connected to your database:
|
|
41
55
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
- React + React Router 6
|
|
56
|
+
```bash
|
|
57
|
+
npx @rebasepro/cli init my-rebase-app
|
|
58
|
+
```
|
|
46
59
|
|
|
47
|
-
|
|
60
|
+
Configure your database in `.env`, then start everything:
|
|
48
61
|
|
|
49
|
-
|
|
50
|
-
|
|
62
|
+
```bash
|
|
63
|
+
cd my-rebase-app
|
|
64
|
+
npm run dev
|
|
65
|
+
```
|
|
51
66
|
|
|
52
|
-
|
|
67
|
+
Your admin panel is running at `http://localhost:5173` and the API at `http://localhost:3001`.
|
|
53
68
|
|
|
54
|
-
|
|
69
|
+
---
|
|
55
70
|
|
|
56
|
-
|
|
71
|
+
## Features
|
|
57
72
|
|
|
58
|
-
|
|
73
|
+
### 🏓 Full Admin Panel & CMS
|
|
59
74
|
|
|
60
|
-
|
|
75
|
+
An incredibly fast, windowed spreadsheet view to manage your database with inline editing, real-time updates, filtering, sorting, and text search. Switch between multiple view modes:
|
|
61
76
|
|
|
62
|
-
|
|
77
|
+
- **Spreadsheet table** — Inline editing, column reordering, drag-and-drop
|
|
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
|
|
63
81
|
|
|
64
|
-
|
|
82
|
+
### 🔒 Typed Schema & Database Migrations
|
|
65
83
|
|
|
66
|
-
|
|
84
|
+
Define your data models using pure TypeScript collections. Rebase automatically generates your Drizzle ORM schema, handles PostgreSQL migrations, and keeps your live database perfectly in sync using built-in tooling like `rebase doctor`.
|
|
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 |
|
|
110
|
+
|---|---|
|
|
111
|
+
| **SQL Editor** | Write and execute SQL queries directly against your database with schema-aware autocomplete |
|
|
112
|
+
| **RLS Policy Editor** | Visual editor for PostgreSQL Row-Level Security policies |
|
|
113
|
+
| **Schema Visualizer** | Interactive ER diagram of your database with relationship mapping |
|
|
114
|
+
| **JS/TS Editor** | In-browser code editor for scripts and functions |
|
|
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.
|
|
122
|
+
|
|
123
|
+
### 🧬 SDK Generator
|
|
124
|
+
|
|
125
|
+
Auto-generate fully typed **TypeScript SDKs** from your collection definitions. Use them in any frontend, script, or service to interact with your Rebase backend with complete type safety.
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
npx @rebasepro/cli generate-sdk
|
|
129
|
+
```
|
|
67
130
|
|
|
68
|
-
|
|
69
|
-
to build a CMS/admin tool while offering an excellent data editing experience
|
|
70
|
-
and a user-friendly interface for marketers and content managers.
|
|
131
|
+
### 🤖 MCP Server
|
|
71
132
|
|
|
72
|
-
|
|
133
|
+
A built-in **Model Context Protocol** server that enables AI assistants to:
|
|
73
134
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
135
|
+
- Query and manage your database schema
|
|
136
|
+
- Create, read, update, and delete documents
|
|
137
|
+
- Manage users and roles
|
|
138
|
+
- Introspect your data model
|
|
77
139
|
|
|
78
|
-
|
|
79
|
-
constant updates. It also supports **text search** (through an external provider
|
|
80
|
-
like Algolia, if using Firestore), **filtering and sorting**, and **exporting**
|
|
81
|
-
data.
|
|
140
|
+
### 🔍 Schema Inference & Introspection
|
|
82
141
|
|
|
83
|
-
|
|
142
|
+
Point Rebase at an existing PostgreSQL database and automatically generate collection definitions from your tables — including types, relations, validation constraints, and more.
|
|
84
143
|
|
|
85
|
-
|
|
144
|
+
### 📥📤 Import & Export
|
|
86
145
|
|
|
87
|
-
|
|
88
|
-
navigating through **subcollections** and accessing custom views (such as custom
|
|
89
|
-
forms or blog previews). This functionality can also be accessed
|
|
90
|
-
programmatically using the `useSideEntityController` hook.
|
|
146
|
+
Import data from **CSV, JSON, and Excel** with an intuitive field mapper. Export your data in multiple formats with configurable column selection.
|
|
91
147
|
|
|
92
|
-
|
|
93
|
-
validation options. The components have been carefully designed for an
|
|
94
|
-
outstanding user experience, including advanced features like **references** to
|
|
95
|
-
other collections, **markdown**, and **array reordering**.
|
|
148
|
+
### 🧩 Plugins
|
|
96
149
|
|
|
97
|
-
|
|
98
|
-
component.
|
|
150
|
+
Extend the admin experience with first-party plugins:
|
|
99
151
|
|
|
100
|
-
|
|
101
|
-
|
|
152
|
+
- **Data Enhancement** — AI-powered field suggestions and auto-fill
|
|
153
|
+
- **Insights** — Analytics dashboards and usage metrics
|
|
102
154
|
|
|
103
|
-
###
|
|
155
|
+
### 📜 Standalone Scripting
|
|
104
156
|
|
|
105
|
-
|
|
106
|
-
delete) they can perform based on your role system. You can even configure this
|
|
107
|
-
on a per-entity or collection level.
|
|
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.
|
|
108
158
|
|
|
109
|
-
|
|
110
|
-
implement your own.
|
|
159
|
+
### 🧩 Custom Views & React Extensibility
|
|
111
160
|
|
|
112
|
-
|
|
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.
|
|
113
162
|
|
|
114
|
-
|
|
115
|
-
integrated reference fields and shortcuts.
|
|
163
|
+
---
|
|
116
164
|
|
|
117
|
-
|
|
118
|
-
collection/document/collection model.
|
|
165
|
+
## 🛠️ Core Technologies
|
|
119
166
|
|
|
120
|
-
|
|
167
|
+
Built entirely on modern, battle-tested web standards:
|
|
121
168
|
|
|
122
|
-
|
|
123
|
-
|
|
169
|
+
| Technology | What we use it for |
|
|
170
|
+
|---|---|
|
|
171
|
+
| 💙 **TypeScript 5.x** | End-to-end type safety |
|
|
172
|
+
| ⚛️ **React 19** | Component-driven UI |
|
|
173
|
+
| 🌊 **Tailwind CSS v4** | Utility-first styling |
|
|
174
|
+
| 🔌 **WebSockets** | Real-time synchronization |
|
|
175
|
+
| 🗄️ **Drizzle ORM** | Type-safe SQL migrations and queries |
|
|
176
|
+
| 🧱 **Radix UI** | Accessible UI primitives |
|
|
177
|
+
| 📝 **TipTap v3** | Rich text editing |
|
|
178
|
+
| 🌐 **Hono** | Ultrafast HTTP server framework |
|
|
124
179
|
|
|
125
|
-
|
|
126
|
-
updated in any open form view as long as it hasn't been touched by the user.
|
|
127
|
-
This enables advanced cases where a Cloud Function is triggered after saving an
|
|
128
|
-
entity, modifying some values, and requiring real-time updates.
|
|
180
|
+
---
|
|
129
181
|
|
|
130
|
-
|
|
182
|
+
## 📦 Packages
|
|
131
183
|
|
|
132
|
-
Rebase
|
|
133
|
-
specific fields for handling single and multiple file uploads, as well as
|
|
134
|
-
reordering.
|
|
184
|
+
Rebase is structured as a modular monorepo — install only the layers you need:
|
|
135
185
|
|
|
136
|
-
|
|
186
|
+
| Package | Description |
|
|
187
|
+
|---|---|
|
|
188
|
+
| `@rebasepro/types` | Core TypeScript type definitions |
|
|
189
|
+
| `@rebasepro/utils` | Shared utility functions |
|
|
190
|
+
| `@rebasepro/common` | Common modules shared across packages |
|
|
191
|
+
| `@rebasepro/formex` | Lightweight form management library |
|
|
192
|
+
| `@rebasepro/ui` | Standalone React component library (Tailwind + Radix) |
|
|
193
|
+
| `@rebasepro/core` | Core CMS logic and controllers |
|
|
194
|
+
| `@rebasepro/client` | Client-side data access layer |
|
|
195
|
+
| `@rebasepro/client-postgresql` | PostgreSQL client adapter |
|
|
196
|
+
| `@rebasepro/client-firebase` | Firebase/Firestore client adapter |
|
|
197
|
+
| `@rebasepro/server-core` | Server framework and middleware (Hono) |
|
|
198
|
+
| `@rebasepro/server-postgresql` | PostgreSQL server adapter with Drizzle |
|
|
199
|
+
| `@rebasepro/server-mongodb` | MongoDB server adapter |
|
|
200
|
+
| `@rebasepro/auth` | Authentication controllers and login views |
|
|
201
|
+
| `@rebasepro/admin` | Full admin panel interface |
|
|
202
|
+
| `@rebasepro/studio` | SQL editor, RLS editor, schema visualizer, API explorer |
|
|
203
|
+
| `@rebasepro/cli` | CLI for project scaffolding and management |
|
|
204
|
+
| `@rebasepro/sdk-generator` | TypeScript SDK code generation |
|
|
205
|
+
| `@rebasepro/mcp-server` | MCP server for AI integrations |
|
|
206
|
+
| `@rebasepro/schema-inference` | Database schema introspection and inference |
|
|
207
|
+
| `@rebasepro/plugin-data-enhancement` | AI-powered data enhancement plugin |
|
|
208
|
+
| `@rebasepro/plugin-insights` | Analytics and insights plugin |
|
|
137
209
|
|
|
138
|
-
|
|
210
|
+
---
|
|
139
211
|
|
|
140
|
-
|
|
141
|
-
[`example`](https://github.com/rebasepro/rebase/tree/master/example). It includes
|
|
142
|
-
every feature provided by this CMS.
|
|
212
|
+
## 🎨 Standalone UI Library
|
|
143
213
|
|
|
144
|
-
|
|
145
|
-
use it as it is, without linking it to the library source code. More details in
|
|
146
|
-
its README
|
|
214
|
+
Rebase exposes its design system as a completely independent library. Fully typed, accessible, and customizable via Tailwind CSS v4:
|
|
147
215
|
|
|
148
|
-
|
|
216
|
+
```bash
|
|
217
|
+
npm install @rebasepro/ui
|
|
218
|
+
```
|
|
149
219
|
|
|
150
|
-
|
|
220
|
+
---
|
|
151
221
|
|
|
152
|
-
|
|
153
|
-
happy to help!
|
|
154
|
-
`hello@rebase.pro`
|
|
222
|
+
## Demo
|
|
155
223
|
|
|
156
|
-
|
|
224
|
+
Explore a live interactive sandbox with all features — data resets periodically:
|
|
157
225
|
|
|
158
|
-
|
|
226
|
+
**👉 [demo.rebase.pro](https://demo.rebase.pro)**
|
|
159
227
|
|
|
160
|
-
|
|
161
|
-
There is an example project in the folder `example`.
|
|
228
|
+
---
|
|
162
229
|
|
|
163
|
-
|
|
164
|
-
called `firebase_config.ts`
|
|
165
|
-
in `example/src`.
|
|
230
|
+
## Support & Community
|
|
166
231
|
|
|
167
|
-
|
|
168
|
-
|
|
232
|
+
- 📖 [Documentation](https://rebase.pro/docs)
|
|
233
|
+
- 💬 [Discord Community](https://discord.gg/fxy7xsQm3m)
|
|
234
|
+
- 🐛 [GitHub Issues](https://github.com/rebasepro/rebase/issues)
|
|
235
|
+
- 📝 [Changelog](./CHANGELOG.md)
|
|
169
236
|
|
|
170
|
-
|
|
237
|
+
---
|
|
171
238
|
|
|
172
239
|
## License
|
|
173
240
|
|
|
174
|
-
MIT
|
|
241
|
+
Rebase is open-source and licensed under the **MIT License**.
|
|
242
|
+
See the full [License](https://github.com/rebasepro/rebase/blob/main/LICENSE) for details.
|
|
@@ -80,8 +80,14 @@ export type AuthController<USER extends User = User, ExtraData = unknown> = {
|
|
|
80
80
|
export interface AuthControllerExtended<USER extends User = User, ExtraData = unknown> extends AuthController<USER, ExtraData> {
|
|
81
81
|
/** Login with email and password */
|
|
82
82
|
emailPasswordLogin?(email: string, password: string): Promise<void>;
|
|
83
|
-
/** Login with a Google token
|
|
84
|
-
googleLogin
|
|
83
|
+
/** Login with a Google token or authorization code */
|
|
84
|
+
googleLogin?: {
|
|
85
|
+
(token: string, tokenType?: "idToken" | "accessToken"): Promise<void>;
|
|
86
|
+
(payload: {
|
|
87
|
+
code: string;
|
|
88
|
+
redirectUri: string;
|
|
89
|
+
}): Promise<void>;
|
|
90
|
+
};
|
|
85
91
|
/** Register a new user */
|
|
86
92
|
register?(email: string, password: string, displayName?: string): Promise<void>;
|
|
87
93
|
/** Skip login (for anonymous access if enabled) */
|
|
@@ -167,4 +167,17 @@ export interface RebaseClient<DB = unknown> {
|
|
|
167
167
|
email?: EmailService;
|
|
168
168
|
/** Admin API for user and role management */
|
|
169
169
|
admin?: AdminAPI;
|
|
170
|
+
/**
|
|
171
|
+
* The base HTTP URL of the backend server.
|
|
172
|
+
* Exposed by the SDK client (`@rebasepro/client`) and used to auto-derive
|
|
173
|
+
* the `ApiConfigProvider` URL.
|
|
174
|
+
*/
|
|
175
|
+
baseUrl?: string;
|
|
176
|
+
/**
|
|
177
|
+
* WebSocket client for realtime subscriptions and admin capabilities.
|
|
178
|
+
* Exposed by the SDK client (`@rebasepro/client`). The shape is intentionally
|
|
179
|
+
* left as `unknown` in the base interface — callers should narrow via feature
|
|
180
|
+
* detection (e.g. `typeof ws.executeSql === "function"`).
|
|
181
|
+
*/
|
|
182
|
+
ws?: unknown;
|
|
170
183
|
}
|
|
@@ -144,17 +144,18 @@ export interface AppView {
|
|
|
144
144
|
* It will still be accessible if you reach the specified path
|
|
145
145
|
*/
|
|
146
146
|
hideFromNavigation?: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Navigation group for this view.
|
|
149
|
+
* Views sharing the same group name will be visually grouped
|
|
150
|
+
* together in the drawer and home page. If not set, the view
|
|
151
|
+
* falls into the default "Views" group.
|
|
152
|
+
*/
|
|
153
|
+
group?: string;
|
|
147
154
|
/**
|
|
148
155
|
* Component to be rendered. This can be any React component, and can use
|
|
149
156
|
* any of the provided hooks
|
|
150
157
|
*/
|
|
151
158
|
view: React.ReactNode;
|
|
152
|
-
/**
|
|
153
|
-
* Optional field used to group top level navigation entries under a
|
|
154
|
-
* navigation view.
|
|
155
|
-
* This prop is ignored for admin views.
|
|
156
|
-
*/
|
|
157
|
-
group?: string;
|
|
158
159
|
/**
|
|
159
160
|
* If true, a wildcard route (slug/*) is automatically registered
|
|
160
161
|
* alongside the base route, enabling nested navigation within this view.
|
|
@@ -193,6 +194,17 @@ export interface NavigationGroupMapping {
|
|
|
193
194
|
* List of collection ids or view paths that belong to this group.
|
|
194
195
|
*/
|
|
195
196
|
entries: string[];
|
|
197
|
+
/**
|
|
198
|
+
* Configure which groups start collapsed.
|
|
199
|
+
* Set to `true` to collapse in both drawer and home page,
|
|
200
|
+
* or use an object to control each independently.
|
|
201
|
+
*
|
|
202
|
+
* @defaultValue false (expanded)
|
|
203
|
+
*/
|
|
204
|
+
collapsedByDefault?: boolean | {
|
|
205
|
+
drawer?: boolean;
|
|
206
|
+
home?: boolean;
|
|
207
|
+
};
|
|
196
208
|
}
|
|
197
209
|
export interface NavigationEntry {
|
|
198
210
|
id: string;
|
|
@@ -3,7 +3,7 @@ import type { EntityCollection } from "../types/collections";
|
|
|
3
3
|
import type { EntityCollectionsBuilder } from "../types/builders";
|
|
4
4
|
import type { EntityCustomView } from "../types/entity_views";
|
|
5
5
|
import type { EntityAction } from "../types/entity_actions";
|
|
6
|
-
import type { AppView } from "./navigation";
|
|
6
|
+
import type { AppView, NavigationGroupMapping } from "./navigation";
|
|
7
7
|
/**
|
|
8
8
|
* Options to enable the built-in collection editor.
|
|
9
9
|
* When provided to `<RebaseCMS>`, the editor is auto-wired as a native feature.
|
|
@@ -25,6 +25,14 @@ export interface RebaseCMSConfig<EC extends EntityCollection = any> {
|
|
|
25
25
|
entityViews?: EntityCustomView<any>[];
|
|
26
26
|
entityActions?: EntityAction[];
|
|
27
27
|
plugins?: any[];
|
|
28
|
+
/**
|
|
29
|
+
* Centralized configuration for how collections and views are grouped
|
|
30
|
+
* in the navigation sidebar and home page.
|
|
31
|
+
* Each mapping defines a named group and the collection/view slugs
|
|
32
|
+
* that belong to it. The array order determines group display order.
|
|
33
|
+
* Entry order within each group determines card order.
|
|
34
|
+
*/
|
|
35
|
+
navigationGroupMappings?: NavigationGroupMapping[];
|
|
28
36
|
/**
|
|
29
37
|
* Enable the built-in visual collection/schema editor.
|
|
30
38
|
* Pass `true` for zero-config, or an options object for fine-grained control.
|
|
@@ -62,6 +62,13 @@ export interface EntitySidePanelProps<M extends Record<string, unknown> = Record
|
|
|
62
62
|
* Allow the user to open the entity fullscreen
|
|
63
63
|
*/
|
|
64
64
|
allowFullScreen?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Pre-populate the form with these values when creating a new entity.
|
|
67
|
+
* Only applied when `entityId` is not set (i.e. the form is in "new" mode).
|
|
68
|
+
* Useful for actions that fetch data from an external source (e.g. a URL)
|
|
69
|
+
* and want to pre-fill the document before the user saves.
|
|
70
|
+
*/
|
|
71
|
+
defaultValues?: Partial<M>;
|
|
65
72
|
}
|
|
66
73
|
/**
|
|
67
74
|
* Controller to open the side dialog displaying entity forms
|
package/dist/index.es.js
CHANGED
|
@@ -196,6 +196,9 @@ function getDataSourceCapabilities(driver) {
|
|
|
196
196
|
function registerDataSourceCapabilities(capabilities) {
|
|
197
197
|
CAPABILITIES_REGISTRY[capabilities.key] = capabilities;
|
|
198
198
|
}
|
|
199
|
+
function isLazyComponentRef(ref) {
|
|
200
|
+
return typeof ref === "object" && ref !== null && "__rebaseLazy" in ref && ref.__rebaseLazy === true;
|
|
201
|
+
}
|
|
199
202
|
export {
|
|
200
203
|
DEFAULT_CAPABILITIES,
|
|
201
204
|
EntityReference,
|
|
@@ -209,6 +212,7 @@ export {
|
|
|
209
212
|
isBranchAdmin,
|
|
210
213
|
isDocumentAdmin,
|
|
211
214
|
isFirebaseCollection,
|
|
215
|
+
isLazyComponentRef,
|
|
212
216
|
isMongoDBCollection,
|
|
213
217
|
isPostgresCollection,
|
|
214
218
|
isSQLAdmin,
|