@wordpress/block-library 9.24.0 → 9.26.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 (300) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/avatar/edit.js +84 -39
  3. package/build/avatar/edit.js.map +1 -1
  4. package/build/avatar/user-control.js +32 -17
  5. package/build/avatar/user-control.js.map +1 -1
  6. package/build/button/edit.js +29 -17
  7. package/build/button/edit.js.map +1 -1
  8. package/build/columns/edit.js +18 -22
  9. package/build/columns/edit.js.map +1 -1
  10. package/build/comment-author-name/edit.js +41 -12
  11. package/build/comment-author-name/edit.js.map +1 -1
  12. package/build/comment-date/edit.js +41 -12
  13. package/build/comment-date/edit.js.map +1 -1
  14. package/build/comment-edit-link/edit.js +27 -7
  15. package/build/comment-edit-link/edit.js.map +1 -1
  16. package/build/comments/edit/comments-inspector-controls.js +1 -3
  17. package/build/comments/edit/comments-inspector-controls.js.map +1 -1
  18. package/build/comments-pagination/edit.js +23 -9
  19. package/build/comments-pagination/edit.js.map +1 -1
  20. package/build/comments-title/edit.js +41 -12
  21. package/build/comments-title/edit.js.map +1 -1
  22. package/build/details/edit.js +27 -3
  23. package/build/details/edit.js.map +1 -1
  24. package/build/embed/edit.js +2 -4
  25. package/build/embed/edit.js.map +1 -1
  26. package/build/embed/embed-controls.js +41 -22
  27. package/build/embed/embed-controls.js.map +1 -1
  28. package/build/embed/variations.js +0 -10
  29. package/build/embed/variations.js.map +1 -1
  30. package/build/file/inspector.js +73 -30
  31. package/build/file/inspector.js.map +1 -1
  32. package/build/form/edit.js +67 -38
  33. package/build/form/edit.js.map +1 -1
  34. package/build/form/index.js +3 -3
  35. package/build/form/index.js.map +1 -1
  36. package/build/form-input/edit.js +47 -18
  37. package/build/form-input/edit.js.map +1 -1
  38. package/build/form-input/index.js +2 -1
  39. package/build/form-input/index.js.map +1 -1
  40. package/build/form-submission-notification/index.js +2 -1
  41. package/build/form-submission-notification/index.js.map +1 -1
  42. package/build/form-submit-button/index.js +2 -1
  43. package/build/form-submit-button/index.js.map +1 -1
  44. package/build/image/image.js +1 -0
  45. package/build/image/image.js.map +1 -1
  46. package/build/image/view.js +0 -3
  47. package/build/image/view.js.map +1 -1
  48. package/build/latest-posts/edit.js +154 -82
  49. package/build/latest-posts/edit.js.map +1 -1
  50. package/build/list/ordered-list-settings.js +131 -52
  51. package/build/list/ordered-list-settings.js.map +1 -1
  52. package/build/navigation/edit/index.js +93 -51
  53. package/build/navigation/edit/index.js.map +1 -1
  54. package/build/navigation/edit/overlay-menu-preview.js +43 -27
  55. package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
  56. package/build/navigation-link/edit.js +11 -0
  57. package/build/navigation-link/edit.js.map +1 -1
  58. package/build/navigation-link/index.js +3 -0
  59. package/build/navigation-link/index.js.map +1 -1
  60. package/build/navigation-link/transforms.js +2 -0
  61. package/build/navigation-link/transforms.js.map +1 -1
  62. package/build/navigation-link/update-attributes.js +1 -0
  63. package/build/navigation-link/update-attributes.js.map +1 -1
  64. package/build/navigation-submenu/index.js +3 -0
  65. package/build/navigation-submenu/index.js.map +1 -1
  66. package/build/post-author/edit.js +75 -18
  67. package/build/post-author/edit.js.map +1 -1
  68. package/build/post-comments-count/index.js +3 -1
  69. package/build/post-comments-count/index.js.map +1 -1
  70. package/build/post-comments-count/transforms.js +26 -0
  71. package/build/post-comments-count/transforms.js.map +1 -0
  72. package/build/post-comments-link/index.js +3 -1
  73. package/build/post-comments-link/index.js.map +1 -1
  74. package/build/post-comments-link/transforms.js +26 -0
  75. package/build/post-comments-link/transforms.js.map +1 -0
  76. package/build/post-navigation-link/edit.js +72 -33
  77. package/build/post-navigation-link/edit.js.map +1 -1
  78. package/build/post-title/edit.js +56 -18
  79. package/build/post-title/edit.js.map +1 -1
  80. package/build/query/edit/enhanced-pagination-modal.js +1 -1
  81. package/build/query/edit/enhanced-pagination-modal.js.map +1 -1
  82. package/build/query/edit/inspector-controls/enhanced-pagination-control.js +3 -6
  83. package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  84. package/build/rss/edit.js +120 -46
  85. package/build/rss/edit.js.map +1 -1
  86. package/build/separator/edit.js +52 -20
  87. package/build/separator/edit.js.map +1 -1
  88. package/build/shortcode/index.js +2 -1
  89. package/build/shortcode/index.js.map +1 -1
  90. package/build/site-logo/edit.js +53 -19
  91. package/build/site-logo/edit.js.map +1 -1
  92. package/build/social-link/edit.js +21 -5
  93. package/build/social-link/edit.js.map +1 -1
  94. package/build/social-link/edit.native.js +13 -5
  95. package/build/social-link/edit.native.js.map +1 -1
  96. package/build/social-link/social-list.js +17 -25
  97. package/build/social-link/social-list.js.map +1 -1
  98. package/build/social-link/variations.js +53 -48
  99. package/build/social-link/variations.js.map +1 -1
  100. package/build/social-links/edit.js +38 -45
  101. package/build/social-links/edit.js.map +1 -1
  102. package/build/video/tracks-editor.js +63 -21
  103. package/build/video/tracks-editor.js.map +1 -1
  104. package/build-module/avatar/edit.js +83 -38
  105. package/build-module/avatar/edit.js.map +1 -1
  106. package/build-module/avatar/user-control.js +33 -18
  107. package/build-module/avatar/user-control.js.map +1 -1
  108. package/build-module/button/edit.js +30 -18
  109. package/build-module/button/edit.js.map +1 -1
  110. package/build-module/columns/edit.js +18 -22
  111. package/build-module/columns/edit.js.map +1 -1
  112. package/build-module/comment-author-name/edit.js +42 -13
  113. package/build-module/comment-author-name/edit.js.map +1 -1
  114. package/build-module/comment-date/edit.js +42 -13
  115. package/build-module/comment-date/edit.js.map +1 -1
  116. package/build-module/comment-edit-link/edit.js +28 -8
  117. package/build-module/comment-edit-link/edit.js.map +1 -1
  118. package/build-module/comments/edit/comments-inspector-controls.js +1 -3
  119. package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
  120. package/build-module/comments-pagination/edit.js +24 -10
  121. package/build-module/comments-pagination/edit.js.map +1 -1
  122. package/build-module/comments-title/edit.js +42 -13
  123. package/build-module/comments-title/edit.js.map +1 -1
  124. package/build-module/details/edit.js +29 -5
  125. package/build-module/details/edit.js.map +1 -1
  126. package/build-module/embed/edit.js +2 -4
  127. package/build-module/embed/edit.js.map +1 -1
  128. package/build-module/embed/embed-controls.js +42 -23
  129. package/build-module/embed/embed-controls.js.map +1 -1
  130. package/build-module/embed/variations.js +0 -10
  131. package/build-module/embed/variations.js.map +1 -1
  132. package/build-module/file/inspector.js +74 -31
  133. package/build-module/file/inspector.js.map +1 -1
  134. package/build-module/form/edit.js +68 -39
  135. package/build-module/form/edit.js.map +1 -1
  136. package/build-module/form/index.js +3 -3
  137. package/build-module/form/index.js.map +1 -1
  138. package/build-module/form-input/edit.js +48 -19
  139. package/build-module/form-input/edit.js.map +1 -1
  140. package/build-module/form-input/index.js +2 -1
  141. package/build-module/form-input/index.js.map +1 -1
  142. package/build-module/form-submission-notification/index.js +2 -1
  143. package/build-module/form-submission-notification/index.js.map +1 -1
  144. package/build-module/form-submit-button/index.js +2 -1
  145. package/build-module/form-submit-button/index.js.map +1 -1
  146. package/build-module/image/image.js +1 -0
  147. package/build-module/image/image.js.map +1 -1
  148. package/build-module/image/view.js +0 -3
  149. package/build-module/image/view.js.map +1 -1
  150. package/build-module/latest-posts/edit.js +155 -83
  151. package/build-module/latest-posts/edit.js.map +1 -1
  152. package/build-module/list/ordered-list-settings.js +132 -53
  153. package/build-module/list/ordered-list-settings.js.map +1 -1
  154. package/build-module/navigation/edit/index.js +94 -52
  155. package/build-module/navigation/edit/index.js.map +1 -1
  156. package/build-module/navigation/edit/overlay-menu-preview.js +44 -28
  157. package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
  158. package/build-module/navigation-link/edit.js +11 -0
  159. package/build-module/navigation-link/edit.js.map +1 -1
  160. package/build-module/navigation-link/index.js +3 -0
  161. package/build-module/navigation-link/index.js.map +1 -1
  162. package/build-module/navigation-link/transforms.js +2 -0
  163. package/build-module/navigation-link/transforms.js.map +1 -1
  164. package/build-module/navigation-link/update-attributes.js +1 -0
  165. package/build-module/navigation-link/update-attributes.js.map +1 -1
  166. package/build-module/navigation-submenu/index.js +3 -0
  167. package/build-module/navigation-submenu/index.js.map +1 -1
  168. package/build-module/post-author/edit.js +76 -19
  169. package/build-module/post-author/edit.js.map +1 -1
  170. package/build-module/post-comments-count/index.js +3 -1
  171. package/build-module/post-comments-count/index.js.map +1 -1
  172. package/build-module/post-comments-count/transforms.js +19 -0
  173. package/build-module/post-comments-count/transforms.js.map +1 -0
  174. package/build-module/post-comments-link/index.js +3 -1
  175. package/build-module/post-comments-link/index.js.map +1 -1
  176. package/build-module/post-comments-link/transforms.js +19 -0
  177. package/build-module/post-comments-link/transforms.js.map +1 -0
  178. package/build-module/post-navigation-link/edit.js +73 -34
  179. package/build-module/post-navigation-link/edit.js.map +1 -1
  180. package/build-module/post-title/edit.js +57 -19
  181. package/build-module/post-title/edit.js.map +1 -1
  182. package/build-module/query/edit/enhanced-pagination-modal.js +1 -1
  183. package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -1
  184. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +3 -6
  185. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  186. package/build-module/rss/edit.js +121 -47
  187. package/build-module/rss/edit.js.map +1 -1
  188. package/build-module/separator/edit.js +54 -22
  189. package/build-module/separator/edit.js.map +1 -1
  190. package/build-module/shortcode/index.js +2 -1
  191. package/build-module/shortcode/index.js.map +1 -1
  192. package/build-module/site-logo/edit.js +54 -20
  193. package/build-module/site-logo/edit.js.map +1 -1
  194. package/build-module/social-link/edit.js +24 -8
  195. package/build-module/social-link/edit.js.map +1 -1
  196. package/build-module/social-link/edit.native.js +15 -6
  197. package/build-module/social-link/edit.native.js.map +1 -1
  198. package/build-module/social-link/social-list.js +16 -21
  199. package/build-module/social-link/social-list.js.map +1 -1
  200. package/build-module/social-link/variations.js +53 -48
  201. package/build-module/social-link/variations.js.map +1 -1
  202. package/build-module/social-links/edit.js +40 -47
  203. package/build-module/social-links/edit.js.map +1 -1
  204. package/build-module/video/tracks-editor.js +65 -23
  205. package/build-module/video/tracks-editor.js.map +1 -1
  206. package/build-style/calendar/style-rtl.css +7 -7
  207. package/build-style/calendar/style.css +7 -7
  208. package/build-style/comments-pagination/editor-rtl.css +0 -12
  209. package/build-style/comments-pagination/editor.css +0 -14
  210. package/build-style/comments-pagination/style-rtl.css +0 -7
  211. package/build-style/comments-pagination/style.css +0 -9
  212. package/build-style/editor-rtl.css +9 -21
  213. package/build-style/editor.css +9 -23
  214. package/build-style/gallery/style-rtl.css +1 -0
  215. package/build-style/gallery/style.css +1 -0
  216. package/build-style/navigation/editor-rtl.css +8 -3
  217. package/build-style/navigation/editor.css +8 -3
  218. package/build-style/navigation/style-rtl.css +4 -0
  219. package/build-style/navigation/style.css +4 -0
  220. package/build-style/pullquote/editor-rtl.css +1 -1
  221. package/build-style/pullquote/editor.css +1 -1
  222. package/build-style/pullquote/style-rtl.css +2 -3
  223. package/build-style/pullquote/style.css +2 -3
  224. package/build-style/pullquote/theme-rtl.css +2 -2
  225. package/build-style/pullquote/theme.css +2 -2
  226. package/build-style/style-rtl.css +14 -17
  227. package/build-style/style.css +14 -19
  228. package/build-style/theme-rtl.css +2 -2
  229. package/build-style/theme.css +2 -2
  230. package/package.json +35 -35
  231. package/src/avatar/edit.js +99 -51
  232. package/src/avatar/user-control.js +34 -29
  233. package/src/button/edit.js +44 -29
  234. package/src/calendar/style.scss +10 -10
  235. package/src/columns/edit.js +20 -31
  236. package/src/comment-author-name/edit.js +54 -13
  237. package/src/comment-date/edit.js +50 -15
  238. package/src/comment-edit-link/edit.js +39 -11
  239. package/src/comments/edit/comments-inspector-controls.js +0 -2
  240. package/src/comments-pagination/edit.js +29 -9
  241. package/src/comments-pagination/editor.scss +0 -15
  242. package/src/comments-pagination/style.scss +0 -8
  243. package/src/comments-title/edit.js +53 -15
  244. package/src/details/edit.js +36 -4
  245. package/src/editor.scss +0 -1
  246. package/src/embed/edit.js +3 -5
  247. package/src/embed/embed-controls.js +55 -33
  248. package/src/embed/variations.js +0 -8
  249. package/src/file/inspector.js +99 -45
  250. package/src/form/block.json +1 -2
  251. package/src/form/edit.js +91 -47
  252. package/src/form/index.js +1 -0
  253. package/src/form-input/edit.js +56 -18
  254. package/src/form-input/index.js +1 -0
  255. package/src/form-submission-notification/index.js +1 -0
  256. package/src/form-submit-button/index.js +1 -0
  257. package/src/gallery/style.scss +1 -0
  258. package/src/image/image.js +1 -0
  259. package/src/image/index.php +4 -1
  260. package/src/image/view.js +0 -3
  261. package/src/latest-posts/edit.js +206 -98
  262. package/src/list/ordered-list-settings.js +172 -62
  263. package/src/navigation/edit/index.js +127 -64
  264. package/src/navigation/edit/overlay-menu-preview.js +43 -26
  265. package/src/navigation/editor.scss +8 -4
  266. package/src/navigation/style.scss +8 -0
  267. package/src/navigation-link/block.json +3 -0
  268. package/src/navigation-link/edit.js +14 -1
  269. package/src/navigation-link/index.php +4 -0
  270. package/src/navigation-link/transforms.js +2 -1
  271. package/src/navigation-link/update-attributes.js +1 -0
  272. package/src/navigation-submenu/block.json +3 -0
  273. package/src/navigation-submenu/index.php +4 -0
  274. package/src/post-author/edit.js +91 -27
  275. package/src/post-comments-count/index.js +2 -0
  276. package/src/post-comments-count/transforms.js +20 -0
  277. package/src/post-comments-link/index.js +2 -0
  278. package/src/post-comments-link/transforms.js +20 -0
  279. package/src/post-navigation-link/edit.js +96 -51
  280. package/src/post-title/edit.js +76 -24
  281. package/src/pullquote/editor.scss +1 -1
  282. package/src/pullquote/style.scss +2 -3
  283. package/src/pullquote/theme.scss +2 -2
  284. package/src/query/edit/enhanced-pagination-modal.js +1 -5
  285. package/src/query/edit/inspector-controls/enhanced-pagination-control.js +3 -13
  286. package/src/rss/edit.js +141 -55
  287. package/src/separator/edit.js +66 -21
  288. package/src/shortcode/block.json +2 -1
  289. package/src/site-logo/edit.js +69 -26
  290. package/src/site-title/index.php +1 -1
  291. package/src/social-link/edit.js +18 -7
  292. package/src/social-link/edit.native.js +10 -4
  293. package/src/social-link/index.php +62 -49
  294. package/src/social-link/social-list.js +15 -20
  295. package/src/social-link/variations.js +53 -48
  296. package/src/social-links/edit.js +38 -60
  297. package/src/video/tracks-editor.js +75 -22
  298. package/build-style/post-author/editor-rtl.css +0 -140
  299. package/build-style/post-author/editor.css +0 -140
  300. package/src/post-author/editor.scss +0 -7
