@automattic/newspack-blocks 1.53.0 → 1.54.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 (97) hide show
  1. package/.cache/babel/1783de595f21d427355e559781275222.json.gz +0 -0
  2. package/.cache/babel/2a75259638488d555bb07fb4f54ddde6.json.gz +0 -0
  3. package/.cache/babel/{64cb5afd808420a679c0d56e7bdb7949.json.gz → 2dfe70bf8fa9218857f45826e2386a32.json.gz} +0 -0
  4. package/.cache/babel/2ef414e63685642b486b71a962a5cc09.json.gz +0 -0
  5. package/.cache/babel/5a94cdb1154d1770a8b0e8cd3145825b.json.gz +0 -0
  6. package/.cache/babel/678cc0f373236434bf692c16d26ba22f.json.gz +0 -0
  7. package/.cache/babel/71371fcf9db60a3a1e024991cb3b4bf3.json.gz +0 -0
  8. package/.cache/babel/725e695c6992a4d01573b83867255ea9.json.gz +0 -0
  9. package/.cache/babel/94ee8f45c55ecf01005a435ab588333b.json.gz +0 -0
  10. package/.cache/babel/a5759fe1915229088160b7f5eb8a2e75.json.gz +0 -0
  11. package/.cache/babel/{bdebf548c146fe858685d50dd0ebd031.json.gz → be383af4530fd3521ee3db177be1bbf4.json.gz} +0 -0
  12. package/.cache/babel/d298f58c94d221b643c4c009ea0d8002.json.gz +0 -0
  13. package/.cache/babel/dc7e2d653dbbdbd1939aa281435afa5d.json.gz +0 -0
  14. package/.cache/babel/f50f27ba4b367318e30e91dbe003e5c8.json.gz +0 -0
  15. package/CHANGELOG.md +35 -0
  16. package/dist/author-profile/view.asset.php +1 -1
  17. package/dist/author-profile/view.css +1 -1
  18. package/dist/author-profile/view.rtl.css +1 -1
  19. package/dist/carousel/view.asset.php +1 -1
  20. package/dist/carousel/view.css +1 -1
  21. package/dist/carousel/view.js +1 -1
  22. package/dist/carousel/view.rtl.css +1 -1
  23. package/dist/donate/view.asset.php +1 -1
  24. package/dist/donate/view.css +1 -1
  25. package/dist/donate/view.rtl.css +1 -1
  26. package/dist/donateStreamlined.asset.php +1 -1
  27. package/dist/donateStreamlined.js +1 -1
  28. package/dist/editor.asset.php +1 -1
  29. package/dist/editor.css +1 -1
  30. package/dist/editor.js +5 -5
  31. package/dist/editor.rtl.css +1 -1
  32. package/dist/homepage-articles/view.asset.php +1 -1
  33. package/dist/homepage-articles/view.css +1 -1
  34. package/dist/homepage-articles/view.rtl.css +1 -1
  35. package/dist/placeholder_blocks.asset.php +1 -0
  36. package/dist/placeholder_blocks.js +1 -0
  37. package/includes/class-newspack-blocks-api.php +14 -12
  38. package/includes/class-newspack-blocks-patterns.php +3 -2
  39. package/includes/class-newspack-blocks.php +64 -1
  40. package/newspack-blocks.php +3 -2
  41. package/package.json +17 -16
  42. package/src/block-patterns/homepage-posts-14.php +1 -1
  43. package/src/block-patterns/homepage-posts-2.php +1 -1
  44. package/src/block-patterns/homepage-posts-26.php +1 -1
  45. package/src/block-patterns/homepage-posts-31.php +13 -0
  46. package/src/block-patterns/homepage-posts-7.php +1 -1
  47. package/src/block-styles/core/columns/editor.scss +10 -10
  48. package/src/block-styles/core/columns/view.scss +8 -8
  49. package/src/block-styles/core/group/editor.scss +3 -3
  50. package/src/block-styles/core/group/view.scss +3 -3
  51. package/src/blocks/author-list/editor.scss +1 -1
  52. package/src/blocks/author-profile/edit.js +29 -6
  53. package/src/blocks/author-profile/editor.scss +4 -3
  54. package/src/blocks/author-profile/view.scss +9 -9
  55. package/src/blocks/carousel/edit.js +31 -15
  56. package/src/blocks/carousel/editor.scss +1 -1
  57. package/src/blocks/carousel/view.php +94 -87
  58. package/src/blocks/carousel/view.scss +52 -13
  59. package/src/blocks/donate/block.json +49 -0
  60. package/src/blocks/donate/edit.tsx +569 -0
  61. package/src/blocks/donate/editor.scss +68 -8
  62. package/src/blocks/donate/index.js +8 -41
  63. package/src/blocks/donate/streamlined/style.scss +17 -17
  64. package/src/blocks/donate/view.php +226 -174
  65. package/src/blocks/donate/view.scss +97 -114
  66. package/src/blocks/homepage-articles/edit.js +28 -22
  67. package/src/blocks/homepage-articles/editor.scss +5 -5
  68. package/src/blocks/homepage-articles/templates/article.php +78 -73
  69. package/src/blocks/homepage-articles/utils.ts +1 -3
  70. package/src/blocks/homepage-articles/view.scss +68 -40
  71. package/src/blocks/iframe/edit.js +18 -14
  72. package/src/blocks/iframe/editor.scss +3 -3
  73. package/src/blocks/video-playlist/editor.scss +2 -2
  74. package/src/setup/editor.scss +46 -4
  75. package/src/setup/placeholder-blocks.js +83 -0
  76. package/src/shared/sass/_mixins.scss +7 -5
  77. package/src/types/@wordpress/block-editor.d.ts +1 -0
  78. package/src/types/@wordpress/components.d.ts +1 -0
  79. package/src/types/{index.ts → index.d.ts} +5 -1
  80. package/src/types/newspack-components.d.ts +7 -0
  81. package/vendor/autoload.php +1 -1
  82. package/vendor/composer/autoload_real.php +4 -4
  83. package/vendor/composer/autoload_static.php +2 -2
  84. package/vendor/composer/installed.php +2 -2
  85. package/webpack.config.js +4 -0
  86. package/.cache/babel/07169c73863508b392f15022920bd0b6.json.gz +0 -0
  87. package/.cache/babel/10faf7c74a89e9aa4d8b9528a654913e.json.gz +0 -0
  88. package/.cache/babel/3fc03f1e35bc1fde55a903cf25d74d3d.json.gz +0 -0
  89. package/.cache/babel/553094e2be86910f765ad110c8da1ba1.json.gz +0 -0
  90. package/.cache/babel/55dd64fbb5126117016b9edff26ca5ee.json.gz +0 -0
  91. package/.cache/babel/7cbfe1b298fdc2a21add34363b2a6046.json.gz +0 -0
  92. package/.cache/babel/95c79f7af2e88cb1c48e88f304b1a1fd.json.gz +0 -0
  93. package/.cache/babel/ac3be6086bb961d3a94ba6ba7728901c.json.gz +0 -0
  94. package/.cache/babel/c9354785521531ea2b4a9a8c2f526abf.json.gz +0 -0
  95. package/.cache/babel/ca34d0586d4fbcd06c357ff72bda9a19.json.gz +0 -0
  96. package/.cache/babel/edb4dcd474dbafd6ea1655b24469e261.json.gz +0 -0
  97. package/src/blocks/donate/edit.js +0 -587
