@wordpress/editor 14.33.3 → 14.33.5
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/build/bindings/post-data.js +47 -63
- package/build/bindings/post-data.js.map +3 -3
- package/build/bindings/post-meta.js +45 -39
- package/build/bindings/post-meta.js.map +2 -2
- package/build/components/collab-sidebar/add-comment.js +9 -5
- package/build/components/collab-sidebar/add-comment.js.map +2 -2
- package/build/components/collab-sidebar/comment-author-info.js +27 -15
- package/build/components/collab-sidebar/comment-author-info.js.map +2 -2
- package/build/components/collab-sidebar/comment-indicator-toolbar.js +9 -23
- package/build/components/collab-sidebar/comment-indicator-toolbar.js.map +3 -3
- package/build/components/collab-sidebar/comment-menu-item.js +36 -6
- package/build/components/collab-sidebar/comment-menu-item.js.map +3 -3
- package/build/components/collab-sidebar/comments.js +317 -301
- package/build/components/collab-sidebar/comments.js.map +3 -3
- package/build/components/collab-sidebar/hooks.js +5 -3
- package/build/components/collab-sidebar/hooks.js.map +2 -2
- package/build/components/collab-sidebar/index.js +35 -11
- package/build/components/collab-sidebar/index.js.map +3 -3
- package/build/components/collab-sidebar/utils.js +6 -3
- package/build/components/collab-sidebar/utils.js.map +2 -2
- package/build/components/editor/index.js +2 -2
- package/build/components/editor/index.js.map +3 -3
- package/build/components/more-menu/index.js +1 -1
- package/build/components/more-menu/index.js.map +2 -2
- package/build/components/visual-editor/index.js +20 -9
- package/build/components/visual-editor/index.js.map +2 -2
- package/build/store/private-actions.js +8 -0
- package/build/store/private-actions.js.map +2 -2
- package/build/store/private-selectors.js +5 -0
- package/build/store/private-selectors.js.map +2 -2
- package/build/store/reducer.js +10 -0
- package/build/store/reducer.js.map +2 -2
- package/build-module/bindings/post-data.js +47 -63
- package/build-module/bindings/post-data.js.map +2 -2
- package/build-module/bindings/post-meta.js +45 -39
- package/build-module/bindings/post-meta.js.map +2 -2
- package/build-module/components/collab-sidebar/add-comment.js +10 -6
- package/build-module/components/collab-sidebar/add-comment.js.map +2 -2
- package/build-module/components/collab-sidebar/comment-author-info.js +27 -15
- package/build-module/components/collab-sidebar/comment-author-info.js.map +2 -2
- package/build-module/components/collab-sidebar/comment-indicator-toolbar.js +15 -25
- package/build-module/components/collab-sidebar/comment-indicator-toolbar.js.map +2 -2
- package/build-module/components/collab-sidebar/comment-menu-item.js +40 -7
- package/build-module/components/collab-sidebar/comment-menu-item.js.map +2 -2
- package/build-module/components/collab-sidebar/comments.js +319 -302
- package/build-module/components/collab-sidebar/comments.js.map +2 -2
- package/build-module/components/collab-sidebar/hooks.js +5 -3
- package/build-module/components/collab-sidebar/hooks.js.map +2 -2
- package/build-module/components/collab-sidebar/index.js +35 -11
- package/build-module/components/collab-sidebar/index.js.map +2 -2
- package/build-module/components/collab-sidebar/utils.js +6 -3
- package/build-module/components/collab-sidebar/utils.js.map +2 -2
- package/build-module/components/editor/index.js +2 -2
- package/build-module/components/editor/index.js.map +2 -2
- package/build-module/components/more-menu/index.js +1 -1
- package/build-module/components/more-menu/index.js.map +2 -2
- package/build-module/components/visual-editor/index.js +20 -9
- package/build-module/components/visual-editor/index.js.map +2 -2
- package/build-module/store/private-actions.js +7 -0
- package/build-module/store/private-actions.js.map +2 -2
- package/build-module/store/private-selectors.js +4 -0
- package/build-module/store/private-selectors.js.map +2 -2
- package/build-module/store/reducer.js +9 -0
- package/build-module/store/reducer.js.map +2 -2
- package/build-style/style-rtl.css +6 -43
- package/build-style/style.css +6 -43
- package/build-types/bindings/post-data.d.ts +18 -8
- package/build-types/bindings/post-meta.d.ts +1 -7
- package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comment-author-info.d.ts +5 -16
- package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comment-menu-item.d.ts +3 -2
- package/build-types/components/collab-sidebar/comment-menu-item.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comments.d.ts +1 -1
- package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/utils.d.ts +2 -2
- package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
- package/build-types/components/visual-editor/index.d.ts.map +1 -1
- package/build-types/store/private-actions.d.ts +7 -0
- package/build-types/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +7 -0
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +10 -0
- package/build-types/store/reducer.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/bindings/post-data.js +63 -111
- package/src/bindings/post-meta.js +55 -46
- package/src/bindings/test/post-meta.js +211 -0
- package/src/components/collab-sidebar/add-comment.js +11 -6
- package/src/components/collab-sidebar/comment-author-info.js +33 -26
- package/src/components/collab-sidebar/comment-indicator-toolbar.js +19 -29
- package/src/components/collab-sidebar/comment-menu-item.js +51 -11
- package/src/components/collab-sidebar/comments.js +47 -27
- package/src/components/collab-sidebar/hooks.js +6 -4
- package/src/components/collab-sidebar/index.js +63 -27
- package/src/components/collab-sidebar/style.scss +6 -46
- package/src/components/collab-sidebar/utils.js +15 -5
- package/src/components/editor/index.js +1 -1
- package/src/components/more-menu/index.js +1 -1
- package/src/components/visual-editor/index.js +27 -6
- package/src/store/private-actions.js +13 -0
- package/src/store/private-selectors.js +10 -0
- package/src/store/reducer.js +16 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -114,6 +114,7 @@ function VisualEditor( {
|
|
|
114
114
|
isDesignPostType,
|
|
115
115
|
postType,
|
|
116
116
|
isPreview,
|
|
117
|
+
canvasMinHeight,
|
|
117
118
|
} = useSelect( ( select ) => {
|
|
118
119
|
const {
|
|
119
120
|
getCurrentPostId,
|
|
@@ -122,7 +123,8 @@ function VisualEditor( {
|
|
|
122
123
|
getEditorSettings,
|
|
123
124
|
getRenderingMode,
|
|
124
125
|
getDeviceType,
|
|
125
|
-
|
|
126
|
+
getCanvasMinHeight,
|
|
127
|
+
} = unlock( select( editorStore ) );
|
|
126
128
|
const { getPostType, getEditedEntityRecord } = select( coreStore );
|
|
127
129
|
const postTypeSlug = getCurrentPostType();
|
|
128
130
|
const _renderingMode = getRenderingMode();
|
|
@@ -162,6 +164,7 @@ function VisualEditor( {
|
|
|
162
164
|
isFocusedEntity: !! editorSettings.onNavigateToPreviousEntityRecord,
|
|
163
165
|
postType: postTypeSlug,
|
|
164
166
|
isPreview: editorSettings.isPreviewMode,
|
|
167
|
+
canvasMinHeight: getCanvasMinHeight(),
|
|
165
168
|
};
|
|
166
169
|
}, [] );
|
|
167
170
|
const { isCleanNewPost } = useSelect( editorStore );
|
|
@@ -185,6 +188,7 @@ function VisualEditor( {
|
|
|
185
188
|
};
|
|
186
189
|
}, [] );
|
|
187
190
|
|
|
191
|
+
const localRef = useRef();
|
|
188
192
|
const deviceStyles = useResizeCanvas( deviceType );
|
|
189
193
|
const [ globalLayoutSettings ] = useSettings( 'layout' );
|
|
190
194
|
|
|
@@ -331,30 +335,47 @@ function VisualEditor( {
|
|
|
331
335
|
// Disable resizing in zoomed-out mode.
|
|
332
336
|
! isZoomedOut;
|
|
333
337
|
|
|
338
|
+
// Calculate the minimum height including scroll offset to fit all notes.
|
|
339
|
+
const calculatedMinHeight = useMemo( () => {
|
|
340
|
+
if ( ! localRef.current ) {
|
|
341
|
+
return canvasMinHeight;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
const { ownerDocument } = localRef.current;
|
|
345
|
+
const scrollTop =
|
|
346
|
+
ownerDocument.documentElement.scrollTop ||
|
|
347
|
+
ownerDocument.body.scrollTop;
|
|
348
|
+
|
|
349
|
+
return canvasMinHeight + scrollTop;
|
|
350
|
+
}, [ canvasMinHeight ] );
|
|
351
|
+
|
|
334
352
|
const iframeStyles = useMemo( () => {
|
|
335
353
|
return [
|
|
336
354
|
...( styles ?? [] ),
|
|
337
355
|
{
|
|
338
356
|
// Ensures margins of children are contained so that the body background paints behind them.
|
|
339
|
-
// Otherwise, the background of html (when zoomed out) would show there and appear broken. It
|
|
357
|
+
// Otherwise, the background of html (when zoomed out) would show there and appear broken. It's
|
|
340
358
|
// important mostly for post-only views yet conceivably an issue in templated views too.
|
|
341
|
-
css: `:where(.block-editor-iframe__body){display:flow-root
|
|
359
|
+
css: `:where(.block-editor-iframe__body){display:flow-root;${
|
|
360
|
+
calculatedMinHeight
|
|
361
|
+
? `min-height:${ calculatedMinHeight }px;`
|
|
362
|
+
: ''
|
|
363
|
+
}}.is-root-container{display:flow-root;${
|
|
342
364
|
// Some themes will have `min-height: 100vh` for the root container,
|
|
343
365
|
// which isn't a requirement in auto resize mode.
|
|
344
366
|
enableResizing ? 'min-height:0!important;' : ''
|
|
345
367
|
}}
|
|
346
368
|
${
|
|
347
369
|
enableResizing
|
|
348
|
-
?
|
|
370
|
+
? `.block-editor-iframe__html{background:var(--wp-editor-canvas-background);display:flex;align-items:center;justify-content:center;min-height:100vh;}.block-editor-iframe__body{width:100%;}`
|
|
349
371
|
: ''
|
|
350
372
|
}`,
|
|
351
373
|
// The CSS above centers the body content vertically when resizing is enabled and applies a background
|
|
352
374
|
// color to the iframe HTML element to match the background color of the editor canvas.
|
|
353
375
|
},
|
|
354
376
|
];
|
|
355
|
-
}, [ styles, enableResizing ] );
|
|
377
|
+
}, [ styles, enableResizing, calculatedMinHeight ] );
|
|
356
378
|
|
|
357
|
-
const localRef = useRef();
|
|
358
379
|
const typewriterRef = useTypewriter();
|
|
359
380
|
contentRef = useMergeRefs( [
|
|
360
381
|
localRef,
|
|
@@ -526,3 +526,16 @@ export const setDefaultRenderingMode =
|
|
|
526
526
|
.dispatch( preferencesStore )
|
|
527
527
|
.set( 'core', 'renderingModes', newModes );
|
|
528
528
|
};
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Set the minimum height of the canvas.
|
|
532
|
+
*
|
|
533
|
+
* @param {number} minHeight
|
|
534
|
+
* @return {Object} Action object.
|
|
535
|
+
*/
|
|
536
|
+
export function setCanvasMinHeight( minHeight ) {
|
|
537
|
+
return {
|
|
538
|
+
type: 'SET_CANVAS_MIN_HEIGHT',
|
|
539
|
+
minHeight,
|
|
540
|
+
};
|
|
541
|
+
}
|
|
@@ -270,3 +270,13 @@ export const getDefaultRenderingMode = createRegistrySelector(
|
|
|
270
270
|
return defaultMode;
|
|
271
271
|
}
|
|
272
272
|
);
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Get the canvas minimum height.
|
|
276
|
+
*
|
|
277
|
+
* @param {Object} state Global application state.
|
|
278
|
+
* @return {number} The canvas minimum height.
|
|
279
|
+
*/
|
|
280
|
+
export function getCanvasMinHeight( state ) {
|
|
281
|
+
return state.canvasMinHeight;
|
|
282
|
+
}
|
package/src/store/reducer.js
CHANGED
|
@@ -384,6 +384,21 @@ export function publishSidebarActive( state = false, action ) {
|
|
|
384
384
|
return state;
|
|
385
385
|
}
|
|
386
386
|
|
|
387
|
+
/**
|
|
388
|
+
* Reducer for the canvas minimum height.
|
|
389
|
+
*
|
|
390
|
+
* @param {number} state Current state.
|
|
391
|
+
* @param {Object} action Dispatched action.
|
|
392
|
+
* @return {number} Updated state.
|
|
393
|
+
*/
|
|
394
|
+
export function canvasMinHeight( state = 0, action ) {
|
|
395
|
+
switch ( action.type ) {
|
|
396
|
+
case 'SET_CANVAS_MIN_HEIGHT':
|
|
397
|
+
return action.minHeight;
|
|
398
|
+
}
|
|
399
|
+
return state;
|
|
400
|
+
}
|
|
401
|
+
|
|
387
402
|
export default combineReducers( {
|
|
388
403
|
postId,
|
|
389
404
|
postType,
|
|
@@ -403,5 +418,6 @@ export default combineReducers( {
|
|
|
403
418
|
listViewPanel,
|
|
404
419
|
listViewToggleRef,
|
|
405
420
|
publishSidebarActive,
|
|
421
|
+
canvasMinHeight,
|
|
406
422
|
dataviews: dataviewsReducer,
|
|
407
423
|
} );
|