@wordpress/editor 12.2.1 → 12.4.0-next.e230fbab09.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 (152) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/components/deprecated.js +1 -1
  3. package/build/components/deprecated.js.map +1 -1
  4. package/build/components/deprecated.native.js.map +1 -1
  5. package/build/components/editor-help/index.native.js.map +1 -1
  6. package/build/components/entities-saved-states/entity-record-item.js +1 -1
  7. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  8. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +1 -1
  9. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  10. package/build/components/index.js.map +1 -1
  11. package/build/components/index.native.js.map +1 -1
  12. package/build/components/local-autosave-monitor/index.js +5 -5
  13. package/build/components/local-autosave-monitor/index.js.map +1 -1
  14. package/build/components/post-featured-image/index.js +4 -4
  15. package/build/components/post-featured-image/index.js.map +1 -1
  16. package/build/components/post-last-revision/index.js +3 -3
  17. package/build/components/post-last-revision/index.js.map +1 -1
  18. package/build/components/post-locked-modal/index.js +1 -3
  19. package/build/components/post-locked-modal/index.js.map +1 -1
  20. package/build/components/post-saved-state/index.js +1 -1
  21. package/build/components/post-saved-state/index.js.map +1 -1
  22. package/build/components/post-schedule/index.js +3 -3
  23. package/build/components/post-schedule/index.js.map +1 -1
  24. package/build/components/post-slug/index.js +2 -4
  25. package/build/components/post-slug/index.js.map +1 -1
  26. package/build/components/post-switch-to-draft-button/index.js +19 -14
  27. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  28. package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -2
  29. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  30. package/build/components/post-title/index.native.js +2 -2
  31. package/build/components/post-title/index.native.js.map +1 -1
  32. package/build/components/post-trash/index.js +15 -29
  33. package/build/components/post-trash/index.js.map +1 -1
  34. package/build/components/provider/index.js +1 -1
  35. package/build/components/provider/index.js.map +1 -1
  36. package/build/components/provider/index.native.js +24 -15
  37. package/build/components/provider/index.native.js.map +1 -1
  38. package/build/components/provider/use-block-editor-settings.js +3 -8
  39. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  40. package/build/store/actions.js +231 -225
  41. package/build/store/actions.js.map +1 -1
  42. package/build/store/actions.native.js +6 -4
  43. package/build/store/actions.native.js.map +1 -1
  44. package/build/store/index.js +1 -8
  45. package/build/store/index.js.map +1 -1
  46. package/build/store/{controls.js → local-autosave.js} +1 -18
  47. package/build/store/local-autosave.js.map +1 -0
  48. package/build/store/reducer.js +0 -2
  49. package/build/store/reducer.js.map +1 -1
  50. package/build/store/selectors.js +8 -10
  51. package/build/store/selectors.js.map +1 -1
  52. package/build/store/utils/notice-builder.js +9 -4
  53. package/build/store/utils/notice-builder.js.map +1 -1
  54. package/build/utils/url.js +9 -26
  55. package/build/utils/url.js.map +1 -1
  56. package/build-module/components/deprecated.js +1 -1
  57. package/build-module/components/deprecated.js.map +1 -1
  58. package/build-module/components/deprecated.native.js +1 -1
  59. package/build-module/components/deprecated.native.js.map +1 -1
  60. package/build-module/components/editor-help/index.native.js.map +1 -1
  61. package/build-module/components/entities-saved-states/entity-record-item.js +1 -1
  62. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  63. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +1 -1
  64. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  65. package/build-module/components/index.js +3 -3
  66. package/build-module/components/index.js.map +1 -1
  67. package/build-module/components/index.native.js +3 -3
  68. package/build-module/components/index.native.js.map +1 -1
  69. package/build-module/components/local-autosave-monitor/index.js +1 -1
  70. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  71. package/build-module/components/post-featured-image/index.js +4 -4
  72. package/build-module/components/post-featured-image/index.js.map +1 -1
  73. package/build-module/components/post-last-revision/index.js +2 -2
  74. package/build-module/components/post-last-revision/index.js.map +1 -1
  75. package/build-module/components/post-locked-modal/index.js +1 -2
  76. package/build-module/components/post-locked-modal/index.js.map +1 -1
  77. package/build-module/components/post-saved-state/index.js +1 -1
  78. package/build-module/components/post-saved-state/index.js.map +1 -1
  79. package/build-module/components/post-schedule/index.js +3 -3
  80. package/build-module/components/post-schedule/index.js.map +1 -1
  81. package/build-module/components/post-slug/index.js +1 -2
  82. package/build-module/components/post-slug/index.js.map +1 -1
  83. package/build-module/components/post-switch-to-draft-button/index.js +22 -16
  84. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  85. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +2 -2
  86. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  87. package/build-module/components/post-title/index.native.js +2 -2
  88. package/build-module/components/post-title/index.native.js.map +1 -1
  89. package/build-module/components/post-trash/index.js +15 -27
  90. package/build-module/components/post-trash/index.js.map +1 -1
  91. package/build-module/components/provider/index.js +1 -1
  92. package/build-module/components/provider/index.js.map +1 -1
  93. package/build-module/components/provider/index.native.js +26 -17
  94. package/build-module/components/provider/index.native.js.map +1 -1
  95. package/build-module/components/provider/use-block-editor-settings.js +3 -8
  96. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  97. package/build-module/store/actions.js +208 -207
  98. package/build-module/store/actions.js.map +1 -1
  99. package/build-module/store/actions.native.js +3 -3
  100. package/build-module/store/actions.native.js.map +1 -1
  101. package/build-module/store/index.js +1 -6
  102. package/build-module/store/index.js.map +1 -1
  103. package/build-module/store/{controls.js → local-autosave.js} +1 -15
  104. package/build-module/store/local-autosave.js.map +1 -0
  105. package/build-module/store/reducer.js +0 -2
  106. package/build-module/store/reducer.js.map +1 -1
  107. package/build-module/store/selectors.js +8 -9
  108. package/build-module/store/selectors.js.map +1 -1
  109. package/build-module/store/utils/notice-builder.js +9 -4
  110. package/build-module/store/utils/notice-builder.js.map +1 -1
  111. package/build-module/utils/url.js +8 -25
  112. package/build-module/utils/url.js.map +1 -1
  113. package/package.json +26 -27
  114. package/src/components/deprecated.js +1 -1
  115. package/src/components/deprecated.native.js +1 -1
  116. package/src/components/document-outline/test/index.js +1 -1
  117. package/src/components/editor-help/index.native.js +2 -2
  118. package/src/components/entities-saved-states/entity-record-item.js +1 -1
  119. package/src/components/global-keyboard-shortcuts/register-shortcuts.js +1 -1
  120. package/src/components/index.js +3 -3
  121. package/src/components/index.native.js +3 -3
  122. package/src/components/local-autosave-monitor/index.js +4 -1
  123. package/src/components/post-author/test/check.js +1 -1
  124. package/src/components/post-featured-image/index.js +4 -4
  125. package/src/components/post-last-revision/index.js +2 -2
  126. package/src/components/post-locked-modal/index.js +1 -2
  127. package/src/components/post-saved-state/index.js +1 -1
  128. package/src/components/post-saved-state/test/index.js +2 -2
  129. package/src/components/post-schedule/index.js +3 -3
  130. package/src/components/post-slug/index.js +1 -2
  131. package/src/components/post-switch-to-draft-button/index.js +35 -24
  132. package/src/components/post-taxonomies/hierarchical-term-selector.js +2 -2
  133. package/src/components/post-text-editor/test/index.js +1 -1
  134. package/src/components/post-title/index.native.js +2 -2
  135. package/src/components/post-trash/index.js +12 -24
  136. package/src/components/provider/index.js +1 -1
  137. package/src/components/provider/index.native.js +27 -23
  138. package/src/components/provider/use-block-editor-settings.js +3 -14
  139. package/src/store/actions.js +137 -249
  140. package/src/store/actions.native.js +3 -3
  141. package/src/store/index.js +0 -6
  142. package/src/store/{controls.js → local-autosave.js} +0 -8
  143. package/src/store/reducer.js +0 -2
  144. package/src/store/selectors.js +8 -9
  145. package/src/store/test/actions.js +244 -416
  146. package/src/store/test/selectors.js +1 -1
  147. package/src/store/utils/notice-builder.js +9 -4
  148. package/src/store/utils/test/notice-builder.js +1 -0
  149. package/src/utils/url.js +8 -30
  150. package/build/store/controls.js.map +0 -1
  151. package/build-module/store/controls.js.map +0 -1
  152. package/src/utils/test/url.js +0 -22
