@rebasepro/plugin-data-enhancement 0.3.0 → 0.5.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.
Files changed (68) hide show
  1. package/README.md +70 -78
  2. package/dist/admin/src/collection_editor/ui/collection_editor/PropertyEditView.d.ts +1 -0
  3. package/dist/admin/src/collection_editor/ui/collection_editor/templates/blog_template.d.ts +1 -1
  4. package/dist/admin/src/collection_editor/ui/collection_editor/templates/pages_template.d.ts +1 -1
  5. package/dist/admin/src/collection_editor/ui/collection_editor/templates/products_template.d.ts +1 -1
  6. package/dist/admin/src/collection_editor/ui/collection_editor/templates/users_template.d.ts +1 -1
  7. package/dist/admin/src/components/CollectionPanel.d.ts +83 -0
  8. package/dist/admin/src/components/EntityDetailView.d.ts +0 -3
  9. package/dist/admin/src/components/EntityEditView.d.ts +2 -3
  10. package/dist/admin/src/components/RebaseRouteDefs.d.ts +1 -1
  11. package/dist/admin/src/components/SelectableTable/SelectableTable.d.ts +2 -2
  12. package/dist/admin/src/components/SelectableTable/SelectableTableContext.d.ts +1 -1
  13. package/dist/admin/src/components/SelectableTable/SelectionStore.d.ts +3 -3
  14. package/dist/admin/src/components/index.d.ts +1 -0
  15. package/dist/admin/src/hooks/navigation/useBuildNavigationStateController.d.ts +1 -1
  16. package/dist/admin/src/hooks/navigation/useResolvedViews.d.ts +2 -5
  17. package/dist/admin/src/index.d.ts +2 -4
  18. package/dist/admin/src/util/entity_view_constants.d.ts +6 -0
  19. package/dist/admin/src/util/resolutions.d.ts +1 -2
  20. package/dist/common/src/collections/default-collections.d.ts +5 -8
  21. package/dist/common/src/data/query_builder.d.ts +6 -2
  22. package/dist/common/src/util/permissions.d.ts +14 -6
  23. package/dist/core/src/components/LoginView/LoginView.d.ts +9 -1
  24. package/dist/core/src/components/common/types.d.ts +3 -3
  25. package/dist/core/src/hooks/data/useCollectionFetch.d.ts +12 -1
  26. package/dist/index.es.js.map +1 -1
  27. package/dist/index.umd.js.map +1 -1
  28. package/dist/plugin-data-enhancement/src/components/DataEnhancementControllerProvider.d.ts +3 -3
  29. package/dist/plugin-data-enhancement/src/components/FormEnhanceAction.d.ts +0 -8
  30. package/dist/types/src/controllers/auth.d.ts +2 -2
  31. package/dist/types/src/controllers/client.d.ts +25 -40
  32. package/dist/types/src/controllers/data.d.ts +21 -3
  33. package/dist/types/src/controllers/data_driver.d.ts +5 -0
  34. package/dist/types/src/controllers/email.d.ts +2 -0
  35. package/dist/types/src/types/auth_adapter.d.ts +3 -56
  36. package/dist/types/src/types/backend.d.ts +38 -3
  37. package/dist/types/src/types/backend_hooks.d.ts +2 -17
  38. package/dist/types/src/types/collections.d.ts +30 -6
  39. package/dist/types/src/types/entity_views.d.ts +19 -28
  40. package/dist/types/src/types/properties.d.ts +9 -15
  41. package/dist/types/src/types/user_management_delegate.d.ts +16 -53
  42. package/dist/types/src/users/index.d.ts +0 -1
  43. package/dist/types/src/users/user.d.ts +0 -1
  44. package/dist/ui/src/components/Card.d.ts +2 -3
  45. package/dist/ui/src/components/FilterChip.d.ts +2 -10
  46. package/dist/ui/src/components/VirtualTable/VirtualTableProps.d.ts +8 -2
  47. package/package.json +7 -7
  48. package/src/components/DataEnhancementControllerProvider.tsx +2 -2
  49. package/src/components/FormEnhanceAction.tsx +0 -9
  50. package/dist/admin/src/components/admin/RoleChip.d.ts +0 -4
  51. package/dist/admin/src/components/admin/RolesFilterSelect.d.ts +0 -2
  52. package/dist/admin/src/components/admin/RolesView.d.ts +0 -4
  53. package/dist/admin/src/components/admin/UserRolesSelectField.d.ts +0 -2
  54. package/dist/plugin-data-enhancement/src/locales/de.d.ts +0 -21
  55. package/dist/plugin-data-enhancement/src/locales/en.d.ts +0 -21
  56. package/dist/plugin-data-enhancement/src/locales/es.d.ts +0 -21
  57. package/dist/plugin-data-enhancement/src/locales/fr.d.ts +0 -21
  58. package/dist/plugin-data-enhancement/src/locales/hi.d.ts +0 -21
  59. package/dist/plugin-data-enhancement/src/locales/it.d.ts +0 -21
  60. package/dist/plugin-data-enhancement/src/locales/pt.d.ts +0 -21
  61. package/dist/types/src/users/roles.d.ts +0 -14
  62. package/src/locales/de.ts +0 -21
  63. package/src/locales/en.ts +0 -21
  64. package/src/locales/es.ts +0 -21
  65. package/src/locales/fr.ts +0 -21
  66. package/src/locales/hi.ts +0 -21
  67. package/src/locales/it.ts +0 -21
  68. package/src/locales/pt.ts +0 -21
