@rebasepro/app 0.10.0 → 0.10.1-canary.0a881d4
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/auth/types.d.ts +2 -1
- package/dist/collections/collection_view_config.d.ts +32 -0
- package/dist/collections/entity_image_preview.d.ts +2 -0
- package/dist/collections/filter-operator-resolution.d.ts +32 -0
- package/dist/collections/index.d.ts +8 -0
- package/dist/collections/navigation_from_path.d.ts +34 -0
- package/dist/collections/navigation_utils.d.ts +20 -0
- package/dist/collections/parent_references_from_path.d.ts +7 -0
- package/dist/collections/property_presentation.d.ts +20 -0
- package/dist/collections/title-property.d.ts +43 -0
- package/dist/components/Debug/UIReferenceView.d.ts +10 -3
- 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 +5 -4
- package/dist/components/common/useDataTableController.d.ts +3 -3
- package/dist/contexts/AnalyticsContext.d.ts +1 -1
- package/dist/contexts/AuthControllerContext.d.ts +1 -1
- package/dist/contexts/CollectionScopeContext.d.ts +4 -4
- 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 -1
- package/dist/hooks/data/delete.d.ts +4 -4
- package/dist/hooks/data/save.d.ts +5 -5
- package/dist/hooks/data/useCollection.d.ts +2 -2
- package/dist/hooks/data/useFetch.d.ts +2 -2
- package/dist/hooks/data/useRelationSelector.d.ts +2 -2
- package/dist/hooks/useAnalyticsController.d.ts +1 -1
- package/dist/hooks/useAuthController.d.ts +2 -1
- package/dist/hooks/useAuthSubscription.d.ts +2 -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 +5 -5
- package/dist/hooks/useRebaseContext.d.ts +2 -1
- package/dist/hooks/useRebaseRegistry.d.ts +1 -1
- package/dist/hooks/useSlot.d.ts +1 -1
- package/dist/hooks/useSnackbarController.d.ts +1 -1
- package/dist/hooks/useStudioBridge.d.ts +2 -1
- package/dist/hooks/useUserConfigurationPersistence.d.ts +1 -1
- package/dist/i18n/RebaseI18nProvider.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +799 -121
- package/dist/index.es.js.map +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 +10 -5
- package/dist/vitePlugin.js +1 -1
- package/package.json +9 -7
- package/src/auth/types.ts +2 -1
- package/src/collections/collection_view_config.ts +57 -0
- package/src/collections/entity_image_preview.ts +48 -0
- package/src/collections/filter-operator-resolution.ts +81 -0
- package/src/collections/index.ts +8 -0
- package/src/collections/navigation_from_path.ts +123 -0
- package/src/collections/navigation_utils.ts +171 -0
- package/src/collections/parent_references_from_path.ts +59 -0
- package/src/collections/property_presentation.ts +224 -0
- package/src/collections/title-property.ts +264 -0
- package/src/components/Debug/UIReferenceView.tsx +31 -27
- package/src/components/Debug/collection-views/CardViewDemo.tsx +4 -2
- package/src/components/Debug/collection-views/CollectionTableDemo.tsx +2 -2
- package/src/components/Debug/collection-views/KanbanBoardDemo.tsx +1 -2
- package/src/components/Debug/crm-dashboard/CalendarWidget.tsx +5 -7
- package/src/components/Debug/crm-dashboard/CrmDashboardDemo.tsx +14 -20
- package/src/components/Debug/crm-dashboard/DashboardMetrics.tsx +7 -9
- package/src/components/Debug/crm-dashboard/PipelineOverview.tsx +8 -10
- package/src/components/Debug/crm-dashboard/RecentActivity.tsx +25 -27
- package/src/components/Debug/crm-dashboard/TaskFilters.tsx +7 -9
- package/src/components/Debug/crm-dashboard/TaskTable.tsx +8 -10
- package/src/components/LoginView/LoginView.tsx +55 -4
- package/src/components/RebaseAuth.tsx +1 -1
- package/src/components/common/types.tsx +1 -1
- package/src/components/common/useColumnsIds.tsx +24 -23
- package/src/components/common/useDataTableController.tsx +4 -4
- package/src/contexts/AnalyticsContext.tsx +1 -1
- package/src/contexts/AuthControllerContext.tsx +1 -1
- package/src/contexts/CollectionScopeContext.tsx +6 -5
- 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 +2 -1
- package/src/core/PluginProviderStack.tsx +1 -1
- package/src/core/Rebase.tsx +4 -3
- package/src/core/RebaseProps.tsx +2 -1
- package/src/core/RebaseRouter.tsx +1 -1
- package/src/hooks/data/delete.ts +5 -4
- package/src/hooks/data/save.ts +6 -5
- package/src/hooks/data/useCollection.tsx +3 -2
- package/src/hooks/data/useFetch.tsx +4 -3
- package/src/hooks/data/useRelationSelector.tsx +3 -2
- package/src/hooks/useAnalyticsController.tsx +1 -1
- package/src/hooks/useAuthController.tsx +2 -1
- package/src/hooks/useAuthSubscription.ts +2 -1
- 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 +6 -5
- package/src/hooks/useRebaseContext.tsx +2 -1
- package/src/hooks/useRebaseRegistry.tsx +1 -1
- package/src/hooks/useResolvedComponent.tsx +44 -11
- package/src/hooks/useSlot.tsx +1 -1
- package/src/hooks/useSnackbarController.tsx +1 -1
- package/src/hooks/useStudioBridge.tsx +4 -2
- package/src/hooks/useUserConfigurationPersistence.tsx +1 -1
- package/src/i18n/RebaseI18nProvider.tsx +1 -1
- package/src/index.ts +1 -0
- 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 +16 -34
- package/src/vitePlugin.ts +5 -1
package/dist/auth/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { User, AuthTokens, DeviceSession, RebaseSession, AuthChangeEvent } from "@rebasepro/types";
|
|
2
|
+
import { AuthController } from "@rebasepro/admin-types";
|
|
2
3
|
import type { AuthConfigResponse } from "./api";
|
|
3
4
|
/** @deprecated Use `User` from `@rebasepro/types` instead. */
|
|
4
5
|
export type UserInfo = User;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collection helpers that only the admin panel needs.
|
|
3
|
+
*
|
|
4
|
+
* These lived in `@rebasepro/common`, which is on the backend's dependency path,
|
|
5
|
+
* and they read presentation fields — `defaultSelectedView`, `localChangesBackup`
|
|
6
|
+
* — that now live under a collection's `admin` block. A server has no use for
|
|
7
|
+
* either, and `resolveDefaultSelectedView` was the *only* thing making
|
|
8
|
+
* `@rebasepro/common` name an admin view-model type
|
|
9
|
+
* (`DefaultSelectedViewBuilder`), which was the last UI symbol any core package
|
|
10
|
+
* imported.
|
|
11
|
+
*/
|
|
12
|
+
import type { CollectionConfig } from "@rebasepro/types";
|
|
13
|
+
import { type AdminCollection, type DefaultSelectedViewBuilder, type DefaultSelectedViewParams } from "@rebasepro/admin-types";
|
|
14
|
+
export declare function resolveDefaultSelectedView(defaultSelectedView: string | DefaultSelectedViewBuilder | undefined, params: DefaultSelectedViewParams): string | undefined;
|
|
15
|
+
export declare function getLocalChangesBackup(collection: AdminCollection): "manual_apply" | "auto_apply";
|
|
16
|
+
/**
|
|
17
|
+
* Returns the primary keys for a entity collection by inspecting the properties
|
|
18
|
+
* and finding any properties with `isId`.
|
|
19
|
+
* Fallbacks to `["id"]` if no properties are marked as `isId: true`.
|
|
20
|
+
* @param collection
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* A collection's child collections, as the panel's view model.
|
|
24
|
+
*
|
|
25
|
+
* `getSubcollections` in `@rebasepro/common` returns the contract type, so the
|
|
26
|
+
* children of a resolved collection arrived un-flattened and reading
|
|
27
|
+
* `child.icon` or `child.hideFromNavigation` failed. Resolving is not recursive
|
|
28
|
+
* on purpose — children are fetched lazily through a thunk
|
|
29
|
+
* (`childCollections`/`subcollections`), so walking the whole tree eagerly to
|
|
30
|
+
* flatten it would defeat that.
|
|
31
|
+
*/
|
|
32
|
+
export declare function getAdminSubcollections(collection: AdminCollection | CollectionConfig): AdminCollection[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Property, WhereFilterOp } from "@rebasepro/types";
|
|
2
|
+
export interface ResolveFilterOperatorsParams {
|
|
3
|
+
/**
|
|
4
|
+
* The property to filter on. For array properties, pass the **item**
|
|
5
|
+
* property (`property.of`) together with `isArray: true` — the same
|
|
6
|
+
* convention the filter field dispatchers use.
|
|
7
|
+
*/
|
|
8
|
+
property: Property;
|
|
9
|
+
/** True when filtering an array of `property`. */
|
|
10
|
+
isArray?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The engine backing the collection (`collection.engine`, e.g.
|
|
13
|
+
* `"postgres"`, `"firestore"`). Falls back to the default engine's
|
|
14
|
+
* capabilities when omitted.
|
|
15
|
+
*/
|
|
16
|
+
engine?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Resolve which filter operators the UI should offer for a property.
|
|
20
|
+
*
|
|
21
|
+
* The result is the **intersection** of three sets:
|
|
22
|
+
* 1. what the engine can execute — {@link DataSourceCapabilities.filterOperators}
|
|
23
|
+
* (e.g. Firestore cannot run the LIKE family);
|
|
24
|
+
* 2. what makes sense for the property type (e.g. no `>` on booleans);
|
|
25
|
+
* 3. the developer's optional narrowing — `property.admin.filterOperators`.
|
|
26
|
+
*
|
|
27
|
+
* Returns an empty array when the property is not filterable (either by
|
|
28
|
+
* type, or because the developer disabled it with `filterOperators: []`).
|
|
29
|
+
*
|
|
30
|
+
* @group Models
|
|
31
|
+
*/
|
|
32
|
+
export declare function resolveFilterOperators({ property, isArray, engine }: ResolveFilterOperatorsParams): WhereFilterOp[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./collection_view_config";
|
|
2
|
+
export * from "./entity_image_preview";
|
|
3
|
+
export * from "./filter-operator-resolution";
|
|
4
|
+
export * from "./navigation_from_path";
|
|
5
|
+
export * from "./navigation_utils";
|
|
6
|
+
export * from "./parent_references_from_path";
|
|
7
|
+
export * from "./property_presentation";
|
|
8
|
+
export * from "./title-property";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
type EntityCustomView<M extends Record<string, unknown> = Record<string, unknown>> = {
|
|
2
|
+
key: string;
|
|
3
|
+
[key: string]: unknown;
|
|
4
|
+
};
|
|
5
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
6
|
+
export type NavigationViewInternal<M extends Record<string, unknown> = Record<string, unknown>> = NavigationViewEntityInternal<M> | NavigationViewCollectionInternal<M> | NavigationViewEntityCustomInternal<M>;
|
|
7
|
+
export interface NavigationViewEntityInternal<M extends Record<string, unknown>> {
|
|
8
|
+
type: "entity";
|
|
9
|
+
entityId: string | number;
|
|
10
|
+
slug: string;
|
|
11
|
+
path: string;
|
|
12
|
+
parentCollection: AdminCollection<M>;
|
|
13
|
+
}
|
|
14
|
+
export interface NavigationViewCollectionInternal<M extends Record<string, unknown>> {
|
|
15
|
+
type: "collection";
|
|
16
|
+
id: string;
|
|
17
|
+
slug: string;
|
|
18
|
+
path: string;
|
|
19
|
+
collection: AdminCollection<M>;
|
|
20
|
+
}
|
|
21
|
+
export interface NavigationViewEntityCustomInternal<M extends Record<string, unknown>> {
|
|
22
|
+
type: "custom_view";
|
|
23
|
+
slug: string;
|
|
24
|
+
path: string;
|
|
25
|
+
entityId: string | number;
|
|
26
|
+
view: EntityCustomView<M>;
|
|
27
|
+
}
|
|
28
|
+
export declare function getNavigationEntriesFromPath(props: {
|
|
29
|
+
path: string;
|
|
30
|
+
collections: AdminCollection[] | undefined;
|
|
31
|
+
currentFullPath?: string;
|
|
32
|
+
contextEntityViews?: EntityCustomView[];
|
|
33
|
+
}): NavigationViewInternal[];
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
2
|
+
export declare function removeInitialAndTrailingSlashes(s: string): string;
|
|
3
|
+
export declare function removeInitialSlash(s: string): string;
|
|
4
|
+
export declare function removeTrailingSlash(s: string): string;
|
|
5
|
+
export declare function addInitialSlash(s: string): string;
|
|
6
|
+
export declare function getLastSegment(path: string): string;
|
|
7
|
+
export declare function resolveCollectionPathIds(path: string, allCollections: AdminCollection[]): string;
|
|
8
|
+
/**
|
|
9
|
+
* Find the corresponding view at any depth for a given path.
|
|
10
|
+
* Note that path or segments of the paths can be collection aliases.
|
|
11
|
+
* @param slugOrPath
|
|
12
|
+
* @param collections
|
|
13
|
+
*/
|
|
14
|
+
export declare function getCollectionBySlugWithin(slugOrPath: string, collections: AdminCollection[]): AdminCollection | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Get the subcollection combinations from a path:
|
|
17
|
+
* "sites/es/locales" => ["sites/es/locales", "sites"]
|
|
18
|
+
* @param subpaths
|
|
19
|
+
*/
|
|
20
|
+
export declare function getCollectionPathsCombinations(subpaths: string[]): string[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EntityReference } from "@rebasepro/types";
|
|
2
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
3
|
+
export declare function getParentReferencesFromPath(props: {
|
|
4
|
+
path: string;
|
|
5
|
+
collections: AdminCollection[] | undefined;
|
|
6
|
+
currentFullPath?: string;
|
|
7
|
+
}): EntityReference[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Property presentation helpers.
|
|
3
|
+
*
|
|
4
|
+
* These read a property's admin block — `readOnly`, `disabled.hidden`, the
|
|
5
|
+
* declarative `conditions` — and lived in `@rebasepro/common`, which is on the
|
|
6
|
+
* backend's dependency path. Nothing in core ever called them: `isReadOnly` and
|
|
7
|
+
* `isHidden` are used only by the panel, and `applyPropertyConditions` has no
|
|
8
|
+
* production caller at all.
|
|
9
|
+
*
|
|
10
|
+
* That last one is worth knowing about rather than assuming: the collection editor
|
|
11
|
+
* has a whole Conditions UI, `serializable_utils` persists what it writes, and
|
|
12
|
+
* `BaseProperty.conditions` documents itself as "evaluated at runtime like property
|
|
13
|
+
* builders" — but the evaluator below is reached only from its own tests. The
|
|
14
|
+
* declarative conditions feature is authored and stored, never applied. It lives
|
|
15
|
+
* here now because here is where it would be called from once it is wired up.
|
|
16
|
+
*/
|
|
17
|
+
import type { ConditionContext, Property } from "@rebasepro/types";
|
|
18
|
+
export declare function isReadOnly(property: Property): boolean;
|
|
19
|
+
export declare function isHidden(property: Property): boolean;
|
|
20
|
+
export declare function applyPropertyConditions(property: Property, context: ConditionContext): Property;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
2
|
+
/**
|
|
3
|
+
* All properties that could serve as the entity title, best first.
|
|
4
|
+
*
|
|
5
|
+
* Candidates are ranked from the property *schema* — identifiers (primary
|
|
6
|
+
* keys, foreign keys, UUID columns, user pickers), images and hidden fields are
|
|
7
|
+
* excluded structurally, so a collection whose id column is called something
|
|
8
|
+
* other than `id` is handled the same as one where it isn't.
|
|
9
|
+
*
|
|
10
|
+
* When the collection declares `propertiesOrder` the developer has already
|
|
11
|
+
* stated what comes first, so qualifying candidates keep that order; otherwise
|
|
12
|
+
* they are ranked (a name beats a description beats a relation).
|
|
13
|
+
*
|
|
14
|
+
* @group Collections
|
|
15
|
+
*/
|
|
16
|
+
export declare function getTitlePropertyCandidates<M extends Record<string, unknown>>(collection: AdminCollection<M>): string[];
|
|
17
|
+
/**
|
|
18
|
+
* The property that should fill the title slot for a collection, ignoring any
|
|
19
|
+
* concrete values. Prefer {@link getTitlePropertyKeyForValues} when an entity
|
|
20
|
+
* is at hand — it can skip candidates that happen to be empty or to hold an id.
|
|
21
|
+
*
|
|
22
|
+
* @group Collections
|
|
23
|
+
*/
|
|
24
|
+
export declare function getTitlePropertyKey<M extends Record<string, unknown>>(collection: AdminCollection<M>): string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* True when a value reads as a machine identifier (UUID, ObjectId/long hex,
|
|
27
|
+
* cuid) rather than as something worth showing to a person.
|
|
28
|
+
*
|
|
29
|
+
* @group Collections
|
|
30
|
+
*/
|
|
31
|
+
export declare function looksLikeIdentifierValue(value: unknown): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The title property for a concrete entity: the best-ranked candidate that
|
|
34
|
+
* actually carries a readable value. Candidates that are empty, that repeat the
|
|
35
|
+
* entity id, or that hold an opaque identifier are skipped, so a free-text
|
|
36
|
+
* column that happens to store UUIDs never ends up as the title.
|
|
37
|
+
*
|
|
38
|
+
* Returns the top-ranked candidate when none of them has a usable value, so
|
|
39
|
+
* callers can still render a placeholder for that property.
|
|
40
|
+
*
|
|
41
|
+
* @group Collections
|
|
42
|
+
*/
|
|
43
|
+
export declare function getTitlePropertyKeyForValues<M extends Record<string, unknown>>(collection: AdminCollection<M>, values: Record<string, unknown> | undefined, entityId?: string | number): string | undefined;
|
|
@@ -2,12 +2,19 @@
|
|
|
2
2
|
* UIReferenceView — hidden debug route at /debug/ui
|
|
3
3
|
*
|
|
4
4
|
* This file is a STATIC reference of the real UI patterns used across the app.
|
|
5
|
-
*
|
|
6
|
-
* DO NOT add invented styles
|
|
5
|
+
* Markup / styles are copied from source files where a section mirrors a real
|
|
6
|
+
* screen. DO NOT add invented styles — copy from actual source files, or from
|
|
7
|
+
* the components in @rebasepro/ui.
|
|
8
|
+
*
|
|
9
|
+
* Sections named after a component mirror that component. Sections named after
|
|
10
|
+
* a pattern (e.g. "Management Screen", "Form Dialog") are illustrative
|
|
11
|
+
* compositions of kit components and are not tied to a specific screen.
|
|
12
|
+
*
|
|
13
|
+
* Do not cite source line numbers here — they rot silently. Name the file only.
|
|
7
14
|
*
|
|
8
15
|
* Sources:
|
|
9
16
|
* DefaultDrawer.tsx, DefaultAppBar.tsx, DrawerNavigationItem.tsx,
|
|
10
|
-
* DrawerNavigationGroup.tsx
|
|
17
|
+
* DrawerNavigationGroup.tsx
|
|
11
18
|
*/
|
|
12
19
|
import React from "react";
|
|
13
20
|
export declare function UIReferenceView(): React.JSX.Element;
|
|
@@ -21,7 +21,7 @@ declare global {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
import { AuthControllerExtended } from "@rebasepro/types";
|
|
24
|
+
import { AuthControllerExtended } from "@rebasepro/admin-types";
|
|
25
25
|
/**
|
|
26
26
|
* Props for the generic LoginView.
|
|
27
27
|
* Consumes {@link AuthControllerExtended} — works with any backend
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Property, Entity } from "@rebasepro/types";
|
|
2
|
-
import { CollectionSize, SelectedCellProps } from "@rebasepro/types";
|
|
2
|
+
import { CollectionSize, SelectedCellProps } from "@rebasepro/admin-types";
|
|
3
3
|
export type DataCollectionTableController<M extends Record<string, unknown>> = {
|
|
4
4
|
/**
|
|
5
5
|
* This cell is displayed as selected
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Property } from "@rebasepro/types";
|
|
2
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
2
3
|
export type PropertyColumnConfig = {
|
|
3
4
|
key: string;
|
|
4
5
|
disabled: boolean;
|
|
5
6
|
};
|
|
6
|
-
export declare function getSubcollectionColumnId(collection:
|
|
7
|
-
export declare function useColumnIds<M extends Record<string, any>>(collection:
|
|
7
|
+
export declare function getSubcollectionColumnId(collection: AdminCollection<any>): string;
|
|
8
|
+
export declare function useColumnIds<M extends Record<string, any>>(collection: AdminCollection<M>, includeSubcollections: boolean): PropertyColumnConfig[];
|
|
8
9
|
export declare function getColumnKeysForProperty(property: Property, key: string, disabled?: boolean): PropertyColumnConfig[];
|
|
9
|
-
export declare function getFormFieldKeys(collection:
|
|
10
|
+
export declare function getFormFieldKeys(collection: AdminCollection): string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { Entity, FilterValues, User } from "@rebasepro/types";
|
|
2
|
+
import { EntityTableController, AdminCollection } from "@rebasepro/admin-types";
|
|
3
3
|
import { ScrollRestorationController } from "./useScrollRestoration";
|
|
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 DataTableControllerProps<M extends Record<string, any> = any> = {
|
|
|
10
10
|
/**
|
|
11
11
|
* The collection that is represented by this config.
|
|
12
12
|
*/
|
|
13
|
-
collection:
|
|
13
|
+
collection: AdminCollection<M>;
|
|
14
14
|
/**
|
|
15
15
|
* List of entities that will be displayed on top, no matter the ordering.
|
|
16
16
|
* This is used for reference fields selection
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
3
3
|
/**
|
|
4
4
|
* Carries the collection a UI subtree is currently bound to.
|
|
5
5
|
*
|
|
@@ -13,14 +13,14 @@ import type { CollectionConfig } from "@rebasepro/types";
|
|
|
13
13
|
*
|
|
14
14
|
* @internal
|
|
15
15
|
*/
|
|
16
|
-
export declare const CollectionScopeContext: React.Context<
|
|
16
|
+
export declare const CollectionScopeContext: React.Context<AdminCollection | undefined>;
|
|
17
17
|
/**
|
|
18
18
|
* Read the collection the current subtree is bound to, or `undefined` when
|
|
19
19
|
* rendered outside any collection scope (e.g. a fully standalone table).
|
|
20
20
|
*
|
|
21
21
|
* @group Hooks
|
|
22
22
|
*/
|
|
23
|
-
export declare function useCollectionScope():
|
|
23
|
+
export declare function useCollectionScope(): AdminCollection | undefined;
|
|
24
24
|
/**
|
|
25
25
|
* Scopes a UI subtree to a collection.
|
|
26
26
|
*
|
|
@@ -45,6 +45,6 @@ export declare function useCollectionScope(): CollectionConfig | undefined;
|
|
|
45
45
|
* @group Components
|
|
46
46
|
*/
|
|
47
47
|
export declare function CollectionScopeProvider({ collection, children }: {
|
|
48
|
-
collection:
|
|
48
|
+
collection: AdminCollection<any> | undefined;
|
|
49
49
|
children: React.ReactNode;
|
|
50
50
|
}): React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { ComponentOverrideMap } from "@rebasepro/types";
|
|
2
|
+
import type { ComponentOverrideMap } from "@rebasepro/admin-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/types";
|
|
1
|
+
import type { DialogsController } from "@rebasepro/admin-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/types";
|
|
2
|
+
import { UserConfigurationPersistence } from "@rebasepro/admin-types";
|
|
3
3
|
export declare const UserConfigurationPersistenceContext: React.Context<UserConfigurationPersistence | undefined>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { User, DataDriver, DataSourceDefinition, StorageSource, StorageSourceDefinition, DatabaseAdmin, RebaseClient } from "@rebasepro/types";
|
|
3
|
+
import { Locale, AuthController, AnalyticsEvent, UserConfigurationPersistence, RebaseContext, EntityLinkBuilder, RebasePlugin, SlotContribution, PropertyConfig, EntityCustomView, EntityAction, RebaseTranslations, ComponentOverrideMap } from "@rebasepro/admin-types";
|
|
3
4
|
/**
|
|
4
5
|
* A data source registered on `<Rebase>`. Extends the shared
|
|
5
6
|
* {@link DataSourceDefinition} with the frontend {@link DataDriver} used for
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { Entity, CollectionCallbacks, User } from "@rebasepro/types";
|
|
2
|
+
import { RebaseContext, AdminCollection } from "@rebasepro/admin-types";
|
|
3
3
|
import { RebaseData } from "@rebasepro/types";
|
|
4
4
|
/**
|
|
5
5
|
* @group Hooks and utilities
|
|
6
6
|
*/
|
|
7
7
|
export type DeleteEntityWithCallbacksProps<M extends Record<string, any>, USER extends User = User> = {
|
|
8
8
|
entity: Entity<M>;
|
|
9
|
-
collection?:
|
|
9
|
+
collection?: AdminCollection<M>;
|
|
10
10
|
callbacks?: CollectionCallbacks<M, USER>;
|
|
11
11
|
onDeleteSuccess?: (entity: Entity<M>) => void;
|
|
12
12
|
onDeleteFailure?: (entity: Entity<M>, e: Error) => void;
|
|
@@ -27,7 +27,7 @@ export type DeleteEntityWithCallbacksProps<M extends Record<string, any>, USER e
|
|
|
27
27
|
* @group Hooks and utilities
|
|
28
28
|
*/
|
|
29
29
|
export declare function deleteEntityWithCallbacks<M extends Record<string, any>, USER extends User>({ data, entity, collection, callbacks, onDeleteSuccess, onDeleteFailure, context }: DeleteEntityWithCallbacksProps<M> & {
|
|
30
|
-
collection:
|
|
30
|
+
collection: AdminCollection<M>;
|
|
31
31
|
data: RebaseData;
|
|
32
32
|
context: RebaseContext<USER>;
|
|
33
33
|
}): Promise<boolean>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { Entity, EntityStatus, EntityValues } from "@rebasepro/types";
|
|
2
|
+
import { RebaseContext, AdminCollection } from "@rebasepro/admin-types";
|
|
3
3
|
import { RebaseData } from "@rebasepro/types";
|
|
4
4
|
/**
|
|
5
5
|
* @group Hooks and utilities
|
|
@@ -9,7 +9,7 @@ export type SaveEntityWithCallbacksProps<M extends Record<string, unknown>> = {
|
|
|
9
9
|
values: Partial<EntityValues<M>>;
|
|
10
10
|
entityId?: string | number;
|
|
11
11
|
previousValues?: Partial<EntityValues<M>>;
|
|
12
|
-
collection?:
|
|
12
|
+
collection?: AdminCollection<M>;
|
|
13
13
|
status: EntityStatus;
|
|
14
14
|
afterSave?: (updatedEntity: Entity<M>) => void;
|
|
15
15
|
afterSaveError?: (e: Error) => void;
|
|
@@ -33,8 +33,8 @@ export type SaveEntityWithCallbacksProps<M extends Record<string, unknown>> = {
|
|
|
33
33
|
* @param afterSaveError
|
|
34
34
|
* @group Hooks and utilities
|
|
35
35
|
*/
|
|
36
|
-
export declare function saveEntityWithCallbacks<M extends Record<string, unknown>>({ collection, path, entityId, values, previousValues, status, data, context, afterSave, afterSaveError }: SaveEntityWithCallbacksProps<M> & {
|
|
37
|
-
collection:
|
|
36
|
+
export declare function saveEntityWithCallbacks<M extends Record<string, unknown>>({ collection, path, entityId, values, previousValues, status, data, context, afterSave, afterSaveError }: Omit<SaveEntityWithCallbacksProps<M>, "collection"> & {
|
|
37
|
+
collection: AdminCollection<M>;
|
|
38
38
|
data: RebaseData;
|
|
39
39
|
context: RebaseContext;
|
|
40
40
|
}): Promise<Entity<M>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CollectionConfig } from "@rebasepro/types";
|
|
2
1
|
import { Entity, FilterValues, User } from "@rebasepro/types";
|
|
2
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
3
3
|
/**
|
|
4
4
|
* @group Hooks and utilities
|
|
5
5
|
*/
|
|
@@ -11,7 +11,7 @@ export interface CollectionProps<M extends Record<string, any>> {
|
|
|
11
11
|
/**
|
|
12
12
|
* collection of the entity displayed by this collection
|
|
13
13
|
*/
|
|
14
|
-
collection:
|
|
14
|
+
collection: AdminCollection<M>;
|
|
15
15
|
/**
|
|
16
16
|
* Number of entities to fetch
|
|
17
17
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CollectionConfig } from "@rebasepro/types";
|
|
2
1
|
import { Entity, User } from "@rebasepro/types";
|
|
2
|
+
import { AdminCollection } from "@rebasepro/admin-types";
|
|
3
3
|
/**
|
|
4
4
|
* @group Hooks and utilities
|
|
5
5
|
*/
|
|
@@ -7,7 +7,7 @@ export interface FetchProps<M extends Record<string, any>, USER extends User = U
|
|
|
7
7
|
path: string;
|
|
8
8
|
entityId?: string | number;
|
|
9
9
|
databaseId?: string;
|
|
10
|
-
collection:
|
|
10
|
+
collection: AdminCollection<M, USER>;
|
|
11
11
|
useCache?: boolean;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CollectionConfig } from "@rebasepro/types";
|
|
2
1
|
import { Entity, EntityRelation, FilterValues } from "@rebasepro/types";
|
|
2
|
+
import type { AdminCollection } from "@rebasepro/admin-types";
|
|
3
3
|
export interface RelationItem {
|
|
4
4
|
id: string | number;
|
|
5
5
|
label: string;
|
|
@@ -15,7 +15,7 @@ export interface UseRelationSelectorProps<M extends Record<string, any> = any> {
|
|
|
15
15
|
/**
|
|
16
16
|
* The collection that represents the relation entities
|
|
17
17
|
*/
|
|
18
|
-
collection:
|
|
18
|
+
collection: AdminCollection<M>;
|
|
19
19
|
/**
|
|
20
20
|
* Force filter to be applied to the relation search
|
|
21
21
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { UserConfigurationPersistence } from "@rebasepro/types";
|
|
1
|
+
import { UserConfigurationPersistence } from "@rebasepro/admin-types";
|
|
2
2
|
export declare function useBuildLocalConfigurationPersistence(): UserConfigurationPersistence;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CustomizationController } from "@rebasepro/types";
|
|
1
|
+
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
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { CollectionConfig } from "@rebasepro/types";
|
|
2
1
|
import { Entity } from "@rebasepro/types";
|
|
2
|
+
import type { AdminCollection } from "@rebasepro/admin-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.
|
|
6
6
|
*/
|
|
7
7
|
export declare function usePermissions(): {
|
|
8
|
-
canCreate: (collection:
|
|
9
|
-
canEdit: (collection:
|
|
10
|
-
canDelete: (collection:
|
|
11
|
-
canRead: (collection:
|
|
8
|
+
canCreate: (collection: AdminCollection<any>, path: string) => boolean;
|
|
9
|
+
canEdit: (collection: AdminCollection<any>, path: string, entity: Entity<any> | null) => boolean;
|
|
10
|
+
canDelete: (collection: AdminCollection<any>, path: string, entity: Entity<any> | null) => boolean;
|
|
11
|
+
canRead: (collection: AdminCollection<any>) => boolean;
|
|
12
12
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { RebaseRegistryController, RebaseAdminConfig, RebaseStudioConfig, RebaseAuthConfig } from "@rebasepro/types";
|
|
2
|
+
import type { RebaseRegistryController, RebaseAdminConfig, RebaseStudioConfig, RebaseAuthConfig } 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)
|
package/dist/hooks/useSlot.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { CollectionRegistryController
|
|
2
|
+
import type { CollectionRegistryController } from "@rebasepro/types";
|
|
3
|
+
import type { SidePanelController, UrlController, NavigationStateController, BreadcrumbEntry, BreadcrumbsController } from "@rebasepro/admin-types";
|
|
3
4
|
export type { BreadcrumbEntry, BreadcrumbsController };
|
|
4
5
|
/**
|
|
5
6
|
* StudioBridge provides optional CMS capabilities to Studio components.
|