@wordpress/edit-site 6.13.1-next.cd6172eb0.0 → 6.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (480) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/LICENSE.md +1 -1
  3. package/build/components/add-new-pattern/index.js +7 -10
  4. package/build/components/add-new-pattern/index.js.map +1 -1
  5. package/build/components/add-new-post/index.js +1 -1
  6. package/build/components/add-new-post/index.js.map +1 -1
  7. package/build/components/add-new-template/add-custom-template-modal-content.js +1 -0
  8. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  9. package/build/components/add-new-template/index.js +1 -0
  10. package/build/components/add-new-template/index.js.map +1 -1
  11. package/build/components/add-new-template/utils.js +1 -0
  12. package/build/components/add-new-template/utils.js.map +1 -1
  13. package/build/components/editor/index.js +1 -9
  14. package/build/components/editor/index.js.map +1 -1
  15. package/build/components/editor-canvas-container/index.js +1 -0
  16. package/build/components/editor-canvas-container/index.js.map +1 -1
  17. package/build/components/global-styles/confirm-reset-shadow-dialog.js +39 -0
  18. package/build/components/global-styles/confirm-reset-shadow-dialog.js.map +1 -0
  19. package/build/components/global-styles/font-families.js +1 -0
  20. package/build/components/global-styles/font-families.js.map +1 -1
  21. package/build/components/global-styles/font-library-modal/context.js +1 -0
  22. package/build/components/global-styles/font-library-modal/context.js.map +1 -1
  23. package/build/components/global-styles/font-library-modal/font-collection.js +1 -0
  24. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  25. package/build/components/global-styles/font-library-modal/font-demo.js +1 -0
  26. package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  27. package/build/components/global-styles/font-library-modal/index.js +2 -1
  28. package/build/components/global-styles/font-library-modal/index.js.map +1 -1
  29. package/build/components/global-styles/font-library-modal/installed-fonts.js +1 -0
  30. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  31. package/build/components/global-styles/font-library-modal/library-font-details.js +1 -0
  32. package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  33. package/build/components/global-styles/font-library-modal/upload-fonts.js +1 -0
  34. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  35. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +1 -0
  36. package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  37. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +1 -0
  38. package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  39. package/build/components/global-styles/font-library-modal/utils/index.js +1 -0
  40. package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  41. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +1 -0
  42. package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  43. package/build/components/global-styles/font-library-modal/utils/preview-styles.js +1 -0
  44. package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  45. package/build/components/global-styles/font-library-modal/utils/toggleFont.js +1 -0
  46. package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
  47. package/build/components/global-styles/font-sizes/font-size.js +18 -14
  48. package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
  49. package/build/components/global-styles/font-sizes/font-sizes.js +18 -20
  50. package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -1
  51. package/build/components/global-styles/highlighted-colors.js +1 -0
  52. package/build/components/global-styles/highlighted-colors.js.map +1 -1
  53. package/build/components/global-styles/hooks.js +1 -0
  54. package/build/components/global-styles/hooks.js.map +1 -1
  55. package/build/components/global-styles/palette.js +1 -0
  56. package/build/components/global-styles/palette.js.map +1 -1
  57. package/build/components/global-styles/preset-colors.js +1 -0
  58. package/build/components/global-styles/preset-colors.js.map +1 -1
  59. package/build/components/global-styles/preview-colors.js +2 -2
  60. package/build/components/global-styles/preview-colors.js.map +1 -1
  61. package/build/components/global-styles/preview-styles.js +3 -2
  62. package/build/components/global-styles/preview-styles.js.map +1 -1
  63. package/build/components/global-styles/preview-typography.js +2 -2
  64. package/build/components/global-styles/preview-typography.js.map +1 -1
  65. package/build/components/global-styles/{preview-iframe.js → preview-wrapper.js} +11 -29
  66. package/build/components/global-styles/preview-wrapper.js.map +1 -0
  67. package/build/components/global-styles/screen-block-list.js +1 -0
  68. package/build/components/global-styles/screen-block-list.js.map +1 -1
  69. package/build/components/global-styles/screen-block.js +1 -1
  70. package/build/components/global-styles/screen-block.js.map +1 -1
  71. package/build/components/global-styles/screen-revisions/revisions-buttons.js +1 -0
  72. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  73. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
  74. package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  75. package/build/components/global-styles/shadow-utils.js +1 -0
  76. package/build/components/global-styles/shadow-utils.js.map +1 -1
  77. package/build/components/global-styles/shadows-edit-panel.js +36 -34
  78. package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
  79. package/build/components/global-styles/shadows-panel.js +44 -5
  80. package/build/components/global-styles/shadows-panel.js.map +1 -1
  81. package/build/components/global-styles/style-variations-container.js +1 -0
  82. package/build/components/global-styles/style-variations-container.js.map +1 -1
  83. package/build/components/global-styles/typeset.js +1 -0
  84. package/build/components/global-styles/typeset.js.map +1 -1
  85. package/build/components/global-styles/typography-example.js +8 -1
  86. package/build/components/global-styles/typography-example.js.map +1 -1
  87. package/build/components/global-styles/ui.js +1 -0
  88. package/build/components/global-styles/ui.js.map +1 -1
  89. package/build/components/global-styles/utils.js +1 -0
  90. package/build/components/global-styles/utils.js.map +1 -1
  91. package/build/components/global-styles/variations/variations-color.js +1 -0
  92. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  93. package/build/components/global-styles/variations/variations-panel.js +1 -0
  94. package/build/components/global-styles/variations/variations-panel.js.map +1 -1
  95. package/build/components/global-styles/variations/variations-typography.js +1 -0
  96. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  97. package/build/components/global-styles-renderer/index.js +1 -0
  98. package/build/components/global-styles-renderer/index.js.map +1 -1
  99. package/build/components/layout/index.js +24 -8
  100. package/build/components/layout/index.js.map +1 -1
  101. package/build/components/maybe-editor/index.js +65 -0
  102. package/build/components/maybe-editor/index.js.map +1 -0
  103. package/build/components/media/index.js +1 -0
  104. package/build/components/media/index.js.map +1 -1
  105. package/build/components/page-patterns/fields.js +8 -82
  106. package/build/components/page-patterns/fields.js.map +1 -1
  107. package/build/components/page-patterns/header.js +1 -0
  108. package/build/components/page-patterns/header.js.map +1 -1
  109. package/build/components/page-patterns/index.js +18 -14
  110. package/build/components/page-patterns/index.js.map +1 -1
  111. package/build/components/page-patterns/search-items.js +1 -0
  112. package/build/components/page-patterns/search-items.js.map +1 -1
  113. package/build/components/page-patterns/use-pattern-settings.js +1 -0
  114. package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
  115. package/build/components/page-patterns/use-patterns.js +1 -0
  116. package/build/components/page-patterns/use-patterns.js.map +1 -1
  117. package/build/components/page-templates/fields.js +7 -39
  118. package/build/components/page-templates/fields.js.map +1 -1
  119. package/build/components/page-templates/index.js +38 -41
  120. package/build/components/page-templates/index.js.map +1 -1
  121. package/build/components/post-edit/index.js +16 -8
  122. package/build/components/post-edit/index.js.map +1 -1
  123. package/build/components/post-list/index.js +40 -21
  124. package/build/components/post-list/index.js.map +1 -1
  125. package/build/components/posts-app-routes/index.js +1 -0
  126. package/build/components/posts-app-routes/index.js.map +1 -1
  127. package/build/components/resizable-frame/index.js +9 -1
  128. package/build/components/resizable-frame/index.js.map +1 -1
  129. package/build/components/save-button/index.js +1 -0
  130. package/build/components/save-button/index.js.map +1 -1
  131. package/build/components/save-hub/index.js +1 -0
  132. package/build/components/save-hub/index.js.map +1 -1
  133. package/build/components/save-keyboard-shortcut/index.js +1 -0
  134. package/build/components/save-keyboard-shortcut/index.js.map +1 -1
  135. package/build/components/save-panel/index.js +1 -0
  136. package/build/components/save-panel/index.js.map +1 -1
  137. package/build/components/sidebar/index.js +1 -0
  138. package/build/components/sidebar/index.js.map +1 -1
  139. package/build/components/sidebar-dataviews/custom-dataviews-list.js +6 -7
  140. package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  141. package/build/components/sidebar-dataviews/dataview-item.js +1 -0
  142. package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
  143. package/build/components/sidebar-dataviews/default-views.js +10 -26
  144. package/build/components/sidebar-dataviews/default-views.js.map +1 -1
  145. package/build/components/sidebar-dataviews/index.js +2 -0
  146. package/build/components/sidebar-dataviews/index.js.map +1 -1
  147. package/build/components/sidebar-global-styles-wrapper/index.js +40 -71
  148. package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -1
  149. package/build/components/sidebar-navigation-screen-global-styles/content.js +12 -38
  150. package/build/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
  151. package/build/components/sidebar-navigation-screen-main/index.js +38 -23
  152. package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
  153. package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -0
  154. package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  155. package/build/components/sidebar-navigation-screen-patterns/index.js +1 -4
  156. package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  157. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -0
  158. package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  159. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +1 -0
  160. package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  161. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -0
  162. package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  163. package/build/components/sidebar-navigation-screen-templates-browse/content.js +2 -0
  164. package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  165. package/build/components/site-editor-routes/home.js +4 -2
  166. package/build/components/site-editor-routes/home.js.map +1 -1
  167. package/build/components/site-editor-routes/index.js +3 -1
  168. package/build/components/site-editor-routes/index.js.map +1 -1
  169. package/build/components/site-editor-routes/stylebook.js +37 -0
  170. package/build/components/site-editor-routes/stylebook.js.map +1 -0
  171. package/build/components/site-editor-routes/styles.js +7 -1
  172. package/build/components/site-editor-routes/styles.js.map +1 -1
  173. package/build/components/site-editor-routes/template-item.js +3 -3
  174. package/build/components/site-editor-routes/template-item.js.map +1 -1
  175. package/build/components/site-editor-routes/template-part-item.js +3 -3
  176. package/build/components/site-editor-routes/template-part-item.js.map +1 -1
  177. package/build/components/style-book/categories.js +1 -0
  178. package/build/components/style-book/categories.js.map +1 -1
  179. package/build/components/style-book/color-examples.js +9 -3
  180. package/build/components/style-book/color-examples.js.map +1 -1
  181. package/build/components/style-book/constants.js +36 -3
  182. package/build/components/style-book/constants.js.map +1 -1
  183. package/build/components/style-book/duotone-examples.js +1 -0
  184. package/build/components/style-book/duotone-examples.js.map +1 -1
  185. package/build/components/style-book/examples.js +48 -30
  186. package/build/components/style-book/examples.js.map +1 -1
  187. package/build/components/style-book/index.js +185 -61
  188. package/build/components/style-book/index.js.map +1 -1
  189. package/build/components/style-book/types.js.map +1 -1
  190. package/build/index.js +1 -0
  191. package/build/index.js.map +1 -1
  192. package/build/posts.js +1 -0
  193. package/build/posts.js.map +1 -1
  194. package/build/store/reducer.js +1 -0
  195. package/build/store/reducer.js.map +1 -1
  196. package/build/utils/get-filtered-template-parts.js +1 -0
  197. package/build/utils/get-filtered-template-parts.js.map +1 -1
  198. package/build/utils/set-nested-value.js +1 -0
  199. package/build/utils/set-nested-value.js.map +1 -1
  200. package/build-module/components/add-new-pattern/index.js +7 -10
  201. package/build-module/components/add-new-pattern/index.js.map +1 -1
  202. package/build-module/components/add-new-post/index.js +1 -1
  203. package/build-module/components/add-new-post/index.js.map +1 -1
  204. package/build-module/components/add-new-template/add-custom-template-modal-content.js +1 -0
  205. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  206. package/build-module/components/add-new-template/index.js +1 -0
  207. package/build-module/components/add-new-template/index.js.map +1 -1
  208. package/build-module/components/add-new-template/utils.js +1 -0
  209. package/build-module/components/add-new-template/utils.js.map +1 -1
  210. package/build-module/components/editor/index.js +1 -9
  211. package/build-module/components/editor/index.js.map +1 -1
  212. package/build-module/components/editor-canvas-container/index.js +1 -0
  213. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  214. package/build-module/components/global-styles/confirm-reset-shadow-dialog.js +32 -0
  215. package/build-module/components/global-styles/confirm-reset-shadow-dialog.js.map +1 -0
  216. package/build-module/components/global-styles/font-families.js +1 -0
  217. package/build-module/components/global-styles/font-families.js.map +1 -1
  218. package/build-module/components/global-styles/font-library-modal/context.js +1 -0
  219. package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
  220. package/build-module/components/global-styles/font-library-modal/font-collection.js +1 -0
  221. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  222. package/build-module/components/global-styles/font-library-modal/font-demo.js +1 -0
  223. package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
  224. package/build-module/components/global-styles/font-library-modal/index.js +2 -1
  225. package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
  226. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +1 -0
  227. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  228. package/build-module/components/global-styles/font-library-modal/library-font-details.js +1 -0
  229. package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
  230. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +1 -0
  231. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  232. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +1 -0
  233. package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
  234. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +1 -0
  235. package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
  236. package/build-module/components/global-styles/font-library-modal/utils/index.js +1 -0
  237. package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
  238. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +1 -0
  239. package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
  240. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +1 -0
  241. package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
  242. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +1 -0
  243. package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
  244. package/build-module/components/global-styles/font-sizes/font-size.js +18 -14
  245. package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -1
  246. package/build-module/components/global-styles/font-sizes/font-sizes.js +25 -27
  247. package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
  248. package/build-module/components/global-styles/highlighted-colors.js +1 -0
  249. package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
  250. package/build-module/components/global-styles/hooks.js +1 -0
  251. package/build-module/components/global-styles/hooks.js.map +1 -1
  252. package/build-module/components/global-styles/palette.js +1 -0
  253. package/build-module/components/global-styles/palette.js.map +1 -1
  254. package/build-module/components/global-styles/preset-colors.js +1 -0
  255. package/build-module/components/global-styles/preset-colors.js.map +1 -1
  256. package/build-module/components/global-styles/preview-colors.js +2 -2
  257. package/build-module/components/global-styles/preview-colors.js.map +1 -1
  258. package/build-module/components/global-styles/preview-styles.js +3 -2
  259. package/build-module/components/global-styles/preview-styles.js.map +1 -1
  260. package/build-module/components/global-styles/preview-typography.js +2 -2
  261. package/build-module/components/global-styles/preview-typography.js.map +1 -1
  262. package/build-module/components/global-styles/{preview-iframe.js → preview-wrapper.js} +13 -31
  263. package/build-module/components/global-styles/preview-wrapper.js.map +1 -0
  264. package/build-module/components/global-styles/screen-block-list.js +1 -0
  265. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  266. package/build-module/components/global-styles/screen-block.js +1 -1
  267. package/build-module/components/global-styles/screen-block.js.map +1 -1
  268. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +1 -0
  269. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  270. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
  271. package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
  272. package/build-module/components/global-styles/shadow-utils.js +1 -0
  273. package/build-module/components/global-styles/shadow-utils.js.map +1 -1
  274. package/build-module/components/global-styles/shadows-edit-panel.js +37 -35
  275. package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
  276. package/build-module/components/global-styles/shadows-panel.js +47 -8
  277. package/build-module/components/global-styles/shadows-panel.js.map +1 -1
  278. package/build-module/components/global-styles/style-variations-container.js +1 -0
  279. package/build-module/components/global-styles/style-variations-container.js.map +1 -1
  280. package/build-module/components/global-styles/typeset.js +1 -0
  281. package/build-module/components/global-styles/typeset.js.map +1 -1
  282. package/build-module/components/global-styles/typography-example.js +8 -1
  283. package/build-module/components/global-styles/typography-example.js.map +1 -1
  284. package/build-module/components/global-styles/ui.js +1 -0
  285. package/build-module/components/global-styles/ui.js.map +1 -1
  286. package/build-module/components/global-styles/utils.js +1 -0
  287. package/build-module/components/global-styles/utils.js.map +1 -1
  288. package/build-module/components/global-styles/variations/variations-color.js +1 -0
  289. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  290. package/build-module/components/global-styles/variations/variations-panel.js +1 -0
  291. package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
  292. package/build-module/components/global-styles/variations/variations-typography.js +1 -0
  293. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  294. package/build-module/components/global-styles-renderer/index.js +1 -0
  295. package/build-module/components/global-styles-renderer/index.js.map +1 -1
  296. package/build-module/components/layout/index.js +25 -9
  297. package/build-module/components/layout/index.js.map +1 -1
  298. package/build-module/components/maybe-editor/index.js +59 -0
  299. package/build-module/components/maybe-editor/index.js.map +1 -0
  300. package/build-module/components/media/index.js +1 -0
  301. package/build-module/components/media/index.js.map +1 -1
  302. package/build-module/components/page-patterns/fields.js +10 -84
  303. package/build-module/components/page-patterns/fields.js.map +1 -1
  304. package/build-module/components/page-patterns/header.js +1 -0
  305. package/build-module/components/page-patterns/header.js.map +1 -1
  306. package/build-module/components/page-patterns/index.js +16 -12
  307. package/build-module/components/page-patterns/index.js.map +1 -1
  308. package/build-module/components/page-patterns/search-items.js +1 -0
  309. package/build-module/components/page-patterns/search-items.js.map +1 -1
  310. package/build-module/components/page-patterns/use-pattern-settings.js +1 -0
  311. package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
  312. package/build-module/components/page-patterns/use-patterns.js +1 -0
  313. package/build-module/components/page-patterns/use-patterns.js.map +1 -1
  314. package/build-module/components/page-templates/fields.js +6 -38
  315. package/build-module/components/page-templates/fields.js.map +1 -1
  316. package/build-module/components/page-templates/index.js +37 -40
  317. package/build-module/components/page-templates/index.js.map +1 -1
  318. package/build-module/components/post-edit/index.js +16 -8
  319. package/build-module/components/post-edit/index.js.map +1 -1
  320. package/build-module/components/post-list/index.js +41 -22
  321. package/build-module/components/post-list/index.js.map +1 -1
  322. package/build-module/components/posts-app-routes/index.js +1 -0
  323. package/build-module/components/posts-app-routes/index.js.map +1 -1
  324. package/build-module/components/resizable-frame/index.js +9 -1
  325. package/build-module/components/resizable-frame/index.js.map +1 -1
  326. package/build-module/components/save-button/index.js +1 -0
  327. package/build-module/components/save-button/index.js.map +1 -1
  328. package/build-module/components/save-hub/index.js +1 -0
  329. package/build-module/components/save-hub/index.js.map +1 -1
  330. package/build-module/components/save-keyboard-shortcut/index.js +1 -0
  331. package/build-module/components/save-keyboard-shortcut/index.js.map +1 -1
  332. package/build-module/components/save-panel/index.js +1 -0
  333. package/build-module/components/save-panel/index.js.map +1 -1
  334. package/build-module/components/sidebar/index.js +1 -0
  335. package/build-module/components/sidebar/index.js.map +1 -1
  336. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +6 -7
  337. package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
  338. package/build-module/components/sidebar-dataviews/dataview-item.js +1 -0
  339. package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
  340. package/build-module/components/sidebar-dataviews/default-views.js +10 -26
  341. package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
  342. package/build-module/components/sidebar-dataviews/index.js +2 -0
  343. package/build-module/components/sidebar-dataviews/index.js.map +1 -1
  344. package/build-module/components/sidebar-global-styles-wrapper/index.js +41 -74
  345. package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -1
  346. package/build-module/components/sidebar-navigation-screen-global-styles/content.js +12 -38
  347. package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
  348. package/build-module/components/sidebar-navigation-screen-main/index.js +40 -25
  349. package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
  350. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -0
  351. package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
  352. package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -4
  353. package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
  354. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +1 -0
  355. package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
  356. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +1 -0
  357. package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
  358. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -0
  359. package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
  360. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +2 -0
  361. package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
  362. package/build-module/components/site-editor-routes/home.js +4 -2
  363. package/build-module/components/site-editor-routes/home.js.map +1 -1
  364. package/build-module/components/site-editor-routes/index.js +3 -1
  365. package/build-module/components/site-editor-routes/index.js.map +1 -1
  366. package/build-module/components/site-editor-routes/stylebook.js +29 -0
  367. package/build-module/components/site-editor-routes/stylebook.js.map +1 -0
  368. package/build-module/components/site-editor-routes/styles.js +7 -1
  369. package/build-module/components/site-editor-routes/styles.js.map +1 -1
  370. package/build-module/components/site-editor-routes/template-item.js +3 -3
  371. package/build-module/components/site-editor-routes/template-item.js.map +1 -1
  372. package/build-module/components/site-editor-routes/template-part-item.js +3 -3
  373. package/build-module/components/site-editor-routes/template-part-item.js.map +1 -1
  374. package/build-module/components/style-book/categories.js +1 -0
  375. package/build-module/components/style-book/categories.js.map +1 -1
  376. package/build-module/components/style-book/color-examples.js +9 -3
  377. package/build-module/components/style-book/color-examples.js.map +1 -1
  378. package/build-module/components/style-book/constants.js +35 -2
  379. package/build-module/components/style-book/constants.js.map +1 -1
  380. package/build-module/components/style-book/duotone-examples.js +1 -0
  381. package/build-module/components/style-book/duotone-examples.js.map +1 -1
  382. package/build-module/components/style-book/examples.js +48 -30
  383. package/build-module/components/style-book/examples.js.map +1 -1
  384. package/build-module/components/style-book/index.js +185 -64
  385. package/build-module/components/style-book/index.js.map +1 -1
  386. package/build-module/components/style-book/types.js.map +1 -1
  387. package/build-module/index.js +1 -0
  388. package/build-module/index.js.map +1 -1
  389. package/build-module/posts.js +1 -0
  390. package/build-module/posts.js.map +1 -1
  391. package/build-module/store/reducer.js +1 -0
  392. package/build-module/store/reducer.js.map +1 -1
  393. package/build-module/utils/get-filtered-template-parts.js +1 -0
  394. package/build-module/utils/get-filtered-template-parts.js.map +1 -1
  395. package/build-module/utils/set-nested-value.js +1 -0
  396. package/build-module/utils/set-nested-value.js.map +1 -1
  397. package/build-style/posts-rtl.css +151 -182
  398. package/build-style/posts.css +151 -182
  399. package/build-style/style-rtl.css +343 -354
  400. package/build-style/style.css +343 -354
  401. package/package.json +42 -41
  402. package/src/components/add-new-pattern/index.js +10 -7
  403. package/src/components/add-new-post/index.js +1 -1
  404. package/src/components/canvas-loader/style.scss +4 -3
  405. package/src/components/editor/index.js +1 -7
  406. package/src/components/editor/style.scss +4 -2
  407. package/src/components/editor-canvas-container/style.scss +7 -1
  408. package/src/components/global-styles/confirm-reset-shadow-dialog.js +37 -0
  409. package/src/components/global-styles/font-library-modal/index.js +1 -1
  410. package/src/components/global-styles/font-library-modal/style.scss +4 -2
  411. package/src/components/global-styles/font-sizes/font-size.js +28 -19
  412. package/src/components/global-styles/font-sizes/font-sizes.js +37 -35
  413. package/src/components/global-styles/preview-colors.js +3 -3
  414. package/src/components/global-styles/preview-styles.js +3 -3
  415. package/src/components/global-styles/preview-typography.js +3 -3
  416. package/src/components/global-styles/{preview-iframe.js → preview-wrapper.js} +9 -35
  417. package/src/components/global-styles/screen-block.js +3 -2
  418. package/src/components/global-styles/shadows-edit-panel.js +58 -49
  419. package/src/components/global-styles/shadows-panel.js +64 -5
  420. package/src/components/global-styles/style.scss +40 -18
  421. package/src/components/global-styles/typography-example.js +12 -1
  422. package/src/components/global-styles/variations/style.scss +4 -3
  423. package/src/components/layout/index.js +20 -7
  424. package/src/components/layout/style.scss +8 -3
  425. package/src/components/maybe-editor/index.js +58 -0
  426. package/src/components/page/style.scss +8 -5
  427. package/src/components/page-patterns/fields.js +13 -100
  428. package/src/components/page-patterns/index.js +23 -11
  429. package/src/components/page-patterns/style.scss +4 -53
  430. package/src/components/page-templates/fields.js +6 -33
  431. package/src/components/page-templates/index.js +38 -55
  432. package/src/components/page-templates/style.scss +4 -20
  433. package/src/components/post-edit/index.js +22 -18
  434. package/src/components/post-list/index.js +59 -44
  435. package/src/components/post-list/style.scss +0 -36
  436. package/src/components/resizable-frame/index.js +10 -1
  437. package/src/components/sidebar-dataviews/custom-dataviews-list.js +7 -6
  438. package/src/components/sidebar-dataviews/default-views.js +10 -26
  439. package/src/components/sidebar-dataviews/index.js +1 -1
  440. package/src/components/sidebar-dataviews/style.scss +9 -1
  441. package/src/components/sidebar-global-styles-wrapper/index.js +37 -83
  442. package/src/components/sidebar-global-styles-wrapper/style.scss +22 -0
  443. package/src/components/sidebar-navigation-item/style.scss +6 -0
  444. package/src/components/sidebar-navigation-screen/style.scss +0 -5
  445. package/src/components/sidebar-navigation-screen-global-styles/content.js +7 -35
  446. package/src/components/sidebar-navigation-screen-main/index.js +67 -38
  447. package/src/components/sidebar-navigation-screen-main/style.scss +4 -0
  448. package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
  449. package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +5 -0
  450. package/src/components/sidebar-navigation-screen-patterns/index.js +0 -7
  451. package/src/components/sidebar-navigation-screen-patterns/style.scss +2 -0
  452. package/src/components/sidebar-navigation-screen-templates-browse/content.js +1 -1
  453. package/src/components/sidebar-navigation-screen-templates-browse/style.scss +4 -0
  454. package/src/components/site-editor-routes/home.js +2 -2
  455. package/src/components/site-editor-routes/index.js +2 -0
  456. package/src/components/site-editor-routes/stylebook.js +28 -0
  457. package/src/components/site-editor-routes/styles.js +5 -1
  458. package/src/components/site-editor-routes/template-item.js +3 -3
  459. package/src/components/site-editor-routes/template-part-item.js +3 -3
  460. package/src/components/site-hub/style.scss +4 -2
  461. package/src/components/style-book/color-examples.tsx +21 -3
  462. package/src/components/style-book/constants.ts +49 -2
  463. package/src/components/style-book/examples.tsx +55 -31
  464. package/src/components/style-book/index.js +268 -87
  465. package/src/components/style-book/style.scss +4 -0
  466. package/src/components/style-book/types.ts +1 -1
  467. package/src/style.scss +4 -1
  468. package/build/components/error-boundary/index.js +0 -47
  469. package/build/components/error-boundary/index.js.map +0 -1
  470. package/build/components/error-boundary/warning.js +0 -42
  471. package/build/components/error-boundary/warning.js.map +0 -1
  472. package/build/components/global-styles/preview-iframe.js.map +0 -1
  473. package/build-module/components/error-boundary/index.js +0 -38
  474. package/build-module/components/error-boundary/index.js.map +0 -1
  475. package/build-module/components/error-boundary/warning.js +0 -35
  476. package/build-module/components/error-boundary/warning.js.map +0 -1
  477. package/build-module/components/global-styles/preview-iframe.js.map +0 -1
  478. package/src/components/error-boundary/index.js +0 -44
  479. package/src/components/error-boundary/test/error-boundary.js +0 -40
  480. package/src/components/error-boundary/warning.js +0 -30
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -58,7 +59,7 @@ const getCustomView = editedEntityRecord => {
58
59
  }
