Skip to content

Commit 783b26e

Browse files
chore(DIST-1438): Prettier setup
1 parent 12eaef2 commit 783b26e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3411
-451
lines changed

.eslintrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@typeform/eslint-config'],
3+
}

.husky/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

demo-html/autoclose/index.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
<link rel="stylesheet" href="//embed.typeform.com/next/css/popup.css" />
88
</head>
99
<body>
10-
<button id="button-html" data-tf-popup="HLjqXS5W" data-tf-auto-close>toggle html</button>
10+
<button id="button-html" data-tf-popup="HLjqXS5W" data-tf-auto-close>
11+
toggle html
12+
</button>
1113
<button id="button-js">toggle js</button>
1214
<script src="//embed.typeform.com/next/embed.js"></script>
1315
<script>

demo-html/autoclose/package.json

+18-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
{"name":"autoclose","version":"1.0.0","main":"index.html","scripts":{"start":"parcel index.html --open","build":"parcel build index.html"},"dependencies":{"parcel-bundler":"^1.6.1"},"devDependencies":{"@babel/core":"7.2.0"},"resolutions":{"@babel/preset-env":"7.13.8"}}
1+
{
2+
"name": "autoclose",
3+
"version": "1.0.0",
4+
"main": "index.html",
5+
"scripts": {
6+
"start": "parcel index.html --open",
7+
"build": "parcel build index.html"
8+
},
9+
"dependencies": {
10+
"parcel-bundler": "^1.6.1"
11+
},
12+
"devDependencies": {
13+
"@babel/core": "7.2.0"
14+
},
15+
"resolutions": {
16+
"@babel/preset-env": "7.13.8"
17+
}
18+
}

demo-html/callbacks/package.json

+18-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
{"name":"callbacks","version":"1.0.0","main":"index.html","scripts":{"start":"parcel index.html --open","build":"parcel build index.html"},"dependencies":{"parcel-bundler":"^1.6.1"},"devDependencies":{"@babel/core":"7.2.0"},"resolutions":{"@babel/preset-env":"7.13.8"}}
1+
{
2+
"name": "callbacks",
3+
"version": "1.0.0",
4+
"main": "index.html",
5+
"scripts": {
6+
"start": "parcel index.html --open",
7+
"build": "parcel build index.html"
8+
},
9+
"dependencies": {
10+
"parcel-bundler": "^1.6.1"
11+
},
12+
"devDependencies": {
13+
"@babel/core": "7.2.0"
14+
},
15+
"resolutions": {
16+
"@babel/preset-env": "7.13.8"
17+
}
18+
}

demo-html/chat/index.html

+9-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ <h1>this is an experimental feature</h1>
4343
</p>
4444

4545
<p>
46-
<button data-tf-slider="HLjqXS5W" data-tf-medium="demo-test" data-tf-chat>open slider</button>
46+
<button data-tf-slider="HLjqXS5W" data-tf-medium="demo-test" data-tf-chat>
47+
open slider
48+
</button>
4749
</p>
4850

4951
<div
@@ -55,7 +57,12 @@ <h1>this is an experimental feature</h1>
5557
data-tf-custom-icon="https://images.typeform.com/images/3n7GXN7HiTZT/image/default"
5658
></div>
5759

58-
<div data-tf-sidetab="HLjqXS5W" data-tf-medium="demo-test" data-tf-chat data-tf-button-text="open sidetab"></div>
60+
<div
61+
data-tf-sidetab="HLjqXS5W"
62+
data-tf-medium="demo-test"
63+
data-tf-chat
64+
data-tf-button-text="open sidetab"
65+
></div>
5966

6067
<script src="//embed.typeform.com/next/embed.js"></script>
6168

demo-html/chat/package.json

