@wordpress/editor 14.47.0 → 14.48.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.
Files changed (213) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/build/components/block-removal-warnings/index.cjs +0 -3
  3. package/build/components/block-removal-warnings/index.cjs.map +2 -2
  4. package/build/components/collab-sidebar/note-indicator-toolbar.cjs +49 -43
  5. package/build/components/collab-sidebar/note-indicator-toolbar.cjs.map +3 -3
  6. package/build/components/collaborators-overlay/use-block-highlighting.cjs +1 -8
  7. package/build/components/collaborators-overlay/use-block-highlighting.cjs.map +3 -3
  8. package/build/components/collaborators-overlay/use-render-cursors.cjs +1 -7
  9. package/build/components/collaborators-overlay/use-render-cursors.cjs.map +3 -3
  10. package/build/components/more-menu/view-more-menu-group.cjs +1 -2
  11. package/build/components/more-menu/view-more-menu-group.cjs.map +2 -2
  12. package/build/components/page-attributes/parent.cjs +1 -0
  13. package/build/components/page-attributes/parent.cjs.map +2 -2
  14. package/build/components/post-publish-button/index.cjs +114 -157
  15. package/build/components/post-publish-button/index.cjs.map +3 -3
  16. package/build/components/post-revisions-preview/block-diff.cjs +21 -9
  17. package/build/components/post-revisions-preview/block-diff.cjs.map +2 -2
  18. package/build/components/post-revisions-preview/preserve-client-ids.cjs +2 -2
  19. package/build/components/post-revisions-preview/preserve-client-ids.cjs.map +2 -2
  20. package/build/components/provider/index.cjs +2 -0
  21. package/build/components/provider/index.cjs.map +3 -3
  22. package/build/components/provider/use-block-editor-settings.cjs +1 -1
  23. package/build/components/provider/use-block-editor-settings.cjs.map +2 -2
  24. package/build/components/provider/use-network-reconnect.cjs +51 -0
  25. package/build/components/provider/use-network-reconnect.cjs.map +7 -0
  26. package/build/components/revision-fields-diff/index.cjs +2 -2
  27. package/build/components/revision-fields-diff/index.cjs.map +2 -2
  28. package/build/components/sidebar/index.cjs +1 -4
  29. package/build/components/sidebar/index.cjs.map +2 -2
  30. package/build/components/template-actions-panel/block-theme-content.cjs +7 -1
  31. package/build/components/template-actions-panel/block-theme-content.cjs.map +2 -2
  32. package/build/components/upload-progress-snackbar/index.cjs +161 -0
  33. package/build/components/upload-progress-snackbar/index.cjs.map +7 -0
  34. package/build/components/upload-progress-snackbar/tracker.cjs +90 -0
  35. package/build/components/upload-progress-snackbar/tracker.cjs.map +7 -0
  36. package/build/private-apis.cjs +2 -0
  37. package/build/private-apis.cjs.map +3 -3
  38. package/build/store/selectors.cjs +1 -2
  39. package/build/store/selectors.cjs.map +2 -2
  40. package/build/utils/media-upload/index.cjs +16 -0
  41. package/build/utils/media-upload/index.cjs.map +3 -3
  42. package/build-module/components/block-removal-warnings/index.mjs +0 -3
  43. package/build-module/components/block-removal-warnings/index.mjs.map +2 -2
  44. package/build-module/components/collab-sidebar/note-indicator-toolbar.mjs +53 -44
  45. package/build-module/components/collab-sidebar/note-indicator-toolbar.mjs.map +2 -2
  46. package/build-module/components/collaborators-overlay/use-block-highlighting.mjs +1 -8
  47. package/build-module/components/collaborators-overlay/use-block-highlighting.mjs.map +2 -2
  48. package/build-module/components/collaborators-overlay/use-render-cursors.mjs +1 -7
  49. package/build-module/components/collaborators-overlay/use-render-cursors.mjs.map +2 -2
  50. package/build-module/components/more-menu/view-more-menu-group.mjs +1 -2
  51. package/build-module/components/more-menu/view-more-menu-group.mjs.map +2 -2
  52. package/build-module/components/page-attributes/parent.mjs +1 -0
  53. package/build-module/components/page-attributes/parent.mjs.map +2 -2
  54. package/build-module/components/post-publish-button/index.mjs +116 -159
  55. package/build-module/components/post-publish-button/index.mjs.map +2 -2
  56. package/build-module/components/post-revisions-preview/block-diff.mjs +20 -8
  57. package/build-module/components/post-revisions-preview/block-diff.mjs.map +2 -2
  58. package/build-module/components/post-revisions-preview/preserve-client-ids.mjs +1 -1
  59. package/build-module/components/post-revisions-preview/preserve-client-ids.mjs.map +1 -1
  60. package/build-module/components/provider/index.mjs +2 -0
  61. package/build-module/components/provider/index.mjs.map +2 -2
  62. package/build-module/components/provider/use-block-editor-settings.mjs +1 -1
  63. package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
  64. package/build-module/components/provider/use-network-reconnect.mjs +30 -0
  65. package/build-module/components/provider/use-network-reconnect.mjs.map +7 -0
  66. package/build-module/components/revision-fields-diff/index.mjs +2 -2
  67. package/build-module/components/revision-fields-diff/index.mjs.map +2 -2
  68. package/build-module/components/sidebar/index.mjs +2 -11
  69. package/build-module/components/sidebar/index.mjs.map +2 -2
  70. package/build-module/components/template-actions-panel/block-theme-content.mjs +7 -1
  71. package/build-module/components/template-actions-panel/block-theme-content.mjs.map +2 -2
  72. package/build-module/components/upload-progress-snackbar/index.mjs +135 -0
  73. package/build-module/components/upload-progress-snackbar/index.mjs.map +7 -0
  74. package/build-module/components/upload-progress-snackbar/tracker.mjs +61 -0
  75. package/build-module/components/upload-progress-snackbar/tracker.mjs.map +7 -0
  76. package/build-module/private-apis.mjs +2 -0
  77. package/build-module/private-apis.mjs.map +2 -2
  78. package/build-module/store/selectors.mjs +1 -2
  79. package/build-module/store/selectors.mjs.map +2 -2
  80. package/build-module/utils/media-upload/index.mjs +19 -0
  81. package/build-module/utils/media-upload/index.mjs.map +2 -2
  82. package/build-style/style-rtl.css +479 -84
  83. package/build-style/style.css +479 -84
  84. package/build-types/components/block-removal-warnings/index.d.ts.map +1 -1
  85. package/build-types/components/collab-sidebar/add-comment.d.ts +6 -0
  86. package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -0
  87. package/build-types/components/collab-sidebar/comment-author-info.d.ts +8 -0
  88. package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +1 -0
  89. package/build-types/components/collab-sidebar/comment-form.d.ts +9 -0
  90. package/build-types/components/collab-sidebar/comment-form.d.ts.map +1 -0
  91. package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts +6 -0
  92. package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts.map +1 -0
  93. package/build-types/components/collab-sidebar/comment-menu-item.d.ts +6 -0
  94. package/build-types/components/collab-sidebar/comment-menu-item.d.ts.map +1 -0
  95. package/build-types/components/collab-sidebar/comments.d.ts +10 -0
  96. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -0
  97. package/build-types/components/collab-sidebar/note-indicator-toolbar.d.ts.map +1 -1
  98. package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts +0 -3
  99. package/build-types/components/collaborators-overlay/use-block-highlighting.d.ts.map +1 -1
  100. package/build-types/components/collaborators-overlay/use-render-cursors.d.ts.map +1 -1
  101. package/build-types/components/document-bar/index.d.ts +2 -2
  102. package/build-types/components/document-bar/index.d.ts.map +1 -1
  103. package/build-types/components/global-styles-provider/index.d.ts +16 -0
  104. package/build-types/components/global-styles-provider/index.d.ts.map +1 -0
  105. package/build-types/components/media/index.d.ts +3 -0
  106. package/build-types/components/media/index.d.ts.map +1 -0
  107. package/build-types/components/media/metadata-panel.d.ts +12 -0
  108. package/build-types/components/media/metadata-panel.d.ts.map +1 -0
  109. package/build-types/components/media/preview.d.ts +9 -0
  110. package/build-types/components/media/preview.d.ts.map +1 -0
  111. package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
  112. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  113. package/build-types/components/post-locked-modal/index.d.ts +6 -1
  114. package/build-types/components/post-publish-button/index.d.ts +9 -9
  115. package/build-types/components/post-publish-button/index.d.ts.map +1 -1
  116. package/build-types/components/post-revisions-preview/block-diff.d.ts +3 -0
  117. package/build-types/components/post-revisions-preview/block-diff.d.ts.map +1 -1
  118. package/build-types/components/post-taxonomies/flat-term-selector.d.ts +6 -1
  119. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +6 -1
  120. package/build-types/components/post-text-editor/index.d.ts +1 -1
  121. package/build-types/components/post-text-editor/index.d.ts.map +1 -1
  122. package/build-types/components/post-text-editor/utils.d.ts +29 -0
  123. package/build-types/components/post-text-editor/utils.d.ts.map +1 -0
  124. package/build-types/components/provider/index.d.ts.map +1 -1
  125. package/build-types/components/provider/use-network-reconnect.d.ts +8 -0
  126. package/build-types/components/provider/use-network-reconnect.d.ts.map +1 -0
  127. package/build-types/components/revision-fields-diff/index.d.ts +3 -0
  128. package/build-types/components/revision-fields-diff/index.d.ts.map +1 -1
  129. package/build-types/components/sidebar/index.d.ts.map +1 -1
  130. package/build-types/components/template-actions-panel/block-theme-content.d.ts.map +1 -1
  131. package/build-types/components/upload-progress-snackbar/index.d.ts +19 -0
  132. package/build-types/components/upload-progress-snackbar/index.d.ts.map +1 -0
  133. package/build-types/components/upload-progress-snackbar/stories/index.story.d.ts +28 -0
  134. package/build-types/components/upload-progress-snackbar/stories/index.story.d.ts.map +1 -0
  135. package/build-types/components/upload-progress-snackbar/tracker.d.ts +41 -0
  136. package/build-types/components/upload-progress-snackbar/tracker.d.ts.map +1 -0
  137. package/build-types/private-apis.d.ts.map +1 -1
  138. package/build-types/store/selectors.d.ts.map +1 -1
  139. package/build-types/utils/get-template-part-icon.d.ts.map +1 -1
  140. package/build-types/utils/media-upload/index.d.ts.map +1 -1
  141. package/package.json +55 -52
  142. package/src/components/README.md +1 -1
  143. package/src/components/block-removal-warnings/index.js +0 -7
  144. package/src/components/collab-sidebar/note-indicator-toolbar.js +73 -60
  145. package/src/components/collaborators-overlay/use-block-highlighting.ts +0 -9
  146. package/src/components/collaborators-overlay/use-render-cursors.ts +0 -8
  147. package/src/components/collaborators-presence/avatar/test/index.tsx +8 -3
  148. package/src/components/more-menu/view-more-menu-group.js +1 -2
  149. package/src/components/page-attributes/parent.js +1 -0
  150. package/src/components/post-publish-button/index.js +143 -192
  151. package/src/components/post-publish-button/test/index.js +137 -114
  152. package/src/components/post-revisions-preview/block-diff.js +63 -19
  153. package/src/components/post-revisions-preview/preserve-client-ids.js +1 -1
  154. package/src/components/post-revisions-preview/test/block-diff.js +109 -6
  155. package/src/components/provider/index.js +4 -0
  156. package/src/components/provider/test/use-network-reconnect.js +137 -0
  157. package/src/components/provider/use-block-editor-settings.js +2 -2
  158. package/src/components/provider/use-network-reconnect.js +44 -0
  159. package/src/components/revision-fields-diff/index.js +7 -2
  160. package/src/components/sidebar/index.js +2 -11
  161. package/src/components/template-actions-panel/block-theme-content.js +10 -1
  162. package/src/components/upload-progress-snackbar/README.md +26 -0
  163. package/src/components/upload-progress-snackbar/index.js +216 -0
  164. package/src/components/upload-progress-snackbar/stories/index.story.tsx +85 -0
  165. package/src/components/upload-progress-snackbar/style.scss +30 -0
  166. package/src/components/upload-progress-snackbar/test/index.js +199 -0
  167. package/src/components/upload-progress-snackbar/tracker.js +105 -0
  168. package/src/private-apis.js +2 -0
  169. package/src/store/selectors.js +1 -3
  170. package/src/style.scss +1 -0
  171. package/src/utils/media-upload/index.js +27 -0
  172. package/src/components/commands/index.native.js +0 -2
  173. package/src/components/deprecated.native.js +0 -47
  174. package/src/components/editor-help/add-blocks.native.js +0 -40
  175. package/src/components/editor-help/customize-blocks.native.js +0 -40
  176. package/src/components/editor-help/help-detail-navigation-screen.native.js +0 -67
  177. package/src/components/editor-help/help-get-support-button.native.js +0 -38
  178. package/src/components/editor-help/help-section-title.native.js +0 -29
  179. package/src/components/editor-help/help-topic-row.native.js +0 -33
  180. package/src/components/editor-help/icon-move-blocks.native.js +0 -10
  181. package/src/components/editor-help/index.native.js +0 -208
  182. package/src/components/editor-help/intro-to-blocks.native.js +0 -91
  183. package/src/components/editor-help/move-blocks.native.js +0 -55
  184. package/src/components/editor-help/remove-blocks.native.js +0 -35
  185. package/src/components/editor-help/style.android.scss +0 -6
  186. package/src/components/editor-help/style.ios.scss +0 -6
  187. package/src/components/editor-help/test/index.native.js +0 -81
  188. package/src/components/editor-help/view-sections.native.js +0 -79
  189. package/src/components/error-boundary/index.native.js +0 -192
  190. package/src/components/error-boundary/style.native.scss +0 -116
  191. package/src/components/index.native.js +0 -15
  192. package/src/components/offline-status/index.native.js +0 -99
  193. package/src/components/offline-status/style.native.scss +0 -28
  194. package/src/components/offline-status/test/index.native.js +0 -108
  195. package/src/components/post-title/index.native.js +0 -282
  196. package/src/components/post-title/style.native.scss +0 -13
  197. package/src/components/post-title/test/__snapshots__/index.native.js.snap +0 -25
  198. package/src/components/post-title/test/index.native.js +0 -78
  199. package/src/components/provider/index.native.js +0 -497
  200. package/src/components/provider/use-block-editor-settings.native.js +0 -48
  201. package/src/components/template-part-menu-items/index.native.js +0 -3
  202. package/src/hooks/index.native.js +0 -0
  203. package/src/index.native.js +0 -16
  204. package/src/private-apis.native.js +0 -33
  205. package/src/store/actions.native.js +0 -27
  206. package/src/store/reducer.native.js +0 -94
  207. package/src/store/selectors.native.js +0 -57
  208. package/src/store/test/actions.native.js +0 -16
  209. package/src/store/test/reducer.native.js +0 -36
  210. package/src/store/test/selectors.native.js +0 -28
  211. package/src/utils/index.native.js +0 -6
  212. package/src/utils/media-sideload/index.native.js +0 -1
  213. package/src/utils/media-upload/index.native.js +0 -1
