@wordpress/edit-post 7.26.0 → 7.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/header/index.js +2 -2
- package/build/components/header/index.js.map +1 -1
- package/build/components/layout/index.native.js +1 -3
- package/build/components/layout/index.native.js.map +1 -1
- package/build/components/meta-boxes/index.js +3 -2
- package/build/components/meta-boxes/index.js.map +1 -1
- package/build/components/preferences-modal/{options/enable-custom-fields.js → enable-custom-fields.js} +10 -2
- package/build/components/preferences-modal/enable-custom-fields.js.map +1 -0
- package/build/components/preferences-modal/{options/enable-panel.js → enable-panel.js} +11 -2
- package/build/components/preferences-modal/enable-panel.js.map +1 -0
- package/build/components/preferences-modal/{options/enable-publish-sidebar.js → enable-publish-sidebar.js} +11 -2
- package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
- package/build/components/preferences-modal/index.js +31 -149
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/meta-boxes-section.js +11 -5
- package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build/components/sidebar/plugin-document-setting-panel/index.js +5 -2
- package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build/editor.js +3 -26
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +4 -28
- package/build/editor.native.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +48 -8
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/index.native.js +1 -1
- package/build/index.native.js.map +1 -1
- package/build/store/actions.js +11 -10
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +24 -6
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/header/index.js +2 -2
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/layout/index.native.js +1 -3
- package/build-module/components/layout/index.native.js.map +1 -1
- package/build-module/components/meta-boxes/index.js +3 -2
- package/build-module/components/meta-boxes/index.js.map +1 -1
- package/build-module/components/preferences-modal/{options/enable-custom-fields.js → enable-custom-fields.js} +10 -2
- package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -0
- package/build-module/components/preferences-modal/{options/enable-panel.js → enable-panel.js} +10 -2
- package/build-module/components/preferences-modal/enable-panel.js.map +1 -0
- package/build-module/components/preferences-modal/{options/enable-publish-sidebar.js → enable-publish-sidebar.js} +10 -2
- package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +31 -150
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/meta-boxes-section.js +7 -2
- package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js +5 -2
- package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
- package/build-module/editor.js +3 -26
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +5 -29
- package/build-module/editor.native.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +49 -9
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/index.js +2 -2
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +1 -1
- package/build-module/index.native.js.map +1 -1
- package/build-module/store/actions.js +11 -10
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +24 -6
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/classic-rtl.css +1 -1
- package/build-style/classic.css +1 -1
- package/build-style/style-rtl.css +16 -182
- package/build-style/style.css +16 -182
- package/package.json +32 -32
- package/src/components/header/index.js +2 -4
- package/src/components/header/style.scss +13 -4
- package/src/components/layout/index.native.js +1 -4
- package/src/components/meta-boxes/index.js +4 -2
- package/src/components/preferences-modal/{options/enable-custom-fields.js → enable-custom-fields.js} +10 -3
- package/src/components/preferences-modal/{options/enable-panel.js → enable-panel.js} +9 -2
- package/src/components/preferences-modal/{options/enable-publish-sidebar.js → enable-publish-sidebar.js} +9 -2
- package/src/components/preferences-modal/index.js +44 -267
- package/src/components/preferences-modal/meta-boxes-section.js +6 -2
- package/src/components/preferences-modal/{options/test → test}/__snapshots__/enable-custom-fields.js.snap +4 -4
- package/src/components/preferences-modal/test/__snapshots__/meta-boxes-section.js.snap +18 -18
- package/src/components/sidebar/plugin-document-setting-panel/index.js +6 -2
- package/src/editor.js +55 -85
- package/src/editor.native.js +4 -33
- package/src/hooks/commands/use-common-commands.js +77 -7
- package/src/index.js +2 -2
- package/src/index.native.js +1 -1
- package/src/store/actions.js +14 -33
- package/src/store/selectors.js +52 -26
- package/src/store/test/actions.js +9 -9
- package/src/style.scss +0 -1
- package/build/components/block-manager/category.js +0 -105
- package/build/components/block-manager/category.js.map +0 -1
- package/build/components/block-manager/checklist.js +0 -35
- package/build/components/block-manager/checklist.js.map +0 -1
- package/build/components/block-manager/index.js +0 -127
- package/build/components/block-manager/index.js.map +0 -1
- package/build/components/preferences-modal/options/enable-custom-fields.js.map +0 -1
- package/build/components/preferences-modal/options/enable-feature.js +0 -36
- package/build/components/preferences-modal/options/enable-feature.js.map +0 -1
- package/build/components/preferences-modal/options/enable-panel.js.map +0 -1
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +0 -32
- package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +0 -1
- package/build/components/preferences-modal/options/enable-publish-sidebar.js.map +0 -1
- package/build/components/preferences-modal/options/index.js +0 -42
- package/build/components/preferences-modal/options/index.js.map +0 -1
- package/build-module/components/block-manager/category.js +0 -96
- package/build-module/components/block-manager/category.js.map +0 -1
- package/build-module/components/block-manager/checklist.js +0 -27
- package/build-module/components/block-manager/checklist.js.map +0 -1
- package/build-module/components/block-manager/index.js +0 -118
- package/build-module/components/block-manager/index.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-feature.js +0 -29
- package/build-module/components/preferences-modal/options/enable-feature.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-panel.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +0 -24
- package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +0 -1
- package/build-module/components/preferences-modal/options/enable-publish-sidebar.js.map +0 -1
- package/build-module/components/preferences-modal/options/index.js +0 -6
- package/build-module/components/preferences-modal/options/index.js.map +0 -1
- package/src/components/block-manager/category.js +0 -94
- package/src/components/block-manager/checklist.js +0 -30
- package/src/components/block-manager/index.js +0 -158
- package/src/components/block-manager/style.scss +0 -82
- package/src/components/preferences-modal/options/enable-feature.js +0 -31
- package/src/components/preferences-modal/options/enable-plugin-document-setting-panel.js +0 -23
- package/src/components/preferences-modal/options/index.js +0 -5
- /package/src/components/preferences-modal/{options/test → test}/enable-custom-fields.js +0 -0
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { store as blocksStore } from '@wordpress/blocks';
|
|
6
|
-
import { withSelect, withDispatch } from '@wordpress/data';
|
|
7
|
-
import { SearchControl, Button } from '@wordpress/components';
|
|
8
|
-
import { __, _n, sprintf } from '@wordpress/i18n';
|
|
9
|
-
import { useEffect, useState } from '@wordpress/element';
|
|
10
|
-
import { useDebounce, compose } from '@wordpress/compose';
|
|
11
|
-
import { speak } from '@wordpress/a11y';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Internal dependencies
|
|
15
|
-
*/
|
|
16
|
-
import BlockManagerCategory from './category';
|
|
17
|
-
import { store as editPostStore } from '../../store';
|
|
18
|
-
function BlockManager({
|
|
19
|
-
blockTypes,
|
|
20
|
-
categories,
|
|
21
|
-
hasBlockSupport,
|
|
22
|
-
isMatchingSearchTerm,
|
|
23
|
-
numberOfHiddenBlocks,
|
|
24
|
-
enableAllBlockTypes
|
|
25
|
-
}) {
|
|
26
|
-
const debouncedSpeak = useDebounce(speak, 500);
|
|
27
|
-
const [search, setSearch] = useState('');
|
|
28
|
-
|
|
29
|
-
// Filtering occurs here (as opposed to `withSelect`) to avoid
|
|
30
|
-
// wasted renders by consequence of `Array#filter` producing
|
|
31
|
-
// a new value reference on each call.
|
|
32
|
-
blockTypes = blockTypes.filter(blockType => hasBlockSupport(blockType, 'inserter', true) && (!search || isMatchingSearchTerm(blockType, search)) && (!blockType.parent || blockType.parent.includes('core/post-content')));
|
|
33
|
-
|
|
34
|
-
// Announce search results on change
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
if (!search) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const count = blockTypes.length;
|
|
40
|
-
const resultsFoundMessage = sprintf( /* translators: %d: number of results. */
|
|
41
|
-
_n('%d result found.', '%d results found.', count), count);
|
|
42
|
-
debouncedSpeak(resultsFoundMessage);
|
|
43
|
-
}, [blockTypes.length, search, debouncedSpeak]);
|
|
44
|
-
return createElement("div", {
|
|
45
|
-
className: "edit-post-block-manager__content"
|
|
46
|
-
}, !!numberOfHiddenBlocks && createElement("div", {
|
|
47
|
-
className: "edit-post-block-manager__disabled-blocks-count"
|
|
48
|
-
}, sprintf( /* translators: %d: number of blocks. */
|
|
49
|
-
_n('%d block is hidden.', '%d blocks are hidden.', numberOfHiddenBlocks), numberOfHiddenBlocks), createElement(Button, {
|
|
50
|
-
variant: "link",
|
|
51
|
-
onClick: () => enableAllBlockTypes(blockTypes)
|
|
52
|
-
}, __('Reset'))), createElement(SearchControl, {
|
|
53
|
-
__nextHasNoMarginBottom: true,
|
|
54
|
-
label: __('Search for a block'),
|
|
55
|
-
placeholder: __('Search for a block'),
|
|
56
|
-
value: search,
|
|
57
|
-
onChange: nextSearch => setSearch(nextSearch),
|
|
58
|
-
className: "edit-post-block-manager__search"
|
|
59
|
-
}), createElement("div", {
|
|
60
|
-
tabIndex: "0",
|
|
61
|
-
role: "region",
|
|
62
|
-
"aria-label": __('Available block types'),
|
|
63
|
-
className: "edit-post-block-manager__results"
|
|
64
|
-
}, blockTypes.length === 0 && createElement("p", {
|
|
65
|
-
className: "edit-post-block-manager__no-results"
|
|
66
|
-
}, __('No blocks found.')), categories.map(category => createElement(BlockManagerCategory, {
|
|
67
|
-
key: category.slug,
|
|
68
|
-
title: category.title,
|
|
69
|
-
blockTypes: blockTypes.filter(blockType => blockType.category === category.slug)
|
|
70
|
-
})), createElement(BlockManagerCategory, {
|
|
71
|
-
title: __('Uncategorized'),
|
|
72
|
-
blockTypes: blockTypes.filter(({
|
|
73
|
-
category
|
|
74
|
-
}) => !category)
|
|
75
|
-
})));
|
|
76
|
-
}
|
|
77
|
-
export default compose([withSelect(select => {
|
|
78
|
-
const {
|
|
79
|
-
getBlockTypes,
|
|
80
|
-
getCategories,
|
|
81
|
-
hasBlockSupport,
|
|
82
|
-
isMatchingSearchTerm
|
|
83
|
-
} = select(blocksStore);
|
|
84
|
-
const {
|
|
85
|
-
getHiddenBlockTypes
|
|
86
|
-
} = select(editPostStore);
|
|
87
|
-
|
|
88
|
-
// Some hidden blocks become unregistered
|
|
89
|
-
// by removing for instance the plugin that registered them, yet
|
|
90
|
-
// they're still remain as hidden by the user's action.
|
|
91
|
-
// We consider "hidden", blocks which were hidden and
|
|
92
|
-
// are still registered.
|
|
93
|
-
const blockTypes = getBlockTypes();
|
|
94
|
-
const hiddenBlockTypes = getHiddenBlockTypes().filter(hiddenBlock => {
|
|
95
|
-
return blockTypes.some(registeredBlock => registeredBlock.name === hiddenBlock);
|
|
96
|
-
});
|
|
97
|
-
const numberOfHiddenBlocks = Array.isArray(hiddenBlockTypes) && hiddenBlockTypes.length;
|
|
98
|
-
return {
|
|
99
|
-
blockTypes,
|
|
100
|
-
categories: getCategories(),
|
|
101
|
-
hasBlockSupport,
|
|
102
|
-
isMatchingSearchTerm,
|
|
103
|
-
numberOfHiddenBlocks
|
|
104
|
-
};
|
|
105
|
-
}), withDispatch(dispatch => {
|
|
106
|
-
const {
|
|
107
|
-
showBlockTypes
|
|
108
|
-
} = dispatch(editPostStore);
|
|
109
|
-
return {
|
|
110
|
-
enableAllBlockTypes: blockTypes => {
|
|
111
|
-
const blockNames = blockTypes.map(({
|
|
112
|
-
name
|
|
113
|
-
}) => name);
|
|
114
|
-
showBlockTypes(blockNames);
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
})])(BlockManager);
|
|
118
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["store","blocksStore","withSelect","withDispatch","SearchControl","Button","__","_n","sprintf","useEffect","useState","useDebounce","compose","speak","BlockManagerCategory","editPostStore","BlockManager","blockTypes","categories","hasBlockSupport","isMatchingSearchTerm","numberOfHiddenBlocks","enableAllBlockTypes","debouncedSpeak","search","setSearch","filter","blockType","parent","includes","count","length","resultsFoundMessage","createElement","className","variant","onClick","__nextHasNoMarginBottom","label","placeholder","value","onChange","nextSearch","tabIndex","role","map","category","key","slug","title","select","getBlockTypes","getCategories","getHiddenBlockTypes","hiddenBlockTypes","hiddenBlock","some","registeredBlock","name","Array","isArray","dispatch","showBlockTypes","blockNames"],"sources":["@wordpress/edit-post/src/components/block-manager/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { SearchControl, Button } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEffect, useState } from '@wordpress/element';\nimport { useDebounce, compose } 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\tenableAllBlockTypes,\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\tblockType.parent.includes( '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\t<Button\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tonClick={ () => enableAllBlockTypes( blockTypes ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<SearchControl\n\t\t\t\t__nextHasNoMarginBottom\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={ blockTypes.filter(\n\t\t\t\t\t\t\t( blockType ) =>\n\t\t\t\t\t\t\t\tblockType.category === 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={ blockTypes.filter(\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 compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockTypes,\n\t\t\tgetCategories,\n\t\t\thasBlockSupport,\n\t\t\tisMatchingSearchTerm,\n\t\t} = select( blocksStore );\n\t\tconst { getHiddenBlockTypes } = select( editPostStore );\n\n\t\t// Some hidden blocks become unregistered\n\t\t// by removing for instance the plugin that registered them, yet\n\t\t// they're still remain as hidden by the user's action.\n\t\t// We consider \"hidden\", blocks which were hidden and\n\t\t// are still registered.\n\t\tconst blockTypes = getBlockTypes();\n\t\tconst hiddenBlockTypes = getHiddenBlockTypes().filter(\n\t\t\t( hiddenBlock ) => {\n\t\t\t\treturn blockTypes.some(\n\t\t\t\t\t( registeredBlock ) => registeredBlock.name === hiddenBlock\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t\tconst numberOfHiddenBlocks =\n\t\t\tArray.isArray( hiddenBlockTypes ) && hiddenBlockTypes.length;\n\n\t\treturn {\n\t\t\tblockTypes,\n\t\t\tcategories: getCategories(),\n\t\t\thasBlockSupport,\n\t\t\tisMatchingSearchTerm,\n\t\t\tnumberOfHiddenBlocks,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { showBlockTypes } = dispatch( editPostStore );\n\t\treturn {\n\t\t\tenableAllBlockTypes: ( blockTypes ) => {\n\t\t\t\tconst blockNames = blockTypes.map( ( { name } ) => name );\n\t\t\t\tshowBlockTypes( blockNames );\n\t\t\t},\n\t\t};\n\t} ),\n] )( BlockManager );\n"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useState","__","Button","withSelect","store","editorStore","___unstablePreferencesModalBaseOption","BaseOption","getPathAndQueryString","submitCustomFieldsForm","customFieldsForm","document","getElementById","querySelector","setAttribute","window","location","href","submit","CustomFieldsConfirmation","willEnable","isReloading","setIsReloading","createElement","Fragment","className","variant","isBusy","disabled","onClick","EnableCustomFieldsOption","label","areCustomFieldsEnabled","isChecked","setIsChecked","onChange","select","getEditorSettings","enableCustomFields"],"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-custom-fields.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';\nimport { getPathAndQueryString } from '@wordpress/url';\n\nfunction submitCustomFieldsForm() {\n\tconst customFieldsForm = document.getElementById(\n\t\t'toggle-custom-fields-form'\n\t);\n\n\t// Ensure the referrer values is up to update with any\n\tcustomFieldsForm\n\t\t.querySelector( '[name=\"_wp_http_referer\"]' )\n\t\t.setAttribute( 'value', getPathAndQueryString( window.location.href ) );\n\n\tcustomFieldsForm.submit();\n}\n\nexport function CustomFieldsConfirmation( { willEnable } ) {\n\tconst [ isReloading, setIsReloading ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<p className=\"edit-post-preferences-modal__custom-fields-confirmation-message\">\n\t\t\t\t{ __(\n\t\t\t\t\t'A page reload is required for this change. Make sure your content is saved before reloading.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-post-preferences-modal__custom-fields-confirmation-button\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isReloading }\n\t\t\t\tdisabled={ isReloading }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsReloading( true );\n\t\t\t\t\tsubmitCustomFieldsForm();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ willEnable\n\t\t\t\t\t? __( 'Show & Reload Page' )\n\t\t\t\t\t: __( 'Hide & Reload Page' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport function EnableCustomFieldsOption( { label, areCustomFieldsEnabled } ) {\n\tconst [ isChecked, setIsChecked ] = useState( areCustomFieldsEnabled );\n\n\treturn (\n\t\t<BaseOption\n\t\t\tlabel={ label }\n\t\t\tisChecked={ isChecked }\n\t\t\tonChange={ setIsChecked }\n\t\t>\n\t\t\t{ isChecked !== areCustomFieldsEnabled && (\n\t\t\t\t<CustomFieldsConfirmation willEnable={ isChecked } />\n\t\t\t) }\n\t\t</BaseOption>\n\t);\n}\n\nexport default withSelect( ( select ) => ( {\n\tareCustomFieldsEnabled:\n\t\t!! select( editorStore ).getEditorSettings().enableCustomFields,\n} ) )( EnableCustomFieldsOption );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,qCAAqC,IAAIC,UAAU,QAAQ,sBAAsB;AAC1F,SAASC,qBAAqB,QAAQ,gBAAgB;AAEtD,SAASC,sBAAsBA,CAAA,EAAG;EACjC,MAAMC,gBAAgB,GAAGC,QAAQ,CAACC,cAAc,CAC/C,2BACD,CAAC;;EAED;EACAF,gBAAgB,CACdG,aAAa,CAAE,2BAA4B,CAAC,CAC5CC,YAAY,CAAE,OAAO,EAAEN,qBAAqB,CAAEO,MAAM,CAACC,QAAQ,CAACC,IAAK,CAAE,CAAC;EAExEP,gBAAgB,CAACQ,MAAM,CAAC,CAAC;AAC1B;AAEA,OAAO,SAASC,wBAAwBA,CAAE;EAAEC;AAAW,CAAC,EAAG;EAC1D,MAAM,CAAEC,WAAW,EAAEC,cAAc,CAAE,GAAGtB,QAAQ,CAAE,KAAM,CAAC;EACzD,OACCuB,aAAA,CAAAC,QAAA,QACCD,aAAA;IAAGE,SAAS,EAAC;EAAiE,GAC3ExB,EAAE,CACH,8FACD,CACE,CAAC,EACJsB,aAAA,CAACrB,MAAM;IACNuB,SAAS,EAAC,gEAAgE;IAC1EC,OAAO,EAAC,WAAW;IACnBC,MAAM,EAAGN,WAAa;IACtBO,QAAQ,EAAGP,WAAa;IACxBQ,OAAO,EAAGA,CAAA,KAAM;MACfP,cAAc,CAAE,IAAK,CAAC;MACtBb,sBAAsB,CAAC,CAAC;IACzB;EAAG,GAEDW,UAAU,GACTnB,EAAE,CAAE,oBAAqB,CAAC,GAC1BA,EAAE,CAAE,oBAAqB,CACrB,CACP,CAAC;AAEL;AAEA,OAAO,SAAS6B,wBAAwBA,CAAE;EAAEC,KAAK;EAAEC;AAAuB,CAAC,EAAG;EAC7E,MAAM,CAAEC,SAAS,EAAEC,YAAY,CAAE,GAAGlC,QAAQ,CAAEgC,sBAAuB,CAAC;EAEtE,OACCT,aAAA,CAAChB,UAAU;IACVwB,KAAK,EAAGA,KAAO;IACfE,SAAS,EAAGA,SAAW;IACvBE,QAAQ,EAAGD;EAAc,GAEvBD,SAAS,KAAKD,sBAAsB,IACrCT,aAAA,CAACJ,wBAAwB;IAACC,UAAU,EAAGa;EAAW,CAAE,CAE1C,CAAC;AAEf;AAEA,eAAe9B,UAAU,CAAIiC,MAAM,KAAQ;EAC1CJ,sBAAsB,EACrB,CAAC,CAAEI,MAAM,CAAE/B,WAAY,CAAC,CAACgC,iBAAiB,CAAC,CAAC,CAACC;AAC/C,CAAC,CAAG,CAAC,CAAER,wBAAyB,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
|
-
import { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';
|
|
7
|
-
import { store as preferencesStore } from '@wordpress/preferences';
|
|
8
|
-
export default function EnableFeature(props) {
|
|
9
|
-
const {
|
|
10
|
-
scope = 'core/edit-post',
|
|
11
|
-
featureName,
|
|
12
|
-
onToggle = () => {},
|
|
13
|
-
...remainingProps
|
|
14
|
-
} = props;
|
|
15
|
-
const isChecked = useSelect(select => !!select(preferencesStore).get(scope, featureName), [scope, featureName]);
|
|
16
|
-
const {
|
|
17
|
-
toggle
|
|
18
|
-
} = useDispatch(preferencesStore);
|
|
19
|
-
const onChange = () => {
|
|
20
|
-
onToggle();
|
|
21
|
-
toggle(scope, featureName);
|
|
22
|
-
};
|
|
23
|
-
return createElement(BaseOption, {
|
|
24
|
-
onChange: onChange,
|
|
25
|
-
isChecked: isChecked,
|
|
26
|
-
...remainingProps
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=enable-feature.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useDispatch","___unstablePreferencesModalBaseOption","BaseOption","store","preferencesStore","EnableFeature","props","scope","featureName","onToggle","remainingProps","isChecked","select","get","toggle","onChange","createElement"],"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-feature.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\nexport default function EnableFeature( props ) {\n\tconst {\n\t\tscope = 'core/edit-post',\n\t\tfeatureName,\n\t\tonToggle = () => {},\n\t\t...remainingProps\n\t} = props;\n\tconst isChecked = useSelect(\n\t\t( select ) => !! select( preferencesStore ).get( scope, featureName ),\n\t\t[ scope, featureName ]\n\t);\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst onChange = () => {\n\t\tonToggle();\n\t\ttoggle( scope, featureName );\n\t};\n\treturn (\n\t\t<BaseOption\n\t\t\tonChange={ onChange }\n\t\t\tisChecked={ isChecked }\n\t\t\t{ ...remainingProps }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,qCAAqC,IAAIC,UAAU,QAAQ,sBAAsB;AAC1F,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAElE,eAAe,SAASC,aAAaA,CAAEC,KAAK,EAAG;EAC9C,MAAM;IACLC,KAAK,GAAG,gBAAgB;IACxBC,WAAW;IACXC,QAAQ,GAAGA,CAAA,KAAM,CAAC,CAAC;IACnB,GAAGC;EACJ,CAAC,GAAGJ,KAAK;EACT,MAAMK,SAAS,GAAGZ,SAAS,CACxBa,MAAM,IAAM,CAAC,CAAEA,MAAM,CAAER,gBAAiB,CAAC,CAACS,GAAG,CAAEN,KAAK,EAAEC,WAAY,CAAC,EACrE,CAAED,KAAK,EAAEC,WAAW,CACrB,CAAC;EACD,MAAM;IAAEM;EAAO,CAAC,GAAGd,WAAW,CAAEI,gBAAiB,CAAC;EAClD,MAAMW,QAAQ,GAAGA,CAAA,KAAM;IACtBN,QAAQ,CAAC,CAAC;IACVK,MAAM,CAAEP,KAAK,EAAEC,WAAY,CAAC;EAC7B,CAAC;EACD,OACCQ,aAAA,CAACd,UAAU;IACVa,QAAQ,EAAGA,QAAU;IACrBJ,SAAS,EAAGA,SAAW;IAAA,GAClBD;EAAc,CACnB,CAAC;AAEJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["compose","ifCondition","withSelect","withDispatch","___unstablePreferencesModalBaseOption","BaseOption","store","editorStore","select","panelName","isEditorPanelEnabled","isEditorPanelRemoved","isRemoved","isChecked","dispatch","onChange","toggleEditorPanelEnabled"],"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default compose(\n\twithSelect( ( select, { panelName } ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelRemoved } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( panelName ),\n\t\t\tisChecked: isEditorPanelEnabled( panelName ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\n\twithDispatch( ( dispatch, { panelName } ) => ( {\n\t\tonChange: () =>\n\t\t\tdispatch( editorStore ).toggleEditorPanelEnabled( panelName ),\n\t} ) )\n)( BaseOption );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACzD,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,qCAAqC,IAAIC,UAAU,QAAQ,sBAAsB;AAC1F,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AAExD,eAAeP,OAAO,CACrBE,UAAU,CAAE,CAAEM,MAAM,EAAE;EAAEC;AAAU,CAAC,KAAM;EACxC,MAAM;IAAEC,oBAAoB;IAAEC;EAAqB,CAAC,GACnDH,MAAM,CAAED,WAAY,CAAC;EACtB,OAAO;IACNK,SAAS,EAAED,oBAAoB,CAAEF,SAAU,CAAC;IAC5CI,SAAS,EAAEH,oBAAoB,CAAED,SAAU;EAC5C,CAAC;AACF,CAAE,CAAC,EACHR,WAAW,CAAE,CAAE;EAAEW;AAAU,CAAC,KAAM,CAAEA,SAAU,CAAC,EAC/CT,YAAY,CAAE,CAAEW,QAAQ,EAAE;EAAEL;AAAU,CAAC,MAAQ;EAC9CM,QAAQ,EAAEA,CAAA,KACTD,QAAQ,CAAEP,WAAY,CAAC,CAACS,wBAAwB,CAAEP,SAAU;AAC9D,CAAC,CAAG,CACL,CAAC,CAAEJ,UAAW,CAAC"}
|
package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { createSlotFill } from '@wordpress/components';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
import { EnablePanelOption } from './index';
|
|
11
|
-
const {
|
|
12
|
-
Fill,
|
|
13
|
-
Slot
|
|
14
|
-
} = createSlotFill('EnablePluginDocumentSettingPanelOption');
|
|
15
|
-
const EnablePluginDocumentSettingPanelOption = ({
|
|
16
|
-
label,
|
|
17
|
-
panelName
|
|
18
|
-
}) => createElement(Fill, null, createElement(EnablePanelOption, {
|
|
19
|
-
label: label,
|
|
20
|
-
panelName: panelName
|
|
21
|
-
}));
|
|
22
|
-
EnablePluginDocumentSettingPanelOption.Slot = Slot;
|
|
23
|
-
export default EnablePluginDocumentSettingPanelOption;
|
|
24
|
-
//# sourceMappingURL=enable-plugin-document-setting-panel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createSlotFill","EnablePanelOption","Fill","Slot","EnablePluginDocumentSettingPanelOption","label","panelName","createElement"],"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-plugin-document-setting-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { EnablePanelOption } from './index';\n\nconst { Fill, Slot } = createSlotFill(\n\t'EnablePluginDocumentSettingPanelOption'\n);\n\nconst EnablePluginDocumentSettingPanelOption = ( { label, panelName } ) => (\n\t<Fill>\n\t\t<EnablePanelOption label={ label } panelName={ panelName } />\n\t</Fill>\n);\n\nEnablePluginDocumentSettingPanelOption.Slot = Slot;\n\nexport default EnablePluginDocumentSettingPanelOption;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,cAAc,QAAQ,uBAAuB;;AAEtD;AACA;AACA;AACA,SAASC,iBAAiB,QAAQ,SAAS;AAE3C,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGH,cAAc,CACpC,wCACD,CAAC;AAED,MAAMI,sCAAsC,GAAGA,CAAE;EAAEC,KAAK;EAAEC;AAAU,CAAC,KACpEC,aAAA,CAACL,IAAI,QACJK,aAAA,CAACN,iBAAiB;EAACI,KAAK,EAAGA,KAAO;EAACC,SAAS,EAAGA;AAAW,CAAE,CACvD,CACN;AAEDF,sCAAsC,CAACD,IAAI,GAAGA,IAAI;AAElD,eAAeC,sCAAsC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["compose","withSelect","withDispatch","ifViewportMatches","store","editorStore","___unstablePreferencesModalBaseOption","BaseOption","select","isChecked","isPublishSidebarEnabled","dispatch","enablePublishSidebar","disablePublishSidebar","onChange","isEnabled"],"sources":["@wordpress/edit-post/src/components/preferences-modal/options/enable-publish-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { ifViewportMatches } from '@wordpress/viewport';\nimport { store as editorStore } from '@wordpress/editor';\nimport { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';\n\nexport default compose(\n\twithSelect( ( select ) => ( {\n\t\tisChecked: select( editorStore ).isPublishSidebarEnabled(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { enablePublishSidebar, disablePublishSidebar } =\n\t\t\tdispatch( editorStore );\n\t\treturn {\n\t\t\tonChange: ( isEnabled ) =>\n\t\t\t\tisEnabled ? enablePublishSidebar() : disablePublishSidebar(),\n\t\t};\n\t} ),\n\t// In < medium viewports we override this option and always show the publish sidebar.\n\t// See the edit-post's header component for the specific logic.\n\tifViewportMatches( 'medium' )\n)( BaseOption );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,iBAAiB,QAAQ,qBAAqB;AACvD,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AACxD,SAASC,qCAAqC,IAAIC,UAAU,QAAQ,sBAAsB;AAE1F,eAAeP,OAAO,CACrBC,UAAU,CAAIO,MAAM,KAAQ;EAC3BC,SAAS,EAAED,MAAM,CAAEH,WAAY,CAAC,CAACK,uBAAuB,CAAC;AAC1D,CAAC,CAAG,CAAC,EACLR,YAAY,CAAIS,QAAQ,IAAM;EAC7B,MAAM;IAAEC,oBAAoB;IAAEC;EAAsB,CAAC,GACpDF,QAAQ,CAAEN,WAAY,CAAC;EACxB,OAAO;IACNS,QAAQ,EAAIC,SAAS,IACpBA,SAAS,GAAGH,oBAAoB,CAAC,CAAC,GAAGC,qBAAqB,CAAC;EAC7D,CAAC;AACF,CAAE,CAAC;AACH;AACA;AACAV,iBAAiB,CAAE,QAAS,CAC7B,CAAC,CAAEI,UAAW,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { default as EnableCustomFieldsOption } from './enable-custom-fields';
|
|
2
|
-
export { default as EnablePanelOption } from './enable-panel';
|
|
3
|
-
export { default as EnablePluginDocumentSettingPanelOption } from './enable-plugin-document-setting-panel';
|
|
4
|
-
export { default as EnablePublishSidebarOption } from './enable-publish-sidebar';
|
|
5
|
-
export { default as EnableFeature } from './enable-feature';
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["default","EnableCustomFieldsOption","EnablePanelOption","EnablePluginDocumentSettingPanelOption","EnablePublishSidebarOption","EnableFeature"],"sources":["@wordpress/edit-post/src/components/preferences-modal/options/index.js"],"sourcesContent":["export { default as EnableCustomFieldsOption } from './enable-custom-fields';\nexport { default as EnablePanelOption } from './enable-panel';\nexport { default as EnablePluginDocumentSettingPanelOption } from './enable-plugin-document-setting-panel';\nexport { default as EnablePublishSidebarOption } from './enable-publish-sidebar';\nexport { default as EnableFeature } from './enable-feature';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,wBAAwB,QAAQ,wBAAwB;AAC5E,SAASD,OAAO,IAAIE,iBAAiB,QAAQ,gBAAgB;AAC7D,SAASF,OAAO,IAAIG,sCAAsC,QAAQ,wCAAwC;AAC1G,SAASH,OAAO,IAAII,0BAA0B,QAAQ,0BAA0B;AAChF,SAASJ,OAAO,IAAIK,aAAa,QAAQ,kBAAkB"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useMemo, useCallback } from '@wordpress/element';
|
|
5
|
-
import { useDispatch, useSelect } from '@wordpress/data';
|
|
6
|
-
import { useInstanceId } from '@wordpress/compose';
|
|
7
|
-
import { CheckboxControl } from '@wordpress/components';
|
|
8
|
-
import { store as editorStore } from '@wordpress/editor';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
|
-
import BlockTypesChecklist from './checklist';
|
|
14
|
-
import { store as editPostStore } from '../../store';
|
|
15
|
-
|
|
16
|
-
function BlockManagerCategory( { title, blockTypes } ) {
|
|
17
|
-
const instanceId = useInstanceId( BlockManagerCategory );
|
|
18
|
-
const { defaultAllowedBlockTypes, hiddenBlockTypes } = useSelect(
|
|
19
|
-
( select ) => {
|
|
20
|
-
const { getEditorSettings } = select( editorStore );
|
|
21
|
-
const { getHiddenBlockTypes } = select( editPostStore );
|
|
22
|
-
return {
|
|
23
|
-
defaultAllowedBlockTypes:
|
|
24
|
-
getEditorSettings().defaultAllowedBlockTypes,
|
|
25
|
-
hiddenBlockTypes: getHiddenBlockTypes(),
|
|
26
|
-
};
|
|
27
|
-
},
|
|
28
|
-
[]
|
|
29
|
-
);
|
|
30
|
-
const filteredBlockTypes = useMemo( () => {
|
|
31
|
-
if ( defaultAllowedBlockTypes === true ) {
|
|
32
|
-
return blockTypes;
|
|
33
|
-
}
|
|
34
|
-
return blockTypes.filter( ( { name } ) => {
|
|
35
|
-
return defaultAllowedBlockTypes?.includes( name );
|
|
36
|
-
} );
|
|
37
|
-
}, [ defaultAllowedBlockTypes, blockTypes ] );
|
|
38
|
-
const { showBlockTypes, hideBlockTypes } = useDispatch( editPostStore );
|
|
39
|
-
const toggleVisible = useCallback( ( blockName, nextIsChecked ) => {
|
|
40
|
-
if ( nextIsChecked ) {
|
|
41
|
-
showBlockTypes( blockName );
|
|
42
|
-
} else {
|
|
43
|
-
hideBlockTypes( blockName );
|
|
44
|
-
}
|
|
45
|
-
}, [] );
|
|
46
|
-
const toggleAllVisible = useCallback(
|
|
47
|
-
( nextIsChecked ) => {
|
|
48
|
-
const blockNames = blockTypes.map( ( { name } ) => name );
|
|
49
|
-
if ( nextIsChecked ) {
|
|
50
|
-
showBlockTypes( blockNames );
|
|
51
|
-
} else {
|
|
52
|
-
hideBlockTypes( blockNames );
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
[ blockTypes ]
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
if ( ! filteredBlockTypes.length ) {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const checkedBlockNames = filteredBlockTypes
|
|
63
|
-
.map( ( { name } ) => name )
|
|
64
|
-
.filter( ( type ) => ! hiddenBlockTypes.includes( type ) );
|
|
65
|
-
|
|
66
|
-
const titleId = 'edit-post-block-manager__category-title-' + instanceId;
|
|
67
|
-
|
|
68
|
-
const isAllChecked = checkedBlockNames.length === filteredBlockTypes.length;
|
|
69
|
-
const isIndeterminate = ! isAllChecked && checkedBlockNames.length > 0;
|
|
70
|
-
|
|
71
|
-
return (
|
|
72
|
-
<div
|
|
73
|
-
role="group"
|
|
74
|
-
aria-labelledby={ titleId }
|
|
75
|
-
className="edit-post-block-manager__category"
|
|
76
|
-
>
|
|
77
|
-
<CheckboxControl
|
|
78
|
-
__nextHasNoMarginBottom
|
|
79
|
-
checked={ isAllChecked }
|
|
80
|
-
onChange={ toggleAllVisible }
|
|
81
|
-
className="edit-post-block-manager__category-title"
|
|
82
|
-
indeterminate={ isIndeterminate }
|
|
83
|
-
label={ <span id={ titleId }>{ title }</span> }
|
|
84
|
-
/>
|
|
85
|
-
<BlockTypesChecklist
|
|
86
|
-
blockTypes={ filteredBlockTypes }
|
|
87
|
-
value={ checkedBlockNames }
|
|
88
|
-
onItemChange={ toggleVisible }
|
|
89
|
-
/>
|
|
90
|
-
</div>
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export default BlockManagerCategory;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { BlockIcon } from '@wordpress/block-editor';
|
|
5
|
-
import { CheckboxControl } from '@wordpress/components';
|
|
6
|
-
|
|
7
|
-
function BlockTypesChecklist( { blockTypes, value, onItemChange } ) {
|
|
8
|
-
return (
|
|
9
|
-
<ul className="edit-post-block-manager__checklist">
|
|
10
|
-
{ blockTypes.map( ( blockType ) => (
|
|
11
|
-
<li
|
|
12
|
-
key={ blockType.name }
|
|
13
|
-
className="edit-post-block-manager__checklist-item"
|
|
14
|
-
>
|
|
15
|
-
<CheckboxControl
|
|
16
|
-
__nextHasNoMarginBottom
|
|
17
|
-
label={ blockType.title }
|
|
18
|
-
checked={ value.includes( blockType.name ) }
|
|
19
|
-
onChange={ ( ...args ) =>
|
|
20
|
-
onItemChange( blockType.name, ...args )
|
|
21
|
-
}
|
|
22
|
-
/>
|
|
23
|
-
<BlockIcon icon={ blockType.icon } />
|
|
24
|
-
</li>
|
|
25
|
-
) ) }
|
|
26
|
-
</ul>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default BlockTypesChecklist;
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { store as blocksStore } from '@wordpress/blocks';
|
|
5
|
-
import { withSelect, withDispatch } from '@wordpress/data';
|
|
6
|
-
import { SearchControl, Button } from '@wordpress/components';
|
|
7
|
-
import { __, _n, sprintf } from '@wordpress/i18n';
|
|
8
|
-
import { useEffect, useState } from '@wordpress/element';
|
|
9
|
-
import { useDebounce, compose } from '@wordpress/compose';
|
|
10
|
-
import { speak } from '@wordpress/a11y';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
|
-
import BlockManagerCategory from './category';
|
|
16
|
-
import { store as editPostStore } from '../../store';
|
|
17
|
-
|
|
18
|
-
function BlockManager( {
|
|
19
|
-
blockTypes,
|
|
20
|
-
categories,
|
|
21
|
-
hasBlockSupport,
|
|
22
|
-
isMatchingSearchTerm,
|
|
23
|
-
numberOfHiddenBlocks,
|
|
24
|
-
enableAllBlockTypes,
|
|
25
|
-
} ) {
|
|
26
|
-
const debouncedSpeak = useDebounce( speak, 500 );
|
|
27
|
-
const [ search, setSearch ] = useState( '' );
|
|
28
|
-
|
|
29
|
-
// Filtering occurs here (as opposed to `withSelect`) to avoid
|
|
30
|
-
// wasted renders by consequence of `Array#filter` producing
|
|
31
|
-
// a new value reference on each call.
|
|
32
|
-
blockTypes = blockTypes.filter(
|
|
33
|
-
( blockType ) =>
|
|
34
|
-
hasBlockSupport( blockType, 'inserter', true ) &&
|
|
35
|
-
( ! search || isMatchingSearchTerm( blockType, search ) ) &&
|
|
36
|
-
( ! blockType.parent ||
|
|
37
|
-
blockType.parent.includes( 'core/post-content' ) )
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
// Announce search results on change
|
|
41
|
-
useEffect( () => {
|
|
42
|
-
if ( ! search ) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
const count = blockTypes.length;
|
|
46
|
-
const resultsFoundMessage = sprintf(
|
|
47
|
-
/* translators: %d: number of results. */
|
|
48
|
-
_n( '%d result found.', '%d results found.', count ),
|
|
49
|
-
count
|
|
50
|
-
);
|
|
51
|
-
debouncedSpeak( resultsFoundMessage );
|
|
52
|
-
}, [ blockTypes.length, search, debouncedSpeak ] );
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
<div className="edit-post-block-manager__content">
|
|
56
|
-
{ !! numberOfHiddenBlocks && (
|
|
57
|
-
<div className="edit-post-block-manager__disabled-blocks-count">
|
|
58
|
-
{ sprintf(
|
|
59
|
-
/* translators: %d: number of blocks. */
|
|
60
|
-
_n(
|
|
61
|
-
'%d block is hidden.',
|
|
62
|
-
'%d blocks are hidden.',
|
|
63
|
-
numberOfHiddenBlocks
|
|
64
|
-
),
|
|
65
|
-
numberOfHiddenBlocks
|
|
66
|
-
) }
|
|
67
|
-
<Button
|
|
68
|
-
variant="link"
|
|
69
|
-
onClick={ () => enableAllBlockTypes( blockTypes ) }
|
|
70
|
-
>
|
|
71
|
-
{ __( 'Reset' ) }
|
|
72
|
-
</Button>
|
|
73
|
-
</div>
|
|
74
|
-
) }
|
|
75
|
-
<SearchControl
|
|
76
|
-
__nextHasNoMarginBottom
|
|
77
|
-
label={ __( 'Search for a block' ) }
|
|
78
|
-
placeholder={ __( 'Search for a block' ) }
|
|
79
|
-
value={ search }
|
|
80
|
-
onChange={ ( nextSearch ) => setSearch( nextSearch ) }
|
|
81
|
-
className="edit-post-block-manager__search"
|
|
82
|
-
/>
|
|
83
|
-
<div
|
|
84
|
-
tabIndex="0"
|
|
85
|
-
role="region"
|
|
86
|
-
aria-label={ __( 'Available block types' ) }
|
|
87
|
-
className="edit-post-block-manager__results"
|
|
88
|
-
>
|
|
89
|
-
{ blockTypes.length === 0 && (
|
|
90
|
-
<p className="edit-post-block-manager__no-results">
|
|
91
|
-
{ __( 'No blocks found.' ) }
|
|
92
|
-
</p>
|
|
93
|
-
) }
|
|
94
|
-
{ categories.map( ( category ) => (
|
|
95
|
-
<BlockManagerCategory
|
|
96
|
-
key={ category.slug }
|
|
97
|
-
title={ category.title }
|
|
98
|
-
blockTypes={ blockTypes.filter(
|
|
99
|
-
( blockType ) =>
|
|
100
|
-
blockType.category === category.slug
|
|
101
|
-
) }
|
|
102
|
-
/>
|
|
103
|
-
) ) }
|
|
104
|
-
<BlockManagerCategory
|
|
105
|
-
title={ __( 'Uncategorized' ) }
|
|
106
|
-
blockTypes={ blockTypes.filter(
|
|
107
|
-
( { category } ) => ! category
|
|
108
|
-
) }
|
|
109
|
-
/>
|
|
110
|
-
</div>
|
|
111
|
-
</div>
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export default compose( [
|
|
116
|
-
withSelect( ( select ) => {
|
|
117
|
-
const {
|
|
118
|
-
getBlockTypes,
|
|
119
|
-
getCategories,
|
|
120
|
-
hasBlockSupport,
|
|
121
|
-
isMatchingSearchTerm,
|
|
122
|
-
} = select( blocksStore );
|
|
123
|
-
const { getHiddenBlockTypes } = select( editPostStore );
|
|
124
|
-
|
|
125
|
-
// Some hidden blocks become unregistered
|
|
126
|
-
// by removing for instance the plugin that registered them, yet
|
|
127
|
-
// they're still remain as hidden by the user's action.
|
|
128
|
-
// We consider "hidden", blocks which were hidden and
|
|
129
|
-
// are still registered.
|
|
130
|
-
const blockTypes = getBlockTypes();
|
|
131
|
-
const hiddenBlockTypes = getHiddenBlockTypes().filter(
|
|
132
|
-
( hiddenBlock ) => {
|
|
133
|
-
return blockTypes.some(
|
|
134
|
-
( registeredBlock ) => registeredBlock.name === hiddenBlock
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
);
|
|
138
|
-
const numberOfHiddenBlocks =
|
|
139
|
-
Array.isArray( hiddenBlockTypes ) && hiddenBlockTypes.length;
|
|
140
|
-
|
|
141
|
-
return {
|
|
142
|
-
blockTypes,
|
|
143
|
-
categories: getCategories(),
|
|
144
|
-
hasBlockSupport,
|
|
145
|
-
isMatchingSearchTerm,
|
|
146
|
-
numberOfHiddenBlocks,
|
|
147
|
-
};
|
|
148
|
-
} ),
|
|
149
|
-
withDispatch( ( dispatch ) => {
|
|
150
|
-
const { showBlockTypes } = dispatch( editPostStore );
|
|
151
|
-
return {
|
|
152
|
-
enableAllBlockTypes: ( blockTypes ) => {
|
|
153
|
-
const blockNames = blockTypes.map( ( { name } ) => name );
|
|
154
|
-
showBlockTypes( blockNames );
|
|
155
|
-
},
|
|
156
|
-
};
|
|
157
|
-
} ),
|
|
158
|
-
] )( BlockManager );
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
.edit-post-block-manager__no-results {
|
|
2
|
-
font-style: italic;
|
|
3
|
-
padding: $grid-unit-30 0;
|
|
4
|
-
text-align: center;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.edit-post-block-manager__search {
|
|
8
|
-
margin: $grid-unit-20 0;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.edit-post-block-manager__disabled-blocks-count {
|
|
12
|
-
border: 1px solid $gray-300;
|
|
13
|
-
border-width: 1px 0;
|
|
14
|
-
// Cover up horizontal areas off the sides of the box rectangle
|
|
15
|
-
box-shadow: -$grid-unit-40 0 0 0 $white, $grid-unit-40 0 0 0 $white;
|
|
16
|
-
padding: $grid-unit-10;
|
|
17
|
-
background-color: $white;
|
|
18
|
-
text-align: center;
|
|
19
|
-
position: sticky;
|
|
20
|
-
// When sticking, tuck the top border beneath the modal header border
|
|
21
|
-
top: ($grid-unit-05 + 1) * -1;
|
|
22
|
-
z-index: z-index(".edit-post-block-manager__disabled-blocks-count");
|
|
23
|
-
|
|
24
|
-
// Stick the category titles to the bottom
|
|
25
|
-
~ .edit-post-block-manager__results .edit-post-block-manager__category-title {
|
|
26
|
-
top: $grid-unit-40 - 1;
|
|
27
|
-
}
|
|
28
|
-
.is-link {
|
|
29
|
-
margin-left: 12px;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.edit-post-block-manager__category {
|
|
34
|
-
margin: 0 0 $grid-unit-30 0;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.edit-post-block-manager__category-title {
|
|
38
|
-
position: sticky;
|
|
39
|
-
top: - $grid-unit-05; // Offsets the top padding on the modal content container
|
|
40
|
-
padding: $grid-unit-20 0;
|
|
41
|
-
background-color: $white;
|
|
42
|
-
z-index: z-index(".edit-post-block-manager__category-title");
|
|
43
|
-
|
|
44
|
-
.components-checkbox-control__label {
|
|
45
|
-
font-weight: 600;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.edit-post-block-manager__checklist {
|
|
50
|
-
margin-top: 0;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.edit-post-block-manager__category-title,
|
|
54
|
-
.edit-post-block-manager__checklist-item {
|
|
55
|
-
border-bottom: 1px solid $gray-300;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.edit-post-block-manager__checklist-item {
|
|
59
|
-
display: flex;
|
|
60
|
-
justify-content: space-between;
|
|
61
|
-
align-items: center;
|
|
62
|
-
margin-bottom: 0;
|
|
63
|
-
padding: $grid-unit-10 0 $grid-unit-10 $grid-unit-20;
|
|
64
|
-
|
|
65
|
-
.components-modal__content &.components-checkbox-control__input-container {
|
|
66
|
-
margin: 0 $grid-unit-10;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.block-editor-block-icon {
|
|
70
|
-
margin-right: 10px;
|
|
71
|
-
fill: $gray-900;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.edit-post-block-manager__results {
|
|
76
|
-
border-top: $border-width solid $gray-300;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Remove the top border from results when adjacent to the disabled block count
|
|
80
|
-
.edit-post-block-manager__disabled-blocks-count + .edit-post-block-manager__results {
|
|
81
|
-
border-top-width: 0;
|
|
82
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
|
-
import { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';
|
|
6
|
-
import { store as preferencesStore } from '@wordpress/preferences';
|
|
7
|
-
|
|
8
|
-
export default function EnableFeature( props ) {
|
|
9
|
-
const {
|
|
10
|
-
scope = 'core/edit-post',
|
|
11
|
-
featureName,
|
|
12
|
-
onToggle = () => {},
|
|
13
|
-
...remainingProps
|
|
14
|
-
} = props;
|
|
15
|
-
const isChecked = useSelect(
|
|
16
|
-
( select ) => !! select( preferencesStore ).get( scope, featureName ),
|
|
17
|
-
[ scope, featureName ]
|
|
18
|
-
);
|
|
19
|
-
const { toggle } = useDispatch( preferencesStore );
|
|
20
|
-
const onChange = () => {
|
|
21
|
-
onToggle();
|
|
22
|
-
toggle( scope, featureName );
|
|
23
|
-
};
|
|
24
|
-
return (
|
|
25
|
-
<BaseOption
|
|
26
|
-
onChange={ onChange }
|
|
27
|
-
isChecked={ isChecked }
|
|
28
|
-
{ ...remainingProps }
|
|
29
|
-
/>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { createSlotFill } from '@wordpress/components';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import { EnablePanelOption } from './index';
|
|
10
|
-
|
|
11
|
-
const { Fill, Slot } = createSlotFill(
|
|
12
|
-
'EnablePluginDocumentSettingPanelOption'
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
const EnablePluginDocumentSettingPanelOption = ( { label, panelName } ) => (
|
|
16
|
-
<Fill>
|
|
17
|
-
<EnablePanelOption label={ label } panelName={ panelName } />
|
|
18
|
-
</Fill>
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
EnablePluginDocumentSettingPanelOption.Slot = Slot;
|
|
22
|
-
|
|
23
|
-
export default EnablePluginDocumentSettingPanelOption;
|