chromium-bidi
Advanced tools
Comparing version 0.5.21 to 0.5.22
@@ -143,3 +143,3 @@ "use strict"; | ||
} | ||
#dispatchPointerDownAction(source, keyState, action) { | ||
async #dispatchPointerDownAction(source, keyState, action) { | ||
const { button } = action; | ||
@@ -155,2 +155,3 @@ if (source.pressed.has(button)) { | ||
const { modifiers } = keyState; | ||
const { radiusX, radiusY } = getRadii(width ?? 1, height ?? 1); | ||
switch (pointerType) { | ||
@@ -160,3 +161,3 @@ case "mouse" /* Input.PointerType.Mouse */: | ||
// TODO: Implement width and height when available. | ||
return this.#context.cdpTarget.cdpClient.sendCommand('Input.dispatchMouseEvent', { | ||
await this.#context.cdpTarget.cdpClient.sendCommand('Input.dispatchMouseEvent', { | ||
type: 'mousePressed', | ||
@@ -176,4 +177,5 @@ x, | ||
}); | ||
break; | ||
case "touch" /* Input.PointerType.Touch */: | ||
return this.#context.cdpTarget.cdpClient.sendCommand('Input.dispatchTouchEvent', { | ||
await this.#context.cdpTarget.cdpClient.sendCommand('Input.dispatchTouchEvent', { | ||
type: 'touchStart', | ||
@@ -184,3 +186,4 @@ touchPoints: [ | ||
y, | ||
...getRadii(width ?? 1, height ?? 1), | ||
radiusX, | ||
radiusY, | ||
tangentialPressure, | ||
@@ -196,3 +199,7 @@ tiltX, | ||
}); | ||
break; | ||
} | ||
source.radiusX = radiusX; | ||
source.radiusY = radiusY; | ||
source.force = pressure; | ||
// --- Platform-specific code ends here --- | ||
@@ -206,3 +213,3 @@ } | ||
source.pressed.delete(button); | ||
const { x, y, subtype: pointerType } = source; | ||
const { x, y, force, radiusX, radiusY, subtype: pointerType } = source; | ||
// --- Platform-specific code begins here --- | ||
@@ -232,2 +239,5 @@ const { modifiers } = keyState; | ||
id: source.pointerId, | ||
force, | ||
radiusX, | ||
radiusY, | ||
}, | ||
@@ -244,2 +254,3 @@ ], | ||
const { tiltX, tiltY } = getTilt(action); | ||
const { radiusX, radiusY } = getRadii(width ?? 1, height ?? 1); | ||
const { targetX, targetY } = await this.#getCoordinateFromOrigin(origin, offsetX, offsetY, startX, startY); | ||
@@ -313,3 +324,4 @@ if (targetX < 0 || targetY < 0) { | ||
y, | ||
...getRadii(width ?? 1, height ?? 1), | ||
radiusX, | ||
radiusY, | ||
tangentialPressure, | ||
@@ -331,2 +343,5 @@ tiltX, | ||
source.y = y; | ||
source.radiusX = radiusX; | ||
source.radiusY = radiusY; | ||
source.force = pressure; | ||
} | ||
@@ -333,0 +348,0 @@ } while (!last); |
@@ -49,2 +49,5 @@ /** | ||
y: number; | ||
radiusX?: number; | ||
radiusY?: number; | ||
force?: number; | ||
constructor(id: number, subtype: Input.PointerType); | ||
@@ -51,0 +54,0 @@ get buttons(): number; |
@@ -74,2 +74,5 @@ "use strict"; | ||
y = 0; | ||
radiusX; | ||
radiusY; | ||
force; | ||
constructor(id, subtype) { | ||
@@ -76,0 +79,0 @@ this.pointerId = id; |
{ | ||
"name": "chromium-bidi", | ||
"version": "0.5.21", | ||
"version": "0.5.22", | ||
"description": "An implementation of the WebDriver BiDi protocol for Chromium implemented as a JavaScript layer translating between BiDi and CDP, running inside a Chrome tab.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7699958
90046