@wordpress/block-editor 8.3.1 → 8.4.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 (174) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +1 -0
  3. package/build/components/block-list/block-html.js +4 -1
  4. package/build/components/block-list/block-html.js.map +1 -1
  5. package/build/components/block-list/block.js +4 -1
  6. package/build/components/block-list/block.js.map +1 -1
  7. package/build/components/block-list/use-block-props/use-focus-first-element.js +19 -0
  8. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  9. package/build/components/block-lock/index.js +32 -0
  10. package/build/components/block-lock/index.js.map +1 -0
  11. package/build/components/block-lock/menu-item.js +58 -0
  12. package/build/components/block-lock/menu-item.js.map +1 -0
  13. package/build/components/block-lock/modal.js +143 -0
  14. package/build/components/block-lock/modal.js.map +1 -0
  15. package/build/components/block-lock/toolbar.js +70 -0
  16. package/build/components/block-lock/toolbar.js.map +1 -0
  17. package/build/components/block-settings-menu/block-settings-dropdown.js +26 -6
  18. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  19. package/build/components/block-settings-menu-controls/index.js +19 -9
  20. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  21. package/build/components/block-title/use-block-display-title.js +7 -5
  22. package/build/components/block-title/use-block-display-title.js.map +1 -1
  23. package/build/components/block-toolbar/index.js +4 -0
  24. package/build/components/block-toolbar/index.js.map +1 -1
  25. package/build/components/border-radius-control/index.js +0 -1
  26. package/build/components/border-radius-control/index.js.map +1 -1
  27. package/build/components/border-radius-control/utils.js +1 -1
  28. package/build/components/border-radius-control/utils.js.map +1 -1
  29. package/build/components/colors-gradients/control.js +3 -1
  30. package/build/components/colors-gradients/control.js.map +1 -1
  31. package/build/components/date-format-picker/index.js +132 -0
  32. package/build/components/date-format-picker/index.js.map +1 -0
  33. package/build/components/index.js +9 -0
  34. package/build/components/index.js.map +1 -1
  35. package/build/components/line-height-control/index.js +5 -3
  36. package/build/components/line-height-control/index.js.map +1 -1
  37. package/build/components/list-view/block-select-button.js +4 -22
  38. package/build/components/list-view/block-select-button.js.map +1 -1
  39. package/build/components/list-view/block.js +33 -12
  40. package/build/components/list-view/block.js.map +1 -1
  41. package/build/components/list-view/branch.js +16 -13
  42. package/build/components/list-view/branch.js.map +1 -1
  43. package/build/components/list-view/index.js +7 -1
  44. package/build/components/list-view/index.js.map +1 -1
  45. package/build/components/list-view/use-block-selection.js +9 -2
  46. package/build/components/list-view/use-block-selection.js.map +1 -1
  47. package/build/components/rich-text/index.js +2 -2
  48. package/build/components/rich-text/index.js.map +1 -1
  49. package/build/components/rich-text/index.native.js +13 -9
  50. package/build/components/rich-text/index.native.js.map +1 -1
  51. package/build/components/url-popover/image-url-input-ui.js +11 -27
  52. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  53. package/build/hooks/anchor.js +7 -6
  54. package/build/hooks/anchor.js.map +1 -1
  55. package/build/hooks/gap.js +70 -5
  56. package/build/hooks/gap.js.map +1 -1
  57. package/build/layouts/flex.js +8 -5
  58. package/build/layouts/flex.js.map +1 -1
  59. package/build/layouts/flow.js +16 -12
  60. package/build/layouts/flow.js.map +1 -1
  61. package/build/store/defaults.js +1 -0
  62. package/build/store/defaults.js.map +1 -1
  63. package/build/store/selectors.js +29 -3
  64. package/build/store/selectors.js.map +1 -1
  65. package/build-module/components/block-list/block-html.js +5 -2
  66. package/build-module/components/block-list/block-html.js.map +1 -1
  67. package/build-module/components/block-list/block.js +5 -2
  68. package/build-module/components/block-list/block.js.map +1 -1
  69. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +18 -0
  70. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  71. package/build-module/components/block-lock/index.js +4 -0
  72. package/build-module/components/block-lock/index.js.map +1 -0
  73. package/build-module/components/block-lock/menu-item.js +44 -0
  74. package/build-module/components/block-lock/menu-item.js.map +1 -0
  75. package/build-module/components/block-lock/modal.js +128 -0
  76. package/build-module/components/block-lock/modal.js.map +1 -0
  77. package/build-module/components/block-lock/toolbar.js +55 -0
  78. package/build-module/components/block-lock/toolbar.js.map +1 -0
  79. package/build-module/components/block-settings-menu/block-settings-dropdown.js +26 -6
  80. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  81. package/build-module/components/block-settings-menu-controls/index.js +18 -9
  82. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  83. package/build-module/components/block-title/use-block-display-title.js +7 -5
  84. package/build-module/components/block-title/use-block-display-title.js.map +1 -1
  85. package/build-module/components/block-toolbar/index.js +3 -0
  86. package/build-module/components/block-toolbar/index.js.map +1 -1
  87. package/build-module/components/border-radius-control/index.js +0 -1
  88. package/build-module/components/border-radius-control/index.js.map +1 -1
  89. package/build-module/components/border-radius-control/utils.js +1 -1
  90. package/build-module/components/border-radius-control/utils.js.map +1 -1
  91. package/build-module/components/colors-gradients/control.js +3 -1
  92. package/build-module/components/colors-gradients/control.js.map +1 -1
  93. package/build-module/components/date-format-picker/index.js +122 -0
  94. package/build-module/components/date-format-picker/index.js.map +1 -0
  95. package/build-module/components/index.js +1 -0
  96. package/build-module/components/index.js.map +1 -1
  97. package/build-module/components/line-height-control/index.js +5 -3
  98. package/build-module/components/line-height-control/index.js.map +1 -1
  99. package/build-module/components/list-view/block-select-button.js +5 -20
  100. package/build-module/components/list-view/block-select-button.js.map +1 -1
  101. package/build-module/components/list-view/block.js +31 -12
  102. package/build-module/components/list-view/block.js.map +1 -1
  103. package/build-module/components/list-view/branch.js +16 -13
  104. package/build-module/components/list-view/branch.js.map +1 -1
  105. package/build-module/components/list-view/index.js +7 -1
  106. package/build-module/components/list-view/index.js.map +1 -1
  107. package/build-module/components/list-view/use-block-selection.js +10 -3
  108. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  109. package/build-module/components/rich-text/index.js +2 -2
  110. package/build-module/components/rich-text/index.js.map +1 -1
  111. package/build-module/components/rich-text/index.native.js +13 -9
  112. package/build-module/components/rich-text/index.native.js.map +1 -1
  113. package/build-module/components/url-popover/image-url-input-ui.js +12 -28
  114. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  115. package/build-module/hooks/anchor.js +7 -6
  116. package/build-module/hooks/anchor.js.map +1 -1
  117. package/build-module/hooks/gap.js +68 -7
  118. package/build-module/hooks/gap.js.map +1 -1
  119. package/build-module/layouts/flex.js +7 -5
  120. package/build-module/layouts/flex.js.map +1 -1
  121. package/build-module/layouts/flow.js +15 -12
  122. package/build-module/layouts/flow.js.map +1 -1
  123. package/build-module/store/defaults.js +1 -0
  124. package/build-module/store/defaults.js.map +1 -1
  125. package/build-module/store/selectors.js +24 -1
  126. package/build-module/store/selectors.js.map +1 -1
  127. package/build-style/style-rtl.css +157 -0
  128. package/build-style/style.css +157 -0
  129. package/package.json +28 -27
  130. package/src/components/block-list/block-html.js +8 -4
  131. package/src/components/block-list/block.js +5 -1
  132. package/src/components/block-list/use-block-props/use-focus-first-element.js +28 -0
  133. package/src/components/block-lock/index.js +3 -0
  134. package/src/components/block-lock/menu-item.js +52 -0
  135. package/src/components/block-lock/modal.js +165 -0
  136. package/src/components/block-lock/style.scss +67 -0
  137. package/src/components/block-lock/toolbar.js +58 -0
  138. package/src/components/block-settings-menu/block-settings-dropdown.js +47 -5
  139. package/src/components/block-settings-menu-controls/index.js +33 -12
  140. package/src/components/block-title/README.md +6 -1
  141. package/src/components/block-title/test/index.js +43 -1
  142. package/src/components/block-title/use-block-display-title.js +9 -6
  143. package/src/components/block-toolbar/index.js +6 -0
  144. package/src/components/block-toolbar/style.scss +4 -0
  145. package/src/components/block-tools/style.scss +29 -0
  146. package/src/components/border-radius-control/index.js +0 -1
  147. package/src/components/border-radius-control/test/utils.js +4 -0
  148. package/src/components/border-radius-control/utils.js +2 -1
  149. package/src/components/color-palette/test/__snapshots__/control.js.snap +70 -4
  150. package/src/components/colors-gradients/control.js +1 -1
  151. package/src/components/colors-gradients/style.scss +6 -0
  152. package/src/components/date-format-picker/README.md +58 -0
  153. package/src/components/date-format-picker/index.js +161 -0
  154. package/src/components/date-format-picker/style.scss +31 -0
  155. package/src/components/index.js +1 -0
  156. package/src/components/line-height-control/index.js +3 -3
  157. package/src/components/link-control/README.md +1 -1
  158. package/src/components/list-view/block-select-button.js +2 -29
  159. package/src/components/list-view/block.js +47 -12
  160. package/src/components/list-view/branch.js +37 -15
  161. package/src/components/list-view/index.js +6 -0
  162. package/src/components/list-view/use-block-selection.js +15 -2
  163. package/src/components/rich-text/index.js +1 -1
  164. package/src/components/rich-text/index.native.js +24 -8
  165. package/src/components/url-popover/image-url-input-ui.js +16 -29
  166. package/src/hooks/anchor.js +8 -6
  167. package/src/hooks/gap.js +83 -12
  168. package/src/hooks/test/gap.js +42 -0
  169. package/src/layouts/flex.js +6 -3
  170. package/src/layouts/flow.js +16 -11
  171. package/src/store/defaults.js +1 -0
  172. package/src/store/selectors.js +26 -1
  173. package/src/store/test/selectors.js +63 -0
  174. package/src/style.scss +2 -0