@@ -95,21 +95,18 @@ call_user_func(
95
95
  <?php endif; ?>
96
96
 
97
97
  <div class="entry-wrapper">
98
- <?php if ( ! empty( $sponsors ) ) : ?>
99
- <span class="cat-links sponsor-label">
100
- <span class="flag">
101
- <?php echo esc_html( Newspack_Blocks::get_sponsor_label( $sponsors ) ); ?>
102
- </span>
103
- </span>
104
- <?php elseif ( $attributes['showCategory'] && $category ) : ?>
98
+ <?php if ( ! empty( $sponsors ) || ( $attributes['showCategory'] && $category ) ) : ?>
105
99
  <?php $category_link = get_category_link( $category->term_id ); ?>
106
- <div class="cat-links">
107
- <?php if ( ! empty( $category_link ) ) : ?>
108
- <a href="<?php echo esc_url( $category_link ); ?>">
100
+ <div class="cat-links <?php if ( ! empty( $sponsors ) ) : ?>sponsor-label<?php endif; // phpcs:ignore Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace ?>">
101
+ <?php if ( ! empty( $sponsors ) ) : ?>
102
+ <span class="flag">
103
+ <?php echo esc_html( Newspack_Blocks::get_sponsor_label( $sponsors ) ); ?>
104
+ </span>
109
105
  <?php endif; ?>
106
+ <?php if ( $attributes['showCategory'] && ! empty( $category_link ) && ( empty( $sponsors ) || Newspack_Blocks::newspack_display_sponsors_and_categories( $sponsors ) ) ) : ?>
107
+ <a href="<?php echo esc_url( $category_link ); ?>">
110
108
  <?php echo esc_html( $category->name ); ?>
111
- <?php if ( ! empty( $category_link ) ) : ?>
112
- </a>
109
+ </a>
113
110
  <?php endif; ?>
114
111
  </div>
115
112
  <?php
@@ -173,71 +170,79 @@ call_user_func(
173
170
  if ( $show_author || $show_date || ! empty( $sponsors ) ) :
174
171
  ?>
175
172
  <div class="entry-meta">
176
- <?php if ( ! empty( $sponsors ) ) : ?>
177
- <?php
178
- $logos = Newspack_Blocks::get_sponsor_logos( $sponsors );
179
- if ( ! empty( $logos ) ) :
180
- ?>
181
- <span class="sponsor-logos">
182
- <?php
183
- foreach ( $logos as $logo ) {
184
- if ( '' !== $logo['url'] ) {
185
- echo '<a href="' . esc_url( $logo['url'] ) . '" target="_blank">';
186
- }
187
- echo '<img src="' . esc_url( $logo['src'] ) . '" alt="' . esc_attr( $logo['alt'] ) . '" width="' . esc_attr( $logo['width'] ) . '" height="' . esc_attr( $logo['height'] ) . '">';
188
- if ( '' !== $logo['url'] ) {
189
- echo '</a>';
190
- }
191
- }
192
- ?>
193
- </span>
194
- <?php endif; ?>
195
- <span class="byline sponsor-byline">
196
- <?php
197
- $bylines = Newspack_Blocks::get_sponsor_byline( $sponsors );
198
- echo esc_html( $bylines[0]['byline'] ) . ' ';
199
- foreach ( $bylines as $byline ) {
200
- echo '<span class="author">';
201
- if ( '' !== $byline['url'] ) {
202
- echo '<a target="_blank" href="' . esc_url( $byline['url'] ) . '">';
203
- }
204
- echo esc_html( $byline['name'] );
205
- if ( '' !== $byline['url'] ) {
206
- echo '</a>';
207
- }
208
- echo '</span>' . esc_html( $byline['sep'] );
173
+ <?php
174
+ if ( ! empty( $sponsors ) ) :
175
+ $sponsor_classes[] = 'entry-sponsors';
176
+ if ( Newspack_Blocks::newspack_display_sponsors_and_authors( $sponsors ) ) {
177
+ $sponsor_classes[] = 'plus-author';
209
178
  }
210
179
  ?>
211
- </span>
180
+ <span class="<?php echo esc_attr( implode( ' ', $sponsor_classes ) ); ?>">
181
+ <?php
182
+ $logos = Newspack_Blocks::get_sponsor_logos( $sponsors );
183
+ if ( ! empty( $logos ) ) :
184
+ ?>
185
+ <span class="sponsor-logos">
186
+ <?php
187
+ foreach ( $logos as $logo ) {
188
+ if ( '' !== $logo['url'] ) {
189
+ echo '<a href="' . esc_url( $logo['url'] ) . '" target="_blank">';
190
+ }
191
+ echo '<img src="' . esc_url( $logo['src'] ) . '" alt="' . esc_attr( $logo['alt'] ) . '" width="' . esc_attr( $logo['width'] ) . '" height="' . esc_attr( $logo['height'] ) . '">';
192
+ if ( '' !== $logo['url'] ) {
193
+ echo '</a>';
194
+ }
195
+ }
196
+ ?>
197
+ </span>
198
+ <?php endif; ?>
199
+ <span class="byline sponsor-byline">
200
+ <?php
201
+ $bylines = Newspack_Blocks::get_sponsor_byline( $sponsors );
202
+ echo esc_html( $bylines[0]['byline'] ) . ' ';
203
+ foreach ( $bylines as $byline ) {
204
+ echo '<span class="author">';
205
+ if ( '' !== $byline['url'] ) {
206
+ echo '<a target="_blank" href="' . esc_url( $byline['url'] ) . '">';
207
+ }
208
+ echo esc_html( $byline['name'] );
209
+ if ( '' !== $byline['url'] ) {
210
+ echo '</a>';
211
+ }
212
+ echo '</span>' . esc_html( $byline['sep'] );
213
+ }
214
+ ?>
215
+ </span><!-- /.sponsor-byline -->
216
+ </span><!-- .entry-sponsors -->
212
217
  <?php
213
- else :
214
- if ( $show_author ) :
215
- if ( $attributes['showAvatar'] ) :
216
- echo wp_kses(
217
- newspack_blocks_format_avatars( $authors ),
218
- array(
219
- 'img' => array(
220
- 'class' => true,
221
- 'src' => true,
222
- 'alt' => true,
223
- 'width' => true,
224
- 'height' => true,
225
- 'data-*' => true,
226
- 'srcset' => true,
227
- ),
228
- 'noscript' => array(),
229
- 'a' => array(
230
- 'href' => true,
231
- ),
232
- )
233
- );
234
- endif;
235
- ?>
236
- <span class="byline">
237
- <?php echo wp_kses_post( newspack_blocks_format_byline( $authors ) ); ?>
238
- </span><!-- .author-name -->
239
- <?php
218
+ endif;
219
+
220
+ if ( $show_author && ( empty( $sponsors ) || Newspack_Blocks::newspack_display_sponsors_and_authors( $sponsors ) ) ) :
221
+ if ( $attributes['showAvatar'] ) :
222
+ echo wp_kses(
223
+ newspack_blocks_format_avatars( $authors ),
224
+ array(
225
+ 'img' => array(
226
+ 'class' => true,
227
+ 'src' => true,
228
+ 'alt' => true,
229
+ 'width' => true,
230
+ 'height' => true,
231
+ 'data-*' => true,
232
+ 'srcset' => true,
233
+ ),
234
+ 'noscript' => array(),
235
+ 'a' => array(
236
+ 'href' => true,
237
+ ),
238
+ )
239
+ );
240
240
  endif;
241
+ ?>
242
+ <span class="byline">
243
+ <?php echo wp_kses_post( newspack_blocks_format_byline( $authors ) ); ?>
244
+ </span><!-- .author-name -->
245
+ <?php
241
246
  endif;
242
247
  if ( $show_date ) :
243
248
  $time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
@@ -198,9 +198,7 @@ const generatePreviewPost = ( id: PostId ) => {
198
198
  const getPreviewPosts = ( attributes: HomepageArticlesAttributes ) =>
199
199
  times( attributes.postsToShow, generatePreviewPost );
200
200
 
201
- type Select = (
202
- namespace: string
203
- ) => {
201
+ type Select = ( namespace: string ) => {
204
202
  // core/blocks-editor
205
203
  getBlocks: () => Block[];
206
204
  // core/editor
@@ -1,6 +1,6 @@
1
- @import '../../shared/sass/variables';
2
- @import '../../shared/sass/mixins';
3
- @import '../../shared/sass/preview';
1
+ @use '../../shared/sass/variables';
2
+ @use '../../shared/sass/mixins';
3
+ @use '../../shared/sass/preview';
4
4
 
5
5
  .wpnbha {
6
6
  margin-bottom: 1em;
@@ -19,7 +19,7 @@
19
19
 
20
20
  /* Section header */
21
21
  .article-section-title {
22
- font-size: $font__size-sm;
22
+ font-size: variables.$font__size-sm;
23
23
  margin-bottom: 0.5em;
24
24
  width: 100%; // make sure this isn't caught up in the flex styles.
25
25
  }
@@ -39,13 +39,13 @@
39
39
  article {
40
40
  flex-basis: 100%;
41
41
 
42
- @include media( tablet ) {
42
+ @include mixins.media( tablet ) {
43
43
  margin-bottom: 1em;
44
44
  }
45
45
  }
46
46
  }
47
47
 
48
- @include media( mobile ) {
48
+ @include mixins.media( mobile ) {
49
49
  &.columns-3 article,
50
50
  &.columns-6 article {
51
51
  flex-basis: calc( 33.333% - 16px );
@@ -62,7 +62,7 @@
62
62
  }
63
63
  }
64
64
 
65
- @include media( tablet ) {
65
+ @include mixins.media( tablet ) {
66
66
  @for $i from 2 through 6 {
67
67
  &.columns-#{ $i } article,
68
68
  &.columns-#{ $i } article:last-of-type {
@@ -87,7 +87,7 @@
87
87
  }
88
88
 
89
89
  figcaption {
90
- font-size: $font__size-xxs;
90
+ font-size: variables.$font__size-xxs;
91
91
  }
92
92
 
93
93
  &.image-alignleft,
@@ -107,14 +107,14 @@
107
107
  display: block;
108
108
  }
109
109
 
110
- @include media( mobile ) {
110
+ @include mixins.media( mobile ) {
111
111
  &.mobile-stack .post-has-image {
112
112
  display: flex;
113
113
  }
114
114
  }
115
115
 
116
116
  // Image scale
117
- @include media( mobile ) {
117
+ @include mixins.media( mobile ) {
118
118
  &.is-4 {
119
119
  .post-thumbnail {
120
120
  flex-basis: 75%;
@@ -168,7 +168,7 @@
168
168
  }
169
169
  }
170
170
 
171
- @include media( mobile ) {
171
+ @include mixins.media( mobile ) {
172
172
  &.mobile-stack.image-alignleft .post-thumbnail {
173
173
  margin-right: 1em;
174
174
  }
@@ -277,7 +277,7 @@
277
277
  width: 100%;
278
278
  z-index: 2;
279
279
 
280
- @include media( desktop ) {
280
+ @include mixins.media( desktop ) {
281
281
  padding: 2rem 1.5rem;
282
282
  }
283
283
  }
@@ -310,7 +310,7 @@
310
310
  text-overflow: ellipsis;
311
311
  z-index: 2;
312
312
 
313
- @include media( desktop ) {
313
+ @include mixins.media( desktop ) {
314
314
  padding: 0 1.5rem;
315
315
  }
316
316
  }
@@ -365,14 +365,10 @@
365
365
  &.has-text-align-center {
366
366
  .cat-links,
367
367
  .entry-meta,
368
- .sponsor-logos {
368
+ .entry-sponsors {
369
369
  justify-content: center;
370
370
  }
371
371
 
372
- .sponsor-logos > * {
373
- margin: 0;
374
- }
375
-
376
372
  &.image-alignbehind figcaption,
377
373
  figcaption {
378
374
  text-align: inherit;
@@ -383,8 +379,10 @@
383
379
  &.has-text-align-right {
384
380
  .cat-links,
385
381
  .entry-meta,
382
+ .entry-sponsors,
386
383
  .sponsor-logos {
387
384
  justify-content: flex-end;
385
+ text-align: right;
388
386
  }
389
387
 
390
388
  figcaption {
@@ -395,8 +393,7 @@
395
393
  margin-left: 1.5em;
396
394
  }
397
395
 
398
- .entry-meta .byline:not( :last-child ),
399
- .sponsor-logos > * {
396
+ .entry-meta .byline:not( :last-child ) {
400
397
  margin: 0;
401
398
  }
402
399
  }
@@ -408,10 +405,17 @@ amp-script .wpnbha {
408
405
  /* Article meta */
409
406
  .cat-links {
410
407
  display: flex;
411
- font-size: $font__size-xxs;
408
+ flex-wrap: wrap;
409
+ font-size: variables.$font__size-xxs;
412
410
  font-weight: bold;
413
411
  margin: 0 0 0.5em;
414
412
 
413
+ &.sponsor-label {
414
+ align-items: center;
415
+ display: flex;
416
+ gap: 0.5em;
417
+ }
418
+
415
419
  a {
416
420
  text-decoration: none;
417
421
 
@@ -420,6 +424,30 @@ amp-script .wpnbha {
420
424
  }
421
425
  }
422
426
  }
427
+
428
+ .entry-sponsors {
429
+ align-items: center;
430
+ display: inline-flex;
431
+ flex-wrap: wrap;
432
+ gap: 0.25em;
433
+ width: 100%;
434
+
435
+ &.plus-author {
436
+ font-size: 0.9em;
437
+
438
+ &:not( :last-child ) {
439
+ margin-bottom: 0.5rem;
440
+ }
441
+ }
442
+ }
443
+
444
+ .sponsor-logos {
445
+ align-items: center;
446
+ display: inline-flex;
447
+ flex-wrap: wrap;
448
+ gap: 0.5em;
449
+ line-height: 1;
450
+ }
423
451
  }
424
452
  /* stylelint-enable */
425
453
 
@@ -442,7 +470,7 @@ amp-script .wpnbha {
442
470
  width: 25px;
443
471
  }
444
472
 
445
- @include media( tablet ) {
473
+ @include mixins.media( tablet ) {
446
474
  .entry-title {
447
475
  font-size: 1.6em;
448
476
  }
@@ -460,7 +488,7 @@ amp-script .wpnbha {
460
488
  .entry-title {
461
489
  line-height: 1.1;
462
490
  }
463
- @include media( tablet ) {
491
+ @include mixins.media( tablet ) {
464
492
  article .avatar {
465
493
  height: 2.4em;
466
494
  width: 2.4em;
@@ -481,12 +509,12 @@ amp-script .wpnbha {
481
509
  .entry-title {
482
510
  font-size: 2.6em;
483
511
  }
484
- @include media( tablet ) {
512
+ @include mixins.media( tablet ) {
485
513
  .entry-title {
486
514
  font-size: 3.6em;
487
515
  }
488
516
  }
489
- @include media( desktop ) {
517
+ @include mixins.media( desktop ) {
490
518
  .entry-title {
491
519
  font-size: 4.8em;
492
520
  }
@@ -497,12 +525,12 @@ amp-script .wpnbha {
497
525
  .entry-title {
498
526
  font-size: 2.4em;
499
527
  }
500
- @include media( tablet ) {
528
+ @include mixins.media( tablet ) {
501
529
  .entry-title {
502
530
  font-size: 3.4em;
503
531
  }
504
532
  }
505
- @include media( desktop ) {
533
+ @include mixins.media( desktop ) {
506
534
  .entry-title {
507
535
  font-size: 4.2em;
508
536
  }
@@ -513,12 +541,12 @@ amp-script .wpnbha {
513
541
  .entry-title {
514
542
  font-size: 2.2em;
515
543
  }
516
- @include media( tablet ) {
544
+ @include mixins.media( tablet ) {
517
545
  .entry-title {
518
546
  font-size: 3em;
519
547
  }
520
548
  }
521
- @include media( desktop ) {
549
+ @include mixins.media( desktop ) {
522
550
  .entry-title {
523
551
  font-size: 3.6em;
524
552
  }
@@ -529,7 +557,7 @@ amp-script .wpnbha {
529
557
  .entry-title {
530
558
  font-size: 2em;
531
559
  }
532
- @include media( tablet ) {
560
+ @include mixins.media( tablet ) {
533
561
  .entry-title {
534
562
  font-size: 2.4em;
535
563
  }
@@ -538,7 +566,7 @@ amp-script .wpnbha {
538
566
  width: 48px;
539
567
  }
540
568
  }
541
- @include media( desktop ) {
569
+ @include mixins.media( desktop ) {
542
570
  .entry-title {
543
571
  font-size: 3em;
544
572
  }
@@ -552,7 +580,7 @@ amp-script .wpnbha {
552
580
  .newspack-post-subtitle {
553
581
  font-size: 1.4em;
554
582
  }
555
- @include media( tablet ) {
583
+ @include mixins.media( tablet ) {
556
584
  .entry-title {
557
585
  font-size: 2em;
558
586
  }
@@ -561,7 +589,7 @@ amp-script .wpnbha {
561
589
  width: 44px;
562
590
  }
563
591
  }
564
- @include media( desktop ) {
592
+ @include mixins.media( desktop ) {
565
593
  .entry-title {
566
594
  font-size: 2.4em;
567
595
  }
@@ -575,7 +603,7 @@ amp-script .wpnbha {
575
603
  .newspack-post-subtitle {
576
604
  font-size: 1.2em;
577
605
  }
578
- @include media( tablet ) {
606
+ @include mixins.media( tablet ) {
579
607
  .entry-title {
580
608
  font-size: 1.8em;
581
609
  }
@@ -584,7 +612,7 @@ amp-script .wpnbha {
584
612
  width: 40px;
585
613
  }
586
614
  }
587
- @include media( desktop ) {
615
+ @include mixins.media( desktop ) {
588
616
  .entry-title {
589
617
  font-size: 2em;
590
618
  }
@@ -605,7 +633,7 @@ amp-script .wpnbha {
605
633
  .entry-meta {
606
634
  font-size: 0.7em;
607
635
  }
608
- @include media( tablet ) {
636
+ @include mixins.media( tablet ) {
609
637
  .entry-title {
610
638
  font-size: 1.2em;
611
639
  }
@@ -630,7 +658,7 @@ amp-script .wpnbha {
630
658
  font-size: 0.7em;
631
659
  }
632
660
 
633
- @include media( tablet ) {
661
+ @include mixins.media( tablet ) {
634
662
  .entry-title {
635
663
  font-size: 0.9em;
636
664
  }
@@ -654,7 +682,7 @@ amp-script .wpnbha {
654
682
  .entry-meta {
655
683
  font-size: 0.6em;
656
684
  }
657
- @include media( tablet ) {
685
+ @include mixins.media( tablet ) {
658
686
  .avatar {
659
687
  height: 24px;
660
688
  width: 24px;
@@ -680,7 +708,7 @@ amp-script .wpnbha {
680
708
  }
681
709
  }
682
710
 
683
- @include media( mobile ) {
711
+ @include mixins.media( mobile ) {
684
712
  @for $i from 2 through 6 {
685
713
  &.columns-#{ $i } article {
686
714
  padding-right: calc( ( 16px * #{$i} ) / ( #{$i} - 1 ) );
@@ -715,7 +743,7 @@ amp-script .wpnbha {
715
743
  }
716
744
  }
717
745
 
718
- @include media( tablet ) {
746
+ @include mixins.media( tablet ) {
719
747
  &.is-grid {
720
748
  article {
721
749
  border-width: 0 1px 0 0;
@@ -86,13 +86,15 @@ const IframeEdit = ( { attributes, setAttributes } ) => {
86
86
  formData.append( 'archive_folder', archiveFolder );
87
87
  formData.append( 'iframe_file', archiveFile );
88
88
 
89
- const { src: iframeArchiveSrc, dir: iframeArchiveFolder, mode: iframeMode } = await apiFetch(
90
- {
91
- path: '/newspack-blocks/v1/newspack-blocks-iframe-archive',
92
- method: 'POST',
93
- body: formData,
94
- }
95
- );
89
+ const {
90
+ src: iframeArchiveSrc,
91
+ dir: iframeArchiveFolder,
92
+ mode: iframeMode,
93
+ } = await apiFetch( {
94
+ path: '/newspack-blocks/v1/newspack-blocks-iframe-archive',
95
+ method: 'POST',
96
+ body: formData,
97
+ } );
96
98
 
97
99
  setAttributes( {
98
100
  mode: iframeMode,
@@ -117,13 +119,15 @@ const IframeEdit = ( { attributes, setAttributes } ) => {
117
119
  const formData = new FormData();
118
120
  formData.append( 'media_id', mediaId );
119
121
 
120
- const { src: iframeArchiveSrc, dir: iframeArchiveFolder, mode: iframeMode } = await apiFetch(
121
- {
122
- path: '/newspack-blocks/v1/newspack-blocks-iframe-archive-from-media',
123
- method: 'POST',
124
- body: formData,
125
- }
126
- );
122
+ const {
123
+ src: iframeArchiveSrc,
124
+ dir: iframeArchiveFolder,
125
+ mode: iframeMode,
126
+ } = await apiFetch( {
127
+ path: '/newspack-blocks/v1/newspack-blocks-iframe-archive-from-media',
128
+ method: 'POST',
129
+ body: formData,
130
+ } );
127
131
 
128
132
  setAttributes( {
129
133
  mode: iframeMode,
@@ -1,5 +1,5 @@
1
- @import '../../shared/sass/variables';
2
- @import '../../shared/sass/mixins';
1
+ @use '../../shared/sass/variables';
2
+ @use '../../shared/sass/mixins';
3
3
 
4
4
  .editor-styles-wrapper {
5
5
  .components-form-file-upload {
@@ -44,7 +44,7 @@
44
44
  width: 100%;
45
45
  min-width: 200px;
46
46
 
47
- @include media( tablet ) {
47
+ @include mixins.media( tablet ) {
48
48
  width: 300px;
49
49
  }
50
50
 
@@ -1,5 +1,5 @@
1
- @import '../../shared/sass/colors';
2
- @import '../../shared/sass/placeholder';
1
+ @use '../../shared/sass/colors';
2
+ @use '../../shared/sass/placeholder';
3
3
 
4
4
  /**
5
5
  * Prevents interaction with the player until the block is focused.
@@ -1,6 +1,48 @@
1
- .block-editor-block-patterns-list__item {
2
- .block-editor-block-preview__container {
3
- max-height: 316px;
4
- overflow: hidden;
1
+ @import '~@wordpress/base-styles/colors';
2
+
3
+ .editor-styles-wrapper {
4
+ .block-editor-block-patterns-list__item {
5
+ .block-editor-block-preview__container {
6
+ max-height: 316px;
7
+ overflow: hidden;
8
+ }
9
+ }
10
+
11
+ .newspack-blocks-placeholder-block {
12
+ background-color: white;
13
+ border-radius: 2px;
14
+ box-shadow: inset 0 0 0 1px $gray-900;
15
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu,
16
+ Cantarell, 'Helvetica Neue', sans-serif;
17
+ margin-top: 0;
18
+ padding: 1em;
19
+ p {
20
+ font-size: 13px;
21
+ }
22
+ &__label {
23
+ align-items: center;
24
+ display: flex;
25
+ flex-wrap: wrap;
26
+ font-size: 18pt;
27
+
28
+ svg {
29
+ display: block;
30
+ fill: currentcolor;
31
+ margin-right: 1ch;
32
+ }
33
+ }
34
+ &__buttons {
35
+ display: flex;
36
+ flex-wrap: wrap;
37
+ gap: 16px;
38
+
39
+ .components-button {
40
+ margin: 0;
41
+
42
+ &.is-primary {
43
+ color: white;
44
+ }
45
+ }
46
+ }
5
47
  }
6
48
  }