@wordpress/editor 12.8.0 → 12.11.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 (198) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/components/editor-help/help-section-title.native.js +43 -0
  3. package/build/components/editor-help/help-section-title.native.js.map +1 -0
  4. package/build/components/editor-help/help-topic-row.native.js +3 -2
  5. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  6. package/build/components/editor-help/icon-move-blocks.native.js +23 -0
  7. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -0
  8. package/build/components/editor-help/index.native.js +10 -11
  9. package/build/components/editor-help/index.native.js.map +1 -1
  10. package/build/components/editor-help/move-blocks.native.js +14 -2
  11. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  12. package/build/components/editor-help/view-sections.native.js +21 -5
  13. package/build/components/editor-help/view-sections.native.js.map +1 -1
  14. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  15. package/build/components/entities-saved-states/index.js.map +1 -1
  16. package/build/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
  17. package/build/components/index.js +12 -1
  18. package/build/components/index.js.map +1 -1
  19. package/build/components/local-autosave-monitor/index.js +24 -19
  20. package/build/components/local-autosave-monitor/index.js.map +1 -1
  21. package/build/components/page-attributes/parent.js +1 -1
  22. package/build/components/page-attributes/parent.js.map +1 -1
  23. package/build/components/post-author/select.js.map +1 -1
  24. package/build/components/post-comments/index.js.map +1 -1
  25. package/build/components/post-format/index.js.map +1 -1
  26. package/build/components/post-last-revision/check.js.map +1 -1
  27. package/build/components/post-last-revision/index.js.map +1 -1
  28. package/build/components/post-pending-status/check.js.map +1 -1
  29. package/build/components/post-pingbacks/index.js.map +1 -1
  30. package/build/components/post-publish-button/index.js +4 -2
  31. package/build/components/post-publish-button/index.js.map +1 -1
  32. package/build/components/post-publish-panel/index.js.map +1 -1
  33. package/build/components/post-publish-panel/maybe-category-panel.js +5 -5
  34. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  35. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  36. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  37. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  38. package/build/components/post-schedule/index.js +11 -18
  39. package/build/components/post-schedule/index.js.map +1 -1
  40. package/build/components/post-schedule/label.js +93 -13
  41. package/build/components/post-schedule/label.js.map +1 -1
  42. package/build/components/post-slug/index.js.map +1 -1
  43. package/build/components/post-sticky/index.js.map +1 -1
  44. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  45. package/build/components/post-taxonomies/flat-term-selector.js +7 -4
  46. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  47. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  48. package/build/components/post-title/index.js.map +1 -1
  49. package/build/components/post-title/index.native.js.map +1 -1
  50. package/build/components/post-trash/check.js.map +1 -1
  51. package/build/components/post-visibility/index.js +10 -11
  52. package/build/components/post-visibility/index.js.map +1 -1
  53. package/build/components/provider/index.js.map +1 -1
  54. package/build/components/provider/index.native.js +0 -1
  55. package/build/components/provider/index.native.js.map +1 -1
  56. package/build/components/provider/use-block-editor-settings.js +3 -1
  57. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  58. package/build/components/template-validation-notice/index.js.map +1 -1
  59. package/build/components/theme-support-check/index.js +1 -1
  60. package/build/components/theme-support-check/index.js.map +1 -1
  61. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  62. package/build/store/actions.js +5 -1
  63. package/build/store/actions.js.map +1 -1
  64. package/build/store/reducer.js +1 -1
  65. package/build/store/reducer.js.map +1 -1
  66. package/build/store/selectors.js +2 -2
  67. package/build/store/selectors.js.map +1 -1
  68. package/build/utils/media-upload/index.js +4 -8
  69. package/build/utils/media-upload/index.js.map +1 -1
  70. package/build-module/components/editor-help/help-section-title.native.js +31 -0
  71. package/build-module/components/editor-help/help-section-title.native.js.map +1 -0
  72. package/build-module/components/editor-help/help-topic-row.native.js +3 -2
  73. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  74. package/build-module/components/editor-help/icon-move-blocks.native.js +13 -0
  75. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -0
  76. package/build-module/components/editor-help/index.native.js +10 -12
  77. package/build-module/components/editor-help/index.native.js.map +1 -1
  78. package/build-module/components/editor-help/move-blocks.native.js +15 -3
  79. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  80. package/build-module/components/editor-help/view-sections.native.js +22 -6
  81. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  82. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  83. package/build-module/components/entities-saved-states/index.js.map +1 -1
  84. package/build-module/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
  85. package/build-module/components/index.js +1 -1
  86. package/build-module/components/index.js.map +1 -1
  87. package/build-module/components/local-autosave-monitor/index.js +24 -18
  88. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  89. package/build-module/components/page-attributes/parent.js +2 -2
  90. package/build-module/components/page-attributes/parent.js.map +1 -1
  91. package/build-module/components/post-author/select.js.map +1 -1
  92. package/build-module/components/post-comments/index.js.map +1 -1
  93. package/build-module/components/post-format/index.js.map +1 -1
  94. package/build-module/components/post-last-revision/check.js.map +1 -1
  95. package/build-module/components/post-last-revision/index.js.map +1 -1
  96. package/build-module/components/post-pending-status/check.js.map +1 -1
  97. package/build-module/components/post-pingbacks/index.js.map +1 -1
  98. package/build-module/components/post-publish-button/index.js +4 -1
  99. package/build-module/components/post-publish-button/index.js.map +1 -1
  100. package/build-module/components/post-publish-panel/index.js.map +1 -1
  101. package/build-module/components/post-publish-panel/maybe-category-panel.js +5 -5
  102. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  103. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  104. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  105. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  106. package/build-module/components/post-schedule/index.js +12 -19
  107. package/build-module/components/post-schedule/index.js.map +1 -1
  108. package/build-module/components/post-schedule/label.js +90 -13
  109. package/build-module/components/post-schedule/label.js.map +1 -1
  110. package/build-module/components/post-slug/index.js.map +1 -1
  111. package/build-module/components/post-sticky/index.js.map +1 -1
  112. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  113. package/build-module/components/post-taxonomies/flat-term-selector.js +7 -4
  114. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  115. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  116. package/build-module/components/post-title/index.js.map +1 -1
  117. package/build-module/components/post-title/index.native.js.map +1 -1
  118. package/build-module/components/post-trash/check.js.map +1 -1
  119. package/build-module/components/post-visibility/index.js +12 -13
  120. package/build-module/components/post-visibility/index.js.map +1 -1
  121. package/build-module/components/provider/index.js.map +1 -1
  122. package/build-module/components/provider/index.native.js +0 -1
  123. package/build-module/components/provider/index.native.js.map +1 -1
  124. package/build-module/components/provider/use-block-editor-settings.js +4 -2
  125. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  126. package/build-module/components/template-validation-notice/index.js.map +1 -1
  127. package/build-module/components/theme-support-check/index.js +2 -2
  128. package/build-module/components/theme-support-check/index.js.map +1 -1
  129. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  130. package/build-module/store/actions.js +5 -1
  131. package/build-module/store/actions.js.map +1 -1
  132. package/build-module/store/reducer.js +2 -2
  133. package/build-module/store/reducer.js.map +1 -1
  134. package/build-module/store/selectors.js +2 -2
  135. package/build-module/store/selectors.js.map +1 -1
  136. package/build-module/utils/media-upload/index.js +3 -5
  137. package/build-module/utils/media-upload/index.js.map +1 -1
  138. package/build-style/style-rtl.css +1 -17
  139. package/build-style/style.css +1 -17
  140. package/package.json +29 -29
  141. package/src/components/editor-help/help-section-title.native.js +29 -0
  142. package/src/components/editor-help/help-topic-row.native.js +2 -2
  143. package/src/components/editor-help/icon-move-blocks.native.js +10 -0
  144. package/src/components/editor-help/images/drag-and-drop-dark.png +0 -0
  145. package/src/components/editor-help/images/drag-and-drop-dark@2x.png +0 -0
  146. package/src/components/editor-help/images/drag-and-drop-dark@3x.png +0 -0
  147. package/src/components/editor-help/images/drag-and-drop-light.png +0 -0
  148. package/src/components/editor-help/images/drag-and-drop-light@2x.png +0 -0
  149. package/src/components/editor-help/images/drag-and-drop-light@3x.png +0 -0
  150. package/src/components/editor-help/index.native.js +26 -28
  151. package/src/components/editor-help/move-blocks.native.js +22 -2
  152. package/src/components/editor-help/style.scss +36 -4
  153. package/src/components/editor-help/view-sections.native.js +23 -8
  154. package/src/components/entities-saved-states/entity-record-item.js +6 -6
  155. package/src/components/entities-saved-states/index.js +6 -9
  156. package/src/components/global-keyboard-shortcuts/save-shortcut.js +2 -3
  157. package/src/components/index.js +4 -1
  158. package/src/components/local-autosave-monitor/index.js +39 -38
  159. package/src/components/page-attributes/parent.js +5 -8
  160. package/src/components/post-author/select.js +2 -3
  161. package/src/components/post-comments/index.js +4 -3
  162. package/src/components/post-format/index.js +2 -3
  163. package/src/components/post-last-revision/check.js +2 -4
  164. package/src/components/post-last-revision/index.js +2 -4
  165. package/src/components/post-pending-status/check.js +2 -5
  166. package/src/components/post-pingbacks/index.js +2 -3
  167. package/src/components/post-publish-button/index.js +7 -8
  168. package/src/components/post-publish-panel/index.js +2 -3
  169. package/src/components/post-publish-panel/maybe-category-panel.js +7 -5
  170. package/src/components/post-publish-panel/maybe-post-format-panel.js +2 -3
  171. package/src/components/post-publish-panel/postpublish.js +2 -5
  172. package/src/components/post-publish-panel/prepublish.js +2 -3
  173. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +1 -1
  174. package/src/components/post-schedule/index.js +6 -13
  175. package/src/components/post-schedule/label.js +111 -17
  176. package/src/components/post-schedule/test/label.js +127 -15
  177. package/src/components/post-slug/index.js +2 -3
  178. package/src/components/post-sticky/index.js +2 -3
  179. package/src/components/post-switch-to-draft-button/index.js +2 -5
  180. package/src/components/post-taxonomies/flat-term-selector.js +9 -12
  181. package/src/components/post-taxonomies/hierarchical-term-selector.js +4 -6
  182. package/src/components/post-title/index.js +21 -31
  183. package/src/components/post-title/index.native.js +10 -16
  184. package/src/components/post-title/style.scss +1 -1
  185. package/src/components/post-trash/check.js +2 -3
  186. package/src/components/post-visibility/index.js +11 -17
  187. package/src/components/post-visibility/style.scss +0 -17
  188. package/src/components/provider/index.js +2 -3
  189. package/src/components/provider/index.native.js +12 -17
  190. package/src/components/provider/use-block-editor-settings.js +4 -8
  191. package/src/components/template-validation-notice/index.js +2 -3
  192. package/src/components/theme-support-check/index.js +2 -2
  193. package/src/hooks/custom-sources-backwards-compatibility.js +45 -44
  194. package/src/store/actions.js +213 -190
  195. package/src/store/reducer.js +2 -2
  196. package/src/store/selectors.js +16 -21
  197. package/src/store/test/selectors.js +13 -16
  198. package/src/utils/media-upload/index.js +2 -5
