@strapi/admin 4.12.7 → 4.13.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. package/admin/src/components/NpsSurvey/hooks/useNpsSurveySettings.js +17 -0
  2. package/admin/src/components/NpsSurvey/index.js +365 -0
  3. package/admin/src/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/getTableColumns.js +2 -0
  4. package/admin/src/content-manager/components/DynamicZone/components/DynamicZoneLabel.js +1 -1
  5. package/admin/src/content-manager/components/EditViewDataManagerProvider/reducer.js +8 -1
  6. package/admin/src/content-manager/components/Filter/CustomInputs/AdminUsersFilter.js +42 -0
  7. package/admin/src/content-manager/components/Filter/Filter.js +54 -0
  8. package/admin/src/content-manager/components/Filter/index.js +1 -0
  9. package/admin/src/content-manager/components/InputUID/index.js +222 -216
  10. package/admin/src/content-manager/components/RelationInput/RelationInput.js +4 -0
  11. package/admin/src/content-manager/components/RepeatableComponent/index.js +32 -2
  12. package/admin/src/content-manager/components/Wysiwyg/Editor.js +432 -68
  13. package/admin/src/content-manager/components/Wysiwyg/WysiwygStyles.js +0 -7
  14. package/admin/src/content-manager/components/Wysiwyg/index.js +147 -152
  15. package/admin/src/content-manager/hooks/useAllowedAttributes.js +47 -0
  16. package/admin/src/content-manager/pages/EditView/Information/index.js +9 -8
  17. package/admin/src/content-manager/pages/ListSettingsView/components/Settings.js +40 -7
  18. package/admin/src/content-manager/pages/ListSettingsView/index.js +6 -2
  19. package/admin/src/content-manager/pages/ListView/components/FieldPicker/index.js +67 -69
  20. package/admin/src/content-manager/pages/ListView/components/ViewSettingsMenu/index.js +80 -0
  21. package/admin/src/content-manager/pages/ListView/index.js +236 -67
  22. package/admin/src/content-manager/utils/getDisplayName.js +33 -0
  23. package/admin/src/content-manager/utils/index.js +1 -0
  24. package/admin/src/pages/Admin/index.js +3 -1
  25. package/admin/src/pages/AuthPage/components/Register/index.js +5 -0
  26. package/admin/src/pages/SettingsPage/components/SettingsNav/index.js +3 -3
  27. package/admin/src/pages/SettingsPage/index.js +16 -26
  28. package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/index.js +69 -35
  29. package/admin/src/plugins.js +7 -8
  30. package/admin/src/translations/en.json +10 -1
  31. package/build/{1049.f76cb14b.chunk.js → 1049.ec69f5e0.chunk.js} +1 -1
  32. package/build/1227.9f37e1dc.chunk.js +1 -0
  33. package/build/{1386.879bcd90.chunk.js → 1386.ea73b677.chunk.js} +1 -1
  34. package/build/1504.eff012f7.chunk.js +95 -0
  35. package/build/{2225.c6244756.chunk.js → 2225.649fb7bc.chunk.js} +11 -11
  36. package/build/2237.b832ae6e.chunk.js +114 -0
  37. package/build/2379.1f98a31a.chunk.js +1 -0
  38. package/build/2395.0e5e8ded.chunk.js +26 -0
  39. package/build/2801.8e1aa82a.chunk.js +1 -0
  40. package/build/{3483.03c24f96.chunk.js → 3483.19381b40.chunk.js} +1 -1
  41. package/build/4174.f1f39e40.chunk.js +1 -0
  42. package/build/4546.a5946d22.chunk.js +1 -0
  43. package/build/4724.aea5c8c1.chunk.js +6 -0
  44. package/build/502.7bba43b1.chunk.js +1 -0
  45. package/build/6158.c3c13c20.chunk.js +1 -0
  46. package/build/7464.eb057bec.chunk.js +1 -0
  47. package/build/78.dcc6df5c.chunk.js +1 -0
  48. package/build/8276.be3ed581.chunk.js +26 -0
  49. package/build/{Admin-authenticatedApp.31497f74.chunk.js → Admin-authenticatedApp.43b6ec9a.chunk.js} +2 -2
  50. package/build/{Admin_InternalErrorPage.f45f2462.chunk.js → Admin_InternalErrorPage.38155af3.chunk.js} +1 -1
  51. package/build/{Admin_homePage.ac9dfb86.chunk.js → Admin_homePage.6f128523.chunk.js} +1 -1
  52. package/build/{Admin_marketplace.c94239f6.chunk.js → Admin_marketplace.061a6e5a.chunk.js} +1 -1
  53. package/build/{Admin_pluginsPage.bbe79434.chunk.js → Admin_pluginsPage.16f837b8.chunk.js} +1 -1
  54. package/build/{Admin_profilePage.192edc52.chunk.js → Admin_profilePage.678bce24.chunk.js} +2 -2
  55. package/build/Admin_settingsPage.af7309e4.chunk.js +111 -0
  56. package/build/{Upload_ConfigureTheView.345ac1e0.chunk.js → Upload_ConfigureTheView.3fc1c100.chunk.js} +1 -1
  57. package/build/admin-app.d63bd229.chunk.js +36 -0
  58. package/build/{admin-edit-roles-page.6d567273.chunk.js → admin-edit-roles-page.38a6c863.chunk.js} +3 -3
  59. package/build/{admin-edit-users.acfd4128.chunk.js → admin-edit-users.545fc882.chunk.js} +2 -2
  60. package/build/{admin-roles-list.23ddff26.chunk.js → admin-roles-list.1e2e814d.chunk.js} +1 -1
  61. package/build/{admin-users.00e20017.chunk.js → admin-users.b8ea5677.chunk.js} +2 -2
  62. package/build/{api-tokens-create-page.46c2ea84.chunk.js → api-tokens-create-page.e0c15627.chunk.js} +1 -1
  63. package/build/{api-tokens-edit-page.58139df9.chunk.js → api-tokens-edit-page.9f2dce47.chunk.js} +1 -1
  64. package/build/{api-tokens-list-page.0af7d431.chunk.js → api-tokens-list-page.d747051c.chunk.js} +2 -2
  65. package/build/{audit-logs-settings-page.0f73ccf8.chunk.js → audit-logs-settings-page.96f9d608.chunk.js} +1 -1
  66. package/build/content-manager.ccff1078.chunk.js +1097 -0
  67. package/build/{content-type-builder-list-view.bf9be456.chunk.js → content-type-builder-list-view.b71cf240.chunk.js} +1 -1
  68. package/build/{content-type-builder.cd999f6e.chunk.js → content-type-builder.e5669749.chunk.js} +2 -2
  69. package/build/email-settings-page.2809f0bf.chunk.js +11 -0
  70. package/build/en-json.e12fd5fc.chunk.js +1 -0
  71. package/build/{i18n-settings-page.47f78016.chunk.js → i18n-settings-page.5f716172.chunk.js} +1 -1
  72. package/build/index.html +1 -1
  73. package/build/main.c6c9e04c.js +2859 -0
  74. package/build/review-workflows-settings-create-view.4a156a19.chunk.js +1 -0
  75. package/build/review-workflows-settings-edit-view.ce984d1f.chunk.js +1 -0
  76. package/build/review-workflows-settings-list-view.419b8deb.chunk.js +56 -0
  77. package/build/{runtime~main.d515c521.js → runtime~main.dcf1cb45.js} +2 -2
  78. package/build/{sso-settings-page.12b6d8ae.chunk.js → sso-settings-page.45153df5.chunk.js} +1 -1
  79. package/build/{transfer-tokens-create-page.1597e6ab.chunk.js → transfer-tokens-create-page.ebba16d8.chunk.js} +1 -1
  80. package/build/{transfer-tokens-edit-page.8741529f.chunk.js → transfer-tokens-edit-page.d7bb2b3e.chunk.js} +1 -1
  81. package/build/{transfer-tokens-list-page.d6986b03.chunk.js → transfer-tokens-list-page.cfe1736c.chunk.js} +2 -2
  82. package/build/{upload-settings.7f93d4c0.chunk.js → upload-settings.cc5ad813.chunk.js} +1 -1
  83. package/build/{upload.37488080.chunk.js → upload.756efc28.chunk.js} +1 -1
  84. package/build/users-advanced-settings-page.818d84eb.chunk.js +9 -0
  85. package/build/users-email-settings-page.c1967c09.chunk.js +9 -0
  86. package/build/users-providers-settings-page.11893e08.chunk.js +14 -0
  87. package/build/users-roles-settings-page.2b051e6a.chunk.js +55 -0
  88. package/build/{webhook-edit-page.6cb479ff.chunk.js → webhook-edit-page.de45c635.chunk.js} +2 -2
  89. package/build/{webhook-list-page.65e1b5bb.chunk.js → webhook-list-page.ca91df8b.chunk.js} +1 -1
  90. package/ee/admin/content-manager/components/Filter/CustomInputs/ReviewWorkflows/AssigneeFilter.js +42 -0
  91. package/ee/admin/content-manager/components/Filter/CustomInputs/ReviewWorkflows/StageFilter.js +70 -0
  92. package/ee/admin/content-manager/components/Filter/CustomInputs/ReviewWorkflows/constants.js +71 -0
  93. package/ee/admin/content-manager/pages/EditView/InformationBox/InformationBoxEE.js +9 -217
  94. package/ee/admin/content-manager/pages/EditView/InformationBox/components/AssigneeSelect/AssigneeSelect.js +147 -0
  95. package/ee/admin/content-manager/pages/EditView/InformationBox/components/AssigneeSelect/index.js +1 -0
  96. package/ee/admin/content-manager/pages/EditView/InformationBox/components/StageSelect/StageSelect.js +243 -0
  97. package/ee/admin/content-manager/pages/EditView/InformationBox/components/StageSelect/index.js +1 -0
  98. package/ee/admin/content-manager/pages/EditView/InformationBox/constants.js +2 -0
  99. package/ee/admin/content-manager/pages/ListSettingsView/constants.js +7 -0
  100. package/ee/admin/content-manager/pages/ListView/ReviewWorkflowsColumn/ReviewWorkflowsAssigneeEE.js +21 -0
  101. package/ee/admin/content-manager/pages/ListView/ReviewWorkflowsColumn/constants.js +44 -17
  102. package/ee/admin/content-manager/pages/ListView/ReviewWorkflowsColumn/index.js +1 -0
  103. package/ee/admin/hooks/useAuthProviders.js +25 -0
  104. package/ee/admin/hooks/{useLicenseLimitNotification/index.js → useLicenseLimitNotification.js} +2 -4
  105. package/ee/admin/hooks/{useLicenseLimits/useLicenseLimits.js → useLicenseLimits.js} +4 -1
  106. package/ee/admin/pages/AuthPage/components/Login/index.js +8 -4
  107. package/ee/admin/pages/AuthPage/components/Providers/index.js +8 -5
  108. package/ee/admin/pages/HomePage/index.js +1 -1
  109. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/CreateView/CreateView.js +1 -1
  110. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/EditView/EditView.js +1 -1
  111. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/pages/ListView/ListView.js +1 -1
  112. package/ee/admin/pages/SettingsPage/pages/Users/ListPage/CreateAction/index.js +1 -1
  113. package/ee/admin/pages/SettingsPage/pages/Users/ListPage/index.js +1 -1
  114. package/ee/server/constants/workflows.js +1 -0
  115. package/ee/server/controllers/index.js +1 -0
  116. package/ee/server/controllers/workflows/assignees/index.js +44 -0
  117. package/ee/server/routes/review-workflows.js +17 -0
  118. package/ee/server/services/index.js +1 -0
  119. package/ee/server/services/review-workflows/assignees.js +54 -0
  120. package/ee/server/services/review-workflows/metrics/index.js +5 -0
  121. package/ee/server/services/review-workflows/review-workflows.js +20 -11
  122. package/ee/server/validation/review-workflows.js +8 -0
  123. package/index.js +2 -6
  124. package/package.json +9 -9
  125. package/scripts/build.js +15 -15
  126. package/scripts/create-dev-plugins-file.js +5 -38
  127. package/server/controllers/role.js +2 -0
  128. package/server/controllers/user.js +2 -0
  129. package/server/services/permission/permissions-manager/index.js +3 -1
  130. package/server/services/permission/permissions-manager/sanitize.js +19 -7
  131. package/server/services/permission/permissions-manager/validate.js +218 -0
  132. package/utils/create-cache-dir.js +62 -16
  133. package/utils/create-plugins-exclude-path.js +3 -23
  134. package/utils/get-plugins.js +110 -0
  135. package/utils/index.js +1 -1
  136. package/webpack.config.js +10 -13
  137. package/admin/src/content-manager/components/AttributeFilter/Filters.js +0 -58
  138. package/admin/src/content-manager/components/AttributeFilter/hooks/useAllowedAttributes.js +0 -42
  139. package/admin/src/content-manager/components/AttributeFilter/index.js +0 -40
  140. package/admin/src/content-manager/components/Wysiwyg/EditorStylesContainer.js +0 -344
  141. package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/api.js +0 -23
  142. package/admin/src/pages/SettingsPage/pages/ApplicationInfosPage/utils/prefixAllUrls.js +0 -17
  143. package/admin/src/pages/SettingsPage/utils/createSectionsRoutes.js +0 -11
  144. package/admin/src/pages/SettingsPage/utils/getSectionsToDisplay.js +0 -5
  145. package/admin/src/pages/SettingsPage/utils/index.js +0 -2
  146. package/build/2379.f1641312.chunk.js +0 -1
  147. package/build/2395.46f8d0c1.chunk.js +0 -26
  148. package/build/2801.5cef5ec8.chunk.js +0 -1
  149. package/build/3929.5632f24d.chunk.js +0 -114
  150. package/build/3984.dda474f7.chunk.js +0 -1
  151. package/build/4546.7a3c0d03.chunk.js +0 -1
  152. package/build/502.8ae8ef60.chunk.js +0 -1
  153. package/build/5483.6dd2e776.chunk.js +0 -6
  154. package/build/5542.2415a393.chunk.js +0 -63
  155. package/build/6158.c974fd83.chunk.js +0 -1
  156. package/build/7464.3e64a1d5.chunk.js +0 -1
  157. package/build/8276.10a3f883.chunk.js +0 -26
  158. package/build/Admin_settingsPage.97cb9d41.chunk.js +0 -111
  159. package/build/admin-app.91898385.chunk.js +0 -36
  160. package/build/content-manager.b40f79c0.chunk.js +0 -1099
  161. package/build/email-settings-page.d494d1eb.chunk.js +0 -11
  162. package/build/en-json.08c05fcf.chunk.js +0 -1
  163. package/build/main.9dbe4579.js +0 -2859
  164. package/build/review-workflows-settings-create-view.cb08cfa2.chunk.js +0 -1
  165. package/build/review-workflows-settings-edit-view.3c7cbe63.chunk.js +0 -1
  166. package/build/review-workflows-settings-list-view.1611dc1f.chunk.js +0 -56
  167. package/build/users-advanced-settings-page.f0760eb8.chunk.js +0 -9
  168. package/build/users-email-settings-page.ff4b32f3.chunk.js +0 -9
  169. package/build/users-providers-settings-page.48de0306.chunk.js +0 -14
  170. package/build/users-roles-settings-page.9d9a1eff.chunk.js +0 -30
  171. package/ee/admin/hooks/index.js +0 -4
  172. package/ee/admin/hooks/useAuthProviders/index.js +0 -50
  173. package/ee/admin/hooks/useAuthProviders/reducer.js +0 -26
  174. package/ee/admin/hooks/useLicenseLimits/index.js +0 -1
  175. package/scripts/create-plugins-file.js +0 -92
  176. package/utils/get-plugins-path.js +0 -41
  177. /package/ee/admin/hooks/{useLicenseLimits/__mocks__/index.js → __mocks__/useLicenseLimits.js} +0 -0
  178. /package/server/services/permission/permissions-manager/{query-builers.js → query-builders.js} +0 -0
