@hellocoop/react 1.0.2 → 1.0.4
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/auth.d.ts +1 -13
- package/dist/auth.d.ts.map +1 -1
- package/dist/buttons.js +2 -2
- package/package.json +1 -1
package/dist/auth.d.ts
CHANGED
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
type AuthCookie = {
|
|
3
|
-
sub: string;
|
|
4
|
-
iat: number;
|
|
5
|
-
} & Claims & {
|
|
6
|
-
[key: string]: any;
|
|
7
|
-
};
|
|
8
|
-
export type Auth = {
|
|
9
|
-
isLoggedIn: false;
|
|
10
|
-
} | ({
|
|
11
|
-
isLoggedIn: true;
|
|
12
|
-
} & AuthCookie);
|
|
1
|
+
import type { Auth } from '@hellocoop/types';
|
|
13
2
|
export type AuthState = {
|
|
14
3
|
auth: Auth | {};
|
|
15
4
|
isLoading: boolean;
|
|
16
5
|
isLoggedIn: boolean | undefined;
|
|
17
6
|
};
|
|
18
7
|
export declare const useAuth: () => AuthState;
|
|
19
|
-
export {};
|
|
20
8
|
//# sourceMappingURL=auth.d.ts.map
|
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAe5C,MAAM,MAAM,SAAS,GAAG;IACpB,IAAI,EAAE,IAAI,GAAG,EAAE,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,GAAG,SAAS,CAAA;CAClC,CAAA;AAED,eAAO,MAAM,OAAO,QAAO,SAS1B,CAAA"}
|
package/dist/buttons.js
CHANGED
|
@@ -32,13 +32,13 @@ function BaseButton({ scope, updateScope, targetURI, providerHint, label, style,
|
|
|
32
32
|
var _a;
|
|
33
33
|
//check if dev has added Hellō stylesheet to pages with Hellō buttons
|
|
34
34
|
if (typeof window != 'undefined' && !checkedForStylesheet) {
|
|
35
|
-
const hasStylesheet =
|
|
35
|
+
const hasStylesheet = Array.from(document.head.getElementsByTagName('link')).find((element) => {
|
|
36
36
|
var _a;
|
|
37
37
|
return element.getAttribute('rel') === 'stylesheet' &&
|
|
38
38
|
((_a = element.getAttribute('href')) === null || _a === void 0 ? void 0 : _a.startsWith(types_1.Button.STYLES_URL));
|
|
39
39
|
});
|
|
40
40
|
if (!hasStylesheet)
|
|
41
|
-
console.
|
|
41
|
+
console.warn('Could not find Hellō stylesheet. Please add to pages with Hellō buttons. See http://hello.dev/docs/buttons/#stylesheet for more info.');
|
|
42
42
|
checkedForStylesheet = true;
|
|
43
43
|
}
|
|
44
44
|
const helloBtnClass = (_a = types_1.Button.CLASS_MAPPING[color]) === null || _a === void 0 ? void 0 : _a[theme];
|