@firecms/collection_editor 3.0.0-alpha.15 → 3.0.0-alpha.17
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/ConfigControllerProvider.d.ts +1 -1
- package/dist/components/RootCollectionSuggestions.d.ts +1 -0
- package/dist/components/collection_editor/CollectionEditorDialog.d.ts +7 -3
- package/dist/components/collection_editor/CollectionPropertiesEditorForm.d.ts +5 -3
- package/dist/components/collection_editor/EntityCustomViewsSelectDialog.d.ts +4 -0
- package/dist/components/collection_editor/PropertyEditView.d.ts +5 -4
- package/dist/components/collection_editor/PropertyFieldPreview.d.ts +4 -3
- package/dist/components/collection_editor/PropertySelectItem.d.ts +2 -2
- package/dist/components/collection_editor/PropertyTree.d.ts +6 -5
- package/dist/components/collection_editor/import/CollectionEditorImportMapping.d.ts +3 -1
- package/dist/components/collection_editor/properties/BlockPropertyField.d.ts +3 -1
- package/dist/components/collection_editor/properties/MapPropertyField.d.ts +3 -1
- package/dist/components/collection_editor/properties/RepeatPropertyField.d.ts +3 -1
- package/dist/components/collection_editor/utils/update_property_for_widget.d.ts +2 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.es.js +2221 -1889
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/types/collection_editor_controller.d.ts +6 -1
- package/dist/types/config_controller.d.ts +2 -2
- package/dist/types/persisted_collection.d.ts +3 -2
- package/dist/utils/entities.d.ts +3 -4
- package/dist/utils/icons.d.ts +1 -2
- package/dist/utils/join_collections.d.ts +14 -0
- package/package.json +8 -4
- package/dist/types/editable_properties.d.ts +0 -10
|
@@ -29,7 +29,7 @@ export interface ConfigControllerProviderProps {
|
|
|
29
29
|
}>;
|
|
30
30
|
icon: React.ReactNode;
|
|
31
31
|
};
|
|
32
|
-
pathSuggestions?: (path
|
|
32
|
+
pathSuggestions?: (path?: string) => Promise<string[]>;
|
|
33
33
|
getUser: (uid: string) => User | null;
|
|
34
34
|
getData?: (path: string) => Promise<object[]>;
|
|
35
35
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function RootCollectionSuggestions(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,7 +5,11 @@ import { CollectionInference } from "../../types/collection_inference";
|
|
|
5
5
|
export interface CollectionEditorDialogProps {
|
|
6
6
|
open: boolean;
|
|
7
7
|
isNewCollection: boolean;
|
|
8
|
-
|
|
8
|
+
initialValues?: {
|
|
9
|
+
group?: string;
|
|
10
|
+
path?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
};
|
|
9
13
|
editedCollectionPath?: string;
|
|
10
14
|
fullPath?: string;
|
|
11
15
|
parentPathSegments?: string[];
|
|
@@ -19,7 +23,7 @@ export interface CollectionEditorDialogProps {
|
|
|
19
23
|
}>;
|
|
20
24
|
icon: React.ReactNode;
|
|
21
25
|
};
|
|
22
|
-
pathSuggestions?: (path
|
|
26
|
+
pathSuggestions?: (path?: string) => Promise<string[]>;
|
|
23
27
|
getUser: (uid: string) => User | null;
|
|
24
28
|
getData?: (path: string) => Promise<object[]>;
|
|
25
29
|
parentCollection?: EntityCollection;
|
|
@@ -27,7 +31,7 @@ export interface CollectionEditorDialogProps {
|
|
|
27
31
|
export declare function CollectionEditorDialog(props: CollectionEditorDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
28
32
|
export declare function CollectionEditorDialogInternal<M extends {
|
|
29
33
|
[Key: string]: CMSType;
|
|
30
|
-
}>({ isNewCollection,
|
|
34
|
+
}>({ isNewCollection, initialValues: initialValuesProp, configController, editedCollectionPath, parentPathSegments, fullPath, collectionInference, handleClose, reservedGroups, extraView, handleCancel, setFormDirty, pathSuggestions, getUser, parentCollection, getData }: CollectionEditorDialogProps & {
|
|
31
35
|
handleCancel: () => void;
|
|
32
36
|
setFormDirty: (dirty: boolean) => void;
|
|
33
37
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FormikErrors } from "formik";
|
|
3
|
-
import { EntityCollection, User } from "@firecms/core";
|
|
3
|
+
import { EntityCollection, FieldConfig, User } from "@firecms/core";
|
|
4
|
+
import { PersistedCollection } from "../../types/persisted_collection";
|
|
4
5
|
type CollectionEditorFormProps = {
|
|
5
6
|
showErrors: boolean;
|
|
6
7
|
isNewCollection: boolean;
|
|
@@ -11,7 +12,8 @@ type CollectionEditorFormProps = {
|
|
|
11
12
|
extraIcon: React.ReactNode;
|
|
12
13
|
getUser: (uid: string) => User | null;
|
|
13
14
|
getData?: () => Promise<object[]>;
|
|
14
|
-
doCollectionInference: (collection:
|
|
15
|
+
doCollectionInference: (collection: PersistedCollection<any, string>) => Promise<EntityCollection | null> | undefined;
|
|
16
|
+
customFields: Record<string, FieldConfig>;
|
|
15
17
|
};
|
|
16
|
-
export declare function CollectionPropertiesEditorForm({ showErrors, isNewCollection, propertyErrorsRef, onPropertyError, setDirty, reservedGroups, extraIcon, getUser, getData, doCollectionInference }: CollectionEditorFormProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function CollectionPropertiesEditorForm({ showErrors, isNewCollection, propertyErrorsRef, onPropertyError, setDirty, reservedGroups, extraIcon, getUser, getData, doCollectionInference, customFields }: CollectionEditorFormProps): import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FormikErrors, FormikProps } from "formik";
|
|
3
|
-
import {
|
|
4
|
-
export type PropertyWithId =
|
|
3
|
+
import { FieldConfig, Property } from "@firecms/core";
|
|
4
|
+
export type PropertyWithId = Property & {
|
|
5
5
|
id?: string;
|
|
6
6
|
};
|
|
7
7
|
export type OnPropertyChangedParams = {
|
|
8
8
|
id?: string;
|
|
9
|
-
property:
|
|
9
|
+
property: Property;
|
|
10
10
|
namespace?: string;
|
|
11
11
|
previousId?: string;
|
|
12
12
|
};
|
|
@@ -18,7 +18,7 @@ export type PropertyFormProps = {
|
|
|
18
18
|
inArray: boolean;
|
|
19
19
|
propertyKey?: string;
|
|
20
20
|
propertyNamespace?: string;
|
|
21
|
-
property?:
|
|
21
|
+
property?: Property;
|
|
22
22
|
onPropertyChanged?: (params: OnPropertyChangedParams) => void;
|
|
23
23
|
onPropertyChangedImmediate?: boolean;
|
|
24
24
|
onDelete?: (id?: string, namespace?: string) => void;
|
|
@@ -29,6 +29,7 @@ export type PropertyFormProps = {
|
|
|
29
29
|
allowDataInference: boolean;
|
|
30
30
|
getData?: () => Promise<object[]>;
|
|
31
31
|
getHelpers?: (formikProps: FormikProps<PropertyWithId>) => void;
|
|
32
|
+
customFields: Record<string, FieldConfig>;
|
|
32
33
|
};
|
|
33
34
|
export declare const PropertyForm: React.NamedExoticComponent<PropertyFormProps>;
|
|
34
35
|
export declare function PropertyFormDialog({ open, onCancel, onOkClicked, onPropertyChanged, getData, ...formProps }: PropertyFormProps & {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Property, PropertyOrBuilder } from "@firecms/core";
|
|
2
2
|
export declare function PropertyFieldPreview({ property, onClick, hasError, includeName, includeEditButton, selected }: {
|
|
3
|
-
property:
|
|
3
|
+
property: Property;
|
|
4
4
|
hasError?: boolean;
|
|
5
5
|
selected?: boolean;
|
|
6
6
|
includeName?: boolean;
|
|
7
7
|
includeEditButton?: boolean;
|
|
8
8
|
onClick?: () => void;
|
|
9
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function NonEditablePropertyPreview({ name, selected, onClick, property }: {
|
|
11
11
|
name: string;
|
|
12
12
|
selected: boolean;
|
|
13
13
|
onClick?: () => void;
|
|
14
|
+
property?: PropertyOrBuilder;
|
|
14
15
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { FieldConfig } from "@firecms/core";
|
|
|
2
2
|
export interface PropertySelectItemProps {
|
|
3
3
|
value: string;
|
|
4
4
|
optionDisabled: boolean;
|
|
5
|
-
|
|
5
|
+
fieldConfig: FieldConfig;
|
|
6
6
|
existing: boolean;
|
|
7
7
|
}
|
|
8
|
-
export declare function PropertySelectItem({ value, optionDisabled,
|
|
8
|
+
export declare function PropertySelectItem({ value, optionDisabled, fieldConfig, existing }: PropertySelectItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { CMSType, PropertiesOrBuilders } from "@firecms/core";
|
|
1
|
+
import { AdditionalFieldDelegate, CMSType, PropertiesOrBuilders, PropertyOrBuilder } from "@firecms/core";
|
|
2
2
|
import { DraggableProvided } from "@hello-pangea/dnd";
|
|
3
|
-
import { EditablePropertyOrBuilder } from "../../types/editable_properties";
|
|
4
3
|
export declare function PropertyTree<M extends {
|
|
5
4
|
[Key: string]: CMSType;
|
|
6
|
-
}>({ namespace, selectedPropertyKey, onPropertyClick, properties, propertiesOrder: propertiesOrderProp, errors, onPropertyMove, onPropertyRemove, className, inferredPropertyKeys }: {
|
|
5
|
+
}>({ namespace, selectedPropertyKey, onPropertyClick, properties, propertiesOrder: propertiesOrderProp, additionalFields, errors, onPropertyMove, onPropertyRemove, className, inferredPropertyKeys }: {
|
|
7
6
|
namespace?: string;
|
|
8
7
|
selectedPropertyKey?: string;
|
|
9
8
|
onPropertyClick?: (propertyKey: string, namespace?: string) => void;
|
|
10
9
|
properties: PropertiesOrBuilders<M>;
|
|
11
10
|
propertiesOrder?: string[];
|
|
11
|
+
additionalFields?: AdditionalFieldDelegate<M>[];
|
|
12
12
|
errors: Record<string, any>;
|
|
13
13
|
onPropertyMove?: (propertiesOrder: string[], namespace?: string) => void;
|
|
14
14
|
onPropertyRemove?: (propertyKey: string, namespace?: string) => void;
|
|
15
15
|
className?: string;
|
|
16
16
|
inferredPropertyKeys?: string[];
|
|
17
17
|
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export declare function PropertyTreeEntry({ propertyKey, namespace, propertyOrBuilder, provided, selectedPropertyKey, errors, onPropertyClick, onPropertyMove, onPropertyRemove, inferredPropertyKeys }: {
|
|
18
|
+
export declare function PropertyTreeEntry({ propertyKey, namespace, propertyOrBuilder, additionalField, provided, selectedPropertyKey, errors, onPropertyClick, onPropertyMove, onPropertyRemove, inferredPropertyKeys }: {
|
|
19
19
|
propertyKey: string;
|
|
20
20
|
namespace?: string;
|
|
21
|
-
propertyOrBuilder:
|
|
21
|
+
propertyOrBuilder: PropertyOrBuilder;
|
|
22
|
+
additionalField?: AdditionalFieldDelegate<any>;
|
|
22
23
|
selectedPropertyKey?: string;
|
|
23
24
|
provided: DraggableProvided;
|
|
24
25
|
errors: Record<string, any>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ImportConfig } from "@firecms/data_import";
|
|
2
|
-
|
|
2
|
+
import { FieldConfig } from "@firecms/core";
|
|
3
|
+
export declare function CollectionEditorImportMapping({ importConfig, customFields }: {
|
|
3
4
|
importConfig: ImportConfig;
|
|
5
|
+
customFields: Record<string, FieldConfig>;
|
|
4
6
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { FieldConfig } from "@firecms/core";
|
|
2
|
+
export declare function BlockPropertyField({ disabled, getData, allowDataInference, customFields }: {
|
|
2
3
|
disabled: boolean;
|
|
3
4
|
getData?: () => Promise<object[]>;
|
|
4
5
|
allowDataInference: boolean;
|
|
6
|
+
customFields: Record<string, FieldConfig>;
|
|
5
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { FieldConfig } from "@firecms/core";
|
|
2
|
+
export declare function MapPropertyField({ disabled, getData, allowDataInference, customFields }: {
|
|
2
3
|
disabled: boolean;
|
|
3
4
|
getData?: () => Promise<object[]>;
|
|
4
5
|
allowDataInference: boolean;
|
|
6
|
+
customFields: Record<string, FieldConfig>;
|
|
5
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { FieldConfig } from "@firecms/core";
|
|
2
|
+
export declare function RepeatPropertyField({ showErrors, existing, disabled, getData, allowDataInference, customFields }: {
|
|
2
3
|
showErrors: boolean;
|
|
3
4
|
existing: boolean;
|
|
4
5
|
disabled: boolean;
|
|
5
6
|
getData?: () => Promise<object[]>;
|
|
6
7
|
allowDataInference: boolean;
|
|
8
|
+
customFields: Record<string, FieldConfig>;
|
|
7
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare function updatePropertyFromWidget(propertyData: any, selectedWidgetId: FieldConfigId | undefined): EditableProperty;
|
|
1
|
+
import { FieldConfig, Property } from "@firecms/core";
|
|
2
|
+
export declare function updatePropertyFromWidget(propertyData: any, selectedWidgetId: string | undefined, customFields: Record<string, FieldConfig>): Property;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,4 +7,3 @@ export type { CollectionEditorController } from "./types/collection_editor_contr
|
|
|
7
7
|
export type { CollectionEditorPermissions, CollectionEditorPermissionsBuilder } from "./types/config_permissions";
|
|
8
8
|
export type { PersistedCollection } from "./types/persisted_collection";
|
|
9
9
|
export type { CollectionInference } from "./types/collection_inference";
|
|
10
|
-
export type { EditablePropertiesOrBuilders } from "./types/editable_properties";
|