@firecms/core 3.0.0-alpha.62 → 3.0.0-alpha.64

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 (40) hide show
  1. package/dist/components/HomePage/DefaultHomePage.d.ts +11 -1
  2. package/dist/index.d.ts +0 -1
  3. package/dist/index.es.js +4008 -4012
  4. package/dist/index.es.js.map +1 -1
  5. package/dist/index.umd.js +5 -5
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/preview/PropertyPreview.d.ts +2 -1
  8. package/dist/preview/PropertyPreviewProps.d.ts +1 -6
  9. package/dist/preview/property_previews/ArrayOfMapsPreview.d.ts +1 -1
  10. package/dist/preview/property_previews/ArrayOfStorageComponentsPreview.d.ts +1 -1
  11. package/dist/preview/property_previews/ArrayOfStringsPreview.d.ts +1 -1
  12. package/dist/preview/property_previews/ArrayOneOfPreview.d.ts +1 -1
  13. package/dist/preview/property_previews/ArrayPropertyPreview.d.ts +1 -1
  14. package/dist/preview/property_previews/MapPropertyPreview.d.ts +1 -1
  15. package/dist/types/navigation.d.ts +6 -1
  16. package/dist/types/plugins.d.ts +10 -0
  17. package/dist/util/navigation_utils.d.ts +2 -2
  18. package/package.json +3 -3
  19. package/src/components/EntityCollectionTable/fields/TableStorageUpload.tsx +1 -1
  20. package/src/components/EntityCollectionTable/internal/PropertyTableCell.tsx +2 -2
  21. package/src/components/EntityPreview.tsx +1 -1
  22. package/src/components/HomePage/DefaultHomePage.tsx +16 -4
  23. package/src/core/Scaffold.tsx +5 -8
  24. package/src/form/components/StorageItemPreview.tsx +1 -1
  25. package/src/form/field_bindings/ReadOnlyFieldBinding.tsx +1 -1
  26. package/src/index.ts +0 -2
  27. package/src/internal/useBuildNavigationController.tsx +21 -5
  28. package/src/preview/PropertyPreview.tsx +15 -13
  29. package/src/preview/PropertyPreviewProps.tsx +2 -2
  30. package/src/preview/components/ReferencePreview.tsx +1 -1
  31. package/src/preview/property_previews/ArrayOfMapsPreview.tsx +2 -2
  32. package/src/preview/property_previews/ArrayOfStorageComponentsPreview.tsx +2 -2
  33. package/src/preview/property_previews/ArrayOfStringsPreview.tsx +2 -2
  34. package/src/preview/property_previews/ArrayOneOfPreview.tsx +2 -2
  35. package/src/preview/property_previews/ArrayPropertyPreview.tsx +2 -2
  36. package/src/preview/property_previews/MapPropertyPreview.tsx +4 -4
  37. package/src/types/navigation.ts +7 -1
  38. package/src/types/plugins.tsx +13 -0
  39. package/src/util/join_collections.ts +5 -2
  40. package/src/util/navigation_utils.ts +5 -5
@@ -52,9 +52,12 @@ export function joinCollectionLists(targetCollections: EntityCollection[],
52
52
  }
53
53
  });
54
54
 
55
- // fetched collections that are not in the base collections
55
+ const sourceCollectionIds = updatedCollections.map(c => c.id);
56
+ // fetched collections that are not in the source collections
56
57
  const resultStoredCollections = targetCollections
57
- .filter((col) => !updatedCollections.map(c => c.id).includes(col.id))
58
+ .filter((col) => {
59
+ return !sourceCollectionIds.includes(col.id);
60
+ })
58
61
  .map((col) => {
59
62
  if (modifyCollection) {
60
63
  return applyModifyFunction(modifyCollection, col, parentPaths);
@@ -46,7 +46,7 @@ export function getLastSegment(path: string) {
46
46
  return cleanPath;
47
47
  }
48
48
 
49
- export function resolveCollectionPathAliases(path: string, allCollections: EntityCollection[]): string {
49
+ export function resolveCollectionPathIds(path: string, allCollections: EntityCollection[]): string {
50
50
 
51
51
  const cleanPath = removeInitialAndTrailingSlashes(path);
52
52
  const subpaths = cleanPath.split("/");
@@ -61,12 +61,12 @@ export function resolveCollectionPathAliases(path: string, allCollections: Entit
61
61
  }
62
62
 
63
63
  if (subpaths.length > 1) {
64
- const segmentCollection = getCollectionByPathOrAlias(resolvedAliased ?? subpaths[0], allCollections);
64
+ const segmentCollection = getCollectionByPathOrId(resolvedAliased ?? subpaths[0], allCollections);
65
65
  if (!segmentCollection?.subcollections) {
66
66
  return cleanPath;
67
67
  }
68
68
  const restOfThePath = cleanPath.split("/").slice(2).join("/");
69
- return (resolvedAliased ?? subpaths[0]) + "/" + subpaths[1] + "/" + resolveCollectionPathAliases(restOfThePath, segmentCollection.subcollections);
69
+ return (resolvedAliased ?? subpaths[0]) + "/" + subpaths[1] + "/" + resolveCollectionPathIds(restOfThePath, segmentCollection.subcollections);
70
70
  } else {
71
71
  return resolvedAliased ?? cleanPath;
72
72
  }
@@ -78,7 +78,7 @@ export function resolveCollectionPathAliases(path: string, allCollections: Entit
78
78
  * @param pathOrAlias
79
79
  * @param collections
80
80
  */
81
- export function getCollectionByPathOrAlias(pathOrAlias: string, collections: EntityCollection[]): EntityCollection | undefined {
81
+ export function getCollectionByPathOrId(pathOrAlias: string, collections: EntityCollection[]): EntityCollection | undefined {
82
82
 
83
83
  const subpaths = removeInitialAndTrailingSlashes(pathOrAlias).split("/");
84
84
  if (subpaths.length % 2 === 0) {
@@ -100,7 +100,7 @@ export function getCollectionByPathOrAlias(pathOrAlias: string, collections: Ent
100
100
  } else if (navigationEntry.subcollections) {
101
101
  const newPath = pathOrAlias.replace(subpathCombination, "").split("/").slice(2).join("/");
102
102
  if (newPath.length > 0)
103
- result = getCollectionByPathOrAlias(newPath, navigationEntry.subcollections);
103
+ result = getCollectionByPathOrId(newPath, navigationEntry.subcollections);
104
104
  }
105
105
  }
106
106
  if (result) break;