@akemona-org/strapi-plugin-content-type-builder 3.12.4 → 3.13.0
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/admin/src/components/AllowedTypesSelect/MenuList.js +2 -2
- package/admin/src/components/AllowedTypesSelect/index.js +2 -2
- package/admin/src/components/BooleanBox/CT.js +4 -3
- package/admin/src/components/BooleanBox/ST.js +4 -3
- package/admin/src/components/BooleanBox/index.js +2 -2
- package/admin/src/components/CheckboxWithDescription/index.js +3 -5
- package/admin/src/components/ComponentIconPicker/CellRenderer.js +2 -2
- package/admin/src/components/ComponentIconPicker/index.js +2 -2
- package/admin/src/components/ComponentSelect/Category.js +3 -3
- package/admin/src/components/ComponentSelect/MenuList.js +3 -3
- package/admin/src/components/ComponentSelect/MultipleMenuList.js +3 -3
- package/admin/src/components/ComponentSelect/Value.js +2 -2
- package/admin/src/components/ComponentSelect/index.js +3 -3
- package/admin/src/components/CreatableSelect/index.js +2 -2
- package/admin/src/components/CustomCheckbox/index.js +2 -2
- package/admin/src/components/CustomLink/index.js +3 -3
- package/admin/src/components/ModalHeader/ComponentInfos.js +2 -2
- package/admin/src/components/ModalHeader/DropdownInfos.js +2 -2
- package/admin/src/components/ModalHeader/Icon.js +2 -2
- package/admin/src/components/ModalHeader/index.js +2 -2
- package/admin/src/components/RelationForm/index.js +2 -2
- package/admin/src/components/RelationFormBox/index.js +3 -3
- package/admin/src/components/RelationFormNaturePicker/index.js +3 -3
- package/admin/src/components/RelationTargetPicker/Item.js +3 -3
- package/admin/src/components/RelationTargetPicker/index.js +2 -2
- package/admin/src/components/SelectMenuSubUl/index.js +2 -2
- package/admin/src/components/UpperFirst/index.js +3 -1
- package/admin/src/components/WrapperSelect/index.js +4 -4
- package/admin/src/containers/App/index.js +2 -2
- package/admin/src/containers/DataManagerProvider/index.js +3 -3
- package/admin/src/containers/FormModal/index.js +2 -2
- package/admin/src/containers/Initializer/index.js +2 -2
- package/admin/src/containers/ListView/index.js +5 -4
- package/admin/src/containers/RecursivePath/index.js +2 -2
- package/admin/src/icons/Curve.js +3 -3
- package/admin/src/icons/ManyToMany.js +2 -2
- package/admin/src/icons/ManyToOne.js +2 -2
- package/admin/src/icons/ManyWay.js +2 -2
- package/admin/src/icons/OneToMany.js +2 -2
- package/admin/src/icons/OneToOne.js +2 -2
- package/admin/src/icons/OneWay.js +2 -2
- package/package.json +6 -6
|
@@ -10,7 +10,7 @@ import UpperFirst from '../UpperFirst';
|
|
|
10
10
|
import Ul from '../SelectMenuUl';
|
|
11
11
|
import Text from './Text';
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
function MenuList({ selectProps: { changeMediaAllowedTypes, value }, ...rest }) {
|
|
14
14
|
const { formatMessage } = useGlobalContext();
|
|
15
15
|
const Component = components.MenuList;
|
|
16
16
|
const areAllAllowedTypesSelected = value.value && value.value.length === 3;
|
|
@@ -97,7 +97,7 @@ const MenuList = ({ selectProps: { changeMediaAllowedTypes, value }, ...rest })
|
|
|
97
97
|
</Ul>
|
|
98
98
|
</Component>
|
|
99
99
|
);
|
|
100
|
-
}
|
|
100
|
+
}
|
|
101
101
|
|
|
102
102
|
MenuList.defaultProps = {
|
|
103
103
|
selectProps: {
|
|
@@ -6,7 +6,7 @@ import { upperFirst } from 'lodash';
|
|
|
6
6
|
import MenuList from './MenuList';
|
|
7
7
|
import getTrad from '../../utils/getTrad';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
function AllowedTypesSelect({ name, changeMediaAllowedTypes, styles, value }) {
|
|
10
10
|
const { formatMessage } = useGlobalContext();
|
|
11
11
|
// Create a ref in order to access the StateManager
|
|
12
12
|
// So we can close the menu after clicking on a menu item
|
|
@@ -39,7 +39,7 @@ const AllowedTypesSelect = ({ name, changeMediaAllowedTypes, styles, value }) =>
|
|
|
39
39
|
value={{ label: displayedValue, value: value || '' }}
|
|
40
40
|
/>
|
|
41
41
|
);
|
|
42
|
-
}
|
|
42
|
+
}
|
|
43
43
|
|
|
44
44
|
AllowedTypesSelect.defaultProps = {
|
|
45
45
|
value: null,
|
|
@@ -3,12 +3,13 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import CTSelected from './icons/CTSelected';
|
|
4
4
|
import CTUnselected from './icons/CTUnselected';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
selected ? (
|
|
6
|
+
function CT({ selected }) {
|
|
7
|
+
return selected ? (
|
|
8
8
|
<CTSelected aria-hidden data-testid="ct-selected" />
|
|
9
9
|
) : (
|
|
10
10
|
<CTUnselected aria-hidden data-testid="ct-unselected" />
|
|
11
|
-
)
|
|
11
|
+
)
|
|
12
|
+
}
|
|
12
13
|
|
|
13
14
|
CT.defaultProps = {
|
|
14
15
|
selected: false,
|
|
@@ -3,12 +3,13 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import STSelected from './icons/STSelected';
|
|
4
4
|
import STUnselected from './icons/STUnselected';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
selected ? (
|
|
6
|
+
function ST({ selected }) {
|
|
7
|
+
return selected ? (
|
|
8
8
|
<STSelected aria-hidden data-testid="st-selected" />
|
|
9
9
|
) : (
|
|
10
10
|
<STUnselected aria-hidden data-testid="st-unselected" />
|
|
11
|
-
)
|
|
11
|
+
)
|
|
12
|
+
}
|
|
12
13
|
|
|
13
14
|
ST.defaultProps = {
|
|
14
15
|
selected: false,
|
|
@@ -24,7 +24,7 @@ const STHackSpan = styled.span`
|
|
|
24
24
|
margin-top: -0.4rem;
|
|
25
25
|
`;
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
function BooleanBox({ label, name, onChange, onChangeCallback, options, value }) {
|
|
28
28
|
const { formatMessage } = useGlobalContext();
|
|
29
29
|
|
|
30
30
|
const handleChange = (e) => {
|
|
@@ -83,7 +83,7 @@ const BooleanBox = ({ label, name, onChange, onChangeCallback, options, value })
|
|
|
83
83
|
</Wrapper>
|
|
84
84
|
</div>
|
|
85
85
|
);
|
|
86
|
-
}
|
|
86
|
+
}
|
|
87
87
|
|
|
88
88
|
BooleanBox.defaultProps = {
|
|
89
89
|
label: '',
|
|
@@ -3,10 +3,9 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { Checkbox, Text } from '@buffetjs/core';
|
|
4
4
|
import Wrapper from './Wrapper';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
function CheckboxWithDescription({ description, error, label, value, ...rest }) {
|
|
7
7
|
return (
|
|
8
|
-
|
|
9
|
-
<Wrapper>
|
|
8
|
+
<Wrapper>
|
|
10
9
|
<Checkbox {...rest} message={label} label={label} type="checkbox" value={value} />
|
|
11
10
|
{description && (
|
|
12
11
|
<Text color="grey" title={description} fontSize="sm" ellipsis>
|
|
@@ -19,9 +18,8 @@ const CheckboxWithDescription = ({ description, error, label, value, ...rest })
|
|
|
19
18
|
</Text>
|
|
20
19
|
)}
|
|
21
20
|
</Wrapper>
|
|
22
|
-
</>
|
|
23
21
|
);
|
|
24
|
-
}
|
|
22
|
+
}
|
|
25
23
|
|
|
26
24
|
CheckboxWithDescription.defaultProps = {
|
|
27
25
|
description: null,
|
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
4
|
import Cell from './Cell';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
function CellRenderer({ icon, name, onChange, style, value }) {
|
|
7
7
|
const isSelected = icon === value;
|
|
8
8
|
const handleClick = () => {
|
|
9
9
|
onChange({ target: { name, value: icon } });
|
|
@@ -14,7 +14,7 @@ const CellRenderer = ({ icon, name, onChange, style, value }) => {
|
|
|
14
14
|
<FontAwesomeIcon icon={icon} />
|
|
15
15
|
</Cell>
|
|
16
16
|
);
|
|
17
|
-
}
|
|
17
|
+
}
|
|
18
18
|
|
|
19
19
|
CellRenderer.defaultProps = {
|
|
20
20
|
value: '',
|
|
@@ -12,7 +12,7 @@ import Wrapper from './Wrapper';
|
|
|
12
12
|
|
|
13
13
|
/* eslint-disable jsx-a11y/control-has-associated-label */
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
function ComponentIconPicker({ error, isCreating, label, name, onChange, value }) {
|
|
16
16
|
const { allIcons, allComponentsIconAlreadyTaken } = useDataManager();
|
|
17
17
|
const [originalIcon] = useState(value);
|
|
18
18
|
const initialIcons = allIcons.filter((ico) => {
|
|
@@ -125,7 +125,7 @@ const ComponentIconPicker = ({ error, isCreating, label, name, onChange, value }
|
|
|
125
125
|
{error && <ErrorMessage style={{ marginTop: 5, marginBottom: 16 }}>{error}</ErrorMessage>}
|
|
126
126
|
</Wrapper>
|
|
127
127
|
);
|
|
128
|
-
}
|
|
128
|
+
}
|
|
129
129
|
|
|
130
130
|
ComponentIconPicker.defaultProps = {
|
|
131
131
|
error: null,
|
|
@@ -3,11 +3,11 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import UpperFirst from '../UpperFirst';
|
|
4
4
|
import CategoryName from './CategoryName';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
<CategoryName>
|
|
6
|
+
function Category({ categoryName }) {
|
|
7
|
+
return <CategoryName>
|
|
8
8
|
<UpperFirst content={categoryName} />
|
|
9
9
|
</CategoryName>
|
|
10
|
-
|
|
10
|
+
}
|
|
11
11
|
|
|
12
12
|
Category.defaultProps = {
|
|
13
13
|
categoryName: '',
|
|
@@ -11,10 +11,10 @@ import Category from './Category';
|
|
|
11
11
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
12
12
|
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
function MenuList({
|
|
15
15
|
selectProps: { isAddingAComponentToAnotherComponent, name, onClickOption, refState, value },
|
|
16
16
|
...rest
|
|
17
|
-
})
|
|
17
|
+
}) {
|
|
18
18
|
const { componentsGroupedByCategory, componentsThatHaveOtherComponentInTheirAttributes } =
|
|
19
19
|
useDataManager();
|
|
20
20
|
|
|
@@ -78,7 +78,7 @@ const MenuList = ({
|
|
|
78
78
|
</Ul>
|
|
79
79
|
</Component>
|
|
80
80
|
);
|
|
81
|
-
}
|
|
81
|
+
}
|
|
82
82
|
|
|
83
83
|
MenuList.defaultProps = {
|
|
84
84
|
selectProps: {
|
|
@@ -19,10 +19,10 @@ import hasSomeSubArray from './utils/HasSomeSubArray';
|
|
|
19
19
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
20
20
|
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
function MultipleMenuList({
|
|
23
23
|
selectProps: { name, addComponentsToDynamicZone, inputValue, value },
|
|
24
24
|
...rest
|
|
25
|
-
})
|
|
25
|
+
}) {
|
|
26
26
|
const { componentsGroupedByCategory, modifiedData } = useDataManager();
|
|
27
27
|
const query = useQuery();
|
|
28
28
|
const dzName = query.get('dynamicZoneTarget');
|
|
@@ -242,7 +242,7 @@ const MultipleMenuList = ({
|
|
|
242
242
|
</Ul>
|
|
243
243
|
</Component>
|
|
244
244
|
);
|
|
245
|
-
}
|
|
245
|
+
}
|
|
246
246
|
|
|
247
247
|
MultipleMenuList.defaultProps = {
|
|
248
248
|
selectProps: {
|
|
@@ -7,7 +7,7 @@ import useDataManager from '../../hooks/useDataManager';
|
|
|
7
7
|
import getTrad from '../../utils/getTrad';
|
|
8
8
|
import UpperFirst from '../UpperFirst';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
function Value({ children, ...props }) {
|
|
11
11
|
const SingleValue = components.SingleValue;
|
|
12
12
|
const { components: appComponents } = useDataManager();
|
|
13
13
|
const value = children;
|
|
@@ -50,7 +50,7 @@ const Value = ({ children, ...props }) => {
|
|
|
50
50
|
)}
|
|
51
51
|
</SingleValue>
|
|
52
52
|
);
|
|
53
|
-
}
|
|
53
|
+
}
|
|
54
54
|
|
|
55
55
|
Value.defaultProps = {
|
|
56
56
|
children: null,
|
|
@@ -5,7 +5,7 @@ import MenuList from './MenuList';
|
|
|
5
5
|
import MultipleMenuList from './MultipleMenuList';
|
|
6
6
|
import Value from './Value';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
function ComponentSelect({
|
|
9
9
|
addComponentsToDynamicZone,
|
|
10
10
|
componentCategoryNeededForAddingAfieldWhileCreatingAComponent,
|
|
11
11
|
componentNameNeededForAddingAfieldWhileCreatingAComponent,
|
|
@@ -16,7 +16,7 @@ const ComponentSelect = ({
|
|
|
16
16
|
name,
|
|
17
17
|
value,
|
|
18
18
|
styles,
|
|
19
|
-
})
|
|
19
|
+
}) {
|
|
20
20
|
// Create a ref in order to access the StateManager
|
|
21
21
|
// So we can close the menu after clicking on a menu item
|
|
22
22
|
// This allows us to get rid of the menuIsOpen state management
|
|
@@ -56,7 +56,7 @@ const ComponentSelect = ({
|
|
|
56
56
|
}}
|
|
57
57
|
/>
|
|
58
58
|
);
|
|
59
|
-
}
|
|
59
|
+
}
|
|
60
60
|
|
|
61
61
|
ComponentSelect.defaultProps = {
|
|
62
62
|
componentCategoryNeededForAddingAfieldWhileCreatingAComponent: null,
|
|
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import { uniqBy } from 'lodash';
|
|
5
5
|
import useDataManager from '../../hooks/useDataManager';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
function CreatableSelect({ onChange, name, styles, value }) {
|
|
8
8
|
const { allComponentsCategories } = useDataManager();
|
|
9
9
|
|
|
10
10
|
const handleChange = (inputValue, actionMeta) => {
|
|
@@ -42,7 +42,7 @@ const CreatableSelect = ({ onChange, name, styles, value }) => {
|
|
|
42
42
|
options={formatOptions()}
|
|
43
43
|
/>
|
|
44
44
|
);
|
|
45
|
-
}
|
|
45
|
+
}
|
|
46
46
|
|
|
47
47
|
CreatableSelect.defaultProps = {
|
|
48
48
|
value: null,
|
|
@@ -11,7 +11,7 @@ import { Inputs } from '@buffetjs/custom';
|
|
|
11
11
|
import { Checkbox } from '@buffetjs/core';
|
|
12
12
|
import StyledCustomCheckbox from './StyledCustomCheckbox';
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
function CustomCheckbox({ label, modifiedData, name, onChange, value, ...rest }) {
|
|
15
15
|
const [checked, setChecked] = useState(isNumber(value) || !isEmpty(value));
|
|
16
16
|
const type = modifiedData.type === 'biginteger' ? 'text' : 'number';
|
|
17
17
|
const step = ['decimal', 'float'].includes(modifiedData.type) ? 'any' : '1';
|
|
@@ -51,7 +51,7 @@ const CustomCheckbox = ({ label, modifiedData, name, onChange, value, ...rest })
|
|
|
51
51
|
)}
|
|
52
52
|
</StyledCustomCheckbox>
|
|
53
53
|
);
|
|
54
|
-
}
|
|
54
|
+
}
|
|
55
55
|
|
|
56
56
|
CustomCheckbox.defaultProps = {
|
|
57
57
|
label: null,
|
|
@@ -5,8 +5,8 @@ import { Plus } from '@buffetjs/icons';
|
|
|
5
5
|
import P from './P';
|
|
6
6
|
import StyledCustomLink from './StyledCustomLink';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
<StyledCustomLink disabled={disabled}>
|
|
8
|
+
function CustomLink({ disabled, id, onClick }) {
|
|
9
|
+
return <StyledCustomLink disabled={disabled}>
|
|
10
10
|
<button onClick={onClick} disabled={disabled} type="button">
|
|
11
11
|
<P>
|
|
12
12
|
<Plus fill="#007EFF" width="11px" height="11px" />
|
|
@@ -14,7 +14,7 @@ const CustomLink = ({ disabled, id, onClick }) => (
|
|
|
14
14
|
</P>
|
|
15
15
|
</button>
|
|
16
16
|
</StyledCustomLink>
|
|
17
|
-
|
|
17
|
+
}
|
|
18
18
|
|
|
19
19
|
CustomLink.defaultProps = {
|
|
20
20
|
disabled: false,
|
|
@@ -5,14 +5,14 @@ import ComponentInfosWrapper from './ComponentInfosWrapper';
|
|
|
5
5
|
|
|
6
6
|
/* eslint-disable react/jsx-one-expression-per-line */
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
function ComponentInfos({ category, name }) {
|
|
9
9
|
return (
|
|
10
10
|
<ComponentInfosWrapper>
|
|
11
11
|
(<UpperFirst content={category} /> —
|
|
12
12
|
<UpperFirst content={name} />)
|
|
13
13
|
</ComponentInfosWrapper>
|
|
14
14
|
);
|
|
15
|
-
}
|
|
15
|
+
}
|
|
16
16
|
|
|
17
17
|
ComponentInfos.propTypes = {
|
|
18
18
|
category: PropTypes.string.isRequired,
|
|
@@ -9,7 +9,7 @@ import Wrapper from './Wrapper';
|
|
|
9
9
|
|
|
10
10
|
/* eslint-disable react/no-array-index-key */
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
function DropdownInfos({ headers, shouldDisplaySecondHeader }) {
|
|
13
13
|
const [dropdownOpen, setDropdownOpen] = useState(false);
|
|
14
14
|
|
|
15
15
|
const toggle = () => setDropdownOpen((prevState) => !prevState);
|
|
@@ -35,7 +35,7 @@ const DropdownInfos = ({ headers, shouldDisplaySecondHeader }) => {
|
|
|
35
35
|
</Menu>
|
|
36
36
|
</Wrapper>
|
|
37
37
|
);
|
|
38
|
-
}
|
|
38
|
+
}
|
|
39
39
|
|
|
40
40
|
DropdownInfos.defaultProps = {
|
|
41
41
|
headers: [],
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { AttributeIcon } from '@buffetjs/core';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
function Icon({ type, style }) {
|
|
6
6
|
const icoName = type === 'collectionType' ? 'contentType' : type;
|
|
7
7
|
|
|
8
8
|
return (
|
|
@@ -11,7 +11,7 @@ const Icon = ({ type, style }) => {
|
|
|
11
11
|
style={{ ...style, margin: 'auto 20px auto 0' }}
|
|
12
12
|
/>
|
|
13
13
|
);
|
|
14
|
-
}
|
|
14
|
+
}
|
|
15
15
|
|
|
16
16
|
Icon.defaultProps = {
|
|
17
17
|
style: null,
|
|
@@ -13,7 +13,7 @@ import DropdownInfos from './DropdownInfos';
|
|
|
13
13
|
|
|
14
14
|
/* eslint-disable react/no-array-index-key */
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
function ModalHeader({ headerId, headers }) {
|
|
17
17
|
const shouldDisplayDropDown = headers.length > 3;
|
|
18
18
|
|
|
19
19
|
return (
|
|
@@ -84,7 +84,7 @@ const ModalHeader = ({ headerId, headers }) => {
|
|
|
84
84
|
</HeaderModalTitle>
|
|
85
85
|
</section>
|
|
86
86
|
);
|
|
87
|
-
}
|
|
87
|
+
}
|
|
88
88
|
|
|
89
89
|
ModalHeader.defaultProps = {
|
|
90
90
|
headerId: '',
|
|
@@ -6,7 +6,7 @@ import RelationFormBox from '../RelationFormBox';
|
|
|
6
6
|
import RelationFormNaturePicker from '../RelationFormNaturePicker';
|
|
7
7
|
import Wrapper from './Wrapper';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
function RelationForm({ errors, mainBoxHeader, modifiedData, naturePickerType, onChange }) {
|
|
10
10
|
const { formatMessage } = useGlobalContext();
|
|
11
11
|
const getError = (name) => {
|
|
12
12
|
const errorId = get(errors, [name, 'id'], null);
|
|
@@ -42,7 +42,7 @@ const RelationForm = ({ errors, mainBoxHeader, modifiedData, naturePickerType, o
|
|
|
42
42
|
/>
|
|
43
43
|
</Wrapper>
|
|
44
44
|
);
|
|
45
|
-
}
|
|
45
|
+
}
|
|
46
46
|
|
|
47
47
|
RelationForm.defaultProps = {
|
|
48
48
|
errors: {},
|
|
@@ -7,7 +7,7 @@ import getTrad from '../../utils/getTrad';
|
|
|
7
7
|
import RelationTargetPicker from '../RelationTargetPicker';
|
|
8
8
|
import Wrapper from './Wrapper';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
function RelationFormBox({
|
|
11
11
|
disabled,
|
|
12
12
|
error,
|
|
13
13
|
header,
|
|
@@ -17,7 +17,7 @@ const RelationFormBox = ({
|
|
|
17
17
|
oneThatIsCreatingARelationWithAnother,
|
|
18
18
|
target,
|
|
19
19
|
value,
|
|
20
|
-
})
|
|
20
|
+
}) {
|
|
21
21
|
const { formatMessage } = useGlobalContext();
|
|
22
22
|
|
|
23
23
|
return (
|
|
@@ -55,7 +55,7 @@ const RelationFormBox = ({
|
|
|
55
55
|
</div>
|
|
56
56
|
</Wrapper>
|
|
57
57
|
);
|
|
58
|
-
}
|
|
58
|
+
}
|
|
59
59
|
|
|
60
60
|
RelationFormBox.defaultProps = {
|
|
61
61
|
disabled: false,
|
|
@@ -22,13 +22,13 @@ const relations = {
|
|
|
22
22
|
manyWay: ManyWay,
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
function RelationFormNaturePicker({
|
|
26
26
|
nature,
|
|
27
27
|
naturePickerType,
|
|
28
28
|
onChange,
|
|
29
29
|
oneThatIsCreatingARelationWithAnother,
|
|
30
30
|
target,
|
|
31
|
-
})
|
|
31
|
+
}) {
|
|
32
32
|
const { contentTypes, modifiedData } = useDataManager();
|
|
33
33
|
const ctRelations = ['oneWay', 'oneToOne', 'oneToMany', 'manyToOne', 'manyToMany', 'manyWay'];
|
|
34
34
|
const componentRelations = ['oneWay', 'manyWay'];
|
|
@@ -95,7 +95,7 @@ const RelationFormNaturePicker = ({
|
|
|
95
95
|
</div>
|
|
96
96
|
</Wrapper>
|
|
97
97
|
);
|
|
98
|
-
}
|
|
98
|
+
}
|
|
99
99
|
|
|
100
100
|
RelationFormNaturePicker.defaultProps = {
|
|
101
101
|
nature: 'oneWay',
|
|
@@ -4,14 +4,14 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { Text } from '@buffetjs/core';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
function Item({
|
|
8
8
|
onChange,
|
|
9
9
|
oneThatIsCreatingARelationWithAnother,
|
|
10
10
|
plugin,
|
|
11
11
|
restrictRelationsTo,
|
|
12
12
|
title,
|
|
13
13
|
uid,
|
|
14
|
-
})
|
|
14
|
+
}) {
|
|
15
15
|
const handleChange = () => {
|
|
16
16
|
const selectedContentTypeFriendlyName = plugin ? `${plugin}_${title}` : title;
|
|
17
17
|
|
|
@@ -43,7 +43,7 @@ const Item = ({
|
|
|
43
43
|
</p>
|
|
44
44
|
</DropdownItem>
|
|
45
45
|
);
|
|
46
|
-
}
|
|
46
|
+
}
|
|
47
47
|
|
|
48
48
|
Item.defaultProps = {
|
|
49
49
|
plugin: null,
|
|
@@ -8,7 +8,7 @@ import useDataManager from '../../hooks/useDataManager';
|
|
|
8
8
|
import Item from './Item';
|
|
9
9
|
import Wrapper from './Wrapper';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
function RelationTargetPicker({ onChange, oneThatIsCreatingARelationWithAnother, target }) {
|
|
12
12
|
const [isOpen, setIsOpen] = useState(false);
|
|
13
13
|
const { contentTypes, sortedContentTypesList } = useDataManager();
|
|
14
14
|
const allowedContentTypesForRelation = useMemo(
|
|
@@ -77,7 +77,7 @@ const RelationTargetPicker = ({ onChange, oneThatIsCreatingARelationWithAnother,
|
|
|
77
77
|
</Dropdown>
|
|
78
78
|
</Wrapper>
|
|
79
79
|
);
|
|
80
|
-
}
|
|
80
|
+
}
|
|
81
81
|
|
|
82
82
|
RelationTargetPicker.propTypes = {
|
|
83
83
|
onChange: PropTypes.func.isRequired,
|
|
@@ -2,13 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import ToggleUl from './ToggleUl';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
function SubUl({ children, isOpen }) {
|
|
6
6
|
return (
|
|
7
7
|
<ToggleUl tag="ul" isOpen={isOpen}>
|
|
8
8
|
{children}
|
|
9
9
|
</ToggleUl>
|
|
10
10
|
);
|
|
11
|
-
}
|
|
11
|
+
}
|
|
12
12
|
|
|
13
13
|
SubUl.defaultProps = {
|
|
14
14
|
children: null,
|
|
@@ -8,7 +8,7 @@ import CreatableSelect from '../CreatableSelect';
|
|
|
8
8
|
|
|
9
9
|
/* eslint-disable no-nested-ternary */
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
function WrapperSelect({ error, label, name, type, ...rest }) {
|
|
12
12
|
const styles = {
|
|
13
13
|
container: (base) => ({
|
|
14
14
|
...base,
|
|
@@ -21,8 +21,8 @@ const WrapperSelect = ({ error, label, name, type, ...rest }) => {
|
|
|
21
21
|
border: state.isFocused
|
|
22
22
|
? '1px solid #78caff !important'
|
|
23
23
|
: error
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
? '1px solid #F64D0A !important'
|
|
25
|
+
: '1px solid #E3E9F3 !important',
|
|
26
26
|
borderRadius: '2px !important',
|
|
27
27
|
}),
|
|
28
28
|
menu: (base) => {
|
|
@@ -73,7 +73,7 @@ const WrapperSelect = ({ error, label, name, type, ...rest }) => {
|
|
|
73
73
|
)}
|
|
74
74
|
</SelectWrapper>
|
|
75
75
|
);
|
|
76
|
-
}
|
|
76
|
+
}
|
|
77
77
|
|
|
78
78
|
WrapperSelect.defaultProps = {
|
|
79
79
|
error: null,
|
|
@@ -16,7 +16,7 @@ import Wrapper from './Wrapper';
|
|
|
16
16
|
|
|
17
17
|
const ListView = lazy(() => import('../ListView'));
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
function App() {
|
|
20
20
|
return (
|
|
21
21
|
<CheckPagePermissions permissions={pluginPermissions.main}>
|
|
22
22
|
<Wrapper>
|
|
@@ -34,6 +34,6 @@ const App = () => {
|
|
|
34
34
|
</Wrapper>
|
|
35
35
|
</CheckPagePermissions>
|
|
36
36
|
);
|
|
37
|
-
}
|
|
37
|
+
}
|
|
38
38
|
|
|
39
39
|
export default App;
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
} from './constants';
|
|
52
52
|
import makeSelectDataManagerProvider from './selectors';
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
function DataManagerProvider({
|
|
55
55
|
allIcons,
|
|
56
56
|
children,
|
|
57
57
|
components,
|
|
@@ -61,7 +61,7 @@ const DataManagerProvider = ({
|
|
|
61
61
|
initialData,
|
|
62
62
|
modifiedData,
|
|
63
63
|
reservedNames,
|
|
64
|
-
})
|
|
64
|
+
}) {
|
|
65
65
|
const dispatch = useDispatch();
|
|
66
66
|
const {
|
|
67
67
|
strapi: { getPlugin },
|
|
@@ -584,7 +584,7 @@ const DataManagerProvider = ({
|
|
|
584
584
|
)}
|
|
585
585
|
</DataManagerContext.Provider>
|
|
586
586
|
);
|
|
587
|
-
}
|
|
587
|
+
}
|
|
588
588
|
|
|
589
589
|
DataManagerProvider.defaultProps = {
|
|
590
590
|
components: {},
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
/* eslint-disable indent */
|
|
64
64
|
/* eslint-disable react/no-array-index-key */
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
function FormModal() {
|
|
67
67
|
const [state, setState] = useState(INITIAL_STATE_DATA);
|
|
68
68
|
const [showConfirmModal, setShowConfirmModal] = useState(false);
|
|
69
69
|
const formModalSelector = useMemo(makeSelectFormModal, []);
|
|
@@ -1547,6 +1547,6 @@ const FormModal = () => {
|
|
|
1547
1547
|
/>
|
|
1548
1548
|
</>
|
|
1549
1549
|
);
|
|
1550
|
-
}
|
|
1550
|
+
}
|
|
1551
1551
|
|
|
1552
1552
|
export default FormModal;
|
|
@@ -8,7 +8,7 @@ import { useEffect, useRef } from 'react';
|
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import pluginId from '../../pluginId';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
function Initializer({ updatePlugin }) {
|
|
12
12
|
const ref = useRef();
|
|
13
13
|
ref.current = updatePlugin;
|
|
14
14
|
|
|
@@ -17,7 +17,7 @@ const Initializer = ({ updatePlugin }) => {
|
|
|
17
17
|
}, []);
|
|
18
18
|
|
|
19
19
|
return null;
|
|
20
|
-
}
|
|
20
|
+
}
|
|
21
21
|
|
|
22
22
|
Initializer.propTypes = {
|
|
23
23
|
updatePlugin: PropTypes.func.isRequired,
|
|
@@ -21,7 +21,7 @@ import Wrapper from './Wrapper';
|
|
|
21
21
|
|
|
22
22
|
/* eslint-disable indent */
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
function ListView() {
|
|
25
25
|
const {
|
|
26
26
|
initialData,
|
|
27
27
|
modifiedData,
|
|
@@ -163,6 +163,7 @@ const ListView = () => {
|
|
|
163
163
|
const wait = async () => {
|
|
164
164
|
togglePrompt(false);
|
|
165
165
|
|
|
166
|
+
// eslint-disable-next-line no-promise-executor-return
|
|
166
167
|
return new Promise((resolve) => setTimeout(resolve, 100));
|
|
167
168
|
};
|
|
168
169
|
const label = get(modifiedData, [firstMainDataPath, 'schema', 'name'], '');
|
|
@@ -269,11 +270,11 @@ const ListView = () => {
|
|
|
269
270
|
? [...listInjectedComponents, <ListButton {...addButtonProps} key="add-button" />]
|
|
270
271
|
: listInjectedComponents;
|
|
271
272
|
|
|
272
|
-
|
|
273
|
+
function CustomRow(props) {
|
|
273
274
|
const { name } = props;
|
|
274
275
|
|
|
275
276
|
return <ListRow {...props} attributeName={name} name={name} onClick={handleClickEditField} />;
|
|
276
|
-
}
|
|
277
|
+
}
|
|
277
278
|
|
|
278
279
|
CustomRow.defaultProps = {
|
|
279
280
|
name: null,
|
|
@@ -317,6 +318,6 @@ const ListView = () => {
|
|
|
317
318
|
</Wrapper>
|
|
318
319
|
</ListViewContext.Provider>
|
|
319
320
|
);
|
|
320
|
-
}
|
|
321
|
+
}
|
|
321
322
|
|
|
322
323
|
export default ListView;
|
|
@@ -4,7 +4,7 @@ import { LoadingIndicatorPage } from '@akemona-org/strapi-helper-plugin';
|
|
|
4
4
|
|
|
5
5
|
const ListView = lazy(() => import('../ListView'));
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
function RecursivePath() {
|
|
8
8
|
const { url } = useRouteMatch();
|
|
9
9
|
const { categoryUid } = useParams();
|
|
10
10
|
|
|
@@ -17,6 +17,6 @@ const RecursivePath = () => {
|
|
|
17
17
|
</Switch>
|
|
18
18
|
</Suspense>
|
|
19
19
|
);
|
|
20
|
-
}
|
|
20
|
+
}
|
|
21
21
|
|
|
22
22
|
export default RecursivePath;
|
package/admin/src/icons/Curve.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 21.08 21" {...props}>
|
|
4
|
+
function Curve(props) {
|
|
5
|
+
return <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 21.08 21" {...props}>
|
|
6
6
|
<g>
|
|
7
7
|
<path
|
|
8
8
|
d="M2.58 2.5q-1.2 16 16 16"
|
|
@@ -14,7 +14,7 @@ const Curve = (props) => (
|
|
|
14
14
|
/>
|
|
15
15
|
</g>
|
|
16
16
|
</svg>
|
|
17
|
-
|
|
17
|
+
}
|
|
18
18
|
|
|
19
19
|
Curve.defaultProps = {
|
|
20
20
|
fill: '#f3f4f4',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
function ManyToMany({ isSelected, ...rest }) {
|
|
5
5
|
const stroke = isSelected ? '#1C5DE7' : '#919BAE';
|
|
6
6
|
let rectProps = {
|
|
7
7
|
strokeOpacity: '.1',
|
|
@@ -76,7 +76,7 @@ const ManyToMany = ({ isSelected, ...rest }) => {
|
|
|
76
76
|
</g>
|
|
77
77
|
</svg>
|
|
78
78
|
);
|
|
79
|
-
}
|
|
79
|
+
}
|
|
80
80
|
|
|
81
81
|
ManyToMany.defaultProps = {
|
|
82
82
|
isSelected: false,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
function ManyToOne({ isSelected, ...rest }) {
|
|
5
5
|
const stroke = isSelected ? '#1C5DE7' : '#919BAE';
|
|
6
6
|
let rectProps = {
|
|
7
7
|
strokeOpacity: '.1',
|
|
@@ -48,7 +48,7 @@ const ManyToOne = ({ isSelected, ...rest }) => {
|
|
|
48
48
|
</g>
|
|
49
49
|
</svg>
|
|
50
50
|
);
|
|
51
|
-
}
|
|
51
|
+
}
|
|
52
52
|
|
|
53
53
|
ManyToOne.defaultProps = {
|
|
54
54
|
isSelected: false,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
function ManyWay({ isSelected, ...rest }) {
|
|
5
5
|
const rectStroke = isSelected ? '#1C5DE7' : '#E3E9F3';
|
|
6
6
|
const stroke = isSelected ? '#1C5DE7' : '#ABB3C2';
|
|
7
7
|
const otherStroke = isSelected ? '#1C5DE7' : '#ABB3C4';
|
|
@@ -23,7 +23,7 @@ const ManyWay = ({ isSelected, ...rest }) => {
|
|
|
23
23
|
</g>
|
|
24
24
|
</svg>
|
|
25
25
|
);
|
|
26
|
-
}
|
|
26
|
+
}
|
|
27
27
|
|
|
28
28
|
ManyWay.defaultProps = {
|
|
29
29
|
isSelected: false,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
function OneToMany({ isSelected, ...rest }) {
|
|
5
5
|
const stroke = isSelected ? '#1C5DE7' : '#919BAE';
|
|
6
6
|
let rectProps = {
|
|
7
7
|
strokeOpacity: '.1',
|
|
@@ -46,7 +46,7 @@ const OneToMany = ({ isSelected, ...rest }) => {
|
|
|
46
46
|
</g>
|
|
47
47
|
</svg>
|
|
48
48
|
);
|
|
49
|
-
}
|
|
49
|
+
}
|
|
50
50
|
|
|
51
51
|
OneToMany.defaultProps = {
|
|
52
52
|
isSelected: false,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
function OneToOne({ isSelected, ...rest }) {
|
|
5
5
|
const stroke = isSelected ? '#1C5DE7' : '#919BAE';
|
|
6
6
|
let rectProps = {
|
|
7
7
|
strokeOpacity: '.1',
|
|
@@ -34,7 +34,7 @@ const OneToOne = ({ isSelected, ...rest }) => {
|
|
|
34
34
|
</g>
|
|
35
35
|
</svg>
|
|
36
36
|
);
|
|
37
|
-
}
|
|
37
|
+
}
|
|
38
38
|
|
|
39
39
|
OneToOne.defaultProps = {
|
|
40
40
|
isSelected: false,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
function OneWay({ isSelected, ...rest }) {
|
|
5
5
|
const stroke = isSelected ? '#1C5DE7' : '#919BAE';
|
|
6
6
|
let rectProps = {
|
|
7
7
|
strokeOpacity: '.1',
|
|
@@ -25,7 +25,7 @@ const OneWay = ({ isSelected, ...rest }) => {
|
|
|
25
25
|
</g>
|
|
26
26
|
</svg>
|
|
27
27
|
);
|
|
28
|
-
}
|
|
28
|
+
}
|
|
29
29
|
|
|
30
30
|
OneWay.defaultProps = {
|
|
31
31
|
isSelected: false,
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "3.
|
|
6
|
+
"version": "3.13.0",
|
|
7
7
|
"description": "Strapi plugin to create content type (API).",
|
|
8
8
|
"strapi": {
|
|
9
9
|
"name": "Content Type Builder",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"description": "content-type-builder.plugin.description"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@akemona-org/strapi-generate": "3.
|
|
15
|
-
"@akemona-org/strapi-generate-api": "3.
|
|
16
|
-
"@akemona-org/strapi-helper-plugin": "3.
|
|
17
|
-
"@akemona-org/strapi-utils": "3.
|
|
14
|
+
"@akemona-org/strapi-generate": "3.13.0",
|
|
15
|
+
"@akemona-org/strapi-generate-api": "3.13.0",
|
|
16
|
+
"@akemona-org/strapi-helper-plugin": "3.13.0",
|
|
17
|
+
"@akemona-org/strapi-utils": "3.13.0",
|
|
18
18
|
"@buffetjs/core": "3.3.8",
|
|
19
19
|
"@buffetjs/custom": "3.3.8",
|
|
20
20
|
"@buffetjs/hooks": "3.3.8",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"npm": ">=6.0.0"
|
|
60
60
|
},
|
|
61
61
|
"license": "SEE LICENSE IN LICENSE",
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "8bb7b41ae9cc2110f94b9338f0ec2df437e49161"
|
|
63
63
|
}
|