@wordpress/editor 14.17.0 → 14.18.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 (322) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/bindings/pattern-overrides.js +0 -1
  3. package/build/bindings/pattern-overrides.js.map +1 -1
  4. package/build/bindings/post-meta.js +0 -1
  5. package/build/bindings/post-meta.js.map +1 -1
  6. package/build/components/autocompleters/user.js +0 -1
  7. package/build/components/autocompleters/user.js.map +1 -1
  8. package/build/components/block-removal-warnings/index.js +0 -1
  9. package/build/components/block-removal-warnings/index.js.map +1 -1
  10. package/build/components/block-settings-menu/content-only-settings-menu.js +0 -1
  11. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  12. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -1
  13. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  14. package/build/components/collab-sidebar/comments.js +0 -1
  15. package/build/components/collab-sidebar/comments.js.map +1 -1
  16. package/build/components/collab-sidebar/index.js +0 -1
  17. package/build/components/collab-sidebar/index.js.map +1 -1
  18. package/build/components/collab-sidebar/utils.js +0 -1
  19. package/build/components/collab-sidebar/utils.js.map +1 -1
  20. package/build/components/deprecated.js +0 -1
  21. package/build/components/deprecated.js.map +1 -1
  22. package/build/components/document-outline/index.js +0 -1
  23. package/build/components/document-outline/index.js.map +1 -1
  24. package/build/components/editor/index.js +9 -5
  25. package/build/components/editor/index.js.map +1 -1
  26. package/build/components/editor-help/index.native.js +0 -1
  27. package/build/components/editor-help/index.native.js.map +1 -1
  28. package/build/components/editor-notices/index.js +0 -1
  29. package/build/components/editor-notices/index.js.map +1 -1
  30. package/build/components/editor-snackbars/index.js +0 -1
  31. package/build/components/editor-snackbars/index.js.map +1 -1
  32. package/build/components/entities-saved-states/entity-type-list.js +0 -1
  33. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  34. package/build/components/entities-saved-states/hooks/use-is-dirty.js +0 -1
  35. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  36. package/build/components/entities-saved-states/index.js +0 -1
  37. package/build/components/entities-saved-states/index.js.map +1 -1
  38. package/build/components/keyboard-shortcut-help-modal/index.js +0 -1
  39. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  40. package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -1
  41. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  42. package/build/components/list-view-sidebar/index.js +0 -1
  43. package/build/components/list-view-sidebar/index.js.map +1 -1
  44. package/build/components/local-autosave-monitor/index.js +0 -1
  45. package/build/components/local-autosave-monitor/index.js.map +1 -1
  46. package/build/components/mode-switcher/index.js +0 -1
  47. package/build/components/mode-switcher/index.js.map +1 -1
  48. package/build/components/page-attributes/parent.js +8 -5
  49. package/build/components/page-attributes/parent.js.map +1 -1
  50. package/build/components/post-actions/actions.js +0 -1
  51. package/build/components/post-actions/actions.js.map +1 -1
  52. package/build/components/post-actions/index.js +0 -1
  53. package/build/components/post-actions/index.js.map +1 -1
  54. package/build/components/post-author/check.js +3 -4
  55. package/build/components/post-author/check.js.map +1 -1
  56. package/build/components/post-author/combobox.js +4 -2
  57. package/build/components/post-author/combobox.js.map +1 -1
  58. package/build/components/post-author/hook.js +8 -5
  59. package/build/components/post-author/hook.js.map +1 -1
  60. package/build/components/post-fields/index.js +0 -1
  61. package/build/components/post-fields/index.js.map +1 -1
  62. package/build/components/post-format/index.js +0 -1
  63. package/build/components/post-format/index.js.map +1 -1
  64. package/build/components/post-format/panel.js +0 -1
  65. package/build/components/post-format/panel.js.map +1 -1
  66. package/build/components/post-publish-button/index.js +0 -1
  67. package/build/components/post-publish-button/index.js.map +1 -1
  68. package/build/components/post-publish-panel/maybe-category-panel.js +2 -4
  69. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  70. package/build/components/post-publish-panel/maybe-post-format-panel.js +0 -1
  71. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  72. package/build/components/post-publish-panel/maybe-tags-panel.js +1 -1
  73. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  74. package/build/components/post-publish-panel/maybe-upload-media.js +0 -1
  75. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  76. package/build/components/post-publish-panel/media-util.js +0 -1
  77. package/build/components/post-publish-panel/media-util.js.map +1 -1
  78. package/build/components/post-saved-state/index.js +0 -1
  79. package/build/components/post-saved-state/index.js.map +1 -1
  80. package/build/components/post-schedule/index.js +0 -1
  81. package/build/components/post-schedule/index.js.map +1 -1
  82. package/build/components/post-taxonomies/check.js +1 -1
  83. package/build/components/post-taxonomies/check.js.map +1 -1
  84. package/build/components/post-taxonomies/flat-term-selector.js +2 -3
  85. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  86. package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -3
  87. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  88. package/build/components/post-taxonomies/index.js +1 -2
  89. package/build/components/post-taxonomies/index.js.map +1 -1
  90. package/build/components/post-taxonomies/most-used-terms.js +0 -1
  91. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  92. package/build/components/post-template/classic-theme.js +0 -1
  93. package/build/components/post-template/classic-theme.js.map +1 -1
  94. package/build/components/post-template/swap-template-button.js +0 -1
  95. package/build/components/post-template/swap-template-button.js.map +1 -1
  96. package/build/components/post-transform-panel/hooks.js +0 -1
  97. package/build/components/post-transform-panel/hooks.js.map +1 -1
  98. package/build/components/post-type-support-check/index.js +0 -1
  99. package/build/components/post-type-support-check/index.js.map +1 -1
  100. package/build/components/preferences-modal/block-visibility.js +0 -1
  101. package/build/components/preferences-modal/block-visibility.js.map +1 -1
  102. package/build/components/preferences-modal/index.js +0 -1
  103. package/build/components/preferences-modal/index.js.map +1 -1
  104. package/build/components/provider/disable-non-page-content-blocks.js +0 -1
  105. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  106. package/build/components/provider/index.js +0 -1
  107. package/build/components/provider/index.js.map +1 -1
  108. package/build/components/provider/index.native.js +0 -1
  109. package/build/components/provider/index.native.js.map +1 -1
  110. package/build/components/provider/use-block-editor-settings.js +0 -1
  111. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  112. package/build/components/sidebar/index.js +0 -1
  113. package/build/components/sidebar/index.js.map +1 -1
  114. package/build/components/start-template-options/index.js +0 -1
  115. package/build/components/start-template-options/index.js.map +1 -1
  116. package/build/components/template-part-content-panel/index.js +0 -1
  117. package/build/components/template-part-content-panel/index.js.map +1 -1
  118. package/build/components/theme-support-check/index.js +0 -1
  119. package/build/components/theme-support-check/index.js.map +1 -1
  120. package/build/components/visual-editor/use-select-nearest-editable-block.js +0 -1
  121. package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  122. package/build/dataviews/store/private-actions.js +0 -1
  123. package/build/dataviews/store/private-actions.js.map +1 -1
  124. package/build/dataviews/store/reducer.js +0 -1
  125. package/build/dataviews/store/reducer.js.map +1 -1
  126. package/build/hooks/custom-sources-backwards-compatibility.js +0 -1
  127. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  128. package/build/hooks/pattern-overrides.js +0 -1
  129. package/build/hooks/pattern-overrides.js.map +1 -1
  130. package/build/private-apis.js +2 -0
  131. package/build/private-apis.js.map +1 -1
  132. package/build/store/actions.js +0 -1
  133. package/build/store/actions.js.map +1 -1
  134. package/build/store/private-actions.js +0 -1
  135. package/build/store/private-actions.js.map +1 -1
  136. package/build/store/private-selectors.js +0 -1
  137. package/build/store/private-selectors.js.map +1 -1
  138. package/build/store/reducer.js +0 -1
  139. package/build/store/reducer.js.map +1 -1
  140. package/build/store/reducer.native.js +0 -1
  141. package/build/store/reducer.native.js.map +1 -1
  142. package/build/store/selectors.js +0 -1
  143. package/build/store/selectors.js.map +1 -1
  144. package/build/utils/get-template-info.js +0 -1
  145. package/build/utils/get-template-info.js.map +1 -1
  146. package/build/utils/terms.js +0 -1
  147. package/build/utils/terms.js.map +1 -1
  148. package/build-module/bindings/pattern-overrides.js +0 -1
  149. package/build-module/bindings/pattern-overrides.js.map +1 -1
  150. package/build-module/bindings/post-meta.js +0 -1
  151. package/build-module/bindings/post-meta.js.map +1 -1
  152. package/build-module/components/autocompleters/user.js +0 -1
  153. package/build-module/components/autocompleters/user.js.map +1 -1
  154. package/build-module/components/block-removal-warnings/index.js +0 -1
  155. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  156. package/build-module/components/block-settings-menu/content-only-settings-menu.js +0 -1
  157. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  158. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +0 -1
  159. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  160. package/build-module/components/collab-sidebar/comments.js +0 -1
  161. package/build-module/components/collab-sidebar/comments.js.map +1 -1
  162. package/build-module/components/collab-sidebar/index.js +0 -1
  163. package/build-module/components/collab-sidebar/index.js.map +1 -1
  164. package/build-module/components/collab-sidebar/utils.js +0 -1
  165. package/build-module/components/collab-sidebar/utils.js.map +1 -1
  166. package/build-module/components/deprecated.js +0 -1
  167. package/build-module/components/deprecated.js.map +1 -1
  168. package/build-module/components/document-outline/index.js +0 -1
  169. package/build-module/components/document-outline/index.js.map +1 -1
  170. package/build-module/components/editor/index.js +9 -5
  171. package/build-module/components/editor/index.js.map +1 -1
  172. package/build-module/components/editor-help/index.native.js +0 -1
  173. package/build-module/components/editor-help/index.native.js.map +1 -1
  174. package/build-module/components/editor-notices/index.js +0 -1
  175. package/build-module/components/editor-notices/index.js.map +1 -1
  176. package/build-module/components/editor-snackbars/index.js +0 -1
  177. package/build-module/components/editor-snackbars/index.js.map +1 -1
  178. package/build-module/components/entities-saved-states/entity-type-list.js +0 -1
  179. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  180. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +0 -1
  181. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  182. package/build-module/components/entities-saved-states/index.js +0 -1
  183. package/build-module/components/entities-saved-states/index.js.map +1 -1
  184. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -1
  185. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  186. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -1
  187. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  188. package/build-module/components/list-view-sidebar/index.js +0 -1
  189. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  190. package/build-module/components/local-autosave-monitor/index.js +0 -1
  191. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  192. package/build-module/components/mode-switcher/index.js +0 -1
  193. package/build-module/components/mode-switcher/index.js.map +1 -1
  194. package/build-module/components/page-attributes/parent.js +8 -5
  195. package/build-module/components/page-attributes/parent.js.map +1 -1
  196. package/build-module/components/post-actions/actions.js +0 -1
  197. package/build-module/components/post-actions/actions.js.map +1 -1
  198. package/build-module/components/post-actions/index.js +0 -1
  199. package/build-module/components/post-actions/index.js.map +1 -1
  200. package/build-module/components/post-author/check.js +3 -4
  201. package/build-module/components/post-author/check.js.map +1 -1
  202. package/build-module/components/post-author/combobox.js +4 -2
  203. package/build-module/components/post-author/combobox.js.map +1 -1
  204. package/build-module/components/post-author/hook.js +8 -5
  205. package/build-module/components/post-author/hook.js.map +1 -1
  206. package/build-module/components/post-fields/index.js +0 -1
  207. package/build-module/components/post-fields/index.js.map +1 -1
  208. package/build-module/components/post-format/index.js +0 -1
  209. package/build-module/components/post-format/index.js.map +1 -1
  210. package/build-module/components/post-format/panel.js +0 -1
  211. package/build-module/components/post-format/panel.js.map +1 -1
  212. package/build-module/components/post-publish-button/index.js +0 -1
  213. package/build-module/components/post-publish-button/index.js.map +1 -1
  214. package/build-module/components/post-publish-panel/maybe-category-panel.js +2 -4
  215. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  216. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +0 -1
  217. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  218. package/build-module/components/post-publish-panel/maybe-tags-panel.js +1 -1
  219. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  220. package/build-module/components/post-publish-panel/maybe-upload-media.js +0 -1
  221. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  222. package/build-module/components/post-publish-panel/media-util.js +0 -1
  223. package/build-module/components/post-publish-panel/media-util.js.map +1 -1
  224. package/build-module/components/post-saved-state/index.js +0 -1
  225. package/build-module/components/post-saved-state/index.js.map +1 -1
  226. package/build-module/components/post-schedule/index.js +0 -1
  227. package/build-module/components/post-schedule/index.js.map +1 -1
  228. package/build-module/components/post-taxonomies/check.js +1 -1
  229. package/build-module/components/post-taxonomies/check.js.map +1 -1
  230. package/build-module/components/post-taxonomies/flat-term-selector.js +2 -3
  231. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  232. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +2 -3
  233. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  234. package/build-module/components/post-taxonomies/index.js +1 -2
  235. package/build-module/components/post-taxonomies/index.js.map +1 -1
  236. package/build-module/components/post-taxonomies/most-used-terms.js +0 -1
  237. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  238. package/build-module/components/post-template/classic-theme.js +0 -1
  239. package/build-module/components/post-template/classic-theme.js.map +1 -1
  240. package/build-module/components/post-template/swap-template-button.js +0 -1
  241. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  242. package/build-module/components/post-transform-panel/hooks.js +0 -1
  243. package/build-module/components/post-transform-panel/hooks.js.map +1 -1
  244. package/build-module/components/post-type-support-check/index.js +0 -1
  245. package/build-module/components/post-type-support-check/index.js.map +1 -1
  246. package/build-module/components/preferences-modal/block-visibility.js +0 -1
  247. package/build-module/components/preferences-modal/block-visibility.js.map +1 -1
  248. package/build-module/components/preferences-modal/index.js +0 -1
  249. package/build-module/components/preferences-modal/index.js.map +1 -1
  250. package/build-module/components/provider/disable-non-page-content-blocks.js +0 -1
  251. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  252. package/build-module/components/provider/index.js +0 -1
  253. package/build-module/components/provider/index.js.map +1 -1
  254. package/build-module/components/provider/index.native.js +0 -1
  255. package/build-module/components/provider/index.native.js.map +1 -1
  256. package/build-module/components/provider/use-block-editor-settings.js +0 -1
  257. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  258. package/build-module/components/sidebar/index.js +0 -1
  259. package/build-module/components/sidebar/index.js.map +1 -1
  260. package/build-module/components/start-template-options/index.js +0 -1
  261. package/build-module/components/start-template-options/index.js.map +1 -1
  262. package/build-module/components/template-part-content-panel/index.js +0 -1
  263. package/build-module/components/template-part-content-panel/index.js.map +1 -1
  264. package/build-module/components/theme-support-check/index.js +0 -1
  265. package/build-module/components/theme-support-check/index.js.map +1 -1
  266. package/build-module/components/visual-editor/use-select-nearest-editable-block.js +0 -1
  267. package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -1
  268. package/build-module/dataviews/store/private-actions.js +0 -1
  269. package/build-module/dataviews/store/private-actions.js.map +1 -1
  270. package/build-module/dataviews/store/reducer.js +0 -1
  271. package/build-module/dataviews/store/reducer.js.map +1 -1
  272. package/build-module/hooks/custom-sources-backwards-compatibility.js +0 -1
  273. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  274. package/build-module/hooks/pattern-overrides.js +0 -1
  275. package/build-module/hooks/pattern-overrides.js.map +1 -1
  276. package/build-module/private-apis.js +3 -1
  277. package/build-module/private-apis.js.map +1 -1
  278. package/build-module/store/actions.js +0 -1
  279. package/build-module/store/actions.js.map +1 -1
  280. package/build-module/store/private-actions.js +0 -1
  281. package/build-module/store/private-actions.js.map +1 -1
  282. package/build-module/store/private-selectors.js +0 -1
  283. package/build-module/store/private-selectors.js.map +1 -1
  284. package/build-module/store/reducer.js +0 -1
  285. package/build-module/store/reducer.js.map +1 -1
  286. package/build-module/store/reducer.native.js +0 -1
  287. package/build-module/store/reducer.native.js.map +1 -1
  288. package/build-module/store/selectors.js +0 -1
  289. package/build-module/store/selectors.js.map +1 -1
  290. package/build-module/utils/get-template-info.js +0 -1
  291. package/build-module/utils/get-template-info.js.map +1 -1
  292. package/build-module/utils/terms.js +0 -1
  293. package/build-module/utils/terms.js.map +1 -1
  294. package/build-types/components/editor/index.d.ts.map +1 -1
  295. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  296. package/build-types/components/post-author/check.d.ts.map +1 -1
  297. package/build-types/components/post-author/combobox.d.ts.map +1 -1
  298. package/build-types/components/post-author/hook.d.ts +1 -0
  299. package/build-types/components/post-author/hook.d.ts.map +1 -1
  300. package/build-types/components/post-publish-panel/maybe-category-panel.d.ts.map +1 -1
  301. package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts.map +1 -1
  302. package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
  303. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  304. package/build-types/components/post-taxonomies/index.d.ts.map +1 -1
  305. package/build-types/components/post-template/hooks.d.ts +1 -1
  306. package/build-types/components/post-template/hooks.d.ts.map +1 -1
  307. package/build-types/private-apis.d.ts.map +1 -1
  308. package/package.json +37 -37
  309. package/src/components/editor/index.js +24 -13
  310. package/src/components/page-attributes/parent.js +55 -38
  311. package/src/components/post-author/check.js +7 -4
  312. package/src/components/post-author/combobox.js +3 -1
  313. package/src/components/post-author/hook.js +4 -3
  314. package/src/components/post-publish-panel/maybe-category-panel.js +6 -2
  315. package/src/components/post-publish-panel/maybe-tags-panel.js +5 -1
  316. package/src/components/post-taxonomies/check.js +5 -3
  317. package/src/components/post-taxonomies/flat-term-selector.js +2 -2
  318. package/src/components/post-taxonomies/hierarchical-term-selector.js +2 -2
  319. package/src/components/post-taxonomies/index.js +5 -1
  320. package/src/components/post-taxonomies/test/index.js +32 -18
  321. package/src/private-apis.js +7 -1
  322. package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 14.18.0 (2025-02-12)
6
+
5
7
  ## 14.17.0 (2025-01-29)
6
8
 
