@wordpress/block-editor 8.0.3 → 8.0.7

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 (78) hide show
  1. package/build/components/block-preview/auto.js +1 -0
  2. package/build/components/block-preview/auto.js.map +1 -1
  3. package/build/components/block-tools/block-selection-button.js +7 -1
  4. package/build/components/block-tools/block-selection-button.js.map +1 -1
  5. package/build/components/colors/with-colors.js +6 -4
  6. package/build/components/colors/with-colors.js.map +1 -1
  7. package/build/components/colors-gradients/control.js +4 -2
  8. package/build/components/colors-gradients/control.js.map +1 -1
  9. package/build/components/colors-gradients/panel-color-gradient-settings.js +9 -68
  10. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  11. package/build/components/colors-gradients/use-common-single-multiple-selects.js +21 -0
  12. package/build/components/colors-gradients/use-common-single-multiple-selects.js.map +1 -0
  13. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +98 -0
  14. package/build/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -0
  15. package/build/components/gradients/use-gradient.js +7 -6
  16. package/build/components/gradients/use-gradient.js.map +1 -1
  17. package/build/components/use-setting/index.js +1 -1
  18. package/build/components/use-setting/index.js.map +1 -1
  19. package/build/hooks/border-color.js +11 -12
  20. package/build/hooks/border-color.js.map +1 -1
  21. package/build/hooks/color.js +29 -21
  22. package/build/hooks/color.js.map +1 -1
  23. package/build/hooks/typography.js +3 -0
  24. package/build/hooks/typography.js.map +1 -1
  25. package/build/hooks/use-color-props.js +13 -4
  26. package/build/hooks/use-color-props.js.map +1 -1
  27. package/build/store/selectors.js +37 -43
  28. package/build/store/selectors.js.map +1 -1
  29. package/build-module/components/block-preview/auto.js +1 -0
  30. package/build-module/components/block-preview/auto.js.map +1 -1
  31. package/build-module/components/block-tools/block-selection-button.js +7 -1
  32. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  33. package/build-module/components/colors/with-colors.js +6 -4
  34. package/build-module/components/colors/with-colors.js.map +1 -1
  35. package/build-module/components/colors-gradients/control.js +4 -2
  36. package/build-module/components/colors-gradients/control.js.map +1 -1
  37. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +7 -69
  38. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  39. package/build-module/components/colors-gradients/use-common-single-multiple-selects.js +11 -0
  40. package/build-module/components/colors-gradients/use-common-single-multiple-selects.js.map +1 -0
  41. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +85 -0
  42. package/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js.map +1 -0
  43. package/build-module/components/gradients/use-gradient.js +8 -6
  44. package/build-module/components/gradients/use-gradient.js.map +1 -1
  45. package/build-module/components/use-setting/index.js +1 -1
  46. package/build-module/components/use-setting/index.js.map +1 -1
  47. package/build-module/hooks/border-color.js +10 -12
  48. package/build-module/hooks/border-color.js.map +1 -1
  49. package/build-module/hooks/color.js +30 -22
  50. package/build-module/hooks/color.js.map +1 -1
  51. package/build-module/hooks/typography.js +1 -2
  52. package/build-module/hooks/typography.js.map +1 -1
  53. package/build-module/hooks/use-color-props.js +11 -3
  54. package/build-module/hooks/use-color-props.js.map +1 -1
  55. package/build-module/store/selectors.js +37 -43
  56. package/build-module/store/selectors.js.map +1 -1
  57. package/build-style/style-rtl.css +72 -68
  58. package/build-style/style.css +72 -68
  59. package/package.json +3 -3
  60. package/src/components/block-list-appender/style.scss +0 -42
  61. package/src/components/block-preview/auto.js +3 -0
  62. package/src/components/block-preview/style.scss +5 -0
  63. package/src/components/block-tools/block-selection-button.js +5 -1
  64. package/src/components/button-block-appender/style.scss +0 -17
  65. package/src/components/colors/with-colors.js +11 -5
  66. package/src/components/colors-gradients/control.js +2 -0
  67. package/src/components/colors-gradients/panel-color-gradient-settings.js +5 -60
  68. package/src/components/colors-gradients/use-common-single-multiple-selects.js +11 -0
  69. package/src/components/colors-gradients/use-multiple-origin-colors-and-gradients.js +107 -0
  70. package/src/components/default-block-appender/style.scss +90 -16
  71. package/src/components/gradients/use-gradient.js +16 -7
  72. package/src/components/inner-blocks/style.scss +4 -10
  73. package/src/components/use-setting/index.js +2 -2
  74. package/src/hooks/border-color.js +14 -9
  75. package/src/hooks/color.js +58 -26
  76. package/src/hooks/typography.js +1 -1
  77. package/src/hooks/use-color-props.js +23 -4
  78. package/src/store/selectors.js +14 -26
