@wordpress/editor 13.23.0 → 13.24.1

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 (112) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/entities-saved-states/index.js +15 -1
  3. package/build/components/entities-saved-states/index.js.map +1 -1
  4. package/build/components/index.js +26 -2
  5. package/build/components/index.js.map +1 -1
  6. package/build/components/post-author/panel.js +24 -0
  7. package/build/components/post-author/panel.js.map +1 -0
  8. package/build/components/post-panel-row/index.js +36 -0
  9. package/build/components/post-panel-row/index.js.map +1 -0
  10. package/build/components/post-saved-state/index.js +21 -16
  11. package/build/components/post-saved-state/index.js.map +1 -1
  12. package/build/components/post-schedule/panel.js +67 -0
  13. package/build/components/post-schedule/panel.js.map +1 -0
  14. package/build/components/post-sync-status/index.js +8 -4
  15. package/build/components/post-sync-status/index.js.map +1 -1
  16. package/build/components/post-title/constants.js +11 -0
  17. package/build/components/post-title/constants.js.map +1 -0
  18. package/build/components/post-title/index.js +61 -89
  19. package/build/components/post-title/index.js.map +1 -1
  20. package/build/components/post-title/post-title-raw.js +92 -0
  21. package/build/components/post-title/post-title-raw.js.map +1 -0
  22. package/build/components/post-title/use-post-title-focus.js +64 -0
  23. package/build/components/post-title/use-post-title-focus.js.map +1 -0
  24. package/build/components/post-title/use-post-title.js +41 -0
  25. package/build/components/post-title/use-post-title.js.map +1 -0
  26. package/build/components/post-url/panel.js +4 -3
  27. package/build/components/post-url/panel.js.map +1 -1
  28. package/build/components/provider/constants.js +9 -0
  29. package/build/components/provider/constants.js.map +1 -0
  30. package/build/components/provider/disable-non-page-content-blocks.js +63 -0
  31. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -0
  32. package/build/components/provider/index.js +27 -9
  33. package/build/components/provider/index.js.map +1 -1
  34. package/build/private-apis.js +2 -0
  35. package/build/private-apis.js.map +1 -1
  36. package/build/store/actions.js +23 -2
  37. package/build/store/actions.js.map +1 -1
  38. package/build/store/reducer.js +10 -1
  39. package/build/store/reducer.js.map +1 -1
  40. package/build/store/selectors.js +16 -2
  41. package/build/store/selectors.js.map +1 -1
  42. package/build-module/components/entities-saved-states/index.js +16 -2
  43. package/build-module/components/entities-saved-states/index.js.map +1 -1
  44. package/build-module/components/index.js +3 -0
  45. package/build-module/components/index.js.map +1 -1
  46. package/build-module/components/post-author/panel.js +14 -0
  47. package/build-module/components/post-author/panel.js.map +1 -0
  48. package/build-module/components/post-panel-row/index.js +27 -0
  49. package/build-module/components/post-panel-row/index.js.map +1 -0
  50. package/build-module/components/post-saved-state/index.js +22 -17
  51. package/build-module/components/post-saved-state/index.js.map +1 -1
  52. package/build-module/components/post-schedule/panel.js +59 -0
  53. package/build-module/components/post-schedule/panel.js.map +1 -0
  54. package/build-module/components/post-sync-status/index.js +8 -5
  55. package/build-module/components/post-sync-status/index.js.map +1 -1
  56. package/build-module/components/post-title/constants.js +3 -0
  57. package/build-module/components/post-title/constants.js.map +1 -0
  58. package/build-module/components/post-title/index.js +62 -91
  59. package/build-module/components/post-title/index.js.map +1 -1
  60. package/build-module/components/post-title/post-title-raw.js +83 -0
  61. package/build-module/components/post-title/post-title-raw.js.map +1 -0
  62. package/build-module/components/post-title/use-post-title-focus.js +57 -0
  63. package/build-module/components/post-title/use-post-title-focus.js.map +1 -0
  64. package/build-module/components/post-title/use-post-title.js +33 -0
  65. package/build-module/components/post-title/use-post-title.js.map +1 -0
  66. package/build-module/components/post-url/panel.js +5 -4
  67. package/build-module/components/post-url/panel.js.map +1 -1
  68. package/build-module/components/provider/constants.js +2 -0
  69. package/build-module/components/provider/constants.js.map +1 -0
  70. package/build-module/components/provider/disable-non-page-content-blocks.js +56 -0
  71. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -0
  72. package/build-module/components/provider/index.js +25 -6
  73. package/build-module/components/provider/index.js.map +1 -1
  74. package/build-module/private-apis.js +2 -0
  75. package/build-module/private-apis.js.map +1 -1
  76. package/build-module/store/actions.js +21 -0
  77. package/build-module/store/actions.js.map +1 -1
  78. package/build-module/store/reducer.js +9 -1
  79. package/build-module/store/reducer.js.map +1 -1
  80. package/build-module/store/selectors.js +11 -0
  81. package/build-module/store/selectors.js.map +1 -1
  82. package/build-style/style-rtl.css +51 -18
  83. package/build-style/style.css +51 -18
  84. package/package.json +31 -31
  85. package/src/components/entities-saved-states/index.js +16 -1
  86. package/src/components/index.js +3 -0
  87. package/src/components/post-author/panel.js +18 -0
  88. package/src/components/post-author/style.scss +7 -0
  89. package/src/components/post-panel-row/index.js +26 -0
  90. package/src/components/post-panel-row/style.scss +21 -0
  91. package/src/components/post-saved-state/index.js +46 -37
  92. package/src/components/post-schedule/panel.js +65 -0
  93. package/src/components/post-schedule/style.scss +23 -0
  94. package/src/components/post-sync-status/index.js +5 -6
  95. package/src/components/post-sync-status/style.scss +3 -17
  96. package/src/components/post-title/constants.js +4 -0
  97. package/src/components/post-title/index.js +56 -87
  98. package/src/components/post-title/post-title-raw.js +82 -0
  99. package/src/components/post-title/style.scss +5 -0
  100. package/src/components/post-title/use-post-title-focus.js +50 -0
  101. package/src/components/post-title/use-post-title.js +25 -0
  102. package/src/components/post-url/panel.js +4 -8
  103. package/src/components/post-url/style.scss +1 -12
  104. package/src/components/provider/README.md +0 -13
  105. package/src/components/provider/constants.js +5 -0
  106. package/src/components/provider/disable-non-page-content-blocks.js +55 -0
  107. package/src/components/provider/index.js +41 -14
  108. package/src/private-apis.js +2 -0
  109. package/src/store/actions.js +21 -0
  110. package/src/store/reducer.js +10 -0
  111. package/src/store/selectors.js +11 -0
  112. package/src/style.scss +4 -0
