@wordpress/block-library 9.21.0 → 9.23.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 (201) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/calendar/index.js +1 -0
  3. package/build/calendar/index.js.map +1 -1
  4. package/build/comments/edit/comments-inspector-controls.js +13 -13
  5. package/build/comments/edit/comments-inspector-controls.js.map +1 -1
  6. package/build/comments/edit/index.js +4 -2
  7. package/build/comments/edit/index.js.map +1 -1
  8. package/build/cover/edit/inspector-controls.js +9 -12
  9. package/build/cover/edit/inspector-controls.js.map +1 -1
  10. package/build/cover/index.js +1 -1
  11. package/build/cover/index.js.map +1 -1
  12. package/build/details/edit.js +1 -5
  13. package/build/details/edit.js.map +1 -1
  14. package/build/details/index.js +1 -1
  15. package/build/details/index.js.map +1 -1
  16. package/build/group/edit.js +17 -13
  17. package/build/group/edit.js.map +1 -1
  18. package/build/image/edit.js +0 -6
  19. package/build/image/edit.js.map +1 -1
  20. package/build/latest-posts/edit.js +100 -54
  21. package/build/latest-posts/edit.js.map +1 -1
  22. package/build/navigation/view.js +2 -1
  23. package/build/navigation/view.js.map +1 -1
  24. package/build/navigation-link/edit.js +0 -21
  25. package/build/navigation-link/edit.js.map +1 -1
  26. package/build/navigation-link/index.js +0 -3
  27. package/build/navigation-link/index.js.map +1 -1
  28. package/build/navigation-link/transforms.js +0 -2
  29. package/build/navigation-link/transforms.js.map +1 -1
  30. package/build/navigation-link/update-attributes.js +0 -1
  31. package/build/navigation-link/update-attributes.js.map +1 -1
  32. package/build/navigation-submenu/edit.js +1 -24
  33. package/build/navigation-submenu/edit.js.map +1 -1
  34. package/build/navigation-submenu/index.js +0 -3
  35. package/build/navigation-submenu/index.js.map +1 -1
  36. package/build/post-comments-count/index.js +0 -1
  37. package/build/post-comments-count/index.js.map +1 -1
  38. package/build/post-comments-link/index.js +0 -1
  39. package/build/post-comments-link/index.js.map +1 -1
  40. package/build/post-featured-image/edit.js +15 -5
  41. package/build/post-featured-image/edit.js.map +1 -1
  42. package/build/query/edit/inspector-controls/index.js +47 -59
  43. package/build/query/edit/inspector-controls/index.js.map +1 -1
  44. package/build/query/edit/inspector-controls/parent-control.js +2 -2
  45. package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
  46. package/build/query/edit/inspector-controls/taxonomy-controls.js +2 -2
  47. package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  48. package/build/query/edit/query-content.js +15 -29
  49. package/build/query/edit/query-content.js.map +1 -1
  50. package/build/quote/index.js +1 -1
  51. package/build/quote/index.js.map +1 -1
  52. package/build/separator/edit.js +13 -12
  53. package/build/separator/edit.js.map +1 -1
  54. package/build/social-links/edit.js +29 -31
  55. package/build/social-links/edit.js.map +1 -1
  56. package/build/table/index.js +3 -3
  57. package/build/table/index.js.map +1 -1
  58. package/build/table/transforms.js +11 -3
  59. package/build/table/transforms.js.map +1 -1
  60. package/build/table-of-contents/edit.js +1 -1
  61. package/build/table-of-contents/edit.js.map +1 -1
  62. package/build/table-of-contents/hooks.js +6 -3
  63. package/build/table-of-contents/hooks.js.map +1 -1
  64. package/build/template-part/edit/advanced-controls.js +14 -12
  65. package/build/template-part/edit/advanced-controls.js.map +1 -1
  66. package/build/template-part/edit/index.js +2 -1
  67. package/build/template-part/edit/index.js.map +1 -1
  68. package/build-module/calendar/index.js +1 -0
  69. package/build-module/calendar/index.js.map +1 -1
  70. package/build-module/comments/edit/comments-inspector-controls.js +14 -14
  71. package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
  72. package/build-module/comments/edit/index.js +4 -2
  73. package/build-module/comments/edit/index.js.map +1 -1
  74. package/build-module/cover/edit/inspector-controls.js +10 -13
  75. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  76. package/build-module/cover/index.js +1 -1
  77. package/build-module/cover/index.js.map +1 -1
  78. package/build-module/details/edit.js +1 -5
  79. package/build-module/details/edit.js.map +1 -1
  80. package/build-module/details/index.js +1 -1
  81. package/build-module/details/index.js.map +1 -1
  82. package/build-module/group/edit.js +16 -14
  83. package/build-module/group/edit.js.map +1 -1
  84. package/build-module/image/edit.js +0 -6
  85. package/build-module/image/edit.js.map +1 -1
  86. package/build-module/latest-posts/edit.js +100 -54
  87. package/build-module/latest-posts/edit.js.map +1 -1
  88. package/build-module/navigation/view.js +2 -1
  89. package/build-module/navigation/view.js.map +1 -1
  90. package/build-module/navigation-link/edit.js +0 -21
  91. package/build-module/navigation-link/edit.js.map +1 -1
  92. package/build-module/navigation-link/index.js +0 -3
  93. package/build-module/navigation-link/index.js.map +1 -1
  94. package/build-module/navigation-link/transforms.js +0 -2
  95. package/build-module/navigation-link/transforms.js.map +1 -1
  96. package/build-module/navigation-link/update-attributes.js +0 -1
  97. package/build-module/navigation-link/update-attributes.js.map +1 -1
  98. package/build-module/navigation-submenu/edit.js +1 -24
  99. package/build-module/navigation-submenu/edit.js.map +1 -1
  100. package/build-module/navigation-submenu/index.js +0 -3
  101. package/build-module/navigation-submenu/index.js.map +1 -1
  102. package/build-module/post-comments-count/index.js +0 -1
  103. package/build-module/post-comments-count/index.js.map +1 -1
  104. package/build-module/post-comments-link/index.js +0 -1
  105. package/build-module/post-comments-link/index.js.map +1 -1
  106. package/build-module/post-featured-image/edit.js +15 -5
  107. package/build-module/post-featured-image/edit.js.map +1 -1
  108. package/build-module/query/edit/inspector-controls/index.js +49 -61
  109. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  110. package/build-module/query/edit/inspector-controls/parent-control.js +2 -2
  111. package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
  112. package/build-module/query/edit/inspector-controls/taxonomy-controls.js +2 -2
  113. package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  114. package/build-module/query/edit/query-content.js +16 -30
  115. package/build-module/query/edit/query-content.js.map +1 -1
  116. package/build-module/quote/index.js +1 -1
  117. package/build-module/quote/index.js.map +1 -1
  118. package/build-module/separator/edit.js +15 -14
  119. package/build-module/separator/edit.js.map +1 -1
  120. package/build-module/social-links/edit.js +30 -32
  121. package/build-module/social-links/edit.js.map +1 -1
  122. package/build-module/table/index.js +3 -3
  123. package/build-module/table/index.js.map +1 -1
  124. package/build-module/table/transforms.js +11 -3
  125. package/build-module/table/transforms.js.map +1 -1
  126. package/build-module/table-of-contents/edit.js +1 -1
  127. package/build-module/table-of-contents/edit.js.map +1 -1
  128. package/build-module/table-of-contents/hooks.js +6 -3
  129. package/build-module/table-of-contents/hooks.js.map +1 -1
  130. package/build-module/template-part/edit/advanced-controls.js +14 -12
  131. package/build-module/template-part/edit/advanced-controls.js.map +1 -1
  132. package/build-module/template-part/edit/index.js +2 -1
  133. package/build-module/template-part/edit/index.js.map +1 -1
  134. package/build-style/editor-rtl.css +1 -50
  135. package/build-style/editor.css +1 -50
  136. package/build-style/media-text/style-rtl.css +0 -2
  137. package/build-style/media-text/style.css +0 -2
  138. package/build-style/search/style-rtl.css +1 -0
  139. package/build-style/search/style.css +1 -0
  140. package/build-style/social-links/editor-rtl.css +1 -50
  141. package/build-style/social-links/editor.css +1 -50
  142. package/build-style/style-rtl.css +1 -6
  143. package/build-style/style.css +1 -6
  144. package/build-style/tag-cloud/style-rtl.css +0 -4
  145. package/build-style/tag-cloud/style.css +0 -4
  146. package/package.json +35 -35
  147. package/src/button/index.php +2 -3
  148. package/src/calendar/block.json +1 -0
  149. package/src/comments/edit/comments-inspector-controls.js +14 -12
  150. package/src/comments/edit/index.js +2 -1
  151. package/src/cover/edit/inspector-controls.js +9 -12
  152. package/src/cover/index.js +1 -1
  153. package/src/details/edit.js +6 -8
  154. package/src/details/index.js +1 -1
  155. package/src/file/index.php +2 -3
  156. package/src/group/edit.js +11 -10
  157. package/src/image/edit.js +0 -4
  158. package/src/latest-comments/index.php +1 -1
  159. package/src/latest-posts/edit.js +113 -81
  160. package/src/latest-posts/index.php +3 -0
  161. package/src/loginout/index.php +5 -1
  162. package/src/media-text/style.scss +0 -2
  163. package/src/navigation/index.php +1 -2
  164. package/src/navigation/view.js +2 -1
  165. package/src/navigation-link/block.json +0 -3
  166. package/src/navigation-link/edit.js +1 -22
  167. package/src/navigation-link/index.php +2 -6
  168. package/src/navigation-link/transforms.js +1 -2
  169. package/src/navigation-link/update-attributes.js +0 -1
  170. package/src/navigation-submenu/block.json +0 -3
  171. package/src/navigation-submenu/edit.js +1 -24
  172. package/src/navigation-submenu/index.php +1 -5
  173. package/src/post-author/index.php +1 -1
  174. package/src/post-author-name/index.php +1 -1
  175. package/src/post-comments-count/block.json +0 -1
  176. package/src/post-comments-count/index.php +4 -0
  177. package/src/post-comments-link/block.json +0 -1
  178. package/src/post-comments-link/index.php +4 -0
  179. package/src/post-featured-image/edit.js +94 -77
  180. package/src/query/edit/inspector-controls/index.js +66 -91
  181. package/src/query/edit/inspector-controls/parent-control.js +2 -2
  182. package/src/query/edit/inspector-controls/taxonomy-controls.js +2 -2
  183. package/src/query/edit/query-content.js +17 -27
  184. package/src/quote/index.js +1 -1
  185. package/src/search/index.php +12 -9
  186. package/src/search/style.scss +1 -0
  187. package/src/separator/edit.js +16 -12
  188. package/src/social-links/edit.js +29 -30
  189. package/src/social-links/editor.scss +1 -59
  190. package/src/table/index.js +3 -3
  191. package/src/table/transforms.js +14 -2
  192. package/src/table-of-contents/edit.js +1 -1
  193. package/src/table-of-contents/hooks.js +5 -2
  194. package/src/tag-cloud/style.scss +0 -5
  195. package/src/template-part/edit/advanced-controls.js +9 -8
  196. package/src/template-part/edit/index.js +1 -0
  197. package/build/utils/messages.js +0 -22
  198. package/build/utils/messages.js.map +0 -1
  199. package/build-module/utils/messages.js +0 -15
  200. package/build-module/utils/messages.js.map +0 -1
  201. package/src/utils/messages.js +0 -31
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useDispatch","useInstanceId","useEffect","useCallback","BlockControls","InspectorControls","useBlockProps","store","blockEditorStore","useInnerBlocksProps","SelectControl","__","coreStore","EnhancedPaginationControl","QueryInspectorControls","EnhancedPaginationModal","getQueryContextFromTemplate","QueryToolbar","htmlElementMessages","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","DEFAULTS_POSTS_PER_PAGE","TEMPLATE","QueryContent","attributes","setAttributes","clientId","context","name","queryId","query","displayLayout","enhancedPagination","tagName","TagName","inherit","templateSlug","isSingular","__unstableMarkNextChangeAsNotPersistent","instanceId","blockProps","innerBlocksProps","template","postsPerPage","select","getSettings","getEntityRecord","getEntityRecordEdits","canUser","settingPerPage","kind","posts_per_page","editedSettingPerPage","updateQuery","newQuery","perPage","Object","keys","length","Number","isFinite","updateDisplayLayout","newDisplayLayout","children","setQuery","setDisplayLayout","group","__nextHasNoMarginBottom","__next40pxDefaultSize","label","options","value","onChange","help"],"sources":["@wordpress/block-library/src/query/edit/query-content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect, useCallback } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport EnhancedPaginationControl from './inspector-controls/enhanced-pagination-control';\nimport QueryInspectorControls from './inspector-controls';\nimport EnhancedPaginationModal from './enhanced-pagination-modal';\nimport { getQueryContextFromTemplate } from '../utils';\nimport QueryToolbar from './query-toolbar';\nimport { htmlElementMessages } from '../../utils/messages';\n\nconst DEFAULTS_POSTS_PER_PAGE = 3;\n\nconst TEMPLATE = [ [ 'core/post-template' ] ];\nexport default function QueryContent( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tcontext,\n\tname,\n} ) {\n\tconst {\n\t\tqueryId,\n\t\tquery,\n\t\tdisplayLayout,\n\t\tenhancedPagination,\n\t\ttagName: TagName = 'div',\n\t\tquery: { inherit } = {},\n\t} = attributes;\n\tconst { templateSlug } = context;\n\tconst { isSingular } = getQueryContextFromTemplate( templateSlug );\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst instanceId = useInstanceId( QueryContent );\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\tconst { postsPerPage } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { getEntityRecord, getEntityRecordEdits, canUser } =\n\t\t\tselect( coreStore );\n\t\tconst settingPerPage = canUser( 'read', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} )\n\t\t\t? +getEntityRecord( 'root', 'site' )?.posts_per_page\n\t\t\t: +getSettings().postsPerPage;\n\n\t\t// Gets changes made via the template area posts per page setting. These won't be saved\n\t\t// until the page is saved, but we should reflect this setting within the query loops\n\t\t// that inherit it.\n\t\tconst editedSettingPerPage = +getEntityRecordEdits( 'root', 'site' )\n\t\t\t?.posts_per_page;\n\n\t\treturn {\n\t\t\tpostsPerPage:\n\t\t\t\teditedSettingPerPage ||\n\t\t\t\tsettingPerPage ||\n\t\t\t\tDEFAULTS_POSTS_PER_PAGE,\n\t\t};\n\t}, [] );\n\t// There are some effects running where some initialization logic is\n\t// happening and setting some values to some attributes (ex. queryId).\n\t// These updates can cause an `undo trap` where undoing will result in\n\t// resetting again, so we need to mark these changes as not persistent\n\t// with `__unstableMarkNextChangeAsNotPersistent`.\n\n\t// Changes in query property (which is an object) need to be in the same callback,\n\t// because updates are batched after the render and changes in different query properties\n\t// would cause to override previous wanted changes.\n\tconst updateQuery = useCallback(\n\t\t( newQuery ) => setAttributes( { query: { ...query, ...newQuery } } ),\n\t\t[ query, setAttributes ]\n\t);\n\tuseEffect( () => {\n\t\tconst newQuery = {};\n\t\t// When we inherit from global query always need to set the `perPage`\n\t\t// based on the reading settings.\n\t\tif ( inherit && query.perPage !== postsPerPage ) {\n\t\t\tnewQuery.perPage = postsPerPage;\n\t\t} else if ( ! query.perPage && postsPerPage ) {\n\t\t\tnewQuery.perPage = postsPerPage;\n\t\t}\n\t\t// We need to reset the `inherit` value if in a singular template, as queries\n\t\t// are not inherited when in singular content (e.g. post, page, 404, blank).\n\t\tif ( isSingular && query.inherit ) {\n\t\t\tnewQuery.inherit = false;\n\t\t}\n\t\tif ( !! Object.keys( newQuery ).length ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tupdateQuery( newQuery );\n\t\t}\n\t}, [\n\t\tquery.perPage,\n\t\tquery.inherit,\n\t\tpostsPerPage,\n\t\tinherit,\n\t\tisSingular,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tupdateQuery,\n\t] );\n\t// We need this for multi-query block pagination.\n\t// Query parameters for each block are scoped to their ID.\n\tuseEffect( () => {\n\t\tif ( ! Number.isFinite( queryId ) ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { queryId: instanceId } );\n\t\t}\n\t}, [\n\t\tqueryId,\n\t\tinstanceId,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tsetAttributes,\n\t] );\n\tconst updateDisplayLayout = ( newDisplayLayout ) =>\n\t\tsetAttributes( {\n\t\t\tdisplayLayout: { ...displayLayout, ...newDisplayLayout },\n\t\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<EnhancedPaginationModal\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tclientId={ clientId }\n\t\t\t/>\n\t\t\t<InspectorControls>\n\t\t\t\t<QueryInspectorControls\n\t\t\t\t\tname={ name }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetQuery={ updateQuery }\n\t\t\t\t\tsetDisplayLayout={ updateDisplayLayout }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tisSingular={ isSingular }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<BlockControls>\n\t\t\t\t<QueryToolbar attributes={ attributes } clientId={ clientId } />\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t] }\n\t\t\t\t\tvalue={ TagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ htmlElementMessages[ TagName ] }\n\t\t\t\t/>\n\t\t\t\t<EnhancedPaginationControl\n\t\t\t\t\tenhancedPagination={ enhancedPagination }\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<TagName { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,EAAEC,WAAW,QAAQ,oBAAoB;AAC3D,SACCC,aAAa,EACbC,iBAAiB,EACjBC,aAAa,EACbC,KAAK,IAAIC,gBAAgB,EACzBC,mBAAmB,QACb,yBAAyB;AAChC,SAASC,aAAa,QAAQ,uBAAuB;AACrD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASJ,KAAK,IAAIK,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,yBAAyB,MAAM,kDAAkD;AACxF,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IAAA,CAACV,aAAa;QACb6D,uBAAuB;QACvBC,qBAAqB;QACrBC,KAAK,EAAG9D,EAAE,CAAE,cAAe,CAAG;QAC9B+D,OAAO,EAAG,CACT;UAAED,KAAK,EAAE9D,EAAE,CAAE,iBAAkB,CAAC;UAAEgE,KAAK,EAAE;QAAM,CAAC,EAChD;UAAEF,KAAK,EAAE,QAAQ;UAAEE,KAAK,EAAE;QAAO,CAAC,EAClC;UAAEF,KAAK,EAAE,WAAW;UAAEE,KAAK,EAAE;QAAU,CAAC,EACxC;UAAEF,KAAK,EAAE,SAAS;UAAEE,KAAK,EAAE;QAAQ,CAAC,CAClC;QACHA,KAAK,EAAGrC,OAAS;QACjBsC,QAAQ,EAAKD,KAAK,IACjB9C,aAAa,CAAE;UAAEQ,OAAO,EAAEsC;QAAM,CAAE,CAClC;QACDE,IAAI,EAAG3D,mBAAmB,CAAEoB,OAAO;MAAI,CACvC,CAAC,eACFlB,IAAA,CAACP,yBAAyB;QACzBuB,kBAAkB,EAAGA,kBAAoB;QACzCP,aAAa,EAAGA,aAAe;QAC/BC,QAAQ,EAAGA;MAAU,CACrB,CAAC;IAAA,CACgB,CAAC,eACpBV,IAAA,CAACkB,OAAO;MAAA,GAAMO;IAAgB,CAAI,CAAC;EAAA,CAClC,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","useDispatch","useInstanceId","useEffect","useCallback","BlockControls","InspectorControls","useBlockProps","store","blockEditorStore","useInnerBlocksProps","privateApis","blockEditorPrivateApis","__","coreStore","EnhancedPaginationControl","unlock","QueryInspectorControls","EnhancedPaginationModal","getQueryContextFromTemplate","QueryToolbar","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","HTMLElementControl","DEFAULTS_POSTS_PER_PAGE","TEMPLATE","QueryContent","attributes","setAttributes","clientId","context","name","queryId","query","enhancedPagination","tagName","TagName","inherit","templateSlug","isSingular","__unstableMarkNextChangeAsNotPersistent","instanceId","blockProps","innerBlocksProps","template","postsPerPage","select","getSettings","getEntityRecord","getEntityRecordEdits","canUser","settingPerPage","kind","posts_per_page","editedSettingPerPage","updateQuery","newQuery","prevAttributes","perPage","Object","keys","length","Number","isFinite","children","setQuery","group","onChange","value","options","label"],"sources":["@wordpress/block-library/src/query/edit/query-content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { useEffect, useCallback } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tuseInnerBlocksProps,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport EnhancedPaginationControl from './inspector-controls/enhanced-pagination-control';\nimport { unlock } from '../../lock-unlock';\nimport QueryInspectorControls from './inspector-controls';\nimport EnhancedPaginationModal from './enhanced-pagination-modal';\nimport { getQueryContextFromTemplate } from '../utils';\nimport QueryToolbar from './query-toolbar';\n\nconst { HTMLElementControl } = unlock( blockEditorPrivateApis );\n\nconst DEFAULTS_POSTS_PER_PAGE = 3;\n\nconst TEMPLATE = [ [ 'core/post-template' ] ];\nexport default function QueryContent( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tcontext,\n\tname,\n} ) {\n\tconst {\n\t\tqueryId,\n\t\tquery,\n\t\tenhancedPagination,\n\t\ttagName: TagName = 'div',\n\t\tquery: { inherit } = {},\n\t} = attributes;\n\tconst { templateSlug } = context;\n\tconst { isSingular } = getQueryContextFromTemplate( templateSlug );\n\tconst { __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst instanceId = useInstanceId( QueryContent );\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplate: TEMPLATE,\n\t} );\n\tconst { postsPerPage } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { getEntityRecord, getEntityRecordEdits, canUser } =\n\t\t\tselect( coreStore );\n\t\tconst settingPerPage = canUser( 'read', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} )\n\t\t\t? +getEntityRecord( 'root', 'site' )?.posts_per_page\n\t\t\t: +getSettings().postsPerPage;\n\n\t\t// Gets changes made via the template area posts per page setting. These won't be saved\n\t\t// until the page is saved, but we should reflect this setting within the query loops\n\t\t// that inherit it.\n\t\tconst editedSettingPerPage = +getEntityRecordEdits( 'root', 'site' )\n\t\t\t?.posts_per_page;\n\n\t\treturn {\n\t\t\tpostsPerPage:\n\t\t\t\teditedSettingPerPage ||\n\t\t\t\tsettingPerPage ||\n\t\t\t\tDEFAULTS_POSTS_PER_PAGE,\n\t\t};\n\t}, [] );\n\t// There are some effects running where some initialization logic is\n\t// happening and setting some values to some attributes (ex. queryId).\n\t// These updates can cause an `undo trap` where undoing will result in\n\t// resetting again, so we need to mark these changes as not persistent\n\t// with `__unstableMarkNextChangeAsNotPersistent`.\n\n\t// Changes in query property (which is an object) need to be in the same callback,\n\t// because updates are batched after the render and changes in different query properties\n\t// would cause to override previous wanted changes.\n\tconst updateQuery = useCallback(\n\t\t( newQuery ) =>\n\t\t\tsetAttributes( ( prevAttributes ) => ( {\n\t\t\t\tquery: { ...prevAttributes.query, ...newQuery },\n\t\t\t} ) ),\n\t\t[ setAttributes ]\n\t);\n\tuseEffect( () => {\n\t\tconst newQuery = {};\n\t\t// When we inherit from global query always need to set the `perPage`\n\t\t// based on the reading settings.\n\t\tif ( inherit && query.perPage !== postsPerPage ) {\n\t\t\tnewQuery.perPage = postsPerPage;\n\t\t} else if ( ! query.perPage && postsPerPage ) {\n\t\t\tnewQuery.perPage = postsPerPage;\n\t\t}\n\n\t\tif ( !! Object.keys( newQuery ).length ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tupdateQuery( newQuery );\n\t\t}\n\t}, [\n\t\tquery.perPage,\n\t\tinherit,\n\t\tpostsPerPage,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tupdateQuery,\n\t] );\n\t// We need this for multi-query block pagination.\n\t// Query parameters for each block are scoped to their ID.\n\tuseEffect( () => {\n\t\tif ( ! Number.isFinite( queryId ) ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { queryId: instanceId } );\n\t\t}\n\t}, [\n\t\tqueryId,\n\t\tinstanceId,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\tsetAttributes,\n\t] );\n\n\treturn (\n\t\t<>\n\t\t\t<EnhancedPaginationModal\n\t\t\t\tattributes={ attributes }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tclientId={ clientId }\n\t\t\t/>\n\t\t\t<InspectorControls>\n\t\t\t\t<QueryInspectorControls\n\t\t\t\t\tname={ name }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetQuery={ updateQuery }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tisSingular={ isSingular }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<BlockControls>\n\t\t\t\t<QueryToolbar attributes={ attributes } clientId={ clientId } />\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<HTMLElementControl\n\t\t\t\t\ttagName={ TagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t] }\n\t\t\t\t/>\n\t\t\t\t<EnhancedPaginationControl\n\t\t\t\t\tenhancedPagination={ enhancedPagination }\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<TagName { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,SAAS,EAAEC,WAAW,QAAQ,oBAAoB;AAC3D,SACCC,aAAa,EACbC,iBAAiB,EACjBC,aAAa,EACbC,KAAK,IAAIC,gBAAgB,EACzBC,mBAAmB,EACnBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASL,KAAK,IAAIM,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,OAAOC,yBAAyB,MAAM,kDAAkD;AACxF,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,sBAAsB,MAAM,sBAAsB;AACzD,OAAOC,uBAAuB,MAAM,6BAA6B;AACjE,SAASC,2BAA2B,QAAQ,UAAU;AACtD,OAAOC,YAAY,MAAM,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAE3C,MAAM;EAAEC;AAAmB,CAAC,GAAGX,MAAM,CAAEJ,sBAAuB,CAAC;AAE/D,MAAMgB,uBAAuB,GAAG,CAAC;AAEjC,MAAMC,QAAQ,GAAG,CAAE,CAAE,oBAAoB,CAAE,CAAE;AAC7C,eAAe,SAASC,YAAYA,CAAE;EACrCC,UAAU;EACVC,aAAa;EACbC,QAAQ;EACRC,OAAO;EACPC;AACD,CAAC,EAAG;EACH,MAAM;IACLC,OAAO;IACPC,KAAK;IACLC,kBAAkB;IAClBC,OAAO,EAAEC,OAAO,GAAG,KAAK;IACxBH,KAAK,EAA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U,EAAGA,UAAY;QACzBsC,QAAQ,EAAGV,WAAa;QACxB3B,aAAa,EAAGA,aAAe;QAC/BC,QAAQ,EAAGA,QAAU;QACrBU,UAAU,EAAGA;MAAY,CACzB;IAAC,CACgB,CAAC,eACpBrB,IAAA,CAACjB,aAAa;MAAA+D,QAAA,eACb9C,IAAA,CAACF,YAAY;QAACW,UAAU,EAAGA,UAAY;QAACE,QAAQ,EAAGA;MAAU,CAAE;IAAC,CAClD,CAAC,eAChBT,KAAA,CAAClB,iBAAiB;MAACgE,KAAK,EAAC,UAAU;MAAAF,QAAA,gBAClC9C,IAAA,CAACK,kBAAkB;QAClBY,OAAO,EAAGC,OAAS;QACnB+B,QAAQ,EAAKC,KAAK,IACjBxC,aAAa,CAAE;UAAEO,OAAO,EAAEiC;QAAM,CAAE,CAClC;QACDvC,QAAQ,EAAGA,QAAU;QACrBwC,OAAO,EAAG,CACT;UAAEC,KAAK,EAAE7D,EAAE,CAAE,iBAAkB,CAAC;UAAE2D,KAAK,EAAE;QAAM,CAAC,EAChD;UAAEE,KAAK,EAAE,QAAQ;UAAEF,KAAK,EAAE;QAAO,CAAC,EAClC;UAAEE,KAAK,EAAE,WAAW;UAAEF,KAAK,EAAE;QAAU,CAAC,EACxC;UAAEE,KAAK,EAAE,SAAS;UAAEF,KAAK,EAAE;QAAQ,CAAC;MAClC,CACH,CAAC,eACFlD,IAAA,CAACP,yBAAyB;QACzBuB,kBAAkB,EAAGA,kBAAoB;QACzCN,aAAa,EAAGA,aAAe;QAC/BC,QAAQ,EAAGA;MAAU,CACrB,CAAC;IAAA,CACgB,CAAC,eACpBX,IAAA,CAACkB,OAAO;MAAA,GAAMO;IAAgB,CAAI,CAAC;EAAA,CAClC,CAAC;AAEL","ignoreList":[]}
@@ -124,7 +124,7 @@ export const settings = {
124
124
  icon,
125
125
  example: {
126
126
  attributes: {
127
- citation: 'Julio Cortázar'
127
+ citation: __('Julio Cortázar')
128
128
  },
129
129
  innerBlocks: [{
130
130
  name: 'core/paragraph',
@@ -1 +1 @@
1
- {"version":3,"names":["__","quote","icon","initBlock","deprecated","edit","metadata","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","value","type","source","selector","multiline","role","citation","textAlign","supports","anchor","align","html","background","backgroundImage","backgroundSize","__experimentalDefaultControls","__experimentalBorder","color","radius","style","width","dimensions","minHeight","__experimentalOnEnter","__experimentalOnMerge","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","gradients","heading","link","text","layout","allowEditing","spacing","blockGap","padding","margin","interactivity","clientNavigation","styles","label","isDefault","editorStyle","save","transforms","settings","example","innerBlocks","content","init"],"sources":["@wordpress/block-library/src/quote/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { quote as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcitation: 'Julio Cortázar',\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcontent: __( 'In quoting others, we cite ourselves.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,IAAI,QAAQ,kBAAkB;;AAEhD;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAC3C,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,IAAI,MAAM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WAAA;EAAA9B,KAAA;AAAA;AAE1B,OAAO+B,IAAI,MAAM,QAAQ;AACzB,OAAOC,UAAU,MAAM,cAAc;AAErC,MAAM;EAAE1D;AAAK,CAAC,GAAGH,QAAQ;AAEzB,SAASA,QAAQ,EAAEG,IAAI;AAEvB,OAAO,MAAM2D,QAAQ,GAAG;EACvBlE,IAAI;EACJmE,OAAO,EAAE;IACRtD,UAAU,EAAE;MACXO,QAAQ,EAAE;IACX,CAAC;IACDgD,WAAW,EAAE,CACZ;MACC7D,IAAI,EAAE,gBAAgB;MACtBM,UAAU,EAAE;QACXwD,OAAO,EAAEvE,EAAE,CAAE,uCAAwC;MACtD;IACD,CAAC;EAEH,CAAC;EACDmE,UAAU;EACV9D,IAAI;EACJ6D,IAAI;EACJ9D;AACD,CAAC;AAED,OAAO,MAAMoE,IAAI,GAAGA,CAAA,KAAMrE,SAAS,CAAE;EAAEM,IAAI;EAAEH,QAAQ;EAAE8D;AAAS,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__","quote","icon","initBlock","deprecated","edit","metadata","$schema","apiVersion","name","title","category","description","keywords","textdomain","attributes","value","type","source","selector","multiline","role","citation","textAlign","supports","anchor","align","html","background","backgroundImage","backgroundSize","__experimentalDefaultControls","__experimentalBorder","color","radius","style","width","dimensions","minHeight","__experimentalOnEnter","__experimentalOnMerge","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","gradients","heading","link","text","layout","allowEditing","spacing","blockGap","padding","margin","interactivity","clientNavigation","styles","label","isDefault","editorStyle","save","transforms","settings","example","innerBlocks","content","init"],"sources":["@wordpress/block-library/src/quote/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { quote as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcitation: __( 'Julio Cortázar' ),\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcontent: __( 'In quoting others, we cite ourselves.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,IAAI,QAAQ,kBAAkB;;AAEhD;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAC3C,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,IAAI,MAAM,QAAQ;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,KAAA;MAAAC,IAAA;MAAAC,MAAA;MAAAC,QAAA;MAAAC,SAAA;MAAA;MAAAC,IAAA;IAAA;IAAAC,QAAA;MAAAL,IAAA;MAAAC,MAAA;MAAAC,QAAA;MAAAE,IAAA;IAAA;IAAAE,SAAA;MAAAN,IAAA;IAAA;EAAA;EAAAO,QAAA;IAAAC,MAAA;IAAAC,KAAA;IAAAC,IAAA;IAAAC,UAAA;MAAAC,eAAA;MAAAC,cAAA;MAAAC,6BAAA;QAAAF,eAAA;MAAA;IAAA;IAAAG,oBAAA;MAAAC,KAAA;MAAAC,MAAA;MAAAC,KAAA;MAAAC,KAAA;MAAAL,6BAAA;QAAAE,KAAA;QAAAC,MAAA;QAAAC,KAAA;QAAAC,KAAA;MAAA;IAAA;IAA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ignoreList":[]}
@@ -6,19 +6,23 @@ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { HorizontalRule, SelectControl } from '@wordpress/components';
10
- import { useBlockProps, getColorClassName, __experimentalUseColorProps as useColorProps, InspectorControls } from '@wordpress/block-editor';
9
+ import { HorizontalRule } from '@wordpress/components';
10
+ import { useBlockProps, getColorClassName, __experimentalUseColorProps as useColorProps, InspectorControls, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
11
11
  import { __ } from '@wordpress/i18n';
12
12
 
13
13
  /**
14
14
  * Internal dependencies
15
15
  */
16
16
  import useDeprecatedOpacity from './use-deprecated-opacity';
17
- import { htmlElementMessages } from '../utils/messages';
17
+ import { unlock } from '../lock-unlock';
18
18
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
19
+ const {
20
+ HTMLElementControl
21
+ } = unlock(blockEditorPrivateApis);
19
22
  export default function SeparatorEdit({
20
23
  attributes,
21
- setAttributes
24
+ setAttributes,
25
+ clientId
22
26
  }) {
23
27
  const {
24
28
  backgroundColor,
@@ -48,22 +52,19 @@ export default function SeparatorEdit({
48
52
  return /*#__PURE__*/_jsxs(_Fragment, {
49
53
  children: [/*#__PURE__*/_jsx(InspectorControls, {
50
54
  group: "advanced",
51
- children: /*#__PURE__*/_jsx(SelectControl, {
52
- __nextHasNoMarginBottom: true,
53
- __next40pxDefaultSize: true,
54
- label: __('HTML element'),
55
+ children: /*#__PURE__*/_jsx(HTMLElementControl, {
56
+ tagName: tagName,
57
+ onChange: value => setAttributes({
58
+ tagName: value
59
+ }),
60
+ clientId: clientId,
55
61
  options: [{
56
62
  label: __('Default (<hr>)'),
57
63
  value: 'hr'
58
64
  }, {
59
65
  label: '<div>',
60
66
  value: 'div'
61
- }],
62
- value: tagName,
63
- onChange: value => setAttributes({
64
- tagName: value
65
- }),
66
- help: htmlElementMessages[tagName]
67
+ }]
67
68
  })
68
69
  }), /*#__PURE__*/_jsx(Wrapper, {
69
70
  ...useBlockProps({
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","HorizontalRule","SelectControl","useBlockProps","getColorClassName","__experimentalUseColorProps","useColorProps","InspectorControls","__","useDeprecatedOpacity","htmlElementMessages","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","SeparatorEdit","attributes","setAttributes","backgroundColor","opacity","style","tagName","colorProps","currentColor","hasCustomColor","color","background","colorClass","className","styles","Wrapper","children","group","__nextHasNoMarginBottom","__next40pxDefaultSize","label","options","value","onChange","help","undefined"],"sources":["@wordpress/block-library/src/separator/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { HorizontalRule, SelectControl } from '@wordpress/components';\nimport {\n\tuseBlockProps,\n\tgetColorClassName,\n\t__experimentalUseColorProps as useColorProps,\n\tInspectorControls,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useDeprecatedOpacity from './use-deprecated-opacity';\nimport { htmlElementMessages } from '../utils/messages';\n\nexport default function SeparatorEdit( { attributes, setAttributes } ) {\n\tconst { backgroundColor, opacity, style, tagName } = attributes;\n\tconst colorProps = useColorProps( attributes );\n\tconst currentColor = colorProps?.style?.backgroundColor;\n\tconst hasCustomColor = !! style?.color?.background;\n\n\tuseDeprecatedOpacity( opacity, currentColor, setAttributes );\n\n\t// The dots styles uses text for the dots, to change those dots color is\n\t// using color, not backgroundColor.\n\tconst colorClass = getColorClassName( 'color', backgroundColor );\n\n\tconst className = clsx(\n\t\t{\n\t\t\t'has-text-color': backgroundColor || currentColor,\n\t\t\t[ colorClass ]: colorClass,\n\t\t\t'has-css-opacity': opacity === 'css',\n\t\t\t'has-alpha-channel-opacity': opacity === 'alpha-channel',\n\t\t},\n\t\tcolorProps.className\n\t);\n\n\tconst styles = {\n\t\tcolor: currentColor,\n\t\tbackgroundColor: currentColor,\n\t};\n\tconst Wrapper = tagName === 'hr' ? HorizontalRule : tagName;\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<hr>)' ), value: 'hr' },\n\t\t\t\t\t\t{ label: '<div>', value: 'div' },\n\t\t\t\t\t] }\n\t\t\t\t\tvalue={ tagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ htmlElementMessages[ tagName ] }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<Wrapper\n\t\t\t\t{ ...useBlockProps( {\n\t\t\t\t\tclassName,\n\t\t\t\t\tstyle: hasCustomColor ? styles : undefined,\n\t\t\t\t} ) }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,cAAc,EAAEC,aAAa,QAAQ,uBAAuB;AACrE,SACCC,aAAa,EACbC,iBAAiB,EACjBC,2BAA2B,IAAIC,aAAa,EAC5CC,iBAAiB,QACX,yBAAyB;AAChC,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,SAASC,mBAAmB,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAExD,eAAe,SAASC,aAAaA,CAAE;EAAEC,UAAU;EAAEC;AAAc,CAAC,EAAG;EACtE,MAAM;IAAEC,eAAe;IAAEC,OAAO;IAAEC,KAAK;IAAEC;EAAQ,CAAC,GAAGL,UAAU;EAC/D,MAAMM,UAAU,GAAG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,CAAEa,OAAO;MAAI,CACvC;IAAC,CACgB,CAAC,eACpBX,IAAA,CAACoB,OAAO;MAAA,GACF7B,aAAa,CAAE;QACnB2B,SAAS;QACTR,KAAK,EAAEI,cAAc,GAAGK,MAAM,GAAGW;MAClC,CAAE;IAAC,CACH,CAAC;EAAA,CACD,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["clsx","HorizontalRule","useBlockProps","getColorClassName","__experimentalUseColorProps","useColorProps","InspectorControls","privateApis","blockEditorPrivateApis","__","useDeprecatedOpacity","unlock","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","HTMLElementControl","SeparatorEdit","attributes","setAttributes","clientId","backgroundColor","opacity","style","tagName","colorProps","currentColor","hasCustomColor","color","background","colorClass","className","styles","Wrapper","children","group","onChange","value","options","label","undefined"],"sources":["@wordpress/block-library/src/separator/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { HorizontalRule } from '@wordpress/components';\nimport {\n\tuseBlockProps,\n\tgetColorClassName,\n\t__experimentalUseColorProps as useColorProps,\n\tInspectorControls,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useDeprecatedOpacity from './use-deprecated-opacity';\nimport { unlock } from '../lock-unlock';\n\nconst { HTMLElementControl } = unlock( blockEditorPrivateApis );\n\nexport default function SeparatorEdit( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst { backgroundColor, opacity, style, tagName } = attributes;\n\tconst colorProps = useColorProps( attributes );\n\tconst currentColor = colorProps?.style?.backgroundColor;\n\tconst hasCustomColor = !! style?.color?.background;\n\n\tuseDeprecatedOpacity( opacity, currentColor, setAttributes );\n\n\t// The dots styles uses text for the dots, to change those dots color is\n\t// using color, not backgroundColor.\n\tconst colorClass = getColorClassName( 'color', backgroundColor );\n\n\tconst className = clsx(\n\t\t{\n\t\t\t'has-text-color': backgroundColor || currentColor,\n\t\t\t[ colorClass ]: colorClass,\n\t\t\t'has-css-opacity': opacity === 'css',\n\t\t\t'has-alpha-channel-opacity': opacity === 'alpha-channel',\n\t\t},\n\t\tcolorProps.className\n\t);\n\n\tconst styles = {\n\t\tcolor: currentColor,\n\t\tbackgroundColor: currentColor,\n\t};\n\tconst Wrapper = tagName === 'hr' ? HorizontalRule : tagName;\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<HTMLElementControl\n\t\t\t\t\ttagName={ tagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<hr>)' ), value: 'hr' },\n\t\t\t\t\t\t{ label: '<div>', value: 'div' },\n\t\t\t\t\t] }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t<Wrapper\n\t\t\t\t{ ...useBlockProps( {\n\t\t\t\t\tclassName,\n\t\t\t\t\tstyle: hasCustomColor ? styles : undefined,\n\t\t\t\t} ) }\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,cAAc,QAAQ,uBAAuB;AACtD,SACCC,aAAa,EACbC,iBAAiB,EACjBC,2BAA2B,IAAIC,aAAa,EAC5CC,iBAAiB,EACjBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,SAASC,MAAM,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAExC,MAAM;EAAEC;AAA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AG,CACT;UAAEC,KAAK,EAAEhC,EAAE,CAAE,gBAAiB,CAAC;UAAE8B,KAAK,EAAE;QAAK,CAAC,EAC9C;UAAEE,KAAK,EAAE,OAAO;UAAEF,KAAK,EAAE;QAAM,CAAC;MAC9B,CACH;IAAC,CACgB,CAAC,eACpB1B,IAAA,CAACsB,OAAO;MAAA,GACFjC,aAAa,CAAE;QACnB+B,SAAS;QACTR,KAAK,EAAEI,cAAc,GAAGK,MAAM,GAAGQ;MAClC,CAAE;IAAC,CACH,CAAC;EAAA,CACD,CAAC;AAEL","ignoreList":[]}
@@ -6,7 +6,7 @@ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { useEffect, useRef } from '@wordpress/element';
9
+ import { useEffect } from '@wordpress/element';
10
10
  import { BlockControls, useInnerBlocksProps, useBlockProps, InspectorControls, ContrastChecker, withColors, InnerBlocks, __experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown, __experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients, store as blockEditorStore } from '@wordpress/block-editor';
11
11
  import { MenuGroup, MenuItem, ToggleControl, ToolbarDropdownMenu, __experimentalToolsPanel as ToolsPanel, __experimentalToolsPanelItem as ToolsPanelItem } from '@wordpress/components';
12
12
  import { __ } from '@wordpress/i18n';
@@ -45,51 +45,50 @@ export function SocialLinksEdit(props) {
45
45
  } = props;
46
46
  const {
47
47
  iconBackgroundColorValue,
48
- customIconBackgroundColor,
49
48
  iconColorValue,
50
49
  openInNewTab,
51
50
  showLabels,
52
51
  size
53
52
  } = attributes;
54
- const hasSelectedChild = useSelect(select => select(blockEditorStore).hasSelectedInnerBlock(clientId), [clientId]);
53
+ const {
54
+ hasSocialIcons,
55
+ hasSelectedChild
56
+ } = useSelect(select => {
57
+ const {
58
+ getBlockCount,
59
+ hasSelectedInnerBlock
60
+ } = select(blockEditorStore);
61
+ return {
62
+ hasSocialIcons: getBlockCount(clientId) > 0,
63
+ hasSelectedChild: hasSelectedInnerBlock(clientId)
64
+ };
65
+ }, [clientId]);
55
66
  const hasAnySelected = isSelected || hasSelectedChild;
56
67
  const logosOnly = attributes.className?.includes('is-style-logos-only');
57
68
  const dropdownMenuProps = useToolsPanelDropdownMenuProps();
58
69
 
59
70
  // Remove icon background color when logos only style is selected or
60
71
  // restore it when any other style is selected.
61
- const backgroundBackupRef = useRef({});
62
72
  useEffect(() => {
63
73
  if (logosOnly) {
64
- backgroundBackupRef.current = {
65
- iconBackgroundColor,
66
- iconBackgroundColorValue,
67
- customIconBackgroundColor
68
- };
69
- setAttributes({
70
- iconBackgroundColor: undefined,
71
- customIconBackgroundColor: undefined,
72
- iconBackgroundColorValue: undefined
74
+ let restore;
75
+ setAttributes(prev => {
76
+ restore = {
77
+ iconBackgroundColor: prev.iconBackgroundColor,
78
+ iconBackgroundColorValue: prev.iconBackgroundColorValue,
79
+ customIconBackgroundColor: prev.customIconBackgroundColor
80
+ };
81
+ return {
82
+ iconBackgroundColor: undefined,
83
+ iconBackgroundColorValue: undefined,
84
+ customIconBackgroundColor: undefined
85
+ };
73
86
  });
74
- } else {
75
- setAttributes({
76
- ...backgroundBackupRef.current
87
+ return () => setAttributes({
88
+ ...restore
77
89
  });
78
90
  }
79
- }, [logosOnly]);
80
- const SocialPlaceholder = /*#__PURE__*/_jsx("li", {
81
- className: "wp-block-social-links__social-placeholder",
82
- children: /*#__PURE__*/_jsxs("div", {
83
- className: "wp-block-social-links__social-placeholder-icons",
84
- children: [/*#__PURE__*/_jsx("div", {
85
- className: "wp-social-link wp-social-link-twitter"
86
- }), /*#__PURE__*/_jsx("div", {
87
- className: "wp-social-link wp-social-link-facebook"
88
- }), /*#__PURE__*/_jsx("div", {
89
- className: "wp-social-link wp-social-link-instagram"
90
- })]
91
- })
92
- });
91
+ }, [logosOnly, setAttributes]);
93
92
 
94
93
  // Fallback color values are used maintain selections in case switching
95
94
  // themes and named colors in palette do not match.
@@ -102,11 +101,10 @@ export function SocialLinksEdit(props) {
102
101
  className
103
102
  });
104
103
  const innerBlocksProps = useInnerBlocksProps(blockProps, {
105
- placeholder: !isSelected && SocialPlaceholder,
106
104
  templateLock: false,
107
105
  orientation: (_attributes$layout$or = attributes.layout?.orientation) !== null && _attributes$layout$or !== void 0 ? _attributes$layout$or : 'horizontal',
108
106
  __experimentalAppenderTagName: 'li',
109
- renderAppender: hasAnySelected && InnerBlocks.ButtonBlockAppender
107
+ renderAppender: !hasSocialIcons || hasAnySelected ? InnerBlocks.ButtonBlockAppender : undefined
110
108
  });
111
109
  const POPOVER_PROPS = {
112
110
  position: 'bottom right'
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","useEffect","useRef","BlockControls","useInnerBlocksProps","useBlockProps","InspectorControls","ContrastChecker","withColors","InnerBlocks","__experimentalColorGradientSettingsDropdown","ColorGradientSettingsDropdown","__experimentalUseMultipleOriginColorsAndGradients","useMultipleOriginColorsAndGradients","store","blockEditorStore","MenuGroup","MenuItem","ToggleControl","ToolbarDropdownMenu","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__","check","useSelect","useToolsPanelDropdownMenuProps","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","sizeOptions","name","value","SocialLinksEdit","props","_attributes$layout$or","clientId","attributes","iconBackgroundColor","iconColor","isSelected","setAttributes","setIconBackgroundColor","setIconColor","iconBackgroundColorValue","customIconBackgroundColor","iconColorValue","openInNewTab","showLabels","size","hasSelectedChild","select","hasSelectedInnerBlock","hasAnySelected","logosOnly","className","includes","dropdownMenuProps","backgroundBackupRef","current","undefined","SocialPlaceholder","children","color","blockProps","innerBlocksProps","placeholder","templateLock","orientation","layout","__experimentalAppenderTagName","renderAppender","ButtonBlockAppender","POPOVER_PROPS","position","colorSettings","onChange","colorValue","label","resetAllFilter","push","colorGradientSettings","group","text","icon","popoverProps","onClose","map","entry","onClick","role","resetAll","isShownByDefault","hasValue","onDeselect","__nextHasNoMarginBottom","checked","hasColorsOrGradients","__experimentalIsRenderedInSidebar","settings","onColorChange","enableAlpha","clearable","panelId","textColor","backgroundColor","isLargeText","iconColorAttributes"],"sources":["@wordpress/block-library/src/social-links/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tuseInnerBlocksProps,\n\tuseBlockProps,\n\tInspectorControls,\n\tContrastChecker,\n\twithColors,\n\tInnerBlocks,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tToggleControl,\n\tToolbarDropdownMenu,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst sizeOptions = [\n\t{ name: __( 'Small' ), value: 'has-small-icon-size' },\n\t{ name: __( 'Normal' ), value: 'has-normal-icon-size' },\n\t{ name: __( 'Large' ), value: 'has-large-icon-size' },\n\t{ name: __( 'Huge' ), value: 'has-huge-icon-size' },\n];\n\nexport function SocialLinksEdit( props ) {\n\tconst {\n\t\tclientId,\n\t\tattributes,\n\t\ticonBackgroundColor,\n\t\ticonColor,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tsetIconBackgroundColor,\n\t\tsetIconColor,\n\t} = props;\n\n\tconst {\n\t\ticonBackgroundColorValue,\n\t\tcustomIconBackgroundColor,\n\t\ticonColorValue,\n\t\topenInNewTab,\n\t\tshowLabels,\n\t\tsize,\n\t} = attributes;\n\n\tconst hasSelectedChild = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).hasSelectedInnerBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\n\tconst hasAnySelected = isSelected || hasSelectedChild;\n\n\tconst logosOnly = attributes.className?.includes( 'is-style-logos-only' );\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\t// Remove icon background color when logos only style is selected or\n\t// restore it when any other style is selected.\n\tconst backgroundBackupRef = useRef( {} );\n\tuseEffect( () => {\n\t\tif ( logosOnly ) {\n\t\t\tbackgroundBackupRef.current = {\n\t\t\t\ticonBackgroundColor,\n\t\t\t\ticonBackgroundColorValue,\n\t\t\t\tcustomIconBackgroundColor,\n\t\t\t};\n\t\t\tsetAttributes( {\n\t\t\t\ticonBackgroundColor: undefined,\n\t\t\t\tcustomIconBackgroundColor: undefined,\n\t\t\t\ticonBackgroundColorValue: undefined,\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( { ...backgroundBackupRef.current } );\n\t\t}\n\t}, [ logosOnly ] );\n\n\tconst SocialPlaceholder = (\n\t\t<li className=\"wp-block-social-links__social-placeholder\">\n\t\t\t<div className=\"wp-block-social-links__social-placeholder-icons\">\n\t\t\t\t<div className=\"wp-social-link wp-social-link-twitter\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-facebook\"></div>\n\t\t\t\t<div className=\"wp-social-link wp-social-link-instagram\"></div>\n\t\t\t</div>\n\t\t</li>\n\t);\n\n\t// Fallback color values are used maintain selections in case switching\n\t// themes and named colors in palette do not match.\n\tconst className = clsx( size, {\n\t\t'has-visible-labels': showLabels,\n\t\t'has-icon-color': iconColor.color || iconColorValue,\n\t\t'has-icon-background-color':\n\t\t\ticonBackgroundColor.color || iconBackgroundColorValue,\n\t} );\n\n\tconst blockProps = useBlockProps( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tplaceholder: ! isSelected && SocialPlaceholder,\n\t\ttemplateLock: false,\n\t\torientation: attributes.layout?.orientation ?? 'horizontal',\n\t\t__experimentalAppenderTagName: 'li',\n\t\trenderAppender: hasAnySelected && InnerBlocks.ButtonBlockAppender,\n\t} );\n\n\tconst POPOVER_PROPS = {\n\t\tposition: 'bottom right',\n\t};\n\n\tconst colorSettings = [\n\t\t{\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconColor.color || iconColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconColor( colorValue );\n\t\t\t\tsetAttributes( { iconColorValue: colorValue } );\n\t\t\t},\n\t\t\tlabel: __( 'Icon color' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconColor( undefined );\n\t\t\t\tsetAttributes( { iconColorValue: undefined } );\n\t\t\t},\n\t\t},\n\t];\n\n\tif ( ! logosOnly ) {\n\t\tcolorSettings.push( {\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconBackgroundColor.color || iconBackgroundColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconBackgroundColor( colorValue );\n\t\t\t\tsetAttributes( {\n\t\t\t\t\ticonBackgroundColorValue: colorValue,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tlabel: __( 'Icon background' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconBackgroundColor( undefined );\n\t\t\t\tsetAttributes( { iconBackgroundColorValue: undefined } );\n\t\t\t},\n\t\t} );\n\t}\n\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\ttext={ __( 'Size' ) }\n\t\t\t\t\ticon={ null }\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ sizeOptions.map( ( entry ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t( size === entry.value ||\n\t\t\t\t\t\t\t\t\t\t\t\t( ! size &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tentry.value ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'has-normal-icon-size' ) ) &&\n\t\t\t\t\t\t\t\t\t\t\tcheck\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisSelected={ size === entry.value }\n\t\t\t\t\t\t\t\t\t\tkey={ entry.value }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\tsize: entry.value,\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ entry.name }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\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\topenInNewTab: false,\n\t\t\t\t\t\t\tshowLabels: false,\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\tisShownByDefault\n\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\thasValue={ () => !! openInNewTab }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { openInNewTab: false } )\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={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\t\tchecked={ openInNewTab }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\topenInNewTab: ! openInNewTab,\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</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\tlabel={ __( 'Show text' ) }\n\t\t\t\t\t\thasValue={ () => !! showLabels }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showLabels: false } )\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={ __( 'Show text' ) }\n\t\t\t\t\t\t\tchecked={ showLabels }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showLabels: ! showLabels } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t{ colorGradientSettings.hasColorsOrGradients && (\n\t\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t\t{ colorSettings.map(\n\t\t\t\t\t\t( { onChange, label, value, resetAllFilter } ) => (\n\t\t\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t\t\tkey={ `social-links-color-${ label }` }\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t\tsettings={ [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcolorValue: value,\n\t\t\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\t\t\tonColorChange: onChange,\n\t\t\t\t\t\t\t\t\t\tisShownByDefault: true,\n\t\t\t\t\t\t\t\t\t\tresetAllFilter,\n\t\t\t\t\t\t\t\t\t\tenableAlpha: true,\n\t\t\t\t\t\t\t\t\t\tclearable: true,\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\tpanelId={ clientId }\n\t\t\t\t\t\t\t\t{ ...colorGradientSettings }\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{ ! logosOnly && (\n\t\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\ttextColor: iconColorValue,\n\t\t\t\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisLargeText={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<ul { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n\nconst iconColorAttributes = {\n\ticonColor: 'icon-color',\n\ticonBackgroundColor: 'icon-background-color',\n};\n\nexport default withColors( iconColorAttributes )( SocialLinksEdit );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AACtD,SACCC,aAAa,EACbC,mBAAmB,EACnBC,aAAa,EACbC,iBAAiB,EACjBC,eAAe,EACfC,UAAU,EACVC,WAAW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AAC,EAClBiC,qBAAqB,CAACgB,oBAAoB,iBAC3CtE,KAAA,CAACzB,iBAAiB;MAACgF,KAAK,EAAC,OAAO;MAAApB,QAAA,GAC7Ba,aAAa,CAACY,GAAG,CAClB,CAAE;QAAEX,QAAQ;QAAEE,KAAK;QAAE9C,KAAK;QAAE+C;MAAe,CAAC,kBAC3CtD,IAAA,CAAClB,6BAA6B;QAE7B2F,iCAAiC;QACjCC,QAAQ,EAAG,CACV;UACCtB,UAAU,EAAE7C,KAAK;UACjB8C,KAAK;UACLsB,aAAa,EAAExB,QAAQ;UACvBgB,gBAAgB,EAAE,IAAI;UACtBb,cAAc;UACdsB,WAAW,EAAE,IAAI;UACjBC,SAAS,EAAE;QACZ,CAAC,CACC;QACHC,OAAO,EAAGnE,QAAU;QAAA,GACf6C;MAAqB,GAdpB,sBAAuBH,KAAK,EAelC,CAEH,CAAC,EACC,CAAExB,SAAS,iBACZ7B,IAAA,CAACtB,eAAe;QAEdqG,SAAS,EAAE1D,cAAc;QACzB2D,eAAe,EAAE7D,wBAAwB;QAE1C8D,WAAW,EAAG;MAAO,CACrB,CACD;IAAA,CACiB,CACnB,eACDjF,IAAA;MAAA,GAASwC;IAAgB,CAAI,CAAC;EAAA,CAC7B,CAAC;AAEL;AAEA,MAAM0C,mBAAmB,GAAG;EAC3BpE,SAAS,EAAE,YAAY;EACvBD,mBAAmB,EAAE;AACtB,CAAC;AAED,eAAelC,UAAU,CAAEuG,mBAAoB,CAAC,CAAE1E,eAAgB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["clsx","useEffect","BlockControls","useInnerBlocksProps","useBlockProps","InspectorControls","ContrastChecker","withColors","InnerBlocks","__experimentalColorGradientSettingsDropdown","ColorGradientSettingsDropdown","__experimentalUseMultipleOriginColorsAndGradients","useMultipleOriginColorsAndGradients","store","blockEditorStore","MenuGroup","MenuItem","ToggleControl","ToolbarDropdownMenu","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__","check","useSelect","useToolsPanelDropdownMenuProps","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","sizeOptions","name","value","SocialLinksEdit","props","_attributes$layout$or","clientId","attributes","iconBackgroundColor","iconColor","isSelected","setAttributes","setIconBackgroundColor","setIconColor","iconBackgroundColorValue","iconColorValue","openInNewTab","showLabels","size","hasSocialIcons","hasSelectedChild","select","getBlockCount","hasSelectedInnerBlock","hasAnySelected","logosOnly","className","includes","dropdownMenuProps","restore","prev","customIconBackgroundColor","undefined","color","blockProps","innerBlocksProps","templateLock","orientation","layout","__experimentalAppenderTagName","renderAppender","ButtonBlockAppender","POPOVER_PROPS","position","colorSettings","onChange","colorValue","label","resetAllFilter","push","colorGradientSettings","children","group","text","icon","popoverProps","onClose","map","entry","onClick","role","resetAll","isShownByDefault","hasValue","onDeselect","__nextHasNoMarginBottom","checked","hasColorsOrGradients","__experimentalIsRenderedInSidebar","settings","onColorChange","enableAlpha","clearable","panelId","textColor","backgroundColor","isLargeText","iconColorAttributes"],"sources":["@wordpress/block-library/src/social-links/edit.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tBlockControls,\n\tuseInnerBlocksProps,\n\tuseBlockProps,\n\tInspectorControls,\n\tContrastChecker,\n\twithColors,\n\tInnerBlocks,\n\t__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,\n\t__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tToggleControl,\n\tToolbarDropdownMenu,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst sizeOptions = [\n\t{ name: __( 'Small' ), value: 'has-small-icon-size' },\n\t{ name: __( 'Normal' ), value: 'has-normal-icon-size' },\n\t{ name: __( 'Large' ), value: 'has-large-icon-size' },\n\t{ name: __( 'Huge' ), value: 'has-huge-icon-size' },\n];\n\nexport function SocialLinksEdit( props ) {\n\tconst {\n\t\tclientId,\n\t\tattributes,\n\t\ticonBackgroundColor,\n\t\ticonColor,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tsetIconBackgroundColor,\n\t\tsetIconColor,\n\t} = props;\n\n\tconst {\n\t\ticonBackgroundColorValue,\n\t\ticonColorValue,\n\t\topenInNewTab,\n\t\tshowLabels,\n\t\tsize,\n\t} = attributes;\n\n\tconst { hasSocialIcons, hasSelectedChild } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockCount, hasSelectedInnerBlock } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn {\n\t\t\t\thasSocialIcons: getBlockCount( clientId ) > 0,\n\t\t\t\thasSelectedChild: hasSelectedInnerBlock( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst hasAnySelected = isSelected || hasSelectedChild;\n\n\tconst logosOnly = attributes.className?.includes( 'is-style-logos-only' );\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\t// Remove icon background color when logos only style is selected or\n\t// restore it when any other style is selected.\n\tuseEffect( () => {\n\t\tif ( logosOnly ) {\n\t\t\tlet restore;\n\t\t\tsetAttributes( ( prev ) => {\n\t\t\t\trestore = {\n\t\t\t\t\ticonBackgroundColor: prev.iconBackgroundColor,\n\t\t\t\t\ticonBackgroundColorValue: prev.iconBackgroundColorValue,\n\t\t\t\t\tcustomIconBackgroundColor: prev.customIconBackgroundColor,\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\ticonBackgroundColor: undefined,\n\t\t\t\t\ticonBackgroundColorValue: undefined,\n\t\t\t\t\tcustomIconBackgroundColor: undefined,\n\t\t\t\t};\n\t\t\t} );\n\n\t\t\treturn () => setAttributes( { ...restore } );\n\t\t}\n\t}, [ logosOnly, setAttributes ] );\n\n\t// Fallback color values are used maintain selections in case switching\n\t// themes and named colors in palette do not match.\n\tconst className = clsx( size, {\n\t\t'has-visible-labels': showLabels,\n\t\t'has-icon-color': iconColor.color || iconColorValue,\n\t\t'has-icon-background-color':\n\t\t\ticonBackgroundColor.color || iconBackgroundColorValue,\n\t} );\n\n\tconst blockProps = useBlockProps( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\ttemplateLock: false,\n\t\torientation: attributes.layout?.orientation ?? 'horizontal',\n\t\t__experimentalAppenderTagName: 'li',\n\t\trenderAppender:\n\t\t\t! hasSocialIcons || hasAnySelected\n\t\t\t\t? InnerBlocks.ButtonBlockAppender\n\t\t\t\t: undefined,\n\t} );\n\n\tconst POPOVER_PROPS = {\n\t\tposition: 'bottom right',\n\t};\n\n\tconst colorSettings = [\n\t\t{\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconColor.color || iconColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconColor( colorValue );\n\t\t\t\tsetAttributes( { iconColorValue: colorValue } );\n\t\t\t},\n\t\t\tlabel: __( 'Icon color' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconColor( undefined );\n\t\t\t\tsetAttributes( { iconColorValue: undefined } );\n\t\t\t},\n\t\t},\n\t];\n\n\tif ( ! logosOnly ) {\n\t\tcolorSettings.push( {\n\t\t\t// Use custom attribute as fallback to prevent loss of named color selection when\n\t\t\t// switching themes to a new theme that does not have a matching named color.\n\t\t\tvalue: iconBackgroundColor.color || iconBackgroundColorValue,\n\t\t\tonChange: ( colorValue ) => {\n\t\t\t\tsetIconBackgroundColor( colorValue );\n\t\t\t\tsetAttributes( {\n\t\t\t\t\ticonBackgroundColorValue: colorValue,\n\t\t\t\t} );\n\t\t\t},\n\t\t\tlabel: __( 'Icon background' ),\n\t\t\tresetAllFilter: () => {\n\t\t\t\tsetIconBackgroundColor( undefined );\n\t\t\t\tsetAttributes( { iconBackgroundColorValue: undefined } );\n\t\t\t},\n\t\t} );\n\t}\n\n\tconst colorGradientSettings = useMultipleOriginColorsAndGradients();\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"other\">\n\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\ttext={ __( 'Size' ) }\n\t\t\t\t\ticon={ null }\n\t\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t\t>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ sizeOptions.map( ( entry ) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\t\t( size === entry.value ||\n\t\t\t\t\t\t\t\t\t\t\t\t( ! size &&\n\t\t\t\t\t\t\t\t\t\t\t\t\tentry.value ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'has-normal-icon-size' ) ) &&\n\t\t\t\t\t\t\t\t\t\t\tcheck\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tisSelected={ size === entry.value }\n\t\t\t\t\t\t\t\t\t\tkey={ entry.value }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\t\tsize: entry.value,\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ entry.name }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\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\topenInNewTab: false,\n\t\t\t\t\t\t\tshowLabels: false,\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\tisShownByDefault\n\t\t\t\t\t\tlabel={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\thasValue={ () => !! openInNewTab }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { openInNewTab: false } )\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={ __( 'Open links in new tab' ) }\n\t\t\t\t\t\t\tchecked={ openInNewTab }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\topenInNewTab: ! openInNewTab,\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</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\tlabel={ __( 'Show text' ) }\n\t\t\t\t\t\thasValue={ () => !! showLabels }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { showLabels: false } )\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={ __( 'Show text' ) }\n\t\t\t\t\t\t\tchecked={ showLabels }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { showLabels: ! showLabels } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t{ colorGradientSettings.hasColorsOrGradients && (\n\t\t\t\t<InspectorControls group=\"color\">\n\t\t\t\t\t{ colorSettings.map(\n\t\t\t\t\t\t( { onChange, label, value, resetAllFilter } ) => (\n\t\t\t\t\t\t\t<ColorGradientSettingsDropdown\n\t\t\t\t\t\t\t\tkey={ `social-links-color-${ label }` }\n\t\t\t\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t\t\t\t\tsettings={ [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tcolorValue: value,\n\t\t\t\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t\t\t\t\tonColorChange: onChange,\n\t\t\t\t\t\t\t\t\t\tisShownByDefault: true,\n\t\t\t\t\t\t\t\t\t\tresetAllFilter,\n\t\t\t\t\t\t\t\t\t\tenableAlpha: true,\n\t\t\t\t\t\t\t\t\t\tclearable: true,\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\tpanelId={ clientId }\n\t\t\t\t\t\t\t\t{ ...colorGradientSettings }\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{ ! logosOnly && (\n\t\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\ttextColor: iconColorValue,\n\t\t\t\t\t\t\t\tbackgroundColor: iconBackgroundColorValue,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisLargeText={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<ul { ...innerBlocksProps } />\n\t\t</>\n\t);\n}\n\nconst iconColorAttributes = {\n\ticonColor: 'icon-color',\n\ticonBackgroundColor: 'icon-background-color',\n};\n\nexport default withColors( iconColorAttributes )( SocialLinksEdit );\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SACCC,aAAa,EACbC,mBAAmB,EACnBC,aAAa,EACbC,iBAAiB,EACjBC,eAAe,EACfC,UAAU,EACVC,WAAW,EACXC,2CAA2C,IAAIC,6BAA6B,EAC5EC,iDAAiD,IAAIC,mCAAmC,EACxFC,KAAK,IAAIC,gBAAgB,QACnB,yBAAyB;AAChC,SACCC,SAAS,EACTC,QAAQ,EACRC,aAAa,EACbC,mBAAmB,EACnBC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,QAAQ,kBAAkB;AACxC,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,8BAA8B,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAEhE,MAAMC,WAAW,GAAG,CACnB;EAAEC,IAAI,EAAEX,EAAE,CAAE,OAAQ,CAAC;EAAEY,KAAK,EAAE;AAAsB,CAAC,EACrD;EAAED,IAAI,EAAEX,EAAE,CAAE,QAAS,CAAC;EAAEY,KAAK,EAAE;AAAuB,CAAC,EACvD;EAAED,IAAI,EAAEX,EAAE,CAAE,OAAQ,CAAC;EAAEY,KAAK,EAAE;A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;AACtB,CAAC;AAED,eAAelC,UAAU,CAAEuG,mBAAoB,CAAC,CAAE1E,eAAgB,CAAC","ignoreList":[]}
@@ -253,7 +253,7 @@ export const settings = {
253
253
  content: '5.2',
254
254
  tag: 'td'
255
255
  }, {
256
- content: 'Jaco Pastorius',
256
+ content: __('Jaco Pastorius'),
257
257
  tag: 'td'
258
258
  }, {
259
259
  content: __('May 7, 2019'),
@@ -264,7 +264,7 @@ export const settings = {
264
264
  content: '5.1',
265
265
  tag: 'td'
266
266
  }, {
267
- content: 'Betty Carter',
267
+ content: __('Betty Carter'),
268
268
  tag: 'td'
269
269
  }, {
270
270
  content: __('February 21, 2019'),
@@ -275,7 +275,7 @@ export const settings = {
275
275
  content: '5.0',
276
276
  tag: 'td'
277
277
  }, {
278
- content: 'Bebo Valdés',
278
+ content: __('Bebo Valdés'),
279
279
  tag: 'td'
280
280
  }, {
281
281
  content: __('December 6, 2018'),
@@ -1 +1 @@
1
- {"version":3,"names":["__","blockTable","icon","initBlock","deprecated","edit","metadata","$schema","apiVersion","name","title","category","description","textdomain","attributes","hasFixedLayout","type","caption","source","selector","head","query","cells","content","tag","scope","attribute","align","colspan","rowspan","body","foot","supports","anchor","color","__experimentalSkipSerialization","gradients","__experimentalDefaultControls","background","text","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontStyle","__experimentalFontWeight","__experimentalLetterSpacing","__experimentalTextTransform","__experimentalTextDecoration","__experimentalBorder","style","width","interactivity","clientNavigation","selectors","root","styles","label","isDefault","editorStyle","save","transforms","settings","example","viewportWidth","init"],"sources":["@wordpress/block-library/src/table/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { blockTable as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\thead: [\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'Version' ),\n\t\t\t\t\t\t\ttag: 'th',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'Jazz Musician' ),\n\t\t\t\t\t\t\ttag: 'th',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'Release Date' ),\n\t\t\t\t\t\t\ttag: 'th',\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\tbody: [\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: '5.2',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: 'Jaco Pastorius',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'May 7, 2019' ),\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: '5.1',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: 'Betty Carter',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'February 21, 2019' ),\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: '5.0',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: 'Bebo Valdés',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'December 6, 2018' ),\n\t\t\t\t\t\t\ttag: 'td',\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\tviewportWidth: 450,\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,UAAU,IAAIC,IAAI,QAAQ,kBAAkB;;AAErD;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAC3C,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,IAAI,MAAM,QAAQ;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,cAAA;MAAAC,IAAA;MAAA;IAAA;IAAAC,OAAA;MAAAD,IAAA;MAAAE,MAAA;MAAAC,QAAA;IAAA;IAAAC,IAAA;MAAAJ,IAAA;MAAA;MAAAE,MAAA;MAAAC,QAAA;MAAAE,KAAA;QAAAC,KAAA;UAAAN,IAAA;UAAA;UAAAE,MAAA;UAAAC,QAAA;UAAAE,KAAA;YAAAE,OAAA;cAAAP,IAAA;cAAAE,MAAA;YAAA;YAAAM,GAAA;cAAAR,IAAA;cAAA;cAAAE,MAAA;YAAA;YAAAO,KAAA;cAAAT,IAAA;cAAAE,MAAA;cAAAQ,SAAA;YAAA;YAAAC,KAAA;cAAAX,IAAA;cAAAE,MAAA;cAAAQ,SAAA;YAAA;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EAAE,CACL;QACCR,KAAK,EAAE,CACN;UACCC,OAAO,EAAE,KAAK;UACdC,GAAG,EAAE;QACN,CAAC,EACD;UACCD,OAAO,EAAE,gBAAgB;UACzBC,GAAG,EAAE;QACN,CAAC,EACD;UACCD,OAAO,EAAEvB,EAAE,CAAE,aAAc,CAAC;UAC5BwB,GAAG,EAAE;QACN,CAAC;MAEH,CAAC,EACD;QACCF,KAAK,EAAE,CACN;UACCC,OAAO,EAAE,KAAK;UACdC,GAAG,EAAE;QACN,CAAC,EACD;UACCD,OAAO,EAAE,cAAc;UACvBC,GAAG,EAAE;QACN,CAAC,EACD;UACCD,OAAO,EAAEvB,EAAE,CAAE,mBAAoB,CAAC;UAClCwB,GAAG,EAAE;QACN,CAAC;MAEH,CAAC,EACD;QACCF,KAAK,EAAE,CACN;UACCC,OAAO,EAAE,KAAK;UACdC,GAAG,EAAE;QACN,CAAC,EACD;UACCD,OAAO,EAAE,aAAa;UACtBC,GAAG,EAAE;QACN,CAAC,EACD;UACCD,OAAO,EAAEvB,EAAE,CAAE,kBAAmB,CAAC;UACjCwB,GAAG,EAAE;QACN,CAAC;MAEH,CAAC;IAEH,CAAC;IACD2C,aAAa,EAAE;EAChB,CAAC;EACDH,UAAU;EACV3D,IAAI;EACJ0D,IAAI;EACJ3D;AACD,CAAC;AAED,OAAO,MAAMgE,IAAI,GAAGA,CAAA,KAAMjE,SAAS,CAAE;EAAEM,IAAI;EAAEH,QAAQ;EAAE2D;AAAS,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__","blockTable","icon","initBlock","deprecated","edit","metadata","$schema","apiVersion","name","title","category","description","textdomain","attributes","hasFixedLayout","type","caption","source","selector","head","query","cells","content","tag","scope","attribute","align","colspan","rowspan","body","foot","supports","anchor","color","__experimentalSkipSerialization","gradients","__experimentalDefaultControls","background","text","spacing","margin","padding","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontStyle","__experimentalFontWeight","__experimentalLetterSpacing","__experimentalTextTransform","__experimentalTextDecoration","__experimentalBorder","style","width","interactivity","clientNavigation","selectors","root","styles","label","isDefault","editorStyle","save","transforms","settings","example","viewportWidth","init"],"sources":["@wordpress/block-library/src/table/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { blockTable as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\thead: [\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'Version' ),\n\t\t\t\t\t\t\ttag: 'th',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'Jazz Musician' ),\n\t\t\t\t\t\t\ttag: 'th',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'Release Date' ),\n\t\t\t\t\t\t\ttag: 'th',\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\tbody: [\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: '5.2',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'Jaco Pastorius' ),\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'May 7, 2019' ),\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: '5.1',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'Betty Carter' ),\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'February 21, 2019' ),\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcells: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: '5.0',\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'Bebo Valdés' ),\n\t\t\t\t\t\t\ttag: 'td',\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontent: __( 'December 6, 2018' ),\n\t\t\t\t\t\t\ttag: 'td',\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\tviewportWidth: 450,\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,UAAU,IAAIC,IAAI,QAAQ,kBAAkB;;AAErD;AACA;AACA;AACA,OAAOC,SAAS,MAAM,qBAAqB;AAC3C,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,IAAI,MAAM,QAAQ;AAAC,MAAAC,QAAA;EAAAC,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,cAAA;MAAAC,IAAA;MAAA;IAAA;IAAAC,OAAA;MAAAD,IAAA;MAAAE,MAAA;MAAAC,QAAA;IA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J3D;AACD,CAAC;AAED,OAAO,MAAMgE,IAAI,GAAGA,CAAA,KAAMjE,SAAS,CAAE;EAAEM,IAAI;EAAEH,QAAQ;EAAE2D;AAAS,CAAE,CAAC","ignoreList":[]}
@@ -16,12 +16,12 @@ const tableContentPasteSchema = ({
16
16
  th: {
17
17
  allowEmpty: true,
18
18
  children: phrasingContentSchema,
19
- attributes: ['scope', 'colspan', 'rowspan']
19
+ attributes: ['scope', 'colspan', 'rowspan', 'style']
20
20
  },
21
21
  td: {
22
22
  allowEmpty: true,
23
23
  children: phrasingContentSchema,
24
- attributes: ['colspan', 'rowspan']
24
+ attributes: ['colspan', 'rowspan', 'style']
25
25
  }
26
26
  }
27
27
  }
@@ -62,11 +62,19 @@ const transforms = {
62
62
  const rowAttributes = Array.from(row.children).reduce((colAcc, col) => {
63
63
  const rowspan = normalizeRowColSpan(col.getAttribute('rowspan'));
64
64
  const colspan = normalizeRowColSpan(col.getAttribute('colspan'));
65
+ const {
66
+ textAlign
67
+ } = col.style || {};
68
+ let align;
69
+ if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') {
70
+ align = textAlign;
71
+ }
65
72
  colAcc.push({
66
73
  tag: col.nodeName.toLowerCase(),
67
74
  content: col.innerHTML,
68
75
  rowspan,
69
- colspan
76
+ colspan,
77
+ align
70
78
  });
71
79
  return colAcc;
72
80
  }, []);
@@ -1 +1 @@
1
- {"version":3,"names":["createBlock","normalizeRowColSpan","tableContentPasteSchema","phrasingContentSchema","tr","allowEmpty","children","th","attributes","td","tablePasteSchema","args","table","thead","tfoot","tbody","transforms","from","type","selector","schema","transform","node","Array","reduce","sectionAcc","section","length","sectionName","nodeName","toLowerCase","slice","sectionAttributes","rowAcc","row","rowAttributes","colAcc","col","rowspan","getAttribute","colspan","push","tag","content","innerHTML","cells"],"sources":["@wordpress/block-library/src/table/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { normalizeRowColSpan } from './utils';\n\nconst tableContentPasteSchema = ( { phrasingContentSchema } ) => ( {\n\ttr: {\n\t\tallowEmpty: true,\n\t\tchildren: {\n\t\t\tth: {\n\t\t\t\tallowEmpty: true,\n\t\t\t\tchildren: phrasingContentSchema,\n\t\t\t\tattributes: [ 'scope', 'colspan', 'rowspan' ],\n\t\t\t},\n\t\t\ttd: {\n\t\t\t\tallowEmpty: true,\n\t\t\t\tchildren: phrasingContentSchema,\n\t\t\t\tattributes: [ 'colspan', 'rowspan' ],\n\t\t\t},\n\t\t},\n\t},\n} );\n\nconst tablePasteSchema = ( args ) => ( {\n\ttable: {\n\t\tchildren: {\n\t\t\tthead: {\n\t\t\t\tallowEmpty: true,\n\t\t\t\tchildren: tableContentPasteSchema( args ),\n\t\t\t},\n\t\t\ttfoot: {\n\t\t\t\tallowEmpty: true,\n\t\t\t\tchildren: tableContentPasteSchema( args ),\n\t\t\t},\n\t\t\ttbody: {\n\t\t\t\tallowEmpty: true,\n\t\t\t\tchildren: tableContentPasteSchema( args ),\n\t\t\t},\n\t\t},\n\t},\n} );\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tselector: 'table',\n\t\t\tschema: tablePasteSchema,\n\t\t\ttransform: ( node ) => {\n\t\t\t\tconst attributes = Array.from( node.children ).reduce(\n\t\t\t\t\t( sectionAcc, section ) => {\n\t\t\t\t\t\tif ( ! section.children.length ) {\n\t\t\t\t\t\t\treturn sectionAcc;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst sectionName = section.nodeName\n\t\t\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t\t\t.slice( 1 );\n\n\t\t\t\t\t\tconst sectionAttributes = Array.from(\n\t\t\t\t\t\t\tsection.children\n\t\t\t\t\t\t).reduce( ( rowAcc, row ) => {\n\t\t\t\t\t\t\tif ( ! row.children.length ) {\n\t\t\t\t\t\t\t\treturn rowAcc;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst rowAttributes = Array.from(\n\t\t\t\t\t\t\t\trow.children\n\t\t\t\t\t\t\t).reduce( ( colAcc, col ) => {\n\t\t\t\t\t\t\t\tconst rowspan = normalizeRowColSpan(\n\t\t\t\t\t\t\t\t\tcol.getAttribute( 'rowspan' )\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tconst colspan = normalizeRowColSpan(\n\t\t\t\t\t\t\t\t\tcol.getAttribute( 'colspan' )\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tcolAcc.push( {\n\t\t\t\t\t\t\t\t\ttag: col.nodeName.toLowerCase(),\n\t\t\t\t\t\t\t\t\tcontent: col.innerHTML,\n\t\t\t\t\t\t\t\t\trowspan,\n\t\t\t\t\t\t\t\t\tcolspan,\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t\treturn colAcc;\n\t\t\t\t\t\t\t}, [] );\n\n\t\t\t\t\t\t\trowAcc.push( {\n\t\t\t\t\t\t\t\tcells: rowAttributes,\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\treturn rowAcc;\n\t\t\t\t\t\t}, [] );\n\n\t\t\t\t\t\tsectionAcc[ sectionName ] = sectionAttributes;\n\t\t\t\t\t\treturn sectionAcc;\n\t\t\t\t\t},\n\t\t\t\t\t{}\n\t\t\t\t);\n\n\t\t\t\treturn createBlock( 'core/table', attributes );\n\t\t\t},\n\t\t},\n\t],\n};\n\nexport default transforms;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,mBAAmB;;AAE/C;AACA;AACA;AACA,SAASC,mBAAmB,QAAQ,SAAS;AAE7C,MAAMC,uBAAuB,GAAGA,CAAE;EAAEC;AAAsB,CAAC,MAAQ;EAClEC,EAAE,EAAE;IACHC,UAAU,EAAE,IAAI;IAChBC,QAAQ,EAAE;MACTC,EAAE,EAAE;QACHF,UAAU,EAAE,IAAI;QAChBC,QAAQ,EAAEH,qBAAqB;QAC/BK,UAA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CAAC5B,QAAQ,CAACqB,MAAM,EAAG;YAC5B,OAAOM,MAAM;UACd;UAEA,MAAME,aAAa,GAAGZ,KAAK,CAACN,IAAI,CAC/BiB,GAAG,CAAC5B,QACL,CAAC,CAACkB,MAAM,CAAE,CAAEY,MAAM,EAAEC,GAAG,KAAM;YAC5B,MAAMC,OAAO,GAAGrC,mBAAmB,CAClCoC,GAAG,CAACE,YAAY,CAAE,SAAU,CAC7B,CAAC;YACD,MAAMC,OAAO,GAAGvC,mBAAmB,CAClCoC,GAAG,CAACE,YAAY,CAAE,SAAU,CAC7B,CAAC;YAEDH,MAAM,CAACK,IAAI,CAAE;cACZC,GAAG,EAAEL,GAAG,CAACR,QAAQ,CAACC,WAAW,CAAC,CAAC;cAC/Ba,OAAO,EAAEN,GAAG,CAACO,SAAS;cACtBN,OAAO;cACPE;YACD,CAAE,CAAC;YAEH,OAAOJ,MAAM;UACd,CAAC,EAAE,EAAG,CAAC;UAEPH,MAAM,CAACQ,IAAI,CAAE;YACZI,KAAK,EAAEV;UACR,CAAE,CAAC;UAEH,OAAOF,MAAM;QACd,CAAC,EAAE,EAAG,CAAC;QAEPR,UAAU,CAAEG,WAAW,CAAE,GAAGI,iBAAiB;QAC7C,OAAOP,UAAU;MAClB,CAAC,EACD,CAAC,CACF,CAAC;MAED,OAAOzB,WAAW,CAAE,YAAY,EAAEQ,UAAW,CAAC;IAC/C;EACD,CAAC;AAEH,CAAC;AAED,eAAeQ,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["createBlock","normalizeRowColSpan","tableContentPasteSchema","phrasingContentSchema","tr","allowEmpty","children","th","attributes","td","tablePasteSchema","args","table","thead","tfoot","tbody","transforms","from","type","selector","schema","transform","node","Array","reduce","sectionAcc","section","length","sectionName","nodeName","toLowerCase","slice","sectionAttributes","rowAcc","row","rowAttributes","colAcc","col","rowspan","getAttribute","colspan","textAlign","style","align","push","tag","content","innerHTML","cells"],"sources":["@wordpress/block-library/src/table/transforms.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { normalizeRowColSpan } from './utils';\n\nconst tableContentPasteSchema = ( { phrasingContentSchema } ) => ( {\n\ttr: {\n\t\tallowEmpty: true,\n\t\tchildren: {\n\t\t\tth: {\n\t\t\t\tallowEmpty: true,\n\t\t\t\tchildren: phrasingContentSchema,\n\t\t\t\tattributes: [ 'scope', 'colspan', 'rowspan', 'style' ],\n\t\t\t},\n\t\t\ttd: {\n\t\t\t\tallowEmpty: true,\n\t\t\t\tchildren: phrasingContentSchema,\n\t\t\t\tattributes: [ 'colspan', 'rowspan', 'style' ],\n\t\t\t},\n\t\t},\n\t},\n} );\n\nconst tablePasteSchema = ( args ) => ( {\n\ttable: {\n\t\tchildren: {\n\t\t\tthead: {\n\t\t\t\tallowEmpty: true,\n\t\t\t\tchildren: tableContentPasteSchema( args ),\n\t\t\t},\n\t\t\ttfoot: {\n\t\t\t\tallowEmpty: true,\n\t\t\t\tchildren: tableContentPasteSchema( args ),\n\t\t\t},\n\t\t\ttbody: {\n\t\t\t\tallowEmpty: true,\n\t\t\t\tchildren: tableContentPasteSchema( args ),\n\t\t\t},\n\t\t},\n\t},\n} );\n\nconst transforms = {\n\tfrom: [\n\t\t{\n\t\t\ttype: 'raw',\n\t\t\tselector: 'table',\n\t\t\tschema: tablePasteSchema,\n\t\t\ttransform: ( node ) => {\n\t\t\t\tconst attributes = Array.from( node.children ).reduce(\n\t\t\t\t\t( sectionAcc, section ) => {\n\t\t\t\t\t\tif ( ! section.children.length ) {\n\t\t\t\t\t\t\treturn sectionAcc;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst sectionName = section.nodeName\n\t\t\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t\t\t.slice( 1 );\n\n\t\t\t\t\t\tconst sectionAttributes = Array.from(\n\t\t\t\t\t\t\tsection.children\n\t\t\t\t\t\t).reduce( ( rowAcc, row ) => {\n\t\t\t\t\t\t\tif ( ! row.children.length ) {\n\t\t\t\t\t\t\t\treturn rowAcc;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst rowAttributes = Array.from(\n\t\t\t\t\t\t\t\trow.children\n\t\t\t\t\t\t\t).reduce( ( colAcc, col ) => {\n\t\t\t\t\t\t\t\tconst rowspan = normalizeRowColSpan(\n\t\t\t\t\t\t\t\t\tcol.getAttribute( 'rowspan' )\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tconst colspan = normalizeRowColSpan(\n\t\t\t\t\t\t\t\t\tcol.getAttribute( 'colspan' )\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tconst { textAlign } = col.style || {};\n\n\t\t\t\t\t\t\t\tlet align;\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\ttextAlign === 'left' ||\n\t\t\t\t\t\t\t\t\ttextAlign === 'center' ||\n\t\t\t\t\t\t\t\t\ttextAlign === 'right'\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\talign = textAlign;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tcolAcc.push( {\n\t\t\t\t\t\t\t\t\ttag: col.nodeName.toLowerCase(),\n\t\t\t\t\t\t\t\t\tcontent: col.innerHTML,\n\t\t\t\t\t\t\t\t\trowspan,\n\t\t\t\t\t\t\t\t\tcolspan,\n\t\t\t\t\t\t\t\t\talign,\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t\treturn colAcc;\n\t\t\t\t\t\t\t}, [] );\n\n\t\t\t\t\t\t\trowAcc.push( {\n\t\t\t\t\t\t\t\tcells: rowAttributes,\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\treturn rowAcc;\n\t\t\t\t\t\t}, [] );\n\n\t\t\t\t\t\tsectionAcc[ sectionName ] = sectionAttributes;\n\t\t\t\t\t\treturn sectionAcc;\n\t\t\t\t\t},\n\t\t\t\t\t{}\n\t\t\t\t);\n\n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H,MAAM,CAACW,IAAI,CAAE;YACZI,KAAK,EAAEb;UACR,CAAE,CAAC;UAEH,OAAOF,MAAM;QACd,CAAC,EAAE,EAAG,CAAC;QAEPR,UAAU,CAAEG,WAAW,CAAE,GAAGI,iBAAiB;QAC7C,OAAOP,UAAU;MAClB,CAAC,EACD,CAAC,CACF,CAAC;MAED,OAAOzB,WAAW,CAAE,YAAY,EAAEQ,UAAW,CAAC;IAC/C;EACD,CAAC;AAEH,CAAC;AAED,eAAeQ,UAAU","ignoreList":[]}
@@ -148,7 +148,7 @@ export default function TableOfContentsEdit({
148
148
  onChange: value => setAttributes({
149
149
  maxLevel: value ? parseInt(value) : undefined
150
150
  }),
151
- help: maxLevel ? __('Including all heading levels in the table of contents.') : __('Only include headings up to and including this level.')
151
+ help: !maxLevel ? __('Including all heading levels in the table of contents.') : __('Only include headings up to and including this level.')
152
152
  })
153
153
  })]
154
154
  })
@@ -1 +1 @@
1
- {"version":3,"names":["BlockControls","BlockIcon","InspectorControls","store","blockEditorStore","useBlockProps","createBlock","Placeholder","ToggleControl","SelectControl","ToolbarButton","ToolbarGroup","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","useDispatch","useSelect","renderToString","__","useInstanceId","noticeStore","tableOfContents","icon","TableOfContentsList","linearToNestedHeadingList","useObserveHeadings","useToolsPanelDropdownMenuProps","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","TableOfContentsEdit","attributes","headings","onlyIncludeCurrentPage","maxLevel","clientId","setAttributes","blockProps","instanceId","createWarningNotice","showRedirectionPreventedNotice","event","preventDefault","id","type","canInsertList","select","getBlockRootClientId","canInsertBlockType","rootClientId","replaceBlocks","dropdownMenuProps","headingTree","toolbarControls","children","onClick","ordered","values","nestedHeadingList","inspectorControls","label","resetAll","undefined","hasValue","onDeselect","isShownByDefault","__nextHasNoMarginBottom","checked","onChange","value","help","__next40pxDefaultSize","options","parseInt","length","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":"AAAA;AACA;AACA;AACA,SACCA,aAAa,EACbC,SAAS,EACTC,iBAAiB,EACjBC,KAAK,IAAIC,gBAAgB,EACzBC,aAAa,QACP,yBAAyB;AAChC,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SACCC,WAAW,EACXC,aAAa,EACbC,aAAa,EACbC,aAAa,EACbC,YAAY,EACZC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;AAC9B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASjB,KAAK,IAAIkB,WAAW,QAAQ,oBAAoB;AACzD,SAASC,eAAe,IAAIC,IAAI,QAAQ,kBAAkB;;AAE1D;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,QAAQ;AACxC,SAASC,yBAAyB,QAAQ,SAAS;AACnD,SAASC,kBAAkB,QAAQ,SAAS;AAC5C,SAASC,8BAA8B,QAAQ,gBAAgB;;AAE/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAZA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAaA,eAAe,SAASC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IAAKiB,QAAQ,CAAC0C,MAAM,KAAK,CAAC,EAAG;IAC5B,oBACC/C,KAAA,CAAAE,SAAA;MAAAyB,QAAA,gBACC7B,IAAA;QAAA,GAAUY,UAAU;QAAAiB,QAAA,eACnB7B,IAAA,CAACtB,WAAW;UACXgB,IAAI,eAAGM,IAAA,CAAC5B,SAAS;YAACsB,IAAI,EAAGA;UAAM,CAAE,CAAG;UACpCyC,KAAK,EAAG7C,EAAE,CAAE,mBAAoB,CAAG;UACnC4D,YAAY,EAAG5D,EAAE,CAChB,4GACD;QAAG,CACH;MAAC,CACE,CAAC,EACJ4C,iBAAiB;IAAA,CAClB,CAAC;EAEL;EAEA,oBACChC,KAAA,CAAAE,SAAA;IAAAyB,QAAA,gBACC7B,IAAA;MAAA,GAAUY,UAAU;MAAAiB,QAAA,eACnB7B,IAAA;QAAA6B,QAAA,eACC7B,IAAA,CAACL,mBAAmB;UACnBsC,iBAAiB,EAAGN,WAAa;UACjCwB,qBAAqB;UACrBrB,OAAO,EAAGf;QAAgC,CAC1C;MAAC,CACC;IAAC,CACD,CAAC,EACJa,eAAe,EACfM,iBAAiB;EAAA,CAClB,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["BlockControls","BlockIcon","InspectorControls","store","blockEditorStore","useBlockProps","createBlock","Placeholder","ToggleControl","SelectControl","ToolbarButton","ToolbarGroup","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","useDispatch","useSelect","renderToString","__","useInstanceId","noticeStore","tableOfContents","icon","TableOfContentsList","linearToNestedHeadingList","useObserveHeadings","useToolsPanelDropdownMenuProps","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","TableOfContentsEdit","attributes","headings","onlyIncludeCurrentPage","maxLevel","clientId","setAttributes","blockProps","instanceId","createWarningNotice","showRedirectionPreventedNotice","event","preventDefault","id","type","canInsertList","select","getBlockRootClientId","canInsertBlockType","rootClientId","replaceBlocks","dropdownMenuProps","headingTree","toolbarControls","children","onClick","ordered","values","nestedHeadingList","inspectorControls","label","resetAll","undefined","hasValue","onDeselect","isShownByDefault","__nextHasNoMarginBottom","checked","onChange","value","help","__next40pxDefaultSize","options","parseInt","length","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\t! maxLevel\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":"AAAA;AACA;AACA;AACA,SACCA,aAAa,EACbC,SAAS,EACTC,iBAAiB,EACjBC,KAAK,IAAIC,gBAAgB,EACzBC,aAAa,QACP,yBAAyB;AAChC,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,SACCC,WAAW,EACXC,aAAa,EACbC,aAAa,EACbC,aAAa,EACbC,YAAY,EACZC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;AAC9B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASjB,KAAK,IAAIkB,WAAW,QAAQ,oBAAoB;AACzD,SAASC,eAAe,IAAIC,IAAI,QAAQ,kBAAkB;;AAE1D;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,QAAQ;AACxC,SAASC,yBAAyB,QAAQ,SAAS;AACnD,SAASC,kBAAkB,QAAQ,SAAS;AAC5C,SAASC,8BAA8B,QAAQ,gBAAgB;;AAE/D;;AAEA;AAC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