@wordpress/block-library 9.24.0 → 9.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/avatar/edit.js +84 -39
- package/build/avatar/edit.js.map +1 -1
- package/build/avatar/user-control.js +32 -17
- package/build/avatar/user-control.js.map +1 -1
- package/build/button/edit.js +29 -17
- package/build/button/edit.js.map +1 -1
- package/build/columns/edit.js +18 -22
- package/build/columns/edit.js.map +1 -1
- package/build/comment-author-name/edit.js +41 -12
- package/build/comment-author-name/edit.js.map +1 -1
- package/build/comment-date/edit.js +41 -12
- package/build/comment-date/edit.js.map +1 -1
- package/build/comment-edit-link/edit.js +27 -7
- package/build/comment-edit-link/edit.js.map +1 -1
- package/build/comments/edit/comments-inspector-controls.js +1 -3
- package/build/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build/comments-pagination/edit.js +23 -9
- package/build/comments-pagination/edit.js.map +1 -1
- package/build/comments-title/edit.js +41 -12
- package/build/comments-title/edit.js.map +1 -1
- package/build/details/edit.js +27 -3
- package/build/details/edit.js.map +1 -1
- package/build/embed/edit.js +2 -4
- package/build/embed/edit.js.map +1 -1
- package/build/embed/embed-controls.js +41 -22
- package/build/embed/embed-controls.js.map +1 -1
- package/build/embed/variations.js +0 -10
- package/build/embed/variations.js.map +1 -1
- package/build/file/inspector.js +73 -30
- package/build/file/inspector.js.map +1 -1
- package/build/form/edit.js +67 -38
- package/build/form/edit.js.map +1 -1
- package/build/form/index.js +3 -3
- package/build/form/index.js.map +1 -1
- package/build/form-input/edit.js +47 -18
- package/build/form-input/edit.js.map +1 -1
- package/build/form-input/index.js +2 -1
- package/build/form-input/index.js.map +1 -1
- package/build/form-submission-notification/index.js +2 -1
- package/build/form-submission-notification/index.js.map +1 -1
- package/build/form-submit-button/index.js +2 -1
- package/build/form-submit-button/index.js.map +1 -1
- package/build/image/image.js +1 -0
- package/build/image/image.js.map +1 -1
- package/build/image/view.js +0 -3
- package/build/image/view.js.map +1 -1
- package/build/latest-posts/edit.js +154 -82
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list/ordered-list-settings.js +131 -52
- package/build/list/ordered-list-settings.js.map +1 -1
- package/build/navigation/edit/index.js +93 -51
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/overlay-menu-preview.js +43 -27
- package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build/navigation-link/edit.js +11 -0
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/index.js +3 -0
- package/build/navigation-link/index.js.map +1 -1
- package/build/navigation-link/transforms.js +2 -0
- package/build/navigation-link/transforms.js.map +1 -1
- package/build/navigation-link/update-attributes.js +1 -0
- package/build/navigation-link/update-attributes.js.map +1 -1
- package/build/navigation-submenu/index.js +3 -0
- package/build/navigation-submenu/index.js.map +1 -1
- package/build/post-author/edit.js +75 -18
- package/build/post-author/edit.js.map +1 -1
- package/build/post-comments-count/index.js +3 -1
- package/build/post-comments-count/index.js.map +1 -1
- package/build/post-comments-count/transforms.js +26 -0
- package/build/post-comments-count/transforms.js.map +1 -0
- package/build/post-comments-link/index.js +3 -1
- package/build/post-comments-link/index.js.map +1 -1
- package/build/post-comments-link/transforms.js +26 -0
- package/build/post-comments-link/transforms.js.map +1 -0
- package/build/post-navigation-link/edit.js +72 -33
- package/build/post-navigation-link/edit.js.map +1 -1
- package/build/post-title/edit.js +56 -18
- package/build/post-title/edit.js.map +1 -1
- package/build/query/edit/enhanced-pagination-modal.js +1 -1
- package/build/query/edit/enhanced-pagination-modal.js.map +1 -1
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js +3 -6
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build/rss/edit.js +120 -46
- package/build/rss/edit.js.map +1 -1
- package/build/separator/edit.js +52 -20
- package/build/separator/edit.js.map +1 -1
- package/build/shortcode/index.js +2 -1
- package/build/shortcode/index.js.map +1 -1
- package/build/site-logo/edit.js +53 -19
- package/build/site-logo/edit.js.map +1 -1
- package/build/social-link/edit.js +21 -5
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/edit.native.js +13 -5
- package/build/social-link/edit.native.js.map +1 -1
- package/build/social-link/social-list.js +17 -25
- package/build/social-link/social-list.js.map +1 -1
- package/build/social-link/variations.js +53 -48
- package/build/social-link/variations.js.map +1 -1
- package/build/social-links/edit.js +38 -45
- package/build/social-links/edit.js.map +1 -1
- package/build/video/tracks-editor.js +63 -21
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/avatar/edit.js +83 -38
- package/build-module/avatar/edit.js.map +1 -1
- package/build-module/avatar/user-control.js +33 -18
- package/build-module/avatar/user-control.js.map +1 -1
- package/build-module/button/edit.js +30 -18
- package/build-module/button/edit.js.map +1 -1
- package/build-module/columns/edit.js +18 -22
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/comment-author-name/edit.js +42 -13
- package/build-module/comment-author-name/edit.js.map +1 -1
- package/build-module/comment-date/edit.js +42 -13
- package/build-module/comment-date/edit.js.map +1 -1
- package/build-module/comment-edit-link/edit.js +28 -8
- package/build-module/comment-edit-link/edit.js.map +1 -1
- package/build-module/comments/edit/comments-inspector-controls.js +1 -3
- package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build-module/comments-pagination/edit.js +24 -10
- package/build-module/comments-pagination/edit.js.map +1 -1
- package/build-module/comments-title/edit.js +42 -13
- package/build-module/comments-title/edit.js.map +1 -1
- package/build-module/details/edit.js +29 -5
- package/build-module/details/edit.js.map +1 -1
- package/build-module/embed/edit.js +2 -4
- package/build-module/embed/edit.js.map +1 -1
- package/build-module/embed/embed-controls.js +42 -23
- package/build-module/embed/embed-controls.js.map +1 -1
- package/build-module/embed/variations.js +0 -10
- package/build-module/embed/variations.js.map +1 -1
- package/build-module/file/inspector.js +74 -31
- package/build-module/file/inspector.js.map +1 -1
- package/build-module/form/edit.js +68 -39
- package/build-module/form/edit.js.map +1 -1
- package/build-module/form/index.js +3 -3
- package/build-module/form/index.js.map +1 -1
- package/build-module/form-input/edit.js +48 -19
- package/build-module/form-input/edit.js.map +1 -1
- package/build-module/form-input/index.js +2 -1
- package/build-module/form-input/index.js.map +1 -1
- package/build-module/form-submission-notification/index.js +2 -1
- package/build-module/form-submission-notification/index.js.map +1 -1
- package/build-module/form-submit-button/index.js +2 -1
- package/build-module/form-submit-button/index.js.map +1 -1
- package/build-module/image/image.js +1 -0
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/view.js +0 -3
- package/build-module/image/view.js.map +1 -1
- package/build-module/latest-posts/edit.js +155 -83
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list/ordered-list-settings.js +132 -53
- package/build-module/list/ordered-list-settings.js.map +1 -1
- package/build-module/navigation/edit/index.js +94 -52
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/overlay-menu-preview.js +44 -28
- package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build-module/navigation-link/edit.js +11 -0
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/index.js +3 -0
- package/build-module/navigation-link/index.js.map +1 -1
- package/build-module/navigation-link/transforms.js +2 -0
- package/build-module/navigation-link/transforms.js.map +1 -1
- package/build-module/navigation-link/update-attributes.js +1 -0
- package/build-module/navigation-link/update-attributes.js.map +1 -1
- package/build-module/navigation-submenu/index.js +3 -0
- package/build-module/navigation-submenu/index.js.map +1 -1
- package/build-module/post-author/edit.js +76 -19
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-comments-count/index.js +3 -1
- package/build-module/post-comments-count/index.js.map +1 -1
- package/build-module/post-comments-count/transforms.js +19 -0
- package/build-module/post-comments-count/transforms.js.map +1 -0
- package/build-module/post-comments-link/index.js +3 -1
- package/build-module/post-comments-link/index.js.map +1 -1
- package/build-module/post-comments-link/transforms.js +19 -0
- package/build-module/post-comments-link/transforms.js.map +1 -0
- package/build-module/post-navigation-link/edit.js +73 -34
- package/build-module/post-navigation-link/edit.js.map +1 -1
- package/build-module/post-title/edit.js +57 -19
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/query/edit/enhanced-pagination-modal.js +1 -1
- package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -1
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +3 -6
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build-module/rss/edit.js +121 -47
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/separator/edit.js +54 -22
- package/build-module/separator/edit.js.map +1 -1
- package/build-module/shortcode/index.js +2 -1
- package/build-module/shortcode/index.js.map +1 -1
- package/build-module/site-logo/edit.js +54 -20
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/social-link/edit.js +24 -8
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-link/edit.native.js +15 -6
- package/build-module/social-link/edit.native.js.map +1 -1
- package/build-module/social-link/social-list.js +16 -21
- package/build-module/social-link/social-list.js.map +1 -1
- package/build-module/social-link/variations.js +53 -48
- package/build-module/social-link/variations.js.map +1 -1
- package/build-module/social-links/edit.js +40 -47
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/video/tracks-editor.js +65 -23
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/calendar/style-rtl.css +7 -7
- package/build-style/calendar/style.css +7 -7
- package/build-style/comments-pagination/editor-rtl.css +0 -12
- package/build-style/comments-pagination/editor.css +0 -14
- package/build-style/comments-pagination/style-rtl.css +0 -7
- package/build-style/comments-pagination/style.css +0 -9
- package/build-style/editor-rtl.css +9 -21
- package/build-style/editor.css +9 -23
- package/build-style/gallery/style-rtl.css +1 -0
- package/build-style/gallery/style.css +1 -0
- package/build-style/navigation/editor-rtl.css +8 -3
- package/build-style/navigation/editor.css +8 -3
- package/build-style/navigation/style-rtl.css +4 -0
- package/build-style/navigation/style.css +4 -0
- package/build-style/pullquote/editor-rtl.css +1 -1
- package/build-style/pullquote/editor.css +1 -1
- package/build-style/pullquote/style-rtl.css +2 -3
- package/build-style/pullquote/style.css +2 -3
- package/build-style/pullquote/theme-rtl.css +2 -2
- package/build-style/pullquote/theme.css +2 -2
- package/build-style/style-rtl.css +14 -17
- package/build-style/style.css +14 -19
- package/build-style/theme-rtl.css +2 -2
- package/build-style/theme.css +2 -2
- package/package.json +35 -35
- package/src/avatar/edit.js +99 -51
- package/src/avatar/user-control.js +34 -29
- package/src/button/edit.js +44 -29
- package/src/calendar/style.scss +10 -10
- package/src/columns/edit.js +20 -31
- package/src/comment-author-name/edit.js +54 -13
- package/src/comment-date/edit.js +50 -15
- package/src/comment-edit-link/edit.js +39 -11
- package/src/comments/edit/comments-inspector-controls.js +0 -2
- package/src/comments-pagination/edit.js +29 -9
- package/src/comments-pagination/editor.scss +0 -15
- package/src/comments-pagination/style.scss +0 -8
- package/src/comments-title/edit.js +53 -15
- package/src/details/edit.js +36 -4
- package/src/editor.scss +0 -1
- package/src/embed/edit.js +3 -5
- package/src/embed/embed-controls.js +55 -33
- package/src/embed/variations.js +0 -8
- package/src/file/inspector.js +99 -45
- package/src/form/block.json +1 -2
- package/src/form/edit.js +91 -47
- package/src/form/index.js +1 -0
- package/src/form-input/edit.js +56 -18
- package/src/form-input/index.js +1 -0
- package/src/form-submission-notification/index.js +1 -0
- package/src/form-submit-button/index.js +1 -0
- package/src/gallery/style.scss +1 -0
- package/src/image/image.js +1 -0
- package/src/image/index.php +4 -1
- package/src/image/view.js +0 -3
- package/src/latest-posts/edit.js +206 -98
- package/src/list/ordered-list-settings.js +172 -62
- package/src/navigation/edit/index.js +127 -64
- package/src/navigation/edit/overlay-menu-preview.js +43 -26
- package/src/navigation/editor.scss +8 -4
- package/src/navigation/style.scss +8 -0
- package/src/navigation-link/block.json +3 -0
- package/src/navigation-link/edit.js +14 -1
- package/src/navigation-link/index.php +4 -0
- package/src/navigation-link/transforms.js +2 -1
- package/src/navigation-link/update-attributes.js +1 -0
- package/src/navigation-submenu/block.json +3 -0
- package/src/navigation-submenu/index.php +4 -0
- package/src/post-author/edit.js +91 -27
- package/src/post-comments-count/index.js +2 -0
- package/src/post-comments-count/transforms.js +20 -0
- package/src/post-comments-link/index.js +2 -0
- package/src/post-comments-link/transforms.js +20 -0
- package/src/post-navigation-link/edit.js +96 -51
- package/src/post-title/edit.js +76 -24
- package/src/pullquote/editor.scss +1 -1
- package/src/pullquote/style.scss +2 -3
- package/src/pullquote/theme.scss +2 -2
- package/src/query/edit/enhanced-pagination-modal.js +1 -5
- package/src/query/edit/inspector-controls/enhanced-pagination-control.js +3 -13
- package/src/rss/edit.js +141 -55
- package/src/separator/edit.js +66 -21
- package/src/shortcode/block.json +2 -1
- package/src/site-logo/edit.js +69 -26
- package/src/site-title/index.php +1 -1
- package/src/social-link/edit.js +18 -7
- package/src/social-link/edit.native.js +10 -4
- package/src/social-link/index.php +62 -49
- package/src/social-link/social-list.js +15 -20
- package/src/social-link/variations.js +53 -48
- package/src/social-links/edit.js +38 -60
- package/src/video/tracks-editor.js +75 -22
- package/build-style/post-author/editor-rtl.css +0 -140
- package/build-style/post-author/editor.css +0 -140
- package/src/post-author/editor.scss +0 -7
|
@@ -22,6 +22,7 @@ var _compose = require("@wordpress/compose");
|
|
|
22
22
|
var _linkUi = require("./link-ui");
|
|
23
23
|
var _updateAttributes = require("./update-attributes");
|
|
24
24
|
var _utils = require("../navigation/edit/utils");
|
|
25
|
+
var _hooks = require("../utils/hooks");
|
|
25
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
26
27
|
/**
|
|
27
28
|
* External dependencies
|
|
@@ -162,8 +163,18 @@ function Controls({
|
|
|
162
163
|
description,
|
|
163
164
|
rel
|
|
164
165
|
} = attributes;
|
|
166
|
+
const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
|
|
165
167
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToolsPanel, {
|
|
166
168
|
label: (0, _i18n.__)('Settings'),
|
|
169
|
+
resetAll: () => {
|
|
170
|
+
setAttributes({
|
|
171
|
+
label: '',
|
|
172
|
+
url: '',
|
|
173
|
+
description: '',
|
|
174
|
+
rel: ''
|
|
175
|
+
});
|
|
176
|
+
},
|
|
177
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
167
178
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
168
179
|
hasValue: () => !!label,
|
|
169
180
|
label: (0, _i18n.__)('Text'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blocks","_data","_components","_keycodes","_i18n","_blockEditor","_url","_element","_dom","_htmlEntities","_icons","_coreData","_compose","_linkUi","_updateAttributes","_utils","_jsxRuntime","DEFAULT_BLOCK","name","NESTING_BLOCK_NAMES","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","useState","useEffect","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener","useIsInvalidLink","kind","type","id","enabled","isPostType","hasId","Number","isInteger","blockEditingMode","useBlockEditingMode","postStatus","useSelect","select","getEntityRecord","coreStore","status","isInvalid","isDraft","getMissingText","missingText","__","Controls","attributes","setAttributes","setIsLabelFieldFocused","label","url","description","rel","jsxs","__experimentalToolsPanel","children","jsx","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","TextControl","__nextHasNoMarginBottom","__next40pxDefaultSize","value","stripHTML","onChange","labelValue","autoComplete","onFocus","onBlur","safeDecodeURI","urlValue","updateAttributes","TextareaControl","descriptionValue","help","relValue","NavigationLinkEdit","isSelected","insertBlocksAfter","mergeBlocks","onReplace","context","clientId","maxNestingLevel","replaceBlock","__unstableMarkNextChangeAsNotPersistent","selectBlock","selectPreviousBlock","useDispatch","blockEditorStore","isLinkOpen","setIsLinkOpen","openedBy","setOpenedBy","popoverAnchor","setPopoverAnchor","listItemRef","useRef","itemLabelPlaceholder","ref","linkUIref","prevUrl","usePrevious","isLabelFieldFocused","isAtMaxNesting","isTopLevelLink","isParentOfSelectedBlock","hasChildren","validateLinkStatus","getBlockCount","getBlockName","getBlockRootClientId","hasSelectedInnerBlock","getBlockParentsByBlockName","getSelectedBlockClientId","rootClientId","isTopLevel","selectedBlockClientId","rootNavigationClientId","enableLinkStatusValidation","length","getBlocks","transformToSubmenu","innerBlocks","createBlock","newSubmenu","isURL","prependHTTP","test","selectLabelText","focus","defaultView","selection","getSelection","range","createRange","selectNodeContents","removeAllRanges","addRange","removeLink","undefined","opensInNewTab","textColor","customTextColor","backgroundColor","customBackgroundColor","getColors","onKeyDown","isKeyboardEvent","primary","preventDefault","stopPropagation","blockProps","useBlockProps","useMergeRefs","className","clsx","getColorClassName","style","color","innerBlocksProps","useInnerBlocksProps","defaultBlock","directInsert","renderAppender","onClick","classes","placeholderText","Fragment","BlockControls","ToolbarGroup","ToolbarButton","icon","linkIcon","title","shortcut","displayShortcut","currentTarget","addSubmenu","InspectorControls","RichText","identifier","onMerge","__unstableOnSplitAtEnd","placeholder","withoutInteractiveFormatting","decodeEntities","trim","LinkUI","link","onClose","window","document","activeElement","anchor","onRemove","updatedValue"],"sources":["@wordpress/block-library/src/navigation-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tgetColorClassName,\n\tuseInnerBlocksProps,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { isURL, prependHTTP, safeDecodeURI } from '@wordpress/url';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { link as linkIcon, addSubmenu } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMergeRefs, usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { LinkUI } from './link-ui';\nimport { updateAttributes } from './update-attributes';\nimport { getColors } from '../navigation/edit/utils';\n\nconst DEFAULT_BLOCK = { name: 'core/navigation-link' };\nconst NESTING_BLOCK_NAMES = [\n\t'core/navigation-link',\n\t'core/navigation-submenu',\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}, [ elementRef ] );\n\n\treturn isDraggingWithin;\n};\n\nconst useIsInvalidLink = ( kind, type, id, enabled ) => {\n\tconst isPostType =\n\t\tkind === 'post-type' || type === 'post' || type === 'page';\n\tconst hasId = Number.isInteger( id );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst postStatus = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isPostType ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Fetching the posts status is an \"expensive\" operation. Especially for sites with large navigations.\n\t\t\t// When the block is rendered in a template or other disabled contexts we can skip this check in order\n\t\t\t// to avoid all these additional requests that don't really add any value in that mode.\n\t\t\tif ( blockEditingMode === 'disabled' || ! enabled ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\treturn getEntityRecord( 'postType', type, id )?.status;\n\t\t},\n\t\t[ isPostType, blockEditingMode, enabled, type, id ]\n\t);\n\n\t// Check Navigation Link validity if:\n\t// 1. Link is 'post-type'.\n\t// 2. It has an id.\n\t// 3. It's neither null, nor undefined, as valid items might be either of those while loading.\n\t// If those conditions are met, check if\n\t// 1. The post status is published.\n\t// 2. The Navigation Link item has no label.\n\t// If either of those is true, invalidate.\n\tconst isInvalid =\n\t\tisPostType && hasId && postStatus && 'trash' === postStatus;\n\tconst isDraft = 'draft' === postStatus;\n\n\treturn [ isInvalid, isDraft ];\n};\n\nfunction getMissingText( type ) {\n\tlet missingText = '';\n\n\tswitch ( type ) {\n\t\tcase 'post':\n\t\t\t/* translators: label for missing post in navigation link block */\n\t\t\tmissingText = __( 'Select post' );\n\t\t\tbreak;\n\t\tcase 'page':\n\t\t\t/* translators: label for missing page in navigation link block */\n\t\t\tmissingText = __( 'Select page' );\n\t\t\tbreak;\n\t\tcase 'category':\n\t\t\t/* translators: label for missing category in navigation link block */\n\t\t\tmissingText = __( 'Select category' );\n\t\t\tbreak;\n\t\tcase 'tag':\n\t\t\t/* translators: label for missing tag in navigation link block */\n\t\t\tmissingText = __( 'Select tag' );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t/* translators: label for missing values in navigation link block */\n\t\t\tmissingText = __( 'Add link' );\n\t}\n\n\treturn missingText;\n}\n\n/*\n * Warning, this duplicated in\n * packages/block-library/src/navigation-submenu/edit.js\n * Consider reusing this components for both blocks.\n */\nfunction Controls( { attributes, setAttributes, setIsLabelFieldFocused } ) {\n\tconst { label, url, description, rel } = attributes;\n\treturn (\n\t\t<ToolsPanel label={ __( 'Settings' ) }>\n\t\t\t<ToolsPanelItem\n\t\t\t\thasValue={ () => !! label }\n\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\tonDeselect={ () => setAttributes( { label: '' } ) }\n\t\t\t\tisShownByDefault\n\t\t\t>\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\tvalue={ label ? stripHTML( label ) : '' }\n\t\t\t\t\tonChange={ ( labelValue ) => {\n\t\t\t\t\t\tsetAttributes( { label: labelValue } );\n\t\t\t\t\t} }\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\tonFocus={ () => setIsLabelFieldFocused( true ) }\n\t\t\t\t\tonBlur={ () => setIsLabelFieldFocused( false ) }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\n\t\t\t<ToolsPanelItem\n\t\t\t\thasValue={ () => !! url }\n\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\tonDeselect={ () => setAttributes( { url: '' } ) }\n\t\t\t\tisShownByDefault\n\t\t\t>\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\t\tvalue={ url ? safeDecodeURI( url ) : '' }\n\t\t\t\t\tonChange={ ( urlValue ) => {\n\t\t\t\t\t\tupdateAttributes(\n\t\t\t\t\t\t\t{ url: urlValue },\n\t\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\t\tattributes\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\ttype=\"url\"\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\n\t\t\t<ToolsPanelItem\n\t\t\t\thasValue={ () => !! description }\n\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\tonDeselect={ () => setAttributes( { description: '' } ) }\n\t\t\t\tisShownByDefault\n\t\t\t>\n\t\t\t\t<TextareaControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\tvalue={ description || '' }\n\t\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\t\tsetAttributes( { description: descriptionValue } );\n\t\t\t\t\t} }\n\t\t\t\t\thelp={ __(\n\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) }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\n\t\t\t<ToolsPanelItem\n\t\t\t\thasValue={ () => !! rel }\n\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\tonDeselect={ () => setAttributes( { rel: '' } ) }\n\t\t\t\tisShownByDefault\n\t\t\t>\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t\t} }\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t'The relationship of the linked URL as space-separated link types.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t</ToolsPanel>\n\t);\n}\n\nexport default function NavigationLinkEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tmergeBlocks,\n\tonReplace,\n\tcontext,\n\tclientId,\n} ) {\n\tconst { id, label, type, url, description, kind } = attributes;\n\tconst { maxNestingLevel } = context;\n\n\tconst {\n\t\treplaceBlock,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tselectBlock,\n\t\tselectPreviousBlock,\n\t} = useDispatch( blockEditorStore );\n\t// Have the link editing ui open on mount when lacking a url and selected.\n\tconst [ isLinkOpen, setIsLinkOpen ] = useState( isSelected && ! url );\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 label…' );\n\tconst ref = useRef();\n\tconst linkUIref = useRef();\n\tconst prevUrl = usePrevious( url );\n\n\t// Change the label using inspector causes rich text to change focus on firefox.\n\t// This is a workaround to keep the focus on the label field when label filed is focused we don't render the rich text.\n\tconst [ isLabelFieldFocused, setIsLabelFieldFocused ] = useState( false );\n\n\tconst {\n\t\tisAtMaxNesting,\n\t\tisTopLevelLink,\n\t\tisParentOfSelectedBlock,\n\t\thasChildren,\n\t\tvalidateLinkStatus,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst isTopLevel =\n\t\t\t\tgetBlockName( rootClientId ) === 'core/navigation';\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\tconst rootNavigationClientId = isTopLevel\n\t\t\t\t? rootClientId\n\t\t\t\t: getBlockParentsByBlockName(\n\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t'core/navigation'\n\t\t\t\t )[ 0 ];\n\n\t\t\t// Enable when the root Navigation block is selected or any of its inner blocks.\n\t\t\tconst enableLinkStatusValidation =\n\t\t\t\tselectedBlockClientId === rootNavigationClientId ||\n\t\t\t\thasSelectedInnerBlock( rootNavigationClientId, true );\n\n\t\t\treturn {\n\t\t\t\tisAtMaxNesting:\n\t\t\t\t\tgetBlockParentsByBlockName( clientId, NESTING_BLOCK_NAMES )\n\t\t\t\t\t\t.length >= maxNestingLevel,\n\t\t\t\tisTopLevelLink: isTopLevel,\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\thasChildren: !! getBlockCount( clientId ),\n\t\t\t\tvalidateLinkStatus: enableLinkStatusValidation,\n\t\t\t};\n\t\t},\n\t\t[ clientId, maxNestingLevel ]\n\t);\n\tconst { getBlocks } = useSelect( blockEditorStore );\n\n\tconst [ isInvalid, isDraft ] = useIsInvalidLink(\n\t\tkind,\n\t\ttype,\n\t\tid,\n\t\tvalidateLinkStatus\n\t);\n\n\t/**\n\t * Transform to submenu block.\n\t */\n\tconst transformToSubmenu = () => {\n\t\tlet innerBlocks = getBlocks( clientId );\n\t\tif ( innerBlocks.length === 0 ) {\n\t\t\tinnerBlocks = [ createBlock( 'core/navigation-link' ) ];\n\t\t\tselectBlock( innerBlocks[ 0 ].clientId );\n\t\t}\n\t\tconst newSubmenu = createBlock(\n\t\t\t'core/navigation-submenu',\n\t\t\tattributes,\n\t\t\tinnerBlocks\n\t\t);\n\t\treplaceBlock( clientId, newSubmenu );\n\t};\n\n\tuseEffect( () => {\n\t\t// If block has inner blocks, transform to Submenu.\n\t\tif ( hasChildren ) {\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\ttransformToSubmenu();\n\t\t}\n\t}, [ hasChildren ] );\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\t// We only want to do this when the URL has gone from nothing to a new URL AND the label looks like a URL\n\t\tif (\n\t\t\t! prevUrl &&\n\t\t\turl &&\n\t\t\tisLinkOpen &&\n\t\t\tisURL( prependHTTP( label ) ) &&\n\t\t\t/^.+\\.[a-z]+/.test( label )\n\t\t) {\n\t\t\t// Focus and select the label text.\n\t\t\tselectLabelText();\n\t\t}\n\t}, [ prevUrl, url, isLinkOpen, label ] );\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\t/**\n\t * Removes the current link if set.\n\t */\n\tfunction removeLink() {\n\t\t// Reset all attributes that comprise the link.\n\t\t// It is critical that all attributes are reset\n\t\t// to their default values otherwise this may\n\t\t// in advertently trigger side effects because\n\t\t// the values will have \"changed\".\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tlabel: undefined,\n\t\t\tid: undefined,\n\t\t\tkind: undefined,\n\t\t\ttype: undefined,\n\t\t\topensInNewTab: false,\n\t\t} );\n\n\t\t// Close the link editing UI.\n\t\tsetIsLinkOpen( false );\n\t}\n\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t} = getColors( context, ! isTopLevelLink );\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 this link is a child of a parent submenu item, the parent submenu item event will also open, closing this popover\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} ),\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\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\t...blockProps,\n\t\t\tclassName: 'remove-outline', // Remove the outline from the inner blocks container.\n\t\t},\n\t\t{\n\t\t\tdefaultBlock: DEFAULT_BLOCK,\n\t\t\tdirectInsert: true,\n\t\t\trenderAppender: false,\n\t\t}\n\t);\n\n\tif ( ! url || isInvalid || isDraft ) {\n\t\tblockProps.onClick = () => {\n\t\t\tsetIsLinkOpen( true );\n\t\t\tsetOpenedBy( ref.current );\n\t\t};\n\t}\n\n\tconst classes = clsx( 'wp-block-navigation-item__content', {\n\t\t'wp-block-navigation-link__placeholder': ! url || isInvalid || isDraft,\n\t} );\n\n\tconst missingText = getMissingText( type );\n\t/* translators: Whether the navigation link is Invalid or a Draft. */\n\tconst placeholderText = `(${\n\t\tisInvalid ? __( 'Invalid' ) : __( 'Draft' )\n\t})`;\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\ticon={ linkIcon }\n\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\tsetOpenedBy( event.currentTarget );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isAtMaxNesting && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tname=\"submenu\"\n\t\t\t\t\t\t\ticon={ addSubmenu }\n\t\t\t\t\t\t\ttitle={ __( 'Add submenu' ) }\n\t\t\t\t\t\t\tonClick={ transformToSubmenu }\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{ /* Warning, this duplicated in packages/block-library/src/navigation-submenu/edit.js */ }\n\t\t\t<InspectorControls>\n\t\t\t\t<Controls\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tsetIsLabelFieldFocused={ setIsLabelFieldFocused }\n\t\t\t\t/>\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<a className={ classes }>\n\t\t\t\t\t{ /* eslint-enable */ }\n\t\t\t\t\t{ ! url ? (\n\t\t\t\t\t\t<div className=\"wp-block-navigation-link__placeholder-text\">\n\t\t\t\t\t\t\t<span>{ missingText }</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! isInvalid &&\n\t\t\t\t\t\t\t\t! isDraft &&\n\t\t\t\t\t\t\t\t! isLabelFieldFocused && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\n\t\t\t\t\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\t\t\t\t\tonChange={ ( labelValue ) =>\n\t\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: labelValue,\n\t\t\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\t\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\t\t\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'core/navigation-link'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Navigation link text'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t{ description && (\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"wp-block-navigation-item__description\">\n\t\t\t\t\t\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t\t\t\t\t\t</span>\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) }\n\t\t\t\t\t\t\t{ ( isInvalid ||\n\t\t\t\t\t\t\t\tisDraft ||\n\t\t\t\t\t\t\t\tisLabelFieldFocused ) && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t'wp-block-navigation-link__placeholder-text',\n\t\t\t\t\t\t\t\t\t\t'wp-block-navigation-link__label',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'is-invalid': isInvalid,\n\t\t\t\t\t\t\t\t\t\t\t'is-draft': isDraft,\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>\n\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// Some attributes are stored in an escaped form. It's a legacy issue.\n\t\t\t\t\t\t\t\t\t\t\t// Ideally they would be stored in a raw, unescaped form.\n\t\t\t\t\t\t\t\t\t\t\t// Unescape is used here to \"recover\" the escaped characters\n\t\t\t\t\t\t\t\t\t\t\t// so they display without encoding.\n\t\t\t\t\t\t\t\t\t\t\t// See `updateAttributes` for more details.\n\t\t\t\t\t\t\t\t\t\t\t`${ decodeEntities( label ) } ${\n\t\t\t\t\t\t\t\t\t\t\t\tisInvalid || isDraft\n\t\t\t\t\t\t\t\t\t\t\t\t\t? placeholderText\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t\t\t\t\t\t}`.trim()\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\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{ isLinkOpen && (\n\t\t\t\t\t\t<LinkUI\n\t\t\t\t\t\t\tref={ linkUIref }\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\t// If there is no link then remove the auto-inserted block.\n\t\t\t\t\t\t\t\t// This avoids empty blocks which can provided a poor UX.\n\t\t\t\t\t\t\t\tif ( ! url ) {\n\t\t\t\t\t\t\t\t\t// Fixes https://github.com/WordPress/gutenberg/issues/61361\n\t\t\t\t\t\t\t\t\t// There's a chance we're closing due to the user selecting the browse all button.\n\t\t\t\t\t\t\t\t\t// Only move focus if the focus is still within the popover ui. If it's not within\n\t\t\t\t\t\t\t\t\t// the popover, it's because something has taken the focus from the popover, and\n\t\t\t\t\t\t\t\t\t// we don't want to steal it back.\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\tlinkUIref.current.contains(\n\t\t\t\t\t\t\t\t\t\t\twindow.document.activeElement\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t// Select the previous block to keep focus nearby\n\t\t\t\t\t\t\t\t\t\tselectPreviousBlock( clientId, true );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Remove the link.\n\t\t\t\t\t\t\t\t\tonReplace( [] );\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\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 if ( ref.current ) {\n\t\t\t\t\t\t\t\t\t// select the ref when adding a new link\n\t\t\t\t\t\t\t\t\tref.current.focus();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// Fallback\n\t\t\t\t\t\t\t\t\tselectPreviousBlock( clientId, 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\tanchor={ popoverAnchor }\n\t\t\t\t\t\t\tonRemove={ removeLink }\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</a>\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,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAQA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAUA,IAAAO,IAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,IAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,SAAA,GAAAZ,OAAA;AACA,IAAAa,QAAA,GAAAb,OAAA;AAKA,IAAAc,OAAA,GAAAd,OAAA;AACA,IAAAe,iBAAA,GAAAf,OAAA;AACA,IAAAgB,MAAA,GAA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;QAAA,CACA,CACF,EACCjG,UAAU,iBACX,IAAAzF,WAAA,CAAAqD,GAAA,EAACxD,OAAA,CAAA8L,MAAM;UACNzF,GAAG,EAAGC,SAAW;UACjBlB,QAAQ,EAAGA,QAAU;UACrB2G,IAAI,EAAGjJ,UAAY;UACnBkJ,OAAO,EAAGA,CAAA,KAAM;YACf;YACA;YACA,IAAK,CAAE9I,GAAG,EAAG;cACZ;cACA;cACA;cACA;cACA;cACA,IACCoD,SAAS,CAACxF,OAAO,CAACK,QAAQ,CACzB8K,MAAM,CAACC,QAAQ,CAACC,aACjB,CAAC,EACA;gBACD;gBACA1G,mBAAmB,CAAEL,QAAQ,EAAE,IAAK,CAAC;cACtC;;cAEA;cACAF,SAAS,CAAE,EAAG,CAAC;cACf;YACD;YAEAW,aAAa,CAAE,KAAM,CAAC;YACtB,IAAKC,QAAQ,EAAG;cACfA,QAAQ,CAACsC,KAAK,CAAC,CAAC;cAChBrC,WAAW,CAAE,IAAK,CAAC;YACpB,CAAC,MAAM,IAAKM,GAAG,CAACvF,OAAO,EAAG;cACzB;cACAuF,GAAG,CAACvF,OAAO,CAACsH,KAAK,CAAC,CAAC;YACpB,CAAC,MAAM;cACN;cACA3C,mBAAmB,CAAEL,QAAQ,EAAE,IAAK,CAAC;YACtC;UACD,CAAG;UACHgH,MAAM,EAAGpG,aAAe;UACxBqG,QAAQ,EAAGxD,UAAY;UACvB3E,QAAQ,EAAKoI,YAAY,IAAM;YAC9B,IAAA7H,kCAAgB,EACf6H,YAAY,EACZvJ,aAAa,EACbD,UACD,CAAC;UACF;QAAG,CACH,CACD;MAAA,CACC,CAAC,eACJ,IAAA3C,WAAA,CAAAqD,GAAA;QAAA,GAAU0G;MAAgB,CAAI,CAAC;IAAA,CAC3B,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_clsx","_interopRequireDefault","require","_blocks","_data","_components","_keycodes","_i18n","_blockEditor","_url","_element","_dom","_htmlEntities","_icons","_coreData","_compose","_linkUi","_updateAttributes","_utils","_hooks","_jsxRuntime","DEFAULT_BLOCK","name","NESTING_BLOCK_NAMES","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","useState","useEffect","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener","useIsInvalidLink","kind","type","id","enabled","isPostType","hasId","Number","isInteger","blockEditingMode","useBlockEditingMode","postStatus","useSelect","select","getEntityRecord","coreStore","status","isInvalid","isDraft","getMissingText","missingText","__","Controls","attributes","setAttributes","setIsLabelFieldFocused","label","url","description","rel","dropdownMenuProps","useToolsPanelDropdownMenuProps","jsxs","__experimentalToolsPanel","resetAll","children","jsx","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","TextControl","__nextHasNoMarginBottom","__next40pxDefaultSize","value","stripHTML","onChange","labelValue","autoComplete","onFocus","onBlur","safeDecodeURI","urlValue","updateAttributes","TextareaControl","descriptionValue","help","relValue","NavigationLinkEdit","isSelected","insertBlocksAfter","mergeBlocks","onReplace","context","clientId","maxNestingLevel","replaceBlock","__unstableMarkNextChangeAsNotPersistent","selectBlock","selectPreviousBlock","useDispatch","blockEditorStore","isLinkOpen","setIsLinkOpen","openedBy","setOpenedBy","popoverAnchor","setPopoverAnchor","listItemRef","useRef","itemLabelPlaceholder","ref","linkUIref","prevUrl","usePrevious","isLabelFieldFocused","isAtMaxNesting","isTopLevelLink","isParentOfSelectedBlock","hasChildren","validateLinkStatus","getBlockCount","getBlockName","getBlockRootClientId","hasSelectedInnerBlock","getBlockParentsByBlockName","getSelectedBlockClientId","rootClientId","isTopLevel","selectedBlockClientId","rootNavigationClientId","enableLinkStatusValidation","length","getBlocks","transformToSubmenu","innerBlocks","createBlock","newSubmenu","isURL","prependHTTP","test","selectLabelText","focus","defaultView","selection","getSelection","range","createRange","selectNodeContents","removeAllRanges","addRange","removeLink","undefined","opensInNewTab","textColor","customTextColor","backgroundColor","customBackgroundColor","getColors","onKeyDown","isKeyboardEvent","primary","preventDefault","stopPropagation","blockProps","useBlockProps","useMergeRefs","className","clsx","getColorClassName","style","color","innerBlocksProps","useInnerBlocksProps","defaultBlock","directInsert","renderAppender","onClick","classes","placeholderText","Fragment","BlockControls","ToolbarGroup","ToolbarButton","icon","linkIcon","title","shortcut","displayShortcut","currentTarget","addSubmenu","InspectorControls","RichText","identifier","onMerge","__unstableOnSplitAtEnd","placeholder","withoutInteractiveFormatting","decodeEntities","trim","LinkUI","link","onClose","window","document","activeElement","anchor","onRemove","updatedValue"],"sources":["@wordpress/block-library/src/navigation-link/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tgetColorClassName,\n\tuseInnerBlocksProps,\n\tuseBlockEditingMode,\n} from '@wordpress/block-editor';\nimport { isURL, prependHTTP, safeDecodeURI } from '@wordpress/url';\nimport { useState, useEffect, useRef } from '@wordpress/element';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { link as linkIcon, addSubmenu } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMergeRefs, usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { LinkUI } from './link-ui';\nimport { updateAttributes } from './update-attributes';\nimport { getColors } from '../navigation/edit/utils';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst DEFAULT_BLOCK = { name: 'core/navigation-link' };\nconst NESTING_BLOCK_NAMES = [\n\t'core/navigation-link',\n\t'core/navigation-submenu',\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}, [ elementRef ] );\n\n\treturn isDraggingWithin;\n};\n\nconst useIsInvalidLink = ( kind, type, id, enabled ) => {\n\tconst isPostType =\n\t\tkind === 'post-type' || type === 'post' || type === 'page';\n\tconst hasId = Number.isInteger( id );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst postStatus = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isPostType ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Fetching the posts status is an \"expensive\" operation. Especially for sites with large navigations.\n\t\t\t// When the block is rendered in a template or other disabled contexts we can skip this check in order\n\t\t\t// to avoid all these additional requests that don't really add any value in that mode.\n\t\t\tif ( blockEditingMode === 'disabled' || ! enabled ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\treturn getEntityRecord( 'postType', type, id )?.status;\n\t\t},\n\t\t[ isPostType, blockEditingMode, enabled, type, id ]\n\t);\n\n\t// Check Navigation Link validity if:\n\t// 1. Link is 'post-type'.\n\t// 2. It has an id.\n\t// 3. It's neither null, nor undefined, as valid items might be either of those while loading.\n\t// If those conditions are met, check if\n\t// 1. The post status is published.\n\t// 2. The Navigation Link item has no label.\n\t// If either of those is true, invalidate.\n\tconst isInvalid =\n\t\tisPostType && hasId && postStatus && 'trash' === postStatus;\n\tconst isDraft = 'draft' === postStatus;\n\n\treturn [ isInvalid, isDraft ];\n};\n\nfunction getMissingText( type ) {\n\tlet missingText = '';\n\n\tswitch ( type ) {\n\t\tcase 'post':\n\t\t\t/* translators: label for missing post in navigation link block */\n\t\t\tmissingText = __( 'Select post' );\n\t\t\tbreak;\n\t\tcase 'page':\n\t\t\t/* translators: label for missing page in navigation link block */\n\t\t\tmissingText = __( 'Select page' );\n\t\t\tbreak;\n\t\tcase 'category':\n\t\t\t/* translators: label for missing category in navigation link block */\n\t\t\tmissingText = __( 'Select category' );\n\t\t\tbreak;\n\t\tcase 'tag':\n\t\t\t/* translators: label for missing tag in navigation link block */\n\t\t\tmissingText = __( 'Select tag' );\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t/* translators: label for missing values in navigation link block */\n\t\t\tmissingText = __( 'Add link' );\n\t}\n\n\treturn missingText;\n}\n\n/*\n * Warning, this duplicated in\n * packages/block-library/src/navigation-submenu/edit.js\n * Consider reusing this components for both blocks.\n */\nfunction Controls( { attributes, setAttributes, setIsLabelFieldFocused } ) {\n\tconst { label, url, description, rel } = attributes;\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ __( 'Settings' ) }\n\t\t\tresetAll={ () => {\n\t\t\t\tsetAttributes( {\n\t\t\t\t\tlabel: '',\n\t\t\t\t\turl: '',\n\t\t\t\t\tdescription: '',\n\t\t\t\t\trel: '',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t<ToolsPanelItem\n\t\t\t\thasValue={ () => !! label }\n\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\tonDeselect={ () => setAttributes( { label: '' } ) }\n\t\t\t\tisShownByDefault\n\t\t\t>\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\tvalue={ label ? stripHTML( label ) : '' }\n\t\t\t\t\tonChange={ ( labelValue ) => {\n\t\t\t\t\t\tsetAttributes( { label: labelValue } );\n\t\t\t\t\t} }\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\tonFocus={ () => setIsLabelFieldFocused( true ) }\n\t\t\t\t\tonBlur={ () => setIsLabelFieldFocused( false ) }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\n\t\t\t<ToolsPanelItem\n\t\t\t\thasValue={ () => !! url }\n\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\tonDeselect={ () => setAttributes( { url: '' } ) }\n\t\t\t\tisShownByDefault\n\t\t\t>\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\t\tvalue={ url ? safeDecodeURI( url ) : '' }\n\t\t\t\t\tonChange={ ( urlValue ) => {\n\t\t\t\t\t\tupdateAttributes(\n\t\t\t\t\t\t\t{ url: urlValue },\n\t\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\t\tattributes\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\ttype=\"url\"\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\n\t\t\t<ToolsPanelItem\n\t\t\t\thasValue={ () => !! description }\n\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\tonDeselect={ () => setAttributes( { description: '' } ) }\n\t\t\t\tisShownByDefault\n\t\t\t>\n\t\t\t\t<TextareaControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\tvalue={ description || '' }\n\t\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\t\tsetAttributes( { description: descriptionValue } );\n\t\t\t\t\t} }\n\t\t\t\t\thelp={ __(\n\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) }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\n\t\t\t<ToolsPanelItem\n\t\t\t\thasValue={ () => !! rel }\n\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\tonDeselect={ () => setAttributes( { rel: '' } ) }\n\t\t\t\tisShownByDefault\n\t\t\t>\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'Rel attribute' ) }\n\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t\t} }\n\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t'The relationship of the linked URL as space-separated link types.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</ToolsPanelItem>\n\t\t</ToolsPanel>\n\t);\n}\n\nexport default function NavigationLinkEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tinsertBlocksAfter,\n\tmergeBlocks,\n\tonReplace,\n\tcontext,\n\tclientId,\n} ) {\n\tconst { id, label, type, url, description, kind } = attributes;\n\tconst { maxNestingLevel } = context;\n\n\tconst {\n\t\treplaceBlock,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tselectBlock,\n\t\tselectPreviousBlock,\n\t} = useDispatch( blockEditorStore );\n\t// Have the link editing ui open on mount when lacking a url and selected.\n\tconst [ isLinkOpen, setIsLinkOpen ] = useState( isSelected && ! url );\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 label…' );\n\tconst ref = useRef();\n\tconst linkUIref = useRef();\n\tconst prevUrl = usePrevious( url );\n\n\t// Change the label using inspector causes rich text to change focus on firefox.\n\t// This is a workaround to keep the focus on the label field when label filed is focused we don't render the rich text.\n\tconst [ isLabelFieldFocused, setIsLabelFieldFocused ] = useState( false );\n\n\tconst {\n\t\tisAtMaxNesting,\n\t\tisTopLevelLink,\n\t\tisParentOfSelectedBlock,\n\t\thasChildren,\n\t\tvalidateLinkStatus,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockName,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst isTopLevel =\n\t\t\t\tgetBlockName( rootClientId ) === 'core/navigation';\n\t\t\tconst selectedBlockClientId = getSelectedBlockClientId();\n\t\t\tconst rootNavigationClientId = isTopLevel\n\t\t\t\t? rootClientId\n\t\t\t\t: getBlockParentsByBlockName(\n\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t'core/navigation'\n\t\t\t\t )[ 0 ];\n\n\t\t\t// Enable when the root Navigation block is selected or any of its inner blocks.\n\t\t\tconst enableLinkStatusValidation =\n\t\t\t\tselectedBlockClientId === rootNavigationClientId ||\n\t\t\t\thasSelectedInnerBlock( rootNavigationClientId, true );\n\n\t\t\treturn {\n\t\t\t\tisAtMaxNesting:\n\t\t\t\t\tgetBlockParentsByBlockName( clientId, NESTING_BLOCK_NAMES )\n\t\t\t\t\t\t.length >= maxNestingLevel,\n\t\t\t\tisTopLevelLink: isTopLevel,\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\thasChildren: !! getBlockCount( clientId ),\n\t\t\t\tvalidateLinkStatus: enableLinkStatusValidation,\n\t\t\t};\n\t\t},\n\t\t[ clientId, maxNestingLevel ]\n\t);\n\tconst { getBlocks } = useSelect( blockEditorStore );\n\n\tconst [ isInvalid, isDraft ] = useIsInvalidLink(\n\t\tkind,\n\t\ttype,\n\t\tid,\n\t\tvalidateLinkStatus\n\t);\n\n\t/**\n\t * Transform to submenu block.\n\t */\n\tconst transformToSubmenu = () => {\n\t\tlet innerBlocks = getBlocks( clientId );\n\t\tif ( innerBlocks.length === 0 ) {\n\t\t\tinnerBlocks = [ createBlock( 'core/navigation-link' ) ];\n\t\t\tselectBlock( innerBlocks[ 0 ].clientId );\n\t\t}\n\t\tconst newSubmenu = createBlock(\n\t\t\t'core/navigation-submenu',\n\t\t\tattributes,\n\t\t\tinnerBlocks\n\t\t);\n\t\treplaceBlock( clientId, newSubmenu );\n\t};\n\n\tuseEffect( () => {\n\t\t// If block has inner blocks, transform to Submenu.\n\t\tif ( hasChildren ) {\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\ttransformToSubmenu();\n\t\t}\n\t}, [ hasChildren ] );\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\t// We only want to do this when the URL has gone from nothing to a new URL AND the label looks like a URL\n\t\tif (\n\t\t\t! prevUrl &&\n\t\t\turl &&\n\t\t\tisLinkOpen &&\n\t\t\tisURL( prependHTTP( label ) ) &&\n\t\t\t/^.+\\.[a-z]+/.test( label )\n\t\t) {\n\t\t\t// Focus and select the label text.\n\t\t\tselectLabelText();\n\t\t}\n\t}, [ prevUrl, url, isLinkOpen, label ] );\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\t/**\n\t * Removes the current link if set.\n\t */\n\tfunction removeLink() {\n\t\t// Reset all attributes that comprise the link.\n\t\t// It is critical that all attributes are reset\n\t\t// to their default values otherwise this may\n\t\t// in advertently trigger side effects because\n\t\t// the values will have \"changed\".\n\t\tsetAttributes( {\n\t\t\turl: undefined,\n\t\t\tlabel: undefined,\n\t\t\tid: undefined,\n\t\t\tkind: undefined,\n\t\t\ttype: undefined,\n\t\t\topensInNewTab: false,\n\t\t} );\n\n\t\t// Close the link editing UI.\n\t\tsetIsLinkOpen( false );\n\t}\n\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t} = getColors( context, ! isTopLevelLink );\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 this link is a child of a parent submenu item, the parent submenu item event will also open, closing this popover\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} ),\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\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\t...blockProps,\n\t\t\tclassName: 'remove-outline', // Remove the outline from the inner blocks container.\n\t\t},\n\t\t{\n\t\t\tdefaultBlock: DEFAULT_BLOCK,\n\t\t\tdirectInsert: true,\n\t\t\trenderAppender: false,\n\t\t}\n\t);\n\n\tif ( ! url || isInvalid || isDraft ) {\n\t\tblockProps.onClick = () => {\n\t\t\tsetIsLinkOpen( true );\n\t\t\tsetOpenedBy( ref.current );\n\t\t};\n\t}\n\n\tconst classes = clsx( 'wp-block-navigation-item__content', {\n\t\t'wp-block-navigation-link__placeholder': ! url || isInvalid || isDraft,\n\t} );\n\n\tconst missingText = getMissingText( type );\n\t/* translators: Whether the navigation link is Invalid or a Draft. */\n\tconst placeholderText = `(${\n\t\tisInvalid ? __( 'Invalid' ) : __( 'Draft' )\n\t})`;\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\ticon={ linkIcon }\n\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\tsetOpenedBy( event.currentTarget );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isAtMaxNesting && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tname=\"submenu\"\n\t\t\t\t\t\t\ticon={ addSubmenu }\n\t\t\t\t\t\t\ttitle={ __( 'Add submenu' ) }\n\t\t\t\t\t\t\tonClick={ transformToSubmenu }\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{ /* Warning, this duplicated in packages/block-library/src/navigation-submenu/edit.js */ }\n\t\t\t<InspectorControls>\n\t\t\t\t<Controls\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tsetIsLabelFieldFocused={ setIsLabelFieldFocused }\n\t\t\t\t/>\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<a className={ classes }>\n\t\t\t\t\t{ /* eslint-enable */ }\n\t\t\t\t\t{ ! url ? (\n\t\t\t\t\t\t<div className=\"wp-block-navigation-link__placeholder-text\">\n\t\t\t\t\t\t\t<span>{ missingText }</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t{ ! isInvalid &&\n\t\t\t\t\t\t\t\t! isDraft &&\n\t\t\t\t\t\t\t\t! isLabelFieldFocused && (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\n\t\t\t\t\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\t\t\t\t\tonChange={ ( labelValue ) =>\n\t\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: labelValue,\n\t\t\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\t\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\t\t\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\t\t\t\t\t\t\t\tinsertBlocksAfter(\n\t\t\t\t\t\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'core/navigation-link'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\taria-label={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Navigation link text'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t{ description && (\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"wp-block-navigation-item__description\">\n\t\t\t\t\t\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t\t\t\t\t\t</span>\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) }\n\t\t\t\t\t\t\t{ ( isInvalid ||\n\t\t\t\t\t\t\t\tisDraft ||\n\t\t\t\t\t\t\t\tisLabelFieldFocused ) && (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t'wp-block-navigation-link__placeholder-text',\n\t\t\t\t\t\t\t\t\t\t'wp-block-navigation-link__label',\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t'is-invalid': isInvalid,\n\t\t\t\t\t\t\t\t\t\t\t'is-draft': isDraft,\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>\n\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// Some attributes are stored in an escaped form. It's a legacy issue.\n\t\t\t\t\t\t\t\t\t\t\t// Ideally they would be stored in a raw, unescaped form.\n\t\t\t\t\t\t\t\t\t\t\t// Unescape is used here to \"recover\" the escaped characters\n\t\t\t\t\t\t\t\t\t\t\t// so they display without encoding.\n\t\t\t\t\t\t\t\t\t\t\t// See `updateAttributes` for more details.\n\t\t\t\t\t\t\t\t\t\t\t`${ decodeEntities( label ) } ${\n\t\t\t\t\t\t\t\t\t\t\t\tisInvalid || isDraft\n\t\t\t\t\t\t\t\t\t\t\t\t\t? placeholderText\n\t\t\t\t\t\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t\t\t\t\t\t}`.trim()\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\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{ isLinkOpen && (\n\t\t\t\t\t\t<LinkUI\n\t\t\t\t\t\t\tref={ linkUIref }\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\t// If there is no link then remove the auto-inserted block.\n\t\t\t\t\t\t\t\t// This avoids empty blocks which can provided a poor UX.\n\t\t\t\t\t\t\t\tif ( ! url ) {\n\t\t\t\t\t\t\t\t\t// Fixes https://github.com/WordPress/gutenberg/issues/61361\n\t\t\t\t\t\t\t\t\t// There's a chance we're closing due to the user selecting the browse all button.\n\t\t\t\t\t\t\t\t\t// Only move focus if the focus is still within the popover ui. If it's not within\n\t\t\t\t\t\t\t\t\t// the popover, it's because something has taken the focus from the popover, and\n\t\t\t\t\t\t\t\t\t// we don't want to steal it back.\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\tlinkUIref.current.contains(\n\t\t\t\t\t\t\t\t\t\t\twindow.document.activeElement\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t// Select the previous block to keep focus nearby\n\t\t\t\t\t\t\t\t\t\tselectPreviousBlock( clientId, true );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Remove the link.\n\t\t\t\t\t\t\t\t\tonReplace( [] );\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\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 if ( ref.current ) {\n\t\t\t\t\t\t\t\t\t// select the ref when adding a new link\n\t\t\t\t\t\t\t\t\tref.current.focus();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// Fallback\n\t\t\t\t\t\t\t\t\tselectPreviousBlock( clientId, 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\tanchor={ popoverAnchor }\n\t\t\t\t\t\t\tonRemove={ removeLink }\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</a>\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,OAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAQA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAUA,IAAAO,IAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,IAAA,GAAAT,OAAA;AACA,IAAAU,aAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,SAAA,GAAAZ,OAAA;AACA,IAAAa,QAAA,GAAAb,OAAA;AAKA,IAAAc,OAAA,GAAAd,OAAA;AACA,IAAAe,iBAAA,GAAAf,OAAA;AACA,IAAAgB,MAAA,GAAAhB,OAAA;AACA,IAAAiB,MAAA,GAAAjB,OAAA;AAAgE,IAAAkB,WAAA,GAAAl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;QAAG,CACH,CACD;MAAA,CACC,CAAC,eACJ,IAAA3C,WAAA,CAAAwD,GAAA;QAAA,GAAU0G;MAAgB,CAAI,CAAC;IAAA,CAC3B,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_icons","_blockEditor","_hooks","_initBlock","_interopRequireDefault","_edit","_save","_hooks2","_transforms","_jsxRuntime","metadata","exports","$schema","apiVersion","name","title","category","parent","allowedBlocks","description","textdomain","attributes","label","type","rel","id","opensInNewTab","url","kind","isTopLevelLink","usesContext","supports","reusable","html","__experimentalSlashInserter","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalDefaultControls","renaming","interactivity","clientNavigation","editorStyle","style","settings","icon","linkIcon","__experimentalLabel","merge","leftAttributes","rightLabel","edit","save","example","_x","deprecated","isEligible","nofollow","default","migrate","rest","jsx","InnerBlocks","Content","transforms","init","addFilter","enhanceNavigationLinkVariations","initBlock"],"sources":["@wordpress/block-library/src/navigation-link/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { customLink as linkIcon } from '@wordpress/icons';\nimport { InnerBlocks } from '@wordpress/block-editor';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport { enhanceNavigationLinkVariations } from './hooks';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon: linkIcon,\n\n\t__experimentalLabel: ( { label } ) => label,\n\n\tmerge( leftAttributes, { label: rightLabel = '' } ) {\n\t\treturn {\n\t\t\t...leftAttributes,\n\t\t\tlabel: leftAttributes.label + rightLabel,\n\t\t};\n\t},\n\n\tedit,\n\n\tsave,\n\n\texample: {\n\t\tattributes: {\n\t\t\tlabel: _x( 'Example Link', 'navigation link preview example' ),\n\t\t\turl: 'https://example.com',\n\t\t},\n\t},\n\n\tdeprecated: [\n\t\t{\n\t\t\tisEligible( attributes ) {\n\t\t\t\treturn attributes.nofollow;\n\t\t\t},\n\n\t\t\tattributes: {\n\t\t\t\tlabel: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t},\n\t\t\t\ttype: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t},\n\t\t\t\tnofollow: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t},\n\t\t\t\tdescription: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t},\n\t\t\t\tid: {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t},\n\t\t\t\topensInNewTab: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t},\n\t\t\t\turl: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t},\n\t\t\t},\n\n\t\t\tmigrate( { nofollow, ...rest } ) {\n\t\t\t\treturn {\n\t\t\t\t\trel: nofollow ? 'nofollow' : '',\n\t\t\t\t\t...rest,\n\t\t\t\t};\n\t\t\t},\n\n\t\t\tsave() {\n\t\t\t\treturn <InnerBlocks.Content />;\n\t\t\t},\n\t\t},\n\t],\n\ttransforms,\n};\n\nexport const init = () => {\n\taddFilter(\n\t\t'blocks.registerBlockType',\n\t\t'core/navigation-link',\n\t\tenhanceNavigationLinkVariations\n\t);\n\n\treturn initBlock( { name, metadata, settings } );\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAKA,IAAAI,UAAA,GAAAC,sBAAA,CAAAL,OAAA;AAEA,IAAAM,KAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,KAAA,GAAAF,sBAAA,CAAA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,gBAAS,EACR,0BAA0B,EAC1B,sBAAsB,EACtBC,uCACD,CAAC;EAED,OAAO,IAAAC,kBAAS,EAAE;IAAE5D,IAAI;IAAEJ,QAAQ;IAAEwC;EAAS,CAAE,CAAC;AACjD,CAAC;AAACvC,OAAA,CAAA4D,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_icons","_blockEditor","_hooks","_initBlock","_interopRequireDefault","_edit","_save","_hooks2","_transforms","_jsxRuntime","metadata","exports","$schema","apiVersion","name","title","category","parent","allowedBlocks","description","textdomain","attributes","label","type","rel","id","opensInNewTab","url","kind","isTopLevelLink","usesContext","supports","reusable","html","__experimentalSlashInserter","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalDefaultControls","renaming","interactivity","clientNavigation","editorStyle","style","settings","icon","linkIcon","__experimentalLabel","merge","leftAttributes","rightLabel","edit","save","example","_x","deprecated","isEligible","nofollow","default","migrate","rest","jsx","InnerBlocks","Content","transforms","init","addFilter","enhanceNavigationLinkVariations","initBlock"],"sources":["@wordpress/block-library/src/navigation-link/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { customLink as linkIcon } from '@wordpress/icons';\nimport { InnerBlocks } from '@wordpress/block-editor';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport { enhanceNavigationLinkVariations } from './hooks';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon: linkIcon,\n\n\t__experimentalLabel: ( { label } ) => label,\n\n\tmerge( leftAttributes, { label: rightLabel = '' } ) {\n\t\treturn {\n\t\t\t...leftAttributes,\n\t\t\tlabel: leftAttributes.label + rightLabel,\n\t\t};\n\t},\n\n\tedit,\n\n\tsave,\n\n\texample: {\n\t\tattributes: {\n\t\t\tlabel: _x( 'Example Link', 'navigation link preview example' ),\n\t\t\turl: 'https://example.com',\n\t\t},\n\t},\n\n\tdeprecated: [\n\t\t{\n\t\t\tisEligible( attributes ) {\n\t\t\t\treturn attributes.nofollow;\n\t\t\t},\n\n\t\t\tattributes: {\n\t\t\t\tlabel: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t},\n\t\t\t\ttype: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t},\n\t\t\t\tnofollow: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t},\n\t\t\t\tdescription: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t},\n\t\t\t\tid: {\n\t\t\t\t\ttype: 'number',\n\t\t\t\t},\n\t\t\t\topensInNewTab: {\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t},\n\t\t\t\turl: {\n\t\t\t\t\ttype: 'string',\n\t\t\t\t},\n\t\t\t},\n\n\t\t\tmigrate( { nofollow, ...rest } ) {\n\t\t\t\treturn {\n\t\t\t\t\trel: nofollow ? 'nofollow' : '',\n\t\t\t\t\t...rest,\n\t\t\t\t};\n\t\t\t},\n\n\t\t\tsave() {\n\t\t\t\treturn <InnerBlocks.Content />;\n\t\t\t},\n\t\t},\n\t],\n\ttransforms,\n};\n\nexport const init = () => {\n\taddFilter(\n\t\t'blocks.registerBlockType',\n\t\t'core/navigation-link',\n\t\tenhanceNavigationLinkVariations\n\t);\n\n\treturn initBlock( { name, metadata, settings } );\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAKA,IAAAI,UAAA,GAAAC,sBAAA,CAAAL,OAAA;AAEA,IAAAM,KAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,I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VA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM;EACzB,IAAAC,gBAAS,EACR,0BAA0B,EAC1B,sBAAsB,EACtBC,uCACD,CAAC;EAED,OAAO,IAAAC,kBAAS,EAAE;IAAE5D,IAAI;IAAEJ,QAAQ;IAAEwC;EAAS,CAAE,CAAC;AACjD,CAAC;AAACvC,OAAA,CAAA4D,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -104,12 +104,14 @@ const transforms = {
|
|
|
104
104
|
label,
|
|
105
105
|
url,
|
|
106
106
|
rel,
|
|
107
|
+
title,
|
|
107
108
|
opensInNewTab
|
|
108
109
|
}) => {
|
|
109
110
|
return (0, _blocks.createBlock)('core/buttons', {}, [(0, _blocks.createBlock)('core/button', {
|
|
110
111
|
text: label,
|
|
111
112
|
url,
|
|
112
113
|
rel,
|
|
114
|
+
title,
|
|
113
115
|
linkTarget: opensInNewTab ? '_blank' : undefined
|
|
114
116
|
})]);
|
|
115
117
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks","require","transforms","from","type","blocks","transform","createBlock","to","attributes","innerBlocks","showLabel","buttonUseIcon","buttonPosition","label","url","rel","opensInNewTab","text","linkTarget","undefined","_default","exports","default"],"sources":["@wordpress/block-library/src/navigation-link/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/site-logo' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/navigation-link' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/spacer' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/navigation-link' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/home-link' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/navigation-link' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/social-links' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/navigation-link' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/search' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/navigation-link' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/page-list' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/navigation-link' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/buttons' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/navigation-link' );\n\t\t\t},\n\t\t},\n\t],\n\tto: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/navigation-submenu' ],\n\t\t\ttransform: ( attributes, innerBlocks ) =>\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/navigation-submenu',\n\t\t\t\t\tattributes,\n\t\t\t\t\tinnerBlocks\n\t\t\t\t),\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/spacer' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/spacer' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/site-logo' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/site-logo' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/home-link' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/home-link' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/social-links' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/social-links' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/search' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/search', {\n\t\t\t\t\tshowLabel: false,\n\t\t\t\t\tbuttonUseIcon: true,\n\t\t\t\t\tbuttonPosition: 'button-inside',\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/page-list' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/page-list' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/buttons' ],\n\t\t\ttransform: ( { label, url, rel, opensInNewTab } ) => {\n\t\t\t\treturn createBlock( 'core/buttons', {}, [\n\t\t\t\t\tcreateBlock( 'core/button', {\n\t\t\t\t\t\ttext: label,\n\t\t\t\t\t\turl,\n\t\t\t\t\t\trel,\n\t\t\t\t\t\tlinkTarget: opensInNewTab ? '_blank' : undefined,\n\t\t\t\t\t} ),\n\t\t\t\t] );\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,UAAU,GAAG;EAClBC,IAAI,EAAE,CACL;IACCC,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE,CAAE,gBAAgB,CAAE;IAC5BC,SAAS,EAAEA,CAAA,KAAM;MAChB,OAAO,IAAAC,mBAAW,EAAE,sBAAuB,CAAC;IAC7C;EACD,CAAC,EACD;IACCH,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE,CAAE,aAAa,CAAE;IACzBC,SAAS,EAAEA,CAAA,KAAM;MAChB,OAAO,IAAAC,mBAAW,EAAE,sBAAuB,CAAC;IAC7C;EACD,CAAC,EACD;IACCH,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE,CAAE,gBAAgB,CAAE;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AO,IAAAC,mBAAW,EAAE,gBAAiB,CAAC;IACvC;EACD,CAAC,EACD;IACCH,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE,CAAE,gBAAgB,CAAE;IAC5BC,SAAS,EAAEA,CAAA,KAAM;MAChB,OAAO,IAAAC,mBAAW,EAAE,gBAAiB,CAAC;IACvC;EACD,CAAC,EACD;IACCH,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE,CAAE,mBAAmB,CAAE;IAC/BC,SAAS,EAAEA,CAAA,KAAM;MAChB,OAAO,IAAAC,mBAAW,EAAE,mBAAoB,CAAC;IAC1C;EACD,CAAC,EACD;IACCH,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE,CAAE,aAAa,CAAE;IACzBC,SAAS,EAAEA,CAAA,KAAM;MAChB,OAAO,IAAAC,mBAAW,EAAE,aAAa,EAAE;QAClCI,SAAS,EAAE,KAAK;QAChBC,aAAa,EAAE,IAAI;QACnBC,cAAc,EAAE;MACjB,CAAE,CAAC;IACJ;EACD,CAAC,EACD;IACCT,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE,CAAE,gBAAgB,CAAE;IAC5BC,SAAS,EAAEA,CAAA,KAAM;MAChB,OAAO,IAAAC,mBAAW,EAAE,gBAAiB,CAAC;IACvC;EACD,CAAC,EACD;IACCH,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE,CAAE,cAAc,CAAE;IAC1BC,SAAS,EAAEA,CAAE;MAAEQ,KAAK;MAAEC,GAAG;MAAEC,GAAG;MAAEC;IAAc,CAAC,KAAM;
|
|
1
|
+
{"version":3,"names":["_blocks","require","transforms","from","type","blocks","transform","createBlock","to","attributes","innerBlocks","showLabel","buttonUseIcon","buttonPosition","label","url","rel","title","opensInNewTab","text","linkTarget","undefined","_default","exports","default"],"sources":["@wordpress/block-library/src/navigation-link/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/site-logo' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/navigation-link' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/spacer' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/navigation-link' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/home-link' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/navigation-link' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/social-links' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/navigation-link' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/search' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/navigation-link' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/page-list' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/navigation-link' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/buttons' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/navigation-link' );\n\t\t\t},\n\t\t},\n\t],\n\tto: [\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/navigation-submenu' ],\n\t\t\ttransform: ( attributes, innerBlocks ) =>\n\t\t\t\tcreateBlock(\n\t\t\t\t\t'core/navigation-submenu',\n\t\t\t\t\tattributes,\n\t\t\t\t\tinnerBlocks\n\t\t\t\t),\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/spacer' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/spacer' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/site-logo' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/site-logo' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/home-link' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/home-link' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/social-links' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/social-links' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/search' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/search', {\n\t\t\t\t\tshowLabel: false,\n\t\t\t\t\tbuttonUseIcon: true,\n\t\t\t\t\tbuttonPosition: 'button-inside',\n\t\t\t\t} );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/page-list' ],\n\t\t\ttransform: () => {\n\t\t\t\treturn createBlock( 'core/page-list' );\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttype: 'block',\n\t\t\tblocks: [ 'core/buttons' ],\n\t\t\ttransform: ( { label, url, rel, title, opensInNewTab } ) => {\n\t\t\t\treturn createBlock( 'core/buttons', {}, [\n\t\t\t\t\tcreateBlock( 'core/button', {\n\t\t\t\t\t\ttext: label,\n\t\t\t\t\t\turl,\n\t\t\t\t\t\trel,\n\t\t\t\t\t\ttitle,\n\t\t\t\t\t\tlinkTarget: opensInNewTab ? '_blank' : undefined,\n\t\t\t\t\t} ),\n\t\t\t\t] );\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,UAAU,GAAG;EAClBC,IAAI,EAAE,CACL;IACCC,IAAI,EAAE,OAAO;IACbC,MAAM,EAAE,CAAE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E;MAAEQ,KAAK;MAAEC,GAAG;MAAEC,GAAG;MAAEC,KAAK;MAAEC;IAAc,CAAC,KAAM;MAC3D,OAAO,IAAAX,mBAAW,EAAE,cAAc,EAAE,CAAC,CAAC,EAAE,CACvC,IAAAA,mBAAW,EAAE,aAAa,EAAE;QAC3BY,IAAI,EAAEL,KAAK;QACXC,GAAG;QACHC,GAAG;QACHC,KAAK;QACLG,UAAU,EAAEF,aAAa,GAAG,QAAQ,GAAGG;MACxC,CAAE,CAAC,CACF,CAAC;IACJ;EACD,CAAC;AAEH,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEatB,UAAU","ignoreList":[]}
|
|
@@ -25,6 +25,7 @@ var _url = require("@wordpress/url");
|
|
|
25
25
|
* @property {number} [id] A post or term id.
|
|
26
26
|
* @property {boolean} [opensInNewTab] Sets link target to _blank when true.
|
|
27
27
|
* @property {string} [url] Link href.
|
|
28
|
+
* @property {string} [title] Link title attribute.
|
|
28
29
|
*/
|
|
29
30
|
/**
|
|
30
31
|
* Link Control onChange handler that updates block attributes when a setting is changed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_escapeHtml","require","_url","updateAttributes","updatedValue","setAttributes","blockAttributes","label","originalLabel","kind","originalKind","type","originalType","title","newLabel","url","newUrl","opensInNewTab","id","newKind","newType","newLabelWithoutHttp","replace","newUrlWithoutHttp","useNewLabel","escapeHTML","isBuiltInType","indexOf","isCustomLink","encodeURI","safeDecodeURI","undefined","Number","isInteger","exports"],"sources":["@wordpress/block-library/src/navigation-link/update-attributes.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { escapeHTML } from '@wordpress/escape-html';\nimport { safeDecodeURI } from '@wordpress/url';\n\n/**\n * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind\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/**\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 updateAttributes = (\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\n\tconst {\n\t\ttitle: newLabel = '', // the title of any provided Post.\n\t\turl: newUrl = '',\n\t\topensInNewTab,\n\t\tid,\n\t\tkind: newKind = originalKind,\n\t\ttype: newType = originalType,\n\t} = updatedValue;\n\n\tconst newLabelWithoutHttp = newLabel.replace( /http(s?):\\/\\//gi, '' );\n\tconst newUrlWithoutHttp = newUrl.replace( /http(s?):\\/\\//gi, '' );\n\n\tconst useNewLabel =\n\t\tnewLabel &&\n\t\tnewLabel !== originalLabel &&\n\t\t// LinkControl without the title field relies\n\t\t// on the check below. Specifically, it assumes that\n\t\t// the URL is the same as a title.\n\t\t// This logic a) looks suspicious and b) should really\n\t\t// live in the LinkControl and not here. It's a great\n\t\t// candidate for future refactoring.\n\t\tnewLabelWithoutHttp !== newUrlWithoutHttp;\n\n\t// Unfortunately this causes the escaping model to be inverted.\n\t// The escaped content is stored in the block attributes (and ultimately in the database),\n\t// and then the raw data is \"recovered\" when outputting into the DOM.\n\t// It would be preferable to store the **raw** data in the block attributes and escape it in JS.\n\t// Why? Because there isn't one way to escape data. Depending on the context, you need to do\n\t// different transforms. It doesn't make sense to me to choose one of them for the purposes of storage.\n\t// See also:\n\t// - https://github.com/WordPress/gutenberg/pull/41063\n\t// - https://github.com/WordPress/gutenberg/pull/18617.\n\tconst label = useNewLabel\n\t\t? escapeHTML( newLabel )\n\t\t: originalLabel || escapeHTML( newUrlWithoutHttp );\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...( newUrl && { url: encodeURI( safeDecodeURI( newUrl ) ) } ),\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"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,MAAME,gBAAgB,GAAGA,CAC/BC,YAAY,GAAG,CAAC,CAAC,EACjBC,aAAa,EACbC,eAAe,GAAG,CAAC,CAAC,KAChB;EACJ,MAAM;IACLC,KAAK,EAAEC,aAAa,GAAG,EAAE;IACzBC,IAAI,EAAEC,YAAY,GAAG,EAAE;IACvBC,IAAI,EAAEC,YAAY,GAAG;EACtB,CAAC,GAAGN,eAAe;EAEnB,MAAM;IACLO,KAAK,EAAEC,QAAQ,GAAG,EAAE;IAAE;IACtBC,GAAG,EAAEC,MAAM,GAAG,EAAE;IAChBC,aA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C,EAAE,IAAIc,MAAM,CAACC,SAAS,CAAEf,EAAG,CAAC,IAAI;MAAEA;IAAG,CAAC,CAAE;IAC7C,IAAKT,IAAI,IAAI;MAAEA;IAAK,CAAC,CAAE;IACvB,IAAKE,IAAI,IAAIA,IAAI,KAAK,KAAK,IAAI;MAAEA;IAAK,CAAC;EACxC,CAAE,CAAC;AACJ,CAAC;AAACuB,OAAA,CAAA/B,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_escapeHtml","require","_url","updateAttributes","updatedValue","setAttributes","blockAttributes","label","originalLabel","kind","originalKind","type","originalType","title","newLabel","url","newUrl","opensInNewTab","id","newKind","newType","newLabelWithoutHttp","replace","newUrlWithoutHttp","useNewLabel","escapeHTML","isBuiltInType","indexOf","isCustomLink","encodeURI","safeDecodeURI","undefined","Number","isInteger","exports"],"sources":["@wordpress/block-library/src/navigation-link/update-attributes.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { escapeHTML } from '@wordpress/escape-html';\nimport { safeDecodeURI } from '@wordpress/url';\n\n/**\n * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind\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 * 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 updateAttributes = (\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\n\tconst {\n\t\ttitle: newLabel = '', // the title of any provided Post.\n\t\turl: newUrl = '',\n\t\topensInNewTab,\n\t\tid,\n\t\tkind: newKind = originalKind,\n\t\ttype: newType = originalType,\n\t} = updatedValue;\n\n\tconst newLabelWithoutHttp = newLabel.replace( /http(s?):\\/\\//gi, '' );\n\tconst newUrlWithoutHttp = newUrl.replace( /http(s?):\\/\\//gi, '' );\n\n\tconst useNewLabel =\n\t\tnewLabel &&\n\t\tnewLabel !== originalLabel &&\n\t\t// LinkControl without the title field relies\n\t\t// on the check below. Specifically, it assumes that\n\t\t// the URL is the same as a title.\n\t\t// This logic a) looks suspicious and b) should really\n\t\t// live in the LinkControl and not here. It's a great\n\t\t// candidate for future refactoring.\n\t\tnewLabelWithoutHttp !== newUrlWithoutHttp;\n\n\t// Unfortunately this causes the escaping model to be inverted.\n\t// The escaped content is stored in the block attributes (and ultimately in the database),\n\t// and then the raw data is \"recovered\" when outputting into the DOM.\n\t// It would be preferable to store the **raw** data in the block attributes and escape it in JS.\n\t// Why? Because there isn't one way to escape data. Depending on the context, you need to do\n\t// different transforms. It doesn't make sense to me to choose one of them for the purposes of storage.\n\t// See also:\n\t// - https://github.com/WordPress/gutenberg/pull/41063\n\t// - https://github.com/WordPress/gutenberg/pull/18617.\n\tconst label = useNewLabel\n\t\t? escapeHTML( newLabel )\n\t\t: originalLabel || escapeHTML( newUrlWithoutHttp );\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...( newUrl && { url: encodeURI( safeDecodeURI( newUrl ) ) } ),\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"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,MAAME,gBAAgB,GAAGA,CAC/BC,YAAY,GAAG,CAAC,CAAC,EACjBC,aAAa,EACbC,eAAe,GAAG,CAAC,CAAC,KAChB;EACJ,MAAM;IACLC,KAAK,EAAEC,aAAa,GAAG,EAAE;IACzBC,IAAI,EAAEC,YAAY,GAAG,EAAE;IACvBC,IAAI,EAAEC,YAAY,GAAG;EACtB,CAAC,GAAGN,eAAe;EAEnB,MAAM;IACLO,KAAK,EAAEC,QAAQ,GAAG,EAAE;IAAE;IACtBC,GAAG,EAAEC,MAAM,GAAG,EAAE;IAChBC,aAAa;IACbC,EAAE;IACFT,IAAI,EAAEU,OAAO,GAAGT,YAAY;IAC5BC,IAAI,EAAES,OAAO,GAAGR;EACjB,CAAC,GAAGR,YAAY;EAEhB,MAAMiB,mBAAmB,GAAGP,QAAQ,CAACQ,OAAO,CAAE,iBAAiB,EAAE,EAAG,CAAC;EACrE,MAAMC,iBAAiB,GAAGP,MAAM,CAACM,OAAO,CAAE,iBAAiB,EAAE,EAAG,CAAC;EAEjE,MAAME,WAAW,GAChBV,QAAQ,IACRA,QAAQ,KAAKN,aAAa;EAC1B;EACA;EACA;EACA;EACA;EACA;EACAa,mBAAmB,KAAKE,iBAAiB;;EAE1C;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAMhB,KAAK,GAAGiB,WAAW,GACtB,IAAAC,sBAAU,EAAEX,QAAS,CAAC,GACtBN,aAAa,IAAI,IAAAiB,sBAAU,EAAEF,iBAAkB,CAAC;;EAEnD;EACA,MAAMZ,IAAI,GAAGS,OAAO,KAAK,UAAU,GAAG,KAAK,GAAGA,OAAO,CAACE,OAAO,CAAE,GAAG,EAAE,GAAI,CAAC;EAEzE,MAAMI,aAAa,GAClB,CAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAE,CAACC,OAAO,CAAEhB,IAAK,CAAC,GAAG,CAAC,CAAC;EAE3D,MAAMiB,YAAY,GACf,CAAET,OAAO,IAAI,CAAEO,aAAa,IAAMP,OAAO,KAAK,QAAQ;EACzD,MAAMV,IAAI,GAAGmB,YAAY,GAAG,QAAQ,GAAGT,OAAO;EAE9Cd,aAAa,CAAE;IACd;IACA,IAAKW,MAAM,IAAI;MAAED,GAAG,EAAEc,SAAS,CAAE,IAAAC,kBAAa,EAAEd,MAAO,CAAE;IAAE,CAAC,CAAE;IAC9D,IAAKT,KAAK,IAAI;MAAEA;IAAM,CAAC,CAAE;IACzB,IAAKwB,SAAS,KAAKd,aAAa,IAAI;MAAEA;IAAc,CAAC,CAAE;IACvD,IAAKC,EAAE,IAAIc,MAAM,CAACC,SAAS,CAAEf,EAAG,CAAC,IAAI;MAAEA;IAAG,CAAC,CAAE;IAC7C,IAAKT,IAAI,IAAI;MAAEA;IAAK,CAAC,CAAE;IACvB,IAAKE,IAAI,IAAIA,IAAI,KAAK,KAAK,IAAI;MAAEA;IAAK,CAAC;EACxC,CAAE,CAAC;AACJ,CAAC;AAACuB,OAAA,CAAA/B,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_icons","require","_i18n","_initBlock","_interopRequireDefault","_edit","_save","_transforms","metadata","exports","$schema","apiVersion","name","title","category","parent","description","textdomain","attributes","label","type","rel","id","opensInNewTab","url","kind","isTopLevelItem","usesContext","supports","reusable","html","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalDefaultControls","interactivity","clientNavigation","editorStyle","style","settings","icon","context","page","addSubmenu","__experimentalLabel","customName","edit","example","_x","save","transforms","init","initBlock"],"sources":["@wordpress/block-library/src/navigation-submenu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { page, addSubmenu } from '@wordpress/icons';\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon: ( { context } ) => {\n\t\tif ( context === 'list-view' ) {\n\t\t\treturn page;\n\t\t}\n\t\treturn addSubmenu;\n\t},\n\t__experimentalLabel( attributes, { context } ) {\n\t\tconst { label } = attributes;\n\n\t\tconst customName = attributes?.metadata?.name;\n\n\t\t// In the list view, use the block's menu label as the label.\n\t\t// If the menu label is empty, fall back to the default label.\n\t\tif ( context === 'list-view' && ( customName || label ) ) {\n\t\t\treturn attributes?.metadata?.name || label;\n\t\t}\n\n\t\treturn label;\n\t},\n\tedit,\n\texample: {\n\t\tattributes: {\n\t\t\tlabel: _x( 'About', 'Example link text for Navigation Submenu' ),\n\t\t\ttype: 'page',\n\t\t},\n\t},\n\tsave,\n\ttransforms,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,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,MAAM;MAAE5B;IAAM,CAAC,GAAGD,UAAU;IAE5B,MAAMiC,UAAU,GAAGjC,UAAU,EAAEV,QAAQ,EAAEI,IAAI;;IAE7C;IACA;IACA,IAAKmC,OAAO,KAAK,WAAW,KAAMI,UAAU,IAAIhC,KAAK,CAAE,EAAG;MACzD,OAAOD,UAAU,EAAEV,QAAQ,EAAEI,IAAI,IAAIO,KAAK;IAC3C;IAEA,OAAOA,KAAK;EACb,CAAC;EACDiC,IAAI,EAAJA,aAAI;EACJC,OAAO,EAAE;IACRnC,UAAU,EAAE;MACXC,KAAK,EAAE,IAAAmC,QAAE,EAAE,OAAO,EAAE,0CAA2C,CAAC;MAChElC,IAAI,EAAE;IACP;EACD,CAAC;EACDmC,IAAI,EAAJA,aAAI;EACJC,UAAU,EAAVA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAE9C,IAAI;EAAEJ,QAAQ;EAAEqC;AAAS,CAAE,CAAC;AAACpC,OAAA,CAAAgD,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_icons","require","_i18n","_initBlock","_interopRequireDefault","_edit","_save","_transforms","metadata","exports","$schema","apiVersion","name","title","category","parent","description","textdomain","attributes","label","type","rel","id","opensInNewTab","url","kind","isTopLevelItem","usesContext","supports","reusable","html","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalDefaultControls","interactivity","clientNavigation","editorStyle","style","settings","icon","context","page","addSubmenu","__experimentalLabel","customName","edit","example","_x","save","transforms","init","initBlock"],"sources":["@wordpress/block-library/src/navigation-submenu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { page, addSubmenu } from '@wordpress/icons';\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon: ( { context } ) => {\n\t\tif ( context === 'list-view' ) {\n\t\t\treturn page;\n\t\t}\n\t\treturn addSubmenu;\n\t},\n\t__experimentalLabel( attributes, { context } ) {\n\t\tconst { label } = attributes;\n\n\t\tconst customName = attributes?.metadata?.name;\n\n\t\t// In the list view, use the block's menu label as the label.\n\t\t// If the menu label is empty, fall back to the default label.\n\t\tif ( context === 'list-view' && ( customName || label ) ) {\n\t\t\treturn attributes?.metadata?.name || label;\n\t\t}\n\n\t\treturn label;\n\t},\n\tedit,\n\texample: {\n\t\tattributes: {\n\t\t\tlabel: _x( 'About', 'Example link text for Navigation Submenu' ),\n\t\t\ttype: 'page',\n\t\t},\n\t},\n\tsave,\n\ttransforms,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,KAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,WAAA,GAAAH,sBAAA,CAAAH,OAAA;AAbA;AACA;AACA;AAIA;AACA;AACA;AAFA,MAAAO,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,MAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,KAAA;MAAAC,IAAA;IAAA;IAAAA,IAAA;MAAAA,IAAA;IAAA;IAAAJ,WAAA;MAAAI,IAAA;IAAA;IAAAC,GAAA;MAAAD,IAAA;IAAA;IAAAE,EAAA;MAAAF,IAAA;IAAA;IAAAG,aAAA;MAAAH,IAAA;MAAA;IAAA;IAAAI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ACDmC,IAAI,EAAJA,aAAI;EACJC,UAAU,EAAVA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAE9C,IAAI;EAAEJ,QAAQ;EAAEqC;AAAS,CAAE,CAAC;AAACpC,OAAA,CAAAgD,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -11,6 +11,7 @@ var _components = require("@wordpress/components");
|
|
|
11
11
|
var _data = require("@wordpress/data");
|
|
12
12
|
var _i18n = require("@wordpress/i18n");
|
|
13
13
|
var _coreData = require("@wordpress/core-data");
|
|
14
|
+
var _hooks = require("../utils/hooks");
|
|
14
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
16
|
/**
|
|
16
17
|
* External dependencies
|
|
@@ -20,6 +21,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
20
21
|
* WordPress dependencies
|
|
21
22
|
*/
|
|
22
23
|
|
|
24
|
+
/**
|
|
25
|
+
* Internal dependencies
|
|
26
|
+
*/
|
|
27
|
+
|
|
23
28
|
const minimumUsersForCombobox = 25;
|
|
24
29
|
const AUTHORS_QUERY = {
|
|
25
30
|
who: 'authors',
|
|
@@ -36,6 +41,7 @@ function PostAuthorEdit({
|
|
|
36
41
|
setAttributes
|
|
37
42
|
}) {
|
|
38
43
|
const isDescendentOfQueryLoop = Number.isFinite(queryId);
|
|
44
|
+
const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
|
|
39
45
|
const {
|
|
40
46
|
authorId,
|
|
41
47
|
authorDetails,
|
|
@@ -66,7 +72,8 @@ function PostAuthorEdit({
|
|
|
66
72
|
showBio,
|
|
67
73
|
byline,
|
|
68
74
|
isLink,
|
|
69
|
-
linkTarget
|
|
75
|
+
linkTarget,
|
|
76
|
+
avatarSize
|
|
70
77
|
} = attributes;
|
|
71
78
|
const avatarSizes = [];
|
|
72
79
|
const authorName = authorDetails?.name || (0, _i18n.__)('Post Author');
|
|
@@ -109,12 +116,22 @@ function PostAuthorEdit({
|
|
|
109
116
|
}
|
|
110
117
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
111
118
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
|
|
112
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToolsPanel, {
|
|
120
|
+
label: (0, _i18n.__)('Settings'),
|
|
121
|
+
resetAll: () => {
|
|
122
|
+
setAttributes({
|
|
123
|
+
avatarSize: 48,
|
|
124
|
+
showAvatar: true,
|
|
125
|
+
isLink: false,
|
|
126
|
+
linkTarget: '_self'
|
|
127
|
+
});
|
|
128
|
+
},
|
|
129
|
+
dropdownMenuProps: dropdownMenuProps,
|
|
130
|
+
children: [showAuthorControl && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
131
|
+
style: {
|
|
132
|
+
gridColumn: '1 / -1'
|
|
133
|
+
},
|
|
134
|
+
children: showCombobox && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ComboboxControl, {
|
|
118
135
|
__next40pxDefaultSize: true,
|
|
119
136
|
__nextHasNoMarginBottom: true,
|
|
120
137
|
label: (0, _i18n.__)('Author'),
|
|
@@ -129,47 +146,87 @@ function PostAuthorEdit({
|
|
|
129
146
|
value: authorId,
|
|
130
147
|
options: authorOptions,
|
|
131
148
|
onChange: handleSelect
|
|
132
|
-
})
|
|
149
|
+
})
|
|
150
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
151
|
+
label: (0, _i18n.__)('Show avatar'),
|
|
152
|
+
isShownByDefault: true,
|
|
153
|
+
hasValue: () => !showAvatar,
|
|
154
|
+
onDeselect: () => setAttributes({
|
|
155
|
+
showAvatar: true
|
|
156
|
+
}),
|
|
157
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
133
158
|
__nextHasNoMarginBottom: true,
|
|
134
159
|
label: (0, _i18n.__)('Show avatar'),
|
|
135
160
|
checked: showAvatar,
|
|
136
161
|
onChange: () => setAttributes({
|
|
137
162
|
showAvatar: !showAvatar
|
|
138
163
|
})
|
|
139
|
-
})
|
|
164
|
+
})
|
|
165
|
+
}), showAvatar && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
166
|
+
label: (0, _i18n.__)('Avatar size'),
|
|
167
|
+
isShownByDefault: true,
|
|
168
|
+
hasValue: () => avatarSize !== 48,
|
|
169
|
+
onDeselect: () => setAttributes({
|
|
170
|
+
avatarSize: 48
|
|
171
|
+
}),
|
|
172
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
|
|
140
173
|
__next40pxDefaultSize: true,
|
|
141
174
|
__nextHasNoMarginBottom: true,
|
|
142
175
|
label: (0, _i18n.__)('Avatar size'),
|
|
143
|
-
value:
|
|
176
|
+
value: avatarSize,
|
|
144
177
|
options: avatarSizes,
|
|
145
178
|
onChange: size => {
|
|
146
179
|
setAttributes({
|
|
147
180
|
avatarSize: Number(size)
|
|
148
181
|
});
|
|
149
182
|
}
|
|
150
|
-
})
|
|
183
|
+
})
|
|
184
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
185
|
+
label: (0, _i18n.__)('Show bio'),
|
|
186
|
+
isShownByDefault: true,
|
|
187
|
+
hasValue: () => !!showBio,
|
|
188
|
+
onDeselect: () => setAttributes({
|
|
189
|
+
showBio: undefined
|
|
190
|
+
}),
|
|
191
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
151
192
|
__nextHasNoMarginBottom: true,
|
|
152
193
|
label: (0, _i18n.__)('Show bio'),
|
|
153
|
-
checked: showBio,
|
|
194
|
+
checked: !!showBio,
|
|
154
195
|
onChange: () => setAttributes({
|
|
155
196
|
showBio: !showBio
|
|
156
197
|
})
|
|
157
|
-
})
|
|
198
|
+
})
|
|
199
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
200
|
+
label: (0, _i18n.__)('Link author name to author page'),
|
|
201
|
+
isShownByDefault: true,
|
|
202
|
+
hasValue: () => !!isLink,
|
|
203
|
+
onDeselect: () => setAttributes({
|
|
204
|
+
isLink: false
|
|
205
|
+
}),
|
|
206
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
158
207
|
__nextHasNoMarginBottom: true,
|
|
159
208
|
label: (0, _i18n.__)('Link author name to author page'),
|
|
160
209
|
checked: isLink,
|
|
161
210
|
onChange: () => setAttributes({
|
|
162
211
|
isLink: !isLink
|
|
163
212
|
})
|
|
164
|
-
})
|
|
213
|
+
})
|
|
214
|
+
}), isLink && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
|
|
215
|
+
label: (0, _i18n.__)('Link target'),
|
|
216
|
+
isShownByDefault: true,
|
|
217
|
+
hasValue: () => linkTarget !== '_self',
|
|
218
|
+
onDeselect: () => setAttributes({
|
|
219
|
+
linkTarget: '_self'
|
|
220
|
+
}),
|
|
221
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
|
|
165
222
|
__nextHasNoMarginBottom: true,
|
|
166
223
|
label: (0, _i18n.__)('Open in new tab'),
|
|
167
224
|
onChange: value => setAttributes({
|
|
168
225
|
linkTarget: value ? '_blank' : '_self'
|
|
169
226
|
}),
|
|
170
227
|
checked: linkTarget === '_blank'
|
|
171
|
-
})
|
|
172
|
-
})
|
|
228
|
+
})
|
|
229
|
+
})]
|
|
173
230
|
})
|
|
174
231
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockControls, {
|
|
175
232
|
group: "block",
|
|
@@ -186,8 +243,8 @@ function PostAuthorEdit({
|
|
|
186
243
|
children: [showAvatar && authorDetails?.avatar_urls && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
187
244
|
className: "wp-block-post-author__avatar",
|
|
188
245
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
189
|
-
width:
|
|
190
|
-
src: authorDetails.avatar_urls[
|
|
246
|
+
width: avatarSize,
|
|
247
|
+
src: authorDetails.avatar_urls[avatarSize],
|
|
191
248
|
alt: authorDetails.name
|
|
192
249
|
})
|
|
193
250
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|