Commit 7feff31
Block API: Add block visibility control support and UI (#71203)
* Block API: Add block visibility control support and UI
* Render hidden block block
* Remove unused code
* Always hide block when it's not selected
* Extend existing isBlockVisible selector and use it
* Revert "Extend existing isBlockVisible selector and use it"
This reverts commit c3f7135.
* Remove SCSS import statement
* Use "isBlockHidden"
* Remove useBlockVisibility hook
* useBlockDropZone: Filter out blocks that are hidden
* Remove useBlockVisibility hook
* Update doc
* Show hidden block placeholder when dragging
* Revert "Show hidden block placeholder when dragging"
This reverts commit 2bfa54e.
* Show block toolbar button only when editing mode is default
* Process metadata updates for multiple blocks at once
* Preserve block visibility metadata in block transforms
* Remove support from schema and docs
* Add experiments setting
* Make Block Visibility as experiment feature
* Rename __experimentalBlockVisibility to blockVisibility
* Fix: other metadata attributes get stripped when toggling via the toolbar
* Show block toolbar button when multiple blocks are selected
* Fix incorrect block.json definition
* Apply opacity to hidden and selected blocks
* Revert "Apply opacity to hidden and selected blocks"
This reverts commit 5596f83.
* Provide blockVilibility metadata to preview context
* Accordion Header, Accordion Panel: disable blockVisibility support
* Visually hide block
* Stabilize feature
* Add backport changelog
* Update server side function
* Use "visibility:hidden" to visually hide blocks
* Combine multiple useSelect call into one
* Reset styles from hidden blocks
* Update lib/block-supports/block-visibility.php
Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
* Better behavior for hidden blocks
---------
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: talldan <talldanwp@git.wordpress.org>
Co-authored-by: sunyatasattva <sunyatasattva@git.wordpress.org>
Co-authored-by: mukeshpanchal27 <mukesh27@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>
Co-authored-by: annezazu <annezazu@git.wordpress.org>
Co-authored-by: supernovia <supernovia@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>1 parent 98386bd commit 7feff31
File tree
23 files changed
+354
-33
lines changed- backport-changelog/6.9
- docs/reference-guides
- lib
- block-supports
- packages
- block-editor/src
- components
- block-list
- use-block-props
- block-toolbar
- block-visibility
- list-view
- use-block-drop-zone
- store
- block-library/src
- accordion-header
- accordion-panel
- block
- pattern
- template-part
- utils
23 files changed
+354
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
585 | 585 | | |
586 | 586 | | |
587 | 587 | | |
588 | | - | |
| 588 | + | |
589 | 589 | | |
590 | 590 | | |
591 | 591 | | |
| |||
975 | 975 | | |
976 | 976 | | |
977 | 977 | | |
978 | | - | |
| 978 | + | |
979 | 979 | | |
980 | 980 | | |
981 | 981 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
624 | 624 | | |
625 | 625 | | |
626 | 626 | | |
| 627 | + | |
627 | 628 | | |
628 | 629 | | |
629 | 630 | | |
| |||
632 | 633 | | |
633 | 634 | | |
634 | 635 | | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
635 | 639 | | |
636 | 640 | | |
637 | 641 | | |
| |||
705 | 709 | | |
706 | 710 | | |
707 | 711 | | |
| 712 | + | |
708 | 713 | | |
709 | 714 | | |
710 | 715 | | |
| |||
747 | 752 | | |
748 | 753 | | |
749 | 754 | | |
| 755 | + | |
750 | 756 | | |
751 | 757 | | |
752 | 758 | | |
| |||
795 | 801 | | |
796 | 802 | | |
797 | 803 | | |
| 804 | + | |
798 | 805 | | |
799 | 806 | | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
800 | 816 | | |
801 | 817 | | |
802 | 818 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
96 | 115 | | |
97 | 116 | | |
98 | 117 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| |||
183 | 184 | | |
184 | 185 | | |
185 | 186 | | |
| 187 | + | |
186 | 188 | | |
187 | 189 | | |
188 | 190 | | |
| |||
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
28 | 35 | | |
29 | 36 | | |
| 37 | + | |
30 | 38 | | |
31 | 39 | | |
32 | 40 | | |
| |||
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
41 | 54 | | |
42 | 55 | | |
43 | 56 | | |
| |||
49 | 62 | | |
50 | 63 | | |
51 | 64 | | |
| 65 | + | |
| 66 | + | |
52 | 67 | | |
53 | 68 | | |
54 | 69 | | |
| |||
93 | 108 | | |
94 | 109 | | |
95 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
96 | 116 | | |
97 | 117 | | |
98 | 118 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| |||
163 | 165 | | |
164 | 166 | | |
165 | 167 | | |
| 168 | + | |
166 | 169 | | |
167 | 170 | | |
168 | 171 | | |
| |||
227 | 230 | | |
228 | 231 | | |
229 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
230 | 239 | | |
231 | 240 | | |
232 | 241 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments