@wordpress/customize-widgets 5.35.1-next.16d95556a.0 → 5.36.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/filters/replace-media-upload.js +0 -13
- package/build/filters/replace-media-upload.js.map +3 -3
- package/build/index.js +1 -1
- package/build/index.js.map +2 -2
- package/build-module/filters/replace-media-upload.js +1 -17
- package/build-module/filters/replace-media-upload.js.map +2 -2
- package/build-module/index.js +1 -1
- package/build-module/index.js.map +2 -2
- package/package.json +23 -23
- package/src/filters/replace-media-upload.js +1 -24
- package/src/index.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
// packages/customize-widgets/src/filters/replace-media-upload.js
|
|
2
2
|
var import_hooks = require("@wordpress/hooks");
|
|
3
3
|
var import_media_utils = require("@wordpress/media-utils");
|
|
4
|
-
var import_lock_unlock = require("../lock-unlock");
|
|
5
|
-
var { MediaUploadModal: MediaUploadModalComponent } = (0, import_lock_unlock.unlock)(
|
|
6
|
-
import_media_utils.privateApis
|
|
7
|
-
);
|
|
8
|
-
if (window.__experimentalDataViewsMediaModal) {
|
|
9
|
-
(0, import_hooks.addFilter)(
|
|
10
|
-
"editor.MediaUploadModal",
|
|
11
|
-
"core/customize-widgets/replace-media-upload-modal",
|
|
12
|
-
() => {
|
|
13
|
-
return MediaUploadModalComponent;
|
|
14
|
-
}
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
4
|
var replaceMediaUpload = () => import_media_utils.MediaUpload;
|
|
18
5
|
(0, import_hooks.addFilter)(
|
|
19
6
|
"editor.MediaUpload",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/filters/replace-media-upload.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport {
|
|
5
|
-
"mappings": ";AAGA,mBAA0B;AAC1B,
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { MediaUpload } from '@wordpress/media-utils';\n\nconst replaceMediaUpload = () => MediaUpload;\n\naddFilter(\n\t'editor.MediaUpload',\n\t'core/edit-widgets/replace-media-upload',\n\treplaceMediaUpload\n);\n"],
|
|
5
|
+
"mappings": ";AAGA,mBAA0B;AAC1B,yBAA4B;AAE5B,IAAM,qBAAqB,MAAM;AAAA,IAEjC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/build/index.js
CHANGED
|
@@ -60,7 +60,7 @@ function initialize(editorName, blockEditorSettings) {
|
|
|
60
60
|
});
|
|
61
61
|
(0, import_data.dispatch)(import_blocks.store).reapplyBlockTypeFilters();
|
|
62
62
|
const coreBlocks = (0, import_block_library.__experimentalGetCoreBlocks)().filter((block) => {
|
|
63
|
-
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"));
|
|
63
|
+
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") || block.name.startsWith("core/term"));
|
|
64
64
|
});
|
|
65
65
|
(0, import_block_library.registerCoreBlocks)(coreBlocks);
|
|
66
66
|
(0, import_widgets.registerLegacyWidgetBlock)();
|
package/build/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.js"],
|
|
4
|
-
"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"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAuC;AACvC,2BAIO;AACP,qBAIO;AACP,oBAGO;AACP,kBAAyB;AACzB,yBAA0C;AAK1C,+BAA6B;AAC7B,6BAA8B;AAC9B,6BAA8B;AAC9B,qBAAO;
|
|
4
|
+
"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\tblock.name.startsWith( 'core/term' )\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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAuC;AACvC,2BAIO;AACP,qBAIO;AACP,oBAGO;AACP,kBAAyB;AACzB,yBAA0C;AAK1C,+BAA6B;AAC7B,6BAA8B;AAC9B,6BAA8B;AAC9B,qBAAO;AA8EP,mBAAsB;AATlB;AAnEJ,IAAM,EAAE,GAAG,IAAI;AAEf,IAAM,kBAAkB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AACA,IAAM,iCAAiC;AAQhC,SAAS,WAAY,YAAY,qBAAsB;AAC7D,4BAAU,mBAAAA,KAAiB,EAAE,YAAa,0BAA0B;AAAA,IACnE,cAAc;AAAA,IACd,cAAc;AAAA,EACf,CAAE;AAEF,4BAAU,cAAAC,KAAY,EAAE,wBAAwB;AAChD,QAAM,iBAAa,kDAA4B,EAAE,OAAQ,CAAE,UAAW;AACrE,WAAO,EACN,gBAAgB,SAAU,MAAM,IAAK,KACrC,MAAM,KAAK,WAAY,WAAY,KACnC,MAAM,KAAK,WAAY,YAAa,KACpC,MAAM,KAAK,WAAY,WAAY,KACnC,MAAM,KAAK,WAAY,iBAAkB,KACzC,MAAM,KAAK,WAAY,WAAY;AAAA,EAErC,CAAE;AACF,+CAAoB,UAAW;AAC/B,gDAA0B;AAC1B,MAAK,WAAW,qBAAsB;AACrC,2EAA8C;AAAA,MAC7C,iBAAiB;AAAA,IAClB,CAAE;AAAA,EACH;AACA,qDAAgC,mBAAoB;AACpD,+CAAyB;AAMzB,mDAA+B,WAAY;AAE3C,QAAM,qBAAiB,uBAAAC,SAAmB,mBAAoB;AAE9D,KAAG,UAAU,mBAAmB,cAAU,uBAAAC,SAAkB;AAC5D,KAAG,UAAU,mBAAmB,uBAAuB;AAEvD,QAAM,YAAY,SAAS,cAAe,KAAM;AAChD,WAAS,KAAK,YAAa,SAAU;AAErC,KAAG,UAAU,KAAM,SAAS,MAAM;AACjC,UAAM,kBAAkB,CAAC;AACzB,OAAG,UAAU,QAAQ,KAAM,CAAE,YAAa;AACzC,UAAK,mBAAmB,gBAAiB;AACxC,wBAAgB,KAAM,OAAQ;AAAA,MAC/B;AAAA,IACD,CAAE;AAEF,mCAAY,SAAU,EAAE;AAAA,MACvB,4CAAC,6BACA;AAAA,QAAC,yBAAAC;AAAA,QAAA;AAAA,UACA,KAAM,GAAG;AAAA,UACT;AAAA,UACA;AAAA;AAAA,MACD,GACD;AAAA,IACD;AAAA,EACD,CAAE;AACH;",
|
|
6
6
|
"names": ["preferencesStore", "blocksStore", "getSidebarControl", "getSidebarSection", "CustomizeWidgets"]
|
|
7
7
|
}
|
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
// packages/customize-widgets/src/filters/replace-media-upload.js
|
|
2
2
|
import { addFilter } from "@wordpress/hooks";
|
|
3
|
-
import {
|
|
4
|
-
MediaUpload,
|
|
5
|
-
privateApis as mediaUtilsPrivateApis
|
|
6
|
-
} from "@wordpress/media-utils";
|
|
7
|
-
import { unlock } from "../lock-unlock";
|
|
8
|
-
var { MediaUploadModal: MediaUploadModalComponent } = unlock(
|
|
9
|
-
mediaUtilsPrivateApis
|
|
10
|
-
);
|
|
11
|
-
if (window.__experimentalDataViewsMediaModal) {
|
|
12
|
-
addFilter(
|
|
13
|
-
"editor.MediaUploadModal",
|
|
14
|
-
"core/customize-widgets/replace-media-upload-modal",
|
|
15
|
-
() => {
|
|
16
|
-
return MediaUploadModalComponent;
|
|
17
|
-
}
|
|
18
|
-
);
|
|
19
|
-
}
|
|
3
|
+
import { MediaUpload } from "@wordpress/media-utils";
|
|
20
4
|
var replaceMediaUpload = () => MediaUpload;
|
|
21
5
|
addFilter(
|
|
22
6
|
"editor.MediaUpload",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/filters/replace-media-upload.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport {
|
|
5
|
-
"mappings": ";AAGA,SAAS,iBAAiB;AAC1B
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { MediaUpload } from '@wordpress/media-utils';\n\nconst replaceMediaUpload = () => MediaUpload;\n\naddFilter(\n\t'editor.MediaUpload',\n\t'core/edit-widgets/replace-media-upload',\n\treplaceMediaUpload\n);\n"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB;AAE5B,IAAM,qBAAqB,MAAM;AAEjC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build-module/index.js
CHANGED
|
@@ -37,7 +37,7 @@ function initialize(editorName, blockEditorSettings) {
|
|
|
37
37
|
});
|
|
38
38
|
dispatch(blocksStore).reapplyBlockTypeFilters();
|
|
39
39
|
const coreBlocks = __experimentalGetCoreBlocks().filter((block) => {
|
|
40
|
-
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"));
|
|
40
|
+
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") || block.name.startsWith("core/term"));
|
|
41
41
|
});
|
|
42
42
|
registerCoreBlocks(coreBlocks);
|
|
43
43
|
registerLegacyWidgetBlock();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.js"],
|
|
4
|
-
"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"],
|
|
5
|
-
"mappings": ";AAGA,SAAS,YAAY,kBAAkB;AACvC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,gBAAgB;AACzB,SAAS,SAAS,wBAAwB;AAK1C,OAAO,sBAAsB;AAC7B,OAAO,uBAAuB;AAC9B,OAAO,uBAAuB;AAC9B,OAAO;
|
|
4
|
+
"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\tblock.name.startsWith( 'core/term' )\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"],
|
|
5
|
+
"mappings": ";AAGA,SAAS,YAAY,kBAAkB;AACvC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,gBAAgB;AACzB,SAAS,SAAS,wBAAwB;AAK1C,OAAO,sBAAsB;AAC7B,OAAO,uBAAuB;AAC9B,OAAO,uBAAuB;AAC9B,OAAO;AA8EP,SAAS,aAAa;AATlB;AAnEJ,IAAM,EAAE,GAAG,IAAI;AAEf,IAAM,kBAAkB;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AACA,IAAM,iCAAiC;AAQhC,SAAS,WAAY,YAAY,qBAAsB;AAC7D,WAAU,gBAAiB,EAAE,YAAa,0BAA0B;AAAA,IACnE,cAAc;AAAA,IACd,cAAc;AAAA,EACf,CAAE;AAEF,WAAU,WAAY,EAAE,wBAAwB;AAChD,QAAM,aAAa,4BAA4B,EAAE,OAAQ,CAAE,UAAW;AACrE,WAAO,EACN,gBAAgB,SAAU,MAAM,IAAK,KACrC,MAAM,KAAK,WAAY,WAAY,KACnC,MAAM,KAAK,WAAY,YAAa,KACpC,MAAM,KAAK,WAAY,WAAY,KACnC,MAAM,KAAK,WAAY,iBAAkB,KACzC,MAAM,KAAK,WAAY,WAAY;AAAA,EAErC,CAAE;AACF,qBAAoB,UAAW;AAC/B,4BAA0B;AAC1B,MAAK,WAAW,qBAAsB;AACrC,iDAA8C;AAAA,MAC7C,iBAAiB;AAAA,IAClB,CAAE;AAAA,EACH;AACA,iCAAgC,mBAAoB;AACpD,2BAAyB;AAMzB,gCAA+B,WAAY;AAE3C,QAAM,iBAAiB,kBAAmB,mBAAoB;AAE9D,KAAG,UAAU,mBAAmB,UAAU,kBAAkB;AAC5D,KAAG,UAAU,mBAAmB,uBAAuB;AAEvD,QAAM,YAAY,SAAS,cAAe,KAAM;AAChD,WAAS,KAAK,YAAa,SAAU;AAErC,KAAG,UAAU,KAAM,SAAS,MAAM;AACjC,UAAM,kBAAkB,CAAC;AACzB,OAAG,UAAU,QAAQ,KAAM,CAAE,YAAa;AACzC,UAAK,mBAAmB,gBAAiB;AACxC,wBAAgB,KAAM,OAAQ;AAAA,MAC/B;AAAA,IACD,CAAE;AAEF,eAAY,SAAU,EAAE;AAAA,MACvB,oBAAC,cACA;AAAA,QAAC;AAAA;AAAA,UACA,KAAM,GAAG;AAAA,UACT;AAAA,UACA;AAAA;AAAA,MACD,GACD;AAAA,IACD;AAAA,EACD,CAAE;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/customize-widgets",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.36.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",
|
|
@@ -32,27 +32,27 @@
|
|
|
32
32
|
"react-native": "src/index",
|
|
33
33
|
"wpScript": true,
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@wordpress/base-styles": "^6.
|
|
36
|
-
"@wordpress/block-editor": "^15.
|
|
37
|
-
"@wordpress/block-library": "^9.
|
|
38
|
-
"@wordpress/blocks": "^15.
|
|
39
|
-
"@wordpress/components": "^30.
|
|
40
|
-
"@wordpress/compose": "^7.
|
|
41
|
-
"@wordpress/core-data": "^7.
|
|
42
|
-
"@wordpress/data": "^10.
|
|
43
|
-
"@wordpress/dom": "^4.
|
|
44
|
-
"@wordpress/element": "^6.
|
|
45
|
-
"@wordpress/hooks": "^4.
|
|
46
|
-
"@wordpress/i18n": "^6.
|
|
47
|
-
"@wordpress/icons": "^11.
|
|
48
|
-
"@wordpress/interface": "^9.
|
|
49
|
-
"@wordpress/is-shallow-equal": "^5.
|
|
50
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
51
|
-
"@wordpress/keycodes": "^4.
|
|
52
|
-
"@wordpress/media-utils": "^5.
|
|
53
|
-
"@wordpress/preferences": "^4.
|
|
54
|
-
"@wordpress/private-apis": "^1.
|
|
55
|
-
"@wordpress/widgets": "^4.
|
|
35
|
+
"@wordpress/base-styles": "^6.12.0",
|
|
36
|
+
"@wordpress/block-editor": "^15.9.0",
|
|
37
|
+
"@wordpress/block-library": "^9.36.0",
|
|
38
|
+
"@wordpress/blocks": "^15.9.0",
|
|
39
|
+
"@wordpress/components": "^30.9.0",
|
|
40
|
+
"@wordpress/compose": "^7.36.0",
|
|
41
|
+
"@wordpress/core-data": "^7.36.0",
|
|
42
|
+
"@wordpress/data": "^10.36.0",
|
|
43
|
+
"@wordpress/dom": "^4.36.0",
|
|
44
|
+
"@wordpress/element": "^6.36.0",
|
|
45
|
+
"@wordpress/hooks": "^4.36.0",
|
|
46
|
+
"@wordpress/i18n": "^6.9.0",
|
|
47
|
+
"@wordpress/icons": "^11.3.0",
|
|
48
|
+
"@wordpress/interface": "^9.21.0",
|
|
49
|
+
"@wordpress/is-shallow-equal": "^5.36.0",
|
|
50
|
+
"@wordpress/keyboard-shortcuts": "^5.36.0",
|
|
51
|
+
"@wordpress/keycodes": "^4.36.0",
|
|
52
|
+
"@wordpress/media-utils": "^5.36.0",
|
|
53
|
+
"@wordpress/preferences": "^4.36.0",
|
|
54
|
+
"@wordpress/private-apis": "^1.36.0",
|
|
55
|
+
"@wordpress/widgets": "^4.36.0",
|
|
56
56
|
"clsx": "^2.1.1",
|
|
57
57
|
"fast-deep-equal": "^3.1.3"
|
|
58
58
|
},
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "b35cf1a2dce04665e99fd6b9c2891c0b336361b9"
|
|
67
67
|
}
|
|
@@ -2,30 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { addFilter } from '@wordpress/hooks';
|
|
5
|
-
import {
|
|
6
|
-
MediaUpload,
|
|
7
|
-
privateApis as mediaUtilsPrivateApis,
|
|
8
|
-
} from '@wordpress/media-utils';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
|
-
import { unlock } from '../lock-unlock';
|
|
14
|
-
|
|
15
|
-
const { MediaUploadModal: MediaUploadModalComponent } = unlock(
|
|
16
|
-
mediaUtilsPrivateApis
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
if ( window.__experimentalDataViewsMediaModal ) {
|
|
20
|
-
// Create a new filter for the MediaUploadModal component
|
|
21
|
-
addFilter(
|
|
22
|
-
'editor.MediaUploadModal',
|
|
23
|
-
'core/customize-widgets/replace-media-upload-modal',
|
|
24
|
-
() => {
|
|
25
|
-
return MediaUploadModalComponent;
|
|
26
|
-
}
|
|
27
|
-
);
|
|
28
|
-
}
|
|
5
|
+
import { MediaUpload } from '@wordpress/media-utils';
|
|
29
6
|
|
|
30
7
|
const replaceMediaUpload = () => MediaUpload;
|
|
31
8
|
|
package/src/index.js
CHANGED
|
@@ -56,7 +56,8 @@ export function initialize( editorName, blockEditorSettings ) {
|
|
|
56
56
|
block.name.startsWith( 'core/post' ) ||
|
|
57
57
|
block.name.startsWith( 'core/query' ) ||
|
|
58
58
|
block.name.startsWith( 'core/site' ) ||
|
|
59
|
-
block.name.startsWith( 'core/navigation' )
|
|
59
|
+
block.name.startsWith( 'core/navigation' ) ||
|
|
60
|
+
block.name.startsWith( 'core/term' )
|
|
60
61
|
);
|
|
61
62
|
} );
|
|
62
63
|
registerCoreBlocks( coreBlocks );
|