+18-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
{"name":"chat","version":"1.0.0","main":"index.html","scripts":{"start":"parcel index.html --open","build":"parcel build index.html"},"dependencies":{"parcel-bundler":"^1.6.1"},"devDependencies":{"@babel/core":"7.2.0"},"resolutions":{"@babel/preset-env":"7.13.8"}}
1+
{
2+
"name": "chat",
3+
"version": "1.0.0",
4+
"main": "index.html",
5+
"scripts": {
6+
"start": "parcel index.html --open",
7+
"build": "parcel build index.html"
8+
},
9+
"dependencies": {
10+
"parcel-bundler": "^1.6.1"
11+
},
12+
"devDependencies": {
13+
"@babel/core": "7.2.0"
14+
},
15+
"resolutions": {
16+
"@babel/preset-env": "7.13.8"
17+
}
18+
}

demo-html/client-side/index.html

+12-4
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,28 @@
1515
</head>
1616
<body>
1717
<h1>This page will inject embed code client-side with JS</h1>
18-
<p>This embed code is inserted before the JS lib is loaded and will load automatically.</p>
18+
<p>
19+
This embed code is inserted before the JS lib is loaded and will load
20+
automatically.
21+
</p>
1922
<div id="content"></div>
2023
<p>
21-
Embed code here is inserted later, after the JS lib is loaded and needs to be loaded manually via
24+
Embed code here is inserted later, after the JS lib is loaded and needs to
25+
be loaded manually via
2226
<code>window.tf.load()</code>.
2327
</p>
2428
<div id="more-content"></div>
2529
<script>
2630
// add snippet
2731
const contentElm = document.querySelector('#content')
28-
contentElm.innerHTML = '<div id="wrapper" data-tf-widget="HLjqXS5W"></div>'
32+
contentElm.innerHTML =
33+
'<div id="wrapper" data-tf-widget="HLjqXS5W"></div>'
2934