@@ -737,6 +737,69 @@
737
737
  display: none;
738
738
  }
739
739
 
740
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot,
741
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot,
742
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar,
743
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown,
744
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group {
745
+ padding-right: 6px;
746
+ padding-left: 6px;
747
+ }
748
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot > .components-button,
749
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot > div > .components-button,
750
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot > .components-dropdown .components-button,
751
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot > .components-button,
752
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot > div > .components-button,
753
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot > .components-dropdown .components-button,
754
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar > .components-button,
755
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar > div > .components-button,
756
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar > .components-dropdown .components-button,
757
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown > .components-button,
758
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown > div > .components-button,
759
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown > .components-dropdown .components-button,
760
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group > .components-button,
761
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group > div > .components-button,
762
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group > .components-dropdown .components-button {
763
+ min-width: 36px;
764
+ padding-right: 6px;
765
+ padding-left: 6px;
766
+ }
767
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot > .components-button svg,
768
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot > div > .components-button svg,
769
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot > .components-dropdown .components-button svg,
770
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot > .components-button svg,
771
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot > div > .components-button svg,
772
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot > .components-dropdown .components-button svg,
773
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar > .components-button svg,
774
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar > div > .components-button svg,
775
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar > .components-dropdown .components-button svg,
776
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown > .components-button svg,
777
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown > div > .components-button svg,
778
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown > .components-dropdown .components-button svg,
779
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group > .components-button svg,
780
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group > div > .components-button svg,
781
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group > .components-dropdown .components-button svg {
782
+ min-width: 24px;
783
+ }
784
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot > .components-button::before,
785
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot > div > .components-button::before,
786
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot > .components-dropdown .components-button::before,
787
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot > .components-button::before,
788
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot > div > .components-button::before,
789
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot > .components-dropdown .components-button::before,
790
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar > .components-button::before,
791
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar > div > .components-button::before,
792
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar > .components-dropdown .components-button::before,
793
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown > .components-button::before,
794
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown > div > .components-button::before,
795
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown > .components-dropdown .components-button::before,
796
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group > .components-button::before,
797
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group > div > .components-button::before,
798
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group > .components-dropdown .components-button::before {
799
+ right: 2px;
800
+ left: 2px;
801
+ }
802
+
740
803
  .is-vertical .block-list-appender {
741
804
  width: 24px;
742
805
  margin-left: auto;
@@ -753,6 +816,66 @@
753
816
  transform: scale(0);
754
817
  }
