Skip to content

Commit 86e207d

Browse files
committed
prep build 07/18
2 parents 39e62f9 + 6b3cb26 commit 86e207d

File tree

137 files changed

+2615
-3082
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+2615
-3082
lines changed

.eslintrc.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,31 @@ module.exports = {
277277
],
278278
},
279279
},
280+
{
281+
// Temporary rules until we're ready to officially deprecate the bottom margins.
282+
files: [ 'packages/*/src/**/*.[tj]s?(x)' ],
283+
excludedFiles: [
284+
'packages/components/src/**/@(test|stories)/**',
285+
'**/*.@(native|ios|android).js',
286+
],
287+
rules: {
288+
'no-restricted-syntax': [
289+
'error',
290+
...restrictedSyntax,
291+
...restrictedSyntaxComponents,
292+
...[
293+
'FocalPointPicker',
294+
'TextareaControl',
295+
'TreeSelect',
296+
].map( ( componentName ) => ( {
297+
selector: `JSXOpeningElement[name.name="${ componentName }"]:not(:has(JSXAttribute[name.name="__nextHasNoMarginBottom"]))`,
298+
message:
299+
componentName +
300+
' should have the `__nextHasNoMarginBottom` prop to opt-in to the new margin-free styles.',
301+
} ) ),
302+
],
303+
},
304+
},
280305
{
281306
files: [
282307
// Components package.

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ changelog.txt linguist-language=Markdown
2020

2121
# Flag docs directory as documentation for GitHub stats.
2222
docs/** linguist-documentation
23+
24+
# TSConfig files use jsonc.
25+
tsconfig*.json linguist-language=jsonc

bin/api-docs/gen-theme-reference.js renamed to bin/api-docs/gen-theme-reference.mjs

Lines changed: 10 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@
77
/**
88
* External dependencies
99
*/
10-
const path = require( 'path' );
11-
const fs = require( 'fs' );
10+
import path from 'path';
11+
import fs from 'fs';
12+
import url from 'url';
13+
import $RefParser from '@apidevtools/json-schema-ref-parser';
14+
15+
const __dirname = path.dirname( url.fileURLToPath( import.meta.url ) );
16+
1217
/**
1318
* Path to root project directory.
1419
*
@@ -58,7 +63,7 @@ const END_TOKEN = '<!-- END TOKEN Autogenerated - DO NOT EDIT -->';
5863
*/
5964
const TOKEN_PATTERN = new RegExp( START_TOKEN + '[^]*' + END_TOKEN );
6065

61-
const themejson = require( THEME_JSON_SCHEMA_FILE );
66+
const themejson = await $RefParser.dereference( THEME_JSON_SCHEMA_FILE );
6267

6368
/**
6469
* Convert object keys to an array.
@@ -74,42 +79,6 @@ const keys = ( maybeObject ) => {
7479
return Object.keys( maybeObject );
7580
};
7681

77-
/**
78-
* Get definition from ref.
79-
*
80-
* @param {string} ref
81-
* @return {Object} definition
82-
* @throws {Error} If the referenced definition is not found in 'themejson.definitions'.
83-
*
84-
* @example
85-
* getDefinition( '#/definitions/typographyProperties/properties/fontFamily' )
86-
* // returns themejson.definitions.typographyProperties.properties.fontFamily
87-
*/
88-
const resolveDefinitionRef = ( ref ) => {
89-
const refParts = ref.split( '/' );
90-
const definition = refParts[ refParts.length - 1 ];
91-
if ( ! themejson.definitions[ definition ] ) {
92-
throw new Error( `Can't resolve '${ ref }'. Definition not found` );
93-
}
94-
return themejson.definitions[ definition ];
95-
};
96-
97-
/**
98-
* Get properties from an array.
99-
*
100-
* @param {Object} items
101-
* @return {Object} properties
102-
*/
103-
const getPropertiesFromArray = ( items ) => {
104-
// if its a $ref resolve it
105-
if ( items.$ref ) {
106-
return resolveDefinitionRef( items.$ref ).properties;
107-
}
108-
109-
// otherwise just return the properties
110-
return items.properties;
111-
};
112-
11382
/**
11483
* Convert settings properties to markup.
11584
*
@@ -133,9 +102,7 @@ const getSettingsPropertiesMarkup = ( struct ) => {
133102
let type = props[ key ].type || '';
134103
let ps =
135104
props[ key ].type === 'array'
136-
? keys( getPropertiesFromArray( props[ key ].items ) )
137-
.sort()
138-
.join( ', ' )
105+
? keys( props[ key ].items.properties ).sort().join( ', ' )
139106
: '';
140107

141108
/*
@@ -154,9 +121,7 @@ const getSettingsPropertiesMarkup = ( struct ) => {
154121
.map( ( item ) =>
155122
item?.type === 'object' && item?.properties
156123
? '_{' +
157-
keys( getPropertiesFromArray( item ) )
158-
.sort()
159-
.join( ', ' ) +
124+
keys( item.properties ).sort().join( ', ' ) +
160125
'}_'
161126
: ''
162127
)
@@ -244,10 +209,6 @@ const formatType = ( prop ) => {
244209
if ( item.type ) {
245210
types.push( item.type );
246211
}
247-
// refComplete is always an object
248-
if ( item.$ref && item.$ref === '#/definitions/refComplete' ) {
249-
types.push( 'object' );
250-
}
251212
} );
252213

253214
type = [ ...new Set( types ) ].join( ', ' );

changelog.txt

Lines changed: 10 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,6 @@
11
== Changelog ==
22

3-
= 18.8.0-rc.3 =
4-
5-
6-
## Changelog
7-
8-
### Bug Fixes
9-
10-
#### Layout
11-
- Fix invalid css for nested fullwidth layouts with zero padding applied. ([63436](https://github.com/WordPress/gutenberg/pull/63436))
12-
13-
#### Typography
14-
- Font Appearance Control: Refactor font appearance fallbacks. ([63215](https://github.com/WordPress/gutenberg/pull/63215))
15-
16-
17-
18-
19-
## Contributors
20-
21-
The following contributors merged PRs in this release:
22-
23-
@mikachan @richtabor
24-
25-
26-
= 18.8.0-rc.2 =
27-
28-
29-
## Changelog
30-
31-
### Bug Fixes
32-
33-
- Fix: Error when calling the PostActions `view-post` callback. ([63460](https://github.com/WordPress/gutenberg/pull/63460))
34-
35-
36-
### Various
37-
38-
#### CSS & Styling
39-
- Only add customizer additional CSS to global styles in block themes. ([63331](https://github.com/WordPress/gutenberg/pull/63331))
40-
41-
42-
## First-time contributors
43-
44-
The following PRs were merged by first-time contributors:
45-
46-
- @sejas: Fix: Error when calling the PostActions `view-post` callback. ([63460](https://github.com/WordPress/gutenberg/pull/63460))
47-
48-
49-
## Contributors
50-
51-
The following contributors merged PRs in this release:
52-
53-
@sejas @tellthemachines
54-
55-
56-
= 18.8.0-rc.1 =
57-
3+
= 18.8.0 =
584

595
## Changelog
606

@@ -192,6 +138,7 @@ The following contributors merged PRs in this release:
192138
- Fix Incorrect URL basename logic in EmbedPreview. ([63052](https://github.com/WordPress/gutenberg/pull/63052))
193139
- Fix: Update "Link Text" label to "Text" on Social Icons block #60966. ([61715](https://github.com/WordPress/gutenberg/pull/61715))
194140
- List: Maintain nested list on parent item removal. ([62949](https://github.com/WordPress/gutenberg/pull/62949))
141+
- Navigation: Allow themes to override block library text-decoration rule. ([63406](https://github.com/WordPress/gutenberg/pull/63406))
195142
- Patterns: Check for edited entity content property when exporting. ([63227](https://github.com/WordPress/gutenberg/pull/63227))
196143
- Reduce specificity of social link icon specific colors. ([63049](https://github.com/WordPress/gutenberg/pull/63049))
197144
- Refactor Post Date Relative Time Rendering for Future Dates. ([62979](https://github.com/WordPress/gutenberg/pull/62979))
@@ -224,11 +171,14 @@ The following contributors merged PRs in this release:
224171
- Only hide drop indicator when grid has `isManualPlacement` set. ([63226](https://github.com/WordPress/gutenberg/pull/63226))
225172
- Remove dotted border from grid dropzone. ([63162](https://github.com/WordPress/gutenberg/pull/63162))
226173
- Resizing in Auto mode shouldn't add `columnStart` and `rowStart` values. ([63160](https://github.com/WordPress/gutenberg/pull/63160))
174+
- Fix invalid css for nested fullwidth layouts with zero padding applied. ([63436](https://github.com/WordPress/gutenberg/pull/63436))
227175

228176
#### Global Styles
177+
- Elements: Avoid specificity bump for top-level element-only selectors. ([63403](https://github.com/WordPress/gutenberg/pull/63403))
229178
- Global styles revisions: Ensure that user-defined variation styles CSS is generated. ([62768](https://github.com/WordPress/gutenberg/pull/62768))
230179
- Root padding styles: Include alignwide in nested has-outer-padding logic. ([63207](https://github.com/WordPress/gutenberg/pull/63207))
231180
- Remove letter-spacing from typography element preview. ([60322](https://github.com/WordPress/gutenberg/pull/60322))
181+
- Only add customizer additional CSS to global styles in block themes. ([63331](https://github.com/WordPress/gutenberg/pull/63331))
232182

233183
#### Site Editor
234184
- Make SiteHub available for Pages, Patterns, and Templates in mobile viewports. ([63118](https://github.com/WordPress/gutenberg/pull/63118))
@@ -243,6 +193,7 @@ The following contributors merged PRs in this release:
243193
#### Block Editor
244194
- Featured Image Panel: Align text and icons horizontally to avoid clipping. ([62842](https://github.com/WordPress/gutenberg/pull/62842))
245195
- Zoom Out: Move the hook to the inserter component. ([63315](https://github.com/WordPress/gutenberg/pull/63315))
196+
- Fix error when calling the PostActions `view-post` callback. ([63460](https://github.com/WordPress/gutenberg/pull/63460))
246197

247198
#### Block bindings
248199
- Disable post meta editing in blocks inside a Query Loop. ([63237](https://github.com/WordPress/gutenberg/pull/63237))
@@ -265,6 +216,7 @@ The following contributors merged PRs in this release:
265216

266217
#### Typography
267218
- Use available font weights and styles in FontAppearanceControl. ([61915](https://github.com/WordPress/gutenberg/pull/61915))
219+
- Font Appearance Control: Refactor font appearance fallbacks. ([63215](https://github.com/WordPress/gutenberg/pull/63215))
268220

269221

270222
### Accessibility
@@ -419,6 +371,7 @@ The following PRs were merged by first-time contributors:
419371
- @iworks: Translation should depend on number of items. ([62857](https://github.com/WordPress/gutenberg/pull/62857))
420372
- @roygbyte: Fix typo to be preposition, not verb, in some package comments and documentations. ([62945](https://github.com/WordPress/gutenberg/pull/62945))
421373
- @shreya0204: Add justification to block toolbar in addition to sidebar. ([62924](https://github.com/WordPress/gutenberg/pull/62924))
374+
- @sejas: Fix: Error when calling the PostActions `view-post` callback. ([63460](https://github.com/WordPress/gutenberg/pull/63460))
422375

423376

424377
## Contributors
@@ -428,6 +381,8 @@ The following contributors merged PRs in this release:
428381
@aaronrobertshaw @afercia @airman5573 @akasunil @aliaghdam @amitraj2203 @bogiii @carolinan @Chrico @ciampo @costasovo @creativecoder @DaniGuardiola @desrosj @dhananjaykuber @dmsnell @ellatrix @fluiddot @geriux @hbhalodia @iamibrahimriaz @iworks @jameskoster @jasmussen @jeryj @jffng @jorgefilipecosta @jsnajdr @juanmaguitar @kevin940726 @luisherranz @MaggieCabrera @Mamaduka @matiasbenedetto @michalczaplinski @mikachan @mirka @ndiego @ntsekouras @oandregal @ockham @peterwilsoncc @ramonjd @richtabor @roygbyte @SantosGuillamot @scruffian @shail-mehta @shreya0204 @sirreal @stokesman @swissspidy @t-hamano @talldan @tellthemachines @tyxla @vipul0425 @westonruter @youknowriad
429382

430383

384+
385+
431386
= 18.7.1 =
432387

433388

docs/contributors/code/coding-guidelines.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Examples of styles that appear in both the theme and the editor include gallery
6565

6666
## JavaScript
6767

68-
JavaScript in Gutenberg uses modern language features of the [ECMAScript language specification](https://www.ecma-international.org/ecma-262/) as well as the [JSX language syntax extension](https://reactjs.org/docs/introducing-jsx.html). These are enabled through a combination of preset configurations, notably [`@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default) which is used as a preset in the project's [Babel](https://babeljs.io/) configuration.
68+
JavaScript in Gutenberg uses modern language features of the [ECMAScript language specification](https://www.ecma-international.org/ecma-262/) as well as the [JSX language syntax extension](https://react.dev/learn/writing-markup-with-jsx). These are enabled through a combination of preset configurations, notably [`@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default) which is used as a preset in the project's [Babel](https://babeljs.io/) configuration.
6969

7070
While the [staged process](https://tc39.es/process-document/) for introducing a new JavaScript language feature offers an opportunity to use new features before they are considered complete, **the Gutenberg project and the `@wordpress/babel-preset-default` configuration will only target support for proposals which have reached Stage 4 ("Finished")**.
7171

@@ -531,7 +531,7 @@ alert( `My name is ${ name }.` );
531531

532532
### React components
533533

534-
It is preferred to implement all components as [function components](https://reactjs.org/docs/components-and-props.html), using [hooks](https://reactjs.org/docs/hooks-reference.html) to manage component state and lifecycle. With the exception of [error boundaries](https://reactjs.org/docs/error-boundaries.html), you should never encounter a situation where you must use a class component. Note that the [WordPress guidance on Code Refactoring](https://make.wordpress.org/core/handbook/contribute/code-refactoring/) applies here: There needn't be a concentrated effort to update class components in bulk. Instead, consider it as a good refactoring opportunity in combination with some other change.
534+
It is preferred to implement all components as [function components](https://react.dev/learn/your-first-component), using [hooks](https://react.dev/reference/react/hooks) to manage component state and lifecycle. With the exception of [error boundaries](https://react.dev/reference/react/Component#catching-rendering-errors-with-an-error-boundary), you should never encounter a situation where you must use a class component. Note that the [WordPress guidance on Code Refactoring](https://make.wordpress.org/core/handbook/contribute/code-refactoring/) applies here: There needn't be a concentrated effort to update class components in bulk. Instead, consider it as a good refactoring opportunity in combination with some other change.
535535

536536
## JavaScript documentation using JSDoc
537537

@@ -758,7 +758,7 @@ When documenting an example, use the markdown <code>\`\`\`</code> code block to
758758

759759
### Documenting React components
760760

761-
When possible, all components should be implemented as [function components](https://reactjs.org/docs/components-and-props.html#function-and-class-components), using [hooks](https://react.dev/reference/react/hooks) for managing component lifecycle and state.
761+
When possible, all components should be implemented as [function components](https://react.dev/learn/your-first-component), using [hooks](https://react.dev/reference/react/hooks) for managing component lifecycle and state.
762762

763763
Documenting a function component should be treated the same as any other function. The primary caveat in documenting a component is being aware that the function typically accepts only a single argument (the "props"), which may include many property members. Use the [dot syntax for parameter properties](https://jsdoc.app/tags-param.html#parameters-with-properties) to document individual prop types.
764764

docs/contributors/code/deprecations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ For features included in the Gutenberg plugin, the deprecation policy is intende
183183

184184
## 3.8.0
185185

186-
- `wp.components.withContext` has been removed. Please use `wp.element.createContext` instead. See: https://reactjs.org/docs/context.html.
186+
- `wp.components.withContext` has been removed. Please use `wp.element.createContext` instead. See: https://react.dev/reference/react/createContext.
187187
- `wp.coreBlocks.registerCoreBlocks` has been removed. Please use `wp.blockLibrary.registerCoreBlocks` instead.
188188
- `wp.editor.DocumentTitle` component has been removed.
189189
- `getDocumentTitle` selector (`core/editor`) has been removed.

docs/how-to-guides/data-basics/2-building-a-list-of-pages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ Note that instead of using an `input` tag, we took advantage of the [SearchContr
172172
173173
![](https://raw.githubusercontent.com/WordPress/gutenberg/HEAD/docs/how-to-guides/data-basics/media/list-of-pages/filter-field.jpg)
174174
175-
The field starts empty, and the contents are stored in the `searchTerm` state value. If you aren’t familiar with the [useState](https://reactjs.org/docs/hooks-state.html) hook, you can learn more in [React’s documentation](https://reactjs.org/docs/hooks-state.html).
175+
The field starts empty, and the contents are stored in the `searchTerm` state value. If you aren’t familiar with the [useState](https://react.dev/reference/react/useState) hook, you can learn more in [React’s documentation](https://react.dev/reference/react/useState).
176176
177177
We can now request only the pages matching the `searchTerm`.
178178

docs/how-to-guides/platform/custom-block-editor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ function Editor( { settings } ) {
277277
}
278278
```
279279

280-
In this process, the core of the editor's layout is being scaffolded, along with a few specialized [context providers](https://reactjs.org/docs/context.html#contextprovider) that make specific functionality available throughout the component hierarchy.
280+
In this process, the core of the editor's layout is being scaffolded, along with a few specialized [context providers](https://react.dev/reference/react/createContext#provider) that make specific functionality available throughout the component hierarchy.
281281

282282
Let's examine these in more detail:
283283

docs/reference-guides/block-api/block-context.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Block context is a feature which enables ancestor blocks to provide values which
44

55
This is especially useful in full-site editing where, for example, the contents of a block may depend on the context of the post in which it is displayed. A blogroll template may show excerpts of many different posts. Using block context, there can still be one single "Post Excerpt" block which displays the contents of the post based on an inherited post ID.
66

7-
If you are familiar with [React Context](https://reactjs.org/docs/context.html), block context adopts many of the same ideas. In fact, the client-side block editor implementation of block context is a very simple application of React Context. Block context is also supported in server-side `render_callback` implementations, demonstrated in the examples below.
7+
If you are familiar with [React Context](https://react.dev/learn/passing-data-deeply-with-context), block context adopts many of the same ideas. In fact, the client-side block editor implementation of block context is a very simple application of React Context. Block context is also supported in server-side `render_callback` implementations, demonstrated in the examples below.
88

99
## Defining block context
1010

docs/reference-guides/core-blocks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ Insert an image to make a visual statement. ([Source](https://github.com/WordPre
387387

388388
- **Name:** core/image
389389
- **Category:** media
390-
- **Supports:** align (center, full, left, right, wide), anchor, color (~~background~~, ~~text~~), filter (duotone), interactivity, shadow ()
390+
- **Supports:** align (center, full, left, right, wide), anchor, color (~~background~~, ~~text~~), filter (duotone), interactivity, shadow (), spacing (margin)
391391
- **Attributes:** alt, aspectRatio, blob, caption, height, href, id, lightbox, linkClass, linkDestination, linkTarget, rel, scale, sizeSlug, title, url, width
392392

393393
## Latest Comments
@@ -810,7 +810,7 @@ Help visitors find your content. ([Source](https://github.com/WordPress/gutenber
810810

811811
- **Name:** core/search
812812
- **Category:** widgets
813-
- **Supports:** align (center, left, right), color (background, gradients, text), interactivity, typography (fontSize, lineHeight), ~~html~~
813+
- **Supports:** align (center, left, right), color (background, gradients, text), interactivity, spacing (margin), typography (fontSize, lineHeight), ~~html~~
814814
- **Attributes:** buttonPosition, buttonText, buttonUseIcon, isSearchFieldHidden, label, placeholder, query, showLabel, width, widthUnit
815815

816816
## Separator

0 commit comments

Comments
 (0)