storybook-addon-playwright 4.13.3 → 4.13.4

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.
@@ -89,11 +89,25 @@
89
89
  }
90
90
  },
91
91
  "additionalProperties": false
92
+ },
93
+ "options": {
94
+ "type": "object",
95
+ "properties": {
96
+ "releaseMouse": {
97
+ "type": "boolean",
98
+ "default": true
99
+ }
100
+ },
101
+ "required": [
102
+ "releaseMouse"
103
+ ],
104
+ "additionalProperties": false
92
105
  }
93
106
  },
94
107
  "required": [
95
108
  "from",
96
- "to"
109
+ "to",
110
+ "options"
97
111
  ],
98
112
  "description": "This method will perform mouse down, move,and up from to selected location."
99
113
  },
@@ -1,3 +1,3 @@
1
- import { Position } from './typings';
1
+ import { MouseFromToOptions, Position } from './typings';
2
2
  import { Page } from 'playwright';
3
- export declare function mouseFromTo(this: Page, from: Position, to: Position): Promise<void>;
3
+ export declare function mouseFromTo(this: Page, from: Position, to: Position, options: MouseFromToOptions): Promise<void>;
@@ -2,13 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mouseFromTo = void 0;
4
4
  const tslib_1 = require("tslib");
5
- function mouseFromTo(from, to) {
5
+ function mouseFromTo(from, to, options) {
6
6
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
7
+ const { releaseMouse = true } = options || {};
7
8
  // move mouse to center of element or specified point
8
9
  yield this.mouse.move(from.x, from.y);
9
10
  yield this.mouse.down();
10
11
  yield this.mouse.move(to.x, to.y);
11
- yield this.mouse.up();
12
+ if (releaseMouse)
13
+ yield this.mouse.up();
12
14
  });
13
15
  }
14
16
  exports.mouseFromTo = mouseFromTo;
@@ -1 +1 @@
1
- {"version":3,"file":"mouse-from-to.js","sourceRoot":"","sources":["../../src/page-extra/mouse-from-to.ts"],"names":[],"mappings":";;;;AAGA,SAAsB,WAAW,CAAa,IAAc,EAAE,EAAY;;QACxE,qDAAqD;QACrD,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QAEtC,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAExB,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QAElC,MAAM,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;IACxB,CAAC;CAAA;AATD,kCASC"}
1
+ {"version":3,"file":"mouse-from-to.js","sourceRoot":"","sources":["../../src/page-extra/mouse-from-to.ts"],"names":[],"mappings":";;;;AAGA,SAAsB,WAAW,CAE/B,IAAc,EACd,EAAY,EACZ,OAA2B;;QAE3B,MAAM,EAAE,YAAY,GAAG,IAAI,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;QAE9C,qDAAqD;QACrD,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QAEtC,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAExB,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QAElC,IAAI,YAAY;YAAE,MAAM,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;IAC1C,CAAC;CAAA;AAhBD,kCAgBC"}
@@ -51,6 +51,12 @@ export interface ElementHandleBoundingBox {
51
51
  */
52
52
  height: number;
53
53
  }
54
+ export interface MouseFromToOptions {
55
+ /**
56
+ * @default true
57
+ */
58
+ releaseMouse: boolean;
59
+ }
54
60
  export interface PlaywrightPageWithExtra {
55
61
  /**
56
62
  * This method fetches an element with `selector`, waits for actionability checks, focuses the element, clear it and triggers an input event.
@@ -70,7 +76,7 @@ export interface PlaywrightPageWithExtra {
70
76
  * @param from position in page
71
77
  * @param to position in page
72
78
  */
73
- mouseFromTo: (from: Position, to: Position) => Promise<void>;
79
+ mouseFromTo: (from: Position, to: Position, options: MouseFromToOptions) => Promise<void>;
74
80
  /**
75
81
  * This method fetches an element with `selector`, and set the selector scrollLeft and scrollTop.
76
82
  * If there's no element matching `selector`, the method waits until a matching element appears in the DOM.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook-addon-playwright",
3
- "version": "4.13.3",
3
+ "version": "4.13.4",
4
4
  "description": "An addon to visually test the stories in the multiple browsers within storybook environment",
5
5
  "author": "m.doaie <mdoaie@yahoo.co.uk>",
6
6
  "engines": {