@dreamworld/dw-ripple 2.4.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,45 +1,8 @@
1
1
  version: 2
2
2
  jobs:
3
- merge-to-development:
4
- machine: true
5
- steps:
6
- - run:
7
- name: Clone Repository
8
- working_directory: ~/workdir
9
- command: |
10
- echo "PR IS::"
11
- echo $CIRCLE_PULL_REQUEST
12
- if [[ -n ${CIRCLE_PULL_REQUEST} ]]
13
- then
14
- git clone https://${GH_TOKEN}@github.com/DreamworldSolutions/$CIRCLE_PROJECT_REPONAME.git my-repo
15
- else
16
- echo "No PR Attached, so not doing anything"
17
- fi
18
- - run:
19
- name: Merge PR branch to development
20
- working_directory: ~/workdir/my-repo
21
- command: |
22
- if [[ -n ${CIRCLE_PULL_REQUEST} ]]
23
- then
24
- # circleci has 2.14.x as of now!
25
- git --version
26
- git config credential.helper 'cache --timeout=120'
27
- git config user.email "dw-devops@dreamworld.solutions"
28
- git config user.name "DW Devops"
29
- git remote set-url --push origin https://${GH_TOKEN}@github.com/DreamworldSolutions/$CIRCLE_PROJECT_REPONAME.git
30
- (git checkout -b feature/development origin/master || true)
31
- (git pull origin feature/development || true)
32
- git merge origin/$CIRCLE_BRANCH --no-ff --no-edit
33
- git push origin feature/development
34
- # Push quietly to prevent showing the token in log
35
- git push -q origin feature/development
36
- else
37
- echo "No PR Attached, so not doing anything."
38
- fi
39
-
40
3
  release-snapshot:
41
4
  docker:
42
- - image: circleci/node:14
5
+ - image: circleci/node:lts
43
6
  steps:
44
7
  - checkout
45
8
  - run: yarn install --frozen-lockfile --non-interactive
@@ -51,7 +14,7 @@ jobs:
51
14
  npx semantic-release
52
15
  release:
53
16
  docker:
54
- - image: circleci/node:14
17
+ - image: circleci/node:lts
55
18
  steps:
56
19
  - checkout
57
20
  - run: yarn install --frozen-lockfile --non-interactive
@@ -60,18 +23,8 @@ jobs:
60
23
  name: Deploy
61
24
  command: npx semantic-release
62
25
 
63
-
64
26
  workflows:
65
27
  version: 2
66
- merge-to-development:
67
- jobs:
68
- - merge-to-development:
69
- context: Dreamworld
70
- filters:
71
- branches:
72
- ignore:
73
- - master
74
- - feature/development
75
28
  release:
76
29
  jobs:
77
30
  - release-snapshot:
@@ -79,10 +32,10 @@ workflows:
79
32
  filters:
80
33
  branches:
81
34
  only:
82
- - feature/development
35
+ - /^feature\/.+$/
83
36
  - release:
84
37
  context: Dreamworld
85
38
  filters:
86
- branches:
87
- only:
88
- - master
39
+ branches:
40
+ only:
41
+ - master
@@ -1,5 +1,4 @@
1
- import { html, css } from "lit-element";
2
- import { LitElement } from "@dreamworld/pwa-helpers/lit-element.js";
1
+ import { LitElement, html, css } from '@dreamworld/pwa-helpers/lit.js';
3
2
 
4
3
  //These are the dw element needed by this element.
5
4
  import "../dw-ripple.js";
package/dw-ripple.js CHANGED
@@ -1,4 +1,4 @@
1
- import { css } from "lit-element";
1
+ import { css } from '@dreamworld/pwa-helpers/lit.js';
2
2
 
3
3
  // These are the mwc element needed by this element.
4
4
  import { Ripple } from "@material/mwc-ripple";
