@wordpress/editor 14.23.0 → 14.24.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 (44) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/collab-sidebar/comment-form.js +3 -1
  3. package/build/components/collab-sidebar/comment-form.js.map +1 -1
  4. package/build/components/editor-interface/index.js +11 -6
  5. package/build/components/editor-interface/index.js.map +1 -1
  6. package/build/components/post-publish-panel/postpublish.js +11 -3
  7. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  8. package/build/components/template-part-menu-items/convert-to-template-part.js +4 -1
  9. package/build/components/template-part-menu-items/convert-to-template-part.js.map +1 -1
  10. package/build/store/private-actions.js +2 -1
  11. package/build/store/private-actions.js.map +1 -1
  12. package/build/store/utils/notice-builder.js +2 -1
  13. package/build/store/utils/notice-builder.js.map +1 -1
  14. package/build-module/components/collab-sidebar/comment-form.js +4 -2
  15. package/build-module/components/collab-sidebar/comment-form.js.map +1 -1
  16. package/build-module/components/editor-interface/index.js +11 -6
  17. package/build-module/components/editor-interface/index.js.map +1 -1
  18. package/build-module/components/post-publish-panel/postpublish.js +12 -4
  19. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  20. package/build-module/components/template-part-menu-items/convert-to-template-part.js +4 -1
  21. package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +1 -1
  22. package/build-module/store/private-actions.js +2 -1
  23. package/build-module/store/private-actions.js.map +1 -1
  24. package/build-module/store/utils/notice-builder.js +2 -1
  25. package/build-module/store/utils/notice-builder.js.map +1 -1
  26. package/build-style/style-rtl.css +133 -10
  27. package/build-style/style.css +133 -10
  28. package/build-types/components/collab-sidebar/comment-form.d.ts.map +1 -1
  29. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  30. package/build-types/components/post-publish-panel/postpublish.d.ts.map +1 -1
  31. package/build-types/components/template-part-menu-items/convert-to-template-part.d.ts.map +1 -1
  32. package/build-types/store/private-actions.d.ts.map +1 -1
  33. package/build-types/store/utils/notice-builder.d.ts.map +1 -1
  34. package/package.json +37 -37
  35. package/src/components/collab-sidebar/comment-form.js +3 -1
  36. package/src/components/editor-interface/index.js +17 -15
  37. package/src/components/post-publish-panel/postpublish.js +19 -3
  38. package/src/components/post-publish-panel/style.scss +3 -1
  39. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +82 -12
  40. package/src/components/template-part-menu-items/convert-to-template-part.js +5 -2
  41. package/src/store/private-actions.js +1 -0
  42. package/src/store/utils/notice-builder.js +1 -0
  43. package/src/store/utils/test/notice-builder.js +3 -1
  44. package/tsconfig.tsbuildinfo +1 -1
@@ -27,7 +27,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
27
27
  padding: 0;
28
28
  }
29
29
 
