@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.
- package/dist/collections/filter-operator-resolution.d.ts +27 -2
- package/dist/components/LoginView/LoginView.d.ts +9 -1
- package/dist/components/RebaseAuth.d.ts +3 -3
- package/dist/core/Rebase.d.ts +1 -1
- package/dist/core/RebaseProps.d.ts +8 -11
- package/dist/hooks/useBuildModeController.d.ts +1 -1
- package/dist/hooks/useCustomizationController.d.ts +1 -1
- package/dist/hooks/useRebaseRegistry.d.ts +4 -4
- package/dist/hooks/useStudioBridge.d.ts +10 -10
- package/dist/index.es.js +169 -94
- package/dist/index.es.js.map +1 -1
- package/package.json +7 -7
- package/src/collections/filter-operator-resolution.ts +40 -2
- package/src/collections/property_presentation.ts +9 -4
- package/src/collections/title-property.ts +2 -2
- package/src/components/LoginView/LoginView.tsx +61 -5
- package/src/components/RebaseAuth.tsx +3 -3
- package/src/components/common/useColumnsIds.tsx +1 -1
- package/src/core/Rebase.tsx +2 -3
- package/src/core/RebaseProps.tsx +8 -10
- package/src/hooks/useBuildModeController.tsx +1 -1
- package/src/hooks/useCustomizationController.tsx +1 -1
- package/src/hooks/useRebaseContext.tsx +1 -1
- package/src/hooks/useRebaseRegistry.tsx +9 -9
- package/src/hooks/useStudioBridge.tsx +10 -10
- package/src/index.ts +1 -1
- package/src/locales/de.ts +10 -9
- package/src/locales/en.ts +10 -9
- package/src/locales/es.ts +10 -9
- package/src/locales/fr.ts +10 -9
- package/src/locales/hi.ts +11 -10
- package/src/locales/it.ts +11 -10
- package/src/locales/pt.ts +10 -9
|
@@ -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
|
|
28
|
-
*
|
|
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 {
|
|
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 (
|
|
7
|
+
* authentication is cross-cutting (admin, Studio, any app area).
|
|
8
8
|
* @group Core
|
|
9
9
|
*/
|
|
10
|
-
export declare function RebaseAuth({ loginView }:
|
|
10
|
+
export declare function RebaseAuth({ loginView }: RebaseAuthViewConfig): null;
|
package/dist/core/Rebase.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
47
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
238
|
+
* Plugins loaded in the admin
|
|
241
239
|
*/
|
|
242
240
|
plugins?: RebasePlugin[];
|
|
243
241
|
/**
|
|
244
|
-
* Extra slots for the
|
|
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 {};
|
|
@@ -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
|
|
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,
|
|
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
|
-
|
|
14
|
-
|
|
13
|
+
registerAdmin: (config: RebaseAdminConfig) => void;
|
|
14
|
+
unregisterAdmin: () => void;
|
|
15
15
|
registerStudio: (config: RebaseStudioConfig) => void;
|
|
16
16
|
unregisterStudio: () => void;
|
|
17
|
-
registerAuth: (config:
|
|
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
|
|
7
|
-
* When
|
|
8
|
-
* When
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
43
|
+
/** URL controller — returns noop if the admin is not present. */
|
|
44
44
|
export declare function useStudioUrlController(): UrlController;
|
|
45
|
-
/** Navigation state — returns noop if
|
|
45
|
+
/** Navigation state — returns noop if the admin is not present. */
|
|
46
46
|
export declare function useStudioNavigationState(): NavigationStateController;
|
|
47
|
-
/** Breadcrumbs controller — returns noop if
|
|
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
|