@pendo/agent 2.302.3 → 2.304.0
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/dom.esm.js +38 -39
- package/dist/pendo.module.js +160 -71
- package/dist/pendo.module.min.js +10 -10
- package/dist/servers.json +7 -7
- package/package.json +1 -1
package/dist/dom.esm.js
CHANGED
|
@@ -7359,7 +7359,7 @@ function getScreenPosition(element) {
|
|
|
7359
7359
|
};
|
|
7360
7360
|
}
|
|
7361
7361
|
|
|
7362
|
-
var VERSION = '2.
|
|
7362
|
+
var VERSION = '2.304.0_';
|
|
7363
7363
|
|
|
7364
7364
|
var decodeURIComponent = _.isFunction(window.decodeURIComponent) ? window.decodeURIComponent : _.identity;
|
|
7365
7365
|
|
|
@@ -9255,50 +9255,49 @@ function isElementVisible(element, overflowPattern) {
|
|
|
9255
9255
|
// *Probably* visible...
|
|
9256
9256
|
return true;
|
|
9257
9257
|
}
|
|
9258
|
+
function scrollElementIntoParentRect(element, scrollParent) {
|
|
9259
|
+
var clientRect = getClientRect(element);
|
|
9260
|
+
var scrollRect = getClientRect(scrollParent);
|
|
9261
|
+
var yScrollAmount = 0;
|
|
9262
|
+
var xScrollAmount = 0;
|
|
9263
|
+
var diff;
|
|
9264
|
+
if (clientRect.bottom > scrollRect.bottom) {
|
|
9265
|
+
yScrollAmount += clientRect.bottom - scrollRect.bottom;
|
|
9266
|
+
clientRect.top -= yScrollAmount;
|
|
9267
|
+
clientRect.bottom -= yScrollAmount;
|
|
9268
|
+
}
|
|
9269
|
+
if (clientRect.top < scrollRect.top) {
|
|
9270
|
+
diff = scrollRect.top - clientRect.top;
|
|
9271
|
+
yScrollAmount -= diff;
|
|
9272
|
+
clientRect.top += diff;
|
|
9273
|
+
clientRect.bottom += diff;
|
|
9274
|
+
}
|
|
9275
|
+
if (clientRect.right > scrollRect.right) {
|
|
9276
|
+
xScrollAmount += clientRect.right - scrollRect.right;
|
|
9277
|
+
clientRect.left -= xScrollAmount;
|
|
9278
|
+
clientRect.right -= xScrollAmount;
|
|
9279
|
+
}
|
|
9280
|
+
if (clientRect.left < scrollRect.left) {
|
|
9281
|
+
diff = scrollRect.left - clientRect.left;
|
|
9282
|
+
xScrollAmount -= diff;
|
|
9283
|
+
clientRect.left += diff;
|
|
9284
|
+
clientRect.right += diff;
|
|
9285
|
+
}
|
|
9286
|
+
if (_.isFunction(scrollParent.scrollBy)) {
|
|
9287
|
+
scrollParent.scrollBy(xScrollAmount, yScrollAmount);
|
|
9288
|
+
}
|
|
9289
|
+
else {
|
|
9290
|
+
scrollParent.scrollTop += yScrollAmount;
|
|
9291
|
+
scrollParent.scrollLeft += xScrollAmount;
|
|
9292
|
+
}
|
|
9293
|
+
}
|
|
9258
9294
|
function scrollIntoView(element) {
|
|
9259
9295
|
var overflowScroll = /(auto|scroll)/;
|
|
9260
|
-
var clientRect;
|
|
9261
9296
|
var scrollParent;
|
|
9262
|
-
var scrollRect;
|
|
9263
|
-
var yScrollAmount;
|
|
9264
|
-
var xScrollAmount;
|
|
9265
|
-
var diff;
|
|
9266
9297
|
var pbody = getBody();
|
|
9267
9298
|
scrollParent = getScrollParent(element, overflowScroll);
|
|
9268
9299
|
while (scrollParent && scrollParent !== pbody) {
|
|
9269
|
-
|
|
9270
|
-
scrollRect = getClientRect(scrollParent);
|
|
9271
|
-
yScrollAmount = 0;
|
|
9272
|
-
xScrollAmount = 0;
|
|
9273
|
-
if (clientRect.bottom > scrollRect.bottom) {
|
|
9274
|
-
yScrollAmount += clientRect.bottom - scrollRect.bottom;
|
|
9275
|
-
clientRect.top -= yScrollAmount;
|
|
9276
|
-
clientRect.bottom -= yScrollAmount;
|
|
9277
|
-
}
|
|
9278
|
-
if (clientRect.top < scrollRect.top) {
|
|
9279
|
-
diff = scrollRect.top - clientRect.top;
|
|
9280
|
-
yScrollAmount -= diff;
|
|
9281
|
-
clientRect.top += diff;
|
|
9282
|
-
clientRect.bottom += diff;
|
|
9283
|
-
}
|
|
9284
|
-
if (clientRect.right > scrollRect.right) {
|
|
9285
|
-
xScrollAmount += clientRect.right - scrollRect.right;
|
|
9286
|
-
clientRect.left -= xScrollAmount;
|
|
9287
|
-
clientRect.right -= xScrollAmount;
|
|
9288
|
-
}
|
|
9289
|
-
if (clientRect.left < scrollRect.left) {
|
|
9290
|
-
diff = scrollRect.left - clientRect.left;
|
|
9291
|
-
xScrollAmount -= diff;
|
|
9292
|
-
clientRect.left += diff;
|
|
9293
|
-
clientRect.right += diff;
|
|
9294
|
-
}
|
|
9295
|
-
if (_.isFunction(scrollParent.scrollBy)) {
|
|
9296
|
-
scrollParent.scrollBy(xScrollAmount, yScrollAmount);
|
|
9297
|
-
}
|
|
9298
|
-
else {
|
|
9299
|
-
scrollParent.scrollTop += yScrollAmount;
|
|
9300
|
-
scrollParent.scrollLeft += xScrollAmount;
|
|
9301
|
-
}
|
|
9300
|
+
scrollElementIntoParentRect(element, scrollParent);
|
|
9302
9301
|
scrollParent = getScrollParent(scrollParent, overflowScroll);
|
|
9303
9302
|
}
|
|
9304
9303
|
}
|
package/dist/pendo.module.js
CHANGED
|
@@ -3904,8 +3904,8 @@ let SERVER = '';
|
|
|
3904
3904
|
let ASSET_HOST = '';
|
|
3905
3905
|
let ASSET_PATH = '';
|
|
3906
3906
|
let DESIGNER_SERVER = '';
|
|
3907
|
-
let VERSION = '2.
|
|
3908
|
-
let PACKAGE_VERSION = '2.
|
|
3907
|
+
let VERSION = '2.304.0_';
|
|
3908
|
+
let PACKAGE_VERSION = '2.304.0';
|
|
3909
3909
|
let LOADER = 'xhr';
|
|
3910
3910
|
/* eslint-enable agent-eslint-rules/no-gulp-env-references */
|
|
3911
3911
|
/**
|
|
@@ -4203,6 +4203,12 @@ var getNumberFromText = function (text) {
|
|
|
4203
4203
|
function isPromise(obj) {
|
|
4204
4204
|
return _.isObject(obj) && _.isFunction(obj.then);
|
|
4205
4205
|
}
|
|
4206
|
+
function unwrapFirefoxObject(obj) {
|
|
4207
|
+
if (obj && obj.hasOwnProperty('wrappedJSObject')) {
|
|
4208
|
+
return obj.wrappedJSObject;
|
|
4209
|
+
}
|
|
4210
|
+
return obj;
|
|
4211
|
+
}
|
|
4206
4212
|
|
|
4207
4213
|
var decodeURIComponent = _.isFunction(window.decodeURIComponent) ? window.decodeURIComponent : _.identity;
|
|
4208
4214
|
|
|
@@ -10738,50 +10744,49 @@ function wouldBeVisibleAfterAutoScroll(element) {
|
|
|
10738
10744
|
}
|
|
10739
10745
|
return true;
|
|
10740
10746
|
}
|
|
10747
|
+
function scrollElementIntoParentRect(element, scrollParent) {
|
|
10748
|
+
var clientRect = getClientRect(element);
|
|
10749
|
+
var scrollRect = getClientRect(scrollParent);
|
|
10750
|
+
var yScrollAmount = 0;
|
|
10751
|
+
var xScrollAmount = 0;
|
|
10752
|
+
var diff;
|
|
10753
|
+
if (clientRect.bottom > scrollRect.bottom) {
|
|
10754
|
+
yScrollAmount += clientRect.bottom - scrollRect.bottom;
|
|
10755
|
+
clientRect.top -= yScrollAmount;
|
|
10756
|
+
clientRect.bottom -= yScrollAmount;
|
|
10757
|
+
}
|
|
10758
|
+
if (clientRect.top < scrollRect.top) {
|
|
10759
|
+
diff = scrollRect.top - clientRect.top;
|
|
10760
|
+
yScrollAmount -= diff;
|
|
10761
|
+
clientRect.top += diff;
|
|
10762
|
+
clientRect.bottom += diff;
|
|
10763
|
+
}
|
|
10764
|
+
if (clientRect.right > scrollRect.right) {
|
|
10765
|
+
xScrollAmount += clientRect.right - scrollRect.right;
|
|
10766
|
+
clientRect.left -= xScrollAmount;
|
|
10767
|
+
clientRect.right -= xScrollAmount;
|
|
10768
|
+
}
|
|
10769
|
+
if (clientRect.left < scrollRect.left) {
|
|
10770
|
+
diff = scrollRect.left - clientRect.left;
|
|
10771
|
+
xScrollAmount -= diff;
|
|
10772
|
+
clientRect.left += diff;
|
|
10773
|
+
clientRect.right += diff;
|
|
10774
|
+
}
|
|
10775
|
+
if (_.isFunction(scrollParent.scrollBy)) {
|
|
10776
|
+
scrollParent.scrollBy(xScrollAmount, yScrollAmount);
|
|
10777
|
+
}
|
|
10778
|
+
else {
|
|
10779
|
+
scrollParent.scrollTop += yScrollAmount;
|
|
10780
|
+
scrollParent.scrollLeft += xScrollAmount;
|
|
10781
|
+
}
|
|
10782
|
+
}
|
|
10741
10783
|
function scrollIntoView(element) {
|
|
10742
10784
|
var overflowScroll = /(auto|scroll)/;
|
|
10743
|
-
var clientRect;
|
|
10744
10785
|
var scrollParent;
|
|
10745
|
-
var scrollRect;
|
|
10746
|
-
var yScrollAmount;
|
|
10747
|
-
var xScrollAmount;
|
|
10748
|
-
var diff;
|
|
10749
10786
|
var pbody = getBody();
|
|
10750
10787
|
scrollParent = getScrollParent(element, overflowScroll);
|
|
10751
10788
|
while (scrollParent && scrollParent !== pbody) {
|
|
10752
|
-
|
|
10753
|
-
scrollRect = getClientRect(scrollParent);
|
|
10754
|
-
yScrollAmount = 0;
|
|
10755
|
-
xScrollAmount = 0;
|
|
10756
|
-
if (clientRect.bottom > scrollRect.bottom) {
|
|
10757
|
-
yScrollAmount += clientRect.bottom - scrollRect.bottom;
|
|
10758
|
-
clientRect.top -= yScrollAmount;
|
|
10759
|
-
clientRect.bottom -= yScrollAmount;
|
|
10760
|
-
}
|
|
10761
|
-
if (clientRect.top < scrollRect.top) {
|
|
10762
|
-
diff = scrollRect.top - clientRect.top;
|
|
10763
|
-
yScrollAmount -= diff;
|
|
10764
|
-
clientRect.top += diff;
|
|
10765
|
-
clientRect.bottom += diff;
|
|
10766
|
-
}
|
|
10767
|
-
if (clientRect.right > scrollRect.right) {
|
|
10768
|
-
xScrollAmount += clientRect.right - scrollRect.right;
|
|
10769
|
-
clientRect.left -= xScrollAmount;
|
|
10770
|
-
clientRect.right -= xScrollAmount;
|
|
10771
|
-
}
|
|
10772
|
-
if (clientRect.left < scrollRect.left) {
|
|
10773
|
-
diff = scrollRect.left - clientRect.left;
|
|
10774
|
-
xScrollAmount -= diff;
|
|
10775
|
-
clientRect.left += diff;
|
|
10776
|
-
clientRect.right += diff;
|
|
10777
|
-
}
|
|
10778
|
-
if (_.isFunction(scrollParent.scrollBy)) {
|
|
10779
|
-
scrollParent.scrollBy(xScrollAmount, yScrollAmount);
|
|
10780
|
-
}
|
|
10781
|
-
else {
|
|
10782
|
-
scrollParent.scrollTop += yScrollAmount;
|
|
10783
|
-
scrollParent.scrollLeft += xScrollAmount;
|
|
10784
|
-
}
|
|
10789
|
+
scrollElementIntoParentRect(element, scrollParent);
|
|
10785
10790
|
scrollParent = getScrollParent(scrollParent, overflowScroll);
|
|
10786
10791
|
}
|
|
10787
10792
|
}
|
|
@@ -11535,9 +11540,33 @@ function hasHashedAllowedOriginServers() {
|
|
|
11535
11540
|
function parseUrl(url) {
|
|
11536
11541
|
if (!_.isString(url))
|
|
11537
11542
|
return;
|
|
11543
|
+
try {
|
|
11544
|
+
const urlObj = new URL(url);
|
|
11545
|
+
const filename = _.last(urlObj.pathname.split('/'));
|
|
11546
|
+
const splitFilename = filename.split('.');
|
|
11547
|
+
const result = {
|
|
11548
|
+
filename: _.first(splitFilename),
|
|
11549
|
+
extension: splitFilename.slice(1).join('.'),
|
|
11550
|
+
query: {}
|
|
11551
|
+
};
|
|
11552
|
+
if (urlObj.search.length) {
|
|
11553
|
+
result.query = queryStringToObject(urlObj.search.substring(1));
|
|
11554
|
+
}
|
|
11555
|
+
if (urlObj.hash.length) {
|
|
11556
|
+
const fragQueryStart = urlObj.hash.indexOf('?');
|
|
11557
|
+
if (fragQueryStart >= 0) {
|
|
11558
|
+
const fragmentQuery = urlObj.hash.substring(fragQueryStart + 1);
|
|
11559
|
+
result.fragmentQuery = queryStringToObject(fragmentQuery);
|
|
11560
|
+
}
|
|
11561
|
+
}
|
|
11562
|
+
return result;
|
|
11563
|
+
}
|
|
11564
|
+
catch (e) {
|
|
11565
|
+
}
|
|
11566
|
+
// original implementation, if URL object fails
|
|
11538
11567
|
var queryString = parseQueryString(url).substring(1);
|
|
11539
11568
|
var query = queryString && queryString.length ? queryStringToObject(queryString) : {};
|
|
11540
|
-
var filename = _.last(_.first(url.split(
|
|
11569
|
+
var filename = _.last(_.first(url.split(/[?#]/)).split('/'));
|
|
11541
11570
|
var splitFilename = filename.split('.');
|
|
11542
11571
|
return {
|
|
11543
11572
|
filename: _.first(splitFilename),
|
|
@@ -14749,9 +14778,12 @@ function applyBehaviors(behaviors, obj) {
|
|
|
14749
14778
|
function GuideFactory(guide) {
|
|
14750
14779
|
if (_.isFunction(guide.before))
|
|
14751
14780
|
return guide;
|
|
14781
|
+
guide = unwrapFirefoxObject(guide);
|
|
14752
14782
|
return applyBehaviors(GuideFactory.behaviors, guide);
|
|
14753
14783
|
}
|
|
14754
14784
|
function GuideStepFactory(step, guide) {
|
|
14785
|
+
step = unwrapFirefoxObject(step);
|
|
14786
|
+
guide = unwrapFirefoxObject(guide);
|
|
14755
14787
|
return applyBehaviors(GuideStepFactory.behaviors, step, guide);
|
|
14756
14788
|
}
|
|
14757
14789
|
GuideFactory.behaviors = [];
|
|
@@ -16497,7 +16529,7 @@ var BuildingBlockTooltips = (function () {
|
|
|
16497
16529
|
attachBBAdvanceActions,
|
|
16498
16530
|
attachScrollHandlers,
|
|
16499
16531
|
isBuildingBlockGuideRelativeToElement,
|
|
16500
|
-
|
|
16532
|
+
positionStepForGuide,
|
|
16501
16533
|
patchGuideContainerWidthForResponsiveTooltips
|
|
16502
16534
|
};
|
|
16503
16535
|
function patchGuideContainerWidthForResponsiveTooltips(step, providedGuideContainer, json) {
|
|
@@ -16516,12 +16548,19 @@ var BuildingBlockTooltips = (function () {
|
|
|
16516
16548
|
return;
|
|
16517
16549
|
calculateVwRelativeToLayoutDir(guideContainer, tooltipContext);
|
|
16518
16550
|
}
|
|
16519
|
-
function
|
|
16520
|
-
|
|
16521
|
-
|
|
16522
|
-
|
|
16551
|
+
function positionStepForGuide(step, json, guideContainerEle) {
|
|
16552
|
+
if (step.attributes && step.attributes.calculatedType === 'tooltip') {
|
|
16553
|
+
// This directly modifies step.guideElement object
|
|
16554
|
+
createBBTooltip(json, step.element, step, guideContainerEle);
|
|
16555
|
+
if (!step.hasBeenScrolledTo) {
|
|
16556
|
+
scrollIntoView(step.element);
|
|
16557
|
+
scrollToTooltip(step.element, guideContainerEle, step.attributes.layoutDir);
|
|
16558
|
+
step.hasBeenScrolledTo = true;
|
|
16559
|
+
}
|
|
16560
|
+
}
|
|
16561
|
+
else if (step.element && !step.hasBeenScrolledTo) {
|
|
16523
16562
|
scrollIntoView(step.element);
|
|
16524
|
-
|
|
16563
|
+
scrollElementIntoParentRect(step.element, window);
|
|
16525
16564
|
step.hasBeenScrolledTo = true;
|
|
16526
16565
|
}
|
|
16527
16566
|
}
|
|
@@ -18182,6 +18221,7 @@ function getAllowedAttributes(attributeKeyValueMap, stepId, guideId, type) {
|
|
|
18182
18221
|
}
|
|
18183
18222
|
function buildNodeFromJSON(json, step, guides) {
|
|
18184
18223
|
step = step || { id: 'unknown', guideId: 'unknown' };
|
|
18224
|
+
json = unwrapFirefoxObject(json);
|
|
18185
18225
|
json.props = getAllowedAttributes(json.props, step.id, step.guideId, json.type);
|
|
18186
18226
|
if (step.isDarkMode && json.darkModeProps) {
|
|
18187
18227
|
json.darkModeProps = getAllowedAttributes(json.darkModeProps, step.id, step.guideId, json.type);
|
|
@@ -18373,9 +18413,7 @@ function recalculateGuideHeightOnImgLoad(node, step) {
|
|
|
18373
18413
|
FlexboxPolyfill.flexAllThings(step.containerId, step);
|
|
18374
18414
|
}
|
|
18375
18415
|
}
|
|
18376
|
-
|
|
18377
|
-
BuildingBlockTooltips.positionStepForTooltip(step, step.domJson, guideContainer);
|
|
18378
|
-
}
|
|
18416
|
+
BuildingBlockTooltips.positionStepForGuide(step, step.domJson, guideContainer);
|
|
18379
18417
|
guideContainer.style.visibility = 'visible';
|
|
18380
18418
|
guideContainer.parentNode.style.visibility = 'visible';
|
|
18381
18419
|
dom.event.dispatch(guideContainer, {
|
|
@@ -18391,9 +18429,7 @@ function recalculateGuideHeightOnImgLoad(node, step) {
|
|
|
18391
18429
|
log.info('Failed to find guideContainer for id: ' + step.containerId);
|
|
18392
18430
|
return;
|
|
18393
18431
|
}
|
|
18394
|
-
|
|
18395
|
-
BuildingBlockTooltips.positionStepForTooltip(step, step.domJson, guideContainer);
|
|
18396
|
-
}
|
|
18432
|
+
BuildingBlockTooltips.positionStepForGuide(step, step.domJson, guideContainer);
|
|
18397
18433
|
guideContainer.style.visibility = 'visible';
|
|
18398
18434
|
guideContainer.parentNode.style.visibility = 'visible';
|
|
18399
18435
|
FlexboxPolyfill.flexAllThings(step.containerId, step);
|
|
@@ -28751,7 +28787,7 @@ var BuildingBlockGuides = (function () {
|
|
|
28751
28787
|
adjustGuideContentWidth,
|
|
28752
28788
|
findDomBlockInDomJson,
|
|
28753
28789
|
isElementHiddenInGuide: FlexboxPolyfill.isElementHiddenInGuide,
|
|
28754
|
-
positionStepForTooltip: BuildingBlockTooltips.
|
|
28790
|
+
positionStepForTooltip: BuildingBlockTooltips.positionStepForGuide,
|
|
28755
28791
|
flexAllThings: FlexboxPolyfill.flexAllThings,
|
|
28756
28792
|
flexElement: FlexboxPolyfill.flexElement,
|
|
28757
28793
|
findTopLevelContainer,
|
|
@@ -28808,7 +28844,8 @@ var BuildingBlockGuides = (function () {
|
|
|
28808
28844
|
step.hasEscapeListener = false;
|
|
28809
28845
|
step.containerId = containerJSON && containerJSON.props && containerJSON.props.id;
|
|
28810
28846
|
step.element = getElementForGuideStep(step, options.document);
|
|
28811
|
-
var
|
|
28847
|
+
var modifiableJSON = unwrapFirefoxObject(json);
|
|
28848
|
+
var guideToAppend = BuildingBlockGuides.buildNodeFromJSON(modifiableJSON, step, guides);
|
|
28812
28849
|
step.guideElement = guideToAppend;
|
|
28813
28850
|
var guideContainer = guideToAppend.find('#' + step.containerId);
|
|
28814
28851
|
var verticalAlignmentAttr = 'data-vertical-alignment';
|
|
@@ -28902,8 +28939,8 @@ var BuildingBlockGuides = (function () {
|
|
|
28902
28939
|
else {
|
|
28903
28940
|
BuildingBlockTooltips.attachBBAdvanceActions(step);
|
|
28904
28941
|
}
|
|
28905
|
-
if (
|
|
28906
|
-
BuildingBlockTooltips.
|
|
28942
|
+
if (!hasImageCount) {
|
|
28943
|
+
BuildingBlockTooltips.positionStepForGuide(step, modifiableJSON, guideContainer[0]);
|
|
28907
28944
|
}
|
|
28908
28945
|
if (isResourceCenter) {
|
|
28909
28946
|
BuildingBlockResourceCenter.showHomeViewOrEmptyState(guide);
|
|
@@ -30875,7 +30912,7 @@ function joinShowPromises(promises) {
|
|
|
30875
30912
|
// A group of one or more guide steps with no ordering.
|
|
30876
30913
|
function Guide() {
|
|
30877
30914
|
this.elements = [];
|
|
30878
|
-
this.attributes = this.attributes || {};
|
|
30915
|
+
this.attributes = (this.attributes && unwrapFirefoxObject(this.attributes)) || {};
|
|
30879
30916
|
if (this.attributes.device && this.attributes.device.type) {
|
|
30880
30917
|
if (this.attributes.device.type == 'all') {
|
|
30881
30918
|
this.attributes.device = { desktop: true, mobile: true };
|
|
@@ -38955,7 +38992,7 @@ class WebAnalytics {
|
|
|
38955
38992
|
const parsedUrl = this.api.util.parseUrl(url);
|
|
38956
38993
|
if (!parsedUrl)
|
|
38957
38994
|
return {};
|
|
38958
|
-
const
|
|
38995
|
+
const query = this.pendo._.extend({}, parsedUrl.fragmentQuery, parsedUrl.query);
|
|
38959
38996
|
const source = query.utm_source;
|
|
38960
38997
|
const medium = query.utm_medium;
|
|
38961
38998
|
const campaign = query.utm_campaign;
|
|
@@ -39586,6 +39623,7 @@ class DOMPrompt {
|
|
|
39586
39623
|
this.latestPromptValue = '';
|
|
39587
39624
|
this.isActive = true;
|
|
39588
39625
|
this.lastSubmitTime = 0;
|
|
39626
|
+
this.compositionState = new WeakMap();
|
|
39589
39627
|
this.dom = pendo.dom;
|
|
39590
39628
|
this._ = pendo._;
|
|
39591
39629
|
this.api = PluginAPI;
|
|
@@ -39606,23 +39644,63 @@ class DOMPrompt {
|
|
|
39606
39644
|
this.setupSubmitListeners();
|
|
39607
39645
|
this.setupObserver();
|
|
39608
39646
|
}
|
|
39647
|
+
isComposing(evt) {
|
|
39648
|
+
const target = evt.target;
|
|
39649
|
+
const isComposingFromState = target && this.compositionState.get(target);
|
|
39650
|
+
return evt.isComposing !== undefined ? evt.isComposing : isComposingFromState;
|
|
39651
|
+
}
|
|
39652
|
+
isEnterKey(evt) {
|
|
39653
|
+
return evt.code === 'Enter' || evt.key === 'Enter' || evt.keyCode === 13;
|
|
39654
|
+
}
|
|
39609
39655
|
setupInputListeners() {
|
|
39610
39656
|
this._.each(this.inputEls, (inputEl) => {
|
|
39611
39657
|
if (!inputEl) {
|
|
39612
39658
|
return;
|
|
39613
39659
|
}
|
|
39660
|
+
// Handle IME composition events (Japanese, Chinese, etc.) to prevent premature
|
|
39661
|
+
// analytics collection during intermediate input states
|
|
39662
|
+
inputEl.addEventListener('compositionstart', (evt) => {
|
|
39663
|
+
const target = evt.target;
|
|
39664
|
+
if (target) {
|
|
39665
|
+
this.compositionState.set(target, true);
|
|
39666
|
+
}
|
|
39667
|
+
}, true);
|
|
39668
|
+
inputEl.addEventListener('compositionend', (evt) => {
|
|
39669
|
+
const target = evt.target;
|
|
39670
|
+
if (target) {
|
|
39671
|
+
this.compositionState.set(target, false);
|
|
39672
|
+
this.capturePromptValue();
|
|
39673
|
+
}
|
|
39674
|
+
}, true);
|
|
39675
|
+
inputEl.addEventListener('compositionupdate', (evt) => {
|
|
39676
|
+
const target = evt.target;
|
|
39677
|
+
if (target) {
|
|
39678
|
+
this.compositionState.set(target, true);
|
|
39679
|
+
}
|
|
39680
|
+
}, true);
|
|
39681
|
+
inputEl.addEventListener('blur', (evt) => {
|
|
39682
|
+
const target = evt.target;
|
|
39683
|
+
if (target) {
|
|
39684
|
+
this.compositionState.set(target, false);
|
|
39685
|
+
}
|
|
39686
|
+
}, true);
|
|
39687
|
+
inputEl.addEventListener('input', (evt) => {
|
|
39688
|
+
if (!this.isComposing(evt)) {
|
|
39689
|
+
this.capturePromptValue();
|
|
39690
|
+
}
|
|
39691
|
+
}, true);
|
|
39614
39692
|
inputEl.addEventListener('change', (evt) => {
|
|
39615
|
-
// capture value from copy / paste
|
|
39616
39693
|
this.capturePromptValue();
|
|
39617
39694
|
}, true);
|
|
39618
39695
|
inputEl.addEventListener('keydown', (evt) => {
|
|
39619
|
-
|
|
39620
|
-
if (wasEnterKey) {
|
|
39696
|
+
if (this.isEnterKey(evt) && !this.isComposing(evt)) {
|
|
39621
39697
|
this.submit(this.latestPromptValue);
|
|
39622
39698
|
}
|
|
39623
39699
|
}, true);
|
|
39624
39700
|
inputEl.addEventListener('keyup', (evt) => {
|
|
39625
|
-
this.
|
|
39701
|
+
if (!this.isComposing(evt)) {
|
|
39702
|
+
this.capturePromptValue();
|
|
39703
|
+
}
|
|
39626
39704
|
}, true);
|
|
39627
39705
|
});
|
|
39628
39706
|
}
|
|
@@ -39639,8 +39717,7 @@ class DOMPrompt {
|
|
|
39639
39717
|
};
|
|
39640
39718
|
submitEl.addEventListener('mousedown', clickHandler, true);
|
|
39641
39719
|
const keydownHandler = (evt) => {
|
|
39642
|
-
|
|
39643
|
-
if (wasEnterKey) {
|
|
39720
|
+
if (this.isEnterKey(evt)) {
|
|
39644
39721
|
const currentValue = this.getPromptValue();
|
|
39645
39722
|
const valueToSubmit = currentValue || this.latestPromptValue;
|
|
39646
39723
|
this.submit(valueToSubmit);
|
|
@@ -40609,6 +40686,7 @@ function substitutionIcon(color, size) {
|
|
|
40609
40686
|
}
|
|
40610
40687
|
|
|
40611
40688
|
const requiredElement = '<span class="_pendo-required-indicator" style="color:red; font-style:italic;" title="Question is required"> *</span>';
|
|
40689
|
+
const requiredSyntax = '{required/}';
|
|
40612
40690
|
const RequiredQuestions = {
|
|
40613
40691
|
name: 'RequiredQuestions',
|
|
40614
40692
|
script(step, guide, pendo) {
|
|
@@ -40631,14 +40709,23 @@ const RequiredQuestions = {
|
|
|
40631
40709
|
}
|
|
40632
40710
|
});
|
|
40633
40711
|
}
|
|
40712
|
+
function getEligibleQuestions() {
|
|
40713
|
+
const allQuestions = step.guideElement.find(`[class*=-poll-question]:contains(${requiredSyntax})`);
|
|
40714
|
+
return pendo._.reduce(allQuestions, (eligibleQuestions, question) => {
|
|
40715
|
+
if (question.classList.contains('_pendo-yes-no-poll-question'))
|
|
40716
|
+
return eligibleQuestions;
|
|
40717
|
+
eligibleQuestions.push(question);
|
|
40718
|
+
return eligibleQuestions;
|
|
40719
|
+
}, []);
|
|
40720
|
+
}
|
|
40634
40721
|
function processRequiredQuestions() {
|
|
40635
|
-
let questions =
|
|
40722
|
+
let questions = getEligibleQuestions();
|
|
40636
40723
|
if (questions) {
|
|
40637
40724
|
pendo._.forEach(questions, question => {
|
|
40638
40725
|
let dataPendoPollId = question.getAttribute('data-pendo-poll-id');
|
|
40639
40726
|
requiredPollIds.push(dataPendoPollId);
|
|
40640
40727
|
pendo._.each(step.guideElement.find(`#${question.id} *, #${question.id}`), (element) => {
|
|
40641
|
-
guideMarkdownUtil.removeMarkdownSyntax(element,
|
|
40728
|
+
guideMarkdownUtil.removeMarkdownSyntax(element, requiredSyntax, '', pendo);
|
|
40642
40729
|
});
|
|
40643
40730
|
step.guideElement.find(`#${question.id} p`).append(requiredElement);
|
|
40644
40731
|
});
|
|
@@ -40705,7 +40792,7 @@ const RequiredQuestions = {
|
|
|
40705
40792
|
},
|
|
40706
40793
|
test(step, guide, pendo) {
|
|
40707
40794
|
var _a;
|
|
40708
|
-
let requiredQuestions = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find(
|
|
40795
|
+
let requiredQuestions = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find(`[class*=-poll-question]:contains(${requiredSyntax})`);
|
|
40709
40796
|
return !pendo._.isUndefined(requiredQuestions) && pendo._.size(requiredQuestions);
|
|
40710
40797
|
},
|
|
40711
40798
|
designerListener(pendo) {
|
|
@@ -40738,13 +40825,15 @@ const RequiredQuestions = {
|
|
|
40738
40825
|
dataPendoPollId = poll.getAttribute('data-pendo-poll-id');
|
|
40739
40826
|
}
|
|
40740
40827
|
let questionText;
|
|
40741
|
-
|
|
40828
|
+
const pollQuesiton = pendo.dom(`[class*="-poll-question"][data-pendo-poll-id=${dataPendoPollId}]`)[0];
|
|
40829
|
+
if (pollQuesiton) {
|
|
40742
40830
|
questionText = pendo.dom(`[class*="-poll-question"][data-pendo-poll-id=${dataPendoPollId}]`)[0].textContent;
|
|
40743
40831
|
}
|
|
40744
|
-
|
|
40832
|
+
const requiredSyntaxIndex = questionText.indexOf(requiredSyntax);
|
|
40833
|
+
if (requiredSyntaxIndex > -1) {
|
|
40745
40834
|
pendo._.each(pendo.dom(`[data-pendo-poll-id=${dataPendoPollId}]:not(.pendo-radio)`), (element) => {
|
|
40746
40835
|
pendo._.each(pendo.dom(`#${element.id} *:not(".pendo-radio"), #${element.id}:not(".pendo-radio")`), (item) => {
|
|
40747
|
-
guideMarkdownUtil.removeMarkdownSyntax(item,
|
|
40836
|
+
guideMarkdownUtil.removeMarkdownSyntax(item, requiredSyntax, '', pendo);
|
|
40748
40837
|
});
|
|
40749
40838
|
});
|
|
40750
40839
|
if (pendo.dom(`.bb-text[data-pendo-poll-id=${dataPendoPollId}] p`).length !== 0 || pendo.dom(`.bb-text[data-pendo-poll-id=${dataPendoPollId}] li`).length !== 0) {
|