@wordpress/editor 14.49.1 → 14.51.1-next.v.202607070741.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/CHANGELOG.md +12 -0
- package/build/components/collab-sidebar/format.cjs +83 -0
- package/build/components/collab-sidebar/format.cjs.map +7 -0
- package/build/components/collab-sidebar/hooks.cjs +117 -16
- package/build/components/collab-sidebar/hooks.cjs.map +2 -2
- package/build/components/collab-sidebar/index.cjs +18 -2
- package/build/components/collab-sidebar/index.cjs.map +2 -2
- package/build/components/collab-sidebar/note-highlight-styles.cjs +67 -0
- package/build/components/collab-sidebar/note-highlight-styles.cjs.map +7 -0
- package/build/components/collab-sidebar/utils.cjs +139 -0
- package/build/components/collab-sidebar/utils.cjs.map +2 -2
- package/build/components/collaborators-presence/use-collaborator-notifications.cjs +55 -30
- package/build/components/collaborators-presence/use-collaborator-notifications.cjs.map +2 -2
- package/build/components/commands/index.cjs +99 -3
- package/build/components/commands/index.cjs.map +2 -2
- package/build/components/document-bar/index.cjs +28 -34
- package/build/components/document-bar/index.cjs.map +2 -2
- package/build/components/entities-saved-states/index.cjs +1 -4
- package/build/components/entities-saved-states/index.cjs.map +2 -2
- package/build/components/header/index.cjs +1 -8
- package/build/components/header/index.cjs.map +2 -2
- package/build/components/media-categories/index.cjs +92 -6
- package/build/components/media-categories/index.cjs.map +2 -2
- package/build/components/page-attributes/parent.cjs +0 -1
- package/build/components/page-attributes/parent.cjs.map +2 -2
- package/build/components/post-author/combobox.cjs +0 -1
- package/build/components/post-author/combobox.cjs.map +2 -2
- package/build/components/post-author/select.cjs +0 -1
- package/build/components/post-author/select.cjs.map +2 -2
- package/build/components/post-preview-button/index.cjs +29 -2
- package/build/components/post-preview-button/index.cjs.map +2 -2
- package/build/components/post-publish-panel/maybe-upload-media.cjs +15 -26
- package/build/components/post-publish-panel/maybe-upload-media.cjs.map +3 -3
- package/build/components/post-revisions-preview/revisions-slider.cjs +3 -1
- package/build/components/post-revisions-preview/revisions-slider.cjs.map +2 -2
- package/build/components/post-taxonomies/flat-term-selector.cjs +0 -1
- package/build/components/post-taxonomies/flat-term-selector.cjs.map +2 -2
- package/build/components/post-taxonomies/hierarchical-term-selector.cjs +0 -2
- package/build/components/post-taxonomies/hierarchical-term-selector.cjs.map +2 -2
- package/build/components/post-template/classic-theme.cjs +0 -1
- package/build/components/post-template/classic-theme.cjs.map +2 -2
- package/build/components/preferences-modal/index.cjs +54 -28
- package/build/components/preferences-modal/index.cjs.map +2 -2
- package/build/components/preview-dropdown/index.cjs +38 -9
- package/build/components/preview-dropdown/index.cjs.map +3 -3
- package/build/components/provider/use-block-editor-settings.cjs +23 -9
- package/build/components/provider/use-block-editor-settings.cjs.map +3 -3
- package/build/components/resizable-editor/index.cjs +54 -9
- package/build/components/resizable-editor/index.cjs.map +3 -3
- package/build/components/sidebar/dataform-post-summary.cjs +5 -1
- package/build/components/sidebar/dataform-post-summary.cjs.map +3 -3
- package/build/components/sidebar/index.cjs +29 -38
- package/build/components/sidebar/index.cjs.map +3 -3
- package/build/components/sidebar/post-summary.cjs +0 -13
- package/build/components/sidebar/post-summary.cjs.map +3 -3
- package/build/components/visual-editor/index.cjs +15 -11
- package/build/components/visual-editor/index.cjs.map +3 -3
- package/build/dataviews/store/private-actions.cjs +24 -19
- package/build/dataviews/store/private-actions.cjs.map +2 -2
- package/build/store/actions.cjs +5 -3
- package/build/store/actions.cjs.map +2 -2
- package/build/store/constants.cjs +26 -0
- package/build/store/constants.cjs.map +2 -2
- package/build/store/private-actions.cjs +25 -18
- package/build/store/private-actions.cjs.map +3 -3
- package/build/store/private-selectors.cjs +5 -0
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +6 -6
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs +3 -1
- package/build/store/selectors.cjs.map +2 -2
- package/build/utils/device-type.cjs +52 -0
- package/build/utils/device-type.cjs.map +7 -0
- package/build/utils/media-sideload-from-url/index.cjs +63 -0
- package/build/utils/media-sideload-from-url/index.cjs.map +7 -0
- package/build-module/components/collab-sidebar/format.mjs +57 -0
- package/build-module/components/collab-sidebar/format.mjs.map +7 -0
- package/build-module/components/collab-sidebar/hooks.mjs +121 -16
- package/build-module/components/collab-sidebar/hooks.mjs.map +2 -2
- package/build-module/components/collab-sidebar/index.mjs +21 -5
- package/build-module/components/collab-sidebar/index.mjs.map +2 -2
- package/build-module/components/collab-sidebar/note-highlight-styles.mjs +41 -0
- package/build-module/components/collab-sidebar/note-highlight-styles.mjs.map +7 -0
- package/build-module/components/collab-sidebar/utils.mjs +133 -0
- package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
- package/build-module/components/collaborators-presence/use-collaborator-notifications.mjs +55 -30
- package/build-module/components/collaborators-presence/use-collaborator-notifications.mjs.map +2 -2
- package/build-module/components/commands/index.mjs +99 -3
- package/build-module/components/commands/index.mjs.map +2 -2
- package/build-module/components/document-bar/index.mjs +28 -34
- package/build-module/components/document-bar/index.mjs.map +2 -2
- package/build-module/components/entities-saved-states/index.mjs +1 -4
- package/build-module/components/entities-saved-states/index.mjs.map +2 -2
- package/build-module/components/header/index.mjs +1 -13
- package/build-module/components/header/index.mjs.map +2 -2
- package/build-module/components/media-categories/index.mjs +93 -7
- package/build-module/components/media-categories/index.mjs.map +2 -2
- package/build-module/components/page-attributes/parent.mjs +0 -1
- package/build-module/components/page-attributes/parent.mjs.map +2 -2
- package/build-module/components/post-author/combobox.mjs +0 -1
- package/build-module/components/post-author/combobox.mjs.map +2 -2
- package/build-module/components/post-author/select.mjs +0 -1
- package/build-module/components/post-author/select.mjs.map +2 -2
- package/build-module/components/post-preview-button/index.mjs +29 -2
- package/build-module/components/post-preview-button/index.mjs.map +2 -2
- package/build-module/components/post-publish-panel/maybe-upload-media.mjs +19 -27
- package/build-module/components/post-publish-panel/maybe-upload-media.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/revisions-slider.mjs +3 -1
- package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
- package/build-module/components/post-taxonomies/flat-term-selector.mjs +0 -1
- package/build-module/components/post-taxonomies/flat-term-selector.mjs.map +2 -2
- package/build-module/components/post-taxonomies/hierarchical-term-selector.mjs +0 -2
- package/build-module/components/post-taxonomies/hierarchical-term-selector.mjs.map +2 -2
- package/build-module/components/post-template/classic-theme.mjs +0 -1
- package/build-module/components/post-template/classic-theme.mjs.map +2 -2
- package/build-module/components/preferences-modal/index.mjs +54 -28
- package/build-module/components/preferences-modal/index.mjs.map +2 -2
- package/build-module/components/preview-dropdown/index.mjs +38 -9
- package/build-module/components/preview-dropdown/index.mjs.map +2 -2
- package/build-module/components/provider/use-block-editor-settings.mjs +23 -9
- package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
- package/build-module/components/resizable-editor/index.mjs +55 -10
- package/build-module/components/resizable-editor/index.mjs.map +2 -2
- package/build-module/components/sidebar/dataform-post-summary.mjs +6 -2
- package/build-module/components/sidebar/dataform-post-summary.mjs.map +2 -2
- package/build-module/components/sidebar/index.mjs +29 -42
- package/build-module/components/sidebar/index.mjs.map +2 -2
- package/build-module/components/sidebar/post-summary.mjs +0 -13
- package/build-module/components/sidebar/post-summary.mjs.map +2 -2
- package/build-module/components/visual-editor/index.mjs +16 -13
- package/build-module/components/visual-editor/index.mjs.map +2 -2
- package/build-module/dataviews/store/private-actions.mjs +26 -19
- package/build-module/dataviews/store/private-actions.mjs.map +2 -2
- package/build-module/store/actions.mjs +5 -3
- package/build-module/store/actions.mjs.map +2 -2
- package/build-module/store/constants.mjs +25 -0
- package/build-module/store/constants.mjs.map +2 -2
- package/build-module/store/private-actions.mjs +27 -17
- package/build-module/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +4 -0
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +5 -5
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +3 -1
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/utils/device-type.mjs +25 -0
- package/build-module/utils/device-type.mjs.map +7 -0
- package/build-module/utils/media-sideload-from-url/index.mjs +32 -0
- package/build-module/utils/media-sideload-from-url/index.mjs.map +7 -0
- package/build-style/style-rtl.css +84 -39
- package/build-style/style.css +84 -39
- package/build-types/components/collab-sidebar/format.d.ts +17 -0
- package/build-types/components/collab-sidebar/format.d.ts.map +1 -0
- 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/note-highlight-styles.d.ts +31 -0
- package/build-types/components/collab-sidebar/note-highlight-styles.d.ts.map +1 -0
- package/build-types/components/collab-sidebar/utils.d.ts +82 -2
- package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
- package/build-types/components/collaborators-presence/use-collaborator-notifications.d.ts.map +1 -1
- package/build-types/components/commands/index.d.ts.map +1 -1
- package/build-types/components/document-bar/index.d.ts.map +1 -1
- package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/media-categories/index.d.ts +12 -3
- package/build-types/components/media-categories/index.d.ts.map +1 -1
- package/build-types/components/page-attributes/parent.d.ts.map +1 -1
- package/build-types/components/post-author/combobox.d.ts.map +1 -1
- package/build-types/components/post-author/select.d.ts.map +1 -1
- package/build-types/components/post-preview-button/index.d.ts.map +1 -1
- package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/revisions-slider.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
- package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
- package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
- package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
- package/build-types/components/resizable-editor/index.d.ts.map +1 -1
- package/build-types/components/sidebar/dataform-post-summary.d.ts.map +1 -1
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
- package/build-types/components/visual-editor/index.d.ts.map +1 -1
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/build-types/store/actions.d.ts.map +1 -1
- package/build-types/store/constants.d.ts +6 -0
- package/build-types/store/constants.d.ts.map +1 -1
- package/build-types/store/index.d.ts +2 -2
- package/build-types/store/private-actions.d.ts +9 -15
- 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 +6 -7
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +1 -1
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/utils/device-type.d.ts +23 -0
- package/build-types/utils/device-type.d.ts.map +1 -0
- package/build-types/utils/get-template-part-icon.d.ts.map +1 -1
- package/build-types/utils/media-sideload-from-url/index.d.ts +18 -0
- package/build-types/utils/media-sideload-from-url/index.d.ts.map +1 -0
- package/package.json +48 -46
- package/src/components/collab-sidebar/format.js +72 -0
- package/src/components/collab-sidebar/hooks.js +203 -22
- package/src/components/collab-sidebar/index.js +19 -5
- package/src/components/collab-sidebar/note-highlight-styles.js +83 -0
- package/src/components/collab-sidebar/style.scss +9 -0
- package/src/components/collab-sidebar/test/note-highlight-styles.js +106 -0
- package/src/components/collab-sidebar/test/utils.js +471 -0
- package/src/components/collab-sidebar/utils.js +225 -2
- package/src/components/collaborators-presence/test/use-collaborator-notifications.ts +265 -262
- package/src/components/collaborators-presence/use-collaborator-notifications.ts +70 -34
- package/src/components/commands/index.js +142 -0
- package/src/components/document-bar/index.js +0 -9
- package/src/components/document-bar/style.scss +0 -17
- package/src/components/entities-saved-states/index.js +1 -5
- package/src/components/header/index.js +1 -15
- package/src/components/header/style.scss +7 -3
- package/src/components/media-categories/index.js +160 -6
- package/src/components/media-categories/test/index.js +202 -0
- package/src/components/page-attributes/parent.js +0 -1
- package/src/components/post-author/combobox.js +0 -1
- package/src/components/post-author/select.js +0 -1
- package/src/components/post-preview-button/index.js +68 -2
- package/src/components/post-publish-panel/maybe-upload-media.js +25 -30
- package/src/components/post-publish-panel/style.scss +1 -1
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +11 -127
- package/src/components/post-revisions-preview/revisions-slider.js +4 -1
- package/src/components/post-revisions-preview/test/block-diff.js +2 -2
- package/src/components/post-taxonomies/flat-term-selector.js +0 -1
- package/src/components/post-taxonomies/hierarchical-term-selector.js +0 -2
- package/src/components/post-template/classic-theme.js +0 -1
- package/src/components/preferences-modal/index.js +40 -22
- package/src/components/preferences-modal/test/index.js +83 -0
- package/src/components/preview-dropdown/index.js +42 -3
- package/src/components/provider/use-block-editor-settings.js +42 -7
- package/src/components/resizable-editor/index.js +71 -9
- package/src/components/resizable-editor/style.scss +7 -0
- package/src/components/sidebar/dataform-post-summary.js +13 -1
- package/src/components/sidebar/index.js +32 -47
- package/src/components/sidebar/post-summary.js +0 -17
- package/src/components/styles-canvas/style.scss +1 -2
- package/src/components/visual-editor/index.js +19 -15
- package/src/components/visual-editor/style.scss +11 -4
- package/src/dataviews/store/private-actions.ts +30 -26
- package/src/store/actions.js +6 -3
- package/src/store/constants.ts +45 -0
- package/src/store/private-actions.js +38 -28
- package/src/store/private-selectors.js +10 -0
- package/src/store/reducer.js +7 -9
- package/src/store/selectors.js +3 -1
- package/src/store/test/actions.js +31 -22
- package/src/utils/device-type.js +46 -0
- package/src/utils/media-sideload-from-url/index.js +54 -0
- package/src/utils/media-sideload-from-url/test/index.js +162 -0
- package/build/components/post-publish-panel/media-util.cjs +0 -72
- package/build/components/post-publish-panel/media-util.cjs.map +0 -7
- package/build-module/components/post-publish-panel/media-util.mjs +0 -46
- package/build-module/components/post-publish-panel/media-util.mjs.map +0 -7
- package/build-types/components/post-publish-panel/media-util.d.ts +0 -20
- package/build-types/components/post-publish-panel/media-util.d.ts.map +0 -1
- package/src/components/post-publish-panel/media-util.js +0 -87
- package/src/components/post-publish-panel/test/media-util.js +0 -118
|
@@ -27,30 +27,6 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
|
|
|
27
27
|
padding: 0;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
.emotion-10 {
|
|
31
|
-
display: -webkit-box;
|
|
32
|
-
display: -webkit-flex;
|
|
33
|
-
display: -ms-flexbox;
|
|
34
|
-
display: flex;
|
|
35
|
-
-webkit-align-items: flex-start;
|
|
36
|
-
-webkit-box-align: flex-start;
|
|
37
|
-
-ms-flex-align: flex-start;
|
|
38
|
-
align-items: flex-start;
|
|
39
|
-
-webkit-flex-direction: row;
|
|
40
|
-
-ms-flex-direction: row;
|
|
41
|
-
flex-direction: row;
|
|
42
|
-
gap: 0;
|
|
43
|
-
-webkit-box-pack: start;
|
|
44
|
-
-ms-flex-pack: start;
|
|
45
|
-
-webkit-justify-content: start;
|
|
46
|
-
justify-content: start;
|
|
47
|
-
width: 100%;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.emotion-10>* {
|
|
51
|
-
min-width: 0;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
30
|
<div>
|
|
55
31
|
<div
|
|
56
32
|
class="editor-post-publish-panel"
|
|
@@ -91,7 +67,6 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
|
|
|
91
67
|
<a
|
|
92
68
|
class="components-external-link"
|
|
93
69
|
href="https://wordpress.local/sample-page/"
|
|
94
|
-
rel="external noopener"
|
|
95
70
|
target="_blank"
|
|
96
71
|
>
|
|
97
72
|
<span
|
|
@@ -163,6 +138,7 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
|
|
|
163
138
|
target="_blank"
|
|
164
139
|
>
|
|
165
140
|
<span
|
|
141
|
+
class="style-visually-hidden"
|
|
166
142
|
data-visually-hidden=""
|
|
167
143
|
>
|
|
168
144
|
(opens in a new tab)
|
|
@@ -199,9 +175,10 @@ exports[`PostPublishPanel should render the post-publish panel if the post is pu
|
|
|
199
175
|
class="components-base-control__field emotion-2 emotion-3"
|
|
200
176
|
>
|
|
201
177
|
<div
|
|
202
|
-
class="components-flex components-h-stack
|
|
178
|
+
class="style-flex style-items-row style-expanded-row components-flex components-h-stack"
|
|
203
179
|
data-wp-c16t="true"
|
|
204
180
|
data-wp-component="HStack"
|
|
181
|
+
style="--wp-components-flex-align: flex-start; --wp-components-flex-direction: row; --wp-components-flex-wrap: nowrap; --wp-components-flex-gap: 0; --wp-components-flex-justify: start;"
|
|
205
182
|
>
|
|
206
183
|
<span
|
|
207
184
|
class="components-checkbox-control__input-container"
|
|
@@ -254,30 +231,6 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
|
|
|
254
231
|
padding: 0;
|
|
255
232
|
}
|
|
256
233
|
|
|
257
|
-
.emotion-10 {
|
|
258
|
-
display: -webkit-box;
|
|
259
|
-
display: -webkit-flex;
|
|
260
|
-
display: -ms-flexbox;
|
|
261
|
-
display: flex;
|
|
262
|
-
-webkit-align-items: flex-start;
|
|
263
|
-
-webkit-box-align: flex-start;
|
|
264
|
-
-ms-flex-align: flex-start;
|
|
265
|
-
align-items: flex-start;
|
|
266
|
-
-webkit-flex-direction: row;
|
|
267
|
-
-ms-flex-direction: row;
|
|
268
|
-
flex-direction: row;
|
|
269
|
-
gap: 0;
|
|
270
|
-
-webkit-box-pack: start;
|
|
271
|
-
-ms-flex-pack: start;
|
|
272
|
-
-webkit-justify-content: start;
|
|
273
|
-
justify-content: start;
|
|
274
|
-
width: 100%;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
.emotion-10>* {
|
|
278
|
-
min-width: 0;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
234
|
<div>
|
|
282
235
|
<div
|
|
283
236
|
class="editor-post-publish-panel"
|
|
@@ -318,7 +271,6 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
|
|
|
318
271
|
<a
|
|
319
272
|
class="components-external-link"
|
|
320
273
|
href="https://wordpress.local/sample-page/"
|
|
321
|
-
rel="external noopener"
|
|
322
274
|
target="_blank"
|
|
323
275
|
>
|
|
324
276
|
<span
|
|
@@ -405,9 +357,10 @@ exports[`PostPublishPanel should render the post-publish panel if the post is sc
|
|
|
405
357
|
class="components-base-control__field emotion-2 emotion-3"
|
|
406
358
|
>
|
|
407
359
|
<div
|
|
408
|
-
class="components-flex components-h-stack
|
|
360
|
+
class="style-flex style-items-row style-expanded-row components-flex components-h-stack"
|
|
409
361
|
data-wp-c16t="true"
|
|
410
362
|
data-wp-component="HStack"
|
|
363
|
+
style="--wp-components-flex-align: flex-start; --wp-components-flex-direction: row; --wp-components-flex-wrap: nowrap; --wp-components-flex-gap: 0; --wp-components-flex-justify: start;"
|
|
411
364
|
>
|
|
412
365
|
<span
|
|
413
366
|
class="components-checkbox-control__input-container"
|
|
@@ -450,30 +403,6 @@ exports[`PostPublishPanel should render the pre-publish panel if post status is
|
|
|
450
403
|
margin-bottom: inherit;
|
|
451
404
|
}
|
|
452
405
|
|
|
453
|
-
.emotion-4 {
|
|
454
|
-
display: -webkit-box;
|
|
455
|
-
display: -webkit-flex;
|
|
456
|
-
display: -ms-flexbox;
|
|
457
|
-
display: flex;
|
|
458
|
-
-webkit-align-items: flex-start;
|
|
459
|
-
-webkit-box-align: flex-start;
|
|
460
|
-
-ms-flex-align: flex-start;
|
|
461
|
-
align-items: flex-start;
|
|
462
|
-
-webkit-flex-direction: row;
|
|
463
|
-
-ms-flex-direction: row;
|
|
464
|
-
flex-direction: row;
|
|
465
|
-
gap: 0;
|
|
466
|
-
-webkit-box-pack: start;
|
|
467
|
-
-ms-flex-pack: start;
|
|
468
|
-
-webkit-justify-content: start;
|
|
469
|
-
justify-content: start;
|
|
470
|
-
width: 100%;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
.emotion-4>* {
|
|
474
|
-
min-width: 0;
|
|
475
|
-
}
|
|
476
|
-
|
|
477
406
|
<div>
|
|
478
407
|
<div
|
|
479
408
|
class="editor-post-publish-panel"
|
|
@@ -560,9 +489,10 @@ exports[`PostPublishPanel should render the pre-publish panel if post status is
|
|
|
560
489
|
class="components-base-control__field emotion-2 emotion-3"
|
|
561
490
|
>
|
|
562
491
|
<div
|
|
563
|
-
class="components-flex components-h-stack
|
|
492
|
+
class="style-flex style-items-row style-expanded-row components-flex components-h-stack"
|
|
564
493
|
data-wp-c16t="true"
|
|
565
494
|
data-wp-component="HStack"
|
|
495
|
+
style="--wp-components-flex-align: flex-start; --wp-components-flex-direction: row; --wp-components-flex-wrap: nowrap; --wp-components-flex-gap: 0; --wp-components-flex-justify: start;"
|
|
566
496
|
>
|
|
567
497
|
<span
|
|
568
498
|
class="components-checkbox-control__input-container"
|
|
@@ -605,30 +535,6 @@ exports[`PostPublishPanel should render the pre-publish panel if the post is not
|
|
|
605
535
|
margin-bottom: inherit;
|
|
606
536
|
}
|
|
607
537
|
|
|
608
|
-
.emotion-4 {
|
|
609
|
-
display: -webkit-box;
|
|
610
|
-
display: -webkit-flex;
|
|
611
|
-
display: -ms-flexbox;
|
|
612
|
-
display: flex;
|
|
613
|
-
-webkit-align-items: flex-start;
|
|
614
|
-
-webkit-box-align: flex-start;
|
|
615
|
-
-ms-flex-align: flex-start;
|
|
616
|
-
align-items: flex-start;
|
|
617
|
-
-webkit-flex-direction: row;
|
|
618
|
-
-ms-flex-direction: row;
|
|
619
|
-
flex-direction: row;
|
|
620
|
-
gap: 0;
|
|
621
|
-
-webkit-box-pack: start;
|
|
622
|
-
-ms-flex-pack: start;
|
|
623
|
-
-webkit-justify-content: start;
|
|
624
|
-
justify-content: start;
|
|
625
|
-
width: 100%;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
.emotion-4>* {
|
|
629
|
-
min-width: 0;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
538
|
<div>
|
|
633
539
|
<div
|
|
634
540
|
class="editor-post-publish-panel"
|
|
@@ -715,9 +621,10 @@ exports[`PostPublishPanel should render the pre-publish panel if the post is not
|
|
|
715
621
|
class="components-base-control__field emotion-2 emotion-3"
|
|
716
622
|
>
|
|
717
623
|
<div
|
|
718
|
-
class="components-flex components-h-stack
|
|
624
|
+
class="style-flex style-items-row style-expanded-row components-flex components-h-stack"
|
|
719
625
|
data-wp-c16t="true"
|
|
720
626
|
data-wp-component="HStack"
|
|
627
|
+
style="--wp-components-flex-align: flex-start; --wp-components-flex-direction: row; --wp-components-flex-wrap: nowrap; --wp-components-flex-gap: 0; --wp-components-flex-justify: start;"
|
|
721
628
|
>
|
|
722
629
|
<span
|
|
723
630
|
class="components-checkbox-control__input-container"
|
|
@@ -804,30 +711,6 @@ exports[`PostPublishPanel should render the spinner if the post is being saved 1
|
|
|
804
711
|
margin-bottom: inherit;
|
|
805
712
|
}
|
|
806
713
|
|
|
807
|
-
.emotion-10 {
|
|
808
|
-
display: -webkit-box;
|
|
809
|
-
display: -webkit-flex;
|
|
810
|
-
display: -ms-flexbox;
|
|
811
|
-
display: flex;
|
|
812
|
-
-webkit-align-items: flex-start;
|
|
813
|
-
-webkit-box-align: flex-start;
|
|
814
|
-
-ms-flex-align: flex-start;
|
|
815
|
-
align-items: flex-start;
|
|
816
|
-
-webkit-flex-direction: row;
|
|
817
|
-
-ms-flex-direction: row;
|
|
818
|
-
flex-direction: row;
|
|
819
|
-
gap: 0;
|
|
820
|
-
-webkit-box-pack: start;
|
|
821
|
-
-ms-flex-pack: start;
|
|
822
|
-
-webkit-justify-content: start;
|
|
823
|
-
justify-content: start;
|
|
824
|
-
width: 100%;
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
.emotion-10>* {
|
|
828
|
-
min-width: 0;
|
|
829
|
-
}
|
|
830
|
-
|
|
831
714
|
<div>
|
|
832
715
|
<div
|
|
833
716
|
class="editor-post-publish-panel"
|
|
@@ -894,9 +777,10 @@ exports[`PostPublishPanel should render the spinner if the post is being saved 1
|
|
|
894
777
|
class="components-base-control__field emotion-8 emotion-9"
|
|
895
778
|
>
|
|
896
779
|
<div
|
|
897
|
-
class="components-flex components-h-stack
|
|
780
|
+
class="style-flex style-items-row style-expanded-row components-flex components-h-stack"
|
|
898
781
|
data-wp-c16t="true"
|
|
899
782
|
data-wp-component="HStack"
|
|
783
|
+
style="--wp-components-flex-align: flex-start; --wp-components-flex-direction: row; --wp-components-flex-wrap: nowrap; --wp-components-flex-gap: 0; --wp-components-flex-justify: start;"
|
|
900
784
|
>
|
|
901
785
|
<span
|
|
902
786
|
class="components-checkbox-control__input-container"
|
|
@@ -9,6 +9,7 @@ import { dateI18n, getSettings as getDateSettings } from '@wordpress/date';
|
|
|
9
9
|
import { useMemo } from '@wordpress/element';
|
|
10
10
|
import { chevronLeft, chevronRight } from '@wordpress/icons';
|
|
11
11
|
import { Stack } from '@wordpress/ui';
|
|
12
|
+
import { useFocusOnMount } from '@wordpress/compose';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Internal dependencies
|
|
@@ -64,6 +65,8 @@ function RevisionsSlider() {
|
|
|
64
65
|
useDispatch( editorStore )
|
|
65
66
|
);
|
|
66
67
|
|
|
68
|
+
const focusOnMountRef = useFocusOnMount( true );
|
|
69
|
+
|
|
67
70
|
const isLoading = ! rawRevisions;
|
|
68
71
|
const totalPages = Math.ceil( totalRevisions / perPage ) || 1;
|
|
69
72
|
|
|
@@ -132,7 +135,7 @@ function RevisionsSlider() {
|
|
|
132
135
|
<Spinner />
|
|
133
136
|
) : (
|
|
134
137
|
<RangeControl
|
|
135
|
-
|
|
138
|
+
ref={ focusOnMountRef }
|
|
136
139
|
aria-valuetext={ renderTooltipContent( selectedIndex ) }
|
|
137
140
|
className="editor-revisions-header__slider"
|
|
138
141
|
hideLabelFromVision
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
serialize,
|
|
10
10
|
} from '@wordpress/blocks';
|
|
11
11
|
import { RichTextData } from '@wordpress/rich-text';
|
|
12
|
-
import * as paragraphBlock from '@wordpress/block-library/
|
|
13
|
-
import * as groupBlock from '@wordpress/block-library/
|
|
12
|
+
import * as paragraphBlock from '@wordpress/block-library/build-module/paragraph/index.mjs';
|
|
13
|
+
import * as groupBlock from '@wordpress/block-library/build-module/group/index.mjs';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Internal dependencies
|
|
@@ -417,7 +417,6 @@ export function HierarchicalTermSelector( { slug } ) {
|
|
|
417
417
|
<Flex direction="column" gap="4">
|
|
418
418
|
{ showFilter && ! loading && (
|
|
419
419
|
<SearchControl
|
|
420
|
-
__next40pxDefaultSize
|
|
421
420
|
label={ filterLabel }
|
|
422
421
|
placeholder={ filterLabel }
|
|
423
422
|
value={ filterValue }
|
|
@@ -470,7 +469,6 @@ export function HierarchicalTermSelector( { slug } ) {
|
|
|
470
469
|
/>
|
|
471
470
|
{ !! availableTerms.length && (
|
|
472
471
|
<TreeSelect
|
|
473
|
-
__next40pxDefaultSize
|
|
474
472
|
label={ parentSelectLabel }
|
|
475
473
|
noOptionLabel={ noParentOption }
|
|
476
474
|
onChange={ onChangeFormParent }
|
|
@@ -126,30 +126,48 @@ function PreferencesModalContents( { extraSections = {} } ) {
|
|
|
126
126
|
label={ __( 'Show starter patterns' ) }
|
|
127
127
|
/>
|
|
128
128
|
{ showCollaborationOptions && (
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
'Show avatar in blocks'
|
|
138
|
-
) }
|
|
139
|
-
/>
|
|
140
|
-
<PreferenceToggleControl
|
|
141
|
-
scope="core"
|
|
142
|
-
featureName="showCollaborationNotifications"
|
|
143
|
-
help={ __(
|
|
144
|
-
'Show notifications when collaborators join, leave, or save the post.'
|
|
145
|
-
) }
|
|
146
|
-
label={ __(
|
|
147
|
-
'Show collaboration notifications'
|
|
148
|
-
) }
|
|
149
|
-
/>
|
|
150
|
-
</>
|
|
129
|
+
<PreferenceToggleControl
|
|
130
|
+
scope="core"
|
|
131
|
+
featureName="showCollaborationCursor"
|
|
132
|
+
help={ __(
|
|
133
|
+
'Show your own avatar inside blocks during collaborative editing sessions.'
|
|
134
|
+
) }
|
|
135
|
+
label={ __( 'Show avatar in blocks' ) }
|
|
136
|
+
/>
|
|
151
137
|
) }
|
|
152
138
|
</PreferencesModalSection>
|
|
139
|
+
{ showCollaborationOptions && (
|
|
140
|
+
<PreferencesModalSection
|
|
141
|
+
title={ __(
|
|
142
|
+
'Collaboration notifications'
|
|
143
|
+
) }
|
|
144
|
+
>
|
|
145
|
+
<PreferenceToggleControl
|
|
146
|
+
scope="core"
|
|
147
|
+
featureName="showCollaborationJoinNotifications"
|
|
148
|
+
help={ __(
|
|
149
|
+
'Show notifications when collaborators join the post.'
|
|
150
|
+
) }
|
|
151
|
+
label={ __( 'Collaborator joined' ) }
|
|
152
|
+
/>
|
|
153
|
+
<PreferenceToggleControl
|
|
154
|
+
scope="core"
|
|
155
|
+
featureName="showCollaborationLeaveNotifications"
|
|
156
|
+
help={ __(
|
|
157
|
+
'Show notifications when collaborators leave the post.'
|
|
158
|
+
) }
|
|
159
|
+
label={ __( 'Collaborator left' ) }
|
|
160
|
+
/>
|
|
161
|
+
<PreferenceToggleControl
|
|
162
|
+
scope="core"
|
|
163
|
+
featureName="showCollaborationPostSaveNotifications"
|
|
164
|
+
help={ __(
|
|
165
|
+
'Show notifications when collaborators save, update, or publish the post.'
|
|
166
|
+
) }
|
|
167
|
+
label={ __( 'Post updated' ) }
|
|
168
|
+
/>
|
|
169
|
+
</PreferencesModalSection>
|
|
170
|
+
) }
|
|
153
171
|
<PreferencesModalSection
|
|
154
172
|
title={ __( 'Document settings' ) }
|
|
155
173
|
description={ __(
|
|
@@ -2,22 +2,84 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { render, screen } from '@testing-library/react';
|
|
5
|
+
import userEvent from '@testing-library/user-event';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* WordPress dependencies
|
|
8
9
|
*/
|
|
9
10
|
import { useSelect } from '@wordpress/data';
|
|
11
|
+
import { useViewportMatch } from '@wordpress/compose';
|
|
12
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
13
|
+
import { store as interfaceStore } from '@wordpress/interface';
|
|
14
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
15
|
+
import { SlotFillProvider } from '@wordpress/components';
|
|
10
16
|
|
|
11
17
|
/**
|
|
12
18
|
* Internal dependencies
|
|
13
19
|
*/
|
|
14
20
|
import EditPostPreferencesModal from '../';
|
|
21
|
+
import { store as editorStore } from '../../../store';
|
|
22
|
+
import { lock } from '../../../lock-unlock';
|
|
15
23
|
|
|
16
24
|
// This allows us to tweak the returned value on each test.
|
|
17
25
|
jest.mock( '@wordpress/data/src/components/use-select', () => jest.fn() );
|
|
18
26
|
jest.mock( '@wordpress/compose/src/hooks/use-viewport-match', () => jest.fn() );
|
|
19
27
|
|
|
28
|
+
function setupActiveModal( preferences = {} ) {
|
|
29
|
+
const user = userEvent.setup();
|
|
30
|
+
const editorSelectors = {
|
|
31
|
+
getCurrentPostType: () => 'post',
|
|
32
|
+
getEditedPostAttribute: () => 'post',
|
|
33
|
+
isPublishSidebarEnabled: () => false,
|
|
34
|
+
};
|
|
35
|
+
lock( editorSelectors, {
|
|
36
|
+
getEditorSettings: () => ( {
|
|
37
|
+
richEditingEnabled: true,
|
|
38
|
+
} ),
|
|
39
|
+
isCollaborationEnabledForCurrentPost: () => true,
|
|
40
|
+
} );
|
|
41
|
+
|
|
42
|
+
useViewportMatch.mockReturnValue( true );
|
|
43
|
+
useSelect.mockImplementation( ( mapSelect ) =>
|
|
44
|
+
mapSelect( ( store ) => {
|
|
45
|
+
if ( store === interfaceStore ) {
|
|
46
|
+
return {
|
|
47
|
+
isModalActive: () => true,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
if ( store === editorStore ) {
|
|
51
|
+
return editorSelectors;
|
|
52
|
+
}
|
|
53
|
+
if ( store === preferencesStore ) {
|
|
54
|
+
return {
|
|
55
|
+
get: ( scope, featureName ) => preferences[ featureName ],
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if ( store === coreStore ) {
|
|
59
|
+
return {
|
|
60
|
+
getEntityRecords: () => [],
|
|
61
|
+
getPostType: () => ( { supports: {} } ),
|
|
62
|
+
getThemeSupports: () => ( {} ),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
} )
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
render(
|
|
69
|
+
<SlotFillProvider>
|
|
70
|
+
<EditPostPreferencesModal />
|
|
71
|
+
</SlotFillProvider>
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
return user;
|
|
75
|
+
}
|
|
76
|
+
|
|
20
77
|
describe( 'EditPostPreferencesModal', () => {
|
|
78
|
+
beforeEach( () => {
|
|
79
|
+
useSelect.mockReset();
|
|
80
|
+
useViewportMatch.mockReset();
|
|
81
|
+
} );
|
|
82
|
+
|
|
21
83
|
it( 'should not render when the modal is not active', () => {
|
|
22
84
|
useSelect.mockImplementation( () => false );
|
|
23
85
|
render( <EditPostPreferencesModal /> );
|
|
@@ -25,4 +87,25 @@ describe( 'EditPostPreferencesModal', () => {
|
|
|
25
87
|
screen.queryByRole( 'dialog', { name: 'Preferences' } )
|
|
26
88
|
).not.toBeInTheDocument();
|
|
27
89
|
} );
|
|
90
|
+
|
|
91
|
+
it( 'shows collaboration notification controls', async () => {
|
|
92
|
+
const user = setupActiveModal();
|
|
93
|
+
await user.click( screen.getByRole( 'tab', { name: 'General' } ) );
|
|
94
|
+
|
|
95
|
+
expect(
|
|
96
|
+
await screen.findByRole( 'checkbox', {
|
|
97
|
+
name: 'Collaborator joined',
|
|
98
|
+
} )
|
|
99
|
+
).toBeInTheDocument();
|
|
100
|
+
expect(
|
|
101
|
+
screen.getByRole( 'checkbox', {
|
|
102
|
+
name: 'Collaborator left',
|
|
103
|
+
} )
|
|
104
|
+
).toBeInTheDocument();
|
|
105
|
+
expect(
|
|
106
|
+
screen.getByRole( 'checkbox', {
|
|
107
|
+
name: 'Post updated',
|
|
108
|
+
} )
|
|
109
|
+
).toBeInTheDocument();
|
|
110
|
+
} );
|
|
28
111
|
} );
|
|
@@ -28,6 +28,7 @@ import { VisuallyHidden } from '@wordpress/ui';
|
|
|
28
28
|
*/
|
|
29
29
|
import { store as editorStore } from '../../store';
|
|
30
30
|
import PostPreviewButton from '../post-preview-button';
|
|
31
|
+
import { VIEWPORT_STATE_BY_DEVICE_TYPE } from '../../utils/device-type';
|
|
31
32
|
import { unlock } from '../../lock-unlock';
|
|
32
33
|
|
|
33
34
|
export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
@@ -39,13 +40,17 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
|
39
40
|
showIconLabels,
|
|
40
41
|
isTemplateHidden,
|
|
41
42
|
templateId,
|
|
43
|
+
isResponsiveEditing,
|
|
42
44
|
} = useSelect( ( select ) => {
|
|
43
45
|
const {
|
|
44
|
-
getDeviceType,
|
|
45
46
|
getCurrentPostType,
|
|
46
47
|
getCurrentTemplateId,
|
|
47
48
|
getRenderingMode,
|
|
48
|
-
|
|
49
|
+
getDeviceType,
|
|
50
|
+
} = unlock( select( editorStore ) );
|
|
51
|
+
const { isResponsiveEditing: _isResponsiveEditing } = unlock(
|
|
52
|
+
select( blockEditorStore )
|
|
53
|
+
);
|
|
49
54
|
const { getEntityRecord, getPostType } = select( coreStore );
|
|
50
55
|
const { get } = select( preferencesStore );
|
|
51
56
|
const _currentPostType = getCurrentPostType();
|
|
@@ -57,18 +62,30 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
|
57
62
|
showIconLabels: get( 'core', 'showIconLabels' ),
|
|
58
63
|
isTemplateHidden: getRenderingMode() === 'post-only',
|
|
59
64
|
templateId: getCurrentTemplateId(),
|
|
65
|
+
isResponsiveEditing: _isResponsiveEditing(),
|
|
60
66
|
};
|
|
61
67
|
}, [] );
|
|
62
68
|
const { setDeviceType, setRenderingMode, setDefaultRenderingMode } = unlock(
|
|
63
69
|
useDispatch( editorStore )
|
|
64
70
|
);
|
|
65
|
-
const { resetZoomLevel } =
|
|
71
|
+
const { resetZoomLevel, setStyleStateViewport, setResponsiveEditing } =
|
|
72
|
+
unlock( useDispatch( blockEditorStore ) );
|
|
66
73
|
|
|
67
74
|
const handleDevicePreviewChange = ( newDeviceType ) => {
|
|
68
75
|
setDeviceType( newDeviceType );
|
|
69
76
|
resetZoomLevel();
|
|
70
77
|
};
|
|
71
78
|
|
|
79
|
+
const handleResponsiveEditingChange = () => {
|
|
80
|
+
const newIsResponsiveEditing = ! isResponsiveEditing;
|
|
81
|
+
setResponsiveEditing( newIsResponsiveEditing );
|
|
82
|
+
setStyleStateViewport(
|
|
83
|
+
newIsResponsiveEditing
|
|
84
|
+
? VIEWPORT_STATE_BY_DEVICE_TYPE[ deviceType ] ?? 'default'
|
|
85
|
+
: 'default'
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
72
89
|
const isMobile = useViewportMatch( 'medium', '<' );
|
|
73
90
|
if ( isMobile ) {
|
|
74
91
|
return null;
|
|
@@ -107,16 +124,25 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
|
107
124
|
value: 'Desktop',
|
|
108
125
|
label: __( 'Desktop' ),
|
|
109
126
|
icon: desktop,
|
|
127
|
+
info: isResponsiveEditing
|
|
128
|
+
? __( 'Edit across all breakpoints.' )
|
|
129
|
+
: __( 'Preview desktop viewport.' ),
|
|
110
130
|
},
|
|
111
131
|
{
|
|
112
132
|
value: 'Tablet',
|
|
113
133
|
label: __( 'Tablet' ),
|
|
114
134
|
icon: tablet,
|
|
135
|
+
info: isResponsiveEditing
|
|
136
|
+
? __( 'Make tablet exclusive style changes.' )
|
|
137
|
+
: __( 'Preview tablet viewport.' ),
|
|
115
138
|
},
|
|
116
139
|
{
|
|
117
140
|
value: 'Mobile',
|
|
118
141
|
label: __( 'Mobile' ),
|
|
119
142
|
icon: mobile,
|
|
143
|
+
info: isResponsiveEditing
|
|
144
|
+
? __( 'Make mobile exclusive style changes.' )
|
|
145
|
+
: __( 'Preview mobile viewport.' ),
|
|
120
146
|
},
|
|
121
147
|
];
|
|
122
148
|
|
|
@@ -142,6 +168,19 @@ export default function PreviewDropdown( { forceIsAutosaveable, disabled } ) {
|
|
|
142
168
|
onSelect={ handleDevicePreviewChange }
|
|
143
169
|
/>
|
|
144
170
|
</MenuGroup>
|
|
171
|
+
<MenuGroup>
|
|
172
|
+
<MenuItem
|
|
173
|
+
icon={ isResponsiveEditing ? check : undefined }
|
|
174
|
+
isSelected={ isResponsiveEditing }
|
|
175
|
+
role="menuitemcheckbox"
|
|
176
|
+
onClick={ handleResponsiveEditingChange }
|
|
177
|
+
info={ __(
|
|
178
|
+
'Style changes apply only to the current viewport.'
|
|
179
|
+
) }
|
|
180
|
+
>
|
|
181
|
+
{ __( 'Responsive editing' ) }
|
|
182
|
+
</MenuItem>
|
|
183
|
+
</MenuGroup>
|
|
145
184
|
{ isTemplate && (
|
|
146
185
|
<MenuGroup>
|
|
147
186
|
<MenuItem
|