@wordpress/edit-widgets 5.34.0 → 6.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.
Files changed (123) hide show
  1. package/CHANGELOG.md +15 -2
  2. package/build/blocks/widget-area/edit/index.js +33 -30
  3. package/build/blocks/widget-area/edit/index.js.map +1 -1
  4. package/build/blocks/widget-area/edit/inner-blocks.js +8 -7
  5. package/build/blocks/widget-area/edit/inner-blocks.js.map +1 -1
  6. package/build/components/error-boundary/index.js +14 -12
  7. package/build/components/error-boundary/index.js.map +1 -1
  8. package/build/components/header/document-tools/index.js +40 -60
  9. package/build/components/header/document-tools/index.js.map +1 -1
  10. package/build/components/header/index.js +32 -22
  11. package/build/components/header/index.js.map +1 -1
  12. package/build/components/header/undo-redo/redo.js +2 -2
  13. package/build/components/header/undo-redo/redo.js.map +1 -1
  14. package/build/components/header/undo-redo/undo.js +2 -2
  15. package/build/components/header/undo-redo/undo.js.map +1 -1
  16. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
  17. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  18. package/build/components/keyboard-shortcut-help-modal/index.js +54 -49
  19. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  20. package/build/components/keyboard-shortcut-help-modal/shortcut.js +30 -26
  21. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  22. package/build/components/layout/index.js +11 -8
  23. package/build/components/layout/index.js.map +1 -1
  24. package/build/components/layout/interface.js +16 -13
  25. package/build/components/layout/interface.js.map +1 -1
  26. package/build/components/more-menu/index.js +81 -70
  27. package/build/components/more-menu/index.js.map +1 -1
  28. package/build/components/more-menu/tools-more-menu-group.js +5 -4
  29. package/build/components/more-menu/tools-more-menu-group.js.map +1 -1
  30. package/build/components/notices/index.js +15 -13
  31. package/build/components/notices/index.js.map +1 -1
  32. package/build/components/save-button/index.js +5 -4
  33. package/build/components/save-button/index.js.map +1 -1
  34. package/build/components/secondary-sidebar/index.js +3 -3
  35. package/build/components/secondary-sidebar/index.js.map +1 -1
  36. package/build/components/secondary-sidebar/inserter-sidebar.js +21 -18
  37. package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  38. package/build/components/secondary-sidebar/list-view-sidebar.js +21 -15
  39. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  40. package/build/components/sidebar/index.js +49 -37
  41. package/build/components/sidebar/index.js.map +1 -1
  42. package/build/components/sidebar/widget-areas.js +29 -22
  43. package/build/components/sidebar/widget-areas.js.map +1 -1
  44. package/build/components/welcome-guide/index.js +80 -53
  45. package/build/components/welcome-guide/index.js.map +1 -1
  46. package/build/components/widget-areas-block-editor-content/index.js +18 -11
  47. package/build/components/widget-areas-block-editor-content/index.js.map +1 -1
  48. package/build/components/widget-areas-block-editor-provider/index.js +14 -11
  49. package/build/components/widget-areas-block-editor-provider/index.js.map +1 -1
  50. package/build/filters/move-to-widget-area.js +14 -10
  51. package/build/filters/move-to-widget-area.js.map +1 -1
  52. package/build/index.js +3 -3
  53. package/build/index.js.map +1 -1
  54. package/build/store/private-selectors.js +4 -0
  55. package/build/store/private-selectors.js.map +1 -1
  56. package/build/store/reducer.js +16 -0
  57. package/build/store/reducer.js.map +1 -1
  58. package/build-module/blocks/widget-area/edit/index.js +32 -28
  59. package/build-module/blocks/widget-area/edit/index.js.map +1 -1
  60. package/build-module/blocks/widget-area/edit/inner-blocks.js +8 -7
  61. package/build-module/blocks/widget-area/edit/inner-blocks.js.map +1 -1
  62. package/build-module/components/error-boundary/index.js +14 -12
  63. package/build-module/components/error-boundary/index.js.map +1 -1
  64. package/build-module/components/header/document-tools/index.js +44 -62
  65. package/build-module/components/header/document-tools/index.js.map +1 -1
  66. package/build-module/components/header/index.js +34 -22
  67. package/build-module/components/header/index.js.map +1 -1
  68. package/build-module/components/header/undo-redo/redo.js +2 -2
  69. package/build-module/components/header/undo-redo/redo.js.map +1 -1
  70. package/build-module/components/header/undo-redo/undo.js +2 -2
  71. package/build-module/components/header/undo-redo/undo.js.map +1 -1
  72. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +2 -2
  73. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  74. package/build-module/components/keyboard-shortcut-help-modal/index.js +55 -49
  75. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  76. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +32 -26
  77. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  78. package/build-module/components/layout/index.js +12 -8
  79. package/build-module/components/layout/index.js.map +1 -1
  80. package/build-module/components/layout/interface.js +17 -13
  81. package/build-module/components/layout/interface.js.map +1 -1
  82. package/build-module/components/more-menu/index.js +83 -70
  83. package/build-module/components/more-menu/index.js.map +1 -1
  84. package/build-module/components/more-menu/tools-more-menu-group.js +5 -4
  85. package/build-module/components/more-menu/tools-more-menu-group.js.map +1 -1
  86. package/build-module/components/notices/index.js +17 -13
  87. package/build-module/components/notices/index.js.map +1 -1
  88. package/build-module/components/save-button/index.js +5 -4
  89. package/build-module/components/save-button/index.js.map +1 -1
  90. package/build-module/components/secondary-sidebar/index.js +3 -3
  91. package/build-module/components/secondary-sidebar/index.js.map +1 -1
  92. package/build-module/components/secondary-sidebar/inserter-sidebar.js +22 -18
  93. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  94. package/build-module/components/secondary-sidebar/list-view-sidebar.js +22 -15
  95. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  96. package/build-module/components/sidebar/index.js +50 -37
  97. package/build-module/components/sidebar/index.js.map +1 -1
  98. package/build-module/components/sidebar/widget-areas.js +30 -22
  99. package/build-module/components/sidebar/widget-areas.js.map +1 -1
  100. package/build-module/components/welcome-guide/index.js +82 -53
  101. package/build-module/components/welcome-guide/index.js.map +1 -1
  102. package/build-module/components/widget-areas-block-editor-content/index.js +19 -11
  103. package/build-module/components/widget-areas-block-editor-content/index.js.map +1 -1
  104. package/build-module/components/widget-areas-block-editor-provider/index.js +15 -11
  105. package/build-module/components/widget-areas-block-editor-provider/index.js.map +1 -1
  106. package/build-module/filters/move-to-widget-area.js +16 -10
  107. package/build-module/filters/move-to-widget-area.js.map +1 -1
  108. package/build-module/index.js +3 -3
  109. package/build-module/index.js.map +1 -1
  110. package/build-module/store/private-selectors.js +3 -0
  111. package/build-module/store/private-selectors.js.map +1 -1
  112. package/build-module/store/reducer.js +15 -0
  113. package/build-module/store/reducer.js.map +1 -1
  114. package/build-style/style-rtl.css +15 -14
  115. package/build-style/style.css +15 -14
  116. package/package.json +31 -30
  117. package/src/blocks/widget-area/edit/inner-blocks.js +2 -2
  118. package/src/components/header/document-tools/index.js +30 -50
  119. package/src/components/keyboard-shortcut-help-modal/index.js +2 -2
  120. package/src/components/layout/style.scss +1 -1
  121. package/src/index.js +1 -1
  122. package/src/store/private-selectors.js +4 -0
  123. package/src/store/reducer.js +13 -0
