@wordpress/block-library 8.12.4 → 8.12.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/build/block/edit.js +1 -1
  2. package/build/block/edit.js.map +1 -1
  3. package/build/block/edit.native.js +4 -7
  4. package/build/block/edit.native.js.map +1 -1
  5. package/build/navigation/edit/index.js +1 -1
  6. package/build/navigation/edit/index.js.map +1 -1
  7. package/build/navigation/edit/menu-inspector-controls.js +0 -1
  8. package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
  9. package/build/navigation-link/edit.js +0 -11
  10. package/build/navigation-link/edit.js.map +1 -1
  11. package/build/navigation-link/link-ui.js +12 -2
  12. package/build/navigation-link/link-ui.js.map +1 -1
  13. package/build-module/block/edit.js +1 -1
  14. package/build-module/block/edit.js.map +1 -1
  15. package/build-module/block/edit.native.js +5 -7
  16. package/build-module/block/edit.native.js.map +1 -1
  17. package/build-module/navigation/edit/index.js +1 -1
  18. package/build-module/navigation/edit/index.js.map +1 -1
  19. package/build-module/navigation/edit/menu-inspector-controls.js +0 -1
  20. package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
  21. package/build-module/navigation-link/edit.js +1 -12
  22. package/build-module/navigation-link/edit.js.map +1 -1
  23. package/build-module/navigation-link/link-ui.js +13 -3
  24. package/build-module/navigation-link/link-ui.js.map +1 -1
  25. package/build-style/footnotes/style-rtl.css +2 -2
  26. package/build-style/footnotes/style.css +2 -2
  27. package/build-style/style-rtl.css +2 -2
  28. package/build-style/style.css +2 -2
  29. package/package.json +12 -12
  30. package/src/block/edit.js +2 -2
  31. package/src/block/edit.native.js +6 -10
  32. package/src/footnotes/index.php +11 -9
  33. package/src/footnotes/style.scss +2 -2
  34. package/src/navigation/edit/index.js +1 -2
  35. package/src/navigation/edit/menu-inspector-controls.js +0 -1
  36. package/src/navigation-link/edit.js +1 -15
  37. package/src/navigation-link/link-ui.js +14 -2
  38. package/src/navigation-submenu/index.php +2 -2
  39. package/src/social-link/index.php +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/navigation-link/link-ui.js"],"names":["__unstableStripHTML","stripHTML","Popover","Button","__","sprintf","__experimentalLinkControl","LinkControl","BlockIcon","store","blockEditorStore","createInterpolateElement","useMemo","coreStore","decodeEntities","switchToBlockType","useSelect","useDispatch","getSuggestionsQuery","type","kind","subtype","LinkControlTransforms","clientId","getBlock","blockTransforms","select","_getBlock","getBlockRootClientId","getBlockTransformItems","replaceBlock","featuredBlocks","transforms","filter","item","includes","name","length","map","index","icon","title","LinkUI","props","saveEntityRecord","handleCreate","pageTitle","postType","link","page","status","id","rendered","url","label","opensInNewTab","onClose","anchor","className","hasCreateSuggestion","searchTerm","format","mark","onChange","onRemove","onCancel"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,mBAAmB,IAAIC,SAAhC,QAAiD,gBAAjD;AACA,SAASC,OAAT,EAAkBC,MAAlB,QAAgC,uBAAhC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SACCC,yBAAyB,IAAIC,WAD9B,EAECC,SAFD,EAGCC,KAAK,IAAIC,gBAHV,QAIO,yBAJP;AAKA,SAASC,wBAAT,EAAmCC,OAAnC,QAAkD,oBAAlD;AACA,SAASH,KAAK,IAAII,SAAlB,QAAmC,sBAAnC;AACA,SAASC,cAAT,QAA+B,0BAA/B;AACA,SAASC,iBAAT,QAAkC,mBAAlC;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,mBAAT,CAA8BC,IAA9B,EAAoCC,IAApC,EAA2C;AACjD,UAASD,IAAT;AACC,SAAK,MAAL;AACA,SAAK,MAAL;AACC,aAAO;AAAEA,QAAAA,IAAI,EAAE,MAAR;AAAgBE,QAAAA,OAAO,EAAEF;AAAzB,OAAP;;AACD,SAAK,UAAL;AACC,aAAO;AAAEA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EAAuB;AACtB;AACA0C,QAAAA,MAAM,GAAGzD,EAAE,CAAE,oCAAF,CAAX;AACA,OAHD,MAGO;AACN;AACAyD,QAAAA,MAAM,GAAGzD,EAAE,CAAE,oCAAF,CAAX;AACA;;AAED,aAAOO,wBAAwB,CAC9BN,OAAO,CAAEwD,MAAF,EAAUD,UAAV,CADuB,EAE9B;AACCE,QAAAA,IAAI,EAAE;AADP,OAF8B,CAA/B;AAMA,KAzBF;AA0BC,IAAA,aAAa,EAAG,CAAC,CAAE3C,IA1BpB;AA2BC,IAAA,eAAe,EAAG,CAAC,CAAEA,IA3BtB;AA4BC,IAAA,gBAAgB,EAAGD,mBAAmB,CAAEC,IAAF,EAAQC,IAAR,CA5BvC;AA6BC,IAAA,QAAQ,EAAGuB,KAAK,CAACoB,QA7BlB;AA8BC,IAAA,QAAQ,EAAGpB,KAAK,CAACqB,QA9BlB;AA+BC,IAAA,QAAQ,EAAGrB,KAAK,CAACsB,QA/BlB;AAgCC,IAAA,mBAAmB,EAClB,CAAEZ,GAAF,GACG,MACA,cAAC,qBAAD;AACC,MAAA,QAAQ,EAAGV,KAAK,CAACpB;AADlB,MAFH,GAMG;AAvCL,IAND,CADD;AAmDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { Popover, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__experimentalLinkControl as LinkControl,\n\tBlockIcon,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { createInterpolateElement, useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { switchToBlockType } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\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}\n}\n\n/**\n * Add transforms to Link Control\n *\n * @param {Object} props Component props.\n * @param {string} props.clientId Block client ID.\n */\nfunction LinkControlTransforms( { clientId } ) {\n\tconst { getBlock, blockTransforms } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlock: _getBlock,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockTransformItems,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\treturn {\n\t\t\t\tgetBlock: _getBlock,\n\t\t\t\tblockTransforms: getBlockTransformItems(\n\t\t\t\t\t_getBlock( clientId ),\n\t\t\t\t\tgetBlockRootClientId( clientId )\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\n\tconst featuredBlocks = [\n\t\t'core/page-list',\n\t\t'core/site-logo',\n\t\t'core/social-links',\n\t\t'core/search',\n\t];\n\n\tconst transforms = blockTransforms.filter( ( item ) => {\n\t\treturn featuredBlocks.includes( item.name );\n\t} );\n\n\tif ( ! transforms?.length ) {\n\t\treturn null;\n\t}\n\n\tif ( ! clientId ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"link-control-transform\">\n\t\t\t<h3 className=\"link-control-transform__subheading\">\n\t\t\t\t{ __( 'Transform' ) }\n\t\t\t</h3>\n\t\t\t<div className=\"link-control-transform__items\">\n\t\t\t\t{ transforms.map( ( item, index ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey={ `transform-${ index }` }\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\treplaceBlock(\n\t\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\t\tswitchToBlockType(\n\t\t\t\t\t\t\t\t\t\tgetBlock( clientId ),\n\t\t\t\t\t\t\t\t\t\titem.name\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\tclassName=\"link-control-transform__item\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockIcon icon={ item.icon } />\n\t\t\t\t\t\t\t{ item.title }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport function LinkUI( props ) {\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\tasync function handleCreate( pageTitle ) {\n\t\tconst postType = props.link.type || 'page';\n\n\t\tconst page = await saveEntityRecord( 'postType', postType, {\n\t\t\ttitle: pageTitle,\n\t\t\tstatus: 'draft',\n\t\t} );\n\n\t\treturn {\n\t\t\tid: page.id,\n\t\t\ttype: postType,\n\t\t\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 &#038; 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\tconst { label, url, opensInNewTab, type, kind } = props.link;\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\treturn (\n\t\t<Popover\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<LinkControl\n\t\t\t\thasTextControl\n\t\t\t\thasRichPreviews\n\t\t\t\tclassName={ props.className }\n\t\t\t\tvalue={ link }\n\t\t\t\tshowInitialSuggestions={ true }\n\t\t\t\twithCreateSuggestion={ props.hasCreateSuggestion }\n\t\t\t\tcreateSuggestion={ handleCreate }\n\t\t\t\tcreateSuggestionButtonText={ ( searchTerm ) => {\n\t\t\t\t\tlet format;\n\n\t\t\t\t\tif ( type === 'post' ) {\n\t\t\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t\t\tformat = __( 'Create draft post: <mark>%s</mark>' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t\t\tformat = __( 'Create draft page: <mark>%s</mark>' );\n\t\t\t\t\t}\n\n\t\t\t\t\treturn createInterpolateElement(\n\t\t\t\t\t\tsprintf( format, searchTerm ),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmark: <mark />,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t\tnoDirectEntry={ !! type }\n\t\t\t\tnoURLSuggestion={ !! type }\n\t\t\t\tsuggestionsQuery={ getSuggestionsQuery( type, kind ) }\n\t\t\t\tonChange={ props.onChange }\n\t\t\t\tonRemove={ props.onRemove }\n\t\t\t\tonCancel={ props.onCancel }\n\t\t\t\trenderControlBottom={\n\t\t\t\t\t! url\n\t\t\t\t\t\t? () => (\n\t\t\t\t\t\t\t\t<LinkControlTransforms\n\t\t\t\t\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: null\n\t\t\t\t}\n\t\t\t/>\n\t\t</Popover>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/navigation-link/link-ui.js"],"names":["__unstableStripHTML","stripHTML","Popover","Button","__","sprintf","__experimentalLinkControl","LinkControl","BlockIcon","store","blockEditorStore","createInterpolateElement","useMemo","coreStore","useResourcePermissions","decodeEntities","switchToBlockType","useSelect","useDispatch","getSuggestionsQuery","type","kind","subtype","LinkControlTransforms","clientId","getBlock","blockTransforms","select","_getBlock","getBlockRootClientId","getBlockTransformItems","replaceBlock","featuredBlocks","transforms","filter","item","includes","name","length","map","index","icon","title","LinkUI","props","saveEntityRecord","pagesPermissions","postsPermissions","handleCreate","pageTitle","postType","link","page","status","id","rendered","url","label","opensInNewTab","userCanCreate","canCreate","onClose","anchor","className","searchTerm","format","mark","onChange","onRemove","onCancel"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,mBAAmB,IAAIC,SAAhC,QAAiD,gBAAjD;AACA,SAASC,OAAT,EAAkBC,MAAlB,QAAgC,uBAAhC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SACCC,yBAAyB,IAAIC,WAD9B,EAECC,SAFD,EAGCC,KAAK,IAAIC,gBAHV,QAIO,yBAJP;AAKA,SAASC,wBAAT,EAAmCC,OAAnC,QAAkD,oBAAlD;AACA,SACCH,KAAK,IAAII,SADV,EAECC,sBAF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AQ,EAAGuB,KAAK,CAACuB,QA7BlB;AA8BC,IAAA,QAAQ,EAAGvB,KAAK,CAACwB,QA9BlB;AA+BC,IAAA,QAAQ,EAAGxB,KAAK,CAACyB,QA/BlB;AAgCC,IAAA,mBAAmB,EAClB,CAAEb,GAAF,GACG,MACA,cAAC,qBAAD;AACC,MAAA,QAAQ,EAAGZ,KAAK,CAACpB;AADlB,MAFH,GAMG;AAvCL,IAND,CADD;AAmDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { Popover, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\t__experimentalLinkControl as LinkControl,\n\tBlockIcon,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { createInterpolateElement, useMemo } from '@wordpress/element';\nimport {\n\tstore as coreStore,\n\tuseResourcePermissions,\n} from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { switchToBlockType } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\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}\n}\n\n/**\n * Add transforms to Link Control\n *\n * @param {Object} props Component props.\n * @param {string} props.clientId Block client ID.\n */\nfunction LinkControlTransforms( { clientId } ) {\n\tconst { getBlock, blockTransforms } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlock: _getBlock,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockTransformItems,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\treturn {\n\t\t\t\tgetBlock: _getBlock,\n\t\t\t\tblockTransforms: getBlockTransformItems(\n\t\t\t\t\t_getBlock( clientId ),\n\t\t\t\t\tgetBlockRootClientId( clientId )\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\n\tconst featuredBlocks = [\n\t\t'core/page-list',\n\t\t'core/site-logo',\n\t\t'core/social-links',\n\t\t'core/search',\n\t];\n\n\tconst transforms = blockTransforms.filter( ( item ) => {\n\t\treturn featuredBlocks.includes( item.name );\n\t} );\n\n\tif ( ! transforms?.length ) {\n\t\treturn null;\n\t}\n\n\tif ( ! clientId ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"link-control-transform\">\n\t\t\t<h3 className=\"link-control-transform__subheading\">\n\t\t\t\t{ __( 'Transform' ) }\n\t\t\t</h3>\n\t\t\t<div className=\"link-control-transform__items\">\n\t\t\t\t{ transforms.map( ( item, index ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey={ `transform-${ index }` }\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\treplaceBlock(\n\t\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\t\tswitchToBlockType(\n\t\t\t\t\t\t\t\t\t\tgetBlock( clientId ),\n\t\t\t\t\t\t\t\t\t\titem.name\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\tclassName=\"link-control-transform__item\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<BlockIcon icon={ item.icon } />\n\t\t\t\t\t\t\t{ item.title }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport function LinkUI( props ) {\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst pagesPermissions = useResourcePermissions( 'pages' );\n\tconst postsPermissions = useResourcePermissions( 'posts' );\n\n\tasync function handleCreate( pageTitle ) {\n\t\tconst postType = props.link.type || 'page';\n\n\t\tconst page = await saveEntityRecord( 'postType', postType, {\n\t\t\ttitle: pageTitle,\n\t\t\tstatus: 'draft',\n\t\t} );\n\n\t\treturn {\n\t\t\tid: page.id,\n\t\t\ttype: postType,\n\t\t\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 &#038; 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\tconst { label, url, opensInNewTab, type, kind } = props.link;\n\n\tlet userCanCreate = false;\n\tif ( ! type || type === 'page' ) {\n\t\tuserCanCreate = pagesPermissions.canCreate;\n\t} else if ( type === 'post' ) {\n\t\tuserCanCreate = postsPermissions.canCreate;\n\t}\n\n\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\treturn (\n\t\t<Popover\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<LinkControl\n\t\t\t\thasTextControl\n\t\t\t\thasRichPreviews\n\t\t\t\tclassName={ props.className }\n\t\t\t\tvalue={ link }\n\t\t\t\tshowInitialSuggestions={ true }\n\t\t\t\twithCreateSuggestion={ userCanCreate }\n\t\t\t\tcreateSuggestion={ handleCreate }\n\t\t\t\tcreateSuggestionButtonText={ ( searchTerm ) => {\n\t\t\t\t\tlet format;\n\n\t\t\t\t\tif ( type === 'post' ) {\n\t\t\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t\t\tformat = __( 'Create draft post: <mark>%s</mark>' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t\t\tformat = __( 'Create draft page: <mark>%s</mark>' );\n\t\t\t\t\t}\n\n\t\t\t\t\treturn createInterpolateElement(\n\t\t\t\t\t\tsprintf( format, searchTerm ),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmark: <mark />,\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t\tnoDirectEntry={ !! type }\n\t\t\t\tnoURLSuggestion={ !! type }\n\t\t\t\tsuggestionsQuery={ getSuggestionsQuery( type, kind ) }\n\t\t\t\tonChange={ props.onChange }\n\t\t\t\tonRemove={ props.onRemove }\n\t\t\t\tonCancel={ props.onCancel }\n\t\t\t\trenderControlBottom={\n\t\t\t\t\t! url\n\t\t\t\t\t\t? () => (\n\t\t\t\t\t\t\t\t<LinkControlTransforms\n\t\t\t\t\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: null\n\t\t\t\t}\n\t\t\t/>\n\t\t</Popover>\n\t);\n}\n"]}
@@ -91,7 +91,7 @@
91
91
  counter-reset: footnotes;
92
92
  }
93
93
 
94
- .fn {
94
+ [data-fn].fn {
95
95
  vertical-align: super;
96
96
  font-size: smaller;
97
97
  counter-increment: footnotes;
@@ -99,7 +99,7 @@
99
99
  text-indent: -9999999px;
100
100
  }
101
101
 
102
- .fn::after {
102
+ [data-fn].fn::after {
103
103
  content: "[" counter(footnotes) "]";
104
104
  text-indent: 0;
105
105
  float: right;
@@ -91,7 +91,7 @@
91
91
  counter-reset: footnotes;
92
92
  }
93
93
 
94
- .fn {
94
+ [data-fn].fn {
95
95
  vertical-align: super;
96
96
  font-size: smaller;
97
97
  counter-increment: footnotes;
@@ -99,7 +99,7 @@
99
99
  text-indent: -9999999px;
100
100
  }
101
101
 
102
- .fn::after {
102
+ [data-fn].fn::after {
103
103
  content: "[" counter(footnotes) "]";
104
104
  text-indent: 0;
105
105
  float: left;
@@ -3798,7 +3798,7 @@ pre.wp-block-verse {
3798
3798
  counter-reset: footnotes;
3799
3799
  }
3800
3800
 
3801
- .fn {
3801
+ [data-fn].fn {
3802
3802
  vertical-align: super;
3803
3803
  font-size: smaller;
3804
3804
  counter-increment: footnotes;
@@ -3806,7 +3806,7 @@ pre.wp-block-verse {
3806
3806
  text-indent: -9999999px;
3807
3807
  }
3808
3808
 
3809
- .fn::after {
3809
+ [data-fn].fn::after {
3810
3810
  content: "[" counter(footnotes) "]";
3811
3811
  text-indent: 0;
3812
3812
  float: right;
@@ -3833,7 +3833,7 @@ pre.wp-block-verse {
3833
3833
  counter-reset: footnotes;
3834
3834
  }
3835
3835
 
3836
- .fn {
3836
+ [data-fn].fn {
3837
3837
  vertical-align: super;
3838
3838
  font-size: smaller;
3839
3839
  counter-increment: footnotes;
@@ -3841,7 +3841,7 @@ pre.wp-block-verse {
3841
3841
  text-indent: -9999999px;
3842
3842
  }
3843
3843
 
3844
- .fn::after {
3844
+ [data-fn].fn::after {
3845
3845
  content: "[" counter(footnotes) "]";
3846
3846
  text-indent: 0;
3847
3847
  float: left;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "8.12.4",
3
+ "version": "8.12.6",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -37,12 +37,12 @@
37
37
  "@wordpress/api-fetch": "^6.32.1",
38
38
  "@wordpress/autop": "^3.35.1",
39
39
  "@wordpress/blob": "^3.35.1",
40
- "@wordpress/block-editor": "^12.3.3",
41
- "@wordpress/blocks": "^12.12.1",
42
- "@wordpress/components": "^25.1.3",
40
+ "@wordpress/block-editor": "^12.3.4",
41
+ "@wordpress/blocks": "^12.12.2",
42
+ "@wordpress/components": "^25.1.4",
43
43
  "@wordpress/compose": "^6.12.1",
44
- "@wordpress/core-data": "^6.12.3",
45
- "@wordpress/data": "^9.5.1",
44
+ "@wordpress/core-data": "^6.12.4",
45
+ "@wordpress/data": "^9.5.2",
46
46
  "@wordpress/date": "^4.35.1",
47
47
  "@wordpress/deprecated": "^3.35.1",
48
48
  "@wordpress/dom": "^3.35.1",
@@ -53,14 +53,14 @@
53
53
  "@wordpress/i18n": "^4.35.1",
54
54
  "@wordpress/icons": "^9.26.2",
55
55
  "@wordpress/keycodes": "^3.35.1",
56
- "@wordpress/notices": "^4.3.1",
56
+ "@wordpress/notices": "^4.3.2",
57
57
  "@wordpress/primitives": "^3.33.1",
58
58
  "@wordpress/private-apis": "^0.17.1",
59
- "@wordpress/reusable-blocks": "^4.12.3",
60
- "@wordpress/rich-text": "^6.12.1",
61
- "@wordpress/server-side-render": "^4.12.3",
59
+ "@wordpress/reusable-blocks": "^4.12.4",
60
+ "@wordpress/rich-text": "^6.12.2",
61
+ "@wordpress/server-side-render": "^4.12.4",
62
62
  "@wordpress/url": "^3.36.1",
63
- "@wordpress/viewport": "^5.12.1",
63
+ "@wordpress/viewport": "^5.12.2",
64
64
  "@wordpress/wordcount": "^3.35.1",
65
65
  "change-case": "^4.1.2",
66
66
  "classnames": "^2.3.1",
@@ -83,5 +83,5 @@
83
83
  "publishConfig": {
84
84
  "access": "public"
85
85
  },
86
- "gitHead": "7efa7c2321a958ddfa723825a0354071435a9d43"
86
+ "gitHead": "65fb4cd5187a47ca274c24c04a220bcdb2ddfa67"
87
87
  }
package/src/block/edit.js CHANGED
@@ -119,8 +119,8 @@ export default function ReusableBlockEdit( { attributes: { ref }, clientId } ) {
119
119
  onClick={ () => convertBlockToStatic( clientId ) }
120
120
  label={
121
121
  innerBlockCount > 1
122
- ? __( 'Convert to regular blocks' )
123
- : __( 'Convert to regular block' )
122
+ ? __( 'Detach patterns' )
123
+ : __( 'Detach pattern' )
124
124
  }
125
125
  icon={ ungroup }
126
126
  showTooltip
@@ -132,12 +132,8 @@ export default function ReusableBlockEdit( {
132
132
  }
133
133
 
134
134
  const onConvertToRegularBlocks = useCallback( () => {
135
- const successNotice =
136
- innerBlockCount > 1
137
- ? /* translators: %s: name of the reusable block */
138
- __( '%s converted to regular blocks' )
139
- : /* translators: %s: name of the reusable block */
140
- __( '%s converted to regular block' );
135
+ /* translators: %s: name of the synced block */
136
+ const successNotice = __( '%s detached' );
141
137
  createSuccessNotice( sprintf( successNotice, title ) );
142
138
 
143
139
  clearSelectedBlock();
@@ -182,17 +178,17 @@ export default function ReusableBlockEdit( {
182
178
  <Text style={ [ infoTextStyle, infoDescriptionStyle ] }>
183
179
  { innerBlockCount > 1
184
180
  ? __(
185
- 'Alternatively, you can detach and edit these blocks separately by tapping “Convert to regular blocks”.'
181
+ 'Alternatively, you can detach and edit these blocks separately by tapping “Detach patterns”.'
186
182
  )
187
183
  : __(
188
- 'Alternatively, you can detach and edit this block separately by tapping “Convert to regular block”.'
184
+ 'Alternatively, you can detach and edit this block separately by tapping “Detach pattern”.'
189
185
  ) }
190
186
  </Text>
191
187
  <TextControl
192
188
  label={
193
189
  innerBlockCount > 1
194
- ? __( 'Convert to regular blocks' )
195
- : __( 'Convert to regular block' )
190
+ ? __( 'Detach patterns' )
191
+ : __( 'Detach pattern' )
196
192
  }
197
193
  separatorType="topFullWidth"
198
194
  onPress={ onConvertToRegularBlocks }
@@ -59,15 +59,17 @@ function render_block_core_footnotes( $attributes, $content, $block ) {
59
59
  * Registers the `core/footnotes` block on the server.
60
60
  */
61
61
  function register_block_core_footnotes() {
62
- register_post_meta(
63
- 'post',
64
- 'footnotes',
65
- array(
66
- 'show_in_rest' => true,
67
- 'single' => true,
68
- 'type' => 'string',
69
- )
70
- );
62
+ foreach ( array( 'post', 'page' ) as $post_type ) {
63
+ register_post_meta(
64
+ $post_type,
65
+ 'footnotes',
66
+ array(
67
+ 'show_in_rest' => true,
68
+ 'single' => true,
69
+ 'type' => 'string',
70
+ )
71
+ );
72
+ }
71
73
  register_block_type_from_metadata(
72
74
  __DIR__ . '/footnotes',
73
75
  array(
@@ -3,7 +3,7 @@
3
3
  counter-reset: footnotes;
4
4
  }
5
5
 
6
- .fn {
6
+ [data-fn].fn {
7
7
  vertical-align: super;
8
8
  font-size: smaller;
9
9
  counter-increment: footnotes;
@@ -11,7 +11,7 @@
11
11
  text-indent: -9999999px;
12
12
  }
13
13
 
14
- .fn::after {
14
+ [data-fn].fn::after {
15
15
  content: "[" counter(footnotes) "]";
16
16
  text-indent: 0;
17
17
  float: left;
@@ -69,7 +69,6 @@ import ManageMenusButton from './manage-menus-button';
69
69
  import MenuInspectorControls from './menu-inspector-controls';
70
70
  import DeletedNavigationWarning from './deleted-navigation-warning';
71
71
  import { unlock } from '../../lock-unlock';
72
-
73
72
  const { useBlockEditingMode } = unlock( blockEditorPrivateApis );
74
73
 
75
74
  function Navigation( {
@@ -224,7 +223,7 @@ function Navigation( {
224
223
  // that automatically saves the menu as an entity when changes are made to the inner blocks.
225
224
  const hasUnsavedBlocks = hasUncontrolledInnerBlocks && ! isEntityAvailable;
226
225
 
227
- const { getNavigationFallbackId } = useSelect( coreStore );
226
+ const { getNavigationFallbackId } = unlock( useSelect( coreStore ) );
228
227
 
229
228
  const navigationFallbackId = ! ( ref || hasUnsavedBlocks )
230
229
  ? getNavigationFallbackId()
@@ -60,7 +60,6 @@ function AdditionalBlockContent( { block, insertedBlock, setInsertedBlock } ) {
60
60
  onClose={ () => {
61
61
  setInsertedBlock( null );
62
62
  } }
63
- hasCreateSuggestion={ false }
64
63
  onChange={ ( updatedValue ) => {
65
64
  updateAttributes(
66
65
  updatedValue,
@@ -35,10 +35,7 @@ import {
35
35
  } from '@wordpress/dom';
36
36
  import { decodeEntities } from '@wordpress/html-entities';
37
37
  import { link as linkIcon, addSubmenu } from '@wordpress/icons';
38
- import {
39
- store as coreStore,
40
- useResourcePermissions,
41
- } from '@wordpress/core-data';
38
+ import { store as coreStore } from '@wordpress/core-data';
42
39
  import { useMergeRefs } from '@wordpress/compose';
43
40
 
44
41
  /**
@@ -184,9 +181,6 @@ export default function NavigationLinkEdit( {
184
181
  const itemLabelPlaceholder = __( 'Add label…' );
185
182
  const ref = useRef();
186
183
 
187
- const pagesPermissions = useResourcePermissions( 'pages' );
188
- const postsPermissions = useResourcePermissions( 'posts' );
189
-
190
184
  const {
191
185
  innerBlocks,
192
186
  isAtMaxNesting,
@@ -322,13 +316,6 @@ export default function NavigationLinkEdit( {
322
316
  setIsLinkOpen( false );
323
317
  }
324
318
 
325
- let userCanCreate = false;
326
- if ( ! type || type === 'page' ) {
327
- userCanCreate = pagesPermissions.canCreate;
328
- } else if ( type === 'post' ) {
329
- userCanCreate = postsPermissions.canCreate;
330
- }
331
-
332
319
  const {
333
320
  textColor,
334
321
  customTextColor,
@@ -589,7 +576,6 @@ export default function NavigationLinkEdit( {
589
576
  link={ attributes }
590
577
  onClose={ () => setIsLinkOpen( false ) }
591
578
  anchor={ popoverAnchor }
592
- hasCreateSuggestion={ userCanCreate }
593
579
  onRemove={ removeLink }
594
580
  onChange={ ( updatedValue ) => {
595
581
  updateAttributes(
@@ -10,7 +10,10 @@ import {
10
10
  store as blockEditorStore,
11
11
  } from '@wordpress/block-editor';
12
12
  import { createInterpolateElement, useMemo } from '@wordpress/element';
13
- import { store as coreStore } from '@wordpress/core-data';
13
+ import {
14
+ store as coreStore,
15
+ useResourcePermissions,
16
+ } from '@wordpress/core-data';
14
17
  import { decodeEntities } from '@wordpress/html-entities';
15
18
  import { switchToBlockType } from '@wordpress/blocks';
16
19
  import { useSelect, useDispatch } from '@wordpress/data';
@@ -125,6 +128,8 @@ function LinkControlTransforms( { clientId } ) {
125
128
 
126
129
  export function LinkUI( props ) {
127
130
  const { saveEntityRecord } = useDispatch( coreStore );
131
+ const pagesPermissions = useResourcePermissions( 'pages' );
132
+ const postsPermissions = useResourcePermissions( 'posts' );
128
133
 
129
134
  async function handleCreate( pageTitle ) {
130
135
  const postType = props.link.type || 'page';
@@ -155,6 +160,13 @@ export function LinkUI( props ) {
155
160
 
156
161
  const { label, url, opensInNewTab, type, kind } = props.link;
157
162
 
163
+ let userCanCreate = false;
164
+ if ( ! type || type === 'page' ) {
165
+ userCanCreate = pagesPermissions.canCreate;
166
+ } else if ( type === 'post' ) {
167
+ userCanCreate = postsPermissions.canCreate;
168
+ }
169
+
158
170
  // Memoize link value to avoid overriding the LinkControl's internal state.
159
171
  // This is a temporary fix. See https://github.com/WordPress/gutenberg/issues/50976#issuecomment-1568226407.
160
172
  const link = useMemo(
@@ -179,7 +191,7 @@ export function LinkUI( props ) {
179
191
  className={ props.className }
180
192
  value={ link }
181
193
  showInitialSuggestions={ true }
182
- withCreateSuggestion={ props.hasCreateSuggestion }
194
+ withCreateSuggestion={ userCanCreate }
183
195
  createSuggestion={ handleCreate }
184
196
  createSuggestionButtonText={ ( searchTerm ) => {
185
197
  let format;
@@ -199,9 +199,9 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
199
199
  $attributes['style']['color']['background'] = $block->context['customOverlayBackgroundColor'];
200
200
  }
201
201
 
202
- // This allows us to be able to get a response from gutenberg_apply_colors_support.
202
+ // This allows us to be able to get a response from wp_apply_colors_support.
203
203
  $block->block_type->supports['color'] = true;
204
- $colors_supports = gutenberg_apply_colors_support( $block->block_type, $attributes );
204
+ $colors_supports = wp_apply_colors_support( $block->block_type, $attributes );
205
205
  $css_classes = 'wp-block-navigation__submenu-container';
206
206
  if ( array_key_exists( 'class', $colors_supports ) ) {
207
207
  $css_classes .= ' ' . $colors_supports['class'];
@@ -47,8 +47,8 @@ function render_block_core_social_link( $attributes, $content, $block ) {
47
47
  $icon = block_core_social_link_get_icon( $service );
48
48
  $wrapper_attributes = get_block_wrapper_attributes(
49
49
  array(
50
- 'class' => esc_attr( 'wp-social-link wp-social-link-' . $service . block_core_social_link_get_color_classes( $block->context ) ),
51
- 'style' => esc_attr( block_core_social_link_get_color_styles( $block->context ) ),
50
+ 'class' => 'wp-social-link wp-social-link-' . $service . block_core_social_link_get_color_classes( $block->context ),
51
+ 'style' => block_core_social_link_get_color_styles( $block->context ),
52
52
  )
53
53
  );
54
54