@wordpress/customize-widgets 4.16.0 → 4.17.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/block-appender/index.js +6 -8
- package/build/components/block-appender/index.js.map +1 -1
- package/build/components/block-inspector-button/index.js +3 -9
- package/build/components/block-inspector-button/index.js.map +1 -1
- package/build/components/customize-widgets/index.js +4 -12
- package/build/components/customize-widgets/index.js.map +1 -1
- package/build/components/customize-widgets/use-clear-selected-block.js +12 -15
- package/build/components/customize-widgets/use-clear-selected-block.js.map +1 -1
- package/build/components/error-boundary/index.js +1 -14
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/focus-control/index.js +1 -12
- package/build/components/focus-control/index.js.map +1 -1
- package/build/components/focus-control/use-blocks-focus-control.js +3 -9
- package/build/components/focus-control/use-blocks-focus-control.js.map +1 -1
- package/build/components/header/index.js +7 -18
- package/build/components/header/index.js.map +1 -1
- package/build/components/inserter/index.js +1 -10
- package/build/components/inserter/index.js.map +1 -1
- package/build/components/inserter/use-inserter.js +1 -6
- package/build/components/inserter/use-inserter.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +1 -2
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -9
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +4 -20
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +1 -6
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +1 -16
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/more-menu/index.js +2 -15
- package/build/components/more-menu/index.js.map +1 -1
- package/build/components/sidebar-block-editor/index.js +5 -22
- package/build/components/sidebar-block-editor/index.js.map +1 -1
- package/build/components/sidebar-block-editor/sidebar-adapter.js +13 -75
- package/build/components/sidebar-block-editor/sidebar-adapter.js.map +1 -1
- package/build/components/sidebar-block-editor/sidebar-editor-provider.js +1 -8
- package/build/components/sidebar-block-editor/sidebar-editor-provider.js.map +1 -1
- package/build/components/sidebar-block-editor/use-sidebar-block-editor.js +14 -24
- package/build/components/sidebar-block-editor/use-sidebar-block-editor.js.map +1 -1
- package/build/components/sidebar-controls/index.js +1 -5
- package/build/components/sidebar-controls/index.js.map +1 -1
- package/build/components/welcome-guide/index.js +1 -6
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/controls/inserter-outer-section.js +15 -24
- package/build/controls/inserter-outer-section.js.map +1 -1
- package/build/controls/inspector-section.js +0 -12
- package/build/controls/inspector-section.js.map +1 -1
- package/build/controls/sidebar-control.js +1 -12
- package/build/controls/sidebar-control.js.map +1 -1
- package/build/controls/sidebar-section.js +3 -14
- package/build/controls/sidebar-section.js.map +1 -1
- package/build/filters/index.js +0 -2
- package/build/filters/index.js.map +1 -1
- package/build/filters/move-to-sidebar.js +7 -17
- package/build/filters/move-to-sidebar.js.map +1 -1
- package/build/filters/replace-media-upload.js +1 -3
- package/build/filters/replace-media-upload.js.map +1 -1
- package/build/filters/wide-widget-display.js +3 -5
- package/build/filters/wide-widget-display.js.map +1 -1
- package/build/index.js +5 -20
- package/build/index.js.map +1 -1
- package/build/lock-unlock.js +1 -2
- package/build/lock-unlock.js.map +1 -1
- package/build/store/actions.js +0 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +0 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/index.js +1 -10
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +0 -5
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +9 -10
- package/build/store/selectors.js.map +1 -1
- package/build/utils.js +8 -18
- package/build/utils.js.map +1 -1
- package/build-module/components/block-appender/index.js +5 -5
- package/build-module/components/block-appender/index.js.map +1 -1
- package/build-module/components/block-inspector-button/index.js +2 -5
- package/build-module/components/block-inspector-button/index.js.map +1 -1
- package/build-module/components/customize-widgets/index.js +4 -4
- package/build-module/components/customize-widgets/index.js.map +1 -1
- package/build-module/components/customize-widgets/use-clear-selected-block.js +13 -12
- package/build-module/components/customize-widgets/use-clear-selected-block.js.map +1 -1
- package/build-module/components/error-boundary/index.js +0 -8
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/focus-control/index.js +1 -8
- package/build-module/components/focus-control/index.js.map +1 -1
- package/build-module/components/focus-control/use-blocks-focus-control.js +3 -4
- package/build-module/components/focus-control/use-blocks-focus-control.js.map +1 -1
- package/build-module/components/header/index.js +8 -11
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/inserter/index.js +1 -4
- package/build-module/components/inserter/index.js.map +1 -1
- package/build-module/components/inserter/use-inserter.js +1 -3
- package/build-module/components/inserter/use-inserter.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +1 -6
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +5 -13
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -5
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +0 -9
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/more-menu/index.js +2 -6
- package/build-module/components/more-menu/index.js.map +1 -1
- package/build-module/components/sidebar-block-editor/index.js +5 -9
- package/build-module/components/sidebar-block-editor/index.js.map +1 -1
- package/build-module/components/sidebar-block-editor/sidebar-adapter.js +12 -72
- package/build-module/components/sidebar-block-editor/sidebar-adapter.js.map +1 -1
- package/build-module/components/sidebar-block-editor/sidebar-editor-provider.js +1 -2
- package/build-module/components/sidebar-block-editor/sidebar-editor-provider.js.map +1 -1
- package/build-module/components/sidebar-block-editor/use-sidebar-block-editor.js +15 -20
- package/build-module/components/sidebar-block-editor/use-sidebar-block-editor.js.map +1 -1
- package/build-module/components/sidebar-controls/index.js +0 -1
- package/build-module/components/sidebar-controls/index.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +0 -1
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/controls/inserter-outer-section.js +15 -20
- package/build-module/controls/inserter-outer-section.js.map +1 -1
- package/build-module/controls/inspector-section.js +0 -11
- package/build-module/controls/inspector-section.js.map +1 -1
- package/build-module/controls/sidebar-control.js +1 -8
- package/build-module/controls/sidebar-control.js.map +1 -1
- package/build-module/controls/sidebar-section.js +3 -12
- package/build-module/controls/sidebar-section.js.map +1 -1
- package/build-module/filters/index.js.map +1 -1
- package/build-module/filters/move-to-sidebar.js +7 -10
- package/build-module/filters/move-to-sidebar.js.map +1 -1
- package/build-module/filters/replace-media-upload.js +0 -2
- package/build-module/filters/replace-media-upload.js.map +1 -1
- package/build-module/filters/wide-widget-display.js +2 -3
- package/build-module/filters/wide-widget-display.js.map +1 -1
- package/build-module/index.js +5 -10
- package/build-module/index.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/index.js +3 -3
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js +1 -3
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +10 -9
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils.js +9 -14
- package/build-module/utils.js.map +1 -1
- package/package.json +22 -22
- package/src/store/selectors.js +10 -2
package/build-module/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* WordPress dependencies
|
|
5
4
|
*/
|
|
@@ -9,10 +8,10 @@ import { registerLegacyWidgetBlock, registerLegacyWidgetVariations, registerWidg
|
|
|
9
8
|
import { setFreeformContentHandlerName, store as blocksStore } from '@wordpress/blocks';
|
|
10
9
|
import { dispatch } from '@wordpress/data';
|
|
11
10
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
11
|
+
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
15
|
import CustomizeWidgets from './components/customize-widgets';
|
|
17
16
|
import getSidebarSection from './controls/sidebar-section';
|
|
18
17
|
import getSidebarControl from './controls/sidebar-control';
|
|
@@ -22,40 +21,36 @@ const {
|
|
|
22
21
|
} = window;
|
|
23
22
|
const DISABLED_BLOCKS = ['core/more', 'core/block', 'core/freeform', 'core/template-part'];
|
|
24
23
|
const ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;
|
|
24
|
+
|
|
25
25
|
/**
|
|
26
26
|
* Initializes the widgets block editor in the customizer.
|
|
27
27
|
*
|
|
28
28
|
* @param {string} editorName The editor name.
|
|
29
29
|
* @param {Object} blockEditorSettings Block editor settings.
|
|
30
30
|
*/
|
|
31
|
-
|
|
32
31
|
export function initialize(editorName, blockEditorSettings) {
|
|
33
32
|
dispatch(preferencesStore).setDefaults('core/customize-widgets', {
|
|
34
33
|
fixedToolbar: false,
|
|
35
34
|
welcomeGuide: true
|
|
36
35
|
});
|
|
37
|
-
|
|
38
36
|
dispatch(blocksStore).__experimentalReapplyBlockTypeFilters();
|
|
39
|
-
|
|
40
37
|
const coreBlocks = __experimentalGetCoreBlocks().filter(block => {
|
|
41
38
|
return !(DISABLED_BLOCKS.includes(block.name) || block.name.startsWith('core/post') || block.name.startsWith('core/query') || block.name.startsWith('core/site') || block.name.startsWith('core/navigation'));
|
|
42
39
|
});
|
|
43
|
-
|
|
44
40
|
registerCoreBlocks(coreBlocks);
|
|
45
41
|
registerLegacyWidgetBlock();
|
|
46
|
-
|
|
47
42
|
if (process.env.IS_GUTENBERG_PLUGIN) {
|
|
48
43
|
__experimentalRegisterExperimentalCoreBlocks({
|
|
49
44
|
enableFSEBlocks: ENABLE_EXPERIMENTAL_FSE_BLOCKS
|
|
50
45
|
});
|
|
51
46
|
}
|
|
52
|
-
|
|
53
47
|
registerLegacyWidgetVariations(blockEditorSettings);
|
|
54
|
-
registerWidgetGroupBlock();
|
|
48
|
+
registerWidgetGroupBlock();
|
|
49
|
+
|
|
50
|
+
// As we are unregistering `core/freeform` to avoid the Classic block, we must
|
|
55
51
|
// replace it with something as the default freeform content handler. Failure to
|
|
56
52
|
// do this will result in errors in the default block parser.
|
|
57
53
|
// see: https://github.com/WordPress/gutenberg/issues/33097
|
|
58
|
-
|
|
59
54
|
setFreeformContentHandlerName('core/html');
|
|
60
55
|
const SidebarControl = getSidebarControl(blockEditorSettings);
|
|
61
56
|
wp.customize.sectionConstructor.sidebar = getSidebarSection();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["createRoot","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","registerLegacyWidgetBlock","registerLegacyWidgetVariations","registerWidgetGroupBlock","setFreeformContentHandlerName","store","blocksStore","dispatch","preferencesStore","CustomizeWidgets","getSidebarSection","getSidebarControl","wp","window","DISABLED_BLOCKS","ENABLE_EXPERIMENTAL_FSE_BLOCKS","initialize","editorName","blockEditorSettings","setDefaults","fixedToolbar","welcomeGuide","__experimentalReapplyBlockTypeFilters","coreBlocks","filter","block","includes","name","startsWith","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","SidebarControl","customize","sectionConstructor","sidebar","controlConstructor","sidebar_block_editor","container","document","createElement","body","appendChild","bind","sidebarControls","control","each","push","render","api"],"sources":["@wordpress/customize-widgets/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRoot } from '@wordpress/element';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterLegacyWidgetVariations,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tsetFreeformContentHandlerName,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport CustomizeWidgets from './components/customize-widgets';\nimport getSidebarSection from './controls/sidebar-section';\nimport getSidebarControl from './controls/sidebar-control';\nimport './filters';\n\nconst { wp } = window;\n\nconst DISABLED_BLOCKS = [\n\t'core/more',\n\t'core/block',\n\t'core/freeform',\n\t'core/template-part',\n];\nconst ENABLE_EXPERIMENTAL_FSE_BLOCKS = false;\n\n/**\n * Initializes the widgets block editor in the customizer.\n *\n * @param {string} editorName The editor name.\n * @param {Object} blockEditorSettings Block editor settings.\n */\nexport function initialize( editorName, blockEditorSettings ) {\n\tdispatch( preferencesStore ).setDefaults( 'core/customize-widgets', {\n\t\tfixedToolbar: false,\n\t\twelcomeGuide: true,\n\t} );\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter( ( block ) => {\n\t\treturn ! (\n\t\t\tDISABLED_BLOCKS.includes( block.name ) ||\n\t\t\tblock.name.startsWith( 'core/post' ) ||\n\t\t\tblock.name.startsWith( 'core/query' ) ||\n\t\t\tblock.name.startsWith( 'core/site' ) ||\n\t\t\tblock.name.startsWith( 'core/navigation' )\n\t\t);\n\t} );\n\tregisterCoreBlocks( coreBlocks );\n\tregisterLegacyWidgetBlock();\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: ENABLE_EXPERIMENTAL_FSE_BLOCKS,\n\t\t} );\n\t}\n\tregisterLegacyWidgetVariations( blockEditorSettings );\n\tregisterWidgetGroupBlock();\n\n\t// As we are unregistering `core/freeform` to avoid the Classic block, we must\n\t// replace it with something as the default freeform content handler. Failure to\n\t// do this will result in errors in the default block parser.\n\t// see: https://github.com/WordPress/gutenberg/issues/33097\n\tsetFreeformContentHandlerName( 'core/html' );\n\n\tconst SidebarControl = getSidebarControl( blockEditorSettings );\n\n\twp.customize.sectionConstructor.sidebar = getSidebarSection();\n\twp.customize.controlConstructor.sidebar_block_editor = SidebarControl;\n\n\tconst container = document.createElement( 'div' );\n\tdocument.body.appendChild( container );\n\n\twp.customize.bind( 'ready', () => {\n\t\tconst sidebarControls = [];\n\t\twp.customize.control.each( ( control ) => {\n\t\t\tif ( control instanceof SidebarControl ) {\n\t\t\t\tsidebarControls.push( control );\n\t\t\t}\n\t\t} );\n\n\t\tcreateRoot( container ).render(\n\t\t\t<CustomizeWidgets\n\t\t\t\tapi={ wp.customize }\n\t\t\t\tsidebarControls={ sidebarControls }\n\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t/>\n\t\t);\n\t} );\n}\nexport { store } from './store';\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"sources":["@wordpress/customize-widgets/src/lock-unlock.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',\n\t\t'@wordpress/customize-widgets'\n\t);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAgD,QAAQ,yBAAyB;AAE1F,OAAO,MAAM;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAC5BF,gDAAgD,CAC/C,8GAA8G,EAC9G,8BACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["setIsInserterOpened","value","type"],"sources":["@wordpress/customize-widgets/src/store/actions.js"],"sourcesContent":["/**\n * Returns an action object used to open/close the inserter.\n *\n * @param {boolean|Object} value Whether the inserter should be\n * opened (true) or closed (false).\n * To specify an insertion point,\n * use an object.\n * @param {string} value.rootClientId The root client ID to insert at.\n * @param {number} value.insertionIndex The index to insert at.\n *\n * @example\n * ```js\n * import { store as customizeWidgetsStore } from '@wordpress/customize-widgets';\n * import { __ } from '@wordpress/i18n';\n * import { useDispatch } from '@wordpress/data';\n * import { Button } from '@wordpress/components';\n * import { useState } from '@wordpress/element';\n *\n * const ExampleComponent = () => {\n * const { setIsInserterOpened } = useDispatch( customizeWidgetsStore );\n * const [ isOpen, setIsOpen ] = useState( false );\n *\n * return (\n * <Button\n * onClick={ () => {\n * setIsInserterOpened( ! isOpen );\n * setIsOpen( ! isOpen );\n * } }\n * >\n * { __( 'Open/close inserter' ) }\n * </Button>\n * );\n * };\n * ```\n *\n * @return {Object} Action object.\n */\nexport function setIsInserterOpened( value ) {\n\treturn {\n\t\ttype: 'SET_IS_INSERTER_OPENED',\n\t\tvalue,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,mBAAmBA,CAAEC,KAAK,EAAG;EAC5C,OAAO;IACNC,IAAI,EAAE,wBAAwB;IAC9BD;EACD,CAAC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/customize-widgets/src/store/constants.js"],"
|
|
1
|
+
{"version":3,"names":["STORE_NAME"],"sources":["@wordpress/customize-widgets/src/store/constants.js"],"sourcesContent":["/**\n * Module Constants\n */\nexport const STORE_NAME = 'core/customize-widgets';\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAO,MAAMA,UAAU,GAAG,wBAAwB"}
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { createReduxStore, register } from '@wordpress/data';
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* Internal dependencies
|
|
7
8
|
*/
|
|
8
|
-
|
|
9
9
|
import reducer from './reducer';
|
|
10
10
|
import * as selectors from './selectors';
|
|
11
11
|
import * as actions from './actions';
|
|
12
12
|
import { STORE_NAME } from './constants';
|
|
13
|
+
|
|
13
14
|
/**
|
|
14
15
|
* Block editor data store configuration.
|
|
15
16
|
*
|
|
@@ -17,12 +18,12 @@ import { STORE_NAME } from './constants';
|
|
|
17
18
|
*
|
|
18
19
|
* @type {Object}
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
21
|
const storeConfig = {
|
|
22
22
|
reducer,
|
|
23
23
|
selectors,
|
|
24
24
|
actions
|
|
25
25
|
};
|
|
26
|
+
|
|
26
27
|
/**
|
|
27
28
|
* Store definition for the edit widgets namespace.
|
|
28
29
|
*
|
|
@@ -30,7 +31,6 @@ const storeConfig = {
|
|
|
30
31
|
*
|
|
31
32
|
* @type {Object}
|
|
32
33
|
*/
|
|
33
|
-
|
|
34
34
|
export const store = createReduxStore(STORE_NAME, storeConfig);
|
|
35
35
|
register(store);
|
|
36
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["createReduxStore","register","reducer","selectors","actions","STORE_NAME","storeConfig","store"],"sources":["@wordpress/customize-widgets/src/store/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport { STORE_NAME } from './constants';\n\n/**\n * Block editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registering-a-store\n *\n * @type {Object}\n */\nconst storeConfig = {\n\treducer,\n\tselectors,\n\tactions,\n};\n\n/**\n * Store definition for the edit widgets namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, storeConfig );\nregister( store );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,EAAEC,QAAQ,QAAQ,iBAAiB;;AAE5D;AACA;AACA;AACA,OAAOC,OAAO,MAAM,WAAW;AAC/B,OAAO,KAAKC,SAAS,MAAM,aAAa;AACxC,OAAO,KAAKC,OAAO,MAAM,WAAW;AACpC,SAASC,UAAU,QAAQ,aAAa;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAW,GAAG;EACnBJ,OAAO;EACPC,SAAS;EACTC;AACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,KAAK,GAAGP,gBAAgB,CAAEK,UAAU,EAAEC,WAAY,CAAC;AAChEL,QAAQ,CAAEM,KAAM,CAAC"}
|
|
@@ -2,22 +2,20 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { combineReducers } from '@wordpress/data';
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* Reducer tracking whether the inserter is open.
|
|
7
8
|
*
|
|
8
9
|
* @param {boolean|Object} state
|
|
9
10
|
* @param {Object} action
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
12
|
function blockInserterPanel(state = false, action) {
|
|
13
13
|
switch (action.type) {
|
|
14
14
|
case 'SET_IS_INSERTER_OPENED':
|
|
15
15
|
return action.value;
|
|
16
16
|
}
|
|
17
|
-
|
|
18
17
|
return state;
|
|
19
18
|
}
|
|
20
|
-
|
|
21
19
|
export default combineReducers({
|
|
22
20
|
blockInserterPanel
|
|
23
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["combineReducers","blockInserterPanel","state","action","type","value"],"sources":["@wordpress/customize-widgets/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer tracking whether the inserter is open.\n *\n * @param {boolean|Object} state\n * @param {Object} action\n */\nfunction blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t}\n\treturn state;\n}\n\nexport default combineReducers( {\n\tblockInserterPanel,\n} );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,eAAe,QAAQ,iBAAiB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,kBAAkBA,CAAEC,KAAK,GAAG,KAAK,EAAEC,MAAM,EAAG;EACpD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,wBAAwB;MAC5B,OAAOD,MAAM,CAACE,KAAK;EACrB;EACA,OAAOH,KAAK;AACb;AAEA,eAAeF,eAAe,CAAE;EAC/BC;AACD,CAAE,CAAC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
const EMPTY_INSERTION_POINT = {
|
|
2
|
+
rootClientId: undefined,
|
|
3
|
+
insertionIndex: undefined
|
|
4
|
+
};
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* Returns true if the inserter is opened.
|
|
3
8
|
*
|
|
@@ -26,6 +31,7 @@
|
|
|
26
31
|
export function isInserterOpened(state) {
|
|
27
32
|
return !!state.blockInserterPanel;
|
|
28
33
|
}
|
|
34
|
+
|
|
29
35
|
/**
|
|
30
36
|
* Get the insertion point for the inserter.
|
|
31
37
|
*
|
|
@@ -33,15 +39,10 @@ export function isInserterOpened(state) {
|
|
|
33
39
|
*
|
|
34
40
|
* @return {Object} The root client ID and index to insert at.
|
|
35
41
|
*/
|
|
36
|
-
|
|
37
42
|
export function __experimentalGetInsertionPoint(state) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return {
|
|
43
|
-
rootClientId,
|
|
44
|
-
insertionIndex
|
|
45
|
-
};
|
|
43
|
+
if (typeof state === 'boolean') {
|
|
44
|
+
return EMPTY_INSERTION_POINT;
|
|
45
|
+
}
|
|
46
|
+
return state.blockInserterPanel;
|
|
46
47
|
}
|
|
47
48
|
//# sourceMappingURL=selectors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["EMPTY_INSERTION_POINT","rootClientId","undefined","insertionIndex","isInserterOpened","state","blockInserterPanel","__experimentalGetInsertionPoint"],"sources":["@wordpress/customize-widgets/src/store/selectors.js"],"sourcesContent":["const EMPTY_INSERTION_POINT = {\n\trootClientId: undefined,\n\tinsertionIndex: undefined,\n};\n\n/**\n * Returns true if the inserter is opened.\n *\n * @param {Object} state Global application state.\n *\n * @example\n * ```js\n * import { store as customizeWidgetsStore } from '@wordpress/customize-widgets';\n * import { __ } from '@wordpress/i18n';\n * import { useSelect } from '@wordpress/data';\n *\n * const ExampleComponent = () => {\n * const { isInserterOpened } = useSelect(\n * ( select ) => select( customizeWidgetsStore ),\n * []\n * );\n *\n * return isInserterOpened()\n * ? __( 'Inserter is open' )\n * : __( 'Inserter is closed.' );\n * };\n * ```\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID and index to insert at.\n */\nexport function __experimentalGetInsertionPoint( state ) {\n\tif ( typeof state === 'boolean' ) {\n\t\treturn EMPTY_INSERTION_POINT;\n\t}\n\n\treturn state.blockInserterPanel;\n}\n"],"mappings":"AAAA,MAAMA,qBAAqB,GAAG;EAC7BC,YAAY,EAAEC,SAAS;EACvBC,cAAc,EAAED;AACjB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,gBAAgBA,CAAEC,KAAK,EAAG;EACzC,OAAO,CAAC,CAAEA,KAAK,CAACC,kBAAkB;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,+BAA+BA,CAAEF,KAAK,EAAG;EACxD,IAAK,OAAOA,KAAK,KAAK,SAAS,EAAG;IACjC,OAAOL,qBAAqB;EAC7B;EAEA,OAAOK,KAAK,CAACC,kBAAkB;AAChC"}
|
package/build-module/utils.js
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
-
|
|
3
2
|
/**
|
|
4
3
|
* WordPress dependencies
|
|
5
4
|
*/
|
|
6
5
|
import { serialize, parse, createBlock } from '@wordpress/blocks';
|
|
7
6
|
import { addWidgetIdToBlock } from '@wordpress/widgets';
|
|
7
|
+
|
|
8
8
|
/**
|
|
9
9
|
* Convert settingId to widgetId.
|
|
10
10
|
*
|
|
11
11
|
* @param {string} settingId The setting id.
|
|
12
12
|
* @return {string} The widget id.
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
14
|
export function settingIdToWidgetId(settingId) {
|
|
16
15
|
const matches = settingId.match(/^widget_(.+)(?:\[(\d+)\])$/);
|
|
17
|
-
|
|
18
16
|
if (matches) {
|
|
19
17
|
const idBase = matches[1];
|
|
20
18
|
const number = parseInt(matches[2], 10);
|
|
21
19
|
return `${idBase}-${number}`;
|
|
22
20
|
}
|
|
23
|
-
|
|
24
21
|
return settingId;
|
|
25
22
|
}
|
|
23
|
+
|
|
26
24
|
/**
|
|
27
25
|
* Transform a block to a customizable widget.
|
|
28
26
|
*
|
|
@@ -30,11 +28,9 @@ export function settingIdToWidgetId(settingId) {
|
|
|
30
28
|
* @param {Object} existingWidget The widget to be extended from.
|
|
31
29
|
* @return {Object} The transformed widget.
|
|
32
30
|
*/
|
|
33
|
-
|
|
34
31
|
export function blockToWidget(block, existingWidget = null) {
|
|
35
32
|
let widget;
|
|
36
33
|
const isValidLegacyWidgetBlock = block.name === 'core/legacy-widget' && (block.attributes.id || block.attributes.instance);
|
|
37
|
-
|
|
38
34
|
if (isValidLegacyWidgetBlock) {
|
|
39
35
|
if (block.attributes.id) {
|
|
40
36
|
// Widget that does not extend WP_Widget.
|
|
@@ -47,11 +43,13 @@ export function blockToWidget(block, existingWidget = null) {
|
|
|
47
43
|
hash,
|
|
48
44
|
raw,
|
|
49
45
|
...rest
|
|
50
|
-
} = block.attributes.instance;
|
|
46
|
+
} = block.attributes.instance;
|
|
51
47
|
|
|
48
|
+
// Widget that extends WP_Widget.
|
|
52
49
|
widget = {
|
|
53
50
|
idBase: block.attributes.idBase,
|
|
54
|
-
instance: {
|
|
51
|
+
instance: {
|
|
52
|
+
...existingWidget?.instance,
|
|
55
53
|
// Required only for the customizer.
|
|
56
54
|
is_widget_customizer_js_value: true,
|
|
57
55
|
encoded_serialized_instance: encoded,
|
|
@@ -73,16 +71,17 @@ export function blockToWidget(block, existingWidget = null) {
|
|
|
73
71
|
}
|
|
74
72
|
};
|
|
75
73
|
}
|
|
76
|
-
|
|
77
74
|
const {
|
|
78
75
|
form,
|
|
79
76
|
rendered,
|
|
80
77
|
...restExistingWidget
|
|
81
78
|
} = existingWidget || {};
|
|
82
|
-
return {
|
|
79
|
+
return {
|
|
80
|
+
...restExistingWidget,
|
|
83
81
|
...widget
|
|
84
82
|
};
|
|
85
83
|
}
|
|
84
|
+
|
|
86
85
|
/**
|
|
87
86
|
* Transform a widget to a block.
|
|
88
87
|
*
|
|
@@ -93,7 +92,6 @@ export function blockToWidget(block, existingWidget = null) {
|
|
|
93
92
|
* @param {Object} widget.instance The instance of the widget.
|
|
94
93
|
* @return {WPBlock} The transformed block.
|
|
95
94
|
*/
|
|
96
|
-
|
|
97
95
|
export function widgetToBlock({
|
|
98
96
|
id,
|
|
99
97
|
idBase,
|
|
@@ -107,10 +105,8 @@ export function widgetToBlock({
|
|
|
107
105
|
raw_instance: raw,
|
|
108
106
|
...rest
|
|
109
107
|
} = instance;
|
|
110
|
-
|
|
111
108
|
if (idBase === 'block') {
|
|
112
109
|
var _raw$content;
|
|
113
|
-
|
|
114
110
|
const parsedBlocks = parse((_raw$content = raw.content) !== null && _raw$content !== void 0 ? _raw$content : '', {
|
|
115
111
|
__unstableSkipAutop: true
|
|
116
112
|
});
|
|
@@ -132,7 +128,6 @@ export function widgetToBlock({
|
|
|
132
128
|
id
|
|
133
129
|
});
|
|
134
130
|
}
|
|
135
|
-
|
|
136
131
|
return addWidgetIdToBlock(block, id);
|
|
137
132
|
}
|
|
138
133
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["serialize","parse","createBlock","addWidgetIdToBlock","settingIdToWidgetId","settingId","matches","match","idBase","number","parseInt","blockToWidget","block","existingWidget","widget","isValidLegacyWidgetBlock","name","attributes","id","instance","encoded","hash","raw","rest","is_widget_customizer_js_value","encoded_serialized_instance","instance_hash_key","raw_instance","content","widgetClass","form","rendered","restExistingWidget","widgetToBlock","_raw$content","parsedBlocks","__unstableSkipAutop","length"],"sources":["@wordpress/customize-widgets/src/utils.js"],"sourcesContent":["// @ts-check\n/**\n * WordPress dependencies\n */\nimport { serialize, parse, createBlock } from '@wordpress/blocks';\nimport { addWidgetIdToBlock } from '@wordpress/widgets';\n\n/**\n * Convert settingId to widgetId.\n *\n * @param {string} settingId The setting id.\n * @return {string} The widget id.\n */\nexport function settingIdToWidgetId( settingId ) {\n\tconst matches = settingId.match( /^widget_(.+)(?:\\[(\\d+)\\])$/ );\n\n\tif ( matches ) {\n\t\tconst idBase = matches[ 1 ];\n\t\tconst number = parseInt( matches[ 2 ], 10 );\n\n\t\treturn `${ idBase }-${ number }`;\n\t}\n\n\treturn settingId;\n}\n\n/**\n * Transform a block to a customizable widget.\n *\n * @param {WPBlock} block The block to be transformed from.\n * @param {Object} existingWidget The widget to be extended from.\n * @return {Object} The transformed widget.\n */\nexport function blockToWidget( block, existingWidget = null ) {\n\tlet widget;\n\n\tconst isValidLegacyWidgetBlock =\n\t\tblock.name === 'core/legacy-widget' &&\n\t\t( block.attributes.id || block.attributes.instance );\n\n\tif ( isValidLegacyWidgetBlock ) {\n\t\tif ( block.attributes.id ) {\n\t\t\t// Widget that does not extend WP_Widget.\n\t\t\twidget = {\n\t\t\t\tid: block.attributes.id,\n\t\t\t};\n\t\t} else {\n\t\t\tconst { encoded, hash, raw, ...rest } = block.attributes.instance;\n\n\t\t\t// Widget that extends WP_Widget.\n\t\t\twidget = {\n\t\t\t\tidBase: block.attributes.idBase,\n\t\t\t\tinstance: {\n\t\t\t\t\t...existingWidget?.instance,\n\t\t\t\t\t// Required only for the customizer.\n\t\t\t\t\tis_widget_customizer_js_value: true,\n\t\t\t\t\tencoded_serialized_instance: encoded,\n\t\t\t\t\tinstance_hash_key: hash,\n\t\t\t\t\traw_instance: raw,\n\t\t\t\t\t...rest,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t} else {\n\t\tconst instance = {\n\t\t\tcontent: serialize( block ),\n\t\t};\n\t\twidget = {\n\t\t\tidBase: 'block',\n\t\t\twidgetClass: 'WP_Widget_Block',\n\t\t\tinstance: {\n\t\t\t\traw_instance: instance,\n\t\t\t},\n\t\t};\n\t}\n\n\tconst { form, rendered, ...restExistingWidget } = existingWidget || {};\n\n\treturn {\n\t\t...restExistingWidget,\n\t\t...widget,\n\t};\n}\n\n/**\n * Transform a widget to a block.\n *\n * @param {Object} widget The widget to be transformed from.\n * @param {string} widget.id The widget id.\n * @param {string} widget.idBase The id base of the widget.\n * @param {number} widget.number The number/index of the widget.\n * @param {Object} widget.instance The instance of the widget.\n * @return {WPBlock} The transformed block.\n */\nexport function widgetToBlock( { id, idBase, number, instance } ) {\n\tlet block;\n\n\tconst {\n\t\tencoded_serialized_instance: encoded,\n\t\tinstance_hash_key: hash,\n\t\traw_instance: raw,\n\t\t...rest\n\t} = instance;\n\n\tif ( idBase === 'block' ) {\n\t\tconst parsedBlocks = parse( raw.content ?? '', {\n\t\t\t__unstableSkipAutop: true,\n\t\t} );\n\t\tblock = parsedBlocks.length\n\t\t\t? parsedBlocks[ 0 ]\n\t\t\t: createBlock( 'core/paragraph', {} );\n\t} else if ( number ) {\n\t\t// Widget that extends WP_Widget.\n\t\tblock = createBlock( 'core/legacy-widget', {\n\t\t\tidBase,\n\t\t\tinstance: {\n\t\t\t\tencoded,\n\t\t\t\thash,\n\t\t\t\traw,\n\t\t\t\t...rest,\n\t\t\t},\n\t\t} );\n\t} else {\n\t\t// Widget that does not extend WP_Widget.\n\t\tblock = createBlock( 'core/legacy-widget', {\n\t\t\tid,\n\t\t} );\n\t}\n\n\treturn addWidgetIdToBlock( block, id );\n}\n"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/customize-widgets",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.17.0",
|
|
4
4
|
"description": "Widgets blocks in Customizer Module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -24,26 +24,26 @@
|
|
|
24
24
|
"react-native": "src/index",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.16.0",
|
|
27
|
-
"@wordpress/block-editor": "^12.
|
|
28
|
-
"@wordpress/block-library": "^8.
|
|
29
|
-
"@wordpress/blocks": "^12.
|
|
30
|
-
"@wordpress/components": "^25.
|
|
31
|
-
"@wordpress/compose": "^6.
|
|
32
|
-
"@wordpress/core-data": "^6.
|
|
33
|
-
"@wordpress/data": "^9.
|
|
34
|
-
"@wordpress/dom": "^3.
|
|
35
|
-
"@wordpress/element": "^5.
|
|
36
|
-
"@wordpress/hooks": "^3.
|
|
37
|
-
"@wordpress/i18n": "^4.
|
|
38
|
-
"@wordpress/icons": "^9.
|
|
39
|
-
"@wordpress/interface": "^5.
|
|
40
|
-
"@wordpress/is-shallow-equal": "^4.
|
|
41
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
42
|
-
"@wordpress/keycodes": "^3.
|
|
43
|
-
"@wordpress/media-utils": "^4.
|
|
44
|
-
"@wordpress/preferences": "^3.
|
|
45
|
-
"@wordpress/private-apis": "^0.
|
|
46
|
-
"@wordpress/widgets": "^3.
|
|
27
|
+
"@wordpress/block-editor": "^12.8.0",
|
|
28
|
+
"@wordpress/block-library": "^8.17.0",
|
|
29
|
+
"@wordpress/blocks": "^12.17.0",
|
|
30
|
+
"@wordpress/components": "^25.6.0",
|
|
31
|
+
"@wordpress/compose": "^6.17.0",
|
|
32
|
+
"@wordpress/core-data": "^6.17.0",
|
|
33
|
+
"@wordpress/data": "^9.10.0",
|
|
34
|
+
"@wordpress/dom": "^3.40.0",
|
|
35
|
+
"@wordpress/element": "^5.17.0",
|
|
36
|
+
"@wordpress/hooks": "^3.40.0",
|
|
37
|
+
"@wordpress/i18n": "^4.40.0",
|
|
38
|
+
"@wordpress/icons": "^9.31.0",
|
|
39
|
+
"@wordpress/interface": "^5.17.0",
|
|
40
|
+
"@wordpress/is-shallow-equal": "^4.40.0",
|
|
41
|
+
"@wordpress/keyboard-shortcuts": "^4.17.0",
|
|
42
|
+
"@wordpress/keycodes": "^3.40.0",
|
|
43
|
+
"@wordpress/media-utils": "^4.31.0",
|
|
44
|
+
"@wordpress/preferences": "^3.17.0",
|
|
45
|
+
"@wordpress/private-apis": "^0.22.0",
|
|
46
|
+
"@wordpress/widgets": "^3.17.0",
|
|
47
47
|
"classnames": "^2.3.1",
|
|
48
48
|
"fast-deep-equal": "^3.1.3"
|
|
49
49
|
},
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "78a288d55b83a713b2f7d98d5a855c0771a2afc6"
|
|
58
58
|
}
|
package/src/store/selectors.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
const EMPTY_INSERTION_POINT = {
|
|
2
|
+
rootClientId: undefined,
|
|
3
|
+
insertionIndex: undefined,
|
|
4
|
+
};
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* Returns true if the inserter is opened.
|
|
3
8
|
*
|
|
@@ -35,6 +40,9 @@ export function isInserterOpened( state ) {
|
|
|
35
40
|
* @return {Object} The root client ID and index to insert at.
|
|
36
41
|
*/
|
|
37
42
|
export function __experimentalGetInsertionPoint( state ) {
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
if ( typeof state === 'boolean' ) {
|
|
44
|
+
return EMPTY_INSERTION_POINT;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return state.blockInserterPanel;
|
|
40
48
|
}
|