@wordpress/block-library 10.1.0 → 10.2.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 (926) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/build/accordion/block.json +1 -0
  3. package/build/accordion/edit.cjs +0 -1
  4. package/build/accordion/edit.cjs.map +2 -2
  5. package/build/accordion/view.cjs +23 -0
  6. package/build/accordion/view.cjs.map +2 -2
  7. package/build/accordion-heading/deprecated.cjs +121 -1
  8. package/build/accordion-heading/deprecated.cjs.map +2 -2
  9. package/build/accordion-heading/edit.cjs +18 -1
  10. package/build/accordion-heading/edit.cjs.map +3 -3
  11. package/build/accordion-heading/save.cjs +18 -1
  12. package/build/accordion-heading/save.cjs.map +3 -3
  13. package/build/accordion-panel/edit.cjs +1 -1
  14. package/build/accordion-panel/edit.cjs.map +2 -2
  15. package/build/archives/edit.cjs +0 -1
  16. package/build/archives/edit.cjs.map +2 -2
  17. package/build/audio/edit.cjs +0 -1
  18. package/build/audio/edit.cjs.map +2 -2
  19. package/build/avatar/edit.cjs +0 -1
  20. package/build/avatar/edit.cjs.map +2 -2
  21. package/build/avatar/user-control.cjs +0 -1
  22. package/build/avatar/user-control.cjs.map +2 -2
  23. package/build/button/edit.cjs +18 -8
  24. package/build/button/edit.cjs.map +2 -2
  25. package/build/categories/edit.cjs +0 -1
  26. package/build/categories/edit.cjs.map +2 -2
  27. package/build/code/transforms.cjs +5 -3
  28. package/build/code/transforms.cjs.map +2 -2
  29. package/build/column/edit.cjs +0 -1
  30. package/build/column/edit.cjs.map +2 -2
  31. package/build/columns/edit.cjs +0 -1
  32. package/build/columns/edit.cjs.map +2 -2
  33. package/build/columns/transforms.cjs +9 -2
  34. package/build/columns/transforms.cjs.map +2 -2
  35. package/build/comment-author-avatar/edit.cjs +0 -1
  36. package/build/comment-author-avatar/edit.cjs.map +2 -2
  37. package/build/comments-pagination/comments-pagination-arrow-controls.cjs +0 -1
  38. package/build/comments-pagination/comments-pagination-arrow-controls.cjs.map +2 -2
  39. package/build/cover/block.json +11 -0
  40. package/build/cover/edit/block-controls.cjs +11 -4
  41. package/build/cover/edit/block-controls.cjs.map +2 -2
  42. package/build/cover/edit/embed-video-url-input.cjs +5 -3
  43. package/build/cover/edit/embed-video-url-input.cjs.map +3 -3
  44. package/build/cover/edit/index.cjs +1 -1
  45. package/build/cover/edit/index.cjs.map +2 -2
  46. package/build/cover/edit/inspector-controls.cjs +1 -3
  47. package/build/cover/edit/inspector-controls.cjs.map +2 -2
  48. package/build/cover/embed-video-utils.cjs +17 -7
  49. package/build/cover/embed-video-utils.cjs.map +2 -2
  50. package/build/details/transforms.cjs +1 -1
  51. package/build/details/transforms.cjs.map +2 -2
  52. package/build/embed/edit.cjs +2 -3
  53. package/build/embed/edit.cjs.map +2 -2
  54. package/build/embed/embed-placeholder.cjs +20 -21
  55. package/build/embed/embed-placeholder.cjs.map +3 -3
  56. package/build/file/edit.cjs +4 -3
  57. package/build/file/edit.cjs.map +2 -2
  58. package/build/file/inspector.cjs +0 -2
  59. package/build/file/inspector.cjs.map +2 -2
  60. package/build/file/transforms.cjs +25 -60
  61. package/build/file/transforms.cjs.map +2 -2
  62. package/build/form/edit.cjs +0 -2
  63. package/build/form/edit.cjs.map +2 -2
  64. package/build/freeform/convert-to-blocks-button.cjs +52 -0
  65. package/build/freeform/convert-to-blocks-button.cjs.map +7 -0
  66. package/build/freeform/edit.cjs +14 -33
  67. package/build/freeform/edit.cjs.map +3 -3
  68. package/build/freeform/index.cjs +1 -7
  69. package/build/freeform/index.cjs.map +3 -3
  70. package/build/gallery/block.json +8 -3
  71. package/build/gallery/dynamic-gallery.cjs +263 -0
  72. package/build/gallery/dynamic-gallery.cjs.map +7 -0
  73. package/build/gallery/dynamic-source.cjs +85 -0
  74. package/build/gallery/dynamic-source.cjs.map +7 -0
  75. package/build/gallery/edit.cjs +286 -206
  76. package/build/gallery/edit.cjs.map +3 -3
  77. package/build/gallery/gallery.cjs +0 -3
  78. package/build/gallery/gallery.cjs.map +2 -2
  79. package/build/gallery/gap-styles.cjs +49 -13
  80. package/build/gallery/gap-styles.cjs.map +3 -3
  81. package/build/gallery/index.cjs +2 -0
  82. package/build/gallery/index.cjs.map +3 -3
  83. package/build/gallery/save.cjs +16 -12
  84. package/build/gallery/save.cjs.map +2 -2
  85. package/build/gallery/use-dynamic-gallery.cjs +181 -0
  86. package/build/gallery/use-dynamic-gallery.cjs.map +7 -0
  87. package/build/gallery/variations.cjs +54 -0
  88. package/build/gallery/variations.cjs.map +7 -0
  89. package/build/group/edit.cjs +1 -2
  90. package/build/group/edit.cjs.map +2 -2
  91. package/build/group/transforms.cjs +3 -7
  92. package/build/group/transforms.cjs.map +2 -2
  93. package/build/heading/edit.cjs +10 -3
  94. package/build/heading/edit.cjs.map +2 -2
  95. package/build/html/block.json +2 -2
  96. package/build/html/edit.cjs +65 -23
  97. package/build/html/edit.cjs.map +3 -3
  98. package/build/html/index.cjs +3 -3
  99. package/build/html/index.cjs.map +2 -2
  100. package/build/html/modal.cjs +4 -8
  101. package/build/html/modal.cjs.map +2 -2
  102. package/build/html/save.cjs +2 -4
  103. package/build/html/save.cjs.map +2 -2
  104. package/build/html/transforms.cjs +7 -5
  105. package/build/html/transforms.cjs.map +2 -2
  106. package/build/icon/components/custom-inserter/icon-grid.cjs +25 -12
  107. package/build/icon/components/custom-inserter/icon-grid.cjs.map +2 -2
  108. package/build/icon/components/custom-inserter/index.cjs +100 -31
  109. package/build/icon/components/custom-inserter/index.cjs.map +3 -3
  110. package/build/icon/edit.cjs +11 -12
  111. package/build/icon/edit.cjs.map +2 -2
  112. package/build/image/block.json +1 -1
  113. package/build/image/image.cjs +23 -70
  114. package/build/image/image.cjs.map +3 -3
  115. package/build/image/transforms.cjs +78 -0
  116. package/build/image/transforms.cjs.map +3 -3
  117. package/build/index.cjs +18 -8
  118. package/build/index.cjs.map +2 -2
  119. package/build/latest-comments/edit.cjs +0 -2
  120. package/build/latest-comments/edit.cjs.map +2 -2
  121. package/build/latest-posts/block.json +8 -9
  122. package/build/latest-posts/constants.cjs +0 -3
  123. package/build/latest-posts/constants.cjs.map +2 -2
  124. package/build/latest-posts/deprecated.cjs +100 -8
  125. package/build/latest-posts/deprecated.cjs.map +2 -2
  126. package/build/latest-posts/edit.cjs +67 -84
  127. package/build/latest-posts/edit.cjs.map +2 -2
  128. package/build/list/ordered-list-settings.cjs +0 -1
  129. package/build/list/ordered-list-settings.cjs.map +2 -2
  130. package/build/list-item/edit.cjs +1 -1
  131. package/build/list-item/edit.cjs.map +2 -2
  132. package/build/list-item/hooks/use-enter.cjs +14 -17
  133. package/build/list-item/hooks/use-enter.cjs.map +3 -3
  134. package/build/list-item/hooks/use-space.cjs +3 -2
  135. package/build/list-item/hooks/use-space.cjs.map +3 -3
  136. package/build/media-text/edit.cjs +0 -1
  137. package/build/media-text/edit.cjs.map +2 -2
  138. package/build/missing/edit.cjs +1 -3
  139. package/build/missing/edit.cjs.map +2 -2
  140. package/build/navigation/edit/index.cjs +0 -1
  141. package/build/navigation/edit/index.cjs.map +2 -2
  142. package/build/navigation/edit/overlay-menu-preview-controls.cjs +0 -1
  143. package/build/navigation/edit/overlay-menu-preview-controls.cjs.map +2 -2
  144. package/build/navigation/edit/overlay-menu-preview.cjs +0 -1
  145. package/build/navigation/edit/overlay-menu-preview.cjs.map +2 -2
  146. package/build/navigation/edit/overlay-template-part-selector.cjs +0 -1
  147. package/build/navigation/edit/overlay-template-part-selector.cjs.map +2 -2
  148. package/build/navigation/edit/overlay-visibility-control.cjs +0 -1
  149. package/build/navigation/edit/overlay-visibility-control.cjs.map +2 -2
  150. package/build/navigation-link/shared/use-link-preview.cjs +11 -1
  151. package/build/navigation-link/shared/use-link-preview.cjs.map +2 -2
  152. package/build/navigation-overlay-close/edit.cjs +0 -1
  153. package/build/navigation-overlay-close/edit.cjs.map +2 -2
  154. package/build/page-list/edit.cjs +0 -1
  155. package/build/page-list/edit.cjs.map +2 -2
  156. package/build/paragraph/block.json +1 -0
  157. package/build/paragraph/use-enter.cjs +3 -7
  158. package/build/paragraph/use-enter.cjs.map +3 -3
  159. package/build/playlist/block.json +28 -15
  160. package/build/playlist/context.cjs +36 -0
  161. package/build/playlist/context.cjs.map +7 -0
  162. package/build/playlist/edit.cjs +257 -81
  163. package/build/playlist/edit.cjs.map +3 -3
  164. package/build/playlist/index.cjs +1 -1
  165. package/build/playlist/index.cjs.map +2 -2
  166. package/build/playlist/utils.cjs +19 -8
  167. package/build/playlist/utils.cjs.map +3 -3
  168. package/build/playlist/view.cjs +87 -17
  169. package/build/playlist/view.cjs.map +2 -2
  170. package/build/playlist-track/block.json +4 -5
  171. package/build/playlist-track/edit.cjs +114 -70
  172. package/build/playlist-track/edit.cjs.map +3 -3
  173. package/build/post-author/edit.cjs +0 -2
  174. package/build/post-author/edit.cjs.map +2 -2
  175. package/build/post-content/block.json +1 -0
  176. package/build/post-excerpt/edit.cjs +0 -1
  177. package/build/post-excerpt/edit.cjs.map +2 -2
  178. package/build/post-featured-image/overlay-controls.cjs +1 -2
  179. package/build/post-featured-image/overlay-controls.cjs.map +2 -2
  180. package/build/post-navigation-link/edit.cjs +0 -2
  181. package/build/post-navigation-link/edit.cjs.map +2 -2
  182. package/build/post-template/block.json +2 -1
  183. package/build/post-template/edit.cjs +10 -1
  184. package/build/post-template/edit.cjs.map +2 -2
  185. package/build/pullquote/block.json +3 -1
  186. package/build/query/block.json +3 -2
  187. package/build/query/edit/inspector-controls/author-control.cjs +1 -2
  188. package/build/query/edit/inspector-controls/author-control.cjs.map +2 -2
  189. package/build/query/edit/inspector-controls/format-controls.cjs +1 -2
  190. package/build/query/edit/inspector-controls/format-controls.cjs.map +2 -2
  191. package/build/query/edit/inspector-controls/index.cjs +38 -7
  192. package/build/query/edit/inspector-controls/index.cjs.map +2 -2
  193. package/build/query/edit/inspector-controls/offset-controls.cjs +0 -1
  194. package/build/query/edit/inspector-controls/offset-controls.cjs.map +2 -2
  195. package/build/query/edit/inspector-controls/order-control.cjs +0 -1
  196. package/build/query/edit/inspector-controls/order-control.cjs.map +2 -2
  197. package/build/query/edit/inspector-controls/pages-control.cjs +0 -1
  198. package/build/query/edit/inspector-controls/pages-control.cjs.map +2 -2
  199. package/build/query/edit/inspector-controls/parent-control.cjs +0 -1
  200. package/build/query/edit/inspector-controls/parent-control.cjs.map +2 -2
  201. package/build/query/edit/inspector-controls/per-page-control.cjs +0 -1
  202. package/build/query/edit/inspector-controls/per-page-control.cjs.map +2 -2
  203. package/build/query/edit/inspector-controls/sticky-control.cjs +0 -1
  204. package/build/query/edit/inspector-controls/sticky-control.cjs.map +2 -2
  205. package/build/query/edit/inspector-controls/taxonomy-controls.cjs +1 -2
  206. package/build/query/edit/inspector-controls/taxonomy-controls.cjs.map +2 -2
  207. package/build/query/edit/query-content.cjs +10 -3
  208. package/build/query/edit/query-content.cjs.map +2 -2
  209. package/build/query/index.cjs +2 -1
  210. package/build/query/index.cjs.map +2 -2
  211. package/build/query-pagination/query-pagination-arrow-controls.cjs +0 -1
  212. package/build/query-pagination/query-pagination-arrow-controls.cjs.map +2 -2
  213. package/build/query-pagination-numbers/edit.cjs +0 -1
  214. package/build/query-pagination-numbers/edit.cjs.map +2 -2
  215. package/build/quote/block.json +3 -1
  216. package/build/quote/transforms.cjs +1 -7
  217. package/build/quote/transforms.cjs.map +2 -2
  218. package/build/rss/edit.cjs +0 -4
  219. package/build/rss/edit.cjs.map +2 -2
  220. package/build/search/edit.cjs +0 -4
  221. package/build/search/edit.cjs.map +2 -2
  222. package/build/separator/edit.cjs +1 -2
  223. package/build/separator/edit.cjs.map +2 -2
  224. package/build/site-logo/edit.cjs +34 -63
  225. package/build/site-logo/edit.cjs.map +3 -3
  226. package/build/social-links/edit.cjs +0 -1
  227. package/build/social-links/edit.cjs.map +2 -2
  228. package/build/spacer/controls.cjs +2 -4
  229. package/build/spacer/controls.cjs.map +2 -2
  230. package/build/spacer/edit.cjs +1 -2
  231. package/build/spacer/edit.cjs.map +2 -2
  232. package/build/tab-list/block.json +5 -4
  233. package/build/tab-list/edit.cjs +95 -54
  234. package/build/tab-list/edit.cjs.map +3 -3
  235. package/build/tab-list/save.cjs +4 -3
  236. package/build/tab-list/save.cjs.map +2 -2
  237. package/build/tab-panel/block.json +1 -6
  238. package/build/tab-panel/controls.cjs +2 -4
  239. package/build/tab-panel/controls.cjs.map +3 -3
  240. package/build/tab-panel/edit.cjs +15 -15
  241. package/build/tab-panel/edit.cjs.map +2 -2
  242. package/build/tab-panels/block.json +0 -1
  243. package/build/tab-panels/edit.cjs +2 -4
  244. package/build/tab-panels/edit.cjs.map +3 -3
  245. package/build/table-of-contents/edit.cjs +0 -1
  246. package/build/table-of-contents/edit.cjs.map +2 -2
  247. package/build/tabs/block.json +0 -5
  248. package/build/tabs/edit.cjs +6 -41
  249. package/build/tabs/edit.cjs.map +3 -3
  250. package/build/tabs/tab-toolbar-controls.cjs +74 -0
  251. package/build/tabs/tab-toolbar-controls.cjs.map +7 -0
  252. package/build/tabs/use-tab-actions.cjs +87 -0
  253. package/build/tabs/use-tab-actions.cjs.map +7 -0
  254. package/build/tabs/use-tab-list-items-sync.cjs +23 -5
  255. package/build/tabs/use-tab-list-items-sync.cjs.map +2 -2
  256. package/build/tag-cloud/edit.cjs +2 -6
  257. package/build/tag-cloud/edit.cjs.map +2 -2
  258. package/build/template-part/edit/advanced-controls.cjs +0 -1
  259. package/build/template-part/edit/advanced-controls.cjs.map +2 -2
  260. package/build/template-part/edit/import-controls.cjs +1 -2
  261. package/build/template-part/edit/import-controls.cjs.map +2 -2
  262. package/build/term-name/block.json +1 -3
  263. package/build/term-name/deprecated.cjs +105 -0
  264. package/build/term-name/deprecated.cjs.map +7 -0
  265. package/build/term-name/edit.cjs +11 -37
  266. package/build/term-name/edit.cjs.map +3 -3
  267. package/build/term-name/index.cjs +3 -1
  268. package/build/term-name/index.cjs.map +3 -3
  269. package/build/terms-query/edit/inspector-controls/include-control.cjs +0 -1
  270. package/build/terms-query/edit/inspector-controls/include-control.cjs.map +2 -2
  271. package/build/terms-query/edit/inspector-controls/inherit-control.cjs +0 -1
  272. package/build/terms-query/edit/inspector-controls/inherit-control.cjs.map +2 -2
  273. package/build/terms-query/edit/inspector-controls/max-terms-control.cjs +0 -1
  274. package/build/terms-query/edit/inspector-controls/max-terms-control.cjs.map +2 -2
  275. package/build/terms-query/edit/inspector-controls/order-control.cjs +0 -1
  276. package/build/terms-query/edit/inspector-controls/order-control.cjs.map +2 -2
  277. package/build/terms-query/edit/inspector-controls/taxonomy-control.cjs +0 -1
  278. package/build/terms-query/edit/inspector-controls/taxonomy-control.cjs.map +2 -2
  279. package/build/text-columns/edit.cjs +0 -1
  280. package/build/text-columns/edit.cjs.map +2 -2
  281. package/build/utils/waveform-player.cjs +138 -22
  282. package/build/utils/waveform-player.cjs.map +2 -2
  283. package/build/utils/waveform-utils.cjs +315 -17
  284. package/build/utils/waveform-utils.cjs.map +2 -2
  285. package/build/verse/block.json +3 -1
  286. package/build/video/block.json +6 -0
  287. package/build/video/edit-common-settings.cjs +0 -1
  288. package/build/video/edit-common-settings.cjs.map +2 -2
  289. package/build/video/edit.cjs +17 -1
  290. package/build/video/edit.cjs.map +2 -2
  291. package/build/video/index.cjs +2 -0
  292. package/build/video/index.cjs.map +3 -3
  293. package/build/video/save.cjs +7 -1
  294. package/build/video/save.cjs.map +2 -2
  295. package/build/video/tracks-editor.cjs +0 -1
  296. package/build/video/tracks-editor.cjs.map +2 -2
  297. package/build/video/variations.cjs +75 -0
  298. package/build/video/variations.cjs.map +7 -0
  299. package/build-module/accordion/block.json +1 -0
  300. package/build-module/accordion/edit.mjs +0 -1
  301. package/build-module/accordion/edit.mjs.map +2 -2
  302. package/build-module/accordion/view.mjs +23 -0
  303. package/build-module/accordion/view.mjs.map +2 -2
  304. package/build-module/accordion-heading/deprecated.mjs +121 -1
  305. package/build-module/accordion-heading/deprecated.mjs.map +2 -2
  306. package/build-module/accordion-heading/edit.mjs +8 -1
  307. package/build-module/accordion-heading/edit.mjs.map +2 -2
  308. package/build-module/accordion-heading/save.mjs +8 -1
  309. package/build-module/accordion-heading/save.mjs.map +2 -2
  310. package/build-module/accordion-panel/edit.mjs +1 -1
  311. package/build-module/accordion-panel/edit.mjs.map +2 -2
  312. package/build-module/archives/edit.mjs +0 -1
  313. package/build-module/archives/edit.mjs.map +2 -2
  314. package/build-module/audio/edit.mjs +0 -1
  315. package/build-module/audio/edit.mjs.map +2 -2
  316. package/build-module/avatar/edit.mjs +0 -1
  317. package/build-module/avatar/edit.mjs.map +2 -2
  318. package/build-module/avatar/user-control.mjs +0 -1
  319. package/build-module/avatar/user-control.mjs.map +2 -2
  320. package/build-module/button/edit.mjs +19 -14
  321. package/build-module/button/edit.mjs.map +2 -2
  322. package/build-module/categories/edit.mjs +0 -1
  323. package/build-module/categories/edit.mjs.map +2 -2
  324. package/build-module/code/transforms.mjs +6 -4
  325. package/build-module/code/transforms.mjs.map +2 -2
  326. package/build-module/column/edit.mjs +0 -1
  327. package/build-module/column/edit.mjs.map +2 -2
  328. package/build-module/columns/edit.mjs +0 -1
  329. package/build-module/columns/edit.mjs.map +2 -2
  330. package/build-module/columns/transforms.mjs +9 -2
  331. package/build-module/columns/transforms.mjs.map +2 -2
  332. package/build-module/comment-author-avatar/edit.mjs +0 -1
  333. package/build-module/comment-author-avatar/edit.mjs.map +2 -2
  334. package/build-module/comments-pagination/comments-pagination-arrow-controls.mjs +0 -1
  335. package/build-module/comments-pagination/comments-pagination-arrow-controls.mjs.map +2 -2
  336. package/build-module/cover/block.json +11 -0
  337. package/build-module/cover/edit/block-controls.mjs +11 -4
  338. package/build-module/cover/edit/block-controls.mjs.map +2 -2
  339. package/build-module/cover/edit/embed-video-url-input.mjs +5 -4
  340. package/build-module/cover/edit/embed-video-url-input.mjs.map +2 -2
  341. package/build-module/cover/edit/index.mjs +1 -1
  342. package/build-module/cover/edit/index.mjs.map +2 -2
  343. package/build-module/cover/edit/inspector-controls.mjs +1 -3
  344. package/build-module/cover/edit/inspector-controls.mjs.map +2 -2
  345. package/build-module/cover/embed-video-utils.mjs +16 -7
  346. package/build-module/cover/embed-video-utils.mjs.map +2 -2
  347. package/build-module/details/transforms.mjs +2 -2
  348. package/build-module/details/transforms.mjs.map +2 -2
  349. package/build-module/embed/edit.mjs +2 -3
  350. package/build-module/embed/edit.mjs.map +2 -2
  351. package/build-module/embed/embed-placeholder.mjs +20 -24
  352. package/build-module/embed/embed-placeholder.mjs.map +2 -2
  353. package/build-module/file/edit.mjs +4 -3
  354. package/build-module/file/edit.mjs.map +2 -2
  355. package/build-module/file/inspector.mjs +0 -2
  356. package/build-module/file/inspector.mjs.map +2 -2
  357. package/build-module/file/transforms.mjs +25 -60
  358. package/build-module/file/transforms.mjs.map +2 -2
  359. package/build-module/form/edit.mjs +0 -2
  360. package/build-module/form/edit.mjs.map +2 -2
  361. package/build-module/freeform/convert-to-blocks-button.mjs +31 -0
  362. package/build-module/freeform/convert-to-blocks-button.mjs.map +7 -0
  363. package/build-module/freeform/edit.mjs +15 -34
  364. package/build-module/freeform/edit.mjs.map +2 -2
  365. package/build-module/freeform/index.mjs +1 -7
  366. package/build-module/freeform/index.mjs.map +2 -2
  367. package/build-module/gallery/block.json +8 -3
  368. package/build-module/gallery/dynamic-gallery.mjs +253 -0
  369. package/build-module/gallery/dynamic-gallery.mjs.map +7 -0
  370. package/build-module/gallery/dynamic-source.mjs +55 -0
  371. package/build-module/gallery/dynamic-source.mjs.map +7 -0
  372. package/build-module/gallery/edit.mjs +291 -209
  373. package/build-module/gallery/edit.mjs.map +2 -2
  374. package/build-module/gallery/gallery.mjs +0 -3
  375. package/build-module/gallery/gallery.mjs.map +2 -2
  376. package/build-module/gallery/gap-styles.mjs +53 -14
  377. package/build-module/gallery/gap-styles.mjs.map +2 -2
  378. package/build-module/gallery/index.mjs +2 -0
  379. package/build-module/gallery/index.mjs.map +2 -2
  380. package/build-module/gallery/save.mjs +16 -12
  381. package/build-module/gallery/save.mjs.map +2 -2
  382. package/build-module/gallery/use-dynamic-gallery.mjs +167 -0
  383. package/build-module/gallery/use-dynamic-gallery.mjs.map +7 -0
  384. package/build-module/gallery/variations.mjs +33 -0
  385. package/build-module/gallery/variations.mjs.map +7 -0
  386. package/build-module/group/edit.mjs +1 -2
  387. package/build-module/group/edit.mjs.map +2 -2
  388. package/build-module/group/transforms.mjs +4 -8
  389. package/build-module/group/transforms.mjs.map +2 -2
  390. package/build-module/heading/edit.mjs +11 -4
  391. package/build-module/heading/edit.mjs.map +2 -2
  392. package/build-module/html/block.json +2 -2
  393. package/build-module/html/edit.mjs +69 -25
  394. package/build-module/html/edit.mjs.map +2 -2
  395. package/build-module/html/index.mjs +3 -3
  396. package/build-module/html/index.mjs.map +2 -2
  397. package/build-module/html/modal.mjs +4 -8
  398. package/build-module/html/modal.mjs.map +2 -2
  399. package/build-module/html/save.mjs +2 -4
  400. package/build-module/html/save.mjs.map +2 -2
  401. package/build-module/html/transforms.mjs +8 -6
  402. package/build-module/html/transforms.mjs.map +2 -2
  403. package/build-module/icon/components/custom-inserter/icon-grid.mjs +25 -12
  404. package/build-module/icon/components/custom-inserter/icon-grid.mjs.map +2 -2
  405. package/build-module/icon/components/custom-inserter/index.mjs +102 -33
  406. package/build-module/icon/components/custom-inserter/index.mjs.map +2 -2
  407. package/build-module/icon/edit.mjs +11 -12
  408. package/build-module/icon/edit.mjs.map +2 -2
  409. package/build-module/image/block.json +1 -1
  410. package/build-module/image/image.mjs +23 -71
  411. package/build-module/image/image.mjs.map +2 -2
  412. package/build-module/image/transforms.mjs +78 -0
  413. package/build-module/image/transforms.mjs.map +2 -2
  414. package/build-module/index.mjs +18 -8
  415. package/build-module/index.mjs.map +2 -2
  416. package/build-module/latest-comments/edit.mjs +0 -2
  417. package/build-module/latest-comments/edit.mjs.map +2 -2
  418. package/build-module/latest-posts/block.json +8 -9
  419. package/build-module/latest-posts/constants.mjs +0 -2
  420. package/build-module/latest-posts/constants.mjs.map +2 -2
  421. package/build-module/latest-posts/deprecated.mjs +100 -8
  422. package/build-module/latest-posts/deprecated.mjs.map +2 -2
  423. package/build-module/latest-posts/edit.mjs +67 -85
  424. package/build-module/latest-posts/edit.mjs.map +2 -2
  425. package/build-module/list/ordered-list-settings.mjs +0 -1
  426. package/build-module/list/ordered-list-settings.mjs.map +2 -2
  427. package/build-module/list-item/edit.mjs +1 -1
  428. package/build-module/list-item/edit.mjs.map +2 -2
  429. package/build-module/list-item/hooks/use-enter.mjs +15 -21
  430. package/build-module/list-item/hooks/use-enter.mjs.map +2 -2
  431. package/build-module/list-item/hooks/use-space.mjs +4 -6
  432. package/build-module/list-item/hooks/use-space.mjs.map +2 -2
  433. package/build-module/media-text/edit.mjs +0 -1
  434. package/build-module/media-text/edit.mjs.map +2 -2
  435. package/build-module/missing/edit.mjs +1 -3
  436. package/build-module/missing/edit.mjs.map +2 -2
  437. package/build-module/navigation/edit/index.mjs +0 -1
  438. package/build-module/navigation/edit/index.mjs.map +2 -2
  439. package/build-module/navigation/edit/overlay-menu-preview-controls.mjs +0 -1
  440. package/build-module/navigation/edit/overlay-menu-preview-controls.mjs.map +2 -2
  441. package/build-module/navigation/edit/overlay-menu-preview.mjs +0 -1
  442. package/build-module/navigation/edit/overlay-menu-preview.mjs.map +2 -2
  443. package/build-module/navigation/edit/overlay-template-part-selector.mjs +0 -1
  444. package/build-module/navigation/edit/overlay-template-part-selector.mjs.map +2 -2
  445. package/build-module/navigation/edit/overlay-visibility-control.mjs +0 -1
  446. package/build-module/navigation/edit/overlay-visibility-control.mjs.map +2 -2
  447. package/build-module/navigation-link/shared/use-link-preview.mjs +11 -1
  448. package/build-module/navigation-link/shared/use-link-preview.mjs.map +2 -2
  449. package/build-module/navigation-overlay-close/edit.mjs +0 -1
  450. package/build-module/navigation-overlay-close/edit.mjs.map +2 -2
  451. package/build-module/page-list/edit.mjs +0 -1
  452. package/build-module/page-list/edit.mjs.map +2 -2
  453. package/build-module/paragraph/block.json +1 -0
  454. package/build-module/paragraph/use-enter.mjs +4 -11
  455. package/build-module/paragraph/use-enter.mjs.map +2 -2
  456. package/build-module/playlist/block.json +28 -15
  457. package/build-module/playlist/context.mjs +11 -0
  458. package/build-module/playlist/context.mjs.map +7 -0
  459. package/build-module/playlist/edit.mjs +262 -84
  460. package/build-module/playlist/edit.mjs.map +2 -2
  461. package/build-module/playlist/index.mjs +1 -1
  462. package/build-module/playlist/index.mjs.map +2 -2
  463. package/build-module/playlist/utils.mjs +17 -7
  464. package/build-module/playlist/utils.mjs.map +2 -2
  465. package/build-module/playlist/view.mjs +93 -18
  466. package/build-module/playlist/view.mjs.map +2 -2
  467. package/build-module/playlist-track/block.json +4 -5
  468. package/build-module/playlist-track/edit.mjs +117 -72
  469. package/build-module/playlist-track/edit.mjs.map +2 -2
  470. package/build-module/post-author/edit.mjs +0 -2
  471. package/build-module/post-author/edit.mjs.map +2 -2
  472. package/build-module/post-content/block.json +1 -0
  473. package/build-module/post-excerpt/edit.mjs +0 -1
  474. package/build-module/post-excerpt/edit.mjs.map +2 -2
  475. package/build-module/post-featured-image/overlay-controls.mjs +1 -2
  476. package/build-module/post-featured-image/overlay-controls.mjs.map +2 -2
  477. package/build-module/post-navigation-link/edit.mjs +0 -2
  478. package/build-module/post-navigation-link/edit.mjs.map +2 -2
  479. package/build-module/post-template/block.json +2 -1
  480. package/build-module/post-template/edit.mjs +10 -1
  481. package/build-module/post-template/edit.mjs.map +2 -2
  482. package/build-module/pullquote/block.json +3 -1
  483. package/build-module/query/block.json +3 -2
  484. package/build-module/query/edit/inspector-controls/author-control.mjs +1 -2
  485. package/build-module/query/edit/inspector-controls/author-control.mjs.map +2 -2
  486. package/build-module/query/edit/inspector-controls/format-controls.mjs +1 -2
  487. package/build-module/query/edit/inspector-controls/format-controls.mjs.map +2 -2
  488. package/build-module/query/edit/inspector-controls/index.mjs +40 -8
  489. package/build-module/query/edit/inspector-controls/index.mjs.map +2 -2
  490. package/build-module/query/edit/inspector-controls/offset-controls.mjs +0 -1
  491. package/build-module/query/edit/inspector-controls/offset-controls.mjs.map +2 -2
  492. package/build-module/query/edit/inspector-controls/order-control.mjs +0 -1
  493. package/build-module/query/edit/inspector-controls/order-control.mjs.map +2 -2
  494. package/build-module/query/edit/inspector-controls/pages-control.mjs +0 -1
  495. package/build-module/query/edit/inspector-controls/pages-control.mjs.map +2 -2
  496. package/build-module/query/edit/inspector-controls/parent-control.mjs +0 -1
  497. package/build-module/query/edit/inspector-controls/parent-control.mjs.map +2 -2
  498. package/build-module/query/edit/inspector-controls/per-page-control.mjs +0 -1
  499. package/build-module/query/edit/inspector-controls/per-page-control.mjs.map +2 -2
  500. package/build-module/query/edit/inspector-controls/sticky-control.mjs +0 -1
  501. package/build-module/query/edit/inspector-controls/sticky-control.mjs.map +2 -2
  502. package/build-module/query/edit/inspector-controls/taxonomy-controls.mjs +1 -2
  503. package/build-module/query/edit/inspector-controls/taxonomy-controls.mjs.map +2 -2
  504. package/build-module/query/edit/query-content.mjs +10 -3
  505. package/build-module/query/edit/query-content.mjs.map +2 -2
  506. package/build-module/query/index.mjs +2 -1
  507. package/build-module/query/index.mjs.map +2 -2
  508. package/build-module/query-pagination/query-pagination-arrow-controls.mjs +0 -1
  509. package/build-module/query-pagination/query-pagination-arrow-controls.mjs.map +2 -2
  510. package/build-module/query-pagination-numbers/edit.mjs +0 -1
  511. package/build-module/query-pagination-numbers/edit.mjs.map +2 -2
  512. package/build-module/quote/block.json +3 -1
  513. package/build-module/quote/transforms.mjs +6 -8
  514. package/build-module/quote/transforms.mjs.map +2 -2
  515. package/build-module/rss/edit.mjs +0 -4
  516. package/build-module/rss/edit.mjs.map +2 -2
  517. package/build-module/search/edit.mjs +0 -4
  518. package/build-module/search/edit.mjs.map +2 -2
  519. package/build-module/separator/edit.mjs +1 -2
  520. package/build-module/separator/edit.mjs.map +2 -2
  521. package/build-module/site-logo/edit.mjs +34 -64
  522. package/build-module/site-logo/edit.mjs.map +2 -2
  523. package/build-module/social-links/edit.mjs +0 -1
  524. package/build-module/social-links/edit.mjs.map +2 -2
  525. package/build-module/spacer/controls.mjs +2 -4
  526. package/build-module/spacer/controls.mjs.map +2 -2
  527. package/build-module/spacer/edit.mjs +1 -2
  528. package/build-module/spacer/edit.mjs.map +2 -2
  529. package/build-module/tab-list/block.json +5 -4
  530. package/build-module/tab-list/edit.mjs +102 -56
  531. package/build-module/tab-list/edit.mjs.map +2 -2
  532. package/build-module/tab-list/save.mjs +5 -3
  533. package/build-module/tab-list/save.mjs.map +2 -2
  534. package/build-module/tab-panel/block.json +1 -6
  535. package/build-module/tab-panel/controls.mjs +2 -4
  536. package/build-module/tab-panel/controls.mjs.map +2 -2
  537. package/build-module/tab-panel/edit.mjs +16 -16
  538. package/build-module/tab-panel/edit.mjs.map +2 -2
  539. package/build-module/tab-panels/block.json +0 -1
  540. package/build-module/tab-panels/edit.mjs +2 -4
  541. package/build-module/tab-panels/edit.mjs.map +2 -2
  542. package/build-module/table-of-contents/edit.mjs +0 -1
  543. package/build-module/table-of-contents/edit.mjs.map +2 -2
  544. package/build-module/tabs/block.json +0 -5
  545. package/build-module/tabs/edit.mjs +7 -47
  546. package/build-module/tabs/edit.mjs.map +2 -2
  547. package/build-module/tabs/tab-toolbar-controls.mjs +46 -0
  548. package/build-module/tabs/tab-toolbar-controls.mjs.map +7 -0
  549. package/build-module/tabs/use-tab-actions.mjs +66 -0
  550. package/build-module/tabs/use-tab-actions.mjs.map +7 -0
  551. package/build-module/tabs/use-tab-list-items-sync.mjs +25 -7
  552. package/build-module/tabs/use-tab-list-items-sync.mjs.map +2 -2
  553. package/build-module/tag-cloud/edit.mjs +2 -6
  554. package/build-module/tag-cloud/edit.mjs.map +2 -2
  555. package/build-module/template-part/edit/advanced-controls.mjs +0 -1
  556. package/build-module/template-part/edit/advanced-controls.mjs.map +2 -2
  557. package/build-module/template-part/edit/import-controls.mjs +1 -2
  558. package/build-module/template-part/edit/import-controls.mjs.map +2 -2
  559. package/build-module/term-name/block.json +1 -3
  560. package/build-module/term-name/deprecated.mjs +74 -0
  561. package/build-module/term-name/deprecated.mjs.map +7 -0
  562. package/build-module/term-name/edit.mjs +11 -28
  563. package/build-module/term-name/edit.mjs.map +2 -2
  564. package/build-module/term-name/index.mjs +3 -1
  565. package/build-module/term-name/index.mjs.map +2 -2
  566. package/build-module/terms-query/edit/inspector-controls/include-control.mjs +0 -1
  567. package/build-module/terms-query/edit/inspector-controls/include-control.mjs.map +2 -2
  568. package/build-module/terms-query/edit/inspector-controls/inherit-control.mjs +0 -1
  569. package/build-module/terms-query/edit/inspector-controls/inherit-control.mjs.map +2 -2
  570. package/build-module/terms-query/edit/inspector-controls/max-terms-control.mjs +0 -1
  571. package/build-module/terms-query/edit/inspector-controls/max-terms-control.mjs.map +2 -2
  572. package/build-module/terms-query/edit/inspector-controls/order-control.mjs +0 -1
  573. package/build-module/terms-query/edit/inspector-controls/order-control.mjs.map +2 -2
  574. package/build-module/terms-query/edit/inspector-controls/taxonomy-control.mjs +0 -1
  575. package/build-module/terms-query/edit/inspector-controls/taxonomy-control.mjs.map +2 -2
  576. package/build-module/text-columns/edit.mjs +0 -1
  577. package/build-module/text-columns/edit.mjs.map +2 -2
  578. package/build-module/utils/waveform-player.mjs +144 -23
  579. package/build-module/utils/waveform-player.mjs.map +2 -2
  580. package/build-module/utils/waveform-utils.mjs +310 -16
  581. package/build-module/utils/waveform-utils.mjs.map +2 -2
  582. package/build-module/verse/block.json +3 -1
  583. package/build-module/video/block.json +6 -0
  584. package/build-module/video/edit-common-settings.mjs +0 -1
  585. package/build-module/video/edit-common-settings.mjs.map +2 -2
  586. package/build-module/video/edit.mjs +17 -1
  587. package/build-module/video/edit.mjs.map +2 -2
  588. package/build-module/video/index.mjs +2 -0
  589. package/build-module/video/index.mjs.map +2 -2
  590. package/build-module/video/save.mjs +7 -1
  591. package/build-module/video/save.mjs.map +2 -2
  592. package/build-module/video/tracks-editor.mjs +0 -1
  593. package/build-module/video/tracks-editor.mjs.map +2 -2
  594. package/build-module/video/variations.mjs +50 -0
  595. package/build-module/video/variations.mjs.map +7 -0
  596. package/build-style/accordion-panel/style-rtl.css +1 -2
  597. package/build-style/accordion-panel/style.css +1 -2
  598. package/build-style/audio/style-rtl.css +6 -0
  599. package/build-style/audio/style.css +6 -0
  600. package/build-style/audio/theme-rtl.css +6 -0
  601. package/build-style/audio/theme.css +6 -0
  602. package/build-style/columns/style-rtl.css +6 -0
  603. package/build-style/columns/style.css +6 -0
  604. package/build-style/common-rtl.css +6 -4
  605. package/build-style/common.css +6 -4
  606. package/build-style/editor-rtl.css +84 -24
  607. package/build-style/editor.css +84 -24
  608. package/build-style/embed/style-rtl.css +6 -0
  609. package/build-style/embed/style.css +6 -0
  610. package/build-style/embed/theme-rtl.css +6 -0
  611. package/build-style/embed/theme.css +6 -0
  612. package/build-style/freeform/editor-rtl.css +6 -0
  613. package/build-style/freeform/editor.css +6 -0
  614. package/build-style/gallery/editor-rtl.css +27 -3
  615. package/build-style/gallery/editor.css +27 -3
  616. package/build-style/gallery/style-rtl.css +6 -0
  617. package/build-style/gallery/style.css +6 -0
  618. package/build-style/gallery/theme-rtl.css +6 -0
  619. package/build-style/gallery/theme.css +6 -0
  620. package/build-style/html/editor-rtl.css +13 -0
  621. package/build-style/html/editor.css +13 -0
  622. package/build-style/icon/editor-rtl.css +80 -7
  623. package/build-style/icon/editor.css +80 -7
  624. package/build-style/image/editor-rtl.css +10 -0
  625. package/build-style/image/editor.css +10 -0
  626. package/build-style/image/style-rtl.css +6 -1
  627. package/build-style/image/style.css +6 -1
  628. package/build-style/image/theme-rtl.css +6 -0
  629. package/build-style/image/theme.css +6 -0
  630. package/build-style/latest-posts/style-rtl.css +26 -15
  631. package/build-style/latest-posts/style.css +26 -15
  632. package/build-style/more/editor-rtl.css +2 -2
  633. package/build-style/more/editor.css +2 -2
  634. package/build-style/navigation/editor-rtl.css +9 -4
  635. package/build-style/navigation/editor.css +9 -4
  636. package/build-style/navigation/style-rtl.css +6 -0
  637. package/build-style/navigation/style.css +6 -0
  638. package/build-style/navigation-link/editor-rtl.css +1 -1
  639. package/build-style/navigation-link/editor.css +1 -1
  640. package/build-style/navigation-submenu/editor-rtl.css +6 -0
  641. package/build-style/navigation-submenu/editor.css +6 -0
  642. package/build-style/nextpage/editor-rtl.css +2 -2
  643. package/build-style/nextpage/editor.css +2 -2
  644. package/build-style/page-list/editor-rtl.css +6 -0
  645. package/build-style/page-list/editor.css +6 -0
  646. package/build-style/playlist/editor-rtl.css +6 -0
  647. package/build-style/playlist/editor.css +6 -0
  648. package/build-style/playlist/style-rtl.css +158 -20
  649. package/build-style/playlist/style.css +158 -20
  650. package/build-style/playlist-track/style-rtl.css +10 -0
  651. package/build-style/playlist-track/style.css +10 -0
  652. package/build-style/post-template/style-rtl.css +6 -0
  653. package/build-style/post-template/style.css +6 -0
  654. package/build-style/query/editor-rtl.css +6 -0
  655. package/build-style/query/editor.css +6 -0
  656. package/build-style/rss/style-rtl.css +6 -0
  657. package/build-style/rss/style.css +6 -0
  658. package/build-style/shortcode/editor-rtl.css +6 -0
  659. package/build-style/shortcode/editor.css +6 -0
  660. package/build-style/style-rtl.css +192 -39
  661. package/build-style/style.css +192 -39
  662. package/build-style/table/editor-rtl.css +6 -0
  663. package/build-style/table/editor.css +6 -0
  664. package/build-style/table/theme-rtl.css +6 -0
  665. package/build-style/table/theme.css +6 -0
  666. package/build-style/template-part/editor-rtl.css +6 -0
  667. package/build-style/template-part/editor.css +6 -0
  668. package/build-style/theme-rtl.css +6 -0
  669. package/build-style/theme.css +6 -0
  670. package/build-style/video/editor-rtl.css +1 -1
  671. package/build-style/video/editor.css +1 -1
  672. package/build-style/video/style-rtl.css +6 -0
  673. package/build-style/video/style.css +6 -0
  674. package/build-style/video/theme-rtl.css +6 -0
  675. package/build-style/video/theme.css +6 -0
  676. package/build-types/table-of-contents/list.d.ts +1 -1
  677. package/build-types/table-of-contents/list.d.ts.map +1 -1
  678. package/package.json +48 -44
  679. package/src/accordion/README.md +2 -1
  680. package/src/accordion/block.json +1 -0
  681. package/src/accordion/edit.js +0 -1
  682. package/src/accordion/view.js +24 -0
  683. package/src/accordion-heading/README.md +1 -1
  684. package/src/accordion-heading/deprecated.js +122 -1
  685. package/src/accordion-heading/edit.js +12 -1
  686. package/src/accordion-heading/save.js +12 -1
  687. package/src/accordion-item/README.md +1 -1
  688. package/src/accordion-item/index.php +2 -1
  689. package/src/accordion-panel/edit.js +1 -1
  690. package/src/accordion-panel/style.scss +1 -4
  691. package/src/archives/edit.js +0 -1
  692. package/src/audio/edit.js +0 -1
  693. package/src/avatar/edit.js +0 -1
  694. package/src/avatar/user-control.js +0 -1
  695. package/src/button/edit.js +21 -15
  696. package/src/categories/edit.js +0 -1
  697. package/src/code/transforms.js +6 -4
  698. package/src/column/edit.js +0 -1
  699. package/src/columns/edit.js +0 -1
  700. package/src/columns/transforms.js +9 -2
  701. package/src/comment-author-avatar/edit.js +0 -1
  702. package/src/comments-pagination/comments-pagination-arrow-controls.js +0 -1
  703. package/src/common.scss +0 -4
  704. package/src/cover/README.md +60 -0
  705. package/src/cover/block.json +11 -0
  706. package/src/cover/edit/block-controls.js +21 -11
  707. package/src/cover/edit/embed-video-url-input.js +5 -4
  708. package/src/cover/edit/index.js +9 -11
  709. package/src/cover/edit/inspector-controls.js +0 -2
  710. package/src/cover/embed-video-utils.js +38 -13
  711. package/src/cover/test/edit.js +4 -4
  712. package/src/details/transforms.js +2 -2
  713. package/src/embed/edit.js +4 -5
  714. package/src/embed/embed-placeholder.js +16 -20
  715. package/src/file/edit.js +8 -8
  716. package/src/file/inspector.js +0 -2
  717. package/src/file/transforms.js +28 -60
  718. package/src/form/edit.js +0 -2
  719. package/src/freeform/convert-to-blocks-button.js +33 -0
  720. package/src/freeform/edit.js +11 -21
  721. package/src/freeform/index.js +1 -9
  722. package/src/gallery/README.md +4 -1
  723. package/src/gallery/block.json +8 -3
  724. package/src/gallery/dynamic-gallery.js +384 -0
  725. package/src/gallery/dynamic-source.js +117 -0
  726. package/src/gallery/edit.js +155 -49
  727. package/src/gallery/editor.scss +32 -4
  728. package/src/gallery/gallery.js +0 -7
  729. package/src/gallery/gap-styles.js +79 -20
  730. package/src/gallery/index.js +2 -0
  731. package/src/gallery/index.php +379 -42
  732. package/src/gallery/save.js +22 -11
  733. package/src/gallery/test/dynamic-source.js +90 -0
  734. package/src/gallery/use-dynamic-gallery.js +275 -0
  735. package/src/gallery/variations.js +37 -0
  736. package/src/group/edit.js +2 -3
  737. package/src/group/transforms.js +4 -8
  738. package/src/heading/edit.js +19 -14
  739. package/src/home-link/index.php +1 -1
  740. package/src/html/README.md +2 -1
  741. package/src/html/block.json +2 -2
  742. package/src/html/edit.js +86 -14
  743. package/src/html/editor.scss +10 -0
  744. package/src/html/index.js +3 -4
  745. package/src/html/modal.js +5 -9
  746. package/src/html/save.js +4 -7
  747. package/src/html/test/index.js +143 -0
  748. package/src/html/transforms.js +11 -6
  749. package/src/icon/components/custom-inserter/icon-grid.js +40 -11
  750. package/src/icon/components/custom-inserter/index.js +98 -25
  751. package/src/icon/edit.js +11 -17
  752. package/src/icon/editor.scss +33 -8
  753. package/src/icon/index.php +38 -45
  754. package/src/image/README.md +1 -1
  755. package/src/image/block.json +1 -1
  756. package/src/image/editor.scss +11 -0
  757. package/src/image/image.js +105 -169
  758. package/src/image/style.scss +0 -1
  759. package/src/image/test/use-open-image-media-editor-modal.js +19 -4
  760. package/src/image/transforms.js +128 -0
  761. package/src/index.js +19 -9
  762. package/src/latest-comments/edit.js +0 -2
  763. package/src/latest-posts/README.md +2 -2
  764. package/src/latest-posts/block.json +8 -9
  765. package/src/latest-posts/constants.js +0 -1
  766. package/src/latest-posts/deprecated.js +112 -9
  767. package/src/latest-posts/edit.js +38 -53
  768. package/src/latest-posts/index.php +60 -19
  769. package/src/latest-posts/style.scss +12 -2
  770. package/src/latest-posts/test/deprecated.js +153 -0
  771. package/src/list/ordered-list-settings.js +0 -1
  772. package/src/list-item/edit.js +1 -1
  773. package/src/list-item/hooks/use-enter.js +15 -22
  774. package/src/list-item/hooks/use-space.js +4 -6
  775. package/src/media-text/edit.js +0 -1
  776. package/src/media-text/editor.scss +1 -0
  777. package/src/missing/edit.js +1 -3
  778. package/src/more/editor.scss +1 -1
  779. package/src/navigation/edit/index.js +0 -1
  780. package/src/navigation/edit/overlay-menu-preview-controls.js +0 -1
  781. package/src/navigation/edit/overlay-menu-preview.js +0 -1
  782. package/src/navigation/edit/overlay-template-part-selector.js +0 -1
  783. package/src/navigation/edit/overlay-visibility-control.js +0 -1
  784. package/src/navigation/editor.scss +1 -2
  785. package/src/navigation-link/editor.scss +1 -1
  786. package/src/navigation-link/index.php +6 -3
  787. package/src/navigation-link/shared/test/controls.js +0 -4
  788. package/src/navigation-link/shared/test/use-entity-binding.js +8 -12
  789. package/src/navigation-link/shared/test/use-handle-link-change.test.js +0 -4
  790. package/src/navigation-link/shared/test/use-link-preview.test.js +17 -4
  791. package/src/navigation-link/shared/use-link-preview.js +24 -4
  792. package/src/navigation-overlay-close/edit.js +0 -1
  793. package/src/navigation-submenu/index.php +6 -3
  794. package/src/nextpage/editor.scss +1 -1
  795. package/src/page-list/edit.js +0 -1
  796. package/src/page-list/index.php +1 -1
  797. package/src/paragraph/README.md +1 -0
  798. package/src/paragraph/block.json +1 -0
  799. package/src/paragraph/use-enter.js +4 -11
  800. package/src/playlist/README.md +17 -20
  801. package/src/playlist/block.json +28 -15
  802. package/src/playlist/context.js +9 -0
  803. package/src/playlist/edit.js +298 -97
  804. package/src/playlist/editor.scss +6 -0
  805. package/src/playlist/index.js +1 -1
  806. package/src/playlist/index.php +91 -36
  807. package/src/playlist/style.scss +51 -6
  808. package/src/playlist/test/edit.js +13 -12
  809. package/src/playlist/utils.js +24 -12
  810. package/src/playlist/view.js +101 -20
  811. package/src/playlist-track/README.md +3 -5
  812. package/src/playlist-track/block.json +4 -5
  813. package/src/playlist-track/edit.js +116 -83
  814. package/src/playlist-track/index.php +24 -17
  815. package/src/playlist-track/style.scss +10 -0
  816. package/src/playlist-track/test/edit.js +169 -0
  817. package/src/post-author/edit.js +0 -2
  818. package/src/post-content/README.md +1 -0
  819. package/src/post-content/block.json +1 -0
  820. package/src/post-excerpt/edit.js +0 -1
  821. package/src/post-featured-image/overlay-controls.js +0 -1
  822. package/src/post-navigation-link/edit.js +0 -2
  823. package/src/post-template/README.md +1 -0
  824. package/src/post-template/block.json +2 -1
  825. package/src/post-template/edit.js +9 -0
  826. package/src/pullquote/README.md +1 -0
  827. package/src/pullquote/block.json +3 -1
  828. package/src/query/README.md +2 -1
  829. package/src/query/block.json +3 -2
  830. package/src/query/edit/inspector-controls/author-control.js +0 -1
  831. package/src/query/edit/inspector-controls/format-controls.js +0 -1
  832. package/src/query/edit/inspector-controls/index.js +43 -6
  833. package/src/query/edit/inspector-controls/offset-controls.js +0 -1
  834. package/src/query/edit/inspector-controls/order-control.js +0 -1
  835. package/src/query/edit/inspector-controls/pages-control.js +0 -1
  836. package/src/query/edit/inspector-controls/parent-control.js +0 -1
  837. package/src/query/edit/inspector-controls/per-page-control.js +0 -1
  838. package/src/query/edit/inspector-controls/sticky-control.js +0 -1
  839. package/src/query/edit/inspector-controls/taxonomy-controls.js +0 -1
  840. package/src/query/edit/query-content.js +19 -3
  841. package/src/query/index.js +1 -0
  842. package/src/query-pagination/query-pagination-arrow-controls.js +0 -1
  843. package/src/query-pagination-numbers/edit.js +0 -1
  844. package/src/quote/README.md +1 -0
  845. package/src/quote/block.json +3 -1
  846. package/src/quote/transforms.js +6 -8
  847. package/src/rss/edit.js +0 -4
  848. package/src/rss/index.php +1 -1
  849. package/src/search/edit.js +0 -4
  850. package/src/separator/edit.js +0 -1
  851. package/src/site-logo/edit.js +38 -78
  852. package/src/social-links/edit.js +0 -1
  853. package/src/spacer/controls.js +2 -4
  854. package/src/spacer/edit.js +2 -3
  855. package/src/tab-list/README.md +4 -5
  856. package/src/tab-list/block.json +5 -4
  857. package/src/tab-list/edit.js +133 -73
  858. package/src/tab-list/index.php +9 -4
  859. package/src/tab-list/save.js +5 -4
  860. package/src/tab-panel/README.md +4 -6
  861. package/src/tab-panel/block.json +1 -6
  862. package/src/tab-panel/controls.js +2 -4
  863. package/src/tab-panel/edit.js +19 -24
  864. package/src/tab-panels/README.md +5 -3
  865. package/src/tab-panels/block.json +0 -1
  866. package/src/tab-panels/edit.js +2 -4
  867. package/src/table-of-contents/edit.js +0 -1
  868. package/src/tabs/README.md +18 -9
  869. package/src/tabs/block.json +0 -5
  870. package/src/tabs/edit.js +8 -65
  871. package/src/tabs/tab-toolbar-controls.js +58 -0
  872. package/src/tabs/use-tab-actions.js +102 -0
  873. package/src/tabs/use-tab-list-items-sync.js +31 -12
  874. package/src/tag-cloud/edit.js +0 -4
  875. package/src/tag-cloud/index.php +1 -1
  876. package/src/template-part/edit/advanced-controls.js +0 -1
  877. package/src/template-part/edit/import-controls.js +0 -1
  878. package/src/template-part/index.php +1 -16
  879. package/src/term-name/README.md +1 -1
  880. package/src/term-name/block.json +1 -3
  881. package/src/term-name/deprecated.js +74 -0
  882. package/src/term-name/edit.js +2 -18
  883. package/src/term-name/index.js +2 -0
  884. package/src/terms-query/edit/inspector-controls/include-control.js +0 -1
  885. package/src/terms-query/edit/inspector-controls/inherit-control.js +0 -1
  886. package/src/terms-query/edit/inspector-controls/max-terms-control.js +0 -1
  887. package/src/terms-query/edit/inspector-controls/order-control.js +0 -1
  888. package/src/terms-query/edit/inspector-controls/taxonomy-control.js +0 -1
  889. package/src/text-columns/edit.js +0 -1
  890. package/src/utils/media-control.scss +1 -5
  891. package/src/utils/test/waveform-player.js +297 -38
  892. package/src/utils/test/waveform-utils.js +410 -9
  893. package/src/utils/waveform-player.js +189 -59
  894. package/src/utils/waveform-utils.js +443 -40
  895. package/src/verse/README.md +1 -0
  896. package/src/verse/block.json +3 -1
  897. package/src/video/README.md +2 -0
  898. package/src/video/block.json +6 -0
  899. package/src/video/edit-common-settings.js +0 -1
  900. package/src/video/edit.js +30 -1
  901. package/src/video/editor.scss +1 -1
  902. package/src/video/index.js +2 -0
  903. package/src/video/save.js +12 -0
  904. package/src/video/test/variations.js +65 -0
  905. package/src/video/tracks-editor.js +0 -1
  906. package/src/video/variations.js +65 -0
  907. package/build/freeform/migration-notice.cjs +0 -58
  908. package/build/freeform/migration-notice.cjs.map +0 -7
  909. package/build/tab-panel/add-tab-toolbar-control.cjs +0 -90
  910. package/build/tab-panel/add-tab-toolbar-control.cjs.map +0 -7
  911. package/build/tab-panel/remove-tab-toolbar-control.cjs +0 -99
  912. package/build/tab-panel/remove-tab-toolbar-control.cjs.map +0 -7
  913. package/build/tabs/controls.cjs +0 -45
  914. package/build/tabs/controls.cjs.map +0 -7
  915. package/build-module/freeform/migration-notice.mjs +0 -37
  916. package/build-module/freeform/migration-notice.mjs.map +0 -7
  917. package/build-module/tab-panel/add-tab-toolbar-control.mjs +0 -72
  918. package/build-module/tab-panel/add-tab-toolbar-control.mjs.map +0 -7
  919. package/build-module/tab-panel/remove-tab-toolbar-control.mjs +0 -81
  920. package/build-module/tab-panel/remove-tab-toolbar-control.mjs.map +0 -7
  921. package/build-module/tabs/controls.mjs +0 -14
  922. package/build-module/tabs/controls.mjs.map +0 -7
  923. package/src/freeform/migration-notice.js +0 -49
  924. package/src/tab-panel/add-tab-toolbar-control.js +0 -90
  925. package/src/tab-panel/remove-tab-toolbar-control.js +0 -110
  926. package/src/tabs/controls.js +0 -14
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/waveform-player.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport { useEvent, useRefEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { initWaveformPlayer } from './waveform-utils';\n\nconst EMPTY_ARTIST_PLACEHOLDER = '\\u00a0';\n\n/**\n * Update a live waveform player's metadata elements in place.\n *\n * The title element always exists, so the title is updated in place. The\n * subtitle element is seeded during editor player creation, so it can be\n * updated in place and hidden when the track has no artist. The artwork\n * element only exists when the track had an image when the player was created,\n * so its value is updated in place here; adding or removing an image (which\n * creates or tears down that element) is instead handled by recreating the\n * player, keyed on the `hasImage` dependency.\n *\n * The library's only metadata API is `loadTrack()`, which re-fetches and\n * re-decodes the audio and regenerates the waveform (resetting playback), so\n * it's unsuitable for live metadata edits. We instead write to the title,\n * subtitle, and artwork elements directly, which is what `loadTrack()` itself\n * does internally for these fields.\n *\n * @param {Object} instance - The waveform player instance.\n * @param {Object} metadata - The track metadata.\n * @param {string} metadata.title - The track title.\n * @param {string} metadata.artist - The artist name.\n * @param {string} metadata.image - The artwork image URL.\n */\nfunction updatePlayerMetadata( instance, { title, artist, image } ) {\n\tif ( instance.titleEl ) {\n\t\tinstance.titleEl.textContent = title ?? '';\n\t}\n\tif ( instance.subtitleEl ) {\n\t\tinstance.subtitleEl.textContent = artist ?? '';\n\t\tinstance.subtitleEl.style.display = artist ? '' : 'none';\n\t}\n\tif ( instance.artworkEl && image ) {\n\t\tinstance.artworkEl.src = image;\n\t}\n}\n\n/**\n * A reusable WaveformPlayer component for the block editor.\n *\n * Renders an audio waveform visualization with play/pause controls.\n * Automatically inherits colors from the parent block's text color.\n *\n * @param {Object} props - Component props.\n * @param {string} props.src - The audio file URL.\n * @param {string} props.title - The track title.\n * @param {string} props.artist - The artist name.\n * @param {string} props.image - The artwork image URL.\n * @param {string} props.waveformStyle - Waveform style (bars, mirror, line, blocks, dots, seekbar).\n * @param {Function} props.onEnded - Callback when the track finishes playing.\n * @return {Element} The WaveformPlayer element.\n */\nexport function WaveformPlayer( {\n\tsrc,\n\ttitle,\n\tartist,\n\timage,\n\twaveformStyle,\n\tonEnded,\n} ) {\n\t// Store onEnded in a stable callback so it doesn't need to be a useRefEffect dependency.\n\t// The callback changes reference on every render (its dependency chain\n\t// includes an unstable array), which would cause useRefEffect to destroy\n\t// and recreate the entire player on every re-render, making it disappear\n\t// during editor resizes.\n\tconst onEndedEvent = useEvent( onEnded );\n\tconst metadataRef = useRef( { title, artist, image } );\n\tconst playerRef = useRef();\n\n\t// The artwork element only exists when an image was present when the\n\t// player was created. Recreate the player when one is added or removed so\n\t// that element is created or torn down; value changes to an existing\n\t// element are applied in place below.\n\tconst hasImage = !! image;\n\n\t// Keep the freshest metadata available to init() (which runs on a\n\t// deferred timeout) and update the live player in place when metadata\n\t// changes. Updating in place avoids destroying and recreating the\n\t// player, which would flash it on every keystroke while editing a\n\t// track's title or artist.\n\tuseEffect( () => {\n\t\tmetadataRef.current = { title, artist, image };\n\n\t\tconst instance = playerRef.current?.instance;\n\t\tif ( instance ) {\n\t\t\tupdatePlayerMetadata( instance, { title, artist, image } );\n\t\t}\n\t}, [ title, artist, image ] );\n\n\tconst ref = useRefEffect(\n\t\t( element ) => {\n\t\t\tif ( ! src ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet cancelled = false;\n\t\t\tlet playerDestroy;\n\n\t\t\tfunction init() {\n\t\t\t\tif ( cancelled ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst player = initWaveformPlayer( element, {\n\t\t\t\t\tsrc,\n\t\t\t\t\t...metadataRef.current,\n\t\t\t\t\twaveformStyle,\n\t\t\t\t\tartist:\n\t\t\t\t\t\tmetadataRef.current.artist || EMPTY_ARTIST_PLACEHOLDER,\n\t\t\t\t\tonEnded: () => onEndedEvent?.(),\n\t\t\t\t} );\n\t\t\t\tplayerRef.current = player;\n\t\t\t\tupdatePlayerMetadata( player.instance, metadataRef.current );\n\t\t\t\tconst { destroy } = player;\n\t\t\t\tplayerDestroy = destroy;\n\t\t\t}\n\n\t\t\t// Defer initialization so the element inherits the correct\n\t\t\t// text color, which is used to derive waveform colors. In the\n\t\t\t// editor iframe, theme styles (CSS custom properties) are\n\t\t\t// injected dynamically, so getComputedStyle may return the\n\t\t\t// default black on first render.\n\t\t\t// Using a requestAnimationFrame loop isn't sufficient to solve the issue.\n\t\t\t// TODO - find a better option than a setTimeout, so we're not relying on an arbitrary number.\n\t\t\tconst timeoutId = setTimeout( init, 100 );\n\n\t\t\treturn () => {\n\t\t\t\tcancelled = true;\n\t\t\t\tclearTimeout( timeoutId );\n\t\t\t\tplayerRef.current = undefined;\n\t\t\t\tplayerDestroy?.();\n\t\t\t};\n\t\t},\n\t\t[ onEndedEvent, src, waveformStyle, hasImage ]\n\t);\n\n\treturn <div ref={ ref } className=\"wp-block-playlist__waveform-player\" />;\n}\n"],
5
- "mappings": ";AAGA,SAAS,WAAW,cAAc;AAClC,SAAS,UAAU,oBAAoB;AAKvC,SAAS,0BAA0B;AA0I3B;AAxIR,IAAM,2BAA2B;AAyBjC,SAAS,qBAAsB,UAAU,EAAE,OAAO,QAAQ,MAAM,GAAI;AACnE,MAAK,SAAS,SAAU;AACvB,aAAS,QAAQ,cAAc,SAAS;AAAA,EACzC;AACA,MAAK,SAAS,YAAa;AAC1B,aAAS,WAAW,cAAc,UAAU;AAC5C,aAAS,WAAW,MAAM,UAAU,SAAS,KAAK;AAAA,EACnD;AACA,MAAK,SAAS,aAAa,OAAQ;AAClC,aAAS,UAAU,MAAM;AAAA,EAC1B;AACD;AAiBO,SAAS,eAAgB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AAMH,QAAM,eAAe,SAAU,OAAQ;AACvC,QAAM,cAAc,OAAQ,EAAE,OAAO,QAAQ,MAAM,CAAE;AACrD,QAAM,YAAY,OAAO;AAMzB,QAAM,WAAW,CAAC,CAAE;AAOpB,YAAW,MAAM;AAChB,gBAAY,UAAU,EAAE,OAAO,QAAQ,MAAM;AAE7C,UAAM,WAAW,UAAU,SAAS;AACpC,QAAK,UAAW;AACf,2BAAsB,UAAU,EAAE,OAAO,QAAQ,MAAM,CAAE;AAAA,IAC1D;AAAA,EACD,GAAG,CAAE,OAAO,QAAQ,KAAM,CAAE;AAE5B,QAAM,MAAM;AAAA,IACX,CAAE,YAAa;AACd,UAAK,CAAE,KAAM;AACZ;AAAA,MACD;AAEA,UAAI,YAAY;AAChB,UAAI;AAEJ,eAAS,OAAO;AACf,YAAK,WAAY;AAChB;AAAA,QACD;AACA,cAAM,SAAS,mBAAoB,SAAS;AAAA,UAC3C;AAAA,UACA,GAAG,YAAY;AAAA,UACf;AAAA,UACA,QACC,YAAY,QAAQ,UAAU;AAAA,UAC/B,SAAS,MAAM,eAAe;AAAA,QAC/B,CAAE;AACF,kBAAU,UAAU;AACpB,6BAAsB,OAAO,UAAU,YAAY,OAAQ;AAC3D,cAAM,EAAE,QAAQ,IAAI;AACpB,wBAAgB;AAAA,MACjB;AASA,YAAM,YAAY,WAAY,MAAM,GAAI;AAExC,aAAO,MAAM;AACZ,oBAAY;AACZ,qBAAc,SAAU;AACxB,kBAAU,UAAU;AACpB,wBAAgB;AAAA,MACjB;AAAA,IACD;AAAA,IACA,CAAE,cAAc,KAAK,eAAe,QAAS;AAAA,EAC9C;AAEA,SAAO,oBAAC,SAAI,KAAY,WAAU,sCAAqC;AACxE;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect, useRef } from '@wordpress/element';\nimport { useEvent, useRefEffect } from '@wordpress/compose';\nimport { __, _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tapplyWaveformPlayerStyles,\n\tinitWaveformPlayer,\n\tsetupPlayButtonArtwork,\n\tupdateSeekControlLabel,\n} from './waveform-utils';\n\n/**\n * Update the metadata of a WaveformPlayer element to reflect current props.\n *\n * `loadTrack()` owns full track swaps, but it also resets the audio element.\n * This keeps same-source metadata edits lightweight in the editor.\n *\n * @param {Object} player - The waveform player.\n * @param {Object} metadata - The track metadata.\n * @param {string} metadata.title - The track title.\n * @param {string} metadata.artist - The artist name.\n * @param {string} metadata.image - The track image URL.\n * @param {string} metadata.imageAlt - The track image alt text.\n * @param {boolean} showPlayButtonArtwork - Whether to show artwork on the play button.\n */\nfunction updatePlayerMetadata(\n\tplayer,\n\t{ title, artist, image, imageAlt },\n\tshowPlayButtonArtwork\n) {\n\tconst { instance, container } = player;\n\tconst playerArtwork = showPlayButtonArtwork ? undefined : image;\n\n\tif ( instance.titleEl ) {\n\t\tinstance.titleEl.textContent = title ?? '';\n\t}\n\tupdateSeekControlLabel( instance, title || __( 'Seek' ) );\n\n\tif ( typeof instance.syncArtist === 'function' ) {\n\t\tinstance.syncArtist( artist || '' );\n\t} else if ( instance.artistEl ) {\n\t\tinstance.artistEl.textContent = artist ?? '';\n\t\tinstance.artistEl.style.display = artist ? '' : 'none';\n\t}\n\n\tif ( typeof instance.syncArtwork === 'function' ) {\n\t\tinstance.syncArtwork(\n\t\t\tplayerArtwork || null,\n\t\t\tplayerArtwork ? imageAlt || '' : ''\n\t\t);\n\t} else if ( instance.artworkEl && playerArtwork ) {\n\t\tinstance.artworkEl.src = playerArtwork;\n\t\tinstance.artworkEl.alt = imageAlt || '';\n\t}\n\tif ( showPlayButtonArtwork ) {\n\t\tsetupPlayButtonArtwork( container, image );\n\t}\n}\n\n/**\n * A reusable WaveformPlayer component for the block editor.\n *\n * Renders an audio waveform visualization with play/pause controls.\n * Automatically inherits colors from the parent block's text color.\n *\n * @param {Object} props - Component props.\n * @param {string} props.src - The audio file URL.\n * @param {string} props.title - The track title.\n * @param {string} props.artist - The artist name.\n * @param {string} props.image - The track image URL.\n * @param {string} props.imageAlt - The track image alt text.\n * @param {string} props.color - The waveform color.\n * @param {string} props.gradient - The waveform gradient.\n * @param {string} props.backgroundColor - The waveform background color.\n * @param {string} props.backgroundGradient - The waveform background gradient.\n * @param {string} props.textColor - The player text color.\n * @param {string} props.waveformStyle - Waveform style (bars, mirror, line, blocks, dots, seekbar).\n * @param {Function} props.onEnded - Callback when the track finishes playing.\n * @param {boolean} props.showPlayButtonArtwork - Whether to show artwork on the play button.\n * @return {Element} The WaveformPlayer element.\n */\nexport function WaveformPlayer( {\n\tsrc,\n\ttitle,\n\tartist,\n\timage,\n\timageAlt,\n\tcolor,\n\tgradient,\n\tbackgroundColor,\n\tbackgroundGradient,\n\ttextColor,\n\twaveformStyle,\n\tonEnded,\n\tshowPlayButtonArtwork = false,\n} ) {\n\t// Store onEnded in a stable callback so it doesn't need to be a useRefEffect dependency.\n\t// The callback changes reference on every render (its dependency chain\n\t// includes an unstable array), which would cause useRefEffect to destroy\n\t// and recreate the entire player on every re-render, making it disappear\n\t// during editor resizes.\n\tconst onEndedEvent = useEvent( onEnded );\n\n\t// Ref for the WaveformPlayer instance\n\tconst playerRef = useRef();\n\n\t// WaveformPlayer needs an audio source on init, but the source may change\n\t// throughout its lifetime.\n\tconst hasSrc = !! src;\n\n\t// Combined props ref for `initWaveformPlayer`, which is called\n\t// asynchronously after this component mounts.\n\tconst metadataRef = useRef( { src, title, artist, image, imageAlt } );\n\tconst stylesRef = useRef( {\n\t\tcolor,\n\t\tgradient,\n\t\tbackgroundColor,\n\t\tbackgroundGradient,\n\t\ttextColor,\n\t} );\n\tuseEffect( () => {\n\t\tmetadataRef.current = { src, title, artist, image, imageAlt };\n\t}, [ src, title, artist, image, imageAlt ] );\n\n\tuseEffect( () => {\n\t\tstylesRef.current = {\n\t\t\tcolor,\n\t\t\tgradient,\n\t\t\tbackgroundColor,\n\t\t\tbackgroundGradient,\n\t\t\ttextColor,\n\t\t};\n\t}, [ color, gradient, backgroundColor, backgroundGradient, textColor ] );\n\n\tuseEffect( () => {\n\t\tif ( playerRef.current?.container ) {\n\t\t\tapplyWaveformPlayerStyles( playerRef.current.container, {\n\t\t\t\tbackgroundColor,\n\t\t\t\tbackgroundGradient,\n\t\t\t\ttextColor,\n\t\t\t\tplayButtonColor: showPlayButtonArtwork ? undefined : color,\n\t\t\t\tplayButtonGradient: showPlayButtonArtwork\n\t\t\t\t\t? undefined\n\t\t\t\t\t: gradient,\n\t\t\t} );\n\t\t}\n\t}, [\n\t\tbackgroundColor,\n\t\tbackgroundGradient,\n\t\tcolor,\n\t\tgradient,\n\t\tshowPlayButtonArtwork,\n\t\ttextColor,\n\t] );\n\n\tconst ref = useRefEffect(\n\t\t( element ) => {\n\t\t\tif ( ! hasSrc ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet cancelled = false;\n\t\t\tlet playerDestroy;\n\n\t\t\tfunction init() {\n\t\t\t\tif ( cancelled ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst player = initWaveformPlayer( element, {\n\t\t\t\t\tsrc: metadataRef.current.src,\n\t\t\t\t\ttitle: metadataRef.current.title,\n\t\t\t\t\tartist: metadataRef.current.artist,\n\t\t\t\t\timage: metadataRef.current.image,\n\t\t\t\t\timageAlt: metadataRef.current.imageAlt,\n\t\t\t\t\twaveformColor: stylesRef.current.color,\n\t\t\t\t\twaveformGradient: stylesRef.current.gradient,\n\t\t\t\t\tbackgroundColor: stylesRef.current.backgroundColor,\n\t\t\t\t\tbackgroundGradient: stylesRef.current.backgroundGradient,\n\t\t\t\t\ttextColor: stylesRef.current.textColor,\n\t\t\t\t\twaveformStyle,\n\t\t\t\t\tlabels: {\n\t\t\t\t\t\tseek: __( 'Seek' ),\n\t\t\t\t\t\t/* translators: %1$s: current audio time, %2$s: total audio duration. */\n\t\t\t\t\t\tseekValueText: _x(\n\t\t\t\t\t\t\t'%1$s of %2$s',\n\t\t\t\t\t\t\t'audio current time of total duration'\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\tonEnded: () => onEndedEvent?.(),\n\t\t\t\t\tshowPlayButtonArtwork,\n\t\t\t\t} );\n\t\t\t\tplayerRef.current = player;\n\t\t\t\tconst { destroy } = player;\n\t\t\t\tplayerDestroy = destroy;\n\t\t\t}\n\n\t\t\t// Defer initialization so the element inherits the correct\n\t\t\t// text color, which is used to derive waveform colors. In the\n\t\t\t// editor iframe, theme styles (CSS custom properties) are\n\t\t\t// injected dynamically, so getComputedStyle may return the\n\t\t\t// default black on first render.\n\t\t\t// Using a requestAnimationFrame loop isn't sufficient to solve the issue.\n\t\t\t// TODO - find a better option than a setTimeout, so we're not relying on an arbitrary number.\n\t\t\tconst timeoutId = setTimeout( init, 100 );\n\n\t\t\treturn () => {\n\t\t\t\tcancelled = true;\n\t\t\t\tclearTimeout( timeoutId );\n\t\t\t\tplayerRef.current = undefined;\n\t\t\t\tplayerDestroy?.();\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tonEndedEvent,\n\t\t\thasSrc,\n\t\t\twaveformStyle,\n\t\t\tcolor,\n\t\t\tgradient,\n\t\t\ttextColor,\n\t\t\tshowPlayButtonArtwork,\n\t\t]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( playerRef.current?.instance ) {\n\t\t\tconst player = playerRef.current;\n\t\t\tif ( player ) {\n\t\t\t\tupdatePlayerMetadata(\n\t\t\t\t\tplayer,\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle,\n\t\t\t\t\t\tartist,\n\t\t\t\t\t\timage,\n\t\t\t\t\t\timageAlt,\n\t\t\t\t\t},\n\t\t\t\t\tshowPlayButtonArtwork\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}, [ title, artist, image, imageAlt, showPlayButtonArtwork ] );\n\n\tuseEffect( () => {\n\t\tif ( src && playerRef.current?.instance ) {\n\t\t\tconst wasPlaying = playerRef.current.instance.isPlaying;\n\t\t\tconst promise = playerRef.current.instance.loadTrack(\n\t\t\t\tsrc,\n\t\t\t\tmetadataRef.current.title,\n\t\t\t\tmetadataRef.current.artist,\n\t\t\t\t{\n\t\t\t\t\tartwork: showPlayButtonArtwork\n\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t: metadataRef.current.image,\n\t\t\t\t\tartworkAlt: showPlayButtonArtwork\n\t\t\t\t\t\t? ''\n\t\t\t\t\t\t: metadataRef.current.imageAlt,\n\t\t\t\t}\n\t\t\t);\n\t\t\tpromise.then( () => {\n\t\t\t\tif ( showPlayButtonArtwork && playerRef.current?.container ) {\n\t\t\t\t\tsetupPlayButtonArtwork(\n\t\t\t\t\t\tplayerRef.current.container,\n\t\t\t\t\t\tmetadataRef.current.image\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif ( ! wasPlaying ) {\n\t\t\t\t\tplayerRef.current?.instance.pause();\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}, [ src, showPlayButtonArtwork ] );\n\n\treturn <div ref={ ref } className=\"wp-block-playlist__waveform-player\" />;\n}\n"],
5
+ "mappings": ";AAGA,SAAS,WAAW,cAAc;AAClC,SAAS,UAAU,oBAAoB;AACvC,SAAS,IAAI,UAAU;AAKvB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAsQC;AAtPR,SAAS,qBACR,QACA,EAAE,OAAO,QAAQ,OAAO,SAAS,GACjC,uBACC;AACD,QAAM,EAAE,UAAU,UAAU,IAAI;AAChC,QAAM,gBAAgB,wBAAwB,SAAY;AAE1D,MAAK,SAAS,SAAU;AACvB,aAAS,QAAQ,cAAc,SAAS;AAAA,EACzC;AACA,yBAAwB,UAAU,SAAS,GAAI,MAAO,CAAE;AAExD,MAAK,OAAO,SAAS,eAAe,YAAa;AAChD,aAAS,WAAY,UAAU,EAAG;AAAA,EACnC,WAAY,SAAS,UAAW;AAC/B,aAAS,SAAS,cAAc,UAAU;AAC1C,aAAS,SAAS,MAAM,UAAU,SAAS,KAAK;AAAA,EACjD;AAEA,MAAK,OAAO,SAAS,gBAAgB,YAAa;AACjD,aAAS;AAAA,MACR,iBAAiB;AAAA,MACjB,gBAAgB,YAAY,KAAK;AAAA,IAClC;AAAA,EACD,WAAY,SAAS,aAAa,eAAgB;AACjD,aAAS,UAAU,MAAM;AACzB,aAAS,UAAU,MAAM,YAAY;AAAA,EACtC;AACA,MAAK,uBAAwB;AAC5B,2BAAwB,WAAW,KAAM;AAAA,EAC1C;AACD;AAwBO,SAAS,eAAgB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,wBAAwB;AACzB,GAAI;AAMH,QAAM,eAAe,SAAU,OAAQ;AAGvC,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,KAAM,MAAM;AACnB,YAAK,yBAAyB,UAAU,SAAS,WAAY;AAC5D;AAAA,YACC,UAAU,QAAQ;AAAA,YAClB,YAAY,QAAQ;AAAA,UACrB;AAAA,QACD;AACA,YAAK,CAAE,YAAa;AACnB,oBAAU,SAAS,SAAS,MAAM;AAAA,QACnC;AAAA,MACD,CAAE;AAAA,IACH;AAAA,EACD,GAAG,CAAE,KAAK,qBAAsB,CAAE;AAElC,SAAO,oBAAC,SAAI,KAAY,WAAU,sCAAqC;AACxE;",
6
6
  "names": []
7
7
  }
