@wordpress/editor 14.9.0 → 14.10.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 (338) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/bindings/api.js +0 -29
  3. package/build/bindings/api.js.map +1 -1
  4. package/build/components/autocompleters/user.js.map +1 -1
  5. package/build/components/block-manager/index.js +2 -2
  6. package/build/components/block-manager/index.js.map +1 -1
  7. package/build/components/commands/index.js.map +1 -1
  8. package/build/components/create-template-part-modal/index.js.map +1 -1
  9. package/build/components/create-template-part-modal/utils.js.map +1 -1
  10. package/build/components/document-outline/index.js.map +1 -1
  11. package/build/components/document-outline/item.js.map +1 -1
  12. package/build/components/document-tools/index.js +1 -1
  13. package/build/components/document-tools/index.js.map +1 -1
  14. package/build/components/editor-interface/index.js +1 -12
  15. package/build/components/editor-interface/index.js.map +1 -1
  16. package/build/components/entities-saved-states/index.js +1 -1
  17. package/build/components/entities-saved-states/index.js.map +1 -1
  18. package/build/components/media-categories/index.js.map +1 -1
  19. package/build/components/page-attributes/parent.js +1 -1
  20. package/build/components/page-attributes/parent.js.map +1 -1
  21. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  22. package/build/components/post-actions/index.js.map +1 -1
  23. package/build/components/post-content-information/index.js +1 -1
  24. package/build/components/post-content-information/index.js.map +1 -1
  25. package/build/components/post-featured-image/index.js.map +1 -1
  26. package/build/components/post-format/index.js +1 -1
  27. package/build/components/post-format/index.js.map +1 -1
  28. package/build/components/post-last-revision/index.js +1 -1
  29. package/build/components/post-last-revision/index.js.map +1 -1
  30. package/build/components/post-locked-modal/index.js +2 -2
  31. package/build/components/post-locked-modal/index.js.map +1 -1
  32. package/build/components/post-preview-button/index.js +1 -1
  33. package/build/components/post-preview-button/index.js.map +1 -1
  34. package/build/components/post-publish-button/index.js.map +1 -1
  35. package/build/components/post-publish-panel/maybe-post-format-panel.js +1 -1
  36. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  37. package/build/components/post-publish-panel/maybe-upload-media.js +1 -0
  38. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  39. package/build/components/post-publish-panel/media-util.js +1 -0
  40. package/build/components/post-publish-panel/media-util.js.map +1 -1
  41. package/build/components/post-publish-panel/postpublish.js +1 -1
  42. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  43. package/build/components/post-schedule/label.js.map +1 -1
  44. package/build/components/post-taxonomies/flat-term-selector.js +4 -4
  45. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  46. package/build/components/post-taxonomies/hierarchical-term-selector.js +3 -2
  47. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  48. package/build/components/post-taxonomies/index.js +1 -1
  49. package/build/components/post-taxonomies/index.js.map +1 -1
  50. package/build/components/post-taxonomies/panel.js.map +1 -1
  51. package/build/components/post-template/classic-theme.js +2 -4
  52. package/build/components/post-template/classic-theme.js.map +1 -1
  53. package/build/components/post-text-editor/index.js.map +1 -1
  54. package/build/components/post-title/index.js +15 -19
  55. package/build/components/post-title/index.js.map +1 -1
  56. package/build/components/post-title/index.native.js +2 -2
  57. package/build/components/post-title/index.native.js.map +1 -1
  58. package/build/components/post-url/index.js +76 -63
  59. package/build/components/post-url/index.js.map +1 -1
  60. package/build/components/post-url/panel.js +46 -26
  61. package/build/components/post-url/panel.js.map +1 -1
  62. package/build/components/post-visibility/index.js.map +1 -1
  63. package/build/components/preferences-modal/index.js.map +1 -1
  64. package/build/components/preview-dropdown/index.js.map +1 -1
  65. package/build/components/provider/index.js +1 -1
  66. package/build/components/provider/index.js.map +1 -1
  67. package/build/components/resizable-editor/resize-handle.js.map +1 -1
  68. package/build/components/time-to-read/index.js +1 -1
  69. package/build/components/time-to-read/index.js.map +1 -1
  70. package/build/components/visual-editor/edit-template-blocks-notification.js +4 -1
  71. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  72. package/build/components/visual-editor/index.js +4 -3
  73. package/build/components/visual-editor/index.js.map +1 -1
  74. package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  75. package/build/dataviews/actions/duplicate-template-part.js +1 -1
  76. package/build/dataviews/actions/duplicate-template-part.js.map +1 -1
  77. package/build/private-apis.js +0 -1
  78. package/build/private-apis.js.map +1 -1
  79. package/build/store/actions.js +26 -1
  80. package/build/store/actions.js.map +1 -1
  81. package/build/store/constants.js +1 -0
  82. package/build/store/constants.js.map +1 -1
  83. package/build/store/local-autosave.js.map +1 -1
  84. package/build/store/private-actions.js +7 -6
  85. package/build/store/private-actions.js.map +1 -1
  86. package/build/store/selectors.js +21 -0
  87. package/build/store/selectors.js.map +1 -1
  88. package/build/utils/media-upload/index.js.map +1 -1
  89. package/build-module/bindings/api.js +1 -29
  90. package/build-module/bindings/api.js.map +1 -1
  91. package/build-module/components/autocompleters/user.js +1 -3
  92. package/build-module/components/autocompleters/user.js.map +1 -1
  93. package/build-module/components/block-manager/category.js +1 -2
  94. package/build-module/components/block-manager/category.js.map +1 -1
  95. package/build-module/components/block-manager/checklist.js +1 -2
  96. package/build-module/components/block-manager/checklist.js.map +1 -1
  97. package/build-module/components/block-manager/index.js +3 -4
  98. package/build-module/components/block-manager/index.js.map +1 -1
  99. package/build-module/components/block-settings-menu/content-only-settings-menu.js +1 -3
  100. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  101. package/build-module/components/blog-title/index.js +1 -3
  102. package/build-module/components/blog-title/index.js.map +1 -1
  103. package/build-module/components/collapsible-block-toolbar/index.js +1 -3
  104. package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
  105. package/build-module/components/commands/index.js.map +1 -1
  106. package/build-module/components/create-template-part-modal/index.js +1 -2
  107. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  108. package/build-module/components/create-template-part-modal/utils.js.map +1 -1
  109. package/build-module/components/document-bar/index.js +1 -2
  110. package/build-module/components/document-bar/index.js.map +1 -1
  111. package/build-module/components/document-outline/index.js +1 -2
  112. package/build-module/components/document-outline/index.js.map +1 -1
  113. package/build-module/components/document-outline/item.js +1 -2
  114. package/build-module/components/document-outline/item.js.map +1 -1
  115. package/build-module/components/document-tools/index.js +2 -4
  116. package/build-module/components/document-tools/index.js.map +1 -1
  117. package/build-module/components/editor/index.js +1 -3
  118. package/build-module/components/editor/index.js.map +1 -1
  119. package/build-module/components/editor-help/add-blocks.native.js +1 -3
  120. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  121. package/build-module/components/editor-help/customize-blocks.native.js +1 -3
  122. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  123. package/build-module/components/editor-help/help-detail-navigation-screen.native.js +1 -2
  124. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  125. package/build-module/components/editor-help/index.native.js +1 -3
  126. package/build-module/components/editor-help/index.native.js.map +1 -1
  127. package/build-module/components/editor-help/intro-to-blocks.native.js +1 -3
  128. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  129. package/build-module/components/editor-help/move-blocks.native.js +1 -3
  130. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  131. package/build-module/components/editor-help/remove-blocks.native.js +1 -3
  132. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  133. package/build-module/components/editor-help/view-sections.native.js +1 -2
  134. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  135. package/build-module/components/editor-interface/index.js +2 -15
  136. package/build-module/components/editor-interface/index.js.map +1 -1
  137. package/build-module/components/editor-notices/index.js +1 -3
  138. package/build-module/components/editor-notices/index.js.map +1 -1
  139. package/build-module/components/entities-saved-states/entity-record-item.js +1 -3
  140. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  141. package/build-module/components/entities-saved-states/entity-type-list.js +1 -2
  142. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  143. package/build-module/components/entities-saved-states/index.js +2 -3
  144. package/build-module/components/entities-saved-states/index.js.map +1 -1
  145. package/build-module/components/error-boundary/index.native.js +1 -2
  146. package/build-module/components/error-boundary/index.native.js.map +1 -1
  147. package/build-module/components/header/index.js +1 -2
  148. package/build-module/components/header/index.js.map +1 -1
  149. package/build-module/components/keyboard-shortcut-help-modal/index.js +1 -2
  150. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  151. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +1 -3
  152. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  153. package/build-module/components/list-view-sidebar/list-view-outline.js +1 -3
  154. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  155. package/build-module/components/media-categories/index.js.map +1 -1
  156. package/build-module/components/more-menu/index.js +1 -3
  157. package/build-module/components/more-menu/index.js.map +1 -1
  158. package/build-module/components/offline-status/index.native.js +1 -2
  159. package/build-module/components/offline-status/index.native.js.map +1 -1
  160. package/build-module/components/page-attributes/parent.js +2 -3
  161. package/build-module/components/page-attributes/parent.js.map +1 -1
  162. package/build-module/components/plugin-document-setting-panel/index.js +1 -3
  163. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  164. package/build-module/components/post-actions/index.js +1 -3
  165. package/build-module/components/post-actions/index.js.map +1 -1
  166. package/build-module/components/post-author/panel.js +1 -2
  167. package/build-module/components/post-author/panel.js.map +1 -1
  168. package/build-module/components/post-card-panel/index.js +1 -2
  169. package/build-module/components/post-card-panel/index.js.map +1 -1
  170. package/build-module/components/post-content-information/index.js +1 -1
  171. package/build-module/components/post-content-information/index.js.map +1 -1
  172. package/build-module/components/post-discussion/panel.js +1 -2
  173. package/build-module/components/post-discussion/panel.js.map +1 -1
  174. package/build-module/components/post-excerpt/panel.js +1 -3
  175. package/build-module/components/post-excerpt/panel.js.map +1 -1
  176. package/build-module/components/post-featured-image/index.js +1 -2
  177. package/build-module/components/post-featured-image/index.js.map +1 -1
  178. package/build-module/components/post-format/index.js +2 -3
  179. package/build-module/components/post-format/index.js.map +1 -1
  180. package/build-module/components/post-format/panel.js +1 -2
  181. package/build-module/components/post-format/panel.js.map +1 -1
  182. package/build-module/components/post-last-revision/index.js +1 -1
  183. package/build-module/components/post-last-revision/index.js.map +1 -1
  184. package/build-module/components/post-locked-modal/index.js +3 -5
  185. package/build-module/components/post-locked-modal/index.js.map +1 -1
  186. package/build-module/components/post-panel-row/index.js +1 -2
  187. package/build-module/components/post-panel-row/index.js.map +1 -1
  188. package/build-module/components/post-preview-button/index.js +2 -4
  189. package/build-module/components/post-preview-button/index.js.map +1 -1
  190. package/build-module/components/post-publish-button/index.js +1 -2
  191. package/build-module/components/post-publish-button/index.js.map +1 -1
  192. package/build-module/components/post-publish-panel/index.js +1 -3
  193. package/build-module/components/post-publish-panel/index.js.map +1 -1
  194. package/build-module/components/post-publish-panel/maybe-category-panel.js +1 -2
  195. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  196. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -3
  197. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  198. package/build-module/components/post-publish-panel/maybe-tags-panel.js +1 -2
  199. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  200. package/build-module/components/post-publish-panel/maybe-upload-media.js +2 -2
  201. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  202. package/build-module/components/post-publish-panel/media-util.js +1 -0
  203. package/build-module/components/post-publish-panel/media-util.js.map +1 -1
  204. package/build-module/components/post-publish-panel/postpublish.js +2 -4
  205. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  206. package/build-module/components/post-publish-panel/prepublish.js +1 -3
  207. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  208. package/build-module/components/post-saved-state/index.js +1 -2
  209. package/build-module/components/post-saved-state/index.js.map +1 -1
  210. package/build-module/components/post-schedule/label.js.map +1 -1
  211. package/build-module/components/post-status/index.js +1 -3
  212. package/build-module/components/post-status/index.js.map +1 -1
  213. package/build-module/components/post-switch-to-draft-button/index.js +1 -3
  214. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  215. package/build-module/components/post-taxonomies/flat-term-selector.js +5 -7
  216. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  217. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +4 -4
  218. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  219. package/build-module/components/post-taxonomies/index.js +1 -1
  220. package/build-module/components/post-taxonomies/index.js.map +1 -1
  221. package/build-module/components/post-taxonomies/most-used-terms.js +1 -2
  222. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  223. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  224. package/build-module/components/post-template/block-theme.js +1 -3
  225. package/build-module/components/post-template/block-theme.js.map +1 -1
  226. package/build-module/components/post-template/classic-theme.js +3 -6
  227. package/build-module/components/post-template/classic-theme.js.map +1 -1
  228. package/build-module/components/post-template/create-new-template-modal.js +1 -2
  229. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  230. package/build-module/components/post-template/create-new-template.js +1 -3
  231. package/build-module/components/post-template/create-new-template.js.map +1 -1
  232. package/build-module/components/post-template/swap-template-button.js +1 -3
  233. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  234. package/build-module/components/post-text-editor/index.js +1 -3
  235. package/build-module/components/post-text-editor/index.js.map +1 -1
  236. package/build-module/components/post-title/index.js +15 -19
  237. package/build-module/components/post-title/index.js.map +1 -1
  238. package/build-module/components/post-title/index.native.js +2 -2
  239. package/build-module/components/post-title/index.native.js.map +1 -1
  240. package/build-module/components/post-trash/index.js +1 -2
  241. package/build-module/components/post-trash/index.js.map +1 -1
  242. package/build-module/components/post-url/index.js +78 -66
  243. package/build-module/components/post-url/index.js.map +1 -1
  244. package/build-module/components/post-url/panel.js +48 -28
  245. package/build-module/components/post-url/panel.js.map +1 -1
  246. package/build-module/components/post-visibility/index.js +1 -2
  247. package/build-module/components/post-visibility/index.js.map +1 -1
  248. package/build-module/components/posts-per-page/index.js +1 -3
  249. package/build-module/components/posts-per-page/index.js.map +1 -1
  250. package/build-module/components/preferences-modal/index.js +1 -3
  251. package/build-module/components/preferences-modal/index.js.map +1 -1
  252. package/build-module/components/preview-dropdown/index.js +1 -3
  253. package/build-module/components/preview-dropdown/index.js.map +1 -1
  254. package/build-module/components/provider/index.js +2 -4
  255. package/build-module/components/provider/index.js.map +1 -1
  256. package/build-module/components/provider/index.native.js +1 -3
  257. package/build-module/components/provider/index.native.js.map +1 -1
  258. package/build-module/components/resizable-editor/resize-handle.js +1 -3
  259. package/build-module/components/resizable-editor/resize-handle.js.map +1 -1
  260. package/build-module/components/save-publish-panels/index.js +1 -3
  261. package/build-module/components/save-publish-panels/index.js.map +1 -1
  262. package/build-module/components/sidebar/header.js +1 -2
  263. package/build-module/components/sidebar/header.js.map +1 -1
  264. package/build-module/components/sidebar/index.js +1 -2
  265. package/build-module/components/sidebar/index.js.map +1 -1
  266. package/build-module/components/sidebar/post-summary.js +1 -3
  267. package/build-module/components/sidebar/post-summary.js.map +1 -1
  268. package/build-module/components/site-discussion/index.js +1 -3
  269. package/build-module/components/site-discussion/index.js.map +1 -1
  270. package/build-module/components/start-template-options/index.js +1 -2
  271. package/build-module/components/start-template-options/index.js.map +1 -1
  272. package/build-module/components/table-of-contents/panel.js +1 -3
  273. package/build-module/components/table-of-contents/panel.js.map +1 -1
  274. package/build-module/components/template-part-menu-items/convert-to-template-part.js +1 -3
  275. package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +1 -1
  276. package/build-module/components/template-validation-notice/index.js +1 -3
  277. package/build-module/components/template-validation-notice/index.js.map +1 -1
  278. package/build-module/components/text-editor/index.js +1 -2
  279. package/build-module/components/text-editor/index.js.map +1 -1
  280. package/build-module/components/time-to-read/index.js +1 -1
  281. package/build-module/components/time-to-read/index.js.map +1 -1
  282. package/build-module/components/visual-editor/edit-template-blocks-notification.js +4 -1
  283. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  284. package/build-module/components/visual-editor/index.js +5 -6
  285. package/build-module/components/visual-editor/index.js.map +1 -1
  286. package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  287. package/build-module/dataviews/actions/duplicate-template-part.js +1 -1
  288. package/build-module/dataviews/actions/duplicate-template-part.js.map +1 -1
  289. package/build-module/hooks/pattern-overrides.js +1 -3
  290. package/build-module/hooks/pattern-overrides.js.map +1 -1
  291. package/build-module/private-apis.js +1 -2
  292. package/build-module/private-apis.js.map +1 -1
  293. package/build-module/store/actions.js +26 -1
  294. package/build-module/store/actions.js.map +1 -1
  295. package/build-module/store/constants.js +1 -0
  296. package/build-module/store/constants.js.map +1 -1
  297. package/build-module/store/local-autosave.js.map +1 -1
  298. package/build-module/store/private-actions.js +7 -6
  299. package/build-module/store/private-actions.js.map +1 -1
  300. package/build-module/store/selectors.js +21 -0
  301. package/build-module/store/selectors.js.map +1 -1
  302. package/build-module/utils/media-upload/index.js.map +1 -1
  303. package/build-style/style-rtl.css +20 -5
  304. package/build-style/style.css +20 -5
  305. package/build-types/bindings/api.d.ts +0 -13
  306. package/build-types/bindings/api.d.ts.map +1 -1
  307. package/build-types/components/editor-interface/index.d.ts +1 -2
  308. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  309. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  310. package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
  311. package/build-types/components/post-url/index.d.ts.map +1 -1
  312. package/build-types/components/post-url/panel.d.ts.map +1 -1
  313. package/build-types/components/provider/index.d.ts.map +1 -1
  314. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -1
  315. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  316. package/build-types/private-apis.d.ts.map +1 -1
  317. package/build-types/store/actions.d.ts +1 -4
  318. package/build-types/store/actions.d.ts.map +1 -1
  319. package/build-types/store/selectors.d.ts +21 -0
  320. package/build-types/store/selectors.d.ts.map +1 -1
  321. package/package.json +38 -38
  322. package/src/bindings/api.js +1 -32
  323. package/src/components/document-tools/index.js +1 -1
  324. package/src/components/editor-interface/index.js +0 -15
  325. package/src/components/header/style.scss +1 -0
  326. package/src/components/post-saved-state/test/__snapshots__/index.js.snap +1 -1
  327. package/src/components/post-taxonomies/hierarchical-term-selector.js +1 -0
  328. package/src/components/post-template/classic-theme.js +1 -2
  329. package/src/components/post-url/index.js +67 -55
  330. package/src/components/post-url/panel.js +57 -33
  331. package/src/components/post-url/style.scss +21 -3
  332. package/src/components/provider/index.js +1 -0
  333. package/src/components/visual-editor/edit-template-blocks-notification.js +5 -1
  334. package/src/components/visual-editor/index.js +3 -1
  335. package/src/private-apis.js +1 -5
  336. package/src/store/actions.js +28 -1
  337. package/src/store/selectors.js +21 -0
  338. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["clsx","Modal","__","useShortcut","store","keyboardShortcutsStore","useDispatch","useSelect","interfaceStore","textFormattingShortcuts","Shortcut","DynamicShortcut","jsx","_jsx","jsxs","_jsxs","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","ShortcutList","shortcuts","className","role","children","map","shortcut","index","name","ShortcutSection","title","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","openModal","closeModal","toggleModal","closeButtonLabel","onRequestClose","keyCombination","character","description","ariaLabel"],"sources":["@wordpress/editor/src/components/keyboard-shortcut-help-modal/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { textFormattingShortcuts } from './config';\nimport Shortcut from './shortcut';\nimport DynamicShortcut from './dynamic-shortcut';\n\nconst KEYBOARD_SHORTCUT_HELP_MODAL_NAME = 'editor/keyboard-shortcut-help';\n\nconst ShortcutList = ( { shortcuts } ) => (\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t<ul\n\t\tclassName=\"editor-keyboard-shortcut-help-modal__shortcut-list\"\n\t\trole=\"list\"\n\t>\n\t\t{ shortcuts.map( ( shortcut, index ) => (\n\t\t\t<li\n\t\t\t\tclassName=\"editor-keyboard-shortcut-help-modal__shortcut\"\n\t\t\t\tkey={ index }\n\t\t\t>\n\t\t\t\t{ typeof shortcut === 'string' ? (\n\t\t\t\t\t<DynamicShortcut name={ shortcut } />\n\t\t\t\t) : (\n\t\t\t\t\t<Shortcut { ...shortcut } />\n\t\t\t\t) }\n\t\t\t</li>\n\t\t) ) }\n\t</ul>\n\t/* eslint-enable jsx-a11y/no-redundant-roles */\n);\n\nconst ShortcutSection = ( { title, shortcuts, className } ) => (\n\t<section\n\t\tclassName={ clsx(\n\t\t\t'editor-keyboard-shortcut-help-modal__section',\n\t\t\tclassName\n\t\t) }\n\t>\n\t\t{ !! title && (\n\t\t\t<h2 className=\"editor-keyboard-shortcut-help-modal__section-title\">\n\t\t\t\t{ title }\n\t\t\t</h2>\n\t\t) }\n\t\t<ShortcutList shortcuts={ shortcuts } />\n\t</section>\n);\n\nconst ShortcutCategorySection = ( {\n\ttitle,\n\tcategoryName,\n\tadditionalShortcuts = [],\n} ) => {\n\tconst categoryShortcuts = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( keyboardShortcutsStore ).getCategoryShortcuts(\n\t\t\t\tcategoryName\n\t\t\t);\n\t\t},\n\t\t[ categoryName ]\n\t);\n\n\treturn (\n\t\t<ShortcutSection\n\t\t\ttitle={ title }\n\t\t\tshortcuts={ categoryShortcuts.concat( additionalShortcuts ) }\n\t\t/>\n\t);\n};\n\nfunction KeyboardShortcutHelpModal() {\n\tconst isModalActive = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).isModalActive(\n\t\t\t\tKEYBOARD_SHORTCUT_HELP_MODAL_NAME\n\t\t\t),\n\t\t[]\n\t);\n\tconst { openModal, closeModal } = useDispatch( interfaceStore );\n\tconst toggleModal = () => {\n\t\tif ( isModalActive ) {\n\t\t\tcloseModal();\n\t\t} else {\n\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t}\n\t};\n\tuseShortcut( 'core/editor/keyboard-shortcuts', toggleModal );\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"editor-keyboard-shortcut-help-modal\"\n\t\t\ttitle={ __( 'Keyboard shortcuts' ) }\n\t\t\tcloseButtonLabel={ __( 'Close' ) }\n\t\t\tonRequestClose={ toggleModal }\n\t\t>\n\t\t\t<ShortcutSection\n\t\t\t\tclassName=\"editor-keyboard-shortcut-help-modal__main-shortcuts\"\n\t\t\t\tshortcuts={ [ 'core/editor/keyboard-shortcuts' ] }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Global shortcuts' ) }\n\t\t\t\tcategoryName=\"global\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Selection shortcuts' ) }\n\t\t\t\tcategoryName=\"selection\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Block shortcuts' ) }\n\t\t\t\tcategoryName=\"block\"\n\t\t\t\tadditionalShortcuts={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyCombination: { character: '/' },\n\t\t\t\t\t\tdescription: __(\n\t\t\t\t\t\t\t'Change the block type after adding a new paragraph.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t/* translators: The forward-slash character. e.g. '/'. */\n\t\t\t\t\t\tariaLabel: __( 'Forward-slash' ),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t\t<ShortcutSection\n\t\t\t\ttitle={ __( 'Text formatting' ) }\n\t\t\t\tshortcuts={ textFormattingShortcuts }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'List View shortcuts' ) }\n\t\t\t\tcategoryName=\"list-view\"\n\t\t\t/>\n\t\t</Modal>\n\t);\n}\n\nexport default KeyboardShortcutHelpModal;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,WAAW,EACXC,KAAK,IAAIC,sBAAsB,QACzB,+BAA+B;AACtC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASH,KAAK,IAAII,cAAc,QAAQ,sBAAsB;;AAE9D;AACA;AACA;AACA,SAASC,uBAAuB,QAAQ,UAAU;AAClD,OAAOC,QAAQ,MAAM,YAAY;AACjC,OAAOC,eAAe,MAAM,oBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEjD,MAAMC,iCAAiC,GAAG,+BAA+B;AAEzE,MAAMC,YAAY,GAAGA,CAAE;EAAEC;AAAU,CAAC;AAAA;AACnC;AACD;AACA;AACA;AACC;AACAL,IAAA;EACCM,SAAS,EAAC,oDAAoD;EAC9DC,IAAI,EAAC,MAAM;EAAAC,QAAA,EAETH,SAAS,CAACI,GAAG,CAAE,CAAEC,QAAQ,EAAEC,KAAK,kBACjCX,IAAA;IACCM,SAAS,EAAC,+CAA+C;IAAAE,QAAA,EAGvD,OAAOE,QAAQ,KAAK,QAAQ,gBAC7BV,IAAA,CAACF,eAAe;MAACc,IAAI,EAAGF;IAAU,CAAE,CAAC,gBAErCV,IAAA,CAACH,QAAQ;MAAA,GAAMa;IAAQ,CAAI;EAC3B,GANKC,KAOH,CAC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useDispatch","useSelect","interfaceStore","textFormattingShortcuts","Shortcut","DynamicShortcut","jsx","_jsx","jsxs","_jsxs","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","ShortcutList","shortcuts","className","role","children","map","shortcut","index","name","ShortcutSection","title","ShortcutCategorySection","categoryName","additionalShortcuts","categoryShortcuts","select","getCategoryShortcuts","concat","KeyboardShortcutHelpModal","isModalActive","openModal","closeModal","toggleModal","closeButtonLabel","onRequestClose","keyCombination","character","description","ariaLabel"],"sources":["@wordpress/editor/src/components/keyboard-shortcut-help-modal/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { textFormattingShortcuts } from './config';\nimport Shortcut from './shortcut';\nimport DynamicShortcut from './dynamic-shortcut';\n\nconst KEYBOARD_SHORTCUT_HELP_MODAL_NAME = 'editor/keyboard-shortcut-help';\n\nconst ShortcutList = ( { shortcuts } ) => (\n\t/*\n\t * Disable reason: The `list` ARIA role is redundant but\n\t * Safari+VoiceOver won't announce the list otherwise.\n\t */\n\t/* eslint-disable jsx-a11y/no-redundant-roles */\n\t<ul\n\t\tclassName=\"editor-keyboard-shortcut-help-modal__shortcut-list\"\n\t\trole=\"list\"\n\t>\n\t\t{ shortcuts.map( ( shortcut, index ) => (\n\t\t\t<li\n\t\t\t\tclassName=\"editor-keyboard-shortcut-help-modal__shortcut\"\n\t\t\t\tkey={ index }\n\t\t\t>\n\t\t\t\t{ typeof shortcut === 'string' ? (\n\t\t\t\t\t<DynamicShortcut name={ shortcut } />\n\t\t\t\t) : (\n\t\t\t\t\t<Shortcut { ...shortcut } />\n\t\t\t\t) }\n\t\t\t</li>\n\t\t) ) }\n\t</ul>\n\t/* eslint-enable jsx-a11y/no-redundant-roles */\n);\n\nconst ShortcutSection = ( { title, shortcuts, className } ) => (\n\t<section\n\t\tclassName={ clsx(\n\t\t\t'editor-keyboard-shortcut-help-modal__section',\n\t\t\tclassName\n\t\t) }\n\t>\n\t\t{ !! title && (\n\t\t\t<h2 className=\"editor-keyboard-shortcut-help-modal__section-title\">\n\t\t\t\t{ title }\n\t\t\t</h2>\n\t\t) }\n\t\t<ShortcutList shortcuts={ shortcuts } />\n\t</section>\n);\n\nconst ShortcutCategorySection = ( {\n\ttitle,\n\tcategoryName,\n\tadditionalShortcuts = [],\n} ) => {\n\tconst categoryShortcuts = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( keyboardShortcutsStore ).getCategoryShortcuts(\n\t\t\t\tcategoryName\n\t\t\t);\n\t\t},\n\t\t[ categoryName ]\n\t);\n\n\treturn (\n\t\t<ShortcutSection\n\t\t\ttitle={ title }\n\t\t\tshortcuts={ categoryShortcuts.concat( additionalShortcuts ) }\n\t\t/>\n\t);\n};\n\nfunction KeyboardShortcutHelpModal() {\n\tconst isModalActive = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).isModalActive(\n\t\t\t\tKEYBOARD_SHORTCUT_HELP_MODAL_NAME\n\t\t\t),\n\t\t[]\n\t);\n\tconst { openModal, closeModal } = useDispatch( interfaceStore );\n\tconst toggleModal = () => {\n\t\tif ( isModalActive ) {\n\t\t\tcloseModal();\n\t\t} else {\n\t\t\topenModal( KEYBOARD_SHORTCUT_HELP_MODAL_NAME );\n\t\t}\n\t};\n\tuseShortcut( 'core/editor/keyboard-shortcuts', toggleModal );\n\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"editor-keyboard-shortcut-help-modal\"\n\t\t\ttitle={ __( 'Keyboard shortcuts' ) }\n\t\t\tcloseButtonLabel={ __( 'Close' ) }\n\t\t\tonRequestClose={ toggleModal }\n\t\t>\n\t\t\t<ShortcutSection\n\t\t\t\tclassName=\"editor-keyboard-shortcut-help-modal__main-shortcuts\"\n\t\t\t\tshortcuts={ [ 'core/editor/keyboard-shortcuts' ] }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Global shortcuts' ) }\n\t\t\t\tcategoryName=\"global\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Selection shortcuts' ) }\n\t\t\t\tcategoryName=\"selection\"\n\t\t\t/>\n\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'Block shortcuts' ) }\n\t\t\t\tcategoryName=\"block\"\n\t\t\t\tadditionalShortcuts={ [\n\t\t\t\t\t{\n\t\t\t\t\t\tkeyCombination: { character: '/' },\n\t\t\t\t\t\tdescription: __(\n\t\t\t\t\t\t\t'Change the block type after adding a new paragraph.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t/* translators: The forward-slash character. e.g. '/'. */\n\t\t\t\t\t\tariaLabel: __( 'Forward-slash' ),\n\t\t\t\t\t},\n\t\t\t\t] }\n\t\t\t/>\n\t\t\t<ShortcutSection\n\t\t\t\ttitle={ __( 'Text formatting' ) }\n\t\t\t\tshortcuts={ textFormattingShortcuts }\n\t\t\t/>\n\t\t\t<ShortcutCategorySection\n\t\t\t\ttitle={ __( 'List View shortcuts' ) }\n\t\t\t\tcategoryName=\"list-view\"\n\t\t\t/>\n\t\t</Modal>\n\t);\n}\n\nexport default KeyboardShortcutHelpModal;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,KAAK,QAAQ,uBAAuB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,WAAW,EACXC,KAAK,IAAIC,sBAAsB,QACzB,+BAA+B;AACtC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASH,KAAK,IA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E,qBAAsB,CAAG;MACrC2B,YAAY,EAAC;IAAW,CACxB,CAAC,eAEFhB,IAAA,CAACe,uBAAuB;MACvBD,KAAK,EAAGzB,EAAE,CAAE,iBAAkB,CAAG;MACjC2B,YAAY,EAAC,OAAO;MACpBC,mBAAmB,EAAG,CACrB;QACCY,cAAc,EAAE;UAAEC,SAAS,EAAE;QAAI,CAAC;QAClCC,WAAW,EAAE1C,EAAE,CACd,qDACD,CAAC;QACD;QACA2C,SAAS,EAAE3C,EAAE,CAAE,eAAgB;MAChC,CAAC;IACC,CACH,CAAC,eACFW,IAAA,CAACa,eAAe;MACfC,KAAK,EAAGzB,EAAE,CAAE,iBAAkB,CAAG;MACjCgB,SAAS,EAAGT;IAAyB,CACrC,CAAC,eACFI,IAAA,CAACe,uBAAuB;MACvBD,KAAK,EAAGzB,EAAE,CAAE,qBAAsB,CAAG;MACrC2B,YAAY,EAAC;IAAW,CACxB,CAAC;EAAA,CACI,CAAC;AAEV;AAEA,eAAeM,yBAAyB","ignoreList":[]}
