@strapi/admin 4.0.7 → 4.0.8
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/EditViewDataManagerProvider/utils/isValidJSONString.js +15 -0
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/schema.js +11 -12
- package/admin/src/content-manager/components/InputJSON/index.js +1 -1
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/index.js +4 -0
- package/admin/src/content-manager/pages/EditSettingsView/components/FormModal.js +4 -3
- package/admin/src/content-manager/pages/EditSettingsView/components/ModalForm.js +46 -4
- package/admin/src/content-manager/pages/EditSettingsView/index.js +10 -1
- package/admin/src/content-manager/pages/EditSettingsView/reducer.js +26 -5
- package/admin/src/content-manager/pages/EditSettingsView/utils/layout.js +40 -9
- package/admin/src/content-manager/pages/EditView/index.js +2 -1
- package/admin/src/pages/MarketplacePage/index.js +13 -13
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/ListView/index.js +4 -1
- package/admin/src/translations/en.json +4 -1
- package/admin/src/translations/fr.json +3 -0
- package/admin/src/translations/zh-Hans.json +9 -9
- package/build/1856.a06395b4.chunk.js +1 -0
- package/build/2481.7d15bd79.chunk.js +1 -0
- package/build/2912.38fb9bd1.chunk.js +1 -0
- package/build/{3215.b6c950c2.chunk.js → 3215.4d042146.chunk.js} +2 -2
- package/build/{3215.b6c950c2.chunk.js.LICENSE.txt → 3215.4d042146.chunk.js.LICENSE.txt} +0 -0
- package/build/4261.a4e1e93c.chunk.js +1 -0
- package/build/4362.e3d2d72b.chunk.js +1 -0
- package/build/460.639962f0.chunk.js +2 -0
- package/build/{6060.1a1bd16a.chunk.js.LICENSE.txt → 460.639962f0.chunk.js.LICENSE.txt} +0 -0
- package/build/4715.31ca1967.chunk.js +1 -0
- package/build/4741.c2bfe032.chunk.js +2 -0
- package/build/{4741.57e58885.chunk.js.LICENSE.txt → 4741.c2bfe032.chunk.js.LICENSE.txt} +0 -0
- package/build/497.8f30da61.chunk.js +1 -0
- package/build/4982.da4adb38.chunk.js +1 -0
- package/build/5032.ed02a466.chunk.js +2 -0
- package/build/{4801.3a0d8fcd.chunk.js.LICENSE.txt → 5032.ed02a466.chunk.js.LICENSE.txt} +0 -0
- package/build/6250.dc6d7a58.chunk.js +1 -0
- package/build/6925.bd694b04.chunk.js +2 -0
- package/build/{6925.4767e761.chunk.js.LICENSE.txt → 6925.bd694b04.chunk.js.LICENSE.txt} +2 -1
- package/build/7841.ef9bcee9.chunk.js +1 -0
- package/build/849.9075d399.chunk.js +1 -0
- package/build/{9235.63b1528f.chunk.js → 9235.ced8aebf.chunk.js} +1 -1
- package/build/9238.bdd93dae.chunk.js +1 -0
- package/build/{Admin-authenticatedApp.c6b9128c.chunk.js → Admin-authenticatedApp.f65c428a.chunk.js} +1 -1
- package/build/Admin_homePage.a20b5e76.chunk.js +1 -0
- package/build/Admin_marketplace.e8654056.chunk.js +1 -0
- package/build/{Admin_pluginsPage.0d59d86e.chunk.js → Admin_pluginsPage.7d1bd7ce.chunk.js} +1 -1
- package/build/{Admin_profilePage.c08119de.chunk.js → Admin_profilePage.67dd744c.chunk.js} +1 -1
- package/build/{Admin_settingsPage.97246c41.chunk.js → Admin_settingsPage.05877e0b.chunk.js} +1 -1
- package/build/{admin-edit-roles-page.8af004a6.chunk.js → admin-edit-roles-page.2d1b6461.chunk.js} +1 -1
- package/build/{admin-edit-users.73877840.chunk.js → admin-edit-users.e736db15.chunk.js} +1 -1
- package/build/admin-users.5f79c031.chunk.js +1 -0
- package/build/api-tokens-create-page.10586e16.chunk.js +1 -0
- package/build/{api-tokens-create-page.ebe57c8e.chunk.js → api-tokens-edit-page.f9e3038d.chunk.js} +1 -1
- package/build/{api-tokens-list-page.f01b7b98.chunk.js → api-tokens-list-page.e071058b.chunk.js} +1 -1
- package/build/codemirror-css.48b438c9.chunk.js +1 -0
- package/build/{codemirror-javacript.381a518a.chunk.js → codemirror-javacript.8c7c015d.chunk.js} +1 -1
- package/build/content-manager.07db1dd9.chunk.js +1 -0
- package/build/content-type-builder.52f5975c.chunk.js +1 -0
- package/build/email-settings-page.4338588d.chunk.js +1 -0
- package/build/en-json.3422a59e.chunk.js +1 -0
- package/build/fr-json.390bcdeb.chunk.js +1 -0
- package/build/i18n-settings-page.51e37957.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/main.59b96514.js +2 -0
- package/build/{main.fcbcdd20.js.LICENSE.txt → main.59b96514.js.LICENSE.txt} +0 -0
- package/build/{runtime~main.32f93f84.js → runtime~main.75c67df1.js} +1 -1
- package/build/{sso-settings-page.36c35df0.chunk.js → sso-settings-page.c073b6d7.chunk.js} +1 -1
- package/build/upload-settings.62631a39.chunk.js +1 -0
- package/build/upload.803ab265.chunk.js +1 -0
- package/build/users-advanced-settings-page.7694d3c9.chunk.js +1 -0
- package/build/webhook-edit-page.adad0a42.chunk.js +1 -0
- package/build/webhook-list-page.5c8f2a91.chunk.js +1 -0
- package/build/zh-Hans-json.5843950b.chunk.js +1 -0
- package/index.js +1 -1
- package/package.json +9 -9
- package/build/1024.efaaca35.chunk.js +0 -1
- package/build/1856.ec8cf094.chunk.js +0 -1
- package/build/2912.b886455f.chunk.js +0 -1
- package/build/4261.d5024c20.chunk.js +0 -1
- package/build/4362.0700c5df.chunk.js +0 -1
- package/build/4672.e18b4834.chunk.js +0 -1
- package/build/4715.7f86301d.chunk.js +0 -1
- package/build/4741.57e58885.chunk.js +0 -2
- package/build/4801.3a0d8fcd.chunk.js +0 -2
- package/build/497.9a3be008.chunk.js +0 -1
- package/build/4982.52a2ce10.chunk.js +0 -1
- package/build/6060.1a1bd16a.chunk.js +0 -2
- package/build/6250.2172d040.chunk.js +0 -1
- package/build/6925.4767e761.chunk.js +0 -2
- package/build/7841.c4d33a2f.chunk.js +0 -1
- package/build/849.46892e8e.chunk.js +0 -1
- package/build/Admin_homePage.f044cfaf.chunk.js +0 -1
- package/build/Admin_marketplace.1cf20eeb.chunk.js +0 -1
- package/build/admin-users.e0558d75.chunk.js +0 -1
- package/build/api-tokens-edit-page.35e1522b.chunk.js +0 -1
- package/build/codemirror-css.17bc19d4.chunk.js +0 -1
- package/build/content-manager.9c7ee647.chunk.js +0 -1
- package/build/content-type-builder.7673250d.chunk.js +0 -1
- package/build/email-settings-page.448433af.chunk.js +0 -1
- package/build/en-json.ec998c8f.chunk.js +0 -1
- package/build/fr-json.bae03a2c.chunk.js +0 -1
- package/build/i18n-settings-page.0ba8ab95.chunk.js +0 -1
- package/build/main.fcbcdd20.js +0 -2
- package/build/upload-settings.113fd6b8.chunk.js +0 -1
- package/build/upload.36c37a29.chunk.js +0 -1
- package/build/users-advanced-settings-page.627f173b.chunk.js +0 -1
- package/build/webhook-edit-page.e463d0ab.chunk.js +0 -1
- package/build/webhook-list-page.b7649616.chunk.js +0 -1
- package/build/zh-Hans-json.fcc53388.chunk.js +0 -1
package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/isValidJSONString.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const isValidJSONString = value => {
|
|
2
|
+
if (typeof value === 'string' && value.startsWith('"') && value.endsWith('"')) {
|
|
3
|
+
try {
|
|
4
|
+
JSON.parse(value);
|
|
5
|
+
|
|
6
|
+
return true;
|
|
7
|
+
} catch {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return false;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default isValidJSONString;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
isNaN,
|
|
10
|
-
toNumber,
|
|
11
|
-
} from 'lodash';
|
|
1
|
+
import get from 'lodash/get';
|
|
2
|
+
import isBoolean from 'lodash/isBoolean';
|
|
3
|
+
import isNumber from 'lodash/isNumber';
|
|
4
|
+
import isNull from 'lodash/isNull';
|
|
5
|
+
import isObject from 'lodash/isObject';
|
|
6
|
+
import isEmpty from 'lodash/isEmpty';
|
|
7
|
+
import isNaN from 'lodash/isNaN';
|
|
8
|
+
import toNumber from 'lodash/toNumber';
|
|
12
9
|
|
|
13
10
|
import * as yup from 'yup';
|
|
14
11
|
import { translatedErrors as errorsTrads } from '@strapi/helper-plugin';
|
|
15
12
|
|
|
13
|
+
import isValidJSONString from './isValidJSONString';
|
|
14
|
+
|
|
16
15
|
yup.addMethod(yup.mixed, 'defined', function() {
|
|
17
16
|
return this.test('defined', errorsTrads.required, value => value !== undefined);
|
|
18
17
|
});
|
|
@@ -224,7 +223,7 @@ const createYupSchemaAttribute = (type, validations, options) => {
|
|
|
224
223
|
return true;
|
|
225
224
|
}
|
|
226
225
|
|
|
227
|
-
if (
|
|
226
|
+
if (isValidJSONString(value) || isNumber(value) || isNull(value) || isObject(value)) {
|
|
228
227
|
return true;
|
|
229
228
|
}
|
|
230
229
|
|
|
@@ -80,7 +80,7 @@ class InputJSON extends React.Component {
|
|
|
80
80
|
try {
|
|
81
81
|
if (value === null) return this.codeMirror.setValue('');
|
|
82
82
|
|
|
83
|
-
const nextValue =
|
|
83
|
+
const nextValue = stringify(value, null, 2);
|
|
84
84
|
|
|
85
85
|
return this.codeMirror.setValue(nextValue);
|
|
86
86
|
} catch (err) {
|
|
@@ -121,6 +121,10 @@ const DraggedItem = ({
|
|
|
121
121
|
if (dragIndex > hoverIndex && hoverClientY > hoverMiddleY) {
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
+
// If They are not in the same level, should not move
|
|
125
|
+
if (dragPath.split('.').length !== hoverPath.split('.').length) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
124
128
|
// Time to actually perform the action in the data
|
|
125
129
|
moveComponentField(pathToComponentArray, dragIndex, hoverIndex);
|
|
126
130
|
|
|
@@ -26,7 +26,7 @@ const HeaderContainer = styled(Flex)`
|
|
|
26
26
|
}
|
|
27
27
|
`;
|
|
28
28
|
|
|
29
|
-
const FormModal = ({ onToggle,
|
|
29
|
+
const FormModal = ({ onToggle, onMetaChange, onSizeChange, onSubmit, type }) => {
|
|
30
30
|
const { selectedField } = useLayoutDnd();
|
|
31
31
|
const { formatMessage } = useIntl();
|
|
32
32
|
|
|
@@ -61,7 +61,7 @@ const FormModal = ({ onToggle, onChange, onSubmit, type }) => {
|
|
|
61
61
|
</ModalHeader>
|
|
62
62
|
<ModalBody>
|
|
63
63
|
<Grid gap={4}>
|
|
64
|
-
<ModalForm
|
|
64
|
+
<ModalForm onMetaChange={onMetaChange} onSizeChange={onSizeChange} />
|
|
65
65
|
</Grid>
|
|
66
66
|
</ModalBody>
|
|
67
67
|
<ModalFooter
|
|
@@ -84,7 +84,8 @@ const FormModal = ({ onToggle, onChange, onSubmit, type }) => {
|
|
|
84
84
|
FormModal.propTypes = {
|
|
85
85
|
onSubmit: PropTypes.func.isRequired,
|
|
86
86
|
onToggle: PropTypes.func.isRequired,
|
|
87
|
-
|
|
87
|
+
onMetaChange: PropTypes.func.isRequired,
|
|
88
|
+
onSizeChange: PropTypes.func.isRequired,
|
|
88
89
|
type: PropTypes.string.isRequired,
|
|
89
90
|
};
|
|
90
91
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { useMemo, useCallback } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import get from 'lodash/get';
|
|
3
4
|
import { GridItem } from '@strapi/design-system/Grid';
|
|
5
|
+
import { Select, Option } from '@strapi/design-system/Select';
|
|
4
6
|
import { useSelector, shallowEqual } from 'react-redux';
|
|
5
7
|
import { useIntl } from 'react-intl';
|
|
6
8
|
import { useLayoutDnd } from '../../../hooks';
|
|
@@ -9,7 +11,11 @@ import { makeSelectModelAndComponentSchemas } from '../../App/selectors';
|
|
|
9
11
|
import getTrad from '../../../utils/getTrad';
|
|
10
12
|
import GenericInput from './GenericInput';
|
|
11
13
|
|
|
12
|
-
const
|
|
14
|
+
const FIELD_SIZES = [[4, '33%'], [6, '50%'], [8, '66%'], [12, '100%']];
|
|
15
|
+
|
|
16
|
+
const NON_RESIZABLE_FIELD_TYPES = ['dynamiczone', 'component', 'json', 'richtext'];
|
|
17
|
+
|
|
18
|
+
const ModalForm = ({ onMetaChange, onSizeChange }) => {
|
|
13
19
|
const { formatMessage } = useIntl();
|
|
14
20
|
const { modifiedData, selectedField, attributes, fieldForm } = useLayoutDnd();
|
|
15
21
|
const schemasSelector = useMemo(makeSelectModelAndComponentSchemas, []);
|
|
@@ -44,7 +50,7 @@ const ModalForm = ({ onChange }) => {
|
|
|
44
50
|
[selectedField, componentsAndModelsPossibleMainFields, modifiedData]
|
|
45
51
|
);
|
|
46
52
|
|
|
47
|
-
|
|
53
|
+
const metaFields = formToDisplay.map(meta => {
|
|
48
54
|
const formType = get(attributes, [selectedField, 'type']);
|
|
49
55
|
|
|
50
56
|
if (
|
|
@@ -77,13 +83,49 @@ const ModalForm = ({ onChange }) => {
|
|
|
77
83
|
id: get(getInputProps(meta), 'label.id', 'app.utils.defaultMessage'),
|
|
78
84
|
})}
|
|
79
85
|
name={meta}
|
|
80
|
-
onChange={
|
|
81
|
-
value={get(fieldForm, meta, '')}
|
|
86
|
+
onChange={onMetaChange}
|
|
87
|
+
value={get(fieldForm, ['metadata', meta], '')}
|
|
82
88
|
options={getSelectedItemSelectOptions(formType)}
|
|
83
89
|
/>
|
|
84
90
|
</GridItem>
|
|
85
91
|
);
|
|
86
92
|
});
|
|
93
|
+
|
|
94
|
+
const canResize = !NON_RESIZABLE_FIELD_TYPES.includes(attributes[selectedField].type);
|
|
95
|
+
|
|
96
|
+
const sizeField = (
|
|
97
|
+
<GridItem col={6} key="size">
|
|
98
|
+
<Select
|
|
99
|
+
value={fieldForm?.size}
|
|
100
|
+
name="size"
|
|
101
|
+
onChange={value => {
|
|
102
|
+
onSizeChange({ name: selectedField, value });
|
|
103
|
+
}}
|
|
104
|
+
label={formatMessage({
|
|
105
|
+
id: getTrad('containers.SettingPage.editSettings.size.label'),
|
|
106
|
+
defaultMessage: 'Size',
|
|
107
|
+
})}
|
|
108
|
+
>
|
|
109
|
+
{FIELD_SIZES.map(([value, label]) => (
|
|
110
|
+
<Option key={value} value={value}>
|
|
111
|
+
{label}
|
|
112
|
+
</Option>
|
|
113
|
+
))}
|
|
114
|
+
</Select>
|
|
115
|
+
</GridItem>
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<>
|
|
120
|
+
{metaFields}
|
|
121
|
+
{canResize && sizeField}
|
|
122
|
+
</>
|
|
123
|
+
);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
ModalForm.propTypes = {
|
|
127
|
+
onMetaChange: PropTypes.func.isRequired,
|
|
128
|
+
onSizeChange: PropTypes.func.isRequired,
|
|
87
129
|
};
|
|
88
130
|
|
|
89
131
|
export default ModalForm;
|
|
@@ -110,6 +110,14 @@ const EditSettingsView = ({ mainLayout, components, isContentTypeView, slug, upd
|
|
|
110
110
|
});
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
+
const handleSizeChange = ({ name, value }) => {
|
|
114
|
+
dispatch({
|
|
115
|
+
type: 'ON_CHANGE_SIZE',
|
|
116
|
+
name,
|
|
117
|
+
value,
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
|
|
113
121
|
const handleMetaSubmit = e => {
|
|
114
122
|
e.preventDefault();
|
|
115
123
|
dispatch({
|
|
@@ -365,7 +373,8 @@ const EditSettingsView = ({ mainLayout, components, isContentTypeView, slug, upd
|
|
|
365
373
|
onSubmit={handleMetaSubmit}
|
|
366
374
|
onToggle={handleToggleModal}
|
|
367
375
|
type={get(attributes, [metaToEdit, 'type'], '')}
|
|
368
|
-
|
|
376
|
+
onMetaChange={handleMetaChange}
|
|
377
|
+
onSizeChange={handleSizeChange}
|
|
369
378
|
/>
|
|
370
379
|
)}
|
|
371
380
|
</Main>
|
|
@@ -4,7 +4,7 @@ import get from 'lodash/get';
|
|
|
4
4
|
import cloneDeep from 'lodash/cloneDeep';
|
|
5
5
|
|
|
6
6
|
import { arrayMoveItem } from '../../utils';
|
|
7
|
-
import { formatLayout,
|
|
7
|
+
import { formatLayout, getDefaultInputSize, getFieldSize, setFieldSize } from './utils/layout';
|
|
8
8
|
|
|
9
9
|
const initialState = {
|
|
10
10
|
fieldForm: {},
|
|
@@ -45,7 +45,7 @@ const reducer = (state = initialState, action) =>
|
|
|
45
45
|
}
|
|
46
46
|
case 'ON_ADD_FIELD': {
|
|
47
47
|
const newState = cloneDeep(state);
|
|
48
|
-
const size =
|
|
48
|
+
const size = getDefaultInputSize(
|
|
49
49
|
get(newState, ['modifiedData', 'attributes', action.name, 'type'], '')
|
|
50
50
|
);
|
|
51
51
|
const listSize = get(newState, layoutPathEdit, []).length;
|
|
@@ -76,7 +76,11 @@ const reducer = (state = initialState, action) =>
|
|
|
76
76
|
break;
|
|
77
77
|
}
|
|
78
78
|
case 'ON_CHANGE_META': {
|
|
79
|
-
set(draftState, ['metaForm', ...action.keys], action.value);
|
|
79
|
+
set(draftState, ['metaForm', 'metadata', ...action.keys], action.value);
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
case 'ON_CHANGE_SIZE': {
|
|
83
|
+
set(draftState, ['metaForm', 'size'], action.value);
|
|
80
84
|
break;
|
|
81
85
|
}
|
|
82
86
|
case 'ON_RESET': {
|
|
@@ -168,11 +172,28 @@ const reducer = (state = initialState, action) =>
|
|
|
168
172
|
}
|
|
169
173
|
case 'SET_FIELD_TO_EDIT': {
|
|
170
174
|
draftState.metaToEdit = action.name;
|
|
171
|
-
draftState.metaForm =
|
|
175
|
+
draftState.metaForm = {
|
|
176
|
+
metadata: get(state, ['modifiedData', 'metadatas', action.name, 'edit'], {}),
|
|
177
|
+
size:
|
|
178
|
+
getFieldSize(action.name, state.modifiedData?.layouts?.edit) ?? getDefaultInputSize(),
|
|
179
|
+
};
|
|
180
|
+
|
|
172
181
|
break;
|
|
173
182
|
}
|
|
174
183
|
case 'SUBMIT_META_FORM': {
|
|
175
|
-
set(
|
|
184
|
+
set(
|
|
185
|
+
draftState,
|
|
186
|
+
['modifiedData', 'metadatas', state.metaToEdit, 'edit'],
|
|
187
|
+
state.metaForm.metadata
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
const layoutsCopy = cloneDeep(get(state, layoutPathEdit, []));
|
|
191
|
+
const nextLayoutValue = setFieldSize(state.metaToEdit, state.metaForm.size, layoutsCopy);
|
|
192
|
+
|
|
193
|
+
if (nextLayoutValue.length > 0) {
|
|
194
|
+
set(draftState, layoutPathEdit, formatLayout(nextLayoutValue));
|
|
195
|
+
}
|
|
196
|
+
|
|
176
197
|
break;
|
|
177
198
|
}
|
|
178
199
|
case 'SUBMIT_SUCCEEDED': {
|
|
@@ -28,13 +28,7 @@ const formatLayout = arr => {
|
|
|
28
28
|
|
|
29
29
|
return acc2;
|
|
30
30
|
}, []);
|
|
31
|
-
const rowId =
|
|
32
|
-
acc.length === 0
|
|
33
|
-
? 0
|
|
34
|
-
: Math.max.apply(
|
|
35
|
-
Math,
|
|
36
|
-
acc.map(o => o.rowId)
|
|
37
|
-
) + 1;
|
|
31
|
+
const rowId = acc.length === 0 ? 0 : Math.max.apply(Math, acc.map(o => o.rowId)) + 1;
|
|
38
32
|
|
|
39
33
|
const currentRowSize = getRowSize(currentRow);
|
|
40
34
|
|
|
@@ -75,7 +69,7 @@ const unformatLayout = arr => {
|
|
|
75
69
|
}, []);
|
|
76
70
|
};
|
|
77
71
|
|
|
78
|
-
const
|
|
72
|
+
const getDefaultInputSize = type => {
|
|
79
73
|
switch (type) {
|
|
80
74
|
case 'boolean':
|
|
81
75
|
case 'date':
|
|
@@ -95,4 +89,41 @@ const getInputSize = type => {
|
|
|
95
89
|
}
|
|
96
90
|
};
|
|
97
91
|
|
|
98
|
-
|
|
92
|
+
const getFieldSize = (name, layouts = []) => {
|
|
93
|
+
return layouts.reduce((acc, { rowContent }) => {
|
|
94
|
+
const size = rowContent.find(row => row.name === name)?.size ?? null;
|
|
95
|
+
|
|
96
|
+
if (size) {
|
|
97
|
+
acc = size;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return acc;
|
|
101
|
+
}, null);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const setFieldSize = (name, size, layouts = []) => {
|
|
105
|
+
return layouts.map(row => {
|
|
106
|
+
row.rowContent = row.rowContent.map(column => {
|
|
107
|
+
if (column.name === name) {
|
|
108
|
+
return {
|
|
109
|
+
...column,
|
|
110
|
+
size,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return column;
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
return row;
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export {
|
|
122
|
+
createLayout,
|
|
123
|
+
formatLayout,
|
|
124
|
+
getDefaultInputSize,
|
|
125
|
+
getFieldSize,
|
|
126
|
+
setFieldSize,
|
|
127
|
+
getRowSize,
|
|
128
|
+
unformatLayout,
|
|
129
|
+
};
|
|
@@ -309,6 +309,7 @@ const EditView = ({
|
|
|
309
309
|
)}
|
|
310
310
|
<Box as="aside" aria-labelledby="links">
|
|
311
311
|
<Stack size={2}>
|
|
312
|
+
<InjectionZone area="contentManager.editView.right-links" slug={slug} />
|
|
312
313
|
{slug !== 'strapi::administrator' && (
|
|
313
314
|
<CheckPermissions permissions={ctbPermissions}>
|
|
314
315
|
<LinkButton
|
|
@@ -343,7 +344,7 @@ const EditView = ({
|
|
|
343
344
|
})}
|
|
344
345
|
</LinkButton>
|
|
345
346
|
</CheckPermissions>
|
|
346
|
-
|
|
347
|
+
|
|
347
348
|
{allowedActions.canDelete && (
|
|
348
349
|
<DeleteLink
|
|
349
350
|
isCreatingEntry={isCreatingEntry}
|
|
@@ -10,6 +10,7 @@ import { Stack } from '@strapi/design-system/Stack';
|
|
|
10
10
|
import { LinkButton } from '@strapi/design-system/LinkButton';
|
|
11
11
|
import { Main } from '@strapi/design-system/Main';
|
|
12
12
|
import { Typography } from '@strapi/design-system/Typography';
|
|
13
|
+
import ExternalLink from '@strapi/icons/ExternalLink';
|
|
13
14
|
import adminPermissions from '../../permissions';
|
|
14
15
|
import MarketplacePicture from './assets/marketplace-coming-soon.png';
|
|
15
16
|
|
|
@@ -79,31 +80,30 @@ const MarketPlacePage = () => {
|
|
|
79
80
|
</Typography>
|
|
80
81
|
<Typography variant="alpha" textColor="primary700">
|
|
81
82
|
{formatMessage({
|
|
82
|
-
id: 'admin.pages.MarketPlacePage.
|
|
83
|
-
defaultMessage: '
|
|
83
|
+
id: 'admin.pages.MarketPlacePage.published',
|
|
84
|
+
defaultMessage: 'Finally here.',
|
|
84
85
|
})}
|
|
85
86
|
</Typography>
|
|
86
|
-
<Flex maxWidth={pxToRem(
|
|
87
|
+
<Flex maxWidth={pxToRem(620)} paddingTop={3}>
|
|
87
88
|
<CenterTypography variant="epsilon" textColor="neutral600">
|
|
88
89
|
{formatMessage({
|
|
89
|
-
id: 'admin.pages.MarketPlacePage.content.subtitle',
|
|
90
|
+
id: 'admin.pages.MarketPlacePage.content.subtitle.published',
|
|
90
91
|
defaultMessage:
|
|
91
|
-
'The
|
|
92
|
+
'The web marketplace helps you get the most of Strapi. In addition, we are working hard to offer the best experience to discover and install plugins, directly from the app.',
|
|
92
93
|
})}
|
|
93
94
|
</CenterTypography>
|
|
94
95
|
</Flex>
|
|
95
96
|
<Stack paddingTop={6} horizontal size={2}>
|
|
96
|
-
|
|
97
|
-
{/* <LinkButton href="https://strapi.io/" size="L" variant="secondary">
|
|
97
|
+
<LinkButton href="https://market.strapi.io" size="L" variant="primary" endIcon={<ExternalLink />}>
|
|
98
98
|
{formatMessage({
|
|
99
|
-
id: 'admin.pages.MarketPlacePage.submit.
|
|
100
|
-
defaultMessage: '
|
|
99
|
+
id: 'admin.pages.MarketPlacePage.submit.market.link',
|
|
100
|
+
defaultMessage: 'Visit the web marketplace',
|
|
101
101
|
})}
|
|
102
|
-
</LinkButton>
|
|
103
|
-
<LinkButton href="https://strapi.io/
|
|
102
|
+
</LinkButton>
|
|
103
|
+
<LinkButton href="https://market.strapi.io/submit-plugin" size="L" variant="secondary">
|
|
104
104
|
{formatMessage({
|
|
105
|
-
id: 'admin.pages.MarketPlacePage.
|
|
106
|
-
defaultMessage: '
|
|
105
|
+
id: 'admin.pages.MarketPlacePage.submit.plugin.link',
|
|
106
|
+
defaultMessage: 'Submit your plugin',
|
|
107
107
|
})}
|
|
108
108
|
</LinkButton>
|
|
109
109
|
</Stack>
|
|
@@ -64,9 +64,12 @@
|
|
|
64
64
|
"admin.pages.MarketPlacePage.subtitle": "Get more out of Strapi",
|
|
65
65
|
"admin.pages.MarketPlacePage.coming-soon.1": "A new way to make Strapi awesome.",
|
|
66
66
|
"admin.pages.MarketPlacePage.coming-soon.2": "Coming soon.",
|
|
67
|
+
"admin.pages.MarketPlacePage.published": "Finally here.",
|
|
67
68
|
"admin.pages.MarketPlacePage.content.subtitle": "The new marketplace will help you get more out of Strapi. We are working hard to offer the best experience to discover and install plugins.",
|
|
69
|
+
"admin.pages.MarketPlacePage.content.subtitle.published": "The web marketplace helps you get the most of Strapi. In addition, we are working hard to offer the best experience to discover and install plugins, directly from the app.",
|
|
68
70
|
"admin.pages.MarketPlacePage.submit.plugin.link": "Submit your plugin",
|
|
69
71
|
"admin.pages.MarketPlacePage.blog.link": "Read our blog post",
|
|
72
|
+
"admin.pages.MarketPlacePage.market.link": "Visit the web marketplace",
|
|
70
73
|
"Content Manager": "Content Manager",
|
|
71
74
|
"Content Type Builder": "Content-Types Builder",
|
|
72
75
|
"Documentation": "Documentation",
|
|
@@ -97,7 +100,7 @@
|
|
|
97
100
|
"Settings.apiTokens.copy.editMessage": "For security reasons, you can only see your token once.",
|
|
98
101
|
"Settings.apiTokens.copy.editTitle": "This token isn’t accessible anymore.",
|
|
99
102
|
"Settings.apiTokens.copy.lastWarning": "Make sure to copy this token, you won’t be able to see it again!",
|
|
100
|
-
"Settings.apiTokens.create": "
|
|
103
|
+
"Settings.apiTokens.create": "Create new API Token",
|
|
101
104
|
"Settings.apiTokens.description": "List of generated tokens to consume the API",
|
|
102
105
|
"Settings.apiTokens.emptyStateLayout": "You don’t have any content yet...",
|
|
103
106
|
"Settings.apiTokens.notification.copied": "Token copied to clipboard.",
|
|
@@ -64,9 +64,12 @@
|
|
|
64
64
|
"admin.pages.MarketPlacePage.subtitle":"Tirez le meilleur de Strapi",
|
|
65
65
|
"admin.pages.MarketPlacePage.coming-soon.1":"Une nouvelle façon de rendre Strapi génial.",
|
|
66
66
|
"admin.pages.MarketPlacePage.coming-soon.2":"Bientôt disponible.",
|
|
67
|
+
"admin.pages.MarketPlacePage.published":"Enfin disponible",
|
|
67
68
|
"admin.pages.MarketPlacePage.content.subtitle":"La nouvelle marketplace vous aidera à tirer le meilleur parti de Strapi. Nous travaillons dur pour vous offrir la meilleure expérience possible pour découvrir et installer des plugins.",
|
|
69
|
+
"admin.pages.MarketPlacePage.content.subtitle.published":"La marketplace web vous aide à tirer le meilleur parti de Strapi. En plus, nous travaillons dur pour vous offrir la meilleure expérience possible pour découvrir et installer des plugins, directement depuis Strapi.",
|
|
68
70
|
"admin.pages.MarketPlacePage.submit.plugin.link":"Soumettez votre plugin",
|
|
69
71
|
"admin.pages.MarketPlacePage.blog.link":"Lire notre article de blog",
|
|
72
|
+
"admin.pages.MarketPlacePage.market.link": "Voir la marketplace web",
|
|
70
73
|
"Content Manager": "Content Manager",
|
|
71
74
|
"Content Type Builder": "Content Types Builder",
|
|
72
75
|
"Documentation": "Documentation",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"Auth.form.button.login": "登录",
|
|
9
9
|
"Auth.form.button.login.providers.error": "无法通过选定的验证方式连接你的帐号。",
|
|
10
10
|
"Auth.form.button.login.providers.see-more": "查看更多",
|
|
11
|
-
"Auth.form.button.login.strapi": "
|
|
11
|
+
"Auth.form.button.login.strapi": "通过 Strapi 登录",
|
|
12
12
|
"Auth.form.button.password-recovery": "找回密码",
|
|
13
13
|
"Auth.form.button.register": "准备开始",
|
|
14
14
|
"Auth.form.button.reset-password": "修改密码",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"Auth.form.error.user.not-exist": "这个电子邮件地址不存在。",
|
|
33
33
|
"Auth.form.error.username.taken": "用户名已被占用。",
|
|
34
34
|
"Auth.form.firstname.label": "名字",
|
|
35
|
-
"Auth.form.firstname.placeholder": "
|
|
35
|
+
"Auth.form.firstname.placeholder": "例如:三",
|
|
36
36
|
"Auth.form.forgot-password.email.label": "输入您的电子邮件地址",
|
|
37
37
|
"Auth.form.forgot-password.email.label.success": "邮件成功发送",
|
|
38
38
|
"Auth.form.lastname.label": "姓氏",
|
|
39
|
-
"Auth.form.lastname.placeholder": "
|
|
39
|
+
"Auth.form.lastname.placeholder": "例如:张",
|
|
40
40
|
"Auth.form.password.hide-password": "隐藏密码",
|
|
41
41
|
"Auth.form.password.hint": "密码必须包含至少 8 个字符,1 个大写字母,1 个小写字母,1 个数字",
|
|
42
42
|
"Auth.form.password.label": "密码",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"Auth.form.register.subtitle": "你的凭证只用于管理后台验证你的身份。所有保存的数据都将储存在你自己的数据库中。",
|
|
46
46
|
"Auth.form.rememberMe.label": "记住我",
|
|
47
47
|
"Auth.form.username.label": "用户名",
|
|
48
|
-
"Auth.form.username.placeholder": "
|
|
48
|
+
"Auth.form.username.placeholder": "张三",
|
|
49
49
|
"Auth.form.welcome.subtitle": "登录您的Strapi账户",
|
|
50
50
|
"Auth.form.welcome.title": "欢迎!",
|
|
51
51
|
"Auth.link.forgot-password": "忘记密码?",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"admin.pages.MarketPlacePage.illustration": "市场插图",
|
|
63
63
|
"admin.pages.MarketPlacePage.title": "市场",
|
|
64
64
|
"admin.pages.MarketPlacePage.subtitle": "从Strapi中获得更多",
|
|
65
|
-
"admin.pages.MarketPlacePage.coming-soon.1": "让 Strapi
|
|
66
|
-
"admin.pages.MarketPlacePage.coming-soon.2": "
|
|
65
|
+
"admin.pages.MarketPlacePage.coming-soon.1": "让 Strapi 变得更棒",
|
|
66
|
+
"admin.pages.MarketPlacePage.coming-soon.2": "敬请期待",
|
|
67
67
|
"admin.pages.MarketPlacePage.content.subtitle": "新的市场将帮助你从Strapi中获得更多。我们正在努力提供发现和安装插件的最佳体验。",
|
|
68
68
|
"admin.pages.MarketPlacePage.submit.plugin.link": "提交您的插件",
|
|
69
69
|
"admin.pages.MarketPlacePage.blog.link": "阅读我们的博文",
|
|
@@ -199,16 +199,16 @@
|
|
|
199
199
|
"Settings.webhooks.events.delete": "删除",
|
|
200
200
|
"Settings.webhooks.events.update": "更新",
|
|
201
201
|
"Settings.webhooks.form.events": "事件",
|
|
202
|
-
"Settings.webhooks.form.headers": "
|
|
202
|
+
"Settings.webhooks.form.headers": "请求头",
|
|
203
203
|
"Settings.webhooks.form.name": "名称",
|
|
204
|
-
"Settings.webhooks.form.url": "
|
|
204
|
+
"Settings.webhooks.form.url": "请求地址",
|
|
205
205
|
"Settings.webhooks.headers.remove": "移除第 {number} 行 header",
|
|
206
206
|
"Settings.webhooks.key": "键",
|
|
207
207
|
"Settings.webhooks.list.all-entries.select": "选择所有条目",
|
|
208
208
|
"Settings.webhooks.list.button.add": "添加 Webhook",
|
|
209
209
|
"Settings.webhooks.list.description": "获得 POST 请求的更新通知",
|
|
210
210
|
"Settings.webhooks.list.empty.description": "没有找到 Webhooks",
|
|
211
|
-
"Settings.webhooks.list.empty.link": "
|
|
211
|
+
"Settings.webhooks.list.empty.link": "查看我们的文档",
|
|
212
212
|
"Settings.webhooks.list.empty.title": "还没有 Webhooks",
|
|
213
213
|
"Settings.webhooks.list.select": "选择",
|
|
214
214
|
"Settings.webhooks.list.th.actions": "操作",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[1856],{11856:(e,n,t)=>{"use strict";e.exports=t(34796)},34796:function(e,n,t){var r,o;e.exports=(r=t(32735),o=t(19615),function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=95)}({0:function(e,n,t){e.exports=t(17)()},1:function(e,n){e.exports=r},10:function(e,n,t){var r=t(23),o=t(24),i=t(20),a=t(25);e.exports=function(e,n){return r(e)||o(e,n)||i(e,n)||a()},e.exports.default=e.exports,e.exports.__esModule=!0},13:function(e,n){function t(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=t=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),t(n)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},17:function(e,n,t){"use strict";var r=t(18);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,n,t,o,i,a){if(a!==r){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}function n(){return e}e.isRequired=e;var t={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:n,element:e,elementType:e,instanceOf:n,node:e,objectOf:n,oneOf:n,oneOfType:n,shape:n,exact:n,checkPropTypes:i,resetWarningCache:o};return t.PropTypes=t,t}},18:function(e,n,t){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},19:function(e,n){e.exports=function(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r},e.exports.default=e.exports,e.exports.__esModule=!0},2:function(e,n){e.exports=o},20:function(e,n,t){var r=t(19);e.exports=function(e,n){if(e){if("string"==typeof e)return r(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?r(e,n):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},22:function(e,n){e.exports=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],n.indexOf(t)>=0||(o[t]=e[t]);return o},e.exports.default=e.exports,e.exports.__esModule=!0},23:function(e,n){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},24:function(e,n){e.exports=function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,o,i=[],a=!0,u=!1;try{for(t=t.call(e);!(a=(r=t.next()).done)&&(i.push(r.value),!n||i.length!==n);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==t.return||t.return()}finally{if(u)throw o}}return i}},e.exports.default=e.exports,e.exports.__esModule=!0},25:function(e,n){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},3:function(e,n){e.exports=function(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))},e.exports.default=e.exports,e.exports.__esModule=!0},4:function(e,n,t){"use strict";t.r(n),t.d(n,"Box",(function(){return f}));var r,o=t(3),i=t.n(o),a=t(0),u=t.n(a),s=t(2),c=t.n(s),d=t(7),l={color:!0},f=c.a.div.withConfig({shouldForwardProp:function(e,n){return!l[e]&&n(e)}})(r||(r=i()(["\n // Font\n font-size: ",";\n\n // Colors\n background: ",";\n color: ",";\n\n // Spaces\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n\n // Responsive hiding\n ","\n ","\n \n\n // Borders\n border-radius: ",";\n border-style: ",";\n border-width: ",";\n border-color: ",";\n border: ",";\n\n // Shadows\n box-shadow: ",";\n\n // Handlers\n pointer-events: ",";\n &:hover {\n ","\n }\n\n // Display\n display: ",";\n\n // Position\n position: ",";\n left: ",";\n right: ",";\n top: ",";\n bottom: ",";\n z-index: ",";\n overflow: ",";\n cursor: ",";\n\n // Size\n width: ",";\n max-width: ",";\n min-width: ",";\n height: ",";\n max-height: ",";\n min-height: ",";\n\n // Animation\n transition: ",";\n transform: ",";\n animation: ",";\n\n //Flexbox children props\n flex-shrink: ",";\n flex-grow: ",";\n flex-basis: ",";\n flex: ",";\n\n // Text\n text-align: ",";\n text-transform: ",";\n line-height: ",";\n\n // Cursor\n cursor: ",";\n"])),(function(e){var n=e.fontSize;return e.theme.fontSizes[n]||n}),(function(e){var n=e.theme,t=e.background;return n.colors[t]}),(function(e){var n=e.theme,t=e.color;return n.colors[t]}),(function(e){var n=e.theme,t=e.padding;return Object(d.a)("padding",t,n)}),(function(e){var n=e.theme,t=e.paddingTop;return Object(d.a)("padding-top",t,n)}),(function(e){var n=e.theme,t=e.paddingRight;return Object(d.a)("padding-right",t,n)}),(function(e){var n=e.theme,t=e.paddingBottom;return Object(d.a)("padding-bottom",t,n)}),(function(e){var n=e.theme,t=e.paddingLeft;return Object(d.a)("padding-left",t,n)}),(function(e){var n=e.theme,t=e.marginLeft;return Object(d.a)("margin-left",t,n)}),(function(e){var n=e.theme,t=e.marginRight;return Object(d.a)("margin-right",t,n)}),(function(e){var n=e.theme,t=e.marginTop;return Object(d.a)("margin-top",t,n)}),(function(e){var n=e.theme,t=e.marginBottom;return Object(d.a)("margin-bottom",t,n)}),(function(e){var n=e.theme;return e.hiddenS?"".concat(n.mediaQueries.tablet," { display: none; }"):void 0}),(function(e){var n=e.theme;return e.hiddenXS?"".concat(n.mediaQueries.mobile," { display: none; }"):void 0}),(function(e){var n=e.theme,t=e.hasRadius,r=e.borderRadius;return t?n.borderRadius:r}),(function(e){return e.borderStyle}),(function(e){return e.borderWidth}),(function(e){var n=e.borderColor;return e.theme.colors[n]}),(function(e){var n=e.theme,t=e.borderColor,r=e.borderStyle,o=e.borderWidth;if(t&&!r&&!o)return"1px solid ".concat(n.colors[t])}),(function(e){var n=e.theme,t=e.shadow;return n.shadows[t]}),(function(e){return e.pointerEvents}),(function(e){var n=e._hover,t=e.theme;return n?n(t):void 0}),(function(e){return e.display}),(function(e){return e.position}),(function(e){var n=e.left;return e.theme.spaces[n]||n}),(function(e){var n=e.right;return e.theme.spaces[n]||n}),(function(e){var n=e.top;return e.theme.spaces[n]||n}),(function(e){var n=e.bottom;return e.theme.spaces[n]||n}),(function(e){return e.zIndex}),(function(e){return e.overflow}),(function(e){return e.cursor}),(function(e){var n=e.width;return e.theme.spaces[n]||n}),(function(e){var n=e.maxWidth;return e.theme.spaces[n]||n}),(function(e){var n=e.minWidth;return e.theme.spaces[n]||n}),(function(e){var n=e.height;return e.theme.spaces[n]||n}),(function(e){var n=e.maxHeight;return e.theme.spaces[n]||n}),(function(e){var n=e.minHeight;return e.theme.spaces[n]||n}),(function(e){return e.transition}),(function(e){return e.transform}),(function(e){return e.animation}),(function(e){return e.shrink}),(function(e){return e.grow}),(function(e){return e.basis}),(function(e){return e.flex}),(function(e){return e.textAlign}),(function(e){return e.textTransform}),(function(e){return e.lineHeight}),(function(e){return e.cursor}));f.displayName="Box",f.defaultProps={background:void 0,borderColor:void 0,color:void 0,hiddenS:!1,hiddenXS:!1,padding:void 0,paddingTop:void 0,paddingRight:void 0,paddingBottom:void 0,paddingLeft:void 0,hasRadius:!1,shadow:void 0,children:null,shrink:void 0,grow:void 0,basis:void 0,flex:void 0,_hover:function(){}},f.propTypes={_hover:u.a.func,background:u.a.string,basis:u.a.oneOfType([u.a.string,u.a.string]),borderColor:u.a.string,children:u.a.oneOfType([u.a.node,u.a.string]),color:u.a.string,flex:u.a.oneOfType([u.a.string,u.a.string]),grow:u.a.oneOfType([u.a.string,u.a.string]),hasRadius:u.a.bool,hiddenS:u.a.bool,hiddenXS:u.a.bool,padding:u.a.oneOfType([u.a.number,u.a.arrayOf(u.a.number)]),paddingBottom:u.a.oneOfType([u.a.number,u.a.arrayOf(u.a.number)]),paddingLeft:u.a.oneOfType([u.a.number,u.a.arrayOf(u.a.number)]),paddingRight:u.a.oneOfType([u.a.number,u.a.arrayOf(u.a.number)]),paddingTop:u.a.oneOfType([u.a.number,u.a.arrayOf(u.a.number)]),shadow:u.a.string,shrink:u.a.oneOfType([u.a.string,u.a.string])}},47:function(e,n,t){"use strict";t.d(n,"a",(function(){return o}));var r=t(1),o=function(e,n){Object(r.useEffect)((function(){var t=new ResizeObserver(n);return t.observe(e.current),function(){t.disconnect()}}),[])}},49:function(e,n,t){"use strict";t.r(n),t.d(n,"Grid",(function(){return w})),t.d(n,"GridItem",(function(){return _}));var r,o=t(5),i=t.n(o),a=t(6),u=t.n(a),s=t(3),c=t.n(s),d=t(1),l=t.n(d),f=t(2),p=t.n(f),g=t(0),h=t.n(g),m=Object(d.createContext)({gap:0,gridCols:12}),v=t(4),b=t(7),y=["gap","gridCols"],x=p()(v.Box)(r||(r=c()(["\n display: grid;\n grid-template-columns: repeat(",", 1fr);\n ","\n"])),(function(e){return e.gridCols}),(function(e){var n=e.theme,t=e.gap;return Object(b.a)("gap",t,n)})),w=function(e){var n=e.gap,t=e.gridCols,r=u()(e,y);return l.a.createElement(m.Provider,{value:{gap:n,gridCols:t}},l.a.createElement(x,i()({gap:n,gridCols:t},r)))};w.defaultProps={gap:0,gridCols:12},w.propTypes={gap:h.a.oneOfType([h.a.number,h.a.arrayOf(h.a.number)]),gridCols:h.a.number};var O,S=["col","xs","s"],T=p.a.div(O||(O=c()(["\n grid-column: span ",";\n max-width: 100%;\n\n "," {\n grid-column: span ",";\n }\n\n "," {\n grid-column: span ",";\n }\n"])),(function(e){return e.col}),(function(e){return e.theme.mediaQueries.tablet}),(function(e){return e.s}),(function(e){return e.theme.mediaQueries.mobile}),(function(e){return e.xs})),_=function(e){var n=e.col,t=e.xs,r=e.s,o=u()(e,S),i=Object(d.useContext)(m),a=i.gap,s=i.gridCols;return l.a.createElement(T,{gap:a,gridCols:s,col:n,xs:t,s:r},l.a.createElement(v.Box,o))};_.defaultProps={col:void 0,s:void 0,xs:void 0},_.propTypes={col:h.a.number,s:h.a.number,xs:h.a.number}},5:function(e,n){function t(){return e.exports=t=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,t.apply(this,arguments)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},6:function(e,n,t){var r=t(22);e.exports=function(e,n){if(null==e)return{};var t,o,i=r(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)t=a[o],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i},e.exports.default=e.exports,e.exports.__esModule=!0},7:function(e,n,t){"use strict";var r=t(10),o=t.n(r),i=t(13),a=t.n(i);n.a=function(e,n,t){var r=n;if(Array.isArray(n)||"object"!==a()(n)||(r=[null==n?void 0:n.desktop,null==n?void 0:n.tablet,null==n?void 0:n.mobile]),void 0!==r){if(Array.isArray(r)){var i=r,u=o()(i,3),s=u[0],c=u[1],d=u[2],l="".concat(e,": ").concat(t.spaces[s],";");return void 0!==c&&(l+="".concat(t.mediaQueries.tablet,"{\n ").concat(e,": ").concat(t.spaces[c],";\n }")),void 0!==d&&(l+="".concat(t.mediaQueries.mobile,"{\n ").concat(e,": ").concat(t.spaces[d],";\n }")),l}var f=t.spaces[r]||r;return"".concat(e,": ").concat(f,";")}}},8:function(e,n,t){"use strict";t.r(n),t.d(n,"Typography",(function(){return l}));var r,o=t(3),i=t.n(o),a=t(0),u=t.n(a),s=t(2),c=["alpha","beta","delta","epsilon","omega","pi","sigma"],d={fontSize:!0,fontWeight:!0},l=t.n(s).a.span.withConfig({shouldForwardProp:function(e,n){return!d[e]&&n(e)}})(r||(r=i()(["\n font-weight: ",";\n font-size: ",";\n line-height: ",";\n color: ",";\n text-transform: ",";\n ","\n ","\n"])),(function(e){var n=e.theme,t=e.fontWeight;return n.fontWeights[t]}),(function(e){var n=e.theme,t=e.fontSize;return n.fontSizes[t]}),(function(e){var n=e.theme,t=e.lineHeight;return n.lineHeights[t]}),(function(e){var n=e.theme,t=e.textColor;return n.colors[t||"neutral800"]}),(function(e){return e.textTransform}),(function(e){return e.ellipsis&&"\n display: block;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n "}),(function(e){var n=e.variant,t=e.theme;switch(n){case"alpha":return"\n font-weight: ".concat(t.fontWeights.bold,";\n font-size: ").concat(t.fontSizes[5],";\n line-height: ").concat(t.lineHeights[2],";\n ");case"beta":return"\n font-weight: ".concat(t.fontWeights.bold,";\n font-size: ").concat(t.fontSizes[4],";\n line-height: ").concat(t.lineHeights[1],";\n ");case"delta":return"\n font-weight: ".concat(t.fontWeights.semiBold,";\n font-size: ").concat(t.fontSizes[3],";\n line-height: ").concat(t.lineHeights[2],";\n ");case"epsilon":return"\n font-size: ".concat(t.fontSizes[3],";\n line-height: ").concat(t.lineHeights[6],";\n ");case"omega":return"\n font-size: ".concat(t.fontSizes[2],";\n line-height: ").concat(t.lineHeights[4],";\n ");case"pi":return"\n font-size: ".concat(t.fontSizes[1],";\n line-height: ").concat(t.lineHeights[3],";\n ");case"sigma":return"\n font-weight: ".concat(t.fontWeights.bold,";\n font-size: ").concat(t.fontSizes[0],";\n line-height: ").concat(t.lineHeights[5],";\n text-transform: uppercase;\n ");default:return"\n font-size: ".concat(t.fontSizes[2],";\n ")}}));l.defaultProps={fontWeight:void 0,fontSize:void 0,lineHeight:void 0,textColor:void 0,textTransform:void 0,variant:"omega"},l.propTypes={fontSize:u.a.oneOfType([u.a.number,u.a.string]),fontWeight:u.a.string,lineHeight:u.a.oneOfType([u.a.number,u.a.string]),textColor:u.a.string,textTransform:u.a.string,variant:u.a.oneOf(c)}},9:function(e,n,t){"use strict";t.r(n),t.d(n,"Flex",(function(){return f}));var r,o=t(3),i=t.n(o),a=t(0),u=t.n(a),s=t(2),c=t.n(s),d=t(4),l={direction:!0},f=c()(d.Box).withConfig({shouldForwardProp:function(e,n){return!l[e]&&n(e)}})(r||(r=i()(["\n display: ",";\n flex-direction: ",";\n justify-content: ",";\n align-items: ",";\n flex-wrap: ",";\n"])),(function(e){return e.inline?"inline-flex":"flex"}),(function(e){return e.direction}),(function(e){return e.justifyContent}),(function(e){return e.alignItems}),(function(e){return e.wrap}));f.defaultProps={alignItems:"center",basis:void 0,direction:"row",inline:!1,justifyContent:void 0,reverse:!1,wrap:void 0},f.propTypes={alignItems:u.a.string,basis:u.a.oneOfType([u.a.string,u.a.number]),direction:u.a.string,inline:u.a.bool,justifyContent:u.a.string,reverse:u.a.bool,wrap:u.a.string}},95:function(e,n,t){"use strict";t.r(n),t.d(n,"Layout",(function(){return m})),t.d(n,"ActionLayout",(function(){return O})),t.d(n,"ContentLayout",(function(){return S})),t.d(n,"HeaderLayout",(function(){return L})),t.d(n,"BaseHeaderLayout",(function(){return M})),t.d(n,"TwoColsLayout",(function(){return F})),t.d(n,"GridLayout",(function(){return N}));var r,o,i=t(3),a=t.n(i),u=t(1),s=t.n(u),c=t(0),d=t.n(c),l=t(2),f=t.n(l),p=t(4),g=f()(p.Box)(r||(r=a()(["\n display: grid;\n grid-template-columns: ",";\n"])),(function(e){return e.hasSideNav?"auto 1fr":"1fr"})),h=f()(p.Box)(o||(o=a()(["\n overflow-x: hidden;\n"]))),m=function(e){var n=e.sideNav,t=e.children;return s.a.createElement(g,{hasSideNav:Boolean(n)},n,s.a.createElement(h,{paddingBottom:10},t))};m.defaultProps={sideNav:void 0},m.propTypes={children:d.a.node.isRequired,sideNav:d.a.node};var v,b,y=t(9),x=f()(y.Flex)(v||(v=a()(["\n & > * + * {\n margin-left: ",";\n }\n\n margin-left: ",";\n"])),(function(e){return e.theme.spaces[2]}),(function(e){return e.pullRight?"auto":void 0})),w=f()(x)(b||(b=a()(["\n flex-shrink: 0;\n"]))),O=function(e){var n=e.startActions,t=e.endActions;return n||t?s.a.createElement(p.Box,{paddingLeft:10,paddingRight:10},s.a.createElement(p.Box,{paddingBottom:4},s.a.createElement(y.Flex,{justifyContent:"space-between",alignItems:"flex-start"},n&&s.a.createElement(x,{wrap:"wrap"},n),t&&s.a.createElement(w,{pullRight:!0},t)))):null};O.defaultProps={endActions:void 0,startActions:void 0},O.propTypes={endActions:d.a.node,startActions:d.a.node};var S=function(e){var n=e.children;return s.a.createElement(p.Box,{paddingLeft:10,paddingRight:10},n)};S.propTypes={children:d.a.node.isRequired};var T,_=t(6),j=t.n(_),E=t(5),C=t.n(E),R=t(10),A=t.n(R),B=t(8),z=t(47),k=["navigationAction","primaryAction","secondaryAction","subtitle","title","sticky","width"],P=function(){var e=Object(u.useRef)(null),n=Object(u.useState)(null),t=A()(n,2),r=t[0],o=t[1],i=function(e){var n=Object(u.useRef)(null),t=Object(u.useState)(!0),r=A()(t,2),o=r[0],i=r[1],a=function(e){var n=A()(e,1)[0];i(n.isIntersecting)};return Object(u.useEffect)((function(){var t=n.current,r=new IntersectionObserver(a,e);return t&&r.observe(n.current),function(){t&&r.disconnect()}}),[n,e]),[n,o]}({root:null,rootMargin:"0px",threshold:0}),a=A()(i,2),s=a[0],c=a[1];return Object(z.a)(s,(function(){s.current&&o(s.current.getBoundingClientRect())})),Object(u.useEffect)((function(){e.current&&o(e.current.getBoundingClientRect())}),[e]),{containerRef:s,isVisible:c,baseHeaderLayoutRef:e,headerSize:r}},L=function(e){var n=P(),t=n.containerRef,r=n.isVisible,o=n.baseHeaderLayoutRef,i=n.headerSize;return s.a.createElement(s.a.Fragment,null,s.a.createElement("div",{style:{height:null==i?void 0:i.height},ref:t},r&&s.a.createElement(M,C()({ref:o},e))),!r&&s.a.createElement(M,C()({},e,{sticky:!0,width:null==i?void 0:i.width})))};L.displayName="HeaderLayout";var H=f()(p.Box)(T||(T=a()(["\n position: fixed;\n top: 0;\n right: 0;\n width: ","px;\n z-index: 4;\n box-shadow: ",";\n"])),(function(e){return e.width}),(function(e){return e.theme.shadows.tableShadow})),M=s.a.forwardRef((function(e,n){var t=e.navigationAction,r=e.primaryAction,o=e.secondaryAction,i=e.subtitle,a=e.title,u=e.sticky,c=e.width,d=j()(e,k);return u?s.a.createElement(H,{paddingLeft:6,paddingRight:6,paddingTop:3,paddingBottom:3,background:"neutral0",width:c,"data-strapi-header-sticky":!0},s.a.createElement(y.Flex,{justifyContent:"space-between"},s.a.createElement(y.Flex,null,t&&s.a.createElement(p.Box,{paddingRight:3},t),s.a.createElement(p.Box,null,s.a.createElement(B.Typography,C()({variant:"beta",as:"h1"},d),a),s.a.createElement(B.Typography,{variant:"pi",textColor:"neutral600"},i)),o?s.a.createElement(p.Box,{paddingLeft:4},o):null),s.a.createElement(y.Flex,null,r?s.a.createElement(p.Box,{paddingLeft:2},r):void 0))):s.a.createElement(p.Box,{ref:n,paddingLeft:10,paddingRight:10,paddingBottom:8,paddingTop:t?6:8,background:"neutral100","data-strapi-header":!0},t?s.a.createElement(p.Box,{paddingBottom:2},t):null,s.a.createElement(y.Flex,{justifyContent:"space-between"},s.a.createElement(y.Flex,null,s.a.createElement(B.Typography,C()({as:"h1",variant:"alpha"},d),a),o?s.a.createElement(p.Box,{paddingLeft:4},o):null),r),s.a.createElement(B.Typography,{variant:"epsilon",textColor:"neutral600",as:"p"},i))}));M.displayName="BaseHeaderLayout",M.defaultProps={navigationAction:void 0,primaryAction:void 0,secondaryAction:void 0,subtitle:void 0,sticky:!1,width:void 0},M.propTypes={navigationAction:d.a.node,primaryAction:d.a.node,secondaryAction:d.a.node,sticky:d.a.bool,subtitle:d.a.string,title:d.a.string.isRequired,width:d.a.number},L.defaultProps={navigationAction:void 0,primaryAction:void 0,secondaryAction:void 0,subtitle:void 0},L.propTypes={navigationAction:d.a.node,primaryAction:d.a.node,secondaryAction:d.a.node,subtitle:d.a.string,title:d.a.string.isRequired};var I,W=t(49),F=function(e){var n=e.startCol,t=e.endCol;return s.a.createElement(W.Grid,{gap:4},s.a.createElement(W.GridItem,{col:9,s:12},s.a.createElement(p.Box,{hasRadius:!0,background:"neutral0",shadow:"tableShadow"},n)),s.a.createElement(W.GridItem,{col:3,s:12},s.a.createElement(p.Box,{hasRadius:!0,background:"neutral0",shadow:"tableShadow"},t)))};F.propTypes={endCol:d.a.node.isRequired,startCol:d.a.node.isRequired};var N=f.a.div(I||(I=a()(["\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));\n grid-gap: ",";\n"])),(function(e){return e.theme.spaces[4]}));N.propTypes={children:d.a.node.isRequired}}}))}}]);
|