@@ -2,14 +2,168 @@
2
2
  import { colord } from "colord";
3
3
  import WaveformPlayerLib from "@arraypress/waveform-player";
4
4
  var DEFAULT_WAVEFORM_HEIGHT = 100;
5
+ var DEFAULT_SEEK_LABEL = "Seek";
5
6
  function getComputedStyle(element) {
6
7
  return element.ownerDocument.defaultView.getComputedStyle(element);
7
8
  }
8
- function getWaveformColors(element) {
9
- const textColor = getComputedStyle(element).color;
10
- const waveformColor = colord(textColor).alpha(0.3).toRgbString();
11
- const progressColor = colord(textColor).alpha(0.6).toRgbString();
12
- return { textColor, waveformColor, progressColor };
9
+ function getTopLevelGradientParts(gradientValue) {
10
+ const match = gradientValue?.trim().match(/^[\w-]+-gradient\((.*)\)$/i);
11
+ if (!match) {
12
+ return [];
13
+ }
14
+ const parts = [];
15
+ let depth = 0;
16
+ let current = "";
17
+ for (const character of match[1]) {
18
+ if (character === "(") {
19
+ ++depth;
20
+ } else if (character === ")") {
21
+ --depth;
22
+ }
23
+ if (character === "," && depth === 0) {
24
+ parts.push(current.trim());
25
+ current = "";
26
+ continue;
27
+ }
28
+ current += character;
29
+ }
30
+ if (current.trim()) {
31
+ parts.push(current.trim());
32
+ }
33
+ return parts;
34
+ }
35
+ function getLeadingColorFunction(value) {
36
+ const match = value.match(/^([\w-]+)\(/);
37
+ if (!match) {
38
+ return;
39
+ }
40
+ const supportedFunctions = [
41
+ "color",
42
+ "color-mix",
43
+ "hsl",
44
+ "hsla",
45
+ "hwb",
46
+ "lab",
47
+ "lch",
48
+ "oklab",
49
+ "oklch",
50
+ "rgb",
51
+ "rgba",
52
+ "var"
53
+ ];
54
+ if (!supportedFunctions.includes(match[1].toLowerCase())) {
55
+ return;
56
+ }
57
+ let depth = 0;
58
+ let foundOpeningParenthesis = false;
59
+ for (let index = 0; index < value.length; index++) {
60
+ const character = value[index];
61
+ if (character === "(") {
62
+ foundOpeningParenthesis = true;
63
+ ++depth;
64
+ } else if (character === ")") {
65
+ --depth;
66
+ }
67
+ if (foundOpeningParenthesis && depth === 0) {
68
+ return value.slice(0, index + 1);
69
+ }
70
+ }
71
+ }
72
+ function getColorStopValue(gradientPart) {
73
+ const colorFunction = getLeadingColorFunction(gradientPart);
74
+ if (colorFunction) {
75
+ return colorFunction;
76
+ }
77
+ const [possibleColor] = gradientPart.split(/\s+/);
78
+ if (colord(possibleColor).isValid()) {
79
+ return possibleColor;
80
+ }
81
+ }
82
+ function getWaveformGradientDirection(gradientValue) {
83
+ const parts = getTopLevelGradientParts(gradientValue);
84
+ const direction = parts[0];
85
+ const angleMatch = direction?.match(/^(-?\d+(?:\.\d+)?)deg$/i);
86
+ if (angleMatch) {
87
+ const angle = (Number(angleMatch[1]) % 360 + 360) % 360;
88
+ if (angle === 90 || angle === 270) {
89
+ return "horizontal";
90
+ }
91
+ if (angle === 0 || angle === 180) {
92
+ return "vertical";
93
+ }
94
+ return "diagonal";
95
+ }
96
+ if (!direction?.startsWith("to ")) {
97
+ return void 0;
98
+ }
99
+ const sideOrCorner = direction.toLowerCase().replace(/^to\s+/, "");
100
+ const hasHorizontalSide = sideOrCorner.includes("left") || sideOrCorner.includes("right");
101
+ const hasVerticalSide = sideOrCorner.includes("top") || sideOrCorner.includes("bottom");
102
+ if (hasHorizontalSide && hasVerticalSide) {
103
+ return "diagonal";
104
+ }
105
+ if (hasHorizontalSide) {
106
+ return "horizontal";
107
+ }
108
+ if (hasVerticalSide) {
109
+ return "vertical";
110
+ }
111
+ }
112
+ function resolveColorValue(element, colorValue) {
113
+ if (!colorValue || colord(colorValue).isValid()) {
114
+ return colorValue;
115
+ }
116
+ const colorResolver = element.ownerDocument.createElement("span");
117
+ colorResolver.style.color = colorValue;
118
+ if (!colorResolver.style.color) {
119
+ return colorValue;
120
+ }
121
+ element.appendChild(colorResolver);
122
+ const resolvedColor = getComputedStyle(colorResolver).color;
123
+ colorResolver.remove();
124
+ return resolvedColor && colord(resolvedColor).isValid() ? resolvedColor : colorValue;
125
+ }
126
+ function getResolvedGradientStops(element, gradientValue) {
127
+ const stops = getWaveformGradientStops(gradientValue)?.map((colorValue) => resolveColorValue(element, colorValue)).filter((colorValue) => colord(colorValue).isValid());
128
+ return stops?.length > 1 ? stops : void 0;
129
+ }
130
+ function applyAlpha(colorValue, alpha) {
131
+ if (Array.isArray(colorValue)) {
132
+ return colorValue.map(
133
+ (color) => colord(color).alpha(alpha).toRgbString()
134
+ );
135
+ }
136
+ return colord(colorValue).alpha(alpha).toRgbString();
137
+ }
138
+ function getRepresentativeColor(colorValue) {
139
+ if (Array.isArray(colorValue)) {
140
+ return colorValue[colorValue.length - 1];
141
+ }
142
+ return colorValue;
143
+ }
144
+ function getWaveformGradientStops(gradientValue) {
145
+ const stops = getTopLevelGradientParts(gradientValue).map(getColorStopValue).filter(Boolean);
146
+ return stops.length > 1 ? stops : void 0;
147
+ }
148
+ function serializeColorValue(colorValue) {
149
+ return Array.isArray(colorValue) ? JSON.stringify(colorValue) : colorValue;
150
+ }
151
+ function getWaveformColors(element, waveformColorValue, textColorValue, waveformGradientValue) {
152
+ const textColor = textColorValue || getComputedStyle(element).color;
153
+ const waveformGradientStops = getResolvedGradientStops(
154
+ element,
155
+ waveformGradientValue
156
+ );
157
+ const waveformBaseColor = waveformGradientStops || waveformColorValue || textColor;
158
+ const waveformColor = applyAlpha(waveformBaseColor, 0.3);
159
+ const progressColor = applyAlpha(waveformBaseColor, 0.6);
160
+ const waveformGradient = waveformGradientStops ? getWaveformGradientDirection(waveformGradientValue) : void 0;
161
+ return {
162
+ textColor,
163
+ waveformColor,
164
+ progressColor,
165
+ ...waveformGradient && { waveformGradient }
166
+ };
13
167
  }
14
168
  function createWaveformContainer({
15
169
  url,
@@ -18,7 +172,10 @@ function createWaveformContainer({
18
172
  artwork,
19
173
  waveformColor,
20
174
  progressColor,
175
+ waveformGradient,
21
176
  buttonColor,
177
+ seekLabel,
178
+ seekValueText,
22
179
  height = DEFAULT_WAVEFORM_HEIGHT,
23
180
  waveformStyle = "bars"
24
181
  }) {
@@ -27,22 +184,84 @@ function createWaveformContainer({
27
184
  container.setAttribute("data-url", url);
28
185
  container.setAttribute("data-height", String(height));
29
186
  container.setAttribute("data-waveform-style", waveformStyle);
30
- container.setAttribute("data-waveform-color", waveformColor);
31
- container.setAttribute("data-progress-color", progressColor);
187
+ container.setAttribute(
188
+ "data-waveform-color",
189
+ serializeColorValue(waveformColor)
190
+ );
191
+ container.setAttribute(
192
+ "data-progress-color",
193
+ serializeColorValue(progressColor)
194
+ );
195
+ if (waveformGradient) {
196
+ container.setAttribute("data-waveform-gradient", waveformGradient);
197
+ }
32
198
  container.setAttribute("data-button-color", buttonColor);
199
+ container.setAttribute(
200
+ "data-seek-label",
201
+ getSeekControlLabel(seekLabel)
202
+ );
203
+ if (seekValueText) {
204
+ container.setAttribute("data-seek-value-text", seekValueText);
205
+ }
33
206
  container.setAttribute("data-text-color", buttonColor);
34
207
  container.setAttribute("data-text-secondary-color", buttonColor);
35
208
  if (title) {
36
209
  container.setAttribute("data-title", title);
37
210
  }
38
211
  if (artist) {
39
- container.setAttribute("data-subtitle", artist);
212
+ container.setAttribute("data-artist", artist);
40
213
  }
41
214
  if (artwork) {
42
215
  container.setAttribute("data-artwork", artwork);
43
216
  }
44
217
  return container;
45
218
  }
219
+ function applyWaveformPlayerStyles(container, {
220
+ backgroundColor,
221
+ backgroundGradient,
222
+ textColor,
223
+ playButtonColor,
224
+ playButtonGradient
225
+ } = {}) {
226
+ const waveformContainer = container.querySelector(".waveform-container");
227
+ const playButton = container.querySelector(".waveform-btn");
228
+ const playButtonBaseColor = getRepresentativeColor(
229
+ getResolvedGradientStops(container, playButtonGradient) || playButtonColor
230
+ );
231
+ if (playButtonBaseColor) {
232
+ container.style.setProperty(
233
+ "--wfp-button-color",
234
+ playButtonBaseColor
235
+ );
236
+ } else {
237
+ container.style.removeProperty("--wfp-button-color");
238
+ }
239
+ if (textColor) {
240
+ container.style.setProperty("--wfp-text-color", textColor);
241
+ container.style.setProperty("--wfp-text-secondary-color", textColor);
242
+ } else {
243
+ container.style.removeProperty("--wfp-text-color");
244
+ container.style.removeProperty("--wfp-text-secondary-color");
245
+ }
246
+ if (playButton) {
247
+ if (playButtonGradient) {
248
+ playButton.style.background = playButtonGradient;
249
+ } else {
250
+ playButton.style.removeProperty("background");
251
+ }
252
+ }
253
+ if (waveformContainer) {
254
+ if (backgroundGradient) {
255
+ waveformContainer.style.background = backgroundGradient;
256
+ } else if (backgroundColor) {
257
+ waveformContainer.style.removeProperty("background");
258
+ waveformContainer.style.backgroundColor = backgroundColor;
259
+ } else {
260
+ waveformContainer.style.removeProperty("background");
261
+ waveformContainer.style.removeProperty("background-color");
262
+ }
263
+ }
264
+ }
46
265
  function styleSvgIcons(container, buttonColor) {
47
266
  const isButtonDark = colord(buttonColor).isDark();
48
267
  const iconColor = isButtonDark ? "#ffffff" : "#000000";
@@ -68,31 +287,102 @@ function setupPlayButtonAccessibility(container, { play: playLabel = "Play", pau
68
287
  container.removeEventListener("waveformplayer:ended", onPause);
69
288
  };
70
289
  }
290
+ function getSeekControlLabel(label) {
291
+ return label || DEFAULT_SEEK_LABEL;
292
+ }
293
+ function updateSeekControlLabel(instance, label) {
294
+ const seekLabel = getSeekControlLabel(label);
295
+ instance.options.seekLabel = seekLabel;
296
+ instance.applySeekLabel?.(seekLabel);
297
+ const seekControl = instance?.container?.querySelector(
298
+ ".waveform-container"
299
+ );
300
+ if (seekControl) {
301
+ seekControl.setAttribute("aria-label", seekLabel);
302
+ }
303
+ }
304
+ function setupPlayButtonArtwork(container, artworkUrl) {
305
+ if (!artworkUrl) {
306
+ container.classList.remove("has-play-button-artwork");
307
+ container.style.removeProperty("--wp--playlist--play-button-artwork");
308
+ return;
309
+ }
310
+ container.classList.add("has-play-button-artwork");
311
+ container.style.setProperty(
312
+ "--wp--playlist--play-button-artwork",
313
+ `url(${JSON.stringify(artworkUrl)})`
314
+ );
315
+ }
71
316
  function logPlayError(error) {
72
317
  if (error.name === "AbortError") {
73
318
  return;
74
319
  }
75
320
  console.error("Playlist play error:", error);
76
321
  }
77
- function initWaveformPlayer(element, { src, title, artist, image, autoPlay, onEnded, labels, waveformStyle }) {
78
- const { textColor, waveformColor, progressColor } = getWaveformColors(element);
322
+ function initWaveformPlayer(element, {
323
+ src,
324
+ title,
325
+ artist,
326
+ image,
327
+ imageAlt,
328
+ waveformColor: waveformColorValue,
329
+ waveformGradient: waveformGradientValue,
330
+ textColor: textColorValue,
331
+ backgroundColor,
332
+ backgroundGradient,
333
+ autoPlay,
334
+ onEnded,
335
+ labels,
336
+ waveformStyle,
337
+ showPlayButtonArtwork = false
338
+ }) {
339
+ const playerArtwork = showPlayButtonArtwork ? void 0 : image;
340
+ const { textColor, waveformColor, progressColor, waveformGradient } = getWaveformColors(
341
+ element,
342
+ waveformColorValue,
343
+ textColorValue,
344
+ waveformGradientValue
345
+ );
346
+ const waveformGradientStops = getResolvedGradientStops(
347
+ element,
348
+ waveformGradientValue
349
+ );
350
+ const waveformButtonColor = getRepresentativeColor(
351
+ waveformGradientStops || waveformColorValue
352
+ );
79
353
  const container = createWaveformContainer({
80
354
  url: src,
81
355
  title,
82
356
  artist,
83
- artwork: image,
357
+ artwork: playerArtwork,
84
358
  waveformColor,
85
359
  progressColor,
360
+ waveformGradient,
86
361
  buttonColor: textColor,
362
+ seekLabel: title || labels?.seek,
363
+ seekValueText: labels?.seekValueText,
87
364
  waveformStyle
88
365
  });
89
366
  element.appendChild(container);
90
367
  const instance = new WaveformPlayerLib(container);
91
- let cleanupAccessibility;
368
+ if (instance.artworkEl) {
369
+ instance.artworkEl.alt = imageAlt || "";
370
+ }
371
+ applyWaveformPlayerStyles(container, {
372
+ backgroundColor,
373
+ backgroundGradient,
374
+ textColor,
375
+ playButtonColor: showPlayButtonArtwork ? void 0 : waveformButtonColor,
376
+ playButtonGradient: showPlayButtonArtwork ? void 0 : waveformGradientValue
377
+ });
378
+ let cleanupPlayButtonAccessibility;
92
379
  const handlers = {
93
380
  ready: () => {
94
- styleSvgIcons(container, textColor);
95
- cleanupAccessibility = setupPlayButtonAccessibility(
381
+ styleSvgIcons(container, waveformButtonColor || textColor);
382
+ if (showPlayButtonArtwork) {
383
+ setupPlayButtonArtwork(container, image);
384
+ }
385
+ cleanupPlayButtonAccessibility = setupPlayButtonAccessibility(
96
386
  container,
97
387
  labels
98
388
  );
@@ -108,7 +398,7 @@ function initWaveformPlayer(element, { src, title, artist, image, autoPlay, onEn
108
398
  instance,
109
399
  container,
110
400
  destroy: () => {
111
- cleanupAccessibility?.();
401
+ cleanupPlayButtonAccessibility?.();
112
402
  container.removeEventListener(
113
403
  "waveformplayer:ready",
114
404
  handlers.ready
@@ -123,11 +413,15 @@ function initWaveformPlayer(element, { src, title, artist, image, autoPlay, onEn
123
413
  };
124
414
  }
125
415
  export {
416
+ applyWaveformPlayerStyles,
126
417
  createWaveformContainer,
127
418
  getWaveformColors,
419
+ getWaveformGradientStops,
128
420
  initWaveformPlayer,
129
421
  logPlayError,
130
422
  setupPlayButtonAccessibility,
131
- styleSvgIcons
423
+ setupPlayButtonArtwork,
424
+ styleSvgIcons,
425
+ updateSeekControlLabel
132
426
  };
133
427
  //# sourceMappingURL=waveform-utils.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/waveform-utils.js"],
4
- "sourcesContent": ["/**\n * Shared utilities for waveform audio player functionality.\n * Used by both the WaveformPlayer component (editor) and view.js (frontend).\n */\n\n/**\n * External dependencies\n */\nimport { colord } from 'colord';\nimport WaveformPlayerLib from '@arraypress/waveform-player';\n\n/**\n * Configuration constants.\n * Note: DEFAULT_WAVEFORM_HEIGHT should match $waveform-player-height in style.scss.\n */\nconst DEFAULT_WAVEFORM_HEIGHT = 100;\n\n/**\n * Get computed style for an element, using ownerDocument for iframe compatibility.\n *\n * @param {Element} element - The element to get styles from.\n * @return {CSSStyleDeclaration} The computed style.\n */\nfunction getComputedStyle( element ) {\n\treturn element.ownerDocument.defaultView.getComputedStyle( element );\n}\n\n/**\n * Get all colors needed for the waveform player based on the element's styles.\n *\n * @param {Element} element - The element to derive colors from.\n * @return {Object} Object containing textColor, waveformColor, progressColor.\n */\nexport function getWaveformColors( element ) {\n\tconst textColor = getComputedStyle( element ).color;\n\tconst waveformColor = colord( textColor ).alpha( 0.3 ).toRgbString();\n\tconst progressColor = colord( textColor ).alpha( 0.6 ).toRgbString();\n\n\treturn { textColor, waveformColor, progressColor };\n}\n\n/**\n * Create a waveform container element with the specified attributes.\n *\n * @param {Object} options - The options for the container.\n * @param {string} options.url - The audio URL.\n * @param {string} options.title - The track title.\n * @param {string} options.artist - The track artist.\n * @param {string} options.artwork - The album artwork URL.\n * @param {string} options.waveformColor - The waveform bar color.\n * @param {string} options.progressColor - The progress indicator color.\n * @param {string} options.buttonColor - The play button color.\n * @param {number} options.height - The waveform height in pixels.\n * @param {string} options.waveformStyle - The visualization style (bars, mirror, line, blocks, dots, seekbar).\n * @return {Element} The configured container element.\n */\nexport function createWaveformContainer( {\n\turl,\n\ttitle,\n\tartist,\n\tartwork,\n\twaveformColor,\n\tprogressColor,\n\tbuttonColor,\n\theight = DEFAULT_WAVEFORM_HEIGHT,\n\twaveformStyle = 'bars',\n} ) {\n\tconst container = document.createElement( 'div' );\n\tcontainer.setAttribute( 'data-waveform-player', '' );\n\tcontainer.setAttribute( 'data-url', url );\n\tcontainer.setAttribute( 'data-height', String( height ) );\n\tcontainer.setAttribute( 'data-waveform-style', waveformStyle );\n\tcontainer.setAttribute( 'data-waveform-color', waveformColor );\n\tcontainer.setAttribute( 'data-progress-color', progressColor );\n\tcontainer.setAttribute( 'data-button-color', buttonColor );\n\tcontainer.setAttribute( 'data-text-color', buttonColor );\n\tcontainer.setAttribute( 'data-text-secondary-color', buttonColor );\n\tif ( title ) {\n\t\tcontainer.setAttribute( 'data-title', title );\n\t}\n\tif ( artist ) {\n\t\tcontainer.setAttribute( 'data-subtitle', artist );\n\t}\n\tif ( artwork ) {\n\t\tcontainer.setAttribute( 'data-artwork', artwork );\n\t}\n\treturn container;\n}\n\n/**\n * Apply contrasting color to SVG icon paths for visibility.\n * The icons should contrast with the button background (which uses textColor).\n *\n * @param {Element} container - The waveform container element.\n * @param {string} buttonColor - The button background color (textColor).\n */\nexport function styleSvgIcons( container, buttonColor ) {\n\t// Compute a contrasting color for the icons based on button brightness.\n\tconst isButtonDark = colord( buttonColor ).isDark();\n\tconst iconColor = isButtonDark ? '#ffffff' : '#000000';\n\n\tconst svgPaths = container.querySelectorAll( 'svg path' );\n\tsvgPaths.forEach( ( path ) => {\n\t\tpath.style.fill = iconColor;\n\t} );\n}\n\n/**\n * Set up play button accessibility: aria-label that toggles on play/pause.\n *\n * @param {Element} container - The waveform container element.\n * @param {Object} labels - Button labels.\n * @param {string} labels.play - Label for the play state.\n * @param {string} labels.pause - Label for the pause state.\n */\nexport function setupPlayButtonAccessibility(\n\tcontainer,\n\t{ play: playLabel = 'Play', pause: pauseLabel = 'Pause' } = {}\n) {\n\tconst playBtn = container.querySelector( '.waveform-btn' );\n\tif ( ! playBtn ) {\n\t\treturn;\n\t}\n\n\tplayBtn.setAttribute( 'aria-label', playLabel );\n\n\tconst onPlay = () => playBtn.setAttribute( 'aria-label', pauseLabel );\n\tconst onPause = () => playBtn.setAttribute( 'aria-label', playLabel );\n\n\tcontainer.addEventListener( 'waveformplayer:play', onPlay );\n\tcontainer.addEventListener( 'waveformplayer:pause', onPause );\n\tcontainer.addEventListener( 'waveformplayer:ended', onPause );\n\n\treturn () => {\n\t\tcontainer.removeEventListener( 'waveformplayer:play', onPlay );\n\t\tcontainer.removeEventListener( 'waveformplayer:pause', onPause );\n\t\tcontainer.removeEventListener( 'waveformplayer:ended', onPause );\n\t};\n}\n\n/**\n * Log play errors, filtering out expected AbortError.\n *\n * @param {Error} error - The error from play().\n */\nexport function logPlayError( error ) {\n\t// The browser throws AbortError when a play() promise is interrupted\n\t// by a subsequent pause() or a new audio source load (track change).\n\t// This is normal during rapid user interaction and safe to ignore.\n\tif ( error.name === 'AbortError' ) {\n\t\treturn;\n\t}\n\t// eslint-disable-next-line no-console\n\tconsole.error( 'Playlist play error:', error );\n}\n\n/**\n * Initialize a WaveformPlayer instance on an element.\n *\n * This is the shared core logic used by both the React component (editor)\n * and the Interactivity API (frontend).\n *\n * @param {Element} element - The container element (must be in DOM).\n * @param {Object} options - Configuration options.\n * @param {string} options.src - The audio file URL.\n * @param {string} options.title - The track title.\n * @param {string} options.artist - The artist name.\n * @param {string} options.image - The artwork image URL.\n * @param {boolean} options.autoPlay - Whether to auto-play when ready.\n * @param {Function} options.onEnded - Callback when track ends.\n * @param {Object} options.labels - Translated button labels.\n * @param {string} options.waveformStyle - Waveform style (bars, mirror, line, blocks, dots, seekbar).\n * @return {Object} Object with instance, container, and destroy function.\n */\nexport function initWaveformPlayer(\n\telement,\n\t{ src, title, artist, image, autoPlay, onEnded, labels, waveformStyle }\n) {\n\t// Get colors from computed styles.\n\tconst { textColor, waveformColor, progressColor } =\n\t\tgetWaveformColors( element );\n\n\t// Create the waveform container.\n\tconst container = createWaveformContainer( {\n\t\turl: src,\n\t\ttitle,\n\t\tartist,\n\t\tartwork: image,\n\t\twaveformColor,\n\t\tprogressColor,\n\t\tbuttonColor: textColor,\n\t\twaveformStyle,\n\t} );\n\telement.appendChild( container );\n\n\t// Initialize the WaveformPlayer library.\n\tconst instance = new WaveformPlayerLib( container );\n\n\t// Set up event handlers.\n\tlet cleanupAccessibility;\n\tconst handlers = {\n\t\tready: () => {\n\t\t\tstyleSvgIcons( container, textColor );\n\t\t\tcleanupAccessibility = setupPlayButtonAccessibility(\n\t\t\t\tcontainer,\n\t\t\t\tlabels\n\t\t\t);\n\t\t\tif ( autoPlay ) {\n\t\t\t\tinstance.play()?.catch( logPlayError );\n\t\t\t}\n\t\t},\n\t\tended: () => onEnded?.(),\n\t};\n\n\tcontainer.addEventListener( 'waveformplayer:ready', handlers.ready );\n\tcontainer.addEventListener( 'waveformplayer:ended', handlers.ended );\n\n\t// Return instance, container, and cleanup function.\n\treturn {\n\t\tinstance,\n\t\tcontainer,\n\t\tdestroy: () => {\n\t\t\tcleanupAccessibility?.();\n\t\t\tcontainer.removeEventListener(\n\t\t\t\t'waveformplayer:ready',\n\t\t\t\thandlers.ready\n\t\t\t);\n\t\t\tcontainer.removeEventListener(\n\t\t\t\t'waveformplayer:ended',\n\t\t\t\thandlers.ended\n\t\t\t);\n\t\t\tinstance.destroy();\n\t\t\tcontainer.remove();\n\t\t},\n\t};\n}\n"],
5
- "mappings": ";AAQA,SAAS,cAAc;AACvB,OAAO,uBAAuB;AAM9B,IAAM,0BAA0B;AAQhC,SAAS,iBAAkB,SAAU;AACpC,SAAO,QAAQ,cAAc,YAAY,iBAAkB,OAAQ;AACpE;AAQO,SAAS,kBAAmB,SAAU;AAC5C,QAAM,YAAY,iBAAkB,OAAQ,EAAE;AAC9C,QAAM,gBAAgB,OAAQ,SAAU,EAAE,MAAO,GAAI,EAAE,YAAY;AACnE,QAAM,gBAAgB,OAAQ,SAAU,EAAE,MAAO,GAAI,EAAE,YAAY;AAEnE,SAAO,EAAE,WAAW,eAAe,cAAc;AAClD;AAiBO,SAAS,wBAAyB;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT,gBAAgB;AACjB,GAAI;AACH,QAAM,YAAY,SAAS,cAAe,KAAM;AAChD,YAAU,aAAc,wBAAwB,EAAG;AACnD,YAAU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;AAOO,SAAS,aAAc,OAAQ;AAIrC,MAAK,MAAM,SAAS,cAAe;AAClC;AAAA,EACD;AAEA,UAAQ,MAAO,wBAAwB,KAAM;AAC9C;AAoBO,SAAS,mBACf,SACA,EAAE,KAAK,OAAO,QAAQ,OAAO,UAAU,SAAS,QAAQ,cAAc,GACrE;AAED,QAAM,EAAE,WAAW,eAAe,cAAc,IAC/C,kBAAmB,OAAQ;AAG5B,QAAM,YAAY,wBAAyB;AAAA,IAC1C,KAAK;AAAA,IACL;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb;AAAA,EACD,CAAE;AACF,UAAQ,YAAa,SAAU;AAG/B,QAAM,WAAW,IAAI,kBAAmB,SAAU;AAGlD,MAAI;AACJ,QAAM,WAAW;AAAA,IAChB,OAAO,MAAM;AACZ,oBAAe,WAAW,SAAU;AACpC,6BAAuB;AAAA,QACtB;AAAA,QACA;AAAA,MACD;AACA,UAAK,UAAW;AACf,iBAAS,KAAK,GAAG,MAAO,YAAa;AAAA,MACtC;AAAA,IACD;AAAA,IACA,OAAO,MAAM,UAAU;AAAA,EACxB;AAEA,YAAU,iBAAkB,wBAAwB,SAAS,KAAM;AACnE,YAAU,iBAAkB,wBAAwB,SAAS,KAAM;AAGnE,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA,SAAS,MAAM;AACd,6BAAuB;AACvB,gBAAU;AAAA,QACT;AAAA,QACA,SAAS;AAAA,MACV;AACA,gBAAU;AAAA,QACT;AAAA,QACA,SAAS;AAAA,MACV;AACA,eAAS,QAAQ;AACjB,gBAAU,OAAO;AAAA,IAClB;AAAA,EACD;AACD;",
4
+ "sourcesContent": ["/**\n * Shared utilities for waveform audio player functionality.\n * Used by both the WaveformPlayer component (editor) and view.js (frontend).\n */\n\n/**\n * External dependencies\n */\nimport { colord } from 'colord';\nimport WaveformPlayerLib from '@arraypress/waveform-player';\n\n/**\n * Configuration constants.\n * Note: DEFAULT_WAVEFORM_HEIGHT should match $waveform-player-height in style.scss.\n */\nconst DEFAULT_WAVEFORM_HEIGHT = 100;\nconst DEFAULT_SEEK_LABEL = 'Seek';\n\n/**\n * Get computed style for an element, using ownerDocument for iframe compatibility.\n *\n * @param {Element} element - The element to get styles from.\n * @return {CSSStyleDeclaration} The computed style.\n */\nfunction getComputedStyle( element ) {\n\treturn element.ownerDocument.defaultView.getComputedStyle( element );\n}\n\nfunction getTopLevelGradientParts( gradientValue ) {\n\tconst match = gradientValue?.trim().match( /^[\\w-]+-gradient\\((.*)\\)$/i );\n\tif ( ! match ) {\n\t\treturn [];\n\t}\n\n\tconst parts = [];\n\tlet depth = 0;\n\tlet current = '';\n\n\tfor ( const character of match[ 1 ] ) {\n\t\tif ( character === '(' ) {\n\t\t\t++depth;\n\t\t} else if ( character === ')' ) {\n\t\t\t--depth;\n\t\t}\n\n\t\tif ( character === ',' && depth === 0 ) {\n\t\t\tparts.push( current.trim() );\n\t\t\tcurrent = '';\n\t\t\tcontinue;\n\t\t}\n\n\t\tcurrent += character;\n\t}\n\n\tif ( current.trim() ) {\n\t\tparts.push( current.trim() );\n\t}\n\n\treturn parts;\n}\n\nfunction getLeadingColorFunction( value ) {\n\tconst match = value.match( /^([\\w-]+)\\(/ );\n\tif ( ! match ) {\n\t\treturn;\n\t}\n\n\tconst supportedFunctions = [\n\t\t'color',\n\t\t'color-mix',\n\t\t'hsl',\n\t\t'hsla',\n\t\t'hwb',\n\t\t'lab',\n\t\t'lch',\n\t\t'oklab',\n\t\t'oklch',\n\t\t'rgb',\n\t\t'rgba',\n\t\t'var',\n\t];\n\tif ( ! supportedFunctions.includes( match[ 1 ].toLowerCase() ) ) {\n\t\treturn;\n\t}\n\n\tlet depth = 0;\n\tlet foundOpeningParenthesis = false;\n\tfor ( let index = 0; index < value.length; index++ ) {\n\t\tconst character = value[ index ];\n\t\tif ( character === '(' ) {\n\t\t\tfoundOpeningParenthesis = true;\n\t\t\t++depth;\n\t\t} else if ( character === ')' ) {\n\t\t\t--depth;\n\t\t}\n\n\t\tif ( foundOpeningParenthesis && depth === 0 ) {\n\t\t\treturn value.slice( 0, index + 1 );\n\t\t}\n\t}\n}\n\nfunction getColorStopValue( gradientPart ) {\n\tconst colorFunction = getLeadingColorFunction( gradientPart );\n\tif ( colorFunction ) {\n\t\treturn colorFunction;\n\t}\n\n\tconst [ possibleColor ] = gradientPart.split( /\\s+/ );\n\tif ( colord( possibleColor ).isValid() ) {\n\t\treturn possibleColor;\n\t}\n}\n\nfunction getWaveformGradientDirection( gradientValue ) {\n\tconst parts = getTopLevelGradientParts( gradientValue );\n\tconst direction = parts[ 0 ];\n\tconst angleMatch = direction?.match( /^(-?\\d+(?:\\.\\d+)?)deg$/i );\n\tif ( angleMatch ) {\n\t\tconst angle = ( ( Number( angleMatch[ 1 ] ) % 360 ) + 360 ) % 360;\n\t\tif ( angle === 90 || angle === 270 ) {\n\t\t\treturn 'horizontal';\n\t\t}\n\t\tif ( angle === 0 || angle === 180 ) {\n\t\t\treturn 'vertical';\n\t\t}\n\t\treturn 'diagonal';\n\t}\n\n\tif ( ! direction?.startsWith( 'to ' ) ) {\n\t\treturn undefined;\n\t}\n\n\tconst sideOrCorner = direction.toLowerCase().replace( /^to\\s+/, '' );\n\tconst hasHorizontalSide =\n\t\tsideOrCorner.includes( 'left' ) || sideOrCorner.includes( 'right' );\n\tconst hasVerticalSide =\n\t\tsideOrCorner.includes( 'top' ) || sideOrCorner.includes( 'bottom' );\n\n\tif ( hasHorizontalSide && hasVerticalSide ) {\n\t\treturn 'diagonal';\n\t}\n\tif ( hasHorizontalSide ) {\n\t\treturn 'horizontal';\n\t}\n\tif ( hasVerticalSide ) {\n\t\treturn 'vertical';\n\t}\n}\n\nfunction resolveColorValue( element, colorValue ) {\n\tif ( ! colorValue || colord( colorValue ).isValid() ) {\n\t\treturn colorValue;\n\t}\n\n\tconst colorResolver = element.ownerDocument.createElement( 'span' );\n\tcolorResolver.style.color = colorValue;\n\tif ( ! colorResolver.style.color ) {\n\t\treturn colorValue;\n\t}\n\telement.appendChild( colorResolver );\n\n\tconst resolvedColor = getComputedStyle( colorResolver ).color;\n\tcolorResolver.remove();\n\n\treturn resolvedColor && colord( resolvedColor ).isValid()\n\t\t? resolvedColor\n\t\t: colorValue;\n}\n\nfunction getResolvedGradientStops( element, gradientValue ) {\n\tconst stops = getWaveformGradientStops( gradientValue )\n\t\t?.map( ( colorValue ) => resolveColorValue( element, colorValue ) )\n\t\t.filter( ( colorValue ) => colord( colorValue ).isValid() );\n\n\treturn stops?.length > 1 ? stops : undefined;\n}\n\nfunction applyAlpha( colorValue, alpha ) {\n\tif ( Array.isArray( colorValue ) ) {\n\t\treturn colorValue.map( ( color ) =>\n\t\t\tcolord( color ).alpha( alpha ).toRgbString()\n\t\t);\n\t}\n\treturn colord( colorValue ).alpha( alpha ).toRgbString();\n}\n\nfunction getRepresentativeColor( colorValue ) {\n\tif ( Array.isArray( colorValue ) ) {\n\t\treturn colorValue[ colorValue.length - 1 ];\n\t}\n\treturn colorValue;\n}\n\nexport function getWaveformGradientStops( gradientValue ) {\n\tconst stops = getTopLevelGradientParts( gradientValue )\n\t\t.map( getColorStopValue )\n\t\t.filter( Boolean );\n\n\treturn stops.length > 1 ? stops : undefined;\n}\n\nfunction serializeColorValue( colorValue ) {\n\treturn Array.isArray( colorValue )\n\t\t? JSON.stringify( colorValue )\n\t\t: colorValue;\n}\n\n/**\n * Get all colors needed for the waveform player based on the element's styles.\n *\n * @param {Element} element - The element to derive colors from.\n * @param {string} waveformColorValue - The base waveform color value to use.\n * @param {string} textColorValue - The text color value to use.\n * @param {string} waveformGradientValue - The waveform gradient value to use.\n * @return {Object} Object containing textColor, waveformColor, progressColor.\n */\nexport function getWaveformColors(\n\telement,\n\twaveformColorValue,\n\ttextColorValue,\n\twaveformGradientValue\n) {\n\tconst textColor = textColorValue || getComputedStyle( element ).color;\n\tconst waveformGradientStops = getResolvedGradientStops(\n\t\telement,\n\t\twaveformGradientValue\n\t);\n\tconst waveformBaseColor =\n\t\twaveformGradientStops || waveformColorValue || textColor;\n\tconst waveformColor = applyAlpha( waveformBaseColor, 0.3 );\n\tconst progressColor = applyAlpha( waveformBaseColor, 0.6 );\n\tconst waveformGradient = waveformGradientStops\n\t\t? getWaveformGradientDirection( waveformGradientValue )\n\t\t: undefined;\n\n\treturn {\n\t\ttextColor,\n\t\twaveformColor,\n\t\tprogressColor,\n\t\t...( waveformGradient && { waveformGradient } ),\n\t};\n}\n\n/**\n * Create a waveform container element with the specified attributes.\n *\n * @param {Object} options - The options for the container.\n * @param {string} options.url - The audio URL.\n * @param {string} options.title - The track title.\n * @param {string} options.artist - The track artist.\n * @param {string} options.artwork - The track image URL.\n * @param {string} options.waveformColor - The waveform bar color.\n * @param {string} options.progressColor - The progress indicator color.\n * @param {string} options.waveformGradient - The waveform gradient direction.\n * @param {string} options.buttonColor - The play button color.\n * @param {string} options.seekLabel - Accessible label for the seek control.\n * @param {string} options.seekValueText - Accessible value-text template for the seek control (e.g. '%1$s of %2$s').\n * @param {number} options.height - The waveform height in pixels.\n * @param {string} options.waveformStyle - The visualization style (bars, mirror, line, blocks, dots, seekbar).\n * @return {Element} The configured container element.\n */\nexport function createWaveformContainer( {\n\turl,\n\ttitle,\n\tartist,\n\tartwork,\n\twaveformColor,\n\tprogressColor,\n\twaveformGradient,\n\tbuttonColor,\n\tseekLabel,\n\tseekValueText,\n\theight = DEFAULT_WAVEFORM_HEIGHT,\n\twaveformStyle = 'bars',\n} ) {\n\tconst container = document.createElement( 'div' );\n\tcontainer.setAttribute( 'data-waveform-player', '' );\n\tcontainer.setAttribute( 'data-url', url );\n\tcontainer.setAttribute( 'data-height', String( height ) );\n\tcontainer.setAttribute( 'data-waveform-style', waveformStyle );\n\tcontainer.setAttribute(\n\t\t'data-waveform-color',\n\t\tserializeColorValue( waveformColor )\n\t);\n\tcontainer.setAttribute(\n\t\t'data-progress-color',\n\t\tserializeColorValue( progressColor )\n\t);\n\tif ( waveformGradient ) {\n\t\tcontainer.setAttribute( 'data-waveform-gradient', waveformGradient );\n\t}\n\tcontainer.setAttribute( 'data-button-color', buttonColor );\n\tcontainer.setAttribute(\n\t\t'data-seek-label',\n\t\tgetSeekControlLabel( seekLabel )\n\t);\n\t// The library formats the current time and duration and interpolates them\n\t// into this translated template for the seek slider's aria-valuetext.\n\tif ( seekValueText ) {\n\t\tcontainer.setAttribute( 'data-seek-value-text', seekValueText );\n\t}\n\tcontainer.setAttribute( 'data-text-color', buttonColor );\n\tcontainer.setAttribute( 'data-text-secondary-color', buttonColor );\n\n\tif ( title ) {\n\t\tcontainer.setAttribute( 'data-title', title );\n\t}\n\tif ( artist ) {\n\t\tcontainer.setAttribute( 'data-artist', artist );\n\t}\n\tif ( artwork ) {\n\t\tcontainer.setAttribute( 'data-artwork', artwork );\n\t}\n\treturn container;\n}\n\n/**\n * Apply custom styles to a generated waveform player.\n *\n * @param {Element} container - The generated player container.\n * @param {Object} styles - The player styles.\n * @param {string} styles.backgroundColor - The waveform area background color.\n * @param {string} styles.backgroundGradient - The waveform area background gradient.\n * @param {string} styles.textColor - The player text color.\n * @param {string} styles.playButtonColor - The play button color.\n * @param {string} styles.playButtonGradient - The play button gradient.\n */\nexport function applyWaveformPlayerStyles(\n\tcontainer,\n\t{\n\t\tbackgroundColor,\n\t\tbackgroundGradient,\n\t\ttextColor,\n\t\tplayButtonColor,\n\t\tplayButtonGradient,\n\t} = {}\n) {\n\tconst waveformContainer = container.querySelector( '.waveform-container' );\n\tconst playButton = container.querySelector( '.waveform-btn' );\n\tconst playButtonBaseColor = getRepresentativeColor(\n\t\tgetResolvedGradientStops( container, playButtonGradient ) ||\n\t\t\tplayButtonColor\n\t);\n\n\tif ( playButtonBaseColor ) {\n\t\tcontainer.style.setProperty(\n\t\t\t'--wfp-button-color',\n\t\t\tplayButtonBaseColor\n\t\t);\n\t} else {\n\t\tcontainer.style.removeProperty( '--wfp-button-color' );\n\t}\n\n\tif ( textColor ) {\n\t\tcontainer.style.setProperty( '--wfp-text-color', textColor );\n\t\tcontainer.style.setProperty( '--wfp-text-secondary-color', textColor );\n\t} else {\n\t\tcontainer.style.removeProperty( '--wfp-text-color' );\n\t\tcontainer.style.removeProperty( '--wfp-text-secondary-color' );\n\t}\n\n\tif ( playButton ) {\n\t\tif ( playButtonGradient ) {\n\t\t\tplayButton.style.background = playButtonGradient;\n\t\t} else {\n\t\t\tplayButton.style.removeProperty( 'background' );\n\t\t}\n\t}\n\n\tif ( waveformContainer ) {\n\t\tif ( backgroundGradient ) {\n\t\t\twaveformContainer.style.background = backgroundGradient;\n\t\t} else if ( backgroundColor ) {\n\t\t\twaveformContainer.style.removeProperty( 'background' );\n\t\t\twaveformContainer.style.backgroundColor = backgroundColor;\n\t\t} else {\n\t\t\twaveformContainer.style.removeProperty( 'background' );\n\t\t\twaveformContainer.style.removeProperty( 'background-color' );\n\t\t}\n\t}\n}\n\n/**\n * Apply contrasting color to SVG icon paths for visibility.\n * The icons should contrast with the button background.\n *\n * @param {Element} container - The waveform container element.\n * @param {string} buttonColor - The button background color.\n */\nexport function styleSvgIcons( container, buttonColor ) {\n\t// Compute a contrasting color for the icons based on button brightness.\n\tconst isButtonDark = colord( buttonColor ).isDark();\n\tconst iconColor = isButtonDark ? '#ffffff' : '#000000';\n\n\tconst svgPaths = container.querySelectorAll( 'svg path' );\n\tsvgPaths.forEach( ( path ) => {\n\t\tpath.style.fill = iconColor;\n\t} );\n}\n\n/**\n * Set up play button accessibility: aria-label that toggles on play/pause.\n *\n * @param {Element} container - The waveform container element.\n * @param {Object} labels - Button labels.\n * @param {string} labels.play - Label for the play state.\n * @param {string} labels.pause - Label for the pause state.\n */\nexport function setupPlayButtonAccessibility(\n\tcontainer,\n\t{ play: playLabel = 'Play', pause: pauseLabel = 'Pause' } = {}\n) {\n\tconst playBtn = container.querySelector( '.waveform-btn' );\n\tif ( ! playBtn ) {\n\t\treturn;\n\t}\n\n\tplayBtn.setAttribute( 'aria-label', playLabel );\n\n\tconst onPlay = () => playBtn.setAttribute( 'aria-label', pauseLabel );\n\tconst onPause = () => playBtn.setAttribute( 'aria-label', playLabel );\n\n\tcontainer.addEventListener( 'waveformplayer:play', onPlay );\n\tcontainer.addEventListener( 'waveformplayer:pause', onPause );\n\tcontainer.addEventListener( 'waveformplayer:ended', onPause );\n\n\treturn () => {\n\t\tcontainer.removeEventListener( 'waveformplayer:play', onPlay );\n\t\tcontainer.removeEventListener( 'waveformplayer:pause', onPause );\n\t\tcontainer.removeEventListener( 'waveformplayer:ended', onPause );\n\t};\n}\n\n/**\n * Get the accessible label for the waveform seek control.\n *\n * @param {string} label - Accessible label for the seek control.\n * @return {string} The provided label or translated fallback.\n */\nfunction getSeekControlLabel( label ) {\n\treturn label || DEFAULT_SEEK_LABEL;\n}\n\n/**\n * Update the waveform seek control label.\n *\n * @param {Object} instance - The WaveformPlayer instance.\n * @param {string} label - Accessible label for the seek control.\n */\nexport function updateSeekControlLabel( instance, label ) {\n\tconst seekLabel = getSeekControlLabel( label );\n\tinstance.options.seekLabel = seekLabel;\n\tinstance.applySeekLabel?.( seekLabel );\n\n\tconst seekControl = instance?.container?.querySelector(\n\t\t'.waveform-container'\n\t);\n\n\tif ( seekControl ) {\n\t\tseekControl.setAttribute( 'aria-label', seekLabel );\n\t}\n}\n\n/**\n * Show the current artwork as the play button background.\n *\n * @param {Element} container - The waveform player container element.\n * @param {string} artworkUrl - The track image URL.\n */\nexport function setupPlayButtonArtwork( container, artworkUrl ) {\n\tif ( ! artworkUrl ) {\n\t\tcontainer.classList.remove( 'has-play-button-artwork' );\n\t\tcontainer.style.removeProperty( '--wp--playlist--play-button-artwork' );\n\t\treturn;\n\t}\n\n\tcontainer.classList.add( 'has-play-button-artwork' );\n\tcontainer.style.setProperty(\n\t\t'--wp--playlist--play-button-artwork',\n\t\t`url(${ JSON.stringify( artworkUrl ) })`\n\t);\n}\n\n/**\n * Log play errors, filtering out expected AbortError.\n *\n * @param {Error} error - The error from play().\n */\nexport function logPlayError( error ) {\n\t// The browser throws AbortError when a play() promise is interrupted\n\t// by a subsequent pause() or a new audio source load (track change).\n\t// This is normal during rapid user interaction and safe to ignore.\n\tif ( error.name === 'AbortError' ) {\n\t\treturn;\n\t}\n\t// eslint-disable-next-line no-console\n\tconsole.error( 'Playlist play error:', error );\n}\n\n/**\n * Initialize a WaveformPlayer instance on an element.\n *\n * This is the shared core logic used by both the React component (editor)\n * and the Interactivity API (frontend).\n *\n * @param {Element} element - The container element (must be in DOM).\n * @param {Object} options - Configuration options.\n * @param {string} options.src - The audio file URL.\n * @param {string} options.title - The track title.\n * @param {string} options.artist - The artist name.\n * @param {string} options.image - The track image URL.\n * @param {string} options.imageAlt - The track image alt text.\n * @param {string} options.waveformColor - The waveform color.\n * @param {string} options.waveformGradient - The waveform gradient.\n * @param {string} options.textColor - The player text color.\n * @param {string} options.backgroundColor - The player background color.\n * @param {string} options.backgroundGradient - The player background gradient.\n * @param {boolean} options.autoPlay - Whether to auto-play when ready.\n * @param {Function} options.onEnded - Callback when track ends.\n * @param {Object} options.labels - Translated button labels.\n * @param {string} options.waveformStyle - Waveform style (bars, mirror, line, blocks, dots, seekbar).\n * @param {boolean} options.showPlayButtonArtwork - Whether to show artwork on the play button.\n * @return {Object} Object with instance, container, and destroy function.\n */\nexport function initWaveformPlayer(\n\telement,\n\t{\n\t\tsrc,\n\t\ttitle,\n\t\tartist,\n\t\timage,\n\t\timageAlt,\n\t\twaveformColor: waveformColorValue,\n\t\twaveformGradient: waveformGradientValue,\n\t\ttextColor: textColorValue,\n\t\tbackgroundColor,\n\t\tbackgroundGradient,\n\t\tautoPlay,\n\t\tonEnded,\n\t\tlabels,\n\t\twaveformStyle,\n\t\tshowPlayButtonArtwork = false,\n\t}\n) {\n\tconst playerArtwork = showPlayButtonArtwork ? undefined : image;\n\n\t// Get colors from computed styles.\n\tconst { textColor, waveformColor, progressColor, waveformGradient } =\n\t\tgetWaveformColors(\n\t\t\telement,\n\t\t\twaveformColorValue,\n\t\t\ttextColorValue,\n\t\t\twaveformGradientValue\n\t\t);\n\tconst waveformGradientStops = getResolvedGradientStops(\n\t\telement,\n\t\twaveformGradientValue\n\t);\n\tconst waveformButtonColor = getRepresentativeColor(\n\t\twaveformGradientStops || waveformColorValue\n\t);\n\n\t// Create the waveform container.\n\tconst container = createWaveformContainer( {\n\t\turl: src,\n\t\ttitle,\n\t\tartist,\n\t\tartwork: playerArtwork,\n\t\twaveformColor,\n\t\tprogressColor,\n\t\twaveformGradient,\n\t\tbuttonColor: textColor,\n\t\tseekLabel: title || labels?.seek,\n\t\tseekValueText: labels?.seekValueText,\n\t\twaveformStyle,\n\t} );\n\telement.appendChild( container );\n\n\t// Initialize the WaveformPlayer library. The library reads the translated\n\t// seek label and value-text templates from the container's data attributes\n\t// and owns the seek slider's accessible label and value text.\n\tconst instance = new WaveformPlayerLib( container );\n\tif ( instance.artworkEl ) {\n\t\tinstance.artworkEl.alt = imageAlt || '';\n\t}\n\tapplyWaveformPlayerStyles( container, {\n\t\tbackgroundColor,\n\t\tbackgroundGradient,\n\t\ttextColor,\n\t\tplayButtonColor: showPlayButtonArtwork\n\t\t\t? undefined\n\t\t\t: waveformButtonColor,\n\t\tplayButtonGradient: showPlayButtonArtwork\n\t\t\t? undefined\n\t\t\t: waveformGradientValue,\n\t} );\n\n\t// Set up event handlers.\n\tlet cleanupPlayButtonAccessibility;\n\tconst handlers = {\n\t\tready: () => {\n\t\t\tstyleSvgIcons( container, waveformButtonColor || textColor );\n\t\t\tif ( showPlayButtonArtwork ) {\n\t\t\t\tsetupPlayButtonArtwork( container, image );\n\t\t\t}\n\t\t\tcleanupPlayButtonAccessibility = setupPlayButtonAccessibility(\n\t\t\t\tcontainer,\n\t\t\t\tlabels\n\t\t\t);\n\t\t\tif ( autoPlay ) {\n\t\t\t\tinstance.play()?.catch( logPlayError );\n\t\t\t}\n\t\t},\n\t\tended: () => onEnded?.(),\n\t};\n\n\tcontainer.addEventListener( 'waveformplayer:ready', handlers.ready );\n\tcontainer.addEventListener( 'waveformplayer:ended', handlers.ended );\n\n\t// Return instance, container, and cleanup function.\n\treturn {\n\t\tinstance,\n\t\tcontainer,\n\t\tdestroy: () => {\n\t\t\tcleanupPlayButtonAccessibility?.();\n\t\t\tcontainer.removeEventListener(\n\t\t\t\t'waveformplayer:ready',\n\t\t\t\thandlers.ready\n\t\t\t);\n\t\t\tcontainer.removeEventListener(\n\t\t\t\t'waveformplayer:ended',\n\t\t\t\thandlers.ended\n\t\t\t);\n\t\t\tinstance.destroy();\n\t\t\tcontainer.remove();\n\t\t},\n\t};\n}\n"],
5
+ "mappings": ";AAQA,SAAS,cAAc;AACvB,OAAO,uBAAuB;AAM9B,IAAM,0BAA0B;AAChC,IAAM,qBAAqB;AAQ3B,SAAS,iBAAkB,SAAU;AACpC,SAAO,QAAQ,cAAc,YAAY,iBAAkB,OAAQ;AACpE;AAEA,SAAS,yBAA0B,eAAgB;AAClD,QAAM,QAAQ,eAAe,KAAK,EAAE,MAAO,4BAA6B;AACxE,MAAK,CAAE,OAAQ;AACd,WAAO,CAAC;AAAA,EACT;AAEA,QAAM,QAAQ,CAAC;AACf,MAAI,QAAQ;AACZ,MAAI,UAAU;AAEd,aAAY,aAAa,MAAO,CAAE,GAAI;AACrC,QAAK,cAAc,KAAM;AACxB,QAAE;AAAA,IACH,WAAY,cAAc,KAAM;AAC/B,QAAE;AAAA,IACH;AAEA,QAAK,cAAc,OAAO,UAAU,GAAI;AACvC,YAAM,KAAM,QAAQ,KAAK,CAAE;AAC3B,gBAAU;AACV;AAAA,IACD;AAEA,eAAW;AAAA,EACZ;AAEA,MAAK,QAAQ,KAAK,GAAI;AACrB,UAAM,KAAM,QAAQ,KAAK,CAAE;AAAA,EAC5B;AAEA,SAAO;AACR;AAEA,SAAS,wBAAyB,OAAQ;AACzC,QAAM,QAAQ,MAAM,MAAO,aAAc;AACzC,MAAK,CAAE,OAAQ;AACd;AAAA,EACD;AAEA,QAAM,qBAAqB;AAAA,IAC1B;AAAA,IACA;AAAA,IACA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IACA;AAAA,IACA,iBAAiB,wBACd,SACA;AAAA,IACH,oBAAoB,wBACjB,SACA;AAAA,EACJ,CAAE;AAGF,MAAI;AACJ,QAAM,WAAW;AAAA,IAChB,OAAO,MAAM;AACZ,oBAAe,WAAW,uBAAuB,SAAU;AAC3D,UAAK,uBAAwB;AAC5B,+BAAwB,WAAW,KAAM;AAAA,MAC1C;AACA,uCAAiC;AAAA,QAChC;AAAA,QACA;AAAA,MACD;AACA,UAAK,UAAW;AACf,iBAAS,KAAK,GAAG,MAAO,YAAa;AAAA,MACtC;AAAA,IACD;AAAA,IACA,OAAO,MAAM,UAAU;AAAA,EACxB;AAEA,YAAU,iBAAkB,wBAAwB,SAAS,KAAM;AACnE,YAAU,iBAAkB,wBAAwB,SAAS,KAAM;AAGnE,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA,SAAS,MAAM;AACd,uCAAiC;AACjC,gBAAU;AAAA,QACT;AAAA,QACA,SAAS;AAAA,MACV;AACA,gBAAU;AAAA,QACT;AAAA,QACA,SAAS;AAAA,MACV;AACA,eAAS,QAAQ;AACjB,gBAAU,OAAO;AAAA,IAClB;AAAA,EACD;AACD;",
6
6
  "names": []
7
7
  }
@@ -21,8 +21,10 @@
21
21
  "background": {
22
22
  "backgroundImage": true,
23
23
  "backgroundSize": true,
24
+ "gradient": true,
24
25
  "__experimentalDefaultControls": {
25
- "backgroundImage": true
26
+ "backgroundImage": true,
27
+ "gradient": true
26
28
  }
27
29
  },
28
30
  "color": {
@@ -67,6 +67,12 @@
67
67
  "attribute": "src",
68
68
  "role": "content"
69
69
  },
70
+ "width": {
71
+ "type": "number"
72
+ },
73
+ "height": {
74
+ "type": "number"
75
+ },
70
76
  "playsInline": {
71
77
  "type": "boolean",
72
78
  "source": "attribute",
@@ -160,7 +160,6 @@ var VideoSettings = ({ setAttributes, attributes }) => {
160
160
  children: /* @__PURE__ */ jsx(
161
161
  SelectControl,
162
162
  {
163
- __next40pxDefaultSize: true,
164
163
  label: __("Preload"),
165
164
  value: preload,
166
165
  onChange: onChangePreload,