@firecms/collection_editor 3.0.0-alpha.5 → 3.0.0-alpha.50

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 (140) hide show
  1. package/dist/ConfigControllerProvider.d.ts +36 -0
  2. package/dist/index.d.ts +11 -0
  3. package/dist/index.es.js +6998 -0
  4. package/dist/index.es.js.map +1 -0
  5. package/dist/index.umd.js +4 -0
  6. package/dist/index.umd.js.map +1 -0
  7. package/dist/types/collection_editor_controller.d.ts +35 -0
  8. package/dist/types/collection_inference.d.ts +2 -0
  9. package/dist/types/config_controller.d.ts +41 -0
  10. package/dist/types/config_permissions.d.ts +19 -0
  11. package/dist/types/persisted_collection.d.ts +6 -0
  12. package/dist/ui/CollectionViewHeaderAction.d.ts +10 -0
  13. package/dist/ui/EditorCollectionAction.d.ts +2 -0
  14. package/dist/ui/HomePageEditorCollectionAction.d.ts +2 -0
  15. package/dist/ui/MissingReferenceWidget.d.ts +3 -0
  16. package/dist/ui/NewCollectionCard.d.ts +2 -0
  17. package/dist/ui/PropertyAddColumnComponent.d.ts +6 -0
  18. package/dist/ui/RootCollectionSuggestions.d.ts +1 -0
  19. package/dist/ui/collection_editor/CollectionDetailsForm.d.ts +9 -0
  20. package/dist/ui/collection_editor/CollectionEditorDialog.d.ts +38 -0
  21. package/dist/ui/collection_editor/CollectionEditorWelcomeView.d.ts +15 -0
  22. package/dist/ui/collection_editor/CollectionPropertiesEditorForm.d.ts +20 -0
  23. package/dist/ui/collection_editor/CollectionYupValidation.d.ts +14 -0
  24. package/dist/ui/collection_editor/EntityCustomViewsSelectDialog.d.ts +4 -0
  25. package/dist/ui/collection_editor/EnumForm.d.ts +13 -0
  26. package/dist/ui/collection_editor/GetCodeDialog.d.ts +5 -0
  27. package/dist/ui/collection_editor/PropertyEditView.d.ts +40 -0
  28. package/dist/ui/collection_editor/PropertyFieldPreview.d.ts +15 -0
  29. package/dist/ui/collection_editor/PropertySelectItem.d.ts +8 -0
  30. package/dist/ui/collection_editor/PropertyTree.d.ts +32 -0
  31. package/dist/ui/collection_editor/SelectIcons.d.ts +6 -0
  32. package/dist/ui/collection_editor/SubcollectionsEditTab.d.ts +12 -0
  33. package/dist/ui/collection_editor/UnsavedChangesDialog.d.ts +9 -0
  34. package/dist/ui/collection_editor/import/CollectionEditorImportDataPreview.d.ts +7 -0
  35. package/dist/ui/collection_editor/import/CollectionEditorImportMapping.d.ts +7 -0
  36. package/dist/ui/collection_editor/import/clean_import_data.d.ts +7 -0
  37. package/dist/ui/collection_editor/properties/BlockPropertyField.d.ts +8 -0
  38. package/dist/ui/collection_editor/properties/BooleanPropertyField.d.ts +3 -0
  39. package/dist/ui/collection_editor/properties/CommonPropertyFields.d.ts +10 -0
  40. package/dist/ui/collection_editor/properties/DateTimePropertyField.d.ts +3 -0
  41. package/dist/ui/collection_editor/properties/EnumPropertyField.d.ts +8 -0
  42. package/dist/ui/collection_editor/properties/FieldHelperView.d.ts +4 -0
  43. package/dist/ui/collection_editor/properties/KeyValuePropertyField.d.ts +3 -0
  44. package/dist/ui/collection_editor/properties/MapPropertyField.d.ts +8 -0
  45. package/dist/ui/collection_editor/properties/NumberPropertyField.d.ts +3 -0
  46. package/dist/ui/collection_editor/properties/ReferencePropertyField.d.ts +13 -0
  47. package/dist/ui/collection_editor/properties/RepeatPropertyField.d.ts +10 -0
  48. package/dist/ui/collection_editor/properties/StoragePropertyField.d.ts +5 -0
  49. package/dist/ui/collection_editor/properties/StringPropertyField.d.ts +5 -0
  50. package/dist/ui/collection_editor/properties/UrlPropertyField.d.ts +4 -0
  51. package/dist/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.d.ts +3 -0
  52. package/dist/ui/collection_editor/properties/validation/ArrayPropertyValidation.d.ts +5 -0
  53. package/dist/ui/collection_editor/properties/validation/GeneralPropertyValidation.d.ts +4 -0
  54. package/dist/ui/collection_editor/properties/validation/NumberPropertyValidation.d.ts +3 -0
  55. package/dist/ui/collection_editor/properties/validation/StringPropertyValidation.d.ts +11 -0
  56. package/dist/ui/collection_editor/properties/validation/ValidationPanel.d.ts +2 -0
  57. package/dist/ui/collection_editor/templates/blog_template.d.ts +2 -0
  58. package/dist/ui/collection_editor/templates/products_template.d.ts +2 -0
  59. package/dist/ui/collection_editor/templates/users_template.d.ts +2 -0
  60. package/dist/ui/collection_editor/util.d.ts +4 -0
  61. package/dist/ui/collection_editor/utils/strings.d.ts +1 -0
  62. package/dist/ui/collection_editor/utils/supported_fields.d.ts +3 -0
  63. package/dist/ui/collection_editor/utils/update_property_for_widget.d.ts +2 -0
  64. package/dist/ui/collection_editor/utils/useTraceUpdate.d.ts +1 -0
  65. package/dist/useCollectionEditorController.d.ts +6 -0
  66. package/dist/useCollectionEditorPlugin.d.ts +45 -0
  67. package/dist/useCollectionsConfigController.d.ts +6 -0
  68. package/dist/utils/arrays.d.ts +1 -0
  69. package/dist/utils/entities.d.ts +3 -0
  70. package/dist/utils/icons.d.ts +1 -0
  71. package/dist/utils/synonyms.d.ts +1951 -0
  72. package/package.json +26 -23
  73. package/src/ConfigControllerProvider.tsx +321 -0
  74. package/src/index.ts +35 -0
  75. package/src/types/collection_editor_controller.tsx +42 -0
  76. package/src/types/collection_inference.ts +3 -0
  77. package/src/types/config_controller.tsx +50 -0
  78. package/src/types/config_permissions.ts +20 -0
  79. package/src/types/persisted_collection.ts +9 -0
  80. package/src/ui/CollectionViewHeaderAction.tsx +42 -0
  81. package/src/ui/EditorCollectionAction.tsx +95 -0
  82. package/src/ui/HomePageEditorCollectionAction.tsx +88 -0
  83. package/src/ui/MissingReferenceWidget.tsx +34 -0
  84. package/src/ui/NewCollectionCard.tsx +46 -0
  85. package/src/ui/PropertyAddColumnComponent.tsx +41 -0
  86. package/src/ui/RootCollectionSuggestions.tsx +62 -0
  87. package/src/ui/collection_editor/CollectionDetailsForm.tsx +353 -0
  88. package/src/ui/collection_editor/CollectionEditorDialog.tsx +744 -0
  89. package/src/ui/collection_editor/CollectionEditorWelcomeView.tsx +212 -0
  90. package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +480 -0
  91. package/src/ui/collection_editor/CollectionYupValidation.tsx +7 -0
  92. package/src/ui/collection_editor/EntityCustomViewsSelectDialog.tsx +36 -0
  93. package/src/ui/collection_editor/EnumForm.tsx +356 -0
  94. package/src/ui/collection_editor/GetCodeDialog.tsx +118 -0
  95. package/src/ui/collection_editor/PropertyEditView.tsx +564 -0
  96. package/src/ui/collection_editor/PropertyFieldPreview.tsx +201 -0
  97. package/src/ui/collection_editor/PropertySelectItem.tsx +31 -0
  98. package/src/ui/collection_editor/PropertyTree.tsx +238 -0
  99. package/src/ui/collection_editor/SelectIcons.tsx +72 -0
  100. package/src/ui/collection_editor/SubcollectionsEditTab.tsx +252 -0
  101. package/src/ui/collection_editor/UnsavedChangesDialog.tsx +47 -0
  102. package/src/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +37 -0
  103. package/src/ui/collection_editor/import/CollectionEditorImportMapping.tsx +275 -0
  104. package/src/ui/collection_editor/import/clean_import_data.ts +53 -0
  105. package/src/ui/collection_editor/properties/BlockPropertyField.tsx +134 -0
  106. package/src/ui/collection_editor/properties/BooleanPropertyField.tsx +36 -0
  107. package/src/ui/collection_editor/properties/CommonPropertyFields.tsx +111 -0
  108. package/src/ui/collection_editor/properties/DateTimePropertyField.tsx +86 -0
  109. package/src/ui/collection_editor/properties/EnumPropertyField.tsx +116 -0
  110. package/src/ui/collection_editor/properties/FieldHelperView.tsx +13 -0
  111. package/src/ui/collection_editor/properties/KeyValuePropertyField.tsx +20 -0
  112. package/src/ui/collection_editor/properties/MapPropertyField.tsx +157 -0
  113. package/src/ui/collection_editor/properties/NumberPropertyField.tsx +38 -0
  114. package/src/ui/collection_editor/properties/ReferencePropertyField.tsx +184 -0
  115. package/src/ui/collection_editor/properties/RepeatPropertyField.tsx +107 -0
  116. package/src/ui/collection_editor/properties/StoragePropertyField.tsx +194 -0
  117. package/src/ui/collection_editor/properties/StringPropertyField.tsx +79 -0
  118. package/src/ui/collection_editor/properties/UrlPropertyField.tsx +89 -0
  119. package/src/ui/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +36 -0
  120. package/src/ui/collection_editor/properties/validation/ArrayPropertyValidation.tsx +50 -0
  121. package/src/ui/collection_editor/properties/validation/GeneralPropertyValidation.tsx +49 -0
  122. package/src/ui/collection_editor/properties/validation/NumberPropertyValidation.tsx +99 -0
  123. package/src/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +131 -0
  124. package/src/ui/collection_editor/properties/validation/ValidationPanel.tsx +28 -0
  125. package/src/ui/collection_editor/templates/blog_template.ts +115 -0
  126. package/src/ui/collection_editor/templates/products_template.ts +88 -0
  127. package/src/ui/collection_editor/templates/users_template.ts +34 -0
  128. package/src/ui/collection_editor/util.ts +21 -0
  129. package/src/ui/collection_editor/utils/strings.ts +8 -0
  130. package/src/ui/collection_editor/utils/supported_fields.tsx +28 -0
  131. package/src/ui/collection_editor/utils/update_property_for_widget.ts +271 -0
  132. package/src/ui/collection_editor/utils/useTraceUpdate.tsx +23 -0
  133. package/src/useCollectionEditorController.tsx +9 -0
  134. package/src/useCollectionEditorPlugin.tsx +128 -0
  135. package/src/useCollectionsConfigController.tsx +9 -0
  136. package/src/utils/arrays.ts +3 -0
  137. package/src/utils/entities.ts +38 -0
  138. package/src/utils/icons.ts +17 -0
  139. package/src/utils/synonyms.ts +1952 -0
  140. package/src/vite-env.d.ts +1 -0