@@ -3,9 +3,7 @@
3
3
  */
4
4
  import { Fragment } from '@wordpress/element';
5
5
  import { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';
6
- import { jsx as _jsx } from "react/jsx-runtime";
7
- import { jsxs as _jsxs } from "react/jsx-runtime";
8
- import { Fragment as _Fragment } from "react/jsx-runtime";
6
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
9
7
  function KeyCombination({
10
8
  keyCombination,
11
9
  forceAriaLabel
@@ -1 +1 @@
1
- {"version":3,"names":["Fragment","displayShortcutList","shortcutAriaLabel","jsx","_jsx","jsxs","_jsxs","_Fragment","KeyCombination","keyCombination","forceAriaLabel","shortcut","modifier","character","ariaLabel","className","children","Array","isArray","map","index","Shortcut","description","aliases","alias"],"sources":["@wordpress/editor/src/components/keyboard-shortcut-help-modal/shortcut.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';\n\nfunction KeyCombination( { keyCombination, forceAriaLabel } ) {\n\tconst shortcut = keyCombination.modifier\n\t\t? displayShortcutList[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst ariaLabel = keyCombination.modifier\n\t\t? shortcutAriaLabel[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"editor-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\taria-label={ forceAriaLabel || ariaLabel }\n\t\t>\n\t\t\t{ ( Array.isArray( shortcut ) ? shortcut : [ shortcut ] ).map(\n\t\t\t\t( character, index ) => {\n\t\t\t\t\tif ( character === '+' ) {\n\t\t\t\t\t\treturn <Fragment key={ index }>{ character }</Fragment>;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<kbd\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tclassName=\"editor-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ character }\n\t\t\t\t\t\t</kbd>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t) }\n\t\t</kbd>\n\t);\n}\n\nfunction Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"editor-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"editor-keyboard-shortcut-help-modal__shortcut-term\">\n\t\t\t\t<KeyCombination\n\t\t\t\t\tkeyCombination={ keyCombination }\n\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t/>\n\t\t\t\t{ aliases.map( ( alias, index ) => (\n\t\t\t\t\t<KeyCombination\n\t\t\t\t\t\tkeyCombination={ alias }\n\t\t\t\t\t\tforceAri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EAAEb,cAAc;EAAEc,OAAO,GAAG,EAAE;EAAET;AAAU,CAAC,EAAG;EAC7E,oBACCR,KAAA,CAAAC,SAAA;IAAAS,QAAA,gBACCZ,IAAA;MAAKW,SAAS,EAAC,2DAA2D;MAAAC,QAAA,EACvEM;IAAW,CACT,CAAC,eACNhB,KAAA;MAAKS,SAAS,EAAC,oDAAoD;MAAAC,QAAA,gBAClEZ,IAAA,CAACI,cAAc;QACdC,cAAc,EAAGA,cAAgB;QACjCC,cAAc,EAAGI;MAAW,CAC5B,CAAC,EACAS,OAAO,CAACJ,GAAG,CAAE,CAAEK,KAAK,EAAEJ,KAAK,kBAC5BhB,IAAA,CAACI,cAAc;QACdC,cAAc,EAAGe,KAAO;QACxBd,cAAc,EAAGI;MAAW,GACtBM,KACN,CACA,CAAC;IAAA,CACC,CAAC;EAAA,CACL,CAAC;AAEL;AAEA,eAAeC,QAAQ","ignoreList":[]}
1
+ {"version":3,"names":["Fragment","displayShortcutList","shortcutAriaLabel","jsx","_jsx","jsxs","_jsxs","_Fragment","KeyCombination","keyCombination","forceAriaLabel","shortcut","modifier","character","ariaLabel","className","children","Array","isArray","map","index","Shortcut","description","aliases","alias"],"sources":["@wordpress/editor/src/components/keyboard-shortcut-help-modal/shortcut.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Fragment } from '@wordpress/element';\nimport { displayShortcutList, shortcutAriaLabel } from '@wordpress/keycodes';\n\nfunction KeyCombination( { keyCombination, forceAriaLabel } ) {\n\tconst shortcut = keyCombination.modifier\n\t\t? displayShortcutList[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\tconst ariaLabel = keyCombination.modifier\n\t\t? shortcutAriaLabel[ keyCombination.modifier ](\n\t\t\t\tkeyCombination.character\n\t\t )\n\t\t: keyCombination.character;\n\n\treturn (\n\t\t<kbd\n\t\t\tclassName=\"editor-keyboard-shortcut-help-modal__shortcut-key-combination\"\n\t\t\taria-label={ forceAriaLabel || ariaLabel }\n\t\t>\n\t\t\t{ ( Array.isArray( shortcut ) ? shortcut : [ shortcut ] ).map(\n\t\t\t\t( character, index ) => {\n\t\t\t\t\tif ( character === '+' ) {\n\t\t\t\t\t\treturn <Fragment key={ index }>{ character }</Fragment>;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<kbd\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tclassName=\"editor-keyboard-shortcut-help-modal__shortcut-key\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ character }\n\t\t\t\t\t\t</kbd>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t) }\n\t\t</kbd>\n\t);\n}\n\nfunction Shortcut( { description, keyCombination, aliases = [], ariaLabel } ) {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"editor-keyboard-shortcut-help-modal__shortcut-description\">\n\t\t\t\t{ description }\n\t\t\t</div>\n\t\t\t<div className=\"editor-keyboard-shortcut-help-modal__shortcut-term\">\n\t\t\t\t<KeyCombination\n\t\t\t\t\tkeyCombination={ keyCombination }\n\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t/>\n\t\t\t\t{ aliases.map( ( alias, index ) => (\n\t\t\t\t\t<KeyCombination\n\t\t\t\t\t\tkeyCombination={ alias }\n\t\t\t\t\t\tforceAriaLabel={ ariaLabel }\n\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default Shortcut;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,mBAAmB,EAAEC,iBAAiB,QAAQ,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAN,QAAA,IAAAO,SAAA;AAE7E,SAASC,cAAcA,CAAE;EAAEC,cAAc;EAAEC;AAAe,CAAC,EAAG;EAC7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hB,IAAA,CAACI,cAAc;QACdC,cAAc,EAAGe,KAAO;QACxBd,cAAc,EAAGI;MAAW,GACtBM,KACN,CACA,CAAC;IAAA,CACC,CAAC;EAAA,CACL,CAAC;AAEL;AAEA,eAAeC,QAAQ","ignoreList":[]}
@@ -11,9 +11,7 @@ import CharacterCount from '../character-count';
11
11
  import WordCount from '../word-count';
12
12
  import TimeToRead from '../time-to-read';
13
13
  import DocumentOutline from '../document-outline';
14
- import { jsx as _jsx } from "react/jsx-runtime";
15
- import { jsxs as _jsxs } from "react/jsx-runtime";
16
- import { Fragment as _Fragment } from "react/jsx-runtime";
14
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
17
15
  export default function ListViewOutline() {
18
16
  return /*#__PURE__*/_jsxs(_Fragment, {
19
17
  children: [/*#__PURE__*/_jsxs("div", {
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalText","Text","__","CharacterCount","WordCount","TimeToRead","DocumentOutline","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","ListViewOutline","children","className"],"sources":["@wordpress/editor/src/components/list-view-sidebar/list-view-outline.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalText as Text } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport CharacterCount from '../character-count';\nimport WordCount from '../word-count';\nimport TimeToRead from '../time-to-read';\nimport DocumentOutline from '../document-outline';\n\nexport default function ListViewOutline() {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"editor-list-view-sidebar__outline\">\n\t\t\t\t<div>\n\t\t\t\t\t<Text>{ __( 'Characters:' ) }</Text>\n\t\t\t\t\t<Text>\n\t\t\t\t\t\t<CharacterCount />\n\t\t\t\t\t</Text>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<Text>{ __( 'Words:' ) }</Text>\n\t\t\t\t\t<WordCount />\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t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AC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["__experimentalText","Text","__","CharacterCount","WordCount","TimeToRead","DocumentOutline","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","ListViewOutline","children","className"],"sources":["@wordpress/editor/src/components/list-view-sidebar/list-view-outline.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalText as Text } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport CharacterCount from '../character-count';\nimport WordCount from '../word-count';\nimport TimeToRead from '../time-to-read';\nimport DocumentOutline from '../document-outline';\n\nexport default function ListViewOutline() {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"editor-list-view-sidebar__outline\">\n\t\t\t\t<div>\n\t\t\t\t\t<Text>{ __( 'Characters:' ) }</Text>\n\t\t\t\t\t<Text>\n\t\t\t\t\t\t<CharacterCount />\n\t\t\t\t\t</Text>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<Text>{ __( 'Words:' ) }</Text>\n\t\t\t\t\t<WordCount />\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<Text>{ __( 'Time to read:' ) }</Text>\n\t\t\t\t\t<TimeToRead />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<DocumentOutline />\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,kBAAkB,IAAIC,IAAI,QAAQ,uBAAuB;AAClE,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,cAAc,MAAM,oBAAoB;AAC/C,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,UAAU,MAAM,iBAAiB;AACxC,OAAOC,eAAe,MAAM,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAElD,eAAe,SAASC,eAAeA,CAAA,EAAG;EACzC,oBACCH,KAAA,CAAAE,SAAA;IAAAE,QAAA,gBACCJ,KAAA;MAAKK,SAAS,EAAC,mCAAmC;MAAAD,QAAA,gBACjDJ,KAAA;QAAAI,QAAA,gBACCN,IAAA,CAACP,IAAI;UAAAa,QAAA,EAAGZ,EAAE,CAAE,aAAc;QAAC,CAAQ,CAAC,eACpCM,IAAA,CAACP,IAAI;UAAAa,QAAA,eACJN,IAAA,CAACL,cAAc,IAAE;QAAC,CACb,CAAC;MAAA,CACH,CAAC,eACNO,KAAA;QAAAI,QAAA,gBACCN,IAAA,CAACP,IAAI;UAAAa,QAAA,EAAGZ,EAAE,CAAE,QAAS;QAAC,CAAQ,CAAC,eAC/BM,IAAA,CAACJ,SAAS,IAAE,CAAC;MAAA,CACT,CAAC,eACNM,KAAA;QAAAI,QAAA,gBACCN,IAAA,CAACP,IAAI;UAAAa,QAAA,EAAGZ,EAAE,CAAE,eAAgB;QAAC,CAAQ,CAAC,eACtCM,IAAA,CAACH,UAAU,IAAE,CAAC;MAAA,CACV,CAAC;IAAA,CACF,CAAC,eACNG,IAAA,CAACF,eAAe,IAAE,CAAC;EAAA,CAClB,CAAC;AAEL","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","_x","resolveSelect","decodeEntities","store","coreStore","getExternalLink","url","text","getExternalLinkAttributes","getOpenverseLicense","license","licenseVersion","licenseName","trim","toUpperCase","replace","includes","getOpenverseCaption","item","title","foreign_landing_url","foreignLandingUrl","creator","creator_url","creatorUrl","license_version","license_url","licenseUrl","fullLicense","_creator","_caption","coreMediaFetch","query","mediaItems","getMediaItems","orderBy","search","map","mediaItem","alt","alt_text","source_url","previewUrl","media_details","sizes","medium","caption","raw","inserterMediaCategories","name","labels","search_items","mediaType","fetch","media_type","defaultArgs","mature","excluded_source","finalQuery","mapFromInserterMediaRequest","per_page","URL","Object","entries","forEach","key","value","queryKey","searchParams","set","response","window","headers","jsonResponse","json","results","result","toLowerCase","startsWith","slice","sourceId","id","undefined","thumbnail","getReportUrl","isExternalResource"],"sources":["@wordpress/editor/src/components/media-categories/index.js"],"sourcesContent":["/**\n * The `editor` settings here need to be in sync with the corresponding ones in `editor` package.\n * See `packages/editor/src/components/media-categories/index.js`.\n *\n * In the future we could consider creating an Openvese package that can be used in both `editor` and `site-editor`.\n * The rest of the settings would still need to be in sync though.\n */\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf, _x } from '@wordpress/i18n';\nimport { resolveSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\n\n/** @typedef {import('@wordpress/block-editor').InserterMediaRequest} InserterMediaRequest */\n/** @typedef {import('@wordpress/block-editor').InserterMediaItem} InserterMediaItem */\n/** @typedef {import('@wordpress/block-editor').InserterMediaCategory} InserterMediaCategory */\n\nconst getExternalLink = ( url, text ) =>\n\t`<a ${ getExternalLinkAttributes( url ) }>${ text }</a>`;\n\nconst getExternalLinkAttributes = ( url ) =>\n\t`href=\"${ url }\" target=\"_blank\" rel=\"noreferrer noopener\"`;\n\nconst getOpenverseLicense = ( license, licenseVersion ) => {\n\tlet licenseName = license.trim();\n\t// PDM has no abbreviation\n\tif ( license !== 'pdm' ) {\n\t\tlicenseName = license.toUpperCase().replace( 'SAMPLING', 'Sampling' );\n\t}\n\t// If version is known, append version to the name.\n\t// The license has to have a version to be valid. Only\n\t// PDM (public domain mark) doesn't have a version.\n\tif ( licenseVersion ) {\n\t\tlicenseName += ` ${ licenseVersion }`;\n\t}\n\t// For licenses other than public-domain marks, prepend 'CC' to the name.\n\tif ( ! [ 'pdm', 'cc0' ].includes( license ) ) {\n\t\tlicenseName = `CC ${ licenseName }`;\n\t}\n\treturn licenseName;\n};\n\nconst getOpenverseCaption = ( item ) => {\n\tconst {\n\t\ttitle,\n\t\tforeign_landing_url: foreignLandingUrl,\n\t\tcreator,\n\t\tcreator_url: creatorUrl,\n\t\tlicense,\n\t\tlicense_version: licenseVersion,\n\t\tlicense_url: licenseUrl,\n\t} = item;\n\tconst fullLicense = getOpenverseLicense( license, licenseVersion );\n\tconst _creator = decodeEntities( creator );\n\tlet _caption;\n\tif ( _creator ) {\n\t\t_caption = title\n\t\t\t? sprintf(\n\t\t\t\t\t// translators: %1s: Title of a media work from Openverse; %2s: Name of the work's creator; %3s: Work's licence e.g: \"CC0 1.0\".\n\t\t\t\t\t_x( '\"%1$s\" by %2$s/ %3$s', 'caption' ),\n\t\t\t\t\tgetExternalLink(\n\t\t\t\t\t\tforeignLandingUrl,\n\t\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t\t),\n\t\t\t\t\tcreatorUrl\n\t\t\t\t\t\t? getExternalLink( creatorUrl, _creator )\n\t\t\t\t\t\t: _creator,\n\t\t\t\t\tlicenseUrl\n\t\t\t\t\t\t? getExternalLink(\n\t\t\t\t\t\t\t\t`${ licenseUrl }?ref=openverse`,\n\t\t\t\t\t\t\t\tfullLicense\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: fullLicense\n\t\t\t )\n\t\t\t: sprintf(\n\t\t\t\t\t// translators: %1s: Link attributes for a given Openverse media work; %2s: Name of the work's creator; %3s: Works's licence e.g: \"CC0 1.0\".\n\t\t\t\t\t_x( '<a %1$s>Work</a> by %2$s/ %3$s', 'caption' ),\n\t\t\t\t\tgetExternalLinkAttributes( foreignLandingUrl ),\n\t\t\t\t\tcreatorUrl\n\t\t\t\t\t\t? getExternalLink( creatorUrl, _creator )\n\t\t\t\t\t\t: _creator,\n\t\t\t\t\tlicenseUrl\n\t\t\t\t\t\t? getExternalLink(\n\t\t\t\t\t\t\t\t`${ licenseUrl }?ref=openverse`,\n\t\t\t\t\t\t\t\tfullLicense\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: fullLicense\n\t\t\t );\n\t} else {\n\t\t_caption = title\n\t\t\t? sprintf(\n\t\t\t\t\t// translators: %1s: Title of a media work from Openverse; %2s: Work's licence e.g: \"CC0 1.0\".\n\t\t\t\t\t_x( '\"%1$s\"/ %2$s', 'caption' ),\n\t\t\t\t\tgetExternalLink(\n\t\t\t\t\t\tforeignLandingUrl,\n\t\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t\t),\n\t\t\t\t\tlicenseUrl\n\t\t\t\t\t\t? getExternalLink(\n\t\t\t\t\t\t\t\t`${ licenseUrl }?ref=openverse`,\n\t\t\t\t\t\t\t\tfullLicense\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: fullLicense\n\t\t\t )\n\t\t\t: sprintf(\n\t\t\t\t\t// translators: %1s: Link attributes for a given Openverse media work; %2s: Works's licence e.g: \"CC0 1.0\".\n\t\t\t\t\t_x( '<a %1$s>Work</a>/ %2$s', 'caption' ),\n\t\t\t\t\tgetExternalLinkAttributes( foreignLandingUrl ),\n\t\t\t\t\tlicenseUrl\n\t\t\t\t\t\t? getExternalLink(\n\t\t\t\t\t\t\t\t`${ licenseUrl }?ref=openverse`,\n\t\t\t\t\t\t\t\tfullLicense\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: fullLicense\n\t\t\t );\n\t}\n\treturn _caption.replace( /\\s{2}/g, ' ' );\n};\n\nconst coreMediaFetch = async ( query = {} ) => {\n\tconst mediaItems = await resolveSelect( coreStore ).getMediaItems( {\n\t\t...query,\n\t\torderBy: !! query?.search ? 'relevance' : 'date',\n\t} );\n\treturn mediaItems.map( ( mediaItem ) => ( {\n\t\t...mediaItem,\n\t\talt: mediaItem.alt_text,\n\t\turl: mediaItem.source_url,\n\t\tpreviewUrl: mediaItem.media_details?.sizes?.medium?.source_url,\n\t\tcaption: mediaItem.caption?.raw,\n\t} ) );\n};\n\n/** @type {InserterMediaCategory[]} */\nconst inserterMediaCategories = [\n\t{\n\t\tname: 'images',\n\t\tlabels: {\n\t\t\tname: __( 'Images' ),\n\t\t\tsearch_items: __( 'Search images' ),\n\t\t},\n\t\tmediaType: 'image',\n\t\tasync fetch( query = {} ) {\n\t\t\treturn coreMediaFetch( { ...query, media_type: 'image' } );\n\t\t},\n\t},\n\t{\n\t\tname: 'videos',\n\t\tlabels: {\n\t\t\tname: __( 'Videos' ),\n\t\t\tsearch_items: __( 'Search videos' ),\n\t\t},\n\t\tmediaType: 'video',\n\t\tasync fetch( query = {} ) {\n\t\t\treturn coreMediaFetch( { ...query, media_type: 'video' } );\n\t\t},\n\t},\n\t{\n\t\tname: 'audio',\n\t\tlabels: {\n\t\t\tname: __( 'Audio' ),\n\t\t\tsearch_items: __( 'Search audio' ),\n\t\t},\n\t\tmediaType: 'audio',\n\t\tasync fetch( query = {} ) {\n\t\t\treturn coreMediaFetch( { ...query, media_type: 'audio' } );\n\t\t},\n\t},\n\t{\n\t\tname: 'openverse',\n\t\tlabels: {\n\t\t\tname: __( 'Openverse' ),\n\t\t\tsearch_items: __( 'Search Openverse' ),\n\t\t},\n\t\tmediaType: 'image',\n\t\tasync fetch( query = {} ) {\n\t\t\tconst defaultArgs = {\n\t\t\t\tmature: false,\n\t\t\t\texcluded_source: 'flickr,inaturalist,wikimedia',\n\t\t\t\tlicense: 'pdm,cc0',\n\t\t\t};\n\t\t\tconst finalQuery = { ...query, ...defaultArgs };\n\t\t\tconst mapFromInserterMediaRequest = {\n\t\t\t\tper_page: 'page_size',\n\t\t\t\tsearch: 'q',\n\t\t\t};\n\t\t\tconst url = new URL( 'https://api.openverse.org/v1/images/' );\n\t\t\tObject.entries( finalQuery ).forEach( ( [ key, value ] ) => {\n\t\t\t\tconst queryKey = mapFromInserterMediaRequest[ key ] || key;\n\t\t\t\turl.searchParams.set( queryKey, value );\n\t\t\t} );\n\t\t\tconst response = await window.fetch( url, {\n\t\t\t\theaders: {\n\t\t\t\t\t'User-Agent': 'WordPress/inserter-media-fetch',\n\t\t\t\t},\n\t\t\t} );\n\t\t\tconst jsonResponse = await response.json();\n\t\t\tconst results = jsonResponse.results;\n\t\t\treturn results.map( ( result ) => ( {\n\t\t\t\t...result,\n\t\t\t\t// This is a temp solution for better titles, until Openverse API\n\t\t\t\t// completes the cleaning up of some titles of their upstream data.\n\t\t\t\ttitle: result.title?.toLowerCase().startsWith( 'file:' )\n\t\t\t\t\t? result.title.slice( 5 )\n\t\t\t\t\t: result.title,\n\t\t\t\tsourceId: result.id,\n\t\t\t\tid: undefined,\n\t\t\t\tcaption: getOpenverseCaption( result ),\n\t\t\t\tpreviewUrl: result.thumbnail,\n\t\t\t} ) );\n\t\t},\n\t\tgetReportUrl: ( { sourceId } ) =>\n\t\t\t`https://wordpress.org/openverse/image/${ sourceId }/report/`,\n\t\tisExternalResource: true,\n\t},\n];\n\nexport default inserterMediaCategories;\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AACjD,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;;AAEA,MAAMC,eAAe,GAAGA,CAAEC,GAAG,EAAEC,IAAI,KACjC,MAAMC,yBAAyB,CAAEF,GAAI,CAAG,IAAIC,IAAM,MAAK;AAEzD,MAAMC,yBAAyB,GAAKF,GAAG,IACrC,SAASA,GAAK,6CAA4C;AAE5D,MAAMG,mBAAmB,GAAGA,CAAEC,OAAO,EAAEC,cAAc,KAAM;EAC1D,IAAIC,WAAW,GAAGF,OAAO,CAACG,IAAI,CAAC,CAAC;EAChC;EACA,IAAKH,OAAO,KAAK,KAAK,EAAG;IACxBE,WAAW,GAAGF,OAAO,CAACI,WAAW,CAAC,CAAC,CAACC,OAAO,CAAE,UAAU,EAAE,UAAW,CAAC;EACtE;EACA;EACA;EACA;EACA,IAAKJ,cAAc,EAAG;IACrBC,WAAW,IAAK,IAAID,cAAgB,EAAC;EACtC;EACA;EACA,IAAK,CAAE,CAAE,KAAK,EAAE,KAAK,CAAE,CAACK,QAAQ,CAAEN,OAAQ,CAAC,EAAG;IAC7C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AG,IAAIuD,GAAG,CAAE,sCAAuC,CAAC;IAC7DC,MAAM,CAACC,OAAO,CAAEL,UAAW,CAAC,CAACM,OAAO,CAAE,CAAE,CAAEC,GAAG,EAAEC,KAAK,CAAE,KAAM;MAC3D,MAAMC,QAAQ,GAAGR,2BAA2B,CAAEM,GAAG,CAAE,IAAIA,GAAG;MAC1D3D,GAAG,CAAC8D,YAAY,CAACC,GAAG,CAAEF,QAAQ,EAAED,KAAM,CAAC;IACxC,CAAE,CAAC;IACH,MAAMI,QAAQ,GAAG,MAAMC,MAAM,CAAClB,KAAK,CAAE/C,GAAG,EAAE;MACzCkE,OAAO,EAAE;QACR,YAAY,EAAE;MACf;IACD,CAAE,CAAC;IACH,MAAMC,YAAY,GAAG,MAAMH,QAAQ,CAACI,IAAI,CAAC,CAAC;IAC1C,MAAMC,OAAO,GAAGF,YAAY,CAACE,OAAO;IACpC,OAAOA,OAAO,CAACtC,GAAG,CAAIuC,MAAM,KAAQ;MACnC,GAAGA,MAAM;MACT;MACA;MACAzD,KAAK,EAAEyD,MAAM,CAACzD,KAAK,EAAE0D,WAAW,CAAC,CAAC,CAACC,UAAU,CAAE,OAAQ,CAAC,GACrDF,MAAM,CAACzD,KAAK,CAAC4D,KAAK,CAAE,CAAE,CAAC,GACvBH,MAAM,CAACzD,KAAK;MACf6D,QAAQ,EAAEJ,MAAM,CAACK,EAAE;MACnBA,EAAE,EAAEC,SAAS;MACbpC,OAAO,EAAE7B,mBAAmB,CAAE2D,MAAO,CAAC;MACtClC,UAAU,EAAEkC,MAAM,CAACO;IACpB,CAAC,CAAG,CAAC;EACN,CAAC;EACDC,YAAY,EAAEA,CAAE;IAAEJ;EAAS,CAAC,KAC1B,yCAAyCA,QAAU,UAAS;EAC9DK,kBAAkB,EAAE;AACrB,CAAC,CACD;AAED,eAAerC,uBAAuB","ignoreList":[]}
1
+ {"version":3,"names":["__","sprintf","_x","resolveSelect","decodeEntities","store","coreStore","getExternalLink","url","text","getExternalLinkAttributes","getOpenverseLicense","license","licenseVersion","licenseName","trim","toUpperCase","replace","includes","getOpenverseCaption","item","title","foreign_landing_url","foreignLandingUrl","creator","creator_url","creatorUrl","license_version","license_url","licenseUrl","fullLicense","_creator","_caption","coreMediaFetch","query","mediaItems","getMediaItems","orderBy","search","map","mediaItem","alt","alt_text","source_url","previewUrl","media_details","sizes","medium","caption","raw","inserterMediaCategories","name","labels","search_items","mediaType","fetch","media_type","defaultArgs","mature","excluded_source","finalQuery","mapFromInserterMediaRequest","per_page","URL","Object","entries","forEach","key","value","queryKey","searchParams","set","response","window","headers","jsonResponse","json","results","result","toLowerCase","startsWith","slice","sourceId","id","undefined","thumbnail","getReportUrl","isExternalResource"],"sources":["@wordpress/editor/src/components/media-categories/index.js"],"sourcesContent":["/**\n * The `editor` settings here need to be in sync with the corresponding ones in `editor` package.\n * See `packages/editor/src/components/media-categories/index.js`.\n *\n * In the future we could consider creating an Openvese package that can be used in both `editor` and `site-editor`.\n * The rest of the settings would still need to be in sync though.\n */\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf, _x } from '@wordpress/i18n';\nimport { resolveSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\n\n/** @typedef {import('@wordpress/block-editor').InserterMediaRequest} InserterMediaRequest */\n/** @typedef {import('@wordpress/block-editor').InserterMediaItem} InserterMediaItem */\n/** @typedef {import('@wordpress/block-editor').InserterMediaCategory} InserterMediaCategory */\n\nconst getExternalLink = ( url, text ) =>\n\t`<a ${ getExternalLinkAttributes( url ) }>${ text }</a>`;\n\nconst getExternalLinkAttributes = ( url ) =>\n\t`href=\"${ url }\" target=\"_blank\" rel=\"noreferrer noopener\"`;\n\nconst getOpenverseLicense = ( license, licenseVersion ) => {\n\tlet licenseName = license.trim();\n\t// PDM has no abbreviation\n\tif ( license !== 'pdm' ) {\n\t\tlicenseName = license.toUpperCase().replace( 'SAMPLING', 'Sampling' );\n\t}\n\t// If version is known, append version to the name.\n\t// The license has to have a version to be valid. Only\n\t// PDM (public domain mark) doesn't have a version.\n\tif ( licenseVersion ) {\n\t\tlicenseName += ` ${ licenseVersion }`;\n\t}\n\t// For licenses other than public-domain marks, prepend 'CC' to the name.\n\tif ( ! [ 'pdm', 'cc0' ].includes( license ) ) {\n\t\tlicenseName = `CC ${ licenseName }`;\n\t}\n\treturn licenseName;\n};\n\nconst getOpenverseCaption = ( item ) => {\n\tconst {\n\t\ttitle,\n\t\tforeign_landing_url: foreignLandingUrl,\n\t\tcreator,\n\t\tcreator_url: creatorUrl,\n\t\tlicense,\n\t\tlicense_version: licenseVersion,\n\t\tlicense_url: licenseUrl,\n\t} = item;\n\tconst fullLicense = getOpenverseLicense( license, licenseVersion );\n\tconst _creator = decodeEntities( creator );\n\tlet _caption;\n\tif ( _creator ) {\n\t\t_caption = title\n\t\t\t? sprintf(\n\t\t\t\t\t// translators: %1s: Title of a media work from Openverse; %2s: Name of the work's creator; %3s: Work's licence e.g: \"CC0 1.0\".\n\t\t\t\t\t_x( '\"%1$s\" by %2$s/ %3$s', 'caption' ),\n\t\t\t\t\tgetExternalLink(\n\t\t\t\t\t\tforeignLandingUrl,\n\t\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t\t),\n\t\t\t\t\tcreatorUrl\n\t\t\t\t\t\t? getExternalLink( creatorUrl, _creator )\n\t\t\t\t\t\t: _creator,\n\t\t\t\t\tlicenseUrl\n\t\t\t\t\t\t? getExternalLink(\n\t\t\t\t\t\t\t\t`${ licenseUrl }?ref=openverse`,\n\t\t\t\t\t\t\t\tfullLicense\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: fullLicense\n\t\t\t )\n\t\t\t: sprintf(\n\t\t\t\t\t// translators: %1s: Link attributes for a given Openverse media work; %2s: Name of the work's creator; %3s: Works's licence e.g: \"CC0 1.0\".\n\t\t\t\t\t_x( '<a %1$s>Work</a> by %2$s/ %3$s', 'caption' ),\n\t\t\t\t\tgetExternalLinkAttributes( foreignLandingUrl ),\n\t\t\t\t\tcreatorUrl\n\t\t\t\t\t\t? getExternalLink( creatorUrl, _creator )\n\t\t\t\t\t\t: _creator,\n\t\t\t\t\tlicenseUrl\n\t\t\t\t\t\t? getExternalLink(\n\t\t\t\t\t\t\t\t`${ licenseUrl }?ref=openverse`,\n\t\t\t\t\t\t\t\tfullLicense\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: fullLicense\n\t\t\t );\n\t} else {\n\t\t_caption = title\n\t\t\t? sprintf(\n\t\t\t\t\t// translators: %1s: Title of a media work from Openverse; %2s: Work's licence e.g: \"CC0 1.0\".\n\t\t\t\t\t_x( '\"%1$s\"/ %2$s', 'caption' ),\n\t\t\t\t\tgetExternalLink(\n\t\t\t\t\t\tforeignLandingUrl,\n\t\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t\t),\n\t\t\t\t\tlicenseUrl\n\t\t\t\t\t\t? getExternalLink(\n\t\t\t\t\t\t\t\t`${ licenseUrl }?ref=openverse`,\n\t\t\t\t\t\t\t\tfullLicense\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: fullLicense\n\t\t\t )\n\t\t\t: sprintf(\n\t\t\t\t\t// translators: %1s: Link attributes for a given Openverse media work; %2s: Works's licence e.g: \"CC0 1.0\".\n\t\t\t\t\t_x( '<a %1$s>Work</a>/ %2$s', 'caption' ),\n\t\t\t\t\tgetExternalLinkAttributes( foreignLandingUrl ),\n\t\t\t\t\tlicenseUrl\n\t\t\t\t\t\t? getExternalLink(\n\t\t\t\t\t\t\t\t`${ licenseUrl }?ref=openverse`,\n\t\t\t\t\t\t\t\tfullLicense\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: fullLicense\n\t\t\t );\n\t}\n\treturn _caption.replace( /\\s{2}/g, ' ' );\n};\n\nconst coreMediaFetch = async ( query = {} ) => {\n\tconst mediaItems = await resolveSelect( coreStore ).getMediaItems( {\n\t\t...query,\n\t\torderBy: !! query?.search ? 'relevance' : 'date',\n\t} );\n\treturn mediaItems.map( ( mediaItem ) => ( {\n\t\t...mediaItem,\n\t\talt: mediaItem.alt_text,\n\t\turl: mediaItem.source_url,\n\t\tpreviewUrl: mediaItem.media_details?.sizes?.medium?.source_url,\n\t\tcaption: mediaItem.caption?.raw,\n\t} ) );\n};\n\n/** @type {InserterMediaCategory[]} */\nconst inserterMediaCategories = [\n\t{\n\t\tname: 'images',\n\t\tlabels: {\n\t\t\tname: __( 'Images' ),\n\t\t\tsearch_items: __( 'Search images' ),\n\t\t},\n\t\tmediaType: 'image',\n\t\tasync fetch( query = {} ) {\n\t\t\treturn coreMediaFetch( { ...query, media_type: 'image' } );\n\t\t},\n\t},\n\t{\n\t\tname: 'videos',\n\t\tlabels: {\n\t\t\tname: __( 'Videos' ),\n\t\t\tsearch_items: __( 'Search videos' ),\n\t\t},\n\t\tmediaType: 'video',\n\t\tasync fetch( query = {} ) {\n\t\t\treturn coreMediaFetch( { ...query, media_type: 'video' } );\n\t\t},\n\t},\n\t{\n\t\tname: 'audio',\n\t\tlabels: {\n\t\t\tname: __( 'Audio' ),\n\t\t\tsearch_items: __( 'Search audio' ),\n\t\t},\n\t\tmediaType: 'audio',\n\t\tasync fetch( query = {} ) {\n\t\t\treturn coreMediaFetch( { ...query, media_type: 'audio' } );\n\t\t},\n\t},\n\t{\n\t\tname: 'openverse',\n\t\tlabels: {\n\t\t\tname: __( 'Openverse' ),\n\t\t\tsearch_items: __( 'Search Openverse' ),\n\t\t},\n\t\tmediaType: 'image',\n\t\tasync fetch( query = {} ) {\n\t\t\tconst defaultArgs = {\n\t\t\t\tmature: false,\n\t\t\t\texcluded_source: 'flickr,inaturalist,wikimedia',\n\t\t\t\tlicense: 'pdm,cc0',\n\t\t\t};\n\t\t\tconst finalQuery = { ...query, ...defaultArgs };\n\t\t\tconst mapFromInserterMediaRequest = {\n\t\t\t\tper_page: 'page_size',\n\t\t\t\tsearch: 'q',\n\t\t\t};\n\t\t\tconst url = new URL( 'https://api.openverse.org/v1/images/' );\n\t\t\tObject.entries( finalQuery ).forEach( ( [ key, value ] ) => {\n\t\t\t\tconst queryKey = mapFromInserterMediaRequest[ key ] || key;\n\t\t\t\turl.searchParams.set( queryKey, value );\n\t\t\t} );\n\t\t\tconst response = await window.fetch( url, {\n\t\t\t\theaders: {\n\t\t\t\t\t'User-Agent': 'WordPress/inserter-media-fetch',\n\t\t\t\t},\n\t\t\t} );\n\t\t\tconst jsonResponse = await response.json();\n\t\t\tconst results = jsonResponse.results;\n\t\t\treturn results.map( ( result ) => ( {\n\t\t\t\t...result,\n\t\t\t\t// This is a temp solution for better titles, until Openverse API\n\t\t\t\t// completes the cleaning up of some titles of their upstream data.\n\t\t\t\ttitle: result.title?.toLowerCase().startsWith( 'file:' )\n\t\t\t\t\t? result.title.slice( 5 )\n\t\t\t\t\t: result.title,\n\t\t\t\tsourceId: result.id,\n\t\t\t\tid: undefined,\n\t\t\t\tcaption: getOpenverseCaption( result ),\n\t\t\t\tpreviewUrl: result.thumbnail,\n\t\t\t} ) );\n\t\t},\n\t\tgetReportUrl: ( { sourceId } ) =>\n\t\t\t`https://wordpress.org/openverse/image/${ sourceId }/report/`,\n\t\tisExternalResource: true,\n\t},\n];\n\nexport default inserterMediaCategories;\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AACjD,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;;AAEA,MAAMC,eAAe,GAAGA,CAAEC,GAAG,EAAEC,IAAI,KAClC,MAAOC,yBAAyB,CAAEF,GAAI,CAAC,IAAMC,IAAI,MAAO;AAEzD,MAAMC,yBAAyB,GAAKF,GAAG,IACtC,SAAUA,GAAG,6CAA8C;AAE5D,MAAMG,mBAAmB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zD,KAAK;MACf6D,QAAQ,EAAEJ,MAAM,CAACK,EAAE;MACnBA,EAAE,EAAEC,SAAS;MACbpC,OAAO,EAAE7B,mBAAmB,CAAE2D,MAAO,CAAC;MACtClC,UAAU,EAAEkC,MAAM,CAACO;IACpB,CAAC,CAAG,CAAC;EACN,CAAC;EACDC,YAAY,EAAEA,CAAE;IAAEJ;EAAS,CAAC,KAC3B,yCAA0CA,QAAQ,UAAW;EAC9DK,kBAAkB,EAAE;AACrB,CAAC,CACD;AAED,eAAerC,uBAAuB","ignoreList":[]}
@@ -17,9 +17,7 @@ import ModeSwitcher from '../mode-switcher';
17
17
  import ToolsMoreMenuGroup from './tools-more-menu-group';
18
18
  import ViewMoreMenuGroup from './view-more-menu-group';
19
19
  import { store as editorStore } from '../../store';
20
- import { jsx as _jsx } from "react/jsx-runtime";
21
- import { jsxs as _jsxs } from "react/jsx-runtime";
22
- import { Fragment as _Fragment } from "react/jsx-runtime";
20
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
23
21
  export default function MoreMenu() {
24
22
  const {
25
23
  openModal
@@ -1 +1 @@
1
- {"version":3,"names":["__","_x","useSelect","useDispatch","displayShortcut","external","moreVertical","MenuGroup","MenuItem","VisuallyHidden","DropdownMenu","PreferenceToggleMenuItem","store","preferencesStore","interfaceStore","ActionItem","CopyContentMenuItem","ModeSwitcher","ToolsMoreMenuGroup","ViewMoreMenuGroup","editorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","MoreMenu","openModal","set","setPreference","toggleDistractionFree","showIconLabels","select","get","turnOffDistractionFree","children","icon","label","popoverProps","placement","className","toggleProps","showTooltip","variant","tooltipPosition","size","onClose","scope","name","onToggle","info","messageActivated","messageDeactivated","handleToggling","shortcut","primaryShift","Slot","fillProps","as","onClick","access","href","target","rel"],"sources":["@wordpress/editor/src/components/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { external, moreVertical } from '@wordpress/icons';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n\tDropdownMenu,\n} from '@wordpress/components';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { store as interfaceStore, ActionItem } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport ModeSwitcher from '../mode-switcher';\nimport ToolsMoreMenuGroup from './tools-more-menu-group';\nimport ViewMoreMenuGroup from './view-more-menu-group';\nimport { store as editorStore } from '../../store';\n\nexport default function MoreMenu() {\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst { toggleDistractionFree } = useDispatch( editorStore );\n\tconst showIconLabels = useSelect(\n\t\t( select ) =>\n\t\t\tselect( preferencesStore ).get( 'core', 'showIconLabels' ),\n\t\t[]\n\t);\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\tpopoverProps={ {\n\t\t\t\t\tplacement: 'bottom-end',\n\t\t\t\t\tclassName: 'more-menu-dropdown__content',\n\t\t\t\t} }\n\t\t\t\ttoggleProps={ {\n\t\t\t\t\tshowTooltip: ! showIconLabels,\n\t\t\t\t\t...( showIconLabels && { variant: 'tertiary' } ),\n\t\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\t\tsize: 'compact',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"distractionFree\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Write with calmness' ) }\n\t\t\t\t\t\t\t\thandleToggling={ false }\n\t\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primaryShift(\n\t\t\t\t\t\t\t\t\t'\\\\'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"focusMode\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ViewMoreMenuGroup.Slot fillProps={ { onClose } } />\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<ModeSwitcher />\n\t\t\t\t\t\t<ActionItem.Slot\n\t\t\t\t\t\t\tname=\"core/plugin-more-menu\"\n\t\t\t\t\t\t\tlabel={ __( 'Plugins' ) }\n\t\t\t\t\t\t\tas={ MenuGroup }\n\t\t\t\t\t\t\tfillProps={ { onClick: onClose } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal( 'editor/keyboard-shortcut-help' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<ToolsMoreMenuGroup.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal( 'editor/preferences' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Preferences' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,QAAQ,EAAEC,YAAY,QAAQ,kBAAkB;AACzD,SACCC,SAAS,EACTC,QAAQ,EACRC,cAAc,EACdC,YAAY,QACN,uBAAuB;AAC9B,SACCC,wBAAwB,EACxBC,KAAK,IAAIC,gBAAgB,QACnB,wBAAwB;AAC/B,SAASD,KAAK,IAAIE,cAAc,EAAEC,UAAU,QAAQ,sBAAsB;;AAE1E;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,0BAA0B;AAC1D,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,kBAAkB,MAAM,yBAAyB;AACxD,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,SAASP,KAAK,IAAIQ,WAAW,QAAQ,aAAa;AAAC,SAAAC,GA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AChBmD,SAAS,EAAG;YAAEE,OAAO,EAAEb;UAAQ;QAAG,CAClC,CAAC,eACFvB,KAAA,CAACjB,SAAS;UAAC+B,KAAK,EAAGtC,EAAE,CAAE,OAAQ,CAAG;UAAAoC,QAAA,gBACjCd,IAAA,CAACd,QAAQ;YACRoD,OAAO,EAAGA,CAAA,KACThC,SAAS,CAAE,+BAAgC,CAC3C;YACD2B,QAAQ,EAAGnD,eAAe,CAACyD,MAAM,CAAE,GAAI,CAAG;YAAAzB,QAAA,EAExCpC,EAAE,CAAE,oBAAqB;UAAC,CACnB,CAAC,eACXsB,IAAA,CAACN,mBAAmB,IAAE,CAAC,eACvBQ,KAAA,CAAChB,QAAQ;YACR6B,IAAI,EAAGhC,QAAU;YACjByD,IAAI,EAAG9D,EAAE,CACR,qEACD,CAAG;YACH+D,MAAM,EAAC,QAAQ;YACfC,GAAG,EAAC,qBAAqB;YAAA5B,QAAA,GAEvBpC,EAAE,CAAE,MAAO,CAAC,eACdsB,IAAA,CAACb,cAAc;cAACkD,EAAE,EAAC,MAAM;cAAAvB,QAAA,EAEvB;cACApC,EAAE,CAAE,sBAAuB;YAAC,CAEd,CAAC;UAAA,CACR,CAAC,eACXsB,IAAA,CAACJ,kBAAkB,CAACuC,IAAI;YACvBC,SAAS,EAAG;cAAEX;YAAQ;UAAG,CACzB,CAAC;QAAA,CACQ,CAAC,eACZzB,IAAA,CAACf,SAAS;UAAA6B,QAAA,eACTd,IAAA,CAACd,QAAQ;YACRoD,OAAO,EAAGA,CAAA,KACThC,SAAS,CAAE,oBAAqB,CAChC;YAAAQ,QAAA,EAECpC,EAAE,CAAE,aAAc;UAAC,CACZ;QAAC,CACD,CAAC;MAAA,CACX;IACF,CACY;EAAC,CACd,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["__","_x","useSelect","useDispatch","displayShortcut","external","moreVertical","MenuGroup","MenuItem","VisuallyHidden","DropdownMenu","PreferenceToggleMenuItem","store","preferencesStore","interfaceStore","ActionItem","CopyContentMenuItem","ModeSwitcher","ToolsMoreMenuGroup","ViewMoreMenuGroup","editorStore","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","MoreMenu","openModal","set","setPreference","toggleDistractionFree","showIconLabels","select","get","turnOffDistractionFree","children","icon","label","popoverProps","placement","className","toggleProps","showTooltip","variant","tooltipPosition","size","onClose","scope","name","onToggle","info","messageActivated","messageDeactivated","handleToggling","shortcut","primaryShift","Slot","fillProps","as","onClick","access","href","target","rel"],"sources":["@wordpress/editor/src/components/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { external, moreVertical } from '@wordpress/icons';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n\tDropdownMenu,\n} from '@wordpress/components';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { store as interfaceStore, ActionItem } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport ModeSwitcher from '../mode-switcher';\nimport ToolsMoreMenuGroup from './tools-more-menu-group';\nimport ViewMoreMenuGroup from './view-more-menu-group';\nimport { store as editorStore } from '../../store';\n\nexport default function MoreMenu() {\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst { toggleDistractionFree } = useDispatch( editorStore );\n\tconst showIconLabels = useSelect(\n\t\t( select ) =>\n\t\t\tselect( preferencesStore ).get( 'core', 'showIconLabels' ),\n\t\t[]\n\t);\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\tpopoverProps={ {\n\t\t\t\t\tplacement: 'bottom-end',\n\t\t\t\t\tclassName: 'more-menu-dropdown__content',\n\t\t\t\t} }\n\t\t\t\ttoggleProps={ {\n\t\t\t\t\tshowTooltip: ! showIconLabels,\n\t\t\t\t\t...( showIconLabels && { variant: 'tertiary' } ),\n\t\t\t\t\ttooltipPosition: 'bottom',\n\t\t\t\t\tsize: 'compact',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"distractionFree\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Write with calmness' ) }\n\t\t\t\t\t\t\t\thandleToggling={ false }\n\t\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primaryShift(\n\t\t\t\t\t\t\t\t\t'\\\\'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"focusMode\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ViewMoreMenuGroup.Slot fillProps={ { onClose } } />\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<ModeSwitcher />\n\t\t\t\t\t\t<ActionItem.Slot\n\t\t\t\t\t\t\tname=\"core/plugin-more-menu\"\n\t\t\t\t\t\t\tlabel={ __( 'Plugins' ) }\n\t\t\t\t\t\t\tas={ MenuGroup }\n\t\t\t\t\t\t\tfillProps={ { onClick: onClose } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal( 'editor/keyboard-shortcut-help' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<ToolsMoreMenuGroup.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal( 'editor/preferences' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Preferences' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,QAAQ,EAAEC,YAAY,QAAQ,kBAAkB;AACzD,SACCC,SAAS,EACTC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,eACZzB,IAAA,CAACf,SAAS;UAAA6B,QAAA,eACTd,IAAA,CAACd,QAAQ;YACRoD,OAAO,EAAGA,CAAA,KACThC,SAAS,CAAE,oBAAqB,CAChC;YAAAQ,QAAA,EAECpC,EAAE,CAAE,aAAc;UAAC,CACZ;QAAC,CACD,CAAC;MAAA,CACX;IACF,CACY;EAAC,CACd,CAAC;AAEL","ignoreList":[]}
@@ -29,8 +29,7 @@ import styles from './style.native.scss';
29
29
  * @param {boolean} [options.isActive] Whether the message should be announced.
30
30
  * @param {string} [options.inactiveMessage] The message to announce when inactive.
31
31
  */
32
- import { jsx as _jsx } from "react/jsx-runtime";
33
- import { jsxs as _jsxs } from "react/jsx-runtime";
32
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
34
33
  function useAccessibilityLiveRegion(message, {
35
34
  isActive,
36
35
  inactiveMessage
@@ -1 +1 @@
1
- {"version":3,"names":["AccessibilityInfo","Text","View","usePreferredColorSchemeStyle","useNetworkConnectivity","usePrevious","Icon","offline","offlineIcon","__","useEffect","styles","jsx","_jsx","jsxs","_jsxs","useAccessibilityLiveRegion","message","isActive","inactiveMessage","announceForAccessibility","prevIsActive","unconditionalMessage","initialRender","OfflineStatus","isConnected","containerStyle","offline__dark","textStyle","iconStyle","accessible","accessibilityRole","accessibilityLabel","style","children","fill","icon"],"sources":["@wordpress/editor/src/components/offline-status/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { AccessibilityInfo, Text, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tusePreferredColorSchemeStyle,\n\tuseNetworkConnectivity,\n\tusePrevious,\n} from '@wordpress/compose';\nimport { Icon } from '@wordpress/components';\nimport { offline as offlineIcon } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.native.scss';\n\n/**\n * Conditionally announces messages for screen reader users. This Hook provides\n * two benefits over React Native's `accessibilityLiveRegion`:\n *\n * 1. It works on both iOS and Android.\n * 2. It allows announcing a secondary message when the component is inactive.\n *\n * @param {string} message The message to announce.\n * @param {Object} options Options for the Hook.\n * @param {boolean} [options.isActive] Whether the message should be announced.\n * @param {string} [options.inactiveMessage] The message to announce when inactive.\n */\nfunction useAccessibilityLiveRegion( message, { isActive, inactiveMessage } ) {\n\tconst { announceForAccessibility } = AccessibilityInfo;\n\tconst prevIsActive = usePrevious( isActive );\n\n\tuseEffect( () => {\n\t\tconst unconditionalMessage = typeof isActive === 'undefined';\n\t\tconst initialRender = typeof prevIsActive === 'undefined';\n\n\t\tif (\n\t\t\tunconditionalMessage ||\n\t\t\t( isActive && ! prevIsActive && ! initialRender )\n\t\t) {\n\t\t\tannounceForAccessibility( message );\n\t\t} else if ( ! isActive && prevIsActive && inactiveMessage ) {\n\t\t\tannounceForAccessibility( inactiveMessage );\n\t\t}\n\t}, [\n\t\tmessage,\n\t\tisActive,\n\t\tprevIsActive,\n\t\tinactiveMessage,\n\t\tannounceForAccessibility,\n\t] );\n}\n\nconst OfflineStatus = () => {\n\tconst { isConnected } = useNetworkConnectivity();\n\n\tuseAccessibilityLiveRegion( __( 'Network connection re-established' ), {\n\t\tisActive: isConnected,\n\t\tinactiveMessage: __( 'Network connection lost, working offline' ),\n\t} );\n\n\tconst containerStyle = usePreferredColorSchemeStyle(\n\t\tstyles.offline,\n\t\tstyles.offline__dark\n\t);\n\n\tconst textStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'offline--text' ],\n\t\tstyles[ 'offline--text__dark' ]\n\t);\n\n\tconst iconStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'offline--icon' ],\n\t\tstyles[ 'offline--icon__dark' ]\n\t);\n\n\treturn ! isConnected ? (\n\t\t<View\n\t\t\taccessible\n\t\t\taccessibilityRole=\"alert\"\n\t\t\taccessibilityLabel={ __(\n\t\t\t\t'Network connection lost, working offline'\n\t\t\t) }\n\t\t\tstyle={ containerStyle }\n\t\t>\n\t\t\t<Icon fill={ iconStyle.fill } icon={ offlineIcon } />\n\t\t\t<Text style={ textStyle }>{ __( 'Working Offline' ) } </Text>\n\t\t</View>\n\t) : null;\n};\n\nexport default OfflineStatus;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAiB,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;;AAE5D;AACA;AACA;AACA,SACCC,4BAA4B,EAC5BC,sBAAsB,EACtBC,WAAW,QACL,oBAAoB;AAC3B,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,SAASC,OAAO,IAAIC,WAAW,QAAQ,kBAAkB;AACzD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA,OAAOC,MAAM,MAAM,qBAAqB;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAXA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAYA,SAASC,0BAA0BA,CAAEC,OAAO,EAAE;EAAEC,QAAQ;EAAEC;AAAgB,CAAC,EAAG;EAC7E,MAAM;IAAEC;EAAyB,CAAC,GAAGpB,iBAAiB;EACtD,MAAMqB,YAAY,GAAGhB,WAAW,CAAEa,QAAS,CAAC;EAE5CR,SAAS,CAAE,MAAM;IAChB,MAAMY,oBAAoB,GAAG,OAAOJ,QAAQ,KAAK,WAAW;IAC5D,MAAMK,aAAa,GAAG,OAAOF,YAAY,KAAK,WAAW;IAEzD,IACCC,oBAAoB,IAClBJ,QAAQ,IAAI,CAAEG,YAAY,IAAI,CAAEE,aAAe,EAChD;MACDH,wBAAwB,CAAEH,OAAQ,CAAC;IACpC,CAAC,MAAM,IAAK,CAAEC,QAAQ,IAAIG,YAAY,IAAIF,eAAe,EAAG;MAC3DC,wBAAwB,CAAED,eAAgB,CAAC;IAC5C;EACD,CAAC,EAAE,CACFF,OAAO,EACPC,QAAQ,EACRG,YAAY,EACZF,eAAe,EACfC,wBAAwB,CACvB,CAAC;AACJ;AAEA,MAAMI,aAAa,GAAGA,CAAA,KAAM;EAC3B,MAAM;IAAEC;EAAY,CAAC,GAAGrB,sBAAsB,CAAC,CAAC;EAEhDY,0BAA0B,CAAEP,EAAE,CAAE,mCAAoC,CAAC,EAAE;IACtES,QAAQ,EAAEO,WAAW;IACrBN,eAAe,EAAEV,EAAE,CAAE,0CAA2C;EACjE,CAAE,CAAC;EAEH,MAAMiB,cAAc,GAAGvB,4BAA4B,CAClDQ,MAAM,CAACJ,OAAO,EACdI,MAAM,CAACgB,aACR,CAAC;EAED,MAAMC,SAAS,GAAGzB,4BAA4B,CAC7CQ,MAAM,CAAE,eAAe,CAAE,EACzBA,MAAM,CAAE,qBAAqB,CAC9B,CAAC;EAED,MAAMkB,SAAS,GAAG1B,4BAA4B,CAC7CQ,MAAM,CAAE,eAAe,CAAE,EACzBA,MAAM,CAAE,qBAAqB,CAC9B,CAAC;EAED,OAAO,CAAEc,WAAW,gBACnBV,KAAA,CAACb,IAAI;IACJ4B,UAAU;IACVC,iBAAiB,EAAC,OAAO;IACzBC,kBAAkB,EAAGvB,EAAE,CACtB,0CACD,CAAG;IACHwB,KAAK,EAAGP,cAAgB;IAAAQ,QAAA,gBAExBrB,IAAA,CAACP,IAAI;MAAC6B,IAAI,EAAGN,SAAS,CAACM,IAAM;MAACC,IAAI,EAAG5B;IAAa,CAAE,CAAC,eACrDO,KAAA,CAACd,IAAI;MAACgC,KAAK,EAAGL,SAAW;MAAAM,QAAA,GAAGzB,EAAE,CAAE,iBAAkB,CAAC,EAAE,GAAC;IAAA,CAAM,CAAC;EAAA,CACxD,CAAC,GACJ,IAAI;AACT,CAAC;AAED,eAAee,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["AccessibilityInfo","Text","View","usePreferredColorSchemeStyle","useNetworkConnectivity","usePrevious","Icon","offline","offlineIcon","__","useEffect","styles","jsx","_jsx","jsxs","_jsxs","useAccessibilityLiveRegion","message","isActive","inactiveMessage","announceForAccessibility","prevIsActive","unconditionalMessage","initialRender","OfflineStatus","isConnected","containerStyle","offline__dark","textStyle","iconStyle","accessible","accessibilityRole","accessibilityLabel","style","children","fill","icon"],"sources":["@wordpress/editor/src/components/offline-status/index.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { AccessibilityInfo, Text, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tusePreferredColorSchemeStyle,\n\tuseNetworkConnectivity,\n\tusePrevious,\n} from '@wordpress/compose';\nimport { Icon } from '@wordpress/components';\nimport { offline as offlineIcon } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.native.scss';\n\n/**\n * Conditionally announces messages for screen reader users. This Hook provides\n * two benefits over React Native's `accessibilityLiveRegion`:\n *\n * 1. It works on both iOS and Android.\n * 2. It allows announcing a secondary message when the component is inactive.\n *\n * @param {string} message The message to announce.\n * @param {Object} options Options for the Hook.\n * @param {boolean} [options.isActive] Whether the message should be announced.\n * @param {string} [options.inactiveMessage] The message to announce when inactive.\n */\nfunction useAccessibilityLiveRegion( message, { isActive, inactiveMessage } ) {\n\tconst { announceForAccessibility } = AccessibilityInfo;\n\tconst prevIsActive = usePrevious( isActive );\n\n\tuseEffect( () => {\n\t\tconst unconditionalMessage = typeof isActive === 'undefined';\n\t\tconst initialRender = typeof prevIsActive === 'undefined';\n\n\t\tif (\n\t\t\tunconditionalMessage ||\n\t\t\t( isActive && ! prevIsActive && ! initialRender )\n\t\t) {\n\t\t\tannounceForAccessibility( message );\n\t\t} else if ( ! isActive && prevIsActive && inactiveMessage ) {\n\t\t\tannounceForAccessibility( inactiveMessage );\n\t\t}\n\t}, [\n\t\tmessage,\n\t\tisActive,\n\t\tprevIsActive,\n\t\tinactiveMessage,\n\t\tannounceForAccessibility,\n\t] );\n}\n\nconst OfflineStatus = () => {\n\tconst { isConnected } = useNetworkConnectivity();\n\n\tuseAccessibilityLiveRegion( __( 'Network connection re-established' ), {\n\t\tisActive: isConnected,\n\t\tinactiveMessage: __( 'Network connection lost, working offline' ),\n\t} );\n\n\tconst containerStyle = usePreferredColorSchemeStyle(\n\t\tstyles.offline,\n\t\tstyles.offline__dark\n\t);\n\n\tconst textStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'offline--text' ],\n\t\tstyles[ 'offline--text__dark' ]\n\t);\n\n\tconst iconStyle = usePreferredColorSchemeStyle(\n\t\tstyles[ 'offline--icon' ],\n\t\tstyles[ 'offline--icon__dark' ]\n\t);\n\n\treturn ! isConnected ? (\n\t\t<View\n\t\t\taccessible\n\t\t\taccessibilityRole=\"alert\"\n\t\t\taccessibilityLabel={ __(\n\t\t\t\t'Network connection lost, working offline'\n\t\t\t) }\n\t\t\tstyle={ containerStyle }\n\t\t>\n\t\t\t<Icon fill={ iconStyle.fill } icon={ offlineIcon } />\n\t\t\t<Text style={ textStyle }>{ __( 'Working Offline' ) } </Text>\n\t\t</View>\n\t) : null;\n};\n\nexport default OfflineStatus;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,iBAAiB,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;;AAE5D;AACA;AACA;AACA,SACCC,4BAA4B,EAC5BC,sBAAsB,EACtBC,WAAW,QACL,oBAAoB;AAC3B,SAASC,IAAI,QAAQ,uBAAuB;AAC5C,SAASC,OAAO,IAAIC,WAAW,QAAQ,kBAAkB;AACzD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA,OAAOC,MAAM,MAAM,qBAAqB;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAXA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAYA,SAASC,0BAA0BA,CAAEC,OAAO,EAAE;EAAEC,QAAQ;EAAEC;AAAgB,CAAC,EAAG;EAC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GvB,EAAE,CACtB,0CACD,CAAG;IACHwB,KAAK,EAAGP,cAAgB;IAAAQ,QAAA,gBAExBrB,IAAA,CAACP,IAAI;MAAC6B,IAAI,EAAGN,SAAS,CAACM,IAAM;MAACC,IAAI,EAAG5B;IAAa,CAAE,CAAC,eACrDO,KAAA,CAACd,IAAI;MAACgC,KAAK,EAAGL,SAAW;MAAAM,QAAA,GAAGzB,EAAE,CAAE,iBAAkB,CAAC,EAAE,GAAC;IAAA,CAAM,CAAC;EAAA,CACxD,CAAC,GACJ,IAAI;AACT,CAAC;AAED,eAAee,aAAa","ignoreList":[]}
@@ -22,8 +22,7 @@ import { filterURLForDisplay } from '@wordpress/url';
22
22
  import PostPanelRow from '../post-panel-row';
23
23
  import { buildTermsTree } from '../../utils/terms';
24
24
  import { store as editorStore } from '../../store';
25
- import { jsx as _jsx } from "react/jsx-runtime";
26
- import { jsxs as _jsxs } from "react/jsx-runtime";
25
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
27
26
  function getTitle(post) {
28
27
  return post?.title?.rendered ? decodeEntities(post.title.rendered) : `#${post.id} (${__('no title')})`;
29
28
  }
@@ -237,7 +236,7 @@ export function ParentRow() {
237
236
  title: __('Parent'),
238
237
  onClose: onClose
239
238
  }), /*#__PURE__*/_jsxs("div", {
240
- children: [createInterpolateElement(sprintf( /* translators: %1$s The home URL of the WordPress installation without the scheme. */
239
+ children: [createInterpolateElement(sprintf(/* translators: %1$s The home URL of the WordPress installation without the scheme. */
241
240
  __('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %1$s<wbr />/services<wbr />/pricing.'), filterURLForDisplay(homeUrl).replace(/([/.])/g, '<wbr />$1')), {
242
241
  wbr: /*#__PURE__*/_jsx("wbr", {})
243
242
  }), /*#__PURE__*/_jsx("p", {
@@ -1 +1 @@
1
- {"version":3,"names":["removeAccents","__","sprintf","Button","Dropdown","ComboboxControl","ExternalLink","debounce","createInterpolateElement","useState","useMemo","useSelect","useDispatch","decodeEntities","store","coreStore","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","filterURLForDisplay","PostPanelRow","buildTermsTree","editorStore","jsx","_jsx","jsxs","_jsxs","getTitle","post","title","rendered","id","getItemPriority","name","searchValue","normalizedName","toLowerCase","normalizedSearch","startsWith","length","Infinity","PageAttributesParent","editPost","fieldValue","setFieldValue","isHierarchical","parentPostId","parentPostTitle","pageItems","select","_pType$hierarchical","getPostType","getEntityRecords","getEntityRecord","getCurrentPostId","getEditedPostAttribute","postTypeSlug","pageId","pType","postId","postIsHierarchical","hierarchical","query","per_page","exclude","parent_exclude","orderby","order","_fields","search","parentPost","parentOptions","getOptionsFromTree","tree","level","mappedNodes","map","treeNode","value","label","repeat","rawName","children","sortedNodes","sort","a","b","priorityA","priorityB","flat","item","parent","opts","optsHasParent","find","unshift","handleKeydown","inputValue","handleChange","selectedPostId","__nextHasNoMarginBottom","__next40pxDefaultSize","className","help","options","onFilterValueChange","onChange","hideLabelFromVision","PostParentToggle","isOpen","onClick","parentTitle","size","variant","ParentRow","homeUrl","home","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","offset","shift","ref","contentClassName","focusOnMount","renderToggle","onToggle","renderContent","onClose","replace","wbr","href"],"sources":["@wordpress/editor/src/components/page-attributes/parent.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tDropdown,\n\tComboboxControl,\n\tExternalLink,\n} from '@wordpress/components';\nimport { debounce } from '@wordpress/compose';\nimport {\n\tcreateInterpolateElement,\n\tuseState,\n\tuseMemo,\n} from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { filterURLForDisplay } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport PostPanelRow from '../post-panel-row';\nimport { buildTermsTree } from '../../utils/terms';\nimport { store as editorStore } from '../../store';\n\nfunction getTitle( post ) {\n\treturn post?.title?.rendered\n\t\t? decodeEntities( post.title.rendered )\n\t\t: `#${ post.id } (${ __( 'no title' ) })`;\n}\n\nexport const getItemPriority = ( name, searchValue ) => {\n\tconst normalizedName = removeAccents( name || '' ).toLowerCase();\n\tconst normalizedSearch = removeAccents( searchValue || '' ).toLowerCase();\n\tif ( normalizedName === normalizedSearch ) {\n\t\treturn 0;\n\t}\n\n\tif ( normalizedName.startsWith( normalizedSearch ) ) {\n\t\treturn normalizedName.length;\n\t}\n\n\treturn Infinity;\n};\n\n/**\n * Renders the Page Attributes Parent component. A dropdown menu in an editor interface\n * for selecting the parent page of a given page.\n *\n * @return {Component|null} The component to be rendered. Return null if post type is not hierarchical.\n */\nexport function PageAttributesParent() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ fieldValue, setFieldValue ] = useState( false );\n\tconst { isHierarchical, parentPostId, parentPostTitle, pageItems } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getPostType, getEntityRecords, getEntityRecord } =\n\t\t\t\t\tselect( coreStore );\n\t\t\t\tconst { getCurrentPostId, getEditedPostAttribute } =\n\t\t\t\t\tselect( editorStore );\n\t\t\t\tconst postTypeSlug = getEditedPostAttribute( 'type' );\n\t\t\t\tconst pageId = getEditedPostAttribute( 'parent' );\n\t\t\t\tconst pType = getPostType( postTypeSlug );\n\t\t\t\tconst postId = getCurrentPostId();\n\t\t\t\tconst postIsHierarchical = pType?.hierarchical ?? false;\n\t\t\t\tconst query = {\n\t\t\t\t\tper_page: 100,\n\t\t\t\t\texclude: postId,\n\t\t\t\t\tparent_exclude: postId,\n\t\t\t\t\torderby: 'menu_order',\n\t\t\t\t\torder: 'asc',\n\t\t\t\t\t_fields: 'id,title,parent',\n\t\t\t\t};\n\n\t\t\t\t// Perform a search when the field is changed.\n\t\t\t\tif ( !! fieldValue ) {\n\t\t\t\t\tquery.search = fieldValue;\n\t\t\t\t}\n\n\t\t\t\tconst parentPost = pageId\n\t\t\t\t\t? getEntityRecord( 'postType', postTypeSlug, pageId )\n\t\t\t\t\t: null;\n\n\t\t\t\treturn {\n\t\t\t\t\tisHierarchical: postIsHierarchical,\n\t\t\t\t\tparentPostId: pageId,\n\t\t\t\t\tparentPostTitle: parentPost ? getTitle( parentPost ) : '',\n\t\t\t\t\tpageItems: postIsHierarchical\n\t\t\t\t\t\t? getEntityRecords( 'postType', postTypeSlug, query )\n\t\t\t\t\t\t: null,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ fieldValue ]\n\t\t);\n\n\tconst parentOptions = useMemo( () => {\n\t\tconst getOptionsFromTree = ( tree, level = 0 ) => {\n\t\t\tconst mappedNodes = tree.map( ( treeNode ) => [\n\t\t\t\t{\n\t\t\t\t\tvalue: treeNode.id,\n\t\t\t\t\tlabel:\n\t\t\t\t\t\t'— '.repeat( level ) + decodeEntities( treeNode.name ),\n\t\t\t\t\trawName: treeNode.name,\n\t\t\t\t},\n\t\t\t\t...getOptionsFromTree( treeNode.children || [], level + 1 ),\n\t\t\t] );\n\n\t\t\tconst sortedNodes = mappedNodes.sort( ( [ a ], [ b ] ) => {\n\t\t\t\tconst priorityA = getItemPriority( a.rawName, fieldValue );\n\t\t\t\tconst priorityB = getItemPriority( b.rawName, fieldValue );\n\t\t\t\treturn priorityA >= priorityB ? 1 : -1;\n\t\t\t} );\n\n\t\t\treturn sortedNodes.flat();\n\t\t};\n\n\t\tif ( ! pageItems ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tlet tree = pageItems.map( ( item ) => ( {\n\t\t\tid: item.id,\n\t\t\tparent: item.parent,\n\t\t\tname: getTitle( item ),\n\t\t} ) );\n\n\t\t// Only build a hierarchical tree when not searching.\n\t\tif ( ! fieldValue ) {\n\t\t\ttree = buildTermsTree( tree );\n\t\t}\n\n\t\tconst opts = getOptionsFromTree( tree );\n\n\t\t// Ensure the current parent is in the options list.\n\t\tconst optsHasParent = opts.find(\n\t\t\t( item ) => item.value === parentPostId\n\t\t);\n\t\tif ( parentPostTitle && ! optsHasParent ) {\n\t\t\topts.unshift( {\n\t\t\t\tvalue: parentPostId,\n\t\t\t\tlabel: parentPostTitle,\n\t\t\t} );\n\t\t}\n\t\treturn opts;\n\t}, [ pageItems, fieldValue, parentPostTitle, parentPostId ] );\n\n\tif ( ! isHierarchical ) {\n\t\treturn null;\n\t}\n\t/**\n\t * Handle user input.\n\t *\n\t * @param {string} inputValue The current value of the input field.\n\t */\n\tconst handleKeydown = ( inputValue ) => {\n\t\tsetFieldValue( inputValue );\n\t};\n\n\t/**\n\t * Handle author selection.\n\t *\n\t * @param {Object} selectedPostId The selected Author.\n\t */\n\tconst handleChange = ( selectedPostId ) => {\n\t\teditPost( { parent: selectedPostId } );\n\t};\n\n\treturn (\n\t\t<ComboboxControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tclassName=\"editor-page-attributes__parent\"\n\t\t\tlabel={ __( 'Parent' ) }\n\t\t\thelp={ __( 'Choose a parent page.' ) }\n\t\t\tvalue={ parentPostId }\n\t\t\toptions={ parentOptions }\n\t\t\tonFilterValueChange={ debounce( handleKeydown, 300 ) }\n\t\t\tonChange={ handleChange }\n\t\t\thideLabelFromVision\n\t\t/>\n\t);\n}\n\nfunction PostParentToggle( { isOpen, onClick } ) {\n\tconst parentPost = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst parentPostId = getEditedPostAttribute( 'parent' );\n\t\tif ( ! parentPostId ) {\n\t\t\treturn null;\n\t\t}\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst postTypeSlug = getEditedPostAttribute( 'type' );\n\t\treturn getEntityRecord( 'postType', postTypeSlug, parentPostId );\n\t}, [] );\n\tconst parentTitle = useMemo(\n\t\t() => ( ! parentPost ? __( 'None' ) : getTitle( parentPost ) ),\n\t\t[ parentPost ]\n\t);\n\treturn (\n\t\t<Button\n\t\t\tsize=\"compact\"\n\t\t\tclassName=\"editor-post-parent__panel-toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post parent.\n\t\t\taria-label={ sprintf( __( 'Change parent: %s' ), parentTitle ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ parentTitle }\n\t\t</Button>\n\t);\n}\n\nexport function ParentRow() {\n\tconst homeUrl = useSelect( ( select ) => {\n\t\t// Site index.\n\t\treturn select( coreStore ).getEntityRecord( 'root', '__unstableBase' )\n\t\t\t?.home;\n\t}, [] );\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\treturn (\n\t\t<PostPanelRow label={ __( 'Parent' ) } ref={ setPopoverAnchor }>\n\t\t\t<Dropdown\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tclassName=\"editor-post-parent__panel-dropdown\"\n\t\t\t\tcontentClassName=\"editor-post-parent__panel-dialog\"\n\t\t\t\tfocusOnMount\n\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t<PostParentToggle isOpen={ isOpen } onClick={ onToggle } />\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<div className=\"editor-post-parent\">\n\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\ttitle={ __( 'Parent' ) }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %1$s The home URL of the WordPress installation without the scheme. */\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'Child pages inherit characteristics from their parent, such as URL structure. For instance, if \"Pricing\" is a child of \"Services\", its URL would be %1$s<wbr />/services<wbr />/pricing.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tfilterURLForDisplay( homeUrl ).replace(\n\t\t\t\t\t\t\t\t\t\t/([/.])/g,\n\t\t\t\t\t\t\t\t\t\t'<wbr />$1'\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\t{\n\t\t\t\t\t\t\t\t\twbr: <wbr />,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'They also show up as sub-items in the default navigation menu. <a>Learn more.</a>'\n\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\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes'\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/>\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) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<PageAttributesParent />\n\t\t\t\t\t</div>\n\t\t\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,OAAO,EAAGA;QAAS,CACnB,CAAC,eACFxG,KAAA;UAAAwD,QAAA,GACGzE,wBAAwB,CACzBN,OAAO,EACN;UACAD,EAAE,CACD,0LACD,CAAC,EACDiB,mBAAmB,CAAEgG,OAAQ,CAAC,CAACgB,OAAO,CACrC,SAAS,EACT,WACD,CACD,CAAC,EACD;YACCC,GAAG,eAAE5G,IAAA,UAAM;UACZ,CACD,CAAC,eACDA,IAAA;YAAA0D,QAAA,EACGzE,wBAAwB,CACzBP,EAAE,CACD,mFACD,CAAC,EACD;cACCmF,CAAC,eACA7D,IAAA,CAACjB,YAAY;gBACZ8H,IAAI,EAAGnI,EAAE,CACR,yFACD;cAAG,CACH;YAEH,CACD;UAAC,CACC,CAAC;QAAA,CACA,CAAC,eACNsB,IAAA,CAACiB,oBAAoB,IAAE,CAAC;MAAA,CACpB;IACH,CACH;EAAC,CACW,CAAC;AAEjB;AAEA,eAAeA,oBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["removeAccents","__","sprintf","Button","Dropdown","ComboboxControl","ExternalLink","debounce","createInterpolateElement","useState","useMemo","useSelect","useDispatch","decodeEntities","store","coreStore","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","filterURLForDisplay","PostPanelRow","buildTermsTree","editorStore","jsx","_jsx","jsxs","_jsxs","getTitle","post","title","rendered","id","getItemPriority","name","searchValue","normalizedName","toLowerCase","normalizedSearch","startsWith","length","Infinity","PageAttributesParent","editPost","fieldValue","setFieldValue","isHierarchical","parentPostId","parentPostTitle","pageItems","select","_pType$hierarchical","getPostType","getEntityRecords","getEntityRecord","getCurrentPostId","getEditedPostAttribute","postTypeSlug","pageId","pType","postId","postIsHierarchical","hierarchical","query","per_page","exclude","parent_exclude","orderby","order","_fields","search","parentPost","parentOptions","getOptionsFromTree","tree","level","mappedNodes","map","treeNode","value","label","repeat","rawName","children","sortedNodes","sort","a","b","priorityA","priorityB","flat","item","parent","opts","optsHasParent","find","unshift","handleKeydown","inputValue","handleChange","selectedPostId","__nextHasNoMarginBottom","__next40pxDefaultSize","className","help","options","onFilterValueChange","onChange","hideLabelFromVision","PostParentToggle","isOpen","onClick","parentTitle","size","variant","ParentRow","homeUrl","home","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","offset","shift","ref","contentClassName","focusOnMount","renderToggle","onToggle","renderContent","onClose","replace","wbr","href"],"sources":["@wordpress/editor/src/components/page-attributes/parent.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tDropdown,\n\tComboboxControl,\n\tExternalLink,\n} from '@wordpress/components';\nimport { debounce } from '@wordpress/compose';\nimport {\n\tcreateInterpolateElement,\n\tuseState,\n\tuseMemo,\n} from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { filterURLForDisplay } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport PostPanelRow from '../post-panel-row';\nimport { buildTermsTree } from '../../utils/terms';\nimport { store as editorStore } from '../../store';\n\nfunction getTitle( post ) {\n\treturn post?.title?.rendered\n\t\t? decodeEntities( post.title.rendered )\n\t\t: `#${ post.id } (${ __( 'no title' ) })`;\n}\n\nexport const getItemPriority = ( name, searchValue ) => {\n\tconst normalizedName = removeAccents( name || '' ).toLowerCase();\n\tconst normalizedSearch = removeAccents( searchValue || '' ).toLowerCase();\n\tif ( normalizedName === normalizedSearch ) {\n\t\treturn 0;\n\t}\n\n\tif ( normalizedName.startsWith( normalizedSearch ) ) {\n\t\treturn normalizedName.length;\n\t}\n\n\treturn Infinity;\n};\n\n/**\n * Renders the Page Attributes Parent component. A dropdown menu in an editor interface\n * for selecting the parent page of a given page.\n *\n * @return {Component|null} The component to be rendered. Return null if post type is not hierarchical.\n */\nexport function PageAttributesParent() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ fieldValue, setFieldValue ] = useState( false );\n\tconst { isHierarchical, parentPostId, parentPostTitle, pageItems } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getPostType, getEntityRecords, getEntityRecord } =\n\t\t\t\t\tselect( coreStore );\n\t\t\t\tconst { getCurrentPostId, getEditedPostAttribute } =\n\t\t\t\t\tselect( editorStore );\n\t\t\t\tconst postTypeSlug = getEditedPostAttribute( 'type' );\n\t\t\t\tconst pageId = getEditedPostAttribute( 'parent' );\n\t\t\t\tconst pType = getPostType( postTypeSlug );\n\t\t\t\tconst postId = getCurrentPostId();\n\t\t\t\tconst postIsHierarchical = pType?.hierarchical ?? false;\n\t\t\t\tconst query = {\n\t\t\t\t\tper_page: 100,\n\t\t\t\t\texclude: postId,\n\t\t\t\t\tparent_exclude: postId,\n\t\t\t\t\torderby: 'menu_order',\n\t\t\t\t\torder: 'asc',\n\t\t\t\t\t_fields: 'id,title,parent',\n\t\t\t\t};\n\n\t\t\t\t// Perform a search when the field is changed.\n\t\t\t\tif ( !! fieldValue ) {\n\t\t\t\t\tquery.search = fieldValue;\n\t\t\t\t}\n\n\t\t\t\tconst parentPost = pageId\n\t\t\t\t\t? getEntityRecord( 'postType', postTypeSlug, pageId )\n\t\t\t\t\t: null;\n\n\t\t\t\treturn {\n\t\t\t\t\tisHierarchical: postIsHierarchical,\n\t\t\t\t\tparentPostId: pageId,\n\t\t\t\t\tparentPostTitle: parentPost ? getTitle( parentPost ) : '',\n\t\t\t\t\tpageItems: postIsHierarchical\n\t\t\t\t\t\t? getEntityRecords( 'postType', postTypeSlug, query )\n\t\t\t\t\t\t: null,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ fieldValue ]\n\t\t);\n\n\tconst parentOptions = useMemo( () => {\n\t\tconst getOptionsFromTree = ( tree, level = 0 ) => {\n\t\t\tconst mappedNodes = tree.map( ( treeNode ) => [\n\t\t\t\t{\n\t\t\t\t\tvalue: treeNode.id,\n\t\t\t\t\tlabel:\n\t\t\t\t\t\t'— '.repeat( level ) + decodeEntities( treeNode.name ),\n\t\t\t\t\trawName: treeNode.name,\n\t\t\t\t},\n\t\t\t\t...getOptionsFromTree( treeNode.children || [], level + 1 ),\n\t\t\t] );\n\n\t\t\tconst sortedNodes = mappedNodes.sort( ( [ a ], [ b ] ) => {\n\t\t\t\tconst priorityA = getItemPriority( a.rawName, fieldValue );\n\t\t\t\tconst priorityB = getItemPriority( b.rawName, fieldValue );\n\t\t\t\treturn priorityA >= priorityB ? 1 : -1;\n\t\t\t} );\n\n\t\t\treturn sortedNodes.flat();\n\t\t};\n\n\t\tif ( ! pageItems ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tlet tree = pageItems.map( ( item ) => ( {\n\t\t\tid: item.id,\n\t\t\tparent: item.parent,\n\t\t\tname: getTitle( item ),\n\t\t} ) );\n\n\t\t// Only build a hierarchical tree when not searching.\n\t\tif ( ! fieldValue ) {\n\t\t\ttree = buildTermsTree( tree );\n\t\t}\n\n\t\tconst opts = getOptionsFromTree( tree );\n\n\t\t// Ensure the current parent is in the options list.\n\t\tconst optsHasParent = opts.find(\n\t\t\t( item ) => item.value === parentPostId\n\t\t);\n\t\tif ( parentPostTitle && ! optsHasParent ) {\n\t\t\topts.unshift( {\n\t\t\t\tvalue: parentPostId,\n\t\t\t\tlabel: parentPostTitle,\n\t\t\t} );\n\t\t}\n\t\treturn opts;\n\t}, [ pageItems, fieldValue, parentPostTitle, parentPostId ] );\n\n\tif ( ! isHierarchical ) {\n\t\treturn null;\n\t}\n\t/**\n\t * Handle user input.\n\t *\n\t * @param {string} inputValue The current value of the input field.\n\t */\n\tconst handleKeydown = ( inputValue ) => {\n\t\tsetFieldValue( inputValue );\n\t};\n\n\t/**\n\t * Handle author selection.\n\t *\n\t * @param {Object} selectedPostId The selected Author.\n\t */\n\tconst handleChange = ( selectedPostId ) => {\n\t\teditPost( { parent: selectedPostId } );\n\t};\n\n\treturn (\n\t\t<ComboboxControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\t__next40pxDefaultSize\n\t\t\tclassName=\"editor-page-attributes__parent\"\n\t\t\tlabel={ __( 'Parent' ) }\n\t\t\thelp={ __( 'Choose a parent page.' ) }\n\t\t\tvalue={ parentPostId }\n\t\t\toptions={ parentOptions }\n\t\t\tonFilterValueChange={ debounce( handleKeydown, 300 ) }\n\t\t\tonChange={ handleChange }\n\t\t\thideLabelFromVision\n\t\t/>\n\t);\n}\n\nfunction PostParentToggle( { isOpen, onClick } ) {\n\tconst parentPost = useSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst parentPostId = getEditedPostAttribute( 'parent' );\n\t\tif ( ! parentPostId ) {\n\t\t\treturn null;\n\t\t}\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst postTypeSlug = getEditedPostAttribute( 'type' );\n\t\treturn getEntityRecord( 'postType', postTypeSlug, parentPostId );\n\t}, [] );\n\tconst parentTitle = useMemo(\n\t\t() => ( ! parentPost ? __( 'None' ) : getTitle( parentPost ) ),\n\t\t[ parentPost ]\n\t);\n\treturn (\n\t\t<Button\n\t\t\tsize=\"compact\"\n\t\t\tclassName=\"editor-post-parent__panel-toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post parent.\n\t\t\taria-label={ sprintf( __( 'Change parent: %s' ), parentTitle ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ parentTitle }\n\t\t</Button>\n\t);\n}\n\nexport function ParentRow() {\n\tconst homeUrl = useSelect( ( select ) => {\n\t\t// Site index.\n\t\treturn select( coreStore ).getEntityRecord( 'root', '__unstableBase' )\n\t\t\t?.home;\n\t}, [] );\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\treturn (\n\t\t<PostPanelRow label={ __( 'Parent' ) } ref={ setPopoverAnchor }>\n\t\t\t<Dropdown\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tclassName=\"editor-post-parent__panel-dropdown\"\n\t\t\t\tcontentClassName=\"editor-post-parent__panel-dialog\"\n\t\t\t\tfocusOnMount\n\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t<PostParentToggle isOpen={ isOpen } onClick={ onToggle } />\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<div className=\"editor-post-parent\">\n\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\ttitle={ __( 'Parent' ) }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %1$s The home URL of the WordPress installation without the scheme. */\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'Child pages inherit characteristics from their parent, such as URL structure. For instance, if \"Pricing\" is a child of \"Services\", its URL would be %1$s<wbr />/services<wbr />/pricing.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tfilterURLForDisplay( homeUrl ).replace(\n\t\t\t\t\t\t\t\t\t\t/([/.])/g,\n\t\t\t\t\t\t\t\t\t\t'<wbr />$1'\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\t{\n\t\t\t\t\t\t\t\t\twbr: <wbr />,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'They also show up as sub-items in the default navigation menu. <a>Learn more.</a>'\n\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\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes'\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/>\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) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<PageAttributesParent />\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PostPanelRow>\n\t);\n}\n\nexport default PageAttributesParent;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,aAAa,MAAM,gBAAgB;;AAE1C;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,MAAM,EACNC,QAAQ,EACRC,eAAe,EACfC,YAAY,QACN,uBAAuB;AAC9B,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SACCC,wBAAwB,EACxBC,QAAQ,EACRC,OAAO,QACD,oBAAoB;AAC3B,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,oCAAoC,IAAIC,sBAAsB,QAAQ,yBAAyB;AACxG,SAASC,mBAAmB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EA,eAAeA,oBAAoB","ignoreList":[]}
@@ -11,9 +11,7 @@ import warning from '@wordpress/warning';
11
11
  */
12
12
  import EnablePluginDocumentSettingPanelOption from '../preferences-modal/enable-plugin-document-setting-panel';
13
13
  import { store as editorStore } from '../../store';
14
- import { jsx as _jsx } from "react/jsx-runtime";
15
- import { Fragment as _Fragment } from "react/jsx-runtime";
16
- import { jsxs as _jsxs } from "react/jsx-runtime";
14
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
17
15
  const {
18
16
  Fill,
19
17
  Slot
@@ -1 +1 @@
1
- {"version":3,"names":["createSlotFill","PanelBody","usePluginContext","useDispatch","useSelect","warning","EnablePluginDocumentSettingPanelOption","store","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Fill","Slot","PluginDocumentSettingPanel","name","className","title","icon","children","pluginName","panelName","opened","isEnabled","select","isEditorPanelOpened","isEditorPanelEnabled","toggleEditorPanelOpened","undefined","globalThis","SCRIPT_DEBUG","label","onToggle"],"sources":["@wordpress/editor/src/components/plugin-document-setting-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { usePluginContext } from '@wordpress/plugins';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport EnablePluginDocumentSettingPanelOption from '../preferences-modal/enable-plugin-document-setting-panel';\nimport { store as editorStore } from '../../store';\n\nconst { Fill, Slot } = createSlotFill( 'PluginDocumentSettingPanel' );\n\n/**\n * Renders items below the Status & Availability panel in the Document Sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} props.name Required. A machine-friendly name for the panel.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {string} [props.title] The title of the panel\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n * @param {Element} props.children Children to be rendered\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var el = React.createElement;\n * var __ = wp.i18n.__;\n * var registerPlugin = wp.plugins.registerPlugin;\n * var PluginDocumentSettingPanel = wp.editor.PluginDocumentSettingPanel;\n *\n * function MyDocumentSettingPlugin() {\n * \treturn el(\n * \t\tPluginDocumentSettingPanel,\n * \t\t{\n * \t\t\tclassName: 'my-document-setting-plugin',\n * \t\t\ttitle: 'My Panel',\n * \t\t\tname: 'my-panel',\n * \t\t},\n * \t\t__( 'My Document Setting Panel' )\n * \t);\n * }\n *\n * registerPlugin( 'my-document-setting-plugin', {\n * \t\trender: MyDocumentSettingPlugin\n * } );\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { registerPlugin } from '@wordpress/plugins';\n * import { PluginDocumentSettingPanel } from '@wordpress/editor';\n *\n * const MyDocumentSettingTest = () => (\n * \t\t<PluginDocumentSettingPanel className=\"my-document-setting-plugin\" title=\"My Panel\" name=\"my-panel\">\n *\t\t\t<p>My Document Setting Panel</p>\n *\t\t</PluginDocumentSettingPanel>\n *\t);\n *\n * registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nconst PluginDocumentSettingPanel = ( {\n\tname,\n\tclassName,\n\ttitle,\n\ticon,\n\tchildren,\n} ) => {\n\tconst { name: pluginName } = usePluginContext();\n\tconst panelName = `${ pluginName }/${ name }`;\n\tconst { opened, isEnabled } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isEditorPanelOpened, isEditorPanelEnabled } =\n\t\t\t\tselect( editorStore );\n\n\t\t\treturn {\n\t\t\t\topened: isEditorPanelOpened( panelName ),\n\t\t\t\tisEnabled: isEditorPanelEnabled( panelName ),\n\t\t\t};\n\t\t},\n\t\t[ panelName ]\n\t);\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( undefined === name ) {\n\t\twarning( 'PluginDocumentSettingPanel requires a name property.' );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<EnablePluginDocumentSettingPanelOption\n\t\t\t\tlabel={ title }\n\t\t\t\tpanelName={ panelName }\n\t\t\t/>\n\t\t\t<Fill>\n\t\t\t\t{ isEnabled && (\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\topened={ opened }\n\t\t\t\t\t\tonToggle={ () => toggleEditorPanelOpened( panelName ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\nPluginDocumentSettingPanel.Slot = Slot;\n\nexport default PluginDocumentSettingPanel;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,SAAS,QAAQ,uBAAuB;AACjE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;AACA,OAAOC,sCAAsC,MAAM,2DAA2D;AAC9G,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEnD,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGhB,cAAc,CAAE,4BAA6B,CAAC;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMi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AAeC,0BAA0B","ignoreList":[]}
1
+ {"version":3,"names":["createSlotFill","PanelBody","usePluginContext","useDispatch","useSelect","warning","EnablePluginDocumentSettingPanelOption","store","editorStore","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Fill","Slot","PluginDocumentSettingPanel","name","className","title","icon","children","pluginName","panelName","opened","isEnabled","select","isEditorPanelOpened","isEditorPanelEnabled","toggleEditorPanelOpened","undefined","globalThis","SCRIPT_DEBUG","label","onToggle"],"sources":["@wordpress/editor/src/components/plugin-document-setting-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createSlotFill, PanelBody } from '@wordpress/components';\nimport { usePluginContext } from '@wordpress/plugins';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport EnablePluginDocumentSettingPanelOption from '../preferences-modal/enable-plugin-document-setting-panel';\nimport { store as editorStore } from '../../store';\n\nconst { Fill, Slot } = createSlotFill( 'PluginDocumentSettingPanel' );\n\n/**\n * Renders items below the Status & Availability panel in the Document Sidebar.\n *\n * @param {Object} props Component properties.\n * @param {string} props.name Required. A machine-friendly name for the panel.\n * @param {string} [props.className] An optional class name added to the row.\n * @param {string} [props.title] The title of the panel\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n * @param {Element} props.children Children to be rendered\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var el = React.createElement;\n * var __ = wp.i18n.__;\n * var registerPlugin = wp.plugins.registerPlugin;\n * var PluginDocumentSettingPanel = wp.editor.PluginDocumentSettingPanel;\n *\n * function MyDocumentSettingPlugin() {\n * \treturn el(\n * \t\tPluginDocumentSettingPanel,\n * \t\t{\n * \t\t\tclassName: 'my-document-setting-plugin',\n * \t\t\ttitle: 'My Panel',\n * \t\t\tname: 'my-panel',\n * \t\t},\n * \t\t__( 'My Document Setting Panel' )\n * \t);\n * }\n *\n * registerPlugin( 'my-document-setting-plugin', {\n * \t\trender: MyDocumentSettingPlugin\n * } );\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { registerPlugin } from '@wordpress/plugins';\n * import { PluginDocumentSettingPanel } from '@wordpress/editor';\n *\n * const MyDocumentSettingTest = () => (\n * \t\t<PluginDocumentSettingPanel className=\"my-document-setting-plugin\" title=\"My Panel\" name=\"my-panel\">\n *\t\t\t<p>My Document Setting Panel</p>\n *\t\t</PluginDocumentSettingPanel>\n *\t);\n *\n * registerPlugin( 'document-setting-test', { render: MyDocumentSettingTest } );\n * ```\n *\n * @return {Component} The component to be rendered.\n */\nconst PluginDocumentSettingPanel = ( {\n\tname,\n\tclassName,\n\ttitle,\n\ticon,\n\tchildren,\n} ) => {\n\tconst { name: pluginName } = usePluginContext();\n\tconst panelName = `${ pluginName }/${ name }`;\n\tconst { opened, isEnabled } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isEditorPanelOpened, isEditorPanelEnabled } =\n\t\t\t\tselect( editorStore );\n\n\t\t\treturn {\n\t\t\t\topened: isEditorPanelOpened( panelName ),\n\t\t\t\tisEnabled: isEditorPanelEnabled( panelName ),\n\t\t\t};\n\t\t},\n\t\t[ panelName ]\n\t);\n\tconst { toggleEditorPanelOpened } = useDispatch( editorStore );\n\n\tif ( undefined === name ) {\n\t\twarning( 'PluginDocumentSettingPanel requires a name property.' );\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<EnablePluginDocumentSettingPanelOption\n\t\t\t\tlabel={ title }\n\t\t\t\tpanelName={ panelName }\n\t\t\t/>\n\t\t\t<Fill>\n\t\t\t\t{ isEnabled && (\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\topened={ opened }\n\t\t\t\t\t\tonToggle={ () => toggleEditorPanelOpened( panelName ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</PanelBody>\n\t\t\t\t) }\n\t\t\t</Fill>\n\t\t</>\n\t);\n};\n\nPluginDocumentSettingPanel.Slot = Slot;\n\nexport default PluginDocumentSettingPanel;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,cAAc,EAAEC,SAAS,QAAQ,uBAAuB;AACjE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,OAAOC,OAAO,MAAM,oBAAoB;;AAExC;AACA;AACA;AACA,OAAOC,sCAAsC,MAAM,2DAA2D;AAC9G,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAEnD,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGhB,cAAc,CAAE,4BAA6B,CAAC;;AAErE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMiB,0BAA0B,GAAGA,CAAE;EACpCC,IAAI;EACJC,SAAS;EACTC,KAAK;EACLC,IAAI;EACJC;AACD,CAAC,KAAM;EACN,MAAM;IAAEJ,IAAI,EAAEK;EAAW,CAAC,GAAGrB,gBAAgB,CAAC,CAAC;EAC/C,MAAMsB,SAAS,GAAG,GAAID,UAAU,IAAML,IAAI,EAAG;EAC7C,MAAM;IAAEO,MAAM;IAAEC;EAAU,CAAC,GAAGtB,SAAS,CACpCuB,MAAM,IAAM;IACb,MAAM;MAAEC,mBAAmB;MAAEC;IAAqB,CAAC,GAClDF,MAAM,CAAEnB,WAAY,CAAC;IAEtB,OAAO;MACNiB,MAAM,EAAEG,mBAAmB,CAAEJ,SAAU,CAAC;MACxCE,SAAS,EAAEG,oBAAoB,CAAEL,SAAU;IAC5C,CAAC;EACF,CAAC,EACD,CAAEA,SAAS,CACZ,CAAC;EACD,MAAM;IAAEM;EAAwB,CAAC,GAAG3B,WAAW,CAAEK,WAAY,CAAC;EAE9D,IAAKuB,SAAS,KAAKb,IAAI,EAAG;IACzBc,UAAA,CAAAC,YAAA,YAAA5B,OAAO,CAAE,sDAAuD,CAAC;EAClE;EAEA,oBACCS,KAAA,CAAAF,SAAA;IAAAU,QAAA,gBACCZ,IAAA,CAACJ,sCAAsC;MACtC4B,KAAK,EAAGd,KAAO;MACfI,SAAS,EAAGA;IAAW,CACvB,CAAC,eACFd,IAAA,CAACK,IAAI;MAAAO,QAAA,EACFI,SAAS,iBACVhB,IAAA,CAACT,SAAS;QACTkB,SAAS,EAAGA,SAAW;QACvBC,KAAK,EAAGA,KAAO;QACfC,IAAI,EAAGA,IAAM;QACbI,MAAM,EAAGA,MAAQ;QACjBU,QAAQ,EAAGA,CAAA,KAAML,uBAAuB,CAAEN,SAAU,CAAG;QAAAF,QAAA,EAErDA;MAAQ,CACA;IACX,CACI,CAAC;EAAA,CACN,CAAC;AAEL,CAAC;AAEDL,0BAA0B,CAACD,IAAI,GAAGA,IAAI;AAEtC,eAAeC,0BAA0B","ignoreList":[]}
@@ -13,9 +13,7 @@ import { store as coreStore } from '@wordpress/core-data';
13
13
  */
14
14
  import { unlock } from '../../lock-unlock';
15
15
  import { usePostActions } from './actions';
16
- import { jsx as _jsx } from "react/jsx-runtime";
17
- import { Fragment as _Fragment } from "react/jsx-runtime";
18
- import { jsxs as _jsxs } from "react/jsx-runtime";
16
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
19
17
  const {
20
18
  DropdownMenuV2,
21
19
  kebabCase
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useState","useMemo","__","privateApis","componentsPrivateApis","Button","Modal","moreVertical","store","coreStore","unlock","usePostActions","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DropdownMenuV2","kebabCase","PostActions","postType","postId","onActionPerformed","isActionsMenuOpen","setIsActionsMenuOpen","item","permissions","select","getEditedEntityRecord","getEntityRecordPermissions","itemWithPermissions","allActions","actions","filter","action","isEligible","open","trigger","size","icon","label","disabled","length","accessibleWhenDisabled","className","onClick","onOpenChange","placement","children","ActionsDropdownMenuGroup","onClose","DropdownMenuItemTrigger","items","Item","hideOnClick","RenderModal","ItemLabel","ActionWithModal","ActionTrigger","isModalOpen","setIsModalOpen","actionTriggerProps","hideModalHeader","title","modalHeader","__experimentalHideHeader","onRequestClose","overlayClassName","id","focusOnMount","closeModal","Group","map","callback"],"sources":["@wordpress/editor/src/components/post-actions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tprivateApis as componentsPrivateApis,\n\tButton,\n\tModal,\n} from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { usePostActions } from './actions';\n\nconst { DropdownMenuV2, kebabCase } = unlock( componentsPrivateApis );\n\nexport default function PostActions( { postType, postId, onActionPerformed } ) {\n\tconst [ isActionsMenuOpen, setIsActionsMenuOpen ] = useState( false );\n\tconst { item, permissions } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getEntityRecordPermissions } =\n\t\t\t\tunlock( select( coreStore ) );\n\t\t\treturn {\n\t\t\t\titem: getEditedEntityRecord( 'postType', postType, postId ),\n\t\t\t\tpermissions: getEntityRecordPermissions(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ postId, postType ]\n\t);\n\tconst itemWithPermissions = useMemo( () => {\n\t\treturn {\n\t\t\t...item,\n\t\t\tpermissions,\n\t\t};\n\t}, [ item, permissions ] );\n\tconst allActions = usePostActions( { postType, onActionPerformed } );\n\n\tconst actions = useMemo( () => {\n\t\treturn allActions.filter( ( action ) => {\n\t\t\treturn (\n\t\t\t\t! action.isEligible || action.isEligible( itemWithPermissions )\n\t\t\t);\n\t\t} );\n\t}, [ allActions, itemWithPermissions ] );\n\n\treturn (\n\t\t<DropdownMenuV2\n\t\t\topen={ isActionsMenuOpen }\n\t\t\ttrigger={\n\t\t\t\t<Button\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\t\tdisabled={ ! actions.length }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tclassName=\"editor-all-actions-button\"\n\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\tsetIsActionsMenuOpen( ! isActionsMenuOpen )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t}\n\t\t\tonOpenChange={ setIsActionsMenuOpen }\n\t\t\tplacement=\"bottom-end\"\n\t\t>\n\t\t\t<ActionsDropdownMenuGroup\n\t\t\t\tactions={ actions }\n\t\t\t\titem={ itemWithPermissions }\n\t\t\t\tonClose={ () => {\n\t\t\t\t\tsetIsActionsMenuOpen( false );\n\t\t\t\t} }\n\t\t\t/>\n\t\t</DropdownMenuV2>\n\t);\n}\n\n// From now on all the functions on this file are copied as from the dataviews packages,\n// The editor packages should not be using the dataviews packages directly,\n// and the dataviews package should not be using the editor packages directly,\n// so duplicating the code here seems like the least bad option.\n\n// Copied as is from packages/dataviews/src/item-actions.js\nfunction DropdownMenuItemTrigger( { action, onClick, items } ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<DropdownMenuV2.Item\n\t\t\tonClick={ onClick }\n\t\t\thideOnClick={ ! action.RenderModal }\n\t\t>\n\t\t\t<DropdownMenuV2.ItemLabel>{ label }</DropdownMenuV2.ItemLabel>\n\t\t</DropdownMenuV2.Item>\n\t);\n}\n\n// Copied as is from packages/dataviews/src/item-actions.js\n// With an added onClose prop.\nfunction ActionWithModal( { action, item, ActionTrigger, onClose } ) {\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst actionTriggerProps = {\n\t\taction,\n\t\tonClick: () => setIsModalOpen( true ),\n\t\titems: [ item ],\n\t};\n\tconst { RenderModal, hideModalHeader } = action;\n\treturn (\n\t\t<>\n\t\t\t<ActionTrigger { ...actionTriggerProps } />\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ action.modalHeader || action.label }\n\t\t\t\t\t__experimentalHideHeader={ !! hideModalHeader }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName={ `editor-action-modal editor-action-modal__${ kebabCase(\n\t\t\t\t\t\taction.id\n\t\t\t\t\t) }` }\n\t\t\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t>\n\t\t\t\t\t<RenderModal\n\t\t\t\t\t\titems={ [ item ] }\n\t\t\t\t\t\tcloseModal={ () => {\n\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n// Copied as is from packages/dataviews/src/item-actions.js\n// With an added onClose prop.\nfunction ActionsDropdownMenuGroup( { actions, item, onClose } ) {\n\treturn (\n\t\t<DropdownMenuV2.Group>\n\t\t\t{ actions.map( ( action ) => {\n\t\t\t\tif ( action.RenderModal ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<ActionWithModal\n\t\t\t\t\t\t\tkey={ action.id }\n\t\t\t\t\t\t\taction={ action }\n\t\t\t\t\t\t\titem={ item }\n\t\t\t\t\t\t\tActionTrigger={ DropdownMenuItemTrigger }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<DropdownMenuItemTrigger\n\t\t\t\t\t\tkey={ action.id }\n\t\t\t\t\t\taction={ action }\n\t\t\t\t\t\tonClick={ () => action.callback( [ item ] ) }\n\t\t\t\t\t\titems={ [ item ] }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</DropdownMenuV2.Group>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACtD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,WAAW,IAAIC,qBAAqB,EACpCC,MAAM,EACNC,KAAK,QACC,uBAAuB;AAC9B,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,cAAc,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAE3C,MAAM;EAAEC,cAAc;EAAEC;AAAU,CAAC,GAAGT,MAAM,CAAEN,qBAAsB,CAAC;AAErE,eAAe,SAASgB,WAAWA,CAAE;EAAEC,QAAQ;EAAEC,MAAM;EAAEC;AAAkB,CAAC,EAAG;EAC9E,MAAM,CAAEC,iBAAiB,EAAEC,oBAAoB,CAAE,GAAGzB,QAAQ,CAAE,KAAM,CAAC;EACrE,MAAM;IAAE0B,IAAI;IAAEC;EAAY,CAAC,GAAG5B,SAAS,CACpC6B,MAAM,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AC;AAEzB","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","useState","useMemo","__","privateApis","componentsPrivateApis","Button","Modal","moreVertical","store","coreStore","unlock","usePostActions","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DropdownMenuV2","kebabCase","PostActions","postType","postId","onActionPerformed","isActionsMenuOpen","setIsActionsMenuOpen","item","permissions","select","getEditedEntityRecord","getEntityRecordPermissions","itemWithPermissions","allActions","actions","filter","action","isEligible","open","trigger","size","icon","label","disabled","length","accessibleWhenDisabled","className","onClick","onOpenChange","placement","children","ActionsDropdownMenuGroup","onClose","DropdownMenuItemTrigger","items","Item","hideOnClick","RenderModal","ItemLabel","ActionWithModal","ActionTrigger","isModalOpen","setIsModalOpen","actionTriggerProps","hideModalHeader","title","modalHeader","__experimentalHideHeader","onRequestClose","overlayClassName","id","focusOnMount","closeModal","Group","map","callback"],"sources":["@wordpress/editor/src/components/post-actions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tprivateApis as componentsPrivateApis,\n\tButton,\n\tModal,\n} from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { usePostActions } from './actions';\n\nconst { DropdownMenuV2, kebabCase } = unlock( componentsPrivateApis );\n\nexport default function PostActions( { postType, postId, onActionPerformed } ) {\n\tconst [ isActionsMenuOpen, setIsActionsMenuOpen ] = useState( false );\n\tconst { item, permissions } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, getEntityRecordPermissions } =\n\t\t\t\tunlock( select( coreStore ) );\n\t\t\treturn {\n\t\t\t\titem: getEditedEntityRecord( 'postType', postType, postId ),\n\t\t\t\tpermissions: getEntityRecordPermissions(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ postId, postType ]\n\t);\n\tconst itemWithPermissions = useMemo( () => {\n\t\treturn {\n\t\t\t...item,\n\t\t\tpermissions,\n\t\t};\n\t}, [ item, permissions ] );\n\tconst allActions = usePostActions( { postType, onActionPerformed } );\n\n\tconst actions = useMemo( () => {\n\t\treturn allActions.filter( ( action ) => {\n\t\t\treturn (\n\t\t\t\t! action.isEligible || action.isEligible( itemWithPermissions )\n\t\t\t);\n\t\t} );\n\t}, [ allActions, itemWithPermissions ] );\n\n\treturn (\n\t\t<DropdownMenuV2\n\t\t\topen={ isActionsMenuOpen }\n\t\t\ttrigger={\n\t\t\t\t<Button\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\t\tdisabled={ ! actions.length }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tclassName=\"editor-all-actions-button\"\n\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\tsetIsActionsMenuOpen( ! isActionsMenuOpen )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t}\n\t\t\tonOpenChange={ setIsActionsMenuOpen }\n\t\t\tplacement=\"bottom-end\"\n\t\t>\n\t\t\t<ActionsDropdownMenuGroup\n\t\t\t\tactions={ actions }\n\t\t\t\titem={ itemWithPermissions }\n\t\t\t\tonClose={ () => {\n\t\t\t\t\tsetIsActionsMenuOpen( false );\n\t\t\t\t} }\n\t\t\t/>\n\t\t</DropdownMenuV2>\n\t);\n}\n\n// From now on all the functions on this file are copied as from the dataviews packages,\n// The editor packages should not be using the dataviews packages directly,\n// and the dataviews package should not be using the editor packages directly,\n// so duplicating the code here seems like the least bad option.\n\n// Copied as is from packages/dataviews/src/item-actions.js\nfunction DropdownMenuItemTrigger( { action, onClick, items } ) {\n\tconst label =\n\t\ttypeof action.label === 'string' ? action.label : action.label( items );\n\treturn (\n\t\t<DropdownMenuV2.Item\n\t\t\tonClick={ onClick }\n\t\t\thideOnClick={ ! action.RenderModal }\n\t\t>\n\t\t\t<DropdownMenuV2.ItemLabel>{ label }</DropdownMenuV2.ItemLabel>\n\t\t</DropdownMenuV2.Item>\n\t);\n}\n\n// Copied as is from packages/dataviews/src/item-actions.js\n// With an added onClose prop.\nfunction ActionWithModal( { action, item, ActionTrigger, onClose } ) {\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst actionTriggerProps = {\n\t\taction,\n\t\tonClick: () => setIsModalOpen( true ),\n\t\titems: [ item ],\n\t};\n\tconst { RenderModal, hideModalHeader } = action;\n\treturn (\n\t\t<>\n\t\t\t<ActionTrigger { ...actionTriggerProps } />\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ action.modalHeader || action.label }\n\t\t\t\t\t__experimentalHideHeader={ !! hideModalHeader }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName={ `editor-action-modal editor-action-modal__${ kebabCase(\n\t\t\t\t\t\taction.id\n\t\t\t\t\t) }` }\n\t\t\t\t\tfocusOnMount=\"firstContentElement\"\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t>\n\t\t\t\t\t<RenderModal\n\t\t\t\t\t\titems={ [ item ] }\n\t\t\t\t\t\tcloseModal={ () => {\n\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n// Copied as is from packages/dataviews/src/item-actions.js\n// With an added onClose prop.\nfunction ActionsDropdownMenuGroup( { actions, item, onClose } ) {\n\treturn (\n\t\t<DropdownMenuV2.Group>\n\t\t\t{ actions.map( ( action ) => {\n\t\t\t\tif ( action.RenderModal ) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<ActionWithModal\n\t\t\t\t\t\t\tkey={ action.id }\n\t\t\t\t\t\t\taction={ action }\n\t\t\t\t\t\t\titem={ item }\n\t\t\t\t\t\t\tActionTrigger={ DropdownMenuItemTrigger }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn (\n\t\t\t\t\t<DropdownMenuItemTrigger\n\t\t\t\t\t\tkey={ action.id }\n\t\t\t\t\t\taction={ action }\n\t\t\t\t\t\tonClick={ () => action.callback( [ item ] ) }\n\t\t\t\t\t\titems={ [ item ] }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</DropdownMenuV2.Group>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACtD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,WAAW,IAAIC,qBAAqB,EACpCC,MAAM,EACNC,KAAK,QACC,uBAAuB;AAC9B,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,cAAc,QAAQ,WAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAE3C,MAAM;EAAEC,cAAc;EAAEC;AAAU,CAAC,GAAGT,MAAM,CAAEN,qBAAsB,CAAC;AAErE,eAAe,SAASgB,WAAWA,CAAE;EAAEC,QAAQ;EAAEC,MAAM;EAAEC;AAAkB,CAAC,EAAG;EAC9E,MAAM,CAAEC,iBAAiB,EAAEC,oBAAoB,CAAE,GAAGzB,QAAQ,CAAE,KAAM,CAAC;EACrE,MAAM;IAAE0B,IAAI;IAAEC;EAAY,CAAC,GAAG5B,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CAAE;EAAC,CACkB,CAAC;AAEzB","ignoreList":[]}
@@ -14,8 +14,7 @@ import PostAuthorCheck from './check';
14
14
  import PostAuthorForm from './index';
15
15
  import PostPanelRow from '../post-panel-row';
16
16
  import { useAuthorsQuery } from './hook';
17
- import { jsx as _jsx } from "react/jsx-runtime";
18
- import { jsxs as _jsxs } from "react/jsx-runtime";
17
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
18
  function PostAuthorToggle({
20
19
  isOpen,
21
20
  onClick
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","Button","Dropdown","useState","useMemo","decodeEntities","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","PostAuthorCheck","PostAuthorForm","PostPanelRow","useAuthorsQuery","jsx","_jsx","jsxs","_jsxs","PostAuthorToggle","isOpen","onClick","postAuthor","authorName","name","size","className","variant","children","PostAuthor","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","offset","shift","label","ref","contentClassName","focusOnMount","renderToggle","onToggle","renderContent","onClose","title"],"sources":["@wordpress/editor/src/components/post-author/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button, Dropdown } from '@wordpress/components';\nimport { useState, useMemo } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport PostAuthorCheck from './check';\nimport PostAuthorForm from './index';\nimport PostPanelRow from '../post-panel-row';\nimport { useAuthorsQuery } from './hook';\n\nfunction PostAuthorToggle( { isOpen, onClick } ) {\n\tconst { postAuthor } = useAuthorsQuery();\n\tconst authorName =\n\t\tdecodeEntities( postAuthor?.name ) || __( '(No author)' );\n\treturn (\n\t\t<Button\n\t\t\tsize=\"compact\"\n\t\t\tclassName=\"editor-post-author__panel-toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post link.\n\t\t\taria-label={ sprintf( __( 'Change author: %s' ), authorName ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ authorName }\n\t\t</Button>\n\t);\n}\n\n/**\n * Renders the Post Author Panel component.\n *\n * @return {Component} The component to be rendered.\n */\nexport function PostAuthor() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\treturn (\n\t\t<PostAuthorCheck>\n\t\t\t<PostPanelRow label={ __( 'Author' ) } ref={ setPopoverAnchor }>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tcontentClassName=\"editor-post-author__panel-dialog\"\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<PostAuthorToggle\n\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<div className=\"editor-post-author\">\n\t\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\t\ttitle={ __( 'Author' ) }\n\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostAuthorForm onClose={ onClose } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostAuthorChe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AEH,aAAa;IACrBI,SAAS,EAAE,YAAY;IACvBC,MAAM,EAAE,EAAE;IACVC,KAAK,EAAE;EACR,CAAC,CAAE,EACH,CAAEN,aAAa,CAChB,CAAC;EACD,oBACCd,IAAA,CAACL,eAAe;IAAAiB,QAAA,eACfZ,IAAA,CAACH,YAAY;MAACwB,KAAK,EAAGnC,EAAE,CAAE,QAAS,CAAG;MAACoC,GAAG,EAAGP,gBAAkB;MAAAH,QAAA,eAC9DZ,IAAA,CAACX,QAAQ;QACR2B,YAAY,EAAGA,YAAc;QAC7BO,gBAAgB,EAAC,kCAAkC;QACnDC,YAAY;QACZC,YAAY,EAAGA,CAAE;UAAErB,MAAM;UAAEsB;QAAS,CAAC,kBACpC1B,IAAA,CAACG,gBAAgB;UAChBC,MAAM,EAAGA,MAAQ;UACjBC,OAAO,EAAGqB;QAAU,CACpB,CACC;QACHC,aAAa,EAAGA,CAAE;UAAEC;QAAQ,CAAC,kBAC5B1B,KAAA;UAAKQ,SAAS,EAAC,oBAAoB;UAAAE,QAAA,gBAClCZ,IAAA,CAACN,sBAAsB;YACtBmC,KAAK,EAAG3C,EAAE,CAAE,QAAS,CAAG;YACxB0C,OAAO,EAAGA;UAAS,CACnB,CAAC,eACF5B,IAAA,CAACJ,cAAc;YAACgC,OAAO,EAAGA;UAAS,CAAE,CAAC;QAAA,CAClC;MACH,CACH;IAAC,CACW;EAAC,CACC,CAAC;AAEpB;AAEA,eAAef,UAAU","ignoreList":[]}
1
+ {"version":3,"names":["__","sprintf","Button","Dropdown","useState","useMemo","decodeEntities","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","PostAuthorCheck","PostAuthorForm","PostPanelRow","useAuthorsQuery","jsx","_jsx","jsxs","_jsxs","PostAuthorToggle","isOpen","onClick","postAuthor","authorName","name","size","className","variant","children","PostAuthor","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","offset","shift","label","ref","contentClassName","focusOnMount","renderToggle","onToggle","renderContent","onClose","title"],"sources":["@wordpress/editor/src/components/post-author/panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button, Dropdown } from '@wordpress/components';\nimport { useState, useMemo } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport PostAuthorCheck from './check';\nimport PostAuthorForm from './index';\nimport PostPanelRow from '../post-panel-row';\nimport { useAuthorsQuery } from './hook';\n\nfunction PostAuthorToggle( { isOpen, onClick } ) {\n\tconst { postAuthor } = useAuthorsQuery();\n\tconst authorName =\n\t\tdecodeEntities( postAuthor?.name ) || __( '(No author)' );\n\treturn (\n\t\t<Button\n\t\t\tsize=\"compact\"\n\t\t\tclassName=\"editor-post-author__panel-toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post link.\n\t\t\taria-label={ sprintf( __( 'Change author: %s' ), authorName ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ authorName }\n\t\t</Button>\n\t);\n}\n\n/**\n * Renders the Post Author Panel component.\n *\n * @return {Component} The component to be rendered.\n */\nexport function PostAuthor() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\treturn (\n\t\t<PostAuthorCheck>\n\t\t\t<PostPanelRow label={ __( 'Author' ) } ref={ setPopoverAnchor }>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tcontentClassName=\"editor-post-author__panel-dialog\"\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<PostAuthorToggle\n\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<div className=\"editor-post-author\">\n\t\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\t\ttitle={ __( 'Author' ) }\n\t\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PostAuthorForm onClose={ onClose } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PostPanelRow>\n\t\t</PostAuthorCheck>\n\t);\n}\n\nexport default PostAuthor;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,MAAM,EAAEC,QAAQ,QAAQ,uBAAuB;AACxD,SAASC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACtD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,oCAAoC,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAExG;AACA;AACA;AACA,OAAOC,eAAe,MAAM,SAAS;AACrC,OAAOC,cAAc,MAAM,SAAS;AACpC,OAAOC,YAAY,MAAM,mBAAmB;AAC5C,SAASC,eAAe,QAAQ,QAAQ;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEzC,SAASC,gBAAgBA,CAAE;EAAEC,MAAM;EAAEC;AAAQ,CAAC,EAAG;EAChD,MAAM;IAAEC;EAAW,CAAC,GAAGR,eAAe,CAAC,CAAC;EACxC,MAAMS,UAAU,GACff,cAAc,CAAEc,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,CAACN,sBAAsB;YACtBmC,KAAK,EAAG3C,EAAE,CAAE,QAAS,CAAG;YACxB0C,OAAO,EAAGA;UAAS,CACnB,CAAC,eACF5B,IAAA,CAACJ,cAAc;YAACgC,OAAO,EAAGA;UAAS,CAAE,CAAC;QAAA,CAClC;MACH,CACH;IAAC,CACW;EAAC,CACC,CAAC;AAEpB;AAEA,eAAef,UAAU","ignoreList":[]}
@@ -18,8 +18,7 @@ import { store as editorStore } from '../../store';
18
18
  import { TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, PATTERN_POST_TYPE, GLOBAL_POST_TYPES } from '../../store/constants';
19
19
  import { unlock } from '../../lock-unlock';
20
20
  import PostActions from '../post-actions';
21
- import { jsx as _jsx } from "react/jsx-runtime";
22
- import { jsxs as _jsxs } from "react/jsx-runtime";
21
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
22
  export default function PostCardPanel({
24
23
  postType,
25
24
  postId,