@@ -49,6 +49,8 @@ export class DwRipple extends Ripple {
49
49
  this.__onTouchStart = this.__onTouchStart.bind(this);
50
50
  this.__onMouseUp = this.__onMouseUp.bind(this);
51
51
  this.__onTouchEnd = this.__onTouchEnd.bind(this);
52
+ this.__onPointerMove = this.__onPointerMove.bind(this);
53
+ this.__onTouchMove = this.__onTouchMove.bind(this);
52
54
 
53
55
  if (!this.disableHover) {
54
56
  parent.addEventListener("mouseenter", this._rippleHander.startHover);
@@ -59,16 +61,34 @@ export class DwRipple extends Ripple {
59
61
 
60
62
  parent.addEventListener("mousedown", this.__onMouseDown);
61
63
  parent.addEventListener("touchstart", this.__onTouchStart);
64
+ window.addEventListener("pointermove", this.__onPointerMove);
65
+ window.addEventListener("touchmove", this.__onTouchMove);
62
66
  }
63
67
 
64
68
  __onMouseDown(e) {
65
- window.addEventListener("mouseup", this.__onMouseUp);
66
- this._rippleHander.startPress(e);
69
+ this._timeoutRippleOnMouseDown = setTimeout(() => {
70
+ window.addEventListener("mouseup", this.__onMouseUp);
71
+ this._rippleHander.startPress(e);
72
+ }, 50);
67
73
  }
68
74
 
69
75
  __onTouchStart(e) {
70
- window.addEventListener("touchend", this.__onTouchEnd);
71
- this._rippleHander.startPress(e);
76
+ this._timeoutRippleOnTouchStart = setTimeout(() => {
77
+ window.addEventListener("touchend", this.__onTouchEnd);
78
+ this._rippleHander.startPress(e);
79
+ }, 50);
80
+ }
81
+
82
+ __onPointerMove() {
83
+ if (this._timeoutRippleOnMouseDown) {
84
+ clearTimeout(this._timeoutRippleOnMouseDown);
85
+ }
86
+ }
87
+
88
+ __onTouchMove() {
89
+ if (this._timeoutRippleOnTouchStart) {
90
+ clearTimeout(this._timeoutRippleOnTouchStart);
91
+ }
72
92
  }
73
93
 
74
94
  __onMouseUp() {
@@ -105,6 +125,8 @@ export class DwRipple extends Ripple {
105
125
 
106
126
  window.removeEventListener("touchend", this.__onTouchEnd);
107
127
  window.removeEventListener("mouseup", this.__onMouseUp);
128
+ window.removeEventListener("pointermove", this.__onPointerMove);
129
+ window.removeEventListener("touchmove", this.__onTouchMove);
108
130
 
109
131
  super.disconnectedCallback();
110
132
  }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dreamworld/dw-ripple",
3
- "version": "2.4.0",
3
+ "version": "3.0.0",
4
4
  "description": "Ripple element created as child-class of [`mwc-ripple`] (https://github.com/material-components/material-components-web-components/tree/master/packages/ripple)",
5
5
  "main": "dw-ripple.js",
6
6
  "scripts": {
7
- "start": "polymer serve",
7
+ "start": "wds --node-resolve --app-index demo/index.html --open --watch",
8
8
  "test": "echo \"Error: no test specified\" && exit 1"
9
9
  },
10
10
  "repository": {
@@ -18,14 +18,14 @@
18
18
  },
19
19
  "homepage": "https://github.com/DreamworldSolutions/dw-ripple#readme",
20
20
  "dependencies": {
21
- "@material/mwc-ripple": "^0.26.1",
22
- "lit-element": "^2.2.0"
21
+ "@material/mwc-ripple": "0.27.0"
23
22
  },
24
23
  "devDependencies": {
25
- "@dreamworld/material-styles": "^1.1.0",
26
- "@dreamworld/pwa-helpers": "^1.10.0",
27
- "@material/mwc-formfield": "^0.26.1",
28
- "@material/mwc-switch": "^0.26.1",
24
+ "@dreamworld/material-styles": "^3.0.0",
25
+ "@dreamworld/pwa-helpers": "^1.13.1",
26
+ "@material/mwc-formfield": "0.27.0",
27
+ "@material/mwc-switch": "0.27.0",
28
+ "@web/dev-server": "^0.1.34",
29
29
  "@webcomponents/webcomponentsjs": "^2.2.10",
30
30
  "semantic-release": "17.4.2"
31
31
  },