@wordpress/customize-widgets 5.0.0 → 5.1.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/index.js +6 -4
- package/build/index.js.map +1 -1
- package/build-module/index.js +7 -5
- package/build-module/index.js.map +1 -1
- package/build-style/style-rtl.css +0 -1
- package/build-style/style.css +0 -1
- package/package.json +22 -22
- package/src/components/keyboard-shortcut-help-modal/style.scss +0 -3
- package/src/index.js +8 -6
package/CHANGELOG.md
CHANGED
package/build/index.js
CHANGED
|
@@ -79,10 +79,12 @@ function initialize(editorName, blockEditorSettings) {
|
|
|
79
79
|
sidebarControls.push(control);
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
|
-
(0, _element.createRoot)(container).render( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
(0, _element.createRoot)(container).render( /*#__PURE__*/(0, _jsxRuntime.jsx)(_element.StrictMode, {
|
|
83
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_customizeWidgets.default, {
|
|
84
|
+
api: wp.customize,
|
|
85
|
+
sidebarControls: sidebarControls,
|
|
86
|
+
blockEditorSettings: blockEditorSettings
|
|
87
|
+
})
|
|
86
88
|
}));
|
|
87
89
|
});
|
|
88
90
|
}
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_blockLibrary","_widgets","_blocks","_data","_preferences","_customizeWidgets","_interopRequireDefault","_sidebarSection","_sidebarControl","_jsxRuntime","_store","wp","window","DISABLED_BLOCKS","ENABLE_EXPERIMENTAL_FSE_BLOCKS","initialize","editorName","blockEditorSettings","dispatch","preferencesStore","setDefaults","fixedToolbar","welcomeGuide","blocksStore","reapplyBlockTypeFilters","coreBlocks","__experimentalGetCoreBlocks","filter","block","includes","name","startsWith","registerCoreBlocks","registerLegacyWidgetBlock","globalThis","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","registerLegacyWidgetVariations","registerWidgetGroupBlock","setFreeformContentHandlerName","SidebarControl","getSidebarControl","customize","sectionConstructor","sidebar","getSidebarSection","controlConstructor","sidebar_block_editor","container","document","createElement","body","appendChild","bind","sidebarControls","control","each","push","createRoot","render","jsx","default","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 ).reapplyBlockTypeFilters();\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 ( globalThis.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":";;;;;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,OAAA,GAAAH,OAAA;AAIA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,iBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,eAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,eAAA,GAAAF,sBAAA,CAAAP,OAAA;AACAA,OAAA;AAAmB,IAAAU,WAAA,GAAAV,OAAA;
|
|
1
|
+
{"version":3,"names":["_element","require","_blockLibrary","_widgets","_blocks","_data","_preferences","_customizeWidgets","_interopRequireDefault","_sidebarSection","_sidebarControl","_jsxRuntime","_store","wp","window","DISABLED_BLOCKS","ENABLE_EXPERIMENTAL_FSE_BLOCKS","initialize","editorName","blockEditorSettings","dispatch","preferencesStore","setDefaults","fixedToolbar","welcomeGuide","blocksStore","reapplyBlockTypeFilters","coreBlocks","__experimentalGetCoreBlocks","filter","block","includes","name","startsWith","registerCoreBlocks","registerLegacyWidgetBlock","globalThis","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","registerLegacyWidgetVariations","registerWidgetGroupBlock","setFreeformContentHandlerName","SidebarControl","getSidebarControl","customize","sectionConstructor","sidebar","getSidebarSection","controlConstructor","sidebar_block_editor","container","document","createElement","body","appendChild","bind","sidebarControls","control","each","push","createRoot","render","jsx","StrictMode","children","default","api"],"sources":["@wordpress/customize-widgets/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRoot, StrictMode } 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 ).reapplyBlockTypeFilters();\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 ( globalThis.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<StrictMode>\n\t\t\t\t<CustomizeWidgets\n\t\t\t\t\tapi={ wp.customize }\n\t\t\t\t\tsidebarControls={ sidebarControls }\n\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t/>\n\t\t\t</StrictMode>\n\t\t);\n\t} );\n}\nexport { store } from './store';\n"],"mappings":";;;;;;;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AAKA,IAAAG,OAAA,GAAAH,OAAA;AAIA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,iBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,eAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,eAAA,GAAAF,sBAAA,CAAAP,OAAA;AACAA,OAAA;AAAmB,IAAAU,WAAA,GAAAV,OAAA;AA6EnB,IAAAW,MAAA,GAAAX,OAAA;AAxGA;AACA;AACA;;AAmBA;AACA;AACA;;AAMA,MAAM;EAAEY;AAAG,CAAC,GAAGC,MAAM;AAErB,MAAMC,eAAe,GAAG,CACvB,WAAW,EACX,YAAY,EACZ,eAAe,EACf,oBAAoB,CACpB;AACD,MAAMC,8BAA8B,GAAG,KAAK;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAAEC,UAAU,EAAEC,mBAAmB,EAAG;EAC7D,IAAAC,cAAQ,EAAEC,kBAAiB,CAAC,CAACC,WAAW,CAAE,wBAAwB,EAAE;IACnEC,YAAY,EAAE,KAAK;IACnBC,YAAY,EAAE;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,MAAMC,eAAe,GAAG,EAAE;IAC1B5C,EAAE,CAACgC,SAAS,CAACa,OAAO,CAACC,IAAI,CAAID,OAAO,IAAM;MACzC,IAAKA,OAAO,YAAYf,cAAc,EAAG;QACxCc,eAAe,CAACG,IAAI,CAAEF,OAAQ,CAAC;MAChC;IACD,CAAE,CAAC;IAEH,IAAAG,mBAAU,EAAEV,SAAU,CAAC,CAACW,MAAM,eAC7B,IAAAnD,WAAA,CAAAoD,GAAA,EAAC/D,QAAA,CAAAgE,UAAU;MAAAC,QAAA,eACV,IAAAtD,WAAA,CAAAoD,GAAA,EAACxD,iBAAA,CAAA2D,OAAgB;QAChBC,GAAG,EAAGtD,EAAE,CAACgC,SAAW;QACpBY,eAAe,EAAGA,eAAiB;QACnCtC,mBAAmB,EAAGA;MAAqB,CAC3C;IAAC,CACS,CACb,CAAC;EACF,CAAE,CAAC;AACJ","ignoreList":[]}
|
package/build-module/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { createRoot } from '@wordpress/element';
|
|
4
|
+
import { createRoot, StrictMode } from '@wordpress/element';
|
|
5
5
|
import { registerCoreBlocks, __experimentalGetCoreBlocks, __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';
|
|
6
6
|
import { registerLegacyWidgetBlock, registerLegacyWidgetVariations, registerWidgetGroupBlock } from '@wordpress/widgets';
|
|
7
7
|
import { setFreeformContentHandlerName, store as blocksStore } from '@wordpress/blocks';
|
|
@@ -64,10 +64,12 @@ export function initialize(editorName, blockEditorSettings) {
|
|
|
64
64
|
sidebarControls.push(control);
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
|
-
createRoot(container).render( /*#__PURE__*/_jsx(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
createRoot(container).render( /*#__PURE__*/_jsx(StrictMode, {
|
|
68
|
+
children: /*#__PURE__*/_jsx(CustomizeWidgets, {
|
|
69
|
+
api: wp.customize,
|
|
70
|
+
sidebarControls: sidebarControls,
|
|
71
|
+
blockEditorSettings: blockEditorSettings
|
|
72
|
+
})
|
|
71
73
|
}));
|
|
72
74
|
});
|
|
73
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createRoot","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","registerLegacyWidgetBlock","registerLegacyWidgetVariations","registerWidgetGroupBlock","setFreeformContentHandlerName","store","blocksStore","dispatch","preferencesStore","CustomizeWidgets","getSidebarSection","getSidebarControl","jsx","_jsx","wp","window","DISABLED_BLOCKS","ENABLE_EXPERIMENTAL_FSE_BLOCKS","initialize","editorName","blockEditorSettings","setDefaults","fixedToolbar","welcomeGuide","reapplyBlockTypeFilters","coreBlocks","filter","block","includes","name","startsWith","globalThis","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 ).reapplyBlockTypeFilters();\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 ( globalThis.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":"AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,oBAAoB;
|
|
1
|
+
{"version":3,"names":["createRoot","StrictMode","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","registerLegacyWidgetBlock","registerLegacyWidgetVariations","registerWidgetGroupBlock","setFreeformContentHandlerName","store","blocksStore","dispatch","preferencesStore","CustomizeWidgets","getSidebarSection","getSidebarControl","jsx","_jsx","wp","window","DISABLED_BLOCKS","ENABLE_EXPERIMENTAL_FSE_BLOCKS","initialize","editorName","blockEditorSettings","setDefaults","fixedToolbar","welcomeGuide","reapplyBlockTypeFilters","coreBlocks","filter","block","includes","name","startsWith","globalThis","IS_GUTENBERG_PLUGIN","enableFSEBlocks","SidebarControl","customize","sectionConstructor","sidebar","controlConstructor","sidebar_block_editor","container","document","createElement","body","appendChild","bind","sidebarControls","control","each","push","render","children","api"],"sources":["@wordpress/customize-widgets/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createRoot, StrictMode } 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 ).reapplyBlockTypeFilters();\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 ( globalThis.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<StrictMode>\n\t\t\t\t<CustomizeWidgets\n\t\t\t\t\tapi={ wp.customize }\n\t\t\t\t\tsidebarControls={ sidebarControls }\n\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t/>\n\t\t\t</StrictMode>\n\t\t);\n\t} );\n}\nexport { store } from './store';\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SACCC,kBAAkB,EAClBC,2BAA2B,EAC3BC,4CAA4C,QACtC,0BAA0B;AACjC,SACCC,yBAAyB,EACzBC,8BAA8B,EAC9BC,wBAAwB,QAClB,oBAAoB;AAC3B,SACCC,6BAA6B,EAC7BC,KAAK,IAAIC,WAAW,QACd,mBAAmB;AAC1B,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASF,KAAK,IAAIG,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,OAAOC,gBAAgB,MAAM,gCAAgC;AAC7D,OAAOC,iBAAiB,MAAM,4BAA4B;AAC1D,OAAOC,iBAAiB,MAAM,4BAA4B;AAC1D,OAAO,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnB,MAAM;EAAEC;AAAG,CAAC,GAAGC,MAAM;AAErB,MAAMC,eAAe,GAAG,CACvB,WAAW,EACX,YAAY,EACZ,eAAe,EACf,oBAAoB,CACpB;AACD,MAAMC,8BAA8B,GAAG,KAAK;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,UAAUA,CAAEC,UAAU,EAAEC,mBAAmB,EAAG;EAC7Db,QAAQ,CAAEC,gBAAiB,CAAC,CA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AO,EAAE,MAAM;IACjC,MAAMC,eAAe,GAAG,EAAE;IAC1BhC,EAAE,CAACqB,SAAS,CAACY,OAAO,CAACC,IAAI,CAAID,OAAO,IAAM;MACzC,IAAKA,OAAO,YAAYb,cAAc,EAAG;QACxCY,eAAe,CAACG,IAAI,CAAEF,OAAQ,CAAC;MAChC;IACD,CAAE,CAAC;IAEHnD,UAAU,CAAE4C,SAAU,CAAC,CAACU,MAAM,eAC7BrC,IAAA,CAAChB,UAAU;MAAAsD,QAAA,eACVtC,IAAA,CAACJ,gBAAgB;QAChB2C,GAAG,EAAGtC,EAAE,CAACqB,SAAW;QACpBW,eAAe,EAAGA,eAAiB;QACnC1B,mBAAmB,EAAGA;MAAqB,CAC3C;IAAC,CACS,CACb,CAAC;EACF,CAAE,CAAC;AACJ;AACA,SAASf,KAAK,QAAQ,SAAS","ignoreList":[]}
|
package/build-style/style.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/customize-widgets",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.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",
|
|
@@ -25,26 +25,26 @@
|
|
|
25
25
|
"react-native": "src/index",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@babel/runtime": "^7.16.0",
|
|
28
|
-
"@wordpress/block-editor": "^13.
|
|
29
|
-
"@wordpress/block-library": "^9.
|
|
30
|
-
"@wordpress/blocks": "^13.
|
|
31
|
-
"@wordpress/components": "^28.
|
|
32
|
-
"@wordpress/compose": "^7.
|
|
33
|
-
"@wordpress/core-data": "^7.
|
|
34
|
-
"@wordpress/data": "^10.
|
|
35
|
-
"@wordpress/dom": "^4.
|
|
36
|
-
"@wordpress/element": "^6.
|
|
37
|
-
"@wordpress/hooks": "^4.
|
|
38
|
-
"@wordpress/i18n": "^5.
|
|
39
|
-
"@wordpress/icons": "^10.
|
|
40
|
-
"@wordpress/interface": "^6.
|
|
41
|
-
"@wordpress/is-shallow-equal": "^5.
|
|
42
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
43
|
-
"@wordpress/keycodes": "^4.
|
|
44
|
-
"@wordpress/media-utils": "^5.
|
|
45
|
-
"@wordpress/preferences": "^4.
|
|
46
|
-
"@wordpress/private-apis": "^1.
|
|
47
|
-
"@wordpress/widgets": "^4.
|
|
28
|
+
"@wordpress/block-editor": "^13.1.0",
|
|
29
|
+
"@wordpress/block-library": "^9.1.0",
|
|
30
|
+
"@wordpress/blocks": "^13.1.0",
|
|
31
|
+
"@wordpress/components": "^28.1.0",
|
|
32
|
+
"@wordpress/compose": "^7.1.0",
|
|
33
|
+
"@wordpress/core-data": "^7.1.0",
|
|
34
|
+
"@wordpress/data": "^10.1.0",
|
|
35
|
+
"@wordpress/dom": "^4.1.0",
|
|
36
|
+
"@wordpress/element": "^6.1.0",
|
|
37
|
+
"@wordpress/hooks": "^4.1.0",
|
|
38
|
+
"@wordpress/i18n": "^5.1.0",
|
|
39
|
+
"@wordpress/icons": "^10.1.0",
|
|
40
|
+
"@wordpress/interface": "^6.1.0",
|
|
41
|
+
"@wordpress/is-shallow-equal": "^5.1.0",
|
|
42
|
+
"@wordpress/keyboard-shortcuts": "^5.1.0",
|
|
43
|
+
"@wordpress/keycodes": "^4.1.0",
|
|
44
|
+
"@wordpress/media-utils": "^5.1.0",
|
|
45
|
+
"@wordpress/preferences": "^4.1.0",
|
|
46
|
+
"@wordpress/private-apis": "^1.1.0",
|
|
47
|
+
"@wordpress/widgets": "^4.1.0",
|
|
48
48
|
"clsx": "^2.1.1",
|
|
49
49
|
"fast-deep-equal": "^3.1.3"
|
|
50
50
|
},
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "66d3bf12e67d16deddc4b4a9ec42e1d0bed3479a"
|
|
59
59
|
}
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { createRoot } from '@wordpress/element';
|
|
4
|
+
import { createRoot, StrictMode } from '@wordpress/element';
|
|
5
5
|
import {
|
|
6
6
|
registerCoreBlocks,
|
|
7
7
|
__experimentalGetCoreBlocks,
|
|
@@ -92,11 +92,13 @@ export function initialize( editorName, blockEditorSettings ) {
|
|
|
92
92
|
} );
|
|
93
93
|
|
|
94
94
|
createRoot( container ).render(
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
95
|
+
<StrictMode>
|
|
96
|
+
<CustomizeWidgets
|
|
97
|
+
api={ wp.customize }
|
|
98
|
+
sidebarControls={ sidebarControls }
|
|
99
|
+
blockEditorSettings={ blockEditorSettings }
|
|
100
|
+
/>
|
|
101
|
+
</StrictMode>
|
|
100
102
|
);
|
|
101
103
|
} );
|
|
102
104
|
}
|