@firecms/core 3.1.0-canary.1df3b2c → 3.1.0-canary.8958c1b

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 (46) hide show
  1. package/dist/components/EntityCollectionTable/internal/popup_field/useDraggable.d.ts +2 -2
  2. package/dist/components/EntityCollectionView/ViewModeToggle.d.ts +5 -10
  3. package/dist/components/ErrorBoundary.d.ts +1 -1
  4. package/dist/components/VirtualTable/VirtualTableHeader.d.ts +1 -1
  5. package/dist/form/components/ErrorFocus.d.ts +1 -1
  6. package/dist/index.es.js +247 -210
  7. package/dist/index.es.js.map +1 -1
  8. package/dist/index.umd.js +246 -209
  9. package/dist/index.umd.js.map +1 -1
  10. package/dist/internal/useRestoreScroll.d.ts +1 -1
  11. package/dist/types/analytics.d.ts +1 -1
  12. package/dist/types/collections.d.ts +8 -0
  13. package/dist/types/plugins.d.ts +16 -0
  14. package/dist/util/entities.d.ts +1 -1
  15. package/dist/util/resolutions.d.ts +2 -2
  16. package/package.json +7 -7
  17. package/src/components/EntityCollectionTable/internal/EntityTableCellActions.tsx +1 -1
  18. package/src/components/EntityCollectionTable/internal/popup_field/useDraggable.tsx +11 -11
  19. package/src/components/EntityCollectionView/EntityBoardCard.tsx +1 -1
  20. package/src/components/EntityCollectionView/EntityCard.tsx +4 -0
  21. package/src/components/EntityCollectionView/EntityCollectionBoardView.tsx +23 -3
  22. package/src/components/EntityCollectionView/EntityCollectionView.tsx +50 -16
  23. package/src/components/EntityCollectionView/ViewModeToggle.tsx +27 -30
  24. package/src/components/VirtualTable/VirtualTable.tsx +116 -113
  25. package/src/components/VirtualTable/VirtualTableHeader.tsx +42 -42
  26. package/src/components/VirtualTable/VirtualTableHeaderRow.tsx +1 -1
  27. package/src/components/VirtualTable/fields/VirtualTableSelect.tsx +3 -3
  28. package/src/core/DefaultAppBar.tsx +1 -1
  29. package/src/core/EntitySidePanel.tsx +28 -26
  30. package/src/core/field_configs.tsx +14 -9
  31. package/src/form/EntityForm.tsx +69 -60
  32. package/src/form/PropertyFieldBinding.tsx +3 -3
  33. package/src/form/components/ErrorFocus.tsx +3 -3
  34. package/src/form/field_bindings/MarkdownEditorFieldBinding.tsx +1 -1
  35. package/src/form/field_bindings/StorageUploadFieldBinding.tsx +83 -83
  36. package/src/hooks/useBuildNavigationController.tsx +4 -4
  37. package/src/hooks/useValidateAuthenticator.tsx +1 -1
  38. package/src/internal/useBuildDataSource.ts +1 -2
  39. package/src/preview/PropertyPreview.tsx +1 -0
  40. package/src/types/analytics.ts +10 -0
  41. package/src/types/collections.ts +9 -0
  42. package/src/types/plugins.tsx +18 -0
  43. package/src/util/entities.ts +1 -1
  44. package/src/util/previews.ts +2 -2
  45. package/src/util/property_utils.tsx +1 -1
  46. package/src/util/resolutions.ts +5 -3
@@ -1,4 +1,4 @@
1
- import { AuthController, EntityCollection, PropertyConfig, ResolvedEntityCollection } from "../types";
1
+ import { AuthController, EntityCollection, Property, PropertyConfig, ResolvedEntityCollection } from "../types";
2
2
  import { isReferenceProperty } from "./property_utils";
3
3
  import { isPropertyBuilder } from "./entities";
4
4
  import { getFieldConfig } from "../core";
@@ -33,7 +33,7 @@ export function getEntityTitlePropertyKey<M extends Record<string, any>>(collect
33
33
  for (const key in collection.properties) {
34
34
  const property = collection.properties[key];
35
35
  if (!isPropertyBuilder(property)) {
36
- const field = getFieldConfig(property, propertyConfigs);
36
+ const field = getFieldConfig(property as Property, propertyConfigs);
37
37
  if (field?.key === "text_field") {
38
38
  return key;
39
39
  }
@@ -18,7 +18,7 @@ export function isReferenceProperty(
18
18
  authController: AuthController,
19
19
  propertyOrBuilder: PropertyOrBuilder,
20
20
  fields: Record<string, PropertyConfig>) {
21
- const resolvedProperty = resolveProperty({
21
+ const resolvedProperty: ResolvedProperty<any> | null = resolveProperty({
22
22
  propertyKey: "ignore", // TODO
23
23
  propertyOrBuilder,
24
24
  propertyConfigs: fields,
@@ -13,6 +13,7 @@ import {
13
13
  Properties,
14
14
  PropertiesOrBuilders,
15
15
  Property,
16
+ PropertyBuilder,
16
17
  PropertyConfig,
17
18
  PropertyOrBuilder,
18
19
  ResolvedArrayProperty,
@@ -62,6 +63,7 @@ export const resolveCollection = <M extends Record<string, any>,>
62
63
  const usedPreviousValues = previousValues ?? values ?? defaultValues;
63
64
 
64
65
  const resolvedProperties = Object.entries(collection.properties)
66
+ .filter(([, propertyOrBuilder]) => propertyOrBuilder != null)
65
67
  .map(([key, propertyOrBuilder]) => {
66
68
  const childResolvedProperty = resolveProperty({
67
69
  propertyKey: key,
@@ -108,7 +110,7 @@ export function resolveProperty<T extends CMSType = CMSType, M extends Record<st
108
110
  ...props
109
111
  }: {
110
112
  propertyKey?: string,
111
- propertyOrBuilder: PropertyOrBuilder<T, M> | ResolvedProperty<T>,
113
+ propertyOrBuilder: PropertyOrBuilder<T, M> | ResolvedProperty<T> | PropertyOrBuilder | Property | ResolvedProperty | undefined,
112
114
  values?: Partial<M>,
113
115
  previousValues?: Partial<M>,
114
116
  path?: string,
@@ -120,7 +122,7 @@ export function resolveProperty<T extends CMSType = CMSType, M extends Record<st
120
122
  authController: AuthController;
121
123
  }): ResolvedProperty<T> | null {
122
124
 
123
- if (typeof propertyOrBuilder === "object" && "resolved" in propertyOrBuilder) {
125
+ if (propertyOrBuilder !== null && typeof propertyOrBuilder === "object" && "resolved" in propertyOrBuilder) {
124
126
  return propertyOrBuilder as ResolvedProperty<T>;
125
127
  }
126
128
 
@@ -134,7 +136,7 @@ export function resolveProperty<T extends CMSType = CMSType, M extends Record<st
134
136
  throw Error("Trying to resolve a property builder without specifying the entity path");
135
137
 
136
138
  const usedPropertyValue = props.propertyKey ? getIn(props.values, props.propertyKey) : undefined;
137
- const result: Property<T> | null = propertyOrBuilder({
139
+ const result: Property<T> | null = (propertyOrBuilder as PropertyBuilder<T, M>)({
138
140
  ...props,
139
141
  path,
140
142
  propertyValue: usedPropertyValue,