kamrify commited on
Commit
e6213af
·
1 Parent(s): 3f0c832

Refactor and update dependencies

Browse files
.babelrc ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "presets": [
3
+ [
4
+ "@babel/preset-env",
5
+ {
6
+ "useBuiltIns": "usage"
7
+ }
8
+ ]
9
+ ],
10
+ "plugins": [
11
+ "babel-plugin-add-module-exports",
12
+ "@babel/plugin-proposal-object-rest-spread"
13
+ ]
14
+ }
config/webpack.config.demo.js CHANGED
@@ -11,7 +11,6 @@ module.exports = {
11
  entry: [
12
  'webpack-dev-server/client?http://localhost:3000',
13
  './demo/styles/demo.scss',
14
- './demo/scripts/emoji.js',
15
  './demo/scripts/demo.js',
16
  './src/index.js',
17
  ],
@@ -38,20 +37,6 @@ module.exports = {
38
  test: /\.js$/,
39
  exclude: /node_modules/,
40
  loader: 'babel-loader',
41
- options: {
42
- presets: [
43
- [
44
- 'env',
45
- {
46
- useBuiltIns: 'usage',
47
- },
48
- ],
49
- ],
50
- plugins: [
51
- 'babel-plugin-add-module-exports',
52
- 'transform-object-rest-spread',
53
- ],
54
- },
55
  },
56
  {
57
  test: /.scss$/,
 
11
  entry: [
12
  'webpack-dev-server/client?http://localhost:3000',
13
  './demo/styles/demo.scss',
 
14
  './demo/scripts/demo.js',
15
  './src/index.js',
16
  ],
 
37
  test: /\.js$/,
38
  exclude: /node_modules/,
39
  loader: 'babel-loader',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  },
41
  {
42
  test: /.scss$/,
config/webpack.config.prod.js CHANGED
@@ -30,20 +30,6 @@ module.exports = {
30
  test: /\.js$/,
31
  exclude: /node_modules/,
32
  loader: 'babel-loader',
33
- options: {
34
- presets: [
35
- [
36
- 'env',
37
- {
38
- useBuiltIns: 'usage',
39
- },
40
- ],
41
- ],
42
- plugins: [
43
- 'babel-plugin-add-module-exports',
44
- 'transform-object-rest-spread',
45
- ],
46
- },
47
  },
48
  {
49
  test: /.scss$/,
 
30
  test: /\.js$/,
31
  exclude: /node_modules/,
32
  loader: 'babel-loader',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  },
34
  {
35
  test: /.scss$/,
demo/scripts/demo.js CHANGED
@@ -1,6 +1,7 @@
1
  /* eslint-disable */
2
- document.addEventListener('DOMContentLoaded', function () {
3
 
 
4
  const tourSteps = [
5
  {
6
  element: document.getElementById('driver-demo-head'),
 
1
  /* eslint-disable */
2
+ import Driver from '../../src';
3
 
4
+ document.addEventListener('DOMContentLoaded', function () {
5
  const tourSteps = [
6
  {
7
  element: document.getElementById('driver-demo-head'),
demo/scripts/emoji.js DELETED
@@ -1,28 +0,0 @@
1
- // Just for the sake of styling page
2
- /* eslint-disable */
3
-
4
- /**
5
- * Determine if this browser supports emoji.
6
- *
7
- * Modified from https://gist.github.com/mwunsch/4710561
8
- * and probobly originally github's javascript source
9
- */
10
- function doesSupportEmoji() {
11
- let context;
12
- if (!document.createElement('canvas').getContext) return;
13
- context = document.createElement('canvas').getContext('2d');
14
- if ((typeof context.fillText) !== 'function') {
15
- return;
16
- }
17
-
18
- let smile = String.fromCharCode(55357) + String.fromCharCode(56835);
19
-
20
- context.textBaseline = "top";
21
- context.font = "32px Arial";
22
- context.fillText(smile, 0, 0);
23
- return context.getImageData(16, 16, 1, 1).data[0] !== 0;
24
- }
25
-
26
- if (!doesSupportEmoji()) {
27
- twemoji.parse(document.body);
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
package.json CHANGED
@@ -17,29 +17,29 @@
17
  "author": "Kamran Ahmed <[email protected]>",
18
  "license": "MIT",
19
  "devDependencies": {
20
- "babel-core": "^6.26.0",
21
- "babel-eslint": "^8.2.2",
22
- "babel-loader": "^7.1.3",
23
- "babel-plugin-add-module-exports": "^0.2.1",
24
- "babel-plugin-transform-object-rest-spread": "^6.26.0",
25
- "babel-preset-env": "^1.6.1",
26
  "copy-webpack-plugin": "^4.5.1",
27
- "css-loader": "^0.28.10",
28
- "eslint": "^4.18.2",
29
- "eslint-config-airbnb-base": "^12.1.0",
30
  "eslint-loader": "^2.0.0",
31
  "eslint-plugin-import": "^2.9.0",
32
- "eslint-plugin-node": "^6.0.1",
33
- "extract-loader": "^1.0.2",
34
  "extract-text-webpack-plugin": "next",
35
- "file-loader": "^1.1.11",
36
  "node-sass": "^4.7.2",
37
  "opn": "^5.2.0",
38
- "postcss-loader": "^2.1.1",
39
- "sass-loader": "^6.0.7",
40
- "style-loader": "^0.20.2",
41
  "webpack": "^4.0.1",
42
- "webpack-cli": "^2.0.10",
43
  "webpack-dev-server": "^3.1.0"
44
  },
45
  "dependencies": {}
 
17
  "author": "Kamran Ahmed <[email protected]>",
18
  "license": "MIT",
19
  "devDependencies": {
20
+ "@babel/core": "^7.0.0",
21
+ "@babel/plugin-proposal-object-rest-spread": "^7.0.0",
22
+ "@babel/preset-env": "^7.0.0",
23
+ "babel-eslint": "^10.0.1",
24
+ "babel-loader": "^8.0.0",
25
+ "babel-plugin-add-module-exports": "^1.0.0",
26
  "copy-webpack-plugin": "^4.5.1",
27
+ "css-loader": "^1.0.0",
28
+ "eslint": "^5.6.1",
29
+ "eslint-config-airbnb-base": "^13.1.0",
30
  "eslint-loader": "^2.0.0",
31
  "eslint-plugin-import": "^2.9.0",
32
+ "eslint-plugin-node": "^7.0.1",
33
+ "extract-loader": "^3.0.0",
34
  "extract-text-webpack-plugin": "next",
35
+ "file-loader": "^2.0.0",
36
  "node-sass": "^4.7.2",
37
  "opn": "^5.2.0",
38
+ "postcss-loader": "^3.0.0",
39
+ "sass-loader": "^7.1.0",
40
+ "style-loader": "^0.23.1",
41
  "webpack": "^4.0.1",
42
+ "webpack-cli": "^3.1.2",
43
  "webpack-dev-server": "^3.1.0"
44
  },
45
  "dependencies": {}
src/core/element.js CHANGED
@@ -62,10 +62,10 @@ export default class Element {
62
  }
63
 
64
  return (
65
- top >= this.window.pageYOffset &&
66
- left >= this.window.pageXOffset &&
67
- (top + height) <= (this.window.pageYOffset + this.window.innerHeight) &&
68
- (left + width) <= (this.window.pageXOffset + this.window.innerWidth)
69
  );
70
  }
71
 
@@ -267,13 +267,13 @@ export default class Element {
267
  // - Opacity is below 0
268
  // - Filter/transform or perspective is applied
269
  if (
270
- /[0-9]+/.test(zIndex) ||
271
- opacity < 1 ||
272
- (transform && transform !== 'none') ||
273
- (transformStyle && transformStyle !== 'flat') ||
274
- (transformBox && transformBox !== 'border-box') ||
275
- (filter && filter !== 'none') ||
276
- (perspective && perspective !== 'none')
277
  ) {
278
  parentNode.classList.add(CLASS_FIX_STACKING_CONTEXT);
279
  }
 
62
  }
63
 
64
  return (
65
+ top >= this.window.pageYOffset
66
+ && left >= this.window.pageXOffset
67
+ && (top + height) <= (this.window.pageYOffset + this.window.innerHeight)
68
+ && (left + width) <= (this.window.pageXOffset + this.window.innerWidth)
69
  );
70
  }
71
 
 
267
  // - Opacity is below 0
268
  // - Filter/transform or perspective is applied
269
  if (
270
+ /[0-9]+/.test(zIndex)
271
+ || opacity < 1
272
+ || (transform && transform !== 'none')
273
+ || (transformStyle && transformStyle !== 'flat')
274
+ || (transformBox && transformBox !== 'border-box')
275
+ || (filter && filter !== 'none')
276
+ || (perspective && perspective !== 'none')
277
  ) {
278
  parentNode.classList.add(CLASS_FIX_STACKING_CONTEXT);
279
  }
src/core/position.js CHANGED
@@ -29,17 +29,4 @@ export default class Position {
29
  canHighlight() {
30
  return this.left < this.right && this.top < this.bottom;
31
  }
32
-
33
- /**
34
- * Checks if the given position is equal to the passed position
35
- * @param position Position
36
- * @returns {boolean}
37
- * @public
38
- */
39
- equals(position) {
40
- return Math.round(this.left) === Math.round(position.left) &&
41
- Math.round(this.right) === Math.round(position.right) &&
42
- Math.round(this.top) === Math.round(position.top) &&
43
- Math.round(this.bottom) === Math.round(position.bottom);
44
- }
45
  }
 
29
  canHighlight() {
30
  return this.left < this.right && this.top < this.bottom;
31
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  }
src/core/stage.js CHANGED
@@ -90,4 +90,3 @@ export default class Stage extends Element {
90
  this.node.style.backgroundColor = this.options.stageBackground;
91
  }
92
  }
93
-
 
90
  this.node.style.backgroundColor = this.options.stageBackground;
91
  }
92
  }
 
yarn.lock CHANGED
The diff for this file is too large to render. See raw diff