Skip to content

Commit e3919eb

Browse files
authored
Merge pull request #33 from BeAPI/ver/1.0.8
Release 1.0.8
2 parents 40a85e4 + 938d3f8 commit e3919eb

19 files changed

Lines changed: 1661 additions & 5048 deletions

.distignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/.github
44
/node_modules
55
/src
6+
/tests
67

78
# Configuration files
89
.distignore

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/.github export-ignore
44
/node_modules export-ignore
55
/src export-ignore
6+
/tests export-ignore
67

78
# Configuration files
89
/.distignore export-ignore
Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,24 @@
1-
name: "Check plugin version and tags"
1+
name: "Check plugin version and release files"
22
on:
33
pull_request:
44
branches:
55
- main
66

77
jobs:
88
version-check:
9-
name: "Check version doesn't not already exists."
9+
name: "Version bump, tag, and file checks"
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout code
13-
uses: actions/checkout@v3
13+
uses: actions/checkout@v4
1414
with:
1515
fetch-depth: 0
1616

17-
- id: set-vars
18-
name: "Set variables from .plugin-data file"
19-
run: |
20-
# Get all data from .plugin-data file
21-
content=`cat ./.plugin-data`
22-
# the following lines are only required for multi line json
23-
content="${content//'%'/'%25'}"
24-
content="${content//$'\n'/'%0A'}"
25-
content="${content//$'\r'/'%0D'}"
26-
# end of optional handling for multi line json
27-
echo "::set-output name=pluginData::$content"
17+
- name: Fetch tags
18+
run: git fetch --tags --prune origin
2819

29-
- id: version-check
30-
name: "Check version in .plugin-data is not existing"
31-
run: |
32-
# Check version from .plugin-data
33-
VERSION=${{fromJson(steps.set-vars.outputs.pluginData).version}}
34-
35-
if git rev-parse "$VERSION" >/dev/null 2>&1; then
36-
echo "Tag aleady exists please update the .plugin-data file to good version";
37-
exit 1;
38-
fi
20+
- name: Verify version bump and release files
21+
env:
22+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
23+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
24+
run: tests/bin/check-release-version.sh

.github/workflows/quality-js.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ on:
44
pull_request:
55
paths:
66
- 'src/**'
7+
- 'package.json'
78
push:
89
paths:
910
- 'src/**'
11+
- 'package.json'
1012
branches:
1113
- main
1214

