@wordpress/block-editor 14.21.0 → 14.21.1-next.719a03cbe.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/build/components/background-image-control/index.js +0 -4
- package/build/components/background-image-control/index.js.map +1 -1
- package/build/components/block-list/block-invalid-warning.native.js +1 -1
- package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build/components/block-lock/modal.js +1 -0
- package/build/components/block-lock/modal.js.map +1 -1
- package/build/components/image-size-control/index.js +1 -1
- package/build/components/image-size-control/index.js.map +1 -1
- package/build/components/use-paste-styles/index.js +2 -2
- package/build/components/use-paste-styles/index.js.map +1 -1
- package/build/utils/use-notify-copy.js +2 -2
- package/build/utils/use-notify-copy.js.map +1 -1
- package/build-module/components/background-image-control/index.js +0 -4
- package/build-module/components/background-image-control/index.js.map +1 -1
- package/build-module/components/block-list/block-invalid-warning.native.js +1 -1
- package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
- package/build-module/components/block-lock/modal.js +1 -0
- package/build-module/components/block-lock/modal.js.map +1 -1
- package/build-module/components/image-size-control/index.js +1 -1
- package/build-module/components/image-size-control/index.js.map +1 -1
- package/build-module/components/use-paste-styles/index.js +2 -2
- package/build-module/components/use-paste-styles/index.js.map +1 -1
- package/build-module/utils/use-notify-copy.js +2 -2
- package/build-module/utils/use-notify-copy.js.map +1 -1
- package/build-style/style-rtl.css +3 -12
- package/build-style/style.css +3 -12
- package/package.json +34 -34
- package/src/components/background-image-control/index.js +1 -8
- package/src/components/background-image-control/style.scss +3 -7
- package/src/components/block-list/block-invalid-warning.native.js +1 -1
- package/src/components/block-lock/modal.js +1 -0
- package/src/components/block-lock/style.scss +0 -6
- package/src/components/image-size-control/index.js +1 -1
- package/src/components/use-paste-styles/index.js +2 -2
- package/src/utils/use-notify-copy.js +2 -2
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -104,7 +104,6 @@ function InspectorImagePreviewItem({
|
|
|
104
104
|
toggleProps = {},
|
|
105
105
|
filename,
|
|
106
106
|
label,
|
|
107
|
-
className,
|
|
108
107
|
onToggleCallback = noop
|
|
109
108
|
}) {
|
|
110
109
|
const {
|
|
@@ -149,9 +148,7 @@ function InspectorImagePreviewItem({
|
|
|
149
148
|
};
|
|
150
149
|
return as === 'button' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
|
|
151
150
|
__next40pxDefaultSize: true,
|
|
152
|
-
className: className,
|
|
153
151
|
...restToggleProps,
|
|
154
|
-
"aria-expanded": isOpen,
|
|
155
152
|
children: renderPreviewContent()
|
|
156
153
|
}) : renderPreviewContent();
|
|
157
154
|
}
|
|
@@ -319,7 +316,6 @@ function BackgroundImageControls({
|
|
|
319
316
|
})
|
|
320
317
|
},
|
|
321
318
|
name: /*#__PURE__*/(0, _jsxRuntime.jsx)(InspectorImagePreviewItem, {
|
|
322
|
-
className: "block-editor-global-styles-background-panel__image-preview",
|
|
323
319
|
imgUrl: url,
|
|
324
320
|
filename: title,
|
|
325
321
|
label: imgLabel
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_notices","_url","_element","_data","_dom","_blob","_utils","_backgroundPanel","_object","_mediaReplaceFlow","_store","_privateKeys","_jsxRuntime","IMAGE_BACKGROUND_TYPE","BACKGROUND_POPOVER_PROPS","placement","offset","shift","className","noop","backgroundSizeHelpText","value","undefined","__","coordsToBackgroundPosition","isNaN","x","y","exports","backgroundPositionToCoords","split","map","v","parseFloat","InspectorImagePreviewItem","as","imgUrl","toggleProps","filename","label","onToggleCallback","isOpen","restToggleProps","useEffect","renderPreviewContent","jsxs","__experimentalHStack","justify","children","jsx","style","backgroundImage","FlexItem","flexGrow","__experimentalTruncate","numberOfLines","VisuallyHidden","sprintf","Button","__next40pxDefaultSize","BackgroundControlsPanel","url","onToggle","hasImageValue","imgLabel","getFilename","Dropdown","popoverProps","renderToggle","onClick","renderContent","__experimentalDropdownContentWrapper","paddingSize","LoadingSpinner","Placeholder","Spinner","BackgroundImageControls","onChange","inheritedValue","onRemoveImage","onResetImage","displayInPanel","defaultValues","containerRef","isUploading","setIsUploading","useState","getSettings","useSelect","blockEditorStore","id","title","background","createErrorNotice","useDispatch","noticesStore","onUploadError","message","type","resetBackgroundImage","setImmutably","onSelectMedia","media","isBlobURL","media_type","sizeValue","backgroundSize","positionValue","backgroundPosition","source","closeAndFocus","onFilesDrop","filesList","mediaUpload","allowedTypes","onFileChange","image","onError","multiple","hasValue","hasBackgroundImageValue","window","requestAnimationFrame","toggleButton","focus","tabbable","find","current","onRemove","canRemove","default","mediaId","mediaURL","accept","onSelect","clsx","name","props","onReset","MenuItem","DropZone","BackgroundSizeControls","repeatValue","backgroundRepeat","imageValue","isUploadedImage","attachmentValue","backgroundAttachment","currentValueForToggle","includes","repeatCheckedValue","updateBackgroundSize","next","nextRepeat","nextPosition","updateBackgroundPosition","toggleIsRepeated","toggleScrollWithPage","backgroundPositionValue","__experimentalVStack","spacing","FocalPointPicker","__nextHasNoMarginBottom","ToggleControl","checked","__experimentalToggleGroupControl","size","isBlock","help","__experimentalToggleGroupControlOption","_x","__experimentalUnitControl","__unstableInputWidth","min","placeholder","disabled","BackgroundImagePanel","settings","globalStyles","_links","select","_settings","globalStylesDataKey","globalStylesLinksDataKey","resolvedInheritedValue","useMemo","resolvedValues","Object","entries","forEach","key","backgroundValue","getResolvedValue","styles","resetBackground","shouldShowBackgroundImageControls","isDropDownOpen","setIsDropDownOpen","useRef","ref"],"sources":["@wordpress/block-editor/src/components/background-image-control/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tToggleControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalVStack as VStack,\n\tDropZone,\n\tFlexItem,\n\tFocalPointPicker,\n\tMenuItem,\n\tVisuallyHidden,\n\t__experimentalHStack as HStack,\n\t__experimentalTruncate as Truncate,\n\tDropdown,\n\tPlaceholder,\n\tSpinner,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\tButton,\n} from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { getFilename } from '@wordpress/url';\nimport { useRef, useState, useEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { focus } from '@wordpress/dom';\nimport { isBlobURL } from '@wordpress/blob';\n\n/**\n * Internal dependencies\n */\nimport { getResolvedValue } from '../global-styles/utils';\nimport { hasBackgroundImageValue } from '../global-styles/background-panel';\nimport { setImmutably } from '../../utils/object';\nimport MediaReplaceFlow from '../media-replace-flow';\nimport { store as blockEditorStore } from '../../store';\n\nimport {\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n} from '../../store/private-keys';\n\nconst IMAGE_BACKGROUND_TYPE = 'image';\n\nconst BACKGROUND_POPOVER_PROPS = {\n\tplacement: 'left-start',\n\toffset: 36,\n\tshift: true,\n\tclassName: 'block-editor-global-styles-background-panel__popover',\n};\nconst noop = () => {};\n\n/**\n * Get the help text for the background size control.\n *\n * @param {string} value backgroundSize value.\n * @return {string} Translated help text.\n */\nfunction backgroundSizeHelpText( value ) {\n\tif ( value === 'cover' || value === undefined ) {\n\t\treturn __( 'Image covers the space evenly.' );\n\t}\n\tif ( value === 'contain' ) {\n\t\treturn __( 'Image is contained without distortion.' );\n\t}\n\treturn __( 'Image has a fixed width.' );\n}\n\n/**\n * Converts decimal x and y coords from FocalPointPicker to percentage-based values\n * to use as backgroundPosition value.\n *\n * @param {{x?:number, y?:number}} value FocalPointPicker coords.\n * @return {string} \t\t\t\t backgroundPosition value.\n */\nexport const coordsToBackgroundPosition = ( value ) => {\n\tif ( ! value || ( isNaN( value.x ) && isNaN( value.y ) ) ) {\n\t\treturn undefined;\n\t}\n\n\tconst x = isNaN( value.x ) ? 0.5 : value.x;\n\tconst y = isNaN( value.y ) ? 0.5 : value.y;\n\n\treturn `${ x * 100 }% ${ y * 100 }%`;\n};\n\n/**\n * Converts backgroundPosition value to x and y coords for FocalPointPicker.\n *\n * @param {string} value backgroundPosition value.\n * @return {{x?:number, y?:number}} FocalPointPicker coords.\n */\nexport const backgroundPositionToCoords = ( value ) => {\n\tif ( ! value ) {\n\t\treturn { x: undefined, y: undefined };\n\t}\n\n\tlet [ x, y ] = value.split( ' ' ).map( ( v ) => parseFloat( v ) / 100 );\n\tx = isNaN( x ) ? undefined : x;\n\ty = isNaN( y ) ? x : y;\n\n\treturn { x, y };\n};\n\nfunction InspectorImagePreviewItem( {\n\tas = 'span',\n\timgUrl,\n\ttoggleProps = {},\n\tfilename,\n\tlabel,\n\tclassName,\n\tonToggleCallback = noop,\n} ) {\n\tconst { isOpen, ...restToggleProps } = toggleProps;\n\n\tuseEffect( () => {\n\t\tif ( typeof isOpen !== 'undefined' ) {\n\t\t\tonToggleCallback( isOpen );\n\t\t}\n\t}, [ isOpen, onToggleCallback ] );\n\n\tconst renderPreviewContent = () => {\n\t\treturn (\n\t\t\t<HStack\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\tas=\"span\"\n\t\t\t\tclassName=\"block-editor-global-styles-background-panel__inspector-preview-inner\"\n\t\t\t>\n\t\t\t\t{ imgUrl && (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName=\"block-editor-global-styles-background-panel__inspector-image-indicator-wrapper\"\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"block-editor-global-styles-background-panel__inspector-image-indicator\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tbackgroundImage: `url(${ imgUrl })`,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t<FlexItem as=\"span\" style={ imgUrl ? {} : { flexGrow: 1 } }>\n\t\t\t\t\t<Truncate\n\t\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\t\tclassName=\"block-editor-global-styles-background-panel__inspector-media-replace-title\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Truncate>\n\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t{ imgUrl\n\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: file name */\n\t\t\t\t\t\t\t\t\t__( 'Background image: %s' ),\n\t\t\t\t\t\t\t\t\tfilename || label\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: __( 'No background image selected' ) }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t</FlexItem>\n\t\t\t</HStack>\n\t\t);\n\t};\n\n\treturn as === 'button' ? (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tclassName={ className }\n\t\t\t{ ...restToggleProps }\n\t\t\taria-expanded={ isOpen }\n\t\t>\n\t\t\t{ renderPreviewContent() }\n\t\t</Button>\n\t) : (\n\t\trenderPreviewContent()\n\t);\n}\n\nfunction BackgroundControlsPanel( {\n\tlabel,\n\tfilename,\n\turl: imgUrl,\n\tchildren,\n\tonToggle: onToggleCallback = noop,\n\thasImageValue,\n} ) {\n\tif ( ! hasImageValue ) {\n\t\treturn;\n\t}\n\n\tconst imgLabel =\n\t\tlabel || getFilename( imgUrl ) || __( 'Add background image' );\n\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ BACKGROUND_POPOVER_PROPS }\n\t\t\trenderToggle={ ( { onToggle, isOpen } ) => {\n\t\t\t\tconst toggleProps = {\n\t\t\t\t\tonClick: onToggle,\n\t\t\t\t\tclassName:\n\t\t\t\t\t\t'block-editor-global-styles-background-panel__dropdown-toggle',\n\t\t\t\t\t'aria-expanded': isOpen,\n\t\t\t\t\t'aria-label': __(\n\t\t\t\t\t\t'Background size, position and repeat options.'\n\t\t\t\t\t),\n\t\t\t\t\tisOpen,\n\t\t\t\t};\n\t\t\t\treturn (\n\t\t\t\t\t<InspectorImagePreviewItem\n\t\t\t\t\t\timgUrl={ imgUrl }\n\t\t\t\t\t\tfilename={ filename }\n\t\t\t\t\t\tlabel={ imgLabel }\n\t\t\t\t\t\ttoggleProps={ toggleProps }\n\t\t\t\t\t\tas=\"button\"\n\t\t\t\t\t\tonToggleCallback={ onToggleCallback }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trenderContent={ () => (\n\t\t\t\t<DropdownContentWrapper\n\t\t\t\t\tclassName=\"block-editor-global-styles-background-panel__dropdown-content-wrapper\"\n\t\t\t\t\tpaddingSize=\"medium\"\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</DropdownContentWrapper>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nfunction LoadingSpinner() {\n\treturn (\n\t\t<Placeholder className=\"block-editor-global-styles-background-panel__loading\">\n\t\t\t<Spinner />\n\t\t</Placeholder>\n\t);\n}\n\nfunction BackgroundImageControls( {\n\tonChange,\n\tstyle,\n\tinheritedValue,\n\tonRemoveImage = noop,\n\tonResetImage = noop,\n\tdisplayInPanel,\n\tdefaultValues,\n\tcontainerRef,\n} ) {\n\tconst [ isUploading, setIsUploading ] = useState( false );\n\tconst { getSettings } = useSelect( blockEditorStore );\n\n\tconst { id, title, url } = style?.background?.backgroundImage || {\n\t\t...inheritedValue?.background?.backgroundImage,\n\t};\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t\tsetIsUploading( false );\n\t};\n\n\tconst resetBackgroundImage = () =>\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tstyle,\n\t\t\t\t[ 'background', 'backgroundImage' ],\n\t\t\t\tundefined\n\t\t\t)\n\t\t);\n\n\tconst onSelectMedia = ( media ) => {\n\t\tif ( ! media || ! media.url ) {\n\t\t\tresetBackgroundImage();\n\t\t\tsetIsUploading( false );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isBlobURL( media.url ) ) {\n\t\t\tsetIsUploading( true );\n\t\t\treturn;\n\t\t}\n\n\t\t// For media selections originated from a file upload.\n\t\tif (\n\t\t\t( media.media_type &&\n\t\t\t\tmedia.media_type !== IMAGE_BACKGROUND_TYPE ) ||\n\t\t\t( ! media.media_type &&\n\t\t\t\tmedia.type &&\n\t\t\t\tmedia.type !== IMAGE_BACKGROUND_TYPE )\n\t\t) {\n\t\t\tonUploadError(\n\t\t\t\t__( 'Only images can be used as a background image.' )\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tconst sizeValue =\n\t\t\tstyle?.background?.backgroundSize || defaultValues?.backgroundSize;\n\t\tconst positionValue = style?.background?.backgroundPosition;\n\t\tonChange(\n\t\t\tsetImmutably( style, [ 'background' ], {\n\t\t\t\t...style?.background,\n\t\t\t\tbackgroundImage: {\n\t\t\t\t\turl: media.url,\n\t\t\t\t\tid: media.id,\n\t\t\t\t\tsource: 'file',\n\t\t\t\t\ttitle: media.title || undefined,\n\t\t\t\t},\n\t\t\t\tbackgroundPosition:\n\t\t\t\t\t/*\n\t\t\t\t\t * A background image uploaded and set in the editor receives a default background position of '50% 0',\n\t\t\t\t\t * when the background image size is the equivalent of \"Tile\".\n\t\t\t\t\t * This is to increase the chance that the image's focus point is visible.\n\t\t\t\t\t * This is in-editor only to assist with the user experience.\n\t\t\t\t\t */\n\t\t\t\t\t! positionValue && ( 'auto' === sizeValue || ! sizeValue )\n\t\t\t\t\t\t? '50% 0'\n\t\t\t\t\t\t: positionValue,\n\t\t\t\tbackgroundSize: sizeValue,\n\t\t\t} )\n\t\t);\n\t\tsetIsUploading( false );\n\t\t// Close the dropdown and focus the toggle button.\n\t\tcloseAndFocus();\n\t};\n\n\t// Drag and drop callback, restricting image to one.\n\tconst onFilesDrop = ( filesList ) => {\n\t\tgetSettings().mediaUpload( {\n\t\t\tallowedTypes: [ IMAGE_BACKGROUND_TYPE ],\n\t\t\tfilesList,\n\t\t\tonFileChange( [ image ] ) {\n\t\t\t\tonSelectMedia( image );\n\t\t\t},\n\t\t\tonError: onUploadError,\n\t\t\tmultiple: false,\n\t\t} );\n\t};\n\n\tconst hasValue = hasBackgroundImageValue( style );\n\n\tconst closeAndFocus = () => {\n\t\t// Use requestAnimationFrame to ensure DOM updates are complete\n\t\twindow.requestAnimationFrame( () => {\n\t\t\tconst [ toggleButton ] = focus.tabbable.find(\n\t\t\t\tcontainerRef?.current\n\t\t\t);\n\t\t\tif ( ! toggleButton ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Focus the toggle button and close the dropdown menu.\n\t\t\t// This ensures similar behaviour as to selecting an image, where the dropdown is\n\t\t\t// closed and focus is redirected to the dropdown toggle button.\n\t\t\ttoggleButton.focus();\n\t\t} );\n\t};\n\n\tconst onRemove = () =>\n\t\tonChange(\n\t\t\tsetImmutably( style, [ 'background' ], {\n\t\t\t\tbackgroundImage: 'none',\n\t\t\t} )\n\t\t);\n\tconst canRemove = ! hasValue && hasBackgroundImageValue( inheritedValue );\n\tconst imgLabel =\n\t\ttitle || getFilename( url ) || __( 'Add background image' );\n\n\treturn (\n\t\t<div className=\"block-editor-global-styles-background-panel__image-tools-panel-item\">\n\t\t\t{ isUploading && <LoadingSpinner /> }\n\t\t\t<MediaReplaceFlow\n\t\t\t\tmediaId={ id }\n\t\t\t\tmediaURL={ url }\n\t\t\t\tallowedTypes={ [ IMAGE_BACKGROUND_TYPE ] }\n\t\t\t\taccept=\"image/*\"\n\t\t\t\tonSelect={ onSelectMedia }\n\t\t\t\tpopoverProps={ {\n\t\t\t\t\tclassName: clsx( {\n\t\t\t\t\t\t'block-editor-global-styles-background-panel__media-replace-popover':\n\t\t\t\t\t\t\tdisplayInPanel,\n\t\t\t\t\t} ),\n\t\t\t\t} }\n\t\t\t\tname={\n\t\t\t\t\t<InspectorImagePreviewItem\n\t\t\t\t\t\tclassName=\"block-editor-global-styles-background-panel__image-preview\"\n\t\t\t\t\t\timgUrl={ url }\n\t\t\t\t\t\tfilename={ title }\n\t\t\t\t\t\tlabel={ imgLabel }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\trenderToggle={ ( props ) => (\n\t\t\t\t\t<Button { ...props } __next40pxDefaultSize />\n\t\t\t\t) }\n\t\t\t\tonError={ onUploadError }\n\t\t\t\tonReset={ () => {\n\t\t\t\t\tcloseAndFocus();\n\t\t\t\t\tonResetImage();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ canRemove && (\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tcloseAndFocus();\n\t\t\t\t\t\t\tonRemove();\n\t\t\t\t\t\t\tonRemoveImage();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Remove' ) }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t) }\n\t\t\t</MediaReplaceFlow>\n\t\t\t<DropZone\n\t\t\t\tonFilesDrop={ onFilesDrop }\n\t\t\t\tlabel={ __( 'Drop to upload' ) }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction BackgroundSizeControls( {\n\tonChange,\n\tstyle,\n\tinheritedValue,\n\tdefaultValues,\n} ) {\n\tconst sizeValue =\n\t\tstyle?.background?.backgroundSize ||\n\t\tinheritedValue?.background?.backgroundSize;\n\tconst repeatValue =\n\t\tstyle?.background?.backgroundRepeat ||\n\t\tinheritedValue?.background?.backgroundRepeat;\n\tconst imageValue =\n\t\tstyle?.background?.backgroundImage?.url ||\n\t\tinheritedValue?.background?.backgroundImage?.url;\n\tconst isUploadedImage = style?.background?.backgroundImage?.id;\n\tconst positionValue =\n\t\tstyle?.background?.backgroundPosition ||\n\t\tinheritedValue?.background?.backgroundPosition;\n\tconst attachmentValue =\n\t\tstyle?.background?.backgroundAttachment ||\n\t\tinheritedValue?.background?.backgroundAttachment;\n\n\t/*\n\t * Set default values for uploaded images.\n\t * The default values are passed by the consumer.\n\t * Block-level controls may have different defaults to root-level controls.\n\t * A falsy value is treated by default as `auto` (Tile).\n\t */\n\tlet currentValueForToggle =\n\t\t! sizeValue && isUploadedImage\n\t\t\t? defaultValues?.backgroundSize\n\t\t\t: sizeValue || 'auto';\n\t/*\n\t * The incoming value could be a value + unit, e.g. '20px'.\n\t * In this case set the value to 'tile'.\n\t */\n\tcurrentValueForToggle = ! [ 'cover', 'contain', 'auto' ].includes(\n\t\tcurrentValueForToggle\n\t)\n\t\t? 'auto'\n\t\t: currentValueForToggle;\n\t/*\n\t * If the current value is `cover` and the repeat value is `undefined`, then\n\t * the toggle should be unchecked as the default state. Otherwise, the toggle\n\t * should reflect the current repeat value.\n\t */\n\tconst repeatCheckedValue = ! (\n\t\trepeatValue === 'no-repeat' ||\n\t\t( currentValueForToggle === 'cover' && repeatValue === undefined )\n\t);\n\n\tconst updateBackgroundSize = ( next ) => {\n\t\t// When switching to 'contain' toggle the repeat off.\n\t\tlet nextRepeat = repeatValue;\n\t\tlet nextPosition = positionValue;\n\n\t\tif ( next === 'contain' ) {\n\t\t\tnextRepeat = 'no-repeat';\n\t\t\tnextPosition = undefined;\n\t\t}\n\n\t\tif ( next === 'cover' ) {\n\t\t\tnextRepeat = undefined;\n\t\t\tnextPosition = undefined;\n\t\t}\n\n\t\tif (\n\t\t\t( currentValueForToggle === 'cover' ||\n\t\t\t\tcurrentValueForToggle === 'contain' ) &&\n\t\t\tnext === 'auto'\n\t\t) {\n\t\t\tnextRepeat = undefined;\n\t\t\t/*\n\t\t\t * A background image uploaded and set in the editor (an image with a record id),\n\t\t\t * receives a default background position of '50% 0',\n\t\t\t * when the toggle switches to \"Tile\". This is to increase the chance that\n\t\t\t * the image's focus point is visible.\n\t\t\t * This is in-editor only to assist with the user experience.\n\t\t\t */\n\t\t\tif ( !! style?.background?.backgroundImage?.id ) {\n\t\t\t\tnextPosition = '50% 0';\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Next will be null when the input is cleared,\n\t\t * in which case the value should be 'auto'.\n\t\t */\n\t\tif ( ! next && currentValueForToggle === 'auto' ) {\n\t\t\tnext = 'auto';\n\t\t}\n\n\t\tonChange(\n\t\t\tsetImmutably( style, [ 'background' ], {\n\t\t\t\t...style?.background,\n\t\t\t\tbackgroundPosition: nextPosition,\n\t\t\t\tbackgroundRepeat: nextRepeat,\n\t\t\t\tbackgroundSize: next,\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst updateBackgroundPosition = ( next ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tstyle,\n\t\t\t\t[ 'background', 'backgroundPosition' ],\n\t\t\t\tcoordsToBackgroundPosition( next )\n\t\t\t)\n\t\t);\n\t};\n\n\tconst toggleIsRepeated = () =>\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tstyle,\n\t\t\t\t[ 'background', 'backgroundRepeat' ],\n\t\t\t\trepeatCheckedValue === true ? 'no-repeat' : 'repeat'\n\t\t\t)\n\t\t);\n\n\tconst toggleScrollWithPage = () =>\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tstyle,\n\t\t\t\t[ 'background', 'backgroundAttachment' ],\n\t\t\t\tattachmentValue === 'fixed' ? 'scroll' : 'fixed'\n\t\t\t)\n\t\t);\n\n\t// Set a default background position for non-site-wide, uploaded images with a size of 'contain'.\n\tconst backgroundPositionValue =\n\t\t! positionValue && isUploadedImage && 'contain' === sizeValue\n\t\t\t? defaultValues?.backgroundPosition\n\t\t\t: positionValue;\n\n\treturn (\n\t\t<VStack spacing={ 3 } className=\"single-column\">\n\t\t\t<FocalPointPicker\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\turl={ imageValue }\n\t\t\t\tvalue={ backgroundPositionToCoords( backgroundPositionValue ) }\n\t\t\t\tonChange={ updateBackgroundPosition }\n\t\t\t/>\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Fixed background' ) }\n\t\t\t\tchecked={ attachmentValue === 'fixed' }\n\t\t\t\tonChange={ toggleScrollWithPage }\n\t\t\t/>\n\t\t\t<ToggleGroupControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\tvalue={ currentValueForToggle }\n\t\t\t\tonChange={ updateBackgroundSize }\n\t\t\t\tisBlock\n\t\t\t\thelp={ backgroundSizeHelpText(\n\t\t\t\t\tsizeValue || defaultValues?.backgroundSize\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"cover\"\n\t\t\t\t\tvalue=\"cover\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Cover',\n\t\t\t\t\t\t'Size option for background image control'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"contain\"\n\t\t\t\t\tvalue=\"contain\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Contain',\n\t\t\t\t\t\t'Size option for background image control'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"tile\"\n\t\t\t\t\tvalue=\"auto\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Tile',\n\t\t\t\t\t\t'Size option for background image control'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</ToggleGroupControl>\n\t\t\t<HStack justify=\"flex-start\" spacing={ 2 } as=\"span\">\n\t\t\t\t<UnitControl\n\t\t\t\t\taria-label={ __( 'Background image width' ) }\n\t\t\t\t\tonChange={ updateBackgroundSize }\n\t\t\t\t\tvalue={ sizeValue }\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t__unstableInputWidth=\"100px\"\n\t\t\t\t\tmin={ 0 }\n\t\t\t\t\tplaceholder={ __( 'Auto' ) }\n\t\t\t\t\tdisabled={\n\t\t\t\t\t\tcurrentValueForToggle !== 'auto' ||\n\t\t\t\t\t\tcurrentValueForToggle === undefined\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Repeat' ) }\n\t\t\t\t\tchecked={ repeatCheckedValue }\n\t\t\t\t\tonChange={ toggleIsRepeated }\n\t\t\t\t\tdisabled={ currentValueForToggle === 'cover' }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t</VStack>\n\t);\n}\n\nexport default function BackgroundImagePanel( {\n\tvalue,\n\tonChange,\n\tinheritedValue = value,\n\tsettings,\n\tdefaultValues = {},\n} ) {\n\t/*\n\t * Resolve any inherited \"ref\" pointers.\n\t * Should the block editor need resolved, inherited values\n\t * across all controls, this could be abstracted into a hook,\n\t * e.g., useResolveGlobalStyle\n\t */\n\tconst { globalStyles, _links } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst _settings = getSettings();\n\t\treturn {\n\t\t\tglobalStyles: _settings[ globalStylesDataKey ],\n\t\t\t_links: _settings[ globalStylesLinksDataKey ],\n\t\t};\n\t}, [] );\n\tconst resolvedInheritedValue = useMemo( () => {\n\t\tconst resolvedValues = {\n\t\t\tbackground: {},\n\t\t};\n\n\t\tif ( ! inheritedValue?.background ) {\n\t\t\treturn inheritedValue;\n\t\t}\n\n\t\tObject.entries( inheritedValue?.background ).forEach(\n\t\t\t( [ key, backgroundValue ] ) => {\n\t\t\t\tresolvedValues.background[ key ] = getResolvedValue(\n\t\t\t\t\tbackgroundValue,\n\t\t\t\t\t{\n\t\t\t\t\t\tstyles: globalStyles,\n\t\t\t\t\t\t_links,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t\treturn resolvedValues;\n\t}, [ globalStyles, _links, inheritedValue ] );\n\n\tconst resetBackground = () =>\n\t\tonChange( setImmutably( value, [ 'background' ], {} ) );\n\n\tconst { title, url } = value?.background?.backgroundImage || {\n\t\t...resolvedInheritedValue?.background?.backgroundImage,\n\t};\n\tconst hasImageValue =\n\t\thasBackgroundImageValue( value ) ||\n\t\thasBackgroundImageValue( resolvedInheritedValue );\n\n\tconst imageValue =\n\t\tvalue?.background?.backgroundImage ||\n\t\tinheritedValue?.background?.backgroundImage;\n\n\tconst shouldShowBackgroundImageControls =\n\t\thasImageValue &&\n\t\t'none' !== imageValue &&\n\t\t( settings?.background?.backgroundSize ||\n\t\t\tsettings?.background?.backgroundPosition ||\n\t\t\tsettings?.background?.backgroundRepeat );\n\n\tconst [ isDropDownOpen, setIsDropDownOpen ] = useState( false );\n\tconst containerRef = useRef();\n\n\treturn (\n\t\t<div\n\t\t\tref={ containerRef }\n\t\t\tclassName={ clsx(\n\t\t\t\t'block-editor-global-styles-background-panel__inspector-media-replace-container',\n\t\t\t\t{\n\t\t\t\t\t'is-open': isDropDownOpen,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t{ shouldShowBackgroundImageControls ? (\n\t\t\t\t<BackgroundControlsPanel\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tfilename={ title }\n\t\t\t\t\turl={ url }\n\t\t\t\t\tonToggle={ setIsDropDownOpen }\n\t\t\t\t\thasImageValue={ hasImageValue }\n\t\t\t\t>\n\t\t\t\t\t<VStack spacing={ 3 } className=\"single-column\">\n\t\t\t\t\t\t<BackgroundImageControls\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tstyle={ value }\n\t\t\t\t\t\t\tinheritedValue={ resolvedInheritedValue }\n\t\t\t\t\t\t\tdisplayInPanel\n\t\t\t\t\t\t\tonResetImage={ () => {\n\t\t\t\t\t\t\t\tsetIsDropDownOpen( false );\n\t\t\t\t\t\t\t\tresetBackground();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonRemoveImage={ () => setIsDropDownOpen( false ) }\n\t\t\t\t\t\t\tdefaultValues={ defaultValues }\n\t\t\t\t\t\t\tcontainerRef={ containerRef }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<BackgroundSizeControls\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tstyle={ value }\n\t\t\t\t\t\t\tdefaultValues={ defaultValues }\n\t\t\t\t\t\t\tinheritedValue={ resolvedInheritedValue }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</VStack>\n\t\t\t\t</BackgroundControlsPanel>\n\t\t\t) : (\n\t\t\t\t<BackgroundImageControls\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\tstyle={ value }\n\t\t\t\t\tinheritedValue={ resolvedInheritedValue }\n\t\t\t\t\tdefaultValues={ defaultValues }\n\t\t\t\t\tonResetImage={ () => {\n\t\t\t\t\t\tsetIsDropDownOpen( false );\n\t\t\t\t\t\tresetBackground();\n\t\t\t\t\t} }\n\t\t\t\t\tonRemoveImage={ () => setIsDropDownOpen( false ) }\n\t\t\t\t\tcontainerRef={ containerRef }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAmBA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,gBAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AACA,IAAAY,iBAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AAEA,IAAAc,YAAA,GAA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AAM;YACpBqH,iBAAiB,CAAE,KAAM,CAAC;YAC1BH,eAAe,CAAC,CAAC;UAClB,CAAG;UACHnH,aAAa,EAAGA,CAAA,KAAMsH,iBAAiB,CAAE,KAAM,CAAG;UAClDnH,aAAa,EAAGA,aAAe;UAC/BC,YAAY,EAAGA;QAAc,CAC7B,CAAC,eACF,IAAAvE,WAAA,CAAAqC,GAAA,EAAC4F,sBAAsB;UACtBhE,QAAQ,EAAGA,QAAU;UACrB3B,KAAK,EAAG7B,KAAO;UACf6D,aAAa,EAAGA,aAAe;UAC/BJ,cAAc,EAAG0G;QAAwB,CACzC,CAAC;MAAA,CACK;IAAC,CACe,CAAC,gBAE1B,IAAA5K,WAAA,CAAAqC,GAAA,EAAC2B,uBAAuB;MACvBC,QAAQ,EAAGA,QAAU;MACrB3B,KAAK,EAAG7B,KAAO;MACfyD,cAAc,EAAG0G,sBAAwB;MACzCtG,aAAa,EAAGA,aAAe;MAC/BF,YAAY,EAAGA,CAAA,KAAM;QACpBqH,iBAAiB,CAAE,KAAM,CAAC;QAC1BH,eAAe,CAAC,CAAC;MAClB,CAAG;MACHnH,aAAa,EAAGA,CAAA,KAAMsH,iBAAiB,CAAE,KAAM,CAAG;MAClDlH,YAAY,EAAGA;IAAc,CAC7B;EACD,CACG,CAAC;AAER","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_notices","_url","_element","_data","_dom","_blob","_utils","_backgroundPanel","_object","_mediaReplaceFlow","_store","_privateKeys","_jsxRuntime","IMAGE_BACKGROUND_TYPE","BACKGROUND_POPOVER_PROPS","placement","offset","shift","className","noop","backgroundSizeHelpText","value","undefined","__","coordsToBackgroundPosition","isNaN","x","y","exports","backgroundPositionToCoords","split","map","v","parseFloat","InspectorImagePreviewItem","as","imgUrl","toggleProps","filename","label","onToggleCallback","isOpen","restToggleProps","useEffect","renderPreviewContent","jsxs","__experimentalHStack","justify","children","jsx","style","backgroundImage","FlexItem","flexGrow","__experimentalTruncate","numberOfLines","VisuallyHidden","sprintf","Button","__next40pxDefaultSize","BackgroundControlsPanel","url","onToggle","hasImageValue","imgLabel","getFilename","Dropdown","popoverProps","renderToggle","onClick","renderContent","__experimentalDropdownContentWrapper","paddingSize","LoadingSpinner","Placeholder","Spinner","BackgroundImageControls","onChange","inheritedValue","onRemoveImage","onResetImage","displayInPanel","defaultValues","containerRef","isUploading","setIsUploading","useState","getSettings","useSelect","blockEditorStore","id","title","background","createErrorNotice","useDispatch","noticesStore","onUploadError","message","type","resetBackgroundImage","setImmutably","onSelectMedia","media","isBlobURL","media_type","sizeValue","backgroundSize","positionValue","backgroundPosition","source","closeAndFocus","onFilesDrop","filesList","mediaUpload","allowedTypes","onFileChange","image","onError","multiple","hasValue","hasBackgroundImageValue","window","requestAnimationFrame","toggleButton","focus","tabbable","find","current","onRemove","canRemove","default","mediaId","mediaURL","accept","onSelect","clsx","name","props","onReset","MenuItem","DropZone","BackgroundSizeControls","repeatValue","backgroundRepeat","imageValue","isUploadedImage","attachmentValue","backgroundAttachment","currentValueForToggle","includes","repeatCheckedValue","updateBackgroundSize","next","nextRepeat","nextPosition","updateBackgroundPosition","toggleIsRepeated","toggleScrollWithPage","backgroundPositionValue","__experimentalVStack","spacing","FocalPointPicker","__nextHasNoMarginBottom","ToggleControl","checked","__experimentalToggleGroupControl","size","isBlock","help","__experimentalToggleGroupControlOption","_x","__experimentalUnitControl","__unstableInputWidth","min","placeholder","disabled","BackgroundImagePanel","settings","globalStyles","_links","select","_settings","globalStylesDataKey","globalStylesLinksDataKey","resolvedInheritedValue","useMemo","resolvedValues","Object","entries","forEach","key","backgroundValue","getResolvedValue","styles","resetBackground","shouldShowBackgroundImageControls","isDropDownOpen","setIsDropDownOpen","useRef","ref"],"sources":["@wordpress/block-editor/src/components/background-image-control/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tToggleControl,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\t__experimentalUnitControl as UnitControl,\n\t__experimentalVStack as VStack,\n\tDropZone,\n\tFlexItem,\n\tFocalPointPicker,\n\tMenuItem,\n\tVisuallyHidden,\n\t__experimentalHStack as HStack,\n\t__experimentalTruncate as Truncate,\n\tDropdown,\n\tPlaceholder,\n\tSpinner,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\tButton,\n} from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { getFilename } from '@wordpress/url';\nimport { useRef, useState, useEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { focus } from '@wordpress/dom';\nimport { isBlobURL } from '@wordpress/blob';\n\n/**\n * Internal dependencies\n */\nimport { getResolvedValue } from '../global-styles/utils';\nimport { hasBackgroundImageValue } from '../global-styles/background-panel';\nimport { setImmutably } from '../../utils/object';\nimport MediaReplaceFlow from '../media-replace-flow';\nimport { store as blockEditorStore } from '../../store';\n\nimport {\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n} from '../../store/private-keys';\n\nconst IMAGE_BACKGROUND_TYPE = 'image';\n\nconst BACKGROUND_POPOVER_PROPS = {\n\tplacement: 'left-start',\n\toffset: 36,\n\tshift: true,\n\tclassName: 'block-editor-global-styles-background-panel__popover',\n};\nconst noop = () => {};\n\n/**\n * Get the help text for the background size control.\n *\n * @param {string} value backgroundSize value.\n * @return {string} Translated help text.\n */\nfunction backgroundSizeHelpText( value ) {\n\tif ( value === 'cover' || value === undefined ) {\n\t\treturn __( 'Image covers the space evenly.' );\n\t}\n\tif ( value === 'contain' ) {\n\t\treturn __( 'Image is contained without distortion.' );\n\t}\n\treturn __( 'Image has a fixed width.' );\n}\n\n/**\n * Converts decimal x and y coords from FocalPointPicker to percentage-based values\n * to use as backgroundPosition value.\n *\n * @param {{x?:number, y?:number}} value FocalPointPicker coords.\n * @return {string} \t\t\t\t backgroundPosition value.\n */\nexport const coordsToBackgroundPosition = ( value ) => {\n\tif ( ! value || ( isNaN( value.x ) && isNaN( value.y ) ) ) {\n\t\treturn undefined;\n\t}\n\n\tconst x = isNaN( value.x ) ? 0.5 : value.x;\n\tconst y = isNaN( value.y ) ? 0.5 : value.y;\n\n\treturn `${ x * 100 }% ${ y * 100 }%`;\n};\n\n/**\n * Converts backgroundPosition value to x and y coords for FocalPointPicker.\n *\n * @param {string} value backgroundPosition value.\n * @return {{x?:number, y?:number}} FocalPointPicker coords.\n */\nexport const backgroundPositionToCoords = ( value ) => {\n\tif ( ! value ) {\n\t\treturn { x: undefined, y: undefined };\n\t}\n\n\tlet [ x, y ] = value.split( ' ' ).map( ( v ) => parseFloat( v ) / 100 );\n\tx = isNaN( x ) ? undefined : x;\n\ty = isNaN( y ) ? x : y;\n\n\treturn { x, y };\n};\n\nfunction InspectorImagePreviewItem( {\n\tas = 'span',\n\timgUrl,\n\ttoggleProps = {},\n\tfilename,\n\tlabel,\n\tonToggleCallback = noop,\n} ) {\n\tconst { isOpen, ...restToggleProps } = toggleProps;\n\n\tuseEffect( () => {\n\t\tif ( typeof isOpen !== 'undefined' ) {\n\t\t\tonToggleCallback( isOpen );\n\t\t}\n\t}, [ isOpen, onToggleCallback ] );\n\n\tconst renderPreviewContent = () => {\n\t\treturn (\n\t\t\t<HStack\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\tas=\"span\"\n\t\t\t\tclassName=\"block-editor-global-styles-background-panel__inspector-preview-inner\"\n\t\t\t>\n\t\t\t\t{ imgUrl && (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName=\"block-editor-global-styles-background-panel__inspector-image-indicator-wrapper\"\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"block-editor-global-styles-background-panel__inspector-image-indicator\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\tbackgroundImage: `url(${ imgUrl })`,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t<FlexItem as=\"span\" style={ imgUrl ? {} : { flexGrow: 1 } }>\n\t\t\t\t\t<Truncate\n\t\t\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\t\t\tclassName=\"block-editor-global-styles-background-panel__inspector-media-replace-title\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Truncate>\n\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t{ imgUrl\n\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: file name */\n\t\t\t\t\t\t\t\t\t__( 'Background image: %s' ),\n\t\t\t\t\t\t\t\t\tfilename || label\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: __( 'No background image selected' ) }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t</FlexItem>\n\t\t\t</HStack>\n\t\t);\n\t};\n\n\treturn as === 'button' ? (\n\t\t<Button __next40pxDefaultSize { ...restToggleProps }>\n\t\t\t{ renderPreviewContent() }\n\t\t</Button>\n\t) : (\n\t\trenderPreviewContent()\n\t);\n}\n\nfunction BackgroundControlsPanel( {\n\tlabel,\n\tfilename,\n\turl: imgUrl,\n\tchildren,\n\tonToggle: onToggleCallback = noop,\n\thasImageValue,\n} ) {\n\tif ( ! hasImageValue ) {\n\t\treturn;\n\t}\n\n\tconst imgLabel =\n\t\tlabel || getFilename( imgUrl ) || __( 'Add background image' );\n\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ BACKGROUND_POPOVER_PROPS }\n\t\t\trenderToggle={ ( { onToggle, isOpen } ) => {\n\t\t\t\tconst toggleProps = {\n\t\t\t\t\tonClick: onToggle,\n\t\t\t\t\tclassName:\n\t\t\t\t\t\t'block-editor-global-styles-background-panel__dropdown-toggle',\n\t\t\t\t\t'aria-expanded': isOpen,\n\t\t\t\t\t'aria-label': __(\n\t\t\t\t\t\t'Background size, position and repeat options.'\n\t\t\t\t\t),\n\t\t\t\t\tisOpen,\n\t\t\t\t};\n\t\t\t\treturn (\n\t\t\t\t\t<InspectorImagePreviewItem\n\t\t\t\t\t\timgUrl={ imgUrl }\n\t\t\t\t\t\tfilename={ filename }\n\t\t\t\t\t\tlabel={ imgLabel }\n\t\t\t\t\t\ttoggleProps={ toggleProps }\n\t\t\t\t\t\tas=\"button\"\n\t\t\t\t\t\tonToggleCallback={ onToggleCallback }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trenderContent={ () => (\n\t\t\t\t<DropdownContentWrapper\n\t\t\t\t\tclassName=\"block-editor-global-styles-background-panel__dropdown-content-wrapper\"\n\t\t\t\t\tpaddingSize=\"medium\"\n\t\t\t\t>\n\t\t\t\t\t{ children }\n\t\t\t\t</DropdownContentWrapper>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nfunction LoadingSpinner() {\n\treturn (\n\t\t<Placeholder className=\"block-editor-global-styles-background-panel__loading\">\n\t\t\t<Spinner />\n\t\t</Placeholder>\n\t);\n}\n\nfunction BackgroundImageControls( {\n\tonChange,\n\tstyle,\n\tinheritedValue,\n\tonRemoveImage = noop,\n\tonResetImage = noop,\n\tdisplayInPanel,\n\tdefaultValues,\n\tcontainerRef,\n} ) {\n\tconst [ isUploading, setIsUploading ] = useState( false );\n\tconst { getSettings } = useSelect( blockEditorStore );\n\n\tconst { id, title, url } = style?.background?.backgroundImage || {\n\t\t...inheritedValue?.background?.backgroundImage,\n\t};\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t\tsetIsUploading( false );\n\t};\n\n\tconst resetBackgroundImage = () =>\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tstyle,\n\t\t\t\t[ 'background', 'backgroundImage' ],\n\t\t\t\tundefined\n\t\t\t)\n\t\t);\n\n\tconst onSelectMedia = ( media ) => {\n\t\tif ( ! media || ! media.url ) {\n\t\t\tresetBackgroundImage();\n\t\t\tsetIsUploading( false );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isBlobURL( media.url ) ) {\n\t\t\tsetIsUploading( true );\n\t\t\treturn;\n\t\t}\n\n\t\t// For media selections originated from a file upload.\n\t\tif (\n\t\t\t( media.media_type &&\n\t\t\t\tmedia.media_type !== IMAGE_BACKGROUND_TYPE ) ||\n\t\t\t( ! media.media_type &&\n\t\t\t\tmedia.type &&\n\t\t\t\tmedia.type !== IMAGE_BACKGROUND_TYPE )\n\t\t) {\n\t\t\tonUploadError(\n\t\t\t\t__( 'Only images can be used as a background image.' )\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tconst sizeValue =\n\t\t\tstyle?.background?.backgroundSize || defaultValues?.backgroundSize;\n\t\tconst positionValue = style?.background?.backgroundPosition;\n\t\tonChange(\n\t\t\tsetImmutably( style, [ 'background' ], {\n\t\t\t\t...style?.background,\n\t\t\t\tbackgroundImage: {\n\t\t\t\t\turl: media.url,\n\t\t\t\t\tid: media.id,\n\t\t\t\t\tsource: 'file',\n\t\t\t\t\ttitle: media.title || undefined,\n\t\t\t\t},\n\t\t\t\tbackgroundPosition:\n\t\t\t\t\t/*\n\t\t\t\t\t * A background image uploaded and set in the editor receives a default background position of '50% 0',\n\t\t\t\t\t * when the background image size is the equivalent of \"Tile\".\n\t\t\t\t\t * This is to increase the chance that the image's focus point is visible.\n\t\t\t\t\t * This is in-editor only to assist with the user experience.\n\t\t\t\t\t */\n\t\t\t\t\t! positionValue && ( 'auto' === sizeValue || ! sizeValue )\n\t\t\t\t\t\t? '50% 0'\n\t\t\t\t\t\t: positionValue,\n\t\t\t\tbackgroundSize: sizeValue,\n\t\t\t} )\n\t\t);\n\t\tsetIsUploading( false );\n\t\t// Close the dropdown and focus the toggle button.\n\t\tcloseAndFocus();\n\t};\n\n\t// Drag and drop callback, restricting image to one.\n\tconst onFilesDrop = ( filesList ) => {\n\t\tgetSettings().mediaUpload( {\n\t\t\tallowedTypes: [ IMAGE_BACKGROUND_TYPE ],\n\t\t\tfilesList,\n\t\t\tonFileChange( [ image ] ) {\n\t\t\t\tonSelectMedia( image );\n\t\t\t},\n\t\t\tonError: onUploadError,\n\t\t\tmultiple: false,\n\t\t} );\n\t};\n\n\tconst hasValue = hasBackgroundImageValue( style );\n\n\tconst closeAndFocus = () => {\n\t\t// Use requestAnimationFrame to ensure DOM updates are complete\n\t\twindow.requestAnimationFrame( () => {\n\t\t\tconst [ toggleButton ] = focus.tabbable.find(\n\t\t\t\tcontainerRef?.current\n\t\t\t);\n\t\t\tif ( ! toggleButton ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Focus the toggle button and close the dropdown menu.\n\t\t\t// This ensures similar behaviour as to selecting an image, where the dropdown is\n\t\t\t// closed and focus is redirected to the dropdown toggle button.\n\t\t\ttoggleButton.focus();\n\t\t} );\n\t};\n\n\tconst onRemove = () =>\n\t\tonChange(\n\t\t\tsetImmutably( style, [ 'background' ], {\n\t\t\t\tbackgroundImage: 'none',\n\t\t\t} )\n\t\t);\n\tconst canRemove = ! hasValue && hasBackgroundImageValue( inheritedValue );\n\tconst imgLabel =\n\t\ttitle || getFilename( url ) || __( 'Add background image' );\n\n\treturn (\n\t\t<div className=\"block-editor-global-styles-background-panel__image-tools-panel-item\">\n\t\t\t{ isUploading && <LoadingSpinner /> }\n\t\t\t<MediaReplaceFlow\n\t\t\t\tmediaId={ id }\n\t\t\t\tmediaURL={ url }\n\t\t\t\tallowedTypes={ [ IMAGE_BACKGROUND_TYPE ] }\n\t\t\t\taccept=\"image/*\"\n\t\t\t\tonSelect={ onSelectMedia }\n\t\t\t\tpopoverProps={ {\n\t\t\t\t\tclassName: clsx( {\n\t\t\t\t\t\t'block-editor-global-styles-background-panel__media-replace-popover':\n\t\t\t\t\t\t\tdisplayInPanel,\n\t\t\t\t\t} ),\n\t\t\t\t} }\n\t\t\t\tname={\n\t\t\t\t\t<InspectorImagePreviewItem\n\t\t\t\t\t\timgUrl={ url }\n\t\t\t\t\t\tfilename={ title }\n\t\t\t\t\t\tlabel={ imgLabel }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\trenderToggle={ ( props ) => (\n\t\t\t\t\t<Button { ...props } __next40pxDefaultSize />\n\t\t\t\t) }\n\t\t\t\tonError={ onUploadError }\n\t\t\t\tonReset={ () => {\n\t\t\t\t\tcloseAndFocus();\n\t\t\t\t\tonResetImage();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ canRemove && (\n\t\t\t\t\t<MenuItem\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tcloseAndFocus();\n\t\t\t\t\t\t\tonRemove();\n\t\t\t\t\t\t\tonRemoveImage();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Remove' ) }\n\t\t\t\t\t</MenuItem>\n\t\t\t\t) }\n\t\t\t</MediaReplaceFlow>\n\t\t\t<DropZone\n\t\t\t\tonFilesDrop={ onFilesDrop }\n\t\t\t\tlabel={ __( 'Drop to upload' ) }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction BackgroundSizeControls( {\n\tonChange,\n\tstyle,\n\tinheritedValue,\n\tdefaultValues,\n} ) {\n\tconst sizeValue =\n\t\tstyle?.background?.backgroundSize ||\n\t\tinheritedValue?.background?.backgroundSize;\n\tconst repeatValue =\n\t\tstyle?.background?.backgroundRepeat ||\n\t\tinheritedValue?.background?.backgroundRepeat;\n\tconst imageValue =\n\t\tstyle?.background?.backgroundImage?.url ||\n\t\tinheritedValue?.background?.backgroundImage?.url;\n\tconst isUploadedImage = style?.background?.backgroundImage?.id;\n\tconst positionValue =\n\t\tstyle?.background?.backgroundPosition ||\n\t\tinheritedValue?.background?.backgroundPosition;\n\tconst attachmentValue =\n\t\tstyle?.background?.backgroundAttachment ||\n\t\tinheritedValue?.background?.backgroundAttachment;\n\n\t/*\n\t * Set default values for uploaded images.\n\t * The default values are passed by the consumer.\n\t * Block-level controls may have different defaults to root-level controls.\n\t * A falsy value is treated by default as `auto` (Tile).\n\t */\n\tlet currentValueForToggle =\n\t\t! sizeValue && isUploadedImage\n\t\t\t? defaultValues?.backgroundSize\n\t\t\t: sizeValue || 'auto';\n\t/*\n\t * The incoming value could be a value + unit, e.g. '20px'.\n\t * In this case set the value to 'tile'.\n\t */\n\tcurrentValueForToggle = ! [ 'cover', 'contain', 'auto' ].includes(\n\t\tcurrentValueForToggle\n\t)\n\t\t? 'auto'\n\t\t: currentValueForToggle;\n\t/*\n\t * If the current value is `cover` and the repeat value is `undefined`, then\n\t * the toggle should be unchecked as the default state. Otherwise, the toggle\n\t * should reflect the current repeat value.\n\t */\n\tconst repeatCheckedValue = ! (\n\t\trepeatValue === 'no-repeat' ||\n\t\t( currentValueForToggle === 'cover' && repeatValue === undefined )\n\t);\n\n\tconst updateBackgroundSize = ( next ) => {\n\t\t// When switching to 'contain' toggle the repeat off.\n\t\tlet nextRepeat = repeatValue;\n\t\tlet nextPosition = positionValue;\n\n\t\tif ( next === 'contain' ) {\n\t\t\tnextRepeat = 'no-repeat';\n\t\t\tnextPosition = undefined;\n\t\t}\n\n\t\tif ( next === 'cover' ) {\n\t\t\tnextRepeat = undefined;\n\t\t\tnextPosition = undefined;\n\t\t}\n\n\t\tif (\n\t\t\t( currentValueForToggle === 'cover' ||\n\t\t\t\tcurrentValueForToggle === 'contain' ) &&\n\t\t\tnext === 'auto'\n\t\t) {\n\t\t\tnextRepeat = undefined;\n\t\t\t/*\n\t\t\t * A background image uploaded and set in the editor (an image with a record id),\n\t\t\t * receives a default background position of '50% 0',\n\t\t\t * when the toggle switches to \"Tile\". This is to increase the chance that\n\t\t\t * the image's focus point is visible.\n\t\t\t * This is in-editor only to assist with the user experience.\n\t\t\t */\n\t\t\tif ( !! style?.background?.backgroundImage?.id ) {\n\t\t\t\tnextPosition = '50% 0';\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t * Next will be null when the input is cleared,\n\t\t * in which case the value should be 'auto'.\n\t\t */\n\t\tif ( ! next && currentValueForToggle === 'auto' ) {\n\t\t\tnext = 'auto';\n\t\t}\n\n\t\tonChange(\n\t\t\tsetImmutably( style, [ 'background' ], {\n\t\t\t\t...style?.background,\n\t\t\t\tbackgroundPosition: nextPosition,\n\t\t\t\tbackgroundRepeat: nextRepeat,\n\t\t\t\tbackgroundSize: next,\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst updateBackgroundPosition = ( next ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tstyle,\n\t\t\t\t[ 'background', 'backgroundPosition' ],\n\t\t\t\tcoordsToBackgroundPosition( next )\n\t\t\t)\n\t\t);\n\t};\n\n\tconst toggleIsRepeated = () =>\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tstyle,\n\t\t\t\t[ 'background', 'backgroundRepeat' ],\n\t\t\t\trepeatCheckedValue === true ? 'no-repeat' : 'repeat'\n\t\t\t)\n\t\t);\n\n\tconst toggleScrollWithPage = () =>\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tstyle,\n\t\t\t\t[ 'background', 'backgroundAttachment' ],\n\t\t\t\tattachmentValue === 'fixed' ? 'scroll' : 'fixed'\n\t\t\t)\n\t\t);\n\n\t// Set a default background position for non-site-wide, uploaded images with a size of 'contain'.\n\tconst backgroundPositionValue =\n\t\t! positionValue && isUploadedImage && 'contain' === sizeValue\n\t\t\t? defaultValues?.backgroundPosition\n\t\t\t: positionValue;\n\n\treturn (\n\t\t<VStack spacing={ 3 } className=\"single-column\">\n\t\t\t<FocalPointPicker\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\turl={ imageValue }\n\t\t\t\tvalue={ backgroundPositionToCoords( backgroundPositionValue ) }\n\t\t\t\tonChange={ updateBackgroundPosition }\n\t\t\t/>\n\t\t\t<ToggleControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Fixed background' ) }\n\t\t\t\tchecked={ attachmentValue === 'fixed' }\n\t\t\t\tonChange={ toggleScrollWithPage }\n\t\t\t/>\n\t\t\t<ToggleGroupControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\tvalue={ currentValueForToggle }\n\t\t\t\tonChange={ updateBackgroundSize }\n\t\t\t\tisBlock\n\t\t\t\thelp={ backgroundSizeHelpText(\n\t\t\t\t\tsizeValue || defaultValues?.backgroundSize\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"cover\"\n\t\t\t\t\tvalue=\"cover\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Cover',\n\t\t\t\t\t\t'Size option for background image control'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"contain\"\n\t\t\t\t\tvalue=\"contain\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Contain',\n\t\t\t\t\t\t'Size option for background image control'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\tkey=\"tile\"\n\t\t\t\t\tvalue=\"auto\"\n\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t'Tile',\n\t\t\t\t\t\t'Size option for background image control'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</ToggleGroupControl>\n\t\t\t<HStack justify=\"flex-start\" spacing={ 2 } as=\"span\">\n\t\t\t\t<UnitControl\n\t\t\t\t\taria-label={ __( 'Background image width' ) }\n\t\t\t\t\tonChange={ updateBackgroundSize }\n\t\t\t\t\tvalue={ sizeValue }\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t__unstableInputWidth=\"100px\"\n\t\t\t\t\tmin={ 0 }\n\t\t\t\t\tplaceholder={ __( 'Auto' ) }\n\t\t\t\t\tdisabled={\n\t\t\t\t\t\tcurrentValueForToggle !== 'auto' ||\n\t\t\t\t\t\tcurrentValueForToggle === undefined\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Repeat' ) }\n\t\t\t\t\tchecked={ repeatCheckedValue }\n\t\t\t\t\tonChange={ toggleIsRepeated }\n\t\t\t\t\tdisabled={ currentValueForToggle === 'cover' }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t</VStack>\n\t);\n}\n\nexport default function BackgroundImagePanel( {\n\tvalue,\n\tonChange,\n\tinheritedValue = value,\n\tsettings,\n\tdefaultValues = {},\n} ) {\n\t/*\n\t * Resolve any inherited \"ref\" pointers.\n\t * Should the block editor need resolved, inherited values\n\t * across all controls, this could be abstracted into a hook,\n\t * e.g., useResolveGlobalStyle\n\t */\n\tconst { globalStyles, _links } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst _settings = getSettings();\n\t\treturn {\n\t\t\tglobalStyles: _settings[ globalStylesDataKey ],\n\t\t\t_links: _settings[ globalStylesLinksDataKey ],\n\t\t};\n\t}, [] );\n\tconst resolvedInheritedValue = useMemo( () => {\n\t\tconst resolvedValues = {\n\t\t\tbackground: {},\n\t\t};\n\n\t\tif ( ! inheritedValue?.background ) {\n\t\t\treturn inheritedValue;\n\t\t}\n\n\t\tObject.entries( inheritedValue?.background ).forEach(\n\t\t\t( [ key, backgroundValue ] ) => {\n\t\t\t\tresolvedValues.background[ key ] = getResolvedValue(\n\t\t\t\t\tbackgroundValue,\n\t\t\t\t\t{\n\t\t\t\t\t\tstyles: globalStyles,\n\t\t\t\t\t\t_links,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t\treturn resolvedValues;\n\t}, [ globalStyles, _links, inheritedValue ] );\n\n\tconst resetBackground = () =>\n\t\tonChange( setImmutably( value, [ 'background' ], {} ) );\n\n\tconst { title, url } = value?.background?.backgroundImage || {\n\t\t...resolvedInheritedValue?.background?.backgroundImage,\n\t};\n\tconst hasImageValue =\n\t\thasBackgroundImageValue( value ) ||\n\t\thasBackgroundImageValue( resolvedInheritedValue );\n\n\tconst imageValue =\n\t\tvalue?.background?.backgroundImage ||\n\t\tinheritedValue?.background?.backgroundImage;\n\n\tconst shouldShowBackgroundImageControls =\n\t\thasImageValue &&\n\t\t'none' !== imageValue &&\n\t\t( settings?.background?.backgroundSize ||\n\t\t\tsettings?.background?.backgroundPosition ||\n\t\t\tsettings?.background?.backgroundRepeat );\n\n\tconst [ isDropDownOpen, setIsDropDownOpen ] = useState( false );\n\tconst containerRef = useRef();\n\n\treturn (\n\t\t<div\n\t\t\tref={ containerRef }\n\t\t\tclassName={ clsx(\n\t\t\t\t'block-editor-global-styles-background-panel__inspector-media-replace-container',\n\t\t\t\t{\n\t\t\t\t\t'is-open': isDropDownOpen,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t{ shouldShowBackgroundImageControls ? (\n\t\t\t\t<BackgroundControlsPanel\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tfilename={ title }\n\t\t\t\t\turl={ url }\n\t\t\t\t\tonToggle={ setIsDropDownOpen }\n\t\t\t\t\thasImageValue={ hasImageValue }\n\t\t\t\t>\n\t\t\t\t\t<VStack spacing={ 3 } className=\"single-column\">\n\t\t\t\t\t\t<BackgroundImageControls\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tstyle={ value }\n\t\t\t\t\t\t\tinheritedValue={ resolvedInheritedValue }\n\t\t\t\t\t\t\tdisplayInPanel\n\t\t\t\t\t\t\tonResetImage={ () => {\n\t\t\t\t\t\t\t\tsetIsDropDownOpen( false );\n\t\t\t\t\t\t\t\tresetBackground();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonRemoveImage={ () => setIsDropDownOpen( false ) }\n\t\t\t\t\t\t\tdefaultValues={ defaultValues }\n\t\t\t\t\t\t\tcontainerRef={ containerRef }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<BackgroundSizeControls\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tstyle={ value }\n\t\t\t\t\t\t\tdefaultValues={ defaultValues }\n\t\t\t\t\t\t\tinheritedValue={ resolvedInheritedValue }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</VStack>\n\t\t\t\t</BackgroundControlsPanel>\n\t\t\t) : (\n\t\t\t\t<BackgroundImageControls\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\tstyle={ value }\n\t\t\t\t\tinheritedValue={ resolvedInheritedValue }\n\t\t\t\t\tdefaultValues={ defaultValues }\n\t\t\t\t\tonResetImage={ () => {\n\t\t\t\t\t\tsetIsDropDownOpen( false );\n\t\t\t\t\t\tresetBackground();\n\t\t\t\t\t} }\n\t\t\t\t\tonRemoveImage={ () => setIsDropDownOpen( false ) }\n\t\t\t\t\tcontainerRef={ containerRef }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAmBA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,gBAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AACA,IAAAY,iBAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AAE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G;UACHnH,aAAa,EAAGA,CAAA,KAAMsH,iBAAiB,CAAE,KAAM,CAAG;UAClDnH,aAAa,EAAGA,aAAe;UAC/BC,YAAY,EAAGA;QAAc,CAC7B,CAAC,eACF,IAAAvE,WAAA,CAAAqC,GAAA,EAAC4F,sBAAsB;UACtBhE,QAAQ,EAAGA,QAAU;UACrB3B,KAAK,EAAG7B,KAAO;UACf6D,aAAa,EAAGA,aAAe;UAC/BJ,cAAc,EAAG0G;QAAwB,CACzC,CAAC;MAAA,CACK;IAAC,CACe,CAAC,gBAE1B,IAAA5K,WAAA,CAAAqC,GAAA,EAAC2B,uBAAuB;MACvBC,QAAQ,EAAGA,QAAU;MACrB3B,KAAK,EAAG7B,KAAO;MACfyD,cAAc,EAAG0G,sBAAwB;MACzCtG,aAAa,EAAGA,aAAe;MAC/BF,YAAY,EAAGA,CAAA,KAAM;QACpBqH,iBAAiB,CAAE,KAAM,CAAC;QAC1BH,eAAe,CAAC,CAAC;MAClB,CAAG;MACHnH,aAAa,EAAGA,CAAA,KAAMsH,iBAAiB,CAAE,KAAM,CAAG;MAClDlH,YAAY,EAAGA;IAAc,CAC7B;EACD,CACG,CAAC;AAER","ignoreList":[]}
|
|
@@ -49,7 +49,7 @@ function BlockInvalidWarning({
|
|
|
49
49
|
blockTitle,
|
|
50
50
|
icon
|
|
51
51
|
} = (0, _data.useSelect)(selector, [clientId]);
|
|
52
|
-
const accessibilityLabel = (0, _i18n.sprintf)(/* translators: accessibility text for blocks with invalid content. %
|
|
52
|
+
const accessibilityLabel = (0, _i18n.sprintf)(/* translators: accessibility text for blocks with invalid content. %s: localized block title */
|
|
53
53
|
(0, _i18n.__)('%s block. This block has invalid content'), blockTitle);
|
|
54
54
|
const {
|
|
55
55
|
replaceBlock
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_i18n","_data","_blocks","_warning","_interopRequireDefault","_store","_jsxRuntime","BlockInvalidWarning","clientId","selector","select","getBlock","blockEditorStore","block","name","blockType","getBlockType","title","blockIcon","icon","blockTitle","useSelect","accessibilityLabel","sprintf","__","replaceBlock","useDispatch","recoverBlock","attributes","innerBlocks","createBlock","attemptBlockRecovery","jsx","TouchableWithoutFeedback","onPress","accessible","accessibilityRole","children","default","message"],"sources":["@wordpress/block-editor/src/components/block-list/block-invalid-warning.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { TouchableWithoutFeedback } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { createBlock, getBlockType } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport Warning from '../warning';\nimport { store as blockEditorStore } from '../../store';\n\nexport default function BlockInvalidWarning( { clientId } ) {\n\tconst selector = ( select ) => {\n\t\tconst { getBlock } = select( blockEditorStore );\n\t\tconst block = getBlock( clientId );\n\t\tconst { name } = block || {};\n\n\t\tconst blockType = getBlockType( name || 'core/missing' );\n\t\tconst title = blockType?.title;\n\t\tconst blockIcon = blockType?.icon;\n\n\t\treturn {\n\t\t\tblock,\n\t\t\tblockTitle: title,\n\t\t\ticon: blockIcon,\n\t\t};\n\t};\n\n\tconst { block, blockTitle, icon } = useSelect( selector, [ clientId ] );\n\n\tconst accessibilityLabel = sprintf(\n\t\t/* translators: accessibility text for blocks with invalid content. %
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_i18n","_data","_blocks","_warning","_interopRequireDefault","_store","_jsxRuntime","BlockInvalidWarning","clientId","selector","select","getBlock","blockEditorStore","block","name","blockType","getBlockType","title","blockIcon","icon","blockTitle","useSelect","accessibilityLabel","sprintf","__","replaceBlock","useDispatch","recoverBlock","attributes","innerBlocks","createBlock","attemptBlockRecovery","jsx","TouchableWithoutFeedback","onPress","accessible","accessibilityRole","children","default","message"],"sources":["@wordpress/block-editor/src/components/block-list/block-invalid-warning.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { TouchableWithoutFeedback } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { createBlock, getBlockType } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport Warning from '../warning';\nimport { store as blockEditorStore } from '../../store';\n\nexport default function BlockInvalidWarning( { clientId } ) {\n\tconst selector = ( select ) => {\n\t\tconst { getBlock } = select( blockEditorStore );\n\t\tconst block = getBlock( clientId );\n\t\tconst { name } = block || {};\n\n\t\tconst blockType = getBlockType( name || 'core/missing' );\n\t\tconst title = blockType?.title;\n\t\tconst blockIcon = blockType?.icon;\n\n\t\treturn {\n\t\t\tblock,\n\t\t\tblockTitle: title,\n\t\t\ticon: blockIcon,\n\t\t};\n\t};\n\n\tconst { block, blockTitle, icon } = useSelect( selector, [ clientId ] );\n\n\tconst accessibilityLabel = sprintf(\n\t\t/* translators: accessibility text for blocks with invalid content. %s: localized block title */\n\t\t__( '%s block. This block has invalid content' ),\n\t\tblockTitle\n\t);\n\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\n\tconst recoverBlock = ( { name, attributes, innerBlocks } ) =>\n\t\tcreateBlock( name, attributes, innerBlocks );\n\n\tconst attemptBlockRecovery = () => {\n\t\treplaceBlock( block.clientId, recoverBlock( block ) );\n\t};\n\n\treturn (\n\t\t<TouchableWithoutFeedback\n\t\t\tonPress={ attemptBlockRecovery }\n\t\t\taccessible\n\t\t\taccessibilityRole=\"button\"\n\t\t>\n\t\t\t<Warning\n\t\t\t\ttitle={ blockTitle }\n\t\t\t\t// eslint-disable-next-line @wordpress/i18n-no-collapsible-whitespace\n\t\t\t\tmessage={ __(\n\t\t\t\t\t'Problem displaying block. \\nTap to attempt block recovery.'\n\t\t\t\t) }\n\t\t\t\ticon={ icon }\n\t\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\t/>\n\t\t</TouchableWithoutFeedback>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC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WAAY,CAAC;EAE7C,MAAME,oBAAoB,GAAGA,CAAA,KAAM;IAClCN,YAAY,CAAEZ,KAAK,CAACL,QAAQ,EAAEmB,YAAY,CAAEd,KAAM,CAAE,CAAC;EACtD,CAAC;EAED,oBACC,IAAAP,WAAA,CAAA0B,GAAA,EAAClC,YAAA,CAAAmC,wBAAwB;IACxBC,OAAO,EAAGH,oBAAsB;IAChCI,UAAU;IACVC,iBAAiB,EAAC,QAAQ;IAAAC,QAAA,eAE1B,IAAA/B,WAAA,CAAA0B,GAAA,EAAC7B,QAAA,CAAAmC,OAAO;MACPrB,KAAK,EAAGG;MACR;MAAA;MACAmB,OAAO,EAAG,IAAAf,QAAE,EACX,4DACD,CAAG;MACHL,IAAI,EAAGA,IAAM;MACbG,kBAAkB,EAAGA;IAAoB,CACzC;EAAC,CACuB,CAAC;AAE7B","ignoreList":[]}
|
|
@@ -88,6 +88,7 @@ function BlockLockModal({
|
|
|
88
88
|
(0, _i18n.__)('Lock %s'), blockInformation.title),
|
|
89
89
|
overlayClassName: "block-editor-block-lock-modal",
|
|
90
90
|
onRequestClose: onClose,
|
|
91
|
+
size: "small",
|
|
91
92
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("form", {
|
|
92
93
|
onSubmit: event => {
|
|
93
94
|
event.preventDefault();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_element","_components","_icons","_data","_blocks","_useBlockLock","_interopRequireDefault","_useBlockDisplayInformation","_store","_jsxRuntime","ALLOWS_EDIT_LOCKING","getTemplateLockValue","lock","remove","move","BlockLockModal","clientId","onClose","setLock","useState","canEdit","canMove","canRemove","useBlockLock","allowsEditLocking","templateLock","hasTemplateLock","useSelect","select","getBlockName","getBlockAttributes","blockEditorStore","blockName","blockType","getBlockType","includes","attributes","applyTemplateLock","setApplyTemplateLock","updateBlockAttributes","useDispatch","blockInformation","useBlockDisplayInformation","useEffect","edit","isAllChecked","Object","values","every","Boolean","isMixed","some","jsx","Modal","title","sprintf","__","overlayClassName","onRequestClose","children","jsxs","onSubmit","event","preventDefault","undefined","className","role","CheckboxControl","__nextHasNoMarginBottom","label","checked","indeterminate","onChange","newValue","prevLock","Icon","icon","lockIcon","unlockIcon","ToggleControl","disabled","Flex","justify","expanded","FlexItem","Button","variant","onClick","__next40pxDefaultSize","type"],"sources":["@wordpress/block-editor/src/components/block-lock/modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useEffect, useState } from '@wordpress/element';\nimport {\n\tButton,\n\tCheckboxControl,\n\tFlex,\n\tFlexItem,\n\tIcon,\n\tModal,\n\tToggleControl,\n} from '@wordpress/components';\nimport { lock as lockIcon, unlock as unlockIcon } from '@wordpress/icons';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { getBlockType } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport useBlockLock from './use-block-lock';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport { store as blockEditorStore } from '../../store';\n\n// Entity based blocks which allow edit locking\nconst ALLOWS_EDIT_LOCKING = [ 'core/navigation' ];\n\nfunction getTemplateLockValue( lock ) {\n\t// Prevents all operations.\n\tif ( lock.remove && lock.move ) {\n\t\treturn 'all';\n\t}\n\n\t// Prevents inserting or removing blocks, but allows moving existing blocks.\n\tif ( lock.remove && ! lock.move ) {\n\t\treturn 'insert';\n\t}\n\n\treturn false;\n}\n\nexport default function BlockLockModal( { clientId, onClose } ) {\n\tconst [ lock, setLock ] = useState( { move: false, remove: false } );\n\tconst { canEdit, canMove, canRemove } = useBlockLock( clientId );\n\tconst { allowsEditLocking, templateLock, hasTemplateLock } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst blockName = getBlockName( clientId );\n\t\t\tconst blockType = getBlockType( blockName );\n\n\t\t\treturn {\n\t\t\t\tallowsEditLocking: ALLOWS_EDIT_LOCKING.includes( blockName ),\n\t\t\t\ttemplateLock: getBlockAttributes( clientId )?.templateLock,\n\t\t\t\thasTemplateLock: !! blockType?.attributes?.templateLock,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst [ applyTemplateLock, setApplyTemplateLock ] = useState(\n\t\t!! templateLock\n\t);\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\n\tuseEffect( () => {\n\t\tsetLock( {\n\t\t\tmove: ! canMove,\n\t\t\tremove: ! canRemove,\n\t\t\t...( allowsEditLocking ? { edit: ! canEdit } : {} ),\n\t\t} );\n\t}, [ canEdit, canMove, canRemove, allowsEditLocking ] );\n\n\tconst isAllChecked = Object.values( lock ).every( Boolean );\n\tconst isMixed = Object.values( lock ).some( Boolean ) && ! isAllChecked;\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ sprintf(\n\t\t\t\t/* translators: %s: Name of the block. */\n\t\t\t\t__( 'Lock %s' ),\n\t\t\t\tblockInformation.title\n\t\t\t) }\n\t\t\toverlayClassName=\"block-editor-block-lock-modal\"\n\t\t\tonRequestClose={ onClose }\n\t\t>\n\t\t\t<form\n\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tupdateBlockAttributes( [ clientId ], {\n\t\t\t\t\t\tlock,\n\t\t\t\t\t\ttemplateLock: applyTemplateLock\n\t\t\t\t\t\t\t? getTemplateLockValue( lock )\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t} );\n\t\t\t\t\tonClose();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<fieldset className=\"block-editor-block-lock-modal__options\">\n\t\t\t\t\t<legend>\n\t\t\t\t\t\t{ __( 'Select the features you want to lock' ) }\n\t\t\t\t\t</legend>\n\t\t\t\t\t{ /*\n\t\t\t\t\t * Disable reason: The `list` ARIA role is redundant but\n\t\t\t\t\t * Safari+VoiceOver won't announce the list otherwise.\n\t\t\t\t\t */\n\t\t\t\t\t/* eslint-disable jsx-a11y/no-redundant-roles */ }\n\t\t\t\t\t<ul\n\t\t\t\t\t\trole=\"list\"\n\t\t\t\t\t\tclassName=\"block-editor-block-lock-modal__checklist\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tclassName=\"block-editor-block-lock-modal__options-all\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Lock all' ) }\n\t\t\t\t\t\t\t\tchecked={ isAllChecked }\n\t\t\t\t\t\t\t\tindeterminate={ isMixed }\n\t\t\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\t\t\tsetLock( {\n\t\t\t\t\t\t\t\t\t\tmove: newValue,\n\t\t\t\t\t\t\t\t\t\tremove: newValue,\n\t\t\t\t\t\t\t\t\t\t...( allowsEditLocking\n\t\t\t\t\t\t\t\t\t\t\t? { edit: newValue }\n\t\t\t\t\t\t\t\t\t\t\t: {} ),\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ul\n\t\t\t\t\t\t\t\trole=\"list\"\n\t\t\t\t\t\t\t\tclassName=\"block-editor-block-lock-modal__checklist\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ allowsEditLocking && (\n\t\t\t\t\t\t\t\t\t<li className=\"block-editor-block-lock-modal__checklist-item\">\n\t\t\t\t\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Lock editing' ) }\n\t\t\t\t\t\t\t\t\t\t\tchecked={ !! lock.edit }\n\t\t\t\t\t\t\t\t\t\t\tonChange={ ( edit ) =>\n\t\t\t\t\t\t\t\t\t\t\t\tsetLock( ( prevLock ) => ( {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...prevLock,\n\t\t\t\t\t\t\t\t\t\t\t\t\tedit,\n\t\t\t\t\t\t\t\t\t\t\t\t} ) )\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-block-lock-modal__lock-icon\"\n\t\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t\tlock.edit\n\t\t\t\t\t\t\t\t\t\t\t\t\t? lockIcon\n\t\t\t\t\t\t\t\t\t\t\t\t\t: unlockIcon\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<li className=\"block-editor-block-lock-modal__checklist-item\">\n\t\t\t\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Lock movement' ) }\n\t\t\t\t\t\t\t\t\t\tchecked={ lock.move }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( move ) =>\n\t\t\t\t\t\t\t\t\t\t\tsetLock( ( prevLock ) => ( {\n\t\t\t\t\t\t\t\t\t\t\t\t...prevLock,\n\t\t\t\t\t\t\t\t\t\t\t\tmove,\n\t\t\t\t\t\t\t\t\t\t\t} ) )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-block-lock-modal__lock-icon\"\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tlock.move ? lockIcon : unlockIcon\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t<li className=\"block-editor-block-lock-modal__checklist-item\">\n\t\t\t\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Lock removal' ) }\n\t\t\t\t\t\t\t\t\t\tchecked={ lock.remove }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( remove ) =>\n\t\t\t\t\t\t\t\t\t\t\tsetLock( ( prevLock ) => ( {\n\t\t\t\t\t\t\t\t\t\t\t\t...prevLock,\n\t\t\t\t\t\t\t\t\t\t\t\tremove,\n\t\t\t\t\t\t\t\t\t\t\t} ) )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-block-lock-modal__lock-icon\"\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tlock.remove ? lockIcon : unlockIcon\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t{ /* eslint-enable jsx-a11y/no-redundant-roles */ }\n\t\t\t\t\t{ hasTemplateLock && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tclassName=\"block-editor-block-lock-modal__template-lock\"\n\t\t\t\t\t\t\tlabel={ __( 'Apply to all blocks inside' ) }\n\t\t\t\t\t\t\tchecked={ applyTemplateLock }\n\t\t\t\t\t\t\tdisabled={ lock.move && ! lock.remove }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetApplyTemplateLock( ! applyTemplateLock )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</fieldset>\n\t\t\t\t<Flex\n\t\t\t\t\tclassName=\"block-editor-block-lock-modal__actions\"\n\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\texpanded={ false }\n\t\t\t\t>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Apply' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AASA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAKA,IAAAM,aAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,2BAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AAAwD,IAAAU,WAAA,GAAAV,OAAA;AAvBxD;AACA;AACA;;AAgBA;AACA;AACA;;AAKA;AACA,MAAMW,mBAAmB,GAAG,CAAE,iBAAiB,CAAE;AAEjD,SAASC,oBAAoBA,CAAEC,IAAI,EAAG;EACrC;EACA,IAAKA,IAAI,CAACC,MAAM,IAAID,IAAI,CAACE,IAAI,EAAG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["_i18n","require","_element","_components","_icons","_data","_blocks","_useBlockLock","_interopRequireDefault","_useBlockDisplayInformation","_store","_jsxRuntime","ALLOWS_EDIT_LOCKING","getTemplateLockValue","lock","remove","move","BlockLockModal","clientId","onClose","setLock","useState","canEdit","canMove","canRemove","useBlockLock","allowsEditLocking","templateLock","hasTemplateLock","useSelect","select","getBlockName","getBlockAttributes","blockEditorStore","blockName","blockType","getBlockType","includes","attributes","applyTemplateLock","setApplyTemplateLock","updateBlockAttributes","useDispatch","blockInformation","useBlockDisplayInformation","useEffect","edit","isAllChecked","Object","values","every","Boolean","isMixed","some","jsx","Modal","title","sprintf","__","overlayClassName","onRequestClose","size","children","jsxs","onSubmit","event","preventDefault","undefined","className","role","CheckboxControl","__nextHasNoMarginBottom","label","checked","indeterminate","onChange","newValue","prevLock","Icon","icon","lockIcon","unlockIcon","ToggleControl","disabled","Flex","justify","expanded","FlexItem","Button","variant","onClick","__next40pxDefaultSize","type"],"sources":["@wordpress/block-editor/src/components/block-lock/modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useEffect, useState } from '@wordpress/element';\nimport {\n\tButton,\n\tCheckboxControl,\n\tFlex,\n\tFlexItem,\n\tIcon,\n\tModal,\n\tToggleControl,\n} from '@wordpress/components';\nimport { lock as lockIcon, unlock as unlockIcon } from '@wordpress/icons';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { getBlockType } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport useBlockLock from './use-block-lock';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport { store as blockEditorStore } from '../../store';\n\n// Entity based blocks which allow edit locking\nconst ALLOWS_EDIT_LOCKING = [ 'core/navigation' ];\n\nfunction getTemplateLockValue( lock ) {\n\t// Prevents all operations.\n\tif ( lock.remove && lock.move ) {\n\t\treturn 'all';\n\t}\n\n\t// Prevents inserting or removing blocks, but allows moving existing blocks.\n\tif ( lock.remove && ! lock.move ) {\n\t\treturn 'insert';\n\t}\n\n\treturn false;\n}\n\nexport default function BlockLockModal( { clientId, onClose } ) {\n\tconst [ lock, setLock ] = useState( { move: false, remove: false } );\n\tconst { canEdit, canMove, canRemove } = useBlockLock( clientId );\n\tconst { allowsEditLocking, templateLock, hasTemplateLock } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst blockName = getBlockName( clientId );\n\t\t\tconst blockType = getBlockType( blockName );\n\n\t\t\treturn {\n\t\t\t\tallowsEditLocking: ALLOWS_EDIT_LOCKING.includes( blockName ),\n\t\t\t\ttemplateLock: getBlockAttributes( clientId )?.templateLock,\n\t\t\t\thasTemplateLock: !! blockType?.attributes?.templateLock,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst [ applyTemplateLock, setApplyTemplateLock ] = useState(\n\t\t!! templateLock\n\t);\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\n\tuseEffect( () => {\n\t\tsetLock( {\n\t\t\tmove: ! canMove,\n\t\t\tremove: ! canRemove,\n\t\t\t...( allowsEditLocking ? { edit: ! canEdit } : {} ),\n\t\t} );\n\t}, [ canEdit, canMove, canRemove, allowsEditLocking ] );\n\n\tconst isAllChecked = Object.values( lock ).every( Boolean );\n\tconst isMixed = Object.values( lock ).some( Boolean ) && ! isAllChecked;\n\n\treturn (\n\t\t<Modal\n\t\t\ttitle={ sprintf(\n\t\t\t\t/* translators: %s: Name of the block. */\n\t\t\t\t__( 'Lock %s' ),\n\t\t\t\tblockInformation.title\n\t\t\t) }\n\t\t\toverlayClassName=\"block-editor-block-lock-modal\"\n\t\t\tonRequestClose={ onClose }\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t<form\n\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tupdateBlockAttributes( [ clientId ], {\n\t\t\t\t\t\tlock,\n\t\t\t\t\t\ttemplateLock: applyTemplateLock\n\t\t\t\t\t\t\t? getTemplateLockValue( lock )\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t} );\n\t\t\t\t\tonClose();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<fieldset className=\"block-editor-block-lock-modal__options\">\n\t\t\t\t\t<legend>\n\t\t\t\t\t\t{ __( 'Select the features you want to lock' ) }\n\t\t\t\t\t</legend>\n\t\t\t\t\t{ /*\n\t\t\t\t\t * Disable reason: The `list` ARIA role is redundant but\n\t\t\t\t\t * Safari+VoiceOver won't announce the list otherwise.\n\t\t\t\t\t */\n\t\t\t\t\t/* eslint-disable jsx-a11y/no-redundant-roles */ }\n\t\t\t\t\t<ul\n\t\t\t\t\t\trole=\"list\"\n\t\t\t\t\t\tclassName=\"block-editor-block-lock-modal__checklist\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tclassName=\"block-editor-block-lock-modal__options-all\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Lock all' ) }\n\t\t\t\t\t\t\t\tchecked={ isAllChecked }\n\t\t\t\t\t\t\t\tindeterminate={ isMixed }\n\t\t\t\t\t\t\t\tonChange={ ( newValue ) =>\n\t\t\t\t\t\t\t\t\tsetLock( {\n\t\t\t\t\t\t\t\t\t\tmove: newValue,\n\t\t\t\t\t\t\t\t\t\tremove: newValue,\n\t\t\t\t\t\t\t\t\t\t...( allowsEditLocking\n\t\t\t\t\t\t\t\t\t\t\t? { edit: newValue }\n\t\t\t\t\t\t\t\t\t\t\t: {} ),\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ul\n\t\t\t\t\t\t\t\trole=\"list\"\n\t\t\t\t\t\t\t\tclassName=\"block-editor-block-lock-modal__checklist\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ allowsEditLocking && (\n\t\t\t\t\t\t\t\t\t<li className=\"block-editor-block-lock-modal__checklist-item\">\n\t\t\t\t\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Lock editing' ) }\n\t\t\t\t\t\t\t\t\t\t\tchecked={ !! lock.edit }\n\t\t\t\t\t\t\t\t\t\t\tonChange={ ( edit ) =>\n\t\t\t\t\t\t\t\t\t\t\t\tsetLock( ( prevLock ) => ( {\n\t\t\t\t\t\t\t\t\t\t\t\t\t...prevLock,\n\t\t\t\t\t\t\t\t\t\t\t\t\tedit,\n\t\t\t\t\t\t\t\t\t\t\t\t} ) )\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-block-lock-modal__lock-icon\"\n\t\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t\tlock.edit\n\t\t\t\t\t\t\t\t\t\t\t\t\t? lockIcon\n\t\t\t\t\t\t\t\t\t\t\t\t\t: unlockIcon\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<li className=\"block-editor-block-lock-modal__checklist-item\">\n\t\t\t\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Lock movement' ) }\n\t\t\t\t\t\t\t\t\t\tchecked={ lock.move }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( move ) =>\n\t\t\t\t\t\t\t\t\t\t\tsetLock( ( prevLock ) => ( {\n\t\t\t\t\t\t\t\t\t\t\t\t...prevLock,\n\t\t\t\t\t\t\t\t\t\t\t\tmove,\n\t\t\t\t\t\t\t\t\t\t\t} ) )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-block-lock-modal__lock-icon\"\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tlock.move ? lockIcon : unlockIcon\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t<li className=\"block-editor-block-lock-modal__checklist-item\">\n\t\t\t\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Lock removal' ) }\n\t\t\t\t\t\t\t\t\t\tchecked={ lock.remove }\n\t\t\t\t\t\t\t\t\t\tonChange={ ( remove ) =>\n\t\t\t\t\t\t\t\t\t\t\tsetLock( ( prevLock ) => ( {\n\t\t\t\t\t\t\t\t\t\t\t\t...prevLock,\n\t\t\t\t\t\t\t\t\t\t\t\tremove,\n\t\t\t\t\t\t\t\t\t\t\t} ) )\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-block-lock-modal__lock-icon\"\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\tlock.remove ? lockIcon : unlockIcon\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t{ /* eslint-enable jsx-a11y/no-redundant-roles */ }\n\t\t\t\t\t{ hasTemplateLock && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tclassName=\"block-editor-block-lock-modal__template-lock\"\n\t\t\t\t\t\t\tlabel={ __( 'Apply to all blocks inside' ) }\n\t\t\t\t\t\t\tchecked={ applyTemplateLock }\n\t\t\t\t\t\t\tdisabled={ lock.move && ! lock.remove }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetApplyTemplateLock( ! applyTemplateLock )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</fieldset>\n\t\t\t\t<Flex\n\t\t\t\t\tclassName=\"block-editor-block-lock-modal__actions\"\n\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\texpanded={ false }\n\t\t\t\t>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Apply' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t</Flex>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AASA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,G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AA,EAEnB,IAAAJ,QAAE,EAAE,QAAS;UAAC,CACT;QAAC,CACA,CAAC,eACX,IAAA/C,WAAA,CAAA2C,GAAA,EAACnD,WAAA,CAAAoF,QAAQ;UAAAzB,QAAA,eACR,IAAAnD,WAAA,CAAA2C,GAAA,EAACnD,WAAA,CAAAqF,MAAM;YACNC,OAAO,EAAC,SAAS;YACjBG,IAAI,EAAC,QAAQ;YACbD,qBAAqB;YAAA7B,QAAA,EAEnB,IAAAJ,QAAE,EAAE,OAAQ;UAAC,CACR;QAAC,CACA,CAAC;MAAA,CACN,CAAC;IAAA,CACF;EAAC,CACD,CAAC;AAEV","ignoreList":[]}
|
|
@@ -123,7 +123,7 @@ function ImageSizeControl({
|
|
|
123
123
|
children: IMAGE_SIZE_PRESETS.map(scale => {
|
|
124
124
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToggleGroupControlOption, {
|
|
125
125
|
value: scale,
|
|
126
|
-
label: (0, _i18n.sprintf)(/* translators: Percentage value. */
|
|
126
|
+
label: (0, _i18n.sprintf)(/* translators: %d: Percentage value. */
|
|
127
127
|
(0, _i18n.__)('%d%%'), scale)
|
|
128
128
|
}, scale);
|
|
129
129
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_useDimensionHandler","_interopRequireDefault","_jsxRuntime","IMAGE_SIZE_PRESETS","noop","getScaledWidthAndHeight","scale","imageWidth","imageHeight","scaledWidth","Math","round","scaledHeight","ImageSizeControl","imageSizeHelp","imageSizeOptions","isResizable","slug","width","height","onChange","onChangeImage","currentHeight","currentWidth","updateDimension","updateDimensions","useDimensionHandler","handleUpdateDimensions","undefined","selectedValue","find","jsxs","__experimentalVStack","className","spacing","children","length","jsx","SelectControl","__nextHasNoMarginBottom","label","__","value","options","help","size","Fragment","__experimentalHStack","align","__experimentalNumberControl","min","__experimentalToggleGroupControl","hideLabelFromVision","isBlock","__next40pxDefaultSize","map","__experimentalToggleGroupControlOption","sprintf"],"sources":["@wordpress/block-editor/src/components/image-size-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tSelectControl,\n\t__experimentalNumberControl as NumberControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useDimensionHandler from './use-dimension-handler';\n\nconst IMAGE_SIZE_PRESETS = [ 25, 50, 75, 100 ];\nconst noop = () => {};\n\n/**\n * Get scaled width and height for the given scale.\n *\n * @param {number} scale The scale to get the scaled width and height for.\n * @param {number} imageWidth The image width.\n * @param {number} imageHeight The image height.\n *\n * @return {Object} The scaled width and height.\n */\nfunction getScaledWidthAndHeight( scale, imageWidth, imageHeight ) {\n\tconst scaledWidth = Math.round( imageWidth * ( scale / 100 ) );\n\tconst scaledHeight = Math.round( imageHeight * ( scale / 100 ) );\n\n\treturn {\n\t\tscaledWidth,\n\t\tscaledHeight,\n\t};\n}\n\nexport default function ImageSizeControl( {\n\timageSizeHelp,\n\timageWidth,\n\timageHeight,\n\timageSizeOptions = [],\n\tisResizable = true,\n\tslug,\n\twidth,\n\theight,\n\tonChange,\n\tonChangeImage = noop,\n} ) {\n\tconst { currentHeight, currentWidth, updateDimension, updateDimensions } =\n\t\tuseDimensionHandler( height, width, imageHeight, imageWidth, onChange );\n\n\t/**\n\t * Updates the dimensions for the given scale.\n\t * Handler for toggle group control change.\n\t *\n\t * @param {number} scale The scale to update the dimensions for.\n\t */\n\tconst handleUpdateDimensions = ( scale ) => {\n\t\tif ( undefined === scale ) {\n\t\t\tupdateDimensions();\n\t\t\treturn;\n\t\t}\n\n\t\tconst { scaledWidth, scaledHeight } = getScaledWidthAndHeight(\n\t\t\tscale,\n\t\t\timageWidth,\n\t\t\timageHeight\n\t\t);\n\n\t\tupdateDimensions( scaledHeight, scaledWidth );\n\t};\n\n\t/**\n\t * Add the stored image preset value to toggle group control.\n\t */\n\tconst selectedValue = IMAGE_SIZE_PRESETS.find( ( scale ) => {\n\t\tconst { scaledWidth, scaledHeight } = getScaledWidthAndHeight(\n\t\t\tscale,\n\t\t\timageWidth,\n\t\t\timageHeight\n\t\t);\n\n\t\treturn currentWidth === scaledWidth && currentHeight === scaledHeight;\n\t} );\n\n\treturn (\n\t\t<VStack className=\"block-editor-image-size-control\" spacing=\"4\">\n\t\t\t{ imageSizeOptions && imageSizeOptions.length > 0 && (\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\tvalue={ slug }\n\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\tonChange={ onChangeImage }\n\t\t\t\t\thelp={ imageSizeHelp }\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isResizable && (\n\t\t\t\t<>\n\t\t\t\t\t<HStack align=\"baseline\" spacing=\"4\">\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\tvalue={ currentWidth }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tupdateDimension( 'width', value )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\t\t\tvalue={ currentHeight }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tupdateDimension( 'height', value )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</HStack>\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\tlabel={ __( 'Image size presets' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tonChange={ handleUpdateDimensions }\n\t\t\t\t\t\tvalue={ selectedValue }\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t>\n\t\t\t\t\t\t{ IMAGE_SIZE_PRESETS.map( ( scale ) => {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\tkey={ scale }\n\t\t\t\t\t\t\t\t\tvalue={ scale }\n\t\t\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: Percentage value. */\n\t\t\t\t\t\t\t\t\t\t__( '%d%%' ),\n\t\t\t\t\t\t\t\t\t\tscale\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAQA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,oBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA0D,IAAAI,WAAA,GAAAJ,OAAA;AAhB1D;AACA;AACA;;AAWA;AACA;AACA;;AAGA,MAAMK,kBAAkB,GAAG,CAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAE;AAC9C,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,uBAAuBA,CAAEC,KAAK,EAAEC,UAAU,EAAEC,WAAW,EAAG;EAClE,MAAMC,WAAW,GAAGC,IAAI,CAACC,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,EAACxC,WAAA,CAAAsD,gCAAkB;QAClBX,KAAK,EAAG,IAAAC,QAAE,EAAE,oBAAqB,CAAG;QACpCW,mBAAmB;QACnBhC,QAAQ,EAAGO,sBAAwB;QACnCe,KAAK,EAAGb,aAAe;QACvBwB,OAAO;QACPC,qBAAqB;QACrBf,uBAAuB;QAAAJ,QAAA,EAErBhC,kBAAkB,CAACoD,GAAG,CAAIjD,KAAK,IAAM;UACtC,oBACC,IAAAJ,WAAA,CAAAmC,GAAA,EAACxC,WAAA,CAAA2D,sCAAwB;YAExBd,KAAK,EAAGpC,KAAO;YACfkC,KAAK,EAAG,IAAAiB,aAAO,EACd;YACA,IAAAhB,QAAE,EAAE,MAAO,CAAC,EACZnC,KACD;UAAG,GANGA,KAON,CAAC;QAEJ,CAAE;MAAC,CACgB,CAAC;IAAA,CACpB,CACF;EAAA,CACM,CAAC;AAEX","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_useDimensionHandler","_interopRequireDefault","_jsxRuntime","IMAGE_SIZE_PRESETS","noop","getScaledWidthAndHeight","scale","imageWidth","imageHeight","scaledWidth","Math","round","scaledHeight","ImageSizeControl","imageSizeHelp","imageSizeOptions","isResizable","slug","width","height","onChange","onChangeImage","currentHeight","currentWidth","updateDimension","updateDimensions","useDimensionHandler","handleUpdateDimensions","undefined","selectedValue","find","jsxs","__experimentalVStack","className","spacing","children","length","jsx","SelectControl","__nextHasNoMarginBottom","label","__","value","options","help","size","Fragment","__experimentalHStack","align","__experimentalNumberControl","min","__experimentalToggleGroupControl","hideLabelFromVision","isBlock","__next40pxDefaultSize","map","__experimentalToggleGroupControlOption","sprintf"],"sources":["@wordpress/block-editor/src/components/image-size-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tSelectControl,\n\t__experimentalNumberControl as NumberControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useDimensionHandler from './use-dimension-handler';\n\nconst IMAGE_SIZE_PRESETS = [ 25, 50, 75, 100 ];\nconst noop = () => {};\n\n/**\n * Get scaled width and height for the given scale.\n *\n * @param {number} scale The scale to get the scaled width and height for.\n * @param {number} imageWidth The image width.\n * @param {number} imageHeight The image height.\n *\n * @return {Object} The scaled width and height.\n */\nfunction getScaledWidthAndHeight( scale, imageWidth, imageHeight ) {\n\tconst scaledWidth = Math.round( imageWidth * ( scale / 100 ) );\n\tconst scaledHeight = Math.round( imageHeight * ( scale / 100 ) );\n\n\treturn {\n\t\tscaledWidth,\n\t\tscaledHeight,\n\t};\n}\n\nexport default function ImageSizeControl( {\n\timageSizeHelp,\n\timageWidth,\n\timageHeight,\n\timageSizeOptions = [],\n\tisResizable = true,\n\tslug,\n\twidth,\n\theight,\n\tonChange,\n\tonChangeImage = noop,\n} ) {\n\tconst { currentHeight, currentWidth, updateDimension, updateDimensions } =\n\t\tuseDimensionHandler( height, width, imageHeight, imageWidth, onChange );\n\n\t/**\n\t * Updates the dimensions for the given scale.\n\t * Handler for toggle group control change.\n\t *\n\t * @param {number} scale The scale to update the dimensions for.\n\t */\n\tconst handleUpdateDimensions = ( scale ) => {\n\t\tif ( undefined === scale ) {\n\t\t\tupdateDimensions();\n\t\t\treturn;\n\t\t}\n\n\t\tconst { scaledWidth, scaledHeight } = getScaledWidthAndHeight(\n\t\t\tscale,\n\t\t\timageWidth,\n\t\t\timageHeight\n\t\t);\n\n\t\tupdateDimensions( scaledHeight, scaledWidth );\n\t};\n\n\t/**\n\t * Add the stored image preset value to toggle group control.\n\t */\n\tconst selectedValue = IMAGE_SIZE_PRESETS.find( ( scale ) => {\n\t\tconst { scaledWidth, scaledHeight } = getScaledWidthAndHeight(\n\t\t\tscale,\n\t\t\timageWidth,\n\t\t\timageHeight\n\t\t);\n\n\t\treturn currentWidth === scaledWidth && currentHeight === scaledHeight;\n\t} );\n\n\treturn (\n\t\t<VStack className=\"block-editor-image-size-control\" spacing=\"4\">\n\t\t\t{ imageSizeOptions && imageSizeOptions.length > 0 && (\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\tvalue={ slug }\n\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\tonChange={ onChangeImage }\n\t\t\t\t\thelp={ imageSizeHelp }\n\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isResizable && (\n\t\t\t\t<>\n\t\t\t\t\t<HStack align=\"baseline\" spacing=\"4\">\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\tvalue={ currentWidth }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tupdateDimension( 'width', value )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\t\t\tvalue={ currentHeight }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tupdateDimension( 'height', value )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</HStack>\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\tlabel={ __( 'Image size presets' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tonChange={ handleUpdateDimensions }\n\t\t\t\t\t\tvalue={ selectedValue }\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t>\n\t\t\t\t\t\t{ IMAGE_SIZE_PRESETS.map( ( scale ) => {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\tkey={ scale }\n\t\t\t\t\t\t\t\t\tvalue={ scale }\n\t\t\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %d: Percentage value. */\n\t\t\t\t\t\t\t\t\t\t__( '%d%%' ),\n\t\t\t\t\t\t\t\t\t\tscale\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAQA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,oBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA0D,IAAAI,WAAA,GAAAJ,OAAA;AAhB1D;AACA;AACA;;AAWA;AACA;AACA;;AAGA,MAAMK,kBAAkB,GAAG,CAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAE;AAC9C,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,uBAAuBA,CAAEC,KAAK,EAAEC,UAAU,EAAEC,WAAW,EAAG;EAClE,MAAMC,WAAW,GAAGC,IAAI,CAACC,KAAK,CAAEJ,UAAU,IAAKD,KAAK,GAAG,GAAG,CAAG,CAAC;EAC9D,MAAMM,YAAY,GAAGF,IAAI,CAACC,KAAK,CAAEH,WAAW,IAAKF,KAAK,GAAG,GAAG,CAAG,CAAC;EAEhE,OAAO;IACNG,WAAW;IACXG;EACD,CAAC;AACF;AAEe,S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,QAAA,EAErBhC,kBAAkB,CAACoD,GAAG,CAAIjD,KAAK,IAAM;UACtC,oBACC,IAAAJ,WAAA,CAAAmC,GAAA,EAACxC,WAAA,CAAA2D,sCAAwB;YAExBd,KAAK,EAAGpC,KAAO;YACfkC,KAAK,EAAG,IAAAiB,aAAO,EACd;YACA,IAAAhB,QAAE,EAAE,MAAO,CAAC,EACZnC,KACD;UAAG,GANGA,KAON,CAAC;QAEJ,CAAE;MAAC,CACgB,CAAC;IAAA,CACpB,CACF;EAAA,CACM,CAAC;AAEX","ignoreList":[]}
|
|
@@ -152,13 +152,13 @@ function usePasteStyles() {
|
|
|
152
152
|
if (targetBlocks.length === 1) {
|
|
153
153
|
const title = (0, _blocks.getBlockType)(targetBlocks[0].name)?.title;
|
|
154
154
|
createSuccessNotice((0, _i18n.sprintf)(
|
|
155
|
-
// Translators: Name of the block being pasted, e.g. "Paragraph".
|
|
155
|
+
// Translators: %s: Name of the block being pasted, e.g. "Paragraph".
|
|
156
156
|
(0, _i18n.__)('Pasted styles to %s.'), title), {
|
|
157
157
|
type: 'snackbar'
|
|
158
158
|
});
|
|
159
159
|
} else {
|
|
160
160
|
createSuccessNotice((0, _i18n.sprintf)(
|
|
161
|
-
// Translators: The number of the blocks.
|
|
161
|
+
// Translators: %d: The number of the blocks.
|
|
162
162
|
(0, _i18n.__)('Pasted styles to %d blocks.'), targetBlocks.length), {
|
|
163
163
|
type: 'snackbar'
|
|
164
164
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_blocks","_data","_notices","_i18n","_store","_supports","hasSerializedBlocks","text","blocks","parse","__unstableSkipMigrationLogs","__unstableSkipAutop","length","name","err","STYLE_ATTRIBUTES","align","hasAlignSupport","borderColor","nameOrType","hasBorderSupport","backgroundColor","hasBackgroundColorSupport","textAlign","hasTextAlignSupport","textColor","hasTextColorSupport","gradient","hasGradientSupport","className","hasCustomClassNameSupport","fontFamily","hasFontFamilySupport","fontSize","hasFontSizeSupport","layout","hasLayoutSupport","style","hasStyleSupport","getStyleAttributes","sourceBlock","targetBlock","Object","entries","reduce","attributes","attributeKey","hasSupport","recursivelyUpdateBlockAttributes","targetBlocks","sourceBlocks","updateBlockAttributes","index","Math","min","clientId","innerBlocks","usePasteStyles","registry","useRegistry","useDispatch","blockEditorStore","createSuccessNotice","createWarningNotice","createErrorNotice","noticesStore","useCallback","html","window","navigator","clipboard","__","type","readText","error","copiedBlocks","batch","map","title","getBlockType","sprintf"],"sources":["@wordpress/block-editor/src/components/use-paste-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { getBlockType, parse } from '@wordpress/blocks';\nimport { useDispatch, useRegistry } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport {\n\thasAlignSupport,\n\thasBorderSupport,\n\thasBackgroundColorSupport,\n\thasTextAlignSupport,\n\thasTextColorSupport,\n\thasGradientSupport,\n\thasCustomClassNameSupport,\n\thasFontFamilySupport,\n\thasFontSizeSupport,\n\thasLayoutSupport,\n\thasStyleSupport,\n} from '../../hooks/supports';\n\n/**\n * Determine if the copied text looks like serialized blocks or not.\n * Since plain text will always get parsed into a freeform block,\n * we check that if the parsed blocks is anything other than that.\n *\n * @param {string} text The copied text.\n * @return {boolean} True if the text looks like serialized blocks, false otherwise.\n */\nfunction hasSerializedBlocks( text ) {\n\ttry {\n\t\tconst blocks = parse( text, {\n\t\t\t__unstableSkipMigrationLogs: true,\n\t\t\t__unstableSkipAutop: true,\n\t\t} );\n\t\tif ( blocks.length === 1 && blocks[ 0 ].name === 'core/freeform' ) {\n\t\t\t// It's likely that the text is just plain text and not serialized blocks.\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t} catch ( err ) {\n\t\t// Parsing error, the text is not serialized blocks.\n\t\t// (Even though that it technically won't happen)\n\t\treturn false;\n\t}\n}\n\n/**\n * Style attributes are attributes being added in `block-editor/src/hooks/*`.\n * (Except for some unrelated to style like `anchor` or `settings`.)\n * They generally represent the default block supports.\n */\nconst STYLE_ATTRIBUTES = {\n\talign: hasAlignSupport,\n\tborderColor: ( nameOrType ) => hasBorderSupport( nameOrType, 'color' ),\n\tbackgroundColor: hasBackgroundColorSupport,\n\ttextAlign: hasTextAlignSupport,\n\ttextColor: hasTextColorSupport,\n\tgradient: hasGradientSupport,\n\tclassName: hasCustomClassNameSupport,\n\tfontFamily: hasFontFamilySupport,\n\tfontSize: hasFontSizeSupport,\n\tlayout: hasLayoutSupport,\n\tstyle: hasStyleSupport,\n};\n\n/**\n * Get the \"style attributes\" from a given block to a target block.\n *\n * @param {WPBlock} sourceBlock The source block.\n * @param {WPBlock} targetBlock The target block.\n * @return {Object} the filtered attributes object.\n */\nfunction getStyleAttributes( sourceBlock, targetBlock ) {\n\treturn Object.entries( STYLE_ATTRIBUTES ).reduce(\n\t\t( attributes, [ attributeKey, hasSupport ] ) => {\n\t\t\t// Only apply the attribute if both blocks support it.\n\t\t\tif (\n\t\t\t\thasSupport( sourceBlock.name ) &&\n\t\t\t\thasSupport( targetBlock.name )\n\t\t\t) {\n\t\t\t\t// Override attributes that are not present in the block to their defaults.\n\t\t\t\tattributes[ attributeKey ] =\n\t\t\t\t\tsourceBlock.attributes[ attributeKey ];\n\t\t\t}\n\t\t\treturn attributes;\n\t\t},\n\t\t{}\n\t);\n}\n\n/**\n * Update the target blocks with style attributes recursively.\n *\n * @param {WPBlock[]} targetBlocks The target blocks to be updated.\n * @param {WPBlock[]} sourceBlocks The source blocks to get th style attributes from.\n * @param {Function} updateBlockAttributes The function to update the attributes.\n */\nfunction recursivelyUpdateBlockAttributes(\n\ttargetBlocks,\n\tsourceBlocks,\n\tupdateBlockAttributes\n) {\n\tfor (\n\t\tlet index = 0;\n\t\tindex < Math.min( sourceBlocks.length, targetBlocks.length );\n\t\tindex += 1\n\t) {\n\t\tupdateBlockAttributes(\n\t\t\ttargetBlocks[ index ].clientId,\n\t\t\tgetStyleAttributes( sourceBlocks[ index ], targetBlocks[ index ] )\n\t\t);\n\n\t\trecursivelyUpdateBlockAttributes(\n\t\t\ttargetBlocks[ index ].innerBlocks,\n\t\t\tsourceBlocks[ index ].innerBlocks,\n\t\t\tupdateBlockAttributes\n\t\t);\n\t}\n}\n\n/**\n * A hook to return a pasteStyles event function for handling pasting styles to blocks.\n *\n * @return {Function} A function to update the styles to the blocks.\n */\nexport default function usePasteStyles() {\n\tconst registry = useRegistry();\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst { createSuccessNotice, createWarningNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\treturn useCallback(\n\t\tasync ( targetBlocks ) => {\n\t\t\tlet html = '';\n\t\t\ttry {\n\t\t\t\t// `http:` sites won't have the clipboard property on navigator.\n\t\t\t\t// (with the exception of localhost.)\n\t\t\t\tif ( ! window.navigator.clipboard ) {\n\t\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\thtml = await window.navigator.clipboard.readText();\n\t\t\t} catch ( error ) {\n\t\t\t\t// Possibly the permission is denied.\n\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Unable to paste styles. Please allow browser clipboard permissions before continuing.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Abort if the copied text is empty or doesn't look like serialized blocks.\n\t\t\tif ( ! html || ! hasSerializedBlocks( html ) ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t\"Unable to paste styles. Block styles couldn't be found within the copied content.\"\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst copiedBlocks = parse( html );\n\n\t\t\tif ( copiedBlocks.length === 1 ) {\n\t\t\t\t// Apply styles of the block to all the target blocks.\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\trecursivelyUpdateBlockAttributes(\n\t\t\t\t\t\ttargetBlocks,\n\t\t\t\t\t\ttargetBlocks.map( () => copiedBlocks[ 0 ] ),\n\t\t\t\t\t\tupdateBlockAttributes\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\trecursivelyUpdateBlockAttributes(\n\t\t\t\t\t\ttargetBlocks,\n\t\t\t\t\t\tcopiedBlocks,\n\t\t\t\t\t\tupdateBlockAttributes\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tif ( targetBlocks.length === 1 ) {\n\t\t\t\tconst title = getBlockType( targetBlocks[ 0 ].name )?.title;\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t// Translators: Name of the block being pasted, e.g. \"Paragraph\".\n\t\t\t\t\t\t__( 'Pasted styles to %s.' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t\t),\n\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t// Translators: The number of the blocks.\n\t\t\t\t\t\t__( 'Pasted styles to %d blocks.' ),\n\t\t\t\t\t\ttargetBlocks.length\n\t\t\t\t\t),\n\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tregistry.batch,\n\t\t\tupdateBlockAttributes,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C,MAAM,KAAK,CAAC,EAAG;MAChC,MAAMkE,KAAK,GAAG,IAAAC,oBAAY,EAAE9B,YAAY,CAAE,CAAC,CAAE,CAACpC,IAAK,CAAC,EAAEiE,KAAK;MAC3DhB,mBAAmB,CAClB,IAAAkB,aAAO;MACN;MACA,IAAAT,QAAE,EAAE,sBAAuB,CAAC,EAC5BO,KACD,CAAC,EACD;QAAEN,IAAI,EAAE;MAAW,CACpB,CAAC;IACF,CAAC,MAAM;MACNV,mBAAmB,CAClB,IAAAkB,aAAO;MACN;MACA,IAAAT,QAAE,EAAE,6BAA8B,CAAC,EACnCtB,YAAY,CAACrC,MACd,CAAC,EACD;QAAE4D,IAAI,EAAE;MAAW,CACpB,CAAC;IACF;EACD,CAAC,EACD,CACCd,QAAQ,CAACkB,KAAK,EACdzB,qBAAqB,EACrBW,mBAAmB,EACnBC,mBAAmB,EACnBC,iBAAiB,CAEnB,CAAC;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_element","require","_blocks","_data","_notices","_i18n","_store","_supports","hasSerializedBlocks","text","blocks","parse","__unstableSkipMigrationLogs","__unstableSkipAutop","length","name","err","STYLE_ATTRIBUTES","align","hasAlignSupport","borderColor","nameOrType","hasBorderSupport","backgroundColor","hasBackgroundColorSupport","textAlign","hasTextAlignSupport","textColor","hasTextColorSupport","gradient","hasGradientSupport","className","hasCustomClassNameSupport","fontFamily","hasFontFamilySupport","fontSize","hasFontSizeSupport","layout","hasLayoutSupport","style","hasStyleSupport","getStyleAttributes","sourceBlock","targetBlock","Object","entries","reduce","attributes","attributeKey","hasSupport","recursivelyUpdateBlockAttributes","targetBlocks","sourceBlocks","updateBlockAttributes","index","Math","min","clientId","innerBlocks","usePasteStyles","registry","useRegistry","useDispatch","blockEditorStore","createSuccessNotice","createWarningNotice","createErrorNotice","noticesStore","useCallback","html","window","navigator","clipboard","__","type","readText","error","copiedBlocks","batch","map","title","getBlockType","sprintf"],"sources":["@wordpress/block-editor/src/components/use-paste-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { getBlockType, parse } from '@wordpress/blocks';\nimport { useDispatch, useRegistry } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport {\n\thasAlignSupport,\n\thasBorderSupport,\n\thasBackgroundColorSupport,\n\thasTextAlignSupport,\n\thasTextColorSupport,\n\thasGradientSupport,\n\thasCustomClassNameSupport,\n\thasFontFamilySupport,\n\thasFontSizeSupport,\n\thasLayoutSupport,\n\thasStyleSupport,\n} from '../../hooks/supports';\n\n/**\n * Determine if the copied text looks like serialized blocks or not.\n * Since plain text will always get parsed into a freeform block,\n * we check that if the parsed blocks is anything other than that.\n *\n * @param {string} text The copied text.\n * @return {boolean} True if the text looks like serialized blocks, false otherwise.\n */\nfunction hasSerializedBlocks( text ) {\n\ttry {\n\t\tconst blocks = parse( text, {\n\t\t\t__unstableSkipMigrationLogs: true,\n\t\t\t__unstableSkipAutop: true,\n\t\t} );\n\t\tif ( blocks.length === 1 && blocks[ 0 ].name === 'core/freeform' ) {\n\t\t\t// It's likely that the text is just plain text and not serialized blocks.\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t} catch ( err ) {\n\t\t// Parsing error, the text is not serialized blocks.\n\t\t// (Even though that it technically won't happen)\n\t\treturn false;\n\t}\n}\n\n/**\n * Style attributes are attributes being added in `block-editor/src/hooks/*`.\n * (Except for some unrelated to style like `anchor` or `settings`.)\n * They generally represent the default block supports.\n */\nconst STYLE_ATTRIBUTES = {\n\talign: hasAlignSupport,\n\tborderColor: ( nameOrType ) => hasBorderSupport( nameOrType, 'color' ),\n\tbackgroundColor: hasBackgroundColorSupport,\n\ttextAlign: hasTextAlignSupport,\n\ttextColor: hasTextColorSupport,\n\tgradient: hasGradientSupport,\n\tclassName: hasCustomClassNameSupport,\n\tfontFamily: hasFontFamilySupport,\n\tfontSize: hasFontSizeSupport,\n\tlayout: hasLayoutSupport,\n\tstyle: hasStyleSupport,\n};\n\n/**\n * Get the \"style attributes\" from a given block to a target block.\n *\n * @param {WPBlock} sourceBlock The source block.\n * @param {WPBlock} targetBlock The target block.\n * @return {Object} the filtered attributes object.\n */\nfunction getStyleAttributes( sourceBlock, targetBlock ) {\n\treturn Object.entries( STYLE_ATTRIBUTES ).reduce(\n\t\t( attributes, [ attributeKey, hasSupport ] ) => {\n\t\t\t// Only apply the attribute if both blocks support it.\n\t\t\tif (\n\t\t\t\thasSupport( sourceBlock.name ) &&\n\t\t\t\thasSupport( targetBlock.name )\n\t\t\t) {\n\t\t\t\t// Override attributes that are not present in the block to their defaults.\n\t\t\t\tattributes[ attributeKey ] =\n\t\t\t\t\tsourceBlock.attributes[ attributeKey ];\n\t\t\t}\n\t\t\treturn attributes;\n\t\t},\n\t\t{}\n\t);\n}\n\n/**\n * Update the target blocks with style attributes recursively.\n *\n * @param {WPBlock[]} targetBlocks The target blocks to be updated.\n * @param {WPBlock[]} sourceBlocks The source blocks to get th style attributes from.\n * @param {Function} updateBlockAttributes The function to update the attributes.\n */\nfunction recursivelyUpdateBlockAttributes(\n\ttargetBlocks,\n\tsourceBlocks,\n\tupdateBlockAttributes\n) {\n\tfor (\n\t\tlet index = 0;\n\t\tindex < Math.min( sourceBlocks.length, targetBlocks.length );\n\t\tindex += 1\n\t) {\n\t\tupdateBlockAttributes(\n\t\t\ttargetBlocks[ index ].clientId,\n\t\t\tgetStyleAttributes( sourceBlocks[ index ], targetBlocks[ index ] )\n\t\t);\n\n\t\trecursivelyUpdateBlockAttributes(\n\t\t\ttargetBlocks[ index ].innerBlocks,\n\t\t\tsourceBlocks[ index ].innerBlocks,\n\t\t\tupdateBlockAttributes\n\t\t);\n\t}\n}\n\n/**\n * A hook to return a pasteStyles event function for handling pasting styles to blocks.\n *\n * @return {Function} A function to update the styles to the blocks.\n */\nexport default function usePasteStyles() {\n\tconst registry = useRegistry();\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst { createSuccessNotice, createWarningNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\treturn useCallback(\n\t\tasync ( targetBlocks ) => {\n\t\t\tlet html = '';\n\t\t\ttry {\n\t\t\t\t// `http:` sites won't have the clipboard property on navigator.\n\t\t\t\t// (with the exception of localhost.)\n\t\t\t\tif ( ! window.navigator.clipboard ) {\n\t\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\thtml = await window.navigator.clipboard.readText();\n\t\t\t} catch ( error ) {\n\t\t\t\t// Possibly the permission is denied.\n\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Unable to paste styles. Please allow browser clipboard permissions before continuing.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Abort if the copied text is empty or doesn't look like serialized blocks.\n\t\t\tif ( ! html || ! hasSerializedBlocks( html ) ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t\"Unable to paste styles. Block styles couldn't be found within the copied content.\"\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst copiedBlocks = parse( html );\n\n\t\t\tif ( copiedBlocks.length === 1 ) {\n\t\t\t\t// Apply styles of the block to all the target blocks.\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\trecursivelyUpdateBlockAttributes(\n\t\t\t\t\t\ttargetBlocks,\n\t\t\t\t\t\ttargetBlocks.map( () => copiedBlocks[ 0 ] ),\n\t\t\t\t\t\tupdateBlockAttributes\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\trecursivelyUpdateBlockAttributes(\n\t\t\t\t\t\ttargetBlocks,\n\t\t\t\t\t\tcopiedBlocks,\n\t\t\t\t\t\tupdateBlockAttributes\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tif ( targetBlocks.length === 1 ) {\n\t\t\t\tconst title = getBlockType( targetBlocks[ 0 ].name )?.title;\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t// Translators: %s: Name of the block being pasted, e.g. \"Paragraph\".\n\t\t\t\t\t\t__( 'Pasted styles to %s.' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t\t),\n\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t// Translators: %d: The number of the blocks.\n\t\t\t\t\t\t__( 'Pasted styles to %d blocks.' ),\n\t\t\t\t\t\ttargetBlocks.length\n\t\t\t\t\t),\n\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tregistry.batch,\n\t\t\tupdateBlockAttributes,\n\t\t\tcreateSuccessNotice,\n\t\t\tcreateWarningNotice,\n\t\t\tcreateErrorNotice,\n\t\t]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAbA;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N;MACA,IAAAT,QAAE,EAAE,6BAA8B,CAAC,EACnCtB,YAAY,CAACrC,MACd,CAAC,EACD;QAAE4D,IAAI,EAAE;MAAW,CACpB,CAAC;IACF;EACD,CAAC,EACD,CACCd,QAAQ,CAACkB,KAAK,EACdzB,qBAAqB,EACrBW,mBAAmB,EACnBC,mBAAmB,EACnBC,iBAAiB,CAEnB,CAAC;AACF","ignoreList":[]}
|
|
@@ -37,11 +37,11 @@ function useNotifyCopy() {
|
|
|
37
37
|
const title = getBlockType(getBlockName(clientId))?.title;
|
|
38
38
|
if (eventType === 'copy') {
|
|
39
39
|
notice = (0, _i18n.sprintf)(
|
|
40
|
-
// Translators: Name of the block being copied, e.g. "Paragraph".
|
|
40
|
+
// Translators: %s: Name of the block being copied, e.g. "Paragraph".
|
|
41
41
|
(0, _i18n.__)('Copied "%s" to clipboard.'), title);
|
|
42
42
|
} else {
|
|
43
43
|
notice = (0, _i18n.sprintf)(
|
|
44
|
-
// Translators: Name of the block being cut, e.g. "Paragraph".
|
|
44
|
+
// Translators: %s: Name of the block being cut, e.g. "Paragraph".
|
|
45
45
|
(0, _i18n.__)('Moved "%s" to clipboard.'), title);
|
|
46
46
|
}
|
|
47
47
|
} else if (eventType === 'copy') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_blocks","_data","_i18n","_notices","_store","useNotifyCopy","getBlockName","useSelect","blockEditorStore","getBlockType","blocksStore","createSuccessNotice","useDispatch","noticesStore","useCallback","eventType","selectedBlockClientIds","notice","__","length","clientId","title","sprintf","_n","type"],"sources":["@wordpress/block-editor/src/utils/use-notify-copy.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\n\nexport function useNotifyCopy() {\n\tconst { getBlockName } = useSelect( blockEditorStore );\n\tconst { getBlockType } = useSelect( blocksStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\treturn useCallback(\n\t\t( eventType, selectedBlockClientIds ) => {\n\t\t\tlet notice = '';\n\n\t\t\tif ( eventType === 'copyStyles' ) {\n\t\t\t\tnotice = __( 'Styles copied to clipboard.' );\n\t\t\t} else if ( selectedBlockClientIds.length === 1 ) {\n\t\t\t\tconst clientId = selectedBlockClientIds[ 0 ];\n\t\t\t\tconst title = getBlockType( getBlockName( clientId ) )?.title;\n\n\t\t\t\tif ( eventType === 'copy' ) {\n\t\t\t\t\tnotice = sprintf(\n\t\t\t\t\t\t// Translators: Name of the block being copied, e.g. \"Paragraph\".\n\t\t\t\t\t\t__( 'Copied \"%s\" to clipboard.' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tnotice = sprintf(\n\t\t\t\t\t\t// Translators: Name of the block being cut, e.g. \"Paragraph\".\n\t\t\t\t\t\t__( 'Moved \"%s\" to clipboard.' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if ( eventType === 'copy' ) {\n\t\t\t\tnotice = sprintf(\n\t\t\t\t\t// Translators: %d: Number of blocks being copied.\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'Copied %d block to clipboard.',\n\t\t\t\t\t\t'Copied %d blocks to clipboard.',\n\t\t\t\t\t\tselectedBlockClientIds.length\n\t\t\t\t\t),\n\t\t\t\t\tselectedBlockClientIds.length\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tnotice = sprintf(\n\t\t\t\t\t// Translators: %d: Number of blocks being moved.\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'Moved %d block to clipboard.',\n\t\t\t\t\t\t'Moved %d blocks to clipboard.',\n\t\t\t\t\t\tselectedBlockClientIds.length\n\t\t\t\t\t),\n\t\t\t\t\t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;QACA,IAAAJ,QAAE,EAAE,0BAA2B,CAAC,EAChCG,KACD,CAAC;MACF;IACD,CAAC,MAAM,IAAKN,SAAS,KAAK,MAAM,EAAG;MAClCE,MAAM,GAAG,IAAAK,aAAO;MACf;MACA,IAAAC,QAAE,EACD,+BAA+B,EAC/B,gCAAgC,EAChCP,sBAAsB,CAACG,MACxB,CAAC,EACDH,sBAAsB,CAACG,MACxB,CAAC;IACF,CAAC,MAAM;MACNF,MAAM,GAAG,IAAAK,aAAO;MACf;MACA,IAAAC,QAAE,EACD,8BAA8B,EAC9B,+BAA+B,EAC/BP,sBAAsB,CAACG,MACxB,CAAC,EACDH,sBAAsB,CAACG,MACxB,CAAC;IACF;IAEAR,mBAAmB,CAAEM,MAAM,EAAE;MAC5BO,IAAI,EAAE;IACP,CAAE,CAAC;EACJ,CAAC,EACD,CAAEb,mBAAmB,EAAEL,YAAY,EAAEG,YAAY,CAClD,CAAC;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_element","require","_blocks","_data","_i18n","_notices","_store","useNotifyCopy","getBlockName","useSelect","blockEditorStore","getBlockType","blocksStore","createSuccessNotice","useDispatch","noticesStore","useCallback","eventType","selectedBlockClientIds","notice","__","length","clientId","title","sprintf","_n","type"],"sources":["@wordpress/block-editor/src/utils/use-notify-copy.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\n\nexport function useNotifyCopy() {\n\tconst { getBlockName } = useSelect( blockEditorStore );\n\tconst { getBlockType } = useSelect( blocksStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\treturn useCallback(\n\t\t( eventType, selectedBlockClientIds ) => {\n\t\t\tlet notice = '';\n\n\t\t\tif ( eventType === 'copyStyles' ) {\n\t\t\t\tnotice = __( 'Styles copied to clipboard.' );\n\t\t\t} else if ( selectedBlockClientIds.length === 1 ) {\n\t\t\t\tconst clientId = selectedBlockClientIds[ 0 ];\n\t\t\t\tconst title = getBlockType( getBlockName( clientId ) )?.title;\n\n\t\t\t\tif ( eventType === 'copy' ) {\n\t\t\t\t\tnotice = sprintf(\n\t\t\t\t\t\t// Translators: %s: Name of the block being copied, e.g. \"Paragraph\".\n\t\t\t\t\t\t__( 'Copied \"%s\" to clipboard.' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tnotice = sprintf(\n\t\t\t\t\t\t// Translators: %s: Name of the block being cut, e.g. \"Paragraph\".\n\t\t\t\t\t\t__( 'Moved \"%s\" to clipboard.' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if ( eventType === 'copy' ) {\n\t\t\t\tnotice = sprintf(\n\t\t\t\t\t// Translators: %d: Number of blocks being copied.\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'Copied %d block to clipboard.',\n\t\t\t\t\t\t'Copied %d blocks to clipboard.',\n\t\t\t\t\t\tselectedBlockClientIds.length\n\t\t\t\t\t),\n\t\t\t\t\tselectedBlockClientIds.length\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tnotice = sprintf(\n\t\t\t\t\t// Translators: %d: Number of blocks being moved.\n\t\t\t\t\t_n(\n\t\t\t\t\t\t'Moved %d block to clipboard.',\n\t\t\t\t\t\t'Moved %d blocks to clipboard.',\n\t\t\t\t\t\tselectedBlockClientIds.length\n\t\t\t\t\t),\n\t\t\t\t\tselectedBlockClientIds.length\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tcreateSuccessNotice( notice, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t},\n\t\t[ createSuccessNotice, getBlockName, getBlockType ]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA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CAAgC,EAChCP,sBAAsB,CAACG,MACxB,CAAC,EACDH,sBAAsB,CAACG,MACxB,CAAC;IACF,CAAC,MAAM;MACNF,MAAM,GAAG,IAAAK,aAAO;MACf;MACA,IAAAC,QAAE,EACD,8BAA8B,EAC9B,+BAA+B,EAC/BP,sBAAsB,CAACG,MACxB,CAAC,EACDH,sBAAsB,CAACG,MACxB,CAAC;IACF;IAEAR,mBAAmB,CAAEM,MAAM,EAAE;MAC5BO,IAAI,EAAE;IACP,CAAE,CAAC;EACJ,CAAC,EACD,CAAEb,mBAAmB,EAAEL,YAAY,EAAEG,YAAY,CAClD,CAAC;AACF","ignoreList":[]}
|
|
@@ -93,7 +93,6 @@ function InspectorImagePreviewItem({
|
|
|
93
93
|
toggleProps = {},
|
|
94
94
|
filename,
|
|
95
95
|
label,
|
|
96
|
-
className,
|
|
97
96
|
onToggleCallback = noop
|
|
98
97
|
}) {
|
|
99
98
|
const {
|
|
@@ -138,9 +137,7 @@ function InspectorImagePreviewItem({
|
|
|
138
137
|
};
|
|
139
138
|
return as === 'button' ? /*#__PURE__*/_jsx(Button, {
|
|
140
139
|
__next40pxDefaultSize: true,
|
|
141
|
-
className: className,
|
|
142
140
|
...restToggleProps,
|
|
143
|
-
"aria-expanded": isOpen,
|
|
144
141
|
children: renderPreviewContent()
|
|
145
142
|
}) : renderPreviewContent();
|
|
146
143
|
}
|
|
@@ -308,7 +305,6 @@ function BackgroundImageControls({
|
|
|
308
305
|
})
|
|
309
306
|
},
|
|
310
307
|
name: /*#__PURE__*/_jsx(InspectorImagePreviewItem, {
|
|
311
|
-
className: "block-editor-global-styles-background-panel__image-preview",
|
|
312
308
|
imgUrl: url,
|
|
313
309
|
filename: title,
|
|
314
310
|
label: imgLabel
|