@@ -1,8 +1,7 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * External dependencies
4
3
  */
5
- import classnames from 'classnames';
4
+ import clsx from 'clsx';
6
5
 
7
6
  /**
8
7
  * WordPress dependencies
@@ -18,37 +17,43 @@ import { useSelect } from '@wordpress/data';
18
17
  import { textFormattingShortcuts } from './config';
19
18
  import Shortcut from './shortcut';
20
19
  import DynamicShortcut from './dynamic-shortcut';
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ import { jsxs as _jsxs } from "react/jsx-runtime";
21
22
  const ShortcutList = ({
22
23
  shortcuts
23
24
  }) =>
25
+ /*#__PURE__*/
24
26
  /*
25
27
  * Disable reason: The `list` ARIA role is redundant but
26
28
  * Safari+VoiceOver won't announce the list otherwise.
27
29
  */
28
30
  /* eslint-disable jsx-a11y/no-redundant-roles */
29
- createElement("ul", {
31
+ _jsx("ul", {
30
32
  className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-list",
31
- role: "list"
32
- }, shortcuts.map((shortcut, index) => createElement("li", {
33
- className: "edit-widgets-keyboard-shortcut-help-modal__shortcut",
34
- key: index
35
- }, typeof shortcut === 'string' ? createElement(DynamicShortcut, {
36
- name: shortcut
37
- }) : createElement(Shortcut, {
38
- ...shortcut
39
- }))))
33
+ role: "list",
34
+ children: shortcuts.map((shortcut, index) => /*#__PURE__*/_jsx("li", {
35
+ className: "edit-widgets-keyboard-shortcut-help-modal__shortcut",
36
+ children: typeof shortcut === 'string' ? /*#__PURE__*/_jsx(DynamicShortcut, {
37
+ name: shortcut
38
+ }) : /*#__PURE__*/_jsx(Shortcut, {
39
+ ...shortcut
40
+ })
41
+ }, index))
42
+ })
40
43
  /* eslint-enable jsx-a11y/no-redundant-roles */;
