@wordpress/edit-widgets 3.2.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,13 +2,23 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 4.0.0 (2022-02-10)
6
+
7
+ ### Breaking Change
8
+
9
+ - The `GUTENBERG_PHASE` environment variable has been renamed to `IS_GUTENBERG_PLUGIN` and is now a boolean ([#38202](https://github.com/WordPress/gutenberg/pull/38202)).
10
+
11
+ ### Bug Fix
12
+
13
+ - Removed unused `@wordpress/a11y`, `@wordpress/server-side-render`, `rememo` and `uuid` dependencies ([#38388](https://github.com/WordPress/gutenberg/pull/38388)).
14
+
5
15
  ## 3.2.0 (2022-01-27)
6
16
 
7
17
  ## 3.1.0 (2021-11-07)
8
18
 
9
19
  ### Enhancement
10
20
 
11
- - Enable persistent List View in the widget editor [#35706](https://github.com/WordPress/gutenberg/pull/35706).
21
+ - Enable persistent List View in the widget editor [#35706](https://github.com/WordPress/gutenberg/pull/35706).
12
22
 
13
23
  ## 3.0.0 (2021-07-29)
14
24
 
package/README.md CHANGED
@@ -18,8 +18,6 @@ npm install @wordpress/edit-widgets
18
18
 
19
19
  _This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._
20
20
 
21
- <br/><br/><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>
22
-
23
21
  ## How this works
24
22
 
25
23
  The new Widgets screen in WordPress admin is another block editor, just like the Post editor or the experimental site editor. Hence it will be referred often as the Widgets editor.
@@ -39,3 +37,11 @@ In order to make the experience as seamless as possible for users, the following
39
37
  - for every available widget, a variation of the widget block is registered so that the user can see and search by the exact name of what they need
40
38
  - all widgets that have a block equivalent (a block that fulfills the same function) can be made not available as a widget block variation via a filter
41
39
  - all core widgets that have a block equivalent are not available as a widget block variation
40
+
41
+ ## Contributing to this package
42
+
43
+ This is an individual package that's part of the Gutenberg project. The project is organized as a monorepo. It's made up of multiple self-contained software packages, each with a specific purpose. The packages in this monorepo are published to [npm](https://www.npmjs.com/) and used by [WordPress](https://make.wordpress.org/core/) as well as other software projects.
44
+
45
+ To find out more about contributing to this package or Gutenberg as a whole, please read the project's main [contributor guide](https://github.com/WordPress/gutenberg/tree/HEAD/CONTRIBUTING.md).
46
+
47
+ <br /><br /><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>
@@ -9,10 +9,16 @@ exports.default = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
+ var _i18n = require("@wordpress/i18n");
13
+
12
14
  var _components = require("@wordpress/components");
13
15
 
16
+ var _data = require("@wordpress/data");
17
+
14
18
  var _plugins = require("@wordpress/plugins");
15
19
 
20
+ var _notices = require("@wordpress/notices");
21
+
16
22
  var _errorBoundary = _interopRequireDefault(require("../error-boundary"));
17
23
 
18
24
  var _widgetAreasBlockEditorProvider = _interopRequireDefault(require("../widget-areas-block-editor-provider"));
@@ -37,13 +43,25 @@ function Layout(_ref) {
37
43
  blockEditorSettings,
38
44
  onError
39
45
  } = _ref;
46
+ const {
47
+ createErrorNotice
48
+ } = (0, _data.useDispatch)(_notices.store);
49
+
50
+ function onPluginAreaError(name) {
51
+ createErrorNotice((0, _i18n.sprintf)(
52
+ /* translators: %s: plugin name */
53
+ (0, _i18n.__)('The "%s" plugin has encountered an error and cannot be rendered.'), name));
54
+ }
55
+
40
56
  return (0, _element.createElement)(_errorBoundary.default, {
41
57
  onError: onError
42
58
  }, (0, _element.createElement)(_widgetAreasBlockEditorProvider.default, {
43
59
  blockEditorSettings: blockEditorSettings
44
60
  }, (0, _element.createElement)(_interface.default, {
45
61
  blockEditorSettings: blockEditorSettings
46
- }), (0, _element.createElement)(_sidebar.default, null), (0, _element.createElement)(_components.Popover.Slot, null), (0, _element.createElement)(_plugins.PluginArea, null), (0, _element.createElement)(_unsavedChangesWarning.default, null), (0, _element.createElement)(_welcomeGuide.default, null)));
62
+ }), (0, _element.createElement)(_sidebar.default, null), (0, _element.createElement)(_components.Popover.Slot, null), (0, _element.createElement)(_plugins.PluginArea, {
63
+ onError: onPluginAreaError
64
+ }), (0, _element.createElement)(_unsavedChangesWarning.default, null), (0, _element.createElement)(_welcomeGuide.default, null)));
47
65
  }
48
66
 
49
67
  var _default = Layout;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/layout/index.js"],"names":["Layout","blockEditorSettings","onError"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAdA;AACA;AACA;;AAIA;AACA;AACA;AAQA,SAASA,MAAT,OAAoD;AAAA,MAAnC;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA;AAAvB,GAAmC;AACnD,SACC,4BAAC,sBAAD;AAAe,IAAA,OAAO,EAAGA;AAAzB,KACC,4BAAC,uCAAD;AACC,IAAA,mBAAmB,EAAGD;AADvB,KAGC,4BAAC,kBAAD;AAAW,IAAA,mBAAmB,EAAGA;AAAjC,IAHD,EAIC,4BAAC,gBAAD,OAJD,EAKC,4BAAC,mBAAD,CAAS,IAAT,OALD,EAMC,4BAAC,mBAAD,OAND,EAOC,4BAAC,8BAAD,OAPD,EAQC,4BAAC,qBAAD,OARD,CADD,CADD;AAcA;;eAEcD,M","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Popover } from '@wordpress/components';\nimport { PluginArea } from '@wordpress/plugins';\n\n/**\n * Internal dependencies\n */\nimport ErrorBoundary from '../error-boundary';\nimport WidgetAreasBlockEditorProvider from '../widget-areas-block-editor-provider';\nimport Sidebar from '../sidebar';\nimport Interface from './interface';\nimport UnsavedChangesWarning from './unsaved-changes-warning';\nimport WelcomeGuide from '../welcome-guide';\n\nfunction Layout( { blockEditorSettings, onError } ) {\n\treturn (\n\t\t<ErrorBoundary onError={ onError }>\n\t\t\t<WidgetAreasBlockEditorProvider\n\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t>\n\t\t\t\t<Interface blockEditorSettings={ blockEditorSettings } />\n\t\t\t\t<Sidebar />\n\t\t\t\t<Popover.Slot />\n\t\t\t\t<PluginArea />\n\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t<WelcomeGuide />\n\t\t\t</WidgetAreasBlockEditorProvider>\n\t\t</ErrorBoundary>\n\t);\n}\n\nexport default Layout;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-widgets/src/components/layout/index.js"],"names":["Layout","blockEditorSettings","onError","createErrorNotice","noticesStore","onPluginAreaError","name"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAOA;AACA;AACA;AAQA,SAASA,MAAT,OAAoD;AAAA,MAAnC;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA;AAAvB,GAAmC;AACnD,QAAM;AAAEC,IAAAA;AAAF,MAAwB,uBAAaC,cAAb,CAA9B;;AAEA,WAASC,iBAAT,CAA4BC,IAA5B,EAAmC;AAClCH,IAAAA,iBAAiB,CAChB;AACC;AACA,kBACC,kEADD,CAFD,EAKCG,IALD,CADgB,CAAjB;AASA;;AAED,SACC,4BAAC,sBAAD;AAAe,IAAA,OAAO,EAAGJ;AAAzB,KACC,4BAAC,uCAAD;AACC,IAAA,mBAAmB,EAAGD;AADvB,KAGC,4BAAC,kBAAD;AAAW,IAAA,mBAAmB,EAAGA;AAAjC,IAHD,EAIC,4BAAC,gBAAD,OAJD,EAKC,4BAAC,mBAAD,CAAS,IAAT,OALD,EAMC,4BAAC,mBAAD;AAAY,IAAA,OAAO,EAAGI;AAAtB,IAND,EAOC,4BAAC,8BAAD,OAPD,EAQC,4BAAC,qBAAD,OARD,CADD,CADD;AAcA;;eAEcL,M","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Popover } from '@wordpress/components';\nimport { useDispatch } from '@wordpress/data';\nimport { PluginArea } from '@wordpress/plugins';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport ErrorBoundary from '../error-boundary';\nimport WidgetAreasBlockEditorProvider from '../widget-areas-block-editor-provider';\nimport Sidebar from '../sidebar';\nimport Interface from './interface';\nimport UnsavedChangesWarning from './unsaved-changes-warning';\nimport WelcomeGuide from '../welcome-guide';\n\nfunction Layout( { blockEditorSettings, onError } ) {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<ErrorBoundary onError={ onError }>\n\t\t\t<WidgetAreasBlockEditorProvider\n\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t>\n\t\t\t\t<Interface blockEditorSettings={ blockEditorSettings } />\n\t\t\t\t<Sidebar />\n\t\t\t\t<Popover.Slot />\n\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t<WelcomeGuide />\n\t\t\t</WidgetAreasBlockEditorProvider>\n\t\t</ErrorBoundary>\n\t);\n}\n\nexport default Layout;\n"]}