@@ -169,19 +169,15 @@ class PostTitle extends Component {
169
169
 
170
170
  export default compose(
171
171
  withSelect( ( select ) => {
172
- const { isPostTitleSelected, getEditedPostAttribute } = select(
173
- editorStore
174
- );
175
- const {
176
- getSelectedBlockClientId,
177
- getBlockRootClientId,
178
- getSettings,
179
- } = select( blockEditorStore );
172
+ const { isPostTitleSelected, getEditedPostAttribute } =
173
+ select( editorStore );
174
+ const { getSelectedBlockClientId, getBlockRootClientId, getSettings } =
175
+ select( blockEditorStore );
180
176
 
181
177
  const selectedId = getSelectedBlockClientId();
182
178
  const selectionIsNested = !! getBlockRootClientId( selectedId );
183
- const globalStyles = getSettings()?.__experimentalGlobalStylesBaseStyles
184
- ?.color;
179
+ const globalStyles =
180
+ getSettings()?.__experimentalGlobalStylesBaseStyles?.color;
185
181
 
186
182
  return {
187
183
  postType: getEditedPostAttribute( 'type' ),
@@ -192,13 +188,11 @@ export default compose(
192
188
  };
193
189
  } ),
194
190
  withDispatch( ( dispatch ) => {
195
- const { undo, redo, togglePostTitleSelection } = dispatch(
196
- editorStore
197
- );
191
+ const { undo, redo, togglePostTitleSelection } =
192
+ dispatch( editorStore );
198
193
 
199
- const { clearSelectedBlock, insertDefaultBlock } = dispatch(
200
- blockEditorStore
201
- );
194
+ const { clearSelectedBlock, insertDefaultBlock } =
195
+ dispatch( blockEditorStore );
202
196
 
203
197
  return {
204
198
  onEnterPress() {
@@ -2,7 +2,7 @@
2
2
  position: relative;
3
3
 
4
4
  &.is-focus-mode {
5
- opacity: 0.5;
5
+ opacity: 0.2;
6
6
  transition: opacity 0.1s linear;
7
7
  @include reduce-motion("transition");
8
8
 
@@ -18,9 +18,8 @@ function PostTrashCheck( { isNew, postId, canUserDelete, children } ) {
18
18
  }
19
19
 
20
20
  export default withSelect( ( select ) => {
21
- const { isEditedPostNew, getCurrentPostId, getCurrentPostType } = select(
22
- editorStore
23
- );
21
+ const { isEditedPostNew, getCurrentPostId, getCurrentPostType } =
22
+ select( editorStore );
24
23
  const { getPostType, canUser } = select( coreStore );
25
24
  const postId = getCurrentPostId();
26
25
  const postType = getPostType( getCurrentPostType() );
@@ -6,11 +6,10 @@ import { useState } from '@wordpress/element';
6
6
  import {
7
7
  VisuallyHidden,
8
8
  __experimentalConfirmDialog as ConfirmDialog,
9
- Button,
10
9
  } from '@wordpress/components';
11
10
  import { useInstanceId } from '@wordpress/compose';
12
11
  import { useSelect, useDispatch } from '@wordpress/data';
13
- import { close as closeIcon } from '@wordpress/icons';
12
+ import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';
14
13
 
15
14
  /**
16
15
  * Internal dependencies
@@ -30,9 +29,8 @@ export default function PostVisibility( { onClose } ) {
30
29
  const { editPost, savePost } = useDispatch( editorStore );
31
30
 
32
31
  const [ hasPassword, setHasPassword ] = useState( !! password );
33
- const [ showPrivateConfirmDialog, setShowPrivateConfirmDialog ] = useState(
34
- false
35
- );
32
+ const [ showPrivateConfirmDialog, setShowPrivateConfirmDialog ] =
33
+ useState( false );
36
34
 
37
35
  const setPublic = () => {
38
36
  editPost( {
@@ -70,20 +68,16 @@ export default function PostVisibility( { onClose } ) {
70
68
  };
71
69
 
72
70
  return (
73
- <>
74
- <Button
75
- className="editor-post-visibility__close"
76
- isSmall
77
- icon={ closeIcon }
78
- onClick={ onClose }
71
+ <div className="editor-post-visibility">
72
+ <InspectorPopoverHeader
73
+ title={ __( 'Visibility' ) }
74
+ help={ __( 'Control how this post is viewed.' ) }
75
+ onClose={ onClose }
79
76
  />
80
77
  <fieldset className="editor-post-visibility__fieldset">
81
- <legend className="editor-post-visibility__legend">
78
+ <VisuallyHidden as="legend">
82
79
  { __( 'Visibility' ) }
83
- </legend>
84
- <p className="editor-post-visibility__description">
85
- { __( 'Control how this post is viewed.' ) }
86
- </p>
80
+ </VisuallyHidden>
87
81
  <PostVisibilityChoice
88
82
  instanceId={ instanceId }
89
83
  value="public"
@@ -134,7 +128,7 @@ export default function PostVisibility( { onClose } ) {
134
128
  >
135
129
  { __( 'Would you like to privately publish this post now?' ) }
136
130
  </ConfirmDialog>
137
- </>
131
+ </div>
138
132
  );
139
133
  }
140
134
 
@@ -1,21 +1,4 @@
1
- .editor-post-visibility__close {
2
- position: absolute;
3
- right: $grid-unit-20;
4
- top: $grid-unit-20;
5
- }
6
-
7
1
  .editor-post-visibility__fieldset {
8
- padding: $grid-unit-10;
9
-
10
- .editor-post-visibility__legend {
11
- font-weight: 600;
12
- padding: 1em 0 0 0;
13
- }
14
-
15
- .editor-post-visibility__description {
16
- margin-top: 0.5em;
17
- }
18
-
19
2
  .editor-post-visibility__radio[type="radio"] {
20
3
  @include radio-control;
21
4
  margin-top: 2px;
@@ -34,9 +34,8 @@ function EditorProvider( {
34
34
  return { postId: post.id, postType: post.type };
35
35
  }, [ post.id, post.type ] );
36
36
  const { selection, isReady } = useSelect( ( select ) => {
37
- const { getEditorSelection, __unstableIsEditorReady } = select(
38
- editorStore
39
- );
37
+ const { getEditorSelection, __unstableIsEditorReady } =
38
+ select( editorStore );
40
39
  return {
41
40
  isReady: __unstableIsEditorReady(),
42
41
  selection: getEditorSelection(),
@@ -130,9 +130,8 @@ class NativeEditorProvider extends Component {
130
130
  const blockName = 'core/' + payload.mediaType;
131
131
  const newBlock = createBlock( blockName, {
132
132
  id: payload.mediaId,
133
- [ payload.mediaType === 'image'
134
- ? 'url'
135
- : 'src' ]: payload.mediaUrl,
133
+ [ payload.mediaType === 'image' ? 'url' : 'src' ]:
134
+ payload.mediaUrl,
136
135
  } );
137
136
 
138
137
  const indexAfterSelected = this.props.selectedBlockIndex + 1;
@@ -143,14 +142,16 @@ class NativeEditorProvider extends Component {
143
142
  }
144
143
  );
145
144
 
146
- this.subscriptionParentUpdateEditorSettings = subscribeUpdateEditorSettings(
147
- ( { galleryWithImageBlocks, ...editorSettings } ) => {
148
- if ( typeof galleryWithImageBlocks === 'boolean' ) {
149
- window.wp.galleryBlockV2Enabled = galleryWithImageBlocks;
145
+ this.subscriptionParentUpdateEditorSettings =
146
+ subscribeUpdateEditorSettings(
147
+ ( { galleryWithImageBlocks, ...editorSettings } ) => {
148
+ if ( typeof galleryWithImageBlocks === 'boolean' ) {
149
+ window.wp.galleryBlockV2Enabled =
150
+ galleryWithImageBlocks;
151
+ }
152
+ updateSettings( this.getThemeColors( editorSettings ) );
150
153
  }
151
- updateSettings( this.getThemeColors( editorSettings ) );
152
- }
153
- );
154
+ );
154
155
 
155
156
  this.subscriptionParentUpdateCapabilities = subscribeUpdateCapabilities(
156
157
  ( payload ) => {
@@ -318,13 +319,7 @@ class NativeEditorProvider extends Component {
318
319
  }
319
320
 
320
321
  render() {
321
- const {
322
- children,
323
- post, // eslint-disable-line no-unused-vars
324
- capabilities,
325
- settings,
326
- ...props
327
- } = this.props;
322
+ const { children, post, capabilities, settings, ...props } = this.props;
328
323
  const editorSettings = this.getEditorSettings( settings, capabilities );
329
324
 
330
325
  return (
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { pick, defaultTo, unionBy } from 'lodash';
4
+ import { pick, unionBy } from 'lodash';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -52,10 +52,7 @@ function useBlockEditorSettings( settings, hasTemplate ) {
52
52
  { per_page: -1 }
53
53
  )
54
54
  : [], // Reusable blocks are fetched in the native version of this hook.
55
- hasUploadPermissions: defaultTo(
56
- canUser( 'create', 'media' ),
57
- true
58
- ),
55
+ hasUploadPermissions: canUser( 'create', 'media' ) ?? true,
59
56
  userCanCreatePages: canUser( 'create', 'pages' ),
60
57
  pageOnFront: siteSettings?.page_on_front,
61
58
  };
@@ -71,9 +68,8 @@ function useBlockEditorSettings( settings, hasTemplate ) {
71
68
  const { restBlockPatterns, restBlockPatternCategories } = useSelect(
72
69
  ( select ) => ( {
73
70
  restBlockPatterns: select( coreStore ).getBlockPatterns(),
74
- restBlockPatternCategories: select(
75
- coreStore
76
- ).getBlockPatternCategories(),
71
+ restBlockPatternCategories:
72
+ select( coreStore ).getBlockPatternCategories(),
77
73
  } ),
78
74
  []
79
75
  );
@@ -53,9 +53,8 @@ export default compose( [
53
53
  isValid: select( blockEditorStore ).isValidTemplate(),
54
54
  } ) ),
55
55
  withDispatch( ( dispatch ) => {
56
- const { setTemplateValidity, synchronizeTemplate } = dispatch(
57
- blockEditorStore
58
- );
56
+ const { setTemplateValidity, synchronizeTemplate } =
57
+ dispatch( blockEditorStore );
59
58
  return {
60
59
  resetTemplateValidity: () => setTemplateValidity( true ),
61
60
  synchronizeTemplate,
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { castArray, includes, isArray, get, some } from 'lodash';
4
+ import { castArray, includes, get, some } from 'lodash';
5
5
 
6
6
  /**
7
7
  * WordPress dependencies
@@ -26,7 +26,7 @@ export function ThemeSupportCheck( {
26
26
  // In the latter case, we need to verify `postType` exists
27
27
  // within `supported`. If `postType` isn't passed, then the check
28
28
  // should fail.
29
- if ( 'post-thumbnails' === key && isArray( supported ) ) {
29
+ if ( 'post-thumbnails' === key && Array.isArray( supported ) ) {
30
30
  return includes( supported, postType );
31
31
  }
32
32
  return supported;
@@ -42,55 +42,56 @@ import { store as editorStore } from '../store';
42
42
  */
43
43
  const createWithMetaAttributeSource = ( metaAttributes ) =>
44
44
  createHigherOrderComponent(
45
- ( BlockEdit ) => ( { attributes, setAttributes, ...props } ) => {
46
- const postType = useSelect(
47
- ( select ) => select( editorStore ).getCurrentPostType(),
48
- []
49
- );
50
- const [ meta, setMeta ] = useEntityProp(
51
- 'postType',
52
- postType,
53
- 'meta'
54
- );
45
+ ( BlockEdit ) =>
46
+ ( { attributes, setAttributes, ...props } ) => {
47
+ const postType = useSelect(
48
+ ( select ) => select( editorStore ).getCurrentPostType(),
49
+ []
50
+ );
51
+ const [ meta, setMeta ] = useEntityProp(
52
+ 'postType',
53
+ postType,
54
+ 'meta'
55
+ );
55
56
 
56
- const mergedAttributes = useMemo(
57
- () => ( {
58
- ...attributes,
59
- ...mapValues(
60
- metaAttributes,
61
- ( metaKey ) => meta[ metaKey ]
62
- ),
63
- } ),
64
- [ attributes, meta ]
65
- );
57
+ const mergedAttributes = useMemo(
58
+ () => ( {
59
+ ...attributes,
60
+ ...mapValues(
61
+ metaAttributes,
62
+ ( metaKey ) => meta[ metaKey ]
63
+ ),
64
+ } ),
65
+ [ attributes, meta ]
66
+ );
66
67
 
67
- return (
68
- <BlockEdit
69
- attributes={ mergedAttributes }
70
- setAttributes={ ( nextAttributes ) => {
71
- const nextMeta = mapKeys(
72
- // Filter to intersection of keys between the updated
73
- // attributes and those with an associated meta key.
74
- pickBy(
75
- nextAttributes,
76
- ( value, key ) => metaAttributes[ key ]
77
- ),
68
+ return (
69
+ <BlockEdit
70
+ attributes={ mergedAttributes }
71
+ setAttributes={ ( nextAttributes ) => {
72
+ const nextMeta = mapKeys(
73
+ // Filter to intersection of keys between the updated
74
+ // attributes and those with an associated meta key.
75
+ pickBy(
76
+ nextAttributes,
77
+ ( value, key ) => metaAttributes[ key ]
78
+ ),
78
79
 
79
- // Rename the keys to the expected meta key name.
80
- ( value, attributeKey ) =>
81
- metaAttributes[ attributeKey ]
82
- );
80
+ // Rename the keys to the expected meta key name.
81
+ ( value, attributeKey ) =>
82
+ metaAttributes[ attributeKey ]
83
+ );
83
84
 
84
- if ( ! isEmpty( nextMeta ) ) {
85
- setMeta( nextMeta );
86
- }
85
+ if ( ! isEmpty( nextMeta ) ) {
86
+ setMeta( nextMeta );
87
+ }
87
88
 
88
- setAttributes( nextAttributes );
89
- } }
90
- { ...props }
91
- />
92
- );
93
- },
89
+ setAttributes( nextAttributes );
90
+ } }
91
+ { ...props }
92
+ />
93
+ );
94
+ },
94
95
  'withMetaAttributeSource'
95
96
  );
96
97