@apicurio/common-ui-components 2.1.0 → 2.1.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/dist/auth/AuthConfigContext.d.ts +22 -0
- package/dist/main.js +79 -79
- package/package.json +1 -1
|
@@ -26,6 +26,28 @@ export interface OidcAuthOptions {
|
|
|
26
26
|
* @default 300000 (5 minutes)
|
|
27
27
|
*/
|
|
28
28
|
stateMaxAge?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Custom redirect handler for client-side navigation after OIDC authentication.
|
|
31
|
+
* This allows React Router or other routing libraries to handle navigation
|
|
32
|
+
* without causing a full page refresh.
|
|
33
|
+
*
|
|
34
|
+
* If not provided, defaults to `window.location.href = location` which causes
|
|
35
|
+
* a full page reload.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* // With React Router v6
|
|
39
|
+
* import { useNavigate } from 'react-router-dom';
|
|
40
|
+
*
|
|
41
|
+
* const navigate = useNavigate();
|
|
42
|
+
* const authConfig = {
|
|
43
|
+
* type: "oidc",
|
|
44
|
+
* options: {
|
|
45
|
+
* // ... other options
|
|
46
|
+
* onRedirect: (location) => navigate(location)
|
|
47
|
+
* }
|
|
48
|
+
* };
|
|
49
|
+
*/
|
|
50
|
+
onRedirect?: (location: string) => void;
|
|
29
51
|
}
|
|
30
52
|
export interface AuthConfig {
|
|
31
53
|
type: "none" | "basic" | "oidc";
|
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import F, { createContext as ut, useContext as _t, useState as T, useEffect as pe, memo as Re, forwardRef as ne, useCallback as De, useMemo as qe } from "react";
|
|
2
2
|
import { jsx as a, jsxs as v, Fragment as Ue } from "react/jsx-runtime";
|
|
3
3
|
import { useInterval as pt, Tooltip as ft, EmptyState as oe, EmptyStateVariant as wt, EmptyStateHeader as ae, EmptyStateBody as Se, Spinner as te, Alert as mt, Dropdown as vt, MenuToggle as Be, DropdownList as St, Divider as Ke, DropdownItem as yt, Select as bt, SelectOption as kt, TextInput as ce, Button as le, TextArea as Tt, AboutModal as It, TextContent as Et, Text as $e, TextVariants as Le, TextList as je, TextListItem as b, Modal as Ae, Form as ze, FormGroup as He, Progress as Ct, EmptyStateIcon as Ve, ChipGroup as Pt, Chip as Rt, InputGroup as Ut, ButtonVariant as At, Pagination as xt, PaginationVariant as Ot, Skeleton as Nt } from "@patternfly/react-core";
|
|
4
4
|
import { EllipsisVIcon as Dt, ChevronDownIcon as qt, ChevronRightIcon as $t, ErrorCircleOIcon as Lt, SearchIcon as jt } from "@patternfly/react-icons";
|
|
@@ -65,39 +65,39 @@ var Qt = {
|
|
|
65
65
|
},
|
|
66
66
|
error: () => {
|
|
67
67
|
}
|
|
68
|
-
},
|
|
68
|
+
}, j, H, he = /* @__PURE__ */ ((e) => (e[e.NONE = 0] = "NONE", e[e.ERROR = 1] = "ERROR", e[e.WARN = 2] = "WARN", e[e.INFO = 3] = "INFO", e[e.DEBUG = 4] = "DEBUG", e))(he || {});
|
|
69
69
|
((e) => {
|
|
70
70
|
function t() {
|
|
71
|
-
|
|
71
|
+
j = 3, H = Qt;
|
|
72
72
|
}
|
|
73
73
|
e.reset = t;
|
|
74
74
|
function s(r) {
|
|
75
75
|
if (!(0 <= r && r <= 4))
|
|
76
76
|
throw new Error("Invalid log level");
|
|
77
|
-
|
|
77
|
+
j = r;
|
|
78
78
|
}
|
|
79
79
|
e.setLevel = s;
|
|
80
80
|
function i(r) {
|
|
81
|
-
|
|
81
|
+
H = r;
|
|
82
82
|
}
|
|
83
83
|
e.setLogger = i;
|
|
84
84
|
})(he || (he = {}));
|
|
85
|
-
var p = class
|
|
85
|
+
var p = class $ {
|
|
86
86
|
constructor(t) {
|
|
87
87
|
this._name = t;
|
|
88
88
|
}
|
|
89
89
|
/* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */
|
|
90
90
|
debug(...t) {
|
|
91
|
-
|
|
91
|
+
j >= 4 && H.debug($._format(this._name, this._method), ...t);
|
|
92
92
|
}
|
|
93
93
|
info(...t) {
|
|
94
|
-
|
|
94
|
+
j >= 3 && H.info($._format(this._name, this._method), ...t);
|
|
95
95
|
}
|
|
96
96
|
warn(...t) {
|
|
97
|
-
|
|
97
|
+
j >= 2 && H.warn($._format(this._name, this._method), ...t);
|
|
98
98
|
}
|
|
99
99
|
error(...t) {
|
|
100
|
-
|
|
100
|
+
j >= 1 && H.error($._format(this._name, this._method), ...t);
|
|
101
101
|
}
|
|
102
102
|
/* eslint-enable @typescript-eslint/no-unsafe-enum-comparison */
|
|
103
103
|
throw(t) {
|
|
@@ -108,7 +108,7 @@ var p = class q {
|
|
|
108
108
|
return s._method = t, s.debug("begin"), s;
|
|
109
109
|
}
|
|
110
110
|
static createStatic(t, s) {
|
|
111
|
-
const i = new
|
|
111
|
+
const i = new $(`${t}.${s}`);
|
|
112
112
|
return i.debug("begin"), i;
|
|
113
113
|
}
|
|
114
114
|
static _format(t, s) {
|
|
@@ -118,16 +118,16 @@ var p = class q {
|
|
|
118
118
|
/* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */
|
|
119
119
|
// helpers for static class methods
|
|
120
120
|
static debug(t, ...s) {
|
|
121
|
-
|
|
121
|
+
j >= 4 && H.debug($._format(t), ...s);
|
|
122
122
|
}
|
|
123
123
|
static info(t, ...s) {
|
|
124
|
-
|
|
124
|
+
j >= 3 && H.info($._format(t), ...s);
|
|
125
125
|
}
|
|
126
126
|
static warn(t, ...s) {
|
|
127
|
-
|
|
127
|
+
j >= 2 && H.warn($._format(t), ...s);
|
|
128
128
|
}
|
|
129
129
|
static error(t, ...s) {
|
|
130
|
-
|
|
130
|
+
j >= 1 && H.error($._format(t), ...s);
|
|
131
131
|
}
|
|
132
132
|
/* eslint-enable @typescript-eslint/no-unsafe-enum-comparison */
|
|
133
133
|
};
|
|
@@ -152,7 +152,7 @@ var ge = class {
|
|
|
152
152
|
), c = C.encodeBase64Url(new Uint8Array(o));
|
|
153
153
|
return `${n}.${c}`;
|
|
154
154
|
}
|
|
155
|
-
}, Xt = "10000000-1000-4000-8000-100000000000", ye = (e) => btoa([...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")), Ge = class
|
|
155
|
+
}, Xt = "10000000-1000-4000-8000-100000000000", ye = (e) => btoa([...new Uint8Array(e)].map((t) => String.fromCharCode(t)).join("")), Ge = class L {
|
|
156
156
|
static _randomWord() {
|
|
157
157
|
const t = new Uint32Array(1);
|
|
158
158
|
return crypto.getRandomValues(t), t[0];
|
|
@@ -163,14 +163,14 @@ var ge = class {
|
|
|
163
163
|
static generateUUIDv4() {
|
|
164
164
|
return Xt.replace(
|
|
165
165
|
/[018]/g,
|
|
166
|
-
(s) => (+s ^
|
|
166
|
+
(s) => (+s ^ L._randomWord() & 15 >> +s / 4).toString(16)
|
|
167
167
|
).replace(/-/g, "");
|
|
168
168
|
}
|
|
169
169
|
/**
|
|
170
170
|
* PKCE: Generate a code verifier
|
|
171
171
|
*/
|
|
172
172
|
static generateCodeVerifier() {
|
|
173
|
-
return
|
|
173
|
+
return L.generateUUIDv4() + L.generateUUIDv4() + L.generateUUIDv4();
|
|
174
174
|
}
|
|
175
175
|
/**
|
|
176
176
|
* PKCE: Generate a code challenge
|
|
@@ -239,8 +239,8 @@ var ge = class {
|
|
|
239
239
|
default:
|
|
240
240
|
throw new Error("Unknown jwk type");
|
|
241
241
|
}
|
|
242
|
-
const i = await
|
|
243
|
-
return
|
|
242
|
+
const i = await L.hash("SHA-256", JSON.stringify(s));
|
|
243
|
+
return L.encodeBase64Url(i);
|
|
244
244
|
}
|
|
245
245
|
static async generateDPoPProof({
|
|
246
246
|
url: t,
|
|
@@ -256,7 +256,7 @@ var ge = class {
|
|
|
256
256
|
htu: t,
|
|
257
257
|
iat: Math.floor(Date.now() / 1e3)
|
|
258
258
|
};
|
|
259
|
-
s && (o = await
|
|
259
|
+
s && (o = await L.hash("SHA-256", s), c = L.encodeBase64Url(o), l.ath = c), n && (l.nonce = n);
|
|
260
260
|
try {
|
|
261
261
|
const d = await crypto.subtle.exportKey("jwk", r.publicKey), h = {
|
|
262
262
|
alg: "ES256",
|
|
@@ -276,7 +276,7 @@ var ge = class {
|
|
|
276
276
|
static async generateDPoPJkt(t) {
|
|
277
277
|
try {
|
|
278
278
|
const s = await crypto.subtle.exportKey("jwk", t.publicKey);
|
|
279
|
-
return await
|
|
279
|
+
return await L.customCalculateJwkThumbprint(s);
|
|
280
280
|
} catch (s) {
|
|
281
281
|
throw s instanceof TypeError ? new Error(`Could not retrieve dpop keys from storage: ${s.message}`) : s;
|
|
282
282
|
}
|
|
@@ -692,10 +692,10 @@ var C = Ge, J = class {
|
|
|
692
692
|
ui_locales: k,
|
|
693
693
|
acr_values: x,
|
|
694
694
|
resource: I,
|
|
695
|
-
response_mode:
|
|
695
|
+
response_mode: D,
|
|
696
696
|
// behavior flags
|
|
697
697
|
filterProtocolClaims: P = !0,
|
|
698
|
-
loadUserInfo:
|
|
698
|
+
loadUserInfo: M = !1,
|
|
699
699
|
requestTimeoutInSeconds: R,
|
|
700
700
|
staleStateAgeInSeconds: w = rs,
|
|
701
701
|
mergeClaimsStrategy: E = { array: "replace" },
|
|
@@ -706,20 +706,20 @@ var C = Ge, J = class {
|
|
|
706
706
|
fetchRequestCredentials: f,
|
|
707
707
|
refreshTokenAllowedScope: m,
|
|
708
708
|
// extra
|
|
709
|
-
extraQueryParams:
|
|
709
|
+
extraQueryParams: q = {},
|
|
710
710
|
extraTokenParams: B = {},
|
|
711
711
|
extraHeaders: K = {},
|
|
712
712
|
dpop: X,
|
|
713
713
|
omitScopeWhenRequesting: we = !1
|
|
714
714
|
}) {
|
|
715
715
|
var Y;
|
|
716
|
-
if (this.authority = e, t ? this.metadataUrl = t : (this.metadataUrl = e, e && (this.metadataUrl.endsWith("/") || (this.metadataUrl += "/"), this.metadataUrl += ".well-known/openid-configuration")), this.metadata = s, this.metadataSeed = r, this.signingKeys = i, this.client_id = n, this.client_secret = o, this.response_type = c, this.scope = l, this.redirect_uri = d, this.post_logout_redirect_uri = h, this.client_authentication = g, this.prompt = _, this.display = S, this.max_age = A, this.ui_locales = k, this.acr_values = x, this.resource = I, this.response_mode =
|
|
716
|
+
if (this.authority = e, t ? this.metadataUrl = t : (this.metadataUrl = e, e && (this.metadataUrl.endsWith("/") || (this.metadataUrl += "/"), this.metadataUrl += ".well-known/openid-configuration")), this.metadata = s, this.metadataSeed = r, this.signingKeys = i, this.client_id = n, this.client_secret = o, this.response_type = c, this.scope = l, this.redirect_uri = d, this.post_logout_redirect_uri = h, this.client_authentication = g, this.prompt = _, this.display = S, this.max_age = A, this.ui_locales = k, this.acr_values = x, this.resource = I, this.response_mode = D, this.filterProtocolClaims = P ?? !0, this.loadUserInfo = !!M, this.staleStateAgeInSeconds = w, this.mergeClaimsStrategy = E, this.omitScopeWhenRequesting = we, this.disablePKCE = !!U, this.revokeTokenAdditionalContentTypes = V, this.fetchRequestCredentials = f || "same-origin", this.requestTimeoutInSeconds = R, y)
|
|
717
717
|
this.stateStore = y;
|
|
718
718
|
else {
|
|
719
719
|
const se = typeof window < "u" ? window.localStorage : new Qe();
|
|
720
720
|
this.stateStore = new Xe({ store: se });
|
|
721
721
|
}
|
|
722
|
-
if (this.refreshTokenAllowedScope = m, this.extraQueryParams =
|
|
722
|
+
if (this.refreshTokenAllowedScope = m, this.extraQueryParams = q, this.extraTokenParams = B, this.extraHeaders = K, this.dpop = X, this.dpop && !((Y = this.dpop) != null && Y.store))
|
|
723
723
|
throw new Error("A DPoPStore is required when dpop is enabled");
|
|
724
724
|
}
|
|
725
725
|
}, ns = class {
|
|
@@ -1044,9 +1044,9 @@ var C = Ge, J = class {
|
|
|
1044
1044
|
extraQueryParams: k,
|
|
1045
1045
|
extraTokenParams: x,
|
|
1046
1046
|
disablePKCE: I,
|
|
1047
|
-
dpopJkt:
|
|
1047
|
+
dpopJkt: D,
|
|
1048
1048
|
omitScopeWhenRequesting: P,
|
|
1049
|
-
...
|
|
1049
|
+
...M
|
|
1050
1050
|
}) {
|
|
1051
1051
|
if (!t)
|
|
1052
1052
|
throw this._logger.error("create: No url passed"), new Error("url");
|
|
@@ -1074,10 +1074,10 @@ var C = Ge, J = class {
|
|
|
1074
1074
|
extraTokenParams: x,
|
|
1075
1075
|
skipUserInfo: A
|
|
1076
1076
|
}), w = new URL(t);
|
|
1077
|
-
w.searchParams.append("client_id", i), w.searchParams.append("redirect_uri", r), w.searchParams.append("response_type", n), P || w.searchParams.append("scope", o), g && w.searchParams.append("nonce", g),
|
|
1077
|
+
w.searchParams.append("client_id", i), w.searchParams.append("redirect_uri", r), w.searchParams.append("response_type", n), P || w.searchParams.append("scope", o), g && w.searchParams.append("nonce", g), D && w.searchParams.append("dpop_jkt", D);
|
|
1078
1078
|
let E = R.id;
|
|
1079
1079
|
_ && (E = `${E}${G}${_}`), w.searchParams.append("state", E), R.code_challenge && (w.searchParams.append("code_challenge", R.code_challenge), w.searchParams.append("code_challenge_method", "S256")), S && (Array.isArray(S) ? S : [S]).forEach((y) => w.searchParams.append("resource", y));
|
|
1080
|
-
for (const [U, y] of Object.entries({ response_mode: l, ...
|
|
1080
|
+
for (const [U, y] of Object.entries({ response_mode: l, ...M, ...k }))
|
|
1081
1081
|
y != null && w.searchParams.append(U, y.toString());
|
|
1082
1082
|
return new tt({
|
|
1083
1083
|
url: w.href,
|
|
@@ -1203,9 +1203,9 @@ var as = et, cs = "openid", me = class {
|
|
|
1203
1203
|
ui_locales: k = this.settings.ui_locales,
|
|
1204
1204
|
acr_values: x = this.settings.acr_values,
|
|
1205
1205
|
resource: I = this.settings.resource,
|
|
1206
|
-
response_mode:
|
|
1206
|
+
response_mode: D = this.settings.response_mode,
|
|
1207
1207
|
extraQueryParams: P = this.settings.extraQueryParams,
|
|
1208
|
-
extraTokenParams:
|
|
1208
|
+
extraTokenParams: M = this.settings.extraTokenParams,
|
|
1209
1209
|
dpopJkt: R,
|
|
1210
1210
|
omitScopeWhenRequesting: w = this.settings.omitScopeWhenRequesting
|
|
1211
1211
|
}) {
|
|
@@ -1235,9 +1235,9 @@ var as = et, cs = "openid", me = class {
|
|
|
1235
1235
|
request: t,
|
|
1236
1236
|
request_uri: s,
|
|
1237
1237
|
extraQueryParams: P,
|
|
1238
|
-
extraTokenParams:
|
|
1238
|
+
extraTokenParams: M,
|
|
1239
1239
|
request_type: i,
|
|
1240
|
-
response_mode:
|
|
1240
|
+
response_mode: D,
|
|
1241
1241
|
client_secret: this.settings.client_secret,
|
|
1242
1242
|
skipUserInfo: o,
|
|
1243
1243
|
nonce: c,
|
|
@@ -1593,15 +1593,15 @@ var as = et, cs = "openid", me = class {
|
|
|
1593
1593
|
monitorSession: k = !1,
|
|
1594
1594
|
monitorAnonymousSession: x = !1,
|
|
1595
1595
|
checkSessionIntervalInSeconds: I = ws,
|
|
1596
|
-
query_status_response_type:
|
|
1596
|
+
query_status_response_type: D = "code",
|
|
1597
1597
|
stopCheckSessionOnError: P = !0,
|
|
1598
|
-
revokeTokenTypes:
|
|
1598
|
+
revokeTokenTypes: M = ["access_token", "refresh_token"],
|
|
1599
1599
|
revokeTokensOnSignout: R = !1,
|
|
1600
1600
|
includeIdTokenInSilentSignout: w = !1,
|
|
1601
1601
|
accessTokenExpiringNotificationTimeInSeconds: E = fs,
|
|
1602
1602
|
userStore: U
|
|
1603
1603
|
} = e;
|
|
1604
|
-
if (super(e), this.popup_redirect_uri = t, this.popup_post_logout_redirect_uri = s, this.popupWindowFeatures = i, this.popupWindowTarget = r, this.redirectMethod = n, this.redirectTarget = o, this.iframeNotifyParentOrigin = c, this.iframeScriptOrigin = l, this.silent_redirect_uri = h, this.silentRequestTimeoutInSeconds = g || d || at, this.automaticSilentRenew = _, this.validateSubOnSilentRenew = S, this.includeIdTokenInSilentRenew = A, this.monitorSession = k, this.monitorAnonymousSession = x, this.checkSessionIntervalInSeconds = I, this.stopCheckSessionOnError = P, this.query_status_response_type =
|
|
1604
|
+
if (super(e), this.popup_redirect_uri = t, this.popup_post_logout_redirect_uri = s, this.popupWindowFeatures = i, this.popupWindowTarget = r, this.redirectMethod = n, this.redirectTarget = o, this.iframeNotifyParentOrigin = c, this.iframeScriptOrigin = l, this.silent_redirect_uri = h, this.silentRequestTimeoutInSeconds = g || d || at, this.automaticSilentRenew = _, this.validateSubOnSilentRenew = S, this.includeIdTokenInSilentRenew = A, this.monitorSession = k, this.monitorAnonymousSession = x, this.checkSessionIntervalInSeconds = I, this.stopCheckSessionOnError = P, this.query_status_response_type = D, this.revokeTokenTypes = M, this.revokeTokensOnSignout = R, this.includeIdTokenInSilentSignout = w, this.accessTokenExpiringNotificationTimeInSeconds = E, U)
|
|
1605
1605
|
this.userStore = U;
|
|
1606
1606
|
else {
|
|
1607
1607
|
const y = typeof window < "u" ? window.sessionStorage : new Qe();
|
|
@@ -2380,7 +2380,7 @@ var as = et, cs = "openid", me = class {
|
|
|
2380
2380
|
return await C.generateDPoPJkt(t.keys);
|
|
2381
2381
|
}
|
|
2382
2382
|
};
|
|
2383
|
-
const Ps = ["url", "clientId", "redirectUri", "scope", "logoutUrl", "loadUserInfo", "useStateBasedRedirect", "stateMaxAge"], Rs = "openid profile email", fe = "apicurio.oidc.state.", Us = 3e5;
|
|
2383
|
+
const Ps = ["url", "clientId", "redirectUri", "scope", "logoutUrl", "loadUserInfo", "useStateBasedRedirect", "stateMaxAge", "onRedirect"], Rs = "openid profile email", fe = "apicurio.oidc.state.", Us = 3e5;
|
|
2384
2384
|
function As(e, t) {
|
|
2385
2385
|
const s = {};
|
|
2386
2386
|
return e.forEach((i) => {
|
|
@@ -2431,21 +2431,21 @@ function qs(e) {
|
|
|
2431
2431
|
function $s(e) {
|
|
2432
2432
|
return !e || e.trim() === "" ? !1 : !e.startsWith("/") || e.includes("://") ? (console.warn(`[Auth] Invalid redirect location (must be relative path): ${e}`), !1) : e.toLowerCase().startsWith("javascript:") ? (console.warn(`[Auth] Blocked potentially malicious redirect location: ${e}`), !1) : !0;
|
|
2433
2433
|
}
|
|
2434
|
-
let u,
|
|
2435
|
-
const Ls = (e) => (
|
|
2436
|
-
authority:
|
|
2437
|
-
client_id:
|
|
2438
|
-
redirect_uri:
|
|
2434
|
+
let u, O;
|
|
2435
|
+
const Ls = (e) => (O = As(Ps, e), new Cs({
|
|
2436
|
+
authority: O.url,
|
|
2437
|
+
client_id: O.clientId,
|
|
2438
|
+
redirect_uri: O.redirectUri,
|
|
2439
2439
|
response_type: "code",
|
|
2440
|
-
scope:
|
|
2440
|
+
scope: O.scope || Rs,
|
|
2441
2441
|
filterProtocolClaims: !0,
|
|
2442
2442
|
includeIdTokenInSilentRenew: !0,
|
|
2443
2443
|
includeIdTokenInSilentSignout: !0,
|
|
2444
|
-
loadUserInfo:
|
|
2444
|
+
loadUserInfo: O.loadUserInfo ?? !0
|
|
2445
2445
|
})), js = async () => {
|
|
2446
2446
|
try {
|
|
2447
2447
|
console.debug("[Auth] Logging in using OIDC");
|
|
2448
|
-
const e = new URL(window.location.href), t = await (u == null ? void 0 : u.getUser()), s =
|
|
2448
|
+
const e = new URL(window.location.href), t = await (u == null ? void 0 : u.getUser()), s = O.useStateBasedRedirect !== !1, i = O.stateMaxAge || Us;
|
|
2449
2449
|
if (s && qs(i), e.searchParams.get("state") || t) {
|
|
2450
2450
|
const r = await (u == null ? void 0 : u.signinRedirectCallback());
|
|
2451
2451
|
if (u == null || u.startSilentRenew(), console.debug("[Auth] Started silent token renewal"), s && (r != null && r.state)) {
|
|
@@ -2453,7 +2453,7 @@ const Ls = (e) => (M = As(Ps, e), new Cs({
|
|
|
2453
2453
|
if (n) {
|
|
2454
2454
|
const o = Ns(n);
|
|
2455
2455
|
if (Ds(n), o && $s(o)) {
|
|
2456
|
-
console.debug(`[Auth] Redirecting to stored location: ${o}`), window.location.href = o;
|
|
2456
|
+
console.debug(`[Auth] Redirecting to stored location: ${o}`), O.onRedirect ? O.onRedirect(o) : window.location.href = o;
|
|
2457
2457
|
return;
|
|
2458
2458
|
} else
|
|
2459
2459
|
console.debug("[Auth] No valid stored location found, staying at current page");
|
|
@@ -2479,7 +2479,7 @@ const Ls = (e) => (M = As(Ps, e), new Cs({
|
|
|
2479
2479
|
const e = await (u == null ? void 0 : u.getUser()), t = e == null ? void 0 : e.id_token;
|
|
2480
2480
|
return u == null ? void 0 : u.removeUser().then(() => u == null ? void 0 : u.signoutRedirect({
|
|
2481
2481
|
id_token_hint: t,
|
|
2482
|
-
post_logout_redirect_uri:
|
|
2482
|
+
post_logout_redirect_uri: O.logoutUrl || window.location.href
|
|
2483
2483
|
}));
|
|
2484
2484
|
}, Ms = async () => await (u == null ? void 0 : u.getUser()) != null, Ws = async () => {
|
|
2485
2485
|
const e = await (u == null ? void 0 : u.getUser());
|
|
@@ -2565,24 +2565,24 @@ const Ks = async (e, t) => {
|
|
|
2565
2565
|
return pe(() => {
|
|
2566
2566
|
o();
|
|
2567
2567
|
}, [e.date]), n === "fromNow" ? /* @__PURE__ */ a(ft, { content: /* @__PURE__ */ a("span", { children: i }), children: /* @__PURE__ */ a("span", { children: t }) }) : /* @__PURE__ */ a("span", { children: t });
|
|
2568
|
-
}, ci = (e) => /* @__PURE__ */ a(Ce, { date: e.date, format: "fromNow" }),
|
|
2568
|
+
}, ci = (e) => /* @__PURE__ */ a(Ce, { date: e.date, format: "fromNow" }), N = ({ condition: e, children: t }) => (typeof e == "boolean" ? e : e()) ? /* @__PURE__ */ a(F.Fragment, { children: t }) : /* @__PURE__ */ a(F.Fragment, {}), li = ({ collection: e, emptyState: t, emptyStateTitle: s, emptyStateMessage: i, children: r }) => {
|
|
2569
2569
|
const n = () => !e || e.length === 0, o = t || /* @__PURE__ */ v(oe, { variant: wt.xs, children: [
|
|
2570
2570
|
/* @__PURE__ */ a(ae, { titleText: s || "None found", headingLevel: "h4" }),
|
|
2571
2571
|
/* @__PURE__ */ a(Se, { children: i || "No items found." })
|
|
2572
2572
|
] });
|
|
2573
|
-
return n() ? /* @__PURE__ */ a(
|
|
2573
|
+
return n() ? /* @__PURE__ */ a(F.Fragment, { children: o }) : /* @__PURE__ */ a(F.Fragment, { children: r });
|
|
2574
2574
|
}, _e = ({ isLoading: e, loadingComponent: t, children: s }) => {
|
|
2575
2575
|
const i = () => typeof e == "boolean" ? e : e(), r = t || /* @__PURE__ */ a(te, {});
|
|
2576
|
-
return i() ? /* @__PURE__ */ a(
|
|
2576
|
+
return i() ? /* @__PURE__ */ a(F.Fragment, { children: r }) : /* @__PURE__ */ a(F.Fragment, { children: s });
|
|
2577
2577
|
}, di = ({ toolbar: e, alwaysShowToolbar: t, emptyState: s, filteredEmptyState: i, isLoading: r, isError: n, loadingComponent: o, errorComponent: c, isEmpty: l, isFiltered: d, children: h }) => {
|
|
2578
2578
|
const g = t || !l || d || n;
|
|
2579
|
-
return c || (c = /* @__PURE__ */ a("div", { style: { padding: "15px", backgroundColor: "white" }, children: /* @__PURE__ */ a(mt, { isInline: !0, variant: "danger", title: "Error: Something went wrong!", children: /* @__PURE__ */ a("p", { children: "Something went wrong with the action you attempted, but we're not sure what it was. Try reloading the page and hopef for a better result, or contact your admin to report the error." }) }) })), /* @__PURE__ */ v(
|
|
2580
|
-
/* @__PURE__ */ a(
|
|
2579
|
+
return c || (c = /* @__PURE__ */ a("div", { style: { padding: "15px", backgroundColor: "white" }, children: /* @__PURE__ */ a(mt, { isInline: !0, variant: "danger", title: "Error: Something went wrong!", children: /* @__PURE__ */ a("p", { children: "Something went wrong with the action you attempted, but we're not sure what it was. Try reloading the page and hopef for a better result, or contact your admin to report the error." }) }) })), /* @__PURE__ */ v(F.Fragment, { children: [
|
|
2580
|
+
/* @__PURE__ */ a(N, { condition: g, children: e }),
|
|
2581
2581
|
/* @__PURE__ */ v(_e, { isLoading: r, loadingComponent: o, children: [
|
|
2582
|
-
/* @__PURE__ */ a(
|
|
2583
|
-
/* @__PURE__ */ a(
|
|
2584
|
-
/* @__PURE__ */ a(
|
|
2585
|
-
/* @__PURE__ */ a(
|
|
2582
|
+
/* @__PURE__ */ a(N, { condition: !l && !n, children: h }),
|
|
2583
|
+
/* @__PURE__ */ a(N, { condition: l && d && !n, children: i }),
|
|
2584
|
+
/* @__PURE__ */ a(N, { condition: l && !d && !n, children: s }),
|
|
2585
|
+
/* @__PURE__ */ a(N, { condition: n, children: c })
|
|
2586
2586
|
] })
|
|
2587
2587
|
] });
|
|
2588
2588
|
}, hi = (e) => {
|
|
@@ -2599,7 +2599,7 @@ const Ks = async (e, t) => {
|
|
|
2599
2599
|
appendTo: e.menuAppendTo
|
|
2600
2600
|
};
|
|
2601
2601
|
let c = /* @__PURE__ */ a(Dt, { title: e.label });
|
|
2602
|
-
return e.isKebab || (c = /* @__PURE__ */ a(
|
|
2602
|
+
return e.isKebab || (c = /* @__PURE__ */ a(F.Fragment, { children: e.label })), /* @__PURE__ */ a(
|
|
2603
2603
|
vt,
|
|
2604
2604
|
{
|
|
2605
2605
|
isOpen: t,
|
|
@@ -2718,11 +2718,11 @@ const Ks = async (e, t) => {
|
|
|
2718
2718
|
/* @__PURE__ */ a("div", { className: "url-clear-button", children: /* @__PURE__ */ a(le, { "data-testid": `${e.testId}-clear`, variant: "control", isDisabled: !h(), onClick: S, children: "Clear" }) })
|
|
2719
2719
|
] }),
|
|
2720
2720
|
/* @__PURE__ */ a("div", { className: "url-upload-preview", children: /* @__PURE__ */ v(_e, { isLoading: n, loadingComponent: A, children: [
|
|
2721
|
-
/* @__PURE__ */ a(
|
|
2721
|
+
/* @__PURE__ */ a(N, { condition: g, children: /* @__PURE__ */ v("div", { className: "url-upload-error", style: Ys, children: [
|
|
2722
2722
|
/* @__PURE__ */ a("div", { children: "Error getting content from URL." }),
|
|
2723
2723
|
/* @__PURE__ */ a("div", { children: c })
|
|
2724
2724
|
] }) }),
|
|
2725
|
-
/* @__PURE__ */ a(
|
|
2725
|
+
/* @__PURE__ */ a(N, { condition: !g(), children: /* @__PURE__ */ a(
|
|
2726
2726
|
Tt,
|
|
2727
2727
|
{
|
|
2728
2728
|
"data-testid": `${e.testId}-preview`,
|
|
@@ -2903,23 +2903,23 @@ const Ks = async (e, t) => {
|
|
|
2903
2903
|
/* AUTHENTICATED */
|
|
2904
2904
|
);
|
|
2905
2905
|
}, []), /* @__PURE__ */ v(Ue, { children: [
|
|
2906
|
-
/* @__PURE__ */ a(
|
|
2906
|
+
/* @__PURE__ */ a(N, { condition: t === 0 && i.isOidcAuthEnabled(), children: /* @__PURE__ */ v(oe, { children: [
|
|
2907
2907
|
/* @__PURE__ */ a(ae, { titleText: "Loading", headingLevel: "h4" }),
|
|
2908
2908
|
/* @__PURE__ */ a(Se, { children: /* @__PURE__ */ a(te, { size: "xl", "aria-label": "Loading spinner" }) })
|
|
2909
2909
|
] }) }),
|
|
2910
|
-
/* @__PURE__ */ a(
|
|
2911
|
-
/* @__PURE__ */ a(
|
|
2910
|
+
/* @__PURE__ */ a(N, { condition: t === 0 && i.isBasicAuthEnabled(), children: /* @__PURE__ */ a(Zs, { onLogin: r }) }),
|
|
2911
|
+
/* @__PURE__ */ a(N, { condition: t === 2, children: /* @__PURE__ */ v(oe, { children: [
|
|
2912
2912
|
/* @__PURE__ */ a(ae, { titleText: "Empty state", headingLevel: "h4", icon: /* @__PURE__ */ a(Ve, { icon: Lt }) }),
|
|
2913
2913
|
/* @__PURE__ */ a(Se, { children: "Authentication failed." })
|
|
2914
2914
|
] }) }),
|
|
2915
|
-
/* @__PURE__ */ a(
|
|
2915
|
+
/* @__PURE__ */ a(N, { condition: t === 1, children: e.children })
|
|
2916
2916
|
] });
|
|
2917
2917
|
}, mi = (e) => {
|
|
2918
2918
|
const t = lt();
|
|
2919
2919
|
return (() => {
|
|
2920
2920
|
let i = !0;
|
|
2921
2921
|
return e.enabled !== void 0 && (i = i && (t.isOidcAuthEnabled() === e.enabled || t.isBasicAuthEnabled() === e.enabled)), i;
|
|
2922
|
-
})() ? /* @__PURE__ */ a(
|
|
2922
|
+
})() ? /* @__PURE__ */ a(F.Fragment, { children: e.children }) : /* @__PURE__ */ a(F.Fragment, {});
|
|
2923
2923
|
}, vi = (e) => /* @__PURE__ */ a(Pt, { categoryName: e.categoryName || "Filters", isClosable: !0, onClick: e.onClearAllCriteria, children: e.criteria.map((t, s) => /* @__PURE__ */ v(Rt, { onClick: () => e.onRemoveCriteria(t), children: [
|
|
2924
2924
|
/* @__PURE__ */ a("b", { children: t.filterBy.label }),
|
|
2925
2925
|
/* @__PURE__ */ a("span", { children: ": " }),
|
|
@@ -3032,17 +3032,17 @@ const ki = ({
|
|
|
3032
3032
|
children: k,
|
|
3033
3033
|
variant: x
|
|
3034
3034
|
}) => {
|
|
3035
|
-
const [I,
|
|
3035
|
+
const [I, D] = T(1e3);
|
|
3036
3036
|
let P;
|
|
3037
|
-
const
|
|
3037
|
+
const M = ({ width: f }) => {
|
|
3038
3038
|
P && cancelAnimationFrame(P), f && (P = requestAnimationFrame(() => {
|
|
3039
|
-
|
|
3039
|
+
D(f);
|
|
3040
3040
|
}));
|
|
3041
|
-
}, { ref: R } = Bt({ onResize:
|
|
3041
|
+
}, { ref: R } = Bt({ onResize: M }), w = I >= 576, E = De(
|
|
3042
3042
|
(f) => w && f !== 0 && f !== s.length - 1,
|
|
3043
3043
|
[s, w]
|
|
3044
3044
|
), U = qe(() => s.map((f, m) => {
|
|
3045
|
-
const
|
|
3045
|
+
const q = ne(
|
|
3046
3046
|
({ children: B, ...K }, X) => /* @__PURE__ */ a(
|
|
3047
3047
|
ht,
|
|
3048
3048
|
{
|
|
@@ -3057,8 +3057,8 @@ const ki = ({
|
|
|
3057
3057
|
}
|
|
3058
3058
|
)
|
|
3059
3059
|
);
|
|
3060
|
-
return
|
|
3061
|
-
Th:
|
|
3060
|
+
return q.displayName = "ResponsiveThCurried", r({
|
|
3061
|
+
Th: q,
|
|
3062
3062
|
key: `header_${f}`,
|
|
3063
3063
|
column: f,
|
|
3064
3064
|
colIndex: m
|
|
@@ -3073,7 +3073,7 @@ const ki = ({
|
|
|
3073
3073
|
]), y = De(
|
|
3074
3074
|
(f) => {
|
|
3075
3075
|
const m = ne(
|
|
3076
|
-
({ children:
|
|
3076
|
+
({ children: q, ...B }, K) => /* @__PURE__ */ a(
|
|
3077
3077
|
Pe,
|
|
3078
3078
|
{
|
|
3079
3079
|
position: f,
|
|
@@ -3082,7 +3082,7 @@ const ki = ({
|
|
|
3082
3082
|
canHide: E(f),
|
|
3083
3083
|
...B,
|
|
3084
3084
|
ref: K,
|
|
3085
|
-
children:
|
|
3085
|
+
children: q
|
|
3086
3086
|
}
|
|
3087
3087
|
)
|
|
3088
3088
|
);
|
|
@@ -3114,14 +3114,14 @@ const ki = ({
|
|
|
3114
3114
|
}
|
|
3115
3115
|
),
|
|
3116
3116
|
i == null ? void 0 : i.map((f, m) => {
|
|
3117
|
-
const
|
|
3117
|
+
const q = l !== void 0 && l({ row: f, rowIndex: m }), B = d !== void 0 && d({ row: f, rowIndex: m }), K = !q && g ? () => g({ row: f, rowIndex: m }) : void 0, X = s.map((Y, se) => n({
|
|
3118
3118
|
Td: V[se],
|
|
3119
3119
|
key: `row_${m}_cell_${Y}`,
|
|
3120
3120
|
column: Y,
|
|
3121
3121
|
colIndex: se,
|
|
3122
3122
|
rowIndex: m,
|
|
3123
3123
|
row: f
|
|
3124
|
-
})), we = !
|
|
3124
|
+
})), we = !q && o && /* @__PURE__ */ a(
|
|
3125
3125
|
Pe,
|
|
3126
3126
|
{
|
|
3127
3127
|
position: s.length,
|
|
@@ -3136,7 +3136,7 @@ const ki = ({
|
|
|
3136
3136
|
return /* @__PURE__ */ v(
|
|
3137
3137
|
gt,
|
|
3138
3138
|
{
|
|
3139
|
-
isDeleted:
|
|
3139
|
+
isDeleted: q,
|
|
3140
3140
|
isSelected: B,
|
|
3141
3141
|
onClick: K,
|
|
3142
3142
|
rowOuiaId: S == null ? void 0 : S({ row: f, rowIndex: m }),
|
|
@@ -3226,7 +3226,7 @@ export {
|
|
|
3226
3226
|
gt as DeletableRow,
|
|
3227
3227
|
vi as FilterChips,
|
|
3228
3228
|
ci as FromNow,
|
|
3229
|
-
|
|
3229
|
+
N as If,
|
|
3230
3230
|
mi as IfAuth,
|
|
3231
3231
|
li as IfNotEmpty,
|
|
3232
3232
|
_e as IfNotLoading,
|