sales-frontend-utils 0.0.51 → 0.0.53
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 +11 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -12
- package/dist/index.js.map +1 -1
- package/dist/utils/canvas-utils.cjs +3 -3
- package/dist/utils/canvas-utils.cjs.map +1 -1
- package/dist/utils/canvas-utils.js +3 -3
- package/dist/utils/canvas-utils.js.map +1 -1
- package/dist/utils/cookie-utils.cjs.map +1 -1
- package/dist/utils/cookie-utils.js.map +1 -1
- package/dist/utils/environment-utils.cjs +8 -9
- package/dist/utils/environment-utils.cjs.map +1 -1
- package/dist/utils/environment-utils.d.cts +1 -2
- package/dist/utils/environment-utils.d.ts +1 -2
- package/dist/utils/environment-utils.js +8 -9
- package/dist/utils/environment-utils.js.map +1 -1
- package/dist/utils/file-utils.cjs.map +1 -1
- package/dist/utils/file-utils.js.map +1 -1
- package/dist/utils/ga/index.cjs.map +1 -1
- package/dist/utils/ga/index.js.map +1 -1
- package/dist/utils/user-agent-utils.cjs.map +1 -1
- package/dist/utils/user-agent-utils.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -103,9 +103,11 @@ var getSubdomain = (hostname) => {
|
|
|
103
103
|
return parts[0] ?? "";
|
|
104
104
|
};
|
|
105
105
|
var getEnvironmentFromHostname = (hostname) => {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
if (isClient()) {
|
|
107
|
+
const debugModeEnv = getCookie("dsp-debug-mode-env")?.toLowerCase();
|
|
108
|
+
if (debugModeEnv) {
|
|
109
|
+
return debugModeEnv;
|
|
110
|
+
}
|
|
109
111
|
}
|
|
110
112
|
const subDomain = getSubdomain(hostname);
|
|
111
113
|
if (hostname === "localhost" || hostname === "127.0.0.1" || hostname.startsWith("localhost")) {
|
|
@@ -182,18 +184,15 @@ var getCdnHostNameFromEnvironment = (currentHostname, forceApiHostName) => {
|
|
|
182
184
|
return "";
|
|
183
185
|
}
|
|
184
186
|
};
|
|
185
|
-
var getDudApiBasePathFromEnvironment = (hostname) => {
|
|
186
|
-
|
|
187
|
-
return "";
|
|
188
|
-
}
|
|
189
|
-
const environment = getEnvironmentFromHostname(hostname || location.hostname);
|
|
187
|
+
var getDudApiBasePathFromEnvironment = (hostname, servicePath) => {
|
|
188
|
+
const environment = getEnvironmentFromHostname(hostname);
|
|
190
189
|
switch (environment) {
|
|
191
190
|
/**
|
|
192
191
|
* local에서 호출시, rewrite동작을 위해 상대주소를 호출합니다.
|
|
193
192
|
* (cors이슈 해결을 위해 필수)
|
|
194
193
|
*/
|
|
195
194
|
case "local":
|
|
196
|
-
return `${
|
|
195
|
+
return `${servicePath}/api/dud`;
|
|
197
196
|
/**
|
|
198
197
|
* local 이 아닌 환경에서는 전체주소를 호출합니다.
|
|
199
198
|
*/
|
|
@@ -626,7 +625,7 @@ var convertTextToImg = ({
|
|
|
626
625
|
fontColor,
|
|
627
626
|
fontSize,
|
|
628
627
|
fontWeight,
|
|
629
|
-
fontFamily = `'
|
|
628
|
+
fontFamily = `'system-ui', 'sans-serif'`
|
|
630
629
|
}) => {
|
|
631
630
|
const canvas = document.createElement("canvas");
|
|
632
631
|
const ctx = canvas.getContext("2d");
|
|
@@ -643,8 +642,8 @@ var convertTextToImg = ({
|
|
|
643
642
|
}
|
|
644
643
|
ctx.fillStyle = fontColor ?? "black";
|
|
645
644
|
ctx.textAlign = "center";
|
|
646
|
-
ctx.font = `${fontWeight ?? "
|
|
647
|
-
console.log("font", `${fontWeight ?? "
|
|
645
|
+
ctx.font = `${fontWeight ?? "normal"} ${fontSize ?? 75}px ${fontFamily}`;
|
|
646
|
+
console.log("font", `${fontWeight ?? "normal"} ${fontSize ?? 75}px ${fontFamily}`);
|
|
648
647
|
ctx.textBaseline = "middle";
|
|
649
648
|
ctx.fillText(targetStr, canvas.width / 2, canvas.height / 2);
|
|
650
649
|
return canvas.toDataURL();
|