755
818
 
819
+ .block-editor-block-lock-modal {
820
+ z-index: 1000001;
821
+ }
822
+ @media (min-width: 600px) {
823
+ .block-editor-block-lock-modal .components-modal__frame {
824
+ max-width: 480px;
825
+ }
826
+ }
827
+
828
+ .block-editor-block-lock-modal__checklist {
829
+ margin: 0;
830
+ }
831
+
832
+ .block-editor-block-lock-modal__options-title {
833
+ border-bottom: 1px solid #ddd;
834
+ padding: 12px 0;
835
+ }
836
+ .block-editor-block-lock-modal__options-title .components-checkbox-control__label {
837
+ font-weight: 600;
838
+ }
839
+ .block-editor-block-lock-modal__options-title .components-base-control__field {
840
+ align-items: center;
841
+ display: flex;
842
+ margin: 0;
843
+ }
844
+
845
+ .block-editor-block-lock-modal__checklist-item {
846
+ border-bottom: 1px solid #ddd;
847
+ margin-bottom: 0;
848
+ padding: 12px 12px 12px 0;
849
+ }
850
+ .block-editor-block-lock-modal__checklist-item .components-base-control__field {
851
+ align-items: center;
852
+ display: flex;
853
+ margin: 0;
854
+ }
855
+ .block-editor-block-lock-modal__checklist-item .components-checkbox-control__label {
856
+ display: flex;
857
+ align-items: center;
858
+ justify-content: space-between;
859
+ flex-grow: 1;
860
+ }
861
+ .block-editor-block-lock-modal__checklist-item .components-checkbox-control__label svg {
862
+ margin-left: 12px;
863
+ fill: #1e1e1e;
864
+ }
865
+
866
+ .block-editor-block-lock-modal__actions {
867
+ margin-top: 24px;
868
+ }
869
+
870
+ .block-editor-block-lock-toolbar .components-button.has-icon {
871
+ min-width: 36px !important;
872
+ padding-right: 0 !important;
873
+ }
874
+ .block-editor-block-lock-toolbar .components-button.has-icon:focus::before {
875
+ right: 0 !important;
876
+ left: 12px !important;
877
+ }
878
+
756
879
  .block-editor-block-breadcrumb {
757
880
  list-style: none;
758
881
  padding: 0;
@@ -1768,6 +1891,10 @@
1768
1891
  margin-bottom: 12px;
1769
1892
  }
