@wordpress/edit-post 6.7.0 → 6.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/build/components/block-manager/category.js.map +1 -1
- package/build/components/block-manager/index.js +12 -4
- package/build/components/block-manager/index.js.map +1 -1
- package/build/components/device-preview/index.js.map +1 -1
- package/build/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build/components/header/header-toolbar/index.js.map +1 -1
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/mode-switcher/index.js.map +1 -1
- package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build/components/header/template-title/delete-template.js.map +1 -1
- package/build/components/header/template-title/edit-template-title.js +11 -2
- package/build/components/header/template-title/edit-template-title.js.map +1 -1
- package/build/components/header/template-title/index.js.map +1 -1
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +12 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +1 -3
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/actions-panel.js.map +1 -1
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/preferences-modal/index.js +3 -26
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
- package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
- package/build/components/preferences-modal/options/enable-publish-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build/components/sidebar/featured-image/index.js.map +1 -1
- package/build/components/sidebar/page-attributes/index.js.map +1 -1
- package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build/components/sidebar/plugin-post-status-info/index.js +2 -2
- package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar/post-excerpt/index.js.map +1 -1
- package/build/components/sidebar/post-format/index.js +3 -1
- package/build/components/sidebar/post-format/index.js.map +1 -1
- package/build/components/sidebar/post-schedule/index.js +28 -12
- package/build/components/sidebar/post-schedule/index.js.map +1 -1
- package/build/components/sidebar/post-slug/index.js +3 -1
- package/build/components/sidebar/post-slug/index.js.map +1 -1
- package/build/components/sidebar/post-status/index.js +6 -2
- package/build/components/sidebar/post-status/index.js.map +1 -1
- package/build/components/sidebar/post-template/create-modal.js +116 -0
- package/build/components/sidebar/post-template/create-modal.js.map +1 -0
- package/build/components/sidebar/post-template/form.js +123 -0
- package/build/components/sidebar/post-template/form.js.map +1 -0
- package/build/components/sidebar/post-template/index.js +124 -0
- package/build/components/sidebar/post-template/index.js.map +1 -0
- package/build/components/sidebar/post-url/index.js +68 -0
- package/build/components/sidebar/post-url/index.js.map +1 -0
- package/build/components/sidebar/post-visibility/index.js +21 -6
- package/build/components/sidebar/post-visibility/index.js.map +1 -1
- package/build/components/sidebar/settings-sidebar/index.js +2 -6
- package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build/components/start-page-options/index.js +31 -13
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/visual-editor/block-inspector-button.js +3 -7
- package/build/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build/components/visual-editor/index.js +4 -2
- package/build/components/visual-editor/index.js.map +1 -1
- package/build/editor.js +1 -1
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +1 -1
- package/build/editor.native.js.map +1 -1
- package/build/plugins/copy-content-menu-item/index.js +1 -1
- package/build/plugins/copy-content-menu-item/index.js.map +1 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +8 -8
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/block-manager/index.js +13 -5
- package/build-module/components/block-manager/index.js.map +1 -1
- package/build-module/components/device-preview/index.js.map +1 -1
- package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
- package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
- package/build-module/components/header/header-toolbar/index.js.map +1 -1
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/mode-switcher/index.js.map +1 -1
- package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
- package/build-module/components/header/template-title/delete-template.js.map +1 -1
- package/build-module/components/header/template-title/edit-template-title.js +12 -2
- package/build-module/components/header/template-title/edit-template-title.js.map +1 -1
- package/build-module/components/header/template-title/index.js.map +1 -1
- package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +12 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -2
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/actions-panel.js.map +1 -1
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +3 -25
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-publish-sidebar.js.map +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
- package/build-module/components/sidebar/featured-image/index.js.map +1 -1
- package/build-module/components/sidebar/page-attributes/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-post-status-info/index.js +2 -2
- package/build-module/components/sidebar/plugin-post-status-info/index.js.map +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/post-excerpt/index.js.map +1 -1
- package/build-module/components/sidebar/post-format/index.js +3 -1
- package/build-module/components/sidebar/post-format/index.js.map +1 -1
- package/build-module/components/sidebar/post-schedule/index.js +32 -13
- package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
- package/build-module/components/sidebar/post-slug/index.js +3 -1
- package/build-module/components/sidebar/post-slug/index.js.map +1 -1
- package/build-module/components/sidebar/post-status/index.js +4 -2
- package/build-module/components/sidebar/post-status/index.js.map +1 -1
- package/build-module/components/sidebar/post-template/create-modal.js +104 -0
- package/build-module/components/sidebar/post-template/create-modal.js.map +1 -0
- package/build-module/components/sidebar/post-template/form.js +106 -0
- package/build-module/components/sidebar/post-template/form.js.map +1 -0
- package/build-module/components/sidebar/post-template/index.js +110 -0
- package/build-module/components/sidebar/post-template/index.js.map +1 -0
- package/build-module/components/sidebar/post-url/index.js +59 -0
- package/build-module/components/sidebar/post-url/index.js.map +1 -0
- package/build-module/components/sidebar/post-visibility/index.js +24 -8
- package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
- package/build-module/components/sidebar/settings-sidebar/index.js +2 -4
- package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
- package/build-module/components/start-page-options/index.js +32 -14
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/visual-editor/block-inspector-button.js +3 -5
- package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/visual-editor/index.js +4 -2
- package/build-module/components/visual-editor/index.js.map +1 -1
- package/build-module/editor.js +2 -2
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +2 -2
- package/build-module/editor.native.js.map +1 -1
- package/build-module/plugins/copy-content-menu-item/index.js +1 -1
- package/build-module/plugins/copy-content-menu-item/index.js.map +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +8 -7
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +85 -87
- package/build-style/style.css +84 -90
- package/package.json +27 -27
- package/src/components/block-manager/category.js +2 -2
- package/src/components/block-manager/index.js +15 -4
- package/src/components/device-preview/index.js +4 -6
- package/src/components/editor-initialization/listener-hooks.js +2 -3
- package/src/components/header/fullscreen-mode-close/index.js +2 -3
- package/src/components/header/header-toolbar/index.js +6 -11
- package/src/components/header/index.js +6 -9
- package/src/components/header/mode-switcher/index.js +4 -4
- package/src/components/header/post-publish-button-or-toggle.js +4 -6
- package/src/components/header/template-title/delete-template.js +2 -3
- package/src/components/header/template-title/edit-template-title.js +11 -1
- package/src/components/header/template-title/index.js +2 -3
- package/src/components/header/tools-more-menu-group/index.js +2 -3
- package/src/components/keyboard-shortcut-help-modal/config.js +8 -0
- package/src/components/keyboard-shortcut-help-modal/index.js +1 -2
- package/src/components/keyboard-shortcut-help-modal/style.scss +0 -5
- package/src/components/keyboard-shortcut-help-modal/test/__snapshots__/index.js.snap +14 -0
- package/src/components/keyboard-shortcut-help-modal/test/index.js +2 -1
- package/src/components/keyboard-shortcuts/index.js +4 -8
- package/src/components/layout/actions-panel.js +6 -9
- package/src/components/layout/index.js +12 -21
- package/src/components/layout/index.native.js +4 -5
- package/src/components/preferences-modal/index.js +5 -23
- package/src/components/preferences-modal/options/enable-custom-fields.js +2 -2
- package/src/components/preferences-modal/options/enable-panel.js +2 -3
- package/src/components/preferences-modal/options/enable-publish-sidebar.js +2 -3
- package/src/components/preferences-modal/test/index.js +3 -3
- package/src/components/secondary-sidebar/inserter-sidebar.js +2 -3
- package/src/components/sidebar/discussion-panel/index.js +2 -3
- package/src/components/sidebar/featured-image/index.js +2 -3
- package/src/components/sidebar/page-attributes/index.js +2 -3
- package/src/components/sidebar/plugin-document-setting-panel/index.js +2 -3
- package/src/components/sidebar/plugin-post-status-info/index.js +2 -2
- package/src/components/sidebar/plugin-sidebar/index.js +2 -3
- package/src/components/sidebar/post-author/style.scss +4 -10
- package/src/components/sidebar/post-excerpt/index.js +2 -3
- package/src/components/sidebar/post-format/index.js +1 -1
- package/src/components/sidebar/post-format/style.scss +5 -0
- package/src/components/sidebar/post-schedule/index.js +27 -16
- package/src/components/sidebar/post-schedule/style.scss +17 -4
- package/src/components/sidebar/post-slug/index.js +1 -1
- package/src/components/sidebar/post-slug/style.scss +4 -3
- package/src/components/sidebar/post-status/index.js +8 -5
- package/src/components/sidebar/post-template/create-modal.js +146 -0
- package/src/components/sidebar/post-template/form.js +143 -0
- package/src/components/sidebar/post-template/index.js +102 -0
- package/src/components/sidebar/post-template/style.scss +36 -0
- package/src/components/sidebar/post-url/index.js +51 -0
- package/src/components/sidebar/post-url/style.scss +23 -0
- package/src/components/sidebar/post-visibility/index.js +22 -8
- package/src/components/sidebar/post-visibility/style.scss +5 -4
- package/src/components/sidebar/settings-sidebar/index.js +1 -5
- package/src/components/sidebar/template/style.scss +0 -8
- package/src/components/start-page-options/index.js +48 -28
- package/src/components/start-page-options/style.scss +0 -9
- package/src/components/visual-editor/block-inspector-button.js +4 -8
- package/src/components/visual-editor/index.js +2 -1
- package/src/editor.js +8 -10
- package/src/editor.native.js +5 -6
- package/src/plugins/copy-content-menu-item/index.js +1 -1
- package/src/store/actions.js +322 -295
- package/src/store/selectors.js +21 -24
- package/src/style.scss +3 -2
- package/build/components/sidebar/post-link/index.js +0 -182
- package/build/components/sidebar/post-link/index.js.map +0 -1
- package/build/components/sidebar/template/actions.js +0 -167
- package/build/components/sidebar/template/actions.js.map +0 -1
- package/build/components/sidebar/template/index.js +0 -164
- package/build/components/sidebar/template/index.js.map +0 -1
- package/build-module/components/sidebar/post-link/index.js +0 -165
- package/build-module/components/sidebar/post-link/index.js.map +0 -1
- package/build-module/components/sidebar/template/actions.js +0 -153
- package/build-module/components/sidebar/template/actions.js.map +0 -1
- package/build-module/components/sidebar/template/index.js +0 -145
- package/build-module/components/sidebar/template/index.js.map +0 -1
- package/src/components/sidebar/post-link/index.js +0 -180
- package/src/components/sidebar/post-link/style.scss +0 -20
- package/src/components/sidebar/template/actions.js +0 -203
- package/src/components/sidebar/template/index.js +0 -164
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -268,7 +268,7 @@ _Returns_
|
|
|
268
268
|
|
|
269
269
|
### PluginPostStatusInfo
|
|
270
270
|
|
|
271
|
-
Renders a row in the
|
|
271
|
+
Renders a row in the Summary panel of the Document sidebar.
|
|
272
272
|
It should be noted that this is named and implemented around the function it serves
|
|
273
273
|
and not its location, which may change in future iterations.
|
|
274
274
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/block-manager/category.js"],"names":["BlockManagerCategory","title","blockTypes","instanceId","defaultAllowedBlockTypes","hiddenBlockTypes","select","getEditorSettings","editorStore","getHiddenBlockTypes","editPostStore","filteredBlockTypes","filter","name","showBlockTypes","hideBlockTypes","toggleVisible","blockName","nextIsChecked","toggleAllVisible","blockNames","length","checkedBlockNames","titleId","isAllChecked","ariaChecked"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;AAIA,SAASA,oBAAT,OAAuD;AAAA,MAAxB;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAwB;AACtD,QAAMC,UAAU,GAAG,4BAAeH,oBAAf,CAAnB;AACA,QAAM;AAAEI,IAAAA,wBAAF;AAA4BC,IAAAA;AAA5B,MAAiD,qBACpDC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAwBD,MAAM,CAAEE,aAAF,CAApC;AACA,UAAM;AAAEC,MAAAA;AAAF,QAA0BH,MAAM,CAAEI,YAAF,CAAtC;AACA,WAAO;AACNN,MAAAA,wBAAwB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/block-manager/category.js"],"names":["BlockManagerCategory","title","blockTypes","instanceId","defaultAllowedBlockTypes","hiddenBlockTypes","select","getEditorSettings","editorStore","getHiddenBlockTypes","editPostStore","filteredBlockTypes","filter","name","showBlockTypes","hideBlockTypes","toggleVisible","blockName","nextIsChecked","toggleAllVisible","blockNames","length","checkedBlockNames","titleId","isAllChecked","ariaChecked"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;AAIA,SAASA,oBAAT,OAAuD;AAAA,MAAxB;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAwB;AACtD,QAAMC,UAAU,GAAG,4BAAeH,oBAAf,CAAnB;AACA,QAAM;AAAEI,IAAAA,wBAAF;AAA4BC,IAAAA;AAA5B,MAAiD,qBACpDC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAwBD,MAAM,CAAEE,aAAF,CAApC;AACA,UAAM;AAAEC,MAAAA;AAAF,QAA0BH,MAAM,CAAEI,YAAF,CAAtC;AACA,WAAO;AACNN,MAAAA,wBAAwB,EACvBG,iBAAiB,GAAGH,wBAFf;AAGNC,MAAAA,gBAAgB,EAAEI,mBAAmB;AAH/B,KAAP;AAKA,GATqD,EAUtD,EAVsD,CAAvD;AAYA,QAAME,kBAAkB,GAAG,sBAAS,MAAM;AACzC,QAAKP,wBAAwB,KAAK,IAAlC,EAAyC;AACxC,aAAOF,UAAP;AACA;;AACD,WAAOA,UAAU,CAACU,MAAX,CAAmB,SAAgB;AAAA,UAAd;AAAEC,QAAAA;AAAF,OAAc;AACzC,aAAO,sBAAUT,wBAAwB,IAAI,EAAtC,EAA0CS,IAA1C,CAAP;AACA,KAFM,CAAP;AAGA,GAP0B,EAOxB,CAAET,wBAAF,EAA4BF,UAA5B,CAPwB,CAA3B;AAQA,QAAM;AAAEY,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAAqC,uBAAaL,YAAb,CAA3C;AACA,QAAMM,aAAa,G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M,WAJhB;AAKC,IAAA,KAAK,EAAG;AAAM,MAAA,EAAE,EAAGF;AAAX,OAAuBtB,KAAvB;AALT,IALD,EAYC,4BAAC,kBAAD;AACC,IAAA,UAAU,EAAGU,kBADd;AAEC,IAAA,KAAK,EAAGW,iBAFT;AAGC,IAAA,YAAY,EAAGN;AAHhB,IAZD,CADD;AAoBA;;eAEchB,oB","sourcesContent":["/**\n * External dependencies\n */\nimport { includes, map, without } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { CheckboxControl } from '@wordpress/components';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport BlockTypesChecklist from './checklist';\nimport { store as editPostStore } from '../../store';\n\nfunction BlockManagerCategory( { title, blockTypes } ) {\n\tconst instanceId = useInstanceId( BlockManagerCategory );\n\tconst { defaultAllowedBlockTypes, hiddenBlockTypes } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getHiddenBlockTypes } = select( editPostStore );\n\t\t\treturn {\n\t\t\t\tdefaultAllowedBlockTypes:\n\t\t\t\t\tgetEditorSettings().defaultAllowedBlockTypes,\n\t\t\t\thiddenBlockTypes: getHiddenBlockTypes(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst filteredBlockTypes = useMemo( () => {\n\t\tif ( defaultAllowedBlockTypes === true ) {\n\t\t\treturn blockTypes;\n\t\t}\n\t\treturn blockTypes.filter( ( { name } ) => {\n\t\t\treturn includes( defaultAllowedBlockTypes || [], name );\n\t\t} );\n\t}, [ defaultAllowedBlockTypes, blockTypes ] );\n\tconst { showBlockTypes, hideBlockTypes } = useDispatch( editPostStore );\n\tconst toggleVisible = useCallback( ( blockName, nextIsChecked ) => {\n\t\tif ( nextIsChecked ) {\n\t\t\tshowBlockTypes( blockName );\n\t\t} else {\n\t\t\thideBlockTypes( blockName );\n\t\t}\n\t}, [] );\n\tconst toggleAllVisible = useCallback(\n\t\t( nextIsChecked ) => {\n\t\t\tconst blockNames = map( blockTypes, 'name' );\n\t\t\tif ( nextIsChecked ) {\n\t\t\t\tshowBlockTypes( blockNames );\n\t\t\t} else {\n\t\t\t\thideBlockTypes( blockNames );\n\t\t\t}\n\t\t},\n\t\t[ blockTypes ]\n\t);\n\n\tif ( ! filteredBlockTypes.length ) {\n\t\treturn null;\n\t}\n\n\tconst checkedBlockNames = without(\n\t\tmap( filteredBlockTypes, 'name' ),\n\t\t...hiddenBlockTypes\n\t);\n\n\tconst titleId = 'edit-post-block-manager__category-title-' + instanceId;\n\n\tconst isAllChecked = checkedBlockNames.length === filteredBlockTypes.length;\n\n\tlet ariaChecked;\n\tif ( isAllChecked ) {\n\t\tariaChecked = 'true';\n\t} else if ( checkedBlockNames.length > 0 ) {\n\t\tariaChecked = 'mixed';\n\t} else {\n\t\tariaChecked = 'false';\n\t}\n\n\treturn (\n\t\t<div\n\t\t\trole=\"group\"\n\t\t\taria-labelledby={ titleId }\n\t\t\tclassName=\"edit-post-block-manager__category\"\n\t\t>\n\t\t\t<CheckboxControl\n\t\t\t\tchecked={ isAllChecked }\n\t\t\t\tonChange={ toggleAllVisible }\n\t\t\t\tclassName=\"edit-post-block-manager__category-title\"\n\t\t\t\taria-checked={ ariaChecked }\n\t\t\t\tlabel={ <span id={ titleId }>{ title }</span> }\n\t\t\t/>\n\t\t\t<BlockTypesChecklist\n\t\t\t\tblockTypes={ filteredBlockTypes }\n\t\t\t\tvalue={ checkedBlockNames }\n\t\t\t\tonItemChange={ toggleVisible }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport default BlockManagerCategory;\n"]}
|
|
@@ -109,11 +109,19 @@ var _default = (0, _data.withSelect)(select => {
|
|
|
109
109
|
} = select(_blocks.store);
|
|
110
110
|
const {
|
|
111
111
|
getHiddenBlockTypes
|
|
112
|
-
} = select(_store.store);
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
} = select(_store.store); // Some hidden blocks become unregistered
|
|
113
|
+
// by removing for instance the plugin that registered them, yet
|
|
114
|
+
// they're still remain as hidden by the user's action.
|
|
115
|
+
// We consider "hidden", blocks which were hidden and
|
|
116
|
+
// are still registered.
|
|
117
|
+
|
|
118
|
+
const blockTypes = getBlockTypes();
|
|
119
|
+
const hiddenBlockTypes = getHiddenBlockTypes().filter(hiddenBlock => {
|
|
120
|
+
return blockTypes.some(registeredBlock => registeredBlock.name === hiddenBlock);
|
|
121
|
+
});
|
|
122
|
+
const numberOfHiddenBlocks = Array.isArray(hiddenBlockTypes) && hiddenBlockTypes.length;
|
|
115
123
|
return {
|
|
116
|
-
blockTypes
|
|
124
|
+
blockTypes,
|
|
117
125
|
categories: getCategories(),
|
|
118
126
|
hasBlockSupport,
|
|
119
127
|
isMatchingSearchTerm,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/block-manager/index.js"],"names":["BlockManager","blockTypes","categories","hasBlockSupport","isMatchingSearchTerm","numberOfHiddenBlocks","debouncedSpeak","speak","search","setSearch","filter","blockType","parent","count","length","resultsFoundMessage","nextSearch","map","category","slug","title","select","getBlockTypes","getCategories","blocksStore","getHiddenBlockTypes","editPostStore","hiddenBlockTypes"],"mappings":";;;;;;;;;AAYA;;AATA;;AAKA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAKA;;AACA;;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AAIA,SAASA,YAAT,OAMI;AAAA,MANmB;AACtBC,IAAAA,UADsB;AAEtBC,IAAAA,UAFsB;AAGtBC,IAAAA,eAHsB;AAItBC,IAAAA,oBAJsB;AAKtBC,IAAAA;AALsB,GAMnB;AACH,QAAMC,cAAc,GAAG,0BAAaC,WAAb,EAAoB,GAApB,CAAvB;AACA,QAAM,CAAEC,MAAF,EAAUC,SAAV,IAAwB,uBAAU,EAAV,CAA9B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a,MAAX,KAAsB,CAAtB,IACD;AAAG,IAAA,SAAS,EAAC;AAAb,KACG,cAAI,kBAAJ,CADH,CAPF,EAWGZ,UAAU,CAACe,GAAX,CAAkBC,QAAF,IACjB,4BAAC,iBAAD;AACC,IAAA,GAAG,EAAGA,QAAQ,CAACC,IADhB;AAEC,IAAA,KAAK,EAAGD,QAAQ,CAACE,KAFlB;AAGC,IAAA,UAAU,EAAG,oBAAQnB,UAAR,EAAoB;AAChCiB,MAAAA,QAAQ,EAAEA,QAAQ,CAACC;AADa,KAApB;AAHd,IADC,CAXH,EAoBC,4BAAC,iBAAD;AACC,IAAA,KAAK,EAAG,cAAI,eAAJ,CADT;AAEC,IAAA,UAAU,EAAG,oBACZlB,UADY,EAEZ;AAAA,UAAE;AAAEiB,QAAAA;AAAF,OAAF;AAAA,aAAoB,CAAEA,QAAtB;AAAA,KAFY;AAFd,IApBD,CArBD,CADD;AAoDA;;eAEc,sBAAcG,MAAF,IAAc;AACxC,QAAM;AACLC,IAAAA,aADK;AAELC,IAAAA,aAFK;AAGLpB,IAAAA,eAHK;AAILC,IAAAA;AAJK,MAKFiB,MAAM,CAAEG,aAAF,CALV;AAMA,QAAM;AAAEC,IAAAA;AAAF,MAA0BJ,MAAM,CAAEK,YAAF,CAAtC;AACA,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/block-manager/index.js"],"names":["BlockManager","blockTypes","categories","hasBlockSupport","isMatchingSearchTerm","numberOfHiddenBlocks","debouncedSpeak","speak","search","setSearch","filter","blockType","parent","count","length","resultsFoundMessage","nextSearch","map","category","slug","title","select","getBlockTypes","getCategories","blocksStore","getHiddenBlockTypes","editPostStore","hiddenBlockTypes","hiddenBlock","some","registeredBlock","name","Array","isArray"],"mappings":";;;;;;;;;AAYA;;AATA;;AAKA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAKA;;AACA;;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AAIA,SAASA,YAAT,OAMI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C,eAAF,IAAuBA,eAAe,CAACC,IAAhB,KAAyBH,WAD1C,CAAP;AAGA,GAJwB,CAAzB;AAKA,QAAMvB,oBAAoB,GACzB2B,KAAK,CAACC,OAAN,CAAeN,gBAAf,KAAqCA,gBAAgB,CAACb,MADvD;AAGA,SAAO;AACNb,IAAAA,UADM;AAENC,IAAAA,UAAU,EAAEqB,aAAa,EAFnB;AAGNpB,IAAAA,eAHM;AAINC,IAAAA,oBAJM;AAKNC,IAAAA;AALM,GAAP;AAOA,CA9Bc,EA8BVL,YA9BU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { filter, includes } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { withSelect } from '@wordpress/data';\nimport { SearchControl } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEffect, useState } from '@wordpress/element';\nimport { useDebounce } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport BlockManagerCategory from './category';\nimport { store as editPostStore } from '../../store';\n\nfunction BlockManager( {\n\tblockTypes,\n\tcategories,\n\thasBlockSupport,\n\tisMatchingSearchTerm,\n\tnumberOfHiddenBlocks,\n} ) {\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst [ search, setSearch ] = useState( '' );\n\n\t// Filtering occurs here (as opposed to `withSelect`) to avoid\n\t// wasted renders by consequence of `Array#filter` producing\n\t// a new value reference on each call.\n\tblockTypes = blockTypes.filter(\n\t\t( blockType ) =>\n\t\t\thasBlockSupport( blockType, 'inserter', true ) &&\n\t\t\t( ! search || isMatchingSearchTerm( blockType, search ) ) &&\n\t\t\t( ! blockType.parent ||\n\t\t\t\tincludes( blockType.parent, 'core/post-content' ) )\n\t);\n\n\t// Announce search results on change\n\tuseEffect( () => {\n\t\tif ( ! search ) {\n\t\t\treturn;\n\t\t}\n\t\tconst count = blockTypes.length;\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results. */\n\t\t\t_n( '%d result found.', '%d results found.', count ),\n\t\t\tcount\n\t\t);\n\t\tdebouncedSpeak( resultsFoundMessage );\n\t}, [ blockTypes.length, search, debouncedSpeak ] );\n\n\treturn (\n\t\t<div className=\"edit-post-block-manager__content\">\n\t\t\t{ !! numberOfHiddenBlocks && (\n\t\t\t\t<div className=\"edit-post-block-manager__disabled-blocks-count\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %d: number of blocks. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'%d block is hidden.',\n\t\t\t\t\t\t\t'%d blocks are hidden.',\n\t\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<SearchControl\n\t\t\t\tlabel={ __( 'Search for a block' ) }\n\t\t\t\tplaceholder={ __( 'Search for a block' ) }\n\t\t\t\tvalue={ search }\n\t\t\t\tonChange={ ( nextSearch ) => setSearch( nextSearch ) }\n\t\t\t\tclassName=\"edit-post-block-manager__search\"\n\t\t\t/>\n\t\t\t<div\n\t\t\t\ttabIndex=\"0\"\n\t\t\t\trole=\"region\"\n\t\t\t\taria-label={ __( 'Available block types' ) }\n\t\t\t\tclassName=\"edit-post-block-manager__results\"\n\t\t\t>\n\t\t\t\t{ blockTypes.length === 0 && (\n\t\t\t\t\t<p className=\"edit-post-block-manager__no-results\">\n\t\t\t\t\t\t{ __( 'No blocks found.' ) }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t\t{ categories.map( ( category ) => (\n\t\t\t\t\t<BlockManagerCategory\n\t\t\t\t\t\tkey={ category.slug }\n\t\t\t\t\t\ttitle={ category.title }\n\t\t\t\t\t\tblockTypes={ filter( blockTypes, {\n\t\t\t\t\t\t\tcategory: category.slug,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t\t<BlockManagerCategory\n\t\t\t\t\ttitle={ __( 'Uncategorized' ) }\n\t\t\t\t\tblockTypes={ filter(\n\t\t\t\t\t\tblockTypes,\n\t\t\t\t\t\t( { category } ) => ! category\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\tconst {\n\t\tgetBlockTypes,\n\t\tgetCategories,\n\t\thasBlockSupport,\n\t\tisMatchingSearchTerm,\n\t} = select( blocksStore );\n\tconst { getHiddenBlockTypes } = select( editPostStore );\n\n\t// Some hidden blocks become unregistered\n\t// by removing for instance the plugin that registered them, yet\n\t// they're still remain as hidden by the user's action.\n\t// We consider \"hidden\", blocks which were hidden and\n\t// are still registered.\n\tconst blockTypes = getBlockTypes();\n\tconst hiddenBlockTypes = getHiddenBlockTypes().filter( ( hiddenBlock ) => {\n\t\treturn blockTypes.some(\n\t\t\t( registeredBlock ) => registeredBlock.name === hiddenBlock\n\t\t);\n\t} );\n\tconst numberOfHiddenBlocks =\n\t\tArray.isArray( hiddenBlockTypes ) && hiddenBlockTypes.length;\n\n\treturn {\n\t\tblockTypes,\n\t\tcategories: getCategories(),\n\t\thasBlockSupport,\n\t\tisMatchingSearchTerm,\n\t\tnumberOfHiddenBlocks,\n\t};\n} )( BlockManager );\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/device-preview/index.js"],"names":["DevicePreview","hasActiveMetaboxes","isPostSaveable","isSaving","isViewable","deviceType","select","getEditedPostAttribute","editorStore","getPostType","coreStore","postType","editPostStore","hasMetaBoxes","isSavingMetaBoxes","isEditedPostSaveable","__experimentalGetPreviewDeviceType","__experimentalSetPreviewDeviceType","setPreviewDeviceType","undefined","external"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AAGe,SAASA,aAAT,GAAyB;AACvC,QAAM;AACLC,IAAAA,kBADK;AAELC,IAAAA,cAFK;AAGLC,IAAAA,QAHK;AAILC,IAAAA,UAJK;AAKLC,IAAAA;AALK,MAMF,qBAAaC,MAAF,IAAc;AAC5B,UAAM;AAAEC,MAAAA;AAAF,QAA6BD,MAAM,CAAEE,aAAF,CAAzC;AACA,UAAM;AAAEC,MAAAA;AAAF,QAAkBH,MAAM,CAAEI,eAAF,CAA9B;AACA,UAAMC,QAAQ,GAAGF,WAAW,CAAEF,sBAAsB,CAAE,MAAF,CAAxB,CAA5B;AAEA,WAAO;AACNN,MAAAA,kBAAkB,EAAEK,MAAM,CAAEM,YAAF,CAAN,CAAwBC,YAAxB,EADd;AAENV,MAAAA,QAAQ,EAAEG,MAAM,CAAEM,YAAF,CAAN,CAAwBE,iBAAxB,EAFJ;AAGNZ,MAAAA,cAAc,EAAEI,MAAM,CAAEE,aAAF,CAAN,CAAsBO,oBAAtB,EAHV;AAINX,MAAAA,UAAU,EAAE,iBAAKO,QAAL,EAAe,CAAE,UAAF,CAAf,EAA+B,KAA/B,CAJN;AAKNN,MAAAA,UAAU,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/device-preview/index.js"],"names":["DevicePreview","hasActiveMetaboxes","isPostSaveable","isSaving","isViewable","deviceType","select","getEditedPostAttribute","editorStore","getPostType","coreStore","postType","editPostStore","hasMetaBoxes","isSavingMetaBoxes","isEditedPostSaveable","__experimentalGetPreviewDeviceType","__experimentalSetPreviewDeviceType","setPreviewDeviceType","undefined","external"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AAGe,SAASA,aAAT,GAAyB;AACvC,QAAM;AACLC,IAAAA,kBADK;AAELC,IAAAA,cAFK;AAGLC,IAAAA,QAHK;AAILC,IAAAA,UAJK;AAKLC,IAAA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AGC;AAAb,MAFD;AARF,IADD,CADD,CAPF,CADD;AA6BA","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\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\tisSaving,\n\t\tisViewable,\n\t\tdeviceType,\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\tisSaving: select( editPostStore ).isSavingMetaBoxes(),\n\t\t\tisPostSaveable: select( editorStore ).isEditedPostSaveable(),\n\t\t\tisViewable: get( postType, [ 'viewable' ], false ),\n\t\t\tdeviceType:\n\t\t\t\tselect( editPostStore ).__experimentalGetPreviewDeviceType(),\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>\n\t\t\t{ isViewable && (\n\t\t\t\t<MenuGroup>\n\t\t\t\t\t<div className=\"edit-post-header-preview__grouping-external\">\n\t\t\t\t\t\t<PostPreviewButton\n\t\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\t\t'edit-post-header-preview__button-external'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\tforceIsAutosaveable={ hasActiveMetaboxes }\n\t\t\t\t\t\t\tforcePreviewLink={ isSaving ? null : undefined }\n\t\t\t\t\t\t\ttextContent={\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ __( 'Preview in new tab' ) }\n\t\t\t\t\t\t\t\t\t<Icon icon={ external } />\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</div>\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\t\t</PreviewOptions>\n\t);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/editor-initialization/listener-hooks.js"],"names":["useBlockSelectionListener","postId","hasBlockSelection","isEditorSidebarOpened","select","blockEditorStore","getBlockSelectionStart","STORE_NAME","openGeneralSidebar","useUpdatePostLinkListener","newPermalink","editorStore","getCurrentPost","link","nodeToUpdate","current","document","querySelector","VIEW_AS_PREVIEW_LINK_SELECTOR","VIEW_AS_LINK_SELECTOR","setAttribute"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,yBAAyB,GAAKC,MAAF,IAAc;AACtD,QAAM;AAAEC,IAAAA,iBAAF;AAAqBC,IAAAA;AAArB,MAA+C,qBAClDC,MAAF,KAAgB;AACfF,IAAAA,iBAAiB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/editor-initialization/listener-hooks.js"],"names":["useBlockSelectionListener","postId","hasBlockSelection","isEditorSidebarOpened","select","blockEditorStore","getBlockSelectionStart","STORE_NAME","openGeneralSidebar","useUpdatePostLinkListener","newPermalink","editorStore","getCurrentPost","link","nodeToUpdate","current","document","querySelector","VIEW_AS_PREVIEW_LINK_SELECTOR","VIEW_AS_LINK_SELECTOR","setAttribute"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,yBAAyB,GAAKC,MAAF,IAAc;AACtD,QAAM;AAAEC,IAAAA,iBAAF;AAAqBC,IAAAA;AAArB,MAA+C,qBAClDC,MAAF,KAAgB;AACfF,IAAAA,iBAAiB,EAChB,CAAC,CAAEE,MAAM,CAAEC,kBAAF,CAAN,CAA2BC,sBAA3B,EAFW;AAGfH,IAAAA,qBAAqB,EAAEC,MAAM,CAAEG,qBAAF,CAAN,CAAqBJ,qBAArB;AAHR,GAAhB,CADoD,EAMpD,CAAEF,MAAF,CANoD,CAArD;AASA,QAAM;AAAEO,IAAAA;AAAF,MAAyB,uBAAaD,qBAAb,CAA/B;AAEA,0BAAW,MAAM;AAChB,QAAK,CAAEJ,qBAAP,EAA+B;AAC9B;AACA;;AACD,QAAKD,iBAAL,EAAyB;AACxBM,MAAAA,kBAAkB,CAAE,iBAAF,CAAlB;AACA,KAFD,MAEO;AACNA,MAAAA,kBAAkB,CAAE,oBAAF,CAAlB;AACA;AACD,GATD,EASG,CAAEN,iBAAF,EAAqBC,qBAArB,CATH;AAUA,CAtBM;AAwBP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMM,yBAAyB,GAAKR,MAAF,IAAc;AACtD,QAAM;AAAES,IAAAA;AAAF,MAAmB,qBACtBN,MAAF,KAAgB;AACfM,IAAAA,YAAY,EAAEN,MAAM,CAAEO,aAAF,CAAN,CAAsBC,cAAtB,GAAuCC;AADtC,GAAhB,CADwB,EAIxB,CAAEZ,MAAF,CAJwB,CAAzB;AAMA,QAAMa,YAAY,GAAG,sBAArB;AAEA,0BAAW,MAAM;AAChBA,IAAAA,YAAY,CAACC,OAAb,GACCC,QAAQ,CAACC,aAAT,CAAwBC,wCAAxB,KACAF,QAAQ,CAACC,aAAT,CAAwBE,gCAAxB,CAFD;AAGA,GAJD,EAIG,CAAElB,MAAF,CAJH;AAMA,0BAAW,MAAM;AAChB,QAAK,CAAES,YAAF,IAAkB,CAAEI,YAAY,CAACC,OAAtC,EAAgD;AAC/C;AACA;;AACDD,IAAAA,YAAY,CAACC,OAAb,CAAqBK,YAArB,CAAmC,MAAnC,EAA2CV,YAA3C;AACA,GALD,EAKG,CAAEA,YAAF,CALH;AAMA,CArBM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport {\n\tSTORE_NAME,\n\tVIEW_AS_LINK_SELECTOR,\n\tVIEW_AS_PREVIEW_LINK_SELECTOR,\n} from '../../store/constants';\n\n/**\n * This listener hook monitors for block selection and triggers the appropriate\n * sidebar state.\n *\n * @param {number} postId The current post id.\n */\nexport const useBlockSelectionListener = ( postId ) => {\n\tconst { hasBlockSelection, isEditorSidebarOpened } = useSelect(\n\t\t( select ) => ( {\n\t\t\thasBlockSelection:\n\t\t\t\t!! select( blockEditorStore ).getBlockSelectionStart(),\n\t\t\tisEditorSidebarOpened: select( STORE_NAME ).isEditorSidebarOpened(),\n\t\t} ),\n\t\t[ postId ]\n\t);\n\n\tconst { openGeneralSidebar } = useDispatch( STORE_NAME );\n\n\tuseEffect( () => {\n\t\tif ( ! isEditorSidebarOpened ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( hasBlockSelection ) {\n\t\t\topenGeneralSidebar( 'edit-post/block' );\n\t\t} else {\n\t\t\topenGeneralSidebar( 'edit-post/document' );\n\t\t}\n\t}, [ hasBlockSelection, isEditorSidebarOpened ] );\n};\n\n/**\n * This listener hook monitors any change in permalink and updates the view\n * post link in the admin bar.\n *\n * @param {number} postId\n */\nexport const useUpdatePostLinkListener = ( postId ) => {\n\tconst { newPermalink } = useSelect(\n\t\t( select ) => ( {\n\t\t\tnewPermalink: select( editorStore ).getCurrentPost().link,\n\t\t} ),\n\t\t[ postId ]\n\t);\n\tconst nodeToUpdate = useRef();\n\n\tuseEffect( () => {\n\t\tnodeToUpdate.current =\n\t\t\tdocument.querySelector( VIEW_AS_PREVIEW_LINK_SELECTOR ) ||\n\t\t\tdocument.querySelector( VIEW_AS_LINK_SELECTOR );\n\t}, [ postId ] );\n\n\tuseEffect( () => {\n\t\tif ( ! newPermalink || ! nodeToUpdate.current ) {\n\t\t\treturn;\n\t\t}\n\t\tnodeToUpdate.current.setAttribute( 'href', newPermalink );\n\t}, [ newPermalink ] );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/fullscreen-mode-close/index.js"],"names":["FullscreenModeClose","showTooltip","icon","href","isActive","isRequestingSiteIcon","postType","siteIconUrl","select","getCurrentPostType","editorStore","isFeatureActive","editPostStore","getEntityRecord","getPostType","isResolving","coreStore","siteData","undefined","site_icon_url","disableMotion","buttonIcon","wordpress","effect","expand","scale","transition","type","duration","classes","post_type","slug"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAzBA;AACA;AACA;;AAIA;AACA;AACA;;AAcA;AACA;AACA;AAGA,SAASA,mBAAT,OAA4D;AAAA,MAA9B;AAAEC,IAAAA,WAAF;AAAeC,IAAAA,IAAf;AAAqBC,IAAAA;AAArB,GAA8B;AAC3D,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,oBAAZ;AAAkCC,IAAAA,QAAlC;AAA4CC,IAAAA;AAA5C,MAA4D,qBAC/DC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAyBD,MAAM,CAAEE,aAAF,CAArC;AACA,UAAM;AAAEC,MAAAA;AAAF,QAAsBH,MAAM,CAAEI,YAAF,CAAlC;AACA,UAAM;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA,WAAnB;AAAgCC,MAAAA;AAAhC,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/fullscreen-mode-close/index.js"],"names":["FullscreenModeClose","showTooltip","icon","href","isActive","isRequestingSiteIcon","postType","siteIconUrl","select","getCurrentPostType","editorStore","isFeatureActive","editPostStore","getEntityRecord","getPostType","isResolving","coreStore","siteData","undefined","site_icon_url","disableMotion","buttonIcon","wordpress","effect","expand","scale","transition","type","duration","classes","post_type","slug"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAzBA;AACA;AACA;;AAIA;AACA;AACA;;AAcA;AACA;AACA;AAGA,SAASA,mBAAT,OAA4D;AAAA,MAA9B;AAAEC,IAAAA,WAAF;AAAeC,IAAAA,IAAf;AAAqBC,IAAAA;AAArB,GAA8B;AAC3D,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,oBAAZ;AAAkCC,IAAAA,QAAlC;AAA4CC,IAAAA;AAA5C,MAA4D,qBAC/DC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA;AAAF,QAAyBD,MAAM,CAAEE,aAAF,CAArC;AACA,UAAM;AAAEC,MAAAA;AAAF,QAAsBH,MAAM,CAAEI,YAAF,CAAlC;AACA,UAAM;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA,WAAnB;AAAgCC,MAAAA;AAAhC,QACLP,MAAM,CAAEQ,eAAF,CADP;AAEA,UAAMC,QAAQ,GACbJ,eAAe,CAAE,MAAF,EAAU,gBAAV,EAA4BK,SAA5B,CAAf,IAA0D,EAD3D;AAGA,WAAO;AACNd,MAAAA,QAAQ,EAAEO,eAAe,CAAE,gBAAF,CADnB;AAENN,MAAAA,oBAAoB,EAAEU,WAAW,CAAE,iBAAF,EAAqB,CACrD,MADqD,EAErD,gBA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AAC;AAAvB,KACC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAGsB,OADb;AAEC,IAAA,IAAI,EACH1B,IADG,aACHA,IADG,cACHA,IADG,GAEH,uBAAc,UAAd,EAA0B;AACzB2B,MAAAA,SAAS,EAAExB,QAAQ,CAACyB;AADK,KAA1B,CAJF;AAQC,IAAA,KAAK,EAAG,iBACPzB,QADO,EAEP,CAAE,QAAF,EAAY,YAAZ,CAFO,EAGP,cAAI,MAAJ,CAHO,CART;AAaC,IAAA,WAAW,EAAGL;AAbf,KAeGoB,UAfH,CADD,CADD;AAqBA;;eAEcrB,mB","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction FullscreenModeClose( { showTooltip, icon, href } ) {\n\tconst { isActive, isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { isFeatureActive } = select( editPostStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\t\treturn {\n\t\t\t\tisActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( getCurrentPostType() ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\n\tif ( ! isActive || ! postType ) {\n\t\treturn null;\n\t}\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.25,\n\t\t\ttransition: { type: 'tween', duration: '0.3' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close_site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tif ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\tconst classes = classnames( {\n\t\t'edit-post-fullscreen-mode-close': true,\n\t\t'has-icon': siteIconUrl,\n\t} );\n\n\treturn (\n\t\t<motion.div whileHover=\"expand\">\n\t\t\t<Button\n\t\t\t\tclassName={ classes }\n\t\t\t\thref={\n\t\t\t\t\thref ??\n\t\t\t\t\taddQueryArgs( 'edit.php', {\n\t\t\t\t\t\tpost_type: postType.slug,\n\t\t\t\t\t} )\n\t\t\t\t}\n\t\t\t\tlabel={ get(\n\t\t\t\t\tpostType,\n\t\t\t\t\t[ 'labels', 'view_items' ],\n\t\t\t\t\t__( 'Back' )\n\t\t\t\t) }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default FullscreenModeClose;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.js"],"names":["preventDefault","event","HeaderToolbar","inserterButton","setIsInserterOpened","setIsListViewOpened","editPostStore","isInserterEnabled","isInserterOpened","isTextModeEnabled","showIconLabels","isListViewOpen","listViewShortcut","select","hasInserterItems","getBlockRootClientId","getBlockSelectionEnd","blockEditorStore","getEditorSettings","editorStore","getEditorMode","isFeatureActive","isListViewOpened","getShortcutRepresentation","keyboardShortcutsStore","richEditingEnabled","isLargeViewport","isWideViewport","toolbarAriaLabel","toggleListView","overflowItems","TableOfContents","undefined","Button","listView","openInserter","current","focus","plus","ToolSelector","EditorHistoryUndo","EditorHistoryRedo"],"mappings":";;;;;;;AAmBA;;AAhBA;;AACA;;AACA;;AACA;;AAKA;;AAMA;;AACA;;AAEA;;AAKA;;AAzBA;AACA;AACA;;AAoBA;AACA;AACA;AAGA,MAAMA,cAAc,GAAKC,KAAF,IAAa;AACnCA,EAAAA,KAAK,CAACD,cAAN;AACA,CAFD;;AAIA,SAASE,aAAT,GAAyB;AACxB,QAAMC,cAAc,GAAG,sBAAvB;AACA,QAAM;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA;AAAvB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/header-toolbar/index.js"],"names":["preventDefault","event","HeaderToolbar","inserterButton","setIsInserterOpened","setIsListViewOpened","editPostStore","isInserterEnabled","isInserterOpened","isTextModeEnabled","showIconLabels","isListViewOpen","listViewShortcut","select","hasInserterItems","getBlockRootClientId","getBlockSelectionEnd","blockEditorStore","getEditorSettings","editorStore","getEditorMode","isFeatureActive","isListViewOpened","getShortcutRepresentation","keyboardShortcutsStore","richEditingEnabled","isLargeViewport","isWideViewport","toolbarAriaLabel","toggleListView","overflowItems","TableOfContents","undefined","Button","listView","openInserter","current","focus","plus","ToolSelector","EditorHistoryUndo","EditorHistoryRedo"],"mappings":";;;;;;;AAmBA;;AAhBA;;AACA;;AACA;;AACA;;AAKA;;AAMA;;AACA;;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Match } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tNavigableToolbar,\n\tToolSelector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tTableOfContents,\n\tEditorHistoryRedo,\n\tEditorHistoryUndo,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useRef, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nconst preventDefault = ( event ) => {\n\tevent.preventDefault();\n};\n\nfunction HeaderToolbar() {\n\tconst inserterButton = useRef();\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editPostStore );\n\tconst {\n\t\tisInserterEnabled,\n\t\tisInserterOpened,\n\t\tisTextModeEnabled,\n\t\tshowIconLabels,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t} = useSelect( ( select ) => {\n\t\tconst { hasInserterItems, getBlockRootClientId, getBlockSelectionEnd } =\n\t\t\tselect( blockEditorStore );\n\t\tconst { getEditorSettings } = select( editorStore );\n\t\tconst { getEditorMode, isFeatureActive, isListViewOpened } =\n\t\t\tselect( editPostStore );\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\n\t\treturn {\n\t\t\t// This setting (richEditingEnabled) should not live in the block editor's setting.\n\t\t\tisInserterEnabled:\n\t\t\t\tgetEditorMode() === 'visual' &&\n\t\t\t\tgetEditorSettings().richEditingEnabled &&\n\t\t\t\thasInserterItems(\n\t\t\t\t\tgetBlockRootClientId( getBlockSelectionEnd() )\n\t\t\t\t),\n\t\t\tisInserterOpened: select( editPostStore ).isInserterOpened(),\n\t\t\tisTextModeEnabled: getEditorMode() === 'text',\n\t\t\tshowIconLabels: isFeatureActive( 'showIconLabels' ),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/edit-post/toggle-list-view'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\tconst overflowItems = (\n\t\t<>\n\t\t\t<ToolbarItem\n\t\t\t\tas={ TableOfContents }\n\t\t\t\thasOutlineItemsDisabled={ isTextModeEnabled }\n\t\t\t\trepositionDropdown={ showIconLabels && ! isWideViewport }\n\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t/>\n\t\t\t<ToolbarItem\n\t\t\t\tas={ Button }\n\t\t\t\tclassName=\"edit-post-header-toolbar__list-view-toggle\"\n\t\t\t\ticon={ listView }\n\t\t\t\tdisabled={ isTextModeEnabled }\n\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\tlabel={ __( 'List View' ) }\n\t\t\t\tonClick={ toggleListView }\n\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t/>\n\t\t</>\n\t);\n\tconst openInserter = useCallback( () => {\n\t\tif ( isInserterOpened ) {\n\t\t\t// Focusing the inserter button closes the inserter popover.\n\t\t\tinserterButton.current.focus();\n\t\t} else {\n\t\t\tsetIsInserterOpened( true );\n\t\t}\n\t}, [ isInserterOpened, setIsInserterOpened ] );\n\treturn (\n\t\t<NavigableToolbar\n\t\t\tclassName=\"edit-post-header-toolbar\"\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t>\n\t\t\t<div className=\"edit-post-header-toolbar__left\">\n\t\t\t\t<ToolbarItem\n\t\t\t\t\tref={ inserterButton }\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tclassName=\"edit-post-header-toolbar__inserter-toggle\"\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\tonClick={ openInserter }\n\t\t\t\t\tdisabled={ ! isInserterEnabled }\n\t\t\t\t\ticon={ plus }\n\t\t\t\t\t/* translators: button label text should, if possible, be under 16\n\t\t\tcharacters. */\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Toggle block inserter',\n\t\t\t\t\t\t'Generic label for block inserter button'\n\t\t\t\t\t) }\n\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t>\n\t\t\t\t\t{ showIconLabels &&\n\t\t\t\t\t\t( ! isInserterOpened ? __( 'Add' ) : __( 'Close' ) ) }\n\t\t\t\t</ToolbarItem>\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ isTextModeEnabled }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ overflowItems }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default HeaderToolbar;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/index.js"],"names":["Header","setEntitiesSavedStatesCallback","hasActiveMetaboxes","isPublishSidebarOpened","isSaving","showIconLabels","hasReducedUI","select","editPostStore","hasMetaBoxes","isSavingMetaBoxes","isFeatureActive","isLargeViewport","classes","undefined"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAUA,SAASA,MAAT,OAAsD;AAAA,MAArC;AAAEC,IAAAA;AAAF,GAAqC;AACrD,QAAM;AACLC,IAAAA,kBADK;AAELC,IAAAA,sBAFK;AAGLC,IAAAA,QAHK;AAILC,IAAAA,cAJK;AAKLC,IAAAA;AALK,MAMF,qBACDC,MAAF,KAAgB;AACfL,IAAAA,kBAAkB,EAAEK,MAAM,CAAEC,YAAF,CAAN,CAAwBC,YAAxB,EADL;AAEfN,IAAAA,sBAAsB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/index.js"],"names":["Header","setEntitiesSavedStatesCallback","hasActiveMetaboxes","isPublishSidebarOpened","isSaving","showIconLabels","hasReducedUI","select","editPostStore","hasMetaBoxes","isSavingMetaBoxes","isFeatureActive","isLargeViewport","classes","undefined"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AAC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4BAAC,yBAAD;AACC,IAAA,mBAAmB,EAAGH,kBADvB;AAEC,IAAA,gBAAgB,EAAGE,QAAQ,GAAG,IAAH,GAAUU;AAFtC,IAdD,EAkBC,4BAAC,kCAAD;AACC,IAAA,YAAY,EAAGZ,kBADhB;AAEC,IAAA,aAAa,EAAGE,QAFjB;AAGC,IAAA,8BAA8B,EAC7BH;AAJF,IAlBD,EAyBG,CAAEW,eAAe,IAAI,CAAEP,cAAvB,KACD,qDACC,4BAAC,sBAAD,CAAa,IAAb;AAAkB,IAAA,KAAK,EAAC;AAAxB,IADD,EAEC,4BAAC,iBAAD;AAAU,IAAA,cAAc,EAAGA;AAA3B,IAFD,CA1BF,EA+BGA,cAAc,IAAI,CAAEO,eAApB,IACD,4BAAC,iBAAD;AAAU,IAAA,cAAc,EAAGP;AAA3B,IAhCF,CARD,CADD;AA8CA;;eAEcL,M","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { PostSavedState, PostPreviewButton } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { PinnedItems } from '@wordpress/interface';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport HeaderToolbar from './header-toolbar';\nimport MoreMenu from './more-menu';\nimport PostPublishButtonOrToggle from './post-publish-button-or-toggle';\nimport { default as DevicePreview } from '../device-preview';\nimport MainDashboardButton from './main-dashboard-button';\nimport { store as editPostStore } from '../../store';\nimport TemplateTitle from './template-title';\n\nfunction Header( { setEntitiesSavedStatesCallback } ) {\n\tconst {\n\t\thasActiveMetaboxes,\n\t\tisPublishSidebarOpened,\n\t\tisSaving,\n\t\tshowIconLabels,\n\t\thasReducedUI,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasActiveMetaboxes: select( editPostStore ).hasMetaBoxes(),\n\t\t\tisPublishSidebarOpened:\n\t\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\t\tisSaving: select( editPostStore ).isSavingMetaBoxes(),\n\t\t\tshowIconLabels:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'showIconLabels' ),\n\t\t\thasReducedUI:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'reducedUI' ),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\n\tconst classes = classnames( 'edit-post-header', {\n\t\t'has-reduced-ui': hasReducedUI,\n\t} );\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t<MainDashboardButton.Slot>\n\t\t\t\t<FullscreenModeClose showTooltip />\n\t\t\t</MainDashboardButton.Slot>\n\t\t\t<div className=\"edit-post-header__toolbar\">\n\t\t\t\t<HeaderToolbar />\n\t\t\t\t<TemplateTitle />\n\t\t\t</div>\n\t\t\t<div className=\"edit-post-header__settings\">\n\t\t\t\t{ ! isPublishSidebarOpened && (\n\t\t\t\t\t// This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t// We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t// We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t// when the publish sidebar has been closed.\n\t\t\t\t\t<PostSavedState\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tforceIsSaving={ isSaving }\n\t\t\t\t\t\tshowIconLabels={ showIconLabels }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<DevicePreview />\n\t\t\t\t<PostPreviewButton\n\t\t\t\t\tforceIsAutosaveable={ hasActiveMetaboxes }\n\t\t\t\t\tforcePreviewLink={ isSaving ? null : undefined }\n\t\t\t\t/>\n\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\tforceIsSaving={ isSaving }\n\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ ( isLargeViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-post\" />\n\t\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t{ showIconLabels && ! isLargeViewport && (\n\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport default Header;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/mode-switcher/index.js"],"names":["MODES","value","label","ModeSwitcher","shortcut","isRichEditingEnabled","isCodeEditingEnabled","isEditingTemplate","mode","select","keyboardShortcutsStore","getShortcutRepresentation","editorStore","getEditorSettings","richEditingEnabled","codeEditingEnabled","editPostStore","getEditorMode","switchEditorMode","choices","map","choice"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA,MAAMA,KAAK,GAAG,CACb;AACCC,EAAAA,KAAK,EAAE,QADR;AAECC,EAAAA,KAAK,EAAE,cAAI,eAAJ;AAFR,CADa,EAKb;AACCD,EAAAA,KAAK,EAAE,MADR;AAECC,EAAAA,KAAK,EAAE,cAAI,aAAJ;AAFR,CALa,CAAd;;AAWA,SAASC,YAAT,GAAwB;AACvB,QAAM;AACLC,IAAAA,QADK;AAELC,IAAAA,oBAFK;AAGLC,IAAAA,oBAHK;AAILC,IAAAA,iBAJK;AAKLC,IAAAA;AALK,MAMF,qBACDC,MAAF,KAAgB;AACfL,IAAAA,QAAQ,EAAEK,MAAM,CACfC,wBADe,CAAN,CAERC,yBAFQ,CAEmB,4BAFnB,CADK;AAIfN,IAAAA,oBAAoB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/mode-switcher/index.js"],"names":["MODES","value","label","ModeSwitcher","shortcut","isRichEditingEnabled","isCodeEditingEnabled","isEditingTemplate","mode","select","keyboardShortcutsStore","getShortcutRepresentation","editorStore","getEditorSettings","richEditingEnabled","codeEditingEnabled","editPostStore","getEditorMode","switchEditorMode","choices","map","choice"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA,MAAMA,KAAK,GAAG,CACb;AACCC,EAAAA,KAAK,EAAE,QADR;AAECC,EAAAA,KAAK,EAAE,cAAI,eAAJ;AAFR,CADa,EAKb;AACCD,EAAAA,KAAK,EAAE,MADR;AAECC,EAAAA,KAAK,EAAE,cAAI,aAAJ;AAFR,CALa,CAAd;;AAWA,SAASC,YAAT,GAAwB;AACvB,QAAM;AACLC,IAAAA,QADK;AAELC,IAAAA,oBAFK;AAGLC,IAAAA,oBAHK;AAILC,IAAAA,iBAJK;AAKLC,IAAAA;AALK,MAMF,qBACDC,MAAF,KAAgB;AACfL,IAAAA,QAAQ,EAAEK,MAAM,CACfC,wBADe,CAAN,CAERC,yBAFQ,CAEmB,4BAFnB,CADK;AAIfN,IAAAA,oBAAoB,EACnBI,MAAM,CAAEG,aAAF,CAAN,CAAsBC,iBAAtB,GAA0CC,kBAL5B;AAMfR,IAAAA,oBAAoB,EACnBG,MAAM,CAAEG,aAAF,CAAN,CAAsBC,iBAAtB,GAA0CE,kBAP5B;AAQfR,IAAAA,iBAAiB,EAAEE,MAAM,CAAEO,YAAF,CAAN,CAAwBT,iBAAxB,EARJ;AASfC,IAAAA,IAAI,EAAEC,MAAM,CAAEO,YAAF,CAAN,CAAwBC,aAAxB;AATS,GAAhB,CADG,EAYH,EAZG,CANJ;AAoBA,QAAM;AAAEC,IAAAA;AAAF,MAAuB,uBAAaF,YAAb,CAA7B;;AAEA,MAAKT,iBAAL,EAAyB;AACxB,WAAO,IAAP;AACA;;AAED,MAAK,CAAEF,oBAAF,IAA0B,CAAEC,oBAAjC,EAAwD;AACvD,WAAO,IAAP;AACA;;AAED,QAAMa,OAAO,GAAGnB,KAAK,CAACoB,GAAN,CAAaC,MAAF,IAAc;AACxC,QAAKA,MAAM,CAACpB,KAAP,KAAiBO,IAAtB,EAA6B;AAC5B,aAAO,EAAE,GAAGa,MAAL;AAAajB,QAAAA;AAAb,OAAP;AACA;;AACD,WAAOiB,MAAP;AACA,GALe,CAAhB;AAOA,SACC,4BAAC,qBAAD;AAAW,IAAA,KAAK,EAAG,cAAI,QAAJ;AAAnB,KACC,4BAAC,2BAAD;AACC,IAAA,OAAO,EAAGF,OADX;AAEC,IAAA,KAAK,EAAGX,IAFT;AAGC,IAAA,QAAQ,EAAGU;AAHZ,IADD,CADD;AASA;;eAEcf,Y","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuItemsChoice, MenuGroup } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Set of available mode options.\n *\n * @type {Array}\n */\nconst MODES = [\n\t{\n\t\tvalue: 'visual',\n\t\tlabel: __( 'Visual editor' ),\n\t},\n\t{\n\t\tvalue: 'text',\n\t\tlabel: __( 'Code editor' ),\n\t},\n];\n\nfunction ModeSwitcher() {\n\tconst {\n\t\tshortcut,\n\t\tisRichEditingEnabled,\n\t\tisCodeEditingEnabled,\n\t\tisEditingTemplate,\n\t\tmode,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\tshortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/edit-post/toggle-mode' ),\n\t\t\tisRichEditingEnabled:\n\t\t\t\tselect( editorStore ).getEditorSettings().richEditingEnabled,\n\t\t\tisCodeEditingEnabled:\n\t\t\t\tselect( editorStore ).getEditorSettings().codeEditingEnabled,\n\t\t\tisEditingTemplate: select( editPostStore ).isEditingTemplate(),\n\t\t\tmode: select( editPostStore ).getEditorMode(),\n\t\t} ),\n\t\t[]\n\t);\n\tconst { switchEditorMode } = useDispatch( editPostStore );\n\n\tif ( isEditingTemplate ) {\n\t\treturn null;\n\t}\n\n\tif ( ! isRichEditingEnabled || ! isCodeEditingEnabled ) {\n\t\treturn null;\n\t}\n\n\tconst choices = MODES.map( ( choice ) => {\n\t\tif ( choice.value !== mode ) {\n\t\t\treturn { ...choice, shortcut };\n\t\t}\n\t\treturn choice;\n\t} );\n\n\treturn (\n\t\t<MenuGroup label={ __( 'Editor' ) }>\n\t\t\t<MenuItemsChoice\n\t\t\t\tchoices={ choices }\n\t\t\t\tvalue={ mode }\n\t\t\t\tonSelect={ switchEditorMode }\n\t\t\t/>\n\t\t</MenuGroup>\n\t);\n}\n\nexport default ModeSwitcher;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/post-publish-button-or-toggle.js"],"names":["PostPublishButtonOrToggle","forceIsDirty","forceIsSaving","hasPublishAction","isBeingScheduled","isPending","isPublished","isPublishSidebarEnabled","isPublishSidebarOpened","isScheduled","togglePublishSidebar","setEntitiesSavedStatesCallback","IS_TOGGLE","IS_BUTTON","isSmallerThanMediumViewport","component","select","editorStore","getCurrentPost","isEditedPostBeingScheduled","isCurrentPostPending","isCurrentPostPublished","editPostStore","isCurrentPostScheduled","dispatch"],"mappings":";;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AAGO,SAASA,yBAAT,OAYH;AAAA,MAZuC;AAC1CC,IAAAA,YAD0C;AAE1CC,IAAAA,aAF0C;AAG1CC,IAAAA,gBAH0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,EAAAA,gBAAgB,EAAEY,MAAM,CAAEC,aAAF,CAAN,CAAsBE,0BAAtB,EANS;AAO3Bd,EAAAA,SAAS,EAAEW,MAAM,CAAEC,aAAF,CAAN,CAAsBG,oBAAtB,EAPgB;AAQ3Bd,EAAAA,WAAW,EAAEU,MAAM,CAAEC,aAAF,CAAN,CAAsBI,sBAAtB,EARc;AAS3Bd,EAAAA,uBAAuB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/post-publish-button-or-toggle.js"],"names":["PostPublishButtonOrToggle","forceIsDirty","forceIsSaving","hasPublishAction","isBeingScheduled","isPending","isPublished","isPublishSidebarEnabled","isPublishSidebarOpened","isScheduled","togglePublishSidebar","setEntitiesSavedStatesCallback","IS_TOGGLE","IS_BUTTON","isSmallerThanMediumViewport","component","select","editorStore","getCurrentPost","isEditedPostBeingScheduled","isCurrentPostPending","isCurrentPostPublished","editPostStore","isCurrentPostScheduled","dispatch"],"mappings":";;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AAGO,SAASA,yBAAT,OAYH;AAAA,MAZuC;AAC1CC,IAAAA,YAD0C;AAE1CC,IAAAA,aAF0C;AAG1CC,IAAAA,gBAH0C;AAI1CC,IAAAA,gBAJ0C;AAK1CC,IAAAA,SAL0C;AAM1CC,IAAAA,WAN0C;AAO1CC,IAAAA,uBAP0C;AAQ1CC,IAAAA,sBAR0C;AAS1CC,IAAAA,WAT0C;AAU1CC,IAAAA,oBAV0C;AAW1CC,IAAAA;AAX0C,GAYvC;AACH,QAAMC,SAAS,GAAG,QAAlB;AACA,QAAMC,SAAS,GAAG,QAAlB;AACA,QAAMC,2BAA2B,GAAG,+BAAkB,QAAlB,EAA4B,GAA5B,CAApC;AACA,MAAIC,SAAJ;AAEA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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C,aAAF,CAAN,CAAsBM,sBAAtB;AAbc,CAAhB,CAAZ,CADc,EAgBd,wBAAgBC,QAAF,IAAgB;AAC7B,QAAM;AAAEd,IAAAA;AAAF,MAA2Bc,QAAQ,CAAEF,YAAF,CAAzC;AACA,SAAO;AACNZ,IAAAA;AADM,GAAP;AAGA,CALD,CAhBc,EAsBZV,yBAtBY,C","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch, compose } from '@wordpress/compose';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { PostPublishButton, store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport function PostPublishButtonOrToggle( {\n\tforceIsDirty,\n\tforceIsSaving,\n\thasPublishAction,\n\tisBeingScheduled,\n\tisPending,\n\tisPublished,\n\tisPublishSidebarEnabled,\n\tisPublishSidebarOpened,\n\tisScheduled,\n\ttogglePublishSidebar,\n\tsetEntitiesSavedStatesCallback,\n} ) {\n\tconst IS_TOGGLE = 'toggle';\n\tconst IS_BUTTON = 'button';\n\tconst isSmallerThanMediumViewport = useViewportMatch( 'medium', '<' );\n\tlet component;\n\n\t/**\n\t * Conditions to show a BUTTON (publish directly) or a TOGGLE (open publish sidebar):\n\t *\n\t * 1) We want to show a BUTTON when the post status is at the _final stage_\n\t * for a particular role (see https://wordpress.org/support/article/post-status/):\n\t *\n\t * - is published\n\t * - is scheduled to be published\n\t * - is pending and can't be published (but only for viewports >= medium).\n\t * \t Originally, we considered showing a button for pending posts that couldn't be published\n\t * \t (for example, for an author with the contributor role). Some languages can have\n\t * \t long translations for \"Submit for review\", so given the lack of UI real estate available\n\t * \t we decided to take into account the viewport in that case.\n\t * \t See: https://github.com/WordPress/gutenberg/issues/10475\n\t *\n\t * 2) Then, in small viewports, we'll show a TOGGLE.\n\t *\n\t * 3) Finally, we'll use the publish sidebar status to decide:\n\t *\n\t * - if it is enabled, we show a TOGGLE\n\t * - if it is disabled, we show a BUTTON\n\t */\n\tif (\n\t\tisPublished ||\n\t\t( isScheduled && isBeingScheduled ) ||\n\t\t( isPending && ! hasPublishAction && ! isSmallerThanMediumViewport )\n\t) {\n\t\tcomponent = IS_BUTTON;\n\t} else if ( isSmallerThanMediumViewport ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else if ( isPublishSidebarEnabled ) {\n\t\tcomponent = IS_TOGGLE;\n\t} else {\n\t\tcomponent = IS_BUTTON;\n\t}\n\n\treturn (\n\t\t<PostPublishButton\n\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\tforceIsSaving={ forceIsSaving }\n\t\t\tisOpen={ isPublishSidebarOpened }\n\t\t\tisToggle={ component === IS_TOGGLE }\n\t\t\tonToggle={ togglePublishSidebar }\n\t\t\tsetEntitiesSavedStatesCallback={ setEntitiesSavedStatesCallback }\n\t\t/>\n\t);\n}\n\nexport default compose(\n\twithSelect( ( select ) => ( {\n\t\thasPublishAction: get(\n\t\t\tselect( editorStore ).getCurrentPost(),\n\t\t\t[ '_links', 'wp:action-publish' ],\n\t\t\tfalse\n\t\t),\n\t\tisBeingScheduled: select( editorStore ).isEditedPostBeingScheduled(),\n\t\tisPending: select( editorStore ).isCurrentPostPending(),\n\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\tisPublishSidebarEnabled:\n\t\t\tselect( editorStore ).isPublishSidebarEnabled(),\n\t\tisPublishSidebarOpened:\n\t\t\tselect( editPostStore ).isPublishSidebarOpened(),\n\t\tisScheduled: select( editorStore ).isCurrentPostScheduled(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { togglePublishSidebar } = dispatch( editPostStore );\n\t\treturn {\n\t\t\ttogglePublishSidebar,\n\t\t};\n\t} )\n)( PostPublishButtonOrToggle );\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/template-title/delete-template.js"],"names":["DeleteTemplate","clearSelectedBlock","blockEditorStore","setIsEditingTemplate","editPostStore","getEditorSettings","editorStore","updateEditorSettings","editPost","deleteEntityRecord","coreStore","template","select","isEditingTemplate","getEditedPostTemplate","_isEditing","showConfirmDialog","setShowConfirmDialog","wp_id","templateTitle","slug","title","isRevertable","has_theme_file","onDelete","settings","newAvailableTemplates","availableTemplates","_title","id","throwOnError","undefined"],"mappings":";;;;;;;AAkBA;;AAfA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAMA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;AAGe,SAASA,cAAT,GAA0B;AACxC,QAAM;AAAEC,IAAAA;AAAF,MAAyB,uBAAaC,kBAAb,CAA/B;AACA,QAAM;AAAEC,IAAAA;AAAF,MAA2B,uBAAaC,YAAb,CAAjC;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAwB,qBAAWC,aAAX,CAA9B;AACA,QAAM;AAAEC,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MAAqC,uBAAaF,aAAb,CAA3C;AACA,QAAM;AAAEG,IAAAA;AAAF,MAAyB,uBAAaC,eAAb,CAA/B;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAe,qBAAaC,MAAF,IAAc;AAC7C,UAAM;AAAEC,MAAAA,iBAAF;AAAqBC,MAAAA;AAArB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/template-title/delete-template.js"],"names":["DeleteTemplate","clearSelectedBlock","blockEditorStore","setIsEditingTemplate","editPostStore","getEditorSettings","editorStore","updateEditorSettings","editPost","deleteEntityRecord","coreStore","template","select","isEditingTemplate","getEditedPostTemplate","_isEditing","showConfirmDialog","setShowConfirmDialog","wp_id","templateTitle","slug","title","isRevertable","has_theme_file","onDelete","settings","newAvailableTemplates","availableTemplates","_title","id","throwOnError","undefined"],"mappings":";;;;;;;AAkBA;;AAfA;;AAKA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAMA;;AAvBA;AACA;AACA;;AAGA;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T,IAAAA,QAAQ,CAAE;AACTG,MAAAA,QAAQ,EAAE;AADD,KAAF,CAAR;AAGA,UAAMc,QAAQ,GAAGpB,iBAAiB,EAAlC;AACA,UAAMqB,qBAAqB,GAAG,oBAC7BD,QAAQ,CAACE,kBADoB,EAE7B,CAAEC,MAAF,EAAUC,EAAV,KAAkB;AACjB,aAAOA,EAAE,KAAKlB,QAAQ,CAACS,IAAvB;AACA,KAJ4B,CAA9B;AAMAb,IAAAA,oBAAoB,CAAE,EACrB,GAAGkB,QADkB;AAErBE,MAAAA,kBAAkB,EAAED;AAFC,KAAF,CAApB;AAIAjB,IAAAA,kBAAkB,CAAE,UAAF,EAAc,aAAd,EAA6BE,QAAQ,CAACkB,EAAtC,EAA0C;AAC3DC,MAAAA,YAAY,EAAE;AAD6C,KAA1C,CAAlB;AAGA,GAtBD;;AAwBA,SACC,4BAAC,qBAAD;AAAW,IAAA,SAAS,EAAC;AAArB,KACC,qDACC,4BAAC,oBAAD;AACC,IAAA,SAAS,EAAC,qDADX;AAEC,IAAA,aAAa,EAAG,CAAER,YAFnB;AAGC,IAAA,OAAO,EAAG,MAAM;AACfL,MAAAA,oBAAoB,CAAE,IAAF,CAApB;AACA,KALF;AAMC,IAAA,IAAI,EACHK,YAAY,GACT,cAAI,mCAAJ,CADS,GAETS;AATL,KAYGT,YAAY,GACX,cAAI,sBAAJ,CADW,GAEX,cAAI,iBAAJ,CAdJ,CADD,EAiBC,4BAAC,uCAAD;AACC,IAAA,MAAM,EAAGN,iBADV;AAEC,IAAA,SAAS,EAAGQ,QAFb;AAGC,IAAA,QAAQ,EAAG,MAAM;AAChBP,MAAAA,oBAAoB,CAAE,KAAF,CAApB;AACA;AALF,KAOG;AACD;AACA,gBACC,0FADD,CAFC,EAKDE,aALC,CAPH,CAjBD,CADD,CADD;AAqCA","sourcesContent":["/**\n * External dependencies\n */\nimport { pickBy } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nexport default function DeleteTemplate() {\n\tconst { clearSelectedBlock } = useDispatch( blockEditorStore );\n\tconst { setIsEditingTemplate } = useDispatch( editPostStore );\n\tconst { getEditorSettings } = useSelect( editorStore );\n\tconst { updateEditorSettings, editPost } = useDispatch( editorStore );\n\tconst { deleteEntityRecord } = useDispatch( coreStore );\n\tconst { template } = useSelect( ( select ) => {\n\t\tconst { isEditingTemplate, getEditedPostTemplate } =\n\t\t\tselect( editPostStore );\n\t\tconst _isEditing = isEditingTemplate();\n\t\treturn {\n\t\t\ttemplate: _isEditing ? getEditedPostTemplate() : null,\n\t\t};\n\t}, [] );\n\tconst [ showConfirmDialog, setShowConfirmDialog ] = useState( false );\n\n\tif ( ! template || ! template.wp_id ) {\n\t\treturn null;\n\t}\n\tlet templateTitle = template.slug;\n\tif ( template?.title ) {\n\t\ttemplateTitle = template.title;\n\t}\n\n\tconst isRevertable = template?.has_theme_file;\n\n\tconst onDelete = () => {\n\t\tclearSelectedBlock();\n\t\tsetIsEditingTemplate( false );\n\t\tsetShowConfirmDialog( false );\n\n\t\teditPost( {\n\t\t\ttemplate: '',\n\t\t} );\n\t\tconst settings = getEditorSettings();\n\t\tconst newAvailableTemplates = pickBy(\n\t\t\tsettings.availableTemplates,\n\t\t\t( _title, id ) => {\n\t\t\t\treturn id !== template.slug;\n\t\t\t}\n\t\t);\n\t\tupdateEditorSettings( {\n\t\t\t...settings,\n\t\t\tavailableTemplates: newAvailableTemplates,\n\t\t} );\n\t\tdeleteEntityRecord( 'postType', 'wp_template', template.id, {\n\t\t\tthrowOnError: true,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<MenuGroup className=\"edit-post-template-top-area__second-menu-group\">\n\t\t\t<>\n\t\t\t\t<MenuItem\n\t\t\t\t\tclassName=\"edit-post-template-top-area__delete-template-button\"\n\t\t\t\t\tisDestructive={ ! isRevertable }\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tsetShowConfirmDialog( true );\n\t\t\t\t\t} }\n\t\t\t\t\tinfo={\n\t\t\t\t\t\tisRevertable\n\t\t\t\t\t\t\t? __( 'Restore template to default state' )\n\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ isRevertable\n\t\t\t\t\t\t? __( 'Clear customizations' )\n\t\t\t\t\t\t: __( 'Delete template' ) }\n\t\t\t\t</MenuItem>\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\tisOpen={ showConfirmDialog }\n\t\t\t\t\tonConfirm={ onDelete }\n\t\t\t\t\tonCancel={ () => {\n\t\t\t\t\t\tsetShowConfirmDialog( false );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %s: template name */\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Are you sure you want to delete the %s template? It may be used by other pages or posts.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttemplateTitle\n\t\t\t\t\t) }\n\t\t\t\t</ConfirmDialog>\n\t\t\t</>\n\t\t</MenuGroup>\n\t);\n}\n"]}
|
|
@@ -33,6 +33,7 @@ var _store = require("../../../store");
|
|
|
33
33
|
* Internal dependencies
|
|
34
34
|
*/
|
|
35
35
|
function EditTemplateTitle() {
|
|
36
|
+
const [forceEmpty, setForceEmpty] = (0, _element.useState)(false);
|
|
36
37
|
const {
|
|
37
38
|
template
|
|
38
39
|
} = (0, _data.useSelect)(select => {
|
|
@@ -69,9 +70,16 @@ function EditTemplateTitle() {
|
|
|
69
70
|
className: "edit-site-template-details__group"
|
|
70
71
|
}, (0, _element.createElement)(_components.TextControl, {
|
|
71
72
|
label: (0, _i18n.__)('Title'),
|
|
72
|
-
value: templateTitle,
|
|
73
|
+
value: forceEmpty ? '' : templateTitle,
|
|
73
74
|
help: (0, _i18n.__)('Give the template a title that indicates its purpose, e.g. "Full Width".'),
|
|
74
75
|
onChange: newTitle => {
|
|
76
|
+
// Allow having the field temporarily empty while typing.
|
|
77
|
+
if (!newTitle && !forceEmpty) {
|
|
78
|
+
setForceEmpty(true);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
setForceEmpty(false);
|
|
75
83
|
const settings = getEditorSettings();
|
|
76
84
|
const newAvailableTemplates = (0, _lodash.mapValues)(settings.availableTemplates, (existingTitle, id) => {
|
|
77
85
|
if (id !== template.slug) {
|
|
@@ -86,7 +94,8 @@ function EditTemplateTitle() {
|
|
|
86
94
|
editEntityRecord('postType', 'wp_template', template.id, {
|
|
87
95
|
title: newTitle
|
|
88
96
|
});
|
|
89
|
-
}
|
|
97
|
+
},
|
|
98
|
+
onBlur: () => setForceEmpty(false)
|
|
90
99
|
}));
|
|
91
100
|
}
|
|
92
101
|
//# sourceMappingURL=edit-template-title.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/template-title/edit-template-title.js"],"names":["EditTemplateTitle","template","select","getEditedPostTemplate","editPostStore","editEntityRecord","coreStore","getEditorSettings","editorStore","updateEditorSettings","is_custom","has_theme_file","templateTitle","title","slug","newTitle","settings","newAvailableTemplates","availableTemplates","existingTitle","id"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/template-title/edit-template-title.js"],"names":["EditTemplateTitle","forceEmpty","setForceEmpty","template","select","getEditedPostTemplate","editPostStore","editEntityRecord","coreStore","getEditorSettings","editorStore","updateEditorSettings","is_custom","has_theme_file","templateTitle","title","slug","newTitle","settings","newAvailableTemplates","availableTemplates","existingTitle","id"],"mappings":";;;;;;;AAWA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AAF,IAAc,CAAEhB,UAArB,EAAkC;AACjCC,QAAAA,aAAa,CAAE,IAAF,CAAb;AACA;AACA;;AACDA,MAAAA,aAAa,CAAE,KAAF,CAAb;AAEA,YAAMgB,QAAQ,GAAGT,iBAAiB,EAAlC;AACA,YAAMU,qBAAqB,GAAG,uBAC7BD,QAAQ,CAACE,kBADoB,EAE7B,CAAEC,aAAF,EAAiBC,EAAjB,KAAyB;AACxB,YAAKA,EAAE,KAAKnB,QAAQ,CAACa,IAArB,EAA4B;AAC3B,iBAAOK,aAAP;AACA;;AACD,eAAOJ,QAAP;AACA,OAP4B,CAA9B;AASAN,MAAAA,oBAAoB,CAAE,EACrB,GAAGO,QADkB;AAErBE,QAAAA,kBAAkB,EAAED;AAFC,OAAF,CAApB;AAIAZ,MAAAA,gBAAgB,CAAE,UAAF,EAAc,aAAd,EAA6BJ,QAAQ,CAACmB,EAAtC,EAA0C;AACzDP,QAAAA,KAAK,EAAEE;AADkD,OAA1C,CAAhB;AAGA,KA/BF;AAgCC,IAAA,MAAM,EAAG,MAAMf,aAAa,CAAE,KAAF;AAhC7B,IADD,CADD;AAsCA","sourcesContent":["/**\n * External dependencies\n */\nimport { mapValues } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { TextControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nexport default function EditTemplateTitle() {\n\tconst [ forceEmpty, setForceEmpty ] = useState( false );\n\tconst { template } = useSelect( ( select ) => {\n\t\tconst { getEditedPostTemplate } = select( editPostStore );\n\t\treturn {\n\t\t\ttemplate: getEditedPostTemplate(),\n\t\t};\n\t}, [] );\n\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { getEditorSettings } = useSelect( editorStore );\n\tconst { updateEditorSettings } = useDispatch( editorStore );\n\n\t// Only user-created and non-default templates can change the name.\n\tif ( ! template.is_custom || template.has_theme_file ) {\n\t\treturn null;\n\t}\n\n\tlet templateTitle = __( 'Default' );\n\tif ( template?.title ) {\n\t\ttemplateTitle = template.title;\n\t} else if ( !! template ) {\n\t\ttemplateTitle = template.slug;\n\t}\n\n\treturn (\n\t\t<div className=\"edit-site-template-details__group\">\n\t\t\t<TextControl\n\t\t\t\tlabel={ __( 'Title' ) }\n\t\t\t\tvalue={ forceEmpty ? '' : templateTitle }\n\t\t\t\thelp={ __(\n\t\t\t\t\t'Give the template a title that indicates its purpose, e.g. \"Full Width\".'\n\t\t\t\t) }\n\t\t\t\tonChange={ ( newTitle ) => {\n\t\t\t\t\t// Allow having the field temporarily empty while typing.\n\t\t\t\t\tif ( ! newTitle && ! forceEmpty ) {\n\t\t\t\t\t\tsetForceEmpty( true );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsetForceEmpty( false );\n\n\t\t\t\t\tconst settings = getEditorSettings();\n\t\t\t\t\tconst newAvailableTemplates = mapValues(\n\t\t\t\t\t\tsettings.availableTemplates,\n\t\t\t\t\t\t( existingTitle, id ) => {\n\t\t\t\t\t\t\tif ( id !== template.slug ) {\n\t\t\t\t\t\t\t\treturn existingTitle;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn newTitle;\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\tupdateEditorSettings( {\n\t\t\t\t\t\t...settings,\n\t\t\t\t\t\tavailableTemplates: newAvailableTemplates,\n\t\t\t\t\t} );\n\t\t\t\t\teditEntityRecord( 'postType', 'wp_template', template.id, {\n\t\t\t\t\t\ttitle: newTitle,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tonBlur={ () => setForceEmpty( false ) }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/template-title/index.js"],"names":["TemplateTitle","template","isEditing","title","select","isEditingTemplate","getEditedPostTemplate","editPostStore","getEditedPostAttribute","editorStore","_isEditing","clearSelectedBlock","blockEditorStore","setIsEditingTemplate","templateTitle","slug","hasOptions","custom","wp_id","description","onToggle","chevronDown","lineHeight"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AApBA;AACA;AACA;;AAUA;AACA;AACA;AAQA,SAASA,aAAT,GAAyB;AACxB,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,SAAZ;AAAuBC,IAAAA;AAAvB,MAAiC,qBAAaC,MAAF,IAAc;AAC/D,UAAM;AAAEC,MAAAA,iBAAF;AAAqBC,MAAAA;AAArB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/template-title/index.js"],"names":["TemplateTitle","template","isEditing","title","select","isEditingTemplate","getEditedPostTemplate","editPostStore","getEditedPostAttribute","editorStore","_isEditing","clearSelectedBlock","blockEditorStore","setIsEditingTemplate","templateTitle","slug","hasOptions","custom","wp_id","description","onToggle","chevronDown","lineHeight"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AApBA;AACA;AACA;;AAUA;AACA;AACA;AAQA,SAASA,aAAT,GAAyB;AACxB,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,SAAZ;AAAuBC,IAAAA;AAAvB,MAAiC,qBAAaC,MAAF,IAAc;AAC/D,UAAM;AAAEC,MAAAA,iBAAF;AAAqBC,MAAAA;AAArB,QACLF,MAAM,CAAEG,YAAF,CADP;AAEA,UAAM;AAAEC,MAAAA;AAAF,QAA6BJ,MAAM,CAAEK,aAAF,CAAzC;;AAEA,UAAMC,UAAU,GAAGL,iBAAiB,EAApC;;AAEA,WAAO;AACNJ,MAAAA,QAAQ,EAAES,UAAU,GAAGJ,qBA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GC,IAAA,YAAY,EAAG;AAAA,UAAE;AAAEI,QAAAA;AAAF,OAAF;AAAA,aACd,4BAAC,kBAAD;AACC,QAAA,SAAS,EAAC,0BADX;AAEC,QAAA,MAAM,MAFP;AAGC,QAAA,IAAI,EAAGC,kBAHR;AAIC,QAAA,WAAW,MAJZ;AAKC,QAAA,OAAO,EAAGD,QALX;AAMC,QAAA,KAAK,EAAG,cAAI,kBAAJ;AANT,SAQGN,aARH,CADc;AAAA,KAHhB;AAeC,IAAA,aAAa,EAAG,MACf,qDACC,4BAAC,0BAAD,OADD,EAEC,4BAAC,4BAAD,OAFD,EAGC,4BAAC,uBAAD,OAHD;AAhBF,IADW,GAyBX,4BAAC,8BAAD;AACC,IAAA,SAAS,EAAC,0BADX;AAEC,IAAA,IAAI,EAAC,MAFN;AAGC,IAAA,KAAK,EAAG;AAAEQ,MAAAA,UAAU,EAAE;AAAd;AAHT,KAKGR,aALH,CA1CF,CADD;AAqDA;;eAEcd,a","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tDropdown,\n\tButton,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { chevronDown } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\nimport DeleteTemplate from './delete-template';\nimport EditTemplateTitle from './edit-template-title';\nimport TemplateDescription from './template-description';\n\nfunction TemplateTitle() {\n\tconst { template, isEditing, title } = useSelect( ( select ) => {\n\t\tconst { isEditingTemplate, getEditedPostTemplate } =\n\t\t\tselect( editPostStore );\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\n\t\tconst _isEditing = isEditingTemplate();\n\n\t\treturn {\n\t\t\ttemplate: _isEditing ? getEditedPostTemplate() : null,\n\t\t\tisEditing: _isEditing,\n\t\t\ttitle: getEditedPostAttribute( 'title' )\n\t\t\t\t? getEditedPostAttribute( 'title' )\n\t\t\t\t: __( 'Untitled' ),\n\t\t};\n\t}, [] );\n\n\tconst { clearSelectedBlock } = useDispatch( blockEditorStore );\n\tconst { setIsEditingTemplate } = useDispatch( editPostStore );\n\n\tif ( ! isEditing || ! template ) {\n\t\treturn null;\n\t}\n\n\tlet templateTitle = __( 'Default' );\n\tif ( template?.title ) {\n\t\ttemplateTitle = template.title;\n\t} else if ( !! template ) {\n\t\ttemplateTitle = template.slug;\n\t}\n\n\tconst hasOptions = !! (\n\t\ttemplate.custom ||\n\t\ttemplate.wp_id ||\n\t\ttemplate.description\n\t);\n\n\treturn (\n\t\t<div className=\"edit-post-template-top-area\">\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-template-post-title\"\n\t\t\t\tisLink\n\t\t\t\tshowTooltip\n\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t/* translators: %s: Title of the referring post, e.g: \"Hello World!\" */\n\t\t\t\t\t__( 'Edit %s' ),\n\t\t\t\t\ttitle\n\t\t\t\t) }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tclearSelectedBlock();\n\t\t\t\t\tsetIsEditingTemplate( false );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</Button>\n\t\t\t{ hasOptions ? (\n\t\t\t\t<Dropdown\n\t\t\t\t\tposition=\"bottom center\"\n\t\t\t\t\tcontentClassName=\"edit-post-template-top-area__popover\"\n\t\t\t\t\trenderToggle={ ( { onToggle } ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tclassName=\"edit-post-template-title\"\n\t\t\t\t\t\t\tisLink\n\t\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\tlabel={ __( 'Template Options' ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ templateTitle }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<EditTemplateTitle />\n\t\t\t\t\t\t\t<TemplateDescription />\n\t\t\t\t\t\t\t<DeleteTemplate />\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\t\t<Text\n\t\t\t\t\tclassName=\"edit-post-template-title\"\n\t\t\t\t\tsize=\"body\"\n\t\t\t\t\tstyle={ { lineHeight: '24px' } }\n\t\t\t\t>\n\t\t\t\t\t{ templateTitle }\n\t\t\t\t</Text>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport default TemplateTitle;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/header/tools-more-menu-group/index.js"],"names":["Fill","ToolsMoreMenuGroup","Slot","fillProps","fills"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA,IAAI,EAAEC,kBAAR;AAA4BC,EAAAA;AAA5B,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/header/tools-more-menu-group/index.js"],"names":["Fill","ToolsMoreMenuGroup","Slot","fillProps","fills"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAM;AAAEA,EAAAA,IAAI,EAAEC,kBAAR;AAA4BC,EAAAA;AAA5B,IACL,gCAAgB,oBAAhB,CADD;;AAGAD,kBAAkB,CAACC,IAAnB,GAA0B;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SACzB,4BAAC,IAAD;AAAM,IAAA,SAAS,EAAGA;AAAlB,KACKC,KAAF,IACD,CAAE,qBAASA,KAAT,CAAF,IACC,4BAAC,qBAAD;AAAW,IAAA,KAAK,EAAG,cAAI,OAAJ;AAAnB,KAAqCA,KAArC,CAHH,CADyB;AAAA,CAA1B;;eAUeH,kB","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill, MenuGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } =\n\tcreateSlotFill( 'ToolsMoreMenuGroup' );\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) =>\n\t\t\t! isEmpty( fills ) && (\n\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>{ fills }</MenuGroup>\n\t\t\t)\n\t\t}\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"]}
|
|
@@ -45,6 +45,18 @@ const textFormattingShortcuts = [{
|
|
|
45
45
|
character: 'u'
|
|
46
46
|
},
|
|
47
47
|
description: (0, _i18n.__)('Underline the selected text.')
|
|
48
|
+
}, {
|
|
49
|
+
keyCombination: {
|
|
50
|
+
modifier: 'access',
|
|
51
|
+
character: 'd'
|
|
52
|
+
},
|
|
53
|
+
description: (0, _i18n.__)('Strikethrough the selected text.')
|
|
54
|
+
}, {
|
|
55
|
+
keyCombination: {
|
|
56
|
+
modifier: 'access',
|
|
57
|
+
character: 'x'
|
|
58
|
+
},
|
|
59
|
+
description: (0, _i18n.__)('Make the selected text inline code.')
|
|
48
60
|
}];
|
|
49
61
|
exports.textFormattingShortcuts = textFormattingShortcuts;
|
|
50
62
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/keyboard-shortcut-help-modal/config.js"],"names":["textFormattingShortcuts","keyCombination","modifier","character","description"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAMA,uBAAuB,GAAG,CACtC;AACCC,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,8BAAJ;AAFd,CADsC,EAKtC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,gCAAJ;AAFd,CALsC,EAStC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,wCAAJ;AAFd,CATsC,EAatC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,cAAZ;AAA4BC,IAAAA,SAAS,EAAE;AAAvC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,gBAAJ;AAFd,CAbsC,EAiBtC;AACCH,EAAAA,cAAc,EAAE;AAAEE,IAAAA,SAAS,EAAE;AAAb,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,iCAAJ;AAFd,CAjBsC,EAqBtC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,8BAAJ;AAFd,CArBsC,CAAhC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const textFormattingShortcuts = [\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'b' },\n\t\tdescription: __( 'Make the selected text bold.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'i' },\n\t\tdescription: __( 'Make the selected text italic.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'k' },\n\t\tdescription: __( 'Convert the selected text into a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primaryShift', character: 'k' },\n\t\tdescription: __( 'Remove a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { character: '[[' },\n\t\tdescription: __( 'Insert a link to a post or page' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'u' },\n\t\tdescription: __( 'Underline the selected text.' ),\n\t},\n];\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/keyboard-shortcut-help-modal/config.js"],"names":["textFormattingShortcuts","keyCombination","modifier","character","description"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAMA,uBAAuB,GAAG,CACtC;AACCC,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,8BAAJ;AAFd,CADsC,EAKtC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,gCAAJ;AAFd,CALsC,EAStC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,wCAAJ;AAFd,CATsC,EAatC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,cAAZ;AAA4BC,IAAAA,SAAS,EAAE;AAAvC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,gBAAJ;AAFd,CAbsC,EAiBtC;AACCH,EAAAA,cAAc,EAAE;AAAEE,IAAAA,SAAS,EAAE;AAAb,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,iCAAJ;AAFd,CAjBsC,EAqBtC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,SAAZ;AAAuBC,IAAAA,SAAS,EAAE;AAAlC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,8BAAJ;AAFd,CArBsC,EAyBtC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,QAAZ;AAAsBC,IAAAA,SAAS,EAAE;AAAjC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,kCAAJ;AAFd,CAzBsC,EA6BtC;AACCH,EAAAA,cAAc,EAAE;AAAEC,IAAAA,QAAQ,EAAE,QAAZ;AAAsBC,IAAAA,SAAS,EAAE;AAAjC,GADjB;AAECC,EAAAA,WAAW,EAAE,cAAI,qCAAJ;AAFd,CA7BsC,CAAhC","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const textFormattingShortcuts = [\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'b' },\n\t\tdescription: __( 'Make the selected text bold.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'i' },\n\t\tdescription: __( 'Make the selected text italic.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'k' },\n\t\tdescription: __( 'Convert the selected text into a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primaryShift', character: 'k' },\n\t\tdescription: __( 'Remove a link.' ),\n\t},\n\t{\n\t\tkeyCombination: { character: '[[' },\n\t\tdescription: __( 'Insert a link to a post or page' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'primary', character: 'u' },\n\t\tdescription: __( 'Underline the selected text.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: 'd' },\n\t\tdescription: __( 'Strikethrough the selected text.' ),\n\t},\n\t{\n\t\tkeyCombination: { modifier: 'access', character: 'x' },\n\t\tdescription: __( 'Make the selected text inline code.' ),\n\t},\n];\n"]}
|
|
@@ -12,8 +12,6 @@ var _element = require("@wordpress/element");
|
|
|
12
12
|
|
|
13
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
14
|
|
|
15
|
-
var _lodash = require("lodash");
|
|
16
|
-
|
|
17
15
|
var _components = require("@wordpress/components");
|
|
18
16
|
|
|
19
17
|
var _i18n = require("@wordpress/i18n");
|
|
@@ -62,7 +60,7 @@ const ShortcutList = _ref => {
|
|
|
62
60
|
}, shortcuts.map((shortcut, index) => (0, _element.createElement)("li", {
|
|
63
61
|
className: "edit-post-keyboard-shortcut-help-modal__shortcut",
|
|
64
62
|
key: index
|
|
65
|
-
},
|
|
63
|
+
}, typeof shortcut === 'string' ? (0, _element.createElement)(_dynamicShortcut.default, {
|
|
66
64
|
name: shortcut
|
|
67
65
|
}) : (0, _element.createElement)(_shortcut.default, shortcut))))
|
|
68
66
|
/* eslint-enable jsx-a11y/no-redundant-roles */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-post/src/components/keyboard-shortcut-help-modal/index.js"],"names":["MODAL_NAME","ShortcutList","shortcuts","map","shortcut","index","ShortcutSection","title","className","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","keyboardShortcutsStore","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","keyCombination","character","description","ariaLabel","textFormattingShortcuts","editPostStore","dispatch","openModal","closeModal"],"mappings":";;;;;;;;;;;;AAGA;;
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-post/src/components/keyboard-shortcut-help-modal/index.js"],"names":["MODAL_NAME","ShortcutList","shortcuts","map","shortcut","index","ShortcutSection","title","className","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","keyboardShortcutsStore","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","keyCombination","character","description","ariaLabel","textFormattingShortcuts","editPostStore","dispatch","openModal","closeModal"],"mappings":";;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAIA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;AAMA,MAAMA,UAAU,GAAG,kCAAnB;;AAEA,MAAMC,YAA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AAA,MAAvB;AAAER,IAAAA;AAAF,GAAuB;AAChD,QAAM;AAAES,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA4BF,QAAQ,CAAED,YAAF,CAA1C;AAEA,SAAO;AACNN,IAAAA,WAAW,EAAE,MACZD,aAAa,GAAGU,UAAU,EAAb,GAAkBD,SAAS,CAAE3B,UAAF;AAFnC,GAAP;AAIA,CAPD,CAJuB,CAAT,EAYViB,yBAZU,C","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { withSelect, withDispatch, useSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { textFormattingShortcuts } from './config';\nimport Shortcut from './shortcut';\nimport DynamicShortcut from './dynamic-shortcut';\nimport { store as editPostStore } from '../../store';\n\nconst MODAL_NAME = 'edit-post/keyboard-shortcut-help';\n\nconst ShortcutList = ( { shortcuts } ) => (\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t<ul\n\t\tclassName=\"edit-post-keyboard-shortcut-help-modal__shortcut-list\"\n\t\trole=\"list\"\n\t>\n\t\t{ shortcuts.map( ( shortcut, index ) => (\n\t\t\t<li\n\t\t\t\tclassName=\"edit-post-keyboard-shortcut-help-modal__shortcut\"\n\t\t\t\tkey={ index }\n\t\t\t>\n\t\t\t\t{ typeof shortcut === 'string' ? (\n\t\t\t\t\t<DynamicShortcut name={ shortcut } />\n\t\t\t\t) : (\n\t\t\t\t\t<Shortcut { ...shortcut } />\n\t\t\t\t) }\n\t\t\t</li>\n\t\t) ) }\n\t</ul>\n\t/* eslint-enable jsx-a11y/no-redundant-roles */\n);\n\nconst ShortcutSection = ( { title, shortcuts, className } ) => (\n\t<section\n\t\tclassName={ classnames(\n\t\t\t'edit-post-keyboard-shortcut-help-modal__section',\n\t\t\tclassName\n\t\t) }\n\t>\n\t\t{ !! title && (\n\t\t\t<h2 className=\"edit-post-keyboard-shortcut-help-modal__section-title\">\n\t\t\t\t{ title }\n\t\t\t</h2>\n\t\t) }\n\t\t<ShortcutList shortcuts={ shortcuts } />\n\t</section>\n);\n\nconst ShortcutCategorySection = ( {\n\ttitle,\n\tcategoryName,\n\tadditionalShortcuts = [],\n} ) => {\n\tconst categoryShortcuts = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( keyboardShortcutsStore ).getCategoryShortcuts(\n\t\t\t\tcategoryName\n\t\t\t);\n\t\t},\n\t\t[ categoryName ]\n\t);\n\n\treturn (\n\t\t<ShortcutSection\n\t\t\ttitle={ title }\n\t\t\tshortcuts={ categoryShortcuts.concat( additionalShortcuts ) }\n\t\t/>\n\t);\n};\n\nexport function KeyboardShortcutHelpModal( { isModalActive, toggleModal } ) {\n\tuseShortcut( 'core/edit-post/keyboard-shortcuts', toggleModal );\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-post-keyboard-shortcut-help-modal\"\n\t\t\ttitle={ __( 'Keyboard shortcuts' ) }\n\t\t\tcloseLabel={ __( 'Close' ) }\n\t\t\tonRequestClose={ toggleModal }\n\t\t>\n\t\t\t<ShortcutSection\n\t\t\t\tclassName=\"edit-post-keyboard-shortcut-help-modal__main-shortcuts\"\n\t\t\t\tshortcuts={ [ 'core/edit-post/keyboard-shortcuts' ] }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Global shortcuts' ) }\n\t\t\t\tcategoryName=\"global\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Selection shortcuts' ) }\n\t\t\t\tcategoryName=\"selection\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Block shortcuts' ) }\n\t\t\t\tcategoryName=\"block\"\n\t\t\t\tadditionalShortcuts={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyCombination: { character: '/' },\n\t\t\t\t\t\tdescription: __(\n\t\t\t\t\t\t\t'Change the block type after adding a new paragraph.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t/* translators: The forward-slash character. e.g. '/'. */\n\t\t\t\t\t\tariaLabel: __( 'Forward-slash' ),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t\t<ShortcutSection\n\t\t\t\ttitle={ __( 'Text formatting' ) }\n\t\t\t\tshortcuts={ textFormattingShortcuts }\n\t\t\t/>\n\t\t</Modal>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => ( {\n\t\tisModalActive: select( editPostStore ).isModalActive( MODAL_NAME ),\n\t} ) ),\n\twithDispatch( ( dispatch, { isModalActive } ) => {\n\t\tconst { openModal, closeModal } = dispatch( editPostStore );\n\n\t\treturn {\n\t\t\ttoggleModal: () =>\n\t\t\t\tisModalActive ? closeModal() : openModal( MODAL_NAME ),\n\t\t};\n\t} ),\n] )( KeyboardShortcutHelpModal );\n"]}
|