@wordpress/block-library 9.20.0 → 9.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/categories/edit.js +3 -3
  3. package/build/categories/edit.js.map +1 -1
  4. package/build/embed/edit.js +4 -1
  5. package/build/embed/edit.js.map +1 -1
  6. package/build/image/edit.js +3 -2
  7. package/build/image/edit.js.map +1 -1
  8. package/build/image/image.js +13 -8
  9. package/build/image/image.js.map +1 -1
  10. package/build/navigation/edit/index.js +8 -4
  11. package/build/navigation/edit/index.js.map +1 -1
  12. package/build/navigation-link/edit.js +27 -8
  13. package/build/navigation-link/edit.js.map +1 -1
  14. package/build/post-featured-image/edit.js +2 -1
  15. package/build/post-featured-image/edit.js.map +1 -1
  16. package/build/query-total/index.js +3 -0
  17. package/build/query-total/index.js.map +1 -1
  18. package/build/rss/edit.js +21 -1
  19. package/build/rss/edit.js.map +1 -1
  20. package/build/rss/index.js +7 -0
  21. package/build/rss/index.js.map +1 -1
  22. package/build/site-title/edit.js +1 -1
  23. package/build/site-title/edit.js.map +1 -1
  24. package/build/table-of-contents/edit.js +50 -8
  25. package/build/table-of-contents/edit.js.map +1 -1
  26. package/build/table-of-contents/hooks.js +7 -1
  27. package/build/table-of-contents/hooks.js.map +1 -1
  28. package/build/table-of-contents/index.js +3 -0
  29. package/build/table-of-contents/index.js.map +1 -1
  30. package/build-module/categories/edit.js +3 -3
  31. package/build-module/categories/edit.js.map +1 -1
  32. package/build-module/embed/edit.js +4 -1
  33. package/build-module/embed/edit.js.map +1 -1
  34. package/build-module/image/edit.js +3 -2
  35. package/build-module/image/edit.js.map +1 -1
  36. package/build-module/image/image.js +14 -9
  37. package/build-module/image/image.js.map +1 -1
  38. package/build-module/navigation/edit/index.js +8 -4
  39. package/build-module/navigation/edit/index.js.map +1 -1
  40. package/build-module/navigation-link/edit.js +28 -9
  41. package/build-module/navigation-link/edit.js.map +1 -1
  42. package/build-module/post-featured-image/edit.js +2 -1
  43. package/build-module/post-featured-image/edit.js.map +1 -1
  44. package/build-module/query-total/index.js +3 -0
  45. package/build-module/query-total/index.js.map +1 -1
  46. package/build-module/rss/edit.js +22 -2
  47. package/build-module/rss/edit.js.map +1 -1
  48. package/build-module/rss/index.js +7 -0
  49. package/build-module/rss/index.js.map +1 -1
  50. package/build-module/site-title/edit.js +1 -1
  51. package/build-module/site-title/edit.js.map +1 -1
  52. package/build-module/table-of-contents/edit.js +52 -10
  53. package/build-module/table-of-contents/edit.js.map +1 -1
  54. package/build-module/table-of-contents/hooks.js +7 -1
  55. package/build-module/table-of-contents/hooks.js.map +1 -1
  56. package/build-module/table-of-contents/index.js +3 -0
  57. package/build-module/table-of-contents/index.js.map +1 -1
  58. package/build-style/post-comments-form/style-rtl.css +3 -0
  59. package/build-style/post-comments-form/style.css +3 -0
  60. package/build-style/style-rtl.css +3 -0
  61. package/build-style/style.css +3 -0
  62. package/package.json +35 -35
  63. package/src/categories/edit.js +3 -3
  64. package/src/embed/edit.js +7 -1
  65. package/src/image/edit.js +3 -3
  66. package/src/image/image.js +9 -12
  67. package/src/navigation/edit/index.js +4 -0
  68. package/src/navigation-link/edit.js +45 -11
  69. package/src/post-comments-form/style.scss +5 -0
  70. package/src/post-featured-image/edit.js +2 -1
  71. package/src/query-total/block.json +3 -0
  72. package/src/query-total/index.php +1 -1
  73. package/src/rss/block.json +7 -0
  74. package/src/rss/edit.js +21 -0
  75. package/src/rss/index.php +27 -9
  76. package/src/site-title/edit.js +1 -1
  77. package/src/site-title/index.php +1 -1
  78. package/src/table-of-contents/block.json +3 -0
  79. package/src/table-of-contents/edit.js +45 -4
  80. package/src/table-of-contents/hooks.js +7 -1
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_blob","_coreData","_data","_components","_blockEditor","_element","_i18n","_icons","_notices","_dimensionControls","_overlayControls","_overlay","_hooks","_lockUnlock","_jsxRuntime","ALLOWED_MEDIA_TYPES","ResolutionTool","unlock","blockEditorPrivateApis","DEFAULT_MEDIA_SIZE_SLUG","FeaturedImageResolutionTool","image","value","onChange","imageSizes","useSelect","select","getSettings","blockEditorStore","length","imageSizeOptions","filter","slug","media_details","sizes","source_url","map","name","label","jsx","defaultValue","options","PostFeaturedImageEdit","clientId","attributes","setAttributes","context","postId","postType","postTypeSlug","queryId","isDescendentOfQueryLoop","Number","isFinite","isLink","aspectRatio","height","width","scale","sizeSlug","rel","linkTarget","useFirstImageFromPost","temporaryURL","setTemporaryURL","useState","storedFeaturedImage","setFeaturedImage","useEntityProp","postContent","featuredImage","useMemo","imageOpener","exec","imageId","groups","attrs","JSON","parse","id","media","postPermalink","getMedia","getPostType","getEditedEntityRecord","coreStore","link","mediaUrl","blockProps","useBlockProps","style","className","clsx","borderProps","useBorderProps","shadowProps","getShadowClassesAndStyles","blockEditingMode","useBlockEditingMode","placeholder","content","Placeholder","withIllustration","children","onSelectImage","url","isBlobURL","useEffect","createErrorNotice","useDispatch","noticesStore","onUploadError","message","type","dropdownMenuProps","useToolsPanelDropdownMenuProps","controls","jsxs","Fragment","InspectorControls","group","default","__experimentalToolsPanel","__","resetAll","__experimentalToolsPanelItem","labels","singular_name","sprintf","isShownByDefault","hasValue","onDeselect","ToggleControl","__nextHasNoMarginBottom","checked","TextControl","__next40pxDefaultSize","newRel","nextSizeSlug","href","target","imageStyles","objectFit","MediaPlaceholder","onSelect","accept","allowedTypes","onError","mediaLibraryButton","open","Button","icon","upload","variant","showTooltip","tooltipPosition","onClick","src","alt","alt_text","Spinner","BlockControls","MediaReplaceFlow","mediaId","mediaURL","onReset"],"sources":["@wordpress/block-library/src/post-featured-image/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tToggleControl,\n\tPlaceholder,\n\tButton,\n\tSpinner,\n\tTextControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,\n\tuseBlockEditingMode,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useMemo, useEffect, useState } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { upload } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport DimensionControls from './dimension-controls';\nimport OverlayControls from './overlay-controls';\nimport Overlay from './overlay';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport { unlock } from '../lock-unlock';\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\nconst { ResolutionTool } = unlock( blockEditorPrivateApis );\nconst DEFAULT_MEDIA_SIZE_SLUG = 'full';\n\nfunction FeaturedImageResolutionTool( { image, value, onChange } ) {\n\tconst { imageSizes } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\timageSizes: getSettings().imageSizes,\n\t\t};\n\t}, [] );\n\n\tif ( ! imageSizes?.length ) {\n\t\treturn null;\n\t}\n\n\tconst imageSizeOptions = imageSizes\n\t\t.filter(\n\t\t\t( { slug } ) => image?.media_details?.sizes?.[ slug ]?.source_url\n\t\t)\n\t\t.map( ( { name, slug } ) => ( { value: slug, label: name } ) );\n\n\treturn (\n\t\t<ResolutionTool\n\t\t\tvalue={ value }\n\t\t\tdefaultValue={ DEFAULT_MEDIA_SIZE_SLUG }\n\t\t\toptions={ imageSizeOptions }\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n\nexport default function PostFeaturedImageEdit( {\n\tclientId,\n\tattributes,\n\tsetAttributes,\n\tcontext: { postId, postType: postTypeSlug, queryId },\n} ) {\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst {\n\t\tisLink,\n\t\taspectRatio,\n\t\theight,\n\t\twidth,\n\t\tscale,\n\t\tsizeSlug,\n\t\trel,\n\t\tlinkTarget,\n\t\tuseFirstImageFromPost,\n\t} = attributes;\n\tconst [ temporaryURL, setTemporaryURL ] = useState();\n\n\tconst [ storedFeaturedImage, setFeaturedImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostTypeSlug,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\n\t// Fallback to post content if no featured image is set.\n\t// This is needed for the \"Use first image from post\" option.\n\tconst [ postContent ] = useEntityProp(\n\t\t'postType',\n\t\tpostTypeSlug,\n\t\t'content',\n\t\tpostId\n\t);\n\n\tconst featuredImage = useMemo( () => {\n\t\tif ( storedFeaturedImage ) {\n\t\t\treturn storedFeaturedImage;\n\t\t}\n\n\t\tif ( ! useFirstImageFromPost ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst imageOpener =\n\t\t\t/<!--\\s+wp:(?:core\\/)?image\\s+(?<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\\s+\\/?-->).)*)?}\\s+)?-->/.exec(\n\t\t\t\tpostContent\n\t\t\t);\n\t\tconst imageId =\n\t\t\timageOpener?.groups?.attrs &&\n\t\t\tJSON.parse( imageOpener.groups.attrs )?.id;\n\t\treturn imageId;\n\t}, [ storedFeaturedImage, useFirstImageFromPost, postContent ] );\n\n\tconst { media, postType, postPermalink } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getMedia, getPostType, getEditedEntityRecord } =\n\t\t\t\tselect( coreStore );\n\t\t\treturn {\n\t\t\t\tmedia:\n\t\t\t\t\tfeaturedImage &&\n\t\t\t\t\tgetMedia( featuredImage, {\n\t\t\t\t\t\tcontext: 'view',\n\t\t\t\t\t} ),\n\t\t\t\tpostType: postTypeSlug && getPostType( postTypeSlug ),\n\t\t\t\tpostPermalink: getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostTypeSlug,\n\t\t\t\t\tpostId\n\t\t\t\t)?.link,\n\t\t\t};\n\t\t},\n\t\t[ featuredImage, postTypeSlug, postId ]\n\t);\n\n\tconst mediaUrl =\n\t\tmedia?.media_details?.sizes?.[ sizeSlug ]?.source_url ||\n\t\tmedia?.source_url;\n\n\tconst blockProps = useBlockProps( {\n\t\tstyle: { width, height, aspectRatio },\n\t\tclassName: clsx( {\n\t\t\t'is-transient': temporaryURL,\n\t\t} ),\n\t} );\n\tconst borderProps = useBorderProps( attributes );\n\tconst shadowProps = getShadowClassesAndStyles( attributes );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst placeholder = ( content ) => {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-media-placeholder',\n\t\t\t\t\tborderProps.className\n\t\t\t\t) }\n\t\t\t\twithIllustration\n\t\t\t\tstyle={ {\n\t\t\t\t\theight: !! aspectRatio && '100%',\n\t\t\t\t\twidth: !! aspectRatio && '100%',\n\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t...shadowProps.style,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ content }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\tconst onSelectImage = ( value ) => {\n\t\tif ( value?.id ) {\n\t\t\tsetFeaturedImage( value.id );\n\t\t}\n\n\t\tif ( value?.url && isBlobURL( value.url ) ) {\n\t\t\tsetTemporaryURL( value.url );\n\t\t}\n\t};\n\n\t// Reset temporary url when media is available.\n\tuseEffect( () => {\n\t\tif ( mediaUrl && temporaryURL ) {\n\t\t\tsetTemporaryURL();\n\t\t}\n\t}, [ mediaUrl, temporaryURL ] );\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t\tsetTemporaryURL();\n\t};\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst controls = blockEditingMode === 'default' && (\n\t\t<>\n\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t<OverlayControls\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"dimensions\">\n\t\t\t\t<DimensionControls\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tmedia={ media }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tisLink: false,\n\t\t\t\t\t\t\tlinkTarget: '_self',\n\t\t\t\t\t\t\trel: '',\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\tpostType?.labels.singular_name\n\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t\t\t\t\t\t__( 'Link to %s' ),\n\t\t\t\t\t\t\t\t\t\tpostType.labels.singular_name\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: __( 'Link to post' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! isLink }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tisLink: false,\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\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tpostType?.labels.singular_name\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t\t\t\t\t\t\t__( 'Link to %s' ),\n\t\t\t\t\t\t\t\t\t\t\tpostType.labels.singular_name\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: __( 'Link to post' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { isLink: ! isLink } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => '_self' !== linkTarget }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tlinkTarget: '_self',\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\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\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\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => !! rel }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\trel: '',\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\t\t<TextControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\t\t\tvalue={ rel }\n\t\t\t\t\t\t\t\tonChange={ ( newRel ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { rel: newRel } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t<FeaturedImageResolutionTool\n\t\t\t\t\t\timage={ media }\n\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\tonChange={ ( nextSizeSlug ) =>\n\t\t\t\t\t\t\tsetAttributes( { sizeSlug: nextSizeSlug } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\n\tlet image;\n\n\t/**\n\t * A Post Featured Image block should not have image replacement\n\t * or upload options in the following cases:\n\t * - Is placed in a Query Loop. This is a conscious decision to\n\t * prevent content editing of different posts in Query Loop, and\n\t * this could change in the future.\n\t * - Is in a context where it does not have a postId (for example\n\t * in a template or template part).\n\t */\n\tif ( ! featuredImage && ( isDescendentOfQueryLoop || ! postId ) ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ controls }\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t{ !! isLink ? (\n\t\t\t\t\t\t<a href={ postPermalink } target={ linkTarget }>\n\t\t\t\t\t\t\t{ placeholder() }\n\t\t\t\t\t\t</a>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tplaceholder()\n\t\t\t\t\t) }\n\t\t\t\t\t<Overlay\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst label = __( 'Add a featured image' );\n\tconst imageStyles = {\n\t\t...borderProps.style,\n\t\t...shadowProps.style,\n\t\theight: aspectRatio ? '100%' : height,\n\t\twidth: !! aspectRatio && '100%',\n\t\tobjectFit: !! ( height || aspectRatio ) && scale,\n\t};\n\n\t/**\n\t * When the post featured image block is placed in a context where:\n\t * - It has a postId (for example in a single post)\n\t * - It is not inside a query loop\n\t * - It has no image assigned yet\n\t * Then display the placeholder with the image upload option.\n\t */\n\tif ( ! featuredImage && ! temporaryURL ) {\n\t\timage = (\n\t\t\t<MediaPlaceholder\n\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\taccept=\"image/*\"\n\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\tonError={ onUploadError }\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t\tmediaLibraryButton={ ( { open } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\ttooltipPosition=\"top center\"\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\topen();\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} }\n\t\t\t/>\n\t\t);\n\t} else {\n\t\t// We have a Featured image so show a Placeholder if is loading.\n\t\timage =\n\t\t\t! media && ! temporaryURL ? (\n\t\t\t\tplaceholder()\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<img\n\t\t\t\t\t\tclassName={ borderProps.className }\n\t\t\t\t\t\tsrc={ temporaryURL || mediaUrl }\n\t\t\t\t\t\talt={\n\t\t\t\t\t\t\tmedia && media?.alt_text\n\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: The image's alt text.\n\t\t\t\t\t\t\t\t\t\t__( 'Featured image: %s' ),\n\t\t\t\t\t\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: __( 'Featured image' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstyle={ imageStyles }\n\t\t\t\t\t/>\n\t\t\t\t\t{ temporaryURL && <Spinner /> }\n\t\t\t\t</>\n\t\t\t);\n\t}\n\n\t/**\n\t * When the post featured image block:\n\t * - Has an image assigned\n\t * - Is not inside a query loop\n\t * Then display the image and the image replacement option.\n\t */\n\treturn (\n\t\t<>\n\t\t\t{ ! temporaryURL && controls }\n\t\t\t{ !! media && ! isDescendentOfQueryLoop && (\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\tmediaId={ featuredImage }\n\t\t\t\t\t\tmediaURL={ mediaUrl }\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\taccept=\"image/*\"\n\t\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\tonReset={ () => setFeaturedImage( 0 ) }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t{ /* If the featured image is linked, wrap in an <a /> tag to trigger any inherited link element styles */ }\n\t\t\t\t{ !! isLink ? (\n\t\t\t\t\t<a href={ postPermalink } target={ linkTarget }>\n\t\t\t\t\t\t{ image }\n\t\t\t\t\t</a>\n\t\t\t\t) : (\n\t\t\t\t\timage\n\t\t\t\t) }\n\t\t\t\t<Overlay\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AASA,IAAAK,YAAA,GAAAL,OAAA;AAYA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AAKA,IAAAU,kBAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,gBAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,QAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,WAAA,GAAAd,OAAA;AAAwC,IAAAe,WAAA,GAAAf,OAAA;AA5CxC;AACA;AACA;;AAGA;AACA;AACA;;AA8BA;AACA;AACA;;AAOA,MAAMgB,mBAAmB,GAAG,CAAE,OAAO,CAAE;AACvC,MAAM;EAAEC;AAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAC3D,MAAMC,uBAAuB,GAAG,MAAM;AAEtC,SAASC,2BAA2BA,CAAE;EAAEC,KAAK;EAAEC,KAAK;EAAEC;AAAS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AC;IAAA,CAC5B,CACF;EACH;;EAEA;AACD;AACA;AACA;AACA;AACA;EACC,oBACC,IAAAlJ,WAAA,CAAAuG,IAAA,EAAAvG,WAAA,CAAAwG,QAAA;IAAAf,QAAA,GACG,CAAExC,YAAY,IAAIqD,QAAQ,EAC1B,CAAC,CAAEpC,KAAK,IAAI,CAAE7B,uBAAuB,iBACtC,IAAArC,WAAA,CAAAyB,GAAA,EAACnC,YAAA,CAAA6J,aAAa;MAACzC,KAAK,EAAC,OAAO;MAAAjB,QAAA,eAC3B,IAAAzF,WAAA,CAAAyB,GAAA,EAACnC,YAAA,CAAA8J,gBAAgB;QAChBC,OAAO,EAAG7F,aAAe;QACzB8F,QAAQ,EAAG7E,QAAU;QACrB2D,YAAY,EAAGnI,mBAAqB;QACpCkI,MAAM,EAAC,SAAS;QAChBD,QAAQ,EAAGxC,aAAe;QAC1B2C,OAAO,EAAGpC,aAAe;QACzBsD,OAAO,EAAGA,CAAA,KAAMlG,gBAAgB,CAAE,CAAE;MAAG,CACvC;IAAC,CACY,CACf,eACD,IAAArD,WAAA,CAAAuG,IAAA;MAAA,GAAa7B,UAAU;MAAAe,QAAA,GAEpB,CAAC,CAAEjD,MAAM,gBACV,IAAAxC,WAAA,CAAAyB,GAAA;QAAGoG,IAAI,EAAG1D,aAAe;QAAC2D,MAAM,EAAG/E,UAAY;QAAA0C,QAAA,EAC5ClF;MAAK,CACL,CAAC,GAEJA,KACA,eACD,IAAAP,WAAA,CAAAyB,GAAA,EAAC5B,QAAA,CAAA8G,OAAO;QACP7E,UAAU,EAAGA,UAAY;QACzBC,aAAa,EAAGA,aAAe;QAC/BF,QAAQ,EAAGA;MAAU,CACrB,CAAC;IAAA,CACK,CAAC;EAAA,CACR,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_blob","_coreData","_data","_components","_blockEditor","_element","_i18n","_icons","_notices","_dimensionControls","_overlayControls","_overlay","_hooks","_lockUnlock","_jsxRuntime","ALLOWED_MEDIA_TYPES","ResolutionTool","unlock","blockEditorPrivateApis","DEFAULT_MEDIA_SIZE_SLUG","FeaturedImageResolutionTool","image","value","onChange","imageSizes","useSelect","select","getSettings","blockEditorStore","length","imageSizeOptions","filter","slug","media_details","sizes","source_url","map","name","label","jsx","defaultValue","options","PostFeaturedImageEdit","clientId","attributes","setAttributes","context","postId","postType","postTypeSlug","queryId","isDescendentOfQueryLoop","Number","isFinite","isLink","aspectRatio","height","width","scale","sizeSlug","rel","linkTarget","useFirstImageFromPost","temporaryURL","setTemporaryURL","useState","storedFeaturedImage","setFeaturedImage","useEntityProp","postContent","featuredImage","useMemo","imageOpener","exec","imageId","groups","attrs","JSON","parse","id","media","postPermalink","getMedia","getPostType","getEditedEntityRecord","coreStore","link","mediaUrl","blockProps","useBlockProps","style","className","clsx","borderProps","useBorderProps","shadowProps","getShadowClassesAndStyles","blockEditingMode","useBlockEditingMode","placeholder","content","Placeholder","withIllustration","children","onSelectImage","url","isBlobURL","useEffect","createErrorNotice","useDispatch","noticesStore","onUploadError","message","type","dropdownMenuProps","useToolsPanelDropdownMenuProps","controls","jsxs","Fragment","InspectorControls","group","default","__experimentalToolsPanel","__","resetAll","__experimentalToolsPanelItem","labels","singular_name","sprintf","isShownByDefault","hasValue","onDeselect","ToggleControl","__nextHasNoMarginBottom","checked","TextControl","__next40pxDefaultSize","newRel","nextSizeSlug","href","target","imageStyles","objectFit","MediaPlaceholder","onSelect","accept","allowedTypes","onError","mediaLibraryButton","open","Button","icon","upload","variant","showTooltip","tooltipPosition","onClick","e","preventDefault","src","alt","alt_text","Spinner","BlockControls","MediaReplaceFlow","mediaId","mediaURL","onReset"],"sources":["@wordpress/block-library/src/post-featured-image/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tToggleControl,\n\tPlaceholder,\n\tButton,\n\tSpinner,\n\tTextControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,\n\tuseBlockEditingMode,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useMemo, useEffect, useState } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { upload } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport DimensionControls from './dimension-controls';\nimport OverlayControls from './overlay-controls';\nimport Overlay from './overlay';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport { unlock } from '../lock-unlock';\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\nconst { ResolutionTool } = unlock( blockEditorPrivateApis );\nconst DEFAULT_MEDIA_SIZE_SLUG = 'full';\n\nfunction FeaturedImageResolutionTool( { image, value, onChange } ) {\n\tconst { imageSizes } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\timageSizes: getSettings().imageSizes,\n\t\t};\n\t}, [] );\n\n\tif ( ! imageSizes?.length ) {\n\t\treturn null;\n\t}\n\n\tconst imageSizeOptions = imageSizes\n\t\t.filter(\n\t\t\t( { slug } ) => image?.media_details?.sizes?.[ slug ]?.source_url\n\t\t)\n\t\t.map( ( { name, slug } ) => ( { value: slug, label: name } ) );\n\n\treturn (\n\t\t<ResolutionTool\n\t\t\tvalue={ value }\n\t\t\tdefaultValue={ DEFAULT_MEDIA_SIZE_SLUG }\n\t\t\toptions={ imageSizeOptions }\n\t\t\tonChange={ onChange }\n\t\t/>\n\t);\n}\n\nexport default function PostFeaturedImageEdit( {\n\tclientId,\n\tattributes,\n\tsetAttributes,\n\tcontext: { postId, postType: postTypeSlug, queryId },\n} ) {\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst {\n\t\tisLink,\n\t\taspectRatio,\n\t\theight,\n\t\twidth,\n\t\tscale,\n\t\tsizeSlug,\n\t\trel,\n\t\tlinkTarget,\n\t\tuseFirstImageFromPost,\n\t} = attributes;\n\tconst [ temporaryURL, setTemporaryURL ] = useState();\n\n\tconst [ storedFeaturedImage, setFeaturedImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostTypeSlug,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\n\t// Fallback to post content if no featured image is set.\n\t// This is needed for the \"Use first image from post\" option.\n\tconst [ postContent ] = useEntityProp(\n\t\t'postType',\n\t\tpostTypeSlug,\n\t\t'content',\n\t\tpostId\n\t);\n\n\tconst featuredImage = useMemo( () => {\n\t\tif ( storedFeaturedImage ) {\n\t\t\treturn storedFeaturedImage;\n\t\t}\n\n\t\tif ( ! useFirstImageFromPost ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst imageOpener =\n\t\t\t/<!--\\s+wp:(?:core\\/)?image\\s+(?<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\\s+\\/?-->).)*)?}\\s+)?-->/.exec(\n\t\t\t\tpostContent\n\t\t\t);\n\t\tconst imageId =\n\t\t\timageOpener?.groups?.attrs &&\n\t\t\tJSON.parse( imageOpener.groups.attrs )?.id;\n\t\treturn imageId;\n\t}, [ storedFeaturedImage, useFirstImageFromPost, postContent ] );\n\n\tconst { media, postType, postPermalink } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getMedia, getPostType, getEditedEntityRecord } =\n\t\t\t\tselect( coreStore );\n\t\t\treturn {\n\t\t\t\tmedia:\n\t\t\t\t\tfeaturedImage &&\n\t\t\t\t\tgetMedia( featuredImage, {\n\t\t\t\t\t\tcontext: 'view',\n\t\t\t\t\t} ),\n\t\t\t\tpostType: postTypeSlug && getPostType( postTypeSlug ),\n\t\t\t\tpostPermalink: getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostTypeSlug,\n\t\t\t\t\tpostId\n\t\t\t\t)?.link,\n\t\t\t};\n\t\t},\n\t\t[ featuredImage, postTypeSlug, postId ]\n\t);\n\n\tconst mediaUrl =\n\t\tmedia?.media_details?.sizes?.[ sizeSlug ]?.source_url ||\n\t\tmedia?.source_url;\n\n\tconst blockProps = useBlockProps( {\n\t\tstyle: { width, height, aspectRatio },\n\t\tclassName: clsx( {\n\t\t\t'is-transient': temporaryURL,\n\t\t} ),\n\t} );\n\tconst borderProps = useBorderProps( attributes );\n\tconst shadowProps = getShadowClassesAndStyles( attributes );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst placeholder = ( content ) => {\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-media-placeholder',\n\t\t\t\t\tborderProps.className\n\t\t\t\t) }\n\t\t\t\twithIllustration\n\t\t\t\tstyle={ {\n\t\t\t\t\theight: !! aspectRatio && '100%',\n\t\t\t\t\twidth: !! aspectRatio && '100%',\n\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t...shadowProps.style,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ content }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\tconst onSelectImage = ( value ) => {\n\t\tif ( value?.id ) {\n\t\t\tsetFeaturedImage( value.id );\n\t\t}\n\n\t\tif ( value?.url && isBlobURL( value.url ) ) {\n\t\t\tsetTemporaryURL( value.url );\n\t\t}\n\t};\n\n\t// Reset temporary url when media is available.\n\tuseEffect( () => {\n\t\tif ( mediaUrl && temporaryURL ) {\n\t\t\tsetTemporaryURL();\n\t\t}\n\t}, [ mediaUrl, temporaryURL ] );\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t\tsetTemporaryURL();\n\t};\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst controls = blockEditingMode === 'default' && (\n\t\t<>\n\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t<OverlayControls\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"dimensions\">\n\t\t\t\t<DimensionControls\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tmedia={ media }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tisLink: false,\n\t\t\t\t\t\t\tlinkTarget: '_self',\n\t\t\t\t\t\t\trel: '',\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\tpostType?.labels.singular_name\n\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t\t\t\t\t\t__( 'Link to %s' ),\n\t\t\t\t\t\t\t\t\t\tpostType.labels.singular_name\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: __( 'Link to post' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! isLink }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tisLink: false,\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\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tpostType?.labels.singular_name\n\t\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t\t// translators: %s: Name of the post type e.g: \"post\".\n\t\t\t\t\t\t\t\t\t\t\t__( 'Link to %s' ),\n\t\t\t\t\t\t\t\t\t\t\tpostType.labels.singular_name\n\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t: __( 'Link to post' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { isLink: ! isLink } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => '_self' !== linkTarget }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tlinkTarget: '_self',\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\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\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\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => !! rel }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\trel: '',\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\t\t<TextControl\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\t\t\tvalue={ rel }\n\t\t\t\t\t\t\t\tonChange={ ( newRel ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { rel: newRel } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t<FeaturedImageResolutionTool\n\t\t\t\t\t\timage={ media }\n\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\tonChange={ ( nextSizeSlug ) =>\n\t\t\t\t\t\t\tsetAttributes( { sizeSlug: nextSizeSlug } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\n\tlet image;\n\n\t/**\n\t * A Post Featured Image block should not have image replacement\n\t * or upload options in the following cases:\n\t * - Is placed in a Query Loop. This is a conscious decision to\n\t * prevent content editing of different posts in Query Loop, and\n\t * this could change in the future.\n\t * - Is in a context where it does not have a postId (for example\n\t * in a template or template part).\n\t */\n\tif ( ! featuredImage && ( isDescendentOfQueryLoop || ! postId ) ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ controls }\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t{ !! isLink ? (\n\t\t\t\t\t\t<a href={ postPermalink } target={ linkTarget }>\n\t\t\t\t\t\t\t{ placeholder() }\n\t\t\t\t\t\t</a>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tplaceholder()\n\t\t\t\t\t) }\n\t\t\t\t\t<Overlay\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst label = __( 'Add a featured image' );\n\tconst imageStyles = {\n\t\t...borderProps.style,\n\t\t...shadowProps.style,\n\t\theight: aspectRatio ? '100%' : height,\n\t\twidth: !! aspectRatio && '100%',\n\t\tobjectFit: !! ( height || aspectRatio ) && scale,\n\t};\n\n\t/**\n\t * When the post featured image block is placed in a context where:\n\t * - It has a postId (for example in a single post)\n\t * - It is not inside a query loop\n\t * - It has no image assigned yet\n\t * Then display the placeholder with the image upload option.\n\t */\n\tif ( ! featuredImage && ! temporaryURL ) {\n\t\timage = (\n\t\t\t<MediaPlaceholder\n\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\taccept=\"image/*\"\n\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\tonError={ onUploadError }\n\t\t\t\tplaceholder={ placeholder }\n\t\t\t\tmediaLibraryButton={ ( { open } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\ttooltipPosition=\"top center\"\n\t\t\t\t\t\t\tonClick={ ( e ) => {\n\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\topen();\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} }\n\t\t\t/>\n\t\t);\n\t} else {\n\t\t// We have a Featured image so show a Placeholder if is loading.\n\t\timage =\n\t\t\t! media && ! temporaryURL ? (\n\t\t\t\tplaceholder()\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<img\n\t\t\t\t\t\tclassName={ borderProps.className }\n\t\t\t\t\t\tsrc={ temporaryURL || mediaUrl }\n\t\t\t\t\t\talt={\n\t\t\t\t\t\t\tmedia && media?.alt_text\n\t\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t\t// translators: %s: The image's alt text.\n\t\t\t\t\t\t\t\t\t\t__( 'Featured image: %s' ),\n\t\t\t\t\t\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: __( 'Featured image' )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstyle={ imageStyles }\n\t\t\t\t\t/>\n\t\t\t\t\t{ temporaryURL && <Spinner /> }\n\t\t\t\t</>\n\t\t\t);\n\t}\n\n\t/**\n\t * When the post featured image block:\n\t * - Has an image assigned\n\t * - Is not inside a query loop\n\t * Then display the image and the image replacement option.\n\t */\n\treturn (\n\t\t<>\n\t\t\t{ ! temporaryURL && controls }\n\t\t\t{ !! media && ! isDescendentOfQueryLoop && (\n\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\tmediaId={ featuredImage }\n\t\t\t\t\t\tmediaURL={ mediaUrl }\n\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\taccept=\"image/*\"\n\t\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\tonReset={ () => setFeaturedImage( 0 ) }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<figure { ...blockProps }>\n\t\t\t\t{ /* If the featured image is linked, wrap in an <a /> tag to trigger any inherited link element styles */ }\n\t\t\t\t{ !! isLink ? (\n\t\t\t\t\t<a href={ postPermalink } target={ linkTarget }>\n\t\t\t\t\t\t{ image }\n\t\t\t\t\t</a>\n\t\t\t\t) : (\n\t\t\t\t\timage\n\t\t\t\t) }\n\t\t\t\t<Overlay\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AASA,IAAAK,YAAA,GAAAL,OAAA;AAYA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AAKA,IAAAU,kBAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,gBAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,QAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,WAAA,GAAAd,OAAA;AAAwC,IAAAe,WAAA,GAAAf,OAAA;AA5CxC;AACA;AACA;;AAGA;AACA;AACA;;AA8BA;AACA;AACA;;AAOA,MAAMgB,mBAAmB,GAAG,CAAE,OAAO,CAAE;AACvC,MAAM;EAAEC;AAAe,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAC3D,MAAMC,uBAAuB,GAAG,MAAM;AAEtC,SAASC,2BAA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,
66
66
  style: true
67
67
  }
68
+ },
69
+ interactivity: {
70
+ clientNavigation: true
68
71
  }
69
72
  },
