@wordpress/block-library 9.45.1-next.v.202605131032.0 → 9.47.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 (182) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/build/button/edit.cjs +7 -4
  3. package/build/button/edit.cjs.map +3 -3
  4. package/build/columns/edit.cjs +4 -10
  5. package/build/columns/edit.cjs.map +2 -2
  6. package/build/comments/edit/placeholder.cjs +1 -1
  7. package/build/comments/edit/placeholder.cjs.map +2 -2
  8. package/build/cover/edit/inspector-controls.cjs +4 -2
  9. package/build/cover/edit/inspector-controls.cjs.map +2 -2
  10. package/build/freeform/migration-notice.cjs +1 -1
  11. package/build/freeform/migration-notice.cjs.map +1 -1
  12. package/build/home-link/block.json +7 -0
  13. package/build/home-link/edit.cjs +167 -24
  14. package/build/home-link/edit.cjs.map +3 -3
  15. package/build/html/edit.cjs +2 -4
  16. package/build/html/edit.cjs.map +2 -2
  17. package/build/html/modal.cjs +0 -4
  18. package/build/html/modal.cjs.map +2 -2
  19. package/build/image/block.json +4 -0
  20. package/build/image/deprecated.cjs +202 -4
  21. package/build/image/deprecated.cjs.map +3 -3
  22. package/build/image/image.cjs +80 -27
  23. package/build/image/image.cjs.map +2 -2
  24. package/build/image/index.cjs +23 -4
  25. package/build/image/index.cjs.map +2 -2
  26. package/build/image/save.cjs +25 -10
  27. package/build/image/save.cjs.map +2 -2
  28. package/build/image/transforms.cjs +15 -3
  29. package/build/image/transforms.cjs.map +2 -2
  30. package/build/image/use-open-image-media-editor-modal.cjs +29 -12
  31. package/build/image/use-open-image-media-editor-modal.cjs.map +2 -2
  32. package/build/list-item/hooks/use-enter.cjs +8 -4
  33. package/build/list-item/hooks/use-enter.cjs.map +3 -3
  34. package/build/list-item/hooks/use-space.cjs +8 -4
  35. package/build/list-item/hooks/use-space.cjs.map +3 -3
  36. package/build/navigation-link/edit.cjs +2 -1
  37. package/build/navigation-link/edit.cjs.map +2 -2
  38. package/build/navigation-link/shared/use-handle-link-change.cjs +19 -3
  39. package/build/navigation-link/shared/use-handle-link-change.cjs.map +3 -3
  40. package/build/navigation-submenu/edit.cjs +8 -22
  41. package/build/navigation-submenu/edit.cjs.map +2 -2
  42. package/build/paragraph/use-enter.cjs +8 -4
  43. package/build/paragraph/use-enter.cjs.map +3 -3
  44. package/build/post-date/edit.cjs +9 -1
  45. package/build/post-date/edit.cjs.map +2 -2
  46. package/build/post-featured-image/edit.cjs +0 -1
  47. package/build/post-featured-image/edit.cjs.map +2 -2
  48. package/build/site-logo/edit.cjs +1 -1
  49. package/build/site-logo/edit.cjs.map +2 -2
  50. package/build/social-link/edit.cjs.map +3 -3
  51. package/build/tab-list/edit.cjs +2 -0
  52. package/build/tab-list/edit.cjs.map +2 -2
  53. package/build/tab-panels/edit.cjs +5 -1
  54. package/build/tab-panels/edit.cjs.map +2 -2
  55. package/build/table/edit.cjs +1 -0
  56. package/build/table/edit.cjs.map +2 -2
  57. package/build/tabs/edit.cjs +1 -36
  58. package/build/tabs/edit.cjs.map +2 -2
  59. package/build-module/button/edit.mjs +12 -5
  60. package/build-module/button/edit.mjs.map +2 -2
  61. package/build-module/columns/edit.mjs +4 -10
  62. package/build-module/columns/edit.mjs.map +2 -2
  63. package/build-module/comments/edit/placeholder.mjs +1 -1
  64. package/build-module/comments/edit/placeholder.mjs.map +2 -2
  65. package/build-module/cover/edit/inspector-controls.mjs +4 -3
  66. package/build-module/cover/edit/inspector-controls.mjs.map +2 -2
  67. package/build-module/freeform/migration-notice.mjs +1 -1
  68. package/build-module/freeform/migration-notice.mjs.map +1 -1
  69. package/build-module/home-link/block.json +7 -0
  70. package/build-module/home-link/edit.mjs +181 -26
  71. package/build-module/home-link/edit.mjs.map +2 -2
  72. package/build-module/html/edit.mjs +2 -4
  73. package/build-module/html/edit.mjs.map +2 -2
  74. package/build-module/html/modal.mjs +0 -4
  75. package/build-module/html/modal.mjs.map +2 -2
  76. package/build-module/image/block.json +4 -0
  77. package/build-module/image/deprecated.mjs +204 -5
  78. package/build-module/image/deprecated.mjs.map +2 -2
  79. package/build-module/image/image.mjs +81 -27
  80. package/build-module/image/image.mjs.map +2 -2
  81. package/build-module/image/index.mjs +23 -4
  82. package/build-module/image/index.mjs.map +2 -2
  83. package/build-module/image/save.mjs +25 -10
  84. package/build-module/image/save.mjs.map +2 -2
  85. package/build-module/image/transforms.mjs +15 -3
  86. package/build-module/image/transforms.mjs.map +2 -2
  87. package/build-module/image/use-open-image-media-editor-modal.mjs +29 -12
  88. package/build-module/image/use-open-image-media-editor-modal.mjs.map +2 -2
  89. package/build-module/list-item/hooks/use-enter.mjs +12 -5
  90. package/build-module/list-item/hooks/use-enter.mjs.map +2 -2
  91. package/build-module/list-item/hooks/use-space.mjs +12 -5
  92. package/build-module/list-item/hooks/use-space.mjs.map +2 -2
  93. package/build-module/navigation-link/edit.mjs +2 -1
  94. package/build-module/navigation-link/edit.mjs.map +2 -2
  95. package/build-module/navigation-link/shared/use-handle-link-change.mjs +19 -3
  96. package/build-module/navigation-link/shared/use-handle-link-change.mjs.map +2 -2
  97. package/build-module/navigation-submenu/edit.mjs +9 -23
  98. package/build-module/navigation-submenu/edit.mjs.map +2 -2
  99. package/build-module/paragraph/use-enter.mjs +12 -5
  100. package/build-module/paragraph/use-enter.mjs.map +2 -2
  101. package/build-module/post-date/edit.mjs +9 -1
  102. package/build-module/post-date/edit.mjs.map +2 -2
  103. package/build-module/post-featured-image/edit.mjs +0 -1
  104. package/build-module/post-featured-image/edit.mjs.map +2 -2
  105. package/build-module/site-logo/edit.mjs +1 -1
  106. package/build-module/site-logo/edit.mjs.map +2 -2
  107. package/build-module/social-link/edit.mjs +2 -2
  108. package/build-module/social-link/edit.mjs.map +2 -2
  109. package/build-module/tab-list/edit.mjs +2 -0
  110. package/build-module/tab-list/edit.mjs.map +2 -2
  111. package/build-module/tab-panels/edit.mjs +5 -1
  112. package/build-module/tab-panels/edit.mjs.map +2 -2
  113. package/build-module/table/edit.mjs +1 -0
  114. package/build-module/table/edit.mjs.map +2 -2
  115. package/build-module/tabs/edit.mjs +2 -37
  116. package/build-module/tabs/edit.mjs.map +2 -2
  117. package/build-style/breadcrumbs/style-rtl.css +1 -1
  118. package/build-style/breadcrumbs/style.css +1 -1
  119. package/build-style/editor-rtl.css +0 -11
  120. package/build-style/editor.css +0 -11
  121. package/build-style/gallery/editor-rtl.css +0 -11
  122. package/build-style/gallery/editor.css +0 -11
  123. package/build-style/style-rtl.css +1 -1
  124. package/build-style/style.css +1 -1
  125. package/package.json +42 -42
  126. package/src/block/edit-title.native.js +3 -3
  127. package/src/block/edit.native.js +2 -2
  128. package/src/breadcrumbs/style.scss +1 -1
  129. package/src/button/edit.js +14 -5
  130. package/src/columns/edit.js +3 -9
  131. package/src/comments/edit/placeholder.js +1 -1
  132. package/src/cover/controls.native.js +2 -2
  133. package/src/cover/edit/inspector-controls.js +8 -7
  134. package/src/cover/edit.native.js +6 -4
  135. package/src/cover/focal-point-settings-button.native.js +2 -2
  136. package/src/cover/test/edit.js +32 -31
  137. package/src/embed/embed-no-preview.native.js +7 -3
  138. package/src/embed/embed-placeholder.native.js +2 -2
  139. package/src/file/edit.native.js +2 -2
  140. package/src/freeform/migration-notice.js +1 -1
  141. package/src/gallery/editor.scss +0 -14
  142. package/src/home-link/block.json +7 -0
  143. package/src/home-link/edit.js +185 -22
  144. package/src/home-link/index.php +14 -2
  145. package/src/html/edit.js +14 -12
  146. package/src/html/modal.js +0 -5
  147. package/src/image/block.json +4 -0
  148. package/src/image/deprecated.js +236 -4
  149. package/src/image/edit.native.js +2 -2
  150. package/src/image/image.js +116 -41
  151. package/src/image/index.js +20 -1
  152. package/src/image/index.php +1 -1
  153. package/src/image/save.js +39 -12
  154. package/src/image/test/use-open-image-media-editor-modal.js +60 -0
  155. package/src/image/transforms.js +21 -5
  156. package/src/image/use-open-image-media-editor-modal.js +34 -16
  157. package/src/latest-posts/edit.native.js +2 -2
  158. package/src/list-item/hooks/use-enter.js +15 -5
  159. package/src/list-item/hooks/use-space.js +15 -5
  160. package/src/list-item/list-style-type.native.js +2 -2
  161. package/src/media-text/media-container.native.js +7 -3
  162. package/src/missing/edit.native.js +4 -4
  163. package/src/missing/test/edit.native.js +3 -3
  164. package/src/navigation/test/use-navigation-menu.js +8 -2
  165. package/src/navigation-link/edit.js +1 -0
  166. package/src/navigation-link/shared/test/use-handle-link-change.test.js +212 -0
  167. package/src/navigation-link/shared/use-handle-link-change.js +36 -9
  168. package/src/navigation-link/test/__snapshots__/hooks.js.snap +134 -45
  169. package/src/navigation-submenu/edit.js +11 -28
  170. package/src/navigation-submenu/index.php +13 -0
  171. package/src/paragraph/use-enter.js +19 -5
  172. package/src/post-date/edit.js +7 -3
  173. package/src/post-featured-image/edit.js +0 -1
  174. package/src/search/edit.native.js +2 -2
  175. package/src/search/test/edit.native.js +2 -2
  176. package/src/site-logo/edit.js +2 -1
  177. package/src/social-link/edit.js +2 -2
  178. package/src/tab-list/edit.js +3 -0
  179. package/src/tab-panels/edit.js +10 -1
  180. package/src/table/edit.js +1 -0
  181. package/src/tabs/edit.js +14 -42
  182. package/src/video/edit.native.js +3 -3
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/image/image.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\tExternalLink,\n\tFocalPointPicker,\n\tResizableBox,\n\tSpinner,\n\tTextareaControl,\n\tTextControl,\n\tToolbarButton,\n\tToolbarGroup,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\tPlaceholder,\n\tMenuItem,\n\tToolbarItem,\n\tDropdownMenu,\n\tPopover,\n} from '@wordpress/components';\nimport {\n\tuseMergeRefs,\n\tuseResizeObserver,\n\tuseViewportMatch,\n} 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\tBlockSettingsMenuControls,\n} from '@wordpress/block-editor';\nimport {\n\tcreateInterpolateElement,\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseState,\n} from '@wordpress/element';\nimport { __, _x, sprintf, isRTL } from '@wordpress/i18n';\nimport { getFilename } from '@wordpress/url';\nimport { getBlockBindingsSource, switchToBlockType } from '@wordpress/blocks';\nimport { crop, overlayText, upload, chevronDown } 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';\nimport { MediaControl } from '../utils/media-control';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport { useOpenImageMediaEditorModal } from './use-open-image-media-editor-modal';\nimport {\n\tMIN_SIZE,\n\tALLOWED_MEDIA_TYPES,\n\tSIZED_LAYOUTS,\n\tDEFAULT_MEDIA_SIZE_SLUG,\n} from './constants';\nimport { evalAspectRatio, mediaPosition } from './utils';\n\nconst { DimensionsTool, ResolutionTool, mediaEditKey } = unlock(\n\tblockEditorPrivateApis\n);\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\nconst WRITEMODE_POPOVER_PROPS = {\n\tplacement: 'bottom-start',\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// and remove pointer events. Safari needs the display property.\n\t\t\t\tpointerEvents: 'none',\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\nfunction ContentOnlyControls( {\n\tattributes,\n\tsetAttributes,\n\tlockAltControls,\n\tlockAltControlsMessage,\n\tlockTitleControls,\n\tlockTitleControlsMessage,\n} ) {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst [ isAltDialogOpen, setIsAltDialogOpen ] = useState( false );\n\tconst [ isTitleDialogOpen, setIsTitleDialogOpen ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<ToolbarItem ref={ setPopoverAnchor }>\n\t\t\t\t{ ( toggleProps ) => (\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\tlabel={ __( 'More' ) }\n\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\t...toggleProps,\n\t\t\t\t\t\t\tdescription: __( 'Displays more controls.' ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tpopoverProps={ WRITEMODE_POPOVER_PROPS }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetIsAltDialogOpen( true );\n\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ _x(\n\t\t\t\t\t\t\t\t\t\t'Alternative text',\n\t\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\t) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetIsTitleDialogOpen( true );\n\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Title text' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t) }\n\t\t\t</ToolbarItem>\n\t\t\t{ isAltDialogOpen && (\n\t\t\t\t<Popover\n\t\t\t\t\tplacement=\"bottom-start\"\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tonClose={ () => setIsAltDialogOpen( false ) }\n\t\t\t\t\toffset={ 13 }\n\t\t\t\t\tvariant=\"toolbar\"\n\t\t\t\t>\n\t\t\t\t\t<div className=\"wp-block-image__toolbar_content_textarea__container\">\n\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\tclassName=\"wp-block-image__toolbar_content_textarea\"\n\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\tvalue={ attributes.alt || '' }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { alt: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisabled={ lockAltControls }\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tlockAltControls ? (\n\t\t\t\t\t\t\t\t\t<>{ lockAltControlsMessage }</>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t\t\t\t\t)\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\t\t{ __(\n\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) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t{ __( 'Leave empty if decorative.' ) }\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</div>\n\t\t\t\t</Popover>\n\t\t\t) }\n\t\t\t{ isTitleDialogOpen && (\n\t\t\t\t<Popover\n\t\t\t\t\tplacement=\"bottom-start\"\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tonClose={ () => setIsTitleDialogOpen( false ) }\n\t\t\t\t\toffset={ 13 }\n\t\t\t\t\tvariant=\"toolbar\"\n\t\t\t\t>\n\t\t\t\t\t<div className=\"wp-block-image__toolbar_content_textarea__container\">\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tclassName=\"wp-block-image__toolbar_content_textarea\"\n\t\t\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\t\t\tvalue={ attributes.title || '' }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\ttitle: value,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisabled={ lockTitleControls }\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tlockTitleControls ? (\n\t\t\t\t\t\t\t\t\t<>{ lockTitleControlsMessage }</>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\tcreateInterpolateElement(\n\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t'Describe the role of this image on the page. <a>(Note: many devices and browsers do not display this text.)</a>'\n\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\t\ta: (\n\t\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),\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</div>\n\t\t\t\t</Popover>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default function Image( {\n\ttemporaryURL,\n\tisSideloading,\n\tattributes,\n\tsetAttributes,\n\tisSingleSelected,\n\tinsertBlocksAfter,\n\tonReplace,\n\tonSelectImage,\n\tonSelectURL,\n\tonUploadError,\n\tcontext,\n\tclientId,\n\tblockEditingMode,\n\tparentLayoutType,\n\tmaxContentWidth,\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\tfocalPoint,\n\t\tlinkTarget,\n\t\tsizeSlug,\n\t\tlightbox,\n\t\tmetadata,\n\t} = attributes;\n\tconst [ imageElement, setImageElement ] = useState();\n\tconst [ resizeDelta, setResizeDelta ] = useState( null );\n\tconst [ pixelSize, setPixelSize ] = useState( {} );\n\tconst [ offsetTop, setOffsetTop ] = useState( 0 );\n\tconst setResizeObserved = useResizeObserver( ( [ entry ] ) => {\n\t\tif ( ! resizeDelta ) {\n\t\t\tconst [ box ] = entry.borderBoxSize;\n\t\t\tsetPixelSize( { width: box.inlineSize, height: box.blockSize } );\n\t\t}\n\t\t// This is usually 0 unless the image height is less than the line-height.\n\t\tsetOffsetTop( entry.target.offsetTop );\n\t} );\n\tconst effectResizeableBoxPlacement = useCallback( () => {\n\t\tsetOffsetTop( imageElement?.offsetTop ?? 0 );\n\t}, [ imageElement ] );\n\tconst setRefs = useMergeRefs( [ setImageElement, setResizeObserved ] );\n\tconst { allowResize = true } = context;\n\n\tconst { image, attachmentResolutionError } = useSelect(\n\t\t( select ) => {\n\t\t\tconst imageRecord =\n\t\t\t\tid && isSingleSelected\n\t\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t{ context: 'view' }\n\t\t\t\t\t )\n\t\t\t\t\t: null;\n\n\t\t\t// Check if the attachment resolution failed with a specific error.\n\t\t\t// We use getResolutionError instead of hasFinishedResolution so we\n\t\t\t// can distinguish 404 (attachment doesn't exist) from transient\n\t\t\t// errors (500, 403, network) that shouldn't clear the id.\n\t\t\tconst resolutionError =\n\t\t\t\tid && isSingleSelected\n\t\t\t\t\t? select( coreStore ).getResolutionError(\n\t\t\t\t\t\t\t'getEntityRecord',\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\t{ context: 'view' },\n\t\t\t\t\t\t\t]\n\t\t\t\t\t )\n\t\t\t\t\t: null;\n\n\t\t\treturn {\n\t\t\t\timage: imageRecord,\n\t\t\t\tattachmentResolutionError: resolutionError,\n\t\t\t};\n\t\t},\n\t\t[ id, isSingleSelected ]\n\t);\n\n\tconst {\n\t\tcanInsertCover,\n\t\timageEditing,\n\t\timageSizes,\n\t\tmaxWidth,\n\t\teditMediaEntity,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, canInsertBlockType, getSettings } =\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\teditMediaEntity: settings?.[ mediaEditKey ],\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\tconst { getBlock, getSettings } = useSelect( blockEditorStore );\n\tconst openImageMediaEditorModal = useOpenImageMediaEditorModal( {\n\t\tattributes,\n\t\tsetAttributes,\n\t} );\n\n\tconst {\n\t\treplaceBlocks,\n\t\ttoggleSelection,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t} = useDispatch( blockEditorStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\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 [ hasImageErrored, setHasImageErrored ] = useState( false );\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\tconst isContentOnlyMode = blockEditingMode === 'contentOnly';\n\tconst showDimensionsControls = allowResize && hasNonContentControls;\n\tconst isResizable =\n\t\tallowResize &&\n\t\thasNonContentControls &&\n\t\t! isWideAligned &&\n\t\tisLargeViewport;\n\t// An image is uploading if it has a temporary blob URL, or if it is\n\t// being processed client-side (e.g. transcoded or generating sub-sizes).\n\tconst isUploading = !! temporaryURL || isSideloading;\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 the image has an id but the attachment doesn't exist on this site,\n\t// clear the id so Gutenberg treats the image as external.\n\t// This handles content copied between WordPress sites.\n\t//\n\t// Known limitation: if a different attachment with the same id happens to\n\t// exist on the destination site, the lookup will succeed and the wrong\n\t// local image will be used. URL matching could address this in a follow-up.\n\t// See: https://github.com/WordPress/gutenberg/issues/74156\n\tuseEffect( () => {\n\t\tif ( ! id || ! isSingleSelected ) {\n\t\t\treturn;\n\t\t}\n\t\t// Only clear for confirmed 404s. apiFetch throws the Response object\n\t\t// for HTTP errors, so checking .status === 404 avoids incorrectly\n\t\t// clearing the id on 403, 500, or network failures, which would\n\t\t// cause data loss for valid local attachments.\n\t\tif ( attachmentResolutionError?.status === 404 ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { id: undefined } );\n\t\t}\n\t}, [\n\t\tid,\n\t\tisSingleSelected,\n\t\tattachmentResolutionError,\n\t\tsetAttributes,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t] );\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, getSettings ] );\n\n\t// Get naturalWidth and naturalHeight from image, 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\timageElement?.naturalWidth || loadedNaturalWidth || undefined,\n\t\t\tnaturalHeight:\n\t\t\t\timageElement?.naturalHeight || loadedNaturalHeight || undefined,\n\t\t};\n\t}, [ loadedNaturalWidth, loadedNaturalHeight, imageElement?.complete ] );\n\n\tfunction onImageError() {\n\t\tsetHasImageErrored( true );\n\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\t\tif ( undefined !== embedBlock ) {\n\t\t\tonReplace( embedBlock );\n\t\t}\n\t}\n\n\tfunction onImageLoad( event ) {\n\t\tsetHasImageErrored( false );\n\t\tsetLoadedNaturalSize( {\n\t\t\tloadedNaturalWidth: event.target?.naturalWidth,\n\t\t\tloadedNaturalHeight: event.target?.naturalHeight,\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\tconst imperativeFocalPointPreview = ( value ) => {\n\t\tif ( imageElement ) {\n\t\t\timageElement.style.setProperty(\n\t\t\t\t'object-position',\n\t\t\t\tmediaPosition( value )\n\t\t\t);\n\t\t}\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\tlet notified = false;\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\t// With client-side media processing, onFileChange fires\n\t\t\t\t// for each generated sub-size. Only show the notice once.\n\t\t\t\tif ( ! notified ) {\n\t\t\t\t\tnotified = true;\n\t\t\t\t\tsetExternalBlob();\n\t\t\t\t\tcreateSuccessNotice( __( 'Image uploaded.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t} );\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 =\n\t\tid &&\n\t\tnaturalWidth &&\n\t\tnaturalHeight &&\n\t\timageEditing &&\n\t\t!! editMediaEntity;\n\tconst allowCrop =\n\t\tisSingleSelected &&\n\t\tcanEditImage &&\n\t\t! isEditingImage &&\n\t\t! isContentOnlyMode;\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 dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst dimensionsControl =\n\t\tshowDimensionsControls &&\n\t\t( SIZED_LAYOUTS.includes( parentLayoutType ) ? (\n\t\t\t<DimensionsTool\n\t\t\t\tpanelId={ clientId }\n\t\t\t\tvalue={ { aspectRatio } }\n\t\t\t\tonChange={ ( { aspectRatio: newAspectRatio } ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t\t\t\tscale: 'cover',\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tdefaultAspectRatio=\"auto\"\n\t\t\t\ttools={ [ 'aspectRatio' ] }\n\t\t\t/>\n\t\t) : (\n\t\t\t<DimensionsTool\n\t\t\t\tpanelId={ clientId }\n\t\t\t\tvalue={ { width, height, scale, aspectRatio } }\n\t\t\t\tonChange={ ( {\n\t\t\t\t\twidth: 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\t\t// Rebuilding the object forces setting `undefined`\n\t\t\t\t\t// for values that are removed since setAttributes\n\t\t\t\t\t// doesn't do anything with keys that aren't set.\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t// CSS includes `height: auto`, but we need\n\t\t\t\t\t\t// `width: auto` to fix the aspect ratio when\n\t\t\t\t\t\t// only height is set due to the width and\n\t\t\t\t\t\t// height attributes set via the server.\n\t\t\t\t\t\twidth: ! newWidth && newHeight ? 'auto' : newWidth,\n\t\t\t\t\t\theight: newHeight,\n\t\t\t\t\t\tscale: newScale,\n\t\t\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tdefaultScale=\"cover\"\n\t\t\t\tdefaultAspectRatio=\"auto\"\n\t\t\t\tscaleOptions={ scaleOptions }\n\t\t\t\tunitsOptions={ dimensionsUnitsOptions }\n\t\t\t\ttools={\n\t\t\t\t\tisWideAligned\n\t\t\t\t\t\t? [ 'aspectRatio', 'scale' ]\n\t\t\t\t\t\t: [ 'aspectRatio', 'widthHeight', 'scale' ]\n\t\t\t\t}\n\t\t\t/>\n\t\t) );\n\n\tconst resetSettings = () => {\n\t\tsetAttributes( {\n\t\t\tlightbox: undefined,\n\t\t} );\n\t\tupdateImage( DEFAULT_MEDIA_SIZE_SLUG );\n\t};\n\n\tconst arePatternOverridesEnabled =\n\t\tmetadata?.bindings?.__default?.source === 'core/pattern-overrides';\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\thideCaptionControls = 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 {\n\t\t\t\turl: urlBinding,\n\t\t\t\talt: altBinding,\n\t\t\t\ttitle: titleBinding,\n\t\t\t\tcaption: captionBinding,\n\t\t\t} = metadata?.bindings || {};\n\t\t\tconst hasParentPattern = !! context[ 'pattern/overrides' ];\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?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: urlBinding?.args,\n\t\t\t\t\t} ),\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 || arePatternOverridesEnabled,\n\t\t\t\thideCaptionControls: !! captionBinding,\n\t\t\t\tlockAltControls:\n\t\t\t\t\t!! altBinding &&\n\t\t\t\t\t! altBindingSource?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: altBinding?.args,\n\t\t\t\t\t} ),\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?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: titleBinding?.args,\n\t\t\t\t\t} ),\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[\n\t\t\tarePatternOverridesEnabled,\n\t\t\tcontext,\n\t\t\tisSingleSelected,\n\t\t\tmetadata?.bindings,\n\t\t]\n\t);\n\n\tconst showUrlInput =\n\t\tisSingleSelected &&\n\t\t! isEditingImage &&\n\t\t! lockHrefControls &&\n\t\t! lockUrlControls;\n\n\tconst showCoverControls =\n\t\tisSingleSelected && canInsertCover && ! isContentOnlyMode;\n\n\tconst showBlockControls = showUrlInput || allowCrop || showCoverControls;\n\n\tconst mediaReplaceFlow = isSingleSelected &&\n\t\t! isEditingImage &&\n\t\t! lockUrlControls && (\n\t\t\t// For contentOnly mode, put this button in its own area so it has borders around it.\n\t\t\t<BlockControls group={ isContentOnlyMode ? 'inline' : 'other' }>\n\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\tmediaId={ id }\n\t\t\t\t\tmediaURL={ url }\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\tname={ ! url ? __( 'Add image' ) : __( 'Replace' ) }\n\t\t\t\t\tonReset={ () => onSelectImage( undefined ) }\n\t\t\t\t\tvariant=\"toolbar\"\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t);\n\n\tconst hasDataFormBlockFields =\n\t\twindow?.__experimentalContentOnlyInspectorFields;\n\n\tconst controls = (\n\t\t<>\n\t\t\t{ showBlockControls && (\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t{ showUrlInput && (\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\t{ allowCrop && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\topenImageMediaEditorModal\n\t\t\t\t\t\t\t\t\t? openImageMediaEditorModal\n\t\t\t\t\t\t\t\t\t: () => setIsEditingImage( true )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-haspopup={\n\t\t\t\t\t\t\t\topenImageMediaEditorModal ? 'dialog' : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticon={ crop }\n\t\t\t\t\t\t\tlabel={ __( 'Crop' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showCoverControls && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\ticon={ overlayText }\n\t\t\t\t\t\t\tlabel={ __( 'Add text over image' ) }\n\t\t\t\t\t\t\tonClick={ switchToCover }\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{ 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=\"block\">\n\t\t\t\t\t<ContentOnlyControls\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tlockAltControls={ lockAltControls }\n\t\t\t\t\t\tlockAltControlsMessage={ lockAltControlsMessage }\n\t\t\t\t\t\tlockTitleControls={ lockTitleControls }\n\t\t\t\t\t\tlockTitleControlsMessage={ lockTitleControlsMessage }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ ! hasDataFormBlockFields && isSingleSelected && (\n\t\t\t\t<InspectorControls group=\"content\">\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Media' ) }\n\t\t\t\t\t\tresetAll={ () => onSelectImage( undefined ) }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! lockUrlControls && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Image' ) }\n\t\t\t\t\t\t\t\thasValue={ () => !! url }\n\t\t\t\t\t\t\t\tonDeselect={ () => onSelectImage( undefined ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<MediaControl\n\t\t\t\t\t\t\t\t\tmediaId={ id }\n\t\t\t\t\t\t\t\t\tmediaUrl={ url }\n\t\t\t\t\t\t\t\t\talt={ alt }\n\t\t\t\t\t\t\t\t\tfilename={\n\t\t\t\t\t\t\t\t\t\timage?.media_details?.sizes?.full\n\t\t\t\t\t\t\t\t\t\t\t?.file ||\n\t\t\t\t\t\t\t\t\t\timage?.slug ||\n\t\t\t\t\t\t\t\t\t\tgetFilename( url )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\t\t\t\tonReset={ () => onSelectImage( undefined ) }\n\t\t\t\t\t\t\t\t\tisUploading={ isUploading }\n\t\t\t\t\t\t\t\t\temptyLabel={ __( 'Add image' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<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\n\t\t\t\t\t\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Describe the purpose of the image.'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Leave empty if decorative.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<InspectorControls\n\t\t\t\tgroup=\"dimensions\"\n\t\t\t\tresetAllFilter={ ( attrs ) => ( {\n\t\t\t\t\t...attrs,\n\t\t\t\t\taspectRatio: undefined,\n\t\t\t\t\twidth: undefined,\n\t\t\t\t\theight: undefined,\n\t\t\t\t\tscale: undefined,\n\t\t\t\t\tfocalPoint: undefined,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t{ dimensionsControl }\n\t\t\t\t{ url && scale && (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! focalPoint }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tfocalPoint: undefined,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<FocalPointPicker\n\t\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\tvalue={ focalPoint }\n\t\t\t\t\t\t\tonDragStart={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\tonDrag={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\tonChange={ ( newFocalPoint ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tfocalPoint: newFocalPoint,\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</ToolsPanelItem>\n\t\t\t\t) }\n\t\t\t</InspectorControls>\n\t\t\t{ !! imageSizeOptions.length && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\t\tresetAll={ resetSettings }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ResolutionTool\n\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\tdefaultValue={ DEFAULT_MEDIA_SIZE_SLUG }\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</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<TextControl\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\tcreateInterpolateElement(\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. <a>(Note: many devices and browsers do not display this text.)</a>'\n\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\ta: (\n\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),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</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\tconst { postType, postId, queryId } = context;\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\n\tlet img =\n\t\ttemporaryURL && hasImageErrored ? (\n\t\t\t// Show a placeholder during upload when the blob URL can't be loaded. This can\n\t\t\t// happen when the user uploads a HEIC image in a browser that doesn't support them.\n\t\t\t<Placeholder\n\t\t\t\tclassName=\"wp-block-image__placeholder\"\n\t\t\t\twithIllustration\n\t\t\t>\n\t\t\t\t<Spinner />\n\t\t\t</Placeholder>\n\t\t) : (\n\t\t\t<>\n\t\t\t\t<img\n\t\t\t\t\tsrc={ temporaryURL || url }\n\t\t\t\t\talt={ defaultedAlt }\n\t\t\t\t\tonError={ onImageError }\n\t\t\t\t\tonLoad={ onImageLoad }\n\t\t\t\t\tref={ setRefs }\n\t\t\t\t\tclassName={ borderProps.className }\n\t\t\t\t\twidth={ naturalWidth }\n\t\t\t\t\theight={ naturalHeight }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\taspectRatio,\n\t\t\t\t\t\t...( resizeDelta\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\twidth: pixelSize.width + resizeDelta.width,\n\t\t\t\t\t\t\t\t\theight:\n\t\t\t\t\t\t\t\t\t\tpixelSize.height + resizeDelta.height,\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t: { width, height } ),\n\t\t\t\t\t\tobjectFit: scale,\n\t\t\t\t\t\tobjectPosition:\n\t\t\t\t\t\t\tfocalPoint && scale\n\t\t\t\t\t\t\t\t? mediaPosition( focalPoint )\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t\t...shadowProps.style,\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t{ isUploading && <Spinner /> }\n\t\t\t</>\n\t\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\t{ ...pixelSize }\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 {\n\t\timg = <ImageWrapper href={ href }>{ img }</ImageWrapper>;\n\t}\n\n\tlet resizableBox;\n\tif (\n\t\tisResizable &&\n\t\tisSingleSelected &&\n\t\t! isEditingImage &&\n\t\t! isUploading &&\n\t\t! SIZED_LAYOUTS.includes( parentLayoutType )\n\t) {\n\t\tconst numericRatio = aspectRatio && evalAspectRatio( aspectRatio );\n\t\tconst customRatio = pixelSize.width / pixelSize.height;\n\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\tconst ratio = numericRatio || customRatio || naturalRatio || 1;\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\t\tconst maxResizeWidth = maxContentWidth || maxWidthBuffer;\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\tresizableBox = (\n\t\t\t<ResizableBox\n\t\t\t\tref={ effectResizeableBoxPlacement }\n\t\t\t\tstyle={ {\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t// To match the vertical-align: bottom of the img (from style.scss)\n\t\t\t\t\t// syncs the top with the img. This matters when the img height is\n\t\t\t\t\t// less than the line-height.\n\t\t\t\t\tinset: `${ offsetTop }px 0 0 0`,\n\t\t\t\t} }\n\t\t\t\tsize={ pixelSize }\n\t\t\t\tminWidth={ minWidth }\n\t\t\t\tmaxWidth={ maxResizeWidth }\n\t\t\t\tminHeight={ minHeight }\n\t\t\t\tmaxHeight={ maxResizeWidth / 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={ () => {\n\t\t\t\t\ttoggleSelection( false );\n\t\t\t\t} }\n\t\t\t\tonResize={ ( event, direction, elt, delta ) => {\n\t\t\t\t\tsetResizeDelta( delta );\n\t\t\t\t} }\n\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\ttoggleSelection( true );\n\t\t\t\t\tsetResizeDelta( null );\n\t\t\t\t\tsetPixelSize( ( current ) => ( {\n\t\t\t\t\t\twidth: current.width + delta.width,\n\t\t\t\t\t\theight: current.height + delta.height,\n\t\t\t\t\t} ) );\n\n\t\t\t\t\t// Clear hardcoded width if the resized width is close to the max-content width.\n\t\t\t\t\tif (\n\t\t\t\t\t\tmaxContentWidth &&\n\t\t\t\t\t\t// Only do this if the image is bigger than the container to prevent it from being squished.\n\t\t\t\t\t\t// TODO: Remove this check if the image support setting 100% width.\n\t\t\t\t\t\tnaturalWidth >= maxContentWidth &&\n\t\t\t\t\t\tMath.abs( elt.offsetWidth - maxContentWidth ) < 10\n\t\t\t\t\t) {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\twidth: undefined,\n\t\t\t\t\t\t\theight: undefined,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\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);\n\t}\n\n\tif ( ! url && ! temporaryURL ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ mediaReplaceFlow }\n\t\t\t\t{ controls }\n\t\t\t</>\n\t\t);\n\t}\n\n\t/**\n\t * Set the post's featured image with the current image.\n\t */\n\tconst setPostFeatureImage = () => {\n\t\teditEntityRecord( 'postType', postType, postId, {\n\t\t\tfeatured_media: id,\n\t\t} );\n\t\tcreateSuccessNotice( __( 'Post featured image updated.' ), {\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t};\n\n\tconst featuredImageControl =\n\t\t! isDescendentOfQueryLoop && postId && id ? (\n\t\t\t<BlockSettingsMenuControls>\n\t\t\t\t{ ( { canEdit, selectedClientIds } ) =>\n\t\t\t\t\tcanEdit &&\n\t\t\t\t\tselectedClientIds.length === 1 &&\n\t\t\t\t\tclientId === selectedClientIds[ 0 ] && (\n\t\t\t\t\t\t<MenuItem onClick={ setPostFeatureImage }>\n\t\t\t\t\t\t\t{ __( 'Set as featured image' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t</BlockSettingsMenuControls>\n\t\t) : null;\n\n\treturn (\n\t\t<>\n\t\t\t{ mediaReplaceFlow }\n\t\t\t{ controls }\n\t\t\t{ featuredImageControl }\n\t\t\t{ img }\n\t\t\t{ resizableBox }\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={\n\t\t\t\t\tisSingleSelected &&\n\t\t\t\t\t( hasNonContentControls || isContentOnlyMode ) &&\n\t\t\t\t\t! hideCaptionControls\n\t\t\t\t}\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA0B;AAC1B,wBAiBO;AACP,qBAIO;AACP,kBAAuC;AACvC,0BAYO;AACP,qBAMO;AACP,kBAAuC;AACvC,iBAA4B;AAC5B,oBAA0D;AAC1D,mBAAuD;AACvD,qBAAsC;AACtC,uBAAmC;AAKnC,yBAAuB;AACvB,kBAAyC;AACzC,kBAAgC;AAChC,qBAAwB;AACxB,2BAA6B;AAC7B,mBAA+C;AAC/C,+CAA6C;AAC7C,uBAKO;AACP,mBAA+C;AA6B7C;AA3BF,IAAM,EAAE,gBAAgB,gBAAgB,aAAa,QAAI;AAAA,EACxD,oBAAAA;AACD;AAEA,IAAM,eAAe;AAAA,EACpB;AAAA,IACC,OAAO;AAAA,IACP,WAAO,gBAAI,SAAS,qCAAsC;AAAA,IAC1D,UAAM,gBAAI,gCAAiC;AAAA,EAC5C;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,WAAO,gBAAI,WAAW,qCAAsC;AAAA,IAC5D,UAAM,gBAAI,wCAAyC;AAAA,EACpD;AACD;AAEA,IAAM,0BAA0B;AAAA,EAC/B,WAAW;AACZ;AAGA,IAAM,eAAe,CAAE,EAAE,MAAM,SAAS,MAAO;AAC9C,MAAK,CAAE,MAAO;AACb,WAAO;AAAA,EACR;AACA,SACC;AAAA,IAAC;AAAA;AAAA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AAA,YACd,OAAO,GAAI,IAAI,WAAY;AAAA,YAC3B,QAAQ;AAAA,YACR,aACC,UAAU,eACP,SACA,OAAQ,KAAM;AAAA,UACnB,CAAE;AAAA,QACH;AAAA,QACA,aAAc,UAAU,WAAW,IAAI;AAAA;AAAA,IACxC;AAAA,EAEF;AAEA,MAAK,CAAE,OAAO,CAAE,cAAe;AAC9B,WACC,4EACG;AAAA;AAAA,MACA;AAAA,OACH;AAAA,EAEF;AAKA,QAAM,sBAAsB,MAAM;AACjC,qBAAkB,YAAY,UAAU,QAAQ;AAAA,MAC/C,gBAAgB;AAAA,IACjB,CAAE;AACF,4BAAqB,gBAAI,8BAA+B,GAAG;AAAA,MAC1D,MAAM;AAAA,IACP,CAAE;AAAA,EACH;AAEA,QAAM,uBACL,CAAE,2BAA2B,UAAU,KACtC,4CAAC,iDACE,WAAE,EAAE,SAAS,kBAAkB,MAChC,WACA,kBAAkB,WAAW,KAC7B,aAAa,kBAAmB,CAAE,KACjC,4CAAC,8BAAS,SAAU,qBACjB,8BAAI,uBAAwB,GAC/B,GAGH,IACG;AAEL,SACC,4EACG;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEF;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA,YAAa;AAAA,QACb;AAAA,QACA,WAAQ,gBAAI,oBAAqB;AAAA,QACjC,mBACC,qBACE,yBAAyB,sBAC3B,CAAE;AAAA;AAAA,IAEJ;AAAA,KACD;AAEF;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\tExternalLink,\n\tFocalPointPicker,\n\tResizableBox,\n\tSpinner,\n\tTextareaControl,\n\tTextControl,\n\tCheckboxControl,\n\tToolbarButton,\n\tToolbarGroup,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\tPlaceholder,\n\tMenuItem,\n\tToolbarItem,\n\tDropdownMenu,\n\tPopover,\n} from '@wordpress/components';\nimport {\n\tuseMergeRefs,\n\tuseResizeObserver,\n\tuseViewportMatch,\n} 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\tBlockSettingsMenuControls,\n} from '@wordpress/block-editor';\nimport {\n\tcreateInterpolateElement,\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseState,\n} from '@wordpress/element';\nimport { __, _x, sprintf, isRTL } from '@wordpress/i18n';\nimport { getFilename } from '@wordpress/url';\nimport { getBlockBindingsSource, switchToBlockType } from '@wordpress/blocks';\nimport { crop, overlayText, upload, chevronDown } 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';\nimport { MediaControl } from '../utils/media-control';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport { useOpenImageMediaEditorModal } from './use-open-image-media-editor-modal';\nimport {\n\tMIN_SIZE,\n\tALLOWED_MEDIA_TYPES,\n\tSIZED_LAYOUTS,\n\tDEFAULT_MEDIA_SIZE_SLUG,\n} from './constants';\nimport { evalAspectRatio, mediaPosition } from './utils';\n\nconst { DimensionsTool, ResolutionTool, mediaEditKey } = unlock(\n\tblockEditorPrivateApis\n);\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\nconst WRITEMODE_POPOVER_PROPS = {\n\tplacement: 'bottom-start',\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// and remove pointer events. Safari needs the display property.\n\t\t\t\tpointerEvents: 'none',\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\nfunction ContentOnlyControls( {\n\tattributes,\n\tsetAttributes,\n\tlockAltControls,\n\tlockAltControlsMessage,\n\tlockTitleControls,\n\tlockTitleControlsMessage,\n} ) {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst [ isAltDialogOpen, setIsAltDialogOpen ] = useState( false );\n\tconst [ isTitleDialogOpen, setIsTitleDialogOpen ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<ToolbarItem ref={ setPopoverAnchor }>\n\t\t\t\t{ ( toggleProps ) => (\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\tlabel={ __( 'More' ) }\n\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\t...toggleProps,\n\t\t\t\t\t\t\tdescription: __( 'Displays more controls.' ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tpopoverProps={ WRITEMODE_POPOVER_PROPS }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetIsAltDialogOpen( true );\n\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ _x(\n\t\t\t\t\t\t\t\t\t\t'Alternative text',\n\t\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\t) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetIsTitleDialogOpen( true );\n\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Title text' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t) }\n\t\t\t</ToolbarItem>\n\t\t\t{ isAltDialogOpen && (\n\t\t\t\t<Popover\n\t\t\t\t\tplacement=\"bottom-start\"\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tonClose={ () => setIsAltDialogOpen( false ) }\n\t\t\t\t\toffset={ 13 }\n\t\t\t\t\tvariant=\"toolbar\"\n\t\t\t\t>\n\t\t\t\t\t<div className=\"wp-block-image__toolbar_content_textarea__container\">\n\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\tclassName=\"wp-block-image__toolbar_content_textarea\"\n\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\tvalue={ attributes.alt || '' }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { alt: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisabled={ lockAltControls }\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tlockAltControls ? (\n\t\t\t\t\t\t\t\t\t<>{ lockAltControlsMessage }</>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t\t\t\t\t)\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\t\t{ __(\n\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) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t{ __( 'Leave empty if decorative.' ) }\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</div>\n\t\t\t\t</Popover>\n\t\t\t) }\n\t\t\t{ isTitleDialogOpen && (\n\t\t\t\t<Popover\n\t\t\t\t\tplacement=\"bottom-start\"\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tonClose={ () => setIsTitleDialogOpen( false ) }\n\t\t\t\t\toffset={ 13 }\n\t\t\t\t\tvariant=\"toolbar\"\n\t\t\t\t>\n\t\t\t\t\t<div className=\"wp-block-image__toolbar_content_textarea__container\">\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tclassName=\"wp-block-image__toolbar_content_textarea\"\n\t\t\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\t\t\tvalue={ attributes.title || '' }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\ttitle: value,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisabled={ lockTitleControls }\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tlockTitleControls ? (\n\t\t\t\t\t\t\t\t\t<>{ lockTitleControlsMessage }</>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\tcreateInterpolateElement(\n\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t'Describe the role of this image on the page. <a>(Note: many devices and browsers do not display this text.)</a>'\n\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\t\ta: (\n\t\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),\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</div>\n\t\t\t\t</Popover>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default function Image( {\n\ttemporaryURL,\n\tisSideloading,\n\tattributes,\n\tsetAttributes,\n\tisSingleSelected,\n\tinsertBlocksAfter,\n\tonReplace,\n\tonSelectImage,\n\tonSelectURL,\n\tonUploadError,\n\tcontext,\n\tclientId,\n\tblockEditingMode,\n\tparentLayoutType,\n\tmaxContentWidth,\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\tfocalPoint,\n\t\tlinkTarget,\n\t\tsizeSlug,\n\t\tlightbox,\n\t\tmetadata,\n\t\tisDecorative,\n\t} = attributes;\n\tconst [ imageElement, setImageElement ] = useState();\n\tconst [ resizeDelta, setResizeDelta ] = useState( null );\n\tconst [ pixelSize, setPixelSize ] = useState( {} );\n\tconst [ offsetTop, setOffsetTop ] = useState( 0 );\n\tconst setResizeObserved = useResizeObserver( ( [ entry ] ) => {\n\t\tif ( ! resizeDelta ) {\n\t\t\tconst [ box ] = entry.borderBoxSize;\n\t\t\tsetPixelSize( { width: box.inlineSize, height: box.blockSize } );\n\t\t}\n\t\t// This is usually 0 unless the image height is less than the line-height.\n\t\tsetOffsetTop( entry.target.offsetTop );\n\t} );\n\tconst effectResizeableBoxPlacement = useCallback( () => {\n\t\tsetOffsetTop( imageElement?.offsetTop ?? 0 );\n\t}, [ imageElement ] );\n\tconst setRefs = useMergeRefs( [ setImageElement, setResizeObserved ] );\n\tconst { allowResize = true } = context;\n\n\tconst { image, attachmentResolutionError } = useSelect(\n\t\t( select ) => {\n\t\t\tconst imageRecord =\n\t\t\t\tid && isSingleSelected\n\t\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t{ context: 'view' }\n\t\t\t\t\t )\n\t\t\t\t\t: null;\n\n\t\t\t// Check if the attachment resolution failed with a specific error.\n\t\t\t// We use getResolutionError instead of hasFinishedResolution so we\n\t\t\t// can distinguish 404 (attachment doesn't exist) from transient\n\t\t\t// errors (500, 403, network) that shouldn't clear the id.\n\t\t\tconst resolutionError =\n\t\t\t\tid && isSingleSelected\n\t\t\t\t\t? select( coreStore ).getResolutionError(\n\t\t\t\t\t\t\t'getEntityRecord',\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\t{ context: 'view' },\n\t\t\t\t\t\t\t]\n\t\t\t\t\t )\n\t\t\t\t\t: null;\n\n\t\t\treturn {\n\t\t\t\timage: imageRecord,\n\t\t\t\tattachmentResolutionError: resolutionError,\n\t\t\t};\n\t\t},\n\t\t[ id, isSingleSelected ]\n\t);\n\n\tconst {\n\t\tcanInsertCover,\n\t\timageEditing,\n\t\timageSizes,\n\t\tmaxWidth,\n\t\teditMediaEntity,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, canInsertBlockType, getSettings } =\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\teditMediaEntity: settings?.[ mediaEditKey ],\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\tconst { getBlock, getSettings } = useSelect( blockEditorStore );\n\tconst openImageMediaEditorModal = useOpenImageMediaEditorModal( {\n\t\tattributes,\n\t\tsetAttributes,\n\t} );\n\n\tconst {\n\t\treplaceBlocks,\n\t\ttoggleSelection,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t} = useDispatch( blockEditorStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\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 [ hasImageErrored, setHasImageErrored ] = useState( false );\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\tconst isContentOnlyMode = blockEditingMode === 'contentOnly';\n\tconst showDimensionsControls = allowResize && hasNonContentControls;\n\tconst isResizable =\n\t\tallowResize &&\n\t\thasNonContentControls &&\n\t\t! isWideAligned &&\n\t\tisLargeViewport;\n\t// An image is uploading if it has a temporary blob URL, or if it is\n\t// being processed client-side (e.g. transcoded or generating sub-sizes).\n\tconst isUploading = !! temporaryURL || isSideloading;\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 the image has an id but the attachment doesn't exist on this site,\n\t// clear the id so Gutenberg treats the image as external.\n\t// This handles content copied between WordPress sites.\n\t//\n\t// Known limitation: if a different attachment with the same id happens to\n\t// exist on the destination site, the lookup will succeed and the wrong\n\t// local image will be used. URL matching could address this in a follow-up.\n\t// See: https://github.com/WordPress/gutenberg/issues/74156\n\tuseEffect( () => {\n\t\tif ( ! id || ! isSingleSelected ) {\n\t\t\treturn;\n\t\t}\n\t\t// Only clear for confirmed 404s. apiFetch throws the Response object\n\t\t// for HTTP errors, so checking .status === 404 avoids incorrectly\n\t\t// clearing the id on 403, 500, or network failures, which would\n\t\t// cause data loss for valid local attachments.\n\t\tif ( attachmentResolutionError?.status === 404 ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { id: undefined } );\n\t\t}\n\t}, [\n\t\tid,\n\t\tisSingleSelected,\n\t\tattachmentResolutionError,\n\t\tsetAttributes,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t] );\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, getSettings ] );\n\n\t// Get naturalWidth and naturalHeight from image, 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\timageElement?.naturalWidth || loadedNaturalWidth || undefined,\n\t\t\tnaturalHeight:\n\t\t\t\timageElement?.naturalHeight || loadedNaturalHeight || undefined,\n\t\t};\n\t}, [ loadedNaturalWidth, loadedNaturalHeight, imageElement?.complete ] );\n\n\tfunction onImageError() {\n\t\tsetHasImageErrored( true );\n\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\t\tif ( undefined !== embedBlock ) {\n\t\t\tonReplace( embedBlock );\n\t\t}\n\t}\n\n\tfunction onImageLoad( event ) {\n\t\tsetHasImageErrored( false );\n\t\tsetLoadedNaturalSize( {\n\t\t\tloadedNaturalWidth: event.target?.naturalWidth,\n\t\t\tloadedNaturalHeight: event.target?.naturalHeight,\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\tisDecorative: false,\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 updateIsDecorative( value ) {\n\t\tsetAttributes( {\n\t\t\tisDecorative: value || undefined,\n\t\t\t...( value && {\n\t\t\t\talt: '',\n\t\t\t\tcaption: undefined,\n\t\t\t\thref: undefined,\n\t\t\t\tlinkDestination: undefined,\n\t\t\t\tlinkTarget: undefined,\n\t\t\t\trel: undefined,\n\t\t\t} ),\n\t\t} );\n\t}\n\n\tconst imperativeFocalPointPreview = ( value ) => {\n\t\tif ( imageElement ) {\n\t\t\timageElement.style.setProperty(\n\t\t\t\t'object-position',\n\t\t\t\tmediaPosition( value )\n\t\t\t);\n\t\t}\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\tlet notified = false;\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\t// With client-side media processing, onFileChange fires\n\t\t\t\t// for each generated sub-size. Only show the notice once.\n\t\t\t\tif ( ! notified ) {\n\t\t\t\t\tnotified = true;\n\t\t\t\t\tsetExternalBlob();\n\t\t\t\t\tcreateSuccessNotice( __( 'Image uploaded.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t} );\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 =\n\t\tid &&\n\t\tnaturalWidth &&\n\t\tnaturalHeight &&\n\t\timageEditing &&\n\t\t!! editMediaEntity;\n\tconst allowCrop =\n\t\tisSingleSelected &&\n\t\tcanEditImage &&\n\t\t! isEditingImage &&\n\t\t! isContentOnlyMode;\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 dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst dimensionsControl =\n\t\tshowDimensionsControls &&\n\t\t( SIZED_LAYOUTS.includes( parentLayoutType ) ? (\n\t\t\t<DimensionsTool\n\t\t\t\tpanelId={ clientId }\n\t\t\t\tvalue={ { aspectRatio } }\n\t\t\t\tonChange={ ( { aspectRatio: newAspectRatio } ) => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t\t\t\tscale: 'cover',\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tdefaultAspectRatio=\"auto\"\n\t\t\t\ttools={ [ 'aspectRatio' ] }\n\t\t\t/>\n\t\t) : (\n\t\t\t<DimensionsTool\n\t\t\t\tpanelId={ clientId }\n\t\t\t\tvalue={ { width, height, scale, aspectRatio } }\n\t\t\t\tonChange={ ( {\n\t\t\t\t\twidth: 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\t\t// Rebuilding the object forces setting `undefined`\n\t\t\t\t\t// for values that are removed since setAttributes\n\t\t\t\t\t// doesn't do anything with keys that aren't set.\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t// CSS includes `height: auto`, but we need\n\t\t\t\t\t\t// `width: auto` to fix the aspect ratio when\n\t\t\t\t\t\t// only height is set due to the width and\n\t\t\t\t\t\t// height attributes set via the server.\n\t\t\t\t\t\twidth: ! newWidth && newHeight ? 'auto' : newWidth,\n\t\t\t\t\t\theight: newHeight,\n\t\t\t\t\t\tscale: newScale,\n\t\t\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tdefaultScale=\"cover\"\n\t\t\t\tdefaultAspectRatio=\"auto\"\n\t\t\t\tscaleOptions={ scaleOptions }\n\t\t\t\tunitsOptions={ dimensionsUnitsOptions }\n\t\t\t\ttools={\n\t\t\t\t\tisWideAligned\n\t\t\t\t\t\t? [ 'aspectRatio', 'scale' ]\n\t\t\t\t\t\t: [ 'aspectRatio', 'widthHeight', 'scale' ]\n\t\t\t\t}\n\t\t\t/>\n\t\t) );\n\n\tconst resetSettings = () => {\n\t\tsetAttributes( {\n\t\t\tlightbox: undefined,\n\t\t} );\n\t\tupdateImage( DEFAULT_MEDIA_SIZE_SLUG );\n\t};\n\n\tconst arePatternOverridesEnabled =\n\t\tmetadata?.bindings?.__default?.source === 'core/pattern-overrides';\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\thideCaptionControls = 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 {\n\t\t\t\turl: urlBinding,\n\t\t\t\talt: altBinding,\n\t\t\t\ttitle: titleBinding,\n\t\t\t\tcaption: captionBinding,\n\t\t\t} = metadata?.bindings || {};\n\t\t\tconst hasParentPattern = !! context[ 'pattern/overrides' ];\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?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: urlBinding?.args,\n\t\t\t\t\t} ),\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 || arePatternOverridesEnabled,\n\t\t\t\thideCaptionControls: !! captionBinding,\n\t\t\t\tlockAltControls:\n\t\t\t\t\t!! altBinding &&\n\t\t\t\t\t! altBindingSource?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: altBinding?.args,\n\t\t\t\t\t} ),\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?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: titleBinding?.args,\n\t\t\t\t\t} ),\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[\n\t\t\tarePatternOverridesEnabled,\n\t\t\tcontext,\n\t\t\tisSingleSelected,\n\t\t\tmetadata?.bindings,\n\t\t]\n\t);\n\n\tconst showUrlInput =\n\t\tisSingleSelected &&\n\t\t! isEditingImage &&\n\t\t! lockHrefControls &&\n\t\t! lockUrlControls &&\n\t\t! isDecorative;\n\n\tconst showCoverControls =\n\t\tisSingleSelected && canInsertCover && ! isContentOnlyMode;\n\n\tconst showBlockControls = showUrlInput || allowCrop || showCoverControls;\n\n\tconst mediaReplaceFlow = isSingleSelected &&\n\t\t! isEditingImage &&\n\t\t! lockUrlControls && (\n\t\t\t// For contentOnly mode, put this button in its own area so it has borders around it.\n\t\t\t<BlockControls group={ isContentOnlyMode ? 'inline' : 'other' }>\n\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\tmediaId={ id }\n\t\t\t\t\tmediaURL={ url }\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\tname={ ! url ? __( 'Add image' ) : __( 'Replace' ) }\n\t\t\t\t\tonReset={ () => onSelectImage( undefined ) }\n\t\t\t\t\tvariant=\"toolbar\"\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t);\n\n\tconst hasDataFormBlockFields =\n\t\twindow?.__experimentalContentOnlyInspectorFields;\n\n\tconst controls = (\n\t\t<>\n\t\t\t{ showBlockControls && (\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t{ showUrlInput && (\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\t{ allowCrop && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\topenImageMediaEditorModal\n\t\t\t\t\t\t\t\t\t? openImageMediaEditorModal\n\t\t\t\t\t\t\t\t\t: () => setIsEditingImage( true )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-haspopup={\n\t\t\t\t\t\t\t\topenImageMediaEditorModal ? 'dialog' : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticon={ crop }\n\t\t\t\t\t\t\tlabel={ __( 'Crop' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showCoverControls && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\ticon={ overlayText }\n\t\t\t\t\t\t\tlabel={ __( 'Add text over image' ) }\n\t\t\t\t\t\t\tonClick={ switchToCover }\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{ 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=\"block\">\n\t\t\t\t\t<ContentOnlyControls\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tlockAltControls={ lockAltControls }\n\t\t\t\t\t\tlockAltControlsMessage={ lockAltControlsMessage }\n\t\t\t\t\t\tlockTitleControls={ lockTitleControls }\n\t\t\t\t\t\tlockTitleControlsMessage={ lockTitleControlsMessage }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ ! hasDataFormBlockFields && isSingleSelected && (\n\t\t\t\t<InspectorControls group=\"content\">\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Media' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tonSelectImage( undefined );\n\t\t\t\t\t\t\tsetAttributes( { isDecorative: false } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! lockUrlControls && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Image' ) }\n\t\t\t\t\t\t\t\thasValue={ () => !! url }\n\t\t\t\t\t\t\t\tonDeselect={ () => onSelectImage( undefined ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<MediaControl\n\t\t\t\t\t\t\t\t\tmediaId={ id }\n\t\t\t\t\t\t\t\t\tmediaUrl={ url }\n\t\t\t\t\t\t\t\t\talt={ alt }\n\t\t\t\t\t\t\t\t\tfilename={\n\t\t\t\t\t\t\t\t\t\timage?.media_details?.sizes?.full\n\t\t\t\t\t\t\t\t\t\t\t?.file ||\n\t\t\t\t\t\t\t\t\t\timage?.slug ||\n\t\t\t\t\t\t\t\t\t\tgetFilename( url )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\t\t\t\tonReset={ () => onSelectImage( undefined ) }\n\t\t\t\t\t\t\t\t\tisUploading={ isUploading }\n\t\t\t\t\t\t\t\t\temptyLabel={ __( 'Add image' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isDecorative && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => !! alt }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { alt: undefined } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\t\tvalue={ alt || '' }\n\t\t\t\t\t\t\t\t\tonChange={ updateAlt }\n\t\t\t\t\t\t\t\t\treadOnly={ lockAltControls }\n\t\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\t\tlockAltControls ? (\n\t\t\t\t\t\t\t\t\t\t\t<>{ lockAltControlsMessage }</>\n\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Describe the purpose of the image.'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t{ ! lockAltControls && ! lightboxChecked && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Mark as decorative' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => !! isDecorative }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { isDecorative: false } )\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<CheckboxControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Mark as decorative' ) }\n\t\t\t\t\t\t\t\t\tchecked={ !! isDecorative }\n\t\t\t\t\t\t\t\t\tonChange={ updateIsDecorative }\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Hidden from assistive technologies.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<InspectorControls\n\t\t\t\tgroup=\"dimensions\"\n\t\t\t\tresetAllFilter={ ( attrs ) => ( {\n\t\t\t\t\t...attrs,\n\t\t\t\t\taspectRatio: undefined,\n\t\t\t\t\twidth: undefined,\n\t\t\t\t\theight: undefined,\n\t\t\t\t\tscale: undefined,\n\t\t\t\t\tfocalPoint: undefined,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t{ dimensionsControl }\n\t\t\t\t{ url && scale && (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! focalPoint }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tfocalPoint: undefined,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<FocalPointPicker\n\t\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\tvalue={ focalPoint }\n\t\t\t\t\t\t\tonDragStart={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\tonDrag={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\tonChange={ ( newFocalPoint ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tfocalPoint: newFocalPoint,\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</ToolsPanelItem>\n\t\t\t\t) }\n\t\t\t</InspectorControls>\n\t\t\t{ !! imageSizeOptions.length && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\t\tresetAll={ resetSettings }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ResolutionTool\n\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\tdefaultValue={ DEFAULT_MEDIA_SIZE_SLUG }\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</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<TextControl\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\tcreateInterpolateElement(\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. <a>(Note: many devices and browsers do not display this text.)</a>'\n\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\ta: (\n\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),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\n\tconst filename = getFilename( url );\n\tlet defaultedAlt;\n\n\tif ( isDecorative ) {\n\t\tdefaultedAlt = filename\n\t\t\t? sprintf(\n\t\t\t\t\t/* translators: %s: file name */\n\t\t\t\t\t__(\n\t\t\t\t\t\t'This image has been marked as decorative; its file name is %s'\n\t\t\t\t\t),\n\t\t\t\t\tfilename\n\t\t\t )\n\t\t\t: __( 'This image has been marked as decorative.' );\n\t} else if ( 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\tconst { postType, postId, queryId } = context;\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\n\tlet img =\n\t\ttemporaryURL && hasImageErrored ? (\n\t\t\t// Show a placeholder during upload when the blob URL can't be loaded. This can\n\t\t\t// happen when the user uploads a HEIC image in a browser that doesn't support them.\n\t\t\t<Placeholder\n\t\t\t\tclassName=\"wp-block-image__placeholder\"\n\t\t\t\twithIllustration\n\t\t\t>\n\t\t\t\t<Spinner />\n\t\t\t</Placeholder>\n\t\t) : (\n\t\t\t<>\n\t\t\t\t<img\n\t\t\t\t\tsrc={ temporaryURL || url }\n\t\t\t\t\talt={ defaultedAlt }\n\t\t\t\t\tonError={ onImageError }\n\t\t\t\t\tonLoad={ onImageLoad }\n\t\t\t\t\tref={ setRefs }\n\t\t\t\t\tclassName={ borderProps.className }\n\t\t\t\t\twidth={ naturalWidth }\n\t\t\t\t\theight={ naturalHeight }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\taspectRatio,\n\t\t\t\t\t\t...( resizeDelta\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\twidth: pixelSize.width + resizeDelta.width,\n\t\t\t\t\t\t\t\t\theight:\n\t\t\t\t\t\t\t\t\t\tpixelSize.height + resizeDelta.height,\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t: ( () => {\n\t\t\t\t\t\t\t\t\tconst style = {};\n\t\t\t\t\t\t\t\t\tif ( width === 'auto' ) {\n\t\t\t\t\t\t\t\t\t\tstyle.width = 'auto';\n\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\twidth !== undefined &&\n\t\t\t\t\t\t\t\t\t\twidth !== null\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\tstyle.width =\n\t\t\t\t\t\t\t\t\t\t\ttypeof width === 'number'\n\t\t\t\t\t\t\t\t\t\t\t\t? `${ width }px`\n\t\t\t\t\t\t\t\t\t\t\t\t: width;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\theight === 'auto' ||\n\t\t\t\t\t\t\t\t\t\theight === undefined ||\n\t\t\t\t\t\t\t\t\t\theight === null\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\tstyle.height = 'auto';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tstyle.height =\n\t\t\t\t\t\t\t\t\t\t\ttypeof height === 'number'\n\t\t\t\t\t\t\t\t\t\t\t\t? `${ height }px`\n\t\t\t\t\t\t\t\t\t\t\t\t: height;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn style;\n\t\t\t\t\t\t\t } )() ),\n\t\t\t\t\t\tobjectFit: scale,\n\t\t\t\t\t\tobjectPosition:\n\t\t\t\t\t\t\tfocalPoint && scale\n\t\t\t\t\t\t\t\t? mediaPosition( focalPoint )\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t\t...shadowProps.style,\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t{ isUploading && <Spinner /> }\n\t\t\t</>\n\t\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\t{ ...pixelSize }\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 {\n\t\timg = <ImageWrapper href={ href }>{ img }</ImageWrapper>;\n\t}\n\n\tlet resizableBox;\n\tif (\n\t\tisResizable &&\n\t\tisSingleSelected &&\n\t\t! isEditingImage &&\n\t\t! isUploading &&\n\t\t! SIZED_LAYOUTS.includes( parentLayoutType )\n\t) {\n\t\tconst numericRatio = aspectRatio && evalAspectRatio( aspectRatio );\n\t\tconst customRatio = pixelSize.width / pixelSize.height;\n\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\tconst ratio = numericRatio || customRatio || naturalRatio || 1;\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\t\tconst maxResizeWidth = maxContentWidth || maxWidthBuffer;\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\tresizableBox = (\n\t\t\t<ResizableBox\n\t\t\t\tref={ effectResizeableBoxPlacement }\n\t\t\t\tstyle={ {\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t// To match the vertical-align: bottom of the img (from style.scss)\n\t\t\t\t\t// syncs the top with the img. This matters when the img height is\n\t\t\t\t\t// less than the line-height.\n\t\t\t\t\tinset: `${ offsetTop }px 0 0 0`,\n\t\t\t\t} }\n\t\t\t\tsize={ pixelSize }\n\t\t\t\tminWidth={ minWidth }\n\t\t\t\tmaxWidth={ maxResizeWidth }\n\t\t\t\tminHeight={ minHeight }\n\t\t\t\tmaxHeight={ maxResizeWidth / 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={ () => {\n\t\t\t\t\ttoggleSelection( false );\n\t\t\t\t} }\n\t\t\t\tonResize={ ( event, direction, elt, delta ) => {\n\t\t\t\t\tsetResizeDelta( delta );\n\t\t\t\t} }\n\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\ttoggleSelection( true );\n\t\t\t\t\tsetResizeDelta( null );\n\t\t\t\t\tsetPixelSize( ( current ) => ( {\n\t\t\t\t\t\twidth: current.width + delta.width,\n\t\t\t\t\t\theight: current.height + delta.height,\n\t\t\t\t\t} ) );\n\n\t\t\t\t\t// Clear hardcoded width if the resized width is close to the max-content width.\n\t\t\t\t\tif (\n\t\t\t\t\t\tmaxContentWidth &&\n\t\t\t\t\t\t// Only do this if the image is bigger than the container to prevent it from being squished.\n\t\t\t\t\t\t// TODO: Remove this check if the image support setting 100% width.\n\t\t\t\t\t\tnaturalWidth >= maxContentWidth &&\n\t\t\t\t\t\tMath.abs( elt.offsetWidth - maxContentWidth ) < 10\n\t\t\t\t\t) {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\twidth: undefined,\n\t\t\t\t\t\t\theight: undefined,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\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);\n\t}\n\n\tif ( ! url && ! temporaryURL ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ mediaReplaceFlow }\n\t\t\t\t{ controls }\n\t\t\t</>\n\t\t);\n\t}\n\n\t/**\n\t * Set the post's featured image with the current image.\n\t */\n\tconst setPostFeatureImage = () => {\n\t\teditEntityRecord( 'postType', postType, postId, {\n\t\t\tfeatured_media: id,\n\t\t} );\n\t\tcreateSuccessNotice( __( 'Post featured image updated.' ), {\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t};\n\n\tconst featuredImageControl =\n\t\t! isDescendentOfQueryLoop && postId && id ? (\n\t\t\t<BlockSettingsMenuControls>\n\t\t\t\t{ ( { canEdit, selectedClientIds } ) =>\n\t\t\t\t\tcanEdit &&\n\t\t\t\t\tselectedClientIds.length === 1 &&\n\t\t\t\t\tclientId === selectedClientIds[ 0 ] && (\n\t\t\t\t\t\t<MenuItem onClick={ setPostFeatureImage }>\n\t\t\t\t\t\t\t{ __( 'Set as featured image' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t</BlockSettingsMenuControls>\n\t\t) : null;\n\n\treturn (\n\t\t<>\n\t\t\t{ mediaReplaceFlow }\n\t\t\t{ controls }\n\t\t\t{ featuredImageControl }\n\t\t\t{ img }\n\t\t\t{ resizableBox }\n\n\t\t\t{ ! isDecorative && (\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSingleSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Image caption text' ) }\n\t\t\t\t\tshowToolbarButton={\n\t\t\t\t\t\tisSingleSelected &&\n\t\t\t\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AAAA,MAC/C,gBAAgB;AAAA,IACjB,CAAE;AACF,4BAAqB,gBAAI,8BAA+B,GAAG;AAAA,MAC1D,MAAM;AAAA,IACP,CAAE;AAAA,EACH;AAEA,QAAM,uBACL,CAAE,2BAA2B,UAAU,KACtC,4CAAC,iDACE,WAAE,EAAE,SAAS,kBAAkB,MAChC,WACA,kBAAkB,WAAW,KAC7B,aAAa,kBAAmB,CAAE,KACjC,4CAAC,8BAAS,SAAU,qBACjB,8BAAI,uBAAwB,GAC/B,GAGH,IACG;AAEL,SACC,4EACG;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA,CAAE,gBACH;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA,YAAa;AAAA,QACb;AAAA,QACA,WAAQ,gBAAI,oBAAqB;AAAA,QACjC,mBACC,qBACE,yBAAyB,sBAC3B,CAAE;AAAA;AAAA,IAEJ;AAAA,KAEF;AAEF;",
6
6
  "names": ["blockEditorPrivateApis", "coreStore", "getSettings", "blockEditorStore", "noticesStore", "img", "useCustomUnits", "ImageURLInputUI", "ToolsPanel", "ToolsPanelItem", "useBorderProps", "getShadowClassesAndStyles", "ImageEditor"]
7
7
  }
@@ -124,23 +124,42 @@ if (window.__experimentalContentOnlyInspectorFields) {
124
124
  href: value.url,
125
125
  rel: value.rel,
126
126
  linkTarget: value.linkTarget
127
- })
127
+ }),
128
+ isVisible: (item) => !item.isDecorative
128
129
  },
