@wordpress/editor 13.2.0 → 13.3.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 (122) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/error-boundary/index.js +24 -30
  3. package/build/components/error-boundary/index.js.map +1 -1
  4. package/build/components/media-categories/index.js +237 -0
  5. package/build/components/media-categories/index.js.map +1 -0
  6. package/build/components/page-attributes/parent.js +1 -1
  7. package/build/components/page-attributes/parent.js.map +1 -1
  8. package/build/components/post-publish-panel/postpublish.js +1 -0
  9. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  10. package/build/components/post-slug/index.js +1 -0
  11. package/build/components/post-slug/index.js.map +1 -1
  12. package/build/components/post-taxonomies/hierarchical-term-selector.js +7 -3
  13. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  14. package/build/components/post-template/index.js +7 -4
  15. package/build/components/post-template/index.js.map +1 -1
  16. package/build/components/post-url/index.js +1 -0
  17. package/build/components/post-url/index.js.map +1 -1
  18. package/build/components/provider/index.js +26 -8
  19. package/build/components/provider/index.js.map +1 -1
  20. package/build/components/provider/index.native.js +21 -14
  21. package/build/components/provider/index.native.js.map +1 -1
  22. package/build/components/provider/use-block-editor-settings.js +7 -4
  23. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  24. package/build/components/provider/use-block-editor-settings.native.js +1 -2
  25. package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
  26. package/build/components/table-of-contents/index.js +3 -1
  27. package/build/components/table-of-contents/index.js.map +1 -1
  28. package/build/components/unsaved-changes-warning/index.js +1 -1
  29. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  30. package/build/experiments.js +20 -0
  31. package/build/experiments.js.map +1 -0
  32. package/build/hooks/default-autocompleters.js +2 -7
  33. package/build/hooks/default-autocompleters.js.map +1 -1
  34. package/build/index.js +14 -0
  35. package/build/index.js.map +1 -1
  36. package/build/index.native.js +14 -0
  37. package/build/index.native.js.map +1 -1
  38. package/build/lockUnlock.js +19 -0
  39. package/build/lockUnlock.js.map +1 -0
  40. package/build/store/defaults.js +1 -2
  41. package/build/store/defaults.js.map +1 -1
  42. package/build/store/selectors.js +1 -1
  43. package/build/store/selectors.js.map +1 -1
  44. package/build/utils/terms.js +9 -5
  45. package/build/utils/terms.js.map +1 -1
  46. package/build-module/components/error-boundary/index.js +24 -30
  47. package/build-module/components/error-boundary/index.js.map +1 -1
  48. package/build-module/components/media-categories/index.js +225 -0
  49. package/build-module/components/media-categories/index.js.map +1 -0
  50. package/build-module/components/page-attributes/parent.js +2 -2
  51. package/build-module/components/page-attributes/parent.js.map +1 -1
  52. package/build-module/components/post-publish-panel/postpublish.js +1 -0
  53. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  54. package/build-module/components/post-slug/index.js +1 -0
  55. package/build-module/components/post-slug/index.js.map +1 -1
  56. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +8 -5
  57. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  58. package/build-module/components/post-template/index.js +8 -5
  59. package/build-module/components/post-template/index.js.map +1 -1
  60. package/build-module/components/post-url/index.js +1 -0
  61. package/build-module/components/post-url/index.js.map +1 -1
  62. package/build-module/components/provider/index.js +21 -9
  63. package/build-module/components/provider/index.js.map +1 -1
  64. package/build-module/components/provider/index.native.js +20 -12
  65. package/build-module/components/provider/index.native.js.map +1 -1
  66. package/build-module/components/provider/use-block-editor-settings.js +5 -5
  67. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  68. package/build-module/components/provider/use-block-editor-settings.native.js +1 -2
  69. package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
  70. package/build-module/components/table-of-contents/index.js +3 -1
  71. package/build-module/components/table-of-contents/index.js.map +1 -1
  72. package/build-module/components/unsaved-changes-warning/index.js +1 -1
  73. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  74. package/build-module/experiments.js +10 -0
  75. package/build-module/experiments.js.map +1 -0
  76. package/build-module/hooks/default-autocompleters.js +2 -6
  77. package/build-module/hooks/default-autocompleters.js.map +1 -1
  78. package/build-module/index.js +1 -0
  79. package/build-module/index.js.map +1 -1
  80. package/build-module/index.native.js +1 -0
  81. package/build-module/index.native.js.map +1 -1
  82. package/build-module/lockUnlock.js +9 -0
  83. package/build-module/lockUnlock.js.map +1 -0
  84. package/build-module/store/defaults.js +1 -2
  85. package/build-module/store/defaults.js.map +1 -1
  86. package/build-module/store/selectors.js +1 -1
  87. package/build-module/store/selectors.js.map +1 -1
  88. package/build-module/utils/terms.js +9 -6
  89. package/build-module/utils/terms.js.map +1 -1
  90. package/build-style/style-rtl.css +0 -3
  91. package/build-style/style.css +0 -3
  92. package/package.json +30 -29
  93. package/src/components/autosave-monitor/test/index.js +8 -2
  94. package/src/components/editor-help/test/index.native.js +5 -5
  95. package/src/components/error-boundary/index.js +24 -37
  96. package/src/components/media-categories/index.js +247 -0
  97. package/src/components/page-attributes/parent.js +2 -2
  98. package/src/components/page-attributes/test/order.js +4 -14
  99. package/src/components/post-preview-button/test/index.js +5 -17
  100. package/src/components/post-publish-button/test/index.js +5 -17
  101. package/src/components/post-publish-panel/postpublish.js +1 -0
  102. package/src/components/post-publish-panel/style.scss +1 -5
  103. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -18
  104. package/src/components/post-saved-state/test/index.js +1 -5
  105. package/src/components/post-slug/index.js +1 -0
  106. package/src/components/post-taxonomies/hierarchical-term-selector.js +23 -17
  107. package/src/components/post-template/index.js +3 -4
  108. package/src/components/post-url/index.js +1 -0
  109. package/src/components/provider/index.js +120 -91
  110. package/src/components/provider/index.native.js +26 -17
  111. package/src/components/provider/use-block-editor-settings.js +60 -49
  112. package/src/components/provider/use-block-editor-settings.native.js +1 -2
  113. package/src/components/table-of-contents/index.js +3 -1
  114. package/src/components/unsaved-changes-warning/index.js +1 -1
  115. package/src/experiments.js +10 -0
  116. package/src/hooks/default-autocompleters.js +1 -6
  117. package/src/index.js +1 -0
  118. package/src/index.native.js +1 -0
  119. package/src/lockUnlock.js +9 -0
  120. package/src/store/defaults.js +0 -1
  121. package/src/store/selectors.js +1 -1
  122. package/src/utils/terms.js +8 -5