.plugin-data

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"version": "1.0.7",
2+
"version": "1.0.8",
33
"slug": "blockparty-modal"
44
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
3+
"landingPage": "/blockparty-modal-demo/",
4+
"preferredVersions": {
5+
"php": "8.1",
6+
"wp": "latest"
7+
},
8+
"steps": [
9+
{
10+
"step": "installPlugin",
11+
"pluginData": {
12+
"resource": "git:directory",
13+
"url": "https://github.com/BeAPI/blockparty-modal",
14+
"ref": "1.0.8",
15+
"refType": "tag"
16+
},
17+
"options": {
18+
"activate": true,
19+
"targetFolderName": "blockparty-modal"
20+
}
21+
},
22+
{
23+
"step": "login",
24+
"username": "admin",
25+
"password": "password"
26+
},
27+
{
28+
"step": "runPHP",
29+
"code": "<?php\nrequire_once 'wordpress/wp-load.php';\n$dir = WP_CONTENT_DIR . '/mu-plugins';\nif ( ! is_dir( $dir ) ) {\n\twp_mkdir_p( $dir );\n}\n$file = $dir . '/blockparty-modal-playground-svg-kses.php';\n$lines = array(\n\t'<?php',\n\t'add_filter( \\'wp_kses_allowed_html\\', function( $tags, $context ) {',\n\t'\tif ( \\'post\\' !== $context ) {',\n\t'\t\treturn $tags;',\n\t'\t}',\n\t'\t$tags[\\'dialog\\'] = array(',\n\t'\t\t\\'aria-modal\\' => true,',\n\t'\t\t\\'class\\' => true,',\n\t'\t\t\\'style\\' => true,',\n\t'\t\t\\'id\\' => true,',\n\t'\t\t\\'closedby\\' => true,',\n\t'\t);',\n\t'\t$tags[\\'svg\\'] = array(',\n\t'\t\t\\'xmlns\\' => true,',\n\t'\t\t\\'viewbox\\' => true,',\n\t'\t\t\\'width\\' => true,',\n\t'\t\t\\'height\\' => true,',\n\t'\t\t\\'fill\\' => true,',\n\t'\t\t\\'class\\' => true,',\n\t'\t\t\\'aria-hidden\\' => true,',\n\t'\t\t\\'role\\' => true,',\n\t'\t\t\\'focusable\\' => true,',\n\t'\t);',\n\t'\t$tags[\\'path\\'] = array(',\n\t'\t\t\\'d\\' => true,',\n\t'\t\t\\'fill\\' => true,',\n\t'\t\t\\'class\\' => true,',\n\t'\t);',\n\t'\treturn $tags;',\n\t'}, 10, 2 );',\n);\nfile_put_contents( $file, implode( \"\\n\", $lines ) . \"\\n\" );\necho file_exists( $file ) ? 'mu-plugin installed' : 'mu-plugin failed';\n?>"
30+
},
31+
{
32+
"step": "runPHP",
33+
"code": "<?php require_once 'wordpress/wp-load.php'; $page_content = '<!-- wp:group {\"style\":{\"spacing\":{\"margin\":{\"top\":\"0\",\"bottom\":\"0\"},\"blockGap\":\"var:preset|spacing|40\"}},\"layout\":{\"type\":\"constrained\"}} -->\n<div class=\"wp-block-group\" style=\"margin-top:0;margin-bottom:0\"><!-- wp:paragraph -->\n<p>Click on the button below to reveal a dialog window.</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:buttons {\"layout\":{\"type\":\"flex\",\"justifyContent\":\"center\"}} -->\n<div class=\"wp-block-buttons\"><!-- wp:button {\"linkedModalId\":\"m-4dc3f7ac0a14\"} -->\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\">About Gutenberg</a></div>\n<!-- /wp:button --></div>\n<!-- /wp:buttons --></div>\n<!-- /wp:group -->\n\n<!-- wp:blockparty/modal {\"title\":\"Johannes Gutenberg\",\"modalId\":\"m-4dc3f7ac0a14\",\"displayIconOnly\":true,\"style\":{\"spacing\":{\"padding\":{\"right\":\"var:preset|spacing|40\",\"left\":\"var:preset|spacing|40\",\"top\":\"var:preset|spacing|40\",\"bottom\":\"var:preset|spacing|40\"}}}} -->\n<dialog class=\"wp-block-blockparty-modal\" style=\"padding-top:var(--wp--preset--spacing--40);padding-right:var(--wp--preset--spacing--40);padding-bottom:var(--wp--preset--spacing--40);padding-left:var(--wp--preset--spacing--40)\" id=\"modal-m-4dc3f7ac0a14\" aria-modal=\"true\" closedby=\"any\"><div class=\"wp-block-blockparty-modal__header\"><h2 class=\"wp-block-blockparty-modal__title\">Johannes Gutenberg</h2></div><div class=\"wp-block-blockparty-modal__content\"><!-- wp:quote -->\n<blockquote class=\"wp-block-quote\"><!-- wp:paragraph -->\n<p><em>\"Gutenberg\" redirects here. For the Bible, see </em><a href=\"https://en.wikipedia.org/wiki/Gutenberg_Bible\">Gutenberg Bible</a><em>. For other uses, see </em><a href=\"https://en.wikipedia.org/wiki/Gutenberg_(disambiguation)\">Gutenberg (disambiguation)</a><em>.</em></p>\n<!-- /wp:paragraph --></blockquote>\n<!-- /wp:quote -->\n\n<!-- wp:paragraph -->\n<p><strong>Johannes Gensfleisch zur Laden zum Gutenberg</strong> (c. 1393–1406 – 3 February 1468) was a German inventor and <a href=\"https://en.wikipedia.org/wiki/Artisan\">craftsman</a> who invented the movable-type <a href=\"https://en.wikipedia.org/wiki/Printing_press\">printing press</a>. Though <a href=\"https://en.wikipedia.org/wiki/Movable_type\">movable type</a> was already in use in East Asia, Gutenberg\\'s invention of the printing press enabled a much faster rate of <a href=\"https://en.wikipedia.org/wiki/Printing\">printing</a>. The printing press later <a href=\"https://en.wikipedia.org/wiki/Global_spread_of_the_printing_press\">spread across the world</a>, and led to an <a href=\"https://en.wikipedia.org/wiki/Information_revolution\">information revolution</a> and the unprecedented mass-spread of literature throughout Europe. It had a profound impact on the development of the <a href=\"https://en.wikipedia.org/wiki/Renaissance\">Renaissance</a>, <a href=\"https://en.wikipedia.org/wiki/Reformation\">Reformation</a>, and <a href=\"https://en.wikipedia.org/wiki/Humanist\">humanist</a> movements.</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph {\"align\":\"right\",\"fontSize\":\"small\"} -->\n<p class=\"has-text-align-right has-small-font-size\">Source : <a href=\"https://en.wikipedia.org/wiki/Johannes_Gutenberg\">Wikipedia</a></p>\n<!-- /wp:paragraph --></div><button type=\"button\" class=\"wp-block-blockparty-modal__close-button\"><span class=\"sr-only\">Close this dialog window</span><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width=\"24\" height=\"24\" aria-hidden=\"true\"><path d=\"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z\"></path></svg></button></dialog>\n<!-- /wp:blockparty/modal -->'; $page_id = wp_insert_post( array( 'post_title' => 'Blockparty Modal', 'post_name' => 'blockparty-modal-demo', 'post_content' => $page_content, 'post_status' => 'publish', 'post_type' => 'page' ) ); echo 'Page created with ID: ' . $page_id; ?>"
34+
}
35+
]
36+
}

