@retion-miniapp/react-native 0.18.0 → 0.19.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/dist/index.d.mts +33 -5
- package/dist/index.d.ts +33 -5
- package/dist/index.js +11 -11
- package/dist/index.mjs +11 -11
- package/docs/MINIAPP_README.md +1 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { ImageSourcePropType } from 'react-native';
|
|
2
|
+
import { ImageSourcePropType, TextProps } from 'react-native';
|
|
3
3
|
|
|
4
4
|
type MiniAppChannel = 'production' | 'testing';
|
|
5
5
|
/** Quyền lấy token nhạy cảm — admin bật trên Console, Platform trả trong manifest. */
|
|
@@ -759,15 +759,20 @@ declare const MINIAPP_CHANGELOG_KINDS: {
|
|
|
759
759
|
bg: string;
|
|
760
760
|
}[];
|
|
761
761
|
declare const mergeMiniAppChangelog: (versions: MiniAppChangelogVersion[]) => MiniAppChangelog;
|
|
762
|
+
/** 1 mục changelog: **đậm**, `code`, [chữ](https://link) — Text lồng nhau, link mở trình duyệt. */
|
|
763
|
+
declare const MiniAppChangelogText: ({ text, style }: {
|
|
764
|
+
text: string;
|
|
765
|
+
style?: TextProps["style"];
|
|
766
|
+
}) => React.JSX.Element;
|
|
762
767
|
/** 3 nhóm Mới / Sửa lỗi / Cải thiện (bỏ nhóm trống) — dùng lại được trong UI riêng. */
|
|
763
768
|
declare const MiniAppChangelogGroups: ({ changelog }: {
|
|
764
769
|
changelog: MiniAppChangelog;
|
|
765
770
|
}) => React.JSX.Element;
|
|
766
|
-
/** Toàn bộ lịch sử changelog của 1 mini app (màn "Xem tất cả"), mới nhất trước. */
|
|
767
|
-
declare const MiniAppChangelogHistory: ({ app_id, name,
|
|
771
|
+
/** Toàn bộ lịch sử changelog của 1 mini app (màn "Xem tất cả"), mới nhất trước. Header nổi kiểu Chat SDK. */
|
|
772
|
+
declare const MiniAppChangelogHistory: ({ app_id, name, onBack }: {
|
|
768
773
|
app_id: string;
|
|
769
774
|
name: string;
|
|
770
|
-
|
|
775
|
+
onBack: () => void;
|
|
771
776
|
}) => React.JSX.Element;
|
|
772
777
|
/** UI mặc định "Có gì mới". */
|
|
773
778
|
declare const DefaultMiniAppChangelogPrompt: ({ request, changelog, onClose }: MiniAppChangelogPromptProps) => React.JSX.Element;
|
|
@@ -777,6 +782,29 @@ declare const DefaultMiniAppUpdatePrompt: ({ update, is_updating, progress, has_
|
|
|
777
782
|
}) => React.JSX.Element;
|
|
778
783
|
declare const _default: React.MemoExoticComponent<({ app_ids, shouldShowUpdate, logo, renderUpdate, renderChangelog }: MiniAppUpdatesProps) => React.JSX.Element | null>;
|
|
779
784
|
|
|
785
|
+
/**
|
|
786
|
+
* Markdown inline tối giản cho changelog (1 dòng / mục): **đậm**, `code`, [chữ](https://link).
|
|
787
|
+
* Không hỗ trợ tiêu đề / bảng / list lồng — dữ liệu vẫn lưu nguyên text, chỉ đổi lúc hiển thị.
|
|
788
|
+
* Bản giống hệt trong retion-miniapp-platform (src/lib/inline-markdown.ts) — sửa thì sửa cả hai.
|
|
789
|
+
*/
|
|
790
|
+
type InlineToken = {
|
|
791
|
+
type: 'text';
|
|
792
|
+
text: string;
|
|
793
|
+
} | {
|
|
794
|
+
type: 'bold';
|
|
795
|
+
text: string;
|
|
796
|
+
} | {
|
|
797
|
+
type: 'code';
|
|
798
|
+
text: string;
|
|
799
|
+
} | {
|
|
800
|
+
type: 'link';
|
|
801
|
+
text: string;
|
|
802
|
+
url: string;
|
|
803
|
+
};
|
|
804
|
+
declare const parseInlineMarkdown: (input: string) => InlineToken[];
|
|
805
|
+
/** Bỏ ký hiệu, giữ chữ — cho bản xem trước 1 dòng trong bảng. */
|
|
806
|
+
declare const stripInlineMarkdown: (input: string) => string;
|
|
807
|
+
|
|
780
808
|
/**
|
|
781
809
|
* App → web: gửi event xuống web của mini app — web nhận y như `WebView.postMessage` (sự kiện `message`).
|
|
782
810
|
* `instance_id`: instance_id lúc openMiniApp; không dùng instance_id thì truyền app_id.
|
|
@@ -948,4 +976,4 @@ interface UploadCapabilities {
|
|
|
948
976
|
/** XHR (không phải fetch) để có tiến trình upload; RN đọc file từ uri (cả content://), không nạp vào JS. */
|
|
949
977
|
declare const uploadToUrl: MiniAppUploader;
|
|
950
978
|
|
|
951
|
-
export { CodeType, DefaultMiniAppChangelogPrompt, DefaultMiniAppSplash, DefaultMiniAppUpdatePrompt, type LocationOptions, type LocationResult, MINIAPP_CHANGELOG_KINDS, MINIAPP_PLATFORM_URL, type MiniAppBiometricAvailability, type MiniAppBiometricRequest, type MiniAppBiometricResult, type MiniAppBiometrics, type MiniAppBiometryType, type MiniAppBridgeOptions, type MiniAppCatalogEntry, type MiniAppCatalogItem, type MiniAppChangelog, MiniAppChangelogGroups, MiniAppChangelogHistory, type MiniAppChangelogPromptProps, type MiniAppChangelogRequest, type MiniAppChangelogState, type MiniAppChangelogVersion, type MiniAppChannel, type MiniAppConfig, type MiniAppContainerProps, type MiniAppContext, type MiniAppDownloadState, type MiniAppDownloadStatus, type MiniAppDownloadTask, type MiniAppEvent, type MiniAppFileSystem, type MiniAppHandlerContext, type MiniAppHapticType, _default$1 as MiniAppHost, type MiniAppHostData, BridgeError as MiniAppHostError, type MiniAppHostProps, type MiniAppKeepAlive, type MiniAppLaunch, type MiniAppLocalBundle, type MiniAppManifest, type MiniAppNativeHandlers, type MiniAppPaymentRequest, type MiniAppPaymentResult, type MiniAppPendingChangelog, type MiniAppPermission, type MiniAppPickedFile, type MiniAppSpeechProvider, type MiniAppSpeechStartContext, type MiniAppSplashProps, type MiniAppStorage, type MiniAppSyncResult, type MiniAppUpdate, type MiniAppUpdatePromptProps, _default as MiniAppUpdates, type MiniAppUpdatesProps, type MiniAppUploadCaller, type MiniAppUploadOptions, type MiniAppUploadProcessOptions, type MiniAppUploadProcessor, type MiniAppUploadRequest, type MiniAppUploadSource, type MiniAppUploadSourceRequest, type MiniAppUploadTarget, type MiniAppUploader, type MiniAppUrlUploadTarget, type OpenMiniAppArgs, type ReactNativeBiometricsLike, ScannerEndReason, ScannerEvent, ScannerLayout, ScannerMethod, type ScannerOptions, type ScannerResult, type SpeechOptions, ToastType, type UploadCapabilities, type UploadFileType, type UploadFilesResult, type UploadedFile, closeMiniApp, configureMiniApp, createMmkvStorage, createReactNativeBiometrics, createRnfsFileSystem, dismissMiniAppChangelog, ensureMiniApp, fetchMiniAppChangelog, getLocalMiniApp, getMiniAppCatalog, getMiniAppCatalogEntry, getMiniAppChangelogSeen, getMiniAppStatuses, getMiniAppUpdate, getPendingChangelog, installBundledMiniApp, markMiniAppChangelogSeen, mergeMiniAppChangelog, onMiniAppEvent, openMiniApp, pauseMiniApp, pauseMiniAppDownloads, preloadMiniApp, releaseSpeechFor, restoreMiniApp, resumeMiniApp, resumeMiniAppDownloads, sendEventToWeb, showMiniAppChangelog, syncMiniAppCatalog, uninstallMiniApp, updateMiniApp, uploadToUrl, useMiniAppChangelog, useMiniAppChangelogRequest, useMiniAppDownload, useMiniAppDownloadsPaused };
|
|
979
|
+
export { CodeType, DefaultMiniAppChangelogPrompt, DefaultMiniAppSplash, DefaultMiniAppUpdatePrompt, type InlineToken, type LocationOptions, type LocationResult, MINIAPP_CHANGELOG_KINDS, MINIAPP_PLATFORM_URL, type MiniAppBiometricAvailability, type MiniAppBiometricRequest, type MiniAppBiometricResult, type MiniAppBiometrics, type MiniAppBiometryType, type MiniAppBridgeOptions, type MiniAppCatalogEntry, type MiniAppCatalogItem, type MiniAppChangelog, MiniAppChangelogGroups, MiniAppChangelogHistory, type MiniAppChangelogPromptProps, type MiniAppChangelogRequest, type MiniAppChangelogState, MiniAppChangelogText, type MiniAppChangelogVersion, type MiniAppChannel, type MiniAppConfig, type MiniAppContainerProps, type MiniAppContext, type MiniAppDownloadState, type MiniAppDownloadStatus, type MiniAppDownloadTask, type MiniAppEvent, type MiniAppFileSystem, type MiniAppHandlerContext, type MiniAppHapticType, _default$1 as MiniAppHost, type MiniAppHostData, BridgeError as MiniAppHostError, type MiniAppHostProps, type MiniAppKeepAlive, type MiniAppLaunch, type MiniAppLocalBundle, type MiniAppManifest, type MiniAppNativeHandlers, type MiniAppPaymentRequest, type MiniAppPaymentResult, type MiniAppPendingChangelog, type MiniAppPermission, type MiniAppPickedFile, type MiniAppSpeechProvider, type MiniAppSpeechStartContext, type MiniAppSplashProps, type MiniAppStorage, type MiniAppSyncResult, type MiniAppUpdate, type MiniAppUpdatePromptProps, _default as MiniAppUpdates, type MiniAppUpdatesProps, type MiniAppUploadCaller, type MiniAppUploadOptions, type MiniAppUploadProcessOptions, type MiniAppUploadProcessor, type MiniAppUploadRequest, type MiniAppUploadSource, type MiniAppUploadSourceRequest, type MiniAppUploadTarget, type MiniAppUploader, type MiniAppUrlUploadTarget, type OpenMiniAppArgs, type ReactNativeBiometricsLike, ScannerEndReason, ScannerEvent, ScannerLayout, ScannerMethod, type ScannerOptions, type ScannerResult, type SpeechOptions, ToastType, type UploadCapabilities, type UploadFileType, type UploadFilesResult, type UploadedFile, closeMiniApp, configureMiniApp, createMmkvStorage, createReactNativeBiometrics, createRnfsFileSystem, dismissMiniAppChangelog, ensureMiniApp, fetchMiniAppChangelog, getLocalMiniApp, getMiniAppCatalog, getMiniAppCatalogEntry, getMiniAppChangelogSeen, getMiniAppStatuses, getMiniAppUpdate, getPendingChangelog, installBundledMiniApp, markMiniAppChangelogSeen, mergeMiniAppChangelog, onMiniAppEvent, openMiniApp, parseInlineMarkdown, pauseMiniApp, pauseMiniAppDownloads, preloadMiniApp, releaseSpeechFor, restoreMiniApp, resumeMiniApp, resumeMiniAppDownloads, sendEventToWeb, showMiniAppChangelog, stripInlineMarkdown, syncMiniAppCatalog, uninstallMiniApp, updateMiniApp, uploadToUrl, useMiniAppChangelog, useMiniAppChangelogRequest, useMiniAppDownload, useMiniAppDownloadsPaused };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { ImageSourcePropType } from 'react-native';
|
|
2
|
+
import { ImageSourcePropType, TextProps } from 'react-native';
|
|
3
3
|
|
|
4
4
|
type MiniAppChannel = 'production' | 'testing';
|
|
5
5
|
/** Quyền lấy token nhạy cảm — admin bật trên Console, Platform trả trong manifest. */
|
|
@@ -759,15 +759,20 @@ declare const MINIAPP_CHANGELOG_KINDS: {
|
|
|
759
759
|
bg: string;
|
|
760
760
|
}[];
|
|
761
761
|
declare const mergeMiniAppChangelog: (versions: MiniAppChangelogVersion[]) => MiniAppChangelog;
|
|
762
|
+
/** 1 mục changelog: **đậm**, `code`, [chữ](https://link) — Text lồng nhau, link mở trình duyệt. */
|
|
763
|
+
declare const MiniAppChangelogText: ({ text, style }: {
|
|
764
|
+
text: string;
|
|
765
|
+
style?: TextProps["style"];
|
|
766
|
+
}) => React.JSX.Element;
|
|
762
767
|
/** 3 nhóm Mới / Sửa lỗi / Cải thiện (bỏ nhóm trống) — dùng lại được trong UI riêng. */
|
|
763
768
|
declare const MiniAppChangelogGroups: ({ changelog }: {
|
|
764
769
|
changelog: MiniAppChangelog;
|
|
765
770
|
}) => React.JSX.Element;
|
|
766
|
-
/** Toàn bộ lịch sử changelog của 1 mini app (màn "Xem tất cả"), mới nhất trước. */
|
|
767
|
-
declare const MiniAppChangelogHistory: ({ app_id, name,
|
|
771
|
+
/** Toàn bộ lịch sử changelog của 1 mini app (màn "Xem tất cả"), mới nhất trước. Header nổi kiểu Chat SDK. */
|
|
772
|
+
declare const MiniAppChangelogHistory: ({ app_id, name, onBack }: {
|
|
768
773
|
app_id: string;
|
|
769
774
|
name: string;
|
|
770
|
-
|
|
775
|
+
onBack: () => void;
|
|
771
776
|
}) => React.JSX.Element;
|
|
772
777
|
/** UI mặc định "Có gì mới". */
|
|
773
778
|
declare const DefaultMiniAppChangelogPrompt: ({ request, changelog, onClose }: MiniAppChangelogPromptProps) => React.JSX.Element;
|
|
@@ -777,6 +782,29 @@ declare const DefaultMiniAppUpdatePrompt: ({ update, is_updating, progress, has_
|
|
|
777
782
|
}) => React.JSX.Element;
|
|
778
783
|
declare const _default: React.MemoExoticComponent<({ app_ids, shouldShowUpdate, logo, renderUpdate, renderChangelog }: MiniAppUpdatesProps) => React.JSX.Element | null>;
|
|
779
784
|
|
|
785
|
+
/**
|
|
786
|
+
* Markdown inline tối giản cho changelog (1 dòng / mục): **đậm**, `code`, [chữ](https://link).
|
|
787
|
+
* Không hỗ trợ tiêu đề / bảng / list lồng — dữ liệu vẫn lưu nguyên text, chỉ đổi lúc hiển thị.
|
|
788
|
+
* Bản giống hệt trong retion-miniapp-platform (src/lib/inline-markdown.ts) — sửa thì sửa cả hai.
|
|
789
|
+
*/
|
|
790
|
+
type InlineToken = {
|
|
791
|
+
type: 'text';
|
|
792
|
+
text: string;
|
|
793
|
+
} | {
|
|
794
|
+
type: 'bold';
|
|
795
|
+
text: string;
|
|
796
|
+
} | {
|
|
797
|
+
type: 'code';
|
|
798
|
+
text: string;
|
|
799
|
+
} | {
|
|
800
|
+
type: 'link';
|
|
801
|
+
text: string;
|
|
802
|
+
url: string;
|
|
803
|
+
};
|
|
804
|
+
declare const parseInlineMarkdown: (input: string) => InlineToken[];
|
|
805
|
+
/** Bỏ ký hiệu, giữ chữ — cho bản xem trước 1 dòng trong bảng. */
|
|
806
|
+
declare const stripInlineMarkdown: (input: string) => string;
|
|
807
|
+
|
|
780
808
|
/**
|
|
781
809
|
* App → web: gửi event xuống web của mini app — web nhận y như `WebView.postMessage` (sự kiện `message`).
|
|
782
810
|
* `instance_id`: instance_id lúc openMiniApp; không dùng instance_id thì truyền app_id.
|
|
@@ -948,4 +976,4 @@ interface UploadCapabilities {
|
|
|
948
976
|
/** XHR (không phải fetch) để có tiến trình upload; RN đọc file từ uri (cả content://), không nạp vào JS. */
|
|
949
977
|
declare const uploadToUrl: MiniAppUploader;
|
|
950
978
|
|
|
951
|
-
export { CodeType, DefaultMiniAppChangelogPrompt, DefaultMiniAppSplash, DefaultMiniAppUpdatePrompt, type LocationOptions, type LocationResult, MINIAPP_CHANGELOG_KINDS, MINIAPP_PLATFORM_URL, type MiniAppBiometricAvailability, type MiniAppBiometricRequest, type MiniAppBiometricResult, type MiniAppBiometrics, type MiniAppBiometryType, type MiniAppBridgeOptions, type MiniAppCatalogEntry, type MiniAppCatalogItem, type MiniAppChangelog, MiniAppChangelogGroups, MiniAppChangelogHistory, type MiniAppChangelogPromptProps, type MiniAppChangelogRequest, type MiniAppChangelogState, type MiniAppChangelogVersion, type MiniAppChannel, type MiniAppConfig, type MiniAppContainerProps, type MiniAppContext, type MiniAppDownloadState, type MiniAppDownloadStatus, type MiniAppDownloadTask, type MiniAppEvent, type MiniAppFileSystem, type MiniAppHandlerContext, type MiniAppHapticType, _default$1 as MiniAppHost, type MiniAppHostData, BridgeError as MiniAppHostError, type MiniAppHostProps, type MiniAppKeepAlive, type MiniAppLaunch, type MiniAppLocalBundle, type MiniAppManifest, type MiniAppNativeHandlers, type MiniAppPaymentRequest, type MiniAppPaymentResult, type MiniAppPendingChangelog, type MiniAppPermission, type MiniAppPickedFile, type MiniAppSpeechProvider, type MiniAppSpeechStartContext, type MiniAppSplashProps, type MiniAppStorage, type MiniAppSyncResult, type MiniAppUpdate, type MiniAppUpdatePromptProps, _default as MiniAppUpdates, type MiniAppUpdatesProps, type MiniAppUploadCaller, type MiniAppUploadOptions, type MiniAppUploadProcessOptions, type MiniAppUploadProcessor, type MiniAppUploadRequest, type MiniAppUploadSource, type MiniAppUploadSourceRequest, type MiniAppUploadTarget, type MiniAppUploader, type MiniAppUrlUploadTarget, type OpenMiniAppArgs, type ReactNativeBiometricsLike, ScannerEndReason, ScannerEvent, ScannerLayout, ScannerMethod, type ScannerOptions, type ScannerResult, type SpeechOptions, ToastType, type UploadCapabilities, type UploadFileType, type UploadFilesResult, type UploadedFile, closeMiniApp, configureMiniApp, createMmkvStorage, createReactNativeBiometrics, createRnfsFileSystem, dismissMiniAppChangelog, ensureMiniApp, fetchMiniAppChangelog, getLocalMiniApp, getMiniAppCatalog, getMiniAppCatalogEntry, getMiniAppChangelogSeen, getMiniAppStatuses, getMiniAppUpdate, getPendingChangelog, installBundledMiniApp, markMiniAppChangelogSeen, mergeMiniAppChangelog, onMiniAppEvent, openMiniApp, pauseMiniApp, pauseMiniAppDownloads, preloadMiniApp, releaseSpeechFor, restoreMiniApp, resumeMiniApp, resumeMiniAppDownloads, sendEventToWeb, showMiniAppChangelog, syncMiniAppCatalog, uninstallMiniApp, updateMiniApp, uploadToUrl, useMiniAppChangelog, useMiniAppChangelogRequest, useMiniAppDownload, useMiniAppDownloadsPaused };
|
|
979
|
+
export { CodeType, DefaultMiniAppChangelogPrompt, DefaultMiniAppSplash, DefaultMiniAppUpdatePrompt, type InlineToken, type LocationOptions, type LocationResult, MINIAPP_CHANGELOG_KINDS, MINIAPP_PLATFORM_URL, type MiniAppBiometricAvailability, type MiniAppBiometricRequest, type MiniAppBiometricResult, type MiniAppBiometrics, type MiniAppBiometryType, type MiniAppBridgeOptions, type MiniAppCatalogEntry, type MiniAppCatalogItem, type MiniAppChangelog, MiniAppChangelogGroups, MiniAppChangelogHistory, type MiniAppChangelogPromptProps, type MiniAppChangelogRequest, type MiniAppChangelogState, MiniAppChangelogText, type MiniAppChangelogVersion, type MiniAppChannel, type MiniAppConfig, type MiniAppContainerProps, type MiniAppContext, type MiniAppDownloadState, type MiniAppDownloadStatus, type MiniAppDownloadTask, type MiniAppEvent, type MiniAppFileSystem, type MiniAppHandlerContext, type MiniAppHapticType, _default$1 as MiniAppHost, type MiniAppHostData, BridgeError as MiniAppHostError, type MiniAppHostProps, type MiniAppKeepAlive, type MiniAppLaunch, type MiniAppLocalBundle, type MiniAppManifest, type MiniAppNativeHandlers, type MiniAppPaymentRequest, type MiniAppPaymentResult, type MiniAppPendingChangelog, type MiniAppPermission, type MiniAppPickedFile, type MiniAppSpeechProvider, type MiniAppSpeechStartContext, type MiniAppSplashProps, type MiniAppStorage, type MiniAppSyncResult, type MiniAppUpdate, type MiniAppUpdatePromptProps, _default as MiniAppUpdates, type MiniAppUpdatesProps, type MiniAppUploadCaller, type MiniAppUploadOptions, type MiniAppUploadProcessOptions, type MiniAppUploadProcessor, type MiniAppUploadRequest, type MiniAppUploadSource, type MiniAppUploadSourceRequest, type MiniAppUploadTarget, type MiniAppUploader, type MiniAppUrlUploadTarget, type OpenMiniAppArgs, type ReactNativeBiometricsLike, ScannerEndReason, ScannerEvent, ScannerLayout, ScannerMethod, type ScannerOptions, type ScannerResult, type SpeechOptions, ToastType, type UploadCapabilities, type UploadFileType, type UploadFilesResult, type UploadedFile, closeMiniApp, configureMiniApp, createMmkvStorage, createReactNativeBiometrics, createRnfsFileSystem, dismissMiniAppChangelog, ensureMiniApp, fetchMiniAppChangelog, getLocalMiniApp, getMiniAppCatalog, getMiniAppCatalogEntry, getMiniAppChangelogSeen, getMiniAppStatuses, getMiniAppUpdate, getPendingChangelog, installBundledMiniApp, markMiniAppChangelogSeen, mergeMiniAppChangelog, onMiniAppEvent, openMiniApp, parseInlineMarkdown, pauseMiniApp, pauseMiniAppDownloads, preloadMiniApp, releaseSpeechFor, restoreMiniApp, resumeMiniApp, resumeMiniAppDownloads, sendEventToWeb, showMiniAppChangelog, stripInlineMarkdown, syncMiniAppCatalog, uninstallMiniApp, updateMiniApp, uploadToUrl, useMiniAppChangelog, useMiniAppChangelogRequest, useMiniAppDownload, useMiniAppDownloadsPaused };
|