@wordpress/block-library 9.40.2-next.v.202602271551.0 → 9.41.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 (89) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/button/block.json +11 -3
  3. package/build/button/deprecated.cjs +246 -13
  4. package/build/button/deprecated.cjs.map +2 -2
  5. package/build/button/edit.cjs +45 -58
  6. package/build/button/edit.cjs.map +3 -3
  7. package/build/button/save.cjs +3 -7
  8. package/build/button/save.cjs.map +2 -2
  9. package/build/button/utils.cjs +59 -0
  10. package/build/button/utils.cjs.map +7 -0
  11. package/build/image/image.cjs +1 -1
  12. package/build/image/image.cjs.map +2 -2
  13. package/build/navigation-link/shared/use-link-preview.cjs +2 -2
  14. package/build/navigation-link/shared/use-link-preview.cjs.map +2 -2
  15. package/build/playlist/edit.cjs +43 -136
  16. package/build/playlist/edit.cjs.map +3 -3
  17. package/build/playlist/view.cjs +56 -38
  18. package/build/playlist/view.cjs.map +2 -2
  19. package/build/playlist-track/edit.cjs +0 -1
  20. package/build/playlist-track/edit.cjs.map +2 -2
  21. package/build/post-title/block.json +3 -0
  22. package/build/post-title/edit.cjs +2 -2
  23. package/build/post-title/edit.cjs.map +2 -2
  24. package/build/utils/waveform-player.cjs +68 -0
  25. package/build/utils/waveform-player.cjs.map +7 -0
  26. package/build/utils/waveform-utils.cjs +171 -0
  27. package/build/utils/waveform-utils.cjs.map +7 -0
  28. package/build-module/button/block.json +11 -3
  29. package/build-module/button/deprecated.mjs +246 -13
  30. package/build-module/button/deprecated.mjs.map +2 -2
  31. package/build-module/button/edit.mjs +47 -63
  32. package/build-module/button/edit.mjs.map +2 -2
  33. package/build-module/button/save.mjs +3 -7
  34. package/build-module/button/save.mjs.map +2 -2
  35. package/build-module/button/utils.mjs +33 -0
  36. package/build-module/button/utils.mjs.map +7 -0
  37. package/build-module/image/image.mjs +1 -1
  38. package/build-module/image/image.mjs.map +2 -2
  39. package/build-module/navigation-link/shared/use-link-preview.mjs +2 -2
  40. package/build-module/navigation-link/shared/use-link-preview.mjs.map +2 -2
  41. package/build-module/playlist/edit.mjs +41 -139
  42. package/build-module/playlist/edit.mjs.map +2 -2
  43. package/build-module/playlist/view.mjs +56 -38
  44. package/build-module/playlist/view.mjs.map +2 -2
  45. package/build-module/playlist-track/edit.mjs +0 -1
  46. package/build-module/playlist-track/edit.mjs.map +2 -2
  47. package/build-module/post-title/block.json +3 -0
  48. package/build-module/post-title/edit.mjs +2 -2
  49. package/build-module/post-title/edit.mjs.map +2 -2
  50. package/build-module/utils/waveform-player.mjs +43 -0
  51. package/build-module/utils/waveform-player.mjs.map +7 -0
  52. package/build-module/utils/waveform-utils.mjs +131 -0
  53. package/build-module/utils/waveform-utils.mjs.map +7 -0
  54. package/build-style/button/style-rtl.css +6 -0
  55. package/build-style/button/style.css +6 -0
  56. package/build-style/editor-rtl.css +3 -3
  57. package/build-style/editor.css +3 -3
  58. package/build-style/playlist/editor-rtl.css +3 -3
  59. package/build-style/playlist/editor.css +3 -3
  60. package/build-style/playlist/style-rtl.css +351 -17
  61. package/build-style/playlist/style.css +351 -17
  62. package/build-style/style-rtl.css +357 -17
  63. package/build-style/style.css +357 -17
  64. package/package.json +39 -38
  65. package/src/button/block.json +11 -3
  66. package/src/button/deprecated.js +254 -16
  67. package/src/button/edit.js +50 -61
  68. package/src/button/index.php +68 -0
  69. package/src/button/save.js +2 -8
  70. package/src/button/style.scss +49 -7
  71. package/src/button/test/utils.js +84 -0
  72. package/src/button/utils.js +42 -0
  73. package/src/image/image.js +14 -15
  74. package/src/image/index.php +3 -1
  75. package/src/navigation-link/shared/test/use-link-preview.test.js +9 -0
  76. package/src/navigation-link/shared/use-link-preview.js +6 -9
  77. package/src/playlist/edit.js +60 -154
  78. package/src/playlist/editor.scss +3 -3
  79. package/src/playlist/index.php +15 -40
  80. package/src/playlist/style.scss +34 -27
  81. package/src/playlist/test/edit.js +137 -0
  82. package/src/playlist/view.js +97 -40
  83. package/src/playlist-track/edit.js +0 -1
  84. package/src/post-title/block.json +3 -0
  85. package/src/post-title/edit.js +4 -2
  86. package/src/search/index.php +1 -1
  87. package/src/utils/test/waveform-utils.js +328 -0
  88. package/src/utils/waveform-player.js +77 -0
  89. package/src/utils/waveform-utils.js +232 -0
