@authing/react-ui-components 4.0.0-rc.2 → 4.0.0-rc.5

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.
@@ -0,0 +1,45 @@
1
+ import React from 'react';
2
+ import './style.less';
3
+ interface SelectPanelProps {
4
+ lists: SelectOptions[];
5
+ /**
6
+ * 点击删除
7
+ */
8
+ handleDel: (id: string) => void;
9
+ /**
10
+ * 点击 li
11
+ */
12
+ onClick: (id: string) => void;
13
+ }
14
+ export interface SelectOptions {
15
+ /**
16
+ * 头像
17
+ */
18
+ photo?: string;
19
+ /**
20
+ * 标题
21
+ */
22
+ title?: string;
23
+ /**
24
+ * 描述
25
+ */
26
+ description?: string;
27
+ /**
28
+ * 用户 ID 唯一标识符
29
+ */
30
+ id: string | 'other';
31
+ /**
32
+ * 显示操作栏 default: true
33
+ */
34
+ operation?: boolean;
35
+ /**
36
+ * 登录时间
37
+ */
38
+ _updateTime: number;
39
+ /**
40
+ * 替代图片元素
41
+ */
42
+ element?: React.ReactElement;
43
+ }
44
+ declare const SelectPanel: React.FC<SelectPanelProps>;
45
+ export { SelectPanel };
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import './style.less';
3
3
  import { GuardLocalConfig } from '../../Guard';
4
4
  import { ApplicationConfig, SocialConnectionItem } from '../../Type/application';
5
+ import { StoreInstance } from '../../Guard/core/hooks/useMultipleAccounts';
5
6
  export interface SocialLoginProps {
6
7
  appId: string;
7
8
  config: GuardLocalConfig;
@@ -9,5 +10,9 @@ export interface SocialLoginProps {
9
10
  onLoginSuccess: any;
10
11
  enterpriseConnectionObjs: ApplicationConfig['identityProviders'];
11
12
  socialConnectionObjs: SocialConnectionItem[];
13
+ /**
14
+ * 根据输入的账号 & 返回获得对应的登录方法
15
+ */
16
+ multipleInstance?: StoreInstance;
12
17
  }
13
18
  export declare const SocialLogin: React.FC<SocialLoginProps>;
@@ -1,8 +1,9 @@
1
- import { AuthenticationClient, CommonMessage } from 'authing-js-sdk';
1
+ import { AuthenticationClient, CommonMessage, User } from 'authing-js-sdk';
2
2
  import { GuardModuleType } from '../Guard/module';
3
3
  import { FacePlugin } from '../_utils/facePlugin/interface';
4
4
  import { ApplicationConfig } from './application';
5
5
  export * from './application';
6
+ export type { CommonMessage, User };
6
7
  export declare type Lang = 'zh-CN' | 'en-US' | 'zh-TW';
7
8
  export declare enum GuardMode {
8
9
  Modal = "modal",
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { GuardEvents, GuardLocalConfig, GuardModuleType, GuardPageConfig } from '..';
3
+ import { BackFillMultipleState, StoreInstance } from '../Guard/core/hooks/useMultipleAccounts';
3
4
  import { ModuleState } from '../Guard/GuardModule/stateMachine';
4
5
  import { ApplicationConfig } from '../Type/application';
5
6
  import { GuardHttp } from './guardHttp';
@@ -18,6 +19,29 @@ export interface IGuardContext {
18
19
  isAuthFlow: boolean;
19
20
  contextLoaded: boolean;
20
21
  guardPageConfig: Partial<GuardPageConfig>;
22
+ multipleInstance: {
23
+ /**
24
+ * 多账号相关
25
+ */
26
+ isMultipleAccount: boolean;
27
+ /**
28
+ * when: 多账号页面跳转进入登录页面
29
+ * 携带的回填数据信息
30
+ */
31
+ multipleAccountData?: BackFillMultipleState;
32
+ /**
33
+ * 多账号 store 实例
34
+ */
35
+ instance?: StoreInstance;
36
+ /**
37
+ * 切换多账号 isMultipleAccount 状态
38
+ */
39
+ referMultipleState?: (type: 'login' | 'multiple') => void;
40
+ /**
41
+ * 清空回填数据
42
+ */
43
+ clearBackFillData?: () => void;
44
+ };
21
45
  }
22
46
  export declare const createGuardXContext: () => {
23
47
  Provider: React.FC<{
@@ -55,3 +79,61 @@ export declare const useGuardFinallyConfig: () => GuardLocalConfig;
55
79
  export declare const useGuardContextLoaded: () => boolean;
56
80
  export declare const useGuardIsAuthFlow: () => boolean;
57
81
  export declare const useGuardPageConfig: () => Partial<GuardPageConfig>;
82
+ /**
83
+ * 多账号登录 store 实例
84
+ */
85
+ export declare const useGuardMultipleInstance: () => {
86
+ /**
87
+ * 多账号相关
88
+ */
89
+ isMultipleAccount: boolean;
90
+ /**
91
+ * when: 多账号页面跳转进入登录页面
92
+ * 携带的回填数据信息
93
+ */
94
+ multipleAccountData?: BackFillMultipleState | undefined;
95
+ /**
96
+ * 多账号 store 实例
97
+ */
98
+ instance?: {
99
+ initStore: (appId: string, options: {
100
+ serverSideLoginMethods: import("../Guard/core/hooks/useMultipleAccounts").LoginWay[];
101
+ isInternationSms: boolean;
102
+ }) => void;
103
+ setLoginWay: (tab: "input" | "qrcode", way: import("../Guard/core/hooks/useMultipleAccounts").LoginWay, id?: string | undefined, internation?: {
104
+ phoneCountryCode: string;
105
+ areaCode: string;
106
+ } | undefined) => void;
107
+ setUserInfo: (user: Pick<import("../Guard/core/hooks/useMultipleAccounts").User & {
108
+ id: string;
109
+ }, "email" | "username" | "phone" | "photo" | "id" | "name" | "nickname" | "_updateTime" | "qrCodeId" | "areaCode">) => void;
110
+ setLoginWayByHttpData: (account: string, data: {
111
+ username?: string | undefined;
112
+ phone?: string | undefined;
113
+ email?: string | undefined;
114
+ }) => void;
115
+ setLoginWayByLDAPData: (account: string, data: {
116
+ name?: string | undefined;
117
+ phone?: string | undefined;
118
+ email?: string | undefined;
119
+ }) => void;
120
+ getMemoUser: (excludeWays?: import("../Guard/core/hooks/useMultipleAccounts").LoginWay[]) => import("../Login/multipleAccounts/panel").SelectOptions[];
121
+ getMemoSingleUser: (id: string) => {
122
+ way: import("../Guard/core/hooks/useMultipleAccounts").LoginWay;
123
+ account: string;
124
+ } | undefined;
125
+ delUserById: (id: string) => string;
126
+ getMemberState: () => boolean;
127
+ getFirstBackFillData: () => BackFillMultipleState | undefined;
128
+ getOriginAccount: () => string;
129
+ getOriginWay: () => string;
130
+ } | undefined;
131
+ /**
132
+ * 切换多账号 isMultipleAccount 状态
133
+ */
134
+ referMultipleState?: ((type: 'login' | 'multiple') => void) | undefined;
135
+ /**
136
+ * 清空回填数据
137
+ */
138
+ clearBackFillData?: (() => void) | undefined;
139
+ };
@@ -1,2 +1,2 @@
1
- declare const _default: "4.0.0-rc.2";
1
+ declare const _default: "4.0.0-rc.5";
2
2
  export default _default;