@wordpress/editor 14.0.1 → 14.0.2

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 (54) hide show
  1. package/build/components/document-tools/index.js +12 -3
  2. package/build/components/document-tools/index.js.map +1 -1
  3. package/build/components/entities-saved-states/entity-record-item.js +4 -12
  4. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  5. package/build/components/global-styles-provider/index.js +9 -2
  6. package/build/components/global-styles-provider/index.js.map +1 -1
  7. package/build/components/post-actions/actions.js +1 -1
  8. package/build/components/post-actions/actions.js.map +1 -1
  9. package/build/components/post-trash/index.js +1 -0
  10. package/build/components/post-trash/index.js.map +1 -1
  11. package/build/components/post-visibility/index.js +1 -0
  12. package/build/components/post-visibility/index.js.map +1 -1
  13. package/build/components/template-validation-notice/index.js +1 -0
  14. package/build/components/template-validation-notice/index.js.map +1 -1
  15. package/build/components/visual-editor/edit-template-blocks-notification.js +1 -0
  16. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  17. package/build/hooks/pattern-overrides.js +2 -1
  18. package/build/hooks/pattern-overrides.js.map +1 -1
  19. package/build/lock-unlock.js +1 -1
  20. package/build/lock-unlock.js.map +1 -1
  21. package/build-module/components/document-tools/index.js +12 -3
  22. package/build-module/components/document-tools/index.js.map +1 -1
  23. package/build-module/components/entities-saved-states/entity-record-item.js +6 -14
  24. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  25. package/build-module/components/global-styles-provider/index.js +9 -2
  26. package/build-module/components/global-styles-provider/index.js.map +1 -1
  27. package/build-module/components/post-actions/actions.js +1 -1
  28. package/build-module/components/post-actions/actions.js.map +1 -1
  29. package/build-module/components/post-trash/index.js +1 -0
  30. package/build-module/components/post-trash/index.js.map +1 -1
  31. package/build-module/components/post-visibility/index.js +1 -0
  32. package/build-module/components/post-visibility/index.js.map +1 -1
  33. package/build-module/components/template-validation-notice/index.js +1 -0
  34. package/build-module/components/template-validation-notice/index.js.map +1 -1
  35. package/build-module/components/visual-editor/edit-template-blocks-notification.js +1 -0
  36. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  37. package/build-module/hooks/pattern-overrides.js +2 -1
  38. package/build-module/hooks/pattern-overrides.js.map +1 -1
  39. package/build-module/lock-unlock.js +1 -1
  40. package/build-module/lock-unlock.js.map +1 -1
  41. package/build-style/style-rtl.css +1 -15
  42. package/build-style/style.css +1 -15
  43. package/package.json +18 -18
  44. package/src/components/document-tools/index.js +13 -4
  45. package/src/components/entities-saved-states/entity-record-item.js +4 -14
  46. package/src/components/entities-saved-states/style.scss +0 -13
  47. package/src/components/global-styles-provider/index.js +12 -2
  48. package/src/components/post-actions/actions.js +1 -1
  49. package/src/components/post-trash/index.js +1 -0
  50. package/src/components/post-visibility/index.js +1 -0
  51. package/src/components/template-validation-notice/index.js +1 -0
  52. package/src/components/visual-editor/edit-template-blocks-notification.js +1 -0
  53. package/src/hooks/pattern-overrides.js +2 -0
  54. package/src/lock-unlock.js +1 -1
@@ -1019,19 +1019,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
1019
1019
  margin-bottom: 4px;
1020
1020
  }
1021
1021
 
