@rebasepro/app 0.16.1-canary.gef08a6e → 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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* dialog sizing logic.
|
|
4
4
|
*
|
|
5
5
|
* @internal Not part of the stable public API — exported only because
|
|
6
|
-
* `@rebasepro/
|
|
6
|
+
* `@rebasepro/cms` and `@rebasepro/studio` need them to compute the same
|
|
7
7
|
* dialog widths as the framework. Do not depend on these for app code; they
|
|
8
8
|
* may change shape or be removed without a major version bump.
|
|
9
9
|
*/
|
|
@@ -4,7 +4,7 @@ import React from "react";
|
|
|
4
4
|
* router location. Used by the framework's own home page implementations.
|
|
5
5
|
*
|
|
6
6
|
* @internal Not part of the stable public API — exported only because
|
|
7
|
-
* `@rebasepro/
|
|
7
|
+
* `@rebasepro/cms` and `@rebasepro/studio` reuse it in their home page
|
|
8
8
|
* components. Its behavior (module-level scroll cache, router coupling) is
|
|
9
9
|
* an implementation detail and may change without a major version bump.
|
|
10
10
|
*/
|
package/dist/locales/de.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RebaseTranslations } from "@rebasepro/
|
|
1
|
+
import { RebaseTranslations } from "@rebasepro/cms-types";
|
|
2
2
|
export declare const de: RebaseTranslations;
|
package/dist/locales/en.d.ts
CHANGED
package/dist/locales/es.d.ts
CHANGED
package/dist/locales/fr.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RebaseTranslations } from "@rebasepro/
|
|
1
|
+
import { RebaseTranslations } from "@rebasepro/cms-types";
|
|
2
2
|
export declare const fr: RebaseTranslations;
|
package/dist/locales/hi.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RebaseTranslations } from "@rebasepro/
|
|
1
|
+
import { RebaseTranslations } from "@rebasepro/cms-types";
|
|
2
2
|
export declare const hi: RebaseTranslations;
|
package/dist/locales/it.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { RebaseTranslations } from "@rebasepro/
|
|
1
|
+
import { RebaseTranslations } from "@rebasepro/cms-types";
|
|
2
2
|
export declare const it: RebaseTranslations;
|
package/dist/locales/pt.d.ts
CHANGED
package/dist/util/previews.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PropertyConfig, AdminCollection } from "@rebasepro/
|
|
2
|
-
import { AuthController } from "@rebasepro/
|
|
1
|
+
import type { PropertyConfig, AdminCollection } from "@rebasepro/cms-types";
|
|
2
|
+
import { AuthController } from "@rebasepro/cms-types";
|
|
3
3
|
/**
|
|
4
4
|
* The properties a preview surface should render for a record, best first.
|
|
5
5
|
*
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebasepro/app",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.17.0",
|
|
5
5
|
"description": "Rebase core — framework-agnostic runtime for data-driven admin panels",
|
|
6
6
|
"funding": {
|
|
7
7
|
"url": "https://github.com/sponsors/rebaseco"
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
"magic-string": "^0.30.0",
|
|
53
53
|
"notistack": "^3.0.2",
|
|
54
54
|
"react-i18next": "^17.0.11",
|
|
55
|
-
"@rebasepro/
|
|
56
|
-
"@rebasepro/
|
|
57
|
-
"@rebasepro/forms": "0.
|
|
58
|
-
"@rebasepro/types": "0.
|
|
59
|
-
"@rebasepro/utils": "0.
|
|
60
|
-
"@rebasepro/ui": "0.
|
|
55
|
+
"@rebasepro/cms-types": "0.17.0",
|
|
56
|
+
"@rebasepro/common": "0.17.0",
|
|
57
|
+
"@rebasepro/forms": "0.17.0",
|
|
58
|
+
"@rebasepro/types": "0.17.0",
|
|
59
|
+
"@rebasepro/utils": "0.17.0",
|
|
60
|
+
"@rebasepro/ui": "0.17.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"react": ">=19.2.7",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"moduleNameMapper": {
|
|
128
128
|
"\\.(css|less)$": "<rootDir>/test/__mocks__/styleMock.js",
|
|
129
129
|
"^@rebasepro/([a-z0-9-]+)$": "<rootDir>/../$1/src/index.ts",
|
|
130
|
-
"^@rebasepro/
|
|
130
|
+
"^@rebasepro/cms-types$": "<rootDir>/../cms-types/src/index.ts"
|
|
131
131
|
},
|
|
132
132
|
"transformIgnorePatterns": [
|
|
133
133
|
"node_modules/(?!.*(?:react-router|cookie-es|fractional-indexing))"
|
package/src/auth/types.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";
|
|
4
4
|
|
|
5
5
|
// Re-export canonical types so the auth entry point stays self-contained. `User`
|
|
@@ -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, resolveAdminCollection } from "@rebasepro/
|
|
13
|
+
import { type AdminCollection, type DefaultSelectedViewBuilder, type DefaultSelectedViewParams, resolveAdminCollection } from "@rebasepro/cms-types";
|
|
14
14
|
import { getEntityChildViews } from "@rebasepro/common";
|
|
15
15
|
|
|
16
16
|
export function resolveDefaultSelectedView(
|
|
@@ -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
|
|
|
17
17
|
type CacheEntry = {
|
|
18
18
|
/** Set once resolved. `null` means "resolved to nothing", not "unknown". */
|
|
@@ -16,7 +16,7 @@ import type {
|
|
|
16
16
|
AdminCollection,
|
|
17
17
|
FormSection,
|
|
18
18
|
PropertySpan
|
|
19
|
-
} from "@rebasepro/
|
|
19
|
+
} from "@rebasepro/cms-types";
|
|
20
20
|
import type { Property } from "@rebasepro/types";
|
|
21
21
|
import { getDisplayPropertyKey } from "./entity-display";
|
|
22
22
|
import { isHidden } from "./property_presentation";
|
|
@@ -25,7 +25,7 @@ import { isHidden } from "./property_presentation";
|
|
|
25
25
|
* Columns in the form grid.
|
|
26
26
|
*
|
|
27
27
|
* A local literal rather than an import of `FORM_GRID_COLUMNS`: everything else
|
|
28
|
-
* this module takes from `@rebasepro/
|
|
28
|
+
* this module takes from `@rebasepro/cms-types` is a *type*, erased at build
|
|
29
29
|
* time, and a runtime value would make this pure function depend on that
|
|
30
30
|
* package's built output — which is exactly what broke the dev server, since
|
|
31
31
|
* `@rebasepro/app` resolves that package to its dist. `satisfies PropertySpan`
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type EntityCustomView<M extends Record<string, unknown> = Record<string, unknown>> = { key: string; [key: string]: unknown };
|
|
3
3
|
import { getCollectionPathsCombinations, removeInitialAndTrailingSlashes } from "./navigation_utils";
|
|
4
4
|
import { getSubcollections } from "@rebasepro/common";
|
|
5
|
-
import type { AdminCollection } from "@rebasepro/
|
|
5
|
+
import type { AdminCollection } from "@rebasepro/cms-types";
|
|
6
6
|
|
|
7
7
|
export type NavigationViewInternal<M extends Record<string, unknown> = Record<string, unknown>> =
|
|
8
8
|
| NavigationViewEntityInternal<M>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
import { getSubcollections } from "@rebasepro/common";
|
|
4
|
-
import type { AdminCollection } from "@rebasepro/
|
|
4
|
+
import type { AdminCollection } from "@rebasepro/cms-types";
|
|
5
5
|
|
|
6
6
|
export function removeInitialAndTrailingSlashes(s: string): string {
|
|
7
7
|
return removeInitialSlash(removeTrailingSlash(s));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EntityReference } from "@rebasepro/types";
|
|
2
2
|
import { getCollectionPathsCombinations, removeInitialAndTrailingSlashes } from "./navigation_utils";
|
|
3
3
|
import { getSubcollections } from "@rebasepro/common";
|
|
4
|
-
import type { AdminCollection } from "@rebasepro/
|
|
4
|
+
import type { AdminCollection } from "@rebasepro/cms-types";
|
|
5
5
|
|
|
6
6
|
export function getParentReferencesFromPath(props: {
|
|
7
7
|
path: string,
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* needs an entity to be evaluated against and one that does not.
|
|
23
23
|
*/
|
|
24
24
|
import type { ConditionContext, ConditionRule, EnumValueConfig, Property, PropertyConditions, ReferenceProperty } from "@rebasepro/types";
|
|
25
|
-
import type { AdminArrayOptions, AdminReferenceOptions } from "@rebasepro/
|
|
25
|
+
import type { AdminArrayOptions, AdminReferenceOptions } from "@rebasepro/cms-types";
|
|
26
26
|
import { evaluateCondition } from "@rebasepro/common";
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isRelationalCollectionConfig, type Property, type Relation } from "@rebasepro/types";
|
|
2
2
|
import { generateForeignKeyName } from "@rebasepro/utils";
|
|
3
|
-
import type { AdminCollection } from "@rebasepro/
|
|
3
|
+
import type { AdminCollection } from "@rebasepro/cms-types";
|
|
4
4
|
import { getPrimaryKeys, isPropertyBuilder } from "@rebasepro/common";
|
|
5
5
|
import { getPropertyInPath } from "./property-path";
|
|
6
6
|
import { getDisplayPropertyKey, hasDeclaredDisplay } from "./entity-display";
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
Typography
|
|
37
37
|
} from "@rebasepro/ui";
|
|
38
38
|
import { User } from "@rebasepro/types";
|
|
39
|
-
import { AuthControllerExtended } from "@rebasepro/
|
|
39
|
+
import { AuthControllerExtended } from "@rebasepro/cms-types";
|
|
40
40
|
import { ErrorView } from "../ErrorView";
|
|
41
41
|
import { RebaseLogo } from "../RebaseLogo";
|
|
42
42
|
import { LanguageToggle } from "../LanguageToggle";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useLayoutEffect, useRef } from "react";
|
|
2
2
|
import { useRebaseRegistryDispatch } from "../hooks";
|
|
3
|
-
import type { RebaseAuthViewConfig } from "@rebasepro/
|
|
3
|
+
import type { RebaseAuthViewConfig } from "@rebasepro/cms-types";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Declarative component to configure authentication in Rebase.
|
|
@@ -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
|
|
|
4
4
|
export type DataCollectionTableController<M extends Record<string, unknown>> = {
|
|
5
5
|
|
|
@@ -2,7 +2,7 @@ import type { Property, MapProperty, Properties, RelationProperty } from "@rebas
|
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
;
|
|
4
4
|
import { getChildViewDeclaringProperties, getChildViewRelationPropertyKeys, getSubcollections } from "@rebasepro/common";
|
|
5
|
-
import type { AdminCollection } from "@rebasepro/
|
|
5
|
+
import type { AdminCollection } from "@rebasepro/cms-types";
|
|
6
6
|
import { getPropertyInPath } from "../../collections/property-path";
|
|
7
7
|
import { isDisabled } from "../../collections/property_presentation";
|
|
8
8
|
|
|
@@ -9,7 +9,7 @@ import { toFindParams } from "../../hooks/data/collectionQuery";
|
|
|
9
9
|
import { getRelationIncludeParams } from "../../util/previews";
|
|
10
10
|
import { Entity, EntityReference, EntityRelation, FilterValues, OrderBySpec, OrderByTuple, User, WhereFilterOp, FindResponse } from "@rebasepro/types";
|
|
11
11
|
import { normalizeOrderBy, serializeOrderBy } from "@rebasepro/common";
|
|
12
|
-
import { EntityTableController, RebaseContext, SelectedCellProps, AdminCollection } from "@rebasepro/
|
|
12
|
+
import { EntityTableController, RebaseContext, SelectedCellProps, AdminCollection } from "@rebasepro/cms-types";
|
|
13
13
|
import { ScrollRestorationController } from "./useScrollRestoration";
|
|
14
14
|
|
|
15
15
|
export const DEFAULT_PAGE_SIZE = 50;
|
|
@@ -2,8 +2,8 @@ import React from "react";
|
|
|
2
2
|
import type { AdminModeController } from "../hooks/useAdminModeController";
|
|
3
3
|
|
|
4
4
|
const DEFAULT_ADMIN_MODE_STATE: AdminModeController = {
|
|
5
|
-
mode: "
|
|
6
|
-
setMode: (mode: "
|
|
5
|
+
mode: "cms",
|
|
6
|
+
setMode: (mode: "cms" | "studio" | "settings") => {
|
|
7
7
|
}
|
|
8
8
|
};
|
|
9
9
|
export const AdminModeControllerContext = React.createContext<AdminModeController>(DEFAULT_ADMIN_MODE_STATE);
|
|
@@ -10,7 +10,7 @@ export type CollectionResolver = (slug: string) => { properties?: Record<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,7 +1,7 @@
|
|
|
1
1
|
import React, { createContext, useContext } from "react";
|
|
2
2
|
|
|
3
3
|
import { CollectionComponentOverrideProvider } from "./ComponentOverrideContext";
|
|
4
|
-
import type { AdminCollection } from "@rebasepro/
|
|
4
|
+
import type { AdminCollection } from "@rebasepro/cms-types";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Carries the collection a UI subtree is currently bound to.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { createContext, useContext, useMemo } from "react";
|
|
2
|
-
import type { ComponentOverrideMap } from "@rebasepro/
|
|
2
|
+
import type { ComponentOverrideMap } from "@rebasepro/cms-types";
|
|
3
3
|
|
|
4
4
|
/** Stable empty reference to avoid re-creating context values on every render. */
|
|
5
5
|
const EMPTY_OVERRIDES: ComponentOverrideMap = {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CustomizationController } from "@rebasepro/
|
|
1
|
+
import type { CustomizationController } from "@rebasepro/cms-types";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
4
|
export const CustomizationControllerContext = React.createContext<CustomizationController>({} as CustomizationController);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DialogControllerEntryProps, DialogsController } from "@rebasepro/
|
|
1
|
+
import type { DialogControllerEntryProps, DialogsController } from "@rebasepro/cms-types";
|
|
2
2
|
import React, { PropsWithChildren, useCallback, useRef, useState, useMemo } from "react";
|
|
3
3
|
;
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { UserConfigurationPersistence } from "@rebasepro/
|
|
2
|
+
import { UserConfigurationPersistence } from "@rebasepro/cms-types";
|
|
3
3
|
|
|
4
4
|
export const UserConfigurationPersistenceContext = React.createContext<UserConfigurationPersistence | undefined>(undefined);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { useEffect, useRef } from "react";
|
|
3
3
|
import type { User } from "@rebasepro/types";
|
|
4
|
-
import type { RebasePlugin, RebaseContext } from "@rebasepro/
|
|
4
|
+
import type { RebasePlugin, RebaseContext } from "@rebasepro/cms-types";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Render-less component that manages plugin lifecycle hooks.
|
package/src/core/Rebase.tsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import type { RebaseProps } from "./RebaseProps";
|
|
3
|
-
import type { CustomizationController, RebasePlugin, SlotContribution } from "@rebasepro/
|
|
4
|
-
import type { ComponentOverrideMap } from "@rebasepro/
|
|
3
|
+
import type { CustomizationController, RebasePlugin, SlotContribution } from "@rebasepro/cms-types";
|
|
4
|
+
import type { ComponentOverrideMap } from "@rebasepro/cms-types";
|
|
5
5
|
|
|
6
6
|
import React, { useEffect, useMemo, useRef, useState } from "react";
|
|
7
7
|
import { CenteredView, Typography } from "@rebasepro/ui";
|
|
8
8
|
import { User, CollectionRegistryController, DataDriver, DataSourceDefinition, RebaseData, DEFAULT_DATA_SOURCE_KEY, StorageSource, StorageSourceDefinition, DEFAULT_STORAGE_SOURCE_KEY } from "@rebasepro/types";
|
|
9
|
-
import { RebaseContext, UNRENDERED_SLOTS } from "@rebasepro/
|
|
9
|
+
import { RebaseContext, UNRENDERED_SLOTS } from "@rebasepro/cms-types";
|
|
10
10
|
import { PluginProviderStack } from "./PluginProviderStack";
|
|
11
11
|
import { PluginLifecycleManager } from "./PluginLifecycleManager";
|
|
12
12
|
import { AuthControllerContext, CollectionResolverRegistrationContext, CollectionResolver } from "../contexts";
|
|
@@ -119,7 +119,7 @@ export function Rebase<USER extends User, DB = unknown>(props: RebaseProps<USER,
|
|
|
119
119
|
}, [dataSourcesProp]);
|
|
120
120
|
|
|
121
121
|
// Rows arrive as columns only; their address is derived from the
|
|
122
|
-
// collection's primary keys. The collections live below us (in
|
|
122
|
+
// collection's primary keys. The collections live below us (in RebaseCMS),
|
|
123
123
|
// so they register a resolver here and we read it lazily, per row. Headless
|
|
124
124
|
// apps register nothing and are unaffected.
|
|
125
125
|
const collectionResolverRef = useRef<CollectionResolver | undefined>(undefined);
|
package/src/core/RebaseProps.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { User, DataDriver, DataSourceDefinition, StorageSource, StorageSourceDefinition, CollectionRegistryController, DatabaseAdmin, RebaseClient } from "@rebasepro/types";
|
|
3
|
-
import { Locale, AuthController, AnalyticsEvent, UserConfigurationPersistence, UrlController, NavigationStateController, RebaseContext, EntityLinkBuilder, RebasePlugin, SlotContribution, PropertyConfig, EntityCustomView, CollectionCustomView, EntityAction, RebaseTranslations, ComponentOverrideMap } from "@rebasepro/
|
|
3
|
+
import { Locale, AuthController, AnalyticsEvent, UserConfigurationPersistence, UrlController, NavigationStateController, RebaseContext, EntityLinkBuilder, RebasePlugin, SlotContribution, PropertyConfig, EntityCustomView, CollectionCustomView, EntityAction, RebaseTranslations, ComponentOverrideMap } from "@rebasepro/cms-types";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* A data source registered on `<Rebase>`. Extends the shared
|
|
@@ -108,7 +108,7 @@ import type { EffectiveRoleController } from "@rebasepro/types";
|
|
|
108
108
|
export type RebaseProps<USER extends User, DB = unknown> = {
|
|
109
109
|
|
|
110
110
|
/**
|
|
111
|
-
* The root components of your application. Use
|
|
111
|
+
* The root components of your application. Use RebaseCMS, RebaseStudio, and RebaseShell.
|
|
112
112
|
* Alternatively, pass a render function that receives { context, loading }.
|
|
113
113
|
*/
|
|
114
114
|
children: React.ReactNode | ((props: { context: RebaseContext; loading: boolean }) => React.ReactNode);
|
package/src/hooks/data/delete.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { Entity, CollectionCallbacks, User } from "@rebasepro/types";
|
|
3
|
-
import { RebaseContext, AdminCollection } from "@rebasepro/
|
|
3
|
+
import { RebaseContext, AdminCollection } from "@rebasepro/cms-types";
|
|
4
4
|
import { RebaseData } from "@rebasepro/types";
|
|
5
5
|
|
|
6
6
|
/**
|
package/src/hooks/data/save.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { Entity, EntityStatus, EntityValues } from "@rebasepro/types";
|
|
3
|
-
import { RebaseContext, AdminCollection } from "@rebasepro/
|
|
3
|
+
import { RebaseContext, AdminCollection } from "@rebasepro/cms-types";
|
|
4
4
|
import { RebaseData } from "@rebasepro/types";
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -5,7 +5,7 @@ import { useData } from "./useData";
|
|
|
5
5
|
import { isSchemaDriftError, useSchemaDriftContext } from "../../components/SchemaDriftBanner";
|
|
6
6
|
import { toFindParams } from "./collectionQuery";
|
|
7
7
|
import { getRelationIncludeParams } from "../../util/previews";
|
|
8
|
-
import type { AdminCollection } from "@rebasepro/
|
|
8
|
+
import type { AdminCollection } from "@rebasepro/cms-types";
|
|
9
9
|
/**
|
|
10
10
|
* @group Hooks and utilities
|
|
11
11
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { useEffect, useState, useMemo } from "react";
|
|
3
3
|
import { Entity, User } from "@rebasepro/types";
|
|
4
|
-
import { RebaseContext, AdminCollection } from "@rebasepro/
|
|
4
|
+
import { RebaseContext, AdminCollection } from "@rebasepro/cms-types";
|
|
5
5
|
import { useData } from "./useData";
|
|
6
6
|
import { useRebaseContext } from "../useRebaseContext";
|
|
7
7
|
|
|
@@ -3,7 +3,7 @@ import { useCallback, useEffect, useRef, useState, useMemo } from "react";
|
|
|
3
3
|
import { useData } from "./useData";
|
|
4
4
|
import { Entity, EntityRelation, FilterValues } from "@rebasepro/types";
|
|
5
5
|
import { getRelationIncludeParams } from "../../util/previews";
|
|
6
|
-
import type { AdminCollection } from "@rebasepro/
|
|
6
|
+
import type { AdminCollection } from "@rebasepro/cms-types";
|
|
7
7
|
export interface RelationItem {
|
|
8
8
|
id: string | number;
|
|
9
9
|
label: string;
|
|
@@ -6,8 +6,8 @@ import { useContext } from "react";
|
|
|
6
6
|
* @group Hooks and utilities
|
|
7
7
|
*/
|
|
8
8
|
export interface AdminModeController {
|
|
9
|
-
mode: "
|
|
10
|
-
setMode: (mode: "
|
|
9
|
+
mode: "cms" | "studio" | "settings";
|
|
10
|
+
setMode: (mode: "cms" | "studio" | "settings") => void;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { User } from "@rebasepro/types";
|
|
2
|
-
import { AuthController } from "@rebasepro/
|
|
2
|
+
import { AuthController } from "@rebasepro/cms-types";
|
|
3
3
|
import { useContext } from "react";
|
|
4
4
|
import { AuthControllerContext } from "../contexts/AuthControllerContext";
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState, useEffect, useMemo, useCallback } from "react";
|
|
2
2
|
import { AuthClient, User } from "@rebasepro/types";
|
|
3
|
-
import { AuthController } from "@rebasepro/
|
|
3
|
+
import { AuthController } from "@rebasepro/cms-types";
|
|
4
4
|
|
|
5
5
|
export function useAuthSubscription(authClient?: AuthClient): AuthController {
|
|
6
6
|
|
|
@@ -8,10 +8,16 @@ import { readStoredString, writeStoredString } from "../util/local_storage";
|
|
|
8
8
|
*/
|
|
9
9
|
export function useBuildAdminModeController(): AdminModeController {
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
// The content mode was renamed to "cms" when the panel's CMS half became a
|
|
12
|
+
// product name. The value is persisted, so a browser that used the panel
|
|
13
|
+
// before the rename still has "content" in local storage — read as-is it
|
|
14
|
+
// casts to a mode nothing matches, and the drawer renders neither half.
|
|
15
|
+
// Migrating on read is the exception the no-shims rule allows for stored data.
|
|
16
|
+
const stored = readStoredString("rebase-admin-mode");
|
|
17
|
+
const savedMode = (stored === "content" ? "cms" : stored) as "cms" | "studio" | "settings" | null;
|
|
18
|
+
const [mode, setMode] = useState<"cms" | "studio" | "settings">(savedMode ?? "cms");
|
|
13
19
|
|
|
14
|
-
const setModeInternal = useCallback((newMode: "
|
|
20
|
+
const setModeInternal = useCallback((newMode: "cms" | "studio" | "settings") => {
|
|
15
21
|
writeStoredString("rebase-admin-mode", newMode);
|
|
16
22
|
setMode(newMode);
|
|
17
23
|
}, []);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState, useMemo } from "react";
|
|
2
|
-
import { PartialCollectionConfig, UserConfigurationPersistence } from "@rebasepro/
|
|
2
|
+
import { PartialCollectionConfig, UserConfigurationPersistence } from "@rebasepro/cms-types";
|
|
3
3
|
import { stripCollectionPath } from "@rebasepro/common";
|
|
4
4
|
import { isArrayValue, isRecordValue, mergeDeep, readStoredJson, writeStoredJson } from "@rebasepro/utils";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useContext, useMemo } from "react";
|
|
2
|
-
import type { OverridableComponentName } from "@rebasepro/
|
|
2
|
+
import type { OverridableComponentName } from "@rebasepro/cms-types";
|
|
3
3
|
import { ComponentOverrideContext } from "../contexts/ComponentOverrideContext";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CustomizationController } from "@rebasepro/
|
|
1
|
+
import type { CustomizationController } from "@rebasepro/cms-types";
|
|
2
2
|
import { useContext } from "react";
|
|
3
3
|
import { CustomizationControllerContext } from "../contexts/CustomizationControllerContext";
|
|
4
4
|
|
|
@@ -3,7 +3,7 @@ import { useAuthController } from "./useAuthController";
|
|
|
3
3
|
import { Entity } from "@rebasepro/types";
|
|
4
4
|
import { canCreateEntity, canEditEntity, canDeleteEntity, canReadCollection } from "@rebasepro/common";
|
|
5
5
|
import { useCallback, useMemo } from "react";
|
|
6
|
-
import type { AdminCollection } from "@rebasepro/
|
|
6
|
+
import type { AdminCollection } from "@rebasepro/cms-types";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Hook to evaluate roles and permissions for the current user.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { User } from "@rebasepro/types";
|
|
2
|
-
import { AuthController, RebaseContext } from "@rebasepro/
|
|
2
|
+
import { AuthController, RebaseContext } from "@rebasepro/cms-types";
|
|
3
3
|
import { wrapAsSdkData } from "@rebasepro/common";
|
|
4
4
|
import { useAuthController } from "./useAuthController";
|
|
5
5
|
import { useRebaseClient } from "./useRebaseClient";
|