Skip to content

Commit

Permalink
Merge pull request #50 from michelegiorgi/development
Browse files Browse the repository at this point in the history
release 1.5.4
  • Loading branch information
michelegiorgi authored Mar 27, 2022
2 parents d5b114d + 32b4c48 commit b050074
Show file tree
Hide file tree
Showing 10 changed files with 211 additions and 285 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.13.2
4 changes: 2 additions & 2 deletions assets/scripts/public/fields/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export let customSelect = (field, input, select, conversational) => {
let optionsHtml = ''
options.forEach((option) => {
const selected = option.hasAttribute('selected') ? ' class="selected"' : ''
optionsHtml += `<li data-value="${ option.value }"${ selected }>${ option.innerText }</li>`
optionsHtml += `<li data-text="${ option.innerText }" data-value="${ option.value }"${ selected }>${ option.innerText }</li>`
})
const optionsClass = options.length < 6 ? ' options--' + options.length : '';
input.insertAdjacentHTML('beforeend', `<div class="${ el('select', 'list') + optionsClass }"><ul>${ optionsHtml }</ul></div>`)
Expand Down Expand Up @@ -50,7 +50,7 @@ export let customSelect = (field, input, select, conversational) => {
} else if(e.key == 'Enter' && focused) {
selectOption(field, select, selectItems, focused.getAttribute('data-value'), true)
} else if((/^[a-zA-Z0-9]{1}$/).test(e.key)) {
const search = filterElements(selectItems, `[data-value^="${e.key}" i]`)
const search = filterElements(selectItems, `[data-text^="${e.key}" i]`)
if(search) {
moveOption(focused, 'search', search)
}
Expand Down
5 changes: 3 additions & 2 deletions assets/scripts/public/modules/dbg.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ export let initDbg = () => {
}

export let updateDbg = (field) => {
const bgWrap = document.querySelector(cl('bg'))
if(!bgWrap) return
const image = field.getAttribute('data-dbg-image')
const color = field.getAttribute('data-dbg-color')
if(image) {
const newBg = document.createElement('span')
const img = new Image()
const bgWrap = document.querySelector(cl('bg'))
bgWrap.appendChild(newBg)
img.onload = () => {
newBg.style.backgroundImage = 'url('+image+')'
Expand All @@ -26,7 +27,7 @@ export let updateDbg = (field) => {
}
img.src = image;
} else {
const bgs = document.querySelectorAll(cl('bg span'))
const bgs = bgWrap.querySelectorAll('span')
bgs.forEach((bg) => {
if(bg.matches(':not(:last-child)')) {
bg.remove()
Expand Down
1 change: 1 addition & 0 deletions assets/scripts/public/modules/hints.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const { __ } = wp.i18n

export let initHints = () => {
const wrap = document.querySelector(cl('nav', 'hints'))
if(!wrap) return
wrap.setAttribute('data-more', __('Show more hints', 'formality'))
wrap.setAttribute('data-less', __('Show less hints', 'formality'))
wrap.addEventListener('mousedown', (e) => { lessMoreHints(wrap, e) })
Expand Down
4 changes: 2 additions & 2 deletions formality.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Plugin Name: Formality
* Plugin URI: https://formality.dev
* Description: Forms made simple (and cute). Designless, multistep, conversational, secure, all-in-one WordPress forms plugin.
* Version: 1.5.3
* Version: 1.5.4
* Author: Michele Giorgi
* Author URI: https://giorgi.io
* License: GPLv3
Expand Down Expand Up @@ -47,7 +47,7 @@
/**
* Currently plugin version.
*/
define('FORMALITY_VERSION', '1.5.3');
define('FORMALITY_VERSION', '1.5.4');
define('FORMALITY_PATH', plugin_dir_path( __FILE__ ));

/**
Expand Down
2 changes: 1 addition & 1 deletion includes/class-formality.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Formality {
*/
public function __construct() {

$this->version = defined( 'FORMALITY_VERSION' ) ? FORMALITY_VERSION : '1.5.3';
$this->version = defined( 'FORMALITY_VERSION' ) ? FORMALITY_VERSION : '1.5.4';
$this->formality = 'formality';

$this->load_dependencies();
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Formality",
"version": "1.5.3",
"version": "1.5.4",
"author": "Michele Giorgi <[email protected]>",
"homepage": "https://giorgi.io",
"private": true,
Expand All @@ -14,7 +14,7 @@
"extends @wordpress/browserslist-config"
],
"engines": {
"node": ">=12.0.0"
"node": ">=16.0.0"
},
"scripts": {
"build": "cross-env NODE_ENV=development run-s mix",
Expand All @@ -37,16 +37,16 @@
"devDependencies": {
"@babel/plugin-syntax-jsx": "^7.16.7",
"@babel/preset-react": "^7.16.7",
"@wordpress/babel-preset-default": "^6.6.1",
"@wordpress/babel-preset-default": "^6.7.0",
"@wordpress/browserslist-config": "^4.1.2",
"@wordpress/dependency-extraction-webpack-plugin": "^3.4.1",
"babel-eslint": "^10.1.0",
"browser-sync": "^2.27.7",
"browser-sync": "^2.27.9",
"browser-sync-webpack-plugin": "^2.0.1",
"cross-env": "^7.0.2",
"eslint": "^8.11.0",
"eslint": "^8.12.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-react": "^7.29.3",
"eslint-plugin-react": "^7.29.4",
"laravel-mix": "^6.0.43",
"laravel-mix-banner": "^0.1.4",
"laravel-mix-copy-watched": "^2.3.1",
Expand All @@ -56,7 +56,7 @@
"rimraf": "^3.0.2",
"sass": "^1.49.9",
"sass-loader": "^12.6.0",
"stylelint": "^14.5.3",
"stylelint": "^14.6.1",
"stylelint-config-standard": "^25.0.0",
"vue-template-compiler": "^2.6.12"
},
Expand Down
9 changes: 8 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://www.paypal.me/michelegiorgi/
Tags: form, conversational, multistep, design form, gutenberg, block editor
Requires at least: 5.8
Tested up to: 5.9
Stable tag: 1.5.3
Stable tag: 1.5.4
Requires PHP: 7.2
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
Expand Down Expand Up @@ -61,6 +61,13 @@ You will find **Formality** menu in your WordPress admin screen.

== Changelog ==

= 1.5.4 =
Release Date: Mar 27th, 2022

* Fix select keyboard navigation by letter/number
* Fix javascript errors on embedded forms
* Gutenberg 12.8.1 compatibility

= 1.5.3 =
Release Date: Mar 13th, 2022

Expand Down
2 changes: 1 addition & 1 deletion webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mix
.js('assets/scripts/public/index.js', 'scripts/formality-public.js')
.js('assets/scripts/editor/index.js', 'scripts/formality-editor.js')
.js('assets/scripts/admin/index.js', 'scripts/formality-admin.js')
.banner({ banner: 'Formality v1.5.3' });
.banner({ banner: 'Formality v1.5.4' });

mix
.copyWatched('assets/images/admin/**', 'dist/images/admin')
Expand Down
Loading

0 comments on commit b050074

Please sign in to comment.