@wordpress/block-library 7.3.1 → 7.3.2

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 (43) hide show
  1. package/build/audio/edit.js +1 -1
  2. package/build/audio/edit.js.map +1 -1
  3. package/build/comment-template/edit.js +3 -1
  4. package/build/comment-template/edit.js.map +1 -1
  5. package/build/comment-template/hooks.js +3 -1
  6. package/build/comment-template/hooks.js.map +1 -1
  7. package/build/cover/transforms.js +33 -32
  8. package/build/cover/transforms.js.map +1 -1
  9. package/build/index.js +2 -2
  10. package/build/index.js.map +1 -1
  11. package/build/list/index.js +13 -2
  12. package/build/list/index.js.map +1 -1
  13. package/build/post-featured-image/edit.js +19 -7
  14. package/build/post-featured-image/edit.js.map +1 -1
  15. package/build/quote/index.js +13 -2
  16. package/build/quote/index.js.map +1 -1
  17. package/build-module/audio/edit.js +1 -1
  18. package/build-module/audio/edit.js.map +1 -1
  19. package/build-module/comment-template/edit.js +3 -1
  20. package/build-module/comment-template/edit.js.map +1 -1
  21. package/build-module/comment-template/hooks.js +3 -1
  22. package/build-module/comment-template/hooks.js.map +1 -1
  23. package/build-module/cover/transforms.js +33 -32
  24. package/build-module/cover/transforms.js.map +1 -1
  25. package/build-module/index.js +2 -2
  26. package/build-module/index.js.map +1 -1
  27. package/build-module/list/index.js +9 -3
  28. package/build-module/list/index.js.map +1 -1
  29. package/build-module/post-featured-image/edit.js +19 -7
  30. package/build-module/post-featured-image/edit.js.map +1 -1
  31. package/build-module/quote/index.js +9 -3
  32. package/build-module/quote/index.js.map +1 -1
  33. package/package.json +28 -28
  34. package/src/audio/edit.js +1 -1
  35. package/src/comment-template/edit.js +5 -2
  36. package/src/comment-template/hooks.js +2 -1
  37. package/src/comment-template/index.php +14 -2
  38. package/src/cover/transforms.js +51 -28
  39. package/src/index.js +4 -1
  40. package/src/list/index.js +7 -3
  41. package/src/post-comments-form/index.php +12 -4
  42. package/src/post-featured-image/edit.js +24 -12
  43. package/src/quote/index.js +7 -3
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/index.js"],"names":["registerBlockType","setDefaultBlockName","setFreeformContentHandlerName","setUnregisteredTypeHandlerName","setGroupingBlockName","archives","avatar","audio","button","buttons","calendar","categories","classic","code","column","columns","commentAuthorAvatar","commentAuthorName","commentContent","commentDate","commentEditLink","commentReplyLink","commentTemplate","commentsPaginationPrevious","commentsQueryLoop","commentsPagination","commentsPaginationNext","commentsPaginationNumbers","cover","embed","file","gallery","group","heading","homeLink","html","image","latestComments","latestPosts","list","listItem","logInOut","mediaText","missing","more","navigation","navigationArea","navigationLink","navigationSubmenu","nextpage","pattern","pageList","paragraph","postAuthor","postAuthorName","postAuthorBiography","postComment","postComments","postCommentsCount","postCommentsForm","postCommentsLink","postContent","postDate","postExcerpt","postFeaturedImage","postNavigationLink","postTemplate","postTerms","postTitle","preformatted","pullquote","query","queryNoResults","queryPagination","queryPaginationNext","queryPaginationNumbers","queryPaginationPrevious","queryTitle","quote","reusableBlock","readMore","rss","search","separator","shortcode","siteLogo","siteTagline","siteTitle","socialLink","socialLinks","spacer","table","tagCloud","templatePart","termDescription","textColumns","verse","video","registerBlock","block","metadata","settings","name","__experimentalGetCoreBlocks","window","wp","oldEditor","registerCoreBlocks","blocks","forEach","__experimentalRegisterExperimentalCoreBlocks","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","undefined"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,iBADD,EAECC,mBAFD,EAGCC,6BAHD,EAICC,8BAJD,EAKCC,oBALD,QAMO,mBANP;AAQA;AACA;AACA;;AACA,OAAO,KAAKC,QAAZ,MAA0B,YAA1B;AACA,OAAO,KAAKC,MAAZ,MAAwB,UAAxB;AACA,OAAO,KAAKC,KAAZ,MAAuB,SAAvB;AACA,OAAO,KAAKC,MAAZ,MAAwB,UAAxB;AACA,OAAO,KAAKC,OAAZ,MAAyB,WAAzB;AACA,OAAO,KAAKC,QAAZ,MAA0B,YA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,4CAA4C,GAAGC,OAAO,CAACC,GAAR,CAC1DC,mBAD0D,GAEzD,YAAgC;AAAA,MAA9B;AAAEC,IAAAA;AAAF,GAA8B,uEAAR,EAAQ;AAChC,GACC;AACA5D,EAAAA,cAFD,EAGC;AACA,MAAK4D,eAAe,GACjB,CACAlG,mBADA,EAEA8B,cAFA,EAGAU,WAHA,EAIAE,iBAJA,EAKAC,gBALA,EAMAC,gBANA,CADiB,GASjB,EATH,CAJD,EAcEiD,OAdF,CAcWX,aAdX;AAeC,CAlBwD,GAmBzDiB,SAnBI","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tregisterBlockType,\n\tsetDefaultBlockName,\n\tsetFreeformContentHandlerName,\n\tsetUnregisteredTypeHandlerName,\n\tsetGroupingBlockName,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport * as archives from './archives';\nimport * as avatar from './avatar';\nimport * as audio from './audio';\nimport * as button from './button';\nimport * as buttons from './buttons';\nimport * as calendar from './calendar';\nimport * as categories from './categories';\nimport * as classic from './freeform';\nimport * as code from './code';\nimport * as column from './column';\nimport * as columns from './columns';\nimport * as commentAuthorAvatar from './comment-author-avatar';\nimport * as commentAuthorName from './comment-author-name';\nimport * as commentContent from './comment-content';\nimport * as commentDate from './comment-date';\nimport * as commentEditLink from './comment-edit-link';\nimport * as commentReplyLink from './comment-reply-link';\nimport * as commentTemplate from './comment-template';\nimport * as commentsPaginationPrevious from './comments-pagination-previous';\nimport * as commentsQueryLoop from './comments-query-loop';\nimport * as commentsPagination from './comments-pagination';\nimport * as commentsPaginationNext from './comments-pagination-next';\nimport * as commentsPaginationNumbers from './comments-pagination-numbers';\nimport * as cover from './cover';\nimport * as embed from './embed';\nimport * as file from './file';\nimport * as gallery from './gallery';\nimport * as group from './group';\nimport * as heading from './heading';\nimport * as homeLink from './home-link';\nimport * as html from './html';\nimport * as image from './image';\nimport * as latestComments from './latest-comments';\nimport * as latestPosts from './latest-posts';\nimport * as list from './list';\nimport * as listItem from './list-item';\nimport * as logInOut from './loginout';\nimport * as mediaText from './media-text';\nimport * as missing from './missing';\nimport * as more from './more';\nimport * as navigation from './navigation';\nimport * as navigationArea from './navigation-area';\nimport * as navigationLink from './navigation-link';\nimport * as navigationSubmenu from './navigation-submenu';\nimport * as nextpage from './nextpage';\nimport * as pattern from './pattern';\nimport * as pageList from './page-list';\nimport * as paragraph from './paragraph';\nimport * as postAuthor from './post-author';\nimport * as postAuthorName from './post-author-name';\nimport * as postAuthorBiography from './post-author-biography';\nimport * as postComment from './post-comment';\nimport * as postComments from './post-comments';\nimport * as postCommentsCount from './post-comments-count';\nimport * as postCommentsForm from './post-comments-form';\nimport * as postCommentsLink from './post-comments-link';\nimport * as postContent from './post-content';\nimport * as postDate from './post-date';\nimport * as postExcerpt from './post-excerpt';\nimport * as postFeaturedImage from './post-featured-image';\nimport * as postNavigationLink from './post-navigation-link';\nimport * as postTemplate from './post-template';\nimport * as postTerms from './post-terms';\nimport * as postTitle from './post-title';\nimport * as preformatted from './preformatted';\nimport * as pullquote from './pullquote';\nimport * as query from './query';\nimport * as queryNoResults from './query-no-results';\nimport * as queryPagination from './query-pagination';\nimport * as queryPaginationNext from './query-pagination-next';\nimport * as queryPaginationNumbers from './query-pagination-numbers';\nimport * as queryPaginationPrevious from './query-pagination-previous';\nimport * as queryTitle from './query-title';\nimport * as quote from './quote';\nimport * as reusableBlock from './block';\nimport * as readMore from './read-more';\nimport * as rss from './rss';\nimport * as search from './search';\nimport * as separator from './separator';\nimport * as shortcode from './shortcode';\nimport * as siteLogo from './site-logo';\nimport * as siteTagline from './site-tagline';\nimport * as siteTitle from './site-title';\nimport * as socialLink from './social-link';\nimport * as socialLinks from './social-links';\nimport * as spacer from './spacer';\nimport * as table from './table';\nimport * as tagCloud from './tag-cloud';\nimport * as templatePart from './template-part';\nimport * as termDescription from './term-description';\nimport * as textColumns from './text-columns';\nimport * as verse from './verse';\nimport * as video from './video';\n\n/**\n * Function to register an individual block.\n *\n * @param {Object} block The block to be registered.\n *\n */\nconst registerBlock = ( block ) => {\n\tif ( ! block ) {\n\t\treturn;\n\t}\n\tconst { metadata, settings, name } = block;\n\tregisterBlockType( { name, ...metadata }, settings );\n};\n\n/**\n * Function to get all the core blocks in an array.\n *\n * @example\n * ```js\n * import { __experimentalGetCoreBlocks } from '@wordpress/block-library';\n *\n * const coreBlocks = __experimentalGetCoreBlocks();\n * ```\n */\nexport const __experimentalGetCoreBlocks = () => [\n\t// Common blocks are grouped at the top to prioritize their display\n\t// in various contexts — like the inserter and auto-complete components.\n\tparagraph,\n\timage,\n\theading,\n\tgallery,\n\tlist,\n\tlistItem,\n\tquote,\n\n\t// Register all remaining core blocks.\n\tarchives,\n\taudio,\n\tbutton,\n\tbuttons,\n\tcalendar,\n\tcategories,\n\twindow.wp && window.wp.oldEditor ? classic : null, // Only add the classic block in WP Context.\n\tcode,\n\tcolumn,\n\tcolumns,\n\tcover,\n\tembed,\n\tfile,\n\tgroup,\n\thtml,\n\tlatestComments,\n\tlatestPosts,\n\tmediaText,\n\tmissing,\n\tmore,\n\tnextpage,\n\tpageList,\n\tpattern,\n\tpreformatted,\n\tpullquote,\n\treusableBlock,\n\trss,\n\tsearch,\n\tseparator,\n\tshortcode,\n\tsocialLink,\n\tsocialLinks,\n\tspacer,\n\ttable,\n\t// tableOfContents,\n\ttagCloud,\n\ttextColumns,\n\tverse,\n\tvideo,\n\n\t// theme blocks\n\tnavigation,\n\tnavigationLink,\n\tnavigationSubmenu,\n\tsiteLogo,\n\tsiteTitle,\n\tsiteTagline,\n\tquery,\n\ttemplatePart,\n\tavatar,\n\tpostTitle,\n\tpostExcerpt,\n\tpostFeaturedImage,\n\tpostContent,\n\tpostAuthor,\n\tpostDate,\n\tpostTerms,\n\tpostNavigationLink,\n\tpostTemplate,\n\tqueryPagination,\n\tqueryPaginationNext,\n\tqueryPaginationNumbers,\n\tqueryPaginationPrevious,\n\tqueryNoResults,\n\treadMore,\n\tcommentAuthorName,\n\tcommentContent,\n\tcommentDate,\n\tcommentEditLink,\n\tcommentReplyLink,\n\tcommentTemplate,\n\tcommentsQueryLoop,\n\tcommentsPagination,\n\tcommentsPaginationNext,\n\tcommentsPaginationNumbers,\n\tcommentsPaginationPrevious,\n\tpostComments,\n\thomeLink,\n\tlogInOut,\n\ttermDescription,\n\tqueryTitle,\n\tpostAuthorBiography,\n];\n\n/**\n * Function to register core blocks provided by the block editor.\n *\n * @param {Array} blocks An optional array of the core blocks being registered.\n *\n * @example\n * ```js\n * import { registerCoreBlocks } from '@wordpress/block-library';\n *\n * registerCoreBlocks();\n * ```\n */\nexport const registerCoreBlocks = (\n\tblocks = __experimentalGetCoreBlocks()\n) => {\n\tblocks.forEach( registerBlock );\n\n\tsetDefaultBlockName( paragraph.name );\n\tif ( window.wp && window.wp.oldEditor ) {\n\t\tsetFreeformContentHandlerName( classic.name );\n\t}\n\tsetUnregisteredTypeHandlerName( missing.name );\n\tsetGroupingBlockName( group.name );\n};\n\n/**\n * Function to register experimental core blocks depending on editor settings.\n *\n * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.\n * @example\n * ```js\n * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';\n *\n * __experimentalRegisterExperimentalCoreBlocks( settings );\n * ```\n */\nexport const __experimentalRegisterExperimentalCoreBlocks = process.env\n\t.IS_GUTENBERG_PLUGIN\n\t? ( { enableFSEBlocks } = {} ) => {\n\t\t\t[\n\t\t\t\t// Experimental blocks.\n\t\t\t\tpostAuthorName,\n\t\t\t\t// Full Site Editing blocks.\n\t\t\t\t...( enableFSEBlocks\n\t\t\t\t\t? [\n\t\t\t\t\t\t\tcommentAuthorAvatar,\n\t\t\t\t\t\t\tnavigationArea,\n\t\t\t\t\t\t\tpostComment,\n\t\t\t\t\t\t\tpostCommentsCount,\n\t\t\t\t\t\t\tpostCommentsForm,\n\t\t\t\t\t\t\tpostCommentsLink,\n\t\t\t\t\t ]\n\t\t\t\t\t: [] ),\n\t\t\t].forEach( registerBlock );\n\t }\n\t: undefined;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/index.js"],"names":["registerBlockType","setDefaultBlockName","setFreeformContentHandlerName","setUnregisteredTypeHandlerName","setGroupingBlockName","archives","avatar","audio","button","buttons","calendar","categories","classic","code","column","columns","commentAuthorAvatar","commentAuthorName","commentContent","commentDate","commentEditLink","commentReplyLink","commentTemplate","commentsPaginationPrevious","commentsQueryLoop","commentsPagination","commentsPaginationNext","commentsPaginationNumbers","cover","embed","file","gallery","group","heading","homeLink","html","image","latestComments","latestPosts","list","listItem","logInOut","mediaText","missing","more","navigation","navigationArea","navigationLink","navigationSubmenu","nextpage","pattern","pageList","paragraph","postAuthor","postAuthorName","postAuthorBiography","postComment","postComments","postCommentsCount","postCommentsForm","postCommentsLink","postContent","postDate","postExcerpt","postFeaturedImage","postNavigationLink","postTemplate","postTerms","postTitle","preformatted","pullquote","query","queryNoResults","queryPagination","queryPaginationNext","queryPaginationNumbers","queryPaginationPrevious","queryTitle","quote","reusableBlock","readMore","rss","search","separator","shortcode","siteLogo","siteTagline","siteTitle","socialLink","socialLinks","spacer","table","tagCloud","templatePart","termDescription","textColumns","verse","video","registerBlock","block","metadata","settings","name","__experimentalGetCoreBlocks","window","wp","oldEditor","registerCoreBlocks","blocks","forEach","__experimentalRegisterExperimentalCoreBlocks","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","__experimentalEnableListBlockV2","undefined"],"mappings":"AAAA;AACA;AACA;AACA,SACCA,iBADD,EAECC,mBAFD,EAGCC,6BAHD,EAICC,8BAJD,EAKCC,oBALD,QAMO,mBANP;AAQA;AACA;AACA;;AACA,OAAO,KAAKC,QAAZ,MAA0B,YAA1B;AACA,OAAO,KAAKC,MAAZ,MAAwB,UAAxB;AACA,OAAO,KAAKC,KAAZ,MAAuB,SAAvB;AACA,OAAO,KAAKC,MAAZ,MAAwB,UAAxB;AACA,OAAO,KAAKC,OAAZ,MAAyB,WAAzB;AACA,OAAO,KAAKC,QAAZ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A4C,GAAGC,OAAO,CAACC,GAAR,CAC1DC,mBAD0D,GAEzD,YAAgC;AAAA,MAA9B;AAAEC,IAAAA;AAAF,GAA8B,uEAAR,EAAQ;AAChC,GACC;AACA5D,EAAAA,cAFD,EAGC,IAAKkD,MAAM,CAACW,+BAAP,GACF,CAAE3E,QAAF,CADE,GAEF,EAFH,CAHD,EAOC;AACA,MAAK0E,eAAe,GACjB,CACAlG,mBADA,EAEA8B,cAFA,EAGAU,WAHA,EAIAE,iBAJA,EAKAC,gBALA,EAMAC,gBANA,CADiB,GASjB,EATH,CARD,EAkBEiD,OAlBF,CAkBWX,aAlBX;AAmBC,CAtBwD,GAuBzDkB,SAvBI","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tregisterBlockType,\n\tsetDefaultBlockName,\n\tsetFreeformContentHandlerName,\n\tsetUnregisteredTypeHandlerName,\n\tsetGroupingBlockName,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport * as archives from './archives';\nimport * as avatar from './avatar';\nimport * as audio from './audio';\nimport * as button from './button';\nimport * as buttons from './buttons';\nimport * as calendar from './calendar';\nimport * as categories from './categories';\nimport * as classic from './freeform';\nimport * as code from './code';\nimport * as column from './column';\nimport * as columns from './columns';\nimport * as commentAuthorAvatar from './comment-author-avatar';\nimport * as commentAuthorName from './comment-author-name';\nimport * as commentContent from './comment-content';\nimport * as commentDate from './comment-date';\nimport * as commentEditLink from './comment-edit-link';\nimport * as commentReplyLink from './comment-reply-link';\nimport * as commentTemplate from './comment-template';\nimport * as commentsPaginationPrevious from './comments-pagination-previous';\nimport * as commentsQueryLoop from './comments-query-loop';\nimport * as commentsPagination from './comments-pagination';\nimport * as commentsPaginationNext from './comments-pagination-next';\nimport * as commentsPaginationNumbers from './comments-pagination-numbers';\nimport * as cover from './cover';\nimport * as embed from './embed';\nimport * as file from './file';\nimport * as gallery from './gallery';\nimport * as group from './group';\nimport * as heading from './heading';\nimport * as homeLink from './home-link';\nimport * as html from './html';\nimport * as image from './image';\nimport * as latestComments from './latest-comments';\nimport * as latestPosts from './latest-posts';\nimport * as list from './list';\nimport * as listItem from './list-item';\nimport * as logInOut from './loginout';\nimport * as mediaText from './media-text';\nimport * as missing from './missing';\nimport * as more from './more';\nimport * as navigation from './navigation';\nimport * as navigationArea from './navigation-area';\nimport * as navigationLink from './navigation-link';\nimport * as navigationSubmenu from './navigation-submenu';\nimport * as nextpage from './nextpage';\nimport * as pattern from './pattern';\nimport * as pageList from './page-list';\nimport * as paragraph from './paragraph';\nimport * as postAuthor from './post-author';\nimport * as postAuthorName from './post-author-name';\nimport * as postAuthorBiography from './post-author-biography';\nimport * as postComment from './post-comment';\nimport * as postComments from './post-comments';\nimport * as postCommentsCount from './post-comments-count';\nimport * as postCommentsForm from './post-comments-form';\nimport * as postCommentsLink from './post-comments-link';\nimport * as postContent from './post-content';\nimport * as postDate from './post-date';\nimport * as postExcerpt from './post-excerpt';\nimport * as postFeaturedImage from './post-featured-image';\nimport * as postNavigationLink from './post-navigation-link';\nimport * as postTemplate from './post-template';\nimport * as postTerms from './post-terms';\nimport * as postTitle from './post-title';\nimport * as preformatted from './preformatted';\nimport * as pullquote from './pullquote';\nimport * as query from './query';\nimport * as queryNoResults from './query-no-results';\nimport * as queryPagination from './query-pagination';\nimport * as queryPaginationNext from './query-pagination-next';\nimport * as queryPaginationNumbers from './query-pagination-numbers';\nimport * as queryPaginationPrevious from './query-pagination-previous';\nimport * as queryTitle from './query-title';\nimport * as quote from './quote';\nimport * as reusableBlock from './block';\nimport * as readMore from './read-more';\nimport * as rss from './rss';\nimport * as search from './search';\nimport * as separator from './separator';\nimport * as shortcode from './shortcode';\nimport * as siteLogo from './site-logo';\nimport * as siteTagline from './site-tagline';\nimport * as siteTitle from './site-title';\nimport * as socialLink from './social-link';\nimport * as socialLinks from './social-links';\nimport * as spacer from './spacer';\nimport * as table from './table';\nimport * as tagCloud from './tag-cloud';\nimport * as templatePart from './template-part';\nimport * as termDescription from './term-description';\nimport * as textColumns from './text-columns';\nimport * as verse from './verse';\nimport * as video from './video';\n\n/**\n * Function to register an individual block.\n *\n * @param {Object} block The block to be registered.\n *\n */\nconst registerBlock = ( block ) => {\n\tif ( ! block ) {\n\t\treturn;\n\t}\n\tconst { metadata, settings, name } = block;\n\tregisterBlockType( { name, ...metadata }, settings );\n};\n\n/**\n * Function to get all the core blocks in an array.\n *\n * @example\n * ```js\n * import { __experimentalGetCoreBlocks } from '@wordpress/block-library';\n *\n * const coreBlocks = __experimentalGetCoreBlocks();\n * ```\n */\nexport const __experimentalGetCoreBlocks = () => [\n\t// Common blocks are grouped at the top to prioritize their display\n\t// in various contexts — like the inserter and auto-complete components.\n\tparagraph,\n\timage,\n\theading,\n\tgallery,\n\tlist,\n\tquote,\n\n\t// Register all remaining core blocks.\n\tarchives,\n\taudio,\n\tbutton,\n\tbuttons,\n\tcalendar,\n\tcategories,\n\twindow.wp && window.wp.oldEditor ? classic : null, // Only add the classic block in WP Context.\n\tcode,\n\tcolumn,\n\tcolumns,\n\tcover,\n\tembed,\n\tfile,\n\tgroup,\n\thtml,\n\tlatestComments,\n\tlatestPosts,\n\tmediaText,\n\tmissing,\n\tmore,\n\tnextpage,\n\tpageList,\n\tpattern,\n\tpreformatted,\n\tpullquote,\n\treusableBlock,\n\trss,\n\tsearch,\n\tseparator,\n\tshortcode,\n\tsocialLink,\n\tsocialLinks,\n\tspacer,\n\ttable,\n\t// tableOfContents,\n\ttagCloud,\n\ttextColumns,\n\tverse,\n\tvideo,\n\n\t// theme blocks\n\tnavigation,\n\tnavigationLink,\n\tnavigationSubmenu,\n\tsiteLogo,\n\tsiteTitle,\n\tsiteTagline,\n\tquery,\n\ttemplatePart,\n\tavatar,\n\tpostTitle,\n\tpostExcerpt,\n\tpostFeaturedImage,\n\tpostContent,\n\tpostAuthor,\n\tpostDate,\n\tpostTerms,\n\tpostNavigationLink,\n\tpostTemplate,\n\tqueryPagination,\n\tqueryPaginationNext,\n\tqueryPaginationNumbers,\n\tqueryPaginationPrevious,\n\tqueryNoResults,\n\treadMore,\n\tcommentAuthorName,\n\tcommentContent,\n\tcommentDate,\n\tcommentEditLink,\n\tcommentReplyLink,\n\tcommentTemplate,\n\tcommentsQueryLoop,\n\tcommentsPagination,\n\tcommentsPaginationNext,\n\tcommentsPaginationNumbers,\n\tcommentsPaginationPrevious,\n\tpostComments,\n\thomeLink,\n\tlogInOut,\n\ttermDescription,\n\tqueryTitle,\n\tpostAuthorBiography,\n];\n\n/**\n * Function to register core blocks provided by the block editor.\n *\n * @param {Array} blocks An optional array of the core blocks being registered.\n *\n * @example\n * ```js\n * import { registerCoreBlocks } from '@wordpress/block-library';\n *\n * registerCoreBlocks();\n * ```\n */\nexport const registerCoreBlocks = (\n\tblocks = __experimentalGetCoreBlocks()\n) => {\n\tblocks.forEach( registerBlock );\n\n\tsetDefaultBlockName( paragraph.name );\n\tif ( window.wp && window.wp.oldEditor ) {\n\t\tsetFreeformContentHandlerName( classic.name );\n\t}\n\tsetUnregisteredTypeHandlerName( missing.name );\n\tsetGroupingBlockName( group.name );\n};\n\n/**\n * Function to register experimental core blocks depending on editor settings.\n *\n * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.\n * @example\n * ```js\n * import { __experimentalRegisterExperimentalCoreBlocks } from '@wordpress/block-library';\n *\n * __experimentalRegisterExperimentalCoreBlocks( settings );\n * ```\n */\nexport const __experimentalRegisterExperimentalCoreBlocks = process.env\n\t.IS_GUTENBERG_PLUGIN\n\t? ( { enableFSEBlocks } = {} ) => {\n\t\t\t[\n\t\t\t\t// Experimental blocks.\n\t\t\t\tpostAuthorName,\n\t\t\t\t...( window.__experimentalEnableListBlockV2\n\t\t\t\t\t? [ listItem ]\n\t\t\t\t\t: [] ),\n\n\t\t\t\t// Full Site Editing blocks.\n\t\t\t\t...( enableFSEBlocks\n\t\t\t\t\t? [\n\t\t\t\t\t\t\tcommentAuthorAvatar,\n\t\t\t\t\t\t\tnavigationArea,\n\t\t\t\t\t\t\tpostComment,\n\t\t\t\t\t\t\tpostCommentsCount,\n\t\t\t\t\t\t\tpostCommentsForm,\n\t\t\t\t\t\t\tpostCommentsLink,\n\t\t\t\t\t ]\n\t\t\t\t\t: [] ),\n\t\t\t].forEach( registerBlock );\n\t }\n\t: undefined;\n"]}
@@ -1,5 +1,3 @@
1
- var _window;
2
-
3
1
  /**
4
2
  * WordPress dependencies
5
3
  */
