@wordpress/block-editor 15.0.1-next.46f643fa0.0 → 15.1.1-next.0f6f9d12c.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/block-settings-menu/block-settings-dropdown.js +6 -2
- package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build/components/block-toolbar/block-toolbar-menu.native.js +2 -2
- package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build/components/border-radius-control/constants.js +41 -0
- package/build/components/border-radius-control/constants.js.map +1 -0
- package/build/components/border-radius-control/index.js +49 -58
- package/build/components/border-radius-control/index.js.map +1 -1
- package/build/components/border-radius-control/linked-button.js +1 -1
- package/build/components/border-radius-control/linked-button.js.map +1 -1
- package/build/components/border-radius-control/single-input-control.js +204 -0
- package/build/components/border-radius-control/single-input-control.js.map +1 -0
- package/build/components/border-radius-control/utils.js +161 -4
- package/build/components/border-radius-control/utils.js.map +1 -1
- package/build/components/global-styles/border-panel.js +12 -1
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +1 -1
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/utils.js +5 -3
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/rich-text/index.js +9 -4
- package/build/components/rich-text/index.js.map +1 -1
- package/build/components/rich-text/use-format-types.js +19 -8
- package/build/components/rich-text/use-format-types.js.map +1 -1
- package/build/components/url-popover/image-url-input-ui.js +2 -1
- package/build/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build/hooks/duotone.js +2 -2
- package/build/hooks/duotone.js.map +1 -1
- package/build/hooks/utils.js +4 -3
- package/build/hooks/utils.js.map +1 -1
- package/build/private-apis.js +2 -1
- package/build/private-apis.js.map +1 -1
- package/build/store/private-keys.js +2 -1
- package/build/store/private-keys.js.map +1 -1
- package/build-module/components/block-settings-menu/block-settings-dropdown.js +6 -2
- package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js +3 -3
- package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
- package/build-module/components/border-radius-control/constants.js +34 -0
- package/build-module/components/border-radius-control/constants.js.map +1 -0
- package/build-module/components/border-radius-control/index.js +53 -62
- package/build-module/components/border-radius-control/index.js.map +1 -1
- package/build-module/components/border-radius-control/linked-button.js +1 -1
- package/build-module/components/border-radius-control/linked-button.js.map +1 -1
- package/build-module/components/border-radius-control/single-input-control.js +197 -0
- package/build-module/components/border-radius-control/single-input-control.js.map +1 -0
- package/build-module/components/border-radius-control/utils.js +154 -4
- package/build-module/components/border-radius-control/utils.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +12 -1
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +1 -1
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/utils.js +5 -3
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/rich-text/index.js +9 -4
- package/build-module/components/rich-text/index.js.map +1 -1
- package/build-module/components/rich-text/use-format-types.js +19 -8
- package/build-module/components/rich-text/use-format-types.js.map +1 -1
- package/build-module/components/url-popover/image-url-input-ui.js +2 -1
- package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
- package/build-module/hooks/duotone.js +3 -3
- package/build-module/hooks/duotone.js.map +1 -1
- package/build-module/hooks/utils.js +4 -3
- package/build-module/hooks/utils.js.map +1 -1
- package/build-module/private-apis.js +3 -2
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/private-keys.js +1 -0
- package/build-module/store/private-keys.js.map +1 -1
- package/build-style/style-rtl.css +17 -23
- package/build-style/style.css +17 -23
- package/package.json +34 -34
- package/src/components/block-settings-menu/block-settings-dropdown.js +22 -14
- package/src/components/block-toolbar/block-toolbar-menu.native.js +3 -3
- package/src/components/block-variation-transforms/style.scss +1 -0
- package/src/components/border-radius-control/constants.js +46 -0
- package/src/components/border-radius-control/index.js +71 -72
- package/src/components/border-radius-control/linked-button.js +1 -1
- package/src/components/border-radius-control/single-input-control.js +277 -0
- package/src/components/border-radius-control/style.scss +16 -21
- package/src/components/border-radius-control/utils.js +178 -5
- package/src/components/global-styles/border-panel.js +12 -1
- package/src/components/global-styles/hooks.js +1 -0
- package/src/components/global-styles/utils.js +6 -1
- package/src/components/media-replace-flow/style.scss +0 -6
- package/src/components/rich-text/index.js +19 -10
- package/src/components/rich-text/use-format-types.js +42 -19
- package/src/components/url-popover/image-url-input-ui.js +2 -1
- package/src/hooks/duotone.js +11 -3
- package/src/hooks/utils.js +4 -0
- package/src/private-apis.js +2 -0
- package/src/store/private-keys.js +1 -0
- package/build/components/border-radius-control/all-input-control.js +0 -65
- package/build/components/border-radius-control/all-input-control.js.map +0 -1
- package/build/components/border-radius-control/input-controls.js +0 -82
- package/build/components/border-radius-control/input-controls.js.map +0 -1
- package/build-module/components/border-radius-control/all-input-control.js +0 -58
- package/build-module/components/border-radius-control/all-input-control.js.map +0 -1
- package/build-module/components/border-radius-control/input-controls.js +0 -75
- package/build-module/components/border-radius-control/input-controls.js.map +0 -1
- package/src/components/border-radius-control/all-input-control.js +0 -67
- package/src/components/border-radius-control/input-controls.js +0 -91
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","findNodeHandle","getClipboard","setClipboard","ToolbarGroup","ToolbarButton","Picker","getBlockType","getDefaultBlockName","hasBlockSupport","serialize","rawHandler","createBlock","isUnmodifiedDefaultBlock","isReusableBlock","__","sprintf","withDispatch","withSelect","useSelect","withInstanceId","compose","moreHorizontalMobile","useRef","useState","store","noticesStore","reusableBlocksStore","coreStore","getMoversSetup","blockEditorStore","BlockTransformationsMenu","useConvertToGroupButtons","useConvertToGroupButtonProps","jsx","_jsx","jsxs","_jsxs","BlockActionsMenu","blockTitle","canInsertBlockType","getBlocksByClientId","isEmptyDefaultBlock","isLocked","canDuplicate","isFirst","isLast","isReusableBlockType","reusableBlock","rootClientId","selectedBlockClientId","selectedBlockPossibleTransformations","createSuccessNotice","convertToRegularBlocks","duplicateBlock","onMoveDown","onMoveUp","openGeneralSidebar","pasteBlock","removeBlocks","anchorNodeRef","isStackedHorizontally","onDelete","wrapBlockMover","wrapBlockSettings","clipboard","setCurrentClipboard","blockActionsMenuPickerRef","blockTransformationMenuPickerRef","moversOptions","keys","clipboardBlock","HTML","isPasteEnabled","name","innerBlockCount","select","getBlockCount","actionTitle","backward","backwardButtonTitle","forward","forwardButtonTitle","convertToGroupButtonProps","isGroupable","isUngroupable","showConvertToGroupButton","convertToGroupButtons","allOptions","settings","id","label","value","onSelect","backwardButton","disabled","forwardButton","delete","separated","transformButton","current","presentPicker","copyButton","serializedBlock","cutButton","pasteButton","onPasteBlock","duplicateButton","successNotice","title","raw","options","length","group","ungroup","filter","Boolean","children","icon","onPickerSelect","selectedItem","find","item","onPickerPresent","disabledButtonIndices","map","option","index","accessibilityHint","OS","getAnchor","undefined","onClick","extraProps","hint","testID","ref","onChange","destructiveButtonIndex","hideCancelButton","leftAlign","pickerRef","possibleTransformations","selectedBlock","EMPTY_BLOCK_LIST","clientId","getBlockIndex","getBlockRootClientId","getBlockOrder","getBlockName","getBlockTransformItems","getBlock","getSelectedBlockClientIds","getTemplateLock","block","blockName","blockType","blockOrder","currentBlockIndex","innerBlocks","every","innerBlock","isDefaultBlock","isEmptyContent","attributes","content","isExactlyOneBlock","getEntityRecord","currentIndex","dispatch","moveBlocksDown","moveBlocksUp","duplicateBlocks","insertBlock","replaceBlock","clearSelectedBlock","getBlockSelectionEnd","__experimentalConvertBlockToStatic","convertBlockToStatic","setImmediate","args","canReplaceBlock","insertedBlock"],"sources":["@wordpress/block-editor/src/components/block-toolbar/block-toolbar-menu.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, findNodeHandle } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tgetClipboard,\n\tsetClipboard,\n\tToolbarGroup,\n\tToolbarButton,\n\tPicker,\n} from '@wordpress/components';\nimport {\n\tgetBlockType,\n\tgetDefaultBlockName,\n\thasBlockSupport,\n\tserialize,\n\trawHandler,\n\tcreateBlock,\n\tisUnmodifiedDefaultBlock,\n\tisReusableBlock,\n} from '@wordpress/blocks';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { withDispatch, withSelect, useSelect } from '@wordpress/data';\nimport { withInstanceId, compose } from '@wordpress/compose';\nimport { moreHorizontalMobile } from '@wordpress/icons';\nimport { useRef, useState } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as reusableBlocksStore } from '@wordpress/reusable-blocks';\n// Disable Reason: Needs to be refactored.\n// eslint-disable-next-line no-restricted-imports\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { getMoversSetup } from '../block-mover/mover-description';\nimport { store as blockEditorStore } from '../../store';\nimport BlockTransformationsMenu from '../block-switcher/block-transformations-menu';\nimport {\n\tuseConvertToGroupButtons,\n\tuseConvertToGroupButtonProps,\n} from '../convert-to-group-buttons';\n\nconst BlockActionsMenu = ( {\n\t// Select.\n\tblockTitle,\n\tcanInsertBlockType,\n\tgetBlocksByClientId,\n\tisEmptyDefaultBlock,\n\tisLocked,\n\tcanDuplicate,\n\tisFirst,\n\tisLast,\n\tisReusableBlockType,\n\treusableBlock,\n\trootClientId,\n\tselectedBlockClientId,\n\tselectedBlockPossibleTransformations,\n\t// Dispatch.\n\tcreateSuccessNotice,\n\tconvertToRegularBlocks,\n\tduplicateBlock,\n\tonMoveDown,\n\tonMoveUp,\n\topenGeneralSidebar,\n\tpasteBlock,\n\tremoveBlocks,\n\t// Passed in.\n\tanchorNodeRef,\n\tisStackedHorizontally,\n\tonDelete,\n\twrapBlockMover,\n\twrapBlockSettings,\n} ) => {\n\tconst [ clipboard, setCurrentClipboard ] = useState( getClipboard() );\n\tconst blockActionsMenuPickerRef = useRef();\n\tconst blockTransformationMenuPickerRef = useRef();\n\tconst moversOptions = { keys: [ 'icon', 'actionTitle' ] };\n\tconst clipboardBlock = clipboard && rawHandler( { HTML: clipboard } )[ 0 ];\n\tconst isPasteEnabled =\n\t\tclipboardBlock &&\n\t\tcanInsertBlockType( clipboardBlock.name, rootClientId );\n\n\tconst innerBlockCount = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlockCount( selectedBlockClientId ),\n\t\t[ selectedBlockClientId ]\n\t);\n\n\tconst {\n\t\tactionTitle: {\n\t\t\tbackward: backwardButtonTitle,\n\t\t\tforward: forwardButtonTitle,\n\t\t},\n\t} = getMoversSetup( isStackedHorizontally, moversOptions );\n\n\t// Check if selected block is Groupable and/or Ungroupable.\n\tconst convertToGroupButtonProps = useConvertToGroupButtonProps(\n\t\t// `selectedBlockClientId` can be undefined in some cases where this\n\t\t// component gets re-rendered right after the block is removed.\n\t\tselectedBlockClientId ? [ selectedBlockClientId ] : []\n\t);\n\tconst { isGroupable, isUngroupable } = convertToGroupButtonProps;\n\tconst showConvertToGroupButton = isGroupable || isUngroupable;\n\tconst convertToGroupButtons = useConvertToGroupButtons( {\n\t\t...convertToGroupButtonProps,\n\t} );\n\n\tconst allOptions = {\n\t\tsettings: {\n\t\t\tid: 'settingsOption',\n\t\t\tlabel: __( 'Block settings' ),\n\t\t\tvalue: 'settingsOption',\n\t\t\tonSelect: openGeneralSidebar,\n\t\t},\n\t\tbackwardButton: {\n\t\t\tid: 'backwardButtonOption',\n\t\t\tlabel: backwardButtonTitle,\n\t\t\tvalue: 'backwardButtonOption',\n\t\t\tdisabled: isFirst,\n\t\t\tonSelect: onMoveUp,\n\t\t},\n\t\tforwardButton: {\n\t\t\tid: 'forwardButtonOption',\n\t\t\tlabel: forwardButtonTitle,\n\t\t\tvalue: 'forwardButtonOption',\n\t\t\tdisabled: isLast,\n\t\t\tonSelect: onMoveDown,\n\t\t},\n\t\tdelete: {\n\t\t\tid: 'deleteOption',\n\t\t\tlabel: __( 'Remove block' ),\n\t\t\tvalue: 'deleteOption',\n\t\t\tseparated: true,\n\t\t\tdisabled: isEmptyDefaultBlock,\n\t\t\tonSelect: () => {\n\t\t\t\tonDelete();\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t// translators: displayed right after the block is removed.\n\t\t\t\t\t__( 'Block removed' )\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\ttransformButton: {\n\t\t\tid: 'transformButtonOption',\n\t\t\tlabel: __( 'Transform block…' ),\n\t\t\tvalue: 'transformButtonOption',\n\t\t\tonSelect: () => {\n\t\t\t\tif ( blockTransformationMenuPickerRef.current ) {\n\t\t\t\t\tblockTransformationMenuPickerRef.current.presentPicker();\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\tcopyButton: {\n\t\t\tid: 'copyButtonOption',\n\t\t\tlabel: __( 'Copy' ),\n\t\t\tvalue: 'copyButtonOption',\n\t\t\tonSelect: () => {\n\t\t\t\tconst serializedBlock = serialize(\n\t\t\t\t\tgetBlocksByClientId( selectedBlockClientId )\n\t\t\t\t);\n\t\t\t\tsetCurrentClipboard( serializedBlock );\n\t\t\t\tsetClipboard( serializedBlock );\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t// translators: displayed right after the block is copied.\n\t\t\t\t\t__( 'Block copied' )\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\tcutButton: {\n\t\t\tid: 'cutButtonOption',\n\t\t\tlabel: __( 'Cut block' ),\n\t\t\tvalue: 'cutButtonOption',\n\t\t\tonSelect: () => {\n\t\t\t\tsetClipboard(\n\t\t\t\t\tserialize( getBlocksByClientId( selectedBlockClientId ) )\n\t\t\t\t);\n\t\t\t\tremoveBlocks( selectedBlockClientId );\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t// translators: displayed right after the block is cut.\n\t\t\t\t\t__( 'Block cut' )\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\tpasteButton: {\n\t\t\tid: 'pasteButtonOption',\n\t\t\tlabel: __( 'Paste block after' ),\n\t\t\tvalue: 'pasteButtonOption',\n\t\t\tonSelect: () => {\n\t\t\t\tonPasteBlock();\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t// translators: displayed right after the block is pasted.\n\t\t\t\t\t__( 'Block pasted' )\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\tduplicateButton: {\n\t\t\tid: 'duplicateButtonOption',\n\t\t\tlabel: __( 'Duplicate block' ),\n\t\t\tvalue: 'duplicateButtonOption',\n\t\t\tonSelect: () => {\n\t\t\t\tduplicateBlock();\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t// translators: displayed right after the block is duplicated.\n\t\t\t\t\t__( 'Block duplicated' )\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\tconvertToRegularBlocks: {\n\t\t\tid: 'convertToRegularBlocksOption',\n\t\t\tlabel: __( 'Detach' ),\n\t\t\tvalue: 'convertToRegularBlocksOption',\n\t\t\tonSelect: () => {\n\t\t\t\t/* translators: %s: name of the synced block */\n\t\t\t\tconst successNotice = __( '%s detached' );\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\tsuccessNotice,\n\t\t\t\t\t\treusableBlock?.title?.raw || blockTitle\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconvertToRegularBlocks();\n\t\t\t},\n\t\t},\n\t};\n\n\tconst options = [\n\t\twrapBlockMover && allOptions.backwardButton,\n\t\twrapBlockMover && allOptions.forwardButton,\n\t\twrapBlockSettings && allOptions.settings,\n\t\t! isLocked &&\n\t\t\tselectedBlockPossibleTransformations.length &&\n\t\t\tallOptions.transformButton,\n\t\tcanDuplicate && allOptions.copyButton,\n\t\tcanDuplicate && allOptions.cutButton,\n\t\tcanDuplicate && isPasteEnabled && allOptions.pasteButton,\n\t\tcanDuplicate && allOptions.duplicateButton,\n\t\tshowConvertToGroupButton && isGroupable && convertToGroupButtons.group,\n\t\tshowConvertToGroupButton &&\n\t\t\tisUngroupable &&\n\t\t\tconvertToGroupButtons.ungroup,\n\t\tisReusableBlockType &&\n\t\t\tinnerBlockCount > 0 &&\n\t\t\tallOptions.convertToRegularBlocks,\n\t\t! isLocked && allOptions.delete,\n\t].filter( Boolean );\n\n\t// End early if there are no options to show.\n\tif ( ! options.length ) {\n\t\treturn (\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\ttitle={ __( 'Open Block Actions Menu' ) }\n\t\t\t\t\ticon={ moreHorizontalMobile }\n\t\t\t\t\tdisabled\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t);\n\t}\n\n\tfunction onPasteBlock() {\n\t\tif ( ! clipboard ) {\n\t\t\treturn;\n\t\t}\n\n\t\tpasteBlock( rawHandler( { HTML: clipboard } )[ 0 ] );\n\t}\n\n\tfunction onPickerSelect( value ) {\n\t\tconst selectedItem = options.find( ( item ) => item.value === value );\n\t\tselectedItem.onSelect();\n\t}\n\n\tfunction onPickerPresent() {\n\t\tif ( blockActionsMenuPickerRef.current ) {\n\t\t\tblockActionsMenuPickerRef.current.presentPicker();\n\t\t}\n\t}\n\n\tconst disabledButtonIndices = options\n\t\t.map( ( option, index ) => option.disabled && index + 1 )\n\t\t.filter( Boolean );\n\n\tconst accessibilityHint =\n\t\tPlatform.OS === 'ios'\n\t\t\t? __( 'Double tap to open Action Sheet with available options' )\n\t\t\t: __( 'Double tap to open Bottom Sheet with available options' );\n\n\tconst getAnchor = () =>\n\t\tanchorNodeRef ? findNodeHandle( anchorNodeRef ) : undefined;\n\n\treturn (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarButton\n\t\t\t\ttitle={ __( 'Open Block Actions Menu' ) }\n\t\t\t\tonClick={ onPickerPresent }\n\t\t\t\ticon={ moreHorizontalMobile }\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: accessibilityHint,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<Picker\n\t\t\t\ttestID=\"block-actions-menu\"\n\t\t\t\tref={ blockActionsMenuPickerRef }\n\t\t\t\toptions={ options }\n\t\t\t\tonChange={ onPickerSelect }\n\t\t\t\tdestructiveButtonIndex={ options.length }\n\t\t\t\tdisabledButtonIndices={ disabledButtonIndices }\n\t\t\t\thideCancelButton={ Platform.OS !== 'ios' }\n\t\t\t\tleftAlign\n\t\t\t\tgetAnchor={ getAnchor }\n\t\t\t\t// translators: %s: block title e.g: \"Paragraph\".\n\t\t\t\ttitle={ sprintf( __( '%s block options' ), blockTitle ) }\n\t\t\t/>\n\t\t\t<BlockTransformationsMenu\n\t\t\t\tanchorNodeRef={ anchorNodeRef }\n\t\t\t\tblockTitle={ blockTitle }\n\t\t\t\tpickerRef={ blockTransformationMenuPickerRef }\n\t\t\t\tpossibleTransformations={ selectedBlockPossibleTransformations }\n\t\t\t\tselectedBlock={ getBlocksByClientId( selectedBlockClientId ) }\n\t\t\t\tselectedBlockClientId={ selectedBlockClientId }\n\t\t\t/>\n\t\t</ToolbarGroup>\n\t);\n};\n\nconst EMPTY_BLOCK_LIST = [];\n\nexport default compose(\n\twithSelect( ( select, { clientId } ) => {\n\t\tconst {\n\t\t\tgetBlockIndex,\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockOrder,\n\t\t\tgetBlockName,\n\t\t\tgetBlockTransformItems,\n\t\t\tgetBlock,\n\t\t\tgetBlocksByClientId,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tcanInsertBlockType,\n\t\t\tgetTemplateLock,\n\t\t} = select( blockEditorStore );\n\t\tconst block = getBlock( clientId );\n\t\tconst blockName = getBlockName( clientId );\n\t\tconst blockType = getBlockType( blockName );\n\t\tconst blockTitle = blockType?.title;\n\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\tconst blockOrder = getBlockOrder( rootClientId );\n\n\t\tconst currentBlockIndex = getBlockIndex( clientId );\n\t\tconst isFirst = currentBlockIndex === 0;\n\t\tconst isLast = currentBlockIndex === blockOrder.length - 1;\n\n\t\tconst innerBlocks = getBlocksByClientId( clientId );\n\n\t\tconst canDuplicate = innerBlocks.every( ( innerBlock ) => {\n\t\t\treturn (\n\t\t\t\t!! innerBlock &&\n\t\t\t\thasBlockSupport( innerBlock.name, 'multiple', true ) &&\n\t\t\t\tcanInsertBlockType( innerBlock.name, rootClientId )\n\t\t\t);\n\t\t} );\n\n\t\tconst isDefaultBlock = blockName === getDefaultBlockName();\n\t\tconst isEmptyContent = block?.attributes.content === '';\n\t\tconst isExactlyOneBlock = blockOrder.length === 1;\n\t\tconst isEmptyDefaultBlock =\n\t\t\tisExactlyOneBlock && isDefaultBlock && isEmptyContent;\n\t\tconst isLocked = !! getTemplateLock( rootClientId );\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientIds()[ 0 ];\n\t\tconst selectedBlock = selectedBlockClientId\n\t\t\t? getBlocksByClientId( selectedBlockClientId )[ 0 ]\n\t\t\t: undefined;\n\t\tconst selectedBlockPossibleTransformations = selectedBlock\n\t\t\t? getBlockTransformItems( selectedBlock, rootClientId )\n\t\t\t: EMPTY_BLOCK_LIST;\n\n\t\tconst isReusableBlockType = block ? isReusableBlock( block ) : false;\n\t\tconst reusableBlock = isReusableBlockType\n\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_block',\n\t\t\t\t\tblock?.attributes.ref\n\t\t\t )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tblockTitle,\n\t\t\tcanInsertBlockType,\n\t\t\tcurrentIndex: currentBlockIndex,\n\t\t\tgetBlocksByClientId,\n\t\t\tisEmptyDefaultBlock,\n\t\t\tisLocked,\n\t\t\tcanDuplicate,\n\t\t\tisFirst,\n\t\t\tisLast,\n\t\t\tisReusableBlockType,\n\t\t\treusableBlock,\n\t\t\trootClientId,\n\t\t\tselectedBlockClientId,\n\t\t\tselectedBlockPossibleTransformations,\n\t\t};\n\t} ),\n\twithDispatch(\n\t\t(\n\t\t\tdispatch,\n\t\t\t{ clientId, rootClientId, currentIndex, selectedBlockClientId },\n\t\t\t{ select }\n\t\t) => {\n\t\t\tconst {\n\t\t\t\tmoveBlocksDown,\n\t\t\t\tmoveBlocksUp,\n\t\t\t\tduplicateBlocks,\n\t\t\t\tremoveBlocks,\n\t\t\t\tinsertBlock,\n\t\t\t\treplaceBlock,\n\t\t\t\tclearSelectedBlock,\n\t\t\t} = dispatch( blockEditorStore );\n\t\t\tconst { openGeneralSidebar } = dispatch( 'core/edit-post' );\n\t\t\tconst { getBlockSelectionEnd, getBlock } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst { createSuccessNotice } = dispatch( noticesStore );\n\n\t\t\tconst { __experimentalConvertBlockToStatic: convertBlockToStatic } =\n\t\t\t\tdispatch( reusableBlocksStore );\n\n\t\t\treturn {\n\t\t\t\tcreateSuccessNotice,\n\t\t\t\tconvertToRegularBlocks() {\n\t\t\t\t\tclearSelectedBlock();\n\t\t\t\t\t// Convert action is executed at the end of the current JavaScript execution block\n\t\t\t\t\t// to prevent issues related to undo/redo actions.\n\t\t\t\t\tsetImmediate( () =>\n\t\t\t\t\t\tconvertBlockToStatic( selectedBlockClientId )\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tduplicateBlock() {\n\t\t\t\t\treturn duplicateBlocks( [ clientId ] );\n\t\t\t\t},\n\t\t\t\tonMoveDown: ( ...args ) =>\n\t\t\t\t\tmoveBlocksDown( [ clientId ], rootClientId, ...args ),\n\t\t\t\tonMoveUp: ( ...args ) =>\n\t\t\t\t\tmoveBlocksUp( [ clientId ], rootClientId, ...args ),\n\t\t\t\topenGeneralSidebar: () =>\n\t\t\t\t\topenGeneralSidebar( 'edit-post/block' ),\n\t\t\t\tpasteBlock: ( clipboardBlock ) => {\n\t\t\t\t\tconst canReplaceBlock = isUnmodifiedDefaultBlock(\n\t\t\t\t\t\tgetBlock( getBlockSelectionEnd() )\n\t\t\t\t\t);\n\n\t\t\t\t\tif ( ! canReplaceBlock ) {\n\t\t\t\t\t\tconst insertedBlock = createBlock(\n\t\t\t\t\t\t\tclipboardBlock.name,\n\t\t\t\t\t\t\tclipboardBlock.attributes,\n\t\t\t\t\t\t\tclipboardBlock.innerBlocks\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tinsertBlock(\n\t\t\t\t\t\t\tinsertedBlock,\n\t\t\t\t\t\t\tcurrentIndex + 1,\n\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treplaceBlock( clientId, clipboardBlock );\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tremoveBlocks,\n\t\t\t};\n\t\t}\n\t),\n\twithInstanceId\n)( BlockActionsMenu );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,cAAc,QAAQ,cAAc;;AAEvD;AACA;AACA;AACA,SACCC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,aAAa,EACbC,MAAM,QACA,uBAAuB;AAC9B,SACCC,YAAY,EACZC,mBAAmB,EACnBC,eAAe,EACfC,SAAS,EACTC,UAAU,EACVC,WAAW,EACXC,wBAAwB,EACxBC,eAAe,QACT,mBAAmB;AAC1B,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,YAAY,EAAEC,UAAU,EAAEC,SAAS,QAAQ,iBAAiB;AACrE,SAASC,cAAc,EAAEC,OAAO,QAAQ,oBAAoB;AAC5D,SAASC,oBAAoB,QAAQ,kBAAkB;AACvD,SAASC,MAAM,EAAEC,QAAQ,QAAQ,oBAAoB;AACrD,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASD,KAAK,IAAIE,mBAAmB,QAAQ,4BAA4B;AACzE;AACA;AACA,SAASF,KAAK,IAAIG,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,cAAc,QAAQ,kCAAkC;AACjE,SAASJ,KAAK,IAAIK,gBAAgB,QAAQ,aAAa;AACvD,OAAOC,wBAAwB,MAAM,8CAA8C;AACnF,SACCC,wBAAwB,EACxBC,4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findNodeHandle","getClipboard","setClipboard","ToolbarGroup","ToolbarButton","Picker","getBlockType","getDefaultBlockName","hasBlockSupport","serialize","rawHandler","createBlock","isUnmodifiedDefaultBlock","isReusableBlock","__","sprintf","withDispatch","withSelect","useSelect","withInstanceId","compose","moreHorizontal","useRef","useState","store","noticesStore","reusableBlocksStore","coreStore","getMoversSetup","blockEditorStore","BlockTransformationsMenu","useConvertToGroupButtons","useConvertToGroupButtonProps","jsx","_jsx","jsxs","_jsxs","BlockActionsMenu","blockTitle","canInsertBlockType","getBlocksByClientId","isEmptyDefaultBlock","isLocked","canDuplicate","isFirst","isLast","isReusableBlockType","reusableBlock","rootClientId","selectedBlockClientId","selectedBlockPossibleTransformations","createSuccessNotice","convertToRegularBlocks","duplicateBlock","onMoveDown","onMoveUp","openGeneralSidebar","pasteBlock","removeBlocks","anchorNodeRef","isStackedHorizontally","onDelete","wrapBlockMover","wrapBlockSettings","clipboard","setCurrentClipboard","blockActionsMenuPickerRef","blockTransformationMenuPickerRef","moversOptions","keys","clipboardBlock","HTML","isPasteEnabled","name","innerBlockCount","select","getBlockCount","actionTitle","backward","backwardButtonTitle","forward","forwardButtonTitle","convertToGroupButtonProps","isGroupable","isUngroupable","showConvertToGroupButton","convertToGroupButtons","allOptions","settings","id","label","value","onSelect","backwardButton","disabled","forwardButton","delete","separated","transformButton","current","presentPicker","copyButton","serializedBlock","cutButton","pasteButton","onPasteBlock","duplicateButton","successNotice","title","raw","options","length","group","ungroup","filter","Boolean","children","icon","onPickerSelect","selectedItem","find","item","onPickerPresent","disabledButtonIndices","map","option","index","accessibilityHint","OS","getAnchor","undefined","onClick","extraProps","hint","testID","ref","onChange","destructiveButtonIndex","hideCancelButton","leftAlign","pickerRef","possibleTransformations","selectedBlock","EMPTY_BLOCK_LIST","clientId","getBlockIndex","getBlockRootClientId","getBlockOrder","getBlockName","getBlockTransformItems","getBlock","getSelectedBlockClientIds","getTemplateLock","block","blockName","blockType","blockOrder","currentBlockIndex","innerBlocks","every","innerBlock","isDefaultBlock","isEmptyContent","attributes","content","isExactlyOneBlock","getEntityRecord","currentIndex","dispatch","moveBlocksDown","moveBlocksUp","duplicateBlocks","insertBlock","replaceBlock","clearSelectedBlock","getBlockSelectionEnd","__experimentalConvertBlockToStatic","convertBlockToStatic","setImmediate","args","canReplaceBlock","insertedBlock"],"sources":["@wordpress/block-editor/src/components/block-toolbar/block-toolbar-menu.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Platform, findNodeHandle } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tgetClipboard,\n\tsetClipboard,\n\tToolbarGroup,\n\tToolbarButton,\n\tPicker,\n} from '@wordpress/components';\nimport {\n\tgetBlockType,\n\tgetDefaultBlockName,\n\thasBlockSupport,\n\tserialize,\n\trawHandler,\n\tcreateBlock,\n\tisUnmodifiedDefaultBlock,\n\tisReusableBlock,\n} from '@wordpress/blocks';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { withDispatch, withSelect, useSelect } from '@wordpress/data';\nimport { withInstanceId, compose } from '@wordpress/compose';\nimport { moreHorizontal } from '@wordpress/icons';\nimport { useRef, useState } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as reusableBlocksStore } from '@wordpress/reusable-blocks';\n// Disable Reason: Needs to be refactored.\n// eslint-disable-next-line no-restricted-imports\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { getMoversSetup } from '../block-mover/mover-description';\nimport { store as blockEditorStore } from '../../store';\nimport BlockTransformationsMenu from '../block-switcher/block-transformations-menu';\nimport {\n\tuseConvertToGroupButtons,\n\tuseConvertToGroupButtonProps,\n} from '../convert-to-group-buttons';\n\nconst BlockActionsMenu = ( {\n\t// Select.\n\tblockTitle,\n\tcanInsertBlockType,\n\tgetBlocksByClientId,\n\tisEmptyDefaultBlock,\n\tisLocked,\n\tcanDuplicate,\n\tisFirst,\n\tisLast,\n\tisReusableBlockType,\n\treusableBlock,\n\trootClientId,\n\tselectedBlockClientId,\n\tselectedBlockPossibleTransformations,\n\t// Dispatch.\n\tcreateSuccessNotice,\n\tconvertToRegularBlocks,\n\tduplicateBlock,\n\tonMoveDown,\n\tonMoveUp,\n\topenGeneralSidebar,\n\tpasteBlock,\n\tremoveBlocks,\n\t// Passed in.\n\tanchorNodeRef,\n\tisStackedHorizontally,\n\tonDelete,\n\twrapBlockMover,\n\twrapBlockSettings,\n} ) => {\n\tconst [ clipboard, setCurrentClipboard ] = useState( getClipboard() );\n\tconst blockActionsMenuPickerRef = useRef();\n\tconst blockTransformationMenuPickerRef = useRef();\n\tconst moversOptions = { keys: [ 'icon', 'actionTitle' ] };\n\tconst clipboardBlock = clipboard && rawHandler( { HTML: clipboard } )[ 0 ];\n\tconst isPasteEnabled =\n\t\tclipboardBlock &&\n\t\tcanInsertBlockType( clipboardBlock.name, rootClientId );\n\n\tconst innerBlockCount = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlockCount( selectedBlockClientId ),\n\t\t[ selectedBlockClientId ]\n\t);\n\n\tconst {\n\t\tactionTitle: {\n\t\t\tbackward: backwardButtonTitle,\n\t\t\tforward: forwardButtonTitle,\n\t\t},\n\t} = getMoversSetup( isStackedHorizontally, moversOptions );\n\n\t// Check if selected block is Groupable and/or Ungroupable.\n\tconst convertToGroupButtonProps = useConvertToGroupButtonProps(\n\t\t// `selectedBlockClientId` can be undefined in some cases where this\n\t\t// component gets re-rendered right after the block is removed.\n\t\tselectedBlockClientId ? [ selectedBlockClientId ] : []\n\t);\n\tconst { isGroupable, isUngroupable } = convertToGroupButtonProps;\n\tconst showConvertToGroupButton = isGroupable || isUngroupable;\n\tconst convertToGroupButtons = useConvertToGroupButtons( {\n\t\t...convertToGroupButtonProps,\n\t} );\n\n\tconst allOptions = {\n\t\tsettings: {\n\t\t\tid: 'settingsOption',\n\t\t\tlabel: __( 'Block settings' ),\n\t\t\tvalue: 'settingsOption',\n\t\t\tonSelect: openGeneralSidebar,\n\t\t},\n\t\tbackwardButton: {\n\t\t\tid: 'backwardButtonOption',\n\t\t\tlabel: backwardButtonTitle,\n\t\t\tvalue: 'backwardButtonOption',\n\t\t\tdisabled: isFirst,\n\t\t\tonSelect: onMoveUp,\n\t\t},\n\t\tforwardButton: {\n\t\t\tid: 'forwardButtonOption',\n\t\t\tlabel: forwardButtonTitle,\n\t\t\tvalue: 'forwardButtonOption',\n\t\t\tdisabled: isLast,\n\t\t\tonSelect: onMoveDown,\n\t\t},\n\t\tdelete: {\n\t\t\tid: 'deleteOption',\n\t\t\tlabel: __( 'Remove block' ),\n\t\t\tvalue: 'deleteOption',\n\t\t\tseparated: true,\n\t\t\tdisabled: isEmptyDefaultBlock,\n\t\t\tonSelect: () => {\n\t\t\t\tonDelete();\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t// translators: displayed right after the block is removed.\n\t\t\t\t\t__( 'Block removed' )\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\ttransformButton: {\n\t\t\tid: 'transformButtonOption',\n\t\t\tlabel: __( 'Transform block…' ),\n\t\t\tvalue: 'transformButtonOption',\n\t\t\tonSelect: () => {\n\t\t\t\tif ( blockTransformationMenuPickerRef.current ) {\n\t\t\t\t\tblockTransformationMenuPickerRef.current.presentPicker();\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t\tcopyButton: {\n\t\t\tid: 'copyButtonOption',\n\t\t\tlabel: __( 'Copy' ),\n\t\t\tvalue: 'copyButtonOption',\n\t\t\tonSelect: () => {\n\t\t\t\tconst serializedBlock = serialize(\n\t\t\t\t\tgetBlocksByClientId( selectedBlockClientId )\n\t\t\t\t);\n\t\t\t\tsetCurrentClipboard( serializedBlock );\n\t\t\t\tsetClipboard( serializedBlock );\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t// translators: displayed right after the block is copied.\n\t\t\t\t\t__( 'Block copied' )\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\tcutButton: {\n\t\t\tid: 'cutButtonOption',\n\t\t\tlabel: __( 'Cut block' ),\n\t\t\tvalue: 'cutButtonOption',\n\t\t\tonSelect: () => {\n\t\t\t\tsetClipboard(\n\t\t\t\t\tserialize( getBlocksByClientId( selectedBlockClientId ) )\n\t\t\t\t);\n\t\t\t\tremoveBlocks( selectedBlockClientId );\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t// translators: displayed right after the block is cut.\n\t\t\t\t\t__( 'Block cut' )\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\tpasteButton: {\n\t\t\tid: 'pasteButtonOption',\n\t\t\tlabel: __( 'Paste block after' ),\n\t\t\tvalue: 'pasteButtonOption',\n\t\t\tonSelect: () => {\n\t\t\t\tonPasteBlock();\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t// translators: displayed right after the block is pasted.\n\t\t\t\t\t__( 'Block pasted' )\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\tduplicateButton: {\n\t\t\tid: 'duplicateButtonOption',\n\t\t\tlabel: __( 'Duplicate block' ),\n\t\t\tvalue: 'duplicateButtonOption',\n\t\t\tonSelect: () => {\n\t\t\t\tduplicateBlock();\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t// translators: displayed right after the block is duplicated.\n\t\t\t\t\t__( 'Block duplicated' )\n\t\t\t\t);\n\t\t\t},\n\t\t},\n\t\tconvertToRegularBlocks: {\n\t\t\tid: 'convertToRegularBlocksOption',\n\t\t\tlabel: __( 'Detach' ),\n\t\t\tvalue: 'convertToRegularBlocksOption',\n\t\t\tonSelect: () => {\n\t\t\t\t/* translators: %s: name of the synced block */\n\t\t\t\tconst successNotice = __( '%s detached' );\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\tsuccessNotice,\n\t\t\t\t\t\treusableBlock?.title?.raw || blockTitle\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tconvertToRegularBlocks();\n\t\t\t},\n\t\t},\n\t};\n\n\tconst options = [\n\t\twrapBlockMover && allOptions.backwardButton,\n\t\twrapBlockMover && allOptions.forwardButton,\n\t\twrapBlockSettings && allOptions.settings,\n\t\t! isLocked &&\n\t\t\tselectedBlockPossibleTransformations.length &&\n\t\t\tallOptions.transformButton,\n\t\tcanDuplicate && allOptions.copyButton,\n\t\tcanDuplicate && allOptions.cutButton,\n\t\tcanDuplicate && isPasteEnabled && allOptions.pasteButton,\n\t\tcanDuplicate && allOptions.duplicateButton,\n\t\tshowConvertToGroupButton && isGroupable && convertToGroupButtons.group,\n\t\tshowConvertToGroupButton &&\n\t\t\tisUngroupable &&\n\t\t\tconvertToGroupButtons.ungroup,\n\t\tisReusableBlockType &&\n\t\t\tinnerBlockCount > 0 &&\n\t\t\tallOptions.convertToRegularBlocks,\n\t\t! isLocked && allOptions.delete,\n\t].filter( Boolean );\n\n\t// End early if there are no options to show.\n\tif ( ! options.length ) {\n\t\treturn (\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\ttitle={ __( 'Open Block Actions Menu' ) }\n\t\t\t\t\ticon={ moreHorizontal }\n\t\t\t\t\tdisabled\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t);\n\t}\n\n\tfunction onPasteBlock() {\n\t\tif ( ! clipboard ) {\n\t\t\treturn;\n\t\t}\n\n\t\tpasteBlock( rawHandler( { HTML: clipboard } )[ 0 ] );\n\t}\n\n\tfunction onPickerSelect( value ) {\n\t\tconst selectedItem = options.find( ( item ) => item.value === value );\n\t\tselectedItem.onSelect();\n\t}\n\n\tfunction onPickerPresent() {\n\t\tif ( blockActionsMenuPickerRef.current ) {\n\t\t\tblockActionsMenuPickerRef.current.presentPicker();\n\t\t}\n\t}\n\n\tconst disabledButtonIndices = options\n\t\t.map( ( option, index ) => option.disabled && index + 1 )\n\t\t.filter( Boolean );\n\n\tconst accessibilityHint =\n\t\tPlatform.OS === 'ios'\n\t\t\t? __( 'Double tap to open Action Sheet with available options' )\n\t\t\t: __( 'Double tap to open Bottom Sheet with available options' );\n\n\tconst getAnchor = () =>\n\t\tanchorNodeRef ? findNodeHandle( anchorNodeRef ) : undefined;\n\n\treturn (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarButton\n\t\t\t\ttitle={ __( 'Open Block Actions Menu' ) }\n\t\t\t\tonClick={ onPickerPresent }\n\t\t\t\ticon={ moreHorizontal }\n\t\t\t\textraProps={ {\n\t\t\t\t\thint: accessibilityHint,\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t<Picker\n\t\t\t\ttestID=\"block-actions-menu\"\n\t\t\t\tref={ blockActionsMenuPickerRef }\n\t\t\t\toptions={ options }\n\t\t\t\tonChange={ onPickerSelect }\n\t\t\t\tdestructiveButtonIndex={ options.length }\n\t\t\t\tdisabledButtonIndices={ disabledButtonIndices }\n\t\t\t\thideCancelButton={ Platform.OS !== 'ios' }\n\t\t\t\tleftAlign\n\t\t\t\tgetAnchor={ getAnchor }\n\t\t\t\t// translators: %s: block title e.g: \"Paragraph\".\n\t\t\t\ttitle={ sprintf( __( '%s block options' ), blockTitle ) }\n\t\t\t/>\n\t\t\t<BlockTransformationsMenu\n\t\t\t\tanchorNodeRef={ anchorNodeRef }\n\t\t\t\tblockTitle={ blockTitle }\n\t\t\t\tpickerRef={ blockTransformationMenuPickerRef }\n\t\t\t\tpossibleTransformations={ selectedBlockPossibleTransformations }\n\t\t\t\tselectedBlock={ getBlocksByClientId( selectedBlockClientId ) }\n\t\t\t\tselectedBlockClientId={ selectedBlockClientId }\n\t\t\t/>\n\t\t</ToolbarGroup>\n\t);\n};\n\nconst EMPTY_BLOCK_LIST = [];\n\nexport default compose(\n\twithSelect( ( select, { clientId } ) => {\n\t\tconst {\n\t\t\tgetBlockIndex,\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlockOrder,\n\t\t\tgetBlockName,\n\t\t\tgetBlockTransformItems,\n\t\t\tgetBlock,\n\t\t\tgetBlocksByClientId,\n\t\t\tgetSelectedBlockClientIds,\n\t\t\tcanInsertBlockType,\n\t\t\tgetTemplateLock,\n\t\t} = select( blockEditorStore );\n\t\tconst block = getBlock( clientId );\n\t\tconst blockName = getBlockName( clientId );\n\t\tconst blockType = getBlockType( blockName );\n\t\tconst blockTitle = blockType?.title;\n\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\tconst blockOrder = getBlockOrder( rootClientId );\n\n\t\tconst currentBlockIndex = getBlockIndex( clientId );\n\t\tconst isFirst = currentBlockIndex === 0;\n\t\tconst isLast = currentBlockIndex === blockOrder.length - 1;\n\n\t\tconst innerBlocks = getBlocksByClientId( clientId );\n\n\t\tconst canDuplicate = innerBlocks.every( ( innerBlock ) => {\n\t\t\treturn (\n\t\t\t\t!! innerBlock &&\n\t\t\t\thasBlockSupport( innerBlock.name, 'multiple', true ) &&\n\t\t\t\tcanInsertBlockType( innerBlock.name, rootClientId )\n\t\t\t);\n\t\t} );\n\n\t\tconst isDefaultBlock = blockName === getDefaultBlockName();\n\t\tconst isEmptyContent = block?.attributes.content === '';\n\t\tconst isExactlyOneBlock = blockOrder.length === 1;\n\t\tconst isEmptyDefaultBlock =\n\t\t\tisExactlyOneBlock && isDefaultBlock && isEmptyContent;\n\t\tconst isLocked = !! getTemplateLock( rootClientId );\n\n\t\tconst selectedBlockClientId = getSelectedBlockClientIds()[ 0 ];\n\t\tconst selectedBlock = selectedBlockClientId\n\t\t\t? getBlocksByClientId( selectedBlockClientId )[ 0 ]\n\t\t\t: undefined;\n\t\tconst selectedBlockPossibleTransformations = selectedBlock\n\t\t\t? getBlockTransformItems( selectedBlock, rootClientId )\n\t\t\t: EMPTY_BLOCK_LIST;\n\n\t\tconst isReusableBlockType = block ? isReusableBlock( block ) : false;\n\t\tconst reusableBlock = isReusableBlockType\n\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_block',\n\t\t\t\t\tblock?.attributes.ref\n\t\t\t )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tblockTitle,\n\t\t\tcanInsertBlockType,\n\t\t\tcurrentIndex: currentBlockIndex,\n\t\t\tgetBlocksByClientId,\n\t\t\tisEmptyDefaultBlock,\n\t\t\tisLocked,\n\t\t\tcanDuplicate,\n\t\t\tisFirst,\n\t\t\tisLast,\n\t\t\tisReusableBlockType,\n\t\t\treusableBlock,\n\t\t\trootClientId,\n\t\t\tselectedBlockClientId,\n\t\t\tselectedBlockPossibleTransformations,\n\t\t};\n\t} ),\n\twithDispatch(\n\t\t(\n\t\t\tdispatch,\n\t\t\t{ clientId, rootClientId, currentIndex, selectedBlockClientId },\n\t\t\t{ select }\n\t\t) => {\n\t\t\tconst {\n\t\t\t\tmoveBlocksDown,\n\t\t\t\tmoveBlocksUp,\n\t\t\t\tduplicateBlocks,\n\t\t\t\tremoveBlocks,\n\t\t\t\tinsertBlock,\n\t\t\t\treplaceBlock,\n\t\t\t\tclearSelectedBlock,\n\t\t\t} = dispatch( blockEditorStore );\n\t\t\tconst { openGeneralSidebar } = dispatch( 'core/edit-post' );\n\t\t\tconst { getBlockSelectionEnd, getBlock } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst { createSuccessNotice } = dispatch( noticesStore );\n\n\t\t\tconst { __experimentalConvertBlockToStatic: convertBlockToStatic } =\n\t\t\t\tdispatch( reusableBlocksStore );\n\n\t\t\treturn {\n\t\t\t\tcreateSuccessNotice,\n\t\t\t\tconvertToRegularBlocks() {\n\t\t\t\t\tclearSelectedBlock();\n\t\t\t\t\t// Convert action is executed at the end of the current JavaScript execution block\n\t\t\t\t\t// to prevent issues related to undo/redo actions.\n\t\t\t\t\tsetImmediate( () =>\n\t\t\t\t\t\tconvertBlockToStatic( selectedBlockClientId )\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tduplicateBlock() {\n\t\t\t\t\treturn duplicateBlocks( [ clientId ] );\n\t\t\t\t},\n\t\t\t\tonMoveDown: ( ...args ) =>\n\t\t\t\t\tmoveBlocksDown( [ clientId ], rootClientId, ...args ),\n\t\t\t\tonMoveUp: ( ...args ) =>\n\t\t\t\t\tmoveBlocksUp( [ clientId ], rootClientId, ...args ),\n\t\t\t\topenGeneralSidebar: () =>\n\t\t\t\t\topenGeneralSidebar( 'edit-post/block' ),\n\t\t\t\tpasteBlock: ( clipboardBlock ) => {\n\t\t\t\t\tconst canReplaceBlock = isUnmodifiedDefaultBlock(\n\t\t\t\t\t\tgetBlock( getBlockSelectionEnd() )\n\t\t\t\t\t);\n\n\t\t\t\t\tif ( ! canReplaceBlock ) {\n\t\t\t\t\t\tconst insertedBlock = createBlock(\n\t\t\t\t\t\t\tclipboardBlock.name,\n\t\t\t\t\t\t\tclipboardBlock.attributes,\n\t\t\t\t\t\t\tclipboardBlock.innerBlocks\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tinsertBlock(\n\t\t\t\t\t\t\tinsertedBlock,\n\t\t\t\t\t\t\tcurrentIndex + 1,\n\t\t\t\t\t\t\trootClientId\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treplaceBlock( clientId, clipboardBlock );\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tremoveBlocks,\n\t\t\t};\n\t\t}\n\t),\n\twithInstanceId\n)( BlockActionsMenu );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,cAAc,QAAQ,cAAc;;AAEvD;AACA;AACA;AACA,SACCC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,aAAa,EACbC,MAAM,QACA,uBAAuB;AAC9B,SACCC,YAAY,EACZC,mBAAmB,EACnBC,eAAe,EACfC,SAAS,EACTC,UAAU,EACVC,WAAW,EACXC,wBAAwB,EACxBC,eAAe,QACT,mBAAmB;AAC1B,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,YAAY,EAAEC,UAAU,EAAEC,SAAS,QAAQ,iBAAiB;AACrE,SAASC,cAAc,EAAEC,OAAO,QAAQ,oBAAoB;AAC5D,SAASC,cAAc,QAAQ,kBAA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K,WAAW,CAChC2D,cAAc,CAACG,IAAI,EACnBH,cAAc,CAAC6F,UAAU,EACzB7F,cAAc,CAACwF,WAChB,CAAC;QAEDc,WAAW,CACVS,aAAa,EACbd,YAAY,GAAG,CAAC,EAChBvH,YACD,CAAC;MACF,CAAC,MAAM;QACN6H,YAAY,CAAE7B,QAAQ,EAAE1E,cAAe,CAAC;MACzC;IACD,CAAC;IACDZ;EACD,CAAC;AACF,CACD,CAAC,EACDvC,cACD,CAAC,CAAEkB,gBAAiB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { cornerAll, cornerBottomLeft, cornerBottomRight, cornerTopLeft, cornerTopRight } from '@wordpress/icons';
|
|
6
|
+
export const DEFAULT_VALUES = {
|
|
7
|
+
topLeft: undefined,
|
|
8
|
+
topRight: undefined,
|
|
9
|
+
bottomLeft: undefined,
|
|
10
|
+
bottomRight: undefined
|
|
11
|
+
};
|
|
12
|
+
export const RANGE_CONTROL_MAX_SIZE = 8;
|
|
13
|
+
export const EMPTY_ARRAY = [];
|
|
14
|
+
export const CORNERS = {
|
|
15
|
+
all: __('Border radius'),
|
|
16
|
+
topLeft: __('Top left'),
|
|
17
|
+
topRight: __('Top right'),
|
|
18
|
+
bottomLeft: __('Bottom left'),
|
|
19
|
+
bottomRight: __('Bottom right')
|
|
20
|
+
};
|
|
21
|
+
export const ICONS = {
|
|
22
|
+
all: cornerAll,
|
|
23
|
+
topLeft: cornerTopLeft,
|
|
24
|
+
topRight: cornerTopRight,
|
|
25
|
+
bottomLeft: cornerBottomLeft,
|
|
26
|
+
bottomRight: cornerBottomRight
|
|
27
|
+
};
|
|
28
|
+
export const MIN_BORDER_RADIUS_VALUE = 0;
|
|
29
|
+
export const MAX_BORDER_RADIUS_VALUES = {
|
|
30
|
+
px: 100,
|
|
31
|
+
em: 20,
|
|
32
|
+
rem: 20
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__","cornerAll","cornerBottomLeft","cornerBottomRight","cornerTopLeft","cornerTopRight","DEFAULT_VALUES","topLeft","undefined","topRight","bottomLeft","bottomRight","RANGE_CONTROL_MAX_SIZE","EMPTY_ARRAY","CORNERS","all","ICONS","MIN_BORDER_RADIUS_VALUE","MAX_BORDER_RADIUS_VALUES","px","em","rem"],"sources":["@wordpress/block-editor/src/components/border-radius-control/constants.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tcornerAll,\n\tcornerBottomLeft,\n\tcornerBottomRight,\n\tcornerTopLeft,\n\tcornerTopRight,\n} from '@wordpress/icons';\n\nexport const DEFAULT_VALUES = {\n\ttopLeft: undefined,\n\ttopRight: undefined,\n\tbottomLeft: undefined,\n\tbottomRight: undefined,\n};\n\nexport const RANGE_CONTROL_MAX_SIZE = 8;\n\nexport const EMPTY_ARRAY = [];\n\nexport const CORNERS = {\n\tall: __( 'Border radius' ),\n\ttopLeft: __( 'Top left' ),\n\ttopRight: __( 'Top right' ),\n\tbottomLeft: __( 'Bottom left' ),\n\tbottomRight: __( 'Bottom right' ),\n};\n\nexport const ICONS = {\n\tall: cornerAll,\n\ttopLeft: cornerTopLeft,\n\ttopRight: cornerTopRight,\n\tbottomLeft: cornerBottomLeft,\n\tbottomRight: cornerBottomRight,\n};\n\nexport const MIN_BORDER_RADIUS_VALUE = 0;\n\nexport const MAX_BORDER_RADIUS_VALUES = {\n\tpx: 100,\n\tem: 20,\n\trem: 20,\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SACCC,SAAS,EACTC,gBAAgB,EAChBC,iBAAiB,EACjBC,aAAa,EACbC,cAAc,QACR,kBAAkB;AAEzB,OAAO,MAAMC,cAAc,GAAG;EAC7BC,OAAO,EAAEC,SAAS;EAClBC,QAAQ,EAAED,SAAS;EACnBE,UAAU,EAAEF,SAAS;EACrBG,WAAW,EAAEH;AACd,CAAC;AAED,OAAO,MAAMI,sBAAsB,GAAG,CAAC;AAEvC,OAAO,MAAMC,WAAW,GAAG,EAAE;AAE7B,OAAO,MAAMC,OAAO,GAAG;EACtBC,GAAG,EAAEf,EAAE,CAAE,eAAgB,CAAC;EAC1BO,OAAO,EAAEP,EAAE,CAAE,UAAW,CAAC;EACzBS,QAAQ,EAAET,EAAE,CAAE,WAAY,CAAC;EAC3BU,UAAU,EAAEV,EAAE,CAAE,aAAc,CAAC;EAC/BW,WAAW,EAAEX,EAAE,CAAE,cAAe;AACjC,CAAC;AAED,OAAO,MAAMgB,KAAK,GAAG;EACpBD,GAAG,EAAEd,SAAS;EACdM,OAAO,EAAEH,aAAa;EACtBK,QAAQ,EAAEJ,cAAc;EACxBK,UAAU,EAAER,gBAAgB;EAC5BS,WAAW,EAAER;AACd,CAAC;AAED,OAAO,MAAMc,uBAAuB,GAAG,CAAC;AAExC,OAAO,MAAMC,wBAAwB,GAAG;EACvCC,EAAE,EAAE,GAAG;EACPC,EAAE,EAAE,EAAE;EACNC,GAAG,EAAE;AACN,CAAC","ignoreList":[]}
|
|
@@ -1,31 +1,37 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { BaseControl,
|
|
5
|
-
import { useState } from '@wordpress/element';
|
|
4
|
+
import { BaseControl, __experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue, __experimentalUseCustomUnits as useCustomUnits, __experimentalVStack as VStack, __experimentalHStack as HStack } from '@wordpress/components';
|
|
5
|
+
import { useState, useMemo } from '@wordpress/element';
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
|
-
import AllInputControl from './all-input-control';
|
|
12
|
-
import InputControls from './input-controls';
|
|
13
11
|
import LinkedButton from './linked-button';
|
|
14
12
|
import { useSettings } from '../use-settings';
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
13
|
+
import { hasDefinedValues, hasMixedValues } from './utils';
|
|
14
|
+
import SingleInputControl from './single-input-control';
|
|
15
|
+
import { DEFAULT_VALUES, RANGE_CONTROL_MAX_SIZE, EMPTY_ARRAY } from './constants';
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
|
+
function useBorderRadiusSizes(presets) {
|
|
18
|
+
var _presets$default, _presets$custom, _presets$theme;
|
|
19
|
+
const defaultSizes = (_presets$default = presets?.default) !== null && _presets$default !== void 0 ? _presets$default : EMPTY_ARRAY;
|
|
20
|
+
const customSizes = (_presets$custom = presets?.custom) !== null && _presets$custom !== void 0 ? _presets$custom : EMPTY_ARRAY;
|
|
21
|
+
const themeSizes = (_presets$theme = presets?.theme) !== null && _presets$theme !== void 0 ? _presets$theme : EMPTY_ARRAY;
|
|
22
|
+
return useMemo(() => {
|
|
23
|
+
const sizes = [{
|
|
24
|
+
name: __('None'),
|
|
25
|
+
slug: '0',
|
|
26
|
+
size: 0
|
|
27
|
+
}, ...customSizes, ...themeSizes, ...defaultSizes];
|
|
28
|
+
return sizes.length > RANGE_CONTROL_MAX_SIZE ? [{
|
|
29
|
+
name: __('Default'),
|
|
30
|
+
slug: 'default',
|
|
31
|
+
size: undefined
|
|
32
|
+
}, ...sizes] : sizes;
|
|
33
|
+
}, [customSizes, themeSizes, defaultSizes]);
|
|
34
|
+
}
|
|
29
35
|
|
|
30
36
|
/**
|
|
31
37
|
* Control to display border radius options.
|
|
@@ -33,15 +39,17 @@ const MAX_BORDER_RADIUS_VALUES = {
|
|
|
33
39
|
* @param {Object} props Component props.
|
|
34
40
|
* @param {Function} props.onChange Callback to handle onChange.
|
|
35
41
|
* @param {Object} props.values Border radius values.
|
|
42
|
+
* @param {Object} props.presets Border radius presets.
|
|
36
43
|
*
|
|
37
44
|
* @return {Element} Custom border radius control.
|
|
38
45
|
*/
|
|
39
46
|
export default function BorderRadiusControl({
|
|
40
47
|
onChange,
|
|
41
|
-
values
|
|
48
|
+
values,
|
|
49
|
+
presets
|
|
42
50
|
}) {
|
|
43
51
|
const [isLinked, setIsLinked] = useState(!hasDefinedValues(values) || !hasMixedValues(values));
|
|
44
|
-
|
|
52
|
+
const options = useBorderRadiusSizes(presets);
|
|
45
53
|
// Tracking selected units via internal state allows filtering of CSS unit
|
|
46
54
|
// only values from being saved while maintaining preexisting unit selection
|
|
47
55
|
// behaviour. Filtering CSS unit only values prevents invalid style values.
|
|
@@ -56,55 +64,38 @@ export default function BorderRadiusControl({
|
|
|
56
64
|
const units = useCustomUnits({
|
|
57
65
|
availableUnits: availableUnits || ['px', 'em', 'rem']
|
|
58
66
|
});
|
|
59
|
-
const unit = getAllUnit(selectedUnits);
|
|
60
|
-
const unitConfig = units && units.find(item => item.value === unit);
|
|
61
|
-
const step = unitConfig?.step || 1;
|
|
62
|
-
const [allValue] = parseQuantityAndUnitFromRawValue(getAllValue(values));
|
|
63
67
|
const toggleLinked = () => setIsLinked(!isLinked);
|
|
64
|
-
const handleSliderChange = next => {
|
|
65
|
-
onChange(next !== undefined ? `${next}${unit}` : undefined);
|
|
66
|
-
};
|
|
67
68
|
return /*#__PURE__*/_jsxs("fieldset", {
|
|
68
69
|
className: "components-border-radius-control",
|
|
69
|
-
children: [/*#__PURE__*/
|
|
70
|
-
|
|
71
|
-
children:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
children: [isLinked ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
75
|
-
children: [/*#__PURE__*/_jsx(AllInputControl, {
|
|
76
|
-
className: "components-border-radius-control__unit-control",
|
|
77
|
-
values: values,
|
|
78
|
-
min: MIN_BORDER_RADIUS_VALUE,
|
|
79
|
-
onChange: onChange,
|
|
80
|
-
selectedUnits: selectedUnits,
|
|
81
|
-
setSelectedUnits: setSelectedUnits,
|
|
82
|
-
units: units
|
|
83
|
-
}), /*#__PURE__*/_jsx(RangeControl, {
|
|
84
|
-
__next40pxDefaultSize: true,
|
|
85
|
-
label: __('Border radius'),
|
|
86
|
-
hideLabelFromVision: true,
|
|
87
|
-
className: "components-border-radius-control__range-control",
|
|
88
|
-
value: allValue !== null && allValue !== void 0 ? allValue : '',
|
|
89
|
-
min: MIN_BORDER_RADIUS_VALUE,
|
|
90
|
-
max: MAX_BORDER_RADIUS_VALUES[unit],
|
|
91
|
-
initialPosition: 0,
|
|
92
|
-
withInputField: false,
|
|
93
|
-
onChange: handleSliderChange,
|
|
94
|
-
step: step,
|
|
95
|
-
__nextHasNoMarginBottom: true
|
|
96
|
-
})]
|
|
97
|
-
}) : /*#__PURE__*/_jsx(InputControls, {
|
|
98
|
-
min: MIN_BORDER_RADIUS_VALUE,
|
|
99
|
-
onChange: onChange,
|
|
100
|
-
selectedUnits: selectedUnits,
|
|
101
|
-
setSelectedUnits: setSelectedUnits,
|
|
102
|
-
values: values || DEFAULT_VALUES,
|
|
103
|
-
units: units
|
|
70
|
+
children: [/*#__PURE__*/_jsxs(HStack, {
|
|
71
|
+
className: "components-border-radius-control__header",
|
|
72
|
+
children: [/*#__PURE__*/_jsx(BaseControl.VisualLabel, {
|
|
73
|
+
as: "legend",
|
|
74
|
+
children: __('Radius')
|
|
104
75
|
}), /*#__PURE__*/_jsx(LinkedButton, {
|
|
105
76
|
onClick: toggleLinked,
|
|
106
77
|
isLinked: isLinked
|
|
107
78
|
})]
|
|
79
|
+
}), isLinked ? /*#__PURE__*/_jsx(_Fragment, {
|
|
80
|
+
children: /*#__PURE__*/_jsx(SingleInputControl, {
|
|
81
|
+
onChange: onChange,
|
|
82
|
+
selectedUnits: selectedUnits,
|
|
83
|
+
setSelectedUnits: setSelectedUnits,
|
|
84
|
+
values: values,
|
|
85
|
+
units: units,
|
|
86
|
+
corner: "all",
|
|
87
|
+
presets: options
|
|
88
|
+
})
|
|
89
|
+
}) : /*#__PURE__*/_jsx(VStack, {
|
|
90
|
+
children: ['topLeft', 'topRight', 'bottomLeft', 'bottomRight'].map(corner => /*#__PURE__*/_jsx(SingleInputControl, {
|
|
91
|
+
onChange: onChange,
|
|
92
|
+
selectedUnits: selectedUnits,
|
|
93
|
+
setSelectedUnits: setSelectedUnits,
|
|
94
|
+
values: values || DEFAULT_VALUES,
|
|
95
|
+
units: units,
|
|
96
|
+
corner: corner,
|
|
97
|
+
presets: options
|
|
98
|
+
}, corner))
|
|
108
99
|
})]
|
|
109
100
|
});
|
|
110
101
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseControl","
|
|
1
|
+
{"version":3,"names":["BaseControl","__experimentalParseQuantityAndUnitFromRawValue","parseQuantityAndUnitFromRawValue","__experimentalUseCustomUnits","useCustomUnits","__experimentalVStack","VStack","__experimentalHStack","HStack","useState","useMemo","__","LinkedButton","useSettings","hasDefinedValues","hasMixedValues","SingleInputControl","DEFAULT_VALUES","RANGE_CONTROL_MAX_SIZE","EMPTY_ARRAY","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useBorderRadiusSizes","presets","_presets$default","_presets$custom","_presets$theme","defaultSizes","default","customSizes","custom","themeSizes","theme","sizes","name","slug","size","length","undefined","BorderRadiusControl","onChange","values","isLinked","setIsLinked","options","selectedUnits","setSelectedUnits","flat","topLeft","topRight","bottomLeft","bottomRight","availableUnits","units","toggleLinked","className","children","VisualLabel","as","onClick","corner","map"],"sources":["@wordpress/block-editor/src/components/border-radius-control/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBaseControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { useState, useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport LinkedButton from './linked-button';\nimport { useSettings } from '../use-settings';\nimport { hasDefinedValues, hasMixedValues } from './utils';\nimport SingleInputControl from './single-input-control';\nimport {\n\tDEFAULT_VALUES,\n\tRANGE_CONTROL_MAX_SIZE,\n\tEMPTY_ARRAY,\n} from './constants';\n\nfunction useBorderRadiusSizes( presets ) {\n\tconst defaultSizes = presets?.default ?? EMPTY_ARRAY;\n\tconst customSizes = presets?.custom ?? EMPTY_ARRAY;\n\tconst themeSizes = presets?.theme ?? EMPTY_ARRAY;\n\n\treturn useMemo( () => {\n\t\tconst sizes = [\n\t\t\t{ name: __( 'None' ), slug: '0', size: 0 },\n\t\t\t...customSizes,\n\t\t\t...themeSizes,\n\t\t\t...defaultSizes,\n\t\t];\n\n\t\treturn sizes.length > RANGE_CONTROL_MAX_SIZE\n\t\t\t? [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: __( 'Default' ),\n\t\t\t\t\t\tslug: 'default',\n\t\t\t\t\t\tsize: undefined,\n\t\t\t\t\t},\n\t\t\t\t\t...sizes,\n\t\t\t ]\n\t\t\t: sizes;\n\t}, [ customSizes, themeSizes, defaultSizes ] );\n}\n\n/**\n * Control to display border radius options.\n *\n * @param {Object} props Component props.\n * @param {Function} props.onChange Callback to handle onChange.\n * @param {Object} props.values Border radius values.\n * @param {Object} props.presets Border radius presets.\n *\n * @return {Element} Custom border radius control.\n */\nexport default function BorderRadiusControl( { onChange, values, presets } ) {\n\tconst [ isLinked, setIsLinked ] = useState(\n\t\t! hasDefinedValues( values ) || ! hasMixedValues( values )\n\t);\n\tconst options = useBorderRadiusSizes( presets );\n\t// Tracking selected units via internal state allows filtering of CSS unit\n\t// only values from being saved while maintaining preexisting unit selection\n\t// behaviour. Filtering CSS unit only values prevents invalid style values.\n\tconst [ selectedUnits, setSelectedUnits ] = useState( {\n\t\tflat:\n\t\t\ttypeof values === 'string'\n\t\t\t\t? parseQuantityAndUnitFromRawValue( values )[ 1 ]\n\t\t\t\t: undefined,\n\t\ttopLeft: parseQuantityAndUnitFromRawValue( values?.topLeft )[ 1 ],\n\t\ttopRight: parseQuantityAndUnitFromRawValue( values?.topRight )[ 1 ],\n\t\tbottomLeft: parseQuantityAndUnitFromRawValue( values?.bottomLeft )[ 1 ],\n\t\tbottomRight: parseQuantityAndUnitFromRawValue(\n\t\t\tvalues?.bottomRight\n\t\t)[ 1 ],\n\t} );\n\n\tconst [ availableUnits ] = useSettings( 'spacing.units' );\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: availableUnits || [ 'px', 'em', 'rem' ],\n\t} );\n\n\tconst toggleLinked = () => setIsLinked( ! isLinked );\n\n\treturn (\n\t\t<fieldset className=\"components-border-radius-control\">\n\t\t\t<HStack className=\"components-border-radius-control__header\">\n\t\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t\t{ __( 'Radius' ) }\n\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t\t<LinkedButton onClick={ toggleLinked } isLinked={ isLinked } />\n\t\t\t</HStack>\n\t\t\t{ isLinked ? (\n\t\t\t\t<>\n\t\t\t\t\t<SingleInputControl\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tselectedUnits={ selectedUnits }\n\t\t\t\t\t\tsetSelectedUnits={ setSelectedUnits }\n\t\t\t\t\t\tvalues={ values }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\tcorner=\"all\"\n\t\t\t\t\t\tpresets={ options }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<VStack>\n\t\t\t\t\t{ [\n\t\t\t\t\t\t'topLeft',\n\t\t\t\t\t\t'topRight',\n\t\t\t\t\t\t'bottomLeft',\n\t\t\t\t\t\t'bottomRight',\n\t\t\t\t\t].map( ( corner ) => (\n\t\t\t\t\t\t<SingleInputControl\n\t\t\t\t\t\t\tkey={ corner }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tselectedUnits={ selectedUnits }\n\t\t\t\t\t\t\tsetSelectedUnits={ setSelectedUnits }\n\t\t\t\t\t\t\tvalues={ values || DEFAULT_VALUES }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t\tcorner={ corner }\n\t\t\t\t\t\t\tpresets={ options }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t</VStack>\n\t\t\t) }\n\t\t</fieldset>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,WAAW,EACXC,8CAA8C,IAAIC,gCAAgC,EAClFC,4BAA4B,IAAIC,cAAc,EAC9CC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACtD,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,YAAY,MAAM,iBAAiB;AAC1C,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,gBAAgB,EAAEC,cAAc,QAAQ,SAAS;AAC1D,OAAOC,kBAAkB,MAAM,wBAAwB;AACvD,SACCC,cAAc,EACdC,sBAAsB,EACtBC,WAAW,QACL,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAErB,SAASC,oBAAoBA,CAAEC,OAAO,EAAG;EAAA,IAAAC,gBAAA,EAAAC,eAAA,EAAAC,cAAA;EACxC,MAAMC,YAAY,IAAAH,gBAAA,GAAGD,OAAO,EAAEK,OAAO,cAAAJ,gBAAA,cAAAA,gBAAA,GAAIT,WAAW;EACpD,MAAMc,WAAW,IAAAJ,eAAA,GAAGF,OAAO,EAAEO,MAAM,cAAAL,eAAA,c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,MAAM;MAAAsD,QAAA,EACJ,CACD,SAAS,EACT,UAAU,EACV,YAAY,EACZ,aAAa,CACb,CAACK,GAAG,CAAID,MAAM,iBACd3C,IAAA,CAACL,kBAAkB;QAElB4B,QAAQ,EAAGA,QAAU;QACrBK,aAAa,EAAGA,aAAe;QAC/BC,gBAAgB,EAAGA,gBAAkB;QACrCL,MAAM,EAAGA,MAAM,IAAI5B,cAAgB;QACnCwC,KAAK,EAAGA,KAAO;QACfO,MAAM,EAAGA,MAAQ;QACjBrC,OAAO,EAAGqB;MAAS,GAPbgB,MAQN,CACA;IAAC,CACI,CACR;EAAA,CACQ,CAAC;AAEb","ignoreList":[]}
|
|
@@ -12,7 +12,7 @@ export default function LinkedButton({
|
|
|
12
12
|
const label = isLinked ? __('Unlink radii') : __('Link radii');
|
|
13
13
|
return /*#__PURE__*/_jsx(Button, {
|
|
14
14
|
...props,
|
|
15
|
-
className: "
|
|
15
|
+
className: "components-border-radius-control__linked-button",
|
|
16
16
|
size: "small",
|
|
17
17
|
icon: isLinked ? link : linkOff,
|
|
18
18
|
iconSize: 24,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Button","link","linkOff","__","jsx","_jsx","LinkedButton","isLinked","props","label","className","size","icon","iconSize"],"sources":["@wordpress/block-editor/src/components/border-radius-control/linked-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { link, linkOff } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\nexport default function LinkedButton( { isLinked, ...props } ) {\n\tconst label = isLinked ? __( 'Unlink radii' ) : __( 'Link radii' );\n\n\treturn (\n\t\t<Button\n\t\t\t{ ...props }\n\t\t\tclassName=\"
|
|
1
|
+
{"version":3,"names":["Button","link","linkOff","__","jsx","_jsx","LinkedButton","isLinked","props","label","className","size","icon","iconSize"],"sources":["@wordpress/block-editor/src/components/border-radius-control/linked-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { link, linkOff } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\n\nexport default function LinkedButton( { isLinked, ...props } ) {\n\tconst label = isLinked ? __( 'Unlink radii' ) : __( 'Link radii' );\n\n\treturn (\n\t\t<Button\n\t\t\t{ ...props }\n\t\t\tclassName=\"components-border-radius-control__linked-button\"\n\t\t\tsize=\"small\"\n\t\t\ticon={ isLinked ? link : linkOff }\n\t\t\ticonSize={ 24 }\n\t\t\tlabel={ label }\n\t\t/>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,IAAI,EAAEC,OAAO,QAAQ,kBAAkB;AAChD,SAASC,EAAE,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAErC,eAAe,SAASC,YAAYA,CAAE;EAAEC,QAAQ;EAAE,GAAGC;AAAM,CAAC,EAAG;EAC9D,MAAMC,KAAK,GAAGF,QAAQ,GAAGJ,EAAE,CAAE,cAAe,CAAC,GAAGA,EAAE,CAAE,YAAa,CAAC;EAElE,oBACCE,IAAA,CAACL,MAAM;IAAA,GACDQ,KAAK;IACVE,SAAS,EAAC,iDAAiD;IAC3DC,IAAI,EAAC,OAAO;IACZC,IAAI,EAAGL,QAAQ,GAAGN,IAAI,GAAGC,OAAS;IAClCW,QAAQ,EAAG,EAAI;IACfJ,KAAK,EAAGA;EAAO,CACf,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue, __experimentalUnitControl as UnitControl, __experimentalHStack as HStack, Icon, Tooltip, RangeControl, Button, CustomSelectControl } from '@wordpress/components';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
import { useState } from '@wordpress/element';
|
|
7
|
+
import { settings } from '@wordpress/icons';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import { getAllValue, getCustomValueFromPreset, getPresetValueFromControlValue, getPresetValueFromCustomValue, getSliderValueFromPreset, isValuePreset, convertPresetsToCustomValues } from './utils';
|
|
13
|
+
import { CORNERS, ICONS, MIN_BORDER_RADIUS_VALUE, MAX_BORDER_RADIUS_VALUES, RANGE_CONTROL_MAX_SIZE } from './constants';
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
export default function SingleInputControl({
|
|
16
|
+
corner,
|
|
17
|
+
onChange,
|
|
18
|
+
selectedUnits,
|
|
19
|
+
setSelectedUnits,
|
|
20
|
+
values: valuesProp,
|
|
21
|
+
units,
|
|
22
|
+
presets
|
|
23
|
+
}) {
|
|
24
|
+
const changeCornerValue = validatedValue => {
|
|
25
|
+
if (corner === 'all') {
|
|
26
|
+
onChange({
|
|
27
|
+
topLeft: validatedValue,
|
|
28
|
+
topRight: validatedValue,
|
|
29
|
+
bottomLeft: validatedValue,
|
|
30
|
+
bottomRight: validatedValue
|
|
31
|
+
});
|
|
32
|
+
} else {
|
|
33
|
+
onChange({
|
|
34
|
+
...values,
|
|
35
|
+
[corner]: validatedValue
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const onChangeValue = next => {
|
|
40
|
+
if (!onChange) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Filter out CSS-unit-only values to prevent invalid styles.
|
|
45
|
+
const isNumeric = !isNaN(parseFloat(next));
|
|
46
|
+
const nextValue = isNumeric ? next : undefined;
|
|
47
|
+
changeCornerValue(nextValue);
|
|
48
|
+
};
|
|
49
|
+
const onChangeUnit = next => {
|
|
50
|
+
const newUnits = {
|
|
51
|
+
...selectedUnits
|
|
52
|
+
};
|
|
53
|
+
if (corner === 'all') {
|
|
54
|
+
newUnits.topLeft = next;
|
|
55
|
+
newUnits.topRight = next;
|
|
56
|
+
newUnits.bottomLeft = next;
|
|
57
|
+
newUnits.bottomRight = next;
|
|
58
|
+
} else {
|
|
59
|
+
newUnits[corner] = next;
|
|
60
|
+
}
|
|
61
|
+
setSelectedUnits(newUnits);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// For shorthand style & backwards compatibility, handle flat string value.
|
|
65
|
+
const values = typeof valuesProp !== 'string' ? valuesProp : {
|
|
66
|
+
topLeft: valuesProp,
|
|
67
|
+
topRight: valuesProp,
|
|
68
|
+
bottomLeft: valuesProp,
|
|
69
|
+
bottomRight: valuesProp
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// For 'all' corner, convert presets to custom values before calling getAllValue
|
|
73
|
+
// For individual corners, check if the value should be converted to a preset
|
|
74
|
+
let value;
|
|
75
|
+
if (corner === 'all') {
|
|
76
|
+
const convertedValues = convertPresetsToCustomValues(values, presets);
|
|
77
|
+
const customValue = getAllValue(convertedValues);
|
|
78
|
+
value = getPresetValueFromCustomValue(customValue, presets);
|
|
79
|
+
} else {
|
|
80
|
+
value = getPresetValueFromCustomValue(values[corner], presets);
|
|
81
|
+
}
|
|
82
|
+
const resolvedPresetValue = isValuePreset(value) ? getCustomValueFromPreset(value, presets) : value;
|
|
83
|
+
const [parsedQuantity, parsedUnit] = parseQuantityAndUnitFromRawValue(resolvedPresetValue);
|
|
84
|
+
const computedUnit = value ? parsedUnit : selectedUnits[corner] || selectedUnits.flat || 'px';
|
|
85
|
+
const unitConfig = units && units.find(item => item.value === computedUnit);
|
|
86
|
+
const step = unitConfig?.step || 1;
|
|
87
|
+
const [showCustomValueControl, setShowCustomValueControl] = useState(value !== undefined && !isValuePreset(value));
|
|
88
|
+
const showRangeControl = presets.length <= RANGE_CONTROL_MAX_SIZE;
|
|
89
|
+
const presetIndex = getSliderValueFromPreset(value, presets);
|
|
90
|
+
const rangeTooltip = newValue => value === undefined ? undefined : presets[newValue]?.name;
|
|
91
|
+
const marks = presets.slice(1, presets.length - 1).map((_newValue, index) => ({
|
|
92
|
+
value: index + 1,
|
|
93
|
+
label: undefined
|
|
94
|
+
}));
|
|
95
|
+
const hasPresets = marks.length > 0;
|
|
96
|
+
let options = [];
|
|
97
|
+
if (!showRangeControl) {
|
|
98
|
+
options = [...presets, {
|
|
99
|
+
name: __('Custom'),
|
|
100
|
+
slug: 'custom',
|
|
101
|
+
size: resolvedPresetValue
|
|
102
|
+
}].map((size, index) => ({
|
|
103
|
+
key: index,
|
|
104
|
+
name: size.name
|
|
105
|
+
}));
|
|
106
|
+
}
|
|
107
|
+
const icon = ICONS[corner];
|
|
108
|
+
const handleSliderChange = next => {
|
|
109
|
+
const val = next !== undefined ? `${next}${computedUnit}` : undefined;
|
|
110
|
+
changeCornerValue(val);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
// Controls are wrapped in tooltips as visible labels aren't desired here.
|
|
114
|
+
// Tooltip rendering also requires the UnitControl to be wrapped. See:
|
|
115
|
+
// https://github.com/WordPress/gutenberg/pull/24966#issuecomment-685875026
|
|
116
|
+
return /*#__PURE__*/_jsxs(HStack, {
|
|
117
|
+
children: [icon && /*#__PURE__*/_jsx(Icon, {
|
|
118
|
+
className: "components-border-radius-control__icon",
|
|
119
|
+
icon: icon,
|
|
120
|
+
size: 24
|
|
121
|
+
}), (!hasPresets || showCustomValueControl) && /*#__PURE__*/_jsxs("div", {
|
|
122
|
+
className: "components-border-radius-control__input-controls-wrapper",
|
|
123
|
+
children: [/*#__PURE__*/_jsx(Tooltip, {
|
|
124
|
+
text: CORNERS[corner],
|
|
125
|
+
placement: "top",
|
|
126
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
127
|
+
className: "components-border-radius-control__tooltip-wrapper",
|
|
128
|
+
children: /*#__PURE__*/_jsx(UnitControl, {
|
|
129
|
+
className: "components-border-radius-control__unit-control",
|
|
130
|
+
"aria-label": CORNERS[corner],
|
|
131
|
+
value: [parsedQuantity, computedUnit].join(''),
|
|
132
|
+
onChange: onChangeValue,
|
|
133
|
+
onUnitChange: onChangeUnit,
|
|
134
|
+
size: "__unstable-large",
|
|
135
|
+
min: MIN_BORDER_RADIUS_VALUE,
|
|
136
|
+
units: units
|
|
137
|
+
})
|
|
138
|
+
})
|
|
139
|
+
}), /*#__PURE__*/_jsx(RangeControl, {
|
|
140
|
+
__next40pxDefaultSize: true,
|
|
141
|
+
label: __('Border radius'),
|
|
142
|
+
hideLabelFromVision: true,
|
|
143
|
+
className: "components-border-radius-control__range-control",
|
|
144
|
+
value: parsedQuantity !== null && parsedQuantity !== void 0 ? parsedQuantity : '',
|
|
145
|
+
min: MIN_BORDER_RADIUS_VALUE,
|
|
146
|
+
max: MAX_BORDER_RADIUS_VALUES[computedUnit],
|
|
147
|
+
initialPosition: 0,
|
|
148
|
+
withInputField: false,
|
|
149
|
+
onChange: handleSliderChange,
|
|
150
|
+
step: step,
|
|
151
|
+
__nextHasNoMarginBottom: true
|
|
152
|
+
})]
|
|
153
|
+
}), hasPresets && showRangeControl && !showCustomValueControl && /*#__PURE__*/_jsx(RangeControl, {
|
|
154
|
+
__next40pxDefaultSize: true,
|
|
155
|
+
className: "components-border-radius-control__range-control",
|
|
156
|
+
value: presetIndex,
|
|
157
|
+
onChange: newSize => {
|
|
158
|
+
changeCornerValue(getPresetValueFromControlValue(newSize, 'range', presets));
|
|
159
|
+
},
|
|
160
|
+
withInputField: false,
|
|
161
|
+
"aria-valuenow": presetIndex,
|
|
162
|
+
"aria-valuetext": presets[presetIndex]?.name,
|
|
163
|
+
renderTooltipContent: rangeTooltip,
|
|
164
|
+
min: 0,
|
|
165
|
+
max: presets.length - 1,
|
|
166
|
+
marks: marks,
|
|
167
|
+
label: CORNERS[corner],
|
|
168
|
+
hideLabelFromVision: true,
|
|
169
|
+
__nextHasNoMarginBottom: true
|
|
170
|
+
}), !showRangeControl && !showCustomValueControl && /*#__PURE__*/_jsx(CustomSelectControl, {
|
|
171
|
+
className: "components-border-radius-control__custom-select-control",
|
|
172
|
+
value: options.find(option => option.key === presetIndex) || options[options.length - 1],
|
|
173
|
+
onChange: selection => {
|
|
174
|
+
if (selection.selectedItem.key === options.length - 1) {
|
|
175
|
+
setShowCustomValueControl(true);
|
|
176
|
+
} else {
|
|
177
|
+
changeCornerValue(getPresetValueFromControlValue(selection.selectedItem.key, 'selectList', presets));
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
options: options,
|
|
181
|
+
label: CORNERS[corner],
|
|
182
|
+
hideLabelFromVision: true,
|
|
183
|
+
size: "__unstable-large"
|
|
184
|
+
}), hasPresets && /*#__PURE__*/_jsx(Button, {
|
|
185
|
+
label: showCustomValueControl ? __('Use border radius preset') : __('Set custom border radius'),
|
|
186
|
+
icon: settings,
|
|
187
|
+
onClick: () => {
|
|
188
|
+
setShowCustomValueControl(!showCustomValueControl);
|
|
189
|
+
},
|
|
190
|
+
isPressed: showCustomValueControl,
|
|
191
|
+
size: "small",
|
|
192
|
+
className: "components-border-radius-control__custom-toggle",
|
|
193
|
+
iconSize: 24
|
|
194
|
+
})]
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=single-input-control.js.map
|