@@ -25,6 +25,8 @@ var _compose = require("@wordpress/compose");
25
25
 
26
26
  var _keyboardShortcutHelpModal = _interopRequireDefault(require("../keyboard-shortcut-help-modal"));
27
27
 
28
+ var _toolsMoreMenuGroup = _interopRequireDefault(require("./tools-more-menu-group"));
29
+
28
30
  /**
29
31
  * WordPress dependencies
30
32
  */
@@ -39,7 +41,7 @@ function MoreMenu() {
39
41
 
40
42
  (0, _keyboardShortcuts.useShortcut)('core/edit-widgets/keyboard-shortcuts', toggleKeyboardShortcutsModal);
41
43
  const isLargeViewport = (0, _compose.useViewportMatch)('medium');
42
- return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_interface.MoreMenuDropdown, null, () => (0, _element.createElement)(_element.Fragment, null, isLargeViewport && (0, _element.createElement)(_components.MenuGroup, {
44
+ return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_interface.MoreMenuDropdown, null, onClose => (0, _element.createElement)(_element.Fragment, null, isLargeViewport && (0, _element.createElement)(_components.MenuGroup, {
43
45
  label: (0, _i18n._x)('View', 'noun')
44
46
  }, (0, _element.createElement)(_interface.MoreMenuFeatureToggle, {
45
47
  scope: "core/edit-widgets",
@@ -69,7 +71,11 @@ function MoreMenu() {
69
71
  as: "span"
70
72
  },
71
73
  /* translators: accessibility text */
72
- (0, _i18n.__)('(opens in a new tab)')))), (0, _element.createElement)(_components.MenuGroup, {
74
+ (0, _i18n.__)('(opens in a new tab)'))), (0, _element.createElement)(_toolsMoreMenuGroup.default.Slot, {
75
+ fillProps: {
76
+ onClose
77
+ }
78
+ })), (0, _element.createElement)(_components.MenuGroup, {
73
79
  label: (0, _i18n.__)('Preferences')
74
80
  }, (0, _element.createElement)(_interface.MoreMenuFeatureToggle, {
75
81
  scope: "core/edit-widgets",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/more-menu/index.js"],"names":["MoreMenu","isKeyboardShortcutsModalActive","setIsKeyboardShortcutsModalVisible","toggleKeyboardShortcutsModal","isLargeViewport","displayShortcut","access","external"],"mappings":";;;;;;;;;AAIA;;AADA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAfA;AACA;AACA;;AAUA;AACA;AACA;AAGe,SAASA,QAAT,GAAoB;AAClC,QAAM,CACLC,8BADK,EAELC,kCAFK,IAGF,uBAAU,KAAV,CAHJ;;AAIA,QAAMC,4B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DC,4BAAC,qBAAD;AAAW,IAAA,KAAK,EAAG,cAAI,aAAJ;AAAnB,KACC,4BAAC,gCAAD;AACC,IAAA,KAAK,EAAC,mBADP;AAEC,IAAA,OAAO,EAAC,sBAFT;AAGC,IAAA,KAAK,EAAG,cACP,kCADO,CAHT;AAMC,IAAA,IAAI,EAAG,cACN,iEADM,CANR;AASC,IAAA,gBAAgB,EAAG,cAClB,4CADkB,CATpB;AAYC,IAAA,kBAAkB,EAAG,cACpB,8CADoB;AAZtB,IADD,EAiBC,4BAAC,gCAAD;AACC,IAAA,KAAK,EAAC,mBADP;AAEC,IAAA,OAAO,EAAC,aAFT;AAGC,IAAA,IAAI,EAAG,cACN,uCADM,CAHR;AAMC,IAAA,KAAK,EAAG,cAAI,kBAAJ;AANT,IAjBD,EAyBGH,eAAe,IAChB,4BAAC,gCAAD;AACC,IAAA,KAAK,EAAC,mBADP;AAEC,IAAA,OAAO,EAAC,sBAFT;AAGC,IAAA,KAAK,EAAG,cAAI,2BAAJ,CAHT;AAIC,IAAA,IAAI,EAAG,cACN,sDADM,CAJR;AAOC,IAAA,gBAAgB,EAAG,cAClB,qCADkB,CAPpB;AAUC,IAAA,kBAAkB,EAAG,cACpB,uCADoB;AAVtB,IA1BF,CAnDD,CAFF,CADD,EAmGC,4BAAC,kCAAD;AACC,IAAA,aAAa,EAAGH,8BADjB;AAEC,IAAA,WAAW,EAAGE;AAFf,IAnGD,CADD;AA0GA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuGroup, MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { external } from '@wordpress/icons';\nimport { MoreMenuDropdown, MoreMenuFeatureToggle } from '@wordpress/interface';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\n\nexport default function MoreMenu() {\n\tconst [\n\t\tisKeyboardShortcutsModalActive,\n\t\tsetIsKeyboardShortcutsModalVisible,\n\t] = useState( false );\n\tconst toggleKeyboardShortcutsModal = () =>\n\t\tsetIsKeyboardShortcutsModalVisible( ! isKeyboardShortcutsModalActive );\n\n\tuseShortcut(\n\t\t'core/edit-widgets/keyboard-shortcuts',\n\t\ttoggleKeyboardShortcutsModal\n\t);\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\treturn (\n\t\t<>\n\t\t\t<MoreMenuDropdown>\n\t\t\t\t{ () => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t\t<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\t\tfeature=\"fixedToolbar\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Top toolbar activated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Top toolbar deactivated'\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</MenuGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsKeyboardShortcutsModalVisible( true );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tfeature=\"welcomeGuide\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/support/article/block-based-widgets-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Preferences' ) }>\n\t\t\t\t\t\t\t<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tfeature=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block deactivated'\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<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tfeature=\"themeStyles\"\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t\t<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\t\tfeature=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Display block breadcrumbs activated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Display block breadcrumbs deactivated'\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) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</MoreMenuDropdown>\n\t\t\t<KeyboardShortcutHelpModal\n\t\t\t\tisModalActive={ isKeyboardShortcutsModalActive }\n\t\t\t\ttoggleModal={ toggleKeyboardShortcutsModal }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-widgets/src/components/more-menu/index.js"],"names":["MoreMenu","isKeyboardShortcutsModalActive","setIsKeyboardShortcutsModalVisible","toggleKeyboardShortcutsModal","isLargeViewport","onClose","displayShortcut","access","external"],"mappings":";;;;;;;;;AAIA;;AADA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIe,SAASA,QAAT,GAAoB;AAClC,QAAM,CACLC,8BADK,EAELC,kCAFK,IAGF,uBAAU,KAAV,CAHJ;;AAIA,QAAMC,4BAA4B,GAAG,MACpCD,kCAAkC,CAAE,CAAED,8BAAJ,CADnC;;AAGA,sCACC,sCADD,EAECE,4BAFD;AAKA,QAAMC,eAAe,GAAG,+BAAkB,QAAlB,CAAxB;AAEA,SACC,qDACC,4BAAC,2BAAD,QACKC,OAAF,IACD,qDACGD,eAAe,IAChB,4BAAC,qBAAD;AAAW,IAAA,KAAK,EAAG,cAAI,MAAJ,EAAY,MAAZ;AAAnB,KACC,4BAAC,gCAAD;AACC,IAAA,KAAK,EAAC,mBADP;AAEC,IAAA,OAAO,EAAC,cAFT;AAGC,IAAA,KAAK,EAAG,cAAI,aAAJ,CAHT;AAIC,IAAA,IAAI,EAAG,cACN,uDADM,CAJR;AAOC,IAAA,gBAAgB,EAAG,cAClB,uBADkB,CAPpB;AAUC,IAAA,kBAAkB,EAAG,cACpB,yBADoB;AAVtB,IADD,CAFF,EAmBC,4BAAC,qBAAD;AAAW,IAAA,KAAK,EAAG,cAAI,OAAJ;AAAnB,KACC,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACfF,MAAAA,kCAAkC,CAAE,IAAF,CAAlC;AACA,KAHF;AAIC,IAAA,QAAQ,EAAGI,0BAAgBC,MAAhB,CAAwB,GAA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,CAJR;AAOC,IAAA,gBAAgB,EAAG,cAClB,qCADkB,CAPpB;AAUC,IAAA,kBAAkB,EAAG,cACpB,uCADoB;AAVtB,IA1BF,CAtDD,CAFF,CADD,EAsGC,4BAAC,kCAAD;AACC,IAAA,aAAa,EAAGH,8BADjB;AAEC,IAAA,WAAW,EAAGE;AAFf,IAtGD,CADD;AA6GA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuGroup, MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { external } from '@wordpress/icons';\nimport { MoreMenuDropdown, MoreMenuFeatureToggle } from '@wordpress/interface';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ToolsMoreMenuGroup from './tools-more-menu-group';\n\nexport default function MoreMenu() {\n\tconst [\n\t\tisKeyboardShortcutsModalActive,\n\t\tsetIsKeyboardShortcutsModalVisible,\n\t] = useState( false );\n\tconst toggleKeyboardShortcutsModal = () =>\n\t\tsetIsKeyboardShortcutsModalVisible( ! isKeyboardShortcutsModalActive );\n\n\tuseShortcut(\n\t\t'core/edit-widgets/keyboard-shortcuts',\n\t\ttoggleKeyboardShortcutsModal\n\t);\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\treturn (\n\t\t<>\n\t\t\t<MoreMenuDropdown>\n\t\t\t\t{ ( onClose ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t\t<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\t\tfeature=\"fixedToolbar\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Top toolbar activated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Top toolbar deactivated'\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</MenuGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsKeyboardShortcutsModalVisible( true );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tfeature=\"welcomeGuide\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/support/article/block-based-widgets-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<ToolsMoreMenuGroup.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Preferences' ) }>\n\t\t\t\t\t\t\t<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tfeature=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block deactivated'\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<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tfeature=\"themeStyles\"\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t\t<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\t\tfeature=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Display block breadcrumbs activated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Display block breadcrumbs deactivated'\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) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</MoreMenuDropdown>\n\t\t\t<KeyboardShortcutHelpModal\n\t\t\t\tisModalActive={ isKeyboardShortcutsModalActive }\n\t\t\t\ttoggleModal={ toggleKeyboardShortcutsModal }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"]}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _element = require("@wordpress/element");
9
+
10
+ var _lodash = require("lodash");
11
+
12
+ var _components = require("@wordpress/components");
13
+
14
+ /**
15
+ * External dependencies
16
+ */
17
+
18
+ /**
19
+ * WordPress dependencies
20
+ */
21
+ const {
22
+ Fill: ToolsMoreMenuGroup,
23
+ Slot
24
+ } = (0, _components.createSlotFill)('EditWidgetsToolsMoreMenuGroup');
25
+
26
+ ToolsMoreMenuGroup.Slot = _ref => {
27
+ let {
28
+ fillProps
29
+ } = _ref;
30
+ return (0, _element.createElement)(Slot, {
31
+ fillProps: fillProps
32
+ }, fills => !(0, _lodash.isEmpty)(fills) && fills);
33
+ };
34
+
35
+ var _default = ToolsMoreMenuGroup;
36
+ exports.default = _default;
37
+ //# sourceMappingURL=tools-more-menu-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-widgets/src/components/more-menu/tools-more-menu-group.js"],"names":["Fill","ToolsMoreMenuGroup","Slot","fillProps","fills"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;AAGA,MAAM;AAAEA,EAAAA,IAAI,EAAEC,kBAAR;AAA4BC,EAAAA;AAA5B,IAAqC,gCAC1C,+BAD0C,CAA3C;;AAIAD,kBAAkB,CAACC,IAAnB,GAA0B;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SACzB,4BAAC,IAAD;AAAM,IAAA,SAAS,EAAGA;AAAlB,KACKC,KAAF,IAAa,CAAE,qBAASA,KAAT,CAAF,IAAsBA,KADtC,CADyB;AAAA,CAA1B;;eAMeH,kB","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } = createSlotFill(\n\t'EditWidgetsToolsMoreMenuGroup'\n);\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) => ! isEmpty( fills ) && fills }\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"]}
package/build/index.js CHANGED
@@ -87,7 +87,7 @@ function initialize(id, settings) {
87
87
  (0, _blockLibrary.registerCoreBlocks)(coreBlocks);
88
88
  (0, _widgets.registerLegacyWidgetBlock)();
89
89
 
90
- if (process.env.GUTENBERG_PHASE === 2) {
90
+ if (process.env.IS_GUTENBERG_PLUGIN) {
91
91
  (0, _blockLibrary.__experimentalRegisterExperimentalCoreBlocks)({
92
92
  enableFSEBlocks: _constants.ENABLE_EXPERIMENTAL_FSE_BLOCKS
93
93
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/index.js"],"names":["disabledBlocks","ALLOW_REUSABLE_BLOCKS","reinitializeEditor","target","settings","reboot","bind","initialize","id","document","getElementById","coreBlocks","filter","block","includes","name","startsWith","interfaceStore","setFeatureDefaults","fixedToolbar","welcomeGuide","showBlockBreadcrumbs","themeStyles","blocksStore","__experimentalReapplyBlockTypeFilters","process","env","GUTENBERG_PHASE","enableFSEBlocks","ENABLE_EXPERIMENTAL_FSE_BLOCKS","registerBlock","widgetArea","__experimentalFetchLinkSuggestions","search","searchOptions","metadata"],"mappings":";;;;;;;;;;AAUA;;AAPA;;AAMA;;AAEA;;AAKA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;AAEA;;AACA;;;;;;AAhCA;AACA;AACA;;AAsBA;AACA;AACA;AAWA,MAAMA,cAAc,GAAG,CACtB,WADsB,EAEtB,eAFsB,EAGtB,oBAHsB,EAItB,IAAKC,mCAAwB,EAAxB,GAA6B,CAAE,YAAF,CAAlC,CAJsB,CAAvB;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASC,kBAAT,CAA6BC,MAA7B,EAAqCC,QAArC,EAAgD;AACtD,uCAAwBD,MAAxB;AACA,QAAME,MAAM,GAAGH,kBAAkB,CAACI,IAAnB,CAAyB,IAAzB,EAA+BH,MAA/B,EAAuCC,QAAvC,CAAf;AACA,uBACC,4BAAC,eAAD;AAAQ,IAAA,mBAAmB,EAAGA,QAA9B;AAAyC,IAAA,OAAO,EAAGC;AAAnD,IADD,EAECF,MAFD;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASI,UAAT,CAAqBC,EAArB,EAAyBJ,QAAzB,EAAoC;AAC1C,QAAMD,MAAM,GAAGM,QAAQ,CAACC,cAAT,CAAyBF,EAAzB,CAAf;AACA,QAAMH,MAAM,GAA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IA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAM2B,aAAa,GAAKjB,KAAF,IAAa;AAClC,MAAK,CAAEA,KAAP,EAAe;AACd;AACA;;AACD,QAAM;AAAEsB,IAAAA,QAAF;AAAY/B,IAAAA,QAAZ;AAAsBW,IAAAA;AAAtB,MAA+BF,KAArC;;AACA,MAAKsB,QAAL,EAAgB;AACf,+DAA+C;AAAE,OAAEpB,IAAF,GAAUoB;AAAZ,KAA/C;AACA;;AACD,iCAAmBpB,IAAnB,EAAyBX,QAAzB;AACA,CATD","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 { render, unmountComponentAtNode } 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 interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport './store';\nimport './filters';\nimport * as widgetArea from './blocks/widget-area';\n\nimport Layout from './components/layout';\nimport {\n\tALLOW_REUSABLE_BLOCKS,\n\tENABLE_EXPERIMENTAL_FSE_BLOCKS,\n} from './constants';\n\nconst disabledBlocks = [\n\t'core/more',\n\t'core/freeform',\n\t'core/template-part',\n\t...( ALLOW_REUSABLE_BLOCKS ? [] : [ 'core/block' ] ),\n];\n\n/**\n * Reinitializes the editor after the user chooses to reboot the editor after\n * an unhandled error occurs, replacing previously mounted editor element using\n * an initial state from prior to the crash.\n *\n * @param {Element} target DOM node in which editor is rendered.\n * @param {?Object} settings Editor settings object.\n */\nexport function reinitializeEditor( target, settings ) {\n\tunmountComponentAtNode( target );\n\tconst reboot = reinitializeEditor.bind( null, target, settings );\n\trender(\n\t\t<Layout blockEditorSettings={ settings } onError={ reboot } />,\n\t\ttarget\n\t);\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 initialize( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst reboot = reinitializeEditor.bind( null, target, settings );\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( interfaceStore ).setFeatureDefaults( '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 ).__experimentalReapplyBlockTypeFilters();\n\tregisterCoreBlocks( coreBlocks );\n\tregisterLegacyWidgetBlock();\n\tif ( process.env.GUTENBERG_PHASE === 2 ) {\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\trender(\n\t\t<Layout blockEditorSettings={ settings } onError={ reboot } />,\n\t\ttarget\n\t);\n}\n\n/**\n * Function to register an individual block.\n *\n * @param {Object} block The block to be registered.\n *\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"]}
1
+ {"version":3,"sources":["@wordpress/edit-widgets/src/index.js"],"names":["disabledBlocks","ALLOW_REUSABLE_BLOCKS","reinitializeEditor","target","settings","reboot","bind","initialize","id","document","getElementById","coreBlocks","filter","block","includes","name","startsWith","interfaceStore","setFeatureDefaults","fixedToolbar","welcomeGuide","showBlockBreadcrumbs","themeStyles","blocksStore","__experimentalReapplyBlockTypeFilters","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","ENABLE_EXPERIMENTAL_FSE_BLOCKS","registerBlock","widgetArea","__experimentalFetchLinkSuggestions","search","searchOptions","metadata"],"mappings":";;;;;;;;;;AAUA;;AAPA;;AAMA;;AAEA;;AAKA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;AAEA;;AACA;;;;;;AAhCA;AACA;AACA;;AAsBA;AACA;AACA;AAWA,MAAMA,cAAc,GAAG,CACtB,WADsB,EAEtB,eAFsB,EAGtB,oBAHsB,EAItB,IAAKC,mCAAwB,EAAxB,GAA6B,CAAE,YAAF,CAAlC,CAJsB,CAAvB;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASC,kBAAT,CAA6BC,MAA7B,EAAqCC,QAArC,EAAgD;AACtD,uCAAwBD,MAAxB;AACA,QAAME,MAAM,GAAGH,kBAAkB,CAACI,IAAnB,CAAyB,IAAzB,EAA+BH,MAA/B,EAAuCC,QAAvC,CAAf;AACA,uBACC,4BAAC,eAAD;AAAQ,IAAA,mBAAmB,EAAGA,QAA9B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,kDAAsBD,MAAtB,EAA8BC,aAA9B,EAA6C9B,QAA7C,CADD,CAhC0C,CAmC1C;AACA;AACA;AACA;;;AACA,6CAA+B,WAA/B;AACA,uBACC,4BAAC,eAAD;AAAQ,IAAA,mBAAmB,EAAGA,QAA9B;AAAyC,IAAA,OAAO,EAAGC;AAAnD,IADD,EAECF,MAFD;AAIA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAM2B,aAAa,GAAKjB,KAAF,IAAa;AAClC,MAAK,CAAEA,KAAP,EAAe;AACd;AACA;;AACD,QAAM;AAAEsB,IAAAA,QAAF;AAAY/B,IAAAA,QAAZ;AAAsBW,IAAAA;AAAtB,MAA+BF,KAArC;;AACA,MAAKsB,QAAL,EAAgB;AACf,+DAA+C;AAAE,OAAEpB,IAAF,GAAUoB;AAAZ,KAA/C;AACA;;AACD,iCAAmBpB,IAAnB,EAAyBX,QAAzB;AACA,CATD","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 { render, unmountComponentAtNode } 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 interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport './store';\nimport './filters';\nimport * as widgetArea from './blocks/widget-area';\n\nimport Layout from './components/layout';\nimport {\n\tALLOW_REUSABLE_BLOCKS,\n\tENABLE_EXPERIMENTAL_FSE_BLOCKS,\n} from './constants';\n\nconst disabledBlocks = [\n\t'core/more',\n\t'core/freeform',\n\t'core/template-part',\n\t...( ALLOW_REUSABLE_BLOCKS ? [] : [ 'core/block' ] ),\n];\n\n/**\n * Reinitializes the editor after the user chooses to reboot the editor after\n * an unhandled error occurs, replacing previously mounted editor element using\n * an initial state from prior to the crash.\n *\n * @param {Element} target DOM node in which editor is rendered.\n * @param {?Object} settings Editor settings object.\n */\nexport function reinitializeEditor( target, settings ) {\n\tunmountComponentAtNode( target );\n\tconst reboot = reinitializeEditor.bind( null, target, settings );\n\trender(\n\t\t<Layout blockEditorSettings={ settings } onError={ reboot } />,\n\t\ttarget\n\t);\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 initialize( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst reboot = reinitializeEditor.bind( null, target, settings );\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( interfaceStore ).setFeatureDefaults( '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 ).__experimentalReapplyBlockTypeFilters();\n\tregisterCoreBlocks( coreBlocks );\n\tregisterLegacyWidgetBlock();\n\tif ( process.env.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\trender(\n\t\t<Layout blockEditorSettings={ settings } onError={ reboot } />,\n\t\ttarget\n\t);\n}\n\n/**\n * Function to register an individual block.\n *\n * @param {Object} block The block to be registered.\n *\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"]}
@@ -3,8 +3,11 @@ import { createElement } from "@wordpress/element";
3
3
  /**
4
4
  * WordPress dependencies
5
5
  */
6
+ import { __, sprintf } from '@wordpress/i18n';
6
7
  import { Popover } from '@wordpress/components';
8
+ import { useDispatch } from '@wordpress/data';
7
9
  import { PluginArea } from '@wordpress/plugins';
10
+ import { store as noticesStore } from '@wordpress/notices';
8
11
  /**
9
12
  * Internal dependencies
10
13
  */
@@ -21,13 +24,25 @@ function Layout(_ref) {
21
24
  blockEditorSettings,
22
25
  onError
23
26
  } = _ref;
27
+ const {
28
+ createErrorNotice
29
+ } = useDispatch(noticesStore);
30
+
31
+ function onPluginAreaError(name) {
32
+ createErrorNotice(sprintf(
33
+ /* translators: %s: plugin name */
34
+ __('The "%s" plugin has encountered an error and cannot be rendered.'), name));
35
+ }
36
+
24
37
  return createElement(ErrorBoundary, {
25
38
  onError: onError
26
39
  }, createElement(WidgetAreasBlockEditorProvider, {
27
40
  blockEditorSettings: blockEditorSettings
28
41
  }, createElement(Interface, {
29
42
  blockEditorSettings: blockEditorSettings
30
- }), createElement(Sidebar, null), createElement(Popover.Slot, null), createElement(PluginArea, null), createElement(UnsavedChangesWarning, null), createElement(WelcomeGuide, null)));
43
+ }), createElement(Sidebar, null), createElement(Popover.Slot, null), createElement(PluginArea, {
44
+ onError: onPluginAreaError
45
+ }), createElement(UnsavedChangesWarning, null), createElement(WelcomeGuide, null)));
31
46
  }
32
47
 
33
48
  export default Layout;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/layout/index.js"],"names":["Popover","PluginArea","ErrorBoundary","WidgetAreasBlockEditorProvider","Sidebar","Interface","UnsavedChangesWarning","WelcomeGuide","Layout","blockEditorSettings","onError"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,uBAAxB;AACA,SAASC,UAAT,QAA2B,oBAA3B;AAEA;AACA;AACA;;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,8BAAP,MAA2C,uCAA3C;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,OAAOC,SAAP,MAAsB,aAAtB;AACA,OAAOC,qBAAP,MAAkC,2BAAlC;AACA,OAAOC,YAAP,MAAyB,kBAAzB;;AAEA,SAASC,MAAT,OAAoD;AAAA,MAAnC;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA;AAAvB,GAAmC;AACnD,SACC,cAAC,aAAD;AAAe,IAAA,OAAO,EAAGA;AAAzB,KACC,cAAC,8BAAD;AACC,IAAA,mBAAmB,EAAGD;AADvB,KAGC,cAAC,SAAD;AAAW,IAAA,mBAAmB,EAAGA;AAAjC,IAHD,EAIC,cAAC,OAAD,OAJD,EAKC,cAAC,OAAD,CAAS,IAAT,OALD,EAMC,cAAC,UAAD,OAND,EAOC,cAAC,qBAAD,OAPD,EAQC,cAAC,YAAD,OARD,CADD,CADD;AAcA;;AAED,eAAeD,MAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Popover } from '@wordpress/components';\nimport { PluginArea } from '@wordpress/plugins';\n\n/**\n * Internal dependencies\n */\nimport ErrorBoundary from '../error-boundary';\nimport WidgetAreasBlockEditorProvider from '../widget-areas-block-editor-provider';\nimport Sidebar from '../sidebar';\nimport Interface from './interface';\nimport UnsavedChangesWarning from './unsaved-changes-warning';\nimport WelcomeGuide from '../welcome-guide';\n\nfunction Layout( { blockEditorSettings, onError } ) {\n\treturn (\n\t\t<ErrorBoundary onError={ onError }>\n\t\t\t<WidgetAreasBlockEditorProvider\n\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t>\n\t\t\t\t<Interface blockEditorSettings={ blockEditorSettings } />\n\t\t\t\t<Sidebar />\n\t\t\t\t<Popover.Slot />\n\t\t\t\t<PluginArea />\n\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t<WelcomeGuide />\n\t\t\t</WidgetAreasBlockEditorProvider>\n\t\t</ErrorBoundary>\n\t);\n}\n\nexport default Layout;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-widgets/src/components/layout/index.js"],"names":["__","sprintf","Popover","useDispatch","PluginArea","store","noticesStore","ErrorBoundary","WidgetAreasBlockEditorProvider","Sidebar","Interface","UnsavedChangesWarning","WelcomeGuide","Layout","blockEditorSettings","onError","createErrorNotice","onPluginAreaError","name"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,OAAT,QAAwB,uBAAxB;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SAASC,KAAK,IAAIC,YAAlB,QAAsC,oBAAtC;AAEA;AACA;AACA;;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,8BAAP,MAA2C,uCAA3C;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,OAAOC,SAAP,MAAsB,aAAtB;AACA,OAAOC,qBAAP,MAAkC,2BAAlC;AACA,OAAOC,YAAP,MAAyB,kBAAzB;;AAEA,SAASC,MAAT,OAAoD;AAAA,MAAnC;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA;AAAvB,GAAmC;AACnD,QAAM;AAAEC,IAAAA;AAAF,MAAwBb,WAAW,CAAEG,YAAF,CAAzC;;AAEA,WAASW,iBAAT,CAA4BC,IAA5B,EAAmC;AAClCF,IAAAA,iBAAiB,CAChBf,OAAO;AACN;AACAD,IAAAA,EAAE,CACD,kEADC,CAFI,EAKNkB,IALM,CADS,CAAjB;AASA;;AAED,SACC,cAAC,aAAD;AAAe,IAAA,OAAO,EAAGH;AAAzB,KACC,cAAC,8BAAD;AACC,IAAA,mBAAmB,EAAGD;AADvB,KAGC,cAAC,SAAD;AAAW,IAAA,mBAAmB,EAAGA;AAAjC,IAHD,EAIC,cAAC,OAAD,OAJD,EAKC,cAAC,OAAD,CAAS,IAAT,OALD,EAMC,cAAC,UAAD;AAAY,IAAA,OAAO,EAAGG;AAAtB,IAND,EAOC,cAAC,qBAAD,OAPD,EAQC,cAAC,YAAD,OARD,CADD,CADD;AAcA;;AAED,eAAeJ,MAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Popover } from '@wordpress/components';\nimport { useDispatch } from '@wordpress/data';\nimport { PluginArea } from '@wordpress/plugins';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport ErrorBoundary from '../error-boundary';\nimport WidgetAreasBlockEditorProvider from '../widget-areas-block-editor-provider';\nimport Sidebar from '../sidebar';\nimport Interface from './interface';\nimport UnsavedChangesWarning from './unsaved-changes-warning';\nimport WelcomeGuide from '../welcome-guide';\n\nfunction Layout( { blockEditorSettings, onError } ) {\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\treturn (\n\t\t<ErrorBoundary onError={ onError }>\n\t\t\t<WidgetAreasBlockEditorProvider\n\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t>\n\t\t\t\t<Interface blockEditorSettings={ blockEditorSettings } />\n\t\t\t\t<Sidebar />\n\t\t\t\t<Popover.Slot />\n\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t<WelcomeGuide />\n\t\t\t</WidgetAreasBlockEditorProvider>\n\t\t</ErrorBoundary>\n\t);\n}\n\nexport default Layout;\n"]}
@@ -16,6 +16,7 @@ import { useViewportMatch } from '@wordpress/compose';
16
16
  */
17
17
 
18
18
  import KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';
19
+ import ToolsMoreMenuGroup from './tools-more-menu-group';
19
20
  export default function MoreMenu() {
20
21
  const [isKeyboardShortcutsModalActive, setIsKeyboardShortcutsModalVisible] = useState(false);
21
22
 
@@ -23,7 +24,7 @@ export default function MoreMenu() {
23
24
 
24
25
  useShortcut('core/edit-widgets/keyboard-shortcuts', toggleKeyboardShortcutsModal);
25
26
  const isLargeViewport = useViewportMatch('medium');
26
- return createElement(Fragment, null, createElement(MoreMenuDropdown, null, () => createElement(Fragment, null, isLargeViewport && createElement(MenuGroup, {
27
+ return createElement(Fragment, null, createElement(MoreMenuDropdown, null, onClose => createElement(Fragment, null, isLargeViewport && createElement(MenuGroup, {
27
28
  label: _x('View', 'noun')
28
29
  }, createElement(MoreMenuFeatureToggle, {
29
30
  scope: "core/edit-widgets",
@@ -53,7 +54,11 @@ export default function MoreMenu() {
53
54
  as: "span"
54
55
  },
55
56
  /* translators: accessibility text */
56
- __('(opens in a new tab)')))), createElement(MenuGroup, {
57
+ __('(opens in a new tab)'))), createElement(ToolsMoreMenuGroup.Slot, {
58
+ fillProps: {
59
+ onClose
60
+ }
61
+ })), createElement(MenuGroup, {
57
62
  label: __('Preferences')
58
63
  }, createElement(MoreMenuFeatureToggle, {
59
64
  scope: "core/edit-widgets",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/components/more-menu/index.js"],"names":["MenuGroup","MenuItem","VisuallyHidden","useState","__","_x","external","MoreMenuDropdown","MoreMenuFeatureToggle","displayShortcut","useShortcut","useViewportMatch","KeyboardShortcutHelpModal","MoreMenu","isKeyboardShortcutsModalActive","setIsKeyboardShortcutsModalVisible","toggleKeyboardShortcutsModal","isLargeViewport","access"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,QAApB,EAA8BC,cAA9B,QAAoD,uBAApD;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,EAAT,EAAaC,EAAb,QAAuB,iBAAvB;AACA,SAASC,QAAT,QAAyB,kBAAzB;AACA,SAASC,gBAAT,EAA2BC,qBAA3B,QAAwD,sBAAxD;AACA,SAASC,eAAT,QAAgC,qBAAhC;AACA,SAASC,WAAT,QAA4B,+BAA5B;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AAEA;AACA;AACA;;AACA,OAAOC,yBAAP,MAAsC,iCAAtC;AAEA,eAAe,SAASC,QAAT,GAAoB;AAClC,QAAM,CACLC,8BADK,EAELC,kCAFK,IAGFZ,QAAQ,CAAE,KAAF,CAHZ;;AAIA,QAAMa,4BAA4B,GAAG,MACpCD,kCAAkC,CAAE,CAAED,8BAAJ,CADnC;;AAGAJ,EAAAA,WAAW,CACV,sCADU,EAEVM,4BAFU,CAAX;AAKA,QAAMC,eAAe,GAAGN,gBAAgB,CAAE,QAAF,CAAxC;AAEA,SACC,8BACC,cAAC,gBAAD,QACG,MACD,8BACGM,eAAe,IAChB,cAAC,SAAD;AAAW,IAAA,KAAK,EAAGZ,EAAE,CAAE,MAAF,EAAU,MAAV;AAArB,KACC,cAAC,qBAAD;AACC,IAAA,KAAK,EAAC,mBADP;AAEC,IAAA,OAAO,EAAC,cAFT;AAGC,IAAA,KAAK,EAAGD,EAAE,CAAE,aAAF,CAHX;AAIC,IAAA,IAAI,EAAGA,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C,cAAC,qBAAD;AACC,IAAA,KAAK,EAAC,mBADP;AAEC,IAAA,OAAO,EAAC,aAFT;AAGC,IAAA,IAAI,EAAGA,EAAE,CACR,uCADQ,CAHV;AAMC,IAAA,KAAK,EAAGA,EAAE,CAAE,kBAAF;AANX,IAjBD,EAyBGa,eAAe,IAChB,cAAC,qBAAD;AACC,IAAA,KAAK,EAAC,mBADP;AAEC,IAAA,OAAO,EAAC,sBAFT;AAGC,IAAA,KAAK,EAAGb,EAAE,CAAE,2BAAF,CAHX;AAIC,IAAA,IAAI,EAAGA,EAAE,CACR,sDADQ,CAJV;AAOC,IAAA,gBAAgB,EAAGA,EAAE,CACpB,qCADoB,CAPtB;AAUC,IAAA,kBAAkB,EAAGA,EAAE,CACtB,uCADsB;AAVxB,IA1BF,CAnDD,CAFF,CADD,EAmGC,cAAC,yBAAD;AACC,IAAA,aAAa,EAAGU,8BADjB;AAEC,IAAA,WAAW,EAAGE;AAFf,IAnGD,CADD;AA0GA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuGroup, MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { external } from '@wordpress/icons';\nimport { MoreMenuDropdown, MoreMenuFeatureToggle } from '@wordpress/interface';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\n\nexport default function MoreMenu() {\n\tconst [\n\t\tisKeyboardShortcutsModalActive,\n\t\tsetIsKeyboardShortcutsModalVisible,\n\t] = useState( false );\n\tconst toggleKeyboardShortcutsModal = () =>\n\t\tsetIsKeyboardShortcutsModalVisible( ! isKeyboardShortcutsModalActive );\n\n\tuseShortcut(\n\t\t'core/edit-widgets/keyboard-shortcuts',\n\t\ttoggleKeyboardShortcutsModal\n\t);\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\treturn (\n\t\t<>\n\t\t\t<MoreMenuDropdown>\n\t\t\t\t{ () => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t\t<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\t\tfeature=\"fixedToolbar\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Top toolbar activated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Top toolbar deactivated'\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</MenuGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsKeyboardShortcutsModalVisible( true );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tfeature=\"welcomeGuide\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/support/article/block-based-widgets-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Preferences' ) }>\n\t\t\t\t\t\t\t<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tfeature=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block deactivated'\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<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tfeature=\"themeStyles\"\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t\t<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\t\tfeature=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Display block breadcrumbs activated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Display block breadcrumbs deactivated'\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) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</MoreMenuDropdown>\n\t\t\t<KeyboardShortcutHelpModal\n\t\t\t\tisModalActive={ isKeyboardShortcutsModalActive }\n\t\t\t\ttoggleModal={ toggleKeyboardShortcutsModal }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-widgets/src/components/more-menu/index.js"],"names":["MenuGroup","MenuItem","VisuallyHidden","useState","__","_x","external","MoreMenuDropdown","MoreMenuFeatureToggle","displayShortcut","useShortcut","useViewportMatch","KeyboardShortcutHelpModal","ToolsMoreMenuGroup","MoreMenu","isKeyboardShortcutsModalActive","setIsKeyboardShortcutsModalVisible","toggleKeyboardShortcutsModal","isLargeViewport","onClose","access"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,QAApB,EAA8BC,cAA9B,QAAoD,uBAApD;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,EAAT,EAAaC,EAAb,QAAuB,iBAAvB;AACA,SAASC,QAAT,QAAyB,kBAAzB;AACA,SAASC,gBAAT,EAA2BC,qBAA3B,QAAwD,sBAAxD;AACA,SAASC,eAAT,QAAgC,qBAAhC;AACA,SAASC,WAAT,QAA4B,+BAA5B;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AAEA;AACA;AACA;;AACA,OAAOC,yBAAP,MAAsC,iCAAtC;AACA,OAAOC,kBAAP,MAA+B,yBAA/B;AAEA,eAAe,SAASC,QAAT,GAAoB;AAClC,QAAM,CACLC,8BADK,EAELC,kCAFK,IAGFb,QAAQ,CAAE,KAAF,CAHZ;;AAIA,QAAMc,4BAA4B,GAAG,MACpCD,kCAAkC,CAAE,CAAED,8BAAJ,CADnC;;AAGAL,EAAAA,WAAW,CACV,sCADU,EAEVO,4BAFU,CAAX;AAKA,QAAMC,eAAe,GAAGP,gBAAgB,CAAE,QAAF,CAAxC;AAEA,SACC,8BACC,cAAC,gBAAD,QACKQ,OAAF,IACD,8BACGD,eAAe,IAChB,cAAC,SAAD;AAAW,IAAA,KAAK,EAAGb,EAAE,CAAE,MAAF,EAAU,MAAV;AAArB,KACC,cAAC,qBAAD;AACC,IAAA,KAAK,EAAC,mBADP;AAEC,IAAA,OAAO,EAAC,cAFT;AAGC,IAAA,KAAK,EAAGD,EAAE,CAAE,aAAF,CAHX;AAIC,IAAA,IAAI,EAAGA,EAAE,CACR,uDADQ,CAJV;AAOC,IAAA,gBAAgB,EAAGA,EAAE,CACpB,uBADoB,CAPtB;AAUC,IAAA,kBAAkB,EAAGA,EAAE,CACtB,yBADsB;AAVxB,IADD,CAFF,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AA,OAAO,EAAC,aAFT;AAGC,IAAA,IAAI,EAAGA,EAAE,CACR,uCADQ,CAHV;AAMC,IAAA,KAAK,EAAGA,EAAE,CAAE,kBAAF;AANX,IAjBD,EAyBGc,eAAe,IAChB,cAAC,qBAAD;AACC,IAAA,KAAK,EAAC,mBADP;AAEC,IAAA,OAAO,EAAC,sBAFT;AAGC,IAAA,KAAK,EAAGd,EAAE,CAAE,2BAAF,CAHX;AAIC,IAAA,IAAI,EAAGA,EAAE,CACR,sDADQ,CAJV;AAOC,IAAA,gBAAgB,EAAGA,EAAE,CACpB,qCADoB,CAPtB;AAUC,IAAA,kBAAkB,EAAGA,EAAE,CACtB,uCADsB;AAVxB,IA1BF,CAtDD,CAFF,CADD,EAsGC,cAAC,yBAAD;AACC,IAAA,aAAa,EAAGW,8BADjB;AAEC,IAAA,WAAW,EAAGE;AAFf,IAtGD,CADD;AA6GA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuGroup, MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __, _x } from '@wordpress/i18n';\nimport { external } from '@wordpress/icons';\nimport { MoreMenuDropdown, MoreMenuFeatureToggle } from '@wordpress/interface';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ToolsMoreMenuGroup from './tools-more-menu-group';\n\nexport default function MoreMenu() {\n\tconst [\n\t\tisKeyboardShortcutsModalActive,\n\t\tsetIsKeyboardShortcutsModalVisible,\n\t] = useState( false );\n\tconst toggleKeyboardShortcutsModal = () =>\n\t\tsetIsKeyboardShortcutsModalVisible( ! isKeyboardShortcutsModalActive );\n\n\tuseShortcut(\n\t\t'core/edit-widgets/keyboard-shortcuts',\n\t\ttoggleKeyboardShortcutsModal\n\t);\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\n\treturn (\n\t\t<>\n\t\t\t<MoreMenuDropdown>\n\t\t\t\t{ ( onClose ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t\t<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\t\tfeature=\"fixedToolbar\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Top toolbar activated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Top toolbar deactivated'\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</MenuGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsKeyboardShortcutsModalVisible( true );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tfeature=\"welcomeGuide\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/support/article/block-based-widgets-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<ToolsMoreMenuGroup.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Preferences' ) }>\n\t\t\t\t\t\t\t<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tfeature=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Aids screen readers by stopping text caret from leaving blocks.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Contain text cursor inside block deactivated'\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<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\tfeature=\"themeStyles\"\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Make the editor look like your theme.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t\t\t<MoreMenuFeatureToggle\n\t\t\t\t\t\t\t\t\tscope=\"core/edit-widgets\"\n\t\t\t\t\t\t\t\t\tfeature=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Display block breadcrumbs activated'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t\t'Display block breadcrumbs deactivated'\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) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</MoreMenuDropdown>\n\t\t\t<KeyboardShortcutHelpModal\n\t\t\t\tisModalActive={ isKeyboardShortcutsModalActive }\n\t\t\t\ttoggleModal={ toggleKeyboardShortcutsModal }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"]}
@@ -0,0 +1,27 @@
1
+ import { createElement } from "@wordpress/element";
2
+
3
+ /**
4
+ * External dependencies
5
+ */
6
+ import { isEmpty } from 'lodash';
7
+ /**
8
+ * WordPress dependencies
9
+ */
10
+
11
+ import { createSlotFill } from '@wordpress/components';
12
+ const {
13
+ Fill: ToolsMoreMenuGroup,
14
+ Slot
15
+ } = createSlotFill('EditWidgetsToolsMoreMenuGroup');
16
+
17
+ ToolsMoreMenuGroup.Slot = _ref => {
18
+ let {
19
+ fillProps
20
+ } = _ref;
21
+ return createElement(Slot, {
22
+ fillProps: fillProps
23
+ }, fills => !isEmpty(fills) && fills);
24
+ };
25
+
26
+ export default ToolsMoreMenuGroup;
27
+ //# sourceMappingURL=tools-more-menu-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-widgets/src/components/more-menu/tools-more-menu-group.js"],"names":["isEmpty","createSlotFill","Fill","ToolsMoreMenuGroup","Slot","fillProps","fills"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,OAAT,QAAwB,QAAxB;AAEA;AACA;AACA;;AACA,SAASC,cAAT,QAA+B,uBAA/B;AAEA,MAAM;AAAEC,EAAAA,IAAI,EAAEC,kBAAR;AAA4BC,EAAAA;AAA5B,IAAqCH,cAAc,CACxD,+BADwD,CAAzD;;AAIAE,kBAAkB,CAACC,IAAnB,GAA0B;AAAA,MAAE;AAAEC,IAAAA;AAAF,GAAF;AAAA,SACzB,cAAC,IAAD;AAAM,IAAA,SAAS,EAAGA;AAAlB,KACKC,KAAF,IAAa,CAAEN,OAAO,CAAEM,KAAF,CAAT,IAAsBA,KADtC,CADyB;AAAA,CAA1B;;AAMA,eAAeH,kBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { createSlotFill } from '@wordpress/components';\n\nconst { Fill: ToolsMoreMenuGroup, Slot } = createSlotFill(\n\t'EditWidgetsToolsMoreMenuGroup'\n);\n\nToolsMoreMenuGroup.Slot = ( { fillProps } ) => (\n\t<Slot fillProps={ fillProps }>\n\t\t{ ( fills ) => ! isEmpty( fills ) && fills }\n\t</Slot>\n);\n\nexport default ToolsMoreMenuGroup;\n"]}
@@ -65,7 +65,7 @@ export function initialize(id, settings) {
65
65
  registerCoreBlocks(coreBlocks);
66
66
  registerLegacyWidgetBlock();
67
67
 
68
- if (process.env.GUTENBERG_PHASE === 2) {
68
+ if (process.env.IS_GUTENBERG_PLUGIN) {
69
69
  __experimentalRegisterExperimentalCoreBlocks({
70
70
  enableFSEBlocks: ENABLE_EXPERIMENTAL_FSE_BLOCKS
71
71
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-widgets/src/index.js"],"names":["registerBlockType","unstable__bootstrapServerSideBlockDefinitions","setFreeformContentHandlerName","store","blocksStore","dispatch","render","unmountComponentAtNode","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","registerLegacyWidgetBlock","registerLegacyWidgetVariations","registerWidgetGroupBlock","interfaceStore","widgetArea","Layout","ALLOW_REUSABLE_BLOCKS","ENABLE_EXPERIMENTAL_FSE_BLOCKS","disabledBlocks","reinitializeEditor","target","settings","reboot","bind","initialize","id","document","getElementById","coreBlocks","filter","block","includes","name","startsWith","setFeatureDefaults","fixedToolbar","welcomeGuide","showBlockBreadcrumbs","themeStyles","__experimentalReapplyBlockTypeFilters","process","env","GUTENBERG_PHASE","enableFSEBlocks","registerBlock","search","searchOptions","metadata"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,iBADD,EAECC,6CAFD,EAEgD;AAC/CC,6BAHD,EAICC,KAAK,IAAIC,WAJV,QAKO,mBALP;AAMA,SAASC,QAAT,QAAyB,iBAAzB;AACA,SAASC,MAAT,EAAiBC,sBAAjB,QAA+C,oBAA/C;AACA,SACCC,kBADD,EAECC,2BAFD,EAGCC,4CAHD,QAIO,0BAJP;AAKA,SAASC,kCAAkC,IAAIC,oBAA/C,QAA2E,sBAA3E;AACA,SACCC,yBADD,EAECC,8BAFD,EAGCC,wBAHD,QAIO,oBAJP;AAKA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d;AACA;;AACD,QAAM;AAAEiB,IAAAA,QAAF;AAAY1B,IAAAA,QAAZ;AAAsBW,IAAAA;AAAtB,MAA+BF,KAArC;;AACA,MAAKiB,QAAL,EAAgB;AACfjD,IAAAA,6CAA6C,CAAE;AAAE,OAAEkC,IAAF,GAAUe;AAAZ,KAAF,CAA7C;AACA;;AACDlD,EAAAA,iBAAiB,CAAEmC,IAAF,EAAQX,QAAR,CAAjB;AACA,CATD","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 { render, unmountComponentAtNode } 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 interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport './store';\nimport './filters';\nimport * as widgetArea from './blocks/widget-area';\n\nimport Layout from './components/layout';\nimport {\n\tALLOW_REUSABLE_BLOCKS,\n\tENABLE_EXPERIMENTAL_FSE_BLOCKS,\n} from './constants';\n\nconst disabledBlocks = [\n\t'core/more',\n\t'core/freeform',\n\t'core/template-part',\n\t...( ALLOW_REUSABLE_BLOCKS ? [] : [ 'core/block' ] ),\n];\n\n/**\n * Reinitializes the editor after the user chooses to reboot the editor after\n * an unhandled error occurs, replacing previously mounted editor element using\n * an initial state from prior to the crash.\n *\n * @param {Element} target DOM node in which editor is rendered.\n * @param {?Object} settings Editor settings object.\n */\nexport function reinitializeEditor( target, settings ) {\n\tunmountComponentAtNode( target );\n\tconst reboot = reinitializeEditor.bind( null, target, settings );\n\trender(\n\t\t<Layout blockEditorSettings={ settings } onError={ reboot } />,\n\t\ttarget\n\t);\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 initialize( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst reboot = reinitializeEditor.bind( null, target, settings );\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( interfaceStore ).setFeatureDefaults( '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 ).__experimentalReapplyBlockTypeFilters();\n\tregisterCoreBlocks( coreBlocks );\n\tregisterLegacyWidgetBlock();\n\tif ( process.env.GUTENBERG_PHASE === 2 ) {\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\trender(\n\t\t<Layout blockEditorSettings={ settings } onError={ reboot } />,\n\t\ttarget\n\t);\n}\n\n/**\n * Function to register an individual block.\n *\n * @param {Object} block The block to be registered.\n *\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"]}
1
+ {"version":3,"sources":["@wordpress/edit-widgets/src/index.js"],"names":["registerBlockType","unstable__bootstrapServerSideBlockDefinitions","setFreeformContentHandlerName","store","blocksStore","dispatch","render","unmountComponentAtNode","registerCoreBlocks","__experimentalGetCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","registerLegacyWidgetBlock","registerLegacyWidgetVariations","registerWidgetGroupBlock","interfaceStore","widgetArea","Layout","ALLOW_REUSABLE_BLOCKS","ENABLE_EXPERIMENTAL_FSE_BLOCKS","disabledBlocks","reinitializeEditor","target","settings","reboot","bind","initialize","id","document","getElementById","coreBlocks","filter","block","includes","name","startsWith","setFeatureDefaults","fixedToolbar","welcomeGuide","showBlockBreadcrumbs","themeStyles","__experimentalReapplyBlockTypeFilters","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","registerBlock","search","searchOptions","metadata"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,iBADD,EAECC,6CAFD,EAEgD;AAC/CC,6BAHD,EAICC,KAAK,IAAIC,WAJV,QAKO,mBALP;AAMA,SAASC,QAAT,QAAyB,iBAAzB;AACA,SAASC,MAAT,EAAiBC,sBAAjB,QAA+C,oBAA/C;AACA,SACCC,kBADD,EAECC,2BAFD,EAGCC,4CAHD,QAIO,0BAJP;AAKA,SAASC,kCAAkC,IAAIC,oBAA/C,QAA2E,sBAA3E;AACA,SACCC,yBADD,EAECC,8BAFD,EAGCC,wBAHD,QAIO,oBAJP;AAKA,SAASZ,KAAK,IAAIa,cAAlB,QAAwC,sBAAxC;AAEA;A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AAAsBW,IAAAA;AAAtB,MAA+BF,KAArC;;AACA,MAAKiB,QAAL,EAAgB;AACfjD,IAAAA,6CAA6C,CAAE;AAAE,OAAEkC,IAAF,GAAUe;AAAZ,KAAF,CAA7C;AACA;;AACDlD,EAAAA,iBAAiB,CAAEmC,IAAF,EAAQX,QAAR,CAAjB;AACA,CATD","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 { render, unmountComponentAtNode } 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 interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport './store';\nimport './filters';\nimport * as widgetArea from './blocks/widget-area';\n\nimport Layout from './components/layout';\nimport {\n\tALLOW_REUSABLE_BLOCKS,\n\tENABLE_EXPERIMENTAL_FSE_BLOCKS,\n} from './constants';\n\nconst disabledBlocks = [\n\t'core/more',\n\t'core/freeform',\n\t'core/template-part',\n\t...( ALLOW_REUSABLE_BLOCKS ? [] : [ 'core/block' ] ),\n];\n\n/**\n * Reinitializes the editor after the user chooses to reboot the editor after\n * an unhandled error occurs, replacing previously mounted editor element using\n * an initial state from prior to the crash.\n *\n * @param {Element} target DOM node in which editor is rendered.\n * @param {?Object} settings Editor settings object.\n */\nexport function reinitializeEditor( target, settings ) {\n\tunmountComponentAtNode( target );\n\tconst reboot = reinitializeEditor.bind( null, target, settings );\n\trender(\n\t\t<Layout blockEditorSettings={ settings } onError={ reboot } />,\n\t\ttarget\n\t);\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 initialize( id, settings ) {\n\tconst target = document.getElementById( id );\n\tconst reboot = reinitializeEditor.bind( null, target, settings );\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( interfaceStore ).setFeatureDefaults( '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 ).__experimentalReapplyBlockTypeFilters();\n\tregisterCoreBlocks( coreBlocks );\n\tregisterLegacyWidgetBlock();\n\tif ( process.env.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\trender(\n\t\t<Layout blockEditorSettings={ settings } onError={ reboot } />,\n\t\ttarget\n\t);\n}\n\n/**\n * Function to register an individual block.\n *\n * @param {Object} block The block to be registered.\n *\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-widgets",
3
- "version": "3.2.0",
3
+ "version": "4.0.0",
4
4
  "description": "Widgets Page module for WordPress..",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,37 +27,33 @@
27
27
  "react-native": "src/index",
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.16.0",
30
- "@wordpress/a11y": "^3.3.0",
31
- "@wordpress/api-fetch": "^6.0.0",
32
- "@wordpress/block-editor": "^8.1.0",
33
- "@wordpress/block-library": "^6.1.0",
34
- "@wordpress/blocks": "^11.2.0",
35
- "@wordpress/components": "^19.3.0",
36
- "@wordpress/compose": "^5.1.0",
37
- "@wordpress/core-data": "^4.1.0",
38
- "@wordpress/data": "^6.2.0",
39
- "@wordpress/dom": "^3.3.0",
40
- "@wordpress/element": "^4.1.0",
41
- "@wordpress/hooks": "^3.3.0",
42
- "@wordpress/i18n": "^4.3.0",
43
- "@wordpress/icons": "^6.2.0",
44
- "@wordpress/interface": "^4.2.0",
45
- "@wordpress/keyboard-shortcuts": "^3.1.0",
46
- "@wordpress/keycodes": "^3.3.0",
47
- "@wordpress/media-utils": "^3.1.0",
48
- "@wordpress/notices": "^3.3.0",
49
- "@wordpress/plugins": "^4.1.0",
50
- "@wordpress/reusable-blocks": "^3.1.0",
51
- "@wordpress/server-side-render": "^3.1.0",
52
- "@wordpress/url": "^3.4.0",
53
- "@wordpress/widgets": "^2.1.0",
30
+ "@wordpress/api-fetch": "^6.0.1",
31
+ "@wordpress/block-editor": "^8.1.1",
32
+ "@wordpress/block-library": "^7.0.0",
33
+ "@wordpress/blocks": "^11.2.1",
34
+ "@wordpress/components": "^19.4.0",
35
+ "@wordpress/compose": "^5.1.1",
36
+ "@wordpress/core-data": "^4.1.1",
37
+ "@wordpress/data": "^6.2.1",
38
+ "@wordpress/dom": "^3.3.1",
39
+ "@wordpress/element": "^4.1.1",
40
+ "@wordpress/hooks": "^3.3.1",
41
+ "@wordpress/i18n": "^4.3.1",
42
+ "@wordpress/icons": "^6.3.0",
43
+ "@wordpress/interface": "^4.2.1",
44
+ "@wordpress/keyboard-shortcuts": "^3.1.1",
45
+ "@wordpress/keycodes": "^3.3.1",
46
+ "@wordpress/media-utils": "^3.1.1",
47
+ "@wordpress/notices": "^3.3.1",
48
+ "@wordpress/plugins": "^4.1.1",
49
+ "@wordpress/reusable-blocks": "^3.1.1",
50
+ "@wordpress/url": "^3.4.1",
51
+ "@wordpress/widgets": "^2.1.1",
54
52
  "classnames": "^2.3.1",
55
- "lodash": "^4.17.21",
56
- "rememo": "^3.0.0",
57
- "uuid": "^8.3.0"
53
+ "lodash": "^4.17.21"
58
54
  },
59
55
  "publishConfig": {
60
56
  "access": "public"
61
57
  },
62
- "gitHead": "d95ccb9366e249133cdb1d7b25c382446b9ee502"
58
+ "gitHead": "2e4922861e49f5a090f9dc52056165092cfba163"
63
59
  }
@@ -1,8 +1,11 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
+ import { __, sprintf } from '@wordpress/i18n';
4
5
  import { Popover } from '@wordpress/components';
6
+ import { useDispatch } from '@wordpress/data';
5
7
  import { PluginArea } from '@wordpress/plugins';
8
+ import { store as noticesStore } from '@wordpress/notices';
6
9
 
7
10
  /**
8
11
  * Internal dependencies
@@ -15,6 +18,20 @@ import UnsavedChangesWarning from './unsaved-changes-warning';
15
18
  import WelcomeGuide from '../welcome-guide';
16
19
 
17
20
  function Layout( { blockEditorSettings, onError } ) {
21
+ const { createErrorNotice } = useDispatch( noticesStore );
22
+
23
+ function onPluginAreaError( name ) {
24
+ createErrorNotice(
25
+ sprintf(
26
+ /* translators: %s: plugin name */
27
+ __(
28
+ 'The "%s" plugin has encountered an error and cannot be rendered.'
29
+ ),
30
+ name
31
+ )
32
+ );
33
+ }
34
+
18
35
  return (
19
36
  <ErrorBoundary onError={ onError }>
20
37
  <WidgetAreasBlockEditorProvider
@@ -23,7 +40,7 @@ function Layout( { blockEditorSettings, onError } ) {
23
40
  <Interface blockEditorSettings={ blockEditorSettings } />
24
41
  <Sidebar />
25
42
  <Popover.Slot />
26
- <PluginArea />
43
+ <PluginArea onError={ onPluginAreaError } />
27
44
  <UnsavedChangesWarning />
28
45
  <WelcomeGuide />
29
46
  </WidgetAreasBlockEditorProvider>
@@ -14,6 +14,7 @@ import { useViewportMatch } from '@wordpress/compose';
14
14
  * Internal dependencies
15
15
  */
16
16
  import KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';
17
+ import ToolsMoreMenuGroup from './tools-more-menu-group';
17
18
 
18
19
  export default function MoreMenu() {
19
20
  const [
@@ -33,7 +34,7 @@ export default function MoreMenu() {
33
34
  return (
34
35
  <>
35
36
  <MoreMenuDropdown>
36
- { () => (
37
+ { ( onClose ) => (
37
38
  <>
38
39
  { isLargeViewport && (
39
40
  <MenuGroup label={ _x( 'View', 'noun' ) }>
@@ -84,6 +85,9 @@ export default function MoreMenu() {
84
85
  }
85
86
  </VisuallyHidden>
86
87
  </MenuItem>
88
+ <ToolsMoreMenuGroup.Slot
89
+ fillProps={ { onClose } }
90
+ />
87
91
  </MenuGroup>
88
92
  <MenuGroup label={ __( 'Preferences' ) }>
89
93
  <MoreMenuFeatureToggle
@@ -0,0 +1,21 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { isEmpty } from 'lodash';
5
+
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { createSlotFill } from '@wordpress/components';
10
+
11
+ const { Fill: ToolsMoreMenuGroup, Slot } = createSlotFill(
12
+ 'EditWidgetsToolsMoreMenuGroup'
13
+ );
14
+
15
+ ToolsMoreMenuGroup.Slot = ( { fillProps } ) => (
16
+ <Slot fillProps={ fillProps }>
17
+ { ( fills ) => ! isEmpty( fills ) && fills }
18
+ </Slot>
19
+ );
20
+
21
+ export default ToolsMoreMenuGroup;
package/src/index.js CHANGED
@@ -88,7 +88,7 @@ export function initialize( id, settings ) {
88
88
  dispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();
89
89
  registerCoreBlocks( coreBlocks );
90
90
  registerLegacyWidgetBlock();
91
- if ( process.env.GUTENBERG_PHASE === 2 ) {
91
+ if ( process.env.IS_GUTENBERG_PLUGIN ) {
92
92
  __experimentalRegisterExperimentalCoreBlocks( {
93
93
  enableFSEBlocks: ENABLE_EXPERIMENTAL_FSE_BLOCKS,
94
94
  } );