@wordpress/block-library 8.33.0 → 8.34.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 (259) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/block/edit.js +15 -8
  3. package/build/block/edit.js.map +1 -1
  4. package/build/block-keyboard-shortcuts/index.js +95 -0
  5. package/build/block-keyboard-shortcuts/index.js.map +1 -0
  6. package/build/column/edit.js +28 -19
  7. package/build/column/edit.js.map +1 -1
  8. package/build/column/edit.native.js +3 -1
  9. package/build/column/edit.native.js.map +1 -1
  10. package/build/columns/edit.js +69 -53
  11. package/build/columns/edit.js.map +1 -1
  12. package/build/columns/variations.js +18 -28
  13. package/build/columns/variations.js.map +1 -1
  14. package/build/comment-template/util.js +3 -1
  15. package/build/comment-template/util.js.map +1 -1
  16. package/build/cover/shared.js +3 -1
  17. package/build/cover/shared.js.map +1 -1
  18. package/build/embed/embed-placeholder.js +8 -3
  19. package/build/embed/embed-placeholder.js.map +1 -1
  20. package/build/embed/util.js +3 -1
  21. package/build/embed/util.js.map +1 -1
  22. package/build/embed/variations.js +3 -1
  23. package/build/embed/variations.js.map +1 -1
  24. package/build/embed/wp-embed-preview.js +6 -2
  25. package/build/embed/wp-embed-preview.js.map +1 -1
  26. package/build/group/index.js +0 -8
  27. package/build/group/index.js.map +1 -1
  28. package/build/group/placeholder.js +18 -19
  29. package/build/group/placeholder.js.map +1 -1
  30. package/build/image/image.js +3 -1
  31. package/build/image/image.js.map +1 -1
  32. package/build/image/view.js +3 -1
  33. package/build/image/view.js.map +1 -1
  34. package/build/index.js +9 -1
  35. package/build/index.js.map +1 -1
  36. package/build/list-item/hooks/use-merge.js +12 -4
  37. package/build/list-item/hooks/use-merge.js.map +1 -1
  38. package/build/list-item/hooks/use-outdent-list-item.js +15 -5
  39. package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
  40. package/build/navigation/edit/are-blocks-dirty.js +9 -3
  41. package/build/navigation/edit/are-blocks-dirty.js.map +1 -1
  42. package/build/navigation/edit/deleted-navigation-warning.js +1 -1
  43. package/build/navigation/edit/deleted-navigation-warning.js.map +1 -1
  44. package/build/navigation/edit/menu-inspector-controls.js +3 -1
  45. package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
  46. package/build/navigation/edit/navigation-menu-selector.js +1 -1
  47. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  48. package/build/navigation/index.js +0 -9
  49. package/build/navigation/index.js.map +1 -1
  50. package/build/navigation/view.js +3 -1
  51. package/build/navigation/view.js.map +1 -1
  52. package/build/navigation-link/edit.js +94 -85
  53. package/build/navigation-link/edit.js.map +1 -1
  54. package/build/navigation-link/link-ui.js +2 -7
  55. package/build/navigation-link/link-ui.js.map +1 -1
  56. package/build/paragraph/index.js +0 -1
  57. package/build/paragraph/index.js.map +1 -1
  58. package/build/paragraph/transforms.js +0 -1
  59. package/build/paragraph/transforms.js.map +1 -1
  60. package/build/post-excerpt/edit.js +3 -1
  61. package/build/post-excerpt/edit.js.map +1 -1
  62. package/build/post-featured-image/dimension-controls.js +3 -1
  63. package/build/post-featured-image/dimension-controls.js.map +1 -1
  64. package/build/post-navigation-link/variations.js +3 -1
  65. package/build/post-navigation-link/variations.js.map +1 -1
  66. package/build/post-template/edit.js +18 -8
  67. package/build/post-template/edit.js.map +1 -1
  68. package/build/post-terms/edit.js +3 -1
  69. package/build/post-terms/edit.js.map +1 -1
  70. package/build/private-apis.js +21 -0
  71. package/build/private-apis.js.map +1 -0
  72. package/build/query/edit/enhanced-pagination-modal.js +1 -1
  73. package/build/query/edit/enhanced-pagination-modal.js.map +1 -1
  74. package/build/query/edit/inspector-controls/author-control.js +6 -2
  75. package/build/query/edit/inspector-controls/author-control.js.map +1 -1
  76. package/build/query/edit/inspector-controls/create-new-post-link.js +3 -1
  77. package/build/query/edit/inspector-controls/create-new-post-link.js.map +1 -1
  78. package/build/query/edit/inspector-controls/enhanced-pagination-control.js +6 -3
  79. package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  80. package/build/query/edit/inspector-controls/parent-control.js +18 -6
  81. package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
  82. package/build/query/edit/inspector-controls/taxonomy-controls.js +9 -3
  83. package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  84. package/build/query/utils.js +3 -1
  85. package/build/query/utils.js.map +1 -1
  86. package/build/query-title/variations.js +3 -1
  87. package/build/query-title/variations.js.map +1 -1
  88. package/build/social-link/edit.js +1 -1
  89. package/build/social-link/edit.js.map +1 -1
  90. package/build/social-link/variations.js +3 -1
  91. package/build/social-link/variations.js.map +1 -1
  92. package/build/template-part/variations.js +6 -2
  93. package/build/template-part/variations.js.map +1 -1
  94. package/build-module/block/edit.js +15 -8
  95. package/build-module/block/edit.js.map +1 -1
  96. package/build-module/block-keyboard-shortcuts/index.js +88 -0
  97. package/build-module/block-keyboard-shortcuts/index.js.map +1 -0
  98. package/build-module/column/edit.js +28 -19
  99. package/build-module/column/edit.js.map +1 -1
  100. package/build-module/column/edit.native.js +3 -1
  101. package/build-module/column/edit.native.js.map +1 -1
  102. package/build-module/columns/edit.js +69 -53
  103. package/build-module/columns/edit.js.map +1 -1
  104. package/build-module/columns/variations.js +18 -28
  105. package/build-module/columns/variations.js.map +1 -1
  106. package/build-module/comment-template/util.js +3 -1
  107. package/build-module/comment-template/util.js.map +1 -1
  108. package/build-module/cover/shared.js +3 -1
  109. package/build-module/cover/shared.js.map +1 -1
  110. package/build-module/embed/embed-placeholder.js +9 -4
  111. package/build-module/embed/embed-placeholder.js.map +1 -1
  112. package/build-module/embed/util.js +3 -1
  113. package/build-module/embed/util.js.map +1 -1
  114. package/build-module/embed/variations.js +3 -1
  115. package/build-module/embed/variations.js.map +1 -1
  116. package/build-module/embed/wp-embed-preview.js +6 -2
  117. package/build-module/embed/wp-embed-preview.js.map +1 -1
  118. package/build-module/group/index.js +0 -8
  119. package/build-module/group/index.js.map +1 -1
  120. package/build-module/group/placeholder.js +18 -19
  121. package/build-module/group/placeholder.js.map +1 -1
  122. package/build-module/image/image.js +3 -1
  123. package/build-module/image/image.js.map +1 -1
  124. package/build-module/image/view.js +3 -1
  125. package/build-module/image/view.js.map +1 -1
  126. package/build-module/index.js +1 -0
  127. package/build-module/index.js.map +1 -1
  128. package/build-module/list-item/hooks/use-merge.js +12 -4
  129. package/build-module/list-item/hooks/use-merge.js.map +1 -1
  130. package/build-module/list-item/hooks/use-outdent-list-item.js +15 -5
  131. package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
  132. package/build-module/navigation/edit/are-blocks-dirty.js +9 -3
  133. package/build-module/navigation/edit/are-blocks-dirty.js.map +1 -1
  134. package/build-module/navigation/edit/deleted-navigation-warning.js +1 -1
  135. package/build-module/navigation/edit/deleted-navigation-warning.js.map +1 -1
  136. package/build-module/navigation/edit/menu-inspector-controls.js +3 -1
  137. package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
  138. package/build-module/navigation/edit/navigation-menu-selector.js +1 -1
  139. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  140. package/build-module/navigation/index.js +0 -9
  141. package/build-module/navigation/index.js.map +1 -1
  142. package/build-module/navigation/view.js +3 -1
  143. package/build-module/navigation/view.js.map +1 -1
  144. package/build-module/navigation-link/edit.js +94 -85
  145. package/build-module/navigation-link/edit.js.map +1 -1
  146. package/build-module/navigation-link/link-ui.js +3 -8
  147. package/build-module/navigation-link/link-ui.js.map +1 -1
  148. package/build-module/paragraph/index.js +0 -1
  149. package/build-module/paragraph/index.js.map +1 -1
  150. package/build-module/paragraph/transforms.js +0 -1
  151. package/build-module/paragraph/transforms.js.map +1 -1
  152. package/build-module/post-excerpt/edit.js +3 -1
  153. package/build-module/post-excerpt/edit.js.map +1 -1
  154. package/build-module/post-featured-image/dimension-controls.js +3 -1
  155. package/build-module/post-featured-image/dimension-controls.js.map +1 -1
  156. package/build-module/post-navigation-link/variations.js +3 -1
  157. package/build-module/post-navigation-link/variations.js.map +1 -1
  158. package/build-module/post-template/edit.js +18 -8
  159. package/build-module/post-template/edit.js.map +1 -1
  160. package/build-module/post-terms/edit.js +3 -1
  161. package/build-module/post-terms/edit.js.map +1 -1
  162. package/build-module/private-apis.js +14 -0
  163. package/build-module/private-apis.js.map +1 -0
  164. package/build-module/query/edit/enhanced-pagination-modal.js +1 -1
  165. package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -1
  166. package/build-module/query/edit/inspector-controls/author-control.js +6 -2
  167. package/build-module/query/edit/inspector-controls/author-control.js.map +1 -1
  168. package/build-module/query/edit/inspector-controls/create-new-post-link.js +3 -1
  169. package/build-module/query/edit/inspector-controls/create-new-post-link.js.map +1 -1
  170. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +6 -3
  171. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  172. package/build-module/query/edit/inspector-controls/parent-control.js +18 -6
  173. package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
  174. package/build-module/query/edit/inspector-controls/taxonomy-controls.js +9 -3
  175. package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  176. package/build-module/query/utils.js +3 -1
  177. package/build-module/query/utils.js.map +1 -1
  178. package/build-module/query-title/variations.js +3 -1
  179. package/build-module/query-title/variations.js.map +1 -1
  180. package/build-module/social-link/edit.js +1 -1
  181. package/build-module/social-link/edit.js.map +1 -1
  182. package/build-module/social-link/variations.js +3 -1
  183. package/build-module/social-link/variations.js.map +1 -1
  184. package/build-module/template-part/variations.js +6 -2
  185. package/build-module/template-part/variations.js.map +1 -1
  186. package/build-style/editor-rtl.css +15 -49
  187. package/build-style/editor.css +15 -49
  188. package/build-style/embed/editor-rtl.css +0 -3
  189. package/build-style/embed/editor.css +0 -3
  190. package/build-style/group/editor-rtl.css +0 -44
  191. package/build-style/group/editor.css +0 -44
  192. package/build-style/group/style-rtl.css +4 -0
  193. package/build-style/group/style.css +4 -0
  194. package/build-style/navigation-link/style-rtl.css +0 -8
  195. package/build-style/navigation-link/style.css +0 -8
  196. package/build-style/post-featured-image/editor-rtl.css +1 -0
  197. package/build-style/post-featured-image/editor.css +1 -0
  198. package/build-style/site-logo/editor-rtl.css +1 -0
  199. package/build-style/site-logo/editor.css +1 -0
  200. package/build-style/social-link/editor-rtl.css +13 -2
  201. package/build-style/social-link/editor.css +13 -2
  202. package/build-style/style-rtl.css +4 -8
  203. package/build-style/style.css +4 -8
  204. package/package.json +35 -34
  205. package/src/block/edit.js +19 -12
  206. package/src/block-keyboard-shortcuts/index.js +113 -0
  207. package/src/column/edit.js +26 -20
  208. package/src/column/edit.native.js +3 -1
  209. package/src/columns/edit.js +93 -83
  210. package/src/columns/variations.js +12 -34
  211. package/src/comment-template/util.js +3 -1
  212. package/src/cover/shared.js +3 -1
  213. package/src/embed/editor.scss +0 -2
  214. package/src/embed/embed-placeholder.js +21 -9
  215. package/src/embed/util.js +3 -1
  216. package/src/embed/variations.js +3 -1
  217. package/src/embed/wp-embed-preview.js +6 -2
  218. package/src/gallery/test/helpers.native.js +3 -3
  219. package/src/group/editor.scss +0 -47
  220. package/src/group/index.js +0 -8
  221. package/src/group/placeholder.js +18 -18
  222. package/src/group/style.scss +5 -0
  223. package/src/image/image.js +3 -1
  224. package/src/image/view.js +3 -1
  225. package/src/index.js +2 -0
  226. package/src/list-item/hooks/use-merge.js +12 -4
  227. package/src/list-item/hooks/use-outdent-list-item.js +15 -5
  228. package/src/navigation/block.json +0 -9
  229. package/src/navigation/edit/are-blocks-dirty.js +8 -3
  230. package/src/navigation/edit/deleted-navigation-warning.js +1 -1
  231. package/src/navigation/edit/menu-inspector-controls.js +3 -1
  232. package/src/navigation/edit/navigation-menu-selector.js +1 -1
  233. package/src/navigation/edit/test/navigation-menu-selector.js +5 -5
  234. package/src/navigation/view.js +3 -1
  235. package/src/navigation-link/edit.js +91 -91
  236. package/src/navigation-link/link-ui.js +74 -89
  237. package/src/navigation-link/style.scss +0 -12
  238. package/src/paragraph/block.json +0 -1
  239. package/src/post-excerpt/edit.js +3 -1
  240. package/src/post-featured-image/dimension-controls.js +3 -1
  241. package/src/post-featured-image/editor.scss +1 -0
  242. package/src/post-navigation-link/variations.js +3 -1
  243. package/src/post-template/edit.js +9 -4
  244. package/src/post-terms/edit.js +3 -1
  245. package/src/private-apis.js +13 -0
  246. package/src/query/edit/enhanced-pagination-modal.js +5 -1
  247. package/src/query/edit/inspector-controls/author-control.js +6 -2
  248. package/src/query/edit/inspector-controls/create-new-post-link.js +3 -1
  249. package/src/query/edit/inspector-controls/enhanced-pagination-control.js +13 -3
  250. package/src/query/edit/inspector-controls/parent-control.js +18 -6
  251. package/src/query/edit/inspector-controls/taxonomy-controls.js +9 -3
  252. package/src/query/index.php +1 -1
  253. package/src/query/utils.js +3 -1
  254. package/src/query-title/variations.js +3 -1
  255. package/src/site-logo/editor.scss +1 -0
  256. package/src/social-link/edit.js +2 -2
  257. package/src/social-link/editor.scss +25 -11
  258. package/src/social-link/variations.js +3 -1
  259. package/src/template-part/variations.js +6 -2
