@wordpress/editor 12.0.1 → 12.0.5

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 (331) hide show
  1. package/build/components/autocompleters/user.js +1 -1
  2. package/build/components/autosave-monitor/index.js +7 -1
  3. package/build/components/autosave-monitor/index.js.map +1 -1
  4. package/build/components/deprecated.js +6 -4
  5. package/build/components/deprecated.js.map +1 -1
  6. package/build/components/deprecated.native.js +26 -26
  7. package/build/components/document-outline/check.js +5 -4
  8. package/build/components/document-outline/check.js.map +1 -1
  9. package/build/components/document-outline/index.js +13 -9
  10. package/build/components/document-outline/index.js.map +1 -1
  11. package/build/components/document-outline/item.js +25 -22
  12. package/build/components/document-outline/item.js.map +1 -1
  13. package/build/components/editor-help/help-detail-navigation-screen.native.js +5 -4
  14. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  15. package/build/components/editor-help/help-get-support-button.native.js +5 -4
  16. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  17. package/build/components/editor-help/help-topic-row.native.js +6 -5
  18. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  19. package/build/components/editor-help/index.native.js +23 -18
  20. package/build/components/editor-help/index.native.js.map +1 -1
  21. package/build/components/editor-help/view-sections.native.js +16 -13
  22. package/build/components/editor-help/view-sections.native.js.map +1 -1
  23. package/build/components/editor-notices/index.js +5 -4
  24. package/build/components/editor-notices/index.js.map +1 -1
  25. package/build/components/entities-saved-states/entity-record-item.js +7 -6
  26. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  27. package/build/components/entities-saved-states/entity-type-list.js +30 -20
  28. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  29. package/build/components/entities-saved-states/index.js +51 -26
  30. package/build/components/entities-saved-states/index.js.map +1 -1
  31. package/build/components/error-boundary/index.js +5 -4
  32. package/build/components/error-boundary/index.js.map +1 -1
  33. package/build/components/global-keyboard-shortcuts/save-shortcut.js +4 -3
  34. package/build/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
  35. package/build/components/index.js +22 -22
  36. package/build/components/index.native.js +4 -4
  37. package/build/components/page-attributes/check.js +4 -3
  38. package/build/components/page-attributes/check.js.map +1 -1
  39. package/build/components/page-attributes/order.js +5 -4
  40. package/build/components/page-attributes/order.js.map +1 -1
  41. package/build/components/page-attributes/parent.js +6 -3
  42. package/build/components/page-attributes/parent.js.map +1 -1
  43. package/build/components/post-author/check.js +4 -3
  44. package/build/components/post-author/check.js.map +1 -1
  45. package/build/components/post-author/combobox.js +6 -3
  46. package/build/components/post-author/combobox.js.map +1 -1
  47. package/build/components/post-comments/index.js +6 -4
  48. package/build/components/post-comments/index.js.map +1 -1
  49. package/build/components/post-excerpt/index.js +5 -4
  50. package/build/components/post-excerpt/index.js.map +1 -1
  51. package/build/components/post-featured-image/index.js +51 -41
  52. package/build/components/post-featured-image/index.js.map +1 -1
  53. package/build/components/post-format/check.js +5 -4
  54. package/build/components/post-format/check.js.map +1 -1
  55. package/build/components/post-format/index.js +1 -1
  56. package/build/components/post-last-revision/check.js +7 -5
  57. package/build/components/post-last-revision/check.js.map +1 -1
  58. package/build/components/post-last-revision/index.js +5 -4
  59. package/build/components/post-last-revision/index.js.map +1 -1
  60. package/build/components/post-pending-status/check.js +7 -5
  61. package/build/components/post-pending-status/check.js.map +1 -1
  62. package/build/components/post-pending-status/index.js +6 -4
  63. package/build/components/post-pending-status/index.js.map +1 -1
  64. package/build/components/post-pingbacks/index.js +6 -4
  65. package/build/components/post-pingbacks/index.js.map +1 -1
  66. package/build/components/post-preview-button/index.js +11 -7
  67. package/build/components/post-preview-button/index.js.map +1 -1
  68. package/build/components/post-publish-button/index.js +12 -4
  69. package/build/components/post-publish-button/index.js.map +1 -1
  70. package/build/components/post-publish-button/label.js +15 -12
  71. package/build/components/post-publish-button/label.js.map +1 -1
  72. package/build/components/post-publish-panel/index.js +4 -3
  73. package/build/components/post-publish-panel/index.js.map +1 -1
  74. package/build/components/post-publish-panel/maybe-post-format-panel.js +11 -8
  75. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  76. package/build/components/post-publish-panel/maybe-tags-panel.js +7 -4
  77. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  78. package/build/components/post-publish-panel/postpublish.js +6 -5
  79. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  80. package/build/components/post-publish-panel/prepublish.js +4 -3
  81. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  82. package/build/components/post-saved-state/index.js +6 -5
  83. package/build/components/post-saved-state/index.js.map +1 -1
  84. package/build/components/post-schedule/check.js +6 -4
  85. package/build/components/post-schedule/check.js.map +1 -1
  86. package/build/components/post-schedule/index.js +15 -10
  87. package/build/components/post-schedule/index.js.map +1 -1
  88. package/build/components/post-schedule/label.js +5 -4
  89. package/build/components/post-schedule/label.js.map +1 -1
  90. package/build/components/post-slug/check.js +4 -3
  91. package/build/components/post-slug/check.js.map +1 -1
  92. package/build/components/post-slug/index.js +6 -5
  93. package/build/components/post-slug/index.js.map +1 -1
  94. package/build/components/post-sticky/check.js +7 -5
  95. package/build/components/post-sticky/check.js.map +1 -1
  96. package/build/components/post-sticky/index.js +5 -4
  97. package/build/components/post-sticky/index.js.map +1 -1
  98. package/build/components/post-switch-to-draft-button/index.js +7 -6
  99. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  100. package/build/components/post-taxonomies/check.js +6 -5
  101. package/build/components/post-taxonomies/check.js.map +1 -1
  102. package/build/components/post-taxonomies/flat-term-selector.js +155 -211
  103. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  104. package/build/components/post-taxonomies/hierarchical-term-selector.js +6 -5
  105. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  106. package/build/components/post-taxonomies/index.js +6 -5
  107. package/build/components/post-taxonomies/index.js.map +1 -1
  108. package/build/components/post-taxonomies/most-used-terms.js +5 -4
  109. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  110. package/build/components/post-template/index.js +2 -1
  111. package/build/components/post-template/index.js.map +1 -1
  112. package/build/components/post-title/index.js +4 -2
  113. package/build/components/post-title/index.js.map +1 -1
  114. package/build/components/post-title/index.native.js +6 -5
  115. package/build/components/post-title/index.native.js.map +1 -1
  116. package/build/components/post-trash/check.js +8 -6
  117. package/build/components/post-trash/check.js.map +1 -1
  118. package/build/components/post-trash/index.js +8 -6
  119. package/build/components/post-trash/index.js.map +1 -1
  120. package/build/components/post-type-support-check/index.js +6 -5
  121. package/build/components/post-type-support-check/index.js.map +1 -1
  122. package/build/components/post-visibility/check.js +5 -4
  123. package/build/components/post-visibility/check.js.map +1 -1
  124. package/build/components/post-visibility/index.js +28 -24
  125. package/build/components/post-visibility/index.js.map +1 -1
  126. package/build/components/post-visibility/label.js +5 -3
  127. package/build/components/post-visibility/label.js.map +1 -1
  128. package/build/components/provider/index.js +9 -8
  129. package/build/components/provider/index.js.map +1 -1
  130. package/build/components/provider/index.native.js +17 -11
  131. package/build/components/provider/index.native.js.map +1 -1
  132. package/build/components/provider/use-block-editor-settings.js +1 -1
  133. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  134. package/build/components/table-of-contents/index.js +33 -26
  135. package/build/components/table-of-contents/index.js.map +1 -1
  136. package/build/components/table-of-contents/panel.js +5 -4
  137. package/build/components/table-of-contents/panel.js.map +1 -1
  138. package/build/components/template-validation-notice/index.js +6 -4
  139. package/build/components/template-validation-notice/index.js.map +1 -1
  140. package/build/components/theme-support-check/index.js +7 -6
  141. package/build/components/theme-support-check/index.js.map +1 -1
  142. package/build/hooks/custom-sources-backwards-compatibility.js +12 -8
  143. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  144. package/build/hooks/default-autocompleters.js +2 -1
  145. package/build/hooks/default-autocompleters.js.map +1 -1
  146. package/build/index.js +4 -4
  147. package/build/store/actions.js +51 -30
  148. package/build/store/actions.js.map +1 -1
  149. package/build/store/actions.native.js +3 -2
  150. package/build/store/actions.native.js.map +1 -1
  151. package/build/store/constants.js +1 -1
  152. package/build/store/controls.js +10 -9
  153. package/build/store/controls.js.map +1 -1
  154. package/build/store/defaults.js +1 -1
  155. package/build/store/index.js +5 -3
  156. package/build/store/index.js.map +1 -1
  157. package/build/store/reducer.js +52 -22
  158. package/build/store/reducer.js.map +1 -1
  159. package/build/store/reducer.native.js +14 -4
  160. package/build/store/reducer.native.js.map +1 -1
  161. package/build/store/selectors.js +56 -37
  162. package/build/store/selectors.js.map +1 -1
  163. package/build/store/selectors.native.js +1 -1
  164. package/build/store/utils/notice-builder.js +1 -1
  165. package/build/utils/index.js +6 -6
  166. package/build/utils/media-upload/index.js +15 -11
  167. package/build/utils/media-upload/index.js.map +1 -1
  168. package/build/utils/url.js +1 -1
  169. package/build-module/components/autosave-monitor/index.js +7 -1
  170. package/build-module/components/autosave-monitor/index.js.map +1 -1
  171. package/build-module/components/deprecated.js +4 -3
  172. package/build-module/components/deprecated.js.map +1 -1
  173. package/build-module/components/document-outline/check.js +5 -4
  174. package/build-module/components/document-outline/check.js.map +1 -1
  175. package/build-module/components/document-outline/index.js +13 -9
  176. package/build-module/components/document-outline/index.js.map +1 -1
  177. package/build-module/components/document-outline/item.js +25 -22
  178. package/build-module/components/document-outline/item.js.map +1 -1
  179. package/build-module/components/editor-help/help-detail-navigation-screen.native.js +5 -4
  180. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  181. package/build-module/components/editor-help/help-get-support-button.native.js +5 -4
  182. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  183. package/build-module/components/editor-help/help-topic-row.native.js +6 -5
  184. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  185. package/build-module/components/editor-help/index.native.js +23 -19
  186. package/build-module/components/editor-help/index.native.js.map +1 -1
  187. package/build-module/components/editor-help/view-sections.native.js +15 -12
  188. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  189. package/build-module/components/editor-notices/index.js +5 -4
  190. package/build-module/components/editor-notices/index.js.map +1 -1
  191. package/build-module/components/entities-saved-states/entity-record-item.js +7 -6
  192. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  193. package/build-module/components/entities-saved-states/entity-type-list.js +31 -19
  194. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  195. package/build-module/components/entities-saved-states/index.js +50 -25
  196. package/build-module/components/entities-saved-states/index.js.map +1 -1
  197. package/build-module/components/error-boundary/index.js +5 -4
  198. package/build-module/components/error-boundary/index.js.map +1 -1
  199. package/build-module/components/global-keyboard-shortcuts/save-shortcut.js +4 -3
  200. package/build-module/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
  201. package/build-module/components/page-attributes/check.js +4 -3
  202. package/build-module/components/page-attributes/check.js.map +1 -1
  203. package/build-module/components/page-attributes/order.js +5 -4
  204. package/build-module/components/page-attributes/order.js.map +1 -1
  205. package/build-module/components/page-attributes/parent.js +5 -2
  206. package/build-module/components/page-attributes/parent.js.map +1 -1
  207. package/build-module/components/post-author/check.js +4 -3
  208. package/build-module/components/post-author/check.js.map +1 -1
  209. package/build-module/components/post-author/combobox.js +6 -3
  210. package/build-module/components/post-author/combobox.js.map +1 -1
  211. package/build-module/components/post-comments/index.js +6 -4
  212. package/build-module/components/post-comments/index.js.map +1 -1
  213. package/build-module/components/post-excerpt/index.js +5 -4
  214. package/build-module/components/post-excerpt/index.js.map +1 -1
  215. package/build-module/components/post-featured-image/index.js +51 -41
  216. package/build-module/components/post-featured-image/index.js.map +1 -1
  217. package/build-module/components/post-format/check.js +5 -4
  218. package/build-module/components/post-format/check.js.map +1 -1
  219. package/build-module/components/post-last-revision/check.js +7 -5
  220. package/build-module/components/post-last-revision/check.js.map +1 -1
  221. package/build-module/components/post-last-revision/index.js +5 -4
  222. package/build-module/components/post-last-revision/index.js.map +1 -1
  223. package/build-module/components/post-pending-status/check.js +7 -5
  224. package/build-module/components/post-pending-status/check.js.map +1 -1
  225. package/build-module/components/post-pending-status/index.js +6 -4
  226. package/build-module/components/post-pending-status/index.js.map +1 -1
  227. package/build-module/components/post-pingbacks/index.js +6 -4
  228. package/build-module/components/post-pingbacks/index.js.map +1 -1
  229. package/build-module/components/post-preview-button/index.js +11 -7
  230. package/build-module/components/post-preview-button/index.js.map +1 -1
  231. package/build-module/components/post-publish-button/index.js +12 -4
  232. package/build-module/components/post-publish-button/index.js.map +1 -1
  233. package/build-module/components/post-publish-button/label.js +15 -12
  234. package/build-module/components/post-publish-button/label.js.map +1 -1
  235. package/build-module/components/post-publish-panel/index.js +4 -3
  236. package/build-module/components/post-publish-panel/index.js.map +1 -1
  237. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +11 -8
  238. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  239. package/build-module/components/post-publish-panel/maybe-tags-panel.js +7 -4
  240. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  241. package/build-module/components/post-publish-panel/postpublish.js +6 -5
  242. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  243. package/build-module/components/post-publish-panel/prepublish.js +4 -3
  244. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  245. package/build-module/components/post-saved-state/index.js +6 -5
  246. package/build-module/components/post-saved-state/index.js.map +1 -1
  247. package/build-module/components/post-schedule/check.js +6 -4
  248. package/build-module/components/post-schedule/check.js.map +1 -1
  249. package/build-module/components/post-schedule/index.js +15 -10
  250. package/build-module/components/post-schedule/index.js.map +1 -1
  251. package/build-module/components/post-schedule/label.js +6 -4
  252. package/build-module/components/post-schedule/label.js.map +1 -1
  253. package/build-module/components/post-slug/check.js +4 -3
  254. package/build-module/components/post-slug/check.js.map +1 -1
  255. package/build-module/components/post-slug/index.js +6 -5
  256. package/build-module/components/post-slug/index.js.map +1 -1
  257. package/build-module/components/post-sticky/check.js +7 -5
  258. package/build-module/components/post-sticky/check.js.map +1 -1
  259. package/build-module/components/post-sticky/index.js +5 -4
  260. package/build-module/components/post-sticky/index.js.map +1 -1
  261. package/build-module/components/post-switch-to-draft-button/index.js +7 -6
  262. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  263. package/build-module/components/post-taxonomies/check.js +6 -5
  264. package/build-module/components/post-taxonomies/check.js.map +1 -1
  265. package/build-module/components/post-taxonomies/flat-term-selector.js +157 -214
  266. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  267. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +4 -3
  268. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  269. package/build-module/components/post-taxonomies/index.js +6 -5
  270. package/build-module/components/post-taxonomies/index.js.map +1 -1
  271. package/build-module/components/post-taxonomies/most-used-terms.js +5 -4
  272. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  273. package/build-module/components/post-template/index.js +2 -1
  274. package/build-module/components/post-template/index.js.map +1 -1
  275. package/build-module/components/post-title/index.js +4 -2
  276. package/build-module/components/post-title/index.js.map +1 -1
  277. package/build-module/components/post-title/index.native.js +6 -5
  278. package/build-module/components/post-title/index.native.js.map +1 -1
  279. package/build-module/components/post-trash/check.js +8 -6
  280. package/build-module/components/post-trash/check.js.map +1 -1
  281. package/build-module/components/post-trash/index.js +8 -6
  282. package/build-module/components/post-trash/index.js.map +1 -1
  283. package/build-module/components/post-type-support-check/index.js +6 -5
  284. package/build-module/components/post-type-support-check/index.js.map +1 -1
  285. package/build-module/components/post-visibility/check.js +5 -4
  286. package/build-module/components/post-visibility/check.js.map +1 -1
  287. package/build-module/components/post-visibility/index.js +28 -24
  288. package/build-module/components/post-visibility/index.js.map +1 -1
  289. package/build-module/components/post-visibility/label.js +5 -3
  290. package/build-module/components/post-visibility/label.js.map +1 -1
  291. package/build-module/components/provider/index.js +9 -8
  292. package/build-module/components/provider/index.js.map +1 -1
  293. package/build-module/components/provider/index.native.js +13 -9
  294. package/build-module/components/provider/index.native.js.map +1 -1
  295. package/build-module/components/provider/use-block-editor-settings.js +1 -1
  296. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  297. package/build-module/components/table-of-contents/index.js +33 -26
  298. package/build-module/components/table-of-contents/index.js.map +1 -1
  299. package/build-module/components/table-of-contents/panel.js +5 -4
  300. package/build-module/components/table-of-contents/panel.js.map +1 -1
  301. package/build-module/components/template-validation-notice/index.js +6 -4
  302. package/build-module/components/template-validation-notice/index.js.map +1 -1
  303. package/build-module/components/theme-support-check/index.js +7 -6
  304. package/build-module/components/theme-support-check/index.js.map +1 -1
  305. package/build-module/hooks/custom-sources-backwards-compatibility.js +12 -8
  306. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  307. package/build-module/hooks/default-autocompleters.js +2 -1
  308. package/build-module/hooks/default-autocompleters.js.map +1 -1
  309. package/build-module/store/actions.js +27 -12
  310. package/build-module/store/actions.js.map +1 -1
  311. package/build-module/store/actions.native.js +2 -1
  312. package/build-module/store/actions.native.js.map +1 -1
  313. package/build-module/store/controls.js +8 -7
  314. package/build-module/store/controls.js.map +1 -1
  315. package/build-module/store/reducer.js +44 -14
  316. package/build-module/store/reducer.js.map +1 -1
  317. package/build-module/store/reducer.native.js +12 -3
  318. package/build-module/store/reducer.native.js.map +1 -1
  319. package/build-module/store/selectors.js +7 -4
  320. package/build-module/store/selectors.js.map +1 -1
  321. package/build-module/utils/media-upload/index.js +15 -11
  322. package/build-module/utils/media-upload/index.js.map +1 -1
  323. package/package.json +31 -31
  324. package/src/components/autosave-monitor/index.js +5 -0
  325. package/src/components/autosave-monitor/test/index.js +10 -4
  326. package/src/components/editor-help/index.native.js +116 -110
  327. package/src/components/entities-saved-states/entity-type-list.js +29 -10
  328. package/src/components/entities-saved-states/index.js +38 -8
  329. package/src/components/post-taxonomies/flat-term-selector.js +220 -254
  330. package/src/components/post-title/index.js +4 -2
  331. package/src/components/provider/use-block-editor-settings.js +0 -2