@@ -13,7 +13,7 @@ import {
13
13
  __unstableSerializeAndClean,
14
14
  } from '@wordpress/blocks';
15
15
  import { isInTheFuture, getDate } from '@wordpress/date';
16
- import { addQueryArgs } from '@wordpress/url';
16
+ import { addQueryArgs, cleanForSlug } from '@wordpress/url';
17
17
  import { createRegistrySelector } from '@wordpress/data';
18
18
  import deprecated from '@wordpress/deprecated';
19
19
  import { Platform } from '@wordpress/element';
@@ -32,7 +32,6 @@ import {
32
32
  AUTOSAVE_PROPERTIES,
33
33
  } from './constants';
34
34
  import { getPostRawValue } from './reducer';
35
- import { cleanForSlug } from '../utils/url';
36
35
  import { getTemplatePartIcon } from '../utils/get-template-part-icon';
37
36
 
38
37
  /**
@@ -336,7 +335,7 @@ const getNestedEditedPostProperty = ( state, attributeName ) => {
336
335
  * @return {*} Post attribute value.
337
336
  */
338
337
  export function getEditedPostAttribute( state, attributeName ) {
339
- // Special cases
338
+ // Special cases.
340
339
  switch ( attributeName ) {
341
340
  case 'content':
342
341
  return getEditedPostContent( state );
@@ -477,7 +476,7 @@ export function isEditedPostPublishable( state ) {
477
476
  // TODO: Post being publishable should be superset of condition of post
478
477
  // being saveable. Currently this restriction is imposed at UI.
479
478
  //
480
- // See: <PostPublishButton /> (`isButtonEnabled` assigned by `isSaveable`)
479
+ // See: <PostPublishButton /> (`isButtonEnabled` assigned by `isSaveable`).
481
480
 
482
481
  return (
483
482
  isEditedPostDirty( state ) ||
@@ -506,7 +505,7 @@ export function isEditedPostSaveable( state ) {
506
505
  // See: `isEditedPostPublishable` (includes `isEditedPostDirty` condition)
507
506
  // See: <PostSavedState /> (`forceIsDirty` prop)
508
507
  // See: <PostPublishButton /> (`forceIsDirty` prop)
509
- // See: https://github.com/WordPress/gutenberg/pull/4184
508
+ // See: https://github.com/WordPress/gutenberg/pull/4184.
510
509
 
511
510
  return (
512
511
  !! getEditedPostAttribute( state, 'title' ) ||
@@ -643,7 +642,7 @@ export const isEditedPostAutosaveable = createRegistrySelector(
643
642
  */
644
643
  export function isEditedPostBeingScheduled( state ) {
645
644
  const date = getEditedPostAttribute( state, 'date' );
646
- // Offset the date by one minute (network latency)
645
+ // Offset the date by one minute (network latency).
647
646
  const checkedDate = new Date(
648
647
  Number( getDate( date ) ) - ONE_MINUTE_IN_MS
649
648
  );
@@ -671,7 +670,7 @@ export function isEditedPostDateFloating( state ) {
671
670
  // This should be the status of the persisted post
672
671
  // It shouldn't use the "edited" status otherwise it breaks the
673
672
  // inferred post data floating status
674
- // See https://github.com/WordPress/gutenberg/issues/28083
673
+ // See https://github.com/WordPress/gutenberg/issues/28083.
675
674
  const status = getCurrentPost( state ).status;
676
675
  if (
677
676
  status === 'draft' ||
@@ -808,7 +807,7 @@ export function getEditedPostPreviewLink( state ) {
808
807
  // If the post is draft, ignore the preview link from the autosave record,
809
808
  // because the preview could be a stale autosave if the post was switched from
810
809
  // published to draft.
811
- // See: https://github.com/WordPress/gutenberg/pull/37952
810
+ // See: https://github.com/WordPress/gutenberg/pull/37952.
812
811
  if ( ! previewLink || 'draft' === getCurrentPost( state ).status ) {
813
812
  previewLink = getEditedPostAttribute( state, 'link' );
814
813
  if ( previewLink ) {
@@ -843,7 +842,7 @@ export function getSuggestedPostFormat( state ) {
843
842
  // so we can derive a suitable post format from it.
844
843
  if ( blocks.length === 1 ) {
845
844
  name = blocks[ 0 ].name;
846
- // check for core/embed `video` and `audio` eligible suggestions
845
+ // Check for core/embed `video` and `audio` eligible suggestions.
847
846
  if ( name === 'core/embed' ) {
848
847
  const provider = blocks[ 0 ].attributes?.providerNameSlug;
849
848
  if ( [ 'youtube', 'vimeo' ].includes( provider ) ) {