1770
1893
 
1894
+ .block-editor-color-gradient-control__fieldset {
1895
+ min-width: 0;
1896
+ }
1897
+
1771
1898
  .block-editor-panel-color-gradient-settings .block-editor-panel-color-gradient-settings__panel-title {
1772
1899
  display: flex;
1773
1900
  gap: 8px;
@@ -1932,6 +2059,33 @@
1932
2059
  cursor: text;
1933
2060
  }
1934
2061
 
2062
+ .block-editor-date-format-picker {
2063
+ margin-bottom: 16px;
2064
+ }
2065
+
2066
+ .block-editor-date-format-picker__default-format-toggle-control__hint {
2067
+ color: #757575;
2068
+ display: block;
2069
+ }
2070
+
2071
+ .block-editor-date-format-picker__custom-format-select-control.components-base-control {
2072
+ margin-bottom: 0;
2073
+ }
2074
+ .block-editor-date-format-picker__custom-format-select-control .components-custom-select-control__button {
2075
+ width: 100%;
2076
+ }
2077
+
2078
+ .block-editor-date-format-picker__custom-format-select-control__custom-option {
2079
+ border-top: 1px solid #ddd;
2080
+ }
2081
+ .block-editor-date-format-picker__custom-format-select-control__custom-option.has-hint {
2082
+ grid-template-columns: auto 30px;
2083
+ }
2084
+ .block-editor-date-format-picker__custom-format-select-control__custom-option .components-custom-select-control__item-hint {
2085
+ grid-row: 2;
2086
+ text-align: right;
2087
+ }
2088
+
1935
2089
  .block-editor-duotone-control__popover > .components-popover__content > div {
1936
2090
  padding: 16px;
1937
2091
  width: 280px;
@@ -3732,6 +3886,9 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
3732
3886
  .block-editor-block-toolbar__block-controls .block-editor-block-mover {
3733
3887
  margin-right: -6px;
3734
3888
  }
3889
+ .block-editor-block-toolbar__block-controls .block-editor-block-lock-toolbar {
3890
+ margin-right: -6px !important;
3891
+ }
3735
3892
 
3736
3893
  .block-editor-block-toolbar .components-toolbar-group,
3737
3894
  .block-editor-block-toolbar .components-toolbar,
@@ -737,6 +737,69 @@
737
737
  display: none;
738
738
  }
