@wordpress/edit-widgets 6.0.4 → 6.2.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 +8 -4
- package/build/index.js +4 -2
- package/build/index.js.map +1 -1
- package/build-module/index.js +5 -3
- 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 +28 -28
- package/src/components/keyboard-shortcut-help-modal/style.scss +0 -3
- package/src/index.js +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 6.2.0 (2024-06-26)
|
|
6
|
+
|
|
7
|
+
## 6.1.0 (2024-06-15)
|
|
8
|
+
|
|
5
9
|
## 6.0.0 (2024-05-31)
|
|
6
10
|
|
|
7
11
|
### Breaking Changes
|
|
@@ -129,11 +133,11 @@
|
|
|
129
133
|
|
|
130
134
|
## 4.0.0 (2022-02-10)
|
|
131
135
|
|
|
132
|
-
### Breaking
|
|
136
|
+
### Breaking Changes
|
|
133
137
|
|
|
134
138
|
- The `GUTENBERG_PHASE` environment variable has been renamed to `IS_GUTENBERG_PLUGIN` and is now a boolean ([#38202](https://github.com/WordPress/gutenberg/pull/38202)).
|
|
135
139
|
|
|
136
|
-
### Bug
|
|
140
|
+
### Bug Fixes
|
|
137
141
|
|
|
138
142
|
- Removed unused `@wordpress/a11y`, `@wordpress/server-side-render`, `rememo` and `uuid` dependencies ([#38388](https://github.com/WordPress/gutenberg/pull/38388)).
|
|
139
143
|
|
|
@@ -141,13 +145,13 @@
|
|
|
141
145
|
|
|
142
146
|
## 3.1.0 (2021-11-07)
|
|
143
147
|
|
|
144
|
-
###
|
|
148
|
+
### Enhancements
|
|
145
149
|
|
|
146
150
|
- Enable persistent List View in the widget editor [#35706](https://github.com/WordPress/gutenberg/pull/35706).
|
|
147
151
|
|
|
148
152
|
## 3.0.0 (2021-07-29)
|
|
149
153
|
|
|
150
|
-
### Breaking
|
|
154
|
+
### Breaking Changes
|
|
151
155
|
|
|
152
156
|
- Upgraded React components to work with v17.0 ([#29118](https://github.com/WordPress/gutenberg/pull/29118)). There are no new features in React v17.0 as explained in the [blog post](https://reactjs.org/blog/2020/10/20/react-v17.html).
|
|
153
157
|
|
package/build/index.js
CHANGED
|
@@ -75,8 +75,10 @@ function initializeEditor(id, settings) {
|
|
|
75
75
|
// do this will result in errors in the default block parser.
|
|
76
76
|
// see: https://github.com/WordPress/gutenberg/issues/33097
|
|
77
77
|
(0, _blocks.setFreeformContentHandlerName)('core/html');
|
|
78
|
-
root.render( /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
79
|
-
|
|
78
|
+
root.render( /*#__PURE__*/(0, _jsxRuntime.jsx)(_element.StrictMode, {
|
|
79
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_layout.default, {
|
|
80
|
+
blockEditorSettings: settings
|
|
81
|
+
})
|
|
80
82
|
}));
|
|
81
83
|
return root;
|
|
82
84
|
}
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","_data","_deprecated","_interopRequireDefault","_element","_blockLibrary","_coreData","_widgets","_preferences","_store","widgetArea","_interopRequireWildcard","_layout","_constants","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","disabledBlocks","ALLOW_REUSABLE_BLOCKS","initializeEditor","id","settings","target","document","getElementById","root","createRoot","coreBlocks","__experimentalGetCoreBlocks","filter","block","includes","name","startsWith","dispatch","preferencesStore","setDefaults","fixedToolbar","welcomeGuide","showBlockBreadcrumbs","themeStyles","blocksStore","reapplyBlockTypeFilters","registerCoreBlocks","registerLegacyWidgetBlock","globalThis","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","ENABLE_EXPERIMENTAL_FSE_BLOCKS","registerLegacyWidgetVariations","registerBlock","registerWidgetGroupBlock","__experimentalFetchLinkSuggestions","search","searchOptions","fetchLinkSuggestions","setFreeformContentHandlerName","render","jsx","blockEditorSettings","initialize","exports","reinitializeEditor","deprecated","since","version","metadata","unstable__bootstrapServerSideBlockDefinitions","registerBlockType"],"sources":["@wordpress/edit-widgets/src/index.js"],"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 { 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';\n\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(
|
|
1
|
+
{"version":3,"names":["_blocks","require","_data","_deprecated","_interopRequireDefault","_element","_blockLibrary","_coreData","_widgets","_preferences","_store","widgetArea","_interopRequireWildcard","_layout","_constants","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","disabledBlocks","ALLOW_REUSABLE_BLOCKS","initializeEditor","id","settings","target","document","getElementById","root","createRoot","coreBlocks","__experimentalGetCoreBlocks","filter","block","includes","name","startsWith","dispatch","preferencesStore","setDefaults","fixedToolbar","welcomeGuide","showBlockBreadcrumbs","themeStyles","blocksStore","reapplyBlockTypeFilters","registerCoreBlocks","registerLegacyWidgetBlock","globalThis","IS_GUTENBERG_PLUGIN","__experimentalRegisterExperimentalCoreBlocks","enableFSEBlocks","ENABLE_EXPERIMENTAL_FSE_BLOCKS","registerLegacyWidgetVariations","registerBlock","registerWidgetGroupBlock","__experimentalFetchLinkSuggestions","search","searchOptions","fetchLinkSuggestions","setFreeformContentHandlerName","render","jsx","StrictMode","children","blockEditorSettings","initialize","exports","reinitializeEditor","deprecated","since","version","metadata","unstable__bootstrapServerSideBlockDefinitions","registerBlockType"],"sources":["@wordpress/edit-widgets/src/index.js"],"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';\n\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"],"mappings":";;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AAKA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAKA,IAAAQ,YAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AACAA,OAAA;AACA,IAAAU,UAAA,GAAAC,uBAAA,CAAAX,OAAA;AAEA,IAAAY,OAAA,GAAAT,sBAAA,CAAAH,OAAA;AACA,IAAAa,UAAA,GAAAb,OAAA;AAGqB,IAAAc,WAAA,GAAAd,OAAA;AAAA,SAAAe,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAA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C,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG5C,gBAAgB;AAEnC,SAAS8C,kBAAkBA,CAAA,EAAG;EACpC,IAAAC,mBAAU,EAAE,mCAAmC,EAAE;IAChDC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMjB,aAAa,GAAKrB,KAAK,IAAM;EAClC,IAAK,CAAEA,KAAK,EAAG;IACd;EACD;EACA,MAAM;IAAEuC,QAAQ;IAAEhD,QAAQ;IAAEW;EAAK,CAAC,GAAGF,KAAK;EAC1C,IAAKuC,QAAQ,EAAG;IACf,IAAAC,qDAA6C,EAAE;MAAE,CAAEtC,IAAI,GAAIqC;IAAS,CAAE,CAAC;EACxE;EACA,IAAAE,yBAAiB,EAAEvC,IAAI,EAAEX,QAAS,CAAC;AACpC,CAAC","ignoreList":[]}
|
package/build-module/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { registerBlockType, unstable__bootstrapServerSideBlockDefinitions,
|
|
|
6
6
|
setFreeformContentHandlerName, store as blocksStore } from '@wordpress/blocks';
|
|
7
7
|
import { dispatch } from '@wordpress/data';
|
|
8
8
|
import deprecated from '@wordpress/deprecated';
|
|
9
|
-
import { createRoot } from '@wordpress/element';
|
|
9
|
+
import { StrictMode, createRoot } from '@wordpress/element';
|
|
10
10
|
import { registerCoreBlocks, __experimentalGetCoreBlocks, __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';
|
|
11
11
|
import { __experimentalFetchLinkSuggestions as fetchLinkSuggestions } from '@wordpress/core-data';
|
|
12
12
|
import { registerLegacyWidgetBlock, registerLegacyWidgetVariations, registerWidgetGroupBlock } from '@wordpress/widgets';
|
|
@@ -59,8 +59,10 @@ export function initializeEditor(id, settings) {
|
|
|
59
59
|
// do this will result in errors in the default block parser.
|
|
60
60
|
// see: https://github.com/WordPress/gutenberg/issues/33097
|
|
61
61
|
setFreeformContentHandlerName('core/html');
|
|
62
|
-
root.render( /*#__PURE__*/_jsx(
|
|
63
|
-
|
|
62
|
+
root.render( /*#__PURE__*/_jsx(StrictMode, {
|
|
63
|
+
children: /*#__PURE__*/_jsx(Layout, {
|
|
64
|
+
blockEditorSettings: settings
|
|
65
|
+
})
|
|
64
66
|
}));
|
|
65
67
|
return root;
|
|
66
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["registerBlockType","unstable__bootstrapServerSideBlockDefinitions","setFreeformContentHandlerName","store","blocksStore","dispatch","deprecated","createRoot","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","registerLegacyWidgetBlock","registerLegacyWidgetVariations","registerWidgetGroupBlock","preferencesStore","widgetArea","Layout","ALLOW_REUSABLE_BLOCKS","ENABLE_EXPERIMENTAL_FSE_BLOCKS","jsx","_jsx","disabledBlocks","initializeEditor","id","settings","target","document","getElementById","root","coreBlocks","filter","block","includes","name","startsWith","setDefaults","fixedToolbar","welcomeGuide","showBlockBreadcrumbs","themeStyles","reapplyBlockTypeFilters","globalThis","IS_GUTENBERG_PLUGIN","enableFSEBlocks","registerBlock","search","searchOptions","render","blockEditorSettings","initialize","reinitializeEditor","since","version","metadata"],"sources":["@wordpress/edit-widgets/src/index.js"],"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 { 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';\n\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(
|
|
1
|
+
{"version":3,"names":["registerBlockType","unstable__bootstrapServerSideBlockDefinitions","setFreeformContentHandlerName","store","blocksStore","dispatch","deprecated","StrictMode","createRoot","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","registerLegacyWidgetBlock","registerLegacyWidgetVariations","registerWidgetGroupBlock","preferencesStore","widgetArea","Layout","ALLOW_REUSABLE_BLOCKS","ENABLE_EXPERIMENTAL_FSE_BLOCKS","jsx","_jsx","disabledBlocks","initializeEditor","id","settings","target","document","getElementById","root","coreBlocks","filter","block","includes","name","startsWith","setDefaults","fixedToolbar","welcomeGuide","showBlockBreadcrumbs","themeStyles","reapplyBlockTypeFilters","globalThis","IS_GUTENBERG_PLUGIN","enableFSEBlocks","registerBlock","search","searchOptions","render","children","blockEditorSettings","initialize","reinitializeEditor","since","version","metadata"],"sources":["@wordpress/edit-widgets/src/index.js"],"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';\n\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"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,iBAAiB,EACjBC,6CAA6C;AAAE;AAC/CC,6BAA6B,EAC7BC,KAAK,IAAIC,WAAW,QACd,mBAAmB;AAC1B,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SAASC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AAC3D,SACCC,kBAAkB,EAClBC,2BAA2B,EAC3BC,4CAA4C,QACtC,0BAA0B;AACjC,SAASC,kCAAkC,IAAIC,oBAAoB,QAAQ,sBAAsB;AACjG,SACCC,yBAAyB,EACzBC,8BAA8B,EAC9BC,wBAAwB,QAClB,oBAAoB;AAC3B,SAASb,KAAK,IAAIc,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,OAAO,SAAS;AAChB,OAAO,WAAW;AAClB,OA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AmB,EAAG;IACrClC,4CAA4C,CAAE;MAC7CmC,eAAe,EAAEzB;IAClB,CAAE,CAAC;EACJ;EACAN,8BAA8B,CAAEY,QAAS,CAAC;EAC1CoB,aAAa,CAAE7B,UAAW,CAAC;EAC3BF,wBAAwB,CAAC,CAAC;EAE1BW,QAAQ,CAACf,kCAAkC,GAAG,CAAEoC,MAAM,EAAEC,aAAa,KACpEpC,oBAAoB,CAAEmC,MAAM,EAAEC,aAAa,EAAEtB,QAAS,CAAC;;EAExD;EACA;EACA;EACA;EACAzB,6BAA6B,CAAE,WAAY,CAAC;EAE5C6B,IAAI,CAACmB,MAAM,eACV3B,IAAA,CAAChB,UAAU;IAAA4C,QAAA,eACV5B,IAAA,CAACJ,MAAM;MAACiC,mBAAmB,EAAGzB;IAAU,CAAE;EAAC,CAChC,CACb,CAAC;EAED,OAAOI,IAAI;AACZ;;AAEA;AACA;AACA;AACA,OAAO,MAAMsB,UAAU,GAAG5B,gBAAgB;AAE1C,OAAO,SAAS6B,kBAAkBA,CAAA,EAAG;EACpChD,UAAU,CAAE,mCAAmC,EAAE;IAChDiD,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMT,aAAa,GAAKb,KAAK,IAAM;EAClC,IAAK,CAAEA,KAAK,EAAG;IACd;EACD;EACA,MAAM;IAAEuB,QAAQ;IAAE9B,QAAQ;IAAES;EAAK,CAAC,GAAGF,KAAK;EAC1C,IAAKuB,QAAQ,EAAG;IACfxD,6CAA6C,CAAE;MAAE,CAAEmC,IAAI,GAAIqB;IAAS,CAAE,CAAC;EACxE;EACAzD,iBAAiB,CAAEoC,IAAI,EAAET,QAAS,CAAC;AACpC,CAAC;AAED,SAASxB,KAAK,QAAQ,SAAS","ignoreList":[]}
|
|
@@ -685,7 +685,6 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
|
|
|
685
685
|
.edit-widgets-keyboard-shortcut-help-modal__shortcut-description {
|
|
686
686
|
flex: 1;
|
|
687
687
|
margin: 0;
|
|
688
|
-
flex-basis: auto;
|
|
689
688
|
}
|
|
690
689
|
.edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination {
|
|
691
690
|
display: block;
|
package/build-style/style.css
CHANGED
|
@@ -685,7 +685,6 @@ body.is-dragging-components-draggable .wp-block[data-type="core/widget-area"] .c
|
|
|
685
685
|
.edit-widgets-keyboard-shortcut-help-modal__shortcut-description {
|
|
686
686
|
flex: 1;
|
|
687
687
|
margin: 0;
|
|
688
|
-
flex-basis: auto;
|
|
689
688
|
}
|
|
690
689
|
.edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination {
|
|
691
690
|
display: block;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-widgets",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "Widgets Page module for WordPress..",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -28,32 +28,32 @@
|
|
|
28
28
|
"react-native": "src/index",
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@babel/runtime": "^7.16.0",
|
|
31
|
-
"@wordpress/api-fetch": "^7.0
|
|
32
|
-
"@wordpress/block-editor": "^13.0
|
|
33
|
-
"@wordpress/block-library": "^9.0
|
|
34
|
-
"@wordpress/blocks": "^13.0
|
|
35
|
-
"@wordpress/components": "^28.0
|
|
36
|
-
"@wordpress/compose": "^7.0
|
|
37
|
-
"@wordpress/core-data": "^7.0
|
|
38
|
-
"@wordpress/data": "^10.0
|
|
39
|
-
"@wordpress/deprecated": "^4.0
|
|
40
|
-
"@wordpress/dom": "^4.0
|
|
41
|
-
"@wordpress/element": "^6.0
|
|
42
|
-
"@wordpress/hooks": "^4.0
|
|
43
|
-
"@wordpress/i18n": "^5.0
|
|
44
|
-
"@wordpress/icons": "^10.0
|
|
45
|
-
"@wordpress/interface": "^6.0
|
|
46
|
-
"@wordpress/keyboard-shortcuts": "^5.0
|
|
47
|
-
"@wordpress/keycodes": "^4.0
|
|
48
|
-
"@wordpress/media-utils": "^5.0
|
|
49
|
-
"@wordpress/notices": "^5.0
|
|
50
|
-
"@wordpress/patterns": "^2.0
|
|
51
|
-
"@wordpress/plugins": "^7.0
|
|
52
|
-
"@wordpress/preferences": "^4.0
|
|
53
|
-
"@wordpress/private-apis": "^1.0
|
|
54
|
-
"@wordpress/reusable-blocks": "^5.0
|
|
55
|
-
"@wordpress/url": "^4.0
|
|
56
|
-
"@wordpress/widgets": "^4.0
|
|
31
|
+
"@wordpress/api-fetch": "^7.2.0",
|
|
32
|
+
"@wordpress/block-editor": "^13.2.0",
|
|
33
|
+
"@wordpress/block-library": "^9.2.0",
|
|
34
|
+
"@wordpress/blocks": "^13.2.0",
|
|
35
|
+
"@wordpress/components": "^28.2.0",
|
|
36
|
+
"@wordpress/compose": "^7.2.0",
|
|
37
|
+
"@wordpress/core-data": "^7.2.0",
|
|
38
|
+
"@wordpress/data": "^10.2.0",
|
|
39
|
+
"@wordpress/deprecated": "^4.2.0",
|
|
40
|
+
"@wordpress/dom": "^4.2.0",
|
|
41
|
+
"@wordpress/element": "^6.2.0",
|
|
42
|
+
"@wordpress/hooks": "^4.2.0",
|
|
43
|
+
"@wordpress/i18n": "^5.2.0",
|
|
44
|
+
"@wordpress/icons": "^10.2.0",
|
|
45
|
+
"@wordpress/interface": "^6.2.0",
|
|
46
|
+
"@wordpress/keyboard-shortcuts": "^5.2.0",
|
|
47
|
+
"@wordpress/keycodes": "^4.2.0",
|
|
48
|
+
"@wordpress/media-utils": "^5.2.0",
|
|
49
|
+
"@wordpress/notices": "^5.2.0",
|
|
50
|
+
"@wordpress/patterns": "^2.2.0",
|
|
51
|
+
"@wordpress/plugins": "^7.2.0",
|
|
52
|
+
"@wordpress/preferences": "^4.2.0",
|
|
53
|
+
"@wordpress/private-apis": "^1.2.0",
|
|
54
|
+
"@wordpress/reusable-blocks": "^5.2.0",
|
|
55
|
+
"@wordpress/url": "^4.2.0",
|
|
56
|
+
"@wordpress/widgets": "^4.2.0",
|
|
57
57
|
"clsx": "^2.1.1"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "aa5b14bb5bdbb8d8a02914e154c3bc1c2f18ace6"
|
|
67
67
|
}
|
package/src/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from '@wordpress/blocks';
|
|
10
10
|
import { dispatch } from '@wordpress/data';
|
|
11
11
|
import deprecated from '@wordpress/deprecated';
|
|
12
|
-
import { createRoot } from '@wordpress/element';
|
|
12
|
+
import { StrictMode, createRoot } from '@wordpress/element';
|
|
13
13
|
import {
|
|
14
14
|
registerCoreBlocks,
|
|
15
15
|
__experimentalGetCoreBlocks,
|
|
@@ -91,7 +91,11 @@ export function initializeEditor( id, settings ) {
|
|
|
91
91
|
// see: https://github.com/WordPress/gutenberg/issues/33097
|
|
92
92
|
setFreeformContentHandlerName( 'core/html' );
|
|
93
93
|
|
|
94
|
-
root.render(
|
|
94
|
+
root.render(
|
|
95
|
+
<StrictMode>
|
|
96
|
+
<Layout blockEditorSettings={ settings } />
|
|
97
|
+
</StrictMode>
|
|
98
|
+
);
|
|
95
99
|
|
|
96
100
|
return root;
|
|
97
101
|
}
|