@@ -1,83 +1,101 @@
1
- import React, { useEffect, useRef } from 'react';
1
+ import React, { forwardRef, useEffect, useImperativeHandle, useRef } from 'react';
2
2
 
3
3
  import CodeMirror from 'codemirror5';
4
4
  import PropTypes from 'prop-types';
5
+ import styled from 'styled-components';
5
6
 
6
7
  import PreviewWysiwyg from '../PreviewWysiwyg';
7
8
 
8
- import { EditorStylesContainer } from './EditorStylesContainer';
9
9
  import newlineAndIndentContinueMarkdownList from './utils/continueList';
10
- import { EditorAndPreviewWrapper } from './WysiwygStyles';
11
10
 
12
11
  import 'codemirror5/addon/display/placeholder';
13
12
 
14
- const Editor = ({
15
- disabled,
16
- editorRef,
17
- error,
18
- isPreviewMode,
19
- isExpandMode,
20
- name,
21
- onChange,
22
- placeholder,
23
- textareaRef,
24
- value,
25
- }) => {
26
- const onChangeRef = useRef(onChange);
27
-
28
- useEffect(() => {
29
- editorRef.current = CodeMirror.fromTextArea(textareaRef.current, {
30
- lineWrapping: true,
31
- extraKeys: {
32
- Enter: 'newlineAndIndentContinueMarkdownList',
33
- Tab: false,
34
- 'Shift-Tab': false,
35
- },
36
- readOnly: false,
37
- smartIndent: false,
13
+ const Editor = forwardRef(
14
+ (
15
+ {
16
+ disabled,
17
+ editorRef,
18
+ error,
19
+ isPreviewMode,
20
+ isExpandMode,
21
+ name,
22
+ onChange,
38
23
  placeholder,
39
- spellcheck: true,
40
- inputStyle: 'contenteditable',
41
- });
42
-
43
- CodeMirror.commands.newlineAndIndentContinueMarkdownList = newlineAndIndentContinueMarkdownList;
44
- editorRef.current.on('change', (doc) => {
45
- onChangeRef.current({ target: { name, value: doc.getValue(), type: 'wysiwyg' } });
46
- });
47
- }, [editorRef, textareaRef, name, placeholder]);
48
-
49
- useEffect(() => {
50
- if (value && !editorRef.current.hasFocus()) {
51
- editorRef.current.setValue(value);
52
- }
53
- }, [editorRef, value]);
24
+ textareaRef,
25
+ value,
26
+ },
27
+ forwardedRef
28
+ ) => {
29
+ const onChangeRef = useRef(onChange);
54
30
 
55
- useEffect(() => {
56
- if (isPreviewMode || disabled) {
57
- editorRef.current.setOption('readOnly', 'nocursor');
58
- } else {
59
- editorRef.current.setOption('readOnly', false);
60
- }
61
- }, [disabled, isPreviewMode, editorRef]);
62
-
63
- useEffect(() => {
64
- if (error) {
65
- editorRef.current.setOption('screenReaderLabel', error);
66
- } else {
67
- // to replace with translation
68
- editorRef.current.setOption('screenReaderLabel', 'Editor');
69
- }
70
- }, [editorRef, error]);
71
-
72
- return (
73
- <EditorAndPreviewWrapper>
74
- <EditorStylesContainer isExpandMode={isExpandMode} disabled={disabled || isPreviewMode}>
75
- <textarea ref={textareaRef} />
76
- </EditorStylesContainer>
77
- {isPreviewMode && <PreviewWysiwyg data={value} />}
78
- </EditorAndPreviewWrapper>
79
- );
80
- };
31
+ useEffect(() => {
32
+ editorRef.current = CodeMirror.fromTextArea(textareaRef.current, {
33
+ lineWrapping: true,
34
+ extraKeys: {
35
+ Enter: 'newlineAndIndentContinueMarkdownList',
36
+ Tab: false,
37
+ 'Shift-Tab': false,
38
+ },
39
+ readOnly: false,
40
+ smartIndent: false,
41
+ placeholder,
42
+ spellcheck: true,
43
+ inputStyle: 'contenteditable',
44
+ });
45
+
46
+ CodeMirror.commands.newlineAndIndentContinueMarkdownList =
47
+ newlineAndIndentContinueMarkdownList;
48
+ editorRef.current.on('change', (doc) => {
49
+ onChangeRef.current({ target: { name, value: doc.getValue(), type: 'wysiwyg' } });
50
+ });
51
+ }, [editorRef, textareaRef, name, placeholder]);
52
+
53
+ useEffect(() => {
54
+ if (value && !editorRef.current.hasFocus()) {
55
+ editorRef.current.setValue(value);
56
+ }
57
+ }, [editorRef, value]);
58
+
59
+ useEffect(() => {
60
+ if (isPreviewMode || disabled) {
61
+ editorRef.current.setOption('readOnly', 'nocursor');
62
+ } else {
63
+ editorRef.current.setOption('readOnly', false);
64
+ }
65
+ }, [disabled, isPreviewMode, editorRef]);
66
+
67
+ useEffect(() => {
68
+ if (error) {
69
+ editorRef.current.setOption('screenReaderLabel', error);
70
+ } else {
71
+ // to replace with translation
72
+ editorRef.current.setOption('screenReaderLabel', 'Editor');
73
+ }
74
+ }, [editorRef, error]);
75
+
76
+ useImperativeHandle(
77
+ forwardedRef,
78
+ () => ({
79
+ focus() {
80
+ editorRef.current.getInputField().focus();
81
+ },
82
+ scrollIntoView(args) {
83
+ editorRef.current.getInputField().scrollIntoView(args);
84
+ },
85
+ }),
86
+ [editorRef]
87
+ );
88
+
89
+ return (
90
+ <EditorAndPreviewWrapper>
91
+ <EditorStylesContainer isExpandMode={isExpandMode} disabled={disabled || isPreviewMode}>
92
+ <textarea ref={textareaRef} />
93
+ </EditorStylesContainer>
94
+ {isPreviewMode && <PreviewWysiwyg data={value} />}
95
+ </EditorAndPreviewWrapper>
96
+ );
97
+ }
98
+ );
81
99
 