@@ -548,6 +548,27 @@ export function updateEditorSettings( settings ) {
548
548
  };
549
549
  }
550
550
 
551
+ /**
552
+ * Returns an action used to set the rendering mode of the post editor. We support multiple rendering modes:
553
+ *
554
+ * - `all`: This is the default mode. It renders the post editor with all the features available. If a template is provided, it's preferred over the post.
555
+ * - `template-only`: This mode renders the editor with only the template blocks visible.
556
+ * - `post-only`: This mode extracts the post blocks from the template and renders only those. The idea is to allow the user to edit the post/page in isolation without the wrapping template.
557
+ * - `template-locked`: This mode renders both the template and the post blocks but the template blocks are locked and can't be edited. The post blocks are editable.
558
+ *
559
+ * @param {string} mode Mode (one of 'template-only', 'post-only', 'template-locked' or 'all').
560
+ */
561
+ export const setRenderingMode =
562
+ ( mode ) =>
563
+ ( { dispatch, registry } ) => {
564
+ registry.dispatch( blockEditorStore ).clearSelectedBlock();
565
+
566
+ dispatch( {
567
+ type: 'SET_RENDERING_MODE',
568
+ mode,
569
+ } );
570
+ };
571
+
551
572
  /**
552
573
  * Backward compatibility
553
574
  */
@@ -279,6 +279,15 @@ export function editorSettings( state = EDITOR_SETTINGS_DEFAULTS, action ) {
279
279
  return state;
280
280
  }
281
281
 
282
+ export function renderingMode( state = 'all', action ) {
283
+ switch ( action.type ) {
284
+ case 'SET_RENDERING_MODE':
285
+ return action.mode;
286
+ }
287
+
288
+ return state;
289
+ }
290
+
282
291
  export default combineReducers( {
283
292
  postId,
284
293
  postType,
@@ -290,4 +299,5 @@ export default combineReducers( {
290
299
  isReady,
291
300
  editorSettings,
292
301
  postAutosavingLock,
302
+ renderingMode,
293
303
  } );
@@ -1188,6 +1188,17 @@ export function getEditorSettings( state ) {
1188
1188
  return state.editorSettings;
1189
1189
  }
1190
1190
 
1191
+ /**
1192
+ * Returns the post editor's rendering mode.
1193
+ *
1194
+ * @param {Object} state Editor state.
1195
+ *
1196
+ * @return {string} Rendering mode.
1197
+ */
1198
+ export function getRenderingMode( state ) {
1199
+ return state.renderingMode;
1200
+ }
1201
+
1191
1202
  /*
1192
1203
  * Backward compatibility
1193
1204
  */
package/src/style.scss CHANGED
@@ -3,17 +3,21 @@
3
3
  @import "./components/editor-notices/style.scss";
4
4
  @import "./components/entities-saved-states/style.scss";
5
5
  @import "./components/error-boundary/style.scss";
6
+ @import "./components/post-author/style.scss";
6
7
  @import "./components/post-excerpt/style.scss";
7
8
  @import "./components/post-featured-image/style.scss";
8
9
  @import "./components/post-format/style.scss";
9
10
  @import "./components/post-last-revision/style.scss";
10
11
  @import "./components/post-locked-modal/style.scss";
12
+ @import "./components/post-panel-row/style.scss";
11
13
  @import "./components/post-publish-button/style.scss";
12
14
  @import "./components/post-publish-panel/style.scss";
13
15
  @import "./components/post-saved-state/style.scss";
16
+ @import "./components/post-schedule/style.scss";
14
17
  @import "./components/post-sync-status/style.scss";
15
18
  @import "./components/post-taxonomies/style.scss";
16
19
  @import "./components/post-text-editor/style.scss";
20
+ @import "./components/post-title/style.scss";
17
21
  @import "./components/post-url/style.scss";
18
22
  @import "./components/post-visibility/style.scss";
19
23
  @import "./components/post-trash/style.scss";