59
60
  return {
60
61
  ...content,
61
- layout: _defaultViews.defaultLayouts[content.type]?.layout
62
+ ..._defaultViews.defaultLayouts[content.type]
62
63
  };
63
64
  };
64
65
 
@@ -113,37 +114,46 @@ function useView(postType) {
113
114
  const type = layout !== null && layout !== void 0 ? layout : initialView.type;
114
115
  return {
115
116
  ...initialView,
116
- type
117
+ type,
118
+ ..._defaultViews.defaultLayouts[type]
117
119
  };
118
120
  });
119
- const setViewWithUrlUpdate = (0, _element.useCallback)(newView => {
120
- if (newView.type === _constants.LAYOUT_LIST && !layout) {
121
- // Skip updating the layout URL param if
122
- // it is not present and the newView.type is LAYOUT_LIST.
123
- } else if (newView.type !== layout) {
124
- history.navigate((0, _url.addQueryArgs)(path, {
125
- layout: newView.type
126
- }));
127
- }
121
+ const setViewWithUrlUpdate = (0, _compose.useEvent)(newView => {
128
122
  setView(newView);
129
123
  if (isCustom === 'true' && editedEntityRecord?.id) {
130
124
  editEntityRecord('postType', 'wp_dataviews', editedEntityRecord?.id, {
131
125
  content: JSON.stringify(newView)
132
126
  });
133
127
  }
134
- }, [history, isCustom, editEntityRecord, editedEntityRecord?.id, layout, path]);
128
+ const currentUrlLayout = layout !== null && layout !== void 0 ? layout : _constants.LAYOUT_LIST;
129
+ if (newView.type !== currentUrlLayout) {
130
+ history.navigate((0, _url.addQueryArgs)(path, {
131
+ layout: newView.type
132
+ }));
133
+ }
134
+ });
135
135
 
136
136
  // When layout URL param changes, update the view type
137
137
  // without affecting any other config.
138
+ const onUrlLayoutChange = (0, _compose.useEvent)(() => {
139
+ setView(prevView => {
140
+ const newType = layout !== null && layout !== void 0 ? layout : _constants.LAYOUT_LIST;
141
+ if (newType === prevView.type) {
142
+ return prevView;
143
+ }
144
+ return {
145
+ ...prevView,
146
+ type: newType,
147
+ ..._defaultViews.defaultLayouts[newType]
148
+ };
149
+ });
150
+ });
138
151
  (0, _element.useEffect)(() => {
139
- setView(prevView => ({
140
- ...prevView,
141
- type: layout !== null && layout !== void 0 ? layout : _constants.LAYOUT_LIST
142
- }));
143
- }, [layout]);
152
+ onUrlLayoutChange();
153
+ }, [onUrlLayoutChange, layout]);
144
154
 
145
155
  // When activeView or isCustom URL parameters change, reset the view.
146
- (0, _element.useEffect)(() => {
156
+ const onUrlActiveViewChange = (0, _compose.useEvent)(() => {
147
157
  let newView;
148
158
  if (isCustom === 'true') {
149
159
  newView = getCustomView(editedEntityRecord);
@@ -154,17 +164,24 @@ function useView(postType) {
154
164
  const type = layout !== null && layout !== void 0 ? layout : newView.type;
155
165
  setView({
156
166
  ...newView,
157
- type
167
+ type,
168
+ ..._defaultViews.defaultLayouts[type]
158
169
  });
159
170
  }
160
- }, [activeView, isCustom, layout, defaultViews, editedEntityRecord]);
161
- return [view, setViewWithUrlUpdate, setViewWithUrlUpdate];
171
+ });
172
+ (0, _element.useEffect)(() => {
173
+ onUrlActiveViewChange();
174
+ }, [onUrlActiveViewChange, activeView, isCustom, defaultViews, editedEntityRecord]);
175
+ return [view, setViewWithUrlUpdate];
162
176
  }
163
177
  const DEFAULT_STATUSES = 'draft,future,pending,private,publish'; // All but 'trash'.
164
178
 
165
179
  function getItemId(item) {
166
180
  return item.id.toString();
167
181
  }
