@rebasepro/core 0.0.1-canary.4d4fb3e → 0.0.1-canary.ca2cb6e

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 (91) hide show
  1. package/README.md +2 -2
  2. package/dist/components/AuthSimulationMenu.d.ts +0 -0
  3. package/dist/components/UserDisplay.d.ts +1 -1
  4. package/dist/components/UserSelectPopover.d.ts +1 -1
  5. package/dist/components/common/types.d.ts +4 -0
  6. package/dist/core/PluginLifecycleManager.d.ts +1 -1
  7. package/dist/core/PluginProviderStack.d.ts +1 -1
  8. package/dist/core/RebaseProps.d.ts +1 -1
  9. package/dist/hooks/data/useEntityFetch.d.ts +8 -0
  10. package/dist/hooks/data/useUserSelector.d.ts +31 -0
  11. package/dist/hooks/index.d.ts +1 -0
  12. package/dist/hooks/useBackendStorageSource.d.ts +1 -1
  13. package/dist/hooks/useStudioBridge.d.ts +1 -1
  14. package/dist/hooks/useTranslation.d.ts +1 -1
  15. package/dist/i18n/RebaseI18nProvider.d.ts +3 -3
  16. package/dist/index.es.js +1428 -2604
  17. package/dist/index.es.js.map +1 -1
  18. package/dist/index.umd.js +1431 -2608
  19. package/dist/index.umd.js.map +1 -1
  20. package/dist/locales/en.d.ts +1 -1
  21. package/dist/locales/es.d.ts +1 -1
  22. package/dist/util/constants.d.ts +1 -0
  23. package/dist/util/icon_synonyms.d.ts +1 -1853
  24. package/dist/util/icons.d.ts +4 -0
  25. package/dist/util/index.d.ts +1 -0
  26. package/dist/vitePlugin.js +0 -1
  27. package/package.json +137 -139
  28. package/src/components/AIIcon.tsx +11 -3
  29. package/src/components/AuthSimulationMenu.tsx +0 -0
  30. package/src/components/Debug/UIReferenceView.tsx +175 -177
  31. package/src/components/Debug/UIStyleGuide.tsx +13 -20
  32. package/src/components/ErrorView.tsx +3 -2
  33. package/src/components/LanguageToggle.tsx +10 -9
  34. package/src/components/LoginView/LoginView.tsx +55 -67
  35. package/src/components/RebaseLogo.tsx +3 -3
  36. package/src/components/UnsavedChangesDialog.tsx +1 -3
  37. package/src/components/UserDisplay.tsx +5 -4
  38. package/src/components/UserSelectPopover.tsx +15 -25
  39. package/src/components/UserSettingsView.tsx +7 -15
  40. package/src/components/common/types.tsx +4 -0
  41. package/src/components/common/useColumnsIds.tsx +1 -1
  42. package/src/components/common/useDataTableController.tsx +51 -31
  43. package/src/components/index.tsx +0 -4
  44. package/src/contexts/AdminModeController.tsx +1 -1
  45. package/src/contexts/DialogsProvider.tsx +7 -5
  46. package/src/contexts/EffectiveRoleController.tsx +1 -1
  47. package/src/contexts/ModeController.tsx +1 -1
  48. package/src/core/PluginLifecycleManager.tsx +2 -1
  49. package/src/core/PluginProviderStack.tsx +1 -1
  50. package/src/core/Rebase.tsx +20 -24
  51. package/src/core/RebaseProps.tsx +1 -3
  52. package/src/core/RebaseRouter.tsx +1 -1
  53. package/src/hooks/ApiConfigContext.tsx +2 -1
  54. package/src/hooks/data/delete.ts +1 -1
  55. package/src/hooks/data/save.ts +4 -4
  56. package/src/hooks/data/useCollectionFetch.tsx +18 -10
  57. package/src/hooks/data/useEntityFetch.tsx +31 -9
  58. package/src/hooks/data/useRelationSelector.tsx +10 -10
  59. package/src/hooks/data/useUserSelector.tsx +157 -0
  60. package/src/hooks/index.tsx +1 -0
  61. package/src/hooks/useAuthSubscription.ts +35 -28
  62. package/src/hooks/useBackendStorageSource.ts +57 -60
  63. package/src/hooks/useBuildEffectiveRoleController.tsx +3 -3
  64. package/src/hooks/useBuildLocalConfigurationPersistence.tsx +12 -3
  65. package/src/hooks/useBuildModeController.tsx +6 -6
  66. package/src/hooks/useClipboard.tsx +11 -11
  67. package/src/hooks/useCollapsedGroups.ts +7 -6
  68. package/src/hooks/usePermissions.ts +3 -3
  69. package/src/hooks/useRebaseContext.tsx +1 -1
  70. package/src/hooks/useRebaseRegistry.tsx +7 -4
  71. package/src/hooks/useSlot.tsx +28 -2
  72. package/src/hooks/useStudioBridge.tsx +13 -11
  73. package/src/hooks/useTranslation.ts +7 -5
  74. package/src/hooks/useUnsavedChangesDialog.tsx +10 -8
  75. package/src/hooks/useValidateAuthenticator.tsx +4 -3
  76. package/src/i18n/RebaseI18nProvider.tsx +9 -9
  77. package/src/locales/de.ts +47 -3
  78. package/src/locales/en.ts +52 -8
  79. package/src/locales/es.ts +50 -6
  80. package/src/locales/fr.ts +50 -6
  81. package/src/locales/hi.ts +55 -11
  82. package/src/locales/it.ts +53 -9
  83. package/src/locales/pt.ts +50 -6
  84. package/src/util/constants.ts +7 -0
  85. package/src/util/entity_cache.ts +3 -0
  86. package/src/util/icon_list.ts +1 -1
  87. package/src/util/icon_synonyms.ts +1 -1853
  88. package/src/util/icons.tsx +72 -17
  89. package/src/util/index.ts +1 -0
  90. package/src/util/useStorageUploadController.tsx +4 -3
  91. package/src/vitePlugin.ts +4 -5