129
130
  {
130
131
  id: "caption",
131
132
  label: (0, import_i18n.__)("Caption"),
132
133
  type: "text",
133
- Edit: "rich-text"
134
+ Edit: "rich-text",
134
135
  // TODO: replace with custom component
136
+ isVisible: (item) => !item.isDecorative
135
137
  },
136
138
  {
137
139
  id: "alt",
138
140
  label: (0, import_i18n.__)("Alt text"),
139
- type: "text"
141
+ type: "text",
142
+ isVisible: (item) => !item.isDecorative
143
+ },
144
+ {
145
+ id: "isDecorative",
146
+ label: (0, import_i18n.__)("Mark as decorative"),
147
+ type: "boolean",
148
+ setValue: ({ value }) => ({
149
+ isDecorative: value || void 0,
150
+ ...value && {
151
+ alt: "",
152
+ caption: void 0,
153
+ href: void 0,
154
+ linkDestination: void 0,
155
+ linkTarget: void 0,
156
+ rel: void 0
157
+ }
158
+ })
140
159
  }
141
160
  ];
142
161
  settings[formKey] = {
143
- fields: ["image", "link", "caption", "alt"]
162
+ fields: ["image", "link", "caption", "alt", "isDecorative"]
144
163
  };
145
164
  }
146
165
  var init = () => (0, import_init_block.default)({ name, metadata: import_block.default, settings });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/image/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { image as icon } from '@wordpress/icons';\nimport { privateApis as blocksPrivateApis } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport { unlock } from '../lock-unlock';\n\nconst { fieldsKey, formKey } = unlock( blocksPrivateApis );\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tsizeSlug: 'large',\n\t\t\turl: 'https://s.w.org/images/core/5.3/MtBlanc1.jpg',\n\t\t\t// translators: Caption accompanying an image of the Mont Blanc, which serves as an example for the Image block.\n\t\t\tcaption: __( 'Mont Blanc appears\u2014still, snowy, and serene.' ),\n\t\t},\n\t},\n\t__experimentalLabel( attributes, { context } ) {\n\t\tconst customName = attributes?.metadata?.name;\n\n\t\tif (\n\t\t\t( context === 'list-view' || context === 'breadcrumb' ) &&\n\t\t\tcustomName\n\t\t) {\n\t\t\treturn customName;\n\t\t}\n\n\t\tif ( context === 'accessibility' ) {\n\t\t\tconst { caption, alt, url } = attributes;\n\n\t\t\tif ( ! url ) {\n\t\t\t\treturn __( 'Empty' );\n\t\t\t}\n\n\t\t\tif ( ! alt ) {\n\t\t\t\treturn caption || '';\n\t\t\t}\n\n\t\t\t// This is intended to be read by a screen reader.\n\t\t\t// A period simply means a pause, no need to translate it.\n\t\t\treturn alt + ( caption ? '. ' + caption : '' );\n\t\t}\n\t},\n\tgetEditWrapperProps( attributes ) {\n\t\treturn {\n\t\t\t'data-align': attributes.align,\n\t\t};\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nif ( window.__experimentalContentOnlyInspectorFields ) {\n\tsettings[ fieldsKey ] = [\n\t\t{\n\t\t\tid: 'image',\n\t\t\tlabel: __( 'Image' ),\n\t\t\ttype: 'media',\n\t\t\tEdit: {\n\t\t\t\tcontrol: 'media', // TODO: replace with custom component\n\t\t\t\tallowedTypes: [ 'image' ],\n\t\t\t\tmultiple: false,\n\t\t\t},\n\t\t\tgetValue: ( { item } ) => ( {\n\t\t\t\tid: item.id,\n\t\t\t\turl: item.url,\n\t\t\t\talt: item.alt,\n\t\t\t\tcaption: item.caption,\n\t\t\t} ),\n\t\t\tsetValue: ( { value } ) => ( {\n\t\t\t\tid: value.id,\n\t\t\t\turl: value.url,\n\t\t\t\talt: value.alt,\n\t\t\t\tcaption: value.caption,\n\t\t\t} ),\n\t\t},\n\t\t{\n\t\t\tid: 'link',\n\t\t\tlabel: __( 'Link' ),\n\t\t\ttype: 'url',\n\t\t\tEdit: 'link', // TODO: replace with custom component\n\t\t\tgetValue: ( { item } ) => ( {\n\t\t\t\turl: item.href,\n\t\t\t\trel: item.rel,\n\t\t\t\tlinkTarget: item.linkTarget,\n\t\t\t} ),\n\t\t\tsetValue: ( { value } ) => ( {\n\t\t\t\thref: value.url,\n\t\t\t\trel: value.rel,\n\t\t\t\tlinkTarget: value.linkTarget,\n\t\t\t} ),\n\t\t},\n\t\t{\n\t\t\tid: 'caption',\n\t\t\tlabel: __( 'Caption' ),\n\t\t\ttype: 'text',\n\t\t\tEdit: 'rich-text', // TODO: replace with custom component\n\t\t},\n\t\t{\n\t\t\tid: 'alt',\n\t\t\tlabel: __( 'Alt text' ),\n\t\t\ttype: 'text',\n\t\t},\n\t];\n\tsettings[ formKey ] = {\n\t\tfields: [ 'image', 'link', 'caption', 'alt' ],\n\t};\n}\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,mBAA8B;AAC9B,oBAAiD;AAKjD,wBAAsB;AACtB,wBAAuB;AACvB,kBAAiB;AACjB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AACvB,yBAAuB;AAEvB,IAAM,EAAE,WAAW,QAAQ,QAAI,2BAAQ,cAAAC,WAAkB;AAEzD,IAAM,EAAE,KAAK,IAAI,aAAAD;AAIV,IAAM,WAAW;AAAA,EACvB,mBAAAE;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX,UAAU;AAAA,MACV,KAAK;AAAA;AAAA,MAEL,aAAS,gBAAI,mDAA+C;AAAA,IAC7D;AAAA,EACD;AAAA,EACA,oBAAqB,YAAY,EAAE,QAAQ,GAAI;AAC9C,UAAM,aAAa,YAAY,UAAU;AAEzC,SACG,YAAY,eAAe,YAAY,iBACzC,YACC;AACD,aAAO;AAAA,IACR;AAEA,QAAK,YAAY,iBAAkB;AAClC,YAAM,EAAE,SAAS,KAAK,IAAI,IAAI;AAE9B,UAAK,CAAE,KAAM;AACZ,mBAAO,gBAAI,OAAQ;AAAA,MACpB;AAEA,UAAK,CAAE,KAAM;AACZ,eAAO,WAAW;AAAA,MACnB;AAIA,aAAO,OAAQ,UAAU,OAAO,UAAU;AAAA,IAC3C;AAAA,EACD;AAAA,EACA,oBAAqB,YAAa;AACjC,WAAO;AAAA,MACN,cAAc,WAAW;AAAA,IAC1B;AAAA,EACD;AAAA,EACA,8BAAAC;AAAA,EAC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AA,EAC7C;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { image as icon } from '@wordpress/icons';\nimport { privateApis as blocksPrivateApis } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport { unlock } from '../lock-unlock';\n\nconst { fieldsKey, formKey } = unlock( blocksPrivateApis );\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tsizeSlug: 'large',\n\t\t\turl: 'https://s.w.org/images/core/5.3/MtBlanc1.jpg',\n\t\t\t// translators: Caption accompanying an image of the Mont Blanc, which serves as an example for the Image block.\n\t\t\tcaption: __( 'Mont Blanc appears\u2014still, snowy, and serene.' ),\n\t\t},\n\t},\n\t__experimentalLabel( attributes, { context } ) {\n\t\tconst customName = attributes?.metadata?.name;\n\n\t\tif (\n\t\t\t( context === 'list-view' || context === 'breadcrumb' ) &&\n\t\t\tcustomName\n\t\t) {\n\t\t\treturn customName;\n\t\t}\n\n\t\tif ( context === 'accessibility' ) {\n\t\t\tconst { caption, alt, url } = attributes;\n\n\t\t\tif ( ! url ) {\n\t\t\t\treturn __( 'Empty' );\n\t\t\t}\n\n\t\t\tif ( ! alt ) {\n\t\t\t\treturn caption || '';\n\t\t\t}\n\n\t\t\t// This is intended to be read by a screen reader.\n\t\t\t// A period simply means a pause, no need to translate it.\n\t\t\treturn alt + ( caption ? '. ' + caption : '' );\n\t\t}\n\t},\n\tgetEditWrapperProps( attributes ) {\n\t\treturn {\n\t\t\t'data-align': attributes.align,\n\t\t};\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nif ( window.__experimentalContentOnlyInspectorFields ) {\n\tsettings[ fieldsKey ] = [\n\t\t{\n\t\t\tid: 'image',\n\t\t\tlabel: __( 'Image' ),\n\t\t\ttype: 'media',\n\t\t\tEdit: {\n\t\t\t\tcontrol: 'media', // TODO: replace with custom component\n\t\t\t\tallowedTypes: [ 'image' ],\n\t\t\t\tmultiple: false,\n\t\t\t},\n\t\t\tgetValue: ( { item } ) => ( {\n\t\t\t\tid: item.id,\n\t\t\t\turl: item.url,\n\t\t\t\talt: item.alt,\n\t\t\t\tcaption: item.caption,\n\t\t\t} ),\n\t\t\tsetValue: ( { value } ) => ( {\n\t\t\t\tid: value.id,\n\t\t\t\turl: value.url,\n\t\t\t\talt: value.alt,\n\t\t\t\tcaption: value.caption,\n\t\t\t} ),\n\t\t},\n\t\t{\n\t\t\tid: 'link',\n\t\t\tlabel: __( 'Link' ),\n\t\t\ttype: 'url',\n\t\t\tEdit: 'link', // TODO: replace with custom component\n\t\t\tgetValue: ( { item } ) => ( {\n\t\t\t\turl: item.href,\n\t\t\t\trel: item.rel,\n\t\t\t\tlinkTarget: item.linkTarget,\n\t\t\t} ),\n\t\t\tsetValue: ( { value } ) => ( {\n\t\t\t\thref: value.url,\n\t\t\t\trel: value.rel,\n\t\t\t\tlinkTarget: value.linkTarget,\n\t\t\t} ),\n\t\t\tisVisible: ( item ) => ! item.isDecorative,\n\t\t},\n\t\t{\n\t\t\tid: 'caption',\n\t\t\tlabel: __( 'Caption' ),\n\t\t\ttype: 'text',\n\t\t\tEdit: 'rich-text', // TODO: replace with custom component\n\t\t\tisVisible: ( item ) => ! item.isDecorative,\n\t\t},\n\t\t{\n\t\t\tid: 'alt',\n\t\t\tlabel: __( 'Alt text' ),\n\t\t\ttype: 'text',\n\t\t\tisVisible: ( item ) => ! item.isDecorative,\n\t\t},\n\t\t{\n\t\t\tid: 'isDecorative',\n\t\t\tlabel: __( 'Mark as decorative' ),\n\t\t\ttype: 'boolean',\n\t\t\tsetValue: ( { value } ) => ( {\n\t\t\t\tisDecorative: value || undefined,\n\t\t\t\t...( value && {\n\t\t\t\t\talt: '',\n\t\t\t\t\tcaption: undefined,\n\t\t\t\t\thref: undefined,\n\t\t\t\t\tlinkDestination: undefined,\n\t\t\t\t\tlinkTarget: undefined,\n\t\t\t\t\trel: undefined,\n\t\t\t\t} ),\n\t\t\t} ),\n\t\t},\n\t];\n\tsettings[ formKey ] = {\n\t\tfields: [ 'image', 'link', 'caption', 'alt', 'isDecorative' ],\n\t};\n}\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,mBAA8B;AAC9B,oBAAiD;AAKjD,wBAAsB;AACtB,wBAAuB;AACvB,kBAAiB;AACjB,mBAAqB;AACrB,kBAAiB;AACjB,wBAAuB;AACvB,yBAAuB;AAEvB,IAAM,EAAE,WAAW,QAAQ,QAAI,2BAAQ,cAAAC,WAAkB;AAEzD,IAAM,EAAE,KAAK,IAAI,aAAAD;AAIV,IAAM,WAAW;AAAA,EACvB,mBAAAE;AAAA,EACA,SAAS;AAAA,IACR,YAAY;AAAA,MACX,UAAU;AAAA,MACV,KAAK;AAAA;AAAA,MAEL,aAAS,gBAAI,mDAA+C;AAAA,IAC7D;AAAA,EACD;AAAA,EACA,oBAAqB,YAAY,EAAE,QAAQ,GAAI;AAC9C,UAAM,aAAa,YAAY,UAAU;AAEzC,SACG,YAAY,eAAe,YAAY,iBACzC,YACC;AACD,aAAO;AAAA,IACR;AAEA,QAAK,YAAY,iBAAkB;AAClC,YAAM,EAAE,SAAS,KAAK,IAAI,IAAI;AAE9B,UAAK,CAAE,KAAM;AACZ,mBAAO,gBAAI,OAAQ;AAAA,MACpB;AAEA,UAAK,CAAE,KAAM;AACZ,eAAO,WAAW;AAAA,MACnB;AAIA,aAAO,OAAQ,UAAU,OAAO,UAAU;AAA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WAAW,CAAE,SAAU,CAAE,KAAK;AAAA,IAC/B;AAAA,IACA;AAAA,MACC,IAAI;AAAA,MACJ,WAAO,gBAAI,UAAW;AAAA,MACtB,MAAM;AAAA,MACN,WAAW,CAAE,SAAU,CAAE,KAAK;AAAA,IAC/B;AAAA,IACA;AAAA,MACC,IAAI;AAAA,MACJ,WAAO,gBAAI,oBAAqB;AAAA,MAChC,MAAM;AAAA,MACN,UAAU,CAAE,EAAE,MAAM,OAAS;AAAA,QAC5B,cAAc,SAAS;AAAA,QACvB,GAAK,SAAS;AAAA,UACb,KAAK;AAAA,UACL,SAAS;AAAA,UACT,MAAM;AAAA,UACN,iBAAiB;AAAA,UACjB,YAAY;AAAA,UACZ,KAAK;AAAA,QACN;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACA,WAAU,OAAQ,IAAI;AAAA,IACrB,QAAQ,CAAE,SAAS,QAAQ,WAAW,OAAO,cAAe;AAAA,EAC7D;AACD;AAEO,IAAM,OAAO,UAAM,kBAAAC,SAAW,EAAE,MAAM,uBAAAC,SAAU,SAAS,CAAE;",
