@strapi/admin 4.2.0-alpha.1 → 4.2.0-alpha.5
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 +42 -40
- package/admin/src/app.js +7 -4
- package/admin/src/components/GuidedTour/Homepage/index.js +13 -3
- package/admin/src/components/GuidedTour/Modal/components/Modal.js +1 -1
- package/admin/src/components/GuidedTour/Modal/index.js +4 -1
- package/admin/src/components/GuidedTour/layout.js +9 -0
- package/admin/src/components/Providers/index.js +32 -65
- package/admin/src/components/Theme/index.js +12 -11
- package/admin/src/content-manager/components/Inputs/index.js +3 -4
- package/admin/src/content-manager/components/SelectWrapper/utils/getSelectStyles.js +1 -3
- package/admin/src/content-manager/components/Wysiwyg/EditorStylesContainer.js +2 -4
- package/admin/src/contexts/index.js +0 -1
- package/admin/src/hooks/index.js +0 -1
- package/admin/src/pages/Admin/Onboarding/index.js +1 -1
- package/admin/src/pages/AuthPage/index.js +1 -0
- package/admin/src/pages/HomePage/SocialLinks.js +3 -0
- package/admin/src/pages/ProfilePage/index.js +10 -74
- package/admin/src/pages/ProfilePage/utils/api.js +2 -4
- package/admin/src/themes/colors.js +51 -0
- package/admin/src/themes/fontWeights.js +8 -0
- package/admin/src/themes/index.js +13 -0
- package/admin/src/themes/sizes.js +31 -0
- package/admin/src/translations/en.json +4 -7
- package/admin/src/translations/ja.json +2 -2
- package/admin/src/translations/ko.json +2 -2
- package/build/4362.dbe98749.chunk.js +1 -0
- package/build/{6404.3c2d0a81.chunk.js → 6250.836851ca.chunk.js} +1 -1
- package/build/9260.d9bb874f.chunk.js +2 -0
- package/build/{9260.fa40c7bd.chunk.js.LICENSE.txt → 9260.d9bb874f.chunk.js.LICENSE.txt} +0 -0
- package/build/Admin-authenticatedApp.a24ebaa0.chunk.js +1 -0
- package/build/Admin_homePage.86604515.chunk.js +1 -0
- package/build/Admin_profilePage.c497b39d.chunk.js +1 -0
- package/build/{Admin_settingsPage.a8c7ded5.chunk.js → Admin_settingsPage.55ec1f30.chunk.js} +1 -1
- package/build/content-manager.31be1448.chunk.js +1 -0
- package/build/{content-type-builder.cda4ba3c.chunk.js → content-type-builder.de5d18ad.chunk.js} +1 -1
- package/build/{email-settings-page.40ee2bda.chunk.js → email-settings-page.27ee4a98.chunk.js} +1 -1
- package/build/en-json.bce44d39.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/ja-json.e13f04e8.chunk.js +1 -0
- package/build/ko-json.2200c9c9.chunk.js +1 -0
- package/build/{main.34ee547b.js → main.4ea77c5f.js} +2 -2
- package/build/{main.34ee547b.js.LICENSE.txt → main.4ea77c5f.js.LICENSE.txt} +0 -0
- package/build/{runtime~main.3ef9943c.js → runtime~main.83b9ee0b.js} +1 -1
- package/build/users-email-settings-page.862eb51e.chunk.js +1 -0
- package/index.js +53 -244
- package/package.json +7 -5
- package/server/routes/serve-admin-panel.js +1 -1
- package/utils/create-cache-dir.js +119 -0
- package/utils/get-custom-webpack-config.js +38 -0
- package/utils/index.js +13 -0
- package/utils/should-build-admin.js +51 -0
- package/utils/watch-admin-files.js +56 -0
- package/webpack.config.js +36 -3
- package/admin/src/components/ThemeToggleProvider/index.js +0 -66
- package/admin/src/contexts/ThemeToggle/index.js +0 -5
- package/admin/src/hooks/useThemeToggle/index.js +0 -10
- package/build/4362.86a4e939.chunk.js +0 -1
- package/build/9260.fa40c7bd.chunk.js +0 -2
- package/build/Admin-authenticatedApp.2d44e117.chunk.js +0 -1
- package/build/Admin_homePage.d6754c66.chunk.js +0 -1
- package/build/Admin_profilePage.d7192d06.chunk.js +0 -1
- package/build/content-manager.de808f2c.chunk.js +0 -1
- package/build/en-json.b35c285f.chunk.js +0 -1
- package/build/ja-json.46e29f04.chunk.js +0 -1
- package/build/ko-json.dd36fdc0.chunk.js +0 -1
- package/build/users-email-settings-page.5abb9575.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
|
|
3
|
+
import { lightTheme } 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,6 +13,7 @@ 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';
|
|
16
17
|
import languageNativeNames from './translations/languageNativeNames';
|
|
17
18
|
import {
|
|
18
19
|
INJECT_COLUMN_IN_TABLE,
|
|
@@ -33,7 +34,7 @@ class StrapiApp {
|
|
|
33
34
|
locales: ['en'],
|
|
34
35
|
menuLogo: MenuLogo,
|
|
35
36
|
notifications: { releases: true },
|
|
36
|
-
|
|
37
|
+
theme: lightTheme,
|
|
37
38
|
translations: {},
|
|
38
39
|
tutorials: true,
|
|
39
40
|
};
|
|
@@ -225,7 +226,7 @@ class StrapiApp {
|
|
|
225
226
|
}
|
|
226
227
|
|
|
227
228
|
if (this.customConfigurations?.theme) {
|
|
228
|
-
merge(this.configurations.
|
|
229
|
+
this.configurations.theme = merge(this.configurations.theme, this.customConfigurations.theme);
|
|
229
230
|
}
|
|
230
231
|
|
|
231
232
|
if (this.customConfigurations?.notifications?.releases !== undefined) {
|
|
@@ -426,43 +427,44 @@ class StrapiApp {
|
|
|
426
427
|
} = this.library;
|
|
427
428
|
|
|
428
429
|
return (
|
|
429
|
-
<
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
430
|
+
<Theme theme={this.configurations.theme}>
|
|
431
|
+
<Providers
|
|
432
|
+
authLogo={this.configurations.authLogo}
|
|
433
|
+
components={components}
|
|
434
|
+
fields={fields}
|
|
435
|
+
localeNames={localeNames}
|
|
436
|
+
getAdminInjectedComponents={this.getAdminInjectedComponents}
|
|
437
|
+
getPlugin={this.getPlugin}
|
|
438
|
+
messages={this.configurations.translations}
|
|
439
|
+
menu={this.menu}
|
|
440
|
+
menuLogo={this.configurations.menuLogo}
|
|
441
|
+
plugins={this.plugins}
|
|
442
|
+
runHookParallel={this.runHookParallel}
|
|
443
|
+
runHookWaterfall={(name, initialValue, async = false) => {
|
|
444
|
+
return this.runHookWaterfall(name, initialValue, async, store);
|
|
445
|
+
}}
|
|
446
|
+
runHookSeries={this.runHookSeries}
|
|
447
|
+
settings={this.settings}
|
|
448
|
+
showTutorials={this.configurations.tutorials}
|
|
449
|
+
showReleaseNotification={this.configurations.notifications.releases}
|
|
450
|
+
store={store}
|
|
451
|
+
>
|
|
452
|
+
<>
|
|
453
|
+
<Helmet
|
|
454
|
+
link={[
|
|
455
|
+
{
|
|
456
|
+
rel: 'icon',
|
|
457
|
+
type: 'image/png',
|
|
458
|
+
href: this.configurations.head.favicon,
|
|
459
|
+
},
|
|
460
|
+
]}
|
|
461
|
+
/>
|
|
462
|
+
<BrowserRouter basename={basename}>
|
|
463
|
+
<App store={store} />
|
|
464
|
+
</BrowserRouter>
|
|
465
|
+
</>
|
|
466
|
+
</Providers>
|
|
467
|
+
</Theme>
|
|
466
468
|
);
|
|
467
469
|
}
|
|
468
470
|
}
|
package/admin/src/app.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useGuidedTour } from '@strapi/helper-plugin';
|
|
2
|
+
import { useGuidedTour, useTracking } from '@strapi/helper-plugin';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import { Stack } from '@strapi/design-system/Stack';
|
|
5
5
|
import { Flex } from '@strapi/design-system/Flex';
|
|
@@ -14,12 +14,17 @@ import layout from '../layout';
|
|
|
14
14
|
const GuidedTourHomepage = () => {
|
|
15
15
|
const { guidedTourState, setSkipped } = useGuidedTour();
|
|
16
16
|
const { formatMessage } = useIntl();
|
|
17
|
+
const { trackUsage } = useTracking();
|
|
17
18
|
|
|
18
19
|
const sections = Object.entries(layout).map(([key, val]) => ({
|
|
19
20
|
key,
|
|
20
21
|
title: val.home.title,
|
|
21
22
|
content: (
|
|
22
|
-
<LinkButton
|
|
23
|
+
<LinkButton
|
|
24
|
+
onClick={() => trackUsage(val.home.trackingEvent)}
|
|
25
|
+
to={val.home.cta.target}
|
|
26
|
+
endIcon={<ArrowRight />}
|
|
27
|
+
>
|
|
23
28
|
{formatMessage(val.home.cta.title)}
|
|
24
29
|
</LinkButton>
|
|
25
30
|
),
|
|
@@ -32,6 +37,11 @@ const GuidedTourHomepage = () => {
|
|
|
32
37
|
|
|
33
38
|
const activeSection = enrichedSections.find(section => !section.isDone)?.key;
|
|
34
39
|
|
|
40
|
+
const handleSkip = () => {
|
|
41
|
+
setSkipped(true);
|
|
42
|
+
trackUsage('didSkipGuidedtour');
|
|
43
|
+
};
|
|
44
|
+
|
|
35
45
|
return (
|
|
36
46
|
<Box
|
|
37
47
|
hasRadius
|
|
@@ -52,7 +62,7 @@ const GuidedTourHomepage = () => {
|
|
|
52
62
|
<StepperHomepage sections={sections} currentSectionKey={activeSection} />
|
|
53
63
|
</Stack>
|
|
54
64
|
<Flex justifyContent="flex-end">
|
|
55
|
-
<Button variant="tertiary" onClick={
|
|
65
|
+
<Button variant="tertiary" onClick={handleSkip}>
|
|
56
66
|
{formatMessage({ id: 'app.components.GuidedTour.skip', defaultMessage: 'Skip the tour' })}
|
|
57
67
|
</Button>
|
|
58
68
|
</Flex>
|
|
@@ -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}33`};
|
|
21
21
|
`;
|
|
22
22
|
|
|
23
23
|
const Modal = ({ onClose, onSkip, children, hideSkip }) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState, useReducer } from 'react';
|
|
2
2
|
import at from 'lodash/at';
|
|
3
|
-
import { useGuidedTour } from '@strapi/helper-plugin';
|
|
3
|
+
import { useGuidedTour, useTracking } from '@strapi/helper-plugin';
|
|
4
4
|
import layout from '../layout';
|
|
5
5
|
import Modal from './components/Modal';
|
|
6
6
|
import reducer, { initialState } from './reducer';
|
|
@@ -20,6 +20,7 @@ const GuidedTourModal = () => {
|
|
|
20
20
|
{ stepContent, sectionIndex, stepIndex, hasSectionAfter, hasStepAfter },
|
|
21
21
|
dispatch,
|
|
22
22
|
] = useReducer(reducer, initialState);
|
|
23
|
+
const { trackUsage } = useTracking();
|
|
23
24
|
|
|
24
25
|
useEffect(() => {
|
|
25
26
|
if (!currentStep) {
|
|
@@ -56,6 +57,7 @@ const GuidedTourModal = () => {
|
|
|
56
57
|
|
|
57
58
|
const handleCtaClick = () => {
|
|
58
59
|
setStepState(currentStep, true);
|
|
60
|
+
trackUsage(stepContent.trackingEvent);
|
|
59
61
|
|
|
60
62
|
setCurrentStep(null);
|
|
61
63
|
};
|
|
@@ -63,6 +65,7 @@ const GuidedTourModal = () => {
|
|
|
63
65
|
const handleSkip = () => {
|
|
64
66
|
setSkipped(true);
|
|
65
67
|
setCurrentStep(null);
|
|
68
|
+
trackUsage('didSkipGuidedtour');
|
|
66
69
|
};
|
|
67
70
|
|
|
68
71
|
if (isVisible && stepContent) {
|
|
@@ -13,6 +13,7 @@ const layout = {
|
|
|
13
13
|
type: 'REDIRECT',
|
|
14
14
|
target: '/plugins/content-type-builder',
|
|
15
15
|
},
|
|
16
|
+
trackingEvent: 'didClickGuidedTourHomepageContentTypeBuilder',
|
|
16
17
|
},
|
|
17
18
|
create: {
|
|
18
19
|
title: {
|
|
@@ -31,6 +32,7 @@ const layout = {
|
|
|
31
32
|
},
|
|
32
33
|
type: 'CLOSE',
|
|
33
34
|
},
|
|
35
|
+
trackingEvent: 'didClickGuidedTourStep1CollectionType',
|
|
34
36
|
},
|
|
35
37
|
success: {
|
|
36
38
|
title: {
|
|
@@ -49,6 +51,7 @@ const layout = {
|
|
|
49
51
|
type: 'REDIRECT',
|
|
50
52
|
target: '/content-manager',
|
|
51
53
|
},
|
|
54
|
+
trackingEvent: 'didCreateGuidedTourCollectionType',
|
|
52
55
|
},
|
|
53
56
|
},
|
|
54
57
|
contentManager: {
|
|
@@ -65,6 +68,7 @@ const layout = {
|
|
|
65
68
|
type: 'REDIRECT',
|
|
66
69
|
target: '/content-manager',
|
|
67
70
|
},
|
|
71
|
+
trackingEvent: 'didClickGuidedTourHomepageContentManager',
|
|
68
72
|
},
|
|
69
73
|
create: {
|
|
70
74
|
title: {
|
|
@@ -83,6 +87,7 @@ const layout = {
|
|
|
83
87
|
},
|
|
84
88
|
type: 'CLOSE',
|
|
85
89
|
},
|
|
90
|
+
trackingEvent: 'didClickGuidedTourStep2ContentManager',
|
|
86
91
|
},
|
|
87
92
|
success: {
|
|
88
93
|
title: {
|
|
@@ -101,6 +106,7 @@ const layout = {
|
|
|
101
106
|
type: 'REDIRECT',
|
|
102
107
|
target: '/settings/api-tokens',
|
|
103
108
|
},
|
|
109
|
+
trackingEvent: 'didCreateGuidedTourEntry',
|
|
104
110
|
},
|
|
105
111
|
},
|
|
106
112
|
apiTokens: {
|
|
@@ -117,6 +123,7 @@ const layout = {
|
|
|
117
123
|
type: 'REDIRECT',
|
|
118
124
|
target: '/settings/api-tokens',
|
|
119
125
|
},
|
|
126
|
+
trackingEvent: 'didClickGuidedTourHomepageApiTokens',
|
|
120
127
|
},
|
|
121
128
|
create: {
|
|
122
129
|
title: {
|
|
@@ -135,6 +142,7 @@ const layout = {
|
|
|
135
142
|
},
|
|
136
143
|
type: 'CLOSE',
|
|
137
144
|
},
|
|
145
|
+
trackingEvent: 'didClickGuidedTourStep3ApiTokens',
|
|
138
146
|
},
|
|
139
147
|
success: {
|
|
140
148
|
title: {
|
|
@@ -146,6 +154,7 @@ const layout = {
|
|
|
146
154
|
defaultMessage:
|
|
147
155
|
"<p>See content in action by making an HTTP request:</p><ul><li><p>To this URL: <light>https://'<'YOUR_DOMAIN'>'/api/'<'YOUR_CT'>'</light></p></li><li><p>With the header: <light>Authorization: bearer '<'YOUR_API_TOKEN'>'</light></p></li></ul><p>For more ways to interact with content, see the <documentationLink>documentation</documentationLink>.</p>",
|
|
148
156
|
},
|
|
157
|
+
trackingEvent: 'didGenerateGuidedTourApiTokens',
|
|
149
158
|
},
|
|
150
159
|
},
|
|
151
160
|
};
|
|
@@ -9,8 +9,6 @@ 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';
|
|
14
12
|
|
|
15
13
|
const queryClient = new QueryClient({
|
|
16
14
|
defaultOptions: {
|
|
@@ -38,45 +36,41 @@ const Providers = ({
|
|
|
38
36
|
settings,
|
|
39
37
|
showReleaseNotification,
|
|
40
38
|
showTutorials,
|
|
39
|
+
|
|
41
40
|
store,
|
|
42
|
-
themes,
|
|
43
41
|
}) => {
|
|
44
42
|
return (
|
|
45
|
-
<
|
|
46
|
-
<
|
|
47
|
-
<
|
|
48
|
-
<Provider
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
</Provider>
|
|
77
|
-
</QueryClientProvider>
|
|
78
|
-
</Theme>
|
|
79
|
-
</ThemeToggleProvider>
|
|
43
|
+
<QueryClientProvider client={queryClient}>
|
|
44
|
+
<Provider store={store}>
|
|
45
|
+
<AdminContext.Provider value={{ getAdminInjectedComponents }}>
|
|
46
|
+
<ConfigurationsContext.Provider
|
|
47
|
+
value={{ authLogo, menuLogo, showReleaseNotification, showTutorials }}
|
|
48
|
+
>
|
|
49
|
+
<StrapiAppProvider
|
|
50
|
+
getPlugin={getPlugin}
|
|
51
|
+
menu={menu}
|
|
52
|
+
plugins={plugins}
|
|
53
|
+
runHookParallel={runHookParallel}
|
|
54
|
+
runHookWaterfall={runHookWaterfall}
|
|
55
|
+
runHookSeries={runHookSeries}
|
|
56
|
+
settings={settings}
|
|
57
|
+
>
|
|
58
|
+
<LibraryProvider components={components} fields={fields}>
|
|
59
|
+
<LanguageProvider messages={messages} localeNames={localeNames}>
|
|
60
|
+
<AutoReloadOverlayBlockerProvider>
|
|
61
|
+
<OverlayBlocker>
|
|
62
|
+
<GuidedTour>
|
|
63
|
+
<Notifications>{children}</Notifications>
|
|
64
|
+
</GuidedTour>
|
|
65
|
+
</OverlayBlocker>
|
|
66
|
+
</AutoReloadOverlayBlockerProvider>
|
|
67
|
+
</LanguageProvider>
|
|
68
|
+
</LibraryProvider>
|
|
69
|
+
</StrapiAppProvider>
|
|
70
|
+
</ConfigurationsContext.Provider>
|
|
71
|
+
</AdminContext.Provider>
|
|
72
|
+
</Provider>
|
|
73
|
+
</QueryClientProvider>
|
|
80
74
|
);
|
|
81
75
|
};
|
|
82
76
|
|
|
@@ -110,33 +104,6 @@ Providers.propTypes = {
|
|
|
110
104
|
showReleaseNotification: PropTypes.bool.isRequired,
|
|
111
105
|
showTutorials: PropTypes.bool.isRequired,
|
|
112
106
|
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,
|
|
140
107
|
};
|
|
141
108
|
|
|
142
109
|
export default Providers;
|
|
@@ -1,22 +1,23 @@
|
|
|
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 { lightTheme } from '@strapi/design-system/themes';
|
|
5
5
|
import GlobalStyle from '../GlobalStyle';
|
|
6
6
|
|
|
7
|
-
const Theme = ({ children }) =>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<GlobalStyle />
|
|
14
|
-
</ThemeProvider>
|
|
15
|
-
);
|
|
16
|
-
};
|
|
7
|
+
const Theme = ({ children, theme }) => (
|
|
8
|
+
<ThemeProvider theme={theme}>
|
|
9
|
+
{children}
|
|
10
|
+
<GlobalStyle />
|
|
11
|
+
</ThemeProvider>
|
|
12
|
+
);
|
|
17
13
|
|
|
18
14
|
Theme.propTypes = {
|
|
19
15
|
children: PropTypes.element.isRequired,
|
|
16
|
+
theme: PropTypes.object,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
Theme.defaultProps = {
|
|
20
|
+
theme: lightTheme,
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
export default Theme;
|
|
@@ -224,6 +224,8 @@ function Inputs({
|
|
|
224
224
|
attribute={fieldSchema}
|
|
225
225
|
autoComplete="new-password"
|
|
226
226
|
intlLabel={{ id: label, defaultMessage: label }}
|
|
227
|
+
// in case the default value of the boolean is null, attribute.default doesn't exist
|
|
228
|
+
isNullable={inputType === 'bool' && [null, undefined].includes(fieldSchema.default)}
|
|
227
229
|
description={description ? { id: description, defaultMessage: description } : null}
|
|
228
230
|
disabled={shouldDisableField}
|
|
229
231
|
error={errorId}
|
|
@@ -279,7 +281,4 @@ Inputs.propTypes = {
|
|
|
279
281
|
|
|
280
282
|
const Memoized = memo(Inputs, isEqual);
|
|
281
283
|
|
|
282
|
-
export default connect(
|
|
283
|
-
Memoized,
|
|
284
|
-
select
|
|
285
|
-
);
|
|
284
|
+
export default connect(Memoized, select);
|
|
@@ -49,8 +49,6 @@ const getSelectStyles = theme => {
|
|
|
49
49
|
...base,
|
|
50
50
|
width: '100%',
|
|
51
51
|
marginTop: theme.spaces[1],
|
|
52
|
-
backgroundColor: theme.colors.neutral0,
|
|
53
|
-
color: theme.colors.neutral800,
|
|
54
52
|
borderRadius: '4px !important',
|
|
55
53
|
borderTopLeftRadius: '4px !important',
|
|
56
54
|
borderTopRightRadius: '4px !important',
|
|
@@ -78,7 +76,7 @@ const getSelectStyles = theme => {
|
|
|
78
76
|
return { ...base, lineHeight: theme.spaces[5], backgroundColor, borderRadius: 4 };
|
|
79
77
|
},
|
|
80
78
|
placeholder: base => ({ ...base, marginLeft: 0 }),
|
|
81
|
-
singleValue: base => ({ ...base, marginLeft: 0
|
|
79
|
+
singleValue: base => ({ ...base, marginLeft: 0 }),
|
|
82
80
|
valueContainer: base => ({
|
|
83
81
|
...base,
|
|
84
82
|
padding: 0,
|
|
@@ -29,8 +29,7 @@ export const EditorStylesContainer = styled.div`
|
|
|
29
29
|
|
|
30
30
|
.CodeMirror-scrollbar-filler,
|
|
31
31
|
.CodeMirror-gutter-filler {
|
|
32
|
-
/* The little square between H and V scrollbars */
|
|
33
|
-
background-color: ${({ theme }) => `${theme.colors.neutral0}`};
|
|
32
|
+
background-color: white; /* The little square between H and V scrollbars */
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
/* GUTTER */
|
|
@@ -159,7 +158,7 @@ export const EditorStylesContainer = styled.div`
|
|
|
159
158
|
.CodeMirror {
|
|
160
159
|
position: relative;
|
|
161
160
|
overflow: hidden;
|
|
162
|
-
background:
|
|
161
|
+
background: white;
|
|
163
162
|
}
|
|
164
163
|
|
|
165
164
|
.CodeMirror-scroll {
|
|
@@ -293,7 +292,6 @@ export const EditorStylesContainer = styled.div`
|
|
|
293
292
|
.CodeMirror-cursor {
|
|
294
293
|
position: absolute;
|
|
295
294
|
pointer-events: none;
|
|
296
|
-
border-color: ${({ theme }) => `${theme.colors.neutral800}`};
|
|
297
295
|
}
|
|
298
296
|
.CodeMirror-measure pre {
|
|
299
297
|
position: static;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { default as AdminContext } from './Admin';
|
|
2
2
|
export { default as ConfigurationsContext } from './Configurations';
|
|
3
3
|
export { default as PermissionsDataManagerContext } from './PermisssionsDataManagerContext';
|
|
4
|
-
export { default as ThemeToggleContext } from './ThemeToggle';
|
package/admin/src/hooks/index.js
CHANGED
|
@@ -9,4 +9,3 @@ export { default as useSettingsMenu } from './useSettingsMenu';
|
|
|
9
9
|
export { default as useSettingsForm } from './useSettingsForm';
|
|
10
10
|
export { default as usePermissionsDataManager } from './usePermissionsDataManager';
|
|
11
11
|
export { default as useReleaseNotification } from './useReleaseNotification';
|
|
12
|
-
export { default as useThemeToggle } from './useThemeToggle';
|