diff --git a/.changeset/young-cobras-wash.md b/.changeset/young-cobras-wash.md new file mode 100644 index 000000000..df9baf66e --- /dev/null +++ b/.changeset/young-cobras-wash.md @@ -0,0 +1,15 @@ +--- +"@tma.js/solid-router-integration": patch +"@tma.js/init-data-node": patch +"@tma.js/launch-params": patch +"@tma.js/navigation": patch +"@tma.js/init-data": patch +"@tma.js/sdk-react": patch +"@tma.js/sdk-solid": patch +"@tma.js/parsing": patch +"@tma.js/bridge": patch +"@tma.js/utils": patch +"@tma.js/sdk": patch +--- + +Actualize links and comments diff --git a/.gitignore b/.gitignore index 145a317c9..fe4bd821d 100644 --- a/.gitignore +++ b/.gitignore @@ -40,4 +40,7 @@ yarn-error.log* .docusaurus # App for local development -apps/.local \ No newline at end of file +apps/.local + +apps/docs/.vitepress/cache +apps/docs/.vitepress/dist \ No newline at end of file diff --git a/apps/docs/.gitignore b/apps/docs-old/.gitignore similarity index 100% rename from apps/docs/.gitignore rename to apps/docs-old/.gitignore diff --git a/apps/docs/README.md b/apps/docs-old/README.md similarity index 100% rename from apps/docs/README.md rename to apps/docs-old/README.md diff --git a/apps/docs/babel.config.js b/apps/docs-old/babel.config.js similarity index 100% rename from apps/docs/babel.config.js rename to apps/docs-old/babel.config.js diff --git a/apps/docs/blog/2019-05-28-first-blog-post.md b/apps/docs-old/blog/2019-05-28-first-blog-post.md similarity index 100% rename from apps/docs/blog/2019-05-28-first-blog-post.md rename to apps/docs-old/blog/2019-05-28-first-blog-post.md diff --git a/apps/docs/blog/2019-05-29-long-blog-post.md b/apps/docs-old/blog/2019-05-29-long-blog-post.md similarity index 100% rename from apps/docs/blog/2019-05-29-long-blog-post.md rename to apps/docs-old/blog/2019-05-29-long-blog-post.md diff --git a/apps/docs/blog/2021-08-01-mdx-blog-post.mdx b/apps/docs-old/blog/2021-08-01-mdx-blog-post.mdx similarity index 100% rename from apps/docs/blog/2021-08-01-mdx-blog-post.mdx rename to apps/docs-old/blog/2021-08-01-mdx-blog-post.mdx diff --git a/apps/docs/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg b/apps/docs-old/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg similarity index 100% rename from apps/docs/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg rename to apps/docs-old/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg diff --git a/apps/docs/blog/2021-08-26-welcome/index.md b/apps/docs-old/blog/2021-08-26-welcome/index.md similarity index 100% rename from apps/docs/blog/2021-08-26-welcome/index.md rename to apps/docs-old/blog/2021-08-26-welcome/index.md diff --git a/apps/docs/blog/authors.yml b/apps/docs-old/blog/authors.yml similarity index 100% rename from apps/docs/blog/authors.yml rename to apps/docs-old/blog/authors.yml diff --git a/apps/docs/docusaurus.config.js b/apps/docs-old/docusaurus.config.js similarity index 100% rename from apps/docs/docusaurus.config.js rename to apps/docs-old/docusaurus.config.js diff --git a/apps/docs/i18n/ru/code.json b/apps/docs-old/i18n/ru/code.json similarity index 100% rename from apps/docs/i18n/ru/code.json rename to apps/docs-old/i18n/ru/code.json diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current.json b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current.json similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current.json rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current.json diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/apps-communication/events.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/apps-communication/events.mdx similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/apps-communication/events.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/apps-communication/events.mdx diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/apps-communication/how-it-works.md b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/apps-communication/how-it-works.md similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/apps-communication/how-it-works.md rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/apps-communication/how-it-works.md diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/apps-communication/methods.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/apps-communication/methods.mdx similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/apps-communication/methods.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/apps-communication/methods.mdx diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/functionality/closing-behavior.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/functionality/closing-behavior.mdx similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/functionality/closing-behavior.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/functionality/closing-behavior.mdx diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/functionality/haptic-feedback.md b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/functionality/haptic-feedback.md similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/functionality/haptic-feedback.md rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/functionality/haptic-feedback.md diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/guides/creating-new-app.md b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/guides/creating-new-app.md similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/guides/creating-new-app.md rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/guides/creating-new-app.md diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/introduction/about-platform.md b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/introduction/about-platform.md similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/introduction/about-platform.md rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/introduction/about-platform.md diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/introduction/required-technologies.md b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/introduction/required-technologies.md similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/introduction/required-technologies.md rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/introduction/required-technologies.md diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/introduction/usage.md b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/introduction/usage.md similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/introduction/usage.md rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/introduction/usage.md diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/launch-params/about.md b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/launch-params/about.md similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/launch-params/about.md rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/launch-params/about.md diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/launch-params/init-data.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/launch-params/init-data.mdx similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/launch-params/init-data.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/launch-params/init-data.mdx diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/init-data-golang.md b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/init-data-golang.md similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/init-data-golang.md rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/init-data-golang.md diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-bridge.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-bridge.mdx similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-bridge.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-bridge.mdx diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-init-data-node.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-init-data-node.mdx similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-init-data-node.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-init-data-node.mdx diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-init-data.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-init-data.mdx similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-init-data.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-init-data.mdx diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk-react.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk-react.mdx similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk-react.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk-react.mdx diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk-solid.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk-solid.mdx similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk-solid.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk-solid.mdx diff --git a/apps/docs/docs/libraries/tma-js-sdk/_category_.json b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/_category_.json similarity index 100% rename from apps/docs/docs/libraries/tma-js-sdk/_category_.json rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/_category_.json diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/about.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/about.mdx similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/about.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/about.mdx diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/back-button.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/back-button.mdx similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/back-button.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/back-button.mdx diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/closing-behaviour.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/closing-behaviour.mdx similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/closing-behaviour.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/closing-behaviour.mdx diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/haptic-feedback.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/haptic-feedback.mdx similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/haptic-feedback.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/haptic-feedback.mdx diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/init-data.md b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/init-data.md similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/init-data.md rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/init-data.md diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/main-button.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/main-button.mdx similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/main-button.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/main-button.mdx diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/popup.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/popup.mdx similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/popup.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/popup.mdx diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/qr-scanner.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/qr-scanner.mdx similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/qr-scanner.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/qr-scanner.mdx diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/theme-params.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/theme-params.mdx similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/theme-params.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/theme-params.mdx diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/viewport.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/viewport.mdx similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/viewport.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/viewport.mdx diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/web-app.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/web-app.mdx similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/web-app.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/libraries/tma-js-sdk/components/web-app.mdx diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/supported-applications.md b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/supported-applications.md similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/supported-applications.md rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/supported-applications.md diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/test-environment.md b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/test-environment.md similarity index 100% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/test-environment.md rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/test-environment.md diff --git a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/ui/back-button.mdx b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/ui/back-button.mdx similarity index 92% rename from apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/ui/back-button.mdx rename to apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/ui/back-button.mdx index b8345447b..4e65a6050 100644 --- a/apps/docs/i18n/ru/docusaurus-plugin-content-docs/current/ui/back-button.mdx +++ b/apps/docs-old/i18n/ru/docusaurus-plugin-content-docs/current/ui/back-button.mdx @@ -10,7 +10,7 @@ Telegram не ограничивает разработчика в способ и позволяет ему обрабатывать событие клика на компонент как потребуется в приложении. -import imgURL from '../../../../../static/img/ui/back-button.png'; +import imgURL from '../../../../../../docs/public/components/back-button.png'; 0.5%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "engines": { + "node": ">=16.14" + } +} diff --git a/apps/docs/sidebars.js b/apps/docs-old/sidebars.js similarity index 100% rename from apps/docs/sidebars.js rename to apps/docs-old/sidebars.js diff --git a/apps/docs/src/components/docs/ComponentMethodsSupport.tsx b/apps/docs-old/src/components/docs/ComponentMethodsSupport.tsx similarity index 100% rename from apps/docs/src/components/docs/ComponentMethodsSupport.tsx rename to apps/docs-old/src/components/docs/ComponentMethodsSupport.tsx diff --git a/apps/docs/src/components/docs/ComponentSupportedEvents.tsx b/apps/docs-old/src/components/docs/ComponentSupportedEvents.tsx similarity index 100% rename from apps/docs/src/components/docs/ComponentSupportedEvents.tsx rename to apps/docs-old/src/components/docs/ComponentSupportedEvents.tsx diff --git a/apps/docs/src/components/docs/LibraryBadges.tsx b/apps/docs-old/src/components/docs/LibraryBadges.tsx similarity index 100% rename from apps/docs/src/components/docs/LibraryBadges.tsx rename to apps/docs-old/src/components/docs/LibraryBadges.tsx diff --git a/apps/docs/src/components/docs/NpmInstall.tsx b/apps/docs-old/src/components/docs/NpmInstall.tsx similarity index 100% rename from apps/docs/src/components/docs/NpmInstall.tsx rename to apps/docs-old/src/components/docs/NpmInstall.tsx diff --git a/apps/docs/src/components/docs/NpmLink.tsx b/apps/docs-old/src/components/docs/NpmLink.tsx similarity index 100% rename from apps/docs/src/components/docs/NpmLink.tsx rename to apps/docs-old/src/components/docs/NpmLink.tsx diff --git a/apps/docs/src/pages/index.tsx b/apps/docs-old/src/pages/index.tsx similarity index 100% rename from apps/docs/src/pages/index.tsx rename to apps/docs-old/src/pages/index.tsx diff --git a/apps/docs/src/theme/MDXComponents.js b/apps/docs-old/src/theme/MDXComponents.js similarity index 100% rename from apps/docs/src/theme/MDXComponents.js rename to apps/docs-old/src/theme/MDXComponents.js diff --git a/apps/docs/static/.nojekyll b/apps/docs-old/static/.nojekyll similarity index 100% rename from apps/docs/static/.nojekyll rename to apps/docs-old/static/.nojekyll diff --git a/apps/docs/static/CNAME b/apps/docs-old/static/CNAME similarity index 100% rename from apps/docs/static/CNAME rename to apps/docs-old/static/CNAME diff --git a/apps/docs/static/img/favicon.ico b/apps/docs-old/static/img/favicon.ico similarity index 100% rename from apps/docs/static/img/favicon.ico rename to apps/docs-old/static/img/favicon.ico diff --git a/apps/docs/static/img/ui/closing-behavior.png b/apps/docs-old/static/img/ui/closing-behavior.png similarity index 100% rename from apps/docs/static/img/ui/closing-behavior.png rename to apps/docs-old/static/img/ui/closing-behavior.png diff --git a/apps/docs/static/img/ui/main-button.png b/apps/docs-old/static/img/ui/main-button.png similarity index 100% rename from apps/docs/static/img/ui/main-button.png rename to apps/docs-old/static/img/ui/main-button.png diff --git a/apps/docs/static/img/ui/more.png b/apps/docs-old/static/img/ui/more.png similarity index 100% rename from apps/docs/static/img/ui/more.png rename to apps/docs-old/static/img/ui/more.png diff --git a/apps/docs/static/img/ui/popup.png b/apps/docs-old/static/img/ui/popup.png similarity index 100% rename from apps/docs/static/img/ui/popup.png rename to apps/docs-old/static/img/ui/popup.png diff --git a/apps/docs/tsconfig.json b/apps/docs-old/tsconfig.json similarity index 100% rename from apps/docs/tsconfig.json rename to apps/docs-old/tsconfig.json diff --git a/apps/docs/.vitepress/config.mts b/apps/docs/.vitepress/config.mts new file mode 100644 index 000000000..10e20c99e --- /dev/null +++ b/apps/docs/.vitepress/config.mts @@ -0,0 +1,247 @@ +import { defineConfig } from 'vitepress'; + +// https://vitepress.dev/reference/site-config +export default defineConfig({ + title: 'Telegram Mini Apps', + description: 'Documentation covering all aspects of Telegram platform - Telegram Mini Apps.', + + // Internationalization. + // https://vitepress.dev/guide/i18n + locales: { + root: { + label: 'English', + lang: 'en', + }, + // ru: { + // label: 'Русский', + // lang: 'ru', + // description: 'Документация, покрывающая все аспекты платформы Telegram - Telegram Mini Apps.', + // themeConfig: { + // editLink: { + // text: 'Редактировать эту страницу на GitHub', + // pattern: 'https://github.com/telegram-mini-apps/tma.js/edit/master/apps/docs/src/:path', + // }, + // }, + // }, + }, + + // Show when each page content was last updated. + // https://vitepress.dev/reference/default-theme-last-updated#last-updated + lastUpdated: true, + + // We don't want .html to be in the end of each route. + // https://vitepress.dev/guide/routing#generating-clean-url + cleanUrls: true, + + // Enable sitemap generation. + // https://vitepress.dev/guide/sitemap-generation#sitemap-generation + sitemap: { + hostname: 'https://docs.telegram-mini-apps.com', + }, + + // Configure . + // https://vitepress.dev/reference/site-config#head + head: [ + // Add favicon. + // https://vitepress.dev/reference/site-config#example-adding-a-favicon + ['link', { rel: 'icon', href: '/favicon.ico' }], + ], + + themeConfig: { + logo: '/logo.png', + + // https://vitepress.dev/reference/default-theme-footer#footer + footer: { + message: 'Released under the MIT License.', + copyright: 'Copyright © 2022-present Vladislav Kibenko and Contributors', + }, + + editLink: { + text: 'Edit this page on GitHub', + pattern: 'https://github.com/telegram-mini-apps/tma.js/edit/master/apps/docs/src/:path', + }, + + // https://vitepress.dev/reference/default-theme-config + nav: [ + { text: 'Home', link: '/' }, + { text: 'Documentation', link: '/about-platform' }, + ], + + // https://vitepress.dev/reference/default-theme-sidebar + sidebar: [ + { + text: 'Common information', + items: [ + { text: 'About platform', link: '/about-platform' }, + { text: 'Test environment', link: '/test-environment' }, + ], + }, + + { + text: 'Apps communication', + items: [ + { text: 'Flow definition', link: '/apps-communication/flow-definition' }, + { text: 'Methods', link: '/apps-communication/methods' }, + { text: 'Events', link: '/apps-communication/events' }, + ], + }, + + { + text: 'Launch parameters', + items: [ + { text: 'Common information', link: '/launch-parameters/common-information' }, + { text: 'Init data', link: '/launch-parameters/init-data' }, + ], + }, + + { + text: 'Functionality', + items: [ + { text: 'Closing behavior', link: '/functionality/closing-behavior' }, + { text: 'Haptic feedback', link: '/functionality/haptic-feedback' }, + { text: 'Theming', link: '/functionality/theming' }, + { text: 'Viewport', link: '/functionality/viewport' }, + ], + }, + + { + text: 'UI', + items: [ + { text: 'Back Button', link: '/ui/back-button' }, + { text: 'Main Button', link: '/ui/main-button' }, + { text: 'Popup', link: '/ui/popup' }, + { text: 'Settings Button', link: '/ui/settings-button' }, + ], + }, + + { + text: 'Packages', + items: [ + { + text: 'TypeScript', + collapsed: true, + items: [ + { text: '@tma.js/bridge', link: '/packages/typescript/tma-js-bridge' }, + { + text: '@tma.js/init-data', + collapsed: true, + items: [ + { text: 'About', link: '/packages/typescript/tma-js-init-data/about' }, + { text: 'InitData', link: '/packages/typescript/tma-js-init-data/init-data' }, + { text: 'Chat', link: '/packages/typescript/tma-js-init-data/chat' }, + { text: 'User', link: '/packages/typescript/tma-js-init-data/user' }, + ], + }, + { + text: '@tma.js/init-data-node', + link: '/packages/typescript/tma-js-init-data-node', + }, + { + text: '@tma.js/sdk', + collapsed: true, + items: [ + { text: 'About', link: '/packages/typescript/tma-js-sdk/about' }, + { + text: 'Components', + collapsed: true, + items: [ + { + text: 'BackButton', + link: '/packages/typescript/tma-js-sdk/components/back-button', + }, + { + text: 'ClosingBehavior', + link: '/packages/typescript/tma-js-sdk/components/closing-behaviour', + }, + { + text: 'HapticFeedback', + link: '/packages/typescript/tma-js-sdk/components/haptic-feedback', + }, + { + text: 'InitData', + link: '/packages/typescript/tma-js-sdk/components/init-data', + }, + { + text: 'MainButton', + link: '/packages/typescript/tma-js-sdk/components/main-button', + }, + { + text: 'Popup', + link: '/packages/typescript/tma-js-sdk/components/popup', + }, + { + text: 'QRScanner', + link: '/packages/typescript/tma-js-sdk/components/qr-scanner', + }, + { + text: 'ThemeParams', + link: '/packages/typescript/tma-js-sdk/components/theme-params', + }, + { + text: 'Viewport', + link: '/packages/typescript/tma-js-sdk/components/viewport', + }, + // TODO: Rename? + { + text: 'WebApp', + link: '/packages/typescript/tma-js-sdk/components/web-app', + }, + ], + }, + ], + }, + { text: '@tma.js/sdk-react', link: '/packages/typescript/tma-js-sdk-react' }, + { text: '@tma.js/sdk-solid', link: '/packages/typescript/tma-js-sdk-solid' }, + ], + }, + { + text: 'GoLang', + collapsed: true, + items: [ + { text: 'init-data-golang', link: '/packages/golang/init-data-golang' }, + ], + }, + ], + }, + + { + text: 'Guides', + items: [ + { text: 'Creating new app', link: '/guides/creating-new-app' }, + ], + }, + ], + + socialLinks: [ + { icon: 'github', link: 'https://github.com/telegram-mini-apps' }, + ], + + search: { + // TODO: Probably replace with Algolia. + provider: 'local', + // options: { + // locales: { + // ru: { + // translations: { + // button: { + // buttonText: 'Поиск', + // buttonAriaLabel: 'Поиск', + // }, + // modal: { + // noResultsText: 'Не удалось ничего найти по запросу', + // backButtonTitle: 'закрыть', + // displayDetails: 'Отобразить подробные данные', + // resetButtonTitle: 'Сбросить', + // footer: { + // selectText: 'выбрать', + // navigateText: 'для навигации', + // closeText: 'закрыть', + // }, + // }, + // }, + // }, + // }, + // }, + }, + }, +}); diff --git a/apps/docs/about-platform.md b/apps/docs/about-platform.md new file mode 100644 index 000000000..2e0e5791d --- /dev/null +++ b/apps/docs/about-platform.md @@ -0,0 +1,75 @@ +# About platform + +Telegram Mini Apps is a technology created by developers of the famous messenger Telegram. The main +it’s purpose is to provide developers more flexible communication channel with Telegram users. + +It may seem not clear, but Mini Apps are not self-served services. The first thing to note is, +technically, this technology is just an add-on for such already-known Telegram functionality as +Telegram Bots. So, currently, creating a Mini App without creating a Telegram Bot is not available. + +The platform offers a high variety of available methods to communicate with the Telegram application +to make your web applications look more native, allow them to simulate native application's +behavior, and, finally, **mimic** native applications. + +## Required technologies + +Before starting to create an application on the Mini Apps platform, it is important to know what +Mini Apps is from its technical side. This will lead the developer to language and technologies +selection. + +Internally, Mini Apps are usual web applications, which are displayed in WebView. In other words, +they are just a set of static files (mostly `.js`, `.css`, and `.html`). So, to create Mini App, it +is enough to learn standard front-end development technologies, such as: + +- JavaScript +- CSS +- HTML + +Really simple, isn't it? But to make much more serious and bigger applications, we recommend using +more solid technologies, such as `TypeScript`, `React`, `SCSS`, etc. + +So, if we want to create Mini App, we should create a standard web application with any technologies +stack. The only 1 thing Telegram needs from the developer is the application URL to download it +from. It will be used as a source for WebView, which will lead to application download and display. + +## Usage + +As we mentioned in the previous section, Mini Apps are add-ons for Telegram Bots. Telegram Bots is +also known technology that provides functionality for a wide list of use cases. You could create a +bot to buy a ticket in the cinema, make him tell user jokes, generate random numbers, etc. In other +words, the bot can do whatever the developer thinks about. + +The problem is, the visual part of bots is not as good and functional as it could be. Their current +implementation is "console-like" which is more appropriate for developers, not common users. That's +the time for Mini Apps to show up. + +Using Mini Apps, developers are allowed to create more user-friendly and complex interfaces, which +are commonly used by usual users. With this technology, the developer is still able to communicate +with the bot behind Mini App, but, additionally, he can provide some more flexible interfaces to +interact with. + +Mini Apps are usually used when a standard bot interface is not enough. Create a Mini App when you +want to make user life easier when displaying several buttons is not even close to the +functionality, you want to provide. + +## Supported applications + +Currently, Telegram Mini Apps is presented on the wide list of Telegram +applications: + +- [Telegram for Android](https://github.com/DrKLO/Telegram) `android`; +- [Telegram for iOS](https://github.com/TelegramMessenger/Telegram-iOS) `ios`; +- [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) `web`; +- [Telegram Web K](https://github.com/morethanwords/tweb) `webk`; + +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 +documentation. + +::: info +As long as all applications are being developed separately, there may be variations in how they +implement the platform. If you encounter unexpected differences, please consider reporting +an [issue](https://github.com/Telegram-Mini-Apps/issues). +::: diff --git a/apps/docs/apps-communication/events.md b/apps/docs/apps-communication/events.md new file mode 100644 index 000000000..da5507544 --- /dev/null +++ b/apps/docs/apps-communication/events.md @@ -0,0 +1,250 @@ +--- +outline: [2, 3] +--- + +# Events + +Events are signals, sent from Telegram native application in case, when some external action was +done. Like methods, each event has its unique name and parameters. + +## Web + +As mentioned before, the web version uses a standard way of communication between iframes. It means, +the parent iframe is able to send events through `window.postMessage` function. To handle this type +of message, it is enough to add `message` event listener on the global `window` object: + +```typescript +window.addEventListener('message', ...); +``` + +The native application will send an event with `data: string` which represents a JSON object +converted to string. This object has the same interface as we defined in +the [Methods](methods.md#web) section: + +```typescript +interface MessageJSON { + eventType: string; + eventData: any; +} +``` + +Then, lets imagine how we could process an event from Telegram application: + +```typescript +window.addEventListener('message', ({ data }) => { + const { eventType, eventData } = JSON.parse(data); + console.log(eventType, eventData); +}); +``` + +::: warning +In this code, we assumed, that the `message` event is sent only by the native application which is +not always true in real applications. Additionally, we didn't check if `data` is really of +type `string`. Don't forget to check each type and appropriately process incoming events. +::: + +## Desktop, mobile and Windows Phone + +Desktop, mobile, and Windows Phone versions of Telegram don’t use the method, described in the +previous section. They do it in a bit unusual way. The first thing developer should know, is in +case, when Telegram needs to emit an event, it will insert JavaScript code, which calls a globally +defined function. + +Here is an example: + +```typescript +window.Telegram.WebView.receiveEvent('popup_closed', { button_id: 'cancel' }); +``` + +Path to this function depends on platform: + +- `window.TelegramGameProxy.receiveEvent` - Telegram Desktop; +- `window.Telegram.WebView.receiveEvent` - Telegram for iOS and Android; +- `window.TelegramGameProxy_receiveEvent` - Windows Phone + +All of these functions have the same signature: + +```typescript +type ReceiveEvent = (eventType: string, eventData: unknown) => void; +``` + +So, the solution is rather simple. To handle incoming events we should create a function of this +type and assign it to all 3 paths. + +## Available events + +This section contains the list of events, sent from Telegram: their names, description, and +parameters. Section title means minimal version, from which events inside the section could be sent. + +### `back_button_pressed` + +Available since: **v6.1** + +User clicked the [Back Button](../ui/back-button.md). + +### `clipboard_text_received` + +Available since: **v6.4** + +Telegram application attempted to extract text from clipboard. + +| Field | Type | Description | +|--------|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------| +| req_id | `string` | Passed during the [web_app_read_text_from_clipboard](methods.md#web-app-read-text-from-clipboard) method invocation `req_id` value. | +| data | `string` or `null` | _Optional_. Data extracted from the clipboard. The returned value will have the type `string` only in the case, application has access to the clipboard. | + +### `custom_method_invoked` + +Available since: **v6.9** + +Custom method invocation completed. + +| Field | Type | Description | +|--------|-----------|--------------------------------------------------| +| req_id | `string` | Unique identifier of this invocation. | +| result | `unknown` | _Optional_. Method invocation successful result. | +| error | `string` | _Optional_. Method invocation error code. | + +### `invoice_closed` + +An invoice was closed. + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescription
slug + string + + Passed during the  + + web_app_open_invoice +   + method invocation slug value. +
status + string + + Invoice status. Values: +
    +
  • + paid, invoice was paid +
  • +
  • + failed, invoice failed +
  • +
  • + pending, invoice is currently pending +
  • +
  • + cancelled, invoice was cancelled +
  • +
+
+ +### `main_button_pressed` + +User clicked the [Main Button](../ui/main-button.md). + +### `phone_requested` + +Available since: **v6.9** + +Application received phone access request status. + +| Field | Type | Description | +|--------|----------|-------------------------------------| +| status | `string` | Request status. Can only be `sent`. | + +### `popup_closed` + +[Popup](../ui/popup.md) was closed. + +| Field | Type | Description | +|-----------|----------|-----------------------------------------------------------------------------------------------------------------------------------------| +| button_id | `string` | _Optional_. Identifier of the clicked button. In case, the popup was closed without clicking any button, this property will be omitted. | + +### `qr_text_received` + +Available since: **v6.4** + +The QR scanner scanned some QR and extracted its content. + +| Field | Type | Description | +|-------|----------|-----------------------------------------| +| data | `string` | _Optional_. Data extracted from the QR. | + +### `scan_qr_popup_closed` + +Available since: **v6.4** + +QR scanner was closed. + +### `set_custom_style` + +The event which is usually sent by the Telegram web application. Its payload represents `