@kivacore/signin 0.20.0 → 0.21.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/README.md +119 -102
- package/dist/auth-detector-CRKg56LT.d.ts +122 -0
- package/dist/{constants-jx2_MXlr.d.ts → constants-DbICcNnA.d.ts} +15 -15
- package/dist/core-index.d.ts +31 -122
- package/dist/core-index.js +32 -20
- package/dist/core-index.js.map +1 -1
- package/dist/electron/index.d.ts +3 -0
- package/dist/electron/index.js +22 -3
- package/dist/electron/index.js.map +1 -1
- package/dist/index.d.ts +76 -20
- package/dist/index.js +96 -67
- package/dist/index.js.map +1 -1
- package/dist/nextjs/index.d.ts +3 -3
- package/dist/nextjs/index.js +15 -13
- package/dist/nextjs/index.js.map +1 -1
- package/dist/react-native/index.d.ts +42 -7
- package/dist/react-native/index.js +48 -30
- package/dist/react-native/index.js.map +1 -1
- package/dist/{types-DmIgZa_v.d.ts → types-DF2C4eb6.d.ts} +42 -42
- package/dist/use-kiva-client-JxGnfblw.d.ts +32 -0
- package/dist/vue/index.d.ts +154 -23
- package/dist/vue/index.js +62 -42
- package/dist/vue/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/use-docyrus-client-QqgMT3b9.d.ts +0 -32
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createContext, useRef, useState, useEffect, useMemo, use } from 'react'
|
|
|
2
2
|
import { BrowserOAuth2TokenStorage, OAuth2Client, RestApiClient, MemoryOAuth2TokenStorage } from '@kivacore/api-client';
|
|
3
3
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
|
-
// src/components/
|
|
5
|
+
// src/components/kiva-auth-provider.tsx
|
|
6
6
|
|
|
7
7
|
// src/constants.ts
|
|
8
8
|
var DEFAULT_API_URL = "https://alpha-api.docyrus.com";
|
|
@@ -16,14 +16,15 @@ var DEFAULT_OAUTH_SCOPES = [
|
|
|
16
16
|
"DS.Read.All"
|
|
17
17
|
];
|
|
18
18
|
var DEFAULT_CALLBACK_PATH = "/auth/callback";
|
|
19
|
-
var DEFAULT_ALLOWED_HOST_PATTERN = /^https:\/\/[^/]+\.docyrus\.app$/;
|
|
20
|
-
var REDIRECT_RETURN_KEY = "
|
|
19
|
+
var DEFAULT_ALLOWED_HOST_PATTERN = /^https:\/\/[^/]+\.(?:kiva|docyrus)\.app$/;
|
|
20
|
+
var REDIRECT_RETURN_KEY = "kiva_auth_return_url";
|
|
21
|
+
var LEGACY_REDIRECT_RETURN_KEY = "docyrus_auth_return_url";
|
|
21
22
|
var TOKEN_EXPIRY_BUFFER_SECONDS = 60;
|
|
22
23
|
var MIN_TOKEN_REFRESH_INTERVAL_MS = 1e4;
|
|
23
24
|
var IFRAME_TOKEN_REFRESH_TIMEOUT_MS = 1e4;
|
|
24
25
|
var HOST_ACTION_TIMEOUT_MS = 15e3;
|
|
25
26
|
var MSGRAPH_REQUEST_TIMEOUT_MS = 3e4;
|
|
26
|
-
var DEFAULT_SSR_COOKIE_KEY = "
|
|
27
|
+
var DEFAULT_SSR_COOKIE_KEY = "kiva-token";
|
|
27
28
|
var SSO_TOKEN_PARAM = "sso_token";
|
|
28
29
|
|
|
29
30
|
// src/core/auth-detector.ts
|
|
@@ -63,7 +64,7 @@ var StandaloneOAuth2Auth = class {
|
|
|
63
64
|
const apiUrl = config.apiUrl ?? DEFAULT_API_URL;
|
|
64
65
|
if (!config.clientId) {
|
|
65
66
|
throw new Error(
|
|
66
|
-
'
|
|
67
|
+
'KivaAuthProvider: "clientId" is required. Set it via the clientId prop or the VITE_KIVA_CLIENT_ID / NEXT_PUBLIC_KIVA_CLIENT_ID environment variable.'
|
|
67
68
|
);
|
|
68
69
|
}
|
|
69
70
|
const { clientId } = config;
|
|
@@ -72,7 +73,7 @@ var StandaloneOAuth2Auth = class {
|
|
|
72
73
|
const redirectUri = config.redirectUri ?? `${window.location.origin}${this.callbackPath}`;
|
|
73
74
|
this.storage = config.tokenStorage ?? new BrowserOAuth2TokenStorage(
|
|
74
75
|
window.localStorage,
|
|
75
|
-
config.storageKeyPrefix ?? "
|
|
76
|
+
config.storageKeyPrefix ?? "kiva_oauth2"
|
|
76
77
|
);
|
|
77
78
|
this.oauth2Client = new OAuth2Client({
|
|
78
79
|
baseURL: apiUrl,
|
|
@@ -126,8 +127,9 @@ var StandaloneOAuth2Auth = class {
|
|
|
126
127
|
* Clears the stored value after retrieval.
|
|
127
128
|
*/
|
|
128
129
|
getReturnUrl() {
|
|
129
|
-
const url = window.localStorage.getItem(REDIRECT_RETURN_KEY);
|
|
130
|
+
const url = window.localStorage.getItem(REDIRECT_RETURN_KEY) ?? window.localStorage.getItem(LEGACY_REDIRECT_RETURN_KEY);
|
|
130
131
|
window.localStorage.removeItem(REDIRECT_RETURN_KEY);
|
|
132
|
+
window.localStorage.removeItem(LEGACY_REDIRECT_RETURN_KEY);
|
|
131
133
|
return url;
|
|
132
134
|
}
|
|
133
135
|
/** Get currently stored tokens (e.g., on page reload). */
|
|
@@ -189,7 +191,7 @@ function getJwtSessionKey(accessToken) {
|
|
|
189
191
|
// src/core/iframe-auth.ts
|
|
190
192
|
function postToHost(data) {
|
|
191
193
|
const rnwv = window.ReactNativeWebView;
|
|
192
|
-
const tap = window.__DOCYRUS_DEVTOOLS_MESSAGE_TAP__;
|
|
194
|
+
const tap = window.__KIVA_DEVTOOLS_MESSAGE_TAP__ ?? window.__DOCYRUS_DEVTOOLS_MESSAGE_TAP__;
|
|
193
195
|
if (rnwv && typeof rnwv.postMessage === "function") {
|
|
194
196
|
if (typeof tap === "function") tap("out", data, { transport: "webview" });
|
|
195
197
|
rnwv.postMessage(JSON.stringify(data));
|
|
@@ -595,7 +597,7 @@ var IframeAuth = class {
|
|
|
595
597
|
try {
|
|
596
598
|
handler(message);
|
|
597
599
|
} catch (err) {
|
|
598
|
-
console.warn("[
|
|
600
|
+
console.warn("[kiva-signin] guidy command handler threw:", err);
|
|
599
601
|
}
|
|
600
602
|
}
|
|
601
603
|
}
|
|
@@ -621,7 +623,7 @@ var IframeAuth = class {
|
|
|
621
623
|
try {
|
|
622
624
|
handler(message);
|
|
623
625
|
} catch (err) {
|
|
624
|
-
console.warn("[
|
|
626
|
+
console.warn("[kiva-signin] host navigation handler threw:", err);
|
|
625
627
|
}
|
|
626
628
|
}
|
|
627
629
|
}
|
|
@@ -634,7 +636,7 @@ var IframeAuth = class {
|
|
|
634
636
|
try {
|
|
635
637
|
handler(notification);
|
|
636
638
|
} catch (err) {
|
|
637
|
-
console.warn("[
|
|
639
|
+
console.warn("[kiva-signin] host notification handler threw:", err);
|
|
638
640
|
}
|
|
639
641
|
}
|
|
640
642
|
}
|
|
@@ -1013,17 +1015,17 @@ var ReactNativeOAuth2Auth = class {
|
|
|
1013
1015
|
const apiUrl = config.apiUrl ?? DEFAULT_API_URL;
|
|
1014
1016
|
if (!config.clientId) {
|
|
1015
1017
|
throw new Error(
|
|
1016
|
-
'
|
|
1018
|
+
'KivaAuthProvider: "clientId" is required for React Native mode.'
|
|
1017
1019
|
);
|
|
1018
1020
|
}
|
|
1019
1021
|
if (!config.nativeRedirectUri) {
|
|
1020
1022
|
throw new Error(
|
|
1021
|
-
`
|
|
1023
|
+
`KivaAuthProvider: "nativeRedirectUri" is required for React Native mode. Set it to your app's deep link URI (e.g., "myapp://auth/callback").`
|
|
1022
1024
|
);
|
|
1023
1025
|
}
|
|
1024
1026
|
if (!config.openAuthSession) {
|
|
1025
1027
|
throw new Error(
|
|
1026
|
-
'
|
|
1028
|
+
'KivaAuthProvider: "openAuthSession" is required for React Native mode. Pass WebBrowser.openAuthSessionAsync from expo-web-browser.'
|
|
1027
1029
|
);
|
|
1028
1030
|
}
|
|
1029
1031
|
const scopes = config.scopes ?? DEFAULT_OAUTH_SCOPES;
|
|
@@ -1082,7 +1084,12 @@ var ReactNativeOAuth2Auth = class {
|
|
|
1082
1084
|
};
|
|
1083
1085
|
|
|
1084
1086
|
// src/core/cookie-sync.ts
|
|
1085
|
-
var DEFAULT_SSR_COOKIE_KEY2 = "
|
|
1087
|
+
var DEFAULT_SSR_COOKIE_KEY2 = "kiva-token";
|
|
1088
|
+
var LEGACY_SSR_COOKIE_KEY = "docyrus-token";
|
|
1089
|
+
function removeCookie(key) {
|
|
1090
|
+
const secure = window.location.protocol === "https:" ? ";Secure" : "";
|
|
1091
|
+
document.cookie = `${key}=;path=/;max-age=0;SameSite=Lax${secure}`;
|
|
1092
|
+
}
|
|
1086
1093
|
function syncTokenToCookie(accessToken, cookieKey, expiresAt) {
|
|
1087
1094
|
if (typeof document === "undefined") return;
|
|
1088
1095
|
const key = cookieKey ?? DEFAULT_SSR_COOKIE_KEY2;
|
|
@@ -1093,12 +1100,13 @@ function syncTokenToCookie(accessToken, cookieKey, expiresAt) {
|
|
|
1093
1100
|
if (seconds > 0) maxAge = `;max-age=${seconds}`;
|
|
1094
1101
|
}
|
|
1095
1102
|
document.cookie = `${key}=${encodeURIComponent(accessToken)};path=/;SameSite=Lax${secure}${maxAge}`;
|
|
1103
|
+
if (key === DEFAULT_SSR_COOKIE_KEY2) removeCookie(LEGACY_SSR_COOKIE_KEY);
|
|
1096
1104
|
}
|
|
1097
1105
|
function clearTokenCookie(cookieKey) {
|
|
1098
1106
|
if (typeof document === "undefined") return;
|
|
1099
1107
|
const key = cookieKey ?? DEFAULT_SSR_COOKIE_KEY2;
|
|
1100
|
-
|
|
1101
|
-
|
|
1108
|
+
removeCookie(key);
|
|
1109
|
+
if (key === DEFAULT_SSR_COOKIE_KEY2) removeCookie(LEGACY_SSR_COOKIE_KEY);
|
|
1102
1110
|
}
|
|
1103
1111
|
function getTokenFromCookie(cookieKey) {
|
|
1104
1112
|
if (typeof document === "undefined") return null;
|
|
@@ -1113,7 +1121,11 @@ var LOOPBACK_HOSTS = [
|
|
|
1113
1121
|
"127.0.0.1",
|
|
1114
1122
|
"[::1]"
|
|
1115
1123
|
];
|
|
1116
|
-
var TRUSTED_DOMAINS = [
|
|
1124
|
+
var TRUSTED_DOMAINS = [
|
|
1125
|
+
"kiva.app",
|
|
1126
|
+
"docyrus.com",
|
|
1127
|
+
"attornaid.com"
|
|
1128
|
+
];
|
|
1117
1129
|
function readHostApiUrl() {
|
|
1118
1130
|
if (typeof window === "undefined" || !window.location) return void 0;
|
|
1119
1131
|
const params = new URLSearchParams(window.location.search);
|
|
@@ -1221,7 +1233,7 @@ var AuthManager = class {
|
|
|
1221
1233
|
/** Initialize the auth manager. Must be called once on mount. */
|
|
1222
1234
|
async initialize() {
|
|
1223
1235
|
if (this.status === "error") {
|
|
1224
|
-
console.error("[
|
|
1236
|
+
console.error("[kiva-signin]", UNTRUSTED_BACKEND_MESSAGE);
|
|
1225
1237
|
this.notify();
|
|
1226
1238
|
return;
|
|
1227
1239
|
}
|
|
@@ -1263,7 +1275,7 @@ var AuthManager = class {
|
|
|
1263
1275
|
ssoAuth.cleanUrl();
|
|
1264
1276
|
return;
|
|
1265
1277
|
} catch (err) {
|
|
1266
|
-
console.warn("[
|
|
1278
|
+
console.warn("[kiva-signin] SSO token exchange failed:", err);
|
|
1267
1279
|
}
|
|
1268
1280
|
}
|
|
1269
1281
|
}
|
|
@@ -1319,7 +1331,7 @@ var AuthManager = class {
|
|
|
1319
1331
|
try {
|
|
1320
1332
|
handler(message);
|
|
1321
1333
|
} catch (err) {
|
|
1322
|
-
console.warn("[
|
|
1334
|
+
console.warn("[kiva-signin] host navigation handler threw:", err);
|
|
1323
1335
|
}
|
|
1324
1336
|
}
|
|
1325
1337
|
});
|
|
@@ -1328,7 +1340,7 @@ var AuthManager = class {
|
|
|
1328
1340
|
try {
|
|
1329
1341
|
handler(notification);
|
|
1330
1342
|
} catch (err) {
|
|
1331
|
-
console.warn("[
|
|
1343
|
+
console.warn("[kiva-signin] host notification handler threw:", err);
|
|
1332
1344
|
}
|
|
1333
1345
|
}
|
|
1334
1346
|
});
|
|
@@ -1927,8 +1939,8 @@ function hasPermission(user, operation, scope, config) {
|
|
|
1927
1939
|
}
|
|
1928
1940
|
return getAllowedOperations(user, resolved).includes(operation);
|
|
1929
1941
|
}
|
|
1930
|
-
var
|
|
1931
|
-
function
|
|
1942
|
+
var KivaAuthContext = createContext(null);
|
|
1943
|
+
function KivaAuthProvider({
|
|
1932
1944
|
children,
|
|
1933
1945
|
renderAuthError,
|
|
1934
1946
|
...config
|
|
@@ -2101,31 +2113,31 @@ function DocyrusAuthProvider({
|
|
|
2101
2113
|
if (status === "error" && error) {
|
|
2102
2114
|
content = renderAuthError ? renderAuthError(error) : /* @__PURE__ */ jsx("p", { role: "alert", children: UNTRUSTED_BACKEND_MESSAGE });
|
|
2103
2115
|
}
|
|
2104
|
-
return /* @__PURE__ */ jsx(
|
|
2116
|
+
return /* @__PURE__ */ jsx(KivaAuthContext, { value, children: content });
|
|
2105
2117
|
}
|
|
2106
|
-
function
|
|
2107
|
-
const context = use(
|
|
2118
|
+
function useKivaAuth() {
|
|
2119
|
+
const context = use(KivaAuthContext);
|
|
2108
2120
|
if (!context) {
|
|
2109
2121
|
throw new Error(
|
|
2110
|
-
"
|
|
2122
|
+
"useKivaAuth must be used within a <KivaAuthProvider>. Wrap your app with <KivaAuthProvider> to provide auth context."
|
|
2111
2123
|
);
|
|
2112
2124
|
}
|
|
2113
2125
|
return context;
|
|
2114
2126
|
}
|
|
2115
2127
|
|
|
2116
|
-
// src/hooks/use-
|
|
2117
|
-
function
|
|
2118
|
-
const { client } =
|
|
2128
|
+
// src/hooks/use-kiva-client.ts
|
|
2129
|
+
function useKivaClient() {
|
|
2130
|
+
const { client } = useKivaAuth();
|
|
2119
2131
|
return client;
|
|
2120
2132
|
}
|
|
2121
|
-
function
|
|
2122
|
-
const { enableHostRouteSync } =
|
|
2133
|
+
function useKivaHostRouteSync() {
|
|
2134
|
+
const { enableHostRouteSync } = useKivaAuth();
|
|
2123
2135
|
useEffect(() => {
|
|
2124
2136
|
enableHostRouteSync();
|
|
2125
2137
|
}, [enableHostRouteSync]);
|
|
2126
2138
|
}
|
|
2127
|
-
function
|
|
2128
|
-
const { onHostNavigation } =
|
|
2139
|
+
function useKivaHostNavigation(handler) {
|
|
2140
|
+
const { onHostNavigation } = useKivaAuth();
|
|
2129
2141
|
const handlerRef = useRef(handler);
|
|
2130
2142
|
handlerRef.current = handler;
|
|
2131
2143
|
useEffect(() => {
|
|
@@ -2134,8 +2146,8 @@ function useDocyrusHostNavigation(handler) {
|
|
|
2134
2146
|
});
|
|
2135
2147
|
}, [onHostNavigation]);
|
|
2136
2148
|
}
|
|
2137
|
-
function
|
|
2138
|
-
const { onHostNotification } =
|
|
2149
|
+
function useKivaHostNotification(handler) {
|
|
2150
|
+
const { onHostNotification } = useKivaAuth();
|
|
2139
2151
|
const handlerRef = useRef(handler);
|
|
2140
2152
|
handlerRef.current = handler;
|
|
2141
2153
|
useEffect(() => {
|
|
@@ -2144,54 +2156,55 @@ function useDocyrusHostNotification(handler) {
|
|
|
2144
2156
|
});
|
|
2145
2157
|
}, [onHostNotification]);
|
|
2146
2158
|
}
|
|
2147
|
-
function
|
|
2148
|
-
const { requestHostNavigation } =
|
|
2159
|
+
function useKivaRequestHostNavigation() {
|
|
2160
|
+
const { requestHostNavigation } = useKivaAuth();
|
|
2149
2161
|
return requestHostNavigation;
|
|
2150
2162
|
}
|
|
2151
|
-
function
|
|
2152
|
-
const { setGuidyRoutes } =
|
|
2163
|
+
function useKivaGuidyRoutes(routes) {
|
|
2164
|
+
const { setGuidyRoutes } = useKivaAuth();
|
|
2153
2165
|
useEffect(() => {
|
|
2154
2166
|
setGuidyRoutes(routes);
|
|
2155
2167
|
}, [setGuidyRoutes, routes]);
|
|
2156
2168
|
}
|
|
2157
|
-
function
|
|
2158
|
-
const { sendToDocy } =
|
|
2169
|
+
function useKivaSendToDocy() {
|
|
2170
|
+
const { sendToDocy } = useKivaAuth();
|
|
2159
2171
|
return sendToDocy;
|
|
2160
2172
|
}
|
|
2161
|
-
function
|
|
2162
|
-
const { sendToChat } =
|
|
2173
|
+
function useKivaSendToChat() {
|
|
2174
|
+
const { sendToChat } = useKivaAuth();
|
|
2163
2175
|
return sendToChat;
|
|
2164
2176
|
}
|
|
2165
|
-
function
|
|
2166
|
-
const { sendToEmail } =
|
|
2177
|
+
function useKivaSendToEmail() {
|
|
2178
|
+
const { sendToEmail } = useKivaAuth();
|
|
2167
2179
|
return sendToEmail;
|
|
2168
2180
|
}
|
|
2169
|
-
function
|
|
2170
|
-
const { sendToCalendar } =
|
|
2181
|
+
function useKivaSendToCalendar() {
|
|
2182
|
+
const { sendToCalendar } = useKivaAuth();
|
|
2171
2183
|
return sendToCalendar;
|
|
2172
2184
|
}
|
|
2173
|
-
function
|
|
2174
|
-
const { msGraph } =
|
|
2185
|
+
function useKivaMsGraph() {
|
|
2186
|
+
const { msGraph } = useKivaAuth();
|
|
2175
2187
|
return msGraph;
|
|
2176
2188
|
}
|
|
2177
2189
|
var ICON_SIZE = 20;
|
|
2178
|
-
|
|
2179
|
-
|
|
2190
|
+
var MARK_VIEW_BOX = "0 0 1914 1145";
|
|
2191
|
+
var MARK_TRANSFORM = "matrix(1 0 0 -1 0 1145)";
|
|
2192
|
+
var MARK_PATH = "M338 1144 c-3 -1 -8 -3 -10 -4 -11 -6 -9 -3 -106 -169 -49 -86 -92 -159 -94 -163 -3 -4 -11 -18 -19 -31 -36 -65 -91 -162 -97 -171 -10 -16 -11 -20 -11 -33 0 -14 1 -19 11 -35 4 -6 17 -28 29 -49 12 -21 38 -67 58 -101 20 -34 76 -131 124 -215 49 -84 90 -155 92 -157 4 -6 11 -11 19 -14 l6 -2 151 0 150 1 3 3 c4 4 4 11 0 17 -3 5 -274 474 -276 479 -1 1 -11 19 -22 38 l-21 36 157 270 c86 148 158 272 160 276 7 11 6 20 -2 24 -4 2 -295 2 -302 0z M744 1144 c-1 -1 -4 -4 -5 -7 -2 -3 -35 -60 -75 -127 -48 -82 -71 -124 -73 -128 -2 -8 -1 -22 2 -31 1 -4 46 -82 102 -179 55 -94 163 -280 240 -413 99 -171 141 -243 145 -247 3 -4 7 -6 11 -8 l7 -3 151 -1 c132 0 152 0 157 1 7 3 16 9 21 18 12 17 471 810 482 832 3 7 4 8 4 16 0 5 0 10 -1 12 -2 5 -148 259 -151 262 -5 6 -12 5 -18 -3 -2 -2 -69 -119 -151 -259 -81 -141 -149 -257 -150 -258 -1 -2 -10 -17 -19 -34 -10 -17 -33 -58 -52 -91 -19 -33 -50 -86 -69 -119 -54 -93 -51 -88 -52 -87 -1 1 -10 18 -21 37 -11 19 -20 35 -20 34 -1 0 -108 185 -123 214 -7 13 -16 28 -19 33 -2 5 -72 125 -154 267 -83 141 -151 259 -153 261 -2 4 -9 9 -12 9 -1 0 -3 -1 -4 -1z";
|
|
2193
|
+
var MARK_ACCENT_PATH = "M307 544 c-45 -78 -135 -234 -141 -244 -1 -2 -2 -3 -2 -3 1 0 3 3 5 7 7 11 29 42 40 56 49 64 101 111 147 134 l12 6 -9 16 c-21 35 -33 57 -34 57 0 1 -8 -13 -18 -29z M1209 339 c-1 -24 -3 -39 -8 -64 -12 -56 -38 -126 -74 -198 -7 -15 -13 -27 -13 -27 1 0 32 54 69 120 56 96 69 119 67 119 0 1 -9 17 -20 36 -10 18 -19 34 -20 35 0 1 -1 -7 -1 -21z";
|
|
2194
|
+
function KivaLogo({ size = ICON_SIZE }) {
|
|
2195
|
+
return /* @__PURE__ */ jsxs(
|
|
2180
2196
|
"svg",
|
|
2181
2197
|
{
|
|
2182
2198
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2183
|
-
viewBox:
|
|
2199
|
+
viewBox: MARK_VIEW_BOX,
|
|
2184
2200
|
width: size,
|
|
2185
2201
|
height: size,
|
|
2186
2202
|
"aria-hidden": "true",
|
|
2187
2203
|
style: { display: "block", flexShrink: 0 },
|
|
2188
|
-
children:
|
|
2189
|
-
"path",
|
|
2190
|
-
{
|
|
2191
|
-
|
|
2192
|
-
d: "M768.11,531.68l-.24.21v101.17c0,26.8-21.79,48.63-48.59,48.63h-101.17c-8.72,0-16.82-2.33-23.88-6.35l-113.69,113.73c7.41,11.02,11.77,24.33,11.77,38.47,0,18.98-7.62,36.17-20.04,48.63-12.42,12.42-29.65,20.04-48.63,20.04s-36.2-7.62-48.63-20.04c-12.42-12.46-20.04-29.65-20.04-48.63,0-37.96,30.75-68.91,68.87-68.91,14.48,0,27.76,4.43,38.78,11.94l113.62-113.62c-4.19-7.1-6.55-15.31-6.55-24.09v-101.17c0-11.12,3.81-21.48,10.19-29.68l-93.72-127.52h-229.96V127.7h246.57v225.88l97.6,132.84c5.56-2.23,11.63-3.36,17.95-3.36h101.17c26.8,0,48.63,21.83,48.63,48.63Z"
|
|
2193
|
-
}
|
|
2194
|
-
)
|
|
2204
|
+
children: [
|
|
2205
|
+
/* @__PURE__ */ jsx("path", { fill: "#2887EB", transform: MARK_TRANSFORM, d: MARK_PATH }),
|
|
2206
|
+
/* @__PURE__ */ jsx("path", { fill: "#58595B", transform: MARK_TRANSFORM, d: MARK_ACCENT_PATH })
|
|
2207
|
+
]
|
|
2195
2208
|
}
|
|
2196
2209
|
);
|
|
2197
2210
|
}
|
|
@@ -2205,7 +2218,7 @@ function Spinner({ size = ICON_SIZE }) {
|
|
|
2205
2218
|
height: size,
|
|
2206
2219
|
fill: "none",
|
|
2207
2220
|
"aria-hidden": "true",
|
|
2208
|
-
style: { display: "block", flexShrink: 0, animation: "
|
|
2221
|
+
style: { display: "block", flexShrink: 0, animation: "kiva-spin 1s linear infinite" },
|
|
2209
2222
|
children: [
|
|
2210
2223
|
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "3", opacity: "0.25" }),
|
|
2211
2224
|
/* @__PURE__ */ jsx(
|
|
@@ -2217,19 +2230,19 @@ function Spinner({ size = ICON_SIZE }) {
|
|
|
2217
2230
|
strokeLinecap: "round"
|
|
2218
2231
|
}
|
|
2219
2232
|
),
|
|
2220
|
-
/* @__PURE__ */ jsx("style", { children: `@keyframes
|
|
2233
|
+
/* @__PURE__ */ jsx("style", { children: `@keyframes kiva-spin{to{transform:rotate(360deg)}}` })
|
|
2221
2234
|
]
|
|
2222
2235
|
}
|
|
2223
2236
|
);
|
|
2224
2237
|
}
|
|
2225
2238
|
function SignInButton({
|
|
2226
|
-
label = "Sign in with
|
|
2239
|
+
label = "Sign in with Kiva",
|
|
2227
2240
|
className,
|
|
2228
2241
|
style,
|
|
2229
2242
|
children,
|
|
2230
2243
|
disabled = false
|
|
2231
2244
|
}) {
|
|
2232
|
-
const { signIn, status, mode } =
|
|
2245
|
+
const { signIn, status, mode } = useKivaAuth();
|
|
2233
2246
|
const isLoading = status === "loading";
|
|
2234
2247
|
if (mode === "iframe") return null;
|
|
2235
2248
|
if (status === "authenticated") return null;
|
|
@@ -2251,13 +2264,29 @@ function SignInButton({
|
|
|
2251
2264
|
...style
|
|
2252
2265
|
},
|
|
2253
2266
|
children: [
|
|
2254
|
-
isLoading ? /* @__PURE__ */ jsx(Spinner, {}) : /* @__PURE__ */ jsx(
|
|
2267
|
+
isLoading ? /* @__PURE__ */ jsx(Spinner, {}) : /* @__PURE__ */ jsx(KivaLogo, {}),
|
|
2255
2268
|
/* @__PURE__ */ jsx("span", { children: label })
|
|
2256
2269
|
]
|
|
2257
2270
|
}
|
|
2258
2271
|
);
|
|
2259
2272
|
}
|
|
2260
2273
|
|
|
2261
|
-
|
|
2274
|
+
// src/deprecated-aliases.ts
|
|
2275
|
+
var DocyrusAuthProvider = KivaAuthProvider;
|
|
2276
|
+
var DocyrusAuthContext = KivaAuthContext;
|
|
2277
|
+
var useDocyrusAuth = useKivaAuth;
|
|
2278
|
+
var useDocyrusClient = useKivaClient;
|
|
2279
|
+
var useDocyrusGuidyRoutes = useKivaGuidyRoutes;
|
|
2280
|
+
var useDocyrusHostNavigation = useKivaHostNavigation;
|
|
2281
|
+
var useDocyrusHostNotification = useKivaHostNotification;
|
|
2282
|
+
var useDocyrusHostRouteSync = useKivaHostRouteSync;
|
|
2283
|
+
var useDocyrusMsGraph = useKivaMsGraph;
|
|
2284
|
+
var useDocyrusRequestHostNavigation = useKivaRequestHostNavigation;
|
|
2285
|
+
var useDocyrusSendToCalendar = useKivaSendToCalendar;
|
|
2286
|
+
var useDocyrusSendToChat = useKivaSendToChat;
|
|
2287
|
+
var useDocyrusSendToDocy = useKivaSendToDocy;
|
|
2288
|
+
var useDocyrusSendToEmail = useKivaSendToEmail;
|
|
2289
|
+
|
|
2290
|
+
export { AuthManager, DEFAULT_API_URL, DEFAULT_CALLBACK_PATH, DEFAULT_OAUTH_SCOPES, DEFAULT_SSR_COOKIE_KEY, DocyrusAuthContext, DocyrusAuthProvider, GuidyBridge, IframeAuth, KivaAuthContext, KivaAuthProvider, MsGraphClient, SignInButton, StandaloneOAuth2Auth, clearTokenCookie, detectAuthMode, getAllRoles, getAllowedOperations, getTokenFromCookie, hasPermission, hasRole, syncTokenToCookie, useDocyrusAuth, useDocyrusClient, useDocyrusGuidyRoutes, useDocyrusHostNavigation, useDocyrusHostNotification, useDocyrusHostRouteSync, useDocyrusMsGraph, useDocyrusRequestHostNavigation, useDocyrusSendToCalendar, useDocyrusSendToChat, useDocyrusSendToDocy, useDocyrusSendToEmail, useKivaAuth, useKivaClient, useKivaGuidyRoutes, useKivaHostNavigation, useKivaHostNotification, useKivaHostRouteSync, useKivaMsGraph, useKivaRequestHostNavigation, useKivaSendToCalendar, useKivaSendToChat, useKivaSendToDocy, useKivaSendToEmail };
|
|
2262
2291
|
//# sourceMappingURL=index.js.map
|
|
2263
2292
|
//# sourceMappingURL=index.js.map
|