sales-frontend-utils 0.0.42 → 0.0.44
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 +20 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +20 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/ga/index.cjs +32 -0
- package/dist/utils/ga/index.cjs.map +1 -0
- package/dist/utils/ga/index.d.cts +3 -0
- package/dist/utils/ga/index.d.ts +3 -0
- package/dist/utils/ga/index.js +30 -0
- package/dist/utils/ga/index.js.map +1 -0
- package/dist/utils/user-agent-utils.cjs +1 -1
- package/dist/utils/user-agent-utils.cjs.map +1 -1
- package/dist/utils/user-agent-utils.js +1 -1
- package/dist/utils/user-agent-utils.js.map +1 -1
- package/package.json +53 -43
package/dist/index.d.cts
CHANGED
|
@@ -7,5 +7,6 @@ export { deleteCookie, getCookie, setCookie } from './utils/cookie-utils.cjs';
|
|
|
7
7
|
export { base64ToBlob, base64ToFile, blobToFile, downloadBlob, fileToBase64, getExt, imageUrlToFile, objectUrlToBase64, objectUrlToBlob } from './utils/file-utils.cjs';
|
|
8
8
|
export { addE2EObject, getE2EDataIDs, hasAstx2, initASTX2, loadScript } from './utils/astx2-utils.cjs';
|
|
9
9
|
export { DateFormat, PeriodType, convertDateFormat, convertDateString, getDateDiff, getLastDay, getOneMonthLater, getPeriodDate, isDate, isDateAfter, isFutureDate, isValidDate, validateBirthdate } from './utils/date-utils.cjs';
|
|
10
|
+
export { loadGaScript } from './utils/ga/index.cjs';
|
|
10
11
|
export { BrowserName, ExecutionEnvironment, OSName } from './types/common.types.cjs';
|
|
11
12
|
import 'dayjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -7,5 +7,6 @@ export { deleteCookie, getCookie, setCookie } from './utils/cookie-utils.js';
|
|
|
7
7
|
export { base64ToBlob, base64ToFile, blobToFile, downloadBlob, fileToBase64, getExt, imageUrlToFile, objectUrlToBase64, objectUrlToBlob } from './utils/file-utils.js';
|
|
8
8
|
export { addE2EObject, getE2EDataIDs, hasAstx2, initASTX2, loadScript } from './utils/astx2-utils.js';
|
|
9
9
|
export { DateFormat, PeriodType, convertDateFormat, convertDateString, getDateDiff, getLastDay, getOneMonthLater, getPeriodDate, isDate, isDateAfter, isFutureDate, isValidDate, validateBirthdate } from './utils/date-utils.js';
|
|
10
|
+
export { loadGaScript } from './utils/ga/index.js';
|
|
10
11
|
export { BrowserName, ExecutionEnvironment, OSName } from './types/common.types.js';
|
|
11
12
|
import 'dayjs';
|
package/dist/index.js
CHANGED
|
@@ -246,7 +246,7 @@ var getDspExecutionEnvironment = () => {
|
|
|
246
246
|
if (window.n2Bridge) {
|
|
247
247
|
return "android-webview";
|
|
248
248
|
}
|
|
249
|
-
if (window.webkit?.messageHandlers) {
|
|
249
|
+
if (window.webkit?.messageHandlers?.n2Bridge) {
|
|
250
250
|
return "ios-webview";
|
|
251
251
|
}
|
|
252
252
|
if (window.self !== window.top) {
|
|
@@ -976,6 +976,24 @@ var getPeriodDate = (periodType) => {
|
|
|
976
976
|
}
|
|
977
977
|
};
|
|
978
978
|
|
|
979
|
-
|
|
979
|
+
// src/utils/ga/ga.js
|
|
980
|
+
var ga_default = "(function (w, d, s, l, i) {\n w[l] = w[l] || [];\n w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' });\n let f = d.getElementsByTagName(s)[0],\n j = d.createElement(s),\n dl = l !== 'dataLayer' ? `&l=${l}` : '';\n j.async = true;\n j.src = `https://www.googletagmanager.com/gtm.js?id=${i}${dl}`;\n f.parentNode.insertBefore(j, f);\n})(window, document, 'script', 'dataLayer', 'GTM-PPT3LJ56');\n";
|
|
981
|
+
|
|
982
|
+
// src/utils/ga/index.ts
|
|
983
|
+
var loadGaScript = () => {
|
|
984
|
+
if (isClient()) {
|
|
985
|
+
if (document.querySelector('script[src*="googletagmanager.com/gtm.js"]')) {
|
|
986
|
+
return;
|
|
987
|
+
}
|
|
988
|
+
console.log("ga script load dynamic");
|
|
989
|
+
const script = document.createElement("script");
|
|
990
|
+
script.innerHTML = `
|
|
991
|
+
${ga_default}
|
|
992
|
+
`;
|
|
993
|
+
document.head.appendChild(script);
|
|
994
|
+
}
|
|
995
|
+
};
|
|
996
|
+
|
|
997
|
+
export { MessageEventManager, addE2EObject, base64ToBlob, base64ToFile, blobToFile, checkUserAgentDspApp, convertDateFormat, convertDateString, convertTextToImg, debounce, deleteCookie, downloadBlob, drawImageResizeCentered, fileToBase64, getApiHostNameFromEnvironment, getBrowserName, getBrowserVersion, getBusinessWorkDivisionCode, getCdnHostNameFromEnvironment, getCookie, getCurrentBrowserName, getCurrentBrowserVersion, getCurrentOSName, getCurrentOSVersion, getDateDiff, getDeviceModel, getDspApiBasePathFromEnvironment, getDspExecutionEnvironment, getDudApiBasePathFromEnvironment, getE2EDataIDs, getEnvironmentFromHostname, getExt, getFormFactorFromUserAgent, getLastDay, getNlcHostFromEnvironment, getOSName, getOSVersion, getOneMonthLater, getOrCreateDeviceId, getPeriodDate, getServicePath, getSubdomain, hasAstx2, imageUrlToFile, initASTX2, isClient, isDate, isDateAfter, isDspApp, isFpPlannerApp, isFutureDate, isPc, isPhone, isProductionApp, isSalesPortal, isStorybookEnv, isTablet, isValidDate, loadGaScript, loadScript, objectUrlToBase64, objectUrlToBlob, setCookie, throttle, validateBirthdate };
|
|
980
998
|
//# sourceMappingURL=index.js.map
|
|
981
999
|
//# sourceMappingURL=index.js.map
|