1022
- .entities-saved-states__post-meta {
1023
- margin-right: 24px;
1024
- align-items: center;
1025
- }
1026
-
1027
- .entities-saved-states__connections-icon {
1028
- flex-grow: 0;
1029
- }
1030
-
1031
- .entities-saved-states__bindings-text {
1032
- flex-grow: 1;
1033
- }
1034
-
1035
1022
  .editor-error-boundary {
1036
1023
  margin: auto;
1037
1024
  max-width: 780px;
@@ -2341,8 +2328,7 @@ textarea.editor-post-text-editor:-ms-input-placeholder {
2341
2328
  padding: 0;
2342
2329
  margin: auto 0;
2343
2330
  width: 12px;
2344
- -webkit-appearance: none;
2345
- appearance: none;
2331
+ appearance: none;
2346
2332
  cursor: ew-resize;
2347
2333
  outline: none;
2348
2334
  background: none;
@@ -1019,19 +1019,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
1019
1019
  margin-bottom: 4px;
1020
1020
  }
1021
1021
 
1022
- .entities-saved-states__post-meta {
1023
- margin-left: 24px;
1024
- align-items: center;
1025
- }
1026
-
1027
- .entities-saved-states__connections-icon {
1028
- flex-grow: 0;
1029
- }
1030
-
1031
- .entities-saved-states__bindings-text {
1032
- flex-grow: 1;
1033
- }
1034
-
1035
1022
  .editor-error-boundary {
1036
1023
  margin: auto;
1037
1024
  max-width: 780px;
@@ -2345,8 +2332,7 @@ textarea.editor-post-text-editor:-ms-input-placeholder {
2345
2332
  padding: 0;
2346
2333
  margin: auto 0;
2347
2334
  width: 12px;
2348
- -webkit-appearance: none;
2349
- appearance: none;
2335
+ appearance: none;
2350
2336
  cursor: ew-resize;
2351
2337
  outline: none;
2352
2338
  background: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/editor",
3
- "version": "14.0.1",
3
+ "version": "14.0.2",
4
4
  "description": "Enhanced block editor for WordPress posts.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -35,13 +35,13 @@
35
35
  "@wordpress/a11y": "^4.0.1",
36
36
  "@wordpress/api-fetch": "^7.0.1",
37
37
  "@wordpress/blob": "^4.0.1",
38
- "@wordpress/block-editor": "^13.0.1",
39
- "@wordpress/blocks": "^13.0.1",
40
- "@wordpress/commands": "^1.0.1",
41
- "@wordpress/components": "^28.0.1",
38
+ "@wordpress/block-editor": "^13.0.2",
39
+ "@wordpress/blocks": "^13.0.2",
40
+ "@wordpress/commands": "^1.0.2",
41
+ "@wordpress/components": "^28.0.2",
42
42
  "@wordpress/compose": "^7.0.1",
43
- "@wordpress/core-data": "^7.0.1",
44
- "@wordpress/data": "^10.0.1",
43
+ "@wordpress/core-data": "^7.0.2",
44
+ "@wordpress/data": "^10.0.2",
45
45
  "@wordpress/date": "^5.0.1",
46
46
  "@wordpress/deprecated": "^4.0.1",
47
47
  "@wordpress/dom": "^4.0.1",
@@ -50,18 +50,18 @@
50
50
  "@wordpress/html-entities": "^4.0.1",
51
51
  "@wordpress/i18n": "^5.0.1",
52
52
  "@wordpress/icons": "^10.0.1",
53
- "@wordpress/interface": "^6.0.1",
54
- "@wordpress/keyboard-shortcuts": "^5.0.1",
53
+ "@wordpress/interface": "^6.0.2",
54
+ "@wordpress/keyboard-shortcuts": "^5.0.2",
55
55
  "@wordpress/keycodes": "^4.0.1",
56
56
  "@wordpress/media-utils": "^5.0.1",
57
- "@wordpress/notices": "^5.0.1",
58
- "@wordpress/patterns": "^2.0.1",
59
- "@wordpress/plugins": "^7.0.1",
60
- "@wordpress/preferences": "^4.0.1",
61
- "@wordpress/private-apis": "^1.0.1",
62
- "@wordpress/reusable-blocks": "^5.0.1",
63
- "@wordpress/rich-text": "^7.0.1",
64
- "@wordpress/server-side-render": "^5.0.1",
57
+ "@wordpress/notices": "^5.0.2",
58
+ "@wordpress/patterns": "^2.0.2",
59
+ "@wordpress/plugins": "^7.0.2",
60
+ "@wordpress/preferences": "^4.0.2",
61
+ "@wordpress/private-apis": "^1.0.2",
62
+ "@wordpress/reusable-blocks": "^5.0.2",
63
+ "@wordpress/rich-text": "^7.0.2",
64
+ "@wordpress/server-side-render": "^5.0.2",
65
65
  "@wordpress/url": "^4.0.1",
66
66
  "@wordpress/warning": "^3.0.1",
67
67
  "@wordpress/wordcount": "^4.0.1",
@@ -83,5 +83,5 @@
83
83
  "publishConfig": {
84
84
  "access": "public"
85
85
  },
86
- "gitHead": "0e973525f7787401b5a544e0727774d52a78639f"
86
+ "gitHead": "a68c6b5ef53956cccf4961d53d79b6af7e00ae60"
87
87
  }
@@ -28,10 +28,6 @@ import { store as editorStore } from '../../store';
28
28
  import EditorHistoryRedo from '../editor-history/redo';
29
29
  import EditorHistoryUndo from '../editor-history/undo';
30
30
 
31
- const preventDefault = ( event ) => {
32
- event.preventDefault();
33
- };
34
-
35
31
  function DocumentTools( { className, disableBlockTools = false } ) {
36
32
  const { setIsInserterOpened, setIsListViewOpened } =
37
33
  useDispatch( editorStore );
@@ -72,6 +68,19 @@ function DocumentTools( { className, disableBlockTools = false } ) {
72
68
  };
73
69
  }, [] );
74
70
 
71
+ const preventDefault = ( event ) => {
72
+ // Because the inserter behaves like a dialog,
73
+ // if the inserter is opened already then when we click on the toggle button
74
+ // then the initial click event will close the inserter and then be propagated
75
+ // to the inserter toggle and it will open it again.
76
+ // To prevent this we need to stop the propagation of the event.
77
+ // This won't be necessary when the inserter no longer behaves like a dialog.
78
+
79
+ if ( isInserterOpened ) {
80
+ event.preventDefault();
81
+ }
82
+ };
83
+
75
84
  const isLargeViewport = useViewportMatch( 'medium' );
76
85
  const isWideViewport = useViewportMatch( 'wide' );
77
86
 
@@ -1,12 +1,11 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { Icon, CheckboxControl, Flex, PanelRow } from '@wordpress/components';
4
+ import { CheckboxControl, PanelRow } from '@wordpress/components';
5
5
  import { __ } from '@wordpress/i18n';
6
6
  import { useSelect } from '@wordpress/data';
7
7
  import { store as coreStore } from '@wordpress/core-data';
8
8
  import { decodeEntities } from '@wordpress/html-entities';
9
- import { connection } from '@wordpress/icons';
10
9
 
11
10
  /**
12
11
  * Internal dependencies
@@ -60,18 +59,9 @@ export default function EntityRecordItem( { record, checked, onChange } ) {
60
59
  />
61
60
  </PanelRow>
62
61
  { hasPostMetaChanges && (
63
- <PanelRow>
64
- <Flex className="entities-saved-states__post-meta">
65
- <Icon
66
- className="entities-saved-states__connections-icon"
67
- icon={ connection }
68
- size={ 24 }
69
- />
70
- <span className="entities-saved-states__bindings-text">
71
- { __( 'Post Meta.' ) }
72
- </span>
73
- </Flex>
74
- </PanelRow>
62
+ <ul className="entities-saved-states__changes">
63
+ <li>{ __( 'Post Meta.' ) }</li>
64
+ </ul>
75
65
  ) }
76
66
  </>
77
67
  );
@@ -30,16 +30,3 @@
30
30
  margin-bottom: $grid-unit-05;
31
31
  }
32
32
  }
33
-
34
- .entities-saved-states__post-meta {
35
- margin-left: $grid-unit-30;
36
- align-items: center;
37
- }
38
-
39
- .entities-saved-states__connections-icon {
40
- flex-grow: 0;
41
- }
42
-
43
- .entities-saved-states__bindings-text {
44
- flex-grow: 1;
45
- }
@@ -163,7 +163,13 @@ function useGlobalStylesUserConfig() {
163
163
  }, [ settings, styles, _links ] );
164
164
 
165
165
  const setConfig = useCallback(
166
- ( callback, options = {} ) => {
166
+ /**
167
+ * Set the global styles config.
168
+ * @param {Function|Object} callbackOrObject If the callbackOrObject is a function, pass the current config to the callback so the consumer can merge values.
169
+ * Otherwise, overwrite the current config with the incoming object.
170
+ * @param {Object} options Options for editEntityRecord Core selector.
171
+ */
172
+ ( callbackOrObject, options = {} ) => {
167
173
  const record = getEditedEntityRecord(
168
174
  'root',
169
175
  'globalStyles',
@@ -175,7 +181,11 @@ function useGlobalStylesUserConfig() {
175
181
  settings: record?.settings ?? {},
176
182
  _links: record?._links ?? {},
177
183
  };
178
- const updatedConfig = callback( currentConfig );
184
+
185
+ const updatedConfig =
186
+ typeof callbackOrObject === 'function'
187
+ ? callbackOrObject( currentConfig )
188
+ : callbackOrObject;
179
189
 
180
190
  editEntityRecord(
181
191
  'root',
@@ -783,7 +783,7 @@ const duplicatePostAction = {
783
783
  sprintf(
784
784
  // translators: %s: Title of the created template e.g: "Category".
785
785
  __( '"%s" successfully created.' ),
786
- newItem.title?.rendered || title
786
+ decodeEntities( newItem.title?.rendered || title )
787
787
  ),
788
788
  {
789
789
  id: 'duplicate-post-action',
@@ -55,6 +55,7 @@ export default function PostTrash() {
55
55
  onConfirm={ handleConfirm }
56
56
  onCancel={ () => setShowConfirmDialog( false ) }
57
57
  confirmButtonText={ __( 'Move to trash' ) }
58
+ size="medium"
58
59
  >
59
60
  { __(
60
61
  'Are you sure you want to move this post to the trash?'
@@ -133,6 +133,7 @@ export default function PostVisibility( { onClose } ) {
133
133
  onConfirm={ confirmPrivate }
134
134
  onCancel={ handleDialogCancel }
135
135
  confirmButtonText={ __( 'Publish' ) }
136
+ size="medium"
136
137
  >
137
138
  { __( 'Would you like to privately publish this post now?' ) }
138
139
  </ConfirmDialog>
@@ -51,6 +51,7 @@ export default function TemplateValidationNotice() {
51
51
  synchronizeTemplate();
52
52
  } }
53
53
  onCancel={ () => setShowConfirmDialog( false ) }
54
+ size="medium"
54
55
  >
55
56
  { __(
56
57
  'Resetting the template may result in loss of content, do you want to continue?'
@@ -80,6 +80,7 @@ export default function EditTemplateBlocksNotification( { contentRef } ) {
80
80
  } );
81
81
  } }
82
82
  onCancel={ () => setIsDialogOpen( false ) }
83
+ size="medium"
83
84
  >
84
85
  { __(
85
86
  'You’ve tried to select a block that is part of a template, which may be used on other posts and pages. Would you like to edit the template?'
@@ -17,6 +17,7 @@ import { unlock } from '../lock-unlock';
17
17
  const {
18
18
  PatternOverridesControls,
19
19
  ResetOverridesControl,
20
+ PatternOverridesBlockControls,
20
21
  PATTERN_TYPES,
21
22
  PARTIAL_SYNCING_SUPPORTED_BLOCKS,
22
23
  PATTERN_SYNC_TYPES,
@@ -43,6 +44,7 @@ const withPatternOverrideControls = createHigherOrderComponent(
43
44
  { props.isSelected && isSupportedBlock && (
44
45
  <ControlsWithStoreSubscription { ...props } />
45
46
  ) }
47
+ { isSupportedBlock && <PatternOverridesBlockControls /> }
46
48
  </>
47
49
  );
48
50
  }
@@ -4,6 +4,6 @@
4
4
  import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';
5
5
  export const { lock, unlock } =
6
6
  __dangerousOptInToUnstableAPIsOnlyForCoreModules(
7
- 'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
7
+ 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',
8
8
  '@wordpress/editor'
9
9
  );