@wordpress/editor 14.36.1-next.8b30e05b0.0 → 14.37.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 (100) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +2 -3
  3. package/build/components/autocompleters/user.js.map +2 -2
  4. package/build/components/collab-sidebar/comments.js +4 -12
  5. package/build/components/collab-sidebar/comments.js.map +2 -2
  6. package/build/components/collab-sidebar/hooks.js +7 -19
  7. package/build/components/collab-sidebar/hooks.js.map +2 -2
  8. package/build/components/document-bar/index.js +19 -8
  9. package/build/components/document-bar/index.js.map +3 -3
  10. package/build/components/document-bar/useEditedSectionDetails.js +95 -0
  11. package/build/components/document-bar/useEditedSectionDetails.js.map +7 -0
  12. package/build/components/page-attributes/parent.js +1 -0
  13. package/build/components/page-attributes/parent.js.map +2 -2
  14. package/build/components/post-card-panel/index.js +1 -1
  15. package/build/components/post-card-panel/index.js.map +2 -2
  16. package/build/components/post-publish-panel/maybe-tags-panel.js +1 -1
  17. package/build/components/post-publish-panel/maybe-tags-panel.js.map +2 -2
  18. package/build/components/post-taxonomies/flat-term-selector.js +3 -16
  19. package/build/components/post-taxonomies/flat-term-selector.js.map +3 -3
  20. package/build/components/post-taxonomies/index.js +1 -5
  21. package/build/components/post-taxonomies/index.js.map +2 -2
  22. package/build/components/provider/use-block-editor-settings.js +10 -2
  23. package/build/components/provider/use-block-editor-settings.js.map +2 -2
  24. package/build/components/style-book/index.js +3 -5
  25. package/build/components/style-book/index.js.map +2 -2
  26. package/build/dataviews/store/private-actions.js +9 -1
  27. package/build/dataviews/store/private-actions.js.map +2 -2
  28. package/build/store/utils/notice-builder.js +12 -4
  29. package/build/store/utils/notice-builder.js.map +2 -2
  30. package/build/utils/get-template-part-icon.js +9 -4
  31. package/build/utils/get-template-part-icon.js.map +3 -3
  32. package/build-module/components/autocompleters/user.js.map +2 -2
  33. package/build-module/components/collab-sidebar/comments.js +4 -12
  34. package/build-module/components/collab-sidebar/comments.js.map +2 -2
  35. package/build-module/components/collab-sidebar/hooks.js +7 -20
  36. package/build-module/components/collab-sidebar/hooks.js.map +2 -2
  37. package/build-module/components/document-bar/index.js +20 -9
  38. package/build-module/components/document-bar/index.js.map +2 -2
  39. package/build-module/components/document-bar/useEditedSectionDetails.js +74 -0
  40. package/build-module/components/document-bar/useEditedSectionDetails.js.map +7 -0
  41. package/build-module/components/page-attributes/parent.js +1 -0
  42. package/build-module/components/page-attributes/parent.js.map +2 -2
  43. package/build-module/components/post-card-panel/index.js +1 -1
  44. package/build-module/components/post-card-panel/index.js.map +2 -2
  45. package/build-module/components/post-publish-panel/maybe-tags-panel.js +1 -1
  46. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +2 -2
  47. package/build-module/components/post-taxonomies/flat-term-selector.js +4 -17
  48. package/build-module/components/post-taxonomies/flat-term-selector.js.map +2 -2
  49. package/build-module/components/post-taxonomies/index.js +1 -5
  50. package/build-module/components/post-taxonomies/index.js.map +2 -2
  51. package/build-module/components/provider/use-block-editor-settings.js +10 -2
  52. package/build-module/components/provider/use-block-editor-settings.js.map +2 -2
  53. package/build-module/components/style-book/index.js +3 -5
  54. package/build-module/components/style-book/index.js.map +2 -2
  55. package/build-module/dataviews/store/private-actions.js +11 -2
  56. package/build-module/dataviews/store/private-actions.js.map +2 -2
  57. package/build-module/store/utils/notice-builder.js +12 -4
  58. package/build-module/store/utils/notice-builder.js.map +2 -2
  59. package/build-module/utils/get-template-part-icon.js +10 -4
  60. package/build-module/utils/get-template-part-icon.js.map +2 -2
  61. package/build-style/style-rtl.css +76 -161
  62. package/build-style/style.css +76 -161
  63. package/build-types/components/autocompleters/user.d.ts +8 -2
  64. package/build-types/components/autocompleters/user.d.ts.map +1 -1
  65. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
  66. package/build-types/components/collab-sidebar/hooks.d.ts +0 -1
  67. package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
  68. package/build-types/components/document-bar/index.d.ts.map +1 -1
  69. package/build-types/components/document-bar/useEditedSectionDetails.d.ts +8 -0
  70. package/build-types/components/document-bar/useEditedSectionDetails.d.ts.map +1 -0
  71. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  72. package/build-types/components/post-taxonomies/flat-term-selector.d.ts +3 -5
  73. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  74. package/build-types/components/post-taxonomies/index.d.ts.map +1 -1
  75. package/build-types/components/post-template/hooks.d.ts +1 -1
  76. package/build-types/components/post-template/hooks.d.ts.map +1 -1
  77. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  78. package/build-types/components/style-book/index.d.ts.map +1 -1
  79. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  80. package/build-types/store/utils/notice-builder.d.ts.map +1 -1
  81. package/build-types/utils/get-template-part-icon.d.ts +3 -3
  82. package/build-types/utils/get-template-part-icon.d.ts.map +1 -1
  83. package/package.json +40 -40
  84. package/src/components/autocompleters/user.js +6 -0
  85. package/src/components/collab-sidebar/comments.js +16 -23
  86. package/src/components/collab-sidebar/hooks.js +7 -24
  87. package/src/components/document-bar/index.js +41 -9
  88. package/src/components/document-bar/useEditedSectionDetails.js +103 -0
  89. package/src/components/global-styles-sidebar/style.scss +0 -4
  90. package/src/components/page-attributes/parent.js +2 -1
  91. package/src/components/post-card-panel/index.js +1 -1
  92. package/src/components/post-publish-panel/maybe-tags-panel.js +1 -1
  93. package/src/components/post-taxonomies/flat-term-selector.js +6 -27
  94. package/src/components/post-taxonomies/index.js +1 -7
  95. package/src/components/provider/use-block-editor-settings.js +8 -0
  96. package/src/components/style-book/index.js +3 -5
  97. package/src/dataviews/store/private-actions.ts +16 -0
  98. package/src/store/utils/notice-builder.js +12 -4
  99. package/src/utils/get-template-part-icon.js +19 -6
  100. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"private-actions.d.ts","sourceRoot":"","sources":["../../../src/dataviews/store/private-actions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AA0C1D,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,8BAA8B,CAAC,EAAE,OAAO,CAAC;KACzC;CACD;AAED,wBAAgB,oBAAoB,CAAE,IAAI,EACzC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAE,IAAI,CAAE;;;;;EAQtB;AAED,wBAAgB,sBAAsB,CACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM;;;;;EAQhB;AAED,wBAAgB,mBAAmB,CAAE,IAAI,EACxC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,KAAK,CAAE,IAAI,CAAE;;;;;EAQrB;AAED,wBAAgB,qBAAqB,CACpC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM;;;;;EAQf;AAED,wBAAgB,UAAU,CAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;;;;EAMrD;AAED,eAAO,MAAM,sBAAsB,GAChC,UAAU,MAAM,MACV,cAAc;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,kBAmItC,CAAC"}
