@wordpress/editor 14.27.0 → 14.28.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 (103) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/bindings/api.js +2 -0
  3. package/build/bindings/api.js.map +1 -1
  4. package/build/bindings/pattern-overrides.js +4 -0
  5. package/build/bindings/pattern-overrides.js.map +1 -1
  6. package/build/bindings/post-data.js +141 -0
  7. package/build/bindings/post-data.js.map +1 -0
  8. package/build/bindings/post-meta.js +4 -0
  9. package/build/bindings/post-meta.js.map +1 -1
  10. package/build/components/media-categories/index.js +1 -1
  11. package/build/components/media-categories/index.js.map +1 -1
  12. package/build/components/post-card-panel/index.js +2 -2
  13. package/build/components/post-card-panel/index.js.map +1 -1
  14. package/build/components/post-featured-image/index.js +3 -3
  15. package/build/components/post-featured-image/index.js.map +1 -1
  16. package/build/components/post-taxonomies/flat-term-selector.js +1 -1
  17. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  18. package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -2
  19. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  20. package/build/components/provider/index.native.js +4 -1
  21. package/build/components/provider/index.native.js.map +1 -1
  22. package/build/components/provider/use-block-editor-settings.js +9 -4
  23. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  24. package/build/store/actions.js +0 -15
  25. package/build/store/actions.js.map +1 -1
  26. package/build/store/selectors.js +9 -3
  27. package/build/store/selectors.js.map +1 -1
  28. package/build/utils/media-upload/index.js +1 -1
  29. package/build/utils/media-upload/index.js.map +1 -1
  30. package/build-module/bindings/api.js +2 -0
  31. package/build-module/bindings/api.js.map +1 -1
  32. package/build-module/bindings/pattern-overrides.js +4 -0
  33. package/build-module/bindings/pattern-overrides.js.map +1 -1
  34. package/build-module/bindings/post-data.js +135 -0
  35. package/build-module/bindings/post-data.js.map +1 -0
  36. package/build-module/bindings/post-meta.js +4 -0
  37. package/build-module/bindings/post-meta.js.map +1 -1
  38. package/build-module/components/media-categories/index.js +1 -1
  39. package/build-module/components/media-categories/index.js.map +1 -1
  40. package/build-module/components/post-card-panel/index.js +2 -2
  41. package/build-module/components/post-card-panel/index.js.map +1 -1
  42. package/build-module/components/post-featured-image/index.js +3 -3
  43. package/build-module/components/post-featured-image/index.js.map +1 -1
  44. package/build-module/components/post-taxonomies/flat-term-selector.js +1 -1
  45. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  46. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +2 -2
  47. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  48. package/build-module/components/provider/index.native.js +4 -1
  49. package/build-module/components/provider/index.native.js.map +1 -1
  50. package/build-module/components/provider/use-block-editor-settings.js +9 -4
  51. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  52. package/build-module/store/actions.js +0 -15
  53. package/build-module/store/actions.js.map +1 -1
  54. package/build-module/store/selectors.js +9 -3
  55. package/build-module/store/selectors.js.map +1 -1
  56. package/build-module/utils/media-upload/index.js +1 -1
  57. package/build-module/utils/media-upload/index.js.map +1 -1
  58. package/build-style/style-rtl.css +41 -15
  59. package/build-style/style.css +41 -15
  60. package/build-types/bindings/api.d.ts.map +1 -1
  61. package/build-types/bindings/pattern-overrides.d.ts +6 -6
  62. package/build-types/bindings/pattern-overrides.d.ts.map +1 -1
  63. package/build-types/bindings/post-data.d.ts +24 -0
  64. package/build-types/bindings/post-data.d.ts.map +1 -0
  65. package/build-types/bindings/post-meta.d.ts +7 -7
  66. package/build-types/bindings/post-meta.d.ts.map +1 -1
  67. package/build-types/components/keyboard-shortcut-help-modal/config.d.ts +11 -11
  68. package/build-types/components/media-categories/index.d.ts.map +1 -1
  69. package/build-types/components/post-actions/set-as-homepage.d.ts +1 -1
  70. package/build-types/components/post-actions/set-as-posts-page.d.ts +1 -1
  71. package/build-types/components/post-format/index.d.ts +10 -10
  72. package/build-types/components/post-status/index.d.ts +10 -10
  73. package/build-types/components/post-visibility/utils.d.ts +6 -6
  74. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  75. package/build-types/store/actions.d.ts.map +1 -1
  76. package/build-types/store/selectors.d.ts +6 -2
  77. package/build-types/store/selectors.d.ts.map +1 -1
  78. package/build-types/utils/pageTypeBadge.d.ts +1 -1
  79. package/build-types/utils/pageTypeBadge.d.ts.map +1 -1
  80. package/package.json +37 -37
  81. package/src/bindings/api.js +2 -0
  82. package/src/bindings/pattern-overrides.js +3 -0
  83. package/src/bindings/post-data.js +128 -0
  84. package/src/bindings/post-meta.js +3 -0
  85. package/src/components/collapsible-block-toolbar/style.scss +4 -3
  86. package/src/components/error-boundary/style.scss +1 -1
  87. package/src/components/header/style.scss +1 -0
  88. package/src/components/media-categories/index.js +8 -4
  89. package/src/components/post-card-panel/index.js +3 -3
  90. package/src/components/post-featured-image/index.js +7 -3
  91. package/src/components/post-publish-panel/style.scss +1 -0
  92. package/src/components/post-taxonomies/flat-term-selector.js +1 -1
  93. package/src/components/post-taxonomies/hierarchical-term-selector.js +4 -4
  94. package/src/components/post-taxonomies/test/index.js +6 -6
  95. package/src/components/provider/index.native.js +5 -1
  96. package/src/components/provider/use-block-editor-settings.js +8 -3
  97. package/src/components/sidebar/style.scss +4 -0
  98. package/src/components/text-editor/style.scss +1 -0
  99. package/src/store/actions.js +0 -15
  100. package/src/store/selectors.js +12 -3
  101. package/src/store/test/selectors.js +30 -0
  102. package/src/utils/media-upload/index.js +2 -2
  103. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/store/actions.js"],"names":[],"mappings":"AAyEA;;;;;;;GAOG;AACH,gDAFY,MAAM,CAUjB;AAED;;;;;GAKG;AACH;;EAOC;AAED;;;;;;GAMG;AACH,8BAHY,MAAM,CAWjB;AAED;;;;;;GAMG;AACH,uCAFW,MAAM,UAQhB;AAED;;;;;;;GAOG;AACH,wCAL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;WA8BL;AAKK;;WA+BL;AAOK,uCAFI,MAAM;;;WAyBf;AA2CD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC"}
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/store/actions.js"],"names":[],"mappings":"AAyEA;;;;;;;GAOG;AACH,gDAFY,MAAM,CAUjB;AAED;;;;;GAKG;AACH;;EAOC;AAED;;;;;;GAMG;AACH,8BAHY,MAAM,CAWjB;AAED;;;;;;GAMG;AACH,uCAFW,MAAM,UAQhB;AAED;;;;;;;GAOG;AACH,wCALW,MAAM,UACN,MAAM,GAEL,MAAM,CAQjB;AA6JD;;;;GAIG;AACH;;EAOC;AAqGD;;;;GAIG;AACH;;EAOC;AAED;;;;;GAKG;AACH,qCAHW,MAAM,GACL,MAAM,CAOjB;AAwBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,yCAxCW,MAAM,GAsCL,MAAM,CAOjB;AAED;;;;;;;;;;;;GAYG;AACH,2CAVW,MAAM,GAQL,MAAM,CAOjB;AAED;;;;;;;;;;;;GAYG;AACH,6CAVW,MAAM,GAQL,MAAM,CAOjB;AAED;;;;;;;;;;;;GAYG;AACH,+CAVW,MAAM,GAQL,MAAM,CAOjB;AA6CD;;;EAKC;AAyBD;;;;;;GAMG;AACH,0CAJW,MAAM,GAEL,MAAM,CAOjB;AAiED;;;;;;GAMG;AACH,6CAJW,MAAM,GAEL,MAAM,CAOjB;AAsCD;;;;;GAKG;AACH,4CAHW,OAAO,GACN,MAAM,CAOjB;AAiLD;;;;;GAKG;AACH,sCAFY,MAAM,CAMjB;AAED;;;;;GAKG;AACH,uCAFY,MAAM,CAMjB;AAED;;;;GAIG;AACH,wCAFY,MAAM,CAMjB;AAl8BM,kCAJI,MAAM,SACN,MAAM;;WAkCf;AAkGK,gCAXI,MAAM,YACN,MAAM,GAQL,MAAM,CAShB;AAOK,mCAFI,MAAM;;;;oBA8Hf;AAmBK;;;;oBA0BL;AAWK,iDAFJ;IAA0B,KAAK;CACjC;;;oBAoBC;AAEK;;;mBAkBL;AAKK;;WAIL;AAKK;;WAIL;AAgCK;;WAML;AAKK;;WAML;AAsHK,2DAFI,MAAM;;;;WA8Bf;AAwBK,uCAFI,MAAM;;;;WAef;AAuBK,oDAJI,MAAM,GAEL,MAAM,CA0BhB;AAOK,mDAFI,MAAM;;WAyBf;AAgCK,2CAbI,OAAO,GAAC,MAAM,GAWb,MAAM,CAoBhB;AAuBK,yDAFJ;IAA0B,YAAY;CACxC;;;WAiEC;AAKK;;WA8BL;AAKK;;WA+BL;AAOK,uCAFI,MAAM;;;WAyBf;AA2CD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC;AATD;;WASC"}
@@ -96,10 +96,14 @@ export function getCurrentPostAttribute(state: Object, attributeName: string): a
96
96
  * const getFeaturedMediaUrl = useSelect( ( select ) => {
97
97
  * const getFeaturedMediaId =
98
98
  * select( 'core/editor' ).getEditedPostAttribute( 'featured_media' );
99
- * const getMedia = select( 'core' ).getMedia( getFeaturedMediaId );
99
+ * const media = select( 'core' ).getEntityRecord(
100
+ * 'postType',
101
+ * 'attachment',
102
+ * getFeaturedMediaId
103
+ * );
100
104
  *
101
105
  * return (
102
- * getMedia?.media_details?.sizes?.large?.source_url || getMedia?.source_url || ''
106
+ * media?.media_details?.sizes?.large?.source_url || media?.source_url || ''
103
107
  * );
104
108
  * }, [] );
