@asgardeo/react 0.6.5 → 0.6.7
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/cjs/index.js +326 -140
- package/dist/cjs/index.js.map +4 -4
- package/dist/components/adapters/SelectInput.d.ts +24 -0
- package/dist/index.js +211 -23
- package/dist/index.js.map +4 -4
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -36,7 +36,7 @@ __export(index_exports, {
|
|
|
36
36
|
AlertTitle: () => AlertTitle,
|
|
37
37
|
AsgardeoContext: () => AsgardeoContext_default,
|
|
38
38
|
AsgardeoProvider: () => AsgardeoProvider_default,
|
|
39
|
-
AsgardeoRuntimeError: () =>
|
|
39
|
+
AsgardeoRuntimeError: () => import_browser77.AsgardeoRuntimeError,
|
|
40
40
|
BaseCreateOrganization: () => BaseCreateOrganization,
|
|
41
41
|
BaseOrganization: () => BaseOrganization_default,
|
|
42
42
|
BaseOrganizationList: () => BaseOrganizationList_default,
|
|
@@ -125,17 +125,17 @@ __export(index_exports, {
|
|
|
125
125
|
UsernamePassword: () => UsernamePassword_default,
|
|
126
126
|
createField: () => createField,
|
|
127
127
|
createOrganization: () => createOrganization_default,
|
|
128
|
-
createPatchOperations: () =>
|
|
128
|
+
createPatchOperations: () => import_browser76.createPatchOperations,
|
|
129
129
|
createSignInOption: () => createSignInOption,
|
|
130
130
|
createSignInOptionFromAuthenticator: () => createSignInOptionFromAuthenticator,
|
|
131
|
-
getActiveTheme: () =>
|
|
131
|
+
getActiveTheme: () => import_browser77.getActiveTheme,
|
|
132
132
|
getAllOrganizations: () => getAllOrganizations_default,
|
|
133
133
|
getMeOrganizations: () => getMeOrganizations_default,
|
|
134
134
|
getMeProfile: () => getScim2Me_default,
|
|
135
135
|
getOrganization: () => getOrganization_default,
|
|
136
136
|
getSchemas: () => getSchemas_default,
|
|
137
|
-
http: () =>
|
|
138
|
-
navigate: () =>
|
|
137
|
+
http: () => import_browser77.http,
|
|
138
|
+
navigate: () => import_browser77.navigate,
|
|
139
139
|
updateMeProfile: () => updateMeProfile_default,
|
|
140
140
|
updateOrganization: () => updateOrganization_default,
|
|
141
141
|
useAlertVariant: () => useAlertVariant,
|
|
@@ -856,12 +856,21 @@ var AsgardeoReactClient = class extends import_browser6.AsgardeoBrowserClient {
|
|
|
856
856
|
const arg1 = args[0];
|
|
857
857
|
const arg2 = args[1];
|
|
858
858
|
const config = await this.asgardeo.getConfigData();
|
|
859
|
-
|
|
860
|
-
|
|
859
|
+
const platformFromStorage = sessionStorage.getItem("asgardeo_platform");
|
|
860
|
+
const isV2Platform = config && config.platform === import_browser6.Platform.AsgardeoV2 || platformFromStorage === "AsgardeoV2";
|
|
861
|
+
if (isV2Platform && typeof arg1 === "object" && arg1 !== null && arg1.callOnlyOnRedirect === true) {
|
|
862
|
+
return void 0;
|
|
863
|
+
}
|
|
864
|
+
if (isV2Platform && typeof arg1 === "object" && arg1 !== null && !(0, import_browser6.isEmpty)(arg1) && ("flowId" in arg1 || "applicationId" in arg1)) {
|
|
865
|
+
const sessionDataKeyFromUrl = new URL(window.location.href).searchParams.get("sessionDataKey");
|
|
866
|
+
const sessionDataKeyFromStorage = sessionStorage.getItem("asgardeo_session_data_key");
|
|
867
|
+
const sessionDataKey = sessionDataKeyFromUrl || sessionDataKeyFromStorage;
|
|
868
|
+
const baseUrlFromStorage = sessionStorage.getItem("asgardeo_base_url");
|
|
869
|
+
const baseUrl = config?.baseUrl || baseUrlFromStorage;
|
|
861
870
|
return (0, import_browser6.executeEmbeddedSignInFlowV2)({
|
|
862
871
|
payload: arg1,
|
|
863
872
|
url: arg2?.url,
|
|
864
|
-
baseUrl
|
|
873
|
+
baseUrl,
|
|
865
874
|
sessionDataKey
|
|
866
875
|
});
|
|
867
876
|
}
|
|
@@ -1609,7 +1618,14 @@ var AsgardeoProvider = ({
|
|
|
1609
1618
|
(0, import_react15.useEffect)(() => {
|
|
1610
1619
|
(async () => {
|
|
1611
1620
|
await asgardeo.initialize(config);
|
|
1612
|
-
|
|
1621
|
+
const initializedConfig = await asgardeo.getConfiguration();
|
|
1622
|
+
setConfig(initializedConfig);
|
|
1623
|
+
if (initializedConfig?.platform) {
|
|
1624
|
+
sessionStorage.setItem("asgardeo_platform", initializedConfig.platform);
|
|
1625
|
+
}
|
|
1626
|
+
if (initializedConfig?.baseUrl) {
|
|
1627
|
+
sessionStorage.setItem("asgardeo_base_url", initializedConfig.baseUrl);
|
|
1628
|
+
}
|
|
1613
1629
|
})();
|
|
1614
1630
|
}, []);
|
|
1615
1631
|
(0, import_react15.useEffect)(() => {
|
|
@@ -1625,7 +1641,8 @@ var AsgardeoProvider = ({
|
|
|
1625
1641
|
}
|
|
1626
1642
|
const currentUrl = new URL(window.location.href);
|
|
1627
1643
|
const hasAuthParamsResult = hasAuthParams(currentUrl, afterSignInUrl);
|
|
1628
|
-
|
|
1644
|
+
const isV2Platform = config.platform === import_browser12.Platform.AsgardeoV2;
|
|
1645
|
+
if (hasAuthParamsResult && !isV2Platform) {
|
|
1629
1646
|
try {
|
|
1630
1647
|
await signIn(
|
|
1631
1648
|
{ callOnlyOnRedirect: true }
|
|
@@ -1780,19 +1797,28 @@ var AsgardeoProvider = ({
|
|
|
1780
1797
|
fetchBranding
|
|
1781
1798
|
]);
|
|
1782
1799
|
const signIn = async (...args) => {
|
|
1800
|
+
const arg1 = args[0];
|
|
1801
|
+
const isV2FlowRequest = config.platform === import_browser12.Platform.AsgardeoV2 && typeof arg1 === "object" && arg1 !== null && ("flowId" in arg1 || "applicationId" in arg1);
|
|
1783
1802
|
try {
|
|
1784
|
-
|
|
1785
|
-
|
|
1803
|
+
if (!isV2FlowRequest) {
|
|
1804
|
+
setIsUpdatingSession(true);
|
|
1805
|
+
setIsLoadingSync(true);
|
|
1806
|
+
}
|
|
1786
1807
|
const response = await asgardeo.signIn(...args);
|
|
1808
|
+
if (isV2FlowRequest || response && typeof response === "object" && "flowStatus" in response) {
|
|
1809
|
+
return response;
|
|
1810
|
+
}
|
|
1787
1811
|
if (await asgardeo.isSignedIn()) {
|
|
1788
1812
|
await updateSession();
|
|
1789
1813
|
}
|
|
1790
1814
|
return response;
|
|
1791
1815
|
} catch (error) {
|
|
1792
|
-
throw new Error(`Error while signing in: ${error}`);
|
|
1816
|
+
throw new Error(`Error while signing in: ${error instanceof Error ? error.message : String(error)}`);
|
|
1793
1817
|
} finally {
|
|
1794
|
-
|
|
1795
|
-
|
|
1818
|
+
if (!isV2FlowRequest) {
|
|
1819
|
+
setIsUpdatingSession(false);
|
|
1820
|
+
setIsLoadingSync(asgardeo.isLoading());
|
|
1821
|
+
}
|
|
1796
1822
|
}
|
|
1797
1823
|
};
|
|
1798
1824
|
const signInSilently = async (options) => {
|
|
@@ -7113,6 +7139,25 @@ var convertSimpleInputToComponent = (input, t) => {
|
|
|
7113
7139
|
if (input.name.toLowerCase().includes("password") && input.type.toLowerCase() === "string") {
|
|
7114
7140
|
fieldType = "password";
|
|
7115
7141
|
}
|
|
7142
|
+
if (input.type.toLowerCase() === "dropdown") {
|
|
7143
|
+
const label2 = getInputLabel(input.name, fieldType, t);
|
|
7144
|
+
const placeholder2 = getInputPlaceholder(input.name, fieldType, t);
|
|
7145
|
+
return {
|
|
7146
|
+
id: generateId("select"),
|
|
7147
|
+
type: import_browser47.EmbeddedFlowComponentType.Select,
|
|
7148
|
+
variant: "SELECT",
|
|
7149
|
+
config: {
|
|
7150
|
+
type: fieldType,
|
|
7151
|
+
label: label2,
|
|
7152
|
+
placeholder: placeholder2,
|
|
7153
|
+
required: input.required,
|
|
7154
|
+
identifier: input.name,
|
|
7155
|
+
hint: "",
|
|
7156
|
+
options: input.options || []
|
|
7157
|
+
},
|
|
7158
|
+
components: []
|
|
7159
|
+
};
|
|
7160
|
+
}
|
|
7116
7161
|
const variant = getInputVariant(fieldType, input.name);
|
|
7117
7162
|
const label = getInputLabel(input.name, fieldType, t);
|
|
7118
7163
|
const placeholder = getInputPlaceholder(input.name, fieldType, t);
|
|
@@ -7597,16 +7642,62 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7597
7642
|
const [flowError, setFlowError] = (0, import_react59.useState)(null);
|
|
7598
7643
|
const [isSubmitting, setIsSubmitting] = (0, import_react59.useState)(false);
|
|
7599
7644
|
const initializationAttemptedRef = (0, import_react59.useRef)(false);
|
|
7645
|
+
const oauthCodeProcessedRef = (0, import_react59.useRef)(false);
|
|
7646
|
+
const handleRedirection = (response) => {
|
|
7647
|
+
if (response.type === import_browser51.EmbeddedSignInFlowTypeV2.Redirection) {
|
|
7648
|
+
const redirectURL = response.data?.redirectURL || response?.redirectURL;
|
|
7649
|
+
if (redirectURL) {
|
|
7650
|
+
if (response.flowId) {
|
|
7651
|
+
sessionStorage.setItem("asgardeo_flow_id", response.flowId);
|
|
7652
|
+
}
|
|
7653
|
+
const urlParams = new URL(window.location.href).searchParams;
|
|
7654
|
+
const sessionDataKeyFromUrl = urlParams.get("sessionDataKey");
|
|
7655
|
+
if (sessionDataKeyFromUrl) {
|
|
7656
|
+
sessionStorage.setItem("asgardeo_session_data_key", sessionDataKeyFromUrl);
|
|
7657
|
+
}
|
|
7658
|
+
window.location.href = redirectURL;
|
|
7659
|
+
return true;
|
|
7660
|
+
}
|
|
7661
|
+
}
|
|
7662
|
+
return false;
|
|
7663
|
+
};
|
|
7600
7664
|
(0, import_react59.useEffect)(() => {
|
|
7601
|
-
|
|
7665
|
+
const storedFlowId = sessionStorage.getItem("asgardeo_flow_id");
|
|
7666
|
+
const urlParams = new URL(window.location.href).searchParams;
|
|
7667
|
+
const code = urlParams.get("code");
|
|
7668
|
+
const state = urlParams.get("state");
|
|
7669
|
+
const sessionDataKeyFromUrl = urlParams.get("sessionDataKey");
|
|
7670
|
+
if (sessionDataKeyFromUrl) {
|
|
7671
|
+
sessionStorage.setItem("asgardeo_session_data_key", sessionDataKeyFromUrl);
|
|
7672
|
+
}
|
|
7673
|
+
if (code) {
|
|
7674
|
+
const flowIdFromUrl = urlParams.get("flowId");
|
|
7675
|
+
const flowIdFromState = state || flowIdFromUrl || storedFlowId;
|
|
7676
|
+
if (flowIdFromState) {
|
|
7677
|
+
setCurrentFlowId(flowIdFromState);
|
|
7678
|
+
setIsFlowInitialized(true);
|
|
7679
|
+
sessionStorage.setItem("asgardeo_flow_id", flowIdFromState);
|
|
7680
|
+
initializationAttemptedRef.current = true;
|
|
7681
|
+
}
|
|
7682
|
+
return;
|
|
7683
|
+
}
|
|
7684
|
+
if (isInitialized && !isLoading && !isFlowInitialized && !initializationAttemptedRef.current && !currentFlowId) {
|
|
7602
7685
|
initializationAttemptedRef.current = true;
|
|
7603
7686
|
initializeFlow();
|
|
7604
7687
|
}
|
|
7605
|
-
}, [isInitialized, isLoading, isFlowInitialized]);
|
|
7688
|
+
}, [isInitialized, isLoading, isFlowInitialized, currentFlowId]);
|
|
7606
7689
|
const initializeFlow = async () => {
|
|
7607
7690
|
const urlParams = new URL(window.location.href).searchParams;
|
|
7691
|
+
const code = urlParams.get("code");
|
|
7692
|
+
if (code) {
|
|
7693
|
+
return;
|
|
7694
|
+
}
|
|
7608
7695
|
const flowIdFromUrl = urlParams.get("flowId");
|
|
7609
7696
|
const applicationIdFromUrl = urlParams.get("applicationId");
|
|
7697
|
+
const sessionDataKeyFromUrl = urlParams.get("sessionDataKey");
|
|
7698
|
+
if (sessionDataKeyFromUrl) {
|
|
7699
|
+
sessionStorage.setItem("asgardeo_session_data_key", sessionDataKeyFromUrl);
|
|
7700
|
+
}
|
|
7610
7701
|
const effectiveApplicationId = applicationId || applicationIdFromUrl;
|
|
7611
7702
|
if (!flowIdFromUrl && !effectiveApplicationId) {
|
|
7612
7703
|
const error = new import_browser51.AsgardeoRuntimeError(
|
|
@@ -7631,6 +7722,9 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7631
7722
|
flowType: import_browser51.EmbeddedFlowType.Authentication
|
|
7632
7723
|
});
|
|
7633
7724
|
}
|
|
7725
|
+
if (handleRedirection(response)) {
|
|
7726
|
+
return;
|
|
7727
|
+
}
|
|
7634
7728
|
const { flowId, components: components2 } = normalizeFlowResponse(response, t);
|
|
7635
7729
|
if (flowId && components2) {
|
|
7636
7730
|
setCurrentFlowId(flowId);
|
|
@@ -7650,29 +7744,53 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7650
7744
|
}
|
|
7651
7745
|
};
|
|
7652
7746
|
const handleSubmit = async (payload) => {
|
|
7653
|
-
|
|
7747
|
+
const effectiveFlowId = payload.flowId || currentFlowId;
|
|
7748
|
+
if (!effectiveFlowId) {
|
|
7749
|
+
console.error("[SignIn] handleSubmit - ERROR: No flowId available", {
|
|
7750
|
+
payloadFlowId: payload.flowId,
|
|
7751
|
+
currentFlowId
|
|
7752
|
+
});
|
|
7654
7753
|
throw new Error("No active flow ID");
|
|
7655
7754
|
}
|
|
7656
7755
|
try {
|
|
7657
7756
|
setIsSubmitting(true);
|
|
7658
7757
|
setFlowError(null);
|
|
7659
7758
|
const response = await signIn({
|
|
7660
|
-
flowId:
|
|
7759
|
+
flowId: effectiveFlowId,
|
|
7661
7760
|
...payload
|
|
7662
7761
|
});
|
|
7762
|
+
if (handleRedirection(response)) {
|
|
7763
|
+
return;
|
|
7764
|
+
}
|
|
7663
7765
|
const { flowId, components: components2 } = normalizeFlowResponse(response, t);
|
|
7664
7766
|
if (response.flowStatus === import_browser51.EmbeddedSignInFlowStatusV2.Complete) {
|
|
7767
|
+
const redirectUrl = response.redirectUrl || response.redirect_uri;
|
|
7768
|
+
sessionStorage.removeItem("asgardeo_flow_id");
|
|
7769
|
+
if (redirectUrl) {
|
|
7770
|
+
sessionStorage.removeItem("asgardeo_session_data_key");
|
|
7771
|
+
}
|
|
7772
|
+
const url = new URL(window.location.href);
|
|
7773
|
+
url.searchParams.delete("code");
|
|
7774
|
+
url.searchParams.delete("state");
|
|
7775
|
+
url.searchParams.delete("nonce");
|
|
7776
|
+
window.history.replaceState({}, "", url.toString());
|
|
7777
|
+
const finalRedirectUrl = redirectUrl || afterSignInUrl;
|
|
7665
7778
|
onSuccess && onSuccess({
|
|
7666
|
-
redirectUrl:
|
|
7779
|
+
redirectUrl: finalRedirectUrl,
|
|
7667
7780
|
...response.data
|
|
7668
7781
|
});
|
|
7669
|
-
|
|
7782
|
+
if (finalRedirectUrl) {
|
|
7783
|
+
window.location.href = finalRedirectUrl;
|
|
7784
|
+
}
|
|
7670
7785
|
return;
|
|
7671
7786
|
}
|
|
7672
7787
|
if (flowId && components2) {
|
|
7673
7788
|
setCurrentFlowId(flowId);
|
|
7674
7789
|
setComponents(components2);
|
|
7675
7790
|
}
|
|
7791
|
+
if (!currentFlowId && effectiveFlowId) {
|
|
7792
|
+
setCurrentFlowId(effectiveFlowId);
|
|
7793
|
+
}
|
|
7676
7794
|
} catch (error) {
|
|
7677
7795
|
const err = error;
|
|
7678
7796
|
setFlowError(err);
|
|
@@ -7692,6 +7810,36 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7692
7810
|
setFlowError(error);
|
|
7693
7811
|
onError?.(error);
|
|
7694
7812
|
};
|
|
7813
|
+
(0, import_react59.useEffect)(() => {
|
|
7814
|
+
const urlParams = new URL(window.location.href).searchParams;
|
|
7815
|
+
const code = urlParams.get("code");
|
|
7816
|
+
const nonce = urlParams.get("nonce");
|
|
7817
|
+
const state = urlParams.get("state");
|
|
7818
|
+
const flowIdFromUrl = urlParams.get("flowId");
|
|
7819
|
+
const storedFlowId = sessionStorage.getItem("asgardeo_flow_id");
|
|
7820
|
+
if (!code || oauthCodeProcessedRef.current || isSubmitting) {
|
|
7821
|
+
return;
|
|
7822
|
+
}
|
|
7823
|
+
const flowIdToUse = currentFlowId || state || flowIdFromUrl || storedFlowId;
|
|
7824
|
+
if (!flowIdToUse || !signIn) {
|
|
7825
|
+
return;
|
|
7826
|
+
}
|
|
7827
|
+
oauthCodeProcessedRef.current = true;
|
|
7828
|
+
if (!currentFlowId) {
|
|
7829
|
+
setCurrentFlowId(flowIdToUse);
|
|
7830
|
+
setIsFlowInitialized(true);
|
|
7831
|
+
}
|
|
7832
|
+
const submitPayload = {
|
|
7833
|
+
flowId: flowIdToUse,
|
|
7834
|
+
inputs: {
|
|
7835
|
+
code,
|
|
7836
|
+
...nonce && { nonce }
|
|
7837
|
+
}
|
|
7838
|
+
};
|
|
7839
|
+
handleSubmit(submitPayload).catch(() => {
|
|
7840
|
+
oauthCodeProcessedRef.current = false;
|
|
7841
|
+
});
|
|
7842
|
+
}, [isFlowInitialized, currentFlowId, isInitialized, isLoading, isSubmitting, signIn]);
|
|
7695
7843
|
if (children) {
|
|
7696
7844
|
const renderProps = {
|
|
7697
7845
|
initialize: initializeFlow,
|
|
@@ -7772,12 +7920,12 @@ var SignIn2 = ({ className, size = "medium", children, ...rest }) => {
|
|
|
7772
7920
|
var SignIn_default2 = SignIn2;
|
|
7773
7921
|
|
|
7774
7922
|
// src/components/presentation/SignUp/BaseSignUp.tsx
|
|
7775
|
-
var
|
|
7923
|
+
var import_browser61 = require("@asgardeo/browser");
|
|
7776
7924
|
var import_css38 = require("@emotion/css");
|
|
7777
7925
|
var import_react61 = require("react");
|
|
7778
7926
|
|
|
7779
7927
|
// src/components/presentation/SignUp/SignUpOptionFactory.tsx
|
|
7780
|
-
var
|
|
7928
|
+
var import_browser60 = require("@asgardeo/browser");
|
|
7781
7929
|
|
|
7782
7930
|
// src/components/adapters/CheckboxInput.tsx
|
|
7783
7931
|
var import_browser53 = require("@asgardeo/browser");
|
|
@@ -8140,6 +8288,40 @@ var TextInput = ({
|
|
|
8140
8288
|
};
|
|
8141
8289
|
var TextInput_default = TextInput;
|
|
8142
8290
|
|
|
8291
|
+
// src/components/adapters/SelectInput.tsx
|
|
8292
|
+
var import_browser59 = require("@asgardeo/browser");
|
|
8293
|
+
var SelectInput = ({
|
|
8294
|
+
component,
|
|
8295
|
+
formValues,
|
|
8296
|
+
touchedFields,
|
|
8297
|
+
formErrors,
|
|
8298
|
+
onInputChange,
|
|
8299
|
+
inputClassName
|
|
8300
|
+
}) => {
|
|
8301
|
+
const config = component.config || {};
|
|
8302
|
+
const fieldName = config["identifier"] || config["name"] || component.id;
|
|
8303
|
+
const value = formValues[fieldName] || "";
|
|
8304
|
+
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
8305
|
+
const rawOptions = config["options"] || [];
|
|
8306
|
+
const options = rawOptions.map((option) => ({
|
|
8307
|
+
label: option,
|
|
8308
|
+
value: option
|
|
8309
|
+
}));
|
|
8310
|
+
return createField({
|
|
8311
|
+
type: import_browser59.FieldType.Select,
|
|
8312
|
+
name: fieldName,
|
|
8313
|
+
label: config["label"] || "",
|
|
8314
|
+
placeholder: config["placeholder"] || "",
|
|
8315
|
+
required: config["required"] || false,
|
|
8316
|
+
value,
|
|
8317
|
+
error,
|
|
8318
|
+
options,
|
|
8319
|
+
onChange: (newValue) => onInputChange(fieldName, newValue),
|
|
8320
|
+
className: inputClassName
|
|
8321
|
+
});
|
|
8322
|
+
};
|
|
8323
|
+
var SelectInput_default = SelectInput;
|
|
8324
|
+
|
|
8143
8325
|
// src/components/adapters/Typography.tsx
|
|
8144
8326
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
8145
8327
|
var TypographyComponent = ({ component }) => {
|
|
@@ -8198,9 +8380,9 @@ var Typography_default2 = TypographyComponent;
|
|
|
8198
8380
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
8199
8381
|
var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
8200
8382
|
switch (component.type) {
|
|
8201
|
-
case
|
|
8383
|
+
case import_browser60.EmbeddedFlowComponentType.Typography:
|
|
8202
8384
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography_default2, { component, onSubmit, ...rest });
|
|
8203
|
-
case
|
|
8385
|
+
case import_browser60.EmbeddedFlowComponentType.Input:
|
|
8204
8386
|
const inputVariant = component.variant?.toUpperCase();
|
|
8205
8387
|
const inputType = component.config["type"]?.toLowerCase();
|
|
8206
8388
|
if (inputVariant === "EMAIL" || inputType === "email") {
|
|
@@ -8222,7 +8404,7 @@ var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
|
8222
8404
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CheckboxInput_default, { component, onSubmit, ...rest });
|
|
8223
8405
|
}
|
|
8224
8406
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TextInput_default, { component, onSubmit, ...rest });
|
|
8225
|
-
case
|
|
8407
|
+
case import_browser60.EmbeddedFlowComponentType.Button: {
|
|
8226
8408
|
const buttonVariant = component.variant?.toUpperCase();
|
|
8227
8409
|
const buttonText = component.config["text"] || component.config["label"] || "";
|
|
8228
8410
|
if (buttonVariant === "SOCIAL") {
|
|
@@ -8247,11 +8429,13 @@ var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
|
8247
8429
|
}
|
|
8248
8430
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SubmitButton_default, { component, onSubmit, ...rest });
|
|
8249
8431
|
}
|
|
8250
|
-
case
|
|
8432
|
+
case import_browser60.EmbeddedFlowComponentType.Form:
|
|
8251
8433
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(FormContainer_default, { component, onSubmit, ...rest });
|
|
8252
|
-
case
|
|
8434
|
+
case import_browser60.EmbeddedFlowComponentType.Select:
|
|
8435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SelectInput_default, { component, onSubmit, ...rest });
|
|
8436
|
+
case import_browser60.EmbeddedFlowComponentType.Divider:
|
|
8253
8437
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DividerComponent_default, { component, onSubmit, ...rest });
|
|
8254
|
-
case
|
|
8438
|
+
case import_browser60.EmbeddedFlowComponentType.Image:
|
|
8255
8439
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ImageComponent_default, { component, onSubmit, ...rest });
|
|
8256
8440
|
default:
|
|
8257
8441
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", {});
|
|
@@ -8454,6 +8638,7 @@ var BaseSignUpContent = ({
|
|
|
8454
8638
|
const { theme, colorScheme } = useTheme_default();
|
|
8455
8639
|
const { t } = useTranslation_default();
|
|
8456
8640
|
const { subtitle: flowSubtitle, title: flowTitle, messages: flowMessages, addMessage, clearMessages } = useFlow_default();
|
|
8641
|
+
const { platform } = useAsgardeo_default();
|
|
8457
8642
|
const styles = BaseSignUp_styles_default(theme, colorScheme);
|
|
8458
8643
|
const handleError = (0, import_react61.useCallback)(
|
|
8459
8644
|
(error) => {
|
|
@@ -8495,7 +8680,7 @@ var BaseSignUpContent = ({
|
|
|
8495
8680
|
const fields = [];
|
|
8496
8681
|
const processComponents = (comps) => {
|
|
8497
8682
|
comps.forEach((component) => {
|
|
8498
|
-
if (component.type ===
|
|
8683
|
+
if (component.type === import_browser61.EmbeddedFlowComponentType.Input) {
|
|
8499
8684
|
const config = component.config || {};
|
|
8500
8685
|
fields.push({
|
|
8501
8686
|
name: config.name || component.id,
|
|
@@ -8579,20 +8764,21 @@ var BaseSignUpContent = ({
|
|
|
8579
8764
|
}
|
|
8580
8765
|
});
|
|
8581
8766
|
}
|
|
8767
|
+
const actionId = platform === import_browser61.Platform.AsgardeoV2 ? component.config?.actionId : component.id;
|
|
8582
8768
|
const payload = {
|
|
8583
8769
|
...currentFlow.flowId && { flowId: currentFlow.flowId },
|
|
8584
8770
|
flowType: currentFlow.flowType || "REGISTRATION",
|
|
8585
8771
|
inputs: filteredInputs,
|
|
8586
|
-
actionId
|
|
8772
|
+
...actionId && { actionId }
|
|
8587
8773
|
};
|
|
8588
8774
|
const rawResponse = await onSubmit(payload);
|
|
8589
8775
|
const response = normalizeFlowResponse2(rawResponse);
|
|
8590
8776
|
onFlowChange?.(response);
|
|
8591
|
-
if (response.flowStatus ===
|
|
8777
|
+
if (response.flowStatus === import_browser61.EmbeddedFlowStatus.Complete) {
|
|
8592
8778
|
onComplete?.(response);
|
|
8593
8779
|
return;
|
|
8594
8780
|
}
|
|
8595
|
-
if (response.flowStatus ===
|
|
8781
|
+
if (response.flowStatus === import_browser61.EmbeddedFlowStatus.Incomplete) {
|
|
8596
8782
|
if (handleRedirectionIfNeeded(response, component)) {
|
|
8597
8783
|
return;
|
|
8598
8784
|
}
|
|
@@ -8607,7 +8793,7 @@ var BaseSignUpContent = ({
|
|
|
8607
8793
|
}
|
|
8608
8794
|
};
|
|
8609
8795
|
const handleRedirectionIfNeeded = (response, component) => {
|
|
8610
|
-
if (response?.type ===
|
|
8796
|
+
if (response?.type === import_browser61.EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL) {
|
|
8611
8797
|
const redirectUrl = response.data.redirectURL;
|
|
8612
8798
|
const popup = window.open(redirectUrl, "oauth_popup", "width=500,height=600,scrollbars=yes,resizable=yes");
|
|
8613
8799
|
if (!popup) {
|
|
@@ -8636,9 +8822,9 @@ var BaseSignUpContent = ({
|
|
|
8636
8822
|
try {
|
|
8637
8823
|
const continueResponse = await onSubmit(payload);
|
|
8638
8824
|
onFlowChange?.(continueResponse);
|
|
8639
|
-
if (continueResponse.flowStatus ===
|
|
8825
|
+
if (continueResponse.flowStatus === import_browser61.EmbeddedFlowStatus.Complete) {
|
|
8640
8826
|
onComplete?.(continueResponse);
|
|
8641
|
-
} else if (continueResponse.flowStatus ===
|
|
8827
|
+
} else if (continueResponse.flowStatus === import_browser61.EmbeddedFlowStatus.Incomplete) {
|
|
8642
8828
|
setCurrentFlow(continueResponse);
|
|
8643
8829
|
setupFormFields(continueResponse);
|
|
8644
8830
|
}
|
|
@@ -8696,9 +8882,9 @@ var BaseSignUpContent = ({
|
|
|
8696
8882
|
try {
|
|
8697
8883
|
const continueResponse = await onSubmit(payload);
|
|
8698
8884
|
onFlowChange?.(continueResponse);
|
|
8699
|
-
if (continueResponse.flowStatus ===
|
|
8885
|
+
if (continueResponse.flowStatus === import_browser61.EmbeddedFlowStatus.Complete) {
|
|
8700
8886
|
onComplete?.(continueResponse);
|
|
8701
|
-
} else if (continueResponse.flowStatus ===
|
|
8887
|
+
} else if (continueResponse.flowStatus === import_browser61.EmbeddedFlowStatus.Incomplete) {
|
|
8702
8888
|
setCurrentFlow(continueResponse);
|
|
8703
8889
|
setupFormFields(continueResponse);
|
|
8704
8890
|
}
|
|
@@ -8722,30 +8908,30 @@ var BaseSignUpContent = ({
|
|
|
8722
8908
|
};
|
|
8723
8909
|
const containerClasses = (0, import_css38.cx)(
|
|
8724
8910
|
[
|
|
8725
|
-
(0,
|
|
8726
|
-
(0,
|
|
8727
|
-
(0,
|
|
8911
|
+
(0, import_browser61.withVendorCSSClassPrefix)("signup"),
|
|
8912
|
+
(0, import_browser61.withVendorCSSClassPrefix)(`signup--${size}`),
|
|
8913
|
+
(0, import_browser61.withVendorCSSClassPrefix)(`signup--${variant}`)
|
|
8728
8914
|
],
|
|
8729
8915
|
className
|
|
8730
8916
|
);
|
|
8731
8917
|
const inputClasses = (0, import_css38.cx)(
|
|
8732
8918
|
[
|
|
8733
|
-
(0,
|
|
8734
|
-
size === "small" && (0,
|
|
8735
|
-
size === "large" && (0,
|
|
8919
|
+
(0, import_browser61.withVendorCSSClassPrefix)("signup__input"),
|
|
8920
|
+
size === "small" && (0, import_browser61.withVendorCSSClassPrefix)("signup__input--small"),
|
|
8921
|
+
size === "large" && (0, import_browser61.withVendorCSSClassPrefix)("signup__input--large")
|
|
8736
8922
|
],
|
|
8737
8923
|
inputClassName
|
|
8738
8924
|
);
|
|
8739
8925
|
const buttonClasses = (0, import_css38.cx)(
|
|
8740
8926
|
[
|
|
8741
|
-
(0,
|
|
8742
|
-
size === "small" && (0,
|
|
8743
|
-
size === "large" && (0,
|
|
8927
|
+
(0, import_browser61.withVendorCSSClassPrefix)("signup__button"),
|
|
8928
|
+
size === "small" && (0, import_browser61.withVendorCSSClassPrefix)("signup__button--small"),
|
|
8929
|
+
size === "large" && (0, import_browser61.withVendorCSSClassPrefix)("signup__button--large")
|
|
8744
8930
|
],
|
|
8745
8931
|
buttonClassName
|
|
8746
8932
|
);
|
|
8747
|
-
const errorClasses = (0, import_css38.cx)([(0,
|
|
8748
|
-
const messageClasses = (0, import_css38.cx)([(0,
|
|
8933
|
+
const errorClasses = (0, import_css38.cx)([(0, import_browser61.withVendorCSSClassPrefix)("signup__error")], errorClassName);
|
|
8934
|
+
const messageClasses = (0, import_css38.cx)([(0, import_browser61.withVendorCSSClassPrefix)("signup__messages")], messageClassName);
|
|
8749
8935
|
const renderComponents = (0, import_react61.useCallback)(
|
|
8750
8936
|
(components) => renderSignUpComponents(
|
|
8751
8937
|
components,
|
|
@@ -8788,11 +8974,11 @@ var BaseSignUpContent = ({
|
|
|
8788
8974
|
setCurrentFlow(response);
|
|
8789
8975
|
setIsFlowInitialized(true);
|
|
8790
8976
|
onFlowChange?.(response);
|
|
8791
|
-
if (response.flowStatus ===
|
|
8977
|
+
if (response.flowStatus === import_browser61.EmbeddedFlowStatus.Complete) {
|
|
8792
8978
|
onComplete?.(response);
|
|
8793
8979
|
return;
|
|
8794
8980
|
}
|
|
8795
|
-
if (response.flowStatus ===
|
|
8981
|
+
if (response.flowStatus === import_browser61.EmbeddedFlowStatus.Incomplete) {
|
|
8796
8982
|
setupFormFields(response);
|
|
8797
8983
|
}
|
|
8798
8984
|
} catch (err) {
|
|
@@ -8863,7 +9049,7 @@ var BaseSignUpContent = ({
|
|
|
8863
9049
|
var BaseSignUp_default = BaseSignUp;
|
|
8864
9050
|
|
|
8865
9051
|
// src/components/presentation/SignUp/SignUp.tsx
|
|
8866
|
-
var
|
|
9052
|
+
var import_browser62 = require("@asgardeo/browser");
|
|
8867
9053
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
8868
9054
|
var SignUp = ({
|
|
8869
9055
|
className,
|
|
@@ -8881,18 +9067,18 @@ var SignUp = ({
|
|
|
8881
9067
|
const applicationIdFromUrl = urlParams.get("applicationId");
|
|
8882
9068
|
const effectiveApplicationId = applicationId || applicationIdFromUrl;
|
|
8883
9069
|
const initialPayload = payload || {
|
|
8884
|
-
flowType:
|
|
8885
|
-
...platform ===
|
|
9070
|
+
flowType: import_browser62.EmbeddedFlowType.Registration,
|
|
9071
|
+
...platform === import_browser62.Platform.AsgardeoV2 && effectiveApplicationId && { applicationId: effectiveApplicationId }
|
|
8886
9072
|
};
|
|
8887
9073
|
return await signUp(initialPayload);
|
|
8888
9074
|
};
|
|
8889
9075
|
const handleOnSubmit = async (payload) => await signUp(payload);
|
|
8890
9076
|
const handleComplete = (response) => {
|
|
8891
9077
|
onComplete?.(response);
|
|
8892
|
-
if (shouldRedirectAfterSignUp && response?.type !==
|
|
9078
|
+
if (shouldRedirectAfterSignUp && response?.type !== import_browser62.EmbeddedFlowResponseType.Redirection && afterSignUpUrl) {
|
|
8893
9079
|
window.location.href = afterSignUpUrl;
|
|
8894
9080
|
}
|
|
8895
|
-
if (shouldRedirectAfterSignUp && response?.type ===
|
|
9081
|
+
if (shouldRedirectAfterSignUp && response?.type === import_browser62.EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL && !response.data.redirectURL.includes("oauth") && // Not a social provider redirect
|
|
8896
9082
|
!response.data.redirectURL.includes("auth")) {
|
|
8897
9083
|
window.location.href = response.data.redirectURL;
|
|
8898
9084
|
}
|
|
@@ -8910,8 +9096,8 @@ var SignUp = ({
|
|
|
8910
9096
|
isInitialized,
|
|
8911
9097
|
children,
|
|
8912
9098
|
showLogo: true,
|
|
8913
|
-
showTitle: platform ===
|
|
8914
|
-
showSubtitle: platform ===
|
|
9099
|
+
showTitle: platform === import_browser62.Platform.AsgardeoV2,
|
|
9100
|
+
showSubtitle: platform === import_browser62.Platform.AsgardeoV2,
|
|
8915
9101
|
...rest
|
|
8916
9102
|
}
|
|
8917
9103
|
);
|
|
@@ -8959,35 +9145,35 @@ Organization5.displayName = "Organization";
|
|
|
8959
9145
|
var Organization_default = Organization5;
|
|
8960
9146
|
|
|
8961
9147
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
8962
|
-
var
|
|
9148
|
+
var import_browser68 = require("@asgardeo/browser");
|
|
8963
9149
|
var import_css46 = require("@emotion/css");
|
|
8964
9150
|
var import_react70 = require("react");
|
|
8965
9151
|
|
|
8966
9152
|
// src/utils/getMappedUserProfileValue.ts
|
|
8967
|
-
var
|
|
9153
|
+
var import_browser63 = require("@asgardeo/browser");
|
|
8968
9154
|
var getMappedUserProfileValue = (key, mappings, user) => {
|
|
8969
9155
|
if (!key || !mappings || !user) {
|
|
8970
9156
|
return void 0;
|
|
8971
9157
|
}
|
|
8972
9158
|
const mapping = mappings[key];
|
|
8973
9159
|
if (!mapping) {
|
|
8974
|
-
return (0,
|
|
9160
|
+
return (0, import_browser63.get)(user, key);
|
|
8975
9161
|
}
|
|
8976
9162
|
if (Array.isArray(mapping)) {
|
|
8977
9163
|
for (const path of mapping) {
|
|
8978
|
-
const value = (0,
|
|
9164
|
+
const value = (0, import_browser63.get)(user, path);
|
|
8979
9165
|
if (value !== void 0 && value !== null && value !== "") {
|
|
8980
9166
|
return value;
|
|
8981
9167
|
}
|
|
8982
9168
|
}
|
|
8983
9169
|
return void 0;
|
|
8984
9170
|
}
|
|
8985
|
-
return (0,
|
|
9171
|
+
return (0, import_browser63.get)(user, mapping);
|
|
8986
9172
|
};
|
|
8987
9173
|
var getMappedUserProfileValue_default = getMappedUserProfileValue;
|
|
8988
9174
|
|
|
8989
9175
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
8990
|
-
var
|
|
9176
|
+
var import_browser64 = require("@asgardeo/browser");
|
|
8991
9177
|
var import_css40 = require("@emotion/css");
|
|
8992
9178
|
var import_react63 = require("react");
|
|
8993
9179
|
|
|
@@ -9106,20 +9292,20 @@ var Avatar = ({
|
|
|
9106
9292
|
const getInitials = (fullName) => fullName.split(" ").map((part) => part[0]).slice(0, 2).join("").toUpperCase();
|
|
9107
9293
|
const renderContent = () => {
|
|
9108
9294
|
if (imageUrl) {
|
|
9109
|
-
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("img", { src: imageUrl, alt, className: (0, import_css40.cx)((0,
|
|
9295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("img", { src: imageUrl, alt, className: (0, import_css40.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("avatar", "image")), styles.image) });
|
|
9110
9296
|
}
|
|
9111
9297
|
if (name) {
|
|
9112
9298
|
return getInitials(name);
|
|
9113
9299
|
}
|
|
9114
9300
|
if (isLoading) {
|
|
9115
|
-
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: (0, import_css40.cx)((0,
|
|
9301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: (0, import_css40.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("avatar", "skeleton")), styles.skeleton) });
|
|
9116
9302
|
}
|
|
9117
9303
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
9118
9304
|
"svg",
|
|
9119
9305
|
{
|
|
9120
9306
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9121
9307
|
viewBox: "0 0 640 640",
|
|
9122
|
-
className: (0, import_css40.cx)((0,
|
|
9308
|
+
className: (0, import_css40.cx)((0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("avatar", "icon")), styles.icon),
|
|
9123
9309
|
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("path", { d: "M240 192C240 147.8 275.8 112 320 112C364.2 112 400 147.8 400 192C400 236.2 364.2 272 320 272C275.8 272 240 236.2 240 192zM448 192C448 121.3 390.7 64 320 64C249.3 64 192 121.3 192 192C192 262.7 249.3 320 320 320C390.7 320 448 262.7 448 192zM144 544C144 473.3 201.3 416 272 416L368 416C438.7 416 496 473.3 496 544L496 552C496 565.3 506.7 576 520 576C533.3 576 544 565.3 544 552L544 544C544 446.8 465.2 368 368 368L272 368C174.8 368 96 446.8 96 544L96 552C96 565.3 106.7 576 120 576C133.3 576 144 565.3 144 552L144 544z" })
|
|
9124
9310
|
}
|
|
9125
9311
|
);
|
|
@@ -9128,11 +9314,11 @@ var Avatar = ({
|
|
|
9128
9314
|
"div",
|
|
9129
9315
|
{
|
|
9130
9316
|
className: (0, import_css40.cx)(
|
|
9131
|
-
(0,
|
|
9317
|
+
(0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("avatar")),
|
|
9132
9318
|
styles.avatar,
|
|
9133
9319
|
styles.variant,
|
|
9134
|
-
(0,
|
|
9135
|
-
isDefaultState && (0,
|
|
9320
|
+
(0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("avatar", null, variant)),
|
|
9321
|
+
isDefaultState && (0, import_browser64.withVendorCSSClassPrefix)((0, import_browser64.bem)("avatar", "default")),
|
|
9136
9322
|
className
|
|
9137
9323
|
),
|
|
9138
9324
|
children: renderContent()
|
|
@@ -9142,7 +9328,7 @@ var Avatar = ({
|
|
|
9142
9328
|
var Avatar_default = Avatar;
|
|
9143
9329
|
|
|
9144
9330
|
// src/components/primitives/Dialog/Dialog.tsx
|
|
9145
|
-
var
|
|
9331
|
+
var import_browser65 = require("@asgardeo/browser");
|
|
9146
9332
|
var import_react65 = require("@floating-ui/react");
|
|
9147
9333
|
var import_css42 = require("@emotion/css");
|
|
9148
9334
|
var import_react66 = __toESM(require("react"), 1);
|
|
@@ -9379,11 +9565,11 @@ var DialogContent = import_react66.default.forwardRef((props, propRef) => {
|
|
|
9379
9565
|
const styles = Dialog_styles_default(theme, colorScheme);
|
|
9380
9566
|
const ref = (0, import_react65.useMergeRefs)([context.refs.setFloating, propRef]);
|
|
9381
9567
|
if (!floatingContext.open) return null;
|
|
9382
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react65.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react65.FloatingOverlay, { className: (0, import_css42.cx)((0,
|
|
9568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react65.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react65.FloatingOverlay, { className: (0, import_css42.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("dialog", "overlay")), styles.overlay), lockScroll: true, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_react65.FloatingFocusManager, { context: floatingContext, initialFocus: -1, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9383
9569
|
"div",
|
|
9384
9570
|
{
|
|
9385
9571
|
ref,
|
|
9386
|
-
className: (0, import_css42.cx)((0,
|
|
9572
|
+
className: (0, import_css42.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("dialog", "content")), styles.content, props.className),
|
|
9387
9573
|
"aria-labelledby": context.labelId,
|
|
9388
9574
|
"aria-describedby": context.descriptionId,
|
|
9389
9575
|
...context.getFloatingProps(props),
|
|
@@ -9401,14 +9587,14 @@ var DialogHeading = import_react66.default.forwardRef(
|
|
|
9401
9587
|
context.setLabelId(id);
|
|
9402
9588
|
return () => context.setLabelId(void 0);
|
|
9403
9589
|
}, [id, context.setLabelId]);
|
|
9404
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: (0, import_css42.cx)((0,
|
|
9590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: (0, import_css42.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("dialog", "header")), styles.header), children: [
|
|
9405
9591
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
9406
9592
|
"h2",
|
|
9407
9593
|
{
|
|
9408
9594
|
...props,
|
|
9409
9595
|
ref,
|
|
9410
9596
|
id,
|
|
9411
|
-
className: (0, import_css42.cx)((0,
|
|
9597
|
+
className: (0, import_css42.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("dialog", "title")), styles.headerTitle),
|
|
9412
9598
|
children
|
|
9413
9599
|
}
|
|
9414
9600
|
),
|
|
@@ -9443,7 +9629,7 @@ var DialogDescription = import_react66.default.forwardRef(
|
|
|
9443
9629
|
...props,
|
|
9444
9630
|
ref,
|
|
9445
9631
|
id,
|
|
9446
|
-
className: (0, import_css42.cx)((0,
|
|
9632
|
+
className: (0, import_css42.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("dialog", "description")), styles.description, props.className),
|
|
9447
9633
|
children
|
|
9448
9634
|
}
|
|
9449
9635
|
);
|
|
@@ -9473,7 +9659,7 @@ var DialogClose = import_react66.default.forwardRef(({ children, asChild = false
|
|
|
9473
9659
|
...props,
|
|
9474
9660
|
ref,
|
|
9475
9661
|
onClick: handleClick,
|
|
9476
|
-
className: (0, import_css42.cx)((0,
|
|
9662
|
+
className: (0, import_css42.cx)((0, import_browser65.withVendorCSSClassPrefix)((0, import_browser65.bem)("dialog", "close")), props.className),
|
|
9477
9663
|
variant: "text",
|
|
9478
9664
|
children
|
|
9479
9665
|
}
|
|
@@ -9494,7 +9680,7 @@ var Dialog_default = Dialog;
|
|
|
9494
9680
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
9495
9681
|
var import_react68 = require("react");
|
|
9496
9682
|
var import_css44 = require("@emotion/css");
|
|
9497
|
-
var
|
|
9683
|
+
var import_browser66 = require("@asgardeo/browser");
|
|
9498
9684
|
|
|
9499
9685
|
// src/components/primitives/MultiInput/MultiInput.styles.ts
|
|
9500
9686
|
var import_css43 = require("@emotion/css");
|
|
@@ -9686,26 +9872,26 @@ var MultiInput = ({
|
|
|
9686
9872
|
{
|
|
9687
9873
|
error,
|
|
9688
9874
|
helperText,
|
|
9689
|
-
className: (0, import_css44.cx)((0,
|
|
9875
|
+
className: (0, import_css44.cx)((0, import_browser66.withVendorCSSClassPrefix)((0, import_browser66.bem)("multi-input")), className),
|
|
9690
9876
|
style,
|
|
9691
9877
|
children: [
|
|
9692
9878
|
label && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(InputLabel_default, { required, error: !!error, children: label }),
|
|
9693
|
-
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: (0, import_css44.cx)((0,
|
|
9694
|
-
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: (0, import_css44.cx)((0,
|
|
9879
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: (0, import_css44.cx)((0, import_browser66.withVendorCSSClassPrefix)((0, import_browser66.bem)("multi-input", "container")), styles.container), children: [
|
|
9880
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: (0, import_css44.cx)((0, import_browser66.withVendorCSSClassPrefix)((0, import_browser66.bem)("multi-input", "input-row")), styles.inputRow), children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: (0, import_css44.cx)((0, import_browser66.withVendorCSSClassPrefix)((0, import_browser66.bem)("multi-input", "input-wrapper")), styles.inputWrapper), children: renderInputField(
|
|
9695
9881
|
currentInputValue,
|
|
9696
9882
|
setCurrentInputValue,
|
|
9697
9883
|
canAddMore ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(PlusIcon, { className: styles.plusIcon }) : void 0,
|
|
9698
9884
|
canAddMore ? handleInputSubmit : void 0
|
|
9699
9885
|
) }) }),
|
|
9700
|
-
values.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: (0, import_css44.cx)((0,
|
|
9886
|
+
values.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: (0, import_css44.cx)((0, import_browser66.withVendorCSSClassPrefix)((0, import_browser66.bem)("multi-input", "list-container")), styles.listContainer), children: values.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
9701
9887
|
"div",
|
|
9702
9888
|
{
|
|
9703
|
-
className: (0, import_css44.cx)((0,
|
|
9889
|
+
className: (0, import_css44.cx)((0, import_browser66.withVendorCSSClassPrefix)((0, import_browser66.bem)("multi-input", "list-item")), styles.listItem),
|
|
9704
9890
|
children: [
|
|
9705
9891
|
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
9706
9892
|
"span",
|
|
9707
9893
|
{
|
|
9708
|
-
className: (0, import_css44.cx)((0,
|
|
9894
|
+
className: (0, import_css44.cx)((0, import_browser66.withVendorCSSClassPrefix)((0, import_browser66.bem)("multi-input", "list-item-text")), styles.listItemText),
|
|
9709
9895
|
children: value
|
|
9710
9896
|
}
|
|
9711
9897
|
),
|
|
@@ -9715,7 +9901,7 @@ var MultiInput = ({
|
|
|
9715
9901
|
type: "button",
|
|
9716
9902
|
onClick: () => handleRemoveValue(index),
|
|
9717
9903
|
disabled,
|
|
9718
|
-
className: (0, import_css44.cx)((0,
|
|
9904
|
+
className: (0, import_css44.cx)((0, import_browser66.withVendorCSSClassPrefix)((0, import_browser66.bem)("multi-input", "remove-button")), styles.removeButton),
|
|
9719
9905
|
title: "Remove value",
|
|
9720
9906
|
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(BinIcon, { className: styles.icon })
|
|
9721
9907
|
}
|
|
@@ -9734,7 +9920,7 @@ var MultiInput_default = MultiInput;
|
|
|
9734
9920
|
// src/components/presentation/UserProfile/BaseUserProfile.styles.ts
|
|
9735
9921
|
var import_css45 = require("@emotion/css");
|
|
9736
9922
|
var import_react69 = require("react");
|
|
9737
|
-
var
|
|
9923
|
+
var import_browser67 = require("@asgardeo/browser");
|
|
9738
9924
|
var useStyles21 = (theme, colorScheme) => {
|
|
9739
9925
|
const valuePlaceholder = import_css45.css`
|
|
9740
9926
|
font-style: italic;
|
|
@@ -9845,7 +10031,7 @@ var useStyles21 = (theme, colorScheme) => {
|
|
|
9845
10031
|
max-width: 350px;
|
|
9846
10032
|
text-align: start;
|
|
9847
10033
|
|
|
9848
|
-
.${(0,
|
|
10034
|
+
.${(0, import_browser67.withVendorCSSClassPrefix)("form-control")} {
|
|
9849
10035
|
margin-bottom: 0;
|
|
9850
10036
|
}
|
|
9851
10037
|
|
|
@@ -10044,7 +10230,7 @@ var BaseUserProfile = ({
|
|
|
10044
10230
|
fieldValue = fieldValue.filter((v) => v !== void 0 && v !== null && v !== "");
|
|
10045
10231
|
}
|
|
10046
10232
|
let payload = {};
|
|
10047
|
-
if (schema.schemaId && schema.schemaId !==
|
|
10233
|
+
if (schema.schemaId && schema.schemaId !== import_browser68.WellKnownSchemaIds.User) {
|
|
10048
10234
|
payload = {
|
|
10049
10235
|
[schema.schemaId]: {
|
|
10050
10236
|
[fieldName]: fieldValue
|
|
@@ -10278,7 +10464,7 @@ var BaseUserProfile = ({
|
|
|
10278
10464
|
const containerClasses = (0, import_css46.cx)(
|
|
10279
10465
|
styles.root,
|
|
10280
10466
|
cardLayout ? styles.card : "",
|
|
10281
|
-
(0,
|
|
10467
|
+
(0, import_browser68.withVendorCSSClassPrefix)("user-profile"),
|
|
10282
10468
|
className
|
|
10283
10469
|
);
|
|
10284
10470
|
const currentUser = flattenedProfile || profile;
|
|
@@ -10296,7 +10482,7 @@ var BaseUserProfile = ({
|
|
|
10296
10482
|
] }, key)) });
|
|
10297
10483
|
};
|
|
10298
10484
|
const profileContent = /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Card_default, { className: containerClasses, children: [
|
|
10299
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Alert_default, { variant: "error", className: (0, import_css46.cx)((0,
|
|
10485
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Alert_default, { variant: "error", className: (0, import_css46.cx)((0, import_browser68.withVendorCSSClassPrefix)((0, import_browser68.bem)("user-profile", "alert")), styles.alert), children: [
|
|
10300
10486
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Alert_default.Title, { children: t("errors.title") || "Error" }),
|
|
10301
10487
|
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Alert_default.Description, { children: error })
|
|
10302
10488
|
] }),
|
|
@@ -10344,8 +10530,8 @@ var BaseUserProfile_default = BaseUserProfile;
|
|
|
10344
10530
|
var import_react71 = require("react");
|
|
10345
10531
|
|
|
10346
10532
|
// src/api/updateMeProfile.ts
|
|
10347
|
-
var
|
|
10348
|
-
var httpClient5 =
|
|
10533
|
+
var import_browser69 = require("@asgardeo/browser");
|
|
10534
|
+
var httpClient5 = import_browser69.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser69.AsgardeoSPAClient.getInstance());
|
|
10349
10535
|
var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
10350
10536
|
const defaultFetcher = async (url, config) => {
|
|
10351
10537
|
const response = await httpClient5({
|
|
@@ -10362,7 +10548,7 @@ var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
|
10362
10548
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
10363
10549
|
};
|
|
10364
10550
|
};
|
|
10365
|
-
return (0,
|
|
10551
|
+
return (0, import_browser69.updateMeProfile)({
|
|
10366
10552
|
...requestConfig,
|
|
10367
10553
|
fetcher: fetcher || defaultFetcher
|
|
10368
10554
|
});
|
|
@@ -10370,7 +10556,7 @@ var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
|
10370
10556
|
var updateMeProfile_default = updateMeProfile;
|
|
10371
10557
|
|
|
10372
10558
|
// src/components/presentation/UserProfile/UserProfile.tsx
|
|
10373
|
-
var
|
|
10559
|
+
var import_browser70 = require("@asgardeo/browser");
|
|
10374
10560
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
10375
10561
|
var UserProfile3 = ({ ...rest }) => {
|
|
10376
10562
|
const { baseUrl, isLoading } = useAsgardeo_default();
|
|
@@ -10384,7 +10570,7 @@ var UserProfile3 = ({ ...rest }) => {
|
|
|
10384
10570
|
onUpdateProfile(response);
|
|
10385
10571
|
} catch (error2) {
|
|
10386
10572
|
let message = t("user.profile.update.generic.error");
|
|
10387
|
-
if (error2 instanceof
|
|
10573
|
+
if (error2 instanceof import_browser70.AsgardeoError) {
|
|
10388
10574
|
message = error2?.message;
|
|
10389
10575
|
}
|
|
10390
10576
|
setError(message);
|
|
@@ -10405,7 +10591,7 @@ var UserProfile3 = ({ ...rest }) => {
|
|
|
10405
10591
|
var UserProfile_default = UserProfile3;
|
|
10406
10592
|
|
|
10407
10593
|
// src/components/presentation/UserDropdown/BaseUserDropdown.tsx
|
|
10408
|
-
var
|
|
10594
|
+
var import_browser71 = require("@asgardeo/browser");
|
|
10409
10595
|
var import_react73 = require("@floating-ui/react");
|
|
10410
10596
|
var import_css48 = require("@emotion/css");
|
|
10411
10597
|
var import_react74 = require("react");
|
|
@@ -10666,12 +10852,12 @@ var BaseUserDropdown = ({
|
|
|
10666
10852
|
}
|
|
10667
10853
|
allMenuItems.push(...defaultMenuItems);
|
|
10668
10854
|
}
|
|
10669
|
-
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css48.cx)((0,
|
|
10855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown"), className), children: [
|
|
10670
10856
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
10671
10857
|
Button_default,
|
|
10672
10858
|
{
|
|
10673
10859
|
ref: refs.setReference,
|
|
10674
|
-
className: (0, import_css48.cx)((0,
|
|
10860
|
+
className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__trigger"), styles.trigger),
|
|
10675
10861
|
color: "tertiary",
|
|
10676
10862
|
variant: "text",
|
|
10677
10863
|
size: "medium",
|
|
@@ -10690,7 +10876,7 @@ var BaseUserDropdown = ({
|
|
|
10690
10876
|
Typography_default,
|
|
10691
10877
|
{
|
|
10692
10878
|
variant: "body2",
|
|
10693
|
-
className: (0, import_css48.cx)((0,
|
|
10879
|
+
className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__trigger-label"), styles.userName),
|
|
10694
10880
|
children: getDisplayName_default(mergedMappings, user)
|
|
10695
10881
|
}
|
|
10696
10882
|
)
|
|
@@ -10701,7 +10887,7 @@ var BaseUserDropdown = ({
|
|
|
10701
10887
|
"div",
|
|
10702
10888
|
{
|
|
10703
10889
|
ref: refs.setFloating,
|
|
10704
|
-
className: (0, import_css48.cx)((0,
|
|
10890
|
+
className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__content"), styles.dropdownContent),
|
|
10705
10891
|
style: {
|
|
10706
10892
|
...floatingStyles,
|
|
10707
10893
|
// Floating UI doesn't set a z-index by default, so we set a high value to ensure the dropdown appears above other elements.
|
|
@@ -10710,7 +10896,7 @@ var BaseUserDropdown = ({
|
|
|
10710
10896
|
},
|
|
10711
10897
|
...getFloatingProps(),
|
|
10712
10898
|
children: [
|
|
10713
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css48.cx)((0,
|
|
10899
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__header"), styles.dropdownHeader), children: [
|
|
10714
10900
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10715
10901
|
Avatar,
|
|
10716
10902
|
{
|
|
@@ -10720,12 +10906,12 @@ var BaseUserDropdown = ({
|
|
|
10720
10906
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
10721
10907
|
}
|
|
10722
10908
|
),
|
|
10723
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css48.cx)((0,
|
|
10909
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__header-info"), styles.headerInfo), children: [
|
|
10724
10910
|
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
10725
10911
|
Typography_default,
|
|
10726
10912
|
{
|
|
10727
10913
|
noWrap: true,
|
|
10728
|
-
className: (0,
|
|
10914
|
+
className: (0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__header-name"),
|
|
10729
10915
|
variant: "body1",
|
|
10730
10916
|
fontWeight: "medium",
|
|
10731
10917
|
children: getDisplayName_default(mergedMappings, user)
|
|
@@ -10735,7 +10921,7 @@ var BaseUserDropdown = ({
|
|
|
10735
10921
|
Typography_default,
|
|
10736
10922
|
{
|
|
10737
10923
|
noWrap: true,
|
|
10738
|
-
className: (0,
|
|
10924
|
+
className: (0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__header-email"),
|
|
10739
10925
|
variant: "caption",
|
|
10740
10926
|
color: "secondary",
|
|
10741
10927
|
children: getMappedUserProfileValue_default("username", mergedMappings, user) || getMappedUserProfileValue_default("email", mergedMappings, user)
|
|
@@ -10743,14 +10929,14 @@ var BaseUserDropdown = ({
|
|
|
10743
10929
|
)
|
|
10744
10930
|
] })
|
|
10745
10931
|
] }),
|
|
10746
|
-
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: (0, import_css48.cx)((0,
|
|
10932
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__menu"), styles.dropdownMenu), children: allMenuItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { children: item.label === "" ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__menu-divider"), styles.divider) }) : item.href ? /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
10747
10933
|
"a",
|
|
10748
10934
|
{
|
|
10749
10935
|
href: item.href,
|
|
10750
10936
|
style: {
|
|
10751
10937
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
10752
10938
|
},
|
|
10753
|
-
className: (0, import_css48.cx)((0,
|
|
10939
|
+
className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__menu-item"), styles.menuItemAnchor),
|
|
10754
10940
|
onMouseEnter: () => setHoveredItemIndex(index),
|
|
10755
10941
|
onMouseLeave: () => setHoveredItemIndex(null),
|
|
10756
10942
|
onFocus: () => setHoveredItemIndex(index),
|
|
@@ -10767,7 +10953,7 @@ var BaseUserDropdown = ({
|
|
|
10767
10953
|
style: {
|
|
10768
10954
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
10769
10955
|
},
|
|
10770
|
-
className: (0, import_css48.cx)((0,
|
|
10956
|
+
className: (0, import_css48.cx)((0, import_browser71.withVendorCSSClassPrefix)("user-dropdown__menu-item"), styles.menuItem),
|
|
10771
10957
|
color: "tertiary",
|
|
10772
10958
|
variant: "text",
|
|
10773
10959
|
size: "small",
|
|
@@ -11670,8 +11856,8 @@ var BaseCreateOrganization = ({
|
|
|
11670
11856
|
};
|
|
11671
11857
|
|
|
11672
11858
|
// src/api/createOrganization.ts
|
|
11673
|
-
var
|
|
11674
|
-
var httpClient6 =
|
|
11859
|
+
var import_browser72 = require("@asgardeo/browser");
|
|
11860
|
+
var httpClient6 = import_browser72.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser72.AsgardeoSPAClient.getInstance());
|
|
11675
11861
|
var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
11676
11862
|
const defaultFetcher = async (url, config) => {
|
|
11677
11863
|
const response = await httpClient6({
|
|
@@ -11688,7 +11874,7 @@ var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
11688
11874
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
11689
11875
|
};
|
|
11690
11876
|
};
|
|
11691
|
-
return (0,
|
|
11877
|
+
return (0, import_browser72.createOrganization)({
|
|
11692
11878
|
...requestConfig,
|
|
11693
11879
|
fetcher: fetcher || defaultFetcher
|
|
11694
11880
|
});
|
|
@@ -11763,12 +11949,12 @@ var CreateOrganization = ({
|
|
|
11763
11949
|
var import_react86 = require("react");
|
|
11764
11950
|
|
|
11765
11951
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
11766
|
-
var
|
|
11952
|
+
var import_browser74 = require("@asgardeo/browser");
|
|
11767
11953
|
var import_css56 = require("@emotion/css");
|
|
11768
11954
|
var import_react85 = require("react");
|
|
11769
11955
|
|
|
11770
11956
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
11771
|
-
var
|
|
11957
|
+
var import_browser73 = require("@asgardeo/browser");
|
|
11772
11958
|
var import_css54 = require("@emotion/css");
|
|
11773
11959
|
var import_react83 = require("react");
|
|
11774
11960
|
|
|
@@ -12003,27 +12189,27 @@ var KeyValueInput = ({
|
|
|
12003
12189
|
);
|
|
12004
12190
|
const canAddMore = !maxPairs || pairs.length < maxPairs;
|
|
12005
12191
|
const isAddDisabled = disabled || readOnly || !canAddMore || !newKey.trim() || !newValue.trim();
|
|
12006
|
-
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css54.cx)((0,
|
|
12007
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("label", { className: (0, import_css54.cx)((0,
|
|
12192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input")), styles.container, className), children: [
|
|
12193
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("label", { className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "label")), styles.label), children: [
|
|
12008
12194
|
label,
|
|
12009
12195
|
required && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
12010
12196
|
"span",
|
|
12011
12197
|
{
|
|
12012
|
-
className: (0, import_css54.cx)((0,
|
|
12198
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "required")), styles.requiredIndicator),
|
|
12013
12199
|
children: " *"
|
|
12014
12200
|
}
|
|
12015
12201
|
)
|
|
12016
12202
|
] }),
|
|
12017
|
-
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css54.cx)((0,
|
|
12018
|
-
pairs.length === 0 && readOnly ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: (0, import_css54.cx)((0,
|
|
12203
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "pairs-list")), styles.pairsList), children: [
|
|
12204
|
+
pairs.length === 0 && readOnly ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "empty-state")), styles.emptyState), children: "No attributes defined" }) : readOnly ? pairs.map((pair, index) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
12019
12205
|
"div",
|
|
12020
12206
|
{
|
|
12021
|
-
className: (0, import_css54.cx)((0,
|
|
12207
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "readonly-pair")), styles.readOnlyPair),
|
|
12022
12208
|
children: [
|
|
12023
12209
|
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
12024
12210
|
"span",
|
|
12025
12211
|
{
|
|
12026
|
-
className: (0, import_css54.cx)((0,
|
|
12212
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "readonly-key")), styles.readOnlyKey),
|
|
12027
12213
|
children: [
|
|
12028
12214
|
pair.key,
|
|
12029
12215
|
":"
|
|
@@ -12033,7 +12219,7 @@ var KeyValueInput = ({
|
|
|
12033
12219
|
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
12034
12220
|
"span",
|
|
12035
12221
|
{
|
|
12036
|
-
className: (0, import_css54.cx)((0,
|
|
12222
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "readonly-value")), styles.readOnlyValue),
|
|
12037
12223
|
children: pair.value
|
|
12038
12224
|
}
|
|
12039
12225
|
)
|
|
@@ -12043,7 +12229,7 @@ var KeyValueInput = ({
|
|
|
12043
12229
|
)) : pairs.map((pair, index) => /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
12044
12230
|
"div",
|
|
12045
12231
|
{
|
|
12046
|
-
className: (0, import_css54.cx)((0,
|
|
12232
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "pair-row")), styles.pairRow),
|
|
12047
12233
|
children: [
|
|
12048
12234
|
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
12049
12235
|
TextField_default,
|
|
@@ -12052,7 +12238,7 @@ var KeyValueInput = ({
|
|
|
12052
12238
|
value: pair.key,
|
|
12053
12239
|
onChange: (e) => handleUpdatePair(index, "key", e.target.value),
|
|
12054
12240
|
disabled: disabled || readOnly,
|
|
12055
|
-
className: (0, import_css54.cx)((0,
|
|
12241
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
12056
12242
|
"aria-label": `${keyLabel} ${index + 1}`
|
|
12057
12243
|
}
|
|
12058
12244
|
),
|
|
@@ -12063,7 +12249,7 @@ var KeyValueInput = ({
|
|
|
12063
12249
|
value: pair.value,
|
|
12064
12250
|
onChange: (e) => handleUpdatePair(index, "value", e.target.value),
|
|
12065
12251
|
disabled: disabled || readOnly,
|
|
12066
|
-
className: (0, import_css54.cx)((0,
|
|
12252
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
12067
12253
|
"aria-label": `${valueLabel} ${index + 1}`
|
|
12068
12254
|
}
|
|
12069
12255
|
),
|
|
@@ -12073,7 +12259,7 @@ var KeyValueInput = ({
|
|
|
12073
12259
|
type: "button",
|
|
12074
12260
|
onClick: () => handleRemovePair(index),
|
|
12075
12261
|
disabled,
|
|
12076
|
-
className: (0, import_css54.cx)((0,
|
|
12262
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "remove-button")), styles.removeButton),
|
|
12077
12263
|
"aria-label": `${removeButtonText} ${pair.key}`,
|
|
12078
12264
|
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(X_default, { width: 16, height: 16 })
|
|
12079
12265
|
}
|
|
@@ -12082,7 +12268,7 @@ var KeyValueInput = ({
|
|
|
12082
12268
|
},
|
|
12083
12269
|
`${pair.key}-${index}`
|
|
12084
12270
|
)),
|
|
12085
|
-
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css54.cx)((0,
|
|
12271
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "add-row")), styles.addRow), children: [
|
|
12086
12272
|
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
12087
12273
|
TextField_default,
|
|
12088
12274
|
{
|
|
@@ -12090,7 +12276,7 @@ var KeyValueInput = ({
|
|
|
12090
12276
|
value: newKey,
|
|
12091
12277
|
onChange: (e) => setNewKey(e.target.value),
|
|
12092
12278
|
disabled,
|
|
12093
|
-
className: (0, import_css54.cx)((0,
|
|
12279
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
12094
12280
|
"aria-label": "New key"
|
|
12095
12281
|
}
|
|
12096
12282
|
),
|
|
@@ -12101,7 +12287,7 @@ var KeyValueInput = ({
|
|
|
12101
12287
|
value: newValue,
|
|
12102
12288
|
onChange: (e) => setNewValue(e.target.value),
|
|
12103
12289
|
disabled,
|
|
12104
|
-
className: (0, import_css54.cx)((0,
|
|
12290
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
12105
12291
|
"aria-label": "New value",
|
|
12106
12292
|
onKeyPress: (e) => {
|
|
12107
12293
|
if (e.key === "Enter" && !isAddDisabled) {
|
|
@@ -12116,15 +12302,15 @@ var KeyValueInput = ({
|
|
|
12116
12302
|
type: "button",
|
|
12117
12303
|
onClick: handleAddPair,
|
|
12118
12304
|
disabled: isAddDisabled,
|
|
12119
|
-
className: (0, import_css54.cx)((0,
|
|
12305
|
+
className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "add-button")), styles.addButton),
|
|
12120
12306
|
"aria-label": "Add new key-value pair",
|
|
12121
12307
|
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Plus_default, { width: 16, height: 16 })
|
|
12122
12308
|
}
|
|
12123
12309
|
)
|
|
12124
12310
|
] })
|
|
12125
12311
|
] }),
|
|
12126
|
-
(helperText || error) && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: (0, import_css54.cx)((0,
|
|
12127
|
-
maxPairs && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css54.cx)((0,
|
|
12312
|
+
(helperText || error) && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "helper-text")), styles.helperText), children: error || helperText }),
|
|
12313
|
+
maxPairs && /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css54.cx)((0, import_browser73.withVendorCSSClassPrefix)((0, import_browser73.bem)("key-value-input", "counter")), styles.counterText), children: [
|
|
12128
12314
|
pairs.length,
|
|
12129
12315
|
" of ",
|
|
12130
12316
|
maxPairs,
|
|
@@ -12328,13 +12514,13 @@ var BaseOrganizationProfile = ({
|
|
|
12328
12514
|
key: "created",
|
|
12329
12515
|
label: "Created Date",
|
|
12330
12516
|
editable: false,
|
|
12331
|
-
render: (value) => (0,
|
|
12517
|
+
render: (value) => (0, import_browser74.formatDate)(value)
|
|
12332
12518
|
},
|
|
12333
12519
|
{
|
|
12334
12520
|
key: "lastModified",
|
|
12335
12521
|
label: "Last Modified Date",
|
|
12336
12522
|
editable: false,
|
|
12337
|
-
render: (value) => (0,
|
|
12523
|
+
render: (value) => (0, import_browser74.formatDate)(value)
|
|
12338
12524
|
}
|
|
12339
12525
|
]
|
|
12340
12526
|
}) => {
|
|
@@ -12571,8 +12757,8 @@ var BaseOrganizationProfile = ({
|
|
|
12571
12757
|
var BaseOrganizationProfile_default = BaseOrganizationProfile;
|
|
12572
12758
|
|
|
12573
12759
|
// src/api/getOrganization.ts
|
|
12574
|
-
var
|
|
12575
|
-
var httpClient7 =
|
|
12760
|
+
var import_browser75 = require("@asgardeo/browser");
|
|
12761
|
+
var httpClient7 = import_browser75.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser75.AsgardeoSPAClient.getInstance());
|
|
12576
12762
|
var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
12577
12763
|
const defaultFetcher = async (url, config) => {
|
|
12578
12764
|
const response = await httpClient7({
|
|
@@ -12588,7 +12774,7 @@ var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
12588
12774
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
12589
12775
|
};
|
|
12590
12776
|
};
|
|
12591
|
-
return (0,
|
|
12777
|
+
return (0, import_browser75.getOrganization)({
|
|
12592
12778
|
...requestConfig,
|
|
12593
12779
|
fetcher: fetcher || defaultFetcher
|
|
12594
12780
|
});
|
|
@@ -12596,8 +12782,8 @@ var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
12596
12782
|
var getOrganization_default = getOrganization;
|
|
12597
12783
|
|
|
12598
12784
|
// src/api/updateOrganization.ts
|
|
12599
|
-
var
|
|
12600
|
-
var httpClient8 =
|
|
12785
|
+
var import_browser76 = require("@asgardeo/browser");
|
|
12786
|
+
var httpClient8 = import_browser76.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser76.AsgardeoSPAClient.getInstance());
|
|
12601
12787
|
var updateOrganization = async ({
|
|
12602
12788
|
fetcher,
|
|
12603
12789
|
...requestConfig
|
|
@@ -12617,7 +12803,7 @@ var updateOrganization = async ({
|
|
|
12617
12803
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
12618
12804
|
};
|
|
12619
12805
|
};
|
|
12620
|
-
return (0,
|
|
12806
|
+
return (0, import_browser76.updateOrganization)({
|
|
12621
12807
|
...requestConfig,
|
|
12622
12808
|
fetcher: fetcher || defaultFetcher
|
|
12623
12809
|
});
|
|
@@ -12670,7 +12856,7 @@ var OrganizationProfile = ({
|
|
|
12670
12856
|
const handleOrganizationUpdate = async (payload) => {
|
|
12671
12857
|
if (!baseUrl || !organizationId) return;
|
|
12672
12858
|
try {
|
|
12673
|
-
const operations = (0,
|
|
12859
|
+
const operations = (0, import_browser76.createPatchOperations)(payload);
|
|
12674
12860
|
await updateOrganization_default({
|
|
12675
12861
|
baseUrl,
|
|
12676
12862
|
organizationId,
|
|
@@ -13320,5 +13506,5 @@ var OrganizationSwitcher = ({
|
|
|
13320
13506
|
var OrganizationSwitcher_default = OrganizationSwitcher;
|
|
13321
13507
|
|
|
13322
13508
|
// src/index.ts
|
|
13323
|
-
var
|
|
13509
|
+
var import_browser77 = require("@asgardeo/browser");
|
|
13324
13510
|
//# sourceMappingURL=index.js.map
|