@wordpress/edit-post 7.23.0 → 7.24.1
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/device-preview/index.js +6 -3
- package/build/components/device-preview/index.js.map +1 -1
- package/build/components/header/writing-menu/index.js +1 -1
- package/build/components/header/writing-menu/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +1 -1
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/sidebar/post-pending-status/index.js +9 -2
- package/build/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +1 -3
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/post-sticky/index.js +9 -2
- package/build/components/sidebar/post-sticky/index.js.map +1 -1
- package/build/components/sidebar/post-template/index.js +7 -4
- package/build/components/sidebar/post-template/index.js.map +1 -1
- package/build/components/sidebar/post-visibility/index.js +12 -4
- package/build/components/sidebar/post-visibility/index.js.map +1 -1
- package/build/components/text-editor/index.js +21 -1
- package/build/components/text-editor/index.js.map +1 -1
- package/build/components/view-link/index.js +11 -3
- package/build/components/view-link/index.js.map +1 -1
- package/build/components/visual-editor/index.js +5 -1
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/store/actions.js +1 -1
- package/build/store/actions.js.map +1 -1
- package/build-module/components/device-preview/index.js +6 -3
- package/build-module/components/device-preview/index.js.map +1 -1
- package/build-module/components/header/writing-menu/index.js +1 -1
- package/build-module/components/header/writing-menu/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -1
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/sidebar/post-pending-status/index.js +10 -3
- package/build-module/components/sidebar/post-pending-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +2 -4
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-sticky/index.js +10 -3
- package/build-module/components/sidebar/post-sticky/index.js.map +1 -1
- package/build-module/components/sidebar/post-template/index.js +9 -6
- package/build-module/components/sidebar/post-template/index.js.map +1 -1
- package/build-module/components/sidebar/post-visibility/index.js +14 -6
- package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
- package/build-module/components/text-editor/index.js +22 -2
- package/build-module/components/text-editor/index.js.map +1 -1
- package/build-module/components/view-link/index.js +11 -3
- package/build-module/components/view-link/index.js.map +1 -1
- package/build-module/components/visual-editor/index.js +5 -1
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/store/actions.js +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-style/style-rtl.css +7 -62
- package/build-style/style.css +7 -62
- package/package.json +32 -32
- package/src/components/device-preview/index.js +21 -15
- package/src/components/header/writing-menu/index.js +1 -1
- package/src/components/preferences-modal/index.js +1 -1
- package/src/components/sidebar/post-pending-status/index.js +10 -3
- package/src/components/sidebar/post-status/index.js +5 -5
- package/src/components/sidebar/post-sticky/index.js +10 -3
- package/src/components/sidebar/post-template/index.js +10 -6
- package/src/components/sidebar/post-template/style.scss +0 -15
- package/src/components/sidebar/post-visibility/index.js +12 -5
- package/src/components/sidebar/post-visibility/style.scss +0 -11
- package/src/components/text-editor/index.js +20 -2
- package/src/components/text-editor/style.scss +3 -1
- package/src/components/view-link/index.js +21 -10
- package/src/components/visual-editor/index.js +7 -0
- package/src/store/actions.js +1 -1
- package/src/store/test/actions.js +1 -1
- package/src/style.scss +0 -2
- package/build/components/sidebar/post-author/index.js +0 -22
- package/build/components/sidebar/post-author/index.js.map +0 -1
- package/build/components/sidebar/post-schedule/index.js +0 -67
- package/build/components/sidebar/post-schedule/index.js.map +0 -1
- package/build-module/components/sidebar/post-author/index.js +0 -13
- package/build-module/components/sidebar/post-author/index.js.map +0 -1
- package/build-module/components/sidebar/post-schedule/index.js +0 -60
- package/build-module/components/sidebar/post-schedule/index.js.map +0 -1
- package/src/components/sidebar/post-author/index.js +0 -20
- package/src/components/sidebar/post-author/style.scss +0 -5
- package/src/components/sidebar/post-schedule/index.js +0 -67
- package/src/components/sidebar/post-schedule/style.scss +0 -36
package/CHANGELOG.md
CHANGED
|
@@ -26,7 +26,8 @@ function DevicePreview() {
|
|
|
26
26
|
hasActiveMetaboxes,
|
|
27
27
|
isPostSaveable,
|
|
28
28
|
isViewable,
|
|
29
|
-
deviceType
|
|
29
|
+
deviceType,
|
|
30
|
+
showIconLabels
|
|
30
31
|
} = (0, _data.useSelect)(select => {
|
|
31
32
|
var _postType$viewable;
|
|
32
33
|
const {
|
|
@@ -40,7 +41,8 @@ function DevicePreview() {
|
|
|
40
41
|
hasActiveMetaboxes: select(_store.store).hasMetaBoxes(),
|
|
41
42
|
isPostSaveable: select(_editor.store).isEditedPostSaveable(),
|
|
42
43
|
isViewable: (_postType$viewable = postType?.viewable) !== null && _postType$viewable !== void 0 ? _postType$viewable : false,
|
|
43
|
-
deviceType: select(_store.store).__experimentalGetPreviewDeviceType()
|
|
44
|
+
deviceType: select(_store.store).__experimentalGetPreviewDeviceType(),
|
|
45
|
+
showIconLabels: select(_store.store).isFeatureActive('showIconLabels')
|
|
44
46
|
};
|
|
45
47
|
}, []);
|
|
46
48
|
const {
|
|
@@ -51,7 +53,8 @@ function DevicePreview() {
|
|
|
51
53
|
className: "edit-post-post-preview-dropdown",
|
|
52
54
|
deviceType: deviceType,
|
|
53
55
|
setDeviceType: setPreviewDeviceType,
|
|
54
|
-
label: (0, _i18n.__)('Preview')
|
|
56
|
+
label: (0, _i18n.__)('Preview'),
|
|
57
|
+
showIconLabels: showIconLabels
|
|
55
58
|
}, ({
|
|
56
59
|
onClose
|
|
57
60
|
}) => isViewable && (0, _react.createElement)(_components.MenuGroup, null, (0, _react.createElement)("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_editor","_icons","_i18n","_blockEditor","_data","_coreData","_store","DevicePreview","hasActiveMetaboxes","isPostSaveable","isViewable","deviceType","useSelect","select","_postType$viewable","getEditedPostAttribute","editorStore","getPostType","coreStore","postType","editPostStore","hasMetaBoxes","isEditedPostSaveable","viewable","__experimentalGetPreviewDeviceType","__experimentalSetPreviewDeviceType","setPreviewDeviceType","useDispatch","_react","createElement","__experimentalPreviewOptions","isEnabled","className","setDeviceType","label","__","onClose","MenuGroup","PostPreviewButton","role","forceIsAutosaveable","textContent","Fragment","Icon","icon","external","onPreview"],"sources":["@wordpress/edit-post/src/components/device-preview/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Icon, MenuGroup } from '@wordpress/components';\nimport { PostPreviewButton, store as editorStore } from '@wordpress/editor';\nimport { external } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalPreviewOptions as PreviewOptions } from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport default function DevicePreview() {\n\tconst {
|
|
1
|
+
{"version":3,"names":["_components","require","_editor","_icons","_i18n","_blockEditor","_data","_coreData","_store","DevicePreview","hasActiveMetaboxes","isPostSaveable","isViewable","deviceType","showIconLabels","useSelect","select","_postType$viewable","getEditedPostAttribute","editorStore","getPostType","coreStore","postType","editPostStore","hasMetaBoxes","isEditedPostSaveable","viewable","__experimentalGetPreviewDeviceType","isFeatureActive","__experimentalSetPreviewDeviceType","setPreviewDeviceType","useDispatch","_react","createElement","__experimentalPreviewOptions","isEnabled","className","setDeviceType","label","__","onClose","MenuGroup","PostPreviewButton","role","forceIsAutosaveable","textContent","Fragment","Icon","icon","external","onPreview"],"sources":["@wordpress/edit-post/src/components/device-preview/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Icon, MenuGroup } from '@wordpress/components';\nimport { PostPreviewButton, store as editorStore } from '@wordpress/editor';\nimport { external } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalPreviewOptions as PreviewOptions } from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport default function DevicePreview() {\n\tconst {\n\t\thasActiveMetaboxes,\n\t\tisPostSaveable,\n\t\tisViewable,\n\t\tdeviceType,\n\t\tshowIconLabels,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tisPostSaveable: select( editorStore ).isEditedPostSaveable(),\n\t\t\tisViewable: postType?.viewable ?? false,\n\t\t\tdeviceType:\n\t\t\t\tselect( editPostStore ).__experimentalGetPreviewDeviceType(),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t};\n\t}, [] );\n\tconst { __experimentalSetPreviewDeviceType: setPreviewDeviceType } =\n\t\tuseDispatch( editPostStore );\n\n\treturn (\n\t\t<PreviewOptions\n\t\t\tisEnabled={ isPostSaveable }\n\t\t\tclassName=\"edit-post-post-preview-dropdown\"\n\t\t\tdeviceType={ deviceType }\n\t\t\tsetDeviceType={ setPreviewDeviceType }\n\t\t\tlabel={ __( 'Preview' ) }\n\t\t\tshowIconLabels={ showIconLabels }\n\t\t>\n\t\t\t{ ( { onClose } ) =>\n\t\t\t\tisViewable && (\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<div className=\"edit-post-header-preview__grouping-external\">\n\t\t\t\t\t\t\t<PostPreviewButton\n\t\t\t\t\t\t\t\tclassName=\"edit-post-header-preview__button-external\"\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\tforceIsAutosaveable={ hasActiveMetaboxes }\n\t\t\t\t\t\t\t\ttextContent={\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t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AEO,YAAc,CAAC,CAACI,kCAAkC,CAAC,CAAC;MAC7Db,cAAc,EACbE,MAAM,CAAEO,YAAc,CAAC,CAACK,eAAe,CAAE,gBAAiB;IAC5D,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEC,kCAAkC,EAAEC;EAAqB,CAAC,GACjE,IAAAC,iBAAW,EAAER,YAAc,CAAC;EAE7B,OACC,IAAAS,MAAA,CAAAC,aAAA,EAAC5B,YAAA,CAAA6B,4BAAc;IACdC,SAAS,EAAGxB,cAAgB;IAC5ByB,SAAS,EAAC,iCAAiC;IAC3CvB,UAAU,EAAGA,UAAY;IACzBwB,aAAa,EAAGP,oBAAsB;IACtCQ,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU,CAAG;IACzBzB,cAAc,EAAGA;EAAgB,GAE/B,CAAE;IAAE0B;EAAQ,CAAC,KACd5B,UAAU,IACT,IAAAoB,MAAA,CAAAC,aAAA,EAACjC,WAAA,CAAAyC,SAAS,QACT,IAAAT,MAAA,CAAAC,aAAA;IAAKG,SAAS,EAAC;EAA6C,GAC3D,IAAAJ,MAAA,CAAAC,aAAA,EAAC/B,OAAA,CAAAwC,iBAAiB;IACjBN,SAAS,EAAC,2CAA2C;IACrDO,IAAI,EAAC,UAAU;IACfC,mBAAmB,EAAGlC,kBAAoB;IAC1CmC,WAAW,EACV,IAAAb,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAc,QAAA,QACG,IAAAP,QAAE,EAAE,oBAAqB,CAAC,EAC5B,IAAAP,MAAA,CAAAC,aAAA,EAACjC,WAAA,CAAA+C,IAAI;MAACC,IAAI,EAAGC;IAAU,CAAE,CACxB,CACF;IACDC,SAAS,EAAGV;EAAS,CACrB,CACG,CACK,CAGE,CAAC;AAEnB"}
|
|
@@ -34,7 +34,7 @@ function WritingMenu() {
|
|
|
34
34
|
} = (0, _data.useDispatch)(_preferences.store);
|
|
35
35
|
const toggleDistractionFree = () => {
|
|
36
36
|
registry.batch(() => {
|
|
37
|
-
setPreference('core/edit-post', 'fixedToolbar',
|
|
37
|
+
setPreference('core/edit-post', 'fixedToolbar', true);
|
|
38
38
|
setIsInserterOpened(false);
|
|
39
39
|
setIsListViewOpened(false);
|
|
40
40
|
closeGeneralSidebar();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_components","_i18n","_compose","_keycodes","_preferences","_blockEditor","_store","WritingMenu","registry","useRegistry","isDistractionFree","useSelect","select","blockEditorStore","getSettings","setIsInserterOpened","setIsListViewOpened","closeGeneralSidebar","useDispatch","postEditorStore","set","setPreference","preferencesStore","toggleDistractionFree","batch","isLargeViewport","useViewportMatch","_react","createElement","MenuGroup","label","_x","PreferenceToggleMenuItem","scope","disabled","name","__","info","messageActivated","messageDeactivated","shortcut","displayShortcut","secondary","onToggle","primaryShift","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/header/writing-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch, useRegistry } from '@wordpress/data';\nimport { MenuGroup } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as postEditorStore } from '../../../store';\n\nfunction WritingMenu() {\n\tconst registry = useRegistry();\n\tconst isDistractionFree = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().isDistractionFree,\n\t\t[]\n\t);\n\n\tconst { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } =\n\t\tuseDispatch( postEditorStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tregistry.batch( () => {\n\t\t\tsetPreference( 'core/edit-post', 'fixedToolbar',
|
|
1
|
+
{"version":3,"names":["_data","require","_components","_i18n","_compose","_keycodes","_preferences","_blockEditor","_store","WritingMenu","registry","useRegistry","isDistractionFree","useSelect","select","blockEditorStore","getSettings","setIsInserterOpened","setIsListViewOpened","closeGeneralSidebar","useDispatch","postEditorStore","set","setPreference","preferencesStore","toggleDistractionFree","batch","isLargeViewport","useViewportMatch","_react","createElement","MenuGroup","label","_x","PreferenceToggleMenuItem","scope","disabled","name","__","info","messageActivated","messageDeactivated","shortcut","displayShortcut","secondary","onToggle","primaryShift","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/header/writing-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch, useRegistry } from '@wordpress/data';\nimport { MenuGroup } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as postEditorStore } from '../../../store';\n\nfunction WritingMenu() {\n\tconst registry = useRegistry();\n\tconst isDistractionFree = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().isDistractionFree,\n\t\t[]\n\t);\n\n\tconst { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } =\n\t\tuseDispatch( postEditorStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tregistry.batch( () => {\n\t\t\tsetPreference( 'core/edit-post', 'fixedToolbar', true );\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t\tcloseGeneralSidebar();\n\t\t} );\n\t};\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tif ( ! isLargeViewport ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tdisabled={ isDistractionFree }\n\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\tinfo={ __(\n\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t) }\n\t\t\t\tmessageActivated={ __( 'Top toolbar activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Top toolbar deactivated' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tname=\"focusMode\"\n\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\tmessageActivated={ __( 'Spotlight mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Spotlight mode deactivated' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tname=\"fullscreenMode\"\n\t\t\t\tlabel={ __( 'Fullscreen mode' ) }\n\t\t\t\tinfo={ __( 'Show and hide admin UI' ) }\n\t\t\t\tmessageActivated={ __( 'Fullscreen mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Fullscreen mode deactivated' ) }\n\t\t\t\tshortcut={ displayShortcut.secondary( 'f' ) }\n\t\t\t/>\n\t\t\t<PreferenceToggleMenuItem\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tname=\"distractionFree\"\n\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\tinfo={ __( 'Write with calmness' ) }\n\t\t\t\tmessageActivated={ __( 'Distraction free mode activated' ) }\n\t\t\t\tmessageDeactivated={ __( 'Distraction free mode deactivated' ) }\n\t\t\t\tshortcut={ displayShortcut.primaryShift( '\\\\' ) }\n\t\t\t/>\n\t\t</MenuGroup>\n\t);\n}\n\nexport default WritingM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IAAI,EAAC,iBAAiB;IACtBQ,QAAQ,EAAGpB,qBAAuB;IAClCO,KAAK,EAAG,IAAAM,QAAE,EAAE,kBAAmB,CAAG;IAClCC,IAAI,EAAG,IAAAD,QAAE,EAAE,qBAAsB,CAAG;IACpCE,gBAAgB,EAAG,IAAAF,QAAE,EAAE,iCAAkC,CAAG;IAC5DG,kBAAkB,EAAG,IAAAH,QAAE,EAAE,mCAAoC,CAAG;IAChEI,QAAQ,EAAGC,yBAAe,CAACG,YAAY,CAAE,IAAK;EAAG,CACjD,CACS,CAAC;AAEd;AAAC,IAAAC,QAAA,GAEctC,WAAW;AAAAuC,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -56,7 +56,7 @@ function EditPostPreferencesModal() {
|
|
|
56
56
|
set: setPreference
|
|
57
57
|
} = (0, _data.useDispatch)(_preferences.store);
|
|
58
58
|
const toggleDistractionFree = () => {
|
|
59
|
-
setPreference('core/edit-post', 'fixedToolbar',
|
|
59
|
+
setPreference('core/edit-post', 'fixedToolbar', true);
|
|
60
60
|
setIsInserterOpened(false);
|
|
61
61
|
setIsListViewOpened(false);
|
|
62
62
|
closeGeneralSidebar();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_compose","_data","_element","_editor","_interface","_preferences","_options","_metaBoxesSection","_interopRequireDefault","_store","_blockManager","PREFERENCES_MODAL_NAME","exports","EditPostPreferencesModal","isLargeViewport","useViewportMatch","closeModal","useDispatch","interfaceStore","isModalActive","showBlockBreadcrumbsOption","useSelect","select","getEditorSettings","editorStore","getEditorMode","isFeatureActive","editPostStore","modalActive","mode","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","closeGeneralSidebar","setIsListViewOpened","setIsInserterOpened","set","setPreference","preferencesStore","toggleDistractionFree","sections","useMemo","name","tabLabel","__","content","_react","createElement","Fragment","PreferencesModalSection","title","description","EnablePublishSidebarOption","help","label","EnableFeature","featureName","onToggle","default","EnablePluginDocumentSettingPanelOption","Slot","PostTaxonomies","taxonomyWrapper","taxonomy","EnablePanelOption","labels","menu_name","panelName","slug","PostFeaturedImageCheck","PostExcerptCheck","PostTypeSupportCheck","supportKeys","PageAttributesCheck","PreferencesModal","PreferencesModalTabs"],"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tPostTaxonomies,\n\tPostExcerptCheck,\n\tPageAttributesCheck,\n\tPostFeaturedImageCheck,\n\tPostTypeSupportCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\n\nimport {\n\tEnablePluginDocumentSettingPanelOption,\n\tEnablePublishSidebarOption,\n\tEnablePanelOption,\n\tEnableFeature,\n} from './options';\nimport MetaBoxesSection from './meta-boxes-section';\nimport { store as editPostStore } from '../../store';\nimport BlockManager from '../block-manager';\n\nexport const PREFERENCES_MODAL_NAME = 'edit-post/preferences';\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\tconst [ isModalActive, showBlockBreadcrumbsOption ] = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getEditorMode, isFeatureActive } = select( editPostStore );\n\t\t\tconst modalActive = select( interfaceStore ).isModalActive(\n\t\t\t\tPREFERENCES_MODAL_NAME\n\t\t\t);\n\t\t\tconst mode = getEditorMode();\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled =\n\t\t\t\tisFeatureActive( 'distractionFree' );\n\t\t\treturn [\n\t\t\t\tmodalActive,\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\t\tisLargeViewport &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual',\n\t\t\t\tisDistractionFreeEnabled,\n\t\t\t];\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\n\tconst { closeGeneralSidebar, setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tsetPreference( 'core/edit-post', 'fixedToolbar', false );\n\t\tsetIsInserterOpened( false );\n\t\tsetIsListViewOpened( false );\n\t\tcloseGeneralSidebar();\n\t};\n\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Change options related to publishing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Include pre-publish checklist'\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</PreferencesModalSection>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize options related to the block editor interface and editing flow.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Block interactions' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize how you interact with blocks in the block library and editing canvas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Places the most frequent blocks in the block library.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Visible blocks' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'panels',\n\t\t\t\ttabLabel: __( 'Panels' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Choose what displays in the panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\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/>\n\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<MetaBoxesSection\n\t\t\t\t\t\t\ttitle={ __( 'Additional' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Add extra areas to the editor.'\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),\n\t\t\t},\n\t\t],\n\t\t[ isLargeViewport, showBlockBreadcrumbsOption ]\n\t);\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"],"mappings":";;;;;;;;;AAIA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;A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,QAAE,EAAE,iBAAkB,CAAG;MACjCuB,SAAS,EAAC;IAAiB,CAC3B,CACmB,CACG,CAAC,EAC1B,IAAArB,MAAA,CAAAC,aAAA,EAACxC,iBAAA,CAAAmD,OAAgB;MAChBR,KAAK,EAAG,IAAAN,QAAE,EAAE,YAAa,CAAG;MAC5BO,WAAW,EAAG,IAAAP,QAAE,EACf,gCACD;IAAG,CACH,CACA;EAEJ,CAAC,CACD,EACD,CAAE9B,eAAe,EAAEM,0BAA0B,CAC9C,CAAC;EAED,IAAK,CAAED,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,OACC,IAAA2B,MAAA,CAAAC,aAAA,EAAC3C,UAAA,CAAAsE,gBAAgB;IAAC1D,UAAU,EAAGA;EAAY,GAC1C,IAAA8B,MAAA,CAAAC,aAAA,EAAC3C,UAAA,CAAAuE,oBAAoB;IAACnC,QAAQ,EAAGA;EAAU,CAAE,CAC5B,CAAC;AAErB"}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_compose","_data","_element","_editor","_interface","_preferences","_options","_metaBoxesSection","_interopRequireDefault","_store","_blockManager","PREFERENCES_MODAL_NAME","exports","EditPostPreferencesModal","isLargeViewport","useViewportMatch","closeModal","useDispatch","interfaceStore","isModalActive","showBlockBreadcrumbsOption","useSelect","select","getEditorSettings","editorStore","getEditorMode","isFeatureActive","editPostStore","modalActive","mode","isRichEditingEnabled","richEditingEnabled","isDistractionFreeEnabled","closeGeneralSidebar","setIsListViewOpened","setIsInserterOpened","set","setPreference","preferencesStore","toggleDistractionFree","sections","useMemo","name","tabLabel","__","content","_react","createElement","Fragment","PreferencesModalSection","title","description","EnablePublishSidebarOption","help","label","EnableFeature","featureName","onToggle","default","EnablePluginDocumentSettingPanelOption","Slot","PostTaxonomies","taxonomyWrapper","taxonomy","EnablePanelOption","labels","menu_name","panelName","slug","PostFeaturedImageCheck","PostExcerptCheck","PostTypeSupportCheck","supportKeys","PageAttributesCheck","PreferencesModal","PreferencesModalTabs"],"sources":["@wordpress/edit-post/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport {\n\tPostTaxonomies,\n\tPostExcerptCheck,\n\tPageAttributesCheck,\n\tPostFeaturedImageCheck,\n\tPostTypeSupportCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\n\nimport {\n\tEnablePluginDocumentSettingPanelOption,\n\tEnablePublishSidebarOption,\n\tEnablePanelOption,\n\tEnableFeature,\n} from './options';\nimport MetaBoxesSection from './meta-boxes-section';\nimport { store as editPostStore } from '../../store';\nimport BlockManager from '../block-manager';\n\nexport const PREFERENCES_MODAL_NAME = 'edit-post/preferences';\n\nexport default function EditPostPreferencesModal() {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { closeModal } = useDispatch( interfaceStore );\n\tconst [ isModalActive, showBlockBreadcrumbsOption ] = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getEditorMode, isFeatureActive } = select( editPostStore );\n\t\t\tconst modalActive = select( interfaceStore ).isModalActive(\n\t\t\t\tPREFERENCES_MODAL_NAME\n\t\t\t);\n\t\t\tconst mode = getEditorMode();\n\t\t\tconst isRichEditingEnabled = getEditorSettings().richEditingEnabled;\n\t\t\tconst isDistractionFreeEnabled =\n\t\t\t\tisFeatureActive( 'distractionFree' );\n\t\t\treturn [\n\t\t\t\tmodalActive,\n\t\t\t\t! isDistractionFreeEnabled &&\n\t\t\t\t\tisLargeViewport &&\n\t\t\t\t\tisRichEditingEnabled &&\n\t\t\t\t\tmode === 'visual',\n\t\t\t\tisDistractionFreeEnabled,\n\t\t\t];\n\t\t},\n\t\t[ isLargeViewport ]\n\t);\n\n\tconst { closeGeneralSidebar, setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tsetPreference( 'core/edit-post', 'fixedToolbar', true );\n\t\tsetIsInserterOpened( false );\n\t\tsetIsListViewOpened( false );\n\t\tcloseGeneralSidebar();\n\t};\n\n\tconst sections = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\tname: 'general',\n\t\t\t\ttabLabel: __( 'General' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\t\ttitle={ __( 'Publishing' ) }\n\t\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\t'Change options related to publishing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePublishSidebarOption\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Review settings, such as visibility and tags.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t'Include pre-publish checklist'\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</PreferencesModalSection>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize options related to the block editor interface and editing flow.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Show text instead of icons on buttons.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ showBlockBreadcrumbsOption && (\n\t\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'blocks',\n\t\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Block interactions' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Customize how you interact with blocks in the block library and editing canvas.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Places the most frequent blocks in the block library.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Visible blocks' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t\"Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.\"\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockManager />\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'panels',\n\t\t\t\ttabLabel: __( 'Panels' ),\n\t\t\t\tcontent: (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Choose what displays in the panel.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePluginDocumentSettingPanelOption.Slot />\n\t\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\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/>\n\t\t\t\t\t\t\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t\t<MetaBoxesSection\n\t\t\t\t\t\t\ttitle={ __( 'Additional' ) }\n\t\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t\t'Add extra areas to the editor.'\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),\n\t\t\t},\n\t\t],\n\t\t[ isLargeViewport, showBlockBreadcrumbsOption ]\n\t);\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModal closeModal={ closeModal }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"],"mappings":";;;;;;;;;AAIA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAQA,IAAAK,UAAA,GAAAL,OAAA;AAMA,IAAAM,YAAA,GAAAN,OAAA;AAMA,IAAAO,QAAA,GAAAP,OA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EAAG,IAAAN,QAAE,EAAE,YAAa,CAAG;MAC5BO,WAAW,EAAG,IAAAP,QAAE,EACf,gCACD;IAAG,CACH,CACA;EAEJ,CAAC,CACD,EACD,CAAE9B,eAAe,EAAEM,0BAA0B,CAC9C,CAAC;EAED,IAAK,CAAED,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,OACC,IAAA2B,MAAA,CAAAC,aAAA,EAAC3C,UAAA,CAAAsE,gBAAgB;IAAC1D,UAAU,EAAGA;EAAY,GAC1C,IAAA8B,MAAA,CAAAC,aAAA,EAAC3C,UAAA,CAAAuE,oBAAoB;IAACnC,QAAQ,EAAGA;EAAU,CAAE,CAC5B,CAAC;AAErB"}
|
|
@@ -6,14 +6,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.PostPendingStatus = PostPendingStatus;
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var _components = require("@wordpress/components");
|
|
10
9
|
var _editor = require("@wordpress/editor");
|
|
10
|
+
var _lockUnlock = require("../../../lock-unlock");
|
|
11
11
|
/**
|
|
12
12
|
* WordPress dependencies
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
PostPanelRow
|
|
21
|
+
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
15
22
|
function PostPendingStatus() {
|
|
16
|
-
return (0, _react.createElement)(_editor.PostPendingStatusCheck, null, (0, _react.createElement)(
|
|
23
|
+
return (0, _react.createElement)(_editor.PostPendingStatusCheck, null, (0, _react.createElement)(PostPanelRow, null, (0, _react.createElement)(_editor.PostPendingStatus, null)));
|
|
17
24
|
}
|
|
18
25
|
var _default = PostPendingStatus;
|
|
19
26
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_editor","require","_lockUnlock","PostPanelRow","unlock","editorPrivateApis","PostPendingStatus","_react","createElement","PostPendingStatusCheck","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/post-pending-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPostPendingStatus as PostPendingStatusForm,\n\tPostPendingStatusCheck,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostPanelRow } = unlock( editorPrivateApis );\n\nexport function PostPendingStatus() {\n\treturn (\n\t\t<PostPendingStatusCheck>\n\t\t\t<PostPanelRow>\n\t\t\t\t<PostPendingStatusForm />\n\t\t\t</PostPanelRow>\n\t\t</PostPendingStatusCheck>\n\t);\n}\n\nexport default PostPendingStatus;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AASA,IAAAC,WAAA,GAAAD,OAAA;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA,MAAM;EAAEE;AAAa,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAE7C,SAASC,iBAAiBA,CAAA,EAAG;EACnC,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACR,OAAA,CAAAS,sBAAsB,QACtB,IAAAF,MAAA,CAAAC,aAAA,EAACL,YAAY,QACZ,IAAAI,MAAA,CAAAC,aAAA,EAACR,OAAA,CAAAM,iBAAqB,MAAE,CACX,CACS,CAAC;AAE3B;AAAC,IAAAI,QAAA,GAEcJ,iBAAiB;AAAAK,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -12,9 +12,7 @@ var _data = require("@wordpress/data");
|
|
|
12
12
|
var _editor = require("@wordpress/editor");
|
|
13
13
|
var _postVisibility = _interopRequireDefault(require("../post-visibility"));
|
|
14
14
|
var _postTrash = _interopRequireDefault(require("../post-trash"));
|
|
15
|
-
var _postSchedule = _interopRequireDefault(require("../post-schedule"));
|
|
16
15
|
var _postSticky = _interopRequireDefault(require("../post-sticky"));
|
|
17
|
-
var _postAuthor = _interopRequireDefault(require("../post-author"));
|
|
18
16
|
var _postSlug = _interopRequireDefault(require("../post-slug"));
|
|
19
17
|
var _postFormat = _interopRequireDefault(require("../post-format"));
|
|
20
18
|
var _postPendingStatus = _interopRequireDefault(require("../post-pending-status"));
|
|
@@ -60,7 +58,7 @@ function PostStatus() {
|
|
|
60
58
|
title: (0, _i18n.__)('Summary'),
|
|
61
59
|
opened: isOpened,
|
|
62
60
|
onToggle: () => toggleEditorPanelOpened(PANEL_NAME)
|
|
63
|
-
}, (0, _react.createElement)(_pluginPostStatusInfo.default.Slot, null, fills => (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_postVisibility.default, null), (0, _react.createElement)(
|
|
61
|
+
}, (0, _react.createElement)(_pluginPostStatusInfo.default.Slot, null, fills => (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_postVisibility.default, null), (0, _react.createElement)(_editor.PostSchedulePanel, null), (0, _react.createElement)(_postTemplate.default, null), (0, _react.createElement)(_editor.PostURLPanel, null), (0, _react.createElement)(_editor.PostSyncStatus, null), (0, _react.createElement)(_postSticky.default, null), (0, _react.createElement)(_postPendingStatus.default, null), (0, _react.createElement)(_postFormat.default, null), (0, _react.createElement)(_postSlug.default, null), (0, _react.createElement)(_editor.PostAuthorPanel, null), fills, (0, _react.createElement)(_components.__experimentalHStack, {
|
|
64
62
|
style: {
|
|
65
63
|
marginTop: '16px'
|
|
66
64
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_data","_editor","_postVisibility","_interopRequireDefault","_postTrash","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_data","_editor","_postVisibility","_interopRequireDefault","_postTrash","_postSticky","_postSlug","_postFormat","_postPendingStatus","_pluginPostStatusInfo","_store","_postTemplate","PANEL_NAME","PostStatus","isOpened","isRemoved","useSelect","select","isEditorPanelRemoved","isEditorPanelOpened","editPostStore","toggleEditorPanelOpened","useDispatch","_react","createElement","PanelBody","className","title","__","opened","onToggle","default","Slot","fills","Fragment","PostSchedulePanel","PostURLPanel","PostSyncStatus","PostAuthorPanel","__experimentalHStack","style","marginTop","spacing","wrap","PostSwitchToDraftButton"],"sources":["@wordpress/edit-post/src/components/sidebar/post-status/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalHStack as HStack,\n\tPanelBody,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tPostAuthorPanel,\n\tPostSchedulePanel,\n\tPostSwitchToDraftButton,\n\tPostSyncStatus,\n\tPostURLPanel,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport PostVisibility from '../post-visibility';\nimport PostTrash from '../post-trash';\nimport PostSticky from '../post-sticky';\nimport PostSlug from '../post-slug';\nimport PostFormat from '../post-format';\nimport PostPendingStatus from '../post-pending-status';\nimport PluginPostStatusInfo from '../plugin-post-status-info';\nimport { store as editPostStore } from '../../../store';\nimport PostTemplate from '../post-template';\n\n/**\n * Module Constants\n */\nconst PANEL_NAME = 'post-status';\n\nexport default function PostStatus() {\n\tconst { isOpened, isRemoved } = useSelect( ( select ) => {\n\t\t// We use isEditorPanelRemoved to hide the panel if it was programatically removed. We do\n\t\t// not use isEditorPanelEnabled since this panel should not be disabled through the UI.\n\t\tconst { isEditorPanelRemoved, isEditorPanelOpened } =\n\t\t\tselect( editPostStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( PANEL_NAME ),\n\t\t\tisOpened: isEditorPanelOpened( PANEL_NAME ),\n\t\t};\n\t}, [] );\n\tconst { toggleEditorPanelOpened } = useDispatch( editPostStore );\n\n\tif ( isRemoved ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody\n\t\t\tclassName=\"edit-post-post-status\"\n\t\t\ttitle={ __( 'Summary' ) }\n\t\t\topened={ isOpened }\n\t\t\tonToggle={ () => toggleEditorPanelOpened( PANEL_NAME ) }\n\t\t>\n\t\t\t<PluginPostStatusInfo.Slot>\n\t\t\t\t{ ( fills ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PostVisibility />\n\t\t\t\t\t\t<PostSchedulePanel />\n\t\t\t\t\t\t<PostTemplate />\n\t\t\t\t\t\t<PostURLPanel />\n\t\t\t\t\t\t<PostSyncStatus />\n\t\t\t\t\t\t<PostSticky />\n\t\t\t\t\t\t<PostPendingStatus />\n\t\t\t\t\t\t<PostFormat />\n\t\t\t\t\t\t<PostSlug />\n\t\t\t\t\t\t<PostAuthorPanel />\n\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tmarginTop: '16px',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\t\t\twrap\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostSwitchToDraftButton />\n\t\t\t\t\t\t\t<PostTrash />\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</PluginPostStatusInfo.Slot>\n\t\t</PanelBody>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAIA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAWA,IAAAI,eAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,UAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,WAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,SAAA,GAAAH,sBAAA,CAAAL,OAAA;AACA,IAAAS,WAAA,GAAAJ,sBAAA,CAAAL,OAAA;AACA,IAAAU,kBAAA,GAAAL,sBAAA,CAAAL,OAAA;AACA,IAAAW,qBAAA,GAAAN,sBAAA,CAAA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C,EAChB,IAAAR,MAAA,CAAAC,aAAA,EAACvB,OAAA,CAAAmC,YAAY,MAAE,CAAC,EAChB,IAAAb,MAAA,CAAAC,aAAA,EAACvB,OAAA,CAAAoC,cAAc,MAAE,CAAC,EAClB,IAAAd,MAAA,CAAAC,aAAA,EAACnB,WAAA,CAAA0B,OAAU,MAAE,CAAC,EACd,IAAAR,MAAA,CAAAC,aAAA,EAAChB,kBAAA,CAAAuB,OAAiB,MAAE,CAAC,EACrB,IAAAR,MAAA,CAAAC,aAAA,EAACjB,WAAA,CAAAwB,OAAU,MAAE,CAAC,EACd,IAAAR,MAAA,CAAAC,aAAA,EAAClB,SAAA,CAAAyB,OAAQ,MAAE,CAAC,EACZ,IAAAR,MAAA,CAAAC,aAAA,EAACvB,OAAA,CAAAqC,eAAe,MAAE,CAAC,EACjBL,KAAK,EACP,IAAAV,MAAA,CAAAC,aAAA,EAACzB,WAAA,CAAAwC,oBAAM;IACNC,KAAK,EAAG;MACPC,SAAS,EAAE;IACZ,CAAG;IACHC,OAAO,EAAG,CAAG;IACbC,IAAI;EAAA,GAEJ,IAAApB,MAAA,CAAAC,aAAA,EAACvB,OAAA,CAAA2C,uBAAuB,MAAE,CAAC,EAC3B,IAAArB,MAAA,CAAAC,aAAA,EAACpB,UAAA,CAAA2B,OAAS,MAAE,CACL,CACP,CAEuB,CACjB,CAAC;AAEd"}
|
|
@@ -6,14 +6,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.PostSticky = PostSticky;
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var _components = require("@wordpress/components");
|
|
10
9
|
var _editor = require("@wordpress/editor");
|
|
10
|
+
var _lockUnlock = require("../../../lock-unlock");
|
|
11
11
|
/**
|
|
12
12
|
* WordPress dependencies
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Internal dependencies
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
PostPanelRow
|
|
21
|
+
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
15
22
|
function PostSticky() {
|
|
16
|
-
return (0, _react.createElement)(_editor.PostStickyCheck, null, (0, _react.createElement)(
|
|
23
|
+
return (0, _react.createElement)(_editor.PostStickyCheck, null, (0, _react.createElement)(PostPanelRow, null, (0, _react.createElement)(_editor.PostSticky, null)));
|
|
17
24
|
}
|
|
18
25
|
var _default = PostSticky;
|
|
19
26
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_editor","require","_lockUnlock","PostPanelRow","unlock","editorPrivateApis","PostSticky","_react","createElement","PostStickyCheck","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/post-sticky/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPostSticky as PostStickyForm,\n\tPostStickyCheck,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostPanelRow } = unlock( editorPrivateApis );\n\nexport function PostSticky() {\n\treturn (\n\t\t<PostStickyCheck>\n\t\t\t<PostPanelRow>\n\t\t\t\t<PostStickyForm />\n\t\t\t</PostPanelRow>\n\t\t</PostStickyCheck>\n\t);\n}\n\nexport default PostSticky;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AASA,IAAAC,WAAA,GAAAD,OAAA;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA,MAAM;EAAEE;AAAa,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAE7C,SAASC,UAAUA,CAAA,EAAG;EAC5B,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACR,OAAA,CAAAS,eAAe,QACf,IAAAF,MAAA,CAAAC,aAAA,EAACL,YAAY,QACZ,IAAAI,MAAA,CAAAC,aAAA,EAACR,OAAA,CAAAM,UAAc,MAAE,CACJ,CACE,CAAC;AAEpB;AAAC,IAAAI,QAAA,GAEcJ,UAAU;AAAAK,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -14,6 +14,7 @@ var _editor = require("@wordpress/editor");
|
|
|
14
14
|
var _coreData = require("@wordpress/core-data");
|
|
15
15
|
var _form = _interopRequireDefault(require("./form"));
|
|
16
16
|
var _store = require("../../../store");
|
|
17
|
+
var _lockUnlock = require("../../../lock-unlock");
|
|
17
18
|
/**
|
|
18
19
|
* WordPress dependencies
|
|
19
20
|
*/
|
|
@@ -22,6 +23,9 @@ var _store = require("../../../store");
|
|
|
22
23
|
* Internal dependencies
|
|
23
24
|
*/
|
|
24
25
|
|
|
26
|
+
const {
|
|
27
|
+
PostPanelRow
|
|
28
|
+
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
25
29
|
function PostTemplate() {
|
|
26
30
|
// Use internal state instead of a ref to make sure that the component
|
|
27
31
|
// re-renders when the popover's anchor updates.
|
|
@@ -52,12 +56,11 @@ function PostTemplate() {
|
|
|
52
56
|
if (!isVisible) {
|
|
53
57
|
return null;
|
|
54
58
|
}
|
|
55
|
-
return (0, _react.createElement)(
|
|
56
|
-
|
|
59
|
+
return (0, _react.createElement)(PostPanelRow, {
|
|
60
|
+
label: (0, _i18n.__)('Template'),
|
|
57
61
|
ref: setPopoverAnchor
|
|
58
|
-
}, (0, _react.createElement)(
|
|
62
|
+
}, (0, _react.createElement)(_components.Dropdown, {
|
|
59
63
|
popoverProps: popoverProps,
|
|
60
|
-
className: "edit-post-post-template__dropdown",
|
|
61
64
|
contentClassName: "edit-post-post-template__dialog",
|
|
62
65
|
focusOnMount: true,
|
|
63
66
|
renderToggle: ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_components","_i18n","_data","_editor","_coreData","_form","_interopRequireDefault","_store","PostTemplate","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","isVisible","useSelect","select","_select$canUser","postTypeSlug","editorStore","getCurrentPostType","postType","coreStore","getPostType","viewable","settings","getEditorSettings","hasTemplates","availableTemplates","Object","keys","length","supportsTemplateMode","canCreateTemplates","canUser","_react","createElement","
|
|
1
|
+
{"version":3,"names":["_element","require","_components","_i18n","_data","_editor","_coreData","_form","_interopRequireDefault","_store","_lockUnlock","PostPanelRow","unlock","editorPrivateApis","PostTemplate","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","isVisible","useSelect","select","_select$canUser","postTypeSlug","editorStore","getCurrentPostType","postType","coreStore","getPostType","viewable","settings","getEditorSettings","hasTemplates","availableTemplates","Object","keys","length","supportsTemplateMode","canCreateTemplates","canUser","_react","createElement","label","__","ref","Dropdown","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","PostTemplateToggle","onClick","renderContent","onClose","default","templateTitle","templateSlug","getEditedPostAttribute","template","editPostStore","getEditedPostTemplate","title","slug","Button","className","variant","sprintf"],"sources":["@wordpress/edit-post/src/components/sidebar/post-template/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState, useMemo } from '@wordpress/element';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostTemplateForm from './form';\nimport { store as editPostStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostPanelRow } = unlock( editorPrivateApis );\n\nexport default function PostTemplate() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( { anchor: popoverAnchor, placement: 'bottom-end' } ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tconst isVisible = useSelect( ( select ) => {\n\t\tconst postTypeSlug = select( editorStore ).getCurrentPostType();\n\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\t\tif ( ! postType?.viewable ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst settings = select( editorStore ).getEditorSettings();\n\t\tconst hasTemplates =\n\t\t\t!! settings.availableTemplates &&\n\t\t\tObject.keys( settings.availableTemplates ).length > 0;\n\t\tif ( hasTemplates ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( ! settings.supportsTemplateMode ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst canCreateTemplates =\n\t\t\tselect( coreStore ).canUser( 'create', 'templates' ) ?? false;\n\t\treturn canCreateTemplates;\n\t}, [] );\n\n\tif ( ! isVisible ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PostPanelRow label={ __( 'Template' ) } ref={ setPopoverAnchor }>\n\t\t\t<Dropdown\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tcontentClassName=\"edit-post-post-template__dialog\"\n\t\t\t\tfocusOnMount\n\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t<PostTemplateToggle\n\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<PostTemplateForm onClose={ onClose } />\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PostPanelRow>\n\t);\n}\n\nfunction PostTemplateToggle( { isOpen, onClick } ) {\n\tconst templateTitle = useSelect( ( select ) => {\n\t\tconst templateSlug =\n\t\t\tselect( editorStore ).getEditedPostAttribute( 'template' );\n\n\t\tconst { supportsTemplateMode, availableTemplates } =\n\t\t\tselect( editorStore ).getEditorSettings();\n\t\tif ( ! supportsTemplateMode && availableTemplates[ templateSlug ] ) {\n\t\t\treturn availableTemplates[ templateSlug ];\n\t\t}\n\t\tconst template =\n\t\t\tselect( coreStore ).canUser( 'create', 'templates' ) &&\n\t\t\tselect( editPostStore ).getEditedPostTemplate();\n\t\treturn (\n\t\t\ttemplate?.title ||\n\t\t\ttemplate?.slug ||\n\t\t\tavailableTemplates?.[ templateSlug ]\n\t\t);\n\t}, [] );\n\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-post-post-template__toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\taria-label={\n\t\t\t\ttemplateTitle\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t// translators: %s: Name of the currently selected template.\n\t\t\t\t\t\t\t__( 'Select template: %s' ),\n\t\t\t\t\t\t\ttemplateTitle\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'Select template' )\n\t\t\t}\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ templateTitle ?? __( 'Default template' ) }\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAIA,IAAAK,SAAA,GAAAL,OAAA;AAKA,IAAAM,KAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAlBA;AACA;AACA;;AAWA;AACA;AACA;;AAKA,MAAM;EAAEU;AAAa,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAErC,SAASC,YAAYA,CAAA,EAAG;EACtC;EACA;EACA,MAAM,CAAEC,aAAa,EAAEC,gBAAgB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,IAAK,CAAC;EAC5D;EACA,MAAMC,YAAY,GAAG,IAAAC,gBAAO,EAC3B,OAAQ;IAAEC,MAAM,EAAEL,aAAa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AAQ;IACxB,cACCO,aAAa,GACV,IAAAW,aAAO;IACP;IACA,IAAAxB,QAAE,EAAE,qBAAsB,CAAC,EAC3Ba,aACA,CAAC,GACD,IAAAb,QAAE,EAAE,iBAAkB,CACzB;IACDS,OAAO,EAAGA;EAAS,GAEjBI,aAAa,aAAbA,aAAa,cAAbA,aAAa,GAAI,IAAAb,QAAE,EAAE,kBAAmB,CACnC,CAAC;AAEX"}
|
|
@@ -10,10 +10,18 @@ var _i18n = require("@wordpress/i18n");
|
|
|
10
10
|
var _components = require("@wordpress/components");
|
|
11
11
|
var _editor = require("@wordpress/editor");
|
|
12
12
|
var _element = require("@wordpress/element");
|
|
13
|
+
var _lockUnlock = require("../../../lock-unlock");
|
|
13
14
|
/**
|
|
14
15
|
* WordPress dependencies
|
|
15
16
|
*/
|
|
16
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Internal dependencies
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const {
|
|
23
|
+
PostPanelRow
|
|
24
|
+
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
17
25
|
function PostVisibility() {
|
|
18
26
|
// Use internal state instead of a ref to make sure that the component
|
|
19
27
|
// re-renders when the popover's anchor updates.
|
|
@@ -28,10 +36,10 @@ function PostVisibility() {
|
|
|
28
36
|
return (0, _react.createElement)(_editor.PostVisibilityCheck, {
|
|
29
37
|
render: ({
|
|
30
38
|
canEdit
|
|
31
|
-
}) => (0, _react.createElement)(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
},
|
|
39
|
+
}) => (0, _react.createElement)(PostPanelRow, {
|
|
40
|
+
label: (0, _i18n.__)('Visibility'),
|
|
41
|
+
ref: setPopoverAnchor
|
|
42
|
+
}, !canEdit && (0, _react.createElement)("span", null, (0, _react.createElement)(_editor.PostVisibilityLabel, null)), canEdit && (0, _react.createElement)(_components.Dropdown, {
|
|
35
43
|
contentClassName: "edit-post-post-visibility__dialog",
|
|
36
44
|
popoverProps: popoverProps,
|
|
37
45
|
focusOnMount: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_editor","_element","PostVisibility","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","_react","createElement","PostVisibilityCheck","render","canEdit","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_editor","_element","_lockUnlock","PostPanelRow","unlock","editorPrivateApis","PostVisibility","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","_react","createElement","PostVisibilityCheck","render","canEdit","label","__","ref","PostVisibilityLabel","Dropdown","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","PostVisibilityToggle","onClick","renderContent","onClose","usePostVisibilityLabel","Button","className","variant","sprintf","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/post-visibility/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport {\n\tPostVisibility as PostVisibilityForm,\n\tPostVisibilityLabel,\n\tPostVisibilityCheck,\n\tusePostVisibilityLabel,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useMemo, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostPanelRow } = unlock( editorPrivateApis );\n\nexport function PostVisibility() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'bottom-end',\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\treturn (\n\t\t<PostVisibilityCheck\n\t\t\trender={ ( { canEdit } ) => (\n\t\t\t\t<PostPanelRow\n\t\t\t\t\tlabel={ __( 'Visibility' ) }\n\t\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\t>\n\t\t\t\t\t{ ! canEdit && (\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<PostVisibilityLabel />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t{ canEdit && (\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tcontentClassName=\"edit-post-post-visibility__dialog\"\n\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t\tfocusOnMount\n\t\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t\t<PostVisibilityToggle\n\t\t\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t<PostVisibilityForm onClose={ onClose } />\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</PostPanelRow>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nfunction PostVisibilityToggle( { isOpen, onClick } ) {\n\tconst label = usePostVisibilityLabel();\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-post-post-visibility__toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post visibility.\n\t\t\taria-label={ sprintf( __( 'Select visibility: %s' ), label ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n\nexport default PostVisibility;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAOA,IAAAG,QAAA,GAAAH,OAAA;AAKA,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EAAGA;MAAS,CAAE;IACvC,CACH,CAEW;EACZ,CACH,CAAC;AAEJ;AAEA,SAASH,oBAAoBA,CAAE;EAAEF,MAAM;EAAEG;AAAQ,CAAC,EAAG;EACpD,MAAMX,KAAK,GAAG,IAAAc,8BAAsB,EAAC,CAAC;EACtC,OACC,IAAAnB,MAAA,CAAAC,aAAA,EAAChB,WAAA,CAAAmC,MAAM;IACNC,SAAS,EAAC,mCAAmC;IAC7CC,OAAO,EAAC,UAAU;IAClB,iBAAgBT;IAChB;IAAA;IACA,cAAa,IAAAU,aAAO,EAAE,IAAAjB,QAAE,EAAE,uBAAwB,CAAC,EAAED,KAAM,CAAG;IAC9DW,OAAO,EAAGA;EAAS,GAEjBX,KACK,CAAC;AAEX;AAAC,IAAAmB,QAAA,GAEchC,cAAc;AAAAiC,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -10,6 +10,7 @@ var _components = require("@wordpress/components");
|
|
|
10
10
|
var _data = require("@wordpress/data");
|
|
11
11
|
var _i18n = require("@wordpress/i18n");
|
|
12
12
|
var _keycodes = require("@wordpress/keycodes");
|
|
13
|
+
var _element = require("@wordpress/element");
|
|
13
14
|
var _store = require("../../store");
|
|
14
15
|
/**
|
|
15
16
|
* WordPress dependencies
|
|
@@ -26,6 +27,23 @@ function TextEditor() {
|
|
|
26
27
|
const {
|
|
27
28
|
switchEditorMode
|
|
28
29
|
} = (0, _data.useDispatch)(_store.store);
|
|
30
|
+
const {
|
|
31
|
+
isWelcomeGuideVisible
|
|
32
|
+
} = (0, _data.useSelect)(select => {
|
|
33
|
+
const {
|
|
34
|
+
isFeatureActive
|
|
35
|
+
} = select(_store.store);
|
|
36
|
+
return {
|
|
37
|
+
isWelcomeGuideVisible: isFeatureActive('welcomeGuide')
|
|
38
|
+
};
|
|
39
|
+
}, []);
|
|
40
|
+
const titleRef = (0, _element.useRef)();
|
|
41
|
+
(0, _element.useEffect)(() => {
|
|
42
|
+
if (isWelcomeGuideVisible) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
titleRef?.current?.focus();
|
|
46
|
+
}, [isWelcomeGuideVisible]);
|
|
29
47
|
return (0, _react.createElement)("div", {
|
|
30
48
|
className: "edit-post-text-editor"
|
|
31
49
|
}, isRichEditingEnabled && (0, _react.createElement)("div", {
|
|
@@ -36,6 +54,8 @@ function TextEditor() {
|
|
|
36
54
|
shortcut: _keycodes.displayShortcut.secondary('m')
|
|
37
55
|
}, (0, _i18n.__)('Exit code editor'))), (0, _react.createElement)("div", {
|
|
38
56
|
className: "edit-post-text-editor__body"
|
|
39
|
-
}, (0, _react.createElement)(_editor.
|
|
57
|
+
}, (0, _react.createElement)(_editor.PostTitleRaw, {
|
|
58
|
+
ref: titleRef
|
|
59
|
+
}), (0, _react.createElement)(_editor.PostTextEditor, null)));
|
|
40
60
|
}
|
|
41
61
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_editor","require","_components","_data","_i18n","_keycodes","_store","TextEditor","isRichEditingEnabled","useSelect","select","editorStore","getEditorSettings","richEditingEnabled","switchEditorMode","useDispatch","editPostStore","_react","createElement","className","__","Button","variant","onClick","shortcut","displayShortcut","secondary","
|
|
1
|
+
{"version":3,"names":["_editor","require","_components","_data","_i18n","_keycodes","_element","_store","TextEditor","isRichEditingEnabled","useSelect","select","editorStore","getEditorSettings","richEditingEnabled","switchEditorMode","useDispatch","editPostStore","isWelcomeGuideVisible","isFeatureActive","titleRef","useRef","useEffect","current","focus","_react","createElement","className","__","Button","variant","onClick","shortcut","displayShortcut","secondary","PostTitleRaw","ref","PostTextEditor"],"sources":["@wordpress/edit-post/src/components/text-editor/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPostTextEditor,\n\tPostTitleRaw,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport default function TextEditor() {\n\tconst isRichEditingEnabled = useSelect( ( select ) => {\n\t\treturn select( editorStore ).getEditorSettings().richEditingEnabled;\n\t}, [] );\n\tconst { switchEditorMode } = useDispatch( editPostStore );\n\n\tconst { isWelcomeGuideVisible } = useSelect( ( select ) => {\n\t\tconst { isFeatureActive } = select( editPostStore );\n\n\t\treturn {\n\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t};\n\t}, [] );\n\n\tconst titleRef = useRef();\n\n\tuseEffect( () => {\n\t\tif ( isWelcomeGuideVisible ) {\n\t\t\treturn;\n\t\t}\n\t\ttitleRef?.current?.focus();\n\t}, [ isWelcomeGuideVisible ] );\n\n\treturn (\n\t\t<div className=\"edit-post-text-editor\">\n\t\t\t{ isRichEditingEnabled && (\n\t\t\t\t<div className=\"edit-post-text-editor__toolbar\">\n\t\t\t\t\t<h2>{ __( 'Editing code' ) }</h2>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => switchEditorMode( 'visual' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.secondary( 'm' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Exit code editor' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"edit-post-text-editor__body\">\n\t\t\t\t<PostTitleRaw ref={ titleRef } />\n\t\t\t\t<PostTextEditor />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,G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G,GAE3C,IAAAN,QAAE,EAAE,kBAAmB,CAClB,CACJ,CACL,EACD,IAAAH,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAA6B,GAC3C,IAAAF,MAAA,CAAAC,aAAA,EAAC1B,OAAA,CAAAmC,YAAY;IAACC,GAAG,EAAGhB;EAAU,CAAE,CAAC,EACjC,IAAAK,MAAA,CAAAC,aAAA,EAAC1B,OAAA,CAAAqC,cAAc,MAAE,CACb,CACD,CAAC;AAER"}
|
|
@@ -11,15 +11,21 @@ var _icons = require("@wordpress/icons");
|
|
|
11
11
|
var _editor = require("@wordpress/editor");
|
|
12
12
|
var _coreData = require("@wordpress/core-data");
|
|
13
13
|
var _data = require("@wordpress/data");
|
|
14
|
+
var _store = require("../../store");
|
|
14
15
|
/**
|
|
15
16
|
* WordPress dependencies
|
|
16
17
|
*/
|
|
17
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Internal dependencies
|
|
21
|
+
*/
|
|
22
|
+
|
|
18
23
|
function ViewLink() {
|
|
19
24
|
const {
|
|
20
25
|
permalink,
|
|
21
26
|
isPublished,
|
|
22
|
-
label
|
|
27
|
+
label,
|
|
28
|
+
showIconLabels
|
|
23
29
|
} = (0, _data.useSelect)(select => {
|
|
24
30
|
// Grab post type to retrieve the view_item label.
|
|
25
31
|
const postTypeSlug = select(_editor.store).getCurrentPostType();
|
|
@@ -27,7 +33,8 @@ function ViewLink() {
|
|
|
27
33
|
return {
|
|
28
34
|
permalink: select(_editor.store).getPermalink(),
|
|
29
35
|
isPublished: select(_editor.store).isCurrentPostPublished(),
|
|
30
|
-
label: postType?.labels.view_item
|
|
36
|
+
label: postType?.labels.view_item,
|
|
37
|
+
showIconLabels: select(_store.store).isFeatureActive('showIconLabels')
|
|
31
38
|
};
|
|
32
39
|
}, []);
|
|
33
40
|
|
|
@@ -39,7 +46,8 @@ function ViewLink() {
|
|
|
39
46
|
icon: _icons.external,
|
|
40
47
|
label: label || (0, _i18n.__)('View post'),
|
|
41
48
|
href: permalink,
|
|
42
|
-
target: "_blank"
|
|
49
|
+
target: "_blank",
|
|
50
|
+
showTooltip: !showIconLabels
|
|
43
51
|
});
|
|
44
52
|
}
|
|
45
53
|
//# sourceMappingURL=index.js.map
|