7
9
  ## 14.16.0 (2025-01-15)
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","CONTENT","_default","exports","default","name","getValues","select","clientId","context","bindings","patternOverridesContent","getBlockAttributes","blockEditorStore","currentBlockAttributes","overridesValues","attributeName","Object","keys","overridableValue","metadata","undefined","setValues","dispatch","getBlockParentsByBlockName","getBlocks","blockName","patternClientId","attributes","entries","reduce","attrs","key","newValue","syncBlocksWithSameName","blocks","block","updateBlockAttributes","innerBlocks","currentBindingValue","acc","value","canUserEditValue"],"sources":["@wordpress/editor/src/bindings/pattern-overrides.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nconst CONTENT = 'content';\n\nexport default {\n\tname: 'core/pattern-overrides',\n\tgetValues( { select, clientId, context, bindings } ) {\n\t\tconst patternOverridesContent = context[ 'pattern/overrides' ];\n\t\tconst { getBlockAttributes } = select( blockEditorStore );\n\t\tconst currentBlockAttributes = getBlockAttributes( clientId );\n\n\t\tconst overridesValues = {};\n\t\tfor ( const attributeName of Object.keys( bindings ) ) {\n\t\t\tconst overridableValue =\n\t\t\t\tpatternOverridesContent?.[\n\t\t\t\t\tcurrentBlockAttributes?.metadata?.name\n\t\t\t\t]?.[ attributeName ];\n\n\t\t\t// If it has not been overridden, return the original value.\n\t\t\t// Check undefined because empty string is a valid value.\n\t\t\tif ( overridableValue === undefined ) {\n\t\t\t\toverridesValues[ attributeName ] =\n\t\t\t\t\tcurrentBlockAttributes[ attributeName ];\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\toverridesValues[ attributeName ] =\n\t\t\t\t\toverridableValue === '' ? undefined : overridableValue;\n\t\t\t}\n\t\t}\n\t\treturn overridesValues;\n\t},\n\tsetValues( { select, dispatch, clientId, bindings } ) {\n\t\tconst { getBlockAttributes, getBlockParentsByBlockName, getBlocks } =\n\t\t\tselect( blockEditorStore );\n\t\tconst currentBlockAttributes = getBlockAttributes( clientId );\n\t\tconst blockName = currentBlockAttributes?.metadata?.name;\n\t\tif ( ! blockName ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ patternClientId ] = getBlockParentsByBlockName(\n\t\t\tclientId,\n\t\t\t'core/block',\n\t\t\ttrue\n\t\t);\n\n\t\t// Extract the updated attributes from the source bindings.\n\t\tconst attributes = Object.entries( bindings ).reduce(\n\t\t\t( attrs, [ key, { newValue } ] ) => {\n\t\t\t\tattrs[ key ] = newValue;\n\t\t\t\treturn attrs;\n\t\t\t},\n\t\t\t{}\n\t\t);\n\n\t\t// If there is no pattern client ID, sync blocks with the same name and same attributes.\n\t\tif ( ! patternClientId ) {\n\t\t\tconst syncBlocksWithSameName = ( blocks ) => {\n\t\t\t\tfor ( const block of blocks ) {\n\t\t\t\t\tif ( block.attributes?.metadata?.name === blockName ) {\n\t\t\t\t\t\tdispatch( blockEditorStore ).updateBlockAttributes(\n\t\t\t\t\t\t\tblock.clientId,\n\t\t\t\t\t\t\tattributes\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tsyncBlocksWithSameName( block.innerBlocks );\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tsyncBlocksWithSameName( getBlocks() );\n\t\t\treturn;\n\t\t}\n\t\tconst currentBindingValue =\n\t\t\tgetBlockAttributes( patternClientId )?.[ CONTENT ];\n\n\t\tdispatch( blockEditorStore ).updateBlockAttributes( patternClientId, {\n\t\t\t[ CONTENT ]: {\n\t\t\t\t...currentBindingValue,\n\t\t\t\t[ blockName ]: {\n\t\t\t\t\t...currentBindingValue?.[ blockName ],\n\t\t\t\t\t...Object.entries( attributes ).reduce(\n\t\t\t\t\t\t( acc, [ key, value ] ) => {\n\t\t\t\t\t\t\t// TODO: We need a way to represent `undefined` in the serialized overrides.\n\t\t\t\t\t\t\t// Also see: https://github.com/WordPress/gutenberg/pull/57249#discussion_r1452987871\n\t\t\t\t\t\t\t// We use an empty string to represent undefined for now until\n\t\t\t\t\t\t\t// we support a richer format for overrides and the block bindings API.\n\t\t\t\t\t\t\tacc[ key ] = value === undefined ? '' : value;\n\t\t\t\t\t\t\treturn acc;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{}\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t},\n\t\t} );\n\t},\n\tcanUserEditValue: () => true,\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,OAAO,GAAG,SAAS;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEX;EACdC,IAAI,EAAE,wBAAwB;EAC9BC,SAASA,CAAE;IAAEC,MAAM;IAAEC,QAAQ;IAAEC,OAAO;IAAEC;EAAS,CAAC,EAAG;IACpD,MAAMC,uBAAuB,GAAGF,OAAO,CAAE,mBAAmB,CAAE;IAC9D,MAAM;MAAEG;IAAmB,CAAC,GAAGL,MAAM,CAAEM,kBAAiB,CAAC;IACzD,MAAMC,sBAAsB,GAAGF,kBAAkB,CAAEJ,QAAS,CAAC;IAE7D,MAAMO,eAAe,GAAG,CAAC,CAAC;IAC1B,KAAM,MAAMC,aAAa,IAAIC,MAAM,CAACC,IAAI,CAAER,QAAS,CAAC,EAAG;MACtD,MAAMS,gBAAgB,GACrBR,uBAAuB,GACtBG,sBAAsB,EAAEM,QAAQ,EAAEf,IAAI,CACtC,GAAIW,aAAa,CAAE;;MAErB;MACA;MACA,IAAKG,gBAAgB,KAAKE,SAAS,EAAG;QACrCN,eAAe,CAAEC,aAAa,CAAE,GAC/BF,sBAAsB,CAAEE,aAAa,CAAE;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sBAAsB,CAAET,SAAS,CAAC,CAAE,CAAC;MACrC;IACD;IACA,MAAMc,mBAAmB,GACxB3B,kBAAkB,CAAEe,eAAgB,CAAC,GAAI1B,OAAO,CAAE;IAEnDsB,QAAQ,CAAEV,kBAAiB,CAAC,CAACwB,qBAAqB,CAAEV,eAAe,EAAE;MACpE,CAAE1B,OAAO,GAAI;QACZ,GAAGsC,mBAAmB;QACtB,CAAEb,SAAS,GAAI;UACd,GAAGa,mBAAmB,GAAIb,SAAS,CAAE;UACrC,GAAGT,MAAM,CAACY,OAAO,CAAED,UAAW,CAAC,CAACE,MAAM,CACrC,CAAEU,GAAG,EAAE,CAAER,GAAG,EAAES,KAAK,CAAE,KAAM;YAC1B;YACA;YACA;YACA;YACAD,GAAG,CAAER,GAAG,CAAE,GAAGS,KAAK,KAAKpB,SAAS,GAAG,EAAE,GAAGoB,KAAK;YAC7C,OAAOD,GAAG;UACX,CAAC,EACD,CAAC,CACF;QACD;MACD;IACD,CAAE,CAAC;EACJ,CAAC;EACDE,gBAAgB,EAAEA,CAAA,KAAM;AACzB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_blockEditor","require","CONTENT","_default","exports","default","name","getValues","select","clientId","context","bindings","patternOverridesContent","getBlockAttributes","blockEditorStore","currentBlockAttributes","overridesValues","attributeName","Object","keys","overridableValue","metadata","undefined","setValues","dispatch","getBlockParentsByBlockName","getBlocks","blockName","patternClientId","attributes","entries","reduce","attrs","key","newValue","syncBlocksWithSameName","blocks","block","updateBlockAttributes","innerBlocks","currentBindingValue","acc","value","canUserEditValue"],"sources":["@wordpress/editor/src/bindings/pattern-overrides.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nconst CONTENT = 'content';\n\nexport default {\n\tname: 'core/pattern-overrides',\n\tgetValues( { select, clientId, context, bindings } ) {\n\t\tconst patternOverridesContent = context[ 'pattern/overrides' ];\n\t\tconst { getBlockAttributes } = select( blockEditorStore );\n\t\tconst currentBlockAttributes = getBlockAttributes( clientId );\n\n\t\tconst overridesValues = {};\n\t\tfor ( const attributeName of Object.keys( bindings ) ) {\n\t\t\tconst overridableValue =\n\t\t\t\tpatternOverridesContent?.[\n\t\t\t\t\tcurrentBlockAttributes?.metadata?.name\n\t\t\t\t]?.[ attributeName ];\n\n\t\t\t// If it has not been overridden, return the original value.\n\t\t\t// Check undefined because empty string is a valid value.\n\t\t\tif ( overridableValue === undefined ) {\n\t\t\t\toverridesValues[ attributeName ] =\n\t\t\t\t\tcurrentBlockAttributes[ attributeName ];\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\toverridesValues[ attributeName ] =\n\t\t\t\t\toverridableValue === '' ? undefined : overridableValue;\n\t\t\t}\n\t\t}\n\t\treturn overridesValues;\n\t},\n\tsetValues( { select, dispatch, clientId, bindings } ) {\n\t\tconst { getBlockAttributes, getBlockParentsByBlockName, getBlocks } =\n\t\t\tselect( blockEditorStore );\n\t\tconst currentBlockAttributes = getBlockAttributes( clientId );\n\t\tconst blockName = currentBlockAttributes?.metadata?.name;\n\t\tif ( ! blockName ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ patternClientId ] = getBlockParentsByBlockName(\n\t\t\tclientId,\n\t\t\t'core/block',\n\t\t\ttrue\n\t\t);\n\n\t\t// Extract the updated attributes from the source bindings.\n\t\tconst attributes = Object.entries( bindings ).reduce(\n\t\t\t( attrs, [ key, { newValue } ] ) => {\n\t\t\t\tattrs[ key ] = newValue;\n\t\t\t\treturn attrs;\n\t\t\t},\n\t\t\t{}\n\t\t);\n\n\t\t// If there is no pattern client ID, sync blocks with the same name and same attributes.\n\t\tif ( ! patternClientId ) {\n\t\t\tconst syncBlocksWithSameName = ( blocks ) => {\n\t\t\t\tfor ( const block of blocks ) {\n\t\t\t\t\tif ( block.attributes?.metadata?.name === blockName ) {\n\t\t\t\t\t\tdispatch( blockEditorStore ).updateBlockAttributes(\n\t\t\t\t\t\t\tblock.clientId,\n\t\t\t\t\t\t\tattributes\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tsyncBlocksWithSameName( block.innerBlocks );\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tsyncBlocksWithSameName( getBlocks() );\n\t\t\treturn;\n\t\t}\n\t\tconst currentBindingValue =\n\t\t\tgetBlockAttributes( patternClientId )?.[ CONTENT ];\n\n\t\tdispatch( blockEditorStore ).updateBlockAttributes( patternClientId, {\n\t\t\t[ CONTENT ]: {\n\t\t\t\t...currentBindingValue,\n\t\t\t\t[ blockName ]: {\n\t\t\t\t\t...currentBindingValue?.[ blockName ],\n\t\t\t\t\t...Object.entries( attributes ).reduce(\n\t\t\t\t\t\t( acc, [ key, value ] ) => {\n\t\t\t\t\t\t\t// TODO: We need a way to represent `undefined` in the serialized overrides.\n\t\t\t\t\t\t\t// Also see: https://github.com/WordPress/gutenberg/pull/57249#discussion_r1452987871\n\t\t\t\t\t\t\t// We use an empty string to represent undefined for now until\n\t\t\t\t\t\t\t// we support a richer format for overrides and the block bindings API.\n\t\t\t\t\t\t\tacc[ key ] = value === undefined ? '' : value;\n\t\t\t\t\t\t\treturn acc;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{}\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t},\n\t\t} );\n\t},\n\tcanUserEditValue: () => true,\n};\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,OAAO,GAAG,SAAS;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEX;EACdC,IAAI,EAAE,wBAAwB;EAC9BC,SAASA,CAAE;IAAEC,MAAM;IAAEC,QAAQ;IAAEC,OAAO;IAAEC;EAAS,CAAC,EAAG;IACpD,MAAMC,uBAAuB,GAAGF,OAAO,CAAE,mBAAmB,CAAE;IAC9D,MAAM;MAAEG;IAAmB,CAAC,GAAGL,MAAM,CAAEM,kBAAiB,CAAC;IACzD,MAAMC,s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CAAC;;IAED;IACA,IAAK,CAAEJ,eAAe,EAAG;MACxB,MAAMO,sBAAsB,GAAKC,MAAM,IAAM;QAC5C,KAAM,MAAMC,KAAK,IAAID,MAAM,EAAG;UAC7B,IAAKC,KAAK,CAACR,UAAU,EAAER,QAAQ,EAAEf,IAAI,KAAKqB,SAAS,EAAG;YACrDH,QAAQ,CAAEV,kBAAiB,CAAC,CAACwB,qBAAqB,CACjDD,KAAK,CAAC5B,QAAQ,EACdoB,UACD,CAAC;UACF;UACAM,sBAAsB,CAAEE,KAAK,CAACE,WAAY,CAAC;QAC5C;MACD,CAAC;MAEDJ,sBAAsB,CAAET,SAAS,CAAC,CAAE,CAAC;MACrC;IACD;IACA,MAAMc,mBAAmB,GACxB3B,kBAAkB,CAAEe,eAAgB,CAAC,GAAI1B,OAAO,CAAE;IAEnDsB,QAAQ,CAAEV,kBAAiB,CAAC,CAACwB,qBAAqB,CAAEV,eAAe,EAAE;MACpE,CAAE1B,OAAO,GAAI;QACZ,GAAGsC,mBAAmB;QACtB,CAAEb,SAAS,GAAI;UACd,GAAGa,mBAAmB,GAAIb,SAAS,CAAE;UACrC,GAAGT,MAAM,CAACY,OAAO,CAAED,UAAW,CAAC,CAACE,MAAM,CACrC,CAAEU,GAAG,EAAE,CAAER,GAAG,EAAES,KAAK,CAAE,KAAM;YAC1B;YACA;YACA;YACA;YACAD,GAAG,CAAER,GAAG,CAAE,GAAGS,KAAK,KAAKpB,SAAS,GAAG,EAAE,GAAGoB,KAAK;YAC7C,OAAOD,GAAG;UACX,CAAC,EACD,CAAC,CACF;QACD;MACD;IACD,CAAE,CAAC;EACJ,CAAC;EACDE,gBAAgB,EAAEA,CAAA,KAAM;AACzB,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_coreData","require","_store","_lockUnlock","getPostMetaFields","select","context","getEditedEntityRecord","coreDataStore","getRegisteredPostMeta","unlock","entityMetaValues","postType","postId","meta","registeredFields","metaFields","Object","entries","forEach","key","props","charAt","_entityMetaValues$key","label","title","value","default","undefined","type","keys","length","_default","exports","name","getValues","bindings","newValues","attributeName","source","_ref","fieldKey","args","fieldValue","fieldLabel","setValues","dispatch","newMeta","values","newValue","editEntityRecord","canUserEditValue","query","queryId","areCustomFieldsEnabled","editorStore","getEditorSettings","enableCustomFields","canUserEdit","canUser","kind","id","getFieldsList"],"sources":["@wordpress/editor/src/bindings/post-meta.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Gets a list of post meta fields with their values and labels\n * to be consumed in the needed callbacks.\n * If the value is not available based on context, like in templates,\n * it falls back to the default value, label, or key.\n *\n * @param {Object} select The select function from the data store.\n * @param {Object} context The context provided.\n * @return {Object} List of post meta fields with their value and label.\n *\n * @example\n * ```js\n * {\n * field_1_key: {\n * label: 'Field 1 Label',\n * value: 'Field 1 Value',\n * },\n * field_2_key: {\n * label: 'Field 2 Label',\n * value: 'Field 2 Value',\n * },\n * ...\n * }\n * ```\n */\nfunction getPostMetaFields( select, context ) {\n\tconst { getEditedEntityRecord } = select( coreDataStore );\n\tconst { getRegisteredPostMeta } = unlock( select( coreDataStore ) );\n\n\tlet entityMetaValues;\n\t// Try to get the current entity meta values.\n\tif ( context?.postType && context?.postId ) {\n\t\tentityMetaValues = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\tcontext?.postType,\n\t\t\tcontext?.postId\n\t\t).meta;\n\t}\n\n\tconst registeredFields = getRegisteredPostMeta( context?.postType );\n\tconst metaFields = {};\n\tObject.entries( registeredFields || {} ).forEach( ( [ key, props ] ) => {\n\t\t// Don't include footnotes or private fields.\n\t\tif ( key !== 'footnotes' && key.charAt( 0 ) !== '_' ) {\n\t\t\tmetaFields[ key ] = {\n\t\t\t\tlabel: props.title || key,\n\t\t\t\tvalue:\n\t\t\t\t\t// When using the entity value, an empty string IS a valid value.\n\t\t\t\t\tentityMetaValues?.[ key ] ??\n\t\t\t\t\t// When using the default, an empty string IS NOT a valid value.\n\t\t\t\t\t( props.default || undefined ),\n\t\t\t\ttype: props.type,\n\t\t\t};\n\t\t}\n\t} );\n\n\tif ( ! Object.keys( metaFields || {} ).length ) {\n\t\treturn null;\n\t}\n\n\treturn metaFields;\n}\n\nexport default {\n\tname: 'core/post-meta',\n\tgetValues( { select, context, bindings } ) {\n\t\tconst metaFields = getPostMetaFields( select, context );\n\n\t\tconst newValues = {};\n\t\tfor ( const [ attributeName, source ] of Object.entries( bindings ) ) {\n\t\t\t// Use the value, the field label, or the field key.\n\t\t\tconst fieldKey = source.args.key;\n\t\t\tconst { value: fieldValue, label: fieldLabel } =\n\t\t\t\tmetaFields?.[ fieldKey ] || {};\n\t\t\tnewValues[ attributeName ] = fieldValue ?? fieldLabel ?? fieldKey;\n\t\t}\n\t\treturn newValues;\n\t},\n\tsetValues( { dispatch, context, bindings } ) {\n\t\tconst newMeta = {};\n\t\tObject.values( bindings ).forEach( ( { args, newValue } ) => {\n\t\t\tnewMeta[ args.key ] = newValue;\n\t\t} );\n\n\t\tdispatch( coreDataStore ).editEntityRecord(\n\t\t\t'postType',\n\t\t\tcontext?.postType,\n\t\t\tcontext?.postId,\n\t\t\t{\n\t\t\t\tmeta: newMeta,\n\t\t\t}\n\t\t);\n\t},\n\tcanUserEditValue( { select, context, args } ) {\n\t\t// Lock editing in query loop.\n\t\tif ( context?.query || context?.queryId ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Lock editing when `postType` is not defined.\n\t\tif ( ! context?.postType ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst fieldValue = getPostMetaFields( select, context )?.[ args.key ]\n\t\t\t?.value;\n\t\t// Empty string or `false` could be a valid value, so we need to check if the field value is undefined.\n\t\tif ( fieldValue === undefined ) {\n\t\t\treturn false;\n\t\t}\n\t\t// Check that custom fields metabox is not enabled.\n\t\tconst areCustomFieldsEnabled =\n\t\t\tselect( editorStore ).getEditorSettings().enableCustomFields;\n\t\tif ( areCustomFieldsEnabled ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that the user has the capability to edit post meta.\n\t\tconst canUserEdit = select( coreDataStore ).canUser( 'update', {\n\t\t\tkind: 'postType',\n\t\t\tname: context?.postType,\n\t\t\tid: context?.postId,\n\t\t} );\n\t\tif ( ! canUserEdit ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n\tgetFieldsList( { select, context } ) {\n\t\treturn getPostMetaFields( select, context );\n\t},\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,iBAAiBA,CAAEC,MAAM,EAAEC,OAAO,EAAG;EAC7C,MAAM;IAAEC;EAAsB,CAAC,GAAGF,MAAM,CAAEG,eAAc,CAAC;EACzD,MAAM;IAAEC;EAAsB,CAAC,GAAG,IAAAC,kBAAM,EAAEL,MAAM,CAAEG,eAAc,CAAE,CAAC;EAEnE,IAAIG,gBAAgB;EACpB;EACA,IAAKL,OAAO,EAAEM,QAAQ,IAAIN,OAAO,EAAEO,MAAM,EAAG;IAC3CF,gBAAgB,GAAGJ,qBAAqB,CACvC,UAAU,EACVD,OAAO,EAAEM,QAAQ,EACjBN,OAAO,EAAEO,MACV,CAAC,CAACC,IAAI;EACP;EAEA,MAAMC,gBAAgB,GAAGN,qBAAqB,CAAEH,OAAO,EAAEM,QAAS,CAAC;EACnE,MAAMI,UAAU,GAAG,CAAC,CAAC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kBAAkB;IAC7D,IAAKH,sBAAsB,EAAG;MAC7B,OAAO,KAAK;IACb;;IAEA;IACA,MAAMI,WAAW,GAAGrD,MAAM,CAAEG,eAAc,CAAC,CAACmD,OAAO,CAAE,QAAQ,EAAE;MAC9DC,IAAI,EAAE,UAAU;MAChB1B,IAAI,EAAE5B,OAAO,EAAEM,QAAQ;MACvBiD,EAAE,EAAEvD,OAAO,EAAEO;IACd,CAAE,CAAC;IACH,IAAK,CAAE6C,WAAW,EAAG;MACpB,OAAO,KAAK;IACb;IAEA,OAAO,IAAI;EACZ,CAAC;EACDI,aAAaA,CAAE;IAAEzD,MAAM;IAAEC;EAAQ,CAAC,EAAG;IACpC,OAAOF,iBAAiB,CAAEC,MAAM,EAAEC,OAAQ,CAAC;EAC5C;AACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_coreData","require","_store","_lockUnlock","getPostMetaFields","select","context","getEditedEntityRecord","coreDataStore","getRegisteredPostMeta","unlock","entityMetaValues","postType","postId","meta","registeredFields","metaFields","Object","entries","forEach","key","props","charAt","_entityMetaValues$key","label","title","value","default","undefined","type","keys","length","_default","exports","name","getValues","bindings","newValues","attributeName","source","_ref","fieldKey","args","fieldValue","fieldLabel","setValues","dispatch","newMeta","values","newValue","editEntityRecord","canUserEditValue","query","queryId","areCustomFieldsEnabled","editorStore","getEditorSettings","enableCustomFields","canUserEdit","canUser","kind","id","getFieldsList"],"sources":["@wordpress/editor/src/bindings/post-meta.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Gets a list of post meta fields with their values and labels\n * to be consumed in the needed callbacks.\n * If the value is not available based on context, like in templates,\n * it falls back to the default value, label, or key.\n *\n * @param {Object} select The select function from the data store.\n * @param {Object} context The context provided.\n * @return {Object} List of post meta fields with their value and label.\n *\n * @example\n * ```js\n * {\n * field_1_key: {\n * label: 'Field 1 Label',\n * value: 'Field 1 Value',\n * },\n * field_2_key: {\n * label: 'Field 2 Label',\n * value: 'Field 2 Value',\n * },\n * ...\n * }\n * ```\n */\nfunction getPostMetaFields( select, context ) {\n\tconst { getEditedEntityRecord } = select( coreDataStore );\n\tconst { getRegisteredPostMeta } = unlock( select( coreDataStore ) );\n\n\tlet entityMetaValues;\n\t// Try to get the current entity meta values.\n\tif ( context?.postType && context?.postId ) {\n\t\tentityMetaValues = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\tcontext?.postType,\n\t\t\tcontext?.postId\n\t\t).meta;\n\t}\n\n\tconst registeredFields = getRegisteredPostMeta( context?.postType );\n\tconst metaFields = {};\n\tObject.entries( registeredFields || {} ).forEach( ( [ key, props ] ) => {\n\t\t// Don't include footnotes or private fields.\n\t\tif ( key !== 'footnotes' && key.charAt( 0 ) !== '_' ) {\n\t\t\tmetaFields[ key ] = {\n\t\t\t\tlabel: props.title || key,\n\t\t\t\tvalue:\n\t\t\t\t\t// When using the entity value, an empty string IS a valid value.\n\t\t\t\t\tentityMetaValues?.[ key ] ??\n\t\t\t\t\t// When using the default, an empty string IS NOT a valid value.\n\t\t\t\t\t( props.default || undefined ),\n\t\t\t\ttype: props.type,\n\t\t\t};\n\t\t}\n\t} );\n\n\tif ( ! Object.keys( metaFields || {} ).length ) {\n\t\treturn null;\n\t}\n\n\treturn metaFields;\n}\n\nexport default {\n\tname: 'core/post-meta',\n\tgetValues( { select, context, bindings } ) {\n\t\tconst metaFields = getPostMetaFields( select, context );\n\n\t\tconst newValues = {};\n\t\tfor ( const [ attributeName, source ] of Object.entries( bindings ) ) {\n\t\t\t// Use the value, the field label, or the field key.\n\t\t\tconst fieldKey = source.args.key;\n\t\t\tconst { value: fieldValue, label: fieldLabel } =\n\t\t\t\tmetaFields?.[ fieldKey ] || {};\n\t\t\tnewValues[ attributeName ] = fieldValue ?? fieldLabel ?? fieldKey;\n\t\t}\n\t\treturn newValues;\n\t},\n\tsetValues( { dispatch, context, bindings } ) {\n\t\tconst newMeta = {};\n\t\tObject.values( bindings ).forEach( ( { args, newValue } ) => {\n\t\t\tnewMeta[ args.key ] = newValue;\n\t\t} );\n\n\t\tdispatch( coreDataStore ).editEntityRecord(\n\t\t\t'postType',\n\t\t\tcontext?.postType,\n\t\t\tcontext?.postId,\n\t\t\t{\n\t\t\t\tmeta: newMeta,\n\t\t\t}\n\t\t);\n\t},\n\tcanUserEditValue( { select, context, args } ) {\n\t\t// Lock editing in query loop.\n\t\tif ( context?.query || context?.queryId ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Lock editing when `postType` is not defined.\n\t\tif ( ! context?.postType ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst fieldValue = getPostMetaFields( select, context )?.[ args.key ]\n\t\t\t?.value;\n\t\t// Empty string or `false` could be a valid value, so we need to check if the field value is undefined.\n\t\tif ( fieldValue === undefined ) {\n\t\t\treturn false;\n\t\t}\n\t\t// Check that custom fields metabox is not enabled.\n\t\tconst areCustomFieldsEnabled =\n\t\t\tselect( editorStore ).getEditorSettings().enableCustomFields;\n\t\tif ( areCustomFieldsEnabled ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that the user has the capability to edit post meta.\n\t\tconst canUserEdit = select( coreDataStore ).canUser( 'update', {\n\t\t\tkind: 'postType',\n\t\t\tname: context?.postType,\n\t\t\tid: context?.postId,\n\t\t} );\n\t\tif ( ! canUserEdit ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n\tgetFieldsList( { select, context } ) {\n\t\treturn getPostMetaFields( select, context );\n\t},\n};\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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AAEiC;IACP,CACD,CAAC;EACF,CAAC;EACDI,gBAAgBA,CAAE;IAAE9C,MAAM;IAAEC,OAAO;IAAEoC;EAAK,CAAC,EAAG;IAC7C;IACA,IAAKpC,OAAO,EAAE8C,KAAK,IAAI9C,OAAO,EAAE+C,OAAO,EAAG;MACzC,OAAO,KAAK;IACb;;IAEA;IACA,IAAK,CAAE/C,OAAO,EAAEM,QAAQ,EAAG;MAC1B,OAAO,KAAK;IACb;IAEA,MAAM+B,UAAU,GAAGvC,iBAAiB,CAAEC,MAAM,EAAEC,OAAQ,CAAC,GAAIoC,IAAI,CAACtB,GAAG,CAAE,EAClEM,KAAK;IACR;IACA,IAAKiB,UAAU,KAAKf,SAAS,EAAG;MAC/B,OAAO,KAAK;IACb;IACA;IACA,MAAM0B,sBAAsB,GAC3BjD,MAAM,CAAEkD,YAAY,CAAC,CAACC,iBAAiB,CAAC,CAAC,CAACC,kBAAkB;IAC7D,IAAKH,sBAAsB,EAAG;MAC7B,OAAO,KAAK;IACb;;IAEA;IACA,MAAMI,WAAW,GAAGrD,MAAM,CAAEG,eAAc,CAAC,CAACmD,OAAO,CAAE,QAAQ,EAAE;MAC9DC,IAAI,EAAE,UAAU;MAChB1B,IAAI,EAAE5B,OAAO,EAAEM,QAAQ;MACvBiD,EAAE,EAAEvD,OAAO,EAAEO;IACd,CAAE,CAAC;IACH,IAAK,CAAE6C,WAAW,EAAG;MACpB,OAAO,KAAK;IACb;IAEA,OAAO,IAAI;EACZ,CAAC;EACDI,aAAaA,CAAE;IAAEzD,MAAM;IAAEC;EAAQ,CAAC,EAAG;IACpC,OAAOF,iBAAiB,CAAEC,MAAM,EAAEC,OAAQ,CAAC;EAC5C;AACD,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_data","_coreData","_jsxRuntime","getUserLabel","user","avatar","avatar_urls","jsx","className","alt","src","jsxs","Fragment","children","name","slug","_default","exports","default","triggerPrefix","useItems","filterValue","users","useSelect","select","getUsers","coreStore","context","search","encodeURIComponent","options","useMemo","map","key","value","label","getOptionCompletion"],"sources":["@wordpress/editor/src/components/autocompleters/user.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport function getUserLabel( user ) {\n\tconst avatar =\n\t\tuser.avatar_urls && user.avatar_urls[ 24 ] ? (\n\t\t\t<img\n\t\t\t\tclassName=\"editor-autocompleters__user-avatar\"\n\t\t\t\talt=\"\"\n\t\t\t\tsrc={ user.avatar_urls[ 24 ] }\n\t\t\t/>\n\t\t) : (\n\t\t\t<span className=\"editor-autocompleters__no-avatar\"></span>\n\t\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ avatar }\n\t\t\t<span className=\"editor-autocompleters__user-name\">\n\t\t\t\t{ user.name }\n\t\t\t</span>\n\t\t\t<span className=\"editor-autocompleters__user-slug\">\n\t\t\t\t{ user.slug }\n\t\t\t</span>\n\t\t</>\n\t);\n}\n\n/**\n * A user mentions completer.\n *\n * @type {Object}\n */\nexport default {\n\tname: 'users',\n\tclassName: 'editor-autocompleters__user',\n\ttriggerPrefix: '@',\n\n\tuseItems( filterValue ) {\n\t\tconst users = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getUsers } = select( coreStore );\n\t\t\t\treturn getUsers( {\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t\tsearch: encodeURIComponent( filterValue ),\n\t\t\t\t} );\n\t\t\t},\n\t\t\t[ filterValue ]\n\t\t);\n\n\t\tconst options = useMemo(\n\t\t\t() =>\n\t\t\t\tusers\n\t\t\t\t\t? users.map( ( user ) => ( {\n\t\t\t\t\t\t\tkey: `user-${ user.slug }`,\n\t\t\t\t\t\t\tvalue: user,\n\t\t\t\t\t\t\tlabel: getUserLabel( user ),\n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AM,IAAM;MACb,MAAM;QAAEC;MAAS,CAAC,GAAGD,MAAM,CAAEE,eAAU,CAAC;MACxC,OAAOD,QAAQ,CAAE;QAChBE,OAAO,EAAE,MAAM;QACfC,MAAM,EAAEC,kBAAkB,CAAER,WAAY;MACzC,CAAE,CAAC;IACJ,CAAC,EACD,CAAEA,WAAW,CACd,CAAC;IAED,MAAMS,OAAO,GAAG,IAAAC,gBAAO,EACtB,MACCT,KAAK,GACFA,KAAK,CAACU,GAAG,CAAI5B,IAAI,KAAQ;MACzB6B,GAAG,EAAE,QAAS7B,IAAI,CAACW,IAAI,EAAG;MAC1BmB,KAAK,EAAE9B,IAAI;MACX+B,KAAK,EAAEhC,YAAY,CAAEC,IAAK;IAC1B,CAAC,CAAG,CAAC,GACL,EAAE,EACN,CAAEkB,KAAK,CACR,CAAC;IAED,OAAO,CAAEQ,OAAO,CAAE;EACnB,CAAC;EAEDM,mBAAmBA,CAAEhC,IAAI,EAAG;IAC3B,OAAO,IAAKA,IAAI,CAACW,IAAI,EAAG;EACzB;AACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_element","require","_data","_coreData","_jsxRuntime","getUserLabel","user","avatar","avatar_urls","jsx","className","alt","src","jsxs","Fragment","children","name","slug","_default","exports","default","triggerPrefix","useItems","filterValue","users","useSelect","select","getUsers","coreStore","context","search","encodeURIComponent","options","useMemo","map","key","value","label","getOptionCompletion"],"sources":["@wordpress/editor/src/components/autocompleters/user.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport function getUserLabel( user ) {\n\tconst avatar =\n\t\tuser.avatar_urls && user.avatar_urls[ 24 ] ? (\n\t\t\t<img\n\t\t\t\tclassName=\"editor-autocompleters__user-avatar\"\n\t\t\t\talt=\"\"\n\t\t\t\tsrc={ user.avatar_urls[ 24 ] }\n\t\t\t/>\n\t\t) : (\n\t\t\t<span className=\"editor-autocompleters__no-avatar\"></span>\n\t\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ avatar }\n\t\t\t<span className=\"editor-autocompleters__user-name\">\n\t\t\t\t{ user.name }\n\t\t\t</span>\n\t\t\t<span className=\"editor-autocompleters__user-slug\">\n\t\t\t\t{ user.slug }\n\t\t\t</span>\n\t\t</>\n\t);\n}\n\n/**\n * A user mentions completer.\n *\n * @type {Object}\n */\nexport default {\n\tname: 'users',\n\tclassName: 'editor-autocompleters__user',\n\ttriggerPrefix: '@',\n\n\tuseItems( filterValue ) {\n\t\tconst users = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getUsers } = select( coreStore );\n\t\t\t\treturn getUsers( {\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t\tsearch: encodeURIComponent( filterValue ),\n\t\t\t\t} );\n\t\t\t},\n\t\t\t[ filterValue ]\n\t\t);\n\n\t\tconst options = useMemo(\n\t\t\t() =>\n\t\t\t\tusers\n\t\t\t\t\t? users.map( ( user ) => ( {\n\t\t\t\t\t\t\tkey: `user-${ user.slug }`,\n\t\t\t\t\t\t\tvalue: user,\n\t\t\t\t\t\t\tlabel: getUserLabel( user ),\n\t\t\t\t\t } ) )\n\t\t\t\t\t: [],\n\t\t\t[ users ]\n\t\t);\n\n\t\treturn [ options ];\n\t},\n\n\tgetOptionCompletion( user ) {\n\t\treturn `@${ user.slug }`;\n\t},\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAA0D,IAAAG,WAAA,GAAAH,OAAA;AAL1D;AACA;AACA;;AAKO,SAASI,YAAYA,CAAEC,IAAI,EAAG;EACpC,MAAMC,MAAM,GACXD,IAAI,CAACE,WAAW,IAAIF,IAAI,CAACE,WAAW,CAAE,EAAE,CAAE,gBACzC,IAAAJ,WAAA,CAAAK,GAAA;IACCC,SAAS,EAAC,oCAAoC;IAC9CC,G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,CACR,CAAC;IAED,OAAO,CAAEQ,OAAO,CAAE;EACnB,CAAC;EAEDM,mBAAmBA,CAAEhC,IAAI,EAAG;IAC3B,OAAO,IAAKA,IAAI,CAACW,IAAI,EAAG;EACzB;AACD,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_blockEditor","_data","_element","_lockUnlock","_store","_jsxRuntime","BlockRemovalWarningModal","unlock","blockEditorPrivateApis","TEMPLATE_BLOCKS","BLOCK_REMOVAL_RULES","postTypes","callback","removedBlocks","removedTemplateBlocks","filter","name","includes","length","_n","removedBlocksWithOverrides","attributes","metadata","bindings","Object","values","some","binding","source","BlockRemovalWarnings","currentPostType","useSelect","select","editorStore","getCurrentPostType","removalRulesForPostType","useMemo","rule","jsx","rules"],"sources":["@wordpress/editor/src/components/block-removal-warnings/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { _n } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\n\nconst { BlockRemovalWarningModal } = unlock( blockEditorPrivateApis );\n\n// Prevent accidental removal of certain blocks, asking the user for confirmation first.\nconst TEMPLATE_BLOCKS = [\n\t'core/post-content',\n\t'core/post-template',\n\t'core/query',\n];\nconst BLOCK_REMOVAL_RULES = [\n\t{\n\t\t// Template blocks.\n\t\t// The warning is only shown when a user manipulates templates or template parts.\n\t\tpostTypes: [ 'wp_template', 'wp_template_part' ],\n\t\tcallback( removedBlocks ) {\n\t\t\tconst removedTemplateBlocks = removedBlocks.filter( ( { name } ) =>\n\t\t\t\tTEMPLATE_BLOCKS.includes( name )\n\t\t\t);\n\t\t\tif ( removedTemplateBlocks.length ) {\n\t\t\t\treturn _n(\n\t\t\t\t\t'Deleting this block will stop your post or page content from displaying on this template. It is not recommended.',\n\t\t\t\t\t'Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.',\n\t\t\t\t\tremovedBlocks.length\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t},\n\t{\n\t\t// Pattern overrides.\n\t\t// The warning is only shown when the user edits a pattern.\n\t\tpostTypes: [ 'wp_block' ],\n\t\tcallback( removedBlocks ) {\n\t\t\tconst removedBlocksWithOverrides = removedBlocks.filter(\n\t\t\t\t( { attributes } ) =>\n\t\t\t\t\tattributes?.metadata?.bindings &&\n\t\t\t\t\tObject.values( attributes.metadata.bindings ).some(\n\t\t\t\t\t\t( binding ) =>\n\t\t\t\t\t\t\tbinding.source === 'core/pattern-overrides'\n\t\t\t\t\t)\n\t\t\t);\n\t\t\tif ( removedBlocksWithOverrides.length ) {\n\t\t\t\treturn _n(\n\t\t\t\t\t'The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?',\n\t\t\t\t\t'Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?',\n\t\t\t\t\tremovedBlocks.length\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t},\n];\n\nexport default function BlockRemovalWarnings() {\n\tconst currentPostType = useSelect(\n\t\t( select ) => select( editorStore ).getCurrentPostType(),\n\t\t[]\n\t);\n\n\tconst removalRulesForPostType = useMemo(\n\t\t() =>\n\t\t\tBLOCK_REMOVAL_RULES.filter( ( rule ) =>\n\t\t\t\trule.postTypes.includes( currentPostType )\n\t\t\t),\n\t\t[ currentPostType ]\n\t);\n\n\t// `BlockRemovalWarnings` is rendered in the editor provider, a shared component\n\t// across react native and web. However, `BlockRemovalWarningModal` is web only.\n\t// Check it exists before trying to render it.\n\tif ( ! BlockRemovalWarningModal ) {\n\t\treturn null;\n\t}\n\n\tif ( ! removalRulesForPostType ) {\n\t\treturn null;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AAC;IACD,IAAKR,0BAA0B,CAACF,MAAM,EAAG;MACxC,OAAO,IAAAC,QAAE,EACR,6JAA6J,EAC7J,uKAAuK,EACvKN,aAAa,CAACK,MACf,CAAC;IACF;EACD;AACD,CAAC,CACD;AAEc,SAASW,oBAAoBA,CAAA,EAAG;EAC9C,MAAMC,eAAe,GAAG,IAAAC,eAAS,EAC9BC,MAAM,IAAMA,MAAM,CAAEC,YAAY,CAAC,CAACC,kBAAkB,CAAC,CAAC,EACxD,EACD,CAAC;EAED,MAAMC,uBAAuB,GAAG,IAAAC,gBAAO,EACtC,MACC1B,mBAAmB,CAACK,MAAM,CAAIsB,IAAI,IACjCA,IAAI,CAAC1B,SAAS,CAACM,QAAQ,CAAEa,eAAgB,CAC1C,CAAC,EACF,CAAEA,eAAe,CAClB,CAAC;;EAED;EACA;EACA;EACA,IAAK,CAAExB,wBAAwB,EAAG;IACjC,OAAO,IAAI;EACZ;EAEA,IAAK,CAAE6B,uBAAuB,EAAG;IAChC,OAAO,IAAI;EACZ;EAEA,oBAAO,IAAA9B,WAAA,CAAAiC,GAAA,EAAChC,wBAAwB;IAACiC,KAAK,EAAGJ;EAAyB,CAAE,CAAC;AACtE","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_blockEditor","_data","_element","_lockUnlock","_store","_jsxRuntime","BlockRemovalWarningModal","unlock","blockEditorPrivateApis","TEMPLATE_BLOCKS","BLOCK_REMOVAL_RULES","postTypes","callback","removedBlocks","removedTemplateBlocks","filter","name","includes","length","_n","removedBlocksWithOverrides","attributes","metadata","bindings","Object","values","some","binding","source","BlockRemovalWarnings","currentPostType","useSelect","select","editorStore","getCurrentPostType","removalRulesForPostType","useMemo","rule","jsx","rules"],"sources":["@wordpress/editor/src/components/block-removal-warnings/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { _n } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\n\nconst { BlockRemovalWarningModal } = unlock( blockEditorPrivateApis );\n\n// Prevent accidental removal of certain blocks, asking the user for confirmation first.\nconst TEMPLATE_BLOCKS = [\n\t'core/post-content',\n\t'core/post-template',\n\t'core/query',\n];\nconst BLOCK_REMOVAL_RULES = [\n\t{\n\t\t// Template blocks.\n\t\t// The warning is only shown when a user manipulates templates or template parts.\n\t\tpostTypes: [ 'wp_template', 'wp_template_part' ],\n\t\tcallback( removedBlocks ) {\n\t\t\tconst removedTemplateBlocks = removedBlocks.filter( ( { name } ) =>\n\t\t\t\tTEMPLATE_BLOCKS.includes( name )\n\t\t\t);\n\t\t\tif ( removedTemplateBlocks.length ) {\n\t\t\t\treturn _n(\n\t\t\t\t\t'Deleting this block will stop your post or page content from displaying on this template. It is not recommended.',\n\t\t\t\t\t'Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.',\n\t\t\t\t\tremovedBlocks.length\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t},\n\t{\n\t\t// Pattern overrides.\n\t\t// The warning is only shown when the user edits a pattern.\n\t\tpostTypes: [ 'wp_block' ],\n\t\tcallback( removedBlocks ) {\n\t\t\tconst removedBlocksWithOverrides = removedBlocks.filter(\n\t\t\t\t( { attributes } ) =>\n\t\t\t\t\tattributes?.metadata?.bindings &&\n\t\t\t\t\tObject.values( attributes.metadata.bindings ).some(\n\t\t\t\t\t\t( binding ) =>\n\t\t\t\t\t\t\tbinding.source === 'core/pattern-overrides'\n\t\t\t\t\t)\n\t\t\t);\n\t\t\tif ( removedBlocksWithOverrides.length ) {\n\t\t\t\treturn _n(\n\t\t\t\t\t'The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?',\n\t\t\t\t\t'Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?',\n\t\t\t\t\tremovedBlocks.length\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t},\n];\n\nexport default function BlockRemovalWarnings() {\n\tconst currentPostType = useSelect(\n\t\t( select ) => select( editorStore ).getCurrentPostType(),\n\t\t[]\n\t);\n\n\tconst removalRulesForPostType = useMemo(\n\t\t() =>\n\t\t\tBLOCK_REMOVAL_RULES.filter( ( rule ) =>\n\t\t\t\trule.postTypes.includes( currentPostType )\n\t\t\t),\n\t\t[ currentPostType ]\n\t);\n\n\t// `BlockRemovalWarnings` is rendered in the editor provider, a shared component\n\t// across react native and web. However, `BlockRemovalWarningModal` is web only.\n\t// Check it exists before trying to render it.\n\tif ( ! BlockRemovalWarningModal ) {\n\t\treturn null;\n\t}\n\n\tif ( ! removalRulesForPostType ) {\n\t\treturn null;\n\t}\n\n\treturn <BlockRemovalWarningModal rules={ removalRulesForPostType } />;\n}\n"],"mappings":";;;;;;AAIA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAAmD,IAAAM,WAAA,GAAAN,OAAA;AAbnD;AACA;AACA;;AAOA;AACA;AACA;;AAIA,MAAM;EAAEO;AAAyB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;;AAErE;AACA,MAAMC,eAAe,GAAG,CACvB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,CACZ;AACD,MAAMC,mBAAmB,GAAG,CAC3B;EACC;EACA;EACAC,SAAS,EAAE,CAAE,aAAa,EAAE,kBAAkB,CAAE;EAChDC,QAAQA,CAAEC,aAAa,EAAG;IACzB,MAAMC,qBAAqB,GAAGD,aAAa,CAACE,MAAM,CAAE,CAAE;MAAEC;IAAK,CAAC,KAC7DP,eAAe,CAACQ,QAAQ,CAAED,IAAK,CAChC,CAAC;IAC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[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_coreData","_components","_data","_i18n","_store","_lockUnlock","_usePostContentBlocks","_interopRequireDefault","_jsxRuntime","ContentOnlySettingsMenuItems","clientId","onClose","postContentBlocks","usePostContentBlocks","entity","onNavigateToEntityRecord","canEditTemplates","useSelect","select","getBlockParentsByBlockName","getSettings","getBlockAttributes","getBlockParents","blockEditorStore","getCurrentTemplateId","getRenderingMode","editorStore","patternParent","record","coreStore","getEntityRecord","ref","some","parent","includes","_canEditTemplates","canUser","kind","name","jsx","TemplateLockContentOnlyMenuItems","isPattern","type","helpText","__","jsxs","Fragment","children","__unstableBlockSettingsMenuFirstItem","MenuItem","onClick","postId","id","postType","disabled","__experimentalText","variant","as","className","contentLockingParent","getContentLockingParent","unlock","blockDisplayInformation","useBlockDisplayInformation","blockEditorActions","useDispatch","title","modifyContentLockBlock","_x","ContentOnlySettingsMenu","BlockSettingsMenuControls","selectedClientIds","length"],"sources":["@wordpress/editor/src/components/block-settings-menu/content-only-settings-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockSettingsMenuControls,\n\t__unstableBlockSettingsMenuFirstItem as BlockSettingsMenuFirstItem,\n\tstore as blockEditorStore,\n\tuseBlockDisplayInformation,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalText as Text, MenuItem } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport usePostContentBlocks from '../provider/use-post-content-blocks';\n\nfunction ContentOnlySettingsMenuItems( { clientId, onClose } ) {\n\tconst postContentBlocks = usePostContentBlocks();\n\tconst { entity, onNavigateToEntityRecord, canEditTemplates } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\tgetSettings,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetBlockParents,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { getCurrentTemplateId, getRenderingMode } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst patternParent = getBlockParentsByBlockName(\n\t\t\t\tclientId,\n\t\t\t\t'core/block',\n\t\t\t\ttrue\n\t\t\t)[ 0 ];\n\n\t\t\tlet record;\n\t\t\tif ( patternParent ) {\n\t\t\t\trecord = select( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_block',\n\t\t\t\t\tgetBlockAttributes( patternParent ).ref\n\t\t\t\t);\n\t\t\t} else if (\n\t\t\t\tgetRenderingMode() === 'template-locked' &&\n\t\t\t\t! getBlockParents( clientId ).some( ( parent ) =>\n\t\t\t\t\tpostContentBlocks.includes( parent )\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\trecord = select( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_template',\n\t\t\t\t\tgetCurrentTemplateId()\n\t\t\t\t);\n\t\t\t}\n\t\t\tif ( ! record ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\tconst _canEditTemplates = select( coreStore ).canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} );\n\t\t\treturn {\n\t\t\t\tcanEditTemplates: _canEditTemplates,\n\t\t\t\tentity: record,\n\t\t\t\tonNavigateToEntityRecord:\n\t\t\t\t\tgetSettings().onNavigateToEntityRecord,\n\t\t\t};\n\t\t},\n\t\t[ clientId, postContentBlocks ]\n\t);\n\n\tif ( ! entity ) {\n\t\treturn (\n\t\t\t<TemplateLockContentOnlyMenuItems\n\t\t\t\tclientId={ clientId }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst isPattern = entity.type === 'wp_block';\n\tlet helpText = isPattern\n\t\t? __(\n\t\t\t\t'Edit the pattern to move, delete, or make further changes to this block.'\n\t\t )\n\t\t: __(\n\t\t\t\t'Edit the template to move, delete, or make further changes to this block.'\n\t\t );\n\n\tif ( ! canEditTemplates ) {\n\t\thelpText = __(\n\t\t\t'Only users with permissions to edit the template can move or delete this block'\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockSettingsMenuFirstItem>\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\t\t\tpostId: entity.id,\n\t\t\t\t\t\t\tpostType: entity.type,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdisabled={ ! canEditTemplates }\n\t\t\t\t>\n\t\t\t\t\t{ isPattern ? __( 'Edit pattern' ) : __( 'Edit template' ) }\n\t\t\t\t</MenuItem>\n\t\t\t</BlockSettingsMenuFirstItem>\n\t\t\t<Text\n\t\t\t\tvariant=\"muted\"\n\t\t\t\tas=\"p\"\n\t\t\t\tclassName=\"editor-content-only-settings-menu__description\"\n\t\t\t>\n\t\t\t\t{ helpText }\n\t\t\t</Text>\n\t\t</>\n\t);\n}\n\nfunction TemplateLockContentOnlyMenuItems( { clientId, onClose } ) {\n\tconst { contentLockingParent } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getContentLockingParent } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tcontentLockingParent: getContentLockingParent( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst blockDisplayInformation =\n\t\tuseBlockDisplayInformation( contentLockingParent );\n\tconst blockEditorActions = useDispatch( blockEditorStore );\n\tif ( ! blockDisplayInformation?.title ) {\n\t\treturn null;\n\t}\n\n\tconst { modifyContentLockBlock } = unlock( blockEditorActions );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockSettingsMenuFirstItem>\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tmodifyContentLockBlock( contentLockingParent );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ _x( 'Unlock', 'Unlock content locked blocks' ) }\n\t\t\t\t</MenuItem>\n\t\t\t</BlockSettingsMenuFirstItem>\n\t\t\t<Text\n\t\t\t\tvariant=\"muted\"\n\t\t\t\tas=\"p\"\n\t\t\t\tclassName=\"editor-content-only-settings-menu__description\"\n\t\t\t>\n\t\t\t\t{ __(\n\t\t\t\t\t'Temporarily unlock the parent block to edit, delete or make further changes to this block.'\n\t\t\t\t) }\n\t\t\t</Text>\n\t\t</>\n\t);\n}\n\nexport default function ContentOnlySettingsMenu() {\n\treturn (\n\t\t<BlockSettingsMenuControls>\n\t\t\t{ ( { selectedClientIds, onClose } ) =>\n\t\t\t\tselectedClientIds.length === 1 && (\n\t\t\t\t\t<ContentOnlySettingsMenuItems\n\t\t\t\t\t\tclientId={ selectedClientIds[ 0 ] }\n\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t</BlockSettingsMenuControls>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAMA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,qBAAA,GAAAC,sBAAA,CAAAR,OAAA;AAAuE,IAAAS,WAAA,GAAAT,OAAA;AAnBvE;AACA;AACA;;AAYA;AACA;AACA;;AAKA,SAASU,4BAA4BA,CAAE;EAAEC,QAAQ;EAAEC;AAAQ,CAAC,EAAG;EAC9D,MAAMC,iBAA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,4FACD;IAAC,CACI,CAAC;EAAA,CACN,CAAC;AAEL;AAEe,SAASyB,uBAAuBA,CAAA,EAAG;EACjD,oBACC,IAAA7D,WAAA,CAAA+B,GAAA,EAACzC,YAAA,CAAAwE,yBAAyB;IAAAvB,QAAA,EACvBA,CAAE;MAAEwB,iBAAiB;MAAE5D;IAAQ,CAAC,KACjC4D,iBAAiB,CAACC,MAAM,KAAK,CAAC,iBAC7B,IAAAhE,WAAA,CAAA+B,GAAA,EAAC9B,4BAA4B;MAC5BC,QAAQ,EAAG6D,iBAAiB,CAAE,CAAC,CAAI;MACnC5D,OAAO,EAAGA;IAAS,CACnB;EACD,CAEwB,CAAC;AAE9B","ignoreList":[]}
1
+ {"version":3,"names":["_blockEditor","require","_coreData","_components","_data","_i18n","_store","_lockUnlock","_usePostContentBlocks","_interopRequireDefault","_jsxRuntime","ContentOnlySettingsMenuItems","clientId","onClose","postContentBlocks","usePostContentBlocks","entity","onNavigateToEntityRecord","canEditTemplates","useSelect","select","getBlockParentsByBlockName","getSettings","getBlockAttributes","getBlockParents","blockEditorStore","getCurrentTemplateId","getRenderingMode","editorStore","patternParent","record","coreStore","getEntityRecord","ref","some","parent","includes","_canEditTemplates","canUser","kind","name","jsx","TemplateLockContentOnlyMenuItems","isPattern","type","helpText","__","jsxs","Fragment","children","__unstableBlockSettingsMenuFirstItem","MenuItem","onClick","postId","id","postType","disabled","__experimentalText","variant","as","className","contentLockingParent","getContentLockingParent","unlock","blockDisplayInformation","useBlockDisplayInformation","blockEditorActions","useDispatch","title","modifyContentLockBlock","_x","ContentOnlySettingsMenu","BlockSettingsMenuControls","selectedClientIds","length"],"sources":["@wordpress/editor/src/components/block-settings-menu/content-only-settings-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockSettingsMenuControls,\n\t__unstableBlockSettingsMenuFirstItem as BlockSettingsMenuFirstItem,\n\tstore as blockEditorStore,\n\tuseBlockDisplayInformation,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalText as Text, MenuItem } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport usePostContentBlocks from '../provider/use-post-content-blocks';\n\nfunction ContentOnlySettingsMenuItems( { clientId, onClose } ) {\n\tconst postContentBlocks = usePostContentBlocks();\n\tconst { entity, onNavigateToEntityRecord, canEditTemplates } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\tgetSettings,\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetBlockParents,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { getCurrentTemplateId, getRenderingMode } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst patternParent = getBlockParentsByBlockName(\n\t\t\t\tclientId,\n\t\t\t\t'core/block',\n\t\t\t\ttrue\n\t\t\t)[ 0 ];\n\n\t\t\tlet record;\n\t\t\tif ( patternParent ) {\n\t\t\t\trecord = select( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_block',\n\t\t\t\t\tgetBlockAttributes( patternParent ).ref\n\t\t\t\t);\n\t\t\t} else if (\n\t\t\t\tgetRenderingMode() === 'template-locked' &&\n\t\t\t\t! getBlockParents( clientId ).some( ( parent ) =>\n\t\t\t\t\tpostContentBlocks.includes( parent )\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\trecord = select( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_template',\n\t\t\t\t\tgetCurrentTemplateId()\n\t\t\t\t);\n\t\t\t}\n\t\t\tif ( ! record ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\tconst _canEditTemplates = select( coreStore ).canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} );\n\t\t\treturn {\n\t\t\t\tcanEditTemplates: _canEditTemplates,\n\t\t\t\tentity: record,\n\t\t\t\tonNavigateToEntityRecord:\n\t\t\t\t\tgetSettings().onNavigateToEntityRecord,\n\t\t\t};\n\t\t},\n\t\t[ clientId, postContentBlocks ]\n\t);\n\n\tif ( ! entity ) {\n\t\treturn (\n\t\t\t<TemplateLockContentOnlyMenuItems\n\t\t\t\tclientId={ clientId }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst isPattern = entity.type === 'wp_block';\n\tlet helpText = isPattern\n\t\t? __(\n\t\t\t\t'Edit the pattern to move, delete, or make further changes to this block.'\n\t\t )\n\t\t: __(\n\t\t\t\t'Edit the template to move, delete, or make further changes to this block.'\n\t\t );\n\n\tif ( ! canEditTemplates ) {\n\t\thelpText = __(\n\t\t\t'Only users with permissions to edit the template can move or delete this block'\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockSettingsMenuFirstItem>\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\t\t\tpostId: entity.id,\n\t\t\t\t\t\t\tpostType: entity.type,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdisabled={ ! canEditTemplates }\n\t\t\t\t>\n\t\t\t\t\t{ isPattern ? __( 'Edit pattern' ) : __( 'Edit template' ) }\n\t\t\t\t</MenuItem>\n\t\t\t</BlockSettingsMenuFirstItem>\n\t\t\t<Text\n\t\t\t\tvariant=\"muted\"\n\t\t\t\tas=\"p\"\n\t\t\t\tclassName=\"editor-content-only-settings-menu__description\"\n\t\t\t>\n\t\t\t\t{ helpText }\n\t\t\t</Text>\n\t\t</>\n\t);\n}\n\nfunction TemplateLockContentOnlyMenuItems( { clientId, onClose } ) {\n\tconst { contentLockingParent } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getContentLockingParent } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tcontentLockingParent: getContentLockingParent( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst blockDisplayInformation =\n\t\tuseBlockDisplayInformation( contentLockingParent );\n\tconst blockEditorActions = useDispatch( blockEditorStore );\n\tif ( ! blockDisplayInformation?.title ) {\n\t\treturn null;\n\t}\n\n\tconst { modifyContentLockBlock } = unlock( blockEditorActions );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockSettingsMenuFirstItem>\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tmodifyContentLockBlock( contentLockingParent );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ _x( 'Unlock', 'Unlock content locked blocks' ) }\n\t\t\t\t</MenuItem>\n\t\t\t</BlockSettingsMenuFirstItem>\n\t\t\t<Text\n\t\t\t\tvariant=\"muted\"\n\t\t\t\tas=\"p\"\n\t\t\t\tclassName=\"editor-content-only-settings-menu__description\"\n\t\t\t>\n\t\t\t\t{ __(\n\t\t\t\t\t'Temporarily unlock the parent block to edit, delete or make further changes to this block.'\n\t\t\t\t) }\n\t\t\t</Text>\n\t\t</>\n\t);\n}\n\nexport default function ContentOnlySettingsMenu() {\n\treturn (\n\t\t<BlockSettingsMenuControls>\n\t\t\t{ ( { selectedClientIds, onClose } ) =>\n\t\t\t\tselectedClientIds.length === 1 && (\n\t\t\t\t\t<ContentOnlySettingsMenuItems\n\t\t\t\t\t\tclientId={ selectedClientIds[ 0 ] }\n\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t</BlockSettingsMenuControls>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAMA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GA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CAAC;UAC9ChD,OAAO,CAAC,CAAC;QACV,CAAG;QAAAoC,QAAA,EAED,IAAAqB,QAAE,EAAE,QAAQ,EAAE,8BAA+B;MAAC,CACvC;IAAC,CACgB,CAAC,eAC7B,IAAA5D,WAAA,CAAA+B,GAAA,EAACtC,WAAA,CAAAsD,kBAAI;MACJC,OAAO,EAAC,OAAO;MACfC,EAAE,EAAC,GAAG;MACNC,SAAS,EAAC,gDAAgD;MAAAX,QAAA,EAExD,IAAAH,QAAE,EACH,4FACD;IAAC,CACI,CAAC;EAAA,CACN,CAAC;AAEL;AAEe,SAASyB,uBAAuBA,CAAA,EAAG;EACjD,oBACC,IAAA7D,WAAA,CAAA+B,GAAA,EAACzC,YAAA,CAAAwE,yBAAyB;IAAAvB,QAAA,EACvBA,CAAE;MAAEwB,iBAAiB;MAAE5D;IAAQ,CAAC,KACjC4D,iBAAiB,CAACC,MAAM,KAAK,CAAC,iBAC7B,IAAAhE,WAAA,CAAA+B,GAAA,EAAC9B,4BAA4B;MAC5BC,QAAQ,EAAG6D,iBAAiB,CAAE,CAAC,CAAI;MACnC5D,OAAO,EAAGA;IAAS,CACnB;EACD,CAEwB,CAAC;AAE9B","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_components","_compose","_jsxRuntime","isEverySelectedBlockAllowed","selected","allowed","filter","id","includes","length","shouldRenderItem","selectedBlocks","allowedBlocks","Array","isArray","PluginBlockSettingsMenuItem","icon","label","onClick","small","role","jsx","BlockSettingsMenuControls","children","onClose","MenuItem","compose","undefined","_default","exports","default"],"sources":["@wordpress/editor/src/components/block-settings-menu/plugin-block-settings-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockSettingsMenuControls } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\n\nconst isEverySelectedBlockAllowed = ( selected, allowed ) =>\n\tselected.filter( ( id ) => ! allowed.includes( id ) ).length === 0;\n\n/**\n * Plugins may want to add an item to the menu either for every block\n * or only for the specific ones provided in the `allowedBlocks` component property.\n *\n * If there are multiple blocks selected the item will be rendered if every block\n * is of one allowed type (not necessarily the same).\n *\n * @param {string[]} selectedBlocks Array containing the names of the blocks selected\n * @param {string[]} allowedBlocks Array containing the names of the blocks allowed\n * @return {boolean} Whether the item will be rendered or not.\n */\nconst shouldRenderItem = ( selectedBlocks, allowedBlocks ) =>\n\t! Array.isArray( allowedBlocks ) ||\n\tisEverySelectedBlockAllowed( selectedBlocks, allowedBlocks );\n\n/**\n * Renders a new item in the block settings menu.\n *\n * @param {Object} props Component props.\n * @param {Array} [props.allowedBlocks] An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list.\n * @param {WPBlockTypeIconRender} [props.icon] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.\n * @param {string} props.label The menu item text.\n * @param {Function} props.onClick Callback function to be executed when the user click the menu item.\n * @param {boolean} [props.small] Whether to render the label or not.\n * @param {string} [props.role] The ARIA role for the menu item.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginBlockSettingsMenuItem = wp.editor.PluginBlockSettingsMenuItem;\n *\n * function doOnClick(){\n * \t// To be called when the user clicks the menu item.\n * }\n *\n * function MyPluginBlockSettingsMenuItem() {\n * \treturn React.createElement(\n * \t\tPluginBlockSettingsMenuItem,\n * \t\t{\n * \t\t\tallowedBlocks: [ 'core/paragraph' ],\n * \t\t\ticon: 'dashicon-name',\n * \t\t\tlabel: __( 'Menu item text' ),\n * \t\t\tonClick: doOnClick,\n * \t\t}\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginBlockSettingsMenuItem } from '@wordpress/editor';\n *\n * const doOnClick = ( ) => {\n * // To be called when the user clicks the menu item.\n * };\n *\n * const MyPluginBlockSettingsMenuItem = () => (\n * <PluginBlockSettingsMenuItem\n * \t\tallowedBlocks={ [ 'core/paragraph' ] }\n * \t\ticon='dashicon-name'\n * \t\tlabel={ __( 'Menu item text' ) }\n * \t\tonClick={ doOnClick } />\n * );\n * ```\n *\n * @return {React.ReactNode} The rendered component.\n */\nconst PluginBlockSettingsMenuItem = ( {\n\tallowedBlocks,\n\ticon,\n\tlabel,\n\tonClick,\n\tsmall,\n\trole,\n} ) => (\n\t<BlockSettingsMenuControls>\n\t\t{ ( { selectedBlocks, onClose } ) => {\n\t\t\tif ( ! shouldRenderItem( selectedBlocks, allowedBlocks ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ compose( onClick, onClose ) }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ small ? label : undefined }\n\t\t\t\t\trole={ role }\n\t\t\t\t>\n\t\t\t\t\t{ ! small && label }\n\t\t\t\t</MenuItem>\n\t\t\t);\n\t\t} }\n\t</BlockSettingsMenuControls>\n);\n\nexport default PluginBlockSettingsMenuItem;\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAA6C,IAAAG,WAAA,GAAAH,OAAA;AAL7C;AACA;AACA;;AAKA,MAAMI,2BAA2B,GAAGA,CAAEC,QAAQ,EAAEC,OAAO,KACtDD,QAAQ,CAACE,MAAM,CAAIC,EAAE,IAAM,CAAEF,OAAO,CAACG,QAAQ,CAAED,EAAG,CAAE,CAAC,CAACE,MAAM,KAAK,CAAC;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAAEC,cAAc,EAAEC,aAAa,KACvD,CAAEC,KAAK,CAACC,OAAO,CAAEF,aAAc,CAAC,IAChCT,2BAA2B,CAAEQ,cAAc,EAAEC,aAAc,CAAC;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,2BAA2B,GAAGA,CAAE;EACrCH,aAAa;EACbI,IAAI;EACJC,KAAK;EACLC,OAAO;EACPC,KAAK;EACLC;AACD,CAAC,kBACA,IAAAlB,WAAA,CAAAmB,GAAA,EAACvB,YAAA,CAAAwB,yBAAyB;EAAAC,QAAA,EACvBA,CAAE;IAAEZ,cAAc;IAAEa;EAAQ,CAAC,KAAM;IACpC,IAAK,CAAEd,gBAAgB,CAAEC,cAAc,EAAEC,aAAc,CAAC,EAAG;MAC1D,OAAO,IAAI;IACZ;IACA,oBACC,IAAAV,WAAA,CAAAmB,GAAA,EAACrB,WAAA,CAAAyB,QAAQ;MACRP,OAAO,EAAG,IAAAQ,gBAAO,EAAER,OAAO,EAAEM,OAAQ,CAAG;MACvCR,IAAI,EAAGA,IAAM;MACbC,KAAK,EAAGE,KAAK,GAAGF,KAAK,GAAGU,SAAW;MACnCP,IAAI,EAAGA,IAAM;MAAAG,QAAA,EAEX,CAAEJ,KAAK,IAAIF;IAAK,CACT,CAAC;EAEb;AAAC,CACyB,CAC3B;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaf,2BAA2B","ignoreList":[]}
1
+ {"version":3,"names":["_blockEditor","require","_components","_compose","_jsxRuntime","isEverySelectedBlockAllowed","selected","allowed","filter","id","includes","length","shouldRenderItem","selectedBlocks","allowedBlocks","Array","isArray","PluginBlockSettingsMenuItem","icon","label","onClick","small","role","jsx","BlockSettingsMenuControls","children","onClose","MenuItem","compose","undefined","_default","exports","default"],"sources":["@wordpress/editor/src/components/block-settings-menu/plugin-block-settings-menu-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { BlockSettingsMenuControls } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\n\nconst isEverySelectedBlockAllowed = ( selected, allowed ) =>\n\tselected.filter( ( id ) => ! allowed.includes( id ) ).length === 0;\n\n/**\n * Plugins may want to add an item to the menu either for every block\n * or only for the specific ones provided in the `allowedBlocks` component property.\n *\n * If there are multiple blocks selected the item will be rendered if every block\n * is of one allowed type (not necessarily the same).\n *\n * @param {string[]} selectedBlocks Array containing the names of the blocks selected\n * @param {string[]} allowedBlocks Array containing the names of the blocks allowed\n * @return {boolean} Whether the item will be rendered or not.\n */\nconst shouldRenderItem = ( selectedBlocks, allowedBlocks ) =>\n\t! Array.isArray( allowedBlocks ) ||\n\tisEverySelectedBlockAllowed( selectedBlocks, allowedBlocks );\n\n/**\n * Renders a new item in the block settings menu.\n *\n * @param {Object} props Component props.\n * @param {Array} [props.allowedBlocks] An array containing a list of block names for which the item should be shown. If not present, it'll be rendered for any block. If multiple blocks are selected, it'll be shown if and only if all of them are in the allowed list.\n * @param {WPBlockTypeIconRender} [props.icon] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element.\n * @param {string} props.label The menu item text.\n * @param {Function} props.onClick Callback function to be executed when the user click the menu item.\n * @param {boolean} [props.small] Whether to render the label or not.\n * @param {string} [props.role] The ARIA role for the menu item.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var PluginBlockSettingsMenuItem = wp.editor.PluginBlockSettingsMenuItem;\n *\n * function doOnClick(){\n * \t// To be called when the user clicks the menu item.\n * }\n *\n * function MyPluginBlockSettingsMenuItem() {\n * \treturn React.createElement(\n * \t\tPluginBlockSettingsMenuItem,\n * \t\t{\n * \t\t\tallowedBlocks: [ 'core/paragraph' ],\n * \t\t\ticon: 'dashicon-name',\n * \t\t\tlabel: __( 'Menu item text' ),\n * \t\t\tonClick: doOnClick,\n * \t\t}\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PluginBlockSettingsMenuItem } from '@wordpress/editor';\n *\n * const doOnClick = ( ) => {\n * // To be called when the user clicks the menu item.\n * };\n *\n * const MyPluginBlockSettingsMenuItem = () => (\n * <PluginBlockSettingsMenuItem\n * \t\tallowedBlocks={ [ 'core/paragraph' ] }\n * \t\ticon='dashicon-name'\n * \t\tlabel={ __( 'Menu item text' ) }\n * \t\tonClick={ doOnClick } />\n * );\n * ```\n *\n * @return {React.ReactNode} The rendered component.\n */\nconst PluginBlockSettingsMenuItem = ( {\n\tallowedBlocks,\n\ticon,\n\tlabel,\n\tonClick,\n\tsmall,\n\trole,\n} ) => (\n\t<BlockSettingsMenuControls>\n\t\t{ ( { selectedBlocks, onClose } ) => {\n\t\t\tif ( ! shouldRenderItem( selectedBlocks, allowedBlocks ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn (\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ compose( onClick, onClose ) }\n\t\t\t\t\ticon={ icon }\n\t\t\t\t\tlabel={ small ? label : undefined }\n\t\t\t\t\trole={ role }\n\t\t\t\t>\n\t\t\t\t\t{ ! small && label }\n\t\t\t\t</MenuItem>\n\t\t\t);\n\t\t} }\n\t</BlockSettingsMenuControls>\n);\n\nexport default PluginBlockSettingsMenuItem;\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAA6C,IAAAG,WAAA,GAAAH,OAAA;AAL7C;AACA;AACA;;AAKA,MAAMI,2BAA2B,GAAGA,CAAEC,QAAQ,EAAEC,OAAO,KACtD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AAAC,CACyB,CAC3B;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaf,2BAA2B","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_components","_icons","_i18n","_data","_blockEditor","_commentAuthorInfo","_commentForm","_jsxRuntime","Comments","threads","onEditComment","onAddReply","onCommentDelete","onCommentResolve","showCommentBoard","setShowCommentBoard","blockCommentId","useSelect","select","getBlockAttributes","getSelectedBlockClientId","blockEditorStore","_clientId","focusThread","setFocusThread","useState","clearThreadFocus","jsxs","Fragment","children","Array","isArray","length","jsx","__experimentalVStack","alignment","className","justify","spacing","__","map","thread","clsx","id","onClick","Thread","isFocused","CommentBoard","onResolve","onEdit","onDelete","status","reply","sprintf","_x","__experimentalHStack","default","onSubmit","inputComment","onCancel","event","stopPropagation","submitButtonText","actionState","setActionState","showConfirmDialog","setShowConfirmDialog","handleConfirmDelete","handleConfirmResolve","handleCancel","actions","title","moreActions","filter","item","avatar","author_avatar_urls","name","author_name","date","parent","Button","label","__next40pxDefaultSize","icon","published","showTooltip","DropdownMenu","moreVertical","controls","Tooltip","text","Icon","check","value","RawHTML","content","raw","__experimentalConfirmDialog","isOpen","onConfirm","confirmButtonText","cancelButtonText"],"sources":["@wordpress/editor/src/components/collab-sidebar/comments.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, RawHTML } from '@wordpress/element';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalConfirmDialog as ConfirmDialog,\n\tButton,\n\tDropdownMenu,\n\tTooltip,\n} from '@wordpress/components';\nimport { Icon, check, published, moreVertical } from '@wordpress/icons';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport CommentAuthorInfo from './comment-author-info';\nimport CommentForm from './comment-form';\n\n/**\n * Renders the Comments component.\n *\n * @param {Object} props - The component props.\n * @param {Array} props.threads - The array of comment threads.\n * @param {Function} props.onEditComment - The function to handle comment editing.\n * @param {Function} props.onAddReply - The function to add a reply to a comment.\n * @param {Function} props.onCommentDelete - The function to delete a comment.\n * @param {Function} props.onCommentResolve - The function to mark a comment as resolved.\n * @param {boolean} props.showCommentBoard - Whether to show the comment board.\n * @param {Function} props.setShowCommentBoard - The function to set the comment board visibility.\n * @return {React.ReactNode} The rendered Comments component.\n */\nexport function Comments( {\n\tthreads,\n\tonEditComment,\n\tonAddReply,\n\tonCommentDelete,\n\tonCommentResolve,\n\tshowCommentBoard,\n\tsetShowCommentBoard,\n} ) {\n\tconst { blockCommentId } = useSelect( ( select ) => {\n\t\tconst { getBlockAttributes, getSelectedBlockClientId } =\n\t\t\tselect( blockEditorStore );\n\t\tconst _clientId = getSelectedBlockClientId();\n\n\t\treturn {\n\t\t\tblockCommentId: _clientId\n\t\t\t\t? getBlockAttributes( _clientId )?.blockCommentId\n\t\t\t\t: null,\n\t\t};\n\t}, [] );\n\n\tconst [ focusThread, setFocusThread ] = useState(\n\t\tshowCommentBoard && blockCommentId ? blockCommentId : null\n\t);\n\n\tconst clearThreadFocus = () => {\n\t\tsetFocusThread( null );\n\t\tsetShowCommentBoard( false );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{\n\t\t\t\t// If there are no comments, show a message indicating no comments are available.\n\t\t\t\t( ! Array.isArray( threads ) || threads.length === 0 ) && (\n\t\t\t\t\t<VStack\n\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__thread\"\n\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// translators: message displayed when there are no comments available\n\t\t\t\t\t\t\t__( 'No comments available' )\n\t\t\t\t\t\t}\n\t\t\t\t\t</VStack>\n\t\t\t\t)\n\t\t\t}\n\t\t\t{ Array.isArray( threads ) &&\n\t\t\t\tthreads.length > 0 &&\n\t\t\t\tthreads.map( ( thread ) => (\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tkey={ thread.id }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'editor-collab-sidebar-panel__thread',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'editor-collab-sidebar-panel__active-thread':\n\t\t\t\t\t\t\t\t\tblockCommentId &&\n\t\t\t\t\t\t\t\t\tblockCommentId === thread.id,\n\t\t\t\t\t\t\t\t'editor-collab-sidebar-panel__focus-thread':\n\t\t\t\t\t\t\t\t\tfocusThread && focusThread === thread.id,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tid={ thread.id }\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\tonClick={ () => setFocusThread( thread.id ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Thread\n\t\t\t\t\t\t\tthread={ thread }\n\t\t\t\t\t\t\tonAddReply={ onAddReply }\n\t\t\t\t\t\t\tonCommentDelete={ onCommentDelete }\n\t\t\t\t\t\t\tonCommentResolve={ onCommentResolve }\n\t\t\t\t\t\t\tonEditComment={ onEditComment }\n\t\t\t\t\t\t\tisFocused={ focusThread === thread.id }\n\t\t\t\t\t\t\tclearThreadFocus={ clearThreadFocus }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</VStack>\n\t\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nfunction Thread( {\n\tthread,\n\tonEditComment,\n\tonAddReply,\n\tonCommentDelete,\n\tonCommentResolve,\n\tisFocused,\n\tclearThreadFocus,\n} ) {\n\treturn (\n\t\t<>\n\t\t\t<CommentBoard\n\t\t\t\tthread={ thread }\n\t\t\t\tonResolve={ onCommentResolve }\n\t\t\t\tonEdit={ onEditComment }\n\t\t\t\tonDelete={ onCommentDelete }\n\t\t\t\tstatus={ thread.status }\n\t\t\t/>\n\t\t\t{ 0 < thread?.reply?.length && (\n\t\t\t\t<>\n\t\t\t\t\t{ ! isFocused && (\n\t\t\t\t\t\t<VStack className=\"editor-collab-sidebar-panel__show-more-reply\">\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t// translators: 1: number of replies.\n\t\t\t\t\t\t\t\t_x(\n\t\t\t\t\t\t\t\t\t'%s more replies..',\n\t\t\t\t\t\t\t\t\t'Show replies button'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tthread?.reply?.length\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ isFocused &&\n\t\t\t\t\t\tthread.reply.map( ( reply ) => (\n\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\tkey={ reply.id }\n\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__child-thread\"\n\t\t\t\t\t\t\t\tid={ reply.id }\n\t\t\t\t\t\t\t\tspacing=\"2\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ 'approved' !== thread.status && (\n\t\t\t\t\t\t\t\t\t<CommentBoard\n\t\t\t\t\t\t\t\t\t\tthread={ reply }\n\t\t\t\t\t\t\t\t\t\tonEdit={ onEditComment }\n\t\t\t\t\t\t\t\t\t\tonDelete={ onCommentDelete }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ 'approved' === thread.status && (\n\t\t\t\t\t\t\t\t\t<CommentBoard thread={ reply } />\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t) ) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ 'approved' !== thread.status && isFocused && (\n\t\t\t\t<VStack\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__child-thread\"\n\t\t\t\t\tspacing=\"2\"\n\t\t\t\t>\n\t\t\t\t\t<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t\t\t\t<CommentAuthorInfo />\n\t\t\t\t\t</HStack>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-field\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<CommentForm\n\t\t\t\t\t\t\tonSubmit={ ( inputComment ) => {\n\t\t\t\t\t\t\t\tonAddReply( inputComment, thread.id );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonCancel={ ( event ) => {\n\t\t\t\t\t\t\t\tevent.stopPropagation(); // Prevent the parent onClick from being triggered\n\t\t\t\t\t\t\t\tclearThreadFocus();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tsubmitButtonText={ _x(\n\t\t\t\t\t\t\t\t'Reply',\n\t\t\t\t\t\t\t\t'Add reply comment'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</VStack>\n\t\t\t\t</VStack>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nconst CommentBoard = ( { thread, onResolve, onEdit, onDelete, status } ) => {\n\tconst [ actionState, setActionState ] = useState( false );\n\tconst [ showConfirmDialog, setShowConfirmDialog ] = useState( false );\n\n\tconst handleConfirmDelete = () => {\n\t\tonDelete( thread.id );\n\t\tsetActionState( false );\n\t\tsetShowConfirmDialog( false );\n\t};\n\n\tconst handleConfirmResolve = () => {\n\t\tonResolve( thread.id );\n\t\tsetActionState( false );\n\t\tsetShowConfirmDialog( false );\n\t};\n\n\tconst handleCancel = () => {\n\t\tsetActionState( false );\n\t\tsetShowConfirmDialog( false );\n\t};\n\n\tconst actions = [\n\t\tonEdit && {\n\t\t\ttitle: _x( 'Edit', 'Edit comment' ),\n\t\t\tonClick: () => {\n\t\t\t\tsetActionState( 'edit' );\n\t\t\t},\n\t\t},\n\t\tonDelete && {\n\t\t\ttitle: _x( 'Delete', 'Delete comment' ),\n\t\t\tonClick: () => {\n\t\t\t\tsetActionState( 'delete' );\n\t\t\t\tsetShowConfirmDialog( true );\n\t\t\t},\n\t\t},\n\t];\n\n\tconst moreActions = actions.filter( ( item ) => item?.onClick );\n\n\treturn (\n\t\t<>\n\t\t\t<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t\t<CommentAuthorInfo\n\t\t\t\t\tavatar={ thread?.author_avatar_urls?.[ 48 ] }\n\t\t\t\t\tname={ thread?.author_name }\n\t\t\t\t\tdate={ thread?.date }\n\t\t\t\t/>\n\t\t\t\t<span className=\"editor-collab-sidebar-panel__comment-status\">\n\t\t\t\t\t{ status !== 'approved' && (\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\talignment=\"right\"\n\t\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t\t\tspacing=\"0\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ 0 === thread?.parent && onResolve && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t\t'Resolve',\n\t\t\t\t\t\t\t\t\t\t'Mark comment as resolved'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\ticon={ published }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetActionState( 'resolve' );\n\t\t\t\t\t\t\t\t\t\tsetShowConfirmDialog( true );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ 0 < moreActions.length && (\n\t\t\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t\t'Select an action',\n\t\t\t\t\t\t\t\t\t\t'Select comment action'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-dropdown-menu\"\n\t\t\t\t\t\t\t\t\tcontrols={ moreActions }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t) }\n\t\t\t\t\t{ status === 'approved' && (\n\t\t\t\t\t\t// translators: tooltip for resolved comment\n\t\t\t\t\t\t<Tooltip text={ __( 'Resolved' ) }>\n\t\t\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t) }\n\t\t\t\t</span>\n\t\t\t</HStack>\n\t\t\t<HStack\n\t\t\t\talignment=\"left\"\n\t\t\t\tspacing=\"3\"\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-comment\"\n\t\t\t>\n\t\t\t\t<VStack\n\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-field\"\n\t\t\t\t>\n\t\t\t\t\t{ 'edit' === actionState && (\n\t\t\t\t\t\t<CommentForm\n\t\t\t\t\t\t\tonSubmit={ ( value ) => {\n\t\t\t\t\t\t\t\tonEdit( thread.id, value );\n\t\t\t\t\t\t\t\tsetActionState( false );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonCancel={ () => handleCancel() }\n\t\t\t\t\t\t\tthread={ thread }\n\t\t\t\t\t\t\tsubmitButtonText={ _x( 'Update', 'verb' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ 'edit' !== actionState && (\n\t\t\t\t\t\t<RawHTML>{ thread?.content?.raw }</RawHTML>\n\t\t\t\t\t) }\n\t\t\t\t</VStack>\n\t\t\t</HStack>\n\t\t\t{ 'resolve' === actionState && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\tisOpen={ showConfirmDialog }\n\t\t\t\t\tonConfirm={ handleConfirmResolve }\n\t\t\t\t\tonCancel={ handleCancel }\n\t\t\t\t\tconfirmButtonText=\"Yes\"\n\t\t\t\t\tcancelButtonText=\"No\"\n\t\t\t\t>\n\t\t\t\t\t{\n\t\t\t\t\t\t// translators: message displayed when confirming an action\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Are you sure you want to mark this comment as resolved?'\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t</ConfirmDialog>\n\t\t\t) }\n\t\t\t{ 'delete' === actionState && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\tisOpen={ showConfirmDialog }\n\t\t\t\t\tonConfirm={ handleConfirmDelete }\n\t\t\t\t\tonCancel={ handleCancel }\n\t\t\t\t\tconfirmButtonText=\"Yes\"\n\t\t\t\t\tcancelButtonText=\"No\"\n\t\t\t\t>\n\t\t\t\t\t{\n\t\t\t\t\t\t// translators: message displayed when confirming an action\n\t\t\t\t\t\t__( 'Are you sure you want to delete this comment?' )\n\t\t\t\t\t}\n\t\t\t\t</ConfirmDialog>\n\t\t\t) }\n\t\t</>\n\t);\n};\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAQA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,kBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,YAAA,GAAAT,sBAAA,CAAAC,OAAA;AAAyC,IAAAS,WAAA,GAAAT,OAAA;AA1BzC;AACA;AACA;;AAGA;AACA;AACA;;AAeA;AACA;AACA;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BAAa;MACbC,MAAM,EAAGlC,iBAAmB;MAC5BmC,SAAS,EAAGjC,mBAAqB;MACjCR,QAAQ,EAAGU,YAAc;MACzBgC,iBAAiB,EAAC,KAAK;MACvBC,gBAAgB,EAAC,IAAI;MAAAzE,QAAA;MAGpB;MACA,IAAAU,QAAE,EAAE,+CAAgD;IAAC,CAExC,CACf;EAAA,CACA,CAAC;AAEL,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_element","_components","_icons","_i18n","_data","_blockEditor","_commentAuthorInfo","_commentForm","_jsxRuntime","Comments","threads","onEditComment","onAddReply","onCommentDelete","onCommentResolve","showCommentBoard","setShowCommentBoard","blockCommentId","useSelect","select","getBlockAttributes","getSelectedBlockClientId","blockEditorStore","_clientId","focusThread","setFocusThread","useState","clearThreadFocus","jsxs","Fragment","children","Array","isArray","length","jsx","__experimentalVStack","alignment","className","justify","spacing","__","map","thread","clsx","id","onClick","Thread","isFocused","CommentBoard","onResolve","onEdit","onDelete","status","reply","sprintf","_x","__experimentalHStack","default","onSubmit","inputComment","onCancel","event","stopPropagation","submitButtonText","actionState","setActionState","showConfirmDialog","setShowConfirmDialog","handleConfirmDelete","handleConfirmResolve","handleCancel","actions","title","moreActions","filter","item","avatar","author_avatar_urls","name","author_name","date","parent","Button","label","__next40pxDefaultSize","icon","published","showTooltip","DropdownMenu","moreVertical","controls","Tooltip","text","Icon","check","value","RawHTML","content","raw","__experimentalConfirmDialog","isOpen","onConfirm","confirmButtonText","cancelButtonText"],"sources":["@wordpress/editor/src/components/collab-sidebar/comments.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useState, RawHTML } from '@wordpress/element';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalConfirmDialog as ConfirmDialog,\n\tButton,\n\tDropdownMenu,\n\tTooltip,\n} from '@wordpress/components';\nimport { Icon, check, published, moreVertical } from '@wordpress/icons';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport CommentAuthorInfo from './comment-author-info';\nimport CommentForm from './comment-form';\n\n/**\n * Renders the Comments component.\n *\n * @param {Object} props - The component props.\n * @param {Array} props.threads - The array of comment threads.\n * @param {Function} props.onEditComment - The function to handle comment editing.\n * @param {Function} props.onAddReply - The function to add a reply to a comment.\n * @param {Function} props.onCommentDelete - The function to delete a comment.\n * @param {Function} props.onCommentResolve - The function to mark a comment as resolved.\n * @param {boolean} props.showCommentBoard - Whether to show the comment board.\n * @param {Function} props.setShowCommentBoard - The function to set the comment board visibility.\n * @return {React.ReactNode} The rendered Comments component.\n */\nexport function Comments( {\n\tthreads,\n\tonEditComment,\n\tonAddReply,\n\tonCommentDelete,\n\tonCommentResolve,\n\tshowCommentBoard,\n\tsetShowCommentBoard,\n} ) {\n\tconst { blockCommentId } = useSelect( ( select ) => {\n\t\tconst { getBlockAttributes, getSelectedBlockClientId } =\n\t\t\tselect( blockEditorStore );\n\t\tconst _clientId = getSelectedBlockClientId();\n\n\t\treturn {\n\t\t\tblockCommentId: _clientId\n\t\t\t\t? getBlockAttributes( _clientId )?.blockCommentId\n\t\t\t\t: null,\n\t\t};\n\t}, [] );\n\n\tconst [ focusThread, setFocusThread ] = useState(\n\t\tshowCommentBoard && blockCommentId ? blockCommentId : null\n\t);\n\n\tconst clearThreadFocus = () => {\n\t\tsetFocusThread( null );\n\t\tsetShowCommentBoard( false );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{\n\t\t\t\t// If there are no comments, show a message indicating no comments are available.\n\t\t\t\t( ! Array.isArray( threads ) || threads.length === 0 ) && (\n\t\t\t\t\t<VStack\n\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__thread\"\n\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// translators: message displayed when there are no comments available\n\t\t\t\t\t\t\t__( 'No comments available' )\n\t\t\t\t\t\t}\n\t\t\t\t\t</VStack>\n\t\t\t\t)\n\t\t\t}\n\t\t\t{ Array.isArray( threads ) &&\n\t\t\t\tthreads.length > 0 &&\n\t\t\t\tthreads.map( ( thread ) => (\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tkey={ thread.id }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'editor-collab-sidebar-panel__thread',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'editor-collab-sidebar-panel__active-thread':\n\t\t\t\t\t\t\t\t\tblockCommentId &&\n\t\t\t\t\t\t\t\t\tblockCommentId === thread.id,\n\t\t\t\t\t\t\t\t'editor-collab-sidebar-panel__focus-thread':\n\t\t\t\t\t\t\t\t\tfocusThread && focusThread === thread.id,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tid={ thread.id }\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\tonClick={ () => setFocusThread( thread.id ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Thread\n\t\t\t\t\t\t\tthread={ thread }\n\t\t\t\t\t\t\tonAddReply={ onAddReply }\n\t\t\t\t\t\t\tonCommentDelete={ onCommentDelete }\n\t\t\t\t\t\t\tonCommentResolve={ onCommentResolve }\n\t\t\t\t\t\t\tonEditComment={ onEditComment }\n\t\t\t\t\t\t\tisFocused={ focusThread === thread.id }\n\t\t\t\t\t\t\tclearThreadFocus={ clearThreadFocus }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</VStack>\n\t\t\t\t) ) }\n\t\t</>\n\t);\n}\n\nfunction Thread( {\n\tthread,\n\tonEditComment,\n\tonAddReply,\n\tonCommentDelete,\n\tonCommentResolve,\n\tisFocused,\n\tclearThreadFocus,\n} ) {\n\treturn (\n\t\t<>\n\t\t\t<CommentBoard\n\t\t\t\tthread={ thread }\n\t\t\t\tonResolve={ onCommentResolve }\n\t\t\t\tonEdit={ onEditComment }\n\t\t\t\tonDelete={ onCommentDelete }\n\t\t\t\tstatus={ thread.status }\n\t\t\t/>\n\t\t\t{ 0 < thread?.reply?.length && (\n\t\t\t\t<>\n\t\t\t\t\t{ ! isFocused && (\n\t\t\t\t\t\t<VStack className=\"editor-collab-sidebar-panel__show-more-reply\">\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t// translators: 1: number of replies.\n\t\t\t\t\t\t\t\t_x(\n\t\t\t\t\t\t\t\t\t'%s more replies..',\n\t\t\t\t\t\t\t\t\t'Show replies button'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tthread?.reply?.length\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ isFocused &&\n\t\t\t\t\t\tthread.reply.map( ( reply ) => (\n\t\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\t\tkey={ reply.id }\n\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__child-thread\"\n\t\t\t\t\t\t\t\tid={ reply.id }\n\t\t\t\t\t\t\t\tspacing=\"2\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ 'approved' !== thread.status && (\n\t\t\t\t\t\t\t\t\t<CommentBoard\n\t\t\t\t\t\t\t\t\t\tthread={ reply }\n\t\t\t\t\t\t\t\t\t\tonEdit={ onEditComment }\n\t\t\t\t\t\t\t\t\t\tonDelete={ onCommentDelete }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ 'approved' === thread.status && (\n\t\t\t\t\t\t\t\t\t<CommentBoard thread={ reply } />\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t) ) }\n\t\t\t\t</>\n\t\t\t) }\n\t\t\t{ 'approved' !== thread.status && isFocused && (\n\t\t\t\t<VStack\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__child-thread\"\n\t\t\t\t\tspacing=\"2\"\n\t\t\t\t>\n\t\t\t\t\t<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t\t\t\t<CommentAuthorInfo />\n\t\t\t\t\t</HStack>\n\t\t\t\t\t<VStack\n\t\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-field\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<CommentForm\n\t\t\t\t\t\t\tonSubmit={ ( inputComment ) => {\n\t\t\t\t\t\t\t\tonAddReply( inputComment, thread.id );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonCancel={ ( event ) => {\n\t\t\t\t\t\t\t\tevent.stopPropagation(); // Prevent the parent onClick from being triggered\n\t\t\t\t\t\t\t\tclearThreadFocus();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tsubmitButtonText={ _x(\n\t\t\t\t\t\t\t\t'Reply',\n\t\t\t\t\t\t\t\t'Add reply comment'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</VStack>\n\t\t\t\t</VStack>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nconst CommentBoard = ( { thread, onResolve, onEdit, onDelete, status } ) => {\n\tconst [ actionState, setActionState ] = useState( false );\n\tconst [ showConfirmDialog, setShowConfirmDialog ] = useState( false );\n\n\tconst handleConfirmDelete = () => {\n\t\tonDelete( thread.id );\n\t\tsetActionState( false );\n\t\tsetShowConfirmDialog( false );\n\t};\n\n\tconst handleConfirmResolve = () => {\n\t\tonResolve( thread.id );\n\t\tsetActionState( false );\n\t\tsetShowConfirmDialog( false );\n\t};\n\n\tconst handleCancel = () => {\n\t\tsetActionState( false );\n\t\tsetShowConfirmDialog( false );\n\t};\n\n\tconst actions = [\n\t\tonEdit && {\n\t\t\ttitle: _x( 'Edit', 'Edit comment' ),\n\t\t\tonClick: () => {\n\t\t\t\tsetActionState( 'edit' );\n\t\t\t},\n\t\t},\n\t\tonDelete && {\n\t\t\ttitle: _x( 'Delete', 'Delete comment' ),\n\t\t\tonClick: () => {\n\t\t\t\tsetActionState( 'delete' );\n\t\t\t\tsetShowConfirmDialog( true );\n\t\t\t},\n\t\t},\n\t];\n\n\tconst moreActions = actions.filter( ( item ) => item?.onClick );\n\n\treturn (\n\t\t<>\n\t\t\t<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t\t<CommentAuthorInfo\n\t\t\t\t\tavatar={ thread?.author_avatar_urls?.[ 48 ] }\n\t\t\t\t\tname={ thread?.author_name }\n\t\t\t\t\tdate={ thread?.date }\n\t\t\t\t/>\n\t\t\t\t<span className=\"editor-collab-sidebar-panel__comment-status\">\n\t\t\t\t\t{ status !== 'approved' && (\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\talignment=\"right\"\n\t\t\t\t\t\t\tjustify=\"flex-end\"\n\t\t\t\t\t\t\tspacing=\"0\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ 0 === thread?.parent && onResolve && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t\t'Resolve',\n\t\t\t\t\t\t\t\t\t\t'Mark comment as resolved'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\ticon={ published }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetActionState( 'resolve' );\n\t\t\t\t\t\t\t\t\t\tsetShowConfirmDialog( true );\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t{ 0 < moreActions.length && (\n\t\t\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\t\t\tlabel={ _x(\n\t\t\t\t\t\t\t\t\t\t'Select an action',\n\t\t\t\t\t\t\t\t\t\t'Select comment action'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-dropdown-menu\"\n\t\t\t\t\t\t\t\t\tcontrols={ moreActions }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t) }\n\t\t\t\t\t{ status === 'approved' && (\n\t\t\t\t\t\t// translators: tooltip for resolved comment\n\t\t\t\t\t\t<Tooltip text={ __( 'Resolved' ) }>\n\t\t\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t) }\n\t\t\t\t</span>\n\t\t\t</HStack>\n\t\t\t<HStack\n\t\t\t\talignment=\"left\"\n\t\t\t\tspacing=\"3\"\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-comment\"\n\t\t\t>\n\t\t\t\t<VStack\n\t\t\t\t\tspacing=\"3\"\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__comment-field\"\n\t\t\t\t>\n\t\t\t\t\t{ 'edit' === actionState && (\n\t\t\t\t\t\t<CommentForm\n\t\t\t\t\t\t\tonSubmit={ ( value ) => {\n\t\t\t\t\t\t\t\tonEdit( thread.id, value );\n\t\t\t\t\t\t\t\tsetActionState( false );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonCancel={ () => handleCancel() }\n\t\t\t\t\t\t\tthread={ thread }\n\t\t\t\t\t\t\tsubmitButtonText={ _x( 'Update', 'verb' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ 'edit' !== actionState && (\n\t\t\t\t\t\t<RawHTML>{ thread?.content?.raw }</RawHTML>\n\t\t\t\t\t) }\n\t\t\t\t</VStack>\n\t\t\t</HStack>\n\t\t\t{ 'resolve' === actionState && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\tisOpen={ showConfirmDialog }\n\t\t\t\t\tonConfirm={ handleConfirmResolve }\n\t\t\t\t\tonCancel={ handleCancel }\n\t\t\t\t\tconfirmButtonText=\"Yes\"\n\t\t\t\t\tcancelButtonText=\"No\"\n\t\t\t\t>\n\t\t\t\t\t{\n\t\t\t\t\t\t// translators: message displayed when confirming an action\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Are you sure you want to mark this comment as resolved?'\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t</ConfirmDialog>\n\t\t\t) }\n\t\t\t{ 'delete' === actionState && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\tisOpen={ showConfirmDialog }\n\t\t\t\t\tonConfirm={ handleConfirmDelete }\n\t\t\t\t\tonCancel={ handleCancel }\n\t\t\t\t\tconfirmButtonText=\"Yes\"\n\t\t\t\t\tcancelButtonText=\"No\"\n\t\t\t\t>\n\t\t\t\t\t{\n\t\t\t\t\t\t// translators: message displayed when confirming an action\n\t\t\t\t\t\t__( 'Are you sure you want to delete this comment?' )\n\t\t\t\t\t}\n\t\t\t\t</ConfirmDialog>\n\t\t\t) }\n\t\t</>\n\t);\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAQA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAKA,IAAAO,kBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,YAAA,GAAAT,sBAAA,CAAAC,OAAA;AAAyC,IAAAS,WAAA,GAAAT,OAAA;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IAAAxD,WAAA,CAAA0B,GAAA,EAACjC,WAAA,CAAAkG,2BAAa;MACbC,MAAM,EAAGlC,iBAAmB;MAC5BmC,SAAS,EAAGjC,mBAAqB;MACjCR,QAAQ,EAAGU,YAAc;MACzBgC,iBAAiB,EAAC,KAAK;MACvBC,gBAAgB,EAAC,IAAI;MAAAzE,QAAA;MAGpB;MACA,IAAAU,QAAE,EAAE,+CAAgD;IAAC,CAExC,CACf;EAAA,CACA,CAAC;AAEL,CAAC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_data","_element","_icons","_hooks","_notices","_coreData","_blockEditor","_interface","_pluginSidebar","_interopRequireDefault","_constants","_comments","_addComment","_store","_commentButton","_commentButtonToolbar","_globalStylesProvider","_utils","_jsxRuntime","modifyBlockCommentAttributes","settings","attributes","blockCommentId","type","addFilter","CollabSidebarContent","showCommentBoard","setShowCommentBoard","styles","comments","createNotice","useDispatch","noticesStore","saveEntityRecord","deleteEntityRecord","coreStore","getEntityRecord","resolveSelect","postId","useSelect","select","getCurrentPostId","editorStore","_postId","getSelectedBlockClientId","blockEditorStore","updateBlockAttributes","addNewComment","comment","parentCommentId","args","post","content","comment_type","comment_approved","updatedArgs","parent","savedRecord","id","__","isDismissible","onError","onCommentResolve","commentId","status","onEditComment","onCommentDelete","childComment","undefined","jsxs","className","style","children","jsx","AddComment","onSubmit","Comments","threads","onAddReply","CollabSidebar","useState","enableComplementaryArea","interfaceStore","getActiveComplementaryArea","postType","postStatus","getCurrentPostType","data","getEntityRecords","per_page","getEditedPostAttribute","getBlockAttributes","_clientId","openCollabBoard","blocks","useEntityBlockEditor","resultComments","sortedThreads","useMemo","compare","result","filteredComments","filter","forEach","item","reply","push","length","updatedResult","map","reverse","blockCommentIds","getCommentIdsFromBlocks","threadIdMap","Map","thread","sortedComments","get","merged","GlobalStyles","useGlobalStylesContext","backgroundColor","color","background","unsubscribe","subscribe","activeSidebar","collabSidebarName","AddCommentComponent","AddCommentToolbarButton","AddCommentButton","Fragment","onClick","default","identifier","collabHistorySidebarName","title","icon","commentIcon","isPinnable","header","headerClassName"],"sources":["@wordpress/editor/src/components/collab-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseSelect,\n\tuseDispatch,\n\tresolveSelect,\n\tsubscribe,\n} from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { comment as commentIcon } from '@wordpress/icons';\nimport { addFilter } from '@wordpress/hooks';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore, useEntityBlockEditor } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport PluginSidebar from '../plugin-sidebar';\nimport { collabHistorySidebarName, collabSidebarName } from './constants';\nimport { Comments } from './comments';\nimport { AddComment } from './add-comment';\nimport { store as editorStore } from '../../store';\nimport AddCommentButton from './comment-button';\nimport AddCommentToolbarButton from './comment-button-toolbar';\nimport { useGlobalStylesContext } from '../global-styles-provider';\nimport { getCommentIdsFromBlocks } from './utils';\n\nconst modifyBlockCommentAttributes = ( settings ) => {\n\tif ( ! settings.attributes.blockCommentId ) {\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tblockCommentId: {\n\t\t\t\ttype: 'number',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n};\n\n// Apply the filter to all core blocks\naddFilter(\n\t'blocks.registerBlockType',\n\t'block-comment/modify-core-block-attributes',\n\tmodifyBlockCommentAttributes\n);\n\nfunction CollabSidebarContent( {\n\tshowCommentBoard,\n\tsetShowCommentBoard,\n\tstyles,\n\tcomments,\n} ) {\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst { saveEntityRecord, deleteEntityRecord } = useDispatch( coreStore );\n\tconst { getEntityRecord } = resolveSelect( coreStore );\n\n\tconst { postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostId } = select( editorStore );\n\t\tconst _postId = getCurrentPostId();\n\n\t\treturn {\n\t\t\tpostId: _postId,\n\t\t};\n\t}, [] );\n\n\tconst { getSelectedBlockClientId } = useSelect( blockEditorStore );\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\t// Function to save the comment.\n\tconst addNewComment = async ( comment, parentCommentId ) => {\n\t\tconst args = {\n\t\t\tpost: postId,\n\t\t\tcontent: comment,\n\t\t\tcomment_type: 'block_comment',\n\t\t\tcomment_approved: 0,\n\t\t};\n\n\t\t// Create a new object, conditionally including the parent property\n\t\tconst updatedArgs = {\n\t\t\t...args,\n\t\t\t...( parentCommentId ? { parent: parentCommentId } : {} ),\n\t\t};\n\n\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t'root',\n\t\t\t'comment',\n\t\t\tupdatedArgs\n\t\t);\n\n\t\tif ( savedRecord ) {\n\t\t\t// If it's a main comment, update the block attributes with the comment id.\n\t\t\tif ( ! parentCommentId ) {\n\t\t\t\tupdateBlockAttributes( getSelectedBlockClientId(), {\n\t\t\t\t\tblockCommentId: savedRecord?.id,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tcreateNotice(\n\t\t\t\t'snackbar',\n\t\t\t\tparentCommentId\n\t\t\t\t\t? // translators: Reply added successfully\n\t\t\t\t\t __( 'Reply added successfully.' )\n\t\t\t\t\t: // translators: Comment added successfully\n\t\t\t\t\t __( 'Comment added successfully.' ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tisDismissible: true,\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\tonError();\n\t\t}\n\t};\n\n\tconst onCommentResolve = async ( commentId ) => {\n\t\tconst savedRecord = await saveEntityRecord( 'root', 'comment', {\n\t\t\tid: commentId,\n\t\t\tstatus: 'approved',\n\t\t} );\n\n\t\tif ( savedRecord ) {\n\t\t\t// translators: Comment resolved successfully\n\t\t\tcreateNotice( 'snackbar', __( 'Comment marked as resolved.' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tisDismissible: true,\n\t\t\t} );\n\t\t} else {\n\t\t\tonError();\n\t\t}\n\t};\n\n\tconst onEditComment = async ( commentId, comment ) => {\n\t\tconst savedRecord = await saveEntityRecord( 'root', 'comment', {\n\t\t\tid: commentId,\n\t\t\tcontent: comment,\n\t\t} );\n\n\t\tif ( savedRecord ) {\n\t\t\tcreateNotice(\n\t\t\t\t'snackbar',\n\t\t\t\t// translators: Comment edited successfully\n\t\t\t\t__( 'Comment edited successfully.' ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tisDismissible: true,\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\tonError();\n\t\t}\n\t};\n\n\tconst onError = () => {\n\t\tcreateNotice(\n\t\t\t'error',\n\t\t\t// translators: Error message when comment submission fails\n\t\t\t__(\n\t\t\t\t'Something went wrong. Please try publishing the post, or you may have already submitted your comment earlier.'\n\t\t\t),\n\t\t\t{\n\t\t\t\tisDismissible: true,\n\t\t\t}\n\t\t);\n\t};\n\n\tconst onCommentDelete = async ( commentId ) => {\n\t\tconst childComment = await getEntityRecord(\n\t\t\t'root',\n\t\t\t'comment',\n\t\t\tcommentId\n\t\t);\n\t\tawait deleteEntityRecord( 'root', 'comment', commentId );\n\n\t\tif ( childComment && ! childComment.parent ) {\n\t\t\tupdateBlockAttributes( getSelectedBlockClientId(), {\n\t\t\t\tblockCommentId: undefined,\n\t\t\t} );\n\t\t}\n\n\t\tcreateNotice(\n\t\t\t'snackbar',\n\t\t\t// translators: Comment deleted successfully\n\t\t\t__( 'Comment deleted successfully.' ),\n\t\t\t{\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tisDismissible: true,\n\t\t\t}\n\t\t);\n\t};\n\n\treturn (\n\t\t<div className=\"editor-collab-sidebar-panel\" style={ styles }>\n\t\t\t<AddComment\n\t\t\t\tonSubmit={ addNewComment }\n\t\t\t\tshowCommentBoard={ showCommentBoard }\n\t\t\t\tsetShowCommentBoard={ setShowCommentBoard }\n\t\t\t/>\n\t\t\t<Comments\n\t\t\t\tkey={ getSelectedBlockClientId() }\n\t\t\t\tthreads={ comments }\n\t\t\t\tonEditComment={ onEditComment }\n\t\t\t\tonAddReply={ addNewComment }\n\t\t\t\tonCommentDelete={ onCommentDelete }\n\t\t\t\tonCommentResolve={ onCommentResolve }\n\t\t\t\tshowCommentBoard={ showCommentBoard }\n\t\t\t\tsetShowCommentBoard={ setShowCommentBoard }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\n/**\n * Renders the Collab sidebar.\n */\nexport default function CollabSidebar() {\n\tconst [ showCommentBoard, setShowCommentBoard ] = useState( false );\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst { getActiveComplementaryArea } = useSelect( interfaceStore );\n\n\tconst { postId, postType, postStatus, threads } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostId, getCurrentPostType } = select( editorStore );\n\t\tconst _postId = getCurrentPostId();\n\t\tconst data =\n\t\t\t!! _postId && typeof _postId === 'number'\n\t\t\t\t? select( coreStore ).getEntityRecords( 'root', 'comment', {\n\t\t\t\t\t\tpost: _postId,\n\t\t\t\t\t\ttype: 'block_comment',\n\t\t\t\t\t\tstatus: 'any',\n\t\t\t\t\t\tper_page: 100,\n\t\t\t\t } )\n\t\t\t\t: null;\n\t\treturn {\n\t\t\tpostId: _postId,\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tpostStatus:\n\t\t\t\tselect( editorStore ).getEditedPostAttribute( 'status' ),\n\t\t\tthreads: data,\n\t\t};\n\t}, [] );\n\n\tconst { blockCommentId } = useSelect( ( select ) => {\n\t\tconst { getBlockAttributes, getSelectedBlockClientId } =\n\t\t\tselect( blockEditorStore );\n\t\tconst _clientId = getSelectedBlockClientId();\n\n\t\treturn {\n\t\t\tblockCommentId: _clientId\n\t\t\t\t? getBlockAttributes( _clientId )?.blockCommentId\n\t\t\t\t: null,\n\t\t};\n\t}, [] );\n\n\tconst openCollabBoard = () => {\n\t\tsetShowCommentBoard( true );\n\t\tenableComplementaryArea( 'core', 'edit-post/collab-sidebar' );\n\t};\n\n\tconst [ blocks ] = useEntityBlockEditor( 'postType', postType, {\n\t\tid: postId,\n\t} );\n\n\t// Process comments to build the tree structure\n\tconst { resultComments, sortedThreads } = useMemo( () => {\n\t\t// Create a compare to store the references to all objects by id\n\t\tconst compare = {};\n\t\tconst result = [];\n\n\t\tconst filteredComments = ( threads ?? [] ).filter(\n\t\t\t( comment ) => comment.status !== 'trash'\n\t\t);\n\n\t\t// Initialize each object with an empty `reply` array\n\t\tfilteredComments.forEach( ( item ) => {\n\t\t\tcompare[ item.id ] = { ...item, reply: [] };\n\t\t} );\n\n\t\t// Iterate over the data to build the tree structure\n\t\tfilteredComments.forEach( ( item ) => {\n\t\t\tif ( item.parent === 0 ) {\n\t\t\t\t// If parent is 0, it's a root item, push it to the result array\n\t\t\t\tresult.push( compare[ item.id ] );\n\t\t\t} else if ( compare[ item.parent ] ) {\n\t\t\t\t// Otherwise, find its parent and push it to the parent's `reply` array\n\t\t\t\tcompare[ item.parent ].reply.push( compare[ item.id ] );\n\t\t\t}\n\t\t} );\n\n\t\tif ( 0 === result?.length ) {\n\t\t\treturn { resultComments: [], sortedThreads: [] };\n\t\t}\n\n\t\tconst updatedResult = result.map( ( item ) => ( {\n\t\t\t...item,\n\t\t\treply: [ ...item.reply ].reverse(),\n\t\t} ) );\n\n\t\tconst blockCommentIds = getCommentIdsFromBlocks( blocks );\n\n\t\tconst threadIdMap = new Map(\n\t\t\tupdatedResult.map( ( thread ) => [ thread.id, thread ] )\n\t\t);\n\n\t\tconst sortedComments = blockCommentIds\n\t\t\t.map( ( id ) => threadIdMap.get( id ) )\n\t\t\t.filter( ( thread ) => thread !== undefined );\n\n\t\treturn { resultComments: updatedResult, sortedThreads: sortedComments };\n\t}, [ threads, blocks ] );\n\n\t// Get the global styles to set the background color of the sidebar.\n\tconst { merged: GlobalStyles } = useGlobalStylesContext();\n\tconst backgroundColor = GlobalStyles?.styles?.color?.background;\n\n\tif ( 0 < resultComments.length ) {\n\t\tconst unsubscribe = subscribe( () => {\n\t\t\tconst activeSidebar = getActiveComplementaryArea( 'core' );\n\n\t\t\tif ( ! activeSidebar ) {\n\t\t\t\tenableComplementaryArea( 'core', collabSidebarName );\n\t\t\t\tunsubscribe();\n\t\t\t}\n\t\t} );\n\t}\n\n\tif ( postStatus === 'publish' ) {\n\t\treturn null; // or maybe return some message indicating no threads are available.\n\t}\n\n\tconst AddCommentComponent = blockCommentId\n\t\t? AddCommentToolbarButton\n\t\t: AddCommentButton;\n\n\treturn (\n\t\t<>\n\t\t\t<AddCommentComponent onClick={ openCollabBoard } />\n\t\t\t<PluginSidebar\n\t\t\t\tidentifier={ collabHistorySidebarName }\n\t\t\t\t// translators: Comments sidebar title\n\t\t\t\ttitle={ __( 'Comments' ) }\n\t\t\t\ticon={ commentIcon }\n\t\t\t>\n\t\t\t\t<CollabSidebarContent\n\t\t\t\t\tcomments={ resultComments }\n\t\t\t\t\tshowCommentBoard={ showCommentBoard }\n\t\t\t\t\tsetShowCommentBoard={ setShowCommentBoard }\n\t\t\t\t/>\n\t\t\t</PluginSidebar>\n\t\t\t<PluginSidebar\n\t\t\t\tisPinnable={ false }\n\t\t\t\theader={ false }\n\t\t\t\tidentifier={ collabSidebarName }\n\t\t\t\tclassName=\"editor-collab-sidebar\"\n\t\t\t\theaderClassName=\"editor-collab-sidebar__header\"\n\t\t\t>\n\t\t\t\t<CollabSidebarContent\n\t\t\t\t\tcomments={ sortedThreads }\n\t\t\t\t\tshowCommentBoard={ showCommentBoard }\n\t\t\t\t\tsetShowCommentBoard={ setShowCommentBoard }\n\t\t\t\t\tstyles={ {\n\t\t\t\t\t\tbackgroundColor,\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t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B,OAAO,IAAI,CAAC,CAAC;EACd;EAEA,MAAM2C,mBAAmB,GAAG1G,cAAc,GACvC2G,6BAAuB,GACvBC,sBAAgB;EAEnB,oBACC,IAAAhH,WAAA,CAAAmD,IAAA,EAAAnD,WAAA,CAAAiH,QAAA;IAAA3D,QAAA,gBACC,IAAAtD,WAAA,CAAAuD,GAAA,EAACuD,mBAAmB;MAACI,OAAO,EAAGvC;IAAiB,CAAE,CAAC,eACnD,IAAA3E,WAAA,CAAAuD,GAAA,EAACjE,cAAA,CAAA6H,OAAa;MACbC,UAAU,EAAGC;MACb;MAAA;MACAC,KAAK,EAAG,IAAA7E,QAAE,EAAE,UAAW,CAAG;MAC1B8E,IAAI,EAAGC,cAAa;MAAAlE,QAAA,eAEpB,IAAAtD,WAAA,CAAAuD,GAAA,EAAChD,oBAAoB;QACpBI,QAAQ,EAAGmE,cAAgB;QAC3BtE,gBAAgB,EAAGA,gBAAkB;QACrCC,mBAAmB,EAAGA;MAAqB,CAC3C;IAAC,CACY,CAAC,eAChB,IAAAT,WAAA,CAAAuD,GAAA,EAACjE,cAAA,CAAA6H,OAAa;MACbM,UAAU,EAAG,KAAO;MACpBC,MAAM,EAAG,KAAO;MAChBN,UAAU,EAAGP,4BAAmB;MAChCzD,SAAS,EAAC,uBAAuB;MACjCuE,eAAe,EAAC,+BAA+B;MAAArE,QAAA,eAE/C,IAAAtD,WAAA,CAAAuD,GAAA,EAAChD,oBAAoB;QACpBI,QAAQ,EAAGoE,aAAe;QAC1BvE,gBAAgB,EAAGA,gBAAkB;QACrCC,mBAAmB,EAAGA,mBAAqB;QAC3CC,MAAM,EAAG;UACR6F;QACD;MAAG,CACH;IAAC,CACY,CAAC;EAAA,CACf,CAAC;AAEL","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_data","_element","_icons","_hooks","_notices","_coreData","_blockEditor","_interface","_pluginSidebar","_interopRequireDefault","_constants","_comments","_addComment","_store","_commentButton","_commentButtonToolbar","_globalStylesProvider","_utils","_jsxRuntime","modifyBlockCommentAttributes","settings","attributes","blockCommentId","type","addFilter","CollabSidebarContent","showCommentBoard","setShowCommentBoard","styles","comments","createNotice","useDispatch","noticesStore","saveEntityRecord","deleteEntityRecord","coreStore","getEntityRecord","resolveSelect","postId","useSelect","select","getCurrentPostId","editorStore","_postId","getSelectedBlockClientId","blockEditorStore","updateBlockAttributes","addNewComment","comment","parentCommentId","args","post","content","comment_type","comment_approved","updatedArgs","parent","savedRecord","id","__","isDismissible","onError","onCommentResolve","commentId","status","onEditComment","onCommentDelete","childComment","undefined","jsxs","className","style","children","jsx","AddComment","onSubmit","Comments","threads","onAddReply","CollabSidebar","useState","enableComplementaryArea","interfaceStore","getActiveComplementaryArea","postType","postStatus","getCurrentPostType","data","getEntityRecords","per_page","getEditedPostAttribute","getBlockAttributes","_clientId","openCollabBoard","blocks","useEntityBlockEditor","resultComments","sortedThreads","useMemo","compare","result","filteredComments","filter","forEach","item","reply","push","length","updatedResult","map","reverse","blockCommentIds","getCommentIdsFromBlocks","threadIdMap","Map","thread","sortedComments","get","merged","GlobalStyles","useGlobalStylesContext","backgroundColor","color","background","unsubscribe","subscribe","activeSidebar","collabSidebarName","AddCommentComponent","AddCommentToolbarButton","AddCommentButton","Fragment","onClick","default","identifier","collabHistorySidebarName","title","icon","commentIcon","isPinnable","header","headerClassName"],"sources":["@wordpress/editor/src/components/collab-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseSelect,\n\tuseDispatch,\n\tresolveSelect,\n\tsubscribe,\n} from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { comment as commentIcon } from '@wordpress/icons';\nimport { addFilter } from '@wordpress/hooks';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore, useEntityBlockEditor } from '@wordpress/core-data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport PluginSidebar from '../plugin-sidebar';\nimport { collabHistorySidebarName, collabSidebarName } from './constants';\nimport { Comments } from './comments';\nimport { AddComment } from './add-comment';\nimport { store as editorStore } from '../../store';\nimport AddCommentButton from './comment-button';\nimport AddCommentToolbarButton from './comment-button-toolbar';\nimport { useGlobalStylesContext } from '../global-styles-provider';\nimport { getCommentIdsFromBlocks } from './utils';\n\nconst modifyBlockCommentAttributes = ( settings ) => {\n\tif ( ! settings.attributes.blockCommentId ) {\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tblockCommentId: {\n\t\t\t\ttype: 'number',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n};\n\n// Apply the filter to all core blocks\naddFilter(\n\t'blocks.registerBlockType',\n\t'block-comment/modify-core-block-attributes',\n\tmodifyBlockCommentAttributes\n);\n\nfunction CollabSidebarContent( {\n\tshowCommentBoard,\n\tsetShowCommentBoard,\n\tstyles,\n\tcomments,\n} ) {\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst { saveEntityRecord, deleteEntityRecord } = useDispatch( coreStore );\n\tconst { getEntityRecord } = resolveSelect( coreStore );\n\n\tconst { postId } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostId } = select( editorStore );\n\t\tconst _postId = getCurrentPostId();\n\n\t\treturn {\n\t\t\tpostId: _postId,\n\t\t};\n\t}, [] );\n\n\tconst { getSelectedBlockClientId } = useSelect( blockEditorStore );\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\t// Function to save the comment.\n\tconst addNewComment = async ( comment, parentCommentId ) => {\n\t\tconst args = {\n\t\t\tpost: postId,\n\t\t\tcontent: comment,\n\t\t\tcomment_type: 'block_comment',\n\t\t\tcomment_approved: 0,\n\t\t};\n\n\t\t// Create a new object, conditionally including the parent property\n\t\tconst updatedArgs = {\n\t\t\t...args,\n\t\t\t...( parentCommentId ? { parent: parentCommentId } : {} ),\n\t\t};\n\n\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t'root',\n\t\t\t'comment',\n\t\t\tupdatedArgs\n\t\t);\n\n\t\tif ( savedRecord ) {\n\t\t\t// If it's a main comment, update the block attributes with the comment id.\n\t\t\tif ( ! parentCommentId ) {\n\t\t\t\tupdateBlockAttributes( getSelectedBlockClientId(), {\n\t\t\t\t\tblockCommentId: savedRecord?.id,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tcreateNotice(\n\t\t\t\t'snackbar',\n\t\t\t\tparentCommentId\n\t\t\t\t\t? // translators: Reply added successfully\n\t\t\t\t\t __( 'Reply added successfully.' )\n\t\t\t\t\t: // translators: Comment added successfully\n\t\t\t\t\t __( 'Comment added successfully.' ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tisDismissible: true,\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\tonError();\n\t\t}\n\t};\n\n\tconst onCommentResolve = async ( commentId ) => {\n\t\tconst savedRecord = await saveEntityRecord( 'root', 'comment', {\n\t\t\tid: commentId,\n\t\t\tstatus: 'approved',\n\t\t} );\n\n\t\tif ( savedRecord ) {\n\t\t\t// translators: Comment resolved successfully\n\t\t\tcreateNotice( 'snackbar', __( 'Comment marked as resolved.' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tisDismissible: true,\n\t\t\t} );\n\t\t} else {\n\t\t\tonError();\n\t\t}\n\t};\n\n\tconst onEditComment = async ( commentId, comment ) => {\n\t\tconst savedRecord = await saveEntityRecord( 'root', 'comment', {\n\t\t\tid: commentId,\n\t\t\tcontent: comment,\n\t\t} );\n\n\t\tif ( savedRecord ) {\n\t\t\tcreateNotice(\n\t\t\t\t'snackbar',\n\t\t\t\t// translators: Comment edited successfully\n\t\t\t\t__( 'Comment edited successfully.' ),\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tisDismissible: true,\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\tonError();\n\t\t}\n\t};\n\n\tconst onError = () => {\n\t\tcreateNotice(\n\t\t\t'error',\n\t\t\t// translators: Error message when comment submission fails\n\t\t\t__(\n\t\t\t\t'Something went wrong. Please try publishing the post, or you may have already submitted your comment earlier.'\n\t\t\t),\n\t\t\t{\n\t\t\t\tisDismissible: true,\n\t\t\t}\n\t\t);\n\t};\n\n\tconst onCommentDelete = async ( commentId ) => {\n\t\tconst childComment = await getEntityRecord(\n\t\t\t'root',\n\t\t\t'comment',\n\t\t\tcommentId\n\t\t);\n\t\tawait deleteEntityRecord( 'root', 'comment', commentId );\n\n\t\tif ( childComment && ! childComment.parent ) {\n\t\t\tupdateBlockAttributes( getSelectedBlockClientId(), {\n\t\t\t\tblockCommentId: undefined,\n\t\t\t} );\n\t\t}\n\n\t\tcreateNotice(\n\t\t\t'snackbar',\n\t\t\t// translators: Comment deleted successfully\n\t\t\t__( 'Comment deleted successfully.' ),\n\t\t\t{\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tisDismissible: true,\n\t\t\t}\n\t\t);\n\t};\n\n\treturn (\n\t\t<div className=\"editor-collab-sidebar-panel\" style={ styles }>\n\t\t\t<AddComment\n\t\t\t\tonSubmit={ addNewComment }\n\t\t\t\tshowCommentBoard={ showCommentBoard }\n\t\t\t\tsetShowCommentBoard={ setShowCommentBoard }\n\t\t\t/>\n\t\t\t<Comments\n\t\t\t\tkey={ getSelectedBlockClientId() }\n\t\t\t\tthreads={ comments }\n\t\t\t\tonEditComment={ onEditComment }\n\t\t\t\tonAddReply={ addNewComment }\n\t\t\t\tonCommentDelete={ onCommentDelete }\n\t\t\t\tonCommentResolve={ onCommentResolve }\n\t\t\t\tshowCommentBoard={ showCommentBoard }\n\t\t\t\tsetShowCommentBoard={ setShowCommentBoard }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\n/**\n * Renders the Collab sidebar.\n */\nexport default function CollabSidebar() {\n\tconst [ showCommentBoard, setShowCommentBoard ] = useState( false );\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst { getActiveComplementaryArea } = useSelect( interfaceStore );\n\n\tconst { postId, postType, postStatus, threads } = useSelect( ( select ) => {\n\t\tconst { getCurrentPostId, getCurrentPostType } = select( editorStore );\n\t\tconst _postId = getCurrentPostId();\n\t\tconst data =\n\t\t\t!! _postId && typeof _postId === 'number'\n\t\t\t\t? select( coreStore ).getEntityRecords( 'root', 'comment', {\n\t\t\t\t\t\tpost: _postId,\n\t\t\t\t\t\ttype: 'block_comment',\n\t\t\t\t\t\tstatus: 'any',\n\t\t\t\t\t\tper_page: 100,\n\t\t\t\t } )\n\t\t\t\t: null;\n\t\treturn {\n\t\t\tpostId: _postId,\n\t\t\tpostType: getCurrentPostType(),\n\t\t\tpostStatus:\n\t\t\t\tselect( editorStore ).getEditedPostAttribute( 'status' ),\n\t\t\tthreads: data,\n\t\t};\n\t}, [] );\n\n\tconst { blockCommentId } = useSelect( ( select ) => {\n\t\tconst { getBlockAttributes, getSelectedBlockClientId } =\n\t\t\tselect( blockEditorStore );\n\t\tconst _clientId = getSelectedBlockClientId();\n\n\t\treturn {\n\t\t\tblockCommentId: _clientId\n\t\t\t\t? getBlockAttributes( _clientId )?.blockCommentId\n\t\t\t\t: null,\n\t\t};\n\t}, [] );\n\n\tconst openCollabBoard = () => {\n\t\tsetShowCommentBoard( true );\n\t\tenableComplementaryArea( 'core', 'edit-post/collab-sidebar' );\n\t};\n\n\tconst [ blocks ] = useEntityBlockEditor( 'postType', postType, {\n\t\tid: postId,\n\t} );\n\n\t// Process comments to build the tree structure\n\tconst { resultComments, sortedThreads } = useMemo( () => {\n\t\t// Create a compare to store the references to all objects by id\n\t\tconst compare = {};\n\t\tconst result = [];\n\n\t\tconst filteredComments = ( threads ?? [] ).filter(\n\t\t\t( comment ) => comment.status !== 'trash'\n\t\t);\n\n\t\t// Initialize each object with an empty `reply` array\n\t\tfilteredComments.forEach( ( item ) => {\n\t\t\tcompare[ item.id ] = { ...item, reply: [] };\n\t\t} );\n\n\t\t// Iterate over the data to build the tree structure\n\t\tfilteredComments.forEach( ( item ) => {\n\t\t\tif ( item.parent === 0 ) {\n\t\t\t\t// If parent is 0, it's a root item, push it to the result array\n\t\t\t\tresult.push( compare[ item.id ] );\n\t\t\t} else if ( compare[ item.parent ] ) {\n\t\t\t\t// Otherwise, find its parent and push it to the parent's `reply` array\n\t\t\t\tcompare[ item.parent ].reply.push( compare[ item.id ] );\n\t\t\t}\n\t\t} );\n\n\t\tif ( 0 === result?.length ) {\n\t\t\treturn { resultComments: [], sortedThreads: [] };\n\t\t}\n\n\t\tconst updatedResult = result.map( ( item ) => ( {\n\t\t\t...item,\n\t\t\treply: [ ...item.reply ].reverse(),\n\t\t} ) );\n\n\t\tconst blockCommentIds = getCommentIdsFromBlocks( blocks );\n\n\t\tconst threadIdMap = new Map(\n\t\t\tupdatedResult.map( ( thread ) => [ thread.id, thread ] )\n\t\t);\n\n\t\tconst sortedComments = blockCommentIds\n\t\t\t.map( ( id ) => threadIdMap.get( id ) )\n\t\t\t.filter( ( thread ) => thread !== undefined );\n\n\t\treturn { resultComments: updatedResult, sortedThreads: sortedComments };\n\t}, [ threads, blocks ] );\n\n\t// Get the global styles to set the background color of the sidebar.\n\tconst { merged: GlobalStyles } = useGlobalStylesContext();\n\tconst backgroundColor = GlobalStyles?.styles?.color?.background;\n\n\tif ( 0 < resultComments.length ) {\n\t\tconst unsubscribe = subscribe( () => {\n\t\t\tconst activeSidebar = getActiveComplementaryArea( 'core' );\n\n\t\t\tif ( ! activeSidebar ) {\n\t\t\t\tenableComplementaryArea( 'core', collabSidebarName );\n\t\t\t\tunsubscribe();\n\t\t\t}\n\t\t} );\n\t}\n\n\tif ( postStatus === 'publish' ) {\n\t\treturn null; // or maybe return some message indicating no threads are available.\n\t}\n\n\tconst AddCommentComponent = blockCommentId\n\t\t? AddCommentToolbarButton\n\t\t: AddCommentButton;\n\n\treturn (\n\t\t<>\n\t\t\t<AddCommentComponent onClick={ openCollabBoard } />\n\t\t\t<PluginSidebar\n\t\t\t\tidentifier={ collabHistorySidebarName }\n\t\t\t\t// translators: Comments sidebar title\n\t\t\t\ttitle={ __( 'Comments' ) }\n\t\t\t\ticon={ commentIcon }\n\t\t\t>\n\t\t\t\t<CollabSidebarContent\n\t\t\t\t\tcomments={ resultComments }\n\t\t\t\t\tshowCommentBoard={ showCommentBoard }\n\t\t\t\t\tsetShowCommentBoard={ setShowCommentBoard }\n\t\t\t\t/>\n\t\t\t</PluginSidebar>\n\t\t\t<PluginSidebar\n\t\t\t\tisPinnable={ false }\n\t\t\t\theader={ false }\n\t\t\t\tidentifier={ collabSidebarName }\n\t\t\t\tclassName=\"editor-collab-sidebar\"\n\t\t\t\theaderClassName=\"editor-collab-sidebar__header\"\n\t\t\t>\n\t\t\t\t<CollabSidebarContent\n\t\t\t\t\tcomments={ sortedThreads }\n\t\t\t\t\tshowCommentBoard={ showCommentBoard }\n\t\t\t\t\tsetShowCommentBoard={ setShowCommentBoard }\n\t\t\t\t\tstyles={ {\n\t\t\t\t\t\tbackgroundColor,\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</PluginSidebar>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AAKA,IAAAS,cAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,UAAA,GAAAX,OAAA;AACA,IAAAY,SAAA,GAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AACA,IAAAe,cAAA,GAAAL,sBAAA,CAAAV,OAAA;AACA,IAAAgB,qBAAA,GAA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CC,mBAAmB,EAAGA;MAAqB,CAC3C;IAAC,CACY,CAAC,eAChB,IAAAT,WAAA,CAAAuD,GAAA,EAACjE,cAAA,CAAA6H,OAAa;MACbM,UAAU,EAAG,KAAO;MACpBC,MAAM,EAAG,KAAO;MAChBN,UAAU,EAAGP,4BAAmB;MAChCzD,SAAS,EAAC,uBAAuB;MACjCuE,eAAe,EAAC,+BAA+B;MAAArE,QAAA,eAE/C,IAAAtD,WAAA,CAAAuD,GAAA,EAAChD,oBAAoB;QACpBI,QAAQ,EAAGoE,aAAe;QAC1BvE,gBAAgB,EAAGA,gBAAkB;QACrCC,mBAAmB,EAAGA,mBAAqB;QAC3CC,MAAM,EAAG;UACR6F;QACD;MAAG,CACH;IAAC,CACY,CAAC;EAAA,CACf,CAAC;AAEL","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"names":["sanitizeCommentString","str","trim","getCommentIdsFromBlocks","blocks","extractCommentIds","items","reduce","commentIds","block","attributes","blockCommentId","includes","push","innerBlocks","length","innerCommentIds"],"sources":["@wordpress/editor/src/components/collab-sidebar/utils.js"],"sourcesContent":["/**\n * Sanitizes a comment string by removing non-printable ASCII characters.\n *\n * @param {string} str - The comment string to sanitize.\n * @return {string} - The sanitized comment string.\n */\nexport function sanitizeCommentString( str ) {\n\treturn str.trim();\n}\n\n/**\n * Extracts comment IDs from an array of blocks.\n *\n * This function recursively traverses the blocks and their inner blocks to\n * collect all comment IDs found in the block attributes.\n *\n * @param {Array} blocks - The array of blocks to extract comment IDs from.\n * @return {Array} An array of comment IDs extracted from the blocks.\n */\nexport function getCommentIdsFromBlocks( blocks ) {\n\t// Recursive function to extract comment IDs from blocks\n\tconst extractCommentIds = ( items ) => {\n\t\treturn items.reduce( ( commentIds, block ) => {\n\t\t\t// Check for comment IDs in the current block's attributes\n\t\t\tif (\n\t\t\t\tblock.attributes &&\n\t\t\t\tblock.attributes.blockCommentId &&\n\t\t\t\t! commentIds.includes( block.attributes.blockCommentId )\n\t\t\t) {\n\t\t\t\tcommentIds.push( block.attributes.blockCommentId );\n\t\t\t}\n\n\t\t\t// Recursively check inner blocks\n\t\t\tif ( block.innerBlocks && block.innerBlocks.length > 0 ) {\n\t\t\t\tconst innerCommentIds = extractCommentIds( block.innerBlocks );\n\t\t\t\tcommentIds.push( ...innerCommentIds );\n\t\t\t}\n\n\t\t\treturn commentIds;\n\t\t}, [] );\n\t};\n\n\t// Extract all comment IDs recursively\n\treturn extractCommentIds( blocks );\n}\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,qBAAqBA,CAAEC,GAAG,EAAG;EAC5C,OAAOA,GAAG,CAACC,IAAI,CAAC,CAAC;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,uBAAuBA,CAAEC,MAAM,EAAG;EACjD;EACA,MAAMC,iBAAiB,GAAKC,KAAK,IAAM;IACtC,OAAOA,KAAK,CAACC,MAAM,CAAE,CAAEC,UAAU,EAAEC,KAAK,KAAM;MAC7C;MACA,IACCA,KAAK,CAACC,UAAU,IAChBD,KAAK,CAACC,UAAU,CAACC,cAAc,IAC/B,CAAEH,UAAU,CAACI,QAAQ,CAAEH,KAAK,CAACC,UAAU,CAACC,cAAe,CAAC,EACvD;QACDH,UAAU,CAACK,IAAI,CAAEJ,KAAK,CAACC,UAAU,CAACC,cAAe,CAAC;MACnD;;MAEA;MACA,IAAKF,KAAK,CAACK,WAAW,IAAIL,KAAK,CAACK,WAAW,CAACC,MAAM,GAAG,CAAC,EAAG;QACxD,MAAMC,eAAe,GAAGX,iBAAiB,CAAEI,KAAK,CAACK,WAAY,CAAC;QAC9DN,UAAU,CAACK,IAAI,CAAE,GAAGG,eAAgB,CAAC;MACtC;MAEA,OAAOR,UAAU;IAClB,CAAC,EAAE,EAAG,CAAC;EACR,CAAC;;EAED;EACA,OAAOH,iBAAiB,CAAED,MAAO,CAAC;AACnC","ignoreList":[]}
1
+ {"version":3,"names":["sanitizeCommentString","str","trim","getCommentIdsFromBlocks","blocks","extractCommentIds","items","reduce","commentIds","block","attributes","blockCommentId","includes","push","innerBlocks","length","innerCommentIds"],"sources":["@wordpress/editor/src/components/collab-sidebar/utils.js"],"sourcesContent":["/**\n * Sanitizes a comment string by removing non-printable ASCII characters.\n *\n * @param {string} str - The comment string to sanitize.\n * @return {string} - The sanitized comment string.\n */\nexport function sanitizeCommentString( str ) {\n\treturn str.trim();\n}\n\n/**\n * Extracts comment IDs from an array of blocks.\n *\n * This function recursively traverses the blocks and their inner blocks to\n * collect all comment IDs found in the block attributes.\n *\n * @param {Array} blocks - The array of blocks to extract comment IDs from.\n * @return {Array} An array of comment IDs extracted from the blocks.\n */\nexport function getCommentIdsFromBlocks( blocks ) {\n\t// Recursive function to extract comment IDs from blocks\n\tconst extractCommentIds = ( items ) => {\n\t\treturn items.reduce( ( commentIds, block ) => {\n\t\t\t// Check for comment IDs in the current block's attributes\n\t\t\tif (\n\t\t\t\tblock.attributes &&\n\t\t\t\tblock.attributes.blockCommentId &&\n\t\t\t\t! commentIds.includes( block.attributes.blockCommentId )\n\t\t\t) {\n\t\t\t\tcommentIds.push( block.attributes.blockCommentId );\n\t\t\t}\n\n\t\t\t// Recursively check inner blocks\n\t\t\tif ( block.innerBlocks && block.innerBlocks.length > 0 ) {\n\t\t\t\tconst innerCommentIds = extractCommentIds( block.innerBlocks );\n\t\t\t\tcommentIds.push( ...innerCommentIds );\n\t\t\t}\n\n\t\t\treturn commentIds;\n\t\t}, [] );\n\t};\n\n\t// Extract all comment IDs recursively\n\treturn extractCommentIds( blocks );\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,qBAAqBA,CAAEC,GAAG,EAAG;EAC5C,OAAOA,GAAG,CAACC,IAAI,CAAC,CAAC;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,uBAAuBA,CAAEC,MAAM,EAAG;EACjD;EACA,MAAMC,iBAAiB,GAAKC,KAAK,IAAM;IACtC,OAAOA,KAAK,CAACC,MAAM,CAAE,CAAEC,UAAU,EAAEC,KAAK,KAAM;MAC7C;MACA,IACCA,KAAK,CAACC,UAAU,IAChBD,KAAK,CAACC,UAAU,CAACC,cAAc,IAC/B,CAAEH,UAAU,CAACI,QAAQ,CAAEH,KAAK,CAACC,UAAU,CAACC,cAAe,CAAC,EACvD;QACDH,UAAU,CAACK,IAAI,CAAEJ,KAAK,CAACC,UAAU,CAACC,cAAe,CAAC;MACnD;;MAEA;MACA,IAAKF,KAAK,CAACK,WAAW,IAAIL,KAAK,CAACK,WAAW,CAACC,MAAM,GAAG,CAAC,EAAG;QACxD,MAAMC,eAAe,GAAGX,iBAAiB,CAAEI,KAAK,CAACK,WAAY,CAAC;QAC9DN,UAAU,CAACK,IAAI,CAAE,GAAGG,eAAgB,CAAC;MACtC;MAEA,OAAOR,UAAU;IAClB,CAAC,EAAE,EAAG,CAAC;EACR,CAAC;;EAED;EACA,OAAOH,iBAAiB,CAAED,MAAO,CAAC;AACnC","ignoreList":[]}
@@ -1,4 +1,3 @@
1
- /* wp:polyfill */
2
1
  "use strict";
3
2
 
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");