@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
@@ -245,6 +245,9 @@
245
245
  .wp-block-buttons > .wp-block-button.has-custom-font-size .wp-block-button__link {
246
246
  font-size: inherit;
247
247
  }
248
+ .wp-block-buttons > .wp-block-button[class*=wp-block-button__width] {
249
+ width: calc(var(--wp--block-button--width) * 1% - var(--wp--style--block-gap, 0.5em) * (1 - var(--wp--block-button--width) / 100));
250
+ }
248
251
  .wp-block-buttons > .wp-block-button.wp-block-button__width-25 {
249
252
  width: calc(25% - var(--wp--style--block-gap, 0.5em) * 0.75);
250
253
  }
@@ -259,6 +262,9 @@
259
262
  flex-basis: 100%;
260
263
  }
261
264
 
265
+ .wp-block-buttons.is-vertical > .wp-block-button[class*=wp-block-button__width] {
266
+ width: calc(var(--wp--block-button--width) * 1%);
267
+ }
262
268
  .wp-block-buttons.is-vertical > .wp-block-button.wp-block-button__width-25 {
263
269
  width: 25%;
264
270
  }
@@ -3151,29 +3157,367 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
3151
3157
  rotate: 180deg;
3152
3158
  }
3153
3159
 
3154
- .wp-block-playlist .wp-block-playlist__current-item {
3160
+ .waveform-player {
3161
+ font-family: inherit;
3162
+ color: inherit;
3163
+ line-height: 1.4;
3164
+ }
3165
+
3166
+ .waveform-player * {
3167
+ box-sizing: border-box;
3168
+ }
3169
+
3170
+ .waveform-body {
3171
+ display: flex;
3172
+ flex-direction: column;
3173
+ gap: 8px;
3174
+ }
3175
+
3176
+ .waveform-track {
3155
3177
  display: flex;
3156
3178
  align-items: center;
3157
- gap: var(--wp--preset--spacing--40, 1.5em);
3158
- align-self: stretch;
3159
- padding-bottom: var(--wp--preset--spacing--30, 1em);
3160
- margin-bottom: var(--wp--preset--spacing--30, 1em);
3179
+ gap: 12px;
3180
+ position: relative;
3161
3181
  }
3162
- .wp-block-playlist .wp-block-playlist__current-item div {
3182
+
3183
+ .waveform-btn {
3184
+ width: 36px;
3185
+ height: 36px;
3186
+ min-width: 36px;
3187
+ border-radius: 50%;
3188
+ border: 2px solid currentColor;
3189
+ background: transparent;
3190
+ color: inherit;
3191
+ cursor: pointer;
3192
+ display: flex;
3193
+ align-items: center;
3194
+ justify-content: center;
3195
+ transition: all 0.2s ease;
3196
+ padding: 0;
3197
+ opacity: 0.9;
3198
+ flex-shrink: 0;
3199
+ }
3200
+
3201
+ .waveform-btn:hover:not(:disabled) {
3202
+ opacity: 1;
3203
+ transform: scale(1.05);
3204
+ }
3205
+
3206
+ .waveform-btn:disabled {
3207
+ cursor: not-allowed;
3208
+ opacity: 0.3;
3209
+ }
3210
+
3211
+ .waveform-btn > * {
3212
+ display: flex;
3213
+ align-items: center;
3214
+ justify-content: center;
3215
+ width: 100%;
3216
+ height: 100%;
3217
+ }
3218
+
3219
+ .waveform-btn svg {
3220
+ width: 16px;
3221
+ height: 16px;
3222
+ fill: currentColor;
3223
+ display: block;
3224
+ }
3225
+
3226
+ .waveform-icon-play svg {
3227
+ margin-right: 1px;
3228
+ }
3229
+
3230
+ .waveform-container {
3231
+ flex: 1;
3232
+ position: relative;
3233
+ min-height: 60px;
3234
+ cursor: pointer;
3235
+ min-width: 0;
3236
+ width: 100%;
3237
+ }
3238
+
3239
+ .waveform-container canvas {
3240
+ display: block;
3241
+ width: 100%;
3242
+ height: 100%;
3243
+ max-width: 100%;
3244
+ transition: opacity 0.3s ease;
3245
+ position: relative;
3246
+ z-index: 1;
3247
+ }
3248
+
3249
+ .waveform-info {
3250
+ display: flex;
3251
+ align-items: center;
3252
+ gap: 8px;
3253
+ font-size: 13px;
3254
+ min-height: 20px;
3255
+ }
3256
+
3257
+ .waveform-text {
3258
+ flex: 1;
3163
3259
  display: flex;
3164
3260
  flex-direction: column;
3261
+ gap: 2px;
3262
+ min-width: 0;
3263
+ }
3264
+
3265
+ .waveform-title {
3266
+ white-space: nowrap;
3267
+ overflow: hidden;
3268
+ text-overflow: ellipsis;
3269
+ font-weight: 500;
3270
+ }
3271
+
3272
+ .waveform-subtitle {
3273
+ font-size: 11px;
3274
+ white-space: nowrap;
3275
+ overflow: hidden;
3276
+ text-overflow: ellipsis;
3277
+ }
3278
+
3279
+ .waveform-time {
3280
+ font-size: 11px;
3281
+ white-space: nowrap;
3282
+ flex-shrink: 0;
3283
+ }
3284
+
3285
+ .waveform-bpm {
3286
+ font-size: 11px;
3287
+ white-space: nowrap;
3288
+ flex-shrink: 0;
3289
+ display: inline-flex;
3290
+ align-items: center;
3291
+ gap: 4px;
3292
+ }
3293
+
3294
+ .waveform-loading {
3295
+ position: absolute;
3296
+ inset: 0;
3297
+ background: rgba(0, 0, 0, 0.1019607843);
3298
+ z-index: 10;
3299
+ }
3300
+
3301
+ .waveform-error {
3302
+ position: absolute;
3303
+ inset: 0;
3304
+ display: flex;
3305
+ align-items: center;
3306
+ justify-content: center;
3307
+ background: rgba(0, 0, 0, 0.2);
3308
+ z-index: 10;
3309
+ }
3310
+
3311
+ .waveform-error-text {
3312
+ font-size: 12px;
3313
+ opacity: 0.7;
3314
+ text-align: center;
3315
+ padding: 0 20px;
3316
+ }
3317
+
3318
+ .waveform-markers {
3319
+ position: absolute;
3320
+ inset: 0;
3321
+ pointer-events: none;
3322
+ z-index: 5;
3323
+ }
3324
+
3325
+ .waveform-marker {
3326
+ position: absolute;
3327
+ top: 0;
3328
+ width: 2px;
3329
+ height: 100%;
3330
+ background: rgba(255, 255, 255, 0.5019607843);
3331
+ border: none;
3332
+ padding: 0;
3333
+ cursor: pointer;
3334
+ pointer-events: all;
3335
+ transition: all 0.2s;
3336
+ }
3337
+
3338
+ .waveform-marker:hover {
3339
+ width: 4px;
3340
+ z-index: 20;
3341
+ }
3342
+
3343
+ .waveform-marker-tooltip {
3344
+ position: absolute;
3345
+ bottom: calc(100% + 4px);
3346
+ right: 50%;
3347
+ transform: translate(50%);
3348
+ background: rgba(0, 0, 0, 0.9019607843);
3349
+ color: #fff;
3350
+ padding: 4px 8px;
3351
+ border-radius: 4px;
3352
+ font-size: 11px;
3353
+ white-space: nowrap;
3354
+ pointer-events: none;
3355
+ opacity: 0;
3356
+ transition: opacity 0.2s;
3357
+ z-index: 1000;
3358
+ }
3359
+
3360
+ .waveform-marker:hover .waveform-marker-tooltip {
3361
+ opacity: 1;
3362
+ }
3363
+
3364
+ .waveform-btn:focus-visible {
3365
+ outline: 2px solid currentColor;
3366
+ outline-offset: 2px;
3367
+ }
3368
+
3369
+ .waveform-marker:focus-visible {
3370
+ outline: 2px solid currentColor;
3371
+ outline-offset: 1px;
3372
+ width: 4px;
3373
+ }
3374
+
3375
+ .waveform-speed {
3376
+ position: relative;
3377
+ flex-shrink: 0;
3378
+ }
3379
+
3380
+ .speed-btn {
3381
+ background: transparent;
3382
+ border: 1px solid rgba(255, 255, 255, 0.2);
3383
+ border-radius: 4px;
3384
+ padding: 4px 8px;
3385
+ color: inherit;
3386
+ font-size: 11px;
3387
+ cursor: pointer;
3388
+ transition: all 0.2s;
3389
+ min-width: 40px;
3390
+ }
3391
+
3392
+ .speed-btn:hover {
3393
+ background: rgba(255, 255, 255, 0.0509803922);
3394
+ border-color: rgba(255, 255, 255, 0.3019607843);
3395
+ }
3396
+
3397
+ .speed-value {
3398
+ font-weight: 600;
3399
+ }
3400
+
3401
+ .speed-menu {
3402
+ position: absolute;
3403
+ bottom: 100%;
3404
+ left: 0;
3405
+ margin-bottom: 4px;
3406
+ background: rgba(0, 0, 0, 0.9490196078);
3407
+ border: 1px solid rgba(255, 255, 255, 0.2);
3408
+ border-radius: 6px;
3409
+ padding: 4px;
3410
+ z-index: 100;
3411
+ min-width: 60px;
3412
+ }
3413
+
3414
+ .speed-option {
3415
+ display: block;
3416
+ width: 100%;
3417
+ background: transparent;
3418
+ border: none;
3419
+ color: rgba(255, 255, 255, 0.7019607843);
3420
+ padding: 6px 12px;
3421
+ font-size: 12px;
3422
+ cursor: pointer;
3423
+ transition: all 0.2s;
3424
+ text-align: right;
3425
+ border-radius: 4px;
3426
+ }
3427
+
3428
+ .speed-option:hover {
3429
+ background: rgba(255, 255, 255, 0.1019607843);
3430
+ color: #fff;
3431
+ }
3432
+
3433
+ .speed-option.active {
3434
+ background: rgba(168, 85, 247, 0.2);
3435
+ color: #a855f7;
3436
+ font-weight: 600;
3437
+ }
3438
+
3439
+ .waveform-player.waveform-focused {
3440
+ outline: 2px solid rgba(168, 85, 247, 0.5);
3441
+ outline-offset: 2px;
3442
+ border-radius: 4px;
3443
+ }
3444
+
3445
+ .waveform-player:focus {
3446
+ outline: none;
3447
+ }
3448
+
3449
+ .waveform-player:focus-visible {
3450
+ outline: 1px solid rgba(168, 85, 247, 0.3);
3451
+ outline-offset: 1px;
3452
+ }
3453
+
3454
+ .waveform-player.waveform-focused {
3455
+ outline: none;
3456
+ }
3457
+
3458
+ .waveform-track.waveform-align-top {
3165
3459
  align-items: flex-start;
3166
- gap: var(--wp--preset--spacing--20, 0.5em);
3167
3460
  }
3168
- .wp-block-playlist .wp-block-playlist__current-item .wp-block-playlist__current-item-artist-album {
3169
- flex-direction: row;
3461
+
3462
+ .waveform-track.waveform-align-top .waveform-btn {
3463
+ margin-top: 5px;
3170
3464
  }
3171
- .wp-block-playlist .wp-block-playlist__current-item .wp-block-playlist__item-title {
3172
- word-break: break-all;
3465
+
3466
+ .waveform-track.waveform-align-center {
3467
+ align-items: center;
3468
+ }
3469
+
3470
+ .waveform-track.waveform-align-bottom {
3471
+ align-items: flex-end;
3472
+ }
3473
+
3474
+ .waveform-track.waveform-align-bottom .waveform-btn {
3475
+ margin-bottom: 5px;
3476
+ }
3477
+
3478
+ @media (max-width: 480px) {
3479
+ .waveform-btn {
3480
+ width: 32px;
3481
+ height: 32px;
3482
+ min-width: 32px;
3483
+ }
3484
+ .waveform-container {
3485
+ min-height: 50px;
3486
+ }
3487
+ .waveform-info {
3488
+ font-size: 12px;
3489
+ }
3490
+ .waveform-subtitle, .waveform-time, .waveform-bpm {
3491
+ font-size: 10px;
3492
+ }
3173
3493
  }
3174
- .wp-block-playlist audio {
3494
+ .wp-block-playlist .wp-block-playlist__waveform-player {
3175
3495
  width: 100%;
3176
- margin-top: var(--wp--preset--spacing--20, 0.625em);
3496
+ margin: var(--wp--preset--spacing--20, 0.625em) 0;
3497
+ position: relative;
3498
+ }
3499
+ .wp-block-playlist .waveform-track {
3500
+ height: 100px;
3501
+ gap: 0;
3502
+ }
3503
+ .wp-block-playlist .waveform-btn {
3504
+ border-radius: 0;
3505
+ border-end-start-radius: 0.125rem;
3506
+ border-start-start-radius: 0.125rem;
3507
+ width: 100px;
3508
+ height: 100px;
3509
+ min-width: 100px;
3510
+ background: currentColor;
3511
+ margin: 0;
3512
+ }
3513
+ .wp-block-playlist .waveform-btn:hover:not(:disabled) {
3514
+ transform: none;
3515
+ }
3516
+ .wp-block-playlist .waveform-track.waveform-align-bottom .waveform-btn {
3517
+ margin-bottom: 0;
3518
+ }
3519
+ .wp-block-playlist .waveform-subtitle {
3520
+ opacity: 0.7;
3177
3521
  }
3178
3522
  .wp-block-playlist .wp-block-playlist__tracklist {
3179
3523
  margin: 0;
@@ -3189,10 +3533,6 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
3189
3533
  .wp-block-playlist .wp-block-playlist__tracklist.wp-block-playlist__tracklist-show-numbers {
3190
3534
  counter-reset: playlist-track;
3191
3535
  }
3192
- .wp-block-playlist li.block-list-appender.block-list-appender {
3193
- position: initial;
3194
- margin-top: var(--wp--preset--spacing--30, 1em);
3195
- }
3196
3536
 
3197
3537
  .wp-block-playlist-track:has([aria-current=true]) {
3198
3538
  background-color: color-mix(in srgb, currentColor 10%, transparent);