6
6
  "names": ["metadata", "blocksPrivateApis", "icon", "transforms", "edit", "save", "deprecated", "initBlock", "metadata"]
7
7
  }
@@ -55,6 +55,7 @@ function save({ attributes }) {
55
55
  linkTarget,
56
56
  sizeSlug,
57
57
  title,
58
+ isDecorative,
58
59
  metadata: { bindings = {} } = {}
59
60
  } = attributes;
60
61
  const newRel = !rel ? void 0 : rel;
@@ -77,16 +78,30 @@ function save({ attributes }) {
77
78
  src: url,
78
79
  alt,
79
80
  className: imageClasses || void 0,
80
- style: {
81
- ...borderProps.style,
82
- ...shadowProps.style,
83
- aspectRatio,
84
- objectFit: scale,
85
- objectPosition: focalPoint && scale ? (0, import_utils.mediaPosition)(focalPoint) : void 0,
86
- width,
87
- height
88
- },
89
- title
81
+ style: (() => {
82
+ const style = {
83
+ ...borderProps.style,
84
+ ...shadowProps.style,
85
+ aspectRatio,
86
+ objectFit: scale,
87
+ objectPosition: focalPoint && scale ? (0, import_utils.mediaPosition)(focalPoint) : void 0
88
+ };
89
+ if (width !== void 0 || height !== void 0) {
90
+ if (width === "auto") {
91
+ style.width = "auto";
92
+ } else if (width !== void 0 && width !== null) {
93
+ style.width = typeof width === "number" ? `${width}px` : width;
94
+ }
95
+ if (height === "auto" || height === void 0 || height === null) {
96
+ style.height = "auto";
97
+ } else {
98
+ style.height = typeof height === "number" ? `${height}px` : height;
99
+ }
100
+ }
101
+ return style;
102
+ })(),
103
+ title,
104
+ role: isDecorative ? "none" : void 0
90
105
  }
