@scarlett-player/gestures 1.6.0 → 1.8.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Hackney Enterprises Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.cjs CHANGED
@@ -350,13 +350,16 @@ var GestureOverlay = class {
350
350
  }
351
351
  };
352
352
 
353
+ // src/version.ts
354
+ var PKG_VERSION = true ? "1.7.1" : "0.0.0-dev";
355
+
353
356
  // src/index.ts
354
357
  function hasCoarsePointer() {
355
358
  if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
356
359
  return false;
357
360
  }
358
361
  try {
359
- return window.matchMedia("(pointer: coarse)").matches;
362
+ return window.matchMedia("(any-pointer: coarse)").matches;
360
363
  } catch {
361
364
  return false;
362
365
  }
@@ -474,7 +477,7 @@ function createGesturesPlugin(config = {}) {
474
477
  return {
475
478
  id: "gestures",
476
479
  name: "Gestures",
477
- version: "1.0.0",
480
+ version: PKG_VERSION,
478
481
  type: "feature",
479
482
  init(pluginApi) {
480
483
  api = pluginApi;
package/dist/index.d.cts CHANGED
@@ -58,10 +58,11 @@ interface GesturesPluginConfig {
58
58
  /**
59
59
  * Whether gestures are active.
60
60
  *
61
- * `'auto'` enables them when the device reports a coarse pointer, and every
62
- * individual gesture is additionally checked for `pointerType === 'touch'`,
63
- * so a touchscreen laptop works with a finger and is untouched by the mouse.
64
- * Never UA sniffing.
61
+ * `'auto'` enables them wherever the device has a coarse pointer at all
62
+ * (`matchMedia('(any-pointer: coarse)')`, not the primary-pointer
63
+ * `(pointer: coarse)`), and every individual gesture is additionally checked
64
+ * for `pointerType === 'touch'`, so a touchscreen laptop works with a finger
65
+ * and is untouched by the mouse. Never UA sniffing.
65
66
  *
66
67
  * @defaultValue 'auto'
67
68
  */
@@ -235,9 +236,10 @@ declare class GestureOverlay {
235
236
  *
236
237
  * @example
237
238
  * ```ts
239
+ * import { createPlayer } from '@scarlett-player/core';
238
240
  * import { createGesturesPlugin } from '@scarlett-player/gestures';
239
241
  *
240
- * const player = new ScarlettPlayer({
242
+ * const player = await createPlayer({
241
243
  * container: '#player',
242
244
  * plugins: [uiPlugin(), createGesturesPlugin({ seekSeconds: 10 })],
243
245
  * });
package/dist/index.d.ts CHANGED
@@ -58,10 +58,11 @@ interface GesturesPluginConfig {
58
58
  /**
59
59
  * Whether gestures are active.
60
60
  *
61
- * `'auto'` enables them when the device reports a coarse pointer, and every
62
- * individual gesture is additionally checked for `pointerType === 'touch'`,
63
- * so a touchscreen laptop works with a finger and is untouched by the mouse.
64
- * Never UA sniffing.
61
+ * `'auto'` enables them wherever the device has a coarse pointer at all
62
+ * (`matchMedia('(any-pointer: coarse)')`, not the primary-pointer
63
+ * `(pointer: coarse)`), and every individual gesture is additionally checked
64
+ * for `pointerType === 'touch'`, so a touchscreen laptop works with a finger
65
+ * and is untouched by the mouse. Never UA sniffing.
65
66
  *
66
67
  * @defaultValue 'auto'
67
68
  */
@@ -235,9 +236,10 @@ declare class GestureOverlay {
235
236
  *
236
237
  * @example
237
238
  * ```ts
239
+ * import { createPlayer } from '@scarlett-player/core';
238
240
  * import { createGesturesPlugin } from '@scarlett-player/gestures';
239
241
  *
240
- * const player = new ScarlettPlayer({
242
+ * const player = await createPlayer({
241
243
  * container: '#player',
242
244
  * plugins: [uiPlugin(), createGesturesPlugin({ seekSeconds: 10 })],
243
245
  * });
package/dist/index.js CHANGED
@@ -319,13 +319,16 @@ var GestureOverlay = class {
319
319
  }
320
320
  };
321
321
 
322
+ // src/version.ts
323
+ var PKG_VERSION = true ? "1.7.1" : "0.0.0-dev";
324
+
322
325
  // src/index.ts
323
326
  function hasCoarsePointer() {
324
327
  if (typeof window === "undefined" || typeof window.matchMedia !== "function") {
325
328
  return false;
326
329
  }
327
330
  try {
328
- return window.matchMedia("(pointer: coarse)").matches;
331
+ return window.matchMedia("(any-pointer: coarse)").matches;
329
332
  } catch {
330
333
  return false;
331
334
  }
@@ -443,7 +446,7 @@ function createGesturesPlugin(config = {}) {
443
446
  return {
444
447
  id: "gestures",
445
448
  name: "Gestures",
446
- version: "1.0.0",
449
+ version: PKG_VERSION,
447
450
  type: "feature",
448
451
  init(pluginApi) {
449
452
  api = pluginApi;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scarlett-player/gestures",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "Gestures Plugin for Scarlett Player - double-tap seek zones and tap to toggle controls",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -21,23 +21,16 @@
21
21
  "files": [
22
22
  "dist"
23
23
  ],
24
- "scripts": {
25
- "build": "tsup src/index.ts --format esm,cjs --dts",
26
- "dev": "tsup src/index.ts --format esm,cjs --dts --watch",
27
- "test": "vitest --run",
28
- "test:watch": "vitest",
29
- "test:coverage": "vitest --coverage"
30
- },
31
24
  "peerDependencies": {
32
- "@scarlett-player/core": "^1.5.0"
25
+ "@scarlett-player/core": "^1.7.0"
33
26
  },
34
27
  "devDependencies": {
35
- "@scarlett-player/core": "workspace:*",
36
28
  "@vitest/coverage-v8": "^1.6.0",
37
29
  "jsdom": "^24.0.0",
38
30
  "tsup": "^8.5.1",
39
31
  "typescript": "^5.3.0",
40
- "vitest": "^1.6.0"
32
+ "vitest": "^1.6.0",
33
+ "@scarlett-player/core": "1.8.0"
41
34
  },
42
35
  "keywords": [
43
36
  "video",
@@ -59,5 +52,13 @@
59
52
  "bugs": {
60
53
  "url": "https://github.com/Hackney-Enterprises-Inc/scarlett-player/issues"
61
54
  },
62
- "homepage": "https://scarlettplayer.com"
63
- }
55
+ "homepage": "https://scarlettplayer.com",
56
+ "scripts": {
57
+ "build": "tsup",
58
+ "dev": "tsup --watch",
59
+ "test": "vitest --run",
60
+ "test:watch": "vitest",
61
+ "test:coverage": "vitest --coverage",
62
+ "typecheck": "tsc --noEmit -p tsconfig.typecheck.json"
63
+ }
64
+ }