739
739
 
740
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot,
741
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot,
742
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar,
743
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown,
744
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group {
745
+ padding-left: 6px;
746
+ padding-right: 6px;
747
+ }
748
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot > .components-button,
749
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot > div > .components-button,
750
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot > .components-dropdown .components-button,
751
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot > .components-button,
752
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot > div > .components-button,
753
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot > .components-dropdown .components-button,
754
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar > .components-button,
755
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar > div > .components-button,
756
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar > .components-dropdown .components-button,
757
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown > .components-button,
758
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown > div > .components-button,
759
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown > .components-dropdown .components-button,
760
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group > .components-button,
761
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group > div > .components-button,
762
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group > .components-dropdown .components-button {
763
+ min-width: 36px;
764
+ padding-left: 6px;
765
+ padding-right: 6px;
766
+ }
767
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot > .components-button svg,
768
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot > div > .components-button svg,
769
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot > .components-dropdown .components-button svg,
770
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot > .components-button svg,
771
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot > div > .components-button svg,
772
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot > .components-dropdown .components-button svg,
773
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar > .components-button svg,
774
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar > div > .components-button svg,
775
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar > .components-dropdown .components-button svg,
776
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown > .components-button svg,
777
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown > div > .components-button svg,
778
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown > .components-dropdown .components-button svg,
779
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group > .components-button svg,
780
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group > div > .components-button svg,
781
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group > .components-dropdown .components-button svg {
782
+ min-width: 24px;
783
+ }
784
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot > .components-button::before,
785
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot > div > .components-button::before,
786
+ .block-editor-block-toolbar > .components-toolbar > .block-editor-block-toolbar__slot > .components-dropdown .components-button::before,
787
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot > .components-button::before,
788
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot > div > .components-button::before,
789
+ .block-editor-block-toolbar > .components-toolbar-group > .block-editor-block-toolbar__slot > .components-dropdown .components-button::before,
790
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar > .components-button::before,
791
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar > div > .components-button::before,
792
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-toolbar > .components-dropdown .components-button::before,
793
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown > .components-button::before,
794
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown > div > .components-button::before,
795
+ .block-editor-block-toolbar > .block-editor-block-toolbar__slot > .components-dropdown > .components-dropdown .components-button::before,
796
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group > .components-button::before,
797
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group > div > .components-button::before,
798
+ .block-editor-block-toolbar .block-editor-block-toolbar__slot .components-toolbar-group > .components-dropdown .components-button::before {
799
+ left: 2px;
800
+ right: 2px;
801
+ }
802
+
740
803
  .is-vertical .block-list-appender {
741
804
  width: 24px;
742
805
  margin-right: auto;
@@ -753,6 +816,66 @@
753
816
  transform: scale(0);
754
817
  }
755
818
 
