@wordpress/block-library 6.0.11 → 6.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cover/edit.js +1 -0
- package/build/cover/edit.js.map +1 -1
- package/build/gallery/deprecated.js +314 -26
- package/build/gallery/deprecated.js.map +1 -1
- package/build/gallery/edit-wrapper.js +10 -27
- package/build/gallery/edit-wrapper.js.map +1 -1
- package/build/gallery/edit.js +10 -12
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/save.js +3 -3
- package/build/gallery/save.js.map +1 -1
- package/build/gallery/shared.js +24 -0
- package/build/gallery/shared.js.map +1 -1
- package/build/gallery/transforms.js +8 -22
- package/build/gallery/transforms.js.map +1 -1
- package/build/gallery/use-mobile-warning.js +1 -1
- package/build/gallery/use-mobile-warning.js.map +1 -1
- package/build/gallery/v1/edit.js +2 -21
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/navigation/edit/index.js +1 -0
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +0 -4
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation-submenu/edit.js +4 -0
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/query-pagination/index.js +1 -1
- package/build/query-pagination-next/index.js +1 -1
- package/build/query-pagination-numbers/index.js +1 -1
- package/build/query-pagination-previous/index.js +1 -1
- package/build/separator/separator-settings.js +1 -0
- package/build/separator/separator-settings.js.map +1 -1
- package/build/social-links/edit.js +1 -0
- package/build/social-links/edit.js.map +1 -1
- package/build-module/cover/edit.js +1 -0
- package/build-module/cover/edit.js.map +1 -1
- package/build-module/gallery/deprecated.js +309 -27
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/gallery/edit-wrapper.js +7 -27
- package/build-module/gallery/edit-wrapper.js.map +1 -1
- package/build-module/gallery/edit.js +10 -12
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/save.js +2 -3
- package/build-module/gallery/save.js.map +1 -1
- package/build-module/gallery/shared.js +22 -0
- package/build-module/gallery/shared.js.map +1 -1
- package/build-module/gallery/transforms.js +9 -21
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/gallery/use-mobile-warning.js +1 -1
- package/build-module/gallery/use-mobile-warning.js.map +1 -1
- package/build-module/gallery/v1/edit.js +4 -22
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/navigation/edit/index.js +1 -0
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +0 -4
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +4 -0
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/query-pagination/index.js +1 -1
- package/build-module/query-pagination-next/index.js +1 -1
- package/build-module/query-pagination-numbers/index.js +1 -1
- package/build-module/query-pagination-previous/index.js +1 -1
- package/build-module/separator/separator-settings.js +1 -0
- package/build-module/separator/separator-settings.js.map +1 -1
- package/build-module/social-links/edit.js +1 -0
- package/build-module/social-links/edit.js.map +1 -1
- package/build-style/columns/editor-rtl.css +1 -1
- package/build-style/columns/editor.css +1 -1
- package/build-style/editor-rtl.css +1 -1
- package/build-style/editor.css +1 -1
- package/build-style/navigation/style-rtl.css +4 -1
- package/build-style/navigation/style.css +4 -1
- package/build-style/style-rtl.css +4 -1
- package/build-style/style.css +4 -1
- package/package.json +8 -8
- package/src/columns/editor.scss +3 -2
- package/src/cover/edit.js +1 -0
- package/src/gallery/deprecated.js +831 -559
- package/src/gallery/edit-wrapper.js +7 -27
- package/src/gallery/edit.js +10 -12
- package/src/gallery/save.js +2 -1
- package/src/gallery/shared.js +24 -0
- package/src/gallery/transforms.js +9 -27
- package/src/gallery/use-mobile-warning.js +1 -1
- package/src/gallery/v1/edit.js +1 -28
- package/src/navigation/edit/index.js +1 -0
- package/src/navigation/edit/inner-blocks.js +0 -5
- package/src/navigation/index.php +149 -18
- package/src/navigation/style.scss +4 -1
- package/src/navigation-submenu/edit.js +6 -0
- package/src/navigation-submenu/index.php +30 -45
- package/src/page-list/index.php +5 -9
- package/src/query-pagination/block.json +1 -1
- package/src/query-pagination-next/block.json +1 -1
- package/src/query-pagination-numbers/block.json +1 -1
- package/src/query-pagination-previous/block.json +1 -1
- package/src/separator/separator-settings.js +1 -0
- package/src/social-links/edit.js +1 -0
- package/src/template-part/index.php +36 -0
- package/build/gallery/v1/update-gallery-modal.js +0 -114
- package/build/gallery/v1/update-gallery-modal.js.map +0 -1
- package/build-module/gallery/v1/update-gallery-modal.js +0 -97
- package/build-module/gallery/v1/update-gallery-modal.js.map +0 -1
- package/src/gallery/v1/update-gallery-modal.js +0 -97
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/navigation-submenu/edit.js"],"names":["classnames","escape","pull","useSelect","useDispatch","PanelBody","Popover","TextControl","TextareaControl","ToolbarButton","ToolbarGroup","displayShortcut","isKeyboardEvent","__","sprintf","BlockControls","InnerBlocks","useInnerBlocksProps","InspectorControls","RichText","__experimentalLinkControl","LinkControl","useBlockProps","store","blockEditorStore","getColorClassName","isURL","prependHTTP","safeDecodeURI","Fragment","useState","useEffect","useRef","createInterpolateElement","placeCaretAtHorizontalEdge","link","linkIcon","coreStore","speak","ItemSubmenuIcon","ALLOWED_BLOCKS","DEFAULT_BLOCK","MAX_NESTING","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener","getSuggestionsQuery","type","kind","subtype","getColors","context","isSubMenu","textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","style","colors","color","text","background","updateNavigationLinkBlockAttributes","updatedValue","setAttributes","blockAttributes","label","originalLabel","originalKind","originalType","title","url","opensInNewTab","id","newKind","newType","normalizedTitle","replace","normalizedURL","escapeTitle","isBuiltInType","indexOf","isCustomLink","encodeURI","undefined","Number","isInteger","NavigationSubmenuEdit","attributes","isSelected","mergeBlocks","onReplace","clientId","description","rel","showSubmenuIcon","openSubmenusOnClick","saveEntityRecord","__unstableMarkNextChangeAsNotPersistent","isLinkOpen","setIsLinkOpen","listItemRef","itemLabelPlaceholder","ref","isAtMaxNesting","isTopLevelItem","isParentOfSelectedBlock","isImmediateParentOfSelectedBlock","hasDescendants","selectedBlockHasDescendants","userCanCreatePages","userCanCreatePosts","select","getClientIdsOfDescendants","hasSelectedInnerBlock","getSelectedBlockClientId","getBlockParentsByBlockName","selectedBlockId","descendants","length","name","canUser","test","selectLabelText","focus","defaultView","selection","getSelection","range","createRange","selectNodeContents","removeAllRanges","addRange","userCanCreate","handleCreate","pageTitle","postType","page","status","rendered","onKeyDown","primary","blockProps","className","innerBlocksColors","innerBlocksProps","allowedBlocks","__experimentalDefaultBlock","__experimentalDirectInsert","renderAppender","DefaultAppender","ParentElement","descriptionValue","titleValue","relValue","labelValue","searchTerm","format","mark"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,SAASC,MAAT,EAAiBC,IAAjB,QAA6B,QAA7B;AAEA;AACA;AACA;;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SACCC,SADD,EAECC,OAFD,EAGCC,WAHD,EAICC,eAJD,EAKCC,aALD,EAMCC,YAND,QAOO,uBAPP;AAQA,SAASC,eAAT,EAA0BC,eAA1B,QAAiD,qBAAjD;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SACCC,aADD,EAECC,WAFD,EAGCC,mBAHD,EAICC,iBAJD,EAKCC,QALD,EAMCC,yBAAyB,IAAIC,WAN9B,EAOCC,aAPD,EAQCC,KAAK,IAAIC,gBARV,EASCC,iBATD,QAUO,yBAVP;AAWA,SAASC,KAAT,EAAgBC,WAAhB,EAA6BC,aAA7B,QAAkD,gBAAlD;AACA,SACCC,QADD,EAECC,QAFD,EAGCC,S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CD,CADD;AA0IA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { escape, pull } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPanelBody,\n\tPopover,\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tInnerBlocks,\n\tuseInnerBlocksProps,\n\tInspectorControls,\n\tRichText,\n\t__experimentalLinkControl as LinkControl,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tgetColorClassName,\n} from '@wordpress/block-editor';\nimport { isURL, prependHTTP, safeDecodeURI } from '@wordpress/url';\nimport {\n\tFragment,\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport { placeCaretAtHorizontalEdge } from '@wordpress/dom';\nimport { link as linkIcon } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { ItemSubmenuIcon } from './icons';\nimport { name } from './block.json';\n\nconst ALLOWED_BLOCKS = [ 'core/navigation-link', 'core/navigation-submenu' ];\n\nconst DEFAULT_BLOCK = [ 'core/navigation-link' ];\n\nconst MAX_NESTING = 5;\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 * Given the Link block's type attribute, return the query params to give to\n * /wp/v2/search.\n *\n * @param {string} type Link block's type attribute.\n * @param {string} kind Link block's entity of kind (post-type|taxonomy)\n * @return {{ type?: string, subtype?: string }} Search query params.\n */\nfunction getSuggestionsQuery( type, kind ) {\n\tswitch ( type ) {\n\t\tcase 'post':\n\t\tcase 'page':\n\t\t\treturn { type: 'post', subtype: type };\n\t\tcase 'category':\n\t\t\treturn { type: 'term', subtype: 'category' };\n\t\tcase 'tag':\n\t\t\treturn { type: 'term', subtype: 'post_tag' };\n\t\tcase 'post_format':\n\t\t\treturn { type: 'post-format' };\n\t\tdefault:\n\t\t\tif ( kind === 'taxonomy' ) {\n\t\t\t\treturn { type: 'term', subtype: type };\n\t\t\t}\n\t\t\tif ( kind === 'post-type' ) {\n\t\t\t\treturn { type: 'post', subtype: type };\n\t\t\t}\n\t\t\treturn {};\n\t}\n}\n\n/**\n * Determine the colors for a menu.\n *\n * Order of priority is:\n * 1: Overlay custom colors (if submenu)\n * 2: Overlay theme colors (if submenu)\n * 3: Custom colors\n * 4: Theme colors\n * 5: Global styles\n *\n * @param {Object} context\n * @param {boolean} isSubMenu\n */\nfunction getColors( context, isSubMenu ) {\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t\toverlayTextColor,\n\t\tcustomOverlayTextColor,\n\t\toverlayBackgroundColor,\n\t\tcustomOverlayBackgroundColor,\n\t\tstyle,\n\t} = context;\n\n\tconst colors = {};\n\n\tif ( isSubMenu && !! customOverlayTextColor ) {\n\t\tcolors.customTextColor = customOverlayTextColor;\n\t} else if ( isSubMenu && !! overlayTextColor ) {\n\t\tcolors.textColor = overlayTextColor;\n\t} else if ( !! customTextColor ) {\n\t\tcolors.customTextColor = customTextColor;\n\t} else if ( !! textColor ) {\n\t\tcolors.textColor = textColor;\n\t} else if ( !! style?.color?.text ) {\n\t\tcolors.customTextColor = style.color.text;\n\t}\n\n\tif ( isSubMenu && !! customOverlayBackgroundColor ) {\n\t\tcolors.customBackgroundColor = customOverlayBackgroundColor;\n\t} else if ( isSubMenu && !! overlayBackgroundColor ) {\n\t\tcolors.backgroundColor = overlayBackgroundColor;\n\t} else if ( !! customBackgroundColor ) {\n\t\tcolors.customBackgroundColor = customBackgroundColor;\n\t} else if ( !! backgroundColor ) {\n\t\tcolors.backgroundColor = backgroundColor;\n\t} else if ( !! style?.color?.background ) {\n\t\tcolors.customTextColor = style.color.background;\n\t}\n\n\treturn colors;\n}\n\n/**\n * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind\n */\n\n/**\n * Navigation Link Block Attributes\n *\n * @typedef {Object} WPNavigationLinkBlockAttributes\n *\n * @property {string} [label] Link text.\n * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status.\n * @property {string} [type] The type such as post, page, tag, category and other custom types.\n * @property {string} [rel] The relationship of the linked URL.\n * @property {number} [id] A post or term id.\n * @property {boolean} [opensInNewTab] Sets link target to _blank when true.\n * @property {string} [url] Link href.\n * @property {string} [title] Link title attribute.\n */\n\n/**\n * Link Control onChange handler that updates block attributes when a setting is changed.\n *\n * @param {Object} updatedValue New block attributes to update.\n * @param {Function} setAttributes Block attribute update function.\n * @param {WPNavigationLinkBlockAttributes} blockAttributes Current block attributes.\n *\n */\nexport const updateNavigationLinkBlockAttributes = (\n\tupdatedValue = {},\n\tsetAttributes,\n\tblockAttributes = {}\n) => {\n\tconst {\n\t\tlabel: originalLabel = '',\n\t\tkind: originalKind = '',\n\t\ttype: originalType = '',\n\t} = blockAttributes;\n\tconst {\n\t\ttitle = '',\n\t\turl = '',\n\t\topensInNewTab,\n\t\tid,\n\t\tkind: newKind = originalKind,\n\t\ttype: newType = originalType,\n\t} = updatedValue;\n\n\tconst normalizedTitle = title.replace( /http(s?):\\/\\//gi, '' );\n\tconst normalizedURL = url.replace( /http(s?):\\/\\//gi, '' );\n\tconst escapeTitle =\n\t\ttitle !== '' &&\n\t\tnormalizedTitle !== normalizedURL &&\n\t\toriginalLabel !== title;\n\tconst label = escapeTitle\n\t\t? escape( title )\n\t\t: originalLabel || escape( normalizedURL );\n\n\t// In https://github.com/WordPress/gutenberg/pull/24670 we decided to use \"tag\" in favor of \"post_tag\"\n\tconst type = newType === 'post_tag' ? 'tag' : newType.replace( '-', '_' );\n\n\tconst isBuiltInType =\n\t\t[ 'post', 'page', 'tag', 'category' ].indexOf( type ) > -1;\n\n\tconst isCustomLink =\n\t\t( ! newKind && ! isBuiltInType ) || newKind === 'custom';\n\tconst kind = isCustomLink ? 'custom' : newKind;\n\n\tsetAttributes( {\n\t\t// Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.\n\t\t...( url && { url: encodeURI( safeDecodeURI( url ) ) } ),\n\t\t...( label && { label } ),\n\t\t...( undefined !== opensInNewTab && { opensInNewTab } ),\n\t\t...( id && Number.isInteger( id ) && { id } ),\n\t\t...( kind && { kind } ),\n\t\t...( type && type !== 'URL' && { type } ),\n\t} );\n};\n\nexport default function NavigationSubmenuEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tmergeBlocks,\n\tonReplace,\n\tcontext,\n\tclientId,\n} ) {\n\tconst {\n\t\tlabel,\n\t\ttype,\n\t\topensInNewTab,\n\t\turl,\n\t\tdescription,\n\t\trel,\n\t\ttitle,\n\t\tkind,\n\t} = attributes;\n\tconst link = {\n\t\turl,\n\t\topensInNewTab,\n\t};\n\tconst { showSubmenuIcon, openSubmenusOnClick } = context;\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { __unstableMarkNextChangeAsNotPersistent } = useDispatch(\n\t\tblockEditorStore\n\t);\n\tconst [ isLinkOpen, setIsLinkOpen ] = useState( false );\n\tconst listItemRef = useRef( null );\n\tconst isDraggingWithin = useIsDraggingWithin( listItemRef );\n\tconst itemLabelPlaceholder = __( 'Add text…' );\n\tconst ref = useRef();\n\n\tconst {\n\t\tisAtMaxNesting,\n\t\tisTopLevelItem,\n\t\tisParentOfSelectedBlock,\n\t\tisImmediateParentOfSelectedBlock,\n\t\thasDescendants,\n\t\tselectedBlockHasDescendants,\n\t\tuserCanCreatePages,\n\t\tuserCanCreatePosts,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetClientIdsOfDescendants,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst selectedBlockId = getSelectedBlockClientId();\n\n\t\t\tconst descendants = getClientIdsOfDescendants( [ clientId ] )\n\t\t\t\t.length;\n\n\t\t\treturn {\n\t\t\t\tisAtMaxNesting:\n\t\t\t\t\tgetBlockParentsByBlockName( clientId, name ).length >=\n\t\t\t\t\tMAX_NESTING,\n\t\t\t\tisTopLevelItem:\n\t\t\t\t\tgetBlockParentsByBlockName( clientId, name ).length === 0,\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\thasDescendants: !! descendants,\n\t\t\t\tselectedBlockHasDescendants: !! getClientIdsOfDescendants( [\n\t\t\t\t\tselectedBlockId,\n\t\t\t\t] )?.length,\n\t\t\t\tuserCanCreatePages: select( coreStore ).canUser(\n\t\t\t\t\t'create',\n\t\t\t\t\t'pages'\n\t\t\t\t),\n\t\t\t\tuserCanCreatePosts: select( coreStore ).canUser(\n\t\t\t\t\t'create',\n\t\t\t\t\t'posts'\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\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// Store the colors from context as attributes for rendering\n\tuseEffect( () => {\n\t\t// This side-effect should not create an undo level as those should\n\t\t// only be created via user interactions. Mark this change as\n\t\t// not persistent to avoid undo level creation.\n\t\t// See https://github.com/WordPress/gutenberg/issues/34564.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\tsetAttributes( { isTopLevelItem } );\n\t}, [ isTopLevelItem ] );\n\n\t/**\n\t * The hook shouldn't be necessary but due to a focus loss happening\n\t * when selecting a suggestion in the link popover, we force close on block unselection.\n\t */\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsLinkOpen( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\t// If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.\n\tuseEffect( () => {\n\t\tif ( isLinkOpen && url ) {\n\t\t\t// Does this look like a URL and have something TLD-ish?\n\t\t\tif (\n\t\t\t\tisURL( prependHTTP( label ) ) &&\n\t\t\t\t/^.+\\.[a-z]+/.test( label )\n\t\t\t) {\n\t\t\t\t// Focus and select the label text.\n\t\t\t\tselectLabelText();\n\t\t\t} else {\n\t\t\t\t// Focus it (but do not select).\n\t\t\t\tplaceCaretAtHorizontalEdge( ref.current, true );\n\t\t\t}\n\t\t}\n\t}, [ url ] );\n\n\t/**\n\t * Focus the Link label text and select it.\n\t */\n\tfunction selectLabelText() {\n\t\tref.current.focus();\n\t\tconst { ownerDocument } = ref.current;\n\t\tconst { defaultView } = ownerDocument;\n\t\tconst selection = defaultView.getSelection();\n\t\tconst range = ownerDocument.createRange();\n\t\t// Get the range of the current ref contents so we can add this range to the selection.\n\t\trange.selectNodeContents( ref.current );\n\t\tselection.removeAllRanges();\n\t\tselection.addRange( range );\n\t}\n\n\tlet userCanCreate = false;\n\tif ( ! type || type === 'page' ) {\n\t\tuserCanCreate = userCanCreatePages;\n\t} else if ( type === 'post' ) {\n\t\tuserCanCreate = userCanCreatePosts;\n\t}\n\n\tasync function handleCreate( pageTitle ) {\n\t\tconst postType = type || 'page';\n\n\t\tconst page = await saveEntityRecord( 'postType', postType, {\n\t\t\ttitle: pageTitle,\n\t\t\tstatus: 'draft',\n\t\t} );\n\n\t\treturn {\n\t\t\tid: page.id,\n\t\t\ttype: postType,\n\t\t\ttitle: page.title.rendered,\n\t\t\turl: page.link,\n\t\t\tkind: 'post-type',\n\t\t};\n\t}\n\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t} = getColors( context, ! isTopLevelItem );\n\n\tfunction onKeyDown( event ) {\n\t\tif ( isKeyboardEvent.primary( event, 'k' ) ) {\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tref: listItemRef,\n\t\tclassName: classnames( 'wp-block-navigation-item', {\n\t\t\t'is-editing': isSelected || isParentOfSelectedBlock,\n\t\t\t'is-dragging-within': isDraggingWithin,\n\t\t\t'has-link': !! url,\n\t\t\t'has-child': hasDescendants,\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(\n\t\t\t\t'background-color',\n\t\t\t\tbackgroundColor\n\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\tif ( isAtMaxNesting ) {\n\t\tpull( ALLOWED_BLOCKS, 'core/navigation-submenu' );\n\t}\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tclassName: classnames( 'wp-block-navigation__submenu-container', {\n\t\t\t\t'is-parent-of-selected-block': isParentOfSelectedBlock,\n\t\t\t\t'has-text-color': !! (\n\t\t\t\t\tinnerBlocksColors.textColor ||\n\t\t\t\t\tinnerBlocksColors.customTextColor\n\t\t\t\t),\n\t\t\t\t[ `has-${ innerBlocksColors.textColor }-color` ]: !! innerBlocksColors.textColor,\n\t\t\t\t'has-background': !! (\n\t\t\t\t\tinnerBlocksColors.backgroundColor ||\n\t\t\t\t\tinnerBlocksColors.customBackgroundColor\n\t\t\t\t),\n\t\t\t\t[ `has-${ innerBlocksColors.backgroundColor }-background-color` ]: !! innerBlocksColors.backgroundColor,\n\t\t\t} ),\n\t\t\tstyle: {\n\t\t\t\tcolor: innerBlocksColors.customTextColor,\n\t\t\t\tbackgroundColor: innerBlocksColors.customBackgroundColor,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tallowedBlocks: ALLOWED_BLOCKS,\n\t\t\t__experimentalDefaultBlock: DEFAULT_BLOCK,\n\t\t\t__experimentalDirectInsert: true,\n\t\t\trenderAppender:\n\t\t\t\tisSelected ||\n\t\t\t\t( isImmediateParentOfSelectedBlock &&\n\t\t\t\t\t! selectedBlockHasDescendants ) ||\n\t\t\t\t// Show the appender while dragging to allow inserting element between item and the appender.\n\t\t\t\thasDescendants\n\t\t\t\t\t? InnerBlocks.DefaultAppender\n\t\t\t\t\t: false,\n\t\t}\n\t);\n\n\tconst ParentElement = openSubmenusOnClick ? 'button' : 'a';\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t{ ! openSubmenusOnClick && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\t\ticon={ linkIcon }\n\t\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\tonClick={ () => setIsLinkOpen( true ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarGroup>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\tvalue={ description || '' }\n\t\t\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tdescription: descriptionValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'The description will be displayed in the menu if the current theme supports it.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\t\tonChange={ ( titleValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { title: titleValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Link title' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ /* eslint-disable jsx-a11y/anchor-is-valid */ }\n\t\t\t\t<ParentElement className=\"wp-block-navigation-item__content\">\n\t\t\t\t\t{ /* eslint-enable */ }\n\t\t\t\t\t{\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\n\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\tonChange={ ( labelValue ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { label: labelValue } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\t\taria-label={ __( 'Navigation link text' ) }\n\t\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\t\tallowedFormats={ [\n\t\t\t\t\t\t\t\t'core/bold',\n\t\t\t\t\t\t\t\t'core/italic',\n\t\t\t\t\t\t\t\t'core/image',\n\t\t\t\t\t\t\t\t'core/strikethrough',\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t\t{ ! openSubmenusOnClick && isLinkOpen && (\n\t\t\t\t\t\t<Popover\n\t\t\t\t\t\t\tposition=\"bottom center\"\n\t\t\t\t\t\t\tonClose={ () => setIsLinkOpen( false ) }\n\t\t\t\t\t\t\tanchorRef={ listItemRef.current }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<LinkControl\n\t\t\t\t\t\t\t\tclassName=\"wp-block-navigation-link__inline-link-input\"\n\t\t\t\t\t\t\t\tvalue={ link }\n\t\t\t\t\t\t\t\tshowInitialSuggestions={ true }\n\t\t\t\t\t\t\t\twithCreateSuggestion={ userCanCreate }\n\t\t\t\t\t\t\t\tcreateSuggestion={ handleCreate }\n\t\t\t\t\t\t\t\tcreateSuggestionButtonText={ ( searchTerm ) => {\n\t\t\t\t\t\t\t\t\tlet format;\n\t\t\t\t\t\t\t\t\tif ( type === 'post' ) {\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t\t\t\t\t\t\tformat = __(\n\t\t\t\t\t\t\t\t\t\t\t'Create draft post: <mark>%s</mark>'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t\t\t\t\t\t\tformat = __(\n\t\t\t\t\t\t\t\t\t\t\t'Create draft page: <mark>%s</mark>'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn createInterpolateElement(\n\t\t\t\t\t\t\t\t\t\tsprintf( format, searchTerm ),\n\t\t\t\t\t\t\t\t\t\t{ mark: <mark /> }\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tnoDirectEntry={ !! type }\n\t\t\t\t\t\t\t\tnoURLSuggestion={ !! type }\n\t\t\t\t\t\t\t\tsuggestionsQuery={ getSuggestionsQuery(\n\t\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\t\tkind\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonChange={ ( updatedValue ) =>\n\t\t\t\t\t\t\t\t\tupdateNavigationLinkBlockAttributes(\n\t\t\t\t\t\t\t\t\t\tupdatedValue,\n\t\t\t\t\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\t\t\t\t\tattributes\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\t\t\tsetAttributes( { url: '' } );\n\t\t\t\t\t\t\t\t\tspeak( __( 'Link removed.' ), 'assertive' );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Popover>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ( showSubmenuIcon || openSubmenusOnClick ) && (\n\t\t\t\t\t\t<span className=\"wp-block-navigation__submenu-icon\">\n\t\t\t\t\t\t\t<ItemSubmenuIcon />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</ParentElement>\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</div>\n\t\t</Fragment>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/navigation-submenu/edit.js"],"names":["classnames","escape","pull","useSelect","useDispatch","PanelBody","Popover","TextControl","TextareaControl","ToolbarButton","ToolbarGroup","displayShortcut","isKeyboardEvent","__","sprintf","BlockControls","InnerBlocks","useInnerBlocksProps","InspectorControls","RichText","__experimentalLinkControl","LinkControl","useBlockProps","store","blockEditorStore","getColorClassName","isURL","prependHTTP","safeDecodeURI","Fragment","useState","useEffect","useRef","createInterpolateElement","placeCaretAtHorizontalEdge","link","linkIcon","coreStore","speak","ItemSubmenuIcon","ALLOWED_BLOCKS","DEFAULT_BLOCK","MAX_NESTING","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener","getSuggestionsQuery","type","kind","subtype","getColors","context","isSubMenu","textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","style","colors","color","text","background","updateNavigationLinkBlockAttributes","updatedValue","setAttributes","blockAttributes","label","originalLabel","originalKind","originalType","title","url","opensInNewTab","id","newKind","newType","normalizedTitle","replace","normalizedURL","escapeTitle","isBuiltInType","indexOf","isCustomLink","encodeURI","undefined","Number","isInteger","NavigationSubmenuEdit","attributes","isSelected","mergeBlocks","onReplace","clientId","description","rel","showSubmenuIcon","openSubmenusOnClick","saveEntityRecord","__unstableMarkNextChangeAsNotPersistent","isLinkOpen","setIsLinkOpen","listItemRef","itemLabelPlaceholder","ref","isAtMaxNesting","isTopLevelItem","isParentOfSelectedBlock","isImmediateParentOfSelectedBlock","hasDescendants","selectedBlockHasDescendants","userCanCreatePages","userCanCreatePosts","select","getClientIdsOfDescendants","hasSelectedInnerBlock","getSelectedBlockClientId","getBlockParentsByBlockName","selectedBlockId","descendants","length","name","canUser","test","selectLabelText","focus","defaultView","selection","getSelection","range","createRange","selectNodeContents","removeAllRanges","addRange","userCanCreate","handleCreate","pageTitle","postType","page","status","rendered","onKeyDown","primary","blockProps","className","innerBlocksColors","innerBlocksProps","allowedBlocks","__experimentalDefaultBlock","__experimentalDirectInsert","__experimentalCaptureToolbars","renderAppender","DefaultAppender","ParentElement","descriptionValue","titleValue","relValue","labelValue","searchTerm","format","mark"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,SAASC,MAAT,EAAiBC,IAAjB,QAA6B,QAA7B;AAEA;AACA;AACA;;AACA,SAASC,SAAT,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,IAzBtB;AA0BC,IAAA,gBAAgB,EAAGD,mBAAmB,CACrCC,IADqC,EAErCC,IAFqC,CA1BvC;AA8BC,IAAA,QAAQ,EAAKmB,YAAF,IACVD,mCAAmC,CAClCC,YADkC,EAElCC,aAFkC,EAGlCwB,UAHkC,CA/BrC;AAqCC,IAAA,QAAQ,EAAG,MAAM;AAChBxB,MAAAA,aAAa,CAAE;AAAEO,QAAAA,GAAG,EAAE;AAAP,OAAF,CAAb;AACAhD,MAAAA,KAAK,CAAEzB,EAAE,CAAE,eAAF,CAAJ,EAAyB,WAAzB,CAAL;AACA;AAxCF,IALD,CA9BF,EA+EG,CAAEiG,eAAe,IAAIC,mBAArB,KACD;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC,cAAC,eAAD,OADD,CAhFF,CAFD,EAuFC,qBAAUiD,gBAAV,CAvFD,CA9CD,CADD;AA0IA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { escape, pull } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPanelBody,\n\tPopover,\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tInnerBlocks,\n\tuseInnerBlocksProps,\n\tInspectorControls,\n\tRichText,\n\t__experimentalLinkControl as LinkControl,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tgetColorClassName,\n} from '@wordpress/block-editor';\nimport { isURL, prependHTTP, safeDecodeURI } from '@wordpress/url';\nimport {\n\tFragment,\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport { placeCaretAtHorizontalEdge } from '@wordpress/dom';\nimport { link as linkIcon } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport { ItemSubmenuIcon } from './icons';\nimport { name } from './block.json';\n\nconst ALLOWED_BLOCKS = [ 'core/navigation-link', 'core/navigation-submenu' ];\n\nconst DEFAULT_BLOCK = [ 'core/navigation-link' ];\n\nconst MAX_NESTING = 5;\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 * Given the Link block's type attribute, return the query params to give to\n * /wp/v2/search.\n *\n * @param {string} type Link block's type attribute.\n * @param {string} kind Link block's entity of kind (post-type|taxonomy)\n * @return {{ type?: string, subtype?: string }} Search query params.\n */\nfunction getSuggestionsQuery( type, kind ) {\n\tswitch ( type ) {\n\t\tcase 'post':\n\t\tcase 'page':\n\t\t\treturn { type: 'post', subtype: type };\n\t\tcase 'category':\n\t\t\treturn { type: 'term', subtype: 'category' };\n\t\tcase 'tag':\n\t\t\treturn { type: 'term', subtype: 'post_tag' };\n\t\tcase 'post_format':\n\t\t\treturn { type: 'post-format' };\n\t\tdefault:\n\t\t\tif ( kind === 'taxonomy' ) {\n\t\t\t\treturn { type: 'term', subtype: type };\n\t\t\t}\n\t\t\tif ( kind === 'post-type' ) {\n\t\t\t\treturn { type: 'post', subtype: type };\n\t\t\t}\n\t\t\treturn {};\n\t}\n}\n\n/**\n * Determine the colors for a menu.\n *\n * Order of priority is:\n * 1: Overlay custom colors (if submenu)\n * 2: Overlay theme colors (if submenu)\n * 3: Custom colors\n * 4: Theme colors\n * 5: Global styles\n *\n * @param {Object} context\n * @param {boolean} isSubMenu\n */\nfunction getColors( context, isSubMenu ) {\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t\toverlayTextColor,\n\t\tcustomOverlayTextColor,\n\t\toverlayBackgroundColor,\n\t\tcustomOverlayBackgroundColor,\n\t\tstyle,\n\t} = context;\n\n\tconst colors = {};\n\n\tif ( isSubMenu && !! customOverlayTextColor ) {\n\t\tcolors.customTextColor = customOverlayTextColor;\n\t} else if ( isSubMenu && !! overlayTextColor ) {\n\t\tcolors.textColor = overlayTextColor;\n\t} else if ( !! customTextColor ) {\n\t\tcolors.customTextColor = customTextColor;\n\t} else if ( !! textColor ) {\n\t\tcolors.textColor = textColor;\n\t} else if ( !! style?.color?.text ) {\n\t\tcolors.customTextColor = style.color.text;\n\t}\n\n\tif ( isSubMenu && !! customOverlayBackgroundColor ) {\n\t\tcolors.customBackgroundColor = customOverlayBackgroundColor;\n\t} else if ( isSubMenu && !! overlayBackgroundColor ) {\n\t\tcolors.backgroundColor = overlayBackgroundColor;\n\t} else if ( !! customBackgroundColor ) {\n\t\tcolors.customBackgroundColor = customBackgroundColor;\n\t} else if ( !! backgroundColor ) {\n\t\tcolors.backgroundColor = backgroundColor;\n\t} else if ( !! style?.color?.background ) {\n\t\tcolors.customTextColor = style.color.background;\n\t}\n\n\treturn colors;\n}\n\n/**\n * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind\n */\n\n/**\n * Navigation Link Block Attributes\n *\n * @typedef {Object} WPNavigationLinkBlockAttributes\n *\n * @property {string} [label] Link text.\n * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status.\n * @property {string} [type] The type such as post, page, tag, category and other custom types.\n * @property {string} [rel] The relationship of the linked URL.\n * @property {number} [id] A post or term id.\n * @property {boolean} [opensInNewTab] Sets link target to _blank when true.\n * @property {string} [url] Link href.\n * @property {string} [title] Link title attribute.\n */\n\n/**\n * Link Control onChange handler that updates block attributes when a setting is changed.\n *\n * @param {Object} updatedValue New block attributes to update.\n * @param {Function} setAttributes Block attribute update function.\n * @param {WPNavigationLinkBlockAttributes} blockAttributes Current block attributes.\n *\n */\nexport const updateNavigationLinkBlockAttributes = (\n\tupdatedValue = {},\n\tsetAttributes,\n\tblockAttributes = {}\n) => {\n\tconst {\n\t\tlabel: originalLabel = '',\n\t\tkind: originalKind = '',\n\t\ttype: originalType = '',\n\t} = blockAttributes;\n\tconst {\n\t\ttitle = '',\n\t\turl = '',\n\t\topensInNewTab,\n\t\tid,\n\t\tkind: newKind = originalKind,\n\t\ttype: newType = originalType,\n\t} = updatedValue;\n\n\tconst normalizedTitle = title.replace( /http(s?):\\/\\//gi, '' );\n\tconst normalizedURL = url.replace( /http(s?):\\/\\//gi, '' );\n\tconst escapeTitle =\n\t\ttitle !== '' &&\n\t\tnormalizedTitle !== normalizedURL &&\n\t\toriginalLabel !== title;\n\tconst label = escapeTitle\n\t\t? escape( title )\n\t\t: originalLabel || escape( normalizedURL );\n\n\t// In https://github.com/WordPress/gutenberg/pull/24670 we decided to use \"tag\" in favor of \"post_tag\"\n\tconst type = newType === 'post_tag' ? 'tag' : newType.replace( '-', '_' );\n\n\tconst isBuiltInType =\n\t\t[ 'post', 'page', 'tag', 'category' ].indexOf( type ) > -1;\n\n\tconst isCustomLink =\n\t\t( ! newKind && ! isBuiltInType ) || newKind === 'custom';\n\tconst kind = isCustomLink ? 'custom' : newKind;\n\n\tsetAttributes( {\n\t\t// Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.\n\t\t...( url && { url: encodeURI( safeDecodeURI( url ) ) } ),\n\t\t...( label && { label } ),\n\t\t...( undefined !== opensInNewTab && { opensInNewTab } ),\n\t\t...( id && Number.isInteger( id ) && { id } ),\n\t\t...( kind && { kind } ),\n\t\t...( type && type !== 'URL' && { type } ),\n\t} );\n};\n\nexport default function NavigationSubmenuEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tmergeBlocks,\n\tonReplace,\n\tcontext,\n\tclientId,\n} ) {\n\tconst {\n\t\tlabel,\n\t\ttype,\n\t\topensInNewTab,\n\t\turl,\n\t\tdescription,\n\t\trel,\n\t\ttitle,\n\t\tkind,\n\t} = attributes;\n\tconst link = {\n\t\turl,\n\t\topensInNewTab,\n\t};\n\tconst { showSubmenuIcon, openSubmenusOnClick } = context;\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { __unstableMarkNextChangeAsNotPersistent } = useDispatch(\n\t\tblockEditorStore\n\t);\n\tconst [ isLinkOpen, setIsLinkOpen ] = useState( false );\n\tconst listItemRef = useRef( null );\n\tconst isDraggingWithin = useIsDraggingWithin( listItemRef );\n\tconst itemLabelPlaceholder = __( 'Add text…' );\n\tconst ref = useRef();\n\n\tconst {\n\t\tisAtMaxNesting,\n\t\tisTopLevelItem,\n\t\tisParentOfSelectedBlock,\n\t\tisImmediateParentOfSelectedBlock,\n\t\thasDescendants,\n\t\tselectedBlockHasDescendants,\n\t\tuserCanCreatePages,\n\t\tuserCanCreatePosts,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetClientIdsOfDescendants,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst selectedBlockId = getSelectedBlockClientId();\n\n\t\t\tconst descendants = getClientIdsOfDescendants( [ clientId ] )\n\t\t\t\t.length;\n\n\t\t\treturn {\n\t\t\t\tisAtMaxNesting:\n\t\t\t\t\tgetBlockParentsByBlockName( clientId, name ).length >=\n\t\t\t\t\tMAX_NESTING,\n\t\t\t\tisTopLevelItem:\n\t\t\t\t\tgetBlockParentsByBlockName( clientId, name ).length === 0,\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\thasDescendants: !! descendants,\n\t\t\t\tselectedBlockHasDescendants: !! getClientIdsOfDescendants( [\n\t\t\t\t\tselectedBlockId,\n\t\t\t\t] )?.length,\n\t\t\t\tuserCanCreatePages: select( coreStore ).canUser(\n\t\t\t\t\t'create',\n\t\t\t\t\t'pages'\n\t\t\t\t),\n\t\t\t\tuserCanCreatePosts: select( coreStore ).canUser(\n\t\t\t\t\t'create',\n\t\t\t\t\t'posts'\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\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// Store the colors from context as attributes for rendering\n\tuseEffect( () => {\n\t\t// This side-effect should not create an undo level as those should\n\t\t// only be created via user interactions. Mark this change as\n\t\t// not persistent to avoid undo level creation.\n\t\t// See https://github.com/WordPress/gutenberg/issues/34564.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\tsetAttributes( { isTopLevelItem } );\n\t}, [ isTopLevelItem ] );\n\n\t/**\n\t * The hook shouldn't be necessary but due to a focus loss happening\n\t * when selecting a suggestion in the link popover, we force close on block unselection.\n\t */\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsLinkOpen( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\t// If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.\n\tuseEffect( () => {\n\t\tif ( isLinkOpen && url ) {\n\t\t\t// Does this look like a URL and have something TLD-ish?\n\t\t\tif (\n\t\t\t\tisURL( prependHTTP( label ) ) &&\n\t\t\t\t/^.+\\.[a-z]+/.test( label )\n\t\t\t) {\n\t\t\t\t// Focus and select the label text.\n\t\t\t\tselectLabelText();\n\t\t\t} else {\n\t\t\t\t// Focus it (but do not select).\n\t\t\t\tplaceCaretAtHorizontalEdge( ref.current, true );\n\t\t\t}\n\t\t}\n\t}, [ url ] );\n\n\t/**\n\t * Focus the Link label text and select it.\n\t */\n\tfunction selectLabelText() {\n\t\tref.current.focus();\n\t\tconst { ownerDocument } = ref.current;\n\t\tconst { defaultView } = ownerDocument;\n\t\tconst selection = defaultView.getSelection();\n\t\tconst range = ownerDocument.createRange();\n\t\t// Get the range of the current ref contents so we can add this range to the selection.\n\t\trange.selectNodeContents( ref.current );\n\t\tselection.removeAllRanges();\n\t\tselection.addRange( range );\n\t}\n\n\tlet userCanCreate = false;\n\tif ( ! type || type === 'page' ) {\n\t\tuserCanCreate = userCanCreatePages;\n\t} else if ( type === 'post' ) {\n\t\tuserCanCreate = userCanCreatePosts;\n\t}\n\n\tasync function handleCreate( pageTitle ) {\n\t\tconst postType = type || 'page';\n\n\t\tconst page = await saveEntityRecord( 'postType', postType, {\n\t\t\ttitle: pageTitle,\n\t\t\tstatus: 'draft',\n\t\t} );\n\n\t\treturn {\n\t\t\tid: page.id,\n\t\t\ttype: postType,\n\t\t\ttitle: page.title.rendered,\n\t\t\turl: page.link,\n\t\t\tkind: 'post-type',\n\t\t};\n\t}\n\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t} = getColors( context, ! isTopLevelItem );\n\n\tfunction onKeyDown( event ) {\n\t\tif ( isKeyboardEvent.primary( event, 'k' ) ) {\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tref: listItemRef,\n\t\tclassName: classnames( 'wp-block-navigation-item', {\n\t\t\t'is-editing': isSelected || isParentOfSelectedBlock,\n\t\t\t'is-dragging-within': isDraggingWithin,\n\t\t\t'has-link': !! url,\n\t\t\t'has-child': hasDescendants,\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(\n\t\t\t\t'background-color',\n\t\t\t\tbackgroundColor\n\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\tif ( isAtMaxNesting ) {\n\t\tpull( ALLOWED_BLOCKS, 'core/navigation-submenu' );\n\t}\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tclassName: classnames( 'wp-block-navigation__submenu-container', {\n\t\t\t\t'is-parent-of-selected-block': isParentOfSelectedBlock,\n\t\t\t\t'has-text-color': !! (\n\t\t\t\t\tinnerBlocksColors.textColor ||\n\t\t\t\t\tinnerBlocksColors.customTextColor\n\t\t\t\t),\n\t\t\t\t[ `has-${ innerBlocksColors.textColor }-color` ]: !! innerBlocksColors.textColor,\n\t\t\t\t'has-background': !! (\n\t\t\t\t\tinnerBlocksColors.backgroundColor ||\n\t\t\t\t\tinnerBlocksColors.customBackgroundColor\n\t\t\t\t),\n\t\t\t\t[ `has-${ innerBlocksColors.backgroundColor }-background-color` ]: !! innerBlocksColors.backgroundColor,\n\t\t\t} ),\n\t\t\tstyle: {\n\t\t\t\tcolor: innerBlocksColors.customTextColor,\n\t\t\t\tbackgroundColor: innerBlocksColors.customBackgroundColor,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tallowedBlocks: ALLOWED_BLOCKS,\n\t\t\t__experimentalDefaultBlock: DEFAULT_BLOCK,\n\t\t\t__experimentalDirectInsert: true,\n\n\t\t\t// Ensure block toolbar is not too far removed from item\n\t\t\t// being edited.\n\t\t\t// see: https://github.com/WordPress/gutenberg/pull/34615.\n\t\t\t__experimentalCaptureToolbars: true,\n\n\t\t\trenderAppender:\n\t\t\t\tisSelected ||\n\t\t\t\t( isImmediateParentOfSelectedBlock &&\n\t\t\t\t\t! selectedBlockHasDescendants ) ||\n\t\t\t\t// Show the appender while dragging to allow inserting element between item and the appender.\n\t\t\t\thasDescendants\n\t\t\t\t\t? InnerBlocks.DefaultAppender\n\t\t\t\t\t: false,\n\t\t}\n\t);\n\n\tconst ParentElement = openSubmenusOnClick ? 'button' : 'a';\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t{ ! openSubmenusOnClick && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\t\ticon={ linkIcon }\n\t\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\tonClick={ () => setIsLinkOpen( true ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarGroup>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\tvalue={ description || '' }\n\t\t\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tdescription: descriptionValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'The description will be displayed in the menu if the current theme supports it.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\t\tonChange={ ( titleValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { title: titleValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Link title' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ /* eslint-disable jsx-a11y/anchor-is-valid */ }\n\t\t\t\t<ParentElement className=\"wp-block-navigation-item__content\">\n\t\t\t\t\t{ /* eslint-enable */ }\n\t\t\t\t\t{\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\n\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\tonChange={ ( labelValue ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { label: labelValue } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\t\taria-label={ __( 'Navigation link text' ) }\n\t\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\t\tallowedFormats={ [\n\t\t\t\t\t\t\t\t'core/bold',\n\t\t\t\t\t\t\t\t'core/italic',\n\t\t\t\t\t\t\t\t'core/image',\n\t\t\t\t\t\t\t\t'core/strikethrough',\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t\t{ ! openSubmenusOnClick && isLinkOpen && (\n\t\t\t\t\t\t<Popover\n\t\t\t\t\t\t\tposition=\"bottom center\"\n\t\t\t\t\t\t\tonClose={ () => setIsLinkOpen( false ) }\n\t\t\t\t\t\t\tanchorRef={ listItemRef.current }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<LinkControl\n\t\t\t\t\t\t\t\tclassName=\"wp-block-navigation-link__inline-link-input\"\n\t\t\t\t\t\t\t\tvalue={ link }\n\t\t\t\t\t\t\t\tshowInitialSuggestions={ true }\n\t\t\t\t\t\t\t\twithCreateSuggestion={ userCanCreate }\n\t\t\t\t\t\t\t\tcreateSuggestion={ handleCreate }\n\t\t\t\t\t\t\t\tcreateSuggestionButtonText={ ( searchTerm ) => {\n\t\t\t\t\t\t\t\t\tlet format;\n\t\t\t\t\t\t\t\t\tif ( type === 'post' ) {\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t\t\t\t\t\t\tformat = __(\n\t\t\t\t\t\t\t\t\t\t\t'Create draft post: <mark>%s</mark>'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t\t\t\t\t\t\tformat = __(\n\t\t\t\t\t\t\t\t\t\t\t'Create draft page: <mark>%s</mark>'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn createInterpolateElement(\n\t\t\t\t\t\t\t\t\t\tsprintf( format, searchTerm ),\n\t\t\t\t\t\t\t\t\t\t{ mark: <mark /> }\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tnoDirectEntry={ !! type }\n\t\t\t\t\t\t\t\tnoURLSuggestion={ !! type }\n\t\t\t\t\t\t\t\tsuggestionsQuery={ getSuggestionsQuery(\n\t\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\t\tkind\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonChange={ ( updatedValue ) =>\n\t\t\t\t\t\t\t\t\tupdateNavigationLinkBlockAttributes(\n\t\t\t\t\t\t\t\t\t\tupdatedValue,\n\t\t\t\t\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\t\t\t\t\tattributes\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\t\t\tsetAttributes( { url: '' } );\n\t\t\t\t\t\t\t\t\tspeak( __( 'Link removed.' ), 'assertive' );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Popover>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ( showSubmenuIcon || openSubmenusOnClick ) && (\n\t\t\t\t\t\t<span className=\"wp-block-navigation__submenu-icon\">\n\t\t\t\t\t\t\t<ItemSubmenuIcon />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</ParentElement>\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</div>\n\t\t</Fragment>\n\t);\n}\n"]}
|
|
@@ -9,7 +9,7 @@ import { queryPagination as icon } from '@wordpress/icons';
|
|
|
9
9
|
const metadata = {
|
|
10
10
|
apiVersion: 2,
|
|
11
11
|
name: "core/query-pagination",
|
|
12
|
-
title: "
|
|
12
|
+
title: "Pagination",
|
|
13
13
|
category: "design",
|
|
14
14
|
parent: ["core/query"],
|
|
15
15
|
description: "Displays a paginated navigation to next/previous set of posts, when applicable.",
|
|
@@ -9,7 +9,7 @@ import { queryPaginationNext as icon } from '@wordpress/icons';
|
|
|
9
9
|
const metadata = {
|
|
10
10
|
apiVersion: 2,
|
|
11
11
|
name: "core/query-pagination-next",
|
|
12
|
-
title: "
|
|
12
|
+
title: "Next Page",
|
|
13
13
|
category: "design",
|
|
14
14
|
parent: ["core/query-pagination"],
|
|
15
15
|
description: "Displays the next posts page link.",
|
|
@@ -9,7 +9,7 @@ import { queryPaginationNumbers as icon } from '@wordpress/icons';
|
|
|
9
9
|
const metadata = {
|
|
10
10
|
apiVersion: 2,
|
|
11
11
|
name: "core/query-pagination-numbers",
|
|
12
|
-
title: "
|
|
12
|
+
title: "Page Numbers",
|
|
13
13
|
category: "design",
|
|
14
14
|
parent: ["core/query-pagination"],
|
|
15
15
|
description: "Displays a list of page numbers for pagination",
|
|
@@ -9,7 +9,7 @@ import { queryPaginationPrevious as icon } from '@wordpress/icons';
|
|
|
9
9
|
const metadata = {
|
|
10
10
|
apiVersion: 2,
|
|
11
11
|
name: "core/query-pagination-previous",
|
|
12
|
-
title: "
|
|
12
|
+
title: "Previous Page",
|
|
13
13
|
category: "design",
|
|
14
14
|
parent: ["core/query-pagination"],
|
|
15
15
|
description: "Displays the previous posts page link.",
|
|
@@ -13,6 +13,7 @@ const SeparatorSettings = _ref => {
|
|
|
13
13
|
} = _ref;
|
|
14
14
|
return createElement(InspectorControls, null, createElement(PanelColorSettings, {
|
|
15
15
|
__experimentalHasMultipleOrigins: true,
|
|
16
|
+
__experimentalIsRenderedInSidebar: true,
|
|
16
17
|
title: __('Color'),
|
|
17
18
|
colorSettings: [{
|
|
18
19
|
value: color.color,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/separator/separator-settings.js"],"names":["__","InspectorControls","PanelColorSettings","SeparatorSettings","color","setColor","value","onChange","label"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,iBAAT,EAA4BC,kBAA5B,QAAsD,yBAAtD;;AAEA,MAAMC,iBAAiB,GAAG;AAAA,MAAE;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAF;AAAA,SACzB,cAAC,iBAAD,QACC,cAAC,kBAAD;AACC,IAAA,gCAAgC,MADjC;AAEC,IAAA,KAAK,EAAGL,EAAE,CAAE,OAAF,
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/separator/separator-settings.js"],"names":["__","InspectorControls","PanelColorSettings","SeparatorSettings","color","setColor","value","onChange","label"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,iBAAT,EAA4BC,kBAA5B,QAAsD,yBAAtD;;AAEA,MAAMC,iBAAiB,GAAG;AAAA,MAAE;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAF;AAAA,SACzB,cAAC,iBAAD,QACC,cAAC,kBAAD;AACC,IAAA,gCAAgC,MADjC;AAEC,IAAA,iCAAiC,MAFlC;AAGC,IAAA,KAAK,EAAGL,EAAE,CAAE,OAAF,CAHX;AAIC,IAAA,aAAa,EAAG,CACf;AACCM,MAAAA,KAAK,EAAEF,KAAK,CAACA,KADd;AAECG,MAAAA,QAAQ,EAAEF,QAFX;AAGCG,MAAAA,KAAK,EAAER,EAAE,CAAE,OAAF;AAHV,KADe;AAJjB,IADD,CADyB;AAAA,CAA1B;;AAiBA,eAAeG,iBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { InspectorControls, PanelColorSettings } from '@wordpress/block-editor';\n\nconst SeparatorSettings = ( { color, setColor } ) => (\n\t<InspectorControls>\n\t\t<PanelColorSettings\n\t\t\t__experimentalHasMultipleOrigins\n\t\t\t__experimentalIsRenderedInSidebar\n\t\t\ttitle={ __( 'Color' ) }\n\t\t\tcolorSettings={ [\n\t\t\t\t{\n\t\t\t\t\tvalue: color.color,\n\t\t\t\t\tonChange: setColor,\n\t\t\t\t\tlabel: __( 'Color' ),\n\t\t\t\t},\n\t\t\t] }\n\t\t></PanelColorSettings>\n\t</InspectorControls>\n);\n\nexport default SeparatorSettings;\n"]}
|
|
@@ -136,6 +136,7 @@ export function SocialLinksEdit(props) {
|
|
|
136
136
|
})
|
|
137
137
|
})), createElement(PanelColorSettings, {
|
|
138
138
|
__experimentalHasMultipleOrigins: true,
|
|
139
|
+
__experimentalIsRenderedInSidebar: true,
|
|
139
140
|
title: __('Color'),
|
|
140
141
|
colorSettings: [{
|
|
141
142
|
// Use custom attribute as fallback to prevent loss of named color selection when
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/social-links/edit.js"],"names":["classNames","getBlockSupport","Fragment","useEffect","BlockControls","useInnerBlocksProps","useBlockProps","InspectorControls","ContrastChecker","PanelColorSettings","withColors","MenuGroup","MenuItem","PanelBody","ToggleControl","ToolbarDropdownMenu","__","check","ALLOWED_BLOCKS","sizeOptions","name","value","getDefaultBlockLayout","blockTypeOrName","layoutBlockSupportConfig","default","SocialLinksEdit","props","attributes","iconBackgroundColor","iconColor","isSelected","setAttributes","setIconBackgroundColor","setIconColor","iconBackgroundColorValue","iconColorValue","openInNewTab","size","layout","usedLayout","logosOnly","className","indexOf","undefined","customIconBackgroundColor","SocialPlaceholder","SelectedSocialPlaceholder","color","blockProps","innerBlocksProps","allowedBlocks","placeholder","templateLock","__experimentalAppenderTagName","__experimentalLayout","POPOVER_PROPS","position","onClose","map","entry","onChange","colorValue","label","textColor","backgroundColor","iconColorAttributes"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,QAAT,EAAmBC,SAAnB,QAAoC,oBAApC;AACA,SACCC,aADD,EAECC,mBAFD,EAGCC,aAHD,EAICC,iBAJD,EAKCC,eALD,EAMCC,kBAND,EAOCC,UAPD,QAQO,yBARP;AASA,SACCC,SADD,EAECC,QAFD,EAGCC,SAHD,EAICC,aAJD,EAKCC,mBALD,QAMO,uBANP;AAOA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAT,QAAsB,kBAAtB;AAEA,MAAMC,cAAc,GAAG,CAAE,kBAAF,CAAvB;AAEA,MAAMC,WAAW,GAAG,CACnB;AAAEC,EAAAA,IAAI,EAAEJ,EAAE,CAAE,OAAF,CAAV;AAAuBK,EAAAA,KAAK,EAAE;AAA9B,CADmB,EAEnB;AAAED,EAAAA,IAAI,EAAEJ,EAAE,CAAE,QAAF,CAAV;AAAwBK,EAAAA,KAAK,EAAE;AAA/B,CAFmB,EAGnB;AAAED,EAAAA,IAAI,EAAEJ,EAAE,CAAE,OAAF,CAAV;AAAuBK,EAAAA,KAAK,EAAE;AAA9B,CAHmB,EAInB;AAAED,EAAAA,IAAI,EAAEJ,EAAE,CAAE,MAAF,CAAV;AAAsBK,EAAAA,KAAK,EAAE;AAA7B,CAJmB,CAApB;;AAOA,MAAMC,qBAAqB,GAAKC,eAAF,IAAuB;AACpD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3B7B,QAAAA,sBAAsB,CAAE6B,UAAF,CAAtB;AACA9B,QAAAA,aAAa,CAAE;AACdG,UAAAA,wBAAwB,EAAE2B;AADZ,SAAF,CAAb;AAGA,OAXa;AAYdC,MAAAA,KAAK,EAAE/C,EAAE,CAAE,uBAAF;AAZK,KAXA;AAHjB,IAVD,EAwCG,CAAEyB,SAAF,IACD,cAAC,eAAD;AAEEuB,IAAAA,SAAS,EAAE5B,cAFb;AAGE6B,IAAAA,eAAe,EAAE9B,wBAHnB;AAKC,IAAA,WAAW,EAAG;AALf,IAzCF,CAtCD,EAwFC,oBAASe,gBAAT,CAxFD,CADD;AA4FA;AAED,MAAMgB,mBAAmB,GAAG;AAC3BpC,EAAAA,SAAS,EAAE,YADgB;AAE3BD,EAAAA,mBAAmB,EAAE;AAFM,CAA5B;AAKA,eAAenB,UAAU,CAAEwD,mBAAF,CAAV,CAAmCxC,eAAnC,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { Fragment, useEffect } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tuseInnerBlocksProps,\n\tuseBlockProps,\n\tInspectorControls,\n\tContrastChecker,\n\tPanelColorSettings,\n\twithColors,\n} from '@wordpress/block-editor';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tPanelBody,\n\tToggleControl,\n\tToolbarDropdownMenu,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\n\nconst ALLOWED_BLOCKS = [ 'core/social-link' ];\n\nconst sizeOptions = [\n\t{ name: __( 'Small' ), value: 'has-small-icon-size' },\n\t{ name: __( 'Normal' ), value: 'has-normal-icon-size' },\n\t{ name: __( 'Large' ), value: 'has-large-icon-size' },\n\t{ name: __( 'Huge' ), value: 'has-huge-icon-size' },\n];\n\nconst getDefaultBlockLayout = ( blockTypeOrName ) => {\n\tconst layoutBlockSupportConfig = getBlockSupport(\n\t\tblockTypeOrName,\n\t\t'__experimentalLayout'\n\t);\n\treturn layoutBlockSupportConfig?.default;\n};\n\nexport function SocialLinksEdit( props ) {\n\tconst {\n\t\tname,\n\t\tattributes,\n\t\ticonBackgroundColor,\n\t\ticonColor,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tsetIconBackgroundColor,\n\t\tsetIconColor,\n\t} = props;\n\n\tconst {\n\t\ticonBackgroundColorValue,\n\t\ticonColorValue,\n\t\topenInNewTab,\n\t\tsize,\n\t\tlayout,\n\t} = attributes;\n\tconst usedLayout = layout || getDefaultBlockLayout( name );\n\n\t// Remove icon background color if logos only style selected.\n\tconst logosOnly =\n\t\tattributes.className?.indexOf( 'is-style-logos-only' ) >= 0;\n\tuseEffect( () => {\n\t\tif ( logosOnly ) {\n\t\t\tsetAttributes( {\n\t\t\t\ticonBackgroundColor: undefined,\n\t\t\t\tcustomIconBackgroundColor: undefined,\n\t\t\t\ticonBackgroundColorValue: undefined,\n\t\t\t} );\n\t\t}\n\t}, [ logosOnly, setAttributes ] );\n\n\tconst SocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-placeholder\">\n\t\t\t<div className=\"wp-social-link\"></div>\n\t\t\t<div className=\"wp-block-social-links__social-placeholder-icons\">\n\t\t\t\t<div className=\"wp-social-link wp-social-link-twitter\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-facebook\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-instagram\"></div>\n\t\t\t</div>\n\t\t</li>\n\t);\n\n\tconst SelectedSocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-prompt\">\n\t\t\t{ __( 'Click plus to add' ) }\n\t\t</li>\n\t);\n\n\t// Fallback color values are used maintain selections in case switching\n\t// themes and named colors in palette do not match.\n\tconst className = classNames( size, {\n\t\t'has-icon-color': iconColor.color || iconColorValue,\n\t\t'has-icon-background-color':\n\t\t\ticonBackgroundColor.color || iconBackgroundColorValue,\n\t} );\n\n\tconst blockProps = useBlockProps( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tallowedBlocks: ALLOWED_BLOCKS,\n\t\tplaceholder: isSelected ? SelectedSocialPlaceholder : SocialPlaceholder,\n\t\ttemplateLock: false,\n\t\t__experimentalAppenderTagName: 'li',\n\t\t__experimentalLayout: usedLayout,\n\t} );\n\n\tconst POPOVER_PROPS = {\n\t\tposition: 'bottom right',\n\t};\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\ttext={ __( 'Size' ) }\n\t\t\t\t\ticon={ null }\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ sizeOptions.map( ( entry ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t( size === entry.value ||\n\t\t\t\t\t\t\t\t\t\t\t\t( ! size &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tentry.value ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'has-normal-icon-size' ) ) &&\n\t\t\t\t\t\t\t\t\t\t\tcheck\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisSelected={ size === entry.value }\n\t\t\t\t\t\t\t\t\t\tkey={ entry.value }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\tsize: entry.value,\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ entry.name }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\tchecked={ openInNewTab }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { openInNewTab: ! openInNewTab } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t\t<PanelColorSettings\n\t\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\t\ttitle={ __( 'Color' ) }\n\t\t\t\t\tcolorSettings={ [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t\t\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\t\t\t\t\tvalue: iconColor.color || iconColorValue,\n\t\t\t\t\t\t\tonChange: ( colorValue ) => {\n\t\t\t\t\t\t\t\tsetIconColor( colorValue );\n\t\t\t\t\t\t\t\tsetAttributes( { iconColorValue: colorValue } );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tlabel: __( 'Icon color' ),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t! logosOnly && {\n\t\t\t\t\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t\t\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\t\t\t\t\tvalue:\n\t\t\t\t\t\t\t\ticonBackgroundColor.color ||\n\t\t\t\t\t\t\t\ticonBackgroundColorValue,\n\t\t\t\t\t\t\tonChange: ( colorValue ) => {\n\t\t\t\t\t\t\t\tsetIconBackgroundColor( colorValue );\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\ticonBackgroundColorValue: colorValue,\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: __( 'Icon background color' ),\n\t\t\t\t\t\t},\n\t\t\t\t\t] }\n\t\t\t\t/>\n\t\t\t\t{ ! logosOnly && (\n\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\ttextColor: iconColorValue,\n\t\t\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisLargeText={ false }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</InspectorControls>\n\t\t\t<ul { ...innerBlocksProps } />\n\t\t</Fragment>\n\t);\n}\n\nconst iconColorAttributes = {\n\ticonColor: 'icon-color',\n\ticonBackgroundColor: 'icon-background-color',\n};\n\nexport default withColors( iconColorAttributes )( SocialLinksEdit );\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/social-links/edit.js"],"names":["classNames","getBlockSupport","Fragment","useEffect","BlockControls","useInnerBlocksProps","useBlockProps","InspectorControls","ContrastChecker","PanelColorSettings","withColors","MenuGroup","MenuItem","PanelBody","ToggleControl","ToolbarDropdownMenu","__","check","ALLOWED_BLOCKS","sizeOptions","name","value","getDefaultBlockLayout","blockTypeOrName","layoutBlockSupportConfig","default","SocialLinksEdit","props","attributes","iconBackgroundColor","iconColor","isSelected","setAttributes","setIconBackgroundColor","setIconColor","iconBackgroundColorValue","iconColorValue","openInNewTab","size","layout","usedLayout","logosOnly","className","indexOf","undefined","customIconBackgroundColor","SocialPlaceholder","SelectedSocialPlaceholder","color","blockProps","innerBlocksProps","allowedBlocks","placeholder","templateLock","__experimentalAppenderTagName","__experimentalLayout","POPOVER_PROPS","position","onClose","map","entry","onChange","colorValue","label","textColor","backgroundColor","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,EAAE5B,cAFb;AAGE6B,IAAAA,eAAe,EAAE9B,wBAHnB;AAKC,IAAA,WAAW,EAAG;AALf,IA1CF,CAtCD,EAyFC,oBAASe,gBAAT,CAzFD,CADD;AA6FA;AAED,MAAMgB,mBAAmB,GAAG;AAC3BpC,EAAAA,SAAS,EAAE,YADgB;AAE3BD,EAAAA,mBAAmB,EAAE;AAFM,CAA5B;AAKA,eAAenB,UAAU,CAAEwD,mBAAF,CAAV,CAAmCxC,eAAnC,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { getBlockSupport } from '@wordpress/blocks';\nimport { Fragment, useEffect } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tuseInnerBlocksProps,\n\tuseBlockProps,\n\tInspectorControls,\n\tContrastChecker,\n\tPanelColorSettings,\n\twithColors,\n} from '@wordpress/block-editor';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tPanelBody,\n\tToggleControl,\n\tToolbarDropdownMenu,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\n\nconst ALLOWED_BLOCKS = [ 'core/social-link' ];\n\nconst sizeOptions = [\n\t{ name: __( 'Small' ), value: 'has-small-icon-size' },\n\t{ name: __( 'Normal' ), value: 'has-normal-icon-size' },\n\t{ name: __( 'Large' ), value: 'has-large-icon-size' },\n\t{ name: __( 'Huge' ), value: 'has-huge-icon-size' },\n];\n\nconst getDefaultBlockLayout = ( blockTypeOrName ) => {\n\tconst layoutBlockSupportConfig = getBlockSupport(\n\t\tblockTypeOrName,\n\t\t'__experimentalLayout'\n\t);\n\treturn layoutBlockSupportConfig?.default;\n};\n\nexport function SocialLinksEdit( props ) {\n\tconst {\n\t\tname,\n\t\tattributes,\n\t\ticonBackgroundColor,\n\t\ticonColor,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tsetIconBackgroundColor,\n\t\tsetIconColor,\n\t} = props;\n\n\tconst {\n\t\ticonBackgroundColorValue,\n\t\ticonColorValue,\n\t\topenInNewTab,\n\t\tsize,\n\t\tlayout,\n\t} = attributes;\n\tconst usedLayout = layout || getDefaultBlockLayout( name );\n\n\t// Remove icon background color if logos only style selected.\n\tconst logosOnly =\n\t\tattributes.className?.indexOf( 'is-style-logos-only' ) >= 0;\n\tuseEffect( () => {\n\t\tif ( logosOnly ) {\n\t\t\tsetAttributes( {\n\t\t\t\ticonBackgroundColor: undefined,\n\t\t\t\tcustomIconBackgroundColor: undefined,\n\t\t\t\ticonBackgroundColorValue: undefined,\n\t\t\t} );\n\t\t}\n\t}, [ logosOnly, setAttributes ] );\n\n\tconst SocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-placeholder\">\n\t\t\t<div className=\"wp-social-link\"></div>\n\t\t\t<div className=\"wp-block-social-links__social-placeholder-icons\">\n\t\t\t\t<div className=\"wp-social-link wp-social-link-twitter\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-facebook\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-instagram\"></div>\n\t\t\t</div>\n\t\t</li>\n\t);\n\n\tconst SelectedSocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-prompt\">\n\t\t\t{ __( 'Click plus to add' ) }\n\t\t</li>\n\t);\n\n\t// Fallback color values are used maintain selections in case switching\n\t// themes and named colors in palette do not match.\n\tconst className = classNames( size, {\n\t\t'has-icon-color': iconColor.color || iconColorValue,\n\t\t'has-icon-background-color':\n\t\t\ticonBackgroundColor.color || iconBackgroundColorValue,\n\t} );\n\n\tconst blockProps = useBlockProps( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tallowedBlocks: ALLOWED_BLOCKS,\n\t\tplaceholder: isSelected ? SelectedSocialPlaceholder : SocialPlaceholder,\n\t\ttemplateLock: false,\n\t\t__experimentalAppenderTagName: 'li',\n\t\t__experimentalLayout: usedLayout,\n\t} );\n\n\tconst POPOVER_PROPS = {\n\t\tposition: 'bottom right',\n\t};\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\ttext={ __( 'Size' ) }\n\t\t\t\t\ticon={ null }\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ sizeOptions.map( ( entry ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t( size === entry.value ||\n\t\t\t\t\t\t\t\t\t\t\t\t( ! size &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tentry.value ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'has-normal-icon-size' ) ) &&\n\t\t\t\t\t\t\t\t\t\t\tcheck\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisSelected={ size === entry.value }\n\t\t\t\t\t\t\t\t\t\tkey={ entry.value }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\tsize: entry.value,\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ entry.name }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\tchecked={ openInNewTab }\n\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\tsetAttributes( { openInNewTab: ! openInNewTab } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t\t<PanelColorSettings\n\t\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\ttitle={ __( 'Color' ) }\n\t\t\t\t\tcolorSettings={ [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t\t\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\t\t\t\t\tvalue: iconColor.color || iconColorValue,\n\t\t\t\t\t\t\tonChange: ( colorValue ) => {\n\t\t\t\t\t\t\t\tsetIconColor( colorValue );\n\t\t\t\t\t\t\t\tsetAttributes( { iconColorValue: colorValue } );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tlabel: __( 'Icon color' ),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t! logosOnly && {\n\t\t\t\t\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t\t\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\t\t\t\t\tvalue:\n\t\t\t\t\t\t\t\ticonBackgroundColor.color ||\n\t\t\t\t\t\t\t\ticonBackgroundColorValue,\n\t\t\t\t\t\t\tonChange: ( colorValue ) => {\n\t\t\t\t\t\t\t\tsetIconBackgroundColor( colorValue );\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\ticonBackgroundColorValue: colorValue,\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: __( 'Icon background color' ),\n\t\t\t\t\t\t},\n\t\t\t\t\t] }\n\t\t\t\t/>\n\t\t\t\t{ ! logosOnly && (\n\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\ttextColor: iconColorValue,\n\t\t\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tisLargeText={ false }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</InspectorControls>\n\t\t\t<ul { ...innerBlocksProps } />\n\t\t</Fragment>\n\t);\n}\n\nconst iconColorAttributes = {\n\ticonColor: 'icon-color',\n\ticonBackgroundColor: 'icon-background-color',\n};\n\nexport default withColors( iconColorAttributes )( SocialLinksEdit );\n"]}
|
package/build-style/editor.css
CHANGED
|
@@ -355,10 +355,13 @@ button.wp-block-navigation-item__content {
|
|
|
355
355
|
display: flex;
|
|
356
356
|
flex-direction: column;
|
|
357
357
|
align-items: var(--layout-justification-setting, inherit);
|
|
358
|
-
justify-content: flex-start;
|
|
359
358
|
overflow: auto;
|
|
360
359
|
padding: 0;
|
|
361
360
|
}
|
|
361
|
+
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
|
|
362
|
+
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
|
|
363
|
+
justify-content: flex-start;
|
|
364
|
+
}
|
|
362
365
|
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-icon {
|
|
363
366
|
display: none;
|
|
364
367
|
}
|
|
@@ -355,10 +355,13 @@ button.wp-block-navigation-item__content {
|
|
|
355
355
|
display: flex;
|
|
356
356
|
flex-direction: column;
|
|
357
357
|
align-items: var(--layout-justification-setting, inherit);
|
|
358
|
-
justify-content: flex-start;
|
|
359
358
|
overflow: auto;
|
|
360
359
|
padding: 0;
|
|
361
360
|
}
|
|
361
|
+
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
|
|
362
|
+
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
|
|
363
|
+
justify-content: flex-start;
|
|
364
|
+
}
|
|
362
365
|
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-icon {
|
|
363
366
|
display: none;
|
|
364
367
|
}
|
|
@@ -1767,10 +1767,13 @@ button.wp-block-navigation-item__content {
|
|
|
1767
1767
|
display: flex;
|
|
1768
1768
|
flex-direction: column;
|
|
1769
1769
|
align-items: var(--layout-justification-setting, inherit);
|
|
1770
|
-
justify-content: flex-start;
|
|
1771
1770
|
overflow: auto;
|
|
1772
1771
|
padding: 0;
|
|
1773
1772
|
}
|
|
1773
|
+
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
|
|
1774
|
+
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
|
|
1775
|
+
justify-content: flex-start;
|
|
1776
|
+
}
|
|
1774
1777
|
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-icon {
|
|
1775
1778
|
display: none;
|
|
1776
1779
|
}
|
package/build-style/style.css
CHANGED
|
@@ -1789,10 +1789,13 @@ button.wp-block-navigation-item__content {
|
|
|
1789
1789
|
display: flex;
|
|
1790
1790
|
flex-direction: column;
|
|
1791
1791
|
align-items: var(--layout-justification-setting, inherit);
|
|
1792
|
-
justify-content: flex-start;
|
|
1793
1792
|
overflow: auto;
|
|
1794
1793
|
padding: 0;
|
|
1795
1794
|
}
|
|
1795
|
+
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
|
|
1796
|
+
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
|
|
1797
|
+
justify-content: flex-start;
|
|
1798
|
+
}
|
|
1796
1799
|
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-icon {
|
|
1797
1800
|
display: none;
|
|
1798
1801
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.12",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"@wordpress/api-fetch": "^5.2.6",
|
|
38
38
|
"@wordpress/autop": "^3.2.3",
|
|
39
39
|
"@wordpress/blob": "^3.2.2",
|
|
40
|
-
"@wordpress/block-editor": "^8.0.
|
|
40
|
+
"@wordpress/block-editor": "^8.0.8",
|
|
41
41
|
"@wordpress/blocks": "^11.1.4",
|
|
42
|
-
"@wordpress/components": "^19.1.
|
|
42
|
+
"@wordpress/components": "^19.1.2",
|
|
43
43
|
"@wordpress/compose": "^5.0.6",
|
|
44
44
|
"@wordpress/core-data": "^4.0.8",
|
|
45
45
|
"@wordpress/data": "^6.1.4",
|
|
@@ -52,14 +52,14 @@
|
|
|
52
52
|
"@wordpress/html-entities": "^3.2.3",
|
|
53
53
|
"@wordpress/i18n": "^4.2.4",
|
|
54
54
|
"@wordpress/icons": "^6.1.1",
|
|
55
|
-
"@wordpress/interface": "^4.1.
|
|
55
|
+
"@wordpress/interface": "^4.1.10",
|
|
56
56
|
"@wordpress/is-shallow-equal": "^4.2.1",
|
|
57
57
|
"@wordpress/keycodes": "^3.2.4",
|
|
58
58
|
"@wordpress/notices": "^3.2.7",
|
|
59
59
|
"@wordpress/primitives": "^3.0.4",
|
|
60
|
-
"@wordpress/reusable-blocks": "^3.0.
|
|
60
|
+
"@wordpress/reusable-blocks": "^3.0.14",
|
|
61
61
|
"@wordpress/rich-text": "^5.0.6",
|
|
62
|
-
"@wordpress/server-side-render": "^3.0.
|
|
62
|
+
"@wordpress/server-side-render": "^3.0.12",
|
|
63
63
|
"@wordpress/url": "^3.3.1",
|
|
64
64
|
"@wordpress/viewport": "^4.0.6",
|
|
65
65
|
"classnames": "^2.3.1",
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"fast-average-color": "4.3.0",
|
|
68
68
|
"lodash": "^4.17.21",
|
|
69
69
|
"memize": "^1.1.0",
|
|
70
|
-
"micromodal": "^0.4.
|
|
70
|
+
"micromodal": "^0.4.9",
|
|
71
71
|
"moment": "^2.22.1"
|
|
72
72
|
},
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "34b76b2f9397215e5afb8443f5b3073c83913102"
|
|
77
77
|
}
|
package/src/columns/editor.scss
CHANGED
|
@@ -25,8 +25,9 @@
|
|
|
25
25
|
|
|
26
26
|
// Individual columns do not have top and bottom margins on the frontend.
|
|
27
27
|
// So we make the editor match that.
|
|
28
|
-
//
|
|
29
|
-
.
|
|
28
|
+
// We use :where to provide minimum specificity, so that intentional margins,
|
|
29
|
+
// such as those configured in theme.json, override and win on specificity.
|
|
30
|
+
html :where(.wp-block-column) {
|
|
30
31
|
margin-top: 0;
|
|
31
32
|
margin-bottom: 0;
|
|
32
33
|
}
|