@adobe/alloy 2.21.1 → 2.22.0-alpha.1
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/babel.config.cjs +0 -1
- package/libEs5/baseCode/index.js +3 -2
- package/libEs5/components/ActivityCollector/attachClickActivityCollector.js +23 -20
- package/libEs5/components/ActivityCollector/configValidators.js +2 -2
- package/libEs5/components/ActivityCollector/createClickActivityStorage.js +11 -9
- package/libEs5/components/ActivityCollector/createClickedElementProperties.js +39 -32
- package/libEs5/components/ActivityCollector/createGetClickedElementProperties.js +28 -20
- package/libEs5/components/ActivityCollector/createInjectClickedElementProperties.js +24 -21
- package/libEs5/components/ActivityCollector/createRecallAndInjectClickedElementProperties.js +10 -8
- package/libEs5/components/ActivityCollector/createStorePageViewProperties.js +6 -4
- package/libEs5/components/ActivityCollector/getLinkName.js +19 -18
- package/libEs5/components/ActivityCollector/getLinkRegion.js +10 -9
- package/libEs5/components/ActivityCollector/index.js +61 -45
- package/libEs5/components/ActivityCollector/utils/activityMapExtensionEnabled.js +3 -5
- package/libEs5/components/ActivityCollector/utils/createTransientStorage.js +7 -6
- package/libEs5/components/ActivityCollector/utils/determineLinkType.js +4 -3
- package/libEs5/components/ActivityCollector/utils/dom/elementHasClickHandler.js +3 -2
- package/libEs5/components/ActivityCollector/utils/dom/extractDomain.js +5 -4
- package/libEs5/components/ActivityCollector/utils/dom/findClickableElement.js +4 -3
- package/libEs5/components/ActivityCollector/utils/dom/getAbsoluteUrlFromAnchorElement.js +11 -8
- package/libEs5/components/ActivityCollector/utils/dom/isButtonSubmitElement.js +3 -2
- package/libEs5/components/ActivityCollector/utils/dom/isDownloadLink.js +6 -5
- package/libEs5/components/ActivityCollector/utils/dom/isExitLink.js +6 -5
- package/libEs5/components/ActivityCollector/utils/dom/isInputSubmitElement.js +4 -3
- package/libEs5/components/ActivityCollector/utils/dom/isSupportedAnchorElement.js +3 -2
- package/libEs5/components/ActivityCollector/utils/dom/isSupportedTextNode.js +4 -3
- package/libEs5/components/ActivityCollector/utils/hasPageName.js +4 -3
- package/libEs5/components/ActivityCollector/utils/isDifferentDomains.js +5 -4
- package/libEs5/components/ActivityCollector/utils/trimQueryFromUrl.js +5 -4
- package/libEs5/components/ActivityCollector/utils/truncateWhiteSpace.js +3 -2
- package/libEs5/components/ActivityCollector/utils/urlStartsWithScheme.js +3 -2
- package/libEs5/components/Audiences/index.js +13 -12
- package/libEs5/components/Audiences/injectProcessDestinations.js +32 -35
- package/libEs5/components/Audiences/injectProcessResponse.js +19 -16
- package/libEs5/components/Context/createComponent.js +10 -13
- package/libEs5/components/Context/implementationDetails.js +5 -4
- package/libEs5/components/Context/index.js +24 -28
- package/libEs5/components/Context/injectDevice.js +23 -15
- package/libEs5/components/Context/injectEnvironment.js +17 -12
- package/libEs5/components/Context/injectHighEntropyUserAgentHints.js +12 -21
- package/libEs5/components/Context/injectPlaceContext.js +8 -7
- package/libEs5/components/Context/injectTimestamp.js +6 -5
- package/libEs5/components/Context/injectWeb.js +6 -5
- package/libEs5/components/DataCollector/index.js +37 -38
- package/libEs5/components/DataCollector/validateApplyResponse.js +6 -4
- package/libEs5/components/DataCollector/validateUserEventOptions.js +6 -4
- package/libEs5/components/DecisioningEngine/consequenceAdapters/inAppMessageConsequenceAdapter.js +11 -8
- package/libEs5/components/DecisioningEngine/consequenceAdapters/schemaTypeConsequenceAdapter.js +10 -7
- package/libEs5/components/DecisioningEngine/constants.js +3 -3
- package/libEs5/components/DecisioningEngine/createApplyResponse.js +15 -15
- package/libEs5/components/DecisioningEngine/createConsequenceAdapter.js +17 -13
- package/libEs5/components/DecisioningEngine/createContextProvider.js +48 -44
- package/libEs5/components/DecisioningEngine/createDecisionHistory.js +7 -5
- package/libEs5/components/DecisioningEngine/createDecisionProvider.js +16 -21
- package/libEs5/components/DecisioningEngine/createEvaluableRulesetPayload.js +39 -37
- package/libEs5/components/DecisioningEngine/createEvaluateRulesetsCommand.js +21 -19
- package/libEs5/components/DecisioningEngine/createEventRegistry.js +63 -67
- package/libEs5/components/DecisioningEngine/createOnResponseHandler.js +23 -22
- package/libEs5/components/DecisioningEngine/createSubscribeRulesetItems.js +100 -55
- package/libEs5/components/DecisioningEngine/index.js +83 -54
- package/libEs5/components/DecisioningEngine/utils.js +43 -38
- package/libEs5/components/EventMerge/createComponent.js +5 -3
- package/libEs5/components/EventMerge/createEventMergeId.js +3 -2
- package/libEs5/components/EventMerge/index.js +1 -1
- package/libEs5/components/Identity/addEcidQueryToPayload.js +3 -2
- package/libEs5/components/Identity/addEcidToPayload.js +3 -2
- package/libEs5/components/Identity/appendIdentityToUrl/injectAppendIdentityToUrl.js +13 -23
- package/libEs5/components/Identity/configValidators.js +1 -1
- package/libEs5/components/Identity/constants/authState.js +3 -3
- package/libEs5/components/Identity/createComponent.js +39 -33
- package/libEs5/components/Identity/createLegacyIdentity.js +29 -29
- package/libEs5/components/Identity/getEcidFromResponse.js +5 -7
- package/libEs5/components/Identity/getIdentity/createGetIdentity.js +17 -15
- package/libEs5/components/Identity/getIdentity/createIdentityRequest.js +10 -8
- package/libEs5/components/Identity/getIdentity/createIdentityRequestPayload.js +5 -4
- package/libEs5/components/Identity/index.js +61 -62
- package/libEs5/components/Identity/injectAddLegacyEcidToPayload.js +8 -6
- package/libEs5/components/Identity/injectAddQueryStringIdentityToPayload.js +46 -52
- package/libEs5/components/Identity/injectAwaitIdentityCookie.js +14 -11
- package/libEs5/components/Identity/injectEnsureSingleIdentity.js +25 -24
- package/libEs5/components/Identity/injectHandleResponseForIdSyncs.js +6 -4
- package/libEs5/components/Identity/injectProcessIdSyncs.js +20 -22
- package/libEs5/components/Identity/injectSetDomainForInitialIdentityPayload.js +7 -5
- package/libEs5/components/Identity/visitorService/awaitVisitorOptIn.js +8 -6
- package/libEs5/components/Identity/visitorService/getVisitor.js +4 -3
- package/libEs5/components/Identity/visitorService/injectGetEcidFromVisitor.js +15 -13
- package/libEs5/components/LegacyMediaAnalytics/constants/constants.js +9 -9
- package/libEs5/components/LegacyMediaAnalytics/constants/mediaKeysToXdmConverter.js +2 -2
- package/libEs5/components/LegacyMediaAnalytics/createGetInstance.js +61 -63
- package/libEs5/components/LegacyMediaAnalytics/createLegacyMediaComponent.js +38 -37
- package/libEs5/components/LegacyMediaAnalytics/createMediaHelper.js +54 -52
- package/libEs5/components/LegacyMediaAnalytics/index.js +32 -33
- package/libEs5/components/LibraryInfo/index.js +23 -30
- package/libEs5/components/MachineLearning/index.js +1 -1
- package/libEs5/components/MachineLearning/processResponse.js +5 -3
- package/libEs5/components/Personalization/constants/loggerMessage.js +2 -2
- package/libEs5/components/Personalization/constants/scopeType.js +3 -3
- package/libEs5/components/Personalization/constants/surface.js +4 -4
- package/libEs5/components/Personalization/createActionsProvider.js +37 -32
- package/libEs5/components/Personalization/createApplyPropositions.js +71 -81
- package/libEs5/components/Personalization/createClickStorage.js +30 -32
- package/libEs5/components/Personalization/createComponent.js +65 -74
- package/libEs5/components/Personalization/createFetchDataHandler.js +83 -52
- package/libEs5/components/Personalization/createGetPageLocation.js +6 -6
- package/libEs5/components/Personalization/createHandleConsentFlicker.js +15 -14
- package/libEs5/components/Personalization/createInteractionStorage.js +25 -39
- package/libEs5/components/Personalization/createNotificationHandler.js +9 -10
- package/libEs5/components/Personalization/createOnClickHandler.js +29 -25
- package/libEs5/components/Personalization/createOnDecisionHandler.js +23 -21
- package/libEs5/components/Personalization/createPersonalizationDetails.js +39 -45
- package/libEs5/components/Personalization/createPreprocessors.js +7 -7
- package/libEs5/components/Personalization/createSetTargetMigration.js +6 -4
- package/libEs5/components/Personalization/createViewCacheManager.js +29 -32
- package/libEs5/components/Personalization/createViewChangeHandler.js +35 -20
- package/libEs5/components/Personalization/dom-actions/action.js +24 -25
- package/libEs5/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +12 -13
- package/libEs5/components/Personalization/dom-actions/appendHtml.js +8 -7
- package/libEs5/components/Personalization/dom-actions/clicks/collectClicks.js +28 -33
- package/libEs5/components/Personalization/dom-actions/clicks/collectInteractions.js +37 -40
- package/libEs5/components/Personalization/dom-actions/collectInteractions.js +3 -2
- package/libEs5/components/Personalization/dom-actions/createPreprocess.js +10 -11
- package/libEs5/components/Personalization/dom-actions/createRedirect.js +11 -13
- package/libEs5/components/Personalization/dom-actions/dom/createFragment.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/getAttribute.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/getChildNodes.js +6 -3
- package/libEs5/components/Personalization/dom-actions/dom/getChildren.js +6 -3
- package/libEs5/components/Personalization/dom-actions/dom/getElementById.js +3 -3
- package/libEs5/components/Personalization/dom-actions/dom/getFirstChild.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/getNextSibling.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/getNonce.js +7 -6
- package/libEs5/components/Personalization/dom-actions/dom/getParent.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/helperForEq.js +7 -7
- package/libEs5/components/Personalization/dom-actions/dom/index.js +14 -14
- package/libEs5/components/Personalization/dom-actions/dom/insertAfter.js +4 -3
- package/libEs5/components/Personalization/dom-actions/dom/insertBefore.js +4 -3
- package/libEs5/components/Personalization/dom-actions/dom/isDomElement.js +2 -3
- package/libEs5/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +6 -5
- package/libEs5/components/Personalization/dom-actions/dom/removeAttribute.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/selectNodesWithEq.js +39 -38
- package/libEs5/components/Personalization/dom-actions/dom/setAttribute.js +3 -2
- package/libEs5/components/Personalization/dom-actions/dom/setStyle.js +4 -3
- package/libEs5/components/Personalization/dom-actions/images.js +10 -9
- package/libEs5/components/Personalization/dom-actions/index.js +1 -1
- package/libEs5/components/Personalization/dom-actions/initDomActionsModules.js +40 -25
- package/libEs5/components/Personalization/dom-actions/insertHtmlAfter.js +9 -8
- package/libEs5/components/Personalization/dom-actions/insertHtmlBefore.js +8 -7
- package/libEs5/components/Personalization/dom-actions/prependHtml.js +13 -10
- package/libEs5/components/Personalization/dom-actions/rearrangeChildren.js +9 -7
- package/libEs5/components/Personalization/dom-actions/remapCustomCodeOffers.js +14 -9
- package/libEs5/components/Personalization/dom-actions/remapHeadOffers.js +16 -14
- package/libEs5/components/Personalization/dom-actions/replaceHtml.js +4 -3
- package/libEs5/components/Personalization/dom-actions/scripts.js +58 -38
- package/libEs5/components/Personalization/dom-actions/setAttributes.js +4 -3
- package/libEs5/components/Personalization/dom-actions/setHtml.js +5 -4
- package/libEs5/components/Personalization/dom-actions/setStyles.js +8 -8
- package/libEs5/components/Personalization/dom-actions/setText.js +3 -2
- package/libEs5/components/Personalization/dom-actions/swapImage.js +3 -2
- package/libEs5/components/Personalization/flicker/index.js +66 -49
- package/libEs5/components/Personalization/handlers/createDecorateProposition.js +16 -13
- package/libEs5/components/Personalization/handlers/createProcessDomAction.js +45 -50
- package/libEs5/components/Personalization/handlers/createProcessHtmlContent.js +30 -29
- package/libEs5/components/Personalization/handlers/createProcessInAppMessage.js +35 -31
- package/libEs5/components/Personalization/handlers/createProcessPropositions.js +109 -105
- package/libEs5/components/Personalization/handlers/createProcessRedirect.js +38 -28
- package/libEs5/components/Personalization/handlers/injectCreateProposition.js +59 -67
- package/libEs5/components/Personalization/handlers/processDefaultContent.js +3 -2
- package/libEs5/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +140 -121
- package/libEs5/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +4 -5
- package/libEs5/components/Personalization/in-app-message-actions/utils.js +23 -19
- package/libEs5/components/Personalization/index.js +120 -103
- package/libEs5/components/Personalization/utils/addRenderAttemptedToDecisions.js +10 -10
- package/libEs5/components/Personalization/utils/createAsyncArray.js +10 -9
- package/libEs5/components/Personalization/utils/isAuthoringModeEnabled.js +3 -3
- package/libEs5/components/Personalization/utils/metaUtils.js +14 -19
- package/libEs5/components/Personalization/utils/surfaceUtils.js +27 -46
- package/libEs5/components/Personalization/validateApplyPropositionsOptions.js +8 -6
- package/libEs5/components/Privacy/computeConsentHash.js +9 -9
- package/libEs5/components/Privacy/createComponent.js +32 -32
- package/libEs5/components/Privacy/createConsentHashStore.js +27 -24
- package/libEs5/components/Privacy/createConsentRequest.js +10 -8
- package/libEs5/components/Privacy/createConsentRequestPayload.js +9 -8
- package/libEs5/components/Privacy/createStoredConsent.js +11 -9
- package/libEs5/components/Privacy/index.js +26 -23
- package/libEs5/components/Privacy/injectSendSetConsentRequest.js +30 -29
- package/libEs5/components/Privacy/parseConsentCookie.js +6 -14
- package/libEs5/components/StreamingMedia/createMediaEventManager.js +59 -45
- package/libEs5/components/StreamingMedia/createMediaRequest.js +8 -6
- package/libEs5/components/StreamingMedia/createMediaResponseHandler.js +22 -17
- package/libEs5/components/StreamingMedia/createMediaSessionCacheManager.js +22 -18
- package/libEs5/components/StreamingMedia/createStreamingMediaComponent.js +30 -29
- package/libEs5/components/StreamingMedia/createTrackMediaEvent.js +41 -36
- package/libEs5/components/StreamingMedia/createTrackMediaSession.js +25 -22
- package/libEs5/components/StreamingMedia/index.js +33 -34
- package/libEs5/components/StreamingMedia/validateMediaEventOptions.js +9 -12
- package/libEs5/components/StreamingMedia/validateMediaSessionOptions.js +6 -4
- package/libEs5/constants/browser.js +7 -7
- package/libEs5/constants/consentPurpose.js +1 -1
- package/libEs5/constants/consentStatus.js +3 -3
- package/libEs5/constants/contentType.js +2 -2
- package/libEs5/constants/cookieNameKey.js +3 -3
- package/libEs5/constants/coreCommands.js +2 -2
- package/libEs5/constants/decisionProvider.js +4 -3
- package/libEs5/constants/domain.js +2 -2
- package/libEs5/constants/elementAttribute.js +1 -1
- package/libEs5/constants/eventType.js +5 -5
- package/libEs5/constants/handle.js +1 -1
- package/libEs5/constants/httpHeaderNames.js +2 -2
- package/libEs5/constants/httpStatusCode.js +5 -5
- package/libEs5/constants/identityMapAuthenticatedState.js +3 -3
- package/libEs5/constants/legacyCookies.js +3 -3
- package/libEs5/constants/libraryVersion.js +1 -1
- package/libEs5/constants/propositionEventType.js +18 -12
- package/libEs5/constants/propositionInteractionType.js +4 -4
- package/libEs5/constants/schema.js +11 -11
- package/libEs5/constants/sessionDataKeys.js +1 -1
- package/libEs5/constants/tagName.js +7 -7
- package/libEs5/core/buildAndValidateConfig.js +55 -69
- package/libEs5/core/componentCreators.js +70 -41
- package/libEs5/core/config/createConfig.js +4 -3
- package/libEs5/core/config/createCoreConfigs.js +11 -12
- package/libEs5/core/consent/createConsent.js +16 -14
- package/libEs5/core/consent/createConsentStateMachine.js +27 -35
- package/libEs5/core/createComponentRegistry.js +28 -27
- package/libEs5/core/createCookieTransfer.js +18 -18
- package/libEs5/core/createEvent.js +39 -44
- package/libEs5/core/createEventManager.js +64 -69
- package/libEs5/core/createInstanceFunction.js +4 -11
- package/libEs5/core/createLifecycle.js +14 -19
- package/libEs5/core/createLogController.js +30 -29
- package/libEs5/core/createLogger.js +41 -27
- package/libEs5/core/edgeNetwork/handleRequestFailure.js +6 -5
- package/libEs5/core/edgeNetwork/injectApplyResponse.js +29 -32
- package/libEs5/core/edgeNetwork/injectExtractEdgeInfo.js +19 -25
- package/libEs5/core/edgeNetwork/injectGetLocationHint.js +11 -11
- package/libEs5/core/edgeNetwork/injectProcessWarningsAndErrors.js +20 -16
- package/libEs5/core/edgeNetwork/injectSendEdgeNetworkRequest.js +42 -38
- package/libEs5/core/edgeNetwork/mergeLifecycleResponses.js +8 -12
- package/libEs5/core/index.js +137 -133
- package/libEs5/core/initializeComponents.js +17 -15
- package/libEs5/core/injectCreateResponse.js +47 -53
- package/libEs5/core/injectExecuteCommand.js +39 -40
- package/libEs5/core/injectHandleError.js +19 -19
- package/libEs5/core/injectShouldTransferCookie.js +12 -12
- package/libEs5/core/network/getRequestRetryDelay.js +20 -18
- package/libEs5/core/network/injectSendNetworkRequest.js +46 -49
- package/libEs5/core/network/isRequestRetryable.js +9 -8
- package/libEs5/core/network/requestMethods/injectSendBeaconRequest.js +10 -8
- package/libEs5/core/network/requestMethods/injectSendFetchRequest.js +18 -19
- package/libEs5/core/requiredComponentCreators.js +23 -0
- package/libEs5/core/validateCommandOptions.js +14 -11
- package/libEs5/index.js +43 -22
- package/libEs5/standalone.js +6 -1
- package/libEs5/utils/areThirdPartyCookiesSupportedByDefault.js +3 -5
- package/libEs5/utils/assignConcatArrayValues.js +9 -18
- package/libEs5/utils/clone.js +2 -3
- package/libEs5/utils/cookieJar.js +4 -4
- package/libEs5/utils/crc32.js +8 -8
- package/libEs5/utils/createCallbackAggregator.js +7 -11
- package/libEs5/utils/createCollect.js +52 -0
- package/libEs5/utils/createLoggingCookieJar.js +14 -16
- package/libEs5/utils/createMerger.js +9 -10
- package/libEs5/utils/createSubscription.js +48 -48
- package/libEs5/utils/createTaskQueue.js +8 -7
- package/libEs5/utils/deduplicateArray.js +7 -11
- package/libEs5/utils/deepAssign.js +7 -11
- package/libEs5/utils/defer.js +5 -4
- package/libEs5/utils/dom/appendNode.js +3 -2
- package/libEs5/utils/dom/awaitSelector.js +36 -34
- package/libEs5/utils/dom/createNode.js +10 -15
- package/libEs5/utils/dom/index.js +8 -8
- package/libEs5/utils/dom/isShadowSelector.js +2 -3
- package/libEs5/utils/dom/matchesSelector.js +3 -2
- package/libEs5/utils/dom/querySelectorAll.js +5 -13
- package/libEs5/utils/dom/removeNode.js +4 -3
- package/libEs5/utils/dom/selectNodes.js +3 -3
- package/libEs5/utils/dom/selectNodesWithShadow.js +14 -23
- package/libEs5/utils/event.js +49 -0
- package/libEs5/utils/filterObject.js +14 -12
- package/libEs5/utils/fireImage.js +10 -9
- package/libEs5/utils/flattenArray.js +4 -11
- package/libEs5/utils/flattenObject.js +8 -18
- package/libEs5/utils/getApexDomain.js +7 -6
- package/libEs5/utils/getBrowser.js +45 -12
- package/libEs5/utils/getLastArrayItems.js +2 -3
- package/libEs5/utils/getNamespacedCookieName.js +2 -3
- package/libEs5/utils/groupBy.js +6 -5
- package/libEs5/utils/index.js +50 -113
- package/libEs5/utils/injectDoesIdentityCookieExist.js +7 -7
- package/libEs5/utils/injectFireReferrerHideableImage.js +28 -34
- package/libEs5/utils/injectStorage.js +13 -15
- package/libEs5/utils/intersection.js +2 -6
- package/libEs5/utils/isBlankString.js +2 -3
- package/libEs5/utils/isBoolean.js +2 -3
- package/libEs5/utils/isEmptyObject.js +2 -3
- package/libEs5/utils/isFunction.js +2 -3
- package/libEs5/utils/isInteger.js +4 -3
- package/libEs5/utils/isNamespacedCookieName.js +2 -3
- package/libEs5/utils/isNil.js +2 -3
- package/libEs5/utils/isNonEmptyArray.js +2 -3
- package/libEs5/utils/isNonEmptyString.js +2 -3
- package/libEs5/utils/isNumber.js +2 -4
- package/libEs5/utils/isObject.js +3 -4
- package/libEs5/utils/isString.js +2 -3
- package/libEs5/utils/isUnique.js +6 -5
- package/libEs5/utils/isValidRegExp.js +3 -2
- package/libEs5/utils/memoize.js +7 -6
- package/libEs5/utils/noop.js +2 -1
- package/libEs5/utils/parseUrl.js +19 -25
- package/libEs5/utils/prepareConfigOverridesForEdge.js +6 -5
- package/libEs5/utils/request/createAddIdentity.js +4 -3
- package/libEs5/utils/request/createDataCollectionRequest.js +15 -11
- package/libEs5/utils/request/createDataCollectionRequestPayload.js +9 -10
- package/libEs5/utils/request/createGetAssuranceValidationTokenParams.js +17 -15
- package/libEs5/utils/request/createHasIdentity.js +4 -5
- package/libEs5/utils/request/createRequest.js +26 -23
- package/libEs5/utils/request/createRequestParams.js +13 -13
- package/libEs5/utils/request/createRequestPayload.js +13 -12
- package/libEs5/utils/request/index.js +8 -8
- package/libEs5/utils/sanitizeOrgIdForCookieName.js +2 -3
- package/libEs5/utils/stackError.js +8 -6
- package/libEs5/utils/stringToBoolean.js +3 -2
- package/libEs5/utils/toArray.js +3 -2
- package/libEs5/utils/toError.js +3 -2
- package/libEs5/utils/toISOStringLocal.js +29 -14
- package/libEs5/utils/toInteger.js +5 -5
- package/libEs5/utils/updateErrorMessage.js +6 -4
- package/libEs5/utils/validation/booleanValidator.js +3 -2
- package/libEs5/utils/validation/callbackValidator.js +3 -2
- package/libEs5/utils/validation/createAnyOfValidator.js +14 -17
- package/libEs5/utils/validation/createArrayOfValidator.js +16 -18
- package/libEs5/utils/validation/createDefaultValidator.js +7 -8
- package/libEs5/utils/validation/createDeprecatedValidator.js +12 -14
- package/libEs5/utils/validation/createLiteralValidator.js +5 -6
- package/libEs5/utils/validation/createMapOfValuesValidator.js +20 -22
- package/libEs5/utils/validation/createMaximumValidator.js +5 -6
- package/libEs5/utils/validation/createMinimumValidator.js +5 -6
- package/libEs5/utils/validation/createNoUnknownFieldsValidator.js +13 -14
- package/libEs5/utils/validation/createNonEmptyValidator.js +9 -10
- package/libEs5/utils/validation/createObjectOfValidator.js +27 -29
- package/libEs5/utils/validation/createRenamedValidator.js +24 -27
- package/libEs5/utils/validation/createUniqueItemsValidator.js +4 -3
- package/libEs5/utils/validation/createUniqueValidator.js +5 -4
- package/libEs5/utils/validation/domainValidator.js +4 -3
- package/libEs5/utils/validation/index.js +66 -72
- package/libEs5/utils/validation/integerValidator.js +3 -2
- package/libEs5/utils/validation/matchesRegexpValidator.js +5 -6
- package/libEs5/utils/validation/numberValidator.js +3 -2
- package/libEs5/utils/validation/regexpValidator.js +3 -2
- package/libEs5/utils/validation/requiredValidator.js +3 -2
- package/libEs5/utils/validation/stringValidator.js +3 -2
- package/libEs5/utils/validation/utils.js +29 -35
- package/libEs6/components/ActivityCollector/index.js +18 -8
- package/libEs6/components/Context/createComponent.js +1 -3
- package/libEs6/components/DecisioningEngine/createApplyResponse.js +1 -1
- package/libEs6/components/DecisioningEngine/createSubscribeRulesetItems.js +78 -28
- package/libEs6/components/DecisioningEngine/index.js +22 -2
- package/libEs6/components/DecisioningEngine/utils.js +2 -9
- package/libEs6/components/Identity/createComponent.js +4 -2
- package/libEs6/components/Identity/getEcidFromResponse.js +1 -3
- package/libEs6/components/LegacyMediaAnalytics/createGetInstance.js +2 -2
- package/libEs6/components/LibraryInfo/index.js +4 -5
- package/libEs6/components/Personalization/createActionsProvider.js +4 -2
- package/libEs6/components/Personalization/createComponent.js +2 -2
- package/libEs6/components/Personalization/createFetchDataHandler.js +35 -1
- package/libEs6/components/Personalization/createPersonalizationDetails.js +6 -6
- package/libEs6/components/Personalization/createViewCacheManager.js +5 -2
- package/libEs6/components/Personalization/createViewChangeHandler.js +11 -1
- package/libEs6/components/Personalization/dom-actions/createPreprocess.js +5 -2
- package/libEs6/components/Personalization/dom-actions/dom/selectNodesWithEq.js +1 -3
- package/libEs6/components/Personalization/dom-actions/remapCustomCodeOffers.js +6 -4
- package/libEs6/components/Personalization/dom-actions/remapHeadOffers.js +3 -2
- package/libEs6/components/Personalization/dom-actions/scripts.js +18 -2
- package/libEs6/components/Personalization/flicker/index.js +44 -30
- package/libEs6/components/Personalization/handlers/createDecorateProposition.js +2 -2
- package/libEs6/components/Personalization/handlers/createProcessPropositions.js +29 -9
- package/libEs6/components/Personalization/handlers/createProcessRedirect.js +9 -0
- package/libEs6/components/Personalization/handlers/injectCreateProposition.js +0 -3
- package/libEs6/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +8 -5
- package/libEs6/components/Personalization/in-app-message-actions/utils.js +2 -2
- package/libEs6/components/Personalization/index.js +9 -5
- package/libEs6/components/Personalization/utils/addRenderAttemptedToDecisions.js +4 -4
- package/libEs6/components/Personalization/utils/surfaceUtils.js +3 -3
- package/libEs6/constants/decisionProvider.js +1 -0
- package/libEs6/constants/libraryVersion.js +1 -1
- package/libEs6/constants/schema.js +1 -1
- package/libEs6/core/buildAndValidateConfig.js +8 -5
- package/libEs6/core/componentCreators.js +14 -43
- package/libEs6/core/config/createConfig.js +3 -2
- package/libEs6/core/createCookieTransfer.js +1 -3
- package/libEs6/core/createInstanceFunction.js +1 -9
- package/libEs6/core/createLogger.js +17 -2
- package/libEs6/core/edgeNetwork/injectExtractEdgeInfo.js +1 -7
- package/libEs6/core/index.js +11 -10
- package/libEs6/core/injectCreateResponse.js +1 -3
- package/libEs6/core/network/isRequestRetryable.js +1 -2
- package/libEs6/core/network/requestMethods/injectSendFetchRequest.js +1 -2
- package/libEs6/{utils/assignIf.js → core/requiredComponentCreators.js} +4 -8
- package/libEs6/index.js +26 -6
- package/libEs6/standalone.js +7 -1
- package/libEs6/utils/areThirdPartyCookiesSupportedByDefault.js +1 -2
- package/libEs6/utils/assignConcatArrayValues.js +1 -2
- package/libEs6/utils/cookieJar.js +4 -4
- package/libEs6/{components/Personalization → utils}/createCollect.js +3 -3
- package/libEs6/utils/createSubscription.js +20 -3
- package/libEs6/utils/dom/querySelectorAll.js +1 -10
- package/libEs6/utils/dom/selectNodesWithShadow.js +2 -12
- package/libEs6/{components/Personalization → utils}/event.js +1 -1
- package/libEs6/utils/index.js +1 -10
- package/libEs6/utils/injectStorage.js +1 -2
- package/libEs6/utils/intersection.js +1 -4
- package/libEs6/utils/isNumber.js +1 -2
- package/libEs6/utils/toISOStringLocal.js +14 -1
- package/libEs6/utils/toInteger.js +1 -2
- package/libEs6/utils/validation/createAnyOfValidator.js +1 -2
- package/libEs6/utils/validation/utils.js +3 -6
- package/package.json +35 -37
- package/rollup.config.js +115 -7
- package/scripts/alloyBuilder.js +89 -55
- package/scripts/helpers/entryPointGeneratorBabelPlugin.js +39 -0
- package/libEs5/components/Personalization/createCollect.js +0 -53
- package/libEs5/components/Personalization/event.js +0 -49
- package/libEs5/core/network/requestMethods/injectSendXhrRequest.js +0 -50
- package/libEs5/utils/assign.js +0 -16
- package/libEs5/utils/assignIf.js +0 -21
- package/libEs5/utils/endsWith.js +0 -23
- package/libEs5/utils/find.js +0 -30
- package/libEs5/utils/flatMap.js +0 -17
- package/libEs5/utils/includes.js +0 -23
- package/libEs5/utils/padStart.js +0 -27
- package/libEs5/utils/startsWith.js +0 -23
- package/libEs5/utils/values.js +0 -25
- package/libEs6/core/network/requestMethods/injectSendXhrRequest.js +0 -49
- package/libEs6/utils/assign.js +0 -14
- package/libEs6/utils/endsWith.js +0 -19
- package/libEs6/utils/find.js +0 -28
- package/libEs6/utils/flatMap.js +0 -14
- package/libEs6/utils/includes.js +0 -21
- package/libEs6/utils/padStart.js +0 -25
- package/libEs6/utils/startsWith.js +0 -19
- package/libEs6/utils/values.js +0 -21
- package/scripts/helpers/alloyComponents.js +0 -63
- package/scripts/helpers/conditionalBuildBabelPlugin.js +0 -57
package/babel.config.cjs
CHANGED
package/libEs5/baseCode/index.js
CHANGED
|
@@ -33,7 +33,7 @@ governing permissions and limitations under the License.
|
|
|
33
33
|
* Take particular care to write well-minifiable code, as consumers are
|
|
34
34
|
* particularly sensitive to base code size.
|
|
35
35
|
*/
|
|
36
|
-
var _default =
|
|
36
|
+
var _default = (window, instanceNames) => {
|
|
37
37
|
instanceNames.forEach(function (instanceName) {
|
|
38
38
|
if (!window[instanceName]) {
|
|
39
39
|
// __alloyNS stores a name of each "instance", or in other words, each
|
|
@@ -58,4 +58,5 @@ var _default = exports.default = function _default(window, instanceNames) {
|
|
|
58
58
|
window[instanceName].q = [];
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
-
};
|
|
61
|
+
};
|
|
62
|
+
exports.default = _default;
|
|
@@ -14,24 +14,25 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
const createClickHandler = ({
|
|
18
|
+
eventManager,
|
|
19
|
+
lifecycle,
|
|
20
|
+
handleError
|
|
21
|
+
}) => {
|
|
22
|
+
return clickEvent => {
|
|
22
23
|
// Ignore repropagated clicks from AppMeasurement
|
|
23
24
|
if (clickEvent.s_fe) {
|
|
24
25
|
return Promise.resolve();
|
|
25
26
|
}
|
|
26
27
|
// TODO: Consider safeguarding from the same object being clicked multiple times in rapid succession?
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
const clickedElement = clickEvent.target;
|
|
29
|
+
const event = eventManager.createEvent();
|
|
29
30
|
// this is to make sure a exit link personalization metric use send beacon
|
|
30
31
|
event.documentMayUnload();
|
|
31
32
|
return lifecycle.onClick({
|
|
32
|
-
event
|
|
33
|
-
clickedElement
|
|
34
|
-
}).then(
|
|
33
|
+
event,
|
|
34
|
+
clickedElement
|
|
35
|
+
}).then(() => {
|
|
35
36
|
if (event.isEmpty()) {
|
|
36
37
|
return Promise.resolve();
|
|
37
38
|
}
|
|
@@ -39,19 +40,21 @@ var createClickHandler = function createClickHandler(_ref) {
|
|
|
39
40
|
})
|
|
40
41
|
// eventManager.sendEvent() will return a promise resolved to an
|
|
41
42
|
// object and we want to avoid returning any value to the customer
|
|
42
|
-
.then(_index.noop).catch(
|
|
43
|
+
.then(_index.noop).catch(error => {
|
|
43
44
|
handleError(error, "click collection");
|
|
44
45
|
});
|
|
45
46
|
};
|
|
46
47
|
};
|
|
47
|
-
var _default =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
var _default = ({
|
|
49
|
+
eventManager,
|
|
50
|
+
lifecycle,
|
|
51
|
+
handleError
|
|
52
|
+
}) => {
|
|
53
|
+
const clickHandler = createClickHandler({
|
|
54
|
+
eventManager,
|
|
55
|
+
lifecycle,
|
|
56
|
+
handleError
|
|
55
57
|
});
|
|
56
58
|
document.addEventListener("click", clickHandler, true);
|
|
57
|
-
};
|
|
59
|
+
};
|
|
60
|
+
exports.default = _default;
|
|
@@ -14,7 +14,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
const downloadLinkQualifier = exports.downloadLinkQualifier = (0, _index.string)().regexp().default("\\.(exe|zip|wav|mp3|mov|mpg|avi|wmv|pdf|doc|docx|xls|xlsx|ppt|pptx)$");
|
|
18
18
|
var _default = exports.default = (0, _index.objectOf)({
|
|
19
19
|
clickCollectionEnabled: (0, _index.boolean)().default(true),
|
|
20
20
|
clickCollection: (0, _index.objectOf)({
|
|
@@ -32,6 +32,6 @@ var _default = exports.default = (0, _index.objectOf)({
|
|
|
32
32
|
sessionStorageEnabled: false,
|
|
33
33
|
eventGroupingEnabled: false
|
|
34
34
|
}),
|
|
35
|
-
downloadLinkQualifier
|
|
35
|
+
downloadLinkQualifier,
|
|
36
36
|
onBeforeLinkClickSend: (0, _index.callback)().deprecated('The field "onBeforeLinkClickSend" has been deprecated. Use "clickCollection.filterClickDetails" instead.')
|
|
37
37
|
});
|
|
@@ -13,23 +13,25 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
13
13
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
var _default =
|
|
17
|
-
|
|
16
|
+
var _default = ({
|
|
17
|
+
storage
|
|
18
|
+
}) => {
|
|
18
19
|
return {
|
|
19
|
-
save:
|
|
20
|
-
|
|
20
|
+
save: data => {
|
|
21
|
+
const jsonData = JSON.stringify(data);
|
|
21
22
|
storage.setItem(_sessionDataKeys.CLICK_ACTIVITY_DATA, jsonData);
|
|
22
23
|
},
|
|
23
|
-
load:
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
load: () => {
|
|
25
|
+
let jsonData = null;
|
|
26
|
+
const data = storage.getItem(_sessionDataKeys.CLICK_ACTIVITY_DATA);
|
|
26
27
|
if (data) {
|
|
27
28
|
jsonData = JSON.parse(data);
|
|
28
29
|
}
|
|
29
30
|
return jsonData;
|
|
30
31
|
},
|
|
31
|
-
remove:
|
|
32
|
+
remove: () => {
|
|
32
33
|
storage.removeItem(_sessionDataKeys.CLICK_ACTIVITY_DATA);
|
|
33
34
|
}
|
|
34
35
|
};
|
|
35
|
-
};
|
|
36
|
+
};
|
|
37
|
+
exports.default = _default;
|
|
@@ -13,7 +13,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
13
13
|
governing permissions and limitations under the License.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
const buildXdmFromClickedElementProperties = props => {
|
|
17
17
|
return {
|
|
18
18
|
eventType: "web.webinteraction.linkClicks",
|
|
19
19
|
web: {
|
|
@@ -29,7 +29,7 @@ var buildXdmFromClickedElementProperties = function buildXdmFromClickedElementPr
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
const buildDataFromClickedElementProperties = props => {
|
|
33
33
|
return {
|
|
34
34
|
__adobe: {
|
|
35
35
|
analytics: {
|
|
@@ -47,17 +47,20 @@ var buildDataFromClickedElementProperties = function buildDataFromClickedElement
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
const populateClickedElementPropertiesFromOptions = (options, props) => {
|
|
51
|
+
const {
|
|
52
|
+
xdm,
|
|
53
|
+
data,
|
|
54
|
+
clickedElement
|
|
55
|
+
} = options;
|
|
54
56
|
props.clickedElement = clickedElement;
|
|
55
57
|
if (xdm && xdm.web && xdm.web.webInteraction) {
|
|
56
|
-
|
|
57
|
-
name
|
|
58
|
-
region
|
|
59
|
-
type
|
|
60
|
-
URL
|
|
58
|
+
const {
|
|
59
|
+
name,
|
|
60
|
+
region,
|
|
61
|
+
type,
|
|
62
|
+
URL
|
|
63
|
+
} = xdm.web.webInteraction;
|
|
61
64
|
props.linkName = name;
|
|
62
65
|
props.linkRegion = region;
|
|
63
66
|
props.linkType = type;
|
|
@@ -66,29 +69,32 @@ var populateClickedElementPropertiesFromOptions = function populateClickedElemen
|
|
|
66
69
|
// DATA has priority over XDM
|
|
67
70
|
/* eslint no-underscore-dangle: 0 */
|
|
68
71
|
if (data && data.__adobe && data.__adobe.analytics) {
|
|
69
|
-
|
|
72
|
+
const {
|
|
73
|
+
contextData
|
|
74
|
+
} = data.__adobe.analytics;
|
|
70
75
|
if (contextData && contextData.a && contextData.a.activitymap) {
|
|
71
76
|
// Set the properties if they exists
|
|
72
|
-
|
|
73
|
-
page
|
|
74
|
-
link
|
|
75
|
-
|
|
76
|
-
pageIDType
|
|
77
|
+
const {
|
|
78
|
+
page,
|
|
79
|
+
link,
|
|
80
|
+
region,
|
|
81
|
+
pageIDType
|
|
82
|
+
} = contextData.a.activitymap;
|
|
77
83
|
props.pageName = page || props.pageName;
|
|
78
84
|
props.linkName = link || props.linkName;
|
|
79
|
-
props.linkRegion =
|
|
85
|
+
props.linkRegion = region || props.linkRegion;
|
|
80
86
|
if (pageIDType !== undefined) {
|
|
81
87
|
props.pageIDType = pageIDType;
|
|
82
88
|
}
|
|
83
89
|
}
|
|
84
90
|
}
|
|
85
91
|
};
|
|
86
|
-
var _default =
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
+
var _default = ({
|
|
93
|
+
properties,
|
|
94
|
+
logger
|
|
95
|
+
} = {}) => {
|
|
96
|
+
let props = properties || {};
|
|
97
|
+
const clickedElementProperties = {
|
|
92
98
|
get pageName() {
|
|
93
99
|
return props.pageName;
|
|
94
100
|
},
|
|
@@ -141,13 +147,13 @@ var _default = exports.default = function _default() {
|
|
|
141
147
|
pageIDType: props.pageIDType
|
|
142
148
|
};
|
|
143
149
|
},
|
|
144
|
-
isValidLink
|
|
150
|
+
isValidLink() {
|
|
145
151
|
return !!props.linkUrl && !!props.linkType && !!props.linkName && !!props.linkRegion;
|
|
146
152
|
},
|
|
147
|
-
isInternalLink
|
|
153
|
+
isInternalLink() {
|
|
148
154
|
return this.isValidLink() && props.linkType === "other";
|
|
149
155
|
},
|
|
150
|
-
isValidActivityMapData
|
|
156
|
+
isValidActivityMapData() {
|
|
151
157
|
return !!props.pageName && !!props.linkName && !!props.linkRegion && props.pageIDType !== undefined;
|
|
152
158
|
},
|
|
153
159
|
get xdm() {
|
|
@@ -162,7 +168,7 @@ var _default = exports.default = function _default() {
|
|
|
162
168
|
}
|
|
163
169
|
return buildDataFromClickedElementProperties(this);
|
|
164
170
|
},
|
|
165
|
-
applyPropertyFilter
|
|
171
|
+
applyPropertyFilter(filter) {
|
|
166
172
|
if (filter && filter(props) === false) {
|
|
167
173
|
if (logger) {
|
|
168
174
|
logger.info("Clicked element properties were rejected by filter function: " + JSON.stringify(this.properties, null, 2));
|
|
@@ -170,8 +176,8 @@ var _default = exports.default = function _default() {
|
|
|
170
176
|
props = {};
|
|
171
177
|
}
|
|
172
178
|
},
|
|
173
|
-
applyOptionsFilter
|
|
174
|
-
|
|
179
|
+
applyOptionsFilter(filter) {
|
|
180
|
+
const opts = this.options;
|
|
175
181
|
if (opts && opts.clickedElement && (opts.xdm || opts.data)) {
|
|
176
182
|
// Properties are rejected if filter is explicitly false.
|
|
177
183
|
if (filter && filter(opts) === false) {
|
|
@@ -189,7 +195,7 @@ var _default = exports.default = function _default() {
|
|
|
189
195
|
}
|
|
190
196
|
},
|
|
191
197
|
get options() {
|
|
192
|
-
|
|
198
|
+
const opts = {};
|
|
193
199
|
if (this.isValidLink()) {
|
|
194
200
|
opts.xdm = this.xdm;
|
|
195
201
|
}
|
|
@@ -212,4 +218,5 @@ var _default = exports.default = function _default() {
|
|
|
212
218
|
}
|
|
213
219
|
};
|
|
214
220
|
return clickedElementProperties;
|
|
215
|
-
};
|
|
221
|
+
};
|
|
222
|
+
exports.default = _default;
|
|
@@ -13,26 +13,33 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
13
13
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
var _default =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
16
|
+
var _default = ({
|
|
17
|
+
window,
|
|
18
|
+
getLinkName,
|
|
19
|
+
getLinkRegion,
|
|
20
|
+
getAbsoluteUrlFromAnchorElement,
|
|
21
|
+
findClickableElement,
|
|
22
|
+
determineLinkType
|
|
23
|
+
}) => {
|
|
24
|
+
return ({
|
|
25
|
+
clickedElement,
|
|
26
|
+
config,
|
|
27
|
+
logger,
|
|
28
|
+
clickActivityStorage
|
|
29
|
+
}) => {
|
|
30
|
+
const {
|
|
31
|
+
onBeforeLinkClickSend: optionsFilter,
|
|
32
|
+
// Deprecated
|
|
33
|
+
clickCollection
|
|
34
|
+
} = config;
|
|
35
|
+
const {
|
|
36
|
+
filterClickDetails: propertyFilter
|
|
37
|
+
} = clickCollection;
|
|
38
|
+
const elementProperties = (0, _createClickedElementProperties.default)({
|
|
39
|
+
logger
|
|
33
40
|
});
|
|
34
41
|
if (clickedElement) {
|
|
35
|
-
|
|
42
|
+
const clickableElement = findClickableElement(clickedElement);
|
|
36
43
|
if (clickableElement) {
|
|
37
44
|
elementProperties.clickedElement = clickedElement;
|
|
38
45
|
elementProperties.linkUrl = getAbsoluteUrlFromAnchorElement(window, clickableElement);
|
|
@@ -42,7 +49,7 @@ var _default = exports.default = function _default(_ref) {
|
|
|
42
49
|
elementProperties.pageIDType = 0;
|
|
43
50
|
elementProperties.pageName = window.location.href;
|
|
44
51
|
// Check if we have a page-name stored from an earlier page view event
|
|
45
|
-
|
|
52
|
+
const storedLinkData = clickActivityStorage.load();
|
|
46
53
|
if (storedLinkData && storedLinkData.pageName) {
|
|
47
54
|
elementProperties.pageName = storedLinkData.pageName;
|
|
48
55
|
// Perhaps pageIDType should be established after customer filter is applied
|
|
@@ -61,4 +68,5 @@ var _default = exports.default = function _default(_ref) {
|
|
|
61
68
|
}
|
|
62
69
|
return elementProperties;
|
|
63
70
|
};
|
|
64
|
-
};
|
|
71
|
+
};
|
|
72
|
+
exports.default = _default;
|
|
@@ -15,31 +15,33 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
15
15
|
governing permissions and limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
const isDissallowedLinkType = (clickCollection, linkType) => {
|
|
19
19
|
return linkType && (linkType === "download" && !clickCollection.downloadLinkEnabled || linkType === "exit" && !clickCollection.externalLinkEnabled || linkType === "other" && !clickCollection.internalLinkEnabled);
|
|
20
20
|
};
|
|
21
|
-
var _default =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
var _default = ({
|
|
22
|
+
config,
|
|
23
|
+
logger,
|
|
24
|
+
getClickedElementProperties,
|
|
25
|
+
clickActivityStorage
|
|
26
|
+
}) => {
|
|
27
|
+
const {
|
|
28
|
+
clickCollectionEnabled,
|
|
29
|
+
clickCollection
|
|
30
|
+
} = config;
|
|
28
31
|
if (!clickCollectionEnabled) {
|
|
29
|
-
return
|
|
30
|
-
return undefined;
|
|
31
|
-
};
|
|
32
|
+
return () => undefined;
|
|
32
33
|
}
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
return ({
|
|
35
|
+
event,
|
|
36
|
+
clickedElement
|
|
37
|
+
}) => {
|
|
38
|
+
const elementProperties = getClickedElementProperties({
|
|
39
|
+
clickActivityStorage,
|
|
40
|
+
clickedElement,
|
|
41
|
+
config,
|
|
42
|
+
logger
|
|
41
43
|
});
|
|
42
|
-
|
|
44
|
+
const linkType = elementProperties.linkType;
|
|
43
45
|
// Avoid clicks to be collected for the ActivityMap interface
|
|
44
46
|
if ((0, _activityMapExtensionEnabled.default)()) {
|
|
45
47
|
return;
|
|
@@ -67,4 +69,5 @@ var _default = exports.default = function _default(_ref) {
|
|
|
67
69
|
clickActivityStorage.save(elementProperties.properties);
|
|
68
70
|
}
|
|
69
71
|
};
|
|
70
|
-
};
|
|
72
|
+
};
|
|
73
|
+
exports.default = _default;
|
package/libEs5/components/ActivityCollector/createRecallAndInjectClickedElementProperties.js
CHANGED
|
@@ -14,20 +14,21 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
14
14
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
15
15
|
governing permissions and limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
var _default =
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
var _default = ({
|
|
18
|
+
clickActivityStorage
|
|
19
|
+
}) => {
|
|
20
|
+
return event => {
|
|
20
21
|
// Avoid clicks to be collected for the ActivityMap interface
|
|
21
22
|
if ((0, _activityMapExtensionEnabled.default)()) {
|
|
22
23
|
return;
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
properties
|
|
25
|
+
const properties = clickActivityStorage.load();
|
|
26
|
+
const elementProperties = (0, _createClickedElementProperties.default)({
|
|
27
|
+
properties
|
|
27
28
|
});
|
|
28
29
|
if (elementProperties.isValidLink() || elementProperties.isValidActivityMapData()) {
|
|
29
30
|
if (elementProperties.isValidLink()) {
|
|
30
|
-
|
|
31
|
+
const xdm = elementProperties.xdm;
|
|
31
32
|
// Have to delete the eventType not to override the page view
|
|
32
33
|
delete xdm.eventType;
|
|
33
34
|
event.mergeXdm(xdm);
|
|
@@ -43,4 +44,5 @@ var _default = exports.default = function _default(_ref) {
|
|
|
43
44
|
});
|
|
44
45
|
}
|
|
45
46
|
};
|
|
46
|
-
};
|
|
47
|
+
};
|
|
48
|
+
exports.default = _default;
|
|
@@ -12,12 +12,14 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
12
12
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
13
|
governing permissions and limitations under the License.
|
|
14
14
|
*/
|
|
15
|
-
var _default =
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
var _default = ({
|
|
16
|
+
clickActivityStorage
|
|
17
|
+
}) => {
|
|
18
|
+
return event => {
|
|
18
19
|
clickActivityStorage.save({
|
|
19
20
|
pageName: event.getContent().xdm.web.webPageDetails.name,
|
|
20
21
|
pageIDType: 1 // 1 = name, 0 = URL
|
|
21
22
|
});
|
|
22
23
|
};
|
|
23
|
-
};
|
|
24
|
+
};
|
|
25
|
+
exports.default = _default;
|
|
@@ -21,15 +21,15 @@ governing permissions and limitations under the License.
|
|
|
21
21
|
* @param {*} node The node to extract supported and unsupported nodes from.
|
|
22
22
|
* @returns {{supportedNodes: Array, includesUnsupportedNodes: boolean}} Node support object.
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const extractSupportedNodes = node => {
|
|
25
|
+
let supportedNodes = [];
|
|
26
|
+
let includesUnsupportedNodes = false;
|
|
27
27
|
if ((0, _isSupportedTextNode.default)(node)) {
|
|
28
28
|
supportedNodes.push(node);
|
|
29
29
|
if (node.childNodes) {
|
|
30
|
-
|
|
31
|
-
childNodes.forEach(
|
|
32
|
-
|
|
30
|
+
const childNodes = Array.prototype.slice.call(node.childNodes);
|
|
31
|
+
childNodes.forEach(childNode => {
|
|
32
|
+
const nodes = extractSupportedNodes(childNode);
|
|
33
33
|
supportedNodes = supportedNodes.concat(nodes.supportedNodes);
|
|
34
34
|
includesUnsupportedNodes = includesUnsupportedNodes || nodes.includesUnsupportedNodes;
|
|
35
35
|
});
|
|
@@ -38,8 +38,8 @@ var extractSupportedNodes = function extractSupportedNodes(node) {
|
|
|
38
38
|
includesUnsupportedNodes = true;
|
|
39
39
|
}
|
|
40
40
|
return {
|
|
41
|
-
supportedNodes
|
|
42
|
-
includesUnsupportedNodes
|
|
41
|
+
supportedNodes,
|
|
42
|
+
includesUnsupportedNodes
|
|
43
43
|
};
|
|
44
44
|
};
|
|
45
45
|
|
|
@@ -50,8 +50,8 @@ var extractSupportedNodes = function extractSupportedNodes(node) {
|
|
|
50
50
|
* @param {string} nodeName Optional node name constraint.
|
|
51
51
|
* @returns {string} Attribute value or undefined.
|
|
52
52
|
*/
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
const getNodeAttributeValue = (node, attributeName, nodeName) => {
|
|
54
|
+
let attributeValue;
|
|
55
55
|
if (!nodeName || nodeName === node.nodeName.toUpperCase()) {
|
|
56
56
|
attributeValue = node.getAttribute(attributeName);
|
|
57
57
|
}
|
|
@@ -63,11 +63,11 @@ var getNodeAttributeValue = function getNodeAttributeValue(node, attributeName,
|
|
|
63
63
|
* @param {*} nodes The nodes array holding the children nodes.
|
|
64
64
|
* The returned map contains the supported not empty children attributes values.
|
|
65
65
|
* */
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
const getChildrenAttributes = nodes => {
|
|
67
|
+
const attributes = {
|
|
68
68
|
texts: []
|
|
69
69
|
};
|
|
70
|
-
nodes.supportedNodes.forEach(
|
|
70
|
+
nodes.supportedNodes.forEach(supportedNode => {
|
|
71
71
|
if (supportedNode.getAttribute) {
|
|
72
72
|
if (!attributes.alt) {
|
|
73
73
|
attributes.alt = (0, _truncateWhiteSpace.default)(supportedNode.getAttribute("alt"));
|
|
@@ -109,16 +109,17 @@ var getChildrenAttributes = function getChildrenAttributes(nodes) {
|
|
|
109
109
|
* @param {*} node The node to find link text for.
|
|
110
110
|
* @returns {string} link-name or an empty string if not link-name is found.
|
|
111
111
|
*/
|
|
112
|
-
var _default =
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
var _default = node => {
|
|
113
|
+
let nodeText = (0, _truncateWhiteSpace.default)(node.innerText || node.textContent);
|
|
114
|
+
const nodes = extractSupportedNodes(node);
|
|
115
115
|
// if contains unsupported nodes we want children node attributes
|
|
116
116
|
if (!nodeText || nodes.includesUnsupportedNodes) {
|
|
117
|
-
|
|
117
|
+
const attributesMap = getChildrenAttributes(nodes);
|
|
118
118
|
nodeText = (0, _truncateWhiteSpace.default)(attributesMap.texts.join(""));
|
|
119
119
|
if (!nodeText) {
|
|
120
120
|
nodeText = attributesMap.alt || attributesMap.title || attributesMap.inputValue || attributesMap.imgSrc;
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
return nodeText || "";
|
|
124
|
-
};
|
|
124
|
+
};
|
|
125
|
+
exports.default = _default;
|
|
@@ -15,16 +15,16 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
15
15
|
governing permissions and limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const semanticElements = /^(HEADER|MAIN|FOOTER|NAV)$/i;
|
|
19
|
+
const getAriaRegionLabel = node => {
|
|
20
|
+
let regionLabel;
|
|
21
21
|
if (node.role === "region" && (0, _index.isNonEmptyString)(node["aria-label"])) {
|
|
22
22
|
regionLabel = node["aria-label"];
|
|
23
23
|
}
|
|
24
24
|
return regionLabel;
|
|
25
25
|
};
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
const getSectionNodeName = node => {
|
|
27
|
+
let nodeName;
|
|
28
28
|
if (node && node.nodeName) {
|
|
29
29
|
if (node.nodeName.match(semanticElements)) {
|
|
30
30
|
nodeName = node.nodeName;
|
|
@@ -47,9 +47,9 @@ var getSectionNodeName = function getSectionNodeName(node) {
|
|
|
47
47
|
* @param {*} node The node to find link region for.
|
|
48
48
|
* @returns {string} link-region.
|
|
49
49
|
*/
|
|
50
|
-
var _default =
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
var _default = node => {
|
|
51
|
+
let linkParentNode = node.parentNode;
|
|
52
|
+
let regionName;
|
|
53
53
|
while (linkParentNode) {
|
|
54
54
|
regionName = (0, _truncateWhiteSpace.default)(linkParentNode.id || getAriaRegionLabel(linkParentNode) || getSectionNodeName(linkParentNode));
|
|
55
55
|
if (regionName) {
|
|
@@ -58,4 +58,5 @@ var _default = exports.default = function _default(node) {
|
|
|
58
58
|
linkParentNode = linkParentNode.parentNode;
|
|
59
59
|
}
|
|
60
60
|
return "BODY";
|
|
61
|
-
};
|
|
61
|
+
};
|
|
62
|
+
exports.default = _default;
|