@wordpress/block-editor 14.21.1-next.719a03cbe.0 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/components/block-list/use-block-props/index.js +1 -3
  3. package/build/components/block-list/use-block-props/index.js.map +1 -1
  4. package/build/components/block-list/use-block-props/use-is-hovered.js +8 -25
  5. package/build/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  6. package/build/components/block-settings-menu/block-settings-dropdown.js +7 -4
  7. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  8. package/build/components/child-layout-control/index.js +53 -34
  9. package/build/components/child-layout-control/index.js.map +1 -1
  10. package/build/components/link-control/search-input.js +4 -2
  11. package/build/components/link-control/search-input.js.map +1 -1
  12. package/build/components/list-view/block.js +5 -4
  13. package/build/components/list-view/block.js.map +1 -1
  14. package/build/components/list-view/use-list-view-images.js +62 -30
  15. package/build/components/list-view/use-list-view-images.js.map +1 -1
  16. package/build/layouts/grid.js +2 -0
  17. package/build/layouts/grid.js.map +1 -1
  18. package/build/store/actions.js +7 -6
  19. package/build/store/actions.js.map +1 -1
  20. package/build/store/reducer.js +0 -18
  21. package/build/store/reducer.js.map +1 -1
  22. package/build/store/selectors.js +13 -9
  23. package/build/store/selectors.js.map +1 -1
  24. package/build-module/components/block-list/use-block-props/index.js +1 -3
  25. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  26. package/build-module/components/block-list/use-block-props/use-is-hovered.js +8 -26
  27. package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +1 -1
  28. package/build-module/components/block-settings-menu/block-settings-dropdown.js +7 -4
  29. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  30. package/build-module/components/child-layout-control/index.js +54 -35
  31. package/build-module/components/child-layout-control/index.js.map +1 -1
  32. package/build-module/components/link-control/search-input.js +4 -2
  33. package/build-module/components/link-control/search-input.js.map +1 -1
  34. package/build-module/components/list-view/block.js +6 -5
  35. package/build-module/components/list-view/block.js.map +1 -1
  36. package/build-module/components/list-view/use-list-view-images.js +62 -30
  37. package/build-module/components/list-view/use-list-view-images.js.map +1 -1
  38. package/build-module/layouts/grid.js +2 -0
  39. package/build-module/layouts/grid.js.map +1 -1
  40. package/build-module/store/actions.js +7 -6
  41. package/build-module/store/actions.js.map +1 -1
  42. package/build-module/store/reducer.js +0 -17
  43. package/build-module/store/reducer.js.map +1 -1
  44. package/build-module/store/selectors.js +12 -9
  45. package/build-module/store/selectors.js.map +1 -1
  46. package/build-style/style-rtl.css +46 -8
  47. package/build-style/style.css +46 -8
  48. package/package.json +34 -34
  49. package/src/components/block-list/use-block-props/index.js +1 -1
  50. package/src/components/block-list/use-block-props/use-is-hovered.js +12 -26
  51. package/src/components/block-lock/style.scss +10 -0
  52. package/src/components/block-settings-menu/block-settings-dropdown.js +4 -1
  53. package/src/components/block-variation-transforms/style.scss +7 -0
  54. package/src/components/border-radius-control/style.scss +5 -0
  55. package/src/components/child-layout-control/index.js +66 -42
  56. package/src/components/colors-gradients/style.scss +5 -0
  57. package/src/components/inserter-list-item/style.scss +9 -6
  58. package/src/components/link-control/search-input.js +9 -2
  59. package/src/components/link-control/style.scss +7 -0
  60. package/src/components/link-control/test/index.js +44 -44
  61. package/src/components/list-view/block.js +9 -5
  62. package/src/components/list-view/use-list-view-images.js +57 -36
  63. package/src/components/media-replace-flow/test/index.js +1 -1
  64. package/src/components/spacing-sizes-control/style.scss +5 -0
  65. package/src/hooks/layout.scss +8 -0
  66. package/src/layouts/grid.js +2 -2
  67. package/src/store/actions.js +7 -6
  68. package/src/store/reducer.js +0 -18
  69. package/src/store/selectors.js +29 -31
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 15.0.0 (2025-07-23)
6
+
7
+ ### Breaking Changes
8
+
9
+ - Store: Deprecate the block hovered global state and related action/selector ([#70731](https://github.com/WordPress/gutenberg/pull/70731))
10
+
5
11
  ## 14.21.0 (2025-06-25)
6
12
 
7
13
  ## 14.20.0 (2025-06-04)
@@ -120,9 +120,7 @@ function useBlockProps(props = {}, {
120
120
  }), (0, _useBlockRefs.useBlockRefProvider)(clientId), (0, _useFocusHandler.useFocusHandler)(clientId), (0, _useSelectedBlockEventHandlers.useEventHandlers)({
121
121
  clientId,
122
122
  isSelected
123
- }), (0, _useIsHovered.useIsHovered)({
124
- clientId
125
- }), (0, _useIntersectionObserver.useIntersectionObserver)(), (0, _useMovingAnimation.default)({
123
+ }), (0, _useIsHovered.useIsHovered)(), (0, _useIntersectionObserver.useIntersectionObserver)(), (0, _useMovingAnimation.default)({
126
124
  triggerAnimationOnChange: index,
127
125
  clientId
128
126
  }), (0, _compose.useDisabled)({
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_blocks","_compose","_warning","_useMovingAnimation","_privateBlockContext","_useFocusFirstElement","_useIsHovered","_context","_useFocusHandler","_useSelectedBlockEventHandlers","_useBlockRefs","_useIntersectionObserver","_useScrollIntoView","_useFlashEditableBlocks","_blockBindings","_useFirefoxDraggableCompatibility","useBlockProps","props","__unstableIsHtml","clientId","className","wrapperProps","isAligned","index","mode","name","blockApiVersion","blockTitle","isSelected","isSubtreeDisabled","hasOverlay","initialPosition","blockEditingMode","isHighlighted","isMultiSelected","isPartiallySelected","isReusable","isDragging","hasChildSelected","isEditingDisabled","hasEditableOutline","isTemporarilyEditingAsBlocks","defaultClassName","isSectionBlock","canMove","useContext","PrivateBlockContext","blockLabel","sprintf","__","htmlSuffix","ffDragRef","useFirefoxDraggableCompatibility","mergedRefs","useMergeRefs","ref","useFocusFirstElement","useBlockRefProvider","useFocusHandler","useEventHandlers","useIsHovered","useIntersectionObserver","useMovingAnimation","triggerAnimationOnChange","useDisabled","isDisabled","useFlashEditableBlocks","isEnabled","useScrollIntoView","undefined","blockEditContext","useBlockEditContext","hasBlockBindings","blockBindingsKey","bindingsStyle","canBindBlock","globalThis","SCRIPT_DEBUG","warning","hasNegativeMargin","style","marginTop","charAt","marginBottom","marginLeft","marginRight","tabIndex","draggable","id","role","inert","clsx","save","getBlockProps"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableGetBlockProps as getBlockProps } from '@wordpress/blocks';\nimport { useMergeRefs, useDisabled } from '@wordpress/compose';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport useMovingAnimation from '../../use-moving-animation';\nimport { PrivateBlockContext } from '../private-block-context';\nimport { useFocusFirstElement } from './use-focus-first-element';\nimport { useIsHovered } from './use-is-hovered';\nimport {\n\tblockBindingsKey,\n\tuseBlockEditContext,\n} from '../../block-edit/context';\nimport { useFocusHandler } from './use-focus-handler';\nimport { useEventHandlers } from './use-selected-block-event-handlers';\nimport { useBlockRefProvider } from './use-block-refs';\nimport { useIntersectionObserver } from './use-intersection-observer';\nimport { useScrollIntoView } from './use-scroll-into-view';\nimport { useFlashEditableBlocks } from '../../use-flash-editable-blocks';\nimport { canBindBlock } from '../../../utils/block-bindings';\nimport { useFirefoxDraggableCompatibility } from './use-firefox-draggable-compatibility';\n\n/**\n * This hook is used to lightly mark an element as a block element. The element\n * should be the outermost element of a block. Call this hook and pass the\n * returned props to the element to mark as a block. If you define a ref for the\n * element, it is important to pass the ref to this hook, which the hook in turn\n * will pass to the component through the props it returns. Optionally, you can\n * also pass any other props through this hook, and they will be merged and\n * returned.\n *\n * Use of this hook on the outermost element of a block is required if using API >= v2.\n *\n * @example\n * ```js\n * import { useBlockProps } from '@wordpress/block-editor';\n *\n * export default function Edit() {\n *\n * const blockProps = useBlockProps( {\n * className: 'my-custom-class',\n * style: {\n * color: '#222222',\n * backgroundColor: '#eeeeee'\n * }\n * } )\n *\n * return (\n *\t <div { ...blockProps }>\n *\n * </div>\n * )\n * }\n *\n * ```\n *\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Options for internal use only.\n * @param {boolean} options.__unstableIsHtml\n *\n * @return {Object} Props to pass to the element to mark as a block.\n */\nexport function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {\n\tconst {\n\t\tclientId,\n\t\tclassName,\n\t\twrapperProps = {},\n\t\tisAligned,\n\t\tindex,\n\t\tmode,\n\t\tname,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\tisSelected,\n\t\tisSubtreeDisabled,\n\t\thasOverlay,\n\t\tinitialPosition,\n\t\tblockEditingMode,\n\t\tisHighlighted,\n\t\tisMultiSelected,\n\t\tisPartiallySelected,\n\t\tisReusable,\n\t\tisDragging,\n\t\thasChildSelected,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tdefaultClassName,\n\t\tisSectionBlock,\n\t\tcanMove,\n\t} = useContext( PrivateBlockContext );\n\n\t// translators: %s: Type of block (i.e. Text, Image etc)\n\tconst blockLabel = sprintf( __( 'Block: %s' ), blockTitle );\n\tconst htmlSuffix = mode === 'html' && ! __unstableIsHtml ? '-visual' : '';\n\tconst ffDragRef = useFirefoxDraggableCompatibility();\n\tconst mergedRefs = useMergeRefs( [\n\t\tprops.ref,\n\t\tuseFocusFirstElement( { clientId, initialPosition } ),\n\t\tuseBlockRefProvider( clientId ),\n\t\tuseFocusHandler( clientId ),\n\t\tuseEventHandlers( { clientId, isSelected } ),\n\t\tuseIsHovered( { clientId } ),\n\t\tuseIntersectionObserver(),\n\t\tuseMovingAnimation( { triggerAnimationOnChange: index, clientId } ),\n\t\tuseDisabled( { isDisabled: ! hasOverlay } ),\n\t\tuseFlashEditableBlocks( {\n\t\t\tclientId,\n\t\t\tisEnabled: isSectionBlock,\n\t\t} ),\n\t\tuseScrollIntoView( { isSelected } ),\n\t\tcanMove ? ffDragRef : undefined,\n\t] );\n\n\tconst blockEditContext = useBlockEditContext();\n\tconst hasBlockBindings = !! blockEditContext[ blockBindingsKey ];\n\tconst bindingsStyle =\n\t\thasBlockBindings && canBindBlock( name )\n\t\t\t? {\n\t\t\t\t\t'--wp-admin-theme-color': 'var(--wp-block-synced-color)',\n\t\t\t\t\t'--wp-admin-theme-color--rgb':\n\t\t\t\t\t\t'var(--wp-block-synced-color--rgb)',\n\t\t\t }\n\t\t\t: {};\n\n\t// Ensures it warns only inside the `edit` implementation for the block.\n\tif ( blockApiVersion < 2 && clientId === blockEditContext.clientId ) {\n\t\twarning(\n\t\t\t`Block type \"${ name }\" must support API version 2 or higher to work correctly with \"useBlockProps\" method.`\n\t\t);\n\t}\n\n\tlet hasNegativeMargin = false;\n\tif (\n\t\twrapperProps?.style?.marginTop?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginBottom?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginLeft?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginRight?.charAt( 0 ) === '-'\n\t) {\n\t\thasNegativeMargin = true;\n\t}\n\n\treturn {\n\t\ttabIndex: blockEditingMode === 'disabled' ? -1 : 0,\n\t\tdraggable: canMove && ! hasChildSelected ? true : undefined,\n\t\t...wrapperProps,\n\t\t...props,\n\t\tref: mergedRefs,\n\t\tid: `block-${ clientId }${ htmlSuffix }`,\n\t\trole: 'document',\n\t\t'aria-label': blockLabel,\n\t\t'data-block': clientId,\n\t\t'data-type': name,\n\t\t'data-title': blockTitle,\n\t\tinert: isSubtreeDisabled ? 'true' : undefined,\n\t\tclassName: clsx(\n\t\t\t'block-editor-block-list__block',\n\t\t\t{\n\t\t\t\t// The wp-block className is important for editor styles.\n\t\t\t\t'wp-block': ! isAligned,\n\t\t\t\t'has-block-overlay': hasOverlay,\n\t\t\t\t'is-selected': isSelected,\n\t\t\t\t'is-highlighted': isHighlighted,\n\t\t\t\t'is-multi-selected': isMultiSelected,\n\t\t\t\t'is-partially-selected': isPartiallySelected,\n\t\t\t\t'is-reusable': isReusable,\n\t\t\t\t'is-dragging': isDragging,\n\t\t\t\t'has-child-selected': hasChildSelected,\n\t\t\t\t'is-editing-disabled': isEditingDisabled,\n\t\t\t\t'has-editable-outline': hasEditableOutline,\n\t\t\t\t'has-negative-margin': hasNegativeMargin,\n\t\t\t\t'is-content-locked-temporarily-editing-as-blocks':\n\t\t\t\t\tisTemporarilyEditingAsBlocks,\n\t\t\t},\n\t\t\tclassName,\n\t\t\tprops.className,\n\t\t\twrapperProps.className,\n\t\t\tdefaultClassName\n\t\t),\n\t\tstyle: { ...wrapperProps.style, ...props.style, ...bindingsStyle },\n\t};\n}\n\n/**\n * Call within a save function to get the props for the block wrapper.\n *\n * @param {Object} props Optional. Props to pass to the element.\n */\nuseBlockProps.save = getBlockProps;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAN,sBAAA,CAAAC,OAAA;AAKA,IAAAM,mBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,oBAAA,GAAAP,OAAA;AACA,IAAAQ,qBAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AAIA,IAAAW,gBAAA,GAAAX,OAAA;AACA,IAAAY,8BAAA,GAAAZ,OAAA;AACA,IAAAa,aAAA,GAAAb,OAAA;AACA,IAAAc,wBAAA,GAAAd,OAAA;AACA,IAAAe,kBAAA,GAAAf,OAAA;AACA,IAAAgB,uBAAA,GAAAhB,OAAA;AACA,IAAAiB,cAAA,GAAAjB,OAAA;AACA,IAAAkB,iCAAA,GAAAlB,OAAA;AAhCA;AACA;AAC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,CAAC+D,KAAK;MAAE,GAAGN;IAAc;EAClE,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA1D,aAAa,CAAC4E,IAAI,GAAGC,+BAAa","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_blocks","_compose","_warning","_useMovingAnimation","_privateBlockContext","_useFocusFirstElement","_useIsHovered","_context","_useFocusHandler","_useSelectedBlockEventHandlers","_useBlockRefs","_useIntersectionObserver","_useScrollIntoView","_useFlashEditableBlocks","_blockBindings","_useFirefoxDraggableCompatibility","useBlockProps","props","__unstableIsHtml","clientId","className","wrapperProps","isAligned","index","mode","name","blockApiVersion","blockTitle","isSelected","isSubtreeDisabled","hasOverlay","initialPosition","blockEditingMode","isHighlighted","isMultiSelected","isPartiallySelected","isReusable","isDragging","hasChildSelected","isEditingDisabled","hasEditableOutline","isTemporarilyEditingAsBlocks","defaultClassName","isSectionBlock","canMove","useContext","PrivateBlockContext","blockLabel","sprintf","__","htmlSuffix","ffDragRef","useFirefoxDraggableCompatibility","mergedRefs","useMergeRefs","ref","useFocusFirstElement","useBlockRefProvider","useFocusHandler","useEventHandlers","useIsHovered","useIntersectionObserver","useMovingAnimation","triggerAnimationOnChange","useDisabled","isDisabled","useFlashEditableBlocks","isEnabled","useScrollIntoView","undefined","blockEditContext","useBlockEditContext","hasBlockBindings","blockBindingsKey","bindingsStyle","canBindBlock","globalThis","SCRIPT_DEBUG","warning","hasNegativeMargin","style","marginTop","charAt","marginBottom","marginLeft","marginRight","tabIndex","draggable","id","role","inert","clsx","save","getBlockProps"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableGetBlockProps as getBlockProps } from '@wordpress/blocks';\nimport { useMergeRefs, useDisabled } from '@wordpress/compose';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport useMovingAnimation from '../../use-moving-animation';\nimport { PrivateBlockContext } from '../private-block-context';\nimport { useFocusFirstElement } from './use-focus-first-element';\nimport { useIsHovered } from './use-is-hovered';\nimport {\n\tblockBindingsKey,\n\tuseBlockEditContext,\n} from '../../block-edit/context';\nimport { useFocusHandler } from './use-focus-handler';\nimport { useEventHandlers } from './use-selected-block-event-handlers';\nimport { useBlockRefProvider } from './use-block-refs';\nimport { useIntersectionObserver } from './use-intersection-observer';\nimport { useScrollIntoView } from './use-scroll-into-view';\nimport { useFlashEditableBlocks } from '../../use-flash-editable-blocks';\nimport { canBindBlock } from '../../../utils/block-bindings';\nimport { useFirefoxDraggableCompatibility } from './use-firefox-draggable-compatibility';\n\n/**\n * This hook is used to lightly mark an element as a block element. The element\n * should be the outermost element of a block. Call this hook and pass the\n * returned props to the element to mark as a block. If you define a ref for the\n * element, it is important to pass the ref to this hook, which the hook in turn\n * will pass to the component through the props it returns. Optionally, you can\n * also pass any other props through this hook, and they will be merged and\n * returned.\n *\n * Use of this hook on the outermost element of a block is required if using API >= v2.\n *\n * @example\n * ```js\n * import { useBlockProps } from '@wordpress/block-editor';\n *\n * export default function Edit() {\n *\n * const blockProps = useBlockProps( {\n * className: 'my-custom-class',\n * style: {\n * color: '#222222',\n * backgroundColor: '#eeeeee'\n * }\n * } )\n *\n * return (\n *\t <div { ...blockProps }>\n *\n * </div>\n * )\n * }\n *\n * ```\n *\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Options for internal use only.\n * @param {boolean} options.__unstableIsHtml\n *\n * @return {Object} Props to pass to the element to mark as a block.\n */\nexport function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {\n\tconst {\n\t\tclientId,\n\t\tclassName,\n\t\twrapperProps = {},\n\t\tisAligned,\n\t\tindex,\n\t\tmode,\n\t\tname,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\tisSelected,\n\t\tisSubtreeDisabled,\n\t\thasOverlay,\n\t\tinitialPosition,\n\t\tblockEditingMode,\n\t\tisHighlighted,\n\t\tisMultiSelected,\n\t\tisPartiallySelected,\n\t\tisReusable,\n\t\tisDragging,\n\t\thasChildSelected,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tdefaultClassName,\n\t\tisSectionBlock,\n\t\tcanMove,\n\t} = useContext( PrivateBlockContext );\n\n\t// translators: %s: Type of block (i.e. Text, Image etc)\n\tconst blockLabel = sprintf( __( 'Block: %s' ), blockTitle );\n\tconst htmlSuffix = mode === 'html' && ! __unstableIsHtml ? '-visual' : '';\n\tconst ffDragRef = useFirefoxDraggableCompatibility();\n\tconst mergedRefs = useMergeRefs( [\n\t\tprops.ref,\n\t\tuseFocusFirstElement( { clientId, initialPosition } ),\n\t\tuseBlockRefProvider( clientId ),\n\t\tuseFocusHandler( clientId ),\n\t\tuseEventHandlers( { clientId, isSelected } ),\n\t\tuseIsHovered(),\n\t\tuseIntersectionObserver(),\n\t\tuseMovingAnimation( { triggerAnimationOnChange: index, clientId } ),\n\t\tuseDisabled( { isDisabled: ! hasOverlay } ),\n\t\tuseFlashEditableBlocks( {\n\t\t\tclientId,\n\t\t\tisEnabled: isSectionBlock,\n\t\t} ),\n\t\tuseScrollIntoView( { isSelected } ),\n\t\tcanMove ? ffDragRef : undefined,\n\t] );\n\n\tconst blockEditContext = useBlockEditContext();\n\tconst hasBlockBindings = !! blockEditContext[ blockBindingsKey ];\n\tconst bindingsStyle =\n\t\thasBlockBindings && canBindBlock( name )\n\t\t\t? {\n\t\t\t\t\t'--wp-admin-theme-color': 'var(--wp-block-synced-color)',\n\t\t\t\t\t'--wp-admin-theme-color--rgb':\n\t\t\t\t\t\t'var(--wp-block-synced-color--rgb)',\n\t\t\t }\n\t\t\t: {};\n\n\t// Ensures it warns only inside the `edit` implementation for the block.\n\tif ( blockApiVersion < 2 && clientId === blockEditContext.clientId ) {\n\t\twarning(\n\t\t\t`Block type \"${ name }\" must support API version 2 or higher to work correctly with \"useBlockProps\" method.`\n\t\t);\n\t}\n\n\tlet hasNegativeMargin = false;\n\tif (\n\t\twrapperProps?.style?.marginTop?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginBottom?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginLeft?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginRight?.charAt( 0 ) === '-'\n\t) {\n\t\thasNegativeMargin = true;\n\t}\n\n\treturn {\n\t\ttabIndex: blockEditingMode === 'disabled' ? -1 : 0,\n\t\tdraggable: canMove && ! hasChildSelected ? true : undefined,\n\t\t...wrapperProps,\n\t\t...props,\n\t\tref: mergedRefs,\n\t\tid: `block-${ clientId }${ htmlSuffix }`,\n\t\trole: 'document',\n\t\t'aria-label': blockLabel,\n\t\t'data-block': clientId,\n\t\t'data-type': name,\n\t\t'data-title': blockTitle,\n\t\tinert: isSubtreeDisabled ? 'true' : undefined,\n\t\tclassName: clsx(\n\t\t\t'block-editor-block-list__block',\n\t\t\t{\n\t\t\t\t// The wp-block className is important for editor styles.\n\t\t\t\t'wp-block': ! isAligned,\n\t\t\t\t'has-block-overlay': hasOverlay,\n\t\t\t\t'is-selected': isSelected,\n\t\t\t\t'is-highlighted': isHighlighted,\n\t\t\t\t'is-multi-selected': isMultiSelected,\n\t\t\t\t'is-partially-selected': isPartiallySelected,\n\t\t\t\t'is-reusable': isReusable,\n\t\t\t\t'is-dragging': isDragging,\n\t\t\t\t'has-child-selected': hasChildSelected,\n\t\t\t\t'is-editing-disabled': isEditingDisabled,\n\t\t\t\t'has-editable-outline': hasEditableOutline,\n\t\t\t\t'has-negative-margin': hasNegativeMargin,\n\t\t\t\t'is-content-locked-temporarily-editing-as-blocks':\n\t\t\t\t\tisTemporarilyEditingAsBlocks,\n\t\t\t},\n\t\t\tclassName,\n\t\t\tprops.className,\n\t\t\twrapperProps.className,\n\t\t\tdefaultClassName\n\t\t),\n\t\tstyle: { ...wrapperProps.style, ...props.style, ...bindingsStyle },\n\t};\n}\n\n/**\n * Call within a save function to get the props for the block wrapper.\n *\n * @param {Object} props Optional. Props to pass to the element.\n */\nuseBlockProps.save = getBlockProps;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAN,sBAAA,CAAAC,OAAA;AAKA,IAAAM,mBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,oBAAA,GAAAP,OAAA;AACA,IAAAQ,qBAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AAIA,IAAAW,gBAAA,GAAAX,OAAA;AACA,IAAAY,8BAAA,GAAAZ,OAAA;AACA,IAAAa,aAAA,GAAAb,OAAA;AACA,IAAAc,wBAAA,GAAAd,OAAA;AACA,IAAAe,kBAAA,GAAAf,OAAA;AACA,IAAAgB,uBAAA,GAAAhB,OAAA;AACA,IAAAiB,cAAA,GAAAjB,OAAA;AACA,IAAAkB,iCAAA,GAAAlB,OAAA;AAhCA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASmB,aAAaA,CAAEC,KAAK,GAAG,CAAC,CAAC,EAAE;EAAEC;AAAiB,CAAC,GAAG,CAAC,CAAC,EAAG;EACtE,MAAM;IACLC,QAAQ;IACRC,SAAS;IACTC,Y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SAAUrE,QAAQ,GAAK+B,UAAU,EAAG;IACxCuC,IAAI,EAAE,UAAU;IAChB,YAAY,EAAE1C,UAAU;IACxB,YAAY,EAAE5B,QAAQ;IACtB,WAAW,EAAEM,IAAI;IACjB,YAAY,EAAEE,UAAU;IACxB+D,KAAK,EAAE7D,iBAAiB,GAAG,MAAM,GAAGwC,SAAS;IAC7CjD,SAAS,EAAE,IAAAuE,aAAI,EACd,gCAAgC,EAChC;MACC;MACA,UAAU,EAAE,CAAErE,SAAS;MACvB,mBAAmB,EAAEQ,UAAU;MAC/B,aAAa,EAAEF,UAAU;MACzB,gBAAgB,EAAEK,aAAa;MAC/B,mBAAmB,EAAEC,eAAe;MACpC,uBAAuB,EAAEC,mBAAmB;MAC5C,aAAa,EAAEC,UAAU;MACzB,aAAa,EAAEC,UAAU;MACzB,oBAAoB,EAAEC,gBAAgB;MACtC,qBAAqB,EAAEC,iBAAiB;MACxC,sBAAsB,EAAEC,kBAAkB;MAC1C,qBAAqB,EAAEuC,iBAAiB;MACxC,iDAAiD,EAChDtC;IACF,CAAC,EACDrB,SAAS,EACTH,KAAK,CAACG,SAAS,EACfC,YAAY,CAACD,SAAS,EACtBsB,gBACD,CAAC;IACDsC,KAAK,EAAE;MAAE,GAAG3D,YAAY,CAAC2D,KAAK;MAAE,GAAG/D,KAAK,CAAC+D,KAAK;MAAE,GAAGN;IAAc;EAClE,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA1D,aAAa,CAAC4E,IAAI,GAAGC,+BAAa","ignoreList":[]}
@@ -5,39 +5,23 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useIsHovered = useIsHovered;
7
7
  var _compose = require("@wordpress/compose");
8
- var _data = require("@wordpress/data");
9
- var _store = require("../../../store");
10
8
  /**
11
9
  * WordPress dependencies
12
10
  */
13
11
 
14
- /**
15
- * Internal dependencies
16
- */
12
+ function listener(event) {
13
+ if (event.defaultPrevented) {
14
+ return;
15
+ }
16
+ event.preventDefault();
17
+ event.currentTarget.classList.toggle('is-hovered', event.type === 'mouseover');
18
+ }
17
19
 
18
20
  /*
19
21
  * Adds `is-hovered` class when the block is hovered and in navigation or
20
22
  * outline mode.
21
23
  */
22
- function useIsHovered({
23
- clientId
24
- }) {
25
- const {
26
- hoverBlock
27
- } = (0, _data.useDispatch)(_store.store);
28
- function listener(event) {
29
- if (event.defaultPrevented) {
30
- return;
31
- }
32
- const action = event.type === 'mouseover' ? 'add' : 'remove';
33
- event.preventDefault();
34
- event.currentTarget.classList[action]('is-hovered');
35
- if (action === 'add') {
36
- hoverBlock(clientId);
37
- } else {
38
- hoverBlock(null);
39
- }
40
- }
24
+ function useIsHovered() {
41
25
  return (0, _compose.useRefEffect)(node => {
42
26
  node.addEventListener('mouseout', listener);
43
27
  node.addEventListener('mouseover', listener);
@@ -47,7 +31,6 @@ function useIsHovered({
47
31
 
48
32
  // Remove class in case it lingers.
49
33
  node.classList.remove('is-hovered');
50
- hoverBlock(null);
51
34
  };
52
35
  }, []);
53
36
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_compose","require","_data","_store","useIsHovered","clientId","hoverBlock","useDispatch","blockEditorStore","listener","event","defaultPrevented","action","type","preventDefault","currentTarget","classList","useRefEffect","node","addEventListener","removeEventListener","remove"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/use-is-hovered.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../../store';\n\n/*\n * Adds `is-hovered` class when the block is hovered and in navigation or\n * outline mode.\n */\nexport function useIsHovered( { clientId } ) {\n\tconst { hoverBlock } = useDispatch( blockEditorStore );\n\n\tfunction listener( event ) {\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst action = event.type === 'mouseover' ? 'add' : 'remove';\n\n\t\tevent.preventDefault();\n\t\tevent.currentTarget.classList[ action ]( 'is-hovered' );\n\n\t\tif ( action === 'add' ) {\n\t\t\thoverBlock( clientId );\n\t\t} else {\n\t\t\thoverBlock( null );\n\t\t}\n\t}\n\n\treturn useRefEffect( ( node ) => {\n\t\tnode.addEventListener( 'mouseout', listener );\n\t\tnode.addEventListener( 'mouseover', listener );\n\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'mouseout', listener );\n\t\t\tnode.removeEventListener( 'mouseover', listener );\n\n\t\t\t// Remove class in case it lingers.\n\t\t\tnode.classList.remove( 'is-hovered' );\n\t\t\thoverBlock( null );\n\t\t};\n\t}, [] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACO,SAASG,YAAYA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC5C,MAAM;IAAEC;EAAW,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAiB,CAAC;EAEtD,SAASC,QAAQA,CAAEC,KAAK,EAAG;IAC1B,IAAKA,KAAK,CAACC,gBAAgB,EAAG;MAC7B;IACD;IAEA,MAAMC,MAAM,GAAGF,KAAK,CAACG,IAAI,KAAK,WAAW,GAAG,KAAK,GAAG,QAAQ;IAE5DH,KAAK,CAACI,cAAc,CAAC,CAAC;IACtBJ,KAAK,CAACK,aAAa,CAACC,SAAS,CAAEJ,MAAM,CAAE,CAAE,YAAa,CAAC;IAEvD,IAAKA,MAAM,KAAK,KAAK,EAAG;MACvBN,UAAU,CAAED,QAAS,CAAC;IACvB,CAAC,MAAM;MACNC,UAAU,CAAE,IAAK,CAAC;IACnB;EACD;EAEA,OAAO,IAAAW,qBAAY,EAAIC,IAAI,IAAM;IAChCA,IAAI,CAACC,gBAAgB,CAAE,UAAU,EAAEV,QAAS,CAAC;IAC7CS,IAAI,CAACC,gBAAgB,CAAE,WAAW,EAAEV,QAAS,CAAC;IAE9C,OAAO,MAAM;MACZS,IAAI,CAACE,mBAAmB,CAAE,UAAU,EAAEX,QAAS,CAAC;MAChDS,IAAI,CAACE,mBAAmB,CAAE,WAAW,EAAEX,QAAS,CAAC;;MAEjD;MACAS,IAAI,CAACF,SAAS,CAACK,MAAM,CAAE,YAAa,CAAC;MACrCf,UAAU,CAAE,IAAK,CAAC;IACnB,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
1
+ {"version":3,"names":["_compose","require","listener","event","defaultPrevented","preventDefault","currentTarget","classList","toggle","type","useIsHovered","useRefEffect","node","addEventListener","removeEventListener","remove"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/use-is-hovered.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\n\nfunction listener( event ) {\n\tif ( event.defaultPrevented ) {\n\t\treturn;\n\t}\n\n\tevent.preventDefault();\n\tevent.currentTarget.classList.toggle(\n\t\t'is-hovered',\n\t\tevent.type === 'mouseover'\n\t);\n}\n\n/*\n * Adds `is-hovered` class when the block is hovered and in navigation or\n * outline mode.\n */\nexport function useIsHovered() {\n\treturn useRefEffect( ( node ) => {\n\t\tnode.addEventListener( 'mouseout', listener );\n\t\tnode.addEventListener( 'mouseover', listener );\n\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'mouseout', listener );\n\t\t\tnode.removeEventListener( 'mouseover', listener );\n\n\t\t\t// Remove class in case it lingers.\n\t\t\tnode.classList.remove( 'is-hovered' );\n\t\t};\n\t}, [] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,SAASC,QAAQA,CAAEC,KAAK,EAAG;EAC1B,IAAKA,KAAK,CAACC,gBAAgB,EAAG;IAC7B;EACD;EAEAD,KAAK,CAACE,cAAc,CAAC,CAAC;EACtBF,KAAK,CAACG,aAAa,CAACC,SAAS,CAACC,MAAM,CACnC,YAAY,EACZL,KAAK,CAACM,IAAI,KAAK,WAChB,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAAA,EAAG;EAC9B,OAAO,IAAAC,qBAAY,EAAIC,IAAI,IAAM;IAChCA,IAAI,CAACC,gBAAgB,CAAE,UAAU,EAAEX,QAAS,CAAC;IAC7CU,IAAI,CAACC,gBAAgB,CAAE,WAAW,EAAEX,QAAS,CAAC;IAE9C,OAAO,MAAM;MACZU,IAAI,CAACE,mBAAmB,CAAE,UAAU,EAAEZ,QAAS,CAAC;MAChDU,IAAI,CAACE,mBAAmB,CAAE,WAAW,EAAEZ,QAAS,CAAC;;MAEjD;MACAU,IAAI,CAACL,SAAS,CAACQ,MAAM,CAAE,YAAa,CAAC;IACtC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR","ignoreList":[]}
@@ -90,7 +90,8 @@ function BlockSettingsDropdown({
90
90
  previousBlockClientId,
91
91
  selectedBlockClientIds,
92
92
  openedBlockSettingsMenu,
93
- isContentOnly
93
+ isContentOnly,
94
+ isZoomOut
94
95
  } = (0, _data.useSelect)(select => {
95
96
  const {
96
97
  getBlockName,
@@ -99,7 +100,8 @@ function BlockSettingsDropdown({
99
100
  getSelectedBlockClientIds,
100
101
  getBlockAttributes,
101
102
  getOpenedBlockSettingsMenu,
102
- getBlockEditingMode
103
+ getBlockEditingMode,
104
+ isZoomOut: _isZoomOut
103
105
  } = (0, _lockUnlock.unlock)(select(_store.store));
104
106
  const {
105
107
  getActiveBlockVariation
@@ -112,7 +114,8 @@ function BlockSettingsDropdown({
112
114
  previousBlockClientId: getPreviousBlockClientId(firstBlockClientId),
113
115
  selectedBlockClientIds: getSelectedBlockClientIds(),
114
116
  openedBlockSettingsMenu: getOpenedBlockSettingsMenu(),
115
- isContentOnly: getBlockEditingMode(firstBlockClientId) === 'contentOnly'
117
+ isContentOnly: getBlockEditingMode(firstBlockClientId) === 'contentOnly',
118
+ isZoomOut: _isZoomOut()
116
119
  };
117
120
  }, [firstBlockClientId]);
118
121
  const {
@@ -240,7 +243,7 @@ function BlockSettingsDropdown({
240
243
  onClick: (0, _compose.pipe)(onClose, onDuplicate, updateSelectionAfterDuplicate),
241
244
  shortcut: shortcuts.duplicate,
242
245
  children: (0, _i18n.__)('Duplicate')
243
- }), canInsertBlock && !isContentOnly && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
246
+ }), canInsertBlock && !isZoomOut && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
244
247
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
245
248
  onClick: (0, _compose.pipe)(onClose, onInsertBefore),
246
249
  shortcut: shortcuts.insertBefore,
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_components","_data","_icons","_element","_i18n","_keyboardShortcuts","_compose","_blockActions","_interopRequireDefault","_blockCommentIconSlot","_blockHtmlConvertButton","_blockSettingsMenuFirstItem","_blockSettingsMenuControls","_blockParentSelectorMenuItem","_store","_lockUnlock","_useNotifyCopy","_jsxRuntime","POPOVER_PROPS","className","placement","CopyMenuItem","clientIds","onCopy","label","shortcut","eventType","__experimentalUpdateSelection","updateSelection","getBlocksByClientId","useSelect","blockEditorStore","removeBlocks","useDispatch","notifyCopy","useNotifyCopy","ref","useCopyToClipboard","serialize","copyMenuItemLabel","__","jsx","MenuItem","children","BlockSettingsDropdown","block","__experimentalSelectBlock","props","currentClientId","clientId","count","length","firstBlockClientId","firstParentClientId","parentBlockType","previousBlockClientId","selectedBlockClientIds","openedBlockSettingsMenu","isContentOnly","select","getBlockName","getBlockRootClientId","getPreviousBlockClientId","getSelectedBlockClientIds","getBlockAttributes","getOpenedBlockSettingsMenu","getBlockEditingMode","unlock","getActiveBlockVariation","blocksStore","_firstParentClientId","parentBlockName","getBlockType","getBlockOrder","setOpenedBlockSettingsMenu","shortcuts","getShortcutRepresentation","keyboardShortcutsStore","copy","cut","duplicate","remove","insertAfter","insertBefore","hasSelectedBlocks","updateSelectionAfterDuplicate","clientIdsPromise","ids","updateSelectionAfterRemove","blockToFocus","shouldUpdateSelection","parentBlockIsSelected","includes","open","undefined","onToggle","localOpen","shouldShowBlockParentMenuItem","default","canCopyStyles","canDuplicate","canInsertBlock","canRemove","onDuplicate","onInsertAfter","onInsertBefore","onRemove","onPasteStyles","isEmpty","DropdownMenu","icon","moreVertical","popoverProps","noIcons","onClose","jsxs","Fragment","MenuGroup","Slot","fillProps","parentClientId","onClick","pipe","Children","map","child","cloneElement","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-settings-menu/block-settings-dropdown.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tgetBlockType,\n\tserialize,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { moreVertical } from '@wordpress/icons';\nimport { Children, cloneElement } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { pipe, useCopyToClipboard } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockActions from '../block-actions';\nimport CommentIconSlotFill from '../../components/collab/block-comment-icon-slot';\nimport BlockHTMLConvertButton from './block-html-convert-button';\nimport __unstableBlockSettingsMenuFirstItem from './block-settings-menu-first-item';\nimport BlockSettingsMenuControls from '../block-settings-menu-controls';\nimport BlockParentSelectorMenuItem from './block-parent-selector-menu-item';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useNotifyCopy } from '../../utils/use-notify-copy';\n\nconst POPOVER_PROPS = {\n\tclassName: 'block-editor-block-settings-menu__popover',\n\tplacement: 'bottom-start',\n};\n\nfunction CopyMenuItem( {\n\tclientIds,\n\tonCopy,\n\tlabel,\n\tshortcut,\n\teventType = 'copy',\n\t__experimentalUpdateSelection: updateSelection = false,\n} ) {\n\tconst { getBlocksByClientId } = useSelect( blockEditorStore );\n\tconst { removeBlocks } = useDispatch( blockEditorStore );\n\tconst notifyCopy = useNotifyCopy();\n\tconst ref = useCopyToClipboard(\n\t\t() => serialize( getBlocksByClientId( clientIds ) ),\n\t\t() => {\n\t\t\tswitch ( eventType ) {\n\t\t\t\tcase 'copy':\n\t\t\t\tcase 'copyStyles':\n\t\t\t\t\tonCopy();\n\t\t\t\t\tnotifyCopy( eventType, clientIds );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'cut':\n\t\t\t\t\tnotifyCopy( eventType, clientIds );\n\t\t\t\t\tremoveBlocks( clientIds, updateSelection );\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t);\n\tconst copyMenuItemLabel = label ? label : __( 'Copy' );\n\treturn (\n\t\t<MenuItem ref={ ref } shortcut={ shortcut }>\n\t\t\t{ copyMenuItemLabel }\n\t\t</MenuItem>\n\t);\n}\n\nexport function BlockSettingsDropdown( {\n\tblock,\n\tclientIds,\n\tchildren,\n\t__experimentalSelectBlock,\n\t...props\n} ) {\n\t// Get the client id of the current block for this menu, if one is set.\n\tconst currentClientId = block?.clientId;\n\tconst count = clientIds.length;\n\tconst firstBlockClientId = clientIds[ 0 ];\n\n\tconst {\n\t\tfirstParentClientId,\n\t\tparentBlockType,\n\t\tpreviousBlockClientId,\n\t\tselectedBlockClientIds,\n\t\topenedBlockSettingsMenu,\n\t\tisContentOnly,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetOpenedBlockSettingsMenu,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\n\t\t\tconst { getActiveBlockVariation } = select( blocksStore );\n\n\t\t\tconst _firstParentClientId =\n\t\t\t\tgetBlockRootClientId( firstBlockClientId );\n\t\t\tconst parentBlockName =\n\t\t\t\t_firstParentClientId && getBlockName( _firstParentClientId );\n\n\t\t\treturn {\n\t\t\t\tfirstParentClientId: _firstParentClientId,\n\t\t\t\tparentBlockType:\n\t\t\t\t\t_firstParentClientId &&\n\t\t\t\t\t( getActiveBlockVariation(\n\t\t\t\t\t\tparentBlockName,\n\t\t\t\t\t\tgetBlockAttributes( _firstParentClientId )\n\t\t\t\t\t) ||\n\t\t\t\t\t\tgetBlockType( parentBlockName ) ),\n\t\t\t\tpreviousBlockClientId:\n\t\t\t\t\tgetPreviousBlockClientId( firstBlockClientId ),\n\t\t\t\tselectedBlockClientIds: getSelectedBlockClientIds(),\n\t\t\t\topenedBlockSettingsMenu: getOpenedBlockSettingsMenu(),\n\t\t\t\tisContentOnly:\n\t\t\t\t\tgetBlockEditingMode( firstBlockClientId ) === 'contentOnly',\n\t\t\t};\n\t\t},\n\t\t[ firstBlockClientId ]\n\t);\n\n\tconst { getBlockOrder, getSelectedBlockClientIds } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst { setOpenedBlockSettingsMenu } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\n\tconst shortcuts = useSelect( ( select ) => {\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\t\treturn {\n\t\t\tcopy: getShortcutRepresentation( 'core/block-editor/copy' ),\n\t\t\tcut: getShortcutRepresentation( 'core/block-editor/cut' ),\n\t\t\tduplicate: getShortcutRepresentation(\n\t\t\t\t'core/block-editor/duplicate'\n\t\t\t),\n\t\t\tremove: getShortcutRepresentation( 'core/block-editor/remove' ),\n\t\t\tinsertAfter: getShortcutRepresentation(\n\t\t\t\t'core/block-editor/insert-after'\n\t\t\t),\n\t\t\tinsertBefore: getShortcutRepresentation(\n\t\t\t\t'core/block-editor/insert-before'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst hasSelectedBlocks = selectedBlockClientIds.length > 0;\n\n\tasync function updateSelectionAfterDuplicate( clientIdsPromise ) {\n\t\tif ( ! __experimentalSelectBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst ids = await clientIdsPromise;\n\t\tif ( ids && ids[ 0 ] ) {\n\t\t\t__experimentalSelectBlock( ids[ 0 ], false );\n\t\t}\n\t}\n\n\tfunction updateSelectionAfterRemove() {\n\t\tif ( ! __experimentalSelectBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet blockToFocus = previousBlockClientId || firstParentClientId;\n\n\t\t// Focus the first block if there's no previous block nor parent block.\n\t\tif ( ! blockToFocus ) {\n\t\t\tblockToFocus = getBlockOrder()[ 0 ];\n\t\t}\n\n\t\t// Only update the selection if the original selection is removed.\n\t\tconst shouldUpdateSelection =\n\t\t\thasSelectedBlocks && getSelectedBlockClientIds().length === 0;\n\n\t\t__experimentalSelectBlock( blockToFocus, shouldUpdateSelection );\n\t}\n\n\t// This can occur when the selected block (the parent)\n\t// displays child blocks within a List View.\n\tconst parentBlockIsSelected =\n\t\tselectedBlockClientIds?.includes( firstParentClientId );\n\n\t// When a currentClientId is in use, treat the menu as a controlled component.\n\t// This ensures that only one block settings menu is open at a time.\n\t// This is a temporary solution to work around an issue with `onFocusOutside`\n\t// where it does not allow a dropdown to be closed if focus was never within\n\t// the dropdown to begin with. Examples include a user either CMD+Clicking or\n\t// right clicking into an inactive window.\n\t// See: https://github.com/WordPress/gutenberg/pull/54083\n\tconst open = ! currentClientId\n\t\t? undefined\n\t\t: openedBlockSettingsMenu === currentClientId || false;\n\n\tfunction onToggle( localOpen ) {\n\t\tif ( localOpen && openedBlockSettingsMenu !== currentClientId ) {\n\t\t\tsetOpenedBlockSettingsMenu( currentClientId );\n\t\t} else if (\n\t\t\t! localOpen &&\n\t\t\topenedBlockSettingsMenu &&\n\t\t\topenedBlockSettingsMenu === currentClientId\n\t\t) {\n\t\t\tsetOpenedBlockSettingsMenu( undefined );\n\t\t}\n\t}\n\n\tconst shouldShowBlockParentMenuItem =\n\t\t! parentBlockIsSelected && !! firstParentClientId;\n\n\treturn (\n\t\t<BlockActions\n\t\t\tclientIds={ clientIds }\n\t\t\t__experimentalUpdateSelection={ ! __experimentalSelectBlock }\n\t\t>\n\t\t\t{ ( {\n\t\t\t\tcanCopyStyles,\n\t\t\t\tcanDuplicate,\n\t\t\t\tcanInsertBlock,\n\t\t\t\tcanRemove,\n\t\t\t\tonDuplicate,\n\t\t\t\tonInsertAfter,\n\t\t\t\tonInsertBefore,\n\t\t\t\tonRemove,\n\t\t\t\tonCopy,\n\t\t\t\tonPasteStyles,\n\t\t\t} ) => {\n\t\t\t\t// It is possible that some plugins register fills for this menu\n\t\t\t\t// even if Core doesn't render anything in the block settings menu.\n\t\t\t\t// in which case, we may want to render the menu anyway.\n\t\t\t\t// That said for now, we can start more conservative.\n\t\t\t\tconst isEmpty =\n\t\t\t\t\t! canRemove &&\n\t\t\t\t\t! canDuplicate &&\n\t\t\t\t\t! canInsertBlock &&\n\t\t\t\t\tisContentOnly;\n\n\t\t\t\tif ( isEmpty ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\t\t\tclassName=\"block-editor-block-settings-menu\"\n\t\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t\t\topen={ open }\n\t\t\t\t\t\tonToggle={ onToggle }\n\t\t\t\t\t\tnoIcons\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t<__unstableBlockSettingsMenuFirstItem.Slot\n\t\t\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{ shouldShowBlockParentMenuItem && (\n\t\t\t\t\t\t\t\t\t\t<BlockParentSelectorMenuItem\n\t\t\t\t\t\t\t\t\t\t\tparentClientId={\n\t\t\t\t\t\t\t\t\t\t\t\tfirstParentClientId\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tparentBlockType={ parentBlockType }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ count === 1 && (\n\t\t\t\t\t\t\t\t\t\t<BlockHTMLConvertButton\n\t\t\t\t\t\t\t\t\t\t\tclientId={ firstBlockClientId }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<CopyMenuItem\n\t\t\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t\t\tonCopy={ onCopy }\n\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.copy }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<CopyMenuItem\n\t\t\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Cut' ) }\n\t\t\t\t\t\t\t\t\t\teventType=\"cut\"\n\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.cut }\n\t\t\t\t\t\t\t\t\t\t__experimentalUpdateSelection={\n\t\t\t\t\t\t\t\t\t\t\t! __experimentalSelectBlock\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{ canDuplicate && (\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\tonDuplicate,\n\t\t\t\t\t\t\t\t\t\t\t\tupdateSelectionAfterDuplicate\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.duplicate }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Duplicate' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ canInsertBlock && ! isContentOnly && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\t\tonInsertBefore\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\tshortcut={\n\t\t\t\t\t\t\t\t\t\t\t\t\tshortcuts.insertBefore\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Add before' ) }\n\t\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\t\tonInsertAfter\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\tshortcut={\n\t\t\t\t\t\t\t\t\t\t\t\t\tshortcuts.insertAfter\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Add after' ) }\n\t\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<CommentIconSlotFill.Slot\n\t\t\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t\t{ canCopyStyles && ! isContentOnly && (\n\t\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t\t<CopyMenuItem\n\t\t\t\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t\t\t\tonCopy={ onCopy }\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Copy styles' ) }\n\t\t\t\t\t\t\t\t\t\t\teventType=\"copyStyles\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<MenuItem onClick={ onPasteStyles }>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Paste styles' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ ! isContentOnly && (\n\t\t\t\t\t\t\t\t\t<BlockSettingsMenuControls.Slot\n\t\t\t\t\t\t\t\t\t\tfillProps={ {\n\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\tcount,\n\t\t\t\t\t\t\t\t\t\t\tfirstBlockClientId,\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ typeof children === 'function'\n\t\t\t\t\t\t\t\t\t? children( { onClose } )\n\t\t\t\t\t\t\t\t\t: Children.map( ( child ) =>\n\t\t\t\t\t\t\t\t\t\t\tcloneElement( child, { onClose } )\n\t\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t\t{ canRemove && (\n\t\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\tonRemove,\n\t\t\t\t\t\t\t\t\t\t\t\tupdateSelectionAfterRemove\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.remove }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t</MenuGroup>\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</DropdownMenu>\n\t\t\t\t);\n\t\t\t} }\n\t\t</BlockActions>\n\t);\n}\n\nexport default BlockSettingsDropdown;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAKA,IAAAQ,aAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,qBAAA,GAAAD,sBAAA,CAAAT,OAAA;AACA,IAAAW,uBAAA,GAAAF,sBAAA,CAAAT,OAAA;AACA,IAAAY,2BAAA,GAAAH,sBAAA,CAAAT,OAAA;AACA,IAAAa,0BAAA,GAAAJ,sBAAA,CAAAT,OAAA;AACA,IAAAc,4BAAA,GAAAL,sBAAA,CAAAT,OAAA;AACA,IAAAe,MAAA,GAAAf,OAAA;AACA,IAAAgB,WAAA,GAAAhB,OAAA;AACA,IAAAiB,cAAA,GAAAjB,OAAA;AAA4D,IAAAkB,WAAA,GAAAlB,OA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,GAAA,EAACzC,WAAA,CAAA0C,QAAQ;cAAC+E,OAAO,EAAGd,aAAe;cAAAhE,QAAA,EAChC,IAAAH,QAAE,EAAE,cAAe;YAAC,CACb,CAAC;UAAA,CACD,CACX,EACC,CAAEkB,aAAa,iBAChB,IAAAzC,WAAA,CAAAwB,GAAA,EAAC7B,0BAAA,CAAAsF,OAAyB,CAACoB,IAAI;YAC9BC,SAAS,EAAG;cACXL,OAAO;cACPhE,KAAK;cACLE;YACD,CAAG;YACH9B,SAAS,EAAGA;UAAW,CACvB,CACD,EACC,OAAOqB,QAAQ,KAAK,UAAU,GAC7BA,QAAQ,CAAE;YAAEuE;UAAQ,CAAE,CAAC,GACvBS,iBAAQ,CAACC,GAAG,CAAIC,KAAK,IACrB,IAAAC,qBAAY,EAAED,KAAK,EAAE;YAAEX;UAAQ,CAAE,CACjC,CAAC,EACFZ,SAAS,iBACV,IAAArF,WAAA,CAAAwB,GAAA,EAACzC,WAAA,CAAAqH,SAAS;YAAA1E,QAAA,eACT,IAAA1B,WAAA,CAAAwB,GAAA,EAACzC,WAAA,CAAA0C,QAAQ;cACR+E,OAAO,EAAG,IAAAC,aAAI,EACbR,OAAO,EACPR,QAAQ,EACRlB,0BACD,CAAG;cACH/D,QAAQ,EAAGkD,SAAS,CAACM,MAAQ;cAAAtC,QAAA,EAE3B,IAAAH,QAAE,EAAE,QAAS;YAAC,CACP;UAAC,CACD,CACX;QAAA,CACA;MACF,CACY,CAAC;IAEjB;EAAC,CACY,CAAC;AAEjB;AAAC,IAAAuF,QAAA,GAAAC,OAAA,CAAA9B,OAAA,GAEctD,qBAAqB","ignoreList":[]}
1
+ {"version":3,"names":["_blocks","require","_components","_data","_icons","_element","_i18n","_keyboardShortcuts","_compose","_blockActions","_interopRequireDefault","_blockCommentIconSlot","_blockHtmlConvertButton","_blockSettingsMenuFirstItem","_blockSettingsMenuControls","_blockParentSelectorMenuItem","_store","_lockUnlock","_useNotifyCopy","_jsxRuntime","POPOVER_PROPS","className","placement","CopyMenuItem","clientIds","onCopy","label","shortcut","eventType","__experimentalUpdateSelection","updateSelection","getBlocksByClientId","useSelect","blockEditorStore","removeBlocks","useDispatch","notifyCopy","useNotifyCopy","ref","useCopyToClipboard","serialize","copyMenuItemLabel","__","jsx","MenuItem","children","BlockSettingsDropdown","block","__experimentalSelectBlock","props","currentClientId","clientId","count","length","firstBlockClientId","firstParentClientId","parentBlockType","previousBlockClientId","selectedBlockClientIds","openedBlockSettingsMenu","isContentOnly","isZoomOut","select","getBlockName","getBlockRootClientId","getPreviousBlockClientId","getSelectedBlockClientIds","getBlockAttributes","getOpenedBlockSettingsMenu","getBlockEditingMode","_isZoomOut","unlock","getActiveBlockVariation","blocksStore","_firstParentClientId","parentBlockName","getBlockType","getBlockOrder","setOpenedBlockSettingsMenu","shortcuts","getShortcutRepresentation","keyboardShortcutsStore","copy","cut","duplicate","remove","insertAfter","insertBefore","hasSelectedBlocks","updateSelectionAfterDuplicate","clientIdsPromise","ids","updateSelectionAfterRemove","blockToFocus","shouldUpdateSelection","parentBlockIsSelected","includes","open","undefined","onToggle","localOpen","shouldShowBlockParentMenuItem","default","canCopyStyles","canDuplicate","canInsertBlock","canRemove","onDuplicate","onInsertAfter","onInsertBefore","onRemove","onPasteStyles","isEmpty","DropdownMenu","icon","moreVertical","popoverProps","noIcons","onClose","jsxs","Fragment","MenuGroup","Slot","fillProps","parentClientId","onClick","pipe","Children","map","child","cloneElement","_default","exports"],"sources":["@wordpress/block-editor/src/components/block-settings-menu/block-settings-dropdown.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tgetBlockType,\n\tserialize,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { moreVertical } from '@wordpress/icons';\nimport { Children, cloneElement } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { pipe, useCopyToClipboard } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockActions from '../block-actions';\nimport CommentIconSlotFill from '../../components/collab/block-comment-icon-slot';\nimport BlockHTMLConvertButton from './block-html-convert-button';\nimport __unstableBlockSettingsMenuFirstItem from './block-settings-menu-first-item';\nimport BlockSettingsMenuControls from '../block-settings-menu-controls';\nimport BlockParentSelectorMenuItem from './block-parent-selector-menu-item';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useNotifyCopy } from '../../utils/use-notify-copy';\n\nconst POPOVER_PROPS = {\n\tclassName: 'block-editor-block-settings-menu__popover',\n\tplacement: 'bottom-start',\n};\n\nfunction CopyMenuItem( {\n\tclientIds,\n\tonCopy,\n\tlabel,\n\tshortcut,\n\teventType = 'copy',\n\t__experimentalUpdateSelection: updateSelection = false,\n} ) {\n\tconst { getBlocksByClientId } = useSelect( blockEditorStore );\n\tconst { removeBlocks } = useDispatch( blockEditorStore );\n\tconst notifyCopy = useNotifyCopy();\n\tconst ref = useCopyToClipboard(\n\t\t() => serialize( getBlocksByClientId( clientIds ) ),\n\t\t() => {\n\t\t\tswitch ( eventType ) {\n\t\t\t\tcase 'copy':\n\t\t\t\tcase 'copyStyles':\n\t\t\t\t\tonCopy();\n\t\t\t\t\tnotifyCopy( eventType, clientIds );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'cut':\n\t\t\t\t\tnotifyCopy( eventType, clientIds );\n\t\t\t\t\tremoveBlocks( clientIds, updateSelection );\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t);\n\tconst copyMenuItemLabel = label ? label : __( 'Copy' );\n\treturn (\n\t\t<MenuItem ref={ ref } shortcut={ shortcut }>\n\t\t\t{ copyMenuItemLabel }\n\t\t</MenuItem>\n\t);\n}\n\nexport function BlockSettingsDropdown( {\n\tblock,\n\tclientIds,\n\tchildren,\n\t__experimentalSelectBlock,\n\t...props\n} ) {\n\t// Get the client id of the current block for this menu, if one is set.\n\tconst currentClientId = block?.clientId;\n\tconst count = clientIds.length;\n\tconst firstBlockClientId = clientIds[ 0 ];\n\n\tconst {\n\t\tfirstParentClientId,\n\t\tparentBlockType,\n\t\tpreviousBlockClientId,\n\t\tselectedBlockClientIds,\n\t\topenedBlockSettingsMenu,\n\t\tisContentOnly,\n\t\tisZoomOut,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetPreviousBlockClientId,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetOpenedBlockSettingsMenu,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t\tisZoomOut: _isZoomOut,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\n\t\t\tconst { getActiveBlockVariation } = select( blocksStore );\n\n\t\t\tconst _firstParentClientId =\n\t\t\t\tgetBlockRootClientId( firstBlockClientId );\n\t\t\tconst parentBlockName =\n\t\t\t\t_firstParentClientId && getBlockName( _firstParentClientId );\n\n\t\t\treturn {\n\t\t\t\tfirstParentClientId: _firstParentClientId,\n\t\t\t\tparentBlockType:\n\t\t\t\t\t_firstParentClientId &&\n\t\t\t\t\t( getActiveBlockVariation(\n\t\t\t\t\t\tparentBlockName,\n\t\t\t\t\t\tgetBlockAttributes( _firstParentClientId )\n\t\t\t\t\t) ||\n\t\t\t\t\t\tgetBlockType( parentBlockName ) ),\n\t\t\t\tpreviousBlockClientId:\n\t\t\t\t\tgetPreviousBlockClientId( firstBlockClientId ),\n\t\t\t\tselectedBlockClientIds: getSelectedBlockClientIds(),\n\t\t\t\topenedBlockSettingsMenu: getOpenedBlockSettingsMenu(),\n\t\t\t\tisContentOnly:\n\t\t\t\t\tgetBlockEditingMode( firstBlockClientId ) === 'contentOnly',\n\t\t\t\tisZoomOut: _isZoomOut(),\n\t\t\t};\n\t\t},\n\t\t[ firstBlockClientId ]\n\t);\n\n\tconst { getBlockOrder, getSelectedBlockClientIds } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst { setOpenedBlockSettingsMenu } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\n\tconst shortcuts = useSelect( ( select ) => {\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\t\treturn {\n\t\t\tcopy: getShortcutRepresentation( 'core/block-editor/copy' ),\n\t\t\tcut: getShortcutRepresentation( 'core/block-editor/cut' ),\n\t\t\tduplicate: getShortcutRepresentation(\n\t\t\t\t'core/block-editor/duplicate'\n\t\t\t),\n\t\t\tremove: getShortcutRepresentation( 'core/block-editor/remove' ),\n\t\t\tinsertAfter: getShortcutRepresentation(\n\t\t\t\t'core/block-editor/insert-after'\n\t\t\t),\n\t\t\tinsertBefore: getShortcutRepresentation(\n\t\t\t\t'core/block-editor/insert-before'\n\t\t\t),\n\t\t};\n\t}, [] );\n\tconst hasSelectedBlocks = selectedBlockClientIds.length > 0;\n\n\tasync function updateSelectionAfterDuplicate( clientIdsPromise ) {\n\t\tif ( ! __experimentalSelectBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst ids = await clientIdsPromise;\n\t\tif ( ids && ids[ 0 ] ) {\n\t\t\t__experimentalSelectBlock( ids[ 0 ], false );\n\t\t}\n\t}\n\n\tfunction updateSelectionAfterRemove() {\n\t\tif ( ! __experimentalSelectBlock ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet blockToFocus = previousBlockClientId || firstParentClientId;\n\n\t\t// Focus the first block if there's no previous block nor parent block.\n\t\tif ( ! blockToFocus ) {\n\t\t\tblockToFocus = getBlockOrder()[ 0 ];\n\t\t}\n\n\t\t// Only update the selection if the original selection is removed.\n\t\tconst shouldUpdateSelection =\n\t\t\thasSelectedBlocks && getSelectedBlockClientIds().length === 0;\n\n\t\t__experimentalSelectBlock( blockToFocus, shouldUpdateSelection );\n\t}\n\n\t// This can occur when the selected block (the parent)\n\t// displays child blocks within a List View.\n\tconst parentBlockIsSelected =\n\t\tselectedBlockClientIds?.includes( firstParentClientId );\n\n\t// When a currentClientId is in use, treat the menu as a controlled component.\n\t// This ensures that only one block settings menu is open at a time.\n\t// This is a temporary solution to work around an issue with `onFocusOutside`\n\t// where it does not allow a dropdown to be closed if focus was never within\n\t// the dropdown to begin with. Examples include a user either CMD+Clicking or\n\t// right clicking into an inactive window.\n\t// See: https://github.com/WordPress/gutenberg/pull/54083\n\tconst open = ! currentClientId\n\t\t? undefined\n\t\t: openedBlockSettingsMenu === currentClientId || false;\n\n\tfunction onToggle( localOpen ) {\n\t\tif ( localOpen && openedBlockSettingsMenu !== currentClientId ) {\n\t\t\tsetOpenedBlockSettingsMenu( currentClientId );\n\t\t} else if (\n\t\t\t! localOpen &&\n\t\t\topenedBlockSettingsMenu &&\n\t\t\topenedBlockSettingsMenu === currentClientId\n\t\t) {\n\t\t\tsetOpenedBlockSettingsMenu( undefined );\n\t\t}\n\t}\n\n\tconst shouldShowBlockParentMenuItem =\n\t\t! parentBlockIsSelected && !! firstParentClientId;\n\n\treturn (\n\t\t<BlockActions\n\t\t\tclientIds={ clientIds }\n\t\t\t__experimentalUpdateSelection={ ! __experimentalSelectBlock }\n\t\t>\n\t\t\t{ ( {\n\t\t\t\tcanCopyStyles,\n\t\t\t\tcanDuplicate,\n\t\t\t\tcanInsertBlock,\n\t\t\t\tcanRemove,\n\t\t\t\tonDuplicate,\n\t\t\t\tonInsertAfter,\n\t\t\t\tonInsertBefore,\n\t\t\t\tonRemove,\n\t\t\t\tonCopy,\n\t\t\t\tonPasteStyles,\n\t\t\t} ) => {\n\t\t\t\t// It is possible that some plugins register fills for this menu\n\t\t\t\t// even if Core doesn't render anything in the block settings menu.\n\t\t\t\t// in which case, we may want to render the menu anyway.\n\t\t\t\t// That said for now, we can start more conservative.\n\t\t\t\tconst isEmpty =\n\t\t\t\t\t! canRemove &&\n\t\t\t\t\t! canDuplicate &&\n\t\t\t\t\t! canInsertBlock &&\n\t\t\t\t\tisContentOnly;\n\n\t\t\t\tif ( isEmpty ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\t\t\tclassName=\"block-editor-block-settings-menu\"\n\t\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t\t\topen={ open }\n\t\t\t\t\t\tonToggle={ onToggle }\n\t\t\t\t\t\tnoIcons\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t<__unstableBlockSettingsMenuFirstItem.Slot\n\t\t\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{ shouldShowBlockParentMenuItem && (\n\t\t\t\t\t\t\t\t\t\t<BlockParentSelectorMenuItem\n\t\t\t\t\t\t\t\t\t\t\tparentClientId={\n\t\t\t\t\t\t\t\t\t\t\t\tfirstParentClientId\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tparentBlockType={ parentBlockType }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ count === 1 && (\n\t\t\t\t\t\t\t\t\t\t<BlockHTMLConvertButton\n\t\t\t\t\t\t\t\t\t\t\tclientId={ firstBlockClientId }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<CopyMenuItem\n\t\t\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t\t\tonCopy={ onCopy }\n\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.copy }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<CopyMenuItem\n\t\t\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Cut' ) }\n\t\t\t\t\t\t\t\t\t\teventType=\"cut\"\n\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.cut }\n\t\t\t\t\t\t\t\t\t\t__experimentalUpdateSelection={\n\t\t\t\t\t\t\t\t\t\t\t! __experimentalSelectBlock\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t{ canDuplicate && (\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\tonDuplicate,\n\t\t\t\t\t\t\t\t\t\t\t\tupdateSelectionAfterDuplicate\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.duplicate }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Duplicate' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ canInsertBlock && ! isZoomOut && (\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\t\tonInsertBefore\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\tshortcut={\n\t\t\t\t\t\t\t\t\t\t\t\t\tshortcuts.insertBefore\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Add before' ) }\n\t\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\t\tonInsertAfter\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\tshortcut={\n\t\t\t\t\t\t\t\t\t\t\t\t\tshortcuts.insertAfter\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Add after' ) }\n\t\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<CommentIconSlotFill.Slot\n\t\t\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t\t{ canCopyStyles && ! isContentOnly && (\n\t\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t\t<CopyMenuItem\n\t\t\t\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t\t\t\tonCopy={ onCopy }\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Copy styles' ) }\n\t\t\t\t\t\t\t\t\t\t\teventType=\"copyStyles\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<MenuItem onClick={ onPasteStyles }>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Paste styles' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ ! isContentOnly && (\n\t\t\t\t\t\t\t\t\t<BlockSettingsMenuControls.Slot\n\t\t\t\t\t\t\t\t\t\tfillProps={ {\n\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\tcount,\n\t\t\t\t\t\t\t\t\t\t\tfirstBlockClientId,\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tclientIds={ clientIds }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ typeof children === 'function'\n\t\t\t\t\t\t\t\t\t? children( { onClose } )\n\t\t\t\t\t\t\t\t\t: Children.map( ( child ) =>\n\t\t\t\t\t\t\t\t\t\t\tcloneElement( child, { onClose } )\n\t\t\t\t\t\t\t\t\t ) }\n\t\t\t\t\t\t\t\t{ canRemove && (\n\t\t\t\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\tonClick={ pipe(\n\t\t\t\t\t\t\t\t\t\t\t\tonClose,\n\t\t\t\t\t\t\t\t\t\t\t\tonRemove,\n\t\t\t\t\t\t\t\t\t\t\t\tupdateSelectionAfterRemove\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tshortcut={ shortcuts.remove }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t</MenuGroup>\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</DropdownMenu>\n\t\t\t\t);\n\t\t\t} }\n\t\t</BlockActions>\n\t);\n}\n\nexport default BlockSettingsDropdown;\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IA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,CAAC,EACFZ,SAAS,iBACV,IAAAvF,WAAA,CAAAwB,GAAA,EAACzC,WAAA,CAAAuH,SAAS;YAAA5E,QAAA,eACT,IAAA1B,WAAA,CAAAwB,GAAA,EAACzC,WAAA,CAAA0C,QAAQ;cACRiF,OAAO,EAAG,IAAAC,aAAI,EACbR,OAAO,EACPR,QAAQ,EACRlB,0BACD,CAAG;cACHjE,QAAQ,EAAGoD,SAAS,CAACM,MAAQ;cAAAxC,QAAA,EAE3B,IAAAH,QAAE,EAAE,QAAS;YAAC,CACP;UAAC,CACD,CACX;QAAA,CACA;MACF,CACY,CAAC;IAEjB;EAAC,CACY,CAAC;AAEjB;AAAC,IAAAyF,QAAA,GAAAC,OAAA,CAAA9B,OAAA,GAEcxD,qBAAqB","ignoreList":[]}
@@ -183,7 +183,7 @@ function GridControls({
183
183
  rowSpan
184
184
  } = childLayout;
185
185
  const {
186
- columnCount = 3,
186
+ columnCount,
187
187
  rowCount
188
188
  } = parentLayout !== null && parentLayout !== void 0 ? parentLayout : {};
189
189
  const rootClientId = (0, _data.useSelect)(select => select(_store.store).getBlockRootClientId(panelId));
@@ -191,7 +191,7 @@ function GridControls({
191
191
  moveBlocksToPosition,
192
192
  __unstableMarkNextChangeAsNotPersistent
193
193
  } = (0, _data.useDispatch)(_store.store);
194
- const getNumberOfBlocksBeforeCell = (0, _useGetNumberOfBlocksBeforeCell.useGetNumberOfBlocksBeforeCell)(rootClientId, columnCount);
194
+ const getNumberOfBlocksBeforeCell = (0, _useGetNumberOfBlocksBeforeCell.useGetNumberOfBlocksBeforeCell)(rootClientId, columnCount || 3);
195
195
  const hasStartValue = () => !!columnStart || !!rowStart;
196
196
  const hasSpanValue = () => !!columnSpan || !!rowSpan;
197
197
  const resetGridStarts = () => {
@@ -206,48 +206,67 @@ function GridControls({
206
206
  rowSpan: undefined
207
207
  });
208
208
  };
209
+
210
+ // Calculate max column span based on current position and grid width
211
+ const maxColumnSpan = columnCount ? columnCount - (columnStart !== null && columnStart !== void 0 ? columnStart : 1) + 1 : undefined;
212
+
213
+ // Calculate max row span based on current position and grid height
214
+ const maxRowSpan = window.__experimentalEnableGridInteractivity && rowCount ? rowCount - (rowStart !== null && rowStart !== void 0 ? rowStart : 1) + 1 : undefined;
209
215
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
210
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
216
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Flex, {
211
217
  as: _components.__experimentalToolsPanelItem,
212
218
  hasValue: hasSpanValue,
213
219
  label: (0, _i18n.__)('Grid span'),
214
220
  onDeselect: resetGridSpans,
215
221
  isShownByDefault: isShownByDefault,
216
222
  panelId: panelId,
217
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalInputControl, {
218
- size: "__unstable-large",
219
- label: (0, _i18n.__)('Column span'),
220
- type: "number",
221
- onChange: value => {
222
- // Don't allow unsetting.
223
- const newColumnSpan = value === '' ? 1 : parseInt(value, 10);
224
- onChange({
225
- columnStart,
226
- rowStart,
227
- rowSpan,
228
- columnSpan: newColumnSpan
229
- });
223
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
224
+ style: {
225
+ width: '50%'
230
226
  },
231
- value: columnSpan !== null && columnSpan !== void 0 ? columnSpan : 1,
232
- min: 1
233
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalInputControl, {
234
- size: "__unstable-large",
235
- label: (0, _i18n.__)('Row span'),
236
- type: "number",
237
- onChange: value => {
238
- // Don't allow unsetting.
239
- const newRowSpan = value === '' ? 1 : parseInt(value, 10);
240
- onChange({
241
- columnStart,
242
- rowStart,
243
- columnSpan,
244
- rowSpan: newRowSpan
245
- });
227
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalInputControl, {
228
+ size: "__unstable-large",
229
+ label: (0, _i18n.__)('Column span'),
230
+ type: "number",
231
+ onChange: value => {
232
+ // Don't allow unsetting.
233
+ const newColumnSpan = value === '' ? 1 : parseInt(value, 10);
234
+ const constrainedValue = maxColumnSpan ? Math.min(newColumnSpan, maxColumnSpan) : newColumnSpan;
235
+ onChange({
236
+ columnStart,
237
+ rowStart,
238
+ rowSpan,
239
+ columnSpan: constrainedValue
240
+ });
241
+ },
242
+ value: columnSpan !== null && columnSpan !== void 0 ? columnSpan : 1,
243
+ min: 1,
244
+ max: maxColumnSpan
245
+ })
246
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
247
+ style: {
248
+ width: '50%'
246
249
  },
247
- value: rowSpan !== null && rowSpan !== void 0 ? rowSpan : 1,
248
- min: 1
250
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalInputControl, {
251
+ size: "__unstable-large",
252
+ label: (0, _i18n.__)('Row span'),
253
+ type: "number",
254
+ onChange: value => {
255
+ const newRowSpan = value === '' ? 1 : parseInt(value, 10);
256
+ const constrainedValue = maxRowSpan ? Math.min(newRowSpan, maxRowSpan) : newRowSpan;
257
+ onChange({
258
+ columnStart,
259
+ rowStart,
260
+ columnSpan,
261
+ rowSpan: constrainedValue
262
+ });
263
+ },
264
+ value: rowSpan !== null && rowSpan !== void 0 ? rowSpan : 1,
265
+ min: 1,
266
+ max: maxRowSpan
267
+ })
249
268
  })]
250
- }), window.__experimentalEnableGridInteractivity && columnCount &&
269
+ }), window.__experimentalEnableGridInteractivity &&
251
270
  /*#__PURE__*/
252
271
  // Use Flex with an explicit width on the FlexItem instead of HStack to
253
272
  // work around an issue in webkit where inputs with a max attribute are
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_element","_data","_useGetNumberOfBlocksBeforeCell","_store","_useSettings","_jsxRuntime","helpText","selfStretch","parentLayout","orientation","__","ChildLayoutControl","value","childLayout","onChange","isShownByDefault","panelId","type","parentType","default","defaultParentType","parentLayoutType","jsx","FlexControls","GridControls","flexSize","hasFlexValue","flexResetLabel","availableUnits","useSettings","units","useCustomUnits","resetFlex","undefined","useEffect","jsxs","__experimentalVStack","as","ToolsPanelItem","spacing","hasValue","label","onDeselect","children","__experimentalToggleGroupControl","__nextHasNoMarginBottom","size","childLayoutOrientation","help","newFlexSize","isBlock","__experimentalToggleGroupControlOption","_x","__experimentalUnitControl","min","hideLabelFromVision","columnStart","rowStart","columnSpan","rowSpan","columnCount","rowCount","rootClientId","useSelect","select","blockEditorStore","getBlockRootClientId","moveBlocksToPosition","__unstableMarkNextChangeAsNotPersistent","useDispatch","getNumberOfBlocksBeforeCell","useGetNumberOfBlocksBeforeCell","hasStartValue","hasSpanValue","resetGridStarts","resetGridSpans","Fragment","__experimentalHStack","__experimentalInputControl","newColumnSpan","parseInt","newRowSpan","window","__experimentalEnableGridInteractivity","Flex","FlexItem","style","width","newColumnStart","max","newRowStart"],"sources":["@wordpress/block-editor/src/components/child-layout-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalInputControl as InputControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\tFlex,\n\tFlexItem,\n} from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useGetNumberOfBlocksBeforeCell } from '../grid/use-get-number-of-blocks-before-cell';\nimport { store as blockEditorStore } from '../../store';\nimport { useSettings } from '../use-settings';\n\nfunction helpText( selfStretch, parentLayout ) {\n\tconst { orientation = 'horizontal' } = parentLayout;\n\n\tif ( selfStretch === 'fill' ) {\n\t\treturn __( 'Stretch to fill available space.' );\n\t}\n\tif ( selfStretch === 'fixed' && orientation === 'horizontal' ) {\n\t\treturn __( 'Specify a fixed width.' );\n\t} else if ( selfStretch === 'fixed' ) {\n\t\treturn __( 'Specify a fixed height.' );\n\t}\n\treturn __( 'Fit contents.' );\n}\n\n/**\n * Form to edit the child layout value.\n *\n * @param {Object} props Props.\n * @param {Object} props.value The child layout value.\n * @param {Function} props.onChange Function to update the child layout value.\n * @param {Object} props.parentLayout The parent layout value.\n *\n * @param {boolean} props.isShownByDefault\n * @param {string} props.panelId\n * @return {Element} child layout edit element.\n */\nexport default function ChildLayoutControl( {\n\tvalue: childLayout = {},\n\tonChange,\n\tparentLayout,\n\tisShownByDefault,\n\tpanelId,\n} ) {\n\tconst {\n\t\ttype: parentType,\n\t\tdefault: { type: defaultParentType = 'default' } = {},\n\t} = parentLayout ?? {};\n\tconst parentLayoutType = parentType || defaultParentType;\n\n\tif ( parentLayoutType === 'flex' ) {\n\t\treturn (\n\t\t\t<FlexControls\n\t\t\t\tchildLayout={ childLayout }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tparentLayout={ parentLayout }\n\t\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\t\tpanelId={ panelId }\n\t\t\t/>\n\t\t);\n\t} else if ( parentLayoutType === 'grid' ) {\n\t\treturn (\n\t\t\t<GridControls\n\t\t\t\tchildLayout={ childLayout }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tparentLayout={ parentLayout }\n\t\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\t\tpanelId={ panelId }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn null;\n}\n\nfunction FlexControls( {\n\tchildLayout,\n\tonChange,\n\tparentLayout,\n\tisShownByDefault,\n\tpanelId,\n} ) {\n\tconst { selfStretch, flexSize } = childLayout;\n\tconst { orientation = 'horizontal' } = parentLayout ?? {};\n\tconst hasFlexValue = () => !! selfStretch;\n\tconst flexResetLabel =\n\t\torientation === 'horizontal' ? __( 'Width' ) : __( 'Height' );\n\tconst [ availableUnits ] = useSettings( 'spacing.units' );\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: availableUnits || [\n\t\t\t'%',\n\t\t\t'px',\n\t\t\t'em',\n\t\t\t'rem',\n\t\t\t'vh',\n\t\t\t'vw',\n\t\t],\n\t} );\n\tconst resetFlex = () => {\n\t\tonChange( {\n\t\t\tselfStretch: undefined,\n\t\t\tflexSize: undefined,\n\t\t} );\n\t};\n\n\tuseEffect( () => {\n\t\tif ( selfStretch === 'fixed' && ! flexSize ) {\n\t\t\tonChange( {\n\t\t\t\t...childLayout,\n\t\t\t\tselfStretch: 'fit',\n\t\t\t} );\n\t\t}\n\t}, [] );\n\n\treturn (\n\t\t<VStack\n\t\t\tas={ ToolsPanelItem }\n\t\t\tspacing={ 2 }\n\t\t\thasValue={ hasFlexValue }\n\t\t\tlabel={ flexResetLabel }\n\t\t\tonDeselect={ resetFlex }\n\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t<ToggleGroupControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\tlabel={ childLayoutOrientation( parentLayout ) }\n\t\t\t\tvalue={ selfStretch || 'fit' }\n\t\t\t\thelp={ helpText( selfStretch, parentLayout ) }\n\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\tconst newFlexSize = value !== 'fixed' ? null : flexSize;\n\t\t\t\t\tonChange( {\n\t\t\t\t\t\tselfStretch: value,\n\t\t\t\t\t\tflexSize: newFlexSize,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tisBlock\n\t\t\t>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"fit\"\n\t\t\t\t\tvalue=\"fit\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Fit',\n\t\t\t\t\t\t'Intrinsic block width in flex layout'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"fill\"\n\t\t\t\t\tvalue=\"fill\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Grow',\n\t\t\t\t\t\t'Block with expanding width in flex layout'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"fixed\"\n\t\t\t\t\tvalue=\"fixed\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Fixed',\n\t\t\t\t\t\t'Block with fixed width in flex layout'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</ToggleGroupControl>\n\t\t\t{ selfStretch === 'fixed' && (\n\t\t\t\t<UnitControl\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\tunits={ units }\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\tselfStretch,\n\t\t\t\t\t\t\tflexSize: value,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ flexSize }\n\t\t\t\t\tmin={ 0 }\n\t\t\t\t\tlabel={ flexResetLabel }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t/>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport function childLayoutOrientation( parentLayout ) {\n\tconst { orientation = 'horizontal' } = parentLayout;\n\treturn orientation === 'horizontal' ? __( 'Width' ) : __( 'Height' );\n}\n\nfunction GridControls( {\n\tchildLayout,\n\tonChange,\n\tparentLayout,\n\tisShownByDefault,\n\tpanelId,\n} ) {\n\tconst { columnStart, rowStart, columnSpan, rowSpan } = childLayout;\n\tconst { columnCount = 3, rowCount } = parentLayout ?? {};\n\tconst rootClientId = useSelect( ( select ) =>\n\t\tselect( blockEditorStore ).getBlockRootClientId( panelId )\n\t);\n\tconst { moveBlocksToPosition, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(\n\t\trootClientId,\n\t\tcolumnCount\n\t);\n\tconst hasStartValue = () => !! columnStart || !! rowStart;\n\tconst hasSpanValue = () => !! columnSpan || !! rowSpan;\n\tconst resetGridStarts = () => {\n\t\tonChange( {\n\t\t\tcolumnStart: undefined,\n\t\t\trowStart: undefined,\n\t\t} );\n\t};\n\tconst resetGridSpans = () => {\n\t\tonChange( {\n\t\t\tcolumnSpan: undefined,\n\t\t\trowSpan: undefined,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<HStack\n\t\t\t\tas={ ToolsPanelItem }\n\t\t\t\thasValue={ hasSpanValue }\n\t\t\t\tlabel={ __( 'Grid span' ) }\n\t\t\t\tonDeselect={ resetGridSpans }\n\t\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\t\tpanelId={ panelId }\n\t\t\t>\n\t\t\t\t<InputControl\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\tlabel={ __( 'Column span' ) }\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t// Don't allow unsetting.\n\t\t\t\t\t\tconst newColumnSpan =\n\t\t\t\t\t\t\tvalue === '' ? 1 : parseInt( value, 10 );\n\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\trowStart,\n\t\t\t\t\t\t\trowSpan,\n\t\t\t\t\t\t\tcolumnSpan: newColumnSpan,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ columnSpan ?? 1 }\n\t\t\t\t\tmin={ 1 }\n\t\t\t\t/>\n\t\t\t\t<InputControl\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\tlabel={ __( 'Row span' ) }\n\t\t\t\t\ttype=\"number\"\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t// Don't allow unsetting.\n\t\t\t\t\t\tconst newRowSpan =\n\t\t\t\t\t\t\tvalue === '' ? 1 : parseInt( value, 10 );\n\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\trowStart,\n\t\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\t\trowSpan: newRowSpan,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ rowSpan ?? 1 }\n\t\t\t\t\tmin={ 1 }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t\t{ window.__experimentalEnableGridInteractivity && columnCount && (\n\t\t\t\t// Use Flex with an explicit width on the FlexItem instead of HStack to\n\t\t\t\t// work around an issue in webkit where inputs with a max attribute are\n\t\t\t\t// sized incorrectly.\n\t\t\t\t<Flex\n\t\t\t\t\tas={ ToolsPanelItem }\n\t\t\t\t\thasValue={ hasStartValue }\n\t\t\t\t\tlabel={ __( 'Grid placement' ) }\n\t\t\t\t\tonDeselect={ resetGridStarts }\n\t\t\t\t\tisShownByDefault={ false }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<FlexItem style={ { width: '50%' } }>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tlabel={ __( 'Column' ) }\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t// Don't allow unsetting.\n\t\t\t\t\t\t\t\tconst newColumnStart =\n\t\t\t\t\t\t\t\t\tvalue === '' ? 1 : parseInt( value, 10 );\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\tcolumnStart: newColumnStart,\n\t\t\t\t\t\t\t\t\trowStart,\n\t\t\t\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\t\t\t\trowSpan,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t[ panelId ],\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\tgetNumberOfBlocksBeforeCell(\n\t\t\t\t\t\t\t\t\t\tnewColumnStart,\n\t\t\t\t\t\t\t\t\t\trowStart\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tvalue={ columnStart ?? 1 }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tcolumnCount\n\t\t\t\t\t\t\t\t\t? columnCount - ( columnSpan ?? 1 ) + 1\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem style={ { width: '50%' } }>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tlabel={ __( 'Row' ) }\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t// Don't allow unsetting.\n\t\t\t\t\t\t\t\tconst newRowStart =\n\t\t\t\t\t\t\t\t\tvalue === '' ? 1 : parseInt( value, 10 );\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\t\t\trowStart: newRowStart,\n\t\t\t\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\t\t\t\trowSpan,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t[ panelId ],\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\tgetNumberOfBlocksBeforeCell(\n\t\t\t\t\t\t\t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{"version":3,"names":["_components","require","_i18n","_element","_data","_useGetNumberOfBlocksBeforeCell","_store","_useSettings","_jsxRuntime","helpText","selfStretch","parentLayout","orientation","__","ChildLayoutControl","value","childLayout","onChange","isShownByDefault","panelId","type","parentType","default","defaultParentType","parentLayoutType","jsx","FlexControls","GridControls","flexSize","hasFlexValue","flexResetLabel","availableUnits","useSettings","units","useCustomUnits","resetFlex","undefined","useEffect","jsxs","__experimentalVStack","as","ToolsPanelItem","spacing","hasValue","label","onDeselect","children","__experimentalToggleGroupControl","__nextHasNoMarginBottom","size","childLayoutOrientation","help","newFlexSize","isBlock","__experimentalToggleGroupControlOption","_x","__experimentalUnitControl","min","hideLabelFromVision","columnStart","rowStart","columnSpan","rowSpan","columnCount","rowCount","rootClientId","useSelect","select","blockEditorStore","getBlockRootClientId","moveBlocksToPosition","__unstableMarkNextChangeAsNotPersistent","useDispatch","getNumberOfBlocksBeforeCell","useGetNumberOfBlocksBeforeCell","hasStartValue","hasSpanValue","resetGridStarts","resetGridSpans","maxColumnSpan","maxRowSpan","window","__experimentalEnableGridInteractivity","Fragment","Flex","FlexItem","style","width","__experimentalInputControl","newColumnSpan","parseInt","constrainedValue","Math","max","newRowSpan","newColumnStart","newRowStart"],"sources":["@wordpress/block-editor/src/components/child-layout-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalInputControl as InputControl,\n\t__experimentalVStack as VStack,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\tFlex,\n\tFlexItem,\n} from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useGetNumberOfBlocksBeforeCell } from '../grid/use-get-number-of-blocks-before-cell';\nimport { store as blockEditorStore } from '../../store';\nimport { useSettings } from '../use-settings';\n\nfunction helpText( selfStretch, parentLayout ) {\n\tconst { orientation = 'horizontal' } = parentLayout;\n\n\tif ( selfStretch === 'fill' ) {\n\t\treturn __( 'Stretch to fill available space.' );\n\t}\n\tif ( selfStretch === 'fixed' && orientation === 'horizontal' ) {\n\t\treturn __( 'Specify a fixed width.' );\n\t} else if ( selfStretch === 'fixed' ) {\n\t\treturn __( 'Specify a fixed height.' );\n\t}\n\treturn __( 'Fit contents.' );\n}\n\n/**\n * Form to edit the child layout value.\n *\n * @param {Object} props Props.\n * @param {Object} props.value The child layout value.\n * @param {Function} props.onChange Function to update the child layout value.\n * @param {Object} props.parentLayout The parent layout value.\n *\n * @param {boolean} props.isShownByDefault\n * @param {string} props.panelId\n * @return {Element} child layout edit element.\n */\nexport default function ChildLayoutControl( {\n\tvalue: childLayout = {},\n\tonChange,\n\tparentLayout,\n\tisShownByDefault,\n\tpanelId,\n} ) {\n\tconst {\n\t\ttype: parentType,\n\t\tdefault: { type: defaultParentType = 'default' } = {},\n\t} = parentLayout ?? {};\n\tconst parentLayoutType = parentType || defaultParentType;\n\n\tif ( parentLayoutType === 'flex' ) {\n\t\treturn (\n\t\t\t<FlexControls\n\t\t\t\tchildLayout={ childLayout }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tparentLayout={ parentLayout }\n\t\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\t\tpanelId={ panelId }\n\t\t\t/>\n\t\t);\n\t} else if ( parentLayoutType === 'grid' ) {\n\t\treturn (\n\t\t\t<GridControls\n\t\t\t\tchildLayout={ childLayout }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tparentLayout={ parentLayout }\n\t\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\t\tpanelId={ panelId }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn null;\n}\n\nfunction FlexControls( {\n\tchildLayout,\n\tonChange,\n\tparentLayout,\n\tisShownByDefault,\n\tpanelId,\n} ) {\n\tconst { selfStretch, flexSize } = childLayout;\n\tconst { orientation = 'horizontal' } = parentLayout ?? {};\n\tconst hasFlexValue = () => !! selfStretch;\n\tconst flexResetLabel =\n\t\torientation === 'horizontal' ? __( 'Width' ) : __( 'Height' );\n\tconst [ availableUnits ] = useSettings( 'spacing.units' );\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: availableUnits || [\n\t\t\t'%',\n\t\t\t'px',\n\t\t\t'em',\n\t\t\t'rem',\n\t\t\t'vh',\n\t\t\t'vw',\n\t\t],\n\t} );\n\tconst resetFlex = () => {\n\t\tonChange( {\n\t\t\tselfStretch: undefined,\n\t\t\tflexSize: undefined,\n\t\t} );\n\t};\n\n\tuseEffect( () => {\n\t\tif ( selfStretch === 'fixed' && ! flexSize ) {\n\t\t\tonChange( {\n\t\t\t\t...childLayout,\n\t\t\t\tselfStretch: 'fit',\n\t\t\t} );\n\t\t}\n\t}, [] );\n\n\treturn (\n\t\t<VStack\n\t\t\tas={ ToolsPanelItem }\n\t\t\tspacing={ 2 }\n\t\t\thasValue={ hasFlexValue }\n\t\t\tlabel={ flexResetLabel }\n\t\t\tonDeselect={ resetFlex }\n\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t<ToggleGroupControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\tlabel={ childLayoutOrientation( parentLayout ) }\n\t\t\t\tvalue={ selfStretch || 'fit' }\n\t\t\t\thelp={ helpText( selfStretch, parentLayout ) }\n\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\tconst newFlexSize = value !== 'fixed' ? null : flexSize;\n\t\t\t\t\tonChange( {\n\t\t\t\t\t\tselfStretch: value,\n\t\t\t\t\t\tflexSize: newFlexSize,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tisBlock\n\t\t\t>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"fit\"\n\t\t\t\t\tvalue=\"fit\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Fit',\n\t\t\t\t\t\t'Intrinsic block width in flex layout'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"fill\"\n\t\t\t\t\tvalue=\"fill\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Grow',\n\t\t\t\t\t\t'Block with expanding width in flex layout'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"fixed\"\n\t\t\t\t\tvalue=\"fixed\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Fixed',\n\t\t\t\t\t\t'Block with fixed width in flex layout'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</ToggleGroupControl>\n\t\t\t{ selfStretch === 'fixed' && (\n\t\t\t\t<UnitControl\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\tunits={ units }\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\tselfStretch,\n\t\t\t\t\t\t\tflexSize: value,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tvalue={ flexSize }\n\t\t\t\t\tmin={ 0 }\n\t\t\t\t\tlabel={ flexResetLabel }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t/>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n\nexport function childLayoutOrientation( parentLayout ) {\n\tconst { orientation = 'horizontal' } = parentLayout;\n\treturn orientation === 'horizontal' ? __( 'Width' ) : __( 'Height' );\n}\n\nfunction GridControls( {\n\tchildLayout,\n\tonChange,\n\tparentLayout,\n\tisShownByDefault,\n\tpanelId,\n} ) {\n\tconst { columnStart, rowStart, columnSpan, rowSpan } = childLayout;\n\tconst { columnCount, rowCount } = parentLayout ?? {};\n\tconst rootClientId = useSelect( ( select ) =>\n\t\tselect( blockEditorStore ).getBlockRootClientId( panelId )\n\t);\n\tconst { moveBlocksToPosition, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(\n\t\trootClientId,\n\t\tcolumnCount || 3\n\t);\n\tconst hasStartValue = () => !! columnStart || !! rowStart;\n\tconst hasSpanValue = () => !! columnSpan || !! rowSpan;\n\tconst resetGridStarts = () => {\n\t\tonChange( {\n\t\t\tcolumnStart: undefined,\n\t\t\trowStart: undefined,\n\t\t} );\n\t};\n\tconst resetGridSpans = () => {\n\t\tonChange( {\n\t\t\tcolumnSpan: undefined,\n\t\t\trowSpan: undefined,\n\t\t} );\n\t};\n\n\t// Calculate max column span based on current position and grid width\n\tconst maxColumnSpan = columnCount\n\t\t? columnCount - ( columnStart ?? 1 ) + 1\n\t\t: undefined;\n\n\t// Calculate max row span based on current position and grid height\n\tconst maxRowSpan =\n\t\twindow.__experimentalEnableGridInteractivity && rowCount\n\t\t\t? rowCount - ( rowStart ?? 1 ) + 1\n\t\t\t: undefined;\n\n\treturn (\n\t\t<>\n\t\t\t<Flex\n\t\t\t\tas={ ToolsPanelItem }\n\t\t\t\thasValue={ hasSpanValue }\n\t\t\t\tlabel={ __( 'Grid span' ) }\n\t\t\t\tonDeselect={ resetGridSpans }\n\t\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\t\tpanelId={ panelId }\n\t\t\t>\n\t\t\t\t<FlexItem style={ { width: '50%' } }>\n\t\t\t\t\t<InputControl\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\tlabel={ __( 'Column span' ) }\n\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t// Don't allow unsetting.\n\t\t\t\t\t\t\tconst newColumnSpan =\n\t\t\t\t\t\t\t\tvalue === '' ? 1 : parseInt( value, 10 );\n\t\t\t\t\t\t\tconst constrainedValue = maxColumnSpan\n\t\t\t\t\t\t\t\t? Math.min( newColumnSpan, maxColumnSpan )\n\t\t\t\t\t\t\t\t: newColumnSpan;\n\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\t\trowStart,\n\t\t\t\t\t\t\t\trowSpan,\n\t\t\t\t\t\t\t\tcolumnSpan: constrainedValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tvalue={ columnSpan ?? 1 }\n\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\tmax={ maxColumnSpan }\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t\t<FlexItem style={ { width: '50%' } }>\n\t\t\t\t\t<InputControl\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\tlabel={ __( 'Row span' ) }\n\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\tconst newRowSpan =\n\t\t\t\t\t\t\t\tvalue === '' ? 1 : parseInt( value, 10 );\n\t\t\t\t\t\t\tconst constrainedValue = maxRowSpan\n\t\t\t\t\t\t\t\t? Math.min( newRowSpan, maxRowSpan )\n\t\t\t\t\t\t\t\t: newRowSpan;\n\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\t\trowStart,\n\t\t\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\t\t\trowSpan: constrainedValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tvalue={ rowSpan ?? 1 }\n\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\tmax={ maxRowSpan }\n\t\t\t\t\t/>\n\t\t\t\t</FlexItem>\n\t\t\t</Flex>\n\n\t\t\t{ window.__experimentalEnableGridInteractivity && (\n\t\t\t\t// Use Flex with an explicit width on the FlexItem instead of HStack to\n\t\t\t\t// work around an issue in webkit where inputs with a max attribute are\n\t\t\t\t// sized incorrectly.\n\t\t\t\t<Flex\n\t\t\t\t\tas={ ToolsPanelItem }\n\t\t\t\t\thasValue={ hasStartValue }\n\t\t\t\t\tlabel={ __( 'Grid placement' ) }\n\t\t\t\t\tonDeselect={ resetGridStarts }\n\t\t\t\t\tisShownByDefault={ false }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<FlexItem style={ { width: '50%' } }>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tlabel={ __( 'Column' ) }\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t// Don't allow unsetting.\n\t\t\t\t\t\t\t\tconst newColumnStart =\n\t\t\t\t\t\t\t\t\tvalue === '' ? 1 : parseInt( value, 10 );\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\tcolumnStart: newColumnStart,\n\t\t\t\t\t\t\t\t\trowStart,\n\t\t\t\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\t\t\t\trowSpan,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t[ panelId ],\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\tgetNumberOfBlocksBeforeCell(\n\t\t\t\t\t\t\t\t\t\tnewColumnStart,\n\t\t\t\t\t\t\t\t\t\trowStart\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tvalue={ columnStart ?? 1 }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\tcolumnCount\n\t\t\t\t\t\t\t\t\t? columnCount - ( columnSpan ?? 1 ) + 1\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem style={ { width: '50%' } }>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tlabel={ __( 'Row' ) }\n\t\t\t\t\t\t\ttype=\"number\"\n\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t// Don't allow unsetting.\n\t\t\t\t\t\t\t\tconst newRowStart =\n\t\t\t\t\t\t\t\t\tvalue === '' ? 1 : parseInt( value, 10 );\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\t\t\trowStart: newRowStart,\n\t\t\t\t\t\t\t\t\tcolumnSpan,\n\t\t\t\t\t\t\t\t\trowSpan,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t\t\t[ panelId ],\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\t\t\t\tgetNumberOfBlocksBeforeCell(\n\t\t\t\t\t\t\t\t\t\tcolumnStart,\n\t\t\t\t\t\t\t\t\t\tnewRowStart\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tvalue={ rowStart ?? 1 }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tmax={\n\t\t\t\t\t\t\t\trowCount\n\t\t\t\t\t\t\t\t\t? rowCount - ( rowSpan ?? 1 ) + 1\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\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,QAAQ,EAAEoC,WAAW;cACrBnC,UAAU;cACVC;YACD,CAAE,CAAC;YACHS,uCAAuC,CAAC,CAAC;YACzCD,oBAAoB,CACnB,CAAEnD,OAAO,CAAE,EACX8C,YAAY,EACZA,YAAY,EACZQ,2BAA2B,CAC1Bd,WAAW,EACXqC,WACD,CACD,CAAC;UACF,CAAG;UACHjF,KAAK,EAAG6C,QAAQ,aAARA,QAAQ,cAARA,QAAQ,GAAI,CAAG;UACvBH,GAAG,EAAG,CAAG;UACToC,GAAG,EACF7B,QAAQ,GACLA,QAAQ,IAAKF,OAAO,aAAPA,OAAO,cAAPA,OAAO,GAAI,CAAC,CAAE,GAAG,CAAC,GAC/B1B;QACH,CACD;MAAC,CACO,CAAC;IAAA,CACN,CACN;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
@@ -102,16 +102,18 @@ const LinkControlSearchInput = (0, _element.forwardRef)(({
102
102
  }, suggestion);
103
103
  }
104
104
  };
105
+ const _placeholder = placeholder !== null && placeholder !== void 0 ? placeholder : (0, _i18n.__)('Search or type URL');
106
+ const label = hideLabelFromVision && placeholder !== '' ? _placeholder : (0, _i18n.__)('Link');
105
107
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
106
108
  className: "block-editor-link-control__search-input-container",
107
109
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.URLInput, {
108
110
  disableSuggestions: currentLink?.url === value,
109
- label: (0, _i18n.__)('Link'),
111
+ label: label,
110
112
  hideLabelFromVision: hideLabelFromVision,
111
113
  className: className,
112
114
  value: value,
113
115
  onChange: onInputChange,
114
- placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : (0, _i18n.__)('Search or type URL'),
116
+ placeholder: _placeholder,
115
117
  __experimentalRenderSuggestions: showSuggestions ? handleRenderSuggestions : null,
116
118
  __experimentalFetchLinkSuggestions: searchHandler,
117
119
  __experimentalHandleURLSuggestions: true,