70
73
  style: "wp-block-query-total"
@@ -1 +1 @@
1
- {"version":3,"names":["_edit","_interopRequireDefault","require","_initBlock","_icons","metadata","exports","$schema","apiVersion","name","title","category","ancestor","description","textdomain","attributes","displayType","type","usesContext","supports","align","html","spacing","margin","padding","color","gradients","__experimentalDefaultControls","background","text","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalBorder","radius","width","style","settings","icon","queryTotal","edit","init","initBlock"],"sources":["@wordpress/block-library/src/query-total/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\nimport initBlock from '../utils/init-block';\nimport { queryTotal } from './icons';\n\n/* Block settings */\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon: queryTotal,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAIA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AANA;AACA;AACA;AAFA,MAAAG,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,WAAA;MAAAC,IAAA;MAAA;IAAA;EAAA;EAAAC,WAAA;EAAAC,QAAA;IAAAC,KAAA;IAAAC,IAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,OAAA;IAAA;IAAAC,KAAA;MAAAC,SAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAC,IAAA;MAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAX,6BAAA;QAAAI,QAAA;MAAA;IAAA;IAAAQ,oBAAA;MAAAC,MAAA;MAAAf,KAAA;MAAAgB,KAAA;MAAAC,KAAA;MAAAf,6BAAA;QAAAa,MAAA;QAAAf,KAAA;QAAAgB,KAAA;QAAAC,KAAA;MAAA;IAAA;EAAA;EAAAA,KAAA;AAAA;AAQA;AACA,MAAM;EAAEjC;AAAK,CAAC,GAAGJ,QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAGnB,MAAMkC,QAAQ,GAAArC,OAAA,CAAAqC,QAAA,GAAG;EACvBC,IAAI,EAAEC,iBAAU;EAChBC,IAAI,EAAJA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAEvC,IAAI;EAAEJ,QAAQ;EAAEsC;AAAS,CAAE,CAAC;AAACrC,OAAA,CAAAyC,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {"version":3,"names":["_edit","_interopRequireDefault","require","_initBlock","_icons","metadata","exports","$schema","apiVersion","name","title","category","ancestor","description","textdomain","attributes","displayType","type","usesContext","supports","align","html","spacing","margin","padding","color","gradients","__experimentalDefaultControls","background","text","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalBorder","radius","width","style","interactivity","clientNavigation","settings","icon","queryTotal","edit","init","initBlock"],"sources":["@wordpress/block-library/src/query-total/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport metadata from './block.json';\nimport edit from './edit';\nimport initBlock from '../utils/init-block';\nimport { queryTotal } from './icons';\n\n/* Block settings */\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon: queryTotal,\n\tedit,\n};\n\nexport const init = () => initBlock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EAAEwC;AAAS,CAAE,CAAC;AAACvC,OAAA,CAAA2C,IAAA,GAAAA,IAAA","ignoreList":[]}
package/build/rss/edit.js CHANGED
@@ -32,7 +32,9 @@ function RSSEdit({
32
32
  displayExcerpt,
33
33
  excerptLength,
34
34
  feedURL,
35
- itemsToShow
35
+ itemsToShow,
36
+ openInNewTab,
37
+ rel
36
38
  } = attributes;
37
39
  function toggleAttribute(propName) {
38
40
  return () => {
@@ -173,8 +175,26 @@ function RSSEdit({
173
175
  min: 2,
174
176
  max: 6,
175
177
  required: true
178
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToggleControl, {
179
+ __nextHasNoMarginBottom: true,
180
+ label: (0, _i18n.__)('Open links in new tab'),
181
+ checked: openInNewTab,
182
+ onChange: value => setAttributes({
183
+ openInNewTab: value
184
+ })
176
185
  })]
177
186
  })
187
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
188
+ group: "advanced",
189
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextControl, {
190
+ __next40pxDefaultSize: true,
191
+ __nextHasNoMarginBottom: true,
192
+ label: (0, _i18n.__)('Link rel'),
193
+ value: rel || '',
194
+ onChange: value => setAttributes({
195
+ rel: value
196
+ })
197
+ })
178
198
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
179
199
  ...blockProps,
180
200
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Disabled, {
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_components","_element","_icons","_i18n","_url","_serverSideRender","_interopRequireDefault","_jsxRuntime","DEFAULT_MIN_ITEMS","DEFAULT_MAX_ITEMS","RSSEdit","attributes","setAttributes","isEditing","setIsEditing","useState","feedURL","blockLayout","columns","displayAuthor","displayDate","displayExcerpt","excerptLength","itemsToShow","toggleAttribute","propName","value","onSubmitURL","event","preventDefault","prependHTTP","blockProps","useBlockProps","label","__","jsx","children","Placeholder","icon","rss","instructions","jsxs","onSubmit","className","__experimentalInputControl","__next40pxDefaultSize","type","hideLabelFromVision","placeholder","onChange","Button","variant","toolbarControls","edit","title","onClick","list","_x","isActive","grid","serverSideAttributes","style","border","undefined","spacing","Fragment","BlockControls","ToolbarGroup","controls","InspectorControls","PanelBody","RangeControl","__nextHasNoMarginBottom","min","max","required","ToggleControl","checked","Disabled","default","block"],"sources":["@wordpress/block-library/src/rss/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport {\n\tButton,\n\tDisabled,\n\tPanelBody,\n\tPlaceholder,\n\tRangeControl,\n\tToggleControl,\n\tToolbarGroup,\n\t__experimentalInputControl as InputControl,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { grid, list, edit, rss } from '@wordpress/icons';\nimport { __, _x } from '@wordpress/i18n';\nimport { prependHTTP } from '@wordpress/url';\nimport ServerSideRender from '@wordpress/server-side-render';\n\nconst DEFAULT_MIN_ITEMS = 1;\nconst DEFAULT_MAX_ITEMS = 20;\n\nexport default function RSSEdit( { attributes, setAttributes } ) {\n\tconst [ isEditing, setIsEditing ] = useState( ! attributes.feedURL );\n\n\tconst {\n\t\tblockLayout,\n\t\tcolumns,\n\t\tdisplayAuthor,\n\t\tdisplayDate,\n\t\tdisplayExcerpt,\n\t\texcerptLength,\n\t\tfeedURL,\n\t\titemsToShow,\n\t} = attributes;\n\n\tfunction toggleAttribute( propName ) {\n\t\treturn () => {\n\t\t\tconst value = attributes[ propName ];\n\n\t\t\tsetAttributes( { [ propName ]: ! value } );\n\t\t};\n\t}\n\n\tfunction onSubmitURL( event ) {\n\t\tevent.preventDefault();\n\n\t\tif ( feedURL ) {\n\t\t\tsetAttributes( { feedURL: prependHTTP( feedURL ) } );\n\t\t\tsetIsEditing( false );\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps();\n\n\tconst label = __( 'RSS URL' );\n\n\tif ( isEditing ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Placeholder\n\t\t\t\t\ticon={ rss }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tinstructions={ __(\n\t\t\t\t\t\t'Display entries from any RSS or Atom feed.'\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={ onSubmitURL }\n\t\t\t\t\t\tclassName=\"wp-block-rss__placeholder-form\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\ttype=\"url\"\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tplaceholder={ __( 'Enter URL here…' ) }\n\t\t\t\t\t\t\tvalue={ feedURL }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { feedURL: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tclassName=\"wp-block-rss__placeholder-input\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Apply' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</form>\n\t\t\t\t</Placeholder>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst toolbarControls = [\n\t\t{\n\t\t\ticon: edit,\n\t\t\ttitle: __( 'Edit RSS URL' ),\n\t\t\tonClick: () => setIsEditing( true ),\n\t\t},\n\t\t{\n\t\t\ticon: list,\n\t\t\ttitle: _x( 'List view', 'RSS block display setting' ),\n\t\t\tonClick: () => setAttributes( { blockLayout: 'list' } ),\n\t\t\tisActive: blockLayout === 'list',\n\t\t},\n\t\t{\n\t\t\ticon: grid,\n\t\t\ttitle: _x( 'Grid view', 'RSS block display setting' ),\n\t\t\tonClick: () => setAttributes( { blockLayout: 'grid' } ),\n\t\t\tisActive: blockLayout === 'grid',\n\t\t},\n\t];\n\n\t/*\n\t * This function merges the existing attributes with additional style properties.\n\t * The `border` and `spacing` properties are set to `undefined` to ensure that\n\t * these styles are reset and not applied on the server side.\n\t */\n\tconst serverSideAttributes = {\n\t\t...attributes,\n\t\tstyle: {\n\t\t\t...attributes?.style,\n\t\t\tborder: undefined,\n\t\t\tspacing: undefined,\n\t\t},\n\t};\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup controls={ toolbarControls } />\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tlabel={ __( 'Number of items' ) }\n\t\t\t\t\t\tvalue={ itemsToShow }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { itemsToShow: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmin={ DEFAULT_MIN_ITEMS }\n\t\t\t\t\t\tmax={ DEFAULT_MAX_ITEMS }\n\t\t\t\t\t\trequired\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Display author' ) }\n\t\t\t\t\t\tchecked={ displayAuthor }\n\t\t\t\t\t\tonChange={ toggleAttribute( 'displayAuthor' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Display date' ) }\n\t\t\t\t\t\tchecked={ displayDate }\n\t\t\t\t\t\tonChange={ toggleAttribute( 'displayDate' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Display excerpt' ) }\n\t\t\t\t\t\tchecked={ displayExcerpt }\n\t\t\t\t\t\tonChange={ toggleAttribute( 'displayExcerpt' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ displayExcerpt && (\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Max number of words in excerpt' ) }\n\t\t\t\t\t\t\tvalue={ excerptLength }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { excerptLength: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ 10 }\n\t\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ blockLayout === 'grid' && (\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\tvalue={ columns }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { columns: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ 2 }\n\t\t\t\t\t\t\tmax={ 6 }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Disabled>\n\t\t\t\t\t<ServerSideRender\n\t\t\t\t\t\tblock=\"core/rss\"\n\t\t\t\t\t\tattributes={ serverSideAttributes }\n\t\t\t\t\t/>\n\t\t\t\t</Disabled>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;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A,CAAAuE,YAAY;UACZC,uBAAuB;UACvB3B,qBAAqB;UACrBZ,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU,CAAG;UACzBR,KAAK,EAAGR,OAAS;UACjB+B,QAAQ,EAAKvB,KAAK,IACjBd,aAAa,CAAE;YAAEM,OAAO,EAAEQ;UAAM,CAAE,CAClC;UACD+C,GAAG,EAAG,CAAG;UACTC,GAAG,EAAG,CAAG;UACTC,QAAQ;QAAA,CACR,CACD;MAAA,CACS;IAAC,CACM,CAAC,eACpB,IAAApE,WAAA,CAAA4B,GAAA;MAAA,GAAUJ,UAAU;MAAAK,QAAA,eACnB,IAAA7B,WAAA,CAAA4B,GAAA,EAACnC,WAAA,CAAA8E,QAAQ;QAAA1C,QAAA,eACR,IAAA7B,WAAA,CAAA4B,GAAA,EAAC9B,iBAAA,CAAA0E,OAAgB;UAChBC,KAAK,EAAC,UAAU;UAChBrE,UAAU,EAAGiD;QAAsB,CACnC;MAAC,CACO;IAAC,CACP,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_blockEditor","require","_components","_element","_icons","_i18n","_url","_serverSideRender","_interopRequireDefault","_jsxRuntime","DEFAULT_MIN_ITEMS","DEFAULT_MAX_ITEMS","RSSEdit","attributes","setAttributes","isEditing","setIsEditing","useState","feedURL","blockLayout","columns","displayAuthor","displayDate","displayExcerpt","excerptLength","itemsToShow","openInNewTab","rel","toggleAttribute","propName","value","onSubmitURL","event","preventDefault","prependHTTP","blockProps","useBlockProps","label","__","jsx","children","Placeholder","icon","rss","instructions","jsxs","onSubmit","className","__experimentalInputControl","__next40pxDefaultSize","type","hideLabelFromVision","placeholder","onChange","Button","variant","toolbarControls","edit","title","onClick","list","_x","isActive","grid","serverSideAttributes","style","border","undefined","spacing","Fragment","BlockControls","ToolbarGroup","controls","InspectorControls","PanelBody","RangeControl","__nextHasNoMarginBottom","min","max","required","ToggleControl","checked","group","TextControl","Disabled","default","block"],"sources":["@wordpress/block-library/src/rss/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport {\n\tButton,\n\tDisabled,\n\tPanelBody,\n\tPlaceholder,\n\tRangeControl,\n\tToggleControl,\n\tToolbarGroup,\n\tTextControl,\n\t__experimentalInputControl as InputControl,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { grid, list, edit, rss } from '@wordpress/icons';\nimport { __, _x } from '@wordpress/i18n';\nimport { prependHTTP } from '@wordpress/url';\nimport ServerSideRender from '@wordpress/server-side-render';\n\nconst DEFAULT_MIN_ITEMS = 1;\nconst DEFAULT_MAX_ITEMS = 20;\n\nexport default function RSSEdit( { attributes, setAttributes } ) {\n\tconst [ isEditing, setIsEditing ] = useState( ! attributes.feedURL );\n\n\tconst {\n\t\tblockLayout,\n\t\tcolumns,\n\t\tdisplayAuthor,\n\t\tdisplayDate,\n\t\tdisplayExcerpt,\n\t\texcerptLength,\n\t\tfeedURL,\n\t\titemsToShow,\n\t\topenInNewTab,\n\t\trel,\n\t} = attributes;\n\n\tfunction toggleAttribute( propName ) {\n\t\treturn () => {\n\t\t\tconst value = attributes[ propName ];\n\n\t\t\tsetAttributes( { [ propName ]: ! value } );\n\t\t};\n\t}\n\n\tfunction onSubmitURL( event ) {\n\t\tevent.preventDefault();\n\n\t\tif ( feedURL ) {\n\t\t\tsetAttributes( { feedURL: prependHTTP( feedURL ) } );\n\t\t\tsetIsEditing( false );\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps();\n\n\tconst label = __( 'RSS URL' );\n\n\tif ( isEditing ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Placeholder\n\t\t\t\t\ticon={ rss }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tinstructions={ __(\n\t\t\t\t\t\t'Display entries from any RSS or Atom feed.'\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={ onSubmitURL }\n\t\t\t\t\t\tclassName=\"wp-block-rss__placeholder-form\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\ttype=\"url\"\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tplaceholder={ __( 'Enter URL here…' ) }\n\t\t\t\t\t\t\tvalue={ feedURL }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { feedURL: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tclassName=\"wp-block-rss__placeholder-input\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Apply' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</form>\n\t\t\t\t</Placeholder>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst toolbarControls = [\n\t\t{\n\t\t\ticon: edit,\n\t\t\ttitle: __( 'Edit RSS URL' ),\n\t\t\tonClick: () => setIsEditing( true ),\n\t\t},\n\t\t{\n\t\t\ticon: list,\n\t\t\ttitle: _x( 'List view', 'RSS block display setting' ),\n\t\t\tonClick: () => setAttributes( { blockLayout: 'list' } ),\n\t\t\tisActive: blockLayout === 'list',\n\t\t},\n\t\t{\n\t\t\ticon: grid,\n\t\t\ttitle: _x( 'Grid view', 'RSS block display setting' ),\n\t\t\tonClick: () => setAttributes( { blockLayout: 'grid' } ),\n\t\t\tisActive: blockLayout === 'grid',\n\t\t},\n\t];\n\n\t/*\n\t * This function merges the existing attributes with additional style properties.\n\t * The `border` and `spacing` properties are set to `undefined` to ensure that\n\t * these styles are reset and not applied on the server side.\n\t */\n\tconst serverSideAttributes = {\n\t\t...attributes,\n\t\tstyle: {\n\t\t\t...attributes?.style,\n\t\t\tborder: undefined,\n\t\t\tspacing: undefined,\n\t\t},\n\t};\n\treturn (\n\t\t<>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup controls={ toolbarControls } />\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tlabel={ __( 'Number of items' ) }\n\t\t\t\t\t\tvalue={ itemsToShow }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { itemsToShow: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmin={ DEFAULT_MIN_ITEMS }\n\t\t\t\t\t\tmax={ DEFAULT_MAX_ITEMS }\n\t\t\t\t\t\trequired\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Display author' ) }\n\t\t\t\t\t\tchecked={ displayAuthor }\n\t\t\t\t\t\tonChange={ toggleAttribute( 'displayAuthor' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Display date' ) }\n\t\t\t\t\t\tchecked={ displayDate }\n\t\t\t\t\t\tonChange={ toggleAttribute( 'displayDate' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Display excerpt' ) }\n\t\t\t\t\t\tchecked={ displayExcerpt }\n\t\t\t\t\t\tonChange={ toggleAttribute( 'displayExcerpt' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t{ displayExcerpt && (\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Max number of words in excerpt' ) }\n\t\t\t\t\t\t\tvalue={ excerptLength }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { excerptLength: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ 10 }\n\t\t\t\t\t\t\tmax={ 100 }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ blockLayout === 'grid' && (\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\tvalue={ columns }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { columns: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ 2 }\n\t\t\t\t\t\t\tmax={ 6 }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\tchecked={ openInNewTab }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { openInNewTab: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\tonChange={ ( value ) => setAttributes( { rel: value } ) }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Disabled>\n\t\t\t\t\t<ServerSideRender\n\t\t\t\t\t\tblock=\"core/rss\"\n\t\t\t\t\t\tattributes={ serverSideAttributes }\n\t\t\t\t\t/>\n\t\t\t\t</Disabled>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAWA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAC,sBAAA,CAAAP,OAAA;AAA6D,IAAAQ,WAAA,GAAAR,OAAA;AAvB7D;AACA;AACA;;AAuBA,MAAMS,iBAAiB,GAAG,CAAC;AAC3B,MAAMC,iBAAiB,GAAG,EAAE;AAEb,SAASC,OAAOA,CAAE;EAAEC,UAAU;EAAEC;AAAc,CAAC,EAAG;EAChE,MAAM,CAAEC,SAAS,EAAEC,YAAY,CAAE,GAAG,IAAAC,iBAAQ,EAAE,CAAEJ,UAAU,CAACK,OAAQ,CAAC;EAEpE,MAAM;IACLC,WAAW;IACXC,OAAO;IACPC,aAAa;IACbC,WAAW;IACXC,cAAc;IACdC,aAAa;IACbN,OAAO;IACPO,WAAW;IACXC,YAAY;IACZC;EACD,CAAC,GAAGd,UAAU;EAEd,SAASe,eAAeA,CAAEC,QAAQ,EAAG;IACpC,OAAO,MAAM;MACZ,MAAMC,KAAK,GAAGjB,UAAU,CAAEgB,QAAQ,CAAE;MAEpCf,aAAa,CAAE;QAAE,CAAEe,QAAQ,GAAI,CAAEC;MAAM,CAAE,CAAC;IAC3C,CAAC;EACF;EAEA,SAASC,WAAWA,CAAEC,KAAK,EAAG;IAC7BA,KAAK,CAACC,cAAc,CAA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Ea,GAAG,EAAEG;QAAM,CAAE;MAAG,CACzD;IAAC,CACgB,CAAC,eACpB,IAAArB,WAAA,CAAA8B,GAAA;MAAA,GAAUJ,UAAU;MAAAK,QAAA,eACnB,IAAA/B,WAAA,CAAA8B,GAAA,EAACrC,WAAA,CAAAkF,QAAQ;QAAA5C,QAAA,eACR,IAAA/B,WAAA,CAAA8B,GAAA,EAAChC,iBAAA,CAAA8E,OAAgB;UAChBC,KAAK,EAAC,UAAU;UAChBzE,UAAU,EAAGmD;QAAsB,CACnC;MAAC,CACO;IAAC,CACP,CAAC;EAAA,CACL,CAAC;AAEL","ignoreList":[]}
@@ -55,6 +55,13 @@ const metadata = exports.metadata = {
55
55
  excerptLength: {
56
56
  type: "number",
57
57
  "default": 55
58
+ },
59
+ openInNewTab: {
60
+ type: "boolean",
61
+ "default": false
62
+ },
63
+ rel: {
64
+ type: "string"
58
65
  }
59
66
  },
60
67
  supports: {
@@ -1 +1 @@
1
- {"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","metadata","exports","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","columns","type","blockLayout","feedURL","itemsToShow","displayExcerpt","displayAuthor","displayDate","excerptLength","supports","align","html","interactivity","clientNavigation","__experimentalBorder","radius","color","width","style","spacing","margin","padding","__experimentalDefaultControls","background","text","gradients","link","editorStyle","settings","icon","example","edit","init","initBlock"],"sources":["@wordpress/block-library/src/rss/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { rss as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tfeedURL: 'https://wordpress.org',\n\t\t},\n\t},\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA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AEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAExC,IAAI;EAAEJ,QAAQ;EAAEuC;AAAS,CAAE,CAAC;AAACtC,OAAA,CAAA0C,IAAA,GAAAA,IAAA","ignoreList":[]}
1
+ {"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","metadata","exports","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","columns","type","blockLayout","feedURL","itemsToShow","displayExcerpt","displayAuthor","displayDate","excerptLength","openInNewTab","rel","supports","align","html","interactivity","clientNavigation","__experimentalBorder","radius","color","width","style","spacing","margin","padding","__experimentalDefaultControls","background","text","gradients","link","editorStyle","settings","icon","example","edit","init","initBlock"],"sources":["@wordpress/block-library/src/rss/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { rss as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tfeedURL: 'https://wordpress.org',\n\t\t},\n\t},\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AAVA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAI,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,OAAA;MAAAC,IAAA;MAAA;IAAA;IAAAC,WAAA;MAAAD,IAAA;MAAA;IAAA;IAAAE,OAAA;MAAAF,IAAA;MAAA;IAAA;IAAAG,WAAA;MAAAH,IAAA;MAAA;IAAA;IAAAI,cAAA;MAAAJ,IAAA;MAAA;IAAA;IAAAK,aAAA;MAAAL,IAAA;MAAA;IAAA;IAAAM,WAAA;MAAAN,IAAA;MAAA;IAAA;IAAAO,aAAA;MAAAP,IAAA;MAAA;IAAA;IAAAQ,YAAA;MAAAR,IAAA;MAAA;IAAA;IAAAS,GAAA;MAAAT,IAAA;IAAA;EAAA;EAAAU,QAAA;IAAAC,KAAA;IAAAC,IAAA;IAAAC,aAAA;MAAAC,gBAAA;IAAA;IAAAC,oBAAA;MAAAC,MAAA;MAAAC,KAAA;MAAAC,KAAA;MAAAC,KAAA;IAAA;IAAAC,OAAA;MAAAC,MAAA;MAAAC,OAAA;MAAAC,6BAAA;QAAAD,OAAA;QAAAD,MAAA;MAAA;IAAA;IAAAJ,KAAA;MAAAO,UAAA;MAAAC,IAAA;MAAAC,SAAA;MAAAC,IAAA;IAAA;EAAA;EAAAC,WAAA;EAAAT,KAAA;AAAA;AAOA,MAAM;EAAE3B;AAAK,CAAC,GAAGJ,QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAInB,MAAMqC,QAAQ,GAAAxC,OAAA,CAAAwC,QAAA,GAAG;EACvBC,IAAI,EAAJA,UAAI;EACJC,OAAO,EAAE;IACRjC,UAAU,EAAE;MACXI,OAAO,EAAE;IACV;EACD,CAAC;EACD8B,IAAI,EAAJA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAE1C,IAAI;EAAEJ,QAAQ;EAAEyC;AAAS,CAAE,CAAC;AAACxC,OAAA,CAAA4C,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -65,7 +65,7 @@ function SiteTitleEdit({
65
65
  const dropdownMenuProps = (0, _hooks.useToolsPanelDropdownMenuProps)();
66
66
  function setTitle(newTitle) {
67
67
  editEntityRecord('root', 'site', undefined, {
68
- title: newTitle
68
+ title: newTitle.trim()
69
69
  });
70
70
  }
71
71
  const TagName = level === 0 ? 'p' : `h${level}`;
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_data","_coreData","_i18n","_blockEditor","_components","_blocks","_htmlEntities","_hooks","_jsxRuntime","SiteTitleEdit","attributes","setAttributes","insertBlocksAfter","level","levelOptions","textAlign","isLink","linkTarget","canUserEdit","title","useSelect","select","canUser","getEntityRecord","getEditedEntityRecord","coreStore","canEdit","kind","name","settings","readOnlySettings","editEntityRecord","useDispatch","dropdownMenuProps","useToolsPanelDropdownMenuProps","setTitle","newTitle","undefined","TagName","blockProps","useBlockProps","className","clsx","siteTitleContent","jsx","children","RichText","tagName","href","__","placeholder","value","onChange","allowedFormats","disableLineBreaks","__unstableOnSplitAtEnd","createBlock","getDefaultBlockName","onClick","event","preventDefault","decodeEntities","jsxs","Fragment","BlockControls","group","HeadingLevelDropdown","options","newLevel","AlignmentControl","nextAlign","InspectorControls","__experimentalToolsPanel","label","resetAll","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","ToggleControl","__nextHasNoMarginBottom","checked"],"sources":["@wordpress/block-library/src/site-title/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tRichText,\n\tAlignmentControl,\n\tInspectorControls,\n\tBlockControls,\n\tuseBlockProps,\n\tHeadingLevelDropdown,\n} from '@wordpress/block-editor';\nimport {\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function SiteTitleEdit( {\n\tattributes,\n\tsetAttributes,\n\tinsertBlocksAfter,\n} ) {\n\tconst { level, levelOptions, textAlign, isLink, linkTarget } = attributes;\n\tconst { canUserEdit, title } = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEditedEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst canEdit = canUser( 'update', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} );\n\t\tconst settings = canEdit ? getEditedEntityRecord( 'root', 'site' ) : {};\n\t\tconst readOnlySettings = getEntityRecord( 'root', '__unstableBase' );\n\n\t\treturn {\n\t\t\tcanUserEdit: canEdit,\n\t\t\ttitle: canEdit ? settings?.title : readOnlySettings?.name,\n\t\t};\n\t}, [] );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tfunction setTitle( newTitle ) {\n\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\ttitle: newTitle,\n\t\t} );\n\t}\n\n\tconst TagName = level === 0 ? 'p' : `h${ level }`;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t\t'wp-block-site-title__placeholder': ! canUserEdit && ! title,\n\t\t} ),\n\t} );\n\tconst siteTitleContent = canUserEdit ? (\n\t\t<TagName { ...blockProps }>\n\t\t\t<RichText\n\t\t\t\ttagName={ isLink ? 'a' : 'span' }\n\t\t\t\thref={ isLink ? '#site-title-pseudo-link' : undefined }\n\t\t\t\taria-label={ __( 'Site title text' ) }\n\t\t\t\tplaceholder={ __( 'Write site title…' ) }\n\t\t\t\tvalue={ title }\n\t\t\t\tonChange={ setTitle }\n\t\t\t\tallowedFormats={ [] }\n\t\t\t\tdisableLineBreaks\n\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\tinsertBlocksAfter( createBlock( getDefaultBlockName() ) )\n\t\t\t\t}\n\t\t\t/>\n\t\t</TagName>\n\t) : (\n\t\t<TagName { ...blockProps }>\n\t\t\t{ isLink ? (\n\t\t\t\t<a\n\t\t\t\t\thref=\"#site-title-pseudo-link\"\n\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t>\n\t\t\t\t\t{ decodeEntities( title ) ||\n\t\t\t\t\t\t__( 'Site Title placeholder' ) }\n\t\t\t\t</a>\n\t\t\t) : (\n\t\t\t\t<span>\n\t\t\t\t\t{ decodeEntities( title ) ||\n\t\t\t\t\t\t__( 'Site Title placeholder' ) }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t</TagName>\n\t);\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<HeadingLevelDropdown\n\t\t\t\t\tvalue={ level }\n\t\t\t\t\toptions={ levelOptions }\n\t\t\t\t\tonChange={ ( newLevel ) =>\n\t\t\t\t\t\tsetAttributes( { level: newLevel } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tisLink: true,\n\t\t\t\t\t\t\tlinkTarget: '_self',\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => ! isLink }\n\t\t\t\t\t\tlabel={ __( 'Make title link to home' ) }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { isLink: true } ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Make title link to home' ) }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { isLink: ! isLink } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => linkTarget !== '_self' }\n\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { linkTarget: '_self' } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\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\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t{ siteTitleContent }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAQA,IAAAK,WAAA,GAAAL,OAAA;AAKA,I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n","_blockEditor","_components","_blocks","_htmlEntities","_hooks","_jsxRuntime","SiteTitleEdit","attributes","setAttributes","insertBlocksAfter","level","levelOptions","textAlign","isLink","linkTarget","canUserEdit","title","useSelect","select","canUser","getEntityRecord","getEditedEntityRecord","coreStore","canEdit","kind","name","settings","readOnlySettings","editEntityRecord","useDispatch","dropdownMenuProps","useToolsPanelDropdownMenuProps","setTitle","newTitle","undefined","trim","TagName","blockProps","useBlockProps","className","clsx","siteTitleContent","jsx","children","RichText","tagName","href","__","placeholder","value","onChange","allowedFormats","disableLineBreaks","__unstableOnSplitAtEnd","createBlock","getDefaultBlockName","onClick","event","preventDefault","decodeEntities","jsxs","Fragment","BlockControls","group","HeadingLevelDropdown","options","newLevel","AlignmentControl","nextAlign","InspectorControls","__experimentalToolsPanel","label","resetAll","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","ToggleControl","__nextHasNoMarginBottom","checked"],"sources":["@wordpress/block-library/src/site-title/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tRichText,\n\tAlignmentControl,\n\tInspectorControls,\n\tBlockControls,\n\tuseBlockProps,\n\tHeadingLevelDropdown,\n} from '@wordpress/block-editor';\nimport {\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { createBlock, getDefaultBlockName } from '@wordpress/blocks';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function SiteTitleEdit( {\n\tattributes,\n\tsetAttributes,\n\tinsertBlocksAfter,\n} ) {\n\tconst { level, levelOptions, textAlign, isLink, linkTarget } = attributes;\n\tconst { canUserEdit, title } = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEditedEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst canEdit = canUser( 'update', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} );\n\t\tconst settings = canEdit ? getEditedEntityRecord( 'root', 'site' ) : {};\n\t\tconst readOnlySettings = getEntityRecord( 'root', '__unstableBase' );\n\n\t\treturn {\n\t\t\tcanUserEdit: canEdit,\n\t\t\ttitle: canEdit ? settings?.title : readOnlySettings?.name,\n\t\t};\n\t}, [] );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tfunction setTitle( newTitle ) {\n\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\ttitle: newTitle.trim(),\n\t\t} );\n\t}\n\n\tconst TagName = level === 0 ? 'p' : `h${ level }`;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t\t'wp-block-site-title__placeholder': ! canUserEdit && ! title,\n\t\t} ),\n\t} );\n\tconst siteTitleContent = canUserEdit ? (\n\t\t<TagName { ...blockProps }>\n\t\t\t<RichText\n\t\t\t\ttagName={ isLink ? 'a' : 'span' }\n\t\t\t\thref={ isLink ? '#site-title-pseudo-link' : undefined }\n\t\t\t\taria-label={ __( 'Site title text' ) }\n\t\t\t\tplaceholder={ __( 'Write site title…' ) }\n\t\t\t\tvalue={ title }\n\t\t\t\tonChange={ setTitle }\n\t\t\t\tallowedFormats={ [] }\n\t\t\t\tdisableLineBreaks\n\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\tinsertBlocksAfter( createBlock( getDefaultBlockName() ) )\n\t\t\t\t}\n\t\t\t/>\n\t\t</TagName>\n\t) : (\n\t\t<TagName { ...blockProps }>\n\t\t\t{ isLink ? (\n\t\t\t\t<a\n\t\t\t\t\thref=\"#site-title-pseudo-link\"\n\t\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t\t>\n\t\t\t\t\t{ decodeEntities( title ) ||\n\t\t\t\t\t\t__( 'Site Title placeholder' ) }\n\t\t\t\t</a>\n\t\t\t) : (\n\t\t\t\t<span>\n\t\t\t\t\t{ decodeEntities( title ) ||\n\t\t\t\t\t\t__( 'Site Title placeholder' ) }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t</TagName>\n\t);\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<HeadingLevelDropdown\n\t\t\t\t\tvalue={ level }\n\t\t\t\t\toptions={ levelOptions }\n\t\t\t\t\tonChange={ ( newLevel ) =>\n\t\t\t\t\t\tsetAttributes( { level: newLevel } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tisLink: true,\n\t\t\t\t\t\t\tlinkTarget: '_self',\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => ! isLink }\n\t\t\t\t\t\tlabel={ __( 'Make title link to home' ) }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { isLink: true } ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\tlabel={ __( 'Make title link to home' ) }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { isLink: ! isLink } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () => linkTarget !== '_self' }\n\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { linkTarget: '_self' } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\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\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t{ siteTitleContent }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAQA,IAAAK,WAAA,GAAAL,OAAA;AAKA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AAAgE,IAA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AK,EAAG,IAAAxB,QAAE,EAAE,yBAA0B,CAAG;UACzC4B,UAAU,EAAGA,CAAA,KAAMnE,aAAa,CAAE;YAAEK,MAAM,EAAE;UAAK,CAAE,CAAG;UACtD+D,gBAAgB;UAAAjC,QAAA,eAEhB,IAAAtC,WAAA,CAAAqC,GAAA,EAACzC,WAAA,CAAA4E,aAAa;YACbC,uBAAuB;YACvBP,KAAK,EAAG,IAAAxB,QAAE,EAAE,yBAA0B,CAAG;YACzCG,QAAQ,EAAGA,CAAA,KACV1C,aAAa,CAAE;cAAEK,MAAM,EAAE,CAAEA;YAAO,CAAE,CACpC;YACDkE,OAAO,EAAGlE;UAAQ,CAClB;QAAC,CACa,CAAC,EACfA,MAAM,iBACP,IAAAR,WAAA,CAAAqC,GAAA,EAACzC,WAAA,CAAAwE,4BAAc;UACdC,QAAQ,EAAGA,CAAA,KAAM5D,UAAU,KAAK,OAAS;UACzCyD,KAAK,EAAG,IAAAxB,QAAE,EAAE,iBAAkB,CAAG;UACjC4B,UAAU,EAAGA,CAAA,KACZnE,aAAa,CAAE;YAAEM,UAAU,EAAE;UAAQ,CAAE,CACvC;UACD8D,gBAAgB;UAAAjC,QAAA,eAEhB,IAAAtC,WAAA,CAAAqC,GAAA,EAACzC,WAAA,CAAA4E,aAAa;YACbC,uBAAuB;YACvBP,KAAK,EAAG,IAAAxB,QAAE,EAAE,iBAAkB,CAAG;YACjCG,QAAQ,EAAKD,KAAK,IACjBzC,aAAa,CAAE;cACdM,UAAU,EAAEmC,KAAK,GAAG,QAAQ,GAAG;YAChC,CAAE,CACF;YACD8B,OAAO,EAAGjE,UAAU,KAAK;UAAU,CACnC;QAAC,CACa,CAChB;MAAA,CACU;IAAC,CACK,CAAC,EAClB2B,gBAAgB;EAAA,CACjB,CAAC;AAEL","ignoreList":[]}
@@ -34,16 +34,18 @@ var _jsxRuntime = require("react/jsx-runtime");
34
34
  *
35
35
  * @param {Object} props The props.
36
36
  * @param {Object} props.attributes The block attributes.
37
- * @param {HeadingData[]} props.attributes.headings A list of data for each heading in the post.
37
+ * @param {HeadingData[]} props.attributes.headings The list of data for each heading in the post.
38
38
  * @param {boolean} props.attributes.onlyIncludeCurrentPage Whether to only include headings from the current page (if the post is paginated).
39
- * @param {string} props.clientId
40
- * @param {(attributes: Object) => void} props.setAttributes
39
+ * @param {number|undefined} props.attributes.maxLevel The maximum heading level to include, or null to include all levels.
40
+ * @param {string} props.clientId The client id.
41
+ * @param {(attributes: Object) => void} props.setAttributes The set attributes function.
41
42
  *
42
43
  * @return {Component} The component.
43
44
  */function TableOfContentsEdit({
44
45
  attributes: {
45
46
  headings = [],
46
- onlyIncludeCurrentPage
47
+ onlyIncludeCurrentPage,
48
+ maxLevel
47
49
  },
48
50
  clientId,
49
51
  setAttributes
@@ -90,15 +92,16 @@ var _jsxRuntime = require("react/jsx-runtime");
90
92
  })
91
93
  });
92
94
  const inspectorControls = /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.InspectorControls, {
93
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanel, {
95
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalToolsPanel, {
94
96
  label: (0, _i18n.__)('Settings'),
95
97
  resetAll: () => {
96
98
  setAttributes({
97
- onlyIncludeCurrentPage: false
99
+ onlyIncludeCurrentPage: false,
100
+ maxLevel: undefined
98
101
  });
99
102
  },
100
103
  dropdownMenuProps: dropdownMenuProps,
101
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
104
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
102
105
  hasValue: () => !!onlyIncludeCurrentPage,
103
106
  label: (0, _i18n.__)('Only include current page'),
104
107
  onDeselect: () => setAttributes({
@@ -114,7 +117,46 @@ var _jsxRuntime = require("react/jsx-runtime");
114
117
  }),
115
118
  help: onlyIncludeCurrentPage ? (0, _i18n.__)('Only including headings from the current page (if the post is paginated).') : (0, _i18n.__)('Include headings from all pages (if the post is paginated).')
116
119
  })
117
- })
120
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalToolsPanelItem, {
121
+ hasValue: () => !!maxLevel,
122
+ label: (0, _i18n.__)('Limit heading levels'),
123
+ onDeselect: () => setAttributes({
124
+ maxLevel: undefined
125
+ }),
126
+ isShownByDefault: true,
127
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.SelectControl, {
128
+ __nextHasNoMarginBottom: true,
129
+ __next40pxDefaultSize: true,
130
+ label: (0, _i18n.__)('Include headings down to level'),
131
+ value: maxLevel || '',
132
+ options: [{
133
+ value: '',
134
+ label: (0, _i18n.__)('All levels')
135
+ }, {
136
+ value: '1',
137
+ label: (0, _i18n.__)('Heading 1')
138
+ }, {
139
+ value: '2',
140
+ label: (0, _i18n.__)('Heading 2')
141
+ }, {
142
+ value: '3',
143
+ label: (0, _i18n.__)('Heading 3')
144
+ }, {
145
+ value: '4',
146
+ label: (0, _i18n.__)('Heading 4')
147
+ }, {
148
+ value: '5',
149
+ label: (0, _i18n.__)('Heading 5')
150
+ }, {
151
+ value: '6',
152
+ label: (0, _i18n.__)('Heading 6')
153
+ }],
154
+ onChange: value => setAttributes({
155
+ maxLevel: value ? parseInt(value) : undefined
156
+ }),
157
+ help: maxLevel ? (0, _i18n.__)('Including all heading levels in the table of contents.') : (0, _i18n.__)('Only include headings up to and including this level.')
158
+ })
159
+ })]
118
160
  })