@@ -1,3 +1,8 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+
1
6
  /**
2
7
  * Internal dependencies
3
8
  */
@@ -57,292 +62,292 @@ const variations = [
57
62
  isDefault: true,
58
63
  name: 'wordpress',
59
64
  attributes: { service: 'wordpress' },
60
- title: 'WordPress',
65
+ title: __( 'WordPress' ),
61
66
  icon: WordPressIcon,
62
67
  },
63
68
 
64
69
  {
65
70
  name: 'fivehundredpx',
66
71
  attributes: { service: 'fivehundredpx' },
67
- title: '500px',
72
+ title: __( '500px' ),
68
73
  icon: FivehundredpxIcon,
69
74
  },
70
75
  {
71
76
  name: 'amazon',
72
77
  attributes: { service: 'amazon' },
73
- title: 'Amazon',
78
+ title: __( 'Amazon' ),
74
79
  icon: AmazonIcon,
75
80
  },
76
81
  {
77
82
  name: 'bandcamp',
78
83
  attributes: { service: 'bandcamp' },
79
- title: 'Bandcamp',
84
+ title: __( 'Bandcamp' ),
80
85
  icon: BandcampIcon,
81
86
  },
82
87
  {
83
88
  name: 'behance',
84
89
  attributes: { service: 'behance' },
85
- title: 'Behance',
90
+ title: __( 'Behance' ),
86
91
  icon: BehanceIcon,
87
92
  },
