@firecms/collection_editor 3.0.0-beta.6 → 3.0.0-beta.7
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/index.es.js +887 -854
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +20 -20
- package/src/ConfigControllerProvider.tsx +24 -24
- package/src/ui/HomePageEditorCollectionAction.tsx +5 -5
- package/src/ui/NewCollectionCard.tsx +3 -3
- package/src/ui/collection_editor/CollectionDetailsForm.tsx +33 -3
- package/src/ui/collection_editor/CollectionEditorDialog.tsx +14 -14
- package/src/ui/collection_editor/CollectionEditorWelcomeView.tsx +2 -2
- package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +19 -17
- package/src/ui/collection_editor/PropertyEditView.tsx +5 -4
- package/src/ui/collection_editor/PropertyFieldPreview.tsx +3 -6
- package/src/ui/collection_editor/PropertySelectItem.tsx +2 -2
- package/src/ui/collection_editor/PropertyTree.tsx +3 -3
- package/src/ui/collection_editor/import/CollectionEditorImportDataPreview.tsx +2 -1
- package/src/ui/collection_editor/properties/BlockPropertyField.tsx +5 -5
- package/src/ui/collection_editor/properties/MapPropertyField.tsx +5 -5
- package/src/ui/collection_editor/properties/RepeatPropertyField.tsx +0 -1
- package/src/useCollectionEditorPlugin.tsx +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useState } from "react";
|
|
2
2
|
import { AddIcon, Button, Paper, Typography } from "@firecms/ui";
|
|
3
3
|
import { getIn, useFormex } from "@firecms/formex";
|
|
4
4
|
import { PropertyFormDialog } from "../PropertyEditView";
|
|
@@ -49,7 +49,7 @@ export function BlockPropertyField({
|
|
|
49
49
|
const selectedPropertyFullId = selectedPropertyKey ? getFullId(selectedPropertyKey, selectedPropertyNamespace) : undefined;
|
|
50
50
|
const selectedProperty = selectedPropertyFullId ? getIn(values.oneOf?.properties, selectedPropertyFullId.replaceAll(".", ".properties.")) : undefined;
|
|
51
51
|
|
|
52
|
-
const deleteProperty =
|
|
52
|
+
const deleteProperty = (propertyKey?: string, namespace?: string) => {
|
|
53
53
|
const fullId = propertyKey ? getFullId(propertyKey, namespace) : undefined;
|
|
54
54
|
if (!fullId)
|
|
55
55
|
throw Error("collection editor miss config");
|
|
@@ -62,7 +62,7 @@ export function BlockPropertyField({
|
|
|
62
62
|
setPropertyDialogOpen(false);
|
|
63
63
|
setSelectedPropertyKey(undefined);
|
|
64
64
|
setSelectedPropertyNamespace(undefined);
|
|
65
|
-
}
|
|
65
|
+
};
|
|
66
66
|
|
|
67
67
|
const addChildButton = <Button
|
|
68
68
|
autoFocus
|
|
@@ -74,9 +74,9 @@ export function BlockPropertyField({
|
|
|
74
74
|
Add property to {values.name ?? "this block"}
|
|
75
75
|
</Button>;
|
|
76
76
|
|
|
77
|
-
const onPropertyMove =
|
|
77
|
+
const onPropertyMove = (propertiesOrder: string[], namespace?: string) => {
|
|
78
78
|
setFieldValue(`oneOf.${namespaceToPropertiesOrderPath(namespace)}`, propertiesOrder, false);
|
|
79
|
-
}
|
|
79
|
+
};
|
|
80
80
|
|
|
81
81
|
return (
|
|
82
82
|
<>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useState } from "react";
|
|
2
2
|
import { FieldCaption, MapProperty, Property, PropertyConfig, } from "@firecms/core";
|
|
3
3
|
import { AddIcon, BooleanSwitchWithLabel, Button, Paper, Typography } from "@firecms/ui";
|
|
4
4
|
import { PropertyFormDialog } from "../PropertyEditView";
|
|
@@ -42,7 +42,7 @@ export function MapPropertyField({ disabled, getData, allowDataInference, proper
|
|
|
42
42
|
setPropertyDialogOpen(false);
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
const deleteProperty =
|
|
45
|
+
const deleteProperty = (propertyKey?: string, namespace?: string) => {
|
|
46
46
|
const fullId = propertyKey ? getFullId(propertyKey, namespace) : undefined;
|
|
47
47
|
if (!fullId)
|
|
48
48
|
throw Error("collection editor miss config");
|
|
@@ -58,16 +58,16 @@ export function MapPropertyField({ disabled, getData, allowDataInference, proper
|
|
|
58
58
|
setPropertyDialogOpen(false);
|
|
59
59
|
setSelectedPropertyKey(undefined);
|
|
60
60
|
setSelectedPropertyNamespace(undefined);
|
|
61
|
-
}
|
|
61
|
+
};
|
|
62
62
|
|
|
63
63
|
const selectedPropertyFullId = selectedPropertyKey ? getFullId(selectedPropertyKey, selectedPropertyNamespace) : undefined;
|
|
64
64
|
const selectedProperty = selectedPropertyFullId ? getIn(values.properties, selectedPropertyFullId.replaceAll(".", ".properties.")) : undefined;
|
|
65
65
|
|
|
66
66
|
const empty = !propertiesOrder || propertiesOrder.length < 1;
|
|
67
67
|
|
|
68
|
-
const onPropertyMove =
|
|
68
|
+
const onPropertyMove = (propertiesOrder: string[], namespace?: string) => {
|
|
69
69
|
setFieldValue(namespaceToPropertiesOrderPath(namespace), propertiesOrder, false);
|
|
70
|
-
}
|
|
70
|
+
};
|
|
71
71
|
|
|
72
72
|
return (
|
|
73
73
|
<>
|
|
@@ -39,7 +39,6 @@ export function RepeatPropertyField({
|
|
|
39
39
|
|
|
40
40
|
const onPropertyChanged = ({ id, property, namespace }:
|
|
41
41
|
{ id?: string, property: Property, namespace?: string }) => {
|
|
42
|
-
console.log("onPropertyChanged", id, property, namespace);
|
|
43
42
|
setFieldValue("of", property);
|
|
44
43
|
};
|
|
45
44
|
|
|
@@ -125,7 +125,7 @@ export function IntroWidget({}: {}) {
|
|
|
125
125
|
}).createCollections
|
|
126
126
|
: true;
|
|
127
127
|
|
|
128
|
-
if (!navigation.initialised ||
|
|
128
|
+
if (!navigation.initialised || (navigation.collections ?? []).length > 0) {
|
|
129
129
|
return null;
|
|
130
130
|
}
|
|
131
131
|
|