@wordpress/editor 14.44.0 → 14.44.1-next.v.202604201441.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.
- package/build/components/collab-sidebar/add-comment.cjs +6 -22
- package/build/components/collab-sidebar/add-comment.cjs.map +3 -3
- package/build/components/collab-sidebar/board-store.cjs +103 -0
- package/build/components/collab-sidebar/board-store.cjs.map +7 -0
- package/build/components/collab-sidebar/comment-form.cjs +2 -10
- package/build/components/collab-sidebar/comment-form.cjs.map +2 -2
- package/build/components/collab-sidebar/comments.cjs +29 -149
- package/build/components/collab-sidebar/comments.cjs.map +3 -3
- package/build/components/collab-sidebar/floating-container.cjs +62 -0
- package/build/components/collab-sidebar/floating-container.cjs.map +7 -0
- package/build/components/collab-sidebar/hooks.cjs +49 -41
- package/build/components/collab-sidebar/hooks.cjs.map +2 -2
- package/build/components/collab-sidebar/index.cjs +2 -13
- package/build/components/collab-sidebar/index.cjs.map +2 -2
- package/build/components/collab-sidebar/utils.cjs +72 -4
- package/build/components/collab-sidebar/utils.cjs.map +2 -2
- package/build/components/collaborators-presence/avatar/component.cjs.map +1 -1
- package/build/components/collaborators-presence/index.cjs +3 -3
- package/build/components/collaborators-presence/index.cjs.map +2 -2
- package/build/components/collaborators-presence/list.cjs +3 -3
- package/build/components/collaborators-presence/list.cjs.map +2 -2
- package/build/components/media-categories/index.cjs +1 -1
- package/build/components/media-categories/index.cjs.map +1 -1
- package/build/components/more-menu/index.cjs +1 -1
- package/build/components/more-menu/index.cjs.map +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.cjs +1 -1
- package/build/components/post-publish-panel/maybe-upload-media.cjs.map +1 -1
- package/build/components/style-book/constants.cjs +1 -1
- package/build/components/style-book/constants.cjs.map +1 -1
- package/build/components/style-book/index.cjs +1 -1
- package/build/components/style-book/index.cjs.map +1 -1
- package/build-module/components/collab-sidebar/add-comment.mjs +8 -27
- package/build-module/components/collab-sidebar/add-comment.mjs.map +2 -2
- package/build-module/components/collab-sidebar/board-store.mjs +78 -0
- package/build-module/components/collab-sidebar/board-store.mjs.map +7 -0
- package/build-module/components/collab-sidebar/comment-form.mjs +4 -12
- package/build-module/components/collab-sidebar/comment-form.mjs.map +2 -2
- package/build-module/components/collab-sidebar/comments.mjs +30 -151
- package/build-module/components/collab-sidebar/comments.mjs.map +2 -2
- package/build-module/components/collab-sidebar/floating-container.mjs +27 -0
- package/build-module/components/collab-sidebar/floating-container.mjs.map +7 -0
- package/build-module/components/collab-sidebar/hooks.mjs +51 -44
- package/build-module/components/collab-sidebar/hooks.mjs.map +2 -2
- package/build-module/components/collab-sidebar/index.mjs +2 -13
- package/build-module/components/collab-sidebar/index.mjs.map +2 -2
- package/build-module/components/collab-sidebar/utils.mjs +71 -3
- package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
- package/build-module/components/collaborators-presence/avatar/component.mjs.map +1 -1
- package/build-module/components/collaborators-presence/index.mjs +3 -3
- package/build-module/components/collaborators-presence/index.mjs.map +2 -2
- package/build-module/components/collaborators-presence/list.mjs +3 -3
- package/build-module/components/collaborators-presence/list.mjs.map +2 -2
- package/build-module/components/media-categories/index.mjs +1 -1
- package/build-module/components/media-categories/index.mjs.map +1 -1
- package/build-module/components/more-menu/index.mjs +1 -1
- package/build-module/components/more-menu/index.mjs.map +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.mjs +1 -1
- package/build-module/components/post-publish-panel/maybe-upload-media.mjs.map +1 -1
- package/build-module/components/style-book/constants.mjs +1 -1
- package/build-module/components/style-book/constants.mjs.map +1 -1
- package/build-module/components/style-book/index.mjs +1 -1
- package/build-module/components/style-book/index.mjs.map +1 -1
- package/build-style/style-rtl.css +12 -30
- package/build-style/style.css +12 -30
- package/build-types/components/collab-sidebar/add-comment.d.ts +2 -6
- package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/board-store.d.ts +8 -0
- package/build-types/components/collab-sidebar/board-store.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/comment-form.d.ts +1 -3
- package/build-types/components/collab-sidebar/comment-form.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/comments.d.ts +1 -3
- package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
- package/build-types/components/collab-sidebar/floating-container.d.ts +8 -0
- package/build-types/components/collab-sidebar/floating-container.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/hooks.d.ts +13 -9
- 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 +27 -4
- package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
- package/build-types/components/style-book/constants.d.ts +1 -1
- package/build-types/components/style-book/constants.d.ts.map +1 -1
- package/package.json +45 -45
- package/src/components/collab-sidebar/add-comment.js +9 -31
- package/src/components/collab-sidebar/board-store.js +83 -0
- package/src/components/collab-sidebar/comment-form.js +5 -14
- package/src/components/collab-sidebar/comments.js +29 -202
- package/src/components/collab-sidebar/floating-container.js +29 -0
- package/src/components/collab-sidebar/hooks.js +60 -48
- package/src/components/collab-sidebar/index.js +3 -14
- package/src/components/collab-sidebar/test/utils.js +153 -0
- package/src/components/collab-sidebar/utils.js +112 -4
- package/src/components/collaborators-presence/avatar/component.tsx +1 -1
- package/src/components/collaborators-presence/styles/collaborators-list.scss +1 -1
- package/src/components/collaborators-presence/styles/collaborators-presence.scss +1 -1
- package/src/components/document-outline/style.scss +1 -1
- package/src/components/media-categories/index.js +1 -1
- package/src/components/more-menu/index.js +1 -1
- package/src/components/post-publish-panel/maybe-upload-media.js +1 -1
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
- package/src/components/post-revisions-preview/style.scss +1 -1
- package/src/components/style-book/constants.ts +1 -1
- package/src/components/style-book/index.js +1 -1
- package/src/components/template-actions-panel/style.scss +1 -1
|
@@ -38,12 +38,9 @@ function NotesSidebarContent( {
|
|
|
38
38
|
styles,
|
|
39
39
|
comments,
|
|
40
40
|
commentSidebarRef,
|
|
41
|
-
reflowComments,
|
|
42
|
-
commentLastUpdated,
|
|
43
41
|
isFloating = false,
|
|
44
42
|
} ) {
|
|
45
|
-
const { onCreate, onEdit, onDelete } =
|
|
46
|
-
useBlockCommentsActions( reflowComments );
|
|
43
|
+
const { onCreate, onEdit, onDelete } = useBlockCommentsActions();
|
|
47
44
|
|
|
48
45
|
return (
|
|
49
46
|
<VStack
|
|
@@ -70,8 +67,6 @@ function NotesSidebarContent( {
|
|
|
70
67
|
onAddReply={ onCreate }
|
|
71
68
|
onCommentDelete={ onDelete }
|
|
72
69
|
commentSidebarRef={ commentSidebarRef }
|
|
73
|
-
reflowComments={ reflowComments }
|
|
74
|
-
commentLastUpdated={ commentLastUpdated }
|
|
75
70
|
isFloating={ isFloating }
|
|
76
71
|
/>
|
|
77
72
|
</VStack>
|
|
@@ -119,12 +114,8 @@ function NotesSidebar( { postId } ) {
|
|
|
119
114
|
[]
|
|
120
115
|
);
|
|
121
116
|
|
|
122
|
-
const {
|
|
123
|
-
|
|
124
|
-
unresolvedSortedThreads,
|
|
125
|
-
reflowComments,
|
|
126
|
-
commentLastUpdated,
|
|
127
|
-
} = useBlockComments( postId );
|
|
117
|
+
const { resultComments, unresolvedSortedThreads } =
|
|
118
|
+
useBlockComments( postId );
|
|
128
119
|
|
|
129
120
|
// Only enable the floating sidebar for large viewports.
|
|
130
121
|
const showFloatingSidebar = isLargeViewport;
|
|
@@ -239,8 +230,6 @@ function NotesSidebar( { postId } ) {
|
|
|
239
230
|
<NotesSidebarContent
|
|
240
231
|
comments={ unresolvedSortedThreads }
|
|
241
232
|
commentSidebarRef={ commentSidebarRef }
|
|
242
|
-
reflowComments={ reflowComments }
|
|
243
|
-
commentLastUpdated={ commentLastUpdated }
|
|
244
233
|
styles={ {
|
|
245
234
|
backgroundColor,
|
|
246
235
|
} }
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { calculateAllOffsets } from '../utils';
|
|
5
|
+
|
|
6
|
+
function makeRect( top ) {
|
|
7
|
+
return { top };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
describe( 'calculateAllOffsets', () => {
|
|
11
|
+
it( 'returns empty offsets when no threads match blockRects', () => {
|
|
12
|
+
const { offsets, minHeight } = calculateAllOffsets( {
|
|
13
|
+
threads: [ { id: 1 } ],
|
|
14
|
+
selectedNoteId: undefined,
|
|
15
|
+
blockRects: {},
|
|
16
|
+
heights: {},
|
|
17
|
+
} );
|
|
18
|
+
expect( offsets ).toEqual( {} );
|
|
19
|
+
expect( minHeight ).toBe( 0 );
|
|
20
|
+
} );
|
|
21
|
+
|
|
22
|
+
it( 'assigns default offset when there is no selected thread', () => {
|
|
23
|
+
const threads = [ { id: 1 }, { id: 2 }, { id: 3 } ];
|
|
24
|
+
const blockRects = {
|
|
25
|
+
1: makeRect( 100 ),
|
|
26
|
+
2: makeRect( 300 ),
|
|
27
|
+
3: makeRect( 500 ),
|
|
28
|
+
};
|
|
29
|
+
const heights = { 1: 50, 2: 50, 3: 50 };
|
|
30
|
+
|
|
31
|
+
const { offsets } = calculateAllOffsets( {
|
|
32
|
+
threads,
|
|
33
|
+
selectedNoteId: undefined,
|
|
34
|
+
blockRects,
|
|
35
|
+
heights,
|
|
36
|
+
} );
|
|
37
|
+
|
|
38
|
+
// With no selected thread, breakIndex falls back to 0 (first thread).
|
|
39
|
+
expect( offsets[ 1 ] ).toBe( -16 );
|
|
40
|
+
// Non-overlapping threads get the default offset.
|
|
41
|
+
expect( offsets[ 2 ] ).toBe( -16 );
|
|
42
|
+
expect( offsets[ 3 ] ).toBe( -16 );
|
|
43
|
+
} );
|
|
44
|
+
|
|
45
|
+
it( 'pushes neighbors below the selected thread downward when overlapping', () => {
|
|
46
|
+
const threads = [ { id: 1 }, { id: 2 }, { id: 3 } ];
|
|
47
|
+
// Thread 2 selected; thread 3 starts inside thread 2's space.
|
|
48
|
+
const blockRects = {
|
|
49
|
+
1: makeRect( 100 ),
|
|
50
|
+
2: makeRect( 200 ),
|
|
51
|
+
3: makeRect( 220 ),
|
|
52
|
+
};
|
|
53
|
+
const heights = { 1: 50, 2: 80, 3: 50 };
|
|
54
|
+
|
|
55
|
+
const { offsets } = calculateAllOffsets( {
|
|
56
|
+
threads,
|
|
57
|
+
selectedNoteId: 2,
|
|
58
|
+
blockRects,
|
|
59
|
+
heights,
|
|
60
|
+
} );
|
|
61
|
+
|
|
62
|
+
expect( offsets[ 2 ] ).toBe( -16 );
|
|
63
|
+
// thread 3 overlaps thread 2: previous bottom = (200-16)+80 = 264.
|
|
64
|
+
// 220 < 264+16 = 280, so offset = 264 - 220 + 20 = 64.
|
|
65
|
+
expect( offsets[ 3 ] ).toBe( 64 );
|
|
66
|
+
} );
|
|
67
|
+
|
|
68
|
+
it( 'pushes neighbors above the selected thread upward when overlapping', () => {
|
|
69
|
+
const threads = [ { id: 1 }, { id: 2 } ];
|
|
70
|
+
// Thread 1 is tall and overlaps where thread 2 sits.
|
|
71
|
+
const blockRects = {
|
|
72
|
+
1: makeRect( 150 ),
|
|
73
|
+
2: makeRect( 180 ),
|
|
74
|
+
};
|
|
75
|
+
const heights = { 1: 60, 2: 50 };
|
|
76
|
+
|
|
77
|
+
const { offsets } = calculateAllOffsets( {
|
|
78
|
+
threads,
|
|
79
|
+
selectedNoteId: 2,
|
|
80
|
+
blockRects,
|
|
81
|
+
heights,
|
|
82
|
+
} );
|
|
83
|
+
|
|
84
|
+
expect( offsets[ 2 ] ).toBe( -16 );
|
|
85
|
+
// Thread 1 bottom = 150 + 60 = 210, next threadTop = 180 - 16 = 164.
|
|
86
|
+
// 210 > 164, so offset = 164 - 150 - 60 - 20 = -66.
|
|
87
|
+
expect( offsets[ 1 ] ).toBe( -66 );
|
|
88
|
+
} );
|
|
89
|
+
|
|
90
|
+
it( 'cascades overlap adjustment across multiple threads below', () => {
|
|
91
|
+
const threads = [ { id: 1 }, { id: 2 }, { id: 3 } ];
|
|
92
|
+
// All three threads are tightly packed.
|
|
93
|
+
const blockRects = {
|
|
94
|
+
1: makeRect( 100 ),
|
|
95
|
+
2: makeRect( 110 ),
|
|
96
|
+
3: makeRect( 120 ),
|
|
97
|
+
};
|
|
98
|
+
const heights = { 1: 80, 2: 80, 3: 80 };
|
|
99
|
+
|
|
100
|
+
const { offsets } = calculateAllOffsets( {
|
|
101
|
+
threads,
|
|
102
|
+
selectedNoteId: 1,
|
|
103
|
+
blockRects,
|
|
104
|
+
heights,
|
|
105
|
+
} );
|
|
106
|
+
|
|
107
|
+
expect( offsets[ 1 ] ).toBe( -16 );
|
|
108
|
+
// Thread 2: previous bottom = (100-16)+80 = 164. 110 < 164+16, offset = 164-110+20 = 74.
|
|
109
|
+
expect( offsets[ 2 ] ).toBe( 74 );
|
|
110
|
+
// Thread 3: previous bottom = (110+74)+80 = 264. 120 < 264+16, offset = 264-120+20 = 164.
|
|
111
|
+
expect( offsets[ 3 ] ).toBe( 164 );
|
|
112
|
+
} );
|
|
113
|
+
|
|
114
|
+
it( 'skips threads with missing blockRects', () => {
|
|
115
|
+
const threads = [ { id: 1 }, { id: 2 }, { id: 3 } ];
|
|
116
|
+
const blockRects = {
|
|
117
|
+
1: makeRect( 100 ),
|
|
118
|
+
// id 2 is missing
|
|
119
|
+
3: makeRect( 500 ),
|
|
120
|
+
};
|
|
121
|
+
const heights = { 1: 50, 3: 50 };
|
|
122
|
+
|
|
123
|
+
const { offsets } = calculateAllOffsets( {
|
|
124
|
+
threads,
|
|
125
|
+
selectedNoteId: 1,
|
|
126
|
+
blockRects,
|
|
127
|
+
heights,
|
|
128
|
+
} );
|
|
129
|
+
|
|
130
|
+
expect( offsets[ 1 ] ).toBe( -16 );
|
|
131
|
+
expect( offsets[ 2 ] ).toBeUndefined();
|
|
132
|
+
expect( offsets[ 3 ] ).toBe( -16 );
|
|
133
|
+
} );
|
|
134
|
+
|
|
135
|
+
it( 'computes minHeight from the last thread position', () => {
|
|
136
|
+
const threads = [ { id: 1 }, { id: 2 } ];
|
|
137
|
+
const blockRects = {
|
|
138
|
+
1: makeRect( 100 ),
|
|
139
|
+
2: makeRect( 400 ),
|
|
140
|
+
};
|
|
141
|
+
const heights = { 1: 50, 2: 60 };
|
|
142
|
+
|
|
143
|
+
const { minHeight } = calculateAllOffsets( {
|
|
144
|
+
threads,
|
|
145
|
+
selectedNoteId: 1,
|
|
146
|
+
blockRects,
|
|
147
|
+
heights,
|
|
148
|
+
} );
|
|
149
|
+
|
|
150
|
+
// Last thread: top=400, height=60, offset=-16, + 32 = 476.
|
|
151
|
+
expect( minHeight ).toBe( 476 );
|
|
152
|
+
} );
|
|
153
|
+
} );
|
|
@@ -13,10 +13,10 @@ export function sanitizeCommentString( str ) {
|
|
|
13
13
|
return str.trim();
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const THREAD_ALIGN_OFFSET = -16;
|
|
17
|
+
const THREAD_GAP = 16;
|
|
18
|
+
const OVERLAP_MARGIN = 20;
|
|
19
|
+
const BOARD_BOTTOM_PADDING = 32;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Avatar border colors chosen to be visually distinct from each other and from
|
|
@@ -91,6 +91,114 @@ export function getCommentExcerpt( text, excerptLength = 10 ) {
|
|
|
91
91
|
return isTrimmed ? trimmedExcerpt + '…' : trimmedExcerpt;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Calculate y offsets for all floating comment threads. Adjusts positions
|
|
96
|
+
* to prevent overlapping by pushing threads above the selected one upward
|
|
97
|
+
* and threads below it downward.
|
|
98
|
+
*
|
|
99
|
+
* @param {Object} params
|
|
100
|
+
* @param {Array} params.threads Ordered list of thread objects.
|
|
101
|
+
* @param {string|number|undefined} params.selectedNoteId ID of the currently selected thread.
|
|
102
|
+
* @param {Object<string,DOMRect>} params.blockRects Pre-read bounding rects keyed by thread ID.
|
|
103
|
+
* @param {Object<string,number>} params.heights Rendered heights keyed by thread ID.
|
|
104
|
+
* @return {{ offsets: Object<string,number>, minHeight: number }} Computed offsets and minimum editor height.
|
|
105
|
+
*/
|
|
106
|
+
export function calculateAllOffsets( {
|
|
107
|
+
threads,
|
|
108
|
+
selectedNoteId,
|
|
109
|
+
blockRects,
|
|
110
|
+
heights,
|
|
111
|
+
} ) {
|
|
112
|
+
const offsets = {};
|
|
113
|
+
|
|
114
|
+
const anchorIndex = Math.max(
|
|
115
|
+
0,
|
|
116
|
+
threads.findIndex( ( thread ) => thread.id === selectedNoteId )
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
const anchorThread = threads[ anchorIndex ];
|
|
120
|
+
|
|
121
|
+
if ( ! anchorThread || ! blockRects[ anchorThread.id ] ) {
|
|
122
|
+
return { offsets, minHeight: 0 };
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const anchorRect = blockRects[ anchorThread.id ];
|
|
126
|
+
const anchorTop = anchorRect.top || 0;
|
|
127
|
+
const anchorHeight = heights[ anchorThread.id ] || 0;
|
|
128
|
+
|
|
129
|
+
offsets[ anchorThread.id ] = THREAD_ALIGN_OFFSET;
|
|
130
|
+
|
|
131
|
+
// Process threads after the anchor, offsetting overlapping threads downward.
|
|
132
|
+
let prevAdjustedTop = anchorTop + THREAD_ALIGN_OFFSET;
|
|
133
|
+
let prevHeight = anchorHeight;
|
|
134
|
+
|
|
135
|
+
for ( let i = anchorIndex + 1; i < threads.length; i++ ) {
|
|
136
|
+
const thread = threads[ i ];
|
|
137
|
+
const threadRect = blockRects[ thread.id ];
|
|
138
|
+
if ( ! threadRect ) {
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const threadTop = threadRect.top || 0;
|
|
143
|
+
const threadHeight = heights[ thread.id ] || 0;
|
|
144
|
+
|
|
145
|
+
let offset = THREAD_ALIGN_OFFSET;
|
|
146
|
+
|
|
147
|
+
const prevBottom = prevAdjustedTop + prevHeight;
|
|
148
|
+
if ( threadTop < prevBottom + THREAD_GAP ) {
|
|
149
|
+
offset = prevBottom - threadTop + OVERLAP_MARGIN;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
offsets[ thread.id ] = offset;
|
|
153
|
+
|
|
154
|
+
prevAdjustedTop = threadTop + offset;
|
|
155
|
+
prevHeight = threadHeight;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Process threads before the anchor, offsetting overlapping threads upward.
|
|
159
|
+
let belowAdjustedTop = anchorTop + THREAD_ALIGN_OFFSET;
|
|
160
|
+
|
|
161
|
+
for ( let i = anchorIndex - 1; i >= 0; i-- ) {
|
|
162
|
+
const thread = threads[ i ];
|
|
163
|
+
const threadRect = blockRects[ thread.id ];
|
|
164
|
+
if ( ! threadRect ) {
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const threadTop = threadRect.top || 0;
|
|
169
|
+
const threadHeight = heights[ thread.id ] || 0;
|
|
170
|
+
|
|
171
|
+
let offset = THREAD_ALIGN_OFFSET;
|
|
172
|
+
|
|
173
|
+
const threadBottom = threadTop + threadHeight;
|
|
174
|
+
|
|
175
|
+
if ( threadBottom > belowAdjustedTop ) {
|
|
176
|
+
offset =
|
|
177
|
+
belowAdjustedTop - threadTop - threadHeight - OVERLAP_MARGIN;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
offsets[ thread.id ] = offset;
|
|
181
|
+
|
|
182
|
+
belowAdjustedTop = threadTop + offset;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
let editorMinHeight = 0;
|
|
186
|
+
const lastThread = threads[ threads.length - 1 ];
|
|
187
|
+
const lastBlockRect = blockRects[ lastThread.id ];
|
|
188
|
+
if ( lastBlockRect ) {
|
|
189
|
+
const lastThreadTop = lastBlockRect.top || 0;
|
|
190
|
+
const lastThreadHeight = heights[ lastThread.id ] || 0;
|
|
191
|
+
const lastThreadOffset = offsets[ lastThread.id ] || 0;
|
|
192
|
+
editorMinHeight =
|
|
193
|
+
lastThreadTop +
|
|
194
|
+
lastThreadHeight +
|
|
195
|
+
lastThreadOffset +
|
|
196
|
+
BOARD_BOTTOM_PADDING;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return { offsets, minHeight: editorMinHeight };
|
|
200
|
+
}
|
|
201
|
+
|
|
94
202
|
/**
|
|
95
203
|
* Shift focus to the comment thread associated with a particular comment ID.
|
|
96
204
|
* If an additional selector is provided, the focus will be shifted to the element matching the selector.
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
.editor-collaborators-presence__button.editor-collaborators-presence__button.components-button {
|
|
23
23
|
display: flex;
|
|
24
24
|
align-items: center;
|
|
25
|
-
cursor:
|
|
25
|
+
cursor: var(--wpds-cursor-control);
|
|
26
26
|
position: relative;
|
|
27
27
|
padding: $grid-unit-05;
|
|
28
28
|
border-radius: $grid-unit-05;
|
|
@@ -26,7 +26,7 @@ const getExternalLink = ( url, text ) =>
|
|
|
26
26
|
`<a ${ getExternalLinkAttributes( url ) }>${ text }</a>`;
|
|
27
27
|
|
|
28
28
|
const getExternalLinkAttributes = ( url ) =>
|
|
29
|
-
`href="${ url }" target="_blank" rel="
|
|
29
|
+
`href="${ url }" target="_blank" rel="noopener"`;
|
|
30
30
|
|
|
31
31
|
const getOpenverseLicense = ( license, licenseVersion ) => {
|
|
32
32
|
let licenseName = license.trim();
|
|
@@ -132,7 +132,7 @@ export default function MoreMenu( { disabled = false } ) {
|
|
|
132
132
|
'https://wordpress.org/documentation/article/wordpress-block-editor/'
|
|
133
133
|
) }
|
|
134
134
|
target="_blank"
|
|
135
|
-
rel="noopener
|
|
135
|
+
rel="noopener"
|
|
136
136
|
>
|
|
137
137
|
{ __( 'Help' ) }
|
|
138
138
|
<VisuallyHidden as="span">
|
|
@@ -89,7 +89,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
|
|
|
89
89
|
<a
|
|
90
90
|
class="components-external-link"
|
|
91
91
|
href="https://wordpress.local/sample-page/"
|
|
92
|
-
rel="external
|
|
92
|
+
rel="external noopener"
|
|
93
93
|
target="_blank"
|
|
94
94
|
>
|
|
95
95
|
<span
|
|
@@ -316,7 +316,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
|
|
|
316
316
|
<a
|
|
317
317
|
class="components-external-link"
|
|
318
318
|
href="https://wordpress.local/sample-page/"
|
|
319
|
-
rel="external
|
|
319
|
+
rel="external noopener"
|
|
320
320
|
target="_blank"
|
|
321
321
|
>
|
|
322
322
|
<span
|
|
@@ -620,7 +620,7 @@ export const StyleBookBody = ( {
|
|
|
620
620
|
<style>
|
|
621
621
|
{ STYLE_BOOK_IFRAME_STYLES }
|
|
622
622
|
{ !! onClick &&
|
|
623
|
-
'body { cursor:
|
|
623
|
+
'body { cursor: var(--wpds-cursor-control); } body * { pointer-events: none; }' }
|
|
624
624
|
</style>
|
|
625
625
|
<Examples
|
|
626
626
|
className="editor-style-book__examples"
|