@wordpress/edit-post 6.16.0 → 6.17.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.
- package/CHANGELOG.md +2 -0
- package/build/components/block-manager/category.js +1 -1
- package/build/components/block-manager/category.js.map +1 -1
- package/build/components/device-preview/index.js +3 -0
- package/build/components/device-preview/index.js.map +1 -1
- package/build/components/header/index.js +54 -11
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +3 -1
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/writing-menu/index.js +51 -2
- package/build/components/header/writing-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +43 -2
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/layout/index.js +14 -8
- package/build/components/layout/index.js.map +1 -1
- package/build/components/preferences-modal/index.js +27 -8
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/preferences-modal/options/enable-feature.js +6 -2
- package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
- package/build/editor.js +5 -5
- package/build/editor.js.map +1 -1
- package/build/editor.native.js +1 -1
- package/build/editor.native.js.map +1 -1
- package/build/store/actions.js +1 -1
- package/build/store/actions.js.map +1 -1
- package/build/store/reducer.js +1 -1
- package/build/store/reducer.js.map +1 -1
- package/build-module/components/block-manager/category.js +2 -2
- package/build-module/components/block-manager/category.js.map +1 -1
- package/build-module/components/device-preview/index.js +3 -0
- package/build-module/components/device-preview/index.js.map +1 -1
- package/build-module/components/header/index.js +53 -11
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +3 -1
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/components/header/writing-menu/index.js +49 -3
- package/build-module/components/header/writing-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +42 -3
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/layout/index.js +15 -9
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +26 -8
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/preferences-modal/options/enable-feature.js +6 -2
- package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
- package/build-module/editor.js +6 -6
- package/build-module/editor.js.map +1 -1
- package/build-module/editor.native.js +2 -2
- package/build-module/editor.native.js.map +1 -1
- package/build-module/store/actions.js +2 -2
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/reducer.js +1 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-style/style-rtl.css +32 -0
- package/build-style/style.css +32 -0
- package/package.json +27 -27
- package/src/components/block-manager/category.js +3 -4
- package/src/components/device-preview/index.js +2 -0
- package/src/components/editor-initialization/test/listener-hooks.js +47 -49
- package/src/components/header/index.js +31 -12
- package/src/components/header/more-menu/index.js +1 -1
- package/src/components/header/style.scss +44 -0
- package/src/components/header/writing-menu/index.js +52 -3
- package/src/components/keyboard-shortcuts/index.js +49 -3
- package/src/components/layout/index.js +17 -7
- package/src/components/layout/style.scss +7 -0
- package/src/components/preferences-modal/index.js +35 -19
- package/src/components/preferences-modal/options/enable-feature.js +5 -2
- package/src/components/preferences-modal/options/test/__snapshots__/enable-custom-fields.js.snap +128 -132
- package/src/components/preferences-modal/options/test/enable-custom-fields.js +35 -30
- package/src/components/preferences-modal/test/__snapshots__/index.js.snap +50 -55
- package/src/components/preferences-modal/test/index.js +3 -3
- package/src/components/sidebar/plugin-post-status-info/test/__snapshots__/index.js.snap +1 -1
- package/src/components/sidebar/plugin-post-status-info/test/index.js +4 -4
- package/src/editor.js +7 -8
- package/src/editor.native.js +3 -4
- package/src/store/actions.js +3 -4
- package/src/store/reducer.js +1 -1
|
@@ -253,7 +253,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
253
253
|
class="components-toggle-control__label"
|
|
254
254
|
for="inspector-toggle-control-1"
|
|
255
255
|
>
|
|
256
|
-
|
|
256
|
+
Distraction Free
|
|
257
257
|
</label>
|
|
258
258
|
</div>
|
|
259
259
|
</div>
|
|
@@ -261,7 +261,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
261
261
|
class="components-base-control__help emotion-6 emotion-7"
|
|
262
262
|
id="inspector-toggle-control-1__help"
|
|
263
263
|
>
|
|
264
|
-
|
|
264
|
+
Reduce visual distractions by hiding the toolbar and other elements to focus on writing.
|
|
265
265
|
</p>
|
|
266
266
|
</div>
|
|
267
267
|
</div>
|
|
@@ -299,7 +299,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
299
299
|
class="components-toggle-control__label"
|
|
300
300
|
for="inspector-toggle-control-2"
|
|
301
301
|
>
|
|
302
|
-
|
|
302
|
+
Spotlight mode
|
|
303
303
|
</label>
|
|
304
304
|
</div>
|
|
305
305
|
</div>
|
|
@@ -307,7 +307,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
307
307
|
class="components-base-control__help emotion-6 emotion-7"
|
|
308
308
|
id="inspector-toggle-control-2__help"
|
|
309
309
|
>
|
|
310
|
-
|
|
310
|
+
Highlights the current block and fades other content.
|
|
311
311
|
</p>
|
|
312
312
|
</div>
|
|
313
313
|
</div>
|
|
@@ -345,7 +345,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
345
345
|
class="components-toggle-control__label"
|
|
346
346
|
for="inspector-toggle-control-3"
|
|
347
347
|
>
|
|
348
|
-
|
|
348
|
+
Show button text labels
|
|
349
349
|
</label>
|
|
350
350
|
</div>
|
|
351
351
|
</div>
|
|
@@ -353,7 +353,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
353
353
|
class="components-base-control__help emotion-6 emotion-7"
|
|
354
354
|
id="inspector-toggle-control-3__help"
|
|
355
355
|
>
|
|
356
|
-
|
|
356
|
+
Show text instead of icons on buttons.
|
|
357
357
|
</p>
|
|
358
358
|
</div>
|
|
359
359
|
</div>
|
|
@@ -391,7 +391,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
391
391
|
class="components-toggle-control__label"
|
|
392
392
|
for="inspector-toggle-control-4"
|
|
393
393
|
>
|
|
394
|
-
|
|
394
|
+
Always open list view
|
|
395
395
|
</label>
|
|
396
396
|
</div>
|
|
397
397
|
</div>
|
|
@@ -399,7 +399,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
399
399
|
class="components-base-control__help emotion-6 emotion-7"
|
|
400
400
|
id="inspector-toggle-control-4__help"
|
|
401
401
|
>
|
|
402
|
-
|
|
402
|
+
Opens the block list view sidebar by default.
|
|
403
403
|
</p>
|
|
404
404
|
</div>
|
|
405
405
|
</div>
|
|
@@ -508,11 +508,6 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
508
508
|
}
|
|
509
509
|
|
|
510
510
|
.emotion-2 {
|
|
511
|
-
overflow-x: auto;
|
|
512
|
-
max-height: 100%;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
.emotion-3 {
|
|
516
511
|
background-color: #fff;
|
|
517
512
|
color: #1e1e1e;
|
|
518
513
|
position: relative;
|
|
@@ -522,47 +517,47 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
522
517
|
border-radius: calc(2px - 1px);
|
|
523
518
|
}
|
|
524
519
|
|
|
525
|
-
.emotion-
|
|
520
|
+
.emotion-4 {
|
|
526
521
|
height: 100%;
|
|
527
522
|
}
|
|
528
523
|
|
|
529
|
-
.emotion-
|
|
524
|
+
.emotion-6 {
|
|
530
525
|
box-sizing: border-box;
|
|
531
526
|
height: auto;
|
|
532
527
|
max-height: 100%;
|
|
533
528
|
padding: calc(4px * 4);
|
|
534
529
|
}
|
|
535
530
|
|
|
536
|
-
.emotion-
|
|
531
|
+
.emotion-6:first-of-type {
|
|
537
532
|
border-top-left-radius: calc(2px - 1px);
|
|
538
533
|
border-top-right-radius: calc(2px - 1px);
|
|
539
534
|
}
|
|
540
535
|
|
|
541
|
-
.emotion-
|
|
536
|
+
.emotion-6:last-of-type {
|
|
542
537
|
border-bottom-left-radius: calc(2px - 1px);
|
|
543
538
|
border-bottom-right-radius: calc(2px - 1px);
|
|
544
539
|
}
|
|
545
540
|
|
|
546
|
-
.emotion-
|
|
541
|
+
.emotion-8 {
|
|
547
542
|
border-radius: 2px;
|
|
548
543
|
}
|
|
549
544
|
|
|
550
|
-
.emotion-
|
|
545
|
+
.emotion-8>*:first-of-type>* {
|
|
551
546
|
border-top-left-radius: 2px;
|
|
552
547
|
border-top-right-radius: 2px;
|
|
553
548
|
}
|
|
554
549
|
|
|
555
|
-
.emotion-
|
|
550
|
+
.emotion-8>*:last-of-type>* {
|
|
556
551
|
border-bottom-left-radius: 2px;
|
|
557
552
|
border-bottom-right-radius: 2px;
|
|
558
553
|
}
|
|
559
554
|
|
|
560
|
-
.emotion-
|
|
555
|
+
.emotion-10 {
|
|
561
556
|
width: 100%;
|
|
562
557
|
display: block;
|
|
563
558
|
}
|
|
564
559
|
|
|
565
|
-
.emotion-
|
|
560
|
+
.emotion-12 {
|
|
566
561
|
-webkit-appearance: none;
|
|
567
562
|
-moz-appearance: none;
|
|
568
563
|
-ms-appearance: none;
|
|
@@ -579,18 +574,18 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
579
574
|
border-radius: 2px;
|
|
580
575
|
}
|
|
581
576
|
|
|
582
|
-
.emotion-
|
|
577
|
+
.emotion-12:hover {
|
|
583
578
|
color: var( --wp-admin-theme-color, #007cba);
|
|
584
579
|
}
|
|
585
580
|
|
|
586
|
-
.emotion-
|
|
581
|
+
.emotion-12:focus {
|
|
587
582
|
background-color: transparent;
|
|
588
583
|
color: var( --wp-admin-theme-color, #007cba);
|
|
589
584
|
border-color: var( --wp-admin-theme-color, #007cba);
|
|
590
585
|
outline: 3px solid transparent;
|
|
591
586
|
}
|
|
592
587
|
|
|
593
|
-
.emotion-
|
|
588
|
+
.emotion-14 {
|
|
594
589
|
display: -webkit-box;
|
|
595
590
|
display: -webkit-flex;
|
|
596
591
|
display: -ms-flexbox;
|
|
@@ -609,11 +604,11 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
609
604
|
width: 100%;
|
|
610
605
|
}
|
|
611
606
|
|
|
612
|
-
.emotion-
|
|
607
|
+
.emotion-14>* {
|
|
613
608
|
min-width: 0;
|
|
614
609
|
}
|
|
615
610
|
|
|
616
|
-
.emotion-
|
|
611
|
+
.emotion-16 {
|
|
617
612
|
display: block;
|
|
618
613
|
max-height: 100%;
|
|
619
614
|
max-width: 100%;
|
|
@@ -621,14 +616,14 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
621
616
|
min-width: 0;
|
|
622
617
|
}
|
|
623
618
|
|
|
624
|
-
.emotion-
|
|
619
|
+
.emotion-18 {
|
|
625
620
|
display: block;
|
|
626
621
|
overflow: hidden;
|
|
627
622
|
text-overflow: ellipsis;
|
|
628
623
|
white-space: nowrap;
|
|
629
624
|
}
|
|
630
625
|
|
|
631
|
-
.emotion-
|
|
626
|
+
.emotion-46 {
|
|
632
627
|
background: transparent;
|
|
633
628
|
display: block;
|
|
634
629
|
margin: 0!important;
|
|
@@ -648,7 +643,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
648
643
|
}
|
|
649
644
|
|
|
650
645
|
@media ( prefers-reduced-motion: reduce ) {
|
|
651
|
-
.emotion-
|
|
646
|
+
.emotion-46 {
|
|
652
647
|
transition-duration: 0ms;
|
|
653
648
|
}
|
|
654
649
|
}
|
|
@@ -701,52 +696,52 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
701
696
|
data-wp-component="NavigatorProvider"
|
|
702
697
|
>
|
|
703
698
|
<div
|
|
704
|
-
class="
|
|
699
|
+
class="components-navigator-screen"
|
|
705
700
|
data-wp-c16t="true"
|
|
706
701
|
data-wp-component="NavigatorScreen"
|
|
707
702
|
style="opacity: 0; transform: translateX(50px) translateZ(0);"
|
|
708
703
|
>
|
|
709
704
|
<div
|
|
710
|
-
class="components-surface components-card emotion-
|
|
705
|
+
class="components-surface components-card emotion-2 emotion-1"
|
|
711
706
|
data-wp-c16t="true"
|
|
712
707
|
data-wp-component="Card"
|
|
713
708
|
>
|
|
714
709
|
<div
|
|
715
|
-
class="emotion-
|
|
710
|
+
class="emotion-4 emotion-1"
|
|
716
711
|
>
|
|
717
712
|
<div
|
|
718
|
-
class="components-card__body components-card-body emotion-
|
|
713
|
+
class="components-card__body components-card-body emotion-6 emotion-1"
|
|
719
714
|
data-wp-c16t="true"
|
|
720
715
|
data-wp-component="CardBody"
|
|
721
716
|
>
|
|
722
717
|
<div
|
|
723
|
-
class="components-item-group emotion-
|
|
718
|
+
class="components-item-group emotion-8 emotion-1"
|
|
724
719
|
data-wp-c16t="true"
|
|
725
720
|
data-wp-component="ItemGroup"
|
|
726
721
|
role="list"
|
|
727
722
|
>
|
|
728
723
|
<div
|
|
729
|
-
class="emotion-
|
|
724
|
+
class="emotion-10"
|
|
730
725
|
role="listitem"
|
|
731
726
|
>
|
|
732
727
|
<button
|
|
733
|
-
class="components-item components-navigator-button emotion-1 emotion-
|
|
728
|
+
class="components-item components-navigator-button emotion-1 emotion-12 emotion-1"
|
|
734
729
|
data-wp-c16t="true"
|
|
735
730
|
data-wp-component="NavigatorButton"
|
|
736
731
|
id="general"
|
|
737
732
|
>
|
|
738
733
|
<div
|
|
739
|
-
class="components-flex components-h-stack emotion-
|
|
734
|
+
class="components-flex components-h-stack emotion-14 emotion-1"
|
|
740
735
|
data-wp-c16t="true"
|
|
741
736
|
data-wp-component="HStack"
|
|
742
737
|
>
|
|
743
738
|
<div
|
|
744
|
-
class="components-flex-item emotion-
|
|
739
|
+
class="components-flex-item emotion-16 emotion-1"
|
|
745
740
|
data-wp-c16t="true"
|
|
746
741
|
data-wp-component="FlexItem"
|
|
747
742
|
>
|
|
748
743
|
<span
|
|
749
|
-
class="components-truncate emotion-
|
|
744
|
+
class="components-truncate emotion-18 emotion-1"
|
|
750
745
|
data-wp-c16t="true"
|
|
751
746
|
data-wp-component="Truncate"
|
|
752
747
|
>
|
|
@@ -754,7 +749,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
754
749
|
</span>
|
|
755
750
|
</div>
|
|
756
751
|
<div
|
|
757
|
-
class="components-flex-item emotion-
|
|
752
|
+
class="components-flex-item emotion-16 emotion-1"
|
|
758
753
|
data-wp-c16t="true"
|
|
759
754
|
data-wp-component="FlexItem"
|
|
760
755
|
>
|
|
@@ -775,27 +770,27 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
775
770
|
</button>
|
|
776
771
|
</div>
|
|
777
772
|
<div
|
|
778
|
-
class="emotion-
|
|
773
|
+
class="emotion-10"
|
|
779
774
|
role="listitem"
|
|
780
775
|
>
|
|
781
776
|
<button
|
|
782
|
-
class="components-item components-navigator-button emotion-1 emotion-
|
|
777
|
+
class="components-item components-navigator-button emotion-1 emotion-12 emotion-1"
|
|
783
778
|
data-wp-c16t="true"
|
|
784
779
|
data-wp-component="NavigatorButton"
|
|
785
780
|
id="blocks"
|
|
786
781
|
>
|
|
787
782
|
<div
|
|
788
|
-
class="components-flex components-h-stack emotion-
|
|
783
|
+
class="components-flex components-h-stack emotion-14 emotion-1"
|
|
789
784
|
data-wp-c16t="true"
|
|
790
785
|
data-wp-component="HStack"
|
|
791
786
|
>
|
|
792
787
|
<div
|
|
793
|
-
class="components-flex-item emotion-
|
|
788
|
+
class="components-flex-item emotion-16 emotion-1"
|
|
794
789
|
data-wp-c16t="true"
|
|
795
790
|
data-wp-component="FlexItem"
|
|
796
791
|
>
|
|
797
792
|
<span
|
|
798
|
-
class="components-truncate emotion-
|
|
793
|
+
class="components-truncate emotion-18 emotion-1"
|
|
799
794
|
data-wp-c16t="true"
|
|
800
795
|
data-wp-component="Truncate"
|
|
801
796
|
>
|
|
@@ -803,7 +798,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
803
798
|
</span>
|
|
804
799
|
</div>
|
|
805
800
|
<div
|
|
806
|
-
class="components-flex-item emotion-
|
|
801
|
+
class="components-flex-item emotion-16 emotion-1"
|
|
807
802
|
data-wp-c16t="true"
|
|
808
803
|
data-wp-component="FlexItem"
|
|
809
804
|
>
|
|
@@ -824,27 +819,27 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
824
819
|
</button>
|
|
825
820
|
</div>
|
|
826
821
|
<div
|
|
827
|
-
class="emotion-
|
|
822
|
+
class="emotion-10"
|
|
828
823
|
role="listitem"
|
|
829
824
|
>
|
|
830
825
|
<button
|
|
831
|
-
class="components-item components-navigator-button emotion-1 emotion-
|
|
826
|
+
class="components-item components-navigator-button emotion-1 emotion-12 emotion-1"
|
|
832
827
|
data-wp-c16t="true"
|
|
833
828
|
data-wp-component="NavigatorButton"
|
|
834
829
|
id="panels"
|
|
835
830
|
>
|
|
836
831
|
<div
|
|
837
|
-
class="components-flex components-h-stack emotion-
|
|
832
|
+
class="components-flex components-h-stack emotion-14 emotion-1"
|
|
838
833
|
data-wp-c16t="true"
|
|
839
834
|
data-wp-component="HStack"
|
|
840
835
|
>
|
|
841
836
|
<div
|
|
842
|
-
class="components-flex-item emotion-
|
|
837
|
+
class="components-flex-item emotion-16 emotion-1"
|
|
843
838
|
data-wp-c16t="true"
|
|
844
839
|
data-wp-component="FlexItem"
|
|
845
840
|
>
|
|
846
841
|
<span
|
|
847
|
-
class="components-truncate emotion-
|
|
842
|
+
class="components-truncate emotion-18 emotion-1"
|
|
848
843
|
data-wp-c16t="true"
|
|
849
844
|
data-wp-component="Truncate"
|
|
850
845
|
>
|
|
@@ -852,7 +847,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
852
847
|
</span>
|
|
853
848
|
</div>
|
|
854
849
|
<div
|
|
855
|
-
class="components-flex-item emotion-
|
|
850
|
+
class="components-flex-item emotion-16 emotion-1"
|
|
856
851
|
data-wp-c16t="true"
|
|
857
852
|
data-wp-component="FlexItem"
|
|
858
853
|
>
|
|
@@ -877,13 +872,13 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
|
|
|
877
872
|
</div>
|
|
878
873
|
<div
|
|
879
874
|
aria-hidden="true"
|
|
880
|
-
class="components-elevation emotion-
|
|
875
|
+
class="components-elevation emotion-46 emotion-1"
|
|
881
876
|
data-wp-c16t="true"
|
|
882
877
|
data-wp-component="Elevation"
|
|
883
878
|
/>
|
|
884
879
|
<div
|
|
885
880
|
aria-hidden="true"
|
|
886
|
-
class="components-elevation emotion-
|
|
881
|
+
class="components-elevation emotion-46 emotion-1"
|
|
887
882
|
data-wp-c16t="true"
|
|
888
883
|
data-wp-component="Elevation"
|
|
889
884
|
/>
|
|
@@ -21,7 +21,7 @@ jest.mock( '@wordpress/compose/src/hooks/use-viewport-match', () => jest.fn() );
|
|
|
21
21
|
describe( 'EditPostPreferencesModal', () => {
|
|
22
22
|
describe( 'should match snapshot when the modal is active', () => {
|
|
23
23
|
it( 'large viewports', () => {
|
|
24
|
-
useSelect.mockImplementation( () => true );
|
|
24
|
+
useSelect.mockImplementation( () => [ true, true, false ] );
|
|
25
25
|
useViewportMatch.mockImplementation( () => true );
|
|
26
26
|
render( <EditPostPreferencesModal /> );
|
|
27
27
|
expect(
|
|
@@ -29,7 +29,7 @@ describe( 'EditPostPreferencesModal', () => {
|
|
|
29
29
|
).toMatchSnapshot();
|
|
30
30
|
} );
|
|
31
31
|
it( 'small viewports', () => {
|
|
32
|
-
useSelect.mockImplementation( () => true );
|
|
32
|
+
useSelect.mockImplementation( () => [ true, true, false ] );
|
|
33
33
|
useViewportMatch.mockImplementation( () => false );
|
|
34
34
|
render( <EditPostPreferencesModal /> );
|
|
35
35
|
expect(
|
|
@@ -39,7 +39,7 @@ describe( 'EditPostPreferencesModal', () => {
|
|
|
39
39
|
} );
|
|
40
40
|
|
|
41
41
|
it( 'should not render when the modal is not active', () => {
|
|
42
|
-
useSelect.mockImplementation( () => false );
|
|
42
|
+
useSelect.mockImplementation( () => [ false, false, false ] );
|
|
43
43
|
render( <EditPostPreferencesModal /> );
|
|
44
44
|
expect(
|
|
45
45
|
screen.queryByRole( 'dialog', { name: 'Preferences' } )
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import { render } from '@testing-library/react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -15,15 +15,15 @@ import PluginPostStatusInfo from '../';
|
|
|
15
15
|
|
|
16
16
|
describe( 'PluginPostStatusInfo', () => {
|
|
17
17
|
test( 'renders fill properly', () => {
|
|
18
|
-
const
|
|
18
|
+
const { container } = render(
|
|
19
19
|
<SlotFillProvider>
|
|
20
20
|
<PluginPostStatusInfo className="my-plugin-post-status-info">
|
|
21
21
|
My plugin post status info
|
|
22
22
|
</PluginPostStatusInfo>
|
|
23
23
|
<PluginPostStatusInfo.Slot />
|
|
24
24
|
</SlotFillProvider>
|
|
25
|
-
)
|
|
25
|
+
);
|
|
26
26
|
|
|
27
|
-
expect(
|
|
27
|
+
expect( container.firstChild ).toMatchSnapshot();
|
|
28
28
|
} );
|
|
29
29
|
} );
|
package/src/editor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { map
|
|
4
|
+
import { map } from 'lodash';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -38,7 +38,7 @@ function Editor( {
|
|
|
38
38
|
const {
|
|
39
39
|
hasFixedToolbar,
|
|
40
40
|
focusMode,
|
|
41
|
-
|
|
41
|
+
isDistractionFree,
|
|
42
42
|
hasInlineToolbar,
|
|
43
43
|
hasThemeStyles,
|
|
44
44
|
post,
|
|
@@ -85,7 +85,7 @@ function Editor( {
|
|
|
85
85
|
isFeatureActive( 'fixedToolbar' ) ||
|
|
86
86
|
__experimentalGetPreviewDeviceType() !== 'Desktop',
|
|
87
87
|
focusMode: isFeatureActive( 'focusMode' ),
|
|
88
|
-
|
|
88
|
+
isDistractionFree: isFeatureActive( 'distractionFree' ),
|
|
89
89
|
hasInlineToolbar: isFeatureActive( 'inlineToolbar' ),
|
|
90
90
|
hasThemeStyles: isFeatureActive( 'themeStyles' ),
|
|
91
91
|
preferredStyleVariations: select( preferencesStore ).get(
|
|
@@ -118,7 +118,7 @@ function Editor( {
|
|
|
118
118
|
},
|
|
119
119
|
hasFixedToolbar,
|
|
120
120
|
focusMode,
|
|
121
|
-
|
|
121
|
+
isDistractionFree,
|
|
122
122
|
hasInlineToolbar,
|
|
123
123
|
|
|
124
124
|
// This is marked as experimental to give time for the quick inserter to mature.
|
|
@@ -139,9 +139,8 @@ function Editor( {
|
|
|
139
139
|
? map( blockTypes, 'name' )
|
|
140
140
|
: settings.allowedBlockTypes || [];
|
|
141
141
|
|
|
142
|
-
result.allowedBlockTypes =
|
|
143
|
-
|
|
144
|
-
...hiddenBlockTypes
|
|
142
|
+
result.allowedBlockTypes = defaultAllowedBlockTypes.filter(
|
|
143
|
+
( type ) => ! hiddenBlockTypes.includes( type )
|
|
145
144
|
);
|
|
146
145
|
}
|
|
147
146
|
|
|
@@ -150,7 +149,7 @@ function Editor( {
|
|
|
150
149
|
settings,
|
|
151
150
|
hasFixedToolbar,
|
|
152
151
|
focusMode,
|
|
153
|
-
|
|
152
|
+
isDistractionFree,
|
|
154
153
|
hiddenBlockTypes,
|
|
155
154
|
blockTypes,
|
|
156
155
|
preferredStyleVariations,
|
package/src/editor.native.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import memize from 'memize';
|
|
5
|
-
import { map
|
|
5
|
+
import { map } from 'lodash';
|
|
6
6
|
import { I18nManager } from 'react-native';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -76,9 +76,8 @@ class Editor extends Component {
|
|
|
76
76
|
? map( blockTypes, 'name' )
|
|
77
77
|
: settings.allowedBlockTypes || [];
|
|
78
78
|
|
|
79
|
-
settings.allowedBlockTypes =
|
|
80
|
-
|
|
81
|
-
...hiddenBlockTypes
|
|
79
|
+
settings.allowedBlockTypes = defaultAllowedBlockTypes.filter(
|
|
80
|
+
( type ) => ! hiddenBlockTypes.includes( type )
|
|
82
81
|
);
|
|
83
82
|
}
|
|
84
83
|
|
package/src/store/actions.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { castArray, reduce
|
|
4
|
+
import { castArray, reduce } from 'lodash';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
@@ -295,9 +295,8 @@ export const showBlockTypes =
|
|
|
295
295
|
.select( preferencesStore )
|
|
296
296
|
.get( 'core/edit-post', 'hiddenBlockTypes' ) ?? [];
|
|
297
297
|
|
|
298
|
-
const newBlockNames =
|
|
299
|
-
|
|
300
|
-
...castArray( blockNames )
|
|
298
|
+
const newBlockNames = existingBlockNames.filter(
|
|
299
|
+
( type ) => ! castArray( blockNames ).includes( type )
|
|
301
300
|
);
|
|
302
301
|
|
|
303
302
|
registry
|
package/src/store/reducer.js
CHANGED
|
@@ -153,7 +153,7 @@ export function listViewPanel( state = false, action ) {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
|
-
* Reducer tracking whether
|
|
156
|
+
* Reducer tracking whether template editing is on or off.
|
|
157
157
|
*
|
|
158
158
|
* @param {boolean} state
|
|
159
159
|
* @param {Object} action
|