@wordpress/block-library 9.13.0 → 9.13.1-next.a9f418477.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 (178) hide show
  1. package/build/block/edit.js +2 -29
  2. package/build/block/edit.js.map +1 -1
  3. package/build/cover/edit/index.js +4 -2
  4. package/build/cover/edit/index.js.map +1 -1
  5. package/build/cover/edit/inspector-controls.js +6 -4
  6. package/build/cover/edit/inspector-controls.js.map +1 -1
  7. package/build/form/index.js +1 -2
  8. package/build/form/index.js.map +1 -1
  9. package/build/form/view.js +10 -5
  10. package/build/form/view.js.map +1 -1
  11. package/build/list-item/hooks/use-merge.js +2 -2
  12. package/build/list-item/hooks/use-merge.js.map +1 -1
  13. package/build/navigation/edit/deleted-navigation-warning.js +9 -2
  14. package/build/navigation/edit/deleted-navigation-warning.js.map +1 -1
  15. package/build/navigation-link/edit.js +1 -2
  16. package/build/navigation-link/edit.js.map +1 -1
  17. package/build/navigation-submenu/edit.js +3 -1
  18. package/build/navigation-submenu/edit.js.map +1 -1
  19. package/build/pattern/recursion-detector.js +0 -1
  20. package/build/pattern/recursion-detector.js.map +1 -1
  21. package/build/query/edit/index.js +2 -2
  22. package/build/query/edit/index.js.map +1 -1
  23. package/build/query/edit/inspector-controls/author-control.js +0 -1
  24. package/build/query/edit/inspector-controls/author-control.js.map +1 -1
  25. package/build/query/edit/inspector-controls/parent-control.js +0 -1
  26. package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
  27. package/build/query/edit/inspector-controls/taxonomy-controls.js +0 -1
  28. package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  29. package/build/query/edit/{pattern-selection-modal.js → pattern-selection.js} +55 -36
  30. package/build/query/edit/pattern-selection.js.map +1 -0
  31. package/build/query/edit/query-content.js +5 -8
  32. package/build/query/edit/query-content.js.map +1 -1
  33. package/build/query/edit/query-placeholder.js +5 -11
  34. package/build/query/edit/query-placeholder.js.map +1 -1
  35. package/build/query/edit/query-toolbar.js +31 -11
  36. package/build/query/edit/query-toolbar.js.map +1 -1
  37. package/build/separator/deprecated.js +2 -1
  38. package/build/separator/deprecated.js.map +1 -1
  39. package/build/separator/edit.js +29 -4
  40. package/build/separator/edit.js.map +1 -1
  41. package/build/separator/index.js +5 -0
  42. package/build/separator/index.js.map +1 -1
  43. package/build/separator/save.js +3 -2
  44. package/build/separator/save.js.map +1 -1
  45. package/build/template-part/edit/import-controls.js +0 -1
  46. package/build/template-part/edit/import-controls.js.map +1 -1
  47. package/build-module/block/edit.js +3 -30
  48. package/build-module/block/edit.js.map +1 -1
  49. package/build-module/cover/edit/index.js +4 -2
  50. package/build-module/cover/edit/index.js.map +1 -1
  51. package/build-module/cover/edit/inspector-controls.js +6 -4
  52. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  53. package/build-module/form/index.js +1 -2
  54. package/build-module/form/index.js.map +1 -1
  55. package/build-module/form/view.js +10 -5
  56. package/build-module/form/view.js.map +1 -1
  57. package/build-module/list-item/hooks/use-merge.js +2 -2
  58. package/build-module/list-item/hooks/use-merge.js.map +1 -1
  59. package/build-module/navigation/edit/deleted-navigation-warning.js +10 -3
  60. package/build-module/navigation/edit/deleted-navigation-warning.js.map +1 -1
  61. package/build-module/navigation-link/edit.js +1 -2
  62. package/build-module/navigation-link/edit.js.map +1 -1
  63. package/build-module/navigation-submenu/edit.js +3 -1
  64. package/build-module/navigation-submenu/edit.js.map +1 -1
  65. package/build-module/pattern/recursion-detector.js +0 -1
  66. package/build-module/pattern/recursion-detector.js.map +1 -1
  67. package/build-module/query/edit/index.js +1 -1
  68. package/build-module/query/edit/index.js.map +1 -1
  69. package/build-module/query/edit/inspector-controls/author-control.js +0 -1
  70. package/build-module/query/edit/inspector-controls/author-control.js.map +1 -1
  71. package/build-module/query/edit/inspector-controls/parent-control.js +0 -1
  72. package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
  73. package/build-module/query/edit/inspector-controls/taxonomy-controls.js +0 -1
  74. package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  75. package/build-module/query/edit/{pattern-selection-modal.js → pattern-selection.js} +53 -36
  76. package/build-module/query/edit/pattern-selection.js.map +1 -0
  77. package/build-module/query/edit/query-content.js +5 -8
  78. package/build-module/query/edit/query-content.js.map +1 -1
  79. package/build-module/query/edit/query-placeholder.js +6 -12
  80. package/build-module/query/edit/query-placeholder.js.map +1 -1
  81. package/build-module/query/edit/query-toolbar.js +31 -13
  82. package/build-module/query/edit/query-toolbar.js.map +1 -1
  83. package/build-module/separator/deprecated.js +2 -1
  84. package/build-module/separator/deprecated.js.map +1 -1
  85. package/build-module/separator/edit.js +32 -7
  86. package/build-module/separator/edit.js.map +1 -1
  87. package/build-module/separator/index.js +5 -0
  88. package/build-module/separator/index.js.map +1 -1
  89. package/build-module/separator/save.js +3 -2
  90. package/build-module/separator/save.js.map +1 -1
  91. package/build-module/template-part/edit/import-controls.js +0 -1
  92. package/build-module/template-part/edit/import-controls.js.map +1 -1
  93. package/build-style/button/style-rtl.css +3 -3
  94. package/build-style/button/style.css +3 -3
  95. package/build-style/comments/editor-rtl.css +1 -1
  96. package/build-style/comments/editor.css +1 -1
  97. package/build-style/comments/style-rtl.css +1 -1
  98. package/build-style/comments/style.css +1 -1
  99. package/build-style/comments-pagination/editor-rtl.css +1 -0
  100. package/build-style/comments-pagination/editor.css +1 -0
  101. package/build-style/comments-pagination/style-rtl.css +1 -0
  102. package/build-style/comments-pagination/style.css +1 -0
  103. package/build-style/common-rtl.css +17 -17
  104. package/build-style/common.css +17 -17
  105. package/build-style/editor-rtl.css +72 -41
  106. package/build-style/editor.css +72 -41
  107. package/build-style/gallery/style-rtl.css +2 -2
  108. package/build-style/gallery/style.css +2 -2
  109. package/build-style/heading/style-rtl.css +11 -11
  110. package/build-style/heading/style.css +11 -11
  111. package/build-style/image/style-rtl.css +4 -3
  112. package/build-style/image/style.css +4 -3
  113. package/build-style/latest-comments/style-rtl.css +4 -4
  114. package/build-style/latest-comments/style.css +4 -4
  115. package/build-style/latest-posts/style-rtl.css +2 -1
  116. package/build-style/latest-posts/style.css +2 -1
  117. package/build-style/more/editor-rtl.css +1 -1
  118. package/build-style/more/editor.css +1 -1
  119. package/build-style/nextpage/editor-rtl.css +1 -1
  120. package/build-style/nextpage/editor.css +1 -1
  121. package/build-style/post-comments-form/style-rtl.css +2 -2
  122. package/build-style/post-comments-form/style.css +2 -2
  123. package/build-style/post-featured-image/editor-rtl.css +27 -27
  124. package/build-style/post-featured-image/editor.css +27 -27
  125. package/build-style/pullquote/style-rtl.css +1 -0
  126. package/build-style/pullquote/style.css +1 -0
  127. package/build-style/query/editor-rtl.css +30 -0
  128. package/build-style/query/editor.css +30 -0
  129. package/build-style/read-more/style-rtl.css +2 -2
  130. package/build-style/read-more/style.css +2 -2
  131. package/build-style/social-link/editor-rtl.css +2 -2
  132. package/build-style/social-link/editor.css +2 -2
  133. package/build-style/social-links/editor-rtl.css +2 -2
  134. package/build-style/social-links/editor.css +2 -2
  135. package/build-style/social-links/style-rtl.css +2 -2
  136. package/build-style/social-links/style.css +2 -2
  137. package/build-style/style-rtl.css +55 -51
  138. package/build-style/style.css +55 -51
  139. package/build-style/text-columns/style-rtl.css +3 -3
  140. package/build-style/text-columns/style.css +3 -3
  141. package/build-types/lock-unlock.d.ts +1 -1
  142. package/build-types/lock-unlock.d.ts.map +1 -1
  143. package/package.json +35 -34
  144. package/src/block/edit.js +6 -51
  145. package/src/comments-pagination/editor.scss +1 -0
  146. package/src/comments-pagination/style.scss +1 -0
  147. package/src/cover/edit/index.js +4 -1
  148. package/src/cover/edit/inspector-controls.js +10 -3
  149. package/src/cover/index.php +2 -2
  150. package/src/form/block.json +1 -2
  151. package/src/form/index.php +1 -20
  152. package/src/form/view.js +18 -5
  153. package/src/image/style.scss +4 -3
  154. package/src/latest-posts/style.scss +2 -1
  155. package/src/list-item/hooks/use-merge.js +2 -2
  156. package/src/missing/test/edit.native.js +0 -1
  157. package/src/navigation/README.md +1 -0
  158. package/src/navigation/edit/deleted-navigation-warning.js +11 -2
  159. package/src/navigation/index.php +9 -35
  160. package/src/navigation-link/edit.js +0 -6
  161. package/src/navigation-submenu/edit.js +5 -6
  162. package/src/navigation-submenu/index.php +17 -1
  163. package/src/pullquote/style.scss +1 -0
  164. package/src/query/edit/index.js +1 -1
  165. package/src/query/edit/{pattern-selection-modal.js → pattern-selection.js} +53 -33
  166. package/src/query/edit/query-content.js +4 -10
  167. package/src/query/edit/query-placeholder.js +5 -14
  168. package/src/query/edit/query-toolbar.js +38 -17
  169. package/src/query/editor.scss +30 -0
  170. package/src/search/index.php +3 -3
  171. package/src/separator/block.json +5 -0
  172. package/src/separator/deprecated.js +1 -0
  173. package/src/separator/edit.js +28 -3
  174. package/src/separator/save.js +2 -2
  175. package/src/separator/test/edit.js +1 -0
  176. package/tsconfig.tsbuildinfo +1 -1
  177. package/build/query/edit/pattern-selection-modal.js.map +0 -1
  178. package/build-module/query/edit/pattern-selection-modal.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useEntityProp","store","coreStore","useEffect","useMemo","useRef","Placeholder","Spinner","compose","useResizeObserver","withColors","ColorPalette","useBlockProps","useSettings","useInnerBlocksProps","__experimentalUseGradient","blockEditorStore","useBlockEditingMode","__","useSelect","useDispatch","isBlobURL","noticesStore","attributesFromMedia","IMAGE_BACKGROUND_TYPE","VIDEO_BACKGROUND_TYPE","dimRatioToClass","isContentPositionCenter","getPositionClassName","mediaPosition","CoverInspectorControls","CoverBlockControls","CoverPlaceholder","ResizableCoverPopover","getMediaColor","compositeIsDark","DEFAULT_BACKGROUND_COLOR","DEFAULT_OVERLAY_COLOR","DEFAULT_MEDIA_SIZE_SLUG","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","getInnerBlocksTemplate","attributes","align","placeholder","isTemporaryMedia","id","url","CoverEdit","clientId","isSelected","overlayColor","setAttributes","setOverlayColor","toggleSelection","context","postId","postType","contentPosition","originalUrl","backgroundType","originalBackgroundType","useFeaturedImage","dimRatio","focalPoint","hasParallax","isDark","isRepeated","minHeight","minHeightUnit","alt","allowedBlocks","templateLock","tagName","TagName","isUserOverlayColor","sizeSlug","featuredImage","getSettings","__unstableMarkNextChangeAsNotPersistent","media","select","getMedia","mediaUrl","source_url","averageBackgroundColor","newOverlayColor","color","newIsDark","replaceAll","createErrorNotice","gradientClass","gradientValue","onSelectMedia","newMedia","mediaAttributes","isImage","type","media_type","includes","undefined","newDimRatio","imageDefaultSize","sizes","media_details","onClearMedia","onSetOverlayColor","onUpdateDimRatio","onUploadError","message","isUploadingMedia","isImageBackground","isVideoBackground","blockEditingMode","hasNonContentControls","resizeListener","height","width","resizableBoxDimensions","minHeightWithUnit","isImgElement","style","backgroundImage","backgroundPosition","bgStyle","backgroundColor","mediaStyle","objectPosition","hasBackground","hasInnerBlocks","getBlock","innerBlocks","length","ref","blockProps","fontSizes","hasFontSizes","innerBlocksTemplate","fontSize","innerBlocksProps","className","template","templateInsertUpdatesSelection","dropZoneElement","current","mediaElement","currentSettings","toggleUseFeaturedImage","newUseFeaturedImage","blockControls","inspectorControls","coverRef","updateDimRatio","resizableCoverProps","onResizeStart","onResize","value","onResizeStop","newMinHeight","showHandle","dimensions","aspectRatio","size","children","onError","disableCustomColors","onChange","clearable","classes","showOverlay","withIllustration","src","role","autoPlay","muted","loop","class","disableMediaButtons"],"sources":["@wordpress/block-library/src/cover/edit/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useMemo, useRef } from '@wordpress/element';\nimport { Placeholder, Spinner } from '@wordpress/components';\nimport { compose, useResizeObserver } from '@wordpress/compose';\nimport {\n\twithColors,\n\tColorPalette,\n\tuseBlockProps,\n\tuseSettings,\n\tuseInnerBlocksProps,\n\t__experimentalUseGradient,\n\tstore as blockEditorStore,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { isBlobURL } from '@wordpress/blob';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport {\n\tattributesFromMedia,\n\tIMAGE_BACKGROUND_TYPE,\n\tVIDEO_BACKGROUND_TYPE,\n\tdimRatioToClass,\n\tisContentPositionCenter,\n\tgetPositionClassName,\n\tmediaPosition,\n} from '../shared';\nimport CoverInspectorControls from './inspector-controls';\nimport CoverBlockControls from './block-controls';\nimport CoverPlaceholder from './cover-placeholder';\nimport ResizableCoverPopover from './resizable-cover-popover';\nimport {\n\tgetMediaColor,\n\tcompositeIsDark,\n\tDEFAULT_BACKGROUND_COLOR,\n\tDEFAULT_OVERLAY_COLOR,\n} from './color-utils';\nimport { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';\n\nfunction getInnerBlocksTemplate( attributes ) {\n\treturn [\n\t\t[\n\t\t\t'core/paragraph',\n\t\t\t{\n\t\t\t\talign: 'center',\n\t\t\t\tplaceholder: __( 'Write title…' ),\n\t\t\t\t...attributes,\n\t\t\t},\n\t\t],\n\t];\n}\n\n/**\n * Is the URL a temporary blob URL? A blob URL is one that is used temporarily while\n * the media (image or video) is being uploaded and will not have an id allocated yet.\n *\n * @param {number} id The id of the media.\n * @param {string} url The url of the media.\n *\n * @return {boolean} Is the URL a Blob URL.\n */\nconst isTemporaryMedia = ( id, url ) => ! id && isBlobURL( url );\n\nfunction CoverEdit( {\n\tattributes,\n\tclientId,\n\tisSelected,\n\toverlayColor,\n\tsetAttributes,\n\tsetOverlayColor,\n\ttoggleSelection,\n\tcontext: { postId, postType },\n} ) {\n\tconst {\n\t\tcontentPosition,\n\t\tid,\n\t\turl: originalUrl,\n\t\tbackgroundType: originalBackgroundType,\n\t\tuseFeaturedImage,\n\t\tdimRatio,\n\t\tfocalPoint,\n\t\thasParallax,\n\t\tisDark,\n\t\tisRepeated,\n\t\tminHeight,\n\t\tminHeightUnit,\n\t\talt,\n\t\tallowedBlocks,\n\t\ttemplateLock,\n\t\ttagName: TagName = 'div',\n\t\tisUserOverlayColor,\n\t\tsizeSlug,\n\t} = attributes;\n\n\tconst [ featuredImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\tconst { getSettings } = useSelect( blockEditorStore );\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst media = useSelect(\n\t\t( select ) =>\n\t\t\tfeaturedImage &&\n\t\t\tselect( coreStore ).getMedia( featuredImage, { context: 'view' } ),\n\t\t[ featuredImage ]\n\t);\n\tconst mediaUrl = media?.source_url;\n\n\t// User can change the featured image outside of the block, but we still\n\t// need to update the block when that happens. This effect should only\n\t// run when the featured image changes in that case. All other cases are\n\t// handled in their respective callbacks.\n\tuseEffect( () => {\n\t\t( async () => {\n\t\t\tif ( ! useFeaturedImage ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst averageBackgroundColor = await getMediaColor( mediaUrl );\n\n\t\t\tlet newOverlayColor = overlayColor.color;\n\t\t\tif ( ! isUserOverlayColor ) {\n\t\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t}\n\n\t\t\tconst newIsDark = compositeIsDark(\n\t\t\t\tdimRatio,\n\t\t\t\tnewOverlayColor,\n\t\t\t\taverageBackgroundColor\n\t\t\t);\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tisDark: newIsDark,\n\t\t\t\tisUserOverlayColor: isUserOverlayColor || false,\n\t\t\t} );\n\t\t} )();\n\t\t// Update the block only when the featured image changes.\n\t}, [ mediaUrl ] );\n\n\t// instead of destructuring the attributes\n\t// we define the url and background type\n\t// depending on the value of the useFeaturedImage flag\n\t// to preview in edit the dynamic featured image\n\tconst url = useFeaturedImage\n\t\t? mediaUrl\n\t\t: // Ensure the url is not malformed due to sanitization through `wp_kses`.\n\t\t originalUrl?.replaceAll( '&amp;', '&' );\n\tconst backgroundType = useFeaturedImage\n\t\t? IMAGE_BACKGROUND_TYPE\n\t\t: originalBackgroundType;\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { gradientClass, gradientValue } = __experimentalUseGradient();\n\n\tconst onSelectMedia = async ( newMedia ) => {\n\t\tconst mediaAttributes = attributesFromMedia( newMedia );\n\t\tconst isImage = [ newMedia?.type, newMedia?.media_type ].includes(\n\t\t\tIMAGE_BACKGROUND_TYPE\n\t\t);\n\n\t\tconst averageBackgroundColor = await getMediaColor(\n\t\t\tisImage ? newMedia?.url : undefined\n\t\t);\n\n\t\tlet newOverlayColor = overlayColor.color;\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\tsetOverlayColor( newOverlayColor );\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\t// Only set a new dimRatio if there was no previous media selected\n\t\t// to avoid resetting to 50 if it has been explicitly set to 100.\n\t\t// See issue #52835 for context.\n\t\tconst newDimRatio =\n\t\t\toriginalUrl === undefined && dimRatio === 100 ? 50 : dimRatio;\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tif ( backgroundType === IMAGE_BACKGROUND_TYPE && mediaAttributes?.id ) {\n\t\t\tconst { imageDefaultSize } = getSettings();\n\n\t\t\t// Try to use the previous selected image size if it's available\n\t\t\t// otherwise try the default image size or fallback to full size.\n\t\t\tif (\n\t\t\t\tsizeSlug &&\n\t\t\t\t( newMedia?.sizes?.[ sizeSlug ] ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ sizeSlug ] )\n\t\t\t) {\n\t\t\t\tmediaAttributes.sizeSlug = sizeSlug;\n\t\t\t\tmediaAttributes.url =\n\t\t\t\t\tnewMedia?.sizes?.[ sizeSlug ]?.url ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ sizeSlug ]?.source_url;\n\t\t\t} else if (\n\t\t\t\tnewMedia?.sizes?.[ imageDefaultSize ] ||\n\t\t\t\tnewMedia?.media_details?.sizes?.[ imageDefaultSize ]\n\t\t\t) {\n\t\t\t\tmediaAttributes.sizeSlug = imageDefaultSize;\n\t\t\t\tmediaAttributes.url =\n\t\t\t\t\tnewMedia?.sizes?.[ imageDefaultSize ]?.url ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ imageDefaultSize ]\n\t\t\t\t\t\t?.source_url;\n\t\t\t} else {\n\t\t\t\tmediaAttributes.sizeSlug = DEFAULT_MEDIA_SIZE_SLUG;\n\t\t\t}\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\t...mediaAttributes,\n\t\t\tfocalPoint: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t\tdimRatio: newDimRatio,\n\t\t\tisDark: newIsDark,\n\t\t\tisUserOverlayColor: isUserOverlayColor || false,\n\t\t} );\n\t};\n\n\tconst onClearMedia = () => {\n\t\tlet newOverlayColor = overlayColor.color;\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tnewOverlayColor = DEFAULT_OVERLAY_COLOR;\n\t\t\tsetOverlayColor( undefined );\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tdimRatio,\n\t\t\tnewOverlayColor,\n\t\t\tDEFAULT_BACKGROUND_COLOR\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tid: undefined,\n\t\t\tbackgroundType: undefined,\n\t\t\tfocalPoint: undefined,\n\t\t\thasParallax: undefined,\n\t\t\tisRepeated: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onSetOverlayColor = async ( newOverlayColor ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tdimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetOverlayColor( newOverlayColor );\n\n\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\n\t\tsetAttributes( {\n\t\t\tisUserOverlayColor: true,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onUpdateDimRatio = async ( newDimRatio ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\toverlayColor.color,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\tdimRatio: newDimRatio,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t};\n\n\tconst isUploadingMedia = isTemporaryMedia( id, url );\n\n\tconst isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;\n\tconst isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;\n\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\n\tconst [ resizeListener, { height, width } ] = useResizeObserver();\n\tconst resizableBoxDimensions = useMemo( () => {\n\t\treturn {\n\t\t\theight: minHeightUnit === 'px' ? minHeight : 'auto',\n\t\t\twidth: 'auto',\n\t\t};\n\t}, [ minHeight, minHeightUnit ] );\n\n\tconst minHeightWithUnit =\n\t\tminHeight && minHeightUnit\n\t\t\t? `${ minHeight }${ minHeightUnit }`\n\t\t\t: minHeight;\n\n\tconst isImgElement = ! ( hasParallax || isRepeated );\n\n\tconst style = {\n\t\tminHeight: minHeightWithUnit || undefined,\n\t};\n\n\tconst backgroundImage = url ? `url(${ url })` : undefined;\n\n\tconst backgroundPosition = mediaPosition( focalPoint );\n\n\tconst bgStyle = { backgroundColor: overlayColor.color };\n\tconst mediaStyle = {\n\t\tobjectPosition:\n\t\t\tfocalPoint && isImgElement\n\t\t\t\t? mediaPosition( focalPoint )\n\t\t\t\t: undefined,\n\t};\n\n\tconst hasBackground = !! ( url || overlayColor.color || gradientValue );\n\n\tconst hasInnerBlocks = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlock( clientId ).innerBlocks.length >\n\t\t\t0,\n\t\t[ clientId ]\n\t);\n\n\tconst ref = useRef();\n\tconst blockProps = useBlockProps( { ref } );\n\n\t// Check for fontSize support before we pass a fontSize attribute to the innerBlocks.\n\tconst [ fontSizes ] = useSettings( 'typography.fontSizes' );\n\tconst hasFontSizes = fontSizes?.length > 0;\n\tconst innerBlocksTemplate = getInnerBlocksTemplate( {\n\t\tfontSize: hasFontSizes ? 'large' : undefined,\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tclassName: 'wp-block-cover__inner-container',\n\t\t},\n\t\t{\n\t\t\t// Avoid template sync when the `templateLock` value is `all` or `contentOnly`.\n\t\t\t// See: https://github.com/WordPress/gutenberg/pull/45632\n\t\t\ttemplate: ! hasInnerBlocks ? innerBlocksTemplate : undefined,\n\t\t\ttemplateInsertUpdatesSelection: true,\n\t\t\tallowedBlocks,\n\t\t\ttemplateLock,\n\t\t\tdropZoneElement: ref.current,\n\t\t}\n\t);\n\n\tconst mediaElement = useRef();\n\tconst currentSettings = {\n\t\tisVideoBackground,\n\t\tisImageBackground,\n\t\tmediaElement,\n\t\thasInnerBlocks,\n\t\turl,\n\t\tisImgElement,\n\t\toverlayColor,\n\t};\n\n\tconst toggleUseFeaturedImage = async () => {\n\t\tconst newUseFeaturedImage = ! useFeaturedImage;\n\n\t\tconst averageBackgroundColor = newUseFeaturedImage\n\t\t\t? await getMediaColor( mediaUrl )\n\t\t\t: DEFAULT_BACKGROUND_COLOR;\n\n\t\tconst newOverlayColor = ! isUserOverlayColor\n\t\t\t? averageBackgroundColor\n\t\t\t: overlayColor.color;\n\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tif ( newUseFeaturedImage ) {\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t} else {\n\t\t\t\tsetOverlayColor( undefined );\n\t\t\t}\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newDimRatio = dimRatio === 100 ? 50 : dimRatio;\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\tid: undefined,\n\t\t\turl: undefined,\n\t\t\tuseFeaturedImage: newUseFeaturedImage,\n\t\t\tdimRatio: newDimRatio,\n\t\t\tbackgroundType: useFeaturedImage\n\t\t\t\t? IMAGE_BACKGROUND_TYPE\n\t\t\t\t: undefined,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst blockControls = (\n\t\t<CoverBlockControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t/>\n\t);\n\n\tconst inspectorControls = (\n\t\t<CoverInspectorControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tclientId={ clientId }\n\t\t\tsetOverlayColor={ onSetOverlayColor }\n\t\t\tcoverRef={ ref }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tupdateDimRatio={ onUpdateDimRatio }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t/>\n\t);\n\n\tconst resizableCoverProps = {\n\t\tclassName: 'block-library-cover__resize-container',\n\t\tclientId,\n\t\theight,\n\t\tminHeight: minHeightWithUnit,\n\t\tonResizeStart: () => {\n\t\t\tsetAttributes( { minHeightUnit: 'px' } );\n\t\t\ttoggleSelection( false );\n\t\t},\n\t\tonResize: ( value ) => {\n\t\t\tsetAttributes( { minHeight: value } );\n\t\t},\n\t\tonResizeStop: ( newMinHeight ) => {\n\t\t\ttoggleSelection( true );\n\t\t\tsetAttributes( { minHeight: newMinHeight } );\n\t\t},\n\t\t// Hide the resize handle if an aspect ratio is set, as the aspect ratio takes precedence.\n\t\tshowHandle: ! attributes.style?.dimensions?.aspectRatio,\n\t\tsize: resizableBoxDimensions,\n\t\twidth,\n\t};\n\n\tif ( ! useFeaturedImage && ! hasInnerBlocks && ! hasBackground ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ blockControls }\n\t\t\t\t{ inspectorControls }\n\t\t\t\t{ hasNonContentControls && isSelected && (\n\t\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t\t) }\n\t\t\t\t<TagName\n\t\t\t\t\t{ ...blockProps }\n\t\t\t\t\tclassName={ clsx( 'is-placeholder', blockProps.className ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...blockProps.style,\n\t\t\t\t\t\tminHeight: minHeightWithUnit || undefined,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ resizeListener }\n\t\t\t\t\t<CoverPlaceholder\n\t\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className=\"wp-block-cover__placeholder-background-options\">\n\t\t\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\t\t\tdisableCustomColors\n\t\t\t\t\t\t\t\tvalue={ overlayColor.color }\n\t\t\t\t\t\t\t\tonChange={ onSetOverlayColor }\n\t\t\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</CoverPlaceholder>\n\t\t\t\t</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst classes = clsx(\n\t\t{\n\t\t\t'is-dark-theme': isDark,\n\t\t\t'is-light': ! isDark,\n\t\t\t'is-transient': isUploadingMedia,\n\t\t\t'has-parallax': hasParallax,\n\t\t\t'is-repeated': isRepeated,\n\t\t\t'has-custom-content-position':\n\t\t\t\t! isContentPositionCenter( contentPosition ),\n\t\t},\n\t\tgetPositionClassName( contentPosition )\n\t);\n\n\tconst showOverlay =\n\t\turl || ! useFeaturedImage || ( useFeaturedImage && ! url );\n\n\treturn (\n\t\t<>\n\t\t\t{ blockControls }\n\t\t\t{ inspectorControls }\n\t\t\t<TagName\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( classes, blockProps.className ) }\n\t\t\t\tstyle={ { ...style, ...blockProps.style } }\n\t\t\t\tdata-url={ url }\n\t\t\t>\n\t\t\t\t{ resizeListener }\n\n\t\t\t\t{ ! url && useFeaturedImage && (\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\tclassName=\"wp-block-cover__image--placeholder-image\"\n\t\t\t\t\t\twithIllustration\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ url &&\n\t\t\t\t\tisImageBackground &&\n\t\t\t\t\t( isImgElement ? (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\tclassName=\"wp-block-cover__image-background\"\n\t\t\t\t\t\t\talt={ alt }\n\t\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\trole={ alt ? 'img' : undefined }\n\t\t\t\t\t\t\taria-label={ alt ? alt : undefined }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\tclasses,\n\t\t\t\t\t\t\t\t'wp-block-cover__image-background'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tstyle={ { backgroundImage, backgroundPosition } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t{ url && isVideoBackground && (\n\t\t\t\t\t<video\n\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\tclassName=\"wp-block-cover__video-background\"\n\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\tmuted\n\t\t\t\t\t\tloop\n\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ showOverlay && (\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'wp-block-cover__background',\n\t\t\t\t\t\t\tdimRatioToClass( dimRatio ),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t[ overlayColor.class ]: overlayColor.class,\n\t\t\t\t\t\t\t\t'has-background-dim': dimRatio !== undefined,\n\t\t\t\t\t\t\t\t// For backwards compatibility. Former versions of the Cover Block applied\n\t\t\t\t\t\t\t\t// `.wp-block-cover__gradient-background` in the presence of\n\t\t\t\t\t\t\t\t// media, a gradient and a dim.\n\t\t\t\t\t\t\t\t'wp-block-cover__gradient-background':\n\t\t\t\t\t\t\t\t\turl && gradientValue && dimRatio !== 0,\n\t\t\t\t\t\t\t\t'has-background-gradient': gradientValue,\n\t\t\t\t\t\t\t\t[ gradientClass ]: gradientClass,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tstyle={ { backgroundImage: gradientValue, ...bgStyle } }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ isUploadingMedia && <Spinner /> }\n\n\t\t\t\t<CoverPlaceholder\n\t\t\t\t\tdisableMediaButtons\n\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t/>\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</TagName>\n\t\t\t{ hasNonContentControls && isSelected && (\n\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default compose( [\n\twithColors( { overlayColor: 'background-color' } ),\n] )( CoverEdit );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,aAAa,EAAEC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACxE,SAASC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,oBAAoB;AAC/D,SAASC,WAAW,EAAEC,OAAO,QAAQ,uBAAuB;AAC5D,SAASC,OAAO,EAAEC,iBAAiB,QAAQ,oBAAoB;AAC/D,SACCC,UAAU,EACVC,YAAY,EACZC,aAAa,EACbC,WAAW,EACXC,mBAAmB,EACnBC,yBAAyB,EACzBd,KAAK,IAAIe,gBAAgB,EACzBC,mBAAmB,QACb,yBAAyB;AAChC,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASpB,KAAK,IAAIqB,YAAY,QAAQ,oBAAoB;;AAE1D;AACA;AACA;AACA,SACCC,mBAAmB,EACnBC,qBAAqB,EACrBC,qBAAqB,EACrBC,eAAe,EACfC,uBAAuB,EACvBC,oBAAoB,EACpBC,aAAa,QACP,WAAW;AAClB,OAAOC,sBAAsB,MAAM,sBAAsB;AACzD,OAAOC,kBAAkB,MAAM,kBAAkB;AACjD,O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x","useEntityProp","store","coreStore","useEffect","useMemo","useRef","Placeholder","Spinner","compose","useResizeObserver","withColors","ColorPalette","useBlockProps","useSettings","useInnerBlocksProps","__experimentalUseGradient","blockEditorStore","useBlockEditingMode","__","useSelect","useDispatch","isBlobURL","noticesStore","attributesFromMedia","IMAGE_BACKGROUND_TYPE","VIDEO_BACKGROUND_TYPE","dimRatioToClass","isContentPositionCenter","getPositionClassName","mediaPosition","CoverInspectorControls","CoverBlockControls","CoverPlaceholder","ResizableCoverPopover","getMediaColor","compositeIsDark","DEFAULT_BACKGROUND_COLOR","DEFAULT_OVERLAY_COLOR","DEFAULT_MEDIA_SIZE_SLUG","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","getInnerBlocksTemplate","attributes","align","placeholder","isTemporaryMedia","id","url","CoverEdit","clientId","isSelected","overlayColor","setAttributes","setOverlayColor","toggleSelection","context","postId","postType","_media$media_details$","contentPosition","originalUrl","backgroundType","originalBackgroundType","useFeaturedImage","dimRatio","focalPoint","hasParallax","isDark","isRepeated","minHeight","minHeightUnit","alt","allowedBlocks","templateLock","tagName","TagName","isUserOverlayColor","sizeSlug","featuredImage","getSettings","__unstableMarkNextChangeAsNotPersistent","media","select","getMedia","mediaUrl","media_details","sizes","source_url","averageBackgroundColor","newOverlayColor","color","newIsDark","replaceAll","createErrorNotice","gradientClass","gradientValue","onSelectMedia","newMedia","mediaAttributes","isImage","type","media_type","includes","undefined","newDimRatio","imageDefaultSize","onClearMedia","onSetOverlayColor","onUpdateDimRatio","onUploadError","message","isUploadingMedia","isImageBackground","isVideoBackground","blockEditingMode","hasNonContentControls","resizeListener","height","width","resizableBoxDimensions","minHeightWithUnit","isImgElement","style","backgroundImage","backgroundPosition","bgStyle","backgroundColor","mediaStyle","objectPosition","hasBackground","hasInnerBlocks","getBlock","innerBlocks","length","ref","blockProps","fontSizes","hasFontSizes","innerBlocksTemplate","fontSize","innerBlocksProps","className","template","templateInsertUpdatesSelection","dropZoneElement","current","mediaElement","currentSettings","toggleUseFeaturedImage","newUseFeaturedImage","blockControls","inspectorControls","coverRef","updateDimRatio","resizableCoverProps","onResizeStart","onResize","value","onResizeStop","newMinHeight","showHandle","dimensions","aspectRatio","size","children","onError","disableCustomColors","onChange","clearable","classes","showOverlay","withIllustration","src","role","autoPlay","muted","loop","class","disableMediaButtons"],"sources":["@wordpress/block-library/src/cover/edit/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useMemo, useRef } from '@wordpress/element';\nimport { Placeholder, Spinner } from '@wordpress/components';\nimport { compose, useResizeObserver } from '@wordpress/compose';\nimport {\n\twithColors,\n\tColorPalette,\n\tuseBlockProps,\n\tuseSettings,\n\tuseInnerBlocksProps,\n\t__experimentalUseGradient,\n\tstore as blockEditorStore,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { isBlobURL } from '@wordpress/blob';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport {\n\tattributesFromMedia,\n\tIMAGE_BACKGROUND_TYPE,\n\tVIDEO_BACKGROUND_TYPE,\n\tdimRatioToClass,\n\tisContentPositionCenter,\n\tgetPositionClassName,\n\tmediaPosition,\n} from '../shared';\nimport CoverInspectorControls from './inspector-controls';\nimport CoverBlockControls from './block-controls';\nimport CoverPlaceholder from './cover-placeholder';\nimport ResizableCoverPopover from './resizable-cover-popover';\nimport {\n\tgetMediaColor,\n\tcompositeIsDark,\n\tDEFAULT_BACKGROUND_COLOR,\n\tDEFAULT_OVERLAY_COLOR,\n} from './color-utils';\nimport { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';\n\nfunction getInnerBlocksTemplate( attributes ) {\n\treturn [\n\t\t[\n\t\t\t'core/paragraph',\n\t\t\t{\n\t\t\t\talign: 'center',\n\t\t\t\tplaceholder: __( 'Write title…' ),\n\t\t\t\t...attributes,\n\t\t\t},\n\t\t],\n\t];\n}\n\n/**\n * Is the URL a temporary blob URL? A blob URL is one that is used temporarily while\n * the media (image or video) is being uploaded and will not have an id allocated yet.\n *\n * @param {number} id The id of the media.\n * @param {string} url The url of the media.\n *\n * @return {boolean} Is the URL a Blob URL.\n */\nconst isTemporaryMedia = ( id, url ) => ! id && isBlobURL( url );\n\nfunction CoverEdit( {\n\tattributes,\n\tclientId,\n\tisSelected,\n\toverlayColor,\n\tsetAttributes,\n\tsetOverlayColor,\n\ttoggleSelection,\n\tcontext: { postId, postType },\n} ) {\n\tconst {\n\t\tcontentPosition,\n\t\tid,\n\t\turl: originalUrl,\n\t\tbackgroundType: originalBackgroundType,\n\t\tuseFeaturedImage,\n\t\tdimRatio,\n\t\tfocalPoint,\n\t\thasParallax,\n\t\tisDark,\n\t\tisRepeated,\n\t\tminHeight,\n\t\tminHeightUnit,\n\t\talt,\n\t\tallowedBlocks,\n\t\ttemplateLock,\n\t\ttagName: TagName = 'div',\n\t\tisUserOverlayColor,\n\t\tsizeSlug,\n\t} = attributes;\n\n\tconst [ featuredImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\tconst { getSettings } = useSelect( blockEditorStore );\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst media = useSelect(\n\t\t( select ) =>\n\t\t\tfeaturedImage &&\n\t\t\tselect( coreStore ).getMedia( featuredImage, { context: 'view' } ),\n\t\t[ featuredImage ]\n\t);\n\tconst mediaUrl =\n\t\tmedia?.media_details?.sizes?.[ sizeSlug ]?.source_url ??\n\t\tmedia?.source_url;\n\n\t// User can change the featured image outside of the block, but we still\n\t// need to update the block when that happens. This effect should only\n\t// run when the featured image changes in that case. All other cases are\n\t// handled in their respective callbacks.\n\tuseEffect( () => {\n\t\t( async () => {\n\t\t\tif ( ! useFeaturedImage ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst averageBackgroundColor = await getMediaColor( mediaUrl );\n\n\t\t\tlet newOverlayColor = overlayColor.color;\n\t\t\tif ( ! isUserOverlayColor ) {\n\t\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t}\n\n\t\t\tconst newIsDark = compositeIsDark(\n\t\t\t\tdimRatio,\n\t\t\t\tnewOverlayColor,\n\t\t\t\taverageBackgroundColor\n\t\t\t);\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tisDark: newIsDark,\n\t\t\t\tisUserOverlayColor: isUserOverlayColor || false,\n\t\t\t} );\n\t\t} )();\n\t\t// Update the block only when the featured image changes.\n\t}, [ mediaUrl ] );\n\n\t// instead of destructuring the attributes\n\t// we define the url and background type\n\t// depending on the value of the useFeaturedImage flag\n\t// to preview in edit the dynamic featured image\n\tconst url = useFeaturedImage\n\t\t? mediaUrl\n\t\t: // Ensure the url is not malformed due to sanitization through `wp_kses`.\n\t\t originalUrl?.replaceAll( '&amp;', '&' );\n\tconst backgroundType = useFeaturedImage\n\t\t? IMAGE_BACKGROUND_TYPE\n\t\t: originalBackgroundType;\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { gradientClass, gradientValue } = __experimentalUseGradient();\n\n\tconst onSelectMedia = async ( newMedia ) => {\n\t\tconst mediaAttributes = attributesFromMedia( newMedia );\n\t\tconst isImage = [ newMedia?.type, newMedia?.media_type ].includes(\n\t\t\tIMAGE_BACKGROUND_TYPE\n\t\t);\n\n\t\tconst averageBackgroundColor = await getMediaColor(\n\t\t\tisImage ? newMedia?.url : undefined\n\t\t);\n\n\t\tlet newOverlayColor = overlayColor.color;\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\tsetOverlayColor( newOverlayColor );\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\t// Only set a new dimRatio if there was no previous media selected\n\t\t// to avoid resetting to 50 if it has been explicitly set to 100.\n\t\t// See issue #52835 for context.\n\t\tconst newDimRatio =\n\t\t\toriginalUrl === undefined && dimRatio === 100 ? 50 : dimRatio;\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tif ( backgroundType === IMAGE_BACKGROUND_TYPE && mediaAttributes?.id ) {\n\t\t\tconst { imageDefaultSize } = getSettings();\n\n\t\t\t// Try to use the previous selected image size if it's available\n\t\t\t// otherwise try the default image size or fallback to full size.\n\t\t\tif (\n\t\t\t\tsizeSlug &&\n\t\t\t\t( newMedia?.sizes?.[ sizeSlug ] ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ sizeSlug ] )\n\t\t\t) {\n\t\t\t\tmediaAttributes.sizeSlug = sizeSlug;\n\t\t\t\tmediaAttributes.url =\n\t\t\t\t\tnewMedia?.sizes?.[ sizeSlug ]?.url ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ sizeSlug ]?.source_url;\n\t\t\t} else if (\n\t\t\t\tnewMedia?.sizes?.[ imageDefaultSize ] ||\n\t\t\t\tnewMedia?.media_details?.sizes?.[ imageDefaultSize ]\n\t\t\t) {\n\t\t\t\tmediaAttributes.sizeSlug = imageDefaultSize;\n\t\t\t\tmediaAttributes.url =\n\t\t\t\t\tnewMedia?.sizes?.[ imageDefaultSize ]?.url ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ imageDefaultSize ]\n\t\t\t\t\t\t?.source_url;\n\t\t\t} else {\n\t\t\t\tmediaAttributes.sizeSlug = DEFAULT_MEDIA_SIZE_SLUG;\n\t\t\t}\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\t...mediaAttributes,\n\t\t\tfocalPoint: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t\tdimRatio: newDimRatio,\n\t\t\tisDark: newIsDark,\n\t\t\tisUserOverlayColor: isUserOverlayColor || false,\n\t\t} );\n\t};\n\n\tconst onClearMedia = () => {\n\t\tlet newOverlayColor = overlayColor.color;\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tnewOverlayColor = DEFAULT_OVERLAY_COLOR;\n\t\t\tsetOverlayColor( undefined );\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tdimRatio,\n\t\t\tnewOverlayColor,\n\t\t\tDEFAULT_BACKGROUND_COLOR\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tid: undefined,\n\t\t\tbackgroundType: undefined,\n\t\t\tfocalPoint: undefined,\n\t\t\thasParallax: undefined,\n\t\t\tisRepeated: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onSetOverlayColor = async ( newOverlayColor ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tdimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetOverlayColor( newOverlayColor );\n\n\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\n\t\tsetAttributes( {\n\t\t\tisUserOverlayColor: true,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onUpdateDimRatio = async ( newDimRatio ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\toverlayColor.color,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\tdimRatio: newDimRatio,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t};\n\n\tconst isUploadingMedia = isTemporaryMedia( id, url );\n\n\tconst isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;\n\tconst isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;\n\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\n\tconst [ resizeListener, { height, width } ] = useResizeObserver();\n\tconst resizableBoxDimensions = useMemo( () => {\n\t\treturn {\n\t\t\theight: minHeightUnit === 'px' ? minHeight : 'auto',\n\t\t\twidth: 'auto',\n\t\t};\n\t}, [ minHeight, minHeightUnit ] );\n\n\tconst minHeightWithUnit =\n\t\tminHeight && minHeightUnit\n\t\t\t? `${ minHeight }${ minHeightUnit }`\n\t\t\t: minHeight;\n\n\tconst isImgElement = ! ( hasParallax || isRepeated );\n\n\tconst style = {\n\t\tminHeight: minHeightWithUnit || undefined,\n\t};\n\n\tconst backgroundImage = url ? `url(${ url })` : undefined;\n\n\tconst backgroundPosition = mediaPosition( focalPoint );\n\n\tconst bgStyle = { backgroundColor: overlayColor.color };\n\tconst mediaStyle = {\n\t\tobjectPosition:\n\t\t\tfocalPoint && isImgElement\n\t\t\t\t? mediaPosition( focalPoint )\n\t\t\t\t: undefined,\n\t};\n\n\tconst hasBackground = !! ( url || overlayColor.color || gradientValue );\n\n\tconst hasInnerBlocks = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlock( clientId ).innerBlocks.length >\n\t\t\t0,\n\t\t[ clientId ]\n\t);\n\n\tconst ref = useRef();\n\tconst blockProps = useBlockProps( { ref } );\n\n\t// Check for fontSize support before we pass a fontSize attribute to the innerBlocks.\n\tconst [ fontSizes ] = useSettings( 'typography.fontSizes' );\n\tconst hasFontSizes = fontSizes?.length > 0;\n\tconst innerBlocksTemplate = getInnerBlocksTemplate( {\n\t\tfontSize: hasFontSizes ? 'large' : undefined,\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tclassName: 'wp-block-cover__inner-container',\n\t\t},\n\t\t{\n\t\t\t// Avoid template sync when the `templateLock` value is `all` or `contentOnly`.\n\t\t\t// See: https://github.com/WordPress/gutenberg/pull/45632\n\t\t\ttemplate: ! hasInnerBlocks ? innerBlocksTemplate : undefined,\n\t\t\ttemplateInsertUpdatesSelection: true,\n\t\t\tallowedBlocks,\n\t\t\ttemplateLock,\n\t\t\tdropZoneElement: ref.current,\n\t\t}\n\t);\n\n\tconst mediaElement = useRef();\n\tconst currentSettings = {\n\t\tisVideoBackground,\n\t\tisImageBackground,\n\t\tmediaElement,\n\t\thasInnerBlocks,\n\t\turl,\n\t\tisImgElement,\n\t\toverlayColor,\n\t};\n\n\tconst toggleUseFeaturedImage = async () => {\n\t\tconst newUseFeaturedImage = ! useFeaturedImage;\n\n\t\tconst averageBackgroundColor = newUseFeaturedImage\n\t\t\t? await getMediaColor( mediaUrl )\n\t\t\t: DEFAULT_BACKGROUND_COLOR;\n\n\t\tconst newOverlayColor = ! isUserOverlayColor\n\t\t\t? averageBackgroundColor\n\t\t\t: overlayColor.color;\n\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tif ( newUseFeaturedImage ) {\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t} else {\n\t\t\t\tsetOverlayColor( undefined );\n\t\t\t}\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newDimRatio = dimRatio === 100 ? 50 : dimRatio;\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\tid: undefined,\n\t\t\turl: undefined,\n\t\t\tuseFeaturedImage: newUseFeaturedImage,\n\t\t\tdimRatio: newDimRatio,\n\t\t\tbackgroundType: useFeaturedImage\n\t\t\t\t? IMAGE_BACKGROUND_TYPE\n\t\t\t\t: undefined,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst blockControls = (\n\t\t<CoverBlockControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t/>\n\t);\n\n\tconst inspectorControls = (\n\t\t<CoverInspectorControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tclientId={ clientId }\n\t\t\tsetOverlayColor={ onSetOverlayColor }\n\t\t\tcoverRef={ ref }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tupdateDimRatio={ onUpdateDimRatio }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t\tfeaturedImage={ media }\n\t\t/>\n\t);\n\n\tconst resizableCoverProps = {\n\t\tclassName: 'block-library-cover__resize-container',\n\t\tclientId,\n\t\theight,\n\t\tminHeight: minHeightWithUnit,\n\t\tonResizeStart: () => {\n\t\t\tsetAttributes( { minHeightUnit: 'px' } );\n\t\t\ttoggleSelection( false );\n\t\t},\n\t\tonResize: ( value ) => {\n\t\t\tsetAttributes( { minHeight: value } );\n\t\t},\n\t\tonResizeStop: ( newMinHeight ) => {\n\t\t\ttoggleSelection( true );\n\t\t\tsetAttributes( { minHeight: newMinHeight } );\n\t\t},\n\t\t// Hide the resize handle if an aspect ratio is set, as the aspect ratio takes precedence.\n\t\tshowHandle: ! attributes.style?.dimensions?.aspectRatio,\n\t\tsize: resizableBoxDimensions,\n\t\twidth,\n\t};\n\n\tif ( ! useFeaturedImage && ! hasInnerBlocks && ! hasBackground ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ blockControls }\n\t\t\t\t{ inspectorControls }\n\t\t\t\t{ hasNonContentControls && isSelected && (\n\t\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t\t) }\n\t\t\t\t<TagName\n\t\t\t\t\t{ ...blockProps }\n\t\t\t\t\tclassName={ clsx( 'is-placeholder', blockProps.className ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...blockProps.style,\n\t\t\t\t\t\tminHeight: minHeightWithUnit || undefined,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ resizeListener }\n\t\t\t\t\t<CoverPlaceholder\n\t\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className=\"wp-block-cover__placeholder-background-options\">\n\t\t\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\t\t\tdisableCustomColors\n\t\t\t\t\t\t\t\tvalue={ overlayColor.color }\n\t\t\t\t\t\t\t\tonChange={ onSetOverlayColor }\n\t\t\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</CoverPlaceholder>\n\t\t\t\t</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst classes = clsx(\n\t\t{\n\t\t\t'is-dark-theme': isDark,\n\t\t\t'is-light': ! isDark,\n\t\t\t'is-transient': isUploadingMedia,\n\t\t\t'has-parallax': hasParallax,\n\t\t\t'is-repeated': isRepeated,\n\t\t\t'has-custom-content-position':\n\t\t\t\t! isContentPositionCenter( contentPosition ),\n\t\t},\n\t\tgetPositionClassName( contentPosition )\n\t);\n\n\tconst showOverlay =\n\t\turl || ! useFeaturedImage || ( useFeaturedImage && ! url );\n\n\treturn (\n\t\t<>\n\t\t\t{ blockControls }\n\t\t\t{ inspectorControls }\n\t\t\t<TagName\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( classes, blockProps.className ) }\n\t\t\t\tstyle={ { ...style, ...blockProps.style } }\n\t\t\t\tdata-url={ url }\n\t\t\t>\n\t\t\t\t{ resizeListener }\n\n\t\t\t\t{ ! url && useFeaturedImage && (\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\tclassName=\"wp-block-cover__image--placeholder-image\"\n\t\t\t\t\t\twithIllustration\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ url &&\n\t\t\t\t\tisImageBackground &&\n\t\t\t\t\t( isImgElement ? (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\tclassName=\"wp-block-cover__image-background\"\n\t\t\t\t\t\t\talt={ alt }\n\t\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\trole={ alt ? 'img' : undefined }\n\t\t\t\t\t\t\taria-label={ alt ? alt : undefined }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\tclasses,\n\t\t\t\t\t\t\t\t'wp-block-cover__image-background'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tstyle={ { backgroundImage, backgroundPosition } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t{ url && isVideoBackground && (\n\t\t\t\t\t<video\n\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\tclassName=\"wp-block-cover__video-background\"\n\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\tmuted\n\t\t\t\t\t\tloop\n\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ showOverlay && (\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'wp-block-cover__background',\n\t\t\t\t\t\t\tdimRatioToClass( dimRatio ),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t[ overlayColor.class ]: overlayColor.class,\n\t\t\t\t\t\t\t\t'has-background-dim': dimRatio !== undefined,\n\t\t\t\t\t\t\t\t// For backwards compatibility. Former versions of the Cover Block applied\n\t\t\t\t\t\t\t\t// `.wp-block-cover__gradient-background` in the presence of\n\t\t\t\t\t\t\t\t// media, a gradient and a dim.\n\t\t\t\t\t\t\t\t'wp-block-cover__gradient-background':\n\t\t\t\t\t\t\t\t\turl && gradientValue && dimRatio !== 0,\n\t\t\t\t\t\t\t\t'has-background-gradient': gradientValue,\n\t\t\t\t\t\t\t\t[ gradientClass ]: gradientClass,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tstyle={ { backgroundImage: gradientValue, ...bgStyle } }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ isUploadingMedia && <Spinner /> }\n\n\t\t\t\t<CoverPlaceholder\n\t\t\t\t\tdisableMediaButtons\n\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t/>\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</TagName>\n\t\t\t{ hasNonContentControls && isSelected && (\n\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default compose( [\n\twithColors( { overlayColor: 'background-color' } ),\n] )( CoverEdit );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,aAAa,EAAEC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACxE,SAASC,S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KAAK,GAAI9H,YAAY,CAAC8H,KAAK;UAC1C,oBAAoB,EAAEjH,QAAQ,KAAKuC,SAAS;UAC5C;UACA;UACA;UACA,qCAAqC,EACpCxD,GAAG,IAAIgD,aAAa,IAAI/B,QAAQ,KAAK,CAAC;UACvC,yBAAyB,EAAE+B,aAAa;UACxC,CAAED,aAAa,GAAIA;QACpB,CACD,CAAG;QACH4B,KAAK,EAAG;UAAEC,eAAe,EAAE5B,aAAa;UAAE,GAAG8B;QAAQ;MAAG,CACxD,CACD,EAECd,gBAAgB,iBAAI3E,IAAA,CAACjC,OAAO,IAAE,CAAC,eAEjCiC,IAAA,CAACR,gBAAgB;QAChBsJ,mBAAmB;QACnBlF,aAAa,EAAGA,aAAe;QAC/BqE,OAAO,EAAGxD,aAAe;QACzBuC,sBAAsB,EAAGA;MAAwB,CACjD,CAAC,eACFhH,IAAA;QAAA,GAAUwG;MAAgB,CAAI,CAAC;IAAA,CACvB,CAAC,EACRzB,qBAAqB,IAAIjE,UAAU,iBACpCd,IAAA,CAACP,qBAAqB;MAAA,GAAM6H;IAAmB,CAAI,CACnD;EAAA,CACA,CAAC;AAEL;AAEA,eAAetJ,OAAO,CAAE,CACvBE,UAAU,CAAE;EAAE6C,YAAY,EAAE;AAAmB,CAAE,CAAC,CACjD,CAAC,CAAEH,SAAU,CAAC","ignoreList":[]}
@@ -73,7 +73,8 @@ export default function CoverInspectorControls({
73
73
  setOverlayColor,
74
74
  coverRef,
75
75
  currentSettings,
76
- updateDimRatio
76
+ updateDimRatio,
77
+ featuredImage
77
78
  }) {
78
79
  const {
79
80
  useFeaturedImage,
@@ -106,8 +107,9 @@ export default function CoverInspectorControls({
106
107
  const image = useSelect(select => id && isImageBackground ? select(coreStore).getMedia(id, {
107
108
  context: 'view'
108
109
  }) : null, [id, isImageBackground]);
110
+ const currentBackgroundImage = useFeaturedImage ? featuredImage : image;
109
111
  function updateImage(newSizeSlug) {
110
- const newUrl = image?.media_details?.sizes?.[newSizeSlug]?.source_url;
112
+ const newUrl = currentBackgroundImage?.media_details?.sizes?.[newSizeSlug]?.source_url;
111
113
  if (!newUrl) {
112
114
  return null;
113
115
  }
@@ -118,7 +120,7 @@ export default function CoverInspectorControls({
118
120
  }
119
121
  const imageSizeOptions = imageSizes?.filter(({
120
122
  slug
121
- }) => image?.media_details?.sizes?.[slug]?.source_url)?.map(({
123
+ }) => currentBackgroundImage?.media_details?.sizes?.[slug]?.source_url)?.map(({
122
124
  name,
123
125
  slug
124
126
  }) => ({
@@ -237,7 +239,7 @@ export default function CoverInspectorControls({
237
239
  }), /*#__PURE__*/_jsx("br", {}), __('Leave empty if decorative.')]
238
240
  })
239
241
  })
240
- }), !useFeaturedImage && !!imageSizeOptions?.length && /*#__PURE__*/_jsx(ResolutionTool, {
242
+ }), !!imageSizeOptions?.length && /*#__PURE__*/_jsx(ResolutionTool, {
241
243
  value: sizeSlug,
242
244
  onChange: updateImage,
243
245
  options: imageSizeOptions,
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","ExternalLink","FocalPointPicker","RangeControl","TextareaControl","ToggleControl","SelectControl","__experimentalUseCustomUnits","useCustomUnits","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__experimentalUnitControl","UnitControl","__experimentalParseQuantityAndUnitFromRawValue","parseQuantityAndUnitFromRawValue","useInstanceId","InspectorControls","useSettings","store","blockEditorStore","__experimentalColorGradientSettingsDropdown","ColorGradientSettingsDropdown","__experimentalUseGradient","__experimentalUseMultipleOriginColorsAndGradients","useMultipleOriginColorsAndGradients","privateApis","blockEditorPrivateApis","__","useSelect","coreStore","COVER_MIN_HEIGHT","mediaPosition","unlock","useToolsPanelDropdownMenuProps","DEFAULT_MEDIA_SIZE_SLUG","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","cleanEmptyObject","ResolutionTool","CoverHeightInput","onChange","onUnitChange","unit","value","instanceId","inputId","isPx","availableUnits","units","defaultValues","px","em","rem","vw","vh","handleOnChange","unprocessedValue","inputValue","parseFloat","undefined","isNaN","computedValue","parsedQuantity","join","min","__next40pxDefaultSize","label","id","isResetValueOnUnitChange","CoverInspectorControls","attributes","setAttributes","clientId","setOverlayColor","coverRef","currentSettings","updateDimRatio","useFeaturedImage","dimRatio","focalPoint","hasParallax","isRepeated","minHeight","minHeightUnit","alt","tagName","isVideoBackground","isImageBackground","mediaElement","url","overlayColor","sizeSlug","gradientValue","setGradient","getSettings","imageSizes","image","select","getMedia","context","updateImage","newSizeSlug","newUrl","media_details","sizes","source_url","imageSizeOptions","filter","slug","map","name","toggleParallax","toggleIsRepeated","showFocalPointPicker","imperativeFocalPointPreview","styleOfRef","property","current","style","colorGradientSettings","htmlElementMessages","header","main","section","article","aside","footer","dropdownMenuProps","children","resetAll","isShownByDefault","hasValue","onDeselect","__nextHasNoMarginBottom","checked","onDragStart","onDrag","newFocalPoint","newAlt","help","href","length","options","defaultValue","hasColorsOrGradients","group","__experimentalIsRenderedInSidebar","settings","colorValue","color","onColorChange","onGradientChange","resetAllFilter","customOverlayColor","gradient","customGradient","clearable","panelId","newDimRatio","max","step","required","className","dimensions","aspectRatio","newMinHeight","nextUnit"],"sources":["@wordpress/block-library/src/cover/edit/inspector-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport {\n\tExternalLink,\n\tFocalPointPicker,\n\tRangeControl,\n\tTextareaControl,\n\tToggleControl,\n\tSelectControl,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport {\n\tInspectorControls,\n\tuseSettings,\n\tstore as blockEditorStore,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseGradient,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { COVER_MIN_HEIGHT, mediaPosition } from '../shared';\nimport { unlock } from '../../lock-unlock';\nimport { useToolsPanelDropdownMenuProps } from '../../utils/hooks';\nimport { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';\n\nconst { cleanEmptyObject, ResolutionTool } = unlock( blockEditorPrivateApis );\n\nfunction CoverHeightInput( {\n\tonChange,\n\tonUnitChange,\n\tunit = 'px',\n\tvalue = '',\n} ) {\n\tconst instanceId = useInstanceId( UnitControl );\n\tconst inputId = `block-cover-height-input-${ instanceId }`;\n\tconst isPx = unit === 'px';\n\n\tconst [ availableUnits ] = useSettings( 'spacing.units' );\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: availableUnits || [ 'px', 'em', 'rem', 'vw', 'vh' ],\n\t\tdefaultValues: { px: 430, '%': 20, em: 20, rem: 20, vw: 20, vh: 50 },\n\t} );\n\n\tconst handleOnChange = ( unprocessedValue ) => {\n\t\tconst inputValue =\n\t\t\tunprocessedValue !== ''\n\t\t\t\t? parseFloat( unprocessedValue )\n\t\t\t\t: undefined;\n\n\t\tif ( isNaN( inputValue ) && inputValue !== undefined ) {\n\t\t\treturn;\n\t\t}\n\t\tonChange( inputValue );\n\t};\n\n\tconst computedValue = useMemo( () => {\n\t\tconst [ parsedQuantity ] = parseQuantityAndUnitFromRawValue( value );\n\t\treturn [ parsedQuantity, unit ].join( '' );\n\t}, [ unit, value ] );\n\n\tconst min = isPx ? COVER_MIN_HEIGHT : 0;\n\n\treturn (\n\t\t<UnitControl\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Minimum height' ) }\n\t\t\tid={ inputId }\n\t\t\tisResetValueOnUnitChange\n\t\t\tmin={ min }\n\t\t\tonChange={ handleOnChange }\n\t\t\tonUnitChange={ onUnitChange }\n\t\t\tunits={ units }\n\t\t\tvalue={ computedValue }\n\t\t/>\n\t);\n}\nexport default function CoverInspectorControls( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tsetOverlayColor,\n\tcoverRef,\n\tcurrentSettings,\n\tupdateDimRatio,\n} ) {\n\tconst {\n\t\tuseFeaturedImage,\n\t\tid,\n\t\tdimRatio,\n\t\tfocalPoint,\n\t\thasParallax,\n\t\tisRepeated,\n\t\tminHeight,\n\t\tminHeightUnit,\n\t\talt,\n\t\ttagName,\n\t} = attributes;\n\tconst {\n\t\tisVideoBackground,\n\t\tisImageBackground,\n\t\tmediaElement,\n\t\turl,\n\t\toverlayColor,\n\t} = currentSettings;\n\n\tconst sizeSlug = attributes.sizeSlug || DEFAULT_MEDIA_SIZE_SLUG;\n\n\tconst { gradientValue, setGradient } = __experimentalUseGradient();\n\tconst { getSettings } = useSelect( blockEditorStore );\n\n\tconst imageSizes = getSettings()?.imageSizes;\n\n\tconst image = useSelect(\n\t\t( select ) =>\n\t\t\tid && isImageBackground\n\t\t\t\t? select( coreStore ).getMedia( id, { context: 'view' } )\n\t\t\t\t: null,\n\t\t[ id, isImageBackground ]\n\t);\n\n\tfunction updateImage( newSizeSlug ) {\n\t\tconst newUrl = image?.media_details?.sizes?.[ newSizeSlug ]?.source_url;\n\t\tif ( ! newUrl ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\turl: newUrl,\n\t\t\tsizeSlug: newSizeSlug,\n\t\t} );\n\t}\n\n\tconst imageSizeOptions = imageSizes\n\t\t?.filter(\n\t\t\t( { slug } ) => image?.media_details?.sizes?.[ slug ]?.source_url\n\t\t)\n\t\t?.map( ( { name, slug } ) => ( { value: slug, label: name } ) );\n\n\tconst toggleParallax = () => {\n\t\tsetAttributes( {\n\t\t\thasParallax: ! hasParallax,\n\t\t\t...( ! hasParallax ? { focalPoint: undefined } : {} ),\n\t\t} );\n\t};\n\n\tconst toggleIsRepeated = () => {\n\t\tsetAttributes( {\n\t\t\tisRepeated: ! isRepeated,\n\t\t} );\n\t};\n\n\tconst showFocalPointPicker =\n\t\tisVideoBackground ||\n\t\t( isImageBackground && ( ! hasParallax || isRepeated ) );\n\n\tconst imperativeFocalPointPreview = ( value ) => {\n\t\tconst [ styleOfRef, property ] = mediaElement.current\n\t\t\t? [ mediaElement.current.style, 'objectPosition' ]\n\t\t\t: [ coverRef.current.style, 'backgroundPosition' ];\n\t\tstyleOfRef[ property ] = mediaPosition( value );\n\t};\n\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\n\tconst htmlElementMessages = {\n\t\theader: __(\n\t\t\t'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'\n\t\t),\n\t\tmain: __(\n\t\t\t'The <main> element should be used for the primary content of your document only.'\n\t\t),\n\t\tsection: __(\n\t\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t\t),\n\t\tarticle: __(\n\t\t\t'The <article> element should represent a self-contained, syndicatable portion of the document.'\n\t\t),\n\t\taside: __(\n\t\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t\t),\n\t\tfooter: __(\n\t\t\t'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'\n\t\t),\n\t};\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t{ !! url && (\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\thasParallax: false,\n\t\t\t\t\t\t\t\tfocalPoint: undefined,\n\t\t\t\t\t\t\t\tisRepeated: false,\n\t\t\t\t\t\t\t\talt: '',\n\t\t\t\t\t\t\t\tsizeSlug: undefined,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isImageBackground && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Fixed background' ) }\n\t\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\t\thasValue={ () => hasParallax }\n\t\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\thasParallax: false,\n\t\t\t\t\t\t\t\t\t\t\tfocalPoint: undefined,\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>\n\t\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Fixed background' ) }\n\t\t\t\t\t\t\t\t\t\tchecked={ hasParallax }\n\t\t\t\t\t\t\t\t\t\tonChange={ toggleParallax }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Repeated background' ) }\n\t\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\t\thasValue={ () => isRepeated }\n\t\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\tisRepeated: false,\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>\n\t\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Repeated background' ) }\n\t\t\t\t\t\t\t\t\t\tchecked={ isRepeated }\n\t\t\t\t\t\t\t\t\t\tonChange={ toggleIsRepeated }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showFocalPointPicker && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => !! focalPoint }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tfocalPoint: undefined,\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\t\t<FocalPointPicker\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\t\t\tvalue={ focalPoint }\n\t\t\t\t\t\t\t\t\tonDragStart={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\t\t\tonDrag={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\t\t\tonChange={ ( newFocalPoint ) =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\tfocalPoint: newFocalPoint,\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/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! useFeaturedImage && url && ! isVideoBackground && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => !! alt }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { alt: '' } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\t\tvalue={ alt }\n\t\t\t\t\t\t\t\t\tonChange={ ( newAlt ) =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( { alt: newAlt } )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\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{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Describe the purpose of the image.'\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</ExternalLink>\n\t\t\t\t\t\t\t\t\t\t\t<br />\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'Leave empty if decorative.'\n\t\t\t\t\t\t\t\t\t\t\t) }\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/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! useFeaturedImage && !! imageSizeOptions?.length && (\n\t\t\t\t\t\t\t<ResolutionTool\n\t\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\t\tonChange={ updateImage }\n\t\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t\t\tdefaultValue={ DEFAULT_MEDIA_SIZE_SLUG }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t) }\n\t\t\t</InspectorControls>\n\t\t\t{ colorGradientSettings.hasColorsOrGradients && (\n\t\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\tsettings={ [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcolorValue: overlayColor.color,\n\t\t\t\t\t\t\t\tgradientValue,\n\t\t\t\t\t\t\t\tlabel: __( 'Overlay' ),\n\t\t\t\t\t\t\t\tonColorChange: setOverlayColor,\n\t\t\t\t\t\t\t\tonGradientChange: setGradient,\n\t\t\t\t\t\t\t\tisShownByDefault: true,\n\t\t\t\t\t\t\t\tresetAllFilter: () => ( {\n\t\t\t\t\t\t\t\t\toverlayColor: undefined,\n\t\t\t\t\t\t\t\t\tcustomOverlayColor: undefined,\n\t\t\t\t\t\t\t\t\tgradient: undefined,\n\t\t\t\t\t\t\t\t\tcustomGradient: undefined,\n\t\t\t\t\t\t\t\t} ),\n\t\t\t\t\t\t\t\tclearable: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t\t{ ...colorGradientSettings }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => {\n\t\t\t\t\t\t\t// If there's a media background the dimRatio will be\n\t\t\t\t\t\t\t// defaulted to 50 whereas it will be 100 for colors.\n\t\t\t\t\t\t\treturn dimRatio === undefined\n\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t: dimRatio !== ( url ? 50 : 100 );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Overlay opacity' ) }\n\t\t\t\t\t\tonDeselect={ () => updateDimRatio( url ? 50 : 100 ) }\n\t\t\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\t\t\tdimRatio: url ? 50 : 100,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Overlay opacity' ) }\n\t\t\t\t\t\t\tvalue={ dimRatio }\n\t\t\t\t\t\t\tonChange={ ( newDimRatio ) =>\n\t\t\t\t\t\t\t\tupdateDimRatio( newDimRatio )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\t\tstep={ 10 }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<InspectorControls group=\"dimensions\">\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tclassName=\"single-column\"\n\t\t\t\t\thasValue={ () => !! minHeight }\n\t\t\t\t\tlabel={ __( 'Minimum height' ) }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tminHeight: undefined,\n\t\t\t\t\t\t\tminHeightUnit: undefined,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\t\tminHeight: undefined,\n\t\t\t\t\t\tminHeightUnit: undefined,\n\t\t\t\t\t} ) }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t>\n\t\t\t\t\t<CoverHeightInput\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\tattributes?.style?.dimensions?.aspectRatio\n\t\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t\t: minHeight\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunit={ minHeightUnit }\n\t\t\t\t\t\tonChange={ ( newMinHeight ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tminHeight: newMinHeight,\n\t\t\t\t\t\t\t\tstyle: cleanEmptyObject( {\n\t\t\t\t\t\t\t\t\t...attributes?.style,\n\t\t\t\t\t\t\t\t\tdimensions: {\n\t\t\t\t\t\t\t\t\t\t...attributes?.style?.dimensions,\n\t\t\t\t\t\t\t\t\t\taspectRatio: undefined, // Reset aspect ratio when minHeight is set.\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}\n\t\t\t\t\t\tonUnitChange={ ( nextUnit ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tminHeightUnit: nextUnit,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<header>', value: 'header' },\n\t\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<article>', value: 'article' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t\t{ label: '<footer>', value: 'footer' },\n\t\t\t\t\t] }\n\t\t\t\t\tvalue={ tagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ htmlElementMessages[ tagName ] }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SACCC,YAAY,EACZC,gBAAgB,EAChBC,YAAY,EACZC,eAAe,EACfC,aAAa,EACbC,aAAa,EACbC,4BAA4B,IAAIC,cAAc,EAC9CC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,EAC9CC,yBAAyB,IAAIC,WAAW,EACxCC,8CAA8C,IAAIC,gCAAgC,QAC5E,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SACCC,iBAAiB,EACjBC,WAAW,EACXC,KAAK,IAAIC,gBAAgB,EACzBC,2CAA2C,IAAIC,6BAA6B,EAC5EC,yBAAyB,EACzBC,iDAAiD,IAAIC,mCAAmC,EACxFC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASV,KAAK,IAAIW,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,WAAW;AAC3D,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,8BAA8B,QAAQ,mBAAmB;AAClE,SAASC,uBAAuB,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AA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ACbqI,uBAAuB;QACvBpE,qBAAqB;QACrBC,KAAK,EAAG3C,EAAE,CAAE,cAAe,CAAG;QAC9BuH,OAAO,EAAG,CACT;UAAE5E,KAAK,EAAE3C,EAAE,CAAE,iBAAkB,CAAC;UAAEoB,KAAK,EAAE;QAAM,CAAC,EAChD;UAAEuB,KAAK,EAAE,UAAU;UAAEvB,KAAK,EAAE;QAAS,CAAC,EACtC;UAAEuB,KAAK,EAAE,QAAQ;UAAEvB,KAAK,EAAE;QAAO,CAAC,EAClC;UAAEuB,KAAK,EAAE,WAAW;UAAEvB,KAAK,EAAE;QAAU,CAAC,EACxC;UAAEuB,KAAK,EAAE,WAAW;UAAEvB,KAAK,EAAE;QAAU,CAAC,EACxC;UAAEuB,KAAK,EAAE,SAAS;UAAEvB,KAAK,EAAE;QAAQ,CAAC,EACpC;UAAEuB,KAAK,EAAE,UAAU;UAAEvB,KAAK,EAAE;QAAS,CAAC,CACpC;QACHA,KAAK,EAAG0C,OAAS;QACjB7C,QAAQ,EAAKG,KAAK,IACjB4B,aAAa,CAAE;UAAEc,OAAO,EAAE1C;QAAM,CAAE,CAClC;QACDgG,IAAI,EAAGnB,mBAAmB,CAAEnC,OAAO;MAAI,CACvC;IAAC,CACgB,CAAC;EAAA,CACnB,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["useMemo","ExternalLink","FocalPointPicker","RangeControl","TextareaControl","ToggleControl","SelectControl","__experimentalUseCustomUnits","useCustomUnits","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__experimentalUnitControl","UnitControl","__experimentalParseQuantityAndUnitFromRawValue","parseQuantityAndUnitFromRawValue","useInstanceId","InspectorControls","useSettings","store","blockEditorStore","__experimentalColorGradientSettingsDropdown","ColorGradientSettingsDropdown","__experimentalUseGradient","__experimentalUseMultipleOriginColorsAndGradients","useMultipleOriginColorsAndGradients","privateApis","blockEditorPrivateApis","__","useSelect","coreStore","COVER_MIN_HEIGHT","mediaPosition","unlock","useToolsPanelDropdownMenuProps","DEFAULT_MEDIA_SIZE_SLUG","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","cleanEmptyObject","ResolutionTool","CoverHeightInput","onChange","onUnitChange","unit","value","instanceId","inputId","isPx","availableUnits","units","defaultValues","px","em","rem","vw","vh","handleOnChange","unprocessedValue","inputValue","parseFloat","undefined","isNaN","computedValue","parsedQuantity","join","min","__next40pxDefaultSize","label","id","isResetValueOnUnitChange","CoverInspectorControls","attributes","setAttributes","clientId","setOverlayColor","coverRef","currentSettings","updateDimRatio","featuredImage","useFeaturedImage","dimRatio","focalPoint","hasParallax","isRepeated","minHeight","minHeightUnit","alt","tagName","isVideoBackground","isImageBackground","mediaElement","url","overlayColor","sizeSlug","gradientValue","setGradient","getSettings","imageSizes","image","select","getMedia","context","currentBackgroundImage","updateImage","newSizeSlug","newUrl","media_details","sizes","source_url","imageSizeOptions","filter","slug","map","name","toggleParallax","toggleIsRepeated","showFocalPointPicker","imperativeFocalPointPreview","styleOfRef","property","current","style","colorGradientSettings","htmlElementMessages","header","main","section","article","aside","footer","dropdownMenuProps","children","resetAll","isShownByDefault","hasValue","onDeselect","__nextHasNoMarginBottom","checked","onDragStart","onDrag","newFocalPoint","newAlt","help","href","length","options","defaultValue","hasColorsOrGradients","group","__experimentalIsRenderedInSidebar","settings","colorValue","color","onColorChange","onGradientChange","resetAllFilter","customOverlayColor","gradient","customGradient","clearable","panelId","newDimRatio","max","step","required","className","dimensions","aspectRatio","newMinHeight","nextUnit"],"sources":["@wordpress/block-library/src/cover/edit/inspector-controls.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport {\n\tExternalLink,\n\tFocalPointPicker,\n\tRangeControl,\n\tTextareaControl,\n\tToggleControl,\n\tSelectControl,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport {\n\tInspectorControls,\n\tuseSettings,\n\tstore as blockEditorStore,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseGradient,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { COVER_MIN_HEIGHT, mediaPosition } from '../shared';\nimport { unlock } from '../../lock-unlock';\nimport { useToolsPanelDropdownMenuProps } from '../../utils/hooks';\nimport { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';\n\nconst { cleanEmptyObject, ResolutionTool } = unlock( blockEditorPrivateApis );\n\nfunction CoverHeightInput( {\n\tonChange,\n\tonUnitChange,\n\tunit = 'px',\n\tvalue = '',\n} ) {\n\tconst instanceId = useInstanceId( UnitControl );\n\tconst inputId = `block-cover-height-input-${ instanceId }`;\n\tconst isPx = unit === 'px';\n\n\tconst [ availableUnits ] = useSettings( 'spacing.units' );\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: availableUnits || [ 'px', 'em', 'rem', 'vw', 'vh' ],\n\t\tdefaultValues: { px: 430, '%': 20, em: 20, rem: 20, vw: 20, vh: 50 },\n\t} );\n\n\tconst handleOnChange = ( unprocessedValue ) => {\n\t\tconst inputValue =\n\t\t\tunprocessedValue !== ''\n\t\t\t\t? parseFloat( unprocessedValue )\n\t\t\t\t: undefined;\n\n\t\tif ( isNaN( inputValue ) && inputValue !== undefined ) {\n\t\t\treturn;\n\t\t}\n\t\tonChange( inputValue );\n\t};\n\n\tconst computedValue = useMemo( () => {\n\t\tconst [ parsedQuantity ] = parseQuantityAndUnitFromRawValue( value );\n\t\treturn [ parsedQuantity, unit ].join( '' );\n\t}, [ unit, value ] );\n\n\tconst min = isPx ? COVER_MIN_HEIGHT : 0;\n\n\treturn (\n\t\t<UnitControl\n\t\t\t__next40pxDefaultSize\n\t\t\tlabel={ __( 'Minimum height' ) }\n\t\t\tid={ inputId }\n\t\t\tisResetValueOnUnitChange\n\t\t\tmin={ min }\n\t\t\tonChange={ handleOnChange }\n\t\t\tonUnitChange={ onUnitChange }\n\t\t\tunits={ units }\n\t\t\tvalue={ computedValue }\n\t\t/>\n\t);\n}\nexport default function CoverInspectorControls( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tsetOverlayColor,\n\tcoverRef,\n\tcurrentSettings,\n\tupdateDimRatio,\n\tfeaturedImage,\n} ) {\n\tconst {\n\t\tuseFeaturedImage,\n\t\tid,\n\t\tdimRatio,\n\t\tfocalPoint,\n\t\thasParallax,\n\t\tisRepeated,\n\t\tminHeight,\n\t\tminHeightUnit,\n\t\talt,\n\t\ttagName,\n\t} = attributes;\n\tconst {\n\t\tisVideoBackground,\n\t\tisImageBackground,\n\t\tmediaElement,\n\t\turl,\n\t\toverlayColor,\n\t} = currentSettings;\n\n\tconst sizeSlug = attributes.sizeSlug || DEFAULT_MEDIA_SIZE_SLUG;\n\n\tconst { gradientValue, setGradient } = __experimentalUseGradient();\n\tconst { getSettings } = useSelect( blockEditorStore );\n\n\tconst imageSizes = getSettings()?.imageSizes;\n\n\tconst image = useSelect(\n\t\t( select ) =>\n\t\t\tid && isImageBackground\n\t\t\t\t? select( coreStore ).getMedia( id, { context: 'view' } )\n\t\t\t\t: null,\n\t\t[ id, isImageBackground ]\n\t);\n\n\tconst currentBackgroundImage = useFeaturedImage ? featuredImage : image;\n\n\tfunction updateImage( newSizeSlug ) {\n\t\tconst newUrl =\n\t\t\tcurrentBackgroundImage?.media_details?.sizes?.[ newSizeSlug ]\n\t\t\t\t?.source_url;\n\t\tif ( ! newUrl ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\turl: newUrl,\n\t\t\tsizeSlug: newSizeSlug,\n\t\t} );\n\t}\n\n\tconst imageSizeOptions = imageSizes\n\t\t?.filter(\n\t\t\t( { slug } ) =>\n\t\t\t\tcurrentBackgroundImage?.media_details?.sizes?.[ slug ]\n\t\t\t\t\t?.source_url\n\t\t)\n\t\t?.map( ( { name, slug } ) => ( { value: slug, label: name } ) );\n\n\tconst toggleParallax = () => {\n\t\tsetAttributes( {\n\t\t\thasParallax: ! hasParallax,\n\t\t\t...( ! hasParallax ? { focalPoint: undefined } : {} ),\n\t\t} );\n\t};\n\n\tconst toggleIsRepeated = () => {\n\t\tsetAttributes( {\n\t\t\tisRepeated: ! isRepeated,\n\t\t} );\n\t};\n\n\tconst showFocalPointPicker =\n\t\tisVideoBackground ||\n\t\t( isImageBackground && ( ! hasParallax || isRepeated ) );\n\n\tconst imperativeFocalPointPreview = ( value ) => {\n\t\tconst [ styleOfRef, property ] = mediaElement.current\n\t\t\t? [ mediaElement.current.style, 'objectPosition' ]\n\t\t\t: [ coverRef.current.style, 'backgroundPosition' ];\n\t\tstyleOfRef[ property ] = mediaPosition( value );\n\t};\n\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\n\tconst htmlElementMessages = {\n\t\theader: __(\n\t\t\t'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'\n\t\t),\n\t\tmain: __(\n\t\t\t'The <main> element should be used for the primary content of your document only.'\n\t\t),\n\t\tsection: __(\n\t\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t\t),\n\t\tarticle: __(\n\t\t\t'The <article> element should represent a self-contained, syndicatable portion of the document.'\n\t\t),\n\t\taside: __(\n\t\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t\t),\n\t\tfooter: __(\n\t\t\t'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'\n\t\t),\n\t};\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t{ !! url && (\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\thasParallax: false,\n\t\t\t\t\t\t\t\tfocalPoint: undefined,\n\t\t\t\t\t\t\t\tisRepeated: false,\n\t\t\t\t\t\t\t\talt: '',\n\t\t\t\t\t\t\t\tsizeSlug: undefined,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isImageBackground && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Fixed background' ) }\n\t\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\t\thasValue={ () => hasParallax }\n\t\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\thasParallax: false,\n\t\t\t\t\t\t\t\t\t\t\tfocalPoint: undefined,\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>\n\t\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Fixed background' ) }\n\t\t\t\t\t\t\t\t\t\tchecked={ hasParallax }\n\t\t\t\t\t\t\t\t\t\tonChange={ toggleParallax }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Repeated background' ) }\n\t\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\t\thasValue={ () => isRepeated }\n\t\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\tisRepeated: false,\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>\n\t\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Repeated background' ) }\n\t\t\t\t\t\t\t\t\t\tchecked={ isRepeated }\n\t\t\t\t\t\t\t\t\t\tonChange={ toggleIsRepeated }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ showFocalPointPicker && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => !! focalPoint }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tfocalPoint: undefined,\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\t\t<FocalPointPicker\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\t\t\tvalue={ focalPoint }\n\t\t\t\t\t\t\t\t\tonDragStart={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\t\t\tonDrag={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\t\t\tonChange={ ( newFocalPoint ) =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\tfocalPoint: newFocalPoint,\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/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! useFeaturedImage && url && ! isVideoBackground && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => !! alt }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { alt: '' } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\t\tvalue={ alt }\n\t\t\t\t\t\t\t\t\tonChange={ ( newAlt ) =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( { alt: newAlt } )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\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{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Describe the purpose of the image.'\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</ExternalLink>\n\t\t\t\t\t\t\t\t\t\t\t<br />\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'Leave empty if decorative.'\n\t\t\t\t\t\t\t\t\t\t\t) }\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/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ !! imageSizeOptions?.length && (\n\t\t\t\t\t\t\t<ResolutionTool\n\t\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\t\tonChange={ updateImage }\n\t\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t\t\tdefaultValue={ DEFAULT_MEDIA_SIZE_SLUG }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t) }\n\t\t\t</InspectorControls>\n\t\t\t{ colorGradientSettings.hasColorsOrGradients && (\n\t\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\tsettings={ [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcolorValue: overlayColor.color,\n\t\t\t\t\t\t\t\tgradientValue,\n\t\t\t\t\t\t\t\tlabel: __( 'Overlay' ),\n\t\t\t\t\t\t\t\tonColorChange: setOverlayColor,\n\t\t\t\t\t\t\t\tonGradientChange: setGradient,\n\t\t\t\t\t\t\t\tisShownByDefault: true,\n\t\t\t\t\t\t\t\tresetAllFilter: () => ( {\n\t\t\t\t\t\t\t\t\toverlayColor: undefined,\n\t\t\t\t\t\t\t\t\tcustomOverlayColor: undefined,\n\t\t\t\t\t\t\t\t\tgradient: undefined,\n\t\t\t\t\t\t\t\t\tcustomGradient: undefined,\n\t\t\t\t\t\t\t\t} ),\n\t\t\t\t\t\t\t\tclearable: true,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t\t{ ...colorGradientSettings }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => {\n\t\t\t\t\t\t\t// If there's a media background the dimRatio will be\n\t\t\t\t\t\t\t// defaulted to 50 whereas it will be 100 for colors.\n\t\t\t\t\t\t\treturn dimRatio === undefined\n\t\t\t\t\t\t\t\t? false\n\t\t\t\t\t\t\t\t: dimRatio !== ( url ? 50 : 100 );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Overlay opacity' ) }\n\t\t\t\t\t\tonDeselect={ () => updateDimRatio( url ? 50 : 100 ) }\n\t\t\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\t\t\tdimRatio: url ? 50 : 100,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Overlay opacity' ) }\n\t\t\t\t\t\t\tvalue={ dimRatio }\n\t\t\t\t\t\t\tonChange={ ( newDimRatio ) =>\n\t\t\t\t\t\t\t\tupdateDimRatio( newDimRatio )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ 0 }\n\t\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\t\tstep={ 10 }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<InspectorControls group=\"dimensions\">\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tclassName=\"single-column\"\n\t\t\t\t\thasValue={ () => !! minHeight }\n\t\t\t\t\tlabel={ __( 'Minimum height' ) }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tminHeight: undefined,\n\t\t\t\t\t\t\tminHeightUnit: undefined,\n\t\t\t\t\t\t} )\n\t\t\t\t\t}\n\t\t\t\t\tresetAllFilter={ () => ( {\n\t\t\t\t\t\tminHeight: undefined,\n\t\t\t\t\t\tminHeightUnit: undefined,\n\t\t\t\t\t} ) }\n\t\t\t\t\tisShownByDefault\n\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t>\n\t\t\t\t\t<CoverHeightInput\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\tattributes?.style?.dimensions?.aspectRatio\n\t\t\t\t\t\t\t\t? ''\n\t\t\t\t\t\t\t\t: minHeight\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunit={ minHeightUnit }\n\t\t\t\t\t\tonChange={ ( newMinHeight ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tminHeight: newMinHeight,\n\t\t\t\t\t\t\t\tstyle: cleanEmptyObject( {\n\t\t\t\t\t\t\t\t\t...attributes?.style,\n\t\t\t\t\t\t\t\t\tdimensions: {\n\t\t\t\t\t\t\t\t\t\t...attributes?.style?.dimensions,\n\t\t\t\t\t\t\t\t\t\taspectRatio: undefined, // Reset aspect ratio when minHeight is set.\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}\n\t\t\t\t\t\tonUnitChange={ ( nextUnit ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tminHeightUnit: nextUnit,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<header>', value: 'header' },\n\t\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<article>', value: 'article' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t\t{ label: '<footer>', value: 'footer' },\n\t\t\t\t\t] }\n\t\t\t\t\tvalue={ tagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ htmlElementMessages[ tagName ] }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,oBAAoB;AAC5C,SACCC,YAAY,EACZC,gBAAgB,EAChBC,YAAY,EACZC,eAAe,EACfC,aAAa,EACbC,aAAa,EACbC,4BAA4B,IAAIC,cAAc,EAC9CC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,EAC9CC,yBAAyB,IAAIC,WAAW,EACxCC,8CAA8C,IAAIC,gCAAgC,QAC5E,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SACCC,iBAAiB,EACjBC,WAAW,EACXC,KAAK,IAAIC,gBAAgB,EACzBC,2CAA2C,IAAIC,6BAA6B,EAC5EC,yBAAyB,EACzBC,iDAAiD,IAAIC,mCAAmC,EACxFC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,EAAE,QAAQ,iBAA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= {
61
61
  }
62
62
  },
63
63
  __experimentalSelector: "form"
64
- },
65
- viewScript: "file:./view.min.js"
64
+ }
66
65
  };