@@ -111,5 +109,13 @@ const settingsV1 = {
111
109
  save,
112
110
  deprecated
113
111
  };
114
- export const settings = (_window = window) !== null && _window !== void 0 && _window.__experimentalEnableListBlockV2 ? settingsV2 : settingsV1;
112
+ let settings = settingsV1;
113
+
114
+ if (process.env.IS_GUTENBERG_PLUGIN) {
115
+ var _window;
116
+
117
+ settings = (_window = window) !== null && _window !== void 0 && _window.__experimentalEnableListBlockV2 ? settingsV2 : settingsV1;
118
+ }
119
+
120
+ export { settings };
115
121
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/list/index.js"],"names":["list","icon","deprecated","edit","save","transforms","settingsV2","name","metadata","settingsV1","example","attributes","values","merge","attributesToMerge","settings","window","__experimentalEnableListBlockV2"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAI,IAAIC,IAAjB,QAA6B,kBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,IAAP,MAAiB,QAAjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,UAAP,MAAuB,MAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AAEA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,MAAME,UAAU,GAAG;AAClBR,EAAAA,IADkB;AAElBS,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,MAAM,EACL;AAFU;AADJ,GAFS;AAQlBP,EAAAA,UARkB;;AASlBQ,EAAAA,KAAK,CAAEF,UAAF,EAAcG,iBAAd,EAAkC;AACtC,UAAM;AAAEF,MAAAA;AAAF,QAAaE,iBAAnB;;AAEA,QAAK,CAAEF,MAAF,IAAYA,MAAM,KAAK,WAA5B,EAA0C;AACzC,aAAOD,UAAP;AACA;;AAED,WAAO,EACN,GAAGA,UADG;AAENC,MAAAA,MAAM,EAAED,UAAU,CAACC,MAAX,GAAoBA;AAFtB,KAAP;AAIA,GApBiB;;AAqBlBT,EAAAA,IArBkB;AAsBlBC,EAAAA,IAtBkB;AAuBlBF,EAAAA;AAvBkB,CAAnB;AA0BA,OAAO,MAAMa,QAAQ,GAAG,WAAAC,MAAM,UAAN,kCAAQC,+BAAR,GACrBX,UADqB,GAErBG,UAFI","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { list as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport settingsV2 from './v2';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nconst settingsV1 = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tvalues:\n\t\t\t\t'<li>Alice.</li><li>The White Rabbit.</li><li>The Cheshire Cat.</li><li>The Mad Hatter.</li><li>The Queen of Hearts.</li>',\n\t\t},\n\t},\n\ttransforms,\n\tmerge( attributes, attributesToMerge ) {\n\t\tconst { values } = attributesToMerge;\n\n\t\tif ( ! values || values === '<li></li>' ) {\n\t\t\treturn attributes;\n\t\t}\n\n\t\treturn {\n\t\t\t...attributes,\n\t\t\tvalues: attributes.values + values,\n\t\t};\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const settings = window?.__experimentalEnableListBlockV2\n\t? settingsV2\n\t: settingsV1;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/list/index.js"],"names":["list","icon","deprecated","edit","save","transforms","settingsV2","name","metadata","settingsV1","example","attributes","values","merge","attributesToMerge","settings","process","env","IS_GUTENBERG_PLUGIN","window","__experimentalEnableListBlockV2"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,IAAI,IAAIC,IAAjB,QAA6B,kBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,IAAP,MAAiB,QAAjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,UAAP,MAAuB,MAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AAEA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,MAAME,UAAU,GAAG;AAClBR,EAAAA,IADkB;AAElBS,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,MAAM,EACL;AAFU;AADJ,GAFS;AAQlBP,EAAAA,UARkB;;AASlBQ,EAAAA,KAAK,CAAEF,UAAF,EAAcG,iBAAd,EAAkC;AACtC,UAAM;AAAEF,MAAAA;AAAF,QAAaE,iBAAnB;;AAEA,QAAK,CAAEF,MAAF,IAAYA,MAAM,KAAK,WAA5B,EAA0C;AACzC,aAAOD,UAAP;AACA;;AAED,WAAO,EACN,GAAGA,UADG;AAENC,MAAAA,MAAM,EAAED,UAAU,CAACC,MAAX,GAAoBA;AAFtB,KAAP;AAIA,GApBiB;;AAqBlBT,EAAAA,IArBkB;AAsBlBC,EAAAA,IAtBkB;AAuBlBF,EAAAA;AAvBkB,CAAnB;AA0BA,IAAIa,QAAQ,GAAGN,UAAf;;AACA,IAAKO,OAAO,CAACC,GAAR,CAAYC,mBAAjB,EAAuC;AAAA;;AACtCH,EAAAA,QAAQ,GAAG,WAAAI,MAAM,UAAN,kCAAQC,+BAAR,GACRd,UADQ,GAERG,UAFH;AAGA;;AACD,SAASM,QAAT","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { list as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport settingsV2 from './v2';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nconst settingsV1 = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tvalues:\n\t\t\t\t'<li>Alice.</li><li>The White Rabbit.</li><li>The Cheshire Cat.</li><li>The Mad Hatter.</li><li>The Queen of Hearts.</li>',\n\t\t},\n\t},\n\ttransforms,\n\tmerge( attributes, attributesToMerge ) {\n\t\tconst { values } = attributesToMerge;\n\n\t\tif ( ! values || values === '<li></li>' ) {\n\t\t\treturn attributes;\n\t\t}\n\n\t\treturn {\n\t\t\t...attributes,\n\t\t\tvalues: attributes.values + values,\n\t\t};\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nlet settings = settingsV1;\nif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\tsettings = window?.__experimentalEnableListBlockV2\n\t\t? settingsV2\n\t\t: settingsV1;\n}\nexport { settings };\n"]}
@@ -44,7 +44,7 @@ function PostFeaturedImageDisplay(_ref) {
44
44
  setAttributes,
45
45
  context: {
46
46
  postId,
47
- postType,
47
+ postType: postTypeSlug,
48
48
  queryId
49
49
  }
50
50
  } = _ref;
