@rdlabo/ionic-theme-ios26 1.2.1 → 1.2.2

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 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sheets-of-glass/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAUjF,eAAO,MAAM,cAAc,GACzB,eAAe,WAAW,EAC1B,eAAe,MAAM,EACrB,mBAAmB,MAAM,EACzB,QAAQ,YAAY,KACnB,gBAAgB,GAAG,SA8LrB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sheets-of-glass/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAUjF,eAAO,MAAM,cAAc,GACzB,eAAe,WAAW,EAC1B,eAAe,MAAM,EACrB,mBAAmB,MAAM,EACzB,QAAQ,YAAY,KACnB,gBAAgB,GAAG,SAiMrB,CAAC"}
@@ -15,7 +15,8 @@ export const registerEffect = (targetElement, effectTagName, selectedClassName,
15
15
  let scaleAnimationPromise;
16
16
  let startAnimationPromise;
17
17
  let maxVelocity = 0;
18
- let wasRealUserClick = false;
18
+ let isUseMove = false;
19
+ let isRealUserClick = false;
19
20
  const effectElement = cloneElement(effectTagName);
20
21
  const onPointerDown = () => {
21
22
  clearActivated();
@@ -23,7 +24,7 @@ export const registerEffect = (targetElement, effectTagName, selectedClassName,
23
24
  createAnimationGesture();
24
25
  };
25
26
  const onPointerUp = (event) => {
26
- wasRealUserClick = true;
27
+ isRealUserClick = true;
27
28
  clearActivatedTimer = setTimeout(async () => {
28
29
  await onEndGesture();
29
30
  gesture.destroy();
@@ -51,7 +52,7 @@ export const registerEffect = (targetElement, effectTagName, selectedClassName,
51
52
  if (!currentTouchedElement) {
52
53
  return;
53
54
  }
54
- if (!wasRealUserClick) {
55
+ if (!isRealUserClick || isUseMove) {
55
56
  currentTouchedElement.click();
56
57
  }
57
58
  currentTouchedElement?.classList.remove('ion-activated');
@@ -59,7 +60,7 @@ export const registerEffect = (targetElement, effectTagName, selectedClassName,
59
60
  effectElement.style.display = 'none';
60
61
  maxVelocity = 0;
61
62
  targetElement.classList.remove(ANIMATED_NAME);
62
- wasRealUserClick = false;
63
+ isRealUserClick = false;
63
64
  };
64
65
  const onStartGesture = (detail) => {
65
66
  currentTouchedElement = detail.event.target.closest(effectTagName) || undefined;
@@ -67,6 +68,7 @@ export const registerEffect = (targetElement, effectTagName, selectedClassName,
67
68
  if (currentTouchedElement === undefined || tabSelectedElement === null) {
68
69
  return false;
69
70
  }
71
+ isUseMove = false;
70
72
  animationPosition = {
71
73
  minPositionX: targetElement.getBoundingClientRect().left,
72
74
  maxPositionX: targetElement.getBoundingClientRect().right - tabSelectedElement.clientWidth,
@@ -92,6 +94,7 @@ export const registerEffect = (targetElement, effectTagName, selectedClassName,
92
94
  return true;
93
95
  };
94
96
  const onMoveGesture = (detail) => {
97
+ isUseMove = true;
95
98
  if (currentTouchedElement === undefined || !moveAnimation) {
96
99
  return false;
97
100
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rdlabo/ionic-theme-ios26",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "iOS26 Theme for Ionic Framework",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -26,7 +26,8 @@ export const registerEffect = (
26
26
  let scaleAnimationPromise: Promise<void> | undefined;
27
27
  let startAnimationPromise: Promise<void> | undefined;
28
28
  let maxVelocity = 0;
29
- let wasRealUserClick = false;
29
+ let isUseMove = false;
30
+ let isRealUserClick = false;
30
31
  const effectElement = cloneElement(effectTagName);
31
32
 
32
33
  /**
@@ -39,7 +40,7 @@ export const registerEffect = (
39
40
  createAnimationGesture();
40
41
  };
41
42
  const onPointerUp = (event: PointerEvent) => {
42
- wasRealUserClick = true;
43
+ isRealUserClick = true;
43
44
  clearActivatedTimer = setTimeout(async () => {
44
45
  await onEndGesture();
45
46
  gesture.destroy();
@@ -70,7 +71,7 @@ export const registerEffect = (
70
71
  if (!currentTouchedElement) {
71
72
  return;
72
73
  }
73
- if (!wasRealUserClick) {
74
+ if (!isRealUserClick || isUseMove) {
74
75
  currentTouchedElement!.click();
75
76
  }
76
77
  currentTouchedElement?.classList.remove('ion-activated');
@@ -78,7 +79,7 @@ export const registerEffect = (
78
79
  effectElement.style.display = 'none';
79
80
  maxVelocity = 0;
80
81
  targetElement.classList.remove(ANIMATED_NAME);
81
- wasRealUserClick = false;
82
+ isRealUserClick = false;
82
83
  };
83
84
 
84
85
  const onStartGesture = (detail: GestureDetail): boolean | undefined => {
@@ -87,6 +88,7 @@ export const registerEffect = (
87
88
  if (currentTouchedElement === undefined || tabSelectedElement === null) {
88
89
  return false;
89
90
  }
91
+ isUseMove = false;
90
92
  animationPosition = {
91
93
  minPositionX: targetElement.getBoundingClientRect().left,
92
94
  maxPositionX: targetElement.getBoundingClientRect().right - tabSelectedElement.clientWidth,
@@ -116,6 +118,7 @@ export const registerEffect = (
116
118
  };
117
119
 
118
120
  const onMoveGesture = (detail: GestureDetail): boolean | undefined => {
121
+ isUseMove = true;
119
122
  if (currentTouchedElement === undefined || !moveAnimation) {
120
123
  return false; // Skip Animation
121
124
  }