@rebasepro/app 0.16.1-canary.ge71347e → 0.17.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/README.md +2 -2
- package/dist/auth/types.d.ts +1 -1
- package/dist/collections/collection_view_config.d.ts +1 -1
- package/dist/collections/entity-display-cache.d.ts +1 -1
- package/dist/collections/entity-display.d.ts +1 -1
- package/dist/collections/form-layout.d.ts +1 -1
- package/dist/collections/navigation_from_path.d.ts +1 -1
- package/dist/collections/navigation_utils.d.ts +1 -1
- package/dist/collections/parent_references_from_path.d.ts +1 -1
- package/dist/collections/title-property.d.ts +1 -1
- package/dist/components/LoginView/LoginView.d.ts +1 -1
- package/dist/components/RebaseAuth.d.ts +1 -1
- package/dist/components/common/types.d.ts +1 -1
- package/dist/components/common/useColumnsIds.d.ts +1 -1
- package/dist/components/common/useDataTableController.d.ts +1 -1
- package/dist/contexts/AnalyticsContext.d.ts +1 -1
- package/dist/contexts/AuthControllerContext.d.ts +1 -1
- package/dist/contexts/CollectionResolverContext.d.ts +1 -1
- package/dist/contexts/CollectionScopeContext.d.ts +1 -1
- package/dist/contexts/ComponentOverrideContext.d.ts +1 -1
- package/dist/contexts/CustomizationControllerContext.d.ts +1 -1
- package/dist/contexts/DialogsProvider.d.ts +1 -1
- package/dist/contexts/UserConfigurationPersistenceContext.d.ts +1 -1
- package/dist/core/PluginLifecycleManager.d.ts +1 -1
- package/dist/core/PluginProviderStack.d.ts +1 -1
- package/dist/core/RebaseProps.d.ts +2 -2
- package/dist/hooks/data/delete.d.ts +1 -1
- package/dist/hooks/data/save.d.ts +1 -1
- package/dist/hooks/data/useCollection.d.ts +1 -1
- package/dist/hooks/data/useFetch.d.ts +1 -1
- package/dist/hooks/data/useRelationSelector.d.ts +1 -1
- package/dist/hooks/useAdminModeController.d.ts +2 -2
- package/dist/hooks/useAnalyticsController.d.ts +1 -1
- package/dist/hooks/useAuthController.d.ts +1 -1
- package/dist/hooks/useAuthSubscription.d.ts +1 -1
- package/dist/hooks/useBuildLocalConfigurationPersistence.d.ts +1 -1
- package/dist/hooks/useComponentOverride.d.ts +1 -1
- package/dist/hooks/useCustomizationController.d.ts +1 -1
- package/dist/hooks/useDialogsController.d.ts +1 -1
- package/dist/hooks/usePermissions.d.ts +1 -1
- package/dist/hooks/useRebaseContext.d.ts +1 -1
- package/dist/hooks/useRebaseRegistry.d.ts +4 -4
- package/dist/hooks/useSlot.d.ts +1 -1
- package/dist/hooks/useSnackbarController.d.ts +1 -1
- package/dist/hooks/useStudioBridge.d.ts +1 -1
- package/dist/hooks/useUserConfigurationPersistence.d.ts +1 -1
- package/dist/i18n/RebaseI18nProvider.d.ts +1 -1
- package/dist/index.es.js +9 -8
- package/dist/index.es.js.map +1 -1
- package/dist/internal/common.d.ts +1 -1
- package/dist/internal/useRestoreScroll.d.ts +1 -1
- package/dist/locales/de.d.ts +1 -1
- package/dist/locales/en.d.ts +1 -1
- package/dist/locales/es.d.ts +1 -1
- package/dist/locales/fr.d.ts +1 -1
- package/dist/locales/hi.d.ts +1 -1
- package/dist/locales/it.d.ts +1 -1
- package/dist/locales/pt.d.ts +1 -1
- package/dist/util/previews.d.ts +2 -2
- package/package.json +8 -8
- package/src/auth/types.ts +1 -1
- package/src/collections/collection_view_config.ts +1 -1
- package/src/collections/entity-display-cache.ts +1 -1
- package/src/collections/entity-display.ts +1 -1
- package/src/collections/entity_image_preview.ts +1 -1
- package/src/collections/form-layout.ts +2 -2
- package/src/collections/navigation_from_path.ts +1 -1
- package/src/collections/navigation_utils.ts +1 -1
- package/src/collections/parent_references_from_path.ts +1 -1
- package/src/collections/property_presentation.ts +1 -1
- package/src/collections/title-property.ts +1 -1
- package/src/components/LoginView/LoginView.tsx +1 -1
- package/src/components/RebaseAuth.tsx +1 -1
- package/src/components/common/types.tsx +1 -1
- package/src/components/common/useColumnsIds.tsx +1 -1
- package/src/components/common/useDataTableController.tsx +1 -1
- package/src/contexts/AdminModeController.tsx +2 -2
- package/src/contexts/AnalyticsContext.tsx +1 -1
- package/src/contexts/AuthControllerContext.tsx +1 -1
- package/src/contexts/CollectionResolverContext.tsx +1 -1
- package/src/contexts/CollectionScopeContext.tsx +1 -1
- package/src/contexts/ComponentOverrideContext.tsx +1 -1
- package/src/contexts/CustomizationControllerContext.tsx +1 -1
- package/src/contexts/DialogsProvider.tsx +1 -1
- package/src/contexts/UserConfigurationPersistenceContext.tsx +1 -1
- package/src/core/PluginLifecycleManager.tsx +1 -1
- package/src/core/PluginProviderStack.tsx +1 -1
- package/src/core/Rebase.tsx +4 -4
- package/src/core/RebaseProps.tsx +2 -2
- package/src/hooks/data/delete.ts +1 -1
- package/src/hooks/data/save.ts +1 -1
- package/src/hooks/data/useCollection.tsx +1 -1
- package/src/hooks/data/useFetch.tsx +1 -1
- package/src/hooks/data/useRelationSelector.tsx +1 -1
- package/src/hooks/useAdminModeController.tsx +2 -2
- package/src/hooks/useAnalyticsController.tsx +1 -1
- package/src/hooks/useAuthController.tsx +1 -1
- package/src/hooks/useAuthSubscription.ts +1 -1
- package/src/hooks/useBuildAdminModeController.tsx +9 -3
- package/src/hooks/useBuildLocalConfigurationPersistence.tsx +1 -1
- package/src/hooks/useComponentOverride.tsx +1 -1
- package/src/hooks/useCustomizationController.tsx +1 -1
- package/src/hooks/useDialogsController.tsx +1 -1
- package/src/hooks/usePermissions.ts +1 -1
- package/src/hooks/useRebaseContext.tsx +1 -1
- package/src/hooks/useRebaseRegistry.tsx +7 -7
- package/src/hooks/useSlot.tsx +1 -1
- package/src/hooks/useSnackbarController.tsx +1 -1
- package/src/hooks/useStudioBridge.tsx +1 -1
- package/src/hooks/useUserConfigurationPersistence.tsx +1 -1
- package/src/i18n/RebaseI18nProvider.tsx +1 -1
- package/src/index.ts +1 -1
- package/src/internal/common.tsx +1 -1
- package/src/internal/useRestoreScroll.tsx +1 -1
- package/src/locales/de.ts +1 -1
- package/src/locales/en.ts +1 -1
- package/src/locales/es.ts +1 -1
- package/src/locales/fr.ts +1 -1
- package/src/locales/hi.ts +1 -1
- package/src/locales/it.ts +1 -1
- package/src/locales/pt.ts +1 -1
- package/src/util/previews.ts +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @rebasepro/app
|
|
2
2
|
|
|
3
|
-
Framework-agnostic runtime for data-driven admin panels — React hooks, providers, contexts, and shared components used by `@rebasepro/
|
|
3
|
+
Framework-agnostic runtime for data-driven admin panels — React hooks, providers, contexts, and shared components used by `@rebasepro/cms` and `@rebasepro/studio`.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -166,7 +166,7 @@ function ProductList() {
|
|
|
166
166
|
|
|
167
167
|
## Related Packages
|
|
168
168
|
|
|
169
|
-
- [`@rebasepro/
|
|
169
|
+
- [`@rebasepro/cms`](../admin) — CMS views, forms, and routing (built on top of core)
|
|
170
170
|
- [`@rebasepro/ui`](../ui) — Design system components
|
|
171
171
|
- [`@rebasepro/common`](../common) — Shared utilities and collection registry
|
|
172
172
|
- [`@rebasepro/types`](../types) — TypeScript type definitions
|
package/dist/auth/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { User, AuthTokens, DeviceSession, RebaseSession, AuthChangeEvent } from "@rebasepro/types";
|
|
2
|
-
import { AuthController } from "@rebasepro/
|
|
2
|
+
import { AuthController } from "@rebasepro/cms-types";
|
|
3
3
|
import type { AuthConfigResponse } from "./api.js";
|
|
4
4
|
export type { User, AuthTokens, DeviceSession };
|
|
5
5
|
/**
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* imported.
|
|
11
11
|
*/
|
|
12
12
|
import type { ChildViewSource, CollectionConfig } from "@rebasepro/types";
|
|
13
|
-
import { type AdminCollection, type DefaultSelectedViewBuilder, type DefaultSelectedViewParams } from "@rebasepro/
|
|
13
|
+
import { type AdminCollection, type DefaultSelectedViewBuilder, type DefaultSelectedViewParams } from "@rebasepro/cms-types";
|
|
14
14
|
export declare function resolveDefaultSelectedView(defaultSelectedView: string | DefaultSelectedViewBuilder | undefined, params: DefaultSelectedViewParams): string | undefined;
|
|
15
15
|
export declare function getLocalChangesBackup(collection: AdminCollection): "manual_apply" | "auto_apply";
|
|
16
16
|
/**
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* thing: the same store answers an imperative caller (an export, a breadcrumb
|
|
13
13
|
* built outside the tree), and it is testable without a renderer.
|
|
14
14
|
*/
|
|
15
|
-
import type { EntityDisplayRole } from "@rebasepro/
|
|
15
|
+
import type { EntityDisplayRole } from "@rebasepro/cms-types";
|
|
16
16
|
export type EntityDisplayKey = string;
|
|
17
17
|
/** The identity of one role of one record, as a cache key. */
|
|
18
18
|
export declare function entityDisplayKey(path: string, entityId: string | number | undefined, role: EntityDisplayRole): EntityDisplayKey;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* await — a sort comparator, an export column, a server render — uses the key
|
|
8
8
|
* and is documented to ignore resolvers.
|
|
9
9
|
*/
|
|
10
|
-
import type { AdminCollection, EntityDisplayResolver, EntityDisplayRole } from "@rebasepro/
|
|
10
|
+
import type { AdminCollection, EntityDisplayResolver, EntityDisplayRole } from "@rebasepro/cms-types";
|
|
11
11
|
/**
|
|
12
12
|
* The property path a role is declared to read, when it is declared as a path.
|
|
13
13
|
*
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* hand-tunes. Deriving it here means it is testable in isolation, which matters
|
|
13
13
|
* because "what span does a date get" is exactly the kind of rule that rots.
|
|
14
14
|
*/
|
|
15
|
-
import type { AdminCollection, PropertySpan } from "@rebasepro/
|
|
15
|
+
import type { AdminCollection, PropertySpan } from "@rebasepro/cms-types";
|
|
16
16
|
import type { Property } from "@rebasepro/types";
|
|
17
17
|
/** A field placed on the grid. */
|
|
18
18
|
export interface ResolvedFormField {
|
|
@@ -2,7 +2,7 @@ type EntityCustomView<M extends Record<string, unknown> = Record<string, unknown
|
|
|
2
2
|
key: string;
|
|
3
3
|
[key: string]: unknown;
|
|
4
4
|
};
|
|
5
|
-
import type { AdminCollection } from "@rebasepro/
|
|
5
|
+
import type { AdminCollection } from "@rebasepro/cms-types";
|
|
6
6
|
export type NavigationViewInternal<M extends Record<string, unknown> = Record<string, unknown>> = NavigationViewEntityInternal<M> | NavigationViewCollectionInternal<M> | NavigationViewEntityCustomInternal<M>;
|
|
7
7
|
export interface NavigationViewEntityInternal<M extends Record<string, unknown>> {
|
|
8
8
|
type: "entity";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AdminCollection } from "@rebasepro/
|
|
1
|
+
import type { AdminCollection } from "@rebasepro/cms-types";
|
|
2
2
|
export declare function removeInitialAndTrailingSlashes(s: string): string;
|
|
3
3
|
export declare function removeInitialSlash(s: string): string;
|
|
4
4
|
export declare function removeTrailingSlash(s: string): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EntityReference } from "@rebasepro/types";
|
|
2
|
-
import type { AdminCollection } from "@rebasepro/
|
|
2
|
+
import type { AdminCollection } from "@rebasepro/cms-types";
|
|
3
3
|
export declare function getParentReferencesFromPath(props: {
|
|
4
4
|
path: string;
|
|
5
5
|
collections: AdminCollection[] | undefined;
|
|
@@ -21,7 +21,7 @@ declare global {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
import { AuthControllerExtended } from "@rebasepro/
|
|
24
|
+
import { AuthControllerExtended } from "@rebasepro/cms-types";
|
|
25
25
|
/**
|
|
26
26
|
* Props for the generic LoginView.
|
|
27
27
|
* Consumes {@link AuthControllerExtended} — works with any backend
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RebaseAuthViewConfig } from "@rebasepro/
|
|
1
|
+
import type { RebaseAuthViewConfig } from "@rebasepro/cms-types";
|
|
2
2
|
/**
|
|
3
3
|
* Declarative component to configure authentication in Rebase.
|
|
4
4
|
* Renders nothing — purely registers config into the RebaseRegistry.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Property, Entity } from "@rebasepro/types";
|
|
2
|
-
import { CollectionSize, SelectedCellProps } from "@rebasepro/
|
|
2
|
+
import { CollectionSize, SelectedCellProps } from "@rebasepro/cms-types";
|
|
3
3
|
export type DataCollectionTableController<M extends Record<string, unknown>> = {
|
|
4
4
|
/**
|
|
5
5
|
* This cell is displayed as selected
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Entity, FilterValues, User } from "@rebasepro/types";
|
|
2
|
-
import { EntityTableController, AdminCollection } from "@rebasepro/
|
|
2
|
+
import { EntityTableController, AdminCollection } from "@rebasepro/cms-types";
|
|
3
3
|
import { ScrollRestorationController } from "./useScrollRestoration.js";
|
|
4
4
|
export declare const DEFAULT_PAGE_SIZE = 50;
|
|
5
5
|
export type DataTableControllerProps<M extends Record<string, any> = any> = {
|
|
@@ -10,7 +10,7 @@ export type CollectionResolver = (slug: string) => {
|
|
|
10
10
|
* layer, which needs a collection's primary keys to give its rows an address.
|
|
11
11
|
*
|
|
12
12
|
* The inversion is forced by the composition: `<Rebase client>` builds the data
|
|
13
|
-
* layer, and `<
|
|
13
|
+
* layer, and `<RebaseCMS collections>` sits inside it — so the collections are
|
|
14
14
|
* not in scope where the data is created, and `Rebase` cannot take them as a
|
|
15
15
|
* prop without giving every headless BaaS app a collections argument it has no
|
|
16
16
|
* use for.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { ComponentOverrideMap } from "@rebasepro/
|
|
2
|
+
import type { ComponentOverrideMap } from "@rebasepro/cms-types";
|
|
3
3
|
/**
|
|
4
4
|
* Internal state for the component override resolution chain.
|
|
5
5
|
* Holds both global overrides (set on `<Rebase>`) and collection-scoped
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DialogsController } from "@rebasepro/
|
|
1
|
+
import type { DialogsController } from "@rebasepro/cms-types";
|
|
2
2
|
import React, { PropsWithChildren } from "react";
|
|
3
3
|
export declare const DialogsControllerContext: React.Context<DialogsController>;
|
|
4
4
|
export declare const DialogsProvider: React.FC<PropsWithChildren>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { UserConfigurationPersistence } from "@rebasepro/
|
|
2
|
+
import { UserConfigurationPersistence } from "@rebasepro/cms-types";
|
|
3
3
|
export declare const UserConfigurationPersistenceContext: React.Context<UserConfigurationPersistence | undefined>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { User, DataDriver, DataSourceDefinition, StorageSource, StorageSourceDefinition, DatabaseAdmin, RebaseClient } from "@rebasepro/types";
|
|
3
|
-
import { Locale, AuthController, AnalyticsEvent, UserConfigurationPersistence, RebaseContext, EntityLinkBuilder, RebasePlugin, SlotContribution, PropertyConfig, EntityCustomView, CollectionCustomView, EntityAction, RebaseTranslations, ComponentOverrideMap } from "@rebasepro/
|
|
3
|
+
import { Locale, AuthController, AnalyticsEvent, UserConfigurationPersistence, RebaseContext, EntityLinkBuilder, RebasePlugin, SlotContribution, PropertyConfig, EntityCustomView, CollectionCustomView, EntityAction, RebaseTranslations, ComponentOverrideMap } from "@rebasepro/cms-types";
|
|
4
4
|
/**
|
|
5
5
|
* A data source registered on `<Rebase>`. Extends the shared
|
|
6
6
|
* {@link DataSourceDefinition} with the frontend {@link DataDriver} used for
|
|
@@ -101,7 +101,7 @@ import type { EffectiveRoleController } from "@rebasepro/types";
|
|
|
101
101
|
*/
|
|
102
102
|
export type RebaseProps<USER extends User, DB = unknown> = {
|
|
103
103
|
/**
|
|
104
|
-
* The root components of your application. Use
|
|
104
|
+
* The root components of your application. Use RebaseCMS, RebaseStudio, and RebaseShell.
|
|
105
105
|
* Alternatively, pass a render function that receives { context, loading }.
|
|
106
106
|
*/
|
|
107
107
|
children: React.ReactNode | ((props: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Entity, CollectionCallbacks, User } from "@rebasepro/types";
|
|
2
|
-
import { RebaseContext, AdminCollection } from "@rebasepro/
|
|
2
|
+
import { RebaseContext, AdminCollection } from "@rebasepro/cms-types";
|
|
3
3
|
import { RebaseData } from "@rebasepro/types";
|
|
4
4
|
/**
|
|
5
5
|
* @group Hooks and utilities
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Entity, EntityStatus, EntityValues } from "@rebasepro/types";
|
|
2
|
-
import { RebaseContext, AdminCollection } from "@rebasepro/
|
|
2
|
+
import { RebaseContext, AdminCollection } from "@rebasepro/cms-types";
|
|
3
3
|
import { RebaseData } from "@rebasepro/types";
|
|
4
4
|
/**
|
|
5
5
|
* @group Hooks and utilities
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Entity, EntityRelation, FilterValues } from "@rebasepro/types";
|
|
2
|
-
import type { AdminCollection } from "@rebasepro/
|
|
2
|
+
import type { AdminCollection } from "@rebasepro/cms-types";
|
|
3
3
|
export interface RelationItem {
|
|
4
4
|
id: string | number;
|
|
5
5
|
label: string;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* @group Hooks and utilities
|
|
4
4
|
*/
|
|
5
5
|
export interface AdminModeController {
|
|
6
|
-
mode: "
|
|
7
|
-
setMode: (mode: "
|
|
6
|
+
mode: "cms" | "studio" | "settings";
|
|
7
|
+
setMode: (mode: "cms" | "studio" | "settings") => void;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
10
|
* Hook to retrieve the current admin mode ("developer" | "editor"), and `setMode`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { UserConfigurationPersistence } from "@rebasepro/
|
|
1
|
+
import { UserConfigurationPersistence } from "@rebasepro/cms-types";
|
|
2
2
|
export declare function useBuildLocalConfigurationPersistence(): UserConfigurationPersistence;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CustomizationController } from "@rebasepro/
|
|
1
|
+
import type { CustomizationController } from "@rebasepro/cms-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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Entity } from "@rebasepro/types";
|
|
2
|
-
import type { AdminCollection } from "@rebasepro/
|
|
2
|
+
import type { AdminCollection } from "@rebasepro/cms-types";
|
|
3
3
|
/**
|
|
4
4
|
* Hook to evaluate roles and permissions for the current user.
|
|
5
5
|
* It abstracts away the need to pass `authController` to permission evaluation functions.
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { RebaseRegistryController,
|
|
2
|
+
import type { RebaseRegistryController, RebaseCMSConfig, RebaseStudioConfig, RebaseAuthViewConfig } from "@rebasepro/cms-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)
|
|
6
6
|
* - StateContext: the current config values (changes when modules register)
|
|
7
7
|
*
|
|
8
|
-
* Feature components (RebaseAuth,
|
|
8
|
+
* Feature components (RebaseAuth, RebaseCMS, RebaseStudio) only consume
|
|
9
9
|
* the dispatch context, so registering does NOT cause them to re-render.
|
|
10
10
|
* RebaseShell consumes state context to read the collected configs.
|
|
11
11
|
*/
|
|
12
12
|
interface RegistryDispatch {
|
|
13
|
-
registerAdmin: (config:
|
|
13
|
+
registerAdmin: (config: RebaseCMSConfig) => void;
|
|
14
14
|
unregisterAdmin: () => void;
|
|
15
15
|
registerStudio: (config: RebaseStudioConfig) => void;
|
|
16
16
|
unregisterStudio: () => void;
|
|
@@ -27,7 +27,7 @@ export declare function RebaseRegistryProvider({ children }: {
|
|
|
27
27
|
export declare function useRebaseRegistry(): RebaseRegistryController;
|
|
28
28
|
/**
|
|
29
29
|
* Returns only the stable dispatch functions.
|
|
30
|
-
* Use this in feature components (RebaseAuth,
|
|
30
|
+
* Use this in feature components (RebaseAuth, RebaseCMS, RebaseStudio)
|
|
31
31
|
* to avoid re-render loops.
|
|
32
32
|
*/
|
|
33
33
|
export declare function useRebaseRegistryDispatch(): RegistryDispatch;
|
package/dist/hooks/useSlot.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { CollectionRegistryController } from "@rebasepro/types";
|
|
3
|
-
import type { SidePanelController, UrlController, NavigationStateController, BreadcrumbEntry, BreadcrumbsController } from "@rebasepro/
|
|
3
|
+
import type { SidePanelController, UrlController, NavigationStateController, BreadcrumbEntry, BreadcrumbsController } from "@rebasepro/cms-types";
|
|
4
4
|
export type { BreadcrumbEntry, BreadcrumbsController };
|
|
5
5
|
/**
|
|
6
6
|
* StudioBridge provides optional admin capabilities to Studio components.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from "react";
|
|
2
|
-
import { RebaseTranslations } from "@rebasepro/
|
|
2
|
+
import { RebaseTranslations } from "@rebasepro/cms-types";
|
|
3
3
|
export declare const REBASE_LOCALE_STORAGE_KEY = "rebase_locale";
|
|
4
4
|
/** DeepPartial helper — allows partial overrides at any nesting level */
|
|
5
5
|
type DeepPartial<T> = T extends object ? {
|
package/dist/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { createContext, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
import { Alert, AlertCircleIcon, AlertTriangleIcon, AppWindow, ArrowDownIcon, ArrowLeftIcon, ArrowRightLeftIcon, ArrowUpDownIcon, ArrowUpIcon, Avatar, BooleanSwitch, Button, CalendarIcon, Card, CenteredView, CheckCircle2Icon, CheckIcon, Checkbox, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronsLeftIcon, ChevronsRightIcon, Chip, CircleDotIcon, CircleUserIcon, CircularProgress, ColumnsIcon, Container, Dialog, DialogActions, DialogContent, DialogTitle, DollarSignIcon, ErrorBoundary, FileIcon, FileTextIcon, FilterChip, FilterIcon, FolderIcon, FolderKanbanIcon, IconButton, KanbanIcon, KanbanView, LanguagesIcon, LayoutGridIcon, ListIcon, ListPlusIcon, ListTodoIcon, LoadingButton, LogOutIcon, LucideIconByName, MailIcon, Menu, MenuItem, MessageCircleIcon, MoonIcon, MultiSelect, MultiSelectItem, PanelLeftIcon, Paper, PenLineIcon, PencilIcon, PhoneIcon, PinIcon, PlusIcon, Popover, RefreshCwIcon, SearchBar, Select, SelectItem, Separator, SettingsIcon, Skeleton, StickyNoteIcon, SunIcon, SunMoonIcon, Tab, Table, TableBody, TableCell, TableHeader, TableRow, Tabs, TagIcon, TextField, ToggleButtonGroup, Tooltip, Trash2Icon, TrendingUpIcon, TypeIcon, Typography, UserIcon, UserPlus, UsersIcon, VideoIcon, Wand2Icon, WrenchIcon, XIcon, cls, colorClassesMapping, coolIconKeys, defaultBorderMixin, getColorSchemeForKey, getColorSchemeForSeed, iconKeys, iconSize, lazyChunk } from "@rebasepro/ui";
|
|
3
3
|
import { ALL_WHERE_FILTER_OPS, DEFAULT_DATA_SOURCE_KEY, DEFAULT_FILTERABLE_RELATION_KINDS, DEFAULT_STORAGE_SOURCE_KEY, EntityReference, EntityRelation, GeoPoint, RebaseApiError, Vector, getDataSourceCapabilities, isLazyComponentRef, isRelationalCollectionConfig } from "@rebasepro/types";
|
|
4
|
-
import { UNRENDERED_SLOTS, resolveAdminCollection } from "@rebasepro/
|
|
4
|
+
import { UNRENDERED_SLOTS, resolveAdminCollection } from "@rebasepro/cms-types";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { SnackbarProvider as SnackbarProvider$1, useSnackbar } from "notistack";
|
|
7
7
|
import { buildRebaseData, canCreateEntity, canDeleteEntity, canEditEntity, canReadCollection, evaluateCondition, getChildViewDeclaringProperties, getChildViewRelationPropertyKeys, getEntityChildViews, getLabelOrConfigFrom, getPrimaryKeys, getSubcollections, isPropertyBuilder, normalizeOrderBy, resolveStorageFilenameString, resolveStoragePathString, resolveStorageSource, serializeOrderBy, stripCollectionPath, wrapAsEntityData, wrapAsSdkData } from "@rebasepro/common";
|
|
@@ -102,7 +102,7 @@ var ModeControllerContext = React.createContext({
|
|
|
102
102
|
});
|
|
103
103
|
var ModeControllerProvider = ModeControllerContext.Provider;
|
|
104
104
|
var AdminModeControllerContext = React.createContext({
|
|
105
|
-
mode: "
|
|
105
|
+
mode: "cms",
|
|
106
106
|
setMode: (mode) => {}
|
|
107
107
|
});
|
|
108
108
|
var AdminModeControllerProvider = AdminModeControllerContext.Provider;
|
|
@@ -307,7 +307,7 @@ function CollectionScopeProvider({ collection, children }) {
|
|
|
307
307
|
* layer, which needs a collection's primary keys to give its rows an address.
|
|
308
308
|
*
|
|
309
309
|
* The inversion is forced by the composition: `<Rebase client>` builds the data
|
|
310
|
-
* layer, and `<
|
|
310
|
+
* layer, and `<RebaseCMS collections>` sits inside it — so the collections are
|
|
311
311
|
* not in scope where the data is created, and `Rebase` cannot take them as a
|
|
312
312
|
* prop without giving every headless BaaS app a collections argument it has no
|
|
313
313
|
* use for.
|
|
@@ -1556,7 +1556,8 @@ function removeStoredString(key) {
|
|
|
1556
1556
|
* whether the UI shows Developer or Editor tools.
|
|
1557
1557
|
*/
|
|
1558
1558
|
function useBuildAdminModeController() {
|
|
1559
|
-
const
|
|
1559
|
+
const stored = readStoredString("rebase-admin-mode");
|
|
1560
|
+
const [mode, setMode] = useState((stored === "content" ? "cms" : stored) ?? "cms");
|
|
1560
1561
|
const setModeInternal = useCallback((newMode) => {
|
|
1561
1562
|
writeStoredString("rebase-admin-mode", newMode);
|
|
1562
1563
|
setMode(newMode);
|
|
@@ -2018,7 +2019,7 @@ function useRebaseRegistry() {
|
|
|
2018
2019
|
}
|
|
2019
2020
|
/**
|
|
2020
2021
|
* Returns only the stable dispatch functions.
|
|
2021
|
-
* Use this in feature components (RebaseAuth,
|
|
2022
|
+
* Use this in feature components (RebaseAuth, RebaseCMS, RebaseStudio)
|
|
2022
2023
|
* to avoid re-render loops.
|
|
2023
2024
|
*/
|
|
2024
2025
|
function useRebaseRegistryDispatch() {
|
|
@@ -18103,7 +18104,7 @@ var STUDIO_NAVIGATION_GROUPS = [
|
|
|
18103
18104
|
* dialog sizing logic.
|
|
18104
18105
|
*
|
|
18105
18106
|
* @internal Not part of the stable public API — exported only because
|
|
18106
|
-
* `@rebasepro/
|
|
18107
|
+
* `@rebasepro/cms` and `@rebasepro/studio` need them to compute the same
|
|
18107
18108
|
* dialog widths as the framework. Do not depend on these for app code; they
|
|
18108
18109
|
* may change shape or be removed without a major version bump.
|
|
18109
18110
|
*/
|
|
@@ -18132,7 +18133,7 @@ var scrollsMap = {};
|
|
|
18132
18133
|
* router location. Used by the framework's own home page implementations.
|
|
18133
18134
|
*
|
|
18134
18135
|
* @internal Not part of the stable public API — exported only because
|
|
18135
|
-
* `@rebasepro/
|
|
18136
|
+
* `@rebasepro/cms` and `@rebasepro/studio` reuse it in their home page
|
|
18136
18137
|
* components. Its behavior (module-level scroll cache, router coupling) is
|
|
18137
18138
|
* an implementation detail and may change without a major version bump.
|
|
18138
18139
|
*/
|
|
@@ -18767,7 +18768,7 @@ function resolveFilterOperators({ property, isArray, engine }) {
|
|
|
18767
18768
|
* Columns in the form grid.
|
|
18768
18769
|
*
|
|
18769
18770
|
* A local literal rather than an import of `FORM_GRID_COLUMNS`: everything else
|
|
18770
|
-
* this module takes from `@rebasepro/
|
|
18771
|
+
* this module takes from `@rebasepro/cms-types` is a *type*, erased at build
|
|
18771
18772
|
* time, and a runtime value would make this pure function depend on that
|
|
18772
18773
|
* package's built output — which is exactly what broke the dev server, since
|
|
18773
18774
|
* `@rebasepro/app` resolves that package to its dist. `satisfies PropertySpan`
|