@rebasepro/core 0.2.1 → 0.2.4
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/components/LoginView/LoginView.d.ts +17 -1
- package/dist/components/common/types.d.ts +10 -7
- package/dist/components/common/useDebouncedData.d.ts +1 -1
- package/dist/core/RebaseProps.d.ts +13 -2
- package/dist/core/RebaseRouter.d.ts +1 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/index.es.js +499 -418
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +499 -418
- package/dist/index.umd.js.map +1 -1
- package/dist/util/entity_cache.d.ts +0 -5
- package/dist/util/index.d.ts +0 -2
- package/dist/util/useStorageUploadController.d.ts +2 -2
- package/package.json +7 -6
- package/src/components/BootstrapAdminBanner.tsx +12 -3
- package/src/components/LoginView/LoginView.tsx +151 -6
- package/src/components/UserSettingsView.tsx +95 -2
- package/src/components/common/types.tsx +7 -7
- package/src/components/common/useDebouncedData.ts +2 -2
- package/src/core/Rebase.tsx +3 -2
- package/src/core/RebaseProps.tsx +15 -2
- package/src/core/RebaseRouter.tsx +1 -1
- package/src/hooks/index.tsx +0 -1
- package/src/hooks/useResolvedComponent.tsx +4 -3
- package/src/locales/en.ts +13 -0
- package/src/locales/es.ts +11 -1
- package/src/util/entity_cache.ts +1 -27
- package/src/util/icon_list.ts +2 -2
- package/src/util/index.ts +2 -2
- package/src/util/useStorageUploadController.tsx +4 -4
- package/dist/hooks/useValidateAuthenticator.d.ts +0 -21
- package/dist/util/icon_synonyms.d.ts +0 -1
- package/dist/util/useTraceUpdate.d.ts +0 -2
- package/src/hooks/useValidateAuthenticator.tsx +0 -116
- package/src/util/icon_synonyms.ts +0 -1
- package/src/util/useTraceUpdate.tsx +0 -24
|
@@ -66,6 +66,22 @@ export interface LoginViewProps {
|
|
|
66
66
|
* Required when Google login is enabled via ID token flow.
|
|
67
67
|
*/
|
|
68
68
|
googleClientId?: string;
|
|
69
|
+
/**
|
|
70
|
+
* GitHub client ID for GitHub OAuth.
|
|
71
|
+
*/
|
|
72
|
+
githubClientId?: string;
|
|
73
|
+
/**
|
|
74
|
+
* LinkedIn client ID for LinkedIn OAuth.
|
|
75
|
+
*/
|
|
76
|
+
linkedinClientId?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Optional custom title shown above options
|
|
79
|
+
*/
|
|
80
|
+
title?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Optional custom subtitle shown above options
|
|
83
|
+
*/
|
|
84
|
+
subtitle?: string;
|
|
69
85
|
/**
|
|
70
86
|
* When true, shows bootstrap/setup UI (first-user creation).
|
|
71
87
|
* If not set, derived from `authController` if it exposes `needsSetup`.
|
|
@@ -82,4 +98,4 @@ export interface LoginViewProps {
|
|
|
82
98
|
* Feature-detects capabilities to show/hide login methods.
|
|
83
99
|
* @group Core
|
|
84
100
|
*/
|
|
85
|
-
export declare function LoginView({ logo, authController, noUserComponent, disableSignupScreen, disabled, notAllowedError, googleClientId, needsSetup, registrationEnabled }: LoginViewProps): import("react/jsx-runtime").JSX.Element;
|
|
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;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import type { Property } from "@rebasepro/types";
|
|
2
2
|
import { CollectionSize, SelectedCellProps } from "@rebasepro/types";
|
|
3
|
-
export type EntityCollectionTableController<M extends Record<string,
|
|
3
|
+
export type EntityCollectionTableController<M extends Record<string, unknown>> = {
|
|
4
4
|
/**
|
|
5
5
|
* This cell is displayed as selected
|
|
6
6
|
*/
|
|
7
|
-
selectedCell?: SelectedCellProps
|
|
7
|
+
selectedCell?: SelectedCellProps;
|
|
8
8
|
/**
|
|
9
9
|
* Store used to sync selection state across cells efficiently.
|
|
10
10
|
*/
|
|
11
|
-
selectionStore?:
|
|
11
|
+
selectionStore?: {
|
|
12
|
+
getSnapshot: () => SelectedCellProps | undefined;
|
|
13
|
+
subscribe: (cb: () => void) => () => void;
|
|
14
|
+
};
|
|
12
15
|
/**
|
|
13
16
|
* Select a table cell
|
|
14
17
|
* @param cell
|
|
@@ -23,7 +26,7 @@ export type EntityCollectionTableController<M extends Record<string, any>> = {
|
|
|
23
26
|
* Callback used when the value of a cell has changed.
|
|
24
27
|
* @param params
|
|
25
28
|
*/
|
|
26
|
-
onValueChange?: (params: OnCellValueChangeParams<
|
|
29
|
+
onValueChange?: (params: OnCellValueChangeParams<unknown, M>) => void;
|
|
27
30
|
/**
|
|
28
31
|
* Size of the elements in the collection
|
|
29
32
|
*/
|
|
@@ -33,7 +36,7 @@ export type EntityCollectionTableController<M extends Record<string, any>> = {
|
|
|
33
36
|
* Props passed in a callback when the content of a cell in a table has been edited
|
|
34
37
|
* @group Collection components
|
|
35
38
|
*/
|
|
36
|
-
export interface OnCellValueChangeParams<T =
|
|
39
|
+
export interface OnCellValueChangeParams<T = unknown, D = unknown> {
|
|
37
40
|
value: T;
|
|
38
41
|
propertyKey: string;
|
|
39
42
|
data?: D;
|
|
@@ -45,7 +48,7 @@ export interface OnCellValueChangeParams<T = any, D = any> {
|
|
|
45
48
|
*/
|
|
46
49
|
export type UniqueFieldValidator = (props: {
|
|
47
50
|
name: string;
|
|
48
|
-
value:
|
|
51
|
+
value: unknown;
|
|
49
52
|
property: Property;
|
|
50
53
|
entityId?: string | number;
|
|
51
54
|
}) => Promise<boolean>;
|
|
@@ -53,7 +56,7 @@ export type UniqueFieldValidator = (props: {
|
|
|
53
56
|
* Callback when a cell has changed in a table
|
|
54
57
|
* @group Collection components
|
|
55
58
|
*/
|
|
56
|
-
export type OnCellValueChange<T, M extends Record<string,
|
|
59
|
+
export type OnCellValueChange<T, M extends Record<string, unknown>> = (params: OnCellValueChangeParams<T, M>) => Promise<void> | void;
|
|
57
60
|
/**
|
|
58
61
|
* @group Collection components
|
|
59
62
|
*/
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Locale, User, AuthController, AnalyticsEvent, DataDriver, StorageSource, UserConfigurationPersistence, DatabaseAdmin, RebaseData, RebaseClient, RebaseContext, UserManagementDelegate, EntityLinkBuilder, RebasePlugin, SlotContribution, PropertyConfig, EntityCustomView, EntityAction } from "@rebasepro/types";
|
|
2
|
+
import { Locale, User, AuthController, AnalyticsEvent, DataDriver, StorageSource, UserConfigurationPersistence, DatabaseAdmin, RebaseData, RebaseClient, RebaseContext, UserManagementDelegate, EntityLinkBuilder, RebasePlugin, SlotContribution, PropertyConfig, EntityCustomView, EntityAction, RebaseTranslations } from "@rebasepro/types";
|
|
3
|
+
/** DeepPartial helper — allows partial overrides at any nesting level */
|
|
4
|
+
type DeepPartial<T> = T extends object ? {
|
|
5
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
6
|
+
} : T;
|
|
3
7
|
/**
|
|
4
8
|
* Controller to simulate different roles when dev mode is active.
|
|
5
9
|
* @group Models
|
|
@@ -116,7 +120,7 @@ export type RebaseProps<USER extends User> = {
|
|
|
116
120
|
/**
|
|
117
121
|
* Entity Views
|
|
118
122
|
*/
|
|
119
|
-
entityViews?: EntityCustomView
|
|
123
|
+
entityViews?: EntityCustomView[];
|
|
120
124
|
/**
|
|
121
125
|
* Entity Actions
|
|
122
126
|
*/
|
|
@@ -133,4 +137,11 @@ export type RebaseProps<USER extends User> = {
|
|
|
133
137
|
* Controller to simulate different roles when dev mode is active.
|
|
134
138
|
*/
|
|
135
139
|
effectiveRoleController?: EffectiveRoleController;
|
|
140
|
+
/**
|
|
141
|
+
* Override or extend any Rebase UI string, keyed by locale.
|
|
142
|
+
*/
|
|
143
|
+
translations?: {
|
|
144
|
+
[locale: string]: DeepPartial<RebaseTranslations>;
|
|
145
|
+
};
|
|
136
146
|
};
|
|
147
|
+
export {};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -26,7 +26,6 @@ export * from "./useSlot";
|
|
|
26
26
|
export * from "./useCustomizationController";
|
|
27
27
|
export * from "./useBuildLocalConfigurationPersistence";
|
|
28
28
|
export * from "./useBuildModeController";
|
|
29
|
-
export * from "./useValidateAuthenticator";
|
|
30
29
|
export * from "./useRebaseRegistry";
|
|
31
30
|
export * from "./useBackendStorageSource";
|
|
32
31
|
export * from "./usePermissions";
|