@retion-miniapp/react-native 0.20.1 → 0.21.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 CHANGED
@@ -1,4 +1,5 @@
1
- import React, { ReactNode } from 'react';
1
+ import * as React from 'react';
2
+ import React__default, { ReactNode } from 'react';
2
3
  import { ImageSourcePropType, TextProps } from 'react-native';
3
4
 
4
5
  type MiniAppChannel = 'production' | 'testing';
@@ -432,15 +433,15 @@ declare const createMmkvStorage: (mmkv: {
432
433
  }) => MiniAppStorage;
433
434
 
434
435
  /** Splash mặc định (chỉ dùng component RN) — ứng dụng truyền `splash` để thay bằng UI riêng. */
435
- declare const DefaultMiniAppSplash: ({ app, is_dark, status, progress, retry }: MiniAppSplashProps) => React.JSX.Element;
436
+ declare const DefaultMiniAppSplash: ({ app, is_dark, status, progress, retry }: MiniAppSplashProps) => React__default.JSX.Element;
436
437
  interface MiniAppHostProps {
437
438
  /**
438
439
  * Layout bao ngoài (bottom sheet, modal, full screen…). PHẢI là component cố định (khai báo ngoài
439
440
  * render) — truyền inline `(p) => …` thì mỗi lần render là component mới → mount lại mọi WebView.
440
441
  */
441
- container: React.ComponentType<MiniAppContainerProps>;
442
+ container: React__default.ComponentType<MiniAppContainerProps>;
442
443
  /** Màn che lúc khởi động / đang tải / lỗi. Mặc định DefaultMiniAppSplash. Cũng phải cố định như container. */
443
- splash?: React.ComponentType<MiniAppSplashProps>;
444
+ splash?: React__default.ComponentType<MiniAppSplashProps>;
444
445
  is_dark?: boolean;
445
446
  bridge?: MiniAppBridgeOptions;
446
447
  /**
@@ -466,7 +467,7 @@ interface MiniAppHostProps {
466
467
  url: string;
467
468
  }) => void;
468
469
  }
469
- declare const _default$1: React.MemoExoticComponent<({ container, splash, is_dark, bridge, close_on_back, opaque_background, allow_embedded_miniapps, onWebLoadEnd }: MiniAppHostProps) => React.JSX.Element | null>;
470
+ declare const _default$1: React__default.MemoExoticComponent<({ container, splash, is_dark, bridge, close_on_back, opaque_background, allow_embedded_miniapps, onWebLoadEnd }: MiniAppHostProps) => React__default.JSX.Element | null>;
470
471
 
471
472
  interface OpenMiniAppArgs {
472
473
  app: MiniAppLaunch;
@@ -703,28 +704,32 @@ interface MiniAppChangelogRequest extends MiniAppPendingChangelog {
703
704
  /** Changelog các bản đã nhảy qua (from loại trừ → to bao gồm), mới nhất trước. Luôn ≥ 1. */
704
705
  versions: MiniAppChangelogVersion[];
705
706
  }
707
+ /** Màn "Xem tất cả" mở trực tiếp (không qua popup) — vd web gọi openChangelogHistory(). */
708
+ interface MiniAppChangelogHistoryRequest {
709
+ app_id: string;
710
+ name: string;
711
+ }
706
712
  /**
707
713
  * Có bản mới chưa xem changelog → tải → hiện (qua <MiniAppUpdates />). true nếu hiện.
714
+ * `force`: hiện cả khi đã xem (bản đang có), dùng cho nút "Có gì mới" trong mini app.
708
715
  * SDK tự gọi khi openMiniApp / updateMiniApp xong; gọi tay khi mở mini app theo đường khác (vd iframe trong web).
709
716
  * Các bản nhảy qua đều chưa có changelog → ghi nhận đã xem, không hiện. Lỗi mạng → lần mở sau thử lại.
710
717
  */
