Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/16.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
igorschoester committed Mar 15, 2021
2 parents d64df1e + 3fe9b2d commit 8a318e3
Show file tree
Hide file tree
Showing 18 changed files with 83 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!--
Attach one of the following labels to the PR: `changelog: bugfix`, `changelog: enhancement`, `changelog: other`, `changelog: non-user-facing`.
Specify between square brackets in which package changelog the item should be included, for example: * [yoast-components] Fixes a bug where ....
Specify between square brackets in which package changelog the item should be included, for example: * [@yoast/components] Fixes a bug where ....
If the same changelog item is applicable to multiple packages, add a separate changelog item for all of them.
If the changelog item should appear in the changelog of the plugin, also add a separate changelog item and put [Yoast SEO Free] or [Yoast SEO Premium] instead of the package name.
If the changelog item is a bugfix, please use the following sentence structure: Fixes a bug where ... would ... (when ...).
Expand Down
12 changes: 6 additions & 6 deletions apps/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yoast/example-component-app",
"version": "1.5.0",
"version": "1.6.0-rc.0",
"description": "This app demonstrates the possibilites of our components",
"main": "index.js",
"author": "Yoast",
Expand All @@ -12,11 +12,11 @@
},
"dependencies": {
"@wordpress/i18n": "1.2.3",
"@yoast/analysis-report": "^1.17.0",
"@yoast/components": "^2.15.0",
"@yoast/configuration-wizard": "^2.18.0",
"@yoast/analysis-report": "^1.18.0-rc.0",
"@yoast/components": "^2.16.0-rc.0",
"@yoast/configuration-wizard": "^2.19.0-rc.0",
"@yoast/helpers": "^0.15.0",
"@yoast/search-metadata-previews": "^2.20.0",
"@yoast/search-metadata-previews": "^2.21.0-rc.0",
"@yoast/style-guide": "^0.13.0",
"babel-polyfill": "^6.23.0",
"lodash": "4.17.11",
Expand Down Expand Up @@ -48,7 +48,7 @@
"webpack": "4.19.1",
"webpack-cli": "^2.1.3",
"webpack-dev-server": "3.1.14",
"yoast-components": "^5.20.0"
"yoast-components": "^5.21.0-rc.0"
},
"peerDependencies": {
"material-ui": "^0.18.6",
Expand Down
6 changes: 3 additions & 3 deletions apps/content-analysis/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@yoast/content-analysis-app",
"version": "0.6.0",
"version": "0.7.0-rc.0",
"private": true,
"dependencies": {
"@babel/core": "7.7.4",
"@svgr/webpack": "4.3.3",
"@wordpress/i18n": "^3.1.1",
"@yoast/analysis-report": "^1.17.0",
"@yoast/components": "^2.15.0",
"@yoast/analysis-report": "^1.18.0-rc.0",
"@yoast/components": "^2.16.0-rc.0",
"@yoast/style-guide": "^0.13.0",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/analysis-report/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yoast/analysis-report",
"version": "1.17.0",
"version": "1.18.0-rc.0",
"main": "src/index.js",
"repository": {
"type": "git",
Expand All @@ -17,7 +17,7 @@
"private": false,
"dependencies": {
"@wordpress/i18n": "^1.1.0",
"@yoast/components": "^2.15.0",
"@yoast/components": "^2.16.0-rc.0",
"@yoast/helpers": "^0.15.0",
"@yoast/style-guide": "^0.13.0",
"lodash": "^4.17.11",
Expand Down
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yoast/components",
"version": "2.15.0",
"version": "2.16.0-rc.0",
"description": "Yoast Components",
"main": "src/index.js",
"private": false,
Expand Down
6 changes: 6 additions & 0 deletions packages/components/src/Alert.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ class Alert extends React.Component {
* @returns {React.Element} The rendered component.
*/
render() {
if ( this.props.isAlertDismissed === true ) {
return null;
}

const options = this.getTypeDisplayOptions( this.props.type );
const dismissAriaLabel = this.props.dismissAriaLabel || __( "Dismiss this alert", "yoast-components" );

Expand Down Expand Up @@ -150,12 +154,14 @@ Alert.propTypes = {
children: PropTypes.any.isRequired,
type: PropTypes.oneOf( [ "error", "info", "success", "warning" ] ).isRequired,
onDismissed: PropTypes.func,
isAlertDismissed: PropTypes.bool,
dismissAriaLabel: PropTypes.string,
className: PropTypes.string,
};

Alert.defaultProps = {
onDismissed: null,
isAlertDismissed: false,
dismissAriaLabel: "",
className: "",
};
Expand Down
4 changes: 2 additions & 2 deletions packages/configuration-wizard/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yoast/configuration-wizard",
"version": "2.18.0",
"version": "2.19.0-rc.0",
"description": "Package for our configuration wizard",
"main": "src/index.js",
"repository": {
Expand All @@ -18,7 +18,7 @@
},
"dependencies": {
"@wordpress/i18n": "^1.1.0",
"@yoast/components": "^2.15.0",
"@yoast/components": "^2.16.0-rc.0",
"@yoast/helpers": "^0.15.0",
"@yoast/style-guide": "^0.13.0",
"interpolate-components": "^1.1.1",
Expand Down
4 changes: 4 additions & 0 deletions packages/helpers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. Releases wi

We follow [Semantic Versioning](http://semver.org/).

## 0.16.0 March 15th, 2021
### Bugfixes
* Fixes a bug where the `wicked-good-xpath` package would be missing because it was set as a development dependency.

## 0.14.0 October 26th, 2020
### Enhancements
* Adds `join` that filters an array with Boolean and then joins it.
Expand Down
6 changes: 3 additions & 3 deletions packages/helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"@wordpress/i18n": "^1.2.3",
"prop-types": "^15.7.2",
"styled-components": "^2.4.1",
"whatwg-fetch": "1.1.1"
"whatwg-fetch": "1.1.1",
"wicked-good-xpath": "^1.3.0"
},
"peerDependencies": {
"react": "^16.12.0"
Expand All @@ -37,8 +38,7 @@
"@yoast/browserslist-config": "^1.2.2",
"browserslist": "^4.7.3",
"jest-styled-components": "^5.0.1",
"react-test-renderer": "^16.8.6",
"wicked-good-xpath": "^1.3.0"
"react-test-renderer": "^16.8.6"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions packages/replacement-variable-editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yoast/replacement-variable-editor",
"version": "1.13.0",
"version": "1.14.0-rc.0",
"private": false,
"main": "src/index.js",
"repository": {
Expand Down Expand Up @@ -35,7 +35,7 @@
"dependencies": {
"@wordpress/a11y": "^1.1.3",
"@wordpress/i18n": "^1.2.3",
"@yoast/components": "^2.15.0",
"@yoast/components": "^2.16.0-rc.0",
"@yoast/helpers": "^0.15.0",
"@yoast/style-guide": "^0.13.0",
"draft-js": "^0.11.4",
Expand Down
4 changes: 4 additions & 0 deletions packages/schema-blocks/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ This changelog is according to [Keep a Changelog](http://keepachangelog.com).
All notable changes to this project will be documented in this file.
We follow [Semantic Versioning](http://semver.org/).

## 1.5.0 March 15th, 2021
### Bugfixes
* Fixes a bug where the editor would crash when a separator would be generated that clashes with a generated ID in the schema template.

## 1.4.0 February 22nd, 2021
### Enhancements
* Adds a `Date` block instruction for adding dates to a schema block template.
Expand Down
7 changes: 3 additions & 4 deletions packages/schema-blocks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yoast/schema-blocks",
"version": "1.4.0",
"version": "1.5.0-rc.0",
"main": "dist/index.js",
"license": "MIT",
"private": false,
Expand All @@ -14,7 +14,7 @@
"@wordpress/element": "^2.9.0",
"@wordpress/hooks": "^2.7.0",
"@wordpress/i18n": "^3.9.0",
"@yoast/components": "^2.15.0",
"@yoast/components": "^2.16.0-rc.0",
"lodash": "^4.17.15",
"tokenizr": "^1.5.2"
},
Expand Down Expand Up @@ -57,11 +57,10 @@
"scripts": {
"build": "tsc",
"watch": "tsc --watch",
"prepare": "yarn build",
"lint": "eslint \"src/**\"",
"lint-fix": "eslint \"src/**\" --fix",
"test": "jest",
"prepublishOnly": "rm -rf dist && tsc && mkdir dist/css && cp -r css/*.css dist/css && cp package.json dist/package.json && json -I -f dist/package.json -e \"this.main='index.js'\""
"prepublishOnly": "rm -rf dist && yarn build && mkdir dist/css && cp -r css/*.css dist/css && cp package.json dist/package.json && json -I -f dist/package.json -e \"this.main='index.js'\""
},
"publishConfig": {
"access": "public"
Expand Down
31 changes: 27 additions & 4 deletions packages/schema-blocks/src/functions/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,36 @@ import { IToken } from "tokenizr";
import BlockDefinition from "../core/blocks/BlockDefinition";
import BlockInstruction from "../core/blocks/BlockInstruction";
import Definition, { DefinitionClass } from "../core/Definition";
import Instruction, { InstructionArray, InstructionValue, InstructionPrimitive, InstructionObject } from "../core/Instruction";
import Instruction, {
InstructionArray,
InstructionValue,
InstructionPrimitive,
InstructionObject,
} from "../core/Instruction";
import SchemaDefinition from "../core/schema/SchemaDefinition";
import SchemaInstruction from "../core/schema/SchemaInstruction";
import { generateUniqueSeparator } from "./separator";
import tokenize from "./tokenize";

let nextId = 0;

/**
* Generate the next instruction ID.
* Skips any IDs that are in the separator.
*
* @param separator The separator string.
*
* @returns The generated ID.
*/
function generateNextId( separator: string ): number {
do {
nextId++;
}
while ( separator.includes( nextId.toString() ) );

return nextId;
}

/**
* Processes an array.
*
Expand Down Expand Up @@ -89,12 +111,13 @@ function processToken( currentToken: IToken, tokens: IToken[] ): InstructionValu
* @param token The current token.
* @param tokens The remaining tokens.
* @param instructionClass The instruction class.
* @param separator The generated separator.
*
* @returns The instruction.
*/
function processBlockInstruction( token: IToken<string>, tokens: IToken[], instructionClass: typeof Instruction ) {
function processBlockInstruction( token: IToken<string>, tokens: IToken[], instructionClass: typeof Instruction, separator: string ) {
const defaultOptions = { name: token.value };
const instruction = instructionClass.create( token.value, nextId++, defaultOptions );
const instruction = instructionClass.create( token.value, generateNextId( separator ), defaultOptions );

while ( tokens[ 0 ] && tokens[ 0 ].isA( "key" ) ) {
const key = camelCase( ( tokens.shift() as IToken<string> ).value );
Expand Down Expand Up @@ -157,7 +180,7 @@ function process<T extends Definition>(
}

if ( token.isA( "definition" ) ) {
const instruction = processBlockInstruction( token as IToken<string>, tokens, instructionClass );
const instruction = processBlockInstruction( token as IToken<string>, tokens, instructionClass, separator );
definition.instructions[ instruction.id ] = instruction;
if ( instruction.renderable() ) {
definition.template += separator + instruction.id + separator;
Expand Down
8 changes: 4 additions & 4 deletions packages/schema-blocks/tests/functions/process.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "../matchMedia.mock";
import process, { processBlock } from "../../src/functions/process";
import BlockDefinition from "../../src/core/blocks/BlockDefinition";
import BlockInstruction from "../../src/core/blocks/BlockInstruction";
import "../../src/instructions/blocks/InnerBlocks";
import "../../src/instructions/blocks/InnerBlocks";
import InnerBlocks from "../../src/instructions/blocks/InnerBlocks";
import { RequiredBlock, RequiredBlockOption } from "../../src/core/validation";

Expand All @@ -19,8 +19,8 @@ describe( "the process function", () => {
'template=[ [ "yoast/ingredients", { "value": [ "ingredient 1", "ingredient 2" ]} ], [ "yoast/ingredients", {} ]] ' +
'appender="button" appenderLabel="Add to recipe" }}';
const expected = {
0: {
id: 0,
1: {
id: 1,
options: {
allowedBlocks: [
"core/paragraph",
Expand All @@ -29,7 +29,7 @@ describe( "the process function", () => {
],
appender: "button",
appenderLabel: "Add to recipe",
name: "inner-blocks",
name: "inner-blocks",
template: [
[
"yoast/ingredients",
Expand Down
6 changes: 3 additions & 3 deletions packages/search-metadata-previews/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yoast/search-metadata-previews",
"version": "2.20.0",
"version": "2.21.0-rc.0",
"private": false,
"main": "src/index.js",
"repository": {
Expand All @@ -18,9 +18,9 @@
"dependencies": {
"@wordpress/a11y": "^1.0.7",
"@wordpress/i18n": "^1.1.0",
"@yoast/components": "^2.15.0",
"@yoast/components": "^2.16.0-rc.0",
"@yoast/helpers": "^0.15.0",
"@yoast/replacement-variable-editor": "^1.13.0",
"@yoast/replacement-variable-editor": "^1.14.0-rc.0",
"@yoast/style-guide": "^0.13.0",
"draft-js": "^0.10.5",
"draft-js-mention-plugin": "^3.0.4",
Expand Down
6 changes: 3 additions & 3 deletions packages/social-metadata-forms/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yoast/social-metadata-forms",
"version": "1.13.0",
"version": "1.14.0-rc.0",
"main": "src/index.js",
"repository": {
"type": "git",
Expand Down Expand Up @@ -37,8 +37,8 @@
},
"dependencies": {
"@wordpress/i18n": "^1.1.0",
"@yoast/components": "^2.15.0",
"@yoast/replacement-variable-editor": "^1.13.0",
"@yoast/components": "^2.16.0-rc.0",
"@yoast/replacement-variable-editor": "^1.14.0-rc.0",
"@yoast/style-guide": "^0.13.0",
"lodash": "^4.17.11",
"prop-types": "^15.6.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/social-metadata-previews/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yoast/social-metadata-previews",
"version": "1.13.0",
"version": "1.14.0-rc.0",
"main": "src/index.js",
"repository": {
"type": "git",
Expand Down Expand Up @@ -37,8 +37,8 @@
},
"dependencies": {
"@wordpress/i18n": "^1.1.0",
"@yoast/replacement-variable-editor": "^1.13.0",
"@yoast/social-metadata-forms": "^1.13.0",
"@yoast/replacement-variable-editor": "^1.14.0-rc.0",
"@yoast/social-metadata-forms": "^1.14.0-rc.0",
"@yoast/style-guide": "^0.13.0",
"lodash": "^4.17.11",
"prop-types": "^15.6.0",
Expand Down
12 changes: 6 additions & 6 deletions packages/yoast-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yoast-components",
"version": "5.20.0",
"version": "5.21.0-rc.0",
"description": "Yoast Generic Components",
"homepage": "https://github.com/Yoast/",
"repository": {
Expand Down Expand Up @@ -59,12 +59,12 @@
"dependencies": {
"@wordpress/a11y": "^1.0.7",
"@wordpress/i18n": "^1.1.0",
"@yoast/analysis-report": "^1.17.0",
"@yoast/components": "^2.15.0",
"@yoast/configuration-wizard": "^2.18.0",
"@yoast/analysis-report": "^1.18.0-rc.0",
"@yoast/components": "^2.16.0-rc.0",
"@yoast/configuration-wizard": "^2.19.0-rc.0",
"@yoast/helpers": "^0.15.0",
"@yoast/replacement-variable-editor": "^1.13.0",
"@yoast/search-metadata-previews": "^2.20.0",
"@yoast/replacement-variable-editor": "^1.14.0-rc.0",
"@yoast/search-metadata-previews": "^2.21.0-rc.0",
"@yoast/style-guide": "^0.13.0",
"clipboard": "^1.5.15",
"draft-js": "^0.11.4",
Expand Down

0 comments on commit 8a318e3

Please sign in to comment.