package/README.md CHANGED
@@ -69,9 +69,9 @@ Rebase has been meticulously crafted to make it incredibly easy for developers
69
69
  to build a CMS/admin tool while offering an excellent data editing experience
70
70
  and a user-friendly interface for marketers and content managers.
71
71
 
72
- ### 🏓 Exceptional Spreadsheet View
72
+ ### 🏓 Exceptional Table View
73
73
 
74
- We've developed a highly efficient windowed **spreadsheet view** for
74
+ We've developed a highly efficient windowed **table view** for
75
75
  collections, allowing inline editing for most common fields, as well as popup
76
76
  views for other cases and your custom field implementations.
77
77
 
File without changes
@@ -2,6 +2,6 @@ import { User } from "@rebasepro/types";
2
2
  /**
3
3
  * Component to render a single user with name and email
4
4
  */
5
- export declare function UserDisplay({ user, }: {
5
+ export declare function UserDisplay({ user }: {
6
6
  user: User | null;
7
7
  }): import("react/jsx-runtime").JSX.Element;
@@ -59,4 +59,4 @@ export interface UserSelectPopoverProps {
59
59
  *
60
60
  * @group Components
61
61
  */
62
- export declare function UserSelectPopover({ selectedUser, onUserSelected, users, loading, currentUser, defaultLabel, renderLimit, className, size, }: UserSelectPopoverProps): import("react/jsx-runtime").JSX.Element;
62
+ export declare function UserSelectPopover({ selectedUser, onUserSelected, users, loading, currentUser, defaultLabel, renderLimit, className, size }: UserSelectPopoverProps): import("react/jsx-runtime").JSX.Element;
@@ -5,6 +5,10 @@ export type EntityCollectionTableController<M extends Record<string, any>> = {
5
5
  * This cell is displayed as selected
6
6
  */
7
7
  selectedCell?: SelectedCellProps<any>;
8
+ /**
9
+ * Store used to sync selection state across cells efficiently.
10
+ */
11
+ selectionStore?: any;
8
12
  /**
9
13
  * Select a table cell
10
14
  * @param cell
@@ -11,7 +11,7 @@ import type { RebasePlugin, RebaseContext } from "@rebasepro/types";
11
11
  *
12
12
  * @internal
13
13
  */
14
- export declare function PluginLifecycleManager({ plugins, context, }: {
14
+ export declare function PluginLifecycleManager({ plugins, context }: {
15
15
  plugins: RebasePlugin[];
16
16
  context: RebaseContext;
17
17
  }): null;
@@ -13,7 +13,7 @@ import React from "react";
13
13
  *
14
14
  * @group Core
15
15
  */
16
- export declare function PluginProviderStack({ plugins, scope, scopeProps, children, }: {
16
+ export declare function PluginProviderStack({ plugins, scope, scopeProps, children }: {
17
17
  plugins: RebasePlugin[];
18
18
  scope: "root" | "form";
19
19
  scopeProps?: Record<string, unknown>;
@@ -100,7 +100,7 @@ export type RebaseProps<USER extends User> = {
100
100
  * If you are using the Rebase user management plugin, this
101
101
  * prop will be implemented automatically.
102
102
  */
103
- userManagement?: UserManagementDelegate;
103
+ userManagement?: UserManagementDelegate<USER>;
104
104
  /**
105
105
  * Plugins loaded in the CMS
106
106
  */
@@ -18,6 +18,14 @@ export interface EntityFetchResult<M extends Record<string, any>> {
18
18
  dataLoading: boolean;
19
19
  dataLoadingError?: Error;
20
20
  }
21
+ /**
22
+ * Pre-populate the entity fetch cache with entities loaded from a collection.
23
+ * This allows entity detail views to render instantly using cached data,
24
+ * while the background fetch/listener brings in fresh data.
25
+ * @param path - The collection path (e.g. "products")
26
+ * @param entities - Array of entities to cache
27
+ */
28
+ export declare function populateEntityFetchCache<M extends Record<string, any>>(path: string, entities: Entity<M>[]): void;
21
29
  /**
22
30
  * This hook is used to fetch an entity.
23
31
  * It gives real time updates if the driver supports it.
@@ -0,0 +1,31 @@
1
+ import { User } from "@rebasepro/types";
2
+ export interface UserSelectorItem {
3
+ uid: string;
4
+ label: string;
5
+ description?: string;
6
+ user: User;
7
+ }
8
+ export interface UseUserSelectorProps {
9
+ /**
10
+ * Page size for pagination. Defaults to 10.
11
+ */
12
+ pageSize?: number;
13
+ }
14
+ export interface UserSelectorController {
15
+ items: UserSelectorItem[];
16
+ isLoading: boolean;
17
+ error: Error | undefined;
18
+ search: (searchString: string) => void;
19
+ loadMore: () => void;
20
+ hasMore: boolean;
21
+ getUser: (uid: string) => User | null;
22
+ }
23
+ /**
24
+ * Hook to manage user selection with server-side search and pagination.
25
+ * Similar to useRelationSelector but for the UserManagementDelegate.
26
+ *
27
+ * If the delegate provides `searchUsers`, this hook uses server-side
28
+ * search/pagination. Otherwise it falls back to client-side filtering
29
+ * over the in-memory `users` array.
30
+ */
31
+ export declare function useUserSelector({ pageSize }?: UseUserSelectorProps): UserSelectorController;
@@ -2,6 +2,7 @@ export * from "./data/useData";
2
2
  export * from "./data/useCollectionFetch";
3
3
  export * from "./data/useEntityFetch";
4
4
  export * from "./data/useRelationSelector";
5
+ export * from "./data/useUserSelector";
5
6
  export * from "./data/save";
6
7
  export * from "./data/delete";
7
8
  export * from "./useUnsavedChangesDialog";
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * React hook for using backend storage API as a StorageSource
3
3
  */
4
- import { StorageSource } from '@rebasepro/types';
4
+ import { StorageSource } from "@rebasepro/types";
5
5
  export interface BackendStorageSourceProps {
6
6
  /**
7
7
  * Backend API URL (e.g., 'http://localhost:3001')
@@ -43,7 +43,7 @@ export declare const StudioBridgeContext: React.Context<StudioBridge>;
43
43
  * </StudioBridgeProvider>
44
44
  * ```
45
45
  */
46
- export declare function StudioBridgeProvider({ value, children, }: {
46
+ export declare function StudioBridgeProvider({ value, children }: {
47
47
  value: Partial<StudioBridge>;
48
48
  children: React.ReactNode;
49
49
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Internal hook for translating FireCMS UI strings.
2
+ * Internal hook for translating Rebase UI strings.
3
3
  *
4
4
  * Uses the `rebase_core` i18next namespace that is initialised by
5
5
  * `RebaseI18nProvider`. Do NOT use `react-i18next` directly in internal
@@ -9,7 +9,7 @@ export interface RebaseI18nProviderProps {
9
9
  /** BCP-47 locale tag, e.g. "en", "es", "fr". Defaults to "en". */
10
10
  locale?: string;
11
11
  /**
12
- * Override or extend any FireCMS UI string, keyed by locale.
12
+ * Override or extend any Rebase UI string, keyed by locale.
13
13
  *
14
14
  * @example
15
15
  * translations={{
@@ -22,10 +22,10 @@ export interface RebaseI18nProviderProps {
22
22
  };
23
23
  }
24
24
  /**
25
- * Initialises a dedicated i18next instance for FireCMS's internal UI strings.
25
+ * Initialises a dedicated i18next instance for Rebase's internal UI strings.
26
26
  *
27
27
  * This instance is isolated from any app-level i18next configuration the
28
- * consumer may have. Mount this at the top of the FireCMS component tree.
28
+ * consumer may have. Mount this at the top of the Rebase component tree.
29
29
  *
30
30
  * @internal
31
31
  */