@wordpress/block-library 9.26.1-next.719a03cbe.0 → 9.27.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.
Files changed (110) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/cover/edit/block-controls.js +4 -2
  3. package/build/cover/edit/block-controls.js.map +1 -1
  4. package/build/cover/edit/index.js +6 -3
  5. package/build/cover/edit/index.js.map +1 -1
  6. package/build/cover/edit/inspector-controls.js +11 -4
  7. package/build/cover/edit/inspector-controls.js.map +1 -1
  8. package/build/cover/edit/poster-image.js +81 -0
  9. package/build/cover/edit/poster-image.js.map +1 -0
  10. package/build/cover/index.js +6 -0
  11. package/build/cover/index.js.map +1 -1
  12. package/build/cover/save.js +3 -1
  13. package/build/cover/save.js.map +1 -1
  14. package/build/media-text/edit.js +2 -2
  15. package/build/media-text/edit.js.map +1 -1
  16. package/build/navigation-link/edit.js +32 -15
  17. package/build/navigation-link/edit.js.map +1 -1
  18. package/build/navigation-link/update-attributes.js +112 -14
  19. package/build/navigation-link/update-attributes.js.map +1 -1
  20. package/build/navigation-submenu/edit.js +19 -2
  21. package/build/navigation-submenu/edit.js.map +1 -1
  22. package/build/post-content/edit.js +78 -16
  23. package/build/post-content/edit.js.map +1 -1
  24. package/build/post-content/index.js +6 -0
  25. package/build/post-content/index.js.map +1 -1
  26. package/build/separator/edit.js +5 -30
  27. package/build/separator/edit.js.map +1 -1
  28. package/build/site-tagline/index.js +1 -1
  29. package/build/video/edit.js +2 -5
  30. package/build/video/edit.js.map +1 -1
  31. package/build/video/poster-image.js +25 -25
  32. package/build/video/poster-image.js.map +1 -1
  33. package/build/video/tracks-editor.js +95 -104
  34. package/build/video/tracks-editor.js.map +1 -1
  35. package/build/video/tracks.js +6 -2
  36. package/build/video/tracks.js.map +1 -1
  37. package/build-module/cover/edit/block-controls.js +4 -2
  38. package/build-module/cover/edit/block-controls.js.map +1 -1
  39. package/build-module/cover/edit/index.js +6 -3
  40. package/build-module/cover/edit/index.js.map +1 -1
  41. package/build-module/cover/edit/inspector-controls.js +10 -4
  42. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  43. package/build-module/cover/edit/poster-image.js +74 -0
  44. package/build-module/cover/edit/poster-image.js.map +1 -0
  45. package/build-module/cover/index.js +6 -0
  46. package/build-module/cover/index.js.map +1 -1
  47. package/build-module/cover/save.js +3 -1
  48. package/build-module/cover/save.js.map +1 -1
  49. package/build-module/media-text/edit.js +2 -2
  50. package/build-module/media-text/edit.js.map +1 -1
  51. package/build-module/navigation-link/edit.js +32 -15
  52. package/build-module/navigation-link/edit.js.map +1 -1
  53. package/build-module/navigation-link/update-attributes.js +113 -15
  54. package/build-module/navigation-link/update-attributes.js.map +1 -1
  55. package/build-module/navigation-submenu/edit.js +20 -3
  56. package/build-module/navigation-submenu/edit.js.map +1 -1
  57. package/build-module/post-content/edit.js +80 -18
  58. package/build-module/post-content/edit.js.map +1 -1
  59. package/build-module/post-content/index.js +6 -0
  60. package/build-module/post-content/index.js.map +1 -1
  61. package/build-module/separator/edit.js +6 -31
  62. package/build-module/separator/edit.js.map +1 -1
  63. package/build-module/site-tagline/index.js +1 -1
  64. package/build-module/video/edit.js +2 -5
  65. package/build-module/video/edit.js.map +1 -1
  66. package/build-module/video/poster-image.js +26 -26
  67. package/build-module/video/poster-image.js.map +1 -1
  68. package/build-module/video/tracks-editor.js +96 -105
  69. package/build-module/video/tracks-editor.js.map +1 -1
  70. package/build-module/video/tracks.js +6 -2
  71. package/build-module/video/tracks.js.map +1 -1
  72. package/build-style/archives/editor-rtl.css +0 -4
  73. package/build-style/archives/editor.css +0 -4
  74. package/build-style/editor-rtl.css +0 -8
  75. package/build-style/editor.css +0 -8
  76. package/build-style/file/style-rtl.css +1 -1
  77. package/build-style/file/style.css +1 -1
  78. package/build-style/navigation/style-rtl.css +1 -0
  79. package/build-style/navigation/style.css +1 -0
  80. package/build-style/style-rtl.css +2 -1
  81. package/build-style/style.css +2 -1
  82. package/build-style/video/editor-rtl.css +0 -4
  83. package/build-style/video/editor.css +0 -4
  84. package/package.json +35 -35
  85. package/src/archives/editor.scss +0 -4
  86. package/src/comments-pagination/index.php +7 -2
  87. package/src/cover/block.json +6 -0
  88. package/src/cover/edit/block-controls.js +22 -17
  89. package/src/cover/edit/index.js +4 -1
  90. package/src/cover/edit/inspector-controls.js +11 -2
  91. package/src/cover/edit/poster-image.js +91 -0
  92. package/src/cover/save.js +2 -0
  93. package/src/file/style.scss +1 -1
  94. package/src/media-text/edit.js +1 -1
  95. package/src/navigation/style.scss +1 -0
  96. package/src/navigation-link/edit.js +28 -16
  97. package/src/navigation-link/test/edit.js +738 -6
  98. package/src/navigation-link/update-attributes.js +125 -12
  99. package/src/navigation-submenu/edit.js +21 -1
  100. package/src/post-content/block.json +6 -0
  101. package/src/post-content/edit.js +71 -19
  102. package/src/post-content/index.php +11 -4
  103. package/src/post-featured-image/index.php +3 -2
  104. package/src/separator/edit.js +8 -43
  105. package/src/site-tagline/block.json +1 -1
  106. package/src/video/edit.js +1 -4
  107. package/src/video/editor.scss +0 -6
  108. package/src/video/poster-image.js +29 -24
  109. package/src/video/tracks-editor.js +93 -103
  110. package/src/video/tracks.js +2 -1
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_keycodes","_i18n","_blockEditor","_url","_element","_icons","_a11y","_blocks","_compose","_icons2","_linkUi","_updateAttributes","_utils","_hooks","_jsxRuntime","ALLOWED_BLOCKS","DEFAULT_BLOCK","name","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","useState","useEffect","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener","NavigationSubmenuEdit","attributes","isSelected","setAttributes","mergeBlocks","onReplace","context","clientId","label","url","description","rel","showSubmenuIcon","maxNestingLevel","openSubmenusOnClick","__unstableMarkNextChangeAsNotPersistent","replaceBlock","selectBlock","useDispatch","blockEditorStore","isLinkOpen","setIsLinkOpen","openedBy","setOpenedBy","popoverAnchor","setPopoverAnchor","listItemRef","useRef","itemLabelPlaceholder","__","ref","dropdownMenuProps","useToolsPanelDropdownMenuProps","parentCount","isParentOfSelectedBlock","isImmediateParentOfSelectedBlock","hasChildren","selectedBlockHasChildren","onlyDescendantIsEmptyLink","useSelect","select","hasSelectedInnerBlock","getSelectedBlockClientId","getBlockParentsByBlockName","getBlock","getBlockCount","getBlockOrder","_onlyDescendantIsEmptyLink","selectedBlockId","selectedBlockChildren","length","singleBlock","prevHasChildren","usePrevious","isURL","prependHTTP","test","selectLabelText","focus","defaultView","selection","getSelection","range","createRange","selectNodeContents","removeAllRanges","addRange","textColor","customTextColor","backgroundColor","customBackgroundColor","getColors","onKeyDown","isKeyboardEvent","primary","preventDefault","stopPropagation","blockProps","useBlockProps","useMergeRefs","className","clsx","getColorClassName","style","color","innerBlocksColors","allowedBlocks","filter","blockName","navigationChildBlockProps","getNavigationChildBlockProps","innerBlocksProps","useInnerBlocksProps","defaultBlock","directInsert","__experimentalCaptureToolbars","renderAppender","InnerBlocks","ButtonBlockAppender","ParentElement","transformToLink","newLinkBlock","createBlock","canConvertToLink","jsxs","Fragment","children","jsx","BlockControls","ToolbarGroup","ToolbarButton","icon","linkIcon","title","shortcut","displayShortcut","onClick","currentTarget","removeSubmenu","disabled","InspectorControls","__experimentalToolsPanel","resetAll","__experimentalToolsPanelItem","isShownByDefault","hasValue","onDeselect","TextControl","__nextHasNoMarginBottom","__next40pxDefaultSize","value","onChange","labelValue","autoComplete","urlValue","type","TextareaControl","descriptionValue","help","relValue","RichText","identifier","onMerge","placeholder","withoutInteractiveFormatting","LinkUI","link","onClose","anchor","onRemove","speak","updatedValue","updateAttributes","ItemSubmenuIcon"],"sources":["@wordpress/block-library/src/navigation-submenu/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tToolbarGroup,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\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 { link as linkIcon, removeSubmenu } from '@wordpress/icons';\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';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\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 */\n\nexport default function NavigationSubmenuEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tmergeBlocks,\n\tonReplace,\n\tcontext,\n\tclientId,\n} ) {\n\tconst { label, url, description, rel } = attributes;\n\n\tconst { showSubmenuIcon, maxNestingLevel, openSubmenusOnClick } = context;\n\n\tconst {\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\treplaceBlock,\n\t\tselectBlock,\n\t} = useDispatch( blockEditorStore );\n\tconst [ isLinkOpen, setIsLinkOpen ] = useState( false );\n\t// Store what element opened the popover, so we know where to return focus to (toolbar button vs navigation link text)\n\tconst [ openedBy, setOpenedBy ] = useState( null );\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\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\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}\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\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\t// Required to prevent the command center from opening,\n\t\t\t// as it shares the CMD+K shortcut.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/59845.\n\t\t\tevent.preventDefault();\n\t\t\t// If we don't stop propagation, this event bubbles up to the parent submenu item\n\t\t\tevent.stopPropagation();\n\t\t\tsetIsLinkOpen( true );\n\t\t\tsetOpenedBy( ref.current );\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tref: useMergeRefs( [ setPopoverAnchor, listItemRef ] ),\n\t\tclassName: clsx( '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={ ( event ) => {\n\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\t\tsetOpenedBy( event.currentTarget );\n\t\t\t\t\t\t\t} }\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\tdisabled={ ! 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<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tlabel: '',\n\t\t\t\t\t\t\turl: '',\n\t\t\t\t\t\t\tdescription: '',\n\t\t\t\t\t\t\trel: '',\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! label }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { label: '' } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\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\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! url }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { url: '' } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvalue={ url || '' }\n\t\t\t\t\t\t\tonChange={ ( urlValue ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { url: urlValue } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\ttype=\"url\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! description }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { description: '' } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tvalue={ description || '' }\n\t\t\t\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tdescription: descriptionValue,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\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\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! rel }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { rel: '' } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\thelp={ __(\n\t\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\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\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<RichText\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\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\tonMerge={ mergeBlocks }\n\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\taria-label={ __( 'Navigation link text' ) }\n\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\t\tsetOpenedBy( ref.current );\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{ description && (\n\t\t\t\t\t\t<span className=\"wp-block-navigation-item__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</span>\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={ () => {\n\t\t\t\t\t\t\t\tsetIsLinkOpen( false );\n\t\t\t\t\t\t\t\tif ( openedBy ) {\n\t\t\t\t\t\t\t\t\topenedBy.focus();\n\t\t\t\t\t\t\t\t\tsetOpenedBy( null );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tselectBlock( clientId );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tanchor={ popoverAnchor }\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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAQA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAUA,IAAAM,IAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,QAAA,GAAAX,OAAA;AAKA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AACA,IAAAc,iBAAA,GAAAd,OAAA;AACA,IAAAe,MAAA,GAAAf,OAAA;AAIA,IAAAgB,MAAA,GAAAhB,OAAA;AAAgE,IAAAiB,WAAA,GAAAjB,OAAA;AA9ChE;AACA;AACA;;AAGA;AACA;AACA;;AA6BA;AACA;AACA;;AAUA,MAAMkB,cAAc,GAAG,CACtB,sBAAsB,EACtB,yBAAyB,EACzB,gBAAgB,CAChB;AAED,MAAMC,aAAa,GAAG;EACrBC,IAAI,EAAE;AACP,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAKC,UAAU,IAAM;EAC7C,MAAM,CAAEC,gBAAgB,EAAEC,mBAAmB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EAEnE,IAAAC,kBAAS,EAAE,MAAM;I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CAAAkL,eAAe,IAAE;MAAC,CACd,CACN,eACD,IAAA7K,WAAA,CAAA+H,GAAA;QAAA,GAAUhB;MAAgB,CAAI,CAAC;IAAA,CAC3B,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_components","_keycodes","_i18n","_blockEditor","_url","_element","_icons","_a11y","_blocks","_compose","_icons2","_linkUi","_updateAttributes","_utils","_hooks","_jsxRuntime","ALLOWED_BLOCKS","DEFAULT_BLOCK","name","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","useState","useEffect","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener","NavigationSubmenuEdit","attributes","isSelected","setAttributes","mergeBlocks","onReplace","context","clientId","label","url","description","rel","opensInNewTab","showSubmenuIcon","maxNestingLevel","openSubmenusOnClick","__unstableMarkNextChangeAsNotPersistent","replaceBlock","selectBlock","useDispatch","blockEditorStore","isLinkOpen","setIsLinkOpen","openedBy","setOpenedBy","popoverAnchor","setPopoverAnchor","listItemRef","useRef","itemLabelPlaceholder","__","ref","dropdownMenuProps","useToolsPanelDropdownMenuProps","parentCount","isParentOfSelectedBlock","isImmediateParentOfSelectedBlock","hasChildren","selectedBlockHasChildren","onlyDescendantIsEmptyLink","useSelect","select","hasSelectedInnerBlock","getSelectedBlockClientId","getBlockParentsByBlockName","getBlock","getBlockCount","getBlockOrder","_onlyDescendantIsEmptyLink","selectedBlockId","selectedBlockChildren","length","singleBlock","prevHasChildren","usePrevious","isURL","prependHTTP","test","selectLabelText","focus","defaultView","selection","getSelection","range","createRange","selectNodeContents","removeAllRanges","addRange","textColor","customTextColor","backgroundColor","customBackgroundColor","getColors","onKeyDown","isKeyboardEvent","primary","preventDefault","stopPropagation","blockProps","useBlockProps","useMergeRefs","className","clsx","getColorClassName","style","color","innerBlocksColors","allowedBlocks","filter","blockName","navigationChildBlockProps","getNavigationChildBlockProps","innerBlocksProps","useInnerBlocksProps","defaultBlock","directInsert","__experimentalCaptureToolbars","renderAppender","InnerBlocks","ButtonBlockAppender","ParentElement","transformToLink","newLinkBlock","createBlock","canConvertToLink","jsxs","Fragment","children","jsx","BlockControls","ToolbarGroup","ToolbarButton","icon","linkIcon","title","shortcut","displayShortcut","onClick","currentTarget","removeSubmenu","disabled","InspectorControls","__experimentalToolsPanel","resetAll","__experimentalToolsPanelItem","isShownByDefault","hasValue","onDeselect","TextControl","__nextHasNoMarginBottom","__next40pxDefaultSize","value","onChange","labelValue","autoComplete","urlValue","type","CheckboxControl","checked","TextareaControl","descriptionValue","help","relValue","RichText","identifier","onMerge","placeholder","withoutInteractiveFormatting","LinkUI","link","onClose","anchor","onRemove","speak","updatedValue","updateAttributes","ItemSubmenuIcon"],"sources":["@wordpress/block-library/src/navigation-submenu/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tCheckboxControl,\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tToolbarGroup,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\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 { link as linkIcon, removeSubmenu } from '@wordpress/icons';\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';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\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 */\n\nexport default function NavigationSubmenuEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tmergeBlocks,\n\tonReplace,\n\tcontext,\n\tclientId,\n} ) {\n\tconst { label, url, description, rel, opensInNewTab } = attributes;\n\n\tconst { showSubmenuIcon, maxNestingLevel, openSubmenusOnClick } = context;\n\n\tconst {\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\treplaceBlock,\n\t\tselectBlock,\n\t} = useDispatch( blockEditorStore );\n\tconst [ isLinkOpen, setIsLinkOpen ] = useState( false );\n\t// Store what element opened the popover, so we know where to return focus to (toolbar button vs navigation link text)\n\tconst [ openedBy, setOpenedBy ] = useState( null );\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\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\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}\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\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\t// Required to prevent the command center from opening,\n\t\t\t// as it shares the CMD+K shortcut.\n\t\t\t// See https://github.com/WordPress/gutenberg/pull/59845.\n\t\t\tevent.preventDefault();\n\t\t\t// If we don't stop propagation, this event bubbles up to the parent submenu item\n\t\t\tevent.stopPropagation();\n\t\t\tsetIsLinkOpen( true );\n\t\t\tsetOpenedBy( ref.current );\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tref: useMergeRefs( [ setPopoverAnchor, listItemRef ] ),\n\t\tclassName: clsx( '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={ ( event ) => {\n\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\t\tsetOpenedBy( event.currentTarget );\n\t\t\t\t\t\t\t} }\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\tdisabled={ ! 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<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tlabel: '',\n\t\t\t\t\t\t\turl: '',\n\t\t\t\t\t\t\tdescription: '',\n\t\t\t\t\t\t\trel: '',\n\t\t\t\t\t\t\topensInNewTab: false,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! label }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { label: '' } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\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\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! url }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { url: '' } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvalue={ url || '' }\n\t\t\t\t\t\t\tonChange={ ( urlValue ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { url: urlValue } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\ttype=\"url\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => !! opensInNewTab }\n\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { opensInNewTab: false } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\tchecked={ opensInNewTab }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { opensInNewTab: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! description }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { description: '' } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tvalue={ description || '' }\n\t\t\t\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tdescription: descriptionValue,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\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\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! rel }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { rel: '' } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t\t\thelp={ __(\n\t\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\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\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<RichText\n\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\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\tonMerge={ mergeBlocks }\n\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\taria-label={ __( 'Navigation link text' ) }\n\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\t\tsetOpenedBy( ref.current );\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{ description && (\n\t\t\t\t\t\t<span className=\"wp-block-navigation-item__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</span>\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={ () => {\n\t\t\t\t\t\t\t\tsetIsLinkOpen( false );\n\t\t\t\t\t\t\t\tif ( openedBy ) {\n\t\t\t\t\t\t\t\t\topenedBy.focus();\n\t\t\t\t\t\t\t\t\tsetOpenedBy( null );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tselectBlock( clientId );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tanchor={ popoverAnchor }\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":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AASA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAUA,IAAAM,IAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,KAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,QAAA,GAAAX,OAAA;AAKA,IAAAY,OAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AACA,IAAAc,iBAAA,GAAAd,OAAA;AACA,IAAAe,MAAA,GAAAf,OAAA;AAIA,IAAAgB,MAAA,GAAAhB,OAAA;AAAgE,IAAAiB,WAAA,GAAAjB,OAAA;AA/ChE;AACA;AACA;;AAGA;AACA;AACA;;AA8BA;AACA;AACA;;AAUA,MAAMkB,cAAc,GAAG,CACtB,sBAAsB,EACtB,yBAAyB,EACzB,gBAAgB,CAChB;AAED,MAAMC,aAAa,GAAG;EACrBC,IAAI,EAAE;AACP,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAKC,UAAU,IAAM;EAC7C,MAAM,CAAEC,gBAAgB,EAAEC,mBAAmB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,KAAM,CAAC;EAEnE,IAAAC,kBAAS,EAAE,MAAM;IAChB,MAAM;M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K,CAAC;YACpB,CAAC,MAAM;cACNN,WAAW,CAAEX,QAAS,CAAC;YACxB;UACD,CAAG;UACHgJ,MAAM,EAAG9H,aAAe;UACxB+H,QAAQ,EAAGA,CAAA,KAAM;YAChBrJ,aAAa,CAAE;cAAEM,GAAG,EAAE;YAAG,CAAE,CAAC;YAC5B,IAAAgJ,WAAK,EAAE,IAAA3H,QAAE,EAAE,eAAgB,CAAC,EAAE,WAAY,CAAC;UAC5C,CAAG;UACHsG,QAAQ,EAAKsB,YAAY,IAAM;YAC9B,IAAAC,kCAAgB,EACfD,YAAY,EACZvJ,aAAa,EACbF,UACD,CAAC;UACF;QAAG,CACH,CACD;MAAA,CACa,CAAC,EACd,CAAEY,eAAe,IAAIE,mBAAmB,kBACzC,IAAAnC,WAAA,CAAAgI,GAAA;QAAM3B,SAAS,EAAC,mCAAmC;QAAA0B,QAAA,eAClD,IAAA/H,WAAA,CAAAgI,GAAA,EAACrI,OAAA,CAAAqL,eAAe,IAAE;MAAC,CACd,CACN,eACD,IAAAhL,WAAA,CAAAgI,GAAA;QAAA,GAAUhB;MAAgB,CAAI,CAAC;IAAA,CAC3B,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
@@ -11,6 +11,7 @@ var _coreData = require("@wordpress/core-data");
11
11
  var _data = require("@wordpress/data");
12
12
  var _element = require("@wordpress/element");
13
13
  var _hooks = require("../utils/hooks");
14
+ var _lockUnlock = require("../lock-unlock");
14
15
  var _jsxRuntime = require("react/jsx-runtime");
15
16
  /**
16
17
  * WordPress dependencies
@@ -20,12 +21,16 @@ var _jsxRuntime = require("react/jsx-runtime");
20
21
  * Internal dependencies
21
22
  */
22
23
 
24
+ const {
25
+ HTMLElementControl
26
+ } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
23
27
  function ReadOnlyContent({
24
28
  parentLayout,
25
29
  layoutClassNames,
26
30
  userCanEdit,
27
31
  postType,
28
- postId
32
+ postId,
33
+ tagName: TagName = 'div'
29
34
  }) {
30
35
  const [,, content] = (0, _coreData.useEntityProp)('postType', postType, 'content', postId);
31
36
  const blockProps = (0, _blockEditor.useBlockProps)({
@@ -52,12 +57,12 @@ function ReadOnlyContent({
52
57
  ...blockPreviewProps
53
58
  });
54
59
  }
55
- return content?.protected ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
60
+ return content?.protected ? /*#__PURE__*/(0, _jsxRuntime.jsx)(TagName, {
56
61
  ...blockProps,
57
62
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.Warning, {
58
63
  children: (0, _i18n.__)('This content is password protected.')
59
64
  })
60
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
65
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(TagName, {
61
66
  ...blockProps,
62
67
  dangerouslySetInnerHTML: {
63
68
  __html: content?.rendered
@@ -65,7 +70,8 @@ function ReadOnlyContent({
65
70
  });
66
71
  }
67
72
  function EditableContent({
68
- context = {}
73
+ context = {},
74
+ tagName: TagName = 'div'
69
75
  }) {
70
76
  const {
71
77
  postType,
@@ -87,7 +93,7 @@ function EditableContent({
87
93
  onChange,
88
94
  template: !hasInnerBlocks ? initialInnerBlocks : undefined
89
95
  });
90
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
96
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(TagName, {
91
97
  ...props
92
98
  });
93
99
  }
@@ -98,7 +104,8 @@ function Content(props) {
98
104
  postType,
99
105
  postId
100
106
  } = {},
101
- layoutClassNames
107
+ layoutClassNames,
108
+ tagName
102
109
  } = props;
103
110
  const userCanEdit = (0, _hooks.useCanEditEntity)('postType', postType, postId);
104
111
  if (userCanEdit === undefined) {
@@ -113,7 +120,8 @@ function Content(props) {
113
120
  layoutClassNames: layoutClassNames,
114
121
  userCanEdit: userCanEdit,
115
122
  postType: postType,
116
- postId: postId
123
+ postId: postId,
124
+ tagName: tagName
117
125
  });
118
126
  }
119
127
  function Placeholder({
@@ -142,8 +150,51 @@ function RecursionError() {
142
150
  })
143
151
  });
144
152
  }
153
+
154
+ /**
155
+ * Render inspector controls for the PostContent block.
156
+ *
157
+ * @param {Object} props Component props.
158
+ * @param {string} props.tagName The HTML tag name.
159
+ * @param {Function} props.onSelectTagName onChange function for the SelectControl.
160
+ * @param {string} props.clientId The client ID of the current block.
161
+ *
162
+ * @return {JSX.Element} The control group.
163
+ */
164
+ function PostContentEditControls({
165
+ tagName,
166
+ onSelectTagName,
167
+ clientId
168
+ }) {
169
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
170
+ group: "advanced",
171
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(HTMLElementControl, {
172
+ tagName: tagName,
173
+ onChange: onSelectTagName,
174
+ clientId: clientId,
175
+ options: [{
176
+ label: (0, _i18n.__)('Default (<div>)'),
177
+ value: 'div'
178
+ }, {
179
+ label: '<main>',
180
+ value: 'main'
181
+ }, {
182
+ label: '<section>',
183
+ value: 'section'
184
+ }, {
185
+ label: '<article>',
186
+ value: 'article'
187
+ }]
188
+ })
189
+ });
190
+ }
145
191
  function PostContentEdit({
146
192
  context,
193
+ attributes: {
194
+ tagName = 'div'
195
+ },
196
+ setAttributes,
197
+ clientId,
147
198
  __unstableLayoutClassNames: layoutClassNames,
148
199
  __unstableParentLayout: parentLayout
149
200
  }) {
@@ -155,15 +206,26 @@ function PostContentEdit({
155
206
  if (contextPostId && contextPostType && hasAlreadyRendered) {
156
207
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(RecursionError, {});
157
208
  }
158
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.RecursionProvider, {
159
- uniqueId: contextPostId,
160
- children: contextPostId && contextPostType ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Content, {
161
- context: context,
162
- parentLayout: parentLayout,
163
- layoutClassNames: layoutClassNames
164
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(Placeholder, {
165
- layoutClassNames: layoutClassNames
166
- })
209
+ const handleSelectTagName = value => {
210
+ setAttributes({
211
+ tagName: value
212
+ });
213
+ };
214
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
215
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(PostContentEditControls, {
216
+ tagName: tagName,
217
+ onSelectTagName: handleSelectTagName,
218
+ clientId: clientId
219
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.RecursionProvider, {
220
+ uniqueId: contextPostId,
221
+ children: contextPostId && contextPostType ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Content, {
222
+ context: context,
223
+ parentLayout: parentLayout,
224
+ layoutClassNames: layoutClassNames
225
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(Placeholder, {
226
+ layoutClassNames: layoutClassNames
227
+ })
228
+ })]
167
229
  });
168
230
  }
169
231
  //# sourceMappingURL=edit.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_blockEditor","_blocks","_coreData","_data","_element","_hooks","_jsxRuntime","ReadOnlyContent","parentLayout","layoutClassNames","userCanEdit","postType","postId","content","useEntityProp","blockProps","useBlockProps","className","blocks","useMemo","raw","parse","blockPreviewProps","useBlockPreview","props","layout","jsx","protected","children","Warning","__","dangerouslySetInnerHTML","__html","rendered","EditableContent","context","onInput","onChange","useEntityBlockEditor","id","entityRecord","useSelect","select","coreStore","getEntityRecord","hasInnerBlocks","length","initialInnerBlocks","useInnerBlocksProps","value","template","undefined","Content","queryId","useCanEditEntity","isDescendentOfQueryLoop","Number","isFinite","isEditable","Placeholder","jsxs","RecursionError","PostContentEdit","__unstableLayoutClassNames","__unstableParentLayout","contextPostId","contextPostType","hasAlreadyRendered","useHasRecursion","RecursionProvider","uniqueId"],"sources":["@wordpress/block-library/src/post-content/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tRecursionProvider,\n\tuseHasRecursion,\n\tWarning,\n\t__experimentalUseBlockPreview as useBlockPreview,\n} from '@wordpress/block-editor';\nimport { parse } from '@wordpress/blocks';\nimport {\n\tuseEntityProp,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useCanEditEntity } from '../utils/hooks';\n\nfunction ReadOnlyContent( {\n\tparentLayout,\n\tlayoutClassNames,\n\tuserCanEdit,\n\tpostType,\n\tpostId,\n} ) {\n\tconst [ , , content ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'content',\n\t\tpostId\n\t);\n\tconst blockProps = useBlockProps( { className: layoutClassNames } );\n\tconst blocks = useMemo( () => {\n\t\treturn content?.raw ? parse( content.raw ) : [];\n\t}, [ content?.raw ] );\n\tconst blockPreviewProps = useBlockPreview( {\n\t\tblocks,\n\t\tprops: blockProps,\n\t\tlayout: parentLayout,\n\t} );\n\n\tif ( userCanEdit ) {\n\t\t/*\n\t\t * Rendering the block preview using the raw content blocks allows for\n\t\t * block support styles to be generated and applied by the editor.\n\t\t *\n\t\t * The preview using the raw blocks can only be presented to users with\n\t\t * edit permissions for the post to prevent potential exposure of private\n\t\t * block content.\n\t\t */\n\t\treturn <div { ...blockPreviewProps }></div>;\n\t}\n\n\treturn content?.protected ? (\n\t\t<div { ...blockProps }>\n\t\t\t<Warning>{ __( 'This content is password protected.' ) }</Warning>\n\t\t</div>\n\t) : (\n\t\t<div\n\t\t\t{ ...blockProps }\n\t\t\tdangerouslySetInnerHTML={ { __html: content?.rendered } }\n\t\t></div>\n\t);\n}\n\nfunction EditableContent( { context = {} } ) {\n\tconst { postType, postId } = context;\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpostType,\n\t\t{ id: postId }\n\t);\n\n\tconst entityRecord = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst hasInnerBlocks = !! entityRecord?.content?.raw || blocks?.length;\n\n\tconst initialInnerBlocks = [ [ 'core/paragraph' ] ];\n\n\tconst props = useInnerBlocksProps(\n\t\tuseBlockProps( { className: 'entry-content' } ),\n\t\t{\n\t\t\tvalue: blocks,\n\t\t\tonInput,\n\t\t\tonChange,\n\t\t\ttemplate: ! hasInnerBlocks ? initialInnerBlocks : undefined,\n\t\t}\n\t);\n\treturn <div { ...props } />;\n}\n\nfunction Content( props ) {\n\tconst { context: { queryId, postType, postId } = {}, layoutClassNames } =\n\t\tprops;\n\tconst userCanEdit = useCanEditEntity( 'postType', postType, postId );\n\tif ( userCanEdit === undefined ) {\n\t\treturn null;\n\t}\n\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst isEditable = userCanEdit && ! isDescendentOfQueryLoop;\n\n\treturn isEditable ? (\n\t\t<EditableContent { ...props } />\n\t) : (\n\t\t<ReadOnlyContent\n\t\t\tparentLayout={ props.parentLayout }\n\t\t\tlayoutClassNames={ layoutClassNames }\n\t\t\tuserCanEdit={ userCanEdit }\n\t\t\tpostType={ postType }\n\t\t\tpostId={ postId }\n\t\t/>\n\t);\n}\n\nfunction Placeholder( { layoutClassNames } ) {\n\tconst blockProps = useBlockProps( { className: layoutClassNames } );\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'This is the Content block, it will display all the blocks in any single post or page.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'That might be a simple arrangement like consecutive paragraphs in a blog post, or a more elaborate composition that includes image galleries, videos, tables, columns, and any other block types.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'If there are any Custom Post Types registered at your site, the Content block can display the contents of those entries as well.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t</div>\n\t);\n}\n\nfunction RecursionError() {\n\tconst blockProps = useBlockProps();\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<Warning>\n\t\t\t\t{ __( 'Block cannot be rendered inside itself.' ) }\n\t\t\t</Warning>\n\t\t</div>\n\t);\n}\n\nexport default function PostContentEdit( {\n\tcontext,\n\t__unstableLayoutClassNames: layoutClassNames,\n\t__unstableParentLayout: parentLayout,\n} ) {\n\tconst { postId: contextPostId, postType: contextPostType } = context;\n\tconst hasAlreadyRendered = useHasRecursion( contextPostId );\n\n\tif ( contextPostId && contextPostType && hasAlreadyRendered ) {\n\t\treturn <RecursionError />;\n\t}\n\n\treturn (\n\t\t<RecursionProvider uniqueId={ contextPostId }>\n\t\t\t{ contextPostId && contextPostType ? (\n\t\t\t\t<Content\n\t\t\t\t\tcontext={ context }\n\t\t\t\t\tparentLayout={ parentLayout }\n\t\t\t\t\tlayoutClassNames={ layoutClassNames }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Placeholder layoutClassNames={ layoutClassNames } />\n\t\t\t) }\n\t\t</RecursionProvider>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAKA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAAkD,IAAAO,WAAA,GAAAP,OAAA;AAxBlD;AACA;AACA;;AAmBA;AACA;AACA;;AAGA,SAASQ,eAAeA,CAAE;EACzBC,YAAY;EACZC,gBAAgB;EAChBC,WAAW;EACXC,QAAQ;EACRC;AACD,CAAC,EAAG;EACH,MAAM,IAAMC,OAAO,CAAE,GAAG,IAAAC,uBAAa,EACpC,UAAU,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,aAAa;IAAEtD,QAAQ,EAAEuD;EAAgB,CAAC,GAAG/B,OAAO;EACpE,MAAMgC,kBAAkB,GAAG,IAAAC,4BAAe,EAAEH,aAAc,CAAC;EAE3D,IAAKA,aAAa,IAAIC,eAAe,IAAIC,kBAAkB,EAAG;IAC7D,oBAAO,IAAA7D,WAAA,CAAAoB,GAAA,EAACmC,cAAc,IAAE,CAAC;EAC1B;EAEA,oBACC,IAAAvD,WAAA,CAAAoB,GAAA,EAAC1B,YAAA,CAAAqE,iBAAiB;IAACC,QAAQ,EAAGL,aAAe;IAAArC,QAAA,EAC1CqC,aAAa,IAAIC,eAAe,gBACjC,IAAA5D,WAAA,CAAAoB,GAAA,EAAC0B,OAAO;MACPjB,OAAO,EAAGA,OAAS;MACnB3B,YAAY,EAAGA,YAAc;MAC7BC,gBAAgB,EAAGA;IAAkB,CACrC,CAAC,gBAEF,IAAAH,WAAA,CAAAoB,GAAA,EAACiC,WAAW;MAAClD,gBAAgB,EAAGA;IAAkB,CAAE;EACpD,CACiB,CAAC;AAEtB","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_blockEditor","_blocks","_coreData","_data","_element","_hooks","_lockUnlock","_jsxRuntime","HTMLElementControl","unlock","blockEditorPrivateApis","ReadOnlyContent","parentLayout","layoutClassNames","userCanEdit","postType","postId","tagName","TagName","content","useEntityProp","blockProps","useBlockProps","className","blocks","useMemo","raw","parse","blockPreviewProps","useBlockPreview","props","layout","jsx","protected","children","Warning","__","dangerouslySetInnerHTML","__html","rendered","EditableContent","context","onInput","onChange","useEntityBlockEditor","id","entityRecord","useSelect","select","coreStore","getEntityRecord","hasInnerBlocks","length","initialInnerBlocks","useInnerBlocksProps","value","template","undefined","Content","queryId","useCanEditEntity","isDescendentOfQueryLoop","Number","isFinite","isEditable","Placeholder","jsxs","RecursionError","PostContentEditControls","onSelectTagName","clientId","InspectorControls","group","options","label","PostContentEdit","attributes","setAttributes","__unstableLayoutClassNames","__unstableParentLayout","contextPostId","contextPostType","hasAlreadyRendered","useHasRecursion","handleSelectTagName","Fragment","RecursionProvider","uniqueId"],"sources":["@wordpress/block-library/src/post-content/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tRecursionProvider,\n\tuseHasRecursion,\n\tWarning,\n\tprivateApis as blockEditorPrivateApis,\n\t__experimentalUseBlockPreview as useBlockPreview,\n} from '@wordpress/block-editor';\nimport { parse } from '@wordpress/blocks';\nimport {\n\tuseEntityProp,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useCanEditEntity } from '../utils/hooks';\nimport { unlock } from '../lock-unlock';\n\nconst { HTMLElementControl } = unlock( blockEditorPrivateApis );\n\nfunction ReadOnlyContent( {\n\tparentLayout,\n\tlayoutClassNames,\n\tuserCanEdit,\n\tpostType,\n\tpostId,\n\ttagName: TagName = 'div',\n} ) {\n\tconst [ , , content ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'content',\n\t\tpostId\n\t);\n\tconst blockProps = useBlockProps( { className: layoutClassNames } );\n\tconst blocks = useMemo( () => {\n\t\treturn content?.raw ? parse( content.raw ) : [];\n\t}, [ content?.raw ] );\n\tconst blockPreviewProps = useBlockPreview( {\n\t\tblocks,\n\t\tprops: blockProps,\n\t\tlayout: parentLayout,\n\t} );\n\n\tif ( userCanEdit ) {\n\t\t/*\n\t\t * Rendering the block preview using the raw content blocks allows for\n\t\t * block support styles to be generated and applied by the editor.\n\t\t *\n\t\t * The preview using the raw blocks can only be presented to users with\n\t\t * edit permissions for the post to prevent potential exposure of private\n\t\t * block content.\n\t\t */\n\t\treturn <div { ...blockPreviewProps }></div>;\n\t}\n\n\treturn content?.protected ? (\n\t\t<TagName { ...blockProps }>\n\t\t\t<Warning>{ __( 'This content is password protected.' ) }</Warning>\n\t\t</TagName>\n\t) : (\n\t\t<TagName\n\t\t\t{ ...blockProps }\n\t\t\tdangerouslySetInnerHTML={ { __html: content?.rendered } }\n\t\t></TagName>\n\t);\n}\n\nfunction EditableContent( { context = {}, tagName: TagName = 'div' } ) {\n\tconst { postType, postId } = context;\n\n\tconst [ blocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpostType,\n\t\t{ id: postId }\n\t);\n\n\tconst entityRecord = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst hasInnerBlocks = !! entityRecord?.content?.raw || blocks?.length;\n\n\tconst initialInnerBlocks = [ [ 'core/paragraph' ] ];\n\n\tconst props = useInnerBlocksProps(\n\t\tuseBlockProps( { className: 'entry-content' } ),\n\t\t{\n\t\t\tvalue: blocks,\n\t\t\tonInput,\n\t\t\tonChange,\n\t\t\ttemplate: ! hasInnerBlocks ? initialInnerBlocks : undefined,\n\t\t}\n\t);\n\treturn <TagName { ...props } />;\n}\n\nfunction Content( props ) {\n\tconst {\n\t\tcontext: { queryId, postType, postId } = {},\n\t\tlayoutClassNames,\n\t\ttagName,\n\t} = props;\n\tconst userCanEdit = useCanEditEntity( 'postType', postType, postId );\n\tif ( userCanEdit === undefined ) {\n\t\treturn null;\n\t}\n\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst isEditable = userCanEdit && ! isDescendentOfQueryLoop;\n\n\treturn isEditable ? (\n\t\t<EditableContent { ...props } />\n\t) : (\n\t\t<ReadOnlyContent\n\t\t\tparentLayout={ props.parentLayout }\n\t\t\tlayoutClassNames={ layoutClassNames }\n\t\t\tuserCanEdit={ userCanEdit }\n\t\t\tpostType={ postType }\n\t\t\tpostId={ postId }\n\t\t\ttagName={ tagName }\n\t\t/>\n\t);\n}\n\nfunction Placeholder( { layoutClassNames } ) {\n\tconst blockProps = useBlockProps( { className: layoutClassNames } );\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'This is the Content block, it will display all the blocks in any single post or page.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'That might be a simple arrangement like consecutive paragraphs in a blog post, or a more elaborate composition that includes image galleries, videos, tables, columns, and any other block types.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t{ __(\n\t\t\t\t\t'If there are any Custom Post Types registered at your site, the Content block can display the contents of those entries as well.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t</div>\n\t);\n}\n\nfunction RecursionError() {\n\tconst blockProps = useBlockProps();\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t<Warning>\n\t\t\t\t{ __( 'Block cannot be rendered inside itself.' ) }\n\t\t\t</Warning>\n\t\t</div>\n\t);\n}\n\n/**\n * Render inspector controls for the PostContent block.\n *\n * @param {Object} props Component props.\n * @param {string} props.tagName The HTML tag name.\n * @param {Function} props.onSelectTagName onChange function for the SelectControl.\n * @param {string} props.clientId The client ID of the current block.\n *\n * @return {JSX.Element} The control group.\n */\nfunction PostContentEditControls( { tagName, onSelectTagName, clientId } ) {\n\treturn (\n\t\t<InspectorControls group=\"advanced\">\n\t\t\t<HTMLElementControl\n\t\t\t\ttagName={ tagName }\n\t\t\t\tonChange={ onSelectTagName }\n\t\t\t\tclientId={ clientId }\n\t\t\t\toptions={ [\n\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t{ label: '<article>', value: 'article' },\n\t\t\t\t] }\n\t\t\t/>\n\t\t</InspectorControls>\n\t);\n}\n\nexport default function PostContentEdit( {\n\tcontext,\n\tattributes: { tagName = 'div' },\n\tsetAttributes,\n\tclientId,\n\t__unstableLayoutClassNames: layoutClassNames,\n\t__unstableParentLayout: parentLayout,\n} ) {\n\tconst { postId: contextPostId, postType: contextPostType } = context;\n\tconst hasAlreadyRendered = useHasRecursion( contextPostId );\n\n\tif ( contextPostId && contextPostType && hasAlreadyRendered ) {\n\t\treturn <RecursionError />;\n\t}\n\n\tconst handleSelectTagName = ( value ) => {\n\t\tsetAttributes( { tagName: value } );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<PostContentEditControls\n\t\t\t\ttagName={ tagName }\n\t\t\t\tonSelectTagName={ handleSelectTagName }\n\t\t\t\tclientId={ clientId }\n\t\t\t/>\n\t\t\t<RecursionProvider uniqueId={ contextPostId }>\n\t\t\t\t{ contextPostId && contextPostType ? (\n\t\t\t\t\t<Content\n\t\t\t\t\t\tcontext={ context }\n\t\t\t\t\t\tparentLayout={ parentLayout }\n\t\t\t\t\t\tlayoutClassNames={ layoutClassNames }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<Placeholder layoutClassNames={ layoutClassNames } />\n\t\t\t\t) }\n\t\t\t</RecursionProvider>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAUA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAKA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAAwC,IAAAQ,WAAA,GAAAR,OAAA;AA3BxC;AACA;AACA;;AAqBA;AACA;AACA;;AAIA,MAAM;EAAES;AAAmB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAE/D,SAASC,eAAeA,CAAE;EACzBC,YAAY;EACZC,gBAAgB;EAChBC,WAAW;EACXC,QA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oBAAO,IAAA3E,WAAA,CAAAyB,GAAA,EAACmC,cAAc,IAAE,CAAC;EAC1B;EAEA,MAAMiB,mBAAmB,GAAK7B,KAAK,IAAM;IACxCsB,aAAa,CAAE;MAAE5D,OAAO,EAAEsC;IAAM,CAAE,CAAC;EACpC,CAAC;EAED,oBACC,IAAAhD,WAAA,CAAA2D,IAAA,EAAA3D,WAAA,CAAA8E,QAAA;IAAAnD,QAAA,gBACC,IAAA3B,WAAA,CAAAyB,GAAA,EAACoC,uBAAuB;MACvBnD,OAAO,EAAGA,OAAS;MACnBoD,eAAe,EAAGe,mBAAqB;MACvCd,QAAQ,EAAGA;IAAU,CACrB,CAAC,eACF,IAAA/D,WAAA,CAAAyB,GAAA,EAAChC,YAAA,CAAAsF,iBAAiB;MAACC,QAAQ,EAAGP,aAAe;MAAA9C,QAAA,EAC1C8C,aAAa,IAAIC,eAAe,gBACjC,IAAA1E,WAAA,CAAAyB,GAAA,EAAC0B,OAAO;QACPjB,OAAO,EAAGA,OAAS;QACnB7B,YAAY,EAAGA,YAAc;QAC7BC,gBAAgB,EAAGA;MAAkB,CACrC,CAAC,gBAEF,IAAAN,WAAA,CAAAyB,GAAA,EAACiC,WAAW;QAACpD,gBAAgB,EAAGA;MAAkB,CAAE;IACpD,CACiB,CAAC;EAAA,CACnB,CAAC;AAEL","ignoreList":[]}
@@ -23,6 +23,12 @@ const metadata = exports.metadata = {
23
23
  description: "Displays the contents of a post or page.",
24
24
  textdomain: "default",
25
25
  usesContext: ["postId", "postType", "queryId"],
26
+ attributes: {
27
+ tagName: {
28
+ type: "string",
29
+ "default": "div"
30
+ }
31
+ },
26
32
  example: {
27
33
  viewportWidth: 350
28
34
  },
@@ -1 +1 @@
1
- {"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","usesContext","example","viewportWidth","supports","align","html","layout","background","backgroundImage","backgroundSize","__experimentalDefaultControls","dimensions","minHeight","spacing","blockGap","padding","margin","color","gradients","heading","link","text","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalBorder","radius","width","style","editorStyle","settings","icon","edit","init","initBlock"],"sources":["@wordpress/block-library/src/post-content/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postContent as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AAVA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAI,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,WAAA;EAAAC,OAAA;IAAAC,aAAA;EAAA;EAAAC,QAAA;IAAAC,KAAA;IAAAC,IAAA;IAAAC,MAAA;IAAAC,UAAA;MAAAC,eAAA;MAAAC,cAAA;MAAAC,6BAAA;QAAAF,eAAA;MAAA;IAAA;IAAAG,UAAA;MAAAC,SAAA;IAAA;IAAAC,OAAA;MAAAC,QAAA;MAAAC,OAAA;MAAAC,MAAA;MAAAN,6BAAA;QAAAM,MAAA;QAAAD,OAAA;MAAA;IAAA;IAAAE,KAAA;MAAAC,SAAA;MAAAC,OAAA;MAAAC,IAAA;MAAAV,6BAAA;QAAAH,UAAA;QAAAc,IAAA;MAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAApB,6BAAA;QAAAa,QAAA;MAAA;IAAA;IAAAQ,oBAAA;MAAAC,MAAA;MAAAf,KAAA;MAAAgB,KAAA;MAAAC,KAAA;MAAAxB,6BAAA;QAAAsB,MAAA;QAAAf,KAAA;QAAAgB,KAAA;QAAAC,KAAA;MAAA;IAAA;EAAA;EAAAA,KAAA;EAAAC,WAAA;AAAA;AAOA,MAAM;EAAExC;AAAK,CAAC,GAAGJ,QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAGnB,MAAMyC,QAAQ,GAAA5C,OAAA,CAAA4C,QAAA,GAAG;EACvBC,IAAI,EAAJA,kBAAI;EACJC,IAAI,EAAJA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAE7C,IAAI;EAAEJ,QAAQ;EAAE6C;AAAS,CAAE,CAAC;AAAC5C,OAAA,CAAA+C,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","usesContext","attributes","tagName","type","example","viewportWidth","supports","align","html","layout","background","backgroundImage","backgroundSize","__experimentalDefaultControls","dimensions","minHeight","spacing","blockGap","padding","margin","color","gradients","heading","link","text","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalBorder","radius","width","style","editorStyle","settings","icon","edit","init","initBlock"],"sources":["@wordpress/block-library/src/post-content/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postContent as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\ted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QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAGnB,MAAM4C,QAAQ,GAAA/C,OAAA,CAAA+C,QAAA,GAAG;EACvBC,IAAI,EAAJA,kBAAI;EACJC,IAAI,EAAJA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAEhD,IAAI;EAAEJ,QAAQ;EAAEgD;AAAS,CAAE,CAAC;AAAC/C,OAAA,CAAAkD,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -6,12 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = SeparatorEdit;
8
8
  var _clsx = _interopRequireDefault(require("clsx"));
9
- var _components = require("@wordpress/components");
10
9
  var _blockEditor = require("@wordpress/block-editor");
11
- var _element = require("@wordpress/element");
10
+ var _components = require("@wordpress/components");
12
11
  var _i18n = require("@wordpress/i18n");
13
12
  var _useDeprecatedOpacity = _interopRequireDefault(require("./use-deprecated-opacity"));
14
- var _hooks = require("../utils/hooks");
15
13
  var _jsxRuntime = require("react/jsx-runtime");
16
14
  /**
17
15
  * External dependencies
@@ -60,7 +58,6 @@ function SeparatorEdit({
60
58
  const colorProps = (0, _blockEditor.__experimentalUseColorProps)(attributes);
61
59
  const currentColor = colorProps?.style?.backgroundColor;
62
60
  const hasCustomColor = !!style?.color?.background;
63
- const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
64
61
  (0, _useDeprecatedOpacity.default)(opacity, currentColor, setAttributes);
65
62
 
66
63
  // The dots styles uses text for the dots, to change those dots color is
@@ -79,32 +76,10 @@ function SeparatorEdit({
79
76
  const Wrapper = tagName === 'hr' ? _components.HorizontalRule : tagName;
80
77
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
81
78
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
82
- children: _element.Platform.isNative ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.PanelBody, {
83
- title: (0, _i18n.__)('Settings'),
84
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(HtmlElementControl, {
85
- tagName: tagName,
86
- setAttributes: setAttributes
87
- })
88
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanel, {
89
- label: (0, _i18n.__)('Settings'),
90
- resetAll: () => {
91
- setAttributes({
92
- tagName: 'hr'
93
- });
94
- },
95
- dropdownMenuProps: dropdownMenuProps,
96
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
97
- hasValue: () => tagName !== 'hr',
98
- label: (0, _i18n.__)('HTML element'),
99
- onDeselect: () => setAttributes({
100
- tagName: 'hr'
101
- }),
102
- isShownByDefault: true,
103
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(HtmlElementControl, {
104
- tagName: tagName,
105
- setAttributes: setAttributes
106
- })
107
- })
79
+ group: "advanced",
80
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(HtmlElementControl, {
81
+ tagName: tagName,
82
+ setAttributes: setAttributes
108
83
  })
109
84
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapper, {
110
85
  ...(0, _blockEditor.useBlockProps)({
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_blockEditor","_element","_i18n","_useDeprecatedOpacity","_hooks","_jsxRuntime","HtmlElementControl","tagName","setAttributes","jsx","SelectControl","label","__","value","onChange","newValue","options","help","__next40pxDefaultSize","__nextHasNoMarginBottom","SeparatorEdit","attributes","backgroundColor","opacity","style","colorProps","useColorProps","currentColor","hasCustomColor","color","background","dropdownMenuProps","useToolsPanelDropdownMenuProps","useDeprecatedOpacity","colorClass","getColorClassName","className","clsx","styles","Wrapper","HorizontalRule","jsxs","Fragment","children","InspectorControls","Platform","isNative","PanelBody","title","__experimentalToolsPanel","resetAll","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","useBlockProps","undefined"],"sources":["@wordpress/block-library/src/separator/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tHorizontalRule,\n\tSelectControl,\n\tPanelBody,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport {\n\tuseBlockProps,\n\tgetColorClassName,\n\t__experimentalUseColorProps as useColorProps,\n\tInspectorControls,\n} from '@wordpress/block-editor';\nimport { Platform } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useDeprecatedOpacity from './use-deprecated-opacity';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst HtmlElementControl = ( { tagName, setAttributes } ) => {\n\treturn (\n\t\t<SelectControl\n\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\tvalue={ tagName }\n\t\t\tonChange={ ( newValue ) => setAttributes( { tagName: newValue } ) }\n\t\t\toptions={ [\n\t\t\t\t{ label: __( 'Default (<hr>)' ), value: 'hr' },\n\t\t\t\t{ label: '<div>', value: 'div' },\n\t\t\t] }\n\t\t\thelp={\n\t\t\t\ttagName === 'hr'\n\t\t\t\t\t? __(\n\t\t\t\t\t\t\t'Only select <hr> if the separator conveys important information and should be announced by screen readers.'\n\t\t\t\t\t )\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'The <div> element should only be used if the block is a design element with no semantic meaning.'\n\t\t\t\t\t )\n\t\t\t}\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t/>\n\t);\n};\n\nexport default function SeparatorEdit( { attributes, setAttributes } ) {\n\tconst { backgroundColor, opacity, style, tagName } = attributes;\n\tconst colorProps = useColorProps( attributes );\n\tconst currentColor = colorProps?.style?.backgroundColor;\n\tconst hasCustomColor = !! style?.color?.background;\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tuseDeprecatedOpacity( opacity, currentColor, setAttributes );\n\n\t// The dots styles uses text for the dots, to change those dots color is\n\t// using color, not backgroundColor.\n\tconst colorClass = getColorClassName( 'color', backgroundColor );\n\n\tconst className = clsx(\n\t\t{\n\t\t\t'has-text-color': backgroundColor || currentColor,\n\t\t\t[ colorClass ]: colorClass,\n\t\t\t'has-css-opacity': opacity === 'css',\n\t\t\t'has-alpha-channel-opacity': opacity === 'alpha-channel',\n\t\t},\n\t\tcolorProps.className\n\t);\n\n\tconst styles = {\n\t\tcolor: currentColor,\n\t\tbackgroundColor: currentColor,\n\t};\n\tconst Wrapper = tagName === 'hr' ? HorizontalRule : tagName;\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t{ Platform.isNative ? (\n\t\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t\t<HtmlElementControl\n\t\t\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) : (\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tsetAttributes( { tagName: 'hr' } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => tagName !== 'hr' }\n\t\t\t\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { tagName: 'hr' } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<HtmlElementControl\n\t\t\t\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\t\t/>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C,QAAE,EAAE,UAAW,CAAG;QAAA+B,QAAA,eACpC,IAAAtC,WAAA,CAAAI,GAAA,EAACH,kBAAkB;UAClBC,OAAO,EAAGA,OAAS;UACnBC,aAAa,EAAGA;QAAe,CAC/B;MAAC,CACQ,CAAC,gBAEZ,IAAAH,WAAA,CAAAI,GAAA,EAACV,WAAA,CAAAkD,wBAAU;QACVtC,KAAK,EAAG,IAAAC,QAAE,EAAE,UAAW,CAAG;QAC1BsC,QAAQ,EAAGA,CAAA,KAAM;UAChB1C,aAAa,CAAE;YAAED,OAAO,EAAE;UAAK,CAAE,CAAC;QACnC,CAAG;QACHwB,iBAAiB,EAAGA,iBAAmB;QAAAY,QAAA,eAEvC,IAAAtC,WAAA,CAAAI,GAAA,EAACV,WAAA,CAAAoD,4BAAc;UACdC,QAAQ,EAAGA,CAAA,KAAM7C,OAAO,KAAK,IAAM;UACnCI,KAAK,EAAG,IAAAC,QAAE,EAAE,cAAe,CAAG;UAC9ByC,UAAU,EAAGA,CAAA,KACZ7C,aAAa,CAAE;YAAED,OAAO,EAAE;UAAK,CAAE,CACjC;UACD+C,gBAAgB;UAAAX,QAAA,eAEhB,IAAAtC,WAAA,CAAAI,GAAA,EAACH,kBAAkB;YAClBC,OAAO,EAAGA,OAAS;YACnBC,aAAa,EAAGA;UAAe,CAC/B;QAAC,CACa;MAAC,CACN;IACZ,CACiB,CAAC,eACpB,IAAAH,WAAA,CAAAI,GAAA,EAAC8B,OAAO;MAAA,GACF,IAAAgB,0BAAa,EAAE;QACnBnB,SAAS;QACTZ,KAAK,EAAEI,cAAc,GAAGU,MAAM,GAAGkB;MAClC,CAAE;IAAC,CACH,CAAC;EAAA,CACD,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_components","_i18n","_useDeprecatedOpacity","_jsxRuntime","HtmlElementControl","tagName","setAttributes","jsx","SelectControl","label","__","value","onChange","newValue","options","help","__next40pxDefaultSize","__nextHasNoMarginBottom","SeparatorEdit","attributes","backgroundColor","opacity","style","colorProps","useColorProps","currentColor","hasCustomColor","color","background","useDeprecatedOpacity","colorClass","getColorClassName","className","clsx","styles","Wrapper","HorizontalRule","jsxs","Fragment","children","InspectorControls","group","useBlockProps","undefined"],"sources":["@wordpress/block-library/src/separator/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tgetColorClassName,\n\tInspectorControls,\n\tuseBlockProps,\n\t__experimentalUseColorProps as useColorProps,\n} from '@wordpress/block-editor';\nimport { HorizontalRule, SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useDeprecatedOpacity from './use-deprecated-opacity';\n\nconst HtmlElementControl = ( { tagName, setAttributes } ) => {\n\treturn (\n\t\t<SelectControl\n\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\tvalue={ tagName }\n\t\t\tonChange={ ( newValue ) => setAttributes( { tagName: newValue } ) }\n\t\t\toptions={ [\n\t\t\t\t{ label: __( 'Default (<hr>)' ), value: 'hr' },\n\t\t\t\t{ label: '<div>', value: 'div' },\n\t\t\t] }\n\t\t\thelp={\n\t\t\t\ttagName === 'hr'\n\t\t\t\t\t? __(\n\t\t\t\t\t\t\t'Only select <hr> if the separator conveys important information and should be announced by screen readers.'\n\t\t\t\t\t )\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'The <div> element should only be used if the block is a design element with no semantic meaning.'\n\t\t\t\t\t )\n\t\t\t}\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t/>\n\t);\n};\n\nexport default function SeparatorEdit( { attributes, setAttributes } ) {\n\tconst { backgroundColor, opacity, style, tagName } = attributes;\n\tconst colorProps = useColorProps( attributes );\n\tconst currentColor = colorProps?.style?.backgroundColor;\n\tconst hasCustomColor = !! style?.color?.background;\n\n\tuseDeprecatedOpacity( opacity, currentColor, setAttributes );\n\n\t// The dots styles uses text for the dots, to change those dots color is\n\t// using color, not backgroundColor.\n\tconst colorClass = getColorClassName( 'color', backgroundColor );\n\n\tconst className = clsx(\n\t\t{\n\t\t\t'has-text-color': backgroundColor || currentColor,\n\t\t\t[ colorClass ]: colorClass,\n\t\t\t'has-css-opacity': opacity === 'css',\n\t\t\t'has-alpha-channel-opacity': opacity === 'alpha-channel',\n\t\t},\n\t\tcolorProps.className\n\t);\n\n\tconst styles = {\n\t\tcolor: currentColor,\n\t\tbackgroundColor: currentColor,\n\t};\n\tconst Wrapper = tagName === 'hr' ? HorizontalRule : tagName;\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<HtmlElementControl\n\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<Wrapper\n\t\t\t\t{ ...useBlockProps( {\n\t\t\t\t\tclassName,\n\t\t\t\t\tstyle: hasCustomColor ? styles : undefined,\n\t\t\t\t} ) }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,qBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAA4D,IAAAK,WAAA,GAAAL,OAAA;AApB5D;AACA;AACA;;AAGA;AACA;AACA;;AAUA;AACA;AACA;;AAGA,MAAMM,kBAAkB,GAAGA,CAAE;EAAEC,OAAO;EAAEC;AAAc,CAAC,KAAM;EAC5D,oBACC,IAAAH,WAAA,CAAAI,GAAA,EAACP,WAAA,CAAAQ,aAAa;IACbC,KAAK,EAAG,IAAAC,QAAE,EAAE,cAAe,CAAG;IAC9BC,KAAK,EAAGN,OAAS;IACjBO,QAAQ,EAAKC,QAAQ,IAAMP,aAAa,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,KAAK,IAAI,GAAG+B,0BAAc,GAAG/B,OAAO;EAE3D,oBACC,IAAAF,WAAA,CAAAkC,IAAA,EAAAlC,WAAA,CAAAmC,QAAA;IAAAC,QAAA,gBACC,IAAApC,WAAA,CAAAI,GAAA,EAACR,YAAA,CAAAyC,iBAAiB;MAACC,KAAK,EAAC,UAAU;MAAAF,QAAA,eAClC,IAAApC,WAAA,CAAAI,GAAA,EAACH,kBAAkB;QAClBC,OAAO,EAAGA,OAAS;QACnBC,aAAa,EAAGA;MAAe,CAC/B;IAAC,CACgB,CAAC,eACpB,IAAAH,WAAA,CAAAI,GAAA,EAAC4B,OAAO;MAAA,GACF,IAAAO,0BAAa,EAAE;QACnBV,SAAS;QACTV,KAAK,EAAEI,cAAc,GAAGQ,MAAM,GAAGS;MAClC,CAAE;IAAC,CACH,CAAC;EAAA,CACD,CAAC;AAEL","ignoreList":[]}
@@ -18,7 +18,7 @@ const metadata = exports.metadata = {
18
18
  name: "core/site-tagline",
19
19
  title: "Site Tagline",
20
20
  category: "theme",
21
- description: "Describe in a few words what the site is about. The tagline can be used in search results or when sharing on social networks even if it\u2019s not displayed in the theme design.",
21
+ description: "Describe in a few words what this site is about. This is important for search results, sharing on social media, and gives overall clarity to visitors.",
22
22
  keywords: ["description"],
23
23
  textdomain: "default",
24
24
  attributes: {
@@ -11,7 +11,6 @@ var _components = require("@wordpress/components");
11
11
  var _blockEditor = require("@wordpress/block-editor");
12
12
  var _element = require("@wordpress/element");
13
13
  var _i18n = require("@wordpress/i18n");
14
- var _compose = require("@wordpress/compose");
15
14
  var _data = require("@wordpress/data");
16
15
  var _icons = require("@wordpress/icons");
17
16
  var _notices = require("@wordpress/notices");
@@ -44,7 +43,6 @@ function VideoEdit({
44
43
  insertBlocksAfter,
45
44
  onReplace
46
45
  }) {
47
- const instanceId = (0, _compose.useInstanceId)(VideoEdit);
48
46
  const videoPlayer = (0, _element.useRef)();
49
47
  const {
50
48
  id,
@@ -197,7 +195,7 @@ function VideoEdit({
197
195
  muted: false,
198
196
  playsInline: false,
199
197
  preload: 'metadata',
200
- poster: ''
198
+ poster: undefined
201
199
  });
202
200
  },
203
201
  dropdownMenuProps: dropdownMenuProps,
@@ -206,8 +204,7 @@ function VideoEdit({
206
204
  attributes: attributes
207
205
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_posterImage.default, {
208
206
  poster: poster,
209
- setAttributes: setAttributes,
210
- instanceId: instanceId
207
+ setAttributes: setAttributes
211
208
  })]
212
209
  })
213
210
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("figure", {