@@ -0,0 +1,95 @@
1
+ import equal from "react-fast-compare"
2
+
3
+ import {
4
+ Button,
5
+ CollectionActionsProps,
6
+ IconButton,
7
+ mergeDeep,
8
+ SaveIcon,
9
+ SettingsIcon,
10
+ Tooltip,
11
+ useAuthController,
12
+ useNavigationController,
13
+ useSnackbarController
14
+ } from "@firecms/core";
15
+
16
+ import { useCollectionEditorController } from "../useCollectionEditorController";
17
+ import { useCollectionsConfigController } from "../useCollectionsConfigController";
18
+ import { PersistedCollection } from "../types/persisted_collection";
19
+
20
+ export function EditorCollectionAction({
21
+ path: fullPath,
22
+ parentCollectionIds,
23
+ collection,
24
+ tableController
25
+ }: CollectionActionsProps) {
26
+
27
+ const authController = useAuthController();
28
+ const navigationController = useNavigationController();
29
+ const collectionEditorController = useCollectionEditorController();
30
+ const configController = useCollectionsConfigController();
31
+ const snackbarController = useSnackbarController();
32
+
33
+ const parentCollection = navigationController.getCollectionFromIds(parentCollectionIds);
34
+
35
+ const canEditCollection = collectionEditorController.configPermissions
36
+ ? collectionEditorController.configPermissions({
37
+ user: authController.user,
38
+ collection
39
+ }).editCollections
40
+ : true;
41
+
42
+ let saveDefaultFilterButton = null;
43
+ if (!equal(getObjectOrNull(tableController.filterValues), getObjectOrNull(collection.initialFilter)) ||
44
+ !equal(getObjectOrNull(tableController.sortBy), getObjectOrNull(collection.initialSort))) {
45
+ saveDefaultFilterButton = <Tooltip
46
+ title={tableController.sortBy || tableController.filterValues ? "Save default filter and sort" : "Clear default filter and sort"}>
47
+ <Button
48
+ color={"primary"}
49
+ size={"small"}
50
+ variant={"outlined"}
51
+ onClick={() => configController
52
+ ?.saveCollection({
53
+ id: collection.path,
54
+ parentCollectionIds,
55
+ collectionData: mergeDeep(collection as PersistedCollection,
56
+ {
57
+ initialFilter: tableController.filterValues ?? null,
58
+ initialSort: tableController.sortBy ?? null
59
+ })
60
+ }).then(() => {
61
+ snackbarController.open({
62
+ type: "success",
63
+ message: "Default config saved"
64
+ });
65
+ })}>
66
+ <SaveIcon/>
67
+ {/*{tableController.sortBy || tableController.filterValues ? "Save default filter and sort" : "Clear default filter and sort"}*/}
68
+ </Button>
69
+ </Tooltip>;
70
+ }
71
+
72
+ const editorButton = <Tooltip
73
+ title={canEditCollection ? "Edit collection" : "You don't have permissions to edit this collection"}>
74
+ <IconButton
75
+ color={"primary"}
76
+ disabled={!canEditCollection}
77
+ onClick={canEditCollection
78
+ ? () => collectionEditorController?.editCollection({ path: collection.path, fullPath, parentCollectionIds, parentCollection: parentCollection as PersistedCollection })
79
+ : undefined}>
80
+ <SettingsIcon/>
81
+ </IconButton>
82
+ </Tooltip>;
83
+
84
+ return <>
85
+ {canEditCollection && saveDefaultFilterButton}
86
+ {editorButton}
87
+ </>
88
+
89
+ }
90
+
91
+ function getObjectOrNull(o?: object): object | null {
92
+ if (o && Object.keys(o).length === 0)
93
+ return o
94
+ return o ?? null;
95
+ }
@@ -0,0 +1,88 @@
1
+ import {
2
+ DeleteConfirmationDialog,
3
+ DeleteIcon,
4
+ IconButton,
5
+ Menu,
6
+ MenuItem,
7
+ MoreVertIcon,
8
+ PluginHomePageActionsProps,
9
+ SettingsIcon,
10
+ useAuthController, useSnackbarController
11
+ } from "@firecms/core";
12
+ import { useCollectionEditorController } from "../useCollectionEditorController";
13
+ import { useCallback, useState } from "react";
14
+ import { useCollectionsConfigController } from "../useCollectionsConfigController";
15
+
16
+ export function HomePageEditorCollectionAction({
17
+ path,
18
+ collection
19
+ }: PluginHomePageActionsProps) {
20
+
21
+ const snackbarController = useSnackbarController();
22
+ const authController = useAuthController();
23
+ const configController = useCollectionsConfigController();
24
+ const collectionEditorController = useCollectionEditorController();
25
+
26
+ const permissions = collectionEditorController.configPermissions({
27
+ user: authController.user,
28
+ collection
29
+ });
30
+
31
+ const onEditCollectionClicked = useCallback(() => {
32
+ collectionEditorController?.editCollection({ path, parentCollectionIds: [] });
33
+ }, [collectionEditorController, path]);
34
+
35
+ const [deleteRequested, setDeleteRequested] = useState(false);
36
+
37
+ const deleteCollection = useCallback(() => {
38
+ configController?.deleteCollection({ path }).then(() => {
39
+ setDeleteRequested(false);
40
+ snackbarController.open({
41
+ message: "Collection deleted",
42
+ type: "success"
43
+ });
44
+ });
45
+ }, [path, configController]);
46
+
47
+ return <>
48
+
49
+ <div>
50
+ {permissions.deleteCollections &&
51
+ <Menu
52
+ trigger={<IconButton>
53
+ <MoreVertIcon size={"small"}/>
54
+ </IconButton>}
55
+ >
56
+ <MenuItem onClick={(event) => {
57
+ event.preventDefault();
58
+ event.stopPropagation();
59
+ setDeleteRequested(true);
60
+ }}>
61
+ <DeleteIcon/>
62
+ Delete
63
+ </MenuItem>
64
+
65
+ </Menu>
66
+
67
+ }
68
+
69
+ {permissions.editCollections &&
70
+ <IconButton
71
+ onClick={(event) => {
72
+ onEditCollectionClicked();
73
+ }}>
74
+ <SettingsIcon size={"small"}/>
75
+ </IconButton>}
76
+ </div>
77
+
78
+ <DeleteConfirmationDialog
79
+ open={deleteRequested}
80
+ onAccept={deleteCollection}
81
+ onCancel={() => setDeleteRequested(false)}
82
+ title={<>Delete this collection?</>}
83
+ body={<> This will <b>not
84
+ delete any data</b>, only
85
+ the collection in the CMS</>}/>
86
+ </>;
87
+
88
+ }
@@ -0,0 +1,34 @@
1
+ import { Button, ErrorView, unslugify, useNavigationController } from "@firecms/core";
2
+ import { useCollectionEditorController } from "../useCollectionEditorController";
3
+
4
+ export function MissingReferenceWidget({ path: pathProp }: {
5
+ path: string
6
+ }) {
7
+ const navigation = useNavigationController();
8
+ const path = getLastSegment(pathProp);
9
+ const parentCollectionIds = navigation.getParentCollectionIds(pathProp);
10
+ const collectionEditor = useCollectionEditorController();
11
+ return <div className={"p-1 flex flex-col items-center"}>
12
+ <ErrorView error={"No collection for path: " + path}/>
13
+ <Button className={"mx-2"} variant={"outlined"} size={"small"}
14
+ onClick={() => {
15
+ collectionEditor.createCollection({
16
+ initialValues: { path, name: unslugify(path) },
17
+ parentCollectionIds,
18
+ redirect: false
19
+ });
20
+ }}>
21
+ Create
22
+ </Button>
23
+ </div>;
24
+ }
25
+
26
+ function getParentPathSegments(path: string): string[] {
27
+ const segments = path.split("/");
28
+ return segments.filter((segment, index) => index % 2 === 0 && index !== segments.length - 1);
29
+ }
30
+
31
+ function getLastSegment(path: string): string {
32
+ const segments = path.split("/");
33
+ return segments[segments.length - 1];
34
+ }
@@ -0,0 +1,46 @@
1
+ import { AddIcon, Card, cn, PluginHomePageAdditionalCardsProps, Typography, useAuthController } from "@firecms/core";
2
+ import { useCollectionEditorController } from "../useCollectionEditorController";
3
+
4
+ export function NewCollectionCard({
5
+ group,
6
+ context
7
+ }: PluginHomePageAdditionalCardsProps) {
8
+
9
+ if (!context.navigation.topLevelNavigation)
10
+ throw Error("Navigation not ready in FireCMSHomePage");
11
+
12
+ const authController = useAuthController();
13
+
14
+ const collectionEditorController = useCollectionEditorController();
15
+ const canCreateCollections = collectionEditorController.configPermissions
16
+ ? collectionEditorController.configPermissions({
17
+ user: authController.user,
18
+ }).createCollections
19
+ : true;
20
+
21
+ return (
22
+ <Card className={cn("h-full p-4 min-h-[124px]")}
23
+ onClick={collectionEditorController && canCreateCollections
24
+ ? () => collectionEditorController.createCollection({
25
+ initialValues: group ? { group } : undefined,
26
+ parentCollectionIds: [],
27
+ redirect: true
28
+ })
29
+ : undefined}>
30
+
31
+ <div
32
+ className="flex flex-col items-start h-full w-full items-center justify-center h-full w-full flex-grow flex-col">
33
+ <AddIcon color="primary" size={"large"}/>
34
+ <Typography color="primary"
35
+ variant={"caption"}
36
+ className={"font-medium"}>{"Add new collection".toUpperCase()}</Typography>
37
+
38
+ {!canCreateCollections &&
39
+ <Typography variant={"caption"}>You don&apos;t have permissions to create
40
+ collections</Typography>
41
+ }
42
+ </div>
43
+
44
+ </Card>
45
+ );
46
+ }
@@ -0,0 +1,41 @@
1
+ import { AddIcon, getDefaultPropertiesOrder, Tooltip, useAuthController } from "@firecms/core";
2
+ import { useCollectionEditorController } from "../useCollectionEditorController";
3
+ import { PersistedCollection } from "../types/persisted_collection";
4
+
5
+ export function PropertyAddColumnComponent({
6
+ fullPath,
7
+ parentCollectionIds,
8
+ collection
9
+ }: {
10
+ fullPath: string,
11
+ parentCollectionIds: string[],
12
+ collection: PersistedCollection;
13
+ }) {
14
+
15
+ const authController = useAuthController();
16
+ const collectionEditorController = useCollectionEditorController();
17
+ const canEditCollection = collectionEditorController.configPermissions
18
+ ? collectionEditorController.configPermissions({
19
+ user: authController.user,
20
+ collection
21
+ }).editCollections
22
+ : true;
23
+
24
+ return (
25
+ <Tooltip title={canEditCollection ? "Add new property" : "You don't have permission to add new properties"}>
26
+ <div
27
+ className={"p-0.5 w-20 h-full flex items-center justify-center cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-950"}
28
+ // className={onHover ? "bg-white dark:bg-gray-950" : undefined}
29
+ onClick={() => {
30
+ collectionEditorController.editProperty({
31
+ editedCollectionPath: fullPath,
32
+ parentCollectionIds,
33
+ currentPropertiesOrder: getDefaultPropertiesOrder(collection),
34
+ collection
35
+ });
36
+ }}>
37
+ <AddIcon color={"inherit"}/>
38
+ </div>
39
+ </Tooltip>
40
+ )
41
+ }
@@ -0,0 +1,62 @@
1
+ import {
2
+ AddIcon,
3
+ Chip,
4
+ Collapse,
5
+ Typography,
6
+ unslugify,
7
+ useAuthController,
8
+ useNavigationController
9
+ } from "@firecms/core";
10
+ import { useCollectionEditorController } from "../useCollectionEditorController";
11
+ import React from "react";
12
+
13
+ export function RootCollectionSuggestions() {
14
+
15
+ const authController = useAuthController();
16
+ const navigationController = useNavigationController();
17
+
18
+ const collectionEditorController = useCollectionEditorController();
19
+ const canCreateCollections = collectionEditorController.configPermissions
20
+ ? collectionEditorController.configPermissions({
21
+ user: authController.user
22
+ }).createCollections
23
+ : true;
24
+
25
+ const rootPathSuggestions = collectionEditorController.rootPathSuggestions ?? [];
26
+
27
+ const showSuggestions = rootPathSuggestions.length > 3 || (navigationController.collections.length === 0 && rootPathSuggestions.length > 0);
28
+ return <Collapse
29
+ in={showSuggestions}>
30
+
31
+ <div
32
+ className={"flex flex-col gap-1 p-2 my-4"}>
33
+
34
+ <Typography variant={"body2"} color={"secondary"}>
35
+ Create a collection from your data:
36
+ </Typography>
37
+
38
+ <div
39
+ className={"flex flex-row gap-1 overflow-scroll no-scrollbar "}>
40
+ {rootPathSuggestions.map((path) => {
41
+ return (
42
+ <div key={path}>
43
+ <Chip
44
+ icon={<AddIcon size={"small"}/>}
45
+ colorScheme={"cyanLighter"}
46
+ onClick={collectionEditorController && canCreateCollections
47
+ ? () => collectionEditorController.createCollection({
48
+ initialValues: { path, name: unslugify(path) },
49
+ parentCollectionIds: [],
50
+ redirect: true
51
+ })
52
+ : undefined}
53
+ size="small">
54
+ {path}
55
+ </Chip>
56
+ </div>
57
+ );
58
+ })}
59
+ </div>
60
+ </div>
61
+ </Collapse>
62
+ }