@strapi/admin 4.6.0-alpha.0 → 4.6.0-beta.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/content-manager/components/ComponentInitializer/index.js +1 -7
- package/admin/src/content-manager/components/{RepeatableComponent/DragPreview.js → DragLayer/ComponentDragPreview.js} +25 -12
- package/admin/src/content-manager/components/DragLayer/RelationDragPreview.js +75 -0
- package/admin/src/content-manager/components/DragLayer/index.js +23 -7
- package/admin/src/content-manager/components/DynamicZone/components/DynamicComponent.js +130 -84
- package/admin/src/content-manager/components/DynamicZone/index.js +99 -24
- package/admin/src/content-manager/components/DynamicZone/utils/select.js +9 -5
- package/admin/src/content-manager/components/EditViewDataManagerProvider/index.js +76 -14
- package/admin/src/content-manager/components/EditViewDataManagerProvider/reducer.js +23 -23
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/cleanData.js +24 -5
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/recursivelyFindPathsBasedOnCondition.js +8 -1
- package/admin/src/content-manager/components/Inputs/index.js +5 -19
- package/admin/src/content-manager/components/NonRepeatableComponent/index.js +4 -0
- package/admin/src/content-manager/components/RelationInput/RelationInput.js +203 -63
- package/admin/src/content-manager/components/RelationInput/components/RelationItem.js +134 -21
- package/admin/src/content-manager/components/RelationInput/components/RelationList.js +1 -2
- package/admin/src/content-manager/components/RelationInput/constants.js +1 -0
- package/admin/src/content-manager/components/RelationInputDataManager/RelationInputDataManager.js +132 -10
- package/admin/src/content-manager/components/RepeatableComponent/components/Accordion.js +77 -0
- package/admin/src/content-manager/components/RepeatableComponent/components/Component.js +262 -0
- package/admin/src/content-manager/components/RepeatableComponent/{DraggedItem → components}/Preview.js +0 -0
- package/admin/src/content-manager/components/RepeatableComponent/index.js +147 -87
- package/admin/src/content-manager/components/RepeatableComponent/utils/getComponentErrorKeys.js +1 -1
- package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +1 -1
- package/admin/src/content-manager/components/Wysiwyg/Editor.js +1 -1
- package/admin/src/content-manager/hooks/index.js +2 -0
- package/admin/src/content-manager/hooks/useDragAndDrop.js +120 -0
- package/admin/src/content-manager/hooks/useKeyboardDragAndDrop.js +98 -0
- package/admin/src/content-manager/hooks/useLazyComponents/index.js +69 -0
- package/admin/src/content-manager/pages/CollectionTypeRecursivePath/components/ErrorFallback.js +13 -0
- package/admin/src/content-manager/pages/CollectionTypeRecursivePath/index.js +2 -1
- package/admin/src/content-manager/pages/EditView/GridRow/index.js +62 -0
- package/admin/src/content-manager/pages/EditView/index.js +74 -154
- package/admin/src/content-manager/pages/EditView/selectors.js +14 -0
- package/admin/src/content-manager/pages/EditView/utils/createAttributesLayout.js +11 -6
- package/admin/src/content-manager/pages/EditView/utils/getCustomFieldUidsFromLayout.js +18 -0
- package/admin/src/content-manager/pages/EditView/utils/index.js +1 -0
- package/admin/src/content-manager/pages/EditViewLayoutManager/index.js +1 -1
- package/admin/src/content-manager/sharedReducers/crudReducer/actions.js +5 -0
- package/admin/src/content-manager/sharedReducers/crudReducer/constants.js +2 -0
- package/admin/src/content-manager/sharedReducers/crudReducer/reducer.js +7 -0
- package/admin/src/content-manager/utils/ItemTypes.js +1 -1
- package/admin/src/content-manager/utils/composeRefs.js +28 -0
- package/admin/src/content-manager/utils/getMaxTempKey.js +1 -1
- package/admin/src/content-manager/utils/index.js +7 -0
- package/admin/src/core/utils/axiosInstance.js +4 -2
- package/admin/src/hooks/index.js +1 -0
- package/admin/src/hooks/useFetchClient/index.js +23 -0
- package/admin/src/pages/HomePage/SocialLinks.js +4 -4
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/index.js +23 -18
- package/admin/src/translations/en.json +6 -0
- package/admin/src/translations/ru.json +789 -489
- package/admin/src/utils/fetchClient.js +45 -0
- package/admin/src/utils/getFetchClient.js +10 -0
- package/build/4306.df40a798.chunk.js +98 -0
- package/build/{4318.daf31770.chunk.js → 4318.80bdf035.chunk.js} +2 -2
- package/build/5057.195a59ff.chunk.js +65 -0
- package/build/{805.a1894307.chunk.js → 805.e991a370.chunk.js} +6 -6
- package/build/{4986.3820d11d.chunk.js → 8176.b19bc128.chunk.js} +32 -32
- package/build/{1233.32d6888d.chunk.js → 8186.55910742.chunk.js} +94 -94
- package/build/{8633.8da5488a.chunk.js → 8633.59223842.chunk.js} +1 -1
- package/build/8881.c693411a.chunk.js +245 -0
- package/build/9161.4a0ab137.chunk.js +2119 -0
- package/build/9279.6290c87a.chunk.js +117 -0
- package/build/9707.a0cc4ad8.chunk.js +70 -0
- package/build/Admin-authenticatedApp.f9e74dc0.chunk.js +80 -0
- package/build/{Admin_homePage.b4db4df8.chunk.js → Admin_homePage.8945f71a.chunk.js} +5 -5
- package/build/{Admin_marketplace.fa51405b.chunk.js → Admin_marketplace.ed754a4a.chunk.js} +1 -1
- package/build/{Admin_pluginsPage.14d2840f.chunk.js → Admin_pluginsPage.3c872de7.chunk.js} +1 -1
- package/build/{Admin_profilePage.6c2c8398.chunk.js → Admin_profilePage.c07bdf08.chunk.js} +1 -1
- package/build/{Admin_settingsPage.5e740514.chunk.js → Admin_settingsPage.50a8765b.chunk.js} +5 -5
- package/build/admin-app.2861b6d2.chunk.js +112 -0
- package/build/{admin-edit-roles-page.c7c338b3.chunk.js → admin-edit-roles-page.f407538c.chunk.js} +1 -1
- package/build/{admin-edit-users.d254c128.chunk.js → admin-edit-users.85231e4c.chunk.js} +1 -1
- package/build/{admin-users.7c423e41.chunk.js → admin-users.a2707644.chunk.js} +2 -2
- package/build/api-tokens-create-page.dd4ddfcb.chunk.js +1 -0
- package/build/api-tokens-edit-page.821c5a6c.chunk.js +1 -0
- package/build/{api-tokens-list-page.fe994b6b.chunk.js → api-tokens-list-page.700e575f.chunk.js} +1 -1
- package/build/content-manager.ee948f75.chunk.js +1186 -0
- package/build/content-type-builder-list-view.4412efc3.chunk.js +201 -0
- package/build/content-type-builder.b132b5f4.chunk.js +145 -0
- package/build/email-settings-page.db0d98d1.chunk.js +15 -0
- package/build/{en-json.7dd57947.chunk.js → en-json.4a56dca7.chunk.js} +1 -1
- package/build/index.html +1 -1
- package/build/main.faac89ee.js +2025 -0
- package/build/ru-json.8830286f.chunk.js +1 -0
- package/build/{runtime~main.6e7d95b9.js → runtime~main.75a15b8e.js} +1 -1
- package/build/{sso-settings-page.eb30a02e.chunk.js → sso-settings-page.adb12ac3.chunk.js} +1 -1
- package/build/upload-settings.450cab1a.chunk.js +18 -0
- package/build/upload.e2034370.chunk.js +64 -0
- package/build/users-advanced-settings-page.0c0b8230.chunk.js +13 -0
- package/build/users-email-settings-page.3126ff8c.chunk.js +28 -0
- package/build/users-providers-settings-page.b7b602e2.chunk.js +33 -0
- package/build/users-roles-settings-page.ce5b582d.chunk.js +30 -0
- package/build/webhook-edit-page.1215a6b7.chunk.js +75 -0
- package/build/{webhook-list-page.42533b59.chunk.js → webhook-list-page.b87821f2.chunk.js} +1 -1
- package/ee/server/services/passport/provider-registry.js +1 -1
- package/package.json +15 -15
- package/utils/get-plugins-path.js +17 -3
- package/admin/src/content-manager/components/RepeatableComponent/AccordionGroupCustom/index.js +0 -122
- package/admin/src/content-manager/components/RepeatableComponent/AddFieldButton.js +0 -58
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/DraggingSibling.js +0 -72
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/IconButtonCustoms.js +0 -32
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/index.js +0 -322
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/utils/connect.js +0 -11
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/utils/index.js +0 -2
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/utils/select.js +0 -30
- package/admin/src/content-manager/components/RepeatableComponent/utils/connect.js +0 -11
- package/admin/src/content-manager/components/RepeatableComponent/utils/select.js +0 -12
- package/admin/src/content-manager/hooks/__test__/usePrev.test.js +0 -26
- package/build/2438.afe24949.chunk.js +0 -2525
- package/build/2517.5cc235ba.chunk.js +0 -117
- package/build/4306.53359960.chunk.js +0 -98
- package/build/8881.bfdb6877.chunk.js +0 -245
- package/build/9707.932a3c12.chunk.js +0 -70
- package/build/Admin-authenticatedApp.cfc3b4c9.chunk.js +0 -80
- package/build/admin-app.ee1211cb.chunk.js +0 -112
- package/build/api-tokens-create-page.4ca2778d.chunk.js +0 -1
- package/build/api-tokens-edit-page.70a791c2.chunk.js +0 -1
- package/build/content-manager.794d3373.chunk.js +0 -1200
- package/build/content-type-builder-list-view.95012cf0.chunk.js +0 -201
- package/build/content-type-builder.95b9d6a2.chunk.js +0 -145
- package/build/email-settings-page.4bb3606f.chunk.js +0 -15
- package/build/main.a6470578.js +0 -2031
- package/build/ru-json.d7cfc2ff.chunk.js +0 -1
- package/build/upload-settings.3010911f.chunk.js +0 -18
- package/build/upload.9f19f2e8.chunk.js +0 -64
- package/build/users-advanced-settings-page.9df41d67.chunk.js +0 -13
- package/build/users-email-settings-page.56d82eaf.chunk.js +0 -28
- package/build/users-providers-settings-page.96bb7da0.chunk.js +0 -33
- package/build/users-roles-settings-page.445e5e16.chunk.js +0 -30
- package/build/webhook-edit-page.c5efc08b.chunk.js +0 -75
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/admin",
|
|
3
|
-
"version": "4.6.0-
|
|
3
|
+
"version": "4.6.0-beta.0",
|
|
4
4
|
"description": "Strapi Admin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"@fortawesome/free-solid-svg-icons": "^5.15.3",
|
|
52
52
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
53
53
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.7",
|
|
54
|
-
"@strapi/babel-plugin-switch-ee-ce": "4.6.0-
|
|
55
|
-
"@strapi/design-system": "1.
|
|
56
|
-
"@strapi/helper-plugin": "4.6.0-
|
|
57
|
-
"@strapi/icons": "1.
|
|
58
|
-
"@strapi/permissions": "4.6.0-
|
|
59
|
-
"@strapi/typescript-utils": "4.6.0-
|
|
60
|
-
"@strapi/utils": "4.6.0-
|
|
54
|
+
"@strapi/babel-plugin-switch-ee-ce": "4.6.0-beta.0",
|
|
55
|
+
"@strapi/design-system": "1.4.0",
|
|
56
|
+
"@strapi/helper-plugin": "4.6.0-beta.0",
|
|
57
|
+
"@strapi/icons": "1.4.0",
|
|
58
|
+
"@strapi/permissions": "4.6.0-beta.0",
|
|
59
|
+
"@strapi/typescript-utils": "4.6.0-beta.0",
|
|
60
|
+
"@strapi/utils": "4.6.0-beta.0",
|
|
61
61
|
"axios": "0.27.2",
|
|
62
62
|
"babel-loader": "8.2.5",
|
|
63
63
|
"babel-plugin-styled-components": "2.0.2",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"markdown-it-sup": "1.0.0",
|
|
103
103
|
"match-sorter": "^4.0.2",
|
|
104
104
|
"mini-css-extract-plugin": "2.4.4",
|
|
105
|
-
"msw": "0.
|
|
105
|
+
"msw": "0.49.1",
|
|
106
106
|
"node-polyfill-webpack-plugin": "2.0.1",
|
|
107
107
|
"p-map": "4.0.0",
|
|
108
108
|
"passport-local": "1.0.0",
|
|
@@ -110,10 +110,10 @@
|
|
|
110
110
|
"qs": "6.10.1",
|
|
111
111
|
"react": "^17.0.2",
|
|
112
112
|
"react-copy-to-clipboard": "^5.1.0",
|
|
113
|
-
"react-dnd": "
|
|
114
|
-
"react-dnd-html5-backend": "
|
|
113
|
+
"react-dnd": "15.1.2",
|
|
114
|
+
"react-dnd-html5-backend": "15.1.2",
|
|
115
115
|
"react-dom": "^17.0.2",
|
|
116
|
-
"react-error-boundary": "3.1.
|
|
116
|
+
"react-error-boundary": "3.1.4",
|
|
117
117
|
"react-fast-compare": "^3.2.0",
|
|
118
118
|
"react-helmet": "^6.1.0",
|
|
119
119
|
"react-intl": "5.25.1",
|
|
@@ -122,12 +122,12 @@
|
|
|
122
122
|
"react-redux": "7.2.8",
|
|
123
123
|
"react-refresh": "0.14.0",
|
|
124
124
|
"react-router": "5.2.0",
|
|
125
|
-
"react-router-dom": "5.
|
|
125
|
+
"react-router-dom": "5.3.4",
|
|
126
126
|
"react-window": "1.8.7",
|
|
127
127
|
"redux": "^4.0.1",
|
|
128
128
|
"reselect": "^4.0.0",
|
|
129
129
|
"rimraf": "3.0.2",
|
|
130
|
-
"sanitize-html": "2.7.
|
|
130
|
+
"sanitize-html": "2.7.3",
|
|
131
131
|
"semver": "7.3.8",
|
|
132
132
|
"sift": "16.0.0",
|
|
133
133
|
"style-loader": "3.3.1",
|
|
@@ -166,5 +166,5 @@
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
},
|
|
169
|
-
"gitHead": "
|
|
169
|
+
"gitHead": "c0c3365ad801d088a6ab6c4eb95a014078429747"
|
|
170
170
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const { join, resolve } = require('path');
|
|
3
|
+
const { join, resolve, sep, posix } = require('path');
|
|
4
4
|
const fs = require('fs-extra');
|
|
5
5
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
6
6
|
const glob = require('glob');
|
|
@@ -8,8 +8,22 @@ const glob = require('glob');
|
|
|
8
8
|
// Only for dev environement
|
|
9
9
|
const getPluginsPath = () => {
|
|
10
10
|
const rootPath = resolve(__dirname, '..', join('..', '..', '..', 'packages'));
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* So `glob` only supports '/' as a path separator, so we need to replace
|
|
13
|
+
* the path separator for the current OS with '/'. e.g. on windows it's `\`.
|
|
14
|
+
*
|
|
15
|
+
* see https://github.com/isaacs/node-glob/#windows for more information
|
|
16
|
+
*
|
|
17
|
+
* and see https://github.com/isaacs/node-glob/issues/467#issuecomment-1114240501 for the recommended fix.
|
|
18
|
+
*/
|
|
19
|
+
let corePath = join(rootPath, 'core', '*');
|
|
20
|
+
let pluginsPath = join(rootPath, 'plugins', '*');
|
|
21
|
+
|
|
22
|
+
if (process.platform === 'win32') {
|
|
23
|
+
corePath = corePath.split(sep).join(posix.sep);
|
|
24
|
+
pluginsPath = pluginsPath.split(sep).join(posix.sep);
|
|
25
|
+
}
|
|
26
|
+
|
|
13
27
|
const corePackageDirs = glob.sync(corePath);
|
|
14
28
|
const pluginsPackageDirs = glob.sync(pluginsPath);
|
|
15
29
|
|
package/admin/src/content-manager/components/RepeatableComponent/AccordionGroupCustom/index.js
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import React, { Children, cloneElement } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { useIntl } from 'react-intl';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
import { Box } from '@strapi/design-system/Box';
|
|
6
|
-
import { Typography } from '@strapi/design-system/Typography';
|
|
7
|
-
import { Flex } from '@strapi/design-system/Flex';
|
|
8
|
-
import { KeyboardNavigable } from '@strapi/design-system/KeyboardNavigable';
|
|
9
|
-
|
|
10
|
-
const AccordionFooter = styled(Box)`
|
|
11
|
-
overflow: hidden;
|
|
12
|
-
border-bottom: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
13
|
-
border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
14
|
-
border-left: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
15
|
-
border-radius: 0 0 ${({ theme }) => theme.borderRadius} ${({ theme }) => theme.borderRadius};
|
|
16
|
-
`;
|
|
17
|
-
|
|
18
|
-
const EnhancedGroup = styled(Box)`
|
|
19
|
-
> div {
|
|
20
|
-
& > * {
|
|
21
|
-
border-radius: unset;
|
|
22
|
-
border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
23
|
-
border-left: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
24
|
-
border-bottom: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
25
|
-
}
|
|
26
|
-
> div {
|
|
27
|
-
> div:first-of-type {
|
|
28
|
-
border-radius: unset;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
> div:first-of-type {
|
|
34
|
-
> div {
|
|
35
|
-
border-radius: ${({ theme }) => theme.borderRadius} ${({ theme }) => theme.borderRadius} 0 0;
|
|
36
|
-
> div:first-of-type {
|
|
37
|
-
border-radius: ${({ theme }) => theme.borderRadius} ${({ theme }) => theme.borderRadius} 0 0;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
> div:not([data-strapi-expanded='true']) {
|
|
42
|
-
border-top: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
43
|
-
|
|
44
|
-
&:hover {
|
|
45
|
-
border-top: 1px solid ${({ theme }) => theme.colors.primary600};
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
> span {
|
|
50
|
-
border-radius: ${({ theme }) => theme.borderRadius} ${({ theme }) => theme.borderRadius} 0 0;
|
|
51
|
-
border-top: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
& [data-strapi-expanded='true'] {
|
|
56
|
-
border: 1px solid ${({ theme }) => theme.colors.primary600};
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
${({ theme, footer }) => `
|
|
60
|
-
&:not(${footer}) {
|
|
61
|
-
& > *:last-of-type {
|
|
62
|
-
border-radius: 0 0 ${theme.borderRadius} ${theme.borderRadius};
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
`}
|
|
66
|
-
`;
|
|
67
|
-
|
|
68
|
-
const LabelAction = styled(Box)`
|
|
69
|
-
svg path {
|
|
70
|
-
fill: ${({ theme }) => theme.colors.neutral500};
|
|
71
|
-
}
|
|
72
|
-
`;
|
|
73
|
-
|
|
74
|
-
const AccordionGroupCustom = ({ children, footer, label, labelAction, error }) => {
|
|
75
|
-
const { formatMessage } = useIntl();
|
|
76
|
-
const childrenArray = Children.toArray(children).map((child) => {
|
|
77
|
-
return cloneElement(child, { hasErrorMessage: false });
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
return (
|
|
81
|
-
<KeyboardNavigable attributeName="data-strapi-accordion-toggle">
|
|
82
|
-
{label && (
|
|
83
|
-
<Flex paddingBottom={1}>
|
|
84
|
-
<Typography as="label" textColor="neutral800" variant="pi" fontWeight="bold">
|
|
85
|
-
{label}
|
|
86
|
-
</Typography>
|
|
87
|
-
{labelAction && <LabelAction paddingLeft={1}>{labelAction}</LabelAction>}
|
|
88
|
-
</Flex>
|
|
89
|
-
)}
|
|
90
|
-
<EnhancedGroup footer={footer}>{childrenArray}</EnhancedGroup>
|
|
91
|
-
{footer && <AccordionFooter>{footer}</AccordionFooter>}
|
|
92
|
-
{error && (
|
|
93
|
-
<Box paddingTop={1}>
|
|
94
|
-
<Typography variant="pi" textColor="danger600">
|
|
95
|
-
{formatMessage({ id: error.id, defaultMessage: error.id }, { ...error.values })}
|
|
96
|
-
</Typography>
|
|
97
|
-
</Box>
|
|
98
|
-
)}
|
|
99
|
-
</KeyboardNavigable>
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
AccordionGroupCustom.defaultProps = {
|
|
104
|
-
error: undefined,
|
|
105
|
-
footer: null,
|
|
106
|
-
label: null,
|
|
107
|
-
labelAction: undefined,
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
AccordionGroupCustom.propTypes = {
|
|
111
|
-
children: PropTypes.node.isRequired,
|
|
112
|
-
error: PropTypes.shape({
|
|
113
|
-
id: PropTypes.string.isRequired,
|
|
114
|
-
defaultMessage: PropTypes.string.isRequired,
|
|
115
|
-
values: PropTypes.object,
|
|
116
|
-
}),
|
|
117
|
-
footer: PropTypes.node,
|
|
118
|
-
label: PropTypes.string,
|
|
119
|
-
labelAction: PropTypes.node,
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
export default AccordionGroupCustom;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { useIntl } from 'react-intl';
|
|
5
|
-
import { Box } from '@strapi/design-system/Box';
|
|
6
|
-
import { Flex } from '@strapi/design-system/Flex';
|
|
7
|
-
import { Typography } from '@strapi/design-system/Typography';
|
|
8
|
-
import Plus from '@strapi/icons/Plus';
|
|
9
|
-
import { pxToRem } from '@strapi/helper-plugin';
|
|
10
|
-
import { getTrad } from '../../utils';
|
|
11
|
-
|
|
12
|
-
const StyledButton = styled(Box)`
|
|
13
|
-
width: 100%;
|
|
14
|
-
border-top: 1px solid ${({ theme }) => theme.colors.neutral200};
|
|
15
|
-
cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
|
|
16
|
-
`;
|
|
17
|
-
|
|
18
|
-
const StyledIcon = styled(Plus)`
|
|
19
|
-
width: ${pxToRem(10)};
|
|
20
|
-
height: ${pxToRem(10)};
|
|
21
|
-
margin-right: ${({ theme }) => theme.spaces[2]};
|
|
22
|
-
|
|
23
|
-
> path {
|
|
24
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
|
25
|
-
}
|
|
26
|
-
`;
|
|
27
|
-
|
|
28
|
-
const Button = ({ disabled, onClick }) => {
|
|
29
|
-
const { formatMessage } = useIntl();
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<StyledButton
|
|
33
|
-
as="button"
|
|
34
|
-
disabled={disabled}
|
|
35
|
-
type="button"
|
|
36
|
-
paddingTop={2}
|
|
37
|
-
paddingBottom={2}
|
|
38
|
-
onClick={onClick}
|
|
39
|
-
>
|
|
40
|
-
<Flex justifyContent="center">
|
|
41
|
-
<Typography fontWeight="bold" textColor="primary600">
|
|
42
|
-
<StyledIcon />
|
|
43
|
-
{formatMessage({
|
|
44
|
-
id: getTrad('containers.EditView.add.new-entry'),
|
|
45
|
-
defaultMessage: 'Add an entry',
|
|
46
|
-
})}
|
|
47
|
-
</Typography>
|
|
48
|
-
</Flex>
|
|
49
|
-
</StyledButton>
|
|
50
|
-
);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
Button.propTypes = {
|
|
54
|
-
disabled: PropTypes.bool.isRequired,
|
|
55
|
-
onClick: PropTypes.func.isRequired,
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export default Button;
|
package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/DraggingSibling.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { Stack } from '@strapi/design-system/Stack';
|
|
5
|
-
import { Flex } from '@strapi/design-system/Flex';
|
|
6
|
-
import { TextButton } from '@strapi/design-system/TextButton';
|
|
7
|
-
import { Icon } from '@strapi/design-system/Icon';
|
|
8
|
-
import { Typography } from '@strapi/design-system/Typography';
|
|
9
|
-
import Trash from '@strapi/icons/Trash';
|
|
10
|
-
import Drag from '@strapi/icons/Drag';
|
|
11
|
-
import DropdownIcon from '@strapi/icons/CarretDown';
|
|
12
|
-
import { CustomIconButtonSibling } from './IconButtonCustoms';
|
|
13
|
-
|
|
14
|
-
const SiblingWrapper = styled.span`
|
|
15
|
-
display: flex;
|
|
16
|
-
justify-content: space-between;
|
|
17
|
-
padding-left: ${({ theme }) => theme.spaces[4]};
|
|
18
|
-
padding-right: ${({ theme }) => theme.spaces[4]};
|
|
19
|
-
background-color: ${({ theme }) => theme.colors.neutral0};
|
|
20
|
-
height: ${50 / 16}rem;
|
|
21
|
-
`;
|
|
22
|
-
|
|
23
|
-
const ToggleButton = styled(TextButton)`
|
|
24
|
-
text-align: left;
|
|
25
|
-
|
|
26
|
-
svg {
|
|
27
|
-
width: ${14 / 16}rem;
|
|
28
|
-
height: ${14 / 16}rem;
|
|
29
|
-
|
|
30
|
-
path {
|
|
31
|
-
fill: ${({ theme, expanded }) =>
|
|
32
|
-
expanded ? theme.colors.primary600 : theme.colors.neutral500};
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
`;
|
|
36
|
-
|
|
37
|
-
const DraggingSibling = ({ displayedValue }) => {
|
|
38
|
-
return (
|
|
39
|
-
<SiblingWrapper>
|
|
40
|
-
<Stack horizontal spacing={3} flex={1}>
|
|
41
|
-
<Flex
|
|
42
|
-
justifyContent="center"
|
|
43
|
-
borderRadius="50%"
|
|
44
|
-
height={`${24 / 16}rem}`}
|
|
45
|
-
width={`${24 / 16}rem}`}
|
|
46
|
-
aria-hidden
|
|
47
|
-
as="span"
|
|
48
|
-
background="neutral200"
|
|
49
|
-
>
|
|
50
|
-
<Icon as={DropdownIcon} width={`${8 / 16}rem}`} color="neutral600" />
|
|
51
|
-
</Flex>
|
|
52
|
-
|
|
53
|
-
<ToggleButton onClick={() => {}} flex={1}>
|
|
54
|
-
<Typography fontWeight="bold" textColor="neutral700">
|
|
55
|
-
{displayedValue}
|
|
56
|
-
</Typography>
|
|
57
|
-
</ToggleButton>
|
|
58
|
-
</Stack>
|
|
59
|
-
|
|
60
|
-
<Stack horizontal spacing={0}>
|
|
61
|
-
<CustomIconButtonSibling noBorder onClick={() => {}} icon={<Trash />} />
|
|
62
|
-
<CustomIconButtonSibling icon={<Drag />} noBorder />
|
|
63
|
-
</Stack>
|
|
64
|
-
</SiblingWrapper>
|
|
65
|
-
);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
DraggingSibling.propTypes = {
|
|
69
|
-
displayedValue: PropTypes.string.isRequired,
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
export default DraggingSibling;
|
package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/IconButtonCustoms.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { IconButton } from '@strapi/design-system/IconButton';
|
|
3
|
-
|
|
4
|
-
export const CustomIconButton = styled(IconButton)`
|
|
5
|
-
background-color: transparent;
|
|
6
|
-
|
|
7
|
-
svg {
|
|
8
|
-
path {
|
|
9
|
-
fill: ${({ theme, expanded }) =>
|
|
10
|
-
expanded ? theme.colors.primary600 : theme.colors.neutral600};
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
&:hover {
|
|
15
|
-
svg {
|
|
16
|
-
path {
|
|
17
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
`;
|
|
22
|
-
|
|
23
|
-
export const CustomIconButtonSibling = styled(IconButton)`
|
|
24
|
-
background-color: transparent;
|
|
25
|
-
|
|
26
|
-
svg {
|
|
27
|
-
path {
|
|
28
|
-
fill: ${({ theme, expanded }) =>
|
|
29
|
-
expanded ? theme.colors.primary600 : theme.colors.neutral600};
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
`;
|