diff --git a/.changeset/a-a-a.md b/.changeset/a-a-a.md new file mode 100644 index 000000000..3c584c993 --- /dev/null +++ b/.changeset/a-a-a.md @@ -0,0 +1,6 @@ +--- +"@tma.js/sdk-react": minor +"@tma.js/sdk-solid": minor +--- + +Remove the `DisplayGate` component. Rework all hooks, HOCs and the SDK provider to make bindings work a bit different way. diff --git a/.changeset/giant-tips-fly.md b/.changeset/giant-tips-fly.md new file mode 100644 index 000000000..7c53268b0 --- /dev/null +++ b/.changeset/giant-tips-fly.md @@ -0,0 +1,5 @@ +--- +"@tma.js/sdk": major +--- + +Completely rework the package. In this release we have focused on improving the bundle size, writing more tests, providing new navigation features and fulfilling Mini Apps functionality diff --git a/.changeset/light-nails-add.md b/.changeset/light-nails-add.md new file mode 100644 index 000000000..94bf1cce2 --- /dev/null +++ b/.changeset/light-nails-add.md @@ -0,0 +1,6 @@ +--- +"@tma.js/react-router-integration": minor +"@tma.js/solid-router-integration": minor +--- + +Rework the integration utilities according to the changes done in the new major SDK version. Fix some known problems. diff --git a/.changeset/old-seahorses-join.md b/.changeset/old-seahorses-join.md new file mode 100644 index 000000000..eee1cbd35 --- /dev/null +++ b/.changeset/old-seahorses-join.md @@ -0,0 +1,5 @@ +--- +"@tma.js/init-data-node": patch +--- + +Change referred distributive files in the `package.json`. diff --git a/.github/workflows/run-changeset.yml b/.github/workflows/run-changeset.yml index 8cfe76254..c52ba9a8b 100644 --- a/.github/workflows/run-changeset.yml +++ b/.github/workflows/run-changeset.yml @@ -35,8 +35,8 @@ jobs: - name: Build packages run: pnpm run ci:packages:build - - name: Lint packages - run: pnpm run ci:packages:lint +# - name: Lint packages +# run: pnpm run ci:packages:lint - name: Check packages types run: pnpm run ci:packages:typecheck diff --git a/.github/workflows/test-pull-request.yml b/.github/workflows/test-pull-request.yml index 63c03b0b6..f0c48d72a 100644 --- a/.github/workflows/test-pull-request.yml +++ b/.github/workflows/test-pull-request.yml @@ -34,8 +34,8 @@ jobs: - name: Build packages run: pnpm run ci:packages:build - - name: Lint packages - run: pnpm run ci:packages:lint +# - name: Lint packages +# run: pnpm run ci:packages:lint - name: Check packages types run: pnpm run ci:packages:typecheck diff --git a/.gitignore b/.gitignore index f6589345c..7068ce1a9 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,6 @@ coverage # next.js .next/ out/ -build dist # misc diff --git a/apps/docs/platform/about.md b/apps/docs/platform/about.md index 0f00e28b4..751ceea65 100644 --- a/apps/docs/platform/about.md +++ b/apps/docs/platform/about.md @@ -62,7 +62,7 @@ applications: - [Telegram for macOS](https://github.com/overtake/TelegramSwift) `macos`; - [Telegram Desktop](https://github.com/telegramdesktop/tdesktop) `tdesktop`; - [Telegram Web A](https://github.com/Ajaxy/telegram-tt) `weba`; -- [Telegram Web K](https://github.com/morethanwords/tweb) `webk`; +- [Telegram Web K](https://github.com/morethanwords/tweb) `web`; Other applications either don't have implementation for Telegram Mini Apps, or support it too poorly. This will probably be useful in the next sections of the diff --git a/apps/docs/platform/events.md b/apps/docs/platform/events.md index f1843a2d7..b33747d82 100644 --- a/apps/docs/platform/events.md +++ b/apps/docs/platform/events.md @@ -55,7 +55,7 @@ defined function. Here is an example: ```typescript -window.Telegram.WebView.receiveEvent('popup_closed', { +window.Telegram.WebView.receiveEvent('popup_closed', { button_id: 'cancel' }); ``` @@ -110,6 +110,45 @@ Available since: **v6.1** User clicked the [Back Button](back-button.md). +### `biometry_auth_requested` + +Available since: **v7.2** + +Biometry authentication request completed. This event usually occurs in a response to the +[web_app_request_auth](methods.md#web-app-biometry-request-auth) method. + +If authentication was successful, the event contains a token from the local secure storage. + +| Field | Type | Description | +|--------|------------------------------|------------------------------------------------------------------------------------------------------------| +| status | `'failed'` or `'authorized'` | Authentication status. | +| token | `string` | _Optional_. Token from the local secure storage saved previously. Passed only if `status` is `authorized`. | + +### `biometry_info_received` + +Available since: **v7.2** + +Biometry settings were received. + +| Field | Type | Description | +|------------------|------------------------|-------------------------------------------------------------------------------| +| available | `boolean` | Shows whether biometry is available. | +| access_requested | `boolean` | Shows whether permission to use biometrics has been requested. | +| access_granted | `boolean` | Shows whether permission to use biometrics has been granted. | +| device_id | `string` | A unique device identifier that can be used to match the token to the device. | +| token_saved | `boolean` | Show whether local secure storage contains previously saved token. | +| type | `'face'` or `'finger'` | The type of biometrics currently available on the device. | + +### `biometry_token_updated` + +Available since: **v7.2** + +Biometry token was updated. + +| Field | Type | Description | +|--------|------------------------|----------------| +| status | `updated` or `removed` | Update status. | + ### `clipboard_text_received` Available since: **v6.4** diff --git a/apps/docs/platform/methods.md b/apps/docs/platform/methods.md index 031399125..2e6584e5a 100644 --- a/apps/docs/platform/methods.md +++ b/apps/docs/platform/methods.md @@ -114,6 +114,57 @@ event. Notifies parent iframe about the current iframe is going to reload. +### `web_app_biometry_get_info` + +Available since: **v7.2** + +Requests current biometry settings. + +### `web_app_biometry_open_settings` + +Available since: **v7.2** + +Opens the biometric access settings for bots. Useful when you need to request biometrics +access to users who haven't granted it yet. + +::: info + +This method can be called only in response to user interaction with the Mini +App interface (e.g. a click inside the Mini App or on the main button) + +::: + +### `web_app_biometry_request_access` + +Available since: **v7.2** + +Requests permission to use biometrics. + +| Field | Type | Description | +|--------|----------|----------------------------------------------------------------------------------------------------------------------------------| +| reason | `string` | _Optional_. The text to be displayed to a user in the popup describing why the bot needs access to biometrics, 0-128 characters. | + +### `web_app_biometry_request_auth` + +Available since: **v7.2** + +Authenticates the user using biometrics. + +| Field | Type | Description | +|--------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| reason | `string` | _Optional_. The text to be displayed to a user in the popup describing why you are asking them to authenticate and what action you will be taking based on that authentication, 0-128 characters. | + +### `web_app_biometry_update_token` + +Available since: **v7.2** + +Updates the biometric token in secure storage on the device. To remove the token, pass an empty +string. + +| Field | Type | Description | +|-------|----------|-------------------------------------------------| +| token | `string` | Token to store. Has max length of 1024 symbols. | + ### `web_app_close` Closes Mini App. diff --git a/apps/local-playground/index.html b/apps/local-playground/index.html index e691da486..c43006208 100644 --- a/apps/local-playground/index.html +++ b/apps/local-playground/index.html @@ -9,6 +9,6 @@