88
93
  {
89
94
  name: 'bluesky',
90
95
  attributes: { service: 'bluesky' },
91
- title: 'Bluesky',
96
+ title: __( 'Bluesky' ),
92
97
  icon: BlueskyIcon,
93
98
  },
94
99
  {
95
100
  name: 'chain',
96
101
  attributes: { service: 'chain' },
97
- title: 'Link',
102
+ title: __( 'Link' ),
98
103
  icon: ChainIcon,
99
104
  },
100
105
  {
101
106
  name: 'codepen',
102
107
  attributes: { service: 'codepen' },
103
- title: 'CodePen',
108
+ title: __( 'CodePen' ),
104
109
  icon: CodepenIcon,
105
110
  },
106
111
  {
107
112
  name: 'deviantart',
108
113
  attributes: { service: 'deviantart' },
109
- title: 'DeviantArt',
114
+ title: __( 'DeviantArt' ),
110
115
  icon: DeviantArtIcon,
111
116
  },
112
117
  {
113
118
  name: 'discord',
114
119
  attributes: { service: 'discord' },
115
- title: 'Discord',
120
+ title: __( 'Discord' ),
116
121
  icon: DiscordIcon,
117
122
  },
118
123
  {
119
124
  name: 'dribbble',
120
125
  attributes: { service: 'dribbble' },
121
- title: 'Dribbble',
126
+ title: __( 'Dribbble' ),
122
127
  icon: DribbbleIcon,
123
128
  },