1
+ {"version":3,"file":"private-actions.d.ts","sourceRoot":"","sources":["../../../src/dataviews/store/private-actions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AA2C1D,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,8BAA8B,CAAC,EAAE,OAAO,CAAC;KACzC;CACD;AAgBD,wBAAgB,oBAAoB,CAAE,IAAI,EACzC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAE,IAAI,CAAE;;;;;EAQtB;AAED,wBAAgB,sBAAsB,CACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM;;;;;EAQhB;AAED,wBAAgB,mBAAmB,CAAE,IAAI,EACxC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,KAAK,CAAE,IAAI,CAAE;;;;;EAQrB;AAED,wBAAgB,qBAAqB,CACpC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM;;;;;EAQf;AAED,wBAAgB,UAAU,CAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;;;;EAMrD;AAED,eAAO,MAAM,sBAAsB,GAChC,UAAU,MAAM,MACV,cAAc;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,kBAoItC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"notice-builder.d.ts","sourceRoot":"","sources":["../../../src/store/utils/notice-builder.js"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,6DALW,MAAM,SA+DhB;AAED;;;;;;;GAOG;AACH,0DALW,MAAM,SAuDhB;AAED;;;;;;GAMG;AACH,2DAJW,MAAM,SAahB"}
1
+ {"version":3,"file":"notice-builder.d.ts","sourceRoot":"","sources":["../../../src/store/utils/notice-builder.js"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,6DALW,MAAM,SA+DhB;AAED;;;;;;;GAOG;AACH,0DALW,MAAM,SA+DhB;AAED;;;;;;GAMG;AACH,2DAJW,MAAM,SAahB"}
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Helper function to retrieve the corresponding icon by name.
2
+ * Helper function to retrieve the corresponding icon by area name or icon name.
3
3
  *
4
- * @param {string} iconName The name of the icon.
4
+ * @param {string} areaOrIconName The area name (e.g., 'header', 'overlay') or icon name (e.g., 'menu').
5
5
  *
6
6
  * @return {Object} The corresponding icon.
7
7
  */
8
- export function getTemplatePartIcon(iconName: string): Object;
8
+ export function getTemplatePartIcon(areaOrIconName: string): Object;
9
9
  //# sourceMappingURL=get-template-part-icon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-template-part-icon.d.ts","sourceRoot":"","sources":["../../src/utils/get-template-part-icon.js"],"names":[],"mappings":"AASA;;;;;;GAMG;AACH,8CAJW,MAAM,GAEL,MAAM,CAWjB"}
1
+ {"version":3,"file":"get-template-part-icon.d.ts","sourceRoot":"","sources":["../../src/utils/get-template-part-icon.js"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,oDAJW,MAAM,GAEL,MAAM,CAsBjB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/editor",
3
- "version": "14.36.1-next.8b30e05b0.0",
3
+ "version": "14.37.0",
4
4
  "description": "Enhanced block editor for WordPress posts.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -53,44 +53,44 @@
53
53
  ],
54
54
  "dependencies": {
55
55
  "@floating-ui/react-dom": "2.0.8",
56
- "@wordpress/a11y": "^4.36.1-next.8b30e05b0.0",
57
- "@wordpress/api-fetch": "^7.36.1-next.8b30e05b0.0",
58
- "@wordpress/base-styles": "^6.12.1-next.8b30e05b0.0",
59
- "@wordpress/blob": "^4.36.1-next.8b30e05b0.0",
60
- "@wordpress/block-editor": "^15.9.1-next.8b30e05b0.0",
61
- "@wordpress/blocks": "^15.9.1-next.8b30e05b0.0",
62
- "@wordpress/commands": "^1.36.1-next.8b30e05b0.0",
63
- "@wordpress/components": "^30.9.1-next.8b30e05b0.0",
64
- "@wordpress/compose": "^7.36.1-next.8b30e05b0.0",
65
- "@wordpress/core-data": "^7.36.1-next.8b30e05b0.0",
66
- "@wordpress/data": "^10.36.1-next.8b30e05b0.0",
67
- "@wordpress/dataviews": "^11.0.1-next.8b30e05b0.0",
68
- "@wordpress/date": "^5.36.1-next.8b30e05b0.0",
69
- "@wordpress/deprecated": "^4.36.1-next.8b30e05b0.0",
70
- "@wordpress/dom": "^4.36.1-next.8b30e05b0.0",
71
- "@wordpress/element": "^6.36.1-next.8b30e05b0.0",
72
- "@wordpress/fields": "^0.28.1-next.8b30e05b0.0",
73
- "@wordpress/global-styles-engine": "^1.3.1-next.8b30e05b0.0",
74
- "@wordpress/global-styles-ui": "^1.3.1-next.8b30e05b0.0",
75
- "@wordpress/hooks": "^4.36.1-next.8b30e05b0.0",
76
- "@wordpress/html-entities": "^4.36.1-next.8b30e05b0.0",
77
- "@wordpress/i18n": "^6.9.1-next.8b30e05b0.0",
78
- "@wordpress/icons": "^11.3.1-next.8b30e05b0.0",
79
- "@wordpress/interface": "^9.21.1-next.8b30e05b0.0",
80
- "@wordpress/keyboard-shortcuts": "^5.36.1-next.8b30e05b0.0",
81
- "@wordpress/keycodes": "^4.36.1-next.8b30e05b0.0",
82
- "@wordpress/media-utils": "^5.36.1-next.8b30e05b0.0",
83
- "@wordpress/notices": "^5.36.1-next.8b30e05b0.0",
84
- "@wordpress/patterns": "^2.36.1-next.8b30e05b0.0",
85
- "@wordpress/plugins": "^7.36.1-next.8b30e05b0.0",
86
- "@wordpress/preferences": "^4.36.1-next.8b30e05b0.0",
87
- "@wordpress/private-apis": "^1.36.1-next.8b30e05b0.0",
88
- "@wordpress/reusable-blocks": "^5.36.1-next.8b30e05b0.0",
89
- "@wordpress/rich-text": "^7.36.1-next.8b30e05b0.0",
90
- "@wordpress/server-side-render": "^6.12.1-next.8b30e05b0.0",
91
- "@wordpress/url": "^4.36.1-next.8b30e05b0.0",
92
- "@wordpress/warning": "^3.36.1-next.8b30e05b0.0",
93
- "@wordpress/wordcount": "^4.36.1-next.8b30e05b0.0",
56
+ "@wordpress/a11y": "^4.37.0",
57
+ "@wordpress/api-fetch": "^7.37.0",
58
+ "@wordpress/base-styles": "^6.13.0",
59
+ "@wordpress/blob": "^4.37.0",
60
+ "@wordpress/block-editor": "^15.10.0",
61
+ "@wordpress/blocks": "^15.10.0",
62
+ "@wordpress/commands": "^1.37.0",
63
+ "@wordpress/components": "^31.0.0",
64
+ "@wordpress/compose": "^7.37.0",
65
+ "@wordpress/core-data": "^7.37.0",
66
+ "@wordpress/data": "^10.37.0",
67
+ "@wordpress/dataviews": "^11.1.0",
68
+ "@wordpress/date": "^5.37.0",
69
+ "@wordpress/deprecated": "^4.37.0",
70
+ "@wordpress/dom": "^4.37.0",
71
+ "@wordpress/element": "^6.37.0",
72
+ "@wordpress/fields": "^0.29.0",
73
+ "@wordpress/global-styles-engine": "^1.4.0",
74
+ "@wordpress/global-styles-ui": "^1.4.0",
75
+ "@wordpress/hooks": "^4.37.0",
76
+ "@wordpress/html-entities": "^4.37.0",
77
+ "@wordpress/i18n": "^6.10.0",
78
+ "@wordpress/icons": "^11.4.0",
79
+ "@wordpress/interface": "^9.22.0",
80
+ "@wordpress/keyboard-shortcuts": "^5.37.0",
81
+ "@wordpress/keycodes": "^4.37.0",
82
+ "@wordpress/media-utils": "^5.37.0",
83
+ "@wordpress/notices": "^5.37.0",
84
+ "@wordpress/patterns": "^2.37.0",
85
+ "@wordpress/plugins": "^7.37.0",
86
+ "@wordpress/preferences": "^4.37.0",
87
+ "@wordpress/private-apis": "^1.37.0",
88
+ "@wordpress/reusable-blocks": "^5.37.0",
89
+ "@wordpress/rich-text": "^7.37.0",
90
+ "@wordpress/server-side-render": "^6.13.0",
91
+ "@wordpress/url": "^4.37.0",
92
+ "@wordpress/warning": "^3.37.0",
93
+ "@wordpress/wordcount": "^4.37.0",
94
94
  "change-case": "^4.1.2",
95
95
  "client-zip": "^2.4.5",
96
96
  "clsx": "^2.1.1",
@@ -108,5 +108,5 @@
108
108
  "publishConfig": {
109
109
  "access": "public"
110
110
  },
111
- "gitHead": "2466f6bc223f8be98c55e1ac7270e8c3e413eaaf"
111
+ "gitHead": "2cf13ec6cf86153c9b3cf369bf5c59046f5cd950"
112
112
  }
@@ -5,6 +5,12 @@ import { useMemo } from '@wordpress/element';
5
5
  import { useSelect } from '@wordpress/data';
6
6
  import { store as coreStore } from '@wordpress/core-data';
7
7
 
8
+ /**
9
+ * Renders a user label for the autocompleter.
10
+ *
11
+ * @param {Object} user User object.
12
+ * @return {JSX.Element} User label component.
13
+ */
8
14
  export function getUserLabel( user ) {
9
15
  const avatar =
10
16
  user.avatar_urls && user.avatar_urls[ 24 ] ? (
@@ -70,28 +70,22 @@ export function Comments( {
70
70
  useDispatch( blockEditorStore )
71
71
  );
72
72
 
73
- const {
74
- blockCommentId,
75
- selectedBlockClientId,
76
- orderedBlockIds,
77
- blockMode,
78
- } = useSelect( ( select ) => {
79
- const {
80
- getBlockAttributes,
81
- getSelectedBlockClientId,
82
- getClientIdsWithDescendants,
83
- getBlockMode,
84
- } = select( blockEditorStore );
85
- const clientId = getSelectedBlockClientId();
86
- return {
87
- blockCommentId: clientId
88
- ? getBlockAttributes( clientId )?.metadata?.noteId
89
- : null,
90
- selectedBlockClientId: clientId,
91
- orderedBlockIds: getClientIdsWithDescendants(),
92
- blockMode: clientId ? getBlockMode( clientId ) : null,
93
- };
94
- }, [] );
73
+ const { blockCommentId, selectedBlockClientId, orderedBlockIds } =
74
+ useSelect( ( select ) => {
75
+ const {
76
+ getBlockAttributes,
77
+ getSelectedBlockClientId,
78
+ getClientIdsWithDescendants,
79
+ } = select( blockEditorStore );
80
+ const clientId = getSelectedBlockClientId();
81
+ return {
82
+ blockCommentId: clientId
83
+ ? getBlockAttributes( clientId )?.metadata?.noteId
84
+ : null,
85
+ selectedBlockClientId: clientId,
86
+ orderedBlockIds: getClientIdsWithDescendants(),
87
+ };
88
+ }, [] );
95
89
 
96
90
  const relatedBlockElement = useBlockElement( selectedBlockClientId );
97
91
 
@@ -318,7 +312,6 @@ export function Comments( {
318
312
  threads,
319
313
  selectedThread,
320
314
  setCanvasMinHeight,
321
- blockMode,
322
315
  ] );
323
316
 
324
317
  const handleThreadNavigation = ( event, thread, isSelected ) => {
@@ -14,7 +14,6 @@ import { __ } from '@wordpress/i18n';
14
14
  import {
15
15
  useEffect,
16
16
  useMemo,
17
- useRef,
18
17
  useCallback,
19
18
  useReducer,
20
19
  } from '@wordpress/element';
@@ -36,9 +35,7 @@ import { collabSidebarName } from './constants';
36
35
  import { unlock } from '../../lock-unlock';
37
36
  import { noop } from './utils';
38
37
 
39
- const { useBlockElementRef, cleanEmptyObject } = unlock(
40
- blockEditorPrivateApis
41
- );
38
+ const { useBlockElement, cleanEmptyObject } = unlock( blockEditorPrivateApis );
42
39
 
43
40
  export function useBlockComments( postId ) {
44
41
  const [ commentLastUpdated, reflowComments ] = useReducer(
@@ -369,20 +366,7 @@ export function useFloatingThread( {
369
366
  setBlockRef,
370
367
  commentLastUpdated,
371
368
  } ) {
372
- const blockRef = useRef();
373
- useBlockElementRef( thread.blockClientId, blockRef );
374
-
375
- const blockMode = useSelect(
376
- ( select ) => {
377
- return thread.blockClientId
378
- ? select( blockEditorStore ).getBlockMode(
379
- thread.blockClientId
380
- )
381
- : null;
382
- },
383
- [ thread.blockClientId ]
384
- );
385
-
369
+ const blockElement = useBlockElement( thread.blockClientId );
386
370
  const updateHeight = useCallback(
387
371
  ( id, newHeight ) => {
388
372
  setHeights( ( prev ) => {
@@ -408,17 +392,17 @@ export function useFloatingThread( {
408
392
 
409
393
  // Store the block reference for each thread.
410
394
  useEffect( () => {
411
- if ( blockRef.current ) {
412
- refs.setReference( blockRef.current );
395
+ if ( blockElement ) {
396
+ refs.setReference( blockElement );
413
397
  }
414
- }, [ blockRef, refs, commentLastUpdated, blockMode ] );
398
+ }, [ blockElement, refs, commentLastUpdated ] );
415
399
 
416
400
  // Track thread heights.
417
401
  useEffect( () => {
418
402
  if ( refs.floating?.current ) {
419
- setBlockRef( thread.id, blockRef.current );
403
+ setBlockRef( thread.id, blockElement );
420
404
  }
421
- }, [ thread.id, refs.floating, setBlockRef ] );
405
+ }, [ blockElement, thread.id, refs.floating, setBlockRef ] );
422
406
 
423
407
  // When the selected thread changes, update heights, triggering offset recalculation.
424
408
  useEffect( () => {
@@ -435,7 +419,6 @@ export function useFloatingThread( {
435
419
  ] );
436
420
 
437
421
  return {
438
- blockRef,
439
422
  y,
440
423
  refs,
441
424
  };
@@ -14,7 +14,7 @@ import {
14
14
  __unstableMotion as motion,
15
15
  __unstableAnimatePresence as AnimatePresence,
16
16
  } from '@wordpress/components';
17
- import { BlockIcon } from '@wordpress/block-editor';
17
+ import { BlockIcon, store as blockEditorStore } from '@wordpress/block-editor';
18
18
  import { chevronLeftSmall, chevronRightSmall, layout } from '@wordpress/icons';
19
19
  import { displayShortcut } from '@wordpress/keycodes';
20
20
  import { store as coreStore } from '@wordpress/core-data';
@@ -33,6 +33,7 @@ import usePageTypeBadge from '../../utils/pageTypeBadge';
33
33
  import { getTemplateInfo } from '../../utils/get-template-info';
34
34
  import { getStylesCanvasTitle } from '../styles-canvas';
35
35
  import { unlock } from '../../lock-unlock';
36
+ import useEditedSectionDetails from './useEditedSectionDetails';
36
37
 
37
38
  /** @typedef {import("@wordpress/components").IconType} IconType */
38
39
 
@@ -56,6 +57,14 @@ const MotionButton = motion.create( Button );
56
57
  * @return {React.ReactNode} The rendered DocumentBar component.
57
58
  */
58
59
  export default function DocumentBar( props ) {
60
+ // Get action to lock the pattern design
61
+ const { stopEditingContentOnlySection } = unlock(
62
+ useDispatch( blockEditorStore )
63
+ );
64
+
65
+ // Get details about the currently edited content-only section
66
+ const unlockedPatternInfo = useEditedSectionDetails();
67
+
59
68
  const {
60
69
  postId,
61
70
  postType,
@@ -133,11 +142,28 @@ export default function DocumentBar( props ) {
133
142
  const isReducedMotion = useReducedMotion();
134
143
 
135
144
  const isTemplate = TEMPLATE_POST_TYPES.includes( postType );
136
- const hasBackButton = !! onNavigateToPreviousEntityRecord;
145
+ const hasBackButton =
146
+ !! onNavigateToPreviousEntityRecord || !! unlockedPatternInfo;
137
147
  const entityTitle = isTemplate ? templateTitle : documentTitle;
138
- const title = props.title || stylesCanvasTitle || entityTitle;
148
+
149
+ // Use pattern info if a pattern block is unlocked, otherwise use document/entity info
150
+ const title =
151
+ unlockedPatternInfo?.patternTitle ||
152
+ props.title ||
153
+ stylesCanvasTitle ||
154
+ entityTitle;
139
155
  const icon = props.icon;
140
156
 
157
+ // Determine the back button action
158
+ const handleBackClick = ( event ) => {
159
+ event.stopPropagation();
160
+ if ( unlockedPatternInfo ) {
161
+ stopEditingContentOnlySection();
162
+ } else if ( onNavigateToPreviousEntityRecord ) {
163
+ onNavigateToPreviousEntityRecord();
164
+ }
165
+ };
166
+
141
167
  const pageTypeBadge = usePageTypeBadge( postId );
142
168
 
143
169
  const mountedRef = useRef( false );
@@ -156,10 +182,7 @@ export default function DocumentBar( props ) {
156
182
  <MotionButton
157
183
  className="editor-document-bar__back"
158
184
  icon={ isRTL() ? chevronRightSmall : chevronLeftSmall }
159
- onClick={ ( event ) => {
160
- event.stopPropagation();
161
- onNavigateToPreviousEntityRecord();
162
- } }
185
+ onClick={ handleBackClick }
163
186
  size="compact"
164
187
  initial={
165
188
  mountedRef.current
@@ -219,12 +242,21 @@ export default function DocumentBar( props ) {
219
242
  ? stripHTML( title )
220
243
  : __( 'No title' ) }
221
244
  </span>
222
- { pageTypeBadge && (
245
+ { unlockedPatternInfo && (
246
+ <span className="editor-document-bar__post-type-label">
247
+ { unlockedPatternInfo.type ===
248
+ 'template-part'
249
+ ? `· ${ __( 'Template Part' ) }`
250
+ : `· ${ __( 'Pattern' ) }` }
251
+ </span>
252
+ ) }
253
+ { ! unlockedPatternInfo && pageTypeBadge && (
223
254
  <span className="editor-document-bar__post-type-label">
224
255
  { `· ${ pageTypeBadge }` }
225
256
  </span>
226
257
  ) }
227
- { postTypeLabel &&
258
+ { ! unlockedPatternInfo &&
259
+ postTypeLabel &&
228
260
  ! props.title &&
229
261
  ! pageTypeBadge && (
230
262
  <span className="editor-document-bar__post-type-label">
@@ -0,0 +1,103 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useSelect } from '@wordpress/data';
5
+ import { decodeEntities } from '@wordpress/html-entities';
6
+ import { store as blockEditorStore } from '@wordpress/block-editor';
7
+ import { store as coreStore } from '@wordpress/core-data';
8
+
9
+ /**
10
+ * Internal dependencies
11
+ */
12
+ import { unlock } from '../../lock-unlock';
13
+
14
+ /**
15
+ * Hook to get details about the currently edited content-only section.
16
+ * Only returns information when the content only pattern insertion experiment is enabled.
17
+ *
18
+ * @return {Object|null} Object with patternName, patternTitle, and type, or null if no section is being edited or experiment is disabled.
19
+ */
20
+ export default function useEditedSectionDetails() {
21
+ return useSelect( ( select ) => {
22
+ // Only run when the content only pattern insertion experiment is enabled
23
+ if ( ! window?.__experimentalContentOnlyPatternInsertion ) {
24
+ return null;
25
+ }
26
+
27
+ const {
28
+ getBlockAttributes,
29
+ getBlockName,
30
+ __experimentalGetParsedPattern,
31
+ } = select( blockEditorStore );
32
+ const { getEditedEntityRecord, getCurrentTheme } = select( coreStore );
33
+ const { getEditedContentOnlySection } = unlock(
34
+ select( blockEditorStore )
35
+ );
36
+
37
+ // Get the clientId of the unlocked pattern/section
38
+ const editedSectionId = getEditedContentOnlySection();
39
+ if ( ! editedSectionId ) {
40
+ return null;
41
+ }
42
+
43
+ const attributes = getBlockAttributes( editedSectionId );
44
+
45
+ // Handle unsynced patterns (contentOnly patterns with patternName)
46
+ const patternName = attributes?.metadata?.patternName;
47
+ if ( patternName ) {
48
+ // Get pattern details if available
49
+ const pattern =
50
+ typeof __experimentalGetParsedPattern === 'function'
51
+ ? __experimentalGetParsedPattern( patternName )
52
+ : null;
53
+
54
+ return {
55
+ patternName,
56
+ patternTitle: pattern?.title || attributes?.metadata?.name,
57
+ type: 'pattern',
58
+ };
59
+ }
60
+
61
+ const blockName = getBlockName( editedSectionId );
62
+
63
+ // Handle synced patterns (core/block)
64
+ if ( blockName === 'core/block' && !! attributes?.ref ) {
65
+ const entity = getEditedEntityRecord(
66
+ 'postType',
67
+ 'wp_block',
68
+ attributes.ref
69
+ );
70
+ if ( entity?.title ) {
71
+ return {
72
+ patternName: attributes.ref,
73
+ patternTitle: decodeEntities( entity.title ),
74
+ type: 'synced-pattern',
75
+ };
76
+ }
77
+ }
78
+
79
+ // Handle template parts (core/template-part)
80
+ if ( blockName === 'core/template-part' && !! attributes?.slug ) {
81
+ const theme = attributes.theme || getCurrentTheme()?.stylesheet;
82
+ const templatePartId = theme
83
+ ? `${ theme }//${ attributes.slug }`
84
+ : null;
85
+ if ( templatePartId ) {
86
+ const entity = getEditedEntityRecord(
87
+ 'postType',
88
+ 'wp_template_part',
89
+ templatePartId
90
+ );
91
+ if ( entity?.title ) {
92
+ return {
93
+ patternName: attributes.slug,
94
+ patternTitle: decodeEntities( entity.title ),
95
+ type: 'template-part',
96
+ };
97
+ }
98
+ }
99
+ }
100
+
101
+ return null;
102
+ }, [] );
103
+ }
@@ -9,10 +9,6 @@
9
9
  &__panel {
10
10
  flex: 1;
11
11
  }
12
-
13
- .components-navigator-screen {
14
- padding: 0;
15
- }
16
12
  }
17
13
 
18
14
  .editor-global-styles-sidebar .editor-global-styles-sidebar__header-title {
@@ -91,9 +91,10 @@ export function PageAttributesParent() {
91
91
  _fields: 'id,title,parent',
92
92
  };
93
93
 
94
- // Perform a search when the field is changed.
94
+ // Perform a search by relevance when the field is changed.
95
95
  if ( !! fieldValue ) {
96
96
  query.search = fieldValue;
97
+ query.orderby = 'relevance';
97
98
  }
98
99
 
99
100
  const parentPost = pageId
@@ -102,7 +102,7 @@ export default function PostCardPanel( {
102
102
  <HStack
103
103
  spacing={ 2 }
104
104
  className="editor-post-card-panel__header"
105
- align="flex-start"
105
+ alignment="flex-start"
106
106
  >
107
107
  <Icon className="editor-post-card-panel__icon" icon={ icon } />
108
108
  <Text
@@ -40,7 +40,7 @@ const TagsPanel = () => {
40
40
  tagLabel
41
41
  ) }
42
42
  </p>
43
- <FlatTermSelector slug="post_tag" __nextHasNoMarginBottom />
43
+ <FlatTermSelector slug="post_tag" />
44
44
  </PanelBody>
45
45
  );
46
46
  };
@@ -2,14 +2,13 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __, _x, sprintf } from '@wordpress/i18n';
5
- import { Fragment, useEffect, useMemo, useState } from '@wordpress/element';
5
+ import { useEffect, useMemo, useState } from '@wordpress/element';
6
6
  import {
7
7
  FormTokenField,
8
8
  withFilters,
9
9
  __experimentalVStack as VStack,
10
10
  } from '@wordpress/components';
11
11
  import { useSelect, useDispatch } from '@wordpress/data';
12
- import deprecated from '@wordpress/deprecated';
13
12
  import { store as coreStore } from '@wordpress/core-data';
14
13
  import { useDebounce } from '@wordpress/compose';
15
14
  import { speak } from '@wordpress/a11y';
@@ -57,38 +56,19 @@ const termNamesToIds = ( names, terms ) => {
57
56
  .filter( ( id ) => id !== undefined );
58
57
  };
59
58
 
60
- const Wrapper = ( { children, __nextHasNoMarginBottom } ) =>
61
- __nextHasNoMarginBottom ? (
62
- <VStack spacing={ 4 }>{ children }</VStack>
63
- ) : (
64
- <Fragment>{ children }</Fragment>
65
- );
66
-
67
59
  /**
68
60
  * Renders a flat term selector component.
69
61
  *
70
- * @param {Object} props The component props.
71
- * @param {string} props.slug The slug of the taxonomy.
72
- * @param {boolean} props.__nextHasNoMarginBottom Start opting into the new margin-free styles that will become the default in a future version, currently scheduled to be WordPress 7.0. (The prop can be safely removed once this happens.)
62
+ * @param {Object} props The component props.
63
+ * @param {string} props.slug The slug of the taxonomy.
73
64
  *
74
65
  * @return {React.ReactNode} The rendered flat term selector component.
75
66
  */
76
- export function FlatTermSelector( { slug, __nextHasNoMarginBottom } ) {
67
+ export function FlatTermSelector( { slug } ) {
77
68
  const [ values, setValues ] = useState( [] );
78
69
  const [ search, setSearch ] = useState( '' );
79
70
  const debouncedSearch = useDebounce( setSearch, 500 );
80
71
 
81
- if ( ! __nextHasNoMarginBottom ) {
82
- deprecated(
83
- 'Bottom margin styles for wp.editor.PostTaxonomiesFlatTermSelector',
84
- {
85
- since: '6.7',
86
- version: '7.0',
87
- hint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version.',
88
- }
89
- );
90
- }
91
-
92
72
  const {
93
73
  terms,
94
74
  termIds,
@@ -300,7 +280,7 @@ export function FlatTermSelector( { slug, __nextHasNoMarginBottom } ) {
300
280
  );
301
281
 
302
282
  return (
303
- <Wrapper __nextHasNoMarginBottom={ __nextHasNoMarginBottom }>
283
+ <VStack spacing={ 4 }>
304
284
  <FormTokenField
305
285
  __next40pxDefaultSize
306
286
  value={ values }
@@ -314,10 +294,9 @@ export function FlatTermSelector( { slug, __nextHasNoMarginBottom } ) {
314
294
  removed: termRemovedLabel,
315
295
  remove: removeTermLabel,
316
296
  } }
317
- __nextHasNoMarginBottom={ __nextHasNoMarginBottom }
318
297
  />
319
298
  <MostUsedTerms taxonomy={ taxonomy } onSelect={ appendTerm } />
320
- </Wrapper>
299
+ </VStack>
321
300
  );
322
301
  }
323
302
 
@@ -36,17 +36,11 @@ export function PostTaxonomies( { taxonomyWrapper = identity } ) {
36
36
  const TaxonomyComponent = taxonomy.hierarchical
37
37
  ? HierarchicalTermSelector
38
38
  : FlatTermSelector;
39
- const taxonomyComponentProps = {
40
- slug: taxonomy.slug,
41
- ...( taxonomy.hierarchical
42
- ? {}
43
- : { __nextHasNoMarginBottom: true } ),
44
- };
45
39
 
46
40
  return (
47
41
  <Fragment key={ `taxonomy-${ taxonomy.slug }` }>
48
42
  { taxonomyWrapper(
49
- <TaxonomyComponent { ...taxonomyComponentProps } />,
43
+ <TaxonomyComponent slug={ taxonomy.slug } />,
50
44
  taxonomy
51
45
  ) }
52
46
  </Fragment>
@@ -97,6 +97,7 @@ const {
97
97
  sectionRootClientIdKey,
98
98
  mediaEditKey,
99
99
  getMediaSelectKey,
100
+ isIsolatedEditorKey,
100
101
  } = unlock( privateApis );
101
102
 
102
103
  /**
@@ -348,6 +349,13 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
348
349
  renderingMode === 'post-only' && postType !== 'wp_template'
349
350
  ? 'edit'
350
351
  : undefined,
352
+ // When editing template parts, patterns, or navigation directly,
353
+ // we're in an isolated editing context (focused on that entity alone).
354
+ [ isIsolatedEditorKey ]: [
355
+ 'wp_template_part',
356
+ 'wp_block',
357
+ 'wp_navigation',
358
+ ].includes( postType ),
351
359
  };
352
360
 
353
361
  return blockEditorSettings;
@@ -597,12 +597,10 @@ export const StyleBookBody = ( {
597
597
 
598
598
  const handleLoad = () => setHasIframeLoaded( true );
599
599
  useLayoutEffect( () => {
600
- if ( hasIframeLoaded && iframeRef?.current ) {
601
- if ( goTo?.top ) {
602
- scrollToSection( 'top', iframeRef?.current );
603
- }
600
+ if ( hasIframeLoaded && iframeRef.current && goTo?.top ) {
601
+ scrollToSection( 'top', iframeRef.current );
604
602
  }
605
- }, [ iframeRef?.current, goTo, scrollToSection, hasIframeLoaded ] );
603
+ }, [ goTo?.top, hasIframeLoaded ] );
606
604
 
607
605
  return (
608
606
  <Iframe