30
- .emotion-10 {
30
+ .emotion-12 {
31
31
  display: -webkit-box;
32
32
  display: -webkit-flex;
33
33
  display: -ms-flexbox;
@@ -47,7 +47,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
47
47
  width: 100%;
48
48
  }
49
49
 
50
- .emotion-10>* {
50
+ .emotion-12>* {
51
51
  min-width: 0;
52
52
  }
53
53
 
@@ -87,9 +87,22 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
87
87
  class="components-panel__body post-publish-panel__postpublish-header is-opened"
88
88
  >
89
89
  <a
90
+ class="components-external-link"
90
91
  href="https://wordpress.local/sample-page/"
92
+ rel="external noreferrer noopener"
93
+ target="_blank"
91
94
  >
92
- (no title)
95
+ <span
96
+ class="components-external-link__contents"
97
+ >
98
+ (no title)
99
+ </span>
100
+ <span
101
+ aria-label="(opens in a new tab)"
102
+ class="components-external-link__icon"
103
+ >
104
+
105
+ </span>
93
106
  </a>
94
107
 
95
108
  is now live.
@@ -143,9 +156,31 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
143
156
  class="post-publish-panel__postpublish-buttons"
144
157
  >
145
158
  <a
146
- class="components-button is-next-40px-default-size is-primary"
159
+ class="components-button is-next-40px-default-size is-primary has-icon"
147
160
  href="https://wordpress.local/sample-page/"
148
- />
161
+ target="_blank"
162
+ >
163
+ <span
164
+ class="components-visually-hidden emotion-6 emotion-7"
165
+ data-wp-c16t="true"
166
+ data-wp-component="VisuallyHidden"
167
+ style="border: 0px; clip: rect(1px, 1px, 1px, 1px); clip-path: inset( 50% ); height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; width: 1px; word-wrap: normal;"
168
+ >
169
+ (opens in a new tab)
170
+ </span>
171
+ <svg
172
+ aria-hidden="true"
173
+ focusable="false"
174
+ height="24"
175
+ viewBox="0 0 24 24"
176
+ width="24"
177
+ xmlns="http://www.w3.org/2000/svg"
178
+ >
179
+ <path
180
+ d="M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"
181
+ />
182
+ </svg>
183
+ </a>
149
184
  <a
150
185
  class="components-button is-next-40px-default-size is-secondary"
151
186
  href="post-new.php?"
@@ -164,7 +199,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
164
199
  class="components-base-control__field emotion-2 emotion-3"
165
200
  >
166
201
  <div
167
- class="components-flex components-h-stack emotion-10 emotion-11"
202
+ class="components-flex components-h-stack emotion-12 emotion-7"
168
203
  data-wp-c16t="true"
169
204
  data-wp-component="HStack"
170
205
  >
@@ -219,7 +254,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
219
254
  padding: 0;
220
255
  }
221
256
 
222
- .emotion-10 {
257
+ .emotion-12 {
223
258
  display: -webkit-box;
224
259
  display: -webkit-flex;
225
260
  display: -ms-flexbox;
@@ -239,7 +274,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
239
274
  width: 100%;
240
275
  }
241
276
 
242
- .emotion-10>* {
277
+ .emotion-12>* {
243
278
  min-width: 0;
244
279
  }
245
280
 
@@ -279,9 +314,22 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
279
314
  class="components-panel__body post-publish-panel__postpublish-header is-opened"
280
315
  >
281
316
  <a
317
+ class="components-external-link"
282
318
  href="https://wordpress.local/sample-page/"
319
+ rel="external noreferrer noopener"
320
+ target="_blank"
283
321
  >
284
- (no title)
322
+ <span
323
+ class="components-external-link__contents"
324
+ >
325
+ (no title)
326
+ </span>
327
+ <span
328
+ aria-label="(opens in a new tab)"
329
+ class="components-external-link__icon"
330
+ >
331
+
332
+ </span>
285
333
  </a>
286
334
 
287
335
  is now live.
@@ -335,9 +383,31 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
335
383
  class="post-publish-panel__postpublish-buttons"
336
384
  >
337
385
  <a
338
- class="components-button is-next-40px-default-size is-primary"
386
+ class="components-button is-next-40px-default-size is-primary has-icon"
339
387
  href="https://wordpress.local/sample-page/"
340
- />
388
+ target="_blank"
389
+ >
390
+ <span
391
+ class="components-visually-hidden emotion-6 emotion-7"
392
+ data-wp-c16t="true"
393
+ data-wp-component="VisuallyHidden"
394
+ style="border: 0px; clip: rect(1px, 1px, 1px, 1px); clip-path: inset( 50% ); height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; width: 1px; word-wrap: normal;"
395
+ >
396
+ (opens in a new tab)
397
+ </span>
398
+ <svg
399
+ aria-hidden="true"
400
+ focusable="false"
401
+ height="24"
402
+ viewBox="0 0 24 24"
403
+ width="24"
404
+ xmlns="http://www.w3.org/2000/svg"
405
+ >
406
+ <path
407
+ d="M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"
408
+ />
409
+ </svg>
410
+ </a>
341
411
  <a
342
412
  class="components-button is-next-40px-default-size is-secondary"
343
413
  href="post-new.php?"
@@ -356,7 +426,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
356
426
  class="components-base-control__field emotion-2 emotion-3"
357
427
  >
358
428
  <div
359
- class="components-flex components-h-stack emotion-10 emotion-11"
429
+ class="components-flex components-h-stack emotion-12 emotion-7"
360
430
  data-wp-c16t="true"
361
431
  data-wp-component="HStack"
362
432
  >
@@ -9,6 +9,7 @@ import { __ } from '@wordpress/i18n';
9
9
  import { useState } from '@wordpress/element';
10
10
  import { store as noticesStore } from '@wordpress/notices';
11
11
  import { symbolFilled } from '@wordpress/icons';
12
+ import { store as coreStore } from '@wordpress/core-data';
12
13
 
13
14
  /**
14
15
  * Internal dependencies
@@ -20,8 +21,10 @@ export default function ConvertToTemplatePart( { clientIds, blocks } ) {
20
21
  const { replaceBlocks } = useDispatch( blockEditorStore );
21
22
  const { createSuccessNotice } = useDispatch( noticesStore );
22
23
 
23
- const { canCreate } = useSelect( ( select ) => {
24
+ const { isBlockBasedTheme, canCreate } = useSelect( ( select ) => {
24
25
  return {
26
+ isBlockBasedTheme:
27
+ select( coreStore ).getCurrentTheme()?.is_block_theme,
25
28
  canCreate:
26
29
  select( blockEditorStore ).canInsertBlockType(
27
30
  'core/template-part'
@@ -29,7 +32,7 @@ export default function ConvertToTemplatePart( { clientIds, blocks } ) {
29
32
  };
30
33
  }, [] );
31
34
 
32
- if ( ! canCreate ) {
35
+ if ( ! isBlockBasedTheme || ! canCreate ) {
33
36
  return null;
34
37
  }
35
38
 
@@ -216,6 +216,7 @@ export const saveDirtyEntities =
216
216
  {
217
217
  label: __( 'View site' ),
218
218
  url: homeUrl,
219
+ openInNewTab: true,
219
220
  },
220
221
  ],
221
222
  } );
@@ -58,6 +58,7 @@ export function getNotificationArgumentsForSaveSuccess( data ) {
58
58
  actions.push( {
59
59
  label: isDraft ? __( 'View Preview' ) : postType.labels.view_item,
60
60
  url: post.link,
61
+ openInNewTab: true,
61
62
  } );
62
63
  }
63
64
  return [
@@ -70,7 +70,9 @@ describe( 'getNotificationArgumentsForSaveSuccess()', () => {
70
70
  'updated',
71
71
  {
72
72
  ...defaultExpectedAction,
73
- actions: [ { label: 'view', url: 'some_link' } ],
73
+ actions: [
74
+ { label: 'view', openInNewTab: true, url: 'some_link' },
75
+ ],
74
76
  },
75
77
  ],
76
78
  ],