@@ -1 +1 @@
1
- {"version":3,"names":["isBlobURL","ExternalLink","ResizableBox","Spinner","TextareaControl","TextControl","ToolbarButton","ToolbarGroup","Dropdown","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__experimentalUseCustomUnits","useCustomUnits","useViewportMatch","useSelect","useDispatch","BlockControls","InspectorControls","__experimentalImageURLInputUI","ImageURLInputUI","MediaReplaceFlow","store","blockEditorStore","useSettings","__experimentalImageEditor","ImageEditor","__experimentalUseBorderProps","useBorderProps","__experimentalGetShadowClassesAndStyles","getShadowClassesAndStyles","privateApis","blockEditorPrivateApis","useEffect","useMemo","useState","useRef","__","_x","sprintf","isRTL","DOWN","getFilename","switchToBlockType","blocksStore","crop","overlayText","upload","noticesStore","coreStore","unlock","createUpgradedEmbedBlock","isExternalImage","Caption","TOOLSPANEL_DROPDOWNMENU_PROPS","MIN_SIZE","ALLOWED_MEDIA_TYPES","evalAspectRatio","DimensionsTool","ResolutionTool","scaleOptions","value","label","help","ImageWrapper","href","children","createElement","onClick","event","preventDefault","style","cursor","display","Image","temporaryURL","attributes","setAttributes","isSingleSelected","insertBlocksAfter","onReplace","onSelectImage","onSelectURL","onUploadError","context","clientId","blockEditingMode","url","alt","align","id","rel","linkClass","linkDestination","title","width","height","aspectRatio","scale","linkTarget","sizeSlug","lightbox","metadata","numericWidth","parseInt","undefined","numericHeight","imageRef","allowResize","getBlock","getSettings","image","select","getMedia","canInsertCover","imageEditing","imageSizes","maxWidth","getBlockRootClientId","canInsertBlockType","rootClientId","settings","replaceBlocks","toggleSelection","createErrorNotice","createSuccessNotice","isLargeViewport","isWideAligned","includes","loadedNaturalWidth","loadedNaturalHeight","setLoadedNaturalSize","isEditingImage","setIsEditingImage","externalBlob","setExternalBlob","hasNonContentControls","isContentOnlyMode","isResizable","imageSizeOptions","filter","slug","media_details","sizes","source_url","map","name","mediaUpload","window","fetch","then","response","blob","catch","naturalWidth","naturalHeight","current","complete","onResizeStart","onResizeStop","onImageError","embedBlock","onSetHref","props","onSetLightbox","enable","lightboxSetting","enabled","resetLightbox","allowEditing","onSetTitle","updateAlt","newAlt","updateImage","newSizeSlug","newUrl","uploadExternal","filesList","onFileChange","img","type","allowedTypes","onError","message","canEditImage","allowCrop","switchToCover","dimensionsUnitsOptions","availableUnits","showLightboxSetting","lightboxChecked","dimensionsControl","onChange","newWidth","newHeight","newScale","newAspectRatio","defaultScale","defaultAspectRatio","unitsOptions","resetAll","sizeControls","dropdownMenuProps","lockUrlControls","lockHrefControls","lockAltControls","lockAltControlsMessage","lockTitleControls","lockTitleControlsMessage","lockCaption","getBlockBindingsSource","getBlockParentsByBlockName","urlBinding","altBinding","titleBinding","bindings","hasParentPattern","length","urlBindingSource","source","altBindingSource","titleBindingSource","lockAttributesEditing","controls","Fragment","group","onChangeUrl","mediaUrl","mediaLink","link","lightboxEnabled","icon","mediaId","mediaURL","accept","onSelect","popoverProps","position","renderToggle","isOpen","onToggle","onKeyDown","keyCode","renderContent","className","disabled","__nextHasNoMarginBottom","isShownByDefault","hasValue","onDeselect","readOnly","options","__next40pxDefaultSize","filename","defaultedAlt","borderProps","shadowProps","isRounded","src","onLoad","target","ref","objectFit","onSaveImage","imageAttributes","onFinishEditing","numericRatio","customRatio","naturalRatio","ratio","currentWidth","currentHeight","minWidth","minHeight","maxWidthBuffer","showRightHandle","showLeftHandle","size","showHandle","maxHeight","lockAspectRatio","top","right","bottom","left","direction","elt","offsetWidth","String","resizeRatio","isSelected","showToolbarButton"],"sources":["@wordpress/block-library/src/image/image.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\tExternalLink,\n\tResizableBox,\n\tSpinner,\n\tTextareaControl,\n\tTextControl,\n\tToolbarButton,\n\tToolbarGroup,\n\tDropdown,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalUseCustomUnits as useCustomUnits,\n} from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\t__experimentalImageURLInputUI as ImageURLInputUI,\n\tMediaReplaceFlow,\n\tstore as blockEditorStore,\n\tuseSettings,\n\t__experimentalImageEditor as ImageEditor,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useEffect, useMemo, useState, useRef } from '@wordpress/element';\nimport { __, _x, sprintf, isRTL } from '@wordpress/i18n';\nimport { DOWN } from '@wordpress/keycodes';\nimport { getFilename } from '@wordpress/url';\nimport { switchToBlockType, store as blocksStore } from '@wordpress/blocks';\nimport { crop, overlayText, upload } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nimport { createUpgradedEmbedBlock } from '../embed/util';\nimport { isExternalImage } from './edit';\nimport { Caption } from '../utils/caption';\n\n/**\n * Module constants\n */\nimport { TOOLSPANEL_DROPDOWNMENU_PROPS } from '../utils/constants';\nimport { MIN_SIZE, ALLOWED_MEDIA_TYPES } from './constants';\nimport { evalAspectRatio } from './utils';\n\nconst { DimensionsTool, ResolutionTool } = unlock( blockEditorPrivateApis );\n\nconst scaleOptions = [\n\t{\n\t\tvalue: 'cover',\n\t\tlabel: _x( 'Cover', 'Scale option for dimensions control' ),\n\t\thelp: __( 'Image covers the space evenly.' ),\n\t},\n\t{\n\t\tvalue: 'contain',\n\t\tlabel: _x( 'Contain', 'Scale option for dimensions control' ),\n\t\thelp: __( 'Image is contained without distortion.' ),\n\t},\n];\n\n// If the image has a href, wrap in an <a /> tag to trigger any inherited link element styles.\nconst ImageWrapper = ( { href, children } ) => {\n\tif ( ! href ) {\n\t\treturn children;\n\t}\n\treturn (\n\t\t<a\n\t\t\thref={ href }\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\taria-disabled\n\t\t\tstyle={ {\n\t\t\t\t// When the Image block is linked,\n\t\t\t\t// it's wrapped with a disabled <a /> tag.\n\t\t\t\t// Restore cursor style so it doesn't appear 'clickable'\n\t\t\t\t// Safari needs the display property.\n\t\t\t\tcursor: 'default',\n\t\t\t\tdisplay: 'inline',\n\t\t\t} }\n\t\t>\n\t\t\t{ children }\n\t\t</a>\n\t);\n};\n\nexport default function Image( {\n\ttemporaryURL,\n\tattributes,\n\tsetAttributes,\n\tisSingleSelected,\n\tinsertBlocksAfter,\n\tonReplace,\n\tonSelectImage,\n\tonSelectURL,\n\tonUploadError,\n\tcontext,\n\tclientId,\n\tblockEditingMode,\n} ) {\n\tconst {\n\t\turl = '',\n\t\talt,\n\t\talign,\n\t\tid,\n\t\thref,\n\t\trel,\n\t\tlinkClass,\n\t\tlinkDestination,\n\t\ttitle,\n\t\twidth,\n\t\theight,\n\t\taspectRatio,\n\t\tscale,\n\t\tlinkTarget,\n\t\tsizeSlug,\n\t\tlightbox,\n\t\tmetadata,\n\t} = attributes;\n\n\t// The only supported unit is px, so we can parseInt to strip the px here.\n\tconst numericWidth = width ? parseInt( width, 10 ) : undefined;\n\tconst numericHeight = height ? parseInt( height, 10 ) : undefined;\n\n\tconst imageRef = useRef();\n\tconst { allowResize = true } = context;\n\tconst { getBlock, getSettings } = useSelect( blockEditorStore );\n\n\tconst image = useSelect(\n\t\t( select ) =>\n\t\t\tid && isSingleSelected\n\t\t\t\t? select( coreStore ).getMedia( id, { context: 'view' } )\n\t\t\t\t: null,\n\t\t[ id, isSingleSelected ]\n\t);\n\n\tconst { canInsertCover, imageEditing, imageSizes, maxWidth } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, canInsertBlockType } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst settings = getSettings();\n\n\t\t\treturn {\n\t\t\t\timageEditing: settings.imageEditing,\n\t\t\t\timageSizes: settings.imageSizes,\n\t\t\t\tmaxWidth: settings.maxWidth,\n\t\t\t\tcanInsertCover: canInsertBlockType(\n\t\t\t\t\t'core/cover',\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst { replaceBlocks, toggleSelection } = useDispatch( blockEditorStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideAligned = [ 'wide', 'full' ].includes( align );\n\tconst [\n\t\t{ loadedNaturalWidth, loadedNaturalHeight },\n\t\tsetLoadedNaturalSize,\n\t] = useState( {} );\n\tconst [ isEditingImage, setIsEditingImage ] = useState( false );\n\tconst [ externalBlob, setExternalBlob ] = useState();\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\tconst isContentOnlyMode = blockEditingMode === 'contentOnly';\n\tconst isResizable =\n\t\tallowResize &&\n\t\thasNonContentControls &&\n\t\t! isWideAligned &&\n\t\tisLargeViewport;\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\t// If an image is externally hosted, try to fetch the image data. This may\n\t// fail if the image host doesn't allow CORS with the domain. If it works,\n\t// we can enable a button in the toolbar to upload the image.\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! isExternalImage( id, url ) ||\n\t\t\t! isSingleSelected ||\n\t\t\t! getSettings().mediaUpload\n\t\t) {\n\t\t\tsetExternalBlob();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( externalBlob ) return;\n\n\t\twindow\n\t\t\t// Avoid cache, which seems to help avoid CORS problems.\n\t\t\t.fetch( url.includes( '?' ) ? url : url + '?' )\n\t\t\t.then( ( response ) => response.blob() )\n\t\t\t.then( ( blob ) => setExternalBlob( blob ) )\n\t\t\t// Do nothing, cannot upload.\n\t\t\t.catch( () => {} );\n\t}, [ id, url, isSingleSelected, externalBlob ] );\n\n\t// Get naturalWidth and naturalHeight from image ref, and fall back to loaded natural\n\t// width and height. This resolves an issue in Safari where the loaded natural\n\t// width and height is otherwise lost when switching between alignments.\n\t// See: https://github.com/WordPress/gutenberg/pull/37210.\n\tconst { naturalWidth, naturalHeight } = useMemo( () => {\n\t\treturn {\n\t\t\tnaturalWidth:\n\t\t\t\timageRef.current?.naturalWidth ||\n\t\t\t\tloadedNaturalWidth ||\n\t\t\t\tundefined,\n\t\t\tnaturalHeight:\n\t\t\t\timageRef.current?.naturalHeight ||\n\t\t\t\tloadedNaturalHeight ||\n\t\t\t\tundefined,\n\t\t};\n\t}, [\n\t\tloadedNaturalWidth,\n\t\tloadedNaturalHeight,\n\t\timageRef.current?.complete,\n\t] );\n\n\tfunction onResizeStart() {\n\t\ttoggleSelection( false );\n\t}\n\n\tfunction onResizeStop() {\n\t\ttoggleSelection( true );\n\t}\n\n\tfunction onImageError() {\n\t\t// Check if there's an embed block that handles this URL, e.g., instagram URL.\n\t\t// See: https://github.com/WordPress/gutenberg/pull/11472\n\t\tconst embedBlock = createUpgradedEmbedBlock( { attributes: { url } } );\n\n\t\tif ( undefined !== embedBlock ) {\n\t\t\tonReplace( embedBlock );\n\t\t}\n\t}\n\n\tfunction onSetHref( props ) {\n\t\tsetAttributes( props );\n\t}\n\n\tfunction onSetLightbox( enable ) {\n\t\tif ( enable && ! lightboxSetting?.enabled ) {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: { enabled: true },\n\t\t\t} );\n\t\t} else if ( ! enable && lightboxSetting?.enabled ) {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: { enabled: false },\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: undefined,\n\t\t\t} );\n\t\t}\n\t}\n\n\tfunction resetLightbox() {\n\t\t// When deleting a link from an image while lightbox settings\n\t\t// are enabled by default, we should disable the lightbox,\n\t\t// otherwise the resulting UX looks like a mistake.\n\t\t// See https://github.com/WordPress/gutenberg/pull/59890/files#r1532286123.\n\t\tif ( lightboxSetting?.enabled && lightboxSetting?.allowEditing ) {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: { enabled: false },\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: undefined,\n\t\t\t} );\n\t\t}\n\t}\n\n\tfunction onSetTitle( value ) {\n\t\t// This is the HTML title attribute, separate from the media object\n\t\t// title.\n\t\tsetAttributes( { title: value } );\n\t}\n\n\tfunction updateAlt( newAlt ) {\n\t\tsetAttributes( { alt: newAlt } );\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\tfunction uploadExternal() {\n\t\tconst { mediaUpload } = getSettings();\n\t\tif ( ! mediaUpload ) {\n\t\t\treturn;\n\t\t}\n\t\tmediaUpload( {\n\t\t\tfilesList: [ externalBlob ],\n\t\t\tonFileChange( [ img ] ) {\n\t\t\t\tonSelectImage( img );\n\n\t\t\t\tif ( isBlobURL( img.url ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tsetExternalBlob();\n\t\t\t\tcreateSuccessNotice( __( 'Image uploaded.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\t},\n\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\tonError( message ) {\n\t\t\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t\t\t},\n\t\t} );\n\t}\n\n\tuseEffect( () => {\n\t\tif ( ! isSingleSelected ) {\n\t\t\tsetIsEditingImage( false );\n\t\t}\n\t}, [ isSingleSelected ] );\n\n\tconst canEditImage = id && naturalWidth && naturalHeight && imageEditing;\n\tconst allowCrop = isSingleSelected && canEditImage && ! isEditingImage;\n\n\tfunction switchToCover() {\n\t\treplaceBlocks(\n\t\t\tclientId,\n\t\t\tswitchToBlockType( getBlock( clientId ), 'core/cover' )\n\t\t);\n\t}\n\n\t// TODO: Can allow more units after figuring out how they should interact\n\t// with the ResizableBox and ImageEditor components. Calculations later on\n\t// for those components are currently assuming px units.\n\tconst dimensionsUnitsOptions = useCustomUnits( {\n\t\tavailableUnits: [ 'px' ],\n\t} );\n\n\tconst [ lightboxSetting ] = useSettings( 'lightbox' );\n\n\tconst showLightboxSetting =\n\t\t// If a block-level override is set, we should give users the option to\n\t\t// remove that override, even if the lightbox UI is disabled in the settings.\n\t\t( !! lightbox && lightbox?.enabled !== lightboxSetting?.enabled ) ||\n\t\tlightboxSetting?.allowEditing;\n\n\tconst lightboxChecked =\n\t\t!! lightbox?.enabled || ( ! lightbox && !! lightboxSetting?.enabled );\n\n\tconst dimensionsControl = (\n\t\t<DimensionsTool\n\t\t\tvalue={ { width, height, scale, aspectRatio } }\n\t\t\tonChange={ ( {\n\t\t\t\twidth: newWidth,\n\t\t\t\theight: newHeight,\n\t\t\t\tscale: newScale,\n\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t} ) => {\n\t\t\t\t// Rebuilding the object forces setting `undefined`\n\t\t\t\t// for values that are removed since setAttributes\n\t\t\t\t// doesn't do anything with keys that aren't set.\n\t\t\t\tsetAttributes( {\n\t\t\t\t\t// CSS includes `height: auto`, but we need\n\t\t\t\t\t// `width: auto` to fix the aspect ratio when\n\t\t\t\t\t// only height is set due to the width and\n\t\t\t\t\t// height attributes set via the server.\n\t\t\t\t\twidth: ! newWidth && newHeight ? 'auto' : newWidth,\n\t\t\t\t\theight: newHeight,\n\t\t\t\t\tscale: newScale,\n\t\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tdefaultScale=\"cover\"\n\t\t\tdefaultAspectRatio=\"auto\"\n\t\t\tscaleOptions={ scaleOptions }\n\t\t\tunitsOptions={ dimensionsUnitsOptions }\n\t\t/>\n\t);\n\n\tconst resetAll = () => {\n\t\tsetAttributes( {\n\t\t\talt: undefined,\n\t\t\twidth: undefined,\n\t\t\theight: undefined,\n\t\t\tscale: undefined,\n\t\t\taspectRatio: undefined,\n\t\t\tlightbox: undefined,\n\t\t} );\n\t};\n\n\tconst sizeControls = (\n\t\t<InspectorControls>\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\tresetAll={ resetAll }\n\t\t\t\tdropdownMenuProps={ TOOLSPANEL_DROPDOWNMENU_PROPS }\n\t\t\t>\n\t\t\t\t{ isResizable && dimensionsControl }\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n\n\tconst {\n\t\tlockUrlControls = false,\n\t\tlockHrefControls = false,\n\t\tlockAltControls = false,\n\t\tlockAltControlsMessage,\n\t\tlockTitleControls = false,\n\t\tlockTitleControlsMessage,\n\t\tlockCaption = false,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSingleSelected ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\tconst { getBlockBindingsSource } = unlock( select( blocksStore ) );\n\t\t\tconst { getBlockParentsByBlockName } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\tconst {\n\t\t\t\turl: urlBinding,\n\t\t\t\talt: altBinding,\n\t\t\t\ttitle: titleBinding,\n\t\t\t} = metadata?.bindings || {};\n\t\t\tconst hasParentPattern =\n\t\t\t\tgetBlockParentsByBlockName( clientId, 'core/block' ).length > 0;\n\t\t\tconst urlBindingSource = getBlockBindingsSource(\n\t\t\t\turlBinding?.source\n\t\t\t);\n\t\t\tconst altBindingSource = getBlockBindingsSource(\n\t\t\t\taltBinding?.source\n\t\t\t);\n\t\t\tconst titleBindingSource = getBlockBindingsSource(\n\t\t\t\ttitleBinding?.source\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tlockUrlControls:\n\t\t\t\t\t!! urlBinding &&\n\t\t\t\t\t( ! urlBindingSource ||\n\t\t\t\t\t\turlBindingSource?.lockAttributesEditing ),\n\t\t\t\tlockHrefControls:\n\t\t\t\t\t// Disable editing the link of the URL if the image is inside a pattern instance.\n\t\t\t\t\t// This is a temporary solution until we support overriding the link on the frontend.\n\t\t\t\t\thasParentPattern,\n\t\t\t\tlockCaption:\n\t\t\t\t\t// Disable editing the caption if the image is inside a pattern instance.\n\t\t\t\t\t// This is a temporary solution until we support overriding the caption on the frontend.\n\t\t\t\t\thasParentPattern,\n\t\t\t\tlockAltControls:\n\t\t\t\t\t!! altBinding &&\n\t\t\t\t\t( ! altBindingSource ||\n\t\t\t\t\t\taltBindingSource?.lockAttributesEditing ),\n\t\t\t\tlockAltControlsMessage: altBindingSource?.label\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Label of the bindings source. */\n\t\t\t\t\t\t\t__( 'Connected to %s' ),\n\t\t\t\t\t\t\taltBindingSource.label\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'Connected to dynamic data' ),\n\t\t\t\tlockTitleControls:\n\t\t\t\t\t!! titleBinding &&\n\t\t\t\t\t( ! titleBindingSource ||\n\t\t\t\t\t\ttitleBindingSource?.lockAttributesEditing ),\n\t\t\t\tlockTitleControlsMessage: titleBindingSource?.label\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Label of the bindings source. */\n\t\t\t\t\t\t\t__( 'Connected to %s' ),\n\t\t\t\t\t\t\ttitleBindingSource.label\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'Connected to dynamic data' ),\n\t\t\t};\n\t\t},\n\t\t[ clientId, isSingleSelected, metadata?.bindings ]\n\t);\n\n\tconst controls = (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t{ isSingleSelected &&\n\t\t\t\t\t! isEditingImage &&\n\t\t\t\t\t! lockHrefControls &&\n\t\t\t\t\t! lockUrlControls && (\n\t\t\t\t\t\t<ImageURLInputUI\n\t\t\t\t\t\t\turl={ href || '' }\n\t\t\t\t\t\t\tonChangeUrl={ onSetHref }\n\t\t\t\t\t\t\tlinkDestination={ linkDestination }\n\t\t\t\t\t\t\tmediaUrl={ ( image && image.source_url ) || url }\n\t\t\t\t\t\t\tmediaLink={ image && image.link }\n\t\t\t\t\t\t\tlinkTarget={ linkTarget }\n\t\t\t\t\t\t\tlinkClass={ linkClass }\n\t\t\t\t\t\t\trel={ rel }\n\t\t\t\t\t\t\tshowLightboxSetting={ showLightboxSetting }\n\t\t\t\t\t\t\tlightboxEnabled={ lightboxChecked }\n\t\t\t\t\t\t\tonSetLightbox={ onSetLightbox }\n\t\t\t\t\t\t\tresetLightbox={ resetLightbox }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t{ allowCrop && (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tonClick={ () => setIsEditingImage( true ) }\n\t\t\t\t\t\ticon={ crop }\n\t\t\t\t\t\tlabel={ __( 'Crop' ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ isSingleSelected && canInsertCover && (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ticon={ overlayText }\n\t\t\t\t\t\tlabel={ __( 'Add text over image' ) }\n\t\t\t\t\t\tonClick={ switchToCover }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockControls>\n\t\t\t{ isSingleSelected && ! isEditingImage && ! lockUrlControls && (\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\tmediaId={ id }\n\t\t\t\t\t\tmediaURL={ url }\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\taccept=\"image/*\"\n\t\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ isSingleSelected && externalBlob && (\n\t\t\t\t<BlockControls>\n\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tonClick={ uploadExternal }\n\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\tlabel={ __( 'Upload to Media Library' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ isContentOnlyMode && (\n\t\t\t\t// Add some extra controls for content attributes when content only mode is active.\n\t\t\t\t// With content only mode active, the inspector is hidden, so users need another way\n\t\t\t\t// to edit these attributes.\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<Dropdown\n\t\t\t\t\t\tpopoverProps={ { position: 'bottom right' } }\n\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\tonToggle();\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{ _x(\n\t\t\t\t\t\t\t\t\t'Alt',\n\t\t\t\t\t\t\t\t\t'Alternative text for an image. Block toolbar label, a low character count is preferred.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\t\tclassName=\"wp-block-image__toolbar_content_textarea\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\tvalue={ alt || '' }\n\t\t\t\t\t\t\t\tonChange={ updateAlt }\n\t\t\t\t\t\t\t\tdisabled={ lockAltControls }\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlockAltControls ? (\n\t\t\t\t\t\t\t\t\t\t<>{ lockAltControlsMessage }</>\n\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\t\t<ExternalLink href=\"https://www.w3.org/WAI/tutorials/images/decision-tree\">\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\t__nextHasNoMarginBottom\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\t<Dropdown\n\t\t\t\t\t\tpopoverProps={ { position: 'bottom right' } }\n\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\tonToggle();\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{ __( 'Title' ) }\n\t\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\tclassName=\"wp-block-image__toolbar_content_textarea\"\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\t\t\t\tonChange={ onSetTitle }\n\t\t\t\t\t\t\t\tdisabled={ lockTitleControls }\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlockTitleControls ? (\n\t\t\t\t\t\t\t\t\t\t<>{ lockTitleControlsMessage }</>\n\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\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Describe the role of this image on the page.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink href=\"https://www.w3.org/TR/html52/dom.html#the-title-attribute\">\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'(Note: many devices and browsers do not display this text.)'\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</>\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/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ resetAll }\n\t\t\t\t\tdropdownMenuProps={ TOOLSPANEL_DROPDOWNMENU_PROPS }\n\t\t\t\t>\n\t\t\t\t\t{ isSingleSelected && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => !! alt }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { alt: undefined } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\tvalue={ alt || '' }\n\t\t\t\t\t\t\t\tonChange={ updateAlt }\n\t\t\t\t\t\t\t\treadOnly={ lockAltControls }\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlockAltControls ? (\n\t\t\t\t\t\t\t\t\t\t<>{ lockAltControlsMessage }</>\n\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\t\t<ExternalLink href=\"https://www.w3.org/WAI/tutorials/images/decision-tree\">\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\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isResizable && dimensionsControl }\n\t\t\t\t\t{ !! imageSizeOptions.length && (\n\t\t\t\t\t\t<ResolutionTool\n\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\tonChange={ updateImage }\n\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\tonChange={ onSetTitle }\n\t\t\t\t\treadOnly={ lockTitleControls }\n\t\t\t\t\thelp={\n\t\t\t\t\t\tlockTitleControls ? (\n\t\t\t\t\t\t\t<>{ lockTitleControlsMessage }</>\n\t\t\t\t\t\t) : (\n\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'Describe the role of this image on the page.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<ExternalLink href=\"https://www.w3.org/TR/html52/dom.html#the-title-attribute\">\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'(Note: many devices and browsers do not display this text.)'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\n\tconst filename = getFilename( url );\n\tlet defaultedAlt;\n\n\tif ( alt ) {\n\t\tdefaultedAlt = alt;\n\t} else if ( filename ) {\n\t\tdefaultedAlt = sprintf(\n\t\t\t/* translators: %s: file name */\n\t\t\t__( 'This image has an empty alt attribute; its file name is %s' ),\n\t\t\tfilename\n\t\t);\n\t} else {\n\t\tdefaultedAlt = __( 'This image has an empty alt attribute' );\n\t}\n\n\tconst borderProps = useBorderProps( attributes );\n\tconst shadowProps = getShadowClassesAndStyles( attributes );\n\tconst isRounded = attributes.className?.includes( 'is-style-rounded' );\n\n\tlet img = (\n\t\t// Disable reason: Image itself is not meant to be interactive, but\n\t\t// should direct focus to block.\n\t\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */\n\t\t<>\n\t\t\t<img\n\t\t\t\tsrc={ temporaryURL || url }\n\t\t\t\talt={ defaultedAlt }\n\t\t\t\tonError={ () => onImageError() }\n\t\t\t\tonLoad={ ( event ) => {\n\t\t\t\t\tsetLoadedNaturalSize( {\n\t\t\t\t\t\tloadedNaturalWidth: event.target?.naturalWidth,\n\t\t\t\t\t\tloadedNaturalHeight: event.target?.naturalHeight,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tref={ imageRef }\n\t\t\t\tclassName={ borderProps.className }\n\t\t\t\tstyle={ {\n\t\t\t\t\twidth:\n\t\t\t\t\t\t( width && height ) || aspectRatio ? '100%' : undefined,\n\t\t\t\t\theight:\n\t\t\t\t\t\t( width && height ) || aspectRatio ? '100%' : undefined,\n\t\t\t\t\tobjectFit: scale,\n\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t...shadowProps.style,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t{ temporaryURL && <Spinner /> }\n\t\t</>\n\t\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */\n\t);\n\n\tif ( canEditImage && isEditingImage ) {\n\t\timg = (\n\t\t\t<ImageWrapper href={ href }>\n\t\t\t\t<ImageEditor\n\t\t\t\t\tid={ id }\n\t\t\t\t\turl={ url }\n\t\t\t\t\twidth={ numericWidth }\n\t\t\t\t\theight={ numericHeight }\n\t\t\t\t\tnaturalHeight={ naturalHeight }\n\t\t\t\t\tnaturalWidth={ naturalWidth }\n\t\t\t\t\tonSaveImage={ ( imageAttributes ) =>\n\t\t\t\t\t\tsetAttributes( imageAttributes )\n\t\t\t\t\t}\n\t\t\t\t\tonFinishEditing={ () => {\n\t\t\t\t\t\tsetIsEditingImage( false );\n\t\t\t\t\t} }\n\t\t\t\t\tborderProps={ isRounded ? undefined : borderProps }\n\t\t\t\t/>\n\t\t\t</ImageWrapper>\n\t\t);\n\t} else if ( ! isResizable ) {\n\t\timg = (\n\t\t\t<div style={ { width, height, aspectRatio } }>\n\t\t\t\t<ImageWrapper href={ href }>{ img }</ImageWrapper>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tconst numericRatio = aspectRatio && evalAspectRatio( aspectRatio );\n\t\tconst customRatio = numericWidth / numericHeight;\n\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\tconst ratio = numericRatio || customRatio || naturalRatio || 1;\n\t\tconst currentWidth =\n\t\t\t! numericWidth && numericHeight\n\t\t\t\t? numericHeight * ratio\n\t\t\t\t: numericWidth;\n\t\tconst currentHeight =\n\t\t\t! numericHeight && numericWidth\n\t\t\t\t? numericWidth / ratio\n\t\t\t\t: numericHeight;\n\n\t\tconst minWidth =\n\t\t\tnaturalWidth < naturalHeight ? MIN_SIZE : MIN_SIZE * ratio;\n\t\tconst minHeight =\n\t\t\tnaturalHeight < naturalWidth ? MIN_SIZE : MIN_SIZE / ratio;\n\n\t\t// With the current implementation of ResizableBox, an image needs an\n\t\t// explicit pixel value for the max-width. In absence of being able to\n\t\t// set the content-width, this max-width is currently dictated by the\n\t\t// vanilla editor style. The following variable adds a buffer to this\n\t\t// vanilla style, so 3rd party themes have some wiggleroom. This does,\n\t\t// in most cases, allow you to scale the image beyond the width of the\n\t\t// main column, though not infinitely.\n\t\t// @todo It would be good to revisit this once a content-width variable\n\t\t// becomes available.\n\t\tconst maxWidthBuffer = maxWidth * 2.5;\n\n\t\tlet showRightHandle = false;\n\t\tlet showLeftHandle = false;\n\n\t\t/* eslint-disable no-lonely-if */\n\t\t// See https://github.com/WordPress/gutenberg/issues/7584.\n\t\tif ( align === 'center' ) {\n\t\t\t// When the image is centered, show both handles.\n\t\t\tshowRightHandle = true;\n\t\t\tshowLeftHandle = true;\n\t\t} else if ( isRTL() ) {\n\t\t\t// In RTL mode the image is on the right by default.\n\t\t\t// Show the right handle and hide the left handle only when it is\n\t\t\t// aligned left. Otherwise always show the left handle.\n\t\t\tif ( align === 'left' ) {\n\t\t\t\tshowRightHandle = true;\n\t\t\t} else {\n\t\t\t\tshowLeftHandle = true;\n\t\t\t}\n\t\t} else {\n\t\t\t// Show the left handle and hide the right handle only when the\n\t\t\t// image is aligned right. Otherwise always show the right handle.\n\t\t\tif ( align === 'right' ) {\n\t\t\t\tshowLeftHandle = true;\n\t\t\t} else {\n\t\t\t\tshowRightHandle = true;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-lonely-if */\n\t\timg = (\n\t\t\t<ResizableBox\n\t\t\t\tstyle={ {\n\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\tobjectFit: scale,\n\t\t\t\t\taspectRatio:\n\t\t\t\t\t\t! width && ! height && aspectRatio\n\t\t\t\t\t\t\t? aspectRatio\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t} }\n\t\t\t\tsize={ {\n\t\t\t\t\twidth: currentWidth ?? 'auto',\n\t\t\t\t\theight: currentHeight ?? 'auto',\n\t\t\t\t} }\n\t\t\t\tshowHandle={ isSingleSelected }\n\t\t\t\tminWidth={ minWidth }\n\t\t\t\tmaxWidth={ maxWidthBuffer }\n\t\t\t\tminHeight={ minHeight }\n\t\t\t\tmaxHeight={ maxWidthBuffer / ratio }\n\t\t\t\tlockAspectRatio={ ratio }\n\t\t\t\tenable={ {\n\t\t\t\t\ttop: false,\n\t\t\t\t\tright: showRightHandle,\n\t\t\t\t\tbottom: true,\n\t\t\t\t\tleft: showLeftHandle,\n\t\t\t\t} }\n\t\t\t\tonResizeStart={ onResizeStart }\n\t\t\t\tonResizeStop={ ( event, direction, elt ) => {\n\t\t\t\t\tonResizeStop();\n\t\t\t\t\t// Since the aspect ratio is locked when resizing, we can\n\t\t\t\t\t// use the width of the resized element to calculate the\n\t\t\t\t\t// height in CSS to prevent stretching when the max-width\n\t\t\t\t\t// is reached.\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: `${ elt.offsetWidth }px`,\n\t\t\t\t\t\theight: 'auto',\n\t\t\t\t\t\taspectRatio:\n\t\t\t\t\t\t\tratio === naturalRatio\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: String( ratio ),\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tresizeRatio={ align === 'center' ? 2 : 1 }\n\t\t\t>\n\t\t\t\t<ImageWrapper href={ href }>{ img }</ImageWrapper>\n\t\t\t</ResizableBox>\n\t\t);\n\t}\n\n\tif ( ! url && ! temporaryURL ) {\n\t\t// Add all controls if the image attributes are connected.\n\t\treturn metadata?.bindings ? controls : sizeControls;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ controls }\n\t\t\t{ img }\n\n\t\t\t<Caption\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tisSelected={ isSingleSelected }\n\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\tlabel={ __( 'Image caption text' ) }\n\t\t\t\tshowToolbarButton={ isSingleSelected && hasNonContentControls }\n\t\t\t\treadOnly={ lockCaption }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,YAAY,EACZC,YAAY,EACZC,OAAO,EACPC,eAAe,EACfC,WAAW,EACXC,aAAa,EACbC,YAAY,EACZC,QAAQ,EACRC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,EAC9CC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;AAC9B,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,aAAa,EACbC,iBAAiB,EACjBC,6BAA6B,IAAIC,eAAe,EAChDC,gBAAgB,EAChBC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,EACXC,yBAAyB,IAAIC,WAAW,EACxCC,4BAA4B,IAAIC,cAAc,EAC9CC,uCAAuC,IAAIC,yBAAyB,EACpEC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,oBAAoB;AACzE,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,EAAEC,KAAK,QAAQ,iBAAiB;AACxD,SAASC,IAAI,QAAQ,qBAAqB;AAC1C,S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,OAAO2B,QAAQ,EAAEiH,QAAQ,GAAGQ,QAAQ,GAAGtB,YAAY;EACpD;EAEA,OACCtI,aAAA,CAAA6J,QAAA,QACGD,QAAQ,EACR5C,GAAG,EAELhH,aAAA,CAACd,OAAO;IACPuB,UAAU,EAAGA,UAAY;IACzBC,aAAa,EAAGA,aAAe;IAC/BqN,UAAU,EAAGpN,gBAAkB;IAC/BC,iBAAiB,EAAGA,iBAAmB;IACvCjB,KAAK,EAAGzB,EAAE,CAAE,oBAAqB,CAAG;IACpC8P,iBAAiB,EAAGrN,gBAAgB,IAAI0D,qBAAuB;IAC/DkH,QAAQ,EAAGzC;EAAa,CACxB,CACA,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["isBlobURL","ExternalLink","ResizableBox","Spinner","TextareaControl","TextControl","ToolbarButton","ToolbarGroup","Dropdown","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__experimentalUseCustomUnits","useCustomUnits","useViewportMatch","useSelect","useDispatch","BlockControls","InspectorControls","__experimentalImageURLInputUI","ImageURLInputUI","MediaReplaceFlow","store","blockEditorStore","useSettings","__experimentalImageEditor","ImageEditor","__experimentalUseBorderProps","useBorderProps","__experimentalGetShadowClassesAndStyles","getShadowClassesAndStyles","privateApis","blockEditorPrivateApis","useEffect","useMemo","useState","useRef","__","_x","sprintf","isRTL","DOWN","getFilename","switchToBlockType","blocksStore","crop","overlayText","upload","noticesStore","coreStore","unlock","createUpgradedEmbedBlock","isExternalImage","Caption","TOOLSPANEL_DROPDOWNMENU_PROPS","MIN_SIZE","ALLOWED_MEDIA_TYPES","evalAspectRatio","DimensionsTool","ResolutionTool","scaleOptions","value","label","help","ImageWrapper","href","children","createElement","onClick","event","preventDefault","style","cursor","display","Image","temporaryURL","attributes","setAttributes","isSingleSelected","insertBlocksAfter","onReplace","onSelectImage","onSelectURL","onUploadError","context","clientId","blockEditingMode","url","alt","align","id","rel","linkClass","linkDestination","title","width","height","aspectRatio","scale","linkTarget","sizeSlug","lightbox","metadata","numericWidth","parseInt","undefined","numericHeight","imageRef","allowResize","getBlock","getSettings","image","select","getMedia","canInsertCover","imageEditing","imageSizes","maxWidth","getBlockRootClientId","canInsertBlockType","rootClientId","settings","replaceBlocks","toggleSelection","createErrorNotice","createSuccessNotice","isLargeViewport","isWideAligned","includes","loadedNaturalWidth","loadedNaturalHeight","setLoadedNaturalSize","isEditingImage","setIsEditingImage","externalBlob","setExternalBlob","hasNonContentControls","isContentOnlyMode","isResizable","imageSizeOptions","filter","slug","media_details","sizes","source_url","map","name","mediaUpload","window","fetch","then","response","blob","catch","naturalWidth","naturalHeight","current","complete","onResizeStart","onResizeStop","onImageError","embedBlock","onSetHref","props","onSetLightbox","enable","lightboxSetting","enabled","resetLightbox","allowEditing","onSetTitle","updateAlt","newAlt","updateImage","newSizeSlug","newUrl","uploadExternal","filesList","onFileChange","img","type","allowedTypes","onError","message","canEditImage","allowCrop","switchToCover","dimensionsUnitsOptions","availableUnits","showLightboxSetting","lightboxChecked","dimensionsControl","onChange","newWidth","newHeight","newScale","newAspectRatio","defaultScale","defaultAspectRatio","unitsOptions","resetAll","sizeControls","dropdownMenuProps","lockUrlControls","lockHrefControls","lockAltControls","lockAltControlsMessage","lockTitleControls","lockTitleControlsMessage","lockCaption","getBlockBindingsSource","getBlockParentsByBlockName","urlBinding","altBinding","titleBinding","bindings","hasParentPattern","length","urlBindingSource","source","altBindingSource","titleBindingSource","lockAttributesEditing","controls","Fragment","group","onChangeUrl","mediaUrl","mediaLink","link","lightboxEnabled","icon","mediaId","mediaURL","accept","onSelect","popoverProps","position","renderToggle","isOpen","onToggle","onKeyDown","keyCode","renderContent","className","disabled","__nextHasNoMarginBottom","isShownByDefault","hasValue","onDeselect","readOnly","options","__next40pxDefaultSize","filename","defaultedAlt","borderProps","shadowProps","isRounded","src","onLoad","target","ref","objectFit","onSaveImage","imageAttributes","onFinishEditing","numericRatio","customRatio","naturalRatio","ratio","currentWidth","currentHeight","minWidth","minHeight","maxWidthBuffer","showRightHandle","showLeftHandle","size","showHandle","maxHeight","lockAspectRatio","top","right","bottom","left","direction","elt","offsetWidth","String","resizeRatio","isSelected","showToolbarButton"],"sources":["@wordpress/block-library/src/image/image.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\tExternalLink,\n\tResizableBox,\n\tSpinner,\n\tTextareaControl,\n\tTextControl,\n\tToolbarButton,\n\tToolbarGroup,\n\tDropdown,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalUseCustomUnits as useCustomUnits,\n} from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\t__experimentalImageURLInputUI as ImageURLInputUI,\n\tMediaReplaceFlow,\n\tstore as blockEditorStore,\n\tuseSettings,\n\t__experimentalImageEditor as ImageEditor,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useEffect, useMemo, useState, useRef } from '@wordpress/element';\nimport { __, _x, sprintf, isRTL } from '@wordpress/i18n';\nimport { DOWN } from '@wordpress/keycodes';\nimport { getFilename } from '@wordpress/url';\nimport { switchToBlockType, store as blocksStore } from '@wordpress/blocks';\nimport { crop, overlayText, upload } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nimport { createUpgradedEmbedBlock } from '../embed/util';\nimport { isExternalImage } from './edit';\nimport { Caption } from '../utils/caption';\n\n/**\n * Module constants\n */\nimport { TOOLSPANEL_DROPDOWNMENU_PROPS } from '../utils/constants';\nimport { MIN_SIZE, ALLOWED_MEDIA_TYPES } from './constants';\nimport { evalAspectRatio } from './utils';\n\nconst { DimensionsTool, ResolutionTool } = unlock( blockEditorPrivateApis );\n\nconst scaleOptions = [\n\t{\n\t\tvalue: 'cover',\n\t\tlabel: _x( 'Cover', 'Scale option for dimensions control' ),\n\t\thelp: __( 'Image covers the space evenly.' ),\n\t},\n\t{\n\t\tvalue: 'contain',\n\t\tlabel: _x( 'Contain', 'Scale option for dimensions control' ),\n\t\thelp: __( 'Image is contained without distortion.' ),\n\t},\n];\n\n// If the image has a href, wrap in an <a /> tag to trigger any inherited link element styles.\nconst ImageWrapper = ( { href, children } ) => {\n\tif ( ! href ) {\n\t\treturn children;\n\t}\n\treturn (\n\t\t<a\n\t\t\thref={ href }\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\taria-disabled\n\t\t\tstyle={ {\n\t\t\t\t// When the Image block is linked,\n\t\t\t\t// it's wrapped with a disabled <a /> tag.\n\t\t\t\t// Restore cursor style so it doesn't appear 'clickable'\n\t\t\t\t// Safari needs the display property.\n\t\t\t\tcursor: 'default',\n\t\t\t\tdisplay: 'inline',\n\t\t\t} }\n\t\t>\n\t\t\t{ children }\n\t\t</a>\n\t);\n};\n\nexport default function Image( {\n\ttemporaryURL,\n\tattributes,\n\tsetAttributes,\n\tisSingleSelected,\n\tinsertBlocksAfter,\n\tonReplace,\n\tonSelectImage,\n\tonSelectURL,\n\tonUploadError,\n\tcontext,\n\tclientId,\n\tblockEditingMode,\n} ) {\n\tconst {\n\t\turl = '',\n\t\talt,\n\t\talign,\n\t\tid,\n\t\thref,\n\t\trel,\n\t\tlinkClass,\n\t\tlinkDestination,\n\t\ttitle,\n\t\twidth,\n\t\theight,\n\t\taspectRatio,\n\t\tscale,\n\t\tlinkTarget,\n\t\tsizeSlug,\n\t\tlightbox,\n\t\tmetadata,\n\t} = attributes;\n\n\t// The only supported unit is px, so we can parseInt to strip the px here.\n\tconst numericWidth = width ? parseInt( width, 10 ) : undefined;\n\tconst numericHeight = height ? parseInt( height, 10 ) : undefined;\n\n\tconst imageRef = useRef();\n\tconst { allowResize = true } = context;\n\tconst { getBlock, getSettings } = useSelect( blockEditorStore );\n\n\tconst image = useSelect(\n\t\t( select ) =>\n\t\t\tid && isSingleSelected\n\t\t\t\t? select( coreStore ).getMedia( id, { context: 'view' } )\n\t\t\t\t: null,\n\t\t[ id, isSingleSelected ]\n\t);\n\n\tconst { canInsertCover, imageEditing, imageSizes, maxWidth } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, canInsertBlockType } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst settings = getSettings();\n\n\t\t\treturn {\n\t\t\t\timageEditing: settings.imageEditing,\n\t\t\t\timageSizes: settings.imageSizes,\n\t\t\t\tmaxWidth: settings.maxWidth,\n\t\t\t\tcanInsertCover: canInsertBlockType(\n\t\t\t\t\t'core/cover',\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst { replaceBlocks, toggleSelection } = useDispatch( blockEditorStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideAligned = [ 'wide', 'full' ].includes( align );\n\tconst [\n\t\t{ loadedNaturalWidth, loadedNaturalHeight },\n\t\tsetLoadedNaturalSize,\n\t] = useState( {} );\n\tconst [ isEditingImage, setIsEditingImage ] = useState( false );\n\tconst [ externalBlob, setExternalBlob ] = useState();\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\tconst isContentOnlyMode = blockEditingMode === 'contentOnly';\n\tconst isResizable =\n\t\tallowResize &&\n\t\thasNonContentControls &&\n\t\t! isWideAligned &&\n\t\tisLargeViewport;\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\t// If an image is externally hosted, try to fetch the image data. This may\n\t// fail if the image host doesn't allow CORS with the domain. If it works,\n\t// we can enable a button in the toolbar to upload the image.\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! isExternalImage( id, url ) ||\n\t\t\t! isSingleSelected ||\n\t\t\t! getSettings().mediaUpload\n\t\t) {\n\t\t\tsetExternalBlob();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( externalBlob ) {\n\t\t\treturn;\n\t\t}\n\n\t\twindow\n\t\t\t// Avoid cache, which seems to help avoid CORS problems.\n\t\t\t.fetch( url.includes( '?' ) ? url : url + '?' )\n\t\t\t.then( ( response ) => response.blob() )\n\t\t\t.then( ( blob ) => setExternalBlob( blob ) )\n\t\t\t// Do nothing, cannot upload.\n\t\t\t.catch( () => {} );\n\t}, [ id, url, isSingleSelected, externalBlob ] );\n\n\t// Get naturalWidth and naturalHeight from image ref, and fall back to loaded natural\n\t// width and height. This resolves an issue in Safari where the loaded natural\n\t// width and height is otherwise lost when switching between alignments.\n\t// See: https://github.com/WordPress/gutenberg/pull/37210.\n\tconst { naturalWidth, naturalHeight } = useMemo( () => {\n\t\treturn {\n\t\t\tnaturalWidth:\n\t\t\t\timageRef.current?.naturalWidth ||\n\t\t\t\tloadedNaturalWidth ||\n\t\t\t\tundefined,\n\t\t\tnaturalHeight:\n\t\t\t\timageRef.current?.naturalHeight ||\n\t\t\t\tloadedNaturalHeight ||\n\t\t\t\tundefined,\n\t\t};\n\t}, [\n\t\tloadedNaturalWidth,\n\t\tloadedNaturalHeight,\n\t\timageRef.current?.complete,\n\t] );\n\n\tfunction onResizeStart() {\n\t\ttoggleSelection( false );\n\t}\n\n\tfunction onResizeStop() {\n\t\ttoggleSelection( true );\n\t}\n\n\tfunction onImageError() {\n\t\t// Check if there's an embed block that handles this URL, e.g., instagram URL.\n\t\t// See: https://github.com/WordPress/gutenberg/pull/11472\n\t\tconst embedBlock = createUpgradedEmbedBlock( { attributes: { url } } );\n\n\t\tif ( undefined !== embedBlock ) {\n\t\t\tonReplace( embedBlock );\n\t\t}\n\t}\n\n\tfunction onSetHref( props ) {\n\t\tsetAttributes( props );\n\t}\n\n\tfunction onSetLightbox( enable ) {\n\t\tif ( enable && ! lightboxSetting?.enabled ) {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: { enabled: true },\n\t\t\t} );\n\t\t} else if ( ! enable && lightboxSetting?.enabled ) {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: { enabled: false },\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: undefined,\n\t\t\t} );\n\t\t}\n\t}\n\n\tfunction resetLightbox() {\n\t\t// When deleting a link from an image while lightbox settings\n\t\t// are enabled by default, we should disable the lightbox,\n\t\t// otherwise the resulting UX looks like a mistake.\n\t\t// See https://github.com/WordPress/gutenberg/pull/59890/files#r1532286123.\n\t\tif ( lightboxSetting?.enabled && lightboxSetting?.allowEditing ) {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: { enabled: false },\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: undefined,\n\t\t\t} );\n\t\t}\n\t}\n\n\tfunction onSetTitle( value ) {\n\t\t// This is the HTML title attribute, separate from the media object\n\t\t// title.\n\t\tsetAttributes( { title: value } );\n\t}\n\n\tfunction updateAlt( newAlt ) {\n\t\tsetAttributes( { alt: newAlt } );\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\tfunction uploadExternal() {\n\t\tconst { mediaUpload } = getSettings();\n\t\tif ( ! mediaUpload ) {\n\t\t\treturn;\n\t\t}\n\t\tmediaUpload( {\n\t\t\tfilesList: [ externalBlob ],\n\t\t\tonFileChange( [ img ] ) {\n\t\t\t\tonSelectImage( img );\n\n\t\t\t\tif ( isBlobURL( img.url ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tsetExternalBlob();\n\t\t\t\tcreateSuccessNotice( __( 'Image uploaded.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\t},\n\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\tonError( message ) {\n\t\t\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t\t\t},\n\t\t} );\n\t}\n\n\tuseEffect( () => {\n\t\tif ( ! isSingleSelected ) {\n\t\t\tsetIsEditingImage( false );\n\t\t}\n\t}, [ isSingleSelected ] );\n\n\tconst canEditImage = id && naturalWidth && naturalHeight && imageEditing;\n\tconst allowCrop = isSingleSelected && canEditImage && ! isEditingImage;\n\n\tfunction switchToCover() {\n\t\treplaceBlocks(\n\t\t\tclientId,\n\t\t\tswitchToBlockType( getBlock( clientId ), 'core/cover' )\n\t\t);\n\t}\n\n\t// TODO: Can allow more units after figuring out how they should interact\n\t// with the ResizableBox and ImageEditor components. Calculations later on\n\t// for those components are currently assuming px units.\n\tconst dimensionsUnitsOptions = useCustomUnits( {\n\t\tavailableUnits: [ 'px' ],\n\t} );\n\n\tconst [ lightboxSetting ] = useSettings( 'lightbox' );\n\n\tconst showLightboxSetting =\n\t\t// If a block-level override is set, we should give users the option to\n\t\t// remove that override, even if the lightbox UI is disabled in the settings.\n\t\t( !! lightbox && lightbox?.enabled !== lightboxSetting?.enabled ) ||\n\t\tlightboxSetting?.allowEditing;\n\n\tconst lightboxChecked =\n\t\t!! lightbox?.enabled || ( ! lightbox && !! lightboxSetting?.enabled );\n\n\tconst dimensionsControl = (\n\t\t<DimensionsTool\n\t\t\tvalue={ { width, height, scale, aspectRatio } }\n\t\t\tonChange={ ( {\n\t\t\t\twidth: newWidth,\n\t\t\t\theight: newHeight,\n\t\t\t\tscale: newScale,\n\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t} ) => {\n\t\t\t\t// Rebuilding the object forces setting `undefined`\n\t\t\t\t// for values that are removed since setAttributes\n\t\t\t\t// doesn't do anything with keys that aren't set.\n\t\t\t\tsetAttributes( {\n\t\t\t\t\t// CSS includes `height: auto`, but we need\n\t\t\t\t\t// `width: auto` to fix the aspect ratio when\n\t\t\t\t\t// only height is set due to the width and\n\t\t\t\t\t// height attributes set via the server.\n\t\t\t\t\twidth: ! newWidth && newHeight ? 'auto' : newWidth,\n\t\t\t\t\theight: newHeight,\n\t\t\t\t\tscale: newScale,\n\t\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tdefaultScale=\"cover\"\n\t\t\tdefaultAspectRatio=\"auto\"\n\t\t\tscaleOptions={ scaleOptions }\n\t\t\tunitsOptions={ dimensionsUnitsOptions }\n\t\t/>\n\t);\n\n\tconst resetAll = () => {\n\t\tsetAttributes( {\n\t\t\talt: undefined,\n\t\t\twidth: undefined,\n\t\t\theight: undefined,\n\t\t\tscale: undefined,\n\t\t\taspectRatio: undefined,\n\t\t\tlightbox: undefined,\n\t\t} );\n\t};\n\n\tconst sizeControls = (\n\t\t<InspectorControls>\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\tresetAll={ resetAll }\n\t\t\t\tdropdownMenuProps={ TOOLSPANEL_DROPDOWNMENU_PROPS }\n\t\t\t>\n\t\t\t\t{ isResizable && dimensionsControl }\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n\n\tconst {\n\t\tlockUrlControls = false,\n\t\tlockHrefControls = false,\n\t\tlockAltControls = false,\n\t\tlockAltControlsMessage,\n\t\tlockTitleControls = false,\n\t\tlockTitleControlsMessage,\n\t\tlockCaption = false,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSingleSelected ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\tconst { getBlockBindingsSource } = unlock( select( blocksStore ) );\n\t\t\tconst { getBlockParentsByBlockName } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\tconst {\n\t\t\t\turl: urlBinding,\n\t\t\t\talt: altBinding,\n\t\t\t\ttitle: titleBinding,\n\t\t\t} = metadata?.bindings || {};\n\t\t\tconst hasParentPattern =\n\t\t\t\tgetBlockParentsByBlockName( clientId, 'core/block' ).length > 0;\n\t\t\tconst urlBindingSource = getBlockBindingsSource(\n\t\t\t\turlBinding?.source\n\t\t\t);\n\t\t\tconst altBindingSource = getBlockBindingsSource(\n\t\t\t\taltBinding?.source\n\t\t\t);\n\t\t\tconst titleBindingSource = getBlockBindingsSource(\n\t\t\t\ttitleBinding?.source\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tlockUrlControls:\n\t\t\t\t\t!! urlBinding &&\n\t\t\t\t\t( ! urlBindingSource ||\n\t\t\t\t\t\turlBindingSource?.lockAttributesEditing ),\n\t\t\t\tlockHrefControls:\n\t\t\t\t\t// Disable editing the link of the URL if the image is inside a pattern instance.\n\t\t\t\t\t// This is a temporary solution until we support overriding the link on the frontend.\n\t\t\t\t\thasParentPattern,\n\t\t\t\tlockCaption:\n\t\t\t\t\t// Disable editing the caption if the image is inside a pattern instance.\n\t\t\t\t\t// This is a temporary solution until we support overriding the caption on the frontend.\n\t\t\t\t\thasParentPattern,\n\t\t\t\tlockAltControls:\n\t\t\t\t\t!! altBinding &&\n\t\t\t\t\t( ! altBindingSource ||\n\t\t\t\t\t\taltBindingSource?.lockAttributesEditing ),\n\t\t\t\tlockAltControlsMessage: altBindingSource?.label\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Label of the bindings source. */\n\t\t\t\t\t\t\t__( 'Connected to %s' ),\n\t\t\t\t\t\t\taltBindingSource.label\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'Connected to dynamic data' ),\n\t\t\t\tlockTitleControls:\n\t\t\t\t\t!! titleBinding &&\n\t\t\t\t\t( ! titleBindingSource ||\n\t\t\t\t\t\ttitleBindingSource?.lockAttributesEditing ),\n\t\t\t\tlockTitleControlsMessage: titleBindingSource?.label\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Label of the bindings source. */\n\t\t\t\t\t\t\t__( 'Connected to %s' ),\n\t\t\t\t\t\t\ttitleBindingSource.label\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'Connected to dynamic data' ),\n\t\t\t};\n\t\t},\n\t\t[ clientId, isSingleSelected, metadata?.bindings ]\n\t);\n\n\tconst controls = (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t{ isSingleSelected &&\n\t\t\t\t\t! isEditingImage &&\n\t\t\t\t\t! lockHrefControls &&\n\t\t\t\t\t! lockUrlControls && (\n\t\t\t\t\t\t<ImageURLInputUI\n\t\t\t\t\t\t\turl={ href || '' }\n\t\t\t\t\t\t\tonChangeUrl={ onSetHref }\n\t\t\t\t\t\t\tlinkDestination={ linkDestination }\n\t\t\t\t\t\t\tmediaUrl={ ( image && image.source_url ) || url }\n\t\t\t\t\t\t\tmediaLink={ image && image.link }\n\t\t\t\t\t\t\tlinkTarget={ linkTarget }\n\t\t\t\t\t\t\tlinkClass={ linkClass }\n\t\t\t\t\t\t\trel={ rel }\n\t\t\t\t\t\t\tshowLightboxSetting={ showLightboxSetting }\n\t\t\t\t\t\t\tlightboxEnabled={ lightboxChecked }\n\t\t\t\t\t\t\tonSetLightbox={ onSetLightbox }\n\t\t\t\t\t\t\tresetLightbox={ resetLightbox }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t{ allowCrop && (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tonClick={ () => setIsEditingImage( true ) }\n\t\t\t\t\t\ticon={ crop }\n\t\t\t\t\t\tlabel={ __( 'Crop' ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ isSingleSelected && canInsertCover && (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\ticon={ overlayText }\n\t\t\t\t\t\tlabel={ __( 'Add text over image' ) }\n\t\t\t\t\t\tonClick={ switchToCover }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockControls>\n\t\t\t{ isSingleSelected && ! isEditingImage && ! lockUrlControls && (\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\tmediaId={ id }\n\t\t\t\t\t\tmediaURL={ url }\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\taccept=\"image/*\"\n\t\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ isSingleSelected && externalBlob && (\n\t\t\t\t<BlockControls>\n\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tonClick={ uploadExternal }\n\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\tlabel={ __( 'Upload to Media Library' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ isContentOnlyMode && (\n\t\t\t\t// Add some extra controls for content attributes when content only mode is active.\n\t\t\t\t// With content only mode active, the inspector is hidden, so users need another way\n\t\t\t\t// to edit these attributes.\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<Dropdown\n\t\t\t\t\t\tpopoverProps={ { position: 'bottom right' } }\n\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\tonToggle();\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{ _x(\n\t\t\t\t\t\t\t\t\t'Alt',\n\t\t\t\t\t\t\t\t\t'Alternative text for an image. Block toolbar label, a low character count is preferred.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\t\tclassName=\"wp-block-image__toolbar_content_textarea\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\tvalue={ alt || '' }\n\t\t\t\t\t\t\t\tonChange={ updateAlt }\n\t\t\t\t\t\t\t\tdisabled={ lockAltControls }\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlockAltControls ? (\n\t\t\t\t\t\t\t\t\t\t<>{ lockAltControlsMessage }</>\n\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\t\t<ExternalLink href=\"https://www.w3.org/WAI/tutorials/images/decision-tree\">\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\t__nextHasNoMarginBottom\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\t<Dropdown\n\t\t\t\t\t\tpopoverProps={ { position: 'bottom right' } }\n\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\tonToggle();\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{ __( 'Title' ) }\n\t\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\tclassName=\"wp-block-image__toolbar_content_textarea\"\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\t\t\t\tonChange={ onSetTitle }\n\t\t\t\t\t\t\t\tdisabled={ lockTitleControls }\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlockTitleControls ? (\n\t\t\t\t\t\t\t\t\t\t<>{ lockTitleControlsMessage }</>\n\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\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Describe the role of this image on the page.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink href=\"https://www.w3.org/TR/html52/dom.html#the-title-attribute\">\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'(Note: many devices and browsers do not display this text.)'\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</>\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/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ resetAll }\n\t\t\t\t\tdropdownMenuProps={ TOOLSPANEL_DROPDOWNMENU_PROPS }\n\t\t\t\t>\n\t\t\t\t\t{ isSingleSelected && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => !! alt }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { alt: undefined } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\tvalue={ alt || '' }\n\t\t\t\t\t\t\t\tonChange={ updateAlt }\n\t\t\t\t\t\t\t\treadOnly={ lockAltControls }\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlockAltControls ? (\n\t\t\t\t\t\t\t\t\t\t<>{ lockAltControlsMessage }</>\n\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\t\t<ExternalLink href=\"https://www.w3.org/WAI/tutorials/images/decision-tree\">\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\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isResizable && dimensionsControl }\n\t\t\t\t\t{ !! imageSizeOptions.length && (\n\t\t\t\t\t\t<ResolutionTool\n\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\tonChange={ updateImage }\n\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\tonChange={ onSetTitle }\n\t\t\t\t\treadOnly={ lockTitleControls }\n\t\t\t\t\thelp={\n\t\t\t\t\t\tlockTitleControls ? (\n\t\t\t\t\t\t\t<>{ lockTitleControlsMessage }</>\n\t\t\t\t\t\t) : (\n\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'Describe the role of this image on the page.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<ExternalLink href=\"https://www.w3.org/TR/html52/dom.html#the-title-attribute\">\n\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t'(Note: many devices and browsers do not display this text.)'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\n\tconst filename = getFilename( url );\n\tlet defaultedAlt;\n\n\tif ( alt ) {\n\t\tdefaultedAlt = alt;\n\t} else if ( filename ) {\n\t\tdefaultedAlt = sprintf(\n\t\t\t/* translators: %s: file name */\n\t\t\t__( 'This image has an empty alt attribute; its file name is %s' ),\n\t\t\tfilename\n\t\t);\n\t} else {\n\t\tdefaultedAlt = __( 'This image has an empty alt attribute' );\n\t}\n\n\tconst borderProps = useBorderProps( attributes );\n\tconst shadowProps = getShadowClassesAndStyles( attributes );\n\tconst isRounded = attributes.className?.includes( 'is-style-rounded' );\n\n\tlet img = (\n\t\t// Disable reason: Image itself is not meant to be interactive, but\n\t\t// should direct focus to block.\n\t\t/* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */\n\t\t<>\n\t\t\t<img\n\t\t\t\tsrc={ temporaryURL || url }\n\t\t\t\talt={ defaultedAlt }\n\t\t\t\tonError={ () => onImageError() }\n\t\t\t\tonLoad={ ( event ) => {\n\t\t\t\t\tsetLoadedNaturalSize( {\n\t\t\t\t\t\tloadedNaturalWidth: event.target?.naturalWidth,\n\t\t\t\t\t\tloadedNaturalHeight: event.target?.naturalHeight,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tref={ imageRef }\n\t\t\t\tclassName={ borderProps.className }\n\t\t\t\tstyle={ {\n\t\t\t\t\twidth:\n\t\t\t\t\t\t( width && height ) || aspectRatio ? '100%' : undefined,\n\t\t\t\t\theight:\n\t\t\t\t\t\t( width && height ) || aspectRatio ? '100%' : undefined,\n\t\t\t\t\tobjectFit: scale,\n\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t...shadowProps.style,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t{ temporaryURL && <Spinner /> }\n\t\t</>\n\t\t/* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */\n\t);\n\n\tif ( canEditImage && isEditingImage ) {\n\t\timg = (\n\t\t\t<ImageWrapper href={ href }>\n\t\t\t\t<ImageEditor\n\t\t\t\t\tid={ id }\n\t\t\t\t\turl={ url }\n\t\t\t\t\twidth={ numericWidth }\n\t\t\t\t\theight={ numericHeight }\n\t\t\t\t\tnaturalHeight={ naturalHeight }\n\t\t\t\t\tnaturalWidth={ naturalWidth }\n\t\t\t\t\tonSaveImage={ ( imageAttributes ) =>\n\t\t\t\t\t\tsetAttributes( imageAttributes )\n\t\t\t\t\t}\n\t\t\t\t\tonFinishEditing={ () => {\n\t\t\t\t\t\tsetIsEditingImage( false );\n\t\t\t\t\t} }\n\t\t\t\t\tborderProps={ isRounded ? undefined : borderProps }\n\t\t\t\t/>\n\t\t\t</ImageWrapper>\n\t\t);\n\t} else if ( ! isResizable ) {\n\t\timg = (\n\t\t\t<div style={ { width, height, aspectRatio } }>\n\t\t\t\t<ImageWrapper href={ href }>{ img }</ImageWrapper>\n\t\t\t</div>\n\t\t);\n\t} else {\n\t\tconst numericRatio = aspectRatio && evalAspectRatio( aspectRatio );\n\t\tconst customRatio = numericWidth / numericHeight;\n\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\tconst ratio = numericRatio || customRatio || naturalRatio || 1;\n\t\tconst currentWidth =\n\t\t\t! numericWidth && numericHeight\n\t\t\t\t? numericHeight * ratio\n\t\t\t\t: numericWidth;\n\t\tconst currentHeight =\n\t\t\t! numericHeight && numericWidth\n\t\t\t\t? numericWidth / ratio\n\t\t\t\t: numericHeight;\n\n\t\tconst minWidth =\n\t\t\tnaturalWidth < naturalHeight ? MIN_SIZE : MIN_SIZE * ratio;\n\t\tconst minHeight =\n\t\t\tnaturalHeight < naturalWidth ? MIN_SIZE : MIN_SIZE / ratio;\n\n\t\t// With the current implementation of ResizableBox, an image needs an\n\t\t// explicit pixel value for the max-width. In absence of being able to\n\t\t// set the content-width, this max-width is currently dictated by the\n\t\t// vanilla editor style. The following variable adds a buffer to this\n\t\t// vanilla style, so 3rd party themes have some wiggleroom. This does,\n\t\t// in most cases, allow you to scale the image beyond the width of the\n\t\t// main column, though not infinitely.\n\t\t// @todo It would be good to revisit this once a content-width variable\n\t\t// becomes available.\n\t\tconst maxWidthBuffer = maxWidth * 2.5;\n\n\t\tlet showRightHandle = false;\n\t\tlet showLeftHandle = false;\n\n\t\t/* eslint-disable no-lonely-if */\n\t\t// See https://github.com/WordPress/gutenberg/issues/7584.\n\t\tif ( align === 'center' ) {\n\t\t\t// When the image is centered, show both handles.\n\t\t\tshowRightHandle = true;\n\t\t\tshowLeftHandle = true;\n\t\t} else if ( isRTL() ) {\n\t\t\t// In RTL mode the image is on the right by default.\n\t\t\t// Show the right handle and hide the left handle only when it is\n\t\t\t// aligned left. Otherwise always show the left handle.\n\t\t\tif ( align === 'left' ) {\n\t\t\t\tshowRightHandle = true;\n\t\t\t} else {\n\t\t\t\tshowLeftHandle = true;\n\t\t\t}\n\t\t} else {\n\t\t\t// Show the left handle and hide the right handle only when the\n\t\t\t// image is aligned right. Otherwise always show the right handle.\n\t\t\tif ( align === 'right' ) {\n\t\t\t\tshowLeftHandle = true;\n\t\t\t} else {\n\t\t\t\tshowRightHandle = true;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-lonely-if */\n\t\timg = (\n\t\t\t<ResizableBox\n\t\t\t\tstyle={ {\n\t\t\t\t\tdisplay: 'block',\n\t\t\t\t\tobjectFit: scale,\n\t\t\t\t\taspectRatio:\n\t\t\t\t\t\t! width && ! height && aspectRatio\n\t\t\t\t\t\t\t? aspectRatio\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t} }\n\t\t\t\tsize={ {\n\t\t\t\t\twidth: currentWidth ?? 'auto',\n\t\t\t\t\theight: currentHeight ?? 'auto',\n\t\t\t\t} }\n\t\t\t\tshowHandle={ isSingleSelected }\n\t\t\t\tminWidth={ minWidth }\n\t\t\t\tmaxWidth={ maxWidthBuffer }\n\t\t\t\tminHeight={ minHeight }\n\t\t\t\tmaxHeight={ maxWidthBuffer / ratio }\n\t\t\t\tlockAspectRatio={ ratio }\n\t\t\t\tenable={ {\n\t\t\t\t\ttop: false,\n\t\t\t\t\tright: showRightHandle,\n\t\t\t\t\tbottom: true,\n\t\t\t\t\tleft: showLeftHandle,\n\t\t\t\t} }\n\t\t\t\tonResizeStart={ onResizeStart }\n\t\t\t\tonResizeStop={ ( event, direction, elt ) => {\n\t\t\t\t\tonResizeStop();\n\t\t\t\t\t// Since the aspect ratio is locked when resizing, we can\n\t\t\t\t\t// use the width of the resized element to calculate the\n\t\t\t\t\t// height in CSS to prevent stretching when the max-width\n\t\t\t\t\t// is reached.\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: `${ elt.offsetWidth }px`,\n\t\t\t\t\t\theight: 'auto',\n\t\t\t\t\t\taspectRatio:\n\t\t\t\t\t\t\tratio === naturalRatio\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: String( ratio ),\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tresizeRatio={ align === 'center' ? 2 : 1 }\n\t\t\t>\n\t\t\t\t<ImageWrapper href={ href }>{ img }</ImageWrapper>\n\t\t\t</ResizableBox>\n\t\t);\n\t}\n\n\tif ( ! url && ! temporaryURL ) {\n\t\t// Add all controls if the image attributes are connected.\n\t\treturn metadata?.bindings ? controls : sizeControls;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ controls }\n\t\t\t{ img }\n\n\t\t\t<Caption\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tisSelected={ isSingleSelected }\n\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\tlabel={ __( 'Image caption text' ) }\n\t\t\t\tshowToolbarButton={ isSingleSelected && hasNonContentControls }\n\t\t\t\treadOnly={ lockCaption }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,YAAY,EACZC,YAAY,EACZC,OAAO,EACPC,eAAe,EACfC,WAAW,EACXC,aAAa,EACbC,YAAY,EACZC,QAAQ,EACRC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,EAC9CC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;AAC9B,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,aAAa,EACbC,iBAAiB,EACjBC,6BAA6B,IAAIC,eAAe,EAChDC,gBAAgB,EAChBC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,EACXC,yBAAyB,IAAIC,WAAW,EACxCC,4BAA4B,IAAIC,cAAc,EAC9CC,uCAAuC,IAAIC,yBAAyB,EACpEC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,oBAAoB;AACzE,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,EAAEC,KAAK,QAAQ,iBAAiB;AACxD,SAASC,IAAI,QAAQ,qBAAqB;AAC1C,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,iBAAiB,EAAErB,KAAK,IAAIsB,WAAW,QAAQ,mBAAmB;AAC3E,SAASC,IAAI,EAAEC,WAAW,EAAEC,MAAM,QAAQ,kBAAkB;AAC5D,SAASzB,KAAK,IAAI0B,YAAY,QAA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ACzBC,aAAa,EAAGA,aAAe;IAC/BqN,UAAU,EAAGpN,gBAAkB;IAC/BC,iBAAiB,EAAGA,iBAAmB;IACvCjB,KAAK,EAAGzB,EAAE,CAAE,oBAAqB,CAAG;IACpC8P,iBAAiB,EAAGrN,gBAAgB,IAAI0D,qBAAuB;IAC/DkH,QAAQ,EAAGzC;EAAa,CACxB,CACA,CAAC;AAEL","ignoreList":[]}
@@ -165,7 +165,9 @@ const {
165
165
  },