124
129
  {
125
130
  name: 'dropbox',
126
131
  attributes: { service: 'dropbox' },
127
- title: 'Dropbox',
132
+ title: __( 'Dropbox' ),
128
133
  icon: DropboxIcon,
129
134
  },
130
135
  {
131
136
  name: 'etsy',
132
137
  attributes: { service: 'etsy' },
133
- title: 'Etsy',
138
+ title: __( 'Etsy' ),
134
139
  icon: EtsyIcon,
135
140
  },
136
141
  {
137
142
  name: 'facebook',
138
143
  attributes: { service: 'facebook' },
139
- title: 'Facebook',
144
+ title: __( 'Facebook' ),
140
145
  icon: FacebookIcon,
141
146
  },
142
147
  {
143
148
  name: 'feed',
144
149
  attributes: { service: 'feed' },
145
- title: 'RSS Feed',
150
+ title: __( 'RSS Feed' ),
146
151
  icon: FeedIcon,
147
152
  },
148
153
  {
149
154
  name: 'flickr',
150
155
  attributes: { service: 'flickr' },
151
- title: 'Flickr',
156
+ title: __( 'Flickr' ),
152
157
  icon: FlickrIcon,
153
158
  },
154
159
  {
155
160
  name: 'foursquare',
156
161
  attributes: { service: 'foursquare' },
157
- title: 'Foursquare',
162
+ title: __( 'Foursquare' ),
158
163
  icon: FoursquareIcon,
159
164
  },
