@wordpress/edit-widgets 6.13.0 → 6.13.1-next.a9f418477.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.
@@ -77,7 +77,7 @@ function WelcomeGuide() {
77
77
  content: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
78
78
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h1", {
79
79
  className: "edit-widgets-welcome-guide__heading",
80
- children: (0, _i18n.__)('Make each block your own')
80
+ children: (0, _i18n.__)('Customize each block')
81
81
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
82
82
  className: "edit-widgets-welcome-guide__text",
83
83
  children: (0, _i18n.__)('Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.')
@@ -91,7 +91,7 @@ function WelcomeGuide() {
91
91
  content: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
92
92
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h1", {
93
93
  className: "edit-widgets-welcome-guide__heading",
94
- children: (0, _i18n.__)('Get to know the block library')
94
+ children: (0, _i18n.__)('Explore all blocks')
95
95
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
96
96
  className: "edit-widgets-welcome-guide__text",
97
97
  children: (0, _element.createInterpolateElement)((0, _i18n.__)('All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'), {
@@ -111,7 +111,7 @@ function WelcomeGuide() {
111
111
  content: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
112
112
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h1", {
113
113
  className: "edit-widgets-welcome-guide__heading",
114
- children: (0, _i18n.__)('Learn how to use the block editor')
114
+ children: (0, _i18n.__)('Learn more')
115
115
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
116
116
  className: "edit-widgets-welcome-guide__text",
117
117
  children: (0, _element.createInterpolateElement)((0, _i18n.__)("New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>"), {
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_components","_i18n","_element","_preferences","_store","_jsxRuntime","WelcomeGuide","_widgetAreas$filter$l","isActive","useSelect","select","preferencesStore","get","toggle","useDispatch","widgetAreas","editWidgetsStore","getWidgetAreas","per_page","isEntirelyBlockWidgets","every","widgetArea","id","widgets","widgetId","startsWith","numWidgetAreas","filter","length","jsx","Guide","className","contentLabel","__","finishButtonText","onFinish","pages","image","WelcomeGuideImage","nonAnimatedSrc","animatedSrc","content","jsxs","Fragment","children","sprintf","_n","ExternalLink","href","createInterpolateElement","InserterIconImage","alt","src","a","srcSet","media","width","height"],"sources":["@wordpress/edit-widgets/src/components/welcome-guide/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { ExternalLink, Guide } from '@wordpress/components';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function WelcomeGuide() {\n\tconst isActive = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'welcomeGuide'\n\t\t\t),\n\t\t[]\n\t);\n\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst widgetAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editWidgetsStore ).getWidgetAreas( { per_page: -1 } ),\n\t\t[]\n\t);\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\tconst isEntirelyBlockWidgets = widgetAreas?.every(\n\t\t( widgetArea ) =>\n\t\t\twidgetArea.id === 'wp_inactive_widgets' ||\n\t\t\twidgetArea.widgets.every( ( widgetId ) =>\n\t\t\t\twidgetId.startsWith( 'block-' )\n\t\t\t)\n\t);\n\n\tconst numWidgetAreas =\n\t\twidgetAreas?.filter(\n\t\t\t( widgetArea ) => widgetArea.id !== 'wp_inactive_widgets'\n\t\t).length ?? 0;\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-widgets-welcome-guide\"\n\t\t\tcontentLabel={ __( 'Welcome to block Widgets' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-widgets', 'welcomeGuide' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Welcome to block Widgets' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t{ isEntirelyBlockWidgets ? (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t// Translators: %s: Number of block areas in the current theme.\n\t\t\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t\t\t'Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.',\n\t\t\t\t\t\t\t\t\t\t\t\t'Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.',\n\t\t\t\t\t\t\t\t\t\t\t\tnumWidgetAreas\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tnumWidgetAreas\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Want to stick with the old widgets?'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</strong>{ ' ' }\n\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/plugins/classic-widgets/'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Get the Classic Widgets plugin.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Make each block your own' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Get to know the block library' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tInserterIconImage: (\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-widgets-welcome-guide__inserter-icon\"\n\t\t\t\t\t\t\t\t\t\t\t\talt={ __( 'inserter' ) }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Learn how to use the block editor' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\"New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>\"\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n\nfunction WelcomeGuideImage( { nonAnimatedSrc, animatedSrc } ) {\n\treturn (\n\t\t<picture className=\"edit-widgets-welcome-guide__image\">\n\t\t\t<source\n\t\t\t\tsrcSet={ nonAnimatedSrc }\n\t\t\t\tmedia=\"(prefers-reduced-motion: reduce)\"\n\t\t\t/>\n\t\t\t<img src={ animatedSrc } width=\"312\" height=\"240\" alt=\"\" />\n\t\t</picture>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAAwD,IAAAM,WAAA,GAAAN,OAAA;AAZxD;AACA;AACA;;AAOA;AACA;AACA;;AAGe,SAASO,YAAYA,CAAA,EAAG;EAAA,IAAAC,qBAAA;EACtC,MAAMC,QAAQ,GAAG,IAAAC,eAAS,EACvBC,MAAM,IACP,CAAC,CAAEA,MAAM,CAAEC,kBAAiB,CAAC,CAACC,GAAG,CAChC,mBAAmB,EACnB,cACD,CAAC,EACF,EACD,CAAC;EAED,MAAM;IAAEC;EAAO,CAAC,GAAG,IAAAC,iBAAW,EAAEH,kBAAiB,CAAC;EAElD,MAAMI,WAAW,GAAG,IAAAN,eAAS,EAC1BC,MAAM,IACPA,MAAM,CAAEM,YAAiB,CAAC,CAACC,cAAc,CAAE;IAAEC,QAAQ,EAAE,CAAC;EAAE,CAAE,CAAC,EAC9D,EACD,CAAC;EAED,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AwB,GAAA,EAAC7B,WAAA,CAAA+C,YAAY;cACZC,IAAI,EAAG,IAAAf,QAAE,EACR,qEACD;YAAG,CACH;UAEH,CACD;QAAC,CACC,CAAC;MAAA,CACH;IAEJ,CAAC;EACC,CACH,CAAC;AAEJ;AAEA,SAASK,iBAAiBA,CAAE;EAAEC,cAAc;EAAEC;AAAY,CAAC,EAAG;EAC7D,oBACC,IAAAnC,WAAA,CAAAqC,IAAA;IAASX,SAAS,EAAC,mCAAmC;IAAAa,QAAA,gBACrD,IAAAvC,WAAA,CAAAwB,GAAA;MACCyB,MAAM,EAAGf,cAAgB;MACzBgB,KAAK,EAAC;IAAkC,CACxC,CAAC,eACF,IAAAlD,WAAA,CAAAwB,GAAA;MAAKuB,GAAG,EAAGZ,WAAa;MAACgB,KAAK,EAAC,KAAK;MAACC,MAAM,EAAC,KAAK;MAACN,GAAG,EAAC;IAAE,CAAE,CAAC;EAAA,CACnD,CAAC;AAEZ","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_components","_i18n","_element","_preferences","_store","_jsxRuntime","WelcomeGuide","_widgetAreas$filter$l","isActive","useSelect","select","preferencesStore","get","toggle","useDispatch","widgetAreas","editWidgetsStore","getWidgetAreas","per_page","isEntirelyBlockWidgets","every","widgetArea","id","widgets","widgetId","startsWith","numWidgetAreas","filter","length","jsx","Guide","className","contentLabel","__","finishButtonText","onFinish","pages","image","WelcomeGuideImage","nonAnimatedSrc","animatedSrc","content","jsxs","Fragment","children","sprintf","_n","ExternalLink","href","createInterpolateElement","InserterIconImage","alt","src","a","srcSet","media","width","height"],"sources":["@wordpress/edit-widgets/src/components/welcome-guide/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { ExternalLink, Guide } from '@wordpress/components';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function WelcomeGuide() {\n\tconst isActive = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'welcomeGuide'\n\t\t\t),\n\t\t[]\n\t);\n\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst widgetAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editWidgetsStore ).getWidgetAreas( { per_page: -1 } ),\n\t\t[]\n\t);\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\tconst isEntirelyBlockWidgets = widgetAreas?.every(\n\t\t( widgetArea ) =>\n\t\t\twidgetArea.id === 'wp_inactive_widgets' ||\n\t\t\twidgetArea.widgets.every( ( widgetId ) =>\n\t\t\t\twidgetId.startsWith( 'block-' )\n\t\t\t)\n\t);\n\n\tconst numWidgetAreas =\n\t\twidgetAreas?.filter(\n\t\t\t( widgetArea ) => widgetArea.id !== 'wp_inactive_widgets'\n\t\t).length ?? 0;\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-widgets-welcome-guide\"\n\t\t\tcontentLabel={ __( 'Welcome to block Widgets' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-widgets', 'welcomeGuide' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Welcome to block Widgets' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t{ isEntirelyBlockWidgets ? (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t// Translators: %s: Number of block areas in the current theme.\n\t\t\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t\t\t'Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.',\n\t\t\t\t\t\t\t\t\t\t\t\t'Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.',\n\t\t\t\t\t\t\t\t\t\t\t\tnumWidgetAreas\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tnumWidgetAreas\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Want to stick with the old widgets?'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</strong>{ ' ' }\n\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/plugins/classic-widgets/'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Get the Classic Widgets plugin.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Customize each block' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Explore all blocks' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tInserterIconImage: (\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-widgets-welcome-guide__inserter-icon\"\n\t\t\t\t\t\t\t\t\t\t\t\talt={ __( 'inserter' ) }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Learn more' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\"New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>\"\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n\nfunction WelcomeGuideImage( { nonAnimatedSrc, animatedSrc } ) {\n\treturn (\n\t\t<picture className=\"edit-widgets-welcome-guide__image\">\n\t\t\t<source\n\t\t\t\tsrcSet={ nonAnimatedSrc }\n\t\t\t\tmedia=\"(prefers-reduced-motion: reduce)\"\n\t\t\t/>\n\t\t\t<img src={ animatedSrc } width=\"312\" height=\"240\" alt=\"\" />\n\t\t</picture>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAAwD,IAAAM,WAA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J,IAAAhC,WAAA,CAAAwB,GAAA,EAACS,iBAAiB;QACjBC,cAAc,EAAC,+DAA+D;QAC9EC,WAAW,EAAC;MAA+D,CAC3E,CACD;MACDC,OAAO,eACN,IAAApC,WAAA,CAAAqC,IAAA,EAAArC,WAAA,CAAAsC,QAAA;QAAAC,QAAA,gBACC,IAAAvC,WAAA,CAAAwB,GAAA;UAAIE,SAAS,EAAC,qCAAqC;UAAAa,QAAA,EAChD,IAAAX,QAAE,EAAE,YAAa;QAAC,CACjB,CAAC,eACL,IAAA5B,WAAA,CAAAwB,GAAA;UAAGE,SAAS,EAAC,kCAAkC;UAAAa,QAAA,EAC5C,IAAAK,iCAAwB,EACzB,IAAAhB,QAAE,EACD,6FACD,CAAC,EACD;YACCoB,CAAC,eACA,IAAAhD,WAAA,CAAAwB,GAAA,EAAC7B,WAAA,CAAA+C,YAAY;cACZC,IAAI,EAAG,IAAAf,QAAE,EACR,qEACD;YAAG,CACH;UAEH,CACD;QAAC,CACC,CAAC;MAAA,CACH;IAEJ,CAAC;EACC,CACH,CAAC;AAEJ;AAEA,SAASK,iBAAiBA,CAAE;EAAEC,cAAc;EAAEC;AAAY,CAAC,EAAG;EAC7D,oBACC,IAAAnC,WAAA,CAAAqC,IAAA;IAASX,SAAS,EAAC,mCAAmC;IAAAa,QAAA,gBACrD,IAAAvC,WAAA,CAAAwB,GAAA;MACCyB,MAAM,EAAGf,cAAgB;MACzBgB,KAAK,EAAC;IAAkC,CACxC,CAAC,eACF,IAAAlD,WAAA,CAAAwB,GAAA;MAAKuB,GAAG,EAAGZ,WAAa;MAACgB,KAAK,EAAC,KAAK;MAACC,MAAM,EAAC,KAAK;MAACN,GAAG,EAAC;IAAE,CAAE,CAAC;EAAA,CACnD,CAAC;AAEZ","ignoreList":[]}
@@ -104,7 +104,8 @@ function WidgetAreasBlockEditorProvider({
104
104
  templateLock: 'all',
105
105
  __experimentalSetIsInserterOpened: setIsInserterOpened,
106
106
  pageOnFront,
107
- pageForPosts
107
+ pageForPosts,
108
+ editorTool: 'edit'
108
109
  };
109
110
  }, [hasUploadPermissions, blockEditorSettings, isFixedToolbarActive, isLargeViewport, keepCaretInsideBlock, reusableBlocks, setIsInserterOpened, pageOnFront, pageForPosts]);
110
111
  const widgetAreaId = (0, _useLastSelectedWidgetArea.default)();
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_compose","_mediaUtils","_data","_coreData","_element","_blockEditor","_patterns","_preferences","_blockLibrary","_keyboardShortcuts","_interopRequireDefault","_utils","_useLastSelectedWidgetArea","_store","_constants","_lockUnlock","_jsxRuntime","ExperimentalBlockEditorProvider","unlock","blockEditorPrivateApis","PatternsMenuItems","editPatternsPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","EMPTY_ARRAY","WidgetAreasBlockEditorProvider","blockEditorSettings","children","props","isLargeViewport","useViewportMatch","hasUploadPermissions","reusableBlocks","isFixedToolbarActive","keepCaretInsideBlock","pageOnFront","pageForPosts","useSelect","select","_canUser","canUser","getEntityRecord","getEntityRecords","coreStore","siteSettings","kind","name","undefined","ALLOW_REUSABLE_BLOCKS","preferencesStore","get","page_on_front","page_for_posts","setIsInserterOpened","useDispatch","editWidgetsStore","settings","useMemo","mediaUploadBlockEditor","onError","argumentsObject","uploadMedia","wpAllowedMimeTypes","allowedMimeTypes","message","__experimentalReusableBlocks","hasFixedToolbar","mediaUpload","templateLock","__experimentalSetIsInserterOpened","widgetAreaId","useLastSelectedWidgetArea","blocks","onInput","onChange","useEntityBlockEditor","KIND","POST_TYPE","id","buildWidgetAreasPostId","jsxs","SlotFillProvider","jsx","default","Register","value","useSubRegistry","rootClientId"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SlotFillProvider } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEntityBlockEditor, store as coreStore } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport { buildWidgetAreasPostId, KIND, POST_TYPE } from '../../store/utils';\nimport useLastSelectedWidgetArea from '../../hooks/use-last-selected-widget-area';\nimport { store as editWidgetsStore } from '../../store';\nimport { ALLOW_REUSABLE_BLOCKS } from '../../constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nexport default function WidgetAreasBlockEditorProvider( {\n\tblockEditorSettings,\n\tchildren,\n\t...props\n} ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\thasUploadPermissions,\n\t\treusableBlocks,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEntityRecords } =\n\t\t\tselect( coreStore );\n\t\tconst siteSettings = canUser( 'read', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\treturn {\n\t\t\thasUploadPermissions:\n\t\t\t\tcanUser( 'create', {\n\t\t\t\t\tkind: 'root',\n\t\t\t\t\tname: 'media',\n\t\t\t\t} ) ?? true,\n\t\t\treusableBlocks: ALLOW_REUSABLE_BLOCKS\n\t\t\t\t? getEntityRecords( 'postType', 'wp_block' )\n\t\t\t\t: EMPTY_ARRAY,\n\t\t\tisFixedToolbarActive: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst settings = useMemo( () => {\n\t\tlet mediaUploadBlockEditor;\n\t\tif ( hasUploadPermissions ) {\n\t\t\tmediaUploadBlockEditor = ( { onError, ...argumentsObject } ) => {\n\t\t\t\tuploadMedia( {\n\t\t\t\t\twpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes,\n\t\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t\t...argumentsObject,\n\t\t\t\t} );\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...blockEditorSettings,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\thasFixedToolbar: isFixedToolbarActive || ! isLargeViewport,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: mediaUploadBlockEditor,\n\t\t\ttemplateLock: 'all',\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t};\n\t}, [\n\t\thasUploadPermissions,\n\t\tblockEditorSettings,\n\t\tisFixedToolbarActive,\n\t\tisLargeViewport,\n\t\tkeepCaretInsideBlock,\n\t\treusableBlocks,\n\t\tsetIsInserterOpened,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t] );\n\n\tconst widgetAreaId = useLastSelectedWidgetArea();\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\tKIND,\n\t\tPOST_TYPE,\n\t\t{ id: buildWidgetAreasPostId() }\n\t);\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<KeyboardShortcuts.Register />\n\t\t\t<BlockKeyboardShortcuts />\n\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\tvalue={ blocks }\n\t\t\t\tonInput={ onInput }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tsettings={ settings }\n\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t<PatternsMenuItems rootClientId={ widgetAreaId } />\n\t\t\t</ExperimentalBlockEditorProvider>\n\t\t</SlotFillProvider>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AAKA,IAAAU,kBAAA,GAAAC,sBAAA,CAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,0BAAA,GAAAF,sBAAA,CAAAX,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AACA,IAAAe,UAAA,GAAAf,OAAA;AACA,IAAAgB,WAAA,GAAAhB,OAAA;AAA2C,IAAAiB,WAAA,GAAAjB,OAAA;AAtB3C;AACA;AACA;;AAYA;AACA;AACA;;AAQA,MAAM;EAAEkB;AAAgC,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAC5E,MAAM;EAAEC;AAAkB,CAAC,GAAG,IAAAF,kBAAM,EAAEG,qBAAwB,CAAC;AAC/D,MAAM;EAAEC;AAAuB,CAAC,GAAG,IAAAJ,kBAAM,EAAEK,yBAAwB,C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eAC9B,IAAApE,WAAA,CAAAkE,GAAA,EAAC5D,sBAAsB,IAAE,CAAC,eAC1B,IAAAN,WAAA,CAAAgE,IAAA,EAAC/D,+BAA+B;MAC/BoE,KAAK,EAAGb,MAAQ;MAChBC,OAAO,EAAGA,OAAS;MACnBC,QAAQ,EAAGA,QAAU;MACrBlB,QAAQ,EAAGA,QAAU;MACrB8B,cAAc,EAAG,KAAO;MAAA,GACnB1D,KAAK;MAAAD,QAAA,GAERA,QAAQ,eACV,IAAAX,WAAA,CAAAkE,GAAA,EAAC9D,iBAAiB;QAACmE,YAAY,EAAGjB;MAAc,CAAE,CAAC;IAAA,CACnB,CAAC;EAAA,CACjB,CAAC;AAErB","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_compose","_mediaUtils","_data","_coreData","_element","_blockEditor","_patterns","_preferences","_blockLibrary","_keyboardShortcuts","_interopRequireDefault","_utils","_useLastSelectedWidgetArea","_store","_constants","_lockUnlock","_jsxRuntime","ExperimentalBlockEditorProvider","unlock","blockEditorPrivateApis","PatternsMenuItems","editPatternsPrivateApis","BlockKeyboardShortcuts","blockLibraryPrivateApis","EMPTY_ARRAY","WidgetAreasBlockEditorProvider","blockEditorSettings","children","props","isLargeViewport","useViewportMatch","hasUploadPermissions","reusableBlocks","isFixedToolbarActive","keepCaretInsideBlock","pageOnFront","pageForPosts","useSelect","select","_canUser","canUser","getEntityRecord","getEntityRecords","coreStore","siteSettings","kind","name","undefined","ALLOW_REUSABLE_BLOCKS","preferencesStore","get","page_on_front","page_for_posts","setIsInserterOpened","useDispatch","editWidgetsStore","settings","useMemo","mediaUploadBlockEditor","onError","argumentsObject","uploadMedia","wpAllowedMimeTypes","allowedMimeTypes","message","__experimentalReusableBlocks","hasFixedToolbar","mediaUpload","templateLock","__experimentalSetIsInserterOpened","editorTool","widgetAreaId","useLastSelectedWidgetArea","blocks","onInput","onChange","useEntityBlockEditor","KIND","POST_TYPE","id","buildWidgetAreasPostId","jsxs","SlotFillProvider","jsx","default","Register","value","useSubRegistry","rootClientId"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SlotFillProvider } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEntityBlockEditor, store as coreStore } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport { buildWidgetAreasPostId, KIND, POST_TYPE } from '../../store/utils';\nimport useLastSelectedWidgetArea from '../../hooks/use-last-selected-widget-area';\nimport { store as editWidgetsStore } from '../../store';\nimport { ALLOW_REUSABLE_BLOCKS } from '../../constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nexport default function WidgetAreasBlockEditorProvider( {\n\tblockEditorSettings,\n\tchildren,\n\t...props\n} ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\thasUploadPermissions,\n\t\treusableBlocks,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEntityRecords } =\n\t\t\tselect( coreStore );\n\t\tconst siteSettings = canUser( 'read', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\treturn {\n\t\t\thasUploadPermissions:\n\t\t\t\tcanUser( 'create', {\n\t\t\t\t\tkind: 'root',\n\t\t\t\t\tname: 'media',\n\t\t\t\t} ) ?? true,\n\t\t\treusableBlocks: ALLOW_REUSABLE_BLOCKS\n\t\t\t\t? getEntityRecords( 'postType', 'wp_block' )\n\t\t\t\t: EMPTY_ARRAY,\n\t\t\tisFixedToolbarActive: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst settings = useMemo( () => {\n\t\tlet mediaUploadBlockEditor;\n\t\tif ( hasUploadPermissions ) {\n\t\t\tmediaUploadBlockEditor = ( { onError, ...argumentsObject } ) => {\n\t\t\t\tuploadMedia( {\n\t\t\t\t\twpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes,\n\t\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t\t...argumentsObject,\n\t\t\t\t} );\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...blockEditorSettings,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\thasFixedToolbar: isFixedToolbarActive || ! isLargeViewport,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: mediaUploadBlockEditor,\n\t\t\ttemplateLock: 'all',\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\teditorTool: 'edit',\n\t\t};\n\t}, [\n\t\thasUploadPermissions,\n\t\tblockEditorSettings,\n\t\tisFixedToolbarActive,\n\t\tisLargeViewport,\n\t\tkeepCaretInsideBlock,\n\t\treusableBlocks,\n\t\tsetIsInserterOpened,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t] );\n\n\tconst widgetAreaId = useLastSelectedWidgetArea();\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\tKIND,\n\t\tPOST_TYPE,\n\t\t{ id: buildWidgetAreasPostId() }\n\t);\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<KeyboardShortcuts.Register />\n\t\t\t<BlockKeyboardShortcuts />\n\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\tvalue={ blocks }\n\t\t\t\tonInput={ onInput }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tsettings={ settings }\n\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t<PatternsMenuItems rootClientId={ widgetAreaId } />\n\t\t\t</ExperimentalBlockEditorProvider>\n\t\t</SlotFillProvider>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AAKA,IAAAU,kBAAA,GAAAC,sBAAA,CAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,0BAAA,GAAAF,sBAAA,CAAAX,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AACA,IAAAe,UAAA,GAAAf,OAAA;AACA,IAAAgB,WAAA,GAAAhB,OAAA;AAA2C,IAAAiB,WAAA,GAAAjB,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CAAE,GAAG,IAAAC,8BAAoB,EACzDC,WAAI,EACJC,gBAAS,EACT;IAAEC,EAAE,EAAE,IAAAC,6BAAsB,EAAC;EAAE,CAChC,CAAC;EAED,oBACC,IAAAhE,WAAA,CAAAiE,IAAA,EAACnF,WAAA,CAAAoF,gBAAgB;IAAAvD,QAAA,gBAChB,IAAAX,WAAA,CAAAmE,GAAA,EAAC1E,kBAAA,CAAA2E,OAAiB,CAACC,QAAQ,IAAE,CAAC,eAC9B,IAAArE,WAAA,CAAAmE,GAAA,EAAC7D,sBAAsB,IAAE,CAAC,eAC1B,IAAAN,WAAA,CAAAiE,IAAA,EAAChE,+BAA+B;MAC/BqE,KAAK,EAAGb,MAAQ;MAChBC,OAAO,EAAGA,OAAS;MACnBC,QAAQ,EAAGA,QAAU;MACrBnB,QAAQ,EAAGA,QAAU;MACrB+B,cAAc,EAAG,KAAO;MAAA,GACnB3D,KAAK;MAAAD,QAAA,GAERA,QAAQ,eACV,IAAAX,WAAA,CAAAmE,GAAA,EAAC/D,iBAAiB;QAACoE,YAAY,EAAGjB;MAAc,CAAE,CAAC;IAAA,CACnB,CAAC;EAAA,CACjB,CAAC;AAErB","ignoreList":[]}
package/build/index.js CHANGED
@@ -16,7 +16,6 @@ Object.defineProperty(exports, "store", {
16
16
  var _blocks = require("@wordpress/blocks");
17
17
  var _data = require("@wordpress/data");
18
18
  var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
19
- var _editor = require("@wordpress/editor");
20
19
  var _element = require("@wordpress/element");
21
20
  var _blockLibrary = require("@wordpress/block-library");
22
21
  var _coreData = require("@wordpress/core-data");
@@ -25,7 +24,6 @@ var _preferences = require("@wordpress/preferences");
25
24
  var _store = require("./store");
26
25
  require("./filters");
27
26
  var widgetArea = _interopRequireWildcard(require("./blocks/widget-area"));
28
- var _lockUnlock = require("./lock-unlock");
29
27
  var _layout = _interopRequireDefault(require("./components/layout"));
30
28
  var _constants = require("./constants");
31
29
  var _jsxRuntime = require("react/jsx-runtime");
@@ -40,9 +38,6 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
40
38
  */
41
39
 
42
40
  const disabledBlocks = ['core/more', 'core/freeform', 'core/template-part', ...(_constants.ALLOW_REUSABLE_BLOCKS ? [] : ['core/block'])];
43
- const {
44
- registerCoreBlockBindingsSources
45
- } = (0, _lockUnlock.unlock)(_editor.privateApis);
46
41
 
47
42
  /**
48
43
  * Initializes the block editor in the widgets screen.
@@ -64,7 +59,6 @@ function initializeEditor(id, settings) {
64
59
  });
65
60
  (0, _data.dispatch)(_blocks.store).reapplyBlockTypeFilters();
66
61
  (0, _blockLibrary.registerCoreBlocks)(coreBlocks);
67
- registerCoreBlockBindingsSources();
68
62
  (0, _widgets.registerLegacyWidgetBlock)();
69
63
  if (globalThis.IS_GUTENBERG_PLUGIN) {
70
64
  (0, _blockLibrary.__experimentalRegisterExperimentalCoreBlocks)({
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_data","_deprecated","_interopRequireDefault","_editor","_element","_blockLibrary","_coreData","_widgets","_preferences","_store","widgetArea","_interopRequireWildcard","_lockUnlock","_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","registerCoreBlockBindingsSources","unlock","editorPrivateApis","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 { privateApis as editorPrivateApis } from '@wordpress/editor';\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 { unlock } from './lock-unlock';\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\nconst { registerCoreBlockBindingsSources } = unlock( editorPrivateApis );\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\tregisterCoreBlockBindingsSources();\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,OAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAKA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAKA,IAAAS,YAAA,GAAAT,OAAA;AAKA,IAAAU,MAAA,GAAAV,OAAA;AACAA,OAAA;AACA,IAAAW,UAAA,GAAAC,uBAAA,CAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AACA,IAAAc,OAAA,GAAAX,sBAAA,CAAAH,OAAA;AACA,IAAAe,UAAA,GAAAf,OAAA;AAGqB,IAAAgB,WAAA,GAAAhB,OAAA;AAAA,SAAAiB,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,SAAAN,wBAAAM,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,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA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Z;;AAEA;AACA;AACA;AACO,MAAMsC,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":[]}
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';\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};\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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":[]}
@@ -70,7 +70,7 @@ export default function WelcomeGuide() {
70
70
  content: /*#__PURE__*/_jsxs(_Fragment, {
71
71
  children: [/*#__PURE__*/_jsx("h1", {
72
72
  className: "edit-widgets-welcome-guide__heading",
73
- children: __('Make each block your own')
73
+ children: __('Customize each block')
74
74
  }), /*#__PURE__*/_jsx("p", {
75
75
  className: "edit-widgets-welcome-guide__text",
76
76
  children: __('Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.')
@@ -84,7 +84,7 @@ export default function WelcomeGuide() {
84
84
  content: /*#__PURE__*/_jsxs(_Fragment, {
85
85
  children: [/*#__PURE__*/_jsx("h1", {
86
86
  className: "edit-widgets-welcome-guide__heading",
87
- children: __('Get to know the block library')
87
+ children: __('Explore all blocks')
88
88
  }), /*#__PURE__*/_jsx("p", {
89
89
  className: "edit-widgets-welcome-guide__text",
90
90
  children: createInterpolateElement(__('All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'), {
@@ -104,7 +104,7 @@ export default function WelcomeGuide() {
104
104
  content: /*#__PURE__*/_jsxs(_Fragment, {
105
105
  children: [/*#__PURE__*/_jsx("h1", {
106
106
  className: "edit-widgets-welcome-guide__heading",
107
- children: __('Learn how to use the block editor')
107
+ children: __('Learn more')
108
108
  }), /*#__PURE__*/_jsx("p", {
109
109
  className: "edit-widgets-welcome-guide__text",
110
110
  children: createInterpolateElement(__("New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>"), {
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useDispatch","ExternalLink","Guide","__","sprintf","_n","createInterpolateElement","store","preferencesStore","editWidgetsStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","WelcomeGuide","_widgetAreas$filter$l","isActive","select","get","toggle","widgetAreas","getWidgetAreas","per_page","isEntirelyBlockWidgets","every","widgetArea","id","widgets","widgetId","startsWith","numWidgetAreas","filter","length","className","contentLabel","finishButtonText","onFinish","pages","image","WelcomeGuideImage","nonAnimatedSrc","animatedSrc","content","children","href","InserterIconImage","alt","src","a","srcSet","media","width","height"],"sources":["@wordpress/edit-widgets/src/components/welcome-guide/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { ExternalLink, Guide } from '@wordpress/components';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function WelcomeGuide() {\n\tconst isActive = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'welcomeGuide'\n\t\t\t),\n\t\t[]\n\t);\n\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst widgetAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editWidgetsStore ).getWidgetAreas( { per_page: -1 } ),\n\t\t[]\n\t);\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\tconst isEntirelyBlockWidgets = widgetAreas?.every(\n\t\t( widgetArea ) =>\n\t\t\twidgetArea.id === 'wp_inactive_widgets' ||\n\t\t\twidgetArea.widgets.every( ( widgetId ) =>\n\t\t\t\twidgetId.startsWith( 'block-' )\n\t\t\t)\n\t);\n\n\tconst numWidgetAreas =\n\t\twidgetAreas?.filter(\n\t\t\t( widgetArea ) => widgetArea.id !== 'wp_inactive_widgets'\n\t\t).length ?? 0;\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-widgets-welcome-guide\"\n\t\t\tcontentLabel={ __( 'Welcome to block Widgets' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-widgets', 'welcomeGuide' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Welcome to block Widgets' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t{ isEntirelyBlockWidgets ? (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t// Translators: %s: Number of block areas in the current theme.\n\t\t\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t\t\t'Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.',\n\t\t\t\t\t\t\t\t\t\t\t\t'Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.',\n\t\t\t\t\t\t\t\t\t\t\t\tnumWidgetAreas\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tnumWidgetAreas\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Want to stick with the old widgets?'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</strong>{ ' ' }\n\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/plugins/classic-widgets/'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Get the Classic Widgets plugin.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Make each block your own' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Get to know the block library' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tInserterIconImage: (\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-widgets-welcome-guide__inserter-icon\"\n\t\t\t\t\t\t\t\t\t\t\t\talt={ __( 'inserter' ) }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Learn how to use the block editor' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\"New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>\"\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n\nfunction WelcomeGuideImage( { nonAnimatedSrc, animatedSrc } ) {\n\treturn (\n\t\t<picture className=\"edit-widgets-welcome-guide__image\">\n\t\t\t<source\n\t\t\t\tsrcSet={ nonAnimatedSrc }\n\t\t\t\tmedia=\"(prefers-reduced-motion: reduce)\"\n\t\t\t/>\n\t\t\t<img src={ animatedSrc } width=\"312\" height=\"240\" alt=\"\" />\n\t\t</picture>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,SAASC,EAAE,EAAEC,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AACjD,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAExD,eAAe,SAASC,YAAYA,CAAA,EAAG;EAAA,IAAAC,qBAAA;EACtC,MAAMC,QAAQ,GAAGnB,SAAS,CACvBoB,MAAM,IACP,CAAC,CAAEA,MAAM,CAAEX,gBAAiB,CAAC,CAACY,GAAG,CAChC,mBAAmB,EACnB,cACD,CAAC,EACF,EACD,CAAC;EAED,MAAM;IAAEC;EAAO,CAAC,GAAGrB,WAAW,CAAEQ,gBAAiB,CAAC;EAElD,MAAMc,WAAW,GAAGvB,SAAS,CAC1BoB,MAAM,IACPA,MAAM,CAAEV,gBAAiB,CAAC,CAACc,cAAc,CAAE;IAAEC,QAAQ,EAAE,CAAC;EAAE,CAAE,CAAC,EAC9D,EACD,CAAC;EAED,IAA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CAA2C;cACrDa,GAAG,EAAG7C,EAAE,CAAE,UAAW,CAAG;cACxB8C,GAAG,EAAC;YAA2Q,CAC/Q;UAEH,CACD;QAAC,CACC,CAAC;MAAA,CACH;IAEJ,CAAC,EACD;MACCT,KAAK,eACJ7B,IAAA,CAAC8B,iBAAiB;QACjBC,cAAc,EAAC,+DAA+D;QAC9EC,WAAW,EAAC;MAA+D,CAC3E,CACD;MACDC,OAAO,eACN7B,KAAA,CAAAF,SAAA;QAAAgC,QAAA,gBACClC,IAAA;UAAIwB,SAAS,EAAC,qCAAqC;UAAAU,QAAA,EAChD1C,EAAE,CAAE,mCAAoC;QAAC,CACxC,CAAC,eACLQ,IAAA;UAAGwB,SAAS,EAAC,kCAAkC;UAAAU,QAAA,EAC5CvC,wBAAwB,CACzBH,EAAE,CACD,6FACD,CAAC,EACD;YACC+C,CAAC,eACAvC,IAAA,CAACV,YAAY;cACZ6C,IAAI,EAAG3C,EAAE,CACR,qEACD;YAAG,CACH;UAEH,CACD;QAAC,CACC,CAAC;MAAA,CACH;IAEJ,CAAC;EACC,CACH,CAAC;AAEJ;AAEA,SAASsC,iBAAiBA,CAAE;EAAEC,cAAc;EAAEC;AAAY,CAAC,EAAG;EAC7D,oBACC5B,KAAA;IAASoB,SAAS,EAAC,mCAAmC;IAAAU,QAAA,gBACrDlC,IAAA;MACCwC,MAAM,EAAGT,cAAgB;MACzBU,KAAK,EAAC;IAAkC,CACxC,CAAC,eACFzC,IAAA;MAAKsC,GAAG,EAAGN,WAAa;MAACU,KAAK,EAAC,KAAK;MAACC,MAAM,EAAC,KAAK;MAACN,GAAG,EAAC;IAAE,CAAE,CAAC;EAAA,CACnD,CAAC;AAEZ","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","useDispatch","ExternalLink","Guide","__","sprintf","_n","createInterpolateElement","store","preferencesStore","editWidgetsStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","WelcomeGuide","_widgetAreas$filter$l","isActive","select","get","toggle","widgetAreas","getWidgetAreas","per_page","isEntirelyBlockWidgets","every","widgetArea","id","widgets","widgetId","startsWith","numWidgetAreas","filter","length","className","contentLabel","finishButtonText","onFinish","pages","image","WelcomeGuideImage","nonAnimatedSrc","animatedSrc","content","children","href","InserterIconImage","alt","src","a","srcSet","media","width","height"],"sources":["@wordpress/edit-widgets/src/components/welcome-guide/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { ExternalLink, Guide } from '@wordpress/components';\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editWidgetsStore } from '../../store';\n\nexport default function WelcomeGuide() {\n\tconst isActive = useSelect(\n\t\t( select ) =>\n\t\t\t!! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'welcomeGuide'\n\t\t\t),\n\t\t[]\n\t);\n\n\tconst { toggle } = useDispatch( preferencesStore );\n\n\tconst widgetAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editWidgetsStore ).getWidgetAreas( { per_page: -1 } ),\n\t\t[]\n\t);\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\tconst isEntirelyBlockWidgets = widgetAreas?.every(\n\t\t( widgetArea ) =>\n\t\t\twidgetArea.id === 'wp_inactive_widgets' ||\n\t\t\twidgetArea.widgets.every( ( widgetId ) =>\n\t\t\t\twidgetId.startsWith( 'block-' )\n\t\t\t)\n\t);\n\n\tconst numWidgetAreas =\n\t\twidgetAreas?.filter(\n\t\t\t( widgetArea ) => widgetArea.id !== 'wp_inactive_widgets'\n\t\t).length ?? 0;\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-widgets-welcome-guide\"\n\t\t\tcontentLabel={ __( 'Welcome to block Widgets' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggle( 'core/edit-widgets', 'welcomeGuide' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Welcome to block Widgets' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t{ isEntirelyBlockWidgets ? (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t\t\t// Translators: %s: Number of block areas in the current theme.\n\t\t\t\t\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t\t\t\t\t'Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.',\n\t\t\t\t\t\t\t\t\t\t\t\t'Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.',\n\t\t\t\t\t\t\t\t\t\t\t\tnumWidgetAreas\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\tnumWidgetAreas\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t'You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Want to stick with the old widgets?'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</strong>{ ' ' }\n\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/plugins/classic-widgets/'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Get the Classic Widgets plugin.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Customize each block' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Explore all blocks' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tInserterIconImage: (\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-widgets-welcome-guide__inserter-icon\"\n\t\t\t\t\t\t\t\t\t\t\t\talt={ __( 'inserter' ) }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-widgets-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Learn more' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-widgets-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\"New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>\"\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n\nfunction WelcomeGuideImage( { nonAnimatedSrc, animatedSrc } ) {\n\treturn (\n\t\t<picture className=\"edit-widgets-welcome-guide__image\">\n\t\t\t<source\n\t\t\t\tsrcSet={ nonAnimatedSrc }\n\t\t\t\tmedia=\"(prefers-reduced-motion: reduce)\"\n\t\t\t/>\n\t\t\t<img src={ animatedSrc } width=\"312\" height=\"240\" alt=\"\" />\n\t\t</picture>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,YAAY,EAAEC,KAAK,QAAQ,uBAAuB;AAC3D,SAASC,EAAE,EAAEC,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AACjD,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAExD,eAAe,SAASC,YAAYA,CAAA,EAAG;EAAA,IAAAC,qBAAA;EACtC,MAAMC,QAAQ,GAAGnB,SAAS,CACvBoB,MAAM,IACP,CAAC,CAAEA,MAAM,CAAEX,gBAAiB,CAAC,CAACY,GAAG,CAChC,mBAAmB,EACnB,cACD,CAAC,EACF,EACD,CAAC;EAED,MAAM;IAAEC;EAAO,CAAC,GAAGrB,WAAW,CAAEQ,gBAAiB,CAAC;EAElD,MAAMc,WAAW,GAAGvB,SAAS,CAC1BoB,MAAM,IACPA,MAAM,CAAEV,gBAAiB,CAAC,CAACc,cAAc,CAAE;IAAEC,QAAQ,EAAE,CAAC;EAAE,CAAE,CAAC,EAC9D,EACD,CAAC;EAED,IAAK,CAAEN,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,MAAMO,sBAAsB,GAAGH,WAAW,EAAEI,KAAK,CAC9CC,UAAU,IACXA,UAAU,CAACC,EAAE,KAAK,qBAAqB,IACvCD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AAK,eACJ7B,IAAA,CAAC8B,iBAAiB;QACjBC,cAAc,EAAC,+DAA+D;QAC9EC,WAAW,EAAC;MAA+D,CAC3E,CACD;MACDC,OAAO,eACN7B,KAAA,CAAAF,SAAA;QAAAgC,QAAA,gBACClC,IAAA;UAAIwB,SAAS,EAAC,qCAAqC;UAAAU,QAAA,EAChD1C,EAAE,CAAE,YAAa;QAAC,CACjB,CAAC,eACLQ,IAAA;UAAGwB,SAAS,EAAC,kCAAkC;UAAAU,QAAA,EAC5CvC,wBAAwB,CACzBH,EAAE,CACD,6FACD,CAAC,EACD;YACC+C,CAAC,eACAvC,IAAA,CAACV,YAAY;cACZ6C,IAAI,EAAG3C,EAAE,CACR,qEACD;YAAG,CACH;UAEH,CACD;QAAC,CACC,CAAC;MAAA,CACH;IAEJ,CAAC;EACC,CACH,CAAC;AAEJ;AAEA,SAASsC,iBAAiBA,CAAE;EAAEC,cAAc;EAAEC;AAAY,CAAC,EAAG;EAC7D,oBACC5B,KAAA;IAASoB,SAAS,EAAC,mCAAmC;IAAAU,QAAA,gBACrDlC,IAAA;MACCwC,MAAM,EAAGT,cAAgB;MACzBU,KAAK,EAAC;IAAkC,CACxC,CAAC,eACFzC,IAAA;MAAKsC,GAAG,EAAGN,WAAa;MAACU,KAAK,EAAC,KAAK;MAACC,MAAM,EAAC,KAAK;MAACN,GAAG,EAAC;IAAE,CAAE,CAAC;EAAA,CACnD,CAAC;AAEZ","ignoreList":[]}
@@ -96,7 +96,8 @@ export default function WidgetAreasBlockEditorProvider({
96
96
  templateLock: 'all',
97
97
  __experimentalSetIsInserterOpened: setIsInserterOpened,
98
98
  pageOnFront,
99
- pageForPosts
99
+ pageForPosts,
100
+ editorTool: 'edit'
100
101
  };
101
102
  }, [hasUploadPermissions, blockEditorSettings, isFixedToolbarActive, isLargeViewport, keepCaretInsideBlock, reusableBlocks, setIsInserterOpened, pageOnFront, pageForPosts]);
102
103
  const widgetAreaId = useLastSelectedWidgetArea();
@@ -1 +1 @@
1
- {"version":3,"names":["SlotFillProvider","useViewportMatch","uploadMedia","useDispatch","useSelect","useEntityBlockEditor","store","coreStore","useMemo","privateApis","blockEditorPrivateApis","editPatternsPrivateApis","preferencesStore","blockLibraryPrivateApis","KeyboardShortcuts","buildWidgetAreasPostId","KIND","POST_TYPE","useLastSelectedWidgetArea","editWidgetsStore","ALLOW_REUSABLE_BLOCKS","unlock","jsx","_jsx","jsxs","_jsxs","ExperimentalBlockEditorProvider","PatternsMenuItems","BlockKeyboardShortcuts","EMPTY_ARRAY","WidgetAreasBlockEditorProvider","blockEditorSettings","children","props","isLargeViewport","hasUploadPermissions","reusableBlocks","isFixedToolbarActive","keepCaretInsideBlock","pageOnFront","pageForPosts","select","_canUser","canUser","getEntityRecord","getEntityRecords","siteSettings","kind","name","undefined","get","page_on_front","page_for_posts","setIsInserterOpened","settings","mediaUploadBlockEditor","onError","argumentsObject","wpAllowedMimeTypes","allowedMimeTypes","message","__experimentalReusableBlocks","hasFixedToolbar","mediaUpload","templateLock","__experimentalSetIsInserterOpened","widgetAreaId","blocks","onInput","onChange","id","Register","value","useSubRegistry","rootClientId"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SlotFillProvider } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEntityBlockEditor, store as coreStore } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport { buildWidgetAreasPostId, KIND, POST_TYPE } from '../../store/utils';\nimport useLastSelectedWidgetArea from '../../hooks/use-last-selected-widget-area';\nimport { store as editWidgetsStore } from '../../store';\nimport { ALLOW_REUSABLE_BLOCKS } from '../../constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nexport default function WidgetAreasBlockEditorProvider( {\n\tblockEditorSettings,\n\tchildren,\n\t...props\n} ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\thasUploadPermissions,\n\t\treusableBlocks,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEntityRecords } =\n\t\t\tselect( coreStore );\n\t\tconst siteSettings = canUser( 'read', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\treturn {\n\t\t\thasUploadPermissions:\n\t\t\t\tcanUser( 'create', {\n\t\t\t\t\tkind: 'root',\n\t\t\t\t\tname: 'media',\n\t\t\t\t} ) ?? true,\n\t\t\treusableBlocks: ALLOW_REUSABLE_BLOCKS\n\t\t\t\t? getEntityRecords( 'postType', 'wp_block' )\n\t\t\t\t: EMPTY_ARRAY,\n\t\t\tisFixedToolbarActive: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst settings = useMemo( () => {\n\t\tlet mediaUploadBlockEditor;\n\t\tif ( hasUploadPermissions ) {\n\t\t\tmediaUploadBlockEditor = ( { onError, ...argumentsObject } ) => {\n\t\t\t\tuploadMedia( {\n\t\t\t\t\twpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes,\n\t\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t\t...argumentsObject,\n\t\t\t\t} );\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...blockEditorSettings,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\thasFixedToolbar: isFixedToolbarActive || ! isLargeViewport,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: mediaUploadBlockEditor,\n\t\t\ttemplateLock: 'all',\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t};\n\t}, [\n\t\thasUploadPermissions,\n\t\tblockEditorSettings,\n\t\tisFixedToolbarActive,\n\t\tisLargeViewport,\n\t\tkeepCaretInsideBlock,\n\t\treusableBlocks,\n\t\tsetIsInserterOpened,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t] );\n\n\tconst widgetAreaId = useLastSelectedWidgetArea();\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\tKIND,\n\t\tPOST_TYPE,\n\t\t{ id: buildWidgetAreasPostId() }\n\t);\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<KeyboardShortcuts.Register />\n\t\t\t<BlockKeyboardShortcuts />\n\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\tvalue={ blocks }\n\t\t\t\tonInput={ onInput }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tsettings={ settings }\n\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t<PatternsMenuItems rootClientId={ widgetAreaId }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ACVT,IAAA,CAACI,iBAAiB;QAAC+C,YAAY,EAAGR;MAAc,CAAE,CAAC;IAAA,CACnB,CAAC;EAAA,CACjB,CAAC;AAErB","ignoreList":[]}
1
+ {"version":3,"names":["SlotFillProvider","useViewportMatch","uploadMedia","useDispatch","useSelect","useEntityBlockEditor","store","coreStore","useMemo","privateApis","blockEditorPrivateApis","editPatternsPrivateApis","preferencesStore","blockLibraryPrivateApis","KeyboardShortcuts","buildWidgetAreasPostId","KIND","POST_TYPE","useLastSelectedWidgetArea","editWidgetsStore","ALLOW_REUSABLE_BLOCKS","unlock","jsx","_jsx","jsxs","_jsxs","ExperimentalBlockEditorProvider","PatternsMenuItems","BlockKeyboardShortcuts","EMPTY_ARRAY","WidgetAreasBlockEditorProvider","blockEditorSettings","children","props","isLargeViewport","hasUploadPermissions","reusableBlocks","isFixedToolbarActive","keepCaretInsideBlock","pageOnFront","pageForPosts","select","_canUser","canUser","getEntityRecord","getEntityRecords","siteSettings","kind","name","undefined","get","page_on_front","page_for_posts","setIsInserterOpened","settings","mediaUploadBlockEditor","onError","argumentsObject","wpAllowedMimeTypes","allowedMimeTypes","message","__experimentalReusableBlocks","hasFixedToolbar","mediaUpload","templateLock","__experimentalSetIsInserterOpened","editorTool","widgetAreaId","blocks","onInput","onChange","id","Register","value","useSubRegistry","rootClientId"],"sources":["@wordpress/edit-widgets/src/components/widget-areas-block-editor-provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { SlotFillProvider } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEntityBlockEditor, store as coreStore } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport { buildWidgetAreasPostId, KIND, POST_TYPE } from '../../store/utils';\nimport useLastSelectedWidgetArea from '../../hooks/use-last-selected-widget-area';\nimport { store as editWidgetsStore } from '../../store';\nimport { ALLOW_REUSABLE_BLOCKS } from '../../constants';\nimport { unlock } from '../../lock-unlock';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nexport default function WidgetAreasBlockEditorProvider( {\n\tblockEditorSettings,\n\tchildren,\n\t...props\n} ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\thasUploadPermissions,\n\t\treusableBlocks,\n\t\tisFixedToolbarActive,\n\t\tkeepCaretInsideBlock,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEntityRecords } =\n\t\t\tselect( coreStore );\n\t\tconst siteSettings = canUser( 'read', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} )\n\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\treturn {\n\t\t\thasUploadPermissions:\n\t\t\t\tcanUser( 'create', {\n\t\t\t\t\tkind: 'root',\n\t\t\t\t\tname: 'media',\n\t\t\t\t} ) ?? true,\n\t\t\treusableBlocks: ALLOW_REUSABLE_BLOCKS\n\t\t\t\t? getEntityRecords( 'postType', 'wp_block' )\n\t\t\t\t: EMPTY_ARRAY,\n\t\t\tisFixedToolbarActive: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t};\n\t}, [] );\n\tconst { setIsInserterOpened } = useDispatch( editWidgetsStore );\n\n\tconst settings = useMemo( () => {\n\t\tlet mediaUploadBlockEditor;\n\t\tif ( hasUploadPermissions ) {\n\t\t\tmediaUploadBlockEditor = ( { onError, ...argumentsObject } ) => {\n\t\t\t\tuploadMedia( {\n\t\t\t\t\twpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes,\n\t\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t\t...argumentsObject,\n\t\t\t\t} );\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...blockEditorSettings,\n\t\t\t__experimentalReusableBlocks: reusableBlocks,\n\t\t\thasFixedToolbar: isFixedToolbarActive || ! isLargeViewport,\n\t\t\tkeepCaretInsideBlock,\n\t\t\tmediaUpload: mediaUploadBlockEditor,\n\t\t\ttemplateLock: 'all',\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\teditorTool: 'edit',\n\t\t};\n\t}, [\n\t\thasUploadPermissions,\n\t\tblockEditorSettings,\n\t\tisFixedToolbarActive,\n\t\tisLargeViewport,\n\t\tkeepCaretInsideBlock,\n\t\treusableBlocks,\n\t\tsetIsInserterOpened,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t] );\n\n\tconst widgetAreaId = useLastSelectedWidgetArea();\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\tKIND,\n\t\tPOST_TYPE,\n\t\t{ id: buildWidgetAreasPostId() }\n\t);\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<KeyboardShortcuts.Register />\n\t\t\t<BlockKeyboardShortcuts />\n\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\tvalue={ blocks }\n\t\t\t\tonInput={ onInput }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tsettings={ settings }\n\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t\t<PatternsMenuItems rootClientId={ widgetAreaId } />\n\t\t\t</ExperimentalBlockEditorProvider>\n\t\t</SlotFillProvider>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,oBAAoB,EAAEC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AAC/E,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;AAC/E,SAASD,WAAW,IAAIE,uBAAuB,QAAQ,qBAAqB;AAC5E,SAASL,KAAK,IAAIM,gBAAgB,QAAQ,wBAAwB;AAClE,SAASH,WAAW,IAAII,uBAAuB,QAAQ,0BAA0B;;AAEjF;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,SAASC,sBAAsB,EAAEC,IAAI,EAAEC,SAAS,QAAQ,mBAAmB;AAC3E,OAAOC,yBAAyB,MAAM,2CAA2C;AACjF,SAASZ,KAAK,IAAIa,gBAAgB,QAAQ,aAAa;AACvD,SAASC,qBAAqB,QAAQ,iBAAiB;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE3C,MAAM;EAAEC;AAAgC,CAAC,GAAGL,MAAM,CAAEX,sBAAuB,CAAC;AAC5E,MAAM;EAAEiB;AAAkB,CAAC,GAAGN,MAAM,CAAEV,uBAAwB,CAAC;AAC/D,MAAM;EAAEiB;AAAuB,CAAC,GAAGP,MAAM,CAAER,uBAAwB,CAAC;AAEpE,MAA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AAK,EAAGL,MAAQ;MAChBC,OAAO,EAAGA,OAAS;MACnBC,QAAQ,EAAGA,QAAU;MACrBhB,QAAQ,EAAGA,QAAU;MACrBoB,cAAc,EAAG,KAAO;MAAA,GACnBzC,KAAK;MAAAD,QAAA,GAERA,QAAQ,eACVT,IAAA,CAACI,iBAAiB;QAACgD,YAAY,EAAGR;MAAc,CAAE,CAAC;IAAA,CACnB,CAAC;EAAA,CACjB,CAAC;AAErB","ignoreList":[]}
@@ -6,7 +6,6 @@ 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 { privateApis as editorPrivateApis } from '@wordpress/editor';
10
9
  import { StrictMode, createRoot } from '@wordpress/element';
11
10
  import { registerCoreBlocks, __experimentalGetCoreBlocks, __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';
12
11
  import { __experimentalFetchLinkSuggestions as fetchLinkSuggestions } from '@wordpress/core-data';
@@ -19,14 +18,10 @@ import { store as preferencesStore } from '@wordpress/preferences';
19
18
  import './store';
20
19
  import './filters';
21
20
  import * as widgetArea from './blocks/widget-area';
22
- import { unlock } from './lock-unlock';
23
21
  import Layout from './components/layout';
24
22
  import { ALLOW_REUSABLE_BLOCKS, ENABLE_EXPERIMENTAL_FSE_BLOCKS } from './constants';
25
23
  import { jsx as _jsx } from "react/jsx-runtime";
26
24
  const disabledBlocks = ['core/more', 'core/freeform', 'core/template-part', ...(ALLOW_REUSABLE_BLOCKS ? [] : ['core/block'])];
27
- const {
28
- registerCoreBlockBindingsSources
29
- } = unlock(editorPrivateApis);
30
25
 
31
26
  /**
32
27
  * Initializes the block editor in the widgets screen.
@@ -48,7 +43,6 @@ export function initializeEditor(id, settings) {
48
43
  });
49
44
  dispatch(blocksStore).reapplyBlockTypeFilters();
50
45
  registerCoreBlocks(coreBlocks);
51
- registerCoreBlockBindingsSources();
52
46
  registerLegacyWidgetBlock();
53
47
  if (globalThis.IS_GUTENBERG_PLUGIN) {
54
48
  __experimentalRegisterExperimentalCoreBlocks({
@@ -1 +1 @@
1
- {"version":3,"names":["registerBlockType","unstable__bootstrapServerSideBlockDefinitions","setFreeformContentHandlerName","store","blocksStore","dispatch","deprecated","privateApis","editorPrivateApis","StrictMode","createRoot","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","registerLegacyWidgetBlock","registerLegacyWidgetVariations","registerWidgetGroupBlock","preferencesStore","widgetArea","unlock","Layout","ALLOW_REUSABLE_BLOCKS","ENABLE_EXPERIMENTAL_FSE_BLOCKS","jsx","_jsx","disabledBlocks","registerCoreBlockBindingsSources","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 { privateApis as editorPrivateApis } from '@wordpress/editor';\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 { unlock } from './lock-unlock';\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\nconst { registerCoreBlockBindingsSources } = unlock( editorPrivateApis );\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\tregisterCoreBlockBindingsSources();\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,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,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,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I,GAAIqB;IAAS,CAAE,CAAC;EACxE;EACA7D,iBAAiB,CAAEwC,IAAI,EAAET,QAAS,CAAC;AACpC,CAAC;AAED,SAAS5B,KAAK,QAAQ,SAAS","ignoreList":[]}
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';\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,OAAO,KAAKC,UAAU,MAAM,sBAAsB;AAClD,OAAOC,MAAM,MAAM,qBAAqB;AACxC,SACCC,qBAAqB,EACr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AA8B,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,cACV3B,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":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-widgets",
3
- "version": "6.13.0",
3
+ "version": "6.13.1-next.a9f418477.0",
4
4
  "description": "Widgets Page module for WordPress..",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -29,33 +29,32 @@
29
29
  "wpScript": true,
30
30
  "dependencies": {
31
31
  "@babel/runtime": "7.25.7",
32
- "@wordpress/api-fetch": "*",
33
- "@wordpress/block-editor": "*",
34
- "@wordpress/block-library": "*",
35
- "@wordpress/blocks": "*",
32
+ "@wordpress/api-fetch": "^7.13.1-next.a9f418477.0",
33
+ "@wordpress/block-editor": "^14.8.1-next.a9f418477.0",
34
+ "@wordpress/block-library": "^9.13.1-next.a9f418477.0",
35
+ "@wordpress/blocks": "^14.2.1-next.a9f418477.0",
36
36
  "@wordpress/components": "*",
37
- "@wordpress/compose": "*",
38
- "@wordpress/core-data": "*",
39
- "@wordpress/data": "*",
40
- "@wordpress/deprecated": "*",
41
- "@wordpress/dom": "*",
42
- "@wordpress/editor": "*",
43
- "@wordpress/element": "*",
44
- "@wordpress/hooks": "*",
45
- "@wordpress/i18n": "*",
46
- "@wordpress/icons": "*",
47
- "@wordpress/interface": "*",
48
- "@wordpress/keyboard-shortcuts": "*",
49
- "@wordpress/keycodes": "*",
50
- "@wordpress/media-utils": "*",
51
- "@wordpress/notices": "*",
52
- "@wordpress/patterns": "*",
53
- "@wordpress/plugins": "*",
54
- "@wordpress/preferences": "*",
55
- "@wordpress/private-apis": "*",
56
- "@wordpress/reusable-blocks": "*",
57
- "@wordpress/url": "*",
58
- "@wordpress/widgets": "*",
37
+ "@wordpress/compose": "^7.13.1-next.a9f418477.0",
38
+ "@wordpress/core-data": "^7.13.1-next.a9f418477.0",
39
+ "@wordpress/data": "^10.13.1-next.a9f418477.0",
40
+ "@wordpress/deprecated": "^4.13.1-next.a9f418477.0",
41
+ "@wordpress/dom": "^4.13.1-next.a9f418477.0",
42
+ "@wordpress/element": "^6.13.1-next.a9f418477.0",
43
+ "@wordpress/hooks": "^4.13.1-next.a9f418477.0",
44
+ "@wordpress/i18n": "^5.13.1-next.a9f418477.0",
45
+ "@wordpress/icons": "^10.13.1-next.a9f418477.0",
46
+ "@wordpress/interface": "^8.2.1-next.a9f418477.0",
47
+ "@wordpress/keyboard-shortcuts": "^5.13.1-next.a9f418477.0",
48
+ "@wordpress/keycodes": "^4.13.1-next.a9f418477.0",
49
+ "@wordpress/media-utils": "^5.13.1-next.a9f418477.0",
50
+ "@wordpress/notices": "^5.13.1-next.a9f418477.0",
51
+ "@wordpress/patterns": "^2.13.1-next.a9f418477.0",
52
+ "@wordpress/plugins": "^7.13.1-next.a9f418477.0",
53
+ "@wordpress/preferences": "^4.13.1-next.a9f418477.0",
54
+ "@wordpress/private-apis": "^1.13.1-next.a9f418477.0",
55
+ "@wordpress/reusable-blocks": "^5.13.1-next.a9f418477.0",
56
+ "@wordpress/url": "^4.13.1-next.a9f418477.0",
57
+ "@wordpress/widgets": "^4.13.1-next.a9f418477.0",
59
58
  "clsx": "^2.1.1"
60
59
  },
61
60
  "peerDependencies": {
@@ -65,5 +64,5 @@
65
64
  "publishConfig": {
66
65
  "access": "public"
67
66
  },
68
- "gitHead": "cce81c13739c2a8b53d91df90c4f037cb68c2665"
67
+ "gitHead": "c1a8f3e9cada3b7d8342d1d2595c2dac0433111d"
69
68
  }
@@ -118,7 +118,7 @@ export default function WelcomeGuide() {
118
118
  content: (
119
119
  <>
120
120
  <h1 className="edit-widgets-welcome-guide__heading">
121
- { __( 'Make each block your own' ) }
121
+ { __( 'Customize each block' ) }
122
122
  </h1>
123
123
  <p className="edit-widgets-welcome-guide__text">
124
124
  { __(
@@ -138,7 +138,7 @@ export default function WelcomeGuide() {
138
138
  content: (
139
139
  <>
140
140
  <h1 className="edit-widgets-welcome-guide__heading">
141
- { __( 'Get to know the block library' ) }
141
+ { __( 'Explore all blocks' ) }
142
142
  </h1>
143
143
  <p className="edit-widgets-welcome-guide__text">
144
144
  { createInterpolateElement(
@@ -169,7 +169,7 @@ export default function WelcomeGuide() {
169
169
  content: (
170
170
  <>
171
171
  <h1 className="edit-widgets-welcome-guide__heading">
172
- { __( 'Learn how to use the block editor' ) }
172
+ { __( 'Learn more' ) }
173
173
  </h1>
174
174
  <p className="edit-widgets-welcome-guide__text">
175
175
  { createInterpolateElement(
@@ -94,6 +94,7 @@ export default function WidgetAreasBlockEditorProvider( {
94
94
  __experimentalSetIsInserterOpened: setIsInserterOpened,
95
95
  pageOnFront,
96
96
  pageForPosts,
97
+ editorTool: 'edit',
97
98
  };
98
99
  }, [
99
100
  hasUploadPermissions,
package/src/index.js CHANGED
@@ -9,7 +9,6 @@ import {
9
9
  } from '@wordpress/blocks';
10
10
  import { dispatch } from '@wordpress/data';
11
11
  import deprecated from '@wordpress/deprecated';
12
- import { privateApis as editorPrivateApis } from '@wordpress/editor';
13
12
  import { StrictMode, createRoot } from '@wordpress/element';
14
13
  import {
15
14
  registerCoreBlocks,
@@ -30,7 +29,6 @@ import { store as preferencesStore } from '@wordpress/preferences';
30
29
  import './store';
31
30
  import './filters';
32
31
  import * as widgetArea from './blocks/widget-area';
33
- import { unlock } from './lock-unlock';
34
32
  import Layout from './components/layout';
35
33
  import {
36
34
  ALLOW_REUSABLE_BLOCKS,
@@ -44,8 +42,6 @@ const disabledBlocks = [
44
42
  ...( ALLOW_REUSABLE_BLOCKS ? [] : [ 'core/block' ] ),
45
43
  ];
46
44
 
47
- const { registerCoreBlockBindingsSources } = unlock( editorPrivateApis );
48
-
49
45
  /**
50
46
  * Initializes the block editor in the widgets screen.
51
47
  *
@@ -75,7 +71,6 @@ export function initializeEditor( id, settings ) {
75
71
 
76
72
  dispatch( blocksStore ).reapplyBlockTypeFilters();
77
73
  registerCoreBlocks( coreBlocks );
78
- registerCoreBlockBindingsSources();
79
74
  registerLegacyWidgetBlock();
80
75
  if ( globalThis.IS_GUTENBERG_PLUGIN ) {
81
76
  __experimentalRegisterExperimentalCoreBlocks( {