@wordpress/editor 11.0.1 → 12.0.2
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 +7 -0
- package/README.md +1 -1
- package/build/components/autosave-monitor/index.js +5 -0
- package/build/components/autosave-monitor/index.js.map +1 -1
- package/build/components/character-count/index.js +1 -1
- package/build/components/character-count/index.js.map +1 -1
- package/build/components/editor-help/add-blocks.native.js +6 -5
- package/build/components/editor-help/add-blocks.native.js.map +1 -1
- package/build/components/editor-help/customize-blocks.native.js +7 -6
- package/build/components/editor-help/customize-blocks.native.js.map +1 -1
- package/build/components/editor-help/help-detail-navigation-screen.native.js +29 -15
- package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build/components/editor-help/help-get-support-button.native.js +46 -0
- package/build/components/editor-help/help-get-support-button.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/index.native.js +87 -26
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/editor-help/intro-to-blocks.native.js +19 -9
- package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build/components/editor-help/move-blocks.native.js +6 -5
- package/build/components/editor-help/move-blocks.native.js.map +1 -1
- package/build/components/editor-help/remove-blocks.native.js +6 -5
- package/build/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build/components/editor-help/view-sections.native.js +23 -5
- package/build/components/editor-help/view-sections.native.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +22 -13
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/index.js +23 -4
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/save-shortcut.js +12 -14
- package/build/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/visual-editor-shortcuts.js +0 -4
- package/build/components/global-keyboard-shortcuts/visual-editor-shortcuts.js.map +1 -1
- package/build/components/index.js +9 -0
- package/build/components/index.js.map +1 -1
- package/build/components/local-autosave-monitor/index.js +1 -2
- package/build/components/local-autosave-monitor/index.js.map +1 -1
- package/build/components/post-format/index.js +3 -1
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-locked-modal/index.js +1 -1
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-saved-state/index.js +37 -46
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +154 -211
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-title/index.js +53 -25
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/provider/index.native.js +18 -7
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +32 -5
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/components/word-count/index.js +1 -1
- package/build/components/word-count/index.js.map +1 -1
- package/build/store/actions.js +13 -38
- package/build/store/actions.js.map +1 -1
- package/build/store/defaults.js +7 -2
- package/build/store/defaults.js.map +1 -1
- package/build/store/selectors.js +4 -93
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils/notice-builder.js +15 -18
- package/build/store/utils/notice-builder.js.map +1 -1
- package/build/{store/utils → utils}/get-template-part-icon.js +1 -1
- package/build/utils/get-template-part-icon.js.map +1 -0
- package/build/utils/index.js +8 -0
- package/build/utils/index.js.map +1 -1
- package/build-module/components/autosave-monitor/index.js +5 -0
- package/build-module/components/autosave-monitor/index.js.map +1 -1
- package/build-module/components/character-count/index.js +1 -1
- package/build-module/components/character-count/index.js.map +1 -1
- package/build-module/components/editor-help/add-blocks.native.js +7 -6
- package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/customize-blocks.native.js +8 -7
- package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js +31 -18
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build-module/components/editor-help/help-get-support-button.native.js +34 -0
- package/build-module/components/editor-help/help-get-support-button.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/index.native.js +81 -28
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-help/intro-to-blocks.native.js +19 -10
- package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/move-blocks.native.js +7 -6
- package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/remove-blocks.native.js +7 -6
- package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
- package/build-module/components/editor-help/view-sections.native.js +22 -5
- package/build-module/components/editor-help/view-sections.native.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js +24 -13
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +23 -4
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/save-shortcut.js +12 -14
- package/build-module/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/visual-editor-shortcuts.js +0 -4
- package/build-module/components/global-keyboard-shortcuts/visual-editor-shortcuts.js.map +1 -1
- package/build-module/components/index.js +1 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/local-autosave-monitor/index.js +1 -2
- package/build-module/components/local-autosave-monitor/index.js.map +1 -1
- package/build-module/components/post-format/index.js +4 -2
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +1 -1
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +38 -46
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +156 -214
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-title/index.js +53 -22
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +18 -7
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +31 -5
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/components/word-count/index.js +1 -1
- package/build-module/components/word-count/index.js.map +1 -1
- package/build-module/store/actions.js +13 -36
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +7 -2
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/selectors.js +3 -85
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils/notice-builder.js +15 -18
- package/build-module/store/utils/notice-builder.js.map +1 -1
- package/build-module/{store/utils → utils}/get-template-part-icon.js +2 -2
- package/build-module/utils/get-template-part-icon.js.map +1 -0
- package/build-module/utils/index.js +1 -0
- package/build-module/utils/index.js.map +1 -1
- package/build-style/style-rtl.css +9 -60
- package/build-style/style.css +9 -60
- package/package.json +28 -28
- package/src/components/autosave-monitor/index.js +5 -0
- package/src/components/autosave-monitor/test/index.js +10 -4
- package/src/components/character-count/index.js +3 -2
- package/src/components/editor-help/add-blocks.native.js +17 -12
- package/src/components/editor-help/customize-blocks.native.js +16 -13
- package/src/components/editor-help/help-detail-navigation-screen.native.js +45 -15
- package/src/components/editor-help/help-get-support-button.native.js +38 -0
- package/src/components/editor-help/help-topic-row.native.js +2 -2
- package/src/components/editor-help/images/add-dark.png +0 -0
- package/src/components/editor-help/images/add-dark@2x.png +0 -0
- package/src/components/editor-help/images/add-dark@3x.png +0 -0
- package/src/components/editor-help/images/add-light.png +0 -0
- package/src/components/editor-help/images/add-light@2x.png +0 -0
- package/src/components/editor-help/images/add-light@3x.png +0 -0
- package/src/components/editor-help/images/block-layout-collage.png +0 -0
- package/src/components/editor-help/images/block-layout-collage@2x.png +0 -0
- package/src/components/editor-help/images/block-layout-collage@3x.png +0 -0
- package/src/components/editor-help/images/build-layouts-dark.png +0 -0
- package/src/components/editor-help/images/build-layouts-dark@2x.png +0 -0
- package/src/components/editor-help/images/build-layouts-dark@3x.png +0 -0
- package/src/components/editor-help/images/build-layouts-light.png +0 -0
- package/src/components/editor-help/images/build-layouts-light@2x.png +0 -0
- package/src/components/editor-help/images/build-layouts-light@3x.png +0 -0
- package/src/components/editor-help/images/edit-media-dark.png +0 -0
- package/src/components/editor-help/images/edit-media-dark@2x.png +0 -0
- package/src/components/editor-help/images/edit-media-dark@3x.png +0 -0
- package/src/components/editor-help/images/edit-media-light.png +0 -0
- package/src/components/editor-help/images/edit-media-light@2x.png +0 -0
- package/src/components/editor-help/images/edit-media-light@3x.png +0 -0
- package/src/components/editor-help/images/embed-media-dark.png +0 -0
- package/src/components/editor-help/images/embed-media-dark@2x.png +0 -0
- package/src/components/editor-help/images/embed-media-dark@3x.png +0 -0
- package/src/components/editor-help/images/embed-media-light.png +0 -0
- package/src/components/editor-help/images/embed-media-light@2x.png +0 -0
- package/src/components/editor-help/images/embed-media-light@3x.png +0 -0
- package/src/components/editor-help/images/move-dark.png +0 -0
- package/src/components/editor-help/images/move-dark@2x.png +0 -0
- package/src/components/editor-help/images/move-dark@3x.png +0 -0
- package/src/components/editor-help/images/move-light.png +0 -0
- package/src/components/editor-help/images/move-light@2x.png +0 -0
- package/src/components/editor-help/images/move-light@3x.png +0 -0
- package/src/components/editor-help/images/options-dark.png +0 -0
- package/src/components/editor-help/images/options-dark@2x.png +0 -0
- package/src/components/editor-help/images/options-dark@3x.png +0 -0
- package/src/components/editor-help/images/options-light.png +0 -0
- package/src/components/editor-help/images/options-light@2x.png +0 -0
- package/src/components/editor-help/images/options-light@3x.png +0 -0
- package/src/components/editor-help/images/rich-text-dark.png +0 -0
- package/src/components/editor-help/images/rich-text-dark@2x.png +0 -0
- package/src/components/editor-help/images/rich-text-dark@3x.png +0 -0
- package/src/components/editor-help/images/rich-text-light.png +0 -0
- package/src/components/editor-help/images/rich-text-light@2x.png +0 -0
- package/src/components/editor-help/images/rich-text-light@3x.png +0 -0
- package/src/components/editor-help/images/settings-dark.png +0 -0
- package/src/components/editor-help/images/settings-dark@2x.png +0 -0
- package/src/components/editor-help/images/settings-dark@3x.png +0 -0
- package/src/components/editor-help/images/settings-light.png +0 -0
- package/src/components/editor-help/images/settings-light@2x.png +0 -0
- package/src/components/editor-help/images/settings-light@3x.png +0 -0
- package/src/components/editor-help/index.native.js +147 -43
- package/src/components/editor-help/intro-to-blocks.native.js +63 -43
- package/src/components/editor-help/move-blocks.native.js +12 -7
- package/src/components/editor-help/remove-blocks.native.js +11 -8
- package/src/components/editor-help/style.android.scss +6 -0
- package/src/components/editor-help/style.ios.scss +6 -0
- package/src/components/editor-help/style.scss +49 -32
- package/src/components/editor-help/test/index.native.js +80 -0
- package/src/components/editor-help/view-sections.native.js +47 -4
- package/src/components/entities-saved-states/entity-type-list.js +29 -10
- package/src/components/entities-saved-states/index.js +38 -8
- package/src/components/global-keyboard-shortcuts/save-shortcut.js +34 -42
- package/src/components/global-keyboard-shortcuts/visual-editor-shortcuts.js +8 -16
- package/src/components/index.js +1 -0
- package/src/components/local-autosave-monitor/index.js +1 -3
- package/src/components/post-format/index.js +6 -2
- package/src/components/post-format/style.scss +1 -0
- package/src/components/post-locked-modal/index.js +1 -1
- package/src/components/post-saved-state/index.js +41 -55
- package/src/components/post-saved-state/style.scss +10 -1
- package/src/components/post-saved-state/test/__snapshots__/index.js.snap +20 -0
- package/src/components/post-saved-state/test/index.js +2 -2
- package/src/components/post-taxonomies/flat-term-selector.js +220 -254
- package/src/components/post-title/index.js +47 -30
- package/src/components/post-title/style.scss +1 -70
- package/src/components/provider/index.native.js +17 -5
- package/src/components/provider/use-block-editor-settings.js +25 -2
- package/src/components/word-count/index.js +3 -2
- package/src/store/actions.js +13 -41
- package/src/store/defaults.js +7 -2
- package/src/store/selectors.js +2 -112
- package/src/store/test/actions.js +4 -2
- package/src/store/utils/notice-builder.js +17 -19
- package/src/store/utils/test/notice-builder.js +1 -1
- package/src/{store/utils → utils}/get-template-part-icon.js +2 -2
- package/src/utils/index.js +1 -0
- package/build/store/utils/get-template-part-icon.js.map +0 -1
- package/build-module/store/utils/get-template-part-icon.js.map +0 -1
- package/src/components/editor-help/images/add-blocks.png +0 -0
- package/src/components/editor-help/images/customize-blocks.png +0 -0
- package/src/components/editor-help/images/cut-copy-duplicate-blocks.png +0 -0
- package/src/components/editor-help/images/edit-or-replace-media.png +0 -0
- package/src/components/editor-help/images/intro-blocks-1.png +0 -0
- package/src/components/editor-help/images/intro-blocks-2.png +0 -0
- package/src/components/editor-help/images/intro-blocks-3.png +0 -0
- package/src/components/editor-help/images/intro-blocks-4.png +0 -0
- package/src/components/editor-help/images/move-blocks.png +0 -0
- package/src/components/editor-help/images/remove-blocks.png +0 -0
- package/src/components/editor-help/images/what-is-a-block.png +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { kebabCase } from 'lodash';
|
|
5
|
+
import { Text, SafeAreaView, ScrollView, StyleSheet, View } from 'react-native';
|
|
6
|
+
import { TransitionPresets } from '@react-navigation/stack';
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* WordPress dependencies
|
|
8
10
|
*/
|
|
9
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
BottomSheet,
|
|
13
|
+
BottomSheetConsumer,
|
|
14
|
+
PanelBody,
|
|
15
|
+
} from '@wordpress/components';
|
|
10
16
|
import { __ } from '@wordpress/i18n';
|
|
11
|
-
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
12
17
|
import {
|
|
13
18
|
helpFilled,
|
|
14
19
|
plusCircleFilled,
|
|
@@ -16,6 +21,13 @@ import {
|
|
|
16
21
|
trashFilled,
|
|
17
22
|
cogAlt,
|
|
18
23
|
} from '@wordpress/icons';
|
|
24
|
+
import { useSelect } from '@wordpress/data';
|
|
25
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
26
|
+
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
27
|
+
import {
|
|
28
|
+
requestContactCustomerSupport,
|
|
29
|
+
requestGotoCustomerSupportOptions,
|
|
30
|
+
} from '@wordpress/react-native-bridge';
|
|
19
31
|
|
|
20
32
|
/**
|
|
21
33
|
* Internal dependencies
|
|
@@ -23,6 +35,7 @@ import {
|
|
|
23
35
|
import styles from './style.scss';
|
|
24
36
|
import HelpDetailNavigationScreen from './help-detail-navigation-screen';
|
|
25
37
|
import HelpTopicRow from './help-topic-row';
|
|
38
|
+
import HelpGetSupportButton from './help-get-support-button';
|
|
26
39
|
import IntroToBlocks from './intro-to-blocks';
|
|
27
40
|
import AddBlocks from './add-blocks';
|
|
28
41
|
import MoveBlocks from './move-blocks';
|
|
@@ -49,12 +62,21 @@ const HELP_TOPICS = [
|
|
|
49
62
|
},
|
|
50
63
|
];
|
|
51
64
|
|
|
52
|
-
function EditorHelpTopics( { isVisible, onClose } ) {
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
function EditorHelpTopics( { close, isVisible, onClose } ) {
|
|
66
|
+
const { postType } = useSelect( ( select ) => ( {
|
|
67
|
+
postType: select( editorStore ).getEditedPostAttribute( 'type' ),
|
|
68
|
+
} ) );
|
|
69
|
+
|
|
70
|
+
const sectionTitle = usePreferredColorSchemeStyle(
|
|
71
|
+
styles.helpDetailSectionHeading,
|
|
72
|
+
styles.helpDetailSectionHeadingDark
|
|
56
73
|
);
|
|
57
74
|
|
|
75
|
+
const title =
|
|
76
|
+
postType === 'page'
|
|
77
|
+
? __( 'How to edit your page' )
|
|
78
|
+
: __( 'How to edit your post' );
|
|
79
|
+
|
|
58
80
|
return (
|
|
59
81
|
<BottomSheet
|
|
60
82
|
isVisible={ isVisible }
|
|
@@ -62,45 +84,127 @@ function EditorHelpTopics( { isVisible, onClose } ) {
|
|
|
62
84
|
hideHeader
|
|
63
85
|
hasNavigation
|
|
64
86
|
contentStyle={ styles.contentContainer }
|
|
87
|
+
testID="editor-help-modal"
|
|
65
88
|
>
|
|
66
|
-
<
|
|
67
|
-
<BottomSheet.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
<View style={ styles.separator } />
|
|
77
|
-
<PanelBody
|
|
78
|
-
title={ __( 'The basics' ) }
|
|
79
|
-
style={ styles.sectionContainer }
|
|
89
|
+
<SafeAreaView>
|
|
90
|
+
<BottomSheet.NavigationContainer
|
|
91
|
+
animate
|
|
92
|
+
main
|
|
93
|
+
style={ styles.navigationContainer }
|
|
94
|
+
>
|
|
95
|
+
<BottomSheet.NavigationScreen
|
|
96
|
+
isScrollable
|
|
97
|
+
fullScreen
|
|
98
|
+
name="help-topics"
|
|
80
99
|
>
|
|
81
|
-
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
label={ topic.label }
|
|
87
|
-
icon={ topic.icon }
|
|
100
|
+
<View style={ styles.container }>
|
|
101
|
+
<BottomSheet.NavBar>
|
|
102
|
+
<BottomSheet.NavBar.DismissButton
|
|
103
|
+
onPress={ close }
|
|
104
|
+
iosText={ __( 'Close' ) }
|
|
88
105
|
/>
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
106
|
+
<BottomSheet.NavBar.Heading>
|
|
107
|
+
{ title }
|
|
108
|
+
</BottomSheet.NavBar.Heading>
|
|
109
|
+
</BottomSheet.NavBar>
|
|
110
|
+
<BottomSheetConsumer>
|
|
111
|
+
{ ( { listProps } ) => {
|
|
112
|
+
const contentContainerStyle = StyleSheet.flatten(
|
|
113
|
+
listProps.contentContainerStyle
|
|
114
|
+
);
|
|
115
|
+
return (
|
|
116
|
+
<ScrollView
|
|
117
|
+
{ ...listProps }
|
|
118
|
+
contentContainerStyle={ {
|
|
119
|
+
...contentContainerStyle,
|
|
120
|
+
paddingBottom: Math.max(
|
|
121
|
+
listProps.safeAreaBottomInset,
|
|
122
|
+
contentContainerStyle.paddingBottom
|
|
123
|
+
),
|
|
124
|
+
/**
|
|
125
|
+
* Remove margin set via `hideHeader`. Combining a header
|
|
126
|
+
* and navigation in this bottom sheet is at odds with the
|
|
127
|
+
* current `BottomSheet` implementation.
|
|
128
|
+
*/
|
|
129
|
+
marginTop: 0,
|
|
130
|
+
} }
|
|
131
|
+
>
|
|
132
|
+
<PanelBody>
|
|
133
|
+
<Text style={ sectionTitle }>
|
|
134
|
+
{ __( 'The basics' ) }
|
|
135
|
+
</Text>
|
|
136
|
+
{ /* Print out help topics */ }
|
|
137
|
+
{ HELP_TOPICS.map(
|
|
138
|
+
( { label, icon } ) => {
|
|
139
|
+
const labelSlug = kebabCase(
|
|
140
|
+
label
|
|
141
|
+
);
|
|
142
|
+
return (
|
|
143
|
+
<HelpTopicRow
|
|
144
|
+
key={
|
|
145
|
+
labelSlug
|
|
146
|
+
}
|
|
147
|
+
label={ label }
|
|
148
|
+
icon={ icon }
|
|
149
|
+
screenName={
|
|
150
|
+
labelSlug
|
|
151
|
+
}
|
|
152
|
+
/>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
) }
|
|
156
|
+
{
|
|
157
|
+
<Text
|
|
158
|
+
style={ sectionTitle }
|
|
159
|
+
>
|
|
160
|
+
{ __( 'Get support' ) }
|
|
161
|
+
</Text>
|
|
162
|
+
}
|
|
163
|
+
{
|
|
164
|
+
<HelpGetSupportButton
|
|
165
|
+
title={ __(
|
|
166
|
+
'Contact support'
|
|
167
|
+
) }
|
|
168
|
+
onPress={
|
|
169
|
+
requestContactCustomerSupport
|
|
170
|
+
}
|
|
171
|
+
/>
|
|
172
|
+
}
|
|
173
|
+
{
|
|
174
|
+
<HelpGetSupportButton
|
|
175
|
+
title={ __(
|
|
176
|
+
'More support options'
|
|
177
|
+
) }
|
|
178
|
+
onPress={
|
|
179
|
+
requestGotoCustomerSupportOptions
|
|
180
|
+
}
|
|
181
|
+
/>
|
|
182
|
+
}
|
|
183
|
+
</PanelBody>
|
|
184
|
+
</ScrollView>
|
|
185
|
+
);
|
|
186
|
+
} }
|
|
187
|
+
</BottomSheetConsumer>
|
|
188
|
+
</View>
|
|
189
|
+
</BottomSheet.NavigationScreen>
|
|
190
|
+
{ /* Print out help detail screens */ }
|
|
191
|
+
{ HELP_TOPICS.map( ( { view, label } ) => {
|
|
192
|
+
const labelSlug = kebabCase( label );
|
|
193
|
+
return (
|
|
194
|
+
<HelpDetailNavigationScreen
|
|
195
|
+
key={ labelSlug }
|
|
196
|
+
name={ labelSlug }
|
|
197
|
+
content={ view }
|
|
198
|
+
label={ label }
|
|
199
|
+
options={ {
|
|
200
|
+
gestureEnabled: true,
|
|
201
|
+
...TransitionPresets.DefaultTransition,
|
|
202
|
+
} }
|
|
203
|
+
/>
|
|
204
|
+
);
|
|
205
|
+
} ) }
|
|
206
|
+
</BottomSheet.NavigationContainer>
|
|
207
|
+
</SafeAreaView>
|
|
104
208
|
</BottomSheet>
|
|
105
209
|
);
|
|
106
210
|
}
|
|
@@ -7,6 +7,7 @@ import { View, Text } from 'react-native';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { __ } from '@wordpress/i18n';
|
|
10
|
+
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Internal dependencies
|
|
@@ -19,52 +20,71 @@ import {
|
|
|
19
20
|
} from './view-sections';
|
|
20
21
|
|
|
21
22
|
const IntroToBlocks = () => {
|
|
23
|
+
const titleStyle = usePreferredColorSchemeStyle(
|
|
24
|
+
styles.helpDetailTitle,
|
|
25
|
+
styles.helpDetailTitleDark
|
|
26
|
+
);
|
|
22
27
|
return (
|
|
23
|
-
|
|
24
|
-
<HelpDetailImage
|
|
25
|
-
source={ require( './images/intro-blocks-1.png' ) }
|
|
26
|
-
/>
|
|
27
|
-
<Text style={ styles.helpDetailTitle }>
|
|
28
|
-
{ __( 'Welcome to the world of blocks' ) }
|
|
29
|
-
</Text>
|
|
30
|
-
<HelpDetailBodyText
|
|
31
|
-
text={ __(
|
|
32
|
-
'Blocks are pieces of content that you can insert, rearrange, and style without needing to know how to code. Blocks are an easy and modern way for you to create beautiful layouts.'
|
|
33
|
-
) }
|
|
34
|
-
/>
|
|
35
|
-
<HelpDetailSectionHeadingText text={ __( 'Rich text editing' ) } />
|
|
36
|
-
<HelpDetailBodyText
|
|
37
|
-
text={ __(
|
|
38
|
-
'Blocks allow you to focus on writing your content, knowing that all the formatting tools you need are there to help you get your message across.'
|
|
39
|
-
) }
|
|
40
|
-
/>
|
|
41
|
-
<HelpDetailImage
|
|
42
|
-
source={ require( './images/intro-blocks-2.png' ) }
|
|
43
|
-
/>
|
|
44
|
-
<HelpDetailSectionHeadingText text={ __( 'Embed media' ) } />
|
|
45
|
-
<HelpDetailBodyText
|
|
46
|
-
text={ __(
|
|
47
|
-
'Make your content stand out by adding images, gifs, videos, and embedded media to your pages.'
|
|
48
|
-
) }
|
|
49
|
-
/>
|
|
50
|
-
<HelpDetailImage
|
|
51
|
-
source={ require( './images/intro-blocks-3.png' ) }
|
|
52
|
-
/>
|
|
53
|
-
<HelpDetailSectionHeadingText text={ __( 'Build layouts' ) } />
|
|
54
|
-
<HelpDetailBodyText
|
|
55
|
-
text={ __(
|
|
56
|
-
'Arrange your content into columns, add Call to Action buttons, and overlay images with text.'
|
|
57
|
-
) }
|
|
58
|
-
/>
|
|
28
|
+
<>
|
|
59
29
|
<HelpDetailImage
|
|
60
|
-
source={ require( './images/
|
|
61
|
-
/>
|
|
62
|
-
<HelpDetailBodyText
|
|
63
|
-
text={ __(
|
|
64
|
-
'Give it a try by adding a few blocks to your post or page!'
|
|
65
|
-
) }
|
|
30
|
+
source={ require( './images/block-layout-collage.png' ) }
|
|
66
31
|
/>
|
|
67
|
-
|
|
32
|
+
<View style={ styles.helpDetailContainer }>
|
|
33
|
+
<Text
|
|
34
|
+
accessibilityRole="header"
|
|
35
|
+
selectable
|
|
36
|
+
style={ titleStyle }
|
|
37
|
+
>
|
|
38
|
+
{ __( 'Welcome to the world of blocks' ) }
|
|
39
|
+
</Text>
|
|
40
|
+
<HelpDetailBodyText
|
|
41
|
+
text={ __(
|
|
42
|
+
'Blocks are pieces of content that you can insert, rearrange, and style without needing to know how to code. Blocks are an easy and modern way for you to create beautiful layouts.'
|
|
43
|
+
) }
|
|
44
|
+
/>
|
|
45
|
+
<HelpDetailSectionHeadingText
|
|
46
|
+
text={ __( 'Rich text editing' ) }
|
|
47
|
+
/>
|
|
48
|
+
<HelpDetailBodyText
|
|
49
|
+
text={ __(
|
|
50
|
+
'Blocks allow you to focus on writing your content, knowing that all the formatting tools you need are there to help you get your message across.'
|
|
51
|
+
) }
|
|
52
|
+
/>
|
|
53
|
+
<HelpDetailImage
|
|
54
|
+
accessible={ true }
|
|
55
|
+
accessibilityLabel={ __(
|
|
56
|
+
'Text formatting controls are located within the toolbar positioned above the keyboard while editing a text block'
|
|
57
|
+
) }
|
|
58
|
+
source={ require( './images/rich-text-light.png' ) }
|
|
59
|
+
sourceDarkMode={ require( './images/rich-text-dark.png' ) }
|
|
60
|
+
/>
|
|
61
|
+
<HelpDetailSectionHeadingText text={ __( 'Embed media' ) } />
|
|
62
|
+
<HelpDetailBodyText
|
|
63
|
+
text={ __(
|
|
64
|
+
'Make your content stand out by adding images, gifs, videos, and embedded media to your pages.'
|
|
65
|
+
) }
|
|
66
|
+
/>
|
|
67
|
+
<HelpDetailImage
|
|
68
|
+
source={ require( './images/embed-media-light.png' ) }
|
|
69
|
+
sourceDarkMode={ require( './images/embed-media-dark.png' ) }
|
|
70
|
+
/>
|
|
71
|
+
<HelpDetailSectionHeadingText text={ __( 'Build layouts' ) } />
|
|
72
|
+
<HelpDetailBodyText
|
|
73
|
+
text={ __(
|
|
74
|
+
'Arrange your content into columns, add Call to Action buttons, and overlay images with text.'
|
|
75
|
+
) }
|
|
76
|
+
/>
|
|
77
|
+
<HelpDetailImage
|
|
78
|
+
source={ require( './images/build-layouts-light.png' ) }
|
|
79
|
+
sourceDarkMode={ require( './images/build-layouts-dark.png' ) }
|
|
80
|
+
/>
|
|
81
|
+
<HelpDetailBodyText
|
|
82
|
+
text={ __(
|
|
83
|
+
'Give it a try by adding a few blocks to your post or page!'
|
|
84
|
+
) }
|
|
85
|
+
/>
|
|
86
|
+
</View>
|
|
87
|
+
</>
|
|
68
88
|
);
|
|
69
89
|
};
|
|
70
90
|
|
|
@@ -16,14 +16,19 @@ import { HelpDetailBodyText, HelpDetailImage } from './view-sections';
|
|
|
16
16
|
|
|
17
17
|
const MoveBlocks = () => {
|
|
18
18
|
return (
|
|
19
|
-
|
|
20
|
-
<HelpDetailImage
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
'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 above or below other blocks.'
|
|
24
|
-
) }
|
|
19
|
+
<>
|
|
20
|
+
<HelpDetailImage
|
|
21
|
+
source={ require( './images/move-light.png' ) }
|
|
22
|
+
sourceDarkMode={ require( './images/move-dark.png' ) }
|
|
25
23
|
/>
|
|
26
|
-
|
|
24
|
+
<View style={ styles.helpDetailContainer }>
|
|
25
|
+
<HelpDetailBodyText
|
|
26
|
+
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 above or below other blocks.'
|
|
28
|
+
) }
|
|
29
|
+
/>
|
|
30
|
+
</View>
|
|
31
|
+
</>
|
|
27
32
|
);
|
|
28
33
|
};
|
|
29
34
|
|
|
@@ -16,16 +16,19 @@ import { HelpDetailBodyText, HelpDetailImage } from './view-sections';
|
|
|
16
16
|
|
|
17
17
|
const RemoveBlocks = () => {
|
|
18
18
|
return (
|
|
19
|
-
|
|
19
|
+
<>
|
|
20
20
|
<HelpDetailImage
|
|
21
|
-
source={ require( './images/
|
|
21
|
+
source={ require( './images/options-light.png' ) }
|
|
22
|
+
sourceDarkMode={ require( './images/options-dark.png' ) }
|
|
22
23
|
/>
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
<View style={ styles.helpDetailContainer }>
|
|
25
|
+
<HelpDetailBodyText
|
|
26
|
+
text={ __(
|
|
27
|
+
'To remove a block, select the block and click the three dots in the bottom right of the block to view the settings. From there, choose the option to remove the block.'
|
|
28
|
+
) }
|
|
29
|
+
/>
|
|
30
|
+
</View>
|
|
31
|
+
</>
|
|
29
32
|
);
|
|
30
33
|
};
|
|
31
34
|
|
|
@@ -1,66 +1,83 @@
|
|
|
1
|
-
.
|
|
2
|
-
|
|
1
|
+
.button {
|
|
2
|
+
margin: $grid-unit-10 $grid-unit-05;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
border: $border-width solid $gray-300;
|
|
3
6
|
}
|
|
4
7
|
|
|
5
|
-
.
|
|
6
|
-
|
|
8
|
+
.buttonDark {
|
|
9
|
+
border-color: $gray-700;
|
|
7
10
|
}
|
|
8
11
|
|
|
9
|
-
.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
.buttonText {
|
|
13
|
+
font-weight: 600;
|
|
14
|
+
font-size: 16px;
|
|
15
|
+
color: $light-primary;
|
|
13
16
|
}
|
|
14
17
|
|
|
15
|
-
.
|
|
16
|
-
|
|
18
|
+
.buttonTextDark {
|
|
19
|
+
color: $dark-primary;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
|
-
.
|
|
20
|
-
|
|
21
|
-
align-items: center;
|
|
22
|
-
padding-right: $grid-unit-20;
|
|
23
|
-
padding-left: $grid-unit-20;
|
|
24
|
-
min-height: 44px;
|
|
22
|
+
.navigationContainer {
|
|
23
|
+
overflow: hidden;
|
|
25
24
|
}
|
|
26
25
|
|
|
27
|
-
.
|
|
28
|
-
|
|
29
|
-
text-align: center;
|
|
30
|
-
font-weight: 600;
|
|
31
|
-
font-size: 16px;
|
|
32
|
-
flex: 2;
|
|
26
|
+
.container {
|
|
27
|
+
height: 100%;
|
|
33
28
|
}
|
|
34
29
|
|
|
35
|
-
.
|
|
36
|
-
|
|
30
|
+
.contentContainer {
|
|
31
|
+
padding: 0;
|
|
37
32
|
}
|
|
38
33
|
|
|
39
34
|
.helpDetailContainer {
|
|
40
|
-
|
|
41
|
-
padding: 0;
|
|
42
|
-
height: 100%;
|
|
35
|
+
padding: 0 16px;
|
|
43
36
|
}
|
|
44
37
|
|
|
45
38
|
.helpDetailImage {
|
|
39
|
+
background-color: $gray-light;
|
|
40
|
+
margin-bottom: 16px;
|
|
46
41
|
width: 100%;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.helpDetailImageDark {
|
|
45
|
+
background-color: $gray-dark;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.helpDetailTitle,
|
|
49
|
+
.helpDetailSectionHeading,
|
|
50
|
+
.helpDetailBody {
|
|
47
51
|
margin-bottom: 16px;
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
.helpDetailTitle {
|
|
51
|
-
|
|
55
|
+
color: $light-primary;
|
|
56
|
+
font-weight: 600;
|
|
52
57
|
font-size: 28px;
|
|
53
|
-
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.helpDetailTitleDark {
|
|
61
|
+
color: $dark-primary;
|
|
54
62
|
}
|
|
55
63
|
|
|
56
64
|
.helpDetailSectionHeading {
|
|
65
|
+
color: $light-primary;
|
|
57
66
|
font-weight: 600;
|
|
58
67
|
font-size: 16px;
|
|
59
|
-
|
|
68
|
+
margin-top: 24px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.helpDetailSectionHeadingDark {
|
|
72
|
+
color: $dark-secondary;
|
|
60
73
|
}
|
|
61
74
|
|
|
62
75
|
.helpDetailBody {
|
|
63
|
-
|
|
64
|
-
padding: 0 16px 16px 16px;
|
|
76
|
+
color: $light-secondary;
|
|
65
77
|
font-size: 16px;
|
|
78
|
+
line-height: 24px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.helpDetailBodyDark {
|
|
82
|
+
color: $dark-secondary;
|
|
66
83
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { fireEvent, render, waitForElementToBeRemoved } from 'test/helpers';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import EditorHelp from '../index';
|
|
10
|
+
|
|
11
|
+
it( 'lists help topics', async () => {
|
|
12
|
+
const screen = render( <EditorHelp isVisible /> );
|
|
13
|
+
const helpTopic = await screen.findByText( 'Customize blocks' );
|
|
14
|
+
|
|
15
|
+
expect( helpTopic ).toBeTruthy();
|
|
16
|
+
} );
|
|
17
|
+
|
|
18
|
+
it( 'navigates to help topic detail screen', async () => {
|
|
19
|
+
const screen = render( <EditorHelp isVisible /> );
|
|
20
|
+
const helpTopic = await screen.findByText( 'Customize blocks' );
|
|
21
|
+
fireEvent.press( helpTopic );
|
|
22
|
+
|
|
23
|
+
expect(
|
|
24
|
+
screen.getByText(
|
|
25
|
+
'Each block has its own settings. To find them, tap on a block. Its settings will appear on the toolbar at the bottom of the screen.'
|
|
26
|
+
)
|
|
27
|
+
).toBeTruthy();
|
|
28
|
+
} );
|
|
29
|
+
|
|
30
|
+
it( 'navigates back from help topic detail screen', async () => {
|
|
31
|
+
const screen = render( <EditorHelp isVisible /> );
|
|
32
|
+
const helpTopic = await screen.findByText( 'Customize blocks' );
|
|
33
|
+
fireEvent.press( helpTopic );
|
|
34
|
+
|
|
35
|
+
const backButton = screen.getAllByA11yLabel( 'Go back' );
|
|
36
|
+
fireEvent.press( backButton[ backButton.length - 1 ] );
|
|
37
|
+
|
|
38
|
+
// Currently logs `act` warning due to https://git.io/JYYGE
|
|
39
|
+
await waitForElementToBeRemoved( () =>
|
|
40
|
+
screen.getByText(
|
|
41
|
+
'Each block has its own settings. To find them, tap on a block. Its settings will appear on the toolbar at the bottom of the screen.'
|
|
42
|
+
)
|
|
43
|
+
);
|
|
44
|
+
} );
|
|
45
|
+
|
|
46
|
+
it( 'dismisses when close button is pressed', async () => {
|
|
47
|
+
const closeMock = jest.fn();
|
|
48
|
+
const screen = render( <EditorHelp isVisible close={ closeMock } /> );
|
|
49
|
+
const closeButton = await screen.findByA11yLabel( 'Go back' );
|
|
50
|
+
fireEvent.press( closeButton );
|
|
51
|
+
|
|
52
|
+
expect( closeMock ).toHaveBeenCalled();
|
|
53
|
+
} );
|
|
54
|
+
|
|
55
|
+
it( 'dismisses when parent modal backdrop is pressed', async () => {
|
|
56
|
+
const onCloseMock = jest.fn();
|
|
57
|
+
const screen = render( <EditorHelp isVisible onClose={ onCloseMock } /> );
|
|
58
|
+
const modal = await screen.findByTestId( 'editor-help-modal' );
|
|
59
|
+
fireEvent( modal, 'backdropPress' );
|
|
60
|
+
|
|
61
|
+
expect( onCloseMock ).toHaveBeenCalled();
|
|
62
|
+
} );
|
|
63
|
+
|
|
64
|
+
it( 'dismisses when parent modal backdrop is swiped', async () => {
|
|
65
|
+
const onCloseMock = jest.fn();
|
|
66
|
+
const screen = render( <EditorHelp isVisible onClose={ onCloseMock } /> );
|
|
67
|
+
const modal = await screen.findByTestId( 'editor-help-modal' );
|
|
68
|
+
fireEvent( modal, 'swipeComplete' );
|
|
69
|
+
|
|
70
|
+
expect( onCloseMock ).toHaveBeenCalled();
|
|
71
|
+
} );
|
|
72
|
+
|
|
73
|
+
it( 'dismisses when hardware back button is pressed', async () => {
|
|
74
|
+
const onCloseMock = jest.fn();
|
|
75
|
+
const screen = render( <EditorHelp isVisible onClose={ onCloseMock } /> );
|
|
76
|
+
const modal = await screen.findByTestId( 'editor-help-modal' );
|
|
77
|
+
fireEvent( modal, 'backButtonPress' );
|
|
78
|
+
|
|
79
|
+
expect( onCloseMock ).toHaveBeenCalled();
|
|
80
|
+
} );
|