sales-frontend-components 0.0.105 → 0.0.106
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/index.cjs.js +0 -128
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -21
- package/dist/index.esm.js +3 -129
- package/dist/index.esm.js.map +1 -1
- package/package.json +14 -14
package/dist/index.cjs.js
CHANGED
|
@@ -21,8 +21,6 @@ var styles$9 = require('./modal/pre-standard/vehicle-search-modal/vehicle-search
|
|
|
21
21
|
var styles$a = require('./modal/pre-standard/organization-search-modal/organization-search-modal.module.scss');
|
|
22
22
|
var styles$b = require('./step-indicator/step-indicator.module.scss');
|
|
23
23
|
var styles$c = require('./camera/camera.module.scss');
|
|
24
|
-
var salesFrontendStores = require('sales-frontend-stores');
|
|
25
|
-
var salesFrontendBridge = require('sales-frontend-bridge');
|
|
26
24
|
|
|
27
25
|
const FormCheckboxButton = ({
|
|
28
26
|
name,
|
|
@@ -3981,134 +3979,9 @@ const useRemoteIdentityVerificationPopup = (config) => {
|
|
|
3981
3979
|
};
|
|
3982
3980
|
};
|
|
3983
3981
|
|
|
3984
|
-
const getFormFactor = () => {
|
|
3985
|
-
const { pathname } = location;
|
|
3986
|
-
if (pathname) {
|
|
3987
|
-
const segments = pathname.split("/").filter(Boolean);
|
|
3988
|
-
if (segments.length >= 2) {
|
|
3989
|
-
const secondSegment = segments[1]?.toLowerCase();
|
|
3990
|
-
if (secondSegment === "mobile") {
|
|
3991
|
-
return "phone";
|
|
3992
|
-
}
|
|
3993
|
-
if (secondSegment === "tablet") {
|
|
3994
|
-
return "tablet";
|
|
3995
|
-
}
|
|
3996
|
-
if (secondSegment === "pc") {
|
|
3997
|
-
return "pc";
|
|
3998
|
-
}
|
|
3999
|
-
}
|
|
4000
|
-
}
|
|
4001
|
-
return salesFrontendUtils.getFormFactorFromUserAgent(navigator.userAgent);
|
|
4002
|
-
};
|
|
4003
|
-
const createPureWebClientSession = async () => {
|
|
4004
|
-
const hasAccessToken = !!salesFrontendUtils.getCookie("accessToken");
|
|
4005
|
-
return {
|
|
4006
|
-
isInitialized: true,
|
|
4007
|
-
isLoggedIn: hasAccessToken,
|
|
4008
|
-
isWebView: false,
|
|
4009
|
-
acceptLanguage: navigator.language || "ko",
|
|
4010
|
-
formFactor: getFormFactor(),
|
|
4011
|
-
deviceId: salesFrontendUtils.getOrCreateDeviceId(),
|
|
4012
|
-
appVersion: `${salesFrontendUtils.getBrowserName(navigator.userAgent)} ${salesFrontendUtils.getBrowserVersion(navigator.userAgent)}`,
|
|
4013
|
-
loginType: "web-login",
|
|
4014
|
-
platformName: salesFrontendUtils.getOSName(navigator.userAgent),
|
|
4015
|
-
platformVersion: salesFrontendUtils.getOSVersion(navigator.userAgent),
|
|
4016
|
-
deviceModel: salesFrontendUtils.getDeviceModel(),
|
|
4017
|
-
loginChannel: salesFrontendUtils.isSalesPortal() ? "HMP" : "ETC"
|
|
4018
|
-
};
|
|
4019
|
-
};
|
|
4020
|
-
const createWebviewClientSession = async () => {
|
|
4021
|
-
const [appInfo, accessToken] = await Promise.allSettled([
|
|
4022
|
-
salesFrontendBridge.Bridge.native.getAppInfo(),
|
|
4023
|
-
salesFrontendUtils.isFpPlannerApp() ? Promise.resolve(salesFrontendUtils.getCookie("accessToken")) : salesFrontendBridge.Bridge.native.getAccessToken().then((res) => res.accessToken)
|
|
4024
|
-
]);
|
|
4025
|
-
const appInfoData = appInfo.status === "fulfilled" ? appInfo.value : null;
|
|
4026
|
-
const isLoggedIn = accessToken.status === "fulfilled" ? !!accessToken.value : false;
|
|
4027
|
-
const formFactor = appInfoData?.["X-Channel-FormFactor"]?.toLowerCase() ?? salesFrontendUtils.getCookie("formFactor")?.toLowerCase() ?? getFormFactor();
|
|
4028
|
-
const loginChannel = appInfoData?.["X-Channel-LoginChannel"] ?? salesFrontendUtils.getCookie("loginChannel") ?? "DSP";
|
|
4029
|
-
return {
|
|
4030
|
-
isInitialized: true,
|
|
4031
|
-
isLoggedIn,
|
|
4032
|
-
isWebView: true,
|
|
4033
|
-
acceptLanguage: appInfoData?.["Accept-Language"] ?? "ko",
|
|
4034
|
-
formFactor,
|
|
4035
|
-
deviceId: appInfoData?.["X-Channel-DeviceId"] ?? salesFrontendUtils.getCookie("deviceId"),
|
|
4036
|
-
appVersion: appInfoData?.["X-Channel-AppVersion"] ?? salesFrontendUtils.getCookie("appVersion"),
|
|
4037
|
-
loginType: appInfoData?.["X-Channel-LoginType"] ?? salesFrontendUtils.getCookie("loginType"),
|
|
4038
|
-
platformName: appInfoData?.["X-Channel-PlatformName"] ?? salesFrontendUtils.getCookie("platformName"),
|
|
4039
|
-
platformVersion: appInfoData?.["X-Channel-PlatformVersion"] ?? salesFrontendUtils.getCookie("platformVersion"),
|
|
4040
|
-
deviceModel: appInfoData?.["X-Channel-DeviceModel"] ?? salesFrontendUtils.getCookie("deviceModel"),
|
|
4041
|
-
loginChannel
|
|
4042
|
-
};
|
|
4043
|
-
};
|
|
4044
|
-
const getLoginUserInfo = async () => {
|
|
4045
|
-
try {
|
|
4046
|
-
const { isSuccess, data } = await method.getUserProfile();
|
|
4047
|
-
if (isSuccess && data) {
|
|
4048
|
-
console.log("[useSetupClientSession] \uD504\uB85C\uD544 \uB85C\uB4DC \uC131\uACF5");
|
|
4049
|
-
return data;
|
|
4050
|
-
}
|
|
4051
|
-
console.warn("[getLoginUserInfo] \uD504\uB85C\uD544 \uB85C\uB4DC \uC2E4\uD328: \uC751\uB2F5 \uC5C6\uC74C");
|
|
4052
|
-
return null;
|
|
4053
|
-
} catch (error) {
|
|
4054
|
-
console.error("[getLoginUserInfo] \uD504\uB85C\uD544 \uB85C\uB4DC \uC2E4\uD328:", error);
|
|
4055
|
-
return null;
|
|
4056
|
-
}
|
|
4057
|
-
};
|
|
4058
|
-
|
|
4059
|
-
const useSetupClientSession = () => {
|
|
4060
|
-
const { isInitialized, isLoggedIn } = salesFrontendStores.useClientSession();
|
|
4061
|
-
const setClientSession = salesFrontendStores.useSetClientSession();
|
|
4062
|
-
React.useEffect(() => {
|
|
4063
|
-
if (isInitialized) {
|
|
4064
|
-
console.log("[useSetupClientSession] Already initialized");
|
|
4065
|
-
return;
|
|
4066
|
-
}
|
|
4067
|
-
const initialize = async () => {
|
|
4068
|
-
try {
|
|
4069
|
-
console.log("[useSetupClientSession] \uCD08\uAE30\uD654 \uC2DC\uC791...");
|
|
4070
|
-
if (salesFrontendUtils.isWebView()) {
|
|
4071
|
-
console.log("[useSetupClientSession] \uC6F9\uBDF0 \uD658\uACBD \uAC10\uC9C0");
|
|
4072
|
-
setClientSession(await createWebviewClientSession());
|
|
4073
|
-
} else {
|
|
4074
|
-
console.log("[useSetupClientSession] \uC21C\uC218 \uC6F9 \uD658\uACBD \uAC10\uC9C0");
|
|
4075
|
-
setClientSession(await createPureWebClientSession());
|
|
4076
|
-
}
|
|
4077
|
-
console.log("[useSetupClientSession] \uAE30\uBCF8 \uC138\uC158 \uC124\uC815 \uC644\uB8CC");
|
|
4078
|
-
} catch (error) {
|
|
4079
|
-
console.error("[useSetupClientSession] \uCD08\uAE30\uD654 \uC2E4\uD328:", error);
|
|
4080
|
-
}
|
|
4081
|
-
};
|
|
4082
|
-
initialize();
|
|
4083
|
-
}, [isInitialized, setClientSession]);
|
|
4084
|
-
React.useEffect(() => {
|
|
4085
|
-
if (!isInitialized || !isLoggedIn) {
|
|
4086
|
-
return;
|
|
4087
|
-
}
|
|
4088
|
-
const loadUserInfo = async () => {
|
|
4089
|
-
console.log("[useSetupClientSession] \uC0AC\uC6A9\uC790 \uD504\uB85C\uD544 \uB85C\uB4DC \uC2DC\uC791...");
|
|
4090
|
-
const userInfo = await getLoginUserInfo();
|
|
4091
|
-
if (userInfo) {
|
|
4092
|
-
setClientSession(userInfo);
|
|
4093
|
-
}
|
|
4094
|
-
};
|
|
4095
|
-
loadUserInfo();
|
|
4096
|
-
}, [isInitialized, isLoggedIn, setClientSession]);
|
|
4097
|
-
return isInitialized ?? false;
|
|
4098
|
-
};
|
|
4099
|
-
|
|
4100
|
-
const ClientSessionProvider = ({ children, loadingComponent = null }) => {
|
|
4101
|
-
const isInitialized = useSetupClientSession();
|
|
4102
|
-
if (!isInitialized) {
|
|
4103
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: loadingComponent });
|
|
4104
|
-
}
|
|
4105
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
4106
|
-
};
|
|
4107
|
-
|
|
4108
3982
|
exports.Attachment = Attachment;
|
|
4109
3983
|
exports.BankStockSearchModal = BankStockSearchModal;
|
|
4110
3984
|
exports.CODES = CODES;
|
|
4111
|
-
exports.ClientSessionProvider = ClientSessionProvider;
|
|
4112
3985
|
exports.CustomerSearch = CustomerSearch;
|
|
4113
3986
|
exports.DeaCustomerSearchModal = DeaCustomerSearchModal;
|
|
4114
3987
|
exports.EmployeeSearchModal = EmployeeSearchModal;
|
|
@@ -4139,6 +4012,5 @@ exports.useRemoteIdentityVerificationPopup = useRemoteIdentityVerificationPopup;
|
|
|
4139
4012
|
exports.useSearchAddress = useSearchAddress;
|
|
4140
4013
|
exports.useSearchNationality = useSearchNationality;
|
|
4141
4014
|
exports.useSearchVisa = useSearchVisa;
|
|
4142
|
-
exports.useSetupClientSession = useSetupClientSession;
|
|
4143
4015
|
exports.useVisaComponent = useVisaComponent;
|
|
4144
4016
|
//# sourceMappingURL=index.cjs.js.map
|