@wordpress/edit-post 6.0.1 → 6.1.0-next.e230fbab09.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 (171) hide show
  1. package/build/components/block-manager/category.js +2 -2
  2. package/build/components/block-manager/category.js.map +1 -1
  3. package/build/components/block-manager/index.js +2 -2
  4. package/build/components/block-manager/index.js.map +1 -1
  5. package/build/components/header/fullscreen-mode-close/index.js +11 -4
  6. package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
  7. package/build/components/header/header-toolbar/index.js +1 -1
  8. package/build/components/header/header-toolbar/index.js.map +1 -1
  9. package/build/components/header/header-toolbar/index.native.js +1 -1
  10. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  11. package/build/components/header/index.js +3 -1
  12. package/build/components/header/index.js.map +1 -1
  13. package/build/components/header/more-menu/index.js +0 -6
  14. package/build/components/header/more-menu/index.js.map +1 -1
  15. package/build/components/header/template-title/delete-template.js +29 -20
  16. package/build/components/header/template-title/delete-template.js.map +1 -1
  17. package/build/components/header/writing-menu/index.js +7 -7
  18. package/build/components/header/writing-menu/index.js.map +1 -1
  19. package/build/components/keyboard-shortcut-help-modal/config.js +5 -0
  20. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  21. package/build/components/layout/index.js.map +1 -1
  22. package/build/components/layout/index.native.js +1 -1
  23. package/build/components/layout/index.native.js.map +1 -1
  24. package/build/components/preferences-modal/index.js +14 -136
  25. package/build/components/preferences-modal/index.js.map +1 -1
  26. package/build/components/preferences-modal/meta-boxes-section.js +2 -4
  27. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  28. package/build/components/preferences-modal/options/enable-custom-fields.js +2 -8
  29. package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  30. package/build/components/preferences-modal/options/enable-feature.js +2 -4
  31. package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
  32. package/build/components/preferences-modal/options/enable-panel.js +2 -4
  33. package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
  34. package/build/components/preferences-modal/options/enable-publish-sidebar.js +2 -8
  35. package/build/components/preferences-modal/options/enable-publish-sidebar.js.map +1 -1
  36. package/build/components/secondary-sidebar/list-view-sidebar.js +0 -11
  37. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  38. package/build/components/sidebar/post-link/index.js +1 -1
  39. package/build/components/sidebar/post-link/index.js.map +1 -1
  40. package/build/editor.js +4 -3
  41. package/build/editor.js.map +1 -1
  42. package/build/editor.native.js +8 -8
  43. package/build/editor.native.js.map +1 -1
  44. package/build/hooks/validate-multiple-use/index.js +1 -1
  45. package/build/hooks/validate-multiple-use/index.js.map +1 -1
  46. package/build/index.js +5 -4
  47. package/build/index.js.map +1 -1
  48. package/build/plugins/welcome-guide-menu-item/index.js +3 -3
  49. package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
  50. package/build/store/actions.js +173 -113
  51. package/build/store/actions.js.map +1 -1
  52. package/build/store/index.js +0 -3
  53. package/build/store/index.js.map +1 -1
  54. package/build/store/reducer.js +0 -12
  55. package/build/store/reducer.js.map +1 -1
  56. package/build/store/selectors.js +44 -10
  57. package/build/store/selectors.js.map +1 -1
  58. package/build-module/components/block-manager/category.js +2 -2
  59. package/build-module/components/block-manager/category.js.map +1 -1
  60. package/build-module/components/block-manager/index.js +2 -2
  61. package/build-module/components/block-manager/index.js.map +1 -1
  62. package/build-module/components/header/fullscreen-mode-close/index.js +8 -4
  63. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  64. package/build-module/components/header/header-toolbar/index.js +1 -1
  65. package/build-module/components/header/header-toolbar/index.js.map +1 -1
  66. package/build-module/components/header/header-toolbar/index.native.js +1 -1
  67. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  68. package/build-module/components/header/index.js +3 -1
  69. package/build-module/components/header/index.js.map +1 -1
  70. package/build-module/components/header/more-menu/index.js +0 -5
  71. package/build-module/components/header/more-menu/index.js.map +1 -1
  72. package/build-module/components/header/template-title/delete-template.js +32 -22
  73. package/build-module/components/header/template-title/delete-template.js.map +1 -1
  74. package/build-module/components/header/writing-menu/index.js +7 -7
  75. package/build-module/components/header/writing-menu/index.js.map +1 -1
  76. package/build-module/components/keyboard-shortcut-help-modal/config.js +5 -0
  77. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
  78. package/build-module/components/layout/index.js +2 -2
  79. package/build-module/components/layout/index.js.map +1 -1
  80. package/build-module/components/layout/index.native.js +1 -1
  81. package/build-module/components/layout/index.native.js.map +1 -1
  82. package/build-module/components/preferences-modal/index.js +15 -135
  83. package/build-module/components/preferences-modal/index.js.map +1 -1
  84. package/build-module/components/preferences-modal/meta-boxes-section.js +2 -2
  85. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  86. package/build-module/components/preferences-modal/options/enable-custom-fields.js +1 -5
  87. package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  88. package/build-module/components/preferences-modal/options/enable-feature.js +1 -1
  89. package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
  90. package/build-module/components/preferences-modal/options/enable-panel.js +1 -1
  91. package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
  92. package/build-module/components/preferences-modal/options/enable-publish-sidebar.js +1 -5
  93. package/build-module/components/preferences-modal/options/enable-publish-sidebar.js.map +1 -1
  94. package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -12
  95. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  96. package/build-module/components/sidebar/post-link/index.js +2 -2
  97. package/build-module/components/sidebar/post-link/index.js.map +1 -1
  98. package/build-module/editor.js +5 -4
  99. package/build-module/editor.js.map +1 -1
  100. package/build-module/editor.native.js +8 -8
  101. package/build-module/editor.native.js.map +1 -1
  102. package/build-module/hooks/validate-multiple-use/index.js +1 -1
  103. package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
  104. package/build-module/index.js +5 -4
  105. package/build-module/index.js.map +1 -1
  106. package/build-module/plugins/welcome-guide-menu-item/index.js +3 -3
  107. package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
  108. package/build-module/store/actions.js +143 -102
  109. package/build-module/store/actions.js.map +1 -1
  110. package/build-module/store/index.js +0 -2
  111. package/build-module/store/index.js.map +1 -1
  112. package/build-module/store/reducer.js +1 -13
  113. package/build-module/store/reducer.js.map +1 -1
  114. package/build-module/store/selectors.js +36 -6
  115. package/build-module/store/selectors.js.map +1 -1
  116. package/build-style/style-rtl.css +105 -139
  117. package/build-style/style.css +105 -139
  118. package/package.json +30 -25
  119. package/src/components/block-manager/category.js +2 -2
  120. package/src/components/block-manager/index.js +2 -2
  121. package/src/components/header/fullscreen-mode-close/index.js +9 -4
  122. package/src/components/header/fullscreen-mode-close/style.scss +5 -1
  123. package/src/components/header/fullscreen-mode-close/test/index.js +1 -1
  124. package/src/components/header/header-toolbar/index.js +1 -1
  125. package/src/components/header/header-toolbar/index.native.js +1 -1
  126. package/src/components/header/index.js +1 -1
  127. package/src/components/header/more-menu/index.js +0 -6
  128. package/src/components/header/style.scss +1 -1
  129. package/src/components/header/template-title/delete-template.js +57 -46
  130. package/src/components/header/writing-menu/index.js +7 -7
  131. package/src/components/keyboard-shortcut-help-modal/config.js +4 -0
  132. package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +6 -0
  133. package/src/components/layout/index.js +2 -2
  134. package/src/components/layout/index.native.js +1 -1
  135. package/src/components/preferences-modal/index.js +24 -178
  136. package/src/components/preferences-modal/meta-boxes-section.js +3 -3
  137. package/src/components/preferences-modal/options/enable-custom-fields.js +1 -5
  138. package/src/components/preferences-modal/options/enable-feature.js +1 -1
  139. package/src/components/preferences-modal/options/enable-panel.js +1 -1
  140. package/src/components/preferences-modal/options/enable-publish-sidebar.js +1 -5
  141. package/src/components/preferences-modal/options/test/__snapshots__/enable-custom-fields.js.snap +4 -4
  142. package/src/components/preferences-modal/options/test/enable-custom-fields.js +1 -1
  143. package/src/components/preferences-modal/test/__snapshots__/index.js.snap +235 -357
  144. package/src/components/preferences-modal/test/index.js +6 -6
  145. package/src/components/secondary-sidebar/list-view-sidebar.js +1 -11
  146. package/src/components/sidebar/post-link/index.js +2 -2
  147. package/src/editor.js +4 -3
  148. package/src/editor.native.js +7 -7
  149. package/src/hooks/validate-multiple-use/index.js +1 -1
  150. package/src/index.js +5 -4
  151. package/src/plugins/welcome-guide-menu-item/index.js +3 -3
  152. package/src/store/actions.js +129 -149
  153. package/src/store/index.js +0 -2
  154. package/src/store/reducer.js +1 -12
  155. package/src/store/selectors.js +56 -8
  156. package/src/store/test/actions.js +252 -79
  157. package/src/store/test/reducer.js +0 -28
  158. package/src/style.scss +0 -2
  159. package/src/test/editor.native.js +2 -2
  160. package/build/components/preferences-modal/options/base.js +0 -35
  161. package/build/components/preferences-modal/options/base.js.map +0 -1
  162. package/build/components/preferences-modal/section.js +0 -27
  163. package/build/components/preferences-modal/section.js.map +0 -1
  164. package/build-module/components/preferences-modal/options/base.js +0 -27
  165. package/build-module/components/preferences-modal/options/base.js.map +0 -1
  166. package/build-module/components/preferences-modal/section.js +0 -19
  167. package/build-module/components/preferences-modal/section.js.map +0 -1
  168. package/src/components/header/more-menu/style.scss +0 -35
  169. package/src/components/preferences-modal/options/base.js +0 -20
  170. package/src/components/preferences-modal/section.js +0 -15
  171. package/src/components/preferences-modal/style.scss +0 -112
