@wordpress/block-editor 14.3.4 → 14.3.6

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 (157) hide show
  1. package/README.md +4 -0
  2. package/build/components/block-list/block.js +0 -3
  3. package/build/components/block-list/block.js.map +1 -1
  4. package/build/components/block-list/use-block-props/index.js +1 -4
  5. package/build/components/block-list/use-block-props/index.js.map +1 -1
  6. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js +9 -12
  7. package/build/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +1 -1
  8. package/build/components/block-variation-picker/index.js +2 -4
  9. package/build/components/block-variation-picker/index.js.map +1 -1
  10. package/build/components/block-variation-transforms/index.js +3 -4
  11. package/build/components/block-variation-transforms/index.js.map +1 -1
  12. package/build/components/button-block-appender/index.js +2 -4
  13. package/build/components/button-block-appender/index.js.map +1 -1
  14. package/build/components/colors-gradients/dropdown.js +2 -4
  15. package/build/components/colors-gradients/dropdown.js.map +1 -1
  16. package/build/components/global-styles/color-panel.js +2 -4
  17. package/build/components/global-styles/color-panel.js.map +1 -1
  18. package/build/components/global-styles/filters-panel.js +2 -4
  19. package/build/components/global-styles/filters-panel.js.map +1 -1
  20. package/build/components/global-styles/shadow-panel-components.js +24 -29
  21. package/build/components/global-styles/shadow-panel-components.js.map +1 -1
  22. package/build/components/iframe/index.js +6 -1
  23. package/build/components/iframe/index.js.map +1 -1
  24. package/build/components/inserter/menu.js +3 -0
  25. package/build/components/inserter/menu.js.map +1 -1
  26. package/build/components/inspector-controls-tabs/index.js +11 -8
  27. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  28. package/build/components/inspector-popover-header/index.js +4 -8
  29. package/build/components/inspector-popover-header/index.js.map +1 -1
  30. package/build/components/link-control/index.js +4 -8
  31. package/build/components/link-control/index.js.map +1 -1
  32. package/build/components/link-control/settings-drawer.js +2 -4
  33. package/build/components/link-control/settings-drawer.js.map +1 -1
  34. package/build/components/list-view/block-select-button.js +1 -4
  35. package/build/components/list-view/block-select-button.js.map +1 -1
  36. package/build/components/media-placeholder/index.js +12 -24
  37. package/build/components/media-placeholder/index.js.map +1 -1
  38. package/build/components/skip-to-selected-block/index.js +2 -4
  39. package/build/components/skip-to-selected-block/index.js.map +1 -1
  40. package/build/components/tool-selector/index.js +7 -5
  41. package/build/components/tool-selector/index.js.map +1 -1
  42. package/build/components/url-input/button.js +14 -16
  43. package/build/components/url-input/button.js.map +1 -1
  44. package/build/components/url-input/index.js +2 -4
  45. package/build/components/url-input/index.js.map +1 -1
  46. package/build/components/use-resize-canvas/index.js +1 -2
  47. package/build/components/use-resize-canvas/index.js.map +1 -1
  48. package/build/hooks/grid-visualizer.js +13 -11
  49. package/build/hooks/grid-visualizer.js.map +1 -1
  50. package/build/hooks/layout-child.js +41 -3
  51. package/build/hooks/layout-child.js.map +1 -1
  52. package/build/layouts/flex.js +6 -38
  53. package/build/layouts/flex.js.map +1 -1
  54. package/build/private-apis.js +2 -0
  55. package/build/private-apis.js.map +1 -1
  56. package/build/utils/block-bindings.js +9 -6
  57. package/build/utils/block-bindings.js.map +1 -1
  58. package/build-module/components/block-list/block.js +0 -3
  59. package/build-module/components/block-list/block.js.map +1 -1
  60. package/build-module/components/block-list/use-block-props/index.js +1 -4
  61. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  62. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js +9 -12
  63. package/build-module/components/block-list/use-block-props/use-zoom-out-mode-exit.js.map +1 -1
  64. package/build-module/components/block-variation-picker/index.js +2 -4
  65. package/build-module/components/block-variation-picker/index.js.map +1 -1
  66. package/build-module/components/block-variation-transforms/index.js +3 -4
  67. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  68. package/build-module/components/button-block-appender/index.js +2 -4
  69. package/build-module/components/button-block-appender/index.js.map +1 -1
  70. package/build-module/components/colors-gradients/dropdown.js +2 -4
  71. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  72. package/build-module/components/global-styles/color-panel.js +2 -4
  73. package/build-module/components/global-styles/color-panel.js.map +1 -1
  74. package/build-module/components/global-styles/filters-panel.js +2 -4
  75. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  76. package/build-module/components/global-styles/shadow-panel-components.js +25 -30
  77. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  78. package/build-module/components/iframe/index.js +6 -1
  79. package/build-module/components/iframe/index.js.map +1 -1
  80. package/build-module/components/inserter/menu.js +3 -0
  81. package/build-module/components/inserter/menu.js.map +1 -1
  82. package/build-module/components/inspector-controls-tabs/index.js +12 -9
  83. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  84. package/build-module/components/inspector-popover-header/index.js +4 -8
  85. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  86. package/build-module/components/link-control/index.js +4 -8
  87. package/build-module/components/link-control/index.js.map +1 -1
  88. package/build-module/components/link-control/settings-drawer.js +2 -4
  89. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  90. package/build-module/components/list-view/block-select-button.js +2 -5
  91. package/build-module/components/list-view/block-select-button.js.map +1 -1
  92. package/build-module/components/media-placeholder/index.js +12 -24
  93. package/build-module/components/media-placeholder/index.js.map +1 -1
  94. package/build-module/components/skip-to-selected-block/index.js +2 -4
  95. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  96. package/build-module/components/tool-selector/index.js +7 -5
  97. package/build-module/components/tool-selector/index.js.map +1 -1
  98. package/build-module/components/url-input/button.js +15 -17
  99. package/build-module/components/url-input/button.js.map +1 -1
  100. package/build-module/components/url-input/index.js +2 -4
  101. package/build-module/components/url-input/index.js.map +1 -1
  102. package/build-module/components/use-resize-canvas/index.js +1 -2
  103. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  104. package/build-module/hooks/grid-visualizer.js +13 -11
  105. package/build-module/hooks/grid-visualizer.js.map +1 -1
  106. package/build-module/hooks/layout-child.js +41 -3
  107. package/build-module/hooks/layout-child.js.map +1 -1
  108. package/build-module/layouts/flex.js +7 -39
  109. package/build-module/layouts/flex.js.map +1 -1
  110. package/build-module/private-apis.js +2 -0
  111. package/build-module/private-apis.js.map +1 -1
  112. package/build-module/utils/block-bindings.js +9 -6
  113. package/build-module/utils/block-bindings.js.map +1 -1
  114. package/build-style/content-rtl.css +6 -10
  115. package/build-style/content.css +6 -10
  116. package/build-style/style-rtl.css +27 -26
  117. package/build-style/style.css +27 -26
  118. package/package.json +5 -5
  119. package/src/components/block-inspector/style.scss +2 -0
  120. package/src/components/block-list/block.js +0 -3
  121. package/src/components/block-list/use-block-props/index.js +1 -2
  122. package/src/components/block-list/use-block-props/use-zoom-out-mode-exit.js +19 -11
  123. package/src/components/block-tools/style.scss +5 -0
  124. package/src/components/block-variation-picker/index.js +1 -2
  125. package/src/components/block-variation-transforms/index.js +2 -2
  126. package/src/components/button-block-appender/content.scss +0 -5
  127. package/src/components/button-block-appender/index.js +1 -2
  128. package/src/components/colors-gradients/dropdown.js +1 -5
  129. package/src/components/global-styles/color-panel.js +1 -5
  130. package/src/components/global-styles/filters-panel.js +1 -2
  131. package/src/components/global-styles/shadow-panel-components.js +28 -33
  132. package/src/components/global-styles/style.scss +5 -0
  133. package/src/components/iframe/content.scss +7 -8
  134. package/src/components/iframe/index.js +7 -1
  135. package/src/components/iframe/style.scss +17 -0
  136. package/src/components/inserter/menu.js +5 -0
  137. package/src/components/inspector-controls-tabs/index.js +21 -20
  138. package/src/components/inspector-popover-header/index.js +2 -4
  139. package/src/components/inspector-popover-header/style.scss +0 -13
  140. package/src/components/link-control/index.js +2 -4
  141. package/src/components/link-control/settings-drawer.js +1 -2
  142. package/src/components/list-view/block-select-button.js +2 -5
  143. package/src/components/list-view/style.scss +18 -0
  144. package/src/components/media-placeholder/index.js +6 -12
  145. package/src/components/skip-to-selected-block/index.js +1 -2
  146. package/src/components/skip-to-selected-block/style.scss +0 -9
  147. package/src/components/tool-selector/index.js +6 -4
  148. package/src/components/url-input/button.js +16 -12
  149. package/src/components/url-input/index.js +1 -2
  150. package/src/components/url-input/style.scss +0 -6
  151. package/src/components/use-resize-canvas/index.js +1 -3
  152. package/src/hooks/grid-visualizer.js +23 -9
  153. package/src/hooks/layout-child.js +48 -3
  154. package/src/layouts/flex.js +10 -53
  155. package/src/private-apis.js +2 -0
  156. package/src/utils/block-bindings.js +9 -6
  157. package/src/utils/test/use-block-bindings-utils.js +174 -0
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { __experimentalVStack as VStack, __experimentalHeading as Heading, __experimentalHStack as HStack, __experimentalDropdownContentWrapper as DropdownContentWrapper, Button, FlexItem, Dropdown, Composite } from '@wordpress/components';
5
+ import { __experimentalVStack as VStack, __experimentalHeading as Heading, __experimentalHStack as HStack, __experimentalDropdownContentWrapper as DropdownContentWrapper, Button, FlexItem, Dropdown, Composite, Tooltip } from '@wordpress/components';
6
6
  import { useMemo } from '@wordpress/element';
7
7
  import { shadow as shadowIcon, Icon, check } from '@wordpress/icons';
8
8
 
