-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1357262
Showing
9 changed files
with
327 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
node: true, | ||
es6: true | ||
}, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:vue/vue3-recommended' | ||
], | ||
rules: { | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,119 @@ | ||
package-lock.json | ||
|
||
# Created by .ignore support plugin (hsz.mobi) | ||
### macOS template | ||
# General | ||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Icon must end with two \r | ||
Icon | ||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
.com.apple.timemachine.donotpresent | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
### Node template | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Typescript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
|
||
### JetBrains template | ||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm | ||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | ||
|
||
.idea | ||
*.iws | ||
*.iml | ||
|
||
cmake-build-debug/ | ||
|
||
|
||
## Plugin-specific files: | ||
|
||
# IntelliJ | ||
out/ | ||
|
||
# mpeltonen/sbt-idea plugin | ||
.idea_modules/ | ||
|
||
# JIRA plugin | ||
atlassian-ide-plugin.xml | ||
|
||
# Crashlytics plugin (for Android Studio and IntelliJ) | ||
com_crashlytics_export_strings.xml | ||
crashlytics.properties | ||
crashlytics-build.properties | ||
fabric.properties | ||
|
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.nuxt/ | ||
coverage/ | ||
dist/ |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": true | ||
} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
nuxt-typeform | ||
|
||
Copyright (C) 2020, jgmullor | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# nuxt-typeform | ||
A NuxtJS wrapper for [Typeform Embed SDK](https://developer.typeform.com/embed/). | ||
|
||
## Installation | ||
|
||
```bash | ||
$ npm install --save nuxt-typeform # or yarn add | ||
``` | ||
|
||
## Setup | ||
- Install with | ||
``` | ||
npm install --save nuxt-typeform | ||
// or | ||
yarn add nuxt-typeform | ||
``` | ||
- Add `nuxt-typeform` to `modules` section of `nuxt.config.js` | ||
```js | ||
modules: [ | ||
'nuxt-typeform', | ||
] | ||
``` | ||
|
||
## Usage | ||
```js | ||
<Typeform | ||
url="https://test.typeform.com/to/test" | ||
:hide-headers="true" | ||
:hide-footer="true" | ||
:button-text="Send" | ||
:opacity="0" | ||
:on-submit="onSubmit" | ||
/> | ||
``` | ||
|
||
```js | ||
export default { | ||
methods: { | ||
... | ||
onSubmit () { | ||
console.log('Typeform successfully submitted') | ||
} | ||
} | ||
} | ||
``` | ||
|
||
## Component Options | ||
|
||
#### `url` (required) | ||
typeform's URL (like: https://admin.typeform.com/to/PlBzgL) | ||
|
||
#### `hide-headers` (optional) | ||
Hide typeform header, that appears when you have a Question group, or a long question that you need to scroll through to answer, like a Multiple Choice block. | ||
|
||
#### `hide-footer` (optional) | ||
Hide typeform footer, that appears showing the progress bar and the navigation buttons. | ||
|
||
#### `opacity` (optional) | ||
You can make your typeform's background totally transparent, or opaque. (For example, to have a video as a background) | ||
|
||
#### `button-text` (optional) | ||
The button text that appears on mobile in order to open the typeform. | ||
|
||
#### `on-submit` (optional) | ||
**PRO+ accounts only** Callback function that will be executed right after the typeform is successfully submitted. | ||
|
||
## Development | ||
|
||
```bash | ||
$ git clone https://github.com/jgmullor/nuxt-typeform.git | ||
$ cd nuxt-typeform | ||
$ npm | ||
``` | ||
|
||
## License | ||
Code released under the [MIT license](LICENSE.txt). |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const { resolve } = require('path') | ||
|
||
module.exports = function () { | ||
this.addPlugin({ | ||
fileName: 'nuxt-typeform.js', | ||
src: resolve(__dirname, 'plugin.js'), | ||
options: {}, | ||
template: { | ||
ssr: false | ||
} | ||
}); | ||
} | ||
|
||
module.exports.meta = require('./package.json') |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "nuxt-typeform", | ||
"version": "0.0.1", | ||
"description": "Embed Typeform surveys in your NuxtJS application", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/jgmullor/nuxt-typeform.git" | ||
}, | ||
"keywords": [ | ||
"nuxtJS", | ||
"vue", | ||
"typeform", | ||
"vuejs" | ||
], | ||
"author": "Jose Gilberto Mullor <[email protected]>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/jgmullor/nuxt-typeform/issues" | ||
}, | ||
"homepage": "https://github.com/jgmullor/nuxt-typeform", | ||
"dependencies": { | ||
"@typeform/embed": "^0.16" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^6.8.0", | ||
"eslint-plugin-vue": "^7.0.0-alpha.0" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import Vue from 'vue'; | ||
import * as typeformEmbed from '@typeform/embed'; | ||
|
||
Vue.component('Typeform', { | ||
props: { | ||
url: { | ||
type: String, | ||
required: true | ||
}, | ||
hideHeaders: { | ||
type: Boolean, | ||
default: true | ||
}, | ||
hideFooter: { | ||
type: Boolean, | ||
default: true | ||
}, | ||
opacity: { | ||
type: Number, | ||
default: 100 | ||
}, | ||
buttonText: { | ||
type: String, | ||
default: undefined | ||
}, | ||
onSubmit: { | ||
type: Function, | ||
default: undefined | ||
} | ||
}, | ||
mounted () { | ||
const options = { | ||
hideHeaders: this.hideHeaders, | ||
hideFooter: this.hideFooter, | ||
opacity: this.opacity, | ||
buttonText: this.buttonText, | ||
onSubmit: this.onSubmit | ||
} | ||
|
||
typeformEmbed.makeWidget(this.$el, this.url, options) | ||
}, | ||
render(createElement) { | ||
return createElement('div'); | ||
} | ||
}); |