CHANGELOG.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.0.8]
9+
10+
* Add GitHub Actions check and `tests/bin/check-release-version.sh` to validate that release version bumps are consistent across all versioned files.
11+
* Add this changelog file (Keep a Changelog format).
12+
* Update WordPress Playground `blueprint.json` demo page content.
13+
* Run the JavaScript quality workflow when `package.json` changes.
14+
* Exclude the `tests/` directory from plugin distribution archives.
15+
* Remove Psalm from development dependencies and GrumPHP.
16+
17+
## [1.0.7]
18+
19+
* Add block setting for the close button label.
20+
21+
## [1.0.6]
22+
23+
* Fix `blueprint.json` config.
24+
25+
## [1.0.5]
26+
27+
* Add `blueprint.json` to test the plugin on WordPress Playground.
28+
* Add `screen-reader-text` class to close button element when display icon only is selected.
29+
30+
## [1.0.4]
31+
32+
* Filter `blockparty_modal_inner_allowed_blocks` to control allowed blocks in the modal.
33+
34+
## [1.0.3]
35+
36+
* Fix: prevent adding linkedModalId attribute to non allowed blocks.
37+
* Set min required PHP version to 8.1
38+
39+
## [1.0.2]
40+
41+
* Filter `blockparty_modal_trigger_allowed_blocks` to control which blocks can be modal triggers; dialog margin and InnerBlocks fixes.
42+
* Crawl Modal blocks from patterns
43+
* Style issues
44+
45+
## [1.0.1]
46+
47+
* Fix margin style for dialog element; set to auto by default instead of 0.
48+
* Remove dupplicated InnerBlocks.Content
49+
50+
## [1.0.0]
51+
52+
* Initial release

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Blockparty — Modal
22

3-
[![Test with WordPress Playground](https://img.shields.io/badge/Test%20with-WordPress%20Playground-0073aa?style=for-the-badge&logo=wordpress&logoColor=white)](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/beapi/blockparty-modal/refs/heads/main/blueprint.json)
3+
[![Test with WordPress Playground](https://img.shields.io/badge/Test%20with-WordPress%20Playground-0073aa?style=for-the-badge&logo=wordpress&logoColor=white)](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/beapi/blockparty-modal/refs/heads/main/.wordpress-org/blueprints/blueprint.json)
44

55
[![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/gpl-2.0)
66
[![WordPress: 6.8+](https://img.shields.io/badge/WordPress-6.8+-green.svg)](https://wordpress.org/)

blockparty-modal.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Plugin Name: Blockparty Modal
44
* Description: Modal block for WordPress editor.
5-
* Version: 1.0.7
5+
* Version: 1.0.8
66
* Requires at least: 6.8
77
* Requires PHP: 8.1
88
* Author: Be API Technical Team
@@ -19,7 +19,7 @@
1919
exit; // Exit if accessed directly.
2020
}
2121

22-
define( 'BLOCKPARTY_MODAL_VERSION', '1.0.7' );
22+
define( 'BLOCKPARTY_MODAL_VERSION', '1.0.8' );
2323
define( 'BLOCKPARTY_MODAL_URL', plugin_dir_url( __FILE__ ) );
2424
define( 'BLOCKPARTY_MODAL_DIR', plugin_dir_path( __FILE__ ) );
2525

blueprint.json

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)