819
+ .block-editor-block-lock-modal {
820
+ z-index: 1000001;
821
+ }
822
+ @media (min-width: 600px) {
823
+ .block-editor-block-lock-modal .components-modal__frame {
824
+ max-width: 480px;
825
+ }
826
+ }
827
+
828
+ .block-editor-block-lock-modal__checklist {
829
+ margin: 0;
830
+ }
831
+
832
+ .block-editor-block-lock-modal__options-title {
833
+ border-bottom: 1px solid #ddd;
834
+ padding: 12px 0;
835
+ }
836
+ .block-editor-block-lock-modal__options-title .components-checkbox-control__label {
837
+ font-weight: 600;
838
+ }
839
+ .block-editor-block-lock-modal__options-title .components-base-control__field {
840
+ align-items: center;
841
+ display: flex;
842
+ margin: 0;
843
+ }
844
+
845
+ .block-editor-block-lock-modal__checklist-item {
846
+ border-bottom: 1px solid #ddd;
847
+ margin-bottom: 0;
848
+ padding: 12px 0 12px 12px;
849
+ }
850
+ .block-editor-block-lock-modal__checklist-item .components-base-control__field {
851
+ align-items: center;
852
+ display: flex;
853
+ margin: 0;
854
+ }
855
+ .block-editor-block-lock-modal__checklist-item .components-checkbox-control__label {
856
+ display: flex;
857
+ align-items: center;
858
+ justify-content: space-between;
859
+ flex-grow: 1;
860
+ }
861
+ .block-editor-block-lock-modal__checklist-item .components-checkbox-control__label svg {
862
+ margin-right: 12px;
863
+ fill: #1e1e1e;
864
+ }
865
+
866
+ .block-editor-block-lock-modal__actions {
867
+ margin-top: 24px;
868
+ }
869
+
870
+ .block-editor-block-lock-toolbar .components-button.has-icon {
871
+ min-width: 36px !important;
872
+ padding-left: 0 !important;
873
+ }
874
+ .block-editor-block-lock-toolbar .components-button.has-icon:focus::before {
875
+ left: 0 !important;
876
+ right: 12px !important;
877
+ }
878
+
756
879
  .block-editor-block-breadcrumb {
757
880
  list-style: none;
758
881
  padding: 0;
@@ -1768,6 +1891,10 @@
1768
1891
  margin-bottom: 12px;
1769
1892
  }
1770
1893
 
1894
+ .block-editor-color-gradient-control__fieldset {
1895
+ min-width: 0;
1896
+ }
1897
+
1771
1898
  .block-editor-panel-color-gradient-settings .block-editor-panel-color-gradient-settings__panel-title {
1772
1899
  display: flex;
1773
1900
  gap: 8px;
@@ -1932,6 +2059,33 @@
1932
2059
  cursor: text;
1933
2060
  }
1934
2061
 