160
165
  {
161
166
  name: 'goodreads',
162
167
  attributes: { service: 'goodreads' },
163
- title: 'Goodreads',
168
+ title: __( 'Goodreads' ),
164
169
  icon: GoodreadsIcon,
165
170
  },
166
171
  {
167
172
  name: 'google',
168
173
  attributes: { service: 'google' },
169
- title: 'Google',
174
+ title: __( 'Google' ),
170
175
  icon: GoogleIcon,
171
176
  },
172
177
  {
173
178
  name: 'github',
174
179
  attributes: { service: 'github' },
175
- title: 'GitHub',
180
+ title: __( 'GitHub' ),
176
181
  icon: GitHubIcon,
177
182
  },
178
183
  {
179
184
  name: 'gravatar',
180
185
  attributes: { service: 'gravatar' },
181
- title: 'Gravatar',
186
+ title: __( 'Gravatar' ),
182
187
  icon: GravatarIcon,
183
188
  },
184
189
  {
185
190
  name: 'instagram',
186
191
  attributes: { service: 'instagram' },
187
- title: 'Instagram',
192
+ title: __( 'Instagram' ),
188
193
  icon: InstagramIcon,
189
194
  },
190
195
  {
191
196
  name: 'lastfm',
192
197
  attributes: { service: 'lastfm' },
193
- title: 'Last.fm',
198
+ title: __( 'Last.fm' ),
194
199
  icon: LastfmIcon,
195
200
  },
196
201
  {
197
202
  name: 'linkedin',
198
203
  attributes: { service: 'linkedin' },
199
- title: 'LinkedIn',
204
+ title: __( 'LinkedIn' ),
200
205
  icon: LinkedInIcon,
201
206
  },
202
207
  {
203
208
  name: 'mail',
204
209
  attributes: { service: 'mail' },
205
- title: 'Mail',
210
+ title: __( 'Mail' ),
206
211
  keywords: [ 'email', 'e-mail' ],
207
212
  icon: MailIcon,
208
213
  },
209
214
  {
210
215
  name: 'mastodon',
211
216
  attributes: { service: 'mastodon' },
212
- title: 'Mastodon',
217
+ title: __( 'Mastodon' ),
213
218
  icon: MastodonIcon,
214
219
  },
215
220
  {
216
221
  name: 'meetup',
217
222
  attributes: { service: 'meetup' },
218
- title: 'Meetup',
223
+ title: __( 'Meetup' ),
219
224
  icon: MeetupIcon,
220
225
  },
221
226
  {
222
227
  name: 'medium',
223
228
  attributes: { service: 'medium' },
224
- title: 'Medium',
229
+ title: __( 'Medium' ),
225
230
  icon: MediumIcon,
226
231
  },
227
232
  {
228
233
  name: 'patreon',
229
234
  attributes: { service: 'patreon' },
230
- title: 'Patreon',
235
+ title: __( 'Patreon' ),
231
236
  icon: PatreonIcon,
232
237
  },
233
238
  {
234
239
  name: 'pinterest',
235
240
  attributes: { service: 'pinterest' },
236
- title: 'Pinterest',
241
+ title: __( 'Pinterest' ),
237
242
  icon: PinterestIcon,
238
243
  },
239
244
  {
240
245
  name: 'pocket',
241
246
  attributes: { service: 'pocket' },
242
- title: 'Pocket',
247
+ title: __( 'Pocket' ),
243
248
  icon: PocketIcon,
244
249
  },
245
250
  {
246
251
  name: 'reddit',
247
252
  attributes: { service: 'reddit' },
248
- title: 'Reddit',
253
+ title: __( 'Reddit' ),
249
254
  icon: RedditIcon,
250
255
  },
251
256
  {
252
257
  name: 'skype',
253
258
  attributes: { service: 'skype' },
254
- title: 'Skype',
259
+ title: __( 'Skype' ),
255
260
  icon: SkypeIcon,
256
261
  },
257
262
  {
258
263
  name: 'snapchat',
259
264
  attributes: { service: 'snapchat' },
260
- title: 'Snapchat',
265
+ title: __( 'Snapchat' ),
261
266
  icon: SnapchatIcon,
262
267
  },
263
268
  {
264
269
  name: 'soundcloud',
265
270
  attributes: { service: 'soundcloud' },
266
- title: 'SoundCloud',
271
+ title: __( 'SoundCloud' ),
267
272
  icon: SoundCloudIcon,
268
273
  },
269
274
  {
270
275
  name: 'spotify',
271
276
  attributes: { service: 'spotify' },
272
- title: 'Spotify',
277
+ title: __( 'Spotify' ),
273
278
  icon: SpotifyIcon,
274
279
  },
275
280
  {
276
281
  name: 'telegram',
277
282
  attributes: { service: 'telegram' },
278
- title: 'Telegram',
283
+ title: __( 'Telegram' ),
279
284
  icon: TelegramIcon,
280
285
  },