@@ -1,94 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { combineReducers } from '@wordpress/data';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import {
10
- postId,
11
- postType,
12
- renderingMode,
13
- saving,
14
- postLock,
15
- postSavingLock,
16
- template,
17
- editorSettings,
18
- } from './reducer.js';
19
-
20
- import { EDITOR_SETTINGS_DEFAULTS } from './defaults.js';
21
-
22
- EDITOR_SETTINGS_DEFAULTS.autosaveInterval = 1; // This is a way to override default behavior on mobile, and make it ping the native save every second as long as something changed
23
-
24
- export * from './reducer.js';
25
-
26
- /**
27
- * Reducer returning the post title state.
28
- *
29
- * @param {Object} state Current state.
30
- * @param {Object} action Dispatched action.
31
- *
32
- * @return {Object} Updated state.
33
- */
34
- export const postTitle = combineReducers( {
35
- isSelected( state = false, action ) {
36
- switch ( action.type ) {
37
- case 'TOGGLE_POST_TITLE_SELECTION':
38
- return action.isSelected;
39
- }
40
-
41
- return state;
42
- },
43
- } );
44
-
45
- /**
46
- * Reducer returning the clipboard state.
47
- *
48
- * @param {Object} state Current state.
49
- * @param {Object} action Dispatched action.
50
- *
51
- * @return {Object} Updated state.
52
- */
53
- export function clipboard( state = null, action ) {
54
- switch ( action.type ) {
55
- case 'UPDATE_CLIPBOARD':
56
- return action.clipboard;
57
- }
58
-
59
- return state;
60
- }
61
-
62
- /**
63
- * Reducer returning the notices state.
64
- *
65
- * @param {Object} state Current state.
66
- * @param {Object} action Dispatched action.
67
- *
68
- * @return {Object} Updated state.
69
- */
70
- export function notices( state = [], action ) {
71
- switch ( action.type ) {
72
- case 'CREATE_NOTICE':
73
- return [ ...state, action.notice ];
74
- case 'REMOVE_ALL_NOTICES':
75
- return [];
76
- case 'REMOVE_NOTICE':
77
- return state.filter( ( notice ) => notice.id !== action.id );
78
- }
79
- return state;
80
- }
81
-
82
- export default combineReducers( {
83
- postId,
84
- postType,
85
- postTitle,
86
- renderingMode,
87
- saving,
88
- postLock,
89
- postSavingLock,
90
- template,
91
- editorSettings,
92
- clipboard,
93
- notices,
94
- } );
@@ -1,57 +0,0 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { createRegistrySelector } from '@wordpress/data';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import {
10
- isEditedPostDirty,
11
- isEditedPostSaveable,
12
- hasChangedContent,
13
- } from './selectors.js';
14
-
15
- export * from './selectors.js';
16
-
17
- /**
18
- * Returns true if post title is selected.
19
- *
20
- * @param {Object} state Global application state.
21
- *
22
- * @return {boolean} Whether current post title is selected.
23
- */
24
- export function isPostTitleSelected( state ) {
25
- return state.postTitle.isSelected;
26
- }
27
-
28
- /**
29
- * Returns true if the post can be autosaved, or false otherwise.
30
- *
31
- * @param {Object} state Global application state.
32
- * @param {Object} autosave A raw autosave object from the REST API.
33
- *
34
- * @return {boolean} Whether the post can be autosaved.
35
- */
36
- export const isEditedPostAutosaveable = createRegistrySelector(
37
- () => ( state ) => {
38
- // A post must contain a title, an excerpt, or non-empty content to be valid for autosaving.
39
- if ( ! isEditedPostSaveable( state ) ) {
40
- return false;
41
- }
42
-
43
- // To avoid an expensive content serialization, use the content dirtiness
44
- // flag in place of content field comparison against the known autosave.
45
- // This is not strictly accurate, and relies on a tolerance toward autosave
46
- // request failures for unnecessary saves.
47
- if ( hasChangedContent( state ) ) {
48
- return true;
49
- }
50
-
51
- if ( isEditedPostDirty( state ) ) {
52
- return true;
53
- }
54
-
55
- return false;
56
- }
57
- );
@@ -1,16 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { togglePostTitleSelection } from '../actions';
5
-
6
- describe( 'actions native', () => {
7
- describe( 'togglePostTitleSelection', () => {
8
- it( 'should return the TOGGLE_POST_TITLE_SELECTION action', () => {
9
- const result = togglePostTitleSelection( true );
10
- expect( result ).toEqual( {
11
- type: 'TOGGLE_POST_TITLE_SELECTION',
12
- isSelected: true,
13
- } );
14
- } );
15
- } );
16
- } );
@@ -1,36 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { postTitle } from '../reducer';
5
-
6
- describe( 'state native', () => {
7
- describe( 'postTitle', () => {
8
- describe( 'isSelected', () => {
9
- it( 'should not be selected by default', () => {
10
- expect( postTitle( undefined, {} ).isSelected ).toBe( false );
11
- } );
12
-
13
- it( 'should return false if not selecting the post title', () => {
14
- const action = {
15
- type: 'TOGGLE_POST_TITLE_SELECTION',
16
- isSelected: false,
17
- };
18
-
19
- expect(
20
- postTitle( { isSelected: true }, action ).isSelected
21
- ).toBe( false );
22
- } );
23
-
24
- it( 'should return true if selecting the post title', () => {
25
- const action = {
26
- type: 'TOGGLE_POST_TITLE_SELECTION',
27
- isSelected: true,
28
- };
29
-
30
- expect(
31
- postTitle( { isSelected: false }, action ).isSelected
32
- ).toBe( true );
33
- } );
34
- } );
35
- } );
36
- } );
@@ -1,28 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import { isPostTitleSelected } from '../selectors';
5
-
6
- describe( 'selectors native', () => {
7
- describe( 'isPostTitleSelected', () => {
8
- it( 'should return true if the post title is selected', () => {
9
- const state = {
10
- postTitle: {
11
- isSelected: true,
12
- },
13
- };
14
-
15
- expect( isPostTitleSelected( state ) ).toBe( true );
16
- } );
17
-
18
- it( 'should return false if the post title is not selected', () => {
19
- const state = {
20
- postTitle: {
21
- isSelected: false,
22
- },
23
- };
24
-
25
- expect( isPostTitleSelected( state ) ).toBe( false );
26
- } );
27
- } );
28
- } );
@@ -1,6 +0,0 @@
1
- /**
2
- * Internal dependencies
3
- */
4
- import mediaUpload from './media-upload';
5
-
6
- export { mediaUpload };
@@ -1 +0,0 @@
1
- export default function mediaSideload() {}
@@ -1 +0,0 @@
1
- export default function mediaUpload() {}