105
109
  *```
@@ -1 +1 @@
1
- {"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/store/selectors.js"],"names":[],"mappings":"AAgEA;;;;;;;GAOG;AACH,uCAJW,MAAM,GAEL,OAAO,CAIlB;AAED;;;;;;GAMG;AACH,yCAJW,MAAM,GAEL,OAAO,CAKlB;AA+CD;;;;;;;GAOG;AACH,sCAJW,MAAM,GAEL,OAAO,CAIlB;AAgCD;;;;;;;;;;;GAWG;AACH,0CATW,MAAM,GAOL,MAAM,CAIjB;AAED;;;;;;;GAOG;AACH,wCAJW,MAAM,GAEJ,MAAM,OAAA,CAIlB;AAED;;;;;;GAMG;AACH,4CAJW,MAAM,GAEJ,MAAM,OAAA,CAIlB;AAED;;;;;;GAMG;AACH,oDAJW,MAAM,GAEL,MAAM,CAMjB;AAED;;;;;;;GAOG;AACH,oDAJW,MAAM,GAEJ,MAAM,OAAA,CAOlB;AAsBD;;;;;;;GAOG;AACH,+CALW,MAAM,iBACN,MAAM,GAEL,GAAC,CAkBZ;AA8BD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,8CArBW,MAAM,iBACN,MAAM,GAkBL,GAAC,CAsBZ;AA6CD;;;;;;;;GAQG;AACH,+CAJW,MAAM,GAEL,MAAM,CAcjB;AAED;;;;;;GAMG;AACH,4CAJW,MAAM,GAEL,OAAO,CAIlB;AAED;;;;;;;GAOG;AACH,8CALW,MAAM,gBACN,MAAM,GAEL,OAAO,CAYlB;AAED;;;;;;GAMG;AACH,8CAJW,MAAM,GAEL,OAAO,CAOlB;AAED;;;;;;GAMG;AACH,+CAJW,MAAM,GAEL,O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vE;;GAEG;AACH;;;;EAAuE;AAEvE;;GAEG;AACH;;;;EAA2E;AAE3E;;GAEG;AACH;;;;EAEE;AAEF;;GAEG;AACH;;;;EAEE;AAEF;;GAEG;AACH;;;;EAA+E;AAE/E;;GAEG;AACH;;;;EAA6E;AAE7E;;GAEG;AACH;;;;EACgD;AAEhD;;GAEG;AACH;;;;EAAqE;AAErE;;GAEG;AACH;;;;EAA6D;AAE7D;;GAEG;AACH;;;;EAEE;AAEF;;GAEG;AACH;;;;EAEE;AAEF;;GAEG;AACH;;;;EAEE;AAEF;;GAEG;AACH;;;;EAA2E;AAE3E;;GAEG;AACH;;;;EAAmE;AAEnE;;GAEG;AACH;;;;EAA2E;AAE3E;;GAEG;AACH;;;;EACgD;AAEhD;;GAEG;AACH;;;;EAA6E;AAE7E;;GAEG;AACH;;;;EAA6E;AAE7E;;GAEG;AACH;;;;EAEE;AAEF;;;;EAYE;AAEF;;;;;;GAMG;AACH;;;;EAoBE;AAEF;;;;;;;GAOG;AACH;;;;EAsBE;AAEF;;;;;;;GAOG;AACH;;;;EAuBE;AAEF;;;;;;GAMG;AACH;;;;EAQE;;;;;;;;cAtmBY,MAAM;;;;kBACN,MAAM;;;;;YACN,MAAM"}
@@ -3,5 +3,5 @@
3
3
  *
4
4
  * @param {number|string} postId postId of the current post being edited.
5
5
  */
6
- export default function usePageTypeBadge(postId: number | string): false | import("@wordpress/i18n/build-types/types").TranslatableText<"Homepage"> | import("@wordpress/i18n/build-types/types").TranslatableText<"Posts Page">;
6
+ export default function usePageTypeBadge(postId: number | string): false | import("@wordpress/i18n").TranslatableText<"Homepage"> | import("@wordpress/i18n").TranslatableText<"Posts Page">;
7
7
  //# sourceMappingURL=pageTypeBadge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pageTypeBadge.d.ts","sourceRoot":"","sources":["../../src/utils/pageTypeBadge.js"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,iDAFW,MAAM,GAAC,MAAM,iKA2BvB"}
1
+ {"version":3,"file":"pageTypeBadge.d.ts","sourceRoot":"","sources":["../../src/utils/pageTypeBadge.js"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,iDAFW,MAAM,GAAC,MAAM,6HA2BvB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/editor",
3
- "version": "14.27.0",
3
+ "version": "14.28.0",
4
4
  "description": "Enhanced block editor for WordPress posts.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -34,41 +34,41 @@
34
34
  ],
35
35
  "dependencies": {
36
36
  "@babel/runtime": "7.25.7",
37
- "@wordpress/a11y": "^4.27.0",
38
- "@wordpress/api-fetch": "^7.27.0",
39
- "@wordpress/blob": "^4.27.0",
40
- "@wordpress/block-editor": "^15.0.0",
41
- "@wordpress/blocks": "^15.0.0",
42
- "@wordpress/commands": "^1.27.0",
43
- "@wordpress/components": "^30.0.0",
44
- "@wordpress/compose": "^7.27.0",
45
- "@wordpress/core-data": "^7.27.0",
46
- "@wordpress/data": "^10.27.0",
47
- "@wordpress/dataviews": "^5.0.0",
48
- "@wordpress/date": "^5.27.0",
49
- "@wordpress/deprecated": "^4.27.0",
50
- "@wordpress/dom": "^4.27.0",
51
- "@wordpress/element": "^6.27.0",
52
- "@wordpress/fields": "^0.19.0",
53
- "@wordpress/hooks": "^4.27.0",
54
- "@wordpress/html-entities": "^4.27.0",
55
- "@wordpress/i18n": "^6.0.0",
56
- "@wordpress/icons": "^10.27.0",
57
- "@wordpress/interface": "^9.12.0",
58
- "@wordpress/keyboard-shortcuts": "^5.27.0",
59
- "@wordpress/keycodes": "^4.27.0",
60
- "@wordpress/media-utils": "^5.27.0",
61
- "@wordpress/notices": "^5.27.0",
62
- "@wordpress/patterns": "^2.27.0",
63
- "@wordpress/plugins": "^7.27.0",
64
- "@wordpress/preferences": "^4.27.0",
65
- "@wordpress/private-apis": "^1.27.0",
66
- "@wordpress/reusable-blocks": "^5.27.0",
67
- "@wordpress/rich-text": "^7.27.0",
68
- "@wordpress/server-side-render": "^6.3.0",
69
- "@wordpress/url": "^4.27.0",
70
- "@wordpress/warning": "^3.27.0",
71
- "@wordpress/wordcount": "^4.27.0",
37
+ "@wordpress/a11y": "^4.28.0",
38
+ "@wordpress/api-fetch": "^7.28.0",
39
+ "@wordpress/blob": "^4.28.0",
40
+ "@wordpress/block-editor": "^15.1.0",
41
+ "@wordpress/blocks": "^15.1.0",
42
+ "@wordpress/commands": "^1.28.0",
43
+ "@wordpress/components": "^30.1.0",
44
+ "@wordpress/compose": "^7.28.0",
45
+ "@wordpress/core-data": "^7.28.0",
46
+ "@wordpress/data": "^10.28.0",
47
+ "@wordpress/dataviews": "^6.0.0",
48
+ "@wordpress/date": "^5.28.0",
49
+ "@wordpress/deprecated": "^4.28.0",
50
+ "@wordpress/dom": "^4.28.0",
51
+ "@wordpress/element": "^6.28.0",
52
+ "@wordpress/fields": "^0.20.0",
53
+ "@wordpress/hooks": "^4.28.0",
54
+ "@wordpress/html-entities": "^4.28.0",
55
+ "@wordpress/i18n": "^6.1.0",
56
+ "@wordpress/icons": "^10.28.0",
57
+ "@wordpress/interface": "^9.13.0",
58
+ "@wordpress/keyboard-shortcuts": "^5.28.0",
59
+ "@wordpress/keycodes": "^4.28.0",
60
+ "@wordpress/media-utils": "^5.28.0",
61
+ "@wordpress/notices": "^5.28.0",
62
+ "@wordpress/patterns": "^2.28.0",
63
+ "@wordpress/plugins": "^7.28.0",
64
+ "@wordpress/preferences": "^4.28.0",
65
+ "@wordpress/private-apis": "^1.28.0",
66
+ "@wordpress/reusable-blocks": "^5.28.0",
67
+ "@wordpress/rich-text": "^7.28.0",
68
+ "@wordpress/server-side-render": "^6.4.0",
69
+ "@wordpress/url": "^4.28.0",
70
+ "@wordpress/warning": "^3.28.0",
71
+ "@wordpress/wordcount": "^4.28.0",
72
72
  "change-case": "^4.1.2",
73
73
  "client-zip": "^2.4.5",
74
74
  "clsx": "^2.1.1",
@@ -88,5 +88,5 @@
88
88
  "publishConfig": {
89
89
  "access": "public"
90
90
  },
91
- "gitHead": "abe06a6f2aef8d03c30ea9d5b3e133f041e523b1"
91
+ "gitHead": "28cc2098f5ee28f89096b638533796538f495f72"
92
92
  }
@@ -7,6 +7,7 @@ import { registerBlockBindingsSource } from '@wordpress/blocks';
7
7
  * Internal dependencies
8
8
  */
9
9
  import patternOverrides from './pattern-overrides';
10
+ import postData from './post-data';
10
11
  import postMeta from './post-meta';
11
12
 
12
13
  /**
@@ -21,5 +22,6 @@ import postMeta from './post-meta';
21
22
  */
22
23
  export function registerCoreBlockBindingsSources() {
23
24
  registerBlockBindingsSource( patternOverrides );
25
+ registerBlockBindingsSource( postData );
24
26
  registerBlockBindingsSource( postMeta );
25
27
  }
@@ -5,6 +5,9 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
5
5
 
6
6
  const CONTENT = 'content';
7
7
 
8
+ /**
9
+ * @type {WPBlockBindingsSource}
10
+ */
8
11
  export default {
9
12
  name: 'core/pattern-overrides',
10
13
  getValues( { select, clientId, context, bindings } ) {
@@ -0,0 +1,128 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { store as coreDataStore } from '@wordpress/core-data';
6
+
7
+ /**
8
+ * Gets a list of post data fields with their values and labels
9
+ * to be consumed in the needed callbacks.
10
+ * If the value is not available based on context, like in templates,
11
+ * it falls back to the default value, label, or key.
12
+ *
13
+ * @param {Object} select The select function from the data store.
14
+ * @param {Object} context The context provided.
15
+ * @return {Object} List of post data fields with their value and label.
16
+ *
17
+ * @example
18
+ * ```js
19
+ * {
20
+ * field_1_key: {
21
+ * label: 'Field 1 Label',
22
+ * value: 'Field 1 Value',
23
+ * },
24
+ * field_2_key: {
25
+ * label: 'Field 2 Label',
26
+ * value: 'Field 2 Value',
27
+ * },
28
+ * ...
29
+ * }
30
+ * ```
31
+ */
32
+ function getPostDataFields( select, context ) {
33
+ const { getEditedEntityRecord } = select( coreDataStore );
34
+
35
+ let entityDataValues, dataFields;
36
+ // Try to get the current entity data values.
37
+ if ( context?.postType && context?.postId ) {
38
+ entityDataValues = getEditedEntityRecord(
39
+ 'postType',
40
+ context?.postType,
41
+ context?.postId
42
+ );
43
+ dataFields = {
44
+ date: {
45
+ label: __( 'Post Date' ),
46
+ value: entityDataValues?.date,
47
+ type: 'string',
48
+ },
49
+ modified: {
50
+ label: __( 'Post Modified Date' ),
51
+ value: entityDataValues?.modified,
52
+ type: 'string',
53
+ },
54
+ };
55
+ }
56
+
57
+ if ( ! Object.keys( dataFields || {} ).length ) {
58
+ return null;
59
+ }
60
+
61
+ return dataFields;
62
+ }
63
+
64
+ /**
65
+ * @type {WPBlockBindingsSource}
66
+ */
67
+ export default {
68
+ name: 'core/post-data',
69
+ getValues( { select, context, bindings } ) {
70
+ const dataFields = getPostDataFields( select, context );
71
+
72
+ const newValues = {};
73
+ for ( const [ attributeName, source ] of Object.entries( bindings ) ) {
74
+ // Use the value, the field label, or the field key.
75
+ const fieldKey = source.args.key;
76
+ const { value: fieldValue, label: fieldLabel } =
77
+ dataFields?.[ fieldKey ] || {};
78
+ newValues[ attributeName ] = fieldValue ?? fieldLabel ?? fieldKey;
79
+ }
80
+ return newValues;
81
+ },
82
+ setValues( { dispatch, context, bindings } ) {
83
+ const newData = {};
84
+ Object.values( bindings ).forEach( ( { args, newValue } ) => {
85
+ newData[ args.key ] = newValue;
86
+ } );
87
+
88
+ dispatch( coreDataStore ).editEntityRecord(
89
+ 'postType',
90
+ context?.postType,
91
+ context?.postId,
92
+ newData
93
+ );
94
+ },
95
+ canUserEditValue( { select, context, args } ) {
96
+ // Lock editing in query loop.
97
+ if ( context?.query || context?.queryId ) {
98
+ return false;
99
+ }
100
+
101
+ // Lock editing when `postType` is not defined.
102
+ if ( ! context?.postType ) {
103
+ return false;
104
+ }
105
+
106
+ const fieldValue = getPostDataFields( select, context )?.[ args.key ]
107
+ ?.value;
108
+ // Empty string or `false` could be a valid value, so we need to check if the field value is undefined.
109
+ if ( fieldValue === undefined ) {
110
+ return false;
111
+ }
112
+
113
+ // Check that the user has the capability to edit post data.
114
+ const canUserEdit = select( coreDataStore ).canUser( 'update', {
115
+ kind: 'postType',
116
+ name: context?.postType,
117
+ id: context?.postId,
118
+ } );
119
+ if ( ! canUserEdit ) {
120
+ return false;
121
+ }
122
+
123
+ return true;
124
+ },
125
+ getFieldsList( { select, context } ) {
126
+ return getPostDataFields( select, context );
127
+ },
128
+ };
@@ -72,6 +72,9 @@ function getPostMetaFields( select, context ) {
72
72
  return metaFields;
73
73
  }
74
74
 
75
+ /**
76
+ * @type {WPBlockBindingsSource}
77
+ */
75
78
  export default {
76
79
  name: 'core/post-meta',
77
80
  getValues( { select, context, bindings } ) {
@@ -14,7 +14,7 @@
14
14
  .block-editor-block-toolbar {
15
15
  height: 100%;
16
16
  // Push down so that buttons are centered vertically.
17
- // It should be 14px (60px header height - 32px compact button height = 28 / 2),
17
+ // It should be 16px (64px header height - 32px compact button height = 32 / 2),
18
18
  // but there is a -1px top-margin down the stack that affects this.
19
19
  padding-top: math.div($header-height - $button-size-compact, 2) + 1;
20
20
 
@@ -62,12 +62,13 @@
62
62
  overflow: visible;
63
63
  }
64
64
 
65
- // Move up a little to prevent the toolbar shift when focus is on the vertical movers.
65
+ // Reduce height and move up a little to prevent the toolbar
66
+ // shift when focus is on the vertical movers.
66
67
  @include break-small() {
67
68
  &:not(.is-horizontal) .block-editor-block-mover__move-button-container {
68
69
  height: $grid-unit-50;
69
70
  position: relative;
70
- top: -5px; // Should be -4px, but that causes scrolling when focus lands on the movers, in a 60px header.
71
+ top: #{$grid-unit-05 * -1};
71
72
  }
72
73
  }
73
74
  }
@@ -3,7 +3,7 @@
3
3
  margin: auto;
4
4
  max-width: 780px;
5
5
  padding: 1em;
6
- margin-top: 60px;
6
+ margin-top: $header-height;
7
7
  box-shadow: $elevation-large;
8
8
  border: $border-width solid $gray-900;
9
9
  border-radius: $radius-small;
@@ -1,4 +1,5 @@
1
1
  .editor-header {
2
+ @include reset;
2
3
  height: $header-height;
3
4
  background: $white;
4
5
  display: grid;
@@ -125,10 +125,14 @@ const getOpenverseCaption = ( item ) => {
125
125
  };
126
126
 
127
127
  const coreMediaFetch = async ( query = {} ) => {
128
- const mediaItems = await resolveSelect( coreStore ).getMediaItems( {
129
- ...query,
130
- orderBy: !! query?.search ? 'relevance' : 'date',
131
- } );
128
+ const mediaItems = await resolveSelect( coreStore ).getEntityRecords(
129
+ 'postType',
130
+ 'attachment',
131
+ {
132
+ ...query,
133
+ orderBy: !! query?.search ? 'relevance' : 'date',
134
+ }
135
+ );
132
136
  return mediaItems.map( ( mediaItem ) => ( {
133
137
  ...mediaItem,
134
138
  alt: mediaItem.alt_text,
@@ -88,9 +88,9 @@ export default function PostCardPanel( {
88
88
  let title = __( 'No title' );
89
89
  if ( labels?.name && postIds.length > 1 ) {
90
90
  title = sprintf(
91
- // translators: %i number of selected items %s: Name of the plural post type e.g: "Posts".
92
- __( '%i %s' ),
93
- postId.length,
91
+ // translators: %1$d number of selected items %2$s: Name of the plural post type e.g: "Posts".
92
+ __( '%1$d %2$s' ),
93
+ postIds.length,
94
94
  labels?.name
95
95
  );
96
96
  } else if ( postTitle ) {
@@ -305,21 +305,25 @@ function PostFeaturedImage( {
305
305
  }
306
306
 
307
307
  const applyWithSelect = withSelect( ( select ) => {
308
- const { getMedia, getPostType, hasFinishedResolution } =
308
+ const { getEntityRecord, getPostType, hasFinishedResolution } =
309
309
  select( coreStore );
310
310
  const { getCurrentPostId, getEditedPostAttribute } = select( editorStore );
311
311
  const featuredImageId = getEditedPostAttribute( 'featured_media' );
312
312
 
313
313
  return {
314
314
  media: featuredImageId
315
- ? getMedia( featuredImageId, { context: 'view' } )
315
+ ? getEntityRecord( 'postType', 'attachment', featuredImageId, {
316
+ context: 'view',
317
+ } )
316
318
  : null,
317
319
  currentPostId: getCurrentPostId(),
318
320
  postType: getPostType( getEditedPostAttribute( 'type' ) ),
319
321
  featuredImageId,
320
322
  isRequestingFeaturedImageMedia:
321
323
  !! featuredImageId &&
322
- ! hasFinishedResolution( 'getMedia', [
324
+ ! hasFinishedResolution( 'getEntityRecord', [
325
+ 'postType',
326
+ 'attachment',
323
327
  featuredImageId,
324
328
  { context: 'view' },
325
329
  ] ),
@@ -198,6 +198,7 @@
198
198
  }
199
199
 
200
200
  .editor-post-publish-panel {
201
+ @include reset;
201
202
  position: fixed;
202
203
  z-index: z-index(".editor-post-publish-panel");
203
204
  background: $white;
@@ -279,7 +279,7 @@ export function FlatTermSelector( { slug, __nextHasNoMarginBottom } ) {
279
279
 
280
280
  const newTermLabel =
281
281
  taxonomy?.labels?.add_new_item ??
282
- ( slug === 'post_tag' ? __( 'Add new tag' ) : __( 'Add new Term' ) );
282
+ ( slug === 'post_tag' ? __( 'Add Tag' ) : __( 'Add Term' ) );
283
283
  const singularName =
284
284
  taxonomy?.labels?.singular_name ??
285
285
  ( slug === 'post_tag' ? __( 'Tag' ) : __( 'Term' ) );
@@ -389,13 +389,13 @@ export function HierarchicalTermSelector( { slug } ) {
389
389
 
390
390
  const newTermButtonLabel = labelWithFallback(
391
391
  'add_new_item',
392
- __( 'Add new category' ),
393
- __( 'Add new term' )
392
+ __( 'Add Category' ),
393
+ __( 'Add Term' )
394
394
  );
395
395
  const newTermLabel = labelWithFallback(
396
396
  'new_item_name',
397
- __( 'Add new category' ),
398
- __( 'Add new term' )
397
+ __( 'Add Category' ),
398
+ __( 'Add Term' )
399
399
  );
400
400
  const parentSelectLabel = labelWithFallback(
401
401
  'parent_item',
@@ -26,7 +26,7 @@ describe( 'PostTaxonomies', () => {
26
26
  show_ui: true,
27
27
  },
28
28
  labels: {
29
- add_new_item: 'Add new genre',
29
+ add_new_item: 'Add Genre',
30
30
  },
31
31
  };
32
32
 
@@ -40,7 +40,7 @@ describe( 'PostTaxonomies', () => {
40
40
  show_ui: true,
41
41
  },
42
42
  labels: {
43
- add_new_item: 'Add new category',
43
+ add_new_item: 'Add Category',
44
44
  },
45
45
  };
46
46
 
@@ -135,10 +135,10 @@ describe( 'PostTaxonomies', () => {
135
135
  screen.queryByRole( 'group', { name: 'Categories' } )
136
136
  ).not.toBeInTheDocument();
137
137
  expect(
138
- screen.getByRole( 'button', { name: 'Add new genre' } )
138
+ screen.getByRole( 'button', { name: 'Add Genre' } )
139
139
  ).toBeVisible();
140
140
  expect(
141
- screen.queryByRole( 'button', { name: 'Add new category' } )
141
+ screen.queryByRole( 'button', { name: 'Add Category' } )
142
142
  ).not.toBeInTheDocument();
143
143
  } );
144
144
 
@@ -158,13 +158,13 @@ describe( 'PostTaxonomies', () => {
158
158
 
159
159
  expect( screen.getByRole( 'group', { name: 'Genres' } ) ).toBeVisible();
160
160
  expect(
161
- screen.getByRole( 'button', { name: 'Add new genre' } )
161
+ screen.getByRole( 'button', { name: 'Add Genre' } )
162
162
  ).toBeVisible();
163
163
  expect(
164
164
  screen.queryByRole( 'group', { name: 'Categories' } )
165
165
  ).not.toBeInTheDocument();
166
166
  expect(
167
- screen.queryByRole( 'button', { name: 'Add new category' } )
167
+ screen.queryByRole( 'button', { name: 'Add Category' } )
168
168
  ).not.toBeInTheDocument();
169
169
  } );
170
170
  } );
@@ -47,7 +47,11 @@ import { __ } from '@wordpress/i18n';
47
47
  const postTypeEntities = [
48
48
  { name: 'post', baseURL: '/wp/v2/posts' },
49
49
  { name: 'page', baseURL: '/wp/v2/pages' },
50
- { name: 'attachment', baseURL: '/wp/v2/media' },
50
+ {
51
+ name: 'attachment',
52
+ baseURL: '/wp/v2/media',
53
+ baseURLParams: { context: 'edit' },
54
+ },
51
55
  { name: 'wp_block', baseURL: '/wp/v2/blocks' },
52
56
  ].map( ( postTypeEntity ) => ( {
53
57
  kind: 'postType',
@@ -94,6 +94,7 @@ const {
94
94
  selectBlockPatternsKey,
95
95
  reusableBlocksSelectKey,
96
96
  sectionRootClientIdKey,
97
+ mediaEditKey,
97
98
  } = unlock( privateApis );
98
99
 
99
100
  /**
@@ -176,8 +177,8 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
176
177
  keepCaretInsideBlock: get( 'core', 'keepCaretInsideBlock' ),
177
178
  hasUploadPermissions:
178
179
  canUser( 'create', {
179
- kind: 'root',
180
- name: 'media',
180
+ kind: 'postType',
181
+ name: 'attachment',
181
182
  } ) ?? true,
182
183
  userCanCreatePages: canUser( 'create', {
183
184
  kind: 'postType',
@@ -231,7 +232,7 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
231
232
  );
232
233
 
233
234
  const { undo, setIsInserterOpened } = useDispatch( editorStore );
234
-
235
+ const { editMediaEntity } = unlock( useDispatch( coreStore ) );
235
236
  const { saveEntityRecord } = useDispatch( coreStore );
236
237
 
237
238
  /**
@@ -291,6 +292,9 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
291
292
  hasFixedToolbar,
292
293
  isDistractionFree,
293
294
  keepCaretInsideBlock,
295
+ [ mediaEditKey ]: hasUploadPermissions
296
+ ? editMediaEntity
297
+ : undefined,
294
298
  mediaUpload: hasUploadPermissions ? mediaUpload : undefined,
295
299
  mediaSideload: hasUploadPermissions ? mediaSideload : undefined,
296
300
  __experimentalBlockPatterns: blockPatterns,
@@ -363,6 +367,7 @@ function useBlockEditorSettings( settings, postType, postId, renderingMode ) {
363
367
  globalStylesData,
364
368
  globalStylesLinksData,
365
369
  renderingMode,
370
+ editMediaEntity,
366
371
  ] );
367
372
  }
368
373
 
@@ -14,3 +14,7 @@
14
14
  .editor-post-summary .components-v-stack:empty {
15
15
  display: none;
16
16
  }
17
+
18
+ .editor-sidebar {
19
+ @include reset;
20
+ }
@@ -1,4 +1,5 @@
1
1
  .editor-text-editor {
2
+ @include reset;
2
3
  position: relative;
3
4
  width: 100%;
4
5
  background-color: $white;
@@ -165,21 +165,6 @@ export function setEditedPost( postType, postId ) {
165
165
  * wp.data.dispatch( 'core/editor' ).editPost( { title: `${ newTitle }` } );
166
166
  * ```
