@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/index.native.js"],"names":["kebabCase","Text","SafeAreaView","ScrollView","StyleSheet","View","TransitionPresets","BottomSheet","BottomSheetConsumer","PanelBody","__","helpFilled","plusCircleFilled","alignJustify","trash","cog","useSelect","store","editorStore","usePreferredColorSchemeStyle","requestContactCustomerSupport","requestGotoCustomerSupportOptions","styles","HelpDetailNavigationScreen","HelpTopicRow","HelpGetSupportButton","IntroToBlocks","AddBlocks","MoveBlocks","RemoveBlocks","CustomizeBlocks","HELP_TOPICS","label","icon","view","EditorHelpTopics","close","isVisible","onClose","postType","select","getEditedPostAttribute","sectionTitle","helpDetailSectionHeading","helpDetailSectionHeadingDark","title","contentContainer","navigationContainer","container","listProps","contentContainerStyle","flatten","paddingBottom","Math","max","safeAreaBottomInset","marginTop","map","labelSlug","gestureEnabled","DefaultTransition"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,QAA1B;AACA,SAASC,IAAT,EAAeC,YAAf,EAA6BC,UAA7B,EAAyCC,UAAzC,EAAqDC,IAArD,QAAiE,cAAjE;AACA,SAASC,iBAAT,QAAkC,yB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OAAO,EACNU;AALF,MAhCF,EA0CE,cAAC,oBAAD;AACC,MAAA,KAAK,EAAGV,EAAE,CACT,sBADS,CADX;AAIC,MAAA,OAAO,EACNW;AALF,MA1CF,CAhBD,CADD;AAuEA,GA5EF,CAVD,CALD,CALD,EAqGGU,WAAW,CAAC0B,GAAZ,CAAiB,SAAuB;AAAA,QAArB;AAAEvB,MAAAA,IAAF;AAAQF,MAAAA;AAAR,KAAqB;AACzC,UAAM0B,SAAS,GAAG1D,SAAS,CAAEgC,KAAF,CAA3B;AACA,WACC,cAAC,0BAAD;AACC,MAAA,GAAG,EAAG0B,SADP;AAEC,MAAA,IAAI,EAAGA,SAFR;AAGC,MAAA,OAAO,EAAGxB,IAHX;AAIC,MAAA,KAAK,EAAGF,KAJT;AAKC,MAAA,OAAO,EAAG;AACT2B,QAAAA,cAAc,EAAE,KADP;AAET,WAAGrD,iBAAiB,CAACsD;AAFZ;AALX,MADD;AAYA,GAdC,CArGH,CADD,CARD,CADD;AAkIA;;AAED,eAAezB,gBAAf","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":["kebabCase","SafeAreaView","ScrollView","StyleSheet","View","TransitionPresets","BottomSheet","BottomSheetConsumer","PanelBody","__","helpFilled","plusCircleFilled","trash","cog","useSelect","store","editorStore","requestContactCustomerSupport","requestGotoCustomerSupportOptions","styles","HelpDetailNavigationScreen","HelpTopicRow","HelpGetSupportButton","IntroToBlocks","AddBlocks","MoveBlocks","RemoveBlocks","CustomizeBlocks","moveBlocksIcon","HelpSectionTitle","HELP_TOPICS","label","icon","view","EditorHelpTopics","close","isVisible","onClose","postType","select","getEditedPostAttribute","title","contentContainer","navigationContainer","container","listProps","contentContainerStyle","flatten","paddingBottom","Math","max","safeAreaBottomInset","marginTop","map","index","labelSlug","isLastItem","length","gestureEnabled","DefaultTransition"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,QAA1B;AACA,SAASC,YAAT,EAAuBC,UAAvB,EAAmCC,UAAnC,EAA+CC,IAA/C,QAA2D,cAA3D;AACA,SAASC,iBAAT,QAAkC,yBAAlC;AAEA;AACA;AACA;;AACA,SACCC,WADD,EAECC,mBAFD,EAGCC,SAHD,QAIO,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AIC,MAAA,OAAO,EACNS;AALF,MAlDF,CAhBD,CADD;AA+EA,GApFF,CAVD,CALD,CALD,EA6GGY,WAAW,CAACuB,GAAZ,CAAiB,SAAuB;AAAA,QAArB;AAAEpB,MAAAA,IAAF;AAAQF,MAAAA;AAAR,KAAqB;AACzC,UAAMwB,SAAS,GAAGvD,SAAS,CAAE+B,KAAF,CAA3B;AACA,WACC,cAAC,0BAAD;AACC,MAAA,GAAG,EAAGwB,SADP;AAEC,MAAA,IAAI,EAAGA,SAFR;AAGC,MAAA,OAAO,EAAGtB,IAHX;AAIC,MAAA,KAAK,EAAGF,KAJT;AAKC,MAAA,OAAO,EAAG;AACT2B,QAAAA,cAAc,EAAE,KADP;AAET,WAAGrD,iBAAiB,CAACsD;AAFZ;AALX,MADD;AAYA,GAdC,CA7GH,CADD,CARD,CADD;AA0IA;;AAED,eAAezB,gBAAf","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"]}
|
|
@@ -14,16 +14,28 @@ import { __ } from '@wordpress/i18n';
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import styles from './style.scss';
|
|
17
|
-
import { HelpDetailBodyText, HelpDetailImage } from './view-sections';
|
|
17
|
+
import { HelpDetailBodyText, HelpDetailImage, HelpDetailSectionHeadingText } from './view-sections';
|
|
18
18
|
|
|
19
19
|
const MoveBlocks = () => {
|
|
20
20
|
return createElement(Fragment, null, createElement(HelpDetailImage, {
|
|
21
|
+
source: require('./images/drag-and-drop-light.png'),
|
|
22
|
+
sourceDarkMode: require('./images/drag-and-drop-dark.png')
|
|
23
|
+
}), createElement(View, {
|
|
24
|
+
style: styles.helpDetailContainer
|
|
25
|
+
}, createElement(HelpDetailSectionHeadingText, {
|
|
26
|
+
text: __('Drag & drop'),
|
|
27
|
+
badge: __('NEW')
|
|
28
|
+
}), createElement(HelpDetailBodyText, {
|
|
29
|
+
text: __('Drag & drop makes rearranging blocks a breeze. Press and hold on a block, then drag it to its new location and release.')
|
|
30
|
+
})), createElement(HelpDetailImage, {
|
|
21
31
|
source: require('./images/move-light.png'),
|
|
22
32
|
sourceDarkMode: require('./images/move-dark.png')
|
|
23
33
|
}), createElement(View, {
|
|
24
34
|
style: styles.helpDetailContainer
|
|
25
|
-
}, createElement(
|
|
26
|
-
text: __('
|
|
35
|
+
}, createElement(HelpDetailSectionHeadingText, {
|
|
36
|
+
text: __('Arrow buttons')
|
|
37
|
+
}), createElement(HelpDetailBodyText, {
|
|
38
|
+
text: __('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.')
|
|
27
39
|
})));
|
|
28
40
|
};
|
|
29
41
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/move-blocks.native.js"],"names":["View","__","styles","HelpDetailBodyText","HelpDetailImage","MoveBlocks","require","helpDetailContainer"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,cAArB;AAEA;AACA;AACA;;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,cAAnB;AACA,
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/move-blocks.native.js"],"names":["View","__","styles","HelpDetailBodyText","HelpDetailImage","HelpDetailSectionHeadingText","MoveBlocks","require","helpDetailContainer"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,cAArB;AAEA;AACA;AACA;;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,cAAnB;AACA,SACCC,kBADD,EAECC,eAFD,EAGCC,4BAHD,QAIO,iBAJP;;AAMA,MAAMC,UAAU,GAAG,MAAM;AACxB,SACC,8BACC,cAAC,eAAD;AACC,IAAA,MAAM,EAAGC,OAAO,CAAE,kCAAF,CADjB;AAEC,IAAA,cAAc,EAAGA,OAAO,CAAE,iCAAF;AAFzB,IADD,EAKC,cAAC,IAAD;AAAM,IAAA,KAAK,EAAGL,MAAM,CAACM;AAArB,KACC,cAAC,4BAAD;AACC,IAAA,IAAI,EAAGP,EAAE,CAAE,aAAF,CADV;AAEC,IAAA,KAAK,EAAGA,EAAE,CAAE,KAAF;AAFX,IADD,EAKC,cAAC,kBAAD;AACC,IAAA,IAAI,EAAGA,EAAE,CACR,yHADQ;AADV,IALD,CALD,EAgBC,cAAC,eAAD;AACC,IAAA,MAAM,EAAGM,OAAO,CAAE,yBAAF,CADjB;AAEC,IAAA,cAAc,EAAGA,OAAO,CAAE,wBAAF;AAFzB,IAhBD,EAoBC,cAAC,IAAD;AAAM,IAAA,KAAK,EAAGL,MAAM,CAACM;AAArB,KACC,cAAC,4BAAD;AAA8B,IAAA,IAAI,EAAGP,EAAE,CAAE,eAAF;AAAvC,IADD,EAEC,cAAC,kBAAD;AACC,IAAA,IAAI,EAAGA,EAAE,CACR,kKADQ;AADV,IAFD,CApBD,CADD;AA+BA,CAhCD;;AAkCA,eAAeK,UAAf","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"]}
|
|
@@ -3,7 +3,7 @@ import { createElement } from "@wordpress/element";
|
|
|
3
3
|
/**
|
|
4
4
|
* External dependencies
|
|
5
5
|
*/
|
|
6
|
-
import { Text, Image } from 'react-native';
|
|
6
|
+
import { Text, Image, View } from 'react-native';
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
@@ -26,14 +26,19 @@ export const HelpDetailBodyText = _ref => {
|
|
|
26
26
|
};
|
|
27
27
|
export const HelpDetailSectionHeadingText = _ref2 => {
|
|
28
28
|
let {
|
|
29
|
-
text
|
|
29
|
+
text,
|
|
30
|
+
badge
|
|
30
31
|
} = _ref2;
|
|
31
|
-
const
|
|
32
|
-
return createElement(
|
|
32
|
+
const headingTextStyle = usePreferredColorSchemeStyle(styles.helpDetailSectionHeadingText, styles.helpDetailSectionHeadingTextDark);
|
|
33
|
+
return createElement(View, {
|
|
34
|
+
style: styles.helpDetailSectionHeading
|
|
35
|
+
}, badge && createElement(HelpDetailBadge, {
|
|
36
|
+
text: badge
|
|
37
|
+
}), createElement(Text, {
|
|
33
38
|
accessibilityRole: "header",
|
|
34
39
|
selectable: true,
|
|
35
|
-
style:
|
|
36
|
-
}, text);
|
|
40
|
+
style: headingTextStyle
|
|
41
|
+
}, text));
|
|
37
42
|
};
|
|
38
43
|
export const HelpDetailImage = _ref3 => {
|
|
39
44
|
let {
|
|
@@ -51,4 +56,15 @@ export const HelpDetailImage = _ref3 => {
|
|
|
51
56
|
style: imageStyle
|
|
52
57
|
});
|
|
53
58
|
};
|
|
59
|
+
|
|
60
|
+
const HelpDetailBadge = _ref4 => {
|
|
61
|
+
let {
|
|
62
|
+
text
|
|
63
|
+
} = _ref4;
|
|
64
|
+
return createElement(View, {
|
|
65
|
+
style: styles.helpDetailBadgeContainer
|
|
66
|
+
}, createElement(Text, {
|
|
67
|
+
style: styles.helpDetailBadgeText
|
|
68
|
+
}, text));
|
|
69
|
+
};
|
|
54
70
|
//# sourceMappingURL=view-sections.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/view-sections.native.js"],"names":["Text","Image","usePreferredColorScheme","usePreferredColorSchemeStyle","styles","HelpDetailBodyText","text","bodyStyle","helpDetailBody","helpDetailBodyDark","HelpDetailSectionHeadingText","
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/editor-help/view-sections.native.js"],"names":["Text","Image","View","usePreferredColorScheme","usePreferredColorSchemeStyle","styles","HelpDetailBodyText","text","bodyStyle","helpDetailBody","helpDetailBodyDark","HelpDetailSectionHeadingText","badge","headingTextStyle","helpDetailSectionHeadingText","helpDetailSectionHeadingTextDark","helpDetailSectionHeading","HelpDetailImage","accessible","accessibilityLabel","source","sourceDarkMode","imageStyle","helpDetailImage","helpDetailImageDark","darkModeEnabled","HelpDetailBadge","helpDetailBadgeContainer","helpDetailBadgeText"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,EAAeC,KAAf,EAAsBC,IAAtB,QAAkC,cAAlC;AAEA;AACA;AACA;;AACA,SACCC,uBADD,EAECC,4BAFD,QAGO,oBAHP;A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e,IAAIJ,cAAnB,GAAoCA,cAApC,GAAqDD,MAJvD;AAMC,IAAA,KAAK,EAAGE;AANT,IADD;AAUA,CArBM;;AAuBP,MAAMI,eAAe,GAAG,SAAgB;AAAA,MAAd;AAAEnB,IAAAA;AAAF,GAAc;AACvC,SACC,cAAC,IAAD;AAAM,IAAA,KAAK,EAAGF,MAAM,CAACsB;AAArB,KACC,cAAC,IAAD;AAAM,IAAA,KAAK,EAAGtB,MAAM,CAACuB;AAArB,KAA6CrB,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"]}
|
|
@@ -5,8 +5,8 @@ import { createElement } from "@wordpress/element";
|
|
|
5
5
|
*/
|
|
6
6
|
import { __experimentalGetSettings } from '@wordpress/date';
|
|
7
7
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { __experimentalPublishDateTimePicker as PublishDateTimePicker } from '@wordpress/block-editor';
|
|
9
|
+
import { useState, useMemo } from '@wordpress/element';
|
|
10
10
|
import { store as coreStore } from '@wordpress/core-data';
|
|
11
11
|
/**
|
|
12
12
|
* Internal dependencies
|
|
@@ -21,7 +21,10 @@ function getDayOfTheMonth() {
|
|
|
21
21
|
return new Date(d.getFullYear(), d.getMonth() + (firstDay ? 0 : 1), firstDay ? 1 : 0).toISOString();
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export default function PostSchedule() {
|
|
24
|
+
export default function PostSchedule(_ref) {
|
|
25
|
+
let {
|
|
26
|
+
onClose
|
|
27
|
+
} = _ref;
|
|
25
28
|
const {
|
|
26
29
|
postDate,
|
|
27
30
|
postType
|
|
@@ -45,19 +48,18 @@ export default function PostSchedule() {
|
|
|
45
48
|
before: getDayOfTheMonth(previewedMonth, false),
|
|
46
49
|
exclude: [select(editorStore).getCurrentPostId()]
|
|
47
50
|
}), [previewedMonth, postType]);
|
|
48
|
-
const events = useMemo(() => (eventsByPostType || []).map(
|
|
51
|
+
const events = useMemo(() => (eventsByPostType || []).map(_ref2 => {
|
|
49
52
|
let {
|
|
50
53
|
title,
|
|
51
54
|
type,
|
|
52
55
|
date: eventDate
|
|
53
|
-
} =
|
|
56
|
+
} = _ref2;
|
|
54
57
|
return {
|
|
55
58
|
title: title === null || title === void 0 ? void 0 : title.rendered,
|
|
56
59
|
type,
|
|
57
60
|
date: new Date(eventDate)
|
|
58
61
|
};
|
|
59
62
|
}), [eventsByPostType]);
|
|
60
|
-
const ref = useRef();
|
|
61
63
|
|
|
62
64
|
const settings = __experimentalGetSettings(); // To know if the current timezone is a 12 hour time with look for "a" in the time format
|
|
63
65
|
// We also make sure this a is not escaped by a "/"
|
|
@@ -67,22 +69,13 @@ export default function PostSchedule() {
|
|
|
67
69
|
.replace(/\\\\/g, '') // Replace "//" with empty strings.
|
|
68
70
|
.split('').reverse().join('') // Reverse the string and test for "a" not followed by a slash.
|
|
69
71
|
);
|
|
70
|
-
|
|
71
|
-
function onChange(newDate) {
|
|
72
|
-
onUpdateDate(newDate);
|
|
73
|
-
const {
|
|
74
|
-
ownerDocument
|
|
75
|
-
} = ref.current;
|
|
76
|
-
ownerDocument.activeElement.blur();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return createElement(DateTimePicker, {
|
|
80
|
-
ref: ref,
|
|
72
|
+
return createElement(PublishDateTimePicker, {
|
|
81
73
|
currentDate: postDate,
|
|
82
|
-
onChange:
|
|
74
|
+
onChange: onUpdateDate,
|
|
83
75
|
is12Hour: is12HourTime,
|
|
84
76
|
events: events,
|
|
85
|
-
onMonthPreviewed: setPreviewedMonth
|
|
77
|
+
onMonthPreviewed: setPreviewedMonth,
|
|
78
|
+
onClose: onClose
|
|
86
79
|
});
|
|
87
80
|
}
|
|
88
81
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-schedule/index.js"],"names":["__experimentalGetSettings","useDispatch","useSelect","
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-schedule/index.js"],"names":["__experimentalGetSettings","useDispatch","useSelect","__experimentalPublishDateTimePicker","PublishDateTimePicker","useState","useMemo","store","coreStore","editorStore","getDayOfTheMonth","date","Date","firstDay","d","getFullYear","getMonth","toISOString","PostSchedule","onClose","postDate","postType","select","getEditedPostAttribute","getCurrentPostType","editPost","onUpdateDate","previewedMonth","setPreviewedMonth","eventsByPostType","getEntityRecords","status","after","before","exclude","getCurrentPostId","events","map","title","type","eventDate","rendered","settings","is12HourTime","test","formats","time","toLowerCase","replace","split","reverse","join"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,yBAAT,QAA0C,iBAA1C;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,mCAAmC,IAAIC,qBAAhD,QAA6E,yBAA7E;AACA,SAASC,QAAT,EAAmBC,OAAnB,QAAkC,oBAAlC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,WAAlB,QAAqC,aAArC;;AAEA,SAASC,gBAAT,GAAgE;AAAA,MAArCC,IAAqC,uEAA9B,IAAIC,IAAJ,EAA8B;AAAA,MAAlBC,QAAkB,uEAAP,IAAO;AAC/D,QAAMC,CAAC,GAAG,IAAIF,IAAJ,CAAUD,IAAV,CAAV;AACA,SAAO,IAAIC,IAAJ,CACNE,CAAC,CAACC,WAAF,EADM,EAEND,CAAC,CAACE,QAAF,MAAiBH,QAAQ,GAAG,CAAH,GAAO,CAAhC,CAFM,EAGNA,QAAQ,GAAG,CAAH,GAAO,CAHT,EAILI,WAJK,EAAP;AAKA;;AAED,eAAe,SAASC,YAAT,OAAqC;AAAA,MAAd;AAAEC,IAAAA;AAAF,GAAc;AACnD,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAyBnB,SAAS,CACrCoB,MAAF,KAAgB;AACfF,IAAAA,QAAQ,EAAEE,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,EAAE,IAAIC,IAAJ,CAAU4B,SAAV;AAHmC,KAA1C;AAAA,GADD,CAFoB,EASrB,CAAEX,gBAAF,CATqB,CAAtB;;AAYA,QAAMa,QAAQ,GAAG1C,yBAAyB,EAA1C,CAxCmD,CA0CnD;AACA;;;AACA,QAAM2C,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,cAAC,qBAAD;AACC,IAAA,WAAW,EAAG/B,QADf;AAEC,IAAA,QAAQ,EAAGM,YAFZ;AAGC,IAAA,QAAQ,EAAGiB,YAHZ;AAIC,IAAA,MAAM,EAAGP,MAJV;AAKC,IAAA,gBAAgB,EAAGR,iBALpB;AAMC,IAAA,OAAO,EAAGT;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"]}
|
|
@@ -1425,7 +1425,7 @@ export function __experimentalGetTemplateInfo(state, template) {
|
|
|
1425
1425
|
}
|
|
1426
1426
|
|
|
1427
1427
|
const {
|
|
1428
|
-
|
|
1428
|
+
description,
|
|
1429
1429
|
slug,
|
|
1430
1430
|
title,
|
|
1431
1431
|
area
|
|
@@ -1437,7 +1437,7 @@ export function __experimentalGetTemplateInfo(state, template) {
|
|
|
1437
1437
|
} = __experimentalGetDefaultTemplateType(state, slug);
|
|
1438
1438
|
|
|
1439
1439
|
const templateTitle = isString(title) ? title : title === null || title === void 0 ? void 0 : title.rendered;
|
|
1440
|
-
const templateDescription = isString(
|
|
1440
|
+
const templateDescription = isString(description) ? description : description === null || description === void 0 ? void 0 : description.raw;
|
|
1441
1441
|
const templateIcon = ((_experimentalGetDefa = __experimentalGetDefaultTemplatePartAreas(state).find(item => area === item.area)) === null || _experimentalGetDefa === void 0 ? void 0 : _experimentalGetDefa.icon) || layout;
|
|
1442
1442
|
return {
|
|
1443
1443
|
title: templateTitle && templateTitle !== slug ? templateTitle : defaultTitle || slug,
|