@wordpress/block-editor 14.3.6 → 14.3.8

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 (117) hide show
  1. package/README.md +2 -2
  2. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +14 -6
  3. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  4. package/build/components/block-list/zoom-out-separator.js +10 -7
  5. package/build/components/block-list/zoom-out-separator.js.map +1 -1
  6. package/build/components/block-popover/index.js +1 -1
  7. package/build/components/block-popover/index.js.map +1 -1
  8. package/build/components/block-toolbar/index.js +28 -16
  9. package/build/components/block-toolbar/index.js.map +1 -1
  10. package/build/components/block-toolbar/use-has-block-toolbar.js +3 -3
  11. package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  12. package/build/components/block-tools/index.js +1 -6
  13. package/build/components/block-tools/index.js.map +1 -1
  14. package/build/components/block-tools/use-show-block-tools.js +4 -6
  15. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  16. package/build/components/block-tools/zoom-out-mode-inserters.js +22 -36
  17. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  18. package/build/components/iframe/index.js +40 -10
  19. package/build/components/iframe/index.js.map +1 -1
  20. package/build/components/inserter/block-patterns-tab/index.js +4 -0
  21. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  22. package/build/components/inserter/hooks/use-insertion-point.js +16 -4
  23. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  24. package/build/components/inserter/media-tab/media-tab.js +4 -0
  25. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  26. package/build/components/inserter/menu.js +5 -2
  27. package/build/components/inserter/menu.js.map +1 -1
  28. package/build/hooks/block-bindings.js +12 -1
  29. package/build/hooks/block-bindings.js.map +1 -1
  30. package/build/hooks/use-zoom-out.js +24 -16
  31. package/build/hooks/use-zoom-out.js.map +1 -1
  32. package/build/store/private-selectors.js +37 -2
  33. package/build/store/private-selectors.js.map +1 -1
  34. package/build/store/selectors.js +15 -8
  35. package/build/store/selectors.js.map +1 -1
  36. package/build/utils/dom.js +16 -1
  37. package/build/utils/dom.js.map +1 -1
  38. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +14 -6
  39. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  40. package/build-module/components/block-list/zoom-out-separator.js +10 -7
  41. package/build-module/components/block-list/zoom-out-separator.js.map +1 -1
  42. package/build-module/components/block-popover/index.js +1 -1
  43. package/build-module/components/block-popover/index.js.map +1 -1
  44. package/build-module/components/block-toolbar/index.js +30 -18
  45. package/build-module/components/block-toolbar/index.js.map +1 -1
  46. package/build-module/components/block-toolbar/use-has-block-toolbar.js +3 -3
  47. package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -1
  48. package/build-module/components/block-tools/index.js +1 -6
  49. package/build-module/components/block-tools/index.js.map +1 -1
  50. package/build-module/components/block-tools/use-show-block-tools.js +4 -6
  51. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  52. package/build-module/components/block-tools/zoom-out-mode-inserters.js +22 -36
  53. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  54. package/build-module/components/iframe/index.js +40 -10
  55. package/build-module/components/iframe/index.js.map +1 -1
  56. package/build-module/components/inserter/block-patterns-tab/index.js +5 -1
  57. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  58. package/build-module/components/inserter/hooks/use-insertion-point.js +16 -4
  59. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  60. package/build-module/components/inserter/media-tab/media-tab.js +5 -1
  61. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  62. package/build-module/components/inserter/menu.js +5 -2
  63. package/build-module/components/inserter/menu.js.map +1 -1
  64. package/build-module/hooks/block-bindings.js +13 -2
  65. package/build-module/hooks/block-bindings.js.map +1 -1
  66. package/build-module/hooks/use-zoom-out.js +24 -17
  67. package/build-module/hooks/use-zoom-out.js.map +1 -1
  68. package/build-module/store/private-selectors.js +35 -2
  69. package/build-module/store/private-selectors.js.map +1 -1
  70. package/build-module/store/selectors.js +15 -8
  71. package/build-module/store/selectors.js.map +1 -1
  72. package/build-module/utils/dom.js +16 -1
  73. package/build-module/utils/dom.js.map +1 -1
  74. package/build-style/content-rtl.css +14 -20
  75. package/build-style/content.css +14 -20
  76. package/build-style/style-rtl.css +28 -21
  77. package/build-style/style.css +28 -21
  78. package/build-types/utils/dom.d.ts.map +1 -1
  79. package/package.json +6 -6
  80. package/src/components/block-canvas/style.scss +1 -0
  81. package/src/components/block-list/content.scss +3 -2
  82. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +25 -4
  83. package/src/components/block-list/zoom-out-separator.js +8 -6
  84. package/src/components/block-popover/index.js +2 -2
  85. package/src/components/block-toolbar/index.js +37 -24
  86. package/src/components/block-toolbar/style.scss +10 -1
  87. package/src/components/block-toolbar/use-has-block-toolbar.js +19 -28
  88. package/src/components/block-tools/index.js +0 -9
  89. package/src/components/block-tools/style.scss +2 -26
  90. package/src/components/block-tools/use-show-block-tools.js +2 -10
  91. package/src/components/block-tools/zoom-out-mode-inserters.js +26 -50
  92. package/src/components/iframe/content.scss +16 -24
  93. package/src/components/iframe/index.js +53 -12
  94. package/src/components/iframe/style.scss +6 -5
  95. package/src/components/inserter/block-patterns-tab/index.js +6 -1
  96. package/src/components/inserter/hooks/use-insertion-point.js +23 -5
  97. package/src/components/inserter/media-tab/media-tab.js +6 -1
  98. package/src/components/inserter/menu.js +7 -1
  99. package/src/components/inserter/style.scss +6 -0
  100. package/src/components/rich-text/style.scss +5 -0
  101. package/src/hooks/block-bindings.js +40 -23
  102. package/src/hooks/use-zoom-out.js +36 -20
  103. package/src/store/private-selectors.js +40 -1
  104. package/src/store/selectors.js +16 -8
  105. package/src/style.scss +1 -0
  106. package/src/utils/dom.js +22 -2
  107. package/tsconfig.tsbuildinfo +1 -1
  108. package/build/components/block-tools/zoom-out-popover.js +0 -57
  109. package/build/components/block-tools/zoom-out-popover.js.map +0 -1
  110. package/build/components/block-tools/zoom-out-toolbar.js +0 -159
  111. package/build/components/block-tools/zoom-out-toolbar.js.map +0 -1
  112. package/build-module/components/block-tools/zoom-out-popover.js +0 -48
  113. package/build-module/components/block-tools/zoom-out-popover.js.map +0 -1
  114. package/build-module/components/block-tools/zoom-out-toolbar.js +0 -152
  115. package/build-module/components/block-tools/zoom-out-toolbar.js.map +0 -1
  116. package/src/components/block-tools/zoom-out-popover.js +0 -46
  117. package/src/components/block-tools/zoom-out-toolbar.js +0 -167
