@firecms/collection_editor 3.0.0-beta.2 → 3.0.0-beta.4.pre.1

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 (27) hide show
  1. package/dist/index.es.js +579 -567
  2. package/dist/index.es.js.map +1 -1
  3. package/dist/index.umd.js +2 -2
  4. package/dist/index.umd.js.map +1 -1
  5. package/dist/types/persisted_collection.d.ts +1 -1
  6. package/dist/ui/collection_editor/utils/supported_fields.d.ts +2 -2
  7. package/package.json +27 -19
  8. package/src/ConfigControllerProvider.tsx +1 -1
  9. package/src/types/persisted_collection.ts +1 -1
  10. package/src/ui/MissingReferenceWidget.tsx +2 -1
  11. package/src/ui/collection_editor/CollectionDetailsForm.tsx +17 -18
  12. package/src/ui/collection_editor/CollectionEditorDialog.tsx +8 -4
  13. package/src/ui/collection_editor/CollectionEditorWelcomeView.tsx +1 -1
  14. package/src/ui/collection_editor/CollectionPropertiesEditorForm.tsx +26 -9
  15. package/src/ui/collection_editor/EnumForm.tsx +3 -4
  16. package/src/ui/collection_editor/PropertyEditView.tsx +4 -4
  17. package/src/ui/collection_editor/SubcollectionsEditTab.tsx +1 -2
  18. package/src/ui/collection_editor/import/CollectionEditorImportMapping.tsx +1 -1
  19. package/src/ui/collection_editor/properties/CommonPropertyFields.tsx +7 -8
  20. package/src/ui/collection_editor/properties/DateTimePropertyField.tsx +7 -8
  21. package/src/ui/collection_editor/properties/MapPropertyField.tsx +3 -4
  22. package/src/ui/collection_editor/properties/ReferencePropertyField.tsx +4 -6
  23. package/src/ui/collection_editor/properties/validation/StringPropertyValidation.tsx +3 -4
  24. package/src/ui/collection_editor/utils/supported_fields.tsx +3 -3
  25. package/src/useCollectionEditorPlugin.tsx +1 -3
  26. package/dist/ui/collection_editor/properties/FieldHelperView.d.ts +0 -4
  27. package/src/ui/collection_editor/properties/FieldHelperView.tsx +0 -13
@@ -1,10 +1,9 @@
1
1
  import React from "react";
2
2
 
3
3
  import { Field, FormexFieldProps, getIn, useFormex } from "@firecms/formex";
4
- import { serializeRegExp } from "@firecms/core";
4
+ import { FieldCaption, serializeRegExp } from "@firecms/core";
5
5
  import { DebouncedTextField, } from "@firecms/ui";
6
6
  import { GeneralPropertyValidation } from "./GeneralPropertyValidation";
7
- import { FieldHelperView } from "../FieldHelperView";
8
7
  import { SwitchControl } from "../../SwitchControl";
9
8
 
10
9
  export function StringPropertyValidation({
@@ -140,9 +139,9 @@ export function StringPropertyValidation({
140
139
  disabled={disabled}
141
140
  value={matchesStringValue}
142
141
  error={Boolean(matchesError)}/>
143
- <FieldHelperView error={Boolean(matchesError)}>
142
+ <FieldCaption error={Boolean(matchesError)}>
144
143
  {matchesError ? "Not a valid regexp" : "e.g. /^\\d+$/ for digits only"}
145
- </FieldHelperView>
144
+ </FieldCaption>
146
145
  </div>}
147
146
 
148
147
  </div>
@@ -1,6 +1,6 @@
1
- import { DEFAULT_FIELD_CONFIGS, FieldConfigId, PropertyConfig } from "@firecms/core";
1
+ import { DEFAULT_FIELD_CONFIGS, PropertyConfigId, PropertyConfig } from "@firecms/core";
2
2
 
3
- export const supportedFieldsIds: FieldConfigId[] = [
3
+ export const supportedFieldsIds: PropertyConfigId[] = [
4
4
  "text_field",
5
5
  "multiline",
6
6
  "markdown",
@@ -24,6 +24,6 @@ export const supportedFieldsIds: FieldConfigId[] = [
24
24
  ];
25
25
 
26
26
  export const supportedFields: Record<string, PropertyConfig> = Object.entries(DEFAULT_FIELD_CONFIGS)
27
- .filter(([id]) => supportedFieldsIds.includes(id as FieldConfigId))
27
+ .filter(([id]) => supportedFieldsIds.includes(id as PropertyConfigId))
28
28
  .map(([id, config]) => ({ [id]: config }))
29
29
  .reduce((a, b) => ({ ...a, ...b }), {});
@@ -83,9 +83,6 @@ export function useCollectionEditorPlugin<EC extends PersistedCollection = Persi
83
83
  return {
84
84
  name: "Collection Editor",
85
85
  loading: collectionConfigController.loading,
86
- collections: {
87
- CollectionActions: EditorCollectionAction
88
- },
89
86
  provider: {
90
87
  Component: ConfigControllerProvider,
91
88
  props: {
@@ -108,6 +105,7 @@ export function useCollectionEditorPlugin<EC extends PersistedCollection = Persi
108
105
  AdditionalCards: introMode ? undefined : NewCollectionCard,
109
106
  },
110
107
  collectionView: {
108
+ CollectionActions: EditorCollectionAction,
111
109
  HeaderAction: CollectionViewHeaderAction,
112
110
  AddColumnComponent: PropertyAddColumnComponent
113
111
  }
@@ -1,4 +0,0 @@
1
- export declare function FieldHelperView({ error, children }: {
2
- error?: boolean;
3
- children?: React.ReactNode;
4
- }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,13 +0,0 @@
1
- import { Typography } from "@firecms/ui";
2
-
3
- export function FieldHelperView({
4
- error,
5
- children
6
- }: { error?: boolean, children?: React.ReactNode }) {
7
- if (!children) return null;
8
- return (
9
- <Typography variant={"caption"} color={error ? "error" : "secondary"} className={"ml-3.5 mt-0.5"}>
10
- {children}
11
- </Typography>
12
- );
13
- }