@wordpress/block-library 9.11.0 → 9.12.1-next.082ed6819.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.
- package/CHANGELOG.md +2 -0
- package/build/block-keyboard-shortcuts/index.js +7 -7
- package/build/block-keyboard-shortcuts/index.js.map +1 -1
- package/build/button/index.js +1 -1
- package/build/button/index.js.map +1 -1
- package/build/cover/deprecated.js +140 -4
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/block-controls.js +1 -1
- package/build/cover/edit/block-controls.js.map +1 -1
- package/build/cover/edit/cover-placeholder.js +1 -2
- package/build/cover/edit/cover-placeholder.js.map +1 -1
- package/build/cover/edit/index.js +23 -23
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/index.js +10 -10
- package/build/cover/index.js.map +1 -1
- package/build/cover/save.js +13 -13
- package/build/cover/save.js.map +1 -1
- package/build/cover/shared.js +6 -7
- package/build/cover/shared.js.map +1 -1
- package/build/details/index.js +20 -0
- package/build/details/index.js.map +1 -1
- package/build/file/edit.js +8 -4
- package/build/file/edit.js.map +1 -1
- package/build/freeform/modal.js +1 -1
- package/build/freeform/modal.js.map +1 -1
- package/build/gallery/edit.js +1 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/heading/index.js +1 -7
- package/build/heading/index.js.map +1 -1
- package/build/home-link/edit.js +20 -36
- package/build/home-link/edit.js.map +1 -1
- package/build/image/edit.js +1 -1
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +144 -78
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +1 -1
- package/build/latest-posts/edit.js +0 -1
- package/build/latest-posts/edit.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/navigation/edit/index.js +2 -23
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/use-template-part-area-label.js +6 -8
- package/build/navigation/use-template-part-area-label.js.map +1 -1
- package/build/page-list/index.js +14 -0
- package/build/page-list/index.js.map +1 -1
- package/build/paragraph/edit.js +26 -25
- package/build/paragraph/edit.js.map +1 -1
- package/build/post-content/index.js +13 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-template/edit.js +11 -0
- package/build/post-template/edit.js.map +1 -1
- package/build/post-template/index.js +1 -1
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js +1 -3
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +3 -13
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/pattern-selection-modal.js +0 -3
- package/build/query/edit/pattern-selection-modal.js.map +1 -1
- package/build/query/edit/query-content.js +10 -12
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/index.js +1 -1
- package/build/query/utils.js +38 -9
- package/build/query/utils.js.map +1 -1
- package/build/social-link/edit.js +22 -9
- package/build/social-link/edit.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +2 -7
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/index.js +1 -4
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +0 -3
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/template-part/edit/utils/get-template-part-icon.js +23 -0
- package/build/template-part/edit/utils/get-template-part-icon.js.map +1 -0
- package/build/template-part/edit/utils/hooks.js +1 -6
- package/build/template-part/edit/utils/hooks.js.map +1 -1
- package/build/template-part/variations.js +6 -12
- package/build/template-part/variations.js.map +1 -1
- package/build/video/edit.js +1 -1
- package/build/video/edit.js.map +1 -1
- package/build/video/tracks-editor.js +135 -123
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/block-keyboard-shortcuts/index.js +7 -7
- package/build-module/block-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/button/index.js +1 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/cover/deprecated.js +140 -4
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/block-controls.js +1 -1
- package/build-module/cover/edit/block-controls.js.map +1 -1
- package/build-module/cover/edit/cover-placeholder.js +1 -2
- package/build-module/cover/edit/cover-placeholder.js.map +1 -1
- package/build-module/cover/edit/index.js +23 -23
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/index.js +10 -10
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/save.js +13 -13
- package/build-module/cover/save.js.map +1 -1
- package/build-module/cover/shared.js +6 -7
- package/build-module/cover/shared.js.map +1 -1
- package/build-module/details/index.js +21 -1
- package/build-module/details/index.js.map +1 -1
- package/build-module/file/edit.js +8 -4
- package/build-module/file/edit.js.map +1 -1
- package/build-module/freeform/modal.js +1 -1
- package/build-module/freeform/modal.js.map +1 -1
- package/build-module/gallery/edit.js +1 -1
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/heading/index.js +1 -7
- package/build-module/heading/index.js.map +1 -1
- package/build-module/home-link/edit.js +23 -39
- package/build-module/home-link/edit.js.map +1 -1
- package/build-module/image/edit.js +1 -1
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +149 -83
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +1 -1
- package/build-module/latest-posts/edit.js +0 -1
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/navigation/edit/index.js +2 -23
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/use-template-part-area-label.js +6 -8
- package/build-module/navigation/use-template-part-area-label.js.map +1 -1
- package/build-module/page-list/index.js +14 -0
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/paragraph/edit.js +26 -25
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/post-content/index.js +13 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-template/edit.js +11 -0
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-template/index.js +1 -1
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +1 -3
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +3 -13
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/pattern-selection-modal.js +0 -3
- package/build-module/query/edit/pattern-selection-modal.js.map +1 -1
- package/build-module/query/edit/query-content.js +10 -12
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/index.js +1 -1
- package/build-module/query/utils.js +35 -8
- package/build-module/query/utils.js.map +1 -1
- package/build-module/social-link/edit.js +24 -11
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +3 -8
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/index.js +1 -4
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/selection-modal.js +0 -3
- package/build-module/template-part/edit/selection-modal.js.map +1 -1
- package/build-module/template-part/edit/utils/get-template-part-icon.js +15 -0
- package/build-module/template-part/edit/utils/get-template-part-icon.js.map +1 -0
- package/build-module/template-part/edit/utils/hooks.js +1 -6
- package/build-module/template-part/edit/utils/hooks.js.map +1 -1
- package/build-module/template-part/variations.js +5 -11
- package/build-module/template-part/variations.js.map +1 -1
- package/build-module/video/edit.js +1 -1
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/tracks-editor.js +136 -124
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/cover/editor-rtl.css +3 -5
- package/build-style/cover/editor.css +3 -5
- package/build-style/cover/style-rtl.css +19 -15
- package/build-style/cover/style.css +19 -15
- package/build-style/editor-rtl.css +19 -30
- package/build-style/editor.css +19 -30
- package/build-style/group/editor-rtl.css +0 -10
- package/build-style/group/editor.css +0 -10
- package/build-style/image/editor-rtl.css +4 -0
- package/build-style/image/editor.css +4 -0
- package/build-style/image/style-rtl.css +0 -2
- package/build-style/image/style.css +0 -2
- package/build-style/latest-posts/editor-rtl.css +0 -7
- package/build-style/latest-posts/editor.css +0 -7
- package/build-style/media-text/style-rtl.css +1 -1
- package/build-style/media-text/style.css +1 -1
- package/build-style/navigation/style-rtl.css +1 -1
- package/build-style/navigation/style.css +1 -1
- package/build-style/page-list/style-rtl.css +4 -0
- package/build-style/page-list/style.css +4 -0
- package/build-style/query/editor-rtl.css +0 -4
- package/build-style/query/editor.css +0 -4
- package/build-style/search/style-rtl.css +3 -3
- package/build-style/search/style.css +3 -3
- package/build-style/social-link/editor-rtl.css +4 -4
- package/build-style/social-link/editor.css +4 -4
- package/build-style/style-rtl.css +28 -22
- package/build-style/style.css +28 -22
- package/build-style/video/editor-rtl.css +8 -0
- package/build-style/video/editor.css +8 -0
- package/build-types/lock-unlock.d.ts +2 -0
- package/build-types/lock-unlock.d.ts.map +1 -0
- package/package.json +39 -39
- package/src/block-keyboard-shortcuts/index.js +25 -11
- package/src/button/index.js +1 -1
- package/src/comments/block.json +3 -9
- package/src/cover/deprecated.js +182 -4
- package/src/cover/edit/block-controls.js +1 -1
- package/src/cover/edit/cover-placeholder.js +0 -3
- package/src/cover/edit/index.js +42 -27
- package/src/cover/editor.scss +4 -5
- package/src/cover/index.js +8 -8
- package/src/cover/save.js +27 -20
- package/src/cover/shared.js +10 -10
- package/src/cover/style.scss +40 -16
- package/src/cover/test/__snapshots__/edit.native.js.snap +9 -9
- package/src/cover/test/__snapshots__/transforms.native.js.snap +4 -4
- package/src/cover/test/edit.js +2 -2
- package/src/cover/test/edit.native.js +4 -4
- package/src/cover/test/transforms.native.js +4 -4
- package/src/details/block.json +1 -0
- package/src/details/index.js +23 -1
- package/src/file/edit.js +9 -3
- package/src/freeform/modal.js +1 -1
- package/src/gallery/edit.js +1 -1
- package/src/group/editor.scss +0 -12
- package/src/heading/block.json +1 -7
- package/src/home-link/edit.js +27 -45
- package/src/home-link/index.php +0 -3
- package/src/image/block.json +1 -1
- package/src/image/edit.js +1 -1
- package/src/image/editor.scss +4 -0
- package/src/image/image.js +200 -109
- package/src/image/style.scss +0 -1
- package/src/image/test/__snapshots__/transforms.native.js.snap +1 -1
- package/src/latest-posts/edit.js +0 -1
- package/src/latest-posts/editor.scss +0 -11
- package/src/media-text/style.scss +1 -1
- package/src/media-text/test/__snapshots__/transforms.native.js.snap +2 -2
- package/src/navigation/edit/index.js +3 -30
- package/src/navigation/index.php +5 -151
- package/src/navigation/style.scss +1 -1
- package/src/navigation/use-template-part-area-label.js +10 -10
- package/src/page-list/block.json +14 -0
- package/src/page-list/style.scss +4 -0
- package/src/paragraph/edit.js +20 -17
- package/src/pattern/index.php +0 -7
- package/src/post-content/block.json +14 -1
- package/src/post-template/block.json +2 -1
- package/src/post-template/edit.js +19 -0
- package/src/query/block.json +1 -1
- package/src/query/edit/inspector-controls/enhanced-pagination-control.js +3 -5
- package/src/query/edit/inspector-controls/index.js +2 -12
- package/src/query/edit/pattern-selection-modal.js +0 -3
- package/src/query/edit/query-content.js +9 -17
- package/src/query/editor.scss +0 -4
- package/src/query/index.php +1 -1
- package/src/query/test/utils.js +59 -1
- package/src/query/utils.js +43 -15
- package/src/rss/index.php +11 -8
- package/src/search/index.php +2 -2
- package/src/search/style.scss +3 -5
- package/src/social-link/edit.js +47 -19
- package/src/social-link/editor.scss +6 -7
- package/src/template-part/edit/advanced-controls.js +13 -13
- package/src/template-part/edit/index.js +1 -4
- package/src/template-part/edit/selection-modal.js +0 -3
- package/src/template-part/edit/utils/get-template-part-icon.js +20 -0
- package/src/template-part/edit/utils/hooks.js +2 -7
- package/src/template-part/variations.js +4 -16
- package/src/video/edit.js +1 -1
- package/src/video/editor.scss +9 -0
- package/src/video/test/__snapshots__/transforms.native.js.snap +1 -1
- package/src/video/tracks-editor.js +157 -141
- package/tsconfig.tsbuildinfo +1 -1
- package/build/query/edit/inspector-controls/create-new-post-link.js +0 -40
- package/build/query/edit/inspector-controls/create-new-post-link.js.map +0 -1
- package/build-module/query/edit/inspector-controls/create-new-post-link.js +0 -33
- package/build-module/query/edit/inspector-controls/create-new-post-link.js.map +0 -1
- package/src/query/edit/inspector-controls/create-new-post-link.js +0 -32
- /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_coreData","_element","_components","_compose","_blockEditor","_i18n","_data","_blob","_notices","_shared","_inspectorControls","_blockControls","_coverPlaceholder","_resizableCoverPopover","_colorUtils","_constants","_jsxRuntime","getInnerBlocksTemplate","attributes","align","placeholder","__","isTemporaryMedia","id","url","isBlobURL","CoverEdit","clientId","isSelected","overlayColor","setAttributes","setOverlayColor","toggleSelection","context","postId","postType","contentPosition","originalUrl","backgroundType","originalBackgroundType","useFeaturedImage","dimRatio","focalPoint","hasParallax","isDark","isRepeated","minHeight","minHeightUnit","alt","allowedBlocks","templateLock","tagName","TagName","isUserOverlayColor","sizeSlug","featuredImage","useEntityProp","getSettings","useSelect","blockEditorStore","__unstableMarkNextChangeAsNotPersistent","useDispatch","media","select","coreStore","getMedia","mediaUrl","source_url","useEffect","averageBackgroundColor","getMediaColor","newOverlayColor","color","newIsDark","compositeIsDark","replaceAll","IMAGE_BACKGROUND_TYPE","createErrorNotice","noticesStore","gradientClass","gradientValue","__experimentalUseGradient","onSelectMedia","newMedia","mediaAttributes","attributesFromMedia","isImage","type","media_type","includes","undefined","newDimRatio","imageDefaultSize","sizes","DEFAULT_MEDIA_SIZE_SLUG","onClearMedia","DEFAULT_OVERLAY_COLOR","DEFAULT_BACKGROUND_COLOR","onSetOverlayColor","onUpdateDimRatio","onUploadError","message","isUploadingMedia","isImageBackground","isVideoBackground","VIDEO_BACKGROUND_TYPE","blockEditingMode","useBlockEditingMode","hasNonContentControls","resizeListener","height","width","useResizeObserver","resizableBoxDimensions","useMemo","minHeightWithUnit","isImgElement","style","backgroundImage","backgroundPosition","mediaPosition","bgStyle","backgroundColor","mediaStyle","objectPosition","hasBackground","hasInnerBlocks","getBlock","innerBlocks","length","ref","useRef","blockProps","useBlockProps","fontSizes","useSettings","hasFontSizes","innerBlocksTemplate","fontSize","innerBlocksProps","useInnerBlocksProps","className","template","templateInsertUpdatesSelection","dropZoneElement","current","mediaElement","currentSettings","toggleUseFeaturedImage","newUseFeaturedImage","blockControls","jsx","default","inspectorControls","coverRef","updateDimRatio","resizableCoverProps","onResizeStart","onResize","value","onResizeStop","newMinHeight","showHandle","dimensions","aspectRatio","size","jsxs","Fragment","children","clsx","onError","ColorPalette","disableCustomColors","onChange","clearable","classes","isContentPositionCenter","getPositionClassName","showOverlay","dimRatioToClass","class","Placeholder","withIllustration","src","role","autoPlay","muted","loop","Spinner","disableMediaButtons","_default","exports","compose","withColors"],"sources":["@wordpress/block-library/src/cover/edit/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useMemo, useRef } from '@wordpress/element';\nimport { Placeholder, Spinner } from '@wordpress/components';\nimport { compose, useResizeObserver } from '@wordpress/compose';\nimport {\n\twithColors,\n\tColorPalette,\n\tuseBlockProps,\n\tuseSettings,\n\tuseInnerBlocksProps,\n\t__experimentalUseGradient,\n\tstore as blockEditorStore,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { isBlobURL } from '@wordpress/blob';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport {\n\tattributesFromMedia,\n\tIMAGE_BACKGROUND_TYPE,\n\tVIDEO_BACKGROUND_TYPE,\n\tdimRatioToClass,\n\tisContentPositionCenter,\n\tgetPositionClassName,\n\tmediaPosition,\n} from '../shared';\nimport CoverInspectorControls from './inspector-controls';\nimport CoverBlockControls from './block-controls';\nimport CoverPlaceholder from './cover-placeholder';\nimport ResizableCoverPopover from './resizable-cover-popover';\nimport {\n\tgetMediaColor,\n\tcompositeIsDark,\n\tDEFAULT_BACKGROUND_COLOR,\n\tDEFAULT_OVERLAY_COLOR,\n} from './color-utils';\nimport { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';\n\nfunction getInnerBlocksTemplate( attributes ) {\n\treturn [\n\t\t[\n\t\t\t'core/paragraph',\n\t\t\t{\n\t\t\t\talign: 'center',\n\t\t\t\tplaceholder: __( 'Write title…' ),\n\t\t\t\t...attributes,\n\t\t\t},\n\t\t],\n\t];\n}\n\n/**\n * Is the URL a temporary blob URL? A blob URL is one that is used temporarily while\n * the media (image or video) is being uploaded and will not have an id allocated yet.\n *\n * @param {number} id The id of the media.\n * @param {string} url The url of the media.\n *\n * @return {boolean} Is the URL a Blob URL.\n */\nconst isTemporaryMedia = ( id, url ) => ! id && isBlobURL( url );\n\nfunction CoverEdit( {\n\tattributes,\n\tclientId,\n\tisSelected,\n\toverlayColor,\n\tsetAttributes,\n\tsetOverlayColor,\n\ttoggleSelection,\n\tcontext: { postId, postType },\n} ) {\n\tconst {\n\t\tcontentPosition,\n\t\tid,\n\t\turl: originalUrl,\n\t\tbackgroundType: originalBackgroundType,\n\t\tuseFeaturedImage,\n\t\tdimRatio,\n\t\tfocalPoint,\n\t\thasParallax,\n\t\tisDark,\n\t\tisRepeated,\n\t\tminHeight,\n\t\tminHeightUnit,\n\t\talt,\n\t\tallowedBlocks,\n\t\ttemplateLock,\n\t\ttagName: TagName = 'div',\n\t\tisUserOverlayColor,\n\t\tsizeSlug,\n\t} = attributes;\n\n\tconst [ featuredImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\tconst { getSettings } = useSelect( blockEditorStore );\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst media = useSelect(\n\t\t( select ) =>\n\t\t\tfeaturedImage &&\n\t\t\tselect( coreStore ).getMedia( featuredImage, { context: 'view' } ),\n\t\t[ featuredImage ]\n\t);\n\tconst mediaUrl = media?.source_url;\n\n\t// User can change the featured image outside of the block, but we still\n\t// need to update the block when that happens. This effect should only\n\t// run when the featured image changes in that case. All other cases are\n\t// handled in their respective callbacks.\n\tuseEffect( () => {\n\t\t( async () => {\n\t\t\tif ( ! useFeaturedImage ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst averageBackgroundColor = await getMediaColor( mediaUrl );\n\n\t\t\tlet newOverlayColor = overlayColor.color;\n\t\t\tif ( ! isUserOverlayColor ) {\n\t\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t}\n\n\t\t\tconst newIsDark = compositeIsDark(\n\t\t\t\tdimRatio,\n\t\t\t\tnewOverlayColor,\n\t\t\t\taverageBackgroundColor\n\t\t\t);\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tisDark: newIsDark,\n\t\t\t\tisUserOverlayColor: isUserOverlayColor || false,\n\t\t\t} );\n\t\t} )();\n\t\t// Update the block only when the featured image changes.\n\t}, [ mediaUrl ] );\n\n\t// instead of destructuring the attributes\n\t// we define the url and background type\n\t// depending on the value of the useFeaturedImage flag\n\t// to preview in edit the dynamic featured image\n\tconst url = useFeaturedImage\n\t\t? mediaUrl\n\t\t: // Ensure the url is not malformed due to sanitization through `wp_kses`.\n\t\t originalUrl?.replaceAll( '&', '&' );\n\tconst backgroundType = useFeaturedImage\n\t\t? IMAGE_BACKGROUND_TYPE\n\t\t: originalBackgroundType;\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { gradientClass, gradientValue } = __experimentalUseGradient();\n\n\tconst onSelectMedia = async ( newMedia ) => {\n\t\tconst mediaAttributes = attributesFromMedia( newMedia );\n\t\tconst isImage = [ newMedia?.type, newMedia?.media_type ].includes(\n\t\t\tIMAGE_BACKGROUND_TYPE\n\t\t);\n\n\t\tconst averageBackgroundColor = await getMediaColor(\n\t\t\tisImage ? newMedia?.url : undefined\n\t\t);\n\n\t\tlet newOverlayColor = overlayColor.color;\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\tsetOverlayColor( newOverlayColor );\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\t// Only set a new dimRatio if there was no previous media selected\n\t\t// to avoid resetting to 50 if it has been explicitly set to 100.\n\t\t// See issue #52835 for context.\n\t\tconst newDimRatio =\n\t\t\toriginalUrl === undefined && dimRatio === 100 ? 50 : dimRatio;\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tif ( backgroundType === IMAGE_BACKGROUND_TYPE && mediaAttributes.id ) {\n\t\t\tconst { imageDefaultSize } = getSettings();\n\n\t\t\t// Try to use the previous selected image size if it's available\n\t\t\t// otherwise try the default image size or fallback to full size.\n\t\t\tif ( sizeSlug && newMedia?.sizes?.[ sizeSlug ] ) {\n\t\t\t\tmediaAttributes.sizeSlug = sizeSlug;\n\t\t\t\tmediaAttributes.url = newMedia?.sizes?.[ sizeSlug ]?.url;\n\t\t\t} else if ( newMedia?.sizes?.[ imageDefaultSize ] ) {\n\t\t\t\tmediaAttributes.sizeSlug = imageDefaultSize;\n\t\t\t\tmediaAttributes.url = newMedia?.sizes?.[ sizeSlug ]?.url;\n\t\t\t} else {\n\t\t\t\tmediaAttributes.sizeSlug = DEFAULT_MEDIA_SIZE_SLUG;\n\t\t\t}\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\t...mediaAttributes,\n\t\t\tfocalPoint: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t\tdimRatio: newDimRatio,\n\t\t\tisDark: newIsDark,\n\t\t\tisUserOverlayColor: isUserOverlayColor || false,\n\t\t} );\n\t};\n\n\tconst onClearMedia = () => {\n\t\tlet newOverlayColor = overlayColor.color;\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tnewOverlayColor = DEFAULT_OVERLAY_COLOR;\n\t\t\tsetOverlayColor( undefined );\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tdimRatio,\n\t\t\tnewOverlayColor,\n\t\t\tDEFAULT_BACKGROUND_COLOR\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tid: undefined,\n\t\t\tbackgroundType: undefined,\n\t\t\tfocalPoint: undefined,\n\t\t\thasParallax: undefined,\n\t\t\tisRepeated: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onSetOverlayColor = async ( newOverlayColor ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tdimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetOverlayColor( newOverlayColor );\n\n\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\n\t\tsetAttributes( {\n\t\t\tisUserOverlayColor: true,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onUpdateDimRatio = async ( newDimRatio ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\toverlayColor.color,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\tdimRatio: newDimRatio,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t};\n\n\tconst isUploadingMedia = isTemporaryMedia( id, url );\n\n\tconst isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;\n\tconst isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;\n\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\n\tconst [ resizeListener, { height, width } ] = useResizeObserver();\n\tconst resizableBoxDimensions = useMemo( () => {\n\t\treturn {\n\t\t\theight: minHeightUnit === 'px' ? minHeight : 'auto',\n\t\t\twidth: 'auto',\n\t\t};\n\t}, [ minHeight, minHeightUnit ] );\n\n\tconst minHeightWithUnit =\n\t\tminHeight && minHeightUnit\n\t\t\t? `${ minHeight }${ minHeightUnit }`\n\t\t\t: minHeight;\n\n\tconst isImgElement = ! ( hasParallax || isRepeated );\n\n\tconst style = {\n\t\tminHeight: minHeightWithUnit || undefined,\n\t};\n\n\tconst backgroundImage = url ? `url(${ url })` : undefined;\n\n\tconst backgroundPosition = mediaPosition( focalPoint );\n\n\tconst bgStyle = { backgroundColor: overlayColor.color };\n\tconst mediaStyle = {\n\t\tobjectPosition:\n\t\t\tfocalPoint && isImgElement\n\t\t\t\t? mediaPosition( focalPoint )\n\t\t\t\t: undefined,\n\t};\n\n\tconst hasBackground = !! ( url || overlayColor.color || gradientValue );\n\n\tconst hasInnerBlocks = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlock( clientId ).innerBlocks.length >\n\t\t\t0,\n\t\t[ clientId ]\n\t);\n\n\tconst ref = useRef();\n\tconst blockProps = useBlockProps( { ref } );\n\n\t// Check for fontSize support before we pass a fontSize attribute to the innerBlocks.\n\tconst [ fontSizes ] = useSettings( 'typography.fontSizes' );\n\tconst hasFontSizes = fontSizes?.length > 0;\n\tconst innerBlocksTemplate = getInnerBlocksTemplate( {\n\t\tfontSize: hasFontSizes ? 'large' : undefined,\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tclassName: 'wp-block-cover__inner-container',\n\t\t},\n\t\t{\n\t\t\t// Avoid template sync when the `templateLock` value is `all` or `contentOnly`.\n\t\t\t// See: https://github.com/WordPress/gutenberg/pull/45632\n\t\t\ttemplate: ! hasInnerBlocks ? innerBlocksTemplate : undefined,\n\t\t\ttemplateInsertUpdatesSelection: true,\n\t\t\tallowedBlocks,\n\t\t\ttemplateLock,\n\t\t\tdropZoneElement: ref.current,\n\t\t}\n\t);\n\n\tconst mediaElement = useRef();\n\tconst currentSettings = {\n\t\tisVideoBackground,\n\t\tisImageBackground,\n\t\tmediaElement,\n\t\thasInnerBlocks,\n\t\turl,\n\t\tisImgElement,\n\t\toverlayColor,\n\t};\n\n\tconst toggleUseFeaturedImage = async () => {\n\t\tconst newUseFeaturedImage = ! useFeaturedImage;\n\n\t\tconst averageBackgroundColor = newUseFeaturedImage\n\t\t\t? await getMediaColor( mediaUrl )\n\t\t\t: DEFAULT_BACKGROUND_COLOR;\n\n\t\tconst newOverlayColor = ! isUserOverlayColor\n\t\t\t? averageBackgroundColor\n\t\t\t: overlayColor.color;\n\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tif ( newUseFeaturedImage ) {\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t} else {\n\t\t\t\tsetOverlayColor( undefined );\n\t\t\t}\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newDimRatio = dimRatio === 100 ? 50 : dimRatio;\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\tid: undefined,\n\t\t\turl: undefined,\n\t\t\tuseFeaturedImage: newUseFeaturedImage,\n\t\t\tdimRatio: newDimRatio,\n\t\t\tbackgroundType: useFeaturedImage\n\t\t\t\t? IMAGE_BACKGROUND_TYPE\n\t\t\t\t: undefined,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst blockControls = (\n\t\t<CoverBlockControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t/>\n\t);\n\n\tconst inspectorControls = (\n\t\t<CoverInspectorControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tclientId={ clientId }\n\t\t\tsetOverlayColor={ onSetOverlayColor }\n\t\t\tcoverRef={ ref }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tupdateDimRatio={ onUpdateDimRatio }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t/>\n\t);\n\n\tconst resizableCoverProps = {\n\t\tclassName: 'block-library-cover__resize-container',\n\t\tclientId,\n\t\theight,\n\t\tminHeight: minHeightWithUnit,\n\t\tonResizeStart: () => {\n\t\t\tsetAttributes( { minHeightUnit: 'px' } );\n\t\t\ttoggleSelection( false );\n\t\t},\n\t\tonResize: ( value ) => {\n\t\t\tsetAttributes( { minHeight: value } );\n\t\t},\n\t\tonResizeStop: ( newMinHeight ) => {\n\t\t\ttoggleSelection( true );\n\t\t\tsetAttributes( { minHeight: newMinHeight } );\n\t\t},\n\t\t// Hide the resize handle if an aspect ratio is set, as the aspect ratio takes precedence.\n\t\tshowHandle: ! attributes.style?.dimensions?.aspectRatio ? true : false,\n\t\tsize: resizableBoxDimensions,\n\t\twidth,\n\t};\n\n\tif ( ! useFeaturedImage && ! hasInnerBlocks && ! hasBackground ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ blockControls }\n\t\t\t\t{ inspectorControls }\n\t\t\t\t{ hasNonContentControls && isSelected && (\n\t\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t\t) }\n\t\t\t\t<TagName\n\t\t\t\t\t{ ...blockProps }\n\t\t\t\t\tclassName={ clsx( 'is-placeholder', blockProps.className ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...blockProps.style,\n\t\t\t\t\t\tminHeight: minHeightWithUnit || undefined,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ resizeListener }\n\t\t\t\t\t<CoverPlaceholder\n\t\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className=\"wp-block-cover__placeholder-background-options\">\n\t\t\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\t\t\tdisableCustomColors\n\t\t\t\t\t\t\t\tvalue={ overlayColor.color }\n\t\t\t\t\t\t\t\tonChange={ onSetOverlayColor }\n\t\t\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</CoverPlaceholder>\n\t\t\t\t</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst classes = clsx(\n\t\t{\n\t\t\t'is-dark-theme': isDark,\n\t\t\t'is-light': ! isDark,\n\t\t\t'is-transient': isUploadingMedia,\n\t\t\t'has-parallax': hasParallax,\n\t\t\t'is-repeated': isRepeated,\n\t\t\t'has-custom-content-position':\n\t\t\t\t! isContentPositionCenter( contentPosition ),\n\t\t},\n\t\tgetPositionClassName( contentPosition )\n\t);\n\n\tconst showOverlay =\n\t\turl || ! useFeaturedImage || ( useFeaturedImage && ! url );\n\n\treturn (\n\t\t<>\n\t\t\t{ blockControls }\n\t\t\t{ inspectorControls }\n\t\t\t<TagName\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( classes, blockProps.className ) }\n\t\t\t\tstyle={ { ...style, ...blockProps.style } }\n\t\t\t\tdata-url={ url }\n\t\t\t>\n\t\t\t\t{ resizeListener }\n\t\t\t\t{ showOverlay && (\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'wp-block-cover__background',\n\t\t\t\t\t\t\tdimRatioToClass( dimRatio ),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t[ overlayColor.class ]: overlayColor.class,\n\t\t\t\t\t\t\t\t'has-background-dim': dimRatio !== undefined,\n\t\t\t\t\t\t\t\t// For backwards compatibility. Former versions of the Cover Block applied\n\t\t\t\t\t\t\t\t// `.wp-block-cover__gradient-background` in the presence of\n\t\t\t\t\t\t\t\t// media, a gradient and a dim.\n\t\t\t\t\t\t\t\t'wp-block-cover__gradient-background':\n\t\t\t\t\t\t\t\t\turl && gradientValue && dimRatio !== 0,\n\t\t\t\t\t\t\t\t'has-background-gradient': gradientValue,\n\t\t\t\t\t\t\t\t[ gradientClass ]: gradientClass,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tstyle={ { backgroundImage: gradientValue, ...bgStyle } }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ ! url && useFeaturedImage && (\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\tclassName=\"wp-block-cover__image--placeholder-image\"\n\t\t\t\t\t\twithIllustration\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ url &&\n\t\t\t\t\tisImageBackground &&\n\t\t\t\t\t( isImgElement ? (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\tclassName=\"wp-block-cover__image-background\"\n\t\t\t\t\t\t\talt={ alt }\n\t\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\trole={ alt ? 'img' : undefined }\n\t\t\t\t\t\t\taria-label={ alt ? alt : undefined }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\tclasses,\n\t\t\t\t\t\t\t\t'wp-block-cover__image-background'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tstyle={ { backgroundImage, backgroundPosition } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t{ url && isVideoBackground && (\n\t\t\t\t\t<video\n\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\tclassName=\"wp-block-cover__video-background\"\n\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\tmuted\n\t\t\t\t\t\tloop\n\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ isUploadingMedia && <Spinner /> }\n\t\t\t\t<CoverPlaceholder\n\t\t\t\t\tdisableMediaButtons\n\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t/>\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</TagName>\n\t\t\t{ hasNonContentControls && isSelected && (\n\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default compose( [\n\twithColors( { overlayColor: 'background-color' } ),\n] )( CoverEdit );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAUA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AAKA,IAAAU,OAAA,GAAAV,OAAA;AASA,IAAAW,kBAAA,GAAAZ,sBAAA,CA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AAAuI,GAAA,EAACrJ,WAAA,CAAA0L,OAAO,IAAE,CAAC,eACjC,IAAA5K,WAAA,CAAAuI,GAAA,EAAC3I,iBAAA,CAAA4I,OAAgB;QAChBqC,mBAAmB;QACnB3G,aAAa,EAAGA,aAAe;QAC/BwF,OAAO,EAAGtE,aAAe;QACzBgD,sBAAsB,EAAGA;MAAwB,CACjD,CAAC,eACF,IAAApI,WAAA,CAAAuI,GAAA;QAAA,GAAUZ;MAAgB,CAAI,CAAC;IAAA,CACvB,CAAC,EACR/B,qBAAqB,IAAIhF,UAAU,iBACpC,IAAAZ,WAAA,CAAAuI,GAAA,EAAC1I,sBAAA,CAAA2I,OAAqB;MAAA,GAAMI;IAAmB,CAAI,CACnD;EAAA,CACA,CAAC;AAEL;AAAC,IAAAkC,QAAA,GAAAC,OAAA,CAAAvC,OAAA,GAEc,IAAAwC,gBAAO,EAAE,CACvB,IAAAC,uBAAU,EAAE;EAAEpK,YAAY,EAAE;AAAmB,CAAE,CAAC,CACjD,CAAC,CAAEH,SAAU,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_coreData","_element","_components","_compose","_blockEditor","_i18n","_data","_blob","_notices","_shared","_inspectorControls","_blockControls","_coverPlaceholder","_resizableCoverPopover","_colorUtils","_constants","_jsxRuntime","getInnerBlocksTemplate","attributes","align","placeholder","__","isTemporaryMedia","id","url","isBlobURL","CoverEdit","clientId","isSelected","overlayColor","setAttributes","setOverlayColor","toggleSelection","context","postId","postType","contentPosition","originalUrl","backgroundType","originalBackgroundType","useFeaturedImage","dimRatio","focalPoint","hasParallax","isDark","isRepeated","minHeight","minHeightUnit","alt","allowedBlocks","templateLock","tagName","TagName","isUserOverlayColor","sizeSlug","featuredImage","useEntityProp","getSettings","useSelect","blockEditorStore","__unstableMarkNextChangeAsNotPersistent","useDispatch","media","select","coreStore","getMedia","mediaUrl","source_url","useEffect","averageBackgroundColor","getMediaColor","newOverlayColor","color","newIsDark","compositeIsDark","replaceAll","IMAGE_BACKGROUND_TYPE","createErrorNotice","noticesStore","gradientClass","gradientValue","__experimentalUseGradient","onSelectMedia","newMedia","mediaAttributes","attributesFromMedia","isImage","type","media_type","includes","undefined","newDimRatio","imageDefaultSize","sizes","media_details","DEFAULT_MEDIA_SIZE_SLUG","onClearMedia","DEFAULT_OVERLAY_COLOR","DEFAULT_BACKGROUND_COLOR","onSetOverlayColor","onUpdateDimRatio","onUploadError","message","isUploadingMedia","isImageBackground","isVideoBackground","VIDEO_BACKGROUND_TYPE","blockEditingMode","useBlockEditingMode","hasNonContentControls","resizeListener","height","width","useResizeObserver","resizableBoxDimensions","useMemo","minHeightWithUnit","isImgElement","style","backgroundImage","backgroundPosition","mediaPosition","bgStyle","backgroundColor","mediaStyle","objectPosition","hasBackground","hasInnerBlocks","getBlock","innerBlocks","length","ref","useRef","blockProps","useBlockProps","fontSizes","useSettings","hasFontSizes","innerBlocksTemplate","fontSize","innerBlocksProps","useInnerBlocksProps","className","template","templateInsertUpdatesSelection","dropZoneElement","current","mediaElement","currentSettings","toggleUseFeaturedImage","newUseFeaturedImage","blockControls","jsx","default","inspectorControls","coverRef","updateDimRatio","resizableCoverProps","onResizeStart","onResize","value","onResizeStop","newMinHeight","showHandle","dimensions","aspectRatio","size","jsxs","Fragment","children","clsx","onError","ColorPalette","disableCustomColors","onChange","clearable","classes","isContentPositionCenter","getPositionClassName","showOverlay","Placeholder","withIllustration","src","role","autoPlay","muted","loop","dimRatioToClass","class","Spinner","disableMediaButtons","_default","exports","compose","withColors"],"sources":["@wordpress/block-library/src/cover/edit/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useMemo, useRef } from '@wordpress/element';\nimport { Placeholder, Spinner } from '@wordpress/components';\nimport { compose, useResizeObserver } from '@wordpress/compose';\nimport {\n\twithColors,\n\tColorPalette,\n\tuseBlockProps,\n\tuseSettings,\n\tuseInnerBlocksProps,\n\t__experimentalUseGradient,\n\tstore as blockEditorStore,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { isBlobURL } from '@wordpress/blob';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport {\n\tattributesFromMedia,\n\tIMAGE_BACKGROUND_TYPE,\n\tVIDEO_BACKGROUND_TYPE,\n\tdimRatioToClass,\n\tisContentPositionCenter,\n\tgetPositionClassName,\n\tmediaPosition,\n} from '../shared';\nimport CoverInspectorControls from './inspector-controls';\nimport CoverBlockControls from './block-controls';\nimport CoverPlaceholder from './cover-placeholder';\nimport ResizableCoverPopover from './resizable-cover-popover';\nimport {\n\tgetMediaColor,\n\tcompositeIsDark,\n\tDEFAULT_BACKGROUND_COLOR,\n\tDEFAULT_OVERLAY_COLOR,\n} from './color-utils';\nimport { DEFAULT_MEDIA_SIZE_SLUG } from '../constants';\n\nfunction getInnerBlocksTemplate( attributes ) {\n\treturn [\n\t\t[\n\t\t\t'core/paragraph',\n\t\t\t{\n\t\t\t\talign: 'center',\n\t\t\t\tplaceholder: __( 'Write title…' ),\n\t\t\t\t...attributes,\n\t\t\t},\n\t\t],\n\t];\n}\n\n/**\n * Is the URL a temporary blob URL? A blob URL is one that is used temporarily while\n * the media (image or video) is being uploaded and will not have an id allocated yet.\n *\n * @param {number} id The id of the media.\n * @param {string} url The url of the media.\n *\n * @return {boolean} Is the URL a Blob URL.\n */\nconst isTemporaryMedia = ( id, url ) => ! id && isBlobURL( url );\n\nfunction CoverEdit( {\n\tattributes,\n\tclientId,\n\tisSelected,\n\toverlayColor,\n\tsetAttributes,\n\tsetOverlayColor,\n\ttoggleSelection,\n\tcontext: { postId, postType },\n} ) {\n\tconst {\n\t\tcontentPosition,\n\t\tid,\n\t\turl: originalUrl,\n\t\tbackgroundType: originalBackgroundType,\n\t\tuseFeaturedImage,\n\t\tdimRatio,\n\t\tfocalPoint,\n\t\thasParallax,\n\t\tisDark,\n\t\tisRepeated,\n\t\tminHeight,\n\t\tminHeightUnit,\n\t\talt,\n\t\tallowedBlocks,\n\t\ttemplateLock,\n\t\ttagName: TagName = 'div',\n\t\tisUserOverlayColor,\n\t\tsizeSlug,\n\t} = attributes;\n\n\tconst [ featuredImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\tconst { getSettings } = useSelect( blockEditorStore );\n\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst media = useSelect(\n\t\t( select ) =>\n\t\t\tfeaturedImage &&\n\t\t\tselect( coreStore ).getMedia( featuredImage, { context: 'view' } ),\n\t\t[ featuredImage ]\n\t);\n\tconst mediaUrl = media?.source_url;\n\n\t// User can change the featured image outside of the block, but we still\n\t// need to update the block when that happens. This effect should only\n\t// run when the featured image changes in that case. All other cases are\n\t// handled in their respective callbacks.\n\tuseEffect( () => {\n\t\t( async () => {\n\t\t\tif ( ! useFeaturedImage ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst averageBackgroundColor = await getMediaColor( mediaUrl );\n\n\t\t\tlet newOverlayColor = overlayColor.color;\n\t\t\tif ( ! isUserOverlayColor ) {\n\t\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t}\n\n\t\t\tconst newIsDark = compositeIsDark(\n\t\t\t\tdimRatio,\n\t\t\t\tnewOverlayColor,\n\t\t\t\taverageBackgroundColor\n\t\t\t);\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tisDark: newIsDark,\n\t\t\t\tisUserOverlayColor: isUserOverlayColor || false,\n\t\t\t} );\n\t\t} )();\n\t\t// Update the block only when the featured image changes.\n\t}, [ mediaUrl ] );\n\n\t// instead of destructuring the attributes\n\t// we define the url and background type\n\t// depending on the value of the useFeaturedImage flag\n\t// to preview in edit the dynamic featured image\n\tconst url = useFeaturedImage\n\t\t? mediaUrl\n\t\t: // Ensure the url is not malformed due to sanitization through `wp_kses`.\n\t\t originalUrl?.replaceAll( '&', '&' );\n\tconst backgroundType = useFeaturedImage\n\t\t? IMAGE_BACKGROUND_TYPE\n\t\t: originalBackgroundType;\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { gradientClass, gradientValue } = __experimentalUseGradient();\n\n\tconst onSelectMedia = async ( newMedia ) => {\n\t\tconst mediaAttributes = attributesFromMedia( newMedia );\n\t\tconst isImage = [ newMedia?.type, newMedia?.media_type ].includes(\n\t\t\tIMAGE_BACKGROUND_TYPE\n\t\t);\n\n\t\tconst averageBackgroundColor = await getMediaColor(\n\t\t\tisImage ? newMedia?.url : undefined\n\t\t);\n\n\t\tlet newOverlayColor = overlayColor.color;\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tnewOverlayColor = averageBackgroundColor;\n\t\t\tsetOverlayColor( newOverlayColor );\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\t// Only set a new dimRatio if there was no previous media selected\n\t\t// to avoid resetting to 50 if it has been explicitly set to 100.\n\t\t// See issue #52835 for context.\n\t\tconst newDimRatio =\n\t\t\toriginalUrl === undefined && dimRatio === 100 ? 50 : dimRatio;\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tif ( backgroundType === IMAGE_BACKGROUND_TYPE && mediaAttributes?.id ) {\n\t\t\tconst { imageDefaultSize } = getSettings();\n\n\t\t\t// Try to use the previous selected image size if it's available\n\t\t\t// otherwise try the default image size or fallback to full size.\n\t\t\tif (\n\t\t\t\tsizeSlug &&\n\t\t\t\t( newMedia?.sizes?.[ sizeSlug ] ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ sizeSlug ] )\n\t\t\t) {\n\t\t\t\tmediaAttributes.sizeSlug = sizeSlug;\n\t\t\t\tmediaAttributes.url =\n\t\t\t\t\tnewMedia?.sizes?.[ sizeSlug ]?.url ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ sizeSlug ]?.source_url;\n\t\t\t} else if (\n\t\t\t\tnewMedia?.sizes?.[ imageDefaultSize ] ||\n\t\t\t\tnewMedia?.media_details?.sizes?.[ imageDefaultSize ]\n\t\t\t) {\n\t\t\t\tmediaAttributes.sizeSlug = imageDefaultSize;\n\t\t\t\tmediaAttributes.url =\n\t\t\t\t\tnewMedia?.sizes?.[ imageDefaultSize ]?.url ||\n\t\t\t\t\tnewMedia?.media_details?.sizes?.[ imageDefaultSize ]\n\t\t\t\t\t\t?.source_url;\n\t\t\t} else {\n\t\t\t\tmediaAttributes.sizeSlug = DEFAULT_MEDIA_SIZE_SLUG;\n\t\t\t}\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\t...mediaAttributes,\n\t\t\tfocalPoint: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t\tdimRatio: newDimRatio,\n\t\t\tisDark: newIsDark,\n\t\t\tisUserOverlayColor: isUserOverlayColor || false,\n\t\t} );\n\t};\n\n\tconst onClearMedia = () => {\n\t\tlet newOverlayColor = overlayColor.color;\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tnewOverlayColor = DEFAULT_OVERLAY_COLOR;\n\t\t\tsetOverlayColor( undefined );\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tdimRatio,\n\t\t\tnewOverlayColor,\n\t\t\tDEFAULT_BACKGROUND_COLOR\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tid: undefined,\n\t\t\tbackgroundType: undefined,\n\t\t\tfocalPoint: undefined,\n\t\t\thasParallax: undefined,\n\t\t\tisRepeated: undefined,\n\t\t\tuseFeaturedImage: undefined,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onSetOverlayColor = async ( newOverlayColor ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tdimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetOverlayColor( newOverlayColor );\n\n\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\n\t\tsetAttributes( {\n\t\t\tisUserOverlayColor: true,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onUpdateDimRatio = async ( newDimRatio ) => {\n\t\tconst averageBackgroundColor = await getMediaColor( url );\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\toverlayColor.color,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\tdimRatio: newDimRatio,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t};\n\n\tconst isUploadingMedia = isTemporaryMedia( id, url );\n\n\tconst isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;\n\tconst isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;\n\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\n\tconst [ resizeListener, { height, width } ] = useResizeObserver();\n\tconst resizableBoxDimensions = useMemo( () => {\n\t\treturn {\n\t\t\theight: minHeightUnit === 'px' ? minHeight : 'auto',\n\t\t\twidth: 'auto',\n\t\t};\n\t}, [ minHeight, minHeightUnit ] );\n\n\tconst minHeightWithUnit =\n\t\tminHeight && minHeightUnit\n\t\t\t? `${ minHeight }${ minHeightUnit }`\n\t\t\t: minHeight;\n\n\tconst isImgElement = ! ( hasParallax || isRepeated );\n\n\tconst style = {\n\t\tminHeight: minHeightWithUnit || undefined,\n\t};\n\n\tconst backgroundImage = url ? `url(${ url })` : undefined;\n\n\tconst backgroundPosition = mediaPosition( focalPoint );\n\n\tconst bgStyle = { backgroundColor: overlayColor.color };\n\tconst mediaStyle = {\n\t\tobjectPosition:\n\t\t\tfocalPoint && isImgElement\n\t\t\t\t? mediaPosition( focalPoint )\n\t\t\t\t: undefined,\n\t};\n\n\tconst hasBackground = !! ( url || overlayColor.color || gradientValue );\n\n\tconst hasInnerBlocks = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlock( clientId ).innerBlocks.length >\n\t\t\t0,\n\t\t[ clientId ]\n\t);\n\n\tconst ref = useRef();\n\tconst blockProps = useBlockProps( { ref } );\n\n\t// Check for fontSize support before we pass a fontSize attribute to the innerBlocks.\n\tconst [ fontSizes ] = useSettings( 'typography.fontSizes' );\n\tconst hasFontSizes = fontSizes?.length > 0;\n\tconst innerBlocksTemplate = getInnerBlocksTemplate( {\n\t\tfontSize: hasFontSizes ? 'large' : undefined,\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tclassName: 'wp-block-cover__inner-container',\n\t\t},\n\t\t{\n\t\t\t// Avoid template sync when the `templateLock` value is `all` or `contentOnly`.\n\t\t\t// See: https://github.com/WordPress/gutenberg/pull/45632\n\t\t\ttemplate: ! hasInnerBlocks ? innerBlocksTemplate : undefined,\n\t\t\ttemplateInsertUpdatesSelection: true,\n\t\t\tallowedBlocks,\n\t\t\ttemplateLock,\n\t\t\tdropZoneElement: ref.current,\n\t\t}\n\t);\n\n\tconst mediaElement = useRef();\n\tconst currentSettings = {\n\t\tisVideoBackground,\n\t\tisImageBackground,\n\t\tmediaElement,\n\t\thasInnerBlocks,\n\t\turl,\n\t\tisImgElement,\n\t\toverlayColor,\n\t};\n\n\tconst toggleUseFeaturedImage = async () => {\n\t\tconst newUseFeaturedImage = ! useFeaturedImage;\n\n\t\tconst averageBackgroundColor = newUseFeaturedImage\n\t\t\t? await getMediaColor( mediaUrl )\n\t\t\t: DEFAULT_BACKGROUND_COLOR;\n\n\t\tconst newOverlayColor = ! isUserOverlayColor\n\t\t\t? averageBackgroundColor\n\t\t\t: overlayColor.color;\n\n\t\tif ( ! isUserOverlayColor ) {\n\t\t\tif ( newUseFeaturedImage ) {\n\t\t\t\tsetOverlayColor( newOverlayColor );\n\t\t\t} else {\n\t\t\t\tsetOverlayColor( undefined );\n\t\t\t}\n\n\t\t\t// Make undo revert the next setAttributes and the previous setOverlayColor.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t}\n\n\t\tconst newDimRatio = dimRatio === 100 ? 50 : dimRatio;\n\t\tconst newIsDark = compositeIsDark(\n\t\t\tnewDimRatio,\n\t\t\tnewOverlayColor,\n\t\t\taverageBackgroundColor\n\t\t);\n\n\t\tsetAttributes( {\n\t\t\tid: undefined,\n\t\t\turl: undefined,\n\t\t\tuseFeaturedImage: newUseFeaturedImage,\n\t\t\tdimRatio: newDimRatio,\n\t\t\tbackgroundType: useFeaturedImage\n\t\t\t\t? IMAGE_BACKGROUND_TYPE\n\t\t\t\t: undefined,\n\t\t\tisDark: newIsDark,\n\t\t} );\n\t};\n\n\tconst blockControls = (\n\t\t<CoverBlockControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t/>\n\t);\n\n\tconst inspectorControls = (\n\t\t<CoverInspectorControls\n\t\t\tattributes={ attributes }\n\t\t\tsetAttributes={ setAttributes }\n\t\t\tclientId={ clientId }\n\t\t\tsetOverlayColor={ onSetOverlayColor }\n\t\t\tcoverRef={ ref }\n\t\t\tcurrentSettings={ currentSettings }\n\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\tupdateDimRatio={ onUpdateDimRatio }\n\t\t\tonClearMedia={ onClearMedia }\n\t\t/>\n\t);\n\n\tconst resizableCoverProps = {\n\t\tclassName: 'block-library-cover__resize-container',\n\t\tclientId,\n\t\theight,\n\t\tminHeight: minHeightWithUnit,\n\t\tonResizeStart: () => {\n\t\t\tsetAttributes( { minHeightUnit: 'px' } );\n\t\t\ttoggleSelection( false );\n\t\t},\n\t\tonResize: ( value ) => {\n\t\t\tsetAttributes( { minHeight: value } );\n\t\t},\n\t\tonResizeStop: ( newMinHeight ) => {\n\t\t\ttoggleSelection( true );\n\t\t\tsetAttributes( { minHeight: newMinHeight } );\n\t\t},\n\t\t// Hide the resize handle if an aspect ratio is set, as the aspect ratio takes precedence.\n\t\tshowHandle: ! attributes.style?.dimensions?.aspectRatio,\n\t\tsize: resizableBoxDimensions,\n\t\twidth,\n\t};\n\n\tif ( ! useFeaturedImage && ! hasInnerBlocks && ! hasBackground ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ blockControls }\n\t\t\t\t{ inspectorControls }\n\t\t\t\t{ hasNonContentControls && isSelected && (\n\t\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t\t) }\n\t\t\t\t<TagName\n\t\t\t\t\t{ ...blockProps }\n\t\t\t\t\tclassName={ clsx( 'is-placeholder', blockProps.className ) }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t...blockProps.style,\n\t\t\t\t\t\tminHeight: minHeightWithUnit || undefined,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ resizeListener }\n\t\t\t\t\t<CoverPlaceholder\n\t\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className=\"wp-block-cover__placeholder-background-options\">\n\t\t\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\t\t\tdisableCustomColors\n\t\t\t\t\t\t\t\tvalue={ overlayColor.color }\n\t\t\t\t\t\t\t\tonChange={ onSetOverlayColor }\n\t\t\t\t\t\t\t\tclearable={ false }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</CoverPlaceholder>\n\t\t\t\t</TagName>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst classes = clsx(\n\t\t{\n\t\t\t'is-dark-theme': isDark,\n\t\t\t'is-light': ! isDark,\n\t\t\t'is-transient': isUploadingMedia,\n\t\t\t'has-parallax': hasParallax,\n\t\t\t'is-repeated': isRepeated,\n\t\t\t'has-custom-content-position':\n\t\t\t\t! isContentPositionCenter( contentPosition ),\n\t\t},\n\t\tgetPositionClassName( contentPosition )\n\t);\n\n\tconst showOverlay =\n\t\turl || ! useFeaturedImage || ( useFeaturedImage && ! url );\n\n\treturn (\n\t\t<>\n\t\t\t{ blockControls }\n\t\t\t{ inspectorControls }\n\t\t\t<TagName\n\t\t\t\t{ ...blockProps }\n\t\t\t\tclassName={ clsx( classes, blockProps.className ) }\n\t\t\t\tstyle={ { ...style, ...blockProps.style } }\n\t\t\t\tdata-url={ url }\n\t\t\t>\n\t\t\t\t{ resizeListener }\n\n\t\t\t\t{ ! url && useFeaturedImage && (\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\tclassName=\"wp-block-cover__image--placeholder-image\"\n\t\t\t\t\t\twithIllustration\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ url &&\n\t\t\t\t\tisImageBackground &&\n\t\t\t\t\t( isImgElement ? (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\tclassName=\"wp-block-cover__image-background\"\n\t\t\t\t\t\t\talt={ alt }\n\t\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\t\trole={ alt ? 'img' : undefined }\n\t\t\t\t\t\t\taria-label={ alt ? alt : undefined }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\tclasses,\n\t\t\t\t\t\t\t\t'wp-block-cover__image-background'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tstyle={ { backgroundImage, backgroundPosition } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t{ url && isVideoBackground && (\n\t\t\t\t\t<video\n\t\t\t\t\t\tref={ mediaElement }\n\t\t\t\t\t\tclassName=\"wp-block-cover__video-background\"\n\t\t\t\t\t\tautoPlay\n\t\t\t\t\t\tmuted\n\t\t\t\t\t\tloop\n\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\tstyle={ mediaStyle }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ showOverlay && (\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'wp-block-cover__background',\n\t\t\t\t\t\t\tdimRatioToClass( dimRatio ),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t[ overlayColor.class ]: overlayColor.class,\n\t\t\t\t\t\t\t\t'has-background-dim': dimRatio !== undefined,\n\t\t\t\t\t\t\t\t// For backwards compatibility. Former versions of the Cover Block applied\n\t\t\t\t\t\t\t\t// `.wp-block-cover__gradient-background` in the presence of\n\t\t\t\t\t\t\t\t// media, a gradient and a dim.\n\t\t\t\t\t\t\t\t'wp-block-cover__gradient-background':\n\t\t\t\t\t\t\t\t\turl && gradientValue && dimRatio !== 0,\n\t\t\t\t\t\t\t\t'has-background-gradient': gradientValue,\n\t\t\t\t\t\t\t\t[ gradientClass ]: gradientClass,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tstyle={ { backgroundImage: gradientValue, ...bgStyle } }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ isUploadingMedia && <Spinner /> }\n\n\t\t\t\t<CoverPlaceholder\n\t\t\t\t\tdisableMediaButtons\n\t\t\t\t\tonSelectMedia={ onSelectMedia }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\ttoggleUseFeaturedImage={ toggleUseFeaturedImage }\n\t\t\t\t/>\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</TagName>\n\t\t\t{ hasNonContentControls && isSelected && (\n\t\t\t\t<ResizableCoverPopover { ...resizableCoverProps } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default compose( [\n\twithColors( { overlayColor: 'background-color' } ),\n] )( CoverEdit );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAUA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AAKA,IAAAU,OAAA,GAAAV,OAAA;AASA,IAAAW,kBAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,cAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,iBAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,sBAAA,GAAAf,sBAAA,CAAAC,OAAA;AACA,IAAAe,WAAA,GAAAf,OAAA;AAMA,IAAAgB,UAAA,GAAAhB,OAAA;AAAuD,IAAAiB,WAAA,GAAAjB,OAAA;AAjDvD;AACA;AACA;;AAGA;AACA;AACA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AO,IAAE,CAAC,eAEjC,IAAA7K,WAAA,CAAAwI,GAAA,EAAC5I,iBAAA,CAAA6I,OAAgB;QAChBqC,mBAAmB;QACnB5G,aAAa,EAAGA,aAAe;QAC/ByF,OAAO,EAAGtE,aAAe;QACzBgD,sBAAsB,EAAGA;MAAwB,CACjD,CAAC,eACF,IAAArI,WAAA,CAAAwI,GAAA;QAAA,GAAUZ;MAAgB,CAAI,CAAC;IAAA,CACvB,CAAC,EACR/B,qBAAqB,IAAIjF,UAAU,iBACpC,IAAAZ,WAAA,CAAAwI,GAAA,EAAC3I,sBAAA,CAAA4I,OAAqB;MAAA,GAAMI;IAAmB,CAAI,CACnD;EAAA,CACA,CAAC;AAEL;AAAC,IAAAkC,QAAA,GAAAC,OAAA,CAAAvC,OAAA,GAEc,IAAAwC,gBAAO,EAAE,CACvB,IAAAC,uBAAU,EAAE;EAAErK,YAAY,EAAE;AAAmB,CAAE,CAAC,CACjD,CAAC,CAAEH,SAAU,CAAC","ignoreList":[]}
|
package/build/cover/index.js
CHANGED
|
@@ -175,21 +175,21 @@ const settings = exports.settings = {
|
|
|
175
175
|
attributes: {
|
|
176
176
|
customOverlayColor: '#065174',
|
|
177
177
|
dimRatio: 40,
|
|
178
|
-
url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg'
|
|
178
|
+
url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg',
|
|
179
|
+
style: {
|
|
180
|
+
typography: {
|
|
181
|
+
fontSize: 48
|
|
182
|
+
},
|
|
183
|
+
color: {
|
|
184
|
+
text: 'white'
|
|
185
|
+
}
|
|
186
|
+
}
|
|
179
187
|
},
|
|
180
188
|
innerBlocks: [{
|
|
181
189
|
name: 'core/paragraph',
|
|
182
190
|
attributes: {
|
|
183
191
|
content: (0, _i18n.__)('<strong>Snow Patrol</strong>'),
|
|
184
|
-
align: 'center'
|
|
185
|
-
style: {
|
|
186
|
-
typography: {
|
|
187
|
-
fontSize: 48
|
|
188
|
-
},
|
|
189
|
-
color: {
|
|
190
|
-
text: 'white'
|
|
191
|
-
}
|
|
192
|
-
}
|
|
192
|
+
align: 'center'
|
|
193
193
|
}
|
|
194
194
|
}]
|
|
195
195
|
},
|
package/build/cover/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_icons","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","_transforms","_variations","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","url","type","useFeaturedImage","id","alt","hasParallax","isRepeated","dimRatio","overlayColor","customOverlayColor","isUserOverlayColor","backgroundType","focalPoint","minHeight","minHeightUnit","gradient","customGradient","contentPosition","isDark","allowedBlocks","templateLock","tagName","sizeSlug","usesContext","supports","anchor","align","html","shadow","spacing","padding","margin","blockGap","__experimentalDefaultControls","__experimentalBorder","color","radius","style","width","__experimentalDuotone","heading","text","background","__experimentalSkipSerialization","enableContrastChecker","dimensions","aspectRatio","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","layout","allowJustification","interactivity","clientNavigation","editorStyle","settings","icon","example","innerBlocks","content","__","transforms","save","edit","deprecated","variations","init","initBlock"],"sources":["@wordpress/block-library/src/cover/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { cover as icon } from '@wordpress/icons';\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 variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcustomOverlayColor: '#065174',\n\t\t\tdimRatio: 40,\n\t\t\turl: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg',\n\t\t
|
|
1
|
+
{"version":3,"names":["_i18n","require","_icons","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","_transforms","_variations","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","attributes","url","type","useFeaturedImage","id","alt","hasParallax","isRepeated","dimRatio","overlayColor","customOverlayColor","isUserOverlayColor","backgroundType","focalPoint","minHeight","minHeightUnit","gradient","customGradient","contentPosition","isDark","allowedBlocks","templateLock","tagName","sizeSlug","usesContext","supports","anchor","align","html","shadow","spacing","padding","margin","blockGap","__experimentalDefaultControls","__experimentalBorder","color","radius","style","width","__experimentalDuotone","heading","text","background","__experimentalSkipSerialization","enableContrastChecker","dimensions","aspectRatio","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","layout","allowJustification","interactivity","clientNavigation","editorStyle","settings","icon","example","innerBlocks","content","__","transforms","save","edit","deprecated","variations","init","initBlock"],"sources":["@wordpress/block-library/src/cover/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { cover as icon } from '@wordpress/icons';\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 variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcustomOverlayColor: '#065174',\n\t\t\tdimRatio: 40,\n\t\t\turl: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg',\n\t\t\tstyle: {\n\t\t\t\ttypography: {\n\t\t\t\t\tfontSize: 48,\n\t\t\t\t},\n\t\t\t\tcolor: {\n\t\t\t\t\ttext: 'white',\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcontent: __( '<strong>Snow Patrol</strong>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;MAC7BF,QAAQ,EAAE,EAAE;MACZP,GAAG,EAAE,mDAAmD;MACxDqC,KAAK,EAAE;QACNU,UAAU,EAAE;UACXC,QAAQ,EAAE;QACX,CAAC;QACDb,KAAK,EAAE;UACNM,IAAI,EAAE;QACP;MACD;IACD,CAAC;IACDuB,WAAW,EAAE,CACZ;MACCtE,IAAI,EAAE,gBAAgB;MACtBK,UAAU,EAAE;QACXkE,OAAO,EAAE,IAAAC,QAAE,EAAE,8BAA+B,CAAC;QAC7CxC,KAAK,EAAE;MACR;IACD,CAAC;EAEH,CAAC;EACDyC,UAAU,EAAVA,mBAAU;EACVC,IAAI,EAAJA,aAAI;EACJC,IAAI,EAAJA,aAAI;EACJC,UAAU,EAAVA,mBAAU;EACVC,UAAU,EAAVA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAE/E,IAAI;EAAEJ,QAAQ;EAAEuE;AAAS,CAAE,CAAC;AAACtE,OAAA,CAAAiF,IAAA,GAAAA,IAAA","ignoreList":[]}
|
package/build/cover/save.js
CHANGED
|
@@ -80,19 +80,7 @@ function save({
|
|
|
80
80
|
className: classes,
|
|
81
81
|
style
|
|
82
82
|
}),
|
|
83
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("
|
|
84
|
-
"aria-hidden": "true",
|
|
85
|
-
className: (0, _clsx.default)('wp-block-cover__background', overlayColorClass, (0, _shared.dimRatioToClass)(dimRatio), {
|
|
86
|
-
'has-background-dim': dimRatio !== undefined,
|
|
87
|
-
// For backwards compatibility. Former versions of the Cover Block applied
|
|
88
|
-
// `.wp-block-cover__gradient-background` in the presence of
|
|
89
|
-
// media, a gradient and a dim.
|
|
90
|
-
'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
|
|
91
|
-
'has-background-gradient': gradientValue,
|
|
92
|
-
[gradientClass]: gradientClass
|
|
93
|
-
}),
|
|
94
|
-
style: bgStyle
|
|
95
|
-
}), !useFeaturedImage && isImageBackground && url && (isImgElement ? /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
83
|
+
children: [!useFeaturedImage && isImageBackground && url && (isImgElement ? /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
96
84
|
className: imgClasses,
|
|
97
85
|
alt: alt,
|
|
98
86
|
src: url,
|
|
@@ -121,6 +109,18 @@ function save({
|
|
|
121
109
|
},
|
|
122
110
|
"data-object-fit": "cover",
|
|
123
111
|
"data-object-position": objectPosition
|
|
112
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
113
|
+
"aria-hidden": "true",
|
|
114
|
+
className: (0, _clsx.default)('wp-block-cover__background', overlayColorClass, (0, _shared.dimRatioToClass)(dimRatio), {
|
|
115
|
+
'has-background-dim': dimRatio !== undefined,
|
|
116
|
+
// For backwards compatibility. Former versions of the Cover Block applied
|
|
117
|
+
// `.wp-block-cover__gradient-background` in the presence of
|
|
118
|
+
// media, a gradient and a dim.
|
|
119
|
+
'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
|
|
120
|
+
'has-background-gradient': gradientValue,
|
|
121
|
+
[gradientClass]: gradientClass
|
|
122
|
+
}),
|
|
123
|
+
style: bgStyle
|
|
124
124
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
125
125
|
..._blockEditor.useInnerBlocksProps.save({
|
|
126
126
|
className: 'wp-block-cover__inner-container'
|
package/build/cover/save.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_shared","_jsxRuntime","save","attributes","backgroundType","gradient","contentPosition","customGradient","customOverlayColor","dimRatio","focalPoint","useFeaturedImage","hasParallax","isDark","isRepeated","overlayColor","url","alt","id","minHeight","minHeightProp","minHeightUnit","tagName","Tag","sizeSlug","overlayColorClass","getColorClassName","gradientClass","__experimentalGetGradientClass","isImageBackground","IMAGE_BACKGROUND_TYPE","isVideoBackground","VIDEO_BACKGROUND_TYPE","isImgElement","style","undefined","bgStyle","backgroundColor","background","objectPosition","mediaPosition","backgroundImage","backgroundPosition","classes","clsx","isContentPositionCenter","getPositionClassName","imgClasses","gradientValue","jsxs","useBlockProps","className","children","jsx","
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_shared","_jsxRuntime","save","attributes","backgroundType","gradient","contentPosition","customGradient","customOverlayColor","dimRatio","focalPoint","useFeaturedImage","hasParallax","isDark","isRepeated","overlayColor","url","alt","id","minHeight","minHeightProp","minHeightUnit","tagName","Tag","sizeSlug","overlayColorClass","getColorClassName","gradientClass","__experimentalGetGradientClass","isImageBackground","IMAGE_BACKGROUND_TYPE","isVideoBackground","VIDEO_BACKGROUND_TYPE","isImgElement","style","undefined","bgStyle","backgroundColor","background","objectPosition","mediaPosition","backgroundImage","backgroundPosition","classes","clsx","isContentPositionCenter","getPositionClassName","imgClasses","gradientValue","jsxs","useBlockProps","className","children","jsx","src","role","autoPlay","muted","loop","playsInline","dimRatioToClass","useInnerBlocksProps"],"sources":["@wordpress/block-library/src/cover/save.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseInnerBlocksProps,\n\tgetColorClassName,\n\t__experimentalGetGradientClass,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport {\n\tIMAGE_BACKGROUND_TYPE,\n\tVIDEO_BACKGROUND_TYPE,\n\tdimRatioToClass,\n\tisContentPositionCenter,\n\tgetPositionClassName,\n\tmediaPosition,\n} from './shared';\n\nexport default function save( { attributes } ) {\n\tconst {\n\t\tbackgroundType,\n\t\tgradient,\n\t\tcontentPosition,\n\t\tcustomGradient,\n\t\tcustomOverlayColor,\n\t\tdimRatio,\n\t\tfocalPoint,\n\t\tuseFeaturedImage,\n\t\thasParallax,\n\t\tisDark,\n\t\tisRepeated,\n\t\toverlayColor,\n\t\turl,\n\t\talt,\n\t\tid,\n\t\tminHeight: minHeightProp,\n\t\tminHeightUnit,\n\t\ttagName: Tag,\n\t\tsizeSlug,\n\t} = attributes;\n\tconst overlayColorClass = getColorClassName(\n\t\t'background-color',\n\t\toverlayColor\n\t);\n\tconst gradientClass = __experimentalGetGradientClass( gradient );\n\tconst minHeight =\n\t\tminHeightProp && minHeightUnit\n\t\t\t? `${ minHeightProp }${ minHeightUnit }`\n\t\t\t: minHeightProp;\n\n\tconst isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;\n\tconst isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;\n\n\tconst isImgElement = ! ( hasParallax || isRepeated );\n\n\tconst style = {\n\t\tminHeight: minHeight || undefined,\n\t};\n\n\tconst bgStyle = {\n\t\tbackgroundColor: ! overlayColorClass ? customOverlayColor : undefined,\n\t\tbackground: customGradient ? customGradient : undefined,\n\t};\n\n\tconst objectPosition =\n\t\t// prettier-ignore\n\t\tfocalPoint && isImgElement\n\t\t\t ? mediaPosition(focalPoint)\n\t\t\t : undefined;\n\n\tconst backgroundImage = url ? `url(${ url })` : undefined;\n\n\tconst backgroundPosition = mediaPosition( focalPoint );\n\n\tconst classes = clsx(\n\t\t{\n\t\t\t'is-light': ! isDark,\n\t\t\t'has-parallax': hasParallax,\n\t\t\t'is-repeated': isRepeated,\n\t\t\t'has-custom-content-position':\n\t\t\t\t! isContentPositionCenter( contentPosition ),\n\t\t},\n\t\tgetPositionClassName( contentPosition )\n\t);\n\n\tconst imgClasses = clsx(\n\t\t'wp-block-cover__image-background',\n\t\tid ? `wp-image-${ id }` : null,\n\t\t{\n\t\t\t[ `size-${ sizeSlug }` ]: sizeSlug,\n\t\t\t'has-parallax': hasParallax,\n\t\t\t'is-repeated': isRepeated,\n\t\t}\n\t);\n\n\tconst gradientValue = gradient || customGradient;\n\n\treturn (\n\t\t<Tag { ...useBlockProps.save( { className: classes, style } ) }>\n\t\t\t{ ! useFeaturedImage &&\n\t\t\t\tisImageBackground &&\n\t\t\t\turl &&\n\t\t\t\t( isImgElement ? (\n\t\t\t\t\t<img\n\t\t\t\t\t\tclassName={ imgClasses }\n\t\t\t\t\t\talt={ alt }\n\t\t\t\t\t\tsrc={ url }\n\t\t\t\t\t\tstyle={ { objectPosition } }\n\t\t\t\t\t\tdata-object-fit=\"cover\"\n\t\t\t\t\t\tdata-object-position={ objectPosition }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<div\n\t\t\t\t\t\trole={ alt ? 'img' : undefined }\n\t\t\t\t\t\taria-label={ alt ? alt : undefined }\n\t\t\t\t\t\tclassName={ imgClasses }\n\t\t\t\t\t\tstyle={ { backgroundPosition, backgroundImage } }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t{ isVideoBackground && url && (\n\t\t\t\t<video\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'wp-block-cover__video-background',\n\t\t\t\t\t\t'intrinsic-ignore'\n\t\t\t\t\t) }\n\t\t\t\t\tautoPlay\n\t\t\t\t\tmuted\n\t\t\t\t\tloop\n\t\t\t\t\tplaysInline\n\t\t\t\t\tsrc={ url }\n\t\t\t\t\tstyle={ { objectPosition } }\n\t\t\t\t\tdata-object-fit=\"cover\"\n\t\t\t\t\tdata-object-position={ objectPosition }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t{ /* The `wp-block-cover__background` needs to be immediately before\n\t\t\tthe `wp-block-cover__inner-container`, so the exclusion CSS selector\n\t\t\t`.wp-block-cover__background + .wp-block-cover__inner-container`\n\t\t\tworks properly. If it needs to be changed in the future, the\n\t\t\tselector for the backward compatibility for v14 deprecation also\n\t\t\tneeds change. */ }\n\t\t\t<span\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'wp-block-cover__background',\n\t\t\t\t\toverlayColorClass,\n\t\t\t\t\tdimRatioToClass( dimRatio ),\n\t\t\t\t\t{\n\t\t\t\t\t\t'has-background-dim': dimRatio !== undefined,\n\t\t\t\t\t\t// For backwards compatibility. Former versions of the Cover Block applied\n\t\t\t\t\t\t// `.wp-block-cover__gradient-background` in the presence of\n\t\t\t\t\t\t// media, a gradient and a dim.\n\t\t\t\t\t\t'wp-block-cover__gradient-background':\n\t\t\t\t\t\t\turl && gradientValue && dimRatio !== 0,\n\t\t\t\t\t\t'has-background-gradient': gradientValue,\n\t\t\t\t\t\t[ gradientClass ]: gradientClass,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\tstyle={ bgStyle }\n\t\t\t/>\n\n\t\t\t<div\n\t\t\t\t{ ...useInnerBlocksProps.save( {\n\t\t\t\t\tclassName: 'wp-block-cover__inner-container',\n\t\t\t\t} ) }\n\t\t\t/>\n\t\t</Tag>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAUA,IAAAE,OAAA,GAAAF,OAAA;AAOkB,IAAAG,WAAA,GAAAH,OAAA;AAzBlB;AACA;AACA;;AAGA;AACA;AACA;;AAQA;AACA;AACA;;AAUe,SAASI,IAAIA,CAAE;EAAEC;AAAW,CAAC,EAAG;EAC9C,MAAM;IACLC,cAAc;IACdC,QAAQ;IACRC,eAAe;IACfC,cAAc;IACdC,kBAAkB;IAClBC,QAAQ;IACRC,UAAU;IACVC,gBAAgB;IAChBC,WAAW;IACXC,MAAM;IACNC,UAAU;IACVC,YAAY;IACZC,GAAG;IACHC,GAAG;IACHC,EAAE;IACFC,SAAS,EAAEC,aAAa;IACxBC,aAAa;IACbC,OAAO,EAAEC,GAAG;IACZC;EACD,CAAC,GAAGrB,UAAU;EACd,MAAMsB,iBAAiB,GAAG,IAAAC,8BAAiB,EAC1C,kBAAkB,EAClBX,YACD,CAAC;EACD,MAAMY,aAAa,GAAG,IAAAC,2CAA8B,EAAEvB,QAAS,CAAC;EAChE,MAAMc,SAAS,GACdC,aAAa,IAAIC,aAAa,GAC3B,GAAID,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yBAAyB,EAAEuC,aAAa;QACxC,CAAErB,aAAa,GAAIA;MACpB,CACD,CAAG;MACHO,KAAK,EAAGE;IAAS,CACjB,CAAC,eAEF,IAAAnC,WAAA,CAAAoD,GAAA;MAAA,GACMQ,gCAAmB,CAAC3D,IAAI,CAAE;QAC9BiD,SAAS,EAAE;MACZ,CAAE;IAAC,CACH,CAAC;EAAA,CACE,CAAC;AAER","ignoreList":[]}
|
package/build/cover/shared.js
CHANGED
|
@@ -46,7 +46,7 @@ function dimRatioToClass(ratio) {
|
|
|
46
46
|
return ratio === 50 || ratio === undefined ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10);
|
|
47
47
|
}
|
|
48
48
|
function attributesFromMedia(media) {
|
|
49
|
-
if (!media || !media.url) {
|
|
49
|
+
if (!media || !media.url && !media.src) {
|
|
50
50
|
return {
|
|
51
51
|
url: undefined,
|
|
52
52
|
id: undefined
|
|
@@ -61,19 +61,18 @@ function attributesFromMedia(media) {
|
|
|
61
61
|
if (media.media_type === IMAGE_BACKGROUND_TYPE) {
|
|
62
62
|
mediaType = IMAGE_BACKGROUND_TYPE;
|
|
63
63
|
} else {
|
|
64
|
-
//
|
|
64
|
+
// Only images and videos are accepted so if the media_type is not an image we can assume it is a video.
|
|
65
65
|
// Videos contain the media type of 'file' in the object returned from the rest api.
|
|
66
66
|
mediaType = VIDEO_BACKGROUND_TYPE;
|
|
67
67
|
}
|
|
68
|
-
} else {
|
|
69
68
|
// For media selections originated from existing files in the media library.
|
|
70
|
-
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
69
|
+
} else if (media.type && (media.type === IMAGE_BACKGROUND_TYPE || media.type === VIDEO_BACKGROUND_TYPE)) {
|
|
73
70
|
mediaType = media.type;
|
|
71
|
+
} else {
|
|
72
|
+
return;
|
|
74
73
|
}
|
|
75
74
|
return {
|
|
76
|
-
url: media.url,
|
|
75
|
+
url: media.url || media.src,
|
|
77
76
|
id: media.id,
|
|
78
77
|
alt: media?.alt,
|
|
79
78
|
backgroundType: mediaType,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blob","require","POSITION_CLASSNAMES","center","IMAGE_BACKGROUND_TYPE","exports","VIDEO_BACKGROUND_TYPE","COVER_MIN_HEIGHT","COVER_MAX_HEIGHT","COVER_DEFAULT_HEIGHT","DEFAULT_FOCAL_POINT","x","y","ALLOWED_MEDIA_TYPES","mediaPosition","Math","round","dimRatioToClass","ratio","undefined","attributesFromMedia","media","url","id","isBlobURL","type","getBlobTypeByURL","mediaType","media_type","alt","backgroundType","hasParallax","isContentPositionCenter","contentPosition","getPositionClassName"],"sources":["@wordpress/block-library/src/cover/shared.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlobTypeByURL, isBlobURL } from '@wordpress/blob';\n\nconst POSITION_CLASSNAMES = {\n\t'top left': 'is-position-top-left',\n\t'top center': 'is-position-top-center',\n\t'top right': 'is-position-top-right',\n\t'center left': 'is-position-center-left',\n\t'center center': 'is-position-center-center',\n\tcenter: 'is-position-center-center',\n\t'center right': 'is-position-center-right',\n\t'bottom left': 'is-position-bottom-left',\n\t'bottom center': 'is-position-bottom-center',\n\t'bottom right': 'is-position-bottom-right',\n};\n\nexport const IMAGE_BACKGROUND_TYPE = 'image';\nexport const VIDEO_BACKGROUND_TYPE = 'video';\nexport const COVER_MIN_HEIGHT = 50;\nexport const COVER_MAX_HEIGHT = 1000;\nexport const COVER_DEFAULT_HEIGHT = 300;\nexport const DEFAULT_FOCAL_POINT = { x: 0.5, y: 0.5 };\nexport const ALLOWED_MEDIA_TYPES = [ 'image', 'video' ];\n\nexport function mediaPosition( { x, y } = DEFAULT_FOCAL_POINT ) {\n\treturn `${ Math.round( x * 100 ) }% ${ Math.round( y * 100 ) }%`;\n}\n\nexport function dimRatioToClass( ratio ) {\n\treturn ratio === 50 || ratio === undefined\n\t\t? null\n\t\t: 'has-background-dim-' + 10 * Math.round( ratio / 10 );\n}\n\nexport function attributesFromMedia( media ) {\n\tif ( ! media || ! media.url ) {\n\t\treturn {\n\t\t\turl: undefined,\n\t\t\tid: undefined,\n\t\t};\n\t}\n\n\tif ( isBlobURL( media.url ) ) {\n\t\tmedia.type = getBlobTypeByURL( media.url );\n\t}\n\n\tlet mediaType;\n\t// For media selections originated from a file upload.\n\tif ( media.media_type ) {\n\t\tif ( media.media_type === IMAGE_BACKGROUND_TYPE ) {\n\t\t\tmediaType = IMAGE_BACKGROUND_TYPE;\n\t\t} else {\n\t\t\t//
|
|
1
|
+
{"version":3,"names":["_blob","require","POSITION_CLASSNAMES","center","IMAGE_BACKGROUND_TYPE","exports","VIDEO_BACKGROUND_TYPE","COVER_MIN_HEIGHT","COVER_MAX_HEIGHT","COVER_DEFAULT_HEIGHT","DEFAULT_FOCAL_POINT","x","y","ALLOWED_MEDIA_TYPES","mediaPosition","Math","round","dimRatioToClass","ratio","undefined","attributesFromMedia","media","url","src","id","isBlobURL","type","getBlobTypeByURL","mediaType","media_type","alt","backgroundType","hasParallax","isContentPositionCenter","contentPosition","getPositionClassName"],"sources":["@wordpress/block-library/src/cover/shared.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { getBlobTypeByURL, isBlobURL } from '@wordpress/blob';\n\nconst POSITION_CLASSNAMES = {\n\t'top left': 'is-position-top-left',\n\t'top center': 'is-position-top-center',\n\t'top right': 'is-position-top-right',\n\t'center left': 'is-position-center-left',\n\t'center center': 'is-position-center-center',\n\tcenter: 'is-position-center-center',\n\t'center right': 'is-position-center-right',\n\t'bottom left': 'is-position-bottom-left',\n\t'bottom center': 'is-position-bottom-center',\n\t'bottom right': 'is-position-bottom-right',\n};\n\nexport const IMAGE_BACKGROUND_TYPE = 'image';\nexport const VIDEO_BACKGROUND_TYPE = 'video';\nexport const COVER_MIN_HEIGHT = 50;\nexport const COVER_MAX_HEIGHT = 1000;\nexport const COVER_DEFAULT_HEIGHT = 300;\nexport const DEFAULT_FOCAL_POINT = { x: 0.5, y: 0.5 };\nexport const ALLOWED_MEDIA_TYPES = [ 'image', 'video' ];\n\nexport function mediaPosition( { x, y } = DEFAULT_FOCAL_POINT ) {\n\treturn `${ Math.round( x * 100 ) }% ${ Math.round( y * 100 ) }%`;\n}\n\nexport function dimRatioToClass( ratio ) {\n\treturn ratio === 50 || ratio === undefined\n\t\t? null\n\t\t: 'has-background-dim-' + 10 * Math.round( ratio / 10 );\n}\n\nexport function attributesFromMedia( media ) {\n\tif ( ! media || ( ! media.url && ! media.src ) ) {\n\t\treturn {\n\t\t\turl: undefined,\n\t\t\tid: undefined,\n\t\t};\n\t}\n\n\tif ( isBlobURL( media.url ) ) {\n\t\tmedia.type = getBlobTypeByURL( media.url );\n\t}\n\n\tlet mediaType;\n\t// For media selections originated from a file upload.\n\tif ( media.media_type ) {\n\t\tif ( media.media_type === IMAGE_BACKGROUND_TYPE ) {\n\t\t\tmediaType = IMAGE_BACKGROUND_TYPE;\n\t\t} else {\n\t\t\t// Only images and videos are accepted so if the media_type is not an image we can assume it is a video.\n\t\t\t// Videos contain the media type of 'file' in the object returned from the rest api.\n\t\t\tmediaType = VIDEO_BACKGROUND_TYPE;\n\t\t}\n\t\t// For media selections originated from existing files in the media library.\n\t} else if (\n\t\tmedia.type &&\n\t\t( media.type === IMAGE_BACKGROUND_TYPE ||\n\t\t\tmedia.type === VIDEO_BACKGROUND_TYPE )\n\t) {\n\t\tmediaType = media.type;\n\t} else {\n\t\treturn;\n\t}\n\n\treturn {\n\t\turl: media.url || media.src,\n\t\tid: media.id,\n\t\talt: media?.alt,\n\t\tbackgroundType: mediaType,\n\t\t...( mediaType === VIDEO_BACKGROUND_TYPE\n\t\t\t? { hasParallax: undefined }\n\t\t\t: {} ),\n\t};\n}\n\n/**\n * Checks of the contentPosition is the center (default) position.\n *\n * @param {string} contentPosition The current content position.\n * @return {boolean} Whether the contentPosition is center.\n */\nexport function isContentPositionCenter( contentPosition ) {\n\treturn (\n\t\t! contentPosition ||\n\t\tcontentPosition === 'center center' ||\n\t\tcontentPosition === 'center'\n\t);\n}\n\n/**\n * Retrieves the className for the current contentPosition.\n * The default position (center) will not have a className.\n *\n * @param {string} contentPosition The current content position.\n * @return {string} The className assigned to the contentPosition.\n */\nexport function getPositionClassName( contentPosition ) {\n\t/*\n\t * Only render a className if the contentPosition is not center (the default).\n\t */\n\tif ( isContentPositionCenter( contentPosition ) ) {\n\t\treturn '';\n\t}\n\n\treturn POSITION_CLASSNAMES[ contentPosition ];\n}\n"],"mappings":";;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,mBAAmB,GAAG;EAC3B,UAAU,EAAE,sBAAsB;EAClC,YAAY,EAAE,wBAAwB;EACtC,WAAW,EAAE,uBAAuB;EACpC,aAAa,EAAE,yBAAyB;EACxC,eAAe,EAAE,2BAA2B;EAC5CC,MAAM,EAAE,2BAA2B;EACnC,cAAc,EAAE,0BAA0B;EAC1C,aAAa,EAAE,yBAAyB;EACxC,eAAe,EAAE,2BAA2B;EAC5C,cAAc,EAAE;AACjB,CAAC;AAEM,MAAMC,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,OAAO;AACrC,MAAME,qBAAqB,GAAAD,OAAA,CAAAC,qBAAA,GAAG,OAAO;AACrC,MAAMC,gBAAgB,GAAAF,OAAA,CAAAE,gBAAA,GAAG,EAAE;AAC3B,MAAMC,gBAAgB,GAAAH,OAAA,CAAAG,gBAAA,GAAG,IAAI;AAC7B,MAAMC,oBAAoB,GAAAJ,OAAA,CAAAI,oBAAA,GAAG,GAAG;AAChC,MAAMC,mBAAmB,GAAAL,OAAA,CAAAK,mBAAA,GAAG;EAAEC,CAAC,EAAE,GAAG;EAAEC,CAAC,EAAE;AAAI,CAAC;AAC9C,MAAMC,mBAAmB,GAAAR,OAAA,CAAAQ,mBAAA,GAAG,CAAE,OAAO,EAAE,OAAO,CAAE;AAEhD,SAASC,aAAaA,CAAE;EAAEH,CAAC;EAAEC;AAAE,CAAC,GAAGF,mBAAmB,EAAG;EAC/D,OA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AET,KAAK,EAAES,GAAG;IACfC,cAAc,EAAEH,SAAS;IACzB,IAAKA,SAAS,KAAKtB,qBAAqB,GACrC;MAAE0B,WAAW,EAAEb;IAAU,CAAC,GAC1B,CAAC,CAAC;EACN,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASc,uBAAuBA,CAAEC,eAAe,EAAG;EAC1D,OACC,CAAEA,eAAe,IACjBA,eAAe,KAAK,eAAe,IACnCA,eAAe,KAAK,QAAQ;AAE9B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,oBAAoBA,CAAED,eAAe,EAAG;EACvD;AACD;AACA;EACC,IAAKD,uBAAuB,CAAEC,eAAgB,CAAC,EAAG;IACjD,OAAO,EAAE;EACV;EAEA,OAAOhC,mBAAmB,CAAEgC,eAAe,CAAE;AAC9C","ignoreList":[]}
|
package/build/details/index.js
CHANGED
|
@@ -40,6 +40,7 @@ const metadata = exports.metadata = {
|
|
|
40
40
|
supports: {
|
|
41
41
|
__experimentalOnEnter: true,
|
|
42
42
|
align: ["wide", "full"],
|
|
43
|
+
anchor: true,
|
|
43
44
|
color: {
|
|
44
45
|
gradients: true,
|
|
45
46
|
link: true,
|
|
@@ -104,6 +105,25 @@ const settings = exports.settings = {
|
|
|
104
105
|
}
|
|
105
106
|
}]
|
|
106
107
|
},
|
|
108
|
+
__experimentalLabel(attributes, {
|
|
109
|
+
context
|
|
110
|
+
}) {
|
|
111
|
+
const {
|
|
112
|
+
summary
|
|
113
|
+
} = attributes;
|
|
114
|
+
const customName = attributes?.metadata?.name;
|
|
115
|
+
const hasSummary = summary?.trim().length > 0;
|
|
116
|
+
|
|
117
|
+
// In the list view, use the block's summary as the label.
|
|
118
|
+
// If the summary is empty, fall back to the default label.
|
|
119
|
+
if (context === 'list-view' && (customName || hasSummary)) {
|
|
120
|
+
return customName || summary;
|
|
121
|
+
}
|
|
122
|
+
if (context === 'accessibility') {
|
|
123
|
+
return !hasSummary ? (0, _i18n.__)('Details. Empty.') : (0, _i18n.sprintf)(/* translators: accessibility text; summary title. */
|
|
124
|
+
(0, _i18n.__)('Details. %s'), summary);
|
|
125
|
+
}
|
|
126
|
+
},
|
|
107
127
|
save: _save.default,
|
|
108
128
|
edit: _edit.default,
|
|
109
129
|
transforms: _transforms.default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_icons","require","_i18n","_initBlock","_interopRequireDefault","_edit","_save","_transforms","metadata","exports","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","showContent","type","summary","source","selector","supports","__experimentalOnEnter","align","color","gradients","link","__experimentalDefaultControls","background","text","__experimentalBorder","width","style","html","spacing","margin","padding","blockGap","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","layout","allowEditing","interactivity","clientNavigation","editorStyle","settings","icon","example","innerBlocks","content","__","save","edit","transforms","init","initBlock"],"sources":["@wordpress/block-library/src/details/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { details as icon } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tsummary: 'La Mancha',\n\t\t\tshowContent: true,\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcontent: __(\n\t\t\t\t\t\t'In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\tsave,\n\tedit,\n\ttransforms,\n};\n\nexport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initBlock","_interopRequireDefault","_edit","_save","_transforms","metadata","exports","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","showContent","type","summary","source","selector","supports","__experimentalOnEnter","align","anchor","color","gradients","link","__experimentalDefaultControls","background","text","__experimentalBorder","width","style","html","spacing","margin","padding","blockGap","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","layout","allowEditing","interactivity","clientNavigation","editorStyle","settings","icon","example","innerBlocks","content","__","__experimentalLabel","context","customName","hasSummary","trim","length","sprintf","save","edit","transforms","init","initBlock"],"sources":["@wordpress/block-library/src/details/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { details as icon } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tsummary: 'La Mancha',\n\t\t\tshowContent: true,\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcontent: __(\n\t\t\t\t\t\t'In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.'\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\t__experimentalLabel( attributes, { context } ) {\n\t\tconst { summary } = attributes;\n\n\t\tconst customName = attributes?.metadata?.name;\n\t\tconst hasSummary = summary?.trim().length > 0;\n\n\t\t// In the list view, use the block's summary as the label.\n\t\t// If the summary is empty, fall back to the default label.\n\t\tif ( context === 'list-view' && ( customName || hasSummary ) ) {\n\t\t\treturn customName || summary;\n\t\t}\n\n\t\tif ( context === 'accessibility' ) {\n\t\t\treturn ! hasSummary\n\t\t\t\t? __( 'Details. Empty.' )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text; summary title. */\n\t\t\t\t\t\t__( 'Details. %s' ),\n\t\t\t\t\t\tsummary\n\t\t\t\t );\n\t\t}\n\t},\n\tsave,\n\tedit,\n\ttransforms,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,KAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,WAAA,GAAAH,sBAAA,CAAAH,OAAA;AAbA;AACA;AACA;AAIA;AACA;AACA;AAFA,MAAAO,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,WAAA;MAAAC,IAAA;MAAA;IAAA;IAAAC,OAAA;MAAAD,IAAA;MAAAE,MAAA;MAAAC,QAAA;IAAA;EAAA;EAAAC,QAAA;IAAAC,qBAAA;IAAAC,KAAA;IAAAC,MAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,IAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;MAAA;IAAA;IAAAC,oBAAA;MAAAN,KAAA;MAAAO,KAAA;MAAAC,KAAA;IAAA;IAAAC,IAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,OAAA;MAAAC,QAAA;MAAAV,6BAAA;QAAAQ,MAAA;QAAAC,OAAA;MAAA;IAAA;IAAAE,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;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I,EAAJA,aAAI;EACJC,UAAU,EAAVA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAE7D,IAAI;EAAEJ,QAAQ;EAAEgD;AAAS,CAAE,CAAC;AAAC/C,OAAA,CAAA+D,IAAA,GAAAA,IAAA","ignoreList":[]}
|
package/build/file/edit.js
CHANGED
|
@@ -103,6 +103,7 @@ function FileEdit({
|
|
|
103
103
|
// This effect should only run on mount.
|
|
104
104
|
}, []);
|
|
105
105
|
function onSelectFile(newMedia) {
|
|
106
|
+
var _attributes$displayPr, _attributes$previewHe;
|
|
106
107
|
if (!newMedia || !newMedia.url) {
|
|
107
108
|
// Reset attributes.
|
|
108
109
|
setAttributes({
|
|
@@ -122,15 +123,18 @@ function FileEdit({
|
|
|
122
123
|
return;
|
|
123
124
|
}
|
|
124
125
|
const isPdf = newMedia.url.endsWith('.pdf');
|
|
126
|
+
const pdfAttributes = {
|
|
127
|
+
displayPreview: isPdf ? (_attributes$displayPr = attributes.displayPreview) !== null && _attributes$displayPr !== void 0 ? _attributes$displayPr : true : undefined,
|
|
128
|
+
previewHeight: isPdf ? (_attributes$previewHe = attributes.previewHeight) !== null && _attributes$previewHe !== void 0 ? _attributes$previewHe : 600 : undefined
|
|
129
|
+
};
|
|
125
130
|
setAttributes({
|
|
126
131
|
href: newMedia.url,
|
|
127
132
|
fileName: newMedia.title,
|
|
128
133
|
textLinkHref: newMedia.url,
|
|
129
134
|
id: newMedia.id,
|
|
130
|
-
displayPreview: isPdf ? true : undefined,
|
|
131
|
-
previewHeight: isPdf ? 600 : undefined,
|
|
132
135
|
fileId: `wp-block-file--media-${clientId}`,
|
|
133
|
-
blob: undefined
|
|
136
|
+
blob: undefined,
|
|
137
|
+
...pdfAttributes
|
|
134
138
|
});
|
|
135
139
|
setTemporaryURL();
|
|
136
140
|
}
|
|
@@ -194,7 +198,7 @@ function FileEdit({
|
|
|
194
198
|
}),
|
|
195
199
|
labels: {
|
|
196
200
|
title: (0, _i18n.__)('File'),
|
|
197
|
-
instructions: (0, _i18n.__)('
|
|
201
|
+
instructions: (0, _i18n.__)('Drag and drop a file, upload, or choose from your library.')
|
|
198
202
|
},
|
|
199
203
|
onSelect: onSelectFile,
|
|
200
204
|
onError: onUploadError,
|