@rebasepro/admin 0.2.1 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CollectionEditorDialog-BXIh2AXg.js → CollectionEditorDialog-D0VqpLPO.js} +73 -256
- package/dist/CollectionEditorDialog-D0VqpLPO.js.map +1 -0
- package/dist/{CollectionsStudioView-jR8iz_ja.js → CollectionsStudioView-Bc3Rxxc2.js} +5 -4
- package/dist/{CollectionsStudioView-jR8iz_ja.js.map → CollectionsStudioView-Bc3Rxxc2.js.map} +1 -1
- package/dist/{ExportCollectionAction-CMdiiv1L.js → ExportCollectionAction-Ckc-09BQ.js} +4 -3
- package/dist/ExportCollectionAction-Ckc-09BQ.js.map +1 -0
- package/dist/{ImportCollectionAction-C05lE0IW.js → ImportCollectionAction-BqjIrC3Z.js} +3 -2
- package/dist/{ImportCollectionAction-C05lE0IW.js.map → ImportCollectionAction-BqjIrC3Z.js.map} +1 -1
- package/dist/{PropertyEditView-BB5xjnhZ.js → PropertyEditView-CvRSV-A2.js} +430 -445
- package/dist/PropertyEditView-CvRSV-A2.js.map +1 -0
- package/dist/collection_editor/ConfigControllerProvider.d.ts +0 -5
- package/dist/collection_editor/index.d.ts +0 -1
- package/dist/collection_editor/types/collection_editor_controller.d.ts +0 -2
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +3 -3
- package/dist/collection_editor/ui/collection_editor/properties/RelationPropertyField.d.ts +1 -7
- package/dist/collection_editor_ui.js +3 -3
- package/dist/components/ArrayContainer.d.ts +2 -2
- package/dist/components/DefaultAppBar.d.ts +18 -1
- package/dist/components/DefaultDrawer.d.ts +51 -3
- package/dist/components/EntityCollectionTable/fields/TableStorageUpload.d.ts +2 -2
- package/dist/components/EntityCollectionTable/internal/EntityTableCell.d.ts +2 -2
- package/dist/components/EntityCollectionTable/table_bindings.d.ts +4 -3
- package/dist/components/EntityCollectionView/hooks/useKanbanDragAndDrop.d.ts +4 -3
- package/dist/components/EntityEditView.d.ts +2 -1
- package/dist/components/HomePage/HomePageDnD.d.ts +3 -3
- package/dist/components/PropertyCollectionView.d.ts +1 -1
- package/dist/components/PropertyIdCopyTooltip.d.ts +1 -1
- package/dist/components/SelectableTable/SelectionStore.d.ts +4 -1
- package/dist/components/SelectableTable/filters/BooleanFilterField.d.ts +2 -2
- package/dist/components/SelectableTable/filters/DateTimeFilterField.d.ts +2 -2
- package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -2
- package/dist/components/SelectableTable/filters/StringNumberFilterField.d.ts +2 -2
- package/dist/components/admin/RolesView.d.ts +3 -3
- package/dist/components/admin/UsersView.d.ts +3 -3
- package/dist/components/app/Drawer.d.ts +8 -1
- package/dist/data_export/export/export.d.ts +3 -3
- package/dist/editor/components/editor-bubble.d.ts +5 -1
- package/dist/editor/components/image-bubble.d.ts +5 -1
- package/dist/editor/components/index.d.ts +3 -3
- package/dist/editor/components/table-bubble.d.ts +5 -1
- package/dist/editor/nodeViews/ReactNodeView.d.ts +4 -1
- package/dist/editor/useProseMirror.d.ts +2 -2
- package/dist/editor/utils/remove_classes.d.ts +1 -1
- package/dist/editor.js +15 -14
- package/dist/editor.js.map +1 -1
- package/dist/form/EntityForm.d.ts +2 -2
- package/dist/form/components/StorageUploadProgress.d.ts +2 -2
- package/dist/form/field_bindings/MultiSelectFieldBinding.d.ts +1 -1
- package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +1 -1
- package/dist/form/validation.d.ts +3 -3
- package/dist/hooks/navigation/useResolvedCollections.d.ts +6 -0
- package/dist/hooks/navigation/useResolvedViews.d.ts +3 -4
- package/dist/{index-BAM9KCmM.js → index-BCcLwgfe.js} +3 -2
- package/dist/{index-BAM9KCmM.js.map → index-BCcLwgfe.js.map} +1 -1
- package/dist/{index-D5OQhv-T.js → index-DY2k5TtG.js} +3 -3
- package/dist/index-DY2k5TtG.js.map +1 -0
- package/dist/{index-CoSNm3e3.js → index-UQOMHwt1.js} +3 -3
- package/dist/index-UQOMHwt1.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2813 -372
- package/dist/index.js.map +1 -1
- package/dist/{markdown-z2Ir7Cgo.js → markdown-DD2JDU1X.js} +2 -2
- package/dist/markdown-DD2JDU1X.js.map +1 -0
- package/dist/preview/components/UrlComponentPreview.d.ts +1 -0
- package/dist/types/components/EntityFormActionsProps.d.ts +1 -1
- package/dist/types/components/EntityFormProps.d.ts +2 -2
- package/dist/types/fields.d.ts +1 -1
- package/dist/{util-DtbWD7LF.js → util-ZM9gQuCv.js} +2104 -2071
- package/dist/util-ZM9gQuCv.js.map +1 -0
- package/package.json +10 -9
- package/src/collection_editor/ConfigControllerProvider.tsx +3 -13
- package/src/collection_editor/index.ts +1 -3
- package/src/collection_editor/types/collection_editor_controller.tsx +0 -3
- package/src/collection_editor/ui/EditorCollectionAction.tsx +1 -6
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +1 -6
- package/src/collection_editor/ui/EditorEntityAction.tsx +1 -6
- package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +7 -14
- package/src/collection_editor/ui/NewCollectionCard.tsx +1 -5
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +3 -8
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +1 -10
- package/src/collection_editor/ui/collection_editor/CollectionJsonImportDialog.tsx +8 -12
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +21 -21
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +4 -4
- package/src/collection_editor/ui/collection_editor/EnumForm.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/BlockPropertyField.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/properties/CommonPropertyFields.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/properties/DateTimePropertyField.tsx +8 -8
- package/src/collection_editor/ui/collection_editor/properties/EnumPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/MarkdownPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/NumberPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/ReferencePropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/RelationPropertyField.tsx +37 -57
- package/src/collection_editor/ui/collection_editor/properties/RepeatPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/StoragePropertyField.tsx +8 -8
- package/src/collection_editor/ui/collection_editor/properties/StringPropertyField.tsx +5 -5
- package/src/collection_editor/ui/collection_editor/properties/UrlPropertyField.tsx +3 -2
- package/src/collection_editor/ui/collection_editor/properties/VectorPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +1 -1
- package/src/collection_editor/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +4 -7
- package/src/collection_editor/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +4 -4
- package/src/collection_editor/validateCollectionJson.ts +88 -1
- package/src/components/ArrayContainer.tsx +3 -3
- package/src/components/DefaultAppBar.tsx +52 -31
- package/src/components/DefaultDrawer.tsx +279 -66
- package/src/components/DrawerNavigationItem.tsx +1 -1
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +6 -5
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +9 -7
- package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +5 -5
- package/src/components/EntityCollectionTable/fields/VirtualTableNumberInput.tsx +12 -9
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +2 -2
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +1 -1
- package/src/components/EntityCollectionTable/table_bindings.tsx +5 -4
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +6 -4
- package/src/components/EntityCollectionView/hooks/useCollectionInlineEditor.ts +1 -1
- package/src/components/EntityCollectionView/hooks/useKanbanDragAndDrop.ts +7 -6
- package/src/components/EntityDetailView.tsx +46 -24
- package/src/components/EntityEditView.tsx +51 -28
- package/src/components/EntityEditViewFormActions.tsx +4 -4
- package/src/components/EntityPreview.tsx +9 -4
- package/src/components/HomePage/HomePageDnD.tsx +3 -2
- package/src/components/PropertyCollectionView.tsx +1 -1
- package/src/components/PropertyIdCopyTooltip.tsx +1 -1
- package/src/components/RebaseLayout.tsx +5 -1
- package/src/components/RebaseNavigation.tsx +2 -2
- package/src/components/RebaseRouteDefs.tsx +4 -7
- package/src/components/RebaseShell.tsx +16 -13
- package/src/components/SearchIconsView.tsx +1 -8
- package/src/components/SelectableTable/SelectableTable.tsx +8 -11
- package/src/components/SelectableTable/SelectionStore.ts +1 -1
- package/src/components/SelectableTable/filters/BooleanFilterField.tsx +3 -3
- package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +3 -3
- package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +5 -5
- package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +3 -3
- package/src/components/SideEntityProvider.tsx +2 -1
- package/src/components/admin/RolesView.tsx +7 -2
- package/src/components/admin/UsersView.tsx +12 -6
- package/src/components/app/Drawer.tsx +9 -1
- package/src/components/app/Scaffold.tsx +5 -1
- package/src/data_export/export/export.ts +17 -17
- package/src/data_import/components/DataNewPropertiesMapping.tsx +1 -1
- package/src/editor/components/editor-bubble.tsx +32 -9
- package/src/editor/components/image-bubble.tsx +27 -11
- package/src/editor/components/index.ts +3 -3
- package/src/editor/components/table-bubble.tsx +79 -17
- package/src/editor/extensions/HighlightDecorationExtension.ts +3 -2
- package/src/editor/nodeViews/ReactNodeView.tsx +1 -1
- package/src/editor/nodeViews/TaskItemComponent.tsx +9 -8
- package/src/editor/schema.ts +135 -59
- package/src/editor/selectors/link-selector.tsx +8 -5
- package/src/editor/useProseMirror.ts +2 -2
- package/src/editor/utils/remove_classes.ts +6 -5
- package/src/form/EntityForm.tsx +15 -15
- package/src/form/EntityFormActions.tsx +2 -2
- package/src/form/PropertyFieldBinding.tsx +64 -64
- package/src/form/components/FieldHelperText.tsx +4 -4
- package/src/form/components/StorageUploadProgress.tsx +2 -2
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +1 -1
- package/src/form/field_bindings/BlockFieldBinding.tsx +54 -53
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +290 -289
- package/src/form/field_bindings/MapFieldBinding.tsx +2 -2
- package/src/form/field_bindings/MultiSelectFieldBinding.tsx +2 -2
- package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +1 -1
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +8 -6
- package/src/form/field_bindings/RelationFieldBinding.tsx +4 -4
- package/src/form/field_bindings/RepeatFieldBinding.tsx +1 -1
- package/src/form/field_bindings/SelectFieldBinding.tsx +1 -1
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +84 -84
- package/src/form/field_bindings/SwitchFieldBinding.tsx +16 -16
- package/src/form/field_bindings/TextFieldBinding.tsx +77 -73
- package/src/form/field_bindings/UserSelectFieldBinding.tsx +17 -17
- package/src/form/validation.ts +43 -43
- package/src/hooks/navigation/useBuildNavigationStateController.tsx +3 -5
- package/src/hooks/navigation/useResolvedCollections.ts +27 -7
- package/src/hooks/navigation/useResolvedViews.tsx +24 -44
- package/src/index.ts +2 -0
- package/src/preview/PropertyPreview.tsx +2 -2
- package/src/preview/components/ImagePreview.tsx +2 -1
- package/src/preview/components/UrlComponentPreview.tsx +11 -2
- package/src/preview/components/UserPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +2 -2
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +4 -4
- package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +3 -3
- package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +3 -3
- package/src/preview/property_previews/ArrayOfStringsPreview.tsx +3 -2
- package/src/preview/property_previews/ArrayOneOfPreview.tsx +6 -8
- package/src/preview/property_previews/ArrayPropertyEnumPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayPropertyPreview.tsx +3 -3
- package/src/preview/property_previews/MapPropertyPreview.tsx +4 -3
- package/src/preview/property_previews/NumberPropertyPreview.tsx +5 -3
- package/src/preview/property_previews/StringPropertyPreview.tsx +10 -8
- package/src/types/components/EntityFormActionsProps.tsx +1 -1
- package/src/types/components/EntityFormProps.tsx +2 -2
- package/src/types/fields.tsx +2 -2
- package/dist/CollectionEditorDialog-BXIh2AXg.js.map +0 -1
- package/dist/ContentHomePage-BQZWuOFb.js +0 -1784
- package/dist/ContentHomePage-BQZWuOFb.js.map +0 -1
- package/dist/ExportCollectionAction-CMdiiv1L.js.map +0 -1
- package/dist/PropertyEditView-BB5xjnhZ.js.map +0 -1
- package/dist/RoleChip-QtUFXeTp.js +0 -67
- package/dist/RoleChip-QtUFXeTp.js.map +0 -1
- package/dist/RolesView-CULIHWZ9.js +0 -437
- package/dist/RolesView-CULIHWZ9.js.map +0 -1
- package/dist/UsersView-D7_AtJ44.js +0 -408
- package/dist/UsersView-D7_AtJ44.js.map +0 -1
- package/dist/collection_editor/types/config_permissions.d.ts +0 -19
- package/dist/index-CoSNm3e3.js.map +0 -1
- package/dist/index-D5OQhv-T.js.map +0 -1
- package/dist/markdown-z2Ir7Cgo.js.map +0 -1
- package/dist/util-DtbWD7LF.js.map +0 -1
- package/src/collection_editor/types/config_permissions.ts +0 -20
|
@@ -3,8 +3,8 @@ import type { PropertyConfig } from "@rebasepro/types";
|
|
|
3
3
|
import { AuthController, Entity, EntityValues } from "@rebasepro/types";
|
|
4
4
|
import type { EntityFormProps } from "../types/components/EntityFormProps";
|
|
5
5
|
import { z } from "zod";
|
|
6
|
-
export declare function extractTouchedValues(values:
|
|
6
|
+
export declare function extractTouchedValues(values: unknown, touched: Record<string, boolean>): Record<string, unknown>;
|
|
7
7
|
export declare function getChanges<T extends object>(source: Partial<T>, comparison: Partial<T>): Partial<T>;
|
|
8
8
|
export declare function EntityForm<M extends Record<string, unknown>>({ path, entityId: entityIdProp, collection, onValuesModified, onIdChange, onSaved, entity, initialDirtyValues, onFormContextReady, forceActionsAtTheBottom, initialStatus, className, onStatusChange, onEntityChange, openEntityMode, formex: formexProp, disabled: disabledProp, Builder, EntityFormActionsComponent, showDefaultActions, showEntityPath, navigateBack: navigateBackProp, children }: EntityFormProps<M>): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export declare function getInitialEntityValues<M extends Record<string, unknown>>(authController: AuthController, collection: EntityCollection, path: string, status: "new" | "existing" | "copy", entity: Entity<M> | undefined, propertyConfigs?: Record<string, PropertyConfig>): Partial<EntityValues<M>>;
|
|
10
|
-
export declare function zodToFormErrors(zodError: z.ZodError): Record<string,
|
|
10
|
+
export declare function zodToFormErrors(zodError: z.ZodError): Record<string, string>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { StorageFieldItem } from "@rebasepro/core";
|
|
2
2
|
export interface StorageUploadItemProps {
|
|
3
3
|
storagePath: string;
|
|
4
|
-
metadata?:
|
|
4
|
+
metadata?: Record<string, unknown>;
|
|
5
5
|
entry: StorageFieldItem;
|
|
6
|
-
onFileUploadComplete: (value: string, entry: StorageFieldItem, metadata?:
|
|
6
|
+
onFileUploadComplete: (value: string, entry: StorageFieldItem, metadata?: Record<string, unknown>, uploadedUrl?: string) => Promise<void>;
|
|
7
7
|
imageSize: number;
|
|
8
8
|
simple: boolean;
|
|
9
9
|
}
|
|
@@ -7,4 +7,4 @@ import type { ArrayProperty } from "@rebasepro/types";
|
|
|
7
7
|
* and tables to the specified properties.
|
|
8
8
|
* @group Form fields
|
|
9
9
|
*/
|
|
10
|
-
export declare function MultiSelectFieldBinding({ propertyKey, value, setValue, error, showError, disabled, property, includeDescription, size, autoFocus }: FieldProps<ArrayProperty,
|
|
10
|
+
export declare function MultiSelectFieldBinding({ propertyKey, value, setValue, error, showError, disabled, property, includeDescription, size, autoFocus }: FieldProps<ArrayProperty, unknown, Record<string, unknown>>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,7 +15,7 @@ export interface StorageUploadProps {
|
|
|
15
15
|
storage: StorageConfig;
|
|
16
16
|
onFilesAdded: (acceptedFiles: File[]) => Promise<void>;
|
|
17
17
|
storagePathBuilder: (file: File) => string;
|
|
18
|
-
onFileUploadComplete: (uploadedPath: string, entry: StorageFieldItem, fileMetadata?:
|
|
18
|
+
onFileUploadComplete: (uploadedPath: string, entry: StorageFieldItem, fileMetadata?: Record<string, unknown>) => Promise<void>;
|
|
19
19
|
}
|
|
20
20
|
export declare function StorageUpload({ property, name, value, // This is internalValue from useStorageUploadController
|
|
21
21
|
setInternalValue, onChange, multipleFilesSupported, onFileUploadComplete, disabled, onFilesAdded, autoFocus, storage, storagePathBuilder }: StorageUploadProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,7 +3,7 @@ import type { ArrayProperty, MapProperty, Property } from "@rebasepro/types";
|
|
|
3
3
|
import { z, ZodTypeAny } from "zod";
|
|
4
4
|
export type CustomFieldValidator = (props: {
|
|
5
5
|
name: string;
|
|
6
|
-
value:
|
|
6
|
+
value: unknown;
|
|
7
7
|
property: Property;
|
|
8
8
|
entityId?: string | number;
|
|
9
9
|
parentProperty?: MapProperty | ArrayProperty;
|
|
@@ -13,9 +13,9 @@ interface PropertyContext<P extends Property> {
|
|
|
13
13
|
parentProperty?: MapProperty | ArrayProperty;
|
|
14
14
|
entityId?: string | number;
|
|
15
15
|
customFieldValidator?: CustomFieldValidator;
|
|
16
|
-
name?:
|
|
16
|
+
name?: string;
|
|
17
17
|
}
|
|
18
|
-
export declare function getEntitySchema<M extends Record<string, unknown>>(entityId: string | number | undefined, properties: Properties, customFieldValidator?: CustomFieldValidator): z.ZodObject<
|
|
18
|
+
export declare function getEntitySchema<M extends Record<string, unknown>>(entityId: string | number | undefined, properties: Properties, customFieldValidator?: CustomFieldValidator): z.ZodObject<Record<string, ZodTypeAny>>;
|
|
19
19
|
export declare function mapPropertyToZod(propertyContext: PropertyContext<Property>): ZodTypeAny;
|
|
20
20
|
export declare function getZodMapObjectSchema({ property, entityId, customFieldValidator, name }: PropertyContext<MapProperty>): ZodTypeAny;
|
|
21
21
|
export {};
|
|
@@ -2,6 +2,7 @@ import type { EntityCollection, RebasePlugin } from "@rebasepro/types";
|
|
|
2
2
|
import { AuthController, CollectionRegistryController, RebaseData, User } from "@rebasepro/types";
|
|
3
3
|
import type { EntityCollectionsBuilder } from "@rebasepro/types";
|
|
4
4
|
import { CollectionRegistry } from "@rebasepro/common";
|
|
5
|
+
import { UserManagementDelegate } from "@rebasepro/types";
|
|
5
6
|
export type UseResolvedCollectionsProps<EC extends EntityCollection, USER extends User> = {
|
|
6
7
|
authController: AuthController<USER>;
|
|
7
8
|
collections?: EC[] | EntityCollectionsBuilder<EC>;
|
|
@@ -11,6 +12,7 @@ export type UseResolvedCollectionsProps<EC extends EntityCollection, USER extend
|
|
|
11
12
|
collectionRegistryController: CollectionRegistryController<EC> & {
|
|
12
13
|
collectionRegistryRef: React.MutableRefObject<CollectionRegistry>;
|
|
13
14
|
};
|
|
15
|
+
userManagement?: UserManagementDelegate<USER>;
|
|
14
16
|
};
|
|
15
17
|
export type UseResolvedCollectionsResult = {
|
|
16
18
|
collections: EntityCollection[];
|
|
@@ -22,6 +24,10 @@ export type UseResolvedCollectionsResult = {
|
|
|
22
24
|
* Hook that resolves collection props (which may be async builders or arrays)
|
|
23
25
|
* into concrete EntityCollection[], and registers them with the CollectionRegistry.
|
|
24
26
|
*
|
|
27
|
+
* When userManagement is provided, the default users collection is always
|
|
28
|
+
* prepended. Developer collections override via generic slug-based dedup
|
|
29
|
+
* (Map keyed by slug, last-write-wins). No hardcoded string checks.
|
|
30
|
+
*
|
|
25
31
|
* Uses refs for potentially-unstable dependencies (driver, authController,
|
|
26
32
|
* plugins) to avoid re-triggering effects when their object identity changes.
|
|
27
33
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AppView, AppViewsBuilder, EffectiveRoleController,
|
|
1
|
+
import type { AppView, AppViewsBuilder, EffectiveRoleController, RebasePlugin } from "@rebasepro/types";
|
|
2
2
|
import { AuthController, RebaseData, User } from "@rebasepro/types";
|
|
3
3
|
import { UserManagementDelegate } from "@rebasepro/types";
|
|
4
4
|
export type UseResolvedViewsProps<USER extends User> = {
|
|
@@ -10,7 +10,6 @@ export type UseResolvedViewsProps<USER extends User> = {
|
|
|
10
10
|
adminMode?: "content" | "studio" | "settings";
|
|
11
11
|
effectiveRoleController?: EffectiveRoleController;
|
|
12
12
|
userManagement?: UserManagementDelegate<USER>;
|
|
13
|
-
collections?: EntityCollection[];
|
|
14
13
|
};
|
|
15
14
|
export type UseResolvedViewsResult = {
|
|
16
15
|
views: AppView[] | undefined;
|
|
@@ -21,8 +20,8 @@ export type UseResolvedViewsResult = {
|
|
|
21
20
|
};
|
|
22
21
|
/**
|
|
23
22
|
* Hook that resolves view and admin view props (which may be async builders or arrays)
|
|
24
|
-
* into concrete AppView[]. Also injects
|
|
25
|
-
* is provided.
|
|
23
|
+
* into concrete AppView[]. Also injects the Roles admin view when userManagement
|
|
24
|
+
* is provided with roles.
|
|
26
25
|
*
|
|
27
26
|
* Uses refs for potentially-unstable dependencies (driver, authController,
|
|
28
27
|
* plugins) to avoid re-triggering effects when their object identity changes.
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useRef, useEffect } from "react";
|
|
3
3
|
import { Chip, Tooltip, cls, defaultBorderMixin, Typography, ArrowLeftIcon, iconSize, Label, IconButton, HistoryIcon, ErrorBoundary } from "@rebasepro/ui";
|
|
4
4
|
import { c } from "react-compiler-runtime";
|
|
5
|
-
import {
|
|
5
|
+
import { aY as getPropertyInPath, a7 as PropertyPreview } from "./util-ZM9gQuCv.js";
|
|
6
6
|
import { useAuthController, useSnackbarController, ConfirmationDialog } from "@rebasepro/core";
|
|
7
7
|
import { getValueInPath } from "@rebasepro/utils";
|
|
8
8
|
import "fast-equals";
|
|
@@ -18,6 +18,7 @@ import "@dnd-kit/sortable";
|
|
|
18
18
|
import "@dnd-kit/utilities";
|
|
19
19
|
import "react-dropzone";
|
|
20
20
|
import "react-router-dom";
|
|
21
|
+
import "fuse.js";
|
|
21
22
|
import { u as useEntityHistory } from "./useEntityHistory-UVsSclfZ.js";
|
|
22
23
|
import "exceljs";
|
|
23
24
|
import "@rebasepro/schema-inference";
|
|
@@ -458,4 +459,4 @@ export {
|
|
|
458
459
|
EntityHistoryView,
|
|
459
460
|
UserChip
|
|
460
461
|
};
|
|
461
|
-
//# sourceMappingURL=index-
|
|
462
|
+
//# sourceMappingURL=index-BCcLwgfe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-BAM9KCmM.js","sources":["../src/components/history/UserChip.tsx","../src/components/history/EntityHistoryEntry.tsx","../src/components/history/EntityHistoryView.tsx"],"sourcesContent":["import { User } from \"@rebasepro/types\";\nimport { Chip, Tooltip } from \"@rebasepro/ui\";\n\nexport function UserChip({ user }: { user: User }) {\n return (\n <Tooltip title={user.email ?? user.uid}>\n <Chip size={\"small\"} className={\"flex items-center\"}>\n {user.photoURL && <img\n className={\"rounded-full w-6 h-6 mr-2\"}\n src={user.photoURL} alt={user.displayName ?? \"User picture\"}/>}\n <span>{user.displayName ?? user.email ?? user.uid}</span>\n </Chip>\n </Tooltip>\n );\n}\n","import type { EntityCollection } from \"@rebasepro/types\";\nimport type { Property } from \"@rebasepro/types\";\nimport * as React from \"react\";\n\nimport { ArrowLeftIcon, Chip, cls, defaultBorderMixin, iconSize, Tooltip, Typography } from \"@rebasepro/ui\";\nimport { PreviewSize } from \"../../types/components/PropertyPreviewProps\";\nimport { getPropertyInPath } from \"../../util/property_utils\";\nimport { PropertyPreview } from \"../../preview/PropertyPreview\";\nimport { SkeletonPropertyComponent } from \"../../preview/property_previews/SkeletonPropertyComponent\";\nimport { useAuthController } from \"@rebasepro/core\";\nimport { UserChip } from \"./UserChip\";\nimport { HistoryEntryData } from \"../../hooks\";\nimport { getValueInPath } from \"@rebasepro/utils\";\n\n/**\n * Recursive deep equality for primitives, arrays and plain objects.\n */\nfunction deepEqual(a: unknown, b: unknown): boolean {\n if (a === b) return true;\n if (a == null || b == null) return a === b;\n if (typeof a !== typeof b) return false;\n if (typeof a !== \"object\") return false;\n\n if (Array.isArray(a)) {\n if (!Array.isArray(b) || a.length !== (b as unknown[]).length) return false;\n return a.every((item, i) => deepEqual(item, (b as unknown[])[i]));\n }\n\n if (Array.isArray(b)) return false;\n\n const aObj = a as Record<string, unknown>;\n const bObj = b as Record<string, unknown>;\n const aKeys = Object.keys(aObj);\n const bKeys = Object.keys(bObj);\n if (aKeys.length !== bKeys.length) return false;\n return aKeys.every(key => key in bObj && deepEqual(aObj[key], bObj[key]));\n}\n\nexport type EntityHistoryEntryProps = {\n size: PreviewSize;\n actions?: React.ReactNode;\n collection?: EntityCollection;\n hover?: boolean;\n entry: HistoryEntryData;\n onClick?: (e: React.SyntheticEvent) => void;\n};\n\nfunction PreviousValueView({\n previousValueInPath,\n childProperty,\n propertyKey\n}: {\n previousValueInPath: unknown;\n childProperty: Property;\n propertyKey: string;\n}) {\n if (typeof previousValueInPath === \"string\" || typeof previousValueInPath === \"number\") {\n return <Typography variant={\"caption\"} color={\"secondary\"} className=\"line-through\">\n {previousValueInPath}\n </Typography>;\n } else if (typeof previousValueInPath === \"boolean\") {\n return <Typography variant={\"caption\"} color={\"secondary\"} className=\"line-through\">\n {previousValueInPath ? \"true\" : \"false\"}\n </Typography>;\n } else {\n return <Tooltip\n side={\"left\"}\n title={<div className={\"flex flex-col gap-2\"}>\n <Typography variant={\"caption\"} color={\"secondary\"}>\n Previous value\n </Typography>\n <PropertyPreview\n propertyKey={propertyKey as string}\n value={previousValueInPath as never}\n property={childProperty as Property}\n size={\"small\"}/>\n </div>}>\n <ArrowLeftIcon size={iconSize.smallest} color={\"disabled\"} className={\"mb-1\"}/>\n </Tooltip>\n }\n}\n\n/**\n * Displays a single entity history revision entry.\n * Adapted from the entity_history plugin — now reads from backend API data.\n */\nexport function EntityHistoryEntry({\n actions,\n hover,\n collection,\n size,\n entry\n}: EntityHistoryEntryProps) {\n\n const authController = useAuthController();\n\n const changedFields = entry.changed_fields;\n const previousValues = entry.previous_values;\n const updatedOn = new Date(entry.updated_at);\n const updatedBy = entry.updated_by;\n\n // Resolve user display\n const currentUser = authController.user;\n const userDisplay = updatedBy === currentUser?.uid\n ? currentUser\n : undefined;\n\n return <div className={\"w-full flex flex-col gap-2 mt-4\"}>\n <div className={\"ml-4 flex items-center gap-4\"}>\n <Typography variant={\"body2\"} color={\"secondary\"}>\n {updatedOn.toLocaleString()}\n </Typography>\n <Chip size={\"small\"}>\n {entry.action}\n </Chip>\n {!userDisplay && updatedBy && <Chip size={\"small\"}>{updatedBy}</Chip>}\n {userDisplay && <UserChip user={userDisplay}/>}\n </div>\n <div\n className={cls(\n \"bg-white dark:bg-surface-900\",\n \"min-h-[44px]\",\n \"w-full\",\n \"items-center\",\n hover ? \"hover:bg-surface-accent-50 dark:hover:bg-surface-800\" : \"\",\n size === \"small\" ? \"p-1\" : \"px-2 py-1\",\n \"flex border rounded-lg\",\n defaultBorderMixin\n )}>\n\n {actions}\n\n <div className={\"flex flex-col grow w-full m-1 shrink min-w-0\"}>\n\n {changedFields && collection && changedFields.map((key: string) => {\n const childProperty = getPropertyInPath(collection.properties, key);\n const valueInPath = entry.values ? getValueInPath(entry.values, key) : undefined;\n const previousValueInPath = previousValues ? getValueInPath(previousValues, key) : undefined;\n\n const element = childProperty\n ? <PropertyPreview\n propertyKey={key}\n value={valueInPath as never}\n property={childProperty as Property}\n size={\"small\"}/>\n : <Typography variant={\"body2\"}>\n {typeof valueInPath === \"string\" ? valueInPath : JSON.stringify(valueInPath)}\n </Typography>;\n\n return (\n <div key={\"ref_prev_\" + key}\n className=\"flex w-full my-1 items-center\">\n <Typography variant={\"caption\"}\n color={\"secondary\"}\n className=\"min-w-[140px] md:min-w-[200px] w-1/5 pr-8 overflow-hidden text-ellipsis text-right\">\n {key}\n </Typography>\n <div className=\"w-4/5\">\n {previousValueInPath !== undefined && !deepEqual(previousValueInPath, valueInPath) &&\n <PreviousValueView previousValueInPath={previousValueInPath}\n childProperty={childProperty as Property}\n propertyKey={key}/>\n }\n {element}\n </div>\n </div>\n );\n })}\n\n {(!changedFields || changedFields.length === 0) && (\n <Typography variant={\"caption\"} color={\"secondary\"} className=\"ml-4\">\n {entry.action === \"create\" ? \"Entity created\" :\n entry.action === \"delete\" ? \"Entity deleted\" : \"No field changes recorded\"}\n </Typography>\n )}\n\n </div>\n\n </div>\n </div>;\n}\n","\nimport type { EntityCustomViewParams } from \"@rebasepro/types\";\nimport { useRef, useEffect } from \"react\";\nimport { cls, IconButton, Label, Tooltip, Typography } from \"@rebasepro/ui\";\nimport { ErrorBoundary, HistoryIcon } from \"@rebasepro/ui\";\nimport { EntityHistoryEntry } from \"./EntityHistoryEntry\";\nimport { useSnackbarController, useAuthController } from \"@rebasepro/core\";\nimport { ConfirmationDialog } from \"@rebasepro/core\";\nimport { useState } from \"react\";\nimport { useEntityHistory } from \"../../index\";\n\n/**\n * Entity history tab view. Shows a paginated list of entity revisions\n * fetched from the backend API. Supports infinite scroll and revert.\n */\nexport function EntityHistoryView<M extends Record<string, unknown>>({\n entity,\n collection,\n formContext\n}: EntityCustomViewParams<M>) {\n\n const snackbarController = useSnackbarController();\n const authController = useAuthController();\n const dirty = formContext?.formex.dirty;\n\n const slug = collection.slug;\n const entityId = entity?.id;\n\n const {\n entries,\n isLoading,\n hasMore,\n loadMore,\n revert\n } = useEntityHistory({\n slug,\n entityId,\n enabled: !!entityId,\n pageSize: 10\n });\n\n const [revertHistoryId, setRevertHistoryId] = useState<string | undefined>();\n const [isReverting, setIsReverting] = useState(false);\n\n const containerRef = useRef<HTMLDivElement>(null);\n const loadMoreRef = useRef<HTMLDivElement>(null);\n\n // Intersection observer for infinite scroll\n useEffect(() => {\n const currentContainer = containerRef.current;\n const currentLoadMore = loadMoreRef.current;\n\n if (!currentContainer || !currentLoadMore || !hasMore || isLoading) return;\n\n const observer = new IntersectionObserver(\n (observerEntries) => {\n if (observerEntries[0].isIntersecting && hasMore && !isLoading) {\n loadMore();\n }\n },\n {\n root: currentContainer,\n rootMargin: \"0px 0px 200px 0px\",\n threshold: 0.01\n }\n );\n\n observer.observe(currentLoadMore);\n\n return () => observer.disconnect();\n }, [hasMore, isLoading, entries.length, loadMore]);\n\n if (!entity) {\n return <div className=\"flex items-center justify-center h-full\">\n <Label>HistoryIcon is only available for existing entities</Label>\n </div>;\n }\n\n async function doRevert(historyId: string) {\n setIsReverting(true);\n try {\n const revertedValues = await revert(historyId);\n setRevertHistoryId(undefined);\n\n // Reset the form with the reverted values so the UI updates\n // immediately without requiring a page refresh.\n if (formContext?.formex?.resetForm && revertedValues) {\n formContext.formex.resetForm({\n values: revertedValues as M,\n submitCount: 0,\n touched: {}\n });\n }\n\n snackbarController.open({\n message: \"Reverted to selected version\",\n type: \"info\"\n });\n } catch (error) {\n console.error(\"Error reverting entity:\", error);\n snackbarController.open({\n message: \"Error reverting entity\",\n type: \"error\"\n });\n } finally {\n setIsReverting(false);\n }\n }\n\n const revertEntry = revertHistoryId\n ? entries.find(e => e.id === revertHistoryId)\n : undefined;\n\n return <div\n ref={containerRef}\n className={cls(\"relative flex-1 h-full overflow-auto w-full flex flex-col gap-4 p-8\")}>\n <div className=\"flex flex-col gap-2 max-w-6xl mx-auto w-full\">\n\n <Typography variant={\"h5\"} className={\"mt-24 ml-4\"}>\n HistoryIcon\n </Typography>\n\n {isLoading && entries.length === 0 && (\n <div className=\"flex flex-col gap-4 mt-8 ml-4\">\n {[1, 2, 3].map(i => (\n <div key={i} className=\"flex flex-col gap-2 animate-pulse\">\n <div className=\"h-4 w-48 bg-surface-200 dark:bg-surface-700 rounded\"/>\n <div className=\"h-12 w-full bg-surface-100 dark:bg-surface-900 rounded-lg border border-surface-200 dark:border-surface-700\"/>\n </div>\n ))}\n </div>\n )}\n\n {!isLoading && entries.length === 0 && <>\n <Label className={\"ml-4 mt-8\"}>\n No history available\n </Label>\n <Typography variant={\"caption\"} className={\"ml-4\"}>\n When you save an entity, a new version is created and stored in the history.\n </Typography>\n </>}\n\n {entries.map((entry) => (\n <div key={entry.id} className=\"flex flex-cols gap-2 w-full\">\n <EntityHistoryEntry\n entry={entry}\n collection={collection}\n size={\"medium\"}\n actions={\n <Tooltip title={\"Revert to this version\"}\n className={\"m-2 grow-0 self-start\"}>\n <IconButton\n onClick={() => {\n if (dirty) {\n snackbarController.open({\n message: \"Please save or discard your changes before reverting\",\n type: \"warning\"\n });\n } else {\n setRevertHistoryId(entry.id);\n }\n }}>\n <HistoryIcon/>\n </IconButton>\n </Tooltip>\n }\n />\n </div>\n ))}\n\n {/* Load more sentinel */}\n {entries.length > 0 && (\n <div ref={loadMoreRef} className=\"py-4 text-center\">\n {isLoading && <Label>Loading more...</Label>}\n {!hasMore && entries.length > 10 && <Label>No more history available</Label>}\n </div>\n )}\n </div>\n\n <ErrorBoundary>\n <ConfirmationDialog\n open={Boolean(revertHistoryId)}\n onAccept={() => {\n if (revertHistoryId) doRevert(revertHistoryId);\n }}\n onCancel={() => setRevertHistoryId(undefined)}\n title={<Typography variant={\"subtitle2\"}>Revert data to this version?</Typography>}\n body={revertEntry\n ? <div className=\"p-4\">\n <Typography variant={\"caption\"} color={\"secondary\"}>\n This will save the entity with the values from{\" \"}\n {new Date(revertEntry.updated_at).toLocaleString()}.\n A new history entry will be created for the revert.\n </Typography>\n </div>\n : null\n }\n />\n </ErrorBoundary>\n </div>;\n}\n"],"names":["UserChip","t0","$","_c","user","t1","email","uid","t2","displayName","photoURL","t3","t4","t5","t6","deepEqual","a","b","Array","isArray","length","every","item","i","aObj","bObj","aKeys","Object","keys","bKeys","key","PreviousValueView","previousValueInPath","childProperty","propertyKey","Symbol","for","iconSize","smallest","t7","EntityHistoryEntry","actions","hover","collection","size","entry","authController","useAuthController","changedFields","changed_fields","previousValues","previous_values","T0","updatedBy","userDisplay","updated_at","updated_by","updatedOn","Date","currentUser","undefined","Typography","toLocaleString","action","t8","t9","t10","t11","t12","t13","cls","defaultBorderMixin","t14","values","map","getPropertyInPath","properties","valueInPath","getValueInPath","element","JSON","stringify","t15","t16","t17","t18","EntityHistoryView","entity","formContext","snackbarController","useSnackbarController","dirty","formex","slug","entityId","id","entries","isLoading","hasMore","loadMore","revert","useEntityHistory","enabled","pageSize","revertHistoryId","setRevertHistoryId","useState","isReverting","setIsReverting","containerRef","useRef","loadMoreRef","useEffect","currentContainer","current","currentLoadMore","observer","IntersectionObserver","observerEntries","isIntersecting","root","rootMargin","threshold","observe","disconnect","doRevert","historyId","revertedValues","resetForm","submitCount","touched","open","message","type","error","console","revertEntry","find","e","Boolean"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAGO,SAAAA,SAAAC,IAAA;AAAA,QAAAC,IAAAC,EAAA,EAAA;AAAkB,QAAA;AAAA,IAAAC;AAAAA,EAAAA,IAAAH;AAED,QAAAI,KAAAD,KAAIE,SAAUF,KAAIG;AAAI,MAAAC;AAAA,MAAAN,EAAA,CAAA,MAAAE,KAAAK,eAAAP,EAAA,CAAA,MAAAE,KAAAM,UAAA;AAE7BF,SAAAJ,KAAIM,YAAa,oBAAA,OAAA,EACH,WAAA,6BACN,KAAAN,KAAIM,UAAgB,KAAAN,KAAIK,eAAgB,gBAAc;AAAGP,MAAA,CAAA,IAAAE,KAAAK;AAAAP,MAAA,CAAA,IAAAE,KAAAM;AAAAR,WAAAM;AAAAA,EAAA,OAAA;AAAAA,SAAAN,EAAA,CAAA;AAAA,EAAA;AAC3D,QAAAS,KAAAP,KAAIK,eAAgBL,KAAIE,SAAUF,KAAIG;AAAI,MAAAK;AAAA,MAAAV,SAAAS,IAAA;AAAjDC,uC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AmB7C,MAAS,GAC5C,OAAO,oBAAC,YAAA,EAAW,SAAS,aAAa,UAAA,+BAAA,CAA4B,GACrE,MAAM4E,cACA,oBAAC,OAAA,EAAI,WAAU,OACb,+BAAC,YAAA,EAAW,SAAS,WAAW,OAAO,aAAY,UAAA;AAAA,MAAA;AAAA,MACA;AAAA,MAC9C,IAAI9E,KAAK8E,YAAYjF,UAAU,EAAEO,eAAAA;AAAAA,MAAiB;AAAA,IAAA,EAAA,CAEvD,EAAA,CACJ,IACE,KAAA,CACL,EAAA,CAET;AAAA,EAAA,GACJ;AACJ;"}
|
|
1
|
+
{"version":3,"file":"index-BCcLwgfe.js","sources":["../src/components/history/UserChip.tsx","../src/components/history/EntityHistoryEntry.tsx","../src/components/history/EntityHistoryView.tsx"],"sourcesContent":["import { User } from \"@rebasepro/types\";\nimport { Chip, Tooltip } from \"@rebasepro/ui\";\n\nexport function UserChip({ user }: { user: User }) {\n return (\n <Tooltip title={user.email ?? user.uid}>\n <Chip size={\"small\"} className={\"flex items-center\"}>\n {user.photoURL && <img\n className={\"rounded-full w-6 h-6 mr-2\"}\n src={user.photoURL} alt={user.displayName ?? \"User picture\"}/>}\n <span>{user.displayName ?? user.email ?? user.uid}</span>\n </Chip>\n </Tooltip>\n );\n}\n","import type { EntityCollection } from \"@rebasepro/types\";\nimport type { Property } from \"@rebasepro/types\";\nimport * as React from \"react\";\n\nimport { ArrowLeftIcon, Chip, cls, defaultBorderMixin, iconSize, Tooltip, Typography } from \"@rebasepro/ui\";\nimport { PreviewSize } from \"../../types/components/PropertyPreviewProps\";\nimport { getPropertyInPath } from \"../../util/property_utils\";\nimport { PropertyPreview } from \"../../preview/PropertyPreview\";\nimport { SkeletonPropertyComponent } from \"../../preview/property_previews/SkeletonPropertyComponent\";\nimport { useAuthController } from \"@rebasepro/core\";\nimport { UserChip } from \"./UserChip\";\nimport { HistoryEntryData } from \"../../hooks\";\nimport { getValueInPath } from \"@rebasepro/utils\";\n\n/**\n * Recursive deep equality for primitives, arrays and plain objects.\n */\nfunction deepEqual(a: unknown, b: unknown): boolean {\n if (a === b) return true;\n if (a == null || b == null) return a === b;\n if (typeof a !== typeof b) return false;\n if (typeof a !== \"object\") return false;\n\n if (Array.isArray(a)) {\n if (!Array.isArray(b) || a.length !== (b as unknown[]).length) return false;\n return a.every((item, i) => deepEqual(item, (b as unknown[])[i]));\n }\n\n if (Array.isArray(b)) return false;\n\n const aObj = a as Record<string, unknown>;\n const bObj = b as Record<string, unknown>;\n const aKeys = Object.keys(aObj);\n const bKeys = Object.keys(bObj);\n if (aKeys.length !== bKeys.length) return false;\n return aKeys.every(key => key in bObj && deepEqual(aObj[key], bObj[key]));\n}\n\nexport type EntityHistoryEntryProps = {\n size: PreviewSize;\n actions?: React.ReactNode;\n collection?: EntityCollection;\n hover?: boolean;\n entry: HistoryEntryData;\n onClick?: (e: React.SyntheticEvent) => void;\n};\n\nfunction PreviousValueView({\n previousValueInPath,\n childProperty,\n propertyKey\n}: {\n previousValueInPath: unknown;\n childProperty: Property;\n propertyKey: string;\n}) {\n if (typeof previousValueInPath === \"string\" || typeof previousValueInPath === \"number\") {\n return <Typography variant={\"caption\"} color={\"secondary\"} className=\"line-through\">\n {previousValueInPath}\n </Typography>;\n } else if (typeof previousValueInPath === \"boolean\") {\n return <Typography variant={\"caption\"} color={\"secondary\"} className=\"line-through\">\n {previousValueInPath ? \"true\" : \"false\"}\n </Typography>;\n } else {\n return <Tooltip\n side={\"left\"}\n title={<div className={\"flex flex-col gap-2\"}>\n <Typography variant={\"caption\"} color={\"secondary\"}>\n Previous value\n </Typography>\n <PropertyPreview\n propertyKey={propertyKey as string}\n value={previousValueInPath as never}\n property={childProperty as Property}\n size={\"small\"}/>\n </div>}>\n <ArrowLeftIcon size={iconSize.smallest} color={\"disabled\"} className={\"mb-1\"}/>\n </Tooltip>\n }\n}\n\n/**\n * Displays a single entity history revision entry.\n * Adapted from the entity_history plugin — now reads from backend API data.\n */\nexport function EntityHistoryEntry({\n actions,\n hover,\n collection,\n size,\n entry\n}: EntityHistoryEntryProps) {\n\n const authController = useAuthController();\n\n const changedFields = entry.changed_fields;\n const previousValues = entry.previous_values;\n const updatedOn = new Date(entry.updated_at);\n const updatedBy = entry.updated_by;\n\n // Resolve user display\n const currentUser = authController.user;\n const userDisplay = updatedBy === currentUser?.uid\n ? currentUser\n : undefined;\n\n return <div className={\"w-full flex flex-col gap-2 mt-4\"}>\n <div className={\"ml-4 flex items-center gap-4\"}>\n <Typography variant={\"body2\"} color={\"secondary\"}>\n {updatedOn.toLocaleString()}\n </Typography>\n <Chip size={\"small\"}>\n {entry.action}\n </Chip>\n {!userDisplay && updatedBy && <Chip size={\"small\"}>{updatedBy}</Chip>}\n {userDisplay && <UserChip user={userDisplay}/>}\n </div>\n <div\n className={cls(\n \"bg-white dark:bg-surface-900\",\n \"min-h-[44px]\",\n \"w-full\",\n \"items-center\",\n hover ? \"hover:bg-surface-accent-50 dark:hover:bg-surface-800\" : \"\",\n size === \"small\" ? \"p-1\" : \"px-2 py-1\",\n \"flex border rounded-lg\",\n defaultBorderMixin\n )}>\n\n {actions}\n\n <div className={\"flex flex-col grow w-full m-1 shrink min-w-0\"}>\n\n {changedFields && collection && changedFields.map((key: string) => {\n const childProperty = getPropertyInPath(collection.properties, key);\n const valueInPath = entry.values ? getValueInPath(entry.values, key) : undefined;\n const previousValueInPath = previousValues ? getValueInPath(previousValues, key) : undefined;\n\n const element = childProperty\n ? <PropertyPreview\n propertyKey={key}\n value={valueInPath as never}\n property={childProperty as Property}\n size={\"small\"}/>\n : <Typography variant={\"body2\"}>\n {typeof valueInPath === \"string\" ? valueInPath : JSON.stringify(valueInPath)}\n </Typography>;\n\n return (\n <div key={\"ref_prev_\" + key}\n className=\"flex w-full my-1 items-center\">\n <Typography variant={\"caption\"}\n color={\"secondary\"}\n className=\"min-w-[140px] md:min-w-[200px] w-1/5 pr-8 overflow-hidden text-ellipsis text-right\">\n {key}\n </Typography>\n <div className=\"w-4/5\">\n {previousValueInPath !== undefined && !deepEqual(previousValueInPath, valueInPath) &&\n <PreviousValueView previousValueInPath={previousValueInPath}\n childProperty={childProperty as Property}\n propertyKey={key}/>\n }\n {element}\n </div>\n </div>\n );\n })}\n\n {(!changedFields || changedFields.length === 0) && (\n <Typography variant={\"caption\"} color={\"secondary\"} className=\"ml-4\">\n {entry.action === \"create\" ? \"Entity created\" :\n entry.action === \"delete\" ? \"Entity deleted\" : \"No field changes recorded\"}\n </Typography>\n )}\n\n </div>\n\n </div>\n </div>;\n}\n","\nimport type { EntityCustomViewParams } from \"@rebasepro/types\";\nimport { useRef, useEffect } from \"react\";\nimport { cls, IconButton, Label, Tooltip, Typography } from \"@rebasepro/ui\";\nimport { ErrorBoundary, HistoryIcon } from \"@rebasepro/ui\";\nimport { EntityHistoryEntry } from \"./EntityHistoryEntry\";\nimport { useSnackbarController, useAuthController } from \"@rebasepro/core\";\nimport { ConfirmationDialog } from \"@rebasepro/core\";\nimport { useState } from \"react\";\nimport { useEntityHistory } from \"../../index\";\n\n/**\n * Entity history tab view. Shows a paginated list of entity revisions\n * fetched from the backend API. Supports infinite scroll and revert.\n */\nexport function EntityHistoryView<M extends Record<string, unknown>>({\n entity,\n collection,\n formContext\n}: EntityCustomViewParams<M>) {\n\n const snackbarController = useSnackbarController();\n const authController = useAuthController();\n const dirty = formContext?.formex.dirty;\n\n const slug = collection.slug;\n const entityId = entity?.id;\n\n const {\n entries,\n isLoading,\n hasMore,\n loadMore,\n revert\n } = useEntityHistory({\n slug,\n entityId,\n enabled: !!entityId,\n pageSize: 10\n });\n\n const [revertHistoryId, setRevertHistoryId] = useState<string | undefined>();\n const [isReverting, setIsReverting] = useState(false);\n\n const containerRef = useRef<HTMLDivElement>(null);\n const loadMoreRef = useRef<HTMLDivElement>(null);\n\n // Intersection observer for infinite scroll\n useEffect(() => {\n const currentContainer = containerRef.current;\n const currentLoadMore = loadMoreRef.current;\n\n if (!currentContainer || !currentLoadMore || !hasMore || isLoading) return;\n\n const observer = new IntersectionObserver(\n (observerEntries) => {\n if (observerEntries[0].isIntersecting && hasMore && !isLoading) {\n loadMore();\n }\n },\n {\n root: currentContainer,\n rootMargin: \"0px 0px 200px 0px\",\n threshold: 0.01\n }\n );\n\n observer.observe(currentLoadMore);\n\n return () => observer.disconnect();\n }, [hasMore, isLoading, entries.length, loadMore]);\n\n if (!entity) {\n return <div className=\"flex items-center justify-center h-full\">\n <Label>HistoryIcon is only available for existing entities</Label>\n </div>;\n }\n\n async function doRevert(historyId: string) {\n setIsReverting(true);\n try {\n const revertedValues = await revert(historyId);\n setRevertHistoryId(undefined);\n\n // Reset the form with the reverted values so the UI updates\n // immediately without requiring a page refresh.\n if (formContext?.formex?.resetForm && revertedValues) {\n formContext.formex.resetForm({\n values: revertedValues as M,\n submitCount: 0,\n touched: {}\n });\n }\n\n snackbarController.open({\n message: \"Reverted to selected version\",\n type: \"info\"\n });\n } catch (error) {\n console.error(\"Error reverting entity:\", error);\n snackbarController.open({\n message: \"Error reverting entity\",\n type: \"error\"\n });\n } finally {\n setIsReverting(false);\n }\n }\n\n const revertEntry = revertHistoryId\n ? entries.find(e => e.id === revertHistoryId)\n : undefined;\n\n return <div\n ref={containerRef}\n className={cls(\"relative flex-1 h-full overflow-auto w-full flex flex-col gap-4 p-8\")}>\n <div className=\"flex flex-col gap-2 max-w-6xl mx-auto w-full\">\n\n <Typography variant={\"h5\"} className={\"mt-24 ml-4\"}>\n HistoryIcon\n </Typography>\n\n {isLoading && entries.length === 0 && (\n <div className=\"flex flex-col gap-4 mt-8 ml-4\">\n {[1, 2, 3].map(i => (\n <div key={i} className=\"flex flex-col gap-2 animate-pulse\">\n <div className=\"h-4 w-48 bg-surface-200 dark:bg-surface-700 rounded\"/>\n <div className=\"h-12 w-full bg-surface-100 dark:bg-surface-900 rounded-lg border border-surface-200 dark:border-surface-700\"/>\n </div>\n ))}\n </div>\n )}\n\n {!isLoading && entries.length === 0 && <>\n <Label className={\"ml-4 mt-8\"}>\n No history available\n </Label>\n <Typography variant={\"caption\"} className={\"ml-4\"}>\n When you save an entity, a new version is created and stored in the history.\n </Typography>\n </>}\n\n {entries.map((entry) => (\n <div key={entry.id} className=\"flex flex-cols gap-2 w-full\">\n <EntityHistoryEntry\n entry={entry}\n collection={collection}\n size={\"medium\"}\n actions={\n <Tooltip title={\"Revert to this version\"}\n className={\"m-2 grow-0 self-start\"}>\n <IconButton\n onClick={() => {\n if (dirty) {\n snackbarController.open({\n message: \"Please save or discard your changes before reverting\",\n type: \"warning\"\n });\n } else {\n setRevertHistoryId(entry.id);\n }\n }}>\n <HistoryIcon/>\n </IconButton>\n </Tooltip>\n }\n />\n </div>\n ))}\n\n {/* Load more sentinel */}\n {entries.length > 0 && (\n <div ref={loadMoreRef} className=\"py-4 text-center\">\n {isLoading && <Label>Loading more...</Label>}\n {!hasMore && entries.length > 10 && <Label>No more history available</Label>}\n </div>\n )}\n </div>\n\n <ErrorBoundary>\n <ConfirmationDialog\n open={Boolean(revertHistoryId)}\n onAccept={() => {\n if (revertHistoryId) doRevert(revertHistoryId);\n }}\n onCancel={() => setRevertHistoryId(undefined)}\n title={<Typography variant={\"subtitle2\"}>Revert data to this version?</Typography>}\n body={revertEntry\n ? <div className=\"p-4\">\n <Typography variant={\"caption\"} color={\"secondary\"}>\n This will save the entity with the values from{\" \"}\n {new Date(revertEntry.updated_at).toLocaleString()}.\n A new history entry will be created for the revert.\n </Typography>\n </div>\n : null\n }\n />\n </ErrorBoundary>\n </div>;\n}\n"],"names":["UserChip","t0","$","_c","user","t1","email","uid","t2","displayName","photoURL","t3","t4","t5","t6","deepEqual","a","b","Array","isArray","length","every","item","i","aObj","bObj","aKeys","Object","keys","bKeys","key","PreviousValueView","previousValueInPath","childProperty","propertyKey","Symbol","for","iconSize","smallest","t7","EntityHistoryEntry","actions","hover","collection","size","entry","authController","useAuthController","changedFields","changed_fields","previousValues","previous_values","T0","updatedBy","userDisplay","updated_at","updated_by","updatedOn","Date","currentUser","undefined","Typography","toLocaleString","action","t8","t9","t10","t11","t12","t13","cls","defaultBorderMixin","t14","values","map","getPropertyInPath","properties","valueInPath","getValueInPath","element","JSON","stringify","t15","t16","t17","t18","EntityHistoryView","entity","formContext","snackbarController","useSnackbarController","dirty","formex","slug","entityId","id","entries","isLoading","hasMore","loadMore","revert","useEntityHistory","enabled","pageSize","revertHistoryId","setRevertHistoryId","useState","isReverting","setIsReverting","containerRef","useRef","loadMoreRef","useEffect","currentContainer","current","currentLoadMore","observer","IntersectionObserver","observerEntries","isIntersecting","root","rootMargin","threshold","observe","disconnect","doRevert","historyId","revertedValues","resetForm","submitCount","touched","open","message","type","error","console","revertEntry","find","e","Boolean"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAGO,SAAAA,SAAAC,IAAA;AAAA,QAAAC,IAAAC,EAAA,EAAA;AAAkB,QAAA;AAAA,IAAAC;AAAAA,EAAAA,IAAAH;AAED,QAAAI,KAAAD,KAAIE,SAAUF,KAAIG;AAAI,MAAAC;AAAA,MAAAN,EAAA,CAAA,MAAAE,KAAAK,eAAAP,EAAA,CAAA,MAAAE,KAAAM,UAAA;AAE7BF,SAAAJ,KAAIM,YAAa,oBAAA,OAAA,EACH,WAAA,6BACN,KAAAN,KAAIM,UAAgB,KAAAN,KAAIK,eAAgB,gBAAc;AAAGP,MAAA,CAAA,IAAAE,KAAAK;AAAAP,MAAA,CAAA,IAAAE,KAAAM;AAAAR,WAAAM;AAAAA,EAAA,OAAA;AAAAA,SAAAN,EAAA,CAAA;AAAA,EAAA;AAC3D,QAAAS,KAAAP,KAAIK,eAAgBL,KAAIE,SAAUF,KAAIG;AAAI,MAAAK;AAAA,MAAAV,SAAAS,IAAA;AAAjDC,uCAAOD,UAAAA,GAAAA,CAA2C;AAAOT,WAAAS;AAAAT,WAAAU;AAAAA,EAAA,OAAA;AAAAA,SAAAV,EAAA,CAAA;AAAA,EAAA;AAAA,MAAAW;AAAA,MAAAX,EAAA,CAAA,MAAAM,MAAAN,SAAAU,IAAA;AAJ7DC,8BAA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MACA;AAAA,MAC9C,IAAI9E,KAAK8E,YAAYjF,UAAU,EAAEO,eAAAA;AAAAA,MAAiB;AAAA,IAAA,EAAA,CAEvD,EAAA,CACJ,IACE,KAAA,CACL,EAAA,CAET;AAAA,EAAA,GACJ;AACJ;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as ExportCollectionAction } from "./ExportCollectionAction-
|
|
2
|
-
import { B, d, a, b, g, c } from "./ExportCollectionAction-
|
|
1
|
+
import { E as ExportCollectionAction } from "./ExportCollectionAction-Ckc-09BQ.js";
|
|
2
|
+
import { B, d, a, b, g, c } from "./ExportCollectionAction-Ckc-09BQ.js";
|
|
3
3
|
export {
|
|
4
4
|
B as BasicExportAction,
|
|
5
5
|
ExportCollectionAction,
|
|
@@ -9,4 +9,4 @@ export {
|
|
|
9
9
|
g as getEntityCSVExportableData,
|
|
10
10
|
c as getEntityJsonExportableData
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=index-
|
|
12
|
+
//# sourceMappingURL=index-DY2k5TtG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DY2k5TtG.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { I as ImportCollectionAction } from "./ImportCollectionAction-
|
|
2
|
-
import { a, P } from "./ImportCollectionAction-
|
|
1
|
+
import { I as ImportCollectionAction } from "./ImportCollectionAction-BqjIrC3Z.js";
|
|
2
|
+
import { a, P } from "./ImportCollectionAction-BqjIrC3Z.js";
|
|
3
3
|
export {
|
|
4
4
|
ImportCollectionAction,
|
|
5
5
|
a as ImportDataPreview,
|
|
6
6
|
P as PropertySelectEntry
|
|
7
7
|
};
|
|
8
|
-
//# sourceMappingURL=index-
|
|
8
|
+
//# sourceMappingURL=index-UQOMHwt1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-UQOMHwt1.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export type { RebaseEditorProps, JSONContent, EditorAIController } from "./edito
|
|
|
3
3
|
export * from "./form";
|
|
4
4
|
export * from "./preview";
|
|
5
5
|
export * from "./routes";
|
|
6
|
-
export { EntityView, EntitySelectionTable, SelectableTable, SelectableTableContext, EntityCollectionView, EntityCollectionViewActions, EntityCollectionCardView, EntityCard, useSelectionController, PropertyConfigBadge, PropertyIdCopyTooltip, EntityCollectionTable, EntityCollectionRowActions, VirtualTableInput, ArrayContainer, type ArrayEntryParams, ReferenceWidget, SearchIconsView, FieldCaption, EntityPreview, getFieldConfig, getFieldId, getDefaultFieldConfig, getDefaultFieldId, DEFAULT_FIELD_CONFIGS, editEntityAction, copyEntityAction, deleteEntityAction, resetPasswordAction, SideEntityProvider, Scaffold, AppBar, Drawer, AdminModeSyncer, RebaseCMS, RebaseShell, RebaseAuthGate, RebaseNavigation, RebaseLayout, RebaseRouteDefs, SideDialogs, useApp } from "./components";
|
|
6
|
+
export { EntityView, EntitySelectionTable, SelectableTable, SelectableTableContext, EntityCollectionView, EntityCollectionViewActions, EntityCollectionCardView, EntityCard, useSelectionController, PropertyConfigBadge, PropertyIdCopyTooltip, EntityCollectionTable, EntityCollectionRowActions, VirtualTableInput, ArrayContainer, type ArrayEntryParams, ReferenceWidget, SearchIconsView, FieldCaption, EntityPreview, getFieldConfig, getFieldId, getDefaultFieldConfig, getDefaultFieldId, DEFAULT_FIELD_CONFIGS, editEntityAction, copyEntityAction, deleteEntityAction, resetPasswordAction, SideEntityProvider, Scaffold, AppBar, Drawer, DefaultDrawer, DrawerFooterActions, AdminModeSyncer, RebaseCMS, RebaseShell, RebaseAuthGate, RebaseNavigation, RebaseLayout, RebaseRouteDefs, SideDialogs, useApp } from "./components";
|
|
7
7
|
export type { EntityViewProps, EntitySelectionProps, SelectableTableProps } from "./components";
|
|
8
8
|
export * from "./hooks";
|
|
9
9
|
export { addInitialSlash, removeInitialSlash, removeTrailingSlash, removeInitialAndTrailingSlashes, getLastSegment, getCollectionBySlugWithin, getCollectionPathsCombinations, resolveCollectionPathIds, mergeEntityActions, resolveEntityAction, resolveEntityView, isReferenceProperty, isRelationProperty, getIconForWidget, getIconForProperty, getPropertyInPath, getResolvedPropertyInPath, getBracketNotation, getPropertiesWithPropertiesOrder, getDefaultPropertiesOrder, getEntityPreviewKeys, getEntityTitlePropertyKey } from "./util";
|