Skip to content

Commit

Permalink
prep build 08/05
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Aug 5, 2023
2 parents bc62d37 + 25215a9 commit 597640d
Show file tree
Hide file tree
Showing 64 changed files with 423 additions and 2,105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Note that the commands described here should be run in the top-level directory o
```sh
nvm install
npm ci
npm run native preios
```

## Run
Expand Down
2 changes: 1 addition & 1 deletion docs/reference-guides/core-blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ Add a link to a downloadable file. ([Source](https://github.com/WordPress/gutenb

- **Name:** core/footnotes
- **Category:** text
- **Supports:** color (background, link, text), ~~html~~, ~~multiple~~, ~~reusable~~
- **Supports:** color (background, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~multiple~~, ~~reusable~~
- **Attributes:**

## Classic
Expand Down
40 changes: 38 additions & 2 deletions packages/block-library/src/footnotes/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,52 @@
"textdomain": "default",
"usesContext": [ "postId", "postType" ],
"supports": {
"__experimentalBorder": {
"radius": true,
"color": true,
"width": true,
"style": true,
"__experimentalDefaultControls": {
"radius": false,
"color": false,
"width": false,
"style": false
}
},
"color": {
"background": true,
"link": true,
"text": true,
"__experimentalDefaultControls": {
"background": true,
"link": true,
"text": true
}
},
"html": false,
"multiple": false,
"reusable": false
"reusable": false,
"spacing": {
"margin": true,
"padding": true,
"__experimentalDefaultControls": {
"margin": false,
"padding": false
}
},
"typography": {
"fontSize": true,
"lineHeight": true,
"__experimentalFontFamily": true,
"__experimentalTextDecoration": true,
"__experimentalFontStyle": true,
"__experimentalFontWeight": true,
"__experimentalLetterSpacing": true,
"__experimentalTextTransform": true,
"__experimentalWritingMode": true,
"__experimentalDefaultControls": {
"fontSize": true
}
}
},
"style": "wp-block-footnotes"
}
38 changes: 20 additions & 18 deletions packages/block-library/src/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,24 +477,26 @@ export default function Image( {
/>
</ToolsPanelItem>
) }
<DimensionsTool
value={ { width, height, scale, aspectRatio } }
onChange={ ( newValue ) => {
// Rebuilding the object forces setting `undefined`
// for values that are removed since setAttributes
// doesn't do anything with keys that aren't set.
setAttributes( {
width: newValue.width,
height: newValue.height,
scale: newValue.scale,
aspectRatio: newValue.aspectRatio,
} );
} }
defaultScale="cover"
defaultAspectRatio="auto"
scaleOptions={ scaleOptions }
unitsOptions={ dimensionsUnitsOptions }
/>
{ isResizable && (
<DimensionsTool
value={ { width, height, scale, aspectRatio } }
onChange={ ( newValue ) => {
// Rebuilding the object forces setting `undefined`
// for values that are removed since setAttributes
// doesn't do anything with keys that aren't set.
setAttributes( {
width: newValue.width,
height: newValue.height,
scale: newValue.scale,
aspectRatio: newValue.aspectRatio,
} );
} }
defaultScale="cover"
defaultAspectRatio="auto"
scaleOptions={ scaleOptions }
unitsOptions={ dimensionsUnitsOptions }
/>
) }
<ResolutionTool
value={ sizeSlug }
onChange={ updateImage }
Expand Down
20 changes: 14 additions & 6 deletions packages/block-library/src/media-text/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const migrateDefaultAlign = ( attributes ) => {
};
};

const baseAttributes = {
const v0Attributes = {
align: {
type: 'string',
default: 'wide',
Expand Down Expand Up @@ -104,12 +104,16 @@ const baseAttributes = {
},
isStackedOnMobile: {
type: 'boolean',
default: true,
default: false,
},
};

const v4ToV5BlockAttributes = {
...baseAttributes,
...v0Attributes,
isStackedOnMobile: {
type: 'boolean',
default: true,
},
mediaUrl: {
type: 'string',
source: 'attribute',
Expand Down Expand Up @@ -578,7 +582,11 @@ const v4 = {
// See: https://github.com/WordPress/gutenberg/pull/21169
const v3 = {
attributes: {
...baseAttributes,
...v0Attributes,
isStackedOnMobile: {
type: 'boolean',
default: true,
},
backgroundColor: {
type: 'string',
},
Expand Down Expand Up @@ -726,7 +734,7 @@ const v3 = {
// See: https://github.com/WordPress/gutenberg/pull/14364
const v2 = {
attributes: {
...baseAttributes,
...v0Attributes,
backgroundColor: {
type: 'string',
},
Expand Down Expand Up @@ -828,7 +836,7 @@ const v2 = {
// See: https://github.com/WordPress/gutenberg/pull/11922
const v1 = {
attributes: {
...baseAttributes,
...v0Attributes,
backgroundColor: {
type: 'string',
},
Expand Down
4 changes: 4 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

- `Modal`: Fix loss of focus when clicking outside ([#52653](https://github.com/WordPress/gutenberg/pull/52653)).

### Internal

- `ControlGroup`, `FormGroup`, `ControlLabel`, `Spinner`: Remove unused `ui/` components from the codebase ([#52953](https://github.com/WordPress/gutenberg/pull/52953)).

## 25.4.0 (2023-07-20)

### Enhancements
Expand Down
83 changes: 83 additions & 0 deletions packages/components/src/menu-group/stories/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/**
* WordPress dependencies
*/
import { useState } from '@wordpress/element';

/**
* Internal dependencies
*/
import MenuGroup from '..';
import MenuItem from '../../menu-item';
import MenuItemsChoice from '../../menu-items-choice';

/**
* External dependencies
*/
import type { ComponentMeta, ComponentStory } from '@storybook/react';

const meta: ComponentMeta< typeof MenuGroup > = {
title: 'Components/MenuGroup',
component: MenuGroup,
argTypes: {
children: { control: { type: null } },
},
parameters: {
controls: { expanded: true },
docs: { source: { state: 'open' } },
},
};
export default meta;

const Template: ComponentStory< typeof MenuGroup > = ( args ) => {
return (
<MenuGroup { ...args }>
<MenuItem>Menu Item 1</MenuItem>
<MenuItem>Menu Item 2</MenuItem>
</MenuGroup>
);
};

export const Default: ComponentStory< typeof MenuGroup > = Template.bind( {} );

const MultiGroupsTemplate: ComponentStory< typeof MenuGroup > = ( args ) => {
const [ mode, setMode ] = useState( 'visual' );
const choices = [
{
value: 'visual',
label: 'Visual editor',
},
{
value: 'text',
label: 'Code editor',
},
];

return (
<>
<MenuGroup label={ 'View' }>
<MenuItem>Top Toolbar</MenuItem>
<MenuItem>Spotlight Mode</MenuItem>
<MenuItem>Distraction Free</MenuItem>
</MenuGroup>
<MenuGroup { ...args }>
<MenuItemsChoice
choices={ choices }
value={ mode }
onSelect={ ( newMode: string ) => setMode( newMode ) }
onHover={ () => {} }
/>
</MenuGroup>
</>
);
};

/**
* When other menu items exist above or below a MenuGroup, the group
* should have a divider line between it and the adjacent item.
*/
export const WithSeperator = MultiGroupsTemplate.bind( {} );
WithSeperator.args = {
...Default.args,
hideSeparator: false,
label: 'Editor',
};
23 changes: 3 additions & 20 deletions packages/components/src/ui/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
# (Next) Component System
# TODO

This directory contains the code for next Component System.
We want to get rid of this folder. Don't add anything new here.

More information can be found in the original GitHub issue:
https://github.com/WordPress/gutenberg/issues/27484

## Usage

(This is still very much a work in progress)

```jsx
import { Text, View } from '@wordpress/components/ui';

function Example() {
return (
<View>
<Text>Code is Poetry</Text>
</View>
);
}
```
What is left of this folder should either be deleted (if unused elsewhere), or be moved into the root `packages/components/src` and `packages/components/src/utils` folders.
23 changes: 0 additions & 23 deletions packages/components/src/ui/control-group/README.md

This file was deleted.

75 changes: 0 additions & 75 deletions packages/components/src/ui/control-group/component.js

This file was deleted.

Loading

0 comments on commit 597640d

Please sign in to comment.