@wordpress/block-editor 12.19.3 → 12.19.5

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 (165) hide show
  1. package/build/components/block-actions/index.js +45 -32
  2. package/build/components/block-actions/index.js.map +1 -1
  3. package/build/components/block-bindings-toolbar-indicator/index.js +25 -0
  4. package/build/components/block-bindings-toolbar-indicator/index.js.map +1 -0
  5. package/build/components/block-edit/context.js +2 -1
  6. package/build/components/block-edit/context.js.map +1 -1
  7. package/build/components/block-edit/index.js +8 -3
  8. package/build/components/block-edit/index.js.map +1 -1
  9. package/build/components/block-inspector/index.js +5 -4
  10. package/build/components/block-inspector/index.js.map +1 -1
  11. package/build/components/block-list/use-block-props/index.js +8 -1
  12. package/build/components/block-list/use-block-props/index.js.map +1 -1
  13. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -3
  14. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  15. package/build/components/block-preview/index.js +4 -0
  16. package/build/components/block-preview/index.js.map +1 -1
  17. package/build/components/block-settings-menu/block-settings-dropdown.js +12 -10
  18. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  19. package/build/components/block-toolbar/index.js +14 -5
  20. package/build/components/block-toolbar/index.js.map +1 -1
  21. package/build/components/global-styles/border-panel.js +21 -8
  22. package/build/components/global-styles/border-panel.js.map +1 -1
  23. package/build/components/global-styles/index.js +6 -0
  24. package/build/components/global-styles/index.js.map +1 -1
  25. package/build/components/global-styles/shadow-panel-components.js +80 -23
  26. package/build/components/global-styles/shadow-panel-components.js.map +1 -1
  27. package/build/components/inspector-controls-tabs/styles-tab.js +1 -1
  28. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  29. package/build/components/link-control/link-preview.js +4 -1
  30. package/build/components/link-control/link-preview.js.map +1 -1
  31. package/build/components/list-view/block-select-button.js +10 -2
  32. package/build/components/list-view/block-select-button.js.map +1 -1
  33. package/build/components/list-view/use-clipboard-handler.js +2 -1
  34. package/build/components/list-view/use-clipboard-handler.js.map +1 -1
  35. package/build/components/rich-text/index.js +46 -26
  36. package/build/components/rich-text/index.js.map +1 -1
  37. package/build/components/rich-text/use-enter.js +3 -0
  38. package/build/components/rich-text/use-enter.js.map +1 -1
  39. package/build/components/url-popover/index.js +3 -3
  40. package/build/components/url-popover/index.js.map +1 -1
  41. package/build/components/writing-flow/use-clipboard-handler.js +2 -1
  42. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
  43. package/build/components/writing-flow/utils.js +23 -6
  44. package/build/components/writing-flow/utils.js.map +1 -1
  45. package/build/hooks/block-hooks.js +34 -8
  46. package/build/hooks/block-hooks.js.map +1 -1
  47. package/build/hooks/border.js +6 -4
  48. package/build/hooks/border.js.map +1 -1
  49. package/build/hooks/use-bindings-attributes.js +171 -48
  50. package/build/hooks/use-bindings-attributes.js.map +1 -1
  51. package/build/private-apis.js +5 -1
  52. package/build/private-apis.js.map +1 -1
  53. package/build/store/actions.js +40 -6
  54. package/build/store/actions.js.map +1 -1
  55. package/build/store/private-actions.js +0 -10
  56. package/build/store/private-actions.js.map +1 -1
  57. package/build/store/private-selectors.js +0 -8
  58. package/build/store/private-selectors.js.map +1 -1
  59. package/build/store/reducer.js +1 -16
  60. package/build/store/reducer.js.map +1 -1
  61. package/build-module/components/block-actions/index.js +45 -32
  62. package/build-module/components/block-actions/index.js.map +1 -1
  63. package/build-module/components/block-bindings-toolbar-indicator/index.js +18 -0
  64. package/build-module/components/block-bindings-toolbar-indicator/index.js.map +1 -0
  65. package/build-module/components/block-edit/context.js +1 -0
  66. package/build-module/components/block-edit/context.js.map +1 -1
  67. package/build-module/components/block-edit/index.js +9 -4
  68. package/build-module/components/block-edit/index.js.map +1 -1
  69. package/build-module/components/block-inspector/index.js +6 -5
  70. package/build-module/components/block-inspector/index.js.map +1 -1
  71. package/build-module/components/block-list/use-block-props/index.js +9 -2
  72. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  73. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -3
  74. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  75. package/build-module/components/block-preview/index.js +4 -0
  76. package/build-module/components/block-preview/index.js.map +1 -1
  77. package/build-module/components/block-settings-menu/block-settings-dropdown.js +12 -10
  78. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  79. package/build-module/components/block-toolbar/index.js +14 -5
  80. package/build-module/components/block-toolbar/index.js.map +1 -1
  81. package/build-module/components/global-styles/border-panel.js +22 -10
  82. package/build-module/components/global-styles/border-panel.js.map +1 -1
  83. package/build-module/components/global-styles/index.js +1 -1
  84. package/build-module/components/global-styles/index.js.map +1 -1
  85. package/build-module/components/global-styles/shadow-panel-components.js +82 -24
  86. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  87. package/build-module/components/inspector-controls-tabs/styles-tab.js +2 -2
  88. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  89. package/build-module/components/link-control/link-preview.js +5 -2
  90. package/build-module/components/link-control/link-preview.js.map +1 -1
  91. package/build-module/components/list-view/block-select-button.js +11 -3
  92. package/build-module/components/list-view/block-select-button.js.map +1 -1
  93. package/build-module/components/list-view/use-clipboard-handler.js +3 -2
  94. package/build-module/components/list-view/use-clipboard-handler.js.map +1 -1
  95. package/build-module/components/rich-text/index.js +47 -28
  96. package/build-module/components/rich-text/index.js.map +1 -1
  97. package/build-module/components/rich-text/use-enter.js +3 -0
  98. package/build-module/components/rich-text/use-enter.js.map +1 -1
  99. package/build-module/components/url-popover/index.js +3 -3
  100. package/build-module/components/url-popover/index.js.map +1 -1
  101. package/build-module/components/writing-flow/use-clipboard-handler.js +3 -2
  102. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
  103. package/build-module/components/writing-flow/utils.js +22 -7
  104. package/build-module/components/writing-flow/utils.js.map +1 -1
  105. package/build-module/hooks/block-hooks.js +34 -8
  106. package/build-module/hooks/block-hooks.js.map +1 -1
  107. package/build-module/hooks/border.js +7 -5
  108. package/build-module/hooks/border.js.map +1 -1
  109. package/build-module/hooks/use-bindings-attributes.js +172 -49
  110. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  111. package/build-module/private-apis.js +5 -1
  112. package/build-module/private-apis.js.map +1 -1
  113. package/build-module/store/actions.js +40 -6
  114. package/build-module/store/actions.js.map +1 -1
  115. package/build-module/store/private-actions.js +0 -9
  116. package/build-module/store/private-actions.js.map +1 -1
  117. package/build-module/store/private-selectors.js +0 -6
  118. package/build-module/store/private-selectors.js.map +1 -1
  119. package/build-module/store/reducer.js +1 -16
  120. package/build-module/store/reducer.js.map +1 -1
  121. package/build-style/content-rtl.css +1 -0
  122. package/build-style/content.css +1 -0
  123. package/build-style/default-editor-styles-rtl.css +1 -0
  124. package/build-style/default-editor-styles.css +1 -0
  125. package/build-style/style-rtl.css +70 -14
  126. package/build-style/style.css +70 -14
  127. package/package.json +8 -8
  128. package/src/components/block-actions/index.js +57 -47
  129. package/src/components/block-bindings-toolbar-indicator/index.js +20 -0
  130. package/src/components/block-bindings-toolbar-indicator/style.scss +14 -0
  131. package/src/components/block-edit/context.js +1 -0
  132. package/src/components/block-edit/index.js +5 -1
  133. package/src/components/block-inspector/index.js +7 -5
  134. package/src/components/block-list/use-block-props/index.js +12 -2
  135. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -7
  136. package/src/components/block-preview/index.js +6 -1
  137. package/src/components/block-settings-menu/block-settings-dropdown.js +12 -9
  138. package/src/components/block-toolbar/index.js +14 -4
  139. package/src/components/block-toolbar/style.scss +11 -6
  140. package/src/components/global-styles/border-panel.js +33 -22
  141. package/src/components/global-styles/index.js +5 -1
  142. package/src/components/global-styles/shadow-panel-components.js +92 -23
  143. package/src/components/global-styles/style.scss +33 -10
  144. package/src/components/inspector-controls-tabs/styles-tab.js +2 -2
  145. package/src/components/link-control/link-preview.js +9 -2
  146. package/src/components/link-control/style.scss +9 -0
  147. package/src/components/list-view/block-select-button.js +16 -2
  148. package/src/components/list-view/style.scss +8 -0
  149. package/src/components/list-view/use-clipboard-handler.js +3 -2
  150. package/src/components/rich-text/index.js +75 -52
  151. package/src/components/rich-text/use-enter.js +4 -0
  152. package/src/components/url-popover/index.js +5 -5
  153. package/src/components/url-popover/style.scss +1 -0
  154. package/src/components/writing-flow/use-clipboard-handler.js +3 -2
  155. package/src/components/writing-flow/utils.js +31 -16
  156. package/src/hooks/block-hooks.js +46 -8
  157. package/src/hooks/block-hooks.scss +6 -0
  158. package/src/hooks/border.js +16 -4
  159. package/src/hooks/use-bindings-attributes.js +215 -65
  160. package/src/private-apis.js +4 -0
  161. package/src/store/actions.js +54 -14
  162. package/src/store/private-actions.js +0 -10
  163. package/src/store/private-selectors.js +0 -8
  164. package/src/store/reducer.js +0 -15
  165. package/src/style.scss +1 -0
