Skip to content

Commit

Permalink
Merge pull request #41 from michelegiorgi/development
Browse files Browse the repository at this point in the history
release 1.5.1
  • Loading branch information
michelegiorgi authored Jan 16, 2022
2 parents 452df39 + 6891ac4 commit 7a00288
Show file tree
Hide file tree
Showing 26 changed files with 137 additions and 123 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@ Soon
## Contributing

Contributions are welcome from everyone.

## License

GPL-3.0 - Copyright (c) 2018-2022 Michele Giorgi
Binary file removed assets/fonts/hanken-grotesk-bold.otf
Binary file not shown.
Binary file removed assets/fonts/hanken-grotesk-bold.woff
Binary file not shown.
Binary file removed assets/fonts/hanken-grotesk-bold.woff2
Binary file not shown.
Binary file removed assets/fonts/hanken-grotesk-medium.otf
Binary file not shown.
Binary file removed assets/fonts/hanken-grotesk-medium.woff
Binary file not shown.
Binary file removed assets/fonts/hanken-grotesk-medium.woff2
Binary file not shown.
Binary file added assets/fonts/hkgrotesk-bold.woff
Binary file not shown.
Binary file added assets/fonts/hkgrotesk-bold.woff2
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,94 +1,93 @@
Copyright 2019 Alfredo Marco Pradil (https://hanken.co/), with Reserved Font Name "Hanken Grotesk".


This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Copyright (c) 2021 Alfredo Marco Pradil (https://hanken.co/ | [email protected])

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file added assets/fonts/hkgrotesk-medium.woff
Binary file not shown.
Binary file added assets/fonts/hkgrotesk-medium.woff2
Binary file not shown.
9 changes: 5 additions & 4 deletions assets/scripts/public/modules/fields.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { el, cl, pushEvent, nextEl, prevEl, getInput, isMobile, animateScroll, isVisible } from './helpers'
import { showHints, clearHints } from './hints'
import { moveStep } from './navigation'
import { updateDbg } from './dbg'

export let inputFocus = (input, field, dbg = false) => {
Expand Down Expand Up @@ -86,16 +87,16 @@ export let moveField = (input, field, direction='next', e, conversational=false)
} else {
const form = field.closest(cl('form'))
if(field.matches(':first-child, :nth-child(2)') && direction == 'prev'){
const prevButton = form.querySelector(cl('button', '', 'prev'))
const prevButton = form.querySelector(cl('btn', '', 'prev'))
if(prevButton && isVisible(prevButton)) {
if(e) { e.preventDefault() }
prevButton.click()
moveStep('prev', form)
}
} else if(field.matches(':last-child') && direction == 'next') {
if(e) { e.preventDefault() }
const nextButton = form.querySelector(cl('button', '', 'next'))
const nextButton = form.querySelector(cl('btn', '', 'next'))
if(nextButton && isVisible(nextButton)) {
nextButton.click()
moveStep('next', form)
} else {
let event = new Event('submit', { 'bubbles': true, 'cancelable': true });
form.dispatchEvent(event);
Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/public/modules/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export let isMobile = () => {
return hasTouchScreen
}

export let isVisible = (element) => {
export let isVisible = (elem) => {
return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ) && window.getComputedStyle(elem).visibility !== 'hidden';
}

Expand Down
4 changes: 2 additions & 2 deletions assets/scripts/public/modules/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ export const moveStep = (index, form) => {
const submitBtn = form.querySelector(cl('btn', '', 'submit'))
const nextBtn = form.querySelector(cl('btn', '', 'next'))
const prevBtn = form.querySelector(cl('btn', '', 'prev'))
submitBtn.style.display = index > 0 ? '' : 'none';
submitBtn.style.display = atTheEnd ? '' : 'none';
nextBtn.style.display = !atTheEnd ? '' : 'none';
prevBtn.style.display = atTheEnd ? '' : 'none';
prevBtn.style.display = index > 0 ? '' : 'none';
}
}
2 changes: 1 addition & 1 deletion assets/styles/admin/layouts/results.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
padding-right: 6px;
a {
display: block;
font-family: "Hanken Grotesk";
font-family: "HK Grotesk";
font-weight: bold;
border: 1px solid #eee;
width: 42px;
Expand Down
2 changes: 1 addition & 1 deletion assets/styles/admin/layouts/step.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
h4,
p {
font-family: "Hanken Grotesk", sans-serif;
font-family: "HK Grotesk", sans-serif;
margin: 0;
padding: 0;
line-height: 1.5;
Expand Down
6 changes: 3 additions & 3 deletions assets/styles/public/common/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
font-size: 1em;
font-family: var(--formality_font);
text-rendering: auto;
-webkit-font-smoothing: subpixel-antialiased !important;
-moz-font-smoothing: auto !important;
-moz-osx-font-smoothing: auto !important;
-webkit-font-smoothing: antialiased !important;
-moz-font-smoothing: grayscale !important;
-moz-osx-font-smoothing: grayscale !important;
color: var(--formality_col1);
box-sizing: border-box;
line-height: 1.4;
Expand Down
12 changes: 6 additions & 6 deletions assets/styles/public/common/_typography.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
@font-face {
font-family: "Hanken Grotesk";
font-family: "HK Grotesk";
src:
url("../fonts/hanken-grotesk-medium.woff2") format("woff2"),
url("../fonts/hanken-grotesk-medium.woff") format("woff");
url("../fonts/hkgrotesk-medium.woff2") format("woff2"),
url("../fonts/hkgrotesk-medium.woff") format("woff");
font-style: normal;
font-weight: normal;
}

@font-face {
font-family: "Hanken Grotesk";
font-family: "HK Grotesk";
src:
url("../fonts/hanken-grotesk-bold.woff2") format("woff2"),
url("../fonts/hanken-grotesk-bold.woff") format("woff");
url("../fonts/hkgrotesk-bold.woff2") format("woff2"),
url("../fonts/hkgrotesk-bold.woff") format("woff");
font-style: normal;
font-weight: bold;
}
Expand Down
2 changes: 1 addition & 1 deletion assets/styles/public/common/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
--formality_col2: #ffffff;
--formality_col3: #ff0000;
--formality_bg: #ffffff;
--formality_font: "Hanken Grotesk", sans-serif;
--formality_font: "HK Grotesk", sans-serif;
--formality_fontsize: 20px;
--formality_radius: 0;
--formality_border: 2px;
Expand Down
10 changes: 5 additions & 5 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
* Version: 1.5.1
* Author: Michele Giorgi
* Author URI: https://giorgi.io
* License: GPLv3
Expand All @@ -35,10 +35,10 @@
*
* This program incorporates work covered by the following copyright:
*
* React Sortable HOC - MIT | Copyright (c) 2016, Claudéric Demers | https://github.com/clauderic/react-sortable-hoc
* React Sortable HOC - MIT | Copyright © 2016, Claudéric Demers | https://github.com/clauderic/react-sortable-hoc
* clone-deep - MIT | Copyright © 2018, Jon Schlinkert | https://github.com/jonschlinkert/clone-deep
* Hanken Grotesk - SIL | Copyright 2020 The Hanken Grotesk Project Authors, with Font Name "Hanken Grotesk". | https://github.com/marcologous/hanken-grotesk
* Material design Icons - APACHE 2.0 | Copyright (c) 2014-2020 Google, Inc. | https://github.com/google/material-design-icons
* HK Grotesk - SIL | Copyright © 2021 Alfredo Marco Pradil | https://hanken.co/
* Material design Icons - APACHE 2.0 | Copyright © 2014-2020 Google, Inc. | https://github.com/google/material-design-icons
*/

// If this file is called directly, abort.
Expand All @@ -47,7 +47,7 @@
/**
* Currently plugin version.
*/
define('FORMALITY_VERSION', '1.5');
define('FORMALITY_VERSION', '1.5.1');
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';
$this->version = defined( 'FORMALITY_VERSION' ) ? FORMALITY_VERSION : '1.5.1';
$this->formality = 'formality';
$this->fse = class_exists('WP_Block_Editor_Context');

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Formality",
"version": "1.5.0",
"version": "1.5.1",
"author": "Michele Giorgi <[email protected]>",
"homepage": "https://giorgi.io",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion public/class-formality-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ public function media($options) {
public function upload($options) {
if(!isset($options['formats'])) { $options['formats'] = array('jpg', 'jpeg', 'gif', 'png', 'pdf'); }
if(!isset($options['maxsize'])) { $options['maxsize'] = 3; }
$field = '<input type="file" ' . $this->attr_name($options['uid']) . $this->attr_required($options['required']) . $this->attr_placeholder($options['placeholder']) .' accept=".' . ( count($options['formats']) ? implode(", .", $options['formats']) : 'nnnn' ) . '" data-max-size="' . ($options['maxsize'] * 1048576) .'" />';
$field = '<input type="file" ' . $this->attr_name($options['uid']) . $this->attr_required($options['required']) . $this->attr_placeholder($options['placeholder']) .' accept=".' . ( count($options['formats']) ? implode(", .", $options['formats']) : 'nnnn' ) . '" data-file="" data-max-size="' . ($options['maxsize'] * 1048576) .'" />';
$field .= '<label class="fo__upload" for="' . $options['uid'] . '">';
$field .= '<div class="fo__upload__toggle"><p>' . $options['placeholder'] . '</p>';
$field .= '<span>' . __("Size limit", "formality") . ' <strong>' . $options['maxsize'] . 'MB</strong></span>';
Expand Down
12 changes: 11 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
Stable tag: 1.5.1
Requires PHP: 7.2
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
Expand Down Expand Up @@ -61,6 +61,16 @@ You will find **Formality** menu in your WordPress admin screen.

== Changelog ==

= 1.5.1 =
Release Date: Jan 16th, 2022

* Update HK Grotesk font by Alfredo Marco Pradil (2021 version)
* Fix next/prev buttons visibility on 3+ steps forms ¹
* Fix submit errors with not mandatory upload fields
* Fix step navigation with keyboard

<small>¹ Thanks to @recveri for bug report</small>

= 1.5 =
Release Date: Jan 8th, 2022

Expand Down
Loading

0 comments on commit 7a00288

Please sign in to comment.