@wordpress/block-editor 14.21.0 → 15.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- 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-list/use-block-props/index.js +1 -3
- package/build/components/block-list/use-block-props/index.js.map +1 -1
- package/build/components/block-list/use-block-props/use-is-hovered.js +8 -25
- package/build/components/block-list/use-block-props/use-is-hovered.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/block-settings-menu/block-settings-dropdown.js +7 -4
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/child-layout-control/index.js +53 -34
- package/build/components/child-layout-control/index.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/link-control/search-input.js +4 -2
- package/build/components/link-control/search-input.js.map +1 -1
- package/build/components/list-view/block.js +5 -4
- package/build/components/list-view/block.js.map +1 -1
- package/build/components/list-view/use-list-view-images.js +62 -30
- package/build/components/list-view/use-list-view-images.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/layouts/grid.js +2 -0
- package/build/layouts/grid.js.map +1 -1
- package/build/store/actions.js +7 -6
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +0 -18
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +13 -9
- package/build/store/selectors.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-list/use-block-props/index.js +1 -3
- package/build-module/components/block-list/use-block-props/index.js.map +1 -1
- package/build-module/components/block-list/use-block-props/use-is-hovered.js +8 -26
- package/build-module/components/block-list/use-block-props/use-is-hovered.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/block-settings-menu/block-settings-dropdown.js +7 -4
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/child-layout-control/index.js +54 -35
- package/build-module/components/child-layout-control/index.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/link-control/search-input.js +4 -2
- package/build-module/components/link-control/search-input.js.map +1 -1
- package/build-module/components/list-view/block.js +6 -5
- package/build-module/components/list-view/block.js.map +1 -1
- package/build-module/components/list-view/use-list-view-images.js +62 -30
- package/build-module/components/list-view/use-list-view-images.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/layouts/grid.js +2 -0
- package/build-module/layouts/grid.js.map +1 -1
- package/build-module/store/actions.js +7 -6
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +0 -17
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +12 -9
- package/build-module/store/selectors.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 +48 -19
- package/build-style/style.css +48 -19
- 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-list/use-block-props/index.js +1 -1
- package/src/components/block-list/use-block-props/use-is-hovered.js +12 -26
- package/src/components/block-lock/modal.js +1 -0
- package/src/components/block-lock/style.scss +9 -5
- package/src/components/block-settings-menu/block-settings-dropdown.js +4 -1
- package/src/components/block-variation-transforms/style.scss +7 -0
- package/src/components/border-radius-control/style.scss +5 -0
- package/src/components/child-layout-control/index.js +66 -42
- package/src/components/colors-gradients/style.scss +5 -0
- package/src/components/image-size-control/index.js +1 -1
- package/src/components/inserter-list-item/style.scss +9 -6
- package/src/components/link-control/search-input.js +9 -2
- package/src/components/link-control/style.scss +7 -0
- package/src/components/link-control/test/index.js +44 -44
- package/src/components/list-view/block.js +9 -5
- package/src/components/list-view/use-list-view-images.js +57 -36
- package/src/components/media-replace-flow/test/index.js +1 -1
- package/src/components/spacing-sizes-control/style.scss +5 -0
- package/src/components/use-paste-styles/index.js +2 -2
- package/src/hooks/layout.scss +8 -0
- package/src/layouts/grid.js +2 -2
- package/src/store/actions.js +7 -6
- package/src/store/reducer.js +0 -18
- package/src/store/selectors.js +29 -31
- package/src/utils/use-notify-copy.js +2 -2
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 15.0.0 (2025-07-23)
|
|
6
|
+
|
|
7
|
+
### Breaking Changes
|
|
8
|
+
|
|
9
|
+
- Store: Deprecate the block hovered global state and related action/selector ([#70731](https://github.com/WordPress/gutenberg/pull/70731))
|
|
10
|
+
|
|
5
11
|
## 14.21.0 (2025-06-25)
|
|
6
12
|
|
|
7
13
|
## 14.20.0 (2025-06-04)
|
|
@@ -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,GAAAd,OAAA;AAGkC,IAAAe,WAAA,GAAAf,OAAA;AA/ClC;AACA;AACA;;AAGA;AACA;AACA;;AA4BA;AACA;AACA;;AAYA,MAAMgB,qBAAqB,GAAG,OAAO;AAErC,MAAMC,wBAAwB,GAAG;EAChCC,SAAS,EAAE,YAAY;EACvBC,MAAM,EAAE,EAAE;EACVC,KAAK,EAAE,IAAI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C,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;AAEA,IAAAc,YAAA,GAAAd,OAAA;AAGkC,IAAAe,WAAA,GAAAf,OAAA;AA/ClC;AACA;AACA;;AAGA;AACA;AACA;;AA4BA;AACA;AACA;;AAYA,MAAMgB,qBAAqB,GAAG,OAAO;AAErC,MAAMC,wBAAwB,GAAG;EAChCC,SAAS,EAAE,YAAY;EACvBC,MAAM,EAAE,EAAE;EACV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,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,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,QAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAAwD,IAAAO,WAAA,GAAAP,OAAA;AAhBxD;AACA;AACA;;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,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":[]}
|
|
@@ -120,9 +120,7 @@ function useBlockProps(props = {}, {
|
|
|
120
120
|
}), (0, _useBlockRefs.useBlockRefProvider)(clientId), (0, _useFocusHandler.useFocusHandler)(clientId), (0, _useSelectedBlockEventHandlers.useEventHandlers)({
|
|
121
121
|
clientId,
|
|
122
122
|
isSelected
|
|
123
|
-
}), (0, _useIsHovered.useIsHovered)({
|
|
124
|
-
clientId
|
|
125
|
-
}), (0, _useIntersectionObserver.useIntersectionObserver)(), (0, _useMovingAnimation.default)({
|
|
123
|
+
}), (0, _useIsHovered.useIsHovered)(), (0, _useIntersectionObserver.useIntersectionObserver)(), (0, _useMovingAnimation.default)({
|
|
126
124
|
triggerAnimationOnChange: index,
|
|
127
125
|
clientId
|
|
128
126
|
}), (0, _compose.useDisabled)({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_blocks","_compose","_warning","_useMovingAnimation","_privateBlockContext","_useFocusFirstElement","_useIsHovered","_context","_useFocusHandler","_useSelectedBlockEventHandlers","_useBlockRefs","_useIntersectionObserver","_useScrollIntoView","_useFlashEditableBlocks","_blockBindings","_useFirefoxDraggableCompatibility","useBlockProps","props","__unstableIsHtml","clientId","className","wrapperProps","isAligned","index","mode","name","blockApiVersion","blockTitle","isSelected","isSubtreeDisabled","hasOverlay","initialPosition","blockEditingMode","isHighlighted","isMultiSelected","isPartiallySelected","isReusable","isDragging","hasChildSelected","isEditingDisabled","hasEditableOutline","isTemporarilyEditingAsBlocks","defaultClassName","isSectionBlock","canMove","useContext","PrivateBlockContext","blockLabel","sprintf","__","htmlSuffix","ffDragRef","useFirefoxDraggableCompatibility","mergedRefs","useMergeRefs","ref","useFocusFirstElement","useBlockRefProvider","useFocusHandler","useEventHandlers","useIsHovered","useIntersectionObserver","useMovingAnimation","triggerAnimationOnChange","useDisabled","isDisabled","useFlashEditableBlocks","isEnabled","useScrollIntoView","undefined","blockEditContext","useBlockEditContext","hasBlockBindings","blockBindingsKey","bindingsStyle","canBindBlock","globalThis","SCRIPT_DEBUG","warning","hasNegativeMargin","style","marginTop","charAt","marginBottom","marginLeft","marginRight","tabIndex","draggable","id","role","inert","clsx","save","getBlockProps"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableGetBlockProps as getBlockProps } from '@wordpress/blocks';\nimport { useMergeRefs, useDisabled } from '@wordpress/compose';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport useMovingAnimation from '../../use-moving-animation';\nimport { PrivateBlockContext } from '../private-block-context';\nimport { useFocusFirstElement } from './use-focus-first-element';\nimport { useIsHovered } from './use-is-hovered';\nimport {\n\tblockBindingsKey,\n\tuseBlockEditContext,\n} from '../../block-edit/context';\nimport { useFocusHandler } from './use-focus-handler';\nimport { useEventHandlers } from './use-selected-block-event-handlers';\nimport { useBlockRefProvider } from './use-block-refs';\nimport { useIntersectionObserver } from './use-intersection-observer';\nimport { useScrollIntoView } from './use-scroll-into-view';\nimport { useFlashEditableBlocks } from '../../use-flash-editable-blocks';\nimport { canBindBlock } from '../../../utils/block-bindings';\nimport { useFirefoxDraggableCompatibility } from './use-firefox-draggable-compatibility';\n\n/**\n * This hook is used to lightly mark an element as a block element. The element\n * should be the outermost element of a block. Call this hook and pass the\n * returned props to the element to mark as a block. If you define a ref for the\n * element, it is important to pass the ref to this hook, which the hook in turn\n * will pass to the component through the props it returns. Optionally, you can\n * also pass any other props through this hook, and they will be merged and\n * returned.\n *\n * Use of this hook on the outermost element of a block is required if using API >= v2.\n *\n * @example\n * ```js\n * import { useBlockProps } from '@wordpress/block-editor';\n *\n * export default function Edit() {\n *\n * const blockProps = useBlockProps( {\n * className: 'my-custom-class',\n * style: {\n * color: '#222222',\n * backgroundColor: '#eeeeee'\n * }\n * } )\n *\n * return (\n *\t <div { ...blockProps }>\n *\n * </div>\n * )\n * }\n *\n * ```\n *\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Options for internal use only.\n * @param {boolean} options.__unstableIsHtml\n *\n * @return {Object} Props to pass to the element to mark as a block.\n */\nexport function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {\n\tconst {\n\t\tclientId,\n\t\tclassName,\n\t\twrapperProps = {},\n\t\tisAligned,\n\t\tindex,\n\t\tmode,\n\t\tname,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\tisSelected,\n\t\tisSubtreeDisabled,\n\t\thasOverlay,\n\t\tinitialPosition,\n\t\tblockEditingMode,\n\t\tisHighlighted,\n\t\tisMultiSelected,\n\t\tisPartiallySelected,\n\t\tisReusable,\n\t\tisDragging,\n\t\thasChildSelected,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tdefaultClassName,\n\t\tisSectionBlock,\n\t\tcanMove,\n\t} = useContext( PrivateBlockContext );\n\n\t// translators: %s: Type of block (i.e. Text, Image etc)\n\tconst blockLabel = sprintf( __( 'Block: %s' ), blockTitle );\n\tconst htmlSuffix = mode === 'html' && ! __unstableIsHtml ? '-visual' : '';\n\tconst ffDragRef = useFirefoxDraggableCompatibility();\n\tconst mergedRefs = useMergeRefs( [\n\t\tprops.ref,\n\t\tuseFocusFirstElement( { clientId, initialPosition } ),\n\t\tuseBlockRefProvider( clientId ),\n\t\tuseFocusHandler( clientId ),\n\t\tuseEventHandlers( { clientId, isSelected } ),\n\t\tuseIsHovered( { clientId } ),\n\t\tuseIntersectionObserver(),\n\t\tuseMovingAnimation( { triggerAnimationOnChange: index, clientId } ),\n\t\tuseDisabled( { isDisabled: ! hasOverlay } ),\n\t\tuseFlashEditableBlocks( {\n\t\t\tclientId,\n\t\t\tisEnabled: isSectionBlock,\n\t\t} ),\n\t\tuseScrollIntoView( { isSelected } ),\n\t\tcanMove ? ffDragRef : undefined,\n\t] );\n\n\tconst blockEditContext = useBlockEditContext();\n\tconst hasBlockBindings = !! blockEditContext[ blockBindingsKey ];\n\tconst bindingsStyle =\n\t\thasBlockBindings && canBindBlock( name )\n\t\t\t? {\n\t\t\t\t\t'--wp-admin-theme-color': 'var(--wp-block-synced-color)',\n\t\t\t\t\t'--wp-admin-theme-color--rgb':\n\t\t\t\t\t\t'var(--wp-block-synced-color--rgb)',\n\t\t\t }\n\t\t\t: {};\n\n\t// Ensures it warns only inside the `edit` implementation for the block.\n\tif ( blockApiVersion < 2 && clientId === blockEditContext.clientId ) {\n\t\twarning(\n\t\t\t`Block type \"${ name }\" must support API version 2 or higher to work correctly with \"useBlockProps\" method.`\n\t\t);\n\t}\n\n\tlet hasNegativeMargin = false;\n\tif (\n\t\twrapperProps?.style?.marginTop?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginBottom?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginLeft?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginRight?.charAt( 0 ) === '-'\n\t) {\n\t\thasNegativeMargin = true;\n\t}\n\n\treturn {\n\t\ttabIndex: blockEditingMode === 'disabled' ? -1 : 0,\n\t\tdraggable: canMove && ! hasChildSelected ? true : undefined,\n\t\t...wrapperProps,\n\t\t...props,\n\t\tref: mergedRefs,\n\t\tid: `block-${ clientId }${ htmlSuffix }`,\n\t\trole: 'document',\n\t\t'aria-label': blockLabel,\n\t\t'data-block': clientId,\n\t\t'data-type': name,\n\t\t'data-title': blockTitle,\n\t\tinert: isSubtreeDisabled ? 'true' : undefined,\n\t\tclassName: clsx(\n\t\t\t'block-editor-block-list__block',\n\t\t\t{\n\t\t\t\t// The wp-block className is important for editor styles.\n\t\t\t\t'wp-block': ! isAligned,\n\t\t\t\t'has-block-overlay': hasOverlay,\n\t\t\t\t'is-selected': isSelected,\n\t\t\t\t'is-highlighted': isHighlighted,\n\t\t\t\t'is-multi-selected': isMultiSelected,\n\t\t\t\t'is-partially-selected': isPartiallySelected,\n\t\t\t\t'is-reusable': isReusable,\n\t\t\t\t'is-dragging': isDragging,\n\t\t\t\t'has-child-selected': hasChildSelected,\n\t\t\t\t'is-editing-disabled': isEditingDisabled,\n\t\t\t\t'has-editable-outline': hasEditableOutline,\n\t\t\t\t'has-negative-margin': hasNegativeMargin,\n\t\t\t\t'is-content-locked-temporarily-editing-as-blocks':\n\t\t\t\t\tisTemporarilyEditingAsBlocks,\n\t\t\t},\n\t\t\tclassName,\n\t\t\tprops.className,\n\t\t\twrapperProps.className,\n\t\t\tdefaultClassName\n\t\t),\n\t\tstyle: { ...wrapperProps.style, ...props.style, ...bindingsStyle },\n\t};\n}\n\n/**\n * Call within a save function to get the props for the block wrapper.\n *\n * @param {Object} props Optional. Props to pass to the element.\n */\nuseBlockProps.save = getBlockProps;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAN,sBAAA,CAAAC,OAAA;AAKA,IAAAM,mBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,oBAAA,GAAAP,OAAA;AACA,IAAAQ,qBAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,I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,oBAAoB,EAAEC,gBAAgB;MACtC,qBAAqB,EAAEC,iBAAiB;MACxC,sBAAsB,EAAEC,kBAAkB;MAC1C,qBAAqB,EAAEuC,iBAAiB;MACxC,iDAAiD,EAChDtC;IACF,CAAC,EACDrB,SAAS,EACTH,KAAK,CAACG,SAAS,EACfC,YAAY,CAACD,SAAS,EACtBsB,gBACD,CAAC;IACDsC,KAAK,EAAE;MAAE,GAAG3D,YAAY,CAAC2D,KAAK;MAAE,GAAG/D,KAAK,CAAC+D,KAAK;MAAE,GAAGN;IAAc;EAClE,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA1D,aAAa,CAAC4E,IAAI,GAAGC,+BAAa","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_i18n","_blocks","_compose","_warning","_useMovingAnimation","_privateBlockContext","_useFocusFirstElement","_useIsHovered","_context","_useFocusHandler","_useSelectedBlockEventHandlers","_useBlockRefs","_useIntersectionObserver","_useScrollIntoView","_useFlashEditableBlocks","_blockBindings","_useFirefoxDraggableCompatibility","useBlockProps","props","__unstableIsHtml","clientId","className","wrapperProps","isAligned","index","mode","name","blockApiVersion","blockTitle","isSelected","isSubtreeDisabled","hasOverlay","initialPosition","blockEditingMode","isHighlighted","isMultiSelected","isPartiallySelected","isReusable","isDragging","hasChildSelected","isEditingDisabled","hasEditableOutline","isTemporarilyEditingAsBlocks","defaultClassName","isSectionBlock","canMove","useContext","PrivateBlockContext","blockLabel","sprintf","__","htmlSuffix","ffDragRef","useFirefoxDraggableCompatibility","mergedRefs","useMergeRefs","ref","useFocusFirstElement","useBlockRefProvider","useFocusHandler","useEventHandlers","useIsHovered","useIntersectionObserver","useMovingAnimation","triggerAnimationOnChange","useDisabled","isDisabled","useFlashEditableBlocks","isEnabled","useScrollIntoView","undefined","blockEditContext","useBlockEditContext","hasBlockBindings","blockBindingsKey","bindingsStyle","canBindBlock","globalThis","SCRIPT_DEBUG","warning","hasNegativeMargin","style","marginTop","charAt","marginBottom","marginLeft","marginRight","tabIndex","draggable","id","role","inert","clsx","save","getBlockProps"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { __unstableGetBlockProps as getBlockProps } from '@wordpress/blocks';\nimport { useMergeRefs, useDisabled } from '@wordpress/compose';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport useMovingAnimation from '../../use-moving-animation';\nimport { PrivateBlockContext } from '../private-block-context';\nimport { useFocusFirstElement } from './use-focus-first-element';\nimport { useIsHovered } from './use-is-hovered';\nimport {\n\tblockBindingsKey,\n\tuseBlockEditContext,\n} from '../../block-edit/context';\nimport { useFocusHandler } from './use-focus-handler';\nimport { useEventHandlers } from './use-selected-block-event-handlers';\nimport { useBlockRefProvider } from './use-block-refs';\nimport { useIntersectionObserver } from './use-intersection-observer';\nimport { useScrollIntoView } from './use-scroll-into-view';\nimport { useFlashEditableBlocks } from '../../use-flash-editable-blocks';\nimport { canBindBlock } from '../../../utils/block-bindings';\nimport { useFirefoxDraggableCompatibility } from './use-firefox-draggable-compatibility';\n\n/**\n * This hook is used to lightly mark an element as a block element. The element\n * should be the outermost element of a block. Call this hook and pass the\n * returned props to the element to mark as a block. If you define a ref for the\n * element, it is important to pass the ref to this hook, which the hook in turn\n * will pass to the component through the props it returns. Optionally, you can\n * also pass any other props through this hook, and they will be merged and\n * returned.\n *\n * Use of this hook on the outermost element of a block is required if using API >= v2.\n *\n * @example\n * ```js\n * import { useBlockProps } from '@wordpress/block-editor';\n *\n * export default function Edit() {\n *\n * const blockProps = useBlockProps( {\n * className: 'my-custom-class',\n * style: {\n * color: '#222222',\n * backgroundColor: '#eeeeee'\n * }\n * } )\n *\n * return (\n *\t <div { ...blockProps }>\n *\n * </div>\n * )\n * }\n *\n * ```\n *\n *\n * @param {Object} props Optional. Props to pass to the element. Must contain\n * the ref if one is defined.\n * @param {Object} options Options for internal use only.\n * @param {boolean} options.__unstableIsHtml\n *\n * @return {Object} Props to pass to the element to mark as a block.\n */\nexport function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {\n\tconst {\n\t\tclientId,\n\t\tclassName,\n\t\twrapperProps = {},\n\t\tisAligned,\n\t\tindex,\n\t\tmode,\n\t\tname,\n\t\tblockApiVersion,\n\t\tblockTitle,\n\t\tisSelected,\n\t\tisSubtreeDisabled,\n\t\thasOverlay,\n\t\tinitialPosition,\n\t\tblockEditingMode,\n\t\tisHighlighted,\n\t\tisMultiSelected,\n\t\tisPartiallySelected,\n\t\tisReusable,\n\t\tisDragging,\n\t\thasChildSelected,\n\t\tisEditingDisabled,\n\t\thasEditableOutline,\n\t\tisTemporarilyEditingAsBlocks,\n\t\tdefaultClassName,\n\t\tisSectionBlock,\n\t\tcanMove,\n\t} = useContext( PrivateBlockContext );\n\n\t// translators: %s: Type of block (i.e. Text, Image etc)\n\tconst blockLabel = sprintf( __( 'Block: %s' ), blockTitle );\n\tconst htmlSuffix = mode === 'html' && ! __unstableIsHtml ? '-visual' : '';\n\tconst ffDragRef = useFirefoxDraggableCompatibility();\n\tconst mergedRefs = useMergeRefs( [\n\t\tprops.ref,\n\t\tuseFocusFirstElement( { clientId, initialPosition } ),\n\t\tuseBlockRefProvider( clientId ),\n\t\tuseFocusHandler( clientId ),\n\t\tuseEventHandlers( { clientId, isSelected } ),\n\t\tuseIsHovered(),\n\t\tuseIntersectionObserver(),\n\t\tuseMovingAnimation( { triggerAnimationOnChange: index, clientId } ),\n\t\tuseDisabled( { isDisabled: ! hasOverlay } ),\n\t\tuseFlashEditableBlocks( {\n\t\t\tclientId,\n\t\t\tisEnabled: isSectionBlock,\n\t\t} ),\n\t\tuseScrollIntoView( { isSelected } ),\n\t\tcanMove ? ffDragRef : undefined,\n\t] );\n\n\tconst blockEditContext = useBlockEditContext();\n\tconst hasBlockBindings = !! blockEditContext[ blockBindingsKey ];\n\tconst bindingsStyle =\n\t\thasBlockBindings && canBindBlock( name )\n\t\t\t? {\n\t\t\t\t\t'--wp-admin-theme-color': 'var(--wp-block-synced-color)',\n\t\t\t\t\t'--wp-admin-theme-color--rgb':\n\t\t\t\t\t\t'var(--wp-block-synced-color--rgb)',\n\t\t\t }\n\t\t\t: {};\n\n\t// Ensures it warns only inside the `edit` implementation for the block.\n\tif ( blockApiVersion < 2 && clientId === blockEditContext.clientId ) {\n\t\twarning(\n\t\t\t`Block type \"${ name }\" must support API version 2 or higher to work correctly with \"useBlockProps\" method.`\n\t\t);\n\t}\n\n\tlet hasNegativeMargin = false;\n\tif (\n\t\twrapperProps?.style?.marginTop?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginBottom?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginLeft?.charAt( 0 ) === '-' ||\n\t\twrapperProps?.style?.marginRight?.charAt( 0 ) === '-'\n\t) {\n\t\thasNegativeMargin = true;\n\t}\n\n\treturn {\n\t\ttabIndex: blockEditingMode === 'disabled' ? -1 : 0,\n\t\tdraggable: canMove && ! hasChildSelected ? true : undefined,\n\t\t...wrapperProps,\n\t\t...props,\n\t\tref: mergedRefs,\n\t\tid: `block-${ clientId }${ htmlSuffix }`,\n\t\trole: 'document',\n\t\t'aria-label': blockLabel,\n\t\t'data-block': clientId,\n\t\t'data-type': name,\n\t\t'data-title': blockTitle,\n\t\tinert: isSubtreeDisabled ? 'true' : undefined,\n\t\tclassName: clsx(\n\t\t\t'block-editor-block-list__block',\n\t\t\t{\n\t\t\t\t// The wp-block className is important for editor styles.\n\t\t\t\t'wp-block': ! isAligned,\n\t\t\t\t'has-block-overlay': hasOverlay,\n\t\t\t\t'is-selected': isSelected,\n\t\t\t\t'is-highlighted': isHighlighted,\n\t\t\t\t'is-multi-selected': isMultiSelected,\n\t\t\t\t'is-partially-selected': isPartiallySelected,\n\t\t\t\t'is-reusable': isReusable,\n\t\t\t\t'is-dragging': isDragging,\n\t\t\t\t'has-child-selected': hasChildSelected,\n\t\t\t\t'is-editing-disabled': isEditingDisabled,\n\t\t\t\t'has-editable-outline': hasEditableOutline,\n\t\t\t\t'has-negative-margin': hasNegativeMargin,\n\t\t\t\t'is-content-locked-temporarily-editing-as-blocks':\n\t\t\t\t\tisTemporarilyEditingAsBlocks,\n\t\t\t},\n\t\t\tclassName,\n\t\t\tprops.className,\n\t\t\twrapperProps.className,\n\t\t\tdefaultClassName\n\t\t),\n\t\tstyle: { ...wrapperProps.style, ...props.style, ...bindingsStyle },\n\t};\n}\n\n/**\n * Call within a save function to get the props for the block wrapper.\n *\n * @param {Object} props Optional. Props to pass to the element.\n */\nuseBlockProps.save = getBlockProps;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAN,sBAAA,CAAAC,OAAA;AAKA,IAAAM,mBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,oBAAA,GAAAP,OAAA;AACA,IAAAQ,qBAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AAIA,IAAAW,gBAAA,GAAAX,OAAA;AACA,IAAAY,8BAAA,GAAAZ,OAAA;AACA,IAAAa,aAAA,GAAAb,OAAA;AACA,IAAAc,wBAAA,GAAAd,OAAA;AACA,IAAAe,kBAAA,GAAAf,OAAA;AACA,IAAAgB,uBAAA,GAAAhB,OAAA;AACA,IAAAiB,cAAA,GAAAjB,OAAA;AACA,IAAAkB,iCAAA,GAAAlB,OAAA;AAhCA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;AAkBA;AACA;AACA;AACA;AACA;AACA;AACA;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E,IAAI,GAAGC,+BAAa","ignoreList":[]}
|
|
@@ -5,39 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useIsHovered = useIsHovered;
|
|
7
7
|
var _compose = require("@wordpress/compose");
|
|
8
|
-
var _data = require("@wordpress/data");
|
|
9
|
-
var _store = require("../../../store");
|
|
10
8
|
/**
|
|
11
9
|
* WordPress dependencies
|
|
12
10
|
*/
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
function listener(event) {
|
|
13
|
+
if (event.defaultPrevented) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
event.preventDefault();
|
|
17
|
+
event.currentTarget.classList.toggle('is-hovered', event.type === 'mouseover');
|
|
18
|
+
}
|
|
17
19
|
|
|
18
20
|
/*
|
|
19
21
|
* Adds `is-hovered` class when the block is hovered and in navigation or
|
|
20
22
|
* outline mode.
|
|
21
23
|
*/
|
|
22
|
-
function useIsHovered({
|
|
23
|
-
clientId
|
|
24
|
-
}) {
|
|
25
|
-
const {
|
|
26
|
-
hoverBlock
|
|
27
|
-
} = (0, _data.useDispatch)(_store.store);
|
|
28
|
-
function listener(event) {
|
|
29
|
-
if (event.defaultPrevented) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
const action = event.type === 'mouseover' ? 'add' : 'remove';
|
|
33
|
-
event.preventDefault();
|
|
34
|
-
event.currentTarget.classList[action]('is-hovered');
|
|
35
|
-
if (action === 'add') {
|
|
36
|
-
hoverBlock(clientId);
|
|
37
|
-
} else {
|
|
38
|
-
hoverBlock(null);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
24
|
+
function useIsHovered() {
|
|
41
25
|
return (0, _compose.useRefEffect)(node => {
|
|
42
26
|
node.addEventListener('mouseout', listener);
|
|
43
27
|
node.addEventListener('mouseover', listener);
|
|
@@ -47,7 +31,6 @@ function useIsHovered({
|
|
|
47
31
|
|
|
48
32
|
// Remove class in case it lingers.
|
|
49
33
|
node.classList.remove('is-hovered');
|
|
50
|
-
hoverBlock(null);
|
|
51
34
|
};
|
|
52
35
|
}, []);
|
|
53
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_compose","require","
|
|
1
|
+
{"version":3,"names":["_compose","require","listener","event","defaultPrevented","preventDefault","currentTarget","classList","toggle","type","useIsHovered","useRefEffect","node","addEventListener","removeEventListener","remove"],"sources":["@wordpress/block-editor/src/components/block-list/use-block-props/use-is-hovered.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\n\nfunction listener( event ) {\n\tif ( event.defaultPrevented ) {\n\t\treturn;\n\t}\n\n\tevent.preventDefault();\n\tevent.currentTarget.classList.toggle(\n\t\t'is-hovered',\n\t\tevent.type === 'mouseover'\n\t);\n}\n\n/*\n * Adds `is-hovered` class when the block is hovered and in navigation or\n * outline mode.\n */\nexport function useIsHovered() {\n\treturn useRefEffect( ( node ) => {\n\t\tnode.addEventListener( 'mouseout', listener );\n\t\tnode.addEventListener( 'mouseover', listener );\n\n\t\treturn () => {\n\t\t\tnode.removeEventListener( 'mouseout', listener );\n\t\t\tnode.removeEventListener( 'mouseover', listener );\n\n\t\t\t// Remove class in case it lingers.\n\t\t\tnode.classList.remove( 'is-hovered' );\n\t\t};\n\t}, [] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,SAASC,QAAQA,CAAEC,KAAK,EAAG;EAC1B,IAAKA,KAAK,CAACC,gBAAgB,EAAG;IAC7B;EACD;EAEAD,KAAK,CAACE,cAAc,CAAC,CAAC;EACtBF,KAAK,CAACG,aAAa,CAACC,SAAS,CAACC,MAAM,CACnC,YAAY,EACZL,KAAK,CAACM,IAAI,KAAK,WAChB,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAAA,EAAG;EAC9B,OAAO,IAAAC,qBAAY,EAAIC,IAAI,IAAM;IAChCA,IAAI,CAACC,gBAAgB,CAAE,UAAU,EAAEX,QAAS,CAAC;IAC7CU,IAAI,CAACC,gBAAgB,CAAE,WAAW,EAAEX,QAAS,CAAC;IAE9C,OAAO,MAAM;MACZU,IAAI,CAACE,mBAAmB,CAAE,UAAU,EAAEZ,QAAS,CAAC;MAChDU,IAAI,CAACE,mBAAmB,CAAE,WAAW,EAAEZ,QAAS,CAAC;;MAEjD;MACAU,IAAI,CAACL,SAAS,CAACQ,MAAM,CAAE,YAAa,CAAC;IACtC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;AACR","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;IAC/B,OAAO,KAAK;EACb;;EAEA;EACA,IAAKF,IAAI,CAACC,MAAM,IAAI,CAAED,IAAI,CAACE,IAAI,EAAG;IACjC,OAAO,QAAQ;EAChB;EAEA,OAAO,KAAK;AACb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AAS,EAAC,8CAA8C;UACxDI,KAAK,EAAG,IAAAb,QAAE,EAAE,4BAA6B,CAAG;UAC5Cc,OAAO,EAAGjC,iBAAmB;UAC7B2C,QAAQ,EAAGpE,IAAI,CAACE,IAAI,IAAI,CAAEF,IAAI,CAACC,MAAQ;UACvC2D,QAAQ,EAAGA,CAAA,KACVlC,oBAAoB,CAAE,CAAED,iBAAkB;QAC1C,CACD,CACD;MAAA,CACQ,CAAC,eACX,IAAA5B,WAAA,CAAAmD,IAAA,EAAC3D,WAAA,CAAAgF,IAAI;QACJhB,SAAS,EAAC,wCAAwC;QAClDiB,OAAO,EAAC,UAAU;QAClBC,QAAQ,EAAG,KAAO;QAAAxB,QAAA,gBAElB,IAAAlD,WAAA,CAAA2C,GAAA,EAACnD,WAAA,CAAAmF,QAAQ;UAAAzB,QAAA,eACR,IAAAlD,WAAA,CAAA2C,GAAA,EAACnD,WAAA,CAAAoF,MAAM;YACNC,OAAO,EAAC,UAAU;YAClBC,OAAO,EAAGtE,OAAS;YACnBuE,qBAAqB;YAAA7B,QAAA,EAEnB,IAAAH,QAAE,EAAE,QAAS;UAAC,CACT;QAAC,CACA,CAAC,eACX,IAAA/C,WAAA,CAAA2C,GAAA,EAACnD,WAAA,CAAAmF,QAAQ;UAAAzB,QAAA,eACR,IAAAlD,WAAA,CAAA2C,GAAA,EAACnD,WAAA,CAAAoF,MAAM;YACNC,OAAO,EAAC,SAAS;YACjBG,IAAI,EAAC,QAAQ;YACbD,qBAAqB;YAAA7B,QAAA,EAEnB,IAAAH,QAAE,EAAE,OAAQ;UAAC,CACR;QAAC,CACA,CAAC;MAAA,CACN,CAAC;IAAA,CACF;EAAC,CACD,CAAC;AAEV","ignoreList":[]}
|
|
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","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,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAKA,IAAAM,aAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,2BAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,I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,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":[]}
|
|
@@ -90,7 +90,8 @@ function BlockSettingsDropdown({
|
|
|
90
90
|
previousBlockClientId,
|
|
91
91
|
selectedBlockClientIds,
|
|
92
92
|
openedBlockSettingsMenu,
|
|
93
|
-
isContentOnly
|
|
93
|
+
isContentOnly,
|
|
94
|
+
isZoomOut
|
|
94
95
|
} = (0, _data.useSelect)(select => {
|
|
95
96
|
const {
|
|
96
97
|
getBlockName,
|
|
@@ -99,7 +100,8 @@ function BlockSettingsDropdown({
|
|
|
99
100
|
getSelectedBlockClientIds,
|
|
100
101
|
getBlockAttributes,
|
|
101
102
|
getOpenedBlockSettingsMenu,
|
|
102
|
-
getBlockEditingMode
|
|
103
|
+
getBlockEditingMode,
|
|
104
|
+
isZoomOut: _isZoomOut
|
|
103
105
|
} = (0, _lockUnlock.unlock)(select(_store.store));
|
|
104
106
|
const {
|
|
105
107
|
getActiveBlockVariation
|
|
@@ -112,7 +114,8 @@ function BlockSettingsDropdown({
|
|
|
112
114
|
previousBlockClientId: getPreviousBlockClientId(firstBlockClientId),
|
|
113
115
|
selectedBlockClientIds: getSelectedBlockClientIds(),
|
|
114
116
|
openedBlockSettingsMenu: getOpenedBlockSettingsMenu(),
|
|
115
|
-
isContentOnly: getBlockEditingMode(firstBlockClientId) === 'contentOnly'
|
|
117
|
+
isContentOnly: getBlockEditingMode(firstBlockClientId) === 'contentOnly',
|
|
118
|
+
isZoomOut: _isZoomOut()
|
|
116
119
|
};
|
|
117
120
|
}, [firstBlockClientId]);
|
|
118
121
|
const {
|
|
@@ -240,7 +243,7 @@ function BlockSettingsDropdown({
|
|
|
240
243
|
onClick: (0, _compose.pipe)(onClose, onDuplicate, updateSelectionAfterDuplicate),
|
|
241
244
|
shortcut: shortcuts.duplicate,
|
|
242
245
|
children: (0, _i18n.__)('Duplicate')
|
|
243
|
-
}), canInsertBlock && !
|
|
246
|
+
}), canInsertBlock && !isZoomOut && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
244
247
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
|
|
245
248
|
onClick: (0, _compose.pipe)(onClose, onInsertBefore),
|
|
246
249
|
shortcut: shortcuts.insertBefore,
|