2062
+ .block-editor-date-format-picker {
2063
+ margin-bottom: 16px;
2064
+ }
2065
+
2066
+ .block-editor-date-format-picker__default-format-toggle-control__hint {
2067
+ color: #757575;
2068
+ display: block;
2069
+ }
2070
+
2071
+ .block-editor-date-format-picker__custom-format-select-control.components-base-control {
2072
+ margin-bottom: 0;
2073
+ }
2074
+ .block-editor-date-format-picker__custom-format-select-control .components-custom-select-control__button {
2075
+ width: 100%;
2076
+ }
2077
+
2078
+ .block-editor-date-format-picker__custom-format-select-control__custom-option {
2079
+ border-top: 1px solid #ddd;
2080
+ }
2081
+ .block-editor-date-format-picker__custom-format-select-control__custom-option.has-hint {
2082
+ grid-template-columns: auto 30px;
2083
+ }
2084
+ .block-editor-date-format-picker__custom-format-select-control__custom-option .components-custom-select-control__item-hint {
2085
+ grid-row: 2;
2086
+ text-align: left;
2087
+ }
2088
+
1935
2089
  .block-editor-duotone-control__popover > .components-popover__content > div {
1936
2090
  padding: 16px;
1937
2091
  width: 280px;
@@ -3732,6 +3886,9 @@ figcaption.block-editor-rich-text__editable [data-rich-text-placeholder]::before
3732
3886
  .block-editor-block-toolbar__block-controls .block-editor-block-mover {
3733
3887
  margin-left: -6px;
3734
3888
  }
3889
+ .block-editor-block-toolbar__block-controls .block-editor-block-lock-toolbar {
3890
+ margin-left: -6px !important;
3891
+ }
3735
3892
 
3736
3893
  .block-editor-block-toolbar .components-toolbar-group,
3737
3894
  .block-editor-block-toolbar .components-toolbar,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-editor",
3
- "version": "8.3.1",
3
+ "version": "8.4.0",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -33,31 +33,32 @@
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.16.0",
35
35
  "@react-spring/web": "^9.2.4",
36
- "@wordpress/a11y": "^3.4.1",
37
- "@wordpress/api-fetch": "^6.1.1",
38
- "@wordpress/blob": "^3.4.1",
39
- "@wordpress/blocks": "^11.3.1",
40
- "@wordpress/components": "^19.6.1",
41
- "@wordpress/compose": "^5.2.1",
42
- "@wordpress/data": "^6.4.1",
43
- "@wordpress/deprecated": "^3.4.1",
44
- "@wordpress/dom": "^3.4.1",
45
- "@wordpress/element": "^4.2.1",
46
- "@wordpress/hooks": "^3.4.1",
47
- "@wordpress/html-entities": "^3.4.1",
48
- "@wordpress/i18n": "^4.4.1",
49
- "@wordpress/icons": "^8.0.1",
50
- "@wordpress/is-shallow-equal": "^4.4.1",
51
- "@wordpress/keyboard-shortcuts": "^3.2.1",
52
- "@wordpress/keycodes": "^3.4.1",
53
- "@wordpress/notices": "^3.4.1",
54
- "@wordpress/rich-text": "^5.2.1",
55
- "@wordpress/shortcode": "^3.4.1",
56
- "@wordpress/style-engine": "^0.3.1",
57
- "@wordpress/token-list": "^2.4.1",
58
- "@wordpress/url": "^3.5.1",
59
- "@wordpress/warning": "^2.4.1",
60
- "@wordpress/wordcount": "^3.4.1",
36
+ "@wordpress/a11y": "^3.5.0",
37
+ "@wordpress/api-fetch": "^6.2.0",
38
+ "@wordpress/blob": "^3.5.0",
39
+ "@wordpress/blocks": "^11.4.0",
40
+ "@wordpress/components": "^19.7.0",
41
+ "@wordpress/compose": "^5.3.0",
42
+ "@wordpress/data": "^6.5.0",
43
+ "@wordpress/date": "^4.5.0",
44
+ "@wordpress/deprecated": "^3.5.0",
45
+ "@wordpress/dom": "^3.5.0",
46
+ "@wordpress/element": "^4.3.0",
47
+ "@wordpress/hooks": "^3.5.0",
48
+ "@wordpress/html-entities": "^3.5.0",
49
+ "@wordpress/i18n": "^4.5.0",
50
+ "@wordpress/icons": "^8.1.0",
51
+ "@wordpress/is-shallow-equal": "^4.5.0",
52
+ "@wordpress/keyboard-shortcuts": "^3.3.0",
53
+ "@wordpress/keycodes": "^3.5.0",
54
+ "@wordpress/notices": "^3.5.0",
55
+ "@wordpress/rich-text": "^5.3.0",
56
+ "@wordpress/shortcode": "^3.5.0",
57
+ "@wordpress/style-engine": "^0.4.0",
58
+ "@wordpress/token-list": "^2.5.0",
59
+ "@wordpress/url": "^3.6.0",
60
+ "@wordpress/warning": "^2.5.0",
61
+ "@wordpress/wordcount": "^3.5.0",
61
62
  "classnames": "^2.3.1",
62
63
  "colord": "^2.7.0",
63
64
  "diff": "^4.0.2",
@@ -76,5 +77,5 @@
76
77
  "publishConfig": {
77
78
  "access": "public"
78
79
  },
79
- "gitHead": "3494eafea7cb345728166c902b3d1223c4a8db6f"
80
+ "gitHead": "aa003c3634016cc4ab6348b2106907e371c648e1"
80
81
  }
@@ -12,8 +12,8 @@ import {
12
12
  getBlockAttributes,
13
13
  getBlockContent,
14
14
  getBlockType,
15
- isValidBlockContent,
16
15
  getSaveContent,
16
+ validateBlock,
17
17
  } from '@wordpress/blocks';
18
18
 