@@ -79,7 +79,9 @@ function useInsertionPoint( {
79
79
  getBlockRootClientId,
80
80
  getBlockIndex,
81
81
  getBlockOrder,
82
- } = select( blockEditorStore );
82
+ getSectionRootClientId,
83
+ __unstableGetEditorMode,
84
+ } = unlock( select( blockEditorStore ) );
83
85
  const selectedBlockClientId = getSelectedBlockClientId();
84
86
 
85
87
  let _destinationRootClientId = rootClientId;
@@ -92,10 +94,26 @@ function useInsertionPoint( {
92
94
  // Insert after a specific client ID.
93
95
  _destinationIndex = getBlockIndex( clientId );
94
96
  } else if ( ! isAppender && selectedBlockClientId ) {
95
- _destinationRootClientId = getBlockRootClientId(
96
- selectedBlockClientId
97
- );
98
- _destinationIndex = getBlockIndex( selectedBlockClientId ) + 1;
97
+ const sectionRootClientId = getSectionRootClientId();
98
+
99
+ // Avoids empty inserter when the selected block is acting
100
+ // as the "root".
101
+ // See https://github.com/WordPress/gutenberg/pull/66214.
102
+ if (
103
+ __unstableGetEditorMode() === 'zoom-out' &&
104
+ sectionRootClientId === selectedBlockClientId
105
+ ) {
106
+ _destinationRootClientId = sectionRootClientId;
107
+ _destinationIndex = getBlockOrder(
108
+ _destinationRootClientId
109
+ ).length;
110
+ } else {
111
+ _destinationRootClientId = getBlockRootClientId(
112
+ selectedBlockClientId
113
+ );
114
+ _destinationIndex =
115
+ getBlockIndex( selectedBlockClientId ) + 1;
116
+ }
99
117
  } else {
100
118
  // Insert at the end of the list.
101
119
  _destinationIndex = getBlockOrder(
@@ -4,7 +4,7 @@
4
4
  import { __ } from '@wordpress/i18n';
5
5
  import { useViewportMatch } from '@wordpress/compose';
6
6
  import { Button } from '@wordpress/components';
7
- import { useCallback, useMemo } from '@wordpress/element';
7
+ import { useCallback, useEffect, useMemo } from '@wordpress/element';
8
8
 
9
9
  /**
10
10
  * Internal dependencies
@@ -24,6 +24,7 @@ function MediaTab( {
24
24
  rootClientId,
25
25
  selectedCategory,
26
26
  onSelectCategory,
27
+ setHasCategories,
27
28
  onInsert,
28
29
  children,
29
30
  } ) {
@@ -49,6 +50,10 @@ function MediaTab( {
49
50
  [ mediaCategories ]
50
51
  );
51
52
 
53
+ useEffect( () => {
54
+ setHasCategories( !! categories.length );
55
+ }, [ categories, setHasCategories ] );
56
+
52
57
  if ( ! categories.length ) {
53
58
  return <InserterNoResults />;
54
59
  }
@@ -67,6 +67,8 @@ function InserterMenu(
67
67
  const [ patternFilter, setPatternFilter ] = useState( 'all' );
68
68
  const [ selectedMediaCategory, setSelectedMediaCategory ] =
69
69
  useState( null );
70
+
71
+ const [ hasCategories, setHasCategories ] = useState( true );
70
72
  function getInitialTab() {
71
73
  if ( __experimentalInitialTab ) {
72
74
  return __experimentalInitialTab;
@@ -146,10 +148,12 @@ function InserterMenu(
146
148
 
147
149
  const showPatternPanel =
148
150
  selectedTab === 'patterns' &&
151
+ hasCategories &&
149
152
  ! delayedFilterValue &&
150
153
  !! selectedPatternCategory;
151
154
 
152
- const showMediaPanel = selectedTab === 'media' && !! selectedMediaCategory;
155
+ const showMediaPanel =
156
+ selectedTab === 'media' && !! selectedMediaCategory && hasCategories;
153
157
 
154
158
  const inserterSearch = useMemo( () => {
155
159
  if ( selectedTab === 'media' ) {
@@ -242,6 +246,7 @@ function InserterMenu(
242
246
  onInsert={ onInsertPattern }
243
247
  onSelectCategory={ onClickPatternCategory }
244
248
  selectedCategory={ selectedPatternCategory }
249
+ setHasCategories={ setHasCategories }
245
250
  >
246
251
  { showPatternPanel && (
247
252
  <PatternCategoryPreviews
@@ -270,6 +275,7 @@ function InserterMenu(
270
275
  selectedCategory={ selectedMediaCategory }
271
276
  onSelectCategory={ setSelectedMediaCategory }
272
277
  onInsert={ onInsert }
278
+ setHasCategories={ setHasCategories }
273
279
  >
274
280
  { showMediaPanel && (
275
281
  <MediaCategoryPanel
@@ -123,6 +123,12 @@ $block-inserter-tabs-height: 44px;
123
123
  }
124
124
 
125
125
  .block-editor-inserter__panel-header {
126
+ // Use `position: relative` to ensure any absolute positioned child elements are
127
+ // positioned relative to the panel header.
128
+ // This makes the overflow rule of the panel work correctly, particularly when the
129
+ // `VisuallyHidden` component is used within the inserter UI.
130
+ position: relative;
131
+
126
132
  display: inline-flex;
127
133
  align-items: center;
128
134
  padding: $grid-unit-20 $grid-unit-20 0;
@@ -9,12 +9,17 @@
9
9
  margin-bottom: $grid-unit-10;
10
10
  box-shadow: none;
11
11
  outline: none;
12
+ border-radius: $radius-small;
12
13
  }
13
14
 
14
15
  .components-toolbar {
15
16
  border-radius: $radius-small;
16
17
  }
17
18
 
19
+ .components-toolbar-group {
20
+ background: none;
21
+ }
22
+
18
23
  .components-toolbar__control,
19
24
  .components-dropdown-menu__toggle {
20
25
  min-width: $block-toolbar-height;
@@ -5,6 +5,7 @@ import { __ } from '@wordpress/i18n';
5
5
  import {
6
6
  getBlockBindingsSource,
7
7
  getBlockBindingsSources,
8
+ getBlockType,
8
9
  } from '@wordpress/blocks';
9
10
  import {
10
11
  __experimentalItemGroup as ItemGroup,
@@ -29,6 +30,7 @@ import {
29
30
  import { unlock } from '../lock-unlock';
30
31
  import InspectorControls from '../components/inspector-controls';
31
32
  import BlockContext from '../components/block-context';
33
+ import { useBlockEditContext } from '../components/block-edit';
32
34
  import { useBlockBindingsUtils } from '../utils/block-bindings';
33
35
  import { store as blockEditorStore } from '../store';
34
36
 
@@ -50,9 +52,20 @@ const useToolsPanelDropdownMenuProps = () => {
50
52
  };
51
53
 
52
54
  function BlockBindingsPanelDropdown( { fieldsList, attribute, binding } ) {
55
+ const { clientId } = useBlockEditContext();
53
56
  const registeredSources = getBlockBindingsSources();
54
57
  const { updateBlockBindings } = useBlockBindingsUtils();
55
58
  const currentKey = binding?.args?.key;
59
+ const attributeType = useSelect(
60
+ ( select ) => {
61
+ const { name: blockName } =
62
+ select( blockEditorStore ).getBlock( clientId );
63
+ const _attributeType =
64
+ getBlockType( blockName ).attributes?.[ attribute ]?.type;
65
+ return _attributeType === 'rich-text' ? 'string' : _attributeType;
66
+ },
67
+ [ clientId, attribute ]
68
+ );
56
69
  return (
57
70
  <>
58
71
  { Object.entries( fieldsList ).map( ( [ name, fields ], i ) => (
@@ -63,29 +76,33 @@ function BlockBindingsPanelDropdown( { fieldsList, attribute, binding } ) {
63
76
  { registeredSources[ name ].label }
64
77
  </DropdownMenuV2.GroupLabel>
65
78
  ) }
66
- { Object.entries( fields ).map( ( [ key, args ] ) => (
67
- <DropdownMenuV2.RadioItem
68
- key={ key }
69
- onChange={ () =>
70
- updateBlockBindings( {
71
- [ attribute ]: {
72
- source: name,
73
- args: { key },
74
- },
75
- } )
76
- }
77
- name={ attribute + '-binding' }
78
- value={ key }
79
- checked={ key === currentKey }
80
- >
81
- <DropdownMenuV2.ItemLabel>
82
- { args?.label }
83
- </DropdownMenuV2.ItemLabel>
84
- <DropdownMenuV2.ItemHelpText>
85
- { args?.value }
86
- </DropdownMenuV2.ItemHelpText>
87
- </DropdownMenuV2.RadioItem>
88
- ) ) }
79
+ { Object.entries( fields )
80
+ .filter(
81
+ ( [ , args ] ) => args?.type === attributeType
82
+ )
83
+ .map( ( [ key, args ] ) => (
84
+ <DropdownMenuV2.RadioItem
85
+ key={ key }
86
+ onChange={ () =>
87
+ updateBlockBindings( {
88
+ [ attribute ]: {
89
+ source: name,
90
+ args: { key },
91
+ },
92
+ } )
93
+ }
94
+ name={ attribute + '-binding' }
95
+ value={ key }
96
+ checked={ key === currentKey }
97
+ >
98
+ <DropdownMenuV2.ItemLabel>
99
+ { args?.label }
100
+ </DropdownMenuV2.ItemLabel>
101
+ <DropdownMenuV2.ItemHelpText>
102
+ { args?.value }
103
+ </DropdownMenuV2.ItemHelpText>
104
+ </DropdownMenuV2.RadioItem>
105
+ ) ) }
89
106
  </DropdownMenuV2.Group>
90
107
  { i !== Object.keys( fieldsList ).length - 1 && (
91
108
  <DropdownMenuV2.Separator />
@@ -9,39 +9,55 @@ import { useEffect, useRef } from '@wordpress/element';
9
9
  */
10
10
  import { store as blockEditorStore } from '../store';
11
11
  import { unlock } from '../lock-unlock';
12
-
13
12
  /**
14
- * A hook used to set the zoomed out view, invoking the hook sets the mode.
13
+ * A hook used to set the editor mode to zoomed out mode, invoking the hook sets the mode.
15
14
  *
16
- * @param {boolean} zoomOut If we should zoom out or not.
15
+ * @param {boolean} zoomOut If we should enter into zoomOut mode or not
17
16
  */
18
17
  export function useZoomOut( zoomOut = true ) {
19
- const { setZoomLevel } = unlock( useDispatch( blockEditorStore ) );
20
- const { isZoomOut } = unlock( useSelect( blockEditorStore ) );
18
+ const { __unstableSetEditorMode, setZoomLevel } = unlock(
19
+ useDispatch( blockEditorStore )
20
+ );
21
+ const { __unstableGetEditorMode } = unlock( useSelect( blockEditorStore ) );
21
22
 
22
- const originalIsZoomOutRef = useRef( null );
23
+ const originalEditingModeRef = useRef( null );
24
+ const mode = __unstableGetEditorMode();
23
25
 
24
26
  useEffect( () => {
25
27
  // Only set this on mount so we know what to return to when we unmount.
26
- if ( ! originalIsZoomOutRef.current ) {
27
- originalIsZoomOutRef.current = isZoomOut();
28
+ if ( ! originalEditingModeRef.current ) {
29
+ originalEditingModeRef.current = mode;
28
30
  }
29
31
 
30
- // The effect opens the zoom-out view if we want it open and the canvas is not currently zoomed-out.
31
- if ( zoomOut && isZoomOut() === false ) {
32
+ return () => {
33
+ // We need to use __unstableGetEditorMode() here and not `mode`, as mode may not update on unmount
34
+ if (
35
+ __unstableGetEditorMode() === 'zoom-out' &&
36
+ __unstableGetEditorMode() !== originalEditingModeRef.current
37
+ ) {
38
+ __unstableSetEditorMode( originalEditingModeRef.current );
39
+ setZoomLevel( 100 );
40
+ }
41
+ };
42
+ }, [] );
43
+
44
+ // The effect opens the zoom-out view if we want it open and it's not currently in zoom-out mode.
45
+ useEffect( () => {
46
+ if ( zoomOut && mode !== 'zoom-out' ) {
47
+ __unstableSetEditorMode( 'zoom-out' );
32
48
  setZoomLevel( 50 );
33
49
  } else if (
34
50
  ! zoomOut &&
35
- isZoomOut() &&
36
- originalIsZoomOutRef.current !== isZoomOut()
51
+ __unstableGetEditorMode() === 'zoom-out' &&
52
+ originalEditingModeRef.current !== mode
37
53
  ) {
38
- setZoomLevel( originalIsZoomOutRef.current ? 50 : 100 );
54
+ __unstableSetEditorMode( originalEditingModeRef.current );
55
+ setZoomLevel( 100 );
39
56
  }
40
-
41
- return () => {
42
- if ( isZoomOut() && isZoomOut() !== originalIsZoomOutRef.current ) {
43
- setZoomLevel( originalIsZoomOutRef.current ? 50 : 100 );
44
- }
45
- };
46
- }, [ isZoomOut, setZoomLevel, zoomOut ] );
57
+ }, [
58
+ __unstableGetEditorMode,
59
+ __unstableSetEditorMode,
60
+ zoomOut,
61
+ setZoomLevel,
62
+ ] ); // Mode is deliberately excluded from the dependencies so that the effect does not run when mode changes.
47
63
  }
@@ -15,6 +15,8 @@ import {
15
15
  getBlockName,
16
16
  getTemplateLock,
17
17
  getClientIdsWithDescendants,
18
+ isNavigationMode,
19
+ __unstableGetEditorMode,
18
20
  } from './selectors';
19
21
  import {
20
22
  checkAllowListRecursive,
@@ -545,7 +547,7 @@ export const getBlockStyles = createSelector(
545
547
  * @return {boolean} Is zoom out mode enabled.
546
548
  */
547
549
  export function isZoomOutMode( state ) {
548
- return state.editorMode === 'zoom-out';
550
+ return __unstableGetEditorMode( state ) === 'zoom-out';
549
551
  }
550
552
 
551
553
  /**
@@ -580,3 +582,40 @@ export function getZoomLevel( state ) {
580
582
  export function isZoomOut( state ) {
581
583
  return getZoomLevel( state ) < 100;
582
584
  }
585
+
586
+ /**
587
+ * Retrieves the client ID of the parent section block.
588
+ *
589
+ * @param {Object} state Global application state.
590
+ * @param {string} clientId Client Id of the block.
591
+ *
592
+ * @return {?string} Client ID of the ancestor block that is content locking the block.
593
+ */
594
+ export const getParentSectionBlock = ( state, clientId ) => {
595
+ let current = clientId;
596
+ let result;
597
+ while ( ! result && ( current = state.blocks.parents.get( current ) ) ) {
598
+ if ( isSectionBlock( state, current ) ) {
599
+ result = current;
600
+ }
601
+ }
602
+ return result;
603
+ };
604
+
605
+ /**
606
+ * Retrieves the client ID is a content locking parent
607
+ *
608
+ * @param {Object} state Global application state.
609
+ * @param {string} clientId Client Id of the block.
610
+ *
611
+ * @return {boolean} Whether the block is a content locking parent.
612
+ */
613
+ export function isSectionBlock( state, clientId ) {
614
+ const sectionRootClientId = getSectionRootClientId( state );
615
+ const sectionClientIds = getBlockOrder( state, sectionRootClientId );
616
+ return (
617
+ getBlockName( state, clientId ) === 'core/block' ||
618
+ getTemplateLock( state, clientId ) === 'contentOnly' ||
619
+ ( isNavigationMode( state ) && sectionClientIds.includes( clientId ) )
620
+ );
621
+ }
@@ -2363,6 +2363,21 @@ const getAllowedPatternsDependants = ( select ) => ( state, rootClientId ) => [
2363
2363
  ...getInsertBlockTypeDependants( state, rootClientId ),
2364
2364
  ];
2365
2365
 
2366
+ const patternsWithParsedBlocks = new WeakMap();
2367
+ function enhancePatternWithParsedBlocks( pattern ) {
2368
+ let enhancedPattern = patternsWithParsedBlocks.get( pattern );
2369
+ if ( ! enhancedPattern ) {
2370
+ enhancedPattern = {
2371
+ ...pattern,
2372
+ get blocks() {
2373
+ return getParsedPattern( pattern ).blocks;
2374
+ },
2375
+ };
2376
+ patternsWithParsedBlocks.set( pattern, enhancedPattern );
2377
+ }
2378
+ return enhancedPattern;
2379
+ }
2380
+
2366
2381
  /**
2367
2382
  * Returns the list of allowed patterns for inner blocks children.
2368
2383
  *
@@ -2379,14 +2394,7 @@ export const __experimentalGetAllowedPatterns = createRegistrySelector(
2379
2394
  const { allowedBlockTypes } = getSettings( state );
2380
2395
  const parsedPatterns = patterns
2381
2396
  .filter( ( { inserter = true } ) => !! inserter )
2382
- .map( ( pattern ) => {
2383
- return {
2384
- ...pattern,
2385
- get blocks() {
2386
- return getParsedPattern( pattern ).blocks;
2387
- },
2388
- };
2389
- } );
2397
+ .map( enhancePatternWithParsedBlocks );
2390
2398
 
2391
2399
  const availableParsedPatterns = parsedPatterns.filter(
2392
2400
  ( pattern ) =>
package/src/style.scss CHANGED
@@ -30,6 +30,7 @@
30
30
  @import "./components/global-styles/style.scss";
31
31
  @import "./components/grid/style.scss";
32
32
  @import "./components/height-control/style.scss";
33
+ @import "./components/iframe/style.scss";
33
34
  @import "./components/image-size-control/style.scss";
34
35
  @import "./components/inserter-list-item/style.scss";
35
36
  @import "./components/inspector-controls-tabs/style.scss";
package/src/utils/dom.js CHANGED
@@ -118,6 +118,22 @@ function isElementVisible( element ) {
118
118
  return true;
119
119
  }
120
120
 
121
+ /**
122
+ * Checks if the element is scrollable.
123
+ *
124
+ * @param {Element} element Element.
125
+ * @return {boolean} True if the element is scrollable.
126
+ */
127
+ function isScrollable( element ) {
128
+ const style = window.getComputedStyle( element );
129
+ return (
130
+ style.overflowX === 'auto' ||
131
+ style.overflowX === 'scroll' ||
132
+ style.overflowY === 'auto' ||
133
+ style.overflowY === 'scroll'
134
+ );
135
+ }
136
+
121
137
  /**
122
138
  * Returns the rect of the element including all visible nested elements.
123
139
  *
@@ -136,19 +152,23 @@ function isElementVisible( element ) {
136
152
  */
137
153
  export function getVisibleElementBounds( element ) {
138
154
  const viewport = element.ownerDocument.defaultView;
155
+
139
156
  if ( ! viewport ) {
140
157
  return new window.DOMRectReadOnly();
141
158
  }
142
159
 
143
160
  let bounds = element.getBoundingClientRect();
144
-
145
161
  const stack = [ element ];
146
162
  let currentElement;
147
163
 
148
164
  while ( ( currentElement = stack.pop() ) ) {
149
165
  for ( const child of currentElement.children ) {
150
166
  if ( isElementVisible( child ) ) {
151
- const childBounds = child.getBoundingClientRect();
167
+ let childBounds = child.getBoundingClientRect();
168
+ // If the parent is scrollable, use parent's scrollable bounds.
169
+ if ( isScrollable( currentElement ) ) {
170
+ childBounds = currentElement.getBoundingClientRect();
171
+ }
152
172
  bounds = rectUnion( bounds, childBounds );
153
173
  stack.push( child );
154
174
  }
@@ -1 +1 @@
1
- {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.string.d.ts","../../node_modules/typescript/lib/lib.esnext.promise.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.object.d.ts","../../node_modules/typescript/lib/lib.esnext.regexp.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/react/index.d.ts","../element/build-types/create-interpolate-element.d.ts","../element/build-types/react.d.ts","../../node_modules/@types/react-dom/index.d.ts","../../node_modules/@types/react-dom/client.d.ts","../element/build-types/react-platform.d.ts","../element/build-types/utils.d.ts","../element/build-types/platform.d.ts","../element/build-types/serialize.d.ts","../element/build-types/raw-html.d.ts","../element/build-types/index.d.ts","./src/components/block-context/index.js","./src/utils/dom.js"],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","17edc026abf73c5c2dd508652d63f68ec4efd9d4856e3469890d27598209feb5",{"version":"4af6b0c727b7a2896463d512fafd23634229adf69ac7c00e2ae15a09cb084fad","affectsGlobalScope":true},{"version":"9c00a480825408b6a24c63c1b71362232927247595d7c97659bc24dc68ae0757","affectsGlobalScope":true},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true},{"version":"ae37d6ccd1560b0203ab88d46987393adaaa78c919e51acf32fb82c86502e98c","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"479553e3779be7d4f68e9f40cdb82d038e5ef7592010100410723ceced22a0f7","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"d3d7b04b45033f57351c8434f60b6be1ea71a2dfec2d0a0c3c83badbb0e3e693","affectsGlobalScope":true},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true},{"version":"08a58483392df5fcc1db57d782e87734f77ae9eab42516028acbfe46f29a3ef7","affectsGlobalScope":true},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true},{"version":"0b11f3ca66aa33124202c80b70cd203219c3d4460cfc165e0707aa9ec710fc53","affectsGlobalScope":true},{"version":"6a3f5a0129cc80cf439ab71164334d649b47059a4f5afca90282362407d0c87f","affectsGlobalScope":true},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true},{"version":"15b98a533864d324e5f57cd3cfc0579b231df58c1c0f6063ea0fcb13c3c74ff9","affectsGlobalScope":true},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"55461596dc873b866911ef4e640fae4c39da7ac1fbc7ef5e649cb2f2fb42c349","affectsGlobalScope":true},"4c68749a564a6facdf675416d75789ee5a557afda8960e0803cf6711fa569288","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380",{"version":"8ca4709dbd22a34bcc1ebf93e1877645bdb02ebd3f3d9a211a299a8db2ee4ba1","affectsGlobalScope":true},"4c506b14512049dfe6f4ceb172b13c6af03663f85ba61fc57efbe6c2e7be9f44","4405cd67ec5f7f748fd793be0ce5842fa0808955b8e37518c011abfa5ab63ba5","adb17fea4d847e1267ae1241fa1ac3917c7e332999ebdab388a24d82d4f58240","05321b823dd3781d0b6aac8700bfdc0c9181d56479fe52ba6a40c9196fd661a8","472c14cdec534a465e866b6e1feee2d4e0d89c15fdc33ba80ff034fa0e80f3c1","4d807d55c784b72f71c092c34c84d09b95c29500c30252538fd5cf9a0a788c0e","df43a3968118d4b16618d7a0ac8ba89337fcce3c39e39984087ac34bf0cf250c","4714d89e7ea47b8f79a4d448a11674b2a724f93ab03cfa6879dafbab0f0c5a15","cb9a03b327570c1eae5c82a48604ef697ad1a6264ed0490743a3449de61a4fff","af88a0b0f808a6721401550621bfe67c46c6fd55000305058e7c73600d119a9b",{"version":"0a41b61ddcb640fa2a07cb7a04ecddf540b8199f70d3cf5f2d8903be722529eb","signature":"3dd80666c91b4c1ddb04cbf93038f90420af9bc18d7978acb4b9d7a302238f19"},{"version":"053d5d92994900db287f79816c0d58251f4f0718ba9a9d454a8545ea25f3d72d","signature":"f6104a0c5a67150c41196a7cc40a44078eabbbc89d0bb46470f3773679395241"}],"root":[88,89],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"rootDir":"./src","skipDefaultLibCheck":true,"strict":true,"target":99},"fileIdsList":[[77],[74,75,76],[77,87],[78,79,82,83,84,85,86],[80,81]],"referencedMap":[[81,1],[80,1],[77,2],[88,3],[78,1],[87,4],[86,1],[82,5],[79,1],[85,1]],"latestChangedDtsFile":"./build-types/utils/dom.d.ts"},"version":"5.5.3"}
1
+ {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.string.d.ts","../../node_modules/typescript/lib/lib.esnext.promise.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.object.d.ts","../../node_modules/typescript/lib/lib.esnext.regexp.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/react/index.d.ts","../element/build-types/create-interpolate-element.d.ts","../element/build-types/react.d.ts","../../node_modules/@types/react-dom/index.d.ts","../../node_modules/@types/react-dom/client.d.ts","../element/build-types/react-platform.d.ts","../element/build-types/utils.d.ts","../element/build-types/platform.d.ts","../element/build-types/serialize.d.ts","../element/build-types/raw-html.d.ts","../element/build-types/index.d.ts","./src/components/block-context/index.js","./src/utils/dom.js"],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","17edc026abf73c5c2dd508652d63f68ec4efd9d4856e3469890d27598209feb5",{"version":"4af6b0c727b7a2896463d512fafd23634229adf69ac7c00e2ae15a09cb084fad","affectsGlobalScope":true},{"version":"9c00a480825408b6a24c63c1b71362232927247595d7c97659bc24dc68ae0757","affectsGlobalScope":true},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true},{"version":"ae37d6ccd1560b0203ab88d46987393adaaa78c919e51acf32fb82c86502e98c","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"479553e3779be7d4f68e9f40cdb82d038e5ef7592010100410723ceced22a0f7","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"d3d7b04b45033f57351c8434f60b6be1ea71a2dfec2d0a0c3c83badbb0e3e693","affectsGlobalScope":true},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true},{"version":"08a58483392df5fcc1db57d782e87734f77ae9eab42516028acbfe46f29a3ef7","affectsGlobalScope":true},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true},{"version":"0b11f3ca66aa33124202c80b70cd203219c3d4460cfc165e0707aa9ec710fc53","affectsGlobalScope":true},{"version":"6a3f5a0129cc80cf439ab71164334d649b47059a4f5afca90282362407d0c87f","affectsGlobalScope":true},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true},{"version":"15b98a533864d324e5f57cd3cfc0579b231df58c1c0f6063ea0fcb13c3c74ff9","affectsGlobalScope":true},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"55461596dc873b866911ef4e640fae4c39da7ac1fbc7ef5e649cb2f2fb42c349","affectsGlobalScope":true},"4c68749a564a6facdf675416d75789ee5a557afda8960e0803cf6711fa569288","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380",{"version":"8ca4709dbd22a34bcc1ebf93e1877645bdb02ebd3f3d9a211a299a8db2ee4ba1","affectsGlobalScope":true},"4c506b14512049dfe6f4ceb172b13c6af03663f85ba61fc57efbe6c2e7be9f44","4405cd67ec5f7f748fd793be0ce5842fa0808955b8e37518c011abfa5ab63ba5","adb17fea4d847e1267ae1241fa1ac3917c7e332999ebdab388a24d82d4f58240","05321b823dd3781d0b6aac8700bfdc0c9181d56479fe52ba6a40c9196fd661a8","472c14cdec534a465e866b6e1feee2d4e0d89c15fdc33ba80ff034fa0e80f3c1","4d807d55c784b72f71c092c34c84d09b95c29500c30252538fd5cf9a0a788c0e","df43a3968118d4b16618d7a0ac8ba89337fcce3c39e39984087ac34bf0cf250c","4714d89e7ea47b8f79a4d448a11674b2a724f93ab03cfa6879dafbab0f0c5a15","cb9a03b327570c1eae5c82a48604ef697ad1a6264ed0490743a3449de61a4fff","af88a0b0f808a6721401550621bfe67c46c6fd55000305058e7c73600d119a9b",{"version":"0a41b61ddcb640fa2a07cb7a04ecddf540b8199f70d3cf5f2d8903be722529eb","signature":"3dd80666c91b4c1ddb04cbf93038f90420af9bc18d7978acb4b9d7a302238f19"},{"version":"f531fb882daf97b248456e8f3d645c7dd6d6cfba9da6bf725bf54da02d21ae52","signature":"f6104a0c5a67150c41196a7cc40a44078eabbbc89d0bb46470f3773679395241"}],"root":[88,89],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"rootDir":"./src","skipDefaultLibCheck":true,"strict":true,"target":99},"fileIdsList":[[77],[74,75,76],[77,87],[78,79,82,83,84,85,86],[80,81]],"referencedMap":[[81,1],[80,1],[77,2],[88,3],[78,1],[87,4],[86,1],[82,5],[79,1],[85,1]],"latestChangedDtsFile":"./build-types/utils/dom.d.ts"},"version":"5.5.3"}
@@ -1,57 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = ZoomOutPopover;
8
- var _clsx = _interopRequireDefault(require("clsx"));
9
- var _blockPopover = _interopRequireDefault(require("../block-popover"));
10
- var _useBlockToolbarPopoverProps = _interopRequireDefault(require("./use-block-toolbar-popover-props"));
11
- var _useSelectedBlockToolProps = _interopRequireDefault(require("./use-selected-block-tool-props"));
12
- var _zoomOutToolbar = _interopRequireDefault(require("./zoom-out-toolbar"));
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- /**
15
- * External dependencies
16
- */
17
-
18
- /**
19
- * Internal dependencies
20
- */
21
-
22
- function ZoomOutPopover({
23
- clientId,
24
- __unstableContentRef
25
- }) {
26
- const {
27
- capturingClientId,
28
- isInsertionPointVisible,
29
- lastClientId
30
- } = (0, _useSelectedBlockToolProps.default)(clientId);
31
- const popoverProps = (0, _useBlockToolbarPopoverProps.default)({
32
- contentElement: __unstableContentRef?.current,
33
- clientId
34
- });
35
-
36
- // Override some of the popover props for the zoom-out toolbar.
37
- const props = {
38
- ...popoverProps,
39
- placement: 'left-start',
40
- flip: false,
41
- shift: true
42
- };
43
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockPopover.default, {
44
- clientId: capturingClientId || clientId,
45
- bottomClientId: lastClientId,
46
- className: (0, _clsx.default)('zoom-out-toolbar-popover', {
47
- 'is-insertion-point-visible': isInsertionPointVisible
48
- }),
49
- resize: false,
50
- ...props,
51
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_zoomOutToolbar.default, {
52
- __unstableContentRef: __unstableContentRef,
53
- clientId: clientId
54
- })
55
- });
56
- }
57
- //# sourceMappingURL=zoom-out-popover.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_blockPopover","_useBlockToolbarPopoverProps","_useSelectedBlockToolProps","_zoomOutToolbar","_jsxRuntime","ZoomOutPopover","clientId","__unstableContentRef","capturingClientId","isInsertionPointVisible","lastClientId","useSelectedBlockToolProps","popoverProps","useBlockToolbarPopoverProps","contentElement","current","props","placement","flip","shift","jsx","default","bottomClientId","className","clsx","resize","children"],"sources":["@wordpress/block-editor/src/components/block-tools/zoom-out-popover.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n/**\n * Internal dependencies\n */\nimport BlockPopover from '../block-popover';\nimport useBlockToolbarPopoverProps from './use-block-toolbar-popover-props';\nimport useSelectedBlockToolProps from './use-selected-block-tool-props';\nimport ZoomOutToolbar from './zoom-out-toolbar';\n\nexport default function ZoomOutPopover( { clientId, __unstableContentRef } ) {\n\tconst { capturingClientId, isInsertionPointVisible, lastClientId } =\n\t\tuseSelectedBlockToolProps( clientId );\n\n\tconst popoverProps = useBlockToolbarPopoverProps( {\n\t\tcontentElement: __unstableContentRef?.current,\n\t\tclientId,\n\t} );\n\n\t// Override some of the popover props for the zoom-out toolbar.\n\tconst props = {\n\t\t...popoverProps,\n\t\tplacement: 'left-start',\n\t\tflip: false,\n\t\tshift: true,\n\t};\n\n\treturn (\n\t\t<BlockPopover\n\t\t\tclientId={ capturingClientId || clientId }\n\t\t\tbottomClientId={ lastClientId }\n\t\t\tclassName={ clsx( 'zoom-out-toolbar-popover', {\n\t\t\t\t'is-insertion-point-visible': isInsertionPointVisible,\n\t\t\t} ) }\n\t\t\tresize={ false }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<ZoomOutToolbar\n\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\tclientId={ clientId }\n\t\t\t/>\n\t\t</BlockPopover>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,4BAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,0BAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,eAAA,GAAAL,sBAAA,CAAAC,OAAA;AAAgD,IAAAK,WAAA,GAAAL,OAAA;AAVhD;AACA;AACA;;AAEA;AACA;AACA;;AAMe,SAASM,cAAcA,CAAE;EAAEC,QAAQ;EAAEC;AAAqB,CAAC,EAAG;EAC5E,MAAM;IAAEC,iBAAiB;IAAEC,uBAAuB;IAAEC;EAAa,CAAC,GACjE,IAAAC,kCAAyB,EAAEL,QAAS,CAAC;EAEtC,MAAMM,YAAY,GAAG,IAAAC,oCAA2B,EAAE;IACjDC,cAAc,EAAEP,oBAAoB,EAAEQ,OAAO;IAC7CT;EACD,CAAE,CAAC;;EAEH;EACA,MAAMU,KAAK,GAAG;IACb,GAAGJ,YAAY;IACfK,SAAS,EAAE,YAAY;IACvBC,IAAI,EAAE,KAAK;IACXC,KAAK,EAAE;EACR,CAAC;EAED,oBACC,IAAAf,WAAA,CAAAgB,GAAA,EAACpB,aAAA,CAAAqB,OAAY;IACZf,QAAQ,EAAGE,iBAAiB,IAAIF,QAAU;IAC1CgB,cAAc,EAAGZ,YAAc;IAC/Ba,SAAS,EAAG,IAAAC,aAAI,EAAE,0BAA0B,EAAE;MAC7C,4BAA4B,EAAEf;IAC/B,CAAE,CAAG;IACLgB,MAAM,EAAG,KAAO;IAAA,GACXT,KAAK;IAAAU,QAAA,eAEV,IAAAtB,WAAA,CAAAgB,GAAA,EAACjB,eAAA,CAAAkB,OAAc;MACdd,oBAAoB,EAAGA,oBAAsB;MAC7CD,QAAQ,EAAGA;IAAU,CACrB;EAAC,CACW,CAAC;AAEjB","ignoreList":[]}