@authing/native-js-ui-components 3.0.0-rc.0 → 3.0.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/config/webpack.config.js +2 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.min.css +2 -2
- package/lib/index.min.js +1 -1
- package/package.json +3 -3
- package/src/App.tsx +5 -10
- package/src/components/Guard/index.tsx +9 -3
- package/src/components/index.ts +4 -1
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authing/native-js-ui-components",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"framework": "Native",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "lib/index.min.js",
|
|
7
7
|
"typings": "lib/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@authing/react-ui-components": "^3.0.0
|
|
9
|
+
"@authing/react-ui-components": "^3.0.0",
|
|
10
10
|
"react": "16.14.0",
|
|
11
11
|
"react-dom": "16.14.0"
|
|
12
12
|
},
|
|
@@ -167,5 +167,5 @@
|
|
|
167
167
|
"webpack-manifest-plugin": "2.2.0",
|
|
168
168
|
"workbox-webpack-plugin": "5.1.4"
|
|
169
169
|
},
|
|
170
|
-
"gitHead": "
|
|
170
|
+
"gitHead": "9056f23895fd3f0f6358a735605212246f8526f8"
|
|
171
171
|
}
|
package/src/App.tsx
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import React, { useEffect } from "react";
|
|
2
2
|
import "./App.css";
|
|
3
|
-
import {
|
|
3
|
+
import { Guard, GuardMode } from "./components";
|
|
4
4
|
|
|
5
5
|
function App() {
|
|
6
6
|
useEffect(() => {
|
|
7
|
-
const guard = new
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
appHost: "https://core.dev2.authing-inc.co/",
|
|
12
|
-
mode: GuardMode.Modal,
|
|
13
|
-
},
|
|
14
|
-
"6194a41abf23c1d5268b362a"
|
|
15
|
-
);
|
|
7
|
+
const guard = new Guard("6191cf610f772aa56dc70637", {
|
|
8
|
+
target: ".App",
|
|
9
|
+
mode: GuardMode.Modal,
|
|
10
|
+
});
|
|
16
11
|
|
|
17
12
|
// @ts-ignore
|
|
18
13
|
window.guard = guard;
|
|
@@ -17,8 +17,10 @@ import {
|
|
|
17
17
|
AuthenticationClientOptions,
|
|
18
18
|
} from "@authing/react-ui-components";
|
|
19
19
|
import "@authing/react-ui-components/lib/index.min.css";
|
|
20
|
-
import {
|
|
21
|
-
|
|
20
|
+
import {
|
|
21
|
+
GuardComponentConifg,
|
|
22
|
+
GuardLocalConfig,
|
|
23
|
+
} from "@authing/react-ui-components/components/Guard/config";
|
|
22
24
|
import { GuardEvents } from "@authing/react-ui-components/components/Guard/event";
|
|
23
25
|
|
|
24
26
|
export type {
|
|
@@ -48,7 +50,10 @@ export type EventListeners = {
|
|
|
48
50
|
};
|
|
49
51
|
|
|
50
52
|
export class Guard {
|
|
51
|
-
constructor(
|
|
53
|
+
constructor(
|
|
54
|
+
private appId: string,
|
|
55
|
+
private config?: Partial<GuardLocalConfig>
|
|
56
|
+
) {
|
|
52
57
|
this.render();
|
|
53
58
|
}
|
|
54
59
|
|
|
@@ -112,6 +117,7 @@ export class Guard {
|
|
|
112
117
|
{...(evts as GuardEvents)}
|
|
113
118
|
appId={this.appId}
|
|
114
119
|
config={this.config as GuardComponentConifg}
|
|
120
|
+
visible={this.visible}
|
|
115
121
|
/>,
|
|
116
122
|
Guard.getGuardContainer(this.config?.target),
|
|
117
123
|
cb
|
package/src/components/index.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
// export * from "./Guard";
|
|
2
2
|
import { Guard } from "./Guard";
|
|
3
|
+
import { GuardConfig, GuardLocalConfig } from "@authing/react-ui-components/components";
|
|
3
4
|
export * from "./AuthingGuard";
|
|
4
5
|
|
|
5
|
-
export { Guard };
|
|
6
|
+
export { Guard };
|
|
7
|
+
export type { GuardConfig, GuardLocalConfig };
|
|
8
|
+
|