@@ -1,26 +1,364 @@
1
- .wp-block-playlist .wp-block-playlist__current-item {
1
+ .waveform-player {
2
+ font-family: inherit;
3
+ color: inherit;
4
+ line-height: 1.4;
5
+ }
6
+
7
+ .waveform-player * {
8
+ box-sizing: border-box;
9
+ }
10
+
11
+ .waveform-body {
12
+ display: flex;
13
+ flex-direction: column;
14
+ gap: 8px;
15
+ }
16
+
17
+ .waveform-track {
2
18
  display: flex;
3
19
  align-items: center;
4
- gap: var(--wp--preset--spacing--40, 1.5em);
5
- align-self: stretch;
6
- padding-bottom: var(--wp--preset--spacing--30, 1em);
7
- margin-bottom: var(--wp--preset--spacing--30, 1em);
20
+ gap: 12px;
21
+ position: relative;
8
22
  }
9
- .wp-block-playlist .wp-block-playlist__current-item div {
23
+
24
+ .waveform-btn {
25
+ width: 36px;
26
+ height: 36px;
27
+ min-width: 36px;
28
+ border-radius: 50%;
29
+ border: 2px solid currentColor;
30
+ background: transparent;
31
+ color: inherit;
32
+ cursor: pointer;
33
+ display: flex;
34
+ align-items: center;
35
+ justify-content: center;
36
+ transition: all 0.2s ease;
37
+ padding: 0;
38
+ opacity: 0.9;
39
+ flex-shrink: 0;
40
+ }
41
+
42
+ .waveform-btn:hover:not(:disabled) {
43
+ opacity: 1;
44
+ transform: scale(1.05);
45
+ }
46
+
47
+ .waveform-btn:disabled {
48
+ cursor: not-allowed;
49
+ opacity: 0.3;
50
+ }
51
+
52
+ .waveform-btn > * {
53
+ display: flex;
54
+ align-items: center;
55
+ justify-content: center;
56
+ width: 100%;
57
+ height: 100%;
58
+ }
59
+
60
+ .waveform-btn svg {
61
+ width: 16px;
62
+ height: 16px;
63
+ fill: currentColor;
64
+ display: block;
65
+ }
66
+
67
+ .waveform-icon-play svg {
68
+ margin-left: 1px;
69
+ }
70
+
71
+ .waveform-container {
72
+ flex: 1;
73
+ position: relative;
74
+ min-height: 60px;
75
+ cursor: pointer;
76
+ min-width: 0;
77
+ width: 100%;
78
+ }
79
+
80
+ .waveform-container canvas {
81
+ display: block;
82
+ width: 100%;
83
+ height: 100%;
84
+ max-width: 100%;
85
+ transition: opacity 0.3s ease;
86
+ position: relative;
87
+ z-index: 1;
88
+ }
89
+
90
+ .waveform-info {
91
+ display: flex;
92
+ align-items: center;
93
+ gap: 8px;
94
+ font-size: 13px;
95
+ min-height: 20px;
96
+ }
97
+
98
+ .waveform-text {
99
+ flex: 1;
10
100
  display: flex;
11
101
  flex-direction: column;
102
+ gap: 2px;
103
+ min-width: 0;
104
+ }
105
+
106
+ .waveform-title {
107
+ white-space: nowrap;
108
+ overflow: hidden;
109
+ text-overflow: ellipsis;
110
+ font-weight: 500;
111
+ }
112
+
113
+ .waveform-subtitle {
114
+ font-size: 11px;
115
+ white-space: nowrap;
116
+ overflow: hidden;
117
+ text-overflow: ellipsis;
118
+ }
119
+
120
+ .waveform-time {
121
+ font-size: 11px;
122
+ white-space: nowrap;
123
+ flex-shrink: 0;
124
+ }
125
+
126
+ .waveform-bpm {
127
+ font-size: 11px;
128
+ white-space: nowrap;
129
+ flex-shrink: 0;
130
+ display: inline-flex;
131
+ align-items: center;
132
+ gap: 4px;
133
+ }
134
+
135
+ .waveform-loading {
136
+ position: absolute;
137
+ inset: 0;
138
+ background: rgba(0, 0, 0, 0.1019607843);
139
+ z-index: 10;
140
+ }
141
+
142
+ .waveform-error {
143
+ position: absolute;
144
+ inset: 0;
145
+ display: flex;
146
+ align-items: center;
147
+ justify-content: center;
148
+ background: rgba(0, 0, 0, 0.2);
149
+ z-index: 10;
150
+ }
151
+
152
+ .waveform-error-text {
153
+ font-size: 12px;
154
+ opacity: 0.7;
155
+ text-align: center;
156
+ padding: 0 20px;
157
+ }
158
+
159
+ .waveform-markers {
160
+ position: absolute;
161
+ inset: 0;
162
+ pointer-events: none;
163
+ z-index: 5;
164
+ }
165
+
166
+ .waveform-marker {
167
+ position: absolute;
168
+ top: 0;
169
+ width: 2px;
170
+ height: 100%;
171
+ background: rgba(255, 255, 255, 0.5019607843);
172
+ border: none;
173
+ padding: 0;
174
+ cursor: pointer;
175
+ pointer-events: all;
176
+ transition: all 0.2s;
177
+ }
178
+
179
+ .waveform-marker:hover {
180
+ width: 4px;
181
+ z-index: 20;
182
+ }
183
+
184
+ .waveform-marker-tooltip {
185
+ position: absolute;
186
+ bottom: calc(100% + 4px);
187
+ left: 50%;
188
+ transform: translate(-50%);
189
+ background: rgba(0, 0, 0, 0.9019607843);
190
+ color: #fff;
191
+ padding: 4px 8px;
192
+ border-radius: 4px;
193
+ font-size: 11px;
194
+ white-space: nowrap;
195
+ pointer-events: none;
196
+ opacity: 0;
197
+ transition: opacity 0.2s;
198
+ z-index: 1000;
199
+ }
200
+
201
+ .waveform-marker:hover .waveform-marker-tooltip {
202
+ opacity: 1;
203
+ }
204
+
205
+ .waveform-btn:focus-visible {
206
+ outline: 2px solid currentColor;
207
+ outline-offset: 2px;
208
+ }
209
+
210
+ .waveform-marker:focus-visible {
211
+ outline: 2px solid currentColor;
212
+ outline-offset: 1px;
213
+ width: 4px;
214
+ }
215
+
216
+ .waveform-speed {
217
+ position: relative;
218
+ flex-shrink: 0;
219
+ }
220
+
221
+ .speed-btn {
222
+ background: transparent;
223
+ border: 1px solid rgba(255, 255, 255, 0.2);
224
+ border-radius: 4px;
225
+ padding: 4px 8px;
226
+ color: inherit;
227
+ font-size: 11px;
228
+ cursor: pointer;
229
+ transition: all 0.2s;
230
+ min-width: 40px;
231
+ }
232
+
233
+ .speed-btn:hover {
234
+ background: rgba(255, 255, 255, 0.0509803922);
235
+ border-color: rgba(255, 255, 255, 0.3019607843);
236
+ }
237
+
238
+ .speed-value {
239
+ font-weight: 600;
240
+ }
241
+
242
+ .speed-menu {
243
+ position: absolute;
244
+ bottom: 100%;
245
+ right: 0;
246
+ margin-bottom: 4px;
247
+ background: rgba(0, 0, 0, 0.9490196078);
248
+ border: 1px solid rgba(255, 255, 255, 0.2);
249
+ border-radius: 6px;
250
+ padding: 4px;
251
+ z-index: 100;
252
+ min-width: 60px;
253
+ }
254
+
255
+ .speed-option {
256
+ display: block;
257
+ width: 100%;
258
+ background: transparent;
259
+ border: none;
260
+ color: rgba(255, 255, 255, 0.7019607843);
261
+ padding: 6px 12px;
262
+ font-size: 12px;
263
+ cursor: pointer;
264
+ transition: all 0.2s;
265
+ text-align: left;
266
+ border-radius: 4px;
267
+ }
268
+
269
+ .speed-option:hover {
270
+ background: rgba(255, 255, 255, 0.1019607843);
271
+ color: #fff;
272
+ }
273
+
274
+ .speed-option.active {
275
+ background: rgba(168, 85, 247, 0.2);
276
+ color: #a855f7;
277
+ font-weight: 600;
278
+ }
279
+
280
+ .waveform-player.waveform-focused {
281
+ outline: 2px solid rgba(168, 85, 247, 0.5);
282
+ outline-offset: 2px;
283
+ border-radius: 4px;
284
+ }
285
+
286
+ .waveform-player:focus {
287
+ outline: none;
288
+ }
289
+
290
+ .waveform-player:focus-visible {
291
+ outline: 1px solid rgba(168, 85, 247, 0.3);
292
+ outline-offset: 1px;
293
+ }
294
+
295
+ .waveform-player.waveform-focused {
296
+ outline: none;
297
+ }
298
+
299
+ .waveform-track.waveform-align-top {
12
300
  align-items: flex-start;
13
- gap: var(--wp--preset--spacing--20, 0.5em);
14
301
  }
15
- .wp-block-playlist .wp-block-playlist__current-item .wp-block-playlist__current-item-artist-album {
16
- flex-direction: row;
302
+
303
+ .waveform-track.waveform-align-top .waveform-btn {
304
+ margin-top: 5px;
305
+ }
306
+
307
+ .waveform-track.waveform-align-center {
308
+ align-items: center;
309
+ }
310
+
311
+ .waveform-track.waveform-align-bottom {
312
+ align-items: flex-end;
17
313
  }
18
- .wp-block-playlist .wp-block-playlist__current-item .wp-block-playlist__item-title {
19
- word-break: break-all;
314
+
315
+ .waveform-track.waveform-align-bottom .waveform-btn {
316
+ margin-bottom: 5px;
20
317
  }
21
- .wp-block-playlist audio {
318
+
319
+ @media (max-width: 480px) {
320
+ .waveform-btn {
321
+ width: 32px;
322
+ height: 32px;
323
+ min-width: 32px;
324
+ }
325
+ .waveform-container {
326
+ min-height: 50px;
327
+ }
328
+ .waveform-info {
329
+ font-size: 12px;
330
+ }
331
+ .waveform-subtitle, .waveform-time, .waveform-bpm {
332
+ font-size: 10px;
333
+ }
334
+ }
335
+ .wp-block-playlist .wp-block-playlist__waveform-player {
22
336
  width: 100%;
23
- margin-top: var(--wp--preset--spacing--20, 0.625em);
337
+ margin: var(--wp--preset--spacing--20, 0.625em) 0;
338
+ position: relative;
339
+ }
340
+ .wp-block-playlist .waveform-track {
341
+ height: 100px;
342
+ gap: 0;
343
+ }
344
+ .wp-block-playlist .waveform-btn {
345
+ border-radius: 0;
346
+ border-end-start-radius: 0.125rem;
347
+ border-start-start-radius: 0.125rem;
348
+ width: 100px;
349
+ height: 100px;
350
+ min-width: 100px;
351
+ background: currentColor;
352
+ margin: 0;
353
+ }
354
+ .wp-block-playlist .waveform-btn:hover:not(:disabled) {
355
+ transform: none;
356
+ }
357
+ .wp-block-playlist .waveform-track.waveform-align-bottom .waveform-btn {
358
+ margin-bottom: 0;
359
+ }
360
+ .wp-block-playlist .waveform-subtitle {
361
+ opacity: 0.7;
24
362
  }
25
363
  .wp-block-playlist .wp-block-playlist__tracklist {
26
364
  margin: 0;
@@ -35,8 +373,4 @@
35
373
  }
36
374
  .wp-block-playlist .wp-block-playlist__tracklist.wp-block-playlist__tracklist-show-numbers {
37
375
  counter-reset: playlist-track;
38
- }
39
- .wp-block-playlist li.block-list-appender.block-list-appender {
40
- position: initial;
41
- margin-top: var(--wp--preset--spacing--30, 1em);
42
376
  }