91
106
  );
92
107
  const displayCaption = !import_block_editor.RichText.isEmpty(caption) || bindings.caption || bindings?.__default?.source === "core/pattern-overrides";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/image/save.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tRichText,\n\tuseBlockProps,\n\t__experimentalGetElementClassName,\n\t__experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles,\n\t__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { mediaPosition } from './utils';\n\nexport default function save( { attributes } ) {\n\tconst {\n\t\turl,\n\t\talt,\n\t\tcaption,\n\t\talign,\n\t\thref,\n\t\trel,\n\t\tlinkClass,\n\t\twidth,\n\t\theight,\n\t\taspectRatio,\n\t\tscale,\n\t\tfocalPoint,\n\t\tid,\n\t\tlinkTarget,\n\t\tsizeSlug,\n\t\ttitle,\n\t\tmetadata: { bindings = {} } = {},\n\t} = attributes;\n\n\tconst newRel = ! rel ? undefined : rel;\n\tconst borderProps = getBorderClassesAndStyles( attributes );\n\tconst shadowProps = getShadowClassesAndStyles( attributes );\n\n\tconst classes = clsx( {\n\t\t// All other align classes are handled by block supports.\n\t\t// `{ align: 'none' }` is unique to transforms for the image block.\n\t\talignnone: 'none' === align,\n\t\t[ `size-${ sizeSlug }` ]: sizeSlug,\n\t\t'is-resized': width || height,\n\t\t'has-custom-border':\n\t\t\t!! borderProps.className ||\n\t\t\t( borderProps.style &&\n\t\t\t\tObject.keys( borderProps.style ).length > 0 ),\n\t} );\n\n\tconst imageClasses = clsx( borderProps.className, {\n\t\t[ `wp-image-${ id }` ]: !! id,\n\t} );\n\n\tconst image = (\n\t\t<img\n\t\t\tsrc={ url }\n\t\t\talt={ alt }\n\t\t\tclassName={ imageClasses || undefined }\n\t\t\tstyle={ {\n\t\t\t\t...borderProps.style,\n\t\t\t\t...shadowProps.style,\n\t\t\t\taspectRatio,\n\t\t\t\tobjectFit: scale,\n\t\t\t\tobjectPosition:\n\t\t\t\t\tfocalPoint && scale\n\t\t\t\t\t\t? mediaPosition( focalPoint )\n\t\t\t\t\t\t: undefined,\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t} }\n\t\t\ttitle={ title }\n\t\t/>\n\t);\n\n\tconst displayCaption =\n\t\t! RichText.isEmpty( caption ) ||\n\t\tbindings.caption ||\n\t\tbindings?.__default?.source === 'core/pattern-overrides';\n\n\tconst figure = (\n\t\t<>\n\t\t\t{ href ? (\n\t\t\t\t<a\n\t\t\t\t\tclassName={ linkClass }\n\t\t\t\t\thref={ href }\n\t\t\t\t\ttarget={ linkTarget }\n\t\t\t\t\trel={ newRel }\n\t\t\t\t>\n\t\t\t\t\t{ image }\n\t\t\t\t</a>\n\t\t\t) : (\n\t\t\t\timage\n\t\t\t) }\n\t\t\t{ displayCaption && (\n\t\t\t\t<RichText.Content\n\t\t\t\t\tclassName={ __experimentalGetElementClassName( 'caption' ) }\n\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\tvalue={ caption }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<figure { ...useBlockProps.save( { className: classes } ) }>\n\t\t\t{ figure }\n\t\t</figure>\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;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,WACT,UAAU,WAAW,WAAW;AAEjC,QAAM,SACL,4EACG;AAAA,WACD;AAAA,MAAC;AAAA;AAAA,QACA,WAAY;AAAA,QACZ;AAAA,QACA,QAAS;AAAA,QACT,KAAM;AAAA,QAEJ;AAAA;AAAA,IACH,IAEA;AAAA,IAEC,kBACD;AAAA,MAAC,6BAAS;AAAA,MAAT;AAAA,QACA,eAAY,uDAAmC,SAAU;AAAA,QACzD,SAAQ;AAAA,QACR,OAAQ;AAAA;AAAA,IACT;AAAA,KAEF;AAGD,SACC,4CAAC,YAAS,GAAG,kCAAc,KAAM,EAAE,WAAW,QAAQ,CAAE,GACrD,kBACH;AAEF;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tRichText,\n\tuseBlockProps,\n\t__experimentalGetElementClassName,\n\t__experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles,\n\t__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { mediaPosition } from './utils';\n\nexport default function save( { attributes } ) {\n\tconst {\n\t\turl,\n\t\talt,\n\t\tcaption,\n\t\talign,\n\t\thref,\n\t\trel,\n\t\tlinkClass,\n\t\twidth,\n\t\theight,\n\t\taspectRatio,\n\t\tscale,\n\t\tfocalPoint,\n\t\tid,\n\t\tlinkTarget,\n\t\tsizeSlug,\n\t\ttitle,\n\t\tisDecorative,\n\t\tmetadata: { bindings = {} } = {},\n\t} = attributes;\n\n\tconst newRel = ! rel ? undefined : rel;\n\tconst borderProps = getBorderClassesAndStyles( attributes );\n\tconst shadowProps = getShadowClassesAndStyles( attributes );\n\n\tconst classes = clsx( {\n\t\t// All other align classes are handled by block supports.\n\t\t// `{ align: 'none' }` is unique to transforms for the image block.\n\t\talignnone: 'none' === align,\n\t\t[ `size-${ sizeSlug }` ]: sizeSlug,\n\t\t'is-resized': width || height,\n\t\t'has-custom-border':\n\t\t\t!! borderProps.className ||\n\t\t\t( borderProps.style &&\n\t\t\t\tObject.keys( borderProps.style ).length > 0 ),\n\t} );\n\n\tconst imageClasses = clsx( borderProps.className, {\n\t\t[ `wp-image-${ id }` ]: !! id,\n\t} );\n\n\tconst image = (\n\t\t<img\n\t\t\tsrc={ url }\n\t\t\talt={ alt }\n\t\t\tclassName={ imageClasses || undefined }\n\t\t\tstyle={ ( () => {\n\t\t\t\tconst style = {\n\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t...shadowProps.style,\n\t\t\t\t\taspectRatio,\n\t\t\t\t\tobjectFit: scale,\n\t\t\t\t\tobjectPosition:\n\t\t\t\t\t\tfocalPoint && scale\n\t\t\t\t\t\t\t? mediaPosition( focalPoint )\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t};\n\t\t\t\t// Only apply dimension styles when a width or height is provided.\n\t\t\t\tif ( width !== undefined || height !== undefined ) {\n\t\t\t\t\t// Only apply width when explicitly provided.\n\t\t\t\t\tif ( width === 'auto' ) {\n\t\t\t\t\t\tstyle.width = 'auto';\n\t\t\t\t\t} else if ( width !== undefined && width !== null ) {\n\t\t\t\t\t\tstyle.width =\n\t\t\t\t\t\t\ttypeof width === 'number' ? `${ width }px` : width;\n\t\t\t\t\t}\n\t\t\t\t\t// Force height to auto when unspecified to prevent\n\t\t\t\t\t// theme CSS from squishing the image.\n\t\t\t\t\tif (\n\t\t\t\t\t\theight === 'auto' ||\n\t\t\t\t\t\theight === undefined ||\n\t\t\t\t\t\theight === null\n\t\t\t\t\t) {\n\t\t\t\t\t\tstyle.height = 'auto';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstyle.height =\n\t\t\t\t\t\t\ttypeof height === 'number'\n\t\t\t\t\t\t\t\t? `${ height }px`\n\t\t\t\t\t\t\t\t: height;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn style;\n\t\t\t} )() }\n\t\t\ttitle={ title }\n\t\t\trole={ isDecorative ? 'none' : undefined }\n\t\t/>\n\t);\n\n\tconst displayCaption =\n\t\t! RichText.isEmpty( caption ) ||\n\t\tbindings.caption ||\n\t\tbindings?.__default?.source === 'core/pattern-overrides';\n\n\tconst figure = (\n\t\t<>\n\t\t\t{ href ? (\n\t\t\t\t<a\n\t\t\t\t\tclassName={ linkClass }\n\t\t\t\t\thref={ href }\n\t\t\t\t\ttarget={ linkTarget }\n\t\t\t\t\trel={ newRel }\n\t\t\t\t>\n\t\t\t\t\t{ image }\n\t\t\t\t</a>\n\t\t\t) : (\n\t\t\t\timage\n\t\t\t) }\n\t\t\t{ displayCaption && (\n\t\t\t\t<RichText.Content\n\t\t\t\t\tclassName={ __experimentalGetElementClassName( 'caption' ) }\n\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\tvalue={ caption }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n\n\treturn (\n\t\t<figure { ...useBlockProps.save( { className: classes } ) }>\n\t\t\t{ figure }\n\t\t</figure>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,0BAMO;AAKP,mBAA8B;AA6C5B;AA3Ca,SAAR,KAAuB,EAAE,WAAW,GAAI;AAC9C,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU,EAAE,WAAW,CAAC,EAAE,IAAI,CAAC;AAAA,EAChC,IAAI;AAEJ,QAAM,SAAS,CAAE,MAAM,SAAY;AACnC,QAAM,kBAAc,oBAAAA,yCAA2B,UAAW;AAC1D,QAAM,kBAAc,oBAAAC,yCAA2B,UAAW;AAE1D,QAAM,cAAU,YAAAC,SAAM;AAAA;AAAA;AAAA,IAG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AAA,IAEC,kBACD;AAAA,MAAC,6BAAS;AAAA,MAAT;AAAA,QACA,eAAY,uDAAmC,SAAU;AAAA,QACzD,SAAQ;AAAA,QACR,OAAQ;AAAA;AAAA,IACT;AAAA,KAEF;AAGD,SACC,4CAAC,YAAS,GAAG,kCAAc,KAAM,EAAE,WAAW,QAAQ,CAAE,GACrD,kBACH;AAEF;",
6
6
  "names": ["getBorderClassesAndStyles", "getShadowClassesAndStyles", "clsx"]
7
7
  }
@@ -48,7 +48,7 @@ function getFirstAnchorAttributeFormHTML(html, attributeName) {
48
48
  }
49
49
  var imageSchema = {
50
50
  img: {
51
- attributes: ["src", "alt", "title"],
51
+ attributes: ["src", "alt", "title", "width", "height"],
52
52
  classes: [
53
53
  "alignleft",
54
54
  "aligncenter",
@@ -58,6 +58,9 @@ var imageSchema = {
58
58
  ]
59
59
  }
60
60
  };
61
+ function parsePixelDimension(value) {
62
+ return value && /^\d+$/.test(value) ? `${value}px` : void 0;
63
+ }
61
64
  var schema = ({ phrasingContentSchema }) => ({
62
65
  figure: {
63
66
  require: ["img"],
@@ -81,7 +84,8 @@ var transforms = {
81
84
  isMatch: (node) => node.nodeName === "FIGURE" && !!node.querySelector("img"),
82
85
  schema,
83
86
  transform: (node) => {
84
- const className = node.className + " " + node.querySelector("img").className;
87
+ const img = node.querySelector("img");
88
+ const className = node.className + " " + img.className;
85
89
  const alignMatches = /(?:^|\s)align(left|center|right)(?:$|\s)/.exec(
86
90
  className
87
91
  );
@@ -96,6 +100,12 @@ var transforms = {
96
100
  const href = anchorElement && anchorElement.href ? anchorElement.href : void 0;
97
101
  const rel = anchorElement && anchorElement.rel ? anchorElement.rel : void 0;
98
102
  const linkClass = anchorElement && anchorElement.className ? anchorElement.className : void 0;
103
+ const width = parsePixelDimension(
104
+ img.getAttribute("width")
105
+ );
106
+ const height = parsePixelDimension(
107
+ img.getAttribute("height")
108
+ );
99
109
  const attributes = (0, import_blocks.getBlockAttributes)(
100
110
  "core/image",
101
111
  node.outerHTML,
@@ -106,7 +116,9 @@ var transforms = {
106
116
  href,
107
117
  rel,
108
118
  linkClass,
109
- anchor
119
+ anchor,
120
+ width,
121
+ height
110
122
  }
111
123
  );
112
124
  if ((0, import_blob.isBlobURL)(attributes.url)) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/image/transforms.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createBlobURL, isBlobURL } from '@wordpress/blob';\nimport { createBlock, getBlockAttributes } from '@wordpress/blocks';\n\nexport function stripFirstImage( attributes, { shortcode } ) {\n\tconst { body } = document.implementation.createHTMLDocument( '' );\n\n\tbody.innerHTML = shortcode.content;\n\n\tlet nodeToRemove = body.querySelector( 'img' );\n\n\t// If an image has parents, find the topmost node to remove.\n\twhile (\n\t\tnodeToRemove &&\n\t\tnodeToRemove.parentNode &&\n\t\tnodeToRemove.parentNode !== body\n\t) {\n\t\tnodeToRemove = nodeToRemove.parentNode;\n\t}\n\n\tif ( nodeToRemove ) {\n\t\tnodeToRemove.parentNode.removeChild( nodeToRemove );\n\t}\n\n\treturn body.innerHTML.trim();\n}\n\nfunction getFirstAnchorAttributeFormHTML( html, attributeName ) {\n\tconst { body } = document.implementation.createHTMLDocument( '' );\n\n\tbody.innerHTML = html;\n\n\tconst { firstElementChild } = body;\n\n\tif ( firstElementChild && firstElementChild.nodeName === 'A' ) {\n\t\treturn firstElementChild.getAttribute( attributeName ) || undefined;\n\t}\n}\n\nconst imageSchema = {\n\timg: {\n\t\tattributes: [ 'src', 'alt', 'title' ],\n\t\tclasses: [\n\t\t\t'alignleft',\n\t\t\t'aligncenter',\n\t\t\t'alignright',\n\t\t\t'alignnone',\n\t\t\t/^wp-image-\\d+$/,\n\t\t],\n\t},\n};\n\nconst schema = ( { phrasingContentSchema } ) => ( {\n\tfigure: {\n\t\trequire: [ 'img' ],\n\t\tchildren: {\n\t\t\t...imageSchema,\n\t\t\ta: {\n\t\t\t\tattributes: [ 'href', 'rel', 'target' ],\n\t\t\t\tclasses: [ '*' ],\n\t\t\t\tchildren: imageSchema,\n\t\t\t},\n\t\t\tfigcaption: {\n\t\t\t\tchildren: phrasingContentSchema,\n\t\t\t},\n\t\t},\n\t},\n} );\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tisMatch: ( node ) =>\n\t\t\t\tnode.nodeName === 'FIGURE' && !! node.querySelector( 'img' ),\n\t\t\tschema,\n\t\t\ttransform: ( node ) => {\n\t\t\t\t// Search both figure and image classes. Alignment could be\n\t\t\t\t// set on either. ID is set on the image.\n\t\t\t\tconst className =\n\t\t\t\t\tnode.className +\n\t\t\t\t\t' ' +\n\t\t\t\t\tnode.querySelector( 'img' ).className;\n\t\t\t\tconst alignMatches =\n\t\t\t\t\t/(?:^|\\s)align(left|center|right)(?:$|\\s)/.exec(\n\t\t\t\t\t\tclassName\n\t\t\t\t\t);\n\t\t\t\tconst anchor = node.id === '' ? undefined : node.id;\n\t\t\t\tconst align = alignMatches ? alignMatches[ 1 ] : undefined;\n\t\t\t\tconst idMatches = /(?:^|\\s)wp-image-(\\d+)(?:$|\\s)/.exec(\n\t\t\t\t\tclassName\n\t\t\t\t);\n\t\t\t\tconst id = idMatches ? Number( idMatches[ 1 ] ) : undefined;\n\t\t\t\tconst anchorElement = node.querySelector( 'a' );\n\t\t\t\tconst linkDestination =\n\t\t\t\t\tanchorElement && anchorElement.href ? 'custom' : undefined;\n\t\t\t\tconst href =\n\t\t\t\t\tanchorElement && anchorElement.href\n\t\t\t\t\t\t? anchorElement.href\n\t\t\t\t\t\t: undefined;\n\t\t\t\tconst rel =\n\t\t\t\t\tanchorElement && anchorElement.rel\n\t\t\t\t\t\t? anchorElement.rel\n\t\t\t\t\t\t: undefined;\n\t\t\t\tconst linkClass =\n\t\t\t\t\tanchorElement && anchorElement.className\n\t\t\t\t\t\t? anchorElement.className\n\t\t\t\t\t\t: undefined;\n\t\t\t\tconst attributes = getBlockAttributes(\n\t\t\t\t\t'core/image',\n\t\t\t\t\tnode.outerHTML,\n\t\t\t\t\t{\n\t\t\t\t\t\talign,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tlinkDestination,\n\t\t\t\t\t\thref,\n\t\t\t\t\t\trel,\n\t\t\t\t\t\tlinkClass,\n\t\t\t\t\t\tanchor,\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tif ( isBlobURL( attributes.url ) ) {\n\t\t\t\t\tattributes.blob = attributes.url;\n\t\t\t\t\tdelete attributes.url;\n\t\t\t\t}\n\n\t\t\t\treturn createBlock( 'core/image', attributes );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t// Note: when dragging and dropping multiple files onto a gallery this overrides the\n\t\t\t// gallery transform in order to add new images to the gallery instead of\n\t\t\t// creating a new gallery.\n\t\t\ttype: 'files',\n\t\t\tisMatch( files ) {\n\t\t\t\treturn files.every(\n\t\t\t\t\t( file ) => file.type.indexOf( 'image/' ) === 0\n\t\t\t\t);\n\t\t\t},\n\t\t\ttransform( files ) {\n\t\t\t\tconst blocks = files.map( ( file ) => {\n\t\t\t\t\treturn createBlock( 'core/image', {\n\t\t\t\t\t\tblob: createBlobURL( file ),\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t\treturn blocks;\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'shortcode',\n\t\t\ttag: 'caption',\n\t\t\tattributes: {\n\t\t\t\turl: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tsource: 'attribute',\n\t\t\t\t\tattribute: 'src',\n\t\t\t\t\tselector: 'img',\n\t\t\t\t},\n\t\t\t\talt: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tsource: 'attribute',\n\t\t\t\t\tattribute: 'alt',\n\t\t\t\t\tselector: 'img',\n\t\t\t\t},\n\t\t\t\tcaption: {\n\t\t\t\t\tshortcode: stripFirstImage,\n\t\t\t\t},\n\t\t\t\thref: {\n\t\t\t\t\tshortcode: ( attributes, { shortcode } ) => {\n\t\t\t\t\t\treturn getFirstAnchorAttributeFormHTML(\n\t\t\t\t\t\t\tshortcode.content,\n\t\t\t\t\t\t\t'href'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\trel: {\n\t\t\t\t\tshortcode: ( attributes, { shortcode } ) => {\n\t\t\t\t\t\treturn getFirstAnchorAttributeFormHTML(\n\t\t\t\t\t\t\tshortcode.content,\n\t\t\t\t\t\t\t'rel'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tlinkClass: {\n\t\t\t\t\tshortcode: ( attributes, { shortcode } ) => {\n\t\t\t\t\t\treturn getFirstAnchorAttributeFormHTML(\n\t\t\t\t\t\t\tshortcode.content,\n\t\t\t\t\t\t\t'class'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tid: {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tshortcode: ( { named: { id } } ) => {\n\t\t\t\t\t\tif ( ! id ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn parseInt( id.replace( 'attachment_', '' ), 10 );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\talign: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tshortcode: ( { named: { align = 'alignnone' } } ) => {\n\t\t\t\t\t\treturn align.replace( 'align', '' );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAyC;AACzC,oBAAgD;AAEzC,SAAS,gBAAiB,YAAY,EAAE,UAAU,GAAI;AAC5D,QAAM,EAAE,KAAK,IAAI,SAAS,eAAe,mBAAoB,EAAG;AAEhE,OAAK,YAAY,UAAU;AAE3B,MAAI,eAAe,KAAK,cAAe,KAAM;AA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ACA,KAAK;AAAA,UACJ,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,WAAW;AAAA,UACX,UAAU;AAAA,QACX;AAAA,QACA,SAAS;AAAA,UACR,WAAW;AAAA,QACZ;AAAA,QACA,MAAM;AAAA,UACL,WAAW,CAAE,YAAY,EAAE,UAAU,MAAO;AAC3C,mBAAO;AAAA,cACN,UAAU;AAAA,cACV;AAAA,YACD;AAAA,UACD;AAAA,QACD;AAAA,QACA,KAAK;AAAA,UACJ,WAAW,CAAE,YAAY,EAAE,UAAU,MAAO;AAC3C,mBAAO;AAAA,cACN,UAAU;AAAA,cACV;AAAA,YACD;AAAA,UACD;AAAA,QACD;AAAA,QACA,WAAW;AAAA,UACV,WAAW,CAAE,YAAY,EAAE,UAAU,MAAO;AAC3C,mBAAO;AAAA,cACN,UAAU;AAAA,cACV;AAAA,YACD;AAAA,UACD;AAAA,QACD;AAAA,QACA,IAAI;AAAA,UACH,MAAM;AAAA,UACN,WAAW,CAAE,EAAE,OAAO,EAAE,GAAG,EAAE,MAAO;AACnC,gBAAK,CAAE,IAAK;AACX;AAAA,YACD;AAEA,mBAAO,SAAU,GAAG,QAAS,eAAe,EAAG,GAAG,EAAG;AAAA,UACtD;AAAA,QACD;AAAA,QACA,OAAO;AAAA,UACN,MAAM;AAAA,UACN,WAAW,CAAE,EAAE,OAAO,EAAE,QAAQ,YAAY,EAAE,MAAO;AACpD,mBAAO,MAAM,QAAS,SAAS,EAAG;AAAA,UACnC;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;AAEA,IAAO,qBAAQ;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { createBlobURL, isBlobURL } from '@wordpress/blob';\nimport { createBlock, getBlockAttributes } from '@wordpress/blocks';\n\nexport function stripFirstImage( attributes, { shortcode } ) {\n\tconst { body } = document.implementation.createHTMLDocument( '' );\n\n\tbody.innerHTML = shortcode.content;\n\n\tlet nodeToRemove = body.querySelector( 'img' );\n\n\t// If an image has parents, find the topmost node to remove.\n\twhile (\n\t\tnodeToRemove &&\n\t\tnodeToRemove.parentNode &&\n\t\tnodeToRemove.parentNode !== body\n\t) {\n\t\tnodeToRemove = nodeToRemove.parentNode;\n\t}\n\n\tif ( nodeToRemove ) {\n\t\tnodeToRemove.parentNode.removeChild( nodeToRemove );\n\t}\n\n\treturn body.innerHTML.trim();\n}\n\nfunction getFirstAnchorAttributeFormHTML( html, attributeName ) {\n\tconst { body } = document.implementation.createHTMLDocument( '' );\n\n\tbody.innerHTML = html;\n\n\tconst { firstElementChild } = body;\n\n\tif ( firstElementChild && firstElementChild.nodeName === 'A' ) {\n\t\treturn firstElementChild.getAttribute( attributeName ) || undefined;\n\t}\n}\n\nconst imageSchema = {\n\timg: {\n\t\tattributes: [ 'src', 'alt', 'title', 'width', 'height' ],\n\t\tclasses: [\n\t\t\t'alignleft',\n\t\t\t'aligncenter',\n\t\t\t'alignright',\n\t\t\t'alignnone',\n\t\t\t/^wp-image-\\d+$/,\n\t\t],\n\t},\n};\n\n// Read a pixel dimension from an `<img>` HTML attribute and normalise it to\n// the `<value>px` form the Image block stores in its `width` / `height`\n// attributes. Non-integer values (e.g. `50%`) are dropped because the block\n// attribute round-trips through inline styles that expect pixel units.\nfunction parsePixelDimension( value ) {\n\treturn value && /^\\d+$/.test( value ) ? `${ value }px` : undefined;\n}\n\nconst schema = ( { phrasingContentSchema } ) => ( {\n\tfigure: {\n\t\trequire: [ 'img' ],\n\t\tchildren: {\n\t\t\t...imageSchema,\n\t\t\ta: {\n\t\t\t\tattributes: [ 'href', 'rel', 'target' ],\n\t\t\t\tclasses: [ '*' ],\n\t\t\t\tchildren: imageSchema,\n\t\t\t},\n\t\t\tfigcaption: {\n\t\t\t\tchildren: phrasingContentSchema,\n\t\t\t},\n\t\t},\n\t},\n} );\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tisMatch: ( node ) =>\n\t\t\t\tnode.nodeName === 'FIGURE' && !! node.querySelector( 'img' ),\n\t\t\tschema,\n\t\t\ttransform: ( node ) => {\n\t\t\t\tconst img = node.querySelector( 'img' );\n\t\t\t\t// Search both figure and image classes. Alignment could be\n\t\t\t\t// set on either. ID is set on the image.\n\t\t\t\tconst className = node.className + ' ' + img.className;\n\t\t\t\tconst alignMatches =\n\t\t\t\t\t/(?:^|\\s)align(left|center|right)(?:$|\\s)/.exec(\n\t\t\t\t\t\tclassName\n\t\t\t\t\t);\n\t\t\t\tconst anchor = node.id === '' ? undefined : node.id;\n\t\t\t\tconst align = alignMatches ? alignMatches[ 1 ] : undefined;\n\t\t\t\tconst idMatches = /(?:^|\\s)wp-image-(\\d+)(?:$|\\s)/.exec(\n\t\t\t\t\tclassName\n\t\t\t\t);\n\t\t\t\tconst id = idMatches ? Number( idMatches[ 1 ] ) : undefined;\n\t\t\t\tconst anchorElement = node.querySelector( 'a' );\n\t\t\t\tconst linkDestination =\n\t\t\t\t\tanchorElement && anchorElement.href ? 'custom' : undefined;\n\t\t\t\tconst href =\n\t\t\t\t\tanchorElement && anchorElement.href\n\t\t\t\t\t\t? anchorElement.href\n\t\t\t\t\t\t: undefined;\n\t\t\t\tconst rel =\n\t\t\t\t\tanchorElement && anchorElement.rel\n\t\t\t\t\t\t? anchorElement.rel\n\t\t\t\t\t\t: undefined;\n\t\t\t\tconst linkClass =\n\t\t\t\t\tanchorElement && anchorElement.className\n\t\t\t\t\t\t? anchorElement.className\n\t\t\t\t\t\t: undefined;\n\t\t\t\t// Preserve explicit pixel dimensions set on the source `<img>`\n\t\t\t\t// (e.g. legacy \"Add Media\" output: `<img width=\"77\" height=\"77\">`).\n\t\t\t\tconst width = parsePixelDimension(\n\t\t\t\t\timg.getAttribute( 'width' )\n\t\t\t\t);\n\t\t\t\tconst height = parsePixelDimension(\n\t\t\t\t\timg.getAttribute( 'height' )\n\t\t\t\t);\n\t\t\t\tconst attributes = getBlockAttributes(\n\t\t\t\t\t'core/image',\n\t\t\t\t\tnode.outerHTML,\n\t\t\t\t\t{\n\t\t\t\t\t\talign,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tlinkDestination,\n\t\t\t\t\t\thref,\n\t\t\t\t\t\trel,\n\t\t\t\t\t\tlinkClass,\n\t\t\t\t\t\tanchor,\n\t\t\t\t\t\twidth,\n\t\t\t\t\t\theight,\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tif ( isBlobURL( attributes.url ) ) {\n\t\t\t\t\tattributes.blob = attributes.url;\n\t\t\t\t\tdelete attributes.url;\n\t\t\t\t}\n\n\t\t\t\treturn createBlock( 'core/image', attributes );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\t// Note: when dragging and dropping multiple files onto a gallery this overrides the\n\t\t\t// gallery transform in order to add new images to the gallery instead of\n\t\t\t// creating a new gallery.\n\t\t\ttype: 'files',\n\t\t\tisMatch( files ) {\n\t\t\t\treturn files.every(\n\t\t\t\t\t( file ) => file.type.indexOf( 'image/' ) === 0\n\t\t\t\t);\n\t\t\t},\n\t\t\ttransform( files ) {\n\t\t\t\tconst blocks = files.map( ( file ) => {\n\t\t\t\t\treturn createBlock( 'core/image', {\n\t\t\t\t\t\tblob: createBlobURL( file ),\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t\treturn blocks;\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'shortcode',\n\t\t\ttag: 'caption',\n\t\t\tattributes: {\n\t\t\t\turl: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tsource: 'attribute',\n\t\t\t\t\tattribute: 'src',\n\t\t\t\t\tselector: 'img',\n\t\t\t\t},\n\t\t\t\talt: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tsource: 'attribute',\n\t\t\t\t\tattribute: 'alt',\n\t\t\t\t\tselector: 'img',\n\t\t\t\t},\n\t\t\t\tcaption: {\n\t\t\t\t\tshortcode: stripFirstImage,\n\t\t\t\t},\n\t\t\t\thref: {\n\t\t\t\t\tshortcode: ( attributes, { shortcode } ) => {\n\t\t\t\t\t\treturn getFirstAnchorAttributeFormHTML(\n\t\t\t\t\t\t\tshortcode.content,\n\t\t\t\t\t\t\t'href'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\trel: {\n\t\t\t\t\tshortcode: ( attributes, { shortcode } ) => {\n\t\t\t\t\t\treturn getFirstAnchorAttributeFormHTML(\n\t\t\t\t\t\t\tshortcode.content,\n\t\t\t\t\t\t\t'rel'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tlinkClass: {\n\t\t\t\t\tshortcode: ( attributes, { shortcode } ) => {\n\t\t\t\t\t\treturn getFirstAnchorAttributeFormHTML(\n\t\t\t\t\t\t\tshortcode.content,\n\t\t\t\t\t\t\t'class'\n\t\t\t\t\t\t);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tid: {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tshortcode: ( { named: { id } } ) => {\n\t\t\t\t\t\tif ( ! id ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn parseInt( id.replace( 'attachment_', '' ), 10 );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\talign: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tshortcode: ( { named: { align = 'alignnone' } } ) => {\n\t\t\t\t\t\treturn align.replace( 'align', '' );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAyC;AACzC,oBAAgD;AAEzC,SAAS,gBAAiB,YAAY,EAAE,UAAU,GAAI;AAC5D,QAAM,EAAE,KAAK,IAAI,SAAS,eAAe,mBAAoB,EAAG;AAEhE,OAAK,YAAY,UAAU;AAE3B,MAAI,eAAe,KAAK,cAAe,KAAM;AAG7C,SACC,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