package/README.md CHANGED
@@ -1,89 +1,81 @@
1
- ## Rebase Data enhancement plugin
1
+ # @rebasepro/plugin-data-enhancement
2
2
 
3
- This plugin allows you to enhance data in your [Rebase](https://rebase.pro)
4
- project, using ChatGPT.
3
+ AI-powered data autofill and text autocomplete plugin for Rebase.
5
4
 
6
- The ChatGPT plugin allows you to use the OpenAI API to generate content using
7
- the latest GPT models. This plugin is able to understand the structure of your
8
- data and generate content that fits your schema.
5
+ ## Installation
9
6
 
10
- <p align="center">
11
- <img src="https://rebase.pro/img/data_enhancement.png" width="800px" alt="Data enhancement UI" />
12
- </p>
7
+ ```bash
8
+ pnpm add @rebasepro/plugin-data-enhancement
9
+ ```
10
+
11
+ **Peer dependencies:** `react >= 19.0.0`, `react-dom >= 19.0.0`, `react-router >= 6.28.0`, `react-router-dom >= 6.28.0`
12
+
13
+ ## What This Package Does
14
+
15
+ This plugin adds AI-powered capabilities to the Rebase admin panel:
16
+
17
+ - **Form autofill** — An "Enhance" action button injected into entity forms that uses AI to suggest and fill field values based on collection schema and existing data.
18
+ - **Editor autocomplete** — A streaming text autocomplete controller for rich text editors, powered by an AI backend.
19
+
20
+ It registers as a standard `RebasePlugin`, injecting UI slots and providers automatically.
13
21
 
14
- In order to be able to use this plugin you need to have a valid subscription.
22
+ ## Key Exports
15
23
 
16
- You can get a subscription in
17
- the [Rebase dashboard](https://app.rebase.pro/subscriptions).
24
+ | Export | Type | Description |
25
+ |---|---|---|
26
+ | `useDataEnhancementPlugin` | Hook | Creates the plugin. Returns a `RebasePlugin` to pass to your app's `plugins` array |
27
+ | `DataEnhancementPluginProps` | Type | Configuration options for the plugin |
28
+ | `useEditorAIController` | Hook | Returns an `EditorAIController` with a streaming `autocomplete` method for rich text editors |
18
29
 
19
- You need to specify the Firebase project id you would like to use the plugin
20
- with,
21
- in the website. And that's it!
30
+ ### `DataEnhancementPluginProps`
22
31
 
23
- No need to add any subscription key or anything like that.
32
+ | Prop | Type | Default | Description |
33
+ |---|---|---|---|
34
+ | `apiKey` | `string` | Built-in default key | API key for the data enhancement service |
35
+ | `getConfigForPath` | `(props: { path, collection, user }) => boolean` | — | Return `false` to disable enhancement for specific paths |
36
+ | `host` | `string` | — | Custom API host (development only) |
37
+
38
+ ## Quick Start
39
+
40
+ ```tsx
41
+ import { useDataEnhancementPlugin } from "@rebasepro/plugin-data-enhancement";
42
+
43
+ // In your app setup:
44
+ const dataEnhancementPlugin = useDataEnhancementPlugin({
45
+ getConfigForPath: ({ path, collection }) => {
46
+ // Disable for certain collections
47
+ return collection.name !== "system_logs";
48
+ }
49
+ });
50
+
51
+ // Pass to your Rebase app:
52
+ <RebaseFirebaseApp
53
+ plugins={[dataEnhancementPlugin]}
54
+ // ...other props
55
+ />
56
+ ```
57
+
58
+ ### Editor AI Autocomplete
24
59
 
25
60
  ```tsx
26
- import React from "react";
27
- import { Rebase } from "@rebasepro/core";
28
- import "@fontsource/rubik";
29
- import "@fontsource/jetbrains-mono";
30
-
31
- import { useDataEnhancementPlugin } from "@rebasepro/data_enhancement";
32
-
33
- // TODO: Replace with your Firebase config
34
- const firebaseConfig = {
35
- apiKey: "",
36
- authDomain: "",
37
- projectId: "",
38
- storageBucket: "",
39
- messagingSenderId: "",
40
- appId: ""
41
- };
42
-
43
- export default function App() {
44
-
45
- const dataEnhancementPlugin = useDataEnhancementPlugin({
46
- // Optional callback for defining which collections should be enhanced
47
- getConfigForPath: ({ path }) => {
48
- if (path === "books")
49
- return true;
50
- return false;
51
- }
52
- });
53
-
54
- const plugins = [dataEnhancementPlugin];
55
-
56
- const navigationController = useBuildNavigationStateController({
57
- // ... rest of your config
58
- plugins
59
- });
60
-
61
- return <Rebase
62
- name={"My Online Shop"}
63
- plugins={[dataEnhancementPlugin]}
64
- authentication={myAuthenticator}
65
- navigationController={navigationController}
66
- firebaseConfig={firebaseConfig}
67
- />;
68
- }
61
+ import { useEditorAIController } from "@rebasepro/plugin-data-enhancement";
62
+
63
+ const aiController = useEditorAIController({
64
+ getAuthToken: () => firebaseUser.getIdToken()
65
+ });
66
+
67
+ // Use in a rich text editor:
68
+ await aiController.autocomplete(
69
+ "The quick brown", // text before cursor
70
+ " over the fence", // text after cursor
71
+ (delta) => { // streaming callback
72
+ appendText(delta);
73
+ }
74
+ );
69
75
  ```
70
76
 
71
- ## How does it work?
72
-
73
- This plugin uses the OpenAI API to generate content using the latest GPT models.
74
- This plugin is able to understand the structure of your data and generate
75
- content that fits your schema.
76
-
77
- Some tips in order to get the best results:
78
-
79
- - Make sure you select the **right data** type for your fields.
80
- - The **field names** are used to generate the content and are usually enough to
81
- generate good results. If you want to get even better results, you can
82
- **add a description** to your fields. This will help the plugin understand the
83
- context of your data and generate better results.
84
- - The **collection name** is important as well.
85
- - You can establish **relations between fields** and the plugin will pick it up.
86
- e.g. if you have a field called `author` and another field called `book`, the
87
- plugin will understand that the author is related to the book and will
88
- generate content accordingly. You can use this for making **summaries, reviews,
89
- translations, SEO content**, etc.
77
+ ## Related Packages
78
+
79
+ - `@rebasepro/admin` The admin panel this plugin extends
80
+ - `@rebasepro/core` Core framework providing the plugin system
81
+ - `@rebasepro/types` Shared types (`RebasePlugin`, `EntityCollection`, etc.)
@@ -3,6 +3,7 @@ import { FormexController } from "@rebasepro/formex";
3
3
  import { Property, PropertyConfig } from "@rebasepro/types";
4
4
  export type PropertyWithId = Property & {
5
5
  id?: string;
6
+ conditions?: import('@rebasepro/types').PropertyConditions;
6
7
  };
7
8
  export type OnPropertyChangedParams = {
8
9
  id?: string;
@@ -1,2 +1,2 @@
1
- import { EntityCollection } from "@rebasepro/types";
1
+ import type { EntityCollection } from "@rebasepro/types";
2
2
  export declare const blogCollectionTemplate: EntityCollection;
@@ -1,2 +1,2 @@
1
- import { EntityCollection } from "@rebasepro/types";
1
+ import type { EntityCollection } from "@rebasepro/types";
2
2
  export declare const pagesCollectionTemplate: EntityCollection;
@@ -1,2 +1,2 @@
1
- import { EntityCollection } from "@rebasepro/types";
1
+ import type { EntityCollection } from "@rebasepro/types";
2
2
  export declare const productsCollectionTemplate: EntityCollection;
@@ -1,2 +1,2 @@
1
- import { EntityCollection } from "@rebasepro/types";
1
+ import type { EntityCollection } from "@rebasepro/types";
2
2
  export declare const usersCollectionTemplate: EntityCollection;
@@ -0,0 +1,83 @@
1
+ import type { EntityCollection, ViewMode } from "@rebasepro/types";
2
+ /**
3
+ * Props for the {@link CollectionPanel} component.
4
+ *
5
+ * This is a high-level, consumer-friendly wrapper around {@link EntityCollectionView}
6
+ * designed for embedding collection views inside custom pages (home pages,
7
+ * dashboards, entity detail views, etc.).
8
+ *
9
+ * At minimum, provide the `path` (collection slug). All other props are optional
10
+ * overrides that take precedence over the collection's default configuration.
11
+ *
12
+ * @group Components
13
+ */
14
+ export type CollectionPanelProps = {
15
+ /**
16
+ * The collection slug / path to display (e.g. "tasks", "clients").
17
+ * The collection must be registered in the Rebase context.
18
+ */
19
+ path: string;
20
+ /**
21
+ * Optional title displayed above the collection.
22
+ * Set to `false` to hide the title entirely.
23
+ * Defaults to the collection's `name`.
24
+ */
25
+ title?: string | false;
26
+ /**
27
+ * Force a specific view mode, overriding the collection's default.
28
+ */
29
+ viewMode?: ViewMode;
30
+ /**
31
+ * Override the sort field.
32
+ */
33
+ sort?: [string, "asc" | "desc"];
34
+ /**
35
+ * Maximum number of entities to display.
36
+ */
37
+ limit?: number;
38
+ /**
39
+ * Whether to sync filter/sort state with URL query params.
40
+ * Defaults to `false` (embedded panels shouldn't hijack the URL).
41
+ */
42
+ updateUrl?: boolean;
43
+ /**
44
+ * Override the entity open mode when clicking an entity.
45
+ */
46
+ openEntityMode?: "side_panel" | "full_screen" | "split" | "dialog";
47
+ /**
48
+ * Additional CSS class name for the container.
49
+ */
50
+ className?: string;
51
+ /**
52
+ * Any additional collection-level overrides (e.g. `previewProperties`,
53
+ * `enabledViews`, `entityActions`, `defaultFilter`, etc.).
54
+ */
55
+ collectionOverrides?: Partial<EntityCollection>;
56
+ };
57
+ /**
58
+ * A high-level, reusable wrapper for embedding a Rebase collection view
59
+ * inside custom pages (dashboards, home pages, entity detail views, etc.).
60
+ *
61
+ * Usage:
62
+ * ```tsx
63
+ * import { CollectionPanel } from "@rebasepro/admin";
64
+ *
65
+ * function MyDashboard() {
66
+ * return (
67
+ * <div>
68
+ * <CollectionPanel path="tasks" title="Pending Tasks" />
69
+ * <CollectionPanel
70
+ * path="clients"
71
+ * viewMode="table"
72
+ * collectionOverrides={{
73
+ * defaultFilter: { status: ["!=", "completed"] }
74
+ * }}
75
+ * />
76
+ * </div>
77
+ * );
78
+ * }
79
+ * ```
80
+ *
81
+ * @group Components
82
+ */
83
+ export declare function CollectionPanel({ path, title, viewMode, sort, limit, updateUrl, openEntityMode, className, collectionOverrides }: CollectionPanelProps): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,6 @@
1
1
  import type { EntityCollection } from "@rebasepro/types";
2
2
  import React from "react";
3
3
  import { EntityStatus } from "@rebasepro/types";
4
- export declare const MAIN_TAB_VALUE = "__main_##Q$SC^#S6";
5
- export declare const JSON_TAB_VALUE = "__json";
6
- export declare const HISTORY_TAB_VALUE = "__rebase_history";
7
4
  export type BarActionsParams = {
8
5
  values: object;
9
6
  status: EntityStatus;
@@ -2,9 +2,8 @@ import type { EntityCollection } from "@rebasepro/types";
2
2
  import React from "react";
3
3
  import { Entity, EntityStatus } from "@rebasepro/types";
4
4
  import type { EntityFormProps, OnUpdateParams } from "../types/components/EntityFormProps";
5
- export declare const MAIN_TAB_VALUE = "__main_##Q$SC^#S6";
6
- export declare const JSON_TAB_VALUE = "__json";
7
- export declare const HISTORY_TAB_VALUE = "__rebase_history";
5
+ import { MAIN_TAB_VALUE, JSON_TAB_VALUE, HISTORY_TAB_VALUE } from "../util/entity_view_constants";
6
+ export { MAIN_TAB_VALUE, JSON_TAB_VALUE, HISTORY_TAB_VALUE };
8
7
  export type BarActionsParams = {
9
8
  values: object;
10
9
  status: EntityStatus;
@@ -13,7 +13,7 @@ export interface RebaseRouteDefsProps {
13
13
  * Route definitions for the CMS.
14
14
  *
15
15
  * Defines all standard routes: home, studio home, collection view,
16
- * settings, users, roles, debug, custom views, and a catch-all 404.
16
+ * settings, debug, custom views, and a catch-all 404.
17
17
  *
18
18
  * **Independently usable**: Use this when you want Rebase routes
19
19
  * inside your own layout/navigation setup.
@@ -6,7 +6,7 @@ export type SelectableTableProps<M extends Record<string, unknown>> = {
6
6
  /**
7
7
  * Callback when a cell value changes.
8
8
  */
9
- onValueChange?: OnCellValueChange<any, M>;
9
+ onValueChange?: OnCellValueChange<unknown, M>;
10
10
  columns: VirtualTableColumn[];
11
11
  cellRenderer: React.ComponentType<CellRendererParams<Entity<M>>>;
12
12
  /**
@@ -66,7 +66,7 @@ export type SelectableTableProps<M extends Record<string, unknown>> = {
66
66
  * bust the cell memo comparator, triggering re-render of cells
67
67
  * even when rowData hasn't changed.
68
68
  */
69
- extraData?: Record<string, any>;
69
+ extraData?: unknown;
70
70
  };
71
71
  /**
72
72
  * This component is in charge of rendering a collection table with a high
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { EntityCollectionTableController } from "@rebasepro/core";
3
3
  export declare const SelectableTableContext: React.Context<EntityCollectionTableController<Record<string, unknown>>>;
4
- export declare const useSelectableTableController: () => EntityCollectionTableController<any>;
4
+ export declare const useSelectableTableController: <M extends Record<string, unknown> = Record<string, unknown>>() => EntityCollectionTableController<M>;
@@ -13,9 +13,9 @@ import { SelectedCellProps } from "@rebasepro/types";
13
13
  * derivation actually changed will re-render.
14
14
  */
15
15
  export declare function createSelectionStore(): {
16
- getSnapshot: () => SelectedCellProps<any> | undefined;
16
+ getSnapshot: () => SelectedCellProps | undefined;
17
17
  subscribe: (listener: () => void) => () => void;
18
- select: (cell: SelectedCellProps<any> | undefined) => void;
18
+ select: (cell: SelectedCellProps | undefined) => void;
19
19
  };
20
20
  export type SelectionStore = ReturnType<typeof createSelectionStore>;
21
21
  /**
@@ -24,6 +24,6 @@ export type SelectionStore = ReturnType<typeof createSelectionStore>;
24
24
  * `selected` boolean actually changes (not on every store update).
25
25
  */
26
26
  export declare function useCellSelected(store: {
27
- getSnapshot: () => SelectedCellProps<any> | undefined;
27
+ getSnapshot: () => SelectedCellProps | undefined;
28
28
  subscribe: (listener: () => void) => () => void;
29
29
  }, propertyKey: string, entityPath: string, entityId: string | number): boolean;
@@ -37,3 +37,4 @@ export * from "./RebaseAuthGate";
37
37
  export * from "./RebaseNavigation";
38
38
  export * from "./RebaseLayout";
39
39
  export * from "./RebaseRouteDefs";
40
+ export * from "./CollectionPanel";
@@ -26,7 +26,7 @@ export type BuildNavigationStateProps<EC extends EntityCollection, USER extends
26
26
  * NavigationStateController. This is a thin composition of three focused hooks:
27
27
  *
28
28
  * - useResolvedCollections: resolves collection props and registers with CollectionRegistry
29
- * - useResolvedViews: resolves view/admin view props and injects Users/Roles views
29
+ * - useResolvedViews: resolves view/admin view props
30
30
  * - useTopLevelNavigation: computes the NavigationResult from resolved data
31
31
  *
32
32
  * The NavigationStateController type is preserved as a public API.
@@ -1,6 +1,5 @@
1
1
  import type { AppView, AppViewsBuilder, EffectiveRoleController, RebasePlugin } from "@rebasepro/types";
2
- import { AuthController, RebaseData, User } from "@rebasepro/types";
3
- import { UserManagementDelegate } from "@rebasepro/types";
2
+ import type { AuthController, RebaseData, User } from "@rebasepro/types";
4
3
  export type UseResolvedViewsProps<USER extends User> = {
5
4
  authController: AuthController<USER>;
6
5
  views?: AppView[] | AppViewsBuilder;
@@ -9,7 +8,6 @@ export type UseResolvedViewsProps<USER extends User> = {
9
8
  plugins?: RebasePlugin[];
10
9
  adminMode?: "content" | "studio" | "settings";
11
10
  effectiveRoleController?: EffectiveRoleController;
12
- userManagement?: UserManagementDelegate<USER>;
13
11
  };
14
12
  export type UseResolvedViewsResult = {
15
13
  views: AppView[] | undefined;
@@ -20,8 +18,7 @@ export type UseResolvedViewsResult = {
20
18
  };
21
19
  /**
22
20
  * Hook that resolves view and admin view props (which may be async builders or arrays)
23
- * into concrete AppView[]. Also injects the Roles admin view when userManagement
24
- * is provided with roles.
21
+ * into concrete AppView[].
25
22
  *
26
23
  * Uses refs for potentially-unstable dependencies (driver, authController,
27
24
  * plugins) to avoid re-triggering effects when their object identity changes.
@@ -3,13 +3,11 @@ export type { RebaseEditorProps, JSONContent, EditorAIController } from "./edito
3
3
  export * from "./form";
4
4
  export * from "./preview";
5
5
  export * from "./routes";
6
- export { EntityView, EntitySelectionTable, SelectableTable, SelectableTableContext, EntityCollectionView, EntityCollectionViewActions, EntityCollectionCardView, EntityCard, useSelectionController, PropertyConfigBadge, PropertyIdCopyTooltip, EntityCollectionTable, EntityCollectionRowActions, VirtualTableInput, ArrayContainer, type ArrayEntryParams, ReferenceWidget, SearchIconsView, FieldCaption, EntityPreview, getFieldConfig, getFieldId, getDefaultFieldConfig, getDefaultFieldId, DEFAULT_FIELD_CONFIGS, editEntityAction, copyEntityAction, deleteEntityAction, resetPasswordAction, SideEntityProvider, Scaffold, AppBar, Drawer, DefaultDrawer, DrawerFooterActions, AdminModeSyncer, RebaseCMS, RebaseShell, RebaseAuthGate, RebaseNavigation, RebaseLayout, RebaseRouteDefs, SideDialogs, useApp } from "./components";
7
- export type { EntityViewProps, EntitySelectionProps, SelectableTableProps } from "./components";
6
+ export { EntityView, EntitySelectionTable, SelectableTable, SelectableTableContext, EntityCollectionView, EntityCollectionViewActions, EntityCollectionCardView, EntityCard, useSelectionController, PropertyConfigBadge, PropertyIdCopyTooltip, EntityCollectionTable, EntityCollectionRowActions, VirtualTableInput, ArrayContainer, type ArrayEntryParams, ReferenceWidget, SearchIconsView, FieldCaption, EntityPreview, getFieldConfig, getFieldId, getDefaultFieldConfig, getDefaultFieldId, DEFAULT_FIELD_CONFIGS, editEntityAction, copyEntityAction, deleteEntityAction, resetPasswordAction, SideEntityProvider, Scaffold, AppBar, Drawer, DefaultDrawer, DrawerFooterActions, AdminModeSyncer, RebaseCMS, RebaseShell, RebaseAuthGate, RebaseNavigation, RebaseLayout, RebaseRouteDefs, SideDialogs, useApp, CollectionPanel } from "./components";
7
+ export type { EntityViewProps, EntitySelectionProps, SelectableTableProps, CollectionPanelProps } from "./components";
8
8
  export * from "./hooks";
9
9
  export { addInitialSlash, removeInitialSlash, removeTrailingSlash, removeInitialAndTrailingSlashes, getLastSegment, getCollectionBySlugWithin, getCollectionPathsCombinations, resolveCollectionPathIds, mergeEntityActions, resolveEntityAction, resolveEntityView, isReferenceProperty, isRelationProperty, getIconForWidget, getIconForProperty, getPropertyInPath, getResolvedPropertyInPath, getBracketNotation, getPropertiesWithPropertiesOrder, getDefaultPropertiesOrder, getEntityPreviewKeys, getEntityTitlePropertyKey } from "./util";
10
10
  export * from "./data_import";
11
11
  export * from "./data_export";
12
12
  export * from "./collection_editor";
13
- export { RolesFilterSelect } from "./components/admin/RolesFilterSelect";
14
- export { UserRolesSelectField } from "./components/admin/UserRolesSelectField";
15
13
  export { CreationResultDialog } from "./components/admin/CreationResultDialog";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Shared tab value constants used by EntityEditView and EntityDetailView.
3
+ */
4
+ export declare const MAIN_TAB_VALUE = "__main_##Q$SC^#S6";
5
+ export declare const JSON_TAB_VALUE = "__json";
6
+ export declare const HISTORY_TAB_VALUE = "__rebase_history";
@@ -1,5 +1,4 @@
1
- import type { EntityCustomView } from "@rebasepro/types";
2
- import type { CustomizationController, EntityAction } from "@rebasepro/types";
1
+ import type { CustomizationController, EntityAction, EntityCustomView } from "@rebasepro/types";
3
2
  export declare function resolveEntityView(entityView: string | EntityCustomView<any>, contextEntityViews?: EntityCustomView<any>[]): EntityCustomView<any> | undefined;
4
3
  export declare function resolveEntityAction<M extends Record<string, unknown>>(entityAction: string | EntityAction<M>, contextEntityActions?: EntityAction<M>[]): EntityAction<M> | undefined;
5
4
  export declare function resolvedSelectedEntityView<M extends Record<string, unknown>>(customViews: (string | EntityCustomView<M>)[] | undefined, customizationController: CustomizationController, selectedTab?: string, _canEdit?: boolean): {
@@ -1,12 +1,9 @@
1
- import { PostgresCollection } from "@rebasepro/types";
1
+ import type { PostgresCollection } from "@rebasepro/types";
2
2
  /**
3
- * Default users collection definition.
3
+ * Default users collection.
4
4
  *
5
- * Shared between the admin UI (for navigation/display) and the backend
6
- * (for schema generation). Both consumers prepend this to the developer's
7
- * collections array and rely on generic slug-based deduplication
8
- * (Map keyed by slug, last-write-wins) so that developer-defined
9
- * collections with the same slug override this default — no hardcoded
10
- * string checks required.
5
+ * Prepended to the developer's collections array by the admin and server.
6
+ * Slug-based dedup (Map keyed by slug, last-write-wins) lets developers
7
+ * override by defining their own collection with `slug: "users"`.
11
8
  */
12
9
  export declare const defaultUsersCollection: PostgresCollection;
@@ -1,4 +1,7 @@
1
- import { FindResponse, CollectionAccessor, QueryBuilderInterface, FilterOperator } from "@rebasepro/types";
1
+ import { FindResponse, CollectionAccessor, QueryBuilderInterface, FilterOperator, LogicalCondition, WhereValue, FilterCondition } from "@rebasepro/types";
2
+ export declare function or(...conditions: (FilterCondition | LogicalCondition)[]): LogicalCondition;
3
+ export declare function and(...conditions: (FilterCondition | LogicalCondition)[]): LogicalCondition;
4
+ export declare function cond(column: string, operator: FilterOperator, value: unknown): FilterCondition;
2
5
  export declare class QueryBuilder<M extends Record<string, unknown> = Record<string, unknown>> implements QueryBuilderInterface<M> {
3
6
  private collection;
4
7
  private params;
@@ -8,7 +11,8 @@ export declare class QueryBuilder<M extends Record<string, unknown> = Record<str
8
11
  * @example
9
12
  * client.collection('users').where('age', '>=', 18).find()
10
13
  */
11
- where(column: keyof M & string, operator: FilterOperator, value: unknown): this;
14
+ where<K extends keyof M & string>(column: K, operator: FilterOperator, value: WhereValue<M[K]>): this;
15
+ where(logicalCondition: LogicalCondition): this;
12
16
  /**
13
17
  * Order the results by a specific column.
14
18
  * @example
@@ -1,6 +1,14 @@
1
- import { AuthController, Entity, EntityCollection, User } from "@rebasepro/types";
2
- export declare function checkOperation<M extends Record<string, unknown>, USER extends User>(collection: EntityCollection<M>, authController: AuthController<USER>, entity: Entity<M> | null, targetOperation: "select" | "insert" | "update" | "delete"): boolean;
3
- export declare function canReadCollection<M extends Record<string, unknown>, USER extends User>(collection: EntityCollection<M>, authController: AuthController<USER>): boolean;
4
- export declare function canEditEntity<M extends Record<string, unknown>, USER extends User>(collection: EntityCollection<M>, authController: AuthController<USER>, path: string, entity: Entity<M> | null): boolean;
5
- export declare function canCreateEntity<M extends Record<string, unknown>, USER extends User>(collection: EntityCollection<M>, authController: AuthController<USER>, path: string, entity: Entity<M> | null): boolean;
6
- export declare function canDeleteEntity<M extends Record<string, unknown>, USER extends User>(collection: EntityCollection<M>, authController: AuthController<USER>, path: string, entity: Entity<M> | null): boolean;
1
+ import { Entity, EntityCollection, User } from "@rebasepro/types";
2
+ /**
3
+ * Minimal auth context for permission checking.
4
+ * Only requires the user object avoids forcing callers to construct
5
+ * a full AuthController just to check permissions.
6
+ */
7
+ export interface AuthContext<USER extends User = User> {
8
+ user: USER | null;
9
+ }
10
+ export declare function checkOperation<M extends Record<string, unknown>, USER extends User>(collection: EntityCollection<M>, authContext: AuthContext<USER>, entity: Entity<M> | null, targetOperation: "select" | "insert" | "update" | "delete"): boolean;
11
+ export declare function canReadCollection<M extends Record<string, unknown>, USER extends User>(collection: EntityCollection<M>, authContext: AuthContext<USER>): boolean;
12
+ export declare function canEditEntity<M extends Record<string, unknown>, USER extends User>(collection: EntityCollection<M>, authContext: AuthContext<USER>, path: string, entity: Entity<M> | null): boolean;
13
+ export declare function canCreateEntity<M extends Record<string, unknown>, USER extends User>(collection: EntityCollection<M>, authContext: AuthContext<USER>, path: string, entity: Entity<M> | null): boolean;
14
+ export declare function canDeleteEntity<M extends Record<string, unknown>, USER extends User>(collection: EntityCollection<M>, authContext: AuthContext<USER>, path: string, entity: Entity<M> | null): boolean;
@@ -92,10 +92,18 @@ export interface LoginViewProps {
92
92
  * If not set, derived from `authController.capabilities.registration`.
93
93
  */
94
94
  registrationEnabled?: boolean;
95
+ /**
96
+ * Pre-fill the email field (e.g. for demo or testing environments).
97
+ */
98
+ defaultEmail?: string;
99
+ /**
100
+ * Pre-fill the password field (e.g. for demo or testing environments).
101
+ */
102
+ defaultPassword?: string;
95
103
  }
96
104
  /**
97
105
  * Generic login view component that works with any AuthControllerExtended.
98
106
  * Feature-detects capabilities to show/hide login methods.
99
107
  * @group Core
100
108
  */
101
- export declare function LoginView({ logo, authController, noUserComponent, disableSignupScreen, disabled, notAllowedError, googleClientId, githubClientId, linkedinClientId, title, subtitle, needsSetup, registrationEnabled, additionalComponent }: LoginViewProps): import("react/jsx-runtime").JSX.Element;
109
+ export declare function LoginView({ logo, authController, noUserComponent, disableSignupScreen, disabled, notAllowedError, googleClientId, githubClientId, linkedinClientId, title, subtitle, needsSetup, registrationEnabled, additionalComponent, defaultEmail, defaultPassword }: LoginViewProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import type { Property } from "@rebasepro/types";
1
+ import type { Property, Entity } from "@rebasepro/types";
2
2
  import { CollectionSize, SelectedCellProps } from "@rebasepro/types";
3
3
  export type EntityCollectionTableController<M extends Record<string, unknown>> = {
4
4
  /**
@@ -26,7 +26,7 @@ export type EntityCollectionTableController<M extends Record<string, unknown>> =
26
26
  * Callback used when the value of a cell has changed.
27
27
  * @param params
28
28
  */
29
- onValueChange?: (params: OnCellValueChangeParams<unknown, M>) => void;
29
+ onValueChange?: (params: OnCellValueChangeParams<unknown, Entity<M>>) => void;
30
30
  /**
31
31
  * Size of the elements in the collection
32
32
  */
@@ -56,7 +56,7 @@ export type UniqueFieldValidator = (props: {
56
56
  * Callback when a cell has changed in a table
57
57
  * @group Collection components
58
58
  */
59
- export type OnCellValueChange<T, M extends Record<string, unknown>> = (params: OnCellValueChangeParams<T, M>) => Promise<void> | void;
59
+ export type OnCellValueChange<T, M extends Record<string, unknown>> = (params: OnCellValueChangeParams<T, Entity<M>>) => Promise<void> | void;
60
60
  /**
61
61
  * @group Collection components
62
62
  */
@@ -16,6 +16,14 @@ export interface CollectionFetchProps<M extends Record<string, any>> {
16
16
  * Number of entities to fetch
17
17
  */
18
18
  itemCount?: number;
19
+ /**
20
+ * Number of items to skip
21
+ */
22
+ offset?: number;
23
+ /**
24
+ * Page number (1-indexed), alternative to offset
25
+ */
26
+ page?: number;
19
27
  /**
20
28
  * Filter the fetched data by the property
21
29
  */
@@ -37,6 +45,7 @@ export interface CollectionFetchResult<M extends Record<string, any>> {
37
45
  dataLoading: boolean;
38
46
  noMoreToLoad: boolean;
39
47
  dataLoadingError?: Error;
48
+ totalCount?: number;
40
49
  }
41
50
  /**
42
51
  * This hook is used to fetch collections using a given collection
@@ -45,7 +54,9 @@ export interface CollectionFetchResult<M extends Record<string, any>> {
45
54
  * @param filterValues
46
55
  * @param sortBy
47
56
  * @param itemCount
57
+ * @param offset
58
+ * @param page
48
59
  * @param searchString
49
60
  * @group Hooks and utilities
50
61
  */
51
- export declare function useCollectionFetch<M extends Record<string, any>, USER extends User>({ path, collection, filterValues, sortBy, itemCount, searchString }: CollectionFetchProps<M>): CollectionFetchResult<M>;
62
+ export declare function useCollectionFetch<M extends Record<string, any>, USER extends User>({ path, collection, filterValues, sortBy, itemCount, offset, page, searchString }: CollectionFetchProps<M>): CollectionFetchResult<M>;