@@ -728,35 +728,6 @@
728
728
  display: none;
729
729
  }
730
730
 
731
- .block-editor-block-list__block .block-list-appender {
732
- align-self: center;
733
- padding: 0;
734
- list-style: none;
735
- margin-bottom: revert;
736
- }
737
- .block-editor-block-list__block .block-list-appender.wp-block {
738
- max-width: none;
739
- }
740
- .block-editor-block-list__block .block-list-appender .block-editor-default-block-appender {
741
- margin: 8px 0;
742
- }
743
- .block-editor-block-list__block .block-list-appender .block-list-appender__toggle {
744
- padding: 0;
745
- opacity: 1;
746
- transform: scale(1);
747
- transition: all 0.1s ease;
748
- margin-right: 8px;
749
- }
750
- @media (prefers-reduced-motion: reduce) {
751
- .block-editor-block-list__block .block-list-appender .block-list-appender__toggle {
752
- transition-duration: 0s;
753
- transition-delay: 0s;
754
- }
755
- }
756
- .block-editor-block-list__block .block-list-appender:first-of-type .block-list-appender__toggle {
757
- margin-right: 0;
758
- }
759
-
760
731
  .is-vertical .block-list-appender {
761
732
  width: 24px;
762
733
  margin-left: auto;
@@ -1213,6 +1184,10 @@
1213
1184
  display: none;
1214
1185
  }
1215
1186
 
1187
+ .block-editor-block-preview__content-iframe .block-list-appender {
1188
+ display: none;
1189
+ }
1190
+
1216
1191
  .block-editor-block-settings-menu__popover .components-dropdown-menu__menu {
1217
1192
  padding: 0;
1218
1193
  }
@@ -1762,20 +1737,6 @@
1762
1737
  .block-editor-button-block-appender:active {
1763
1738
  color: #000;
1764
1739
  }
1765
- .block-editor-button-block-appender.block-list-appender__toggle {
1766
- display: flex;
1767
- flex-direction: row;
1768
- box-shadow: none;
1769
- height: 24px;
1770
- width: 24px;
1771
- }
1772
- .block-editor-button-block-appender.block-list-appender__toggle > svg {
1773
- width: 24px;
1774
- background-color: #1e1e1e;
1775
- color: #fff;
1776
- border-radius: 2px;
1777
- flex: 1 0 auto;
1778
- }
1779
1740
 
1780
1741
  .block-editor-color-gradient-control .block-editor-color-gradient-control__color-indicator {
1781
1742
  margin-bottom: 12px;
@@ -1805,6 +1766,14 @@
1805
1766
  margin: 0;
1806
1767
  }
1807
1768
 
1769
+ /**
1770
+ * Default block appender.
1771
+ *
1772
+ * This component shows up in 3 places:
1773
+ * - the black plus that sits at the end of the canvas, if the last block isn't a paragraph
1774
+ * - on the right, inside empty paragraphs
1775
+ * - absolute positioned and blue inside nesting containers
1776
+ */
1808
1777
  .block-editor-default-block-appender {
1809
1778
  clear: both;
1810
1779
  margin-right: auto;
@@ -1821,32 +1790,72 @@
1821
1790
  display: none;
1822
1791
  }
1823
1792
 