82
100
  Editor.defaultProps = {
83
101
  disabled: false,
@@ -101,4 +119,350 @@ Editor.propTypes = {
101
119
  value: PropTypes.string,
102
120
  };
103
121
 
122
+ const EditorAndPreviewWrapper = styled.div`
123
+ position: relative;
124
+ height: calc(100% - 48px);
125
+ `;
126
+
127
+ const EditorStylesContainer = styled.div`
128
+ cursor: ${({ disabled }) => (disabled ? 'not-allowed !important' : 'auto')};
129
+ height: 100%;
130
+ /* BASICS */
131
+ .CodeMirror-placeholder {
132
+ color: ${({ theme }) => theme.colors.neutral600} !important;
133
+ }
134
+
135
+ .CodeMirror {
136
+ /* Set height, width, borders, and global font properties here */
137
+ font-size: ${14 / 16}rem;
138
+ height: ${({ isExpandMode }) => (isExpandMode ? '100%' : '290px')};
139
+ color: ${({ theme }) => theme.colors.neutral800};
140
+ direction: ltr;
141
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
142
+ 'Open Sans', 'Helvetica Neue', sans-serif;
143
+ }
144
+
145
+ /* PADDING */
146
+
147
+ .CodeMirror-lines {
148
+ padding: ${({ theme }) => `${theme.spaces[3]} ${theme.spaces[4]}`};
149
+ /* Vertical padding around content */
150
+ }
151
+
152
+ .CodeMirror-scrollbar-filler,
153
+ .CodeMirror-gutter-filler {
154
+ /* The little square between H and V scrollbars */
155
+ background-color: ${({ theme }) => `${theme.colors.neutral0}`};
156
+ }
157
+
158
+ /* GUTTER */
159
+
160
+ .CodeMirror-gutters {
161
+ border-right: 1px solid #ddd;
162
+ background-color: #f7f7f7;
163
+ white-space: nowrap;
164
+ }
165
+ .CodeMirror-linenumbers {
166
+ }
167
+ .CodeMirror-linenumber {
168
+ padding: 0 3px 0 5px;
169
+ min-width: 20px;
170
+ text-align: right;
171
+ color: #999;
172
+ white-space: nowrap;
173
+ }
174
+
175
+ .CodeMirror-guttermarker {
176
+ color: black;
177
+ }
178
+ .CodeMirror-guttermarker-subtle {
179
+ color: #999;
180
+ }
181
+
182
+ /* CURSOR */
183
+
184
+ .CodeMirror-cursor {
185
+ border-left: 1px solid black;
186
+ border-right: none;
187
+ width: 0;
188
+ }
189
+ /* Shown when moving in bi-directional text */
190
+ .CodeMirror div.CodeMirror-secondarycursor {
191
+ border-left: 1px solid silver;
192
+ }
193
+ .cm-fat-cursor .CodeMirror-cursor {
194
+ width: auto;
195
+ border: 0 !important;
196
+ background: #7e7;
197
+ }
198
+ .cm-fat-cursor div.CodeMirror-cursors {
199
+ /* z-index: 1; */
200
+ }
201
+
202
+ .cm-fat-cursor-mark {
203
+ background-color: rgba(20, 255, 20, 0.5);
204
+ -webkit-animation: blink 1.06s steps(1) infinite;
205
+ -moz-animation: blink 1.06s steps(1) infinite;
206
+ animation: blink 1.06s steps(1) infinite;
207
+ }
208
+ .cm-animate-fat-cursor {
209
+ width: auto;
210
+ border: 0;
211
+ -webkit-animation: blink 1.06s steps(1) infinite;
212
+ -moz-animation: blink 1.06s steps(1) infinite;
213
+ animation: blink 1.06s steps(1) infinite;
214
+ background-color: #7e7;
215
+ }
216
+
217
+ /* Can style cursor different in overwrite (non-insert) mode */
218
+ .CodeMirror-overwrite .CodeMirror-cursor {
219
+ }
220
+
221
+ .cm-tab {
222
+ display: inline-block;
223
+ text-decoration: inherit;
224
+ }
225
+
226
+ .CodeMirror-rulers {
227
+ position: absolute;
228
+ left: 0;
229
+ right: 0;
230
+ top: -50px;
231
+ bottom: 0;
232
+ overflow: hidden;
233
+ }
234
+ .CodeMirror-ruler {
235
+ border-left: 1px solid #ccc;
236
+ top: 0;
237
+ bottom: 0;
238
+ position: absolute;
239
+ }
240
+
241
+ /* DEFAULT THEME */
242
+
243
+ .cm-header,
244
+ .cm-strong {
245
+ font-weight: bold;
246
+ }
247
+ .cm-em {
248
+ font-style: italic;
249
+ }
250
+ .cm-link {
251
+ text-decoration: underline;
252
+ }
253
+ .cm-strikethrough {
254
+ text-decoration: line-through;
255
+ }
256
+
257
+ .CodeMirror-composing {
258
+ border-bottom: 2px solid;
259
+ }
260
+
261
+ /* Default styles for common addons */
262
+
263
+ div.CodeMirror span.CodeMirror-matchingbracket {
264
+ color: #0b0;
265
+ }
266
+ div.CodeMirror span.CodeMirror-nonmatchingbracket {
267
+ color: #a22;
268
+ }
269
+ .CodeMirror-matchingtag {
270
+ background: rgba(255, 150, 0, 0.3);
271
+ }
272
+ .CodeMirror-activeline-background {
273
+ background: #e8f2ff;
274
+ }
275
+
276
+ /* STOP */
277
+
278
+ /* The rest of this file contains styles related to the mechanics of
279
+ the editor. You probably shouldn't touch them. */
280
+
281
+ .CodeMirror {
282
+ position: relative;
283
+ overflow: hidden;
284
+ background: ${({ theme }) => `${theme.colors.neutral0}`};
285
+ }
286
+
287
+ .CodeMirror-scroll {
288
+ overflow: scroll !important; /* Things will break if this is overridden */
289
+ /* 50px is the magic margin used to hide the element's real scrollbars */
290
+ /* See overflow: hidden in .CodeMirror */
291
+ margin-bottom: -50px;
292
+ margin-right: -50px;
293
+ padding-bottom: 50px;
294
+ height: 100%;
295
+ outline: none; /* Prevent dragging from highlighting the element */
296
+ position: relative;
297
+ }
298
+ .CodeMirror-sizer {
299
+ position: relative;
300
+ border-right: 50px solid transparent;
301
+ }
302
+
303
+ /* The fake, visible scrollbars. Used to force redraw during scrolling
304
+ before actual scrolling happens, thus preventing shaking and
305
+ flickering artifacts. */
306
+ .CodeMirror-vscrollbar,
307
+ .CodeMirror-hscrollbar,
308
+ .CodeMirror-scrollbar-filler,
309
+ .CodeMirror-gutter-filler {
310
+ position: absolute;
311
+ z-index: 1;
312
+ display: none;
313
+ outline: none;
314
+ }
315
+
316
+ .CodeMirror-vscrollbar {
317
+ right: 0;
318
+ top: 0;
319
+ overflow-x: hidden;
320
+ overflow-y: scroll;
321
+ }
322
+ .CodeMirror-hscrollbar {
323
+ bottom: 0;
324
+ left: 0;
325
+ overflow-y: hidden;
326
+ overflow-x: scroll;
327
+ }
328
+ .CodeMirror-scrollbar-filler {
329
+ right: 0;
330
+ bottom: 0;
331
+ }
332
+
333
+ .CodeMirror-lines {
334
+ cursor: text;
335
+ min-height: 1px; /* prevents collapsing before first draw */
336
+ }
337
+ /* Reset some styles that the rest of the page might have set */
338
+ .CodeMirror pre.CodeMirror-line,
339
+ .CodeMirror pre.CodeMirror-line-like {
340
+ -moz-border-radius: 0;
341
+ -webkit-border-radius: 0;
342
+ border-radius: 0;
343
+ border-width: 0;
344
+ background: transparent;
345
+ font-family: inherit;
346
+ font-size: inherit;
347
+ margin: 0;
348
+ white-space: pre;
349
+ word-wrap: normal;
350
+ line-height: 1.5;
351
+ color: inherit;
352
+ /* z-index: 2; */
353
+ position: relative;
354
+ overflow: visible;
355
+ -webkit-tap-highlight-color: transparent;
356
+ -webkit-font-variant-ligatures: contextual;
357
+ font-variant-ligatures: contextual;
358
+ }
359
+
360
+ .CodeMirror pre.CodeMirror-line-like {
361
+ z-index: 2;
362
+ }
363
+
364
+ .CodeMirror-wrap pre.CodeMirror-line,
365
+ .CodeMirror-wrap pre.CodeMirror-line-like {
366
+ word-wrap: break-word;
367
+ white-space: pre-wrap;
368
+ word-break: normal;
369
+ }
370
+
371
+ .CodeMirror-linebackground {
372
+ position: absolute;
373
+ left: 0;
374
+ right: 0;
375
+ top: 0;
376
+ bottom: 0;
377
+ z-index: 0;
378
+ }
379
+
380
+ .CodeMirror-linewidget {
381
+ position: relative;
382
+ /* z-index: 2; */
383
+ padding: 0.1px; /* Force widget margins to stay inside of the container */
384
+ }
385
+
386
+ .CodeMirror-widget {
387
+ }
388
+
389
+ .CodeMirror-rtl pre {
390
+ direction: rtl;
391
+ }
392
+
393
+ .CodeMirror-code {
394
+ outline: none;
395
+ }
396
+
397
+ /* Force content-box sizing for the elements where we expect it */
398
+ .CodeMirror-scroll,
399
+ .CodeMirror-sizer,
400
+ .CodeMirror-gutter,
401
+ .CodeMirror-gutters,
402
+ .CodeMirror-linenumber {
403
+ -moz-box-sizing: content-box;
404
+ box-sizing: content-box;
405
+ }
406
+
407
+ .CodeMirror-measure {
408
+ position: absolute;
409
+ width: 100%;
410
+ height: 0;
411
+ overflow: hidden;
412
+ visibility: hidden;
413
+ }
414
+
415
+ .CodeMirror-cursor {
416
+ position: absolute;
417
+ pointer-events: none;
418
+ border-color: ${({ theme }) => `${theme.colors.neutral800}`};
419
+ }
420
+ .CodeMirror-measure pre {
421
+ position: static;
422
+ }
423
+
424
+ div.CodeMirror-cursors {
425
+ visibility: hidden;
426
+ position: relative;
427
+ + div {
428
+ z-index: 0 !important;
429
+ }
430
+ }
431
+
432
+ div.CodeMirror-dragcursors {
433
+ visibility: visible;
434
+ }
435
+
436
+ .CodeMirror-focused div.CodeMirror-cursors {
437
+ visibility: visible;
438
+ }
439
+
440
+ .CodeMirror-selected {
441
+ background: ${({ theme }) => theme.colors.neutral200};
442
+ /* z-index: -10; */
443
+ }
444
+ .CodeMirror-crosshair {
445
+ cursor: crosshair;
446
+ }
447
+
448
+ /* Used to force a border model for a node */
449
+ .cm-force-border {
450
+ padding-right: 0.1px;
451
+ }
452
+
453
+ /* See issue #2901 */
454
+ .cm-tab-wrap-hack:after {
455
+ content: '';
456
+ }
457
+
458
+ /* Help users use markselection to safely style text background */
459
+ span.CodeMirror-selectedtext {
460
+ background: none;
461
+ }
462
+
463
+ span {
464
+ color: ${({ theme }) => theme.colors.neutral800} !important;
465
+ }
466
+ `;
467
+
104
468
  export default Editor;
@@ -40,13 +40,6 @@ export const IconButtonGroupMargin = styled(IconButtonGroup)`
40
40
  margin-right: ${({ theme }) => `${theme.spaces[2]}`};
41
41
  `;
42
42
 
43
- // EDITOR && PREVIEW
44
-
45
- export const EditorAndPreviewWrapper = styled.div`
46
- position: relative;
47
- height: calc(100% - 48px);
48
- `;
49
-
50
43
  // FOOTER
51
44
  export const ExpandButton = styled(BaseButton)`
52
45
  background-color: transparent;