@wordpress/block-library 9.29.1-next.f34ab90e9.0 → 9.30.1-next.6870dfe5b.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/accordion/edit.js +18 -1
- package/build/accordion/edit.js.map +1 -1
- package/build/accordion/index.js +0 -3
- package/build/accordion/index.js.map +1 -1
- package/build/accordion-content/edit.js +8 -8
- package/build/accordion-content/edit.js.map +1 -1
- package/build/accordion-content/index.js +2 -5
- package/build/accordion-content/index.js.map +1 -1
- package/build/accordion-header/index.js +0 -4
- package/build/accordion-header/index.js.map +1 -1
- package/build/accordion-panel/edit.js +5 -30
- package/build/accordion-panel/edit.js.map +1 -1
- package/build/accordion-panel/index.js +2 -5
- package/build/accordion-panel/index.js.map +1 -1
- package/build/accordion-panel/save.js +3 -29
- package/build/accordion-panel/save.js.map +1 -1
- package/build/audio/edit.js +3 -1
- package/build/audio/edit.js.map +1 -1
- package/build/gallery/index.js +2 -1
- package/build/gallery/index.js.map +1 -1
- package/build/group/variations.js +0 -12
- package/build/group/variations.js.map +1 -1
- package/build/image/image.js +1 -1
- package/build/image/image.js.map +1 -1
- package/build/navigation/constants.js +5 -1
- package/build/navigation/constants.js.map +1 -1
- package/build/navigation/edit/index.js +45 -1
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/leaf-more-menu.js +0 -1
- package/build/navigation/edit/leaf-more-menu.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +40 -5
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation-link/block-inserter.js +69 -0
- package/build/navigation-link/block-inserter.js.map +1 -0
- package/build/navigation-link/dialog-wrapper.js +80 -0
- package/build/navigation-link/dialog-wrapper.js.map +1 -0
- package/build/navigation-link/link-ui.js +80 -116
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/navigation-link/page-creator.js +137 -0
- package/build/navigation-link/page-creator.js.map +1 -0
- package/build/query/edit/index.js.map +1 -1
- package/build/query/edit/query-content.js +7 -6
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/edit/query-placeholder.js +30 -9
- package/build/query/edit/query-placeholder.js.map +1 -1
- package/build/query/edit/query-toolbar.js +4 -2
- package/build/query/edit/query-toolbar.js.map +1 -1
- package/build/search/edit.js +22 -14
- package/build/search/edit.js.map +1 -1
- package/build/template-part/edit/placeholder.js +2 -1
- package/build/template-part/edit/placeholder.js.map +1 -1
- package/build/video/edit.js +3 -1
- package/build/video/edit.js.map +1 -1
- package/build-module/accordion/edit.js +20 -3
- package/build-module/accordion/edit.js.map +1 -1
- package/build-module/accordion/index.js +0 -3
- package/build-module/accordion/index.js.map +1 -1
- package/build-module/accordion-content/edit.js +8 -8
- package/build-module/accordion-content/edit.js.map +1 -1
- package/build-module/accordion-content/index.js +2 -5
- package/build-module/accordion-content/index.js.map +1 -1
- package/build-module/accordion-header/index.js +0 -4
- package/build-module/accordion-header/index.js.map +1 -1
- package/build-module/accordion-panel/edit.js +6 -29
- package/build-module/accordion-panel/edit.js.map +1 -1
- package/build-module/accordion-panel/index.js +2 -5
- package/build-module/accordion-panel/index.js.map +1 -1
- package/build-module/accordion-panel/save.js +4 -28
- package/build-module/accordion-panel/save.js.map +1 -1
- package/build-module/audio/edit.js +4 -2
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/gallery/index.js +2 -1
- package/build-module/gallery/index.js.map +1 -1
- package/build-module/group/variations.js +0 -12
- package/build-module/group/variations.js.map +1 -1
- package/build-module/image/image.js +1 -1
- package/build-module/image/image.js.map +1 -1
- package/build-module/navigation/constants.js +5 -1
- package/build-module/navigation/constants.js.map +1 -1
- package/build-module/navigation/edit/index.js +50 -4
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/leaf-more-menu.js +0 -1
- package/build-module/navigation/edit/leaf-more-menu.js.map +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +40 -5
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation-link/block-inserter.js +61 -0
- package/build-module/navigation-link/block-inserter.js.map +1 -0
- package/build-module/navigation-link/dialog-wrapper.js +75 -0
- package/build-module/navigation-link/dialog-wrapper.js.map +1 -0
- package/build-module/navigation-link/link-ui.js +85 -121
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/navigation-link/page-creator.js +130 -0
- package/build-module/navigation-link/page-creator.js.map +1 -0
- package/build-module/query/edit/index.js.map +1 -1
- package/build-module/query/edit/query-content.js +8 -7
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/edit/query-placeholder.js +30 -10
- package/build-module/query/edit/query-placeholder.js.map +1 -1
- package/build-module/query/edit/query-toolbar.js +4 -2
- package/build-module/query/edit/query-toolbar.js.map +1 -1
- package/build-module/search/edit.js +22 -14
- package/build-module/search/edit.js.map +1 -1
- package/build-module/template-part/edit/placeholder.js +2 -1
- package/build-module/template-part/edit/placeholder.js.map +1 -1
- package/build-module/video/edit.js +4 -2
- package/build-module/video/edit.js.map +1 -1
- package/build-style/accordion/style-rtl.css +8 -18
- package/build-style/accordion/style.css +8 -18
- package/build-style/editor-rtl.css +18 -0
- package/build-style/editor.css +18 -0
- package/build-style/form-input/style-rtl.css +4 -3
- package/build-style/form-input/style.css +4 -3
- package/build-style/navigation-link/editor-rtl.css +14 -0
- package/build-style/navigation-link/editor.css +14 -0
- package/build-style/navigation-link/style-rtl.css +1 -1
- package/build-style/navigation-link/style.css +1 -1
- package/build-style/post-comments-form/style-rtl.css +8 -5
- package/build-style/post-comments-form/style.css +8 -5
- package/build-style/query/editor-rtl.css +4 -0
- package/build-style/query/editor.css +4 -0
- package/build-style/search/style-rtl.css +11 -12
- package/build-style/search/style.css +11 -12
- package/build-style/style-rtl.css +32 -40
- package/build-style/style.css +32 -40
- package/package.json +35 -35
- package/src/accordion/block.json +0 -3
- package/src/accordion/edit.js +20 -0
- package/src/accordion/style.scss +12 -21
- package/src/accordion-content/block.json +2 -4
- package/src/accordion-content/edit.js +21 -27
- package/src/accordion-content/index.js +0 -1
- package/src/accordion-header/block.json +0 -3
- package/src/accordion-header/index.js +0 -1
- package/src/accordion-panel/block.json +2 -4
- package/src/accordion-panel/edit.js +11 -51
- package/src/accordion-panel/index.js +0 -1
- package/src/accordion-panel/save.js +4 -45
- package/src/audio/edit.js +6 -1
- package/src/cover/test/edit.js +1 -5
- package/src/form-input/style.scss +3 -2
- package/src/gallery/block.json +2 -1
- package/src/gallery/index.php +1 -1
- package/src/gallery/test/helpers.native.js +3 -3
- package/src/group/variations.js +0 -12
- package/src/image/image.js +2 -1
- package/src/navigation/constants.js +4 -0
- package/src/navigation/edit/index.js +50 -1
- package/src/navigation/edit/leaf-more-menu.js +0 -1
- package/src/navigation/edit/menu-inspector-controls.js +40 -5
- package/src/navigation-link/block-inserter.js +65 -0
- package/src/navigation-link/dialog-wrapper.js +74 -0
- package/src/navigation-link/editor.scss +17 -0
- package/src/navigation-link/link-ui.js +108 -158
- package/src/navigation-link/page-creator.js +157 -0
- package/src/navigation-link/style.scss +1 -1
- package/src/post-comments-form/style.scss +11 -11
- package/src/post-date/index.php +2 -1
- package/src/query/edit/index.js +1 -0
- package/src/query/edit/query-content.js +8 -4
- package/src/query/edit/query-placeholder.js +47 -17
- package/src/query/edit/query-toolbar.js +10 -2
- package/src/query/editor.scss +6 -1
- package/src/search/edit.js +44 -13
- package/src/search/index.php +16 -2
- package/src/search/style.scss +15 -16
- package/src/template-part/edit/placeholder.js +2 -1
- package/src/video/edit.js +6 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { useSelect } from '@wordpress/data';
|
|
6
|
+
import { store as blockEditorStore, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import DialogWrapper from './dialog-wrapper';
|
|
12
|
+
import { unlock } from '../lock-unlock';
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
const {
|
|
15
|
+
PrivateQuickInserter: QuickInserter
|
|
16
|
+
} = unlock(blockEditorPrivateApis);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Component for inserting blocks within the Navigation Link UI.
|
|
20
|
+
*
|
|
21
|
+
* @param {Object} props Component props.
|
|
22
|
+
* @param {string} props.clientId Client ID of the navigation link block.
|
|
23
|
+
* @param {Function} props.onBack Callback when user wants to go back.
|
|
24
|
+
* @param {Function} props.onBlockInsert Callback when a block is inserted.
|
|
25
|
+
*/
|
|
26
|
+
function LinkUIBlockInserter({
|
|
27
|
+
clientId,
|
|
28
|
+
onBack,
|
|
29
|
+
onBlockInsert
|
|
30
|
+
}) {
|
|
31
|
+
const {
|
|
32
|
+
rootBlockClientId
|
|
33
|
+
} = useSelect(select => {
|
|
34
|
+
const {
|
|
35
|
+
getBlockRootClientId
|
|
36
|
+
} = select(blockEditorStore);
|
|
37
|
+
return {
|
|
38
|
+
rootBlockClientId: getBlockRootClientId(clientId)
|
|
39
|
+
};
|
|
40
|
+
}, [clientId]);
|
|
41
|
+
if (!clientId) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
return /*#__PURE__*/_jsx(DialogWrapper, {
|
|
45
|
+
className: "link-ui-block-inserter",
|
|
46
|
+
title: __('Add block'),
|
|
47
|
+
description: __('Choose a block to add to your Navigation.'),
|
|
48
|
+
onBack: onBack,
|
|
49
|
+
children: /*#__PURE__*/_jsx(QuickInserter, {
|
|
50
|
+
rootClientId: rootBlockClientId,
|
|
51
|
+
clientId: clientId,
|
|
52
|
+
isAppender: false,
|
|
53
|
+
prioritizePatterns: false,
|
|
54
|
+
selectBlockOnInsert: !onBlockInsert,
|
|
55
|
+
onSelect: onBlockInsert ? onBlockInsert : undefined,
|
|
56
|
+
hasSearch: false
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
export default LinkUIBlockInserter;
|
|
61
|
+
//# sourceMappingURL=block-inserter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__","useSelect","store","blockEditorStore","privateApis","blockEditorPrivateApis","DialogWrapper","unlock","jsx","_jsx","PrivateQuickInserter","QuickInserter","LinkUIBlockInserter","clientId","onBack","onBlockInsert","rootBlockClientId","select","getBlockRootClientId","className","title","description","children","rootClientId","isAppender","prioritizePatterns","selectBlockOnInsert","onSelect","undefined","hasSearch"],"sources":["@wordpress/block-library/src/navigation-link/block-inserter.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport DialogWrapper from './dialog-wrapper';\nimport { unlock } from '../lock-unlock';\n\nconst { PrivateQuickInserter: QuickInserter } = unlock(\n\tblockEditorPrivateApis\n);\n\n/**\n * Component for inserting blocks within the Navigation Link UI.\n *\n * @param {Object} props Component props.\n * @param {string} props.clientId Client ID of the navigation link block.\n * @param {Function} props.onBack Callback when user wants to go back.\n * @param {Function} props.onBlockInsert Callback when a block is inserted.\n */\nfunction LinkUIBlockInserter( { clientId, onBack, onBlockInsert } ) {\n\tconst { rootBlockClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId } = select( blockEditorStore );\n\n\t\t\treturn {\n\t\t\t\trootBlockClientId: getBlockRootClientId( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tif ( ! clientId ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<DialogWrapper\n\t\t\tclassName=\"link-ui-block-inserter\"\n\t\t\ttitle={ __( 'Add block' ) }\n\t\t\tdescription={ __( 'Choose a block to add to your Navigation.' ) }\n\t\t\tonBack={ onBack }\n\t\t>\n\t\t\t<QuickInserter\n\t\t\t\trootClientId={ rootBlockClientId }\n\t\t\t\tclientId={ clientId }\n\t\t\t\tisAppender={ false }\n\t\t\t\tprioritizePatterns={ false }\n\t\t\t\tselectBlockOnInsert={ ! onBlockInsert }\n\t\t\t\tonSelect={ onBlockInsert ? onBlockInsert : undefined }\n\t\t\t\thasSearch={ false }\n\t\t\t/>\n\t\t</DialogWrapper>\n\t);\n}\n\nexport default LinkUIBlockInserter;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SACCC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;;AAEhC;AACA;AACA;AACA,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,SAASC,MAAM,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAExC,MAAM;EAAEC,oBAAoB,EAAEC;AAAc,CAAC,GAAGJ,MAAM,CACrDF,sBACD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASO,mBAAmBA,CAAE;EAAEC,QAAQ;EAAEC,MAAM;EAAEC;AAAc,CAAC,EAAG;EACnE,MAAM;IAAEC;EAAkB,CAAC,GAAGf,SAAS,CACpCgB,MAAM,IAAM;IACb,MAAM;MAAEC;IAAqB,CAAC,GAAGD,MAAM,CAAEd,gBAAiB,CAAC;IAE3D,OAAO;MACNa,iBAAiB,EAAEE,oBAAoB,CAAEL,QAAS;IACnD,CAAC;EACF,CAAC,EACD,CAAEA,QAAQ,CACX,CAAC;EAED,IAAK,CAAEA,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,oBACCJ,IAAA,CAACH,aAAa;IACba,SAAS,EAAC,wBAAwB;IAClCC,KAAK,EAAGpB,EAAE,CAAE,WAAY,CAAG;IAC3BqB,WAAW,EAAGrB,EAAE,CAAE,2CAA4C,CAAG;IACjEc,MAAM,EAAGA,MAAQ;IAAAQ,QAAA,eAEjBb,IAAA,CAACE,aAAa;MACbY,YAAY,EAAGP,iBAAmB;MAClCH,QAAQ,EAAGA,QAAU;MACrBW,UAAU,EAAG,KAAO;MACpBC,kBAAkB,EAAG,KAAO;MAC5BC,mBAAmB,EAAG,CAAEX,aAAe;MACvCY,QAAQ,EAAGZ,aAAa,GAAGA,aAAa,GAAGa,SAAW;MACtDC,SAAS,EAAG;IAAO,CACnB;EAAC,CACY,CAAC;AAElB;AAEA,eAAejB,mBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { Button, VisuallyHidden } from '@wordpress/components';
|
|
5
|
+
import { __, isRTL } from '@wordpress/i18n';
|
|
6
|
+
import { chevronLeftSmall, chevronRightSmall } from '@wordpress/icons';
|
|
7
|
+
import { useInstanceId, useFocusOnMount } from '@wordpress/compose';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Shared BackButton component for consistent navigation across LinkUI sub-components.
|
|
11
|
+
*
|
|
12
|
+
* @param {Object} props Component props.
|
|
13
|
+
* @param {string} props.className CSS class name for the button.
|
|
14
|
+
* @param {Function} props.onBack Callback when user wants to go back.
|
|
15
|
+
*/
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
function BackButton({
|
|
18
|
+
className,
|
|
19
|
+
onBack
|
|
20
|
+
}) {
|
|
21
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
22
|
+
className: className,
|
|
23
|
+
icon: isRTL() ? chevronRightSmall : chevronLeftSmall,
|
|
24
|
+
onClick: e => {
|
|
25
|
+
e.preventDefault();
|
|
26
|
+
onBack();
|
|
27
|
+
},
|
|
28
|
+
size: "small",
|
|
29
|
+
children: __('Back')
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Shared DialogWrapper component for consistent dialog structure across LinkUI sub-components.
|
|
35
|
+
*
|
|
36
|
+
* @param {Object} props Component props.
|
|
37
|
+
* @param {string} props.className CSS class name for the dialog container.
|
|
38
|
+
* @param {string} props.title Dialog title for accessibility.
|
|
39
|
+
* @param {string} props.description Dialog description for accessibility.
|
|
40
|
+
* @param {Function} props.onBack Callback when user wants to go back.
|
|
41
|
+
* @param {Object} props.children Child components to render inside the dialog.
|
|
42
|
+
*/
|
|
43
|
+
function DialogWrapper({
|
|
44
|
+
className,
|
|
45
|
+
title,
|
|
46
|
+
description,
|
|
47
|
+
onBack,
|
|
48
|
+
children
|
|
49
|
+
}) {
|
|
50
|
+
const dialogTitleId = useInstanceId(DialogWrapper, 'link-ui-dialog-title');
|
|
51
|
+
const dialogDescriptionId = useInstanceId(DialogWrapper, 'link-ui-dialog-description');
|
|
52
|
+
const focusOnMountRef = useFocusOnMount('firstElement');
|
|
53
|
+
const backButtonClassName = `${className}__back`;
|
|
54
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
55
|
+
className: className,
|
|
56
|
+
role: "dialog",
|
|
57
|
+
"aria-labelledby": dialogTitleId,
|
|
58
|
+
"aria-describedby": dialogDescriptionId,
|
|
59
|
+
ref: focusOnMountRef,
|
|
60
|
+
children: [/*#__PURE__*/_jsxs(VisuallyHidden, {
|
|
61
|
+
children: [/*#__PURE__*/_jsx("h2", {
|
|
62
|
+
id: dialogTitleId,
|
|
63
|
+
children: title
|
|
64
|
+
}), /*#__PURE__*/_jsx("p", {
|
|
65
|
+
id: dialogDescriptionId,
|
|
66
|
+
children: description
|
|
67
|
+
})]
|
|
68
|
+
}), /*#__PURE__*/_jsx(BackButton, {
|
|
69
|
+
className: backButtonClassName,
|
|
70
|
+
onBack: onBack
|
|
71
|
+
}), children]
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
export default DialogWrapper;
|
|
75
|
+
//# sourceMappingURL=dialog-wrapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Button","VisuallyHidden","__","isRTL","chevronLeftSmall","chevronRightSmall","useInstanceId","useFocusOnMount","jsx","_jsx","jsxs","_jsxs","BackButton","className","onBack","icon","onClick","e","preventDefault","size","children","DialogWrapper","title","description","dialogTitleId","dialogDescriptionId","focusOnMountRef","backButtonClassName","role","ref","id"],"sources":["@wordpress/block-library/src/navigation-link/dialog-wrapper.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button, VisuallyHidden } from '@wordpress/components';\nimport { __, isRTL } from '@wordpress/i18n';\nimport { chevronLeftSmall, chevronRightSmall } from '@wordpress/icons';\nimport { useInstanceId, useFocusOnMount } from '@wordpress/compose';\n\n/**\n * Shared BackButton component for consistent navigation across LinkUI sub-components.\n *\n * @param {Object} props Component props.\n * @param {string} props.className CSS class name for the button.\n * @param {Function} props.onBack Callback when user wants to go back.\n */\nfunction BackButton( { className, onBack } ) {\n\treturn (\n\t\t<Button\n\t\t\tclassName={ className }\n\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\tonClick={ ( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tonBack();\n\t\t\t} }\n\t\t\tsize=\"small\"\n\t\t>\n\t\t\t{ __( 'Back' ) }\n\t\t</Button>\n\t);\n}\n\n/**\n * Shared DialogWrapper component for consistent dialog structure across LinkUI sub-components.\n *\n * @param {Object} props Component props.\n * @param {string} props.className CSS class name for the dialog container.\n * @param {string} props.title Dialog title for accessibility.\n * @param {string} props.description Dialog description for accessibility.\n * @param {Function} props.onBack Callback when user wants to go back.\n * @param {Object} props.children Child components to render inside the dialog.\n */\nfunction DialogWrapper( { className, title, description, onBack, children } ) {\n\tconst dialogTitleId = useInstanceId(\n\t\tDialogWrapper,\n\t\t'link-ui-dialog-title'\n\t);\n\tconst dialogDescriptionId = useInstanceId(\n\t\tDialogWrapper,\n\t\t'link-ui-dialog-description'\n\t);\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\tconst backButtonClassName = `${ className }__back`;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ className }\n\t\t\trole=\"dialog\"\n\t\t\taria-labelledby={ dialogTitleId }\n\t\t\taria-describedby={ dialogDescriptionId }\n\t\t\tref={ focusOnMountRef }\n\t\t>\n\t\t\t<VisuallyHidden>\n\t\t\t\t<h2 id={ dialogTitleId }>{ title }</h2>\n\t\t\t\t<p id={ dialogDescriptionId }>{ description }</p>\n\t\t\t</VisuallyHidden>\n\n\t\t\t<BackButton className={ backButtonClassName } onBack={ onBack } />\n\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nexport default DialogWrapper;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,EAAEC,cAAc,QAAQ,uBAAuB;AAC9D,SAASC,EAAE,EAAEC,KAAK,QAAQ,iBAAiB;AAC3C,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,kBAAkB;AACtE,SAASC,aAAa,EAAEC,eAAe,QAAQ,oBAAoB;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AANA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAOA,SAASC,UAAUA,CAAE;EAAEC,SAAS;EAAEC;AAAO,CAAC,EAAG;EAC5C,oBACCL,IAAA,CAACT,MAAM;IACNa,SAAS,EAAGA,SAAW;IACvBE,IAAI,EAAGZ,KAAK,CAAC,CAAC,GAAGE,iBAAiB,GAAGD,gBAAkB;IACvDY,OAAO,EAAKC,CAAC,IAAM;MAClBA,CAAC,CAACC,cAAc,CAAC,CAAC;MAClBJ,MAAM,CAAC,CAAC;IACT,CAAG;IACHK,IAAI,EAAC,OAAO;IAAAC,QAAA,EAEVlB,EAAE,CAAE,MAAO;EAAC,CACP,CAAC;AAEX;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASmB,aAAaA,CAAE;EAAER,SAAS;EAAES,KAAK;EAAEC,WAAW;EAAET,MAAM;EAAEM;AAAS,CAAC,EAAG;EAC7E,MAAMI,aAAa,GAAGlB,aAAa,CAClCe,aAAa,EACb,sBACD,CAAC;EACD,MAAMI,mBAAmB,GAAGnB,aAAa,CACxCe,aAAa,EACb,4BACD,CAAC;EACD,MAAMK,eAAe,GAAGnB,eAAe,CAAE,cAAe,CAAC;EACzD,MAAMoB,mBAAmB,GAAG,GAAId,SAAS,QAAS;EAElD,oBACCF,KAAA;IACCE,SAAS,EAAGA,SAAW;IACvBe,IAAI,EAAC,QAAQ;IACb,mBAAkBJ,aAAe;IACjC,oBAAmBC,mBAAqB;IACxCI,GAAG,EAAGH,eAAiB;IAAAN,QAAA,gBAEvBT,KAAA,CAACV,cAAc;MAAAmB,QAAA,gBACdX,IAAA;QAAIqB,EAAE,EAAGN,aAAe;QAAAJ,QAAA,EAAGE;MAAK,CAAM,CAAC,eACvCb,IAAA;QAAGqB,EAAE,EAAGL,mBAAqB;QAAAL,QAAA,EAAGG;MAAW,CAAK,CAAC;IAAA,CAClC,CAAC,eAEjBd,IAAA,CAACG,UAAU;MAACC,SAAS,EAAGc,mBAAqB;MAACb,MAAM,EAAGA;IAAQ,CAAE,CAAC,EAEhEM,QAAQ;EAAA,CACN,CAAC;AAER;AAEA,eAAeC,aAAa","ignoreList":[]}
|
|
@@ -3,23 +3,18 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __unstableStripHTML as stripHTML } from '@wordpress/dom';
|
|
5
5
|
import { Popover, Button, VisuallyHidden, __experimentalVStack as VStack } from '@wordpress/components';
|
|
6
|
-
import { __
|
|
7
|
-
import { LinkControl,
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { chevronLeftSmall, chevronRightSmall, plus } from '@wordpress/icons';
|
|
13
|
-
import { useInstanceId, useFocusOnMount } from '@wordpress/compose';
|
|
6
|
+
import { __ } from '@wordpress/i18n';
|
|
7
|
+
import { LinkControl, useBlockEditingMode } from '@wordpress/block-editor';
|
|
8
|
+
import { useMemo, useState, useRef, useEffect, forwardRef } from '@wordpress/element';
|
|
9
|
+
import { useResourcePermissions } from '@wordpress/core-data';
|
|
10
|
+
import { plus } from '@wordpress/icons';
|
|
11
|
+
import { useInstanceId } from '@wordpress/compose';
|
|
14
12
|
|
|
15
13
|
/**
|
|
16
14
|
* Internal dependencies
|
|
17
15
|
*/
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
const {
|
|
21
|
-
PrivateQuickInserter: QuickInserter
|
|
22
|
-
} = unlock(blockEditorPrivateApis);
|
|
16
|
+
import { LinkUIPageCreator } from './page-creator';
|
|
17
|
+
import LinkUIBlockInserter from './block-inserter';
|
|
23
18
|
|
|
24
19
|
/**
|
|
25
20
|
* Given the Link block's type attribute, return the query params to give to
|
|
@@ -29,6 +24,7 @@ const {
|
|
|
29
24
|
* @param {string} kind Link block's entity of kind (post-type|taxonomy)
|
|
30
25
|
* @return {{ type?: string, subtype?: string }} Search query params.
|
|
31
26
|
*/
|
|
27
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
32
28
|
export function getSuggestionsQuery(type, kind) {
|
|
33
29
|
switch (type) {
|
|
34
30
|
case 'post':
|
|
@@ -75,59 +71,6 @@ export function getSuggestionsQuery(type, kind) {
|
|
|
75
71
|
};
|
|
76
72
|
}
|
|
77
73
|
}
|
|
78
|
-
function LinkUIBlockInserter({
|
|
79
|
-
clientId,
|
|
80
|
-
onBack
|
|
81
|
-
}) {
|
|
82
|
-
const {
|
|
83
|
-
rootBlockClientId
|
|
84
|
-
} = useSelect(select => {
|
|
85
|
-
const {
|
|
86
|
-
getBlockRootClientId
|
|
87
|
-
} = select(blockEditorStore);
|
|
88
|
-
return {
|
|
89
|
-
rootBlockClientId: getBlockRootClientId(clientId)
|
|
90
|
-
};
|
|
91
|
-
}, [clientId]);
|
|
92
|
-
const focusOnMountRef = useFocusOnMount('firstElement');
|
|
93
|
-
const dialogTitleId = useInstanceId(LinkControl, `link-ui-block-inserter__title`);
|
|
94
|
-
const dialogDescriptionId = useInstanceId(LinkControl, `link-ui-block-inserter__description`);
|
|
95
|
-
if (!clientId) {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
return /*#__PURE__*/_jsxs("div", {
|
|
99
|
-
className: "link-ui-block-inserter",
|
|
100
|
-
role: "dialog",
|
|
101
|
-
"aria-labelledby": dialogTitleId,
|
|
102
|
-
"aria-describedby": dialogDescriptionId,
|
|
103
|
-
ref: focusOnMountRef,
|
|
104
|
-
children: [/*#__PURE__*/_jsxs(VisuallyHidden, {
|
|
105
|
-
children: [/*#__PURE__*/_jsx("h2", {
|
|
106
|
-
id: dialogTitleId,
|
|
107
|
-
children: __('Add block')
|
|
108
|
-
}), /*#__PURE__*/_jsx("p", {
|
|
109
|
-
id: dialogDescriptionId,
|
|
110
|
-
children: __('Choose a block to add to your Navigation.')
|
|
111
|
-
})]
|
|
112
|
-
}), /*#__PURE__*/_jsx(Button, {
|
|
113
|
-
className: "link-ui-block-inserter__back",
|
|
114
|
-
icon: isRTL() ? chevronRightSmall : chevronLeftSmall,
|
|
115
|
-
onClick: e => {
|
|
116
|
-
e.preventDefault();
|
|
117
|
-
onBack();
|
|
118
|
-
},
|
|
119
|
-
size: "small",
|
|
120
|
-
children: __('Back')
|
|
121
|
-
}), /*#__PURE__*/_jsx(QuickInserter, {
|
|
122
|
-
rootClientId: rootBlockClientId,
|
|
123
|
-
clientId: clientId,
|
|
124
|
-
isAppender: false,
|
|
125
|
-
prioritizePatterns: false,
|
|
126
|
-
selectBlockOnInsert: true,
|
|
127
|
-
hasSearch: false
|
|
128
|
-
})]
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
74
|
function UnforwardedLinkUI(props, ref) {
|
|
132
75
|
const {
|
|
133
76
|
label,
|
|
@@ -138,37 +81,13 @@ function UnforwardedLinkUI(props, ref) {
|
|
|
138
81
|
} = props.link;
|
|
139
82
|
const postType = type || 'page';
|
|
140
83
|
const [addingBlock, setAddingBlock] = useState(false);
|
|
84
|
+
const [addingPage, setAddingPage] = useState(false);
|
|
141
85
|
const [focusAddBlockButton, setFocusAddBlockButton] = useState(false);
|
|
142
|
-
const
|
|
143
|
-
saveEntityRecord
|
|
144
|
-
} = useDispatch(coreStore);
|
|
86
|
+
const [focusAddPageButton, setFocusAddPageButton] = useState(false);
|
|
145
87
|
const permissions = useResourcePermissions({
|
|
146
88
|
kind: 'postType',
|
|
147
89
|
name: postType
|
|
148
90
|
});
|
|
149
|
-
async function handleCreate(pageTitle) {
|
|
150
|
-
const page = await saveEntityRecord('postType', postType, {
|
|
151
|
-
title: pageTitle,
|
|
152
|
-
status: 'draft'
|
|
153
|
-
});
|
|
154
|
-
return {
|
|
155
|
-
id: page.id,
|
|
156
|
-
type: postType,
|
|
157
|
-
// Make `title` property consistent with that in `fetchLinkSuggestions` where the `rendered` title (containing HTML entities)
|
|
158
|
-
// is also being decoded. By being consistent in both locations we avoid having to branch in the rendering output code.
|
|
159
|
-
// Ideally in the future we will update both APIs to utilise the "raw" form of the title which is better suited to edit contexts.
|
|
160
|
-
// e.g.
|
|
161
|
-
// - title.raw = "Yes & No"
|
|
162
|
-
// - title.rendered = "Yes & No"
|
|
163
|
-
// - decodeEntities( title.rendered ) = "Yes & No"
|
|
164
|
-
// See:
|
|
165
|
-
// - https://github.com/WordPress/gutenberg/pull/41063
|
|
166
|
-
// - https://github.com/WordPress/gutenberg/blob/a1e1fdc0e6278457e9f4fc0b31ac6d2095f5450b/packages/core-data/src/fetch/__experimental-fetch-link-suggestions.js#L212-L218
|
|
167
|
-
title: decodeEntities(page.title.rendered),
|
|
168
|
-
url: page.link,
|
|
169
|
-
kind: 'post-type'
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
91
|
|
|
173
92
|
// Memoize link value to avoid overriding the LinkControl's internal state.
|
|
174
93
|
// This is a temporary fix. See https://github.com/WordPress/gutenberg/issues/50976#issuecomment-1568226407.
|
|
@@ -177,15 +96,22 @@ function UnforwardedLinkUI(props, ref) {
|
|
|
177
96
|
opensInNewTab,
|
|
178
97
|
title: label && stripHTML(label)
|
|
179
98
|
}), [label, opensInNewTab, url]);
|
|
180
|
-
const
|
|
181
|
-
|
|
99
|
+
const handlePageCreated = pageLink => {
|
|
100
|
+
// Set the new page as the current link
|
|
101
|
+
props.onChange(pageLink);
|
|
102
|
+
// Return to main Link UI
|
|
103
|
+
setAddingPage(false);
|
|
104
|
+
};
|
|
105
|
+
const dialogTitleId = useInstanceId(LinkUI, 'link-ui-link-control__title');
|
|
106
|
+
const dialogDescriptionId = useInstanceId(LinkUI, 'link-ui-link-control__description');
|
|
107
|
+
const blockEditingMode = useBlockEditingMode();
|
|
182
108
|
return /*#__PURE__*/_jsxs(Popover, {
|
|
183
109
|
ref: ref,
|
|
184
110
|
placement: "bottom",
|
|
185
111
|
onClose: props.onClose,
|
|
186
112
|
anchor: props.anchor,
|
|
187
113
|
shift: true,
|
|
188
|
-
children: [!addingBlock && /*#__PURE__*/_jsxs("div", {
|
|
114
|
+
children: [!addingBlock && !addingPage && /*#__PURE__*/_jsxs("div", {
|
|
189
115
|
role: "dialog",
|
|
190
116
|
"aria-labelledby": dialogTitleId,
|
|
191
117
|
"aria-describedby": dialogDescriptionId,
|
|
@@ -202,51 +128,66 @@ function UnforwardedLinkUI(props, ref) {
|
|
|
202
128
|
hasRichPreviews: true,
|
|
203
129
|
value: link,
|
|
204
130
|
showInitialSuggestions: true,
|
|
205
|
-
withCreateSuggestion:
|
|
206
|
-
createSuggestion: handleCreate,
|
|
207
|
-
createSuggestionButtonText: searchTerm => {
|
|
208
|
-
let format;
|
|
209
|
-
if (type === 'post') {
|
|
210
|
-
/* translators: %s: search term. */
|
|
211
|
-
format = __('Create draft post: <mark>%s</mark>');
|
|
212
|
-
} else {
|
|
213
|
-
/* translators: %s: search term. */
|
|
214
|
-
format = __('Create draft page: <mark>%s</mark>');
|
|
215
|
-
}
|
|
216
|
-
return createInterpolateElement(sprintf(format, searchTerm), {
|
|
217
|
-
mark: /*#__PURE__*/_jsx("mark", {})
|
|
218
|
-
});
|
|
219
|
-
},
|
|
131
|
+
withCreateSuggestion: false,
|
|
220
132
|
noDirectEntry: !!type,
|
|
221
133
|
noURLSuggestion: !!type,
|
|
222
134
|
suggestionsQuery: getSuggestionsQuery(type, kind),
|
|
223
135
|
onChange: props.onChange,
|
|
224
136
|
onRemove: props.onRemove,
|
|
225
137
|
onCancel: props.onCancel,
|
|
226
|
-
renderControlBottom: () =>
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
setFocusAddBlockButton(false);
|
|
138
|
+
renderControlBottom: () => {
|
|
139
|
+
// Don't show the tools when there is submitted link (preview state).
|
|
140
|
+
if (link?.url?.length) {
|
|
141
|
+
return null;
|
|
231
142
|
}
|
|
232
|
-
|
|
143
|
+
return /*#__PURE__*/_jsx(LinkUITools, {
|
|
144
|
+
focusAddBlockButton: focusAddBlockButton,
|
|
145
|
+
focusAddPageButton: focusAddPageButton,
|
|
146
|
+
setAddingBlock: () => {
|
|
147
|
+
setAddingBlock(true);
|
|
148
|
+
setFocusAddBlockButton(false);
|
|
149
|
+
},
|
|
150
|
+
setAddingPage: () => {
|
|
151
|
+
setAddingPage(true);
|
|
152
|
+
setFocusAddPageButton(false);
|
|
153
|
+
},
|
|
154
|
+
canAddPage: permissions?.canCreate && type === 'page',
|
|
155
|
+
canAddBlock: blockEditingMode === 'default'
|
|
156
|
+
});
|
|
157
|
+
}
|
|
233
158
|
})]
|
|
234
159
|
}), addingBlock && /*#__PURE__*/_jsx(LinkUIBlockInserter, {
|
|
235
160
|
clientId: props.clientId,
|
|
236
161
|
onBack: () => {
|
|
237
162
|
setAddingBlock(false);
|
|
238
163
|
setFocusAddBlockButton(true);
|
|
239
|
-
|
|
164
|
+
setFocusAddPageButton(false);
|
|
165
|
+
},
|
|
166
|
+
onBlockInsert: props?.onBlockInsert
|
|
167
|
+
}), addingPage && /*#__PURE__*/_jsx(LinkUIPageCreator, {
|
|
168
|
+
postType: postType,
|
|
169
|
+
onBack: () => {
|
|
170
|
+
setAddingPage(false);
|
|
171
|
+
setFocusAddPageButton(true);
|
|
172
|
+
setFocusAddBlockButton(false);
|
|
173
|
+
},
|
|
174
|
+
onPageCreated: handlePageCreated,
|
|
175
|
+
initialTitle: link?.url || ''
|
|
240
176
|
})]
|
|
241
177
|
});
|
|
242
178
|
}
|
|
243
179
|
export const LinkUI = forwardRef(UnforwardedLinkUI);
|
|
244
180
|
const LinkUITools = ({
|
|
245
181
|
setAddingBlock,
|
|
246
|
-
|
|
182
|
+
setAddingPage,
|
|
183
|
+
focusAddBlockButton,
|
|
184
|
+
focusAddPageButton,
|
|
185
|
+
canAddPage,
|
|
186
|
+
canAddBlock
|
|
247
187
|
}) => {
|
|
248
188
|
const blockInserterAriaRole = 'listbox';
|
|
249
189
|
const addBlockButtonRef = useRef();
|
|
190
|
+
const addPageButtonRef = useRef();
|
|
250
191
|
|
|
251
192
|
// Focus the add block button when the popover is opened.
|
|
252
193
|
useEffect(() => {
|
|
@@ -254,9 +195,32 @@ const LinkUITools = ({
|
|
|
254
195
|
addBlockButtonRef.current?.focus();
|
|
255
196
|
}
|
|
256
197
|
}, [focusAddBlockButton]);
|
|
257
|
-
|
|
198
|
+
|
|
199
|
+
// Focus the add page button when the popover is opened.
|
|
200
|
+
useEffect(() => {
|
|
201
|
+
if (focusAddPageButton) {
|
|
202
|
+
addPageButtonRef.current?.focus();
|
|
203
|
+
}
|
|
204
|
+
}, [focusAddPageButton]);
|
|
205
|
+
|
|
206
|
+
// Don't render anything if neither button should be shown
|
|
207
|
+
if (!canAddPage && !canAddBlock) {
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
return /*#__PURE__*/_jsxs(VStack, {
|
|
211
|
+
spacing: 0,
|
|
258
212
|
className: "link-ui-tools",
|
|
259
|
-
children: /*#__PURE__*/_jsx(Button, {
|
|
213
|
+
children: [canAddPage && /*#__PURE__*/_jsx(Button, {
|
|
214
|
+
__next40pxDefaultSize: true,
|
|
215
|
+
ref: addPageButtonRef,
|
|
216
|
+
icon: plus,
|
|
217
|
+
onClick: e => {
|
|
218
|
+
e.preventDefault();
|
|
219
|
+
setAddingPage(true);
|
|
220
|
+
},
|
|
221
|
+
"aria-haspopup": blockInserterAriaRole,
|
|
222
|
+
children: __('Create page')
|
|
223
|
+
}), canAddBlock && /*#__PURE__*/_jsx(Button, {
|
|
260
224
|
__next40pxDefaultSize: true,
|
|
261
225
|
ref: addBlockButtonRef,
|
|
262
226
|
icon: plus,
|
|
@@ -266,7 +230,7 @@ const LinkUITools = ({
|
|
|
266
230
|
},
|
|
267
231
|
"aria-haspopup": blockInserterAriaRole,
|
|
268
232
|
children: __('Add block')
|
|
269
|
-
})
|
|
233
|
+
})]
|
|
270
234
|
});
|
|
271
235
|
};
|
|
272
236
|
export default LinkUITools;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__unstableStripHTML","stripHTML","Popover","Button","VisuallyHidden","__experimentalVStack","VStack","__","sprintf","isRTL","LinkControl","store","blockEditorStore","privateApis","blockEditorPrivateApis","createInterpolateElement","useMemo","useState","useRef","useEffect","forwardRef","coreStore","useResourcePermissions","decodeEntities","useSelect","useDispatch","chevronLeftSmall","chevronRightSmall","plus","useInstanceId","useFocusOnMount","unlock","jsx","_jsx","jsxs","_jsxs","PrivateQuickInserter","QuickInserter","getSuggestionsQuery","type","kind","subtype","initialSuggestionsSearchOptions","perPage","LinkUIBlockInserter","clientId","onBack","rootBlockClientId","select","getBlockRootClientId","focusOnMountRef","dialogTitleId","dialogDescriptionId","className","role","ref","children","id","icon","onClick","e","preventDefault","size","rootClientId","isAppender","prioritizePatterns","selectBlockOnInsert","hasSearch","UnforwardedLinkUI","props","label","url","opensInNewTab","link","postType","addingBlock","setAddingBlock","focusAddBlockButton","setFocusAddBlockButton","saveEntityRecord","permissions","name","handleCreate","pageTitle","page","title","status","rendered","LinkUI","placement","onClose","anchor","shift","hasTextControl","hasRichPreviews","value","showInitialSuggestions","withCreateSuggestion","canCreate","createSuggestion","createSuggestionButtonText","searchTerm","format","mark","noDirectEntry","noURLSuggestion","suggestionsQuery","onChange","onRemove","onCancel","renderControlBottom","length","LinkUITools","blockInserterAriaRole","addBlockButtonRef","current","focus","__next40pxDefaultSize"],"sources":["@wordpress/block-library/src/navigation-link/link-ui.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport {\n\tPopover,\n\tButton,\n\tVisuallyHidden,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __, sprintf, isRTL } from '@wordpress/i18n';\nimport {\n\tLinkControl,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport {\n\tcreateInterpolateElement,\n\tuseMemo,\n\tuseState,\n\tuseRef,\n\tuseEffect,\n\tforwardRef,\n} from '@wordpress/element';\nimport {\n\tstore as coreStore,\n\tuseResourcePermissions,\n} from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { chevronLeftSmall, chevronRightSmall, plus } from '@wordpress/icons';\nimport { useInstanceId, useFocusOnMount } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nconst { PrivateQuickInserter: QuickInserter } = unlock(\n\tblockEditorPrivateApis\n);\n\n/**\n * Given the Link block's type attribute, return the query params to give to\n * /wp/v2/search.\n *\n * @param {string} type Link block's type attribute.\n * @param {string} kind Link block's entity of kind (post-type|taxonomy)\n * @return {{ type?: string, subtype?: string }} Search query params.\n */\nexport function getSuggestionsQuery( type, kind ) {\n\tswitch ( type ) {\n\t\tcase 'post':\n\t\tcase 'page':\n\t\t\treturn { type: 'post', subtype: type };\n\t\tcase 'category':\n\t\t\treturn { type: 'term', subtype: 'category' };\n\t\tcase 'tag':\n\t\t\treturn { type: 'term', subtype: 'post_tag' };\n\t\tcase 'post_format':\n\t\t\treturn { type: 'post-format' };\n\t\tdefault:\n\t\t\tif ( kind === 'taxonomy' ) {\n\t\t\t\treturn { type: 'term', subtype: type };\n\t\t\t}\n\t\t\tif ( kind === 'post-type' ) {\n\t\t\t\treturn { type: 'post', subtype: type };\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t// for custom link which has no type\n\t\t\t\t// always show pages as initial suggestions\n\t\t\t\tinitialSuggestionsSearchOptions: {\n\t\t\t\t\ttype: 'post',\n\t\t\t\t\tsubtype: 'page',\n\t\t\t\t\tperPage: 20,\n\t\t\t\t},\n\t\t\t};\n\t}\n}\n\nfunction LinkUIBlockInserter( { clientId, onBack } ) {\n\tconst { rootBlockClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId } = select( blockEditorStore );\n\n\t\t\treturn {\n\t\t\t\trootBlockClientId: getBlockRootClientId( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst focusOnMountRef = useFocusOnMount( 'firstElement' );\n\n\tconst dialogTitleId = useInstanceId(\n\t\tLinkControl,\n\t\t`link-ui-block-inserter__title`\n\t);\n\tconst dialogDescriptionId = useInstanceId(\n\t\tLinkControl,\n\t\t`link-ui-block-inserter__description`\n\t);\n\n\tif ( ! clientId ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"link-ui-block-inserter\"\n\t\t\trole=\"dialog\"\n\t\t\taria-labelledby={ dialogTitleId }\n\t\t\taria-describedby={ dialogDescriptionId }\n\t\t\tref={ focusOnMountRef }\n\t\t>\n\t\t\t<VisuallyHidden>\n\t\t\t\t<h2 id={ dialogTitleId }>{ __( 'Add block' ) }</h2>\n\n\t\t\t\t<p id={ dialogDescriptionId }>\n\t\t\t\t\t{ __( 'Choose a block to add to your Navigation.' ) }\n\t\t\t\t</p>\n\t\t\t</VisuallyHidden>\n\n\t\t\t<Button\n\t\t\t\tclassName=\"link-ui-block-inserter__back\"\n\t\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\t\tonClick={ ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tonBack();\n\t\t\t\t} }\n\t\t\t\tsize=\"small\"\n\t\t\t>\n\t\t\t\t{ __( 'Back' ) }\n\t\t\t</Button>\n\n\t\t\t<QuickInserter\n\t\t\t\trootClientId={ rootBlockClientId }\n\t\t\t\tclientId={ clientId }\n\t\t\t\tisAppender={ false }\n\t\t\t\tprioritizePatterns={ false }\n\t\t\t\tselectBlockOnInsert\n\t\t\t\thasSearch={ false }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nfunction UnforwardedLinkUI( props, ref ) {\n\tconst { label, url, opensInNewTab, type, kind } = props.link;\n\tconst postType = type || 'page';\n\n\tconst [ addingBlock, setAddingBlock ] = useState( false );\n\tconst [ focusAddBlockButton, setFocusAddBlockButton ] = useState( false );\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst permissions = useResourcePermissions( {\n\t\tkind: 'postType',\n\t\tname: postType,\n\t} );\n\n\tasync function handleCreate( pageTitle ) {\n\t\tconst page = await saveEntityRecord( 'postType', postType, {\n\t\t\ttitle: pageTitle,\n\t\t\tstatus: 'draft',\n\t\t} );\n\n\t\treturn {\n\t\t\tid: page.id,\n\t\t\ttype: postType,\n\t\t\t// Make `title` property consistent with that in `fetchLinkSuggestions` where the `rendered` title (containing HTML entities)\n\t\t\t// is also being decoded. By being consistent in both locations we avoid having to branch in the rendering output code.\n\t\t\t// Ideally in the future we will update both APIs to utilise the \"raw\" form of the title which is better suited to edit contexts.\n\t\t\t// e.g.\n\t\t\t// - title.raw = \"Yes & No\"\n\t\t\t// - title.rendered = \"Yes & No\"\n\t\t\t// - decodeEntities( title.rendered ) = \"Yes & No\"\n\t\t\t// See:\n\t\t\t// - https://github.com/WordPress/gutenberg/pull/41063\n\t\t\t// - https://github.com/WordPress/gutenberg/blob/a1e1fdc0e6278457e9f4fc0b31ac6d2095f5450b/packages/core-data/src/fetch/__experimental-fetch-link-suggestions.js#L212-L218\n\t\t\ttitle: decodeEntities( page.title.rendered ),\n\t\t\turl: page.link,\n\t\t\tkind: 'post-type',\n\t\t};\n\t}\n\n\t// Memoize link value to avoid overriding the LinkControl's internal state.\n\t// This is a temporary fix. See https://github.com/WordPress/gutenberg/issues/50976#issuecomment-1568226407.\n\tconst link = useMemo(\n\t\t() => ( {\n\t\t\turl,\n\t\t\topensInNewTab,\n\t\t\ttitle: label && stripHTML( label ),\n\t\t} ),\n\t\t[ label, opensInNewTab, url ]\n\t);\n\n\tconst dialogTitleId = useInstanceId(\n\t\tLinkUI,\n\t\t`link-ui-link-control__title`\n\t);\n\tconst dialogDescriptionId = useInstanceId(\n\t\tLinkUI,\n\t\t`link-ui-link-control__description`\n\t);\n\n\treturn (\n\t\t<Popover\n\t\t\tref={ ref }\n\t\t\tplacement=\"bottom\"\n\t\t\tonClose={ props.onClose }\n\t\t\tanchor={ props.anchor }\n\t\t\tshift\n\t\t>\n\t\t\t{ ! addingBlock && (\n\t\t\t\t<div\n\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\taria-labelledby={ dialogTitleId }\n\t\t\t\t\taria-describedby={ dialogDescriptionId }\n\t\t\t\t>\n\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t<h2 id={ dialogTitleId }>{ __( 'Add link' ) }</h2>\n\n\t\t\t\t\t\t<p id={ dialogDescriptionId }>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Search for and add a link to your Navigation.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t<LinkControl\n\t\t\t\t\t\thasTextControl\n\t\t\t\t\t\thasRichPreviews\n\t\t\t\t\t\tvalue={ link }\n\t\t\t\t\t\tshowInitialSuggestions\n\t\t\t\t\t\twithCreateSuggestion={ permissions.canCreate }\n\t\t\t\t\t\tcreateSuggestion={ handleCreate }\n\t\t\t\t\t\tcreateSuggestionButtonText={ ( searchTerm ) => {\n\t\t\t\t\t\t\tlet format;\n\n\t\t\t\t\t\t\tif ( type === 'post' ) {\n\t\t\t\t\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t\t\t\t\tformat = __(\n\t\t\t\t\t\t\t\t\t'Create draft post: <mark>%s</mark>'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t\t\t\t\tformat = __(\n\t\t\t\t\t\t\t\t\t'Create draft page: <mark>%s</mark>'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn createInterpolateElement(\n\t\t\t\t\t\t\t\tsprintf( format, searchTerm ),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmark: <mark />,\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\tnoDirectEntry={ !! type }\n\t\t\t\t\t\tnoURLSuggestion={ !! type }\n\t\t\t\t\t\tsuggestionsQuery={ getSuggestionsQuery( type, kind ) }\n\t\t\t\t\t\tonChange={ props.onChange }\n\t\t\t\t\t\tonRemove={ props.onRemove }\n\t\t\t\t\t\tonCancel={ props.onCancel }\n\t\t\t\t\t\trenderControlBottom={ () =>\n\t\t\t\t\t\t\t! link?.url?.length && (\n\t\t\t\t\t\t\t\t<LinkUITools\n\t\t\t\t\t\t\t\t\tfocusAddBlockButton={ focusAddBlockButton }\n\t\t\t\t\t\t\t\t\tsetAddingBlock={ () => {\n\t\t\t\t\t\t\t\t\t\tsetAddingBlock( true );\n\t\t\t\t\t\t\t\t\t\tsetFocusAddBlockButton( false );\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)\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t{ addingBlock && (\n\t\t\t\t<LinkUIBlockInserter\n\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\tonBack={ () => {\n\t\t\t\t\t\tsetAddingBlock( false );\n\t\t\t\t\t\tsetFocusAddBlockButton( true );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</Popover>\n\t);\n}\n\nexport const LinkUI = forwardRef( UnforwardedLinkUI );\n\nconst LinkUITools = ( { setAddingBlock, focusAddBlockButton } ) => {\n\tconst blockInserterAriaRole = 'listbox';\n\tconst addBlockButtonRef = useRef();\n\n\t// Focus the add block button when the popover is opened.\n\tuseEffect( () => {\n\t\tif ( focusAddBlockButton ) {\n\t\t\taddBlockButtonRef.current?.focus();\n\t\t}\n\t}, [ focusAddBlockButton ] );\n\n\treturn (\n\t\t<VStack className=\"link-ui-tools\">\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tref={ addBlockButtonRef }\n\t\t\t\ticon={ plus }\n\t\t\t\tonClick={ ( e ) => {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\tsetAddingBlock( true );\n\t\t\t\t} }\n\t\t\t\taria-haspopup={ blockInserterAriaRole }\n\t\t\t>\n\t\t\t\t{ __( 'Add block' ) }\n\t\t\t</Button>\n\t\t</VStack>\n\t);\n};\n\nexport default LinkUITools;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,mBAAmB,IAAIC,SAAS,QAAQ,gBAAgB;AACjE,SACCC,OAAO,EACPC,MAAM,EACNC,cAAc,EACdC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,EAAE,EAAEC,OAAO,EAAEC,KAAK,QAAQ,iBAAiB;AACpD,SACCC,WAAW,EACXC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SACCC,wBAAwB,EACxBC,OAAO,EACPC,QAAQ,EACRC,MAAM,EACNC,SAA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C,cAAc;EAAEC;AAAoB,CAAC,KAAM;EAClE,MAAMoC,qBAAqB,GAAG,SAAS;EACvC,MAAMC,iBAAiB,GAAGhG,MAAM,CAAC,CAAC;;EAElC;EACAC,SAAS,CAAE,MAAM;IAChB,IAAK0D,mBAAmB,EAAG;MAC1BqC,iBAAiB,CAACC,OAAO,EAAEC,KAAK,CAAC,CAAC;IACnC;EACD,CAAC,EAAE,CAAEvC,mBAAmB,CAAG,CAAC;EAE5B,oBACC5C,IAAA,CAAC3B,MAAM;IAAC+C,SAAS,EAAC,eAAe;IAAAG,QAAA,eAChCvB,IAAA,CAAC9B,MAAM;MACNkH,qBAAqB;MACrB9D,GAAG,EAAG2D,iBAAmB;MACzBxD,IAAI,EAAG9B,IAAM;MACb+B,OAAO,EAAKC,CAAC,IAAM;QAClBA,CAAC,CAACC,cAAc,CAAC,CAAC;QAClBe,cAAc,CAAE,IAAK,CAAC;MACvB,CAAG;MACH,iBAAgBqC,qBAAuB;MAAAzD,QAAA,EAErCjD,EAAE,CAAE,WAAY;IAAC,CACZ;EAAC,CACF,CAAC;AAEX,CAAC;AAED,eAAeyG,WAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__unstableStripHTML","stripHTML","Popover","Button","VisuallyHidden","__experimentalVStack","VStack","__","LinkControl","useBlockEditingMode","useMemo","useState","useRef","useEffect","forwardRef","useResourcePermissions","plus","useInstanceId","LinkUIPageCreator","LinkUIBlockInserter","jsx","_jsx","jsxs","_jsxs","getSuggestionsQuery","type","kind","subtype","initialSuggestionsSearchOptions","perPage","UnforwardedLinkUI","props","ref","label","url","opensInNewTab","link","postType","addingBlock","setAddingBlock","addingPage","setAddingPage","focusAddBlockButton","setFocusAddBlockButton","focusAddPageButton","setFocusAddPageButton","permissions","name","title","handlePageCreated","pageLink","onChange","dialogTitleId","LinkUI","dialogDescriptionId","blockEditingMode","placement","onClose","anchor","shift","children","role","id","hasTextControl","hasRichPreviews","value","showInitialSuggestions","withCreateSuggestion","noDirectEntry","noURLSuggestion","suggestionsQuery","onRemove","onCancel","renderControlBottom","length","LinkUITools","canAddPage","canCreate","canAddBlock","clientId","onBack","onBlockInsert","onPageCreated","initialTitle","blockInserterAriaRole","addBlockButtonRef","addPageButtonRef","current","focus","spacing","className","__next40pxDefaultSize","icon","onClick","e","preventDefault"],"sources":["@wordpress/block-library/src/navigation-link/link-ui.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport {\n\tPopover,\n\tButton,\n\tVisuallyHidden,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { LinkControl, useBlockEditingMode } from '@wordpress/block-editor';\nimport {\n\tuseMemo,\n\tuseState,\n\tuseRef,\n\tuseEffect,\n\tforwardRef,\n} from '@wordpress/element';\nimport { useResourcePermissions } from '@wordpress/core-data';\nimport { plus } from '@wordpress/icons';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { LinkUIPageCreator } from './page-creator';\nimport LinkUIBlockInserter from './block-inserter';\n\n/**\n * Given the Link block's type attribute, return the query params to give to\n * /wp/v2/search.\n *\n * @param {string} type Link block's type attribute.\n * @param {string} kind Link block's entity of kind (post-type|taxonomy)\n * @return {{ type?: string, subtype?: string }} Search query params.\n */\nexport function getSuggestionsQuery( type, kind ) {\n\tswitch ( type ) {\n\t\tcase 'post':\n\t\tcase 'page':\n\t\t\treturn { type: 'post', subtype: type };\n\t\tcase 'category':\n\t\t\treturn { type: 'term', subtype: 'category' };\n\t\tcase 'tag':\n\t\t\treturn { type: 'term', subtype: 'post_tag' };\n\t\tcase 'post_format':\n\t\t\treturn { type: 'post-format' };\n\t\tdefault:\n\t\t\tif ( kind === 'taxonomy' ) {\n\t\t\t\treturn { type: 'term', subtype: type };\n\t\t\t}\n\t\t\tif ( kind === 'post-type' ) {\n\t\t\t\treturn { type: 'post', subtype: type };\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t// for custom link which has no type\n\t\t\t\t// always show pages as initial suggestions\n\t\t\t\tinitialSuggestionsSearchOptions: {\n\t\t\t\t\ttype: 'post',\n\t\t\t\t\tsubtype: 'page',\n\t\t\t\t\tperPage: 20,\n\t\t\t\t},\n\t\t\t};\n\t}\n}\n\nfunction UnforwardedLinkUI( props, ref ) {\n\tconst { label, url, opensInNewTab, type, kind } = props.link;\n\tconst postType = type || 'page';\n\n\tconst [ addingBlock, setAddingBlock ] = useState( false );\n\tconst [ addingPage, setAddingPage ] = useState( false );\n\tconst [ focusAddBlockButton, setFocusAddBlockButton ] = useState( false );\n\tconst [ focusAddPageButton, setFocusAddPageButton ] = useState( false );\n\tconst permissions = useResourcePermissions( {\n\t\tkind: 'postType',\n\t\tname: postType,\n\t} );\n\n\t// Memoize link value to avoid overriding the LinkControl's internal state.\n\t// This is a temporary fix. See https://github.com/WordPress/gutenberg/issues/50976#issuecomment-1568226407.\n\tconst link = useMemo(\n\t\t() => ( {\n\t\t\turl,\n\t\t\topensInNewTab,\n\t\t\ttitle: label && stripHTML( label ),\n\t\t} ),\n\t\t[ label, opensInNewTab, url ]\n\t);\n\n\tconst handlePageCreated = ( pageLink ) => {\n\t\t// Set the new page as the current link\n\t\tprops.onChange( pageLink );\n\t\t// Return to main Link UI\n\t\tsetAddingPage( false );\n\t};\n\n\tconst dialogTitleId = useInstanceId(\n\t\tLinkUI,\n\t\t'link-ui-link-control__title'\n\t);\n\tconst dialogDescriptionId = useInstanceId(\n\t\tLinkUI,\n\t\t'link-ui-link-control__description'\n\t);\n\n\tconst blockEditingMode = useBlockEditingMode();\n\n\treturn (\n\t\t<Popover\n\t\t\tref={ ref }\n\t\t\tplacement=\"bottom\"\n\t\t\tonClose={ props.onClose }\n\t\t\tanchor={ props.anchor }\n\t\t\tshift\n\t\t>\n\t\t\t{ ! addingBlock && ! addingPage && (\n\t\t\t\t<div\n\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\taria-labelledby={ dialogTitleId }\n\t\t\t\t\taria-describedby={ dialogDescriptionId }\n\t\t\t\t>\n\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t<h2 id={ dialogTitleId }>{ __( 'Add link' ) }</h2>\n\n\t\t\t\t\t\t<p id={ dialogDescriptionId }>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Search for and add a link to your Navigation.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t<LinkControl\n\t\t\t\t\t\thasTextControl\n\t\t\t\t\t\thasRichPreviews\n\t\t\t\t\t\tvalue={ link }\n\t\t\t\t\t\tshowInitialSuggestions\n\t\t\t\t\t\twithCreateSuggestion={ false }\n\t\t\t\t\t\tnoDirectEntry={ !! type }\n\t\t\t\t\t\tnoURLSuggestion={ !! type }\n\t\t\t\t\t\tsuggestionsQuery={ getSuggestionsQuery( type, kind ) }\n\t\t\t\t\t\tonChange={ props.onChange }\n\t\t\t\t\t\tonRemove={ props.onRemove }\n\t\t\t\t\t\tonCancel={ props.onCancel }\n\t\t\t\t\t\trenderControlBottom={ () => {\n\t\t\t\t\t\t\t// Don't show the tools when there is submitted link (preview state).\n\t\t\t\t\t\t\tif ( link?.url?.length ) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<LinkUITools\n\t\t\t\t\t\t\t\t\tfocusAddBlockButton={ focusAddBlockButton }\n\t\t\t\t\t\t\t\t\tfocusAddPageButton={ focusAddPageButton }\n\t\t\t\t\t\t\t\t\tsetAddingBlock={ () => {\n\t\t\t\t\t\t\t\t\t\tsetAddingBlock( true );\n\t\t\t\t\t\t\t\t\t\tsetFocusAddBlockButton( false );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tsetAddingPage={ () => {\n\t\t\t\t\t\t\t\t\t\tsetAddingPage( true );\n\t\t\t\t\t\t\t\t\t\tsetFocusAddPageButton( false );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tcanAddPage={\n\t\t\t\t\t\t\t\t\t\tpermissions?.canCreate &&\n\t\t\t\t\t\t\t\t\t\ttype === 'page'\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcanAddBlock={\n\t\t\t\t\t\t\t\t\t\tblockEditingMode === 'default'\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);\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t{ addingBlock && (\n\t\t\t\t<LinkUIBlockInserter\n\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\tonBack={ () => {\n\t\t\t\t\t\tsetAddingBlock( false );\n\t\t\t\t\t\tsetFocusAddBlockButton( true );\n\t\t\t\t\t\tsetFocusAddPageButton( false );\n\t\t\t\t\t} }\n\t\t\t\t\tonBlockInsert={ props?.onBlockInsert }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t{ addingPage && (\n\t\t\t\t<LinkUIPageCreator\n\t\t\t\t\tpostType={ postType }\n\t\t\t\t\tonBack={ () => {\n\t\t\t\t\t\tsetAddingPage( false );\n\t\t\t\t\t\tsetFocusAddPageButton( true );\n\t\t\t\t\t\tsetFocusAddBlockButton( false );\n\t\t\t\t\t} }\n\t\t\t\t\tonPageCreated={ handlePageCreated }\n\t\t\t\t\tinitialTitle={ link?.url || '' }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</Popover>\n\t);\n}\n\nexport const LinkUI = forwardRef( UnforwardedLinkUI );\n\nconst LinkUITools = ( {\n\tsetAddingBlock,\n\tsetAddingPage,\n\tfocusAddBlockButton,\n\tfocusAddPageButton,\n\tcanAddPage,\n\tcanAddBlock,\n} ) => {\n\tconst blockInserterAriaRole = 'listbox';\n\tconst addBlockButtonRef = useRef();\n\tconst addPageButtonRef = useRef();\n\n\t// Focus the add block button when the popover is opened.\n\tuseEffect( () => {\n\t\tif ( focusAddBlockButton ) {\n\t\t\taddBlockButtonRef.current?.focus();\n\t\t}\n\t}, [ focusAddBlockButton ] );\n\n\t// Focus the add page button when the popover is opened.\n\tuseEffect( () => {\n\t\tif ( focusAddPageButton ) {\n\t\t\taddPageButtonRef.current?.focus();\n\t\t}\n\t}, [ focusAddPageButton ] );\n\n\t// Don't render anything if neither button should be shown\n\tif ( ! canAddPage && ! canAddBlock ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack spacing={ 0 } className=\"link-ui-tools\">\n\t\t\t{ canAddPage && (\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tref={ addPageButtonRef }\n\t\t\t\t\ticon={ plus }\n\t\t\t\t\tonClick={ ( e ) => {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tsetAddingPage( true );\n\t\t\t\t\t} }\n\t\t\t\t\taria-haspopup={ blockInserterAriaRole }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Create page' ) }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t\t{ canAddBlock && (\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tref={ addBlockButtonRef }\n\t\t\t\t\ticon={ plus }\n\t\t\t\t\tonClick={ ( e ) => {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tsetAddingBlock( true );\n\t\t\t\t\t} }\n\t\t\t\t\taria-haspopup={ blockInserterAriaRole }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Add block' ) }\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</VStack>\n\t);\n};\n\nexport default LinkUITools;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,mBAAmB,IAAIC,SAAS,QAAQ,gBAAgB;AACjE,SACCC,OAAO,EACPC,MAAM,EACNC,cAAc,EACdC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC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