281
286
  {
282
287
  name: 'threads',
283
288
  attributes: { service: 'threads' },
284
- title: 'Threads',
289
+ title: __( 'Threads' ),
285
290
  icon: ThreadsIcon,
286
291
  },
287
292
  {
288
293
  name: 'tiktok',
289
294
  attributes: { service: 'tiktok' },
290
- title: 'TikTok',
295
+ title: __( 'TikTok' ),
291
296
  icon: TiktokIcon,
292
297
  },
293
298
  {
294
299
  name: 'tumblr',
295
300
  attributes: { service: 'tumblr' },
296
- title: 'Tumblr',
301
+ title: __( 'Tumblr' ),
297
302
  icon: TumblrIcon,
298
303
  },
299
304
  {
300
305
  name: 'twitch',
301
306
  attributes: { service: 'twitch' },
302
- title: 'Twitch',
307
+ title: __( 'Twitch' ),
303
308
  icon: TwitchIcon,
304
309
  },
305
310
  {
306
311
  name: 'twitter',
307
312
  attributes: { service: 'twitter' },
308
- title: 'Twitter',
313
+ title: __( 'Twitter' ),
309
314
  icon: TwitterIcon,
310
315
  },
311
316
  {
312
317
  name: 'vimeo',
313
318
  attributes: { service: 'vimeo' },
314
- title: 'Vimeo',
319
+ title: __( 'Vimeo' ),
315
320
  icon: VimeoIcon,
316
321
  },
317
322
  {
318
323
  name: 'vk',
319
324
  attributes: { service: 'vk' },
320
- title: 'VK',
325
+ title: __( 'VK' ),
321
326
  icon: VkIcon,
322
327
  },
323
328
  {
324
329
  name: 'whatsapp',
325
330
  attributes: { service: 'whatsapp' },
326
- title: 'WhatsApp',
331
+ title: __( 'WhatsApp' ),
327
332
  icon: WhatsAppIcon,
328
333
  },
329
334
  {
330
335
  name: 'x',
331
336
  attributes: { service: 'x' },
332
337
  keywords: [ 'twitter' ],
333
- title: 'X',
338
+ title: __( 'X' ),
334
339
  icon: XIcon,
335
340
  },
336
341
  {
337
342
  name: 'yelp',
338
343
  attributes: { service: 'yelp' },
339
- title: 'Yelp',
344
+ title: __( 'Yelp' ),
340
345
  icon: YelpIcon,
341
346
  },
342
347
  {
343
348
  name: 'youtube',
344
349
  attributes: { service: 'youtube' },
345
- title: 'YouTube',
350
+ title: __( 'YouTube' ),
346
351
  icon: YouTubeIcon,
347
352
  },
348
353
  ];
@@ -8,7 +8,6 @@ import clsx from 'clsx';
8
8
  */
9
9
  import { useEffect } from '@wordpress/element';