67
66
  import save from './save';
68
67
  import variations from './variations';
@@ -1 +1 @@
1
- {"version":3,"names":["initBlock","edit","metadata","$schema","apiVersion","__experimental","name","title","category","allowedBlocks","description","keywords","textdomain","icon","attributes","submissionMethod","type","method","action","email","supports","anchor","className","color","gradients","link","__experimentalDefaultControls","background","text","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalTextDecoration","__experimentalFontStyle","__experimentalFontWeight","__experimentalLetterSpacing","__experimentalTextTransform","__experimentalSelector","viewScript","save","variations","addFilter","settings","init","DISALLOWED_PARENTS","canInsert","blockType","rootClientId","getBlock","getBlockParentsByBlockName","disallowedParentType","hasDisallowedParent","length"],"sources":["@wordpress/block-library/src/form/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport variations from './variations';\n\n/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\tedit,\n\tsave,\n\tvariations,\n};\n\nexport const init = () => {\n\t// Prevent adding forms inside forms.\n\tconst DISALLOWED_PARENTS = [ 'core/form' ];\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'core/block-library/preventInsertingFormIntoAnotherForm',\n\t\t(\n\t\t\tcanInsert,\n\t\t\tblockType,\n\t\t\trootClientId,\n\t\t\t{ getBlock, getBlockParentsByBlockName }\n\t\t) => {\n\t\t\tif ( blockType.name !== 'core/form' ) {\n\t\t\t\treturn canInsert;\n\t\t\t}\n\n\t\t\tfor ( const disallowedParentType of DISALLOWED_PARENTS ) {\n\t\t\t\tconst hasDisallowedParent =\n\t\t\t\t\tgetBlock( rootClientId )?.name === disallowedParentType ||\n\t\t\t\t\tgetBlockParentsByBlockName(\n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AMwC,QAAQ,GAAG;EACvB7C,IAAI;EACJ0C,IAAI;EACJC;AACD,CAAC;AAED,OAAO,MAAMG,IAAI,GAAGA,CAAA,KAAM;EACzB;EACA,MAAMC,kBAAkB,GAAG,CAAE,WAAW,CAAE;EAC1CH,SAAS,CACR,0CAA0C,EAC1C,wDAAwD,EACxD,CACCI,SAAS,EACTC,SAAS,EACTC,YAAY,EACZ;IAAEC,QAAQ;IAAEC;EAA2B,CAAC,KACpC;IACJ,IAAKH,SAAS,CAAC5C,IAAI,KAAK,WAAW,EAAG;MACrC,OAAO2C,SAAS;IACjB;IAEA,KAAM,MAAMK,oBAAoB,IAAIN,kBAAkB,EAAG;MACxD,MAAMO,mBAAmB,GACxBH,QAAQ,CAAED,YAAa,CAAC,EAAE7C,IAAI,KAAKgD,oBAAoB,IACvDD,0BAA0B,CACzBF,YAAY,EACZG,oBACD,CAAC,CAACE,MAAM;MACT,IAAKD,mBAAmB,EAAG;QAC1B,OAAO,KAAK;MACb;IACD;IACA,OAAO,IAAI;EACZ,CACD,CAAC;EAED,OAAOvD,SAAS,CAAE;IAAEM,IAAI;IAAEJ,QAAQ;IAAE4C;EAAS,CAAE,CAAC;AACjD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["initBlock","edit","metadata","$schema","apiVersion","__experimental","name","title","category","allowedBlocks","description","keywords","textdomain","icon","attributes","submissionMethod","type","method","action","email","supports","anchor","className","color","gradients","link","__experimentalDefaultControls","background","text","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalTextDecoration","__experimentalFontStyle","__experimentalFontWeight","__experimentalLetterSpacing","__experimentalTextTransform","__experimentalSelector","save","variations","addFilter","settings","init","DISALLOWED_PARENTS","canInsert","blockType","rootClientId","getBlock","getBlockParentsByBlockName","disallowedParentType","hasDisallowedParent","length"],"sources":["@wordpress/block-library/src/form/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport variations from './variations';\n\n/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\tedit,\n\tsave,\n\tvariations,\n};\n\nexport const init = () => {\n\t// Prevent adding forms inside forms.\n\tconst DISALLOWED_PARENTS = [ 'core/form' ];\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'core/block-library/preventInsertingFormIntoAnotherForm',\n\t\t(\n\t\t\tcanInsert,\n\t\t\tblockType,\n\t\t\trootClientId,\n\t\t\t{ getBlock, getBlockParentsByBlockName }\n\t\t) => {\n\t\t\tif ( blockType.name !== 'core/form' ) {\n\t\t\t\treturn canInsert;\n\t\t\t}\n\n\t\t\tfor ( const disallowedParentType of DISALLOWED_PARENTS ) {\n\t\t\t\tconst hasDisallowedParent =\n\t\t\t\t\tgetBlock( rootClientId )?.name === disallowedParentType ||\n\t\t\t\t\tgetBlockParentsByBlockName(\n\t\t\t\t\t\trootClientId,\n\t\t\t\t\t\tdisallowedParentType\n\t\t\t\t\t).length;\n\t\t\t\tif ( hasDisallowedParent ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t);\n\n\treturn initBlock( { name, metadata, settings } );\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,qBAAqB;AAC3C,OAAOC,IAAI,MAAM,QAAQ;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,cAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,aAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,UAAA;IAAAC,gBAAA;MAAAC,IAAA;MAAA;IAAA;IAAAC,MAAA;MAAAD,IAAA;MAAA;IAAA;IAAAE,MAAA;MAAAF,IAAA;IAAA;IAAAG,KAAA;MAAAH,IAAA;IAA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O,IAAI;EACZ,CACD,CAAC;EAED,OAAOtD,SAAS,CAAE;IAAEM,IAAI;IAAEJ,QAAQ;IAAE2C;EAAS,CAAE,CAAC;AACjD,CAAC","ignoreList":[]}
@@ -1,9 +1,14 @@
1
1
  /* wp:polyfill */
2
+ let formSettings;
3
+ try {
4
+ formSettings = JSON.parse(document.getElementById('wp-script-module-data-@wordpress/block-library/form/view')?.textContent);
5
+ } catch {}
6
+
2
7
  // eslint-disable-next-line eslint-comments/disable-enable-pair
3
8
  /* eslint-disable no-undef */
4
9
  document.querySelectorAll('form.wp-block-form').forEach(function (form) {
5
- // Bail If the form is not using the mailto: action.
6
- if (!form.action || !form.action.startsWith('mailto:')) {
10
+ // Bail If the form settings not provided or the form is not using the mailto: action.
11
+ if (!formSettings || !form.action || !form.action.startsWith('mailto:')) {
7
12
  return;
8
13
  }
9
14
  const redirectNotification = status => {
@@ -18,12 +23,12 @@ document.querySelectorAll('form.wp-block-form').forEach(function (form) {
18
23
  // Get the form data and merge it with the form action and nonce.
19
24
  const formData = Object.fromEntries(new FormData(form).entries());
20
25
  formData.formAction = form.action;
21
- formData._ajax_nonce = wpBlockFormSettings.nonce;
22
- formData.action = wpBlockFormSettings.action;
26
+ formData._ajax_nonce = formSettings.nonce;
27
+ formData.action = formSettings.action;
23
28
  formData._wp_http_referer = window.location.href;
24
29
  formData.formAction = form.action;
25
30
  try {
26
- const response = await fetch(wpBlockFormSettings.ajaxUrl, {
31
+ const response = await fetch(formSettings.ajaxUrl, {
27
32
  method: 'POST',
28
33
  headers: {
29
34
  'Content-Type': 'application/x-www-form-urlencoded'
@@ -1 +1 @@
1
- {"version":3,"names":["document","querySelectorAll","forEach","form","action","startsWith","redirectNotification","status","urlParams","URLSearchParams","window","location","search","append","toString","addEventListener","event","preventDefault","formData","Object","fromEntries","FormData","entries","formAction","_ajax_nonce","wpBlockFormSettings","nonce","_wp_http_referer","href","response","fetch","ajaxUrl","method","headers","body","ok","error"],"sources":["@wordpress/block-library/src/form/view.js"],"sourcesContent":["// eslint-disable-next-line eslint-comments/disable-enable-pair\n/* eslint-disable no-undef */\ndocument.querySelectorAll( 'form.wp-block-form' ).forEach( function ( form ) {\n\t// Bail If the form is not using the mailto: action.\n\tif ( ! form.action || ! form.action.startsWith( 'mailto:' ) ) {\n\t\treturn;\n\t}\n\n\tconst redirectNotification = ( status ) => {\n\t\tconst urlParams = new URLSearchParams( window.location.search );\n\t\turlParams.append( 'wp-form-result', status );\n\t\twindow.location.search = urlParams.toString();\n\t};\n\n\t// Add an event listener for the form submission.\n\tform.addEventListener( 'submit', async function ( event ) {\n\t\tevent.preventDefault();\n\t\t// Get the form data and merge it with the form action and nonce.\n\t\tconst formData = Object.fromEntries( new FormData( form ).entries() );\n\t\tformData.formAction = form.action;\n\t\tformData._ajax_nonce = wpBlockFormSettings.nonce;\n\t\tformData.action = wpBlockFormSettings.action;\n\t\tformData._wp_http_referer = window.location.href;\n\t\tformData.formAction = form.action;\n\n\t\ttry {\n\t\t\tconst response = await fetch( wpBlockFormSettings.ajaxUrl, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': 'application/x-www-form-urlencoded',\n\t\t\t\t},\n\t\t\t\tbody: new URLSearchParams( formData ).toString(),\n\t\t\t} );\n\t\t\tif ( response.ok ) {\n\t\t\t\tredirectNotification( 'success' );\n\t\t\t} else {\n\t\t\t\tredirectNotification( 'error' );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tredirectNotification( 'error' );\n\t\t}\n\t} );\n} );\n"],"mappings":";AAAA;AACA;AACAA,QAAQ,CAACC,gBAAgB,CAAE,oBAAqB,CAAC,CAACC,OAAO,CAAE,UAAWC,IAAI,EAAG;EAC5E;EACA,IAAK,CAAEA,IAAI,CAACC,MAAM,IAAI,CAAED,IAAI,CAACC,MAAM,CAACC,UAAU,CAAE,SAAU,CAAC,EAAG;IAC7D;EACD;EAEA,MAAMC,oBAAoB,GAAKC,MAAM,IAAM;IAC1C,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J,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["formSettings","JSON","parse","document","getElementById","textContent","querySelectorAll","forEach","form","action","startsWith","redirectNotification","status","urlParams","URLSearchParams","window","location","search","append","toString","addEventListener","event","preventDefault","formData","Object","fromEntries","FormData","entries","formAction","_ajax_nonce","nonce","_wp_http_referer","href","response","fetch","ajaxUrl","method","headers","body","ok","error"],"sources":["@wordpress/block-library/src/form/view.js"],"sourcesContent":["let formSettings;\ntry {\n\tformSettings = JSON.parse(\n\t\tdocument.getElementById(\n\t\t\t'wp-script-module-data-@wordpress/block-library/form/view'\n\t\t)?.textContent\n\t);\n} catch {}\n\n// eslint-disable-next-line eslint-comments/disable-enable-pair\n/* eslint-disable no-undef */\ndocument.querySelectorAll( 'form.wp-block-form' ).forEach( function ( form ) {\n\t// Bail If the form settings not provided or the form is not using the mailto: action.\n\tif (\n\t\t! formSettings ||\n\t\t! form.action ||\n\t\t! form.action.startsWith( 'mailto:' )\n\t) {\n\t\treturn;\n\t}\n\n\tconst redirectNotification = ( status ) => {\n\t\tconst urlParams = new URLSearchParams( window.location.search );\n\t\turlParams.append( 'wp-form-result', status );\n\t\twindow.location.search = urlParams.toString();\n\t};\n\n\t// Add an event listener for the form submission.\n\tform.addEventListener( 'submit', async function ( event ) {\n\t\tevent.preventDefault();\n\t\t// Get the form data and merge it with the form action and nonce.\n\t\tconst formData = Object.fromEntries( new FormData( form ).entries() );\n\t\tformData.formAction = form.action;\n\t\tformData._ajax_nonce = formSettings.nonce;\n\t\tformData.action = formSettings.action;\n\t\tformData._wp_http_referer = window.location.href;\n\t\tformData.formAction = form.action;\n\n\t\ttry {\n\t\t\tconst response = await fetch( formSettings.ajaxUrl, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t\t'Content-Type': 'application/x-www-form-urlencoded',\n\t\t\t\t},\n\t\t\t\tbody: new URLSearchParams( formData ).toString(),\n\t\t\t} );\n\t\t\tif ( response.ok ) {\n\t\t\t\tredirectNotification( 'success' );\n\t\t\t} else {\n\t\t\t\tredirectNotification( 'error' );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tredirectNotification( 'error' );\n\t\t}\n\t} );\n} );\n"],"mappings":";AAAA,IAAIA,YAAY;AAChB,IAAI;EACHA,YAAY,GAAGC,IAAI,CAACC,KAAK,CACxBC,QAAQ,CAACC,cAAc,CACtB,0DACD,CAAC,EAAEC,WACJ,CAAC;AACF,CAAC,CAAC,MAAM,CAAC;;AAET;AACA;AACAF,QAAQ,CAACG,gBAAgB,CAAE,oBAAqB,CAAC,CAACC,OAAO,CAAE,UAAWC,IAAI,EAAG;EAC5E;EACA,IACC,CAAER,YAAY,IACd,CAAEQ,IAAI,CAACC,MAAM,IACb,CAAED,IAAI,CAACC,MAAM,CAACC,UAAU,CAAE,SAAU,CAAC,EACpC;IACD;EACD;EAEA,MAAMC,oBAAoB,GAAKC,MAAM,IAAM;IAC1C,MAAMC,SAAS,GAAG,IAAIC,eAAe,CAAEC,MAAM,CAACC,QAAQ,CAACC,MAAO,CAAC;IAC/DJ,SAAS,CAACK,MAAM,CAAE,gBAAgB,EAAEN,MAAO,CAAC;IAC5CG,MAAM,CAACC,QAAQ,CAACC,MAAM,GAAGJ,SAAS,CAACM,QAAQ,CAAC,CAAC;EAC9C,CAAC;;EAED;EACAX,IAAI,CAACY,gBAAgB,CAAE,QAAQ,EAAE,gBAAiBC,KAAK,EAAG;IACzDA,KAAK,CAACC,cAAc,CAAC,CAAC;IACtB;IACA,MAAMC,QAAQ,GAAGC,MAAM,CAACC,WAAW,CAAE,IAAIC,QAAQ,CAAElB,IAAK,CAAC,CAACmB,OAAO,CAAC,CAAE,CAAC;IACrEJ,QAAQ,CAACK,UAAU,GAAGpB,IAAI,CAACC,MAAM;IACjCc,QAAQ,CAACM,WAAW,GAAG7B,YAAY,CAAC8B,KAAK;IACzCP,QAAQ,CAACd,MAAM,GAAGT,YAAY,CAACS,MAAM;IACrCc,QAAQ,CAACQ,gBAAgB,GAAGhB,MAAM,CAACC,QAAQ,CAACgB,IAAI;IAChDT,QAAQ,CAACK,UAAU,GAAGpB,IAAI,CAACC,MAAM;IAEjC,IAAI;MACH,MAAMwB,QAAQ,GAAG,MAAMC,KAAK,CAAElC,YAAY,CAACmC,OAAO,EAAE;QACnDC,MAAM,EAAE,MAAM;QACdC,OAAO,EAAE;UACR,cAAc,EAAE;QACjB,CAAC;QACDC,IAAI,EAAE,IAAIxB,eAAe,CAAES,QAAS,CAAC,CAACJ,QAAQ,CAAC;MAChD,CAAE,CAAC;MACH,IAAKc,QAAQ,CAACM,EAAE,EAAG;QAClB5B,oBAAoB,CAAE,SAAU,CAAC;MAClC,CAAC,MAAM;QACNA,oBAAoB,CAAE,OAAQ,CAAC;MAChC;IACD,CAAC,CAAC,OAAQ6B,KAAK,EAAG;MACjB7B,oBAAoB,CAAE,OAAQ,CAAC;IAChC;EACD,CAAE,CAAC;AACJ,CAAE,CAAC","ignoreList":[]}
@@ -46,7 +46,7 @@ export default function useMerge(clientId, onMerge) {
46
46
  * return the next list item of the parent list item if it exists.
47
47
  *
48
48
  * @param {string} id A list item client ID.
49
- * @return {string?} The client ID of the next list item.
49
+ * @return {?string} The client ID of the next list item.
50
50
  */
51
51
  function _getNextId(id) {
52
52
  const next = getNextBlockClientId(id);
@@ -65,7 +65,7 @@ export default function useMerge(clientId, onMerge) {
65
65
  * line, regardless of indentation level.
66
66
  *
67
67
  * @param {string} id The client ID of the current list item.
68
- * @return {string?} The client ID of the next list item.
68
+ * @return {?string} The client ID of the next list item.
69
69
  */
70
70
  function getNextId(id) {
71
71
  const order = getBlockOrder(id);
@@ -1 +1 @@
1
- {"version":3,"names":["useRegistry","useDispatch","useSelect","store","blockEditorStore","useOutdentListItem","useMerge","clientId","onMerge","registry","getPreviousBlockClientId","getNextBlockClientId","getBlockOrder","getBlockRootClientId","getBlockName","mergeBlocks","moveBlocksToPosition","outdentListItem","getTrailingId","id","order","length","getParentListItemId","listId","parentListItemId","_getNextId","next","getNextId","forward","mergeWithNested","clientIdA","clientIdB","batch","nestedListClientId","nextBlockClientId","previousBlockClientId","trailingId"],"sources":["@wordpress/block-library/src/list-item/hooks/use-merge.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry, useDispatch, useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport useOutdentListItem from './use-outdent-list-item';\n\nexport default function useMerge( clientId, onMerge ) {\n\tconst registry = useRegistry();\n\tconst {\n\t\tgetPreviousBlockClientId,\n\t\tgetNextBlockClientId,\n\t\tgetBlockOrder,\n\t\tgetBlockRootClientId,\n\t\tgetBlockName,\n\t} = useSelect( blockEditorStore );\n\tconst { mergeBlocks, moveBlocksToPosition } =\n\t\tuseDispatch( blockEditorStore );\n\tconst outdentListItem = useOutdentListItem();\n\n\tfunction getTrailingId( id ) {\n\t\tconst order = getBlockOrder( id );\n\n\t\tif ( ! order.length ) {\n\t\t\treturn id;\n\t\t}\n\n\t\treturn getTrailingId( order[ order.length - 1 ] );\n\t}\n\n\tfunction getParentListItemId( id ) {\n\t\tconst listId = getBlockRootClientId( id );\n\t\tconst parentListItemId = getBlockRootClientId( listId );\n\t\tif ( ! parentListItemId ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( getBlockName( parentListItemId ) !== 'core/list-item' ) {\n\t\t\treturn;\n\t\t}\n\t\treturn parentListItemId;\n\t}\n\n\t/**\n\t * Return the next list item with respect to the given list item. If none,\n\t * return the next list item of the parent list item if it exists.\n\t *\n\t * @param {string} id A list item client ID.\n\t * @return {string?} The client ID of the next list item.\n\t */\n\tfunction _getNextId( id ) {\n\t\tconst next = getNextBlockClientId( id );\n\t\tif ( next ) {\n\t\t\treturn next;\n\t\t}\n\t\tconst parentListItemId = getParentListItemId( id );\n\t\tif ( ! parentListItemId ) {\n\t\t\treturn;\n\t\t}\n\t\treturn _getNextId( parentListItemId );\n\t}\n\n\t/**\n\t * Given a client ID, return the client ID of the list item on the next\n\t * line, regardless of indentation level.\n\t *\n\t * @param {string} id The client ID of the current list item.\n\t * @return {string?} The client ID of the next list item.\n\t */\n\tfunction getNextId( id ) {\n\t\tconst order = getBlockOrder( id );\n\n\t\t// If the list item does not have a nested list, return the next list\n\t\t// item.\n\t\tif ( ! order.length ) {\n\t\t\treturn _getNextId( id );\n\t\t}\n\n\t\t// Get the first list item in the nested list.\n\t\treturn getBlockOrder( order[ 0 ] )[ 0 ];\n\t}\n\n\treturn ( forward ) => {\n\t\tfunction mergeWithNested( clientIdA, clientIdB ) {\n\t\t\tregistry.batch( () => {\n\t\t\t\t// When merging a sub list item with a higher next list item, we\n\t\t\t\t// also need to move any nested list items. Check if there's a\n\t\t\t\t// listed list, and append its nested list items to the current\n\t\t\t\t// list.\n\t\t\t\tconst [ nestedListClientId ] = getBlockOrder( clientIdB );\n\t\t\t\tif ( nestedListClientId ) {\n\t\t\t\t\t// If we are merging with the previous list item, and the\n\t\t\t\t\t// previous list item does not have nested list, move the\n\t\t\t\t\t// nested list to the previous list item.\n\t\t\t\t\tif (\n\t\t\t\t\t\tgetPreviousBlockClientId( clientIdB ) === clientIdA &&\n\t\t\t\t\t\t! getBlockOrder( clientIdA ).length\n\t\t\t\t\t) {\n\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t[ nestedListClientId ],\n\t\t\t\t\t\t\tclientIdB,\n\t\t\t\t\t\t\tclientIdA\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\tgetBlockOrder( nestedListClientId ),\n\t\t\t\t\t\t\tnestedListClientId,\n\t\t\t\t\t\t\tgetBlockRootClientId( clientIdA )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmergeBlocks( clientIdA, clientIdB );\n\t\t\t} );\n\t\t}\n\n\t\tif ( forward ) {\n\t\t\tconst nextBlockClientId = getNextId( clientId );\n\n\t\t\tif ( ! nextBlockClientId ) {\n\t\t\t\tonMerge( forward );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( getParentListItemId( nextBlockClientId ) ) {\n\t\t\t\toutdentListItem( nextBlockClientId );\n\t\t\t} else {\n\t\t\t\tmergeWithNested( clientId, nextBlockClientId );\n\t\t\t}\n\t\t} else {\n\t\t\t// Merging is only done from the top level. For lowel levels, the\n\t\t\t// list item is outdented instead.\n\t\t\tconst previousBlockClientId = getPreviousBlockClientId( clientId );\n\t\t\tif ( getParentListItemId( clientId ) ) {\n\t\t\t\toutdentListItem( clientId );\n\t\t\t} else if ( previousBlockClientId ) {\n\t\t\t\tconst trailingId = getTrailingId( previousBlockClientId );\n\t\t\t\tmergeWithNested( trailingId, clientId );\n\t\t\t} else {\n\t\t\t\tonMerge( forward );\n\t\t\t}\n\t\t}\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACrE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,OAAOC,kBAAkB,MAAM,yBAAyB;AAExD,eAAe,SAASC,QAAQA,CAAEC,QAAQ,EAAEC,OAAO,EAAG;EACrD,MAAMC,QAAQ,GAAGT,WAAW,CAAC,CAAC;EAC9B,MAAM;IACLU,wBAAwB;IACxBC,oBAAoB;IACpBC,aAAa;IACbC,oBAAoB;IACpBC;EACD,CAAC,GAAGZ,SAAS,CAAEE,gBAAiB,CAAC;EACjC,MAAM;IAAEW,WAAW;IAAEC;EAAqB,CAAC,GAC1Cf,WAAW,CAAEG,gBAAiB,CAAC;EAChC,MAAMa,eAAe,GAAGZ,kBAAkB,CAAC,CAAC;EAE5C,SAASa,aAAaA,CAAEC,EAAE,EAAG;IAC5B,MAAMC,KAAK,GAAGR,aAAa,CAAEO,EAAG,CAAC;IAEjC,IAAK,CAAEC,KAAK,CAACC,MAAM,EAAG;MACrB,OAA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AC;QACzD,IAAKE,kBAAkB,EAAG;UACzB;UACA;UACA;UACA,IACCvB,wBAAwB,CAAEqB,SAAU,CAAC,KAAKD,SAAS,IACnD,CAAElB,aAAa,CAAEkB,SAAU,CAAC,CAACT,MAAM,EAClC;YACDL,oBAAoB,CACnB,CAAEiB,kBAAkB,CAAE,EACtBF,SAAS,EACTD,SACD,CAAC;UACF,CAAC,MAAM;YACNd,oBAAoB,CACnBJ,aAAa,CAAEqB,kBAAmB,CAAC,EACnCA,kBAAkB,EAClBpB,oBAAoB,CAAEiB,SAAU,CACjC,CAAC;UACF;QACD;QACAf,WAAW,CAAEe,SAAS,EAAEC,SAAU,CAAC;MACpC,CAAE,CAAC;IACJ;IAEA,IAAKH,OAAO,EAAG;MACd,MAAMM,iBAAiB,GAAGP,SAAS,CAAEpB,QAAS,CAAC;MAE/C,IAAK,CAAE2B,iBAAiB,EAAG;QAC1B1B,OAAO,CAAEoB,OAAQ,CAAC;QAClB;MACD;MAEA,IAAKN,mBAAmB,CAAEY,iBAAkB,CAAC,EAAG;QAC/CjB,eAAe,CAAEiB,iBAAkB,CAAC;MACrC,CAAC,MAAM;QACNL,eAAe,CAAEtB,QAAQ,EAAE2B,iBAAkB,CAAC;MAC/C;IACD,CAAC,MAAM;MACN;MACA;MACA,MAAMC,qBAAqB,GAAGzB,wBAAwB,CAAEH,QAAS,CAAC;MAClE,IAAKe,mBAAmB,CAAEf,QAAS,CAAC,EAAG;QACtCU,eAAe,CAAEV,QAAS,CAAC;MAC5B,CAAC,MAAM,IAAK4B,qBAAqB,EAAG;QACnC,MAAMC,UAAU,GAAGlB,aAAa,CAAEiB,qBAAsB,CAAC;QACzDN,eAAe,CAAEO,UAAU,EAAE7B,QAAS,CAAC;MACxC,CAAC,MAAM;QACNC,OAAO,CAAEoB,OAAQ,CAAC;MACnB;IACD;EACD,CAAC;AACF","ignoreList":[]}
1
+ {"version":3,"names":["useRegistry","useDispatch","useSelect","store","blockEditorStore","useOutdentListItem","useMerge","clientId","onMerge","registry","getPreviousBlockClientId","getNextBlockClientId","getBlockOrder","getBlockRootClientId","getBlockName","mergeBlocks","moveBlocksToPosition","outdentListItem","getTrailingId","id","order","length","getParentListItemId","listId","parentListItemId","_getNextId","next","getNextId","forward","mergeWithNested","clientIdA","clientIdB","batch","nestedListClientId","nextBlockClientId","previousBlockClientId","trailingId"],"sources":["@wordpress/block-library/src/list-item/hooks/use-merge.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry, useDispatch, useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport useOutdentListItem from './use-outdent-list-item';\n\nexport default function useMerge( clientId, onMerge ) {\n\tconst registry = useRegistry();\n\tconst {\n\t\tgetPreviousBlockClientId,\n\t\tgetNextBlockClientId,\n\t\tgetBlockOrder,\n\t\tgetBlockRootClientId,\n\t\tgetBlockName,\n\t} = useSelect( blockEditorStore );\n\tconst { mergeBlocks, moveBlocksToPosition } =\n\t\tuseDispatch( blockEditorStore );\n\tconst outdentListItem = useOutdentListItem();\n\n\tfunction getTrailingId( id ) {\n\t\tconst order = getBlockOrder( id );\n\n\t\tif ( ! order.length ) {\n\t\t\treturn id;\n\t\t}\n\n\t\treturn getTrailingId( order[ order.length - 1 ] );\n\t}\n\n\tfunction getParentListItemId( id ) {\n\t\tconst listId = getBlockRootClientId( id );\n\t\tconst parentListItemId = getBlockRootClientId( listId );\n\t\tif ( ! parentListItemId ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( getBlockName( parentListItemId ) !== 'core/list-item' ) {\n\t\t\treturn;\n\t\t}\n\t\treturn parentListItemId;\n\t}\n\n\t/**\n\t * Return the next list item with respect to the given list item. If none,\n\t * return the next list item of the parent list item if it exists.\n\t *\n\t * @param {string} id A list item client ID.\n\t * @return {?string} The client ID of the next list item.\n\t */\n\tfunction _getNextId( id ) {\n\t\tconst next = getNextBlockClientId( id );\n\t\tif ( next ) {\n\t\t\treturn next;\n\t\t}\n\t\tconst parentListItemId = getParentListItemId( id );\n\t\tif ( ! parentListItemId ) {\n\t\t\treturn;\n\t\t}\n\t\treturn _getNextId( parentListItemId );\n\t}\n\n\t/**\n\t * Given a client ID, return the client ID of the list item on the next\n\t * line, regardless of indentation level.\n\t *\n\t * @param {string} id The client ID of the current list item.\n\t * @return {?string} The client ID of the next list item.\n\t */\n\tfunction getNextId( id ) {\n\t\tconst order = getBlockOrder( id );\n\n\t\t// If the list item does not have a nested list, return the next list\n\t\t// item.\n\t\tif ( ! order.length ) {\n\t\t\treturn _getNextId( id );\n\t\t}\n\n\t\t// Get the first list item in the nested list.\n\t\treturn getBlockOrder( order[ 0 ] )[ 0 ];\n\t}\n\n\treturn ( forward ) => {\n\t\tfunction mergeWithNested( clientIdA, clientIdB ) {\n\t\t\tregistry.batch( () => {\n\t\t\t\t// When merging a sub list item with a higher next list item, we\n\t\t\t\t// also need to move any nested list items. Check if there's a\n\t\t\t\t// listed list, and append its nested list items to the current\n\t\t\t\t// list.\n\t\t\t\tconst [ nestedListClientId ] = getBlockOrder( clientIdB );\n\t\t\t\tif ( nestedListClientId ) {\n\t\t\t\t\t// If we are merging with the previous list item, and the\n\t\t\t\t\t// previous list item does not have nested list, move the\n\t\t\t\t\t// nested list to the previous list item.\n\t\t\t\t\tif (\n\t\t\t\t\t\tgetPreviousBlockClientId( clientIdB ) === clientIdA &&\n\t\t\t\t\t\t! getBlockOrder( clientIdA ).length\n\t\t\t\t\t) {\n\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\t[ nestedListClientId ],\n\t\t\t\t\t\t\tclientIdB,\n\t\t\t\t\t\t\tclientIdA\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t\t\tgetBlockOrder( nestedListClientId ),\n\t\t\t\t\t\t\tnestedListClientId,\n\t\t\t\t\t\t\tgetBlockRootClientId( clientIdA )\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tmergeBlocks( clientIdA, clientIdB );\n\t\t\t} );\n\t\t}\n\n\t\tif ( forward ) {\n\t\t\tconst nextBlockClientId = getNextId( clientId );\n\n\t\t\tif ( ! nextBlockClientId ) {\n\t\t\t\tonMerge( forward );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( getParentListItemId( nextBlockClientId ) ) {\n\t\t\t\toutdentListItem( nextBlockClientId );\n\t\t\t} else {\n\t\t\t\tmergeWithNested( clientId, nextBlockClientId );\n\t\t\t}\n\t\t} else {\n\t\t\t// Merging is only done from the top level. For lowel levels, the\n\t\t\t// list item is outdented instead.\n\t\t\tconst previousBlockClientId = getPreviousBlockClientId( clientId );\n\t\t\tif ( getParentListItemId( clientId ) ) {\n\t\t\t\toutdentListItem( clientId );\n\t\t\t} else if ( previousBlockClientId ) {\n\t\t\t\tconst trailingId = getTrailingId( previousBlockClientId );\n\t\t\t\tmergeWithNested( trailingId, clientId );\n\t\t\t} else {\n\t\t\t\tonMerge( forward );\n\t\t\t}\n\t\t}\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACrE,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,OAAOC,kBAAkB,MAAM,yBAAyB;AAExD,eAAe,SAASC,QAAQA,CAAEC,QAAQ,EAAEC,OAAO,EAAG;EACrD,MAAMC,QAAQ,GAAGT,WAAW,CAAC,CAAC;EAC9B,MAAM;IACLU,wBAAwB;IACxBC,oBAAoB;IACpBC,aAAa;IACbC,oBAAoB;IACpBC;EACD,CAAC,GAAGZ,SAAS,CAAEE,gBAAiB,CAAC;EACjC,MAAM;IAAEW,WAAW;IAAEC;EAAqB,CAAC,GAC1Cf,WAAW,CAAEG,gBAAiB,CAAC;EAChC,MAAMa,eAAe,GAAGZ,kBAAkB,CAAC,CAAC;EAE5C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QACNC,OAAO,CAAEoB,OAAQ,CAAC;MACnB;IACD;EACD,CAAC;AACF","ignoreList":[]}
@@ -4,17 +4,24 @@
4
4
  import { Warning } from '@wordpress/block-editor';
5
5
  import { Button, Notice } from '@wordpress/components';
6
6
  import { __ } from '@wordpress/i18n';
7
- import { createInterpolateElement } from '@wordpress/element';
7
+ import { useState, createInterpolateElement } from '@wordpress/element';
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  function DeletedNavigationWarning({
10
10
  onCreateNew,
11
11
  isNotice = false
12
12
  }) {
13
+ const [isButtonDisabled, setIsButtonDisabled] = useState(false);
14
+ const handleButtonClick = () => {
15
+ setIsButtonDisabled(true);
16
+ onCreateNew();
17
+ };
13
18
  const message = createInterpolateElement(__('Navigation Menu has been deleted or is unavailable. <button>Create a new Menu?</button>'), {
14
19
  button: /*#__PURE__*/_jsx(Button, {
15
20
  __next40pxDefaultSize: true,
16
- onClick: onCreateNew,
17
- variant: "link"
21
+ onClick: handleButtonClick,
22
+ variant: "link",
23
+ disabled: isButtonDisabled,
24
+ accessibleWhenDisabled: true
18
25
  })
19
26
  });
20
27
  return isNotice ? /*#__PURE__*/_jsx(Notice, {
@@ -1 +1 @@
1
- {"version":3,"names":["Warning","Button","Notice","__","createInterpolateElement","jsx","_jsx","DeletedNavigationWarning","onCreateNew","isNotice","message","button","__next40pxDefaultSize","onClick","variant","status","isDismissible","children"],"sources":["@wordpress/block-library/src/navigation/edit/deleted-navigation-warning.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Warning } from '@wordpress/block-editor';\nimport { Button, Notice } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\n\nfunction DeletedNavigationWarning( { onCreateNew, isNotice = false } ) {\n\tconst message = createInterpolateElement(\n\t\t__(\n\t\t\t'Navigation Menu has been deleted or is unavailable. <button>Create a new Menu?</button>'\n\t\t),\n\t\t{\n\t\t\tbutton: (\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tonClick={ onCreateNew }\n\t\t\t\t\tvariant=\"link\"\n\t\t\t\t/>\n\t\t\t),\n\t\t}\n\t);\n\n\treturn isNotice ? (\n\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t{ message }\n\t\t</Notice>\n\t) : (\n\t\t<Warning>{ message }</Warning>\n\t);\n}\n\nexport default DeletedNavigationWarning;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,yBAAyB;AACjD,SAASC,MAAM,EAAEC,MAAM,QAAQ,uBAAuB;AACtD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,wBAAwB,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE9D,SAASC,wBAAwBA,CAAE;EAAEC,WAAW;EAAEC,QAAQ,GAAG;AAAM,CAAC,EAAG;EACtE,MAAMC,OAAO,GAAGN,wBAAwB,CACvCD,EAAE,CACD,yFACD,CAAC,EACD;IACCQ,MAAM,eACLL,IAAA,CAACL,MAAM;MACNW,qBAAqB;MACrBC,OAAO,EAAGL,WAAa;MACvBM,OAAO,EAAC;IAAM,CACd;EAEH,CACD,CAAC;EAED,OAAOL,QAAQ,gBACdH,IAAA,CAACJ,MAAM;IAACa,MAAM,EAAC,SAAS;IAACC,aAAa,EAAG,KAAO;IAAAC,QAAA,EAC7CP;EAAO,CACF,CAAC,gBAETJ,IAAA,CAACN,OAAO;IAAAiB,QAAA,EAAGP;EAAO,CAAW,CAC7B;AACF;AAEA,eAAeH,wBAAwB","ignoreList":[]}
1
+ {"version":3,"names":["Warning","Button","Notice","__","useState","createInterpolateElement","jsx","_jsx","DeletedNavigationWarning","onCreateNew","isNotice","isButtonDisabled","setIsButtonDisabled","handleButtonClick","message","button","__next40pxDefaultSize","onClick","variant","disabled","accessibleWhenDisabled","status","isDismissible","children"],"sources":["@wordpress/block-library/src/navigation/edit/deleted-navigation-warning.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Warning } from '@wordpress/block-editor';\nimport { Button, Notice } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, createInterpolateElement } from '@wordpress/element';\n\nfunction DeletedNavigationWarning( { onCreateNew, isNotice = false } ) {\n\tconst [ isButtonDisabled, setIsButtonDisabled ] = useState( false );\n\n\tconst handleButtonClick = () => {\n\t\tsetIsButtonDisabled( true );\n\t\tonCreateNew();\n\t};\n\n\tconst message = createInterpolateElement(\n\t\t__(\n\t\t\t'Navigation Menu has been deleted or is unavailable. <button>Create a new Menu?</button>'\n\t\t),\n\t\t{\n\t\t\tbutton: (\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tonClick={ handleButtonClick }\n\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\tdisabled={ isButtonDisabled }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t/>\n\t\t\t),\n\t\t}\n\t);\n\n\treturn isNotice ? (\n\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t{ message }\n\t\t</Notice>\n\t) : (\n\t\t<Warning>{ message }</Warning>\n\t);\n}\n\nexport default DeletedNavigationWarning;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,yBAAyB;AACjD,SAASC,MAAM,EAAEC,MAAM,QAAQ,uBAAuB;AACtD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,EAAEC,wBAAwB,QAAQ,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAExE,SAASC,wBAAwBA,CAAE;EAAEC,WAAW;EAAEC,QAAQ,GAAG;AAAM,CAAC,EAAG;EACtE,MAAM,CAAEC,gBAAgB,EAAEC,mBAAmB,CAAE,GAAGR,QAAQ,CAAE,KAAM,CAAC;EAEnE,MAAMS,iBAAiB,GAAGA,CAAA,KAAM;IAC/BD,mBAAmB,CAAE,IAAK,CAAC;IAC3BH,WAAW,CAAC,CAAC;EACd,CAAC;EAED,MAAMK,OAAO,GAAGT,wBAAwB,CACvCF,EAAE,CACD,yFACD,CAAC,EACD;IACCY,MAAM,eACLR,IAAA,CAACN,MAAM;MACNe,qBAAqB;MACrBC,OAAO,EAAGJ,iBAAmB;MAC7BK,OAAO,EAAC,MAAM;MACdC,QAAQ,EAAGR,gBAAkB;MAC7BS,sBAAsB;IAAA,CACtB;EAEH,CACD,CAAC;EAED,OAAOV,QAAQ,gBACdH,IAAA,CAACL,MAAM;IAACmB,MAAM,EAAC,SAAS;IAACC,aAAa,EAAG,KAAO;IAAAC,QAAA,EAC7CT;EAAO,CACF,CAAC,gBAETP,IAAA,CAACP,OAAO;IAAAuB,QAAA,EAAGT;EAAO,CAAW,CAC7B;AACF;AAEA,eAAeN,wBAAwB","ignoreList":[]}
@@ -458,8 +458,7 @@ export default function NavigationLinkEdit({
458
458
  __unstableOnSplitAtEnd: () => insertBlocksAfter(createBlock('core/navigation-link')),
459
459
  "aria-label": __('Navigation link text'),
460
460
  placeholder: itemLabelPlaceholder,
461
- withoutInteractiveFormatting: true,
462
- allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough']
461
+ withoutInteractiveFormatting: true
463
462
  }), description && /*#__PURE__*/_jsx("span", {
464
463
  className: "wp-block-navigation-item__description",
465
464
  children: description