@firecms/core 3.0.0-canary.12 → 3.0.0-canary.121

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.
Files changed (286) hide show
  1. package/README.md +1 -1
  2. package/dist/app/AppBar.d.ts +12 -0
  3. package/dist/app/Drawer.d.ts +17 -0
  4. package/dist/app/Scaffold.d.ts +30 -0
  5. package/dist/app/index.d.ts +4 -0
  6. package/dist/app/useApp.d.ts +16 -0
  7. package/dist/components/ArrayContainer.d.ts +2 -1
  8. package/dist/components/CircularProgressCenter.d.ts +1 -1
  9. package/dist/components/ClearFilterSortButton.d.ts +5 -0
  10. package/dist/components/EntityCollectionTable/EntityCollectionRowActions.d.ts +11 -12
  11. package/dist/components/EntityCollectionTable/EntityCollectionTable.d.ts +1 -1
  12. package/dist/components/EntityCollectionTable/EntityCollectionTableProps.d.ts +5 -3
  13. package/dist/components/EntityCollectionTable/PropertyTableCell.d.ts +1 -0
  14. package/dist/components/EntityCollectionTable/column_utils.d.ts +1 -2
  15. package/dist/components/EntityCollectionTable/fields/TableReferenceField.d.ts +3 -1
  16. package/dist/components/EntityCollectionTable/internal/CollectionTableToolbar.d.ts +1 -4
  17. package/dist/components/EntityCollectionTable/internal/EntityTableCell.d.ts +2 -2
  18. package/dist/components/EntityCollectionTable/internal/popup_field/PopupFormField.d.ts +2 -2
  19. package/dist/components/EntityCollectionView/EntityCollectionView.d.ts +12 -2
  20. package/dist/components/EntityCollectionView/EntityCollectionViewStartActions.d.ts +11 -0
  21. package/dist/components/EntityPreview.d.ts +6 -5
  22. package/dist/components/ErrorView.d.ts +1 -1
  23. package/dist/components/HomePage/DefaultHomePage.d.ts +1 -1
  24. package/dist/components/HomePage/NavigationCardBinding.d.ts +1 -1
  25. package/dist/components/PropertyIdCopyTooltip.d.ts +8 -0
  26. package/dist/components/ReferenceWidget.d.ts +3 -1
  27. package/dist/components/SelectableTable/SelectableTable.d.ts +1 -1
  28. package/dist/components/SelectableTable/filters/ReferenceFilterField.d.ts +2 -1
  29. package/dist/components/VirtualTable/VirtualTableProps.d.ts +15 -12
  30. package/dist/components/VirtualTable/types.d.ts +3 -3
  31. package/dist/components/{EntityCollectionTable/internal → common}/default_entity_actions.d.ts +1 -1
  32. package/dist/components/common/index.d.ts +1 -0
  33. package/dist/components/common/table_height.d.ts +5 -0
  34. package/dist/components/common/types.d.ts +4 -6
  35. package/dist/components/common/useColumnsIds.d.ts +2 -1
  36. package/dist/components/common/useDataSourceEntityCollectionTableController.d.ts +3 -0
  37. package/dist/components/index.d.ts +3 -1
  38. package/dist/{components/FireCMSAppBar.d.ts → core/DefaultAppBar.d.ts} +6 -9
  39. package/dist/core/DefaultDrawer.d.ts +19 -0
  40. package/dist/core/DrawerNavigationItem.d.ts +10 -0
  41. package/dist/core/EntityEditView.d.ts +18 -4
  42. package/dist/core/FireCMS.d.ts +1 -1
  43. package/dist/core/NavigationRoutes.d.ts +3 -3
  44. package/dist/core/index.d.ts +3 -4
  45. package/dist/form/PropertyFieldBinding.d.ts +1 -1
  46. package/dist/form/components/ErrorFocus.d.ts +1 -1
  47. package/dist/form/components/FieldHelperText.d.ts +3 -3
  48. package/dist/form/components/FormikArrayContainer.d.ts +2 -1
  49. package/dist/form/components/LabelWithIcon.d.ts +1 -1
  50. package/dist/form/components/LabelWithIconAndTooltip.d.ts +15 -0
  51. package/dist/form/components/StorageItemPreview.d.ts +4 -4
  52. package/dist/form/components/index.d.ts +1 -0
  53. package/dist/form/field_bindings/ArrayCustomShapedFieldBinding.d.ts +1 -1
  54. package/dist/form/field_bindings/ArrayOfReferencesFieldBinding.d.ts +1 -1
  55. package/dist/form/field_bindings/BlockFieldBinding.d.ts +1 -1
  56. package/dist/form/field_bindings/KeyValueFieldBinding.d.ts +1 -1
  57. package/dist/form/field_bindings/MapFieldBinding.d.ts +1 -1
  58. package/dist/form/field_bindings/MarkdownEditorFieldBinding.d.ts +11 -0
  59. package/dist/form/field_bindings/{MultiSelectBinding.d.ts → MultiSelectFieldBinding.d.ts} +1 -1
  60. package/dist/form/field_bindings/ReadOnlyFieldBinding.d.ts +1 -1
  61. package/dist/form/field_bindings/RepeatFieldBinding.d.ts +1 -1
  62. package/dist/form/field_bindings/SelectFieldBinding.d.ts +1 -1
  63. package/dist/form/field_bindings/StorageUploadFieldBinding.d.ts +3 -5
  64. package/dist/form/field_bindings/TextFieldBinding.d.ts +1 -1
  65. package/dist/form/index.d.ts +3 -5
  66. package/dist/form/useClearRestoreValue.d.ts +2 -2
  67. package/dist/hooks/data/save.d.ts +1 -2
  68. package/dist/hooks/index.d.ts +1 -0
  69. package/dist/hooks/useBuildNavigationController.d.ts +1 -2
  70. package/dist/hooks/useProjectLog.d.ts +2 -2
  71. package/dist/hooks/useValidateAuthenticator.d.ts +4 -8
  72. package/dist/index.d.ts +1 -0
  73. package/dist/index.es.js +15748 -12448
  74. package/dist/index.es.js.map +1 -1
  75. package/dist/index.umd.js +19981 -587
  76. package/dist/index.umd.js.map +1 -1
  77. package/dist/internal/useBuildDataSource.d.ts +1 -16
  78. package/dist/preview/PropertyPreviewProps.d.ts +6 -1
  79. package/dist/preview/components/EnumValuesChip.d.ts +1 -1
  80. package/dist/preview/components/ReferencePreview.d.ts +3 -2
  81. package/dist/preview/components/StorageThumbnail.d.ts +2 -1
  82. package/dist/preview/components/UrlComponentPreview.d.ts +2 -1
  83. package/dist/types/auth.d.ts +3 -3
  84. package/dist/types/collections.d.ts +39 -5
  85. package/dist/types/datasource.d.ts +55 -35
  86. package/dist/types/entities.d.ts +6 -1
  87. package/dist/types/entity_actions.d.ts +14 -0
  88. package/dist/types/entity_overrides.d.ts +2 -2
  89. package/dist/types/fields.d.ts +47 -41
  90. package/dist/types/index.d.ts +0 -1
  91. package/dist/types/navigation.d.ts +6 -5
  92. package/dist/types/plugins.d.ts +14 -4
  93. package/dist/types/properties.d.ts +34 -21
  94. package/dist/types/side_dialogs_controller.d.ts +10 -0
  95. package/dist/types/storage.d.ts +86 -3
  96. package/dist/util/entities.d.ts +2 -2
  97. package/dist/util/icon_list.d.ts +5 -1
  98. package/dist/util/icon_synonyms.d.ts +1 -97
  99. package/dist/util/icons.d.ts +3 -2
  100. package/dist/util/index.d.ts +1 -0
  101. package/dist/util/navigation_utils.d.ts +2 -2
  102. package/dist/util/objects.d.ts +1 -1
  103. package/dist/util/plurals.d.ts +0 -2
  104. package/dist/util/property_utils.d.ts +1 -1
  105. package/dist/util/resolutions.d.ts +27 -13
  106. package/dist/util/storage.d.ts +23 -2
  107. package/dist/util/useStorageUploadController.d.ts +3 -3
  108. package/package.json +128 -119
  109. package/src/app/AppBar.tsx +18 -0
  110. package/src/app/Drawer.tsx +25 -0
  111. package/src/app/Scaffold.tsx +245 -0
  112. package/src/app/index.ts +4 -0
  113. package/src/app/useApp.tsx +32 -0
  114. package/src/components/ArrayContainer.tsx +15 -10
  115. package/src/components/CircularProgressCenter.tsx +1 -1
  116. package/src/components/ClearFilterSortButton.tsx +41 -0
  117. package/src/components/EntityCollectionTable/EntityCollectionRowActions.tsx +12 -19
  118. package/src/components/EntityCollectionTable/EntityCollectionTable.tsx +21 -20
  119. package/src/components/EntityCollectionTable/EntityCollectionTableProps.tsx +10 -6
  120. package/src/components/EntityCollectionTable/PropertyTableCell.tsx +41 -35
  121. package/src/components/EntityCollectionTable/column_utils.tsx +3 -3
  122. package/src/components/EntityCollectionTable/fields/TableReferenceField.tsx +32 -17
  123. package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +14 -6
  124. package/src/components/EntityCollectionTable/internal/CollectionTableToolbar.tsx +29 -34
  125. package/src/components/EntityCollectionTable/internal/EntityTableCell.tsx +32 -30
  126. package/src/components/EntityCollectionTable/internal/EntityTableCellActions.tsx +19 -7
  127. package/src/components/EntityCollectionTable/internal/popup_field/PopupFormField.tsx +7 -10
  128. package/src/components/EntityCollectionView/EntityCollectionView.tsx +75 -51
  129. package/src/components/EntityCollectionView/EntityCollectionViewStartActions.tsx +68 -0
  130. package/src/components/EntityCollectionView/useSelectionController.tsx +19 -7
  131. package/src/components/EntityPreview.tsx +38 -34
  132. package/src/components/EntityView.tsx +5 -5
  133. package/src/components/ErrorView.tsx +1 -1
  134. package/src/components/HomePage/DefaultHomePage.tsx +26 -19
  135. package/src/components/HomePage/NavigationCard.tsx +3 -3
  136. package/src/components/HomePage/NavigationCardBinding.tsx +1 -1
  137. package/src/components/HomePage/SmallNavigationCard.tsx +5 -6
  138. package/src/components/PropertyIdCopyTooltip.tsx +48 -0
  139. package/src/components/ReferenceTable/ReferenceSelectionTable.tsx +8 -6
  140. package/src/components/ReferenceWidget.tsx +22 -12
  141. package/src/components/SearchIconsView.tsx +11 -7
  142. package/src/components/SelectableTable/SelectableTable.tsx +7 -7
  143. package/src/components/SelectableTable/filters/BooleanFilterField.tsx +2 -3
  144. package/src/components/SelectableTable/filters/DateTimeFilterField.tsx +22 -7
  145. package/src/components/SelectableTable/filters/ReferenceFilterField.tsx +28 -6
  146. package/src/components/SelectableTable/filters/StringNumberFilterField.tsx +89 -21
  147. package/src/components/VirtualTable/VirtualTable.tsx +70 -37
  148. package/src/components/VirtualTable/VirtualTableCell.tsx +1 -9
  149. package/src/components/VirtualTable/VirtualTableHeader.tsx +4 -4
  150. package/src/components/VirtualTable/VirtualTableHeaderRow.tsx +2 -2
  151. package/src/components/VirtualTable/VirtualTableProps.tsx +18 -14
  152. package/src/components/VirtualTable/VirtualTableRow.tsx +4 -5
  153. package/src/components/VirtualTable/fields/VirtualTableDateField.tsx +4 -4
  154. package/src/components/VirtualTable/fields/VirtualTableInput.tsx +2 -1
  155. package/src/components/VirtualTable/fields/VirtualTableNumberInput.tsx +2 -1
  156. package/src/components/VirtualTable/fields/VirtualTableSelect.tsx +14 -28
  157. package/src/components/VirtualTable/types.tsx +2 -3
  158. package/src/components/{EntityCollectionTable/internal → common}/default_entity_actions.tsx +2 -2
  159. package/src/components/common/index.ts +1 -0
  160. package/src/components/{VirtualTable/common.tsx → common/table_height.tsx} +5 -2
  161. package/src/components/common/types.tsx +4 -6
  162. package/src/components/common/useColumnsIds.tsx +23 -2
  163. package/src/components/common/useDataSourceEntityCollectionTableController.tsx +11 -0
  164. package/src/components/common/useTableSearchHelper.ts +53 -12
  165. package/src/components/index.tsx +3 -1
  166. package/src/contexts/DialogsProvider.tsx +2 -2
  167. package/src/{components/FireCMSAppBar.tsx → core/DefaultAppBar.tsx} +52 -37
  168. package/src/core/DefaultDrawer.tsx +179 -0
  169. package/src/core/DrawerNavigationItem.tsx +66 -0
  170. package/src/core/EntityEditView.tsx +716 -149
  171. package/src/core/EntitySidePanel.tsx +1 -2
  172. package/src/core/FireCMS.tsx +39 -44
  173. package/src/core/NavigationRoutes.tsx +7 -8
  174. package/src/core/SideDialogs.tsx +2 -0
  175. package/src/core/field_configs.tsx +7 -8
  176. package/src/core/index.tsx +3 -4
  177. package/src/form/PropertyFieldBinding.tsx +53 -21
  178. package/src/form/components/CustomIdField.tsx +4 -2
  179. package/src/form/components/FieldHelperText.tsx +4 -4
  180. package/src/form/components/FormikArrayContainer.tsx +4 -1
  181. package/src/form/components/LabelWithIcon.tsx +27 -19
  182. package/src/form/components/LabelWithIconAndTooltip.tsx +28 -0
  183. package/src/form/components/StorageItemPreview.tsx +21 -11
  184. package/src/form/components/StorageUploadProgress.tsx +3 -4
  185. package/src/form/components/index.tsx +1 -0
  186. package/src/form/field_bindings/ArrayCustomShapedFieldBinding.tsx +26 -15
  187. package/src/form/field_bindings/ArrayOfReferencesFieldBinding.tsx +29 -24
  188. package/src/form/field_bindings/BlockFieldBinding.tsx +14 -12
  189. package/src/form/field_bindings/DateTimeFieldBinding.tsx +17 -14
  190. package/src/form/field_bindings/KeyValueFieldBinding.tsx +52 -46
  191. package/src/form/field_bindings/MapFieldBinding.tsx +17 -17
  192. package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +150 -0
  193. package/src/form/field_bindings/{MultiSelectBinding.tsx → MultiSelectFieldBinding.tsx} +25 -20
  194. package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +11 -16
  195. package/src/form/field_bindings/ReferenceFieldBinding.tsx +41 -30
  196. package/src/form/field_bindings/RepeatFieldBinding.tsx +32 -19
  197. package/src/form/field_bindings/SelectFieldBinding.tsx +20 -13
  198. package/src/form/field_bindings/StorageUploadFieldBinding.tsx +36 -46
  199. package/src/form/field_bindings/SwitchFieldBinding.tsx +9 -5
  200. package/src/form/field_bindings/TextFieldBinding.tsx +26 -23
  201. package/src/form/index.tsx +4 -9
  202. package/src/form/useClearRestoreValue.tsx +2 -2
  203. package/src/form/validation.ts +1 -17
  204. package/src/hooks/data/delete.ts +2 -1
  205. package/src/hooks/data/save.ts +6 -1
  206. package/src/hooks/data/useDataSource.tsx +11 -3
  207. package/src/hooks/index.tsx +1 -0
  208. package/src/hooks/useBuildLocalConfigurationPersistence.tsx +8 -10
  209. package/src/hooks/useBuildModeController.tsx +11 -5
  210. package/src/hooks/useBuildNavigationController.tsx +91 -31
  211. package/src/hooks/useProjectLog.tsx +19 -8
  212. package/src/hooks/useResolvedNavigationFrom.tsx +1 -1
  213. package/src/hooks/useValidateAuthenticator.tsx +21 -41
  214. package/src/index.ts +1 -0
  215. package/src/internal/useBuildDataSource.ts +71 -81
  216. package/src/internal/useBuildSideDialogsController.tsx +1 -0
  217. package/src/internal/useBuildSideEntityController.tsx +102 -22
  218. package/src/internal/useUnsavedChangesDialog.tsx +3 -1
  219. package/src/preview/PropertyPreview.tsx +10 -17
  220. package/src/preview/PropertyPreviewProps.tsx +7 -1
  221. package/src/preview/components/BooleanPreview.tsx +2 -2
  222. package/src/preview/components/EnumValuesChip.tsx +2 -2
  223. package/src/preview/components/ImagePreview.tsx +24 -34
  224. package/src/preview/components/ReferencePreview.tsx +23 -34
  225. package/src/preview/components/StorageThumbnail.tsx +5 -1
  226. package/src/preview/components/UrlComponentPreview.tsx +44 -11
  227. package/src/preview/property_previews/ArrayOfMapsPreview.tsx +1 -2
  228. package/src/preview/property_previews/ArrayOfReferencesPreview.tsx +3 -2
  229. package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +1 -2
  230. package/src/preview/property_previews/ArrayOfStringsPreview.tsx +0 -1
  231. package/src/preview/property_previews/ArrayOneOfPreview.tsx +3 -4
  232. package/src/preview/property_previews/ArrayPropertyPreview.tsx +3 -4
  233. package/src/preview/property_previews/MapPropertyPreview.tsx +6 -6
  234. package/src/preview/property_previews/SkeletonPropertyComponent.tsx +2 -2
  235. package/src/preview/property_previews/StringPropertyPreview.tsx +3 -3
  236. package/src/preview/util.ts +2 -2
  237. package/src/types/auth.tsx +3 -3
  238. package/src/types/collections.ts +48 -7
  239. package/src/types/customization_controller.tsx +0 -1
  240. package/src/types/datasource.ts +65 -43
  241. package/src/types/entities.ts +11 -1
  242. package/src/types/entity_actions.tsx +16 -3
  243. package/src/types/entity_overrides.tsx +2 -2
  244. package/src/types/fields.tsx +51 -45
  245. package/src/types/index.ts +0 -1
  246. package/src/types/navigation.ts +7 -7
  247. package/src/types/plugins.tsx +16 -6
  248. package/src/types/properties.ts +39 -22
  249. package/src/types/side_dialogs_controller.tsx +13 -0
  250. package/src/types/storage.ts +94 -3
  251. package/src/util/entities.ts +6 -5
  252. package/src/util/enums.ts +1 -1
  253. package/src/util/icon_list.ts +15 -10
  254. package/src/util/icon_synonyms.ts +3 -99
  255. package/src/util/icons.tsx +8 -2
  256. package/src/util/index.ts +1 -0
  257. package/src/util/navigation_utils.ts +6 -6
  258. package/src/util/objects.ts +25 -28
  259. package/src/util/permissions.ts +1 -0
  260. package/src/util/plurals.ts +0 -2
  261. package/src/util/property_utils.tsx +1 -1
  262. package/src/util/references.ts +3 -0
  263. package/src/util/resolutions.ts +74 -41
  264. package/src/util/storage.ts +79 -21
  265. package/src/util/strings.ts +2 -2
  266. package/src/util/useStorageUploadController.tsx +33 -7
  267. package/src/util/useTraceUpdate.tsx +1 -0
  268. package/dist/components/PropertyIdCopyTooltipContent.d.ts +0 -3
  269. package/dist/components/VirtualTable/common.d.ts +0 -2
  270. package/dist/core/Drawer.d.ts +0 -23
  271. package/dist/core/Scaffold.d.ts +0 -55
  272. package/dist/core/SideEntityView.d.ts +0 -7
  273. package/dist/form/EntityForm.d.ts +0 -77
  274. package/dist/form/field_bindings/MarkdownFieldBinding.d.ts +0 -9
  275. package/dist/internal/useBuildCustomizationController.d.ts +0 -2
  276. package/dist/internal/useLocaleConfig.d.ts +0 -1
  277. package/dist/types/appcheck.d.ts +0 -26
  278. package/src/components/PropertyIdCopyTooltipContent.tsx +0 -28
  279. package/src/core/Drawer.tsx +0 -191
  280. package/src/core/Scaffold.tsx +0 -281
  281. package/src/core/SideEntityView.tsx +0 -38
  282. package/src/form/EntityForm.tsx +0 -728
  283. package/src/form/field_bindings/MarkdownFieldBinding.tsx +0 -695
  284. package/src/internal/useBuildCustomizationController.tsx +0 -5
  285. package/src/internal/useLocaleConfig.tsx +0 -18
  286. package/src/types/appcheck.ts +0 -29
