@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.
- package/CHANGELOG.md +2 -0
- package/build/components/entities-saved-states/index.js +15 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/index.js +26 -2
- package/build/components/index.js.map +1 -1
- package/build/components/post-author/panel.js +24 -0
- package/build/components/post-author/panel.js.map +1 -0
- package/build/components/post-panel-row/index.js +36 -0
- package/build/components/post-panel-row/index.js.map +1 -0
- package/build/components/post-saved-state/index.js +21 -16
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/panel.js +67 -0
- package/build/components/post-schedule/panel.js.map +1 -0
- package/build/components/post-sync-status/index.js +8 -4
- package/build/components/post-sync-status/index.js.map +1 -1
- package/build/components/post-title/constants.js +11 -0
- package/build/components/post-title/constants.js.map +1 -0
- package/build/components/post-title/index.js +61 -89
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/post-title-raw.js +92 -0
- package/build/components/post-title/post-title-raw.js.map +1 -0
- package/build/components/post-title/use-post-title-focus.js +64 -0
- package/build/components/post-title/use-post-title-focus.js.map +1 -0
- package/build/components/post-title/use-post-title.js +41 -0
- package/build/components/post-title/use-post-title.js.map +1 -0
- package/build/components/post-url/panel.js +4 -3
- package/build/components/post-url/panel.js.map +1 -1
- package/build/components/provider/constants.js +9 -0
- package/build/components/provider/constants.js.map +1 -0
- package/build/components/provider/disable-non-page-content-blocks.js +63 -0
- package/build/components/provider/disable-non-page-content-blocks.js.map +1 -0
- package/build/components/provider/index.js +27 -9
- package/build/components/provider/index.js.map +1 -1
- package/build/private-apis.js +2 -0
- package/build/private-apis.js.map +1 -1
- package/build/store/actions.js +23 -2
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +10 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +16 -2
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +16 -2
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/index.js +3 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/post-author/panel.js +14 -0
- package/build-module/components/post-author/panel.js.map +1 -0
- package/build-module/components/post-panel-row/index.js +27 -0
- package/build-module/components/post-panel-row/index.js.map +1 -0
- package/build-module/components/post-saved-state/index.js +22 -17
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/panel.js +59 -0
- package/build-module/components/post-schedule/panel.js.map +1 -0
- package/build-module/components/post-sync-status/index.js +8 -5
- package/build-module/components/post-sync-status/index.js.map +1 -1
- package/build-module/components/post-title/constants.js +3 -0
- package/build-module/components/post-title/constants.js.map +1 -0
- package/build-module/components/post-title/index.js +62 -91
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/post-title-raw.js +83 -0
- package/build-module/components/post-title/post-title-raw.js.map +1 -0
- package/build-module/components/post-title/use-post-title-focus.js +57 -0
- package/build-module/components/post-title/use-post-title-focus.js.map +1 -0
- package/build-module/components/post-title/use-post-title.js +33 -0
- package/build-module/components/post-title/use-post-title.js.map +1 -0
- package/build-module/components/post-url/panel.js +5 -4
- package/build-module/components/post-url/panel.js.map +1 -1
- package/build-module/components/provider/constants.js +2 -0
- package/build-module/components/provider/constants.js.map +1 -0
- package/build-module/components/provider/disable-non-page-content-blocks.js +56 -0
- package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -0
- package/build-module/components/provider/index.js +25 -6
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/private-apis.js +2 -0
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/actions.js +21 -0
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +9 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +11 -0
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +51 -18
- package/build-style/style.css +51 -18
- package/package.json +31 -31
- package/src/components/entities-saved-states/index.js +16 -1
- package/src/components/index.js +3 -0
- package/src/components/post-author/panel.js +18 -0
- package/src/components/post-author/style.scss +7 -0
- package/src/components/post-panel-row/index.js +26 -0
- package/src/components/post-panel-row/style.scss +21 -0
- package/src/components/post-saved-state/index.js +46 -37
- package/src/components/post-schedule/panel.js +65 -0
- package/src/components/post-schedule/style.scss +23 -0
- package/src/components/post-sync-status/index.js +5 -6
- package/src/components/post-sync-status/style.scss +3 -17
- package/src/components/post-title/constants.js +4 -0
- package/src/components/post-title/index.js +56 -87
- package/src/components/post-title/post-title-raw.js +82 -0
- package/src/components/post-title/style.scss +5 -0
- package/src/components/post-title/use-post-title-focus.js +50 -0
- package/src/components/post-title/use-post-title.js +25 -0
- package/src/components/post-url/panel.js +4 -8
- package/src/components/post-url/style.scss +1 -12
- package/src/components/provider/README.md +0 -13
- package/src/components/provider/constants.js +5 -0
- package/src/components/provider/disable-non-page-content-blocks.js +55 -0
- package/src/components/provider/index.js +41 -14
- package/src/private-apis.js +2 -0
- package/src/store/actions.js +21 -0
- package/src/store/reducer.js +10 -0
- package/src/store/selectors.js +11 -0
- package/src/style.scss +4 -0
package/src/store/actions.js
CHANGED
|
@@ -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
|
*/
|
package/src/store/reducer.js
CHANGED
|
@@ -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
|
} );
|
package/src/store/selectors.js
CHANGED
|
@@ -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";
|