10
10
  import {
11
- BlockControls,
12
11
  useInnerBlocksProps,
13
12
  useBlockProps,
14
13
  InspectorControls,
@@ -20,15 +19,12 @@ import {
20
19
  store as blockEditorStore,
21
20
  } from '@wordpress/block-editor';
22
21
  import {
23
- MenuGroup,
24
- MenuItem,
25
22
  ToggleControl,
26
- ToolbarDropdownMenu,
23
+ SelectControl,
27
24
  __experimentalToolsPanel as ToolsPanel,
28
25
  __experimentalToolsPanelItem as ToolsPanelItem,
29
26
  } from '@wordpress/components';
30
27
  import { __ } from '@wordpress/i18n';
31
- import { check } from '@wordpress/icons';
32
28
  import { useSelect } from '@wordpress/data';
33
29
 
34
30
  /**
@@ -37,10 +33,11 @@ import { useSelect } from '@wordpress/data';
37
33
  import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
38
34
 
39
35
  const sizeOptions = [
40
- { name: __( 'Small' ), value: 'has-small-icon-size' },
41
- { name: __( 'Normal' ), value: 'has-normal-icon-size' },
42
- { name: __( 'Large' ), value: 'has-large-icon-size' },
43
- { name: __( 'Huge' ), value: 'has-huge-icon-size' },
36
+ { label: __( 'Default' ), value: '' },
37
+ { label: __( 'Small' ), value: 'has-small-icon-size' },
38
+ { label: __( 'Normal' ), value: 'has-normal-icon-size' },
39
+ { label: __( 'Large' ), value: 'has-large-icon-size' },
40
+ { label: __( 'Huge' ), value: 'has-huge-icon-size' },
44
41
  ];
45
42
 
46
43
  export function SocialLinksEdit( props ) {
@@ -123,10 +120,6 @@ export function SocialLinksEdit( props ) {
123
120
  : undefined,
124
121
  } );
125
122
 
126
- const POPOVER_PROPS = {
127
- position: 'bottom right',
128
- };
129
-
130
123
  const colorSettings = [
131
124
  {
132
125
  // Use custom attribute as fallback to prevent loss of named color selection when
@@ -167,43 +160,6 @@ export function SocialLinksEdit( props ) {
167
160
 
168
161
  return (
169
162
  <>
170
- <BlockControls group="other">
171
- <ToolbarDropdownMenu
172
- label={ __( 'Size' ) }
173
- text={ __( 'Size' ) }
174
- icon={ null }
175
- popoverProps={ POPOVER_PROPS }
176
- >
177
- { ( { onClose } ) => (
178
- <MenuGroup>
179
- { sizeOptions.map( ( entry ) => {
180
- return (
181
- <MenuItem
182
- icon={
183
- ( size === entry.value ||
184
- ( ! size &&
185
- entry.value ===
186
- 'has-normal-icon-size' ) ) &&
187
- check
188
- }
189
- isSelected={ size === entry.value }
190
- key={ entry.value }
191
- onClick={ () => {
192
- setAttributes( {
193
- size: entry.value,
194
- } );
195
- } }
196
- onClose={ onClose }
197
- role="menuitemradio"
198
- >
199
- { entry.name }
200
- </MenuItem>
201
- );
202
- } ) }
203
- </MenuGroup>
204
- ) }
205
- </ToolbarDropdownMenu>
206
- </BlockControls>
207
163
  <InspectorControls>
208
164
  <ToolsPanel
209
165
  label={ __( 'Settings' ) }
@@ -211,27 +167,30 @@ export function SocialLinksEdit( props ) {
211
167
  setAttributes( {
212
168
  openInNewTab: false,
213
169
  showLabels: false,
170
+ size: undefined,
214
171
  } );
215
172
  } }
216
173
  dropdownMenuProps={ dropdownMenuProps }
217
174
  >
218
175
  <ToolsPanelItem
219
176
  isShownByDefault
220
- label={ __( 'Open links in new tab' ) }
221
- hasValue={ () => !! openInNewTab }
177
+ hasValue={ () => !! size }
178
+ label={ __( 'Icon size' ) }
222
179
  onDeselect={ () =>
223
- setAttributes( { openInNewTab: false } )
180
+ setAttributes( { size: undefined } )
224
181
  }
225
182
  >
226
- <ToggleControl
183
+ <SelectControl
184
+ __next40pxDefaultSize
227
185
  __nextHasNoMarginBottom
228
- label={ __( 'Open links in new tab' ) }
229
- checked={ openInNewTab }
230
- onChange={ () =>
186
+ label={ __( 'Icon Size' ) }
187
+ onChange={ ( newSize ) => {
231
188
  setAttributes( {
232
- openInNewTab: ! openInNewTab,
233
- } )
234
- }
189
+ size: newSize === '' ? undefined : newSize,
190
+ } );
191
+ } }
192
+ value={ size ?? '' }
193
+ options={ sizeOptions }
235
194
  />
236
195
  </ToolsPanelItem>
237
196
  <ToolsPanelItem
@@ -251,6 +210,25 @@ export function SocialLinksEdit( props ) {
251
210
  }
252
211
  />
253
212
  </ToolsPanelItem>
213
+ <ToolsPanelItem
214
+ isShownByDefault
215
+ label={ __( 'Open links in new tab' ) }
216
+ hasValue={ () => !! openInNewTab }
217
+ onDeselect={ () =>
218
+ setAttributes( { openInNewTab: false } )
219
+ }
220
+ >
221
+ <ToggleControl
222
+ __nextHasNoMarginBottom
223
+ label={ __( 'Open links in new tab' ) }
224
+ checked={ openInNewTab }
225
+ onChange={ () =>
226
+ setAttributes( {
227
+ openInNewTab: ! openInNewTab,
228
+ } )
229
+ }
230
+ />
231
+ </ToolsPanelItem>
254
232
  </ToolsPanel>
255
233
  </InspectorControls>
256
234
  { colorGradientSettings.hasColorsOrGradients && (
@@ -13,20 +13,30 @@ import {
13
13
  Button,
14
14
  TextControl,
15
15
  SelectControl,
16
+ ToggleControl,
16
17
  __experimentalGrid as Grid,
17
18
  __experimentalHStack as HStack,
18
19
  __experimentalVStack as VStack,
20
+ privateApis as componentsPrivateApis,
19
21
  } from '@wordpress/components';
20
22
  import {
21
23
  MediaUpload,
22
24
  MediaUploadCheck,
23
25
  store as blockEditorStore,
24
26
  } from '@wordpress/block-editor';
27
+ import { store as noticesStore } from '@wordpress/notices';
25
28
  import { upload, media } from '@wordpress/icons';
26
- import { useSelect } from '@wordpress/data';
29
+ import { useSelect, useDispatch } from '@wordpress/data';
27
30
  import { useState, useRef, useEffect } from '@wordpress/element';
28
31
  import { getFilename } from '@wordpress/url';
29
32
 
33
+ /**
34
+ * Internal dependencies
35
+ */
36
+ import { unlock } from '../lock-unlock';
37
+
38
+ const { Badge } = unlock( componentsPrivateApis );
39
+
30
40
  const ALLOWED_TYPES = [ 'text/vtt' ];
31
41
 
32
42
  const DEFAULT_KIND = 'subtitles';
@@ -43,22 +53,25 @@ function TrackList( { tracks, onEditPress } ) {
43
53
  const content = tracks.map( ( track, index ) => {
44
54
  return (
45
55
  <HStack
46
- key={ index }
56
+ key={ track.src }
47
57
  className="block-library-video-tracks-editor__track-list-track"
48
58
  >
49
59
  <span>{ track.label }</span>
50
- <Button
51
- __next40pxDefaultSize
52
- variant="tertiary"
53
- onClick={ () => onEditPress( index ) }
54
- aria-label={ sprintf(
55
- /* translators: %s: Label of the video text track e.g: "French subtitles". */
56
- _x( 'Edit %s', 'text tracks' ),
57
- track.label
58
- ) }
59
- >
60
- { __( 'Edit' ) }
61
- </Button>
60
+ <HStack justify="flex-end">
61
+ { track.default && <Badge>{ __( 'Default' ) }</Badge> }
62
+ <Button
63
+ __next40pxDefaultSize
64
+ variant="tertiary"
65
+ onClick={ () => onEditPress( index ) }
66
+ aria-label={ sprintf(
67
+ /* translators: %s: Label of the video text track e.g: "French subtitles". */
68
+ _x( 'Edit %s', 'text tracks' ),
69
+ track.label
70
+ ) }
71
+ >
72
+ { __( 'Edit' ) }
73
+ </Button>
74
+ </HStack>
62
75
  </HStack>
63
76
  );
64
77
  } );
@@ -73,8 +86,20 @@ function TrackList( { tracks, onEditPress } ) {
73
86
  );
74
87
  }
75
88
 
76
- function SingleTrackEditor( { track, onChange, onClose, onRemove } ) {
77
- const { src = '', label = '', srcLang = '', kind = DEFAULT_KIND } = track;
89
+ function SingleTrackEditor( {
90
+ track,
91
+ onChange,
92
+ onClose,
93
+ onRemove,
94
+ allowSettingDefault,
95
+ } ) {
96
+ const {
97
+ src = '',
98
+ label = '',
99
+ srcLang = '',
100
+ kind = DEFAULT_KIND,
101
+ default: isDefaultTrack = false,
102
+ } = track;
78
103
  const fileName = src.startsWith( 'blob:' ) ? '' : getFilename( src ) || '';
79
104
  return (
80
105
  <VStack
@@ -115,7 +140,7 @@ function SingleTrackEditor( { track, onChange, onClose, onRemove } ) {
115
140
  help={ __( 'Language tag (en, fr, etc.)' ) }
116
141
  />
117
142
  </Grid>
118
- <VStack spacing="8">
143
+ <VStack spacing="4">
119
144
  <SelectControl
120
145
  __next40pxDefaultSize
121
146
  __nextHasNoMarginBottom
@@ -130,6 +155,19 @@ function SingleTrackEditor( { track, onChange, onClose, onRemove } ) {
130
155
  } );
131
156
  } }
132
157
  />
158
+ <ToggleControl
159
+ __next40pxDefaultSize
160
+ __nextHasNoMarginBottom
161
+ label={ __( 'Set as default track' ) }
162
+ checked={ isDefaultTrack }
163
+ disabled={ ! allowSettingDefault }
164
+ onChange={ ( defaultTrack ) => {
165
+ onChange( {
166
+ ...track,
167
+ default: defaultTrack,
168
+ } );
169
+ } }
170
+ />
133
171
  <HStack className="block-library-video-tracks-editor__single-track-editor-buttons-container">
134
172
  <Button
135
173
  __next40pxDefaultSize
@@ -175,12 +213,27 @@ function SingleTrackEditor( { track, onChange, onClose, onRemove } ) {
175
213
  }
176
214
 
177
215
  export default function TracksEditor( { tracks = [], onChange } ) {
216
+ const { createNotice } = useDispatch( noticesStore );
178
217
  const mediaUpload = useSelect( ( select ) => {
179
218
  return select( blockEditorStore ).getSettings().mediaUpload;
180
219
  }, [] );
181
220
  const [ trackBeingEdited, setTrackBeingEdited ] = useState( null );
182
221
  const dropdownPopoverRef = useRef();
183
222
 
223
+ const handleTrackSelect = ( { title, url } ) => {
224
+ if ( tracks.some( ( track ) => track.src === url ) ) {
225
+ createNotice( 'error', __( 'This track already exists.' ), {
226
+ isDismissible: true,
227
+ type: 'snackbar',
228
+ } );
229
+ return;
230
+ }
231
+
232
+ const trackIndex = tracks.length;
233
+ onChange( [ ...tracks, { label: title || '', src: url } ] );
234
+ setTrackBeingEdited( trackIndex );
235
+ };
236
+
184
237
  useEffect( () => {
185
238
  dropdownPopoverRef.current?.focus();
186
239
  }, [ trackBeingEdited ] );
@@ -237,6 +290,10 @@ export default function TracksEditor( { tracks = [], onChange } ) {
237
290
  );
238
291
  setTrackBeingEdited( null );
239
292
  } }
293
+ allowSettingDefault={
294
+ ! tracks.some( ( track ) => track.default ) ||
295
+ tracks[ trackBeingEdited ].default
296
+ }
240
297
  />
241
298
  );
242
299
  }
@@ -265,11 +322,7 @@ export default function TracksEditor( { tracks = [], onChange } ) {
265
322
  label={ __( 'Add tracks' ) }
266
323
  >
267
324
  <MediaUpload
268
- onSelect={ ( { url } ) => {
269
- const trackIndex = tracks.length;
270
- onChange( [ ...tracks, { src: url } ] );
271
- setTrackBeingEdited( trackIndex );
272
- } }
325
+ onSelect={ handleTrackSelect }
273
326
  allowedTypes={ ALLOWED_TYPES }
274
327
  render={ ( { open } ) => (
275
328
  <MenuItem