@lark-apaas/client-toolkit 1.1.20 → 1.1.21-alpha.auth.dev.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.
@@ -1,7 +1,10 @@
1
1
  import React from 'react';
2
2
  import { IBaseThemeProviderProps } from '../theme';
3
3
  import '../../index.css';
4
+ interface IBaseAuthProviderProps {
5
+ enableAuth?: boolean;
6
+ }
4
7
  declare const AppContainer: React.FC<{
5
8
  children: React.ReactNode;
6
- } & IBaseThemeProviderProps>;
9
+ } & IBaseThemeProviderProps & IBaseAuthProviderProps>;
7
10
  export default AppContainer;
@@ -11,11 +11,12 @@ import "../../index.css";
11
11
  import { initAxiosConfig } from "../../utils/axiosConfig.js";
12
12
  import { useAppInfo } from "../../hooks/index.js";
13
13
  import safety from "./safety.js";
14
+ import { AuthProvider } from "@lark-apaas/auth-sdk";
14
15
  registerDayjsPlugins();
15
16
  initAxiosConfig();
16
17
  const isMiaodaPreview = window.IS_MIAODA_PREVIEW;
17
18
  const App = (props)=>{
18
- const { themeMeta = {} } = props;
19
+ const { themeMeta = {}, enableAuth } = props;
19
20
  useAppInfo();
20
21
  const { rem } = findValueByPixel(themeMetaOptions.themeRadius, themeMeta.borderRadius) || {
21
22
  rem: '0.625'
@@ -36,7 +37,10 @@ const App = (props)=>{
36
37
  }, 300);
37
38
  });
38
39
  }, []);
39
- return /*#__PURE__*/ jsxs(Fragment, {
40
+ return /*#__PURE__*/ jsxs(AuthProvider, {
41
+ config: {
42
+ enable: enableAuth
43
+ },
40
44
  children: [
41
45
  /*#__PURE__*/ jsx(Toaster, {}),
42
46
  'production' !== process.env.NODE_ENV && /*#__PURE__*/ jsx(MiaodaInspector, {
@@ -61,6 +65,7 @@ const AppContainer = (props)=>{
61
65
  /*#__PURE__*/ jsx(safety, {}),
62
66
  /*#__PURE__*/ jsx(App, {
63
67
  themeMeta: props.themeMeta,
68
+ enableAuth: props.enableAuth,
64
69
  children: children
65
70
  })
66
71
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/client-toolkit",
3
- "version": "1.1.20",
3
+ "version": "1.1.21-alpha.auth.dev.1",
4
4
  "types": "./lib/index.d.ts",
5
5
  "main": "./lib/index.js",
6
6
  "files": [
@@ -69,13 +69,13 @@
69
69
  "storybook": "storybook dev",
70
70
  "test": "echo 0",
71
71
  "lint": "eslint src --ext .js,.jsx,.ts,.tsx",
72
- "lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix",
73
- "prepublishOnly": "npm run build && node scripts/replace-workspace-alias.js"
72
+ "lint:fix": "eslint src --ext .js,.jsx,.ts,.tsx --fix"
74
73
  },
75
74
  "dependencies": {
76
75
  "@ant-design/colors": "^7.2.1",
77
76
  "@ant-design/cssinjs": "^1.24.0",
78
77
  "@data-loom/js": "^0.4.0",
78
+ "@lark-apaas/auth-sdk": "0.1.0-alpha.6",
79
79
  "@lark-apaas/miaoda-inspector": "^1.0.4",
80
80
  "@radix-ui/react-avatar": "^1.1.10",
81
81
  "@radix-ui/react-popover": "^1.1.15",