@@ -7,7 +7,7 @@ import {
7
7
  CollectionSize,
8
8
  Entity,
9
9
  EntityAction,
10
- EntityCollection,
10
+ EntityCollection, EntityTableController,
11
11
  FilterValues,
12
12
  PartialEntityCollection,
13
13
  PropertyOrBuilder,
@@ -35,6 +35,7 @@ import {
35
35
  useAuthController,
36
36
  useCustomizationController,
37
37
  useDataSource,
38
+ useFireCMSContext,
38
39
  useLargeLayout,
39
40
  useNavigationController,
40
41
  useSideEntityController
@@ -44,7 +45,7 @@ import { EntityCollectionViewActions } from "./EntityCollectionViewActions";
44
45
  import {
45
46
  AddIcon,
46
47
  Button,
47
- cn,
48
+ cls,
48
49
  IconButton,
49
50
  KeyboardTabIcon,
50
51
  Markdown,
@@ -65,14 +66,11 @@ import {
65
66
  } from "../common";
66
67
  import { PopupFormField } from "../EntityCollectionTable/internal/popup_field/PopupFormField";
67
68
  import { GetPropertyForProps } from "../EntityCollectionTable/EntityCollectionTableProps";
68
- import {
69
- copyEntityAction,
70
- deleteEntityAction,
71
- editEntityAction
72
- } from "../EntityCollectionTable/internal/default_entity_actions";
69
+ import { copyEntityAction, deleteEntityAction, editEntityAction } from "../common/default_entity_actions";
73
70
  import { DeleteEntityDialog } from "../DeleteEntityDialog";
74
71
  import { useAnalyticsController } from "../../hooks/useAnalyticsController";
75
72
  import { useSelectionController } from "./useSelectionController";
73
+ import { EntityCollectionViewStartActions } from "./EntityCollectionViewStartActions";
76
74
 
77
75
  const COLLECTION_GROUP_PARENT_ID = "collectionGroupParent";
78
76
 
@@ -80,10 +78,22 @@ const COLLECTION_GROUP_PARENT_ID = "collectionGroupParent";
80
78
  * @group Components
81
79
  */
82
80
  export type EntityCollectionViewProps<M extends Record<string, any>> = {
83
- fullPath: string;
81
+ /**
82
+ * Complete path where this collection is located.
83
+ * It defaults to the collection path if not provided.
84
+ */
85
+ fullPath?: string;
86
+ /**
87
+ * If this is a subcollection, specify the parent collection ids.
88
+ */
84
89
  parentCollectionIds?: string[];
90
+ /**
91
+ * Whether this is a subcollection or not.
92
+ */
85
93
  isSubCollection?: boolean;
94
+
86
95
  className?: string;
96
+
87
97
  } & EntityCollection<M>;
88
98
 
89
99
  /**
@@ -107,12 +117,12 @@ export type EntityCollectionViewProps<M extends Record<string, any>> = {
107
117
  *
108
118
  * @param fullPath
109
119
  * @param collection
110
- * @constructor
120
+
111
121
  * @group Components
112
122
  */
113
123
  export const EntityCollectionView = React.memo(
114
124
  function EntityCollectionView<M extends Record<string, any>>({
115
- fullPath,
125
+ fullPath: fullPathProp,
116
126
  parentCollectionIds,
117
127
  isSubCollection,
118
128
  className,
@@ -120,6 +130,8 @@ export const EntityCollectionView = React.memo(
120
130
  }: EntityCollectionViewProps<M>
121
131
  ) {
122
132
 
133
+ const context = useFireCMSContext();
134
+ const fullPath = fullPathProp ?? collectionProp.path;
123
135
  const dataSource = useDataSource(collectionProp);
124
136
  const navigation = useNavigationController();
125
137
  const sideEntityController = useSideEntityController();
@@ -128,7 +140,6 @@ export const EntityCollectionView = React.memo(
128
140
  const analyticsController = useAnalyticsController();
129
141
  const customizationController = useCustomizationController();
130
142
 
131
-
132
143
  const containerRef = React.useRef<HTMLDivElement>(null);
133
144
 
134
145
  const collection = useMemo(() => {
@@ -142,7 +153,7 @@ export const EntityCollectionView = React.memo(
142
153
  }, [collection]);
143
154
 
144
155
  const canCreateEntities = canCreateEntity(collection, authController, fullPath, null);
145
- const [selectedNavigationEntity, setSelectedNavigationEntity] = useState<Entity<M> | undefined>(undefined);
156
+ const [highlightedEntity, setHighlightedEntity] = useState<Entity<M> | undefined>(undefined);
146
157
  const [deleteEntityClicked, setDeleteEntityClicked] = React.useState<Entity<M> | Entity<M>[] | undefined>(undefined);
147
158
 
148
159
  const [lastDeleteTimestamp, setLastDeleteTimestamp] = React.useState<number>(0);
@@ -151,12 +162,12 @@ export const EntityCollectionView = React.memo(
151
162
  const [docsCount, setDocsCount] = useState<number>(0);
152
163
 
153
164
  const unselectNavigatedEntity = useCallback(() => {
154
- const currentSelection = selectedNavigationEntity;
165
+ const currentSelection = highlightedEntity;
155
166
  setTimeout(() => {
156
- if (currentSelection === selectedNavigationEntity)
157
- setSelectedNavigationEntity(undefined);
167
+ if (currentSelection === highlightedEntity)
168
+ setHighlightedEntity(undefined);
158
169
  }, 2400);
159
- }, [selectedNavigationEntity]);
170
+ }, [highlightedEntity]);
160
171
 
161
172
  const checkInlineEditing = useCallback((entity?: Entity<any>): boolean => {
162
173
  const collection = collectionRef.current;
@@ -175,19 +186,16 @@ export const EntityCollectionView = React.memo(
175
186
  const usedSelectionController = collection.selectionController ?? selectionController;
176
187
  const {
177
188
  selectedEntities,
178
- toggleEntitySelection,
179
- isEntitySelected,
180
189
  setSelectedEntities
181
190
  } = usedSelectionController;
182
191
 
183
- useEffect(() => {
184
- setDeleteEntityClicked(undefined);
185
- }, [selectedEntities]);
192
+ // useEffect(() => {
193
+ // setDeleteEntityClicked(undefined);
194
+ // }, [selectedEntities]);
186
195
 
187
196
  const tableController = useDataSourceEntityCollectionTableController<M>({
188
197
  fullPath,
189
- collection: collectionRef.current,
190
- entitiesDisplayedFirst: [],
198
+ collection,
191
199
  lastDeleteTimestamp
192
200
  });
193
201
 
@@ -201,7 +209,7 @@ export const EntityCollectionView = React.memo(
201
209
  const onEntityClick = useCallback((clickedEntity: Entity<M>) => {
202
210
  console.log("Entity clicked", clickedEntity)
203
211
  const collection = collectionRef.current;
204
- setSelectedNavigationEntity(clickedEntity);
212
+ setHighlightedEntity(clickedEntity);
205
213
  analyticsController.onAnalyticsEvent?.("edit_entity_clicked", {
206
214
  path: clickedEntity.path,
207
215
  entityId: clickedEntity.id
@@ -257,6 +265,7 @@ export const EntityCollectionView = React.memo(
257
265
  fullPath: string,
258
266
  parentCollectionIds: string[],
259
267
  collection: EntityCollection;
268
+ tableController: EntityTableController;
260
269
  }> | undefined
261
270
 
262
271
  // we are only using the first plugin that implements this
@@ -297,17 +306,15 @@ export const EntityCollectionView = React.memo(
297
306
  value,
298
307
  property,
299
308
  entityId
300
- }) => dataSource.checkUniqueField(fullPath, name, value, entityId),
309
+ }) => dataSource.checkUniqueField(fullPath, name, value, entityId, collection),
301
310
  [fullPath]);
302
311
 
303
312
  const onValueChange: OnCellValueChange<any, any> = ({
304
- fullPath,
305
- context,
306
313
  value,
307
314
  propertyKey,
308
315
  onValueUpdated,
309
316
  setError,
310
- entity,
317
+ data: entity,
311
318
  }) => {
312
319
 
313
320
  const updatedValues = setIn({ ...entity.values }, propertyKey, value);
@@ -324,10 +331,12 @@ export const EntityCollectionView = React.memo(
324
331
  return saveEntityWithCallbacks({
325
332
  ...saveProps,
326
333
  collection,
327
- callbacks: collection.callbacks,
328
334
  dataSource,
329
335
  context,
330
- onSaveSuccess: () => onValueUpdated(),
336
+ onSaveSuccess: () => {
337
+ setError(undefined);
338
+ onValueUpdated();
339
+ },
331
340
  onSaveFailure: (e: Error) => {
332
341
  console.error("Save failure");
333
342
  console.error(e);
@@ -346,7 +355,6 @@ export const EntityCollectionView = React.memo(
346
355
 
347
356
  const getPropertyFor = useCallback(({
348
357
  propertyKey,
349
- propertyValue,
350
358
  entity
351
359
  }: GetPropertyForProps<M>) => {
352
360
  let propertyOrBuilder: PropertyOrBuilder<any, M> | undefined = getPropertyInPath<M>(collection.properties, propertyKey);
@@ -360,13 +368,12 @@ export const EntityCollectionView = React.memo(
360
368
  return resolveProperty({
361
369
  propertyKey,
362
370
  propertyOrBuilder,
363
- path: fullPath,
364
- propertyValue,
371
+ path: entity.path,
365
372
  values: entity.values,
366
373
  entityId: entity.id,
367
374
  fields: customizationController.propertyConfigs
368
375
  });
369
- }, [collection.properties, customizationController.propertyConfigs, fullPath, resolvedCollection.properties]);
376
+ }, [collection.properties, customizationController.propertyConfigs, resolvedCollection.properties]);
370
377
 
371
378
  const displayedColumnIds = useColumnIds(resolvedCollection, true);
372
379
 
@@ -406,16 +413,16 @@ export const EntityCollectionView = React.memo(
406
413
  Builder: ({ entity }) => {
407
414
  const collectionsWithPath = navigation.getParentReferencesFromPath(entity.path);
408
415
  return (
409
- <>
416
+ <div className={"flex flex-col gap-2 w-full"}>
410
417
  {collectionsWithPath.map((reference) => {
411
418
  return (
412
419
  <ReferencePreview
413
420
  key={reference.path + "/" + reference.id}
414
421
  reference={reference}
415
- size={"tiny"}/>
422
+ size={"smallest"}/>
416
423
  );
417
424
  })}
418
- </>
425
+ </div>
419
426
  );
420
427
  }
421
428
  }]
@@ -460,7 +467,7 @@ export const EntityCollectionView = React.memo(
460
467
  return (largeLayout ? (80 + actionsWidth) : (70 + actionsWidth)) + (collapsedActions.length > 0 ? (largeLayout ? 40 : 30) : 0);
461
468
  };
462
469
 
463
- const tableRowActionsBuilder = ({
470
+ const tableRowActionsBuilder = useCallback(({
464
471
  entity,
465
472
  size,
466
473
  width,
@@ -472,7 +479,7 @@ export const EntityCollectionView = React.memo(
472
479
  frozen?: boolean
473
480
  }) => {
474
481
 
475
- const isSelected = isEntitySelected(entity);
482
+ const isSelected = usedSelectionController.selectedEntities.map(e => e.id).includes(entity.id);
476
483
 
477
484
  const actions = getActionsForEntity({
478
485
  entity,
@@ -487,7 +494,7 @@ export const EntityCollectionView = React.memo(
487
494
  isSelected={isSelected}
488
495
  selectionEnabled={selectionEnabled}
489
496
  size={size}
490
- highlightEntity={setSelectedNavigationEntity}
497
+ highlightEntity={setHighlightedEntity}
491
498
  unhighlightEntity={unselectNavigatedEntity}
492
499
  collection={collection}
493
500
  fullPath={fullPath}
@@ -498,7 +505,7 @@ export const EntityCollectionView = React.memo(
498
505
  />
499
506
  );
500
507
 
501
- };
508
+ }, [updateLastDeleteTimestamp, usedSelectionController]);
502
509
 
503
510
  const title = <Popover
504
511
  open={popOverOpen}
@@ -557,6 +564,7 @@ export const EntityCollectionView = React.memo(
557
564
  property={property}
558
565
  fullPath={fullPath}
559
566
  collection={collection}
567
+ tableController={tableController}
560
568
  parentCollectionIds={parentCollectionIds ?? []}/>;
561
569
  })}
562
570
  </>;
@@ -567,7 +575,8 @@ export const EntityCollectionView = React.memo(
567
575
  if (typeof AddColumnComponent === "function")
568
576
  return <AddColumnComponent fullPath={fullPath}
569
577
  parentCollectionIds={parentCollectionIds ?? []}
570
- collection={collection}/>;
578
+ collection={collection}
579
+ tableController={tableController}/>;
571
580
  return null;
572
581
  }
573
582
  : undefined;
@@ -584,12 +593,13 @@ export const EntityCollectionView = React.memo(
584
593
  });
585
594
 
586
595
  return (
587
- <div className={cn("overflow-hidden h-full w-full rounded-md", className)}
596
+ <div className={cls("overflow-hidden h-full w-full rounded-md", className)}
588
597
  ref={containerRef}>
589
598
  <EntityCollectionTable
590
599
  key={`collection_table_${fullPath}`}
591
600
  additionalFields={additionalFields}
592
601
  tableController={tableController}
602
+ enablePopupIcon={true}
593
603
  displayedColumnIds={displayedColumnIds}
594
604
  onSizeChanged={onSizeChanged}
595
605
  onEntityClick={onEntityClick}
@@ -599,13 +609,21 @@ export const EntityCollectionView = React.memo(
599
609
  uniqueFieldValidator={uniqueFieldValidator}
600
610
  title={title}
601
611
  selectionController={usedSelectionController}
602
- highlightedEntities={selectedNavigationEntity ? [selectedNavigationEntity] : []}
612
+ highlightedEntities={highlightedEntity ? [highlightedEntity] : []}
603
613
  defaultSize={collection.defaultSize}
604
614
  properties={resolvedCollection.properties}
605
615
  getPropertyFor={getPropertyFor}
606
616
  onTextSearchClick={textSearchInitialised ? undefined : onTextSearchClick}
607
617
  textSearchLoading={textSearchLoading}
608
618
  textSearchEnabled={textSearchEnabled}
619
+ actionsStart={<EntityCollectionViewStartActions
620
+ parentCollectionIds={parentCollectionIds ?? []}
621
+ collection={collection}
622
+ tableController={tableController}
623
+ path={fullPath}
624
+ relativePath={collection.path}
625
+ selectionController={usedSelectionController}
626
+ collectionEntitiesCount={docsCount}/>}
609
627
  actions={<EntityCollectionViewActions
610
628
  parentCollectionIds={parentCollectionIds ?? []}
611
629
  collection={collection}
@@ -643,19 +661,19 @@ export const EntityCollectionView = React.memo(
643
661
  collection={collection}/>}
644
662
  />
645
663
 
646
- <PopupFormField
664
+ {popupCell && <PopupFormField
647
665
  key={`popup_form_${popupCell?.propertyKey}_${popupCell?.entity?.id}`}
648
666
  open={Boolean(popupCell)}
649
667
  onClose={onPopupClose}
650
668
  cellRect={popupCell?.cellRect}
651
669
  propertyKey={popupCell?.propertyKey}
652
670
  collection={collection}
653
- entity={popupCell?.entity}
671
+ entity={popupCell.entity}
654
672
  tableKey={tableKey.current}
655
673
  customFieldValidator={uniqueFieldValidator}
656
674
  path={resolvedFullPath}
657
675
  onCellValueChange={onValueChange}
658
- container={containerRef.current}/>
676
+ container={containerRef.current}/>}
659
677
 
660
678
  {deleteEntityClicked &&
661
679
  <DeleteEntityDialog
@@ -683,8 +701,11 @@ export const EntityCollectionView = React.memo(
683
701
  equal(a.selectionController, b.selectionController) &&
684
702
  equal(a.Actions, b.Actions) &&
685
703
  equal(a.defaultSize, b.defaultSize) &&
704
+ equal(a.initialFilter, b.initialFilter) &&
705
+ equal(a.initialSort, b.initialSort) &&
686
706
  equal(a.textSearchEnabled, b.textSearchEnabled) &&
687
707
  equal(a.additionalFields, b.additionalFields) &&
708
+ equal(a.sideDialogWidth, b.sideDialogWidth) &&
688
709
  equal(a.forceFilter, b.forceFilter);
689
710
  }) as React.FunctionComponent<EntityCollectionViewProps<any>>
690
711
 
@@ -724,6 +745,7 @@ function EntitiesCount({
724
745
 
725
746
  useEffect(() => {
726
747
  if (onCountChange) {
748
+ setError(undefined);
727
749
  onCountChange(count ?? 0);
728
750
  }
729
751
  }, [onCountChange, count]);
@@ -759,7 +781,7 @@ function EntityIdHeaderWidget({
759
781
  const [searchString, setSearchString] = React.useState("");
760
782
  const sideEntityController = useSideEntityController();
761
783
  return (
762
- <Tooltip title={!openPopup ? "Find by ID" : undefined}>
784
+ <Tooltip title={!openPopup ? "Find by ID" : undefined} asChild={false}>
763
785
  <Popover
764
786
  open={openPopup}
765
787
  onOpenChange={setOpenPopup}
@@ -775,7 +797,7 @@ function EntityIdHeaderWidget({
775
797
  if (!searchString) return;
776
798
  setOpenPopup(false);
777
799
  return sideEntityController.open({
778
- entityId: searchString,
800
+ entityId: searchString.trim(),
779
801
  path,
780
802
  collection,
781
803
  updateUrl: true,
@@ -788,11 +810,13 @@ function EntityIdHeaderWidget({
788
810
  autoFocus={openPopup}
789
811
  placeholder={"Find entity by ID"}
790
812
  // size={"small"}
791
- onChange={(e) => setSearchString(e.target.value)}
813
+ onChange={(e) => {
814
+ setSearchString(e.target.value);
815
+ }}
792
816
  value={searchString}
793
817
  className={"flex-grow bg-transparent outline-none p-1"}/>
794
818
  <Button variant={"outlined"}
795
- disabled={!searchString}
819
+ disabled={!(searchString.trim())}
796
820
  type={"submit"}
797
821
  >Go</Button>
798
822
  </div>
@@ -0,0 +1,68 @@
1
+ import React from "react";
2
+ import { useCustomizationController, useFireCMSContext } from "../../hooks";
3
+ import { CollectionActionsProps, EntityCollection, EntityTableController, SelectionController } from "../../types";
4
+ import { toArray } from "../../util/arrays";
5
+ import { ErrorBoundary } from "../ErrorBoundary";
6
+ import { ClearFilterSortButton } from "../ClearFilterSortButton";
7
+
8
+ export type EntityCollectionViewStartActionsProps<M extends Record<string, any>> = {
9
+ collection: EntityCollection<M>;
10
+ path: string;
11
+ relativePath: string;
12
+ parentCollectionIds: string[];
13
+ selectionController: SelectionController<M>;
14
+ tableController: EntityTableController<M>;
15
+ collectionEntitiesCount: number;
16
+ }
17
+
18
+ export function EntityCollectionViewStartActions<M extends Record<string, any>>({
19
+ collection,
20
+ relativePath,
21
+ parentCollectionIds,
22
+ path,
23
+ selectionController,
24
+ tableController,
25
+ collectionEntitiesCount
26
+ }: EntityCollectionViewStartActionsProps<M>) {
27
+
28
+ const context = useFireCMSContext();
29
+
30
+ const customizationController = useCustomizationController();
31
+ const plugins = customizationController.plugins ?? [];
32
+
33
+ const actionProps: CollectionActionsProps = {
34
+ path,
35
+ relativePath,
36
+ parentCollectionIds,
37
+ collection,
38
+ selectionController,
39
+ context,
40
+ tableController,
41
+ collectionEntitiesCount
42
+ };
43
+ const actions: React.ReactNode[] = [
44
+ <ClearFilterSortButton
45
+ key={"clear_filter"}
46
+ tableController={tableController}
47
+ enabled={!collection.forceFilter}/>
48
+ ];
49
+
50
+ if (plugins) {
51
+ plugins.forEach((plugin, i) => {
52
+ if (plugin.collectionView?.CollectionActionsStart) {
53
+ actions.push(...toArray(plugin.collectionView?.CollectionActionsStart)
54
+ .map((Action, j) => (
55
+ <ErrorBoundary key={`plugin_actions_${i}_${j}`}>
56
+ <Action {...actionProps} {...plugin.collectionView?.collectionActionsStartProps}/>
57
+ </ErrorBoundary>
58
+ )));
59
+ }
60
+ });
61
+ }
62
+
63
+ return (
64
+ <>
65
+ {actions}
66
+ </>
67
+ );
68
+ }
@@ -7,19 +7,31 @@ export function useSelectionController<M extends Record<string, any> = any>(
7
7
 
8
8
  const [selectedEntities, setSelectedEntities] = useState<Entity<M>[]>([]);
9
9
 
10
- const toggleEntitySelection = useCallback((entity: Entity<M>) => {
10
+ const toggleEntitySelection = useCallback((entity: Entity<M>, newSelectedState?: boolean) => {
11
11
  let newValue;
12
- if (selectedEntities.map(e => e.id).includes(entity.id)) {
13
- onSelectionChange?.(entity, false);
14
- newValue = selectedEntities.filter((item: Entity<M>) => item.id !== entity.id);
12
+ if (newSelectedState === undefined) {
13
+ if (selectedEntities.map(e => e.id).includes(entity.id)) {
14
+ onSelectionChange?.(entity, false);
15
+ newValue = selectedEntities.filter((item: Entity<M>) => item.id !== entity.id);
16
+ } else {
17
+ onSelectionChange?.(entity, true);
18
+ newValue = [...selectedEntities, entity];
19
+ }
15
20
  } else {
16
- onSelectionChange?.(entity, true);
17
- newValue = [...selectedEntities, entity];
21
+ if (newSelectedState) {
22
+ onSelectionChange?.(entity, true);
23
+ newValue = [...selectedEntities, entity];
24
+ } else {
25
+ onSelectionChange?.(entity, false);
26
+ newValue = selectedEntities.filter((item: Entity<M>) => item.id !== entity.id);
27
+ }
18
28
  }
19
29
  setSelectedEntities(newValue);
20
30
  }, [selectedEntities]);
21
31
 
22
- const isEntitySelected = useCallback((entity: Entity<M>) => selectedEntities.map(e => e.id).includes(entity.id), [selectedEntities]);
32
+ const isEntitySelected = useCallback((entity: Entity<M>) => {
33
+ return selectedEntities.map(e => e.id).includes(entity.id);
34
+ }, [selectedEntities]);
23
35
 
24
36
  return {
25
37
  selectedEntities,
@@ -8,9 +8,10 @@ import {
8
8
  getEntityPreviewKeys,
9
9
  getEntityTitlePropertyKey,
10
10
  getValueInPath,
11
+ IconForView,
11
12
  resolveCollection
12
13
  } from "../util";
13
- import { cn, defaultBorderMixin, IconButton, KeyboardTabIcon, Skeleton, Tooltip, Typography } from "@firecms/ui";
14
+ import { cls, defaultBorderMixin, IconButton, KeyboardTabIcon, Skeleton, Tooltip, Typography } from "@firecms/ui";
14
15
  import { PreviewSize, PropertyPreview, SkeletonPropertyComponent } from "../preview";
15
16
  import { useCustomizationController, useNavigationController, useSideEntityController } from "../hooks";
16
17
  import { useAnalyticsController } from "../hooks/useAnalyticsController";
@@ -23,7 +24,8 @@ export type EntityPreviewProps = {
23
24
  previewProperties?: string[],
24
25
  disabled: undefined | boolean,
25
26
  entity: Entity<any>,
26
- includeEntityNavigation?: boolean,
27
+ includeId?: boolean,
28
+ includeEntityLink?: boolean,
27
29
  onClick?: (e: React.SyntheticEvent) => void;
28
30
  };
29
31
 
@@ -39,7 +41,8 @@ export function EntityPreview({
39
41
  previewProperties,
40
42
  onClick,
41
43
  size,
42
- includeEntityNavigation,
44
+ includeId = true,
45
+ includeEntityLink = true,
43
46
  entity
44
47
  }: EntityPreviewProps) {
45
48
 
@@ -49,7 +52,7 @@ export function EntityPreview({
49
52
 
50
53
  const navigationController = useNavigationController();
51
54
 
52
- const collection = collectionProp ?? navigationController.getCollection<EntityCollection>(entity.path);
55
+ const collection = collectionProp ?? navigationController.getCollection(entity.path);
53
56
 
54
57
  if (!collection) {
55
58
  throw Error(`Couldn't find the corresponding collection view for the path: ${entity.path}`);
@@ -74,18 +77,18 @@ export function EntityPreview({
74
77
  return <EntityPreviewContainer onClick={disabled ? undefined : onClick}
75
78
  hover={disabled ? undefined : hover}
76
79
  size={size}>
77
- {imageProperty && (
78
- <div className={cn("w-10 h-10 mr-2 shrink-0 grow-0", size === "tiny" ? "my-0.5" : "m-2 self-start")}>
79
- <PropertyPreview property={imageProperty}
80
- propertyKey={imagePropertyKey as string}
81
- size={"tiny"}
82
- value={getValueInPath(entity.values, imagePropertyKey as string)}/>
83
- </div>
84
- )}
80
+ <div className={cls("w-10 h-10 mr-2 shrink-0 grow-0", size === "smallest" ? "my-0.5" : "m-2 self-start")}>
81
+ {imageProperty && <PropertyPreview property={imageProperty}
82
+ propertyKey={imagePropertyKey as string}
83
+ size={"smallest"}
84
+ value={getValueInPath(entity.values, imagePropertyKey as string)}/>}
85
+ {!imageProperty && <IconForView collectionOrView={collection} size={size} className={"mr-2"}/>}
86
+ </div>
87
+
85
88
 
86
89
  <div className={"flex flex-col flex-grow w-full m-1"}>
87
90
 
88
- {size !== "tiny" && (
91
+ {size !== "smallest" && includeId && (
89
92
  entity
90
93
  ? <div className={`${
91
94
  size !== "medium"
@@ -129,10 +132,10 @@ export function EntityPreview({
129
132
  propertyKey={key as string}
130
133
  value={getValueInPath(entity.values, key)}
131
134
  property={childProperty as ResolvedProperty}
132
- size={"tiny"}/>
135
+ size={"smallest"}/>
133
136
  : <SkeletonPropertyComponent
134
137
  property={childProperty as ResolvedProperty}
135
- size={"tiny"}/>
138
+ size={"smallest"}/>
136
139
  }
137
140
  </div>
138
141
  );
@@ -140,12 +143,12 @@ export function EntityPreview({
140
143
 
141
144
  </div>
142
145
 
143
- {entity && includeEntityNavigation &&
144
- <Tooltip title={`See details for ${entity.id}`}
145
- className={size !== "tiny" ? "self-start" : ""}>
146
+ {entity && includeEntityLink &&
147
+ <Tooltip title={`See details for ${entity.id}`}>
146
148
  <IconButton
147
149
  color={"inherit"}
148
150
  size={"small"}
151
+ className={size !== "smallest" ? "self-start" : ""}
149
152
  onClick={(e) => {
150
153
  e.stopPropagation();
151
154
  analyticsController.onAnalyticsEvent?.("entity_click_from_reference", {
@@ -168,24 +171,27 @@ export function EntityPreview({
168
171
  </EntityPreviewContainer>;
169
172
  }
170
173
 
171
- type EntityPreviewContainerProps = {
174
+ export type EntityPreviewContainerProps = {
172
175
  children: React.ReactNode;
173
176
  hover?: boolean;
177
+ fullwidth?: boolean;
174
178
  size: PreviewSize;
175
179
  className?: string;
176
180
  style?: React.CSSProperties;
177
181
  onClick?: (e: React.SyntheticEvent) => void;
178
182
  };
179
183
 
180
- const EntityPreviewContainerInner = React.forwardRef<HTMLDivElement, EntityPreviewContainerProps>(({
181
- children,
182
- hover,
183
- onClick,
184
- size,
185
- style,
186
- className,
187
- ...props
188
- }, ref) => {
184
+
185
+ export const EntityPreviewContainer = React.forwardRef<HTMLDivElement, EntityPreviewContainerProps>(({
186
+ children,
187
+ hover,
188
+ onClick,
189
+ size,
190
+ style,
191
+ className,
192
+ fullwidth = true,
193
+ ...props
194
+ }, ref) => {
189
195
  return <div
190
196
  ref={ref}
191
197
  style={{
@@ -193,11 +199,13 @@ const EntityPreviewContainerInner = React.forwardRef<HTMLDivElement, EntityPrevi
193
199
  // @ts-ignore
194
200
  tabindex: 0
195
201
  }}
196
- className={cn(
202
+ className={cls(
197
203
  "bg-white dark:bg-gray-900",
204
+ "min-h-[42px]",
205
+ fullwidth ? "w-full" : "",
198
206
  "items-center",
199
207
  hover ? "hover:bg-slate-50 dark:hover:bg-gray-800 group-hover:bg-slate-50 dark:group-hover:bg-gray-800" : "",
200
- size === "tiny" ? "p-1" : "p-2",
208
+ size === "smallest" ? "p-1" : "p-2",
201
209
  "flex border rounded-lg",
202
210
  onClick ? "cursor-pointer" : "",
203
211
  defaultBorderMixin,
@@ -212,7 +220,3 @@ const EntityPreviewContainerInner = React.forwardRef<HTMLDivElement, EntityPrevi
212
220
  {children}
213
221
  </div>;
214
222
  });
215
-
216
- EntityPreviewContainerInner.displayName = "EntityPreviewContainer";
217
-
218
- export const EntityPreviewContainer = React.memo(EntityPreviewContainerInner) as React.FC<EntityPreviewContainerProps>;