@firecms/collection_editor 3.0.0-alpha.16 → 3.0.0-alpha.18
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 +10 -5
- package/src/ConfigControllerProvider.tsx +177 -0
- package/src/components/EditorCollectionAction.tsx +95 -0
- package/src/components/HomePageEditorCollectionAction.tsx +81 -0
- package/src/components/NewCollectionCard.tsx +45 -0
- package/src/components/RootCollectionSuggestions.tsx +53 -0
- package/src/components/collection_editor/CollectionDetailsForm.tsx +312 -0
- package/src/components/collection_editor/CollectionEditorDialog.tsx +640 -0
- package/src/components/collection_editor/CollectionEditorWelcomeView.tsx +212 -0
- package/src/components/collection_editor/CollectionPropertiesEditorForm.tsx +450 -0
- package/src/components/collection_editor/CollectionYupValidation.tsx +6 -0
- package/src/components/collection_editor/EntityCustomViewsSelectDialog.tsx +29 -0
- package/src/components/collection_editor/EnumForm.tsx +354 -0
- package/src/components/collection_editor/PropertyEditView.tsx +535 -0
- package/src/components/collection_editor/PropertyFieldPreview.tsx +205 -0
- package/src/components/collection_editor/PropertySelectItem.tsx +31 -0
- package/src/components/collection_editor/PropertyTree.tsx +228 -0
- package/src/components/collection_editor/SelectIcons.tsx +72 -0
- package/src/components/collection_editor/SubcollectionsEditTab.tsx +239 -0
- package/src/components/collection_editor/UnsavedChangesDialog.tsx +47 -0
- package/src/components/collection_editor/import/CollectionEditorImportDataPreview.tsx +37 -0
- package/src/components/collection_editor/import/CollectionEditorImportMapping.tsx +236 -0
- package/src/components/collection_editor/import/clean_import_data.ts +53 -0
- package/src/components/collection_editor/properties/BlockPropertyField.tsx +131 -0
- package/src/components/collection_editor/properties/BooleanPropertyField.tsx +36 -0
- package/src/components/collection_editor/properties/CommonPropertyFields.tsx +112 -0
- package/src/components/collection_editor/properties/DateTimePropertyField.tsx +86 -0
- package/src/components/collection_editor/properties/EnumPropertyField.tsx +116 -0
- package/src/components/collection_editor/properties/FieldHelperView.tsx +13 -0
- package/src/components/collection_editor/properties/KeyValuePropertyField.tsx +20 -0
- package/src/components/collection_editor/properties/MapPropertyField.tsx +154 -0
- package/src/components/collection_editor/properties/NumberPropertyField.tsx +38 -0
- package/src/components/collection_editor/properties/ReferencePropertyField.tsx +184 -0
- package/src/components/collection_editor/properties/RepeatPropertyField.tsx +115 -0
- package/src/components/collection_editor/properties/StoragePropertyField.tsx +194 -0
- package/src/components/collection_editor/properties/StringPropertyField.tsx +85 -0
- package/src/components/collection_editor/properties/advanced/AdvancedPropertyValidation.tsx +36 -0
- package/src/components/collection_editor/properties/validation/ArrayPropertyValidation.tsx +50 -0
- package/src/components/collection_editor/properties/validation/GeneralPropertyValidation.tsx +49 -0
- package/src/components/collection_editor/properties/validation/NumberPropertyValidation.tsx +99 -0
- package/src/components/collection_editor/properties/validation/StringPropertyValidation.tsx +131 -0
- package/src/components/collection_editor/properties/validation/ValidationPanel.tsx +28 -0
- package/src/components/collection_editor/templates/blog_template.ts +115 -0
- package/src/components/collection_editor/templates/products_template.ts +89 -0
- package/src/components/collection_editor/templates/users_template.ts +34 -0
- package/src/components/collection_editor/util.ts +21 -0
- package/src/components/collection_editor/utils/supported_fields.tsx +28 -0
- package/src/components/collection_editor/utils/update_property_for_widget.ts +258 -0
- package/src/components/collection_editor/utils/useTraceUpdate.tsx +23 -0
- package/src/index.ts +31 -0
- package/src/types/collection_editor_controller.tsx +31 -0
- package/src/types/collection_inference.ts +3 -0
- package/src/types/config_controller.tsx +30 -0
- package/src/types/config_permissions.ts +20 -0
- package/src/types/persisted_collection.ts +7 -0
- package/src/useCollectionEditorController.tsx +9 -0
- package/src/useCollectionEditorPlugin.tsx +103 -0
- package/src/useCollectionsConfigController.tsx +9 -0
- package/src/utils/arrays.ts +3 -0
- package/src/utils/entities.ts +38 -0
- package/src/utils/icons.ts +17 -0
- package/src/utils/join_collections.ts +144 -0
- package/src/utils/synonyms.ts +1952 -0
- package/src/vite-env.d.ts +1 -0
- 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";
|