@authing/react-ui-components 4.2.1-alpha.2 → 4.2.1-zhihu.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authing/react-ui-components",
3
- "version": "4.2.1-alpha.2",
3
+ "version": "4.2.1-zhihu.1",
4
4
  "private": false,
5
5
  "main": "lib/index.min.js",
6
6
  "typings": "types/index.d.ts",
@@ -45,7 +45,8 @@
45
45
  "vite": "vite",
46
46
  "generate-version": "node ./scripts/generate-version",
47
47
  "generate-examples": "node ./scripts/generate-examples.js",
48
- "test": "node ./scripts/dev/pre-build.js"
48
+ "test": "node ./scripts/dev/pre-build.js",
49
+ "lint:fix": "eslint --fix --ext .ts,.tsx,.js ./components"
49
50
  },
50
51
  "publishConfig": {
51
52
  "access": "public",
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { UserRadioItemProps, UserRadioProps } from './interface';
3
+ import './styles.less';
4
+ export declare const UserRadioItem: React.FC<UserRadioItemProps>;
5
+ export declare const UserRadio: React.FC<UserRadioProps>;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import './styles.less';
3
+ export declare const GuardAccountMergeView: React.FC;
@@ -0,0 +1,27 @@
1
+ export interface BriefUserInfo {
2
+ displayName: string;
3
+ avatar: string;
4
+ phone: string;
5
+ email: string;
6
+ username: string;
7
+ name: string;
8
+ }
9
+ export interface GuardAccountMergeInitData {
10
+ currentUserInfo: BriefUserInfo;
11
+ existingUserInfo: BriefUserInfo;
12
+ mergeToken?: string;
13
+ }
14
+ export interface UserRadioProps {
15
+ currentUserInfo: BriefUserInfo;
16
+ existingUserInfo: BriefUserInfo;
17
+ onChange?: (value: any) => void;
18
+ value?: any;
19
+ }
20
+ export interface UserRadioItemProps extends BriefUserInfo {
21
+ value: boolean;
22
+ selected: boolean;
23
+ onClick: (value: boolean) => void;
24
+ }
25
+ export declare enum AuthFlowAction {
26
+ MERGE = "confirm-account-merge"
27
+ }
@@ -0,0 +1,3 @@
1
+ import { User } from 'authing-js-sdk';
2
+ export declare const getDisplayName: (user: User) => string;
3
+ export declare const getDisplayNameByEmail: (displayName: string) => string;
@@ -1,4 +1,6 @@
1
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  import { AuthClientContextProps } from './context';
3
- export declare const AuthClientProvider: React.FC<AuthClientContextProps>;
3
+ export declare const AuthClientProvider: React.FC<AuthClientContextProps & {
4
+ children: ReactNode;
5
+ }>;
4
6
  export declare const useGlobalAuthClient: () => import("authing-js-sdk").AuthenticationClient | undefined;
@@ -7,4 +7,6 @@ export declare const BackLogin: React.FC<BackProps>;
7
7
  export interface BackCustomProps extends BackProps {
8
8
  onBack?: () => void;
9
9
  }
10
- export declare const BackCustom: React.FC<BackCustomProps>;
10
+ export declare const BackCustom: React.FC<BackCustomProps & {
11
+ children: any;
12
+ }>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import './style.less';
3
+ export declare const GuardChangeAccoutTypesView: () => JSX.Element;
@@ -1,7 +1,8 @@
1
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  export declare const GuardChangePassword: React.FC<{
3
3
  title: string;
4
4
  explain: string;
5
+ children: ReactNode;
5
6
  }>;
6
7
  export declare const GuardFirstLoginPasswordResetView: React.FC;
7
8
  export declare const GuardPasswordNotSafeResetView: React.FC;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export declare type OptionType = {
3
+ id: string;
4
+ name: string;
5
+ children: OptionType[];
6
+ };
7
+ interface TreeSelectProps {
8
+ options: OptionType[];
9
+ }
10
+ declare const TreeSelect: React.FC<TreeSelectProps>;
11
+ export default TreeSelect;
@@ -2,7 +2,7 @@ import { AuthenticationClient, CommonMessage, SceneType } from 'authing-js-sdk';
2
2
  import { EmailScene, IG2Config, IG2Events, IG2FCProps, IG2FCViewProps } from '../Type';
3
3
  export interface ForgetPasswordEvents extends IG2Events {
4
4
  onEmailSend?: (authClient: AuthenticationClient, sence?: EmailScene) => void;
5
- onEmailSendError?: (error: CommonMessage, authClient: AuthenticationClient, sence?: EmailScene) => void;
5
+ onEmailSendError?: (error?: CommonMessage, authClient?: AuthenticationClient, sence?: EmailScene) => void;
6
6
  onPhoneSend?: (authClient: AuthenticationClient, sence?: SceneType) => void;
7
7
  onPhoneSendError?: (error: CommonMessage, authClient: AuthenticationClient, sence?: SceneType) => void;
8
8
  onPwdReset?: (authClient: AuthenticationClient) => void;
@@ -1,7 +1,8 @@
1
1
  import { GuardProps } from '..';
2
- import React from 'react';
2
+ import React, { ReactNode } from 'react';
3
3
  import { ModuleState } from '../GuardModule/stateMachine';
4
4
  export declare const RenderContext: React.FC<{
5
5
  guardProps: GuardProps;
6
6
  initState: ModuleState;
7
+ children: ReactNode;
7
8
  }>;
@@ -1,4 +1,2 @@
1
- import { Input } from 'antd';
2
- import { PasswordProps } from 'antd/lib/input';
3
- import React from 'react';
4
- export declare const InputPassword: React.ForwardRefExoticComponent<PasswordProps & React.RefAttributes<React.RefObject<Input>>>;
1
+ /// <reference types="react" />
2
+ export declare const InputPassword: (props: any) => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const LoginWithWeComQrcode: (props: any) => JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import './style.less';
3
3
  import { GuardLocalConfig } from '../../Guard';
4
- import { ApplicationConfig, SocialConnectionItem } from '../../Type/application';
5
4
  import { StoreInstance } from '../../Guard/core/hooks/useMultipleAccounts';
5
+ import { ApplicationConfig, SocialConnectionItem } from '../../Type';
6
6
  export interface SocialLoginProps {
7
7
  appId: string;
8
8
  config: GuardLocalConfig;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import './index.less';
3
3
  import { CodeStatusDescriptions } from './WorkQrCode';
4
4
  export declare type CodeStatus = 'loading' | 'ready' | 'already' | 'success' | 'error' | 'expired' | 'cancel' | 'MFA';
5
- export declare const prefix = "refactor";
5
+ export declare const prefix: string;
6
6
  export interface UiQrProps {
7
7
  /**
8
8
  * Loading 组件
@@ -8,7 +8,8 @@ export declare enum LoginMethods {
8
8
  PhoneCode = "phone-code",
9
9
  WxMinQr = "wechat-miniprogram-qrcode",
10
10
  AD = "ad",
11
- WechatMpQrcode = "wechatmp-qrcode"
11
+ WechatMpQrcode = "wechatmp-qrcode",
12
+ WechatworkCorpQrconnect = "wechatwork-corp-qrconnect"
12
13
  }
13
14
  export declare enum OIDCConnectionMode {
14
15
  FRONT_CHANNEL = "FRONT_CHANNEL",
@@ -112,6 +113,12 @@ export interface QrCodeItem {
112
113
  id: string;
113
114
  title: string;
114
115
  isDefault?: boolean;
116
+ QRConfig?: {
117
+ corpId: string;
118
+ agentId: string;
119
+ redirectUrl: string;
120
+ identifier: string;
121
+ };
115
122
  }
116
123
  export declare type QrcodeTabsSettings = Record<LoginMethods, Array<QrCodeItem>>;
117
124
  export interface OidcClientMetadata {
@@ -292,6 +299,11 @@ export interface ApplicationConfig {
292
299
  loginMethodsSort: string[];
293
300
  };
294
301
  tabMethodsFields: TabFieldsI18nItem[];
302
+ regexRules?: {
303
+ key: string;
304
+ appLevel: string;
305
+ userpoolLevel: string;
306
+ }[];
295
307
  /** 是否为租户控制台应用 */
296
308
  isTenantConsole?: boolean;
297
309
  /** 是否默认为租户应用面板应用 */
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  import { GuardEvents, GuardLocalConfig, GuardModuleType, GuardPageConfig, Lang } from '..';
3
3
  import { BackFillMultipleState, StoreInstance } from '../Guard/core/hooks/useMultipleAccounts';
4
4
  import { ModuleState } from '../Guard/GuardModule/stateMachine';
@@ -43,6 +43,7 @@ export interface IGuardContext {
43
43
  */
44
44
  clearBackFillData?: () => void;
45
45
  };
46
+ phoneRegex: RegExp | null;
46
47
  defaultLanguageConfig: Lang;
47
48
  /** 租户信息获取和操作处理相关 */
48
49
  tenantInstance?: MultipleTenant;
@@ -50,12 +51,14 @@ export interface IGuardContext {
50
51
  export declare const createGuardXContext: () => {
51
52
  Provider: React.FC<{
52
53
  value: Partial<IGuardContext>;
54
+ children: ReactNode;
53
55
  }>;
54
56
  Consumer: React.Consumer<IGuardContext>;
55
57
  };
56
58
  export declare const useGuardXContext: () => {
57
59
  Provider: React.FC<{
58
60
  value: Partial<IGuardContext>;
61
+ children: ReactNode;
59
62
  }>;
60
63
  Consumer: React.Consumer<IGuardContext>;
61
64
  };
@@ -64,7 +67,9 @@ export interface IGuardContextProvider {
64
67
  spinChange: (spin: boolean) => void;
65
68
  }
66
69
  export declare const useGuardButtonContext: () => {
67
- GuardButtonProvider: React.FC<{}>;
70
+ GuardButtonProvider: React.FC<{
71
+ children: ReactNode;
72
+ }>;
68
73
  };
69
74
  export declare const useGuardButtonState: () => IGuardContextProvider;
70
75
  export declare const useGuardPublicConfig: () => ApplicationConfig;
@@ -142,6 +147,7 @@ export declare const useGuardMultipleInstance: () => {
142
147
  */
143
148
  clearBackFillData?: (() => void) | undefined;
144
149
  };
150
+ export declare const useGuardPhoneRegex: () => RegExp | null;
145
151
  /**
146
152
  * 默认语言
147
153
  */
@@ -34,7 +34,7 @@ export declare function isObject(item: any): any;
34
34
  * @param target
35
35
  * @param ...sources
36
36
  */
37
- export declare function deepMerge<T extends any = any>(target: T, ...sources: any[]): T;
37
+ export declare function deepMerge<T extends object = any>(target: T, ...sources: any[]): T;
38
38
  /**
39
39
  * 在托管页下上传query中指定的用户自定义字段进行补全
40
40
  * @param params 指定上传的用户自定义字段
@@ -92,6 +92,9 @@ export declare const getLoginTypePipe: (publicConfig: ApplicationConfig, registe
92
92
  } | undefined;
93
93
  export declare const getPasswordIdentify: (identity: string) => string;
94
94
  export declare const getCurrentLng: () => Lang;
95
+ export declare const isDingTalkOrigin: (origin: string) => boolean;
96
+ export declare const isWeComOrigin: (event: MessageEvent) => boolean;
97
+ export declare const regexFromString: (string: string) => RegExp | null;
95
98
  export declare const getI18nLabel: (method: string | RegisterSortMethods, i18nFields: Map<string, TabFieldsI18nItem>, defaultLanguageConfig: Lang) => string;
96
99
  export declare const getSortLabels: (methods: string[], i18nConfig: Map<string, TabFieldsI18nItem>, defaultLanguageConfig: Lang) => string;
97
100
  export declare const getSortTabs: (tabs: string[], tab?: string | undefined) => string[];
@@ -1,2 +1,2 @@
1
- declare const _default: "4.2.1-alpha.2";
1
+ declare const _default: "4.2.1-zhihu.1";
2
2
  export default _default;