@truelab/truelogic 4.3.0-11 → 4.3.0-13
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/dist/truelogic.min.js +1 -1
- package/dist/types/src/entities/bonus/ui/BonusConfirmButtonBase/BonusConfirmButtonBase.d.ts +9 -1
- package/dist/types/src/entities/bonus/ui/BonusConfirmButtonBase/BonusConfirmButtonBase.stories.d.ts +7 -1
- package/dist/types/src/shared/lib/hooks/useHold.d.ts +8 -3
- package/package.json +6 -2
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
import { PointerEventHandler } from 'react';
|
|
1
2
|
type TProps = {
|
|
2
3
|
onClick: (event: React.MouseEvent) => void;
|
|
3
4
|
cashPrice: number;
|
|
4
5
|
disabled: boolean;
|
|
5
6
|
/** Bonus mode is selected: the spin becomes the confirm control and shows the price chip */
|
|
6
7
|
isActive?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* The control is held — a pointer on it or Space down; the panel owns the hold (useHold), as it
|
|
10
|
+
* does for the spin this control stands in for. Not `:active`: Blink sets that for a touch too
|
|
11
|
+
* late for a quick tap to show it, and a hotkey never sets it at all (GTT-2754)
|
|
12
|
+
*/
|
|
13
|
+
isPressed?: boolean;
|
|
14
|
+
onPointerDown?: PointerEventHandler<HTMLButtonElement>;
|
|
7
15
|
};
|
|
8
|
-
export declare const BonusConfirmButtonBase: ({ onClick, cashPrice, disabled, isActive }: TProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const BonusConfirmButtonBase: ({ onClick, onPointerDown, cashPrice, disabled, isActive, isPressed, }: TProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
17
|
export {};
|
package/dist/types/src/entities/bonus/ui/BonusConfirmButtonBase/BonusConfirmButtonBase.stories.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
declare const meta: {
|
|
2
2
|
title: string;
|
|
3
|
-
component: ({ onClick, cashPrice, disabled, isActive }: {
|
|
3
|
+
component: ({ onClick, onPointerDown, cashPrice, disabled, isActive, isPressed, }: {
|
|
4
4
|
onClick: (event: React.MouseEvent) => void;
|
|
5
5
|
cashPrice: number;
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
isActive?: boolean;
|
|
8
|
+
isPressed?: boolean;
|
|
9
|
+
onPointerDown?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
8
10
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
11
|
decorators: import("@storybook/react-webpack5").Decorator[];
|
|
10
12
|
parameters: {};
|
|
@@ -20,8 +22,12 @@ export declare const Variants: import("storybook/internal/csf").StoryAnnotations
|
|
|
20
22
|
cashPrice: number;
|
|
21
23
|
disabled: boolean;
|
|
22
24
|
isActive?: boolean;
|
|
25
|
+
isPressed?: boolean;
|
|
26
|
+
onPointerDown?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
23
27
|
}, {
|
|
24
28
|
isActive?: boolean;
|
|
29
|
+
isPressed?: boolean;
|
|
30
|
+
onPointerDown?: import("react").PointerEventHandler<HTMLButtonElement>;
|
|
25
31
|
onClick?: (event: React.MouseEvent) => void;
|
|
26
32
|
cashPrice?: number;
|
|
27
33
|
disabled?: boolean;
|
|
@@ -3,11 +3,16 @@ export type THoldSource = 'pointer' | 'key';
|
|
|
3
3
|
type THoldOptions = {
|
|
4
4
|
/** The control is held while one of these keys is down (`KeyboardEvent.code`) */
|
|
5
5
|
keys?: readonly string[];
|
|
6
|
-
/** How long the control must stay held for `onHold` to fire */
|
|
7
|
-
holdDelay
|
|
6
|
+
/** How long the control must stay held for `onHold` to fire; a control with no hold action omits it */
|
|
7
|
+
holdDelay?: number;
|
|
8
8
|
onPress?: (source: THoldSource) => void;
|
|
9
9
|
onHold?: (source: THoldSource) => void;
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* `isCancelled` — the hold ended without the player letting go: a pointercancel, a window blur,
|
|
12
|
+
* another press taking over, the hook getting disabled or unmounted. An action that lands on the
|
|
13
|
+
* release (like a click does) must skip those
|
|
14
|
+
*/
|
|
15
|
+
onRelease?: (source: THoldSource, isCancelled: boolean) => void;
|
|
11
16
|
/** Turning it off releases a hold in progress: a lock (a modal) must not leave the action stuck on */
|
|
12
17
|
isEnabled?: boolean;
|
|
13
18
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@truelab/truelogic",
|
|
3
|
-
"version": "4.3.0-
|
|
3
|
+
"version": "4.3.0-13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/truelogic.min.js",
|
|
6
6
|
"types": "./dist/types/src/index.d.ts",
|
|
@@ -58,7 +58,11 @@
|
|
|
58
58
|
"test:e2e:ui": "playwright test --project=sandbox --ui",
|
|
59
59
|
"test:e2e:ui:game": "playwright test --project=game --ui",
|
|
60
60
|
"test:e2e:report": "playwright show-report",
|
|
61
|
-
"test:e2e:typecheck": "tsc -p tests/e2e/tsconfig.json"
|
|
61
|
+
"test:e2e:typecheck": "tsc -p tests/e2e/tsconfig.json",
|
|
62
|
+
"email:install": "npm install --prefix ./email-letters",
|
|
63
|
+
"email:dev": "npm run dev --prefix ./email-letters",
|
|
64
|
+
"email:export": "npm run export --prefix ./email-letters",
|
|
65
|
+
"email:send-test": "npm run send-test --prefix ./email-letters --"
|
|
62
66
|
},
|
|
63
67
|
"browserslist": [
|
|
64
68
|
"defaults and supports es6-module"
|