@@ -82,11 +82,12 @@ const HELP_TOPICS = [{
82
82
  view: (0, _element.createElement)(_customizeBlocks.default, null)
83
83
  }];
84
84
 
85
- function EditorHelpTopics({
86
- close,
87
- isVisible,
88
- onClose
89
- }) {
85
+ function EditorHelpTopics(_ref) {
86
+ let {
87
+ close,
88
+ isVisible,
89
+ onClose
90
+ } = _ref;
90
91
  const {
91
92
  postType
92
93
  } = (0, _data.useSelect)(select => ({
@@ -101,7 +102,7 @@ function EditorHelpTopics({
101
102
  hasNavigation: true,
102
103
  contentStyle: _style.default.contentContainer,
103
104
  testID: "editor-help-modal"
104
- }, (0, _element.createElement)(_components.BottomSheet.NavigationContainer, {
105
+ }, (0, _element.createElement)(_reactNative.SafeAreaView, null, (0, _element.createElement)(_components.BottomSheet.NavigationContainer, {
105
106
  animate: true,
106
107
  main: true,
107
108
  style: _style.default.navigationContainer
@@ -114,9 +115,11 @@ function EditorHelpTopics({
114
115
  }, (0, _element.createElement)(_components.BottomSheet.NavBar, null, (0, _element.createElement)(_components.BottomSheet.NavBar.DismissButton, {
115
116
  onPress: close,
116
117
  iosText: (0, _i18n.__)('Close')
117
- }), (0, _element.createElement)(_components.BottomSheet.NavBar.Heading, null, title)), (0, _element.createElement)(_components.BottomSheetConsumer, null, ({
118
- listProps
119
- }) => {
118
+ }), (0, _element.createElement)(_components.BottomSheet.NavBar.Heading, null, title)), (0, _element.createElement)(_components.BottomSheetConsumer, null, _ref2 => {
119
+ let {
120
+ listProps
121
+ } = _ref2;
122
+
120
123
  const contentContainerStyle = _reactNative.StyleSheet.flatten(listProps.contentContainerStyle);
121
124
 
122
125
  return (0, _element.createElement)(_reactNative.ScrollView, (0, _extends2.default)({}, listProps, {
@@ -132,10 +135,11 @@ function EditorHelpTopics({
132
135
  }
133
136
  }), (0, _element.createElement)(_components.PanelBody, null, (0, _element.createElement)(_reactNative.Text, {
134
137
  style: sectionTitle
135
- }, (0, _i18n.__)('The basics')), HELP_TOPICS.map(({
136
- label,
137
- icon
138
- }) => {
138
+ }, (0, _i18n.__)('The basics')), HELP_TOPICS.map(_ref3 => {
139
+ let {
140
+ label,
141
+ icon
142
+ } = _ref3;
139
143
  const labelSlug = (0, _lodash.kebabCase)(label);
140
144
  return (0, _element.createElement)(_helpTopicRow.default, {
141
145
  key: labelSlug,
@@ -152,10 +156,11 @@ function EditorHelpTopics({
152
156
  title: (0, _i18n.__)('More support options'),
153
157
  onPress: _reactNativeBridge.requestGotoCustomerSupportOptions
154
158
  })));
155
- }))), HELP_TOPICS.map(({
156
- view,
157
- label
158
- }) => {
159
+ }))), HELP_TOPICS.map(_ref4 => {
160
+ let {
161
+ view,
162
+ label
163
+ } = _ref4;
159
164
  const labelSlug = (0, _lodash.kebabCase)(label);
160
165
  return (0, _element.createElement)(_helpDetailNavigationScreen.default, {
161
166
  key: labelSlug,
@@ -167,7 +172,7 @@ function EditorHelpTopics({
167
172
  ..._stack.TransitionPresets.DefaultTransition
168
173
  }
169
174
  });
170
- })));
175
+ }))));
171
176
  }
172
177
 
173
178
  var _default = EditorHelpTopics;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/editor-help/index.native.js"],"names":["HELP_TOPICS","label","icon","helpFilled","view","plusCircleFilled","alignJustifyAlt","trashFilled","cogAlt","EditorHelpTopics","close","isVisible","onClose","postType","select","editorStore","getEditedPostAttribute","sectionTitle","styles","helpDetailSectionHeading","helpDetailSectionHeadingDark","title","contentContainer","navigationContainer","container","listProps","contentContainerStyle","StyleSheet","flatten","paddingBottom","Math","max","safeAreaBottomInset","marginTop","map","labelSlug","requestContactCustomerSupport","requestGotoCustomerSupportOptions","gestureEnabled","TransitionPresets","DefaultTransition"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAKA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA1CA;AACA;AACA;;AAKA;AACA;AACA;;AAsBA;AACA;AACA;AAWA,MAAMA,WAAW,GAAG,CACnB;AACCC,EAAAA,KAAK,EAAE,cAAI,kBAAJ,CADR;AAECC,EAAAA,IAAI,EAAEC,iBAFP;AAGCC,EAAAA,IAAI,EAAE,4B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QAAA,KAAK,EAAGlC,KAFT;AAGC,QAAA,IAAI,EAAGC,IAHR;AAIC,QAAA,UAAU,EACTiC;AALF,QADD;AAUA,KAfA,CALH,EAuBE,4BAAC,iBAAD;AAAM,MAAA,KAAK,EAAGlB;AAAd,OACG,cAAI,aAAJ,CADH,CAvBF,EA4BE,4BAAC,6BAAD;AACC,MAAA,KAAK,EAAG,cACP,iBADO,CADT;AAIC,MAAA,OAAO,EACNmB;AALF,MA5BF,EAsCE,4BAAC,6BAAD;AACC,MAAA,KAAK,EAAG,cACP,sBADO,CADT;AAIC,MAAA,OAAO,EACNC;AALF,MAtCF,CAhBD,CADD;AAmEA,GAxEF,CAVD,CALD,CALD,EAiGGrC,WAAW,CAACkC,GAAZ,CAAiB,CAAE;AAAE9B,IAAAA,IAAF;AAAQH,IAAAA;AAAR,GAAF,KAAuB;AACzC,UAAMkC,SAAS,GAAG,uBAAWlC,KAAX,CAAlB;AACA,WACC,4BAAC,mCAAD;AACC,MAAA,GAAG,EAAGkC,SADP;AAEC,MAAA,IAAI,EAAGA,SAFR;AAGC,MAAA,OAAO,EAAG/B,IAHX;AAIC,MAAA,KAAK,EAAGH,KAJT;AAKC,MAAA,OAAO,EAAG;AACTqC,QAAAA,cAAc,EAAE,IADP;AAET,WAAGC,yBAAkBC;AAFZ;AALX,MADD;AAYA,GAdC,CAjGH,CARD,CADD;AA4HA;;eAEc/B,gB","sourcesContent":["/**\n * External dependencies\n */\nimport { kebabCase } from 'lodash';\nimport { Text, ScrollView, StyleSheet, View } from 'react-native';\nimport { TransitionPresets } from '@react-navigation/stack';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBottomSheet,\n\tBottomSheetConsumer,\n\tPanelBody,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\thelpFilled,\n\tplusCircleFilled,\n\talignJustifyAlt,\n\ttrashFilled,\n\tcogAlt,\n} from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport {\n\trequestContactCustomerSupport,\n\trequestGotoCustomerSupportOptions,\n} from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport HelpDetailNavigationScreen from './help-detail-navigation-screen';\nimport HelpTopicRow from './help-topic-row';\nimport HelpGetSupportButton from './help-get-support-button';\nimport IntroToBlocks from './intro-to-blocks';\nimport AddBlocks from './add-blocks';\nimport MoveBlocks from './move-blocks';\nimport RemoveBlocks from './remove-blocks';\nimport CustomizeBlocks from './customize-blocks';\n\nconst HELP_TOPICS = [\n\t{\n\t\tlabel: __( 'What is a block?' ),\n\t\ticon: helpFilled,\n\t\tview: <IntroToBlocks />,\n\t},\n\t{\n\t\tlabel: __( 'Add blocks' ),\n\t\ticon: plusCircleFilled,\n\t\tview: <AddBlocks />,\n\t},\n\t{ label: __( 'Move blocks' ), icon: alignJustifyAlt, view: <MoveBlocks /> },\n\t{ label: __( 'Remove blocks' ), icon: trashFilled, view: <RemoveBlocks /> },\n\t{\n\t\tlabel: __( 'Customize blocks' ),\n\t\ticon: cogAlt,\n\t\tview: <CustomizeBlocks />,\n\t},\n];\n\nfunction EditorHelpTopics( { close, isVisible, onClose } ) {\n\tconst { postType } = useSelect( ( select ) => ( {\n\t\tpostType: select( editorStore ).getEditedPostAttribute( 'type' ),\n\t} ) );\n\n\tconst sectionTitle = usePreferredColorSchemeStyle(\n\t\tstyles.helpDetailSectionHeading,\n\t\tstyles.helpDetailSectionHeadingDark\n\t);\n\n\tconst title =\n\t\tpostType === 'page'\n\t\t\t? __( 'How to edit your page' )\n\t\t\t: __( 'How to edit your post' );\n\n\treturn (\n\t\t<BottomSheet\n\t\t\tisVisible={ isVisible }\n\t\t\tonClose={ onClose }\n\t\t\thideHeader\n\t\t\thasNavigation\n\t\t\tcontentStyle={ styles.contentContainer }\n\t\t\ttestID=\"editor-help-modal\"\n\t\t>\n\t\t\t<BottomSheet.NavigationContainer\n\t\t\t\tanimate\n\t\t\t\tmain\n\t\t\t\tstyle={ styles.navigationContainer }\n\t\t\t>\n\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\tisScrollable\n\t\t\t\t\tfullScreen\n\t\t\t\t\tname=\"help-topics\"\n\t\t\t\t>\n\t\t\t\t\t<View style={ styles.container }>\n\t\t\t\t\t\t<BottomSheet.NavBar>\n\t\t\t\t\t\t\t<BottomSheet.NavBar.DismissButton\n\t\t\t\t\t\t\t\tonPress={ close }\n\t\t\t\t\t\t\t\tiosText={ __( 'Close' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t</BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t</BottomSheet.NavBar>\n\t\t\t\t\t\t<BottomSheetConsumer>\n\t\t\t\t\t\t\t{ ( { listProps } ) => {\n\t\t\t\t\t\t\t\tconst contentContainerStyle = StyleSheet.flatten(\n\t\t\t\t\t\t\t\t\tlistProps.contentContainerStyle\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<ScrollView\n\t\t\t\t\t\t\t\t\t\t{ ...listProps }\n\t\t\t\t\t\t\t\t\t\tcontentContainerStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t...contentContainerStyle,\n\t\t\t\t\t\t\t\t\t\t\tpaddingBottom: Math.max(\n\t\t\t\t\t\t\t\t\t\t\t\tlistProps.safeAreaBottomInset,\n\t\t\t\t\t\t\t\t\t\t\t\tcontentContainerStyle.paddingBottom\n\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\t * Remove margin set via `hideHeader`. Combining a header\n\t\t\t\t\t\t\t\t\t\t\t * and navigation in this bottom sheet is at odds with the\n\t\t\t\t\t\t\t\t\t\t\t * current `BottomSheet` implementation.\n\t\t\t\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t\t\t\tmarginTop: 0,\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\t\t<PanelBody>\n\t\t\t\t\t\t\t\t\t\t\t<Text style={ sectionTitle }>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'The basics' ) }\n\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t\t{ /* Print out help topics */ }\n\t\t\t\t\t\t\t\t\t\t\t{ HELP_TOPICS.map(\n\t\t\t\t\t\t\t\t\t\t\t\t( { label, icon } ) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tconst labelSlug = kebabCase(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<HelpTopicRow\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={ labelSlug }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tscreenName={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabelSlug\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\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\t\t<Text style={ sectionTitle }>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Get support' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Text>\n\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\t\t<HelpGetSupportButton\n\t\t\t\t\t\t\t\t\t\t\t\t\ttitle={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Contact support'\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\tonPress={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trequestContactCustomerSupport\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\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\t\t<HelpGetSupportButton\n\t\t\t\t\t\t\t\t\t\t\t\t\ttitle={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'More support options'\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\tonPress={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trequestGotoCustomerSupportOptions\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</PanelBody>\n\t\t\t\t\t\t\t\t\t</ScrollView>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t</BottomSheetConsumer>\n\t\t\t\t\t</View>\n\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t{ /* Print out help detail screens */ }\n\t\t\t\t{ HELP_TOPICS.map( ( { view, label } ) => {\n\t\t\t\t\tconst labelSlug = kebabCase( label );\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<HelpDetailNavigationScreen\n\t\t\t\t\t\t\tkey={ labelSlug }\n\t\t\t\t\t\t\tname={ labelSlug }\n\t\t\t\t\t\t\tcontent={ view }\n\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\toptions={ {\n\t\t\t\t\t\t\t\tgestureEnabled: true,\n\t\t\t\t\t\t\t\t...TransitionPresets.DefaultTransition,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</BottomSheet.NavigationContainer>\n\t\t</BottomSheet>\n\t);\n}\n\nexport default EditorHelpTopics;\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/editor-help/index.native.js"],"names":["HELP_TOPICS","label","icon","helpFilled","view","plusCircleFilled","alignJustifyAlt","trashFilled","cogAlt","EditorHelpTopics","close","isVisible","onClose","postType","select","editorStore","getEditedPostAttribute","sectionTitle","styles","helpDetailSectionHeading","helpDetailSectionHeadingDark","title","contentContainer","navigationContainer","container","listProps","contentContainerStyle","StyleSheet","flatten","paddingBottom","Math","max","safeAreaBottomInset","marginTop","map","labelSlug","requestContactCustomerSupport","requestGotoCustomerSupportOptions","gestureEnabled","TransitionPresets","DefaultTransition"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAKA;;AACA;;AAOA;;AACA;;AACA;;AACA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA1CA;AACA;AACA;;AAKA;AACA;AACA;;AAsBA;AACA;AACA;AAWA,MAAMA,WAAW,GAAG,CACnB;AACCC,EAAAA,KAAK,EAAE,cAAI,kBAAJ,CADR;AAECC,EAAAA,IAAI,EAAEC,iBAFP;AAGCC,EAAAA,IAAI,EAAE,4BAAC,sBAAD;AAHP,CADmB,EAMnB;AACCH,EAAAA,KAAK,EAAE,cAAI,YAAJ,CADR;AAECC,EAAAA,IAAI,EAAEG,uBAFP;AAGCD,EAAAA,IAAI,EAAE,4BAAC,kBAAD;AAHP,CANmB,EAWnB;AAAEH,EAAAA,KAAK,EAAE,cAAI,aAAJ,CAAT;AAA8BC,EAAAA,IAAI,EAAEI,sBAApC;AAAqDF,EAAAA,IAAI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KAAK,EAAG,cACP,iBADO,CADT;AAIC,MAAA,OAAO,EACNmB;AALF,MAhCF,EA0CE,4BAAC,6BAAD;AACC,MAAA,KAAK,EAAG,cACP,sBADO,CADT;AAIC,MAAA,OAAO,EACNC;AALF,MA1CF,CAhBD,CADD;AAuEA,GA5EF,CAVD,CALD,CALD,EAqGGrC,WAAW,CAACkC,GAAZ,CAAiB,SAAuB;AAAA,QAArB;AAAE9B,MAAAA,IAAF;AAAQH,MAAAA;AAAR,KAAqB;AACzC,UAAMkC,SAAS,GAAG,uBAAWlC,KAAX,CAAlB;AACA,WACC,4BAAC,mCAAD;AACC,MAAA,GAAG,EAAGkC,SADP;AAEC,MAAA,IAAI,EAAGA,SAFR;AAGC,MAAA,OAAO,EAAG/B,IAHX;AAIC,MAAA,KAAK,EAAGH,KAJT;AAKC,MAAA,OAAO,EAAG;AACTqC,QAAAA,cAAc,EAAE,IADP;AAET,WAAGC,yBAAkBC;AAFZ;AALX,MADD;AAYA,GAdC,CArGH,CADD,CARD,CADD;AAkIA;;eAEc/B,gB","sourcesContent":["/**\n * External dependencies\n */\nimport { kebabCase } from 'lodash';\nimport { Text, SafeAreaView, ScrollView, StyleSheet, View } from 'react-native';\nimport { TransitionPresets } from '@react-navigation/stack';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBottomSheet,\n\tBottomSheetConsumer,\n\tPanelBody,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\thelpFilled,\n\tplusCircleFilled,\n\talignJustifyAlt,\n\ttrashFilled,\n\tcogAlt,\n} from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport {\n\trequestContactCustomerSupport,\n\trequestGotoCustomerSupportOptions,\n} from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\nimport HelpDetailNavigationScreen from './help-detail-navigation-screen';\nimport HelpTopicRow from './help-topic-row';\nimport HelpGetSupportButton from './help-get-support-button';\nimport IntroToBlocks from './intro-to-blocks';\nimport AddBlocks from './add-blocks';\nimport MoveBlocks from './move-blocks';\nimport RemoveBlocks from './remove-blocks';\nimport CustomizeBlocks from './customize-blocks';\n\nconst HELP_TOPICS = [\n\t{\n\t\tlabel: __( 'What is a block?' ),\n\t\ticon: helpFilled,\n\t\tview: <IntroToBlocks />,\n\t},\n\t{\n\t\tlabel: __( 'Add blocks' ),\n\t\ticon: plusCircleFilled,\n\t\tview: <AddBlocks />,\n\t},\n\t{ label: __( 'Move blocks' ), icon: alignJustifyAlt, view: <MoveBlocks /> },\n\t{ label: __( 'Remove blocks' ), icon: trashFilled, view: <RemoveBlocks /> },\n\t{\n\t\tlabel: __( 'Customize blocks' ),\n\t\ticon: cogAlt,\n\t\tview: <CustomizeBlocks />,\n\t},\n];\n\nfunction EditorHelpTopics( { close, isVisible, onClose } ) {\n\tconst { postType } = useSelect( ( select ) => ( {\n\t\tpostType: select( editorStore ).getEditedPostAttribute( 'type' ),\n\t} ) );\n\n\tconst sectionTitle = usePreferredColorSchemeStyle(\n\t\tstyles.helpDetailSectionHeading,\n\t\tstyles.helpDetailSectionHeadingDark\n\t);\n\n\tconst title =\n\t\tpostType === 'page'\n\t\t\t? __( 'How to edit your page' )\n\t\t\t: __( 'How to edit your post' );\n\n\treturn (\n\t\t<BottomSheet\n\t\t\tisVisible={ isVisible }\n\t\t\tonClose={ onClose }\n\t\t\thideHeader\n\t\t\thasNavigation\n\t\t\tcontentStyle={ styles.contentContainer }\n\t\t\ttestID=\"editor-help-modal\"\n\t\t>\n\t\t\t<SafeAreaView>\n\t\t\t\t<BottomSheet.NavigationContainer\n\t\t\t\t\tanimate\n\t\t\t\t\tmain\n\t\t\t\t\tstyle={ styles.navigationContainer }\n\t\t\t\t>\n\t\t\t\t\t<BottomSheet.NavigationScreen\n\t\t\t\t\t\tisScrollable\n\t\t\t\t\t\tfullScreen\n\t\t\t\t\t\tname=\"help-topics\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ styles.container }>\n\t\t\t\t\t\t\t<BottomSheet.NavBar>\n\t\t\t\t\t\t\t\t<BottomSheet.NavBar.DismissButton\n\t\t\t\t\t\t\t\t\tonPress={ close }\n\t\t\t\t\t\t\t\t\tiosText={ __( 'Close' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t</BottomSheet.NavBar.Heading>\n\t\t\t\t\t\t\t</BottomSheet.NavBar>\n\t\t\t\t\t\t\t<BottomSheetConsumer>\n\t\t\t\t\t\t\t\t{ ( { listProps } ) => {\n\t\t\t\t\t\t\t\t\tconst contentContainerStyle = StyleSheet.flatten(\n\t\t\t\t\t\t\t\t\t\tlistProps.contentContainerStyle\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<ScrollView\n\t\t\t\t\t\t\t\t\t\t\t{ ...listProps }\n\t\t\t\t\t\t\t\t\t\t\tcontentContainerStyle={ {\n\t\t\t\t\t\t\t\t\t\t\t\t...contentContainerStyle,\n\t\t\t\t\t\t\t\t\t\t\t\tpaddingBottom: Math.max(\n\t\t\t\t\t\t\t\t\t\t\t\t\tlistProps.safeAreaBottomInset,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcontentContainerStyle.paddingBottom\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t\t\t\t\t * Remove margin set via `hideHeader`. Combining a header\n\t\t\t\t\t\t\t\t\t\t\t\t * and navigation in this bottom sheet is at odds with the\n\t\t\t\t\t\t\t\t\t\t\t\t * current `BottomSheet` implementation.\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\tmarginTop: 0,\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\t\t<PanelBody>\n\t\t\t\t\t\t\t\t\t\t\t\t<Text style={ sectionTitle }>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'The basics' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t\t\t{ /* Print out help topics */ }\n\t\t\t\t\t\t\t\t\t\t\t\t{ HELP_TOPICS.map(\n\t\t\t\t\t\t\t\t\t\t\t\t\t( { label, icon } ) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst labelSlug = kebabCase(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<HelpTopicRow\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabelSlug\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tscreenName={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabelSlug\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={ sectionTitle }\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Get support' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t<HelpGetSupportButton\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Contact support'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonPress={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trequestContactCustomerSupport\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t<HelpGetSupportButton\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'More support options'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonPress={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trequestGotoCustomerSupportOptions\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\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</PanelBody>\n\t\t\t\t\t\t\t\t\t\t</ScrollView>\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</BottomSheetConsumer>\n\t\t\t\t\t\t</View>\n\t\t\t\t\t</BottomSheet.NavigationScreen>\n\t\t\t\t\t{ /* Print out help detail screens */ }\n\t\t\t\t\t{ HELP_TOPICS.map( ( { view, label } ) => {\n\t\t\t\t\t\tconst labelSlug = kebabCase( label );\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<HelpDetailNavigationScreen\n\t\t\t\t\t\t\t\tkey={ labelSlug }\n\t\t\t\t\t\t\t\tname={ labelSlug }\n\t\t\t\t\t\t\t\tcontent={ view }\n\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\toptions={ {\n\t\t\t\t\t\t\t\t\tgestureEnabled: true,\n\t\t\t\t\t\t\t\t\t...TransitionPresets.DefaultTransition,\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} ) }\n\t\t\t\t</BottomSheet.NavigationContainer>\n\t\t\t</SafeAreaView>\n\t\t</BottomSheet>\n\t);\n}\n\nexport default EditorHelpTopics;\n"]}
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.HelpDetailImage = exports.HelpDetailSectionHeadingText = exports.HelpDetailBodyText = void 0;
8
+ exports.HelpDetailSectionHeadingText = exports.HelpDetailImage = exports.HelpDetailBodyText = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
@@ -26,9 +26,10 @@ var _style = _interopRequireDefault(require("./style.scss"));
26
26
  /**
27
27
  * Internal dependencies
28
28
  */
29
- const HelpDetailBodyText = ({
30
- text
31
- }) => {
29
+ const HelpDetailBodyText = _ref => {
30
+ let {
31
+ text
32
+ } = _ref;
32
33
  const bodyStyle = (0, _compose.usePreferredColorSchemeStyle)(_style.default.helpDetailBody, _style.default.helpDetailBodyDark);
33
34
  return (0, _element.createElement)(_reactNative.Text, {
34
35
  selectable: true,
@@ -38,9 +39,10 @@ const HelpDetailBodyText = ({
38
39
 
39
40
  exports.HelpDetailBodyText = HelpDetailBodyText;
40
41
 
41
- const HelpDetailSectionHeadingText = ({
42
- text
43
- }) => {
42
+ const HelpDetailSectionHeadingText = _ref2 => {
43
+ let {
44
+ text
45
+ } = _ref2;
44
46
  const headingStyle = (0, _compose.usePreferredColorSchemeStyle)(_style.default.helpDetailSectionHeading, _style.default.helpDetailSectionHeadingDark);
45
47
  return (0, _element.createElement)(_reactNative.Text, {
46
48
  accessibilityRole: "header",
@@ -51,12 +53,13 @@ const HelpDetailSectionHeadingText = ({
51
53
 
52
54
  exports.HelpDetailSectionHeadingText = HelpDetailSectionHeadingText;
53
55
 
54
- const HelpDetailImage = ({
55
- accessible,
56
- accessibilityLabel,
57
- source,
58
- sourceDarkMode
59
- }) => {
56
+ const HelpDetailImage = _ref3 => {
57
+ let {
58
+ accessible,
59
+ accessibilityLabel,
60
+ source,
61
+ sourceDarkMode
62
+ } = _ref3;
60
63
  const imageStyle = (0, _compose.usePreferredColorSchemeStyle)(_style.default.helpDetailImage, _style.default.helpDetailImageDark);
61
64
  const darkModeEnabled = (0, _compose.usePreferredColorScheme)() === 'dark';
62
65
  return (0, _element.createElement)(_reactNative.Image, {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/editor-help/view-sections.native.js"],"names":["HelpDetailBodyText","text","bodyStyle","styles","helpDetailBody","helpDetailBodyDark","HelpDetailSectionHeadingText","headingStyle","helpDetailSectionHeading","helpDetailSectionHeadingDark","HelpDetailImage","accessible","accessibilityLabel","source","sourceDarkMode","imageStyle","helpDetailImage","helpDetailImageDark","darkModeEnabled"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAQA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAGO,MAAMA,kBAAkB,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF,KAAgB;AACjD,QAAMC,SAAS,GAAG,2CACjBC,eAAOC,cADU,EAEjBD,eAAOE,kBAFU,CAAlB;AAIA,SACC,4BAAC,iBAAD;AAAM,IAAA,UAAU,MAAhB;AAAiB,IAAA,KAAK,EAAGH;AAAzB,KACGD,IADH,CADD;AAKA,CAVM;;;;AAYA,MAAMK,4BAA4B,GAAG,CAAE;AAAEL,EAAAA;AAAF,CAAF,KAAgB;AAC3D,QAAMM,YAAY,GAAG,2CACpBJ,eAAOK,wBADa,EAEpBL,eAAOM,4BAFa,CAArB;AAIA,SACC,4BAAC,iBAAD;AAAM,IAAA,iBAAiB,EAAC,QAAxB;AAAiC,IAAA,UAAU,MAA3C;AAA4C,IAAA,KAAK,EAAGF;AAApD,KACGN,IADH,CADD;AAKA,CAVM;;;;AAYA,MAAMS,eAAe,GAAG,CAAE;AAChCC,EAAAA,UADgC;AAEhCC,EAAAA,kBAFgC;AAGhCC,EAAAA,MAHgC;AAIhCC,EAAAA;AAJgC,CAAF,KAKxB;AACN,QAAMC,UAAU,GAAG,2CAClBZ,eAAOa,eADW,EAElBb,eAAOc,mBAFW,CAAnB;AAIA,QAAMC,eAAe,GAAG,4CAA8B,MAAtD;AACA,SACC,4BAAC,kBAAD;AACC,IAAA,UAAU,EAAGP,UADd;AAEC,IAAA,kBAAkB,EAAGC,kBAFtB;AAGC,IAAA,MAAM,EACLM,eAAe,IAAIJ,cAAnB,GAAoCA,cAApC,GAAqDD,MAJvD;AAMC,IAAA,KAAK,EAAGE;AANT,IADD;AAUA,CArBM","sourcesContent":["/**\n * External dependencies\n */\nimport { Text, Image } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tusePreferredColorScheme,\n\tusePreferredColorSchemeStyle,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nexport const HelpDetailBodyText = ( { text } ) => {\n\tconst bodyStyle = usePreferredColorSchemeStyle(\n\t\tstyles.helpDetailBody,\n\t\tstyles.helpDetailBodyDark\n\t);\n\treturn (\n\t\t<Text selectable style={ bodyStyle }>\n\t\t\t{ text }\n\t\t</Text>\n\t);\n};\n\nexport const HelpDetailSectionHeadingText = ( { text } ) => {\n\tconst headingStyle = usePreferredColorSchemeStyle(\n\t\tstyles.helpDetailSectionHeading,\n\t\tstyles.helpDetailSectionHeadingDark\n\t);\n\treturn (\n\t\t<Text accessibilityRole=\"header\" selectable style={ headingStyle }>\n\t\t\t{ text }\n\t\t</Text>\n\t);\n};\n\nexport const HelpDetailImage = ( {\n\taccessible,\n\taccessibilityLabel,\n\tsource,\n\tsourceDarkMode,\n} ) => {\n\tconst imageStyle = usePreferredColorSchemeStyle(\n\t\tstyles.helpDetailImage,\n\t\tstyles.helpDetailImageDark\n\t);\n\tconst darkModeEnabled = usePreferredColorScheme() === 'dark';\n\treturn (\n\t\t<Image\n\t\t\taccessible={ accessible }\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\tsource={\n\t\t\t\tdarkModeEnabled && sourceDarkMode ? sourceDarkMode : source\n\t\t\t}\n\t\t\tstyle={ imageStyle }\n\t\t/>\n\t);\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/editor-help/view-sections.native.js"],"names":["HelpDetailBodyText","text","bodyStyle","styles","helpDetailBody","helpDetailBodyDark","HelpDetailSectionHeadingText","headingStyle","helpDetailSectionHeading","helpDetailSectionHeadingDark","HelpDetailImage","accessible","accessibilityLabel","source","sourceDarkMode","imageStyle","helpDetailImage","helpDetailImageDark","darkModeEnabled"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AAQA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAGO,MAAMA,kBAAkB,GAAG,QAAgB;AAAA,MAAd;AAAEC,IAAAA;AAAF,GAAc;AACjD,QAAMC,SAAS,GAAG,2CACjBC,eAAOC,cADU,EAEjBD,eAAOE,kBAFU,CAAlB;AAIA,SACC,4BAAC,iBAAD;AAAM,IAAA,UAAU,MAAhB;AAAiB,IAAA,KAAK,EAAGH;AAAzB,KACGD,IADH,CADD;AAKA,CAVM;;;;AAYA,MAAMK,4BAA4B,GAAG,SAAgB;AAAA,MAAd;AAAEL,IAAAA;AAAF,GAAc;AAC3D,QAAMM,YAAY,GAAG,2CACpBJ,eAAOK,wBADa,EAEpBL,eAAOM,4BAFa,CAArB;AAIA,SACC,4BAAC,iBAAD;AAAM,IAAA,iBAAiB,EAAC,QAAxB;AAAiC,IAAA,UAAU,MAA3C;AAA4C,IAAA,KAAK,EAAGF;AAApD,KACGN,IADH,CADD;AAKA,CAVM;;;;AAYA,MAAMS,eAAe,GAAG,SAKxB;AAAA,MAL0B;AAChCC,IAAAA,UADgC;AAEhCC,IAAAA,kBAFgC;AAGhCC,IAAAA,MAHgC;AAIhCC,IAAAA;AAJgC,GAK1B;AACN,QAAMC,UAAU,GAAG,2CAClBZ,eAAOa,eADW,EAElBb,eAAOc,mBAFW,CAAnB;AAIA,QAAMC,eAAe,GAAG,4CAA8B,MAAtD;AACA,SACC,4BAAC,kBAAD;AACC,IAAA,UAAU,EAAGP,UADd;AAEC,IAAA,kBAAkB,EAAGC,kBAFtB;AAGC,IAAA,MAAM,EACLM,eAAe,IAAIJ,cAAnB,GAAoCA,cAApC,GAAqDD,MAJvD;AAMC,IAAA,KAAK,EAAGE;AANT,IADD;AAUA,CArBM","sourcesContent":["/**\n * External dependencies\n */\nimport { Text, Image } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tusePreferredColorScheme,\n\tusePreferredColorSchemeStyle,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nexport const HelpDetailBodyText = ( { text } ) => {\n\tconst bodyStyle = usePreferredColorSchemeStyle(\n\t\tstyles.helpDetailBody,\n\t\tstyles.helpDetailBodyDark\n\t);\n\treturn (\n\t\t<Text selectable style={ bodyStyle }>\n\t\t\t{ text }\n\t\t</Text>\n\t);\n};\n\nexport const HelpDetailSectionHeadingText = ( { text } ) => {\n\tconst headingStyle = usePreferredColorSchemeStyle(\n\t\tstyles.helpDetailSectionHeading,\n\t\tstyles.helpDetailSectionHeadingDark\n\t);\n\treturn (\n\t\t<Text accessibilityRole=\"header\" selectable style={ headingStyle }>\n\t\t\t{ text }\n\t\t</Text>\n\t);\n};\n\nexport const HelpDetailImage = ( {\n\taccessible,\n\taccessibilityLabel,\n\tsource,\n\tsourceDarkMode,\n} ) => {\n\tconst imageStyle = usePreferredColorSchemeStyle(\n\t\tstyles.helpDetailImage,\n\t\tstyles.helpDetailImageDark\n\t);\n\tconst darkModeEnabled = usePreferredColorScheme() === 'dark';\n\treturn (\n\t\t<Image\n\t\t\taccessible={ accessible }\n\t\t\taccessibilityLabel={ accessibilityLabel }\n\t\t\tsource={\n\t\t\t\tdarkModeEnabled && sourceDarkMode ? sourceDarkMode : source\n\t\t\t}\n\t\t\tstyle={ imageStyle }\n\t\t/>\n\t);\n};\n"]}
@@ -33,10 +33,11 @@ var _templateValidationNotice = _interopRequireDefault(require("../template-vali
33
33
  /**
34
34
  * Internal dependencies
35
35
  */
36
- function EditorNotices({
37
- notices,
38
- onRemove
39
- }) {
36
+ function EditorNotices(_ref) {
37
+ let {
38
+ notices,
39
+ onRemove
40
+ } = _ref;
40
41
  const dismissibleNotices = (0, _lodash.filter)(notices, {
41
42
  isDismissible: true,
42
43
  type: 'default'
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/editor-notices/index.js"],"names":["EditorNotices","notices","onRemove","dismissibleNotices","isDismissible","type","nonDismissibleNotices","select","noticesStore","getNotices","dispatch","removeNotice"],"mappings":";;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAGO,SAASA,aAAT,CAAwB;AAAEC,EAAAA,OAAF;AAAWC,EAAAA;AAAX,CAAxB,EAAgD;AACtD,QAAMC,kBAAkB,GAAG,oBAAQF,OAAR,EAAiB;AAC3CG,IAAAA,aAAa,EAAE,IAD4B;AAE3CC,IAAAA,IAAI,EAAE;AAFqC,GAAjB,CAA3B;AAIA,QAAMC,qBAAqB,GAAG,oBAAQL,OAAR,EAAiB;AAC9CG,IAAAA,aAAa,EAAE,KAD+B;AAE9CC,IAAAA,IAAI,EAAE;AAFwC,GAAjB,CAA9B;AAKA,SACC,qDACC,4BAAC,sBAAD;AACC,IAAA,OAAO,EAAGC,qBADX;AAEC,IAAA,SAAS,EAAC;AAFX,IADD,EAKC,4BAAC,sBAAD;AACC,IAAA,OAAO,EAAGH,kBADX;AAEC,IAAA,SAAS,EAAC,wCAFX;AAGC,IAAA,QAAQ,EAAGD;AAHZ,KAKC,4BAAC,iCAAD,OALD,CALD,CADD;AAeA;;eAEc,sBAAS,CACvB,sBAAcK,MAAF,KAAgB;AAC3BN,EAAAA,OAAO,EAAEM,MAAM,CAAEC,cAAF,CAAN,CAAuBC,UAAvB;AADkB,CAAhB,CAAZ,CADuB,EAIvB,wBAAgBC,QAAF,KAAkB;AAC/BR,EAAAA,QAAQ,EAAEQ,QAAQ,CAAEF,cAAF,CAAR,CAAyBG;AADJ,CAAlB,CAAd,CAJuB,CAAT,EAOVX,aAPU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { filter } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { NoticeList } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TemplateValidationNotice from '../template-validation-notice';\n\nexport function EditorNotices( { notices, onRemove } ) {\n\tconst dismissibleNotices = filter( notices, {\n\t\tisDismissible: true,\n\t\ttype: 'default',\n\t} );\n\tconst nonDismissibleNotices = filter( notices, {\n\t\tisDismissible: false,\n\t\ttype: 'default',\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ nonDismissibleNotices }\n\t\t\t\tclassName=\"components-editor-notices__pinned\"\n\t\t\t/>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ dismissibleNotices }\n\t\t\t\tclassName=\"components-editor-notices__dismissible\"\n\t\t\t\tonRemove={ onRemove }\n\t\t\t>\n\t\t\t\t<TemplateValidationNotice />\n\t\t\t</NoticeList>\n\t\t</>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => ( {\n\t\tnotices: select( noticesStore ).getNotices(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => ( {\n\t\tonRemove: dispatch( noticesStore ).removeNotice,\n\t} ) ),\n] )( EditorNotices );\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/editor-notices/index.js"],"names":["EditorNotices","notices","onRemove","dismissibleNotices","isDismissible","type","nonDismissibleNotices","select","noticesStore","getNotices","dispatch","removeNotice"],"mappings":";;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAGO,SAASA,aAAT,OAAgD;AAAA,MAAxB;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,GAAwB;AACtD,QAAMC,kBAAkB,GAAG,oBAAQF,OAAR,EAAiB;AAC3CG,IAAAA,aAAa,EAAE,IAD4B;AAE3CC,IAAAA,IAAI,EAAE;AAFqC,GAAjB,CAA3B;AAIA,QAAMC,qBAAqB,GAAG,oBAAQL,OAAR,EAAiB;AAC9CG,IAAAA,aAAa,EAAE,KAD+B;AAE9CC,IAAAA,IAAI,EAAE;AAFwC,GAAjB,CAA9B;AAKA,SACC,qDACC,4BAAC,sBAAD;AACC,IAAA,OAAO,EAAGC,qBADX;AAEC,IAAA,SAAS,EAAC;AAFX,IADD,EAKC,4BAAC,sBAAD;AACC,IAAA,OAAO,EAAGH,kBADX;AAEC,IAAA,SAAS,EAAC,wCAFX;AAGC,IAAA,QAAQ,EAAGD;AAHZ,KAKC,4BAAC,iCAAD,OALD,CALD,CADD;AAeA;;eAEc,sBAAS,CACvB,sBAAcK,MAAF,KAAgB;AAC3BN,EAAAA,OAAO,EAAEM,MAAM,CAAEC,cAAF,CAAN,CAAuBC,UAAvB;AADkB,CAAhB,CAAZ,CADuB,EAIvB,wBAAgBC,QAAF,KAAkB;AAC/BR,EAAAA,QAAQ,EAAEQ,QAAQ,CAAEF,cAAF,CAAR,CAAyBG;AADJ,CAAlB,CAAd,CAJuB,CAAT,EAOVX,aAPU,C","sourcesContent":["/**\n * External dependencies\n */\nimport { filter } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { NoticeList } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport TemplateValidationNotice from '../template-validation-notice';\n\nexport function EditorNotices( { notices, onRemove } ) {\n\tconst dismissibleNotices = filter( notices, {\n\t\tisDismissible: true,\n\t\ttype: 'default',\n\t} );\n\tconst nonDismissibleNotices = filter( notices, {\n\t\tisDismissible: false,\n\t\ttype: 'default',\n\t} );\n\n\treturn (\n\t\t<>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ nonDismissibleNotices }\n\t\t\t\tclassName=\"components-editor-notices__pinned\"\n\t\t\t/>\n\t\t\t<NoticeList\n\t\t\t\tnotices={ dismissibleNotices }\n\t\t\t\tclassName=\"components-editor-notices__dismissible\"\n\t\t\t\tonRemove={ onRemove }\n\t\t\t>\n\t\t\t\t<TemplateValidationNotice />\n\t\t\t</NoticeList>\n\t\t</>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => ( {\n\t\tnotices: select( noticesStore ).getNotices(),\n\t} ) ),\n\twithDispatch( ( dispatch ) => ( {\n\t\tonRemove: dispatch( noticesStore ).removeNotice,\n\t} ) ),\n] )( EditorNotices );\n"]}
@@ -26,12 +26,13 @@ var _store = require("../../store");
26
26
  /**
27
27
  * Internal dependencies
28
28
  */
29
- function EntityRecordItem({
30
- record,
31
- checked,
32
- onChange,
33
- closePanel
34
- }) {
29
+ function EntityRecordItem(_ref) {
30
+ let {
31
+ record,
32
+ checked,
33
+ onChange,
34
+ closePanel
35
+ } = _ref;
35
36
  const {
36
37
  name,
37
38
  kind,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/entities-saved-states/entity-record-item.js"],"names":["EntityRecordItem","record","checked","onChange","closePanel","name","kind","title","key","parentBlockId","select","blocks","coreStore","getEditedEntityRecord","parents","blockEditorStore","getBlockParents","clientId","length","entityRecordTitle","template","editorStore","__experimentalGetTemplateInfo","isSelected","selectedBlockId","getSelectedBlockClientId","isSelectedText","selectBlock","selectParentBlock","selectAndDismiss"],"mappings":";;;;;;;AAMA;;AAHA;;AACA;;AACA;;AAEA;;AACA;;AAKA;;AAbA;AACA;AACA;;AAQA;AACA;AACA;AAGe,SAASA,gBAAT,CAA2B;AACzCC,EAAAA,MADyC;AAEzCC,EAAAA,OAFyC;AAGzCC,EAAAA,QAHyC;AAIzCC,EAAAA;AAJyC,CAA3B,EAKX;AACH,QAAM;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,IAAR;AAAcC,IAAAA,KAAd;AAAqBC,IAAAA;AAArB,MAA6BP,MAAnC;AACA,QAAMQ,aAAa,GAAG,qBAAaC,MAAF,IAAc;AAAA;;AAC9C;AACA,UAAM;AAAEC,MAAAA,MAAM,GAAG;AAAX,QAAkBD,MAAM,CAAEE,eAAF,CAAN,CAAoBC,qBAApB,CACvBP,IADuB,EAEvBD,IAFuB,EAGvBG,GAHuB,CAAxB,CAF8C,CAO9C;;AACA,UAAMM,OAAO,GAAGJ,MAAM,CAAEK,kBAAF,CAAN,CAA2BC,eAA3B,aACfL,MAAM,CAAE,CAAF,CADS,6CACf,SAAaM,QADE,CAAhB,CAR8C,CAW9C;;AACA,WAAOH,OAAO,CAAEA,OAAO,CAACI,MAAR,GAAiB,CAAnB,CAAd;AACA,GAbqB,EAanB,EAbmB,CAAtB,CAFG,CAiBH;;AACA,QAAMC,iBAAiB,GAAG,qBACvBT,MAAF,IAAc;AACb,QAAK,eAAeJ,IAAf,IAAuB,kBAAkBD,IAA9C,EAAqD;AACpD,aAAOE,KAAP;AACA;;AAED,UAAMa,QAAQ,GAAGV,MAAM,CAA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AAGG,gBADX;AAEC,IAAA,SAAS,EAAC,0CAFX;AAGC,IAAA,QAAQ,EAAGN;AAHZ,KAKGG,cALH,CARD,CADc,GAiBX,IAzBL,CADD;AA6BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { CheckboxControl, Button, PanelRow } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function EntityRecordItem( {\n\trecord,\n\tchecked,\n\tonChange,\n\tclosePanel,\n} ) {\n\tconst { name, kind, title, key } = record;\n\tconst parentBlockId = useSelect( ( select ) => {\n\t\t// Get entity's blocks.\n\t\tconst { blocks = [] } = select( coreStore ).getEditedEntityRecord(\n\t\t\tkind,\n\t\t\tname,\n\t\t\tkey\n\t\t);\n\t\t// Get parents of the entity's first block.\n\t\tconst parents = select( blockEditorStore ).getBlockParents(\n\t\t\tblocks[ 0 ]?.clientId\n\t\t);\n\t\t// Return closest parent block's clientId.\n\t\treturn parents[ parents.length - 1 ];\n\t}, [] );\n\n\t// Handle templates that might use default descriptive titles\n\tconst entityRecordTitle = useSelect(\n\t\t( select ) => {\n\t\t\tif ( 'postType' !== kind || 'wp_template' !== name ) {\n\t\t\t\treturn title;\n\t\t\t}\n\n\t\t\tconst template = select( coreStore ).getEditedEntityRecord(\n\t\t\t\tkind,\n\t\t\t\tname,\n\t\t\t\tkey\n\t\t\t);\n\t\t\treturn select( editorStore ).__experimentalGetTemplateInfo(\n\t\t\t\ttemplate\n\t\t\t).title;\n\t\t},\n\t\t[ name, kind, title, key ]\n\t);\n\n\tconst isSelected = useSelect(\n\t\t( select ) => {\n\t\t\tconst selectedBlockId = select(\n\t\t\t\tblockEditorStore\n\t\t\t).getSelectedBlockClientId();\n\t\t\treturn selectedBlockId === parentBlockId;\n\t\t},\n\t\t[ parentBlockId ]\n\t);\n\tconst isSelectedText = isSelected ? __( 'Selected' ) : __( 'Select' );\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\tconst selectParentBlock = useCallback( () => selectBlock( parentBlockId ), [\n\t\tparentBlockId,\n\t] );\n\tconst selectAndDismiss = useCallback( () => {\n\t\tselectBlock( parentBlockId );\n\t\tclosePanel();\n\t}, [ parentBlockId ] );\n\n\treturn (\n\t\t<PanelRow>\n\t\t\t<CheckboxControl\n\t\t\t\tlabel={\n\t\t\t\t\t<strong>{ entityRecordTitle || __( 'Untitled' ) }</strong>\n\t\t\t\t}\n\t\t\t\tchecked={ checked }\n\t\t\t\tonChange={ onChange }\n\t\t\t/>\n\t\t\t{ parentBlockId ? (\n\t\t\t\t<>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={ selectParentBlock }\n\t\t\t\t\t\tclassName=\"entities-saved-states__find-entity\"\n\t\t\t\t\t\tdisabled={ isSelected }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isSelectedText }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={ selectAndDismiss }\n\t\t\t\t\t\tclassName=\"entities-saved-states__find-entity-small\"\n\t\t\t\t\t\tdisabled={ isSelected }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isSelectedText }\n\t\t\t\t\t</Button>\n\t\t\t\t</>\n\t\t\t) : null }\n\t\t</PanelRow>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/entities-saved-states/entity-record-item.js"],"names":["EntityRecordItem","record","checked","onChange","closePanel","name","kind","title","key","parentBlockId","select","blocks","coreStore","getEditedEntityRecord","parents","blockEditorStore","getBlockParents","clientId","length","entityRecordTitle","template","editorStore","__experimentalGetTemplateInfo","isSelected","selectedBlockId","getSelectedBlockClientId","isSelectedText","selectBlock","selectParentBlock","selectAndDismiss"],"mappings":";;;;;;;AAMA;;AAHA;;AACA;;AACA;;AAE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c,eAAe,GAAGd,MAAM,CAC7BK,kBAD6B,CAAN,CAEtBU,wBAFsB,EAAxB;AAGA,WAAOD,eAAe,KAAKf,aAA3B;AACA,GANiB,EAOlB,CAAEA,aAAF,CAPkB,CAAnB;AASA,QAAMiB,cAAc,GAAGH,UAAU,GAAG,cAAI,UAAJ,CAAH,GAAsB,cAAI,QAAJ,CAAvD;AACA,QAAM;AAAEI,IAAAA;AAAF,MAAkB,uBAAaZ,kBAAb,CAAxB;AACA,QAAMa,iBAAiB,GAAG,0BAAa,MAAMD,WAAW,CAAElB,aAAF,CAA9B,EAAiD,CAC1EA,aAD0E,CAAjD,CAA1B;AAGA,QAAMoB,gBAAgB,GAAG,0BAAa,MAAM;AAC3CF,IAAAA,WAAW,CAAElB,aAAF,CAAX;AACAL,IAAAA,UAAU;AACV,GAHwB,EAGtB,CAAEK,aAAF,CAHsB,CAAzB;AAKA,SACC,4BAAC,oBAAD,QACC,4BAAC,2BAAD;AACC,IAAA,KAAK,EACJ,4CAAUU,iBAAiB,IAAI,cAAI,UAAJ,CAA/B,CAFF;AAIC,IAAA,OAAO,EAAGjB,OAJX;AAKC,IAAA,QAAQ,EAAGC;AALZ,IADD,EAQGM,aAAa,GACd,qDACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGmB,iBADX;AAEC,IAAA,SAAS,EAAC,oCAFX;AAGC,IAAA,QAAQ,EAAGL;AAHZ,KAKGG,cALH,CADD,EAQC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGG,gBADX;AAEC,IAAA,SAAS,EAAC,0CAFX;AAGC,IAAA,QAAQ,EAAGN;AAHZ,KAKGG,cALH,CARD,CADc,GAiBX,IAzBL,CADD;AA6BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { CheckboxControl, Button, PanelRow } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nexport default function EntityRecordItem( {\n\trecord,\n\tchecked,\n\tonChange,\n\tclosePanel,\n} ) {\n\tconst { name, kind, title, key } = record;\n\tconst parentBlockId = useSelect( ( select ) => {\n\t\t// Get entity's blocks.\n\t\tconst { blocks = [] } = select( coreStore ).getEditedEntityRecord(\n\t\t\tkind,\n\t\t\tname,\n\t\t\tkey\n\t\t);\n\t\t// Get parents of the entity's first block.\n\t\tconst parents = select( blockEditorStore ).getBlockParents(\n\t\t\tblocks[ 0 ]?.clientId\n\t\t);\n\t\t// Return closest parent block's clientId.\n\t\treturn parents[ parents.length - 1 ];\n\t}, [] );\n\n\t// Handle templates that might use default descriptive titles\n\tconst entityRecordTitle = useSelect(\n\t\t( select ) => {\n\t\t\tif ( 'postType' !== kind || 'wp_template' !== name ) {\n\t\t\t\treturn title;\n\t\t\t}\n\n\t\t\tconst template = select( coreStore ).getEditedEntityRecord(\n\t\t\t\tkind,\n\t\t\t\tname,\n\t\t\t\tkey\n\t\t\t);\n\t\t\treturn select( editorStore ).__experimentalGetTemplateInfo(\n\t\t\t\ttemplate\n\t\t\t).title;\n\t\t},\n\t\t[ name, kind, title, key ]\n\t);\n\n\tconst isSelected = useSelect(\n\t\t( select ) => {\n\t\t\tconst selectedBlockId = select(\n\t\t\t\tblockEditorStore\n\t\t\t).getSelectedBlockClientId();\n\t\t\treturn selectedBlockId === parentBlockId;\n\t\t},\n\t\t[ parentBlockId ]\n\t);\n\tconst isSelectedText = isSelected ? __( 'Selected' ) : __( 'Select' );\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\tconst selectParentBlock = useCallback( () => selectBlock( parentBlockId ), [\n\t\tparentBlockId,\n\t] );\n\tconst selectAndDismiss = useCallback( () => {\n\t\tselectBlock( parentBlockId );\n\t\tclosePanel();\n\t}, [ parentBlockId ] );\n\n\treturn (\n\t\t<PanelRow>\n\t\t\t<CheckboxControl\n\t\t\t\tlabel={\n\t\t\t\t\t<strong>{ entityRecordTitle || __( 'Untitled' ) }</strong>\n\t\t\t\t}\n\t\t\t\tchecked={ checked }\n\t\t\t\tonChange={ onChange }\n\t\t\t/>\n\t\t\t{ parentBlockId ? (\n\t\t\t\t<>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={ selectParentBlock }\n\t\t\t\t\t\tclassName=\"entities-saved-states__find-entity\"\n\t\t\t\t\t\tdisabled={ isSelected }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isSelectedText }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={ selectAndDismiss }\n\t\t\t\t\t\tclassName=\"entities-saved-states__find-entity-small\"\n\t\t\t\t\t\tdisabled={ isSelected }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isSelectedText }\n\t\t\t\t\t</Button>\n\t\t\t\t</>\n\t\t\t) : null }\n\t\t</PanelRow>\n\t);\n}\n"]}
@@ -11,12 +11,12 @@ var _element = require("@wordpress/element");
11
11
 
12
12
  var _lodash = require("lodash");
13
13
 
14
+ var _i18n = require("@wordpress/i18n");
15
+
14
16
  var _data = require("@wordpress/data");
15
17
 
16
18
  var _components = require("@wordpress/components");
17
19
 
18
- var _icons = require("@wordpress/icons");
19
-
20
20
  var _coreData = require("@wordpress/core-data");
21
21
 
22
22
  var _entityRecordItem = _interopRequireDefault(require("./entity-record-item"));
@@ -32,29 +32,39 @@ var _entityRecordItem = _interopRequireDefault(require("./entity-record-item"));
32
32
  /**
33
33
  * Internal dependencies
34
34
  */
35
- const ENTITY_NAME_ICONS = {
36
- site: _icons.layout,
37
- page: _icons.page
38
- };
39
-
40
- function EntityTypeList({
41
- list,
42
- unselectedEntities,
43
- setUnselectedEntities,
44
- closePanel
45
- }) {
46
- const firstRecord = list[0];
47
- const entity = (0, _data.useSelect)(select => select(_coreData.store).getEntity(firstRecord.kind, firstRecord.name), [firstRecord.kind, firstRecord.name]); // Set icon based on type of entity.
35
+ function getEntityDescription(entity, length) {
36
+ switch (entity) {
37
+ case 'site':
38
+ return (0, _i18n._n)('This change will affect your whole site.', 'These changes will affect your whole site.', length);
39
+
40
+ case 'wp_template':
41
+ return (0, _i18n._n)('This change will affect pages and posts that use this template.', 'These changes will affect pages and posts that use these templates.', length);
48
42
 
43
+ case 'page':
44
+ case 'post':
45
+ return (0, _i18n.__)('The following content has been modified.');
46
+ }
47
+ }
48
+
49
+ function EntityTypeList(_ref) {
50
+ let {
51
+ list,
52
+ unselectedEntities,
53
+ setUnselectedEntities,
54
+ closePanel
55
+ } = _ref;
56
+ const firstRecord = list[0];
57
+ const entity = (0, _data.useSelect)(select => select(_coreData.store).getEntity(firstRecord.kind, firstRecord.name), [firstRecord.kind, firstRecord.name]);
49
58
  const {
50
59
  name
51
60
  } = firstRecord;
52
- const icon = ENTITY_NAME_ICONS[name];
61
+ const entityLabel = name === 'wp_template_part' ? (0, _i18n._n)('Template Part', 'Template Parts', list.length) : entity.label; // Set description based on type of entity.
62
+
63
+ const description = getEntityDescription(name, list.length);
53
64
  return (0, _element.createElement)(_components.PanelBody, {
54
- title: entity.label,
55
- initialOpen: true,
56
- icon: icon
57
- }, list.map(record => {
65
+ title: entityLabel,
66
+ initialOpen: true
67
+ }, description && (0, _element.createElement)(_components.PanelRow, null, description), list.map(record => {
58
68
  return (0, _element.createElement)(_entityRecordItem.default, {
59
69
  key: record.key || record.property,
60
70
  record: record,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/entities-saved-states/entity-type-list.js"],"names":["ENTITY_NAME_ICONS","site","layout","page","EntityTypeList","list","unselectedEntities","setUnselectedEntities","closePanel","firstRecord","entity","select","coreStore","getEntity","kind","name","icon","label","map","record","key","property","elt","value"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAGA,MAAMA,iBAAiB,GAAG;A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I,KAAV,CAdvB;AAgBC,MAAA,UAAU,EAAGf;AAhBd,MADD;AAoBA,GArBC,CADH,CADD;AA0BA","sourcesContent":["/**\n * External dependencies\n */\nimport { some } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody } from '@wordpress/components';\nimport { page, layout } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport EntityRecordItem from './entity-record-item';\n\nconst ENTITY_NAME_ICONS = {\n\tsite: layout,\n\tpage,\n};\n\nexport default function EntityTypeList( {\n\tlist,\n\tunselectedEntities,\n\tsetUnselectedEntities,\n\tclosePanel,\n} ) {\n\tconst firstRecord = list[ 0 ];\n\tconst entity = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntity( firstRecord.kind, firstRecord.name ),\n\t\t[ firstRecord.kind, firstRecord.name ]\n\t);\n\n\t// Set icon based on type of entity.\n\tconst { name } = firstRecord;\n\tconst icon = ENTITY_NAME_ICONS[ name ];\n\n\treturn (\n\t\t<PanelBody title={ entity.label } initialOpen={ true } icon={ icon }>\n\t\t\t{ list.map( ( record ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityRecordItem\n\t\t\t\t\t\tkey={ record.key || record.property }\n\t\t\t\t\t\trecord={ record }\n\t\t\t\t\t\tchecked={\n\t\t\t\t\t\t\t! some(\n\t\t\t\t\t\t\t\tunselectedEntities,\n\t\t\t\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\t\t\t\telt.kind === record.kind &&\n\t\t\t\t\t\t\t\t\telt.name === record.name &&\n\t\t\t\t\t\t\t\t\telt.key === record.key &&\n\t\t\t\t\t\t\t\t\telt.property === record.property\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetUnselectedEntities( record, value )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclosePanel={ closePanel }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</PanelBody>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/entities-saved-states/entity-type-list.js"],"names":["getEntityDescription","entity","length","EntityTypeList","list","unselectedEntities","setUnselectedEntities","closePanel","firstRecord","select","coreStore","getEntity","kind","name","entityLabel","label","description","map","record","key","property","elt","value"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AAKA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AAGA,SAASA,oBAAT,CAA+BC,MAA/B,EAAuCC,MAAvC,EAAgD;AAC/C,UAASD,MAAT;AACC,SAAK,MAAL;AACC,aAAO,cACN,0CADM,EAEN,4CAFM,EAGNC,MAHM,CAAP;;AAKD,SAAK,aAAL;AACC,aAAO,cACN,iEADM,EAEN,qEAFM,EAGNA,MAHM,CAAP;;AAKD,SAAK,MAAL;AACA,SAAK,MAAL;AACC,aAAO,cAAI,0CAAJ,CAAP;AAfF;AAiBA;;AAEc,SAASC,cAAT,OAKX;AAAA,MALoC;AACvCC,IAAAA,IADuC;AAEvCC,IAAAA,kBAFuC;AAGvCC,IAAAA,qBAHuC;AAIvCC,IAAAA;AAJuC,GAKpC;AACH,QAAMC,WAAW,GAAGJ,IAAI,CAAE,CAAF,CAAxB;AACA,QAAMH,MAAM,GAAG,qBACZQ,MAAF,IACCA,MAAM,CAAEC,eAAF,CAAN,CAAoBC,SAApB,CAA+BH,WAAW,CAACI,IAA3C,EAAiDJ,WAAW,CAACK,IAA7D,CAFa,EAGd,CAAEL,WAAW,CAACI,IAAd,EAAoBJ,WAAW,CAACK,IAAhC,CAHc,CAAf;AAKA,QAAM;AAAEA,IAAAA;AAAF,MAAWL,WAAjB;AACA,QAAMM,WAAW,GAChBD,IAAI,KAAK,kBAAT,GACG,cAAI,eAAJ,EAAqB,gBAArB,EAAuCT,IAAI,CAACF,MAA5C,CADH,GAEGD,MAAM,CAACc,KAHX,CARG,CAYH;;AACA,QAAMC,WAAW,GAAGhB,oBAAoB,CAAEa,IAAF,EAAQT,IAAI,CAACF,MAAb,CAAxC;AAEA,SACC,4BAAC,qBAAD;AAAW,IAAA,KAAK,EAAGY,WAAnB;AAAiC,IAAA,WAAW,EAAG;AAA/C,KACGE,WAAW,IAAI,4BAAC,oBAAD,QAAYA,WAAZ,CADlB,EAEGZ,IAAI,CAACa,GAAL,CAAYC,MAAF,IAAc;AACzB,WACC,4BAAC,yBAAD;AACC,MAAA,GAAG,EAAGA,MAAM,CAACC,GAAP,IAAcD,MAAM,CAACE,QAD5B;AAEC,MAAA,MAAM,EAAGF,MAFV;AAGC,MAAA,OAAO,EACN,CAAE,kBACDb,kBADC,EAECgB,GAAF,IACCA,GAAG,CAACT,IAAJ,KAAaM,MAAM,CAACN,IAApB,IACAS,GAAG,CAACR,IAAJ,KAAaK,MAAM,CAACL,IADpB,IAEAQ,GAAG,CAACF,GAAJ,KAAYD,MAAM,CAACC,GAFnB,IAGAE,GAAG,CAACD,QAAJ,KAAiBF,MAAM,CAACE,QANxB,CAJJ;AAaC,MAAA,QAAQ,EAAKE,KAAF,IACVhB,qBAAqB,CAAEY,MAAF,EAAUI,KAAV,CAdvB;AAgBC,MAAA,UAAU,EAAGf;AAhBd,MADD;AAoBA,GArBC,CAFH,CADD;AA2BA","sourcesContent":["/**\n * External dependencies\n */\nimport { some } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __, _n } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport EntityRecordItem from './entity-record-item';\n\nfunction getEntityDescription( entity, length ) {\n\tswitch ( entity ) {\n\t\tcase 'site':\n\t\t\treturn _n(\n\t\t\t\t'This change will affect your whole site.',\n\t\t\t\t'These changes will affect your whole site.',\n\t\t\t\tlength\n\t\t\t);\n\t\tcase 'wp_template':\n\t\t\treturn _n(\n\t\t\t\t'This change will affect pages and posts that use this template.',\n\t\t\t\t'These changes will affect pages and posts that use these templates.',\n\t\t\t\tlength\n\t\t\t);\n\t\tcase 'page':\n\t\tcase 'post':\n\t\t\treturn __( 'The following content has been modified.' );\n\t}\n}\n\nexport default function EntityTypeList( {\n\tlist,\n\tunselectedEntities,\n\tsetUnselectedEntities,\n\tclosePanel,\n} ) {\n\tconst firstRecord = list[ 0 ];\n\tconst entity = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).getEntity( firstRecord.kind, firstRecord.name ),\n\t\t[ firstRecord.kind, firstRecord.name ]\n\t);\n\tconst { name } = firstRecord;\n\tconst entityLabel =\n\t\tname === 'wp_template_part'\n\t\t\t? _n( 'Template Part', 'Template Parts', list.length )\n\t\t\t: entity.label;\n\t// Set description based on type of entity.\n\tconst description = getEntityDescription( name, list.length );\n\n\treturn (\n\t\t<PanelBody title={ entityLabel } initialOpen={ true }>\n\t\t\t{ description && <PanelRow>{ description }</PanelRow> }\n\t\t\t{ list.map( ( record ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityRecordItem\n\t\t\t\t\t\tkey={ record.key || record.property }\n\t\t\t\t\t\trecord={ record }\n\t\t\t\t\t\tchecked={\n\t\t\t\t\t\t\t! some(\n\t\t\t\t\t\t\t\tunselectedEntities,\n\t\t\t\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\t\t\t\telt.kind === record.kind &&\n\t\t\t\t\t\t\t\t\telt.name === record.name &&\n\t\t\t\t\t\t\t\t\telt.key === record.key &&\n\t\t\t\t\t\t\t\t\telt.property === record.property\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\tsetUnselectedEntities( record, value )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclosePanel={ closePanel }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</PanelBody>\n\t);\n}\n"]}
@@ -38,17 +38,22 @@ var _entityTypeList = _interopRequireDefault(require("./entity-type-list"));
38
38
  /**
39
39
  * Internal dependencies
40
40
  */
41
- const TRANSLATED_SITE_PROTPERTIES = {
41
+ const TRANSLATED_SITE_PROPERTIES = {
42
42
  title: (0, _i18n.__)('Title'),
43
43
  description: (0, _i18n.__)('Tagline'),
44
44
  site_logo: (0, _i18n.__)('Logo'),
45
45
  show_on_front: (0, _i18n.__)('Show on front'),
46
46
  page_on_front: (0, _i18n.__)('Page on front')
47
47
  };
48
-
49
- function EntitiesSavedStates({
50
- close
51
- }) {
48
+ const PUBLISH_ON_SAVE_ENTITIES = [{
49
+ kind: 'postType',
50
+ name: 'wp_navigation'
51
+ }];
52
+
53
+ function EntitiesSavedStates(_ref) {
54
+ let {
55
+ close
56
+ } = _ref;
52
57
  const saveButtonRef = (0, _element.useRef)();
53
58
  const {
54
59
  dirtyEntityRecords
@@ -64,7 +69,7 @@ function EntitiesSavedStates({
64
69
  siteEditsAsEntities.push({
65
70
  kind: 'root',
66
71
  name: 'site',
67
- title: TRANSLATED_SITE_PROTPERTIES[property] || property,
72
+ title: TRANSLATED_SITE_PROPERTIES[property] || property,
68
73
  property
69
74
  });
70
75
  }
@@ -75,20 +80,31 @@ function EntitiesSavedStates({
75
80
  };
76
81
  }, []);
77
82
  const {
83
+ editEntityRecord,
78
84
  saveEditedEntityRecord,
79
85
  __experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits
80
86
  } = (0, _data.useDispatch)(_coreData.store); // To group entities by type.
81
87
 
82
- const partitionedSavables = Object.values((0, _lodash.groupBy)(dirtyEntityRecords, 'name')); // Unchecked entities to be ignored by save function.
88
+ const partitionedSavables = (0, _lodash.groupBy)(dirtyEntityRecords, 'name'); // Sort entity groups.
89
+
90
+ const {
91
+ site: siteSavables,
92
+ wp_template: templateSavables,
93
+ wp_template_part: templatePartSavables,
94
+ ...contentSavables
95
+ } = partitionedSavables;
96
+ const sortedPartitionedSavables = [siteSavables, templateSavables, templatePartSavables, ...Object.values(contentSavables)].filter(Array.isArray); // Unchecked entities to be ignored by save function.
83
97
 
84
98
  const [unselectedEntities, _setUnselectedEntities] = (0, _element.useState)([]);
85
99
 
86
- const setUnselectedEntities = ({
87
- kind,
88
- name,
89
- key,
90
- property
91
- }, checked) => {
100
+ const setUnselectedEntities = (_ref2, checked) => {
101
+ let {
102
+ kind,
103
+ name,
104
+ key,
105
+ property
106
+ } = _ref2;
107
+
92
108
  if (checked) {
93
109
  _setUnselectedEntities(unselectedEntities.filter(elt => elt.kind !== kind || elt.name !== name || elt.key !== key || elt.property !== property));
94
110
  } else {
@@ -102,25 +118,34 @@ function EntitiesSavedStates({
102
118
  };
103
119
 
104
120
  const saveCheckedEntities = () => {
105
- const entitiesToSave = dirtyEntityRecords.filter(({
106
- kind,
107
- name,
108
- key,
109
- property
110
- }) => {
121
+ const entitiesToSave = dirtyEntityRecords.filter(_ref3 => {
122
+ let {
123
+ kind,
124
+ name,
125
+ key,
126
+ property
127
+ } = _ref3;
111
128
  return !(0, _lodash.some)(unselectedEntities, elt => elt.kind === kind && elt.name === name && elt.key === key && elt.property === property);
112
129
  });
113
130
  close(entitiesToSave);
114
131
  const siteItemsToSave = [];
115
- entitiesToSave.forEach(({
116
- kind,
117
- name,
118
- key,
119
- property
120
- }) => {
132
+ entitiesToSave.forEach(_ref4 => {
133
+ let {
134
+ kind,
135
+ name,
136
+ key,
137
+ property
138
+ } = _ref4;
139
+
121
140
  if ('root' === kind && 'site' === name) {
122
141
  siteItemsToSave.push(property);
123
142
  } else {
143
+ if (PUBLISH_ON_SAVE_ENTITIES.some(typeToPublish => typeToPublish.kind === kind && typeToPublish.name === name)) {
144
+ editEntityRecord(kind, name, key, {
145
+ status: 'publish'
146
+ });
147
+ }
148
+
124
149
  saveEditedEntityRecord(kind, name, key);
125
150
  }
126
151
  });
@@ -151,7 +176,7 @@ function EntitiesSavedStates({
151
176
  label: (0, _i18n.__)('Close panel')
152
177
  })), (0, _element.createElement)("div", {
153
178
  className: "entities-saved-states__text-prompt"
154
- }, (0, _element.createElement)("strong", null, (0, _i18n.__)('Select the changes you want to save')), (0, _element.createElement)("p", null, (0, _i18n.__)('Some changes may affect other areas of your site.'))), partitionedSavables.map(list => {
179
+ }, (0, _element.createElement)("strong", null, (0, _i18n.__)('Are you ready to save?')), (0, _element.createElement)("p", null, (0, _i18n.__)('The following changes have been made to your site, templates, and content.'))), sortedPartitionedSavables.map(list => {
155
180
  return (0, _element.createElement)(_entityTypeList.default, {
156
181
  key: list[0].name,
157
182
  list: list,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/editor/src/components/entities-saved-states/index.js"],"names":["TRANSLATED_SITE_PROTPERTIES","title","description","site_logo","show_on_front","page_on_front","EntitiesSavedStates","close","saveButtonRef","dirtyEntityRecords","select","dirtyRecords","coreStore","__experimentalGetDirtyEntityRecords","dirtyRecordsWithoutSite","filter","record","kind","name","siteEdits","getEntityRecordEdits","siteEditsAsEntities","property","push","dirtyRecordsWithSiteItems","saveEditedEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","partitionedSavables","Object","values","unselectedEntities","_setUnselectedEntities","setUnselectedEntities","key","checked","elt","saveCheckedEntities","entitiesToSave","siteItemsToSave","forEach","undefined","dismissPanel","saveDialogRef","saveDialogProps","onClose","length","closeIcon","map","list"],"mappings":";;;;;;;;;AAWA;;;;AARA;;AAKA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAKA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AAGA,MAAMA,2BAA2B,GAAG;AACnCC,EAAAA,KAAK,EAAE,cAAI,OAAJ,CAD4B;AAEnCC,EAAAA,WAAW,EAAE,cAAI,SAAJ,CAFsB;AAGnCC,EAAAA,SAAS,EAAE,cAAI,MAAJ,CAHwB;AAInCC,EAAAA,aAAa,EAAE,cAAI,eAAJ,CAJoB;AAKnCC,EAAAA,aAAa,EAAE,cAAI,eAAJ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mDADC,CADH,CAFD,CA1BD,EAmCGd,mBAAmB,CAACoB,GAApB,CAA2BC,IAAF,IAAY;AACtC,WACC,4BAAC,uBAAD;AACC,MAAA,GAAG,EAAGA,IAAI,CAAE,CAAF,CAAJ,CAAU/B,IADjB;AAEC,MAAA,IAAI,EAAG+B,IAFR;AAGC,MAAA,UAAU,EAAGP,YAHd;AAIC,MAAA,kBAAkB,EAAGX,kBAJtB;AAKC,MAAA,qBAAqB,EAAGE;AALzB,MADD;AASA,GAVC,CAnCH,CADD;AAiDA","sourcesContent":["/**\n * External dependencies\n */\nimport { some, groupBy } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useState, useCallback, useRef } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalUseDialog as useDialog } from '@wordpress/compose';\nimport { close as closeIcon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport EntityTypeList from './entity-type-list';\n\nconst TRANSLATED_SITE_PROTPERTIES = {\n\ttitle: __( 'Title' ),\n\tdescription: __( 'Tagline' ),\n\tsite_logo: __( 'Logo' ),\n\tshow_on_front: __( 'Show on front' ),\n\tpage_on_front: __( 'Page on front' ),\n};\n\nexport default function EntitiesSavedStates( { close } ) {\n\tconst saveButtonRef = useRef();\n\tconst { dirtyEntityRecords } = useSelect( ( select ) => {\n\t\tconst dirtyRecords = select(\n\t\t\tcoreStore\n\t\t).__experimentalGetDirtyEntityRecords();\n\n\t\t// Remove site object and decouple into its edited pieces.\n\t\tconst dirtyRecordsWithoutSite = dirtyRecords.filter(\n\t\t\t( record ) => ! ( record.kind === 'root' && record.name === 'site' )\n\t\t);\n\n\t\tconst siteEdits = select( coreStore ).getEntityRecordEdits(\n\t\t\t'root',\n\t\t\t'site'\n\t\t);\n\n\t\tconst siteEditsAsEntities = [];\n\t\tfor ( const property in siteEdits ) {\n\t\t\tsiteEditsAsEntities.push( {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t\ttitle: TRANSLATED_SITE_PROTPERTIES[ property ] || property,\n\t\t\t\tproperty,\n\t\t\t} );\n\t\t}\n\t\tconst dirtyRecordsWithSiteItems = [\n\t\t\t...dirtyRecordsWithoutSite,\n\t\t\t...siteEditsAsEntities,\n\t\t];\n\n\t\treturn {\n\t\t\tdirtyEntityRecords: dirtyRecordsWithSiteItems,\n\t\t};\n\t}, [] );\n\tconst {\n\t\tsaveEditedEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\t// To group entities by type.\n\tconst partitionedSavables = Object.values(\n\t\tgroupBy( dirtyEntityRecords, 'name' )\n\t);\n\n\t// Unchecked entities to be ignored by save function.\n\tconst [ unselectedEntities, _setUnselectedEntities ] = useState( [] );\n\n\tconst setUnselectedEntities = (\n\t\t{ kind, name, key, property },\n\t\tchecked\n\t) => {\n\t\tif ( checked ) {\n\t\t\t_setUnselectedEntities(\n\t\t\t\tunselectedEntities.filter(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind !== kind ||\n\t\t\t\t\t\telt.name !== name ||\n\t\t\t\t\t\telt.key !== key ||\n\t\t\t\t\t\telt.property !== property\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t_setUnselectedEntities( [\n\t\t\t\t...unselectedEntities,\n\t\t\t\t{ kind, name, key, property },\n\t\t\t] );\n\t\t}\n\t};\n\n\tconst saveCheckedEntities = () => {\n\t\tconst entitiesToSave = dirtyEntityRecords.filter(\n\t\t\t( { kind, name, key, property } ) => {\n\t\t\t\treturn ! some(\n\t\t\t\t\tunselectedEntities,\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind === kind &&\n\t\t\t\t\t\telt.name === name &&\n\t\t\t\t\t\telt.key === key &&\n\t\t\t\t\t\telt.property === property\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\tclose( entitiesToSave );\n\n\t\tconst siteItemsToSave = [];\n\t\tentitiesToSave.forEach( ( { kind, name, key, property } ) => {\n\t\t\tif ( 'root' === kind && 'site' === name ) {\n\t\t\t\tsiteItemsToSave.push( property );\n\t\t\t} else {\n\t\t\t\tsaveEditedEntityRecord( kind, name, key );\n\t\t\t}\n\t\t} );\n\t\tsaveSpecifiedEntityEdits( 'root', 'site', undefined, siteItemsToSave );\n\t};\n\n\t// Explicitly define this with no argument passed. Using `close` on\n\t// its own will use the event object in place of the expected saved entities.\n\tconst dismissPanel = useCallback( () => close(), [ close ] );\n\n\tconst [ saveDialogRef, saveDialogProps ] = useDialog( {\n\t\tonClose: () => dismissPanel(),\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tref={ saveDialogRef }\n\t\t\t{ ...saveDialogProps }\n\t\t\tclassName=\"entities-saved-states__panel\"\n\t\t>\n\t\t\t<div className=\"entities-saved-states__panel-header\">\n\t\t\t\t<Button\n\t\t\t\t\tref={ saveButtonRef }\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tdisabled={\n\t\t\t\t\t\tdirtyEntityRecords.length -\n\t\t\t\t\t\t\tunselectedEntities.length ===\n\t\t\t\t\t\t0\n\t\t\t\t\t}\n\t\t\t\t\tonClick={ saveCheckedEntities }\n\t\t\t\t\tclassName=\"editor-entities-saved-states__save-button\"\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t</Button>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeIcon }\n\t\t\t\t\tonClick={ dismissPanel }\n\t\t\t\t\tlabel={ __( 'Close panel' ) }\n\t\t\t\t/>\n\t\t\t</div>\n\n\t\t\t<div className=\"entities-saved-states__text-prompt\">\n\t\t\t\t<strong>{ __( 'Select the changes you want to save' ) }</strong>\n\t\t\t\t<p>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Some changes may affect other areas of your site.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t</div>\n\n\t\t\t{ partitionedSavables.map( ( list ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityTypeList\n\t\t\t\t\t\tkey={ list[ 0 ].name }\n\t\t\t\t\t\tlist={ list }\n\t\t\t\t\t\tclosePanel={ dismissPanel }\n\t\t\t\t\t\tunselectedEntities={ unselectedEntities }\n\t\t\t\t\t\tsetUnselectedEntities={ setUnselectedEntities }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/editor/src/components/entities-saved-states/index.js"],"names":["TRANSLATED_SITE_PROPERTIES","title","description","site_logo","show_on_front","page_on_front","PUBLISH_ON_SAVE_ENTITIES","kind","name","EntitiesSavedStates","close","saveButtonRef","dirtyEntityRecords","select","dirtyRecords","coreStore","__experimentalGetDirtyEntityRecords","dirtyRecordsWithoutSite","filter","record","siteEdits","getEntityRecordEdits","siteEditsAsEntities","property","push","dirtyRecordsWithSiteItems","editEntityRecord","saveEditedEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","partitionedSavables","site","siteSavables","wp_template","templateSavables","wp_template_part","templatePartSavables","contentSavables","sortedPartitionedSavables","Object","values","Array","isArray","unselectedEntities","_setUnselectedEntities","setUnselectedEntities","checked","key","elt","saveCheckedEntities","entitiesToSave","siteItemsToSave","forEach","some","typeToPublish","status","undefined","dismissPanel","saveDialogRef","saveDialogProps","onClose","length","closeIcon","map","list"],"mappings":";;;;;;;;;AAWA;;;;AARA;;AAKA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAKA;;AAnBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;AAGA,MAAMA,0BAA0B,GAAG;AAClCC,EAAAA,KAAK,EAAE,cAAI,OAAJ,CAD2B;AAElCC,EAAAA,WAAW,EAAE,cAAI,SAAJ,CAFqB;AAGlCC,EAAAA,SAAS,EAAE,cAAI,MAAJ,CAHu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';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useState, useCallback, useRef } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalUseDialog as useDialog } from '@wordpress/compose';\nimport { close as closeIcon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport EntityTypeList from './entity-type-list';\n\nconst TRANSLATED_SITE_PROPERTIES = {\n\ttitle: __( 'Title' ),\n\tdescription: __( 'Tagline' ),\n\tsite_logo: __( 'Logo' ),\n\tshow_on_front: __( 'Show on front' ),\n\tpage_on_front: __( 'Page on front' ),\n};\n\nconst PUBLISH_ON_SAVE_ENTITIES = [\n\t{\n\t\tkind: 'postType',\n\t\tname: 'wp_navigation',\n\t},\n];\n\nexport default function EntitiesSavedStates( { close } ) {\n\tconst saveButtonRef = useRef();\n\tconst { dirtyEntityRecords } = useSelect( ( select ) => {\n\t\tconst dirtyRecords = select(\n\t\t\tcoreStore\n\t\t).__experimentalGetDirtyEntityRecords();\n\n\t\t// Remove site object and decouple into its edited pieces.\n\t\tconst dirtyRecordsWithoutSite = dirtyRecords.filter(\n\t\t\t( record ) => ! ( record.kind === 'root' && record.name === 'site' )\n\t\t);\n\n\t\tconst siteEdits = select( coreStore ).getEntityRecordEdits(\n\t\t\t'root',\n\t\t\t'site'\n\t\t);\n\n\t\tconst siteEditsAsEntities = [];\n\t\tfor ( const property in siteEdits ) {\n\t\t\tsiteEditsAsEntities.push( {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t\ttitle: TRANSLATED_SITE_PROPERTIES[ property ] || property,\n\t\t\t\tproperty,\n\t\t\t} );\n\t\t}\n\t\tconst dirtyRecordsWithSiteItems = [\n\t\t\t...dirtyRecordsWithoutSite,\n\t\t\t...siteEditsAsEntities,\n\t\t];\n\n\t\treturn {\n\t\t\tdirtyEntityRecords: dirtyRecordsWithSiteItems,\n\t\t};\n\t}, [] );\n\tconst {\n\t\teditEntityRecord,\n\t\tsaveEditedEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\t// To group entities by type.\n\tconst partitionedSavables = groupBy( dirtyEntityRecords, 'name' );\n\n\t// Sort entity groups.\n\tconst {\n\t\tsite: siteSavables,\n\t\twp_template: templateSavables,\n\t\twp_template_part: templatePartSavables,\n\t\t...contentSavables\n\t} = partitionedSavables;\n\tconst sortedPartitionedSavables = [\n\t\tsiteSavables,\n\t\ttemplateSavables,\n\t\ttemplatePartSavables,\n\t\t...Object.values( contentSavables ),\n\t].filter( Array.isArray );\n\n\t// Unchecked entities to be ignored by save function.\n\tconst [ unselectedEntities, _setUnselectedEntities ] = useState( [] );\n\n\tconst setUnselectedEntities = (\n\t\t{ kind, name, key, property },\n\t\tchecked\n\t) => {\n\t\tif ( checked ) {\n\t\t\t_setUnselectedEntities(\n\t\t\t\tunselectedEntities.filter(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind !== kind ||\n\t\t\t\t\t\telt.name !== name ||\n\t\t\t\t\t\telt.key !== key ||\n\t\t\t\t\t\telt.property !== property\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t_setUnselectedEntities( [\n\t\t\t\t...unselectedEntities,\n\t\t\t\t{ kind, name, key, property },\n\t\t\t] );\n\t\t}\n\t};\n\n\tconst saveCheckedEntities = () => {\n\t\tconst entitiesToSave = dirtyEntityRecords.filter(\n\t\t\t( { kind, name, key, property } ) => {\n\t\t\t\treturn ! some(\n\t\t\t\t\tunselectedEntities,\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind === kind &&\n\t\t\t\t\t\telt.name === name &&\n\t\t\t\t\t\telt.key === key &&\n\t\t\t\t\t\telt.property === property\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\n\t\tclose( entitiesToSave );\n\n\t\tconst siteItemsToSave = [];\n\t\tentitiesToSave.forEach( ( { kind, name, key, property } ) => {\n\t\t\tif ( 'root' === kind && 'site' === name ) {\n\t\t\t\tsiteItemsToSave.push( property );\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tPUBLISH_ON_SAVE_ENTITIES.some(\n\t\t\t\t\t\t( typeToPublish ) =>\n\t\t\t\t\t\t\ttypeToPublish.kind === kind &&\n\t\t\t\t\t\t\ttypeToPublish.name === name\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\teditEntityRecord( kind, name, key, { status: 'publish' } );\n\t\t\t\t}\n\n\t\t\t\tsaveEditedEntityRecord( kind, name, key );\n\t\t\t}\n\t\t} );\n\t\tsaveSpecifiedEntityEdits( 'root', 'site', undefined, siteItemsToSave );\n\t};\n\n\t// Explicitly define this with no argument passed. Using `close` on\n\t// its own will use the event object in place of the expected saved entities.\n\tconst dismissPanel = useCallback( () => close(), [ close ] );\n\n\tconst [ saveDialogRef, saveDialogProps ] = useDialog( {\n\t\tonClose: () => dismissPanel(),\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\tref={ saveDialogRef }\n\t\t\t{ ...saveDialogProps }\n\t\t\tclassName=\"entities-saved-states__panel\"\n\t\t>\n\t\t\t<div className=\"entities-saved-states__panel-header\">\n\t\t\t\t<Button\n\t\t\t\t\tref={ saveButtonRef }\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tdisabled={\n\t\t\t\t\t\tdirtyEntityRecords.length -\n\t\t\t\t\t\t\tunselectedEntities.length ===\n\t\t\t\t\t\t0\n\t\t\t\t\t}\n\t\t\t\t\tonClick={ saveCheckedEntities }\n\t\t\t\t\tclassName=\"editor-entities-saved-states__save-button\"\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t</Button>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ closeIcon }\n\t\t\t\t\tonClick={ dismissPanel }\n\t\t\t\t\tlabel={ __( 'Close panel' ) }\n\t\t\t\t/>\n\t\t\t</div>\n\n\t\t\t<div className=\"entities-saved-states__text-prompt\">\n\t\t\t\t<strong>{ __( 'Are you ready to save?' ) }</strong>\n\t\t\t\t<p>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'The following changes have been made to your site, templates, and content.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t</div>\n\n\t\t\t{ sortedPartitionedSavables.map( ( list ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<EntityTypeList\n\t\t\t\t\t\tkey={ list[ 0 ].name }\n\t\t\t\t\t\tlist={ list }\n\t\t\t\t\t\tclosePanel={ dismissPanel }\n\t\t\t\t\t\tunselectedEntities={ unselectedEntities }\n\t\t\t\t\t\tsetUnselectedEntities={ setUnselectedEntities }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n"]}
@@ -26,10 +26,11 @@ var _store = require("../../store");
26
26
  /**
27
27
  * Internal dependencies
28
28
  */
29
- function CopyButton({
30
- text,
31
- children
32
- }) {
29
+ function CopyButton(_ref) {
30
+ let {
31
+ text,
32
+ children
33
+ } = _ref;
33
34
  const ref = (0, _compose.useCopyToClipboard)(text);
34
35
  return (0, _element.createElement)(_components.Button, {
35
36
  variant: "secondary",