@@ -56,10 +56,22 @@ function PostFeaturedImageDisplay(_ref) {
56
56
  scale,
57
57
  sizeSlug
58
58
  } = attributes;
59
- const [featuredImage, setFeaturedImage] = useEntityProp('postType', postType, 'featured_media', postId);
60
- const media = useSelect(select => featuredImage && select(coreStore).getMedia(featuredImage, {
61
- context: 'view'
62
- }), [featuredImage]);
59
+ const [featuredImage, setFeaturedImage] = useEntityProp('postType', postTypeSlug, 'featured_media', postId);
60
+ const {
61
+ media,
62
+ postType
63
+ } = useSelect(select => {
64
+ const {
65
+ getMedia,
66
+ getPostType
67
+ } = select(coreStore);
68
+ return {
69
+ media: featuredImage && getMedia(featuredImage, {
70
+ context: 'view'
71
+ }),
72
+ postType: postTypeSlug && getPostType(postTypeSlug)
73
+ };
74
+ }, [featuredImage, postTypeSlug]);
63
75
  const mediaUrl = getMediaSourceUrlBySizeSlug(media, sizeSlug);
64
76
  const imageSizes = useSelect(select => select(blockEditorStore).getSettings().imageSizes, []);
65
77
  const imageSizeOptions = imageSizes.filter(_ref2 => {
@@ -116,8 +128,8 @@ function PostFeaturedImageDisplay(_ref) {
116
128
  }), createElement(InspectorControls, null, createElement(PanelBody, {
117
129
  title: __('Link settings')
118
130
  }, createElement(ToggleControl, {
119
- label: sprintf( // translators: %s: Name of the post type e.g: "post".
120
- __('Link to %s'), postType),
131
+ label: postType !== null && postType !== void 0 && postType.labels.singular_name ? sprintf( // translators: %s: Name of the post type e.g: "post".
132
+ __('Link to %s'), postType.labels.singular_name.toLowerCase()) : __('Link to post'),
121
133
  onChange: () => setAttributes({
122
134
  isLink: !isLink
123
135
  }),
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/post-featured-image/edit.js"],"names":["useEntityProp","store","coreStore","useSelect","useDispatch","MenuItem","ToggleControl","PanelBody","Placeholder","Button","InspectorControls","BlockControls","MediaPlaceholder","MediaReplaceFlow","useBlockProps","blockEditorStore","__","sprintf","upload","SVG","Path","noticesStore","DimensionControls","placeholderIllustration","ALLOWED_MEDIA_TYPES","placeholderChip","getMediaSourceUrlBySizeSlug","media","slug","media_details","sizes","source_url","PostFeaturedImageDisplay","clientId","attributes","setAttributes","context","postId","postType","queryId","isDescendentOfQueryLoop","Number","isFinite","isLink","height","width","scale","sizeSlug","featuredImage","setFeaturedImage","select","getMedia","mediaUrl","imageSizes","getSettings","imageSizeOptions","filter","map","name","value","label","blockProps","style","placeholder","content","onSelectImage","id","createErrorNotice","onUploadError","message","type","controls","image","open","alt_text","objectFit","PostFeatured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AAA,MAAF;AAAU+B,QAAAA,SAAS,EAAE/B,MAAM,IAAIE;AAA/B;AAXT,MAHD;AAiBA;;AAED,SACC,8BACGyB,QADH,EAEG,CAAC,CAAE5C,KAAH,IAAY,CAAEa,uBAAd,IACD,cAAC,aAAD;AAAe,IAAA,KAAK,EAAC;AAArB,KACC,cAAC,gBAAD;AACC,IAAA,OAAO,EAAGQ,aADX;AAEC,IAAA,QAAQ,EAAGI,QAFZ;AAGC,IAAA,YAAY,EAAG5B,mBAHhB;AAIC,IAAA,MAAM,EAAC,SAJR;AAKC,IAAA,QAAQ,EAAGyC,aALZ;AAMC,IAAA,OAAO,EAAGG;AANX,KAQC,cAAC,QAAD;AAAU,IAAA,OAAO,EAAG,MAAMnB,gBAAgB,CAAE,CAAF;AAA1C,KACGjC,EAAE,CAAE,OAAF,CADL,CARD,CADD,CAHF,EAkBC,wBAAa6C,UAAb,EAA4BW,KAA5B,CAlBD,CADD;AAsBA;;AAED,eAAe,SAASI,qBAAT,CAAgCC,KAAhC,EAAwC;AAAA;;AACtD,QAAMhB,UAAU,GAAG/C,aAAa,EAAhC;;AACA,MAAK,oBAAE+D,KAAK,CAACzC,OAAR,2CAAE,eAAeC,MAAjB,CAAL,EAA+B;AAC9B,WAAO,qBAAUwB,UAAV,EAAyBpC,eAAzB,CAAP;AACA;;AACD,SAAO,cAAC,wBAAD,EAA+BoD,KAA/B,CAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tMenuItem,\n\tToggleControl,\n\tPanelBody,\n\tPlaceholder,\n\tButton,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { upload } from '@wordpress/icons';\nimport { SVG, Path } from '@wordpress/primitives';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport DimensionControls from './dimension-controls';\n\nconst placeholderIllustration = (\n\t<SVG\n\t\tclassName=\"components-placeholder__illustration\"\n\t\tfill=\"none\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\tviewBox=\"0 0 60 60\"\n\t\tpreserveAspectRatio=\"none\"\n\t>\n\t\t<Path vectorEffect=\"non-scaling-stroke\" d=\"M60 60 0 0\" />\n\t</SVG>\n);\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\nconst placeholderChip = (\n\t<div className=\"wp-block-post-featured-image__placeholder\">\n\t\t{ placeholderIllustration }\n\t</div>\n);\n\nfunction getMediaSourceUrlBySizeSlug( media, slug ) {\n\treturn (\n\t\tmedia?.media_details?.sizes?.[ slug ]?.source_url || media?.source_url\n\t);\n}\n\nfunction PostFeaturedImageDisplay( {\n\tclientId,\n\tattributes,\n\tsetAttributes,\n\tcontext: { postId, postType, queryId },\n} ) {\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst { isLink, height, width, scale, sizeSlug } = attributes;\n\tconst [ featuredImage, setFeaturedImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\n\tconst media = useSelect(\n\t\t( select ) =>\n\t\t\tfeaturedImage &&\n\t\t\tselect( coreStore ).getMedia( featuredImage, { context: 'view' } ),\n\t\t[ featuredImage ]\n\t);\n\tconst mediaUrl = getMediaSourceUrlBySizeSlug( media, sizeSlug );\n\n\tconst imageSizes = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings().imageSizes,\n\t\t[]\n\t);\n\tconst imageSizeOptions = imageSizes\n\t\t.filter( ( { slug } ) => {\n\t\t\treturn media?.media_details?.sizes?.[ slug ]?.source_url;\n\t\t} )\n\t\t.map( ( { name, slug } ) => ( {\n\t\t\tvalue: slug,\n\t\t\tlabel: name,\n\t\t} ) );\n\n\tconst blockProps = useBlockProps( {\n\t\tstyle: { width, height },\n\t} );\n\n\tconst placeholder = ( content ) => {\n\t\treturn (\n\t\t\t<Placeholder className=\"block-editor-media-placeholder\">\n\t\t\t\t{ placeholderIllustration }\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\t};\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message[ 2 ], { type: 'snackbar' } );\n\t};\n\n\tconst controls = (\n\t\t<>\n\t\t\t<DimensionControls\n\t\t\t\tclientId={ clientId }\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\timageSizeOptions={ imageSizeOptions }\n\t\t\t/>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ sprintf(\n\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__( 'Link to %s' ),\n\t\t\t\t\t\t\tpostType\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonChange={ () => setAttributes( { isLink: ! isLink } ) }\n\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\tlet image;\n\tif ( ! featuredImage && isDescendentOfQueryLoop ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ controls }\n\t\t\t\t<div { ...blockProps }>{ placeholderChip }</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst label = __( 'Add a featured image' );\n\n\tif ( ! featuredImage ) {\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\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 = ! media ? (\n\t\t\tplaceholderChip\n\t\t) : (\n\t\t\t<img\n\t\t\t\tsrc={ mediaUrl }\n\t\t\t\talt={\n\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: The image's alt text.\n\t\t\t\t\t\t\t\t__( 'Featured image: %s' ),\n\t\t\t\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Featured image' )\n\t\t\t\t}\n\t\t\t\tstyle={ { height, objectFit: height && scale } }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ 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>\n\t\t\t\t\t\t<MenuItem onClick={ () => setFeaturedImage( 0 ) }>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MediaReplaceFlow>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<figure { ...blockProps }>{ image }</figure>\n\t\t</>\n\t);\n}\n\nexport default function PostFeaturedImageEdit( props ) {\n\tconst blockProps = useBlockProps();\n\tif ( ! props.context?.postId ) {\n\t\treturn <div { ...blockProps }>{ placeholderChip }</div>;\n\t}\n\treturn <PostFeaturedImageDisplay { ...props } />;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/post-featured-image/edit.js"],"names":["useEntityProp","store","coreStore","useSelect","useDispatch","MenuItem","ToggleControl","PanelBody","Placeholder","Button","InspectorControls","BlockControls","MediaPlaceholder","MediaReplaceFlow","useBlockProps","blockEditorStore","__","sprintf","upload","SVG","Path","noticesStore","DimensionControls","placeholderIllustration","ALLOWED_MEDIA_TYPES","placeholderChip","getMediaSourceUrlBySizeSlug","media","slug","media_details","sizes","source_url","PostFeaturedImageDisplay","clientId","attributes","setAttributes","context","postId","postType","postTypeSlug","queryId","isDescendentOfQueryLoop","Number","isFinite","isLink","height","width","scale","sizeSlug","featuredImage","setFeaturedImage","select","getMedia","getPostType","mediaUrl","imageSizes","getSettings","imageSizeOptions","filter","map","name","value","label","blockProps","style","placeholder","content","onSelectImage","id","createErrorNotice","onUploadError","message","type","controls","labels","singular_name","toLowerCase","image","open","alt_text","objectFit","PostFeaturedImageEdit","props"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,aAAT,EAAwBC,KAAK,IAAIC,SAAjC,QAAkD,sBAAlD;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SACCC,QADD,EAECC,aAFD,EAGCC,SAHD,EAICC,WAJD,EAKCC,MALD,QAMO,uBANP;AAOA,SACCC,iBADD,EAECC,aAFD,EAGCC,gBAHD,EAICC,gBAJD,EAKCC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AAE,oBAAF,CAFK,EAGPW,KAAK,CAACoD,QAHC,CADV,GAMG/D,EAAE,CAAE,gBAAF,CATP;AAWC,MAAA,KAAK,EAAG;AAAE6B,QAAAA,MAAF;AAAUmC,QAAAA,SAAS,EAAEnC,MAAM,IAAIE;AAA/B;AAXT,MAHD;AAiBA;;AAED,SACC,8BACG0B,QADH,EAEG,CAAC,CAAE9C,KAAH,IAAY,CAAEc,uBAAd,IACD,cAAC,aAAD;AAAe,IAAA,KAAK,EAAC;AAArB,KACC,cAAC,gBAAD;AACC,IAAA,OAAO,EAAGQ,aADX;AAEC,IAAA,QAAQ,EAAGK,QAFZ;AAGC,IAAA,YAAY,EAAG9B,mBAHhB;AAIC,IAAA,MAAM,EAAC,SAJR;AAKC,IAAA,QAAQ,EAAG2C,aALZ;AAMC,IAAA,OAAO,EAAGG;AANX,KAQC,cAAC,QAAD;AAAU,IAAA,OAAO,EAAG,MAAMpB,gBAAgB,CAAE,CAAF;AAA1C,KACGlC,EAAE,CAAE,OAAF,CADL,CARD,CADD,CAHF,EAkBC,wBAAa+C,UAAb,EAA4Bc,KAA5B,CAlBD,CADD;AAsBA;;AAED,eAAe,SAASI,qBAAT,CAAgCC,KAAhC,EAAwC;AAAA;;AACtD,QAAMnB,UAAU,GAAGjD,aAAa,EAAhC;;AACA,MAAK,oBAAEoE,KAAK,CAAC9C,OAAR,2CAAE,eAAeC,MAAjB,CAAL,EAA+B;AAC9B,WAAO,qBAAU0B,UAAV,EAAyBtC,eAAzB,CAAP;AACA;;AACD,SAAO,cAAC,wBAAD,EAA+ByD,KAA/B,CAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tMenuItem,\n\tToggleControl,\n\tPanelBody,\n\tPlaceholder,\n\tButton,\n} from '@wordpress/components';\nimport {\n\tInspectorControls,\n\tBlockControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { upload } from '@wordpress/icons';\nimport { SVG, Path } from '@wordpress/primitives';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport DimensionControls from './dimension-controls';\n\nconst placeholderIllustration = (\n\t<SVG\n\t\tclassName=\"components-placeholder__illustration\"\n\t\tfill=\"none\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\tviewBox=\"0 0 60 60\"\n\t\tpreserveAspectRatio=\"none\"\n\t>\n\t\t<Path vectorEffect=\"non-scaling-stroke\" d=\"M60 60 0 0\" />\n\t</SVG>\n);\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\nconst placeholderChip = (\n\t<div className=\"wp-block-post-featured-image__placeholder\">\n\t\t{ placeholderIllustration }\n\t</div>\n);\n\nfunction getMediaSourceUrlBySizeSlug( media, slug ) {\n\treturn (\n\t\tmedia?.media_details?.sizes?.[ slug ]?.source_url || media?.source_url\n\t);\n}\n\nfunction PostFeaturedImageDisplay( {\n\tclientId,\n\tattributes,\n\tsetAttributes,\n\tcontext: { postId, postType: postTypeSlug, queryId },\n} ) {\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\tconst { isLink, height, width, scale, sizeSlug } = attributes;\n\tconst [ featuredImage, setFeaturedImage ] = useEntityProp(\n\t\t'postType',\n\t\tpostTypeSlug,\n\t\t'featured_media',\n\t\tpostId\n\t);\n\n\tconst { media, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getMedia, getPostType } = select( 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};\n\t\t},\n\t\t[ featuredImage, postTypeSlug ]\n\t);\n\tconst mediaUrl = getMediaSourceUrlBySizeSlug( media, sizeSlug );\n\n\tconst imageSizes = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings().imageSizes,\n\t\t[]\n\t);\n\tconst imageSizeOptions = imageSizes\n\t\t.filter( ( { slug } ) => {\n\t\t\treturn media?.media_details?.sizes?.[ slug ]?.source_url;\n\t\t} )\n\t\t.map( ( { name, slug } ) => ( {\n\t\t\tvalue: slug,\n\t\t\tlabel: name,\n\t\t} ) );\n\n\tconst blockProps = useBlockProps( {\n\t\tstyle: { width, height },\n\t} );\n\n\tconst placeholder = ( content ) => {\n\t\treturn (\n\t\t\t<Placeholder className=\"block-editor-media-placeholder\">\n\t\t\t\t{ placeholderIllustration }\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\t};\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message[ 2 ], { type: 'snackbar' } );\n\t};\n\n\tconst controls = (\n\t\t<>\n\t\t\t<DimensionControls\n\t\t\t\tclientId={ clientId }\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\timageSizeOptions={ imageSizeOptions }\n\t\t\t/>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={\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.toLowerCase()\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\tonChange={ () => setAttributes( { isLink: ! isLink } ) }\n\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\tlet image;\n\tif ( ! featuredImage && isDescendentOfQueryLoop ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ controls }\n\t\t\t\t<div { ...blockProps }>{ placeholderChip }</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tconst label = __( 'Add a featured image' );\n\n\tif ( ! featuredImage ) {\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\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 = ! media ? (\n\t\t\tplaceholderChip\n\t\t) : (\n\t\t\t<img\n\t\t\t\tsrc={ mediaUrl }\n\t\t\t\talt={\n\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: The image's alt text.\n\t\t\t\t\t\t\t\t__( 'Featured image: %s' ),\n\t\t\t\t\t\t\t\tmedia.alt_text\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Featured image' )\n\t\t\t\t}\n\t\t\t\tstyle={ { height, objectFit: height && scale } }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ 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>\n\t\t\t\t\t\t<MenuItem onClick={ () => setFeaturedImage( 0 ) }>\n\t\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MediaReplaceFlow>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t<figure { ...blockProps }>{ image }</figure>\n\t\t</>\n\t);\n}\n\nexport default function PostFeaturedImageEdit( props ) {\n\tconst blockProps = useBlockProps();\n\tif ( ! props.context?.postId ) {\n\t\treturn <div { ...blockProps }>{ placeholderChip }</div>;\n\t}\n\treturn <PostFeaturedImageDisplay { ...props } />;\n}\n"]}
@@ -1,5 +1,3 @@
1
- var _window;
2
-
3
1
  /**
4
2
  * WordPress dependencies
5
3
  */
@@ -120,5 +118,13 @@ export const settingsV1 = {
120
118
 
121
119
  deprecated
122
120
  };
123
- export const settings = (_window = window) !== null && _window !== void 0 && _window.__experimentalEnableQuoteBlockV2 ? settingsV2 : settingsV1;
121
+ let settings = settingsV1;
122
+
123
+ if (process.env.IS_GUTENBERG_PLUGIN) {
124
+ var _window;
125
+
126
+ settings = (_window = window) !== null && _window !== void 0 && _window.__experimentalEnableQuoteBlockV2 ? settingsV2 : settingsV1;
127
+ }
128
+
129
+ export { settings };
124
130
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/quote/index.js"],"names":["__","quote","icon","deprecated","edit","save","transforms","settingsV2","name","metadata","settingsV1","example","attributes","value","citation","merge","settings","window","__experimentalEnableQuoteBlockV2"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,IAAlB,QAA8B,kBAA9B;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,IAAP,MAAiB,QAAjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,UAAP,MAAuB,MAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AAEA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,UAAU,GAAG;AACzBR,EAAAA,IADyB;AAEzBS,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,KAAK,EACJ,QAAQb,EAAE,CAAE,uCAAF,CAAV,GAAwD,MAF9C;AAGXc,MAAAA,QAAQ,EAAE;AAHC;AADJ,GAFgB;AASzBR,EAAAA,UATyB;AAUzBF,EAAAA,IAVyB;AAWzBC,EAAAA,IAXyB;;AAYzBU,EAAAA,KAAK,CAAEH,UAAF,QAAoC;AAAA,QAAtB;AAAEC,MAAAA,KAAF;AAASC,MAAAA;AAAT,KAAsB;;AACxC;AACA;AACA,QAAK,CAAEA,QAAP,EAAkB;AACjBA,MAAAA,QAAQ,GAAGF,UAAU,CAACE,QAAtB;AACA;;AAED,QAAK,CAAED,KAAF,IAAWA,KAAK,KAAK,SAA1B,EAAsC;AACrC,aAAO,EACN,GAAGD,UADG;AAENE,QAAAA;AAFM,OAAP;AAIA;;AAED,WAAO,EACN,GAAGF,UADG;AAENC,MAAAA,KAAK,EAAED,UAAU,CAACC,KAAX,GAAmBA,KAFpB;AAGNC,MAAAA;AAHM,KAAP;AAKA,GA/BwB;;AAgCzBX,EAAAA;AAhCyB,CAAnB;AAmCP,OAAO,MAAMa,QAAQ,GAAG,WAAAC,MAAM,UAAN,kCAAQC,gCAAR,GACrBX,UADqB,GAErBG,UAFI","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { quote as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport settingsV2 from './v2';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settingsV1 = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tvalue:\n\t\t\t\t'<p>' + __( 'In quoting others, we cite ourselves.' ) + '</p>',\n\t\t\tcitation: 'Julio Cortázar',\n\t\t},\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tmerge( attributes, { value, citation } ) {\n\t\t// Quote citations cannot be merged. Pick the second one unless it's\n\t\t// empty.\n\t\tif ( ! citation ) {\n\t\t\tcitation = attributes.citation;\n\t\t}\n\n\t\tif ( ! value || value === '<p></p>' ) {\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\tcitation,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\t...attributes,\n\t\t\tvalue: attributes.value + value,\n\t\t\tcitation,\n\t\t};\n\t},\n\tdeprecated,\n};\n\nexport const settings = window?.__experimentalEnableQuoteBlockV2\n\t? settingsV2\n\t: settingsV1;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/quote/index.js"],"names":["__","quote","icon","deprecated","edit","save","transforms","settingsV2","name","metadata","settingsV1","example","attributes","value","citation","merge","settings","process","env","IS_GUTENBERG_PLUGIN","window","__experimentalEnableQuoteBlockV2"],"mappings":"AAAA;AACA;AACA;AAC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OAAO,CAACC,GAAR,CAAYC,mBAAjB,EAAuC;AAAA;;AACtCH,EAAAA,QAAQ,GAAG,WAAAI,MAAM,UAAN,kCAAQC,gCAAR,GACRd,UADQ,GAERG,UAFH;AAGA;;AACD,SAASM,QAAT","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { quote as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\nimport settingsV2 from './v2';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settingsV1 = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tvalue:\n\t\t\t\t'<p>' + __( 'In quoting others, we cite ourselves.' ) + '</p>',\n\t\t\tcitation: 'Julio Cortázar',\n\t\t},\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tmerge( attributes, { value, citation } ) {\n\t\t// Quote citations cannot be merged. Pick the second one unless it's\n\t\t// empty.\n\t\tif ( ! citation ) {\n\t\t\tcitation = attributes.citation;\n\t\t}\n\n\t\tif ( ! value || value === '<p></p>' ) {\n\t\t\treturn {\n\t\t\t\t...attributes,\n\t\t\t\tcitation,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\t...attributes,\n\t\t\tvalue: attributes.value + value,\n\t\t\tcitation,\n\t\t};\n\t},\n\tdeprecated,\n};\n\nlet settings = settingsV1;\nif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\tsettings = window?.__experimentalEnableQuoteBlockV2\n\t\t? settingsV2\n\t\t: settingsV1;\n}\nexport { settings };\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "7.3.1",
3
+ "version": "7.3.2",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -33,32 +33,32 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@babel/runtime": "^7.16.0",
36
- "@wordpress/a11y": "^3.6.0",
37
- "@wordpress/api-fetch": "^6.3.0",
38
- "@wordpress/autop": "^3.6.0",
39
- "@wordpress/blob": "^3.6.0",
40
- "@wordpress/block-editor": "^8.5.1",
41
- "@wordpress/blocks": "^11.5.1",
42
- "@wordpress/components": "^19.8.0",
43
- "@wordpress/compose": "^5.4.0",
44
- "@wordpress/core-data": "^4.4.1",
45
- "@wordpress/data": "^6.6.0",
46
- "@wordpress/date": "^4.6.0",
47
- "@wordpress/deprecated": "^3.6.0",
48
- "@wordpress/dom": "^3.6.0",
49
- "@wordpress/element": "^4.4.0",
50
- "@wordpress/hooks": "^3.6.0",
51
- "@wordpress/html-entities": "^3.6.0",
52
- "@wordpress/i18n": "^4.6.0",
53
- "@wordpress/icons": "^8.2.0",
54
- "@wordpress/keycodes": "^3.6.0",
55
- "@wordpress/notices": "^3.6.0",
56
- "@wordpress/primitives": "^3.4.0",
57
- "@wordpress/reusable-blocks": "^3.4.1",
58
- "@wordpress/rich-text": "^5.4.0",
59
- "@wordpress/server-side-render": "^3.4.1",
60
- "@wordpress/url": "^3.7.0",
61
- "@wordpress/viewport": "^4.4.0",
36
+ "@wordpress/a11y": "^3.6.1",
37
+ "@wordpress/api-fetch": "^6.3.1",
38
+ "@wordpress/autop": "^3.6.1",
39
+ "@wordpress/blob": "^3.6.1",
40
+ "@wordpress/block-editor": "^8.5.2",
41
+ "@wordpress/blocks": "^11.5.2",
42
+ "@wordpress/components": "^19.8.1",
43
+ "@wordpress/compose": "^5.4.1",
44
+ "@wordpress/core-data": "^4.4.2",
45
+ "@wordpress/data": "^6.6.1",
46
+ "@wordpress/date": "^4.6.1",
47
+ "@wordpress/deprecated": "^3.6.1",
48
+ "@wordpress/dom": "^3.6.1",
49
+ "@wordpress/element": "^4.4.1",
50
+ "@wordpress/hooks": "^3.6.1",
51
+ "@wordpress/html-entities": "^3.6.1",
52
+ "@wordpress/i18n": "^4.6.1",
53
+ "@wordpress/icons": "^8.2.1",
54
+ "@wordpress/keycodes": "^3.6.1",
55
+ "@wordpress/notices": "^3.6.1",
56
+ "@wordpress/primitives": "^3.4.1",
57
+ "@wordpress/reusable-blocks": "^3.4.2",
58
+ "@wordpress/rich-text": "^5.4.1",
59
+ "@wordpress/server-side-render": "^3.4.2",
60
+ "@wordpress/url": "^3.7.1",
61
+ "@wordpress/viewport": "^4.4.1",
62
62
  "classnames": "^2.3.1",
63
63
  "colord": "^2.7.0",
64
64
  "fast-average-color": "4.3.0",
@@ -74,5 +74,5 @@
74
74
  "publishConfig": {
75
75
  "access": "public"
76
76
  },
77
- "gitHead": "9c15c669843d53c5ca6024a4c486d01d819d123f"
77
+ "gitHead": "446565ecaa40370173c18926535e975ec5652b71"
78
78
  }
package/src/audio/edit.js CHANGED
@@ -186,7 +186,7 @@ function AudioEdit( {
186
186
  { value: 'metadata', label: __( 'Metadata' ) },
187
187
  {
188
188
  value: 'none',
189
- label: _x( 'None', '"Preload" value' ),
189
+ label: _x( 'None', 'Preload value' ),
190
190
  },
191
191
  ] }
192
192
  />
@@ -252,7 +252,6 @@ export default function CommentTemplateEdit( {
252
252
  ( select ) => {
253
253
  const { getEntityRecords } = select( coreStore );
254
254
  const { getBlocks } = select( blockEditorStore );
255
-
256
255
  return {
257
256
  // Request only top-level comments. Replies are embedded.
258
257
  topLevelComments: commentQuery
@@ -289,7 +288,11 @@ export default function CommentTemplateEdit( {
289
288
  }
290
289
 
291
290
  if ( ! commentTree.length ) {
292
- return <p { ...blockProps }> { __( 'No results found.' ) }</p>;
291
+ return (
292
+ <p { ...blockProps } data-testid="noresults">
293
+ { __( 'No results found.' ) }
294
+ </p>
295
+ );
293
296
  }
294
297
 
295
298
  return (
@@ -96,9 +96,10 @@ const useDefaultPageIndex = ( { defaultPage, postId, perPage, queryArgs } ) => {
96
96
  method: 'HEAD',
97
97
  parse: false,
98
98
  } ).then( ( res ) => {
99
+ const pages = parseInt( res.headers.get( 'X-WP-TotalPages' ) );
99
100
  setDefaultPages( {
100
101
  ...defaultPages,
101
- [ key ]: parseInt( res.headers.get( 'X-WP-TotalPages' ) ),
102
+ [ key ]: pages <= 1 ? 1 : pages, // If there are 0 pages, it means that there are no comments, but there is no 0th page.
102
103
  } );
103
104
  } );
104
105
  }, [ defaultPage, postId, perPage, setDefaultPages ] );
@@ -8,11 +8,17 @@
8
8
  /**
9
9
  * Function that recursively renders a list of nested comments.
10
10
  *
11
- * @param WP_Comment[] $comments The array of comments.
11
+ * @param WP_Comment[] $comments The array of comments.
12
12
  * @param WP_Block $block Block instance.
13
13
  * @return string
14
14
  */
15
15
  function block_core_comment_template_render_comments( $comments, $block ) {
16
+ global $comment_depth;
17
+
18
+ if ( empty( $comment_depth ) ) {
19
+ $comment_depth = 1;
20
+ }
21
+
16
22
  $content = '';
17
23
  foreach ( $comments as $comment ) {
18
24
 
@@ -28,14 +34,20 @@ function block_core_comment_template_render_comments( $comments, $block ) {
28
34
  // If the comment has children, recurse to create the HTML for the nested
29
35
  // comments.
30
36
  if ( ! empty( $children ) ) {
37
+ $comment_depth += 1;
31
38
  $inner_content = block_core_comment_template_render_comments(
32
39
  $children,
33
40
  $block
34
41
  );
35
42
  $block_content .= sprintf( '<ol>%1$s</ol>', $inner_content );
43
+ $comment_depth -= 1;
36
44
  }
37
45
 
38
- $content .= '<li>' . $block_content . '</li>';
46
+ // The `false` parameter at the end means that we do NOT want the function to `echo` the output but to return a string.
47
+ // See https://developer.wordpress.org/reference/functions/comment_class/#parameters.
48
+ $comment_classes = comment_class( '', $comment->comment_ID, $comment->comment_post_ID, false );
49
+
50
+ $content .= sprintf( '<li id="comment-%1$s" %2$s>%3$s</li>', $comment->comment_ID, $comment_classes, $block_content );
39
51
  }
40
52
 
41
53
  return $content;
@@ -64,37 +64,60 @@ const transforms = {
64
64
  {
65
65
  type: 'block',
66
66
  blocks: [ 'core/group' ],
67
- isMatch: ( { backgroundColor, gradient, style } ) => {
68
- /*
69
- * Make this transformation available only if the Group has background
70
- * or gradient set, because otherwise `Cover` block displays a Placeholder.
71
- *
72
- * This helps avoid arbitrary decisions about the Cover block's background
73
- * and user confusion about the existence of previous content.
74
- */
75
- return (
67
+ transform: ( attributes, innerBlocks ) => {
68
+ const {
69
+ align,
70
+ anchor,
71
+ backgroundColor,
72
+ gradient,
73
+ style,
74
+ } = attributes;
75
+
76
+ // If no background or gradient color is provided, default to 50% opacity.
77
+ // This matches the styling of a Cover block with a background image,
78
+ // in the state where a background image has been removed.
79
+ const dimRatio =
76
80
  backgroundColor ||
81
+ gradient ||
77
82
  style?.color?.background ||
78
- style?.color?.gradient ||
79
- gradient
80
- );
81
- },
82
- transform: (
83
- { align, anchor, backgroundColor, gradient, style },
84
- innerBlocks
85
- ) => {
86
- return createBlock(
87
- 'core/cover',
88
- {
89
- align,
90
- anchor,
91
- overlayColor: backgroundColor,
92
- customOverlayColor: style?.color?.background,
93
- gradient,
94
- customGradient: style?.color?.gradient,
83
+ style?.color?.gradient
84
+ ? undefined
85
+ : 50;
86
+
87
+ // Move the background or gradient color to the parent Cover block.
88
+ const parentAttributes = {
89
+ align,
90
+ anchor,
91
+ dimRatio,
92
+ overlayColor: backgroundColor,
93
+ customOverlayColor: style?.color?.background,
94
+ gradient,
95
+ customGradient: style?.color?.gradient,
96
+ };
97
+
98
+ const attributesWithoutBackgroundColors = {
99
+ ...attributes,
100
+ backgroundColor: undefined,
101
+ gradient: undefined,
102
+ style: {
103
+ ...attributes?.style,
104
+ color: {
105
+ ...attributes?.style?.color,
106
+ background: undefined,
107
+ gradient: undefined,
108
+ },
95
109
  },
96
- innerBlocks
97
- );
110
+ };
111
+
112
+ // Preserve the block by nesting it within the Cover block,
113
+ // instead of converting the Group block directly to the Cover block.
114
+ return createBlock( 'core/cover', parentAttributes, [
115
+ createBlock(
116
+ 'core/group',
117
+ attributesWithoutBackgroundColors,
118
+ innerBlocks
119
+ ),
120
+ ] );
98
121
  },
99
122
  },
100
123
  ],
package/src/index.js CHANGED
@@ -138,7 +138,6 @@ export const __experimentalGetCoreBlocks = () => [
138
138
  heading,
139
139
  gallery,
140
140
  list,
141
- listItem,
142
141
  quote,
143
142
 
144
143
  // Register all remaining core blocks.
@@ -268,6 +267,10 @@ export const __experimentalRegisterExperimentalCoreBlocks = process.env
268
267
  [
269
268
  // Experimental blocks.
270
269
  postAuthorName,
270
+ ...( window.__experimentalEnableListBlockV2
271
+ ? [ listItem ]
272
+ : [] ),
273
+
271
274
  // Full Site Editing blocks.
272
275
  ...( enableFSEBlocks
273
276
  ? [
package/src/list/index.js CHANGED
@@ -43,6 +43,10 @@ const settingsV1 = {
43
43
  deprecated,
44
44
  };
45
45
 
46
- export const settings = window?.__experimentalEnableListBlockV2
47
- ? settingsV2
48
- : settingsV1;
46
+ let settings = settingsV1;
47
+ if ( process.env.IS_GUTENBERG_PLUGIN ) {
48
+ settings = window?.__experimentalEnableListBlockV2
49
+ ? settingsV2
50
+ : settingsV1;
51
+ }
52
+ export { settings };
@@ -18,20 +18,28 @@ function render_block_core_post_comments_form( $attributes, $content, $block ) {
18
18
  return '';
19
19
  }
20
20
 
21
- $classes = '';
21
+ $classes = 'comment-respond'; // See comment further below.
22
22
  if ( isset( $attributes['textAlign'] ) ) {
23
23
  $classes .= 'has-text-align-' . $attributes['textAlign'];
24
24
  }
25
25
 
26
+ $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
27
+
26
28
  ob_start();
27
29
  comment_form( array(), $block->context['postId'] );
28
- $form = ob_get_clean();
29
- $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
30
+ $form = ob_get_clean();
31
+
32
+ // We use the outermost wrapping `<div />` returned by `comment_form()`
33
+ // which is identified by its default classname `comment-respond` to inject
34
+ // our wrapper attributes. This way, it is guaranteed that all styling applied
35
+ // to the block is carried along when the comment form is moved to the location
36
+ // of the 'Reply' link that the user clicked by Core's `comment-reply.js` script.
37
+ $form = str_replace( 'class="comment-respond"', $wrapper_attributes, $form );
30
38
 
31
39
  // Enqueue the comment-reply script.
32
40
  wp_enqueue_script( 'comment-reply' );
33
41
 
34
- return sprintf( '<div %1$s>%2$s</div>', $wrapper_attributes, $form );
42
+ return $form;
35
43
  }
36
44
 
37
45
  /**