-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from michelegiorgi/development
Release 1.5.6
- Loading branch information
Showing
13 changed files
with
752 additions
and
344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,41 @@ | ||
// Formality public script | ||
import { cl, isConversational, getInput } from './modules/helpers' | ||
import { cl, isConversational, isLoaded, getInput, pushEvent } from './modules/helpers' | ||
|
||
import { initLoader } from './modules/loader' | ||
import { inputFocus, inputPlaceholder, inputFilled, inputKeypress, firstFocus } from './modules/fields' | ||
import { hasDbg } from './modules/dbg' | ||
import { loadFields, firstFocus } from './modules/fields' | ||
import { buildNavigation } from './modules/navigation' | ||
import { liveUpdate, addStepIndexes } from './modules/validation' | ||
import { addStepIndexes } from './modules/validation' | ||
import { submitForm } from './modules/submit' | ||
import { initConditionalField } from './modules/conditional' | ||
import { initHints } from './modules/hints' | ||
import { initEmbeds } from './modules/embeds' | ||
|
||
import { initMedia } from './fields/media' | ||
import { fieldMultiple } from './fields/multiple' | ||
import { fieldNumber } from './fields/number' | ||
import { fieldRating } from './fields/rating' | ||
import { fieldSwitch } from './fields/switch' | ||
import { fieldTextarea } from './fields/textarea' | ||
import { fieldUpload, dragNdrop } from './fields/upload' | ||
import { fieldSelect } from './fields/select' | ||
import { dragNdrop } from './fields/upload' | ||
|
||
let initForm = (form) => { | ||
const conversational = isConversational(form) | ||
initLoader(form) | ||
addStepIndexes(form) | ||
loadFields(form, conversational) | ||
buildNavigation(form, conversational) | ||
submitForm(form) | ||
initMedia(form) | ||
} | ||
|
||
let loadFields = (form, conversational = false) => { | ||
const fields = form.querySelectorAll(cl('field')) | ||
const dbg = hasDbg(form) | ||
fields.forEach((field) => { | ||
initConditionalField(form, field) | ||
const inputs = getInput(field, true) | ||
inputs.forEach((input) => { | ||
inputFocus(input, field, dbg) | ||
inputPlaceholder(input, field) | ||
inputFilled(input, field) | ||
inputKeypress(input, field, conversational) | ||
liveUpdate(input) | ||
}) | ||
fieldMultiple(field) | ||
fieldNumber(field) | ||
fieldRating(field) | ||
fieldSwitch(field) | ||
fieldTextarea(field) | ||
fieldUpload(field) | ||
fieldSelect(field, conversational) | ||
}) | ||
} | ||
|
||
document.addEventListener('DOMContentLoaded', () => { | ||
let initForms = () => { | ||
const forms = document.querySelectorAll(cl('form')) | ||
forms.forEach((form) => { initForm(form) }) | ||
forms.forEach((form) => { | ||
const conversational = isConversational(form) | ||
const loaded = isLoaded(form) | ||
if(!loaded) { | ||
initLoader(form) | ||
addStepIndexes(form) | ||
loadFields(form, conversational) | ||
buildNavigation(form, conversational) | ||
submitForm(form) | ||
initMedia(form) | ||
} | ||
}) | ||
firstFocus() | ||
initHints() | ||
initEmbeds() | ||
dragNdrop() | ||
} | ||
|
||
window.addEventListener('foFormsInit', () => { | ||
initForms() | ||
}) | ||
|
||
document.addEventListener('DOMContentLoaded', () => { | ||
pushEvent('FormsInit'); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "Formality", | ||
"version": "1.5.5", | ||
"version": "1.5.6", | ||
"author": "Michele Giorgi <[email protected]>", | ||
"homepage": "https://giorgi.io", | ||
"private": true, | ||
|
@@ -35,30 +35,30 @@ | |
"dependencies": "yarn upgrade-interactive --latest" | ||
}, | ||
"devDependencies": { | ||
"@babel/plugin-syntax-jsx": "^7.16.7", | ||
"@babel/preset-react": "^7.16.7", | ||
"@wordpress/babel-preset-default": "^6.10.0", | ||
"@wordpress/browserslist-config": "^4.1.2", | ||
"@wordpress/dependency-extraction-webpack-plugin": "^3.4.1", | ||
"@babel/plugin-syntax-jsx": "^7.18.6", | ||
"@babel/preset-react": "^7.18.6", | ||
"@wordpress/babel-preset-default": "^7.4.0", | ||
"@wordpress/browserslist-config": "^5.3.0", | ||
"@wordpress/dependency-extraction-webpack-plugin": "^4.3.0", | ||
"babel-eslint": "^10.1.0", | ||
"browser-sync": "^2.27.9", | ||
"browser-sync": "^2.27.10", | ||
"browser-sync-webpack-plugin": "^2.0.1", | ||
"cross-env": "^7.0.2", | ||
"eslint": "^8.15.0", | ||
"eslint": "^8.26.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-react": "^7.29.4", | ||
"laravel-mix": "^6.0.43", | ||
"eslint-plugin-react": "^7.31.10", | ||
"laravel-mix": "^6.0.49", | ||
"laravel-mix-banner": "^0.1.4", | ||
"laravel-mix-copy-watched": "^2.3.1", | ||
"laravel-mix-copy-watched": "^3.0.0", | ||
"laravel-mix-purgecss": "^6.0.0", | ||
"npm-run-all": "^4.1", | ||
"purgecss-with-wordpress": "^4.1.0", | ||
"purgecss-with-wordpress": "^5.0.0", | ||
"rimraf": "^3.0.2", | ||
"sass": "^1.51.0", | ||
"sass-loader": "^12.6.0", | ||
"stylelint": "^14.8.2", | ||
"stylelint-config-standard": "^25.0.0", | ||
"vue-template-compiler": "^2.6.12" | ||
"sass": "^1.55.0", | ||
"sass-loader": "^13.1.0", | ||
"stylelint": "^14.14.0", | ||
"stylelint-config-standard": "^29.0.0", | ||
"vue-template-compiler": "^2.7.13" | ||
}, | ||
"dependencies": { | ||
"clone-deep": "^4.0.1", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.