182
+ function getItemLevel(item) {
183
+ return item.level;
184
+ }
168
185
  function PostList({
169
186
  postType
170
187
  }) {
@@ -250,6 +267,7 @@ function PostList({
250
267
  _embed: 'author',
251
268
  order: view.sort?.direction,
252
269
  orderby: view.sort?.field,
270
+ orderby_hierarchy: !!view.showLevels,
253
271
  search: view.search,
254
272
  ...filters
255
273
  };
@@ -350,6 +368,7 @@ function PostList({
350
368
  history.navigate(`/${postType}/${id}?canvas=edit`);
351
369
  },
352
370
  getItemId: getItemId,
371
+ getItemLevel: getItemLevel,
353
372
  defaultLayouts: _defaultViews.defaultLayouts,
354
373
  header: window.__experimentalQuickEditDataViews && view.type !== _constants.LAYOUT_LIST && postType === 'page' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
355
374
  size: "compact",
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_coreData","_element","_router","_data","_dataviews","_editor","_i18n","_icons","_compose","_url","_page","_interopRequireDefault","_defaultViews","_constants","_addNewPost","_lockUnlock","_dataviewsActions","_jsxRuntime","usePostActions","usePostFields","unlock","editorPrivateApis","useLocation","useHistory","routerPrivateApis","useEntityRecordsWithPermissions","coreDataPrivateApis","EMPTY_ARRAY","getDefaultView","defaultViews","activeView","find","slug","view","getCustomView","editedEntityRecord","content","undefined","JSON","parse","layout","defaultLayouts","type","useView","postType","path","query","isCustom","history","useDefaultViews","editEntityRecord","useDispatch","coreStore","useSelect","select","getEditedEntityRecord","Number","setView","useState","initialView","_getCustomView","LAYOUT_LIST","_getDefaultView","setViewWithUrlUpdate","useCallback","newView","navigate","addQueryArgs","id","stringify","useEffect","prevView","DEFAULT_STATUSES","getItemId","item","toString","PostList","_postId$split","_data$map","_usePrevious","location","postId","quickEdit","selection","setSelection","split","onChangeSelection","items","_location$query$isCus","join","getActiveViewFilters","views","match","_found$filters","found","filters","isLoading","isLoadingFields","fields","_fields","useMemo","activeViewFilters","map","field","elements","includes","queryArgs","forEach","filter","operator","OPERATOR_IS_ANY","status","value","author","OPERATOR_IS_NONE","author_exclude","per_page","perPage","page","_embed","order","sort","direction","orderby","search","records","isResolving","isLoadingData","totalItems","totalPages","data","filterSortAndPaginate","ids","record","prevIds","usePrevious","deletedIds","postIdWasDeleted","paginationInfo","labels","canCreateRecord","getPostType","canUser","kind","name","postTypeActions","context","editAction","useEditPostAction","actions","showAddPostModal","setShowAddPostModal","openModal","closeModal","handleNewPage","jsx","default","title","add_new_item","jsxs","Fragment","children","Button","variant","onClick","__next40pxDefaultSize","onSave","onClose","DataViews","onChangeView","isItemClickable","onClickItem","header","window","__experimentalQuickEditDataViews","size","isPressed","icon","drawerRight","label","__"],"sources":["@wordpress/edit-site/src/components/post-list/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport {\n\tstore as coreStore,\n\tprivateApis as coreDataPrivateApis,\n} from '@wordpress/core-data';\nimport { useState, useMemo, useCallback, useEffect } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\nimport { drawerRight } from '@wordpress/icons';\nimport { usePrevious } from '@wordpress/compose';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport {\n\tuseDefaultViews,\n\tdefaultLayouts,\n} from '../sidebar-dataviews/default-views';\nimport {\n\tOPERATOR_IS_ANY,\n\tOPERATOR_IS_NONE,\n\tLAYOUT_LIST,\n} from '../../utils/constants';\n\nimport AddNewPostModal from '../add-new-post';\nimport { unlock } from '../../lock-unlock';\nimport { useEditPostAction } from '../dataviews-actions';\n\nconst { usePostActions, usePostFields } = unlock( editorPrivateApis );\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\nconst { useEntityRecordsWithPermissions } = unlock( coreDataPrivateApis );\nconst EMPTY_ARRAY = [];\n\nconst getDefaultView = ( defaultViews, activeView ) => {\n\treturn defaultViews.find( ( { slug } ) => slug === activeView )?.view;\n};\n\nconst getCustomView = ( editedEntityRecord ) => {\n\tif ( ! editedEntityRecord?.content ) {\n\t\treturn undefined;\n\t}\n\n\tconst content = JSON.parse( editedEntityRecord.content );\n\tif ( ! content ) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\t...content,\n\t\tlayout: defaultLayouts[ content.type ]?.layout,\n\t};\n};\n\n/**\n * This function abstracts working with default & custom views by\n * providing a [ state, setState ] tuple based on the URL parameters.\n *\n * Consumers use the provided tuple to work with state\n * and don't have to deal with the specifics of default & custom views.\n *\n * @param {string} postType Post type to retrieve default views for.\n * @return {Array} The [ state, setState ] tuple.\n */\nfunction useView( postType ) {\n\tconst {\n\t\tpath,\n\t\tquery: { activeView = 'all', isCustom = 'false', layout },\n\t} = useLocation();\n\tconst history = useHistory();\n\n\tconst defaultViews = useDefaultViews( { postType } );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst editedEntityRecord = useSelect(\n\t\t( select ) => {\n\t\t\tif ( isCustom !== 'true' ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\treturn getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_dataviews',\n\t\t\t\tNumber( activeView )\n\t\t\t);\n\t\t},\n\t\t[ activeView, isCustom ]\n\t);\n\tconst [ view, setView ] = useState( () => {\n\t\tlet initialView;\n\t\tif ( isCustom === 'true' ) {\n\t\t\tinitialView = getCustomView( editedEntityRecord ) ?? {\n\t\t\t\ttype: layout ?? LAYOUT_LIST,\n\t\t\t};\n\t\t} else {\n\t\t\tinitialView = getDefaultView( defaultViews, activeView ) ?? {\n\t\t\t\ttype: layout ?? LAYOUT_LIST,\n\t\t\t};\n\t\t}\n\n\t\tconst type = layout ?? initialView.type;\n\t\treturn {\n\t\t\t...initialView,\n\t\t\ttype,\n\t\t};\n\t} );\n\n\tconst setViewWithUrlUpdate = useCallback(\n\t\t( newView ) => {\n\t\t\tif ( newView.type === LAYOUT_LIST && ! layout ) {\n\t\t\t\t// Skip updating the layout URL param if\n\t\t\t\t// it is not present and the newView.type is LAYOUT_LIST.\n\t\t\t} else if ( newView.type !== layout ) {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\t\tlayout: newView.type,\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tsetView( newView );\n\n\t\t\tif ( isCustom === 'true' && editedEntityRecord?.id ) {\n\t\t\t\teditEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\teditedEntityRecord?.id,\n\t\t\t\t\t{\n\t\t\t\t\t\tcontent: JSON.stringify( newView ),\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\thistory,\n\t\t\tisCustom,\n\t\t\teditEntityRecord,\n\t\t\teditedEntityRecord?.id,\n\t\t\tlayout,\n\t\t\tpath,\n\t\t]\n\t);\n\n\t// When layout URL param changes, update the view type\n\t// without affecting any other config.\n\tuseEffect( () => {\n\t\tsetView( ( prevView ) => ( {\n\t\t\t...prevView,\n\t\t\ttype: layout ?? LAYOUT_LIST,\n\t\t} ) );\n\t}, [ layout ] );\n\n\t// When activeView or isCustom URL parameters change, reset the view.\n\tuseEffect( () => {\n\t\tlet newView;\n\t\tif ( isCustom === 'true' ) {\n\t\t\tnewView = getCustomView( editedEntityRecord );\n\t\t} else {\n\t\t\tnewView = getDefaultView( defaultViews, activeView );\n\t\t}\n\n\t\tif ( newView ) {\n\t\t\tconst type = layout ?? newView.type;\n\t\t\tsetView( {\n\t\t\t\t...newView,\n\t\t\t\ttype,\n\t\t\t} );\n\t\t}\n\t}, [ activeView, isCustom, layout, defaultViews, editedEntityRecord ] );\n\n\treturn [ view, setViewWithUrlUpdate, setViewWithUrlUpdate ];\n}\n\nconst DEFAULT_STATUSES = 'draft,future,pending,private,publish'; // All but 'trash'.\n\nfunction getItemId( item ) {\n\treturn item.id.toString();\n}\n\nexport default function PostList( { postType } ) {\n\tconst [ view, setView ] = useView( postType );\n\tconst defaultViews = useDefaultViews( { postType } );\n\tconst history = useHistory();\n\tconst location = useLocation();\n\tconst {\n\t\tpostId,\n\t\tquickEdit = false,\n\t\tisCustom,\n\t\tactiveView = 'all',\n\t} = location.query;\n\tconst [ selection, setSelection ] = useState( postId?.split( ',' ) ?? [] );\n\tconst onChangeSelection = useCallback(\n\t\t( items ) => {\n\t\t\tsetSelection( items );\n\t\t\tif ( ( location.query.isCustom ?? 'false' ) === 'false' ) {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( location.path, {\n\t\t\t\t\t\tpostId: items.join( ',' ),\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ location.path, location.query.isCustom, history ]\n\t);\n\n\tconst getActiveViewFilters = ( views, match ) => {\n\t\tconst found = views.find( ( { slug } ) => slug === match );\n\t\treturn found?.filters ?? [];\n\t};\n\n\tconst { isLoading: isLoadingFields, fields: _fields } = usePostFields( {\n\t\tpostType,\n\t} );\n\tconst fields = useMemo( () => {\n\t\tconst activeViewFilters = getActiveViewFilters(\n\t\t\tdefaultViews,\n\t\t\tactiveView\n\t\t).map( ( { field } ) => field );\n\t\treturn _fields.map( ( field ) => ( {\n\t\t\t...field,\n\t\t\telements: activeViewFilters.includes( field.id )\n\t\t\t\t? []\n\t\t\t\t: field.elements,\n\t\t} ) );\n\t}, [ _fields, defaultViews, activeView ] );\n\n\tconst queryArgs = useMemo( () => {\n\t\tconst filters = {};\n\t\tview.filters?.forEach( ( filter ) => {\n\t\t\tif (\n\t\t\t\tfilter.field === 'status' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\n\t\t\t) {\n\t\t\t\tfilters.status = filter.value;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\n\t\t\t) {\n\t\t\t\tfilters.author = filter.value;\n\t\t\t} else if (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_NONE\n\t\t\t) {\n\t\t\t\tfilters.author_exclude = filter.value;\n\t\t\t}\n\t\t} );\n\n\t\t// The bundled views want data filtered without displaying the filter.\n\t\tconst activeViewFilters = getActiveViewFilters(\n\t\t\tdefaultViews,\n\t\t\tactiveView\n\t\t);\n\t\tactiveViewFilters.forEach( ( filter ) => {\n\t\t\tif (\n\t\t\t\tfilter.field === 'status' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\n\t\t\t) {\n\t\t\t\tfilters.status = filter.value;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\n\t\t\t) {\n\t\t\t\tfilters.author = filter.value;\n\t\t\t} else if (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_NONE\n\t\t\t) {\n\t\t\t\tfilters.author_exclude = filter.value;\n\t\t\t}\n\t\t} );\n\n\t\t// We want to provide a different default item for the status filter\n\t\t// than the REST API provides.\n\t\tif ( ! filters.status || filters.status === '' ) {\n\t\t\tfilters.status = DEFAULT_STATUSES;\n\t\t}\n\n\t\treturn {\n\t\t\tper_page: view.perPage,\n\t\t\tpage: view.page,\n\t\t\t_embed: 'author',\n\t\t\torder: view.sort?.direction,\n\t\t\torderby: view.sort?.field,\n\t\t\tsearch: view.search,\n\t\t\t...filters,\n\t\t};\n\t}, [ view, activeView, defaultViews ] );\n\tconst {\n\t\trecords,\n\t\tisResolving: isLoadingData,\n\t\ttotalItems,\n\t\ttotalPages,\n\t} = useEntityRecordsWithPermissions( 'postType', postType, queryArgs );\n\n\t// The REST API sort the authors by ID, but we want to sort them by name.\n\tconst data = useMemo( () => {\n\t\tif ( ! isLoadingFields && view?.sort?.field === 'author' ) {\n\t\t\treturn filterSortAndPaginate(\n\t\t\t\trecords,\n\t\t\t\t{ sort: { ...view.sort } },\n\t\t\t\tfields\n\t\t\t).data;\n\t\t}\n\n\t\treturn records;\n\t}, [ records, fields, isLoadingFields, view?.sort ] );\n\n\tconst ids = data?.map( ( record ) => getItemId( record ) ) ?? [];\n\tconst prevIds = usePrevious( ids ) ?? [];\n\tconst deletedIds = prevIds.filter( ( id ) => ! ids.includes( id ) );\n\tconst postIdWasDeleted = deletedIds.includes( postId );\n\n\tuseEffect( () => {\n\t\tif ( postIdWasDeleted ) {\n\t\t\thistory.navigate(\n\t\t\t\taddQueryArgs( location.path, {\n\t\t\t\t\tpostId: undefined,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\t}, [ history, postIdWasDeleted, location.path ] );\n\n\tconst paginationInfo = useMemo(\n\t\t() => ( {\n\t\t\ttotalItems,\n\t\t\ttotalPages,\n\t\t} ),\n\t\t[ totalItems, totalPages ]\n\t);\n\n\tconst { labels, canCreateRecord } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPostType, canUser } = select( coreStore );\n\t\t\treturn {\n\t\t\t\tlabels: getPostType( postType )?.labels,\n\t\t\t\tcanCreateRecord: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: postType,\n\t\t\t\t} ),\n\t\t\t};\n\t\t},\n\t\t[ postType ]\n\t);\n\n\tconst postTypeActions = usePostActions( {\n\t\tpostType,\n\t\tcontext: 'list',\n\t} );\n\tconst editAction = useEditPostAction();\n\tconst actions = useMemo(\n\t\t() => [ editAction, ...postTypeActions ],\n\t\t[ postTypeActions, editAction ]\n\t);\n\n\tconst [ showAddPostModal, setShowAddPostModal ] = useState( false );\n\n\tconst openModal = () => setShowAddPostModal( true );\n\tconst closeModal = () => setShowAddPostModal( false );\n\tconst handleNewPage = ( { type, id } ) => {\n\t\thistory.navigate( `/${ type }/${ id }?canvas=edit` );\n\t\tcloseModal();\n\t};\n\n\treturn (\n\t\t<Page\n\t\t\ttitle={ labels?.name }\n\t\t\tactions={\n\t\t\t\tlabels?.add_new_item &&\n\t\t\t\tcanCreateRecord && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tonClick={ openModal }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ labels.add_new_item }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t{ showAddPostModal && (\n\t\t\t\t\t\t\t<AddNewPostModal\n\t\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\t\tonSave={ handleNewPage }\n\t\t\t\t\t\t\t\tonClose={ closeModal }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t)\n\t\t\t}\n\t\t>\n\t\t\t<DataViews\n\t\t\t\tkey={ activeView + isCustom }\n\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\tfields={ fields }\n\t\t\t\tactions={ actions }\n\t\t\t\tdata={ data || EMPTY_ARRAY }\n\t\t\t\tisLoading={ isLoadingData || isLoadingFields }\n\t\t\t\tview={ view }\n\t\t\t\tonChangeView={ setView }\n\t\t\t\tselection={ selection }\n\t\t\t\tonChangeSelection={ onChangeSelection }\n\t\t\t\tisItemClickable={ ( item ) => item.status !== 'trash' }\n\t\t\t\tonClickItem={ ( { id } ) => {\n\t\t\t\t\thistory.navigate( `/${ postType }/${ id }?canvas=edit` );\n\t\t\t\t} }\n\t\t\t\tgetItemId={ getItemId }\n\t\t\t\tdefaultLayouts={ defaultLayouts }\n\t\t\t\theader={\n\t\t\t\t\twindow.__experimentalQuickEditDataViews &&\n\t\t\t\t\tview.type !== LAYOUT_LIST &&\n\t\t\t\t\tpostType === 'page' && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tisPressed={ quickEdit }\n\t\t\t\t\t\t\ticon={ drawerRight }\n\t\t\t\t\t\t\tlabel={ __( 'Details' ) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t\taddQueryArgs( location.path, {\n\t\t\t\t\t\t\t\t\t\tquickEd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GA,SAAW;MACvBhC,cAAc,EAAGA,4BAAgB;MACjCmI,MAAM,EACLC,MAAM,CAACC,gCAAgC,IACvC7I,IAAI,CAACS,IAAI,KAAKmB,sBAAW,IACzBjB,QAAQ,KAAK,MAAM,iBAClB,IAAA3B,WAAA,CAAA0I,GAAA,EAAC7J,WAAA,CAAAoK,MAAM;QACNa,IAAI,EAAC,SAAS;QACdC,SAAS,EAAG9F,SAAW;QACvB+F,IAAI,EAAGC,kBAAa;QACpBC,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU,CAAG;QACzBhB,OAAO,EAAGA,CAAA,KAAM;UACfpH,OAAO,CAACkB,QAAQ,CACf,IAAAC,iBAAY,EAAEa,QAAQ,CAACnC,IAAI,EAAE;YAC5BqC,SAAS,EAAEA,SAAS,GAAG7C,SAAS,GAAG;UACpC,CAAE,CACH,CAAC;QACF;MAAG,CACH;IAEF,GAlCKP,UAAU,GAAGiB,QAmCnB;EAAC,CACG,CAAC;AAET","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_coreData","_element","_router","_data","_dataviews","_editor","_i18n","_icons","_compose","_url","_page","_interopRequireDefault","_defaultViews","_constants","_addNewPost","_lockUnlock","_dataviewsActions","_jsxRuntime","usePostActions","usePostFields","unlock","editorPrivateApis","useLocation","useHistory","routerPrivateApis","useEntityRecordsWithPermissions","coreDataPrivateApis","EMPTY_ARRAY","getDefaultView","defaultViews","activeView","find","slug","view","getCustomView","editedEntityRecord","content","undefined","JSON","parse","defaultLayouts","type","useView","postType","path","query","isCustom","layout","history","useDefaultViews","editEntityRecord","useDispatch","coreStore","useSelect","select","getEditedEntityRecord","Number","setView","useState","initialView","_getCustomView","LAYOUT_LIST","_getDefaultView","setViewWithUrlUpdate","useEvent","newView","id","stringify","currentUrlLayout","navigate","addQueryArgs","onUrlLayoutChange","prevView","newType","useEffect","onUrlActiveViewChange","DEFAULT_STATUSES","getItemId","item","toString","getItemLevel","level","PostList","_postId$split","_data$map","_usePrevious","location","postId","quickEdit","selection","setSelection","split","onChangeSelection","useCallback","items","_location$query$isCus","join","getActiveViewFilters","views","match","_found$filters","found","filters","isLoading","isLoadingFields","fields","_fields","useMemo","activeViewFilters","map","field","elements","includes","queryArgs","forEach","filter","operator","OPERATOR_IS_ANY","status","value","author","OPERATOR_IS_NONE","author_exclude","per_page","perPage","page","_embed","order","sort","direction","orderby","orderby_hierarchy","showLevels","search","records","isResolving","isLoadingData","totalItems","totalPages","data","filterSortAndPaginate","ids","record","prevIds","usePrevious","deletedIds","postIdWasDeleted","paginationInfo","labels","canCreateRecord","getPostType","canUser","kind","name","postTypeActions","context","editAction","useEditPostAction","actions","showAddPostModal","setShowAddPostModal","openModal","closeModal","handleNewPage","jsx","default","title","add_new_item","jsxs","Fragment","children","Button","variant","onClick","__next40pxDefaultSize","onSave","onClose","DataViews","onChangeView","isItemClickable","onClickItem","header","window","__experimentalQuickEditDataViews","size","isPressed","icon","drawerRight","label","__"],"sources":["@wordpress/edit-site/src/components/post-list/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport {\n\tstore as coreStore,\n\tprivateApis as coreDataPrivateApis,\n} from '@wordpress/core-data';\nimport { useState, useMemo, useCallback, useEffect } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { DataViews, filterSortAndPaginate } from '@wordpress/dataviews';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { __ } from '@wordpress/i18n';\nimport { drawerRight } from '@wordpress/icons';\nimport { useEvent, usePrevious } from '@wordpress/compose';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport {\n\tuseDefaultViews,\n\tdefaultLayouts,\n} from '../sidebar-dataviews/default-views';\nimport {\n\tOPERATOR_IS_ANY,\n\tOPERATOR_IS_NONE,\n\tLAYOUT_LIST,\n} from '../../utils/constants';\n\nimport AddNewPostModal from '../add-new-post';\nimport { unlock } from '../../lock-unlock';\nimport { useEditPostAction } from '../dataviews-actions';\n\nconst { usePostActions, usePostFields } = unlock( editorPrivateApis );\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\nconst { useEntityRecordsWithPermissions } = unlock( coreDataPrivateApis );\nconst EMPTY_ARRAY = [];\n\nconst getDefaultView = ( defaultViews, activeView ) => {\n\treturn defaultViews.find( ( { slug } ) => slug === activeView )?.view;\n};\n\nconst getCustomView = ( editedEntityRecord ) => {\n\tif ( ! editedEntityRecord?.content ) {\n\t\treturn undefined;\n\t}\n\n\tconst content = JSON.parse( editedEntityRecord.content );\n\tif ( ! content ) {\n\t\treturn undefined;\n\t}\n\n\treturn {\n\t\t...content,\n\t\t...defaultLayouts[ content.type ],\n\t};\n};\n\n/**\n * This function abstracts working with default & custom views by\n * providing a [ state, setState ] tuple based on the URL parameters.\n *\n * Consumers use the provided tuple to work with state\n * and don't have to deal with the specifics of default & custom views.\n *\n * @param {string} postType Post type to retrieve default views for.\n * @return {Array} The [ state, setState ] tuple.\n */\nfunction useView( postType ) {\n\tconst {\n\t\tpath,\n\t\tquery: { activeView = 'all', isCustom = 'false', layout },\n\t} = useLocation();\n\tconst history = useHistory();\n\n\tconst defaultViews = useDefaultViews( { postType } );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst editedEntityRecord = useSelect(\n\t\t( select ) => {\n\t\t\tif ( isCustom !== 'true' ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\treturn getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_dataviews',\n\t\t\t\tNumber( activeView )\n\t\t\t);\n\t\t},\n\t\t[ activeView, isCustom ]\n\t);\n\tconst [ view, setView ] = useState( () => {\n\t\tlet initialView;\n\t\tif ( isCustom === 'true' ) {\n\t\t\tinitialView = getCustomView( editedEntityRecord ) ?? {\n\t\t\t\ttype: layout ?? LAYOUT_LIST,\n\t\t\t};\n\t\t} else {\n\t\t\tinitialView = getDefaultView( defaultViews, activeView ) ?? {\n\t\t\t\ttype: layout ?? LAYOUT_LIST,\n\t\t\t};\n\t\t}\n\n\t\tconst type = layout ?? initialView.type;\n\t\treturn {\n\t\t\t...initialView,\n\t\t\ttype,\n\t\t\t...defaultLayouts[ type ],\n\t\t};\n\t} );\n\n\tconst setViewWithUrlUpdate = useEvent( ( newView ) => {\n\t\tsetView( newView );\n\n\t\tif ( isCustom === 'true' && editedEntityRecord?.id ) {\n\t\t\teditEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_dataviews',\n\t\t\t\teditedEntityRecord?.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: JSON.stringify( newView ),\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tconst currentUrlLayout = layout ?? LAYOUT_LIST;\n\t\tif ( newView.type !== currentUrlLayout ) {\n\t\t\thistory.navigate(\n\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\tlayout: newView.type,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\t} );\n\n\t// When layout URL param changes, update the view type\n\t// without affecting any other config.\n\tconst onUrlLayoutChange = useEvent( () => {\n\t\tsetView( ( prevView ) => {\n\t\t\tconst newType = layout ?? LAYOUT_LIST;\n\t\t\tif ( newType === prevView.type ) {\n\t\t\t\treturn prevView;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...prevView,\n\t\t\t\ttype: newType,\n\t\t\t\t...defaultLayouts[ newType ],\n\t\t\t};\n\t\t} );\n\t} );\n\tuseEffect( () => {\n\t\tonUrlLayoutChange();\n\t}, [ onUrlLayoutChange, layout ] );\n\n\t// When activeView or isCustom URL parameters change, reset the view.\n\tconst onUrlActiveViewChange = useEvent( () => {\n\t\tlet newView;\n\t\tif ( isCustom === 'true' ) {\n\t\t\tnewView = getCustomView( editedEntityRecord );\n\t\t} else {\n\t\t\tnewView = getDefaultView( defaultViews, activeView );\n\t\t}\n\n\t\tif ( newView ) {\n\t\t\tconst type = layout ?? newView.type;\n\t\t\tsetView( {\n\t\t\t\t...newView,\n\t\t\t\ttype,\n\t\t\t\t...defaultLayouts[ type ],\n\t\t\t} );\n\t\t}\n\t} );\n\tuseEffect( () => {\n\t\tonUrlActiveViewChange();\n\t}, [\n\t\tonUrlActiveViewChange,\n\t\tactiveView,\n\t\tisCustom,\n\t\tdefaultViews,\n\t\teditedEntityRecord,\n\t] );\n\n\treturn [ view, setViewWithUrlUpdate ];\n}\n\nconst DEFAULT_STATUSES = 'draft,future,pending,private,publish'; // All but 'trash'.\n\nfunction getItemId( item ) {\n\treturn item.id.toString();\n}\n\nfunction getItemLevel( item ) {\n\treturn item.level;\n}\n\nexport default function PostList( { postType } ) {\n\tconst [ view, setView ] = useView( postType );\n\tconst defaultViews = useDefaultViews( { postType } );\n\tconst history = useHistory();\n\tconst location = useLocation();\n\tconst {\n\t\tpostId,\n\t\tquickEdit = false,\n\t\tisCustom,\n\t\tactiveView = 'all',\n\t} = location.query;\n\tconst [ selection, setSelection ] = useState( postId?.split( ',' ) ?? [] );\n\tconst onChangeSelection = useCallback(\n\t\t( items ) => {\n\t\t\tsetSelection( items );\n\t\t\tif ( ( location.query.isCustom ?? 'false' ) === 'false' ) {\n\t\t\t\thistory.navigate(\n\t\t\t\t\taddQueryArgs( location.path, {\n\t\t\t\t\t\tpostId: items.join( ',' ),\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ location.path, location.query.isCustom, history ]\n\t);\n\tconst getActiveViewFilters = ( views, match ) => {\n\t\tconst found = views.find( ( { slug } ) => slug === match );\n\t\treturn found?.filters ?? [];\n\t};\n\n\tconst { isLoading: isLoadingFields, fields: _fields } = usePostFields( {\n\t\tpostType,\n\t} );\n\tconst fields = useMemo( () => {\n\t\tconst activeViewFilters = getActiveViewFilters(\n\t\t\tdefaultViews,\n\t\t\tactiveView\n\t\t).map( ( { field } ) => field );\n\t\treturn _fields.map( ( field ) => ( {\n\t\t\t...field,\n\t\t\telements: activeViewFilters.includes( field.id )\n\t\t\t\t? []\n\t\t\t\t: field.elements,\n\t\t} ) );\n\t}, [ _fields, defaultViews, activeView ] );\n\n\tconst queryArgs = useMemo( () => {\n\t\tconst filters = {};\n\t\tview.filters?.forEach( ( filter ) => {\n\t\t\tif (\n\t\t\t\tfilter.field === 'status' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\n\t\t\t) {\n\t\t\t\tfilters.status = filter.value;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\n\t\t\t) {\n\t\t\t\tfilters.author = filter.value;\n\t\t\t} else if (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_NONE\n\t\t\t) {\n\t\t\t\tfilters.author_exclude = filter.value;\n\t\t\t}\n\t\t} );\n\n\t\t// The bundled views want data filtered without displaying the filter.\n\t\tconst activeViewFilters = getActiveViewFilters(\n\t\t\tdefaultViews,\n\t\t\tactiveView\n\t\t);\n\t\tactiveViewFilters.forEach( ( filter ) => {\n\t\t\tif (\n\t\t\t\tfilter.field === 'status' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\n\t\t\t) {\n\t\t\t\tfilters.status = filter.value;\n\t\t\t}\n\t\t\tif (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_ANY\n\t\t\t) {\n\t\t\t\tfilters.author = filter.value;\n\t\t\t} else if (\n\t\t\t\tfilter.field === 'author' &&\n\t\t\t\tfilter.operator === OPERATOR_IS_NONE\n\t\t\t) {\n\t\t\t\tfilters.author_exclude = filter.value;\n\t\t\t}\n\t\t} );\n\n\t\t// We want to provide a different default item for the status filter\n\t\t// than the REST API provides.\n\t\tif ( ! filters.status || filters.status === '' ) {\n\t\t\tfilters.status = DEFAULT_STATUSES;\n\t\t}\n\n\t\treturn {\n\t\t\tper_page: view.perPage,\n\t\t\tpage: view.page,\n\t\t\t_embed: 'author',\n\t\t\torder: view.sort?.direction,\n\t\t\torderby: view.sort?.field,\n\t\t\torderby_hierarchy: !! view.showLevels,\n\t\t\tsearch: view.search,\n\t\t\t...filters,\n\t\t};\n\t}, [ view, activeView, defaultViews ] );\n\tconst {\n\t\trecords,\n\t\tisResolving: isLoadingData,\n\t\ttotalItems,\n\t\ttotalPages,\n\t} = useEntityRecordsWithPermissions( 'postType', postType, queryArgs );\n\n\t// The REST API sort the authors by ID, but we want to sort them by name.\n\tconst data = useMemo( () => {\n\t\tif ( ! isLoadingFields && view?.sort?.field === 'author' ) {\n\t\t\treturn filterSortAndPaginate(\n\t\t\t\trecords,\n\t\t\t\t{ sort: { ...view.sort } },\n\t\t\t\tfields\n\t\t\t).data;\n\t\t}\n\n\t\treturn records;\n\t}, [ records, fields, isLoadingFields, view?.sort ] );\n\n\tconst ids = data?.map( ( record ) => getItemId( record ) ) ?? [];\n\tconst prevIds = usePrevious( ids ) ?? [];\n\tconst deletedIds = prevIds.filter( ( id ) => ! ids.includes( id ) );\n\tconst postIdWasDeleted = deletedIds.includes( postId );\n\n\tuseEffect( () => {\n\t\tif ( postIdWasDeleted ) {\n\t\t\thistory.navigate(\n\t\t\t\taddQueryArgs( location.path, {\n\t\t\t\t\tpostId: undefined,\n\t\t\t\t} )\n\t\t\t);\n\t\t}\n\t}, [ history, postIdWasDeleted, location.path ] );\n\n\tconst paginationInfo = useMemo(\n\t\t() => ( {\n\t\t\ttotalItems,\n\t\t\ttotalPages,\n\t\t} ),\n\t\t[ totalItems, totalPages ]\n\t);\n\n\tconst { labels, canCreateRecord } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPostType, canUser } = select( coreStore );\n\t\t\treturn {\n\t\t\t\tlabels: getPostType( postType )?.labels,\n\t\t\t\tcanCreateRecord: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: postType,\n\t\t\t\t} ),\n\t\t\t};\n\t\t},\n\t\t[ postType ]\n\t);\n\n\tconst postTypeActions = usePostActions( {\n\t\tpostType,\n\t\tcontext: 'list',\n\t} );\n\tconst editAction = useEditPostAction();\n\tconst actions = useMemo(\n\t\t() => [ editAction, ...postTypeActions ],\n\t\t[ postTypeActions, editAction ]\n\t);\n\n\tconst [ showAddPostModal, setShowAddPostModal ] = useState( false );\n\n\tconst openModal = () => setShowAddPostModal( true );\n\tconst closeModal = () => setShowAddPostModal( false );\n\tconst handleNewPage = ( { type, id } ) => {\n\t\thistory.navigate( `/${ type }/${ id }?canvas=edit` );\n\t\tcloseModal();\n\t};\n\n\treturn (\n\t\t<Page\n\t\t\ttitle={ labels?.name }\n\t\t\tactions={\n\t\t\t\tlabels?.add_new_item &&\n\t\t\t\tcanCreateRecord && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\tonClick={ openModal }\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ labels.add_new_item }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t{ showAddPostModal && (\n\t\t\t\t\t\t\t<AddNewPostModal\n\t\t\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\t\t\tonSave={ handleNewPage }\n\t\t\t\t\t\t\t\tonClose={ closeModal }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t)\n\t\t\t}\n\t\t>\n\t\t\t<DataViews\n\t\t\t\tkey={ activeView + isCustom }\n\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\tfields={ fields }\n\t\t\t\tactions={ actions }\n\t\t\t\tdata={ data || EMPTY_ARRAY }\n\t\t\t\tisLoading={ isLoadingData || isLoadingFields }\n\t\t\t\tview={ view }\n\t\t\t\tonChangeView={ setView }\n\t\t\t\tselection={ selection }\n\t\t\t\tonChangeSelection={ onChangeSelection }\n\t\t\t\tisItemClickable={ ( item ) => item.status !== 'trash' }\n\t\t\t\tonClickItem={ ( { id } ) => {\n\t\t\t\t\thistory.navigate( `/${ postType }/${ id }?canvas=edit` );\n\t\t\t\t} }\n\t\t\t\tgetItemId={ getItemId }\n\t\t\t\tgetItemLevel={ getItemLevel }\n\t\t\t\tdefaultLayouts={ defaultLayouts }\n\t\t\t\theader={\n\t\t\t\t\twindow.__experimentalQuickEditDataViews &&\n\t\t\t\t\tview.type !== LAYOUT_LIST &&\n\t\t\t\t\tpostType === 'page' && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\tisPressed={ quickEdit }\n\t\t\t\t\t\t\ticon={ drawerRight }\n\t\t\t\t\t\t\tlabel={ __( 'Details' ) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thistory.navigate(\n\t\t\t\t\t\t\t\t\taddQueryArgs( location.path, {\n\t\t\t\t\t\t\t\t\t\tquickEdit: quickEdit ? undefined : true,\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t/>\n\t\t</Page>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,IAAA,GAAAV,OAAA;AAKA,IAAAW,KAAA,GAAAC,sBAAA,CAAAZ,OAAA;AACA,IAAAa,aAAA,GAAAb,OAAA;AAIA,IAAAc,UAAA,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AClB,IAAA1B,WAAA,CAAAmJ,GAAA,EAACtK,WAAA,CAAA6K,MAAM;QACNa,IAAI,EAAC,SAAS;QACdC,SAAS,EAAGjG,SAAW;QACvBkG,IAAI,EAAGC,kBAAa;QACpBC,KAAK,EAAG,IAAAC,QAAE,EAAE,SAAU,CAAG;QACzBhB,OAAO,EAAGA,CAAA,KAAM;UACf7H,OAAO,CAACqB,QAAQ,CACf,IAAAC,iBAAY,EAAEgB,QAAQ,CAAC1C,IAAI,EAAE;YAC5B4C,SAAS,EAAEA,SAAS,GAAGnD,SAAS,GAAG;UACpC,CAAE,CACH,CAAC;QACF;MAAG,CACH;IAEF,GAnCKP,UAAU,GAAGgB,QAoCnB;EAAC,CACG,CAAC;AAET","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_element","_lockUnlock","_store","_posts","_postItem","routes","postItemRoute","postsRoute","useRegisterPostsAppRoutes","registry","useRegistry","registerRoute","unlock","useDispatch","siteEditorStore","useEffect","batch","forEach"],"sources":["@wordpress/edit-site/src/components/posts-app-routes/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as siteEditorStore } from '../../store';\nimport { postsRoute } from './posts';\nimport { postItemRoute } from './post-item';\n\nconst routes = [ postItemRoute, postsRoute ];\n\nexport function useRegisterPostsAppRoutes() {\n\tconst registry = useRegistry();\n\tconst { registerRoute } = unlock( useDispatch( siteEditorStore ) );\n\tuseEffect( () => {\n\t\tregistry.batch( () => {\n\t\t\troutes.forEach( registerRoute );\n\t\t} );\n\t}, [ registry, registerRoute ] );\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAIA;AACA;AACA;;AAMA,MAAMM,MAAM,GAAG,CAAEC,uBAAa,EAAEC,iBAAU,CAAE;AAErC,SAASC,yBAAyBA,CAAA,EAAG;EAC3C,MAAMC,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAC9B,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,kBAAM,EAAE,IAAAC,iBAAW,EAAEC,YAAgB,CAAE,CAAC;EAClE,IAAAC,kBAAS,EAAE,MAAM;IAChBN,QAAQ,CAACO,KAAK,CAAE,MAAM;MACrBX,MAAM,CAACY,OAAO,CAAEN,aAAc,CAAC;IAChC,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEF,QAAQ,EAAEE,aAAa,CAAG,CAAC;AACjC","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_element","_lockUnlock","_store","_posts","_postItem","routes","postItemRoute","postsRoute","useRegisterPostsAppRoutes","registry","useRegistry","registerRoute","unlock","useDispatch","siteEditorStore","useEffect","batch","forEach"],"sources":["@wordpress/edit-site/src/components/posts-app-routes/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as siteEditorStore } from '../../store';\nimport { postsRoute } from './posts';\nimport { postItemRoute } from './post-item';\n\nconst routes = [ postItemRoute, postsRoute ];\n\nexport function useRegisterPostsAppRoutes() {\n\tconst registry = useRegistry();\n\tconst { registerRoute } = unlock( useDispatch( siteEditorStore ) );\n\tuseEffect( () => {\n\t\tregistry.batch( () => {\n\t\t\troutes.forEach( registerRoute );\n\t\t} );\n\t}, [ registry, registerRoute ] );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAIA;AACA;AACA;;AAMA,MAAMM,MAAM,GAAG,CAAEC,uBAAa,EAAEC,iBAAU,CAAE;AAErC,SAASC,yBAAyBA,CAAA,EAAG;EAC3C,MAAMC,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAC9B,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,kBAAM,EAAE,IAAAC,iBAAW,EAAEC,YAAgB,CAAE,CAAC;EAClE,IAAAC,kBAAS,EAAE,MAAM;IAChBN,QAAQ,CAACO,KAAK,CAAE,MAAM;MACrBX,MAAM,CAACY,OAAO,CAAEN,aAAc,CAAC;IAChC,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEF,QAAQ,EAAEE,aAAa,CAAG,CAAC;AACjC","ignoreList":[]}
@@ -11,6 +11,8 @@ var _components = require("@wordpress/components");
11
11
  var _compose = require("@wordpress/compose");
12
12
  var _i18n = require("@wordpress/i18n");
13
13
  var _router = require("@wordpress/router");
14
+ var _data = require("@wordpress/data");
15
+ var _coreData = require("@wordpress/core-data");
14
16
  var _lockUnlock = require("../../lock-unlock");
15
17
  var _url = require("@wordpress/url");
16
18
  var _jsxRuntime = require("react/jsx-runtime");
@@ -104,6 +106,12 @@ function ResizableFrame({
104
106
  const frameRef = (0, _element.useRef)(null);
105
107
  const resizableHandleHelpId = (0, _compose.useInstanceId)(ResizableFrame, 'edit-site-resizable-frame-handle-help');
106
108
  const defaultAspectRatio = defaultSize.width / defaultSize.height;
109
+ const isBlockTheme = (0, _data.useSelect)(select => {
110
+ const {
111
+ getCurrentTheme
112
+ } = select(_coreData.store);
113
+ return getCurrentTheme()?.is_block_theme;
114
+ }, []);
107
115
  const handleResizeStart = (_event, _direction, ref) => {
108
116
  // Remember the starting width so we don't have to get `ref.offsetWidth` on
109
117
  // every resize event thereafter, which will cause layout thrashing.
@@ -137,7 +145,7 @@ function ResizableFrame({
137
145
  }
138
146
  setIsOversized(false);
139
147
  const remainingWidth = ref.ownerDocument.documentElement.offsetWidth - ref.offsetWidth;
140
- if (remainingWidth > SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD) {
148
+ if (remainingWidth > SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD || !isBlockTheme) {
141
149
  // Reset the initial aspect ratio if the frame is resized slightly
142
150
  // above the sidebar but not far enough to trigger full screen.
143
151
  setFrameSize(INITIAL_FRAME_SIZE);
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_components","_compose","_i18n","_router","_lockUnlock","_url","_jsxRuntime","useLocation","useHistory","unlock","routerPrivateApis","HANDLE_STYLES_OVERRIDE","position","undefined","userSelect","cursor","width","height","top","right","bottom","left","FRAME_MIN_WIDTH","FRAME_REFERENCE_WIDTH","FRAME_TARGET_ASPECT_RATIO","SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD","INITIAL_FRAME_SIZE","calculateNewHeight","initialAspectRatio","lerp","a","b","amount","lerpFactor","Math","max","min","intermediateAspectRatio","ResizableFrame","isFullWidth","isOversized","setIsOversized","isReady","children","defaultSize","innerContentStyle","history","path","query","canvas","disableMotion","useReducedMotion","frameSize","setFrameSize","useState","startingWidth","setStartingWidth","isResizing","setIsResizing","shouldShowHandle","setShouldShowHandle","resizeRatio","setResizeRatio","FRAME_TRANSITION","type","duration","frameRef","useRef","resizableHandleHelpId","useInstanceId","defaultAspectRatio","handleResizeStart","_event","_direction","ref","offsetWidth","handleResize","_ref","delta","normalizedDelta","deltaAbs","abs","maxDoubledDelta","deltaToDouble","doubleSegment","singleSegment","updatedWidth","handleResizeStop","remainingWidth","ownerDocument","documentElement","navigate","addQueryArgs","transition","handleResizableHandleKeyDown","event","includes","key","preventDefault","step","shiftKey","isRTL","newWidth","current","resizable","frameAnimationVariants","default","flexGrow","fullWidth","resizeHandleVariants","hidden","opacity","visible","active","scaleY","currentResizeHandleVariant","jsx","ResizableBox","as","motion","div","initial","variants","animate","onAnimationComplete","definition","whileHover","scale","ease","size","enable","topRight","bottomRight","bottomLeft","topLeft","handleClasses","handleStyles","minWidth","maxWidth","maxHeight","onFocus","onBlur","onMouseOver","onMouseOut","handleComponent","jsxs","Fragment","Tooltip","text","__","__unstableMotion","button","role","className","clsx","onKeyDown","exit","whileFocus","id","onResizeStart","onResize","onResizeStop","showHandle","style","_default","exports"],"sources":["@wordpress/edit-site/src/components/resizable-frame/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useRef } from '@wordpress/element';\nimport {\n\tResizableBox,\n\tTooltip,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { useInstanceId, useReducedMotion } from '@wordpress/compose';\nimport { __, isRTL } from '@wordpress/i18n';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { addQueryArgs } from '@wordpress/url';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\n// Removes the inline styles in the drag handles.\nconst HANDLE_STYLES_OVERRIDE = {\n\tposition: undefined,\n\tuserSelect: undefined,\n\tcursor: undefined,\n\twidth: undefined,\n\theight: undefined,\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\n\n// The minimum width of the frame (in px) while resizing.\nconst FRAME_MIN_WIDTH = 320;\n// The reference width of the frame (in px) used to calculate the aspect ratio.\nconst FRAME_REFERENCE_WIDTH = 1300;\n// 9 : 19.5 is the target aspect ratio enforced (when possible) while resizing.\nconst FRAME_TARGET_ASPECT_RATIO = 9 / 19.5;\n// The minimum distance (in px) between the frame resize handle and the\n// viewport's edge. If the frame is resized to be closer to the viewport's edge\n// than this distance, then \"canvas mode\" will be enabled.\nconst SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD = 200;\n// Default size for the `frameSize` state.\nconst INITIAL_FRAME_SIZE = { width: '100%', height: '100%' };\n\nfunction calculateNewHeight( width, initialAspectRatio ) {\n\tconst lerp = ( a, b, amount ) => {\n\t\treturn a + ( b - a ) * amount;\n\t};\n\n\t// Calculate the intermediate aspect ratio based on the current width.\n\tconst lerpFactor =\n\t\t1 -\n\t\tMath.max(\n\t\t\t0,\n\t\t\tMath.min(\n\t\t\t\t1,\n\t\t\t\t( width - FRAME_MIN_WIDTH ) /\n\t\t\t\t\t( FRAME_REFERENCE_WIDTH - FRAME_MIN_WIDTH )\n\t\t\t)\n\t\t);\n\n\t// Calculate the height based on the intermediate aspect ratio\n\t// ensuring the frame arrives at the target aspect ratio.\n\tconst intermediateAspectRatio = lerp(\n\t\tinitialAspectRatio,\n\t\tFRAME_TARGET_ASPECT_RATIO,\n\t\tlerpFactor\n\t);\n\n\treturn width / intermediateAspectRatio;\n}\n\nfunction ResizableFrame( {\n\tisFullWidth,\n\tisOversized,\n\tsetIsOversized,\n\tisReady,\n\tchildren,\n\t/** The default (unresized) width/height of the frame, based on the space availalbe in the viewport. */\n\tdefaultSize,\n\tinnerContentStyle,\n} ) {\n\tconst history = useHistory();\n\tconst { path, query } = useLocation();\n\tconst { canvas = 'view' } = query;\n\tconst disableMotion = useReducedMotion();\n\tconst [ frameSize, setFrameSize ] = useState( INITIAL_FRAME_SIZE );\n\t// The width of the resizable frame when a new resize gesture starts.\n\tconst [ startingWidth, setStartingWidth ] = useState();\n\tconst [ isResizing, setIsResizing ] = useState( false );\n\tconst [ shouldShowHandle, setShouldShowHandle ] = useState( false );\n\tconst [ resizeRatio, setResizeRatio ] = useState( 1 );\n\n\tconst FRAME_TRANSITION = { type: 'tween', duration: isResizing ? 0 : 0.5 };\n\tconst frameRef = useRef( null );\n\tconst resizableHandleHelpId = useInstanceId(\n\t\tResizableFrame,\n\t\t'edit-site-resizable-frame-handle-help'\n\t);\n\tconst defaultAspectRatio = defaultSize.width / defaultSize.height;\n\n\tconst handleResizeStart = ( _event, _direction, ref ) => {\n\t\t// Remember the starting width so we don't have to get `ref.offsetWidth` on\n\t\t// every resize event thereafter, which will cause layout thrashing.\n\t\tsetStartingWidth( ref.offsetWidth );\n\t\tsetIsResizing( true );\n\t};\n\n\t// Calculate the frame size based on the window width as its resized.\n\tconst handleResize = ( _event, _direction, _ref, delta ) => {\n\t\tconst normalizedDelta = delta.width / resizeRatio;\n\t\tconst deltaAbs = Math.abs( normalizedDelta );\n\t\tconst maxDoubledDelta =\n\t\t\tdelta.width < 0 // is shrinking\n\t\t\t\t? deltaAbs\n\t\t\t\t: ( defaultSize.width - startingWidth ) / 2;\n\t\tconst deltaToDouble = Math.min( deltaAbs, maxDoubledDelta );\n\t\tconst doubleSegment = deltaAbs === 0 ? 0 : deltaToDouble / deltaAbs;\n\t\tconst singleSegment = 1 - doubleSegment;\n\n\t\tsetResizeRatio( singleSegment + doubleSegment * 2 );\n\n\t\tconst updatedWidth = startingWidth + delta.width;\n\n\t\tsetIsOversized( updatedWidth > defaultSize.width );\n\n\t\t// Width will be controlled by the library (via `resizeRatio`),\n\t\t// so we only need to update the height.\n\t\tsetFrameSize( {\n\t\t\theight: isOversized\n\t\t\t\t? '100%'\n\t\t\t\t: calculateNewHeight( updatedWidth, defaultAspectRatio ),\n\t\t} );\n\t};\n\n\tconst handleResizeStop = ( _event, _direction, ref ) => {\n\t\tsetIsResizing( false );\n\n\t\tif ( ! isOversized ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsOversized( false );\n\n\t\tconst remainingWidth =\n\t\t\tref.ownerDocument.documentElement.offsetWidth - ref.offsetWidth;\n\n\t\tif ( remainingWidth > SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD ) {\n\t\t\t// Reset the initial aspect ratio if the frame is resized slightly\n\t\t\t// above the sidebar but not far enough to trigger full screen.\n\t\t\tsetFrameSize( INITIAL_FRAME_SIZE );\n\t\t} else {\n\t\t\t// Trigger full screen if the frame is resized far enough to the left.\n\t\t\thistory.navigate(\n\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t} ),\n\t\t\t\t{\n\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\t// Handle resize by arrow keys\n\tconst handleResizableHandleKeyDown = ( event ) => {\n\t\tif ( ! [ 'ArrowLeft', 'ArrowRight' ].includes( event.key ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\tconst step = 20 * ( event.shiftKey ? 5 : 1 );\n\t\tconst delta =\n\t\t\tstep *\n\t\t\t( event.key === 'ArrowLeft' ? 1 : -1 ) *\n\t\t\t( isRTL() ? -1 : 1 );\n\t\tconst newWidth = Math.min(\n\t\t\tMath.max(\n\t\t\t\tFRAME_MIN_WIDTH,\n\t\t\t\tframeRef.current.resizable.offsetWidth + delta\n\t\t\t),\n\t\t\tdefaultSize.width\n\t\t);\n\n\t\tsetFrameSize( {\n\t\t\twidth: newWidth,\n\t\t\theight: calculateNewHeight( newWidth, defaultAspectRatio ),\n\t\t} );\n\t};\n\n\tconst frameAnimationVariants = {\n\t\tdefault: {\n\t\t\tflexGrow: 0,\n\t\t\theight: frameSize.height,\n\t\t},\n\t\tfullWidth: {\n\t\t\tflexGrow: 1,\n\t\t\theight: frameSize.height,\n\t\t},\n\t};\n\n\tconst resizeHandleVariants = {\n\t\thidden: {\n\t\t\topacity: 0,\n\t\t\t...( isRTL() ? { right: 0 } : { left: 0 } ),\n\t\t},\n\t\tvisible: {\n\t\t\topacity: 1,\n\t\t\t// Account for the handle's width.\n\t\t\t...( isRTL() ? { right: -14 } : { left: -14 } ),\n\t\t},\n\t\tactive: {\n\t\t\topacity: 1,\n\t\t\t// Account for the handle's width.\n\t\t\t...( isRTL() ? { right: -14 } : { left: -14 } ),\n\t\t\tscaleY: 1.3,\n\t\t},\n\t};\n\tconst currentResizeHandleVariant = ( () => {\n\t\tif ( isResizing ) {\n\t\t\treturn 'active';\n\t\t}\n\t\treturn shouldShowHandle ? 'visible' : 'hidden';\n\t} )();\n\n\treturn (\n\t\t<ResizableBox\n\t\t\tas={ motion.div }\n\t\t\tref={ frameRef }\n\t\t\tinitial={ false }\n\t\t\tvariants={ frameAnimationVariants }\n\t\t\tanimate={ isFullWidth ? 'fullWidth' : 'default' }\n\t\t\tonAnimationComplete={ ( definition ) => {\n\t\t\t\tif ( definition === 'fullWidth' ) {\n\t\t\t\t\tsetFrameSize( { width: '100%', height: '100%' } );\n\t\t\t\t}\n\t\t\t} }\n\t\t\twhileHover={\n\t\t\t\tcanvas === 'view'\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tscale: 1.005,\n\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\tduration: disableMotion ? 0 : 0.5,\n\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t }\n\t\t\t\t\t: {}\n\t\t\t}\n\t\t\ttransition={ FRAME_TRANSITION }\n\t\t\tsize={ frameSize }\n\t\t\tenable={ {\n\t\t\t\ttop: false,\n\t\t\t\tbottom: false,\n\t\t\t\t// Resizing will be disabled until the editor content is loaded.\n\t\t\t\t...( isRTL()\n\t\t\t\t\t? { right: isReady, left: false }\n\t\t\t\t\t: { left: isReady, right: false } ),\n\t\t\t\ttopRight: false,\n\t\t\t\tbottomRight: false,\n\t\t\t\tbottomLeft: false,\n\t\t\t\ttopLeft: false,\n\t\t\t} }\n\t\t\tresizeRatio={ resizeRatio }\n\t\t\thandleClasses={ undefined }\n\t\t\thandleStyles={ {\n\t\t\t\tleft: HANDLE_STYLES_OVERRIDE,\n\t\t\t\tright: HANDLE_STYLES_OVERRIDE,\n\t\t\t} }\n\t\t\tminWidth={ FRAME_MIN_WIDTH }\n\t\t\tmaxWidth={ isFullWidth ? '100%' : '150%' }\n\t\t\tmaxHeight=\"100%\"\n\t\t\tonFocus={ () => setShouldShowHandle( true ) }\n\t\t\tonBlur={ () => setShouldShowHandle( false ) }\n\t\t\tonMouseOver={ () => setShouldShowHandle( true ) }\n\t\t\tonMouseOut={ () => setShouldShowHandle( false ) }\n\t\t\thandleComponent={ {\n\t\t\t\t[ isRTL() ? 'right' : 'left' ]: canvas === 'view' && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Tooltip text={ __( 'Drag to resize' ) }>\n\t\t\t\t\t\t\t{ /* Disable reason: role=\"separator\" does in fact support aria-valuenow */ }\n\t\t\t\t\t\t\t{ /* eslint-disable-next-line jsx-a11y/role-supports-aria-props */ }\n\t\t\t\t\t\t\t<motion.button\n\t\t\t\t\t\t\t\tkey=\"handle\"\n\t\t\t\t\t\t\t\trole=\"separator\"\n\t\t\t\t\t\t\t\taria-orientation=\"vertical\"\n\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t'edit-site-resizable-frame__handle',\n\t\t\t\t\t\t\t\t\t{ 'is-resizing': isResizing }\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tvariants={ resizeHandleVariants }\n\t\t\t\t\t\t\t\tanimate={ currentResizeHandleVariant }\n\t\t\t\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\t\t\t\taria-describedby={ resizableHandleHelpId }\n\t\t\t\t\t\t\t\taria-valuenow={\n\t\t\t\t\t\t\t\t\tframeRef.current?.resizable?.offsetWidth ||\n\t\t\t\t\t\t\t\t\tundefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-valuemin={ FRAME_MIN_WIDTH }\n\t\t\t\t\t\t\t\taria-valuemax={ defaultSize.width }\n\t\t\t\t\t\t\t\tonKeyDown={ handleResizableHandleKeyDown }\n\t\t\t\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\t\t\t\texit=\"hidden\"\n\t\t\t\t\t\t\t\twhileFocus=\"active\"\n\t\t\t\t\t\t\t\twhileHover=\"active\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t<div hidden id={ resizableHandleHelpId }>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Use left and right arrow keys to resize the canvas. Hold shift to resize in larger increments.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t} }\n\t\t\tonResizeStart={ handleResizeStart }\n\t\t\tonResize={ handleResize }\n\t\t\tonResizeStop={ handleResizeStop }\n\t\t\tclassName={ clsx( 'edit-site-resizable-frame__inner', {\n\t\t\t\t'is-resizing': isResizing,\n\t\t\t} ) }\n\t\t\tshowHandle={ false } // Do not show the default handle, as we're using a custom one.\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-site-resizable-frame__inner-content\"\n\t\t\t\tstyle={ innerContentStyle }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</ResizableBox>\n\t);\n}\n\nexport default ResizableFrame;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AAA8C,IAAAQ,WAAA,GAAAR,OAAA;AAtB9C;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;;AAIA,MAAM;EAAES,WAAW;EAAEC;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;;AAE/D;AACA,MAAMC,sBAAsB,GAAG;EAC9BC,QAAQ,EAAEC,SAAS;EACnBC,UAAU,EAA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AAA,GAEcpE,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_components","_compose","_i18n","_router","_data","_coreData","_lockUnlock","_url","_jsxRuntime","useLocation","useHistory","unlock","routerPrivateApis","HANDLE_STYLES_OVERRIDE","position","undefined","userSelect","cursor","width","height","top","right","bottom","left","FRAME_MIN_WIDTH","FRAME_REFERENCE_WIDTH","FRAME_TARGET_ASPECT_RATIO","SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD","INITIAL_FRAME_SIZE","calculateNewHeight","initialAspectRatio","lerp","a","b","amount","lerpFactor","Math","max","min","intermediateAspectRatio","ResizableFrame","isFullWidth","isOversized","setIsOversized","isReady","children","defaultSize","innerContentStyle","history","path","query","canvas","disableMotion","useReducedMotion","frameSize","setFrameSize","useState","startingWidth","setStartingWidth","isResizing","setIsResizing","shouldShowHandle","setShouldShowHandle","resizeRatio","setResizeRatio","FRAME_TRANSITION","type","duration","frameRef","useRef","resizableHandleHelpId","useInstanceId","defaultAspectRatio","isBlockTheme","useSelect","select","getCurrentTheme","coreStore","is_block_theme","handleResizeStart","_event","_direction","ref","offsetWidth","handleResize","_ref","delta","normalizedDelta","deltaAbs","abs","maxDoubledDelta","deltaToDouble","doubleSegment","singleSegment","updatedWidth","handleResizeStop","remainingWidth","ownerDocument","documentElement","navigate","addQueryArgs","transition","handleResizableHandleKeyDown","event","includes","key","preventDefault","step","shiftKey","isRTL","newWidth","current","resizable","frameAnimationVariants","default","flexGrow","fullWidth","resizeHandleVariants","hidden","opacity","visible","active","scaleY","currentResizeHandleVariant","jsx","ResizableBox","as","motion","div","initial","variants","animate","onAnimationComplete","definition","whileHover","scale","ease","size","enable","topRight","bottomRight","bottomLeft","topLeft","handleClasses","handleStyles","minWidth","maxWidth","maxHeight","onFocus","onBlur","onMouseOver","onMouseOut","handleComponent","jsxs","Fragment","Tooltip","text","__","__unstableMotion","button","role","className","clsx","onKeyDown","exit","whileFocus","id","onResizeStart","onResize","onResizeStop","showHandle","style","_default","exports"],"sources":["@wordpress/edit-site/src/components/resizable-frame/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, useRef } from '@wordpress/element';\nimport {\n\tResizableBox,\n\tTooltip,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { useInstanceId, useReducedMotion } from '@wordpress/compose';\nimport { __, isRTL } from '@wordpress/i18n';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { addQueryArgs } from '@wordpress/url';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\n// Removes the inline styles in the drag handles.\nconst HANDLE_STYLES_OVERRIDE = {\n\tposition: undefined,\n\tuserSelect: undefined,\n\tcursor: undefined,\n\twidth: undefined,\n\theight: undefined,\n\ttop: undefined,\n\tright: undefined,\n\tbottom: undefined,\n\tleft: undefined,\n};\n\n// The minimum width of the frame (in px) while resizing.\nconst FRAME_MIN_WIDTH = 320;\n// The reference width of the frame (in px) used to calculate the aspect ratio.\nconst FRAME_REFERENCE_WIDTH = 1300;\n// 9 : 19.5 is the target aspect ratio enforced (when possible) while resizing.\nconst FRAME_TARGET_ASPECT_RATIO = 9 / 19.5;\n// The minimum distance (in px) between the frame resize handle and the\n// viewport's edge. If the frame is resized to be closer to the viewport's edge\n// than this distance, then \"canvas mode\" will be enabled.\nconst SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD = 200;\n// Default size for the `frameSize` state.\nconst INITIAL_FRAME_SIZE = { width: '100%', height: '100%' };\n\nfunction calculateNewHeight( width, initialAspectRatio ) {\n\tconst lerp = ( a, b, amount ) => {\n\t\treturn a + ( b - a ) * amount;\n\t};\n\n\t// Calculate the intermediate aspect ratio based on the current width.\n\tconst lerpFactor =\n\t\t1 -\n\t\tMath.max(\n\t\t\t0,\n\t\t\tMath.min(\n\t\t\t\t1,\n\t\t\t\t( width - FRAME_MIN_WIDTH ) /\n\t\t\t\t\t( FRAME_REFERENCE_WIDTH - FRAME_MIN_WIDTH )\n\t\t\t)\n\t\t);\n\n\t// Calculate the height based on the intermediate aspect ratio\n\t// ensuring the frame arrives at the target aspect ratio.\n\tconst intermediateAspectRatio = lerp(\n\t\tinitialAspectRatio,\n\t\tFRAME_TARGET_ASPECT_RATIO,\n\t\tlerpFactor\n\t);\n\n\treturn width / intermediateAspectRatio;\n}\n\nfunction ResizableFrame( {\n\tisFullWidth,\n\tisOversized,\n\tsetIsOversized,\n\tisReady,\n\tchildren,\n\t/** The default (unresized) width/height of the frame, based on the space availalbe in the viewport. */\n\tdefaultSize,\n\tinnerContentStyle,\n} ) {\n\tconst history = useHistory();\n\tconst { path, query } = useLocation();\n\tconst { canvas = 'view' } = query;\n\tconst disableMotion = useReducedMotion();\n\tconst [ frameSize, setFrameSize ] = useState( INITIAL_FRAME_SIZE );\n\t// The width of the resizable frame when a new resize gesture starts.\n\tconst [ startingWidth, setStartingWidth ] = useState();\n\tconst [ isResizing, setIsResizing ] = useState( false );\n\tconst [ shouldShowHandle, setShouldShowHandle ] = useState( false );\n\tconst [ resizeRatio, setResizeRatio ] = useState( 1 );\n\n\tconst FRAME_TRANSITION = { type: 'tween', duration: isResizing ? 0 : 0.5 };\n\tconst frameRef = useRef( null );\n\tconst resizableHandleHelpId = useInstanceId(\n\t\tResizableFrame,\n\t\t'edit-site-resizable-frame-handle-help'\n\t);\n\tconst defaultAspectRatio = defaultSize.width / defaultSize.height;\n\tconst isBlockTheme = useSelect( ( select ) => {\n\t\tconst { getCurrentTheme } = select( coreStore );\n\t\treturn getCurrentTheme()?.is_block_theme;\n\t}, [] );\n\n\tconst handleResizeStart = ( _event, _direction, ref ) => {\n\t\t// Remember the starting width so we don't have to get `ref.offsetWidth` on\n\t\t// every resize event thereafter, which will cause layout thrashing.\n\t\tsetStartingWidth( ref.offsetWidth );\n\t\tsetIsResizing( true );\n\t};\n\n\t// Calculate the frame size based on the window width as its resized.\n\tconst handleResize = ( _event, _direction, _ref, delta ) => {\n\t\tconst normalizedDelta = delta.width / resizeRatio;\n\t\tconst deltaAbs = Math.abs( normalizedDelta );\n\t\tconst maxDoubledDelta =\n\t\t\tdelta.width < 0 // is shrinking\n\t\t\t\t? deltaAbs\n\t\t\t\t: ( defaultSize.width - startingWidth ) / 2;\n\t\tconst deltaToDouble = Math.min( deltaAbs, maxDoubledDelta );\n\t\tconst doubleSegment = deltaAbs === 0 ? 0 : deltaToDouble / deltaAbs;\n\t\tconst singleSegment = 1 - doubleSegment;\n\n\t\tsetResizeRatio( singleSegment + doubleSegment * 2 );\n\n\t\tconst updatedWidth = startingWidth + delta.width;\n\n\t\tsetIsOversized( updatedWidth > defaultSize.width );\n\n\t\t// Width will be controlled by the library (via `resizeRatio`),\n\t\t// so we only need to update the height.\n\t\tsetFrameSize( {\n\t\t\theight: isOversized\n\t\t\t\t? '100%'\n\t\t\t\t: calculateNewHeight( updatedWidth, defaultAspectRatio ),\n\t\t} );\n\t};\n\n\tconst handleResizeStop = ( _event, _direction, ref ) => {\n\t\tsetIsResizing( false );\n\n\t\tif ( ! isOversized ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsOversized( false );\n\n\t\tconst remainingWidth =\n\t\t\tref.ownerDocument.documentElement.offsetWidth - ref.offsetWidth;\n\n\t\tif (\n\t\t\tremainingWidth > SNAP_TO_EDIT_CANVAS_MODE_THRESHOLD ||\n\t\t\t! isBlockTheme\n\t\t) {\n\t\t\t// Reset the initial aspect ratio if the frame is resized slightly\n\t\t\t// above the sidebar but not far enough to trigger full screen.\n\t\t\tsetFrameSize( INITIAL_FRAME_SIZE );\n\t\t} else {\n\t\t\t// Trigger full screen if the frame is resized far enough to the left.\n\t\t\thistory.navigate(\n\t\t\t\taddQueryArgs( path, {\n\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t} ),\n\t\t\t\t{\n\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\t// Handle resize by arrow keys\n\tconst handleResizableHandleKeyDown = ( event ) => {\n\t\tif ( ! [ 'ArrowLeft', 'ArrowRight' ].includes( event.key ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\tconst step = 20 * ( event.shiftKey ? 5 : 1 );\n\t\tconst delta =\n\t\t\tstep *\n\t\t\t( event.key === 'ArrowLeft' ? 1 : -1 ) *\n\t\t\t( isRTL() ? -1 : 1 );\n\t\tconst newWidth = Math.min(\n\t\t\tMath.max(\n\t\t\t\tFRAME_MIN_WIDTH,\n\t\t\t\tframeRef.current.resizable.offsetWidth + delta\n\t\t\t),\n\t\t\tdefaultSize.width\n\t\t);\n\n\t\tsetFrameSize( {\n\t\t\twidth: newWidth,\n\t\t\theight: calculateNewHeight( newWidth, defaultAspectRatio ),\n\t\t} );\n\t};\n\n\tconst frameAnimationVariants = {\n\t\tdefault: {\n\t\t\tflexGrow: 0,\n\t\t\theight: frameSize.height,\n\t\t},\n\t\tfullWidth: {\n\t\t\tflexGrow: 1,\n\t\t\theight: frameSize.height,\n\t\t},\n\t};\n\n\tconst resizeHandleVariants = {\n\t\thidden: {\n\t\t\topacity: 0,\n\t\t\t...( isRTL() ? { right: 0 } : { left: 0 } ),\n\t\t},\n\t\tvisible: {\n\t\t\topacity: 1,\n\t\t\t// Account for the handle's width.\n\t\t\t...( isRTL() ? { right: -14 } : { left: -14 } ),\n\t\t},\n\t\tactive: {\n\t\t\topacity: 1,\n\t\t\t// Account for the handle's width.\n\t\t\t...( isRTL() ? { right: -14 } : { left: -14 } ),\n\t\t\tscaleY: 1.3,\n\t\t},\n\t};\n\tconst currentResizeHandleVariant = ( () => {\n\t\tif ( isResizing ) {\n\t\t\treturn 'active';\n\t\t}\n\t\treturn shouldShowHandle ? 'visible' : 'hidden';\n\t} )();\n\n\treturn (\n\t\t<ResizableBox\n\t\t\tas={ motion.div }\n\t\t\tref={ frameRef }\n\t\t\tinitial={ false }\n\t\t\tvariants={ frameAnimationVariants }\n\t\t\tanimate={ isFullWidth ? 'fullWidth' : 'default' }\n\t\t\tonAnimationComplete={ ( definition ) => {\n\t\t\t\tif ( definition === 'fullWidth' ) {\n\t\t\t\t\tsetFrameSize( { width: '100%', height: '100%' } );\n\t\t\t\t}\n\t\t\t} }\n\t\t\twhileHover={\n\t\t\t\tcanvas === 'view'\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tscale: 1.005,\n\t\t\t\t\t\t\ttransition: {\n\t\t\t\t\t\t\t\tduration: disableMotion ? 0 : 0.5,\n\t\t\t\t\t\t\t\tease: 'easeOut',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t }\n\t\t\t\t\t: {}\n\t\t\t}\n\t\t\ttransition={ FRAME_TRANSITION }\n\t\t\tsize={ frameSize }\n\t\t\tenable={ {\n\t\t\t\ttop: false,\n\t\t\t\tbottom: false,\n\t\t\t\t// Resizing will be disabled until the editor content is loaded.\n\t\t\t\t...( isRTL()\n\t\t\t\t\t? { right: isReady, left: false }\n\t\t\t\t\t: { left: isReady, right: false } ),\n\t\t\t\ttopRight: false,\n\t\t\t\tbottomRight: false,\n\t\t\t\tbottomLeft: false,\n\t\t\t\ttopLeft: false,\n\t\t\t} }\n\t\t\tresizeRatio={ resizeRatio }\n\t\t\thandleClasses={ undefined }\n\t\t\thandleStyles={ {\n\t\t\t\tleft: HANDLE_STYLES_OVERRIDE,\n\t\t\t\tright: HANDLE_STYLES_OVERRIDE,\n\t\t\t} }\n\t\t\tminWidth={ FRAME_MIN_WIDTH }\n\t\t\tmaxWidth={ isFullWidth ? '100%' : '150%' }\n\t\t\tmaxHeight=\"100%\"\n\t\t\tonFocus={ () => setShouldShowHandle( true ) }\n\t\t\tonBlur={ () => setShouldShowHandle( false ) }\n\t\t\tonMouseOver={ () => setShouldShowHandle( true ) }\n\t\t\tonMouseOut={ () => setShouldShowHandle( false ) }\n\t\t\thandleComponent={ {\n\t\t\t\t[ isRTL() ? 'right' : 'left' ]: canvas === 'view' && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<Tooltip text={ __( 'Drag to resize' ) }>\n\t\t\t\t\t\t\t{ /* Disable reason: role=\"separator\" does in fact support aria-valuenow */ }\n\t\t\t\t\t\t\t{ /* eslint-disable-next-line jsx-a11y/role-supports-aria-props */ }\n\t\t\t\t\t\t\t<motion.button\n\t\t\t\t\t\t\t\tkey=\"handle\"\n\t\t\t\t\t\t\t\trole=\"separator\"\n\t\t\t\t\t\t\t\taria-orientation=\"vertical\"\n\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t'edit-site-resizable-frame__handle',\n\t\t\t\t\t\t\t\t\t{ 'is-resizing': isResizing }\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tvariants={ resizeHandleVariants }\n\t\t\t\t\t\t\t\tanimate={ currentResizeHandleVariant }\n\t\t\t\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\t\t\t\taria-describedby={ resizableHandleHelpId }\n\t\t\t\t\t\t\t\taria-valuenow={\n\t\t\t\t\t\t\t\t\tframeRef.current?.resizable?.offsetWidth ||\n\t\t\t\t\t\t\t\t\tundefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-valuemin={ FRAME_MIN_WIDTH }\n\t\t\t\t\t\t\t\taria-valuemax={ defaultSize.width }\n\t\t\t\t\t\t\t\tonKeyDown={ handleResizableHandleKeyDown }\n\t\t\t\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\t\t\t\texit=\"hidden\"\n\t\t\t\t\t\t\t\twhileFocus=\"active\"\n\t\t\t\t\t\t\t\twhileHover=\"active\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t<div hidden id={ resizableHandleHelpId }>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Use left and right arrow keys to resize the canvas. Hold shift to resize in larger increments.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t),\n\t\t\t} }\n\t\t\tonResizeStart={ handleResizeStart }\n\t\t\tonResize={ handleResize }\n\t\t\tonResizeStop={ handleResizeStop }\n\t\t\tclassName={ clsx( 'edit-site-resizable-frame__inner', {\n\t\t\t\t'is-resizing': isResizing,\n\t\t\t} ) }\n\t\t\tshowHandle={ false } // Do not show the default handle, as we're using a custom one.\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName=\"edit-site-resizable-frame__inner-content\"\n\t\t\t\tstyle={ innerContentStyle }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</ResizableBox>\n\t);\n}\n\nexport default ResizableFrame;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAKA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,IAAA,GAAAT,OAAA;AAA8C,IAAAU,WAAA,GAAAV,OAAA;AAxB9C;AACA;AACA;;AAGA;AACA;AACA;;AAaA;AACA;AACA;;AAIA,MAAM;EAAEW,WAAW;EAAEC;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;;AAE/D;AACA,MAAMC,sBAAsB,GAAG;EAC9BC,QAAQ,EAAEC,SAAS;EACnBC,UAAU,EAAED,SAAS;EACrBE,MAAM,EAAEF,SAAS;EACjBG,KAAK,EAAEH,SAAS;EAChBI,MAAM,EAAEJ,SAAS;EACjBK,GAAG,EAAEL,SAAS;EACdM,KAA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AA,EAEzBA;IAAQ,CACN;EAAC,CACO,CAAC;AAEjB;AAAC,IAAA+H,QAAA,GAAAC,OAAA,CAAA3D,OAAA,GAEc1E,cAAc","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_components","_i18n","_coreData","_keycodes","_router","_editor","_store","_isPreviewingTheme","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","SaveButton","className","variant","showTooltip","showReviewMessage","icon","size","__next40pxDefaultSize","params","setIsSaveViewOpened","useDispatch","editSiteStore","saveDirtyEntities","editorStore","dirtyEntityRecords","useEntitiesSavedStatesIsDirty","isSaving","isSaveViewOpen","previewingThemeName","useSelect","select","isSavingEntityRecord","isResolving","coreStore","isSaveViewOpened","isActivatingTheme","currentlyPreviewingThemeId","currentlyPreviewingTheme","some","record","kind","name","key","getTheme","rendered","undefined","hasDirtyEntities","length","isOnlyCurrentEntityDirty","postId","postType","path","includes","disabled","isPreviewingTheme","getLabel","sprintf","__","_n","label","onClick","jsx","Button","isBusy","shortcut","displayShortcut","primary","children"],"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport {\n\tuseEntitiesSavedStatesIsDirty,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport {\n\tcurrentlyPreviewingTheme,\n\tisPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function SaveButton( {\n\tclassName = 'edit-site-save-button__button',\n\tvariant = 'primary',\n\tshowTooltip = true,\n\tshowReviewMessage,\n\ticon,\n\tsize,\n\t__next40pxDefaultSize = false,\n} ) {\n\tconst { params } = useLocation();\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst { saveDirtyEntities } = unlock( useDispatch( editorStore ) );\n\tconst { dirtyEntityRecords } = useEntitiesSavedStatesIsDirty();\n\tconst { isSaving, isSaveViewOpen, previewingThemeName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isSavingEntityRecord, isResolving } = select( coreStore );\n\t\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\t\t\treturn {\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t) || isActivatingTheme,\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[ dirtyEntityRecords ]\n\t);\n\tconst hasDirtyEntities = !! dirtyEntityRecords.length;\n\tlet isOnlyCurrentEntityDirty;\n\t// Check if the current entity is the only entity with changes.\n\t// We have some extra logic for `wp_global_styles` for now, that\n\t// is used in navigation sidebar.\n\tif ( dirtyEntityRecords.length === 1 ) {\n\t\tif ( params.postId ) {\n\t\t\tisOnlyCurrentEntityDirty =\n\t\t\t\t`${ dirtyEntityRecords[ 0 ].key }` === params.postId &&\n\t\t\t\tdirtyEntityRecords[ 0 ].name === params.postType;\n\t\t} else if ( params.path?.includes( 'wp_global_styles' ) ) {\n\t\t\tisOnlyCurrentEntityDirty =\n\t\t\t\tdirtyEntityRecords[ 0 ].name === 'globalStyles';\n\t\t}\n\t}\n\tconst disabled =\n\t\tisSaving || ( ! hasDirtyEntities && ! isPreviewingTheme() );\n\tconst getLabel = () => {\n\t\tif ( isPreviewingTheme() ) {\n\t\t\tif ( isSaving ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activating %s' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t} else if ( disabled ) {\n\t\t\t\treturn __( 'Saved' );\n\t\t\t} else if ( hasDirtyEntities ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activate %s & Save' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t__( 'Activate %s' ),\n\t\t\t\tpreviewingThemeName\n\t\t\t);\n\t\t}\n\t\tif ( isSaving ) {\n\t\t\treturn __( 'Saving' );\n\t\t}\n\t\tif ( disabled ) {\n\t\t\treturn __( 'Saved' );\n\t\t}\n\t\tif ( ! isOnlyCurrentEntityDirty && showReviewMessage ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: %d: number of unsaved changes (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Review %d change…',\n\t\t\t\t\t'Review %d changes…',\n\t\t\t\t\tdirtyEntityRecords.length\n\t\t\t\t),\n\t\t\t\tdirtyEntityRecords.length\n\t\t\t);\n\t\t}\n\t\treturn __( 'Save' );\n\t};\n\tconst label = getLabel();\n\tconst onClick = isOnlyCurrentEntityDirty\n\t\t? () => saveDirtyEntities( { dirtyEntityRecords } )\n\t\t: () => setIsSaveViewOpened( true );\n\treturn (\n\t\t<Button\n\t\t\tvariant={ variant }\n\t\t\tclassName={ className }\n\t\t\taria-disabled={ disabled }\n\t\t\taria-expanded={ isSaveViewOpen }\n\t\t\tisBusy={ isSaving }\n\t\t\tonClick={ disabled ? undefined : onClick }\n\t\t\tlabel={ label }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ disabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\t/*\n\t\t\t * Displaying the keyboard shortcut conditionally makes the tooltip\n\t\t\t * itself show conditionally. This would trigger a full-rerendering\n\t\t\t * of the button that we want to avoid. By setting `showTooltip`,\n\t\t\t * the tooltip is always rendered even when there's no keyboard shortcut.\n\t\t\t */\n\t\t\tshowTooltip={ showTooltip }\n\t\t\ticon={ icon }\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\tsize={ size }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAQA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AAIA,IAAAS,WAAA,GAAAT,OAAA;AAA2C,IAAAU,WAAA,GAAAV,OAAA;AAtB3C;AACA;AACA;;AAYA;AACA;AACA;;AAQA,MAAM;EAAEW;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEpC,SAASC,UAAUA,CAAE;EACnCC,SAAS,GAAG,+BAA+B;EAC3CC,OAAO,GAAG,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AAE,EAAE,OAAQ,CAAC;IACrB;IACA,IAAK,CAAET,wBAAwB,IAAIlC,iBAAiB,EAAG;MACtD,OAAO,IAAA0C,aAAO;MACb;MACA,IAAAE,QAAE,EACD,mBAAmB,EACnB,oBAAoB,EACpBlC,kBAAkB,CAACuB,MACpB,CAAC,EACDvB,kBAAkB,CAACuB,MACpB,CAAC;IACF;IACA,OAAO,IAAAU,QAAE,EAAE,MAAO,CAAC;EACpB,CAAC;EACD,MAAME,KAAK,GAAGJ,QAAQ,CAAC,CAAC;EACxB,MAAMK,OAAO,GAAGZ,wBAAwB,GACrC,MAAM1B,iBAAiB,CAAE;IAAEE;EAAmB,CAAE,CAAC,GACjD,MAAML,mBAAmB,CAAE,IAAK,CAAC;EACpC,oBACC,IAAAb,WAAA,CAAAuD,GAAA,EAAChE,WAAA,CAAAiE,MAAM;IACNlD,OAAO,EAAGA,OAAS;IACnBD,SAAS,EAAGA,SAAW;IACvB,iBAAgB0C,QAAU;IAC1B,iBAAgB1B,cAAgB;IAChCoC,MAAM,EAAGrC,QAAU;IACnBkC,OAAO,EAAGP,QAAQ,GAAGR,SAAS,GAAGe,OAAS;IAC1CD,KAAK,EAAGA;IACR;AACH;AACA;AACA,OAHG;IAIAK,QAAQ,EAAGX,QAAQ,GAAGR,SAAS,GAAGoB,yBAAe,CAACC,OAAO,CAAE,GAAI;IAC/D;AACH;AACA;AACA;AACA;AACA,OALG;IAMArD,WAAW,EAAGA,WAAa;IAC3BE,IAAI,EAAGA,IAAM;IACbE,qBAAqB,EAAGA,qBAAuB;IAC/CD,IAAI,EAAGA,IAAM;IAAAmD,QAAA,EAEXR;EAAK,CACA,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_components","_i18n","_coreData","_keycodes","_router","_editor","_store","_isPreviewingTheme","_lockUnlock","_jsxRuntime","useLocation","unlock","routerPrivateApis","SaveButton","className","variant","showTooltip","showReviewMessage","icon","size","__next40pxDefaultSize","params","setIsSaveViewOpened","useDispatch","editSiteStore","saveDirtyEntities","editorStore","dirtyEntityRecords","useEntitiesSavedStatesIsDirty","isSaving","isSaveViewOpen","previewingThemeName","useSelect","select","isSavingEntityRecord","isResolving","coreStore","isSaveViewOpened","isActivatingTheme","currentlyPreviewingThemeId","currentlyPreviewingTheme","some","record","kind","name","key","getTheme","rendered","undefined","hasDirtyEntities","length","isOnlyCurrentEntityDirty","postId","postType","path","includes","disabled","isPreviewingTheme","getLabel","sprintf","__","_n","label","onClick","jsx","Button","isBusy","shortcut","displayShortcut","primary","children"],"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport {\n\tuseEntitiesSavedStatesIsDirty,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport {\n\tcurrentlyPreviewingTheme,\n\tisPreviewingTheme,\n} from '../../utils/is-previewing-theme';\nimport { unlock } from '../../lock-unlock';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function SaveButton( {\n\tclassName = 'edit-site-save-button__button',\n\tvariant = 'primary',\n\tshowTooltip = true,\n\tshowReviewMessage,\n\ticon,\n\tsize,\n\t__next40pxDefaultSize = false,\n} ) {\n\tconst { params } = useLocation();\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst { saveDirtyEntities } = unlock( useDispatch( editorStore ) );\n\tconst { dirtyEntityRecords } = useEntitiesSavedStatesIsDirty();\n\tconst { isSaving, isSaveViewOpen, previewingThemeName } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isSavingEntityRecord, isResolving } = select( coreStore );\n\t\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst currentlyPreviewingThemeId = currentlyPreviewingTheme();\n\t\t\treturn {\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t) || isActivatingTheme,\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\t// Do not call `getTheme` with null, it will cause a request to\n\t\t\t\t// the server.\n\t\t\t\tpreviewingThemeName: currentlyPreviewingThemeId\n\t\t\t\t\t? select( coreStore ).getTheme( currentlyPreviewingThemeId )\n\t\t\t\t\t\t\t?.name?.rendered\n\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t},\n\t\t[ dirtyEntityRecords ]\n\t);\n\tconst hasDirtyEntities = !! dirtyEntityRecords.length;\n\tlet isOnlyCurrentEntityDirty;\n\t// Check if the current entity is the only entity with changes.\n\t// We have some extra logic for `wp_global_styles` for now, that\n\t// is used in navigation sidebar.\n\tif ( dirtyEntityRecords.length === 1 ) {\n\t\tif ( params.postId ) {\n\t\t\tisOnlyCurrentEntityDirty =\n\t\t\t\t`${ dirtyEntityRecords[ 0 ].key }` === params.postId &&\n\t\t\t\tdirtyEntityRecords[ 0 ].name === params.postType;\n\t\t} else if ( params.path?.includes( 'wp_global_styles' ) ) {\n\t\t\tisOnlyCurrentEntityDirty =\n\t\t\t\tdirtyEntityRecords[ 0 ].name === 'globalStyles';\n\t\t}\n\t}\n\tconst disabled =\n\t\tisSaving || ( ! hasDirtyEntities && ! isPreviewingTheme() );\n\tconst getLabel = () => {\n\t\tif ( isPreviewingTheme() ) {\n\t\t\tif ( isSaving ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activating %s' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t} else if ( disabled ) {\n\t\t\t\treturn __( 'Saved' );\n\t\t\t} else if ( hasDirtyEntities ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activate %s & Save' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t__( 'Activate %s' ),\n\t\t\t\tpreviewingThemeName\n\t\t\t);\n\t\t}\n\t\tif ( isSaving ) {\n\t\t\treturn __( 'Saving' );\n\t\t}\n\t\tif ( disabled ) {\n\t\t\treturn __( 'Saved' );\n\t\t}\n\t\tif ( ! isOnlyCurrentEntityDirty && showReviewMessage ) {\n\t\t\treturn sprintf(\n\t\t\t\t// translators: %d: number of unsaved changes (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Review %d change…',\n\t\t\t\t\t'Review %d changes…',\n\t\t\t\t\tdirtyEntityRecords.length\n\t\t\t\t),\n\t\t\t\tdirtyEntityRecords.length\n\t\t\t);\n\t\t}\n\t\treturn __( 'Save' );\n\t};\n\tconst label = getLabel();\n\tconst onClick = isOnlyCurrentEntityDirty\n\t\t? () => saveDirtyEntities( { dirtyEntityRecords } )\n\t\t: () => setIsSaveViewOpened( true );\n\treturn (\n\t\t<Button\n\t\t\tvariant={ variant }\n\t\t\tclassName={ className }\n\t\t\taria-disabled={ disabled }\n\t\t\taria-expanded={ isSaveViewOpen }\n\t\t\tisBusy={ isSaving }\n\t\t\tonClick={ disabled ? undefined : onClick }\n\t\t\tlabel={ label }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ disabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\t/*\n\t\t\t * Displaying the keyboard shortcut conditionally makes the tooltip\n\t\t\t * itself show conditionally. This would trigger a full-rerendering\n\t\t\t * of the button that we want to avoid. By setting `showTooltip`,\n\t\t\t * the tooltip is always rendered even when there's no keyboard shortcut.\n\t\t\t */\n\t\t\tshowTooltip={ showTooltip }\n\t\t\ticon={ icon }\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\tsize={ size }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAQA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AAIA,IAAAS,WAAA,GAAAT,OAAA;AAA2C,IAAAU,WAAA,GAAAV,OAAA;AAtB3C;AACA;AACA;;AAYA;AACA;AACA;;AAQA,MAAM;EAAEW;AAAY,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEpC,SAASC,UAAUA,CAAE;EACnCC,SAAS,GAAG,+BAA+B;EAC3CC,OAAO,GAAG,SAAS;EACnBC,WAAW,GAAG,IAAI;EAClBC,iBAAiB;EACjBC,IAAI;EACJC,IAAI;EACJC,qBAAqB,GAAG;AACzB,CAAC,EAAG;EACH,MAAM;IAAEC;EAAO,CAAC,GAAGX,WAAW,CAAC,CAAC;EAChC,MAAM;IAAEY;EAAoB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAc,CAAC;EAC5D,MAAM;IAAEC;EAAkB,CAAC,GAAG,IAAAd,kBAAM,EAAE,IAAAY,iBAAW,EAAEG,aAAY,CAAE,CAAC;EAClE,MAAM;IAAEC;EAAmB,CAAC,GAAG,IAAAC,qCAA6B,EAAC,CAAC;EAC9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CAAE,CAAC,GACjD,MAAML,mBAAmB,CAAE,IAAK,CAAC;EACpC,oBACC,IAAAb,WAAA,CAAAuD,GAAA,EAAChE,WAAA,CAAAiE,MAAM;IACNlD,OAAO,EAAGA,OAAS;IACnBD,SAAS,EAAGA,SAAW;IACvB,iBAAgB0C,QAAU;IAC1B,iBAAgB1B,cAAgB;IAChCoC,MAAM,EAAGrC,QAAU;IACnBkC,OAAO,EAAGP,QAAQ,GAAGR,SAAS,GAAGe,OAAS;IAC1CD,KAAK,EAAGA;IACR;AACH;AACA;AACA,OAHG;IAIAK,QAAQ,EAAGX,QAAQ,GAAGR,SAAS,GAAGoB,yBAAe,CAACC,OAAO,CAAE,GAAI;IAC/D;AACH;AACA;AACA;AACA;AACA,OALG;IAMArD,WAAW,EAAGA,WAAa;IAC3BE,IAAI,EAAGA,IAAM;IACbE,qBAAqB,EAAGA,qBAAuB;IAC/CD,IAAI,EAAGA,IAAM;IAAAmD,QAAA,EAEXR;EAAK,CACA,CAAC;AAEX","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_components","_coreData","_icons","_saveButton","_interopRequireDefault","_isPreviewingTheme","_jsxRuntime","SaveHub","isDisabled","isSaving","useSelect","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","_isSaving","some","record","kind","name","key","length","isPreviewingTheme","jsx","__experimentalHStack","className","alignment","spacing","children","default","variant","showTooltip","icon","check","showReviewMessage","__next40pxDefaultSize"],"sources":["@wordpress/edit-site/src/components/save-hub/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SaveButton from '../save-button';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nexport default function SaveHub() {\n\tconst { isDisabled, isSaving } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst _isSaving = dirtyEntityRecords.some( ( record ) =>\n\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t);\n\t\treturn {\n\t\t\tisSaving: _isSaving,\n\t\t\tisDisabled:\n\t\t\t\t_isSaving ||\n\t\t\t\t( ! dirtyEntityRecords.length && ! isPreviewingTheme() ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<HStack className=\"edit-site-save-hub\" alignment=\"right\" spacing={ 4 }>\n\t\t\t<SaveButton\n\t\t\t\tclassName=\"edit-site-save-hub__button\"\n\t\t\t\tvariant={ isDisabled ? null : 'primary' }\n\t\t\t\tshowTooltip={ false }\n\t\t\t\ticon={ isDisabled && ! isSaving ? check : null }\n\t\t\t\tshowReviewMessage\n\t\t\t\t__next40pxDefaultSize\n\t\t\t/>\n\t\t</HStack>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AAAoE,IAAAO,WAAA,GAAAP,OAAA;AAZpE;AACA;AACA;;AAMA;AACA;AACA;;AAIe,SAASQ,OAAOA,CAAA,EAAG;EACjC,MAAM;IAAEC,UAAU;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACzD,MAAM;MAAEC,mCAAmC;MAAEC;IAAqB,CAAC,GAClEF,MAAM,CAAEG,eAAU,CAAC;IACpB,MAAMC,kBAAkB,GAAGH,mCAAmC,CAAC,CAAC;IAChE,MAAMI,SAAS,GAAGD,kBAAkB,CAACE,IAAI,CAAIC,MAAM,IAClDL,oBAAoB,CAAEK,MAAM,CAACC,IAAI,EAAED,MAAM,CAACE,IAAI,EAAEF,MAAM,CAACG,GAAI,CAC5D,CAAC;IACD,OAAO;MACNZ,QAAQ,EAAEO,SAAS;MACnBR,UAAU,EACTQ,SAAS,IACP,CAAED,kBAAkB,CAACO,MAAM,IAAI,CAAE,IAAAC,oCAAiB,EAAC;IACvD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,oBACC,IAAAjB,WAAA,CAAAkB,GAAA,EAACxB,WAAA,CAAAyB,oBAAM;IAACC,SAAS,EAAC,oBAAoB;IAACC,SAAS,EAAC,OAAO;IAACC,OAAO,EAAG,CAAG;IAAAC,QAAA,eACrE,IAAAvB,WAAA,CAAAkB,GAAA,EAACrB,WAAA,CAAA2B,OAAU;MACVJ,SAAS,EAAC,4BAA4B;MACtCK,OAAO,EAAGvB,UAAU,GAAG,IAAI,GAAG,SAAW;MACzCwB,WAAW,EAAG,KAAO;MACrBC,IAAI,EAAGzB,UAAU,IAAI,CAAEC,QAAQ,GAAGyB,YAAK,GAAG,IAAM;MAChDC,iBAAiB;MACjBC,qBAAqB;IAAA,CACrB;EAAC,CACK,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_components","_coreData","_icons","_saveButton","_interopRequireDefault","_isPreviewingTheme","_jsxRuntime","SaveHub","isDisabled","isSaving","useSelect","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","coreStore","dirtyEntityRecords","_isSaving","some","record","kind","name","key","length","isPreviewingTheme","jsx","__experimentalHStack","className","alignment","spacing","children","default","variant","showTooltip","icon","check","showReviewMessage","__next40pxDefaultSize"],"sources":["@wordpress/edit-site/src/components/save-hub/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { __experimentalHStack as HStack } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { check } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SaveButton from '../save-button';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nexport default function SaveHub() {\n\tconst { isDisabled, isSaving } = useSelect( ( select ) => {\n\t\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst _isSaving = dirtyEntityRecords.some( ( record ) =>\n\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t);\n\t\treturn {\n\t\t\tisSaving: _isSaving,\n\t\t\tisDisabled:\n\t\t\t\t_isSaving ||\n\t\t\t\t( ! dirtyEntityRecords.length && ! isPreviewingTheme() ),\n\t\t};\n\t}, [] );\n\treturn (\n\t\t<HStack className=\"edit-site-save-hub\" alignment=\"right\" spacing={ 4 }>\n\t\t\t<SaveButton\n\t\t\t\tclassName=\"edit-site-save-hub__button\"\n\t\t\t\tvariant={ isDisabled ? null : 'primary' }\n\t\t\t\tshowTooltip={ false }\n\t\t\t\ticon={ isDisabled && ! isSaving ? check : null }\n\t\t\t\tshowReviewMessage\n\t\t\t\t__next40pxDefaultSize\n\t\t\t/>\n\t\t</HStack>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AAAoE,IAAAO,WAAA,GAAAP,OAAA;AAZpE;AACA;AACA;;AAMA;AACA;AACA;;AAIe,SAASQ,OAAOA,CAAA,EAAG;EACjC,MAAM;IAAEC,UAAU;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACzD,MAAM;MAAEC,mCAAmC;MAAEC;IAAqB,CAAC,GAClEF,MAAM,CAAEG,eAAU,CAAC;IACpB,MAAMC,kBAAkB,GAAGH,mCAAmC,CAAC,CAAC;IAChE,MAAMI,SAAS,GAAGD,kBAAkB,CAACE,IAAI,CAAIC,MAAM,IAClDL,oBAAoB,CAAEK,MAAM,CAACC,IAAI,EAAED,MAAM,CAACE,IAAI,EAAEF,MAAM,CAACG,GAAI,CAC5D,CAAC;IACD,OAAO;MACNZ,QAAQ,EAAEO,SAAS;MACnBR,UAAU,EACTQ,SAAS,IACP,CAAED,kBAAkB,CAACO,MAAM,IAAI,CAAE,IAAAC,oCAAiB,EAAC;IACvD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,oBACC,IAAAjB,WAAA,CAAAkB,GAAA,EAACxB,WAAA,CAAAyB,oBAAM;IAACC,SAAS,EAAC,oBAAoB;IAACC,SAAS,EAAC,OAAO;IAACC,OAAO,EAAG,CAAG;IAAAC,QAAA,eACrE,IAAAvB,WAAA,CAAAkB,GAAA,EAACrB,WAAA,CAAA2B,OAAU;MACVJ,SAAS,EAAC,4BAA4B;MACtCK,OAAO,EAAGvB,UAAU,GAAG,IAAI,GAAG,SAAW;MACzCwB,WAAW,EAAG,KAAO;MACrBC,IAAI,EAAGzB,UAAU,IAAI,CAAEC,QAAQ,GAAGyB,YAAK,GAAG,IAAM;MAChDC,iBAAiB;MACjBC,qBAAqB;IAAA,CACrB;EAAC,CACK,CAAC;AAEX","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_keyboardShortcuts","_i18n","_data","_coreData","_editor","_store","shortcutName","SaveKeyboardShortcut","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","useSelect","coreStore","hasNonPostEntityChanges","isPostSavingLocked","editorStore","savePost","useDispatch","setIsSaveViewOpened","editSiteStore","registerShortcut","unregisterShortcut","keyboardShortcutsStore","useEffect","name","category","description","__","keyCombination","modifier","character","useShortcut","event","preventDefault","dirtyEntityRecords","hasDirtyEntities","length","isSaving","some","record","kind","key"],"sources":["@wordpress/edit-site/src/components/save-keyboard-shortcut/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nconst shortcutName = 'core/edit-site/save';\n\n/**\n * Register the save keyboard shortcut in view mode.\n *\n * @return {null} Returns null.\n */\nexport default function SaveKeyboardShortcut() {\n\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\tuseSelect( coreStore );\n\tconst { hasNonPostEntityChanges, isPostSavingLocked } =\n\t\tuseSelect( editorStore );\n\tconst { savePost } = useDispatch( editorStore );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst { registerShortcut, unregisterShortcut } = useDispatch(\n\t\tkeyboardShortcutsStore\n\t);\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: shortcutName,\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\t\treturn () => {\n\t\t\tunregisterShortcut( shortcutName );\n\t\t};\n\t}, [ registerShortcut, unregisterShortcut ] );\n\n\tuseShortcut( 'core/edit-site/save', ( event ) => {\n\t\tevent.preventDefault();\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst hasDirtyEntities = !! dirtyEntityRecords.length;\n\t\tconst isSaving = dirtyEntityRecords.some( ( record ) =>\n\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t);\n\t\tif ( ! hasDirtyEntities || isSaving ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( hasNonPostEntityChanges() ) {\n\t\t\tsetIsSaveViewOpened( true );\n\t\t} else if ( ! isPostSavingLocked() ) {\n\t\t\tsavePost();\n\t\t}\n\t} );\n\n\treturn null;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AAIA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAhBA;AACA;AACA;;AAWA;AACA;AACA;;AAGA,MAAMO,YAAY,GAAG,qBAAqB;;AAE1C;AACA;AACA;AACA;AACA;AACe,SAASC,oBAAoBA,CAAA,EAAG;EAC9C,MAAM;IAAEC,mCAAmC;IAAEC;EAAqB,CAAC,GAClE,IAAAC,eAAS,EAAEC,eAAU,CAAC;EACvB,MAAM;IAAEC,uBAAuB;IAAEC;EAAmB,CAAC,GACpD,IAAAH,eAAS,EAAEI,aAAY,CAAC;EACzB,MAAM;IAAEC;EAAS,CAAC,GAAG,IAAAC,iBAAW,EAAEF,aAAY,CAAC;EAC/C,MAAM;IAAEG;EAAoB,CAAC,GAAG,IAAAD,iBAAW,EAAEE,YAAc,CAAC;EAC5D,MAAM;IAAEC,gBAAgB;IAAEC;EAAmB,CAAC,GAAG,IAAAJ,iBAAW,EAC3DK,wBACD,CAAC;EACD,IAAAC,kBAAS,EAAE,MAAM;IAChBH,gBAAgB,CAAE;MACjBI,IAAI,EAAEjB,YAAY;MAClBkB,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAE,IAAAC,QAAE,EAAE,oBAAqB,CAAC;MACvCC,cAAc,EAAE;QACfC,QAAQ,EAAE,SAAS;QACnBC,SAAS,EAAE;MACZ;IACD,CAAE,CAAC;IACH,OAAO,MAAM;MACZT,kBAAkB,CAAEd,YAAa,CAAC;IACnC,CAAC;EACF,CAAC,EAAE,CAAEa,gBAAgB,EAAEC,kBAAkB,CAAG,CAAC;EAE7C,IAAAU,8BAAW,EAAE,qBAAqB,EAAIC,KAAK,IAAM;IAChDA,KAAK,CAACC,cAAc,CAAC,CAAC;IACtB,MAAMC,kBAAkB,GAAGzB,mCAAmC,CAAC,CAAC;IAChE,MAAM0B,gBAAgB,GAAG,CAAC,CAAED,kBAAkB,CAACE,MAAM;IACrD,MAAMC,QAAQ,GAAGH,kBAAkB,CAACI,IAAI,CAAIC,MAAM,IACjD7B,oBAAoB,CAAE6B,MAAM,CAACC,IAAI,EAAED,MAAM,CAACf,IAAI,EAAEe,MAAM,CAACE,GAAI,CAC5D,CAAC;IACD,IAAK,CAAEN,gBAAgB,IAAIE,QAAQ,EAAG;MACrC;IACD;IACA,IAAKxB,uBAAuB,CAAC,CAAC,EAAG;MAChCK,mBAAmB,CAAE,IAAK,CAAC;IAC5B,CAAC,MAAM,IAAK,CAAEJ,kBAAkB,CAAC,CAAC,EAAG;MACpCE,QAAQ,CAAC,CAAC;IACX;EACD,CAAE,CAAC;EAEH,OAAO,IAAI;AACZ","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_keyboardShortcuts","_i18n","_data","_coreData","_editor","_store","shortcutName","SaveKeyboardShortcut","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","useSelect","coreStore","hasNonPostEntityChanges","isPostSavingLocked","editorStore","savePost","useDispatch","setIsSaveViewOpened","editSiteStore","registerShortcut","unregisterShortcut","keyboardShortcutsStore","useEffect","name","category","description","__","keyCombination","modifier","character","useShortcut","event","preventDefault","dirtyEntityRecords","hasDirtyEntities","length","isSaving","some","record","kind","key"],"sources":["@wordpress/edit-site/src/components/save-keyboard-shortcut/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\nconst shortcutName = 'core/edit-site/save';\n\n/**\n * Register the save keyboard shortcut in view mode.\n *\n * @return {null} Returns null.\n */\nexport default function SaveKeyboardShortcut() {\n\tconst { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } =\n\t\tuseSelect( coreStore );\n\tconst { hasNonPostEntityChanges, isPostSavingLocked } =\n\t\tuseSelect( editorStore );\n\tconst { savePost } = useDispatch( editorStore );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst { registerShortcut, unregisterShortcut } = useDispatch(\n\t\tkeyboardShortcutsStore\n\t);\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: shortcutName,\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\t\treturn () => {\n\t\t\tunregisterShortcut( shortcutName );\n\t\t};\n\t}, [ registerShortcut, unregisterShortcut ] );\n\n\tuseShortcut( 'core/edit-site/save', ( event ) => {\n\t\tevent.preventDefault();\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst hasDirtyEntities = !! dirtyEntityRecords.length;\n\t\tconst isSaving = dirtyEntityRecords.some( ( record ) =>\n\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t);\n\t\tif ( ! hasDirtyEntities || isSaving ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( hasNonPostEntityChanges() ) {\n\t\t\tsetIs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B,CAAG,CAAC;EAE7C,IAAAU,8BAAW,EAAE,qBAAqB,EAAIC,KAAK,IAAM;IAChDA,KAAK,CAACC,cAAc,CAAC,CAAC;IACtB,MAAMC,kBAAkB,GAAGzB,mCAAmC,CAAC,CAAC;IAChE,MAAM0B,gBAAgB,GAAG,CAAC,CAAED,kBAAkB,CAACE,MAAM;IACrD,MAAMC,QAAQ,GAAGH,kBAAkB,CAACI,IAAI,CAAIC,MAAM,IACjD7B,oBAAoB,CAAE6B,MAAM,CAACC,IAAI,EAAED,MAAM,CAACf,IAAI,EAAEe,MAAM,CAACE,GAAI,CAC5D,CAAC;IACD,IAAK,CAAEN,gBAAgB,IAAIE,QAAQ,EAAG;MACrC;IACD;IACA,IAAKxB,uBAAuB,CAAC,CAAC,EAAG;MAChCK,mBAAmB,CAAE,IAAK,CAAC;IAC5B,CAAC,MAAM,IAAK,CAAEJ,kBAAkB,CAAC,CAAC,EAAG;MACpCE,QAAQ,CAAC,CAAC;IACX;EACD,CAAE,CAAC;EAEH,OAAO,IAAI;AACZ","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_editor","_data","_i18n","_coreData","_router","_element","_store","_lockUnlock","_useActivateTheme","_useActualCurrentTheme","_isPreviewingTheme","_jsxRuntime","EntitiesSavedStatesExtensible","NavigableRegion","unlock","privateApis","useLocation","routerPrivateApis","EntitiesSavedStatesForPreview","onClose","renderDialog","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","useEntitiesSavedStatesIsDirty","activateSaveLabel","isDirty","__","currentTheme","useActualCurrentTheme","previewingTheme","useSelect","select","coreStore","getCurrentTheme","additionalPrompt","jsx","children","sprintf","name","rendered","activateTheme","useActivateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","isPreviewingTheme","EntitiesSavedStates","SavePanel","query","canvas","isSaveViewOpen","isSaving","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isActivatingTheme","isSaveViewOpened","editSiteStore","length","some","record","kind","key","setIsSaveViewOpened","useDispatch","useEffect","Modal","className","onRequestClose","__experimentalHideHeader","contentLabel","activateSaveEnabled","disabled","jsxs","clsx","ariaLabel","Button","__next40pxDefaultSize","variant","onClick","accessibleWhenDisabled"],"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport { useActualCurrentTheme } from '../../utils/use-actual-current-theme';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible, NavigableRegion } =\n\tunlock( privateApis );\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose, renderDialog } ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t}\n\n\tconst currentTheme = useActualCurrentTheme();\n\n\tconst previewingTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: 1: The name of active theme, 2: The name of theme to be activated. */\n\t\t\t\t__(\n\t\t\t\t\t'Saving your changes will change your active theme from %1$s to %2$s.'\n\t\t\t\t),\n\t\t\t\tcurrentTheme?.name?.rendered ?? '...',\n\t\t\t\tpreviewingTheme?.name?.rendered ?? '...'\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async ( values ) => {\n\t\tawait activateTheme();\n\t\treturn values;\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t\trenderDialog,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose, renderDialog } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn (\n\t\t\t<EntitiesSavedStatesForPreview\n\t\t\t\tonClose={ onClose }\n\t\t\t\trenderDialog={ renderDialog }\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<EntitiesSavedStates close={ onClose } renderDialog={ renderDialog } />\n\t);\n};\n\nexport default function SavePanel() {\n\tconst { query } = useLocation();\n\tconst { canvas = 'view' } = query;\n\tconst { isSaveViewOpen, isDirty, isSaving } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\tisSavingEntityRecord,\n\t\t\tisResolving,\n\t\t} = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\tconst { isSaveViewOpened } = unlock( select( editSiteStore ) );\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving:\n\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t\t) || isActivatingTheme,\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\tuseEffect( () => {\n\t\tsetIsSaveViewOpened( false );\n\t}, [ canvas, setIsSaveViewOpened ] );\n\n\tif ( canvas === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ clsx( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ clsx( 'edit-site-editor__toggle-save-panel', {\n\t\t\t\t\t'screen-reader-text': isSaveViewOpen,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\taccessibleWhenDis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AyB,GAAA,EAACY,oBAAoB;MAAC7B,OAAO,EAAGA,OAAS;MAACC,YAAY;IAAA,CAAE,CACxD;EAAA,CACe,CAAC;AAEpB","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_editor","_data","_i18n","_coreData","_router","_element","_store","_lockUnlock","_useActivateTheme","_useActualCurrentTheme","_isPreviewingTheme","_jsxRuntime","EntitiesSavedStatesExtensible","NavigableRegion","unlock","privateApis","useLocation","routerPrivateApis","EntitiesSavedStatesForPreview","onClose","renderDialog","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","useEntitiesSavedStatesIsDirty","activateSaveLabel","isDirty","__","currentTheme","useActualCurrentTheme","previewingTheme","useSelect","select","coreStore","getCurrentTheme","additionalPrompt","jsx","children","sprintf","name","rendered","activateTheme","useActivateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","isPreviewingTheme","EntitiesSavedStates","SavePanel","query","canvas","isSaveViewOpen","isSaving","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isActivatingTheme","isSaveViewOpened","editSiteStore","length","some","record","kind","key","setIsSaveViewOpened","useDispatch","useEffect","Modal","className","onRequestClose","__experimentalHideHeader","contentLabel","activateSaveEnabled","disabled","jsxs","clsx","ariaLabel","Button","__next40pxDefaultSize","variant","onClick","accessibleWhenDisabled"],"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport { useActualCurrentTheme } from '../../utils/use-actual-current-theme';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible, NavigableRegion } =\n\tunlock( privateApis );\nconst { useLocation } = unlock( routerPrivateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose, renderDialog } ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t}\n\n\tconst currentTheme = useActualCurrentTheme();\n\n\tconst previewingTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: 1: The name of active theme, 2: The name of theme to be activated. */\n\t\t\t\t__(\n\t\t\t\t\t'Saving your changes will change your active theme from %1$s to %2$s.'\n\t\t\t\t),\n\t\t\t\tcurrentTheme?.name?.rendered ?? '...',\n\t\t\t\tpreviewingTheme?.name?.rendered ?? '...'\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async ( values ) => {\n\t\tawait activateTheme();\n\t\treturn values;\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t\trenderDialog,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose, renderDialog } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn (\n\t\t\t<EntitiesSavedStatesForPreview\n\t\t\t\tonClose={ onClose }\n\t\t\t\trenderDialog={ renderDialog }\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<EntitiesSavedStates close={ onClose } renderDialog={ renderDialog } />\n\t);\n};\n\nexport default function SavePanel() {\n\tconst { query } = useLocation();\n\tconst { canvas = 'view' } = query;\n\tconst { isSaveViewOpen, isDirty, isSaving } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\tisSavingEntityRecord,\n\t\t\tisResolving,\n\t\t} = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\tconst { isSaveViewOpened } = unlock( select( editSiteStore ) );\n\n\t\t// The currently selected entity to display.\n\t\t// Typically template or template part in the site editor.\n\t\treturn {\n\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving:\n\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t\t) || isActivatingTheme,\n\t\t};\n\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\tuseEffect( () => {\n\t\tsetIsSaveViewOpened( false );\n\t}, [ canvas, setIsSaveViewOpened ] );\n\n\tif ( canvas === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ clsx( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t<div\n\t\t\t\tclassName={ clsx( 'edit-site-editor__toggle-save-panel', {\n\t\t\t\t\t'screen-reader-text': isSaveViewOpen,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t{ isSaveViewOpen && (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } renderDialog />\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAKA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,iBAAA,GAAAV,OAAA;AACA,IAAAW,sBAAA,GAAAX,OAAA;AACA,IAAAY,kBAAA,GAAAZ,OAAA;AAAoE,IAAAa,WAAA,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