@plusscommunities/pluss-feature-builder-web-d 1.0.7 → 1.0.9-beta.3
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.cjs.js → index.js} +3803 -3504
- package/dist/index.js.map +1 -0
- package/package.json +20 -27
- package/.babelrc +0 -4
- package/rollup.config.js +0 -69
- package/src/actions/featureBuilderStringsActions.js +0 -88
- package/src/actions/featureDefinitionsIndex.js +0 -258
- package/src/actions/formActions.js +0 -301
- package/src/actions/index.js +0 -12
- package/src/actions/listingActions.js +0 -352
- package/src/actions/wizardActions.js +0 -228
- package/src/components/ActivityCardExample.jsx +0 -86
- package/src/components/ActivityCardExample.module.css +0 -130
- package/src/components/BackgroundLoader.jsx +0 -33
- package/src/components/BackgroundLoader.module.css +0 -46
- package/src/components/BaseFieldConfig.jsx +0 -305
- package/src/components/BaseFieldConfig.module.css +0 -42
- package/src/components/CenteredContainer.jsx +0 -29
- package/src/components/CenteredContainer.module.css +0 -171
- package/src/components/DeleteConfirmationPopup.jsx +0 -95
- package/src/components/DeleteConfirmationPopup.module.css +0 -12
- package/src/components/ErrorBoundary.jsx +0 -134
- package/src/components/ErrorBoundary.module.css +0 -77
- package/src/components/ErrorMessage.jsx +0 -85
- package/src/components/ErrorMessage.module.css +0 -116
- package/src/components/ExampleDisplay.jsx +0 -26
- package/src/components/ExampleDisplay.module.css +0 -3
- package/src/components/FeatureBuilderSidebar.jsx +0 -84
- package/src/components/FeatureBuilderSuccessPopup.jsx +0 -49
- package/src/components/FeatureBuilderSuccessPopup.module.css +0 -41
- package/src/components/FeatureBuilderWelcomePopup.jsx +0 -51
- package/src/components/FeatureBuilderWelcomePopup.module.css +0 -21
- package/src/components/FeatureListingCard.jsx +0 -104
- package/src/components/FeatureListingCard.module.css +0 -62
- package/src/components/Fields.jsx +0 -423
- package/src/components/Fields.module.css +0 -159
- package/src/components/IconLoader.jsx +0 -153
- package/src/components/IconLoader.module.css +0 -92
- package/src/components/IconSelector.jsx +0 -111
- package/src/components/IconSelector.module.css +0 -197
- package/src/components/ListingEditor.jsx +0 -405
- package/src/components/ListingEditor.module.css +0 -14
- package/src/components/ListingSuccessPopup.jsx +0 -52
- package/src/components/LoadingScreen.jsx +0 -54
- package/src/components/LoadingScreen.module.css +0 -103
- package/src/components/LoadingState.jsx +0 -40
- package/src/components/LoadingState.module.css +0 -18
- package/src/components/PreviewFull.js +0 -24
- package/src/components/PreviewFull.module.css +0 -11
- package/src/components/PreviewGrid.js +0 -14
- package/src/components/PreviewWidget.js +0 -27
- package/src/components/PreviewWidget.module.css +0 -15
- package/src/components/SidebarLayout.jsx +0 -252
- package/src/components/SidebarLayout.module.css +0 -71
- package/src/components/SkeletonLoader.jsx +0 -128
- package/src/components/SkeletonLoader.module.css +0 -295
- package/src/components/SortButtonGroup.jsx +0 -34
- package/src/components/SortButtonGroup.module.css +0 -51
- package/src/components/ToastContainer.jsx +0 -98
- package/src/components/ToastContainer.module.css +0 -156
- package/src/components/ToggleSwitch.js +0 -40
- package/src/components/ToggleSwitch.module.css +0 -48
- package/src/components/TwoColumnInput.jsx +0 -29
- package/src/components/TwoColumnInput.module.css +0 -32
- package/src/components/ViewFull.js +0 -139
- package/src/components/ViewFull.module.css +0 -71
- package/src/components/ViewWidget.js +0 -62
- package/src/components/ViewWidget.module.css +0 -28
- package/src/components/iconCategories.js +0 -135
- package/src/components/iconImports.js +0 -409
- package/src/components/index.js +0 -59
- package/src/components/listing/FileListItem.jsx +0 -86
- package/src/components/listing/GalleryDisplay.jsx +0 -330
- package/src/components/listing/GalleryDisplay.module.css +0 -309
- package/src/components/listing/ListingCTAInput.jsx +0 -82
- package/src/components/listing/ListingDescriptionInput.jsx +0 -73
- package/src/components/listing/ListingField.jsx +0 -101
- package/src/components/listing/ListingField.module.css +0 -106
- package/src/components/listing/ListingFileInput.jsx +0 -273
- package/src/components/listing/ListingFileInput.module.css +0 -189
- package/src/components/listing/ListingForm.jsx +0 -90
- package/src/components/listing/ListingForm.module.css +0 -38
- package/src/components/listing/ListingGalleryInput.jsx +0 -239
- package/src/components/listing/ListingGalleryInput.module.css +0 -132
- package/src/components/listing/ListingImageInput.jsx +0 -153
- package/src/components/listing/ListingTextInput.jsx +0 -72
- package/src/feature.config.js +0 -130
- package/src/helper/index.js +0 -135
- package/src/hooks/useFeatureDefinitionLoader.js +0 -66
- package/src/images/full.png +0 -0
- package/src/images/fullNoTitle.png +0 -0
- package/src/images/previewWidget.png +0 -0
- package/src/images/widget.png +0 -0
- package/src/index.js +0 -38
- package/src/pages/CreateListingPage.jsx +0 -49
- package/src/pages/EditListingPage.jsx +0 -58
- package/src/reducers/featureBuilderReducer.js +0 -739
- package/src/screens/CreateListing.module.css +0 -45
- package/src/screens/Form.module.css +0 -744
- package/src/screens/FormFieldsStep.jsx +0 -626
- package/src/screens/FormLayoutStep.jsx +0 -405
- package/src/screens/FormOverviewStep.jsx +0 -389
- package/src/screens/ListingScreen.jsx +0 -477
- package/src/screens/ListingScreen.module.css +0 -333
- package/src/selectors/featureBuilderSelectors.js +0 -533
- package/src/types/index.js +0 -91
- package/src/utils/textUtils.js +0 -89
- package/src/validators/galleryValidators.js +0 -345
- package/src/values.config.a.js +0 -49
- package/src/values.config.b.js +0 -49
- package/src/values.config.c.js +0 -49
- package/src/values.config.d.js +0 -49
- package/src/values.config.default.js +0 -49
- package/src/values.config.js +0 -49
- package/src/webapi/featureDefinitionActions.js +0 -0
- package/src/webapi/featuresActions.js +0 -90
- package/src/webapi/helper.js +0 -4
- package/src/webapi/index.js +0 -12
- package/src/webapi/listingActions.js +0 -176
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { ToggleSwitch } from "./ToggleSwitch";
|
|
3
|
-
import { PlussCore } from "../feature.config";
|
|
4
|
-
import styles from "./FeatureListingCard.module.css";
|
|
5
|
-
|
|
6
|
-
const { Text, SVGIcon, Button, MoreMenu } = PlussCore.Components;
|
|
7
|
-
|
|
8
|
-
const FeatureListingCard = ({
|
|
9
|
-
id,
|
|
10
|
-
className,
|
|
11
|
-
style,
|
|
12
|
-
isDeleted,
|
|
13
|
-
icon,
|
|
14
|
-
title,
|
|
15
|
-
description,
|
|
16
|
-
isActive,
|
|
17
|
-
onEdit,
|
|
18
|
-
onDelete,
|
|
19
|
-
onToggle,
|
|
20
|
-
onRestore,
|
|
21
|
-
}) => {
|
|
22
|
-
const getMenuOptions = () => {
|
|
23
|
-
return [
|
|
24
|
-
{
|
|
25
|
-
key: "edit",
|
|
26
|
-
text: "Edit",
|
|
27
|
-
onPress: () => onEdit && onEdit(id),
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
key: "delete",
|
|
31
|
-
text: "Delete",
|
|
32
|
-
onPress: () => onDelete && onDelete(id),
|
|
33
|
-
},
|
|
34
|
-
];
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const handleToggle = (isActive) => {
|
|
38
|
-
if (onToggle) {
|
|
39
|
-
onToggle(id, isActive);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const renderLeftSection = () => {
|
|
44
|
-
return (
|
|
45
|
-
<div className={styles.featureListingCard__leftSection}>
|
|
46
|
-
{icon && (
|
|
47
|
-
<SVGIcon
|
|
48
|
-
icon={icon}
|
|
49
|
-
className={styles.featureListingCard__icon}
|
|
50
|
-
colour="#6c757d"
|
|
51
|
-
/>
|
|
52
|
-
)}
|
|
53
|
-
<div className={styles.featureListingCard__content}>
|
|
54
|
-
<Text type="name" className={styles.featureListingCard__title}>
|
|
55
|
-
{title || "Untitled"}
|
|
56
|
-
</Text>
|
|
57
|
-
<Text type="body" className={styles.featureListingCard__description}>
|
|
58
|
-
{description}
|
|
59
|
-
</Text>
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
const renderRightSection = () => {
|
|
66
|
-
if (isDeleted) {
|
|
67
|
-
return (
|
|
68
|
-
<div className={styles.featureListingCard__rightSection}>
|
|
69
|
-
<Button
|
|
70
|
-
buttonType="success"
|
|
71
|
-
onClick={() => onRestore && onRestore(id)}
|
|
72
|
-
narrow
|
|
73
|
-
>
|
|
74
|
-
Restore
|
|
75
|
-
</Button>
|
|
76
|
-
</div>
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return (
|
|
81
|
-
<div className={styles.featureListingCard__rightSection}>
|
|
82
|
-
<ToggleSwitch isActive={isActive} onChange={handleToggle} />
|
|
83
|
-
<MoreMenu options={getMenuOptions()} />
|
|
84
|
-
</div>
|
|
85
|
-
);
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const cardClasses = [
|
|
89
|
-
styles.featureListingCard,
|
|
90
|
-
isDeleted ? styles["featureListingCard--deleted"] : "",
|
|
91
|
-
className,
|
|
92
|
-
]
|
|
93
|
-
.filter(Boolean)
|
|
94
|
-
.join(" ");
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
<div key={id} className={cardClasses} style={{ ...style }}>
|
|
98
|
-
{renderLeftSection()}
|
|
99
|
-
{renderRightSection()}
|
|
100
|
-
</div>
|
|
101
|
-
);
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
export { FeatureListingCard };
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/* FeatureListingCard BEM CSS Module */
|
|
2
|
-
|
|
3
|
-
/* Block */
|
|
4
|
-
.featureListingCard {
|
|
5
|
-
border: 1px solid var(--linegrey);
|
|
6
|
-
background-color: var(--bg-white);
|
|
7
|
-
padding: 16px;
|
|
8
|
-
border-radius: 4px;
|
|
9
|
-
display: flex;
|
|
10
|
-
justify-content: space-between;
|
|
11
|
-
align-items: center;
|
|
12
|
-
margin-bottom: 8px;
|
|
13
|
-
opacity: 1;
|
|
14
|
-
transition: all 0.2s ease;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/* Modifiers */
|
|
18
|
-
.featureListingCard--deleted {
|
|
19
|
-
border-color: var(--linegrey);
|
|
20
|
-
background-color: var(--bg-bluegrey);
|
|
21
|
-
opacity: 0.7;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.featureListingCard:hover {
|
|
25
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/* Elements */
|
|
29
|
-
.featureListingCard__leftSection {
|
|
30
|
-
display: flex;
|
|
31
|
-
align-items: center;
|
|
32
|
-
flex: 1;
|
|
33
|
-
min-width: 0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.featureListingCard__icon {
|
|
37
|
-
width: 40px;
|
|
38
|
-
height: 40px;
|
|
39
|
-
margin-right: 12px;
|
|
40
|
-
flex-shrink: 0;
|
|
41
|
-
color: var(--text-light);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.featureListingCard__content {
|
|
45
|
-
flex: 1;
|
|
46
|
-
min-width: 0;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.featureListingCard__title {
|
|
50
|
-
margin-bottom: 4px;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.featureListingCard__description {
|
|
54
|
-
color: var(--text-light);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.featureListingCard__rightSection {
|
|
58
|
-
display: flex;
|
|
59
|
-
align-items: center;
|
|
60
|
-
gap: 12px;
|
|
61
|
-
flex-shrink: 0;
|
|
62
|
-
}
|
|
@@ -1,423 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
3
|
-
import { Text, Button } from "./index.js";
|
|
4
|
-
import { BaseFieldConfig } from "./BaseFieldConfig.jsx";
|
|
5
|
-
import { iconImports } from "./iconImports.js";
|
|
6
|
-
import styles from "./Fields.module.css";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Field component for rendering different field types in feature builder
|
|
10
|
-
* Acts as a factory component that renders the appropriate field component based on type
|
|
11
|
-
* Handles all supported field types with proper props forwarding
|
|
12
|
-
*
|
|
13
|
-
* @typedef {Object} FieldProps
|
|
14
|
-
* @property {string} type - Field type ("title", "text", "description", "image", "gallery", "feature-image", "cta", "file")
|
|
15
|
-
* @property {boolean} isMandatory - Whether field is mandatory/required
|
|
16
|
-
* @property {number} fieldIndex - Index of field in the form
|
|
17
|
-
* @property {string} id - Unique identifier of the field
|
|
18
|
-
* @property {Function} [handleDelete] - Callback function for field deletion
|
|
19
|
-
* @property {Function} [onReplaceField] - Callback function for field replacement
|
|
20
|
-
* @property {Object} [stepErrors] - Validation errors by field ID
|
|
21
|
-
* @property {boolean} [showWarnings] - Whether to show validation warnings
|
|
22
|
-
* @property {Object} values - Field configuration values
|
|
23
|
-
*
|
|
24
|
-
* @param {FieldProps} props - Field component props
|
|
25
|
-
* @returns {React.ReactElement} Rendered field component
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* <Field
|
|
29
|
-
* type="text"
|
|
30
|
-
* isMandatory={true}
|
|
31
|
-
* fieldIndex={0}
|
|
32
|
-
* id="field-123"
|
|
33
|
-
* values={{label: "Name", isRequired: true}}
|
|
34
|
-
* />
|
|
35
|
-
*/
|
|
36
|
-
export const Field = (props) => {
|
|
37
|
-
const { type, isMandatory } = props;
|
|
38
|
-
let Component;
|
|
39
|
-
|
|
40
|
-
switch (type) {
|
|
41
|
-
case "title":
|
|
42
|
-
Component = TitleField;
|
|
43
|
-
break;
|
|
44
|
-
case "text":
|
|
45
|
-
Component = TextField;
|
|
46
|
-
break;
|
|
47
|
-
case "description":
|
|
48
|
-
Component = DescriptionField;
|
|
49
|
-
break;
|
|
50
|
-
case "image":
|
|
51
|
-
Component = ImageField;
|
|
52
|
-
break;
|
|
53
|
-
case "gallery":
|
|
54
|
-
Component = GalleryField;
|
|
55
|
-
break;
|
|
56
|
-
case "feature-image":
|
|
57
|
-
Component = FeatureImageField;
|
|
58
|
-
break;
|
|
59
|
-
|
|
60
|
-
case "cta":
|
|
61
|
-
Component = CTAField;
|
|
62
|
-
break;
|
|
63
|
-
case "file":
|
|
64
|
-
Component = FileField;
|
|
65
|
-
break;
|
|
66
|
-
default:
|
|
67
|
-
return <Text type="h1">Field {type} not implemented yet</Text>;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Create field content with field header and content
|
|
71
|
-
const fieldContent = (
|
|
72
|
-
<>
|
|
73
|
-
<div className={styles.fieldHeader}>
|
|
74
|
-
<div className={styles.group}>
|
|
75
|
-
<div className={styles.line} />
|
|
76
|
-
<div className={styles.fieldType}>{getFieldTypeDisplay(type)}</div>
|
|
77
|
-
{!isMandatory && (
|
|
78
|
-
<Button
|
|
79
|
-
buttonType="secondary"
|
|
80
|
-
className={styles.changeTypeButton}
|
|
81
|
-
onClick={() => props.onReplaceField && props.onReplaceField()}
|
|
82
|
-
label="Change Type"
|
|
83
|
-
>
|
|
84
|
-
<FontAwesomeIcon icon={iconImports.repeat} />
|
|
85
|
-
<span className={styles.buttonLabel}>Change</span>
|
|
86
|
-
</Button>
|
|
87
|
-
)}
|
|
88
|
-
</div>
|
|
89
|
-
<div className={styles.group}>
|
|
90
|
-
{!isMandatory && (
|
|
91
|
-
<Button
|
|
92
|
-
buttonType="secondary"
|
|
93
|
-
className={styles.deleteButton}
|
|
94
|
-
onClick={props.handleDelete}
|
|
95
|
-
label="Remove Field"
|
|
96
|
-
>
|
|
97
|
-
<FontAwesomeIcon icon={iconImports.trash} />
|
|
98
|
-
<span className={styles.buttonLabel}>Remove</span>
|
|
99
|
-
</Button>
|
|
100
|
-
)}
|
|
101
|
-
{isMandatory && (
|
|
102
|
-
<span className={styles.padlockIcon}>
|
|
103
|
-
<PadlockIcon />
|
|
104
|
-
<p>This field cannot be removed</p>
|
|
105
|
-
</span>
|
|
106
|
-
)}
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
<div className={styles.fieldInner}>
|
|
110
|
-
<Component {...props} />
|
|
111
|
-
</div>
|
|
112
|
-
</>
|
|
113
|
-
);
|
|
114
|
-
|
|
115
|
-
// Both base and custom fields use the same wrapper now with the maintenance styling
|
|
116
|
-
const hasError =
|
|
117
|
-
props.showWarnings && props.stepErrors && props.stepErrors[props.id];
|
|
118
|
-
|
|
119
|
-
return (
|
|
120
|
-
<div className={styles.fieldContainer}>
|
|
121
|
-
<div className={styles.fieldNumberContainer}>
|
|
122
|
-
<p className={styles.fieldNumber}>{props.fieldIndex + 1}</p>
|
|
123
|
-
</div>
|
|
124
|
-
<div
|
|
125
|
-
className={`${styles.field} ${hasError ? styles["field--invalid"] : ""}`}
|
|
126
|
-
>
|
|
127
|
-
{fieldContent}
|
|
128
|
-
</div>
|
|
129
|
-
</div>
|
|
130
|
-
);
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
const PadlockIcon = () => {
|
|
134
|
-
const icon = iconImports.lock;
|
|
135
|
-
return (
|
|
136
|
-
<span className={styles.padlockIcon}>
|
|
137
|
-
<FontAwesomeIcon icon={icon} />
|
|
138
|
-
</span>
|
|
139
|
-
);
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
// Helper function to get display text for field types
|
|
143
|
-
const getFieldTypeDisplay = (type) => {
|
|
144
|
-
switch (type) {
|
|
145
|
-
case "title":
|
|
146
|
-
return "Title";
|
|
147
|
-
case "text":
|
|
148
|
-
return "Text";
|
|
149
|
-
case "description":
|
|
150
|
-
return "Description";
|
|
151
|
-
case "image":
|
|
152
|
-
return "Image";
|
|
153
|
-
case "gallery":
|
|
154
|
-
return "Gallery";
|
|
155
|
-
case "feature-image":
|
|
156
|
-
return "Feature Image";
|
|
157
|
-
case "cta":
|
|
158
|
-
return "Action Button";
|
|
159
|
-
case "file":
|
|
160
|
-
return "File";
|
|
161
|
-
default:
|
|
162
|
-
return type;
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
const TitleField = (props) => {
|
|
167
|
-
const {
|
|
168
|
-
setPlaceholder,
|
|
169
|
-
setLabel,
|
|
170
|
-
setHelpText,
|
|
171
|
-
stepErrors,
|
|
172
|
-
showWarnings,
|
|
173
|
-
id,
|
|
174
|
-
} = props;
|
|
175
|
-
const { placeholder, label, helpText } = props.values;
|
|
176
|
-
|
|
177
|
-
return (
|
|
178
|
-
<BaseFieldConfig
|
|
179
|
-
label={label}
|
|
180
|
-
placeholder={placeholder}
|
|
181
|
-
helpText={helpText}
|
|
182
|
-
isRequired={true}
|
|
183
|
-
setLabel={setLabel}
|
|
184
|
-
setPlaceholder={setPlaceholder}
|
|
185
|
-
setHelpText={setHelpText}
|
|
186
|
-
toggleIsRequired={() => {}}
|
|
187
|
-
stepErrors={stepErrors}
|
|
188
|
-
showWarnings={showWarnings}
|
|
189
|
-
id={id}
|
|
190
|
-
fieldType="title"
|
|
191
|
-
/>
|
|
192
|
-
);
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
const TextField = (props) => {
|
|
196
|
-
const {
|
|
197
|
-
setPlaceholder,
|
|
198
|
-
setLabel,
|
|
199
|
-
setHelpText,
|
|
200
|
-
stepErrors,
|
|
201
|
-
showWarnings,
|
|
202
|
-
toggleIsRequired,
|
|
203
|
-
id,
|
|
204
|
-
} = props;
|
|
205
|
-
const { placeholder, label, helpText, isRequired } = props.values;
|
|
206
|
-
|
|
207
|
-
return (
|
|
208
|
-
<BaseFieldConfig
|
|
209
|
-
label={label}
|
|
210
|
-
placeholder={placeholder}
|
|
211
|
-
helpText={helpText}
|
|
212
|
-
isRequired={isRequired}
|
|
213
|
-
setLabel={setLabel}
|
|
214
|
-
setPlaceholder={setPlaceholder}
|
|
215
|
-
setHelpText={setHelpText}
|
|
216
|
-
toggleIsRequired={toggleIsRequired}
|
|
217
|
-
stepErrors={stepErrors}
|
|
218
|
-
showWarnings={showWarnings}
|
|
219
|
-
id={id}
|
|
220
|
-
fieldType="text"
|
|
221
|
-
/>
|
|
222
|
-
);
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
const DescriptionField = (props) => {
|
|
226
|
-
const {
|
|
227
|
-
setPlaceholder,
|
|
228
|
-
toggleIsRequired,
|
|
229
|
-
setLabel,
|
|
230
|
-
setHelpText,
|
|
231
|
-
stepErrors,
|
|
232
|
-
showWarnings,
|
|
233
|
-
setUseAsSummary,
|
|
234
|
-
id,
|
|
235
|
-
} = props;
|
|
236
|
-
const { placeholder, label, isRequired, helpText, useAsSummary } =
|
|
237
|
-
props.values;
|
|
238
|
-
|
|
239
|
-
return (
|
|
240
|
-
<BaseFieldConfig
|
|
241
|
-
label={label}
|
|
242
|
-
placeholder={placeholder}
|
|
243
|
-
helpText={helpText}
|
|
244
|
-
isRequired={isRequired}
|
|
245
|
-
setLabel={setLabel}
|
|
246
|
-
setPlaceholder={setPlaceholder}
|
|
247
|
-
setHelpText={setHelpText}
|
|
248
|
-
toggleIsRequired={toggleIsRequired}
|
|
249
|
-
stepErrors={stepErrors}
|
|
250
|
-
showWarnings={showWarnings}
|
|
251
|
-
id={id}
|
|
252
|
-
fieldType="description"
|
|
253
|
-
useAsSummary={useAsSummary}
|
|
254
|
-
setUseAsSummary={setUseAsSummary}
|
|
255
|
-
/>
|
|
256
|
-
);
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
const ImageField = (props) => {
|
|
260
|
-
const {
|
|
261
|
-
setLabel,
|
|
262
|
-
setHelpText,
|
|
263
|
-
toggleIsRequired,
|
|
264
|
-
setAllowCaption,
|
|
265
|
-
toggleAllowCaption,
|
|
266
|
-
stepErrors,
|
|
267
|
-
showWarnings,
|
|
268
|
-
id,
|
|
269
|
-
} = props;
|
|
270
|
-
const { label, isRequired, placeholder, allowCaption, helpText } =
|
|
271
|
-
props.values;
|
|
272
|
-
|
|
273
|
-
return (
|
|
274
|
-
<BaseFieldConfig
|
|
275
|
-
label={label}
|
|
276
|
-
placeholder={placeholder}
|
|
277
|
-
allowCaption={allowCaption}
|
|
278
|
-
helpText={helpText}
|
|
279
|
-
isRequired={isRequired}
|
|
280
|
-
setLabel={setLabel}
|
|
281
|
-
setPlaceholder={() => {}}
|
|
282
|
-
setAllowCaption={setAllowCaption}
|
|
283
|
-
setHelpText={setHelpText}
|
|
284
|
-
toggleIsRequired={toggleIsRequired}
|
|
285
|
-
toggleAllowCaption={toggleAllowCaption}
|
|
286
|
-
stepErrors={stepErrors}
|
|
287
|
-
showWarnings={showWarnings}
|
|
288
|
-
id={id}
|
|
289
|
-
fieldType="image"
|
|
290
|
-
/>
|
|
291
|
-
);
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
const FeatureImageField = (props) => {
|
|
295
|
-
const { setLabel, setHelpText, stepErrors, showWarnings, id } = props;
|
|
296
|
-
const { label, placeholder, helpText } = props.values;
|
|
297
|
-
|
|
298
|
-
return (
|
|
299
|
-
<BaseFieldConfig
|
|
300
|
-
label={label}
|
|
301
|
-
placeholder={placeholder}
|
|
302
|
-
helpText={helpText}
|
|
303
|
-
isRequired={true}
|
|
304
|
-
setLabel={setLabel}
|
|
305
|
-
setPlaceholder={() => {}}
|
|
306
|
-
setHelpText={setHelpText}
|
|
307
|
-
toggleIsRequired={() => {}}
|
|
308
|
-
stepErrors={stepErrors}
|
|
309
|
-
showWarnings={showWarnings}
|
|
310
|
-
id={id}
|
|
311
|
-
fieldType="feature-image"
|
|
312
|
-
customLabel="Label"
|
|
313
|
-
/>
|
|
314
|
-
);
|
|
315
|
-
};
|
|
316
|
-
|
|
317
|
-
const GalleryField = (props) => {
|
|
318
|
-
const {
|
|
319
|
-
setLabel,
|
|
320
|
-
setHelpText,
|
|
321
|
-
toggleIsRequired,
|
|
322
|
-
setMinImages,
|
|
323
|
-
setMaxImages,
|
|
324
|
-
setMaxFileSize,
|
|
325
|
-
setAllowedTypes,
|
|
326
|
-
stepErrors,
|
|
327
|
-
showWarnings,
|
|
328
|
-
id,
|
|
329
|
-
} = props;
|
|
330
|
-
const {
|
|
331
|
-
label,
|
|
332
|
-
isRequired,
|
|
333
|
-
helpText,
|
|
334
|
-
placeholder,
|
|
335
|
-
minImages,
|
|
336
|
-
maxImages,
|
|
337
|
-
maxFileSize,
|
|
338
|
-
allowedTypes,
|
|
339
|
-
} = props.values;
|
|
340
|
-
|
|
341
|
-
return (
|
|
342
|
-
<BaseFieldConfig
|
|
343
|
-
label={label}
|
|
344
|
-
placeholder={placeholder}
|
|
345
|
-
helpText={helpText}
|
|
346
|
-
isRequired={isRequired}
|
|
347
|
-
minImages={minImages}
|
|
348
|
-
maxImages={maxImages}
|
|
349
|
-
maxFileSize={maxFileSize}
|
|
350
|
-
allowedTypes={allowedTypes}
|
|
351
|
-
setLabel={setLabel}
|
|
352
|
-
showPlaceholder={false}
|
|
353
|
-
setPlaceholder={() => {}}
|
|
354
|
-
setHelpText={setHelpText}
|
|
355
|
-
toggleIsRequired={toggleIsRequired}
|
|
356
|
-
setMinImages={setMinImages}
|
|
357
|
-
setMaxImages={setMaxImages}
|
|
358
|
-
setMaxFileSize={setMaxFileSize}
|
|
359
|
-
setAllowedTypes={setAllowedTypes}
|
|
360
|
-
stepErrors={stepErrors}
|
|
361
|
-
showWarnings={showWarnings}
|
|
362
|
-
id={id}
|
|
363
|
-
fieldType="gallery"
|
|
364
|
-
/>
|
|
365
|
-
);
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
const CTAField = (props) => {
|
|
369
|
-
const {
|
|
370
|
-
setLabel,
|
|
371
|
-
toggleIsRequired,
|
|
372
|
-
setHelpText,
|
|
373
|
-
setPlaceholder,
|
|
374
|
-
stepErrors,
|
|
375
|
-
showWarnings,
|
|
376
|
-
id,
|
|
377
|
-
} = props;
|
|
378
|
-
const { label, isRequired, helpText, placeholder } = props.values;
|
|
379
|
-
|
|
380
|
-
return (
|
|
381
|
-
<BaseFieldConfig
|
|
382
|
-
label={label}
|
|
383
|
-
placeholder={placeholder}
|
|
384
|
-
helpText={helpText}
|
|
385
|
-
isRequired={isRequired}
|
|
386
|
-
setLabel={setLabel}
|
|
387
|
-
setPlaceholder={setPlaceholder}
|
|
388
|
-
setHelpText={setHelpText}
|
|
389
|
-
toggleIsRequired={toggleIsRequired}
|
|
390
|
-
stepErrors={stepErrors}
|
|
391
|
-
showWarnings={showWarnings}
|
|
392
|
-
id={id}
|
|
393
|
-
fieldType="cta"
|
|
394
|
-
/>
|
|
395
|
-
);
|
|
396
|
-
};
|
|
397
|
-
|
|
398
|
-
const FileField = (props) => {
|
|
399
|
-
const {
|
|
400
|
-
toggleIsRequired,
|
|
401
|
-
setLabel,
|
|
402
|
-
setHelpText,
|
|
403
|
-
stepErrors,
|
|
404
|
-
showWarnings,
|
|
405
|
-
id,
|
|
406
|
-
} = props;
|
|
407
|
-
const { label, isRequired, helpText } = props.values;
|
|
408
|
-
|
|
409
|
-
return (
|
|
410
|
-
<BaseFieldConfig
|
|
411
|
-
label={label}
|
|
412
|
-
helpText={helpText}
|
|
413
|
-
isRequired={isRequired}
|
|
414
|
-
setLabel={setLabel}
|
|
415
|
-
setHelpText={setHelpText}
|
|
416
|
-
toggleIsRequired={toggleIsRequired}
|
|
417
|
-
stepErrors={stepErrors}
|
|
418
|
-
showWarnings={showWarnings}
|
|
419
|
-
id={id}
|
|
420
|
-
fieldType="file"
|
|
421
|
-
/>
|
|
422
|
-
);
|
|
423
|
-
};
|