1824
- .block-editor-block-list__empty-block-inserter.block-editor-block-list__empty-block-inserter,
1825
- .block-editor-default-block-appender .block-editor-inserter {
1793
+ .block-editor-default-block-appender .block-editor-inserter,
1794
+ .block-editor-block-list__empty-block-inserter.block-editor-block-list__empty-block-inserter {
1826
1795
  position: absolute;
1827
1796
  top: 0;
1828
- height: 32px;
1797
+ left: 0;
1798
+ line-height: 0;
1829
1799
  }
1830
- .block-editor-block-list__empty-block-inserter.block-editor-block-list__empty-block-inserter .block-editor-inserter__toggle,
1831
- .block-editor-default-block-appender .block-editor-inserter .block-editor-inserter__toggle {
1832
- margin-left: 0;
1800
+ .block-editor-default-block-appender .block-editor-inserter:disabled,
1801
+ .block-editor-block-list__empty-block-inserter.block-editor-block-list__empty-block-inserter:disabled {
1802
+ display: none;
1833
1803
  }
1834
1804
 
1835
- @media (min-width: 600px) {
1836
- .block-editor-block-list__empty-block-inserter,
1837
- .block-editor-default-block-appender .block-editor-inserter {
1838
- display: flex;
1839
- height: 100%;
1840
- }
1805
+ /**
1806
+ * Fixed position appender.
1807
+ * These styles apply to all in-canvas inserters that exist inside nesting containers.
1808
+ */
1809
+ .block-editor-block-list__block .block-list-appender {
1810
+ position: absolute;
1811
+ list-style: none;
1812
+ padding: 0;
1813
+ z-index: 2;
1814
+ bottom: 0;
1815
+ left: 0;
1816
+ }
1817
+ .block-editor-block-list__block .block-list-appender.block-list-appender {
1818
+ margin: 0;
1819
+ line-height: 0;
1820
+ }
1821
+ .block-editor-block-list__block .block-list-appender .block-editor-default-block-appender {
1822
+ height: 24px;
1823
+ }
1824
+ .block-editor-block-list__block .block-list-appender .block-editor-inserter__toggle.components-button.has-icon,
1825
+ .block-editor-block-list__block .block-list-appender .block-list-appender__toggle {
1826
+ flex-direction: row;
1827
+ box-shadow: none;
1828
+ height: 24px;
1829
+ width: 24px;
1830
+ display: none;
1831
+ padding: 0 !important;
1832
+ background: #1e1e1e;
1833
+ color: #fff;
1834
+ }
1835
+ .block-editor-block-list__block .block-list-appender .block-editor-inserter__toggle.components-button.has-icon:hover,
1836
+ .block-editor-block-list__block .block-list-appender .block-list-appender__toggle:hover {
1837
+ color: #fff;
1838
+ background: var(--wp-admin-theme-color);
1841
1839
  }
1842
- .block-editor-block-list__empty-block-inserter:disabled,
1843
- .block-editor-default-block-appender .block-editor-inserter:disabled {
1840
+ .block-editor-block-list__block .block-list-appender .block-editor-default-block-appender__content {
1844
1841
  display: none;
1845
1842
  }
1843
+ .block-editor-block-list__block .block-list-appender:only-child {
1844
+ position: relative;
1845
+ left: auto;
1846
+ align-self: center;
1847
+ list-style: none;
1848
+ line-height: inherit;
1849
+ }
1850
+ .block-editor-block-list__block .block-list-appender:only-child .block-editor-default-block-appender__content {
1851
+ display: block;
1852
+ }
1846
1853
 
1847
- .block-editor-default-block-appender.has-visible-prompt .block-editor-inserter,
1848
- .block-editor-block-list__empty-block-inserter {
1849
- left: 0;
1854
+ .block-editor-block-list__block.is-selected .block-editor-block-list__layout > .block-list-appender .block-editor-inserter__toggle.components-button.has-icon,
1855
+ .block-editor-block-list__block.is-selected .block-editor-block-list__layout > .block-list-appender .block-list-appender__toggle,
1856
+ .block-editor-block-list__block.is-selected > .block-list-appender .block-editor-inserter__toggle.components-button.has-icon,
1857
+ .block-editor-block-list__block.is-selected > .block-list-appender .block-list-appender__toggle {
1858
+ display: flex;
1850
1859
  }
1851
1860
 
1852
1861
  .block-editor-duotone-control__popover > .components-popover__content > div {
@@ -2384,16 +2393,11 @@
2384
2393
  .block-editor-block-list__layout.has-overlay::after {
2385
2394
  content: "";
2386
2395
  position: absolute;
2387
- top: -14px;
2388
- left: -14px;
2389
- bottom: -14px;
2390
- right: -14px;
2391
- z-index: 60;
2392
- }
2393
-
2394
- [data-align=full] .has-overlay::after {
2396
+ top: 0;
2395
2397
  left: 0;
2398
+ bottom: 0;
2396
2399
  right: 0;
2400
+ z-index: 60;
2397
2401
  }
2398
2402
 
2399
2403
  .block-editor-block-types-list__list-item {
@@ -728,35 +728,6 @@
728
728
  display: none;
729
729
  }
730
730
 
731
- .block-editor-block-list__block .block-list-appender {
732
- align-self: center;
733
- padding: 0;
734
- list-style: none;
735
- margin-bottom: revert;
736
- }
737
- .block-editor-block-list__block .block-list-appender.wp-block {
738
- max-width: none;
739
- }
740
- .block-editor-block-list__block .block-list-appender .block-editor-default-block-appender {
741
- margin: 8px 0;
742
- }
743
- .block-editor-block-list__block .block-list-appender .block-list-appender__toggle {
744
- padding: 0;
745
- opacity: 1;
746
- transform: scale(1);
747
- transition: all 0.1s ease;
748
- margin-left: 8px;
749
- }
750
- @media (prefers-reduced-motion: reduce) {
751
- .block-editor-block-list__block .block-list-appender .block-list-appender__toggle {
752
- transition-duration: 0s;
753
- transition-delay: 0s;
754
- }
755
- }
756
- .block-editor-block-list__block .block-list-appender:first-of-type .block-list-appender__toggle {
757
- margin-left: 0;
758
- }
759
-
760
731
  .is-vertical .block-list-appender {
761
732
  width: 24px;
762
733
  margin-right: auto;
@@ -1213,6 +1184,10 @@
1213
1184
  display: none;
1214
1185
  }
1215
1186
 
1187
+ .block-editor-block-preview__content-iframe .block-list-appender {
1188
+ display: none;
1189
+ }
1190
+
1216
1191
  .block-editor-block-settings-menu__popover .components-dropdown-menu__menu {
1217
1192
  padding: 0;
1218
1193
  }
@@ -1762,20 +1737,6 @@
1762
1737
  .block-editor-button-block-appender:active {
1763
1738
  color: #000;
1764
1739
  }
1765
- .block-editor-button-block-appender.block-list-appender__toggle {
1766
- display: flex;
1767
- flex-direction: row;
1768
- box-shadow: none;
1769
- height: 24px;
1770
- width: 24px;
1771
- }
1772
- .block-editor-button-block-appender.block-list-appender__toggle > svg {
1773
- width: 24px;
1774
- background-color: #1e1e1e;
1775
- color: #fff;
1776
- border-radius: 2px;
1777
- flex: 1 0 auto;
1778
- }
1779
1740
 
1780
1741
  .block-editor-color-gradient-control .block-editor-color-gradient-control__color-indicator {
1781
1742
  margin-bottom: 12px;
@@ -1805,6 +1766,14 @@
1805
1766
  margin: 0;
1806
1767
  }
1807
1768
 
1769
+ /**
1770
+ * Default block appender.
1771
+ *
1772
+ * This component shows up in 3 places:
1773
+ * - the black plus that sits at the end of the canvas, if the last block isn't a paragraph
1774
+ * - on the right, inside empty paragraphs
1775
+ * - absolute positioned and blue inside nesting containers
1776
+ */
1808
1777
  .block-editor-default-block-appender {
1809
1778
  clear: both;
1810
1779
  margin-left: auto;
@@ -1821,32 +1790,72 @@
1821
1790
  display: none;
1822
1791
  }
1823
1792
 
1824
- .block-editor-block-list__empty-block-inserter.block-editor-block-list__empty-block-inserter,
1825
- .block-editor-default-block-appender .block-editor-inserter {
1793
+ .block-editor-default-block-appender .block-editor-inserter,
1794
+ .block-editor-block-list__empty-block-inserter.block-editor-block-list__empty-block-inserter {
1826
1795
  position: absolute;
1827
1796
  top: 0;
1828
- height: 32px;
1797
+ right: 0;
1798
+ line-height: 0;
1829
1799
  }
1830
- .block-editor-block-list__empty-block-inserter.block-editor-block-list__empty-block-inserter .block-editor-inserter__toggle,
1831
- .block-editor-default-block-appender .block-editor-inserter .block-editor-inserter__toggle {
1832
- margin-right: 0;
1800
+ .block-editor-default-block-appender .block-editor-inserter:disabled,
1801
+ .block-editor-block-list__empty-block-inserter.block-editor-block-list__empty-block-inserter:disabled {
1802
+ display: none;
1833
1803
  }
1834
1804
 
1835
- @media (min-width: 600px) {
1836
- .block-editor-block-list__empty-block-inserter,
1837
- .block-editor-default-block-appender .block-editor-inserter {
1838
- display: flex;
1839
- height: 100%;
1840
- }
1805
+ /**
1806
+ * Fixed position appender.
1807
+ * These styles apply to all in-canvas inserters that exist inside nesting containers.
1808
+ */
1809
+ .block-editor-block-list__block .block-list-appender {
1810
+ position: absolute;
1811
+ list-style: none;
1812
+ padding: 0;
1813
+ z-index: 2;
1814
+ bottom: 0;
1815
+ right: 0;
1816
+ }
1817
+ .block-editor-block-list__block .block-list-appender.block-list-appender {
1818
+ margin: 0;
1819
+ line-height: 0;
1820
+ }
1821
+ .block-editor-block-list__block .block-list-appender .block-editor-default-block-appender {
1822
+ height: 24px;
1823
+ }
1824
+ .block-editor-block-list__block .block-list-appender .block-editor-inserter__toggle.components-button.has-icon,
1825
+ .block-editor-block-list__block .block-list-appender .block-list-appender__toggle {
1826
+ flex-direction: row;
1827
+ box-shadow: none;
1828
+ height: 24px;
1829
+ width: 24px;
1830
+ display: none;
1831
+ padding: 0 !important;
1832
+ background: #1e1e1e;
1833
+ color: #fff;
1834
+ }
1835
+ .block-editor-block-list__block .block-list-appender .block-editor-inserter__toggle.components-button.has-icon:hover,
1836
+ .block-editor-block-list__block .block-list-appender .block-list-appender__toggle:hover {
1837
+ color: #fff;
1838
+ background: var(--wp-admin-theme-color);
1841
1839
  }
1842
- .block-editor-block-list__empty-block-inserter:disabled,
1843
- .block-editor-default-block-appender .block-editor-inserter:disabled {
1840
+ .block-editor-block-list__block .block-list-appender .block-editor-default-block-appender__content {
1844
1841
  display: none;
1845
1842
  }
1843
+ .block-editor-block-list__block .block-list-appender:only-child {
1844
+ position: relative;
1845
+ right: auto;
1846
+ align-self: center;
1847
+ list-style: none;
1848
+ line-height: inherit;
1849
+ }
1850
+ .block-editor-block-list__block .block-list-appender:only-child .block-editor-default-block-appender__content {
1851
+ display: block;
1852
+ }
1846
1853
 
1847
- .block-editor-default-block-appender.has-visible-prompt .block-editor-inserter,
1848
- .block-editor-block-list__empty-block-inserter {
1849
- right: 0;
1854
+ .block-editor-block-list__block.is-selected .block-editor-block-list__layout > .block-list-appender .block-editor-inserter__toggle.components-button.has-icon,
1855
+ .block-editor-block-list__block.is-selected .block-editor-block-list__layout > .block-list-appender .block-list-appender__toggle,
1856
+ .block-editor-block-list__block.is-selected > .block-list-appender .block-editor-inserter__toggle.components-button.has-icon,
1857
+ .block-editor-block-list__block.is-selected > .block-list-appender .block-list-appender__toggle {
1858
+ display: flex;
1850
1859
  }
1851
1860
 
1852
1861
  .block-editor-duotone-control__popover > .components-popover__content > div {
@@ -2384,16 +2393,11 @@
2384
2393
  .block-editor-block-list__layout.has-overlay::after {
2385
2394
  content: "";
2386
2395
  position: absolute;
2387
- top: -14px;
2388
- right: -14px;
2389
- bottom: -14px;
2390
- left: -14px;
2391
- z-index: 60;
2392
- }
2393
-
2394
- [data-align=full] .has-overlay::after {
2396
+ top: 0;
2395
2397
  right: 0;
2398
+ bottom: 0;
2396
2399
  left: 0;
2400
+ z-index: 60;
2397
2401
  }
2398
2402
 
2399
2403
  .block-editor-block-types-list__list-item {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-editor",
3
- "version": "8.0.3",
3
+ "version": "8.0.7",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -38,7 +38,7 @@
38
38
  "@wordpress/blob": "^3.2.2",
39
39
  "@wordpress/block-serialization-default-parser": "^4.2.3",
40
40
  "@wordpress/blocks": "^11.1.4",
41
- "@wordpress/components": "^19.0.3",
41
+ "@wordpress/components": "^19.1.1",
42
42
  "@wordpress/compose": "^5.0.6",
43
43
  "@wordpress/data": "^6.1.4",
44
44
  "@wordpress/deprecated": "^3.2.3",
@@ -75,5 +75,5 @@
75
75
  "publishConfig": {
76
76
  "access": "public"
77
77
  },
78
- "gitHead": "c6594e767659bd3289e633a17c44fdf6a4933194"
78
+ "gitHead": "49c7be0ff5dc493fc9e5a861e18273dd1f3fce8c"
79
79
  }
@@ -1,45 +1,3 @@
1
- // These styles are only applied to the appender when it appears inside of a block.
2
- // Otherwise the default appender may be improperly positioned in some themes.
3
- .block-editor-block-list__block .block-list-appender {
4
- align-self: center;
5
- padding: 0;
6
- list-style: none;
7
-
8
- // Themes sometimes apply a max-width to all elements classed blocks.
9
- &.wp-block {
10
- max-width: none;
11
- }
12
-
13
- .block-editor-default-block-appender {
14
- margin: $grid-unit-10 0;
15
- }
16
-
17
- // Zero out the margin that's inherited from common.scss.
18
- margin-bottom: revert;
19
-
20
- // Black square plus appender.
21
- .block-list-appender__toggle {
22
- padding: 0;
23
-
24
- // Animate appearance.
25
- opacity: 1;
26
- transform: scale(1);
27
- transition: all 0.1s ease;
28
- @include reduce-motion("transition");
29
-
30
- // The black square button should have a little left margin in horizontal containers.
31
- margin-left: $grid-unit-10;
32
- }
33
-
34
- // Cancel any left margin if the black plus sits alone in the container.
35
- // `first-of-type` is used instead of `first-child` as the element is not always the only
36
- // element in the "empty" container. For example the empty navigation block state has a
37
- // zero-width placeholder state that is meant to help correctly size the dimensions.
38
- &:first-of-type .block-list-appender__toggle {
39
- margin-left: 0;
40
- }
41
- }
42
-
43
1
  // For vertical flex containers, a 100% width ensures correct alignment.
44
2
  .is-vertical .block-list-appender {
45
3
  width: $icon-size;
@@ -50,6 +50,9 @@ function AutoBlockPreview( { viewportWidth, __experimentalPadding } ) {
50
50
  const {
51
51
  ownerDocument: { documentElement },
52
52
  } = bodyElement;
53
+ documentElement.classList.add(
54
+ 'block-editor-block-preview__content-iframe'
55
+ );
53
56
  documentElement.style.position = 'absolute';
54
57
  documentElement.style.width = '100%';
55
58
  bodyElement.style.padding =
@@ -36,3 +36,8 @@
36
36
  }
37
37
  }
38
38
  }
39
+
40
+ // Hide inserter from previews.
41
+ .block-editor-block-preview__content-iframe .block-list-appender {
42
+ display: none;
43
+ }
@@ -100,6 +100,7 @@ function BlockSelectionButton( { clientId, rootClientId, blockElement } ) {
100
100
  getMultiSelectedBlocksEndClientId,
101
101
  getPreviousBlockClientId,
102
102
  getNextBlockClientId,
103
+ isNavigationMode,
103
104
  } = useSelect( blockEditorStore );
104
105
  const {
105
106
  selectBlock,
@@ -157,7 +158,10 @@ function BlockSelectionButton( { clientId, rootClientId, blockElement } ) {
157
158
  selectedBlockClientId;
158
159
  }
159
160
  const startingBlockClientId = hasBlockMovingClientId();
160
-
161
+ if ( isEscape && isNavigationMode() ) {
162
+ clearSelectedBlock();
163
+ event.preventDefault();
164
+ }
161
165
  if ( isEscape && startingBlockClientId && ! event.defaultPrevented ) {
162
166
  setBlockMovingClientId( null );
163
167
  event.preventDefault();
@@ -26,21 +26,4 @@
26
26
  &:active {
27
27
  color: $black;
28
28
  }
29
-
30
- // This variant is used in inline situations, like Buttons, Social Links, Navigation Menu.
31
- &.block-list-appender__toggle {
32
- display: flex;
33
- flex-direction: row;
34
- box-shadow: none;
35
- height: $icon-size;
36
- width: $icon-size;
37
-
38
- & > svg {
39
- width: $icon-size;
40
- background-color: $gray-900;
41
- color: $white;
42
- border-radius: $radius-block-ui;
43
- flex: 1 0 auto;
44
- }
45
- }
46
29
  }
@@ -6,7 +6,7 @@ import { isString, kebabCase, reduce, upperFirst } from 'lodash';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { Component } from '@wordpress/element';
9
+ import { useMemo, Component } from '@wordpress/element';
10
10
  import { compose, createHigherOrderComponent } from '@wordpress/compose';
11
11
 
12
12
  /**
@@ -20,8 +20,6 @@ import {
20
20
  } from './utils';
21
21
  import useSetting from '../use-setting';
22
22
 
23
- const DEFAULT_COLORS = [];
24
-
25
23
  /**
26
24
  * Higher order component factory for injecting the `colorsArray` argument as
27
25
  * the colors prop in the `withCustomColors` HOC.
@@ -47,8 +45,16 @@ const withCustomColorPalette = ( colorsArray ) =>
47
45
  const withEditorColorPalette = () =>
48
46
  createHigherOrderComponent(
49
47
  ( WrappedComponent ) => ( props ) => {
50
- const colors = useSetting( 'color.palette' ) || DEFAULT_COLORS;
51
- return <WrappedComponent { ...props } colors={ colors } />;
48
+ const { palette: colorPerOrigin } = useSetting( 'color' ) || {};
49
+ const allColors = useMemo(
50
+ () => [
51
+ ...( colorPerOrigin?.custom || [] ),
52
+ ...( colorPerOrigin?.theme || [] ),
53
+ ...( colorPerOrigin?.default || [] ),
54
+ ],
55
+ [ colorPerOrigin ]
56
+ );
57
+ return <WrappedComponent { ...props } colors={ allColors } />;
52
58
  },
53
59
  'withEditorColorPalette'
54
60
  );
@@ -44,6 +44,7 @@ function ColorGradientControlInner( {
44
44
  gradientValue,
45
45
  clearable,
46
46
  showTitle = true,
47
+ enableAlpha,
47
48
  } ) {
48
49
  const canChooseAColor =
49
50
  onColorChange && ( ! isEmpty( colors ) || ! disableCustomColors );
@@ -109,6 +110,7 @@ function ColorGradientControlInner( {
109
110
  __experimentalHasMultipleOrigins
110
111
  }
111
112
  clearable={ clearable }
113
+ enableAlpha={ enableAlpha }
112
114
  />
113
115
  ) }
114
116
  { ( currentTab === 'gradient' || ! canChooseAColor ) && (
@@ -9,7 +9,6 @@ import { every, isEmpty } from 'lodash';
9
9
  */
10
10
  import { PanelBody, ColorIndicator } from '@wordpress/components';
11
11
  import { sprintf, __ } from '@wordpress/i18n';
12
- import { useMemo } from '@wordpress/element';
13
12
 
14
13
  /**
15
14
  * Internal dependencies
@@ -18,6 +17,8 @@ import ColorGradientControl from './control';
18
17
  import { getColorObjectByColorValue } from '../colors';
19
18
  import { __experimentalGetGradientObjectByGradientValue } from '../gradients';
20
19
  import useSetting from '../use-setting';
20
+ import useCommonSingleMultipleSelects from './use-common-single-multiple-selects';
21
+ import useMultipleOriginColorsAndGradients from './use-multiple-origin-colors-and-gradients';
21
22
 
22
23
  // translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)
23
24
  const colorIndicatorAriaLabel = __( '(%s: color %s)' );
@@ -92,6 +93,7 @@ export const PanelColorGradientSettingsInner = ( {
92
93
  title,
93
94
  showTitle = true,
94
95
  __experimentalHasMultipleOrigins,
96
+ enableAlpha,
95
97
  ...props
96
98
  } ) => {
97
99
  if (
@@ -143,6 +145,7 @@ export const PanelColorGradientSettingsInner = ( {
143
145
  disableCustomColors,
144
146
  disableCustomGradients,
145
147
  __experimentalHasMultipleOrigins,
148
+ enableAlpha,
146
149
  ...setting,
147
150
  } }
148
151
  />
@@ -152,13 +155,6 @@ export const PanelColorGradientSettingsInner = ( {
152
155
  );
153
156
  };
154
157
 
155
- function useCommonSingleMultipleSelects() {
156
- return {
157
- disableCustomColors: ! useSetting( 'color.custom' ),
158
- disableCustomGradients: ! useSetting( 'color.customGradient' ),
159
- };
160
- }
161
-
162
158
  const PanelColorGradientSettingsSingleSelect = ( props ) => {
163
159
  const colorGradientSettings = useCommonSingleMultipleSelects();
164
160
  colorGradientSettings.colors = useSetting( 'color.palette' );
@@ -171,58 +167,7 @@ const PanelColorGradientSettingsSingleSelect = ( props ) => {
171
167
  };
172
168
 
173
169
  const PanelColorGradientSettingsMultipleSelect = ( props ) => {
174
- const colorGradientSettings = useCommonSingleMultipleSelects();
175
- const userColors = useSetting( 'color.palette.user' );
176
- const themeColors = useSetting( 'color.palette.theme' );
177
- const coreColors = useSetting( 'color.palette.core' );
178
- colorGradientSettings.colors = useMemo( () => {
179
- const result = [];
180
- if ( coreColors && coreColors.length ) {
181
- result.push( {
182
- name: __( 'Core' ),
183
- colors: coreColors,
184
- } );
185
- }
186
- if ( themeColors && themeColors.length ) {
187
- result.push( {
188
- name: __( 'Theme' ),
189
- colors: themeColors,
190
- } );
191
- }
192
- if ( userColors && userColors.length ) {
193
- result.push( {
194
- name: __( 'User' ),
195
- colors: userColors,
196
- } );
197
- }
198
- return result;
199
- }, [ coreColors, themeColors, userColors ] );
200
-
201
- const userGradients = useSetting( 'color.gradients.user' );
202
- const themeGradients = useSetting( 'color.gradients.theme' );
203
- const coreGradients = useSetting( 'color.gradients.core' );
204
- colorGradientSettings.gradients = useMemo( () => {
205
- const result = [];
206
- if ( coreGradients && coreGradients.length ) {
207
- result.push( {
208
- name: __( 'Core' ),
209
- gradients: coreGradients,
210
- } );
211
- }
212
- if ( themeGradients && themeGradients.length ) {
213
- result.push( {
214
- name: __( 'Theme' ),
215
- gradients: themeGradients,
216
- } );
217
- }
218
- if ( userGradients && userGradients.length ) {
219
- result.push( {
220
- name: __( 'User' ),
221
- gradients: userGradients,
222
- } );
223
- }
224
- return result;
225
- }, [ userGradients, themeGradients, coreGradients ] );
170
+ const colorGradientSettings = useMultipleOriginColorsAndGradients();
226
171
  return (
227
172
  <PanelColorGradientSettingsInner
228
173
  { ...{ ...colorGradientSettings, ...props } }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import useSetting from '../use-setting';
5
+
6
+ export default function useCommonSingleMultipleSelects() {
7
+ return {
8
+ disableCustomColors: ! useSetting( 'color.custom' ),
9
+ disableCustomGradients: ! useSetting( 'color.customGradient' ),
10
+ };
11
+ }