@@ -39,10 +39,8 @@ export function ShadowPopoverContainer({
39
39
  onSelect: onShadowChange
40
40
  }), /*#__PURE__*/_jsx("div", {
41
41
  className: "block-editor-global-styles__clear-shadow",
42
- children: /*#__PURE__*/_jsx(Button
43
- // TODO: Switch to `true` (40px size) if possible
44
- , {
45
- __next40pxDefaultSize: false,
42
+ children: /*#__PURE__*/_jsx(Button, {
43
+ __next40pxDefaultSize: true,
46
44
  variant: "tertiary",
47
45
  onClick: () => onShadowChange(undefined),
48
46
  children: __('Clear')
@@ -80,28 +78,27 @@ export function ShadowIndicator({
80
78
  onSelect,
81
79
  shadow
82
80
  }) {
83
- return /*#__PURE__*/_jsx(Composite.Item, {
84
- role: "option",
85
- "aria-label": label,
86
- "aria-selected": isActive,
87
- className: clsx('block-editor-global-styles__shadow__item', {
88
- 'is-active': isActive
89
- }),
90
- render: /*#__PURE__*/_jsx(Button
91
- // TODO: Switch to `true` (40px size) if possible
92
- , {
93
- __next40pxDefaultSize: false,
94
- className: clsx('block-editor-global-styles__shadow-indicator', {
95
- unset: type === 'unset'
81
+ return /*#__PURE__*/_jsx(Tooltip, {
82
+ text: label,
83
+ children: /*#__PURE__*/_jsx(Composite.Item, {
84
+ role: "option",
85
+ "aria-label": label,
86
+ "aria-selected": isActive,
87
+ className: clsx('block-editor-global-styles__shadow__item', {
88
+ 'is-active': isActive
96
89
  }),
97
- onClick: onSelect,
98
- label: label,
99
- style: {
100
- boxShadow: shadow
101
- },
102
- showTooltip: true,
103
- children: isActive && /*#__PURE__*/_jsx(Icon, {
104
- icon: check
90
+ render: /*#__PURE__*/_jsx("button", {
91
+ className: clsx('block-editor-global-styles__shadow-indicator', {
92
+ unset: type === 'unset'
93
+ }),
94
+ onClick: onSelect,
95
+ style: {
96
+ boxShadow: shadow
97
+ },
98
+ "aria-label": label,
99
+ children: isActive && /*#__PURE__*/_jsx(Icon, {
100
+ icon: check
101
+ })
105
102
  })
106
103
  })
107
104
  });
@@ -142,10 +139,8 @@ function renderShadowToggle() {
142
139
  }),
143
140
  'aria-expanded': isOpen
144
141
  };
145
- return /*#__PURE__*/_jsx(Button
146
- // TODO: Switch to `true` (40px size) if possible
147
- , {
148
- __next40pxDefaultSize: false,
142
+ return /*#__PURE__*/_jsx(Button, {
143
+ __next40pxDefaultSize: true,
149
144
  ...toggleProps,
150
145
  children: /*#__PURE__*/_jsxs(HStack, {
151
146
  justify: "flex-start",
@@ -1 +1 @@
1
- {"version":3,"names":["__","__experimentalVStack","VStack","__experimentalHeading","Heading","__experimentalHStack","HStack","__experimentalDropdownContentWrapper","DropdownContentWrapper","Button","FlexItem","Dropdown","Composite","useMemo","shadow","shadowIcon","Icon","check","clsx","jsx","_jsx","jsxs","_jsxs","EMPTY_ARRAY","ShadowPopoverContainer","onShadowChange","settings","shadows","useShadowPresets","className","children","spacing","level","ShadowPresets","presets","activeShadow","onSelect","__next40pxDefaultSize","variant","onClick","undefined","role","map","name","slug","ShadowIndicator","label","isActive","type","Item","render","unset","style","boxShadow","showTooltip","icon","ShadowPopover","popoverProps","placement","offset","shift","renderToggle","renderShadowToggle","renderContent","paddingSize","onToggle","isOpen","toggleProps","justify","size","_settings$shadow$pres","defaultPresetsEnabled","defaultPresets","default","defaultShadows","theme","themeShadows","custom","customShadows","unsetShadow","shadowPresets","length","unshift"],"sources":["@wordpress/block-editor/src/components/global-styles/shadow-panel-components.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalHeading as Heading,\n\t__experimentalHStack as HStack,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\tButton,\n\tFlexItem,\n\tDropdown,\n\tComposite,\n} from '@wordpress/components';\nimport { useMemo } from '@wordpress/element';\nimport { shadow as shadowIcon, Icon, check } from '@wordpress/icons';\n\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation.\n *\n * @type {Array}\n */\nconst EMPTY_ARRAY = [];\n\nexport function ShadowPopoverContainer( { shadow, onShadowChange, settings } ) {\n\tconst shadows = useShadowPresets( settings );\n\n\treturn (\n\t\t<div className=\"block-editor-global-styles__shadow-popover-container\">\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t<Heading level={ 5 }>{ __( 'Drop shadow' ) }</Heading>\n\t\t\t\t<ShadowPresets\n\t\t\t\t\tpresets={ shadows }\n\t\t\t\t\tactiveShadow={ shadow }\n\t\t\t\t\tonSelect={ onShadowChange }\n\t\t\t\t/>\n\t\t\t\t<div className=\"block-editor-global-styles__clear-shadow\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => onShadowChange( undefined ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Clear' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t</VStack>\n\t\t</div>\n\t);\n}\n\nexport function ShadowPresets( { presets, activeShadow, onSelect } ) {\n\treturn ! presets ? null : (\n\t\t<Composite\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-editor-global-styles__shadow__list\"\n\t\t\taria-label={ __( 'Drop shadows' ) }\n\t\t>\n\t\t\t{ presets.map( ( { name, slug, shadow } ) => (\n\t\t\t\t<ShadowIndicator\n\t\t\t\t\tkey={ slug }\n\t\t\t\t\tlabel={ name }\n\t\t\t\t\tisActive={ shadow === activeShadow }\n\t\t\t\t\ttype={ slug === 'unset' ? 'unset' : 'preset' }\n\t\t\t\t\tonSelect={ () =>\n\t\t\t\t\t\tonSelect( shadow === activeShadow ? undefined : shadow )\n\t\t\t\t\t}\n\t\t\t\t\tshadow={ shadow }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</Composite>\n\t);\n}\n\nexport function ShadowIndicator( { type, label, isActive, onSelect, shadow } ) {\n\treturn (\n\t\t<Composite.Item\n\t\t\trole=\"option\"\n\t\t\taria-label={ label }\n\t\t\taria-selected={ isActive }\n\t\t\tclassName={ clsx( 'block-editor-global-styles__shadow__item', {\n\t\t\t\t'is-active': isActive,\n\t\t\t} ) }\n\t\t\trender={\n\t\t\t\t<Button\n\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'block-editor-global-styles__shadow-indicator',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset: type === 'unset',\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tonClick={ onSelect }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tstyle={ { boxShadow: shadow } }\n\t\t\t\t\tshowTooltip\n\t\t\t\t>\n\t\t\t\t\t{ isActive && <Icon icon={ check } /> }\n\t\t\t\t</Button>\n\t\t\t}\n\t\t/>\n\t);\n}\n\nexport function ShadowPopover( { shadow, onShadowChange, settings } ) {\n\tconst popoverProps = {\n\t\tplacement: 'left-start',\n\t\toffset: 36,\n\t\tshift: true,\n\t};\n\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ popoverProps }\n\t\t\tclassName=\"block-editor-global-styles__shadow-dropdown\"\n\t\t\trenderToggle={ renderShadowToggle() }\n\t\t\trenderContent={ () => (\n\t\t\t\t<DropdownContentWrapper paddingSize=\"medium\">\n\t\t\t\t\t<ShadowPopoverContainer\n\t\t\t\t\t\tshadow={ shadow }\n\t\t\t\t\t\tonShadowChange={ onShadowChange }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t/>\n\t\t\t\t</DropdownContentWrapper>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nfunction renderShadowToggle() {\n\treturn ( { onToggle, isOpen } ) => {\n\t\tconst toggleProps = {\n\t\t\tonClick: onToggle,\n\t\t\tclassName: clsx( { 'is-open': isOpen } ),\n\t\t\t'aria-expanded': isOpen,\n\t\t};\n\n\t\treturn (\n\t\t\t<Button\n\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t{ ...toggleProps }\n\t\t\t>\n\t\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tclassName=\"block-editor-global-styles__toggle-icon\"\n\t\t\t\t\t\ticon={ shadowIcon }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t\t<FlexItem>{ __( 'Drop shadow' ) }</FlexItem>\n\t\t\t\t</HStack>\n\t\t\t</Button>\n\t\t);\n\t};\n}\n\nexport function useShadowPresets( settings ) {\n\treturn useMemo( () => {\n\t\tif ( ! settings?.shadow ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\n\t\tconst defaultPresetsEnabled = settings?.shadow?.defaultPresets;\n\t\tconst {\n\t\t\tdefault: defaultShadows,\n\t\t\ttheme: themeShadows,\n\t\t\tcustom: customShadows,\n\t\t} = settings?.shadow?.presets ?? {};\n\t\tconst unsetShadow = {\n\t\t\tname: __( 'Unset' ),\n\t\t\tslug: 'unset',\n\t\t\tshadow: 'none',\n\t\t};\n\n\t\tconst shadowPresets = [\n\t\t\t...( ( defaultPresetsEnabled && defaultShadows ) || EMPTY_ARRAY ),\n\t\t\t...( themeShadows || EMPTY_ARRAY ),\n\t\t\t...( customShadows || EMPTY_ARRAY ),\n\t\t];\n\t\tif ( shadowPresets.length ) {\n\t\t\tshadowPresets.unshift( unsetShadow );\n\t\t}\n\n\t\treturn shadowPresets;\n\t}, [ settings ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,qBAAqB,IAAIC,OAAO,EAChCC,oBAAoB,IAAIC,MAAM,EAC9BC,oCAAoC,IAAIC,sBAAsB,EAC9DC,MAAM,EACNC,QAAQ,EACRC,QAAQ,EACRC,SAAS,QACH,uBAAuB;AAC9B,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,MAAM,IAAIC,UAAU,EAAEC,IAAI,EAAEC,KAAK,QAAQ,kBAAkB;;AAEpE;AACA;AACA;AACA,OAAOC,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA;AACA;AACA;AALA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAMA,MAAMC,WAAW,GAAG,EAAE;AAEtB,OAAO,SAASC,sBAAsBA,CAAE;EAAEV,MAAM;EAAEW,cAAc;EAAEC;AAAS,CAAC,EAAG;EAC9E,MAAMC,OAAO,GAAGC,gBAAgB,CAAEF,QAAS,CAAC;EAE5C,oBACCN,IAAA;IAAKS,SAAS,EAAC,sDAAsD;IAAAC,QAAA,eACpER,KAAA,CAACpB,MAAM;MAAC6B,OAAO,EAAG,CAAG;MAAAD,QAAA,gBACpBV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nB4C,IAAI,EAAE,OAAO;MACb9B,MAAM,EAAE;IACT,CAAC;IAED,MAAMkE,aAAa,GAAG,CACrB,IAAOT,qBAAqB,IAAIG,cAAc,IAAMnD,WAAW,CAAE,EACjE,IAAKqD,YAAY,IAAIrD,WAAW,CAAE,EAClC,IAAKuD,aAAa,IAAIvD,WAAW,CAAE,CACnC;IACD,IAAKyD,aAAa,CAACC,MAAM,EAAG;MAC3BD,aAAa,CAACE,OAAO,CAAEH,WAAY,CAAC;IACrC;IAEA,OAAOC,aAAa;EACrB,CAAC,EAAE,CAAEtD,QAAQ,CAAG,CAAC;AAClB","ignoreList":[]}
1
+ {"version":3,"names":["__","__experimentalVStack","VStack","__experimentalHeading","Heading","__experimentalHStack","HStack","__experimentalDropdownContentWrapper","DropdownContentWrapper","Button","FlexItem","Dropdown","Composite","Tooltip","useMemo","shadow","shadowIcon","Icon","check","clsx","jsx","_jsx","jsxs","_jsxs","EMPTY_ARRAY","ShadowPopoverContainer","onShadowChange","settings","shadows","useShadowPresets","className","children","spacing","level","ShadowPresets","presets","activeShadow","onSelect","__next40pxDefaultSize","variant","onClick","undefined","role","map","name","slug","ShadowIndicator","label","isActive","type","text","Item","render","unset","style","boxShadow","icon","ShadowPopover","popoverProps","placement","offset","shift","renderToggle","renderShadowToggle","renderContent","paddingSize","onToggle","isOpen","toggleProps","justify","size","_settings$shadow$pres","defaultPresetsEnabled","defaultPresets","default","defaultShadows","theme","themeShadows","custom","customShadows","unsetShadow","shadowPresets","length","unshift"],"sources":["@wordpress/block-editor/src/components/global-styles/shadow-panel-components.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalHeading as Heading,\n\t__experimentalHStack as HStack,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\tButton,\n\tFlexItem,\n\tDropdown,\n\tComposite,\n\tTooltip,\n} from '@wordpress/components';\nimport { useMemo } from '@wordpress/element';\nimport { shadow as shadowIcon, Icon, check } from '@wordpress/icons';\n\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Shared reference to an empty array for cases where it is important to avoid\n * returning a new array reference on every invocation.\n *\n * @type {Array}\n */\nconst EMPTY_ARRAY = [];\n\nexport function ShadowPopoverContainer( { shadow, onShadowChange, settings } ) {\n\tconst shadows = useShadowPresets( settings );\n\n\treturn (\n\t\t<div className=\"block-editor-global-styles__shadow-popover-container\">\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t<Heading level={ 5 }>{ __( 'Drop shadow' ) }</Heading>\n\t\t\t\t<ShadowPresets\n\t\t\t\t\tpresets={ shadows }\n\t\t\t\t\tactiveShadow={ shadow }\n\t\t\t\t\tonSelect={ onShadowChange }\n\t\t\t\t/>\n\t\t\t\t<div className=\"block-editor-global-styles__clear-shadow\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => onShadowChange( undefined ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Clear' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t</VStack>\n\t\t</div>\n\t);\n}\n\nexport function ShadowPresets( { presets, activeShadow, onSelect } ) {\n\treturn ! presets ? null : (\n\t\t<Composite\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-editor-global-styles__shadow__list\"\n\t\t\taria-label={ __( 'Drop shadows' ) }\n\t\t>\n\t\t\t{ presets.map( ( { name, slug, shadow } ) => (\n\t\t\t\t<ShadowIndicator\n\t\t\t\t\tkey={ slug }\n\t\t\t\t\tlabel={ name }\n\t\t\t\t\tisActive={ shadow === activeShadow }\n\t\t\t\t\ttype={ slug === 'unset' ? 'unset' : 'preset' }\n\t\t\t\t\tonSelect={ () =>\n\t\t\t\t\t\tonSelect( shadow === activeShadow ? undefined : shadow )\n\t\t\t\t\t}\n\t\t\t\t\tshadow={ shadow }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</Composite>\n\t);\n}\n\nexport function ShadowIndicator( { type, label, isActive, onSelect, shadow } ) {\n\treturn (\n\t\t<Tooltip text={ label }>\n\t\t\t<Composite.Item\n\t\t\t\trole=\"option\"\n\t\t\t\taria-label={ label }\n\t\t\t\taria-selected={ isActive }\n\t\t\t\tclassName={ clsx( 'block-editor-global-styles__shadow__item', {\n\t\t\t\t\t'is-active': isActive,\n\t\t\t\t} ) }\n\t\t\t\trender={\n\t\t\t\t\t<button\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'block-editor-global-styles__shadow-indicator',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tunset: type === 'unset',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonClick={ onSelect }\n\t\t\t\t\t\tstyle={ { boxShadow: shadow } }\n\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isActive && <Icon icon={ check } /> }\n\t\t\t\t\t</button>\n\t\t\t\t}\n\t\t\t/>\n\t\t</Tooltip>\n\t);\n}\n\nexport function ShadowPopover( { shadow, onShadowChange, settings } ) {\n\tconst popoverProps = {\n\t\tplacement: 'left-start',\n\t\toffset: 36,\n\t\tshift: true,\n\t};\n\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ popoverProps }\n\t\t\tclassName=\"block-editor-global-styles__shadow-dropdown\"\n\t\t\trenderToggle={ renderShadowToggle() }\n\t\t\trenderContent={ () => (\n\t\t\t\t<DropdownContentWrapper paddingSize=\"medium\">\n\t\t\t\t\t<ShadowPopoverContainer\n\t\t\t\t\t\tshadow={ shadow }\n\t\t\t\t\t\tonShadowChange={ onShadowChange }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t/>\n\t\t\t\t</DropdownContentWrapper>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nfunction renderShadowToggle() {\n\treturn ( { onToggle, isOpen } ) => {\n\t\tconst toggleProps = {\n\t\t\tonClick: onToggle,\n\t\t\tclassName: clsx( { 'is-open': isOpen } ),\n\t\t\t'aria-expanded': isOpen,\n\t\t};\n\n\t\treturn (\n\t\t\t<Button __next40pxDefaultSize { ...toggleProps }>\n\t\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tclassName=\"block-editor-global-styles__toggle-icon\"\n\t\t\t\t\t\ticon={ shadowIcon }\n\t\t\t\t\t\tsize={ 24 }\n\t\t\t\t\t/>\n\t\t\t\t\t<FlexItem>{ __( 'Drop shadow' ) }</FlexItem>\n\t\t\t\t</HStack>\n\t\t\t</Button>\n\t\t);\n\t};\n}\n\nexport function useShadowPresets( settings ) {\n\treturn useMemo( () => {\n\t\tif ( ! settings?.shadow ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\n\t\tconst defaultPresetsEnabled = settings?.shadow?.defaultPresets;\n\t\tconst {\n\t\t\tdefault: defaultShadows,\n\t\t\ttheme: themeShadows,\n\t\t\tcustom: customShadows,\n\t\t} = settings?.shadow?.presets ?? {};\n\t\tconst unsetShadow = {\n\t\t\tname: __( 'Unset' ),\n\t\t\tslug: 'unset',\n\t\t\tshadow: 'none',\n\t\t};\n\n\t\tconst shadowPresets = [\n\t\t\t...( ( defaultPresetsEnabled && defaultShadows ) || EMPTY_ARRAY ),\n\t\t\t...( themeShadows || EMPTY_ARRAY ),\n\t\t\t...( customShadows || EMPTY_ARRAY ),\n\t\t];\n\t\tif ( shadowPresets.length ) {\n\t\t\tshadowPresets.unshift( unsetShadow );\n\t\t}\n\n\t\treturn shadowPresets;\n\t}, [ settings ] );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,qBAAqB,IAAIC,OAAO,EAChCC,oBAAoB,IAAIC,MAAM,EAC9BC,oCAAoC,IAAIC,sBAAsB,EAC9DC,MAA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AAE,CAAE,aAAc;QAAC,CAAY,CAAC;MAAA,CACrC;IAAC,CACF,CAAC;EAEX,CAAC;AACF;AAEA,OAAO,SAAS6B,gBAAgBA,CAAEF,QAAQ,EAAG;EAC5C,OAAOb,OAAO,CAAE,MAAM;IAAA,IAAAyD,qBAAA;IACrB,IAAK,CAAE5C,QAAQ,EAAEZ,MAAM,EAAG;MACzB,OAAOS,WAAW;IACnB;IAEA,MAAMgD,qBAAqB,GAAG7C,QAAQ,EAAEZ,MAAM,EAAE0D,cAAc;IAC9D,MAAM;MACLC,OAAO,EAAEC,cAAc;MACvBC,KAAK,EAAEC,YAAY;MACnBC,MAAM,EAAEC;IACT,CAAC,IAAAR,qBAAA,GAAG5C,QAAQ,EAAEZ,MAAM,EAAEoB,OAAO,cAAAoC,qBAAA,cAAAA,qBAAA,GAAI,CAAC,CAAC;IACnC,MAAMS,WAAW,GAAG;MACnBpC,IAAI,EAAE5C,EAAE,CAAE,OAAQ,CAAC;MACnB6C,IAAI,EAAE,OAAO;MACb9B,MAAM,EAAE;IACT,CAAC;IAED,MAAMkE,aAAa,GAAG,CACrB,IAAOT,qBAAqB,IAAIG,cAAc,IAAMnD,WAAW,CAAE,EACjE,IAAKqD,YAAY,IAAIrD,WAAW,CAAE,EAClC,IAAKuD,aAAa,IAAIvD,WAAW,CAAE,CACnC;IACD,IAAKyD,aAAa,CAACC,MAAM,EAAG;MAC3BD,aAAa,CAACE,OAAO,CAAEH,WAAY,CAAC;IACrC;IAEA,OAAOC,aAAa;EACrB,CAAC,EAAE,CAAEtD,QAAQ,CAAG,CAAC;AAClB","ignoreList":[]}
@@ -257,7 +257,12 @@ function Iframe({
257
257
  }
258
258
  iframeDocument.documentElement.classList.add('is-zoomed-out');
259
259
  const maxWidth = 750;
260
- iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-scale', scale === 'default' ? Math.min(containerWidth, maxWidth) / prevContainerWidthRef.current : scale);
260
+ // This scaling calculation has to happen within the JS because CSS calc() can
261
+ // only divide and multiply by a unitless value. I.e. calc( 100px / 2 ) is valid
262
+ // but calc( 100px / 2px ) is not.
263
+ iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-scale', scale === 'default' ? (Math.min(containerWidth, maxWidth) - parseInt(frameSize) * 2) / prevContainerWidthRef.current : scale);
264
+
265
+ // frameSize has to be a px value for the scaling and frame size to be computed correctly.
261
266
  iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-frame-size', typeof frameSize === 'number' ? `${frameSize}px` : frameSize);
262
267
  iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-content-height', `${contentHeight}px`);
263
268
  iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-inner-height', `${iframeWindowInnerHeight}px`);
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useState","createPortal","forwardRef","useMemo","useEffect","useRef","__","useResizeObserver","useMergeRefs","useRefEffect","useDisabled","__experimentalStyleProvider","StyleProvider","useSelect","useBlockSelectionClearer","useWritingFlow","getCompatibilityStyles","store","blockEditorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","bubbleEvent","event","Constructor","frame","init","key","contentDocument","defaultView","MouseEvent","rect","getBoundingClientRect","clientX","left","clientY","top","newEvent","type","defaultPrevented","preventDefault","cancelled","dispatchEvent","useBubbleEvents","iframeDocument","frameElement","html","documentElement","eventTypes","handlers","name","prototype","Object","getPrototypeOf","constructorName","constructor","window","addEventListener","removeEventListener","Iframe","contentRef","children","tabIndex","scale","frameSize","readonly","forwardedRef","ref","title","props","resolvedAssets","isPreviewMode","select","getSettings","settings","__unstableResolvedAssets","__unstableIsPreviewMode","styles","scripts","setIframeDocument","prevContainerWidthRef","bodyClasses","setBodyClasses","clearerRef","before","writingFlowRef","after","contentResizeListener","height","contentHeight","containerResizeListener","width","containerWidth","setRef","node","_load","iFrameDocument","preventFileDropDefault","onLoad","ownerDocument","classList","add","Array","from","body","filter","startsWith","dir","compatStyle","getElementById","id","head","appendChild","cloneNode","console","warn","iframeWindowInnerHeight","setIframeWindowInnerHeight","iframeResizeRef","nodeWindow","innerHeight","onResize","windowInnerWidth","setWindowInnerWidth","windowResizeRef","innerWidth","isZoomedOut","current","disabledRef","isDisabled","bodyRef","src","cleanup","_src","URL","createObjectURL","Blob","revokeObjectURL","maxWidth","style","setProperty","Math","min","remove","removeProperty","shouldRenderFocusCaptureElements","iframe","onKeyDown","currentTarget","target","stopPropagation","nativeEvent","KeyboardEvent","className","document","IframeIfReady","isInitialised","__internalIsInitialized"],"sources":["@wordpress/block-editor/src/components/iframe/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tcreatePortal,\n\tforwardRef,\n\tuseMemo,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseResizeObserver,\n\tuseMergeRefs,\n\tuseRefEffect,\n\tuseDisabled,\n} from '@wordpress/compose';\nimport { __experimentalStyleProvider as StyleProvider } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useBlockSelectionClearer } from '../block-selection-clearer';\nimport { useWritingFlow } from '../writing-flow';\nimport { getCompatibilityStyles } from './get-compatibility-styles';\nimport { store as blockEditorStore } from '../../store';\n\nfunction bubbleEvent( event, Constructor, frame ) {\n\tconst init = {};\n\n\tfor ( const key in event ) {\n\t\tinit[ key ] = event[ key ];\n\t}\n\n\t// Check if the event is a MouseEvent generated within the iframe.\n\t// If so, adjust the coordinates to be relative to the position of\n\t// the iframe. This ensures that components such as Draggable\n\t// receive coordinates relative to the window, instead of relative\n\t// to the iframe. Without this, the Draggable event handler would\n\t// result in components \"jumping\" position as soon as the user\n\t// drags over the iframe.\n\tif ( event instanceof frame.contentDocument.defaultView.MouseEvent ) {\n\t\tconst rect = frame.getBoundingClientRect();\n\t\tinit.clientX += rect.left;\n\t\tinit.clientY += rect.top;\n\t}\n\n\tconst newEvent = new Constructor( event.type, init );\n\tif ( init.defaultPrevented ) {\n\t\tnewEvent.preventDefault();\n\t}\n\tconst cancelled = ! frame.dispatchEvent( newEvent );\n\n\tif ( cancelled ) {\n\t\tevent.preventDefault();\n\t}\n}\n\n/**\n * Bubbles some event types (keydown, keypress, and dragover) to parent document\n * document to ensure that the keyboard shortcuts and drag and drop work.\n *\n * Ideally, we should remove event bubbling in the future. Keyboard shortcuts\n * should be context dependent, e.g. actions on blocks like Cmd+A should not\n * work globally outside the block editor.\n *\n * @param {Document} iframeDocument Document to attach listeners to.\n */\nfunction useBubbleEvents( iframeDocument ) {\n\treturn useRefEffect( () => {\n\t\tconst { defaultView } = iframeDocument;\n\t\tif ( ! defaultView ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { frameElement } = defaultView;\n\t\tconst html = iframeDocument.documentElement;\n\t\tconst eventTypes = [ 'dragover', 'mousemove' ];\n\t\tconst handlers = {};\n\t\tfor ( const name of eventTypes ) {\n\t\t\thandlers[ name ] = ( event ) => {\n\t\t\t\tconst prototype = Object.getPrototypeOf( event );\n\t\t\t\tconst constructorName = prototype.constructor.name;\n\t\t\t\tconst Constructor = window[ constructorName ];\n\t\t\t\tbubbleEvent( event, Constructor, frameElement );\n\t\t\t};\n\t\t\thtml.addEventListener( name, handlers[ name ] );\n\t\t}\n\n\t\treturn () => {\n\t\t\tfor ( const name of eventTypes ) {\n\t\t\t\thtml.removeEventListener( name, handlers[ name ] );\n\t\t\t}\n\t\t};\n\t} );\n}\n\nfunction Iframe( {\n\tcontentRef,\n\tchildren,\n\ttabIndex = 0,\n\tscale = 1,\n\tframeSize = 0,\n\treadonly,\n\tforwardedRef: ref,\n\ttitle = __( 'Editor canvas' ),\n\t...props\n} ) {\n\tconst { resolvedAssets, isPreviewMode } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst settings = getSettings();\n\t\treturn {\n\t\t\tresolvedAssets: settings.__unstableResolvedAssets,\n\t\t\tisPreviewMode: settings.__unstableIsPreviewMode,\n\t\t};\n\t}, [] );\n\tconst { styles = '', scripts = '' } = resolvedAssets;\n\tconst [ iframeDocument, setIframeDocument ] = useState();\n\tconst prevContainerWidthRef = useRef();\n\tconst [ bodyClasses, setBodyClasses ] = useState( [] );\n\tconst clearerRef = useBlockSelectionClearer();\n\tconst [ before, writingFlowRef, after ] = useWritingFlow();\n\tconst [ contentResizeListener, { height: contentHeight } ] =\n\t\tuseResizeObserver();\n\tconst [ containerResizeListener, { width: containerWidth } ] =\n\t\tuseResizeObserver();\n\n\tconst setRef = useRefEffect( ( node ) => {\n\t\tnode._load = () => {\n\t\t\tsetIframeDocument( node.contentDocument );\n\t\t};\n\t\tlet iFrameDocument;\n\t\t// Prevent the default browser action for files dropped outside of dropzones.\n\t\tfunction preventFileDropDefault( event ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\tfunction onLoad() {\n\t\t\tconst { contentDocument, ownerDocument } = node;\n\t\t\tconst { documentElement } = contentDocument;\n\t\t\tiFrameDocument = contentDocument;\n\n\t\t\tdocumentElement.classList.add( 'block-editor-iframe__html' );\n\n\t\t\tclearerRef( documentElement );\n\n\t\t\t// Ideally ALL classes that are added through get_body_class should\n\t\t\t// be added in the editor too, which we'll somehow have to get from\n\t\t\t// the server in the future (which will run the PHP filters).\n\t\t\tsetBodyClasses(\n\t\t\t\tArray.from( ownerDocument.body.classList ).filter(\n\t\t\t\t\t( name ) =>\n\t\t\t\t\t\tname.startsWith( 'admin-color-' ) ||\n\t\t\t\t\t\tname.startsWith( 'post-type-' ) ||\n\t\t\t\t\t\tname === 'wp-embed-responsive'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tcontentDocument.dir = ownerDocument.dir;\n\n\t\t\tfor ( const compatStyle of getCompatibilityStyles() ) {\n\t\t\t\tif ( contentDocument.getElementById( compatStyle.id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcontentDocument.head.appendChild(\n\t\t\t\t\tcompatStyle.cloneNode( true )\n\t\t\t\t);\n\n\t\t\t\tif ( ! isPreviewMode ) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`${ compatStyle.id } was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,\n\t\t\t\t\t\tcompatStyle\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t}\n\n\t\tnode.addEventListener( 'load', onLoad );\n\n\t\treturn () => {\n\t\t\tdelete node._load;\n\t\t\tnode.removeEventListener( 'load', onLoad );\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t};\n\t}, [] );\n\n\tconst [ iframeWindowInnerHeight, setIframeWindowInnerHeight ] = useState();\n\n\tconst iframeResizeRef = useRefEffect( ( node ) => {\n\t\tconst nodeWindow = node.ownerDocument.defaultView;\n\n\t\tsetIframeWindowInnerHeight( nodeWindow.innerHeight );\n\t\tconst onResize = () => {\n\t\t\tsetIframeWindowInnerHeight( nodeWindow.innerHeight );\n\t\t};\n\t\tnodeWindow.addEventListener( 'resize', onResize );\n\t\treturn () => {\n\t\t\tnodeWindow.removeEventListener( 'resize', onResize );\n\t\t};\n\t}, [] );\n\n\tconst [ windowInnerWidth, setWindowInnerWidth ] = useState();\n\n\tconst windowResizeRef = useRefEffect( ( node ) => {\n\t\tconst nodeWindow = node.ownerDocument.defaultView;\n\n\t\tsetWindowInnerWidth( nodeWindow.innerWidth );\n\t\tconst onResize = () => {\n\t\t\tsetWindowInnerWidth( nodeWindow.innerWidth );\n\t\t};\n\t\tnodeWindow.addEventListener( 'resize', onResize );\n\t\treturn () => {\n\t\t\tnodeWindow.removeEventListener( 'resize', onResize );\n\t\t};\n\t}, [] );\n\n\tconst isZoomedOut = scale !== 1;\n\n\tuseEffect( () => {\n\t\tif ( ! isZoomedOut ) {\n\t\t\tprevContainerWidthRef.current = containerWidth;\n\t\t}\n\t}, [ containerWidth, isZoomedOut ] );\n\n\tconst disabledRef = useDisabled( { isDisabled: ! readonly } );\n\tconst bodyRef = useMergeRefs( [\n\t\tuseBubbleEvents( iframeDocument ),\n\t\tcontentRef,\n\t\tclearerRef,\n\t\twritingFlowRef,\n\t\tdisabledRef,\n\t\t// Avoid resize listeners when not needed, these will trigger\n\t\t// unnecessary re-renders when animating the iframe width, or when\n\t\t// expanding preview iframes.\n\t\tisZoomedOut ? iframeResizeRef : null,\n\t] );\n\n\t// Correct doctype is required to enable rendering in standards\n\t// mode. Also preload the styles to avoid a flash of unstyled\n\t// content.\n\tconst html = `<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<script>window.frameElement._load()</script>\n\t\t<style>\n\t\t\thtml{\n\t\t\t\theight: auto !important;\n\t\t\t\tmin-height: 100%;\n\t\t\t}\n\t\t\t/* Lowest specificity to not override global styles */\n\t\t\t:where(body) {\n\t\t\t\tmargin: 0;\n\t\t\t\t/* Default background color in case zoom out mode background\n\t\t\t\tcolors the html element */\n\t\t\t\tbackground-color: white;\n\t\t\t}\n\t\t</style>\n\t\t${ styles }\n\t\t${ scripts }\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()</script>\n\t</body>\n</html>`;\n\n\tconst [ src, cleanup ] = useMemo( () => {\n\t\tconst _src = URL.createObjectURL(\n\t\t\tnew window.Blob( [ html ], { type: 'text/html' } )\n\t\t);\n\t\treturn [ _src, () => URL.revokeObjectURL( _src ) ];\n\t}, [ html ] );\n\n\tuseEffect( () => cleanup, [ cleanup ] );\n\n\tuseEffect( () => {\n\t\tif ( ! iframeDocument || ! isZoomedOut ) {\n\t\t\treturn;\n\t\t}\n\n\t\tiframeDocument.documentElement.classList.add( 'is-zoomed-out' );\n\n\t\tconst maxWidth = 750;\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-scale',\n\t\t\tscale === 'default'\n\t\t\t\t? Math.min( containerWidth, maxWidth ) /\n\t\t\t\t\t\tprevContainerWidthRef.current\n\t\t\t\t: scale\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-frame-size',\n\t\t\ttypeof frameSize === 'number' ? `${ frameSize }px` : frameSize\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-content-height',\n\t\t\t`${ contentHeight }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-inner-height',\n\t\t\t`${ iframeWindowInnerHeight }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-container-width',\n\t\t\t`${ containerWidth }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-prev-container-width',\n\t\t\t`${ prevContainerWidthRef.current }px`\n\t\t);\n\n\t\treturn () => {\n\t\t\tiframeDocument.documentElement.classList.remove( 'is-zoomed-out' );\n\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-scale'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-frame-size'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-content-height'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-inner-height'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-container-width'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-prev-container-width'\n\t\t\t);\n\t\t};\n\t}, [\n\t\tscale,\n\t\tframeSize,\n\t\tiframeDocument,\n\t\tiframeWindowInnerHeight,\n\t\tcontentHeight,\n\t\tcontainerWidth,\n\t\twindowInnerWidth,\n\t\tisZoomedOut,\n\t] );\n\n\t// Make sure to not render the before and after focusable div elements in view\n\t// mode. They're only needed to capture focus in edit mode.\n\tconst shouldRenderFocusCaptureElements = tabIndex >= 0 && ! isPreviewMode;\n\n\tconst iframe = (\n\t\t<>\n\t\t\t{ shouldRenderFocusCaptureElements && before }\n\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t<iframe\n\t\t\t\t{ ...props }\n\t\t\t\tstyle={ {\n\t\t\t\t\t...props.style,\n\t\t\t\t\theight: props.style?.height,\n\t\t\t\t} }\n\t\t\t\tref={ useMergeRefs( [ ref, setRef ] ) }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t// Correct doctype is required to enable rendering in standards\n\t\t\t\t// mode. Also preload the styles to avoid a flash of unstyled\n\t\t\t\t// content.\n\t\t\t\tsrc={ src }\n\t\t\t\ttitle={ title }\n\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\tif ( props.onKeyDown ) {\n\t\t\t\t\t\tprops.onKeyDown( event );\n\t\t\t\t\t}\n\t\t\t\t\t// If the event originates from inside the iframe, it means\n\t\t\t\t\t// it bubbled through the portal, but only with React\n\t\t\t\t\t// events. We need to to bubble native events as well,\n\t\t\t\t\t// though by doing so we also trigger another React event,\n\t\t\t\t\t// so we need to stop the propagation of this event to avoid\n\t\t\t\t\t// duplication.\n\t\t\t\t\tif (\n\t\t\t\t\t\tevent.currentTarget.ownerDocument !==\n\t\t\t\t\t\tevent.target.ownerDocument\n\t\t\t\t\t) {\n\t\t\t\t\t\t// We should only stop propagation of the React event,\n\t\t\t\t\t\t// the native event should further bubble inside the\n\t\t\t\t\t\t// iframe to the document and window.\n\t\t\t\t\t\t// Alternatively, we could consider redispatching the\n\t\t\t\t\t\t// native event in the iframe.\n\t\t\t\t\t\tconst { stopPropagation } = event.nativeEvent;\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = () => {};\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = stopPropagation;\n\t\t\t\t\t\tbubbleEvent(\n\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\twindow.KeyboardEvent,\n\t\t\t\t\t\t\tevent.currentTarget\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframeDocument &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t// We want to prevent React events from bubbling throught the iframe\n\t\t\t\t\t\t// we bubble these manually.\n\t\t\t\t\t\t/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t<body\n\t\t\t\t\t\t\tref={ bodyRef }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-iframe__body',\n\t\t\t\t\t\t\t\t'editor-styles-wrapper',\n\t\t\t\t\t\t\t\t...bodyClasses\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ contentResizeListener }\n\t\t\t\t\t\t\t<StyleProvider document={ iframeDocument }>\n\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t</StyleProvider>\n\t\t\t\t\t\t</body>,\n\t\t\t\t\t\tiframeDocument.documentElement\n\t\t\t\t\t) }\n\t\t\t</iframe>\n\t\t\t{ shouldRenderFocusCaptureElements && after }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<div className=\"block-editor-iframe__container\" ref={ windowResizeRef }>\n\t\t\t{ containerResizeListener }\n\t\t\t<div\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-iframe__scale-container',\n\t\t\t\t\tisZoomedOut && 'is-zoomed-out'\n\t\t\t\t) }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--wp-block-editor-iframe-zoom-out-container-width':\n\t\t\t\t\t\tisZoomedOut && `${ containerWidth }px`,\n\t\t\t\t\t'--wp-block-editor-iframe-zoom-out-prev-container-width':\n\t\t\t\t\t\tisZoomedOut && `${ prevContainerWidthRef.current }px`,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframe }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nfunction IframeIfReady( props, ref ) {\n\tconst isInitialised = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().__internalIsInitialized,\n\t\t[]\n\t);\n\n\t// We shouldn't render the iframe until the editor settings are initialised.\n\t// The initial settings are needed to get the styles for the srcDoc, which\n\t// cannot be changed after the iframe is mounted. srcDoc is used to to set\n\t// the initial iframe HTML, which is required to avoid a flash of unstyled\n\t// content.\n\tif ( ! isInitialised ) {\n\t\treturn null;\n\t}\n\n\treturn <Iframe { ...props } forwardedRef={ ref } />;\n}\n\nexport default forwardRef( IframeIfReady );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,QAAQ,EACRC,YAAY,EACZC,UAAU,EACVC,OAAO,EACPC,SAAS,EACTC,MAAM,QACA,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,iBAAiB,EACjBC,YAAY,EACZC,YAAY,EACZC,WAAW,QACL,oBAAoB;AAC3B,SAASC,2BAA2B,IAAIC,aAAa,QAAQ,uBAAuB;AACpF,SAASC,S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,EAAGC;EAAK,CAAE,CAAC;AACpD;AAEA,eAAepE,UAAU,CAAE4J,aAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useState","createPortal","forwardRef","useMemo","useEffect","useRef","__","useResizeObserver","useMergeRefs","useRefEffect","useDisabled","__experimentalStyleProvider","StyleProvider","useSelect","useBlockSelectionClearer","useWritingFlow","getCompatibilityStyles","store","blockEditorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","bubbleEvent","event","Constructor","frame","init","key","contentDocument","defaultView","MouseEvent","rect","getBoundingClientRect","clientX","left","clientY","top","newEvent","type","defaultPrevented","preventDefault","cancelled","dispatchEvent","useBubbleEvents","iframeDocument","frameElement","html","documentElement","eventTypes","handlers","name","prototype","Object","getPrototypeOf","constructorName","constructor","window","addEventListener","removeEventListener","Iframe","contentRef","children","tabIndex","scale","frameSize","readonly","forwardedRef","ref","title","props","resolvedAssets","isPreviewMode","select","getSettings","settings","__unstableResolvedAssets","__unstableIsPreviewMode","styles","scripts","setIframeDocument","prevContainerWidthRef","bodyClasses","setBodyClasses","clearerRef","before","writingFlowRef","after","contentResizeListener","height","contentHeight","containerResizeListener","width","containerWidth","setRef","node","_load","iFrameDocument","preventFileDropDefault","onLoad","ownerDocument","classList","add","Array","from","body","filter","startsWith","dir","compatStyle","getElementById","id","head","appendChild","cloneNode","console","warn","iframeWindowInnerHeight","setIframeWindowInnerHeight","iframeResizeRef","nodeWindow","innerHeight","onResize","windowInnerWidth","setWindowInnerWidth","windowResizeRef","innerWidth","isZoomedOut","current","disabledRef","isDisabled","bodyRef","src","cleanup","_src","URL","createObjectURL","Blob","revokeObjectURL","maxWidth","style","setProperty","Math","min","parseInt","remove","removeProperty","shouldRenderFocusCaptureElements","iframe","onKeyDown","currentTarget","target","stopPropagation","nativeEvent","KeyboardEvent","className","document","IframeIfReady","isInitialised","__internalIsInitialized"],"sources":["@wordpress/block-editor/src/components/iframe/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tcreatePortal,\n\tforwardRef,\n\tuseMemo,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseResizeObserver,\n\tuseMergeRefs,\n\tuseRefEffect,\n\tuseDisabled,\n} from '@wordpress/compose';\nimport { __experimentalStyleProvider as StyleProvider } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useBlockSelectionClearer } from '../block-selection-clearer';\nimport { useWritingFlow } from '../writing-flow';\nimport { getCompatibilityStyles } from './get-compatibility-styles';\nimport { store as blockEditorStore } from '../../store';\n\nfunction bubbleEvent( event, Constructor, frame ) {\n\tconst init = {};\n\n\tfor ( const key in event ) {\n\t\tinit[ key ] = event[ key ];\n\t}\n\n\t// Check if the event is a MouseEvent generated within the iframe.\n\t// If so, adjust the coordinates to be relative to the position of\n\t// the iframe. This ensures that components such as Draggable\n\t// receive coordinates relative to the window, instead of relative\n\t// to the iframe. Without this, the Draggable event handler would\n\t// result in components \"jumping\" position as soon as the user\n\t// drags over the iframe.\n\tif ( event instanceof frame.contentDocument.defaultView.MouseEvent ) {\n\t\tconst rect = frame.getBoundingClientRect();\n\t\tinit.clientX += rect.left;\n\t\tinit.clientY += rect.top;\n\t}\n\n\tconst newEvent = new Constructor( event.type, init );\n\tif ( init.defaultPrevented ) {\n\t\tnewEvent.preventDefault();\n\t}\n\tconst cancelled = ! frame.dispatchEvent( newEvent );\n\n\tif ( cancelled ) {\n\t\tevent.preventDefault();\n\t}\n}\n\n/**\n * Bubbles some event types (keydown, keypress, and dragover) to parent document\n * document to ensure that the keyboard shortcuts and drag and drop work.\n *\n * Ideally, we should remove event bubbling in the future. Keyboard shortcuts\n * should be context dependent, e.g. actions on blocks like Cmd+A should not\n * work globally outside the block editor.\n *\n * @param {Document} iframeDocument Document to attach listeners to.\n */\nfunction useBubbleEvents( iframeDocument ) {\n\treturn useRefEffect( () => {\n\t\tconst { defaultView } = iframeDocument;\n\t\tif ( ! defaultView ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { frameElement } = defaultView;\n\t\tconst html = iframeDocument.documentElement;\n\t\tconst eventTypes = [ 'dragover', 'mousemove' ];\n\t\tconst handlers = {};\n\t\tfor ( const name of eventTypes ) {\n\t\t\thandlers[ name ] = ( event ) => {\n\t\t\t\tconst prototype = Object.getPrototypeOf( event );\n\t\t\t\tconst constructorName = prototype.constructor.name;\n\t\t\t\tconst Constructor = window[ constructorName ];\n\t\t\t\tbubbleEvent( event, Constructor, frameElement );\n\t\t\t};\n\t\t\thtml.addEventListener( name, handlers[ name ] );\n\t\t}\n\n\t\treturn () => {\n\t\t\tfor ( const name of eventTypes ) {\n\t\t\t\thtml.removeEventListener( name, handlers[ name ] );\n\t\t\t}\n\t\t};\n\t} );\n}\n\nfunction Iframe( {\n\tcontentRef,\n\tchildren,\n\ttabIndex = 0,\n\tscale = 1,\n\tframeSize = 0,\n\treadonly,\n\tforwardedRef: ref,\n\ttitle = __( 'Editor canvas' ),\n\t...props\n} ) {\n\tconst { resolvedAssets, isPreviewMode } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst settings = getSettings();\n\t\treturn {\n\t\t\tresolvedAssets: settings.__unstableResolvedAssets,\n\t\t\tisPreviewMode: settings.__unstableIsPreviewMode,\n\t\t};\n\t}, [] );\n\tconst { styles = '', scripts = '' } = resolvedAssets;\n\tconst [ iframeDocument, setIframeDocument ] = useState();\n\tconst prevContainerWidthRef = useRef();\n\tconst [ bodyClasses, setBodyClasses ] = useState( [] );\n\tconst clearerRef = useBlockSelectionClearer();\n\tconst [ before, writingFlowRef, after ] = useWritingFlow();\n\tconst [ contentResizeListener, { height: contentHeight } ] =\n\t\tuseResizeObserver();\n\tconst [ containerResizeListener, { width: containerWidth } ] =\n\t\tuseResizeObserver();\n\n\tconst setRef = useRefEffect( ( node ) => {\n\t\tnode._load = () => {\n\t\t\tsetIframeDocument( node.contentDocument );\n\t\t};\n\t\tlet iFrameDocument;\n\t\t// Prevent the default browser action for files dropped outside of dropzones.\n\t\tfunction preventFileDropDefault( event ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t\tfunction onLoad() {\n\t\t\tconst { contentDocument, ownerDocument } = node;\n\t\t\tconst { documentElement } = contentDocument;\n\t\t\tiFrameDocument = contentDocument;\n\n\t\t\tdocumentElement.classList.add( 'block-editor-iframe__html' );\n\n\t\t\tclearerRef( documentElement );\n\n\t\t\t// Ideally ALL classes that are added through get_body_class should\n\t\t\t// be added in the editor too, which we'll somehow have to get from\n\t\t\t// the server in the future (which will run the PHP filters).\n\t\t\tsetBodyClasses(\n\t\t\t\tArray.from( ownerDocument.body.classList ).filter(\n\t\t\t\t\t( name ) =>\n\t\t\t\t\t\tname.startsWith( 'admin-color-' ) ||\n\t\t\t\t\t\tname.startsWith( 'post-type-' ) ||\n\t\t\t\t\t\tname === 'wp-embed-responsive'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tcontentDocument.dir = ownerDocument.dir;\n\n\t\t\tfor ( const compatStyle of getCompatibilityStyles() ) {\n\t\t\t\tif ( contentDocument.getElementById( compatStyle.id ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tcontentDocument.head.appendChild(\n\t\t\t\t\tcompatStyle.cloneNode( true )\n\t\t\t\t);\n\n\t\t\t\tif ( ! isPreviewMode ) {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t`${ compatStyle.id } was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`,\n\t\t\t\t\t\tcompatStyle\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tiFrameDocument.addEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault,\n\t\t\t\tfalse\n\t\t\t);\n\t\t}\n\n\t\tnode.addEventListener( 'load', onLoad );\n\n\t\treturn () => {\n\t\t\tdelete node._load;\n\t\t\tnode.removeEventListener( 'load', onLoad );\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'dragover',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t\tiFrameDocument?.removeEventListener(\n\t\t\t\t'drop',\n\t\t\t\tpreventFileDropDefault\n\t\t\t);\n\t\t};\n\t}, [] );\n\n\tconst [ iframeWindowInnerHeight, setIframeWindowInnerHeight ] = useState();\n\n\tconst iframeResizeRef = useRefEffect( ( node ) => {\n\t\tconst nodeWindow = node.ownerDocument.defaultView;\n\n\t\tsetIframeWindowInnerHeight( nodeWindow.innerHeight );\n\t\tconst onResize = () => {\n\t\t\tsetIframeWindowInnerHeight( nodeWindow.innerHeight );\n\t\t};\n\t\tnodeWindow.addEventListener( 'resize', onResize );\n\t\treturn () => {\n\t\t\tnodeWindow.removeEventListener( 'resize', onResize );\n\t\t};\n\t}, [] );\n\n\tconst [ windowInnerWidth, setWindowInnerWidth ] = useState();\n\n\tconst windowResizeRef = useRefEffect( ( node ) => {\n\t\tconst nodeWindow = node.ownerDocument.defaultView;\n\n\t\tsetWindowInnerWidth( nodeWindow.innerWidth );\n\t\tconst onResize = () => {\n\t\t\tsetWindowInnerWidth( nodeWindow.innerWidth );\n\t\t};\n\t\tnodeWindow.addEventListener( 'resize', onResize );\n\t\treturn () => {\n\t\t\tnodeWindow.removeEventListener( 'resize', onResize );\n\t\t};\n\t}, [] );\n\n\tconst isZoomedOut = scale !== 1;\n\n\tuseEffect( () => {\n\t\tif ( ! isZoomedOut ) {\n\t\t\tprevContainerWidthRef.current = containerWidth;\n\t\t}\n\t}, [ containerWidth, isZoomedOut ] );\n\n\tconst disabledRef = useDisabled( { isDisabled: ! readonly } );\n\tconst bodyRef = useMergeRefs( [\n\t\tuseBubbleEvents( iframeDocument ),\n\t\tcontentRef,\n\t\tclearerRef,\n\t\twritingFlowRef,\n\t\tdisabledRef,\n\t\t// Avoid resize listeners when not needed, these will trigger\n\t\t// unnecessary re-renders when animating the iframe width, or when\n\t\t// expanding preview iframes.\n\t\tisZoomedOut ? iframeResizeRef : null,\n\t] );\n\n\t// Correct doctype is required to enable rendering in standards\n\t// mode. Also preload the styles to avoid a flash of unstyled\n\t// content.\n\tconst html = `<!doctype html>\n<html>\n\t<head>\n\t\t<meta charset=\"utf-8\">\n\t\t<script>window.frameElement._load()</script>\n\t\t<style>\n\t\t\thtml{\n\t\t\t\theight: auto !important;\n\t\t\t\tmin-height: 100%;\n\t\t\t}\n\t\t\t/* Lowest specificity to not override global styles */\n\t\t\t:where(body) {\n\t\t\t\tmargin: 0;\n\t\t\t\t/* Default background color in case zoom out mode background\n\t\t\t\tcolors the html element */\n\t\t\t\tbackground-color: white;\n\t\t\t}\n\t\t</style>\n\t\t${ styles }\n\t\t${ scripts }\n\t</head>\n\t<body>\n\t\t<script>document.currentScript.parentElement.remove()</script>\n\t</body>\n</html>`;\n\n\tconst [ src, cleanup ] = useMemo( () => {\n\t\tconst _src = URL.createObjectURL(\n\t\t\tnew window.Blob( [ html ], { type: 'text/html' } )\n\t\t);\n\t\treturn [ _src, () => URL.revokeObjectURL( _src ) ];\n\t}, [ html ] );\n\n\tuseEffect( () => cleanup, [ cleanup ] );\n\n\tuseEffect( () => {\n\t\tif ( ! iframeDocument || ! isZoomedOut ) {\n\t\t\treturn;\n\t\t}\n\n\t\tiframeDocument.documentElement.classList.add( 'is-zoomed-out' );\n\n\t\tconst maxWidth = 750;\n\t\t// This scaling calculation has to happen within the JS because CSS calc() can\n\t\t// only divide and multiply by a unitless value. I.e. calc( 100px / 2 ) is valid\n\t\t// but calc( 100px / 2px ) is not.\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-scale',\n\t\t\tscale === 'default'\n\t\t\t\t? ( Math.min( containerWidth, maxWidth ) -\n\t\t\t\t\t\tparseInt( frameSize ) * 2 ) /\n\t\t\t\t\t\tprevContainerWidthRef.current\n\t\t\t\t: scale\n\t\t);\n\n\t\t// frameSize has to be a px value for the scaling and frame size to be computed correctly.\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-frame-size',\n\t\t\ttypeof frameSize === 'number' ? `${ frameSize }px` : frameSize\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-content-height',\n\t\t\t`${ contentHeight }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-inner-height',\n\t\t\t`${ iframeWindowInnerHeight }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-container-width',\n\t\t\t`${ containerWidth }px`\n\t\t);\n\t\tiframeDocument.documentElement.style.setProperty(\n\t\t\t'--wp-block-editor-iframe-zoom-out-prev-container-width',\n\t\t\t`${ prevContainerWidthRef.current }px`\n\t\t);\n\n\t\treturn () => {\n\t\t\tiframeDocument.documentElement.classList.remove( 'is-zoomed-out' );\n\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-scale'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-frame-size'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-content-height'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-inner-height'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-container-width'\n\t\t\t);\n\t\t\tiframeDocument.documentElement.style.removeProperty(\n\t\t\t\t'--wp-block-editor-iframe-zoom-out-prev-container-width'\n\t\t\t);\n\t\t};\n\t}, [\n\t\tscale,\n\t\tframeSize,\n\t\tiframeDocument,\n\t\tiframeWindowInnerHeight,\n\t\tcontentHeight,\n\t\tcontainerWidth,\n\t\twindowInnerWidth,\n\t\tisZoomedOut,\n\t] );\n\n\t// Make sure to not render the before and after focusable div elements in view\n\t// mode. They're only needed to capture focus in edit mode.\n\tconst shouldRenderFocusCaptureElements = tabIndex >= 0 && ! isPreviewMode;\n\n\tconst iframe = (\n\t\t<>\n\t\t\t{ shouldRenderFocusCaptureElements && before }\n\t\t\t{ /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ }\n\t\t\t<iframe\n\t\t\t\t{ ...props }\n\t\t\t\tstyle={ {\n\t\t\t\t\t...props.style,\n\t\t\t\t\theight: props.style?.height,\n\t\t\t\t} }\n\t\t\t\tref={ useMergeRefs( [ ref, setRef ] ) }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t// Correct doctype is required to enable rendering in standards\n\t\t\t\t// mode. Also preload the styles to avoid a flash of unstyled\n\t\t\t\t// content.\n\t\t\t\tsrc={ src }\n\t\t\t\ttitle={ title }\n\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\tif ( props.onKeyDown ) {\n\t\t\t\t\t\tprops.onKeyDown( event );\n\t\t\t\t\t}\n\t\t\t\t\t// If the event originates from inside the iframe, it means\n\t\t\t\t\t// it bubbled through the portal, but only with React\n\t\t\t\t\t// events. We need to to bubble native events as well,\n\t\t\t\t\t// though by doing so we also trigger another React event,\n\t\t\t\t\t// so we need to stop the propagation of this event to avoid\n\t\t\t\t\t// duplication.\n\t\t\t\t\tif (\n\t\t\t\t\t\tevent.currentTarget.ownerDocument !==\n\t\t\t\t\t\tevent.target.ownerDocument\n\t\t\t\t\t) {\n\t\t\t\t\t\t// We should only stop propagation of the React event,\n\t\t\t\t\t\t// the native event should further bubble inside the\n\t\t\t\t\t\t// iframe to the document and window.\n\t\t\t\t\t\t// Alternatively, we could consider redispatching the\n\t\t\t\t\t\t// native event in the iframe.\n\t\t\t\t\t\tconst { stopPropagation } = event.nativeEvent;\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = () => {};\n\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\tevent.nativeEvent.stopPropagation = stopPropagation;\n\t\t\t\t\t\tbubbleEvent(\n\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\twindow.KeyboardEvent,\n\t\t\t\t\t\t\tevent.currentTarget\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframeDocument &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t// We want to prevent React events from bubbling throught the iframe\n\t\t\t\t\t\t// we bubble these manually.\n\t\t\t\t\t\t/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t\t\t<body\n\t\t\t\t\t\t\tref={ bodyRef }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-iframe__body',\n\t\t\t\t\t\t\t\t'editor-styles-wrapper',\n\t\t\t\t\t\t\t\t...bodyClasses\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ contentResizeListener }\n\t\t\t\t\t\t\t<StyleProvider document={ iframeDocument }>\n\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t</StyleProvider>\n\t\t\t\t\t\t</body>,\n\t\t\t\t\t\tiframeDocument.documentElement\n\t\t\t\t\t) }\n\t\t\t</iframe>\n\t\t\t{ shouldRenderFocusCaptureElements && after }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<div className=\"block-editor-iframe__container\" ref={ windowResizeRef }>\n\t\t\t{ containerResizeListener }\n\t\t\t<div\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-iframe__scale-container',\n\t\t\t\t\tisZoomedOut && 'is-zoomed-out'\n\t\t\t\t) }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--wp-block-editor-iframe-zoom-out-container-width':\n\t\t\t\t\t\tisZoomedOut && `${ containerWidth }px`,\n\t\t\t\t\t'--wp-block-editor-iframe-zoom-out-prev-container-width':\n\t\t\t\t\t\tisZoomedOut && `${ prevContainerWidthRef.current }px`,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ iframe }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nfunction IframeIfReady( props, ref ) {\n\tconst isInitialised = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().__internalIsInitialized,\n\t\t[]\n\t);\n\n\t// We shouldn't render the iframe until the editor settings are initialised.\n\t// The initial settings are needed to get the styles for the srcDoc, which\n\t// cannot be changed after the iframe is mounted. srcDoc is used to to set\n\t// the initial iframe HTML, which is required to avoid a flash of unstyled\n\t// content.\n\tif ( ! isInitialised ) {\n\t\treturn null;\n\t}\n\n\treturn <Iframe { ...props } forwardedRef={ ref } />;\n}\n\nexport default forwardRef( IframeIfReady );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,QAAQ,EACRC,YAAY,EACZC,UAAU,EACVC,OAAO,EACPC,SAAS,EACTC,MAAM,QACA,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,iBAAiB,EACjBC,YAAY,EACZC,YAAY,EACZC,WAAW,QACL,oBAAoB;AAC3B,SAASC,2BAA2B,IAAIC,aAAa,QAAQ,uBAAuB;AACpF,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,wBAAwB,QAAQ,4BAA4B;AACrE,SAASC,cAAc,QAAQ,iBAAiB;AAChD,SAASC,sBAAsB,QAAQ,4BAA4B;AACnE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IA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,EAAG+D,OAAS;QACfwB,SAAS,EAAG9J,IAAI,CACf,2BAA2B,EAC3B,uBAAuB,EACvB,GAAGqF,WACJ,CAAG;QAAApB,QAAA,GAED0B,qBAAqB,eACvBtE,IAAA,CAACR,aAAa;UAACkJ,QAAQ,EAAG/G,cAAgB;UAAAiB,QAAA,EACvCA;QAAQ,CACI,CAAC;MAAA,CACX,CAAC,EACPjB,cAAc,CAACG,eAChB;IAAC,CACK,CAAC,EACPmG,gCAAgC,IAAI5D,KAAK;EAAA,CAC1C,CACF;EAED,oBACCnE,KAAA;IAAKuI,SAAS,EAAC,gCAAgC;IAACvF,GAAG,EAAGyD,eAAiB;IAAA/D,QAAA,GACpE6B,uBAAuB,eACzBzE,IAAA;MACCyI,SAAS,EAAG9J,IAAI,CACf,sCAAsC,EACtCkI,WAAW,IAAI,eAChB,CAAG;MACHa,KAAK,EAAG;QACP,mDAAmD,EAClDb,WAAW,IAAK,GAAGlC,cAAgB,IAAG;QACvC,wDAAwD,EACvDkC,WAAW,IAAK,GAAG9C,qBAAqB,CAAC+C,OAAS;MACpD,CAAG;MAAAlE,QAAA,EAEDsF;IAAM,CACJ,CAAC;EAAA,CACF,CAAC;AAER;AAEA,SAASS,aAAaA,CAAEvF,KAAK,EAAEF,GAAG,EAAG;EACpC,MAAM0F,aAAa,GAAGnJ,SAAS,CAC5B8D,MAAM,IACPA,MAAM,CAAEzD,gBAAiB,CAAC,CAAC0D,WAAW,CAAC,CAAC,CAACqF,uBAAuB,EACjE,EACD,CAAC;;EAED;EACA;EACA;EACA;EACA;EACA,IAAK,CAAED,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EAEA,oBAAO5I,IAAA,CAAC0C,MAAM;IAAA,GAAMU,KAAK;IAAGH,YAAY,EAAGC;EAAK,CAAE,CAAC;AACpD;AAEA,eAAepE,UAAU,CAAE6J,aAAc,CAAC","ignoreList":[]}
@@ -25,6 +25,7 @@ import InserterSearchResults from './search-results';
25
25
  import useInsertionPoint from './hooks/use-insertion-point';
26
26
  import { store as blockEditorStore } from '../../store';
27
27
  import TabbedSidebar from '../tabbed-sidebar';
28
+ import { useZoomOut } from '../../hooks/use-zoom-out';
28
29
  import { jsx as _jsx } from "react/jsx-runtime";
29
30
  import { Fragment as _Fragment } from "react/jsx-runtime";
30
31
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -59,6 +60,8 @@ function InserterMenu({
59
60
  }
60
61
  }
61
62
  const [selectedTab, setSelectedTab] = useState(getInitialTab());
63
+ const shouldUseZoomOut = selectedTab === 'patterns' || selectedTab === 'media';
64
+ useZoomOut(shouldUseZoomOut);
62
65
  const [destinationRootClientId, onInsertBlocks, onToggleInsertionPoint] = useInsertionPoint({
63
66
  rootClientId,
64
67
  clientId,
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","forwardRef","useState","useCallback","useMemo","useRef","useLayoutEffect","VisuallyHidden","SearchControl","Popover","__","useDebouncedInput","useSelect","Tips","InserterPreviewPanel","BlockTypesTab","BlockPatternsTab","PatternCategoryPreviews","MediaTab","MediaCategoryPanel","InserterSearchResults","useInsertionPoint","store","blockEditorStore","TabbedSidebar","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","NOOP","InserterMenu","rootClientId","clientId","isAppender","__experimentalInsertionIndex","onSelect","showInserterHelpPanel","showMostUsedBlocks","__experimentalFilterValue","shouldFocusBlock","onPatternCategorySelection","onClose","__experimentalInitialTab","__experimentalInitialCategory","ref","isZoomOutMode","select","__unstableGetEditorMode","filterValue","setFilterValue","delayedFilterValue","hoveredItem","setHoveredItem","selectedPatternCategory","setSelectedPatternCategory","patternFilter","setPatternFilter","selectedMediaCategory","setSelectedMediaCategory","getInitialTab","selectedTab","setSelectedTab","destinationRootClientId","onInsertBlocks","onToggleInsertionPoint","insertionIndex","blockTypesTabRef","onInsert","blocks","meta","shouldForceFocusBlock","_rootClientId","window","requestAnimationFrame","current","contains","ownerDocument","activeElement","querySelector","focus","onInsertPattern","patternName","onHover","item","onClickPatternCategory","patternCategory","filter","showPatternPanel","showMediaPanel","inserterSearch","children","__nextHasNoMarginBottom","className","onChange","value","label","placeholder","showBlockDirectory","prioritizePatterns","blocksTab","as","patternsTab","onSelectCategory","selectedCategory","category","showTitlesAsTooltip","mediaTab","handleSetSelectedTab","tabsRef","closeButtonLabel","tabs","name","title","panel","placement","offset","focusOnMount","animate","PrivateInserterMenu","PublicInserterMenu","props"],"sources":["@wordpress/block-editor/src/components/inserter/menu.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tforwardRef,\n\tuseState,\n\tuseCallback,\n\tuseMemo,\n\tuseRef,\n\tuseLayoutEffect,\n} from '@wordpress/element';\nimport { VisuallyHidden, SearchControl, Popover } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDebouncedInput } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport Tips from './tips';\nimport InserterPreviewPanel from './preview-panel';\nimport BlockTypesTab from './block-types-tab';\nimport BlockPatternsTab from './block-patterns-tab';\nimport { PatternCategoryPreviews } from './block-patterns-tab/pattern-category-previews';\nimport { MediaTab, MediaCategoryPanel } from './media-tab';\nimport InserterSearchResults from './search-results';\nimport useInsertionPoint from './hooks/use-insertion-point';\nimport { store as blockEditorStore } from '../../store';\nimport TabbedSidebar from '../tabbed-sidebar';\n\nconst NOOP = () => {};\nfunction InserterMenu(\n\t{\n\t\trootClientId,\n\t\tclientId,\n\t\tisAppender,\n\t\t__experimentalInsertionIndex,\n\t\tonSelect,\n\t\tshowInserterHelpPanel,\n\t\tshowMostUsedBlocks,\n\t\t__experimentalFilterValue = '',\n\t\tshouldFocusBlock = true,\n\t\tonPatternCategorySelection,\n\t\tonClose,\n\t\t__experimentalInitialTab,\n\t\t__experimentalInitialCategory,\n\t},\n\tref\n) {\n\tconst isZoomOutMode = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).__unstableGetEditorMode() === 'zoom-out',\n\t\t[]\n\t);\n\tconst [ filterValue, setFilterValue, delayedFilterValue ] =\n\t\tuseDebouncedInput( __experimentalFilterValue );\n\tconst [ hoveredItem, setHoveredItem ] = useState( null );\n\tconst [ selectedPatternCategory, setSelectedPatternCategory ] = useState(\n\t\t__experimentalInitialCategory\n\t);\n\tconst [ patternFilter, setPatternFilter ] = useState( 'all' );\n\tconst [ selectedMediaCategory, setSelectedMediaCategory ] =\n\t\tuseState( null );\n\tfunction getInitialTab() {\n\t\tif ( __experimentalInitialTab ) {\n\t\t\treturn __experimentalInitialTab;\n\t\t}\n\n\t\tif ( isZoomOutMode ) {\n\t\t\treturn 'patterns';\n\t\t}\n\t}\n\tconst [ selectedTab, setSelectedTab ] = useState( getInitialTab() );\n\n\tconst [ destinationRootClientId, onInsertBlocks, onToggleInsertionPoint ] =\n\t\tuseInsertionPoint( {\n\t\t\trootClientId,\n\t\t\tclientId,\n\t\t\tisAppender,\n\t\t\tinsertionIndex: __experimentalInsertionIndex,\n\t\t\tshouldFocusBlock,\n\t\t} );\n\tconst blockTypesTabRef = useRef();\n\n\tconst onInsert = useCallback(\n\t\t( blocks, meta, shouldForceFocusBlock, _rootClientId ) => {\n\t\t\tonInsertBlocks(\n\t\t\t\tblocks,\n\t\t\t\tmeta,\n\t\t\t\tshouldForceFocusBlock,\n\t\t\t\t_rootClientId\n\t\t\t);\n\t\t\tonSelect( blocks );\n\n\t\t\t// Check for focus loss due to filtering blocks by selected block type\n\t\t\twindow.requestAnimationFrame( () => {\n\t\t\t\tif (\n\t\t\t\t\t! shouldFocusBlock &&\n\t\t\t\t\t! blockTypesTabRef.current?.contains(\n\t\t\t\t\t\tref.current.ownerDocument.activeElement\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\t// There has been a focus loss, so focus the first button in the block types tab\n\t\t\t\t\tblockTypesTabRef.current?.querySelector( 'button' ).focus();\n\t\t\t\t}\n\t\t\t} );\n\t\t},\n\t\t[ onInsertBlocks, onSelect, shouldFocusBlock ]\n\t);\n\n\tconst onInsertPattern = useCallback(\n\t\t( blocks, patternName ) => {\n\t\t\tonToggleInsertionPoint( false );\n\t\t\tonInsertBlocks( blocks, { patternName } );\n\t\t\tonSelect();\n\t\t},\n\t\t[ onInsertBlocks, onSelect ]\n\t);\n\n\tconst onHover = useCallback(\n\t\t( item ) => {\n\t\t\tonToggleInsertionPoint( item );\n\t\t\tsetHoveredItem( item );\n\t\t},\n\t\t[ onToggleInsertionPoint, setHoveredItem ]\n\t);\n\n\tconst onClickPatternCategory = useCallback(\n\t\t( patternCategory, filter ) => {\n\t\t\tsetSelectedPatternCategory( patternCategory );\n\t\t\tsetPatternFilter( filter );\n\t\t\tonPatternCategorySelection?.();\n\t\t},\n\t\t[ setSelectedPatternCategory, onPatternCategorySelection ]\n\t);\n\n\tconst showPatternPanel =\n\t\tselectedTab === 'patterns' &&\n\t\t! delayedFilterValue &&\n\t\t!! selectedPatternCategory;\n\n\tconst showMediaPanel = selectedTab === 'media' && !! selectedMediaCategory;\n\n\tconst inserterSearch = useMemo( () => {\n\t\tif ( selectedTab === 'media' ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<SearchControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tclassName=\"block-editor-inserter__search\"\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\tif ( hoveredItem ) {\n\t\t\t\t\t\t\tsetHoveredItem( null );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetFilterValue( value );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ filterValue }\n\t\t\t\t\tlabel={ __( 'Search for blocks and patterns' ) }\n\t\t\t\t\tplaceholder={ __( 'Search' ) }\n\t\t\t\t/>\n\t\t\t\t{ !! delayedFilterValue && (\n\t\t\t\t\t<InserterSearchResults\n\t\t\t\t\t\tfilterValue={ delayedFilterValue }\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tisAppender={ isAppender }\n\t\t\t\t\t\t__experimentalInsertionIndex={\n\t\t\t\t\t\t\t__experimentalInsertionIndex\n\t\t\t\t\t\t}\n\t\t\t\t\t\tshowBlockDirectory\n\t\t\t\t\t\tshouldFocusBlock={ shouldFocusBlock }\n\t\t\t\t\t\tprioritizePatterns={ selectedTab === 'patterns' }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}, [\n\t\tselectedTab,\n\t\thoveredItem,\n\t\tsetHoveredItem,\n\t\tsetFilterValue,\n\t\tfilterValue,\n\t\tdelayedFilterValue,\n\t\tonSelect,\n\t\tonHover,\n\t\tshouldFocusBlock,\n\t\tclientId,\n\t\trootClientId,\n\t\t__experimentalInsertionIndex,\n\t\tisAppender,\n\t] );\n\n\tconst blocksTab = useMemo( () => {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div className=\"block-editor-inserter__block-list\">\n\t\t\t\t\t<BlockTypesTab\n\t\t\t\t\t\tref={ blockTypesTabRef }\n\t\t\t\t\t\trootClientId={ destinationRootClientId }\n\t\t\t\t\t\tonInsert={ onInsert }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\tshowMostUsedBlocks={ showMostUsedBlocks }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{ showInserterHelpPanel && (\n\t\t\t\t\t<div className=\"block-editor-inserter__tips\">\n\t\t\t\t\t\t<VisuallyHidden as=\"h2\">\n\t\t\t\t\t\t\t{ __( 'A tip for using the block editor' ) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t<Tips />\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}, [\n\t\tdestinationRootClientId,\n\t\tonInsert,\n\t\tonHover,\n\t\tshowMostUsedBlocks,\n\t\tshowInserterHelpPanel,\n\t] );\n\n\tconst patternsTab = useMemo( () => {\n\t\treturn (\n\t\t\t<BlockPatternsTab\n\t\t\t\trootClientId={ destinationRootClientId }\n\t\t\t\tonInsert={ onInsertPattern }\n\t\t\t\tonSelectCategory={ onClickPatternCategory }\n\t\t\t\tselectedCategory={ selectedPatternCategory }\n\t\t\t>\n\t\t\t\t{ showPatternPanel && (\n\t\t\t\t\t<PatternCategoryPreviews\n\t\t\t\t\t\trootClientId={ destinationRootClientId }\n\t\t\t\t\t\tonInsert={ onInsertPattern }\n\t\t\t\t\t\tcategory={ selectedPatternCategory }\n\t\t\t\t\t\tpatternFilter={ patternFilter }\n\t\t\t\t\t\tshowTitlesAsTooltip\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockPatternsTab>\n\t\t);\n\t}, [\n\t\tdestinationRootClientId,\n\t\tonInsertPattern,\n\t\tonClickPatternCategory,\n\t\tpatternFilter,\n\t\tselectedPatternCategory,\n\t\tshowPatternPanel,\n\t] );\n\n\tconst mediaTab = useMemo( () => {\n\t\treturn (\n\t\t\t<MediaTab\n\t\t\t\trootClientId={ destinationRootClientId }\n\t\t\t\tselectedCategory={ selectedMediaCategory }\n\t\t\t\tonSelectCategory={ setSelectedMediaCategory }\n\t\t\t\tonInsert={ onInsert }\n\t\t\t>\n\t\t\t\t{ showMediaPanel && (\n\t\t\t\t\t<MediaCategoryPanel\n\t\t\t\t\t\trootClientId={ destinationRootClientId }\n\t\t\t\t\t\tonInsert={ onInsert }\n\t\t\t\t\t\tcategory={ selectedMediaCategory }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</MediaTab>\n\t\t);\n\t}, [\n\t\tdestinationRootClientId,\n\t\tonInsert,\n\t\tselectedMediaCategory,\n\t\tsetSelectedMediaCategory,\n\t\tshowMediaPanel,\n\t] );\n\n\tconst handleSetSelectedTab = ( value ) => {\n\t\t// If no longer on patterns tab remove the category setting.\n\t\tif ( value !== 'patterns' ) {\n\t\t\tsetSelectedPatternCategory( null );\n\t\t}\n\t\tsetSelectedTab( value );\n\t};\n\n\t// Focus first active tab, if any\n\tconst tabsRef = useRef();\n\tuseLayoutEffect( () => {\n\t\tif ( tabsRef.current ) {\n\t\t\twindow.requestAnimationFrame( () => {\n\t\t\t\ttabsRef.current\n\t\t\t\t\t.querySelector( '[role=\"tab\"][aria-selected=\"true\"]' )\n\t\t\t\t\t?.focus();\n\t\t\t} );\n\t\t}\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( 'block-editor-inserter__menu', {\n\t\t\t\t'show-panel': showPatternPanel || showMediaPanel,\n\t\t\t\t'is-zoom-out': isZoomOutMode,\n\t\t\t} ) }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t<div className=\"block-editor-inserter__main-area\">\n\t\t\t\t<TabbedSidebar\n\t\t\t\t\tref={ tabsRef }\n\t\t\t\t\tonSelect={ handleSetSelectedTab }\n\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\tselectedTab={ selectedTab }\n\t\t\t\t\tcloseButtonLabel={ __( 'Close block inserter' ) }\n\t\t\t\t\ttabs={ [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'blocks',\n\t\t\t\t\t\t\ttitle: __( 'Blocks' ),\n\t\t\t\t\t\t\tpanel: (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ inserterSearch }\n\t\t\t\t\t\t\t\t\t{ selectedTab === 'blocks' &&\n\t\t\t\t\t\t\t\t\t\t! delayedFilterValue &&\n\t\t\t\t\t\t\t\t\t\tblocksTab }\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'patterns',\n\t\t\t\t\t\t\ttitle: __( 'Patterns' ),\n\t\t\t\t\t\t\tpanel: (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ inserterSearch }\n\t\t\t\t\t\t\t\t\t{ selectedTab === 'patterns' &&\n\t\t\t\t\t\t\t\t\t\t! delayedFilterValue &&\n\t\t\t\t\t\t\t\t\t\tpatternsTab }\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'media',\n\t\t\t\t\t\t\ttitle: __( 'Media' ),\n\t\t\t\t\t\t\tpanel: (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ inserterSearch }\n\t\t\t\t\t\t\t\t\t{ mediaTab }\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t] }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t{ showInserterHelpPanel && hoveredItem && (\n\t\t\t\t<Popover\n\t\t\t\t\tclassName=\"block-editor-inserter__preview-container__popover\"\n\t\t\t\t\tplacement=\"right-start\"\n\t\t\t\t\toffset={ 16 }\n\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\tanimate={ false }\n\t\t\t\t>\n\t\t\t\t\t<InserterPreviewPanel item={ hoveredItem } />\n\t\t\t\t</Popover>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport const PrivateInserterMenu = forwardRef( InserterMenu );\n\nfunction PublicInserterMenu( props, ref ) {\n\treturn (\n\t\t<PrivateInserterMenu\n\t\t\t{ ...props }\n\t\t\tonPatternCategorySelection={ NOOP }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( PublicInserterMenu );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,UAAU,EACVC,QAAQ,EACRC,WAAW,EACXC,OAAO,EACPC,MAAM,EACNC,eAAe,QACT,oBAAoB;AAC3B,SAASC,cAAc,EAAEC,aAAa,EAAEC,OAAO,QAAQ,uBAAuB;AAC9E,SAASC,EAAE,QAAQ,iBAAi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ExG,EAAE,CAAE,UAAW,CAAC;UACvByG,KAAK,eACJrF,KAAA,CAAAF,SAAA;YAAAgE,QAAA,GACGD,cAAc,EACd7B,WAAW,KAAK,UAAU,IAC3B,CAAEV,kBAAkB,IACpBmD,WAAW;UAAA,CACX;QAEJ,CAAC,EACD;UACCU,IAAI,EAAE,OAAO;UACbC,KAAK,EAAExG,EAAE,CAAE,OAAQ,CAAC;UACpByG,KAAK,eACJrF,KAAA,CAAAF,SAAA;YAAAgE,QAAA,GACGD,cAAc,EACdiB,QAAQ;UAAA,CACT;QAEJ,CAAC;MACC,CACH;IAAC,CACE,CAAC,EACJtE,qBAAqB,IAAIe,WAAW,iBACrC3B,IAAA,CAACjB,OAAO;MACPqF,SAAS,EAAC,mDAAmD;MAC7DsB,SAAS,EAAC,aAAa;MACvBC,MAAM,EAAG,EAAI;MACbC,YAAY,EAAG,KAAO;MACtBC,OAAO,EAAG,KAAO;MAAA3B,QAAA,eAEjBlE,IAAA,CAACZ,oBAAoB;QAACuE,IAAI,EAAGhC;MAAa,CAAE;IAAC,CACrC,CACT;EAAA,CACG,CAAC;AAER;AAEA,OAAO,MAAMmE,mBAAmB,GAAGvH,UAAU,CAAE+B,YAAa,CAAC;AAE7D,SAASyF,kBAAkBA,CAAEC,KAAK,EAAE5E,GAAG,EAAG;EACzC,oBACCpB,IAAA,CAAC8F,mBAAmB;IAAA,GACdE,KAAK;IACVhF,0BAA0B,EAAGX,IAAM;IACnCe,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ;AAEA,eAAe7C,UAAU,CAAEwH,kBAAmB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","forwardRef","useState","useCallback","useMemo","useRef","useLayoutEffect","VisuallyHidden","SearchControl","Popover","__","useDebouncedInput","useSelect","Tips","InserterPreviewPanel","BlockTypesTab","BlockPatternsTab","PatternCategoryPreviews","MediaTab","MediaCategoryPanel","InserterSearchResults","useInsertionPoint","store","blockEditorStore","TabbedSidebar","useZoomOut","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","NOOP","InserterMenu","rootClientId","clientId","isAppender","__experimentalInsertionIndex","onSelect","showInserterHelpPanel","showMostUsedBlocks","__experimentalFilterValue","shouldFocusBlock","onPatternCategorySelection","onClose","__experimentalInitialTab","__experimentalInitialCategory","ref","isZoomOutMode","select","__unstableGetEditorMode","filterValue","setFilterValue","delayedFilterValue","hoveredItem","setHoveredItem","selectedPatternCategory","setSelectedPatternCategory","patternFilter","setPatternFilter","selectedMediaCategory","setSelectedMediaCategory","getInitialTab","selectedTab","setSelectedTab","shouldUseZoomOut","destinationRootClientId","onInsertBlocks","onToggleInsertionPoint","insertionIndex","blockTypesTabRef","onInsert","blocks","meta","shouldForceFocusBlock","_rootClientId","window","requestAnimationFrame","current","contains","ownerDocument","activeElement","querySelector","focus","onInsertPattern","patternName","onHover","item","onClickPatternCategory","patternCategory","filter","showPatternPanel","showMediaPanel","inserterSearch","children","__nextHasNoMarginBottom","className","onChange","value","label","placeholder","showBlockDirectory","prioritizePatterns","blocksTab","as","patternsTab","onSelectCategory","selectedCategory","category","showTitlesAsTooltip","mediaTab","handleSetSelectedTab","tabsRef","closeButtonLabel","tabs","name","title","panel","placement","offset","focusOnMount","animate","PrivateInserterMenu","PublicInserterMenu","props"],"sources":["@wordpress/block-editor/src/components/inserter/menu.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tforwardRef,\n\tuseState,\n\tuseCallback,\n\tuseMemo,\n\tuseRef,\n\tuseLayoutEffect,\n} from '@wordpress/element';\nimport { VisuallyHidden, SearchControl, Popover } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDebouncedInput } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport Tips from './tips';\nimport InserterPreviewPanel from './preview-panel';\nimport BlockTypesTab from './block-types-tab';\nimport BlockPatternsTab from './block-patterns-tab';\nimport { PatternCategoryPreviews } from './block-patterns-tab/pattern-category-previews';\nimport { MediaTab, MediaCategoryPanel } from './media-tab';\nimport InserterSearchResults from './search-results';\nimport useInsertionPoint from './hooks/use-insertion-point';\nimport { store as blockEditorStore } from '../../store';\nimport TabbedSidebar from '../tabbed-sidebar';\nimport { useZoomOut } from '../../hooks/use-zoom-out';\n\nconst NOOP = () => {};\nfunction InserterMenu(\n\t{\n\t\trootClientId,\n\t\tclientId,\n\t\tisAppender,\n\t\t__experimentalInsertionIndex,\n\t\tonSelect,\n\t\tshowInserterHelpPanel,\n\t\tshowMostUsedBlocks,\n\t\t__experimentalFilterValue = '',\n\t\tshouldFocusBlock = true,\n\t\tonPatternCategorySelection,\n\t\tonClose,\n\t\t__experimentalInitialTab,\n\t\t__experimentalInitialCategory,\n\t},\n\tref\n) {\n\tconst isZoomOutMode = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).__unstableGetEditorMode() === 'zoom-out',\n\t\t[]\n\t);\n\tconst [ filterValue, setFilterValue, delayedFilterValue ] =\n\t\tuseDebouncedInput( __experimentalFilterValue );\n\tconst [ hoveredItem, setHoveredItem ] = useState( null );\n\tconst [ selectedPatternCategory, setSelectedPatternCategory ] = useState(\n\t\t__experimentalInitialCategory\n\t);\n\tconst [ patternFilter, setPatternFilter ] = useState( 'all' );\n\tconst [ selectedMediaCategory, setSelectedMediaCategory ] =\n\t\tuseState( null );\n\tfunction getInitialTab() {\n\t\tif ( __experimentalInitialTab ) {\n\t\t\treturn __experimentalInitialTab;\n\t\t}\n\n\t\tif ( isZoomOutMode ) {\n\t\t\treturn 'patterns';\n\t\t}\n\t}\n\tconst [ selectedTab, setSelectedTab ] = useState( getInitialTab() );\n\n\tconst shouldUseZoomOut =\n\t\tselectedTab === 'patterns' || selectedTab === 'media';\n\tuseZoomOut( shouldUseZoomOut );\n\n\tconst [ destinationRootClientId, onInsertBlocks, onToggleInsertionPoint ] =\n\t\tuseInsertionPoint( {\n\t\t\trootClientId,\n\t\t\tclientId,\n\t\t\tisAppender,\n\t\t\tinsertionIndex: __experimentalInsertionIndex,\n\t\t\tshouldFocusBlock,\n\t\t} );\n\tconst blockTypesTabRef = useRef();\n\n\tconst onInsert = useCallback(\n\t\t( blocks, meta, shouldForceFocusBlock, _rootClientId ) => {\n\t\t\tonInsertBlocks(\n\t\t\t\tblocks,\n\t\t\t\tmeta,\n\t\t\t\tshouldForceFocusBlock,\n\t\t\t\t_rootClientId\n\t\t\t);\n\t\t\tonSelect( blocks );\n\n\t\t\t// Check for focus loss due to filtering blocks by selected block type\n\t\t\twindow.requestAnimationFrame( () => {\n\t\t\t\tif (\n\t\t\t\t\t! shouldFocusBlock &&\n\t\t\t\t\t! blockTypesTabRef.current?.contains(\n\t\t\t\t\t\tref.current.ownerDocument.activeElement\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\t// There has been a focus loss, so focus the first button in the block types tab\n\t\t\t\t\tblockTypesTabRef.current?.querySelector( 'button' ).focus();\n\t\t\t\t}\n\t\t\t} );\n\t\t},\n\t\t[ onInsertBlocks, onSelect, shouldFocusBlock ]\n\t);\n\n\tconst onInsertPattern = useCallback(\n\t\t( blocks, patternName ) => {\n\t\t\tonToggleInsertionPoint( false );\n\t\t\tonInsertBlocks( blocks, { patternName } );\n\t\t\tonSelect();\n\t\t},\n\t\t[ onInsertBlocks, onSelect ]\n\t);\n\n\tconst onHover = useCallback(\n\t\t( item ) => {\n\t\t\tonToggleInsertionPoint( item );\n\t\t\tsetHoveredItem( item );\n\t\t},\n\t\t[ onToggleInsertionPoint, setHoveredItem ]\n\t);\n\n\tconst onClickPatternCategory = useCallback(\n\t\t( patternCategory, filter ) => {\n\t\t\tsetSelectedPatternCategory( patternCategory );\n\t\t\tsetPatternFilter( filter );\n\t\t\tonPatternCategorySelection?.();\n\t\t},\n\t\t[ setSelectedPatternCategory, onPatternCategorySelection ]\n\t);\n\n\tconst showPatternPanel =\n\t\tselectedTab === 'patterns' &&\n\t\t! delayedFilterValue &&\n\t\t!! selectedPatternCategory;\n\n\tconst showMediaPanel = selectedTab === 'media' && !! selectedMediaCategory;\n\n\tconst inserterSearch = useMemo( () => {\n\t\tif ( selectedTab === 'media' ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<SearchControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tclassName=\"block-editor-inserter__search\"\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\tif ( hoveredItem ) {\n\t\t\t\t\t\t\tsetHoveredItem( null );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetFilterValue( value );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ filterValue }\n\t\t\t\t\tlabel={ __( 'Search for blocks and patterns' ) }\n\t\t\t\t\tplaceholder={ __( 'Search' ) }\n\t\t\t\t/>\n\t\t\t\t{ !! delayedFilterValue && (\n\t\t\t\t\t<InserterSearchResults\n\t\t\t\t\t\tfilterValue={ delayedFilterValue }\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\tisAppender={ isAppender }\n\t\t\t\t\t\t__experimentalInsertionIndex={\n\t\t\t\t\t\t\t__experimentalInsertionIndex\n\t\t\t\t\t\t}\n\t\t\t\t\t\tshowBlockDirectory\n\t\t\t\t\t\tshouldFocusBlock={ shouldFocusBlock }\n\t\t\t\t\t\tprioritizePatterns={ selectedTab === 'patterns' }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}, [\n\t\tselectedTab,\n\t\thoveredItem,\n\t\tsetHoveredItem,\n\t\tsetFilterValue,\n\t\tfilterValue,\n\t\tdelayedFilterValue,\n\t\tonSelect,\n\t\tonHover,\n\t\tshouldFocusBlock,\n\t\tclientId,\n\t\trootClientId,\n\t\t__experimentalInsertionIndex,\n\t\tisAppender,\n\t] );\n\n\tconst blocksTab = useMemo( () => {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div className=\"block-editor-inserter__block-list\">\n\t\t\t\t\t<BlockTypesTab\n\t\t\t\t\t\tref={ blockTypesTabRef }\n\t\t\t\t\t\trootClientId={ destinationRootClientId }\n\t\t\t\t\t\tonInsert={ onInsert }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\tshowMostUsedBlocks={ showMostUsedBlocks }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{ showInserterHelpPanel && (\n\t\t\t\t\t<div className=\"block-editor-inserter__tips\">\n\t\t\t\t\t\t<VisuallyHidden as=\"h2\">\n\t\t\t\t\t\t\t{ __( 'A tip for using the block editor' ) }\n\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t<Tips />\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}, [\n\t\tdestinationRootClientId,\n\t\tonInsert,\n\t\tonHover,\n\t\tshowMostUsedBlocks,\n\t\tshowInserterHelpPanel,\n\t] );\n\n\tconst patternsTab = useMemo( () => {\n\t\treturn (\n\t\t\t<BlockPatternsTab\n\t\t\t\trootClientId={ destinationRootClientId }\n\t\t\t\tonInsert={ onInsertPattern }\n\t\t\t\tonSelectCategory={ onClickPatternCategory }\n\t\t\t\tselectedCategory={ selectedPatternCategory }\n\t\t\t>\n\t\t\t\t{ showPatternPanel && (\n\t\t\t\t\t<PatternCategoryPreviews\n\t\t\t\t\t\trootClientId={ destinationRootClientId }\n\t\t\t\t\t\tonInsert={ onInsertPattern }\n\t\t\t\t\t\tcategory={ selectedPatternCategory }\n\t\t\t\t\t\tpatternFilter={ patternFilter }\n\t\t\t\t\t\tshowTitlesAsTooltip\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockPatternsTab>\n\t\t);\n\t}, [\n\t\tdestinationRootClientId,\n\t\tonInsertPattern,\n\t\tonClickPatternCategory,\n\t\tpatternFilter,\n\t\tselectedPatternCategory,\n\t\tshowPatternPanel,\n\t] );\n\n\tconst mediaTab = useMemo( () => {\n\t\treturn (\n\t\t\t<MediaTab\n\t\t\t\trootClientId={ destinationRootClientId }\n\t\t\t\tselectedCategory={ selectedMediaCategory }\n\t\t\t\tonSelectCategory={ setSelectedMediaCategory }\n\t\t\t\tonInsert={ onInsert }\n\t\t\t>\n\t\t\t\t{ showMediaPanel && (\n\t\t\t\t\t<MediaCategoryPanel\n\t\t\t\t\t\trootClientId={ destinationRootClientId }\n\t\t\t\t\t\tonInsert={ onInsert }\n\t\t\t\t\t\tcategory={ selectedMediaCategory }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</MediaTab>\n\t\t);\n\t}, [\n\t\tdestinationRootClientId,\n\t\tonInsert,\n\t\tselectedMediaCategory,\n\t\tsetSelectedMediaCategory,\n\t\tshowMediaPanel,\n\t] );\n\n\tconst handleSetSelectedTab = ( value ) => {\n\t\t// If no longer on patterns tab remove the category setting.\n\t\tif ( value !== 'patterns' ) {\n\t\t\tsetSelectedPatternCategory( null );\n\t\t}\n\t\tsetSelectedTab( value );\n\t};\n\n\t// Focus first active tab, if any\n\tconst tabsRef = useRef();\n\tuseLayoutEffect( () => {\n\t\tif ( tabsRef.current ) {\n\t\t\twindow.requestAnimationFrame( () => {\n\t\t\t\ttabsRef.current\n\t\t\t\t\t.querySelector( '[role=\"tab\"][aria-selected=\"true\"]' )\n\t\t\t\t\t?.focus();\n\t\t\t} );\n\t\t}\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( 'block-editor-inserter__menu', {\n\t\t\t\t'show-panel': showPatternPanel || showMediaPanel,\n\t\t\t\t'is-zoom-out': isZoomOutMode,\n\t\t\t} ) }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t<div className=\"block-editor-inserter__main-area\">\n\t\t\t\t<TabbedSidebar\n\t\t\t\t\tref={ tabsRef }\n\t\t\t\t\tonSelect={ handleSetSelectedTab }\n\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\tselectedTab={ selectedTab }\n\t\t\t\t\tcloseButtonLabel={ __( 'Close block inserter' ) }\n\t\t\t\t\ttabs={ [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'blocks',\n\t\t\t\t\t\t\ttitle: __( 'Blocks' ),\n\t\t\t\t\t\t\tpanel: (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ inserterSearch }\n\t\t\t\t\t\t\t\t\t{ selectedTab === 'blocks' &&\n\t\t\t\t\t\t\t\t\t\t! delayedFilterValue &&\n\t\t\t\t\t\t\t\t\t\tblocksTab }\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'patterns',\n\t\t\t\t\t\t\ttitle: __( 'Patterns' ),\n\t\t\t\t\t\t\tpanel: (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ inserterSearch }\n\t\t\t\t\t\t\t\t\t{ selectedTab === 'patterns' &&\n\t\t\t\t\t\t\t\t\t\t! delayedFilterValue &&\n\t\t\t\t\t\t\t\t\t\tpatternsTab }\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tname: 'media',\n\t\t\t\t\t\t\ttitle: __( 'Media' ),\n\t\t\t\t\t\t\tpanel: (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ inserterSearch }\n\t\t\t\t\t\t\t\t\t{ mediaTab }\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t},\n\t\t\t\t\t] }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t{ showInserterHelpPanel && hoveredItem && (\n\t\t\t\t<Popover\n\t\t\t\t\tclassName=\"block-editor-inserter__preview-container__popover\"\n\t\t\t\t\tplacement=\"right-start\"\n\t\t\t\t\toffset={ 16 }\n\t\t\t\t\tfocusOnMount={ false }\n\t\t\t\t\tanimate={ false }\n\t\t\t\t>\n\t\t\t\t\t<InserterPreviewPanel item={ hoveredItem } />\n\t\t\t\t</Popover>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport const PrivateInserterMenu = forwardRef( InserterMenu );\n\nfunction PublicInserterMenu( props, ref ) {\n\treturn (\n\t\t<PrivateInserterMenu\n\t\t\t{ ...props }\n\t\t\tonPatternCategorySelection={ NOOP }\n\t\t\tref={ ref }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( PublicInserterMenu );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SACCC,UAAU,EACVC,QAAQ,EACRC,WAAW,EACXC,OAAO,EACPC,MAAM,EACNC,eAAe,QACT,oBAAoB;AAC3B,SAASC,cAAc,EAAEC,aAAa,EAAEC,OAAO,QAAQ,uBAAuB;AAC9E,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,IAAI,MAAM,QAAQ;AACzB,OAAOC,oBAAoB,MAAM,iBAAiB;AAClD,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,gBAAgB,MAAM,sBAAsB;AACnD,SAASC,uBAAuB,QAAQ,gDAAgD;AACxF,SAASC,QAAQ,EAAEC,kBAAkB,QAAQ,aAAa;AAC1D,OAAOC,qBAAqB,MAAM,kBAAkB;AACpD,OAAOC,iBAAiB,MAAM,6BAA6B;AAC3D,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,SAASC,UAAU,QAAQ,0BAA0B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,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C3B,IAAA,CAAClB,OAAO;MACPuF,SAAS,EAAC,mDAAmD;MAC7DsB,SAAS,EAAC,aAAa;MACvBC,MAAM,EAAG,EAAI;MACbC,YAAY,EAAG,KAAO;MACtBC,OAAO,EAAG,KAAO;MAAA3B,QAAA,eAEjBnE,IAAA,CAACb,oBAAoB;QAACyE,IAAI,EAAGjC;MAAa,CAAE;IAAC,CACrC,CACT;EAAA,CACG,CAAC;AAER;AAEA,OAAO,MAAMoE,mBAAmB,GAAGzH,UAAU,CAAEgC,YAAa,CAAC;AAE7D,SAAS0F,kBAAkBA,CAAEC,KAAK,EAAE7E,GAAG,EAAG;EACzC,oBACCpB,IAAA,CAAC+F,mBAAmB;IAAA,GACdE,KAAK;IACVjF,0BAA0B,EAAGX,IAAM;IACnCe,GAAG,EAAGA;EAAK,CACX,CAAC;AAEJ;AAEA,eAAe9C,UAAU,CAAE0H,kBAAmB,CAAC","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { Button, privateApis as componentsPrivateApis } from '@wordpress/components';
4
+ import { Icon, Tooltip, privateApis as componentsPrivateApis } from '@wordpress/components';
5
5
  import { store as preferencesStore } from '@wordpress/preferences';
6
6
  import { useSelect } from '@wordpress/data';
7
7
 
@@ -40,16 +40,19 @@ export default function InspectorControlsTabs({
40
40
  children: /*#__PURE__*/_jsxs(Tabs, {
41
41
  defaultTabId: initialTabName,
42
42
  children: [/*#__PURE__*/_jsx(Tabs.TabList, {
43
- children: tabs.map(tab => /*#__PURE__*/_jsx(Tabs.Tab, {
43
+ children: tabs.map(tab => showIconLabels ? /*#__PURE__*/_jsx(Tabs.Tab, {
44
44
  tabId: tab.name,
45
- render: /*#__PURE__*/_jsx(Button
46
- // TODO: Switch to `true` (40px size) if possible
47
- , {
48
- __next40pxDefaultSize: false,
49
- icon: !showIconLabels ? tab.icon : undefined,
50
- label: !showIconLabels ? tab.title : undefined,
45
+ className: tab.className,
46
+ children: tab.title
47
+ }, tab.name) : /*#__PURE__*/_jsx(Tooltip, {
48
+ text: tab.title,
49
+ children: /*#__PURE__*/_jsx(Tabs.Tab, {
50
+ tabId: tab.name,
51
51
  className: tab.className,
52
- children: showIconLabels && tab.title
52
+ "aria-label": tab.title,
53
+ children: /*#__PURE__*/_jsx(Icon, {
54
+ icon: tab.icon
55
+ })
53
56
  })
54
57
  }, tab.name))
55
58
  }), /*#__PURE__*/_jsx(Tabs.TabPanel, {
@@ -1 +1 @@
1
- {"version":3,"names":["Button","privateApis","componentsPrivateApis","store","preferencesStore","useSelect","TAB_SETTINGS","TAB_STYLES","TAB_LIST_VIEW","SettingsTab","StylesTab","InspectorControls","useIsListViewTabDisabled","unlock","jsx","_jsx","jsxs","_jsxs","Tabs","InspectorControlsTabs","blockName","clientId","hasBlockStyles","tabs","showIconLabels","select","get","initialTabName","name","undefined","className","children","defaultTabId","TabList","map","tab","Tab","tabId","render","__next40pxDefaultSize","icon","label","title","TabPanel","focusable","showAdvancedControls","Slot","group"],"sources":["@wordpress/block-editor/src/components/inspector-controls-tabs/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { TAB_SETTINGS, TAB_STYLES, TAB_LIST_VIEW } from './utils';\nimport SettingsTab from './settings-tab';\nimport StylesTab from './styles-tab';\nimport InspectorControls from '../inspector-controls';\nimport useIsListViewTabDisabled from './use-is-list-view-tab-disabled';\nimport { unlock } from '../../lock-unlock';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nexport default function InspectorControlsTabs( {\n\tblockName,\n\tclientId,\n\thasBlockStyles,\n\ttabs,\n} ) {\n\tconst showIconLabels = useSelect( ( select ) => {\n\t\treturn select( preferencesStore ).get( 'core', 'showIconLabels' );\n\t}, [] );\n\n\t// The tabs panel will mount before fills are rendered to the list view\n\t// slot. This means the list view tab isn't initially included in the\n\t// available tabs so the panel defaults selection to the settings tab\n\t// which at the time is the first tab. This check allows blocks known to\n\t// include the list view tab to set it as the tab selected by default.\n\tconst initialTabName = ! useIsListViewTabDisabled( blockName )\n\t\t? TAB_LIST_VIEW.name\n\t\t: undefined;\n\n\treturn (\n\t\t<div className=\"block-editor-block-inspector__tabs\">\n\t\t\t<Tabs defaultTabId={ initialTabName } key={ clientId }>\n\t\t\t\t<Tabs.TabList>\n\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\ttabId={ tab.name }\n\t\t\t\t\t\t\trender={\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t! showIconLabels ? tab.icon : undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\t! showIconLabels ? tab.title : undefined\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tclassName={ tab.className }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ showIconLabels && tab.title }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t</Tabs.TabList>\n\t\t\t\t<Tabs.TabPanel tabId={ TAB_SETTINGS.name } focusable={ false }>\n\t\t\t\t\t<SettingsTab showAdvancedControls={ !! blockName } />\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ TAB_STYLES.name } focusable={ false }>\n\t\t\t\t\t<StylesTab\n\t\t\t\t\t\tblockName={ blockName }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\t\t/>\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ TAB_LIST_VIEW.name } focusable={ false }>\n\t\t\t\t\t<InspectorControls.Slot group=\"list\" />\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs>\n\t\t</div>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,MAAM,EACNC,WAAW,IAAIC,qBAAqB,QAC9B,uBAAuB;AAC9B,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,YAAY,EAAEC,UAAU,EAAEC,aAAa,QAAQ,SAAS;AACjE,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,SAAS,MAAM,cAAc;AACpC,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,OAAOC,wBAAwB,MAAM,iCAAiC;AACtE,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE3C,MAAM;EAAEC;AAAK,CAAC,GAAGL,MAAM,CAAEX,qBAAsB,CAAC;AAEhD,eAAe,SAASiB,qBAAqBA,CAAE;EAC9CC,SAAS;EACTC,QAAQ;EACRC,cAAc;EACdC;AACD,CAAC,EAAG;EACH,MAAMC,cAAc,GAAGnB,SAAS,CAAIoB,MAAM,IAAM;IAC/C,OAAOA,MAAM,CAAErB,gBAAiB,CAAC,CAACsB,GAAG,CAAE,MAAM,EAAE,gBAAiB,CAAC;EAClE,CAAC,EAAE,EAAG,CAAC;;EAEP;EACA;EACA;EACA;EACA;EACA,MAAMC,cAAc,GAAG,CAAEf,wBAAwB,CAAEQ,SAAU,CAAC,GAC3DZ,aAAa,CAACoB,IAAI,GAClBC,SAAS;EAEZ,oBACCd,IAAA;IAAKe,SAAS,EAAC,oCA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,IAAI;UAACC,KAAK,EAAC;QAAM,CAAE;MAAC,CACzB,CAAC;IAAA,GApC2B1B,QAqCtC;EAAC,CACH,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["Icon","Tooltip","privateApis","componentsPrivateApis","store","preferencesStore","useSelect","TAB_SETTINGS","TAB_STYLES","TAB_LIST_VIEW","SettingsTab","StylesTab","InspectorControls","useIsListViewTabDisabled","unlock","jsx","_jsx","jsxs","_jsxs","Tabs","InspectorControlsTabs","blockName","clientId","hasBlockStyles","tabs","showIconLabels","select","get","initialTabName","name","undefined","className","children","defaultTabId","TabList","map","tab","Tab","tabId","title","text","icon","TabPanel","focusable","showAdvancedControls","Slot","group"],"sources":["@wordpress/block-editor/src/components/inspector-controls-tabs/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\tTooltip,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { TAB_SETTINGS, TAB_STYLES, TAB_LIST_VIEW } from './utils';\nimport SettingsTab from './settings-tab';\nimport StylesTab from './styles-tab';\nimport InspectorControls from '../inspector-controls';\nimport useIsListViewTabDisabled from './use-is-list-view-tab-disabled';\nimport { unlock } from '../../lock-unlock';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nexport default function InspectorControlsTabs( {\n\tblockName,\n\tclientId,\n\thasBlockStyles,\n\ttabs,\n} ) {\n\tconst showIconLabels = useSelect( ( select ) => {\n\t\treturn select( preferencesStore ).get( 'core', 'showIconLabels' );\n\t}, [] );\n\n\t// The tabs panel will mount before fills are rendered to the list view\n\t// slot. This means the list view tab isn't initially included in the\n\t// available tabs so the panel defaults selection to the settings tab\n\t// which at the time is the first tab. This check allows blocks known to\n\t// include the list view tab to set it as the tab selected by default.\n\tconst initialTabName = ! useIsListViewTabDisabled( blockName )\n\t\t? TAB_LIST_VIEW.name\n\t\t: undefined;\n\n\treturn (\n\t\t<div className=\"block-editor-block-inspector__tabs\">\n\t\t\t<Tabs defaultTabId={ initialTabName } key={ clientId }>\n\t\t\t\t<Tabs.TabList>\n\t\t\t\t\t{ tabs.map( ( tab ) =>\n\t\t\t\t\t\tshowIconLabels ? (\n\t\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\t\tkey={ tab.name }\n\t\t\t\t\t\t\t\ttabId={ tab.name }\n\t\t\t\t\t\t\t\tclassName={ tab.className }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ tab.title }\n\t\t\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<Tooltip text={ tab.title } key={ tab.name }>\n\t\t\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\t\t\ttabId={ tab.name }\n\t\t\t\t\t\t\t\t\tclassName={ tab.className }\n\t\t\t\t\t\t\t\t\taria-label={ tab.title }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Icon icon={ tab.icon } />\n\t\t\t\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t)\n\t\t\t\t\t) }\n\t\t\t\t</Tabs.TabList>\n\t\t\t\t<Tabs.TabPanel tabId={ TAB_SETTINGS.name } focusable={ false }>\n\t\t\t\t\t<SettingsTab showAdvancedControls={ !! blockName } />\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ TAB_STYLES.name } focusable={ false }>\n\t\t\t\t\t<StylesTab\n\t\t\t\t\t\tblockName={ blockName }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\thasBlockStyles={ hasBlockStyles }\n\t\t\t\t\t/>\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ TAB_LIST_VIEW.name } focusable={ false }>\n\t\t\t\t\t<InspectorControls.Slot group=\"list\" />\n\t\t\t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MAAC,CACzB,CAAC;IAAA,GApC2BxB,QAqCtC;EAAC,CACH,CAAC;AAER","ignoreList":[]}
@@ -26,20 +26,16 @@ export default function InspectorPopoverHeader({
26
26
  label,
27
27
  icon,
28
28
  onClick
29
- }) => /*#__PURE__*/_jsx(Button
30
- // TODO: Switch to `true` (40px size) if possible
31
- , {
32
- __next40pxDefaultSize: false,
29
+ }) => /*#__PURE__*/_jsx(Button, {
30
+ size: "small",
33
31
  className: "block-editor-inspector-popover-header__action",
34
32
  label: label,
35
33
  icon: icon,
36
34
  variant: !icon && 'tertiary',
37
35
  onClick: onClick,
38
36
  children: !icon && label
39
- }, label)), onClose && /*#__PURE__*/_jsx(Button
40
- // TODO: Switch to `true` (40px size) if possible
41
- , {
42
- __next40pxDefaultSize: false,
37
+ }, label)), onClose && /*#__PURE__*/_jsx(Button, {
38
+ size: "small",
43
39
  className: "block-editor-inspector-popover-header__action",
44
40
  label: __('Close'),
45
41
  icon: closeSmall,
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalVStack","VStack","__experimentalHStack","HStack","__experimentalHeading","Heading","__experimentalSpacer","Spacer","Button","__experimentalText","Text","closeSmall","__","jsx","_jsx","jsxs","_jsxs","InspectorPopoverHeader","title","help","actions","onClose","className","spacing","children","alignment","level","size","map","label","icon","onClick","__next40pxDefaultSize","variant"],"sources":["@wordpress/block-editor/src/components/inspector-popover-header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n\t__experimentalSpacer as Spacer,\n\tButton,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { closeSmall } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\nexport default function InspectorPopoverHeader( {\n\ttitle,\n\thelp,\n\tactions = [],\n\tonClose,\n} ) {\n\treturn (\n\t\t<VStack className=\"block-editor-inspector-popover-header\" spacing={ 4 }>\n\t\t\t<HStack alignment=\"center\">\n\t\t\t\t<Heading\n\t\t\t\t\tclassName=\"block-editor-inspector-popover-header__heading\"\n\t\t\t\t\tlevel={ 2 }\n\t\t\t\t\tsize={ 13 }\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</Heading>\n\t\t\t\t<Spacer />\n\t\t\t\t{ actions.map( ( { label, icon, onClick } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\tclassName=\"block-editor-inspector-popover-header__action\"\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tvariant={ ! icon && 'tertiary' }\n\t\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! icon && label }\n\t\t\t\t\t</Button>\n\t\t\t\t) ) }\n\t\t\t\t{ onClose && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\t// TODO: Switch to `true` (40px size) if possible\n\t\t\t\t\t\t__next40pxDefaultSize={ false }\n\t\t\t\t\t\tclassName=\"block-editor-inspector-popover-header__action\"\n\t\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t\t{ help && <Text>{ help }</Text> }\n\t\t</VStack>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,qBAAqB,IAAIC,OAAO,EAChCC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,EACNC,kBAAkB,IAAIC,IAAI,QACpB,uBAAuB;AAC9B,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;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Stack","__experimentalHeading","Heading","__experimentalSpacer","Spacer","Button","__experimentalText","Text","closeSmall","__","jsx","_jsx","jsxs","_jsxs","InspectorPopoverHeader","title","help","actions","onClose","className","spacing","children","alignment","level","size","map","label","icon","onClick","variant"],"sources":["@wordpress/block-editor/src/components/inspector-popover-header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n\t__experimentalSpacer as Spacer,\n\tButton,\n\t__experimentalText as Text,\n} from '@wordpress/components';\nimport { closeSmall } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\nexport default function InspectorPopoverHeader( {\n\ttitle,\n\thelp,\n\tactions = [],\n\tonClose,\n} ) {\n\treturn (\n\t\t<VStack className=\"block-editor-inspector-popover-header\" spacing={ 4 }>\n\t\t\t<HStack alignment=\"center\">\n\t\t\t\t<Heading\n\t\t\t\t\tclassName=\"block-editor-inspector-popover-header__heading\"\n\t\t\t\t\tlevel={ 2 }\n\t\t\t\t\tsize={ 13 }\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</Heading>\n\t\t\t\t<Spacer />\n\t\t\t\t{ actions.map( ( { label, icon, onClick } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tkey={ label }\n\t\t\t\t\t\tclassName=\"block-editor-inspector-popover-header__action\"\n\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\tvariant={ ! icon && 'tertiary' }\n\t\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! icon && label }\n\t\t\t\t\t</Button>\n\t\t\t\t) ) }\n\t\t\t\t{ onClose && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tclassName=\"block-editor-inspector-popover-header__action\"\n\t\t\t\t\t\tlabel={ __( 'Close' ) }\n\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QAAA,EAEjB,CAAEM,IAAI,IAAID;MAAK,GAPXA,KAQC,CACP,CAAC,EACDR,OAAO,iBACRP,IAAA,CAACN,MAAM;QACNmB,IAAI,EAAC,OAAO;QACZL,SAAS,EAAC,+CAA+C;QACzDO,KAAK,EAAGjB,EAAE,CAAE,OAAQ,CAAG;QACvBkB,IAAI,EAAGnB,UAAY;QACnBoB,OAAO,EAAGV;MAAS,CACnB,CACD;IAAA,CACM,CAAC,EACPF,IAAI,iBAAIL,IAAA,CAACJ,IAAI;MAAAc,QAAA,EAAGL;IAAI,CAAQ,CAAC;EAAA,CACxB,CAAC;AAEX","ignoreList":[]}
@@ -385,17 +385,13 @@ function LinkControl({
385
385
  }), showActions && /*#__PURE__*/_jsxs(HStack, {
386
386
  justify: "right",
387
387
  className: "block-editor-link-control__search-actions",
388
- children: [/*#__PURE__*/_jsx(Button
389
- // TODO: Switch to `true` (40px size) if possible
390
- , {
391
- __next40pxDefaultSize: false,
388
+ children: [/*#__PURE__*/_jsx(Button, {
389
+ __next40pxDefaultSize: true,
392
390
  variant: "tertiary",
393
391
  onClick: handleCancel,
394
392
  children: __('Cancel')
395
- }), /*#__PURE__*/_jsx(Button
396
- // TODO: Switch to `true` (40px size) if possible
397
- , {
398
- __next40pxDefaultSize: false,
393
+ }), /*#__PURE__*/_jsx(Button, {
394
+ __next40pxDefaultSize: true,
399
395
  variant: "primary",
400
396
  onClick: isDisabled ? noop : handleSubmit,
401
397
  className: "block-editor-link-control__search-submit",