@wordpress/block-library 7.4.0 → 7.5.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 (269) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/audio/edit.js +3 -15
  3. package/build/audio/edit.js.map +1 -1
  4. package/build/button/edit.native.js +7 -3
  5. package/build/button/edit.native.js.map +1 -1
  6. package/build/comment-template/edit.js +1 -3
  7. package/build/comment-template/edit.js.map +1 -1
  8. package/build/{comments-query-loop → comments}/edit/comments-inspector-controls.js +0 -0
  9. package/{build-module/comments-query-loop → build/comments}/edit/comments-inspector-controls.js.map +1 -1
  10. package/build/{comments-query-loop → comments}/edit.js +3 -3
  11. package/build/comments/edit.js.map +1 -0
  12. package/build/{comments-query-loop → comments}/index.js +1 -1
  13. package/build/comments/index.js.map +1 -0
  14. package/build/{comments-query-loop → comments}/save.js +2 -2
  15. package/build/comments/save.js.map +1 -0
  16. package/build/comments-title/edit.js +7 -5
  17. package/build/comments-title/edit.js.map +1 -1
  18. package/build/cover/edit.js +4 -71
  19. package/build/cover/edit.js.map +1 -1
  20. package/build/cover/edit.native.js +36 -15
  21. package/build/cover/edit.native.js.map +1 -1
  22. package/build/cover/transforms.js +77 -6
  23. package/build/cover/transforms.js.map +1 -1
  24. package/build/cover/use-cover-is-dark.js +81 -0
  25. package/build/cover/use-cover-is-dark.js.map +1 -0
  26. package/build/cover/use-cover-is-dark.native.js +60 -0
  27. package/build/cover/use-cover-is-dark.native.js.map +1 -0
  28. package/build/group/index.js +1 -0
  29. package/build/group/index.js.map +1 -1
  30. package/build/heading/transforms.js +8 -4
  31. package/build/heading/transforms.js.map +1 -1
  32. package/build/index.js +4 -6
  33. package/build/index.js.map +1 -1
  34. package/build/latest-posts/edit.native.js +49 -0
  35. package/build/latest-posts/edit.native.js.map +1 -1
  36. package/build/navigation/edit/index.js +5 -28
  37. package/build/navigation/edit/index.js.map +1 -1
  38. package/build/navigation/edit/inner-blocks.js +5 -7
  39. package/build/navigation/edit/inner-blocks.js.map +1 -1
  40. package/build/navigation/index.js +0 -1
  41. package/build/navigation/index.js.map +1 -1
  42. package/build/navigation/view-modal.js +25 -0
  43. package/build/navigation/view-modal.js.map +1 -1
  44. package/build/navigation-link/edit.js +29 -30
  45. package/build/navigation-link/edit.js.map +1 -1
  46. package/build/navigation-submenu/edit.js +14 -14
  47. package/build/navigation-submenu/edit.js.map +1 -1
  48. package/build/paragraph/edit.js +10 -0
  49. package/build/paragraph/edit.js.map +1 -1
  50. package/build/paragraph/use-enter.js +94 -0
  51. package/build/paragraph/use-enter.js.map +1 -0
  52. package/build/post-comment/index.js +1 -1
  53. package/build/post-comments/edit.js +120 -35
  54. package/build/post-comments/edit.js.map +1 -1
  55. package/build/post-comments/index.js +3 -2
  56. package/build/post-comments/index.js.map +1 -1
  57. package/build/post-comments-form/edit.js +38 -4
  58. package/build/post-comments-form/edit.js.map +1 -1
  59. package/build/post-comments-form/form.js +48 -0
  60. package/build/post-comments-form/form.js.map +1 -0
  61. package/build/post-comments-form/index.js +1 -0
  62. package/build/post-comments-form/index.js.map +1 -1
  63. package/build/post-content/edit.js +1 -1
  64. package/build/post-content/edit.js.map +1 -1
  65. package/build/post-excerpt/edit.js +1 -1
  66. package/build/post-excerpt/edit.js.map +1 -1
  67. package/build/post-terms/edit.js +25 -3
  68. package/build/post-terms/edit.js.map +1 -1
  69. package/build/post-terms/index.js +8 -0
  70. package/build/post-terms/index.js.map +1 -1
  71. package/build/query-no-results/edit.js +1 -1
  72. package/build/query-no-results/edit.js.map +1 -1
  73. package/build/quote/index.js +1 -0
  74. package/build/quote/index.js.map +1 -1
  75. package/build/separator/index.js +3 -0
  76. package/build/separator/index.js.map +1 -1
  77. package/build/video/edit.js +3 -7
  78. package/build/video/edit.js.map +1 -1
  79. package/build-module/audio/edit.js +3 -15
  80. package/build-module/audio/edit.js.map +1 -1
  81. package/build-module/button/edit.native.js +7 -3
  82. package/build-module/button/edit.native.js.map +1 -1
  83. package/build-module/comment-template/edit.js +1 -3
  84. package/build-module/comment-template/edit.js.map +1 -1
  85. package/build-module/{comments-query-loop → comments}/edit/comments-inspector-controls.js +0 -0
  86. package/build-module/comments/edit/comments-inspector-controls.js.map +1 -0
  87. package/build-module/{comments-query-loop → comments}/edit.js +2 -2
  88. package/build-module/comments/edit.js.map +1 -0
  89. package/build-module/{comments-query-loop → comments}/index.js +1 -1
  90. package/build-module/comments/index.js.map +1 -0
  91. package/build-module/{comments-query-loop → comments}/save.js +1 -1
  92. package/build-module/comments/save.js.map +1 -0
  93. package/build-module/comments-title/edit.js +7 -5
  94. package/build-module/comments-title/edit.js.map +1 -1
  95. package/build-module/cover/edit.js +4 -71
  96. package/build-module/cover/edit.js.map +1 -1
  97. package/build-module/cover/edit.native.js +35 -16
  98. package/build-module/cover/edit.native.js.map +1 -1
  99. package/build-module/cover/transforms.js +74 -6
  100. package/build-module/cover/transforms.js.map +1 -1
  101. package/build-module/cover/use-cover-is-dark.js +70 -0
  102. package/build-module/cover/use-cover-is-dark.js.map +1 -0
  103. package/build-module/cover/use-cover-is-dark.native.js +51 -0
  104. package/build-module/cover/use-cover-is-dark.native.js.map +1 -0
  105. package/build-module/group/index.js +1 -0
  106. package/build-module/group/index.js.map +1 -1
  107. package/build-module/heading/transforms.js +8 -4
  108. package/build-module/heading/transforms.js.map +1 -1
  109. package/build-module/index.js +3 -4
  110. package/build-module/index.js.map +1 -1
  111. package/build-module/latest-posts/edit.native.js +51 -2
  112. package/build-module/latest-posts/edit.native.js.map +1 -1
  113. package/build-module/navigation/edit/index.js +6 -28
  114. package/build-module/navigation/edit/index.js.map +1 -1
  115. package/build-module/navigation/edit/inner-blocks.js +5 -7
  116. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  117. package/build-module/navigation/index.js +0 -1
  118. package/build-module/navigation/index.js.map +1 -1
  119. package/build-module/navigation/view-modal.js +24 -0
  120. package/build-module/navigation/view-modal.js.map +1 -1
  121. package/build-module/navigation-link/edit.js +29 -30
  122. package/build-module/navigation-link/edit.js.map +1 -1
  123. package/build-module/navigation-submenu/edit.js +14 -14
  124. package/build-module/navigation-submenu/edit.js.map +1 -1
  125. package/build-module/paragraph/edit.js +9 -0
  126. package/build-module/paragraph/edit.js.map +1 -1
  127. package/build-module/paragraph/use-enter.js +81 -0
  128. package/build-module/paragraph/use-enter.js.map +1 -0
  129. package/build-module/post-comment/index.js +1 -1
  130. package/build-module/post-comments/edit.js +120 -37
  131. package/build-module/post-comments/edit.js.map +1 -1
  132. package/build-module/post-comments/index.js +3 -2
  133. package/build-module/post-comments/index.js.map +1 -1
  134. package/build-module/post-comments-form/edit.js +38 -6
  135. package/build-module/post-comments-form/edit.js.map +1 -1
  136. package/build-module/post-comments-form/form.js +39 -0
  137. package/build-module/post-comments-form/form.js.map +1 -0
  138. package/build-module/post-comments-form/index.js +1 -0
  139. package/build-module/post-comments-form/index.js.map +1 -1
  140. package/build-module/post-content/edit.js +1 -1
  141. package/build-module/post-content/edit.js.map +1 -1
  142. package/build-module/post-excerpt/edit.js +1 -1
  143. package/build-module/post-excerpt/edit.js.map +1 -1
  144. package/build-module/post-terms/edit.js +26 -4
  145. package/build-module/post-terms/edit.js.map +1 -1
  146. package/build-module/post-terms/index.js +8 -0
  147. package/build-module/post-terms/index.js.map +1 -1
  148. package/build-module/query-no-results/edit.js +1 -1
  149. package/build-module/query-no-results/edit.js.map +1 -1
  150. package/build-module/quote/index.js +1 -0
  151. package/build-module/quote/index.js.map +1 -1
  152. package/build-module/separator/index.js +3 -0
  153. package/build-module/separator/index.js.map +1 -1
  154. package/build-module/video/edit.js +3 -7
  155. package/build-module/video/edit.js.map +1 -1
  156. package/build-style/comment-content/style-rtl.css +81 -0
  157. package/build-style/comment-content/style.css +81 -0
  158. package/build-style/{comments-query-loop → comments}/editor-rtl.css +0 -0
  159. package/build-style/{comments-query-loop → comments}/editor.css +0 -0
  160. package/build-style/cover/style-rtl.css +1 -5
  161. package/build-style/cover/style.css +1 -5
  162. package/build-style/editor-rtl.css +12 -4
  163. package/build-style/editor.css +12 -4
  164. package/build-style/latest-posts/style-rtl.css +2 -0
  165. package/build-style/latest-posts/style.css +4 -0
  166. package/build-style/navigation/style-rtl.css +3 -0
  167. package/build-style/navigation/style.css +3 -0
  168. package/build-style/post-comments/editor-rtl.css +79 -0
  169. package/build-style/post-comments/editor.css +79 -0
  170. package/build-style/post-comments/style-rtl.css +6 -4
  171. package/build-style/post-comments/style.css +6 -4
  172. package/build-style/post-comments-form/editor-rtl.css +79 -0
  173. package/build-style/post-comments-form/editor.css +79 -0
  174. package/build-style/style-rtl.css +12 -9
  175. package/build-style/style.css +14 -9
  176. package/package.json +28 -28
  177. package/src/audio/edit.js +2 -7
  178. package/src/button/edit.native.js +6 -3
  179. package/src/comment-author-name/index.php +7 -5
  180. package/src/comment-content/index.php +25 -3
  181. package/src/comment-content/style.scss +5 -0
  182. package/src/comment-edit-link/index.php +1 -4
  183. package/src/comment-reply-link/index.php +1 -4
  184. package/src/comment-template/edit.js +1 -5
  185. package/src/comment-template/index.php +4 -0
  186. package/src/{comments-query-loop → comments}/block.json +1 -1
  187. package/src/{comments-query-loop → comments}/edit/comments-inspector-controls.js +0 -0
  188. package/src/{comments-query-loop → comments}/edit.js +2 -1
  189. package/src/{comments-query-loop → comments}/editor.scss +0 -0
  190. package/src/{comments-query-loop → comments}/index.js +0 -0
  191. package/src/{comments-query-loop → comments}/save.js +1 -3
  192. package/src/comments-pagination/index.php +4 -0
  193. package/src/comments-title/edit.js +20 -4
  194. package/src/comments-title/index.php +18 -7
  195. package/src/cover/edit.js +2 -67
  196. package/src/cover/edit.native.js +40 -13
  197. package/src/cover/index.php +1 -1
  198. package/src/cover/style.native.scss +4 -0
  199. package/src/cover/style.scss +1 -5
  200. package/src/cover/test/__snapshots__/edit.native.js.snap +6 -6
  201. package/src/cover/test/transforms.js +301 -0
  202. package/src/cover/transforms.js +112 -7
  203. package/src/cover/use-cover-is-dark.js +71 -0
  204. package/src/cover/use-cover-is-dark.native.js +51 -0
  205. package/src/editor.scss +3 -1
  206. package/src/group/block.json +1 -0
  207. package/src/heading/transforms.js +4 -3
  208. package/src/index.js +3 -6
  209. package/src/latest-posts/edit.native.js +56 -1
  210. package/src/latest-posts/style.scss +4 -0
  211. package/src/navigation/block.json +0 -1
  212. package/src/navigation/edit/index.js +6 -36
  213. package/src/navigation/edit/inner-blocks.js +5 -7
  214. package/src/navigation/style.scss +3 -0
  215. package/src/navigation/view-modal.js +32 -0
  216. package/src/navigation-link/edit.js +40 -43
  217. package/src/navigation-submenu/edit.js +13 -17
  218. package/src/paragraph/edit.js +6 -0
  219. package/src/paragraph/use-enter.js +103 -0
  220. package/src/post-author/index.php +1 -1
  221. package/src/post-comment/block.json +1 -1
  222. package/src/post-comments/block.json +3 -2
  223. package/src/post-comments/edit.js +174 -44
  224. package/src/post-comments/editor.scss +3 -0
  225. package/src/post-comments/index.php +2 -0
  226. package/src/post-comments/style.scss +6 -7
  227. package/src/post-comments-form/block.json +1 -0
  228. package/src/post-comments-form/edit.js +52 -23
  229. package/src/post-comments-form/editor.scss +3 -0
  230. package/src/post-comments-form/form.js +43 -0
  231. package/src/post-comments-form/index.php +9 -2
  232. package/src/post-content/edit.js +15 -1
  233. package/src/post-excerpt/edit.js +14 -1
  234. package/src/post-terms/block.json +8 -0
  235. package/src/post-terms/edit.js +28 -1
  236. package/src/post-terms/index.php +12 -2
  237. package/src/query-no-results/edit.js +1 -1
  238. package/src/quote/block.json +1 -0
  239. package/src/separator/block.json +3 -0
  240. package/src/video/edit.js +3 -4
  241. package/build/comments-query-loop/edit/comments-inspector-controls.js.map +0 -1
  242. package/build/comments-query-loop/edit.js.map +0 -1
  243. package/build/comments-query-loop/index.js.map +0 -1
  244. package/build/comments-query-loop/save.js.map +0 -1
  245. package/build/navigation-area/edit.js +0 -110
  246. package/build/navigation-area/edit.js.map +0 -1
  247. package/build/navigation-area/index.js +0 -62
  248. package/build/navigation-area/index.js.map +0 -1
  249. package/build/navigation-area/inner-blocks.js +0 -34
  250. package/build/navigation-area/inner-blocks.js.map +0 -1
  251. package/build/navigation-area/save.js +0 -18
  252. package/build/navigation-area/save.js.map +0 -1
  253. package/build-module/comments-query-loop/edit.js.map +0 -1
  254. package/build-module/comments-query-loop/index.js.map +0 -1
  255. package/build-module/comments-query-loop/save.js.map +0 -1
  256. package/build-module/navigation-area/edit.js +0 -94
  257. package/build-module/navigation-area/edit.js.map +0 -1
  258. package/build-module/navigation-area/index.js +0 -48
  259. package/build-module/navigation-area/index.js.map +0 -1
  260. package/build-module/navigation-area/inner-blocks.js +0 -26
  261. package/build-module/navigation-area/inner-blocks.js.map +0 -1
  262. package/build-module/navigation-area/save.js +0 -10
  263. package/build-module/navigation-area/save.js.map +0 -1
  264. package/src/navigation-area/block.json +0 -23
  265. package/src/navigation-area/edit.js +0 -111
  266. package/src/navigation-area/index.js +0 -26
  267. package/src/navigation-area/index.php +0 -22
  268. package/src/navigation-area/inner-blocks.js +0 -24
  269. package/src/navigation-area/save.js +0 -8
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/navigation-submenu/edit.js"],"names":["ALLOWED_BLOCKS","DEFAULT_BLOCK","name","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener","getSuggestionsQuery","type","kind","subtype","getColors","context","isSubMenu","textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","style","colors","color","text","background","updateNavigationLinkBlockAttributes","updatedValue","setAttributes","blockAttributes","label","originalLabel","originalKind","originalType","title","url","opensInNewTab","id","newKind","newType","normalizedTitle","replace","normalizedURL","escapeTitle","isBuiltInType","indexOf","isCustomLink","encodeURI","undefined","Number","isInteger","NavigationSubmenuEdit","attributes","isSelected","mergeBlocks","onReplace","clientId","description","rel","link","showSubmenuIcon","maxNestingLevel","openSubmenusOnClick","saveEntityRecord","coreStore","__unstableMarkNextChangeAsNotPersistent","replaceBlock","blockEditorStore","isLinkOpen","setIsLinkOpen","listItemRef","itemLabelPlaceholder","ref","isAtMaxNesting","isTopLevelItem","isParentOfSelectedBlock","isImmediateParentOfSelectedBlock","hasDescendants","selectedBlockHasDescendants","userCanCreatePages","userCanCreatePosts","onlyDescendantIsEmptyLink","select","getClientIdsOfDescendants","hasSelectedInnerBlock","getSelectedBlockClientId","getBlockParentsByBlockName","getBlock","_onlyDescendantIsEmptyLink","selectedBlockId","descendants","length","selectedBlockDescendants","singleBlock","canUser","test","selectLabelText","focus","defaultView","selection","getSelection","range","createRange","selectNodeContents","removeAllRanges","addRange","userCanCreate","handleCreate","pageTitle","postType","page","status","rendered","onKeyDown","isKeyboardEvent","primary","blockProps","className","innerBlocksColors","allowedBlocks","innerBlocksProps","__experimentalDefaultBlock","__experimentalDirectInsert","__experimentalCaptureToolbars","renderAppender","InnerBlocks","ButtonBlockAppender","ParentElement","transformToLink","newLinkBlock","canConvertToLink","linkIcon","displayShortcut","removeSubmenu","descriptionValue","titleValue","relValue","labelValue","searchTerm","format","mark"],"mappings":";;;;;;;;;;AAgCA;;AA7BA;;AACA;;AAKA;;AACA;;AAQA;;AACA;;AACA;;AAWA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAhDA;AACA;AACA;;AAIA;AACA;AACA;;AAqCA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAMA,cAAc,GAAG,CAAE,sBAAF,EAA0B,yBAA1B,CAAvB;AAEA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,IAAI,EAAE;AADe,CAAtB;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,mBAAmB,GAAKC,UAAF,IAAkB;AAC7C,QAAM,CAAEC,gBAAF,EAAoBC,mBAApB,IAA4C,uBAAU,KAAV,CAAlD;AAEA,0BAAW,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BAAC,uBAAD,OADD,CAnFF,EAuFC,mCAAU0D,gBAAV,CAvFD,CAvDD,CADD;AAmJA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { escape, without } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPanelBody,\n\tPopover,\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tInnerBlocks,\n\tuseInnerBlocksProps,\n\tInspectorControls,\n\tRichText,\n\t__experimentalLinkControl as LinkControl,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tgetColorClassName,\n} from '@wordpress/block-editor';\nimport { isURL, prependHTTP, safeDecodeURI } from '@wordpress/url';\nimport {\n\tFragment,\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport { placeCaretAtHorizontalEdge } from '@wordpress/dom';\nimport { link as linkIcon, removeSubmenu } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { speak } from '@wordpress/a11y';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { ItemSubmenuIcon } from './icons';\nimport { name } from './block.json';\n\nconst ALLOWED_BLOCKS = [ 'core/navigation-link', 'core/navigation-submenu' ];\n\nconst DEFAULT_BLOCK = {\n\tname: 'core/navigation-link',\n};\n\n/**\n * A React hook to determine if it's dragging within the target element.\n *\n * @typedef {import('@wordpress/element').RefObject} RefObject\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the target element.\n */\nconst useIsDraggingWithin = ( elementRef ) => {\n\tconst [ isDraggingWithin, setIsDraggingWithin ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart( event ) {\n\t\t\t// Check the first time when the dragging starts.\n\t\t\thandleDragEnter( event );\n\t\t}\n\n\t\t// Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDraggingWithin( false );\n\t\t}\n\n\t\tfunction handleDragEnter( event ) {\n\t\t\t// Check if the current target is inside the item element.\n\t\t\tif ( elementRef.current.contains( event.target ) ) {\n\t\t\t\tsetIsDraggingWithin( true );\n\t\t\t} else {\n\t\t\t\tsetIsDraggingWithin( false );\n\t\t\t}\n\t\t}\n\n\t\t// Bind these events to the document to catch all drag events.\n\t\t// Ideally, we can also use `event.relatedTarget`, but sadly that\n\t\t// doesn't work in Safari.\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\t\townerDocument.addEventListener( 'dragenter', handleDragEnter );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener( 'dragstart', handleDragStart );\n\t\t\townerDocument.removeEventListener( 'dragend', handleDragEnd );\n\t\t\townerDocument.removeEventListener( 'dragenter', handleDragEnter );\n\t\t};\n\t}, [] );\n\n\treturn isDraggingWithin;\n};\n\n/**\n * Given the Link block's type attribute, return the query params to give to\n * /wp/v2/search.\n *\n * @param {string} type Link block's type attribute.\n * @param {string} kind Link block's entity of kind (post-type|taxonomy)\n * @return {{ type?: string, subtype?: string }} Search query params.\n */\nfunction getSuggestionsQuery( type, kind ) {\n\tswitch ( type ) {\n\t\tcase 'post':\n\t\tcase 'page':\n\t\t\treturn { type: 'post', subtype: type };\n\t\tcase 'category':\n\t\t\treturn { type: 'term', subtype: 'category' };\n\t\tcase 'tag':\n\t\t\treturn { type: 'term', subtype: 'post_tag' };\n\t\tcase 'post_format':\n\t\t\treturn { type: 'post-format' };\n\t\tdefault:\n\t\t\tif ( kind === 'taxonomy' ) {\n\t\t\t\treturn { type: 'term', subtype: type };\n\t\t\t}\n\t\t\tif ( kind === 'post-type' ) {\n\t\t\t\treturn { type: 'post', subtype: type };\n\t\t\t}\n\t\t\treturn {};\n\t}\n}\n\n/**\n * Determine the colors for a menu.\n *\n * Order of priority is:\n * 1: Overlay custom colors (if submenu)\n * 2: Overlay theme colors (if submenu)\n * 3: Custom colors\n * 4: Theme colors\n * 5: Global styles\n *\n * @param {Object} context\n * @param {boolean} isSubMenu\n */\nfunction getColors( context, isSubMenu ) {\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t\toverlayTextColor,\n\t\tcustomOverlayTextColor,\n\t\toverlayBackgroundColor,\n\t\tcustomOverlayBackgroundColor,\n\t\tstyle,\n\t} = context;\n\n\tconst colors = {};\n\n\tif ( isSubMenu && !! customOverlayTextColor ) {\n\t\tcolors.customTextColor = customOverlayTextColor;\n\t} else if ( isSubMenu && !! overlayTextColor ) {\n\t\tcolors.textColor = overlayTextColor;\n\t} else if ( !! customTextColor ) {\n\t\tcolors.customTextColor = customTextColor;\n\t} else if ( !! textColor ) {\n\t\tcolors.textColor = textColor;\n\t} else if ( !! style?.color?.text ) {\n\t\tcolors.customTextColor = style.color.text;\n\t}\n\n\tif ( isSubMenu && !! customOverlayBackgroundColor ) {\n\t\tcolors.customBackgroundColor = customOverlayBackgroundColor;\n\t} else if ( isSubMenu && !! overlayBackgroundColor ) {\n\t\tcolors.backgroundColor = overlayBackgroundColor;\n\t} else if ( !! customBackgroundColor ) {\n\t\tcolors.customBackgroundColor = customBackgroundColor;\n\t} else if ( !! backgroundColor ) {\n\t\tcolors.backgroundColor = backgroundColor;\n\t} else if ( !! style?.color?.background ) {\n\t\tcolors.customTextColor = style.color.background;\n\t}\n\n\treturn colors;\n}\n\n/**\n * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind\n */\n\n/**\n * Navigation Link Block Attributes\n *\n * @typedef {Object} WPNavigationLinkBlockAttributes\n *\n * @property {string} [label] Link text.\n * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status.\n * @property {string} [type] The type such as post, page, tag, category and other custom types.\n * @property {string} [rel] The relationship of the linked URL.\n * @property {number} [id] A post or term id.\n * @property {boolean} [opensInNewTab] Sets link target to _blank when true.\n * @property {string} [url] Link href.\n * @property {string} [title] Link title attribute.\n */\n\n/**\n * Link Control onChange handler that updates block attributes when a setting is changed.\n *\n * @param {Object} updatedValue New block attributes to update.\n * @param {Function} setAttributes Block attribute update function.\n * @param {WPNavigationLinkBlockAttributes} blockAttributes Current block attributes.\n *\n */\nexport const updateNavigationLinkBlockAttributes = (\n\tupdatedValue = {},\n\tsetAttributes,\n\tblockAttributes = {}\n) => {\n\tconst {\n\t\tlabel: originalLabel = '',\n\t\tkind: originalKind = '',\n\t\ttype: originalType = '',\n\t} = blockAttributes;\n\tconst {\n\t\ttitle = '',\n\t\turl = '',\n\t\topensInNewTab,\n\t\tid,\n\t\tkind: newKind = originalKind,\n\t\ttype: newType = originalType,\n\t} = updatedValue;\n\n\tconst normalizedTitle = title.replace( /http(s?):\\/\\//gi, '' );\n\tconst normalizedURL = url.replace( /http(s?):\\/\\//gi, '' );\n\tconst escapeTitle =\n\t\ttitle !== '' &&\n\t\tnormalizedTitle !== normalizedURL &&\n\t\toriginalLabel !== title;\n\tconst label = escapeTitle\n\t\t? escape( title )\n\t\t: originalLabel || escape( normalizedURL );\n\n\t// In https://github.com/WordPress/gutenberg/pull/24670 we decided to use \"tag\" in favor of \"post_tag\"\n\tconst type = newType === 'post_tag' ? 'tag' : newType.replace( '-', '_' );\n\n\tconst isBuiltInType =\n\t\t[ 'post', 'page', 'tag', 'category' ].indexOf( type ) > -1;\n\n\tconst isCustomLink =\n\t\t( ! newKind && ! isBuiltInType ) || newKind === 'custom';\n\tconst kind = isCustomLink ? 'custom' : newKind;\n\n\tsetAttributes( {\n\t\t// Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.\n\t\t...( url && { url: encodeURI( safeDecodeURI( url ) ) } ),\n\t\t...( label && { label } ),\n\t\t...( undefined !== opensInNewTab && { opensInNewTab } ),\n\t\t...( id && Number.isInteger( id ) && { id } ),\n\t\t...( kind && { kind } ),\n\t\t...( type && type !== 'URL' && { type } ),\n\t} );\n};\n\nexport default function NavigationSubmenuEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tmergeBlocks,\n\tonReplace,\n\tcontext,\n\tclientId,\n} ) {\n\tconst {\n\t\tlabel,\n\t\ttype,\n\t\topensInNewTab,\n\t\turl,\n\t\tdescription,\n\t\trel,\n\t\ttitle,\n\t\tkind,\n\t} = attributes;\n\tconst link = {\n\t\turl,\n\t\topensInNewTab,\n\t};\n\tconst { showSubmenuIcon, maxNestingLevel, openSubmenusOnClick } = context;\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\tconst {\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\treplaceBlock,\n\t} = useDispatch( blockEditorStore );\n\tconst [ isLinkOpen, setIsLinkOpen ] = useState( false );\n\tconst listItemRef = useRef( null );\n\tconst isDraggingWithin = useIsDraggingWithin( listItemRef );\n\tconst itemLabelPlaceholder = __( 'Add text…' );\n\tconst ref = useRef();\n\n\tconst {\n\t\tisAtMaxNesting,\n\t\tisTopLevelItem,\n\t\tisParentOfSelectedBlock,\n\t\tisImmediateParentOfSelectedBlock,\n\t\thasDescendants,\n\t\tselectedBlockHasDescendants,\n\t\tuserCanCreatePages,\n\t\tuserCanCreatePosts,\n\t\tonlyDescendantIsEmptyLink,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetClientIdsOfDescendants,\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\tgetBlock,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tlet _onlyDescendantIsEmptyLink;\n\n\t\t\tconst selectedBlockId = getSelectedBlockClientId();\n\n\t\t\tconst descendants = getClientIdsOfDescendants( [ clientId ] )\n\t\t\t\t.length;\n\n\t\t\tconst selectedBlockDescendants = getClientIdsOfDescendants( [\n\t\t\t\tselectedBlockId,\n\t\t\t] );\n\n\t\t\t// Check for a single descendant in the submenu. If that block\n\t\t\t// is a link block in a \"placeholder\" state with no label then\n\t\t\t// we can consider as an \"empty\" link.\n\t\t\tif ( selectedBlockDescendants?.length === 1 ) {\n\t\t\t\tconst singleBlock = getBlock( selectedBlockDescendants[ 0 ] );\n\n\t\t\t\t_onlyDescendantIsEmptyLink =\n\t\t\t\t\tsingleBlock?.name === 'core/navigation-link' &&\n\t\t\t\t\t! singleBlock?.attributes?.label;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tisAtMaxNesting:\n\t\t\t\t\tgetBlockParentsByBlockName( clientId, name ).length >=\n\t\t\t\t\tmaxNestingLevel,\n\t\t\t\tisTopLevelItem:\n\t\t\t\t\tgetBlockParentsByBlockName( clientId, name ).length === 0,\n\t\t\t\tisParentOfSelectedBlock: hasSelectedInnerBlock(\n\t\t\t\t\tclientId,\n\t\t\t\t\ttrue\n\t\t\t\t),\n\t\t\t\tisImmediateParentOfSelectedBlock: hasSelectedInnerBlock(\n\t\t\t\t\tclientId,\n\t\t\t\t\tfalse\n\t\t\t\t),\n\t\t\t\thasDescendants: !! descendants,\n\t\t\t\tselectedBlockHasDescendants: !! selectedBlockDescendants?.length,\n\t\t\t\tuserCanCreatePages: select( coreStore ).canUser(\n\t\t\t\t\t'create',\n\t\t\t\t\t'pages'\n\t\t\t\t),\n\t\t\t\tuserCanCreatePosts: select( coreStore ).canUser(\n\t\t\t\t\t'create',\n\t\t\t\t\t'posts'\n\t\t\t\t),\n\t\t\t\tonlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\t// Show the LinkControl on mount if the URL is empty\n\t// ( When adding a new menu item)\n\t// This can't be done in the useState call because it conflicts\n\t// with the autofocus behavior of the BlockListBlock component.\n\tuseEffect( () => {\n\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}, [] );\n\n\t// Store the colors from context as attributes for rendering.\n\tuseEffect( () => {\n\t\t// This side-effect should not create an undo level as those should\n\t\t// only be created via user interactions. Mark this change as\n\t\t// not persistent to avoid undo level creation.\n\t\t// See https://github.com/WordPress/gutenberg/issues/34564.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\tsetAttributes( { isTopLevelItem } );\n\t}, [ isTopLevelItem ] );\n\n\t/**\n\t * The hook shouldn't be necessary but due to a focus loss happening\n\t * when selecting a suggestion in the link popover, we force close on block unselection.\n\t */\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsLinkOpen( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\t// If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.\n\tuseEffect( () => {\n\t\tif ( isLinkOpen && url ) {\n\t\t\t// Does this look like a URL and have something TLD-ish?\n\t\t\tif (\n\t\t\t\tisURL( prependHTTP( label ) ) &&\n\t\t\t\t/^.+\\.[a-z]+/.test( label )\n\t\t\t) {\n\t\t\t\t// Focus and select the label text.\n\t\t\t\tselectLabelText();\n\t\t\t} else {\n\t\t\t\t// Focus it (but do not select).\n\t\t\t\tplaceCaretAtHorizontalEdge( ref.current, true );\n\t\t\t}\n\t\t}\n\t}, [ url ] );\n\n\t/**\n\t * Focus the Link label text and select it.\n\t */\n\tfunction selectLabelText() {\n\t\tref.current.focus();\n\t\tconst { ownerDocument } = ref.current;\n\t\tconst { defaultView } = ownerDocument;\n\t\tconst selection = defaultView.getSelection();\n\t\tconst range = ownerDocument.createRange();\n\t\t// Get the range of the current ref contents so we can add this range to the selection.\n\t\trange.selectNodeContents( ref.current );\n\t\tselection.removeAllRanges();\n\t\tselection.addRange( range );\n\t}\n\n\tlet userCanCreate = false;\n\tif ( ! type || type === 'page' ) {\n\t\tuserCanCreate = userCanCreatePages;\n\t} else if ( type === 'post' ) {\n\t\tuserCanCreate = userCanCreatePosts;\n\t}\n\n\tasync function handleCreate( pageTitle ) {\n\t\tconst postType = type || 'page';\n\n\t\tconst page = await saveEntityRecord( 'postType', postType, {\n\t\t\ttitle: pageTitle,\n\t\t\tstatus: 'draft',\n\t\t} );\n\n\t\treturn {\n\t\t\tid: page.id,\n\t\t\ttype: postType,\n\t\t\ttitle: page.title.rendered,\n\t\t\turl: page.link,\n\t\t\tkind: 'post-type',\n\t\t};\n\t}\n\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t} = getColors( context, ! isTopLevelItem );\n\n\tfunction onKeyDown( event ) {\n\t\tif ( isKeyboardEvent.primary( event, 'k' ) ) {\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tref: listItemRef,\n\t\tclassName: classnames( 'wp-block-navigation-item', {\n\t\t\t'is-editing': isSelected || isParentOfSelectedBlock,\n\t\t\t'is-dragging-within': isDraggingWithin,\n\t\t\t'has-link': !! url,\n\t\t\t'has-child': hasDescendants,\n\t\t\t'has-text-color': !! textColor || !! customTextColor,\n\t\t\t[ getColorClassName( 'color', textColor ) ]: !! textColor,\n\t\t\t'has-background': !! backgroundColor || customBackgroundColor,\n\t\t\t[ getColorClassName(\n\t\t\t\t'background-color',\n\t\t\t\tbackgroundColor\n\t\t\t) ]: !! backgroundColor,\n\t\t\t'open-on-click': openSubmenusOnClick,\n\t\t} ),\n\t\tstyle: {\n\t\t\tcolor: ! textColor && customTextColor,\n\t\t\tbackgroundColor: ! backgroundColor && customBackgroundColor,\n\t\t},\n\t\tonKeyDown,\n\t} );\n\n\t// Always use overlay colors for submenus.\n\tconst innerBlocksColors = getColors( context, true );\n\n\tconst allowedBlocks = isAtMaxNesting\n\t\t? without( ALLOWED_BLOCKS, 'core/navigation-submenu' )\n\t\t: ALLOWED_BLOCKS;\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tclassName: classnames( 'wp-block-navigation__submenu-container', {\n\t\t\t\t'is-parent-of-selected-block': isParentOfSelectedBlock,\n\t\t\t\t'has-text-color': !! (\n\t\t\t\t\tinnerBlocksColors.textColor ||\n\t\t\t\t\tinnerBlocksColors.customTextColor\n\t\t\t\t),\n\t\t\t\t[ `has-${ innerBlocksColors.textColor }-color` ]: !! innerBlocksColors.textColor,\n\t\t\t\t'has-background': !! (\n\t\t\t\t\tinnerBlocksColors.backgroundColor ||\n\t\t\t\t\tinnerBlocksColors.customBackgroundColor\n\t\t\t\t),\n\t\t\t\t[ `has-${ innerBlocksColors.backgroundColor }-background-color` ]: !! innerBlocksColors.backgroundColor,\n\t\t\t} ),\n\t\t\tstyle: {\n\t\t\t\tcolor: innerBlocksColors.customTextColor,\n\t\t\t\tbackgroundColor: innerBlocksColors.customBackgroundColor,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tallowedBlocks,\n\t\t\t__experimentalDefaultBlock: DEFAULT_BLOCK,\n\t\t\t__experimentalDirectInsert: true,\n\n\t\t\t// Ensure block toolbar is not too far removed from item\n\t\t\t// being edited.\n\t\t\t// see: https://github.com/WordPress/gutenberg/pull/34615.\n\t\t\t__experimentalCaptureToolbars: true,\n\n\t\t\trenderAppender:\n\t\t\t\tisSelected ||\n\t\t\t\t( isImmediateParentOfSelectedBlock &&\n\t\t\t\t\t! selectedBlockHasDescendants ) ||\n\t\t\t\t// Show the appender while dragging to allow inserting element between item and the appender.\n\t\t\t\thasDescendants\n\t\t\t\t\t? InnerBlocks.ButtonBlockAppender\n\t\t\t\t\t: false,\n\t\t}\n\t);\n\n\tconst ParentElement = openSubmenusOnClick ? 'button' : 'a';\n\n\tfunction transformToLink() {\n\t\tconst newLinkBlock = createBlock( 'core/navigation-link', attributes );\n\t\treplaceBlock( clientId, newLinkBlock );\n\t}\n\n\tconst canConvertToLink =\n\t\t! selectedBlockHasDescendants || onlyDescendantIsEmptyLink;\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t{ ! openSubmenusOnClick && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\t\ticon={ linkIcon }\n\t\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\tonClick={ () => setIsLinkOpen( true ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"revert\"\n\t\t\t\t\t\ticon={ removeSubmenu }\n\t\t\t\t\t\ttitle={ __( 'Convert to Link' ) }\n\t\t\t\t\t\tonClick={ transformToLink }\n\t\t\t\t\t\tclassName=\"wp-block-navigation__submenu__revert\"\n\t\t\t\t\t\tisDisabled={ ! canConvertToLink }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\tvalue={ description || '' }\n\t\t\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tdescription: descriptionValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'The description will be displayed in the menu if the current theme supports it.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\t\tonChange={ ( titleValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { title: titleValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Link title' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ /* eslint-disable jsx-a11y/anchor-is-valid */ }\n\t\t\t\t<ParentElement className=\"wp-block-navigation-item__content\">\n\t\t\t\t\t{ /* eslint-enable */ }\n\t\t\t\t\t{\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\n\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\tonChange={ ( labelValue ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { label: labelValue } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\t\taria-label={ __( 'Navigation link text' ) }\n\t\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\t\tallowedFormats={ [\n\t\t\t\t\t\t\t\t'core/bold',\n\t\t\t\t\t\t\t\t'core/italic',\n\t\t\t\t\t\t\t\t'core/image',\n\t\t\t\t\t\t\t\t'core/strikethrough',\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\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\t{ ! openSubmenusOnClick && isLinkOpen && (\n\t\t\t\t\t\t<Popover\n\t\t\t\t\t\t\tposition=\"bottom center\"\n\t\t\t\t\t\t\tonClose={ () => setIsLinkOpen( false ) }\n\t\t\t\t\t\t\tanchorRef={ listItemRef.current }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<LinkControl\n\t\t\t\t\t\t\t\tclassName=\"wp-block-navigation-link__inline-link-input\"\n\t\t\t\t\t\t\t\tvalue={ link }\n\t\t\t\t\t\t\t\tshowInitialSuggestions={ true }\n\t\t\t\t\t\t\t\twithCreateSuggestion={ userCanCreate }\n\t\t\t\t\t\t\t\tcreateSuggestion={ handleCreate }\n\t\t\t\t\t\t\t\tcreateSuggestionButtonText={ ( searchTerm ) => {\n\t\t\t\t\t\t\t\t\tlet format;\n\t\t\t\t\t\t\t\t\tif ( type === 'post' ) {\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t\t\t\t\t\t\tformat = __(\n\t\t\t\t\t\t\t\t\t\t\t'Create draft post: <mark>%s</mark>'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t\t\t\t\t\t\tformat = __(\n\t\t\t\t\t\t\t\t\t\t\t'Create draft page: <mark>%s</mark>'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn createInterpolateElement(\n\t\t\t\t\t\t\t\t\t\tsprintf( format, searchTerm ),\n\t\t\t\t\t\t\t\t\t\t{ mark: <mark /> }\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\tnoDirectEntry={ !! type }\n\t\t\t\t\t\t\t\tnoURLSuggestion={ !! type }\n\t\t\t\t\t\t\t\tsuggestionsQuery={ getSuggestionsQuery(\n\t\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\t\tkind\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonChange={ ( updatedValue ) =>\n\t\t\t\t\t\t\t\t\tupdateNavigationLinkBlockAttributes(\n\t\t\t\t\t\t\t\t\t\tupdatedValue,\n\t\t\t\t\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\t\t\t\t\tattributes\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\tonRemove={ () => {\n\t\t\t\t\t\t\t\t\tsetAttributes( { url: '' } );\n\t\t\t\t\t\t\t\t\tspeak( __( 'Link removed.' ), 'assertive' );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Popover>\n\t\t\t\t\t) }\n\t\t\t\t</ParentElement>\n\t\t\t\t{ ( showSubmenuIcon || openSubmenusOnClick ) && (\n\t\t\t\t\t<span className=\"wp-block-navigation__submenu-icon\">\n\t\t\t\t\t\t<ItemSubmenuIcon />\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</div>\n\t\t</Fragment>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/navigation-submenu/edit.js"],"names":["ALLOWED_BLOCKS","DEFAULT_BLOCK","name","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener","getSuggestionsQuery","type","kind","subtype","getColors","context","isSubMenu","textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","style","colors","color","text","background","updateNavigationLinkBlockAttributes","updatedValue","setAttributes","blockAttributes","label","originalLabel","originalKind","originalType","title","url","opensInNewTab","id","newKind","newType","normalizedTitle","replace","normalizedURL","escapeTitle","isBuiltInType","indexOf","isCustomLink","encodeURI","undefined","Number","isInteger","NavigationSubmenuEdit","attributes","isSelected","mergeBlocks","onReplace","clientId","description","rel","link","showSubmenuIcon","maxNestingLevel","openSubmenusOnClick","saveEntityRecord","coreStore","__unstableMarkNextChangeAsNotPersistent","replaceBlock","blockEditorStore","isLinkOpen","setIsLinkOpen","listItemRef","itemLabelPlaceholder","ref","isAtMaxNesting","isTopLevelItem","isParentOfSelectedBlock","isImmediateParentOfSelectedBlock","hasChildren","selectedBlockHasChildren","userCanCreatePages","userCanCreatePosts","onlyDescendantIsEmptyLink","select","hasSelectedInnerBlock","getSelectedBlockClientId","getBlockParentsByBlockName","getBlock","getBlockCount","getBlockOrder","_onlyDescendantIsEmptyLink","selectedBlockId","selectedBlockChildren","length","singleBlock","canUser","test","selectLabelText","focus","defaultView","selection","getSelection","range","createRange","selectNodeContents","removeAllRanges","addRange","userCanCreate","handleCreate","pageTitle","postType","page","status","rendered","onKeyDown","isKeyboardEvent","primary","blockProps","className","innerBlocksColors","allowedBlocks","innerBlocksProps","__experimentalDefaultBlock","__experimentalDirectInsert","__experimentalCaptureToolbars","renderAppender","InnerBlocks","ButtonBlockAppender","ParentElement","transformToLink","newLinkBlock","canConvertToLink","linkIcon","displayShortcut","removeSubmenu","descriptionValue","titleValue","relValue","labelValue","searchTerm","format","mark"],"mappings":";;;;;;;;;;AAgCA;;AA7BA;;AACA;;AAKA;;AACA;;AAQA;;AACA;;AACA;;AAWA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAhDA;AACA;AACA;;AAIA;AACA;AACA;;AAqCA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAMA,cAAc,GAAG,CAAE,sBAAF,EAA0B,yBAA1B,CAAvB;AAEA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,IAAI,EAAE;AADe,CAAtB;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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AAEyB,eAAe,IAAIE,mBAArB,KACD;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC,4BAAC,uBAAD,OADD,CAnFF,EAuFC,mCAAU0D,gBAAV,CAvFD,CAvDD,CADD;AAmJA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { escape, without } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPanelBody,\n\tPopover,\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tInnerBlocks,\n\tuseInnerBlocksProps,\n\tInspectorControls,\n\tRichText,\n\t__experimentalLinkControl as LinkControl,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tgetColorClassName,\n} from '@wordpress/block-editor';\nimport { isURL, prependHTTP, safeDecodeURI } from '@wordpress/url';\nimport {\n\tFragment,\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport { placeCaretAtHorizontalEdge } from '@wordpress/dom';\nimport { link as linkIcon, removeSubmenu } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { speak } from '@wordpress/a11y';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { ItemSubmenuIcon } from './icons';\nimport { name } from './block.json';\n\nconst ALLOWED_BLOCKS = [ 'core/navigation-link', 'core/navigation-submenu' ];\n\nconst DEFAULT_BLOCK = {\n\tname: 'core/navigation-link',\n};\n\n/**\n * A React hook to determine if it's dragging within the target element.\n *\n * @typedef {import('@wordpress/element').RefObject} RefObject\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the target element.\n */\nconst useIsDraggingWithin = ( elementRef ) => {\n\tconst [ isDraggingWithin, setIsDraggingWithin ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart( event ) {\n\t\t\t// Check the first time when the dragging starts.\n\t\t\thandleDragEnter( event );\n\t\t}\n\n\t\t// Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDraggingWithin( false );\n\t\t}\n\n\t\tfunction handleDragEnter( event ) {\n\t\t\t// Check if the current target is inside the item element.\n\t\t\tif ( elementRef.current.contains( event.target ) ) {\n\t\t\t\tsetIsDraggingWithin( true );\n\t\t\t} else {\n\t\t\t\tsetIsDraggingWithin( false );\n\t\t\t}\n\t\t}\n\n\t\t// Bind these events to the document to catch all drag events.\n\t\t// Ideally, we can also use `event.relatedTarget`, but sadly that\n\t\t// doesn't work in Safari.\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\t\townerDocument.addEventListener( 'dragenter', handleDragEnter );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener( 'dragstart', handleDragStart );\n\t\t\townerDocument.removeEventListener( 'dragend', handleDragEnd );\n\t\t\townerDocument.removeEventListener( 'dragenter', handleDragEnter );\n\t\t};\n\t}, [] );\n\n\treturn isDraggingWithin;\n};\n\n/**\n * Given the Link block's type attribute, return the query params to give to\n * /wp/v2/search.\n *\n * @param {string} type Link block's type attribute.\n * @param {string} kind Link block's entity of kind (post-type|taxonomy)\n * @return {{ type?: string, subtype?: string }} Search query params.\n */\nfunction getSuggestionsQuery( type, kind ) {\n\tswitch ( type ) {\n\t\tcase 'post':\n\t\tcase 'page':\n\t\t\treturn { type: 'post', subtype: type };\n\t\tcase 'category':\n\t\t\treturn { type: 'term', subtype: 'category' };\n\t\tcase 'tag':\n\t\t\treturn { type: 'term', subtype: 'post_tag' };\n\t\tcase 'post_format':\n\t\t\treturn { type: 'post-format' };\n\t\tdefault:\n\t\t\tif ( kind === 'taxonomy' ) {\n\t\t\t\treturn { type: 'term', subtype: type };\n\t\t\t}\n\t\t\tif ( kind === 'post-type' ) {\n\t\t\t\treturn { type: 'post', subtype: type };\n\t\t\t}\n\t\t\treturn {};\n\t}\n}\n\n/**\n * Determine the colors for a menu.\n *\n * Order of priority is:\n * 1: Overlay custom colors (if submenu)\n * 2: Overlay theme colors (if submenu)\n * 3: Custom colors\n * 4: Theme colors\n * 5: Global styles\n *\n * @param {Object} context\n * @param {boolean} isSubMenu\n */\nfunction getColors( context, isSubMenu ) {\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t\toverlayTextColor,\n\t\tcustomOverlayTextColor,\n\t\toverlayBackgroundColor,\n\t\tcustomOverlayBackgroundColor,\n\t\tstyle,\n\t} = context;\n\n\tconst colors = {};\n\n\tif ( isSubMenu && !! customOverlayTextColor ) {\n\t\tcolors.customTextColor = customOverlayTextColor;\n\t} else if ( isSubMenu && !! overlayTextColor ) {\n\t\tcolors.textColor = overlayTextColor;\n\t} else if ( !! customTextColor ) {\n\t\tcolors.customTextColor = customTextColor;\n\t} else if ( !! textColor ) {\n\t\tcolors.textColor = textColor;\n\t} else if ( !! style?.color?.text ) {\n\t\tcolors.customTextColor = style.color.text;\n\t}\n\n\tif ( isSubMenu && !! customOverlayBackgroundColor ) {\n\t\tcolors.customBackgroundColor = customOverlayBackgroundColor;\n\t} else if ( isSubMenu && !! overlayBackgroundColor ) {\n\t\tcolors.backgroundColor = overlayBackgroundColor;\n\t} else if ( !! customBackgroundColor ) {\n\t\tcolors.customBackgroundColor = customBackgroundColor;\n\t} else if ( !! backgroundColor ) {\n\t\tcolors.backgroundColor = backgroundColor;\n\t} else if ( !! style?.color?.background ) {\n\t\tcolors.customTextColor = style.color.background;\n\t}\n\n\treturn colors;\n}\n\n/**\n * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind\n */\n\n/**\n * Navigation Link Block Attributes\n *\n * @typedef {Object} WPNavigationLinkBlockAttributes\n *\n * @property {string} [label] Link text.\n * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status.\n * @property {string} [type] The type such as post, page, tag, category and other custom types.\n * @property {string} [rel] The relationship of the linked URL.\n * @property {number} [id] A post or term id.\n * @property {boolean} [opensInNewTab] Sets link target to _blank when true.\n * @property {string} [url] Link href.\n * @property {string} [title] Link title attribute.\n */\n\n/**\n * Link Control onChange handler that updates block attributes when a setting is changed.\n *\n * @param {Object} updatedValue New block attributes to update.\n * @param {Function} setAttributes Block attribute update function.\n * @param {WPNavigationLinkBlockAttributes} blockAttributes Current block attributes.\n *\n */\nexport const updateNavigationLinkBlockAttributes = (\n\tupdatedValue = {},\n\tsetAttributes,\n\tblockAttributes = {}\n) => {\n\tconst {\n\t\tlabel: originalLabel = '',\n\t\tkind: originalKind = '',\n\t\ttype: originalType = '',\n\t} = blockAttributes;\n\tconst {\n\t\ttitle = '',\n\t\turl = '',\n\t\topensInNewTab,\n\t\tid,\n\t\tkind: newKind = originalKind,\n\t\ttype: newType = originalType,\n\t} = updatedValue;\n\n\tconst normalizedTitle = title.replace( /http(s?):\\/\\//gi, '' );\n\tconst normalizedURL = url.replace( /http(s?):\\/\\//gi, '' );\n\tconst escapeTitle =\n\t\ttitle !== '' &&\n\t\tnormalizedTitle !== normalizedURL &&\n\t\toriginalLabel !== title;\n\tconst label = escapeTitle\n\t\t? escape( title )\n\t\t: originalLabel || escape( normalizedURL );\n\n\t// In https://github.com/WordPress/gutenberg/pull/24670 we decided to use \"tag\" in favor of \"post_tag\"\n\tconst type = newType === 'post_tag' ? 'tag' : newType.replace( '-', '_' );\n\n\tconst isBuiltInType =\n\t\t[ 'post', 'page', 'tag', 'category' ].indexOf( type ) > -1;\n\n\tconst isCustomLink =\n\t\t( ! newKind && ! isBuiltInType ) || newKind === 'custom';\n\tconst kind = isCustomLink ? 'custom' : newKind;\n\n\tsetAttributes( {\n\t\t// Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.\n\t\t...( url && { url: encodeURI( safeDecodeURI( url ) ) } ),\n\t\t...( label && { label } ),\n\t\t...( undefined !== opensInNewTab && { opensInNewTab } ),\n\t\t...( id && Number.isInteger( id ) && { id } ),\n\t\t...( kind && { kind } ),\n\t\t...( type && type !== 'URL' && { type } ),\n\t} );\n};\n\nexport default function NavigationSubmenuEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tmergeBlocks,\n\tonReplace,\n\tcontext,\n\tclientId,\n} ) {\n\tconst {\n\t\tlabel,\n\t\ttype,\n\t\topensInNewTab,\n\t\turl,\n\t\tdescription,\n\t\trel,\n\t\ttitle,\n\t\tkind,\n\t} = attributes;\n\tconst link = {\n\t\turl,\n\t\topensInNewTab,\n\t};\n\tconst { showSubmenuIcon, maxNestingLevel, openSubmenusOnClick } = context;\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\tconst {\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\treplaceBlock,\n\t} = useDispatch( blockEditorStore );\n\tconst [ isLinkOpen, setIsLinkOpen ] = useState( false );\n\tconst listItemRef = useRef( null );\n\tconst isDraggingWithin = useIsDraggingWithin( listItemRef );\n\tconst itemLabelPlaceholder = __( 'Add text…' );\n\tconst ref = useRef();\n\n\tconst {\n\t\tisAtMaxNesting,\n\t\tisTopLevelItem,\n\t\tisParentOfSelectedBlock,\n\t\tisImmediateParentOfSelectedBlock,\n\t\thasChildren,\n\t\tselectedBlockHasChildren,\n\t\tuserCanCreatePages,\n\t\tuserCanCreatePosts,\n\t\tonlyDescendantIsEmptyLink,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\tgetBlock,\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockOrder,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tlet _onlyDescendantIsEmptyLink;\n\n\t\t\tconst selectedBlockId = getSelectedBlockClientId();\n\n\t\t\tconst selectedBlockChildren = getBlockOrder( selectedBlockId );\n\n\t\t\t// Check for a single descendant in the submenu. If that block\n\t\t\t// is a link block in a \"placeholder\" state with no label then\n\t\t\t// we can consider as an \"empty\" link.\n\t\t\tif ( selectedBlockChildren?.length === 1 ) {\n\t\t\t\tconst singleBlock = getBlock( selectedBlockChildren[ 0 ] );\n\n\t\t\t\t_onlyDescendantIsEmptyLink =\n\t\t\t\t\tsingleBlock?.name === 'core/navigation-link' &&\n\t\t\t\t\t! singleBlock?.attributes?.label;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tisAtMaxNesting:\n\t\t\t\t\tgetBlockParentsByBlockName( clientId, name ).length >=\n\t\t\t\t\tmaxNestingLevel,\n\t\t\t\tisTopLevelItem:\n\t\t\t\t\tgetBlockParentsByBlockName( clientId, name ).length === 0,\n\t\t\t\tisParentOfSelectedBlock: hasSelectedInnerBlock(\n\t\t\t\t\tclientId,\n\t\t\t\t\ttrue\n\t\t\t\t),\n\t\t\t\tisImmediateParentOfSelectedBlock: hasSelectedInnerBlock(\n\t\t\t\t\tclientId,\n\t\t\t\t\tfalse\n\t\t\t\t),\n\t\t\t\thasChildren: !! getBlockCount( clientId ),\n\t\t\t\tselectedBlockHasChildren: !! selectedBlockChildren?.length,\n\t\t\t\tuserCanCreatePages: select( coreStore ).canUser(\n\t\t\t\t\t'create',\n\t\t\t\t\t'pages'\n\t\t\t\t),\n\t\t\t\tuserCanCreatePosts: select( coreStore ).canUser(\n\t\t\t\t\t'create',\n\t\t\t\t\t'posts'\n\t\t\t\t),\n\t\t\t\tonlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\t// Show the LinkControl on mount if the URL is empty\n\t// ( When adding a new menu item)\n\t// This can't be done in the useState call because it conflicts\n\t// with the autofocus behavior of the BlockListBlock component.\n\tuseEffect( () => {\n\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}, [] );\n\n\t// Store the colors from context as attributes for rendering.\n\tuseEffect( () => {\n\t\t// This side-effect should not create an undo level as those should\n\t\t// only be created via user interactions. Mark this change as\n\t\t// not persistent to avoid undo level creation.\n\t\t// See https://github.com/WordPress/gutenberg/issues/34564.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\tsetAttributes( { isTopLevelItem } );\n\t}, [ isTopLevelItem ] );\n\n\t/**\n\t * The hook shouldn't be necessary but due to a focus loss happening\n\t * when selecting a suggestion in the link popover, we force close on block unselection.\n\t */\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsLinkOpen( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\t// If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.\n\tuseEffect( () => {\n\t\tif ( isLinkOpen && url ) {\n\t\t\t// Does this look like a URL and have something TLD-ish?\n\t\t\tif (\n\t\t\t\tisURL( prependHTTP( label ) ) &&\n\t\t\t\t/^.+\\.[a-z]+/.test( label )\n\t\t\t) {\n\t\t\t\t// Focus and select the label text.\n\t\t\t\tselectLabelText();\n\t\t\t} else {\n\t\t\t\t// Focus it (but do not select).\n\t\t\t\tplaceCaretAtHorizontalEdge( ref.current, true );\n\t\t\t}\n\t\t}\n\t}, [ url ] );\n\n\t/**\n\t * Focus the Link label text and select it.\n\t */\n\tfunction selectLabelText() {\n\t\tref.current.focus();\n\t\tconst { ownerDocument } = ref.current;\n\t\tconst { defaultView } = ownerDocument;\n\t\tconst selection = defaultView.getSelection();\n\t\tconst range = ownerDocument.createRange();\n\t\t// Get the range of the current ref contents so we can add this range to the selection.\n\t\trange.selectNodeContents( ref.current );\n\t\tselection.removeAllRanges();\n\t\tselection.addRange( range );\n\t}\n\n\tlet userCanCreate = false;\n\tif ( ! type || type === 'page' ) {\n\t\tuserCanCreate = userCanCreatePages;\n\t} else if ( type === 'post' ) {\n\t\tuserCanCreate = userCanCreatePosts;\n\t}\n\n\tasync function handleCreate( pageTitle ) {\n\t\tconst postType = type || 'page';\n\n\t\tconst page = await saveEntityRecord( 'postType', postType, {\n\t\t\ttitle: pageTitle,\n\t\t\tstatus: 'draft',\n\t\t} );\n\n\t\treturn {\n\t\t\tid: page.id,\n\t\t\ttype: postType,\n\t\t\ttitle: page.title.rendered,\n\t\t\turl: page.link,\n\t\t\tkind: 'post-type',\n\t\t};\n\t}\n\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t} = getColors( context, ! isTopLevelItem );\n\n\tfunction onKeyDown( event ) {\n\t\tif ( isKeyboardEvent.primary( event, 'k' ) ) {\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tref: listItemRef,\n\t\tclassName: classnames( 'wp-block-navigation-item', {\n\t\t\t'is-editing': isSelected || isParentOfSelectedBlock,\n\t\t\t'is-dragging-within': isDraggingWithin,\n\t\t\t'has-link': !! url,\n\t\t\t'has-child': hasChildren,\n\t\t\t'has-text-color': !! textColor || !! customTextColor,\n\t\t\t[ getColorClassName( 'color', textColor ) ]: !! textColor,\n\t\t\t'has-background': !! backgroundColor || customBackgroundColor,\n\t\t\t[ getColorClassName(\n\t\t\t\t'background-color',\n\t\t\t\tbackgroundColor\n\t\t\t) ]: !! backgroundColor,\n\t\t\t'open-on-click': openSubmenusOnClick,\n\t\t} ),\n\t\tstyle: {\n\t\t\tcolor: ! textColor && customTextColor,\n\t\t\tbackgroundColor: ! backgroundColor && customBackgroundColor,\n\t\t},\n\t\tonKeyDown,\n\t} );\n\n\t// Always use overlay colors for submenus.\n\tconst innerBlocksColors = getColors( context, true );\n\n\tconst allowedBlocks = isAtMaxNesting\n\t\t? without( ALLOWED_BLOCKS, 'core/navigation-submenu' )\n\t\t: ALLOWED_BLOCKS;\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tclassName: classnames( 'wp-block-navigation__submenu-container', {\n\t\t\t\t'is-parent-of-selected-block': isParentOfSelectedBlock,\n\t\t\t\t'has-text-color': !! (\n\t\t\t\t\tinnerBlocksColors.textColor ||\n\t\t\t\t\tinnerBlocksColors.customTextColor\n\t\t\t\t),\n\t\t\t\t[ `has-${ innerBlocksColors.textColor }-color` ]: !! innerBlocksColors.textColor,\n\t\t\t\t'has-background': !! (\n\t\t\t\t\tinnerBlocksColors.backgroundColor ||\n\t\t\t\t\tinnerBlocksColors.customBackgroundColor\n\t\t\t\t),\n\t\t\t\t[ `has-${ innerBlocksColors.backgroundColor }-background-color` ]: !! innerBlocksColors.backgroundColor,\n\t\t\t} ),\n\t\t\tstyle: {\n\t\t\t\tcolor: innerBlocksColors.customTextColor,\n\t\t\t\tbackgroundColor: innerBlocksColors.customBackgroundColor,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tallowedBlocks,\n\t\t\t__experimentalDefaultBlock: DEFAULT_BLOCK,\n\t\t\t__experimentalDirectInsert: true,\n\n\t\t\t// Ensure block toolbar is not too far removed from item\n\t\t\t// being edited.\n\t\t\t// see: https://github.com/WordPress/gutenberg/pull/34615.\n\t\t\t__experimentalCaptureToolbars: true,\n\n\t\t\trenderAppender:\n\t\t\t\tisSelected ||\n\t\t\t\t( isImmediateParentOfSelectedBlock &&\n\t\t\t\t\t! selectedBlockHasChildren ) ||\n\t\t\t\t// Show the appender while dragging to allow inserting element between item and the appender.\n\t\t\t\thasChildren\n\t\t\t\t\t? InnerBlocks.ButtonBlockAppender\n\t\t\t\t\t: false,\n\t\t}\n\t);\n\n\tconst ParentElement = openSubmenusOnClick ? 'button' : 'a';\n\n\tfunction transformToLink() {\n\t\tconst newLinkBlock = createBlock( 'core/navigation-link', attributes );\n\t\treplaceBlock( clientId, newLinkBlock );\n\t}\n\n\tconst canConvertToLink =\n\t\t! selectedBlockHasChildren || onlyDescendantIsEmptyLink;\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t{ ! openSubmenusOnClick && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\t\ticon={ linkIcon }\n\t\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\tonClick={ () => setIsLinkOpen( true ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"revert\"\n\t\t\t\t\t\ticon={ removeSubmenu }\n\t\t\t\t\t\ttitle={ __( 'Convert to Link' ) }\n\t\t\t\t\t\tonClick={ transformToLink }\n\t\t\t\t\t\tclassName=\"wp-block-navigation__submenu__revert\"\n\t\t\t\t\t\tisDisabled={ ! canConvertToLink }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\tvalue={ description || '' }\n\t\t\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tdescription: descriptionValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'The description will be displayed in the menu if the current theme supports it.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\t\tonChange={ ( titleValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { title: titleValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Link title' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ /* eslint-disable jsx-a11y/anchor-is-valid */ }\n\t\t\t\t<ParentElement className=\"wp-block-navigation-item__content\">\n\t\t\t\t\t{ /* eslint-enable */ }\n\t\t\t\t\t{\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\n\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\tonChange={ ( labelValue ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { label: labelValue } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\t\taria-label={ __( 'Navigation link text' ) }\n\t\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\t\tallowedFormats={ [\n\t\t\t\t\t\t\t\t'core/bold',\n\t\t\t\t\t\t\t\t'core/italic',\n\t\t\t\t\t\t\t\t'core/image',\n\t\t\t\t\t\t\t\t'core/strikethrough',\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\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\t{ ! openSubmenusOnClick && isLinkOpen && (\n\t\t\t\t\t\t<Popover\n\t\t\t\t\t\t\tposition=\"bottom center\"\n\t\t\t\t\t\t\tonClose={ () => setIsLinkOpen( false ) }\n\t\t\t\t\t\t\tanchorRef={ listItemRef.current }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<LinkControl\n\t\t\t\t\t\t\t\tclassName=\"wp-block-navigation-link__inline-link-input\"\n\t\t\t\t\t\t\t\tvalue={ link }\n\t\t\t\t\t\t\t\tshowInitialSuggestions={ true }\n\t\t\t\t\t\t\t\twithCreateSuggestion={ userCanCreate }\n\t\t\t\t\t\t\t\tcreateSuggestion={ handleCreate }\n\t\t\t\t\t\t\t\tcreateSuggestionButtonText={ ( searchTerm ) => {\n\t\t\t\t\t\t\t\t\tlet format;\n\t\t\t\t\t\t\t\t\tif ( type === 'post' ) {\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t\t\t\t\t\t\tformat = __(\n\t\t\t\t\t\t\t\t\t\t\t'Create draft post: <mark>%s</mark>'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t\t\t\t\t\t\tformat = __(\n\t\t\t\t\t\t\t\t\t\t\t'Create draft page: <mark>%s</mark>'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn createInterpolateElement(\n\t\t\t\t\t\t\t\t\t\tsprintf( format, searchTerm ),\n\t\t\t\t\t\t\t\t\t\t{ mark: <mark /> }\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\tnoDirectEntry={ !! type }\n\t\t\t\t\t\t\t\tnoURLSuggestion={ !! type }\n\t\t\t\t\t\t\t\tsuggestionsQuery={ getSuggestionsQuery(\n\t\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\t\tkind\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonChange={ ( updatedValue ) =>\n\t\t\t\t\t\t\t\t\tupdateNavigationLinkBlockAttributes(\n\t\t\t\t\t\t\t\t\t\tupdatedValue,\n\t\t\t\t\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\t\t\t\t\tattributes\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\tonRemove={ () => {\n\t\t\t\t\t\t\t\t\tsetAttributes( { url: '' } );\n\t\t\t\t\t\t\t\t\tspeak( __( 'Link removed.' ), 'assertive' );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Popover>\n\t\t\t\t\t) }\n\t\t\t\t</ParentElement>\n\t\t\t\t{ ( showSubmenuIcon || openSubmenusOnClick ) && (\n\t\t\t\t\t<span className=\"wp-block-navigation__submenu-icon\">\n\t\t\t\t\t\t<ItemSubmenuIcon />\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</div>\n\t\t</Fragment>\n\t);\n}\n"]}
@@ -23,6 +23,8 @@ var _blocks = require("@wordpress/blocks");
23
23
 
24
24
  var _icons = require("@wordpress/icons");
25
25
 
26
+ var _useEnter = require("./use-enter");
27
+
26
28
  /**
27
29
  * External dependencies
28
30
  */
@@ -30,6 +32,10 @@ var _icons = require("@wordpress/icons");
30
32
  /**
31
33
  * WordPress dependencies
32
34
  */
35
+
36
+ /**
37
+ * Internal dependencies
38
+ */
33
39
  const name = 'core/paragraph';
34
40
 
35
41
  function ParagraphRTLControl(_ref) {
@@ -69,6 +75,10 @@ function ParagraphBlock(_ref2) {
69
75
  } = attributes;
70
76
  const isDropCapFeatureEnabled = (0, _blockEditor.useSetting)('typography.dropCap');
71
77
  const blockProps = (0, _blockEditor.useBlockProps)({
78
+ ref: (0, _useEnter.useOnEnter)({
79
+ clientId,
80
+ content
81
+ }),
72
82
  className: (0, _classnames.default)({
73
83
  'has-drop-cap': dropCap,
74
84
  [`has-text-align-${align}`]: align
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/paragraph/edit.js"],"names":["name","ParagraphRTLControl","direction","setDirection","icon","formatLtr","title","isActive","onClick","undefined","ParagraphBlock","attributes","mergeBlocks","onReplace","onRemove","setAttributes","clientId","align","content","dropCap","placeholder","isDropCapFeatureEnabled","blockProps","className","style","newAlign","newDirection","newContent","value","isOriginal","newAttributes","block"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AAQA;;AACA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;AAkBA,MAAMA,IAAI,GAAG,gBAAb;;AAEA,SAASC,mBAAT,OAA4D;AAAA,MAA9B;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,GAA8B;AAC3D,SACC,sBACC,4BAAC,+BAAD;AACC,IAAA,QAAQ,EAAG,CACV;AACCC,MAAAA,IAAI,EAAEC,gBADP;AAECC,MAAAA,KAAK,EAAE,cAAI,eAAJ,EAAqB,eAArB,CAFR;AAGCC,MAAAA,QAAQ,EAAEL,SAAS,KAAK,KAHzB;;AAICM,MAAAA,OAAO,GAAG;AACTL,QAAAA,YAAY,CACXD,SAAS,KAAK,KAAd,GAAsBO,SAAtB,GAAkC,KADvB,CAAZ;AAGA;;AARF,KADU;AADZ,IAFF;AAkBA;;AAED,SAASC,cAAT,QAOI;AAAA,MAPqB;AACxBC,IAAAA,UADwB;AAExBC,IAAAA,WAFwB;AAGxBC,IAAAA,SAHwB;AAIxBC,IAAAA,QAJwB;AAKxBC,IAAAA,aALwB;AAMxBC,IAAAA;AANwB,GAOrB;AACH,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA,OAAT;AAAkBhB,IAAAA,SAAlB;AAA6BiB,IAAAA,OAA7B;AAAsCC,IAAAA;AAAtC,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AJf;AAMC,IAAA,IAAI,EACHA,OAAO,GACJ,cAAI,+BAAJ,CADI,GAEJ,cACA,wCADA;AATL,IATD,CADD,CAhBF,EA2CC,4BAAC,qBAAD;AACC,IAAA,UAAU,EAAC,SADZ;AAEC,IAAA,OAAO,EAAC;AAFT,KAGMG,UAHN;AAIC,IAAA,KAAK,EAAGJ,OAJT;AAKC,IAAA,QAAQ,EAAKS,UAAF,IACVZ,aAAa,CAAE;AAAEG,MAAAA,OAAO,EAAES;AAAX,KAAF,CANf;AAQC,IAAA,OAAO,EAAG,CAAEC,KAAF,EAASC,UAAT,KAAyB;AAClC,UAAIC,aAAJ;;AAEA,UAAKD,UAAU,IAAID,KAAnB,EAA2B;AAC1BE,QAAAA,aAAa,GAAG,EACf,GAAGnB,UADY;AAEfO,UAAAA,OAAO,EAAEU;AAFM,SAAhB;AAIA;;AAED,YAAMG,KAAK,GAAG,yBAAa/B,IAAb,EAAmB8B,aAAnB,CAAd;;AAEA,UAAKD,UAAL,EAAkB;AACjBE,QAAAA,KAAK,CAACf,QAAN,GAAiBA,QAAjB;AACA;;AAED,aAAOe,KAAP;AACA,KAzBF;AA0BC,IAAA,OAAO,EAAGnB,WA1BX;AA2BC,IAAA,SAAS,EAAGC,SA3Bb;AA4BC,IAAA,QAAQ,EAAGC,QA5BZ;AA6BC,kBACCI,OAAO,GACJ,cAAI,iBAAJ,CADI,GAEJ,cACA,oEADA,CAhCL;AAoCC,kBAAaA,OAAO,GAAG,KAAH,GAAW,IApChC;AAqCC,IAAA,WAAW,EAAGE,WAAW,IAAI,cAAI,0BAAJ,CArC9B;AAsCC,IAAA,yBAAyB,MAtC1B;AAuCC,IAAA,oCAAoC;AAvCrC,KA3CD,CADD;AAuFA;;eAEcV,c","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, isRTL } from '@wordpress/i18n';\nimport {\n\tToolbarDropdownMenu,\n\tToggleControl,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tuseSetting,\n} from '@wordpress/block-editor';\nimport { createBlock } from '@wordpress/blocks';\nimport { formatLtr } from '@wordpress/icons';\n\nconst name = 'core/paragraph';\n\nfunction ParagraphRTLControl( { direction, setDirection } ) {\n\treturn (\n\t\tisRTL() && (\n\t\t\t<ToolbarDropdownMenu\n\t\t\t\tcontrols={ [\n\t\t\t\t\t{\n\t\t\t\t\t\ticon: formatLtr,\n\t\t\t\t\t\ttitle: _x( 'Left to right', 'editor button' ),\n\t\t\t\t\t\tisActive: direction === 'ltr',\n\t\t\t\t\t\tonClick() {\n\t\t\t\t\t\t\tsetDirection(\n\t\t\t\t\t\t\t\tdirection === 'ltr' ? undefined : 'ltr'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t)\n\t);\n}\n\nfunction ParagraphBlock( {\n\tattributes,\n\tmergeBlocks,\n\tonReplace,\n\tonRemove,\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst { align, content, direction, dropCap, placeholder } = attributes;\n\tconst isDropCapFeatureEnabled = useSetting( 'typography.dropCap' );\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t'has-drop-cap': dropCap,\n\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t} ),\n\t\tstyle: { direction },\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ align }\n\t\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\t\tsetAttributes( { align: newAlign } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<ParagraphRTLControl\n\t\t\t\t\tdirection={ direction }\n\t\t\t\t\tsetDirection={ ( newDirection ) =>\n\t\t\t\t\t\tsetAttributes( { direction: newDirection } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t{ isDropCapFeatureEnabled && (\n\t\t\t\t<InspectorControls __experimentalGroup=\"typography\">\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => !! dropCap }\n\t\t\t\t\t\tlabel={ __( 'Drop cap' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { dropCap: undefined } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresetAllFilter={ () => ( { dropCap: undefined } ) }\n\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Drop cap' ) }\n\t\t\t\t\t\t\tchecked={ !! dropCap }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { dropCap: ! dropCap } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tdropCap\n\t\t\t\t\t\t\t\t\t? __( 'Showing large initial letter.' )\n\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t'Toggle to show a large initial letter.'\n\t\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</InspectorControls>\n\t\t\t) }\n\t\t\t<RichText\n\t\t\t\tidentifier=\"content\"\n\t\t\t\ttagName=\"p\"\n\t\t\t\t{ ...blockProps }\n\t\t\t\tvalue={ content }\n\t\t\t\tonChange={ ( newContent ) =>\n\t\t\t\t\tsetAttributes( { content: newContent } )\n\t\t\t\t}\n\t\t\t\tonSplit={ ( value, isOriginal ) => {\n\t\t\t\t\tlet newAttributes;\n\n\t\t\t\t\tif ( isOriginal || value ) {\n\t\t\t\t\t\tnewAttributes = {\n\t\t\t\t\t\t\t...attributes,\n\t\t\t\t\t\t\tcontent: value,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\tconst block = createBlock( name, newAttributes );\n\n\t\t\t\t\tif ( isOriginal ) {\n\t\t\t\t\t\tblock.clientId = clientId;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn block;\n\t\t\t\t} }\n\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\tonReplace={ onReplace }\n\t\t\t\tonRemove={ onRemove }\n\t\t\t\taria-label={\n\t\t\t\t\tcontent\n\t\t\t\t\t\t? __( 'Paragraph block' )\n\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t'Empty block; start writing or type forward slash to choose a block'\n\t\t\t\t\t\t )\n\t\t\t\t}\n\t\t\t\tdata-empty={ content ? false : true }\n\t\t\t\tplaceholder={ placeholder || __( 'Type / to choose a block' ) }\n\t\t\t\t__unstableEmbedURLOnPaste\n\t\t\t\t__unstableAllowPrefixTransformations\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ParagraphBlock;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/paragraph/edit.js"],"names":["name","ParagraphRTLControl","direction","setDirection","icon","formatLtr","title","isActive","onClick","undefined","ParagraphBlock","attributes","mergeBlocks","onReplace","onRemove","setAttributes","clientId","align","content","dropCap","placeholder","isDropCapFeatureEnabled","blockProps","ref","className","style","newAlign","newDirection","newContent","value","isOriginal","newAttributes","block"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AAKA;;AAQA;;AACA;;AAKA;;AA5BA;AACA;AACA;;AAGA;AACA;AACA;;AAkBA;AACA;AACA;AAGA,MAAMA,IAAI,GAAG,gBAAb;;AAEA,SAASC,mBAAT,OAA4D;AAAA,MAA9B;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,GAA8B;AAC3D,SACC,sBACC,4BAAC,+BAAD;AACC,IAAA,QAAQ,EAAG,CACV;AACCC,MAAAA,IAAI,EAAEC,gBADP;AAECC,MAAAA,KAA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EAAkB;AACjBE,QAAAA,KAAK,CAAChB,QAAN,GAAiBA,QAAjB;AACA;;AAED,aAAOgB,KAAP;AACA,KAzBF;AA0BC,IAAA,OAAO,EAAGpB,WA1BX;AA2BC,IAAA,SAAS,EAAGC,SA3Bb;AA4BC,IAAA,QAAQ,EAAGC,QA5BZ;AA6BC,kBACCI,OAAO,GACJ,cAAI,iBAAJ,CADI,GAEJ,cACA,oEADA,CAhCL;AAoCC,kBAAaA,OAAO,GAAG,KAAH,GAAW,IApChC;AAqCC,IAAA,WAAW,EAAGE,WAAW,IAAI,cAAI,0BAAJ,CArC9B;AAsCC,IAAA,yBAAyB,MAtC1B;AAuCC,IAAA,oCAAoC;AAvCrC,KA3CD,CADD;AAuFA;;eAEcV,c","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, isRTL } from '@wordpress/i18n';\nimport {\n\tToolbarDropdownMenu,\n\tToggleControl,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tuseSetting,\n} from '@wordpress/block-editor';\nimport { createBlock } from '@wordpress/blocks';\nimport { formatLtr } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useOnEnter } from './use-enter';\n\nconst name = 'core/paragraph';\n\nfunction ParagraphRTLControl( { direction, setDirection } ) {\n\treturn (\n\t\tisRTL() && (\n\t\t\t<ToolbarDropdownMenu\n\t\t\t\tcontrols={ [\n\t\t\t\t\t{\n\t\t\t\t\t\ticon: formatLtr,\n\t\t\t\t\t\ttitle: _x( 'Left to right', 'editor button' ),\n\t\t\t\t\t\tisActive: direction === 'ltr',\n\t\t\t\t\t\tonClick() {\n\t\t\t\t\t\t\tsetDirection(\n\t\t\t\t\t\t\t\tdirection === 'ltr' ? undefined : 'ltr'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t)\n\t);\n}\n\nfunction ParagraphBlock( {\n\tattributes,\n\tmergeBlocks,\n\tonReplace,\n\tonRemove,\n\tsetAttributes,\n\tclientId,\n} ) {\n\tconst { align, content, direction, dropCap, placeholder } = attributes;\n\tconst isDropCapFeatureEnabled = useSetting( 'typography.dropCap' );\n\tconst blockProps = useBlockProps( {\n\t\tref: useOnEnter( { clientId, content } ),\n\t\tclassName: classnames( {\n\t\t\t'has-drop-cap': dropCap,\n\t\t\t[ `has-text-align-${ align }` ]: align,\n\t\t} ),\n\t\tstyle: { direction },\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ align }\n\t\t\t\t\tonChange={ ( newAlign ) =>\n\t\t\t\t\t\tsetAttributes( { align: newAlign } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<ParagraphRTLControl\n\t\t\t\t\tdirection={ direction }\n\t\t\t\t\tsetDirection={ ( newDirection ) =>\n\t\t\t\t\t\tsetAttributes( { direction: newDirection } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t\t{ isDropCapFeatureEnabled && (\n\t\t\t\t<InspectorControls __experimentalGroup=\"typography\">\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => !! dropCap }\n\t\t\t\t\t\tlabel={ __( 'Drop cap' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { dropCap: undefined } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresetAllFilter={ () => ( { dropCap: undefined } ) }\n\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Drop cap' ) }\n\t\t\t\t\t\t\tchecked={ !! dropCap }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { dropCap: ! dropCap } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tdropCap\n\t\t\t\t\t\t\t\t\t? __( 'Showing large initial letter.' )\n\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t'Toggle to show a large initial letter.'\n\t\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</InspectorControls>\n\t\t\t) }\n\t\t\t<RichText\n\t\t\t\tidentifier=\"content\"\n\t\t\t\ttagName=\"p\"\n\t\t\t\t{ ...blockProps }\n\t\t\t\tvalue={ content }\n\t\t\t\tonChange={ ( newContent ) =>\n\t\t\t\t\tsetAttributes( { content: newContent } )\n\t\t\t\t}\n\t\t\t\tonSplit={ ( value, isOriginal ) => {\n\t\t\t\t\tlet newAttributes;\n\n\t\t\t\t\tif ( isOriginal || value ) {\n\t\t\t\t\t\tnewAttributes = {\n\t\t\t\t\t\t\t...attributes,\n\t\t\t\t\t\t\tcontent: value,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\tconst block = createBlock( name, newAttributes );\n\n\t\t\t\t\tif ( isOriginal ) {\n\t\t\t\t\t\tblock.clientId = clientId;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn block;\n\t\t\t\t} }\n\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\tonReplace={ onReplace }\n\t\t\t\tonRemove={ onRemove }\n\t\t\t\taria-label={\n\t\t\t\t\tcontent\n\t\t\t\t\t\t? __( 'Paragraph block' )\n\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t'Empty block; start writing or type forward slash to choose a block'\n\t\t\t\t\t\t )\n\t\t\t\t}\n\t\t\t\tdata-empty={ content ? false : true }\n\t\t\t\tplaceholder={ placeholder || __( 'Type / to choose a block' ) }\n\t\t\t\t__unstableEmbedURLOnPaste\n\t\t\t\t__unstableAllowPrefixTransformations\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default ParagraphBlock;\n"]}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useOnEnter = useOnEnter;
7
+
8
+ var _element = require("@wordpress/element");
9
+
10
+ var _compose = require("@wordpress/compose");
11
+
12
+ var _keycodes = require("@wordpress/keycodes");
13
+
14
+ var _data = require("@wordpress/data");
15
+
16
+ var _blockEditor = require("@wordpress/block-editor");
17
+
18
+ var _blocks = require("@wordpress/blocks");
19
+
20
+ /**
21
+ * WordPress dependencies
22
+ */
23
+ function useOnEnter(props) {
24
+ const {
25
+ batch
26
+ } = (0, _data.useRegistry)();
27
+ const {
28
+ moveBlocksToPosition,
29
+ replaceInnerBlocks,
30
+ duplicateBlocks,
31
+ insertBlock
32
+ } = (0, _data.useDispatch)(_blockEditor.store);
33
+ const {
34
+ getBlockRootClientId,
35
+ getBlockIndex,
36
+ getBlockOrder,
37
+ getBlockName,
38
+ getBlock,
39
+ getNextBlockClientId
40
+ } = (0, _data.useSelect)(_blockEditor.store);
41
+ const propsRef = (0, _element.useRef)(props);
42
+ propsRef.current = props;
43
+ return (0, _compose.useRefEffect)(element => {
44
+ function onKeyDown(event) {
45
+ if (event.defaultPrevented) {
46
+ return;
47
+ }
48
+
49
+ if (event.keyCode !== _keycodes.ENTER) {
50
+ return;
51
+ }
52
+
53
+ const {
54
+ content,
55
+ clientId
56
+ } = propsRef.current; // The paragraph should be empty.
57
+
58
+ if (content.length) {
59
+ return;
60
+ }
61
+
62
+ const wrapperClientId = getBlockRootClientId(clientId);
63
+
64
+ if (!(0, _blocks.hasBlockSupport)(getBlockName(wrapperClientId), '__experimentalOnEnter', false)) {
65
+ return;
66
+ }
67
+
68
+ const order = getBlockOrder(wrapperClientId);
69
+ event.preventDefault();
70
+ const position = order.indexOf(clientId); // If it is the last block, exit.
71
+
72
+ if (position === order.length - 1) {
73
+ moveBlocksToPosition([clientId], wrapperClientId, getBlockRootClientId(wrapperClientId), getBlockIndex(wrapperClientId) + 1);
74
+ return;
75
+ } // If it is in the middle, split the block in two.
76
+
77
+
78
+ const wrapperBlock = getBlock(wrapperClientId);
79
+ batch(() => {
80
+ duplicateBlocks([wrapperClientId]);
81
+ const blockIndex = getBlockIndex(wrapperClientId);
82
+ replaceInnerBlocks(wrapperClientId, wrapperBlock.innerBlocks.slice(0, position));
83
+ replaceInnerBlocks(getNextBlockClientId(wrapperClientId), wrapperBlock.innerBlocks.slice(position + 1));
84
+ insertBlock((0, _blocks.createBlock)('core/paragraph'), blockIndex + 1, getBlockRootClientId(wrapperClientId), true);
85
+ });
86
+ }
87
+
88
+ element.addEventListener('keydown', onKeyDown);
89
+ return () => {
90
+ element.removeEventListener('keydown', onKeyDown);
91
+ };
92
+ }, []);
93
+ }
94
+ //# sourceMappingURL=use-enter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/block-library/src/paragraph/use-enter.js"],"names":["useOnEnter","props","batch","moveBlocksToPosition","replaceInnerBlocks","duplicateBlocks","insertBlock","blockEditorStore","getBlockRootClientId","getBlockIndex","getBlockOrder","getBlockName","getBlock","getNextBlockClientId","propsRef","current","element","onKeyDown","event","defaultPrevented","keyCode","ENTER","content","clientId","length","wrapperClientId","order","preventDefault","position","indexOf","wrapperBlock","blockIndex","innerBlocks","slice","addEventListener","removeEventListener"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AARA;AACA;AACA;AAQO,SAASA,UAAT,CAAqBC,KAArB,EAA6B;AACnC,QAAM;AAAEC,IAAAA;AAAF,MAAY,wBAAlB;AACA,QAAM;AACLC,IAAAA,oBADK;AAELC,IAAAA,kBAFK;AAGLC,IAAAA,eAHK;AAILC,IAAAA;AAJK,MAKF,uBAAaC,kBAAb,CALJ;AAMA,QAAM;AACLC,IAAAA,oBADK;AAELC,IAAAA,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E,CAAEoB,eAAF,CAAF,CAAf;AACA,cAAMM,UAAU,GAAGtB,aAAa,CAAEgB,eAAF,CAAhC;AAEArB,QAAAA,kBAAkB,CACjBqB,eADiB,EAEjBK,YAAY,CAACE,WAAb,CAAyBC,KAAzB,CAAgC,CAAhC,EAAmCL,QAAnC,CAFiB,CAAlB;AAIAxB,QAAAA,kBAAkB,CACjBS,oBAAoB,CAAEY,eAAF,CADH,EAEjBK,YAAY,CAACE,WAAb,CAAyBC,KAAzB,CAAgCL,QAAQ,GAAG,CAA3C,CAFiB,CAAlB;AAIAtB,QAAAA,WAAW,CACV,yBAAa,gBAAb,CADU,EAEVyB,UAAU,GAAG,CAFH,EAGVvB,oBAAoB,CAAEiB,eAAF,CAHV,EAIV,IAJU,CAAX;AAMA,OAlBI,CAAL;AAmBA;;AAEDT,IAAAA,OAAO,CAACkB,gBAAR,CAA0B,SAA1B,EAAqCjB,SAArC;AACA,WAAO,MAAM;AACZD,MAAAA,OAAO,CAACmB,mBAAR,CAA6B,SAA7B,EAAwClB,SAAxC;AACA,KAFD;AAGA,GAzEM,EAyEJ,EAzEI,CAAP;AA0EA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef } from '@wordpress/element';\nimport { useRefEffect } from '@wordpress/compose';\nimport { ENTER } from '@wordpress/keycodes';\nimport { useSelect, useDispatch, useRegistry } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { hasBlockSupport, createBlock } from '@wordpress/blocks';\n\nexport function useOnEnter( props ) {\n\tconst { batch } = useRegistry();\n\tconst {\n\t\tmoveBlocksToPosition,\n\t\treplaceInnerBlocks,\n\t\tduplicateBlocks,\n\t\tinsertBlock,\n\t} = useDispatch( blockEditorStore );\n\tconst {\n\t\tgetBlockRootClientId,\n\t\tgetBlockIndex,\n\t\tgetBlockOrder,\n\t\tgetBlockName,\n\t\tgetBlock,\n\t\tgetNextBlockClientId,\n\t} = useSelect( blockEditorStore );\n\tconst propsRef = useRef( props );\n\tpropsRef.current = props;\n\treturn useRefEffect( ( element ) => {\n\t\tfunction onKeyDown( event ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( event.keyCode !== ENTER ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { content, clientId } = propsRef.current;\n\n\t\t\t// The paragraph should be empty.\n\t\t\tif ( content.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst wrapperClientId = getBlockRootClientId( clientId );\n\n\t\t\tif (\n\t\t\t\t! hasBlockSupport(\n\t\t\t\t\tgetBlockName( wrapperClientId ),\n\t\t\t\t\t'__experimentalOnEnter',\n\t\t\t\t\tfalse\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst order = getBlockOrder( wrapperClientId );\n\n\t\t\tevent.preventDefault();\n\n\t\t\tconst position = order.indexOf( clientId );\n\n\t\t\t// If it is the last block, exit.\n\t\t\tif ( position === order.length - 1 ) {\n\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\t[ clientId ],\n\t\t\t\t\twrapperClientId,\n\t\t\t\t\tgetBlockRootClientId( wrapperClientId ),\n\t\t\t\t\tgetBlockIndex( wrapperClientId ) + 1\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If it is in the middle, split the block in two.\n\t\t\tconst wrapperBlock = getBlock( wrapperClientId );\n\t\t\tbatch( () => {\n\t\t\t\tduplicateBlocks( [ wrapperClientId ] );\n\t\t\t\tconst blockIndex = getBlockIndex( wrapperClientId );\n\n\t\t\t\treplaceInnerBlocks(\n\t\t\t\t\twrapperClientId,\n\t\t\t\t\twrapperBlock.innerBlocks.slice( 0, position )\n\t\t\t\t);\n\t\t\t\treplaceInnerBlocks(\n\t\t\t\t\tgetNextBlockClientId( wrapperClientId ),\n\t\t\t\t\twrapperBlock.innerBlocks.slice( position + 1 )\n\t\t\t\t);\n\t\t\t\tinsertBlock(\n\t\t\t\t\tcreateBlock( 'core/paragraph' ),\n\t\t\t\t\tblockIndex + 1,\n\t\t\t\t\tgetBlockRootClientId( wrapperClientId ),\n\t\t\t\t\ttrue\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\telement.addEventListener( 'keydown', onKeyDown );\n\t\treturn () => {\n\t\t\telement.removeEventListener( 'keydown', onKeyDown );\n\t\t};\n\t}, [] );\n}\n"]}
@@ -26,7 +26,7 @@ const metadata = {
26
26
  name: "core/post-comment",
27
27
  title: "Post Comment (deprecated)",
28
28
  category: "theme",
29
- description: "This block is deprecated. Please use the Comments Query Loop block instead.",
29
+ description: "This block is deprecated. Please use the Comments block instead.",
30
30
  textdomain: "default",
31
31
  attributes: {
32
32
  commentId: {
@@ -11,14 +11,18 @@ var _element = require("@wordpress/element");
11
11
 
12
12
  var _classnames = _interopRequireDefault(require("classnames"));
13
13
 
14
- var _data = require("@wordpress/data");
15
-
16
14
  var _blockEditor = require("@wordpress/block-editor");
17
15
 
18
16
  var _i18n = require("@wordpress/i18n");
19
17
 
18
+ var _data = require("@wordpress/data");
19
+
20
20
  var _coreData = require("@wordpress/core-data");
21
21
 
22
+ var _compose = require("@wordpress/compose");
23
+
24
+ var _form = _interopRequireDefault(require("../post-comments-form/form"));
25
+
22
26
  /**
23
27
  * External dependencies
24
28
  */
@@ -26,45 +30,60 @@ var _coreData = require("@wordpress/core-data");
26
30
  /**
27
31
  * WordPress dependencies
28
32
  */
29
- function PostCommentsDisplay(_ref) {
30
- let {
31
- postId
32
- } = _ref;
33
- return (0, _data.useSelect)(select => {
34
- const comments = select(_coreData.store).getEntityRecords('root', 'comment', {
35
- post: postId
36
- }); // TODO: "No Comments" placeholder should be editable.
37
-
38
- return comments && comments.length ? comments.map(comment => (0, _element.createElement)(_element.RawHTML, {
39
- className: "wp-block-post-comments__comment",
40
- key: comment.id
41
- }, comment.content.rendered)) : (0, _i18n.__)('No comments.');
42
- }, [postId]);
43
- }
44
33
 
45
- function PostCommentsEdit(_ref2) {
34
+ /**
35
+ * Internal dependencies
36
+ */
37
+ function PostCommentsEdit(_ref) {
46
38
  let {
47
- attributes,
39
+ attributes: {
40
+ textAlign
41
+ },
48
42
  setAttributes,
49
- context
50
- } = _ref2;
51
- const {
52
- postType,
53
- postId
54
- } = context;
43
+ context: {
44
+ postType,
45
+ postId
46
+ }
47
+ } = _ref;
48
+ let [postTitle] = (0, _coreData.useEntityProp)('postType', postType, 'title', postId);
49
+ postTitle = postTitle || (0, _i18n.__)('Post Title');
50
+ const [commentStatus] = (0, _coreData.useEntityProp)('postType', postType, 'comment_status', postId);
55
51
  const {
56
- textAlign
57
- } = attributes;
52
+ avatarURL,
53
+ defaultCommentStatus
54
+ } = (0, _data.useSelect)(select => select(_blockEditor.store).getSettings().__experimentalDiscussionSettings);
55
+ const isSiteEditor = postType === undefined || postId === undefined;
56
+ const postTypeSupportsComments = (0, _data.useSelect)(select => {
57
+ var _select$getPostType;
58
+
59
+ return postType ? !!((_select$getPostType = select(_coreData.store).getPostType(postType)) !== null && _select$getPostType !== void 0 && _select$getPostType.supports.comments) : false;
60
+ });
61
+ let warning = (0, _i18n.__)('Post Comments block: This is just a placeholder, not a real comment. The final styling may differ because it also depends on the current theme. For better compatibility with the Block Editor, please consider replacing this block with the "Comments" block.');
62
+ let showPlaceholder = true;
63
+
64
+ if (!isSiteEditor && 'open' !== commentStatus) {
65
+ if ('closed' === commentStatus) {
66
+ warning = (0, _i18n.sprintf)(
67
+ /* translators: 1: Post type (i.e. "post", "page") */
68
+ (0, _i18n.__)('Post Comments block: Comments to this %s are not allowed.'), postType);
69
+ showPlaceholder = false;
70
+ } else if (!postTypeSupportsComments) {
71
+ warning = (0, _i18n.sprintf)(
72
+ /* translators: 1: Post type (i.e. "post", "page") */
73
+ (0, _i18n.__)('Post Comments block: Comments for this post type (%s) are not enabled.'), postType);
74
+ showPlaceholder = false;
75
+ } else if ('open' !== defaultCommentStatus) {
76
+ warning = (0, _i18n.__)('Post Comments block: Comments are not enabled.');
77
+ showPlaceholder = false;
78
+ }
79
+ }
80
+
58
81
  const blockProps = (0, _blockEditor.useBlockProps)({
59
82
  className: (0, _classnames.default)({
60
83
  [`has-text-align-${textAlign}`]: textAlign
61
84
  })
62
85
  });
63
-
64
- if (!postType || !postId) {
65
- return (0, _element.createElement)("div", blockProps, (0, _element.createElement)(_blockEditor.Warning, null, (0, _i18n.__)('Post comments block: no post found.')));
66
- }
67
-
86
+ const disabledRef = (0, _compose.__experimentalUseDisabled)();
68
87
  return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.BlockControls, {
69
88
  group: "block"
70
89
  }, (0, _element.createElement)(_blockEditor.AlignmentControl, {
@@ -74,8 +93,74 @@ function PostCommentsEdit(_ref2) {
74
93
  textAlign: nextAlign
75
94
  });
76
95
  }
77
- })), (0, _element.createElement)("div", blockProps, (0, _element.createElement)(PostCommentsDisplay, {
78
- postId: postId
79
- })));
96
+ })), (0, _element.createElement)("div", blockProps, (0, _element.createElement)(_blockEditor.Warning, null, warning), showPlaceholder && (0, _element.createElement)("div", {
97
+ className: "wp-block-post-comments__placeholder",
98
+ ref: disabledRef
99
+ }, (0, _element.createElement)("h3", null, (0, _i18n.__)('One response to'), " \u201C", postTitle, "\u201D"), (0, _element.createElement)("div", {
100
+ className: "navigation"
101
+ }, (0, _element.createElement)("div", {
102
+ className: "alignleft"
103
+ }, (0, _element.createElement)("a", {
104
+ href: "#top"
105
+ }, "\xAB ", (0, _i18n.__)('Older Comments'))), (0, _element.createElement)("div", {
106
+ className: "alignright"
107
+ }, (0, _element.createElement)("a", {
108
+ href: "#top"
109
+ }, (0, _i18n.__)('Newer Comments'), " \xBB"))), (0, _element.createElement)("ol", {
110
+ className: "commentlist"
111
+ }, (0, _element.createElement)("li", {
112
+ className: "comment even thread-even depth-1"
113
+ }, (0, _element.createElement)("article", {
114
+ className: "comment-body"
115
+ }, (0, _element.createElement)("footer", {
116
+ className: "comment-meta"
117
+ }, (0, _element.createElement)("div", {
118
+ className: "comment-author vcard"
119
+ }, (0, _element.createElement)("img", {
120
+ alt: "Commenter Avatar",
121
+ src: avatarURL,
122
+ className: "avatar avatar-32 photo",
123
+ height: "32",
124
+ width: "32",
125
+ loading: "lazy"
126
+ }), (0, _element.createElement)("b", {
127
+ className: "fn"
128
+ }, (0, _element.createElement)("a", {
129
+ href: "#top",
130
+ className: "url"
131
+ }, (0, _i18n.__)('A WordPress Commenter'))), ' ', (0, _element.createElement)("span", {
132
+ className: "says"
133
+ }, (0, _i18n.__)('says'), ":")), (0, _element.createElement)("div", {
134
+ className: "comment-metadata"
135
+ }, (0, _element.createElement)("a", {
136
+ href: "#top"
137
+ }, (0, _element.createElement)("time", {
138
+ dateTime: "2000-01-01T00:00:00+00:00"
139
+ }, (0, _i18n.__)('January 1, 2000 at 00:00 am'))), ' ', (0, _element.createElement)("span", {
140
+ className: "edit-link"
141
+ }, (0, _element.createElement)("a", {
142
+ className: "comment-edit-link",
143
+ href: "#top"
144
+ }, (0, _i18n.__)('Edit'))))), (0, _element.createElement)("div", {
145
+ className: "comment-content"
146
+ }, (0, _element.createElement)("p", null, (0, _i18n.__)('Hi, this is a comment.'), (0, _element.createElement)("br", null), (0, _i18n.__)('To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'), (0, _element.createElement)("br", null), (0, _i18n.__)('Commenter avatars come from'), ' ', (0, _element.createElement)("a", {
147
+ href: "https://gravatar.com/"
148
+ }, "Gravatar"), ".")), (0, _element.createElement)("div", {
149
+ className: "reply"
150
+ }, (0, _element.createElement)("a", {
151
+ className: "comment-reply-link",
152
+ href: "#top",
153
+ "aria-label": "Reply to A WordPress Commenter"
154
+ }, (0, _i18n.__)('Reply')))))), (0, _element.createElement)("div", {
155
+ className: "navigation"
156
+ }, (0, _element.createElement)("div", {
157
+ className: "alignleft"
158
+ }, (0, _element.createElement)("a", {
159
+ href: "#top"
160
+ }, "\xAB ", (0, _i18n.__)('Older Comments'))), (0, _element.createElement)("div", {
161
+ className: "alignright"
162
+ }, (0, _element.createElement)("a", {
163
+ href: "#top"
164
+ }, (0, _i18n.__)('Newer Comments'), " \xBB"))), (0, _element.createElement)(_form.default, null))));
80
165
  }
81
166
  //# sourceMappingURL=edit.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/post-comments/edit.js"],"names":["PostCommentsDisplay","postId","select","comments","coreStore","getEntityRecords","post","length","map","comment","id","content","rendered","PostCommentsEdit","attributes","setAttributes","context","postType","textAlign","blockProps","className","nextAlign"],"mappings":";;;;;;;;;AAgBA;;AAbA;;AAKA;;AACA;;AAMA;;AAEA;;AAjBA;AACA;AACA;;AAGA;AACA;AACA;AAYA,SAASA,mBAAT,OAA2C;AAAA,MAAb;AAAEC,IAAAA;AAAF,GAAa;AAC1C,SAAO,qBACJC,MAAF,IAAc;AACb,UAAMC,QAAQ,GAAGD,MAAM,CAAEE,eAAF,CAAN,CAAoBC,gBAApB,CAChB,MADgB,EAEhB,SAFgB,EAGhB;AACCC,MAAAA,IAAI,EAAEL;AADP,KAHgB,CAAjB,CADa,CAQb;;AACA,WAAOE,QAAQ,IAAIA,QAAQ,CAACI,MAArB,GACJJ,QAAQ,CAACK,GAAT,CAAgBC,OAAF,IACd,4BAAC,gBAAD;AACC,MAAA,SAAS,EAAC,iCADX;AAEC,MAAA,GAAG,EAAGA,OAAO,CAACC;AAFf,OAIGD,OAAO,CAACE,OAAR,CAAgBC,QAJnB,CADA,CADI,GASJ,cAAI,cAAJ,CATH;AAUA,GApBK,EAqBN,CAAEX,MAAF,CArBM,CAAP;AAuBA;;AAEc,SAASY,gBAAT,QAIX;AAAA,MAJsC;AACzCC,IAAAA,UADyC;AAEzCC,IAAAA,aAFyC;AAGzCC,IAAAA;AAHyC,GAItC;AACH,QAAM;AAAEC,IAAAA,QAAF;AAAYhB,IAAAA;AAAZ,MAAuBe,OAA7B;AACA,QAAM;AAAEE,IAAAA;AAAF,MAAgBJ,UAAtB;AACA,QAAMK,UAAU,GAAG,gCAAe;AACjCC,IAAAA,SAAS,EAAE,yBAAY;AACtB,OAAG,kBAAkBF,SAAW,EAAhC,GAAqCA;AADf,KAAZ;AADsB,GAAf,CAAnB;;AAMA,MAAK,CAAED,QAAF,IAAc,CAAEhB,MAArB,EAA8B;AAC7B,WACC,mCAAUkB,UAAV,EACC,4BAAC,oBAAD,QACG,cAAI,qCAAJ,CADH,CADD,CADD;AAOA;;AAED,SACC,qDACC,4BAAC,0BAAD;AAAe,IAAA,KAAK,EAAC;AAArB,KACC,4BAAC,6BAAD;AACC,IAAA,KAAK,EAAGD,SADT;AAEC,IAAA,QAAQ,EAAKG,SAAF,IAAiB;AAC3BN,MAAAA,aAAa,CAAE;AAAEG,QAAAA,SAAS,EAAEG;AAAb,OAAF,CAAb;AACA;AAJF,IADD,CADD,EAUC,mCAAUF,UAAV,EACC,4BAAC,mBAAD;AAAqB,IAAA,MAAM,EAAGlB;AAA9B,IADD,CAVD,CADD;AAgBA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tWarning,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { RawHTML } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\nfunction PostCommentsDisplay( { postId } ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tconst comments = select( coreStore ).getEntityRecords(\n\t\t\t\t'root',\n\t\t\t\t'comment',\n\t\t\t\t{\n\t\t\t\t\tpost: postId,\n\t\t\t\t}\n\t\t\t);\n\t\t\t// TODO: \"No Comments\" placeholder should be editable.\n\t\t\treturn comments && comments.length\n\t\t\t\t? comments.map( ( comment ) => (\n\t\t\t\t\t\t<RawHTML\n\t\t\t\t\t\t\tclassName=\"wp-block-post-comments__comment\"\n\t\t\t\t\t\t\tkey={ comment.id }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ comment.content.rendered }\n\t\t\t\t\t\t</RawHTML>\n\t\t\t\t ) )\n\t\t\t\t: __( 'No comments.' );\n\t\t},\n\t\t[ postId ]\n\t);\n}\n\nexport default function PostCommentsEdit( {\n\tattributes,\n\tsetAttributes,\n\tcontext,\n} ) {\n\tconst { postType, postId } = context;\n\tconst { textAlign } = attributes;\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tif ( ! postType || ! postId ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>\n\t\t\t\t\t{ __( 'Post comments block: no post found.' ) }\n\t\t\t\t</Warning>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<PostCommentsDisplay postId={ postId } />\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/post-comments/edit.js"],"names":["PostCommentsEdit","attributes","textAlign","setAttributes","context","postType","postId","postTitle","commentStatus","avatarURL","defaultCommentStatus","select","blockEditorStore","getSettings","__experimentalDiscussionSettings","isSiteEditor","undefined","postTypeSupportsComments","coreStore","getPostType","supports","comments","warning","showPlaceholder","blockProps","className","disabledRef","nextAlign"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAOA;;AACA;;AACA;;AACA;;AAKA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;AAGe,SAASA,gBAAT,OAIX;AAAA,MAJsC;AACzCC,IAAAA,UAAU,EAAE;AA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C;AAAf,KACC;AAAG,IAAA,IAAI,EAAC;AAAR,KAAiB,cAAI,gBAAJ,CAAjB,UADD,CAJD,CA5FD,EAqGC,4BAAC,aAAD,OArGD,CAJF,CAVD,CADD;AA0HA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tAlignmentControl,\n\tBlockControls,\n\tWarning,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { __experimentalUseDisabled as useDisabled } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport CommentsForm from '../post-comments-form/form';\n\nexport default function PostCommentsEdit( {\n\tattributes: { textAlign },\n\tsetAttributes,\n\tcontext: { postType, postId },\n} ) {\n\tlet [ postTitle ] = useEntityProp( 'postType', postType, 'title', postId );\n\tpostTitle = postTitle || __( 'Post Title' );\n\n\tconst [ commentStatus ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'comment_status',\n\t\tpostId\n\t);\n\n\tconst { avatarURL, defaultCommentStatus } = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings()\n\t\t\t\t.__experimentalDiscussionSettings\n\t);\n\n\tconst isSiteEditor = postType === undefined || postId === undefined;\n\n\tconst postTypeSupportsComments = useSelect( ( select ) =>\n\t\tpostType\n\t\t\t? !! select( coreStore ).getPostType( postType )?.supports.comments\n\t\t\t: false\n\t);\n\n\tlet warning = __(\n\t\t'Post Comments block: This is just a placeholder, not a real comment. The final styling may differ because it also depends on the current theme. For better compatibility with the Block Editor, please consider replacing this block with the \"Comments\" block.'\n\t);\n\tlet showPlaceholder = true;\n\n\tif ( ! isSiteEditor && 'open' !== commentStatus ) {\n\t\tif ( 'closed' === commentStatus ) {\n\t\t\twarning = sprintf(\n\t\t\t\t/* translators: 1: Post type (i.e. \"post\", \"page\") */\n\t\t\t\t__(\n\t\t\t\t\t'Post Comments block: Comments to this %s are not allowed.'\n\t\t\t\t),\n\t\t\t\tpostType\n\t\t\t);\n\t\t\tshowPlaceholder = false;\n\t\t} else if ( ! postTypeSupportsComments ) {\n\t\t\twarning = sprintf(\n\t\t\t\t/* translators: 1: Post type (i.e. \"post\", \"page\") */\n\t\t\t\t__(\n\t\t\t\t\t'Post Comments block: Comments for this post type (%s) are not enabled.'\n\t\t\t\t),\n\t\t\t\tpostType\n\t\t\t);\n\t\t\tshowPlaceholder = false;\n\t\t} else if ( 'open' !== defaultCommentStatus ) {\n\t\t\twarning = __( 'Post Comments block: Comments are not enabled.' );\n\t\t\tshowPlaceholder = false;\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( {\n\t\t\t[ `has-text-align-${ textAlign }` ]: textAlign,\n\t\t} ),\n\t} );\n\n\tconst disabledRef = useDisabled();\n\n\treturn (\n\t\t<>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<AlignmentControl\n\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\tonChange={ ( nextAlign ) => {\n\t\t\t\t\t\tsetAttributes( { textAlign: nextAlign } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Warning>{ warning }</Warning>\n\n\t\t\t\t{ showPlaceholder && (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"wp-block-post-comments__placeholder\"\n\t\t\t\t\t\tref={ disabledRef }\n\t\t\t\t\t>\n\t\t\t\t\t\t<h3>\n\t\t\t\t\t\t\t{ __( 'One response to' ) } “{ postTitle }”\n\t\t\t\t\t\t</h3>\n\n\t\t\t\t\t\t<div className=\"navigation\">\n\t\t\t\t\t\t\t<div className=\"alignleft\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">« { __( 'Older Comments' ) }</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"alignright\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">{ __( 'Newer Comments' ) } »</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<ol className=\"commentlist\">\n\t\t\t\t\t\t\t<li className=\"comment even thread-even depth-1\">\n\t\t\t\t\t\t\t\t<article className=\"comment-body\">\n\t\t\t\t\t\t\t\t\t<footer className=\"comment-meta\">\n\t\t\t\t\t\t\t\t\t\t<div className=\"comment-author vcard\">\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\talt=\"Commenter Avatar\"\n\t\t\t\t\t\t\t\t\t\t\t\tsrc={ avatarURL }\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"avatar avatar-32 photo\"\n\t\t\t\t\t\t\t\t\t\t\t\theight=\"32\"\n\t\t\t\t\t\t\t\t\t\t\t\twidth=\"32\"\n\t\t\t\t\t\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<b className=\"fn\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"#top\" className=\"url\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'A WordPress Commenter'\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</b>{ ' ' }\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"says\">\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'says' ) }:\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t<div className=\"comment-metadata\">\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"#top\">\n\t\t\t\t\t\t\t\t\t\t\t\t<time dateTime=\"2000-01-01T00:00:00+00:00\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'January 1, 2000 at 00:00 am'\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t</time>\n\t\t\t\t\t\t\t\t\t\t\t</a>{ ' ' }\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"edit-link\">\n\t\t\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"comment-edit-link\"\n\t\t\t\t\t\t\t\t\t\t\t\t\thref=\"#top\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</footer>\n\n\t\t\t\t\t\t\t\t\t<div className=\"comment-content\">\n\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Hi, this is a comment.' ) }\n\t\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Commenter avatars come from'\n\t\t\t\t\t\t\t\t\t\t\t) }{ ' ' }\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"https://gravatar.com/\">\n\t\t\t\t\t\t\t\t\t\t\t\tGravatar\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t\t.\n\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<div className=\"reply\">\n\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"comment-reply-link\"\n\t\t\t\t\t\t\t\t\t\t\thref=\"#top\"\n\t\t\t\t\t\t\t\t\t\t\taria-label=\"Reply to A WordPress Commenter\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Reply' ) }\n\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</article>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</ol>\n\n\t\t\t\t\t\t<div className=\"navigation\">\n\t\t\t\t\t\t\t<div className=\"alignleft\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">« { __( 'Older Comments' ) }</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div className=\"alignright\">\n\t\t\t\t\t\t\t\t<a href=\"#top\">{ __( 'Newer Comments' ) } »</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<CommentsForm />\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}