@wordpress/edit-widgets 6.35.1-next.16d95556a.0 → 6.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 +6 -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/build-style/style-rtl.css +23 -0
- package/build-style/style.css +23 -0
- package/package.json +29 -29
- package/src/components/welcome-guide/style.scss +8 -0
- package/src/filters/replace-media-upload.js +1 -24
- package/src/index.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 6.36.0 (2025-11-26)
|
|
6
|
+
|
|
7
|
+
### Internal
|
|
8
|
+
|
|
9
|
+
- Updated the `welcome-guide` implementation to specify its own close-button hover color, matching previous behavior after changes in the `Guide` component.
|
|
10
|
+
|
|
5
11
|
## 6.35.0 (2025-11-12)
|
|
6
12
|
|
|
7
13
|
## 6.34.0 (2025-10-29)
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
// packages/edit-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/edit-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 initializeEditor(id, settings) {
|
|
|
60
60
|
const target = document.getElementById(id);
|
|
61
61
|
const root = (0, import_element.createRoot)(target);
|
|
62
62
|
const coreBlocks = (0, import_block_library.__experimentalGetCoreBlocks)().filter((block) => {
|
|
63
|
-
return !(disabledBlocks.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 !(disabledBlocks.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_data.dispatch)(import_preferences.store).setDefaults("core/edit-widgets", {
|
|
66
66
|
fixedToolbar: false,
|
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 {\n\tregisterBlockType,\n\tunstable__bootstrapServerSideBlockDefinitions, // eslint-disable-line camelcase\n\tsetFreeformContentHandlerName,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { StrictMode, createRoot } from '@wordpress/element';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { __experimentalFetchLinkSuggestions as fetchLinkSuggestions } from '@wordpress/core-data';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterLegacyWidgetVariations,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport './store';\nimport './filters';\nimport * as widgetArea from './blocks/widget-area';\nimport Layout from './components/layout';\nimport {\n\tALLOW_REUSABLE_BLOCKS,\n\tENABLE_EXPERIMENTAL_FSE_BLOCKS,\n} from './constants';\n\nconst disabledBlocks = [\n\t'core/more',\n\t'core/freeform',\n\t'core/template-part',\n\t...( ALLOW_REUSABLE_BLOCKS ? [] : [ 'core/block' ] ),\n];\n\n/**\n * Initializes the block editor in the widgets screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Block editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter( ( block ) => {\n\t\treturn ! (\n\t\t\tdisabledBlocks.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\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-widgets', {\n\t\tfixedToolbar: false,\n\t\twelcomeGuide: true,\n\t\tshowBlockBreadcrumbs: true,\n\t\tthemeStyles: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\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( settings );\n\tregisterBlock( widgetArea );\n\tregisterWidgetGroupBlock();\n\n\tsettings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>\n\t\tfetchLinkSuggestions( search, searchOptions, settings );\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\troot.render(\n\t\t<StrictMode>\n\t\t\t<Layout blockEditorSettings={ settings } />\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\n/**\n * Compatibility export under the old `initialize` name.\n */\nexport const initialize = initializeEditor;\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editWidgets.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\n/**\n * Function to register an individual block.\n *\n * @param {Object} block The block to be registered.\n */\nconst registerBlock = ( block ) => {\n\tif ( ! block ) {\n\t\treturn;\n\t}\n\tconst { metadata, settings, name } = block;\n\tif ( metadata ) {\n\t\tunstable__bootstrapServerSideBlockDefinitions( { [ name ]: metadata } );\n\t}\n\tregisterBlockType( name, settings );\n};\n\nexport { store } from './store';\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAKO;AACP,kBAAyB;AACzB,wBAAuB;AACvB,qBAAuC;AACvC,2BAIO;AACP,uBAA2E;AAC3E,qBAIO;AACP,yBAA0C;AAK1C,mBAAO;AACP,qBAAO;AACP,iBAA4B;AAC5B,oBAAmB;AACnB,uBAGO;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tregisterBlockType,\n\tunstable__bootstrapServerSideBlockDefinitions, // eslint-disable-line camelcase\n\tsetFreeformContentHandlerName,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { StrictMode, createRoot } from '@wordpress/element';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { __experimentalFetchLinkSuggestions as fetchLinkSuggestions } from '@wordpress/core-data';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterLegacyWidgetVariations,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport './store';\nimport './filters';\nimport * as widgetArea from './blocks/widget-area';\nimport Layout from './components/layout';\nimport {\n\tALLOW_REUSABLE_BLOCKS,\n\tENABLE_EXPERIMENTAL_FSE_BLOCKS,\n} from './constants';\n\nconst disabledBlocks = [\n\t'core/more',\n\t'core/freeform',\n\t'core/template-part',\n\t...( ALLOW_REUSABLE_BLOCKS ? [] : [ 'core/block' ] ),\n];\n\n/**\n * Initializes the block editor in the widgets screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Block editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter( ( block ) => {\n\t\treturn ! (\n\t\t\tdisabledBlocks.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\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-widgets', {\n\t\tfixedToolbar: false,\n\t\twelcomeGuide: true,\n\t\tshowBlockBreadcrumbs: true,\n\t\tthemeStyles: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\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( settings );\n\tregisterBlock( widgetArea );\n\tregisterWidgetGroupBlock();\n\n\tsettings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>\n\t\tfetchLinkSuggestions( search, searchOptions, settings );\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\troot.render(\n\t\t<StrictMode>\n\t\t\t<Layout blockEditorSettings={ settings } />\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\n/**\n * Compatibility export under the old `initialize` name.\n */\nexport const initialize = initializeEditor;\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editWidgets.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\n/**\n * Function to register an individual block.\n *\n * @param {Object} block The block to be registered.\n */\nconst registerBlock = ( block ) => {\n\tif ( ! block ) {\n\t\treturn;\n\t}\n\tconst { metadata, settings, name } = block;\n\tif ( metadata ) {\n\t\tunstable__bootstrapServerSideBlockDefinitions( { [ name ]: metadata } );\n\t}\n\tregisterBlockType( name, settings );\n};\n\nexport { store } from './store';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oBAKO;AACP,kBAAyB;AACzB,wBAAuB;AACvB,qBAAuC;AACvC,2BAIO;AACP,uBAA2E;AAC3E,qBAIO;AACP,yBAA0C;AAK1C,mBAAO;AACP,qBAAO;AACP,iBAA4B;AAC5B,oBAAmB;AACnB,uBAGO;AA+FP,IAAAA,gBAAsB;AAnCnB;AA1DH,IAAM,iBAAiB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAK,yCAAwB,CAAC,IAAI,CAAE,YAAa;AAClD;AAQO,SAAS,iBAAkB,IAAI,UAAW;AAChD,QAAM,SAAS,SAAS,eAAgB,EAAG;AAC3C,QAAM,WAAO,2BAAY,MAAO;AAEhC,QAAM,iBAAa,kDAA4B,EAAE,OAAQ,CAAE,UAAW;AACrE,WAAO,EACN,eAAe,SAAU,MAAM,IAAK,KACpC,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;AAEF,4BAAU,mBAAAC,KAAiB,EAAE,YAAa,qBAAqB;AAAA,IAC9D,cAAc;AAAA,IACd,cAAc;AAAA,IACd,sBAAsB;AAAA,IACtB,aAAa;AAAA,EACd,CAAE;AAEF,4BAAU,cAAAC,KAAY,EAAE,wBAAwB;AAChD,+CAAoB,UAAW;AAC/B,gDAA0B;AAC1B,MAAK,WAAW,qBAAsB;AACrC,2EAA8C;AAAA,MAC7C,iBAAiB;AAAA,IAClB,CAAE;AAAA,EACH;AACA,qDAAgC,QAAS;AACzC,gBAAe,UAAW;AAC1B,+CAAyB;AAEzB,WAAS,qCAAqC,CAAE,QAAQ,sBACvD,iBAAAC,oCAAsB,QAAQ,eAAe,QAAS;AAMvD,mDAA+B,WAAY;AAE3C,OAAK;AAAA,IACJ,4CAAC,6BACA,sDAAC,cAAAC,SAAA,EAAO,qBAAsB,UAAW,GAC1C;AAAA,EACD;AAEA,SAAO;AACR;AAKO,IAAM,aAAa;AAEnB,SAAS,qBAAqB;AACpC,wBAAAC,SAAY,qCAAqC;AAAA,IAChD,OAAO;AAAA,IACP,SAAS;AAAA,EACV,CAAE;AACH;AAOA,IAAM,gBAAgB,CAAE,UAAW;AAClC,MAAK,CAAE,OAAQ;AACd;AAAA,EACD;AACA,QAAM,EAAE,UAAU,UAAU,KAAK,IAAI;AACrC,MAAK,UAAW;AACf,qEAA+C,EAAE,CAAE,IAAK,GAAG,SAAS,CAAE;AAAA,EACvE;AACA,uCAAmB,MAAM,QAAS;AACnC;",
|
|
6
6
|
"names": ["import_store", "preferencesStore", "blocksStore", "fetchLinkSuggestions", "Layout", "deprecated"]
|
|
7
7
|
}
|
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
// packages/edit-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/edit-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
|
@@ -40,7 +40,7 @@ function initializeEditor(id, settings) {
|
|
|
40
40
|
const target = document.getElementById(id);
|
|
41
41
|
const root = createRoot(target);
|
|
42
42
|
const coreBlocks = __experimentalGetCoreBlocks().filter((block) => {
|
|
43
|
-
return !(disabledBlocks.includes(block.name) || block.name.startsWith("core/post") || block.name.startsWith("core/query") || block.name.startsWith("core/site") || block.name.startsWith("core/navigation"));
|
|
43
|
+
return !(disabledBlocks.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"));
|
|
44
44
|
});
|
|
45
45
|
dispatch(preferencesStore).setDefaults("core/edit-widgets", {
|
|
46
46
|
fixedToolbar: false,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tregisterBlockType,\n\tunstable__bootstrapServerSideBlockDefinitions, // eslint-disable-line camelcase\n\tsetFreeformContentHandlerName,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { StrictMode, createRoot } from '@wordpress/element';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { __experimentalFetchLinkSuggestions as fetchLinkSuggestions } from '@wordpress/core-data';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterLegacyWidgetVariations,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport './store';\nimport './filters';\nimport * as widgetArea from './blocks/widget-area';\nimport Layout from './components/layout';\nimport {\n\tALLOW_REUSABLE_BLOCKS,\n\tENABLE_EXPERIMENTAL_FSE_BLOCKS,\n} from './constants';\n\nconst disabledBlocks = [\n\t'core/more',\n\t'core/freeform',\n\t'core/template-part',\n\t...( ALLOW_REUSABLE_BLOCKS ? [] : [ 'core/block' ] ),\n];\n\n/**\n * Initializes the block editor in the widgets screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Block editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter( ( block ) => {\n\t\treturn ! (\n\t\t\tdisabledBlocks.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\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-widgets', {\n\t\tfixedToolbar: false,\n\t\twelcomeGuide: true,\n\t\tshowBlockBreadcrumbs: true,\n\t\tthemeStyles: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\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( settings );\n\tregisterBlock( widgetArea );\n\tregisterWidgetGroupBlock();\n\n\tsettings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>\n\t\tfetchLinkSuggestions( search, searchOptions, settings );\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\troot.render(\n\t\t<StrictMode>\n\t\t\t<Layout blockEditorSettings={ settings } />\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\n/**\n * Compatibility export under the old `initialize` name.\n */\nexport const initialize = initializeEditor;\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editWidgets.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\n/**\n * Function to register an individual block.\n *\n * @param {Object} block The block to be registered.\n */\nconst registerBlock = ( block ) => {\n\tif ( ! block ) {\n\t\treturn;\n\t}\n\tconst { metadata, settings, name } = block;\n\tif ( metadata ) {\n\t\tunstable__bootstrapServerSideBlockDefinitions( { [ name ]: metadata } );\n\t}\n\tregisterBlockType( name, settings );\n};\n\nexport { store } from './store';\n"],
|
|
5
|
-
"mappings": ";AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,gBAAgB;AACzB,OAAO,gBAAgB;AACvB,SAAS,YAAY,kBAAkB;AACvC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,sCAAsC,4BAA4B;AAC3E;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,SAAS,wBAAwB;AAK1C,OAAO;AACP,OAAO;AACP,YAAY,gBAAgB;AAC5B,OAAO,YAAY;AACnB;AAAA,EACC;AAAA,EACA;AAAA,OACM;
|
|
4
|
+
"sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tregisterBlockType,\n\tunstable__bootstrapServerSideBlockDefinitions, // eslint-disable-line camelcase\n\tsetFreeformContentHandlerName,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { StrictMode, createRoot } from '@wordpress/element';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalGetCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport { __experimentalFetchLinkSuggestions as fetchLinkSuggestions } from '@wordpress/core-data';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterLegacyWidgetVariations,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport './store';\nimport './filters';\nimport * as widgetArea from './blocks/widget-area';\nimport Layout from './components/layout';\nimport {\n\tALLOW_REUSABLE_BLOCKS,\n\tENABLE_EXPERIMENTAL_FSE_BLOCKS,\n} from './constants';\n\nconst disabledBlocks = [\n\t'core/more',\n\t'core/freeform',\n\t'core/template-part',\n\t...( ALLOW_REUSABLE_BLOCKS ? [] : [ 'core/block' ] ),\n];\n\n/**\n * Initializes the block editor in the widgets screen.\n *\n * @param {string} id ID of the root element to render the screen in.\n * @param {Object} settings Block editor settings.\n */\nexport function initializeEditor( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tconst coreBlocks = __experimentalGetCoreBlocks().filter( ( block ) => {\n\t\treturn ! (\n\t\t\tdisabledBlocks.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\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-widgets', {\n\t\tfixedToolbar: false,\n\t\twelcomeGuide: true,\n\t\tshowBlockBreadcrumbs: true,\n\t\tthemeStyles: true,\n\t} );\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\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( settings );\n\tregisterBlock( widgetArea );\n\tregisterWidgetGroupBlock();\n\n\tsettings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>\n\t\tfetchLinkSuggestions( search, searchOptions, settings );\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\troot.render(\n\t\t<StrictMode>\n\t\t\t<Layout blockEditorSettings={ settings } />\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\n/**\n * Compatibility export under the old `initialize` name.\n */\nexport const initialize = initializeEditor;\n\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editWidgets.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\n/**\n * Function to register an individual block.\n *\n * @param {Object} block The block to be registered.\n */\nconst registerBlock = ( block ) => {\n\tif ( ! block ) {\n\t\treturn;\n\t}\n\tconst { metadata, settings, name } = block;\n\tif ( metadata ) {\n\t\tunstable__bootstrapServerSideBlockDefinitions( { [ name ]: metadata } );\n\t}\n\tregisterBlockType( name, settings );\n};\n\nexport { store } from './store';\n"],
|
|
5
|
+
"mappings": ";AAGA;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,gBAAgB;AACzB,OAAO,gBAAgB;AACvB,SAAS,YAAY,kBAAkB;AACvC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,sCAAsC,4BAA4B;AAC3E;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,SAAS,wBAAwB;AAK1C,OAAO;AACP,OAAO;AACP,YAAY,gBAAgB;AAC5B,OAAO,YAAY;AACnB;AAAA,EACC;AAAA,EACA;AAAA,OACM;AA+FP,SAAS,aAAa;AAnCnB;AA1DH,IAAM,iBAAiB;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAK,wBAAwB,CAAC,IAAI,CAAE,YAAa;AAClD;AAQO,SAAS,iBAAkB,IAAI,UAAW;AAChD,QAAM,SAAS,SAAS,eAAgB,EAAG;AAC3C,QAAM,OAAO,WAAY,MAAO;AAEhC,QAAM,aAAa,4BAA4B,EAAE,OAAQ,CAAE,UAAW;AACrE,WAAO,EACN,eAAe,SAAU,MAAM,IAAK,KACpC,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;AAEF,WAAU,gBAAiB,EAAE,YAAa,qBAAqB;AAAA,IAC9D,cAAc;AAAA,IACd,cAAc;AAAA,IACd,sBAAsB;AAAA,IACtB,aAAa;AAAA,EACd,CAAE;AAEF,WAAU,WAAY,EAAE,wBAAwB;AAChD,qBAAoB,UAAW;AAC/B,4BAA0B;AAC1B,MAAK,WAAW,qBAAsB;AACrC,iDAA8C;AAAA,MAC7C,iBAAiB;AAAA,IAClB,CAAE;AAAA,EACH;AACA,iCAAgC,QAAS;AACzC,gBAAe,UAAW;AAC1B,2BAAyB;AAEzB,WAAS,qCAAqC,CAAE,QAAQ,kBACvD,qBAAsB,QAAQ,eAAe,QAAS;AAMvD,gCAA+B,WAAY;AAE3C,OAAK;AAAA,IACJ,oBAAC,cACA,8BAAC,UAAO,qBAAsB,UAAW,GAC1C;AAAA,EACD;AAEA,SAAO;AACR;AAKO,IAAM,aAAa;AAEnB,SAAS,qBAAqB;AACpC,aAAY,qCAAqC;AAAA,IAChD,OAAO;AAAA,IACP,SAAS;AAAA,EACV,CAAE;AACH;AAOA,IAAM,gBAAgB,CAAE,UAAW;AAClC,MAAK,CAAE,OAAQ;AACd;AAAA,EACD;AACA,QAAM,EAAE,UAAU,UAAU,KAAK,IAAI;AACrC,MAAK,UAAW;AACf,kDAA+C,EAAE,CAAE,IAAK,GAAG,SAAS,CAAE;AAAA,EACvE;AACA,oBAAmB,MAAM,QAAS;AACnC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -256,6 +256,26 @@
|
|
|
256
256
|
font-size: 12px;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
+
.admin-ui-breadcrumbs__list {
|
|
260
|
+
list-style: none;
|
|
261
|
+
padding: 0;
|
|
262
|
+
margin: 0;
|
|
263
|
+
gap: 0;
|
|
264
|
+
font-size: 15px;
|
|
265
|
+
min-height: 32px;
|
|
266
|
+
font-weight: 500;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.admin-ui-breadcrumbs__list li:not(:last-child)::after {
|
|
270
|
+
content: "/";
|
|
271
|
+
margin: 0 8px;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.admin-ui-breadcrumbs__list h1 {
|
|
275
|
+
font-size: inherit;
|
|
276
|
+
line-height: inherit;
|
|
277
|
+
}
|
|
278
|
+
|
|
259
279
|
/**
|
|
260
280
|
* Colors
|
|
261
281
|
*/
|
|
@@ -1043,6 +1063,9 @@ body.is-fullscreen-mode .edit-widgets-notices__snackbar {
|
|
|
1043
1063
|
margin: 0 4px;
|
|
1044
1064
|
vertical-align: text-top;
|
|
1045
1065
|
}
|
|
1066
|
+
.edit-widgets-welcome-guide .components-button:hover svg {
|
|
1067
|
+
fill: #fff;
|
|
1068
|
+
}
|
|
1046
1069
|
|
|
1047
1070
|
.edit-widgets-block-editor {
|
|
1048
1071
|
position: relative;
|
package/build-style/style.css
CHANGED
|
@@ -256,6 +256,26 @@
|
|
|
256
256
|
font-size: 12px;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
+
.admin-ui-breadcrumbs__list {
|
|
260
|
+
list-style: none;
|
|
261
|
+
padding: 0;
|
|
262
|
+
margin: 0;
|
|
263
|
+
gap: 0;
|
|
264
|
+
font-size: 15px;
|
|
265
|
+
min-height: 32px;
|
|
266
|
+
font-weight: 500;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.admin-ui-breadcrumbs__list li:not(:last-child)::after {
|
|
270
|
+
content: "/";
|
|
271
|
+
margin: 0 8px;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.admin-ui-breadcrumbs__list h1 {
|
|
275
|
+
font-size: inherit;
|
|
276
|
+
line-height: inherit;
|
|
277
|
+
}
|
|
278
|
+
|
|
259
279
|
/**
|
|
260
280
|
* Colors
|
|
261
281
|
*/
|
|
@@ -1043,6 +1063,9 @@ body.is-fullscreen-mode .edit-widgets-notices__snackbar {
|
|
|
1043
1063
|
margin: 0 4px;
|
|
1044
1064
|
vertical-align: text-top;
|
|
1045
1065
|
}
|
|
1066
|
+
.edit-widgets-welcome-guide .components-button:hover svg {
|
|
1067
|
+
fill: #fff;
|
|
1068
|
+
}
|
|
1046
1069
|
|
|
1047
1070
|
.edit-widgets-block-editor {
|
|
1048
1071
|
position: relative;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-widgets",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.36.0",
|
|
4
4
|
"description": "Widgets Page module for WordPress..",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -40,33 +40,33 @@
|
|
|
40
40
|
]
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@wordpress/api-fetch": "^7.
|
|
44
|
-
"@wordpress/base-styles": "^6.
|
|
45
|
-
"@wordpress/block-editor": "^15.
|
|
46
|
-
"@wordpress/block-library": "^9.
|
|
47
|
-
"@wordpress/blocks": "^15.
|
|
48
|
-
"@wordpress/components": "^30.
|
|
49
|
-
"@wordpress/compose": "^7.
|
|
50
|
-
"@wordpress/core-data": "^7.
|
|
51
|
-
"@wordpress/data": "^10.
|
|
52
|
-
"@wordpress/deprecated": "^4.
|
|
53
|
-
"@wordpress/dom": "^4.
|
|
54
|
-
"@wordpress/element": "^6.
|
|
55
|
-
"@wordpress/hooks": "^4.
|
|
56
|
-
"@wordpress/i18n": "^6.
|
|
57
|
-
"@wordpress/icons": "^11.
|
|
58
|
-
"@wordpress/interface": "^9.
|
|
59
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
60
|
-
"@wordpress/keycodes": "^4.
|
|
61
|
-
"@wordpress/media-utils": "^5.
|
|
62
|
-
"@wordpress/notices": "^5.
|
|
63
|
-
"@wordpress/patterns": "^2.
|
|
64
|
-
"@wordpress/plugins": "^7.
|
|
65
|
-
"@wordpress/preferences": "^4.
|
|
66
|
-
"@wordpress/private-apis": "^1.
|
|
67
|
-
"@wordpress/reusable-blocks": "^5.
|
|
68
|
-
"@wordpress/url": "^4.
|
|
69
|
-
"@wordpress/widgets": "^4.
|
|
43
|
+
"@wordpress/api-fetch": "^7.36.0",
|
|
44
|
+
"@wordpress/base-styles": "^6.12.0",
|
|
45
|
+
"@wordpress/block-editor": "^15.9.0",
|
|
46
|
+
"@wordpress/block-library": "^9.36.0",
|
|
47
|
+
"@wordpress/blocks": "^15.9.0",
|
|
48
|
+
"@wordpress/components": "^30.9.0",
|
|
49
|
+
"@wordpress/compose": "^7.36.0",
|
|
50
|
+
"@wordpress/core-data": "^7.36.0",
|
|
51
|
+
"@wordpress/data": "^10.36.0",
|
|
52
|
+
"@wordpress/deprecated": "^4.36.0",
|
|
53
|
+
"@wordpress/dom": "^4.36.0",
|
|
54
|
+
"@wordpress/element": "^6.36.0",
|
|
55
|
+
"@wordpress/hooks": "^4.36.0",
|
|
56
|
+
"@wordpress/i18n": "^6.9.0",
|
|
57
|
+
"@wordpress/icons": "^11.3.0",
|
|
58
|
+
"@wordpress/interface": "^9.21.0",
|
|
59
|
+
"@wordpress/keyboard-shortcuts": "^5.36.0",
|
|
60
|
+
"@wordpress/keycodes": "^4.36.0",
|
|
61
|
+
"@wordpress/media-utils": "^5.36.0",
|
|
62
|
+
"@wordpress/notices": "^5.36.0",
|
|
63
|
+
"@wordpress/patterns": "^2.36.0",
|
|
64
|
+
"@wordpress/plugins": "^7.36.0",
|
|
65
|
+
"@wordpress/preferences": "^4.36.0",
|
|
66
|
+
"@wordpress/private-apis": "^1.36.0",
|
|
67
|
+
"@wordpress/reusable-blocks": "^5.36.0",
|
|
68
|
+
"@wordpress/url": "^4.36.0",
|
|
69
|
+
"@wordpress/widgets": "^4.36.0",
|
|
70
70
|
"clsx": "^2.1.1"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "b35cf1a2dce04665e99fd6b9c2891c0b336361b9"
|
|
80
80
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use "@wordpress/base-styles/colors" as *;
|
|
1
2
|
@use "@wordpress/base-styles/variables" as *;
|
|
2
3
|
|
|
3
4
|
.edit-widgets-welcome-guide {
|
|
@@ -32,4 +33,11 @@
|
|
|
32
33
|
margin: 0 4px;
|
|
33
34
|
vertical-align: text-top;
|
|
34
35
|
}
|
|
36
|
+
.components-button {
|
|
37
|
+
&:hover {
|
|
38
|
+
svg {
|
|
39
|
+
fill: $white;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
35
43
|
}
|
|
@@ -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/edit-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
|
@@ -58,7 +58,8 @@ export function initializeEditor( id, settings ) {
|
|
|
58
58
|
block.name.startsWith( 'core/post' ) ||
|
|
59
59
|
block.name.startsWith( 'core/query' ) ||
|
|
60
60
|
block.name.startsWith( 'core/site' ) ||
|
|
61
|
-
block.name.startsWith( 'core/navigation' )
|
|
61
|
+
block.name.startsWith( 'core/navigation' ) ||
|
|
62
|
+
block.name.startsWith( 'core/term' )
|
|
62
63
|
);
|
|
63
64
|
} );
|
|
64
65
|
|