@wordpress/editor 12.8.0 → 12.11.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 +6 -0
- package/build/components/editor-help/help-section-title.native.js +43 -0
- package/build/components/editor-help/help-section-title.native.js.map +1 -0
- package/build/components/editor-help/help-topic-row.native.js +3 -2
- package/build/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build/components/editor-help/icon-move-blocks.native.js +23 -0
- package/build/components/editor-help/icon-move-blocks.native.js.map +1 -0
- package/build/components/editor-help/index.native.js +10 -11
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/editor-help/move-blocks.native.js +14 -2
- package/build/components/editor-help/move-blocks.native.js.map +1 -1
- package/build/components/editor-help/view-sections.native.js +21 -5
- package/build/components/editor-help/view-sections.native.js.map +1 -1
- package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
- package/build/components/index.js +12 -1
- package/build/components/index.js.map +1 -1
- package/build/components/local-autosave-monitor/index.js +24 -19
- package/build/components/local-autosave-monitor/index.js.map +1 -1
- package/build/components/page-attributes/parent.js +1 -1
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/post-author/select.js.map +1 -1
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-last-revision/check.js.map +1 -1
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-pending-status/check.js.map +1 -1
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-publish-button/index.js +4 -2
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js +5 -5
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-publish-panel/prepublish.js.map +1 -1
- package/build/components/post-schedule/index.js +11 -18
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-schedule/label.js +93 -13
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-sticky/index.js.map +1 -1
- package/build/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +7 -4
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-visibility/index.js +10 -11
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +0 -1
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +3 -1
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/template-validation-notice/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +1 -1
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/store/actions.js +5 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +1 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +2 -2
- package/build/store/selectors.js.map +1 -1
- package/build/utils/media-upload/index.js +4 -8
- package/build/utils/media-upload/index.js.map +1 -1
- package/build-module/components/editor-help/help-section-title.native.js +31 -0
- package/build-module/components/editor-help/help-section-title.native.js.map +1 -0
- package/build-module/components/editor-help/help-topic-row.native.js +3 -2
- package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build-module/components/editor-help/icon-move-blocks.native.js +13 -0
- package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -0
- package/build-module/components/editor-help/index.native.js +10 -12
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-help/move-blocks.native.js +15 -3
- package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/view-sections.native.js +22 -6
- package/build-module/components/editor-help/view-sections.native.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
- package/build-module/components/index.js +1 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/local-autosave-monitor/index.js +24 -18
- package/build-module/components/local-autosave-monitor/index.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +2 -2
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/post-author/select.js.map +1 -1
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-last-revision/check.js.map +1 -1
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-pending-status/check.js.map +1 -1
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +4 -1
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +5 -5
- package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-schedule/index.js +12 -19
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js +90 -13
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-slug/index.js.map +1 -1
- package/build-module/components/post-sticky/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +7 -4
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-visibility/index.js +12 -13
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +0 -1
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +4 -2
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/template-validation-notice/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +2 -2
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/store/actions.js +5 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +2 -2
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +2 -2
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/media-upload/index.js +3 -5
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/build-style/style-rtl.css +1 -17
- package/build-style/style.css +1 -17
- package/package.json +29 -29
- package/src/components/editor-help/help-section-title.native.js +29 -0
- package/src/components/editor-help/help-topic-row.native.js +2 -2
- package/src/components/editor-help/icon-move-blocks.native.js +10 -0
- package/src/components/editor-help/images/drag-and-drop-dark.png +0 -0
- package/src/components/editor-help/images/drag-and-drop-dark@2x.png +0 -0
- package/src/components/editor-help/images/drag-and-drop-dark@3x.png +0 -0
- package/src/components/editor-help/images/drag-and-drop-light.png +0 -0
- package/src/components/editor-help/images/drag-and-drop-light@2x.png +0 -0
- package/src/components/editor-help/images/drag-and-drop-light@3x.png +0 -0
- package/src/components/editor-help/index.native.js +26 -28
- package/src/components/editor-help/move-blocks.native.js +22 -2
- package/src/components/editor-help/style.scss +36 -4
- package/src/components/editor-help/view-sections.native.js +23 -8
- package/src/components/entities-saved-states/entity-record-item.js +6 -6
- package/src/components/entities-saved-states/index.js +6 -9
- package/src/components/global-keyboard-shortcuts/save-shortcut.js +2 -3
- package/src/components/index.js +4 -1
- package/src/components/local-autosave-monitor/index.js +39 -38
- package/src/components/page-attributes/parent.js +5 -8
- package/src/components/post-author/select.js +2 -3
- package/src/components/post-comments/index.js +4 -3
- package/src/components/post-format/index.js +2 -3
- package/src/components/post-last-revision/check.js +2 -4
- package/src/components/post-last-revision/index.js +2 -4
- package/src/components/post-pending-status/check.js +2 -5
- package/src/components/post-pingbacks/index.js +2 -3
- package/src/components/post-publish-button/index.js +7 -8
- package/src/components/post-publish-panel/index.js +2 -3
- package/src/components/post-publish-panel/maybe-category-panel.js +7 -5
- package/src/components/post-publish-panel/maybe-post-format-panel.js +2 -3
- package/src/components/post-publish-panel/postpublish.js +2 -5
- package/src/components/post-publish-panel/prepublish.js +2 -3
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +1 -1
- package/src/components/post-schedule/index.js +6 -13
- package/src/components/post-schedule/label.js +111 -17
- package/src/components/post-schedule/test/label.js +127 -15
- package/src/components/post-slug/index.js +2 -3
- package/src/components/post-sticky/index.js +2 -3
- package/src/components/post-switch-to-draft-button/index.js +2 -5
- package/src/components/post-taxonomies/flat-term-selector.js +9 -12
- package/src/components/post-taxonomies/hierarchical-term-selector.js +4 -6
- package/src/components/post-title/index.js +21 -31
- package/src/components/post-title/index.native.js +10 -16
- package/src/components/post-title/style.scss +1 -1
- package/src/components/post-trash/check.js +2 -3
- package/src/components/post-visibility/index.js +11 -17
- package/src/components/post-visibility/style.scss +0 -17
- package/src/components/provider/index.js +2 -3
- package/src/components/provider/index.native.js +12 -17
- package/src/components/provider/use-block-editor-settings.js +4 -8
- package/src/components/template-validation-notice/index.js +2 -3
- package/src/components/theme-support-check/index.js +2 -2
- package/src/hooks/custom-sources-backwards-compatibility.js +45 -44
- package/src/store/actions.js +213 -190
- package/src/store/reducer.js +2 -2
- package/src/store/selectors.js +16 -21
- package/src/store/test/selectors.js +13 -16
- package/src/utils/media-upload/index.js +2 -5
|
@@ -9,7 +9,7 @@ import { useNavigation } from '@react-navigation/native';
|
|
|
9
9
|
import { TextControl, Icon } from '@wordpress/components';
|
|
10
10
|
import { chevronRight } from '@wordpress/icons';
|
|
11
11
|
|
|
12
|
-
const HelpTopicRow = ( { label, icon, screenName } ) => {
|
|
12
|
+
const HelpTopicRow = ( { label, icon, screenName, isLastItem } ) => {
|
|
13
13
|
const navigation = useNavigation();
|
|
14
14
|
|
|
15
15
|
const openSubSheet = () => {
|
|
@@ -18,7 +18,7 @@ const HelpTopicRow = ( { label, icon, screenName } ) => {
|
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
20
|
<TextControl
|
|
21
|
-
separatorType=
|
|
21
|
+
separatorType={ isLastItem ? 'none' : 'leftMargin' }
|
|
22
22
|
customActionButton
|
|
23
23
|
leftAlign
|
|
24
24
|
onPress={ openSubSheet }
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { SVG, Path } from '@wordpress/primitives';
|
|
5
|
+
|
|
6
|
+
export default (
|
|
7
|
+
<SVG xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
8
|
+
<Path d="M9.53 17.47 9 16.94 7.94 18l.53.53 2 2 .53.53.53-.53 2-2 .53-.53L13 16.94l-.53.53-.72.72v-4.94h-1.5v4.94l-.72-.72Zm-1.06-14L7.94 4 9 5.06l.53-.53.72-.72v4.94h1.5V3.81l.72.72.53.53L14.06 4l-.53-.53-2-2L11 .94l-.53.53-2 2ZM4.53 9.53 5.06 9 4 7.94l-.53.53-2 2-.53.53.53.53 2 2 .53.53L5.06 13l-.53-.53-.72-.72h4.94v-1.5H3.81l.72-.72Zm14-1.06L18 7.94 16.94 9l.53.53.72.72h-4.94v1.5h4.94l-.72.72-.53.53L18 14.06l.53-.53 2-2 .53-.53-.53-.53-2-2Z" />
|
|
9
|
+
</SVG>
|
|
10
|
+
);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { kebabCase } from 'lodash';
|
|
5
|
-
import {
|
|
5
|
+
import { SafeAreaView, ScrollView, StyleSheet, View } from 'react-native';
|
|
6
6
|
import { TransitionPresets } from '@react-navigation/stack';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -14,16 +14,9 @@ import {
|
|
|
14
14
|
PanelBody,
|
|
15
15
|
} from '@wordpress/components';
|
|
16
16
|
import { __ } from '@wordpress/i18n';
|
|
17
|
-
import {
|
|
18
|
-
helpFilled,
|
|
19
|
-
plusCircleFilled,
|
|
20
|
-
alignJustify,
|
|
21
|
-
trash,
|
|
22
|
-
cog,
|
|
23
|
-
} from '@wordpress/icons';
|
|
17
|
+
import { helpFilled, plusCircleFilled, trash, cog } from '@wordpress/icons';
|
|
24
18
|
import { useSelect } from '@wordpress/data';
|
|
25
19
|
import { store as editorStore } from '@wordpress/editor';
|
|
26
|
-
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
27
20
|
import {
|
|
28
21
|
requestContactCustomerSupport,
|
|
29
22
|
requestGotoCustomerSupportOptions,
|
|
@@ -41,6 +34,8 @@ import AddBlocks from './add-blocks';
|
|
|
41
34
|
import MoveBlocks from './move-blocks';
|
|
42
35
|
import RemoveBlocks from './remove-blocks';
|
|
43
36
|
import CustomizeBlocks from './customize-blocks';
|
|
37
|
+
import moveBlocksIcon from './icon-move-blocks';
|
|
38
|
+
import HelpSectionTitle from './help-section-title';
|
|
44
39
|
|
|
45
40
|
const HELP_TOPICS = [
|
|
46
41
|
{
|
|
@@ -53,7 +48,7 @@ const HELP_TOPICS = [
|
|
|
53
48
|
icon: plusCircleFilled,
|
|
54
49
|
view: <AddBlocks />,
|
|
55
50
|
},
|
|
56
|
-
{ label: __( 'Move blocks' ), icon:
|
|
51
|
+
{ label: __( 'Move blocks' ), icon: moveBlocksIcon, view: <MoveBlocks /> },
|
|
57
52
|
{ label: __( 'Remove blocks' ), icon: trash, view: <RemoveBlocks /> },
|
|
58
53
|
{
|
|
59
54
|
label: __( 'Customize blocks' ),
|
|
@@ -67,11 +62,6 @@ function EditorHelpTopics( { close, isVisible, onClose } ) {
|
|
|
67
62
|
postType: select( editorStore ).getEditedPostAttribute( 'type' ),
|
|
68
63
|
} ) );
|
|
69
64
|
|
|
70
|
-
const sectionTitle = usePreferredColorSchemeStyle(
|
|
71
|
-
styles.helpDetailSectionHeading,
|
|
72
|
-
styles.helpDetailSectionHeadingDark
|
|
73
|
-
);
|
|
74
|
-
|
|
75
65
|
const title =
|
|
76
66
|
postType === 'page'
|
|
77
67
|
? __( 'How to edit your page' )
|
|
@@ -109,9 +99,10 @@ function EditorHelpTopics( { close, isVisible, onClose } ) {
|
|
|
109
99
|
</BottomSheet.NavBar>
|
|
110
100
|
<BottomSheetConsumer>
|
|
111
101
|
{ ( { listProps } ) => {
|
|
112
|
-
const contentContainerStyle =
|
|
113
|
-
|
|
114
|
-
|
|
102
|
+
const contentContainerStyle =
|
|
103
|
+
StyleSheet.flatten(
|
|
104
|
+
listProps.contentContainerStyle
|
|
105
|
+
);
|
|
115
106
|
return (
|
|
116
107
|
<ScrollView
|
|
117
108
|
{ ...listProps }
|
|
@@ -130,15 +121,21 @@ function EditorHelpTopics( { close, isVisible, onClose } ) {
|
|
|
130
121
|
} }
|
|
131
122
|
>
|
|
132
123
|
<PanelBody>
|
|
133
|
-
<
|
|
124
|
+
<HelpSectionTitle>
|
|
134
125
|
{ __( 'The basics' ) }
|
|
135
|
-
</
|
|
126
|
+
</HelpSectionTitle>
|
|
136
127
|
{ /* Print out help topics. */ }
|
|
137
128
|
{ HELP_TOPICS.map(
|
|
138
|
-
(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
129
|
+
(
|
|
130
|
+
{ label, icon },
|
|
131
|
+
index
|
|
132
|
+
) => {
|
|
133
|
+
const labelSlug =
|
|
134
|
+
kebabCase( label );
|
|
135
|
+
const isLastItem =
|
|
136
|
+
index ===
|
|
137
|
+
HELP_TOPICS.length -
|
|
138
|
+
1;
|
|
142
139
|
return (
|
|
143
140
|
<HelpTopicRow
|
|
144
141
|
key={
|
|
@@ -149,16 +146,17 @@ function EditorHelpTopics( { close, isVisible, onClose } ) {
|
|
|
149
146
|
screenName={
|
|
150
147
|
labelSlug
|
|
151
148
|
}
|
|
149
|
+
isLastItem={
|
|
150
|
+
isLastItem
|
|
151
|
+
}
|
|
152
152
|
/>
|
|
153
153
|
);
|
|
154
154
|
}
|
|
155
155
|
) }
|
|
156
156
|
{
|
|
157
|
-
<
|
|
158
|
-
style={ sectionTitle }
|
|
159
|
-
>
|
|
157
|
+
<HelpSectionTitle>
|
|
160
158
|
{ __( 'Get support' ) }
|
|
161
|
-
</
|
|
159
|
+
</HelpSectionTitle>
|
|
162
160
|
}
|
|
163
161
|
{
|
|
164
162
|
<HelpGetSupportButton
|
|
@@ -12,19 +12,39 @@ import { __ } from '@wordpress/i18n';
|
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
14
|
import styles from './style.scss';
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
HelpDetailBodyText,
|
|
17
|
+
HelpDetailImage,
|
|
18
|
+
HelpDetailSectionHeadingText,
|
|
19
|
+
} from './view-sections';
|
|
16
20
|
|
|
17
21
|
const MoveBlocks = () => {
|
|
18
22
|
return (
|
|
19
23
|
<>
|
|
24
|
+
<HelpDetailImage
|
|
25
|
+
source={ require( './images/drag-and-drop-light.png' ) }
|
|
26
|
+
sourceDarkMode={ require( './images/drag-and-drop-dark.png' ) }
|
|
27
|
+
/>
|
|
28
|
+
<View style={ styles.helpDetailContainer }>
|
|
29
|
+
<HelpDetailSectionHeadingText
|
|
30
|
+
text={ __( 'Drag & drop' ) }
|
|
31
|
+
badge={ __( 'NEW' ) }
|
|
32
|
+
/>
|
|
33
|
+
<HelpDetailBodyText
|
|
34
|
+
text={ __(
|
|
35
|
+
'Drag & drop makes rearranging blocks a breeze. Press and hold on a block, then drag it to its new location and release.'
|
|
36
|
+
) }
|
|
37
|
+
/>
|
|
38
|
+
</View>
|
|
20
39
|
<HelpDetailImage
|
|
21
40
|
source={ require( './images/move-light.png' ) }
|
|
22
41
|
sourceDarkMode={ require( './images/move-dark.png' ) }
|
|
23
42
|
/>
|
|
24
43
|
<View style={ styles.helpDetailContainer }>
|
|
44
|
+
<HelpDetailSectionHeadingText text={ __( 'Arrow buttons' ) } />
|
|
25
45
|
<HelpDetailBodyText
|
|
26
46
|
text={ __(
|
|
27
|
-
'You can rearrange blocks by tapping a block and then tapping the up and down arrows that appear on the bottom left side of the block to move it
|
|
47
|
+
'You can also rearrange blocks by tapping a block and then tapping the up and down arrows that appear on the bottom left side of the block to move it up or down.'
|
|
28
48
|
) }
|
|
29
49
|
/>
|
|
30
50
|
</View>
|
|
@@ -31,6 +31,21 @@
|
|
|
31
31
|
padding: 0;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
.helpSectionTitleContainer {
|
|
35
|
+
margin-top: 24px;
|
|
36
|
+
margin-bottom: 16px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.helpSectionTitle {
|
|
40
|
+
color: $light-primary;
|
|
41
|
+
font-weight: 600;
|
|
42
|
+
font-size: 16px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.helpSectionTitleDark {
|
|
46
|
+
color: $dark-secondary;
|
|
47
|
+
}
|
|
48
|
+
|
|
34
49
|
.helpDetailContainer {
|
|
35
50
|
padding: 0 16px;
|
|
36
51
|
}
|
|
@@ -62,14 +77,18 @@
|
|
|
62
77
|
}
|
|
63
78
|
|
|
64
79
|
.helpDetailSectionHeading {
|
|
80
|
+
flex-direction: row;
|
|
81
|
+
align-items: center;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.helpDetailSectionHeadingText {
|
|
65
85
|
color: $light-primary;
|
|
66
|
-
font-weight:
|
|
86
|
+
font-weight: 700;
|
|
67
87
|
font-size: 16px;
|
|
68
|
-
margin-top: 24px;
|
|
69
88
|
}
|
|
70
89
|
|
|
71
|
-
.
|
|
72
|
-
color: $dark-
|
|
90
|
+
.helpDetailSectionHeadingTextDark {
|
|
91
|
+
color: $dark-primary;
|
|
73
92
|
}
|
|
74
93
|
|
|
75
94
|
.helpDetailBody {
|
|
@@ -81,3 +100,16 @@
|
|
|
81
100
|
.helpDetailBodyDark {
|
|
82
101
|
color: $dark-secondary;
|
|
83
102
|
}
|
|
103
|
+
|
|
104
|
+
.helpDetailBadgeContainer {
|
|
105
|
+
padding: 2px 6px;
|
|
106
|
+
margin-right: 8px;
|
|
107
|
+
border-radius: 6px;
|
|
108
|
+
background-color: #c9356e;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.helpDetailBadgeText {
|
|
112
|
+
color: $white;
|
|
113
|
+
font-weight: 500;
|
|
114
|
+
font-size: 12px;
|
|
115
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { Text, Image } from 'react-native';
|
|
4
|
+
import { Text, Image, View } from 'react-native';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -28,15 +28,22 @@ export const HelpDetailBodyText = ( { text } ) => {
|
|
|
28
28
|
);
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
export const HelpDetailSectionHeadingText = ( { text } ) => {
|
|
32
|
-
const
|
|
33
|
-
styles.
|
|
34
|
-
styles.
|
|
31
|
+
export const HelpDetailSectionHeadingText = ( { text, badge } ) => {
|
|
32
|
+
const headingTextStyle = usePreferredColorSchemeStyle(
|
|
33
|
+
styles.helpDetailSectionHeadingText,
|
|
34
|
+
styles.helpDetailSectionHeadingTextDark
|
|
35
35
|
);
|
|
36
36
|
return (
|
|
37
|
-
<
|
|
38
|
-
{ text }
|
|
39
|
-
|
|
37
|
+
<View style={ styles.helpDetailSectionHeading }>
|
|
38
|
+
{ badge && <HelpDetailBadge text={ badge } /> }
|
|
39
|
+
<Text
|
|
40
|
+
accessibilityRole="header"
|
|
41
|
+
selectable
|
|
42
|
+
style={ headingTextStyle }
|
|
43
|
+
>
|
|
44
|
+
{ text }
|
|
45
|
+
</Text>
|
|
46
|
+
</View>
|
|
40
47
|
);
|
|
41
48
|
};
|
|
42
49
|
|
|
@@ -62,3 +69,11 @@ export const HelpDetailImage = ( {
|
|
|
62
69
|
/>
|
|
63
70
|
);
|
|
64
71
|
};
|
|
72
|
+
|
|
73
|
+
const HelpDetailBadge = ( { text } ) => {
|
|
74
|
+
return (
|
|
75
|
+
<View style={ styles.helpDetailBadgeContainer }>
|
|
76
|
+
<Text style={ styles.helpDetailBadgeText }>{ text }</Text>
|
|
77
|
+
</View>
|
|
78
|
+
);
|
|
79
|
+
};
|
|
@@ -57,18 +57,18 @@ export default function EntityRecordItem( {
|
|
|
57
57
|
|
|
58
58
|
const isSelected = useSelect(
|
|
59
59
|
( select ) => {
|
|
60
|
-
const selectedBlockId =
|
|
61
|
-
blockEditorStore
|
|
62
|
-
).getSelectedBlockClientId();
|
|
60
|
+
const selectedBlockId =
|
|
61
|
+
select( blockEditorStore ).getSelectedBlockClientId();
|
|
63
62
|
return selectedBlockId === parentBlockId;
|
|
64
63
|
},
|
|
65
64
|
[ parentBlockId ]
|
|
66
65
|
);
|
|
67
66
|
const isSelectedText = isSelected ? __( 'Selected' ) : __( 'Select' );
|
|
68
67
|
const { selectBlock } = useDispatch( blockEditorStore );
|
|
69
|
-
const selectParentBlock = useCallback(
|
|
70
|
-
parentBlockId,
|
|
71
|
-
|
|
68
|
+
const selectParentBlock = useCallback(
|
|
69
|
+
() => selectBlock( parentBlockId ),
|
|
70
|
+
[ parentBlockId ]
|
|
71
|
+
);
|
|
72
72
|
const selectAndDismiss = useCallback( () => {
|
|
73
73
|
selectBlock( parentBlockId );
|
|
74
74
|
closePanel();
|
|
@@ -39,9 +39,8 @@ const PUBLISH_ON_SAVE_ENTITIES = [
|
|
|
39
39
|
export default function EntitiesSavedStates( { close } ) {
|
|
40
40
|
const saveButtonRef = useRef();
|
|
41
41
|
const { dirtyEntityRecords } = useSelect( ( select ) => {
|
|
42
|
-
const dirtyRecords =
|
|
43
|
-
coreStore
|
|
44
|
-
).__experimentalGetDirtyEntityRecords();
|
|
42
|
+
const dirtyRecords =
|
|
43
|
+
select( coreStore ).__experimentalGetDirtyEntityRecords();
|
|
45
44
|
|
|
46
45
|
// Remove site object and decouple into its edited pieces.
|
|
47
46
|
const dirtyRecordsWithoutSite = dirtyRecords.filter(
|
|
@@ -77,13 +76,11 @@ export default function EntitiesSavedStates( { close } ) {
|
|
|
77
76
|
__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,
|
|
78
77
|
} = useDispatch( coreStore );
|
|
79
78
|
|
|
80
|
-
const { __unstableMarkLastChangeAsPersistent } =
|
|
81
|
-
blockEditorStore
|
|
82
|
-
);
|
|
79
|
+
const { __unstableMarkLastChangeAsPersistent } =
|
|
80
|
+
useDispatch( blockEditorStore );
|
|
83
81
|
|
|
84
|
-
const { createSuccessNotice, createErrorNotice } =
|
|
85
|
-
noticesStore
|
|
86
|
-
);
|
|
82
|
+
const { createSuccessNotice, createErrorNotice } =
|
|
83
|
+
useDispatch( noticesStore );
|
|
87
84
|
|
|
88
85
|
// To group entities by type.
|
|
89
86
|
const partitionedSavables = groupBy( dirtyEntityRecords, 'name' );
|
|
@@ -12,9 +12,8 @@ import { store as editorStore } from '../../store';
|
|
|
12
12
|
|
|
13
13
|
function SaveShortcut( { resetBlocksOnSave } ) {
|
|
14
14
|
const { resetEditorBlocks, savePost } = useDispatch( editorStore );
|
|
15
|
-
const { isEditedPostDirty, getPostEdits, isPostSavingLocked } =
|
|
16
|
-
editorStore
|
|
17
|
-
);
|
|
15
|
+
const { isEditedPostDirty, getPostEdits, isPostSavingLocked } =
|
|
16
|
+
useSelect( editorStore );
|
|
18
17
|
|
|
19
18
|
useShortcut( 'core/editor/save', ( event ) => {
|
|
20
19
|
event.preventDefault();
|
package/src/components/index.js
CHANGED
|
@@ -41,7 +41,10 @@ export { default as PostPublishPanel } from './post-publish-panel';
|
|
|
41
41
|
export { default as PostSavedState } from './post-saved-state';
|
|
42
42
|
export { default as PostSchedule } from './post-schedule';
|
|
43
43
|
export { default as PostScheduleCheck } from './post-schedule/check';
|
|
44
|
-
export {
|
|
44
|
+
export {
|
|
45
|
+
default as PostScheduleLabel,
|
|
46
|
+
usePostScheduleLabel,
|
|
47
|
+
} from './post-schedule/label';
|
|
45
48
|
export { default as PostSlug } from './post-slug';
|
|
46
49
|
export { default as PostSlugCheck } from './post-slug/check';
|
|
47
50
|
export { default as PostSticky } from './post-sticky';
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { once, uniqueId, omit } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -27,23 +22,30 @@ const requestIdleCallback = window.requestIdleCallback
|
|
|
27
22
|
? window.requestIdleCallback
|
|
28
23
|
: window.requestAnimationFrame;
|
|
29
24
|
|
|
25
|
+
let hasStorageSupport;
|
|
26
|
+
let uniqueId = 0;
|
|
27
|
+
|
|
30
28
|
/**
|
|
31
29
|
* Function which returns true if the current environment supports browser
|
|
32
30
|
* sessionStorage, or false otherwise. The result of this function is cached and
|
|
33
31
|
* reused in subsequent invocations.
|
|
34
32
|
*/
|
|
35
|
-
const hasSessionStorageSupport =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
const hasSessionStorageSupport = () => {
|
|
34
|
+
if ( typeof hasStorageSupport === 'undefined' ) {
|
|
35
|
+
try {
|
|
36
|
+
// Private Browsing in Safari 10 and earlier will throw an error when
|
|
37
|
+
// attempting to set into sessionStorage. The test here is intentional in
|
|
38
|
+
// causing a thrown error as condition bailing from local autosave.
|
|
39
|
+
window.sessionStorage.setItem( '__wpEditorTestSessionStorage', '' );
|
|
40
|
+
window.sessionStorage.removeItem( '__wpEditorTestSessionStorage' );
|
|
41
|
+
hasStorageSupport = true;
|
|
42
|
+
} catch ( error ) {
|
|
43
|
+
hasStorageSupport = false;
|
|
44
|
+
}
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
|
|
47
|
+
return hasStorageSupport;
|
|
48
|
+
};
|
|
47
49
|
|
|
48
50
|
/**
|
|
49
51
|
* Custom hook which manages the creation of a notice prompting the user to
|
|
@@ -54,8 +56,8 @@ function useAutosaveNotice() {
|
|
|
54
56
|
( select ) => ( {
|
|
55
57
|
postId: select( editorStore ).getCurrentPostId(),
|
|
56
58
|
isEditedPostNew: select( editorStore ).isEditedPostNew(),
|
|
57
|
-
hasRemoteAutosave:
|
|
58
|
-
.autosave,
|
|
59
|
+
hasRemoteAutosave:
|
|
60
|
+
!! select( editorStore ).getEditorSettings().autosave,
|
|
59
61
|
} ),
|
|
60
62
|
[]
|
|
61
63
|
);
|
|
@@ -98,7 +100,7 @@ function useAutosaveNotice() {
|
|
|
98
100
|
return;
|
|
99
101
|
}
|
|
100
102
|
|
|
101
|
-
const noticeId = uniqueId
|
|
103
|
+
const noticeId = `wpEditorAutosaveRestore${ ++uniqueId }`;
|
|
102
104
|
createWarningNotice(
|
|
103
105
|
__(
|
|
104
106
|
'The backup of this post in your browser is different from the version below.'
|
|
@@ -109,7 +111,11 @@ function useAutosaveNotice() {
|
|
|
109
111
|
{
|
|
110
112
|
label: __( 'Restore the backup' ),
|
|
111
113
|
onClick() {
|
|
112
|
-
|
|
114
|
+
const {
|
|
115
|
+
content: editsContent,
|
|
116
|
+
...editsWithoutContent
|
|
117
|
+
} = edits;
|
|
118
|
+
editPost( editsWithoutContent );
|
|
113
119
|
resetEditorBlocks( parse( edits.content ) );
|
|
114
120
|
removeNotice( noticeId );
|
|
115
121
|
},
|
|
@@ -124,22 +130,17 @@ function useAutosaveNotice() {
|
|
|
124
130
|
* Custom hook which ejects a local autosave after a successful save occurs.
|
|
125
131
|
*/
|
|
126
132
|
function useAutosavePurge() {
|
|
127
|
-
const {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
isAutosaving: select( editorStore ).isAutosavingPost(),
|
|
139
|
-
didError: select( editorStore ).didPostSaveRequestFail(),
|
|
140
|
-
} ),
|
|
141
|
-
[]
|
|
142
|
-
);
|
|
133
|
+
const { postId, isEditedPostNew, isDirty, isAutosaving, didError } =
|
|
134
|
+
useSelect(
|
|
135
|
+
( select ) => ( {
|
|
136
|
+
postId: select( editorStore ).getCurrentPostId(),
|
|
137
|
+
isEditedPostNew: select( editorStore ).isEditedPostNew(),
|
|
138
|
+
isDirty: select( editorStore ).isEditedPostDirty(),
|
|
139
|
+
isAutosaving: select( editorStore ).isAutosavingPost(),
|
|
140
|
+
didError: select( editorStore ).didPostSaveRequestFail(),
|
|
141
|
+
} ),
|
|
142
|
+
[]
|
|
143
|
+
);
|
|
143
144
|
|
|
144
145
|
const lastIsDirty = useRef( isDirty );
|
|
145
146
|
const lastIsAutosaving = useRef( isAutosaving );
|
|
@@ -177,8 +178,8 @@ function LocalAutosaveMonitor() {
|
|
|
177
178
|
|
|
178
179
|
const { localAutosaveInterval } = useSelect(
|
|
179
180
|
( select ) => ( {
|
|
180
|
-
localAutosaveInterval:
|
|
181
|
-
.localAutosaveInterval,
|
|
181
|
+
localAutosaveInterval:
|
|
182
|
+
select( editorStore ).getEditorSettings().localAutosaveInterval,
|
|
182
183
|
} ),
|
|
183
184
|
[]
|
|
184
185
|
);
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
debounce,
|
|
8
8
|
repeat,
|
|
9
9
|
find,
|
|
10
|
-
flatten,
|
|
11
10
|
deburr,
|
|
12
11
|
} from 'lodash';
|
|
13
12
|
|
|
@@ -52,12 +51,10 @@ export function PageAttributesParent() {
|
|
|
52
51
|
const [ fieldValue, setFieldValue ] = useState( false );
|
|
53
52
|
const { parentPost, parentPostId, items, postType } = useSelect(
|
|
54
53
|
( select ) => {
|
|
55
|
-
const { getPostType, getEntityRecords, getEntityRecord } =
|
|
56
|
-
coreStore
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
editorStore
|
|
60
|
-
);
|
|
54
|
+
const { getPostType, getEntityRecords, getEntityRecord } =
|
|
55
|
+
select( coreStore );
|
|
56
|
+
const { getCurrentPostId, getEditedPostAttribute } =
|
|
57
|
+
select( editorStore );
|
|
61
58
|
const postTypeSlug = getEditedPostAttribute( 'type' );
|
|
62
59
|
const pageId = getEditedPostAttribute( 'parent' );
|
|
63
60
|
const pType = getPostType( postTypeSlug );
|
|
@@ -113,7 +110,7 @@ export function PageAttributesParent() {
|
|
|
113
110
|
return priorityA >= priorityB ? 1 : -1;
|
|
114
111
|
} );
|
|
115
112
|
|
|
116
|
-
return
|
|
113
|
+
return sortedNodes.flat();
|
|
117
114
|
};
|
|
118
115
|
|
|
119
116
|
let tree = pageItems.map( ( item ) => ( {
|
|
@@ -18,9 +18,8 @@ function PostAuthorSelect() {
|
|
|
18
18
|
const { editPost } = useDispatch( editorStore );
|
|
19
19
|
const { postAuthor, authors } = useSelect( ( select ) => {
|
|
20
20
|
return {
|
|
21
|
-
postAuthor:
|
|
22
|
-
'author'
|
|
23
|
-
),
|
|
21
|
+
postAuthor:
|
|
22
|
+
select( editorStore ).getEditedPostAttribute( 'author' ),
|
|
24
23
|
authors: select( coreStore ).getUsers( AUTHORS_QUERY ),
|
|
25
24
|
};
|
|
26
25
|
}, [] );
|
|
@@ -29,9 +29,10 @@ function PostComments( { commentStatus = 'open', ...props } ) {
|
|
|
29
29
|
export default compose( [
|
|
30
30
|
withSelect( ( select ) => {
|
|
31
31
|
return {
|
|
32
|
-
commentStatus:
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
commentStatus:
|
|
33
|
+
select( editorStore ).getEditedPostAttribute(
|
|
34
|
+
'comment_status'
|
|
35
|
+
),
|
|
35
36
|
};
|
|
36
37
|
} ),
|
|
37
38
|
withDispatch( ( dispatch ) => ( {
|
|
@@ -49,9 +49,8 @@ export default function PostFormat() {
|
|
|
49
49
|
|
|
50
50
|
const { postFormat, suggestedFormat, supportedFormats } = useSelect(
|
|
51
51
|
( select ) => {
|
|
52
|
-
const { getEditedPostAttribute, getSuggestedPostFormat } =
|
|
53
|
-
editorStore
|
|
54
|
-
);
|
|
52
|
+
const { getEditedPostAttribute, getSuggestedPostFormat } =
|
|
53
|
+
select( editorStore );
|
|
55
54
|
const _postFormat = getEditedPostAttribute( 'format' );
|
|
56
55
|
const themeSupports = select( coreStore ).getThemeSupports();
|
|
57
56
|
return {
|
|
@@ -26,10 +26,8 @@ export function PostLastRevisionCheck( {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export default withSelect( ( select ) => {
|
|
29
|
-
const {
|
|
30
|
-
|
|
31
|
-
getCurrentPostRevisionsCount,
|
|
32
|
-
} = select( editorStore );
|
|
29
|
+
const { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =
|
|
30
|
+
select( editorStore );
|
|
33
31
|
return {
|
|
34
32
|
lastRevisionId: getCurrentPostLastRevisionId(),
|
|
35
33
|
revisionsCount: getCurrentPostRevisionsCount(),
|
|
@@ -35,10 +35,8 @@ function LastRevision( { lastRevisionId, revisionsCount } ) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export default withSelect( ( select ) => {
|
|
38
|
-
const {
|
|
39
|
-
|
|
40
|
-
getCurrentPostRevisionsCount,
|
|
41
|
-
} = select( editorStore );
|
|
38
|
+
const { getCurrentPostLastRevisionId, getCurrentPostRevisionsCount } =
|
|
39
|
+
select( editorStore );
|
|
42
40
|
return {
|
|
43
41
|
lastRevisionId: getCurrentPostLastRevisionId(),
|
|
44
42
|
revisionsCount: getCurrentPostRevisionsCount(),
|
|
@@ -28,11 +28,8 @@ export function PostPendingStatusCheck( {
|
|
|
28
28
|
|
|
29
29
|
export default compose(
|
|
30
30
|
withSelect( ( select ) => {
|
|
31
|
-
const {
|
|
32
|
-
|
|
33
|
-
getCurrentPostType,
|
|
34
|
-
getCurrentPost,
|
|
35
|
-
} = select( editorStore );
|
|
31
|
+
const { isCurrentPostPublished, getCurrentPostType, getCurrentPost } =
|
|
32
|
+
select( editorStore );
|
|
36
33
|
return {
|
|
37
34
|
hasPublishAction: get(
|
|
38
35
|
getCurrentPost(),
|
|
@@ -29,9 +29,8 @@ function PostPingbacks( { pingStatus = 'open', ...props } ) {
|
|
|
29
29
|
export default compose( [
|
|
30
30
|
withSelect( ( select ) => {
|
|
31
31
|
return {
|
|
32
|
-
pingStatus:
|
|
33
|
-
'ping_status'
|
|
34
|
-
),
|
|
32
|
+
pingStatus:
|
|
33
|
+
select( editorStore ).getEditedPostAttribute( 'ping_status' ),
|
|
35
34
|
};
|
|
36
35
|
} ),
|
|
37
36
|
withDispatch( ( dispatch ) => ( {
|