diff --git a/README.md b/README.md index e626357..8ca2554 100644 --- a/README.md +++ b/README.md @@ -51,3 +51,7 @@ Soon ## Contributing Contributions are welcome from everyone. + +## License + +GPL-3.0 - Copyright (c) 2018-2022 Michele Giorgi diff --git a/assets/fonts/hanken-grotesk-bold.otf b/assets/fonts/hanken-grotesk-bold.otf deleted file mode 100644 index e6216d1..0000000 Binary files a/assets/fonts/hanken-grotesk-bold.otf and /dev/null differ diff --git a/assets/fonts/hanken-grotesk-bold.woff b/assets/fonts/hanken-grotesk-bold.woff deleted file mode 100644 index 0cbe12c..0000000 Binary files a/assets/fonts/hanken-grotesk-bold.woff and /dev/null differ diff --git a/assets/fonts/hanken-grotesk-bold.woff2 b/assets/fonts/hanken-grotesk-bold.woff2 deleted file mode 100644 index 5b26123..0000000 Binary files a/assets/fonts/hanken-grotesk-bold.woff2 and /dev/null differ diff --git a/assets/fonts/hanken-grotesk-medium.otf b/assets/fonts/hanken-grotesk-medium.otf deleted file mode 100644 index a4a6e55..0000000 Binary files a/assets/fonts/hanken-grotesk-medium.otf and /dev/null differ diff --git a/assets/fonts/hanken-grotesk-medium.woff b/assets/fonts/hanken-grotesk-medium.woff deleted file mode 100644 index 0bf3dd6..0000000 Binary files a/assets/fonts/hanken-grotesk-medium.woff and /dev/null differ diff --git a/assets/fonts/hanken-grotesk-medium.woff2 b/assets/fonts/hanken-grotesk-medium.woff2 deleted file mode 100644 index 115d082..0000000 Binary files a/assets/fonts/hanken-grotesk-medium.woff2 and /dev/null differ diff --git a/assets/fonts/hkgrotesk-bold.woff b/assets/fonts/hkgrotesk-bold.woff new file mode 100644 index 0000000..f96d92a Binary files /dev/null and b/assets/fonts/hkgrotesk-bold.woff differ diff --git a/assets/fonts/hkgrotesk-bold.woff2 b/assets/fonts/hkgrotesk-bold.woff2 new file mode 100644 index 0000000..cfc2b47 Binary files /dev/null and b/assets/fonts/hkgrotesk-bold.woff2 differ diff --git a/assets/fonts/hanken-grotesk-ofl.txt b/assets/fonts/hkgrotesk-license.txt similarity index 96% rename from assets/fonts/hanken-grotesk-ofl.txt rename to assets/fonts/hkgrotesk-license.txt index a116a50..66e9036 100644 --- a/assets/fonts/hanken-grotesk-ofl.txt +++ b/assets/fonts/hkgrotesk-license.txt @@ -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/ | hello@hanken.co) + +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. diff --git a/assets/fonts/hkgrotesk-medium.woff b/assets/fonts/hkgrotesk-medium.woff new file mode 100644 index 0000000..041d6ac Binary files /dev/null and b/assets/fonts/hkgrotesk-medium.woff differ diff --git a/assets/fonts/hkgrotesk-medium.woff2 b/assets/fonts/hkgrotesk-medium.woff2 new file mode 100644 index 0000000..e54e01b Binary files /dev/null and b/assets/fonts/hkgrotesk-medium.woff2 differ diff --git a/assets/scripts/public/modules/fields.js b/assets/scripts/public/modules/fields.js index 8de6a9b..3bd0ea1 100644 --- a/assets/scripts/public/modules/fields.js +++ b/assets/scripts/public/modules/fields.js @@ -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) => { @@ -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); diff --git a/assets/scripts/public/modules/helpers.js b/assets/scripts/public/modules/helpers.js index 968fba2..bc325f5 100644 --- a/assets/scripts/public/modules/helpers.js +++ b/assets/scripts/public/modules/helpers.js @@ -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'; } diff --git a/assets/scripts/public/modules/navigation.js b/assets/scripts/public/modules/navigation.js index 443e45f..e3872ea 100644 --- a/assets/scripts/public/modules/navigation.js +++ b/assets/scripts/public/modules/navigation.js @@ -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'; } } diff --git a/assets/styles/admin/layouts/results.scss b/assets/styles/admin/layouts/results.scss index 9b169c2..085ca06 100644 --- a/assets/styles/admin/layouts/results.scss +++ b/assets/styles/admin/layouts/results.scss @@ -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; diff --git a/assets/styles/admin/layouts/step.scss b/assets/styles/admin/layouts/step.scss index c63aff8..ec1f182 100644 --- a/assets/styles/admin/layouts/step.scss +++ b/assets/styles/admin/layouts/step.scss @@ -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; diff --git a/assets/styles/public/common/_global.scss b/assets/styles/public/common/_global.scss index 5e79bc9..e2db0e8 100755 --- a/assets/styles/public/common/_global.scss +++ b/assets/styles/public/common/_global.scss @@ -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; diff --git a/assets/styles/public/common/_typography.scss b/assets/styles/public/common/_typography.scss index 915387f..983468c 100644 --- a/assets/styles/public/common/_typography.scss +++ b/assets/styles/public/common/_typography.scss @@ -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; } diff --git a/assets/styles/public/common/_variables.scss b/assets/styles/public/common/_variables.scss index a1a0143..e56a843 100755 --- a/assets/styles/public/common/_variables.scss +++ b/assets/styles/public/common/_variables.scss @@ -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; diff --git a/formality.php b/formality.php index 4f7a2b4..69bbfa7 100755 --- a/formality.php +++ b/formality.php @@ -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 @@ -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. @@ -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__ )); /** diff --git a/includes/class-formality.php b/includes/class-formality.php index c61dc4b..9ea5140 100755 --- a/includes/class-formality.php +++ b/includes/class-formality.php @@ -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'); diff --git a/package.json b/package.json index 7ba9cc9..2d4cff8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Formality", - "version": "1.5.0", + "version": "1.5.1", "author": "Michele Giorgi ", "homepage": "https://giorgi.io", "private": true, diff --git a/public/class-formality-fields.php b/public/class-formality-fields.php index 15b6b77..3ded803 100755 --- a/public/class-formality-fields.php +++ b/public/class-formality-fields.php @@ -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 = '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 = '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 .= '