@strapi/admin 4.1.1 → 4.2.0-alpha.O
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/StrapiApp.js +40 -42
- package/admin/src/components/AutoReloadOverlayBlockerProvider/Blocker.js +2 -2
- package/admin/src/components/GuidedTour/Homepage/index.js +1 -1
- package/admin/src/components/GuidedTour/Modal/components/Content.js +1 -1
- package/admin/src/components/GuidedTour/Modal/components/Modal.js +2 -2
- package/admin/src/components/LeftMenu/index.js +1 -1
- package/admin/src/components/Notifications/index.js +1 -1
- package/admin/src/components/Providers/index.js +65 -32
- package/admin/src/components/Theme/index.js +11 -12
- package/admin/src/components/ThemeToggleProvider/index.js +66 -0
- package/admin/src/{pages/AuthPage/components/Logo → components/UnauthenticatedLogo}/index.js +1 -1
- package/admin/src/components/UpgradePlanModal/index.js +2 -2
- package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +4 -4
- package/admin/src/content-manager/components/ComponentInitializer/index.js +1 -1
- package/admin/src/content-manager/components/DynamicTable/ConfirmDialogDelete/index.js +1 -1
- package/admin/src/content-manager/components/DynamicTable/ConfirmDialogDeleteAll/index.js +1 -1
- package/admin/src/content-manager/components/DynamicZone/components/Component/index.js +2 -2
- package/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/Category/ComponentCard/index.js +1 -1
- package/admin/src/content-manager/components/DynamicZone/components/ComponentPicker/Category/index.js +1 -1
- package/admin/src/content-manager/components/DynamicZone/index.js +2 -5
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/cleanData.js +1 -6
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/schema.js +0 -9
- package/admin/src/content-manager/components/FieldComponent/index.js +2 -5
- package/admin/src/content-manager/components/InputJSON/index.js +2 -5
- package/admin/src/content-manager/components/InputUID/index.js +1 -2
- package/admin/src/content-manager/components/NonRepeatableComponent/index.js +1 -1
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/DraggingSibling.js +2 -2
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/index.js +4 -7
- package/admin/src/content-manager/components/SelectMany/index.js +2 -2
- package/admin/src/content-manager/components/SelectOne/index.js +1 -1
- package/admin/src/content-manager/components/SelectWrapper/index.js +2 -5
- package/admin/src/content-manager/components/SelectWrapper/utils/getSelectStyles.js +1 -0
- package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +4 -4
- package/admin/src/content-manager/components/Wysiwyg/EditorStylesContainer.js +5 -3
- package/admin/src/content-manager/components/Wysiwyg/WysiwygNav.js +2 -2
- package/admin/src/content-manager/components/Wysiwyg/index.js +2 -2
- package/admin/src/content-manager/pages/EditSettingsView/components/DisplayedFields.js +2 -2
- package/admin/src/content-manager/pages/EditSettingsView/components/DynamicZoneList.js +1 -1
- package/admin/src/content-manager/pages/EditSettingsView/components/RelationalFields.js +2 -2
- package/admin/src/content-manager/pages/EditSettingsView/index.js +1 -1
- package/admin/src/content-manager/pages/EditView/Header/index.js +4 -7
- package/admin/src/content-manager/pages/EditView/Informations/index.js +1 -1
- package/admin/src/content-manager/pages/EditView/index.js +5 -5
- package/admin/src/content-manager/pages/ListSettingsView/components/CardPreview.js +1 -1
- package/admin/src/content-manager/pages/ListSettingsView/components/DraggableCard.js +1 -1
- package/admin/src/content-manager/pages/ListSettingsView/components/SortDisplayedFields.js +1 -1
- package/admin/src/contexts/ThemeToggle/index.js +5 -0
- package/admin/src/contexts/index.js +1 -0
- package/admin/src/hooks/index.js +1 -0
- package/admin/src/hooks/useSettingsMenu/init.js +2 -2
- package/admin/src/hooks/useThemeToggle/index.js +10 -0
- package/admin/src/pages/Admin/Onboarding/index.js +1 -1
- package/admin/src/pages/App/index.js +2 -0
- package/admin/src/pages/AuthPage/components/ForgotPassword/index.js +2 -2
- package/admin/src/pages/AuthPage/components/ForgotPasswordSuccess/index.js +1 -1
- package/admin/src/pages/AuthPage/components/Login/BaseLogin.js +2 -2
- package/admin/src/pages/AuthPage/components/Oops/index.js +1 -1
- package/admin/src/pages/AuthPage/components/Register/index.js +224 -223
- package/admin/src/pages/AuthPage/components/ResetPassword/index.js +2 -2
- package/admin/src/pages/AuthPage/index.js +20 -17
- package/admin/src/pages/HomePage/ContentBlocks.js +1 -1
- package/admin/src/pages/HomePage/HomeHeader.js +1 -1
- package/admin/src/pages/HomePage/SocialLinks.js +2 -5
- package/admin/src/pages/MarketplacePage/index.js +13 -4
- package/admin/src/pages/ProfilePage/index.js +79 -15
- package/admin/src/pages/ProfilePage/utils/api.js +4 -2
- package/admin/src/pages/SettingsPage/components/SettingsNav/index.js +4 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/ConditionsModal/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/GlobalActions/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/PluginsAndSettings/Row/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/components/RoleForm/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Roles/EditPage/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Users/EditPage/index.js +3 -3
- package/admin/src/pages/SettingsPage/pages/Users/ListPage/ModalForm/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/EventInput/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/HeadersInput/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/TriggerContainer/index.js +4 -4
- package/admin/src/pages/SettingsPage/pages/Webhooks/EditView/components/WebhookForm/index.js +3 -3
- package/admin/src/pages/SettingsPage/pages/Webhooks/ListView/index.js +1 -1
- package/admin/src/pages/UseCasePage/index.js +173 -0
- package/admin/src/translations/en.json +15 -2
- package/build/1094.e1db3a1a.chunk.js +1 -0
- package/build/1454.f065d92a.chunk.js +2 -0
- package/build/{5032.ed02a466.chunk.js.LICENSE.txt → 1454.f065d92a.chunk.js.LICENSE.txt} +0 -0
- package/build/1856.a30bd09b.chunk.js +1 -0
- package/build/2481.4eae9408.chunk.js +1 -0
- package/build/{2912.38fb9bd1.chunk.js → 2912.c5f76e65.chunk.js} +1 -1
- package/build/4362.86a4e939.chunk.js +1 -0
- package/build/4715.8a2db02a.chunk.js +1 -0
- package/build/{4800.18e59c83.chunk.js → 4800.f4a1384a.chunk.js} +1 -1
- package/build/497.3fcf6196.chunk.js +1 -0
- package/build/4982.601f6196.chunk.js +1 -0
- package/build/6404.3c2d0a81.chunk.js +1 -0
- package/build/{7841.ef9bcee9.chunk.js → 7841.490dbbf1.chunk.js} +1 -1
- package/build/{8042.9b85175a.chunk.js → 8042.1d66811a.chunk.js} +2 -2
- package/build/{8042.9b85175a.chunk.js.LICENSE.txt → 8042.1d66811a.chunk.js.LICENSE.txt} +0 -0
- package/build/849.17f011e8.chunk.js +1 -0
- package/build/{2736.ee6e45c9.chunk.js → 9260.fa40c7bd.chunk.js} +2 -2
- package/build/{2736.ee6e45c9.chunk.js.LICENSE.txt → 9260.fa40c7bd.chunk.js.LICENSE.txt} +0 -0
- package/build/9853.6ff595fa.chunk.js +1 -0
- package/build/{9988.b4229043.chunk.js → 9988.fe838ba6.chunk.js} +2 -2
- package/build/{9988.b4229043.chunk.js.LICENSE.txt → 9988.fe838ba6.chunk.js.LICENSE.txt} +0 -0
- package/build/Admin-authenticatedApp.a5d2c5fa.chunk.js +1 -0
- package/build/Admin_homePage.d6754c66.chunk.js +1 -0
- package/build/Admin_marketplace.419010d8.chunk.js +1 -0
- package/build/Admin_profilePage.d7192d06.chunk.js +1 -0
- package/build/Admin_settingsPage.a8c7ded5.chunk.js +1 -0
- package/build/admin-edit-roles-page.49b6f01d.chunk.js +1 -0
- package/build/admin-edit-users.381e4a0d.chunk.js +1 -0
- package/build/admin-users.1fda1f27.chunk.js +1 -0
- package/build/{api-tokens-create-page.0981141a.chunk.js → api-tokens-create-page.db17bb39.chunk.js} +1 -1
- package/build/{api-tokens-edit-page.3faf1af1.chunk.js → api-tokens-edit-page.c7299a77.chunk.js} +1 -1
- package/build/content-manager.8412e024.chunk.js +1 -0
- package/build/content-type-builder-translation-en-json.8034dab6.chunk.js +1 -0
- package/build/content-type-builder.cda4ba3c.chunk.js +1 -0
- package/build/{email-settings-page.4338588d.chunk.js → email-settings-page.40ee2bda.chunk.js} +1 -1
- package/build/{en-json.bb614bb0.chunk.js → en-json.b35c285f.chunk.js} +1 -1
- package/build/i18n-settings-page.c4018651.chunk.js +1 -0
- package/build/i18n-translation-de-json.c5c9054f.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/main.3e719c82.js +2 -0
- package/build/{main.fc123ed7.js.LICENSE.txt → main.3e719c82.js.LICENSE.txt} +0 -0
- package/build/runtime~main.66becdbd.js +1 -0
- package/build/{sso-settings-page.c073b6d7.chunk.js → sso-settings-page.121dd0a6.chunk.js} +1 -1
- package/build/{upload-settings.8e7cbc3b.chunk.js → upload-settings.4401f36d.chunk.js} +1 -1
- package/build/{upload.803ab265.chunk.js → upload.5a2dded7.chunk.js} +1 -1
- package/build/{users-advanced-settings-page.7694d3c9.chunk.js → users-advanced-settings-page.8905d8d8.chunk.js} +1 -1
- package/build/users-email-settings-page.5abb9575.chunk.js +1 -0
- package/build/users-permissions-translation-en-json.21b0fd2f.chunk.js +1 -0
- package/build/users-providers-settings-page.368893ed.chunk.js +1 -0
- package/build/users-roles-settings-page.a2f6277a.chunk.js +1 -0
- package/build/webhook-edit-page.d170eda1.chunk.js +1 -0
- package/build/{webhook-list-page.5c8f2a91.chunk.js → webhook-list-page.c21b5a9a.chunk.js} +1 -1
- package/ee/admin/pages/AuthPage/components/Login/index.js +1 -1
- package/ee/admin/pages/AuthPage/components/Providers/index.js +2 -2
- package/ee/admin/pages/SettingsPage/SingleSignOn/index.js +1 -1
- package/ee/admin/pages/SettingsPage/pages/Roles/CreatePage/index.js +3 -3
- package/index.js +6 -1
- package/package.json +7 -7
- package/server/routes/serve-admin-panel.js +18 -6
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/isValidJSONString.js +0 -15
- package/admin/src/themes/colors.js +0 -51
- package/admin/src/themes/fontWeights.js +0 -8
- package/admin/src/themes/index.js +0 -13
- package/admin/src/themes/sizes.js +0 -31
- package/build/1856.a06395b4.chunk.js +0 -1
- package/build/2481.7d15bd79.chunk.js +0 -1
- package/build/4261.a4e1e93c.chunk.js +0 -1
- package/build/4362.d0c1a04a.chunk.js +0 -1
- package/build/4715.31ca1967.chunk.js +0 -1
- package/build/497.8f30da61.chunk.js +0 -1
- package/build/4982.da4adb38.chunk.js +0 -1
- package/build/5032.ed02a466.chunk.js +0 -2
- package/build/6250.dc6d7a58.chunk.js +0 -1
- package/build/849.9075d399.chunk.js +0 -1
- package/build/9238.bdd93dae.chunk.js +0 -1
- package/build/Admin-authenticatedApp.013e2774.chunk.js +0 -1
- package/build/Admin_homePage.e4779166.chunk.js +0 -1
- package/build/Admin_marketplace.e8654056.chunk.js +0 -1
- package/build/Admin_profilePage.67dd744c.chunk.js +0 -1
- package/build/Admin_settingsPage.2d0d2cca.chunk.js +0 -1
- package/build/admin-edit-roles-page.2d1b6461.chunk.js +0 -1
- package/build/admin-edit-users.e736db15.chunk.js +0 -1
- package/build/admin-users.5f79c031.chunk.js +0 -1
- package/build/content-manager.141d110d.chunk.js +0 -1
- package/build/content-type-builder-translation-en-json.b3d8e9d4.chunk.js +0 -1
- package/build/content-type-builder.f1cef05c.chunk.js +0 -1
- package/build/i18n-settings-page.51e37957.chunk.js +0 -1
- package/build/main.fc123ed7.js +0 -2
- package/build/runtime~main.0866074a.js +0 -1
- package/build/users-email-settings-page.862eb51e.chunk.js +0 -1
- package/build/users-permissions-translation-en-json.1993655e.chunk.js +0 -1
- package/build/users-providers-settings-page.47f97b06.chunk.js +0 -1
- package/build/users-roles-settings-page.b67e2b4d.chunk.js +0 -1
- package/build/webhook-edit-page.adad0a42.chunk.js +0 -1
package/admin/src/StrapiApp.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BrowserRouter } from 'react-router-dom';
|
|
3
|
-
import { lightTheme } from '@strapi/design-system/themes';
|
|
3
|
+
import { lightTheme, darkTheme } from '@strapi/design-system/themes';
|
|
4
4
|
import merge from 'lodash/merge';
|
|
5
5
|
import pick from 'lodash/pick';
|
|
6
6
|
import isFunction from 'lodash/isFunction';
|
|
@@ -13,7 +13,6 @@ import App from './pages/App';
|
|
|
13
13
|
import AuthLogo from './assets/images/logo_strapi_auth_v4.png';
|
|
14
14
|
import MenuLogo from './assets/images/logo_strapi_menu.png';
|
|
15
15
|
import Providers from './components/Providers';
|
|
16
|
-
import Theme from './components/Theme';
|
|
17
16
|
import languageNativeNames from './translations/languageNativeNames';
|
|
18
17
|
import {
|
|
19
18
|
INJECT_COLUMN_IN_TABLE,
|
|
@@ -34,7 +33,7 @@ class StrapiApp {
|
|
|
34
33
|
locales: ['en'],
|
|
35
34
|
menuLogo: MenuLogo,
|
|
36
35
|
notifications: { releases: true },
|
|
37
|
-
|
|
36
|
+
themes: { light: lightTheme, dark: darkTheme },
|
|
38
37
|
translations: {},
|
|
39
38
|
tutorials: true,
|
|
40
39
|
};
|
|
@@ -226,7 +225,7 @@ class StrapiApp {
|
|
|
226
225
|
}
|
|
227
226
|
|
|
228
227
|
if (this.customConfigurations?.theme) {
|
|
229
|
-
|
|
228
|
+
merge(this.configurations.themes.light, this.customConfigurations.theme);
|
|
230
229
|
}
|
|
231
230
|
|
|
232
231
|
if (this.customConfigurations?.notifications?.releases !== undefined) {
|
|
@@ -427,44 +426,43 @@ class StrapiApp {
|
|
|
427
426
|
} = this.library;
|
|
428
427
|
|
|
429
428
|
return (
|
|
430
|
-
<
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
runHookWaterfall
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
</Theme>
|
|
429
|
+
<Providers
|
|
430
|
+
authLogo={this.configurations.authLogo}
|
|
431
|
+
components={components}
|
|
432
|
+
fields={fields}
|
|
433
|
+
localeNames={localeNames}
|
|
434
|
+
getAdminInjectedComponents={this.getAdminInjectedComponents}
|
|
435
|
+
getPlugin={this.getPlugin}
|
|
436
|
+
messages={this.configurations.translations}
|
|
437
|
+
menu={this.menu}
|
|
438
|
+
menuLogo={this.configurations.menuLogo}
|
|
439
|
+
plugins={this.plugins}
|
|
440
|
+
runHookParallel={this.runHookParallel}
|
|
441
|
+
runHookWaterfall={(name, initialValue, async = false) => {
|
|
442
|
+
return this.runHookWaterfall(name, initialValue, async, store);
|
|
443
|
+
}}
|
|
444
|
+
runHookSeries={this.runHookSeries}
|
|
445
|
+
themes={this.configurations.themes}
|
|
446
|
+
settings={this.settings}
|
|
447
|
+
showTutorials={this.configurations.tutorials}
|
|
448
|
+
showReleaseNotification={this.configurations.notifications.releases}
|
|
449
|
+
store={store}
|
|
450
|
+
>
|
|
451
|
+
<>
|
|
452
|
+
<Helmet
|
|
453
|
+
link={[
|
|
454
|
+
{
|
|
455
|
+
rel: 'icon',
|
|
456
|
+
type: 'image/png',
|
|
457
|
+
href: this.configurations.head.favicon,
|
|
458
|
+
},
|
|
459
|
+
]}
|
|
460
|
+
/>
|
|
461
|
+
<BrowserRouter basename={basename}>
|
|
462
|
+
<App store={store} />
|
|
463
|
+
</BrowserRouter>
|
|
464
|
+
</>
|
|
465
|
+
</Providers>
|
|
468
466
|
);
|
|
469
467
|
}
|
|
470
468
|
}
|
|
@@ -44,8 +44,8 @@ const Blocker = ({ displayedIcon, description, title, isOpen }) => {
|
|
|
44
44
|
if (isOpen) {
|
|
45
45
|
return ReactDOM.createPortal(
|
|
46
46
|
<Overlay>
|
|
47
|
-
<Content
|
|
48
|
-
<Stack
|
|
47
|
+
<Content spacing={6}>
|
|
48
|
+
<Stack spacing={2}>
|
|
49
49
|
<Flex justifyContent="center">
|
|
50
50
|
<Typography as="h1" variant="alpha">
|
|
51
51
|
{formatMessage(title)}
|
|
@@ -17,7 +17,7 @@ const ModalWrapper = styled(Flex)`
|
|
|
17
17
|
z-index: 4;
|
|
18
18
|
inset: 0;
|
|
19
19
|
/* this is theme.colors.neutral800 with opacity */
|
|
20
|
-
background: ${({ theme }) => `${theme.colors.neutral800}
|
|
20
|
+
background: ${({ theme }) => `${theme.colors.neutral800}1F`};
|
|
21
21
|
`;
|
|
22
22
|
|
|
23
23
|
const Modal = ({ onClose, onSkip, children, hideSkip }) => {
|
|
@@ -33,7 +33,7 @@ const Modal = ({ onClose, onSkip, children, hideSkip }) => {
|
|
|
33
33
|
shadow="popupShadow"
|
|
34
34
|
hasRadius
|
|
35
35
|
padding={4}
|
|
36
|
-
|
|
36
|
+
spacing={8}
|
|
37
37
|
role="dialog"
|
|
38
38
|
aria-modal
|
|
39
39
|
onClick={e => e.stopPropagation()}
|
|
@@ -156,7 +156,7 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => {
|
|
|
156
156
|
hasRadius
|
|
157
157
|
>
|
|
158
158
|
<FocusTrap onEscape={handleToggleUserLinks}>
|
|
159
|
-
<Stack
|
|
159
|
+
<Stack spacing={0}>
|
|
160
160
|
<LinkUser tabIndex={0} onClick={handleToggleUserLinks} to="/me">
|
|
161
161
|
<Typography>
|
|
162
162
|
{formatMessage({
|
|
@@ -9,6 +9,8 @@ import GuidedTour from '../GuidedTour';
|
|
|
9
9
|
import AutoReloadOverlayBlockerProvider from '../AutoReloadOverlayBlockerProvider';
|
|
10
10
|
import Notifications from '../Notifications';
|
|
11
11
|
import OverlayBlocker from '../OverlayBlocker';
|
|
12
|
+
import ThemeToggleProvider from '../ThemeToggleProvider';
|
|
13
|
+
import Theme from '../Theme';
|
|
12
14
|
|
|
13
15
|
const queryClient = new QueryClient({
|
|
14
16
|
defaultOptions: {
|
|
@@ -36,41 +38,45 @@ const Providers = ({
|
|
|
36
38
|
settings,
|
|
37
39
|
showReleaseNotification,
|
|
38
40
|
showTutorials,
|
|
39
|
-
|
|
40
41
|
store,
|
|
42
|
+
themes,
|
|
41
43
|
}) => {
|
|
42
44
|
return (
|
|
43
|
-
<
|
|
44
|
-
<
|
|
45
|
-
<
|
|
46
|
-
<
|
|
47
|
-
value={{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<
|
|
61
|
-
<
|
|
62
|
-
<
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
45
|
+
<ThemeToggleProvider themes={themes}>
|
|
46
|
+
<Theme>
|
|
47
|
+
<QueryClientProvider client={queryClient}>
|
|
48
|
+
<Provider store={store}>
|
|
49
|
+
<AdminContext.Provider value={{ getAdminInjectedComponents }}>
|
|
50
|
+
<ConfigurationsContext.Provider
|
|
51
|
+
value={{ authLogo, menuLogo, showReleaseNotification, showTutorials }}
|
|
52
|
+
>
|
|
53
|
+
<StrapiAppProvider
|
|
54
|
+
getPlugin={getPlugin}
|
|
55
|
+
menu={menu}
|
|
56
|
+
plugins={plugins}
|
|
57
|
+
runHookParallel={runHookParallel}
|
|
58
|
+
runHookWaterfall={runHookWaterfall}
|
|
59
|
+
runHookSeries={runHookSeries}
|
|
60
|
+
settings={settings}
|
|
61
|
+
>
|
|
62
|
+
<LibraryProvider components={components} fields={fields}>
|
|
63
|
+
<LanguageProvider messages={messages} localeNames={localeNames}>
|
|
64
|
+
<AutoReloadOverlayBlockerProvider>
|
|
65
|
+
<OverlayBlocker>
|
|
66
|
+
<GuidedTour>
|
|
67
|
+
<Notifications>{children}</Notifications>
|
|
68
|
+
</GuidedTour>
|
|
69
|
+
</OverlayBlocker>
|
|
70
|
+
</AutoReloadOverlayBlockerProvider>
|
|
71
|
+
</LanguageProvider>
|
|
72
|
+
</LibraryProvider>
|
|
73
|
+
</StrapiAppProvider>
|
|
74
|
+
</ConfigurationsContext.Provider>
|
|
75
|
+
</AdminContext.Provider>
|
|
76
|
+
</Provider>
|
|
77
|
+
</QueryClientProvider>
|
|
78
|
+
</Theme>
|
|
79
|
+
</ThemeToggleProvider>
|
|
74
80
|
);
|
|
75
81
|
};
|
|
76
82
|
|
|
@@ -104,6 +110,33 @@ Providers.propTypes = {
|
|
|
104
110
|
showReleaseNotification: PropTypes.bool.isRequired,
|
|
105
111
|
showTutorials: PropTypes.bool.isRequired,
|
|
106
112
|
store: PropTypes.object.isRequired,
|
|
113
|
+
themes: PropTypes.shape({
|
|
114
|
+
light: PropTypes.shape({
|
|
115
|
+
colors: PropTypes.object.isRequired,
|
|
116
|
+
shadows: PropTypes.object.isRequired,
|
|
117
|
+
sizes: PropTypes.object.isRequired,
|
|
118
|
+
zIndices: PropTypes.array.isRequired,
|
|
119
|
+
spaces: PropTypes.array.isRequired,
|
|
120
|
+
borderRadius: PropTypes.string.isRequired,
|
|
121
|
+
mediaQueries: PropTypes.object.isRequired,
|
|
122
|
+
fontSizes: PropTypes.array.isRequired,
|
|
123
|
+
lineHeights: PropTypes.array.isRequired,
|
|
124
|
+
fontWeights: PropTypes.object.isRequired,
|
|
125
|
+
}).isRequired,
|
|
126
|
+
dark: PropTypes.shape({
|
|
127
|
+
colors: PropTypes.object.isRequired,
|
|
128
|
+
shadows: PropTypes.object.isRequired,
|
|
129
|
+
sizes: PropTypes.object.isRequired,
|
|
130
|
+
zIndices: PropTypes.array.isRequired,
|
|
131
|
+
spaces: PropTypes.array.isRequired,
|
|
132
|
+
borderRadius: PropTypes.string.isRequired,
|
|
133
|
+
mediaQueries: PropTypes.object.isRequired,
|
|
134
|
+
fontSizes: PropTypes.array.isRequired,
|
|
135
|
+
lineHeights: PropTypes.array.isRequired,
|
|
136
|
+
fontWeights: PropTypes.object.isRequired,
|
|
137
|
+
}).isRequired,
|
|
138
|
+
custom: PropTypes.object,
|
|
139
|
+
}).isRequired,
|
|
107
140
|
};
|
|
108
141
|
|
|
109
142
|
export default Providers;
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ThemeProvider } from '@strapi/design-system/ThemeProvider';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import {
|
|
4
|
+
import { useThemeToggle } from '../../hooks';
|
|
5
5
|
import GlobalStyle from '../GlobalStyle';
|
|
6
6
|
|
|
7
|
-
const Theme = ({ children
|
|
8
|
-
|
|
9
|
-
{children}
|
|
10
|
-
<GlobalStyle />
|
|
11
|
-
</ThemeProvider>
|
|
12
|
-
);
|
|
7
|
+
const Theme = ({ children }) => {
|
|
8
|
+
const { currentTheme, themes } = useThemeToggle();
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
return (
|
|
11
|
+
<ThemeProvider theme={themes[currentTheme] || themes.light}>
|
|
12
|
+
{children}
|
|
13
|
+
<GlobalStyle />
|
|
14
|
+
</ThemeProvider>
|
|
15
|
+
);
|
|
17
16
|
};
|
|
18
17
|
|
|
19
|
-
Theme.
|
|
20
|
-
|
|
18
|
+
Theme.propTypes = {
|
|
19
|
+
children: PropTypes.element.isRequired,
|
|
21
20
|
};
|
|
22
21
|
|
|
23
22
|
export default Theme;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* ThemeToggleProvider
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import React, { useState } from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
import { ThemeToggleContext } from '../../contexts';
|
|
10
|
+
|
|
11
|
+
const THEME_KEY = 'STRAPI_THEME';
|
|
12
|
+
|
|
13
|
+
const getDefaultTheme = () => {
|
|
14
|
+
const browserTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
15
|
+
const persistedTheme = localStorage.getItem(THEME_KEY);
|
|
16
|
+
|
|
17
|
+
return persistedTheme || browserTheme;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const ThemeToggleProvider = ({ children, themes }) => {
|
|
21
|
+
const [currentTheme, setCurrentTheme] = useState(getDefaultTheme());
|
|
22
|
+
|
|
23
|
+
const handleChangeTheme = nextTheme => {
|
|
24
|
+
setCurrentTheme(nextTheme);
|
|
25
|
+
localStorage.setItem(THEME_KEY, nextTheme);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<ThemeToggleContext.Provider value={{ currentTheme, onChangeTheme: handleChangeTheme, themes }}>
|
|
30
|
+
{children}
|
|
31
|
+
</ThemeToggleContext.Provider>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
ThemeToggleProvider.propTypes = {
|
|
36
|
+
children: PropTypes.node.isRequired,
|
|
37
|
+
themes: PropTypes.shape({
|
|
38
|
+
light: PropTypes.shape({
|
|
39
|
+
colors: PropTypes.object.isRequired,
|
|
40
|
+
shadows: PropTypes.object.isRequired,
|
|
41
|
+
sizes: PropTypes.object.isRequired,
|
|
42
|
+
zIndices: PropTypes.array.isRequired,
|
|
43
|
+
spaces: PropTypes.array.isRequired,
|
|
44
|
+
borderRadius: PropTypes.string.isRequired,
|
|
45
|
+
mediaQueries: PropTypes.object.isRequired,
|
|
46
|
+
fontSizes: PropTypes.array.isRequired,
|
|
47
|
+
lineHeights: PropTypes.array.isRequired,
|
|
48
|
+
fontWeights: PropTypes.object.isRequired,
|
|
49
|
+
}).isRequired,
|
|
50
|
+
dark: PropTypes.shape({
|
|
51
|
+
colors: PropTypes.object.isRequired,
|
|
52
|
+
shadows: PropTypes.object.isRequired,
|
|
53
|
+
sizes: PropTypes.object.isRequired,
|
|
54
|
+
zIndices: PropTypes.array.isRequired,
|
|
55
|
+
spaces: PropTypes.array.isRequired,
|
|
56
|
+
borderRadius: PropTypes.string.isRequired,
|
|
57
|
+
mediaQueries: PropTypes.object.isRequired,
|
|
58
|
+
fontSizes: PropTypes.array.isRequired,
|
|
59
|
+
lineHeights: PropTypes.array.isRequired,
|
|
60
|
+
fontWeights: PropTypes.object.isRequired,
|
|
61
|
+
}).isRequired,
|
|
62
|
+
custom: PropTypes.object,
|
|
63
|
+
}).isRequired,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export default ThemeToggleProvider;
|
|
@@ -82,14 +82,14 @@ const UpgradePlanModal = ({ onClose, isOpen }) => {
|
|
|
82
82
|
<CloseButtonContainer>
|
|
83
83
|
<IconButton onClick={onClose} aria-label="Close" icon={<Cross />} />
|
|
84
84
|
</CloseButtonContainer>
|
|
85
|
-
<StackFlexStart
|
|
85
|
+
<StackFlexStart spacing={6}>
|
|
86
86
|
<Typography fontWeight="bold" textColor="primary600">
|
|
87
87
|
{formatMessage({
|
|
88
88
|
id: 'app.components.UpgradePlanModal.text-ce',
|
|
89
89
|
defaultMessage: 'COMMUNITY EDITION',
|
|
90
90
|
})}
|
|
91
91
|
</Typography>
|
|
92
|
-
<Stack
|
|
92
|
+
<Stack spacing={2}>
|
|
93
93
|
<Typography variant="alpha" as="h2" id="upgrade-plan">
|
|
94
94
|
{formatMessage({
|
|
95
95
|
id: 'app.components.UpgradePlanModal.limit-reached',
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
useTracking,
|
|
7
7
|
useNotification,
|
|
8
8
|
useQueryParams,
|
|
9
|
-
|
|
9
|
+
formatContentTypeData,
|
|
10
10
|
contentManagementUtilRemoveFieldsFromData,
|
|
11
11
|
useGuidedTour,
|
|
12
12
|
} from '@strapi/helper-plugin';
|
|
@@ -88,7 +88,7 @@ const CollectionTypeFormWrapper = ({ allLayoutData, children, slug, id, origin }
|
|
|
88
88
|
allLayoutDataRef.current.components
|
|
89
89
|
);
|
|
90
90
|
|
|
91
|
-
return
|
|
91
|
+
return formatContentTypeData(
|
|
92
92
|
cleaned,
|
|
93
93
|
allLayoutDataRef.current.contentType,
|
|
94
94
|
allLayoutDataRef.current.components
|
|
@@ -103,7 +103,7 @@ const CollectionTypeFormWrapper = ({ allLayoutData, children, slug, id, origin }
|
|
|
103
103
|
allLayoutData.components
|
|
104
104
|
);
|
|
105
105
|
|
|
106
|
-
acc[current] =
|
|
106
|
+
acc[current] = formatContentTypeData(
|
|
107
107
|
defaultComponentForm,
|
|
108
108
|
allLayoutData.components[current],
|
|
109
109
|
allLayoutData.components
|
|
@@ -117,7 +117,7 @@ const CollectionTypeFormWrapper = ({ allLayoutData, children, slug, id, origin }
|
|
|
117
117
|
allLayoutData.components
|
|
118
118
|
);
|
|
119
119
|
|
|
120
|
-
const contentTypeDataStructureFormatted =
|
|
120
|
+
const contentTypeDataStructureFormatted = formatContentTypeData(
|
|
121
121
|
contentTypeDataStructure,
|
|
122
122
|
allLayoutData.contentType,
|
|
123
123
|
allLayoutData.components
|
|
@@ -39,7 +39,7 @@ const ComponentInitializer = ({ error, isReadOnly, onClick }) => {
|
|
|
39
39
|
paddingBottom={9}
|
|
40
40
|
type="button"
|
|
41
41
|
>
|
|
42
|
-
<Stack
|
|
42
|
+
<Stack spacing={2}>
|
|
43
43
|
<Flex justifyContent="center" style={{ cursor: isReadOnly ? 'not-allowed' : 'inherit' }}>
|
|
44
44
|
<IconWrapper>
|
|
45
45
|
<PlusCircle />
|
|
@@ -25,7 +25,7 @@ const ConfirmDialogDelete = ({ isConfirmButtonLoading, isOpen, onToggleDialog, o
|
|
|
25
25
|
isOpen={isOpen}
|
|
26
26
|
>
|
|
27
27
|
<DialogBody icon={<ExclamationMarkCircle />}>
|
|
28
|
-
<Stack
|
|
28
|
+
<Stack spacing={2}>
|
|
29
29
|
<Flex justifyContent="center">
|
|
30
30
|
<Typography id="confirm-description">
|
|
31
31
|
{formatMessage({
|
|
@@ -26,7 +26,7 @@ const ConfirmDialogDeleteAll = ({ isConfirmButtonLoading, isOpen, onToggleDialog
|
|
|
26
26
|
isOpen={isOpen}
|
|
27
27
|
>
|
|
28
28
|
<DialogBody icon={<ExclamationMarkCircle />}>
|
|
29
|
-
<Stack
|
|
29
|
+
<Stack spacing={2}>
|
|
30
30
|
<Flex justifyContent="center">
|
|
31
31
|
<Typography id="confirm-description">
|
|
32
32
|
{formatMessage({
|
|
@@ -111,11 +111,11 @@ const Component = ({
|
|
|
111
111
|
<Box>
|
|
112
112
|
<Rectangle />
|
|
113
113
|
<StyledBox hasRadius>
|
|
114
|
-
<Accordion expanded={isOpen}
|
|
114
|
+
<Accordion expanded={isOpen} onToggle={() => onToggle(index)} size="S" error={errorMessage}>
|
|
115
115
|
<AccordionToggle
|
|
116
116
|
startIcon={<FontAwesomeIcon icon={icon} />}
|
|
117
117
|
action={
|
|
118
|
-
<ActionStack horizontal
|
|
118
|
+
<ActionStack horizontal spacing={0} expanded={isOpen}>
|
|
119
119
|
{showDownIcon && (
|
|
120
120
|
<IconButtonCustom
|
|
121
121
|
noBorder
|
|
@@ -62,7 +62,7 @@ function ComponentCard({ componentUid, intlLabel, icon, onClick }) {
|
|
|
62
62
|
return (
|
|
63
63
|
<button type="button" onClick={handleClick}>
|
|
64
64
|
<ComponentBox borderRadius="borderRadius">
|
|
65
|
-
<Stack
|
|
65
|
+
<Stack spacing={1} style={{ justifyContent: 'center', alignItems: 'center' }}>
|
|
66
66
|
<StyledFontAwesomeIcon icon={icon} />
|
|
67
67
|
<Typography variant="pi" fontWeight="bold" textColor="neutral600">
|
|
68
68
|
{formatMessage(intlLabel)}
|
|
@@ -17,7 +17,7 @@ const Category = ({ category, components, isOdd, isOpen, onAddComponent, onToggl
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
|
-
<Accordion expanded={isOpen}
|
|
20
|
+
<Accordion expanded={isOpen} onToggle={handleToggle} size="S">
|
|
21
21
|
<AccordionToggle
|
|
22
22
|
variant={isOdd ? 'primary' : 'secondary'}
|
|
23
23
|
title={category}
|
|
@@ -182,7 +182,7 @@ const DynamicZone = ({
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
return (
|
|
185
|
-
<Stack
|
|
185
|
+
<Stack spacing={6}>
|
|
186
186
|
{dynamicDisplayedComponentsLength > 0 && (
|
|
187
187
|
<Box>
|
|
188
188
|
<DzLabel
|
|
@@ -277,9 +277,6 @@ DynamicZone.propTypes = {
|
|
|
277
277
|
|
|
278
278
|
const Memoized = memo(DynamicZone, isEqual);
|
|
279
279
|
|
|
280
|
-
export default connect(
|
|
281
|
-
Memoized,
|
|
282
|
-
select
|
|
283
|
-
);
|
|
280
|
+
export default connect(Memoized, select);
|
|
284
281
|
|
|
285
282
|
export { DynamicZone };
|
|
@@ -18,12 +18,7 @@ const cleanData = (retrievedData, currentSchema, componentsSchema) => {
|
|
|
18
18
|
|
|
19
19
|
switch (attrType) {
|
|
20
20
|
case 'json':
|
|
21
|
-
|
|
22
|
-
cleanedData = JSON.parse(value);
|
|
23
|
-
} catch (err) {
|
|
24
|
-
cleanedData = value;
|
|
25
|
-
}
|
|
26
|
-
|
|
21
|
+
cleanedData = JSON.parse(value);
|
|
27
22
|
break;
|
|
28
23
|
// TODO
|
|
29
24
|
// case 'date':
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import get from 'lodash/get';
|
|
2
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
3
|
import isEmpty from 'lodash/isEmpty';
|
|
7
4
|
import isNaN from 'lodash/isNaN';
|
|
8
5
|
import toNumber from 'lodash/toNumber';
|
|
@@ -10,8 +7,6 @@ import toNumber from 'lodash/toNumber';
|
|
|
10
7
|
import * as yup from 'yup';
|
|
11
8
|
import { translatedErrors as errorsTrads } from '@strapi/helper-plugin';
|
|
12
9
|
|
|
13
|
-
import isValidJSONString from './isValidJSONString';
|
|
14
|
-
|
|
15
10
|
yup.addMethod(yup.mixed, 'defined', function() {
|
|
16
11
|
return this.test('defined', errorsTrads.required, value => value !== undefined);
|
|
17
12
|
});
|
|
@@ -223,10 +218,6 @@ const createYupSchemaAttribute = (type, validations, options) => {
|
|
|
223
218
|
return true;
|
|
224
219
|
}
|
|
225
220
|
|
|
226
|
-
if (isValidJSONString(value) || isNumber(value) || isNull(value) || isObject(value)) {
|
|
227
|
-
return true;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
221
|
try {
|
|
231
222
|
JSON.parse(value);
|
|
232
223
|
|
|
@@ -86,7 +86,7 @@ const FieldComponent = ({
|
|
|
86
86
|
/>
|
|
87
87
|
)}
|
|
88
88
|
</Flex>
|
|
89
|
-
<Stack
|
|
89
|
+
<Stack spacing={1}>
|
|
90
90
|
{!isRepeatable && !isInitialized && (
|
|
91
91
|
<ComponentInitializer
|
|
92
92
|
isReadOnly={isReadOnly}
|
|
@@ -159,7 +159,4 @@ FieldComponent.propTypes = {
|
|
|
159
159
|
|
|
160
160
|
const Memoized = memo(FieldComponent, isEqual);
|
|
161
161
|
|
|
162
|
-
export default connect(
|
|
163
|
-
Memoized,
|
|
164
|
-
select
|
|
165
|
-
);
|
|
162
|
+
export default connect(Memoized, select);
|
|
@@ -16,7 +16,6 @@ import Label from './Label';
|
|
|
16
16
|
import FieldWrapper from './FieldWrapper';
|
|
17
17
|
|
|
18
18
|
const WAIT = 600;
|
|
19
|
-
const stringify = JSON.stringify;
|
|
20
19
|
const DEFAULT_THEME = 'blackboard';
|
|
21
20
|
|
|
22
21
|
const loadCss = async () => {
|
|
@@ -80,9 +79,7 @@ class InputJSON extends React.Component {
|
|
|
80
79
|
try {
|
|
81
80
|
if (value === null) return this.codeMirror.setValue('');
|
|
82
81
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return this.codeMirror.setValue(nextValue);
|
|
82
|
+
return this.codeMirror.setValue(value);
|
|
86
83
|
} catch (err) {
|
|
87
84
|
return this.setState({ error: true });
|
|
88
85
|
}
|
|
@@ -160,7 +157,7 @@ class InputJSON extends React.Component {
|
|
|
160
157
|
|
|
161
158
|
return (
|
|
162
159
|
<FieldWrapper name={this.props.name} hint={this.props.description} error={this.props.error}>
|
|
163
|
-
<Stack
|
|
160
|
+
<Stack spacing={1}>
|
|
164
161
|
<Label
|
|
165
162
|
intlLabel={this.props.intlLabel}
|
|
166
163
|
labelAction={this.props.labelAction}
|