Version Description
Download this release
Release Info
Developer | gutenbergplugin |
Plugin | Gutenberg |
Version | 11.5.1 |
Comparing to | |
See all releases |
Code changes from version 11.5.0 to 11.5.1
- changelog.txt +218 -202
- gutenberg.php +3 -3
- lib/class-wp-theme-json-gutenberg.php +27 -20
- lib/class-wp-theme-json-resolver-gutenberg.php +0 -7
- lib/global-styles.php +24 -8
- readme.txt +2 -2
changelog.txt
CHANGED
@@ -1,217 +1,233 @@
|
|
1 |
== Changelog ==
|
2 |
|
3 |
-
= 11.5.
|
4 |
|
5 |
-
### Features
|
6 |
-
|
7 |
-
#### Design Tools
|
8 |
-
- Block Support: Add gap block support feature. ([33991](https://github.com/WordPress/gutenberg/pull/33991))
|
9 |
-
|
10 |
-
### Enhancements
|
11 |
-
|
12 |
-
#### Accessibility
|
13 |
-
- Font weight screen reader description. ([34312](https://github.com/WordPress/gutenberg/pull/34312))
|
14 |
-
#### Block Editor:
|
15 |
-
- Media Placeholder: Change media URL input type to allow a local URL path. ([29138](https://github.com/WordPress/gutenberg/pull/29138))
|
16 |
-
#### Block Library
|
17 |
-
- Columns Block: Use `blockGap` between Columns blocks. ([34456](https://github.com/WordPress/gutenberg/pull/34456))
|
18 |
-
- Group Block: Add a row variation. ([34535](https://github.com/WordPress/gutenberg/pull/34535))
|
19 |
-
- Heading Block: Vertical heading levels menu. ([32926](https://github.com/WordPress/gutenberg/pull/32926))
|
20 |
-
- Navigation Block: Allow Site Title and Logo inside Navigation block. ([33316](https://github.com/WordPress/gutenberg/pull/33316))
|
21 |
-
- Navigation Block, List View: Do not show appender and avoid closing the modal on block select. ([34337](https://github.com/WordPress/gutenberg/pull/34337))
|
22 |
-
- Navigation Block: Remove horizontal and vertical navigation block variations from inserter. ([34614](https://github.com/WordPress/gutenberg/pull/34614))
|
23 |
-
- Navigation Block: Use gap instead of margin. ([32367](https://github.com/WordPress/gutenberg/pull/32367))
|
24 |
-
- Post Author Block: Add duotone suport. ([34408](https://github.com/WordPress/gutenberg/pull/34408))
|
25 |
-
- Query Pagination Next/Previous: Add an arrow attribute and sync next/previous block's arrow. ([33656](https://github.com/WordPress/gutenberg/pull/33656))
|
26 |
-
- Site Logo Block: Update block description to be concise. ([34471](https://github.com/WordPress/gutenberg/pull/34471))
|
27 |
-
- Site Title Block: Update block description to be concise. ([34475](https://github.com/WordPress/gutenberg/pull/34475))
|
28 |
-
- Social Links Block: Use the new `flex` layout. ([34493](https://github.com/WordPress/gutenberg/pull/34493))
|
29 |
-
- Video Block: Use existing video poster image on insert. ([34415](https://github.com/WordPress/gutenberg/pull/34415))
|
30 |
-
#### Components
|
31 |
-
- MenuItem: Add right padding for unchecked radio and checkbox items. ([34406](https://github.com/WordPress/gutenberg/pull/34406))
|
32 |
-
- ToggleGroupControl: Update stories to use knobs. ([34497](https://github.com/WordPress/gutenberg/pull/34497))
|
33 |
-
#### Core Data
|
34 |
-
- Add `isRawAttribute` to entity configuration. ([34388](https://github.com/WordPress/gutenberg/pull/34388))
|
35 |
-
#### Design Tools
|
36 |
-
- Add wide alignment control only if theme provides `layout.wideSize`. ([34586](https://github.com/WordPress/gutenberg/pull/34586))
|
37 |
-
- Update justification control in `flex` layout. ([34651](https://github.com/WordPress/gutenberg/pull/34651))
|
38 |
-
- ToolsPanel: Change icon from horizontal to vertical ellipsis. ([34369](https://github.com/WordPress/gutenberg/pull/34369))
|
39 |
-
#### Full Site Editing
|
40 |
-
- Limit FSE admin notices to the Themes screen. ([34353](https://github.com/WordPress/gutenberg/pull/34353))
|
41 |
-
#### Global Styles
|
42 |
-
- Allow disabling `text` and `background` color via `theme.json`. ([34420](https://github.com/WordPress/gutenberg/pull/34420))
|
43 |
-
- Make global styles available to all themes. ([34334](https://github.com/WordPress/gutenberg/pull/34334))
|
44 |
-
#### i18n
|
45 |
-
- Add context to 'none' strings for better translations. ([34341](https://github.com/WordPress/gutenberg/pull/34341))
|
46 |
-
- Make permalinks documentation URL translatable. ([34282](https://github.com/WordPress/gutenberg/pull/34282))
|
47 |
-
#### Post Editor
|
48 |
-
- Expose `ThemeSupportCheck` component. ([20506](https://github.com/WordPress/gutenberg/pull/20506))
|
49 |
-
- Title block gap. ([34570](https://github.com/WordPress/gutenberg/pull/34570))
|
50 |
-
#### Themes
|
51 |
-
- Add default editor styles applied to themes without `theme.json` and without editor styles. ([34439](https://github.com/WordPress/gutenberg/pull/34439))
|
52 |
-
#### Widgets Editor
|
53 |
-
- Add 'Widget Group' block to widgets screens. ([34484](https://github.com/WordPress/gutenberg/pull/34484))
|
54 |
-
- Legacy widget rendering endpoint. ([34230](https://github.com/WordPress/gutenberg/pull/34230))
|
55 |
-
|
56 |
-
### New APIs
|
57 |
-
|
58 |
-
#### Design Tools
|
59 |
-
- Allow themes with `theme.json` to opt-out of block gap styles. ([34491](https://github.com/WordPress/gutenberg/pull/34491))
|
60 |
-
|
61 |
### Bug Fixes
|
62 |
|
63 |
-
#### Accessibility
|
64 |
-
- Fix button block focus trap after a URL has been added. ([34314](https://github.com/WordPress/gutenberg/pull/34314))
|
65 |
-
#### Block Editor
|
66 |
-
- Fix menu item padding regression. ([34435](https://github.com/WordPress/gutenberg/pull/34435))
|
67 |
-
- Fix text-menu min widths. ([34532](https://github.com/WordPress/gutenberg/pull/34532))
|
68 |
-
- Keep id on paste if internal link points to it. ([31107](https://github.com/WordPress/gutenberg/pull/31107))
|
69 |
-
- Fix caret position on block merging. ([34169](https://github.com/WordPress/gutenberg/pull/34169))
|
70 |
-
#### Block Library
|
71 |
-
- Heading Block, Paragraph Block: Fix long strings of text without spaces overflow the block. ([34222](https://github.com/WordPress/gutenberg/pull/34222))
|
72 |
-
- Gallery Block: Fix bug with stalled upload when image size too large. ([34371](https://github.com/WordPress/gutenberg/pull/34371))
|
73 |
-
- Gallery Block: Fix media placeholder height in site editor. ([34629](https://github.com/WordPress/gutenberg/pull/34629))
|
74 |
-
- Gallery Block: Fix problem with overflowing captions on new gallery block format. ([34402](https://github.com/WordPress/gutenberg/pull/34402))
|
75 |
-
- Latest Posts: Fix various React warnings in development log. ([34428](https://github.com/WordPress/gutenberg/pull/34428))
|
76 |
-
- Navigation: Fix navigation block classname issues. ([34344](https://github.com/WordPress/gutenberg/pull/34344))
|
77 |
-
- Navigation: Fix Page List styles inside responsive Navigation. ([34517](https://github.com/WordPress/gutenberg/pull/34517))
|
78 |
-
- Navigation: Fix responsive menu height regression. ([34488](https://github.com/WordPress/gutenberg/pull/34488))
|
79 |
-
- Navigation: Fix submenu layout in navigation page list. ([34342](https://github.com/WordPress/gutenberg/pull/34342))
|
80 |
-
- Navigation: Fix submenus to only take up space when visible. ([34382](https://github.com/WordPress/gutenberg/pull/34382))
|
81 |
-
- Navigation: Fix undo/redo 'trap' in navigation link block. ([34565](https://github.com/WordPress/gutenberg/pull/34565))
|
82 |
-
- Site Title: Allow empty title in edit mode. ([34274](https://github.com/WordPress/gutenberg/pull/34274))
|
83 |
-
- Social Links Block: Fix deprecation. ([34639](https://github.com/WordPress/gutenberg/pull/34639))
|
84 |
-
- Video Block: Fix `TypeError` when removing poster. ([34411](https://github.com/WordPress/gutenberg/pull/34411))
|
85 |
-
#### Components
|
86 |
-
- Align labels on focal point picker position controls above the inputs. ([34209](https://github.com/WordPress/gutenberg/pull/34209))
|
87 |
-
- Check if in browser env before calling `CSS.supports`. ([34572](https://github.com/WordPress/gutenberg/pull/34572))
|
88 |
-
- Combobox Component: Only force expanded state if the input has focus. ([34090](https://github.com/WordPress/gutenberg/pull/34090))
|
89 |
-
- CustomSelectControl: Add describedBy fallback. ([34385](https://github.com/WordPress/gutenberg/pull/34385))
|
90 |
-
- DateTime Component: Fix sizing of help info. ([34370](https://github.com/WordPress/gutenberg/pull/34370))
|
91 |
-
- Fix `ToggleGroupControlBackdrop` not updating size when `isAdaptiveWidth` prop changes. ([34595](https://github.com/WordPress/gutenberg/pull/34595))
|
92 |
-
- Fix selected value computation in `CustomSelectControl` when no initial `value` is set. ([34490](https://github.com/WordPress/gutenberg/pull/34490))
|
93 |
-
- Fix subheadings from wrapping. ([34319](https://github.com/WordPress/gutenberg/pull/34319))
|
94 |
-
#### Design Tools
|
95 |
-
- Border Controls: Display color indicator and check selected color. ([34467](https://github.com/WordPress/gutenberg/pull/34467))
|
96 |
-
- Border Support: Fix check for displaying border support panel. ([34516](https://github.com/WordPress/gutenberg/pull/34516))
|
97 |
-
- Gap block support: Force gap change to cause the block to re-render (fix Safari issue). ([34567](https://github.com/WordPress/gutenberg/pull/34567))
|
98 |
-
- Letter Spacing: Group letter spacing correctly under typography supports. ([34515](https://github.com/WordPress/gutenberg/pull/34515))
|
99 |
-
#### Global Styles
|
100 |
-
- Fix block-level global styles color panels. ([34293](https://github.com/WordPress/gutenberg/pull/34293))
|
101 |
-
- Font Appearance Control: Fix error in global styles for Site Title in TT1-Blocks. ([34520](https://github.com/WordPress/gutenberg/pull/34520))
|
102 |
-
#### Meta Boxes
|
103 |
-
- Change default value of `enableCustomFields` to `undefined`. ([33931](https://github.com/WordPress/gutenberg/pull/33931))
|
104 |
-
- Fix metabox reordering. ([30617](https://github.com/WordPress/gutenberg/pull/30617))
|
105 |
-
#### Packages
|
106 |
-
- Blocks: Register block when invalid value provided for the icon. ([34350](https://github.com/WordPress/gutenberg/pull/34350))
|
107 |
-
- Core Data: Add 'include' to the query key. ([34583](https://github.com/WordPress/gutenberg/pull/34583))
|
108 |
-
- Core Data: Use `resolveSelect` instead of `select` in `saveEntityRecord`. ([34584](https://github.com/WordPress/gutenberg/pull/34584))
|
109 |
-
- Interface: Block Toolbar & Popover component - Prevent sticky position from causing permanently obscured areas of the selected block. ([33981](https://github.com/WordPress/gutenberg/pull/33981))
|
110 |
-
- Scripts: Only use svgr/webpack in js files. ([34394](https://github.com/WordPress/gutenberg/pull/34394))
|
111 |
-
- Scripts: Convert legacy entry point arguments for compatibility with webpack 5. ([34264](https://github.com/WordPress/gutenberg/pull/34264))
|
112 |
-
#### REST API
|
113 |
-
- Default batch processor: Respect the batch endpoint's `maxItems`. ([34280](https://github.com/WordPress/gutenberg/pull/34280))
|
114 |
-
#### Widgets Editor
|
115 |
-
- Fix Block Settings sidebar unexpectedly collapsing. ([34543](https://github.com/WordPress/gutenberg/pull/34543))
|
116 |
-
- Legacy widget's preview functionality is broken when the page is moved. ([34384](https://github.com/WordPress/gutenberg/pull/34384))
|
117 |
-
- Prevent focus trap in Legacy Widget block’s preview iframe. ([33614](https://github.com/WordPress/gutenberg/pull/33614))
|
118 |
-
|
119 |
-
### Performance
|
120 |
-
|
121 |
-
#### Block Editor
|
122 |
-
- Improve the `getBlock` and `getBlocks` performance. ([34241](https://github.com/WordPress/gutenberg/pull/34241))
|
123 |
-
- Remove duplicated `useValidAlignment` hook. ([34593](https://github.com/WordPress/gutenberg/pull/34593))
|
124 |
-
#### Core Data
|
125 |
-
- Move locks state from store to local variable. ([34374](https://github.com/WordPress/gutenberg/pull/34374))
|
126 |
#### Global Styles
|
127 |
-
- Remove colors classes from the packages that are already provided by global styles. ([34510](https://github.com/WordPress/gutenberg/pull/34510))
|
128 |
-
|
129 |
-
### Experiments
|
130 |
|
131 |
-
|
132 |
-
- Add undo redo buttons in navigation editor. ([34533](https://github.com/WordPress/gutenberg/pull/34533))
|
133 |
-
- Decode entities in the menu names. ([34263](https://github.com/WordPress/gutenberg/pull/34263))
|
134 |
-
- Disable "block-nav-menus" feature for the purposes of removing the "experimental" status on the Navigation Editor. ([34444](https://github.com/WordPress/gutenberg/pull/34444))
|
135 |
-
- Preload menu REST API requests on new navigation editor. ([34364](https://github.com/WordPress/gutenberg/pull/34364))
|
136 |
-
- Update navigation editor placeholder. ([34568](https://github.com/WordPress/gutenberg/pull/34568))
|
137 |
|
138 |
-
###
|
139 |
|
140 |
-
|
141 |
-
- Replace `withSelect` references with `useSelect`. ([34549](https://github.com/WordPress/gutenberg/pull/34549))
|
142 |
-
- Updated Template Section copy. ([34383](https://github.com/WordPress/gutenberg/pull/34383))
|
143 |
-
- Update block variations documentation about `block` scope. ([34455](https://github.com/WordPress/gutenberg/pull/34455))
|
144 |
-
#### Packages
|
145 |
-
- Blocks: Correct typo in Blocks Documentation. ([34396](https://github.com/WordPress/gutenberg/pull/34396))
|
146 |
-
- Componentes: Fix/update documentation alignment matrix control. ([34624](https://github.com/WordPress/gutenberg/pull/34624))
|
147 |
-
- Componentes: Update `DuotonePicker` documentation for accuracy. ([34494](https://github.com/WordPress/gutenberg/pull/34494))
|
148 |
-
- Eslint: Add `no-unsafe-wp-apis` to rules list in the documentation. ([34416](https://github.com/WordPress/gutenberg/pull/34416))
|
149 |
-
- Prettier: Correct syntax in `README.md` for `prettier-config`. ([34600](https://github.com/WordPress/gutenberg/pull/34600))
|
150 |
|
151 |
|
152 |
-
### Code Quality
|
153 |
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
-
|
167 |
-
|
168 |
-
-
|
169 |
-
####
|
170 |
-
-
|
171 |
-
-
|
172 |
-
-
|
173 |
-
-
|
174 |
-
-
|
175 |
-
-
|
176 |
-
|
177 |
-
-
|
178 |
-
-
|
179 |
-
-
|
180 |
-
-
|
181 |
-
-
|
182 |
-
-
|
183 |
-
|
184 |
-
-
|
185 |
-
-
|
186 |
-
|
187 |
-
-
|
188 |
-
|
189 |
-
-
|
190 |
-
|
191 |
-
-
|
192 |
-
|
193 |
-
-
|
194 |
-
|
195 |
-
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
####
|
201 |
-
-
|
202 |
-
-
|
203 |
-
|
204 |
-
-
|
205 |
-
|
206 |
-
|
207 |
-
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
####
|
212 |
-
-
|
213 |
-
|
214 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
- Make `Test_Widget` compatible with `WP_Widget`. ([34355](https://github.com/WordPress/gutenberg/pull/34355))
|
216 |
|
217 |
|
1 |
== Changelog ==
|
2 |
|
3 |
+
= 11.5.1 =
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
### Bug Fixes
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
#### Global Styles
|
|
|
|
|
|
|
8 |
|
9 |
+
- Fix theme supports for themes without theme.json. ([34955](https://github.com/WordPress/gutenberg/pull/34955))
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
### Various
|
12 |
|
13 |
+
- Build plugin zip: Verify npm cache before a clean install. ([34973](https://github.com/WordPress/gutenberg/pull/34973))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
|
|
|
16 |
|
17 |
+
|
18 |
+
|
19 |
+
= 11.5.0 =
|
20 |
+
|
21 |
+
### Features
|
22 |
+
|
23 |
+
#### Design Tools
|
24 |
+
- Block Support: Add gap block support feature. ([33991](https://github.com/WordPress/gutenberg/pull/33991))
|
25 |
+
|
26 |
+
### Enhancements
|
27 |
+
|
28 |
+
#### Accessibility
|
29 |
+
- Font weight screen reader description. ([34312](https://github.com/WordPress/gutenberg/pull/34312))
|
30 |
+
#### Block Editor:
|
31 |
+
- Media Placeholder: Change media URL input type to allow a local URL path. ([29138](https://github.com/WordPress/gutenberg/pull/29138))
|
32 |
+
#### Block Library
|
33 |
+
- Columns Block: Use `blockGap` between Columns blocks. ([34456](https://github.com/WordPress/gutenberg/pull/34456))
|
34 |
+
- Group Block: Add a row variation. ([34535](https://github.com/WordPress/gutenberg/pull/34535))
|
35 |
+
- Heading Block: Vertical heading levels menu. ([32926](https://github.com/WordPress/gutenberg/pull/32926))
|
36 |
+
- Navigation Block: Allow Site Title and Logo inside Navigation block. ([33316](https://github.com/WordPress/gutenberg/pull/33316))
|
37 |
+
- Navigation Block, List View: Do not show appender and avoid closing the modal on block select. ([34337](https://github.com/WordPress/gutenberg/pull/34337))
|
38 |
+
- Navigation Block: Remove horizontal and vertical navigation block variations from inserter. ([34614](https://github.com/WordPress/gutenberg/pull/34614))
|
39 |
+
- Navigation Block: Use gap instead of margin. ([32367](https://github.com/WordPress/gutenberg/pull/32367))
|
40 |
+
- Post Author Block: Add duotone suport. ([34408](https://github.com/WordPress/gutenberg/pull/34408))
|
41 |
+
- Query Pagination Next/Previous: Add an arrow attribute and sync next/previous block's arrow. ([33656](https://github.com/WordPress/gutenberg/pull/33656))
|
42 |
+
- Site Logo Block: Update block description to be concise. ([34471](https://github.com/WordPress/gutenberg/pull/34471))
|
43 |
+
- Site Title Block: Update block description to be concise. ([34475](https://github.com/WordPress/gutenberg/pull/34475))
|
44 |
+
- Social Links Block: Use the new `flex` layout. ([34493](https://github.com/WordPress/gutenberg/pull/34493))
|
45 |
+
- Video Block: Use existing video poster image on insert. ([34415](https://github.com/WordPress/gutenberg/pull/34415))
|
46 |
+
#### Components
|
47 |
+
- MenuItem: Add right padding for unchecked radio and checkbox items. ([34406](https://github.com/WordPress/gutenberg/pull/34406))
|
48 |
+
- ToggleGroupControl: Update stories to use knobs. ([34497](https://github.com/WordPress/gutenberg/pull/34497))
|
49 |
+
#### Core Data
|
50 |
+
- Add `isRawAttribute` to entity configuration. ([34388](https://github.com/WordPress/gutenberg/pull/34388))
|
51 |
+
#### Design Tools
|
52 |
+
- Add wide alignment control only if theme provides `layout.wideSize`. ([34586](https://github.com/WordPress/gutenberg/pull/34586))
|
53 |
+
- Update justification control in `flex` layout. ([34651](https://github.com/WordPress/gutenberg/pull/34651))
|
54 |
+
- ToolsPanel: Change icon from horizontal to vertical ellipsis. ([34369](https://github.com/WordPress/gutenberg/pull/34369))
|
55 |
+
#### Full Site Editing
|
56 |
+
- Limit FSE admin notices to the Themes screen. ([34353](https://github.com/WordPress/gutenberg/pull/34353))
|
57 |
+
#### Global Styles
|
58 |
+
- Allow disabling `text` and `background` color via `theme.json`. ([34420](https://github.com/WordPress/gutenberg/pull/34420))
|
59 |
+
- Make global styles available to all themes. ([34334](https://github.com/WordPress/gutenberg/pull/34334))
|
60 |
+
#### i18n
|
61 |
+
- Add context to 'none' strings for better translations. ([34341](https://github.com/WordPress/gutenberg/pull/34341))
|
62 |
+
- Make permalinks documentation URL translatable. ([34282](https://github.com/WordPress/gutenberg/pull/34282))
|
63 |
+
#### Post Editor
|
64 |
+
- Expose `ThemeSupportCheck` component. ([20506](https://github.com/WordPress/gutenberg/pull/20506))
|
65 |
+
- Title block gap. ([34570](https://github.com/WordPress/gutenberg/pull/34570))
|
66 |
+
#### Themes
|
67 |
+
- Add default editor styles applied to themes without `theme.json` and without editor styles. ([34439](https://github.com/WordPress/gutenberg/pull/34439))
|
68 |
+
#### Widgets Editor
|
69 |
+
- Add 'Widget Group' block to widgets screens. ([34484](https://github.com/WordPress/gutenberg/pull/34484))
|
70 |
+
- Legacy widget rendering endpoint. ([34230](https://github.com/WordPress/gutenberg/pull/34230))
|
71 |
+
|
72 |
+
### New APIs
|
73 |
+
|
74 |
+
#### Design Tools
|
75 |
+
- Allow themes with `theme.json` to opt-out of block gap styles. ([34491](https://github.com/WordPress/gutenberg/pull/34491))
|
76 |
+
|
77 |
+
### Bug Fixes
|
78 |
+
|
79 |
+
#### Accessibility
|
80 |
+
- Fix button block focus trap after a URL has been added. ([34314](https://github.com/WordPress/gutenberg/pull/34314))
|
81 |
+
#### Block Editor
|
82 |
+
- Fix menu item padding regression. ([34435](https://github.com/WordPress/gutenberg/pull/34435))
|
83 |
+
- Fix text-menu min widths. ([34532](https://github.com/WordPress/gutenberg/pull/34532))
|
84 |
+
- Keep id on paste if internal link points to it. ([31107](https://github.com/WordPress/gutenberg/pull/31107))
|
85 |
+
- Fix caret position on block merging. ([34169](https://github.com/WordPress/gutenberg/pull/34169))
|
86 |
+
#### Block Library
|
87 |
+
- Heading Block, Paragraph Block: Fix long strings of text without spaces overflow the block. ([34222](https://github.com/WordPress/gutenberg/pull/34222))
|
88 |
+
- Gallery Block: Fix bug with stalled upload when image size too large. ([34371](https://github.com/WordPress/gutenberg/pull/34371))
|
89 |
+
- Gallery Block: Fix media placeholder height in site editor. ([34629](https://github.com/WordPress/gutenberg/pull/34629))
|
90 |
+
- Gallery Block: Fix problem with overflowing captions on new gallery block format. ([34402](https://github.com/WordPress/gutenberg/pull/34402))
|
91 |
+
- Latest Posts: Fix various React warnings in development log. ([34428](https://github.com/WordPress/gutenberg/pull/34428))
|
92 |
+
- Navigation: Fix navigation block classname issues. ([34344](https://github.com/WordPress/gutenberg/pull/34344))
|
93 |
+
- Navigation: Fix Page List styles inside responsive Navigation. ([34517](https://github.com/WordPress/gutenberg/pull/34517))
|
94 |
+
- Navigation: Fix responsive menu height regression. ([34488](https://github.com/WordPress/gutenberg/pull/34488))
|
95 |
+
- Navigation: Fix submenu layout in navigation page list. ([34342](https://github.com/WordPress/gutenberg/pull/34342))
|
96 |
+
- Navigation: Fix submenus to only take up space when visible. ([34382](https://github.com/WordPress/gutenberg/pull/34382))
|
97 |
+
- Navigation: Fix undo/redo 'trap' in navigation link block. ([34565](https://github.com/WordPress/gutenberg/pull/34565))
|
98 |
+
- Site Title: Allow empty title in edit mode. ([34274](https://github.com/WordPress/gutenberg/pull/34274))
|
99 |
+
- Social Links Block: Fix deprecation. ([34639](https://github.com/WordPress/gutenberg/pull/34639))
|
100 |
+
- Video Block: Fix `TypeError` when removing poster. ([34411](https://github.com/WordPress/gutenberg/pull/34411))
|
101 |
+
#### Components
|
102 |
+
- Align labels on focal point picker position controls above the inputs. ([34209](https://github.com/WordPress/gutenberg/pull/34209))
|
103 |
+
- Check if in browser env before calling `CSS.supports`. ([34572](https://github.com/WordPress/gutenberg/pull/34572))
|
104 |
+
- Combobox Component: Only force expanded state if the input has focus. ([34090](https://github.com/WordPress/gutenberg/pull/34090))
|
105 |
+
- CustomSelectControl: Add describedBy fallback. ([34385](https://github.com/WordPress/gutenberg/pull/34385))
|
106 |
+
- DateTime Component: Fix sizing of help info. ([34370](https://github.com/WordPress/gutenberg/pull/34370))
|
107 |
+
- Fix `ToggleGroupControlBackdrop` not updating size when `isAdaptiveWidth` prop changes. ([34595](https://github.com/WordPress/gutenberg/pull/34595))
|
108 |
+
- Fix selected value computation in `CustomSelectControl` when no initial `value` is set. ([34490](https://github.com/WordPress/gutenberg/pull/34490))
|
109 |
+
- Fix subheadings from wrapping. ([34319](https://github.com/WordPress/gutenberg/pull/34319))
|
110 |
+
#### Design Tools
|
111 |
+
- Border Controls: Display color indicator and check selected color. ([34467](https://github.com/WordPress/gutenberg/pull/34467))
|
112 |
+
- Border Support: Fix check for displaying border support panel. ([34516](https://github.com/WordPress/gutenberg/pull/34516))
|
113 |
+
- Gap block support: Force gap change to cause the block to re-render (fix Safari issue). ([34567](https://github.com/WordPress/gutenberg/pull/34567))
|
114 |
+
- Letter Spacing: Group letter spacing correctly under typography supports. ([34515](https://github.com/WordPress/gutenberg/pull/34515))
|
115 |
+
#### Global Styles
|
116 |
+
- Fix block-level global styles color panels. ([34293](https://github.com/WordPress/gutenberg/pull/34293))
|
117 |
+
- Font Appearance Control: Fix error in global styles for Site Title in TT1-Blocks. ([34520](https://github.com/WordPress/gutenberg/pull/34520))
|
118 |
+
#### Meta Boxes
|
119 |
+
- Change default value of `enableCustomFields` to `undefined`. ([33931](https://github.com/WordPress/gutenberg/pull/33931))
|
120 |
+
- Fix metabox reordering. ([30617](https://github.com/WordPress/gutenberg/pull/30617))
|
121 |
+
#### Packages
|
122 |
+
- Blocks: Register block when invalid value provided for the icon. ([34350](https://github.com/WordPress/gutenberg/pull/34350))
|
123 |
+
- Core Data: Add 'include' to the query key. ([34583](https://github.com/WordPress/gutenberg/pull/34583))
|
124 |
+
- Core Data: Use `resolveSelect` instead of `select` in `saveEntityRecord`. ([34584](https://github.com/WordPress/gutenberg/pull/34584))
|
125 |
+
- Interface: Block Toolbar & Popover component - Prevent sticky position from causing permanently obscured areas of the selected block. ([33981](https://github.com/WordPress/gutenberg/pull/33981))
|
126 |
+
- Scripts: Only use svgr/webpack in js files. ([34394](https://github.com/WordPress/gutenberg/pull/34394))
|
127 |
+
- Scripts: Convert legacy entry point arguments for compatibility with webpack 5. ([34264](https://github.com/WordPress/gutenberg/pull/34264))
|
128 |
+
#### REST API
|
129 |
+
- Default batch processor: Respect the batch endpoint's `maxItems`. ([34280](https://github.com/WordPress/gutenberg/pull/34280))
|
130 |
+
#### Widgets Editor
|
131 |
+
- Fix Block Settings sidebar unexpectedly collapsing. ([34543](https://github.com/WordPress/gutenberg/pull/34543))
|
132 |
+
- Legacy widget's preview functionality is broken when the page is moved. ([34384](https://github.com/WordPress/gutenberg/pull/34384))
|
133 |
+
- Prevent focus trap in Legacy Widget block’s preview iframe. ([33614](https://github.com/WordPress/gutenberg/pull/33614))
|
134 |
+
|
135 |
+
### Performance
|
136 |
+
|
137 |
+
#### Block Editor
|
138 |
+
- Improve the `getBlock` and `getBlocks` performance. ([34241](https://github.com/WordPress/gutenberg/pull/34241))
|
139 |
+
- Remove duplicated `useValidAlignment` hook. ([34593](https://github.com/WordPress/gutenberg/pull/34593))
|
140 |
+
#### Core Data
|
141 |
+
- Move locks state from store to local variable. ([34374](https://github.com/WordPress/gutenberg/pull/34374))
|
142 |
+
#### Global Styles
|
143 |
+
- Remove colors classes from the packages that are already provided by global styles. ([34510](https://github.com/WordPress/gutenberg/pull/34510))
|
144 |
+
|
145 |
+
### Experiments
|
146 |
+
|
147 |
+
#### Navigation Editor
|
148 |
+
- Add undo redo buttons in navigation editor. ([34533](https://github.com/WordPress/gutenberg/pull/34533))
|
149 |
+
- Decode entities in the menu names. ([34263](https://github.com/WordPress/gutenberg/pull/34263))
|
150 |
+
- Disable "block-nav-menus" feature for the purposes of removing the "experimental" status on the Navigation Editor. ([34444](https://github.com/WordPress/gutenberg/pull/34444))
|
151 |
+
- Preload menu REST API requests on new navigation editor. ([34364](https://github.com/WordPress/gutenberg/pull/34364))
|
152 |
+
- Update navigation editor placeholder. ([34568](https://github.com/WordPress/gutenberg/pull/34568))
|
153 |
+
|
154 |
+
### Documentation
|
155 |
+
|
156 |
+
#### Handbook
|
157 |
+
- Replace `withSelect` references with `useSelect`. ([34549](https://github.com/WordPress/gutenberg/pull/34549))
|
158 |
+
- Updated Template Section copy. ([34383](https://github.com/WordPress/gutenberg/pull/34383))
|
159 |
+
- Update block variations documentation about `block` scope. ([34455](https://github.com/WordPress/gutenberg/pull/34455))
|
160 |
+
#### Packages
|
161 |
+
- Blocks: Correct typo in Blocks Documentation. ([34396](https://github.com/WordPress/gutenberg/pull/34396))
|
162 |
+
- Componentes: Fix/update documentation alignment matrix control. ([34624](https://github.com/WordPress/gutenberg/pull/34624))
|
163 |
+
- Componentes: Update `DuotonePicker` documentation for accuracy. ([34494](https://github.com/WordPress/gutenberg/pull/34494))
|
164 |
+
- Eslint: Add `no-unsafe-wp-apis` to rules list in the documentation. ([34416](https://github.com/WordPress/gutenberg/pull/34416))
|
165 |
+
- Prettier: Correct syntax in `README.md` for `prettier-config`. ([34600](https://github.com/WordPress/gutenberg/pull/34600))
|
166 |
+
|
167 |
+
|
168 |
+
### Code Quality
|
169 |
+
|
170 |
+
#### Block Editor
|
171 |
+
- Code cleanup to the `getBlock` refactoring. ([34326](https://github.com/WordPress/gutenberg/pull/34326))
|
172 |
+
- Ensure that `blockType` is defined when accessing `apiVersion`. ([34346](https://github.com/WordPress/gutenberg/pull/34346))
|
173 |
+
- Migrate `lightBlockWrapper` support to `apiVersion` for blocks. ([34459](https://github.com/WordPress/gutenberg/pull/34459))
|
174 |
+
- Fix Animated warning log. ([34197](https://github.com/WordPress/gutenberg/pull/34197))
|
175 |
+
- Rich Text: Replace global event handlers with local ones. ([34492](https://github.com/WordPress/gutenberg/pull/34492))
|
176 |
+
- Rich text (core): OnFocus method can be replaced with HTMLElement.focus. ([32054](https://github.com/WordPress/gutenberg/pull/32054))
|
177 |
+
- Use Setting: Consolidate the `PATHS_WITH_MERGE` constant to one instance. ([34407](https://github.com/WordPress/gutenberg/pull/34407))
|
178 |
+
#### Block Library
|
179 |
+
- Gallery Block: Add docblock comments to the new gallery hooks. ([34562](https://github.com/WordPress/gutenberg/pull/34562))
|
180 |
+
- Gallery Block: Remove IE specific CSS hacks. ([34372](https://github.com/WordPress/gutenberg/pull/34372))
|
181 |
+
- Button Block: Replace global shortcut event handlers with local ones. ([34498](https://github.com/WordPress/gutenberg/pull/34498))
|
182 |
+
- Navigation Block: Refactor to use generic classnames. ([34171](https://github.com/WordPress/gutenberg/pull/34171))
|
183 |
+
- Navigation Link Block: Replace global shortcut event handlers with local ones. ([34500](https://github.com/WordPress/gutenberg/pull/34500))
|
184 |
+
- Gallery Block: Remove redundant css selector. ([34277](https://github.com/WordPress/gutenberg/pull/34277))
|
185 |
+
#### Components
|
186 |
+
- CustomGradientBar: Replace global shortcut event handlers with local ones. ([34505](https://github.com/WordPress/gutenberg/pull/34505))
|
187 |
+
- Guide: Replace global shortcut event handlers with local ones. ([34503](https://github.com/WordPress/gutenberg/pull/34503))
|
188 |
+
- Navigate regions: Use React events for shortcuts (portal bubbles & contextual). ([33633](https://github.com/WordPress/gutenberg/pull/33633))
|
189 |
+
- Rename `PolymorphicComponent*` types to `WordPressComponent*`. ([34330](https://github.com/WordPress/gutenberg/pull/34330))
|
190 |
+
- Simplify Modal with hooks. ([34412](https://github.com/WordPress/gutenberg/pull/34412))
|
191 |
+
- Simplify & polish heading levels. ([34378](https://github.com/WordPress/gutenberg/pull/34378))
|
192 |
+
#### Core Data
|
193 |
+
- Fix linting errors. ([34596](https://github.com/WordPress/gutenberg/pull/34596))
|
194 |
+
- Fix linting error in trunk. ([34464](https://github.com/WordPress/gutenberg/pull/34464))
|
195 |
+
- Migrate `canUser` resolver to thunks. ([34580](https://github.com/WordPress/gutenberg/pull/34580))
|
196 |
+
- Migrate `entities.js` to thunks. ([34582](https://github.com/WordPress/gutenberg/pull/34582))
|
197 |
+
- Migrate `getAutosaves` resolver to thunks. ([34581](https://github.com/WordPress/gutenberg/pull/34581))
|
198 |
+
- Migrate `getEntityRecord` resolver to thunks. ([34576](https://github.com/WordPress/gutenberg/pull/34576))
|
199 |
+
- Migrate `getEntityRecords` resolver to thunks. ([34578](https://github.com/WordPress/gutenberg/pull/34578))
|
200 |
+
- Migrate resolvers to thunks: `GetAuthors`, `_getCurrentUser`, `__getCurrentTheme`, `__getThemeSupports`. ([34579](https://github.com/WordPress/gutenberg/pull/34579))
|
201 |
+
- Refactor `deleteEntityRecord` to use thunks instead of generators. ([34386](https://github.com/WordPress/gutenberg/pull/34386))
|
202 |
+
- Refactor `editEntityRecord`, undo, and redo to be thunks instead of generators. ([34387](https://github.com/WordPress/gutenberg/pull/34387))
|
203 |
+
- Remove the `PROCESS_PENDING_LOCK_REQUESTS` action. ([34343](https://github.com/WordPress/gutenberg/pull/34343))
|
204 |
+
- Refactor `saveEntityRecord` from `redux-rungen` to async thunks. ([33201](https://github.com/WordPress/gutenberg/pull/33201))
|
205 |
+
- Remove extraction of raw values in `saveEntityRecords`. ([34502](https://github.com/WordPress/gutenberg/pull/34502))
|
206 |
+
#### Other Packages
|
207 |
+
- Compose, useDropZone: Ensure drag event targets `HTMLElement`. ([34272](https://github.com/WordPress/gutenberg/pull/34272))
|
208 |
+
- Editor: Replace hardcoded store key. ([34296](https://github.com/WordPress/gutenberg/pull/34296))
|
209 |
+
- Env: Clarify config error within `parse-config.js`. ([34322](https://github.com/WordPress/gutenberg/pull/34322))
|
210 |
+
- Post Editor: Fix gray W menu color. ([34318](https://github.com/WordPress/gutenberg/pull/34318))
|
211 |
+
- URL: Add `getFilename` method to the URL package. ([34313](https://github.com/WordPress/gutenberg/pull/34313))
|
212 |
+
|
213 |
+
|
214 |
+
### Tools
|
215 |
+
|
216 |
+
#### Build Tooling
|
217 |
+
- ESLint: Add `useSelect` to direct function calls list. ([34301](https://github.com/WordPress/gutenberg/pull/34301))
|
218 |
+
- ESLint: Update error message for `@emotion/css` with info about the `useCx` hook. ([34418](https://github.com/WordPress/gutenberg/pull/34418))
|
219 |
+
- Fix build hang on Windows 10. ([23589](https://github.com/WordPress/gutenberg/pull/23589))
|
220 |
+
- Linting: Remove global event listener warning. ([34528](https://github.com/WordPress/gutenberg/pull/34528))
|
221 |
+
- More work on the stability of the performance metrics. ([34229](https://github.com/WordPress/gutenberg/pull/34229))
|
222 |
+
#### Plugin
|
223 |
+
- Added janw-me to the Codeowners for the PHP FSE folder. ([32990](https://github.com/WordPress/gutenberg/pull/32990))
|
224 |
+
- Fix title missing in bug report form. ([34504](https://github.com/WordPress/gutenberg/pull/34504))
|
225 |
+
- Update bug form to use drop downs. ([34458](https://github.com/WordPress/gutenberg/pull/34458))
|
226 |
+
- Update the minimum supported WordPress version to 5.7. ([34536](https://github.com/WordPress/gutenberg/pull/34536))
|
227 |
+
#### Testing
|
228 |
+
- Add unit tests for edit site editor utils. ([34401](https://github.com/WordPress/gutenberg/pull/34401))
|
229 |
+
- Debug e2e-tests in vscode. ([29788](https://github.com/WordPress/gutenberg/pull/29788))
|
230 |
+
- Jest Preset: Restore the default setting for the `verbose` option. ([34327](https://github.com/WordPress/gutenberg/pull/34327))
|
231 |
- Make `Test_Widget` compatible with `WP_Widget`. ([34355](https://github.com/WordPress/gutenberg/pull/34355))
|
232 |
|
233 |
|
gutenberg.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: Printing since 1440. This is the development plugin for the new block editor in core.
|
6 |
* Requires at least: 5.7
|
7 |
* Requires PHP: 5.6
|
8 |
-
* Version: 11.5.
|
9 |
* Author: Gutenberg Team
|
10 |
* Text Domain: gutenberg
|
11 |
*
|
@@ -13,8 +13,8 @@
|
|
13 |
*/
|
14 |
|
15 |
### BEGIN AUTO-GENERATED DEFINES
|
16 |
-
define( 'GUTENBERG_VERSION', '11.5.
|
17 |
-
define( 'GUTENBERG_GIT_COMMIT', '
|
18 |
### END AUTO-GENERATED DEFINES
|
19 |
|
20 |
gutenberg_pre_init();
|
5 |
* Description: Printing since 1440. This is the development plugin for the new block editor in core.
|
6 |
* Requires at least: 5.7
|
7 |
* Requires PHP: 5.6
|
8 |
+
* Version: 11.5.1
|
9 |
* Author: Gutenberg Team
|
10 |
* Text Domain: gutenberg
|
11 |
*
|
13 |
*/
|
14 |
|
15 |
### BEGIN AUTO-GENERATED DEFINES
|
16 |
+
define( 'GUTENBERG_VERSION', '11.5.1' );
|
17 |
+
define( 'GUTENBERG_GIT_COMMIT', '6cadb93e8e22f4533e967bfd8fb90c9e3470975b' );
|
18 |
### END AUTO-GENERATED DEFINES
|
19 |
|
20 |
gutenberg_pre_init();
|
lib/class-wp-theme-json-gutenberg.php
CHANGED
@@ -596,12 +596,13 @@ class WP_Theme_JSON_Gutenberg {
|
|
596 |
*
|
597 |
* @param array $preset_per_origin Array of presets keyed by origin.
|
598 |
* @param string $value_key The property of the preset that contains its value.
|
|
|
599 |
*
|
600 |
* @return array Array of presets where each key is a slug and each value is the preset value.
|
601 |
*/
|
602 |
-
private static function get_merged_preset_by_slug( $preset_per_origin, $value_key ) {
|
603 |
$result = array();
|
604 |
-
foreach (
|
605 |
if ( ! isset( $preset_per_origin[ $origin ] ) ) {
|
606 |
continue;
|
607 |
}
|
@@ -622,10 +623,11 @@ class WP_Theme_JSON_Gutenberg {
|
|
622 |
*
|
623 |
* @param array $settings Settings to process.
|
624 |
* @param string $selector Selector wrapping the classes.
|
|
|
625 |
*
|
626 |
* @return string The result of processing the presets.
|
627 |
*/
|
628 |
-
private static function compute_preset_classes( $settings, $selector ) {
|
629 |
if ( self::ROOT_BLOCK_SELECTOR === $selector ) {
|
630 |
// Classes at the global level do not need any CSS prefixed,
|
631 |
// and we don't want to increase its specificity.
|
@@ -635,7 +637,7 @@ class WP_Theme_JSON_Gutenberg {
|
|
635 |
$stylesheet = '';
|
636 |
foreach ( self::PRESETS_METADATA as $preset ) {
|
637 |
$preset_per_origin = _wp_array_get( $settings, $preset['path'], array() );
|
638 |
-
$preset_by_slug = self::get_merged_preset_by_slug( $preset_per_origin, $preset['value_key'] );
|
639 |
foreach ( $preset['classes'] as $class ) {
|
640 |
foreach ( $preset_by_slug as $slug => $value ) {
|
641 |
$stylesheet .= self::to_ruleset(
|
@@ -667,14 +669,15 @@ class WP_Theme_JSON_Gutenberg {
|
|
667 |
* ```
|
668 |
*
|
669 |
* @param array $settings Settings to process.
|
|
|
670 |
*
|
671 |
* @return array Returns the modified $declarations.
|
672 |
*/
|
673 |
-
private static function compute_preset_vars( $settings ) {
|
674 |
$declarations = array();
|
675 |
foreach ( self::PRESETS_METADATA as $preset ) {
|
676 |
$preset_per_origin = _wp_array_get( $settings, $preset['path'], array() );
|
677 |
-
$preset_by_slug = self::get_merged_preset_by_slug( $preset_per_origin, $preset['value_key'] );
|
678 |
foreach ( $preset_by_slug as $slug => $value ) {
|
679 |
$declarations[] = array(
|
680 |
'name' => '--wp--preset--' . $preset['css_var_infix'] . '--' . gutenberg_experimental_to_kebab_case( $slug ),
|
@@ -770,10 +773,11 @@ class WP_Theme_JSON_Gutenberg {
|
|
770 |
* }
|
771 |
*
|
772 |
* @param array $nodes Nodes with settings.
|
|
|
773 |
*
|
774 |
* @return string The new stylesheet.
|
775 |
*/
|
776 |
-
private function get_css_variables( $nodes ) {
|
777 |
$stylesheet = '';
|
778 |
foreach ( $nodes as $metadata ) {
|
779 |
if ( null === $metadata['selector'] ) {
|
@@ -783,7 +787,7 @@ class WP_Theme_JSON_Gutenberg {
|
|
783 |
$selector = $metadata['selector'];
|
784 |
|
785 |
$node = _wp_array_get( $this->theme_json, $metadata['path'], array() );
|
786 |
-
$declarations = array_merge( self::compute_preset_vars( $node ), self::compute_theme_vars( $node ) );
|
787 |
|
788 |
$stylesheet .= self::to_ruleset( $selector, $declarations );
|
789 |
}
|
@@ -855,10 +859,11 @@ class WP_Theme_JSON_Gutenberg {
|
|
855 |
* }
|
856 |
|
857 |
* @param array $setting_nodes Nodes with settings.
|
|
|
858 |
*
|
859 |
* @return string The new stylesheet.
|
860 |
*/
|
861 |
-
private function get_preset_classes( $setting_nodes ) {
|
862 |
$preset_rules = '';
|
863 |
|
864 |
foreach ( $setting_nodes as $metadata ) {
|
@@ -868,7 +873,7 @@ class WP_Theme_JSON_Gutenberg {
|
|
868 |
|
869 |
$selector = $metadata['selector'];
|
870 |
$node = _wp_array_get( $this->theme_json, $metadata['path'], array() );
|
871 |
-
$preset_rules .= self::compute_preset_classes( $node, $selector );
|
872 |
}
|
873 |
|
874 |
return $preset_rules;
|
@@ -1069,27 +1074,29 @@ class WP_Theme_JSON_Gutenberg {
|
|
1069 |
* Returns the stylesheet that results of processing
|
1070 |
* the theme.json structure this object represents.
|
1071 |
*
|
1072 |
-
* @param string $type
|
1073 |
-
*
|
1074 |
-
*
|
1075 |
-
*
|
1076 |
-
*
|
|
|
|
|
1077 |
* @return string Stylesheet.
|
1078 |
*/
|
1079 |
-
public function get_stylesheet( $type = 'all' ) {
|
1080 |
$blocks_metadata = self::get_blocks_metadata();
|
1081 |
$style_nodes = self::get_style_nodes( $this->theme_json, $blocks_metadata );
|
1082 |
$setting_nodes = self::get_setting_nodes( $this->theme_json, $blocks_metadata );
|
1083 |
|
1084 |
switch ( $type ) {
|
1085 |
case 'block_styles':
|
1086 |
-
return $this->get_block_classes( $style_nodes ) . $this->get_preset_classes( $setting_nodes );
|
1087 |
case 'css_variables':
|
1088 |
-
return $this->get_css_variables( $setting_nodes );
|
1089 |
case 'presets':
|
1090 |
-
return $this->get_css_variables( $setting_nodes ) . $this->get_preset_classes( $setting_nodes );
|
1091 |
default:
|
1092 |
-
return $this->get_css_variables( $setting_nodes ) . $this->get_block_classes( $style_nodes ) . $this->get_preset_classes( $setting_nodes );
|
1093 |
}
|
1094 |
}
|
1095 |
|
596 |
*
|
597 |
* @param array $preset_per_origin Array of presets keyed by origin.
|
598 |
* @param string $value_key The property of the preset that contains its value.
|
599 |
+
* @param array $origins List of origins to process.
|
600 |
*
|
601 |
* @return array Array of presets where each key is a slug and each value is the preset value.
|
602 |
*/
|
603 |
+
private static function get_merged_preset_by_slug( $preset_per_origin, $value_key, $origins ) {
|
604 |
$result = array();
|
605 |
+
foreach ( $origins as $origin ) {
|
606 |
if ( ! isset( $preset_per_origin[ $origin ] ) ) {
|
607 |
continue;
|
608 |
}
|
623 |
*
|
624 |
* @param array $settings Settings to process.
|
625 |
* @param string $selector Selector wrapping the classes.
|
626 |
+
* @param array $origins List of origins to process.
|
627 |
*
|
628 |
* @return string The result of processing the presets.
|
629 |
*/
|
630 |
+
private static function compute_preset_classes( $settings, $selector, $origins ) {
|
631 |
if ( self::ROOT_BLOCK_SELECTOR === $selector ) {
|
632 |
// Classes at the global level do not need any CSS prefixed,
|
633 |
// and we don't want to increase its specificity.
|
637 |
$stylesheet = '';
|
638 |
foreach ( self::PRESETS_METADATA as $preset ) {
|
639 |
$preset_per_origin = _wp_array_get( $settings, $preset['path'], array() );
|
640 |
+
$preset_by_slug = self::get_merged_preset_by_slug( $preset_per_origin, $preset['value_key'], $origins );
|
641 |
foreach ( $preset['classes'] as $class ) {
|
642 |
foreach ( $preset_by_slug as $slug => $value ) {
|
643 |
$stylesheet .= self::to_ruleset(
|
669 |
* ```
|
670 |
*
|
671 |
* @param array $settings Settings to process.
|
672 |
+
* @param array $origins List of origins to process.
|
673 |
*
|
674 |
* @return array Returns the modified $declarations.
|
675 |
*/
|
676 |
+
private static function compute_preset_vars( $settings, $origins ) {
|
677 |
$declarations = array();
|
678 |
foreach ( self::PRESETS_METADATA as $preset ) {
|
679 |
$preset_per_origin = _wp_array_get( $settings, $preset['path'], array() );
|
680 |
+
$preset_by_slug = self::get_merged_preset_by_slug( $preset_per_origin, $preset['value_key'], $origins );
|
681 |
foreach ( $preset_by_slug as $slug => $value ) {
|
682 |
$declarations[] = array(
|
683 |
'name' => '--wp--preset--' . $preset['css_var_infix'] . '--' . gutenberg_experimental_to_kebab_case( $slug ),
|
773 |
* }
|
774 |
*
|
775 |
* @param array $nodes Nodes with settings.
|
776 |
+
* @param array $origins List of origins to process.
|
777 |
*
|
778 |
* @return string The new stylesheet.
|
779 |
*/
|
780 |
+
private function get_css_variables( $nodes, $origins ) {
|
781 |
$stylesheet = '';
|
782 |
foreach ( $nodes as $metadata ) {
|
783 |
if ( null === $metadata['selector'] ) {
|
787 |
$selector = $metadata['selector'];
|
788 |
|
789 |
$node = _wp_array_get( $this->theme_json, $metadata['path'], array() );
|
790 |
+
$declarations = array_merge( self::compute_preset_vars( $node, $origins ), self::compute_theme_vars( $node ) );
|
791 |
|
792 |
$stylesheet .= self::to_ruleset( $selector, $declarations );
|
793 |
}
|
859 |
* }
|
860 |
|
861 |
* @param array $setting_nodes Nodes with settings.
|
862 |
+
* @param array $origins List of origins to process presets from.
|
863 |
*
|
864 |
* @return string The new stylesheet.
|
865 |
*/
|
866 |
+
private function get_preset_classes( $setting_nodes, $origins ) {
|
867 |
$preset_rules = '';
|
868 |
|
869 |
foreach ( $setting_nodes as $metadata ) {
|
873 |
|
874 |
$selector = $metadata['selector'];
|
875 |
$node = _wp_array_get( $this->theme_json, $metadata['path'], array() );
|
876 |
+
$preset_rules .= self::compute_preset_classes( $node, $selector, $origins );
|
877 |
}
|
878 |
|
879 |
return $preset_rules;
|
1074 |
* Returns the stylesheet that results of processing
|
1075 |
* the theme.json structure this object represents.
|
1076 |
*
|
1077 |
+
* @param string $type Type of stylesheet. It accepts:
|
1078 |
+
* 'all': css variables, block classes, preset classes. The default.
|
1079 |
+
* 'block_styles': only block & preset classes.
|
1080 |
+
* 'css_variables': only css variables.
|
1081 |
+
* 'presets': only css variables and preset classes.
|
1082 |
+
* @param array $origins A list of origins to include. By default it includes 'core', 'theme', and 'user'.
|
1083 |
+
*
|
1084 |
* @return string Stylesheet.
|
1085 |
*/
|
1086 |
+
public function get_stylesheet( $type = 'all', $origins = self::VALID_ORIGINS ) {
|
1087 |
$blocks_metadata = self::get_blocks_metadata();
|
1088 |
$style_nodes = self::get_style_nodes( $this->theme_json, $blocks_metadata );
|
1089 |
$setting_nodes = self::get_setting_nodes( $this->theme_json, $blocks_metadata );
|
1090 |
|
1091 |
switch ( $type ) {
|
1092 |
case 'block_styles':
|
1093 |
+
return $this->get_block_classes( $style_nodes ) . $this->get_preset_classes( $setting_nodes, $origins );
|
1094 |
case 'css_variables':
|
1095 |
+
return $this->get_css_variables( $setting_nodes, $origins );
|
1096 |
case 'presets':
|
1097 |
+
return $this->get_css_variables( $setting_nodes, $origins ) . $this->get_preset_classes( $setting_nodes, $origins );
|
1098 |
default:
|
1099 |
+
return $this->get_css_variables( $setting_nodes, $origins ) . $this->get_block_classes( $style_nodes ) . $this->get_preset_classes( $setting_nodes, $origins );
|
1100 |
}
|
1101 |
}
|
1102 |
|
lib/class-wp-theme-json-resolver-gutenberg.php
CHANGED
@@ -410,13 +410,6 @@ class WP_Theme_JSON_Resolver_Gutenberg {
|
|
410 |
$result = new WP_Theme_JSON_Gutenberg();
|
411 |
$result->merge( self::get_core_data() );
|
412 |
|
413 |
-
if (
|
414 |
-
! get_theme_support( 'experimental-link-color' ) && // link color support needs the presets CSS variables regardless of the presence of theme.json file.
|
415 |
-
! WP_Theme_JSON_Resolver_Gutenberg::theme_has_support()
|
416 |
-
) {
|
417 |
-
return $result;
|
418 |
-
}
|
419 |
-
|
420 |
$theme_support_data = WP_Theme_JSON_Gutenberg::get_from_editor_settings( $settings );
|
421 |
$result->merge( self::get_theme_data( $theme_support_data ) );
|
422 |
|
410 |
$result = new WP_Theme_JSON_Gutenberg();
|
411 |
$result->merge( self::get_core_data() );
|
412 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
413 |
$theme_support_data = WP_Theme_JSON_Gutenberg::get_from_editor_settings( $settings );
|
414 |
$result->merge( self::get_theme_data( $theme_support_data ) );
|
415 |
|
lib/global-styles.php
CHANGED
@@ -10,11 +10,11 @@
|
|
10 |
* the corresponding stylesheet.
|
11 |
*
|
12 |
* @param WP_Theme_JSON_Gutenberg $tree Input tree.
|
13 |
-
* @param string $type Type of stylesheet
|
14 |
*
|
15 |
* @return string Stylesheet.
|
16 |
*/
|
17 |
-
function gutenberg_experimental_global_styles_get_stylesheet( $tree, $type =
|
18 |
// Check if we can use cached.
|
19 |
$can_use_cached = (
|
20 |
( 'all' === $type ) &&
|
@@ -32,7 +32,27 @@ function gutenberg_experimental_global_styles_get_stylesheet( $tree, $type = 'al
|
|
32 |
}
|
33 |
}
|
34 |
|
35 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
if ( $can_use_cached ) {
|
38 |
// Cache for a minute.
|
@@ -51,11 +71,7 @@ function gutenberg_experimental_global_styles_enqueue_assets() {
|
|
51 |
$settings = gutenberg_get_default_block_editor_settings();
|
52 |
$all = WP_Theme_JSON_Resolver_Gutenberg::get_merged_data( $settings );
|
53 |
|
54 |
-
$
|
55 |
-
if ( ! WP_Theme_JSON_Resolver_Gutenberg::theme_has_support() ) {
|
56 |
-
$type = 'presets';
|
57 |
-
}
|
58 |
-
$stylesheet = gutenberg_experimental_global_styles_get_stylesheet( $all, $type );
|
59 |
if ( empty( $stylesheet ) ) {
|
60 |
return;
|
61 |
}
|
10 |
* the corresponding stylesheet.
|
11 |
*
|
12 |
* @param WP_Theme_JSON_Gutenberg $tree Input tree.
|
13 |
+
* @param string $type Type of stylesheet. It accepts 'all', 'block_styles', 'css_variables', 'presets'.
|
14 |
*
|
15 |
* @return string Stylesheet.
|
16 |
*/
|
17 |
+
function gutenberg_experimental_global_styles_get_stylesheet( $tree, $type = null ) {
|
18 |
// Check if we can use cached.
|
19 |
$can_use_cached = (
|
20 |
( 'all' === $type ) &&
|
32 |
}
|
33 |
}
|
34 |
|
35 |
+
$supports_theme_json = WP_Theme_JSON_Resolver_Gutenberg::theme_has_support();
|
36 |
+
$supports_link_color = get_theme_support( 'experimental-link-color' );
|
37 |
+
|
38 |
+
// Only modify the $type if the consumer hasn't provided any.
|
39 |
+
if ( null === $type && ! $supports_theme_json ) {
|
40 |
+
$type = 'presets';
|
41 |
+
} elseif ( null === $type ) {
|
42 |
+
$type = 'all';
|
43 |
+
}
|
44 |
+
|
45 |
+
$origins = array( 'core', 'theme', 'user' );
|
46 |
+
if ( ! $supports_theme_json && ! $supports_link_color ) {
|
47 |
+
// In this case we only enqueue the core presets (CSS Custom Properties + the classes).
|
48 |
+
$origins = array( 'core' );
|
49 |
+
} elseif ( ! $supports_theme_json && $supports_link_color ) {
|
50 |
+
// For the legacy link color feauter to work, the CSS Custom Properties
|
51 |
+
// should be in scope (either the core or the theme ones).
|
52 |
+
$origins = array( 'core', 'theme' );
|
53 |
+
}
|
54 |
+
|
55 |
+
$stylesheet = $tree->get_stylesheet( $type, $origins );
|
56 |
|
57 |
if ( $can_use_cached ) {
|
58 |
// Cache for a minute.
|
71 |
$settings = gutenberg_get_default_block_editor_settings();
|
72 |
$all = WP_Theme_JSON_Resolver_Gutenberg::get_merged_data( $settings );
|
73 |
|
74 |
+
$stylesheet = gutenberg_experimental_global_styles_get_stylesheet( $all );
|
|
|
|
|
|
|
|
|
75 |
if ( empty( $stylesheet ) ) {
|
76 |
return;
|
77 |
}
|
readme.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
=== Gutenberg ===
|
2 |
Contributors: matveb, joen, karmatosed
|
3 |
Tested up to: 5.8
|
4 |
-
Stable tag: 11.
|
5 |
License: GPLv2 or later
|
6 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
7 |
|
@@ -55,4 +55,4 @@ View <a href="https://developer.wordpress.org/block-editor/principles/versions-i
|
|
55 |
|
56 |
== Changelog ==
|
57 |
|
58 |
-
To read the changelog for Gutenberg 11.5.
|
1 |
=== Gutenberg ===
|
2 |
Contributors: matveb, joen, karmatosed
|
3 |
Tested up to: 5.8
|
4 |
+
Stable tag: 11.5.0
|
5 |
License: GPLv2 or later
|
6 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
7 |
|
55 |
|
56 |
== Changelog ==
|
57 |
|
58 |
+
To read the changelog for Gutenberg 11.5.1, please navigate to the <a href="https://github.com/WordPress/gutenberg/releases/tag/v11.5.1">release page</a>.
|