@@ -1,384 +1,262 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
- exports[`PreferencesModal should match snapshot when the modal is active large viewports 1`] = `
4
- <ForwardRef(Modal)
5
- className="edit-post-preferences-modal"
6
- closeLabel="Close"
7
- onRequestClose={[Function]}
8
- title="Preferences"
3
+ exports[`EditPostPreferencesModal should match snapshot when the modal is active large viewports 1`] = `
4
+ <PreferencesModal
5
+ closeModal={[Function]}
9
6
  >
10
- <TabPanel
11
- className="edit-post-preferences__tabs"
12
- onSelect={[Function]}
13
- orientation="vertical"
14
- tabs={
7
+ <PreferencesModalTabs
8
+ sections={
15
9
  Array [
16
10
  Object {
11
+ "content": <React.Fragment>
12
+ <Section
13
+ description="Change options related to publishing."
14
+ title="Publishing"
15
+ >
16
+ <WithSelect(WithDispatch(IfViewportMatches(BaseOption)))
17
+ help="Review settings, such as visibility and tags."
18
+ label="Include pre-publish checklist"
19
+ />
20
+ </Section>
21
+ <Section
22
+ description="Customize options related to the block editor interface and editing flow."
23
+ title="Appearance"
24
+ >
25
+ <WithSelect(WithDispatch(BaseOption))
26
+ featureName="reducedUI"
27
+ help="Compacts options and outlines in the toolbar."
28
+ label="Reduce the interface"
29
+ />
30
+ <WithSelect(WithDispatch(BaseOption))
31
+ featureName="focusMode"
32
+ help="Highlights the current block and fades other content."
33
+ label="Spotlight mode"
34
+ />
35
+ <WithSelect(WithDispatch(BaseOption))
36
+ featureName="showIconLabels"
37
+ help="Shows text instead of icons."
38
+ label="Display button labels"
39
+ />
40
+ <WithSelect(WithDispatch(BaseOption))
41
+ featureName="themeStyles"
42
+ help="Make the editor look like your theme."
43
+ label="Use theme styles"
44
+ />
45
+ <WithSelect(WithDispatch(BaseOption))
46
+ featureName="showBlockBreadcrumbs"
47
+ help="Shows block breadcrumbs at the bottom of the editor."
48
+ label="Display block breadcrumbs"
49
+ />
50
+ </Section>
51
+ </React.Fragment>,
17
52
  "name": "general",
18
- "title": "General",
53
+ "tabLabel": "General",
19
54
  },
20
55
  Object {
56
+ "content": <React.Fragment>
57
+ <Section
58
+ description="Customize how you interact with blocks in the block library and editing canvas."
59
+ title="Block interactions"
60
+ >
61
+ <WithSelect(WithDispatch(BaseOption))
62
+ featureName="mostUsedBlocks"
63
+ help="Places the most frequent blocks in the block library."
64
+ label="Show most used blocks"
65
+ />
66
+ <WithSelect(WithDispatch(BaseOption))
67
+ featureName="keepCaretInsideBlock"
68
+ help="Aids screen readers by stopping text caret from leaving blocks."
69
+ label="Contain text cursor inside block"
70
+ />
71
+ </Section>
72
+ <Section
73
+ description="Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."
74
+ title="Visible blocks"
75
+ >
76
+ <WithSelect(BlockManager) />
77
+ </Section>
78
+ </React.Fragment>,
21
79
  "name": "blocks",
22
- "title": "Blocks",
80
+ "tabLabel": "Blocks",
23
81
  },
24
82
  Object {
83
+ "content": <React.Fragment>
84
+ <Section
85
+ description="Choose what displays in the panel."
86
+ title="Document settings"
87
+ >
88
+ <EnablePluginDocumentSettingPanelOptionSlot />
89
+ <WithSelect(PostTaxonomies)
90
+ taxonomyWrapper={[Function]}
91
+ />
92
+ <PostFeaturedImageCheck>
93
+ <WithSelect(IfCondition(WithDispatch(BaseOption)))
94
+ label="Featured image"
95
+ panelName="featured-image"
96
+ />
97
+ </PostFeaturedImageCheck>
98
+ <PostExcerptCheck>
99
+ <WithSelect(IfCondition(WithDispatch(BaseOption)))
100
+ label="Excerpt"
101
+ panelName="post-excerpt"
102
+ />
103
+ </PostExcerptCheck>
104
+ <WithSelect(PostTypeSupportCheck)
105
+ supportKeys={
106
+ Array [
107
+ "comments",
108
+ "trackbacks",
109
+ ]
110
+ }
111
+ >
112
+ <WithSelect(IfCondition(WithDispatch(BaseOption)))
113
+ label="Discussion"
114
+ panelName="discussion-panel"
115
+ />
116
+ </WithSelect(PostTypeSupportCheck)>
117
+ <PageAttributesCheck>
118
+ <WithSelect(IfCondition(WithDispatch(BaseOption)))
119
+ label="Page attributes"
120
+ panelName="page-attributes"
121
+ />
122
+ </PageAttributesCheck>
123
+ </Section>
124
+ <WithSelect(MetaBoxesSection)
125
+ description="Add extra areas to the editor."
126
+ title="Additional"
127
+ />
128
+ </React.Fragment>,
25
129
  "name": "panels",
26
- "title": "Panels",
130
+ "tabLabel": "Panels",
27
131
  },
28
132
  ]
29
133
  }
30
- >
31
- <Component />
32
- </TabPanel>
33
- </ForwardRef(Modal)>
134
+ />
135
+ </PreferencesModal>
34
136
  `;
35
137
 
36
- exports[`PreferencesModal should match snapshot when the modal is active small viewports 1`] = `
37
- <ForwardRef(Modal)
38
- className="edit-post-preferences-modal"
39
- closeLabel="Close"
40
- onRequestClose={[Function]}
41
- title="Preferences"
138
+ exports[`EditPostPreferencesModal should match snapshot when the modal is active small viewports 1`] = `
139
+ <PreferencesModal
140
+ closeModal={[Function]}
42
141
  >
43
- <NavigatorProvider
44
- initialPath="/"
45
- >
46
- <NavigatorScreen
47
- path="/"
48
- >
49
- <Card
50
- isBorderless={true}
51
- size="small"
52
- >
53
- <CardBody>
54
- <ItemGroup>
55
- <NavigationButton
56
- as={
57
- Object {
58
- "$$typeof": Symbol(react.forward_ref),
59
- "__contextSystemKey__": Array [
60
- "Item",
61
- ],
62
- "render": [Function],
63
- "selector": ".components-item",
64
- }
65
- }
66
- isAction={true}
67
- key="general"
68
- path="general"
142
+ <PreferencesModalTabs
143
+ sections={
144
+ Array [
145
+ Object {
146
+ "content": <React.Fragment>
147
+ <Section
148
+ description="Customize options related to the block editor interface and editing flow."
149
+ title="Appearance"
69
150
  >
70
- <HStack
71
- justify="space-between"
72
- >
73
- <FlexItem>
74
- <Truncate>
75
- General
76
- </Truncate>
77
- </FlexItem>
78
- <FlexItem>
79
- <Icon
80
- icon={
81
- <SVG
82
- viewBox="0 0 24 24"
83
- xmlns="http://www.w3.org/2000/svg"
84
- >
85
- <Path
86
- d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
87
- />
88
- </SVG>
89
- }
90
- />
91
- </FlexItem>
92
- </HStack>
93
- </NavigationButton>
94
- <NavigationButton
95
- as={
96
- Object {
97
- "$$typeof": Symbol(react.forward_ref),
98
- "__contextSystemKey__": Array [
99
- "Item",
100
- ],
101
- "render": [Function],
102
- "selector": ".components-item",
103
- }
104
- }
105
- isAction={true}
106
- key="blocks"
107
- path="blocks"
151
+ <WithSelect(WithDispatch(BaseOption))
152
+ featureName="reducedUI"
153
+ help="Compacts options and outlines in the toolbar."
154
+ label="Reduce the interface"
155
+ />
156
+ <WithSelect(WithDispatch(BaseOption))
157
+ featureName="focusMode"
158
+ help="Highlights the current block and fades other content."
159
+ label="Spotlight mode"
160
+ />
161
+ <WithSelect(WithDispatch(BaseOption))
162
+ featureName="showIconLabels"
163
+ help="Shows text instead of icons."
164
+ label="Display button labels"
165
+ />
166
+ <WithSelect(WithDispatch(BaseOption))
167
+ featureName="themeStyles"
168
+ help="Make the editor look like your theme."
169
+ label="Use theme styles"
170
+ />
171
+ <WithSelect(WithDispatch(BaseOption))
172
+ featureName="showBlockBreadcrumbs"
173
+ help="Shows block breadcrumbs at the bottom of the editor."
174
+ label="Display block breadcrumbs"
175
+ />
176
+ </Section>
177
+ </React.Fragment>,
178
+ "name": "general",
179
+ "tabLabel": "General",
180
+ },
181
+ Object {
182
+ "content": <React.Fragment>
183
+ <Section
184
+ description="Customize how you interact with blocks in the block library and editing canvas."
185
+ title="Block interactions"
108
186
  >
109
- <HStack
110
- justify="space-between"
111
- >
112
- <FlexItem>
113
- <Truncate>
114
- Blocks
115
- </Truncate>
116
- </FlexItem>
117
- <FlexItem>
118
- <Icon
119
- icon={
120
- <SVG
121
- viewBox="0 0 24 24"
122
- xmlns="http://www.w3.org/2000/svg"
123
- >
124
- <Path
125
- d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
126
- />
127
- </SVG>
128
- }
129
- />
130
- </FlexItem>
131
- </HStack>
132
- </NavigationButton>
133
- <NavigationButton
134
- as={
135
- Object {
136
- "$$typeof": Symbol(react.forward_ref),
137
- "__contextSystemKey__": Array [
138
- "Item",
139
- ],
140
- "render": [Function],
141
- "selector": ".components-item",
142
- }
143
- }
144
- isAction={true}
145
- key="panels"
146
- path="panels"
187
+ <WithSelect(WithDispatch(BaseOption))
188
+ featureName="mostUsedBlocks"
189
+ help="Places the most frequent blocks in the block library."
190
+ label="Show most used blocks"
191
+ />
192
+ <WithSelect(WithDispatch(BaseOption))
193
+ featureName="keepCaretInsideBlock"
194
+ help="Aids screen readers by stopping text caret from leaving blocks."
195
+ label="Contain text cursor inside block"
196
+ />
197
+ </Section>
198
+ <Section
199
+ description="Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."
200
+ title="Visible blocks"
147
201
  >
148
- <HStack
149
- justify="space-between"
150
- >
151
- <FlexItem>
152
- <Truncate>
153
- Panels
154
- </Truncate>
155
- </FlexItem>
156
- <FlexItem>
157
- <Icon
158
- icon={
159
- <SVG
160
- viewBox="0 0 24 24"
161
- xmlns="http://www.w3.org/2000/svg"
162
- >
163
- <Path
164
- d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
165
- />
166
- </SVG>
167
- }
168
- />
169
- </FlexItem>
170
- </HStack>
171
- </NavigationButton>
172
- </ItemGroup>
173
- </CardBody>
174
- </Card>
175
- </NavigatorScreen>
176
- <NavigatorScreen
177
- key="general-menu"
178
- path="general"
179
- >
180
- <Card
181
- isBorderless={true}
182
- size="large"
183
- >
184
- <CardHeader
185
- gap="6"
186
- isBorderless={false}
187
- justify="left"
188
- size="small"
189
- >
190
- <NavigationBackButton
191
- aria-label="Navigate to the previous view"
192
- icon={
193
- <SVG
194
- viewBox="0 0 24 24"
195
- xmlns="http://www.w3.org/2000/svg"
196
- >
197
- <Path
198
- d="M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"
202
+ <WithSelect(BlockManager) />
203
+ </Section>
204
+ </React.Fragment>,
205
+ "name": "blocks",
206
+ "tabLabel": "Blocks",
207
+ },
208
+ Object {
209
+ "content": <React.Fragment>
210
+ <Section
211
+ description="Choose what displays in the panel."
212
+ title="Document settings"
213
+ >
214
+ <EnablePluginDocumentSettingPanelOptionSlot />
215
+ <WithSelect(PostTaxonomies)
216
+ taxonomyWrapper={[Function]}
217
+ />
218
+ <PostFeaturedImageCheck>
219
+ <WithSelect(IfCondition(WithDispatch(BaseOption)))
220
+ label="Featured image"
221
+ panelName="featured-image"
199
222
  />
200
- </SVG>
201
- }
202
- />
203
- <Text
204
- size="16"
205
- >
206
- General
207
- </Text>
208
- </CardHeader>
209
- <CardBody>
210
- <Section
211
- description="Customize options related to the block editor interface and editing flow."
212
- title="Appearance"
213
- >
214
- <WithSelect(WithDispatch(BaseOption))
215
- featureName="reducedUI"
216
- help="Compacts options and outlines in the toolbar."
217
- label="Reduce the interface"
218
- />
219
- <WithSelect(WithDispatch(BaseOption))
220
- featureName="focusMode"
221
- help="Highlights the current block and fades other content."
222
- label="Spotlight mode"
223
- />
224
- <WithSelect(WithDispatch(BaseOption))
225
- featureName="showIconLabels"
226
- help="Shows text instead of icons."
227
- label="Display button labels"
228
- />
229
- <WithSelect(WithDispatch(BaseOption))
230
- featureName="themeStyles"
231
- help="Make the editor look like your theme."
232
- label="Use theme styles"
233
- />
234
- <WithSelect(WithDispatch(BaseOption))
235
- featureName="showBlockBreadcrumbs"
236
- help="Shows block breadcrumbs at the bottom of the editor."
237
- label="Display block breadcrumbs"
238
- />
239
- </Section>
240
- </CardBody>
241
- </Card>
242
- </NavigatorScreen>
243
- <NavigatorScreen
244
- key="blocks-menu"
245
- path="blocks"
246
- >
247
- <Card
248
- isBorderless={true}
249
- size="large"
250
- >
251
- <CardHeader
252
- gap="6"
253
- isBorderless={false}
254
- justify="left"
255
- size="small"
256
- >
257
- <NavigationBackButton
258
- aria-label="Navigate to the previous view"
259
- icon={
260
- <SVG
261
- viewBox="0 0 24 24"
262
- xmlns="http://www.w3.org/2000/svg"
263
- >
264
- <Path
265
- d="M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"
223
+ </PostFeaturedImageCheck>
224
+ <PostExcerptCheck>
225
+ <WithSelect(IfCondition(WithDispatch(BaseOption)))
226
+ label="Excerpt"
227
+ panelName="post-excerpt"
266
228
  />
267
- </SVG>
268
- }
269
- />
270
- <Text
271
- size="16"
272
- >
273
- Blocks
274
- </Text>
275
- </CardHeader>
276
- <CardBody>
277
- <Section
278
- description="Customize how you interact with blocks in the block library and editing canvas."
279
- title="Block interactions"
280
- >
281
- <WithSelect(WithDispatch(BaseOption))
282
- featureName="mostUsedBlocks"
283
- help="Places the most frequent blocks in the block library."
284
- label="Show most used blocks"
285
- />
286
- <WithSelect(WithDispatch(BaseOption))
287
- featureName="keepCaretInsideBlock"
288
- help="Aids screen readers by stopping text caret from leaving blocks."
289
- label="Contain text cursor inside block"
290
- />
291
- </Section>
292
- <Section
293
- description="Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."
294
- title="Visible blocks"
295
- >
296
- <WithSelect(BlockManager) />
297
- </Section>
298
- </CardBody>
299
- </Card>
300
- </NavigatorScreen>
301
- <NavigatorScreen
302
- key="panels-menu"
303
- path="panels"
304
- >
305
- <Card
306
- isBorderless={true}
307
- size="large"
308
- >
309
- <CardHeader
310
- gap="6"
311
- isBorderless={false}
312
- justify="left"
313
- size="small"
314
- >
315
- <NavigationBackButton
316
- aria-label="Navigate to the previous view"
317
- icon={
318
- <SVG
319
- viewBox="0 0 24 24"
320
- xmlns="http://www.w3.org/2000/svg"
229
+ </PostExcerptCheck>
230
+ <WithSelect(PostTypeSupportCheck)
231
+ supportKeys={
232
+ Array [
233
+ "comments",
234
+ "trackbacks",
235
+ ]
236
+ }
321
237
  >
322
- <Path
323
- d="M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"
238
+ <WithSelect(IfCondition(WithDispatch(BaseOption)))
239
+ label="Discussion"
240
+ panelName="discussion-panel"
324
241
  />
325
- </SVG>
326
- }
327
- />
328
- <Text
329
- size="16"
330
- >
331
- Panels
332
- </Text>
333
- </CardHeader>
334
- <CardBody>
335
- <Section
336
- description="Choose what displays in the panel."
337
- title="Document settings"
338
- >
339
- <EnablePluginDocumentSettingPanelOptionSlot />
340
- <WithSelect(PostTaxonomies)
341
- taxonomyWrapper={[Function]}
242
+ </WithSelect(PostTypeSupportCheck)>
243
+ <PageAttributesCheck>
244
+ <WithSelect(IfCondition(WithDispatch(BaseOption)))
245
+ label="Page attributes"
246
+ panelName="page-attributes"
247
+ />
248
+ </PageAttributesCheck>
249
+ </Section>
250
+ <WithSelect(MetaBoxesSection)
251
+ description="Add extra areas to the editor."
252
+ title="Additional"
342
253
  />
343
- <PostFeaturedImageCheck>
344
- <WithSelect(IfCondition(WithDispatch(BaseOption)))
345
- label="Featured image"
346
- panelName="featured-image"
347
- />
348
- </PostFeaturedImageCheck>
349
- <PostExcerptCheck>
350
- <WithSelect(IfCondition(WithDispatch(BaseOption)))
351
- label="Excerpt"
352
- panelName="post-excerpt"
353
- />
354
- </PostExcerptCheck>
355
- <WithSelect(PostTypeSupportCheck)
356
- supportKeys={
357
- Array [
358
- "comments",
359
- "trackbacks",
360
- ]
361
- }
362
- >
363
- <WithSelect(IfCondition(WithDispatch(BaseOption)))
364
- label="Discussion"
365
- panelName="discussion-panel"
366
- />
367
- </WithSelect(PostTypeSupportCheck)>
368
- <PageAttributesCheck>
369
- <WithSelect(IfCondition(WithDispatch(BaseOption)))
370
- label="Page attributes"
371
- panelName="page-attributes"
372
- />
373
- </PageAttributesCheck>
374
- </Section>
375
- <WithSelect(MetaBoxesSection)
376
- description="Add extra areas to the editor."
377
- title="Additional"
378
- />
379
- </CardBody>
380
- </Card>
381
- </NavigatorScreen>
382
- </NavigatorProvider>
383
- </ForwardRef(Modal)>
254
+ </React.Fragment>,
255
+ "name": "panels",
256
+ "tabLabel": "Panels",
257
+ },
258
+ ]
259
+ }
260
+ />
261
+ </PreferencesModal>
384
262
  `;
@@ -12,31 +12,31 @@ import { useViewportMatch } from '@wordpress/compose';
12
12
  /**
13
13
  * Internal dependencies
14
14
  */
15
- import PreferencesModal from '../';
15
+ import EditPostPreferencesModal from '../';
16
16
 
17
- // This allows us to tweak the returned value on each test
17
+ // This allows us to tweak the returned value on each test.
18
18
  jest.mock( '@wordpress/data/src/components/use-select', () => jest.fn() );
19
19
  jest.mock( '@wordpress/compose/src/hooks/use-viewport-match', () => jest.fn() );
20
20
 
21
- describe( 'PreferencesModal', () => {
21
+ describe( 'EditPostPreferencesModal', () => {
22
22
  describe( 'should match snapshot when the modal is active', () => {
23
23
  it( 'large viewports', () => {
24
24
  useSelect.mockImplementation( () => ( { isModalActive: true } ) );
25
25
  useViewportMatch.mockImplementation( () => true );
26
- const wrapper = shallow( <PreferencesModal /> );
26
+ const wrapper = shallow( <EditPostPreferencesModal /> );
27
27
  expect( wrapper ).toMatchSnapshot();
28
28
  } );
29
29
  it( 'small viewports', () => {
30
30
  useSelect.mockImplementation( () => ( { isModalActive: true } ) );
31
31
  useViewportMatch.mockImplementation( () => false );
32
- const wrapper = shallow( <PreferencesModal /> );
32
+ const wrapper = shallow( <EditPostPreferencesModal /> );
33
33
  expect( wrapper ).toMatchSnapshot();
34
34
  } );
35
35
  } );
36
36
 
37
37
  it( 'should not render when the modal is not active', () => {
38
38
  useSelect.mockImplementation( () => ( { isModalActive: false } ) );
39
- const wrapper = shallow( <PreferencesModal /> );
39
+ const wrapper = shallow( <EditPostPreferencesModal /> );
40
40
  expect( wrapper.isEmptyRender() ).toBe( true );
41
41
  } );
42
42
  } );