sales-frontend-utils 0.0.22 → 0.0.24
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 +8 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -105,6 +105,9 @@ var isStorybookEnv = () => {
|
|
|
105
105
|
return false;
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
|
+
var getBusinessWorkDivisionCode = () => {
|
|
109
|
+
return location.pathname.split("/")[1] ?? "";
|
|
110
|
+
};
|
|
108
111
|
|
|
109
112
|
// src/utils/user-agent-utils.ts
|
|
110
113
|
var getDspExecutionEnvironment = () => {
|
|
@@ -451,7 +454,8 @@ var convertTextToImg = ({
|
|
|
451
454
|
backgroundColor,
|
|
452
455
|
fontColor,
|
|
453
456
|
fontSize,
|
|
454
|
-
fontWeight
|
|
457
|
+
fontWeight,
|
|
458
|
+
fontFamily = `'Malgun Gothic', '\uB9D1\uC740 \uACE0\uB515', 'sans-serif', 'Arial'`
|
|
455
459
|
}) => {
|
|
456
460
|
const canvas = document.createElement("canvas");
|
|
457
461
|
const ctx = canvas.getContext("2d");
|
|
@@ -467,8 +471,9 @@ var convertTextToImg = ({
|
|
|
467
471
|
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
468
472
|
}
|
|
469
473
|
ctx.fillStyle = fontColor ?? "black";
|
|
470
|
-
ctx.font = `${fontSize ?? 75}px ${fontWeight ?? "bold"}`;
|
|
471
474
|
ctx.textAlign = "center";
|
|
475
|
+
ctx.font = `${fontWeight ?? "bold"} ${fontSize ?? 75}px ${fontFamily}`;
|
|
476
|
+
console.log("font", `${fontWeight ?? "bold"} ${fontSize ?? 75}px ${fontFamily}`);
|
|
472
477
|
ctx.textBaseline = "middle";
|
|
473
478
|
ctx.fillText(targetStr, canvas.width / 2, canvas.height / 2);
|
|
474
479
|
return canvas.toDataURL();
|
|
@@ -736,6 +741,7 @@ exports.fileToBase64 = fileToBase64;
|
|
|
736
741
|
exports.getApiHostNameFromEnvironment = getApiHostNameFromEnvironment;
|
|
737
742
|
exports.getBrowserName = getBrowserName;
|
|
738
743
|
exports.getBrowserVersion = getBrowserVersion;
|
|
744
|
+
exports.getBusinessWorkDivisionCode = getBusinessWorkDivisionCode;
|
|
739
745
|
exports.getCdnHostNameFromEnvironment = getCdnHostNameFromEnvironment;
|
|
740
746
|
exports.getCookie = getCookie;
|
|
741
747
|
exports.getCurrentBrowserName = getCurrentBrowserName;
|