167
167
  *
168
- * @example
169
- *```js
170
- * // Get specific media size based on the featured media ID
171
- * // Note: change sizes?.large for any registered size
172
- * const getFeaturedMediaUrl = useSelect( ( select ) => {
173
- * const getFeaturedMediaId =
174
- * select( 'core/editor' ).getEditedPostAttribute( 'featured_media' );
175
- * const getMedia = select( 'core' ).getMedia( getFeaturedMediaId );
176
- *
177
- * return (
178
- * getMedia?.media_details?.sizes?.large?.source_url || getMedia?.source_url || ''
179
- * );
180
- * }, [] );
181
- * ```
182
- *
183
168
  * @return {Object} Action object
184
169
  */
185
170
  export const editPost =
@@ -330,10 +330,14 @@ const getNestedEditedPostProperty = createSelector(
330
330
  * const getFeaturedMediaUrl = useSelect( ( select ) => {
331
331
  * const getFeaturedMediaId =
332
332
  * select( 'core/editor' ).getEditedPostAttribute( 'featured_media' );
333
- * const getMedia = select( 'core' ).getMedia( getFeaturedMediaId );
333
+ * const media = select( 'core' ).getEntityRecord(
334
+ * 'postType',
335
+ * 'attachment',
336
+ * getFeaturedMediaId
337
+ * );
334
338
  *
335
339
  * return (
336
- * getMedia?.media_details?.sizes?.large?.source_url || getMedia?.source_url || ''
340
+ * media?.media_details?.sizes?.large?.source_url || media?.source_url || ''
337
341
  * );
338
342
  * }, [] );
339
343
  *```
@@ -610,9 +614,14 @@ export const isEditedPostAutosaveable = createRegistrySelector(
610
614
  }
611
615
 
612
616
  const postType = getCurrentPostType( state );
617
+ const postTypeObject = select( coreStore ).getPostType( postType );
613
618
 
614
619
  // Currently template autosaving is not supported.
615
- if ( postType === 'wp_template' ) {
620
+ // @todo: Remove hardcode check for template after bumping required WP version to 6.8.
621
+ if (
622
+ postType === 'wp_template' ||
623
+ ! postTypeObject?.supports?.autosave
624
+ ) {
616
625
  return false;
617
626
  }
618
627