@@ -27,5 +27,4 @@ export const EDITOR_SETTINGS_DEFAULTS = {
27
27
  richEditingEnabled: true,
28
28
  codeEditingEnabled: true,
29
29
  enableCustomFields: undefined,
30
- supportsLayout: true,
31
30
  };
@@ -785,7 +785,7 @@ export function isPreviewingPost( state ) {
785
785
  *
786
786
  * @param {Object} state Global application state.
787
787
  *
788
- * @return {string?} Preview Link.
788
+ * @return {string | undefined} Preview Link.
789
789
  */
790
790
  export function getEditedPostPreviewLink( state ) {
791
791
  if ( state.saving.pending || isSavingPost( state ) ) {
@@ -1,7 +1,12 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { groupBy, map, unescape as lodashUnescapeString } from 'lodash';
4
+ import { groupBy } from 'lodash';
5
+
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { decodeEntities } from '@wordpress/html-entities';
5
10
 
6
11
  /**
7
12
  * Returns terms in a tree form.
@@ -39,14 +44,12 @@ export function buildTermsTree( flatTerms ) {
39
44
  return fillWithChildren( termsByParent[ '0' ] || [] );
40
45
  }
41
46
 
42
- // Lodash unescape function handles ' but not ' which may be return in some API requests.
43
47
  export const unescapeString = ( arg ) => {
44
- return lodashUnescapeString( arg.replace( ''', "'" ) );
48
+ return decodeEntities( arg );
45
49
  };
46
50
 
47
51
  /**
48
52
  * Returns a term object with name unescaped.
49
- * The unescape of the name property is done using lodash unescape function.
50
53
  *
51
54
  * @param {Object} term The term object to unescape.
52
55
  *
@@ -68,5 +71,5 @@ export const unescapeTerm = ( term ) => {
68
71
  * @return {Object[]} Array of term objects unescaped.
69
72
  */
70
73
  export const unescapeTerms = ( terms ) => {
71
- return map( terms, unescapeTerm );
74
+ return ( terms ?? [] ).map( unescapeTerm );
72
75
  };