711
- declare const showMiniAppChangelog: (app_id: string, { name }?: {
718
+ declare const showMiniAppChangelog: (app_id: string, { name, force }?: {
712
719
  name?: string;
720
+ force?: boolean;
713
721
  }) => Promise<boolean>;
714
722
  /** Đóng changelog đang hiện, ghi nhận đã xem tới bản đang có. */
715
723
  declare const dismissMiniAppChangelog: () => void;
716
724
  declare const useMiniAppChangelogRequest: () => MiniAppChangelogRequest | null;
725
+ /** Mở thẳng màn "Xem tất cả cập nhật" của 1 mini app (qua <MiniAppUpdates />). */
726
+ declare const showMiniAppChangelogHistory: (app_id: string, { name }?: {
727
+ name?: string;
728
+ }) => void;
729
+ declare const closeMiniAppChangelogHistory: () => void;
730
+ declare const useMiniAppChangelogHistoryRequest: () => MiniAppChangelogHistoryRequest | null;
717
731
 
718
- /**
719
- * Popup cập nhật + "Có gì mới" của mini app — SDK lo toàn bộ logic, ứng dụng chỉ mount 1 lần và (tuỳ chọn) bọc UI:
720
- *
721
- * <MiniAppUpdates logo={require('./assets/icon.png')} />
722
- * <MiniAppUpdates renderUpdate={props => <MyUpdatePopup {...props} />} />
723
- *
724
- * - Cập nhật (app trong config.manual_update có bản mới): popup bắt buộc → updateMiniApp → % tải → Thử lại khi lỗi.
725
- * - Changelog: openMiniApp / cập nhật xong / showMiniAppChangelog(app_id) mà có bản mới chưa xem → modal
726
- * gộp các bản đã nhảy qua + "Xem tất cả cập nhật". Lần đầu cài không hiện; bản chưa có changelog bỏ qua.
727
- */
732
+ /** Kiểu public của MiniAppUpdates — tách riêng để UI riêng của app import mà không kéo theo component. */
728
733
  interface MiniAppUpdatePromptProps {
729
734
  update: MiniAppUpdate;
730
735
  is_updating: boolean;
@@ -779,6 +784,8 @@ interface MiniAppUpdatesLabels {
779
784
  update_failed: string;
780
785
  update_now: string;
781
786
  updating_hint: string;
787
+ /** Locale định dạng ngày ở màn lịch sử (vd 'vi-VN', 'en-US'). */
788
+ date_locale: string;
782
789
  }
783
790
  interface MiniAppChangelogActionsProps {
784
791
  onClose: () => void;
@@ -791,7 +798,6 @@ interface MiniAppUpdateActionProps {
791
798
  /** "Cập nhật ngay" hoặc "Thử lại" theo labels. */
792
799
  label: string;
793
800
  }
794
- declare const DEFAULT_MINIAPP_UPDATES_LABELS: MiniAppUpdatesLabels;
795
801
  interface MiniAppHistoryHeaderProps {
796
802
  title: string;
797
803
  /** Tên mini app. */
@@ -803,6 +809,12 @@ interface MiniAppChangelogKindStyle {
803
809
  color?: string;
804
810
  bg?: string;
805
811
  }
812
+ interface MiniAppChangelogKind {
813
+ key: keyof MiniAppChangelog;
814
+ label: string;
815
+ color: string;
816
+ bg: string;
817
+ }
806
818
  /** Tuỳ biến UI — chỉ truyền phần cần đổi, còn lại theo mặc định (sáng hoặc tối nếu `dark`). */
807
819
  interface MiniAppUpdatesTheme {
808
820
  dark?: boolean;
@@ -832,32 +844,27 @@ interface MiniAppUpdatesTheme {
832
844
  /** Màu / nhãn từng nhóm. */
833
845
  kinds?: Partial<Record<keyof MiniAppChangelog, MiniAppChangelogKindStyle>>;
834
846
  }
835
- type ResolvedTheme = Required<Omit<MiniAppUpdatesTheme, 'kinds' | 'secondary'>> & {
847
+ /** Theme đã gộp mặc định + chữ — giá trị context mà mọi khối UI của SDK đọc. */
848
+ type MiniAppUpdatesUI = Required<Omit<MiniAppUpdatesTheme, 'kinds' | 'secondary'>> & {
836
849
  secondary?: string;
837
850
  labels: MiniAppUpdatesLabels;
838
- kinds: {
839
- key: keyof MiniAppChangelog;
840
- label: string;
841
- color: string;
842
- bg: string;
843
- }[];
851
+ kinds: MiniAppChangelogKind[];
844
852
  };
845
- /** Khai báo trước resolveMiniAppUpdatesTheme — DEFAULT_THEME tính ngay lúc nạp module. */
846
- declare const MINIAPP_CHANGELOG_KINDS: {
847
- key: keyof MiniAppChangelog;
848
- label: string;
849
- color: string;
850
- bg: string;
851
- }[];
852
- declare const resolveMiniAppUpdatesTheme: (theme?: MiniAppUpdatesTheme, labels?: Partial<MiniAppUpdatesLabels>) => ResolvedTheme;
853
- /** Bọc UI riêng để MiniAppChangelogGroups / MiniAppChangelogHistory ăn theme của app. */
853
+
854
+ declare const DEFAULT_MINIAPP_UPDATES_LABELS: MiniAppUpdatesLabels;
855
+ declare const MINIAPP_CHANGELOG_KINDS: MiniAppChangelogKind[];
856
+ /** Gộp theme + chữ của app với mặc định (sáng / tối theo `dark`). Nhóm "Mới" theo `primary` nếu app không đặt màu riêng. */
857
+ declare const resolveMiniAppUpdatesTheme: (theme?: MiniAppUpdatesTheme, labels?: Partial<MiniAppUpdatesLabels>) => MiniAppUpdatesUI;
858
+ /** Bọc UI riêng để MiniAppChangelogGroups / MiniAppChangelogHistory ăn theme + chữ của app. */
854
859
  declare const MiniAppUpdatesThemeProvider: ({ theme, labels, children }: {
855
860
  theme?: MiniAppUpdatesTheme;
856
861
  labels?: Partial<MiniAppUpdatesLabels>;
857
862
  children: ReactNode;
858
863
  }) => React.JSX.Element;
859
- declare const useMiniAppUpdatesTheme: () => ResolvedTheme;
864
+ declare const useMiniAppUpdatesTheme: () => MiniAppUpdatesUI;
865
+ /** Gộp changelog các bản đã nhảy qua thành 1. */
860
866
  declare const mergeMiniAppChangelog: (versions: MiniAppChangelogVersion[]) => MiniAppChangelog;
867
+
861
868
  /** 1 mục changelog: **đậm**, `code`, [chữ](https://link) — Text lồng nhau, link mở trình duyệt. */
862
869
  declare const MiniAppChangelogText: ({ text, style }: {
863
870
  text: string;
@@ -870,6 +877,7 @@ declare const MiniAppChangelogGroups: ({ changelog, max_items, onMore }: {
870
877
  max_items?: number;
871
878
  onMore?: () => void;
872
879
  }) => React.JSX.Element;
880
+
873
881
  /** 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. */
874
882
  declare const MiniAppChangelogHistory: ({ app_id, name, onBack, renderHeader }: {
875
883
  app_id: string;
@@ -877,7 +885,8 @@ declare const MiniAppChangelogHistory: ({ app_id, name, onBack, renderHeader }:
877
885
  onBack: () => void;
878
886
  /** Header riêng (nằm trong luồng, SDK đệm sẵn status bar). Không truyền → header nổi mặc định. */
879
887
  renderHeader?: (props: MiniAppHistoryHeaderProps) => ReactNode;
880
- }) => React.JSX.Element;
888
+ }) => React__default.JSX.Element;
889
+
881
890
  /** UI mặc định "Có gì mới". */
882
891
  declare const DefaultMiniAppChangelogPrompt: ({ request, changelog, onClose, renderHistoryHeader, renderActions }: MiniAppChangelogPromptProps & {
883
892
  renderHistoryHeader?: MiniAppUpdatesProps["renderHistoryHeader"];
@@ -888,7 +897,15 @@ declare const DefaultMiniAppUpdatePrompt: ({ update, is_updating, progress, has_
888
897
  logo?: ImageSourcePropType;
889
898
  renderAction?: MiniAppUpdatesProps["renderUpdateAction"];
890
899
  }) => React.JSX.Element;
891
- declare const _default: React.MemoExoticComponent<({ app_ids, shouldShowUpdate, logo, renderUpdate, renderChangelog, theme, renderHistoryHeader, labels, renderChangelogActions, renderUpdateAction }: MiniAppUpdatesProps) => React.JSX.Element | null>;
900
+ /** Màn "Xem tất cả" mở thẳng (web gọi openChangelogHistory) — Modal trượt lên, Back / nút back đóng. */
901
+ declare const DefaultMiniAppChangelogHistoryModal: ({ app_id, name, onClose, renderHistoryHeader }: {
902
+ app_id: string;
903
+ name: string;
904
+ onClose: () => void;
905
+ renderHistoryHeader?: MiniAppUpdatesProps["renderHistoryHeader"];
906
+ }) => React.JSX.Element;
907
+
908
+ declare const _default: React__default.MemoExoticComponent<({ app_ids, shouldShowUpdate, logo, renderUpdate, renderChangelog, theme, renderHistoryHeader, labels, renderChangelogActions, renderUpdateAction }: MiniAppUpdatesProps) => React__default.JSX.Element | null>;
892
909
 
893
910
  /**
894
911
  * Markdown inline tối giản cho changelog (1 dòng / mục): **đậm**, `code`, [chữ](https://link).
@@ -1084,4 +1101,4 @@ interface UploadCapabilities {
1084
1101
  /** 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. */
1085
1102
  declare const uploadToUrl: MiniAppUploader;
1086
1103
 
1087
- export { CodeType, DEFAULT_MINIAPP_UPDATES_LABELS, 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, type MiniAppChangelogActionsProps, MiniAppChangelogGroups, MiniAppChangelogHistory, type MiniAppChangelogKindStyle, 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, type MiniAppHistoryHeaderProps, _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 MiniAppUpdateActionProps, type MiniAppUpdatePromptProps, _default as MiniAppUpdates, type MiniAppUpdatesLabels, type MiniAppUpdatesProps, type MiniAppUpdatesTheme, MiniAppUpdatesThemeProvider, 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, resolveMiniAppUpdatesTheme, restoreMiniApp, resumeMiniApp, resumeMiniAppDownloads, sendEventToWeb, showMiniAppChangelog, stripInlineMarkdown, syncMiniAppCatalog, uninstallMiniApp, updateMiniApp, uploadToUrl, useMiniAppChangelog, useMiniAppChangelogRequest, useMiniAppDownload, useMiniAppDownloadsPaused, useMiniAppUpdatesTheme };
1104
+ export { CodeType, DEFAULT_MINIAPP_UPDATES_LABELS, DefaultMiniAppChangelogHistoryModal, 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, type MiniAppChangelogActionsProps, MiniAppChangelogGroups, MiniAppChangelogHistory, type MiniAppChangelogHistoryRequest, type MiniAppChangelogKindStyle, 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, type MiniAppHistoryHeaderProps, _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 MiniAppUpdateActionProps, type MiniAppUpdatePromptProps, _default as MiniAppUpdates, type MiniAppUpdatesLabels, type MiniAppUpdatesProps, type MiniAppUpdatesTheme, MiniAppUpdatesThemeProvider, 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, closeMiniAppChangelogHistory, configureMiniApp, createMmkvStorage, createReactNativeBiometrics, createRnfsFileSystem, dismissMiniAppChangelog, ensureMiniApp, fetchMiniAppChangelog, getLocalMiniApp, getMiniAppCatalog, getMiniAppCatalogEntry, getMiniAppChangelogSeen, getMiniAppStatuses, getMiniAppUpdate, getPendingChangelog, installBundledMiniApp, markMiniAppChangelogSeen, mergeMiniAppChangelog, onMiniAppEvent, openMiniApp, parseInlineMarkdown, pauseMiniApp, pauseMiniAppDownloads, preloadMiniApp, releaseSpeechFor, resolveMiniAppUpdatesTheme, restoreMiniApp, resumeMiniApp, resumeMiniAppDownloads, sendEventToWeb, showMiniAppChangelog, showMiniAppChangelogHistory, stripInlineMarkdown, syncMiniAppCatalog, uninstallMiniApp, updateMiniApp, uploadToUrl, useMiniAppChangelog, useMiniAppChangelogHistoryRequest, useMiniAppChangelogRequest, useMiniAppDownload, useMiniAppDownloadsPaused, useMiniAppUpdatesTheme };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import React, { ReactNode } from 'react';
1
+ import * as React from 'react';
2
+ import React__default, { ReactNode } from 'react';
2
3
  import { ImageSourcePropType, TextProps } from 'react-native';
3
4
 
4
5
  type MiniAppChannel = 'production' | 'testing';
@@ -432,15 +433,15 @@ declare const createMmkvStorage: (mmkv: {
432
433
  }) => MiniAppStorage;
433
434
 
434
435
  /** Splash mặc định (chỉ dùng component RN) — ứng dụng truyền `splash` để thay bằng UI riêng. */
435
- declare const DefaultMiniAppSplash: ({ app, is_dark, status, progress, retry }: MiniAppSplashProps) => React.JSX.Element;
436
+ declare const DefaultMiniAppSplash: ({ app, is_dark, status, progress, retry }: MiniAppSplashProps) => React__default.JSX.Element;
436
437
  interface MiniAppHostProps {
437
438
  /**
438
439
  * Layout bao ngoài (bottom sheet, modal, full screen…). PHẢI là component cố định (khai báo ngoài
439
440
  * render) — truyền inline `(p) => …` thì mỗi lần render là component mới → mount lại mọi WebView.
440
441
  */
441
- container: React.ComponentType<MiniAppContainerProps>;
442
+ container: React__default.ComponentType<MiniAppContainerProps>;
442
443
  /** Màn che lúc khởi động / đang tải / lỗi. Mặc định DefaultMiniAppSplash. Cũng phải cố định như container. */
443
- splash?: React.ComponentType<MiniAppSplashProps>;
444
+ splash?: React__default.ComponentType<MiniAppSplashProps>;
444
445
  is_dark?: boolean;
445
446
  bridge?: MiniAppBridgeOptions;
446
447
  /**
@@ -466,7 +467,7 @@ interface MiniAppHostProps {
466
467
  url: string;
467
468
  }) => void;
468
469
  }
469
- declare const _default$1: React.MemoExoticComponent<({ container, splash, is_dark, bridge, close_on_back, opaque_background, allow_embedded_miniapps, onWebLoadEnd }: MiniAppHostProps) => React.JSX.Element | null>;
470
+ declare const _default$1: React__default.MemoExoticComponent<({ container, splash, is_dark, bridge, close_on_back, opaque_background, allow_embedded_miniapps, onWebLoadEnd }: MiniAppHostProps) => React__default.JSX.Element | null>;
470
471
 
471
472
  interface OpenMiniAppArgs {
472
473
  app: MiniAppLaunch;
@@ -703,28 +704,32 @@ interface MiniAppChangelogRequest extends MiniAppPendingChangelog {
703
704
  /** Changelog các bản đã nhảy qua (from loại trừ → to bao gồm), mới nhất trước. Luôn ≥ 1. */
704
705
  versions: MiniAppChangelogVersion[];
705
706
  }
707
+ /** Màn "Xem tất cả" mở trực tiếp (không qua popup) — vd web gọi openChangelogHistory(). */
708
+ interface MiniAppChangelogHistoryRequest {
709
+ app_id: string;
710
+ name: string;
711
+ }
706
712
  /**
707
713
  * Có bản mới chưa xem changelog → tải → hiện (qua <MiniAppUpdates />). true nếu hiện.
714
+ * `force`: hiện cả khi đã xem (bản đang có), dùng cho nút "Có gì mới" trong mini app.
708
715
  * SDK tự gọi khi openMiniApp / updateMiniApp xong; gọi tay khi mở mini app theo đường khác (vd iframe trong web).
709
716
  * Các bản nhảy qua đều chưa có changelog → ghi nhận đã xem, không hiện. Lỗi mạng → lần mở sau thử lại.
710
717
  */
711
- declare const showMiniAppChangelog: (app_id: string, { name }?: {
718
+ declare const showMiniAppChangelog: (app_id: string, { name, force }?: {
712
719
  name?: string;
720
+ force?: boolean;
713
721
  }) => Promise<boolean>;
714
722
  /** Đóng changelog đang hiện, ghi nhận đã xem tới bản đang có. */
715
723
  declare const dismissMiniAppChangelog: () => void;
716
724
  declare const useMiniAppChangelogRequest: () => MiniAppChangelogRequest | null;
725
+ /** Mở thẳng màn "Xem tất cả cập nhật" của 1 mini app (qua <MiniAppUpdates />). */
726
+ declare const showMiniAppChangelogHistory: (app_id: string, { name }?: {
727
+ name?: string;
728
+ }) => void;
729
+ declare const closeMiniAppChangelogHistory: () => void;
730
+ declare const useMiniAppChangelogHistoryRequest: () => MiniAppChangelogHistoryRequest | null;
717
731
 
718
- /**
719
- * Popup cập nhật + "Có gì mới" của mini app — SDK lo toàn bộ logic, ứng dụng chỉ mount 1 lần và (tuỳ chọn) bọc UI:
720
- *
721
- * <MiniAppUpdates logo={require('./assets/icon.png')} />
722
- * <MiniAppUpdates renderUpdate={props => <MyUpdatePopup {...props} />} />
723
- *
724
- * - Cập nhật (app trong config.manual_update có bản mới): popup bắt buộc → updateMiniApp → % tải → Thử lại khi lỗi.
725
- * - Changelog: openMiniApp / cập nhật xong / showMiniAppChangelog(app_id) mà có bản mới chưa xem → modal
726
- * gộp các bản đã nhảy qua + "Xem tất cả cập nhật". Lần đầu cài không hiện; bản chưa có changelog bỏ qua.
727
- */
732
+ /** Kiểu public của MiniAppUpdates — tách riêng để UI riêng của app import mà không kéo theo component. */
728
733
  interface MiniAppUpdatePromptProps {
729
734
  update: MiniAppUpdate;
730
735
  is_updating: boolean;
@@ -779,6 +784,8 @@ interface MiniAppUpdatesLabels {
779
784
  update_failed: string;
780
785
  update_now: string;
781
786
  updating_hint: string;
787
+ /** Locale định dạng ngày ở màn lịch sử (vd 'vi-VN', 'en-US'). */
788
+ date_locale: string;
782
789
  }
783
790
  interface MiniAppChangelogActionsProps {
784
791
  onClose: () => void;
@@ -791,7 +798,6 @@ interface MiniAppUpdateActionProps {
791
798
  /** "Cập nhật ngay" hoặc "Thử lại" theo labels. */
792
799
  label: string;
793
800
  }
794
- declare const DEFAULT_MINIAPP_UPDATES_LABELS: MiniAppUpdatesLabels;
795
801
  interface MiniAppHistoryHeaderProps {
796
802
  title: string;
797
803
  /** Tên mini app. */
@@ -803,6 +809,12 @@ interface MiniAppChangelogKindStyle {
803
809
  color?: string;
804
810
  bg?: string;
805
811
  }
812
+ interface MiniAppChangelogKind {
813
+ key: keyof MiniAppChangelog;
814
+ label: string;
815
+ color: string;
816
+ bg: string;
817
+ }
806
818
  /** Tuỳ biến UI — chỉ truyền phần cần đổi, còn lại theo mặc định (sáng hoặc tối nếu `dark`). */
807
819
  interface MiniAppUpdatesTheme {
808
820
  dark?: boolean;
@@ -832,32 +844,27 @@ interface MiniAppUpdatesTheme {
832
844
  /** Màu / nhãn từng nhóm. */
833
845
  kinds?: Partial<Record<keyof MiniAppChangelog, MiniAppChangelogKindStyle>>;
834
846
  }
835
- type ResolvedTheme = Required<Omit<MiniAppUpdatesTheme, 'kinds' | 'secondary'>> & {
847
+ /** Theme đã gộp mặc định + chữ — giá trị context mà mọi khối UI của SDK đọc. */
848
+ type MiniAppUpdatesUI = Required<Omit<MiniAppUpdatesTheme, 'kinds' | 'secondary'>> & {
836
849
  secondary?: string;
837
850
  labels: MiniAppUpdatesLabels;
838
- kinds: {
839
- key: keyof MiniAppChangelog;
840
- label: string;
841
- color: string;
842
- bg: string;
843
- }[];
851
+ kinds: MiniAppChangelogKind[];
844
852
  };
845
- /** Khai báo trước resolveMiniAppUpdatesTheme — DEFAULT_THEME tính ngay lúc nạp module. */
846
- declare const MINIAPP_CHANGELOG_KINDS: {
847
- key: keyof MiniAppChangelog;
848
- label: string;
849
- color: string;
850
- bg: string;
851
- }[];
852
- declare const resolveMiniAppUpdatesTheme: (theme?: MiniAppUpdatesTheme, labels?: Partial<MiniAppUpdatesLabels>) => ResolvedTheme;
853
- /** Bọc UI riêng để MiniAppChangelogGroups / MiniAppChangelogHistory ăn theme của app. */
853
+
854
+ declare const DEFAULT_MINIAPP_UPDATES_LABELS: MiniAppUpdatesLabels;
855
+ declare const MINIAPP_CHANGELOG_KINDS: MiniAppChangelogKind[];
856
+ /** Gộp theme + chữ của app với mặc định (sáng / tối theo `dark`). Nhóm "Mới" theo `primary` nếu app không đặt màu riêng. */
857
+ declare const resolveMiniAppUpdatesTheme: (theme?: MiniAppUpdatesTheme, labels?: Partial<MiniAppUpdatesLabels>) => MiniAppUpdatesUI;
858
+ /** Bọc UI riêng để MiniAppChangelogGroups / MiniAppChangelogHistory ăn theme + chữ của app. */
854
859
  declare const MiniAppUpdatesThemeProvider: ({ theme, labels, children }: {
855
860
  theme?: MiniAppUpdatesTheme;
856
861
  labels?: Partial<MiniAppUpdatesLabels>;
857
862
  children: ReactNode;
858
863
  }) => React.JSX.Element;
859
- declare const useMiniAppUpdatesTheme: () => ResolvedTheme;
864
+ declare const useMiniAppUpdatesTheme: () => MiniAppUpdatesUI;
865
+ /** Gộp changelog các bản đã nhảy qua thành 1. */
860
866
  declare const mergeMiniAppChangelog: (versions: MiniAppChangelogVersion[]) => MiniAppChangelog;
867
+
861
868
  /** 1 mục changelog: **đậm**, `code`, [chữ](https://link) — Text lồng nhau, link mở trình duyệt. */
862
869
  declare const MiniAppChangelogText: ({ text, style }: {
863
870
  text: string;
@@ -870,6 +877,7 @@ declare const MiniAppChangelogGroups: ({ changelog, max_items, onMore }: {
870
877
  max_items?: number;
871
878
  onMore?: () => void;
872
879
  }) => React.JSX.Element;
880
+
873
881
  /** 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. */
874
882
  declare const MiniAppChangelogHistory: ({ app_id, name, onBack, renderHeader }: {
875
883
  app_id: string;
@@ -877,7 +885,8 @@ declare const MiniAppChangelogHistory: ({ app_id, name, onBack, renderHeader }:
877
885
  onBack: () => void;
878
886
  /** Header riêng (nằm trong luồng, SDK đệm sẵn status bar). Không truyền → header nổi mặc định. */
879
887
  renderHeader?: (props: MiniAppHistoryHeaderProps) => ReactNode;
880
- }) => React.JSX.Element;
888
+ }) => React__default.JSX.Element;
889
+
881
890
  /** UI mặc định "Có gì mới". */
882
891
  declare const DefaultMiniAppChangelogPrompt: ({ request, changelog, onClose, renderHistoryHeader, renderActions }: MiniAppChangelogPromptProps & {
883
892
  renderHistoryHeader?: MiniAppUpdatesProps["renderHistoryHeader"];
@@ -888,7 +897,15 @@ declare const DefaultMiniAppUpdatePrompt: ({ update, is_updating, progress, has_
888
897
  logo?: ImageSourcePropType;
889
898
  renderAction?: MiniAppUpdatesProps["renderUpdateAction"];
890
899
  }) => React.JSX.Element;
891
- declare const _default: React.MemoExoticComponent<({ app_ids, shouldShowUpdate, logo, renderUpdate, renderChangelog, theme, renderHistoryHeader, labels, renderChangelogActions, renderUpdateAction }: MiniAppUpdatesProps) => React.JSX.Element | null>;
900
+ /** Màn "Xem tất cả" mở thẳng (web gọi openChangelogHistory) — Modal trượt lên, Back / nút back đóng. */
901
+ declare const DefaultMiniAppChangelogHistoryModal: ({ app_id, name, onClose, renderHistoryHeader }: {
902
+ app_id: string;
903
+ name: string;
904
+ onClose: () => void;
905
+ renderHistoryHeader?: MiniAppUpdatesProps["renderHistoryHeader"];
906
+ }) => React.JSX.Element;
907
+
908
+ declare const _default: React__default.MemoExoticComponent<({ app_ids, shouldShowUpdate, logo, renderUpdate, renderChangelog, theme, renderHistoryHeader, labels, renderChangelogActions, renderUpdateAction }: MiniAppUpdatesProps) => React__default.JSX.Element | null>;
892
909
 
893
910
  /**
894
911
  * Markdown inline tối giản cho changelog (1 dòng / mục): **đậm**, `code`, [chữ](https://link).
@@ -1084,4 +1101,4 @@ interface UploadCapabilities {
1084
1101
  /** 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. */
1085
1102
  declare const uploadToUrl: MiniAppUploader;
1086
1103
 
1087
- export { CodeType, DEFAULT_MINIAPP_UPDATES_LABELS, 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, type MiniAppChangelogActionsProps, MiniAppChangelogGroups, MiniAppChangelogHistory, type MiniAppChangelogKindStyle, 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, type MiniAppHistoryHeaderProps, _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 MiniAppUpdateActionProps, type MiniAppUpdatePromptProps, _default as MiniAppUpdates, type MiniAppUpdatesLabels, type MiniAppUpdatesProps, type MiniAppUpdatesTheme, MiniAppUpdatesThemeProvider, 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, resolveMiniAppUpdatesTheme, restoreMiniApp, resumeMiniApp, resumeMiniAppDownloads, sendEventToWeb, showMiniAppChangelog, stripInlineMarkdown, syncMiniAppCatalog, uninstallMiniApp, updateMiniApp, uploadToUrl, useMiniAppChangelog, useMiniAppChangelogRequest, useMiniAppDownload, useMiniAppDownloadsPaused, useMiniAppUpdatesTheme };
1104
+ export { CodeType, DEFAULT_MINIAPP_UPDATES_LABELS, DefaultMiniAppChangelogHistoryModal, 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, type MiniAppChangelogActionsProps, MiniAppChangelogGroups, MiniAppChangelogHistory, type MiniAppChangelogHistoryRequest, type MiniAppChangelogKindStyle, 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, type MiniAppHistoryHeaderProps, _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 MiniAppUpdateActionProps, type MiniAppUpdatePromptProps, _default as MiniAppUpdates, type MiniAppUpdatesLabels, type MiniAppUpdatesProps, type MiniAppUpdatesTheme, MiniAppUpdatesThemeProvider, 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, closeMiniAppChangelogHistory, configureMiniApp, createMmkvStorage, createReactNativeBiometrics, createRnfsFileSystem, dismissMiniAppChangelog, ensureMiniApp, fetchMiniAppChangelog, getLocalMiniApp, getMiniAppCatalog, getMiniAppCatalogEntry, getMiniAppChangelogSeen, getMiniAppStatuses, getMiniAppUpdate, getPendingChangelog, installBundledMiniApp, markMiniAppChangelogSeen, mergeMiniAppChangelog, onMiniAppEvent, openMiniApp, parseInlineMarkdown, pauseMiniApp, pauseMiniAppDownloads, preloadMiniApp, releaseSpeechFor, resolveMiniAppUpdatesTheme, restoreMiniApp, resumeMiniApp, resumeMiniAppDownloads, sendEventToWeb, showMiniAppChangelog, showMiniAppChangelogHistory, stripInlineMarkdown, syncMiniAppCatalog, uninstallMiniApp, updateMiniApp, uploadToUrl, useMiniAppChangelog, useMiniAppChangelogHistoryRequest, useMiniAppChangelogRequest, useMiniAppDownload, useMiniAppDownloadsPaused, useMiniAppUpdatesTheme };