3035
setTimeout(() => {
31-
console.log('Is document already loaded?', document.readyState === 'complete' ? 'YES' : 'NO')
36+
console.log(
37+
'Is document already loaded?',
38+
document.readyState === 'complete' ? 'YES' : 'NO'
39+
)
3240
console.log('document.readyState =', document.readyState)
3341

3442
// add script (we can not add scripts via innerHTML)

demo-html/client-side/package.json

+18-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
{"name":"client-side","version":"1.0.0","main":"index.html","scripts":{"start":"parcel index.html --open","build":"parcel build index.html"},"dependencies":{"parcel-bundler":"^1.6.1"},"devDependencies":{"@babel/core":"7.2.0"},"resolutions":{"@babel/preset-env":"7.13.8"}}
1+
{
2+
"name": "client-side",
3+
"version": "1.0.0",
4+
"main": "index.html",
5+
"scripts": {
6+
"start": "parcel index.html --open",
7+
"build": "parcel build index.html"
8+
},
9+
"dependencies": {
10+
"parcel-bundler": "^1.6.1"
11+
},
12+
"devDependencies": {
13+
"@babel/core": "7.2.0"
14+
},
15+
"resolutions": {
16+
"@babel/preset-env": "7.13.8"
17+
}
18+
}

demo-html/exit-html/index.html

+27-6
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@
1818
<body>
1919
<div id="visual-threshold"></div>
2020
<h1>This popup opens on exit intent (via embed code)</h1>
21-
<p>If a user wants to navigate away from your page, they usually need to access the browser toolbar.</p>
22-
<p>We detect mouse movement in top part of the page - if the mouse is moving "up", we open the popup.</p>
21+
<p>
22+
If a user wants to navigate away from your page, they usually need to
23+
access the browser toolbar.
24+
</p>
25+
<p>
26+
We detect mouse movement in top part of the page - if the mouse is moving
27+
"up", we open the popup.
28+
</p>
2329
<p>The popup is opened only once (on first detected exit intent).</p>
2430
<button
2531
id="popup"
@@ -33,17 +39,32 @@ <h1>This popup opens on exit intent (via embed code)</h1>
3339
</button>
3440

3541
<h2>Technical stuff</h2>
36-
<p>This is not available for customization on "Share" page, but the embed lib allows it.</p>
42+
<p>
43+
This is not available for customization on "Share" page, but the embed lib
44+
allows it.
45+
</p>
3746
<form action="" method="get">
3847
<label for="threshold">Pixels from top</label>
39-
<input id="threshold" name="threshold" type="number" value="50" step="10" min="10" max="250" />
48+
<input
49+
id="threshold"
50+
name="threshold"
51+
type="number"
52+
value="50"
53+
step="10"
54+
min="10"
55+
max="250"
56+
/>
4057
<button type="submit">Set</button>
4158
</form>
4259
<script>
4360
// if we want to modify embed code snippets we need to do it before loading embed-next.js
44-
const threshold = parseInt(new URL(window.location.href).searchParams.get('threshold'), 10)
61+
const threshold = parseInt(
62+
new URL(window.location.href).searchParams.get('threshold'),
63+
10
64+
)
4565
if (threshold) {
46-
document.getElementById('visual-threshold').style.height = threshold + 'px'
66+
document.getElementById('visual-threshold').style.height =
67+
threshold + 'px'
4768
document.getElementById('popup').dataset.tfOpenValue = threshold
4869
document.getElementById('threshold').value = threshold
4970
}

demo-html/exit-html/package.json

+18-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
{"name":"exit-html","version":"1.0.0","main":"index.html","scripts":{"start":"parcel index.html --open","build":"parcel build index.html"},"dependencies":{"parcel-bundler":"^1.6.1"},"devDependencies":{"@babel/core":"7.2.0"},"resolutions":{"@babel/preset-env":"7.13.8"}}
1+
{
2+
"name": "exit-html",
3+
"version": "1.0.0",
4+
"main": "index.html",
5+
"scripts": {
6+
"start": "parcel index.html --open",
7+
"build": "parcel build index.html"
8+
},
9+
"dependencies": {
10+
"parcel-bundler": "^1.6.1"
11+
},
12+
"devDependencies": {
13+
"@babel/core": "7.2.0"
14+
},
15+
"resolutions": {
16+
"@babel/preset-env": "7.13.8"
17+
}
18+
}

demo-html/exit-js/index.html

+27-7
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,45 @@
1818
<body>
1919
<div id="visual-threshold"></div>
2020
<h1>This popup opens on exit intent (via API)</h1>
21-
<p>If a user wants to navigate away from your page, they usually need to access the browser toolbar.</p>
22-
<p>We detect mouse movement in top part of the page - if the mouse is moving "up", we open the popup.</p>
21+
<p>
22+
If a user wants to navigate away from your page, they usually need to
23+
access the browser toolbar.
24+
</p>
25+
<p>
26+
We detect mouse movement in top part of the page - if the mouse is moving
27+
"up", we open the popup.
28+
</p>
2329
<p>The popup is opened only once (on first detected exit intent).</p>
2430

2531
<h2>Technical stuff</h2>
26-
<p>This is not available for customization on "Share" page, but the embed lib allows it.</p>
32+
<p>
33+
This is not available for customization on "Share" page, but the embed lib
34+
allows it.
35+
</p>
2736
<form action="" method="get">
2837
<label for="threshold">Pixels from top</label>
29-
<input id="threshold" name="threshold" type="number" value="50" step="10" min="10" max="250" />
38+
<input
39+
id="threshold"
40+
name="threshold"
41+
type="number"
42+
value="50"
43+
step="10"
44+
min="10"
45+
max="250"
46+
/>
3047
<button type="submit">Set</button>
3148
</form>
3249
<script src="//embed.typeform.com/next/embed.js"></script>
3350
<script>
3451
const threshold =
35-
parseInt(new URL(window.location.href).searchParams.get('threshold'), 10) ||
36-
document.getElementById('threshold').value
52+
parseInt(
53+
new URL(window.location.href).searchParams.get('threshold'),
54+
10
55+
) || document.getElementById('threshold').value
3756
if (threshold) {
3857
document.getElementById('threshold').value = threshold
39-
document.getElementById('visual-threshold').style.height = threshold + 'px'
58+
document.getElementById('visual-threshold').style.height =
59+
threshold + 'px'
4060
window.tf.createPopup('HLjqXS5W', {
4161
medium: 'unit-test',
4262
open: 'exit',

demo-html/exit-js/package.json

+18-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
{"name":"exit-js","version":"1.0.0","main":"index.html","scripts":{"start":"parcel index.html --open","build":"parcel build index.html"},"dependencies":{"parcel-bundler":"^1.6.1"},"devDependencies":{"@babel/core":"7.2.0"},"resolutions":{"@babel/preset-env":"7.13.8"}}
1+
{
2+
"name": "exit-js",
3+
"version": "1.0.0",
4+
"main": "index.html",
5+
"scripts": {
6+
"start": "parcel index.html --open",
7+
"build": "parcel build index.html"
8+
},
9+
"dependencies": {
10+
"parcel-bundler": "^1.6.1"
11+
},
12+
"devDependencies": {
13+
"@babel/core": "7.2.0"
14+
},
15+
"resolutions": {
16+
"@babel/preset-env": "7.13.8"
17+
}
18+
}

demo-html/load-html/package.json

+18-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
{"name":"load-html","version":"1.0.0","main":"index.html","scripts":{"start":"parcel index.html --open","build":"parcel build index.html"},"dependencies":{"parcel-bundler":"^1.6.1"},"devDependencies":{"@babel/core":"7.2.0"},"resolutions":{"@babel/preset-env":"7.13.8"}}
1+
{
2+
"name": "load-html",
3+
"version": "1.0.0",
4+
"main": "index.html",
5+
"scripts": {
6+
"start": "parcel index.html --open",
7+
"build": "parcel build index.html"
8+
},
9+
"dependencies": {
10+
"parcel-bundler": "^1.6.1"
11+
},
12+
"devDependencies": {
13+
"@babel/core": "7.2.0"
14+
},
15+
"resolutions": {
16+
"@babel/preset-env": "7.13.8"
17+
}
18+
}

demo-html/load-js/package.json

+18-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
{"name":"load-js","version":"1.0.0","main":"index.html","scripts":{"start":"parcel index.html --open","build":"parcel build index.html"},"dependencies":{"parcel-bundler":"^1.6.1"},"devDependencies":{"@babel/core":"7.2.0"},"resolutions":{"@babel/preset-env":"7.13.8"}}
1+
{
2+
"name": "load-js",
3+
"version": "1.0.0",
4+
"main": "index.html",
5+
"scripts": {
6+
"start": "parcel index.html --open",
7+
"build": "parcel build index.html"
8+
},
9+
"dependencies": {
10+
"parcel-bundler": "^1.6.1"
11+
},
12+
"devDependencies": {
13+
"@babel/core": "7.2.0"
14+
},
15+
"resolutions": {
16+
"@babel/preset-env": "7.13.8"
17+
}
18+
}

demo-html/popover-html/package.json

+18-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
{"name":"popover-html","version":"1.0.0","main":"index.html","scripts":{"start":"parcel index.html --open","build":"parcel build index.html"},"dependencies":{"parcel-bundler":"^1.6.1"},"devDependencies":{"@babel/core":"7.2.0"},"resolutions":{"@babel/preset-env":"7.13.8"}}
1+
{
2+
"name": "popover-html",
3+
"version": "1.0.0",
4+
"main": "index.html",
5+
"scripts": {
6+
"start": "parcel index.html --open",
7+
"build": "parcel build index.html"
8+
},
9+
"dependencies": {
10+
"parcel-bundler": "^1.6.1"
11+
},
12+
"devDependencies": {
13+
"@babel/core": "7.2.0"
14+
},
15+
"resolutions": {
16+
"@babel/preset-env": "7.13.8"
17+
}
18+
}

0 commit comments

Comments
 (0)