119
161
  });
120
162
 
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_blocks","_components","_data","_element","_i18n","_compose","_notices","_icons","_list","_interopRequireDefault","_utils","_hooks","_hooks2","_jsxRuntime","TableOfContentsEdit","attributes","headings","onlyIncludeCurrentPage","clientId","setAttributes","useObserveHeadings","blockProps","useBlockProps","instanceId","useInstanceId","createWarningNotice","useDispatch","noticeStore","showRedirectionPreventedNotice","event","preventDefault","__","id","type","canInsertList","useSelect","select","getBlockRootClientId","canInsertBlockType","blockEditorStore","rootClientId","replaceBlocks","dropdownMenuProps","useToolsPanelDropdownMenuProps","headingTree","linearToNestedHeadingList","toolbarControls","jsx","BlockControls","children","ToolbarGroup","ToolbarButton","onClick","createBlock","ordered","values","renderToString","default","nestedHeadingList","inspectorControls","InspectorControls","__experimentalToolsPanel","label","resetAll","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","ToggleControl","__nextHasNoMarginBottom","checked","onChange","value","help","length","jsxs","Fragment","Placeholder","icon","BlockIcon","instructions","disableLinkActivation"],"sources":["@wordpress/block-library/src/table-of-contents/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tInspectorControls,\n\tstore as blockEditorStore,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\tPlaceholder,\n\tToggleControl,\n\tToolbarButton,\n\tToolbarGroup,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { renderToString } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as noticeStore } from '@wordpress/notices';\nimport { tableOfContents as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsList from './list';\nimport { linearToNestedHeadingList } from './utils';\nimport { useObserveHeadings } from './hooks';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\n/** @typedef {import('./utils').HeadingData} HeadingData */\n\n/**\n * Table of Contents block edit component.\n *\n * @param {Object} props The props.\n * @param {Object} props.attributes The block attributes.\n * @param {HeadingData[]} props.attributes.headings A list of data for each heading in the post.\n * @param {boolean} props.attributes.onlyIncludeCurrentPage Whether to only include headings from the current page (if the post is paginated).\n * @param {string} props.clientId\n * @param {(attributes: Object) => void} props.setAttributes\n *\n * @return {Component} The component.\n */\nexport default function TableOfContentsEdit( {\n\tattributes: { headings = [], onlyIncludeCurrentPage },\n\tclientId,\n\tsetAttributes,\n} ) {\n\tuseObserveHeadings( clientId );\n\n\tconst blockProps = useBlockProps();\n\tconst instanceId = useInstanceId(\n\t\tTableOfContentsEdit,\n\t\t'table-of-contents'\n\t);\n\n\t// If a user clicks to a link prevent redirection and show a warning.\n\tconst { createWarningNotice } = useDispatch( noticeStore );\n\tconst showRedirectionPreventedNotice = ( event ) => {\n\t\tevent.preventDefault();\n\t\tcreateWarningNotice( __( 'Links are disabled in the editor.' ), {\n\t\t\tid: `block-library/core/table-of-contents/redirection-prevented/${ instanceId }`,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t};\n\n\tconst canInsertList = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, canInsertBlockType } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\n\t\t\treturn canInsertBlockType( 'core/list', rootClientId );\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst headingTree = linearToNestedHeadingList( headings );\n\n\tconst toolbarControls = canInsertList && (\n\t\t<BlockControls>\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\tcreateBlock( 'core/list', {\n\t\t\t\t\t\t\t\tordered: true,\n\t\t\t\t\t\t\t\tvalues: renderToString(\n\t\t\t\t\t\t\t\t\t<TableOfContentsList\n\t\t\t\t\t\t\t\t\t\tnestedHeadingList={ headingTree }\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>\n\t\t\t\t\t{ __( 'Convert to static list' ) }\n\t\t\t\t</ToolbarButton>\n\t\t\t</ToolbarGroup>\n\t\t</BlockControls>\n\t);\n\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\tresetAll={ () => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tonlyIncludeCurrentPage: false,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t>\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => !! onlyIncludeCurrentPage }\n\t\t\t\t\tlabel={ __( 'Only include current page' ) }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( { onlyIncludeCurrentPage: false } )\n\t\t\t\t\t}\n\t\t\t\t\tisShownByDefault\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Only include current page' ) }\n\t\t\t\t\t\tchecked={ onlyIncludeCurrentPage }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { onlyIncludeCurrentPage: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\tonlyIncludeCurrentPage\n\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t'Only including headings from the current page (if the post is paginated).'\n\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\t'Include headings from all pages (if the post is paginated).'\n\t\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</ToolsPanelItem>\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n\n\t// If there are no headings or the only heading is empty.\n\t// Note that the toolbar controls are intentionally omitted since the\n\t// \"Convert to static list\" option is useless to the placeholder state.\n\tif ( headings.length === 0 ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\t\tlabel={ __( 'Table of Contents' ) }\n\t\t\t\t\t\tinstructions={ __(\n\t\t\t\t\t\t\t'Start adding Heading blocks to create a table of contents. Headings with HTML anchors will be linked here.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{ inspectorControls }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<nav { ...blockProps }>\n\t\t\t\t<ol>\n\t\t\t\t\t<TableOfContentsList\n\t\t\t\t\t\tnestedHeadingList={ headingTree }\n\t\t\t\t\t\tdisableLinkActivation\n\t\t\t\t\t\tonClick={ showRedirectionPreventedNotice }\n\t\t\t\t\t/>\n\t\t\t\t</ol>\n\t\t\t</nav>\n\t\t\t{ toolbarControls }\n\t\t\t{ inspectorControls }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAOA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAQA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAKA,IAAAS,KAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,OAAA,GAAAb,OAAA;AAAgE,IAAAc,WAAA,GAAAd,OAAA;AAhChE;AACA;AACA;;AAwBA;AACA;AACA;;AAMA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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C,CACD,CAAC,EACJkB,eAAe,EACfa,iBAAiB;EAAA,CAClB,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_blockEditor","require","_blocks","_components","_data","_element","_i18n","_compose","_notices","_icons","_list","_interopRequireDefault","_utils","_hooks","_hooks2","_jsxRuntime","TableOfContentsEdit","attributes","headings","onlyIncludeCurrentPage","maxLevel","clientId","setAttributes","useObserveHeadings","blockProps","useBlockProps","instanceId","useInstanceId","createWarningNotice","useDispatch","noticeStore","showRedirectionPreventedNotice","event","preventDefault","__","id","type","canInsertList","useSelect","select","getBlockRootClientId","canInsertBlockType","blockEditorStore","rootClientId","replaceBlocks","dropdownMenuProps","useToolsPanelDropdownMenuProps","headingTree","linearToNestedHeadingList","toolbarControls","jsx","BlockControls","children","ToolbarGroup","ToolbarButton","onClick","createBlock","ordered","values","renderToString","default","nestedHeadingList","inspectorControls","InspectorControls","jsxs","__experimentalToolsPanel","label","resetAll","undefined","__experimentalToolsPanelItem","hasValue","onDeselect","isShownByDefault","ToggleControl","__nextHasNoMarginBottom","checked","onChange","value","help","SelectControl","__next40pxDefaultSize","options","parseInt","length","Fragment","Placeholder","icon","BlockIcon","instructions","disableLinkActivation"],"sources":["@wordpress/block-library/src/table-of-contents/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockControls,\n\tBlockIcon,\n\tInspectorControls,\n\tstore as blockEditorStore,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { createBlock } from '@wordpress/blocks';\nimport {\n\tPlaceholder,\n\tToggleControl,\n\tSelectControl,\n\tToolbarButton,\n\tToolbarGroup,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { renderToString } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as noticeStore } from '@wordpress/notices';\nimport { tableOfContents as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsList from './list';\nimport { linearToNestedHeadingList } from './utils';\nimport { useObserveHeadings } from './hooks';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\n/** @typedef {import('./utils').HeadingData} HeadingData */\n\n/**\n * Table of Contents block edit component.\n *\n * @param {Object} props The props.\n * @param {Object} props.attributes The block attributes.\n * @param {HeadingData[]} props.attributes.headings The list of data for each heading in the post.\n * @param {boolean} props.attributes.onlyIncludeCurrentPage Whether to only include headings from the current page (if the post is paginated).\n * @param {number|undefined} props.attributes.maxLevel The maximum heading level to include, or null to include all levels.\n * @param {string} props.clientId The client id.\n * @param {(attributes: Object) => void} props.setAttributes The set attributes function.\n *\n * @return {Component} The component.\n */\nexport default function TableOfContentsEdit( {\n\tattributes: { headings = [], onlyIncludeCurrentPage, maxLevel },\n\tclientId,\n\tsetAttributes,\n} ) {\n\tuseObserveHeadings( clientId );\n\n\tconst blockProps = useBlockProps();\n\tconst instanceId = useInstanceId(\n\t\tTableOfContentsEdit,\n\t\t'table-of-contents'\n\t);\n\n\t// If a user clicks to a link prevent redirection and show a warning.\n\tconst { createWarningNotice } = useDispatch( noticeStore );\n\tconst showRedirectionPreventedNotice = ( event ) => {\n\t\tevent.preventDefault();\n\t\tcreateWarningNotice( __( 'Links are disabled in the editor.' ), {\n\t\t\tid: `block-library/core/table-of-contents/redirection-prevented/${ instanceId }`,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t};\n\n\tconst canInsertList = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, canInsertBlockType } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\n\t\t\treturn canInsertBlockType( 'core/list', rootClientId );\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\tconst headingTree = linearToNestedHeadingList( headings );\n\n\tconst toolbarControls = canInsertList && (\n\t\t<BlockControls>\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\tcreateBlock( 'core/list', {\n\t\t\t\t\t\t\t\tordered: true,\n\t\t\t\t\t\t\t\tvalues: renderToString(\n\t\t\t\t\t\t\t\t\t<TableOfContentsList\n\t\t\t\t\t\t\t\t\t\tnestedHeadingList={ headingTree }\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>\n\t\t\t\t\t{ __( 'Convert to static list' ) }\n\t\t\t\t</ToolbarButton>\n\t\t\t</ToolbarGroup>\n\t\t</BlockControls>\n\t);\n\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\tresetAll={ () => {\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\tonlyIncludeCurrentPage: false,\n\t\t\t\t\t\tmaxLevel: undefined,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t>\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => !! onlyIncludeCurrentPage }\n\t\t\t\t\tlabel={ __( 'Only include current page' ) }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( { onlyIncludeCurrentPage: false } )\n\t\t\t\t\t}\n\t\t\t\t\tisShownByDefault\n\t\t\t\t>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tlabel={ __( 'Only include current page' ) }\n\t\t\t\t\t\tchecked={ onlyIncludeCurrentPage }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( { onlyIncludeCurrentPage: value } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\tonlyIncludeCurrentPage\n\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t'Only including headings from the current page (if the post is paginated).'\n\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\t'Include headings from all pages (if the post is paginated).'\n\t\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</ToolsPanelItem>\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => !! maxLevel }\n\t\t\t\t\tlabel={ __( 'Limit heading levels' ) }\n\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\tsetAttributes( { maxLevel: undefined } )\n\t\t\t\t\t}\n\t\t\t\t\tisShownByDefault\n\t\t\t\t>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tlabel={ __( 'Include headings down to level' ) }\n\t\t\t\t\t\tvalue={ maxLevel || '' }\n\t\t\t\t\t\toptions={ [\n\t\t\t\t\t\t\t{ value: '', label: __( 'All levels' ) },\n\t\t\t\t\t\t\t{ value: '1', label: __( 'Heading 1' ) },\n\t\t\t\t\t\t\t{ value: '2', label: __( 'Heading 2' ) },\n\t\t\t\t\t\t\t{ value: '3', label: __( 'Heading 3' ) },\n\t\t\t\t\t\t\t{ value: '4', label: __( 'Heading 4' ) },\n\t\t\t\t\t\t\t{ value: '5', label: __( 'Heading 5' ) },\n\t\t\t\t\t\t\t{ value: '6', label: __( 'Heading 6' ) },\n\t\t\t\t\t\t] }\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tmaxLevel: value ? parseInt( value ) : undefined,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\tmaxLevel\n\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t'Including all heading levels in the table of contents.'\n\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\t'Only include headings up to and including this level.'\n\t\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</ToolsPanelItem>\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n\n\t// If there are no headings or the only heading is empty.\n\t// Note that the toolbar controls are intentionally omitted since the\n\t// \"Convert to static list\" option is useless to the placeholder state.\n\tif ( headings.length === 0 ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div { ...blockProps }>\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\t\tlabel={ __( 'Table of Contents' ) }\n\t\t\t\t\t\tinstructions={ __(\n\t\t\t\t\t\t\t'Start adding Heading blocks to create a table of contents. Headings with HTML anchors will be linked here.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{ inspectorControls }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<nav { ...blockProps }>\n\t\t\t\t<ol>\n\t\t\t\t\t<TableOfContentsList\n\t\t\t\t\t\tnestedHeadingList={ headingTree }\n\t\t\t\t\t\tdisableLinkActivation\n\t\t\t\t\t\tonClick={ showRedirectionPreventedNotice }\n\t\t\t\t\t/>\n\t\t\t\t</ol>\n\t\t\t</nav>\n\t\t\t{ toolbarControls }\n\t\t\t{ inspectorControls }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAOA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA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/C,WAAA,CAAAkF,WAAW;UACXC,IAAI,eAAG,IAAAvE,WAAA,CAAAmC,GAAA,EAAClD,YAAA,CAAAuF,SAAS;YAACD,IAAI,EAAGA;UAAM,CAAE,CAAG;UACpCpB,KAAK,EAAG,IAAAhC,QAAE,EAAE,mBAAoB,CAAG;UACnCsD,YAAY,EAAG,IAAAtD,QAAE,EAChB,4GACD;QAAG,CACH;MAAC,CACE,CAAC,EACJ4B,iBAAiB;IAAA,CAClB,CAAC;EAEL;EAEA,oBACC,IAAA/C,WAAA,CAAAiD,IAAA,EAAAjD,WAAA,CAAAqE,QAAA;IAAAhC,QAAA,gBACC,IAAArC,WAAA,CAAAmC,GAAA;MAAA,GAAU1B,UAAU;MAAA4B,QAAA,eACnB,IAAArC,WAAA,CAAAmC,GAAA;QAAAE,QAAA,eACC,IAAArC,WAAA,CAAAmC,GAAA,EAACxC,KAAA,CAAAkD,OAAmB;UACnBC,iBAAiB,EAAGd,WAAa;UACjC0C,qBAAqB;UACrBlC,OAAO,EAAGxB;QAAgC,CAC1C;MAAC,CACC;IAAC,CACD,CAAC,EACJkB,eAAe,EACfa,iBAAiB;EAAA,CAClB,CAAC;AAEL","ignoreList":[]}
@@ -37,7 +37,8 @@ function getLatestHeadings(select, clientId) {
37
37
  const permalink = (_select$getPermalink = select('core/editor').getPermalink()) !== null && _select$getPermalink !== void 0 ? _select$getPermalink : null;
38
38
  const isPaginated = getBlocksByName('core/nextpage').length !== 0;
39
39
  const {
40
- onlyIncludeCurrentPage
40
+ onlyIncludeCurrentPage,
41
+ maxLevel
41
42
  } = (_getBlockAttributes = getBlockAttributes(clientId)) !== null && _getBlockAttributes !== void 0 ? _getBlockAttributes : {};
42
43
 
43
44
  // Get post-content block client ID.
@@ -99,6 +100,11 @@ function getLatestHeadings(select, clientId) {
99
100
  else if (!onlyIncludeCurrentPage || headingPage === tocPage) {
100
101
  if (blockName === 'core/heading') {
101
102
  const headingAttributes = getBlockAttributes(blockClientId);
103
+
104
+ // Skip headings that are deeper than maxLevel
105
+ if (maxLevel && headingAttributes.level > maxLevel) {
106
+ continue;
107
+ }
102
108
  const canBeLinked = typeof headingPageLink === 'string' && typeof headingAttributes.anchor === 'string' && headingAttributes.anchor !== '';
103
109
  latestHeadings.push({
104
110
  // Convert line breaks to spaces, and get rid of HTML tags in the headings.