@wordpress/editor 12.8.0 → 12.9.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 +2 -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/post-schedule/index.js +11 -18
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/store/selectors.js +2 -2
- package/build/store/selectors.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/post-schedule/index.js +12 -19
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/store/selectors.js +2 -2
- package/build-module/store/selectors.js.map +1 -1
- 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 +20 -22
- 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/post-schedule/index.js +6 -13
- package/src/store/selectors.js +4 -2
- package/src/store/test/selectors.js +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _element = require("@wordpress/element");
|
|
11
|
+
|
|
12
|
+
var _reactNative = require("react-native");
|
|
13
|
+
|
|
14
|
+
var _compose = require("@wordpress/compose");
|
|
15
|
+
|
|
16
|
+
var _style = _interopRequireDefault(require("./style.scss"));
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* External dependencies
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* WordPress dependencies
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Internal dependencies
|
|
28
|
+
*/
|
|
29
|
+
const HelpSectionTitle = _ref => {
|
|
30
|
+
let {
|
|
31
|
+
children
|
|
32
|
+
} = _ref;
|
|
33
|
+
const helpSectionTitle = (0, _compose.usePreferredColorSchemeStyle)(_style.default.helpSectionTitle, _style.default.helpSectionTitleDark);
|
|
34
|
+
return (0, _element.createElement)(_reactNative.View, {
|
|
35
|
+
style: _style.default.helpSectionTitleContainer
|
|
36
|
+
}, (0, _element.createElement)(_reactNative.Text, {
|
|
37
|
+
style: helpSectionTitle
|
|
38
|
+
}, children));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
var _default = HelpSectionTitle;
|
|
42
|
+
exports.default = _default;
|
|
43
|
+
//# sourceMappingURL=help-section-title.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/help-section-title.native.js"],"names":["HelpSectionTitle","children","helpSectionTitle","styles","helpSectionTitleDark","helpSectionTitleContainer"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAMA,gBAAgB,GAAG,QAAoB;AAAA,MAAlB;AAAEC,IAAAA;AAAF,GAAkB;AAC5C,QAAMC,gBAAgB,GAAG,2CACxBC,eAAOD,gBADiB,EAExBC,eAAOC,oBAFiB,CAAzB;AAKA,SACC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGD,eAAOE;AAArB,KACC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGH;AAAd,KAAmCD,QAAnC,CADD,CADD;AAKA,CAXD;;eAaeD,gB","sourcesContent":["/**\n * External dependencies\n */\nimport { Text, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nconst HelpSectionTitle = ( { children } ) => {\n\tconst helpSectionTitle = usePreferredColorSchemeStyle(\n\t\tstyles.helpSectionTitle,\n\t\tstyles.helpSectionTitleDark\n\t);\n\n\treturn (\n\t\t<View style={ styles.helpSectionTitleContainer }>\n\t\t\t<Text style={ helpSectionTitle }>{ children }</Text>\n\t\t</View>\n\t);\n};\n\nexport default HelpSectionTitle;\n"]}
|
|
@@ -24,7 +24,8 @@ const HelpTopicRow = _ref => {
|
|
|
24
24
|
let {
|
|
25
25
|
label,
|
|
26
26
|
icon,
|
|
27
|
-
screenName
|
|
27
|
+
screenName,
|
|
28
|
+
isLastItem
|
|
28
29
|
} = _ref;
|
|
29
30
|
const navigation = (0, _native.useNavigation)();
|
|
30
31
|
|
|
@@ -33,7 +34,7 @@ const HelpTopicRow = _ref => {
|
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
return (0, _element.createElement)(_components.TextControl, {
|
|
36
|
-
separatorType:
|
|
37
|
+
separatorType: isLastItem ? 'none' : 'leftMargin',
|
|
37
38
|
customActionButton: true,
|
|
38
39
|
leftAlign: true,
|
|
39
40
|
onPress: openSubSheet,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/help-topic-row.native.js"],"names":["HelpTopicRow","label","icon","screenName","navigation","openSubSheet","navigate","chevronRight"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAMA,YAAY,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/help-topic-row.native.js"],"names":["HelpTopicRow","label","icon","screenName","isLastItem","navigation","openSubSheet","navigate","chevronRight"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAMA,YAAY,GAAG,QAA+C;AAAA,MAA7C;AAAEC,IAAAA,KAAF;AAASC,IAAAA,IAAT;AAAeC,IAAAA,UAAf;AAA2BC,IAAAA;AAA3B,GAA6C;AACnE,QAAMC,UAAU,GAAG,4BAAnB;;AAEA,QAAMC,YAAY,GAAG,MAAM;AAC1BD,IAAAA,UAAU,CAACE,QAAX,CAAqBJ,UAArB;AACA,GAFD;;AAIA,SACC,4BAAC,uBAAD;AACC,IAAA,aAAa,EAAGC,UAAU,GAAG,MAAH,GAAY,YADvC;AAEC,IAAA,kBAAkB,MAFnB;AAGC,IAAA,SAAS,MAHV;AAIC,IAAA,OAAO,EAAGE,YAJX;AAKC,IAAA,KAAK,EAAGL,KALT;AAMC,IAAA,IAAI,EAAGC;AANR,KAQC,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAGM;AAAb,IARD,CADD;AAYA,CAnBD;;eAqBeR,Y","sourcesContent":["/**\n * External dependencies\n */\nimport { useNavigation } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { TextControl, Icon } from '@wordpress/components';\nimport { chevronRight } from '@wordpress/icons';\n\nconst HelpTopicRow = ( { label, icon, screenName, isLastItem } ) => {\n\tconst navigation = useNavigation();\n\n\tconst openSubSheet = () => {\n\t\tnavigation.navigate( screenName );\n\t};\n\n\treturn (\n\t\t<TextControl\n\t\t\tseparatorType={ isLastItem ? 'none' : 'leftMargin' }\n\t\t\tcustomActionButton\n\t\t\tleftAlign\n\t\t\tonPress={ openSubSheet }\n\t\t\tlabel={ label }\n\t\t\ticon={ icon }\n\t\t>\n\t\t\t<Icon icon={ chevronRight } />\n\t\t</TextControl>\n\t);\n};\n\nexport default HelpTopicRow;\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _element = require("@wordpress/element");
|
|
9
|
+
|
|
10
|
+
var _primitives = require("@wordpress/primitives");
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* WordPress dependencies
|
|
14
|
+
*/
|
|
15
|
+
var _default = (0, _element.createElement)(_primitives.SVG, {
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
+
viewBox: "0 0 24 24"
|
|
18
|
+
}, (0, _element.createElement)(_primitives.Path, {
|
|
19
|
+
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"
|
|
20
|
+
}));
|
|
21
|
+
|
|
22
|
+
exports.default = _default;
|
|
23
|
+
//# sourceMappingURL=icon-move-blocks.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/icon-move-blocks.native.js"],"names":[],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;eAIC,4BAAC,eAAD;AAAK,EAAA,KAAK,EAAC,4BAAX;AAAwC,EAAA,OAAO,EAAC;AAAhD,GACC,4BAAC,gBAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EADD,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nexport default (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<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\" />\n\t</SVG>\n);\n"]}
|
|
@@ -27,8 +27,6 @@ var _data = require("@wordpress/data");
|
|
|
27
27
|
|
|
28
28
|
var _editor = require("@wordpress/editor");
|
|
29
29
|
|
|
30
|
-
var _compose = require("@wordpress/compose");
|
|
31
|
-
|
|
32
30
|
var _reactNativeBridge = require("@wordpress/react-native-bridge");
|
|
33
31
|
|
|
34
32
|
var _style = _interopRequireDefault(require("./style.scss"));
|
|
@@ -49,6 +47,10 @@ var _removeBlocks = _interopRequireDefault(require("./remove-blocks"));
|
|
|
49
47
|
|
|
50
48
|
var _customizeBlocks = _interopRequireDefault(require("./customize-blocks"));
|
|
51
49
|
|
|
50
|
+
var _iconMoveBlocks = _interopRequireDefault(require("./icon-move-blocks"));
|
|
51
|
+
|
|
52
|
+
var _helpSectionTitle = _interopRequireDefault(require("./help-section-title"));
|
|
53
|
+
|
|
52
54
|
/**
|
|
53
55
|
* External dependencies
|
|
54
56
|
*/
|
|
@@ -70,7 +72,7 @@ const HELP_TOPICS = [{
|
|
|
70
72
|
view: (0, _element.createElement)(_addBlocks.default, null)
|
|
71
73
|
}, {
|
|
72
74
|
label: (0, _i18n.__)('Move blocks'),
|
|
73
|
-
icon:
|
|
75
|
+
icon: _iconMoveBlocks.default,
|
|
74
76
|
view: (0, _element.createElement)(_moveBlocks.default, null)
|
|
75
77
|
}, {
|
|
76
78
|
label: (0, _i18n.__)('Remove blocks'),
|
|
@@ -93,7 +95,6 @@ function EditorHelpTopics(_ref) {
|
|
|
93
95
|
} = (0, _data.useSelect)(select => ({
|
|
94
96
|
postType: select(_editor.store).getEditedPostAttribute('type')
|
|
95
97
|
}));
|
|
96
|
-
const sectionTitle = (0, _compose.usePreferredColorSchemeStyle)(_style.default.helpDetailSectionHeading, _style.default.helpDetailSectionHeadingDark);
|
|
97
98
|
const title = postType === 'page' ? (0, _i18n.__)('How to edit your page') : (0, _i18n.__)('How to edit your post');
|
|
98
99
|
return (0, _element.createElement)(_components.BottomSheet, {
|
|
99
100
|
isVisible: isVisible,
|
|
@@ -133,23 +134,21 @@ function EditorHelpTopics(_ref) {
|
|
|
133
134
|
*/
|
|
134
135
|
marginTop: 0
|
|
135
136
|
}
|
|
136
|
-
}), (0, _element.createElement)(_components.PanelBody, null, (0, _element.createElement)(
|
|
137
|
-
style: sectionTitle
|
|
138
|
-
}, (0, _i18n.__)('The basics')), HELP_TOPICS.map(_ref3 => {
|
|
137
|
+
}), (0, _element.createElement)(_components.PanelBody, null, (0, _element.createElement)(_helpSectionTitle.default, null, (0, _i18n.__)('The basics')), HELP_TOPICS.map((_ref3, index) => {
|
|
139
138
|
let {
|
|
140
139
|
label,
|
|
141
140
|
icon
|
|
142
141
|
} = _ref3;
|
|
143
142
|
const labelSlug = (0, _lodash.kebabCase)(label);
|
|
143
|
+
const isLastItem = index === HELP_TOPICS.length - 1;
|
|
144
144
|
return (0, _element.createElement)(_helpTopicRow.default, {
|
|
145
145
|
key: labelSlug,
|
|
146
146
|
label: label,
|
|
147
147
|
icon: icon,
|
|
148
|
-
screenName: labelSlug
|
|
148
|
+
screenName: labelSlug,
|
|
149
|
+
isLastItem: isLastItem
|
|
149
150
|
});
|
|
150
|
-
}), (0, _element.createElement)(
|
|
151
|
-
style: sectionTitle
|
|
152
|
-
}, (0, _i18n.__)('Get support')), (0, _element.createElement)(_helpGetSupportButton.default, {
|
|
151
|
+
}), (0, _element.createElement)(_helpSectionTitle.default, null, (0, _i18n.__)('Get support')), (0, _element.createElement)(_helpGetSupportButton.default, {
|
|
153
152
|
title: (0, _i18n.__)('Contact support'),
|
|
154
153
|
onPress: _reactNativeBridge.requestContactCustomerSupport
|
|
155
154
|
}), (0, _element.createElement)(_helpGetSupportButton.default, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/index.native.js"],"names":["HELP_TOPICS","label","icon","helpFilled","view","plusCircleFilled","alignJustify","trash","cog","EditorHelpTopics","close","isVisible","onClose","postType","select","editorStore","getEditedPostAttribute","sectionTitle","styles","helpDetailSectionHeading","helpDetailSectionHeadingDark","title","contentContainer","navigationContainer","container","listProps","contentContainerStyle","StyleSheet","flatten","paddingBottom","Math","max","safeAreaBottomInset","marginTop","map","labelSlug","requestContactCustomerSupport","requestGotoCustomerSupportOptions","gestureEnabled","TransitionPresets","DefaultTransition"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAKA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA1CA;AACA;AACA;;AAKA;AACA;AACA;;AAsBA;AACA;AACA;AAWA,MAAMA,WAAW,GAAG,CACnB;AACCC,EAAAA,KAAK,EAAE,cAAI,kBAAJ,CADR;AAECC,EAAAA,IAAI,EAAEC,iBAFP;AAGCC,EAAAA,IAAI,EAAE,4BAAC,sBAAD;AAHP,CADmB,EAMnB;AACCH,EAAAA,KAAK,EAAE,cAAI,YAAJ,CADR;AAECC,EAAAA,IAAI,EAAEG,uBAFP;AAGCD,EAAAA,IAAI,EAAE,4BAAC,kBAAD;AAHP,CANmB,EAWnB;AAAEH,EAAAA,KAAK,EAAE,cAAI,aAAJ,CAAT;AAA8BC,EAAAA,IAAI,EAAEI,mBAApC;AAAkDF,EAAAA,IAAI,EAAE,4BAAC,mBAAD;AAAxD,CAXmB,EAYnB;AAAEH,EAAAA,KAAK,EAAE,cAAI,eAAJ,CAAT;AAAgCC,EAAAA,IAAI,EAAEK,YAAtC;AAA6CH,EAAAA,IAAI,EAAE,4BAAC,qBAAD;AAAnD,CAZmB,EAanB;AACCH,EAAAA,KAAK,EAAE,cAAI,kBAAJ,CADR;AAECC,EAAAA,IAAI,EAAEM,UAFP;AAGCJ,EAAAA,IAAI,EAAE,4BAAC,wBAAD;AA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ACzC,UAAMkC,SAAS,GAAG,uBAAWlC,KAAX,CAAlB;AACA,WACC,4BAAC,mCAAD;AACC,MAAA,GAAG,EAAGkC,SADP;AAEC,MAAA,IAAI,EAAGA,SAFR;AAGC,MAAA,OAAO,EAAG/B,IAHX;AAIC,MAAA,KAAK,EAAGH,KAJT;AAKC,MAAA,OAAO,EAAG;AACTqC,QAAAA,cAAc,EAAE,KADP;AAET,WAAGC,yBAAkBC;AAFZ;AALX,MADD;AAYA,GAdC,CArGH,CADD,CARD,CADD;AAkIA;;eAEc/B,gB","sourcesContent":["/**\n * External dependencies\n */\nimport { kebabCase } from 'lodash';\nimport { Text, SafeAreaView, ScrollView, StyleSheet, View } from 'react-native';\nimport { TransitionPresets } from '@react-navigation/stack';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBottomSheet,\n\tBottomSheetConsumer,\n\tPanelBody,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\thelpFilled,\n\tplusCircleFilled,\n\talignJustify,\n\ttrash,\n\tcog,\n} from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport {\n\trequestContactCustomerSupport,\n\trequestGotoCustomerSupportOptions,\n} from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport HelpDetailNavigationScreen from './help-detail-navigation-screen';\nimport HelpTopicRow from './help-topic-row';\nimport HelpGetSupportButton from './help-get-support-button';\nimport IntroToBlocks from './intro-to-blocks';\nimport AddBlocks from './add-blocks';\nimport MoveBlocks from './move-blocks';\nimport RemoveBlocks from './remove-blocks';\nimport CustomizeBlocks from './customize-blocks';\n\nconst HELP_TOPICS = [\n\t{\n\t\tlabel: __( 'What is a block?' ),\n\t\ticon: helpFilled,\n\t\tview: <IntroToBlocks />,\n\t},\n\t{\n\t\tlabel: __( 'Add blocks' ),\n\t\ticon: plusCircleFilled,\n\t\tview: <AddBlocks />,\n\t},\n\t{ label: __( 'Move blocks' ), icon: alignJustify, view: <MoveBlocks /> },\n\t{ label: __( 'Remove blocks' ), icon: trash, view: <RemoveBlocks /> },\n\t{\n\t\tlabel: __( 'Customize blocks' ),\n\t\ticon: cog,\n\t\tview: <CustomizeBlocks />,\n\t},\n];\n\nfunction EditorHelpTopics( { close, isVisible, onClose } ) {\n\tconst { postType } = useSelect( ( select ) => ( {\n\t\tpostType: select( editorStore ).getEditedPostAttribute( 'type' ),\n\t} ) );\n\n\tconst sectionTitle = usePreferredColorSchemeStyle(\n\t\tstyles.helpDetailSectionHeading,\n\t\tstyles.helpDetailSectionHeadingDark\n\t);\n\n\tconst title =\n\t\tpostType === 'page'\n\t\t\t? __( 'How to edit your page' )\n\t\t\t: __( 'How to edit your post' );\n\n\treturn (\n\t\t<BottomSheet\n\t\t\tisVisible={ isVisible }\n\t\t\tonClose={ onClose }\n\t\t\thideHeader\n\t\t\thasNavigation\n\t\t\tcontentStyle={ styles.contentContainer }\n\t\t\ttestID=\"editor-help-modal\"\n\t\t>\n\t\t\t<SafeAreaView>\n\t\t\t\t<BottomSheet.NavigationContainer\n\t\t\t\t\tanimate\n\t\t\t\t\tmain\n\t\t\t\t\tstyle={ styles.navigationContainer }\n\t\t\t\t>\n\t\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\t\tisScrollable\n\t\t\t\t\t\tfullScreen\n\t\t\t\t\t\tname=\"help-topics\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ styles.container }>\n\t\t\t\t\t\t\t<BottomSheet.NavBar>\n\t\t\t\t\t\t\t\t<BottomSheet.NavBar.DismissButton\n\t\t\t\t\t\t\t\t\tonPress={ close }\n\t\t\t\t\t\t\t\t\tiosText={ __( 'Close' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t</BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t\t</BottomSheet.NavBar>\n\t\t\t\t\t\t\t<BottomSheetConsumer>\n\t\t\t\t\t\t\t\t{ ( { listProps } ) => {\n\t\t\t\t\t\t\t\t\tconst contentContainerStyle = StyleSheet.flatten(\n\t\t\t\t\t\t\t\t\t\tlistProps.contentContainerStyle\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<ScrollView\n\t\t\t\t\t\t\t\t\t\t\t{ ...listProps }\n\t\t\t\t\t\t\t\t\t\t\tcontentContainerStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\t...contentContainerStyle,\n\t\t\t\t\t\t\t\t\t\t\t\tpaddingBottom: Math.max(\n\t\t\t\t\t\t\t\t\t\t\t\t\tlistProps.safeAreaBottomInset,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontentContainerStyle.paddingBottom\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t\t\t * Remove margin set via `hideHeader`. Combining a header\n\t\t\t\t\t\t\t\t\t\t\t\t * and navigation in this bottom sheet is at odds with the\n\t\t\t\t\t\t\t\t\t\t\t\t * current `BottomSheet` implementation.\n\t\t\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\t\t\tmarginTop: 0,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<PanelBody>\n\t\t\t\t\t\t\t\t\t\t\t\t<Text style={ sectionTitle }>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'The basics' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t\t\t{ /* Print out help topics. */ }\n\t\t\t\t\t\t\t\t\t\t\t\t{ HELP_TOPICS.map(\n\t\t\t\t\t\t\t\t\t\t\t\t\t( { label, icon } ) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst labelSlug = kebabCase(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<HelpTopicRow\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabelSlug\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tscreenName={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabelSlug\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={ sectionTitle }\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Get support' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t<HelpGetSupportButton\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Contact support'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonPress={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trequestContactCustomerSupport\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t<HelpGetSupportButton\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'More support options'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonPress={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trequestGotoCustomerSupportOptions\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t</PanelBody>\n\t\t\t\t\t\t\t\t\t\t</ScrollView>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t</BottomSheetConsumer>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t\t{ /* Print out help detail screens. */ }\n\t\t\t\t\t{ HELP_TOPICS.map( ( { view, label } ) => {\n\t\t\t\t\t\tconst labelSlug = kebabCase( label );\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<HelpDetailNavigationScreen\n\t\t\t\t\t\t\t\tkey={ labelSlug }\n\t\t\t\t\t\t\t\tname={ labelSlug }\n\t\t\t\t\t\t\t\tcontent={ view }\n\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\toptions={ {\n\t\t\t\t\t\t\t\t\tgestureEnabled: false,\n\t\t\t\t\t\t\t\t\t...TransitionPresets.DefaultTransition,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</BottomSheet.NavigationContainer>\n\t\t\t</SafeAreaView>\n\t\t</BottomSheet>\n\t);\n}\n\nexport default EditorHelpTopics;\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/index.native.js"],"names":["HELP_TOPICS","label","icon","helpFilled","view","plusCircleFilled","moveBlocksIcon","trash","cog","EditorHelpTopics","close","isVisible","onClose","postType","select","editorStore","getEditedPostAttribute","title","styles","contentContainer","navigationContainer","container","listProps","contentContainerStyle","StyleSheet","flatten","paddingBottom","Math","max","safeAreaBottomInset","marginTop","map","index","labelSlug","isLastItem","length","requestContactCustomerSupport","requestGotoCustomerSupportOptions","gestureEnabled","TransitionPresets","DefaultTransition"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AArCA;AACA;AACA;;AAKA;AACA;AACA;;AAeA;AACA;AACA;AAaA,MAAMA,WAAW,GAAG,CACnB;AACCC,EAAAA,KAAK,EAAE,cAAI,kBAAJ,CADR;AAECC,EAAAA,IAAI,EAAEC,iBAFP;AAGCC,EAAAA,IAAI,EAAE,4BAAC,sBAAD;AAHP,CADmB,EAMnB;AACCH,EAAAA,KAAK,EAAE,cAAI,YAAJ,CADR;AAECC,EAAAA,IAAI,EAAEG,uBAFP;AAGCD,EAAAA,IAAI,EAAE,4BAAC,kBAAD;AAHP,CANmB,EAWnB;AAAEH,EAAAA,KAAK,EAAE,cAAI,aAAJ,CAAT;AAA8BC,EAAAA,IAAI,EAAEI,uBAApC;AAAoDF,EAAAA,IAAI,EAAE,4BAAC,mBAAD;AAA1D,CAXmB,EAYnB;AAAEH,EAAAA,KAAK,EAAE,cAAI,eAAJ,CAAT;AAAgC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IC,MAAA,OAAO,EACNC;AALF,MAlDF,CAhBD,CADD;AA+EA,GApFF,CAVD,CALD,CALD,EA6GGrC,WAAW,CAAC+B,GAAZ,CAAiB,SAAuB;AAAA,QAArB;AAAE3B,MAAAA,IAAF;AAAQH,MAAAA;AAAR,KAAqB;AACzC,UAAMgC,SAAS,GAAG,uBAAWhC,KAAX,CAAlB;AACA,WACC,4BAAC,mCAAD;AACC,MAAA,GAAG,EAAGgC,SADP;AAEC,MAAA,IAAI,EAAGA,SAFR;AAGC,MAAA,OAAO,EAAG7B,IAHX;AAIC,MAAA,KAAK,EAAGH,KAJT;AAKC,MAAA,OAAO,EAAG;AACTqC,QAAAA,cAAc,EAAE,KADP;AAET,WAAGC,yBAAkBC;AAFZ;AALX,MADD;AAYA,GAdC,CA7GH,CADD,CARD,CADD;AA0IA;;eAEc/B,gB","sourcesContent":["/**\n * External dependencies\n */\nimport { kebabCase } from 'lodash';\nimport { SafeAreaView, ScrollView, StyleSheet, View } from 'react-native';\nimport { TransitionPresets } from '@react-navigation/stack';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBottomSheet,\n\tBottomSheetConsumer,\n\tPanelBody,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { helpFilled, plusCircleFilled, trash, cog } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport {\n\trequestContactCustomerSupport,\n\trequestGotoCustomerSupportOptions,\n} from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport HelpDetailNavigationScreen from './help-detail-navigation-screen';\nimport HelpTopicRow from './help-topic-row';\nimport HelpGetSupportButton from './help-get-support-button';\nimport IntroToBlocks from './intro-to-blocks';\nimport AddBlocks from './add-blocks';\nimport MoveBlocks from './move-blocks';\nimport RemoveBlocks from './remove-blocks';\nimport CustomizeBlocks from './customize-blocks';\nimport moveBlocksIcon from './icon-move-blocks';\nimport HelpSectionTitle from './help-section-title';\n\nconst HELP_TOPICS = [\n\t{\n\t\tlabel: __( 'What is a block?' ),\n\t\ticon: helpFilled,\n\t\tview: <IntroToBlocks />,\n\t},\n\t{\n\t\tlabel: __( 'Add blocks' ),\n\t\ticon: plusCircleFilled,\n\t\tview: <AddBlocks />,\n\t},\n\t{ label: __( 'Move blocks' ), icon: moveBlocksIcon, view: <MoveBlocks /> },\n\t{ label: __( 'Remove blocks' ), icon: trash, view: <RemoveBlocks /> },\n\t{\n\t\tlabel: __( 'Customize blocks' ),\n\t\ticon: cog,\n\t\tview: <CustomizeBlocks />,\n\t},\n];\n\nfunction EditorHelpTopics( { close, isVisible, onClose } ) {\n\tconst { postType } = useSelect( ( select ) => ( {\n\t\tpostType: select( editorStore ).getEditedPostAttribute( 'type' ),\n\t} ) );\n\n\tconst title =\n\t\tpostType === 'page'\n\t\t\t? __( 'How to edit your page' )\n\t\t\t: __( 'How to edit your post' );\n\n\treturn (\n\t\t<BottomSheet\n\t\t\tisVisible={ isVisible }\n\t\t\tonClose={ onClose }\n\t\t\thideHeader\n\t\t\thasNavigation\n\t\t\tcontentStyle={ styles.contentContainer }\n\t\t\ttestID=\"editor-help-modal\"\n\t\t>\n\t\t\t<SafeAreaView>\n\t\t\t\t<BottomSheet.NavigationContainer\n\t\t\t\t\tanimate\n\t\t\t\t\tmain\n\t\t\t\t\tstyle={ styles.navigationContainer }\n\t\t\t\t>\n\t\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\t\tisScrollable\n\t\t\t\t\t\tfullScreen\n\t\t\t\t\t\tname=\"help-topics\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ styles.container }>\n\t\t\t\t\t\t\t<BottomSheet.NavBar>\n\t\t\t\t\t\t\t\t<BottomSheet.NavBar.DismissButton\n\t\t\t\t\t\t\t\t\tonPress={ close }\n\t\t\t\t\t\t\t\t\tiosText={ __( 'Close' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t</BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t\t</BottomSheet.NavBar>\n\t\t\t\t\t\t\t<BottomSheetConsumer>\n\t\t\t\t\t\t\t\t{ ( { listProps } ) => {\n\t\t\t\t\t\t\t\t\tconst contentContainerStyle = StyleSheet.flatten(\n\t\t\t\t\t\t\t\t\t\tlistProps.contentContainerStyle\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<ScrollView\n\t\t\t\t\t\t\t\t\t\t\t{ ...listProps }\n\t\t\t\t\t\t\t\t\t\t\tcontentContainerStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\t...contentContainerStyle,\n\t\t\t\t\t\t\t\t\t\t\t\tpaddingBottom: Math.max(\n\t\t\t\t\t\t\t\t\t\t\t\t\tlistProps.safeAreaBottomInset,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontentContainerStyle.paddingBottom\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t\t\t * Remove margin set via `hideHeader`. Combining a header\n\t\t\t\t\t\t\t\t\t\t\t\t * and navigation in this bottom sheet is at odds with the\n\t\t\t\t\t\t\t\t\t\t\t\t * current `BottomSheet` implementation.\n\t\t\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\t\t\tmarginTop: 0,\n\t\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<PanelBody>\n\t\t\t\t\t\t\t\t\t\t\t\t<HelpSectionTitle>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'The basics' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</HelpSectionTitle>\n\t\t\t\t\t\t\t\t\t\t\t\t{ /* Print out help topics. */ }\n\t\t\t\t\t\t\t\t\t\t\t\t{ HELP_TOPICS.map(\n\t\t\t\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ label, icon },\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tindex\n\t\t\t\t\t\t\t\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst labelSlug = kebabCase(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst isLastItem =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tindex ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tHELP_TOPICS.length -\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<HelpTopicRow\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabelSlug\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tscreenName={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabelSlug\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisLastItem={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tisLastItem\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t<HelpSectionTitle>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Get support' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t</HelpSectionTitle>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t<HelpGetSupportButton\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Contact support'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonPress={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trequestContactCustomerSupport\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t<HelpGetSupportButton\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'More support options'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonPress={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trequestGotoCustomerSupportOptions\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t</PanelBody>\n\t\t\t\t\t\t\t\t\t\t</ScrollView>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t</BottomSheetConsumer>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t\t{ /* Print out help detail screens. */ }\n\t\t\t\t\t{ HELP_TOPICS.map( ( { view, label } ) => {\n\t\t\t\t\t\tconst labelSlug = kebabCase( label );\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<HelpDetailNavigationScreen\n\t\t\t\t\t\t\t\tkey={ labelSlug }\n\t\t\t\t\t\t\t\tname={ labelSlug }\n\t\t\t\t\t\t\t\tcontent={ view }\n\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\toptions={ {\n\t\t\t\t\t\t\t\t\tgestureEnabled: false,\n\t\t\t\t\t\t\t\t\t...TransitionPresets.DefaultTransition,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</BottomSheet.NavigationContainer>\n\t\t\t</SafeAreaView>\n\t\t</BottomSheet>\n\t);\n}\n\nexport default EditorHelpTopics;\n"]}
|
|
@@ -30,12 +30,24 @@ var _viewSections = require("./view-sections");
|
|
|
30
30
|
*/
|
|
31
31
|
const MoveBlocks = () => {
|
|
32
32
|
return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_viewSections.HelpDetailImage, {
|
|
33
|
+
source: require('./images/drag-and-drop-light.png'),
|
|
34
|
+
sourceDarkMode: require('./images/drag-and-drop-dark.png')
|
|
35
|
+
}), (0, _element.createElement)(_reactNative.View, {
|
|
36
|
+
style: _style.default.helpDetailContainer
|
|
37
|
+
}, (0, _element.createElement)(_viewSections.HelpDetailSectionHeadingText, {
|
|
38
|
+
text: (0, _i18n.__)('Drag & drop'),
|
|
39
|
+
badge: (0, _i18n.__)('NEW')
|
|
40
|
+
}), (0, _element.createElement)(_viewSections.HelpDetailBodyText, {
|
|
41
|
+
text: (0, _i18n.__)('Drag & drop makes rearranging blocks a breeze. Press and hold on a block, then drag it to its new location and release.')
|
|
42
|
+
})), (0, _element.createElement)(_viewSections.HelpDetailImage, {
|
|
33
43
|
source: require('./images/move-light.png'),
|
|
34
44
|
sourceDarkMode: require('./images/move-dark.png')
|
|
35
45
|
}), (0, _element.createElement)(_reactNative.View, {
|
|
36
46
|
style: _style.default.helpDetailContainer
|
|
37
|
-
}, (0, _element.createElement)(_viewSections.
|
|
38
|
-
text: (0, _i18n.__)('
|
|
47
|
+
}, (0, _element.createElement)(_viewSections.HelpDetailSectionHeadingText, {
|
|
48
|
+
text: (0, _i18n.__)('Arrow buttons')
|
|
49
|
+
}), (0, _element.createElement)(_viewSections.HelpDetailBodyText, {
|
|
50
|
+
text: (0, _i18n.__)('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.')
|
|
39
51
|
})));
|
|
40
52
|
};
|
|
41
53
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/move-blocks.native.js"],"names":["MoveBlocks","require","styles","helpDetailContainer"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAKA;;AACA;;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/move-blocks.native.js"],"names":["MoveBlocks","require","styles","helpDetailContainer"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAKA;;AACA;;AAdA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AAQA,MAAMA,UAAU,GAAG,MAAM;AACxB,SACC,qDACC,4BAAC,6BAAD;AACC,IAAA,MAAM,EAAGC,OAAO,CAAE,kCAAF,CADjB;AAEC,IAAA,cAAc,EAAGA,OAAO,CAAE,iCAAF;AAFzB,IADD,EAKC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGC,eAAOC;AAArB,KACC,4BAAC,0CAAD;AACC,IAAA,IAAI,EAAG,cAAI,aAAJ,CADR;AAEC,IAAA,KAAK,EAAG,cAAI,KAAJ;AAFT,IADD,EAKC,4BAAC,gCAAD;AACC,IAAA,IAAI,EAAG,cACN,yHADM;AADR,IALD,CALD,EAgBC,4BAAC,6BAAD;AACC,IAAA,MAAM,EAAGF,OAAO,CAAE,yBAAF,CADjB;AAEC,IAAA,cAAc,EAAGA,OAAO,CAAE,wBAAF;AAFzB,IAhBD,EAoBC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGC,eAAOC;AAArB,KACC,4BAAC,0CAAD;AAA8B,IAAA,IAAI,EAAG,cAAI,eAAJ;AAArC,IADD,EAEC,4BAAC,gCAAD;AACC,IAAA,IAAI,EAAG,cACN,kKADM;AADR,IAFD,CApBD,CADD;AA+BA,CAhCD;;eAkCeH,U","sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport {\n\tHelpDetailBodyText,\n\tHelpDetailImage,\n\tHelpDetailSectionHeadingText,\n} from './view-sections';\n\nconst MoveBlocks = () => {\n\treturn (\n\t\t<>\n\t\t\t<HelpDetailImage\n\t\t\t\tsource={ require( './images/drag-and-drop-light.png' ) }\n\t\t\t\tsourceDarkMode={ require( './images/drag-and-drop-dark.png' ) }\n\t\t\t/>\n\t\t\t<View style={ styles.helpDetailContainer }>\n\t\t\t\t<HelpDetailSectionHeadingText\n\t\t\t\t\ttext={ __( 'Drag & drop' ) }\n\t\t\t\t\tbadge={ __( 'NEW' ) }\n\t\t\t\t/>\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'Drag & drop makes rearranging blocks a breeze. Press and hold on a block, then drag it to its new location and release.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t\t<HelpDetailImage\n\t\t\t\tsource={ require( './images/move-light.png' ) }\n\t\t\t\tsourceDarkMode={ require( './images/move-dark.png' ) }\n\t\t\t/>\n\t\t\t<View style={ styles.helpDetailContainer }>\n\t\t\t\t<HelpDetailSectionHeadingText text={ __( 'Arrow buttons' ) } />\n\t\t\t\t<HelpDetailBodyText\n\t\t\t\t\ttext={ __(\n\t\t\t\t\t\t'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.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</View>\n\t\t</>\n\t);\n};\n\nexport default MoveBlocks;\n"]}
|
|
@@ -41,14 +41,19 @@ exports.HelpDetailBodyText = HelpDetailBodyText;
|
|
|
41
41
|
|
|
42
42
|
const HelpDetailSectionHeadingText = _ref2 => {
|
|
43
43
|
let {
|
|
44
|
-
text
|
|
44
|
+
text,
|
|
45
|
+
badge
|
|
45
46
|
} = _ref2;
|
|
46
|
-
const
|
|
47
|
-
return (0, _element.createElement)(_reactNative.
|
|
47
|
+
const headingTextStyle = (0, _compose.usePreferredColorSchemeStyle)(_style.default.helpDetailSectionHeadingText, _style.default.helpDetailSectionHeadingTextDark);
|
|
48
|
+
return (0, _element.createElement)(_reactNative.View, {
|
|
49
|
+
style: _style.default.helpDetailSectionHeading
|
|
50
|
+
}, badge && (0, _element.createElement)(HelpDetailBadge, {
|
|
51
|
+
text: badge
|
|
52
|
+
}), (0, _element.createElement)(_reactNative.Text, {
|
|
48
53
|
accessibilityRole: "header",
|
|
49
54
|
selectable: true,
|
|
50
|
-
style:
|
|
51
|
-
}, text);
|
|
55
|
+
style: headingTextStyle
|
|
56
|
+
}, text));
|
|
52
57
|
};
|
|
53
58
|
|
|
54
59
|
exports.HelpDetailSectionHeadingText = HelpDetailSectionHeadingText;
|
|
@@ -71,4 +76,15 @@ const HelpDetailImage = _ref3 => {
|
|
|
71
76
|
};
|
|
72
77
|
|
|
73
78
|
exports.HelpDetailImage = HelpDetailImage;
|
|
79
|
+
|
|
80
|
+
const HelpDetailBadge = _ref4 => {
|
|
81
|
+
let {
|
|
82
|
+
text
|
|
83
|
+
} = _ref4;
|
|
84
|
+
return (0, _element.createElement)(_reactNative.View, {
|
|
85
|
+
style: _style.default.helpDetailBadgeContainer
|
|
86
|
+
}, (0, _element.createElement)(_reactNative.Text, {
|
|
87
|
+
style: _style.default.helpDetailBadgeText
|
|
88
|
+
}, text));
|
|
89
|
+
};
|
|
74
90
|
//# sourceMappingURL=view-sections.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/view-sections.native.js"],"names":["HelpDetailBodyText","text","bodyStyle","styles","helpDetailBody","helpDetailBodyDark","HelpDetailSectionHeadingText","
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/view-sections.native.js"],"names":["HelpDetailBodyText","text","bodyStyle","styles","helpDetailBody","helpDetailBodyDark","HelpDetailSectionHeadingText","badge","headingTextStyle","helpDetailSectionHeadingText","helpDetailSectionHeadingTextDark","helpDetailSectionHeading","HelpDetailImage","accessible","accessibilityLabel","source","sourceDarkMode","imageStyle","helpDetailImage","helpDetailImageDark","darkModeEnabled","HelpDetailBadge","helpDetailBadgeContainer","helpDetailBadgeText"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAQA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAGO,MAAMA,kBAAkB,GAAG,QAAgB;AAAA,MAAd;AAAEC,IAAAA;AAAF,GAAc;AACjD,QAAMC,SAAS,GAAG,2CACjBC,eAAOC,cADU,EAEjBD,eAAOE,kBAFU,CAAlB;AAIA,SACC,4BAAC,iBAAD;AAAM,IAAA,UAAU,MAAhB;AAAiB,IAAA,KAAK,EAAGH;AAAzB,KACGD,IADH,CADD;AAKA,CAVM;;;;AAYA,MAAMK,4BAA4B,GAAG,SAAuB;AAAA,MAArB;AAAEL,IAAAA,IAAF;AAAQM,IAAAA;AAAR,GAAqB;AAClE,QAAMC,gBAAgB,GAAG,2CACxBL,eAAOM,4BADiB,EAExBN,eAAOO,gCAFiB,CAAzB;AAIA,SACC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGP,eAAOQ;AAArB,KACGJ,KAAK,IAAI,4BAAC,eAAD;AAAiB,IAAA,IAAI,EAAGA;AAAxB,IADZ,EAEC,4BAAC,iBAAD;AACC,IAAA,iBAAiB,EAAC,QADnB;AAEC,IAAA,UAAU,MAFX;AAGC,IAAA,KAAK,EAAGC;AAHT,KAKGP,IALH,CAFD,CADD;AAYA,CAjBM;;;;AAmBA,MAAMW,eAAe,GAAG,SAKxB;AAAA,MAL0B;AAChCC,IAAAA,UADgC;AAEhCC,IAAAA,kBAFgC;AAGhCC,IAAAA,MAHgC;AAIhCC,IAAAA;AAJgC,GAK1B;AACN,QAAMC,UAAU,GAAG,2CAClBd,eAAOe,eADW,EAElBf,eAAOgB,mBAFW,CAAnB;AAIA,QAAMC,eAAe,GAAG,4CAA8B,MAAtD;AACA,SACC,4BAAC,kBAAD;AACC,IAAA,UAAU,EAAGP,UADd;AAEC,IAAA,kBAAkB,EAAGC,kBAFtB;AAGC,IAAA,MAAM,EACLM,eAAe,IAAIJ,cAAnB,GAAoCA,cAApC,GAAqDD,MAJvD;AAMC,IAAA,KAAK,EAAGE;AANT,IADD;AAUA,CArBM;;;;AAuBP,MAAMI,eAAe,GAAG,SAAgB;AAAA,MAAd;AAAEpB,IAAAA;AAAF,GAAc;AACvC,SACC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGE,eAAOmB;AAArB,KACC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGnB,eAAOoB;AAArB,KAA6CtB,IAA7C,CADD,CADD;AAKA,CAND","sourcesContent":["/**\n * External dependencies\n */\nimport { Text, Image, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tusePreferredColorScheme,\n\tusePreferredColorSchemeStyle,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nexport const HelpDetailBodyText = ( { text } ) => {\n\tconst bodyStyle = usePreferredColorSchemeStyle(\n\t\tstyles.helpDetailBody,\n\t\tstyles.helpDetailBodyDark\n\t);\n\treturn (\n\t\t<Text selectable style={ bodyStyle }>\n\t\t\t{ text }\n\t\t</Text>\n\t);\n};\n\nexport const HelpDetailSectionHeadingText = ( { text, badge } ) => {\n\tconst headingTextStyle = usePreferredColorSchemeStyle(\n\t\tstyles.helpDetailSectionHeadingText,\n\t\tstyles.helpDetailSectionHeadingTextDark\n\t);\n\treturn (\n\t\t<View style={ styles.helpDetailSectionHeading }>\n\t\t\t{ badge && <HelpDetailBadge text={ badge } /> }\n\t\t\t<Text\n\t\t\t\taccessibilityRole=\"header\"\n\t\t\t\tselectable\n\t\t\t\tstyle={ headingTextStyle }\n\t\t\t>\n\t\t\t\t{ text }\n\t\t\t</Text>\n\t\t</View>\n\t);\n};\n\nexport const HelpDetailImage = ( {\n\taccessible,\n\taccessibilityLabel,\n\tsource,\n\tsourceDarkMode,\n} ) => {\n\tconst imageStyle = usePreferredColorSchemeStyle(\n\t\tstyles.helpDetailImage,\n\t\tstyles.helpDetailImageDark\n\t);\n\tconst darkModeEnabled = usePreferredColorScheme() === 'dark';\n\treturn (\n\t\t<Image\n\t\t\taccessible={ accessible }\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\tsource={\n\t\t\t\tdarkModeEnabled && sourceDarkMode ? sourceDarkMode : source\n\t\t\t}\n\t\t\tstyle={ imageStyle }\n\t\t/>\n\t);\n};\n\nconst HelpDetailBadge = ( { text } ) => {\n\treturn (\n\t\t<View style={ styles.helpDetailBadgeContainer }>\n\t\t\t<Text style={ styles.helpDetailBadgeText }>{ text }</Text>\n\t\t</View>\n\t);\n};\n"]}
|
|
@@ -11,7 +11,7 @@ var _date = require("@wordpress/date");
|
|
|
11
11
|
|
|
12
12
|
var _data = require("@wordpress/data");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _blockEditor = require("@wordpress/block-editor");
|
|
15
15
|
|
|
16
16
|
var _coreData = require("@wordpress/core-data");
|
|
17
17
|
|
|
@@ -31,7 +31,10 @@ function getDayOfTheMonth() {
|
|
|
31
31
|
return new Date(d.getFullYear(), d.getMonth() + (firstDay ? 0 : 1), firstDay ? 1 : 0).toISOString();
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
function PostSchedule() {
|
|
34
|
+
function PostSchedule(_ref) {
|
|
35
|
+
let {
|
|
36
|
+
onClose
|
|
37
|
+
} = _ref;
|
|
35
38
|
const {
|
|
36
39
|
postDate,
|
|
37
40
|
postType
|
|
@@ -55,19 +58,18 @@ function PostSchedule() {
|
|
|
55
58
|
before: getDayOfTheMonth(previewedMonth, false),
|
|
56
59
|
exclude: [select(_store.store).getCurrentPostId()]
|
|
57
60
|
}), [previewedMonth, postType]);
|
|
58
|
-
const events = (0, _element.useMemo)(() => (eventsByPostType || []).map(
|
|
61
|
+
const events = (0, _element.useMemo)(() => (eventsByPostType || []).map(_ref2 => {
|
|
59
62
|
let {
|
|
60
63
|
title,
|
|
61
64
|
type,
|
|
62
65
|
date: eventDate
|
|
63
|
-
} =
|
|
66
|
+
} = _ref2;
|
|
64
67
|
return {
|
|
65
68
|
title: title === null || title === void 0 ? void 0 : title.rendered,
|
|
66
69
|
type,
|
|
67
70
|
date: new Date(eventDate)
|
|
68
71
|
};
|
|
69
72
|
}), [eventsByPostType]);
|
|
70
|
-
const ref = (0, _element.useRef)();
|
|
71
73
|
const settings = (0, _date.__experimentalGetSettings)(); // To know if the current timezone is a 12 hour time with look for "a" in the time format
|
|
72
74
|
// We also make sure this a is not escaped by a "/"
|
|
73
75
|
|
|
@@ -75,22 +77,13 @@ function PostSchedule() {
|
|
|
75
77
|
.replace(/\\\\/g, '') // Replace "//" with empty strings.
|
|
76
78
|
.split('').reverse().join('') // Reverse the string and test for "a" not followed by a slash.
|
|
77
79
|
);
|
|
78
|
-
|
|
79
|
-
function onChange(newDate) {
|
|
80
|
-
onUpdateDate(newDate);
|
|
81
|
-
const {
|
|
82
|
-
ownerDocument
|
|
83
|
-
} = ref.current;
|
|
84
|
-
ownerDocument.activeElement.blur();
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return (0, _element.createElement)(_components.DateTimePicker, {
|
|
88
|
-
ref: ref,
|
|
80
|
+
return (0, _element.createElement)(_blockEditor.__experimentalPublishDateTimePicker, {
|
|
89
81
|
currentDate: postDate,
|
|
90
|
-
onChange:
|
|
82
|
+
onChange: onUpdateDate,
|
|
91
83
|
is12Hour: is12HourTime,
|
|
92
84
|
events: events,
|
|
93
|
-
onMonthPreviewed: setPreviewedMonth
|
|
85
|
+
onMonthPreviewed: setPreviewedMonth,
|
|
86
|
+
onClose: onClose
|
|
94
87
|
});
|
|
95
88
|
}
|
|
96
89
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-schedule/index.js"],"names":["getDayOfTheMonth","date","Date","firstDay","d","getFullYear","getMonth","toISOString","PostSchedule","postDate","postType","select","editorStore","getEditedPostAttribute","getCurrentPostType","editPost","onUpdateDate","previewedMonth","setPreviewedMonth","eventsByPostType","coreStore","getEntityRecords","status","after","before","exclude","getCurrentPostId","events","map","title","type","eventDate","rendered","
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-schedule/index.js"],"names":["getDayOfTheMonth","date","Date","firstDay","d","getFullYear","getMonth","toISOString","PostSchedule","onClose","postDate","postType","select","editorStore","getEditedPostAttribute","getCurrentPostType","editPost","onUpdateDate","previewedMonth","setPreviewedMonth","eventsByPostType","coreStore","getEntityRecords","status","after","before","exclude","getCurrentPostId","events","map","title","type","eventDate","rendered","settings","is12HourTime","test","formats","time","toLowerCase","replace","split","reverse","join"],"mappings":";;;;;;;AAMA;;AAHA;;AACA;;AACA;;AAEA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGA,SAASA,gBAAT,GAAgE;AAAA,MAArCC,IAAqC,uEAA9B,IAAIC,IAAJ,EAA8B;AAAA,MAAlBC,QAAkB,uEAAP,IAAO;AAC/D,QAAMC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GAA5D,CAFuB,EAQxB,CAAET,cAAF,EAAkBP,QAAlB,CARwB,CAAzB;AAWA,QAAMiB,MAAM,GAAG,sBACd,MACC,CAAER,gBAAgB,IAAI,EAAtB,EAA2BS,GAA3B,CACC;AAAA,QAAE;AAAEC,MAAAA,KAAF;AAASC,MAAAA,IAAT;AAAe9B,MAAAA,IAAI,EAAE+B;AAArB,KAAF;AAAA,WAA0C;AACzCF,MAAAA,KAAK,EAAEA,KAAF,aAAEA,KAAF,uBAAEA,KAAK,CAAEG,QAD2B;AAEzCF,MAAAA,IAFyC;AAGzC9B,MAAAA,IAAI,EAAE,IAAIC,IAAJ,CAAU8B,SAAV;AAHmC,KAA1C;AAAA,GADD,CAFa,EASd,CAAEZ,gBAAF,CATc,CAAf;AAYA,QAAMc,QAAQ,GAAG,sCAAjB,CAxCmD,CA0CnD;AACA;;AACA,QAAMC,YAAY,GAAG,WAAWC,IAAX,CACpBF,QAAQ,CAACG,OAAT,CAAiBC,IAAjB,CACEC,WADF,GACgB;AADhB,GAEEC,OAFF,CAEW,OAFX,EAEoB,EAFpB,EAEyB;AAFzB,GAGEC,KAHF,CAGS,EAHT,EAIEC,OAJF,GAKEC,IALF,CAKQ,EALR,CADoB,CAMP;AANO,GAArB;AASA,SACC,4BAAC,gDAAD;AACC,IAAA,WAAW,EAAGjC,QADf;AAEC,IAAA,QAAQ,EAAGO,YAFZ;AAGC,IAAA,QAAQ,EAAGkB,YAHZ;AAIC,IAAA,MAAM,EAAGP,MAJV;AAKC,IAAA,gBAAgB,EAAGT,iBALpB;AAMC,IAAA,OAAO,EAAGV;AANX,IADD;AAUA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalGetSettings } from '@wordpress/date';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __experimentalPublishDateTimePicker as PublishDateTimePicker } from '@wordpress/block-editor';\nimport { useState, useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction getDayOfTheMonth( date = new Date(), firstDay = true ) {\n\tconst d = new Date( date );\n\treturn new Date(\n\t\td.getFullYear(),\n\t\td.getMonth() + ( firstDay ? 0 : 1 ),\n\t\tfirstDay ? 1 : 0\n\t).toISOString();\n}\n\nexport default function PostSchedule( { onClose } ) {\n\tconst { postDate, postType } = useSelect(\n\t\t( select ) => ( {\n\t\t\tpostDate: select( editorStore ).getEditedPostAttribute( 'date' ),\n\t\t\tpostType: select( editorStore ).getCurrentPostType(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst { editPost } = useDispatch( editorStore );\n\tconst onUpdateDate = ( date ) => editPost( { date } );\n\n\tconst [ previewedMonth, setPreviewedMonth ] = useState(\n\t\tgetDayOfTheMonth( postDate )\n\t);\n\n\t// Pick up published and schduled site posts.\n\tconst eventsByPostType = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntityRecords( 'postType', postType, {\n\t\t\t\tstatus: 'publish,future',\n\t\t\t\tafter: getDayOfTheMonth( previewedMonth ),\n\t\t\t\tbefore: getDayOfTheMonth( previewedMonth, false ),\n\t\t\t\texclude: [ select( editorStore ).getCurrentPostId() ],\n\t\t\t} ),\n\t\t[ previewedMonth, postType ]\n\t);\n\n\tconst events = useMemo(\n\t\t() =>\n\t\t\t( eventsByPostType || [] ).map(\n\t\t\t\t( { title, type, date: eventDate } ) => ( {\n\t\t\t\t\ttitle: title?.rendered,\n\t\t\t\t\ttype,\n\t\t\t\t\tdate: new Date( eventDate ),\n\t\t\t\t} )\n\t\t\t),\n\t\t[ eventsByPostType ]\n\t);\n\n\tconst settings = __experimentalGetSettings();\n\n\t// To know if the current timezone is a 12 hour time with look for \"a\" in the time format\n\t// We also make sure this a is not escaped by a \"/\"\n\tconst is12HourTime = /a(?!\\\\)/i.test(\n\t\tsettings.formats.time\n\t\t\t.toLowerCase() // Test only the lower case a.\n\t\t\t.replace( /\\\\\\\\/g, '' ) // Replace \"//\" with empty strings.\n\t\t\t.split( '' )\n\t\t\t.reverse()\n\t\t\t.join( '' ) // Reverse the string and test for \"a\" not followed by a slash.\n\t);\n\n\treturn (\n\t\t<PublishDateTimePicker\n\t\t\tcurrentDate={ postDate }\n\t\t\tonChange={ onUpdateDate }\n\t\t\tis12Hour={ is12HourTime }\n\t\t\tevents={ events }\n\t\t\tonMonthPreviewed={ setPreviewedMonth }\n\t\t\tonClose={ onClose }\n\t\t/>\n\t);\n}\n"]}
|
package/build/store/selectors.js
CHANGED
|
@@ -1632,7 +1632,7 @@ function __experimentalGetTemplateInfo(state, template) {
|
|
|
1632
1632
|
}
|
|
1633
1633
|
|
|
1634
1634
|
const {
|
|
1635
|
-
|
|
1635
|
+
description,
|
|
1636
1636
|
slug,
|
|
1637
1637
|
title,
|
|
1638
1638
|
area
|
|
@@ -1644,7 +1644,7 @@ function __experimentalGetTemplateInfo(state, template) {
|
|
|
1644
1644
|
} = __experimentalGetDefaultTemplateType(state, slug);
|
|
1645
1645
|
|
|
1646
1646
|
const templateTitle = (0, _lodash.isString)(title) ? title : title === null || title === void 0 ? void 0 : title.rendered;
|
|
1647
|
-
const templateDescription = (0, _lodash.isString)(
|
|
1647
|
+
const templateDescription = (0, _lodash.isString)(description) ? description : description === null || description === void 0 ? void 0 : description.raw;
|
|
1648
1648
|
const templateIcon = ((_experimentalGetDefa = __experimentalGetDefaultTemplatePartAreas(state).find(item => area === item.area)) === null || _experimentalGetDefa === void 0 ? void 0 : _experimentalGetDefa.icon) || _icons.layout;
|
|
1649
1649
|
return {
|
|
1650
1650
|
title: templateTitle && templateTitle !== slug ? templateTitle : defaultTitle || slug,
|