19
19
  /**
@@ -43,9 +43,13 @@ function BlockHTML( { clientId } ) {
43
43
 
44
44
  // If html is empty we reset the block to the default HTML and mark it as valid to avoid triggering an error
45
45
  const content = html ? html : getSaveContent( blockType, attributes );
46
- const isValid = html
47
- ? isValidBlockContent( blockType, attributes, content )
48
- : true;
46
+ const [ isValid ] = html
47
+ ? validateBlock( {
48
+ ...block,
49
+ attributes,
50
+ originalContent: content,
51
+ } )
52
+ : [ true ];
49
53
 
50
54
  updateBlock( clientId, {
51
55
  attributes,
@@ -17,6 +17,7 @@ import {
17
17
  getBlockType,
18
18
  getSaveContent,
19
19
  isUnmodifiedDefaultBlock,
20
+ serializeRawBlock,
20
21
  } from '@wordpress/blocks';
21
22
  import { withFilters } from '@wordpress/components';
22
23
  import {
@@ -74,6 +75,7 @@ function Block( { children, isHtml, ...props } ) {
74
75
  }
75
76
 
76
77
  function BlockListBlock( {
78
+ block: { __unstableBlockSource },
77
79
  mode,
78
80
  isLocked,
79
81
  canRemove,
@@ -155,7 +157,9 @@ function BlockListBlock( {
155
157
  let block;
156
158
 
157
159
  if ( ! isValid ) {
158
- const saveContent = getSaveContent( blockType, attributes );
160
+ const saveContent = __unstableBlockSource
161
+ ? serializeRawBlock( __unstableBlockSource )
162
+ : getSaveContent( blockType, attributes );
159
163
 
160
164
  block = (
161
165
  <Block className="has-warning">
@@ -52,6 +52,16 @@ function useInitialPosition( clientId ) {
52
52
  );
53
53
  }
54
54
 
55
+ function isFormElement( element ) {
56
+ const { tagName } = element;
57
+ return (
58
+ tagName === 'INPUT' ||
59
+ tagName === 'BUTTON' ||
60
+ tagName === 'SELECT' ||
61
+ tagName === 'TEXTAREA'
62
+ );
63
+ }
64
+
55
65
  /**
56
66
  * Transitions focus to the block or inner tabbable when the block becomes
57
67
  * selected and an initial position is set.
@@ -96,6 +106,24 @@ export function useFocusFirstElement( clientId ) {
96
106
  return;
97
107
  }
98
108
 
109
+ // Check to see if element is focussable before a generic caret insert.
110
+ if ( ! target.getAttribute( 'contenteditable' ) ) {
111
+ const focusElement = focus.tabbable.findNext( target );
112
+ // Make sure focusElement is valid, form field, and within the current target element.
113
+ // Ensure is not block inserter trigger, don't want to focus that in the event of the group block which doesn't contain any other focussable elements.
114
+ if (
115
+ focusElement &&
116
+ isFormElement( focusElement ) &&
117
+ target.contains( focusElement ) &&
118
+ ! focusElement.classList.contains(
119
+ 'block-editor-button-block-appender'
120
+ )
121
+ ) {
122
+ focusElement.focus();
123
+ return;
124
+ }
125
+ }
126
+
99
127
  setContentEditableWrapper( ref.current, false );
100
128
 
101
129
  placeCaretAtHorizontalEdge( target, isReverse );
@@ -0,0 +1,3 @@
1
+ export { default as BlockLockMenuItem } from './menu-item';
2
+ export { default as BlockLockModal } from './modal';
3
+ export { default as BlockLockToolbar } from './toolbar';
@@ -0,0 +1,52 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { useReducer } from '@wordpress/element';
6
+ import { MenuItem } from '@wordpress/components';
7
+ import { useSelect } from '@wordpress/data';
8
+ import { lock, unlock } from '@wordpress/icons';
9
+
10
+ /**
11
+ * Internal dependencies
12
+ */
13
+ import BlockLockModal from './modal';
14
+ import { store as blockEditorStore } from '../../store';
15
+
16
+ export default function BlockLockMenuItem( { clientId } ) {
17
+ const { isLocked } = useSelect(
18
+ ( select ) => {
19
+ const {
20
+ canMoveBlock,
21
+ canRemoveBlock,
22
+ getBlockRootClientId,
23
+ } = select( blockEditorStore );
24
+ const rootClientId = getBlockRootClientId( clientId );
25
+
26
+ return {
27
+ isLocked:
28
+ ! canMoveBlock( clientId, rootClientId ) ||
29
+ ! canRemoveBlock( clientId, rootClientId ),
30
+ };
31
+ },
32
+ [ clientId ]
33
+ );
34
+
35
+ const [ isModalOpen, toggleModal ] = useReducer(
36
+ ( isActive ) => ! isActive,
37
+ false
38
+ );
39
+
40
+ const label = isLocked ? __( 'Unlock' ) : __( 'Lock' );
41
+
42
+ return (
43
+ <>
44
+ <MenuItem icon={ isLocked ? unlock : lock } onClick={ toggleModal }>
45
+ { label }
46
+ </MenuItem>
47
+ { isModalOpen && (
48
+ <BlockLockModal clientId={ clientId } onClose={ toggleModal } />
49
+ ) }
50
+ </>
51
+ );
52
+ }