@rebasepro/app 0.11.1-canary.gfd39654 → 0.12.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.
@@ -1,4 +1,28 @@
1
1
  import { Property, WhereFilterOp } from "@rebasepro/types";
2
+ /**
3
+ * Whether a relation is one the collection's engine can compile into a
4
+ * `WHERE`.
5
+ *
6
+ * Which kinds those are is the *driver's* answer, not this function's, so it
7
+ * comes from {@link DataSourceCapabilities.filterableRelationKinds}. The admin
8
+ * is one UI over Postgres, MongoDB, Firestore and whatever a developer
9
+ * registers, and "a many-to-many compiles to an `EXISTS` over the junction" is
10
+ * a fact about the Postgres driver — true today, and not the sort of thing to
11
+ * assert on an engine's behalf.
12
+ *
13
+ * Offering an uncompilable filter is not a cosmetic bug. The Postgres driver
14
+ * used to drop a filter key it could not resolve, which *widened* the result
15
+ * set — filtering a many-to-many column returned every row instead of none.
16
+ * That now fails closed with a 400, which is correct for a real schema drift
17
+ * and wrong as the answer to a control the admin itself put on screen.
18
+ *
19
+ * A relation whose kind cannot be determined at all — no inline `relation`
20
+ * block and no stamped `resolvedRelation` — stays filterable. The server
21
+ * resolves relations before the config reaches the admin, so this is the
22
+ * hand-built-property case, and silently dropping a working filter there would
23
+ * be its own regression.
24
+ */
25
+ export declare function isFilterableRelation(property: Property, engine?: string): boolean;
2
26
  export interface ResolveFilterOperatorsParams {
3
27
  /**
4
28
  * The property to filter on. For array properties, pass the **item**
@@ -24,8 +48,9 @@ export interface ResolveFilterOperatorsParams {
24
48
  * 2. what makes sense for the property type (e.g. no `>` on booleans);
25
49
  * 3. the developer's optional narrowing — `property.admin.filterOperators`.
26
50
  *
27
- * Returns an empty array when the property is not filterable (either by
28
- * type, or because the developer disabled it with `filterOperators: []`).
51
+ * Returns an empty array when the property is not filterable by type, by
52
+ * developer narrowing (`filterOperators: []`), or because it is a relation the
53
+ * query layer has no column for (see {@link isFilterableRelation}).
29
54
  *
30
55
  * @group Models
31
56
  */
@@ -104,10 +104,18 @@ export interface LoginViewProps {
104
104
  * Pre-fill the password field (e.g. for demo or testing environments).
105
105
  */
106
106
  defaultPassword?: string;
107
+ /**
108
+ * When set, the email/password forms render a "Join the newsletter"
109
+ * opt-in checkbox. Called with the address that just authenticated —
110
+ * sign-in or registration — if the box was ticked. Wire it to whatever
111
+ * stores the subscription; failures are the callback's problem, the
112
+ * login flow never waits on it.
113
+ */
114
+ onNewsletterOptIn?: (email: string) => void;
107
115
  }
108
116
  /**
109
117
  * Generic login view component that works with any AuthControllerExtended.
110
118
  * Feature-detects capabilities to show/hide login methods.
111
119
  * @group Core
112
120
  */
113
- export declare function LoginView({ logo, authController, noUserComponent, disableSignupScreen, disabled, notAllowedError, googleClientId, githubClientId, linkedinClientId, title, subtitle, needsSetup, registrationEnabled, additionalComponent, topComponent, defaultEmail, defaultPassword }: LoginViewProps): React.JSX.Element;
121
+ export declare function LoginView({ logo, authController, noUserComponent, disableSignupScreen, disabled, notAllowedError, googleClientId, githubClientId, linkedinClientId, title, subtitle, needsSetup, registrationEnabled, additionalComponent, topComponent, defaultEmail, defaultPassword, onNewsletterOptIn }: LoginViewProps): React.JSX.Element;
@@ -1,10 +1,10 @@
1
- import type { RebaseAuthConfig } from "@rebasepro/admin-types";
1
+ import type { RebaseAuthViewConfig } from "@rebasepro/admin-types";
2
2
  /**
3
3
  * Declarative component to configure authentication in Rebase.
4
4
  * Renders nothing — purely registers config into the RebaseRegistry.
5
5
  *
6
6
  * This is a framework-level component that lives in core since
7
- * authentication is cross-cutting (CMS, Studio, any app area).
7
+ * authentication is cross-cutting (admin, Studio, any app area).
8
8
  * @group Core
9
9
  */
10
- export declare function RebaseAuth({ loginView }: RebaseAuthConfig): null;
10
+ export declare function RebaseAuth({ loginView }: RebaseAuthViewConfig): null;
@@ -2,7 +2,7 @@ import type { RebaseProps } from "./RebaseProps";
2
2
  import React from "react";
3
3
  import { User } from "@rebasepro/types";
4
4
  /**
5
- * If you are using independent components of the CMS
5
+ * If you are using independent components of the admin
6
6
  * you need to wrap them with this main component, so the internal hooks work.
7
7
  *
8
8
  * This is the main component of Rebase. It acts as the provider of all the
@@ -43,10 +43,8 @@ type DeepPartial<T> = T extends object ? {
43
43
  * Controller to simulate different roles when dev mode is active.
44
44
  * @group Models
45
45
  */
46
- export interface EffectiveRoleController {
47
- effectiveRole: string | null;
48
- setEffectiveRole: (role: string | null) => void;
49
- }
46
+ export type { EffectiveRoleController } from "@rebasepro/types";
47
+ import type { EffectiveRoleController } from "@rebasepro/types";
50
48
  /**
51
49
  * Props for the main {@link Rebase} component.
52
50
  *
@@ -116,7 +114,7 @@ export type RebaseProps<USER extends User> = {
116
114
  */
117
115
  basePath?: string;
118
116
  /**
119
- * Optional base path for the CMS collections.
117
+ * Optional base path for the admin collections.
120
118
  * Defaults to "/c"
121
119
  */
122
120
  baseCollectionPath?: string;
@@ -127,12 +125,12 @@ export type RebaseProps<USER extends User> = {
127
125
  */
128
126
  apiUrl?: string;
129
127
  /**
130
- * Format of the dates in the CMS.
128
+ * Format of the dates in the admin.
131
129
  * Defaults to 'MMMM dd, yyyy, HH:mm:ss'
132
130
  */
133
131
  dateTimeFormat?: string;
134
132
  /**
135
- * Locale of the CMS, currently only affecting dates
133
+ * Locale of the admin, currently only affecting dates
136
134
  */
137
135
  locale?: Locale;
138
136
  /**
@@ -228,7 +226,7 @@ export type RebaseProps<USER extends User> = {
228
226
  */
229
227
  userConfigPersistence?: UserConfigurationPersistence;
230
228
  /**
231
- * Callback used to get analytics events from the CMS
229
+ * Callback used to get analytics events from the admin
232
230
  */
233
231
  onAnalyticsEvent?: (event: AnalyticsEvent, data?: object) => void;
234
232
  /**
@@ -237,11 +235,11 @@ export type RebaseProps<USER extends User> = {
237
235
  */
238
236
  entityLinkBuilder?: EntityLinkBuilder;
239
237
  /**
240
- * Plugins loaded in the CMS
238
+ * Plugins loaded in the admin
241
239
  */
242
240
  plugins?: RebasePlugin[];
243
241
  /**
244
- * Extra slots for the CMS
242
+ * Extra slots for the admin
245
243
  */
246
244
  slots?: SlotContribution[];
247
245
  /**
@@ -289,4 +287,3 @@ export type RebaseProps<USER extends User> = {
289
287
  */
290
288
  components?: ComponentOverrideMap;
291
289
  };
292
- export {};
@@ -1,6 +1,6 @@
1
1
  import type { ModeController } from "./useModeController";
2
2
  /**
3
3
  * Use this hook to build a color mode controller that determines
4
- * the theme of the CMS
4
+ * the theme of the admin
5
5
  */
6
6
  export declare function useBuildModeController(): ModeController;
@@ -2,7 +2,7 @@ import type { CustomizationController } from "@rebasepro/admin-types";
2
2
  /**
3
3
  * Use this hook to retrieve the customization controller.
4
4
  * This hook includes all the customization options that can be used
5
- * to customize the CMS.
5
+ * to customize the admin.
6
6
  *
7
7
  * You will likely not need to use this hook directly.
8
8
  *
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import type { RebaseRegistryController, RebaseAdminConfig, RebaseStudioConfig, RebaseAuthConfig } from "@rebasepro/admin-types";
2
+ import type { RebaseRegistryController, RebaseAdminConfig, RebaseStudioConfig, RebaseAuthViewConfig } from "@rebasepro/admin-types";
3
3
  /**
4
4
  * Split into two contexts to prevent infinite re-render loops:
5
5
  * - DispatchContext: stable register/unregister functions (never changes identity)
@@ -10,11 +10,11 @@ import type { RebaseRegistryController, RebaseAdminConfig, RebaseStudioConfig, R
10
10
  * RebaseShell consumes state context to read the collected configs.
11
11
  */
12
12
  interface RegistryDispatch {
13
- registerCMS: (config: RebaseAdminConfig) => void;
14
- unregisterCMS: () => void;
13
+ registerAdmin: (config: RebaseAdminConfig) => void;
14
+ unregisterAdmin: () => void;
15
15
  registerStudio: (config: RebaseStudioConfig) => void;
16
16
  unregisterStudio: () => void;
17
- registerAuth: (config: RebaseAuthConfig) => void;
17
+ registerAuth: (config: RebaseAuthViewConfig) => void;
18
18
  unregisterAuth: () => void;
19
19
  }
20
20
  export declare function RebaseRegistryProvider({ children }: {
@@ -3,9 +3,9 @@ import type { CollectionRegistryController } from "@rebasepro/types";
3
3
  import type { SidePanelController, UrlController, NavigationStateController, BreadcrumbEntry, BreadcrumbsController } from "@rebasepro/admin-types";
4
4
  export type { BreadcrumbEntry, BreadcrumbsController };
5
5
  /**
6
- * StudioBridge provides optional CMS capabilities to Studio components.
7
- * When CMS is present, a bridge provider injects real implementations.
8
- * When CMS is absent, noop defaults ensure Studio works standalone.
6
+ * StudioBridge provides optional admin capabilities to Studio components.
7
+ * When the admin is present, a bridge provider injects real implementations.
8
+ * When the admin is absent, noop defaults ensure Studio works standalone.
9
9
  */
10
10
  export interface StudioBridge {
11
11
  collectionRegistry: CollectionRegistryController;
@@ -16,10 +16,10 @@ export interface StudioBridge {
16
16
  }
17
17
  export declare const StudioBridgeContext: React.Context<StudioBridge>;
18
18
  /**
19
- * Provider that injects CMS capabilities into Studio.
19
+ * Provider that injects admin capabilities into Studio.
20
20
  * Accepts partial overrides — any field not provided falls back to noop.
21
21
  *
22
- * Usage (in app wiring, when CMS is present):
22
+ * Usage (in app wiring, when the admin is present):
23
23
  * ```tsx
24
24
  * <StudioBridgeProvider value={{
25
25
  * collectionRegistry: useCollectionRegistryController(),
@@ -36,15 +36,15 @@ export declare function StudioBridgeProvider({ value, children }: {
36
36
  value: Partial<StudioBridge>;
37
37
  children: React.ReactNode;
38
38
  }): React.JSX.Element;
39
- /** Collection registry — returns noop if CMS is not present. */
39
+ /** Collection registry — returns noop if the admin is not present. */
40
40
  export declare function useStudioCollectionRegistry(): CollectionRegistryController;
41
- /** Side panel controller — returns noop if CMS is not present. */
41
+ /** Side panel controller — returns noop if the admin is not present. */
42
42
  export declare function useStudioSidePanelController(): SidePanelController;
43
- /** URL controller — returns noop if CMS is not present. */
43
+ /** URL controller — returns noop if the admin is not present. */
44
44
  export declare function useStudioUrlController(): UrlController;
45
- /** Navigation state — returns noop if CMS is not present. */
45
+ /** Navigation state — returns noop if the admin is not present. */
46
46
  export declare function useStudioNavigationState(): NavigationStateController;
47
- /** Breadcrumbs controller — returns noop if CMS is not present. */
47
+ /** Breadcrumbs controller — returns noop if the admin is not present. */
48
48
  export declare function useStudioBreadcrumbs(): BreadcrumbsController;
49
49
  /**
50
50
  * Registry that controllers use to self-register their implementations