166
166
  callbacks: {
167
167
  setOverlayStyles() {
168
- if (!imageRef) return;
168
+ if (!imageRef) {
169
+ return;
170
+ }
169
171
  let {
170
172
  naturalWidth,
171
173
  naturalHeight,
@@ -1 +1 @@
1
- {"version":3,"names":["store","getContext","getElement","isTouching","lastTouchTime","imageRef","buttonRef","state","actions","callbacks","currentImage","overlayOpened","currentSrc","roleAttribute","ariaModal","enlargedSrc","uploadedSrc","imgStyles","replace","showLightbox","ctx","complete","scrollTopReset","document","documentElement","scrollTop","scrollLeftReset","scrollLeft","overlayEnabled","setOverlayStyles","hideLightbox","setTimeout","focus","preventScroll","showClosingAnimation","handleKeydown","event","key","preventDefault","ref","querySelector","handleTouchMove","handleTouchStart","handleTouchEnd","Date","now","handleScroll","window","scrollTo","naturalWidth","naturalHeight","offsetWidth","originalWidth","offsetHeight","originalHeight","x","screenPosX","y","screenPosY","getBoundingClientRect","naturalRatio","originalRatio","scaleAttr","heightWithoutSpace","widthWithoutSpace","imgMaxWidth","parseFloat","targetWidth","imgMaxHeight","targetHeight","imgRatio","containerMaxWidth","containerMaxHeight","containerWidth","containerHeight","toFixed","reducedHeight","reducedWidth","horizontalPadding","innerWidth","verticalPadding","targetMaxWidth","Math","min","targetMaxHeight","innerHeight","targetContainerRatio","containerScale","lightboxImgWidth","lightboxImgHeight","overlayStyles","clientWidth","setButtonStyles","figure","parentElement","figureWidth","figureHeight","clientHeight","caption","captionComputedStyle","getComputedStyle","includes","position","marginTop","marginBottom","buttonOffsetTop","buttonOffsetRight","offsetRatio","referenceHeight","imageButtonTop","imageButtonRight","referenceWidth","setOverlayFocus","initTriggerButton","lock"],"sources":["@wordpress/block-library/src/image/view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\n/**\n * Tracks whether user is touching screen; used to differentiate behavior for\n * touch and mouse input.\n *\n * @type {boolean}\n */\nlet isTouching = false;\n\n/**\n * Tracks the last time the screen was touched; used to differentiate behavior\n * for touch and mouse input.\n *\n * @type {number}\n */\nlet lastTouchTime = 0;\n\n/**\n * Stores the image reference of the currently opened lightbox.\n *\n * @type {HTMLElement}\n */\nlet imageRef;\n\n/**\n * Stores the button reference of the currently opened lightbox.\n *\n * @type {HTMLElement}\n */\nlet buttonRef;\n\nconst { state, actions, callbacks } = store(\n\t'core/image',\n\t{\n\t\tstate: {\n\t\t\tcurrentImage: {},\n\t\t\tget overlayOpened() {\n\t\t\t\treturn state.currentImage.currentSrc;\n\t\t\t},\n\t\t\tget roleAttribute() {\n\t\t\t\treturn state.overlayOpened ? 'dialog' : null;\n\t\t\t},\n\t\t\tget ariaModal() {\n\t\t\t\treturn state.overlayOpened ? 'true' : null;\n\t\t\t},\n\t\t\tget enlargedSrc() {\n\t\t\t\treturn (\n\t\t\t\t\tstate.currentImage.uploadedSrc ||\n\t\t\t\t\t'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='\n\t\t\t\t);\n\t\t\t},\n\t\t\tget imgStyles() {\n\t\t\t\treturn (\n\t\t\t\t\tstate.overlayOpened &&\n\t\t\t\t\t`${ state.currentImage.imgStyles?.replace(\n\t\t\t\t\t\t/;$/,\n\t\t\t\t\t\t''\n\t\t\t\t\t) }; object-fit:cover;`\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\tshowLightbox() {\n\t\t\t\tconst ctx = getContext();\n\n\t\t\t\t// Bails out if the image has not loaded yet.\n\t\t\t\tif ( ! ctx.imageRef?.complete ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Stores the positons of the scroll to fix it until the overlay is\n\t\t\t\t// closed.\n\t\t\t\tstate.scrollTopReset = document.documentElement.scrollTop;\n\t\t\t\tstate.scrollLeftReset = document.documentElement.scrollLeft;\n\n\t\t\t\t// Moves the information of the expaned image to the state.\n\t\t\t\tctx.currentSrc = ctx.imageRef.currentSrc;\n\t\t\t\timageRef = ctx.imageRef;\n\t\t\t\tbuttonRef = ctx.buttonRef;\n\t\t\t\tstate.currentImage = ctx;\n\t\t\t\tstate.overlayEnabled = true;\n\n\t\t\t\t// Computes the styles of the overlay for the animation.\n\t\t\t\tcallbacks.setOverlayStyles();\n\t\t\t},\n\t\t\thideLightbox() {\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\t// Waits until the close animation has completed before allowing a\n\t\t\t\t\t// user to scroll again. The duration of this animation is defined in\n\t\t\t\t\t// the `styles.scss` file, but in any case we should wait a few\n\t\t\t\t\t// milliseconds longer than the duration, otherwise a user may scroll\n\t\t\t\t\t// too soon and cause the animation to look sloppy.\n\t\t\t\t\tsetTimeout( function () {\n\t\t\t\t\t\t// Delays before changing the focus. Otherwise the focus ring will\n\t\t\t\t\t\t// appear on Firefox before the image has finished animating, which\n\t\t\t\t\t\t// looks broken.\n\t\t\t\t\t\tbuttonRef.focus( {\n\t\t\t\t\t\t\tpreventScroll: true,\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t// Resets the current image to mark the overlay as closed.\n\t\t\t\t\t\tstate.currentImage = {};\n\t\t\t\t\t\timageRef = null;\n\t\t\t\t\t\tbuttonRef = null;\n\t\t\t\t\t}, 450 );\n\n\t\t\t\t\t// Starts the overlay closing animation. The showClosingAnimation\n\t\t\t\t\t// class is used to avoid showing it on page load.\n\t\t\t\t\tstate.showClosingAnimation = true;\n\t\t\t\t\tstate.overlayEnabled = false;\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleKeydown( event ) {\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\t// Focuses the close button when the user presses the tab key.\n\t\t\t\t\tif ( event.key === 'Tab' ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tconst { ref } = getElement();\n\t\t\t\t\t\tref.querySelector( 'button' ).focus();\n\t\t\t\t\t}\n\t\t\t\t\t// Closes the lightbox when the user presses the escape key.\n\t\t\t\t\tif ( event.key === 'Escape' ) {\n\t\t\t\t\t\tactions.hideLightbox();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleTouchMove( event ) {\n\t\t\t\t// On mobile devices, prevents triggering the scroll event because\n\t\t\t\t// otherwise the page jumps around when it resets the scroll position.\n\t\t\t\t// This also means that closing the lightbox requires that a user\n\t\t\t\t// perform a simple tap. This may be changed in the future if there is a\n\t\t\t\t// better alternative to override or reset the scroll position during\n\t\t\t\t// swipe actions.\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleTouchStart() {\n\t\t\t\tisTouching = true;\n\t\t\t},\n\t\t\thandleTouchEnd() {\n\t\t\t\t// Waits a few milliseconds before resetting to ensure that pinch to\n\t\t\t\t// zoom works consistently on mobile devices when the lightbox is open.\n\t\t\t\tlastTouchTime = Date.now();\n\t\t\t\tisTouching = false;\n\t\t\t},\n\t\t\thandleScroll() {\n\t\t\t\t// Prevents scrolling behaviors that trigger content shift while the\n\t\t\t\t// lightbox is open. It would be better to accomplish through CSS alone,\n\t\t\t\t// but using overflow: hidden is currently the only way to do so and\n\t\t\t\t// that causes a layout to shift and prevents the zoom animation from\n\t\t\t\t// working in some cases because it's not possible to account for the\n\t\t\t\t// layout shift when doing the animation calculations. Instead, it uses\n\t\t\t\t// JavaScript to prevent and reset the scrolling behavior.\n\t\t\t\tif ( state.overlayOpened ) {\n\t\t\t\t\t// Avoids overriding the scroll behavior on mobile devices because\n\t\t\t\t\t// doing so breaks the pinch to zoom functionality, and users should\n\t\t\t\t\t// be able to zoom in further on the high-res image.\n\t\t\t\t\tif ( ! isTouching && Date.now() - lastTouchTime > 450 ) {\n\t\t\t\t\t\t// It doesn't rely on `event.preventDefault()` to prevent scrolling\n\t\t\t\t\t\t// because the scroll event can't be canceled, so it resets the\n\t\t\t\t\t\t// position instead.\n\t\t\t\t\t\twindow.scrollTo(\n\t\t\t\t\t\t\tstate.scrollLeftReset,\n\t\t\t\t\t\t\tstate.scrollTopReset\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\tcallbacks: {\n\t\t\tsetOverlayStyles() {\n\t\t\t\tif ( ! imageRef ) return;\n\n\t\t\t\tlet {\n\t\t\t\t\tnaturalWidth,\n\t\t\t\t\tnaturalHeight,\n\t\t\t\t\toffsetWidth: originalWidth,\n\t\t\t\t\toffsetHeight: originalHeight,\n\t\t\t\t} = imageRef;\n\t\t\t\tlet { x: screenPosX, y: screenPosY } =\n\t\t\t\t\timageRef.getBoundingClientRect();\n\n\t\t\t\t// Natural ratio of the image clicked to open the lightbox.\n\t\t\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\t\t\t// Original ratio of the image clicked to open the lightbox.\n\t\t\t\tlet originalRatio = originalWidth / originalHeight;\n\n\t\t\t\t// If it has object-fit: contain, recalculates the original sizes\n\t\t\t\t// and the screen position without the blank spaces.\n\t\t\t\tif ( state.currentImage.scaleAttr === 'contain' ) {\n\t\t\t\t\tif ( naturalRatio > originalRatio ) {\n\t\t\t\t\t\tconst heightWithoutSpace = originalWidth / naturalRatio;\n\t\t\t\t\t\t// Recalculates screen position without the top space.\n\t\t\t\t\t\tscreenPosY +=\n\t\t\t\t\t\t\t( originalHeight - heightWithoutSpace ) / 2;\n\t\t\t\t\t\toriginalHeight = heightWithoutSpace;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst widthWithoutSpace = originalHeight * naturalRatio;\n\t\t\t\t\t\t// Recalculates screen position without the left space.\n\t\t\t\t\t\tscreenPosX += ( originalWidth - widthWithoutSpace ) / 2;\n\t\t\t\t\t\toriginalWidth = widthWithoutSpace;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toriginalRatio = originalWidth / originalHeight;\n\n\t\t\t\t// Typically, it uses the image's full-sized dimensions. If those\n\t\t\t\t// dimensions have not been set (i.e. an external image with only one\n\t\t\t\t// size), the image's dimensions in the lightbox are the same\n\t\t\t\t// as those of the image in the content.\n\t\t\t\tlet imgMaxWidth = parseFloat(\n\t\t\t\t\tstate.currentImage.targetWidth !== 'none'\n\t\t\t\t\t\t? state.currentImage.targetWidth\n\t\t\t\t\t\t: naturalWidth\n\t\t\t\t);\n\t\t\t\tlet imgMaxHeight = parseFloat(\n\t\t\t\t\tstate.currentImage.targetHeight !== 'none'\n\t\t\t\t\t\t? state.currentImage.targetHeight\n\t\t\t\t\t\t: naturalHeight\n\t\t\t\t);\n\n\t\t\t\t// Ratio of the biggest image stored in the database.\n\t\t\t\tlet imgRatio = imgMaxWidth / imgMaxHeight;\n\t\t\t\tlet containerMaxWidth = imgMaxWidth;\n\t\t\t\tlet containerMaxHeight = imgMaxHeight;\n\t\t\t\tlet containerWidth = imgMaxWidth;\n\t\t\t\tlet containerHeight = imgMaxHeight;\n\t\t\t\t// Checks if the target image has a different ratio than the original\n\t\t\t\t// one (thumbnail). Recalculates the width and height.\n\t\t\t\tif ( naturalRatio.toFixed( 2 ) !== imgRatio.toFixed( 2 ) ) {\n\t\t\t\t\tif ( naturalRatio > imgRatio ) {\n\t\t\t\t\t\t// If the width is reached before the height, it keeps the maxWidth\n\t\t\t\t\t\t// and recalculates the height unless the difference between the\n\t\t\t\t\t\t// maxHeight and the reducedHeight is higher than the maxWidth,\n\t\t\t\t\t\t// where it keeps the reducedHeight and recalculate the width.\n\t\t\t\t\t\tconst reducedHeight = imgMaxWidth / naturalRatio;\n\t\t\t\t\t\tif ( imgMaxHeight - reducedHeight > imgMaxWidth ) {\n\t\t\t\t\t\t\timgMaxHeight = reducedHeight;\n\t\t\t\t\t\t\timgMaxWidth = reducedHeight * naturalRatio;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\timgMaxHeight = imgMaxWidth / naturalRatio;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If the height is reached before the width, it keeps the maxHeight\n\t\t\t\t\t\t// and recalculate the width unlesss the difference between the\n\t\t\t\t\t\t// maxWidth and the reducedWidth is higher than the maxHeight, where\n\t\t\t\t\t\t// it keeps the reducedWidth and recalculate the height.\n\t\t\t\t\t\tconst reducedWidth = imgMaxHeight * naturalRatio;\n\t\t\t\t\t\tif ( imgMaxWidth - reducedWidth > imgMaxHeight ) {\n\t\t\t\t\t\t\timgMaxWidth = reducedWidth;\n\t\t\t\t\t\t\timgMaxHeight = reducedWidth / naturalRatio;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\timgMaxWidth = imgMaxHeight * naturalRatio;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcontainerWidth = imgMaxWidth;\n\t\t\t\t\tcontainerHeight = imgMaxHeight;\n\t\t\t\t\timgRatio = imgMaxWidth / imgMaxHeight;\n\n\t\t\t\t\t// Calculates the max size of the container.\n\t\t\t\t\tif ( originalRatio > imgRatio ) {\n\t\t\t\t\t\tcontainerMaxWidth = imgMaxWidth;\n\t\t\t\t\t\tcontainerMaxHeight = containerMaxWidth / originalRatio;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontainerMaxHeight = imgMaxHeight;\n\t\t\t\t\t\tcontainerMaxWidth = containerMaxHeight * originalRatio;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If the image has been pixelated on purpose, it keeps that size.\n\t\t\t\tif (\n\t\t\t\t\toriginalWidth > containerWidth ||\n\t\t\t\t\toriginalHeight > containerHeight\n\t\t\t\t) {\n\t\t\t\t\tcontainerWidth = originalWidth;\n\t\t\t\t\tcontainerHeight = originalHeight;\n\t\t\t\t}\n\n\t\t\t\t// Calculates the final lightbox image size and the scale factor.\n\t\t\t\t// MaxWidth is either the window container (accounting for padding) or\n\t\t\t\t// the image resolution.\n\t\t\t\tlet horizontalPadding = 0;\n\t\t\t\tif ( window.innerWidth > 480 ) {\n\t\t\t\t\thorizontalPadding = 80;\n\t\t\t\t} else if ( window.innerWidth > 1920 ) {\n\t\t\t\t\thorizontalPadding = 160;\n\t\t\t\t}\n\t\t\t\tconst verticalPadding = 80;\n\n\t\t\t\tconst targetMaxWidth = Math.min(\n\t\t\t\t\twindow.innerWidth - horizontalPadding,\n\t\t\t\t\tcontainerWidth\n\t\t\t\t);\n\t\t\t\tconst targetMaxHeight = Math.min(\n\t\t\t\t\twindow.innerHeight - verticalPadding,\n\t\t\t\t\tcontainerHeight\n\t\t\t\t);\n\t\t\t\tconst targetContainerRatio = targetMaxWidth / targetMaxHeight;\n\n\t\t\t\tif ( originalRatio > targetContainerRatio ) {\n\t\t\t\t\t// If targetMaxWidth is reached before targetMaxHeight.\n\t\t\t\t\tcontainerWidth = targetMaxWidth;\n\t\t\t\t\tcontainerHeight = containerWidth / originalRatio;\n\t\t\t\t} else {\n\t\t\t\t\t// If targetMaxHeight is reached before targetMaxWidth.\n\t\t\t\t\tcontainerHeight = targetMaxHeight;\n\t\t\t\t\tcontainerWidth = containerHeight * originalRatio;\n\t\t\t\t}\n\n\t\t\t\tconst containerScale = originalWidth / containerWidth;\n\t\t\t\tconst lightboxImgWidth =\n\t\t\t\t\timgMaxWidth * ( containerWidth / containerMaxWidth );\n\t\t\t\tconst lightboxImgHeight =\n\t\t\t\t\timgMaxHeight * ( containerHeight / containerMaxHeight );\n\n\t\t\t\t// As of this writing, using the calculations above will render the\n\t\t\t\t// lightbox with a small, erroneous whitespace on the left side of the\n\t\t\t\t// image in iOS Safari, perhaps due to an inconsistency in how browsers\n\t\t\t\t// handle absolute positioning and CSS transformation. In any case,\n\t\t\t\t// adding 1 pixel to the container width and height solves the problem,\n\t\t\t\t// though this can be removed if the issue is fixed in the future.\n\t\t\t\tstate.overlayStyles = `\n\t\t\t\t:root {\n\t\t\t\t\t--wp--lightbox-initial-top-position: ${ screenPosY }px;\n\t\t\t\t\t--wp--lightbox-initial-left-position: ${ screenPosX }px;\n\t\t\t\t\t--wp--lightbox-container-width: ${ containerWidth + 1 }px;\n\t\t\t\t\t--wp--lightbox-container-height: ${ containerHeight + 1 }px;\n\t\t\t\t\t--wp--lightbox-image-width: ${ lightboxImgWidth }px;\n\t\t\t\t\t--wp--lightbox-image-height: ${ lightboxImgHeight }px;\n\t\t\t\t\t--wp--lightbox-scale: ${ containerScale };\n\t\t\t\t\t--wp--lightbox-scrollbar-width: ${\n\t\t\t\t\t\twindow.innerWidth - document.documentElement.clientWidth\n\t\t\t\t\t}px;\n\t\t\t\t}\n\t\t\t`;\n\t\t\t},\n\t\t\tsetButtonStyles() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tctx.imageRef = ref;\n\n\t\t\t\tconst {\n\t\t\t\t\tnaturalWidth,\n\t\t\t\t\tnaturalHeight,\n\t\t\t\t\toffsetWidth,\n\t\t\t\t\toffsetHeight,\n\t\t\t\t} = ref;\n\n\t\t\t\t// If the image isn't loaded yet, it can't calculate where the button\n\t\t\t\t// should be.\n\t\t\t\tif ( naturalWidth === 0 || naturalHeight === 0 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst figure = ref.parentElement;\n\t\t\t\tconst figureWidth = ref.parentElement.clientWidth;\n\n\t\t\t\t// It needs special handling for the height because a caption will cause\n\t\t\t\t// the figure to be taller than the image, which means it needs to\n\t\t\t\t// account for that when calculating the placement of the button in the\n\t\t\t\t// top right corner of the image.\n\t\t\t\tlet figureHeight = ref.parentElement.clientHeight;\n\t\t\t\tconst caption = figure.querySelector( 'figcaption' );\n\t\t\t\tif ( caption ) {\n\t\t\t\t\tconst captionComputedStyle =\n\t\t\t\t\t\twindow.getComputedStyle( caption );\n\t\t\t\t\tif (\n\t\t\t\t\t\t! [ 'absolute', 'fixed' ].includes(\n\t\t\t\t\t\t\tcaptionComputedStyle.position\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tfigureHeight =\n\t\t\t\t\t\t\tfigureHeight -\n\t\t\t\t\t\t\tcaption.offsetHeight -\n\t\t\t\t\t\t\tparseFloat( captionComputedStyle.marginTop ) -\n\t\t\t\t\t\t\tparseFloat( captionComputedStyle.marginBottom );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst buttonOffsetTop = figureHeight - offsetHeight;\n\t\t\t\tconst buttonOffsetRight = figureWidth - offsetWidth;\n\n\t\t\t\t// In the case of an image with object-fit: contain, the size of the\n\t\t\t\t// <img> element can be larger than the image itself, so it needs to\n\t\t\t\t// calculate where to place the button.\n\t\t\t\tif ( ctx.scaleAttr === 'contain' ) {\n\t\t\t\t\t// Natural ratio of the image.\n\t\t\t\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\t\t\t\t// Offset ratio of the image.\n\t\t\t\t\tconst offsetRatio = offsetWidth / offsetHeight;\n\n\t\t\t\t\tif ( naturalRatio >= offsetRatio ) {\n\t\t\t\t\t\t// If it reaches the width first, it keeps the width and compute the\n\t\t\t\t\t\t// height.\n\t\t\t\t\t\tconst referenceHeight = offsetWidth / naturalRatio;\n\t\t\t\t\t\tctx.imageButtonTop =\n\t\t\t\t\t\t\t( offsetHeight - referenceHeight ) / 2 +\n\t\t\t\t\t\t\tbuttonOffsetTop +\n\t\t\t\t\t\t\t16;\n\t\t\t\t\t\tctx.imageButtonRight = buttonOffsetRight + 16;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If it reaches the height first, it keeps the height and compute\n\t\t\t\t\t\t// the width.\n\t\t\t\t\t\tconst referenceWidth = offsetHeight * naturalRatio;\n\t\t\t\t\t\tctx.imageButtonTop = buttonOffsetTop + 16;\n\t\t\t\t\t\tctx.imageButtonRight =\n\t\t\t\t\t\t\t( offsetWidth - referenceWidth ) / 2 +\n\t\t\t\t\t\t\tbuttonOffsetRight +\n\t\t\t\t\t\t\t16;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tctx.imageButtonTop = buttonOffsetTop + 16;\n\t\t\t\t\tctx.imageButtonRight = buttonOffsetRight + 16;\n\t\t\t\t}\n\t\t\t},\n\t\t\tsetOverlayFocus() {\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\t// Moves the focus to the dialog when it opens.\n\t\t\t\t\tconst { ref } = getElement();\n\t\t\t\t\tref.focus();\n\t\t\t\t}\n\t\t\t},\n\t\t\tinitTriggerButton() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tctx.buttonRef = ref;\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,EAAEC,UAAU,EAAEC,UAAU,QAAQ,0BAA0B;;AAExE;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,UAAU,GAAG,KAAK;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA,IAAIC,aAAa,GAAG,CAAC;;AAErB;AACA;AACA;AACA;AACA;AACA,IAAIC,QAAQ;;AAEZ;AACA;AACA;AACA;AACA;AACA,IAAIC,SAAS;AAEb,MAAM;EAAEC,KAAK;EAAEC,OAAO;EAAEC;AAAU,CAAC,GAAGT,KAAK,CAC1C,YAAY,EACZ;EACCO,KAAK,EAAE;IACNG,YAAY,EAAE,CAAC,CAAC;IAChB,IAAIC,aAAaA,CAAA,EAAG;MACnB,OAAOJ,KAAK,CAACG,YAAY,CAACE,UAAU;IACrC,CAAC;IACD,IAAIC,aAAaA,CAAA,EAAG;MACnB,OAAON,KAAK,CAACI,aAAa,GAAG,QAAQ,GAAG,IAAI;IAC7C,CAAC;IACD,IAAIG,SAASA,CAAA,EAAG;MACf,OAAOP,KAAK,CAACI,aAAa,GAAG,MAAM,GAAG,IAAI;IAC3C,CAAC;IACD,IAAII,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AAW,GAAGxD,WAAW,GAAGE,YAAY;QAE9C,IAAKO,YAAY,IAAI+C,WAAW,EAAG;UAClC;UACA;UACA,MAAMC,eAAe,GAAGzD,WAAW,GAAGS,YAAY;UAClDxC,GAAG,CAACyF,cAAc,GACjB,CAAExD,YAAY,GAAGuD,eAAe,IAAK,CAAC,GACtCH,eAAe,GACf,EAAE;UACHrF,GAAG,CAAC0F,gBAAgB,GAAGJ,iBAAiB,GAAG,EAAE;QAC9C,CAAC,MAAM;UACN;UACA;UACA,MAAMK,cAAc,GAAG1D,YAAY,GAAGO,YAAY;UAClDxC,GAAG,CAACyF,cAAc,GAAGJ,eAAe,GAAG,EAAE;UACzCrF,GAAG,CAAC0F,gBAAgB,GACnB,CAAE3D,WAAW,GAAG4D,cAAc,IAAK,CAAC,GACpCL,iBAAiB,GACjB,EAAE;QACJ;MACD,CAAC,MAAM;QACNtF,GAAG,CAACyF,cAAc,GAAGJ,eAAe,GAAG,EAAE;QACzCrF,GAAG,CAAC0F,gBAAgB,GAAGJ,iBAAiB,GAAG,EAAE;MAC9C;IACD,CAAC;IACDM,eAAeA,CAAA,EAAG;MACjB,IAAKzG,KAAK,CAACqB,cAAc,EAAG;QAC3B;QACA,MAAM;UAAEW;QAAI,CAAC,GAAGrC,UAAU,CAAC,CAAC;QAC5BqC,GAAG,CAACP,KAAK,CAAC,CAAC;MACZ;IACD,CAAC;IACDiF,iBAAiBA,CAAA,EAAG;MACnB,MAAM7F,GAAG,GAAGnB,UAAU,CAAC,CAAC;MACxB,MAAM;QAAEsC;MAAI,CAAC,GAAGrC,UAAU,CAAC,CAAC;MAC5BkB,GAAG,CAACd,SAAS,GAAGiC,GAAG;IACpB;EACD;AACD,CAAC,EACD;EAAE2E,IAAI,EAAE;AAAK,CACd,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["store","getContext","getElement","isTouching","lastTouchTime","imageRef","buttonRef","state","actions","callbacks","currentImage","overlayOpened","currentSrc","roleAttribute","ariaModal","enlargedSrc","uploadedSrc","imgStyles","replace","showLightbox","ctx","complete","scrollTopReset","document","documentElement","scrollTop","scrollLeftReset","scrollLeft","overlayEnabled","setOverlayStyles","hideLightbox","setTimeout","focus","preventScroll","showClosingAnimation","handleKeydown","event","key","preventDefault","ref","querySelector","handleTouchMove","handleTouchStart","handleTouchEnd","Date","now","handleScroll","window","scrollTo","naturalWidth","naturalHeight","offsetWidth","originalWidth","offsetHeight","originalHeight","x","screenPosX","y","screenPosY","getBoundingClientRect","naturalRatio","originalRatio","scaleAttr","heightWithoutSpace","widthWithoutSpace","imgMaxWidth","parseFloat","targetWidth","imgMaxHeight","targetHeight","imgRatio","containerMaxWidth","containerMaxHeight","containerWidth","containerHeight","toFixed","reducedHeight","reducedWidth","horizontalPadding","innerWidth","verticalPadding","targetMaxWidth","Math","min","targetMaxHeight","innerHeight","targetContainerRatio","containerScale","lightboxImgWidth","lightboxImgHeight","overlayStyles","clientWidth","setButtonStyles","figure","parentElement","figureWidth","figureHeight","clientHeight","caption","captionComputedStyle","getComputedStyle","includes","position","marginTop","marginBottom","buttonOffsetTop","buttonOffsetRight","offsetRatio","referenceHeight","imageButtonTop","imageButtonRight","referenceWidth","setOverlayFocus","initTriggerButton","lock"],"sources":["@wordpress/block-library/src/image/view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store, getContext, getElement } from '@wordpress/interactivity';\n\n/**\n * Tracks whether user is touching screen; used to differentiate behavior for\n * touch and mouse input.\n *\n * @type {boolean}\n */\nlet isTouching = false;\n\n/**\n * Tracks the last time the screen was touched; used to differentiate behavior\n * for touch and mouse input.\n *\n * @type {number}\n */\nlet lastTouchTime = 0;\n\n/**\n * Stores the image reference of the currently opened lightbox.\n *\n * @type {HTMLElement}\n */\nlet imageRef;\n\n/**\n * Stores the button reference of the currently opened lightbox.\n *\n * @type {HTMLElement}\n */\nlet buttonRef;\n\nconst { state, actions, callbacks } = store(\n\t'core/image',\n\t{\n\t\tstate: {\n\t\t\tcurrentImage: {},\n\t\t\tget overlayOpened() {\n\t\t\t\treturn state.currentImage.currentSrc;\n\t\t\t},\n\t\t\tget roleAttribute() {\n\t\t\t\treturn state.overlayOpened ? 'dialog' : null;\n\t\t\t},\n\t\t\tget ariaModal() {\n\t\t\t\treturn state.overlayOpened ? 'true' : null;\n\t\t\t},\n\t\t\tget enlargedSrc() {\n\t\t\t\treturn (\n\t\t\t\t\tstate.currentImage.uploadedSrc ||\n\t\t\t\t\t'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='\n\t\t\t\t);\n\t\t\t},\n\t\t\tget imgStyles() {\n\t\t\t\treturn (\n\t\t\t\t\tstate.overlayOpened &&\n\t\t\t\t\t`${ state.currentImage.imgStyles?.replace(\n\t\t\t\t\t\t/;$/,\n\t\t\t\t\t\t''\n\t\t\t\t\t) }; object-fit:cover;`\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\tactions: {\n\t\t\tshowLightbox() {\n\t\t\t\tconst ctx = getContext();\n\n\t\t\t\t// Bails out if the image has not loaded yet.\n\t\t\t\tif ( ! ctx.imageRef?.complete ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Stores the positons of the scroll to fix it until the overlay is\n\t\t\t\t// closed.\n\t\t\t\tstate.scrollTopReset = document.documentElement.scrollTop;\n\t\t\t\tstate.scrollLeftReset = document.documentElement.scrollLeft;\n\n\t\t\t\t// Moves the information of the expaned image to the state.\n\t\t\t\tctx.currentSrc = ctx.imageRef.currentSrc;\n\t\t\t\timageRef = ctx.imageRef;\n\t\t\t\tbuttonRef = ctx.buttonRef;\n\t\t\t\tstate.currentImage = ctx;\n\t\t\t\tstate.overlayEnabled = true;\n\n\t\t\t\t// Computes the styles of the overlay for the animation.\n\t\t\t\tcallbacks.setOverlayStyles();\n\t\t\t},\n\t\t\thideLightbox() {\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\t// Waits until the close animation has completed before allowing a\n\t\t\t\t\t// user to scroll again. The duration of this animation is defined in\n\t\t\t\t\t// the `styles.scss` file, but in any case we should wait a few\n\t\t\t\t\t// milliseconds longer than the duration, otherwise a user may scroll\n\t\t\t\t\t// too soon and cause the animation to look sloppy.\n\t\t\t\t\tsetTimeout( function () {\n\t\t\t\t\t\t// Delays before changing the focus. Otherwise the focus ring will\n\t\t\t\t\t\t// appear on Firefox before the image has finished animating, which\n\t\t\t\t\t\t// looks broken.\n\t\t\t\t\t\tbuttonRef.focus( {\n\t\t\t\t\t\t\tpreventScroll: true,\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t// Resets the current image to mark the overlay as closed.\n\t\t\t\t\t\tstate.currentImage = {};\n\t\t\t\t\t\timageRef = null;\n\t\t\t\t\t\tbuttonRef = null;\n\t\t\t\t\t}, 450 );\n\n\t\t\t\t\t// Starts the overlay closing animation. The showClosingAnimation\n\t\t\t\t\t// class is used to avoid showing it on page load.\n\t\t\t\t\tstate.showClosingAnimation = true;\n\t\t\t\t\tstate.overlayEnabled = false;\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleKeydown( event ) {\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\t// Focuses the close button when the user presses the tab key.\n\t\t\t\t\tif ( event.key === 'Tab' ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tconst { ref } = getElement();\n\t\t\t\t\t\tref.querySelector( 'button' ).focus();\n\t\t\t\t\t}\n\t\t\t\t\t// Closes the lightbox when the user presses the escape key.\n\t\t\t\t\tif ( event.key === 'Escape' ) {\n\t\t\t\t\t\tactions.hideLightbox();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleTouchMove( event ) {\n\t\t\t\t// On mobile devices, prevents triggering the scroll event because\n\t\t\t\t// otherwise the page jumps around when it resets the scroll position.\n\t\t\t\t// This also means that closing the lightbox requires that a user\n\t\t\t\t// perform a simple tap. This may be changed in the future if there is a\n\t\t\t\t// better alternative to override or reset the scroll position during\n\t\t\t\t// swipe actions.\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t},\n\t\t\thandleTouchStart() {\n\t\t\t\tisTouching = true;\n\t\t\t},\n\t\t\thandleTouchEnd() {\n\t\t\t\t// Waits a few milliseconds before resetting to ensure that pinch to\n\t\t\t\t// zoom works consistently on mobile devices when the lightbox is open.\n\t\t\t\tlastTouchTime = Date.now();\n\t\t\t\tisTouching = false;\n\t\t\t},\n\t\t\thandleScroll() {\n\t\t\t\t// Prevents scrolling behaviors that trigger content shift while the\n\t\t\t\t// lightbox is open. It would be better to accomplish through CSS alone,\n\t\t\t\t// but using overflow: hidden is currently the only way to do so and\n\t\t\t\t// that causes a layout to shift and prevents the zoom animation from\n\t\t\t\t// working in some cases because it's not possible to account for the\n\t\t\t\t// layout shift when doing the animation calculations. Instead, it uses\n\t\t\t\t// JavaScript to prevent and reset the scrolling behavior.\n\t\t\t\tif ( state.overlayOpened ) {\n\t\t\t\t\t// Avoids overriding the scroll behavior on mobile devices because\n\t\t\t\t\t// doing so breaks the pinch to zoom functionality, and users should\n\t\t\t\t\t// be able to zoom in further on the high-res image.\n\t\t\t\t\tif ( ! isTouching && Date.now() - lastTouchTime > 450 ) {\n\t\t\t\t\t\t// It doesn't rely on `event.preventDefault()` to prevent scrolling\n\t\t\t\t\t\t// because the scroll event can't be canceled, so it resets the\n\t\t\t\t\t\t// position instead.\n\t\t\t\t\t\twindow.scrollTo(\n\t\t\t\t\t\t\tstate.scrollLeftReset,\n\t\t\t\t\t\t\tstate.scrollTopReset\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\tcallbacks: {\n\t\t\tsetOverlayStyles() {\n\t\t\t\tif ( ! imageRef ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlet {\n\t\t\t\t\tnaturalWidth,\n\t\t\t\t\tnaturalHeight,\n\t\t\t\t\toffsetWidth: originalWidth,\n\t\t\t\t\toffsetHeight: originalHeight,\n\t\t\t\t} = imageRef;\n\t\t\t\tlet { x: screenPosX, y: screenPosY } =\n\t\t\t\t\timageRef.getBoundingClientRect();\n\n\t\t\t\t// Natural ratio of the image clicked to open the lightbox.\n\t\t\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\t\t\t// Original ratio of the image clicked to open the lightbox.\n\t\t\t\tlet originalRatio = originalWidth / originalHeight;\n\n\t\t\t\t// If it has object-fit: contain, recalculates the original sizes\n\t\t\t\t// and the screen position without the blank spaces.\n\t\t\t\tif ( state.currentImage.scaleAttr === 'contain' ) {\n\t\t\t\t\tif ( naturalRatio > originalRatio ) {\n\t\t\t\t\t\tconst heightWithoutSpace = originalWidth / naturalRatio;\n\t\t\t\t\t\t// Recalculates screen position without the top space.\n\t\t\t\t\t\tscreenPosY +=\n\t\t\t\t\t\t\t( originalHeight - heightWithoutSpace ) / 2;\n\t\t\t\t\t\toriginalHeight = heightWithoutSpace;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst widthWithoutSpace = originalHeight * naturalRatio;\n\t\t\t\t\t\t// Recalculates screen position without the left space.\n\t\t\t\t\t\tscreenPosX += ( originalWidth - widthWithoutSpace ) / 2;\n\t\t\t\t\t\toriginalWidth = widthWithoutSpace;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toriginalRatio = originalWidth / originalHeight;\n\n\t\t\t\t// Typically, it uses the image's full-sized dimensions. If those\n\t\t\t\t// dimensions have not been set (i.e. an external image with only one\n\t\t\t\t// size), the image's dimensions in the lightbox are the same\n\t\t\t\t// as those of the image in the content.\n\t\t\t\tlet imgMaxWidth = parseFloat(\n\t\t\t\t\tstate.currentImage.targetWidth !== 'none'\n\t\t\t\t\t\t? state.currentImage.targetWidth\n\t\t\t\t\t\t: naturalWidth\n\t\t\t\t);\n\t\t\t\tlet imgMaxHeight = parseFloat(\n\t\t\t\t\tstate.currentImage.targetHeight !== 'none'\n\t\t\t\t\t\t? state.currentImage.targetHeight\n\t\t\t\t\t\t: naturalHeight\n\t\t\t\t);\n\n\t\t\t\t// Ratio of the biggest image stored in the database.\n\t\t\t\tlet imgRatio = imgMaxWidth / imgMaxHeight;\n\t\t\t\tlet containerMaxWidth = imgMaxWidth;\n\t\t\t\tlet containerMaxHeight = imgMaxHeight;\n\t\t\t\tlet containerWidth = imgMaxWidth;\n\t\t\t\tlet containerHeight = imgMaxHeight;\n\t\t\t\t// Checks if the target image has a different ratio than the original\n\t\t\t\t// one (thumbnail). Recalculates the width and height.\n\t\t\t\tif ( naturalRatio.toFixed( 2 ) !== imgRatio.toFixed( 2 ) ) {\n\t\t\t\t\tif ( naturalRatio > imgRatio ) {\n\t\t\t\t\t\t// If the width is reached before the height, it keeps the maxWidth\n\t\t\t\t\t\t// and recalculates the height unless the difference between the\n\t\t\t\t\t\t// maxHeight and the reducedHeight is higher than the maxWidth,\n\t\t\t\t\t\t// where it keeps the reducedHeight and recalculate the width.\n\t\t\t\t\t\tconst reducedHeight = imgMaxWidth / naturalRatio;\n\t\t\t\t\t\tif ( imgMaxHeight - reducedHeight > imgMaxWidth ) {\n\t\t\t\t\t\t\timgMaxHeight = reducedHeight;\n\t\t\t\t\t\t\timgMaxWidth = reducedHeight * naturalRatio;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\timgMaxHeight = imgMaxWidth / naturalRatio;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If the height is reached before the width, it keeps the maxHeight\n\t\t\t\t\t\t// and recalculate the width unlesss the difference between the\n\t\t\t\t\t\t// maxWidth and the reducedWidth is higher than the maxHeight, where\n\t\t\t\t\t\t// it keeps the reducedWidth and recalculate the height.\n\t\t\t\t\t\tconst reducedWidth = imgMaxHeight * naturalRatio;\n\t\t\t\t\t\tif ( imgMaxWidth - reducedWidth > imgMaxHeight ) {\n\t\t\t\t\t\t\timgMaxWidth = reducedWidth;\n\t\t\t\t\t\t\timgMaxHeight = reducedWidth / naturalRatio;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\timgMaxWidth = imgMaxHeight * naturalRatio;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcontainerWidth = imgMaxWidth;\n\t\t\t\t\tcontainerHeight = imgMaxHeight;\n\t\t\t\t\timgRatio = imgMaxWidth / imgMaxHeight;\n\n\t\t\t\t\t// Calculates the max size of the container.\n\t\t\t\t\tif ( originalRatio > imgRatio ) {\n\t\t\t\t\t\tcontainerMaxWidth = imgMaxWidth;\n\t\t\t\t\t\tcontainerMaxHeight = containerMaxWidth / originalRatio;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontainerMaxHeight = imgMaxHeight;\n\t\t\t\t\t\tcontainerMaxWidth = containerMaxHeight * originalRatio;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If the image has been pixelated on purpose, it keeps that size.\n\t\t\t\tif (\n\t\t\t\t\toriginalWidth > containerWidth ||\n\t\t\t\t\toriginalHeight > containerHeight\n\t\t\t\t) {\n\t\t\t\t\tcontainerWidth = originalWidth;\n\t\t\t\t\tcontainerHeight = originalHeight;\n\t\t\t\t}\n\n\t\t\t\t// Calculates the final lightbox image size and the scale factor.\n\t\t\t\t// MaxWidth is either the window container (accounting for padding) or\n\t\t\t\t// the image resolution.\n\t\t\t\tlet horizontalPadding = 0;\n\t\t\t\tif ( window.innerWidth > 480 ) {\n\t\t\t\t\thorizontalPadding = 80;\n\t\t\t\t} else if ( window.innerWidth > 1920 ) {\n\t\t\t\t\thorizontalPadding = 160;\n\t\t\t\t}\n\t\t\t\tconst verticalPadding = 80;\n\n\t\t\t\tconst targetMaxWidth = Math.min(\n\t\t\t\t\twindow.innerWidth - horizontalPadding,\n\t\t\t\t\tcontainerWidth\n\t\t\t\t);\n\t\t\t\tconst targetMaxHeight = Math.min(\n\t\t\t\t\twindow.innerHeight - verticalPadding,\n\t\t\t\t\tcontainerHeight\n\t\t\t\t);\n\t\t\t\tconst targetContainerRatio = targetMaxWidth / targetMaxHeight;\n\n\t\t\t\tif ( originalRatio > targetContainerRatio ) {\n\t\t\t\t\t// If targetMaxWidth is reached before targetMaxHeight.\n\t\t\t\t\tcontainerWidth = targetMaxWidth;\n\t\t\t\t\tcontainerHeight = containerWidth / originalRatio;\n\t\t\t\t} else {\n\t\t\t\t\t// If targetMaxHeight is reached before targetMaxWidth.\n\t\t\t\t\tcontainerHeight = targetMaxHeight;\n\t\t\t\t\tcontainerWidth = containerHeight * originalRatio;\n\t\t\t\t}\n\n\t\t\t\tconst containerScale = originalWidth / containerWidth;\n\t\t\t\tconst lightboxImgWidth =\n\t\t\t\t\timgMaxWidth * ( containerWidth / containerMaxWidth );\n\t\t\t\tconst lightboxImgHeight =\n\t\t\t\t\timgMaxHeight * ( containerHeight / containerMaxHeight );\n\n\t\t\t\t// As of this writing, using the calculations above will render the\n\t\t\t\t// lightbox with a small, erroneous whitespace on the left side of the\n\t\t\t\t// image in iOS Safari, perhaps due to an inconsistency in how browsers\n\t\t\t\t// handle absolute positioning and CSS transformation. In any case,\n\t\t\t\t// adding 1 pixel to the container width and height solves the problem,\n\t\t\t\t// though this can be removed if the issue is fixed in the future.\n\t\t\t\tstate.overlayStyles = `\n\t\t\t\t:root {\n\t\t\t\t\t--wp--lightbox-initial-top-position: ${ screenPosY }px;\n\t\t\t\t\t--wp--lightbox-initial-left-position: ${ screenPosX }px;\n\t\t\t\t\t--wp--lightbox-container-width: ${ containerWidth + 1 }px;\n\t\t\t\t\t--wp--lightbox-container-height: ${ containerHeight + 1 }px;\n\t\t\t\t\t--wp--lightbox-image-width: ${ lightboxImgWidth }px;\n\t\t\t\t\t--wp--lightbox-image-height: ${ lightboxImgHeight }px;\n\t\t\t\t\t--wp--lightbox-scale: ${ containerScale };\n\t\t\t\t\t--wp--lightbox-scrollbar-width: ${\n\t\t\t\t\t\twindow.innerWidth - document.documentElement.clientWidth\n\t\t\t\t\t}px;\n\t\t\t\t}\n\t\t\t`;\n\t\t\t},\n\t\t\tsetButtonStyles() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tctx.imageRef = ref;\n\n\t\t\t\tconst {\n\t\t\t\t\tnaturalWidth,\n\t\t\t\t\tnaturalHeight,\n\t\t\t\t\toffsetWidth,\n\t\t\t\t\toffsetHeight,\n\t\t\t\t} = ref;\n\n\t\t\t\t// If the image isn't loaded yet, it can't calculate where the button\n\t\t\t\t// should be.\n\t\t\t\tif ( naturalWidth === 0 || naturalHeight === 0 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst figure = ref.parentElement;\n\t\t\t\tconst figureWidth = ref.parentElement.clientWidth;\n\n\t\t\t\t// It needs special handling for the height because a caption will cause\n\t\t\t\t// the figure to be taller than the image, which means it needs to\n\t\t\t\t// account for that when calculating the placement of the button in the\n\t\t\t\t// top right corner of the image.\n\t\t\t\tlet figureHeight = ref.parentElement.clientHeight;\n\t\t\t\tconst caption = figure.querySelector( 'figcaption' );\n\t\t\t\tif ( caption ) {\n\t\t\t\t\tconst captionComputedStyle =\n\t\t\t\t\t\twindow.getComputedStyle( caption );\n\t\t\t\t\tif (\n\t\t\t\t\t\t! [ 'absolute', 'fixed' ].includes(\n\t\t\t\t\t\t\tcaptionComputedStyle.position\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tfigureHeight =\n\t\t\t\t\t\t\tfigureHeight -\n\t\t\t\t\t\t\tcaption.offsetHeight -\n\t\t\t\t\t\t\tparseFloat( captionComputedStyle.marginTop ) -\n\t\t\t\t\t\t\tparseFloat( captionComputedStyle.marginBottom );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst buttonOffsetTop = figureHeight - offsetHeight;\n\t\t\t\tconst buttonOffsetRight = figureWidth - offsetWidth;\n\n\t\t\t\t// In the case of an image with object-fit: contain, the size of the\n\t\t\t\t// <img> element can be larger than the image itself, so it needs to\n\t\t\t\t// calculate where to place the button.\n\t\t\t\tif ( ctx.scaleAttr === 'contain' ) {\n\t\t\t\t\t// Natural ratio of the image.\n\t\t\t\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\t\t\t\t// Offset ratio of the image.\n\t\t\t\t\tconst offsetRatio = offsetWidth / offsetHeight;\n\n\t\t\t\t\tif ( naturalRatio >= offsetRatio ) {\n\t\t\t\t\t\t// If it reaches the width first, it keeps the width and compute the\n\t\t\t\t\t\t// height.\n\t\t\t\t\t\tconst referenceHeight = offsetWidth / naturalRatio;\n\t\t\t\t\t\tctx.imageButtonTop =\n\t\t\t\t\t\t\t( offsetHeight - referenceHeight ) / 2 +\n\t\t\t\t\t\t\tbuttonOffsetTop +\n\t\t\t\t\t\t\t16;\n\t\t\t\t\t\tctx.imageButtonRight = buttonOffsetRight + 16;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If it reaches the height first, it keeps the height and compute\n\t\t\t\t\t\t// the width.\n\t\t\t\t\t\tconst referenceWidth = offsetHeight * naturalRatio;\n\t\t\t\t\t\tctx.imageButtonTop = buttonOffsetTop + 16;\n\t\t\t\t\t\tctx.imageButtonRight =\n\t\t\t\t\t\t\t( offsetWidth - referenceWidth ) / 2 +\n\t\t\t\t\t\t\tbuttonOffsetRight +\n\t\t\t\t\t\t\t16;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tctx.imageButtonTop = buttonOffsetTop + 16;\n\t\t\t\t\tctx.imageButtonRight = buttonOffsetRight + 16;\n\t\t\t\t}\n\t\t\t},\n\t\t\tsetOverlayFocus() {\n\t\t\t\tif ( state.overlayEnabled ) {\n\t\t\t\t\t// Moves the focus to the dialog when it opens.\n\t\t\t\t\tconst { ref } = getElement();\n\t\t\t\t\tref.focus();\n\t\t\t\t}\n\t\t\t},\n\t\t\tinitTriggerButton() {\n\t\t\t\tconst ctx = getContext();\n\t\t\t\tconst { ref } = getElement();\n\t\t\t\tctx.buttonRef = ref;\n\t\t\t},\n\t\t},\n\t},\n\t{ lock: true }\n);\n"],"mappings":"AAAA;A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AAiB,GACjB,EAAE;QACJ;MACD,CAAC,MAAM;QACNtF,GAAG,CAACyF,cAAc,GAAGJ,eAAe,GAAG,EAAE;QACzCrF,GAAG,CAAC0F,gBAAgB,GAAGJ,iBAAiB,GAAG,EAAE;MAC9C;IACD,CAAC;IACDM,eAAeA,CAAA,EAAG;MACjB,IAAKzG,KAAK,CAACqB,cAAc,EAAG;QAC3B;QACA,MAAM;UAAEW;QAAI,CAAC,GAAGrC,UAAU,CAAC,CAAC;QAC5BqC,GAAG,CAACP,KAAK,CAAC,CAAC;MACZ;IACD,CAAC;IACDiF,iBAAiBA,CAAA,EAAG;MACnB,MAAM7F,GAAG,GAAGnB,UAAU,CAAC,CAAC;MACxB,MAAM;QAAEsC;MAAI,CAAC,GAAGrC,UAAU,CAAC,CAAC;MAC5BkB,GAAG,CAACd,SAAS,GAAGiC,GAAG;IACpB;EACD;AACD,CAAC,EACD;EAAE2E,IAAI,EAAE;AAAK,CACd,CAAC","ignoreList":[]}
@@ -214,4 +214,5 @@ export const __experimentalRegisterExperimentalCoreBlocks = process.env.IS_GUTEN
214
214
  init
215
215
  }) => init());
216
216
  } : undefined;
217
+ export { privateApis } from './private-apis';
217
218
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["setDefaultBlockName","setFreeformContentHandlerName","setUnregisteredTypeHandlerName","setGroupingBlockName","archives","avatar","audio","button","buttons","calendar","categories","classic","code","column","columns","comments","commentAuthorAvatar","commentAuthorName","commentContent","commentDate","commentEditLink","commentReplyLink","commentTemplate","commentsPaginationPrevious","commentsPagination","commentsPaginationNext","commentsPaginationNumbers","commentsTitle","cover","details","embed","file","form","formInput","formSubmitButton","formSubmissionNotification","gallery","group","heading","homeLink","html","image","latestComments","latestPosts","list","listItem","logInOut","mediaText","missing","more","navigation","navigationLink","navigationSubmenu","nextpage","pattern","pageList","pageListItem","paragraph","postAuthor","postAuthorName","postAuthorBiography","postComment","postCommentsCount","postCommentsForm","postCommentsLink","postContent","postDate","postExcerpt","postFeaturedImage","postNavigationLink","postTemplate","postTerms","postTimeToRead","postTitle","preformatted","pullquote","query","queryNoResults","queryPagination","queryPaginationNext","queryPaginationNumbers","queryPaginationPrevious","queryTitle","quote","reusableBlock","readMore","rss","search","separator","shortcode","siteLogo","siteTagline","siteTitle","socialLink","socialLinks","spacer","table","tableOfContents","tagCloud","templatePart","termDescription","textColumns","verse","video","footnotes","isBlockMetadataExperimental","getAllBlocks","blocks","window","__experimentalEnableFormBlocks","push","wp","oldEditor","needsClassicBlock","__experimentalDisableTinymce","URLSearchParams","location","get","filter","Boolean","__experimentalGetCoreBlocks","metadata","registerCoreBlocks","forEach","init","name","some","__experimentalRegisterExperimentalCoreBlocks","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","enabledExperiments","__experimental","includes","undefined"],"sources":["@wordpress/block-library/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tsetDefaultBlockName,\n\tsetFreeformContentHandlerName,\n\tsetUnregisteredTypeHandlerName,\n\tsetGroupingBlockName,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\n// When IS_GUTENBERG_PLUGIN is set to false, imports of experimental blocks\n// are transformed by packages/block-library/src/index.js as follows:\n// import * as experimentalBlock from './experimental-block'\n// becomes\n// const experimentalBlock = null;\n// This enables webpack to eliminate the experimental blocks code from the\n// production build to make the final bundle smaller.\n//\n// See https://github.com/WordPress/gutenberg/pull/40655 for more context.\nimport * as archives from './archives';\nimport * as avatar from './avatar';\nimport * as audio from './audio';\nimport * as button from './button';\nimport * as buttons from './buttons';\nimport * as calendar from './calendar';\nimport * as categories from './categories';\nimport * as classic from './freeform';\nimport * as code from './code';\nimport * as column from './column';\nimport * as columns from './columns';\nimport * as comments from './comments';\nimport * as commentAuthorAvatar from './comment-author-avatar';\nimport * as commentAuthorName from './comment-author-name';\nimport * as commentContent from './comment-content';\nimport * as commentDate from './comment-date';\nimport * as commentEditLink from './comment-edit-link';\nimport * as commentReplyLink from './comment-reply-link';\nimport * as commentTemplate from './comment-template';\nimport * as commentsPaginationPrevious from './comments-pagination-previous';\nimport * as commentsPagination from './comments-pagination';\nimport * as commentsPaginationNext from './comments-pagination-next';\nimport * as commentsPaginationNumbers from './comments-pagination-numbers';\nimport * as commentsTitle from './comments-title';\nimport * as cover from './cover';\nimport * as details from './details';\nimport * as embed from './embed';\nimport * as file from './file';\nimport * as form from './form';\nimport * as formInput from './form-input';\nimport * as formSubmitButton from './form-submit-button';\nimport * as formSubmissionNotification from './form-submission-notification';\nimport * as gallery from './gallery';\nimport * as group from './group';\nimport * as heading from './heading';\nimport * as homeLink from './home-link';\nimport * as html from './html';\nimport * as image from './image';\nimport * as latestComments from './latest-comments';\nimport * as latestPosts from './latest-posts';\nimport * as list from './list';\nimport * as listItem from './list-item';\nimport * as logInOut from './loginout';\nimport * as mediaText from './media-text';\nimport * as missing from './missing';\nimport * as more from './more';\nimport * as navigation from './navigation';\nimport * as navigationLink from './navigation-link';\nimport * as navigationSubmenu from './navigation-submenu';\nimport * as nextpage from './nextpage';\nimport * as pattern from './pattern';\nimport * as pageList from './page-list';\nimport * as pageListItem from './page-list-item';\nimport * as paragraph from './paragraph';\nimport * as postAuthor from './post-author';\nimport * as postAuthorName from './post-author-name';\nimport * as postAuthorBiography from './post-author-biography';\nimport * as postComment from './post-comment';\nimport * as postCommentsCount from './post-comments-count';\nimport * as postCommentsForm from './post-comments-form';\nimport * as postCommentsLink from './post-comments-link';\nimport * as postContent from './post-content';\nimport * as postDate from './post-date';\nimport * as postExcerpt from './post-excerpt';\nimport * as postFeaturedImage from './post-featured-image';\nimport * as postNavigationLink from './post-navigation-link';\nimport * as postTemplate from './post-template';\nimport * as postTerms from './post-terms';\nimport * as postTimeToRead from './post-time-to-read';\nimport * as postTitle from './post-title';\nimport * as preformatted from './preformatted';\nimport * as pullquote from './pullquote';\nimport * as query from './query';\nimport * as queryNoResults from './query-no-results';\nimport * as queryPagination from './query-pagination';\nimport * as queryPaginationNext from './query-pagination-next';\nimport * as queryPaginationNumbers from './query-pagination-numbers';\nimport * as queryPaginationPrevious from './query-pagination-previous';\nimport * as queryTitle from './query-title';\nimport * as quote from './quote';\nimport * as reusableBlock from './block';\nimport * as readMore from './read-more';\nimport * as rss from './rss';\nimport * as search from './search';\nimport * as separator from './separator';\nimport * as shortcode from './shortcode';\nimport * as siteLogo from './site-logo';\nimport * as siteTagline from './site-tagline';\nimport * as siteTitle from './site-title';\nimport * as socialLink from './social-link';\nimport * as socialLinks from './social-links';\nimport * as spacer from './spacer';\nimport * as table from './table';\nimport * as tableOfContents from './table-of-contents';\nimport * as tagCloud from './tag-cloud';\nimport * as templatePart from './template-part';\nimport * as termDescription from './term-description';\nimport * as textColumns from './text-columns';\nimport * as verse from './verse';\nimport * as video from './video';\nimport * as footnotes from './footnotes';\n\nimport isBlockMetadataExperimental from './utils/is-block-metadata-experimental';\n\n/**\n * Function to get all the block-library blocks in an array\n */\nconst getAllBlocks = () => {\n\tconst blocks = [\n\t\t// Common blocks are grouped at the top to prioritize their display\n\t\t// in various contexts — like the inserter and auto-complete components.\n\t\tparagraph,\n\t\timage,\n\t\theading,\n\t\tgallery,\n\t\tlist,\n\t\tlistItem,\n\t\tquote,\n\n\t\t// Register all remaining core blocks.\n\t\tarchives,\n\t\taudio,\n\t\tbutton,\n\t\tbuttons,\n\t\tcalendar,\n\t\tcategories,\n\t\tcode,\n\t\tcolumn,\n\t\tcolumns,\n\t\tcommentAuthorAvatar,\n\t\tcover,\n\t\tdetails,\n\t\tembed,\n\t\tfile,\n\t\tgroup,\n\t\thtml,\n\t\tlatestComments,\n\t\tlatestPosts,\n\t\tmediaText,\n\t\tmissing,\n\t\tmore,\n\t\tnextpage,\n\t\tpageList,\n\t\tpageListItem,\n\t\tpattern,\n\t\tpreformatted,\n\t\tpullquote,\n\t\treusableBlock,\n\t\trss,\n\t\tsearch,\n\t\tseparator,\n\t\tshortcode,\n\t\tsocialLink,\n\t\tsocialLinks,\n\t\tspacer,\n\t\ttable,\n\t\ttagCloud,\n\t\ttextColumns,\n\t\tverse,\n\t\tvideo,\n\t\tfootnotes,\n\n\t\t// theme blocks\n\t\tnavigation,\n\t\tnavigationLink,\n\t\tnavigationSubmenu,\n\t\tsiteLogo,\n\t\tsiteTitle,\n\t\tsiteTagline,\n\t\tquery,\n\t\ttemplatePart,\n\t\tavatar,\n\t\tpostTitle,\n\t\tpostExcerpt,\n\t\tpostFeaturedImage,\n\t\tpostContent,\n\t\tpostAuthor,\n\t\tpostAuthorName,\n\t\tpostComment,\n\t\tpostCommentsCount,\n\t\tpostCommentsLink,\n\t\tpostDate,\n\t\tpostTerms,\n\t\tpostNavigationLink,\n\t\tpostTemplate,\n\t\tpostTimeToRead,\n\t\tqueryPagination,\n\t\tqueryPaginationNext,\n\t\tqueryPaginationNumbers,\n\t\tqueryPaginationPrevious,\n\t\tqueryNoResults,\n\t\treadMore,\n\t\tcomments,\n\t\tcommentAuthorName,\n\t\tcommentContent,\n\t\tcommentDate,\n\t\tcommentEditLink,\n\t\tcommentReplyLink,\n\t\tcommentTemplate,\n\t\tcommentsTitle,\n\t\tcommentsPagination,\n\t\tcommentsPaginationNext,\n\t\tcommentsPaginationNumbers,\n\t\tcommentsPaginationPrevious,\n\t\tpostCommentsForm,\n\t\ttableOfContents,\n\t\thomeLink,\n\t\tlogInOut,\n\t\ttermDescription,\n\t\tqueryTitle,\n\t\tpostAuthorBiography,\n\t];\n\tif ( window?.__experimentalEnableFormBlocks ) {\n\t\tblocks.push( form );\n\t\tblocks.push( formInput );\n\t\tblocks.push( formSubmitButton );\n\t\tblocks.push( formSubmissionNotification );\n\t}\n\n\t// When in a WordPress context, conditionally\n\t// add the classic block and TinyMCE editor\n\t// under any of the following conditions:\n\t// - the current post contains a classic block\n\t// - the experiment to disable TinyMCE isn't active.\n\t// - a query argument specifies that TinyMCE should be loaded\n\tif (\n\t\twindow?.wp?.oldEditor &&\n\t\t( window?.wp?.needsClassicBlock ||\n\t\t\t! window?.__experimentalDisableTinymce ||\n\t\t\t!! new URLSearchParams( window?.location?.search ).get(\n\t\t\t\t'requiresTinymce'\n\t\t\t) )\n\t) {\n\t\tblocks.push( classic );\n\t}\n\n\treturn blocks.filter( Boolean );\n};\n\n/**\n * Function to get all the core blocks in an array.\n *\n * @example\n * ```js\n * import { __experimentalGetCoreBlocks } from '@wordpress/block-library';\n *\n * const coreBlocks = __experimentalGetCoreBlocks();\n * ```\n */\nexport const __experimentalGetCoreBlocks = () =>\n\tgetAllBlocks().filter(\n\t\t( { metadata } ) => ! isBlockMetadataExperimental( metadata )\n\t);\n\n/**\n * Function to register core blocks provided by the block editor.\n *\n * @param {Array} blocks An optional array of the core blocks being registered.\n *\n * @example\n * ```js\n * import { registerCoreBlocks } from '@wordpress/block-library';\n *\n * registerCoreBlocks();\n * ```\n */\nexport const registerCoreBlocks = (\n\tblocks = __experimentalGetCoreBlocks()\n) => {\n\tblocks.forEach( ( { init } ) => init() );\n\n\tsetDefaultBlockName( paragraph.name );\n\tif (\n\t\twindow.wp &&\n\t\twindow.wp.oldEditor &&\n\t\tblocks.some( ( { name } ) => name === classic.name )\n\t) {\n\t\tsetFreeformContentHandlerName( classic.name );\n\t}\n\tsetUnregisteredTypeHandlerName( missing.name );\n\tsetGroupingBlockName( group.name );\n};\n\n/**\n * Function to register experimental core blocks depending on editor settings.\n *\n * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.\n * @example\n * ```js\n * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';\n *\n * __experimentalRegisterExperimentalCoreBlocks( settings );\n * ```\n */\nexport const __experimentalRegisterExperimentalCoreBlocks = process.env\n\t.IS_GUTENBERG_PLUGIN\n\t? ( { enableFSEBlocks } = {} ) => {\n\t\t\tconst enabledExperiments = [ enableFSEBlocks ? 'fse' : null ];\n\t\t\tgetAllBlocks()\n\t\t\t\t.filter( ( { metadata } ) =>\n\t\t\t\t\tisBlockMetadataExperimental( metadata )\n\t\t\t\t)\n\t\t\t\t.filter(\n\t\t\t\t\t( { metadata: { __experimental } } ) =>\n\t\t\t\t\t\t__experimental === true ||\n\t\t\t\t\t\tenabledExperiments.includes( __experimental )\n\t\t\t\t)\n\t\t\t\t.forEach( ( { init } ) => init() );\n\t }\n\t: undefined;\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,mBAAmB,EACnBC,6BAA6B,EAC7BC,8BAA8B,EAC9BC,oBAAoB,QACd,mBAAmB;;AAE1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,KAAKC,QAAQ,MAAM,YAAY;AACtC,OAAO,KAAKC,MAAM,MAAM,UAAU;AAClC,OAAO,KAAKC,KAAK,MAAM,SAAS;AAChC,OAAO,KAAKC,MAAM,MAAM,UAAU;AAClC,OAAO,KAAKC,OAAO,MAAM,WAAW;AACpC,OAAO,KAAKC,QAAQ,MAAM,YAAY;AACtC,OAAO,KAAKC,UAAU,MAAM,cAAc;AAC1C,OAAO,KAAKC,OAAO,MAAM,YAAY;AACrC,OAAO,KAAKC,IAAI,MAAM,QAAQ;AAC9B,OAAO,KAAKC,MAAM,MAAM,UAAU;AAClC,OAAO,KAAKC,OAAO,MAAM,WAAW;AACpC,OAAO,KAAKC,QAAQ,MAAM,YAAY;AACtC,OAAO,KAAKC,mBAAmB,MAAM,yBAAyB;AAC9D,OAAO,KAAKC,iBAAiB,MAAM,uBAAuB;AAC1D,OAAO,KAAKC,cAAc,MAAM,mBAAmB;AACnD,OAAO,KAAKC,WAAW,MAAM,gBAAgB;AAC7C,OAAO,KAAKC,eAAe,MAAM,qBAAqB;AACtD,OAAO,KAAKC,gBAAgB,MAAM,sBAAsB;AACxD,OAAO,KAAKC,eAAe,MAAM,oBAAoB;AACrD,OAAO,KAAKC,0BAA0B,MAAM,gCAAgC;AAC5E,OAAO,KAAKC,kBAAkB,MAAM,uBAAuB;AAC3D,OAAO,KAAKC,sBAAsB,MAAM,4BAA4B;AACpE,OAAO,KAAKC,yBAAyB,M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eAAe,GAAG,KAAK,GAAG,IAAI,CAAE;EAC7DzB,YAAY,CAAC,CAAC,CACZY,MAAM,CAAE,CAAE;IAAEG;EAAS,CAAC,KACtBhB,2BAA2B,CAAEgB,QAAS,CACvC,CAAC,CACAH,MAAM,CACN,CAAE;IAAEG,QAAQ,EAAE;MAAEY;IAAe;EAAE,CAAC,KACjCA,cAAc,KAAK,IAAI,IACvBD,kBAAkB,CAACE,QAAQ,CAAED,cAAe,CAC9C,CAAC,CACAV,OAAO,CAAE,CAAE;IAAEC;EAAK,CAAC,KAAMA,IAAI,CAAC,CAAE,CAAC;AACnC,CAAC,GACDW,SAAS","ignoreList":[]}
1
+ {"version":3,"names":["setDefaultBlockName","setFreeformContentHandlerName","setUnregisteredTypeHandlerName","setGroupingBlockName","archives","avatar","audio","button","buttons","calendar","categories","classic","code","column","columns","comments","commentAuthorAvatar","commentAuthorName","commentContent","commentDate","commentEditLink","commentReplyLink","commentTemplate","commentsPaginationPrevious","commentsPagination","commentsPaginationNext","commentsPaginationNumbers","commentsTitle","cover","details","embed","file","form","formInput","formSubmitButton","formSubmissionNotification","gallery","group","heading","homeLink","html","image","latestComments","latestPosts","list","listItem","logInOut","mediaText","missing","more","navigation","navigationLink","navigationSubmenu","nextpage","pattern","pageList","pageListItem","paragraph","postAuthor","postAuthorName","postAuthorBiography","postComment","postCommentsCount","postCommentsForm","postCommentsLink","postContent","postDate","postExcerpt","postFeaturedImage","postNavigationLink","postTemplate","postTerms","postTimeToRead","postTitle","preformatted","pullquote","query","queryNoResults","queryPagination","queryPaginationNext","queryPaginationNumbers","queryPaginationPrevious","queryTitle","quote","reusableBlock","readMore","rss","search","separator","shortcode","siteLogo","siteTagline","siteTitle","socialLink","socialLinks","spacer","table","tableOfContents","tagCloud","templatePart","termDescription","textColumns","verse","video","footnotes","isBlockMetadataExperimental","getAllBlocks","blocks","window","__experimentalEnableFormBlocks","push","wp","oldEditor","needsClassicBlock","__experimentalDisableTinymce","URLSearchParams","location","get","filter","Boolean","__experimentalGetCoreBlocks","metadata","registerCoreBlocks","forEach","init","name","some","__experimentalRegisterExperimentalCoreBlocks","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","enabledExperiments","__experimental","includes","undefined","privateApis"],"sources":["@wordpress/block-library/src/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tsetDefaultBlockName,\n\tsetFreeformContentHandlerName,\n\tsetUnregisteredTypeHandlerName,\n\tsetGroupingBlockName,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\n// When IS_GUTENBERG_PLUGIN is set to false, imports of experimental blocks\n// are transformed by packages/block-library/src/index.js as follows:\n// import * as experimentalBlock from './experimental-block'\n// becomes\n// const experimentalBlock = null;\n// This enables webpack to eliminate the experimental blocks code from the\n// production build to make the final bundle smaller.\n//\n// See https://github.com/WordPress/gutenberg/pull/40655 for more context.\nimport * as archives from './archives';\nimport * as avatar from './avatar';\nimport * as audio from './audio';\nimport * as button from './button';\nimport * as buttons from './buttons';\nimport * as calendar from './calendar';\nimport * as categories from './categories';\nimport * as classic from './freeform';\nimport * as code from './code';\nimport * as column from './column';\nimport * as columns from './columns';\nimport * as comments from './comments';\nimport * as commentAuthorAvatar from './comment-author-avatar';\nimport * as commentAuthorName from './comment-author-name';\nimport * as commentContent from './comment-content';\nimport * as commentDate from './comment-date';\nimport * as commentEditLink from './comment-edit-link';\nimport * as commentReplyLink from './comment-reply-link';\nimport * as commentTemplate from './comment-template';\nimport * as commentsPaginationPrevious from './comments-pagination-previous';\nimport * as commentsPagination from './comments-pagination';\nimport * as commentsPaginationNext from './comments-pagination-next';\nimport * as commentsPaginationNumbers from './comments-pagination-numbers';\nimport * as commentsTitle from './comments-title';\nimport * as cover from './cover';\nimport * as details from './details';\nimport * as embed from './embed';\nimport * as file from './file';\nimport * as form from './form';\nimport * as formInput from './form-input';\nimport * as formSubmitButton from './form-submit-button';\nimport * as formSubmissionNotification from './form-submission-notification';\nimport * as gallery from './gallery';\nimport * as group from './group';\nimport * as heading from './heading';\nimport * as homeLink from './home-link';\nimport * as html from './html';\nimport * as image from './image';\nimport * as latestComments from './latest-comments';\nimport * as latestPosts from './latest-posts';\nimport * as list from './list';\nimport * as listItem from './list-item';\nimport * as logInOut from './loginout';\nimport * as mediaText from './media-text';\nimport * as missing from './missing';\nimport * as more from './more';\nimport * as navigation from './navigation';\nimport * as navigationLink from './navigation-link';\nimport * as navigationSubmenu from './navigation-submenu';\nimport * as nextpage from './nextpage';\nimport * as pattern from './pattern';\nimport * as pageList from './page-list';\nimport * as pageListItem from './page-list-item';\nimport * as paragraph from './paragraph';\nimport * as postAuthor from './post-author';\nimport * as postAuthorName from './post-author-name';\nimport * as postAuthorBiography from './post-author-biography';\nimport * as postComment from './post-comment';\nimport * as postCommentsCount from './post-comments-count';\nimport * as postCommentsForm from './post-comments-form';\nimport * as postCommentsLink from './post-comments-link';\nimport * as postContent from './post-content';\nimport * as postDate from './post-date';\nimport * as postExcerpt from './post-excerpt';\nimport * as postFeaturedImage from './post-featured-image';\nimport * as postNavigationLink from './post-navigation-link';\nimport * as postTemplate from './post-template';\nimport * as postTerms from './post-terms';\nimport * as postTimeToRead from './post-time-to-read';\nimport * as postTitle from './post-title';\nimport * as preformatted from './preformatted';\nimport * as pullquote from './pullquote';\nimport * as query from './query';\nimport * as queryNoResults from './query-no-results';\nimport * as queryPagination from './query-pagination';\nimport * as queryPaginationNext from './query-pagination-next';\nimport * as queryPaginationNumbers from './query-pagination-numbers';\nimport * as queryPaginationPrevious from './query-pagination-previous';\nimport * as queryTitle from './query-title';\nimport * as quote from './quote';\nimport * as reusableBlock from './block';\nimport * as readMore from './read-more';\nimport * as rss from './rss';\nimport * as search from './search';\nimport * as separator from './separator';\nimport * as shortcode from './shortcode';\nimport * as siteLogo from './site-logo';\nimport * as siteTagline from './site-tagline';\nimport * as siteTitle from './site-title';\nimport * as socialLink from './social-link';\nimport * as socialLinks from './social-links';\nimport * as spacer from './spacer';\nimport * as table from './table';\nimport * as tableOfContents from './table-of-contents';\nimport * as tagCloud from './tag-cloud';\nimport * as templatePart from './template-part';\nimport * as termDescription from './term-description';\nimport * as textColumns from './text-columns';\nimport * as verse from './verse';\nimport * as video from './video';\nimport * as footnotes from './footnotes';\n\nimport isBlockMetadataExperimental from './utils/is-block-metadata-experimental';\n\n/**\n * Function to get all the block-library blocks in an array\n */\nconst getAllBlocks = () => {\n\tconst blocks = [\n\t\t// Common blocks are grouped at the top to prioritize their display\n\t\t// in various contexts — like the inserter and auto-complete components.\n\t\tparagraph,\n\t\timage,\n\t\theading,\n\t\tgallery,\n\t\tlist,\n\t\tlistItem,\n\t\tquote,\n\n\t\t// Register all remaining core blocks.\n\t\tarchives,\n\t\taudio,\n\t\tbutton,\n\t\tbuttons,\n\t\tcalendar,\n\t\tcategories,\n\t\tcode,\n\t\tcolumn,\n\t\tcolumns,\n\t\tcommentAuthorAvatar,\n\t\tcover,\n\t\tdetails,\n\t\tembed,\n\t\tfile,\n\t\tgroup,\n\t\thtml,\n\t\tlatestComments,\n\t\tlatestPosts,\n\t\tmediaText,\n\t\tmissing,\n\t\tmore,\n\t\tnextpage,\n\t\tpageList,\n\t\tpageListItem,\n\t\tpattern,\n\t\tpreformatted,\n\t\tpullquote,\n\t\treusableBlock,\n\t\trss,\n\t\tsearch,\n\t\tseparator,\n\t\tshortcode,\n\t\tsocialLink,\n\t\tsocialLinks,\n\t\tspacer,\n\t\ttable,\n\t\ttagCloud,\n\t\ttextColumns,\n\t\tverse,\n\t\tvideo,\n\t\tfootnotes,\n\n\t\t// theme blocks\n\t\tnavigation,\n\t\tnavigationLink,\n\t\tnavigationSubmenu,\n\t\tsiteLogo,\n\t\tsiteTitle,\n\t\tsiteTagline,\n\t\tquery,\n\t\ttemplatePart,\n\t\tavatar,\n\t\tpostTitle,\n\t\tpostExcerpt,\n\t\tpostFeaturedImage,\n\t\tpostContent,\n\t\tpostAuthor,\n\t\tpostAuthorName,\n\t\tpostComment,\n\t\tpostCommentsCount,\n\t\tpostCommentsLink,\n\t\tpostDate,\n\t\tpostTerms,\n\t\tpostNavigationLink,\n\t\tpostTemplate,\n\t\tpostTimeToRead,\n\t\tqueryPagination,\n\t\tqueryPaginationNext,\n\t\tqueryPaginationNumbers,\n\t\tqueryPaginationPrevious,\n\t\tqueryNoResults,\n\t\treadMore,\n\t\tcomments,\n\t\tcommentAuthorName,\n\t\tcommentContent,\n\t\tcommentDate,\n\t\tcommentEditLink,\n\t\tcommentReplyLink,\n\t\tcommentTemplate,\n\t\tcommentsTitle,\n\t\tcommentsPagination,\n\t\tcommentsPaginationNext,\n\t\tcommentsPaginationNumbers,\n\t\tcommentsPaginationPrevious,\n\t\tpostCommentsForm,\n\t\ttableOfContents,\n\t\thomeLink,\n\t\tlogInOut,\n\t\ttermDescription,\n\t\tqueryTitle,\n\t\tpostAuthorBiography,\n\t];\n\tif ( window?.__experimentalEnableFormBlocks ) {\n\t\tblocks.push( form );\n\t\tblocks.push( formInput );\n\t\tblocks.push( formSubmitButton );\n\t\tblocks.push( formSubmissionNotification );\n\t}\n\n\t// When in a WordPress context, conditionally\n\t// add the classic block and TinyMCE editor\n\t// under any of the following conditions:\n\t// - the current post contains a classic block\n\t// - the experiment to disable TinyMCE isn't active.\n\t// - a query argument specifies that TinyMCE should be loaded\n\tif (\n\t\twindow?.wp?.oldEditor &&\n\t\t( window?.wp?.needsClassicBlock ||\n\t\t\t! window?.__experimentalDisableTinymce ||\n\t\t\t!! new URLSearchParams( window?.location?.search ).get(\n\t\t\t\t'requiresTinymce'\n\t\t\t) )\n\t) {\n\t\tblocks.push( classic );\n\t}\n\n\treturn blocks.filter( Boolean );\n};\n\n/**\n * Function to get all the core blocks in an array.\n *\n * @example\n * ```js\n * import { __experimentalGetCoreBlocks } from '@wordpress/block-library';\n *\n * const coreBlocks = __experimentalGetCoreBlocks();\n * ```\n */\nexport const __experimentalGetCoreBlocks = () =>\n\tgetAllBlocks().filter(\n\t\t( { metadata } ) => ! isBlockMetadataExperimental( metadata )\n\t);\n\n/**\n * Function to register core blocks provided by the block editor.\n *\n * @param {Array} blocks An optional array of the core blocks being registered.\n *\n * @example\n * ```js\n * import { registerCoreBlocks } from '@wordpress/block-library';\n *\n * registerCoreBlocks();\n * ```\n */\nexport const registerCoreBlocks = (\n\tblocks = __experimentalGetCoreBlocks()\n) => {\n\tblocks.forEach( ( { init } ) => init() );\n\n\tsetDefaultBlockName( paragraph.name );\n\tif (\n\t\twindow.wp &&\n\t\twindow.wp.oldEditor &&\n\t\tblocks.some( ( { name } ) => name === classic.name )\n\t) {\n\t\tsetFreeformContentHandlerName( classic.name );\n\t}\n\tsetUnregisteredTypeHandlerName( missing.name );\n\tsetGroupingBlockName( group.name );\n};\n\n/**\n * Function to register experimental core blocks depending on editor settings.\n *\n * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.\n * @example\n * ```js\n * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';\n *\n * __experimentalRegisterExperimentalCoreBlocks( settings );\n * ```\n */\nexport const __experimentalRegisterExperimentalCoreBlocks = process.env\n\t.IS_GUTENBERG_PLUGIN\n\t? ( { enableFSEBlocks } = {} ) => {\n\t\t\tconst enabledExperiments = [ enableFSEBlocks ? 'fse' : null ];\n\t\t\tgetAllBlocks()\n\t\t\t\t.filter( ( { metadata } ) =>\n\t\t\t\t\tisBlockMetadataExperimental( metadata )\n\t\t\t\t)\n\t\t\t\t.filter(\n\t\t\t\t\t( { metadata: { __experimental } } ) =>\n\t\t\t\t\t\t__experimental === true ||\n\t\t\t\t\t\tenabledExperiments.includes( __experimental )\n\t\t\t\t)\n\t\t\t\t.forEach( ( { init } ) => init() );\n\t }\n\t: undefined;\n\nexport { privateApis } from './private-apis';\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,mBAAmB,EACnBC,6BAA6B,EAC7BC,8BAA8B,EAC9BC,oBAAoB,QACd,mBAAmB;;AAE1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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,CAAC,KAAMA,IAAI,CAAC,CAAE,CAAC;AACnC,CAAC,GACDW,SAAS;AAEZ,SAASC,WAAW,QAAQ,gBAAgB","ignoreList":[]}
@@ -32,8 +32,12 @@ export default function useMerge(clientId, onMerge) {
32
32
  function getParentListItemId(id) {
33
33
  const listId = getBlockRootClientId(id);
34
34
  const parentListItemId = getBlockRootClientId(listId);
35
- if (!parentListItemId) return;
36
- if (getBlockName(parentListItemId) !== 'core/list-item') return;
35
+ if (!parentListItemId) {
36
+ return;
37
+ }
38
+ if (getBlockName(parentListItemId) !== 'core/list-item') {
39
+ return;
40
+ }
37
41
  return parentListItemId;
38
42
  }
39
43
 
@@ -46,9 +50,13 @@ export default function useMerge(clientId, onMerge) {
46
50
  */
47
51
  function _getNextId(id) {
48
52
  const next = getNextBlockClientId(id);
49
- if (next) return next;
53
+ if (next) {
54
+ return next;
55
+ }
50
56
  const parentListItemId = getParentListItemId(id);
51
- if (!parentListItemId) return;
57
+ if (!parentListItemId) {
58
+ return;
59
+ }
52
60
  return _getNextId(parentListItemId);
53
61
  }
54
62