@wordpress/block-library 8.28.7 → 8.28.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/heading/index.js +4 -3
- package/build/heading/index.js.map +1 -1
- package/build/navigation/edit/index.js +11 -15
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/view.js +12 -2
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-link/edit.js +1 -0
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +1 -0
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build-module/heading/index.js +4 -3
- package/build-module/heading/index.js.map +1 -1
- package/build-module/navigation/edit/index.js +11 -15
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/view.js +12 -2
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-link/edit.js +1 -0
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +1 -0
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/package.json +8 -8
- package/src/heading/index.js +4 -3
- package/src/navigation/edit/index.js +48 -50
- package/src/navigation/index.php +18 -2
- package/src/navigation/view.js +11 -2
- package/src/navigation-link/edit.js +1 -0
- package/src/navigation-submenu/edit.js +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","useSelect","useDispatch","PanelBody","TextControl","TextareaControl","ToolbarButton","ToolbarGroup","displayShortcut","isKeyboardEvent","__","BlockControls","InnerBlocks","useInnerBlocksProps","InspectorControls","RichText","useBlockProps","store","blockEditorStore","getColorClassName","isURL","prependHTTP","useState","useEffect","useRef","placeCaretAtHorizontalEdge","link","linkIcon","removeSubmenu","useResourcePermissions","speak","createBlock","useMergeRefs","usePrevious","ItemSubmenuIcon","LinkUI","updateAttributes","getColors","getNavigationChildBlockProps","ALLOWED_BLOCKS","DEFAULT_BLOCK","name","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener","NavigationSubmenuEdit","attributes","isSelected","setAttributes","mergeBlocks","onReplace","context","clientId","label","type","url","description","rel","title","showSubmenuIcon","maxNestingLevel","openSubmenusOnClick","__unstableMarkNextChangeAsNotPersistent","replaceBlock","isLinkOpen","setIsLinkOpen","popoverAnchor","setPopoverAnchor","listItemRef","itemLabelPlaceholder","ref","pagesPermissions","postsPermissions","parentCount","isParentOfSelectedBlock","isImmediateParentOfSelectedBlock","hasChildren","selectedBlockHasChildren","onlyDescendantIsEmptyLink","select","hasSelectedInnerBlock","getSelectedBlockClientId","getBlockParentsByBlockName","getBlock","getBlockCount","getBlockOrder","_onlyDescendantIsEmptyLink","selectedBlockId","selectedBlockChildren","length","singleBlock","prevHasChildren","test","selectLabelText","focus","defaultView","selection","getSelection","range","createRange","selectNodeContents","removeAllRanges","addRange","userCanCreate","canCreate","textColor","customTextColor","backgroundColor","customBackgroundColor","onKeyDown","primary","blockProps","className","style","color","innerBlocksColors","allowedBlocks","filter","blockName","navigationChildBlockProps","innerBlocksProps","defaultBlock","directInsert","__experimentalCaptureToolbars","renderAppender","ButtonBlockAppender","ParentElement","transformToLink","newLinkBlock","canConvertToLink","createElement","Fragment","icon","shortcut","onClick","isDisabled","__nextHasNoMarginBottom","value","onChange","labelValue","autoComplete","urlValue","descriptionValue","help","titleValue","relValue","identifier","onMerge","placeholder","withoutInteractiveFormatting","allowedFormats","onClose","anchor","hasCreateSuggestion","onRemove","updatedValue"],"sources":["@wordpress/block-library/src/navigation-submenu/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPanelBody,\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tInnerBlocks,\n\tuseInnerBlocksProps,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tgetColorClassName,\n} from '@wordpress/block-editor';\nimport { isURL, prependHTTP } from '@wordpress/url';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { placeCaretAtHorizontalEdge } from '@wordpress/dom';\nimport { link as linkIcon, removeSubmenu } from '@wordpress/icons';\nimport { useResourcePermissions } from '@wordpress/core-data';\nimport { speak } from '@wordpress/a11y';\nimport { createBlock } from '@wordpress/blocks';\nimport { useMergeRefs, usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { ItemSubmenuIcon } from './icons';\nimport { LinkUI } from '../navigation-link/link-ui';\nimport { updateAttributes } from '../navigation-link/update-attributes';\nimport {\n\tgetColors,\n\tgetNavigationChildBlockProps,\n} from '../navigation/edit/utils';\n\nconst ALLOWED_BLOCKS = [\n\t'core/navigation-link',\n\t'core/navigation-submenu',\n\t'core/page-list',\n];\n\nconst DEFAULT_BLOCK = {\n\tname: 'core/navigation-link',\n};\n\n/**\n * A React hook to determine if it's dragging within the target element.\n *\n * @typedef {import('@wordpress/element').RefObject} RefObject\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the target element.\n */\nconst useIsDraggingWithin = ( elementRef ) => {\n\tconst [ isDraggingWithin, setIsDraggingWithin ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart( event ) {\n\t\t\t// Check the first time when the dragging starts.\n\t\t\thandleDragEnter( event );\n\t\t}\n\n\t\t// Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDraggingWithin( false );\n\t\t}\n\n\t\tfunction handleDragEnter( event ) {\n\t\t\t// Check if the current target is inside the item element.\n\t\t\tif ( elementRef.current.contains( event.target ) ) {\n\t\t\t\tsetIsDraggingWithin( true );\n\t\t\t} else {\n\t\t\t\tsetIsDraggingWithin( false );\n\t\t\t}\n\t\t}\n\n\t\t// Bind these events to the document to catch all drag events.\n\t\t// Ideally, we can also use `event.relatedTarget`, but sadly that\n\t\t// doesn't work in Safari.\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\t\townerDocument.addEventListener( 'dragenter', handleDragEnter );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener( 'dragstart', handleDragStart );\n\t\t\townerDocument.removeEventListener( 'dragend', handleDragEnd );\n\t\t\townerDocument.removeEventListener( 'dragenter', handleDragEnter );\n\t\t};\n\t}, [] );\n\n\treturn isDraggingWithin;\n};\n\n/**\n * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind\n */\n\n/**\n * Navigation Link Block Attributes\n *\n * @typedef {Object} WPNavigationLinkBlockAttributes\n *\n * @property {string} [label] Link text.\n * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status.\n * @property {string} [type] The type such as post, page, tag, category and other custom types.\n * @property {string} [rel] The relationship of the linked URL.\n * @property {number} [id] A post or term id.\n * @property {boolean} [opensInNewTab] Sets link target to _blank when true.\n * @property {string} [url] Link href.\n * @property {string} [title] Link title attribute.\n */\n\nexport default function NavigationSubmenuEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tmergeBlocks,\n\tonReplace,\n\tcontext,\n\tclientId,\n} ) {\n\tconst { label, type, url, description, rel, title } = attributes;\n\n\tconst { showSubmenuIcon, maxNestingLevel, openSubmenusOnClick } = context;\n\n\tconst { __unstableMarkNextChangeAsNotPersistent, replaceBlock } =\n\t\tuseDispatch( blockEditorStore );\n\tconst [ isLinkOpen, setIsLinkOpen ] = useState( false );\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst listItemRef = useRef( null );\n\tconst isDraggingWithin = useIsDraggingWithin( listItemRef );\n\tconst itemLabelPlaceholder = __( 'Add text…' );\n\tconst ref = useRef();\n\n\tconst pagesPermissions = useResourcePermissions( 'pages' );\n\tconst postsPermissions = useResourcePermissions( 'posts' );\n\n\tconst {\n\t\tparentCount,\n\t\tisParentOfSelectedBlock,\n\t\tisImmediateParentOfSelectedBlock,\n\t\thasChildren,\n\t\tselectedBlockHasChildren,\n\t\tonlyDescendantIsEmptyLink,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\tgetBlock,\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockOrder,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tlet _onlyDescendantIsEmptyLink;\n\n\t\t\tconst selectedBlockId = getSelectedBlockClientId();\n\n\t\t\tconst selectedBlockChildren = getBlockOrder( selectedBlockId );\n\n\t\t\t// Check for a single descendant in the submenu. If that block\n\t\t\t// is a link block in a \"placeholder\" state with no label then\n\t\t\t// we can consider as an \"empty\" link.\n\t\t\tif ( selectedBlockChildren?.length === 1 ) {\n\t\t\t\tconst singleBlock = getBlock( selectedBlockChildren[ 0 ] );\n\n\t\t\t\t_onlyDescendantIsEmptyLink =\n\t\t\t\t\tsingleBlock?.name === 'core/navigation-link' &&\n\t\t\t\t\t! singleBlock?.attributes?.label;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tparentCount: getBlockParentsByBlockName(\n\t\t\t\t\tclientId,\n\t\t\t\t\t'core/navigation-submenu'\n\t\t\t\t).length,\n\t\t\t\tisParentOfSelectedBlock: hasSelectedInnerBlock(\n\t\t\t\t\tclientId,\n\t\t\t\t\ttrue\n\t\t\t\t),\n\t\t\t\tisImmediateParentOfSelectedBlock: hasSelectedInnerBlock(\n\t\t\t\t\tclientId,\n\t\t\t\t\tfalse\n\t\t\t\t),\n\t\t\t\thasChildren: !! getBlockCount( clientId ),\n\t\t\t\tselectedBlockHasChildren: !! selectedBlockChildren?.length,\n\t\t\t\tonlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst prevHasChildren = usePrevious( hasChildren );\n\n\t// Show the LinkControl on mount if the URL is empty\n\t// ( When adding a new menu item)\n\t// This can't be done in the useState call because it conflicts\n\t// with the autofocus behavior of the BlockListBlock component.\n\tuseEffect( () => {\n\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}, [] );\n\n\t/**\n\t * The hook shouldn't be necessary but due to a focus loss happening\n\t * when selecting a suggestion in the link popover, we force close on block unselection.\n\t */\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsLinkOpen( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\t// If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.\n\tuseEffect( () => {\n\t\tif ( isLinkOpen && url ) {\n\t\t\t// Does this look like a URL and have something TLD-ish?\n\t\t\tif (\n\t\t\t\tisURL( prependHTTP( label ) ) &&\n\t\t\t\t/^.+\\.[a-z]+/.test( label )\n\t\t\t) {\n\t\t\t\t// Focus and select the label text.\n\t\t\t\tselectLabelText();\n\t\t\t} else {\n\t\t\t\t// Focus it (but do not select).\n\t\t\t\tplaceCaretAtHorizontalEdge( ref.current, true );\n\t\t\t}\n\t\t}\n\t}, [ url ] );\n\n\t/**\n\t * Focus the Link label text and select it.\n\t */\n\tfunction selectLabelText() {\n\t\tref.current.focus();\n\t\tconst { ownerDocument } = ref.current;\n\t\tconst { defaultView } = ownerDocument;\n\t\tconst selection = defaultView.getSelection();\n\t\tconst range = ownerDocument.createRange();\n\t\t// Get the range of the current ref contents so we can add this range to the selection.\n\t\trange.selectNodeContents( ref.current );\n\t\tselection.removeAllRanges();\n\t\tselection.addRange( range );\n\t}\n\n\tlet userCanCreate = false;\n\tif ( ! type || type === 'page' ) {\n\t\tuserCanCreate = pagesPermissions.canCreate;\n\t} else if ( type === 'post' ) {\n\t\tuserCanCreate = postsPermissions.canCreate;\n\t}\n\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t} = getColors( context, parentCount > 0 );\n\n\tfunction onKeyDown( event ) {\n\t\tif ( isKeyboardEvent.primary( event, 'k' ) ) {\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tref: useMergeRefs( [ setPopoverAnchor, listItemRef ] ),\n\t\tclassName: classnames( 'wp-block-navigation-item', {\n\t\t\t'is-editing': isSelected || isParentOfSelectedBlock,\n\t\t\t'is-dragging-within': isDraggingWithin,\n\t\t\t'has-link': !! url,\n\t\t\t'has-child': hasChildren,\n\t\t\t'has-text-color': !! textColor || !! customTextColor,\n\t\t\t[ getColorClassName( 'color', textColor ) ]: !! textColor,\n\t\t\t'has-background': !! backgroundColor || customBackgroundColor,\n\t\t\t[ getColorClassName( 'background-color', backgroundColor ) ]:\n\t\t\t\t!! backgroundColor,\n\t\t\t'open-on-click': openSubmenusOnClick,\n\t\t} ),\n\t\tstyle: {\n\t\t\tcolor: ! textColor && customTextColor,\n\t\t\tbackgroundColor: ! backgroundColor && customBackgroundColor,\n\t\t},\n\t\tonKeyDown,\n\t} );\n\n\t// Always use overlay colors for submenus.\n\tconst innerBlocksColors = getColors( context, true );\n\n\tconst allowedBlocks =\n\t\tparentCount >= maxNestingLevel\n\t\t\t? ALLOWED_BLOCKS.filter(\n\t\t\t\t\t( blockName ) => blockName !== 'core/navigation-submenu'\n\t\t\t )\n\t\t\t: ALLOWED_BLOCKS;\n\n\tconst navigationChildBlockProps =\n\t\tgetNavigationChildBlockProps( innerBlocksColors );\n\tconst innerBlocksProps = useInnerBlocksProps( navigationChildBlockProps, {\n\t\tallowedBlocks,\n\t\tdefaultBlock: DEFAULT_BLOCK,\n\t\tdirectInsert: true,\n\n\t\t// Ensure block toolbar is not too far removed from item\n\t\t// being edited.\n\t\t// see: https://github.com/WordPress/gutenberg/pull/34615.\n\t\t__experimentalCaptureToolbars: true,\n\n\t\trenderAppender:\n\t\t\tisSelected ||\n\t\t\t( isImmediateParentOfSelectedBlock &&\n\t\t\t\t! selectedBlockHasChildren ) ||\n\t\t\t// Show the appender while dragging to allow inserting element between item and the appender.\n\t\t\thasChildren\n\t\t\t\t? InnerBlocks.ButtonBlockAppender\n\t\t\t\t: false,\n\t} );\n\n\tconst ParentElement = openSubmenusOnClick ? 'button' : 'a';\n\n\tfunction transformToLink() {\n\t\tconst newLinkBlock = createBlock( 'core/navigation-link', attributes );\n\t\treplaceBlock( clientId, newLinkBlock );\n\t}\n\n\tuseEffect( () => {\n\t\t// If block becomes empty, transform to Navigation Link.\n\t\tif ( ! hasChildren && prevHasChildren ) {\n\t\t\t// This side-effect should not create an undo level as those should\n\t\t\t// only be created via user interactions.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\ttransformToLink();\n\t\t}\n\t}, [ hasChildren, prevHasChildren ] );\n\n\tconst canConvertToLink =\n\t\t! selectedBlockHasChildren || onlyDescendantIsEmptyLink;\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t{ ! openSubmenusOnClick && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\t\ticon={ linkIcon }\n\t\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\tonClick={ () => setIsLinkOpen( true ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"revert\"\n\t\t\t\t\t\ticon={ removeSubmenu }\n\t\t\t\t\t\ttitle={ __( 'Convert to Link' ) }\n\t\t\t\t\t\tonClick={ transformToLink }\n\t\t\t\t\t\tclassName=\"wp-block-navigation__submenu__revert\"\n\t\t\t\t\t\tisDisabled={ ! canConvertToLink }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t</BlockControls>\n\t\t\t{ /* Warning, this duplicated in packages/block-library/src/navigation-link/edit.js */ }\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ label || '' }\n\t\t\t\t\t\tonChange={ ( labelValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { label: labelValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Label' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ url || '' }\n\t\t\t\t\t\tonChange={ ( urlValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { url: urlValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'URL' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ description || '' }\n\t\t\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tdescription: descriptionValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'The description will be displayed in the menu if the current theme supports it.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\t\tonChange={ ( titleValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { title: titleValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Additional information to help clarify the purpose of the link.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'The relationship of the linked URL as space-separated link types.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ /* eslint-disable jsx-a11y/anchor-is-valid */ }\n\t\t\t\t<ParentElement className=\"wp-block-navigation-item__content\">\n\t\t\t\t\t{ /* eslint-enable */ }\n\t\t\t\t\t{\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\n\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\tonChange={ ( labelValue ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { label: labelValue } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\t\taria-label={ __( 'Navigation link text' ) }\n\t\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\t\tallowedFormats={ [\n\t\t\t\t\t\t\t\t'core/bold',\n\t\t\t\t\t\t\t\t'core/italic',\n\t\t\t\t\t\t\t\t'core/image',\n\t\t\t\t\t\t\t\t'core/strikethrough',\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t\t{ ! openSubmenusOnClick && isLinkOpen && (\n\t\t\t\t\t\t<LinkUI\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tlink={ attributes }\n\t\t\t\t\t\t\tonClose={ () => setIsLinkOpen( false ) }\n\t\t\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\t\t\thasCreateSuggestion={ userCanCreate }\n\t\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( { url: '' } );\n\t\t\t\t\t\t\t\tspeak( __( 'Link removed.' ), 'assertive' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonChange={ ( updatedValue ) => {\n\t\t\t\t\t\t\t\tupdateAttributes(\n\t\t\t\t\t\t\t\t\tupdatedValue,\n\t\t\t\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\t\t\t\tattributes\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ParentElement>\n\t\t\t\t{ ( showSubmenuIcon || openSubmenusOnClick ) && (\n\t\t\t\t\t<span className=\"wp-block-navigation__submenu-icon\">\n\t\t\t\t\t\t<ItemSubmenuIcon />\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\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aAAa,CAAE;QAAEO,GAAG,EAAE;MAAG,CAAE,CAAC;MAC5BpC,KAAK,CAAEpB,EAAE,CAAE,eAAgB,CAAC,EAAE,WAAY,CAAC;IAC5C,CAAG;IACH2I,QAAQ,EAAKiB,YAAY,IAAM;MAC9BlI,gBAAgB,CACfkI,YAAY,EACZ3G,aAAa,EACbF,UACD,CAAC;IACF;EAAG,CACH,CAEY,CAAC,EACd,CAAEa,eAAe,IAAIE,mBAAmB,KACzCqE,aAAA;IAAMlB,SAAS,EAAC;EAAmC,GAClDkB,aAAA,CAAC3G,eAAe,MAAE,CACb,CACN,EACD2G,aAAA;IAAA,GAAUV;EAAgB,CAAI,CAC1B,CACJ,CAAC;AAEL"}
|
|
1
|
+
{"version":3,"names":["classnames","useSelect","useDispatch","PanelBody","TextControl","TextareaControl","ToolbarButton","ToolbarGroup","displayShortcut","isKeyboardEvent","__","BlockControls","InnerBlocks","useInnerBlocksProps","InspectorControls","RichText","useBlockProps","store","blockEditorStore","getColorClassName","isURL","prependHTTP","useState","useEffect","useRef","placeCaretAtHorizontalEdge","link","linkIcon","removeSubmenu","useResourcePermissions","speak","createBlock","useMergeRefs","usePrevious","ItemSubmenuIcon","LinkUI","updateAttributes","getColors","getNavigationChildBlockProps","ALLOWED_BLOCKS","DEFAULT_BLOCK","name","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener","NavigationSubmenuEdit","attributes","isSelected","setAttributes","mergeBlocks","onReplace","context","clientId","label","type","url","description","rel","title","showSubmenuIcon","maxNestingLevel","openSubmenusOnClick","__unstableMarkNextChangeAsNotPersistent","replaceBlock","isLinkOpen","setIsLinkOpen","popoverAnchor","setPopoverAnchor","listItemRef","itemLabelPlaceholder","ref","pagesPermissions","postsPermissions","parentCount","isParentOfSelectedBlock","isImmediateParentOfSelectedBlock","hasChildren","selectedBlockHasChildren","onlyDescendantIsEmptyLink","select","hasSelectedInnerBlock","getSelectedBlockClientId","getBlockParentsByBlockName","getBlock","getBlockCount","getBlockOrder","_onlyDescendantIsEmptyLink","selectedBlockId","selectedBlockChildren","length","singleBlock","prevHasChildren","test","selectLabelText","focus","defaultView","selection","getSelection","range","createRange","selectNodeContents","removeAllRanges","addRange","userCanCreate","canCreate","textColor","customTextColor","backgroundColor","customBackgroundColor","onKeyDown","primary","preventDefault","blockProps","className","style","color","innerBlocksColors","allowedBlocks","filter","blockName","navigationChildBlockProps","innerBlocksProps","defaultBlock","directInsert","__experimentalCaptureToolbars","renderAppender","ButtonBlockAppender","ParentElement","transformToLink","newLinkBlock","canConvertToLink","createElement","Fragment","icon","shortcut","onClick","isDisabled","__nextHasNoMarginBottom","value","onChange","labelValue","autoComplete","urlValue","descriptionValue","help","titleValue","relValue","identifier","onMerge","placeholder","withoutInteractiveFormatting","allowedFormats","onClose","anchor","hasCreateSuggestion","onRemove","updatedValue"],"sources":["@wordpress/block-library/src/navigation-submenu/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPanelBody,\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tInnerBlocks,\n\tuseInnerBlocksProps,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tgetColorClassName,\n} from '@wordpress/block-editor';\nimport { isURL, prependHTTP } from '@wordpress/url';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { placeCaretAtHorizontalEdge } from '@wordpress/dom';\nimport { link as linkIcon, removeSubmenu } from '@wordpress/icons';\nimport { useResourcePermissions } from '@wordpress/core-data';\nimport { speak } from '@wordpress/a11y';\nimport { createBlock } from '@wordpress/blocks';\nimport { useMergeRefs, usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { ItemSubmenuIcon } from './icons';\nimport { LinkUI } from '../navigation-link/link-ui';\nimport { updateAttributes } from '../navigation-link/update-attributes';\nimport {\n\tgetColors,\n\tgetNavigationChildBlockProps,\n} from '../navigation/edit/utils';\n\nconst ALLOWED_BLOCKS = [\n\t'core/navigation-link',\n\t'core/navigation-submenu',\n\t'core/page-list',\n];\n\nconst DEFAULT_BLOCK = {\n\tname: 'core/navigation-link',\n};\n\n/**\n * A React hook to determine if it's dragging within the target element.\n *\n * @typedef {import('@wordpress/element').RefObject} RefObject\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the target element.\n */\nconst useIsDraggingWithin = ( elementRef ) => {\n\tconst [ isDraggingWithin, setIsDraggingWithin ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart( event ) {\n\t\t\t// Check the first time when the dragging starts.\n\t\t\thandleDragEnter( event );\n\t\t}\n\n\t\t// Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDraggingWithin( false );\n\t\t}\n\n\t\tfunction handleDragEnter( event ) {\n\t\t\t// Check if the current target is inside the item element.\n\t\t\tif ( elementRef.current.contains( event.target ) ) {\n\t\t\t\tsetIsDraggingWithin( true );\n\t\t\t} else {\n\t\t\t\tsetIsDraggingWithin( false );\n\t\t\t}\n\t\t}\n\n\t\t// Bind these events to the document to catch all drag events.\n\t\t// Ideally, we can also use `event.relatedTarget`, but sadly that\n\t\t// doesn't work in Safari.\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\t\townerDocument.addEventListener( 'dragenter', handleDragEnter );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener( 'dragstart', handleDragStart );\n\t\t\townerDocument.removeEventListener( 'dragend', handleDragEnd );\n\t\t\townerDocument.removeEventListener( 'dragenter', handleDragEnter );\n\t\t};\n\t}, [] );\n\n\treturn isDraggingWithin;\n};\n\n/**\n * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind\n */\n\n/**\n * Navigation Link Block Attributes\n *\n * @typedef {Object} WPNavigationLinkBlockAttributes\n *\n * @property {string} [label] Link text.\n * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status.\n * @property {string} [type] The type such as post, page, tag, category and other custom types.\n * @property {string} [rel] The relationship of the linked URL.\n * @property {number} [id] A post or term id.\n * @property {boolean} [opensInNewTab] Sets link target to _blank when true.\n * @property {string} [url] Link href.\n * @property {string} [title] Link title attribute.\n */\n\nexport default function NavigationSubmenuEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tmergeBlocks,\n\tonReplace,\n\tcontext,\n\tclientId,\n} ) {\n\tconst { label, type, url, description, rel, title } = attributes;\n\n\tconst { showSubmenuIcon, maxNestingLevel, openSubmenusOnClick } = context;\n\n\tconst { __unstableMarkNextChangeAsNotPersistent, replaceBlock } =\n\t\tuseDispatch( blockEditorStore );\n\tconst [ isLinkOpen, setIsLinkOpen ] = useState( false );\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst listItemRef = useRef( null );\n\tconst isDraggingWithin = useIsDraggingWithin( listItemRef );\n\tconst itemLabelPlaceholder = __( 'Add text…' );\n\tconst ref = useRef();\n\n\tconst pagesPermissions = useResourcePermissions( 'pages' );\n\tconst postsPermissions = useResourcePermissions( 'posts' );\n\n\tconst {\n\t\tparentCount,\n\t\tisParentOfSelectedBlock,\n\t\tisImmediateParentOfSelectedBlock,\n\t\thasChildren,\n\t\tselectedBlockHasChildren,\n\t\tonlyDescendantIsEmptyLink,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\tgetBlock,\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockOrder,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tlet _onlyDescendantIsEmptyLink;\n\n\t\t\tconst selectedBlockId = getSelectedBlockClientId();\n\n\t\t\tconst selectedBlockChildren = getBlockOrder( selectedBlockId );\n\n\t\t\t// Check for a single descendant in the submenu. If that block\n\t\t\t// is a link block in a \"placeholder\" state with no label then\n\t\t\t// we can consider as an \"empty\" link.\n\t\t\tif ( selectedBlockChildren?.length === 1 ) {\n\t\t\t\tconst singleBlock = getBlock( selectedBlockChildren[ 0 ] );\n\n\t\t\t\t_onlyDescendantIsEmptyLink =\n\t\t\t\t\tsingleBlock?.name === 'core/navigation-link' &&\n\t\t\t\t\t! singleBlock?.attributes?.label;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tparentCount: getBlockParentsByBlockName(\n\t\t\t\t\tclientId,\n\t\t\t\t\t'core/navigation-submenu'\n\t\t\t\t).length,\n\t\t\t\tisParentOfSelectedBlock: hasSelectedInnerBlock(\n\t\t\t\t\tclientId,\n\t\t\t\t\ttrue\n\t\t\t\t),\n\t\t\t\tisImmediateParentOfSelectedBlock: hasSelectedInnerBlock(\n\t\t\t\t\tclientId,\n\t\t\t\t\tfalse\n\t\t\t\t),\n\t\t\t\thasChildren: !! getBlockCount( clientId ),\n\t\t\t\tselectedBlockHasChildren: !! selectedBlockChildren?.length,\n\t\t\t\tonlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst prevHasChildren = usePrevious( hasChildren );\n\n\t// Show the LinkControl on mount if the URL is empty\n\t// ( When adding a new menu item)\n\t// This can't be done in the useState call because it conflicts\n\t// with the autofocus behavior of the BlockListBlock component.\n\tuseEffect( () => {\n\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}, [] );\n\n\t/**\n\t * The hook shouldn't be necessary but due to a focus loss happening\n\t * when selecting a suggestion in the link popover, we force close on block unselection.\n\t */\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsLinkOpen( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\t// If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.\n\tuseEffect( () => {\n\t\tif ( isLinkOpen && url ) {\n\t\t\t// Does this look like a URL and have something TLD-ish?\n\t\t\tif (\n\t\t\t\tisURL( prependHTTP( label ) ) &&\n\t\t\t\t/^.+\\.[a-z]+/.test( label )\n\t\t\t) {\n\t\t\t\t// Focus and select the label text.\n\t\t\t\tselectLabelText();\n\t\t\t} else {\n\t\t\t\t// Focus it (but do not select).\n\t\t\t\tplaceCaretAtHorizontalEdge( ref.current, true );\n\t\t\t}\n\t\t}\n\t}, [ url ] );\n\n\t/**\n\t * Focus the Link label text and select it.\n\t */\n\tfunction selectLabelText() {\n\t\tref.current.focus();\n\t\tconst { ownerDocument } = ref.current;\n\t\tconst { defaultView } = ownerDocument;\n\t\tconst selection = defaultView.getSelection();\n\t\tconst range = ownerDocument.createRange();\n\t\t// Get the range of the current ref contents so we can add this range to the selection.\n\t\trange.selectNodeContents( ref.current );\n\t\tselection.removeAllRanges();\n\t\tselection.addRange( range );\n\t}\n\n\tlet userCanCreate = false;\n\tif ( ! type || type === 'page' ) {\n\t\tuserCanCreate = pagesPermissions.canCreate;\n\t} else if ( type === 'post' ) {\n\t\tuserCanCreate = postsPermissions.canCreate;\n\t}\n\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t} = getColors( context, parentCount > 0 );\n\n\tfunction onKeyDown( event ) {\n\t\tif ( isKeyboardEvent.primary( event, 'k' ) ) {\n\t\t\tevent.preventDefault();\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tref: useMergeRefs( [ setPopoverAnchor, listItemRef ] ),\n\t\tclassName: classnames( 'wp-block-navigation-item', {\n\t\t\t'is-editing': isSelected || isParentOfSelectedBlock,\n\t\t\t'is-dragging-within': isDraggingWithin,\n\t\t\t'has-link': !! url,\n\t\t\t'has-child': hasChildren,\n\t\t\t'has-text-color': !! textColor || !! customTextColor,\n\t\t\t[ getColorClassName( 'color', textColor ) ]: !! textColor,\n\t\t\t'has-background': !! backgroundColor || customBackgroundColor,\n\t\t\t[ getColorClassName( 'background-color', backgroundColor ) ]:\n\t\t\t\t!! backgroundColor,\n\t\t\t'open-on-click': openSubmenusOnClick,\n\t\t} ),\n\t\tstyle: {\n\t\t\tcolor: ! textColor && customTextColor,\n\t\t\tbackgroundColor: ! backgroundColor && customBackgroundColor,\n\t\t},\n\t\tonKeyDown,\n\t} );\n\n\t// Always use overlay colors for submenus.\n\tconst innerBlocksColors = getColors( context, true );\n\n\tconst allowedBlocks =\n\t\tparentCount >= maxNestingLevel\n\t\t\t? ALLOWED_BLOCKS.filter(\n\t\t\t\t\t( blockName ) => blockName !== 'core/navigation-submenu'\n\t\t\t )\n\t\t\t: ALLOWED_BLOCKS;\n\n\tconst navigationChildBlockProps =\n\t\tgetNavigationChildBlockProps( innerBlocksColors );\n\tconst innerBlocksProps = useInnerBlocksProps( navigationChildBlockProps, {\n\t\tallowedBlocks,\n\t\tdefaultBlock: DEFAULT_BLOCK,\n\t\tdirectInsert: true,\n\n\t\t// Ensure block toolbar is not too far removed from item\n\t\t// being edited.\n\t\t// see: https://github.com/WordPress/gutenberg/pull/34615.\n\t\t__experimentalCaptureToolbars: true,\n\n\t\trenderAppender:\n\t\t\tisSelected ||\n\t\t\t( isImmediateParentOfSelectedBlock &&\n\t\t\t\t! selectedBlockHasChildren ) ||\n\t\t\t// Show the appender while dragging to allow inserting element between item and the appender.\n\t\t\thasChildren\n\t\t\t\t? InnerBlocks.ButtonBlockAppender\n\t\t\t\t: false,\n\t} );\n\n\tconst ParentElement = openSubmenusOnClick ? 'button' : 'a';\n\n\tfunction transformToLink() {\n\t\tconst newLinkBlock = createBlock( 'core/navigation-link', attributes );\n\t\treplaceBlock( clientId, newLinkBlock );\n\t}\n\n\tuseEffect( () => {\n\t\t// If block becomes empty, transform to Navigation Link.\n\t\tif ( ! hasChildren && prevHasChildren ) {\n\t\t\t// This side-effect should not create an undo level as those should\n\t\t\t// only be created via user interactions.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\ttransformToLink();\n\t\t}\n\t}, [ hasChildren, prevHasChildren ] );\n\n\tconst canConvertToLink =\n\t\t! selectedBlockHasChildren || onlyDescendantIsEmptyLink;\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t{ ! openSubmenusOnClick && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\t\ticon={ linkIcon }\n\t\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\tonClick={ () => setIsLinkOpen( true ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"revert\"\n\t\t\t\t\t\ticon={ removeSubmenu }\n\t\t\t\t\t\ttitle={ __( 'Convert to Link' ) }\n\t\t\t\t\t\tonClick={ transformToLink }\n\t\t\t\t\t\tclassName=\"wp-block-navigation__submenu__revert\"\n\t\t\t\t\t\tisDisabled={ ! canConvertToLink }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t</BlockControls>\n\t\t\t{ /* Warning, this duplicated in packages/block-library/src/navigation-link/edit.js */ }\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ label || '' }\n\t\t\t\t\t\tonChange={ ( labelValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { label: labelValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Label' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ url || '' }\n\t\t\t\t\t\tonChange={ ( urlValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { url: urlValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'URL' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ description || '' }\n\t\t\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tdescription: descriptionValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'The description will be displayed in the menu if the current theme supports it.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\t\tonChange={ ( titleValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { title: titleValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Additional information to help clarify the purpose of the link.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'The relationship of the linked URL as space-separated link types.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ /* eslint-disable jsx-a11y/anchor-is-valid */ }\n\t\t\t\t<ParentElement className=\"wp-block-navigation-item__content\">\n\t\t\t\t\t{ /* eslint-enable */ }\n\t\t\t\t\t{\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\n\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\tonChange={ ( labelValue ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { label: labelValue } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\t\taria-label={ __( 'Navigation link text' ) }\n\t\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\t\tallowedFormats={ [\n\t\t\t\t\t\t\t\t'core/bold',\n\t\t\t\t\t\t\t\t'core/italic',\n\t\t\t\t\t\t\t\t'core/image',\n\t\t\t\t\t\t\t\t'core/strikethrough',\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t\t{ ! openSubmenusOnClick && isLinkOpen && (\n\t\t\t\t\t\t<LinkUI\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tlink={ attributes }\n\t\t\t\t\t\t\tonClose={ () => setIsLinkOpen( false ) }\n\t\t\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\t\t\thasCreateSuggestion={ userCanCreate }\n\t\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( { url: '' } );\n\t\t\t\t\t\t\t\tspeak( __( 'Link removed.' ), 'assertive' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonChange={ ( updatedValue ) => {\n\t\t\t\t\t\t\t\tupdateAttributes(\n\t\t\t\t\t\t\t\t\tupdatedValue,\n\t\t\t\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\t\t\t\tattributes\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ParentElement>\n\t\t\t\t{ ( showSubmenuIcon || openSubmenusOnClick ) && (\n\t\t\t\t\t<span className=\"wp-block-navigation__submenu-icon\">\n\t\t\t\t\t\t<ItemSubmenuIcon />\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,SAAS,EACTC,WAAW,EACXC,eAAe,EACfC,aAAa,EACbC,YAAY,QACN,uBAAuB;AAC9B,SAASC,eAAe,EAAEC,eAAe,QAAQ,qBAAqB;AACtE,SAASC,EAAE,QAAQ,iBAAiB;AACpC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aAAA;IAAMlB,SAAS,EAAC;EAAmC,GAClDkB,aAAA,CAAC5G,eAAe,MAAE,CACb,CACN,EACD4G,aAAA;IAAA,GAAUV;EAAgB,CAAI,CAC1B,CACJ,CAAC;AAEL"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "8.28.
|
|
3
|
+
"version": "8.28.9",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"@wordpress/api-fetch": "^6.48.1",
|
|
36
36
|
"@wordpress/autop": "^3.51.1",
|
|
37
37
|
"@wordpress/blob": "^3.51.1",
|
|
38
|
-
"@wordpress/block-editor": "^12.19.
|
|
38
|
+
"@wordpress/block-editor": "^12.19.7",
|
|
39
39
|
"@wordpress/blocks": "^12.28.6",
|
|
40
40
|
"@wordpress/components": "^26.0.5",
|
|
41
41
|
"@wordpress/compose": "^6.28.1",
|
|
42
|
-
"@wordpress/core-data": "^6.28.
|
|
42
|
+
"@wordpress/core-data": "^6.28.7",
|
|
43
43
|
"@wordpress/data": "^9.21.1",
|
|
44
44
|
"@wordpress/date": "^4.51.1",
|
|
45
45
|
"@wordpress/deprecated": "^3.51.1",
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
"@wordpress/html-entities": "^3.51.1",
|
|
51
51
|
"@wordpress/i18n": "^4.51.1",
|
|
52
52
|
"@wordpress/icons": "^9.42.4",
|
|
53
|
-
"@wordpress/interactivity": "^5.0.
|
|
54
|
-
"@wordpress/interactivity-router": "^1.1.
|
|
53
|
+
"@wordpress/interactivity": "^5.0.5",
|
|
54
|
+
"@wordpress/interactivity-router": "^1.1.5",
|
|
55
55
|
"@wordpress/keycodes": "^3.51.1",
|
|
56
56
|
"@wordpress/notices": "^4.19.1",
|
|
57
|
-
"@wordpress/patterns": "^1.12.
|
|
57
|
+
"@wordpress/patterns": "^1.12.7",
|
|
58
58
|
"@wordpress/primitives": "^3.49.1",
|
|
59
59
|
"@wordpress/private-apis": "^0.33.1",
|
|
60
|
-
"@wordpress/reusable-blocks": "^4.28.
|
|
60
|
+
"@wordpress/reusable-blocks": "^4.28.7",
|
|
61
61
|
"@wordpress/rich-text": "^6.28.4",
|
|
62
62
|
"@wordpress/server-side-render": "^4.28.6",
|
|
63
63
|
"@wordpress/url": "^3.52.1",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"publishConfig": {
|
|
81
81
|
"access": "public"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "16546bee863900348e0b08abe70496c53abfa16e"
|
|
84
84
|
}
|
package/src/heading/index.js
CHANGED
|
@@ -30,15 +30,16 @@ export const settings = {
|
|
|
30
30
|
const { content, level } = attributes;
|
|
31
31
|
|
|
32
32
|
const customName = attributes?.metadata?.name;
|
|
33
|
+
const hasContent = content?.length > 0;
|
|
33
34
|
|
|
34
35
|
// In the list view, use the block's content as the label.
|
|
35
36
|
// If the content is empty, fall back to the default label.
|
|
36
|
-
if ( context === 'list-view' && ( customName ||
|
|
37
|
-
return
|
|
37
|
+
if ( context === 'list-view' && ( customName || hasContent ) ) {
|
|
38
|
+
return customName || content;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
if ( context === 'accessibility' ) {
|
|
41
|
-
return !
|
|
42
|
+
return ! hasContent
|
|
42
43
|
? sprintf(
|
|
43
44
|
/* translators: accessibility text. %s: heading level. */
|
|
44
45
|
__( 'Level %s. Empty.' ),
|
|
@@ -342,16 +342,7 @@ function Navigation( {
|
|
|
342
342
|
const [ detectedOverlayColor, setDetectedOverlayColor ] = useState();
|
|
343
343
|
|
|
344
344
|
const onSelectClassicMenu = async ( classicMenu ) => {
|
|
345
|
-
|
|
346
|
-
classicMenu.id,
|
|
347
|
-
classicMenu.name,
|
|
348
|
-
'draft'
|
|
349
|
-
);
|
|
350
|
-
if ( navMenu ) {
|
|
351
|
-
handleUpdateMenu( navMenu.id, {
|
|
352
|
-
focusNavigationBlock: true,
|
|
353
|
-
} );
|
|
354
|
-
}
|
|
345
|
+
return convertClassicMenu( classicMenu.id, classicMenu.name, 'draft' );
|
|
355
346
|
};
|
|
356
347
|
|
|
357
348
|
const onSelectNavigationMenu = ( menuId ) => {
|
|
@@ -402,6 +393,9 @@ function Navigation( {
|
|
|
402
393
|
showClassicMenuConversionNotice(
|
|
403
394
|
__( 'Classic menu imported successfully.' )
|
|
404
395
|
);
|
|
396
|
+
handleUpdateMenu( createNavigationMenuPost?.id, {
|
|
397
|
+
focusNavigationBlock: true,
|
|
398
|
+
} );
|
|
405
399
|
}
|
|
406
400
|
|
|
407
401
|
if ( classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_ERROR ) {
|
|
@@ -414,6 +408,8 @@ function Navigation( {
|
|
|
414
408
|
classicMenuConversionError,
|
|
415
409
|
hideClassicMenuConversionNotice,
|
|
416
410
|
showClassicMenuConversionNotice,
|
|
411
|
+
createNavigationMenuPost?.id,
|
|
412
|
+
handleUpdateMenu,
|
|
417
413
|
] );
|
|
418
414
|
|
|
419
415
|
useEffect( () => {
|
|
@@ -866,50 +862,52 @@ function Navigation( {
|
|
|
866
862
|
</InspectorControls>
|
|
867
863
|
) }
|
|
868
864
|
|
|
869
|
-
|
|
870
|
-
|
|
865
|
+
<TagName
|
|
866
|
+
{ ...blockProps }
|
|
867
|
+
aria-describedby={
|
|
868
|
+
! isPlaceholder && ! isLoading
|
|
869
|
+
? accessibleDescriptionId
|
|
870
|
+
: undefined
|
|
871
|
+
}
|
|
872
|
+
>
|
|
873
|
+
{ isLoading && (
|
|
871
874
|
<div className="wp-block-navigation__loading-indicator-container">
|
|
872
875
|
<Spinner className="wp-block-navigation__loading-indicator" />
|
|
873
876
|
</div>
|
|
874
|
-
|
|
875
|
-
) }
|
|
877
|
+
) }
|
|
876
878
|
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
) }
|
|
910
|
-
</ResponsiveWrapper>
|
|
911
|
-
</TagName>
|
|
912
|
-
) }
|
|
879
|
+
{ ! isLoading && (
|
|
880
|
+
<>
|
|
881
|
+
<AccessibleMenuDescription
|
|
882
|
+
id={ accessibleDescriptionId }
|
|
883
|
+
/>
|
|
884
|
+
<ResponsiveWrapper
|
|
885
|
+
id={ clientId }
|
|
886
|
+
onToggle={ setResponsiveMenuVisibility }
|
|
887
|
+
hasIcon={ hasIcon }
|
|
888
|
+
icon={ icon }
|
|
889
|
+
isOpen={ isResponsiveMenuOpen }
|
|
890
|
+
isResponsive={ isResponsive }
|
|
891
|
+
isHiddenByDefault={ 'always' === overlayMenu }
|
|
892
|
+
overlayBackgroundColor={
|
|
893
|
+
overlayBackgroundColor
|
|
894
|
+
}
|
|
895
|
+
overlayTextColor={ overlayTextColor }
|
|
896
|
+
>
|
|
897
|
+
{ isEntityAvailable && (
|
|
898
|
+
<NavigationInnerBlocks
|
|
899
|
+
clientId={ clientId }
|
|
900
|
+
hasCustomPlaceholder={
|
|
901
|
+
!! CustomPlaceholder
|
|
902
|
+
}
|
|
903
|
+
templateLock={ templateLock }
|
|
904
|
+
orientation={ orientation }
|
|
905
|
+
/>
|
|
906
|
+
) }
|
|
907
|
+
</ResponsiveWrapper>
|
|
908
|
+
</>
|
|
909
|
+
) }
|
|
910
|
+
</TagName>
|
|
913
911
|
</RecursionProvider>
|
|
914
912
|
</EntityProvider>
|
|
915
913
|
);
|
package/src/navigation/index.php
CHANGED
|
@@ -135,9 +135,9 @@ class WP_Navigation_Block_Renderer {
|
|
|
135
135
|
if ( static::does_block_need_a_list_item_wrapper( $inner_block ) ) {
|
|
136
136
|
return '<li class="wp-block-navigation-item">' . $inner_block_content . '</li>';
|
|
137
137
|
}
|
|
138
|
-
|
|
139
|
-
return $inner_block_content;
|
|
140
138
|
}
|
|
139
|
+
|
|
140
|
+
return $inner_block_content;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
/**
|
|
@@ -1464,6 +1464,22 @@ function block_core_navigation_set_ignored_hooked_blocks_metadata( $inner_blocks
|
|
|
1464
1464
|
* @return stdClass The updated post object.
|
|
1465
1465
|
*/
|
|
1466
1466
|
function block_core_navigation_update_ignore_hooked_blocks_meta( $post ) {
|
|
1467
|
+
/*
|
|
1468
|
+
* In this scenario the user has likely tried to create a navigation via the REST API.
|
|
1469
|
+
* In which case we won't have a post ID to work with and store meta against.
|
|
1470
|
+
*/
|
|
1471
|
+
if ( empty( $post->ID ) ) {
|
|
1472
|
+
return $post;
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
/**
|
|
1476
|
+
* Skip meta generation when consumers intentionally update specific Navigation fields
|
|
1477
|
+
* and omit the content update.
|
|
1478
|
+
*/
|
|
1479
|
+
if ( ! isset( $post->post_content ) ) {
|
|
1480
|
+
return $post;
|
|
1481
|
+
}
|
|
1482
|
+
|
|
1467
1483
|
/*
|
|
1468
1484
|
* We run the Block Hooks mechanism to inject the `metadata.ignoredHookedBlocks` attribute into
|
|
1469
1485
|
* all anchor blocks. For the root level, we create a mock Navigation and extract them from there.
|
package/src/navigation/view.js
CHANGED
|
@@ -62,11 +62,20 @@ const { state, actions } = store(
|
|
|
62
62
|
// Only open on hover if the overlay is closed.
|
|
63
63
|
Object.values( overlayOpenedBy || {} ).filter( Boolean )
|
|
64
64
|
.length === 0
|
|
65
|
-
)
|
|
65
|
+
) {
|
|
66
66
|
actions.openMenu( 'hover' );
|
|
67
|
+
}
|
|
67
68
|
},
|
|
68
69
|
closeMenuOnHover() {
|
|
69
|
-
|
|
70
|
+
const { type, overlayOpenedBy } = getContext();
|
|
71
|
+
if (
|
|
72
|
+
type === 'submenu' &&
|
|
73
|
+
// Only close on hover if the overlay is closed.
|
|
74
|
+
Object.values( overlayOpenedBy || {} ).filter( Boolean )
|
|
75
|
+
.length === 0
|
|
76
|
+
) {
|
|
77
|
+
actions.closeMenu( 'hover' );
|
|
78
|
+
}
|
|
70
79
|
},
|
|
71
80
|
openMenuOnClick() {
|
|
72
81
|
const ctx = getContext();
|