Skip to content

Commit

Permalink
prep build 10/07
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Oct 7, 2024
2 parents 4e31183 + 47adb49 commit c733078
Show file tree
Hide file tree
Showing 247 changed files with 2,308 additions and 740 deletions.
11 changes: 2 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ module.exports = {
'BorderBoxControl',
'BorderControl',
'BoxControl',
'Button',
'ComboboxControl',
'CustomSelectControl',
'DimensionControl',
Expand All @@ -343,7 +344,7 @@ module.exports = {
selector: `JSXOpeningElement[name.name="${ componentName }"]:not(:has(JSXAttribute[name.name="__next40pxDefaultSize"][value.expression.value!=false])):not(:has(JSXAttribute[name.name="size"][value.value!="default"]))`,
message:
componentName +
' should have the `__next40pxDefaultSize` prop to opt-in to the new default size.',
' should have the `__next40pxDefaultSize` prop when using the default size.',
} ) ),
{
// Falsy `__next40pxDefaultSize` without a `render` prop.
Expand All @@ -352,14 +353,6 @@ module.exports = {
message:
'FormFileUpload should have the `__next40pxDefaultSize` prop to opt-in to the new default size.',
},
// Temporary rules until all existing components have the `__next40pxDefaultSize` prop.
...[ 'Button' ].map( ( componentName ) => ( {
// Not strict. Allows pre-existing __next40pxDefaultSize={ false } usage until they are all manually updated.
selector: `JSXOpeningElement[name.name="${ componentName }"]:not(:has(JSXAttribute[name.name="__next40pxDefaultSize"])):not(:has(JSXAttribute[name.name="size"]))`,
message:
componentName +
' should have the `__next40pxDefaultSize` prop to opt-in to the new default size.',
} ) ),
],
},
},
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bundle-size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
check-latest: true
cache: npm

- uses: preactjs/compressed-size-action@f780fd104362cfce9e118f9198df2ee37d12946c # v2.6.0
- uses: preactjs/compressed-size-action@6fa0e7ca017120c754863b31123c5ee2860fd434 # v2.7.0
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
pattern: '{build/**/*.min.js,build/**/*.css,build-module/**/*.min.js}'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rnmobile-android-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}

- name: Use desired version of Java
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4.3.0
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73 # v4.4.0
with:
distribution: 'corretto'
java-version: '17'
Expand Down
337 changes: 337 additions & 0 deletions changelog.txt

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions docs/reference-guides/data/data-core-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ _Returns_

Returns the post type of the post currently being edited.

_Usage_

```js
const currentPostType = wp.data.select( 'core/editor' ).getCurrentPostType();
```

_Parameters_

- _state_ `Object`: Global application state.
Expand Down Expand Up @@ -284,6 +290,24 @@ _Returns_

Returns a single attribute of the post being edited, preferring the unsaved edit if one exists, but falling back to the attribute for the last known saved state of the post.

_Usage_

```js
// Get specific media size based on the featured media ID
// Note: change sizes?.large for any registered size
const getFeaturedMediaUrl = useSelect( ( select ) => {
const getFeaturedMediaId =
select( 'core/editor' ).getEditedPostAttribute( 'featured_media' );
const getMedia = select( 'core' ).getMedia( getFeaturedMediaId );

return (
getMedia?.media_details?.sizes?.large?.source_url ||
getMedia?.source_url ||
''
);
}, [] );
```
_Parameters_
- _state_ `Object`: Global application state.
Expand Down Expand Up @@ -1154,11 +1178,38 @@ Disables the publish sidebar.
Returns an action object used in signalling that attributes of the post have been edited.
_Usage_
```js
// Update the post title
wp.data.dispatch( 'core/editor' ).editPost( { title: `${ newTitle }` } );
```
```js
// Get specific media size based on the featured media ID
// Note: change sizes?.large for any registered size
const getFeaturedMediaUrl = useSelect( ( select ) => {
const getFeaturedMediaId =
select( 'core/editor' ).getEditedPostAttribute( 'featured_media' );
const getMedia = select( 'core' ).getMedia( getFeaturedMediaId );

return (
getMedia?.media_details?.sizes?.large?.source_url ||
getMedia?.source_url ||
''
);
}, [] );
```
_Parameters_
- _edits_ `Object`: Post attributes to edit.
- _options_ `Object`: Options for the edit.
_Returns_
- `Object`: Action object
### enablePublishSidebar
Enable the publish sidebar.
Expand Down
Loading

0 comments on commit c733078

Please sign in to comment.