@whitesev/pops 3.3.1 → 3.3.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.
@@ -100,6 +100,7 @@ declare class Pops {
100
100
  formatTime(text?: string | number | Date, formatType?: "yyyy-MM-dd HH:mm:ss" | "yyyy/MM/dd HH:mm:ss" | "yyyy_MM_dd_HH_mm_ss" | "yyyy\u5E74MM\u6708dd\u65E5 HH\u65F6mm\u5206ss\u79D2" | "yyyy\u5E74MM\u6708dd\u65E5 hh:mm:ss" | "yyyy\u5E74MM\u6708dd\u65E5 HH:mm:ss" | "yyyy-MM-dd" | "yyyyMMdd" | "HH:mm:ss"): string;
101
101
  formatByteToSize<T extends boolean>(byteSize: number | string, addType?: T | undefined): T extends true ? string : number;
102
102
  AnyTouch: () => typeof import("any-touch").default;
103
+ AnyTouchDoubleTapPlugin: () => typeof import("@any-touch/doubletap").default;
103
104
  isPhone(userAgent?: string): boolean;
104
105
  setTimeout(callback: (...args: any[]) => any, timeout?: number): number;
105
106
  clearTimeout(timeId: number | undefined): void;
@@ -1,4 +1,5 @@
1
1
  import AnyTouch from "any-touch";
2
+ import doubletap from "@any-touch/doubletap";
2
3
  declare class PopsUtils {
3
4
  /**
4
5
  * 判断是否是window,例如window、self、globalThis
@@ -112,7 +113,14 @@ declare class PopsUtils {
112
113
  * > 793.27
113
114
  **/
114
115
  formatByteToSize<T extends boolean>(byteSize: number | string, addType?: T): T extends true ? string : number;
116
+ /**
117
+ * https://github.com/any86/any-touch/blob/master/README.CN.md
118
+ */
115
119
  AnyTouch: () => typeof AnyTouch;
120
+ /**
121
+ * `any-touch`的`doubletap`事件插件
122
+ */
123
+ AnyTouchDoubleTapPlugin: () => typeof doubletap;
116
124
  /**
117
125
  * 通过navigator.userAgent判断是否是手机访问
118
126
  * @param userAgent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whitesev/pops",
3
- "version": "3.3.1",
3
+ "version": "3.3.2",
4
4
  "description": "弹窗库,包含了alert、confirm、prompt、drawer、folder、loading、iframe、panel、tooltip、searchSuggestion、rightClickMenu组件",
5
5
  "keywords": [
6
6
  "ScriptCat",
@@ -40,6 +40,7 @@
40
40
  "registry": "https://registry.npmjs.org/"
41
41
  },
42
42
  "dependencies": {
43
+ "@any-touch/doubletap": "^2.2.0",
43
44
  "any-touch": "^2.2.0"
44
45
  },
45
46
  "devDependencies": {
@@ -171,14 +171,14 @@ export const PopsHandler = {
171
171
  );
172
172
  }
173
173
  // 判断按下的元素是否是pops-anim
174
- popsDOMUtils.on(config.animElement, ["touchstart", "mousedown"], (event) => {
174
+ popsDOMUtils.on(config.animElement, "pointerup", (event) => {
175
175
  const $click = event.composedPath()[0] as HTMLElement;
176
176
  isMaskClick = isAnimElement($click);
177
177
  });
178
178
  // 如果有动画层,在动画层上监听点击事件
179
179
  popsDOMUtils.on<MouseEvent | PointerEvent>(config.animElement, "click", (event) => {
180
180
  const $click = event.composedPath()[0] as HTMLElement;
181
- if (isAnimElement($click) && isMaskClick) {
181
+ if (isMaskClick && isAnimElement($click)) {
182
182
  return clickEvent(event);
183
183
  }
184
184
  });
@@ -1,4 +1,5 @@
1
1
  import AnyTouch from "any-touch";
2
+ import doubletap from "@any-touch/doubletap";
2
3
  import { PopsCore } from "../PopsCore";
3
4
  import type { PopsUtilsOwnObject } from "../types/main";
4
5
 
@@ -336,9 +337,18 @@ class PopsUtils {
336
337
  result = addType ? result + resultType.toString() : (parseFloat(result.toString()) as any);
337
338
  return result;
338
339
  }
340
+ /**
341
+ * https://github.com/any86/any-touch/blob/master/README.CN.md
342
+ */
339
343
  AnyTouch = () => {
340
344
  return AnyTouch;
341
345
  };
346
+ /**
347
+ * `any-touch`的`doubletap`事件插件
348
+ */
349
+ AnyTouchDoubleTapPlugin = () => {
350
+ return doubletap;
351
+ };
342
352
  /**
343
353
  * 通过navigator.userAgent判断是否是手机访问
344
354
  * @param userAgent