@@ -97,6 +97,7 @@
97
97
  --wp-admin-border-width-focus: 2px;
98
98
  --wp-block-synced-color: #7a00df;
99
99
  --wp-block-synced-color--rgb: 122, 0, 223;
100
+ --wp-bound-block-color: #9747ff;
100
101
  }
101
102
  @media (min-resolution: 192dpi) {
102
103
  :root {
@@ -122,6 +123,20 @@
122
123
  margin-top: 0;
123
124
  }
124
125
 
126
+ .block-editor-block-bindings-toolbar-indicator {
127
+ display: inline-flex;
128
+ align-items: center;
129
+ height: 48px;
130
+ padding: 6px;
131
+ }
132
+ .block-editor-block-bindings-toolbar-indicator svg g {
133
+ stroke: var(--wp-bound-block-color);
134
+ fill: transparent;
135
+ stroke-width: 1.5;
136
+ stroke-linecap: round;
137
+ stroke-linejoin: round;
138
+ }
139
+
125
140
  iframe[name=editor-canvas] {
126
141
  width: 100%;
127
142
  height: 100%;
@@ -1550,6 +1565,17 @@ iframe[name=editor-canvas].has-editor-padding {
1550
1565
  width: 230px;
1551
1566
  }
1552
1567
 
1568
+ .block-editor-global-styles__shadow__list {
1569
+ display: flex;
1570
+ gap: 12px;
1571
+ flex-wrap: wrap;
1572
+ padding-bottom: 8px;
1573
+ }
1574
+
1575
+ .block-editor-global-styles__clear-shadow {
1576
+ text-align: left;
1577
+ }
1578
+
1553
1579
  .block-editor-global-styles-filters-panel__dropdown,
1554
1580
  .block-editor-global-styles__shadow-dropdown {
1555
1581
  display: block;
@@ -1565,21 +1591,27 @@ iframe[name=editor-canvas].has-editor-padding {
1565
1591
  background-color: #f0f0f0;
1566
1592
  }
1567
1593
 
1568
- .block-editor-global-styles__shadow-indicator-wrapper {
1569
- padding: 6px;
1570
- display: flex;
1571
- align-items: center;
1572
- justify-content: center;
1573
- }
1574
-
1575
1594
  .block-editor-global-styles__shadow-indicator {
1576
1595
  color: #2f2f2f;
1577
1596
  border: #e0e0e0 1px solid;
1578
1597
  border-radius: 2px;
1579
1598
  cursor: pointer;
1580
1599
  padding: 0;
1581
- height: 24px;
1582
- width: 24px;
1600
+ height: 26px;
1601
+ width: 26px;
1602
+ box-sizing: border-box;
1603
+ transform: scale(1);
1604
+ transition: transform 0.1s ease;
1605
+ will-change: transform;
1606
+ }
1607
+ .block-editor-global-styles__shadow-indicator:focus {
1608
+ border: 2px solid #757575;
1609
+ }
1610
+ .block-editor-global-styles__shadow-indicator:hover {
1611
+ transform: scale(1.2);
1612
+ }
1613
+ .block-editor-global-styles__shadow-indicator.unset {
1614
+ background: linear-gradient(45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
1583
1615
  }
1584
1616
 
1585
1617
  .block-editor-global-styles-advanced-panel__custom-css-input textarea {
@@ -1794,6 +1826,13 @@ iframe[name=editor-canvas].has-editor-padding {
1794
1826
  .show-icon-labels .block-editor-link-control .components-button.has-icon::before {
1795
1827
  content: attr(aria-label);
1796
1828
  }
1829
+ .show-icon-labels .block-editor-link-control .block-editor-link-control__search-item-top {
1830
+ gap: 8px;
1831
+ }
1832
+ .show-icon-labels .block-editor-link-control .block-editor-link-control__search-item-top .components-button.has-icon {
1833
+ min-width: inherit;
1834
+ width: min-content;
1835
+ }
1797
1836
 
1798
1837
  .block-editor-link-control__search-input-wrapper {
1799
1838
  margin-bottom: 8px;
@@ -2646,6 +2685,14 @@ iframe[name=editor-canvas].has-editor-padding {
2646
2685
  display: none;
2647
2686
  }
2648
2687
 
2688
+ .block-editor-list-view-block-select-button__bindings svg g {
2689
+ stroke: var(--wp-bound-block-color);
2690
+ fill: transparent;
2691
+ stroke-width: 1.5;
2692
+ stroke-linecap: round;
2693
+ stroke-linejoin: round;
2694
+ }
2695
+
2649
2696
  .modal-open .block-editor-media-replace-flow__options {
2650
2697
  display: none;
2651
2698
  }
@@ -3125,6 +3172,7 @@ iframe[name=editor-canvas].has-editor-padding {
3125
3172
  text-overflow: ellipsis;
3126
3173
  white-space: nowrap;
3127
3174
  margin-left: 8px;
3175
+ min-width: 150px;
3128
3176
  max-width: 350px;
3129
3177
  }
3130
3178
  .block-editor-url-popover__link-viewer-url.has-invalid-link {
@@ -3169,6 +3217,11 @@ iframe[name=editor-canvas].has-editor-padding {
3169
3217
  .block-editor-hooks__block-hooks .components-toggle-control .components-h-stack .components-h-stack {
3170
3218
  flex-direction: row;
3171
3219
  }
3220
+ .block-editor-hooks__block-hooks .block-editor-hooks__block-hooks-helptext {
3221
+ color: #757575;
3222
+ font-size: 12px;
3223
+ margin-bottom: 16px;
3224
+ }
3172
3225
 
3173
3226
  .block-editor-hooks__background__inspector-media-replace-container {
3174
3227
  position: relative;
@@ -3521,16 +3574,14 @@ iframe[name=editor-canvas].has-editor-padding {
3521
3574
  }
3522
3575
  .show-icon-labels .block-editor-block-mover .block-editor-block-mover__move-button-container {
3523
3576
  width: auto;
3577
+ position: relative;
3524
3578
  }
3525
3579
  @media (min-width: 600px) {
3526
- .show-icon-labels .block-editor-block-mover .block-editor-block-mover__move-button-container {
3527
- position: relative;
3528
- }
3529
- .show-icon-labels .block-editor-block-mover .block-editor-block-mover__move-button-container::before {
3580
+ .show-icon-labels .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container::before {
3530
3581
  content: "";
3531
3582
  height: 1px;
3532
3583
  width: 100%;
3533
- background: #1e1e1e;
3584
+ background: #e0e0e0;
3534
3585
  position: absolute;
3535
3586
  top: 50%;
3536
3587
  right: 50%;
@@ -3538,6 +3589,11 @@ iframe[name=editor-canvas].has-editor-padding {
3538
3589
  margin-top: -0.5px;
3539
3590
  }
3540
3591
  }
3592
+ @media (min-width: 782px) {
3593
+ .show-icon-labels .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container::before {
3594
+ background: #1e1e1e;
3595
+ }
3596
+ }
3541
3597
  .show-icon-labels .block-editor-block-mover.is-horizontal .block-editor-block-mover__move-button-container,
3542
3598
  .show-icon-labels .block-editor-block-mover.is-horizontal .block-editor-block-mover-button {
3543
3599
  padding-right: 6px;
@@ -97,6 +97,7 @@
97
97
  --wp-admin-border-width-focus: 2px;
98
98
  --wp-block-synced-color: #7a00df;
99
99
  --wp-block-synced-color--rgb: 122, 0, 223;
100
+ --wp-bound-block-color: #9747ff;
100
101
  }
101
102
  @media (min-resolution: 192dpi) {
102
103
  :root {
@@ -122,6 +123,20 @@
122
123
  margin-top: 0;
123
124
  }
124
125
 
126
+ .block-editor-block-bindings-toolbar-indicator {
127
+ display: inline-flex;
128
+ align-items: center;
129
+ height: 48px;
130
+ padding: 6px;
131
+ }
132
+ .block-editor-block-bindings-toolbar-indicator svg g {
133
+ stroke: var(--wp-bound-block-color);
134
+ fill: transparent;
135
+ stroke-width: 1.5;
136
+ stroke-linecap: round;
137
+ stroke-linejoin: round;
138
+ }
139
+
125
140
  iframe[name=editor-canvas] {
126
141
  width: 100%;
127
142
  height: 100%;
@@ -1550,6 +1565,17 @@ iframe[name=editor-canvas].has-editor-padding {
1550
1565
  width: 230px;
1551
1566
  }
1552
1567
 
1568
+ .block-editor-global-styles__shadow__list {
1569
+ display: flex;
1570
+ gap: 12px;
1571
+ flex-wrap: wrap;
1572
+ padding-bottom: 8px;
1573
+ }
1574
+
1575
+ .block-editor-global-styles__clear-shadow {
1576
+ text-align: right;
1577
+ }
1578
+
1553
1579
  .block-editor-global-styles-filters-panel__dropdown,
1554
1580
  .block-editor-global-styles__shadow-dropdown {
1555
1581
  display: block;
@@ -1565,21 +1591,27 @@ iframe[name=editor-canvas].has-editor-padding {
1565
1591
  background-color: #f0f0f0;
1566
1592
  }
1567
1593
 
1568
- .block-editor-global-styles__shadow-indicator-wrapper {
1569
- padding: 6px;
1570
- display: flex;
1571
- align-items: center;
1572
- justify-content: center;
1573
- }
1574
-
1575
1594
  .block-editor-global-styles__shadow-indicator {
1576
1595
  color: #2f2f2f;
1577
1596
  border: #e0e0e0 1px solid;
1578
1597
  border-radius: 2px;
1579
1598
  cursor: pointer;
1580
1599
  padding: 0;
1581
- height: 24px;
1582
- width: 24px;
1600
+ height: 26px;
1601
+ width: 26px;
1602
+ box-sizing: border-box;
1603
+ transform: scale(1);
1604
+ transition: transform 0.1s ease;
1605
+ will-change: transform;
1606
+ }
1607
+ .block-editor-global-styles__shadow-indicator:focus {
1608
+ border: 2px solid #757575;
1609
+ }
1610
+ .block-editor-global-styles__shadow-indicator:hover {
1611
+ transform: scale(1.2);
1612
+ }
1613
+ .block-editor-global-styles__shadow-indicator.unset {
1614
+ background: linear-gradient(-45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
1583
1615
  }
1584
1616
 
1585
1617
  .block-editor-global-styles-advanced-panel__custom-css-input textarea {
@@ -1795,6 +1827,13 @@ iframe[name=editor-canvas].has-editor-padding {
1795
1827
  .show-icon-labels .block-editor-link-control .components-button.has-icon::before {
1796
1828
  content: attr(aria-label);
1797
1829
  }
1830
+ .show-icon-labels .block-editor-link-control .block-editor-link-control__search-item-top {
1831
+ gap: 8px;
1832
+ }
1833
+ .show-icon-labels .block-editor-link-control .block-editor-link-control__search-item-top .components-button.has-icon {
1834
+ min-width: inherit;
1835
+ width: min-content;
1836
+ }
1798
1837
 
1799
1838
  .block-editor-link-control__search-input-wrapper {
1800
1839
  margin-bottom: 8px;
@@ -2647,6 +2686,14 @@ iframe[name=editor-canvas].has-editor-padding {
2647
2686
  display: none;
2648
2687
  }
2649
2688
 
2689
+ .block-editor-list-view-block-select-button__bindings svg g {
2690
+ stroke: var(--wp-bound-block-color);
2691
+ fill: transparent;
2692
+ stroke-width: 1.5;
2693
+ stroke-linecap: round;
2694
+ stroke-linejoin: round;
2695
+ }
2696
+
2650
2697
  .modal-open .block-editor-media-replace-flow__options {
2651
2698
  display: none;
2652
2699
  }
@@ -3126,6 +3173,7 @@ iframe[name=editor-canvas].has-editor-padding {
3126
3173
  text-overflow: ellipsis;
3127
3174
  white-space: nowrap;
3128
3175
  margin-right: 8px;
3176
+ min-width: 150px;
3129
3177
  max-width: 350px;
3130
3178
  }
3131
3179
  .block-editor-url-popover__link-viewer-url.has-invalid-link {
@@ -3170,6 +3218,11 @@ iframe[name=editor-canvas].has-editor-padding {
3170
3218
  .block-editor-hooks__block-hooks .components-toggle-control .components-h-stack .components-h-stack {
3171
3219
  flex-direction: row;
3172
3220
  }
3221
+ .block-editor-hooks__block-hooks .block-editor-hooks__block-hooks-helptext {
3222
+ color: #757575;
3223
+ font-size: 12px;
3224
+ margin-bottom: 16px;
3225
+ }
3173
3226
 
3174
3227
  .block-editor-hooks__background__inspector-media-replace-container {
3175
3228
  position: relative;
@@ -3522,16 +3575,14 @@ iframe[name=editor-canvas].has-editor-padding {
3522
3575
  }
3523
3576
  .show-icon-labels .block-editor-block-mover .block-editor-block-mover__move-button-container {
3524
3577
  width: auto;
3578
+ position: relative;
3525
3579
  }
3526
3580
  @media (min-width: 600px) {
3527
- .show-icon-labels .block-editor-block-mover .block-editor-block-mover__move-button-container {
3528
- position: relative;
3529
- }
3530
- .show-icon-labels .block-editor-block-mover .block-editor-block-mover__move-button-container::before {
3581
+ .show-icon-labels .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container::before {
3531
3582
  content: "";
3532
3583
  height: 1px;
3533
3584
  width: 100%;
3534
- background: #1e1e1e;
3585
+ background: #e0e0e0;
3535
3586
  position: absolute;
3536
3587
  top: 50%;
3537
3588
  left: 50%;
@@ -3539,6 +3590,11 @@ iframe[name=editor-canvas].has-editor-padding {
3539
3590
  margin-top: -0.5px;
3540
3591
  }
3541
3592
  }
3593
+ @media (min-width: 782px) {
3594
+ .show-icon-labels .block-editor-block-mover:not(.is-horizontal) .block-editor-block-mover__move-button-container::before {
3595
+ background: #1e1e1e;
3596
+ }
3597
+ }
3542
3598
  .show-icon-labels .block-editor-block-mover.is-horizontal .block-editor-block-mover__move-button-container,
3543
3599
  .show-icon-labels .block-editor-block-mover.is-horizontal .block-editor-block-mover-button {
3544
3600
  padding-left: 6px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-editor",
3
- "version": "12.19.3",
3
+ "version": "12.19.5",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -38,9 +38,9 @@
38
38
  "@wordpress/a11y": "^3.51.1",
39
39
  "@wordpress/api-fetch": "^6.48.1",
40
40
  "@wordpress/blob": "^3.51.1",
41
- "@wordpress/blocks": "^12.28.3",
42
- "@wordpress/commands": "^0.22.2",
43
- "@wordpress/components": "^26.0.2",
41
+ "@wordpress/blocks": "^12.28.5",
42
+ "@wordpress/commands": "^0.22.4",
43
+ "@wordpress/components": "^26.0.4",
44
44
  "@wordpress/compose": "^6.28.1",
45
45
  "@wordpress/data": "^9.21.1",
46
46
  "@wordpress/date": "^4.51.1",
@@ -51,14 +51,14 @@
51
51
  "@wordpress/hooks": "^3.51.1",
52
52
  "@wordpress/html-entities": "^3.51.1",
53
53
  "@wordpress/i18n": "^4.51.1",
54
- "@wordpress/icons": "^9.42.1",
54
+ "@wordpress/icons": "^9.42.3",
55
55
  "@wordpress/is-shallow-equal": "^4.51.1",
56
56
  "@wordpress/keyboard-shortcuts": "^4.28.1",
57
57
  "@wordpress/keycodes": "^3.51.1",
58
58
  "@wordpress/notices": "^4.19.1",
59
- "@wordpress/preferences": "^3.28.2",
59
+ "@wordpress/preferences": "^3.28.4",
60
60
  "@wordpress/private-apis": "^0.33.1",
61
- "@wordpress/rich-text": "^6.28.2",
61
+ "@wordpress/rich-text": "^6.28.3",
62
62
  "@wordpress/style-engine": "^1.34.1",
63
63
  "@wordpress/token-list": "^2.51.1",
64
64
  "@wordpress/url": "^3.52.1",
@@ -87,5 +87,5 @@
87
87
  "publishConfig": {
88
88
  "access": "public"
89
89
  },
90
- "gitHead": "b12d75c5c5256fda2a0509bb432e20ddd3354d5e"
90
+ "gitHead": "4927ea437069f9aed12f696df294a79bd8e12fd5"
91
91
  }
@@ -20,42 +20,55 @@ export default function BlockActions( {
20
20
  children,
21
21
  __experimentalUpdateSelection: updateSelection,
22
22
  } ) {
23
- const {
24
- canInsertBlockType,
25
- getBlockRootClientId,
26
- getBlocksByClientId,
27
- canMoveBlocks,
28
- canRemoveBlocks,
29
- } = useSelect( blockEditorStore );
30
23
  const { getDefaultBlockName, getGroupingBlockName } =
31
24
  useSelect( blocksStore );
32
-
33
- const blocks = getBlocksByClientId( clientIds );
34
- const rootClientId = getBlockRootClientId( clientIds[ 0 ] );
35
-
36
- const canCopyStyles = blocks.every( ( block ) => {
37
- return (
38
- !! block &&
39
- ( hasBlockSupport( block.name, 'color' ) ||
40
- hasBlockSupport( block.name, 'typography' ) )
41
- );
42
- } );
43
-
44
- const canDuplicate = blocks.every( ( block ) => {
45
- return (
46
- !! block &&
47
- hasBlockSupport( block.name, 'multiple', true ) &&
48
- canInsertBlockType( block.name, rootClientId )
49
- );
50
- } );
51
-
52
- const canInsertDefaultBlock = canInsertBlockType(
53
- getDefaultBlockName(),
54
- rootClientId
25
+ const selected = useSelect(
26
+ ( select ) => {
27
+ const {
28
+ canInsertBlockType,
29
+ getBlockRootClientId,
30
+ getBlocksByClientId,
31
+ getDirectInsertBlock,
32
+ canMoveBlocks,
33
+ canRemoveBlocks,
34
+ } = select( blockEditorStore );
35
+
36
+ const blocks = getBlocksByClientId( clientIds );
37
+ const rootClientId = getBlockRootClientId( clientIds[ 0 ] );
38
+ const canInsertDefaultBlock = canInsertBlockType(
39
+ getDefaultBlockName(),
40
+ rootClientId
41
+ );
42
+ const directInsertBlock = rootClientId
43
+ ? getDirectInsertBlock( rootClientId )
44
+ : null;
45
+
46
+ return {
47
+ canMove: canMoveBlocks( clientIds, rootClientId ),
48
+ canRemove: canRemoveBlocks( clientIds, rootClientId ),
49
+ canInsertBlock: canInsertDefaultBlock || !! directInsertBlock,
50
+ canCopyStyles: blocks.every( ( block ) => {
51
+ return (
52
+ !! block &&
53
+ ( hasBlockSupport( block.name, 'color' ) ||
54
+ hasBlockSupport( block.name, 'typography' ) )
55
+ );
56
+ } ),
57
+ canDuplicate: blocks.every( ( block ) => {
58
+ return (
59
+ !! block &&
60
+ hasBlockSupport( block.name, 'multiple', true ) &&
61
+ canInsertBlockType( block.name, rootClientId )
62
+ );
63
+ } ),
64
+ };
65
+ },
66
+ [ clientIds, getDefaultBlockName ]
55
67
  );
68
+ const { getBlocksByClientId, getBlocks } = useSelect( blockEditorStore );
56
69
 
57
- const canMove = canMoveBlocks( clientIds, rootClientId );
58
- const canRemove = canRemoveBlocks( clientIds, rootClientId );
70
+ const { canMove, canRemove, canInsertBlock, canCopyStyles, canDuplicate } =
71
+ selected;
59
72
 
60
73
  const {
61
74
  removeBlocks,
@@ -75,11 +88,9 @@ export default function BlockActions( {
75
88
  return children( {
76
89
  canCopyStyles,
77
90
  canDuplicate,
78
- canInsertDefaultBlock,
91
+ canInsertBlock,
79
92
  canMove,
80
93
  canRemove,
81
- rootClientId,
82
- blocks,
83
94
  onDuplicate() {
84
95
  return duplicateBlocks( clientIds, updateSelection );
85
96
  },
@@ -104,14 +115,17 @@ export default function BlockActions( {
104
115
  setBlockMovingClientId( clientIds[ 0 ] );
105
116
  },
106
117
  onGroup() {
107
- if ( ! blocks.length ) {
118
+ if ( ! clientIds.length ) {
108
119
  return;
109
120
  }
110
121
 
111
122
  const groupingBlockName = getGroupingBlockName();
112
123
 
113
124
  // Activate the `transform` on `core/group` which does the conversion.
114
- const newBlocks = switchToBlockType( blocks, groupingBlockName );
125
+ const newBlocks = switchToBlockType(
126
+ getBlocksByClientId( clientIds ),
127
+ groupingBlockName
128
+ );
115
129
 
116
130
  if ( ! newBlocks ) {
117
131
  return;
@@ -119,12 +133,11 @@ export default function BlockActions( {
119
133
  replaceBlocks( clientIds, newBlocks );
120
134
  },
121
135
  onUngroup() {
122
- if ( ! blocks.length ) {
136
+ if ( ! clientIds.length ) {
123
137
  return;
124
138
  }
125
139
 
126
- const innerBlocks = blocks[ 0 ].innerBlocks;
127
-
140
+ const innerBlocks = getBlocks( clientIds[ 0 ] );
128
141
  if ( ! innerBlocks.length ) {
129
142
  return;
130
143
  }
@@ -132,16 +145,13 @@ export default function BlockActions( {
132
145
  replaceBlocks( clientIds, innerBlocks );
133
146
  },
134
147
  onCopy() {
135
- const selectedBlockClientIds = blocks.map(
136
- ( { clientId } ) => clientId
137
- );
138
- if ( blocks.length === 1 ) {
139
- flashBlock( selectedBlockClientIds[ 0 ] );
148
+ if ( clientIds.length === 1 ) {
149
+ flashBlock( clientIds[ 0 ] );
140
150
  }
141
- notifyCopy( 'copy', selectedBlockClientIds );
151
+ notifyCopy( 'copy', clientIds );
142
152
  },
143
153
  async onPasteStyles() {
144
- await pasteStyles( blocks );
154
+ await pasteStyles( getBlocksByClientId( clientIds ) );
145
155
  },
146
156
  } );
147
157
  }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { ToolbarItem, ToolbarGroup, Icon } from '@wordpress/components';
5
+ import { connection } from '@wordpress/icons';
6
+ import { _x } from '@wordpress/i18n';
7
+
8
+ export default function BlockBindingsToolbarIndicator() {
9
+ return (
10
+ <ToolbarGroup>
11
+ <ToolbarItem
12
+ as={ 'div' }
13
+ aria-label={ _x( 'Connected', 'block toolbar button label' ) }
14
+ className="block-editor-block-bindings-toolbar-indicator"
15
+ >
16
+ <Icon icon={ connection } size={ 24 } />
17
+ </ToolbarItem>
18
+ </ToolbarGroup>
19
+ );
20
+ }
@@ -0,0 +1,14 @@
1
+ .block-editor-block-bindings-toolbar-indicator {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ height: 48px;
5
+ padding: 6px;
6
+
7
+ svg g {
8
+ stroke: var(--wp-bound-block-color);
9
+ fill: transparent;
10
+ stroke-width: 1.5;
11
+ stroke-linecap: round;
12
+ stroke-linejoin: round;
13
+ }
14
+ }
@@ -6,6 +6,7 @@ import { createContext, useContext } from '@wordpress/element';
6
6
  export const mayDisplayControlsKey = Symbol( 'mayDisplayControls' );
7
7
  export const mayDisplayParentControlsKey = Symbol( 'mayDisplayParentControls' );
8
8
  export const blockEditingModeKey = Symbol( 'blockEditingMode' );
9
+ export const blockBindingsKey = Symbol( 'blockBindings' );
9
10
 
10
11
  export const DEFAULT_BLOCK_EDIT_CONTEXT = {
11
12
  name: '',
@@ -14,6 +14,7 @@ import {
14
14
  mayDisplayControlsKey,
15
15
  mayDisplayParentControlsKey,
16
16
  blockEditingModeKey,
17
+ blockBindingsKey,
17
18
  } from './context';
18
19
 
19
20
  /**
@@ -41,7 +42,8 @@ export default function BlockEdit( {
41
42
  attributes = {},
42
43
  __unstableLayoutClassNames,
43
44
  } = props;
44
- const { layout = null } = attributes;
45
+ const { layout = null, metadata = {} } = attributes;
46
+ const { bindings } = metadata;
45
47
  const layoutSupport =
46
48
  hasBlockSupport( name, 'layout', false ) ||
47
49
  hasBlockSupport( name, '__experimentalLayout', false );
@@ -62,6 +64,7 @@ export default function BlockEdit( {
62
64
  [ mayDisplayControlsKey ]: mayDisplayControls,
63
65
  [ mayDisplayParentControlsKey ]: mayDisplayParentControls,
64
66
  [ blockEditingModeKey ]: blockEditingMode,
67
+ [ blockBindingsKey ]: bindings,
65
68
  } ),
66
69
  [
67
70
  name,
@@ -73,6 +76,7 @@ export default function BlockEdit( {
73
76
  mayDisplayControls,
74
77
  mayDisplayParentControls,
75
78
  blockEditingMode,
79
+ bindings,
76
80
  ]
77
81
  ) }
78
82
  >
@@ -30,7 +30,7 @@ import PositionControls from '../inspector-controls-tabs/position-controls-panel
30
30
  import useBlockInspectorAnimationSettings from './useBlockInspectorAnimationSettings';
31
31
  import BlockInfo from '../block-info-slot-fill';
32
32
  import BlockQuickNavigation from '../block-quick-navigation';
33
- import { getBorderPanelLabel } from '../../hooks/border';
33
+ import { useBorderPanelLabel } from '../../hooks/border';
34
34
 
35
35
  function BlockInspectorLockedBlocks( { topLevelLockedBlock } ) {
36
36
  const contentClientIds = useSelect(
@@ -116,6 +116,10 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
116
116
  selectedBlockClientId
117
117
  );
118
118
 
119
+ const borderPanelLabel = useBorderPanelLabel( {
120
+ blockName: selectedBlockName,
121
+ } );
122
+
119
123
  if ( count > 1 ) {
120
124
  return (
121
125
  <div className="block-editor-block-inspector">
@@ -140,9 +144,7 @@ const BlockInspector = ( { showNoBlockSelectedMessage = true } ) => {
140
144
  />
141
145
  <InspectorControls.Slot
142
146
  group="border"
143
- label={ getBorderPanelLabel( {
144
- blockName: selectedBlockName,
145
- } ) }
147
+ label={ borderPanelLabel }
146
148
  />
147
149
  <InspectorControls.Slot group="styles" />
148
150
  </>
@@ -251,7 +253,7 @@ const BlockInspectorSingleBlock = ( { clientId, blockName } ) => {
251
253
  [ blockName ]
252
254
  );
253
255
  const blockInformation = useBlockDisplayInformation( clientId );
254
- const borderPanelLabel = getBorderPanelLabel( { blockName } );
256
+ const borderPanelLabel = useBorderPanelLabel( { blockName } );
255
257
 
256
258
  return (
257
259
  <div className="block-editor-block-inspector">
@@ -19,13 +19,17 @@ import useMovingAnimation from '../../use-moving-animation';
19
19
  import { PrivateBlockContext } from '../private-block-context';
20
20
  import { useFocusFirstElement } from './use-focus-first-element';
21
21
  import { useIsHovered } from './use-is-hovered';
22
- import { useBlockEditContext } from '../../block-edit/context';
22
+ import {
23
+ blockBindingsKey,
24
+ useBlockEditContext,
25
+ } from '../../block-edit/context';
23
26
  import { useFocusHandler } from './use-focus-handler';
24
27
  import { useEventHandlers } from './use-selected-block-event-handlers';
25
28
  import { useNavModeExit } from './use-nav-mode-exit';
26
29
  import { useBlockRefProvider } from './use-block-refs';
27
30
  import { useIntersectionObserver } from './use-intersection-observer';
28
31
  import { useFlashEditableBlocks } from '../../use-flash-editable-blocks';
32
+ import { canBindBlock } from '../../../hooks/use-bindings-attributes';
29
33
 
30
34
  /**
31
35
  * This hook is used to lightly mark an element as a block element. The element
@@ -123,6 +127,12 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
123
127
  ] );
124
128
 
125
129
  const blockEditContext = useBlockEditContext();
130
+ const hasBlockBindings = !! blockEditContext[ blockBindingsKey ];
131
+ const bindingsStyle =
132
+ hasBlockBindings && canBindBlock( name )
133
+ ? { '--wp-admin-theme-color': 'var(--wp-bound-block-color)' }
134
+ : {};
135
+
126
136
  // Ensures it warns only inside the `edit` implementation for the block.
127
137
  if ( blockApiVersion < 2 && clientId === blockEditContext.clientId ) {
128
138
  warning(
@@ -168,7 +178,7 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) {
168
178
  wrapperProps.className,
169
179
  defaultClassName
170
180
  ),
171
- style: { ...wrapperProps.style, ...props.style },
181
+ style: { ...wrapperProps.style, ...props.style, ...bindingsStyle },
172
182
  };
173
183
  }
174
184