@rebasepro/admin 0.0.1-canary.eae7889 → 0.1.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/dist/{CollectionEditorDialog-B2M9lCyL.js → CollectionEditorDialog-MbvXGzEq.js} +42 -31
- package/dist/CollectionEditorDialog-MbvXGzEq.js.map +1 -0
- package/dist/{CollectionsStudioView-WG6soyfs.js → CollectionsStudioView-D9X6aiAr.js} +12 -12
- package/dist/CollectionsStudioView-D9X6aiAr.js.map +1 -0
- package/dist/{ContentHomePage-CDF_a6Lp.js → ContentHomePage-CfVB1eUo.js} +26 -26
- package/dist/ContentHomePage-CfVB1eUo.js.map +1 -0
- package/dist/{ExportCollectionAction-Dc0VOWMN.js → ExportCollectionAction-CUwJg4F9.js} +2 -2
- package/dist/{ExportCollectionAction-Dc0VOWMN.js.map → ExportCollectionAction-CUwJg4F9.js.map} +1 -1
- package/dist/{ImportCollectionAction-DpCagAOy.js → ImportCollectionAction-DGa_SF_8.js} +2 -2
- package/dist/{ImportCollectionAction-DpCagAOy.js.map → ImportCollectionAction-DGa_SF_8.js.map} +1 -1
- package/dist/{PropertyEditView-DS67DxoT.js → PropertyEditView-C4nlYmAc.js} +82 -104
- package/dist/PropertyEditView-C4nlYmAc.js.map +1 -0
- package/dist/{RolesView-CIuYBimF.js → RolesView-CNWxnR8e.js} +7 -5
- package/dist/RolesView-CNWxnR8e.js.map +1 -0
- package/dist/{UsersView-B5zelXnH.js → UsersView-YiTIcXkA.js} +14 -35
- package/dist/UsersView-YiTIcXkA.js.map +1 -0
- package/dist/collection_editor/ConfigControllerProvider.d.ts +0 -4
- package/dist/collection_editor/types/collection_editor_controller.d.ts +6 -3
- package/dist/collection_editor/types/config_controller.d.ts +14 -7
- package/dist/collection_editor/ui/AddKanbanColumnAction.d.ts +3 -2
- package/dist/collection_editor/ui/CollectionViewHeaderAction.d.ts +3 -2
- package/dist/collection_editor/ui/EditorCollectionAction.d.ts +1 -1
- package/dist/collection_editor/ui/EditorCollectionActionStart.d.ts +1 -1
- package/dist/collection_editor/ui/EditorEntityAction.d.ts +1 -1
- package/dist/collection_editor/ui/KanbanSetupAction.d.ts +3 -2
- package/dist/collection_editor/ui/PropertyAddColumnComponent.d.ts +3 -2
- package/dist/collection_editor/ui/collection_editor/CollectionDetailsForm.d.ts +3 -4
- package/dist/collection_editor/ui/collection_editor/CollectionEditorDialog.d.ts +2 -3
- package/dist/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +1 -2
- package/dist/collection_editor/ui/collection_editor/SubcollectionsEditTab.d.ts +3 -2
- package/dist/collection_editor_ui.js +3 -3
- package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +1 -1
- package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +1 -1
- package/dist/components/EntityCollectionTable/column_utils.d.ts +2 -2
- package/dist/components/EntityCollectionTable/fields/TableMultipleRelationField.d.ts +1 -1
- package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +1 -1
- package/dist/components/EntityCollectionTable/fields/TableRelationField.d.ts +1 -1
- package/dist/components/EntityCollectionTable/fields/TableRelationSelectorField.d.ts +2 -2
- package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +5 -1
- package/dist/components/EntityCollectionView/EntityCollectionBoardView.d.ts +3 -2
- package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +2 -1
- package/dist/components/EntityCollectionView/EntityCollectionViewActions.d.ts +4 -2
- package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +4 -2
- package/dist/components/EntityCollectionView/FiltersDialog.d.ts +2 -2
- package/dist/components/EntityCollectionView/SplitListView.d.ts +3 -2
- package/dist/components/EntityEditView.d.ts +9 -2
- package/dist/components/RebaseCMS.d.ts +1 -1
- package/dist/components/ReferenceTable/EntitySelectionTable.d.ts +2 -2
- package/dist/components/ReferenceWidget.d.ts +2 -2
- package/dist/components/RelationSelector.d.ts +1 -1
- package/dist/components/SelectableTable/SelectableTable.d.ts +2 -2
- package/dist/editor.js +2 -2
- package/dist/editor.js.map +1 -1
- package/dist/hooks/navigation/useNavigationRegistry.d.ts +2 -1
- package/dist/hooks/useEntityHistory.d.ts +1 -1
- package/dist/{index-CHxgwt6E.js → index-CtzpHzMQ.js} +11 -4
- package/dist/index-CtzpHzMQ.js.map +1 -0
- package/dist/{index-Dey5WJpO.js → index-DKlrVD1m.js} +3 -3
- package/dist/index-DKlrVD1m.js.map +1 -0
- package/dist/{index-CBhrgpR7.js → index-kHJXfLNI.js} +3 -3
- package/dist/index-kHJXfLNI.js.map +1 -0
- package/dist/index.js +79 -63
- package/dist/index.js.map +1 -1
- package/dist/{useEntityHistory-Dcj4zhGj.js → useEntityHistory-UVsSclfZ.js} +3 -1
- package/dist/useEntityHistory-UVsSclfZ.js.map +1 -0
- package/dist/util/navigation_utils.d.ts +10 -1
- package/dist/{util-BQ82ySL3.js → util-CwLmSpGp.js} +1653 -1257
- package/dist/util-CwLmSpGp.js.map +1 -0
- package/package.json +9 -17
- package/src/collection_editor/ConfigControllerProvider.tsx +19 -28
- package/src/collection_editor/types/collection_editor_controller.tsx +3 -3
- package/src/collection_editor/types/config_controller.tsx +7 -7
- package/src/collection_editor/ui/AddKanbanColumnAction.tsx +4 -4
- package/src/collection_editor/ui/CollectionViewHeaderAction.tsx +3 -3
- package/src/collection_editor/ui/EditorCollectionAction.tsx +3 -3
- package/src/collection_editor/ui/EditorCollectionActionStart.tsx +7 -7
- package/src/collection_editor/ui/EditorEntityAction.tsx +3 -3
- package/src/collection_editor/ui/HomePageEditorCollectionAction.tsx +4 -2
- package/src/collection_editor/ui/KanbanSetupAction.tsx +4 -3
- package/src/collection_editor/ui/MissingReferenceWidget.tsx +3 -2
- package/src/collection_editor/ui/NewCollectionButton.tsx +2 -1
- package/src/collection_editor/ui/NewCollectionCard.tsx +2 -1
- package/src/collection_editor/ui/PropertyAddColumnComponent.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/CollectionDetailsForm.tsx +5 -50
- package/src/collection_editor/ui/collection_editor/CollectionEditorDialog.tsx +12 -20
- package/src/collection_editor/ui/collection_editor/CollectionPropertiesEditorForm.tsx +1 -3
- package/src/collection_editor/ui/collection_editor/CollectionRLSTab.tsx +17 -2
- package/src/collection_editor/ui/collection_editor/CollectionRelationsTab.tsx +3 -3
- package/src/collection_editor/ui/collection_editor/CollectionStudioView.tsx +2 -1
- package/src/collection_editor/ui/collection_editor/CollectionsStudioView.tsx +18 -12
- package/src/collection_editor/ui/collection_editor/DisplaySettingsForm.tsx +1 -2
- package/src/collection_editor/ui/collection_editor/GetCodeDialog.tsx +1 -2
- package/src/collection_editor/ui/collection_editor/PropertyFieldPreview.tsx +6 -6
- package/src/collection_editor/ui/collection_editor/SubcollectionsEditTab.tsx +4 -4
- package/src/collection_editor/ui/collection_editor/properties/MapPropertyField.tsx +2 -2
- package/src/collection_editor/ui/collection_editor/properties/ReferencePropertyField.tsx +15 -49
- package/src/collection_editor/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +4 -5
- package/src/collection_editor/ui/collection_editor/templates/pages_template.ts +1 -1
- package/src/collection_editor/ui/collection_editor/templates/products_template.ts +2 -2
- package/src/components/DefaultAppBar.tsx +2 -2
- package/src/components/DefaultDrawer.tsx +25 -17
- package/src/components/DrawerNavigationGroup.tsx +4 -4
- package/src/components/DrawerNavigationItem.tsx +6 -6
- package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +4 -4
- package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +1 -1
- package/src/components/EntityCollectionTable/PropertyTableCell.tsx +4 -4
- package/src/components/EntityCollectionTable/column_utils.tsx +3 -3
- package/src/components/EntityCollectionTable/fields/TableMultipleRelationField.tsx +3 -3
- package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +3 -3
- package/src/components/EntityCollectionTable/fields/TableRelationField.tsx +4 -4
- package/src/components/EntityCollectionTable/fields/TableRelationSelectorField.tsx +3 -3
- package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +8 -2
- package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +1 -1
- package/src/components/EntityCollectionTable/internal/common.tsx +5 -5
- package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +1 -1
- package/src/components/EntityCollectionTable/table_bindings.tsx +45 -35
- package/src/components/EntityCollectionView/EntityBoardCard.tsx +18 -19
- package/src/components/EntityCollectionView/EntityCard.tsx +2 -2
- package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +42 -14
- package/src/components/EntityCollectionView/EntityCollectionCardView.tsx +4 -3
- package/src/components/EntityCollectionView/EntityCollectionListView.tsx +157 -54
- package/src/components/EntityCollectionView/EntityCollectionView.tsx +169 -75
- package/src/components/EntityCollectionView/EntityCollectionViewActions.tsx +23 -13
- package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +21 -12
- package/src/components/EntityCollectionView/FiltersDialog.tsx +7 -7
- package/src/components/EntityCollectionView/SplitListView.tsx +24 -8
- package/src/components/EntityCollectionView/useEntityPreviewSlots.ts +33 -5
- package/src/components/EntityEditView.tsx +85 -85
- package/src/components/EntitySidePanel.tsx +18 -10
- package/src/components/HomePage/ContentHomePage.tsx +24 -15
- package/src/components/HomePage/NavigationCard.tsx +4 -4
- package/src/components/HomePage/NavigationGroup.tsx +2 -2
- package/src/components/RebaseAuthGate.tsx +2 -0
- package/src/components/RebaseCMS.tsx +4 -3
- package/src/components/RebaseNavigation.tsx +8 -5
- package/src/components/ReferenceTable/EntitySelectionTable.tsx +4 -4
- package/src/components/ReferenceWidget.tsx +3 -3
- package/src/components/RelationSelector.tsx +33 -5
- package/src/components/SelectableTable/SelectableTable.tsx +6 -6
- package/src/components/UserSelector.tsx +1 -1
- package/src/components/admin/RolesView.tsx +10 -3
- package/src/components/admin/UsersView.tsx +13 -25
- package/src/components/app/Scaffold.tsx +4 -4
- package/src/components/field_configs.tsx +29 -32
- package/src/components/history/EntityHistoryView.tsx +12 -1
- package/src/editor/editor.tsx +2 -2
- package/src/form/EntityForm.tsx +5 -4
- package/src/form/PropertyFieldBinding.tsx +14 -10
- package/src/form/components/FieldHelperText.tsx +1 -1
- package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +3 -3
- package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +5 -5
- package/src/form/field_bindings/BlockFieldBinding.tsx +4 -4
- package/src/form/field_bindings/DateTimeFieldBinding.tsx +1 -1
- package/src/form/field_bindings/KeyValueFieldBinding.tsx +1 -1
- package/src/form/field_bindings/MapFieldBinding.tsx +7 -7
- package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +1 -1
- package/src/form/field_bindings/MultipleRelationFieldBinding.tsx +3 -3
- package/src/form/field_bindings/ReferenceAsStringFieldBinding.tsx +7 -7
- package/src/form/field_bindings/ReferenceFieldBinding.tsx +2 -2
- package/src/form/field_bindings/RelationFieldBinding.tsx +4 -4
- package/src/form/field_bindings/RepeatFieldBinding.tsx +5 -5
- package/src/form/field_bindings/SelectFieldBinding.tsx +1 -1
- package/src/form/field_bindings/StorageUploadFieldBinding.tsx +1 -1
- package/src/form/field_bindings/SwitchFieldBinding.tsx +1 -1
- package/src/form/field_bindings/TextFieldBinding.tsx +7 -7
- package/src/form/field_bindings/UserSelectFieldBinding.tsx +1 -1
- package/src/form/useClearRestoreValue.tsx +1 -1
- package/src/form/validation.ts +1 -1
- package/src/hooks/navigation/contexts/CollectionRegistryContext.tsx +2 -1
- package/src/hooks/navigation/useBuildCollectionRegistryController.tsx +15 -3
- package/src/hooks/navigation/useNavigationRegistry.ts +14 -3
- package/src/hooks/navigation/useResolvedViews.tsx +1 -3
- package/src/hooks/navigation/useTopLevelNavigation.ts +1 -1
- package/src/hooks/navigation/utils.ts +1 -1
- package/src/hooks/useEntityHistory.ts +7 -2
- package/src/preview/PropertyPreview.tsx +27 -23
- package/src/preview/components/StorageThumbnail.tsx +4 -1
- package/src/preview/property_previews/ArrayOfMapsPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +1 -1
- package/src/preview/property_previews/ArrayOfRelationsPreview.tsx +1 -1
- package/src/preview/property_previews/SkeletonPropertyComponent.tsx +3 -3
- package/src/preview/property_previews/StringPropertyPreview.tsx +3 -3
- package/src/routes/RebaseRoute.tsx +57 -11
- package/src/util/navigation_utils.ts +21 -2
- package/src/util/previews.ts +15 -6
- package/src/util/property_utils.tsx +3 -3
- package/dist/CollectionEditorDialog-B2M9lCyL.js.map +0 -1
- package/dist/CollectionsStudioView-WG6soyfs.js.map +0 -1
- package/dist/ContentHomePage-CDF_a6Lp.js.map +0 -1
- package/dist/PropertyEditView-DS67DxoT.js.map +0 -1
- package/dist/RolesView-CIuYBimF.js.map +0 -1
- package/dist/UsersView-B5zelXnH.js.map +0 -1
- package/dist/index-CBhrgpR7.js.map +0 -1
- package/dist/index-CHxgwt6E.js.map +0 -1
- package/dist/index-Dey5WJpO.js.map +0 -1
- package/dist/useEntityHistory-Dcj4zhGj.js.map +0 -1
- package/dist/util-BQ82ySL3.js.map +0 -1
|
@@ -6,6 +6,7 @@ export declare function useNavigationRegistry(userConfigPersistence?: UserConfig
|
|
|
6
6
|
getCollection: (slugOrPath: string, includeUserOverride?: boolean) => EntityCollection | undefined;
|
|
7
7
|
getRawCollection: (slugOrPath: string) => EntityCollection | undefined;
|
|
8
8
|
getParentReferencesFromPath: (path: string) => EntityReference[];
|
|
9
|
-
|
|
9
|
+
getParentCollectionSlugs: (path: string) => string[];
|
|
10
|
+
getParentEntityIds: (path: string) => string[];
|
|
10
11
|
convertIdsToPaths: (ids: string[]) => string[];
|
|
11
12
|
};
|
|
@@ -16,7 +16,7 @@ export interface UseEntityHistoryResult {
|
|
|
16
16
|
hasMore: boolean;
|
|
17
17
|
error?: Error;
|
|
18
18
|
loadMore: () => void;
|
|
19
|
-
revert: (historyId: string) => Promise<
|
|
19
|
+
revert: (historyId: string) => Promise<Record<string, unknown>>;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Hook to fetch entity history from the backend REST API.
|
|
@@ -3,7 +3,7 @@ import { useState, useRef, useEffect } from "react";
|
|
|
3
3
|
import { Chip, Tooltip, cls, defaultBorderMixin, Typography, iconSize, Label, IconButton, ErrorBoundary } from "@rebasepro/ui";
|
|
4
4
|
import { ArrowLeftIcon, HistoryIcon } from "lucide-react";
|
|
5
5
|
import { c } from "react-compiler-runtime";
|
|
6
|
-
import { c as getPropertyInPath, l as PropertyPreview } from "./util-
|
|
6
|
+
import { c as getPropertyInPath, l as PropertyPreview } from "./util-CwLmSpGp.js";
|
|
7
7
|
import { useAuthController, useSnackbarController, ConfirmationDialog } from "@rebasepro/core";
|
|
8
8
|
import { getValueInPath } from "@rebasepro/utils";
|
|
9
9
|
import "fast-equals";
|
|
@@ -19,7 +19,7 @@ import "@dnd-kit/sortable";
|
|
|
19
19
|
import "@dnd-kit/utilities";
|
|
20
20
|
import "react-dropzone";
|
|
21
21
|
import "react-router-dom";
|
|
22
|
-
import { u as useEntityHistory } from "./useEntityHistory-
|
|
22
|
+
import { u as useEntityHistory } from "./useEntityHistory-UVsSclfZ.js";
|
|
23
23
|
import "react-router";
|
|
24
24
|
import "xlsx";
|
|
25
25
|
import "@rebasepro/schema-inference";
|
|
@@ -395,8 +395,15 @@ function EntityHistoryView({
|
|
|
395
395
|
async function doRevert(historyId) {
|
|
396
396
|
setIsReverting(true);
|
|
397
397
|
try {
|
|
398
|
-
await revert(historyId);
|
|
398
|
+
const revertedValues = await revert(historyId);
|
|
399
399
|
setRevertHistoryId(void 0);
|
|
400
|
+
if (formContext?.formex?.resetForm && revertedValues) {
|
|
401
|
+
formContext.formex.resetForm({
|
|
402
|
+
values: revertedValues,
|
|
403
|
+
submitCount: 0,
|
|
404
|
+
touched: {}
|
|
405
|
+
});
|
|
406
|
+
}
|
|
400
407
|
snackbarController.open({
|
|
401
408
|
message: "Reverted to selected version",
|
|
402
409
|
type: "info"
|
|
@@ -453,4 +460,4 @@ export {
|
|
|
453
460
|
EntityHistoryView,
|
|
454
461
|
UserChip
|
|
455
462
|
};
|
|
456
|
-
//# sourceMappingURL=index-
|
|
463
|
+
//# sourceMappingURL=index-CtzpHzMQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CtzpHzMQ.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 { Chip, cls, defaultBorderMixin, Tooltip, Typography , iconSize } from \"@rebasepro/ui\";\nimport { ArrowLeftIcon } from \"lucide-react\";\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 { HistoryIcon } from \"lucide-react\";\nimport { EntityHistoryEntry } from \"./EntityHistoryEntry\";\nimport { useSnackbarController, useAuthController } from \"@rebasepro/core\";\nimport { ConfirmationDialog } from \"@rebasepro/core\";\nimport { ErrorBoundary } from \"@rebasepro/ui\";\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,8BAAC,MAAA,EAAW,MAAA,SAAoB,WAAA,qBAC3BL,UAAAA;AAAAA,MAAAA;AAAAA,MAGDI;AAAAA,IAAAA,GACJ;AAAOV,WAAAM;AAAAN,WAAAU;AAAAV,WAAAW;AAAAA,EAAA,OAAA;AAAAA,SAAAX,E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-1,8 +1,8 @@
|
|
|
1
|
-
import { I as ImportCollectionAction } from "./ImportCollectionAction-
|
|
2
|
-
import { a, P } from "./ImportCollectionAction-
|
|
1
|
+
import { I as ImportCollectionAction } from "./ImportCollectionAction-DGa_SF_8.js";
|
|
2
|
+
import { a, P } from "./ImportCollectionAction-DGa_SF_8.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-DKlrVD1m.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DKlrVD1m.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -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-CUwJg4F9.js";
|
|
2
|
+
import { B, d, a, b, g, c } from "./ExportCollectionAction-CUwJg4F9.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-kHJXfLNI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-kHJXfLNI.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as useCMSContext, e as useCollectionRegistryController, n as useEntitySelectionDialog, R as ReferencePreview, j as useUrlController, o as Drawer, A as AppBar, S as SideDialogs, p as Scaffold, q as RebaseNavigation, r as RebaseRouteDefs, l as PropertyPreview, s as useCollectionEditorController } from "./util-
|
|
2
|
-
import { t, v, w, x, y, z, B, C, F, G, H, J, K, L, M, N, O, D, Q, T, U, V, W, X, E, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, I, a8, b, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, P, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, h, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, d, aW, aX, aY, aZ, a_, a, g, c, a$, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, i, bf, bg, bh, bi, bj, bk, u, bl, m, bm, bn, f, bo, bp, bq, br, bs } from "./util-
|
|
1
|
+
import { k as useCMSContext, e as useCollectionRegistryController, n as useEntitySelectionDialog, R as ReferencePreview, j as useUrlController, o as Drawer, A as AppBar, S as SideDialogs, p as Scaffold, q as RebaseNavigation, r as RebaseRouteDefs, l as PropertyPreview, s as useCollectionEditorController } from "./util-CwLmSpGp.js";
|
|
2
|
+
import { t, v, w, x, y, z, B, C, F, G, H, J, K, L, M, N, O, D, Q, T, U, V, W, X, E, Y, Z, _, $, a0, a1, a2, a3, a4, a5, a6, a7, I, a8, b, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, P, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, h, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, d, aW, aX, aY, aZ, a_, a, g, c, a$, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, i, bf, bg, bh, bi, bj, bk, u, bl, m, bm, bn, f, bo, bp, bq, br, bs } from "./util-CwLmSpGp.js";
|
|
3
3
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
4
4
|
import { c as c2 } from "react-compiler-runtime";
|
|
5
5
|
import { Button, cls, CircularProgressCenter, ErrorBoundary } from "@rebasepro/ui";
|
|
@@ -24,9 +24,9 @@ import "react-router";
|
|
|
24
24
|
import { useLocation, Outlet } from "react-router-dom";
|
|
25
25
|
import "xlsx";
|
|
26
26
|
import "@rebasepro/schema-inference";
|
|
27
|
-
import { u as u2 } from "./useEntityHistory-
|
|
28
|
-
import { I as I2, a as a10, P as P2 } from "./ImportCollectionAction-
|
|
29
|
-
import { B as B2, E as E2, d as d2, a as a11, b as b10, g as g2, c as c3 } from "./ExportCollectionAction-
|
|
27
|
+
import { u as u2 } from "./useEntityHistory-UVsSclfZ.js";
|
|
28
|
+
import { I as I2, a as a10, P as P2 } from "./ImportCollectionAction-DGa_SF_8.js";
|
|
29
|
+
import { B as B2, E as E2, d as d2, a as a11, b as b10, g as g2, c as c3 } from "./ExportCollectionAction-CUwJg4F9.js";
|
|
30
30
|
function resolveNavigationFrom({
|
|
31
31
|
path,
|
|
32
32
|
context
|
|
@@ -151,7 +151,7 @@ function ReferenceWidget({
|
|
|
151
151
|
onReferenceSelected,
|
|
152
152
|
onMultipleReferenceSelected,
|
|
153
153
|
previewProperties,
|
|
154
|
-
|
|
154
|
+
fixedFilter,
|
|
155
155
|
size,
|
|
156
156
|
className,
|
|
157
157
|
includeId,
|
|
@@ -187,7 +187,7 @@ function ReferenceWidget({
|
|
|
187
187
|
collection,
|
|
188
188
|
onSingleEntitySelected,
|
|
189
189
|
onMultipleEntitiesSelected,
|
|
190
|
-
|
|
190
|
+
fixedFilter
|
|
191
191
|
});
|
|
192
192
|
useCallback((e_0) => {
|
|
193
193
|
e_0.stopPropagation();
|
|
@@ -244,19 +244,20 @@ function AdminModeSyncer({
|
|
|
244
244
|
return null;
|
|
245
245
|
}
|
|
246
246
|
function RebaseCMS(t0) {
|
|
247
|
-
const $2 = c2(
|
|
247
|
+
const $2 = c2(10);
|
|
248
248
|
const {
|
|
249
249
|
collections,
|
|
250
250
|
homePage,
|
|
251
251
|
entityViews,
|
|
252
252
|
entityActions,
|
|
253
253
|
plugins,
|
|
254
|
-
collectionEditor
|
|
254
|
+
collectionEditor,
|
|
255
|
+
navigationGroupMappings
|
|
255
256
|
} = t0;
|
|
256
257
|
const dispatch = useRebaseRegistryDispatch();
|
|
257
258
|
let t1;
|
|
258
259
|
let t2;
|
|
259
|
-
if ($2[0] !== collectionEditor || $2[1] !== collections || $2[2] !== dispatch || $2[3] !== entityActions || $2[4] !== entityViews || $2[5] !== homePage || $2[6] !== plugins) {
|
|
260
|
+
if ($2[0] !== collectionEditor || $2[1] !== collections || $2[2] !== dispatch || $2[3] !== entityActions || $2[4] !== entityViews || $2[5] !== homePage || $2[6] !== navigationGroupMappings || $2[7] !== plugins) {
|
|
260
261
|
t1 = () => {
|
|
261
262
|
dispatch.registerCMS({
|
|
262
263
|
collections,
|
|
@@ -264,23 +265,25 @@ function RebaseCMS(t0) {
|
|
|
264
265
|
entityViews,
|
|
265
266
|
entityActions,
|
|
266
267
|
plugins,
|
|
267
|
-
collectionEditor
|
|
268
|
+
collectionEditor,
|
|
269
|
+
navigationGroupMappings
|
|
268
270
|
});
|
|
269
271
|
return () => dispatch.unregisterCMS();
|
|
270
272
|
};
|
|
271
|
-
t2 = [dispatch, collections, homePage, entityViews, entityActions, plugins, collectionEditor];
|
|
273
|
+
t2 = [dispatch, collections, homePage, entityViews, entityActions, plugins, collectionEditor, navigationGroupMappings];
|
|
272
274
|
$2[0] = collectionEditor;
|
|
273
275
|
$2[1] = collections;
|
|
274
276
|
$2[2] = dispatch;
|
|
275
277
|
$2[3] = entityActions;
|
|
276
278
|
$2[4] = entityViews;
|
|
277
279
|
$2[5] = homePage;
|
|
278
|
-
$2[6] =
|
|
279
|
-
$2[7] =
|
|
280
|
-
$2[8] =
|
|
280
|
+
$2[6] = navigationGroupMappings;
|
|
281
|
+
$2[7] = plugins;
|
|
282
|
+
$2[8] = t1;
|
|
283
|
+
$2[9] = t2;
|
|
281
284
|
} else {
|
|
282
|
-
t1 = $2[
|
|
283
|
-
t2 = $2[
|
|
285
|
+
t1 = $2[8];
|
|
286
|
+
t2 = $2[9];
|
|
284
287
|
}
|
|
285
288
|
useLayoutEffect(t1, t2);
|
|
286
289
|
return null;
|
|
@@ -292,6 +295,7 @@ function RebaseAuthGate(t0) {
|
|
|
292
295
|
} = t0;
|
|
293
296
|
const registry = useRebaseRegistry();
|
|
294
297
|
const authController = useAuthController();
|
|
298
|
+
console.log("[AuthGate] initialLoading:", authController?.initialLoading, "user:", authController?.user?.email ?? null);
|
|
295
299
|
if (authController?.initialLoading) {
|
|
296
300
|
let t12;
|
|
297
301
|
if ($2[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
@@ -485,7 +489,7 @@ function ArrayOfMapsPreview(t0) {
|
|
|
485
489
|
throw Error(`You need to specify a 'properties' prop (or specify a custom field) in your map property ${propertyKey}`);
|
|
486
490
|
}
|
|
487
491
|
const values = value;
|
|
488
|
-
const previewProperties = mapProperty.previewProperties;
|
|
492
|
+
const previewProperties = mapProperty.ui?.previewProperties;
|
|
489
493
|
if (!values) {
|
|
490
494
|
t3 = null;
|
|
491
495
|
break bb0;
|
|
@@ -533,7 +537,7 @@ function ArrayOfMapsPreview(t0) {
|
|
|
533
537
|
return t5;
|
|
534
538
|
}
|
|
535
539
|
function MissingReferenceWidget(t0) {
|
|
536
|
-
const $2 = c2(
|
|
540
|
+
const $2 = c2(22);
|
|
537
541
|
const {
|
|
538
542
|
path: pathProp
|
|
539
543
|
} = t0;
|
|
@@ -541,82 +545,94 @@ function MissingReferenceWidget(t0) {
|
|
|
541
545
|
const path = getLastSegment(pathProp);
|
|
542
546
|
let t1;
|
|
543
547
|
if ($2[0] !== pathProp || $2[1] !== registry) {
|
|
544
|
-
t1 = registry.
|
|
548
|
+
t1 = registry.getParentCollectionSlugs(pathProp);
|
|
545
549
|
$2[0] = pathProp;
|
|
546
550
|
$2[1] = registry;
|
|
547
551
|
$2[2] = t1;
|
|
548
552
|
} else {
|
|
549
553
|
t1 = $2[2];
|
|
550
554
|
}
|
|
551
|
-
const
|
|
555
|
+
const parentCollectionSlugs = t1;
|
|
556
|
+
let t2;
|
|
557
|
+
if ($2[3] !== pathProp || $2[4] !== registry) {
|
|
558
|
+
t2 = registry.getParentEntityIds(pathProp);
|
|
559
|
+
$2[3] = pathProp;
|
|
560
|
+
$2[4] = registry;
|
|
561
|
+
$2[5] = t2;
|
|
562
|
+
} else {
|
|
563
|
+
t2 = $2[5];
|
|
564
|
+
}
|
|
565
|
+
const parentEntityIds = t2;
|
|
552
566
|
const collectionEditor = useCollectionEditorController();
|
|
553
567
|
const {
|
|
554
|
-
t:
|
|
568
|
+
t: t3
|
|
555
569
|
} = useTranslation();
|
|
556
|
-
const
|
|
570
|
+
const t32 = "p-1 flex flex-col items-center";
|
|
557
571
|
const T0 = ErrorView;
|
|
558
|
-
const
|
|
572
|
+
const t4 = t3("studio_missing_reference_error", {
|
|
559
573
|
path
|
|
560
574
|
});
|
|
561
|
-
let
|
|
562
|
-
if ($2[
|
|
563
|
-
|
|
564
|
-
$2[
|
|
565
|
-
$2[
|
|
566
|
-
$2[
|
|
575
|
+
let t5;
|
|
576
|
+
if ($2[6] !== T0 || $2[7] !== t4) {
|
|
577
|
+
t5 = /* @__PURE__ */ jsx(T0, { error: t4 });
|
|
578
|
+
$2[6] = T0;
|
|
579
|
+
$2[7] = t4;
|
|
580
|
+
$2[8] = t5;
|
|
567
581
|
} else {
|
|
568
|
-
|
|
582
|
+
t5 = $2[8];
|
|
569
583
|
}
|
|
570
|
-
let
|
|
571
|
-
if ($2[
|
|
572
|
-
|
|
584
|
+
let t6;
|
|
585
|
+
if ($2[9] !== collectionEditor || $2[10] !== parentCollectionSlugs || $2[11] !== parentEntityIds || $2[12] !== path) {
|
|
586
|
+
t6 = () => {
|
|
573
587
|
collectionEditor.createCollection({
|
|
574
588
|
initialValues: {
|
|
575
589
|
path,
|
|
576
590
|
name: prettifyIdentifier(path)
|
|
577
591
|
},
|
|
578
|
-
|
|
592
|
+
parentCollectionSlugs,
|
|
593
|
+
parentEntityIds,
|
|
579
594
|
redirect: false,
|
|
580
595
|
sourceClick: "missing_reference"
|
|
581
596
|
});
|
|
582
597
|
};
|
|
583
|
-
$2[
|
|
584
|
-
$2[
|
|
585
|
-
$2[
|
|
586
|
-
$2[
|
|
587
|
-
|
|
588
|
-
t5 = $2[9];
|
|
589
|
-
}
|
|
590
|
-
let t6;
|
|
591
|
-
if ($2[10] !== t2) {
|
|
592
|
-
t6 = t2("studio_missing_reference_create");
|
|
593
|
-
$2[10] = t2;
|
|
594
|
-
$2[11] = t6;
|
|
598
|
+
$2[9] = collectionEditor;
|
|
599
|
+
$2[10] = parentCollectionSlugs;
|
|
600
|
+
$2[11] = parentEntityIds;
|
|
601
|
+
$2[12] = path;
|
|
602
|
+
$2[13] = t6;
|
|
595
603
|
} else {
|
|
596
|
-
t6 = $2[
|
|
604
|
+
t6 = $2[13];
|
|
597
605
|
}
|
|
598
606
|
let t7;
|
|
599
|
-
if ($2[
|
|
600
|
-
t7 =
|
|
601
|
-
$2[
|
|
602
|
-
$2[
|
|
603
|
-
$2[14] = t7;
|
|
607
|
+
if ($2[14] !== t3) {
|
|
608
|
+
t7 = t3("studio_missing_reference_create");
|
|
609
|
+
$2[14] = t3;
|
|
610
|
+
$2[15] = t7;
|
|
604
611
|
} else {
|
|
605
|
-
t7 = $2[
|
|
612
|
+
t7 = $2[15];
|
|
606
613
|
}
|
|
607
614
|
let t8;
|
|
608
|
-
if ($2[
|
|
609
|
-
t8 = /* @__PURE__ */
|
|
610
|
-
|
|
611
|
-
|
|
615
|
+
if ($2[16] !== t6 || $2[17] !== t7) {
|
|
616
|
+
t8 = /* @__PURE__ */ jsx(Button, { className: "mx-2", size: "small", onClick: t6, children: t7 });
|
|
617
|
+
$2[16] = t6;
|
|
618
|
+
$2[17] = t7;
|
|
619
|
+
$2[18] = t8;
|
|
620
|
+
} else {
|
|
621
|
+
t8 = $2[18];
|
|
622
|
+
}
|
|
623
|
+
let t9;
|
|
624
|
+
if ($2[19] !== t5 || $2[20] !== t8) {
|
|
625
|
+
t9 = /* @__PURE__ */ jsxs("div", { className: t32, children: [
|
|
626
|
+
t5,
|
|
627
|
+
t8
|
|
612
628
|
] });
|
|
613
|
-
$2[
|
|
614
|
-
$2[
|
|
615
|
-
$2[
|
|
629
|
+
$2[19] = t5;
|
|
630
|
+
$2[20] = t8;
|
|
631
|
+
$2[21] = t9;
|
|
616
632
|
} else {
|
|
617
|
-
|
|
633
|
+
t9 = $2[21];
|
|
618
634
|
}
|
|
619
|
-
return
|
|
635
|
+
return t9;
|
|
620
636
|
}
|
|
621
637
|
export {
|
|
622
638
|
AdminModeSyncer,
|