@tma.js/sdk 0.12.5 → 0.12.7
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/dts/components/ThemeParams/ThemeParams.d.ts +1 -1
- package/dist/dts/components/WebApp/WebApp.d.ts +1 -1
- package/dist/dts/launch-params.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.iife.js +1 -1
- package/dist/index.iife.js.map +1 -1
- package/dist/index.mjs +4 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/components/BackButton/BackButton.ts +5 -7
- package/src/components/MainButton/MainButton.ts +5 -6
- package/src/init/init.ts +2 -2
- package/src/launch-params.ts +1 -2
|
@@ -55,13 +55,11 @@ export class BackButton {
|
|
|
55
55
|
* @param event - event name.
|
|
56
56
|
* @param listener - event listener.
|
|
57
57
|
*/
|
|
58
|
-
on: typeof this.ee.on = (event, listener) =>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
this.ee.on(event, listener);
|
|
64
|
-
};
|
|
58
|
+
on: typeof this.ee.on = (event, listener) => (
|
|
59
|
+
event === 'click'
|
|
60
|
+
? on('back_button_pressed', listener as BackButtonEventListener<'click'>)
|
|
61
|
+
: this.ee.on(event, listener)
|
|
62
|
+
);
|
|
65
63
|
|
|
66
64
|
/**
|
|
67
65
|
* Removes event listener.
|
|
@@ -156,12 +156,11 @@ export class MainButton {
|
|
|
156
156
|
* @param event - event name.
|
|
157
157
|
* @param listener - event listener.
|
|
158
158
|
*/
|
|
159
|
-
on: typeof this.ee.on = (event, listener) =>
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
};
|
|
159
|
+
on: typeof this.ee.on = (event, listener) => (
|
|
160
|
+
event === 'click'
|
|
161
|
+
? on('main_button_pressed', listener as MainButtonEventListener<'click'>)
|
|
162
|
+
: this.ee.on(event, listener)
|
|
163
|
+
);
|
|
165
164
|
|
|
166
165
|
/**
|
|
167
166
|
* Removes event listener.
|
package/src/init/init.ts
CHANGED
|
@@ -81,7 +81,7 @@ async function actualInit(options: InitOptions = {}): Promise<InitResult> {
|
|
|
81
81
|
acceptCustomStyles = acceptScrollbarStyle,
|
|
82
82
|
targetOrigin,
|
|
83
83
|
debug = false,
|
|
84
|
-
launchParams: optionsLaunchParams
|
|
84
|
+
launchParams: optionsLaunchParams,
|
|
85
85
|
} = options;
|
|
86
86
|
|
|
87
87
|
// Set global settings.
|
|
@@ -98,7 +98,7 @@ async function actualInit(options: InitOptions = {}): Promise<InitResult> {
|
|
|
98
98
|
const launchParamsFromStorage = retrieveFromStorage();
|
|
99
99
|
const launchParams = optionsLaunchParams instanceof URLSearchParams || typeof optionsLaunchParams === 'string'
|
|
100
100
|
? parseLaunchParams(optionsLaunchParams)
|
|
101
|
-
:
|
|
101
|
+
: retrieveLaunchParams();
|
|
102
102
|
|
|
103
103
|
saveLaunchParamsToStorage(launchParams);
|
|
104
104
|
|
package/src/launch-params.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { parse, retrieveFromStorage } from '@tma.js/launch-params';
|
|
2
|
-
import type { LaunchParams } from '@tma.js/launch-params';
|
|
1
|
+
import { parse, retrieveFromStorage, type LaunchParams } from '@tma.js/launch-params';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Attempts to extract launch params from window.location.hash. In case, window.location.hash
|