@firecms/collection_editor 3.0.0-beta.1 → 3.0.0-beta.2-pre.2
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 +3 -3
- 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 +13 -13
- package/src/ui/collection_editor/EnumForm.tsx +1 -5
- package/src/ui/collection_editor/GetCodeDialog.tsx +2 -12
- package/src/ui/collection_editor/PropertyEditView.tsx +2 -2
- package/src/ui/collection_editor/PropertyFieldPreview.tsx +5 -5
- package/src/ui/collection_editor/PropertySelectItem.tsx +2 -2
- package/src/ui/collection_editor/import/CollectionEditorImportMapping.tsx +3 -15
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firecms/collection_editor",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.2-pre.2",
|
|
5
5
|
"main": "./dist/index.umd.js",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"source": "src/index.ts",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@firecms/data_import_export": "^3.0.0-beta.
|
|
11
|
-
"@firecms/schema_inference": "^3.0.0-beta.
|
|
12
|
-
"@firecms/ui": "^3.0.0-beta.
|
|
10
|
+
"@firecms/data_import_export": "^3.0.0-beta.2-pre.2",
|
|
11
|
+
"@firecms/schema_inference": "^3.0.0-beta.2-pre.2",
|
|
12
|
+
"@firecms/ui": "^3.0.0-beta.2-pre.2",
|
|
13
13
|
"json5": "^2.2.3",
|
|
14
|
-
"prism-react-renderer": "^2.3.
|
|
14
|
+
"prism-react-renderer": "^2.3.1"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"react": "^18.2.0",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@jest/globals": "^29.7.0",
|
|
48
|
-
"@types/react": "^18.2.
|
|
49
|
-
"@types/react-dom": "^18.2.
|
|
48
|
+
"@types/react": "^18.2.54",
|
|
49
|
+
"@types/react-dom": "^18.2.18",
|
|
50
50
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
51
51
|
"@typescript-eslint/parser": "^5.62.0",
|
|
52
52
|
"@vitejs/plugin-react": "^4.2.1",
|
|
53
|
-
"eslint": "^8.
|
|
53
|
+
"eslint": "^8.56.0",
|
|
54
54
|
"eslint-config-standard": "^17.1.0",
|
|
55
55
|
"eslint-plugin-import": "^2.29.1",
|
|
56
56
|
"eslint-plugin-n": "^15.7.0",
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
"eslint-plugin-react": "^7.33.2",
|
|
59
59
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
60
60
|
"jest": "^29.7.0",
|
|
61
|
-
"react-router": "^6.
|
|
62
|
-
"react-router-dom": "^6.
|
|
63
|
-
"ts-jest": "^29.1.
|
|
61
|
+
"react-router": "^6.22.0",
|
|
62
|
+
"react-router-dom": "^6.22.0",
|
|
63
|
+
"ts-jest": "^29.1.2",
|
|
64
64
|
"typescript": "^5.3.3",
|
|
65
|
-
"vite": "^4.5.
|
|
65
|
+
"vite": "^4.5.2",
|
|
66
66
|
"vite-plugin-fonts": "^0.7.0"
|
|
67
67
|
},
|
|
68
68
|
"files": [
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"publishConfig": {
|
|
73
73
|
"access": "public"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "f3f62fc3cbc4f0d9d1a26817a14cff06393b7c2b"
|
|
76
76
|
}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import React, { useEffect } from "react";
|
|
2
2
|
|
|
3
3
|
import { FastField, Formik, getIn, useFormikContext } from "formik";
|
|
4
|
-
import {
|
|
5
|
-
EnumValueConfig,
|
|
6
|
-
EnumValues,
|
|
7
|
-
FormikArrayContainer,
|
|
8
|
-
} from "@firecms/core";
|
|
4
|
+
import { EnumValueConfig, EnumValues, FormikArrayContainer, } from "@firecms/core";
|
|
9
5
|
import {
|
|
10
6
|
AutoAwesomeIcon,
|
|
11
7
|
Button,
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
useSnackbarController
|
|
4
|
-
} from "@firecms/core";
|
|
5
|
-
import {
|
|
6
|
-
Button,
|
|
7
|
-
ContentCopyIcon,
|
|
8
|
-
Dialog,
|
|
9
|
-
DialogActions,
|
|
10
|
-
DialogContent,
|
|
11
|
-
Typography,
|
|
12
|
-
} from "@firecms/ui";
|
|
1
|
+
import { EntityCollection, useSnackbarController } from "@firecms/core";
|
|
2
|
+
import { Button, ContentCopyIcon, Dialog, DialogActions, DialogContent, Typography, } from "@firecms/ui";
|
|
13
3
|
import React from "react";
|
|
14
4
|
import JSON5 from "json5";
|
|
15
5
|
import { Highlight, themes } from "prism-react-renderer"
|
|
@@ -5,7 +5,7 @@ import { Formik, FormikErrors, FormikProps, getIn } from "formik";
|
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_FIELD_CONFIGS,
|
|
7
7
|
DeleteConfirmationDialog,
|
|
8
|
-
|
|
8
|
+
PropertyConfigBadge,
|
|
9
9
|
FieldConfigId,
|
|
10
10
|
getFieldConfig,
|
|
11
11
|
getFieldId,
|
|
@@ -479,7 +479,7 @@ function PropertyEditView({
|
|
|
479
479
|
"flex items-center",
|
|
480
480
|
optionDisabled ? "w-full pointer-events-none opacity-50" : "")}>
|
|
481
481
|
<div className={"mr-8"}>
|
|
482
|
-
<
|
|
482
|
+
<PropertyConfigBadge propertyConfig={computedFieldConfig}/>
|
|
483
483
|
</div>
|
|
484
484
|
<div className={"flex flex-col items-start text-base text-left"}>
|
|
485
485
|
<div>{computedFieldConfig.name}</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ErrorBoundary,
|
|
3
|
-
|
|
3
|
+
PropertyConfigBadge,
|
|
4
4
|
getFieldConfig,
|
|
5
5
|
isPropertyBuilder,
|
|
6
6
|
Property,
|
|
@@ -43,14 +43,14 @@ export function PropertyFieldPreview({
|
|
|
43
43
|
|
|
44
44
|
const borderColorClass = hasError
|
|
45
45
|
? "border-red-500"
|
|
46
|
-
: (selected ? "border-
|
|
46
|
+
: (selected ? "border-primary" : "border-transparent");
|
|
47
47
|
|
|
48
48
|
return <ErrorBoundary>
|
|
49
49
|
<div
|
|
50
50
|
onClick={onClick}
|
|
51
51
|
className="flex flex-row w-full cursor-pointer">
|
|
52
52
|
<div className={"m-4"}>
|
|
53
|
-
<
|
|
53
|
+
<PropertyConfigBadge propertyConfig={propertyConfig}/>
|
|
54
54
|
</div>
|
|
55
55
|
<Paper
|
|
56
56
|
className={cn(
|
|
@@ -127,7 +127,7 @@ export function NonEditablePropertyPreview({
|
|
|
127
127
|
onClick={onClick}
|
|
128
128
|
className="flex flex-row w-full cursor-pointer">
|
|
129
129
|
<div className={"relative m-4"}>
|
|
130
|
-
{propertyConfig && <
|
|
130
|
+
{propertyConfig && <PropertyConfigBadge propertyConfig={propertyConfig}/>}
|
|
131
131
|
{!propertyConfig && <div
|
|
132
132
|
className={"h-8 w-8 p-1 rounded-full shadow text-white bg-gray-500"}>
|
|
133
133
|
<FunctionsIcon color={"inherit"} size={"medium"}/>
|
|
@@ -141,7 +141,7 @@ export function NonEditablePropertyPreview({
|
|
|
141
141
|
onClick ? cardClickableMixin : "",
|
|
142
142
|
selected ? cardSelectedMixin : "",
|
|
143
143
|
"flex-grow p-4 border transition-colors duration-200",
|
|
144
|
-
selected ? "border-
|
|
144
|
+
selected ? "border-primary" : "border-transparent")}
|
|
145
145
|
>
|
|
146
146
|
|
|
147
147
|
<div className="w-full flex flex-col">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PropertyConfigBadge, PropertyConfig } from "@firecms/core";
|
|
2
2
|
import { cn, SelectItem, Typography } from "@firecms/ui";
|
|
3
3
|
|
|
4
4
|
export interface PropertySelectItemProps {
|
|
@@ -17,7 +17,7 @@ export function PropertySelectItem({ value, optionDisabled, propertyConfig, exis
|
|
|
17
17
|
"flex flex-row items-center text-base min-h-[52px]",
|
|
18
18
|
optionDisabled ? "w-full" : "")}>
|
|
19
19
|
<div className={"mr-8"}>
|
|
20
|
-
<
|
|
20
|
+
<PropertyConfigBadge propertyConfig={propertyConfig}/>
|
|
21
21
|
</div>
|
|
22
22
|
<div>
|
|
23
23
|
<div>{propertyConfig.name}</div>
|
|
@@ -6,20 +6,8 @@ import {
|
|
|
6
6
|
} from "@firecms/data_import_export";
|
|
7
7
|
import { getIn, useFormikContext } from "formik";
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
getFieldConfig,
|
|
12
|
-
getFieldId,
|
|
13
|
-
Properties,
|
|
14
|
-
Property,
|
|
15
|
-
PropertyConfig,
|
|
16
|
-
} from "@firecms/core";
|
|
17
|
-
import {
|
|
18
|
-
Container,
|
|
19
|
-
Select,
|
|
20
|
-
Tooltip,
|
|
21
|
-
Typography
|
|
22
|
-
} from "@firecms/ui";
|
|
9
|
+
import { PropertyConfigBadge, getFieldConfig, getFieldId, Properties, Property, PropertyConfig, } from "@firecms/core";
|
|
10
|
+
import { Container, Select, Tooltip, Typography } from "@firecms/ui";
|
|
23
11
|
import React, { useState } from "react";
|
|
24
12
|
import { OnPropertyChangedParams, PropertyFormDialog, PropertyWithId } from "../PropertyEditView";
|
|
25
13
|
import { getFullId, idToPropertiesPath, namespaceToPropertiesOrderPath } from "../util";
|
|
@@ -246,7 +234,7 @@ function PropertySelect({
|
|
|
246
234
|
position={"item-aligned"}
|
|
247
235
|
renderValue={(value) => {
|
|
248
236
|
if (!widget) return null;
|
|
249
|
-
return <
|
|
237
|
+
return <PropertyConfigBadge propertyConfig={widget}/>
|
|
250
238
|
}}
|
|
251
239
|
onValueChange={(newSelectedWidgetId) => {
|
|
252
240
|
const newProperty = updatePropertyFromWidget(property, newSelectedWidgetId, propertyConfigs)
|