41
44
  const ShortcutSection = ({
42
45
  title,
43
46
  shortcuts,
44
47
  className
45
- }) => createElement("section", {
46
- className: classnames('edit-widgets-keyboard-shortcut-help-modal__section', className)
47
- }, !!title && createElement("h2", {
48
- className: "edit-widgets-keyboard-shortcut-help-modal__section-title"
49
- }, title), createElement(ShortcutList, {
50
- shortcuts: shortcuts
51
- }));
48
+ }) => /*#__PURE__*/_jsxs("section", {
49
+ className: clsx('edit-widgets-keyboard-shortcut-help-modal__section', className),
50
+ children: [!!title && /*#__PURE__*/_jsx("h2", {
51
+ className: "edit-widgets-keyboard-shortcut-help-modal__section-title",
52
+ children: title
53
+ }), /*#__PURE__*/_jsx(ShortcutList, {
54
+ shortcuts: shortcuts
55
+ })]
56
+ });
52
57
  const ShortcutCategorySection = ({
53
58
  title,
54
59
  categoryName,
@@ -57,7 +62,7 @@ const ShortcutCategorySection = ({
57
62
  const categoryShortcuts = useSelect(select => {
58
63
  return select(keyboardShortcutsStore).getCategoryShortcuts(categoryName);
59
64
  }, [categoryName]);
60
- return createElement(ShortcutSection, {
65
+ return /*#__PURE__*/_jsx(ShortcutSection, {
61
66
  title: title,
62
67
  shortcuts: categoryShortcuts.concat(additionalShortcuts)
63
68
  });
@@ -72,36 +77,37 @@ export default function KeyboardShortcutHelpModal({
72
77
  if (!isModalActive) {
73
78
  return null;
74
79
  }
75
- return createElement(Modal, {
80
+ return /*#__PURE__*/_jsxs(Modal, {
76
81
  className: "edit-widgets-keyboard-shortcut-help-modal",
77
82
  title: __('Keyboard shortcuts'),
78
- onRequestClose: toggleModal
79
- }, createElement(ShortcutSection, {
80
- className: "edit-widgets-keyboard-shortcut-help-modal__main-shortcuts",
81
- shortcuts: ['core/edit-widgets/keyboard-shortcuts']
82
- }), createElement(ShortcutCategorySection, {
83
- title: __('Global shortcuts'),
84
- categoryName: "global"
85
- }), createElement(ShortcutCategorySection, {
86
- title: __('Selection shortcuts'),
87
- categoryName: "selection"
88
- }), createElement(ShortcutCategorySection, {
89
- title: __('Block shortcuts'),
90
- categoryName: "block",
91
- additionalShortcuts: [{
92
- keyCombination: {
93
- character: '/'
94
- },
95
- description: __('Change the block type after adding a new paragraph.'),
96
- /* translators: The forward-slash character. e.g. '/'. */
97
- ariaLabel: __('Forward-slash')
98
- }]
99
- }), createElement(ShortcutSection, {
100
- title: __('Text formatting'),
101
- shortcuts: textFormattingShortcuts
102
- }), createElement(ShortcutCategorySection, {
103
- title: __('List View shortcuts'),
104
- categoryName: "list-view"
105
- }));
83
+ onRequestClose: toggleModal,
84
+ children: [/*#__PURE__*/_jsx(ShortcutSection, {
85
+ className: "edit-widgets-keyboard-shortcut-help-modal__main-shortcuts",
86
+ shortcuts: ['core/edit-widgets/keyboard-shortcuts']
87
+ }), /*#__PURE__*/_jsx(ShortcutCategorySection, {
88
+ title: __('Global shortcuts'),
89
+ categoryName: "global"
90
+ }), /*#__PURE__*/_jsx(ShortcutCategorySection, {
91
+ title: __('Selection shortcuts'),
92
+ categoryName: "selection"
93
+ }), /*#__PURE__*/_jsx(ShortcutCategorySection, {
94
+ title: __('Block shortcuts'),
95
+ categoryName: "block",
96
+ additionalShortcuts: [{
97
+ keyCombination: {
98
+ character: '/'
99
+ },
100
+ description: __('Change the block type after adding a new paragraph.'),
101
+ /* translators: The forward-slash character. e.g. '/'. */
102
+ ariaLabel: __('Forward-slash')
103
+ }]
104
+ }), /*#__PURE__*/_jsx(ShortcutSection, {
105
+ title: __('Text formatting'),
106
+ shortcuts: textFormattingShortcuts
107
+ }), /*#__PURE__*/_jsx(ShortcutCategorySection, {
108
+ title: __('List View shortcuts'),
109
+ categoryName: "list-view"
110
+ })]
111
+ });
106
112
  }
107
113
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","Modal","__","useShortcut","store","keyboardShortcutsStore","useSelect","textFormattingShortcuts","Shortcut","DynamicShortcut","ShortcutList","shortcuts","createElement","className","role","map","shortcut","index","key","name","ShortcutSection","title","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","bindGlobal","onRequestClose","keyCombination","character","description","ariaLabel"],"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { textFormattingShortcuts } from './config';\nimport Shortcut from './shortcut';\nimport DynamicShortcut from './dynamic-shortcut';\n\nconst ShortcutList = ( { shortcuts } ) => (\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t<ul\n\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-list\"\n\t\trole=\"list\"\n\t>\n\t\t{ shortcuts.map( ( shortcut, index ) => (\n\t\t\t<li\n\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut\"\n\t\t\t\tkey={ index }\n\t\t\t>\n\t\t\t\t{ typeof shortcut === 'string' ? (\n\t\t\t\t\t<DynamicShortcut name={ shortcut } />\n\t\t\t\t) : (\n\t\t\t\t\t<Shortcut { ...shortcut } />\n\t\t\t\t) }\n\t\t\t</li>\n\t\t) ) }\n\t</ul>\n\t/* eslint-enable jsx-a11y/no-redundant-roles */\n);\n\nconst ShortcutSection = ( { title, shortcuts, className } ) => (\n\t<section\n\t\tclassName={ classnames(\n\t\t\t'edit-widgets-keyboard-shortcut-help-modal__section',\n\t\t\tclassName\n\t\t) }\n\t>\n\t\t{ !! title && (\n\t\t\t<h2 className=\"edit-widgets-keyboard-shortcut-help-modal__section-title\">\n\t\t\t\t{ title }\n\t\t\t</h2>\n\t\t) }\n\t\t<ShortcutList shortcuts={ shortcuts } />\n\t</section>\n);\n\nconst ShortcutCategorySection = ( {\n\ttitle,\n\tcategoryName,\n\tadditionalShortcuts = [],\n} ) => {\n\tconst categoryShortcuts = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( keyboardShortcutsStore ).getCategoryShortcuts(\n\t\t\t\tcategoryName\n\t\t\t);\n\t\t},\n\t\t[ categoryName ]\n\t);\n\n\treturn (\n\t\t<ShortcutSection\n\t\t\ttitle={ title }\n\t\t\tshortcuts={ categoryShortcuts.concat( additionalShortcuts ) }\n\t\t/>\n\t);\n};\n\nexport default function KeyboardShortcutHelpModal( {\n\tisModalActive,\n\ttoggleModal,\n} ) {\n\tuseShortcut( 'core/edit-widgets/keyboard-shortcuts', toggleModal, {\n\t\tbindGlobal: true,\n\t} );\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal\"\n\t\t\ttitle={ __( 'Keyboard shortcuts' ) }\n\t\t\tonRequestClose={ toggleModal }\n\t\t>\n\t\t\t<ShortcutSection\n\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__main-shortcuts\"\n\t\t\t\tshortcuts={ [ 'core/edit-widgets/keyboard-shortcuts' ] }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Global shortcuts' ) }\n\t\t\t\tcategoryName=\"global\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Selection shortcuts' ) }\n\t\t\t\tcategoryName=\"selection\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Block shortcuts' ) }\n\t\t\t\tcategoryName=\"block\"\n\t\t\t\tadditionalShortcuts={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyCombination: { character: '/' },\n\t\t\t\t\t\tdescription: __(\n\t\t\t\t\t\t\t'Change the block type after adding a new paragraph.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t/* translators: The forward-slash character. e.g. '/'. */\n\t\t\t\t\t\tariaLabel: __( 'Forward-slash' ),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t\t<ShortcutSection\n\t\t\t\ttitle={ __( 'Text formatting' ) }\n\t\t\t\tshortcuts={ textFormattingShortcuts }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'List View shortcuts' ) }\n\t\t\t\tcategoryName=\"list-view\"\n\t\t\t/>\n\t\t</Modal>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,WAAW,EACXC,KAAK,IAAIC,sBAAsB,QACzB,+BAA+B;AACtC,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,uBAAuB,QAAQ,UAAU;AAClD,OAAOC,QAAQ,MAAM,YAAY;AACjC,OAAOC,eAAe,MAAM,oBAAoB;AAEhD,MAAMC,YAAY,GAAGA,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AAE4B,WAAW,EAAE;IACjEC,UAAU,EAAE;EACb,CAAE,CAAC;EAEH,IAAK,CAAEF,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,OACClB,aAAA,CAACX,KAAK;IACLY,SAAS,EAAC,2CAA2C;IACrDQ,KAAK,EAAGnB,EAAE,CAAE,oBAAqB,CAAG;IACpC+B,cAAc,EAAGF;EAAa,GAE9BnB,aAAA,CAACQ,eAAe;IACfP,SAAS,EAAC,2DAA2D;IACrEF,SAAS,EAAG,CAAE,sCAAsC;EAAI,CACxD,CAAC,EACFC,aAAA,CAACU,uBAAuB;IACvBD,KAAK,EAAGnB,EAAE,CAAE,kBAAmB,CAAG;IAClCqB,YAAY,EAAC;EAAQ,CACrB,CAAC,EAEFX,aAAA,CAACU,uBAAuB;IACvBD,KAAK,EAAGnB,EAAE,CAAE,qBAAsB,CAAG;IACrCqB,YAAY,EAAC;EAAW,CACxB,CAAC,EAEFX,aAAA,CAACU,uBAAuB;IACvBD,KAAK,EAAGnB,EAAE,CAAE,iBAAkB,CAAG;IACjCqB,YAAY,EAAC,OAAO;IACpBC,mBAAmB,EAAG,CACrB;MACCU,cAAc,EAAE;QAAEC,SAAS,EAAE;MAAI,CAAC;MAClCC,WAAW,EAAElC,EAAE,CACd,qDACD,CAAC;MACD;MACAmC,SAAS,EAAEnC,EAAE,CAAE,eAAgB;IAChC,CAAC;EACC,CACH,CAAC,EACFU,aAAA,CAACQ,eAAe;IACfC,KAAK,EAAGnB,EAAE,CAAE,iBAAkB,CAAG;IACjCS,SAAS,EAAGJ;EAAyB,CACrC,CAAC,EACFK,aAAA,CAACU,uBAAuB;IACvBD,KAAK,EAAGnB,EAAE,CAAE,qBAAsB,CAAG;IACrCqB,YAAY,EAAC;EAAW,CACxB,CACK,CAAC;AAEV","ignoreList":[]}
1
+ {"version":3,"names":["clsx","Modal","__","useShortcut","store","keyboardShortcutsStore","useSelect","textFormattingShortcuts","Shortcut","DynamicShortcut","jsx","_jsx","jsxs","_jsxs","ShortcutList","shortcuts","className","role","children","map","shortcut","index","name","ShortcutSection","title","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","toggleModal","bindGlobal","onRequestClose","keyCombination","character","description","ariaLabel"],"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { textFormattingShortcuts } from './config';\nimport Shortcut from './shortcut';\nimport DynamicShortcut from './dynamic-shortcut';\n\nconst ShortcutList = ( { shortcuts } ) => (\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t<ul\n\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-list\"\n\t\trole=\"list\"\n\t>\n\t\t{ shortcuts.map( ( shortcut, index ) => (\n\t\t\t<li\n\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut\"\n\t\t\t\tkey={ index }\n\t\t\t>\n\t\t\t\t{ typeof shortcut === 'string' ? (\n\t\t\t\t\t<DynamicShortcut name={ shortcut } />\n\t\t\t\t) : (\n\t\t\t\t\t<Shortcut { ...shortcut } />\n\t\t\t\t) }\n\t\t\t</li>\n\t\t) ) }\n\t</ul>\n\t/* eslint-enable jsx-a11y/no-redundant-roles */\n);\n\nconst ShortcutSection = ( { title, shortcuts, className } ) => (\n\t<section\n\t\tclassName={ clsx(\n\t\t\t'edit-widgets-keyboard-shortcut-help-modal__section',\n\t\t\tclassName\n\t\t) }\n\t>\n\t\t{ !! title && (\n\t\t\t<h2 className=\"edit-widgets-keyboard-shortcut-help-modal__section-title\">\n\t\t\t\t{ title }\n\t\t\t</h2>\n\t\t) }\n\t\t<ShortcutList shortcuts={ shortcuts } />\n\t</section>\n);\n\nconst ShortcutCategorySection = ( {\n\ttitle,\n\tcategoryName,\n\tadditionalShortcuts = [],\n} ) => {\n\tconst categoryShortcuts = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( keyboardShortcutsStore ).getCategoryShortcuts(\n\t\t\t\tcategoryName\n\t\t\t);\n\t\t},\n\t\t[ categoryName ]\n\t);\n\n\treturn (\n\t\t<ShortcutSection\n\t\t\ttitle={ title }\n\t\t\tshortcuts={ categoryShortcuts.concat( additionalShortcuts ) }\n\t\t/>\n\t);\n};\n\nexport default function KeyboardShortcutHelpModal( {\n\tisModalActive,\n\ttoggleModal,\n} ) {\n\tuseShortcut( 'core/edit-widgets/keyboard-shortcuts', toggleModal, {\n\t\tbindGlobal: true,\n\t} );\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal\"\n\t\t\ttitle={ __( 'Keyboard shortcuts' ) }\n\t\t\tonRequestClose={ toggleModal }\n\t\t>\n\t\t\t<ShortcutSection\n\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__main-shortcuts\"\n\t\t\t\tshortcuts={ [ 'core/edit-widgets/keyboard-shortcuts' ] }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Global shortcuts' ) }\n\t\t\t\tcategoryName=\"global\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Selection shortcuts' ) }\n\t\t\t\tcategoryName=\"selection\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Block shortcuts' ) }\n\t\t\t\tcategoryName=\"block\"\n\t\t\t\tadditionalShortcuts={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyCombination: { character: '/' },\n\t\t\t\t\t\tdescription: __(\n\t\t\t\t\t\t\t'Change the block type after adding a new paragraph.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t/* translators: The forward-slash character. e.g. '/'. */\n\t\t\t\t\t\tariaLabel: __( 'Forward-slash' ),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t\t<ShortcutSection\n\t\t\t\ttitle={ __( 'Text formatting' ) }\n\t\t\t\tshortcuts={ textFormattingShortcuts }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'List View shortcuts' ) }\n\t\t\t\tcategoryName=\"list-view\"\n\t\t\t/>\n\t\t</Modal>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,WAAW,EACXC,KAAK,IAAIC,sBAAsB,QACzB,+BAA+B;AACtC,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,uBAAuB,QAAQ,UAAU;AAClD,OAAOC,QAAQ,MAAM,YAAY;AACjC,OAAOC,eAAe,MAAM,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEjD,MAAMC,YAAY,GAAGA,CAAE;EAAEC;AAAU,CAAC;AAAA;AACnC;AACD;AACA;AACA;AACC;AACAJ,IAAA;EACCK,SAAS,EAAC,0DAA0D;EACpEC,IAAI,EAAC,MAAM;EAAAC,QAAA,EAETH,SAAS,CAACI,GAAG,CAAE,CAAEC,QAAQ,EAAEC,KAAK,kBACjCV,IAAA;IACCK,SAAS,EAAC,qDAAqD;IAAAE,QAAA,EAG7D,OAAOE,QAAQ,KAAK,QAAQ,gBAC7BT,IAAA,CAACF,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EAAGF,WAAa;IAAAhB,QAAA,gBAE9BP,IAAA,CAACY,eAAe;MACfP,SAAS,EAAC,2DAA2D;MACrED,SAAS,EAAG,CAAE,sCAAsC;IAAI,CACxD,CAAC,eACFJ,IAAA,CAACc,uBAAuB;MACvBD,KAAK,EAAGtB,EAAE,CAAE,kBAAmB,CAAG;MAClCwB,YAAY,EAAC;IAAQ,CACrB,CAAC,eAEFf,IAAA,CAACc,uBAAuB;MACvBD,KAAK,EAAGtB,EAAE,CAAE,qBAAsB,CAAG;MACrCwB,YAAY,EAAC;IAAW,CACxB,CAAC,eAEFf,IAAA,CAACc,uBAAuB;MACvBD,KAAK,EAAGtB,EAAE,CAAE,iBAAkB,CAAG;MACjCwB,YAAY,EAAC,OAAO;MACpBC,mBAAmB,EAAG,CACrB;QACCU,cAAc,EAAE;UAAEC,SAAS,EAAE;QAAI,CAAC;QAClCC,WAAW,EAAErC,EAAE,CACd,qDACD,CAAC;QACD;QACAsC,SAAS,EAAEtC,EAAE,CAAE,eAAgB;MAChC,CAAC;IACC,CACH,CAAC,eACFS,IAAA,CAACY,eAAe;MACfC,KAAK,EAAGtB,EAAE,CAAE,iBAAkB,CAAG;MACjCa,SAAS,EAAGR;IAAyB,CACrC,CAAC,eACFI,IAAA,CAACc,uBAAuB;MACvBD,KAAK,EAAGtB,EAAE,CAAE,qBAAsB,CAAG;MACrCwB,YAAY,EAAC;IAAW,CACxB,CAAC;EAAA,CACI,CAAC;AAEV","ignoreList":[]}
@@ -1,9 +1,11 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
5
4
  import { Fragment } from '@wordpress/element';
6
5
  import { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
8
+ import { Fragment as _Fragment } from "react/jsx-runtime";
7
9
  function KeyCombination({
8
10
  keyCombination,
9
11
  forceAriaLabel
@@ -11,20 +13,21 @@ function KeyCombination({
11
13
  const shortcut = keyCombination.modifier ? displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character;
12
14
  const ariaLabel = keyCombination.modifier ? shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character;
13
15
  const shortcuts = Array.isArray(shortcut) ? shortcut : [shortcut];
14
- return createElement("kbd", {
16
+ return /*#__PURE__*/_jsx("kbd", {
15
17
  className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination",
16
- "aria-label": forceAriaLabel || ariaLabel
17
- }, shortcuts.map((character, index) => {
18
- if (character === '+') {
19
- return createElement(Fragment, {
20
- key: index
21
- }, character);
22
- }
23
- return createElement("kbd", {
24
- key: index,
25
- className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key"
26
- }, character);
27
- }));
18
+ "aria-label": forceAriaLabel || ariaLabel,
19
+ children: shortcuts.map((character, index) => {
20
+ if (character === '+') {
21
+ return /*#__PURE__*/_jsx(Fragment, {
22
+ children: character
23
+ }, index);
24
+ }
25
+ return /*#__PURE__*/_jsx("kbd", {
26
+ className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key",
27
+ children: character
28
+ }, index);
29
+ })
30
+ });
28
31
  }
29
32
  function Shortcut({
30
33
  description,
@@ -32,18 +35,21 @@ function Shortcut({
32
35
  aliases = [],
33
36
  ariaLabel
34
37
  }) {
35
- return createElement(Fragment, null, createElement("div", {
36
- className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-description"
37
- }, description), createElement("div", {
38
- className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-term"
39
- }, createElement(KeyCombination, {
40
- keyCombination: keyCombination,
41
- forceAriaLabel: ariaLabel
42
- }), aliases.map((alias, index) => createElement(KeyCombination, {
43
- keyCombination: alias,
44
- forceAriaLabel: ariaLabel,
45
- key: index
46
- }))));
38
+ return /*#__PURE__*/_jsxs(_Fragment, {
39
+ children: [/*#__PURE__*/_jsx("div", {
40
+ className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-description",
41
+ children: description
42
+ }), /*#__PURE__*/_jsxs("div", {
43
+ className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-term",
44
+ children: [/*#__PURE__*/_jsx(KeyCombination, {
45
+ keyCombination: keyCombination,
46
+ forceAriaLabel: ariaLabel
47
+ }), aliases.map((alias, index) => /*#__PURE__*/_jsx(KeyCombination, {
48
+ keyCombination: alias,
49
+ forceAriaLabel: ariaLabel
50
+ }, index))]
51
+ })]
52
+ });
47
53
  }
48
54
  export default Shortcut;
49
55
  //# sourceMappingURL=shortcut.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Fragment","displayShortcutList","shortcutAriaLabel","KeyCombination","keyCombination","forceAriaLabel","shortcut","modifier","character","ariaLabel","shortcuts","Array","isArray","createElement","className","map","index","key","Shortcut","description","aliases","alias"],"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/shortcut.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';\n\nfunction KeyCombination( { keyCombination, forceAriaLabel } ) {\n\tconst shortcut = keyCombination.modifier\n\t\t? displayShortcutList[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst ariaLabel = keyCombination.modifier\n\t\t? shortcutAriaLabel[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst shortcuts = Array.isArray( shortcut ) ? shortcut : [ shortcut ];\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\taria-label={ forceAriaLabel || ariaLabel }\n\t\t>\n\t\t\t{ shortcuts.map( ( character, index ) => {\n\t\t\t\tif ( character === '+' ) {\n\t\t\t\t\treturn <Fragment key={ index }>{ character }</Fragment>;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<kbd\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ character }\n\t\t\t\t\t</kbd>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</kbd>\n\t);\n}\n\nfunction Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-term\">\n\t\t\t\t<KeyCombination\n\t\t\t\t\tkeyCombination={ keyCombination }\n\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t/>\n\t\t\t\t{ aliases.map( ( alias, index ) => (\n\t\t\t\t\t<KeyCombination\n\t\t\t\t\t\tkeyCombination={ alias }\n\t\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Shortcut;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,mBAAmB,EAAEC,iBAAiB,QAAQ,qBAAqB;AAE5E,SAASC,cAAcA,CAAE;EAAEC,cAAc;EAAEC;AAAe,CAAC,EAAG;EAC7D,MAAMC,QAAQ,GAAGF,cAAc,CAACG,QAAQ,GACrCN,mBAAmB,CAAEG,cAAc,CAACG,QAAQ,CAAE,CAC9CH,cAAc,CAACI,SACf,CAAC,GACDJ,cAAc,CAACI,SAAS;EAC3B,MAAMC,SAAS,GAAGL,cAAc,CAACG,QAAQ,GACtCL,iBAAiB,CAAEE,cAAc,CAACG,QAAQ,CAAE,CAC5CH,cAAc,CAACI,SACf,CAAC,GACDJ,cAAc,CAACI,SAAS;EAC3B,MAAME,SAAS,GAAGC,KAAK,CAACC,OAAO,CAAEN,QAAS,CAAC,GAAGA,QAAQ,GAAG,CAAEA,QAAQ,CAAE;EAErE,OACCO,aAAA;IACCC,SAAS,EAAC,qEAAqE;IAC/E,cAAaT,cAAc,IAAII;EAAW,GAExCC,SAAS,CAACK,GAAG,CAAE,CAAEP,SAAS,EAAEQ,KAAK,KAAM;IACxC,IAAKR,SAAS,KAAK,GAAG,EAAG;MACxB,OAAOK,aAAA,CAACb,QAAQ;QAACiB,GAAG,EAAGD;MAAO,GAAGR,SAAqB,CAAC;IACxD;IAEA,OACCK,aAAA;MACCI,GAAG,EAAGD,KAAO;MACbF,SAAS,EAAC;IAAyD,GAEjEN,SACE,CAAC;EAER,CAAE,CACE,CAAC;AAER;AAEA,SAASU,QAAQA,CAAE;EAAEC,WAAW;EAAEf,cAAc;EAAEgB,OAAO,GAAG,EAAE;EAAEX;AAAU,CAAC,EAAG;EAC7E,OACCI,aAAA,CAAAb,QAAA,QACCa,aAAA;IAAKC,SAAS,EAAC;EAAiE,GAC7EK,WACE,CAAC,EACNN,aAAA;IAAKC,SAAS,EAAC;EAA0D,GACxED,aAAA,CAACV,cAAc;IACdC,cAAc,EAAGA,cAAgB;IACjCC,cAAc,EAAGI;EAAW,CAC5B,CAAC,EACAW,OAAO,CAACL,GAAG,CAAE,CAAEM,KAAK,EAAEL,KAAK,KAC5BH,aAAA,CAACV,cAAc;IACdC,cAAc,EAAGiB,KAAO;IACxBhB,cAAc,EAAGI,SAAW;IAC5BQ,GAAG,EAAGD;EAAO,CACb,CACA,CACE,CACJ,CAAC;AAEL;AAEA,eAAeE,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":["Fragment","displayShortcutList","shortcutAriaLabel","jsx","_jsx","jsxs","_jsxs","_Fragment","KeyCombination","keyCombination","forceAriaLabel","shortcut","modifier","character","ariaLabel","shortcuts","Array","isArray","className","children","map","index","Shortcut","description","aliases","alias"],"sources":["@wordpress/edit-widgets/src/components/keyboard-shortcut-help-modal/shortcut.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';\n\nfunction KeyCombination( { keyCombination, forceAriaLabel } ) {\n\tconst shortcut = keyCombination.modifier\n\t\t? displayShortcutList[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst ariaLabel = keyCombination.modifier\n\t\t? shortcutAriaLabel[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst shortcuts = Array.isArray( shortcut ) ? shortcut : [ shortcut ];\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\taria-label={ forceAriaLabel || ariaLabel }\n\t\t>\n\t\t\t{ shortcuts.map( ( character, index ) => {\n\t\t\t\tif ( character === '+' ) {\n\t\t\t\t\treturn <Fragment key={ index }>{ character }</Fragment>;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<kbd\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\tclassName=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ character }\n\t\t\t\t\t</kbd>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</kbd>\n\t);\n}\n\nfunction Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"edit-widgets-keyboard-shortcut-help-modal__shortcut-term\">\n\t\t\t\t<KeyCombination\n\t\t\t\t\tkeyCombination={ keyCombination }\n\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t/>\n\t\t\t\t{ aliases.map( ( alias, index ) => (\n\t\t\t\t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,GAHLQ,KAIF,CAAC;IAER,CAAE;EAAC,CACC,CAAC;AAER;AAEA,SAASC,QAAQA,CAAE;EAAEC,WAAW;EAAEd,cAAc;EAAEe,OAAO,GAAG,EAAE;EAAEV;AAAU,CAAC,EAAG;EAC7E,oBACCR,KAAA,CAAAC,SAAA;IAAAY,QAAA,gBACCf,IAAA;MAAKc,SAAS,EAAC,iEAAiE;MAAAC,QAAA,EAC7EI;IAAW,CACT,CAAC,eACNjB,KAAA;MAAKY,SAAS,EAAC,0DAA0D;MAAAC,QAAA,gBACxEf,IAAA,CAACI,cAAc;QACdC,cAAc,EAAGA,cAAgB;QACjCC,cAAc,EAAGI;MAAW,CAC5B,CAAC,EACAU,OAAO,CAACJ,GAAG,CAAE,CAAEK,KAAK,EAAEJ,KAAK,kBAC5BjB,IAAA,CAACI,cAAc;QACdC,cAAc,EAAGgB,KAAO;QACxBf,cAAc,EAAGI;MAAW,GACtBO,KACN,CACA,CAAC;IAAA,CACC,CAAC;EAAA,CACL,CAAC;AAEL;AAEA,eAAeC,QAAQ","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -16,6 +15,8 @@ import Sidebar from '../sidebar';
16
15
  import Interface from './interface';
17
16
  import UnsavedChangesWarning from './unsaved-changes-warning';
18
17
  import WelcomeGuide from '../welcome-guide';
18
+ import { jsx as _jsx } from "react/jsx-runtime";
19
+ import { jsxs as _jsxs } from "react/jsx-runtime";
19
20
  function Layout({
20
21
  blockEditorSettings
21
22
  }) {
@@ -26,13 +27,16 @@ function Layout({
26
27
  createErrorNotice(sprintf( /* translators: %s: plugin name */
27
28
  __('The "%s" plugin has encountered an error and cannot be rendered.'), name));
28
29
  }
29
- return createElement(ErrorBoundary, null, createElement(WidgetAreasBlockEditorProvider, {
30
- blockEditorSettings: blockEditorSettings
31
- }, createElement(Interface, {
32
- blockEditorSettings: blockEditorSettings
33
- }), createElement(Sidebar, null), createElement(PluginArea, {
34
- onError: onPluginAreaError
35
- }), createElement(UnsavedChangesWarning, null), createElement(WelcomeGuide, null)));
30
+ return /*#__PURE__*/_jsx(ErrorBoundary, {
31
+ children: /*#__PURE__*/_jsxs(WidgetAreasBlockEditorProvider, {
32
+ blockEditorSettings: blockEditorSettings,
33
+ children: [/*#__PURE__*/_jsx(Interface, {
34
+ blockEditorSettings: blockEditorSettings
35
+ }), /*#__PURE__*/_jsx(Sidebar, {}), /*#__PURE__*/_jsx(PluginArea, {
36
+ onError: onPluginAreaError
37
+ }), /*#__PURE__*/_jsx(UnsavedChangesWarning, {}), /*#__PURE__*/_jsx(WelcomeGuide, {})]
38
+ })
39
+ });
36
40
  }
37
41
  export default Layout;
38
42
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","useDispatch","PluginArea","store","noticesStore","ErrorBoundary","WidgetAreasBlockEditorProvider","Sidebar","Interface","UnsavedChangesWarning","WelcomeGuide","Layout","blockEditorSettings","createErrorNotice","onPluginAreaError","name","createElement","onError"],"sources":["@wordpress/edit-widgets/src/components/layout/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\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 } ) {\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>\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<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"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;;AAE1D;AACA;AACA;AACA,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,8BAA8B,MAAM,uCAAuC;AAClF,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,SAAS,MAAM,aAAa;AACnC,OAAOC,qBAAqB,MAAM,2BAA2B;AAC7D,OAAOC,YAAY,MAAM,kBAAkB;AAE3C,SAASC,MAAMA,CAAE;EAAEC;AAAoB,CAAC,EAAG;EAC1C,MAAM;IAAEC;EAAkB,CAAC,GAAGZ,WAAW,CAAEG,YAAa,CAAC;EAEzD,SAASU,iBAAiBA,CAAEC,IAAI,EAAG;IAClCF,iBAAiB,CAChBb,OAAO,EACN;IACAD,EAAE,CACD,kEACD,CAAC,EACDgB,IACD,CACD,CAAC;EACF;EAEA,OACCC,aAAA,CAACX,aAAa,QACbW,aAAA,CAACV,8BAA8B;IAC9BM,mBAAmB,EAAGA;EAAqB,GAE3CI,aAAA,CAACR,SAAS;IAACI,mBAAmB,EAAGA;EAAqB,CAAE,CAAC,EACzDI,aAAA,CAACT,OAAO,MAAE,CAAC,EACXS,aAAA,CAACd,UAAU;IAACe,OAAO,EAAGH;EAAmB,CAAE,CAAC,EAC5CE,aAAA,CAACP,qBAAqB,MAAE,CAAC,EACzBO,aAAA,CAACN,YAAY,MAAE,CACgB,CAClB,CAAC;AAElB;AAEA,eAAeC,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["__","sprintf","useDispatch","PluginArea","store","noticesStore","ErrorBoundary","WidgetAreasBlockEditorProvider","Sidebar","Interface","UnsavedChangesWarning","WelcomeGuide","jsx","_jsx","jsxs","_jsxs","Layout","blockEditorSettings","createErrorNotice","onPluginAreaError","name","children","onError"],"sources":["@wordpress/edit-widgets/src/components/layout/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\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 } ) {\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>\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<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t<Unsav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AC;AAElB;AAEA,eAAeK,MAAM","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- import { createElement, Fragment } from "react";
2
1
  /**
3
2
  * WordPress dependencies
4
3
  */
@@ -18,6 +17,8 @@ import Header from '../header';
18
17
  import WidgetAreasBlockEditorContent from '../widget-areas-block-editor-content';
19
18
  import { store as editWidgetsStore } from '../../store';
20
19
  import SecondarySidebar from '../secondary-sidebar';
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ import { Fragment as _Fragment } from "react/jsx-runtime";
21
22
  const interfaceLabels = {
22
23
  /* translators: accessibility text for the widgets screen top bar landmark region. */
23
24
  header: __('Widgets top bar'),
@@ -68,24 +69,27 @@ function Interface({
68
69
  }, [isInserterOpened, isListViewOpened, isHugeViewport]);
69
70
  const secondarySidebarLabel = isListViewOpened ? __('List View') : __('Block Library');
70
71
  const hasSecondarySidebar = isListViewOpened || isInserterOpened;
71
- return createElement(InterfaceSkeleton, {
72
+ return /*#__PURE__*/_jsx(InterfaceSkeleton, {
72
73
  labels: {
73
74
  ...interfaceLabels,
74
75
  secondarySidebar: secondarySidebarLabel
75
76
  },
76
- header: createElement(Header, null),
77
- secondarySidebar: hasSecondarySidebar && createElement(SecondarySidebar, null),
78
- sidebar: createElement(ComplementaryArea.Slot, {
77
+ header: /*#__PURE__*/_jsx(Header, {}),
78
+ secondarySidebar: hasSecondarySidebar && /*#__PURE__*/_jsx(SecondarySidebar, {}),
79
+ sidebar: /*#__PURE__*/_jsx(ComplementaryArea.Slot, {
79
80
  scope: "core/edit-widgets"
80
81
  }),
81
- content: createElement(Fragment, null, createElement(WidgetAreasBlockEditorContent, {
82
- blockEditorSettings: blockEditorSettings
83
- })),
84
- footer: hasBlockBreadCrumbsEnabled && !isMobileViewport && createElement("div", {
85
- className: "edit-widgets-layout__footer"
86
- }, createElement(BlockBreadcrumb, {
87
- rootLabelText: __('Widgets')
88
- })),
82
+ content: /*#__PURE__*/_jsx(_Fragment, {
83
+ children: /*#__PURE__*/_jsx(WidgetAreasBlockEditorContent, {
84
+ blockEditorSettings: blockEditorSettings
85
+ })
86
+ }),
87
+ footer: hasBlockBreadCrumbsEnabled && !isMobileViewport && /*#__PURE__*/_jsx("div", {
88
+ className: "edit-widgets-layout__footer",
89
+ children: /*#__PURE__*/_jsx(BlockBreadcrumb, {
90
+ rootLabelText: __('Widgets')
91
+ })
92
+ }),
89
93
  shortcuts: {
90
94
  previous: previousShortcut,
91
95
  next: nextShortcut
@@ -1 +1 @@
1
- {"version":3,"names":["useViewportMatch","BlockBreadcrumb","useEffect","useDispatch","useSelect","InterfaceSkeleton","ComplementaryArea","store","interfaceStore","__","keyboardShortcutsStore","preferencesStore","Header","WidgetAreasBlockEditorContent","editWidgetsStore","SecondarySidebar","interfaceLabels","header","body","sidebar","footer","Interface","blockEditorSettings","isMobileViewport","isHugeViewport","setIsInserterOpened","setIsListViewOpened","closeGeneralSidebar","hasBlockBreadCrumbsEnabled","hasSidebarEnabled","isInserterOpened","isListViewOpened","previousShortcut","nextShortcut","select","getActiveComplementaryArea","name","get","getAllShortcutKeyCombinations","secondarySidebarLabel","hasSecondarySidebar","createElement","labels","secondarySidebar","Slot","scope","content","Fragment","className","rootLabelText","shortcuts","previous","next"],"sources":["@wordpress/edit-widgets/src/components/layout/interface.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { BlockBreadcrumb } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { __ } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport Header from '../header';\nimport WidgetAreasBlockEditorContent from '../widget-areas-block-editor-content';\nimport { store as editWidgetsStore } from '../../store';\nimport SecondarySidebar from '../secondary-sidebar';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the widgets screen top bar landmark region. */\n\theader: __( 'Widgets top bar' ),\n\t/* translators: accessibility text for the widgets screen content landmark region. */\n\tbody: __( 'Widgets and blocks' ),\n\t/* translators: accessibility text for the widgets screen settings landmark region. */\n\tsidebar: __( 'Widgets settings' ),\n\t/* translators: accessibility text for the widgets screen footer landmark region. */\n\tfooter: __( 'Widgets footer' ),\n};\n\nfunction Interface( { blockEditorSettings } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } =\n\t\tuseDispatch( editWidgetsStore );\n\tconst {\n\t\thasBlockBreadCrumbsEnabled,\n\t\thasSidebarEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasSidebarEnabled: !! select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( editWidgetsStore.name ),\n\t\t\tisInserterOpened: !! select( editWidgetsStore ).isInserterOpened(),\n\t\t\tisListViewOpened: !! select( editWidgetsStore ).isListViewOpened(),\n\t\t\thasBlockBreadCrumbsEnabled: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations(\n\t\t\t\t'core/edit-widgets/previous-region'\n\t\t\t),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-widgets/next-region' ),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( hasSidebarEnabled && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}, [ hasSidebarEnabled, isHugeViewport ] );\n\n\tuseEffect( () => {\n\t\tif ( ( isInserterOpened || isListViewOpened ) && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isListViewOpened, isHugeViewport ] );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\n\tconst hasSecondarySidebar = isListViewOpened || isInserterOpened;\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={ <Header /> }\n\t\t\tsecondarySidebar={ hasSecondarySidebar && <SecondarySidebar /> }\n\t\t\tsidebar={ <ComplementaryArea.Slot scope=\"core/edit-widgets\" /> }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<WidgetAreasBlockEditorContent\n\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\thasBlockBreadCrumbsEnabled &&\n\t\t\t\t! isMobileViewport && (\n\t\t\t\t\t<div className=\"edit-widgets-layout__footer\">\n\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ __( 'Widgets' ) } />\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t\tshortcuts={ {\n\t\t\t\tprevious: previousShortcut,\n\t\t\t\tnext: nextShortcut,\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default Interface;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,eAAe,QAAQ,yBAAyB;AACzD,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;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G;IAChEI,OAAO,EAAGsB,aAAA,CAACnC,iBAAiB,CAACsC,IAAI;MAACC,KAAK,EAAC;IAAmB,CAAE,CAAG;IAChEC,OAAO,EACNL,aAAA,CAAAM,QAAA,QACCN,aAAA,CAAC5B,6BAA6B;MAC7BS,mBAAmB,EAAGA;IAAqB,CAC3C,CACA,CACF;IACDF,MAAM,EACLQ,0BAA0B,IAC1B,CAAEL,gBAAgB,IACjBkB,aAAA;MAAKO,SAAS,EAAC;IAA6B,GAC3CP,aAAA,CAACxC,eAAe;MAACgD,aAAa,EAAGxC,EAAE,CAAE,SAAU;IAAG,CAAE,CAChD,CAEN;IACDyC,SAAS,EAAG;MACXC,QAAQ,EAAEnB,gBAAgB;MAC1BoB,IAAI,EAAEnB;IACP;EAAG,CACH,CAAC;AAEJ;AAEA,eAAeZ,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["useViewportMatch","BlockBreadcrumb","useEffect","useDispatch","useSelect","InterfaceSkeleton","ComplementaryArea","store","interfaceStore","__","keyboardShortcutsStore","preferencesStore","Header","WidgetAreasBlockEditorContent","editWidgetsStore","SecondarySidebar","jsx","_jsx","Fragment","_Fragment","interfaceLabels","header","body","sidebar","footer","Interface","blockEditorSettings","isMobileViewport","isHugeViewport","setIsInserterOpened","setIsListViewOpened","closeGeneralSidebar","hasBlockBreadCrumbsEnabled","hasSidebarEnabled","isInserterOpened","isListViewOpened","previousShortcut","nextShortcut","select","getActiveComplementaryArea","name","get","getAllShortcutKeyCombinations","secondarySidebarLabel","hasSecondarySidebar","labels","secondarySidebar","Slot","scope","content","children","className","rootLabelText","shortcuts","previous","next"],"sources":["@wordpress/edit-widgets/src/components/layout/interface.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { BlockBreadcrumb } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tInterfaceSkeleton,\n\tComplementaryArea,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { __ } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport Header from '../header';\nimport WidgetAreasBlockEditorContent from '../widget-areas-block-editor-content';\nimport { store as editWidgetsStore } from '../../store';\nimport SecondarySidebar from '../secondary-sidebar';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the widgets screen top bar landmark region. */\n\theader: __( 'Widgets top bar' ),\n\t/* translators: accessibility text for the widgets screen content landmark region. */\n\tbody: __( 'Widgets and blocks' ),\n\t/* translators: accessibility text for the widgets screen settings landmark region. */\n\tsidebar: __( 'Widgets settings' ),\n\t/* translators: accessibility text for the widgets screen footer landmark region. */\n\tfooter: __( 'Widgets footer' ),\n};\n\nfunction Interface( { blockEditorSettings } ) {\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst isHugeViewport = useViewportMatch( 'huge', '>=' );\n\tconst { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } =\n\t\tuseDispatch( editWidgetsStore );\n\tconst {\n\t\thasBlockBreadCrumbsEnabled,\n\t\thasSidebarEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t} = useSelect(\n\t\t( select ) => ( {\n\t\t\thasSidebarEnabled: !! select(\n\t\t\t\tinterfaceStore\n\t\t\t).getActiveComplementaryArea( editWidgetsStore.name ),\n\t\t\tisInserterOpened: !! select( editWidgetsStore ).isInserterOpened(),\n\t\t\tisListViewOpened: !! select( editWidgetsStore ).isListViewOpened(),\n\t\t\thasBlockBreadCrumbsEnabled: !! select( preferencesStore ).get(\n\t\t\t\t'core/edit-widgets',\n\t\t\t\t'showBlockBreadcrumbs'\n\t\t\t),\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations(\n\t\t\t\t'core/edit-widgets/previous-region'\n\t\t\t),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/edit-widgets/next-region' ),\n\t\t} ),\n\t\t[]\n\t);\n\n\t// Inserter and Sidebars are mutually exclusive\n\tuseEffect( () => {\n\t\tif ( hasSidebarEnabled && ! isHugeViewport ) {\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t}\n\t}, [ hasSidebarEnabled, isHugeViewport ] );\n\n\tuseEffect( () => {\n\t\tif ( ( isInserterOpened || isListViewOpened ) && ! isHugeViewport ) {\n\t\t\tcloseGeneralSidebar();\n\t\t}\n\t}, [ isInserterOpened, isListViewOpened, isHugeViewport ] );\n\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'List View' )\n\t\t: __( 'Block Library' );\n\n\tconst hasSecondarySidebar = isListViewOpened || isInserterOpened;\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={ <Header /> }\n\t\t\tsecondarySidebar={ hasSecondarySidebar && <SecondarySidebar /> }\n\t\t\tsidebar={ <ComplementaryArea.Slot scope=\"core/edit-widgets\" /> }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<WidgetAreasBlockEditorContent\n\t\t\t\t\t\tblockEditorSettings={ blockEditorSettings }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\thasBlockBreadCrumbsEnabled &&\n\t\t\t\t! isMobileViewport && (\n\t\t\t\t\t<div className=\"edit-widgets-layout__footer\">\n\t\t\t\t\t\t<BlockBreadcrumb rootLabelText={ __( 'Widgets' ) } />\n\t\t\t\t\t</div>\n\t\t\t\t)\n\t\t\t}\n\t\t\tshortcuts={ {\n\t\t\t\tprevious: previousShortcut,\n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