diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d880dc5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,25 @@ +Copyright (c) 2017, Artur Arseniev +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. +- Neither the name "GrapesJS" nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..e40e6a9 --- /dev/null +++ b/README.md @@ -0,0 +1,115 @@ +# GrapesJS Forms + +This plugin adds some basic form components and blocks to help working with forms easier + +[Demo](http://grapesjs.com/demo.html) +
+ +New components: +`form` +`input` +`textarea` +`select` +`checkbox` +`radio` +`button` +`label` + + + +## Options + +* `blocks` Which blocks to add, default: `['form', 'input', 'textarea', 'select', 'button', 'label', 'checkbox', 'radio']` (all), +* `labelTraitMethod` Method trait label, default: 'Method', +* `labelTraitAction` Action trait label, default: 'Action', +* `labelTraitState` State trait label, default: 'State', +* `labelTraitId` ID trait label, default: 'ID', +* `labelTraitFor` For trait label, default: 'For', +* `labelInputName` Input name label, default: 'Input', +* `labelTextareaName` Textarea name label, default: 'Textarea', +* `labelSelectName` Select name label, default: 'Select', +* `labelCheckboxName` Checkbox name label, default: 'Checkbox', +* `labelRadioName` Radio name label, default: 'Radio', +* `labelButtonName` Button name label, default: 'Button', +* `labelTraitName` Name trait label, default: 'Name', +* `labelTraitPlaceholder` Placeholder trait label, default: 'Placeholder', +* `labelTraitValue` Value trait label, default: 'Value', +* `labelTraitRequired` Required trait label, default: 'Required', +* `labelTraitType` Type trait label, default: 'Type', +* `labelTraitOptions` Options trait label, default: 'Options', +* `labelTraitChecked` Checked trait label, default: 'Checked', +* `labelTypeText` Text type label, default: 'Text', +* `labelTypeEmail` Email type label, default: 'Email', +* `labelTypePassword` Password type label, default: 'Password', +* `labelTypeNumber` Number type label, default: 'Number', +* `labelTypeSubmit` Submit type label, default: 'Submit', +* `labelTypeReset` Reset type label, default: 'Reset', +* `labelTypeButton` Button type label, default: 'Button', +* `labelNameLabel` Label type label, default: 'Label', +* `labelForm` Form type label, default: 'Form', +* `labelSelectOption` Select option type label, default: '- Select option -', +* `labelOption` Option label, default: 'Option' + + + +## Download + +* `npm i grapesjs-mjml` or `yarn add grapesjs-mjml` + + + +## Usage + +```html + + + + +
+ + +``` + + + +## Development + +Clone the repository + +```sh +$ git clone https://github.com/artf/grapesjs-plugin-forms.git +$ cd grapesjs-plugin-forms +``` + +Install it + +```sh +$ npm i +``` + +Start the dev server + +```sh +$ npm start +``` + +Build before the commit. This will also increase the patch level version of the package + +```sh +$ npm run build +``` + + + +## License + +BSD 3-Clause diff --git a/index.html b/index.html index bb5869a..fa7d124 100644 --- a/index.html +++ b/index.html @@ -29,12 +29,15 @@
+
+
+ 3
- - -
- - - - - - Label switch -
- -
- - - - - Label checkbox -
diff --git a/package.json b/package.json index 44e9a0d..634a280 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "grapesjs-plugin-forms", "version": "0.2.2", "private": true, - "description": "GrapesJS set of components and blocks to work with forms", + "description": "Set of forms components and blocks for GrapesJS editor", "main": "dist/grapesjs-plugin-forms.min.js", "scripts": { "lint": "eslint src",