Skip to content

Commit 6735216

Browse files
committed
v6.8.8
1 parent 5789c6f commit 6735216

File tree

4 files changed

+435
-432
lines changed

4 files changed

+435
-432
lines changed

build/index.js

Lines changed: 134 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -5027,8 +5027,6 @@ var isLocalNetwork = function isLocalNetwork() {
50275027
return ["localhost", "127.0.0.1", "0.0.0.0", "", "::1"].includes(hostname) || hostname.startsWith("192.168.") || hostname.startsWith("10.0.") || hostname.endsWith(".local") || !hostname.includes(".");
50285028
};
50295029
;// CONCATENATED MODULE: ./src/Gleap.js
5030-
function Gleap_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { Gleap_typeof = function _typeof(obj) { return typeof obj; }; } else { Gleap_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return Gleap_typeof(obj); }
5031-
50325030
function Gleap_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
50335031

50345032
function Gleap_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -6195,178 +6193,178 @@ var Gleap_Gleap = /*#__PURE__*/function () {
61956193
}, {
61966194
key: "applyConfig",
61976195
value: function applyConfig(config, soft) {
6198-
var _this6 = this;
6199-
62006196
try {
6201-
var menuItems;
6202-
var menuItem;
6203-
var actionFlow;
6204-
var action;
6205-
var item;
6206-
6207-
var _ret = function () {
6208-
var flowConfig = config.flowConfig;
6209-
var projectActions = config.projectActions;
6210-
6211-
if (flowConfig.color) {
6212-
_this6.setStyles({
6213-
primaryColor: flowConfig.color,
6214-
headerColor: flowConfig.headerColor,
6215-
buttonColor: flowConfig.buttonColor,
6216-
borderRadius: flowConfig.borderRadius,
6217-
backgroundColor: flowConfig.backgroundColor ? flowConfig.backgroundColor : "#FFFFFF"
6218-
});
6219-
} // If it's only a soft update, return here.
6197+
var flowConfig = config.flowConfig;
6198+
var projectActions = config.projectActions;
6199+
6200+
if (flowConfig.color) {
6201+
Gleap.setStyles({
6202+
primaryColor: flowConfig.color,
6203+
headerColor: flowConfig.headerColor,
6204+
buttonColor: flowConfig.buttonColor,
6205+
borderRadius: flowConfig.borderRadius,
6206+
backgroundColor: flowConfig.backgroundColor ? flowConfig.backgroundColor : "#FFFFFF"
6207+
});
6208+
} // If it's only a soft update, return here.
62206209

62216210

6222-
if (soft) {
6223-
return {
6224-
v: void 0
6225-
};
6226-
}
6211+
if (soft) {
6212+
return;
6213+
}
62276214

6228-
if (flowConfig.logo && flowConfig.logo.length > 0) {
6229-
_this6.setLogoUrl(flowConfig.logo);
6230-
}
6215+
if (flowConfig.logo && flowConfig.logo.length > 0) {
6216+
Gleap.setLogoUrl(flowConfig.logo);
6217+
}
62316218

6232-
if (flowConfig.hideBranding) {
6233-
_this6.enablePoweredBy();
6234-
}
6219+
if (flowConfig.hideBranding) {
6220+
Gleap.enablePoweredBy();
6221+
}
62356222

6236-
if (flowConfig.networkLogPropsToIgnore) {
6237-
_this6.setNetworkLogFilters(flowConfig.networkLogPropsToIgnore);
6238-
}
6223+
if (flowConfig.enableReplays) {
6224+
Gleap.enableReplays(flowConfig.enableReplays);
6225+
}
62396226

6240-
if (!flowConfig.enableConsoleLogs) {
6241-
_this6.disableConsoleLogOverwrite();
6242-
}
6227+
Gleap.enableShortcuts(flowConfig.enableShortcuts ? true : false);
62436228

6244-
if (typeof flowConfig.enableCrashDetector !== "undefined" && flowConfig.enableCrashDetector) {
6245-
_this6.enableCrashDetector(true, flowConfig.enableCrashDetector);
6246-
}
6229+
if (flowConfig.enableNetworkLogs) {
6230+
Gleap.enableNetworkLogger();
6231+
}
62476232

6248-
if (typeof flowConfig.enableRageClickDetector !== "undefined" && flowConfig.enableRageClickDetector) {
6249-
_this6.enableRageClickDetector(flowConfig.rageClickDetectorIsSilent);
6250-
}
6233+
if (flowConfig.networkLogPropsToIgnore) {
6234+
Gleap.setNetworkLogFilters(flowConfig.networkLogPropsToIgnore);
6235+
}
62516236

6252-
if (flowConfig.customTranslations) {
6253-
_this6.setCustomTranslation(flowConfig.customTranslations);
6254-
}
6237+
if (!flowConfig.enableConsoleLogs) {
6238+
Gleap.disableConsoleLogOverwrite();
6239+
}
62556240

6256-
if (typeof flowConfig.feedbackButtonPosition !== "undefined" && flowConfig.feedbackButtonPosition.length > 0) {
6257-
_this6.setButtonType(flowConfig.feedbackButtonPosition);
6258-
}
6241+
if (typeof flowConfig.enableCrashDetector !== "undefined" && flowConfig.enableCrashDetector) {
6242+
Gleap.enableCrashDetector(true, flowConfig.enableCrashDetector);
6243+
}
62596244

6260-
if (typeof flowConfig.widgetButtonText !== "undefined" && flowConfig.widgetButtonText.length > 0) {
6261-
_this6.setFeedbackButtonText(flowConfig.widgetButtonText);
6262-
}
6245+
if (typeof flowConfig.enableRageClickDetector !== "undefined" && flowConfig.enableRageClickDetector) {
6246+
Gleap.enableRageClickDetector(flowConfig.rageClickDetectorIsSilent);
6247+
}
62636248

6264-
if (typeof flowConfig.hideWavingHandAfterName !== "undefined" && flowConfig.hideWavingHandAfterName) {
6265-
_this6.setWelcomeIcon("");
6266-
}
6249+
if (flowConfig.customTranslations) {
6250+
Gleap.setCustomTranslation(flowConfig.customTranslations);
6251+
}
62676252

6268-
if (typeof flowConfig.hideUsersName !== "undefined" && flowConfig.hideUsersName) {
6269-
_this6.setShowUserName(false);
6270-
}
6253+
if (typeof flowConfig.feedbackButtonPosition !== "undefined" && flowConfig.feedbackButtonPosition.length > 0) {
6254+
Gleap.setButtonType(flowConfig.feedbackButtonPosition);
6255+
}
62716256

6272-
if (flowConfig.widgetInfoTitle && flowConfig.widgetInfoTitle.length > 0) {
6273-
_this6.setWidgetInfo({
6274-
title: flowConfig.widgetInfoTitle
6275-
});
6276-
}
6257+
if (typeof flowConfig.widgetButtonText !== "undefined" && flowConfig.widgetButtonText.length > 0) {
6258+
Gleap.setFeedbackButtonText(flowConfig.widgetButtonText);
6259+
}
62776260

6278-
if (flowConfig.widgetInfoSubtitle && flowConfig.widgetInfoSubtitle.length > 0) {
6279-
_this6.setWidgetInfo({
6280-
subtitle: flowConfig.widgetInfoSubtitle
6281-
});
6282-
}
6261+
if (typeof flowConfig.hideWavingHandAfterName !== "undefined" && flowConfig.hideWavingHandAfterName) {
6262+
Gleap.setWelcomeIcon("");
6263+
}
62836264

6284-
if (flowConfig.widgetInfoDialogSubtitle && flowConfig.widgetInfoDialogSubtitle.length > 0) {
6285-
_this6.setWidgetInfo({
6286-
dialogSubtitle: flowConfig.widgetInfoDialogSubtitle
6287-
});
6288-
}
6265+
if (typeof flowConfig.hideUsersName !== "undefined" && flowConfig.hideUsersName) {
6266+
Gleap.setShowUserName(false);
6267+
}
6268+
6269+
if (flowConfig.widgetInfoTitle && flowConfig.widgetInfoTitle.length > 0) {
6270+
Gleap.setWidgetInfo({
6271+
title: flowConfig.widgetInfoTitle
6272+
});
6273+
}
62896274

6290-
var instance = _this6.getInstance();
6275+
if (flowConfig.widgetInfoSubtitle && flowConfig.widgetInfoSubtitle.length > 0) {
6276+
Gleap.setWidgetInfo({
6277+
subtitle: flowConfig.widgetInfoSubtitle
6278+
});
6279+
}
62916280

6292-
if (flowConfig.enableMenu && flowConfig.menuItems && flowConfig.menuItems.length > 0) {
6293-
menuItems = [];
6281+
if (flowConfig.widgetInfoDialogSubtitle && flowConfig.widgetInfoDialogSubtitle.length > 0) {
6282+
Gleap.setWidgetInfo({
6283+
dialogSubtitle: flowConfig.widgetInfoDialogSubtitle
6284+
});
6285+
}
62946286

6295-
for (var _i2 = 0; _i2 < flowConfig.menuItems.length; _i2++) {
6296-
menuItem = flowConfig.menuItems[_i2];
6297-
actionFlow = null;
6298-
action = null;
6287+
if (flowConfig.enableMenu && flowConfig.menuItems && flowConfig.menuItems.length > 0) {
6288+
var menuItems = [];
62996289

6300-
if (menuItem.actionType === "OPEN_INTERCOM") {
6301-
action = function action() {
6302-
if (instance.widgetCallback) {
6303-
return;
6304-
}
6290+
var _loop = function _loop(_i2) {
6291+
var menuItem = flowConfig.menuItems[_i2];
6292+
var actionFlow = null;
6293+
var action = null;
63056294

6306-
if (typeof Intercom !== "undefined") {
6307-
Intercom("showNewMessage");
6308-
}
6309-
};
6310-
} else if (menuItem.actionType === "REDIRECT_URL") {
6295+
if (menuItem.actionType === "OPEN_INTERCOM") {
6296+
action = function action() {
63116297
if (instance.widgetCallback) {
6312-
action = function action() {
6313-
instance.widgetCallback("openExternalURL", {
6314-
url: menuItem.actionBody
6315-
});
6316-
};
6317-
} else {
6318-
if (menuItem.actionOpenInNewTab) {
6319-
action = function action() {
6320-
window.open(menuItem.actionBody, "_blank").focus();
6321-
};
6322-
} else {
6323-
action = function action() {
6324-
window.location.href = menuItem.actionBody;
6325-
};
6326-
}
6298+
return;
6299+
}
6300+
6301+
if (typeof Intercom !== "undefined") {
6302+
Intercom("showNewMessage");
63276303
}
6328-
} else if (menuItem.actionType === "CUSTOM_ACTION") {
6304+
};
6305+
} else if (menuItem.actionType === "REDIRECT_URL") {
6306+
if (instance.widgetCallback) {
63296307
action = function action() {
6330-
this.triggerCustomAction(menuItem.actionBody);
6308+
instance.widgetCallback("openExternalURL", {
6309+
url: menuItem.actionBody
6310+
});
63316311
};
63326312
} else {
6333-
actionFlow = menuItem.actionType;
6334-
} // Action flow
6335-
6313+
if (menuItem.actionOpenInNewTab) {
6314+
action = function action() {
6315+
window.open(menuItem.actionBody, "_blank").focus();
6316+
};
6317+
} else {
6318+
action = function action() {
6319+
window.location.href = menuItem.actionBody;
6320+
};
6321+
}
6322+
}
6323+
} else if (menuItem.actionType === "CUSTOM_ACTION") {
6324+
action = function action() {
6325+
Gleap.triggerCustomAction(menuItem.actionBody);
6326+
};
6327+
} else {
6328+
actionFlow = menuItem.actionType;
6329+
} // Action flow
63366330

6337-
if (actionFlow != null || action != null) {
6338-
item = {
6339-
title: menuItem.title,
6340-
description: menuItem.description,
6341-
icon: menuItem.icon,
6342-
color: menuItem.color
6343-
};
63446331

6345-
if (actionFlow) {
6346-
item["actionFlow"] = actionFlow;
6347-
}
6332+
if (actionFlow != null || action != null) {
6333+
item = {
6334+
title: menuItem.title,
6335+
description: menuItem.description,
6336+
icon: menuItem.icon,
6337+
color: menuItem.color
6338+
};
63486339

6349-
if (action) {
6350-
item["action"] = action;
6351-
}
6340+
if (actionFlow) {
6341+
item["actionFlow"] = actionFlow;
6342+
}
63526343

6353-
menuItems.push(item);
6344+
if (action) {
6345+
item["action"] = action;
63546346
}
6347+
6348+
menuItems.push(item);
63556349
}
6350+
};
63566351

6357-
_this6.setMenuOptions(menuItems);
6358-
}
6352+
for (var _i2 = 0; _i2 < flowConfig.menuItems.length; _i2++) {
6353+
var item;
63596354

6360-
if (projectActions) {
6361-
_this6.setFeedbackActions(projectActions);
6355+
_loop(_i2);
63626356
}
63636357

6364-
if (flowConfig.buttonLogo && flowConfig.buttonLogo.length > 0) {
6365-
_this6.setButtonLogoUrl(flowConfig.buttonLogo);
6366-
}
6367-
}();
6358+
Gleap.setMenuOptions(menuItems);
6359+
}
63686360

6369-
if (Gleap_typeof(_ret) === "object") return _ret.v;
6361+
if (projectActions) {
6362+
Gleap.setFeedbackActions(projectActions);
6363+
}
6364+
6365+
if (flowConfig.buttonLogo && flowConfig.buttonLogo.length > 0) {
6366+
Gleap.setButtonLogoUrl(flowConfig.buttonLogo);
6367+
}
63706368
} catch (e) {
63716369
console.log(e);
63726370
}

0 commit comments

Comments
 (0)