@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
|
@@ -9,10 +9,13 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
export default (preprocessors => action => {
|
|
14
14
|
if (!action) {
|
|
15
15
|
return action;
|
|
16
16
|
}
|
|
17
|
-
return preprocessors.reduce((processed, fn) =>
|
|
17
|
+
return preprocessors.reduce((processed, fn) => ({
|
|
18
|
+
...processed,
|
|
19
|
+
...fn(processed)
|
|
20
|
+
}), action);
|
|
18
21
|
});
|
|
@@ -10,7 +10,6 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import escape from "css.escape";
|
|
14
13
|
import { selectNodes } from "../../../../utils/dom/index.js";
|
|
15
14
|
import { isNotEqSelector, splitWithEq } from "./helperForEq.js";
|
|
16
15
|
|
|
@@ -19,8 +18,7 @@ const CSS_IDENTIFIER_PATTERN = /(#|\.)(-?\w+)/g;
|
|
|
19
18
|
// Here we use CSS.escape() to make sure we get
|
|
20
19
|
// correct values for ID and CSS class
|
|
21
20
|
// Please check: https://www.w3.org/TR/css-syntax-3/#escaping
|
|
22
|
-
|
|
23
|
-
const replaceIdentifier = (_, $1, $2) => `${$1}${escape($2)}`;
|
|
21
|
+
const replaceIdentifier = (_, $1, $2) => `${$1}${CSS.escape($2)}`;
|
|
24
22
|
export const escapeIdentifiersInSelector = selector => {
|
|
25
23
|
return selector.replace(CSS_IDENTIFIER_PATTERN, replaceIdentifier);
|
|
26
24
|
};
|
|
@@ -14,7 +14,6 @@ governing permissions and limitations under the License.
|
|
|
14
14
|
* Preprocess customCode actions before rendering, so that offer selectors are remapped appropriately for
|
|
15
15
|
* target offers, to align with the way it works in at.js.
|
|
16
16
|
*/
|
|
17
|
-
import { assign } from "../../../utils/index.js";
|
|
18
17
|
import { DOM_ACTION_CUSTOM_CODE } from "./initDomActionsModules.js";
|
|
19
18
|
const TARGET_BODY_SELECTOR = "BODY > *:eq(0)";
|
|
20
19
|
export default (action => {
|
|
@@ -28,7 +27,10 @@ export default (action => {
|
|
|
28
27
|
if (selector !== TARGET_BODY_SELECTOR) {
|
|
29
28
|
return action;
|
|
30
29
|
}
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
return {
|
|
31
|
+
...action,
|
|
32
|
+
...{
|
|
33
|
+
selector: "BODY"
|
|
34
|
+
}
|
|
35
|
+
};
|
|
34
36
|
});
|
|
@@ -19,7 +19,6 @@ governing permissions and limitations under the License.
|
|
|
19
19
|
import { selectNodes } from "../../../utils/dom/index.js";
|
|
20
20
|
import { is } from "./scripts.js";
|
|
21
21
|
import { createFragment, selectNodesWithEq } from "./dom/index.js";
|
|
22
|
-
import { assign } from "../../../utils/index.js";
|
|
23
22
|
import isBlankString from "../../../utils/isBlankString.js";
|
|
24
23
|
import { HEAD } from "../../../constants/tagName.js";
|
|
25
24
|
import { DOM_ACTION_APPEND_HTML } from "./initDomActionsModules.js";
|
|
@@ -30,7 +29,9 @@ const filterHeadContent = content => {
|
|
|
30
29
|
return headNodes.map(node => node.outerHTML).join("");
|
|
31
30
|
};
|
|
32
31
|
export default (action => {
|
|
33
|
-
const result =
|
|
32
|
+
const result = {
|
|
33
|
+
...action
|
|
34
|
+
};
|
|
34
35
|
const {
|
|
35
36
|
content,
|
|
36
37
|
selector
|
|
@@ -9,12 +9,28 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
import loadScript from "@adobe/reactor-load-script";
|
|
14
12
|
import { selectNodes, createNode } from "../../../utils/dom/index.js";
|
|
15
13
|
import { SCRIPT } from "../../../constants/tagName.js";
|
|
16
14
|
import { SRC } from "../../../constants/elementAttribute.js";
|
|
17
15
|
import { getAttribute, getNonce } from "./dom/index.js";
|
|
16
|
+
const getPromise = (url, script) => {
|
|
17
|
+
return new Promise((resolve, reject) => {
|
|
18
|
+
script.onload = () => {
|
|
19
|
+
resolve(script);
|
|
20
|
+
};
|
|
21
|
+
script.onerror = () => {
|
|
22
|
+
reject(new Error(`Failed to load script: ${url}`));
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
const loadScript = url => {
|
|
27
|
+
const script = document.createElement("script");
|
|
28
|
+
script.src = url;
|
|
29
|
+
script.async = true;
|
|
30
|
+
const promise = getPromise(url, script);
|
|
31
|
+
document.head.appendChild(script);
|
|
32
|
+
return promise;
|
|
33
|
+
};
|
|
18
34
|
export const is = (element, tagName) => !!element && element.tagName === tagName;
|
|
19
35
|
const isInlineScript = element => is(element, SCRIPT) && !getAttribute(element, SRC);
|
|
20
36
|
const isRemoteScript = element => is(element, SCRIPT) && getAttribute(element, SRC);
|
|
@@ -46,37 +46,51 @@ export const showElements = prehidingSelector => {
|
|
|
46
46
|
delete styleNodes[prehidingSelector];
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
-
export const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
export const createHideContainers = logger => {
|
|
50
|
+
return prehidingStyle => {
|
|
51
|
+
if (!prehidingStyle) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
53
54
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
55
|
+
// If containers prehiding style has been added
|
|
56
|
+
// by customer's prehiding snippet we don't
|
|
57
|
+
// want to add the same node
|
|
58
|
+
const node = getElementById(PREHIDING_ID);
|
|
59
|
+
if (node) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const nonce = getNonce();
|
|
63
|
+
const attrs = {
|
|
64
|
+
id: PREHIDING_ID,
|
|
65
|
+
...(nonce && {
|
|
66
|
+
nonce
|
|
67
|
+
})
|
|
68
|
+
};
|
|
69
|
+
const props = {
|
|
70
|
+
textContent: prehidingStyle
|
|
71
|
+
};
|
|
72
|
+
const styleNode = createNode(STYLE, attrs, props);
|
|
73
|
+
logger.logOnContentHiding({
|
|
74
|
+
status: "hide-containers",
|
|
75
|
+
message: "Prehiding style applied to hide containers.",
|
|
76
|
+
logLevel: "info"
|
|
77
|
+
});
|
|
78
|
+
appendNode(document.head, styleNode);
|
|
70
79
|
};
|
|
71
|
-
const styleNode = createNode(STYLE, attrs, props);
|
|
72
|
-
appendNode(document.head, styleNode);
|
|
73
80
|
};
|
|
74
|
-
export const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
export const createShowContainers = logger => {
|
|
82
|
+
return () => {
|
|
83
|
+
// If containers prehiding style exists
|
|
84
|
+
// we will remove it
|
|
85
|
+
const node = getElementById(PREHIDING_ID);
|
|
86
|
+
if (!node) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
logger.logOnContentHiding({
|
|
90
|
+
status: "show-containers",
|
|
91
|
+
message: "Prehiding style removed to show containers.",
|
|
92
|
+
logLevel: "info"
|
|
93
|
+
});
|
|
94
|
+
removeNode(node);
|
|
95
|
+
};
|
|
82
96
|
};
|
|
@@ -10,7 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
import { getAttribute, setAttribute } from "../dom-actions/dom/index.js";
|
|
13
|
-
import {
|
|
13
|
+
import { noop } from "../../../utils/index.js";
|
|
14
14
|
import { DOM_ACTION_CLICK } from "../dom-actions/initDomActionsModules.js";
|
|
15
15
|
import { ALWAYS, DECORATED_ELEMENTS_ONLY } from "../../../constants/propositionInteractionType.js";
|
|
16
16
|
export const INTERACT_ID_DATA_ATTRIBUTE = "data-aep-interact-id";
|
|
@@ -32,7 +32,7 @@ const interactionTrackingSupported = (autoCollectPropositionInteractions, decisi
|
|
|
32
32
|
if (!autoCollectPropositionInteractions[decisionProvider]) {
|
|
33
33
|
return false;
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return [ALWAYS, DECORATED_ELEMENTS_ONLY].includes(autoCollectPropositionInteractions[decisionProvider]);
|
|
36
36
|
};
|
|
37
37
|
const createDecorateProposition = (autoCollectPropositionInteractions, type, propositionId, itemId, trackingLabel, scopeType, notification, storeInteractionMeta) => {
|
|
38
38
|
const {
|
|
@@ -10,6 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import { groupBy } from "../../../utils/index.js";
|
|
13
14
|
export default (({
|
|
14
15
|
schemaProcessors,
|
|
15
16
|
logger
|
|
@@ -21,14 +22,21 @@ export default (({
|
|
|
21
22
|
}
|
|
22
23
|
return true;
|
|
23
24
|
}).catch(error => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
const {
|
|
26
|
+
message,
|
|
27
|
+
stack
|
|
28
|
+
} = error;
|
|
29
|
+
const warning = `Failed to execute action ${item.toString()}. ${message} ${stack}`;
|
|
30
|
+
logger.logOnContentRendering({
|
|
31
|
+
status: "rendering-failed",
|
|
32
|
+
detail: {
|
|
33
|
+
propositionDetails: item.getProposition().getNotification(),
|
|
34
|
+
item: item.toJSON()
|
|
35
|
+
},
|
|
36
|
+
error,
|
|
37
|
+
message: warning,
|
|
38
|
+
logLevel: "warn"
|
|
39
|
+
});
|
|
32
40
|
return false;
|
|
33
41
|
});
|
|
34
42
|
};
|
|
@@ -164,7 +172,19 @@ export default (({
|
|
|
164
172
|
p.addToReturnValues(returnedPropositions, returnedDecisions, p.getItems(), false);
|
|
165
173
|
});
|
|
166
174
|
const render = () => {
|
|
167
|
-
return Promise.all(renderers.map(renderer => renderer())).then(metas =>
|
|
175
|
+
return Promise.all(renderers.map(renderer => renderer())).then(metas => {
|
|
176
|
+
const renderedPropositions = metas.filter(meta => meta);
|
|
177
|
+
const propsByScope = groupBy(renderedPropositions, p => p.scope);
|
|
178
|
+
logger.logOnContentRendering({
|
|
179
|
+
status: "rendering-succeeded",
|
|
180
|
+
detail: {
|
|
181
|
+
...propsByScope
|
|
182
|
+
},
|
|
183
|
+
message: `Scopes: ${propsByScope} successfully executed.`,
|
|
184
|
+
logLevel: "info"
|
|
185
|
+
});
|
|
186
|
+
return renderedPropositions;
|
|
187
|
+
});
|
|
168
188
|
};
|
|
169
189
|
return {
|
|
170
190
|
returnedPropositions,
|
|
@@ -26,6 +26,15 @@ export default (({
|
|
|
26
26
|
decisionsMeta: [item.getProposition().getNotification()],
|
|
27
27
|
documentMayUnload: true
|
|
28
28
|
}).then(() => {
|
|
29
|
+
logger.logOnContentRendering({
|
|
30
|
+
status: "rendering-redirect",
|
|
31
|
+
detail: {
|
|
32
|
+
propositionDetails: item.getProposition().getNotification(),
|
|
33
|
+
redirect: content
|
|
34
|
+
},
|
|
35
|
+
message: `Redirect action ${item.toString()} executed.`,
|
|
36
|
+
logLevel: "info"
|
|
37
|
+
});
|
|
29
38
|
return executeRedirect(content);
|
|
30
39
|
// Execute redirect will never resolve. If there are bottom of page events that are waiting
|
|
31
40
|
// for display notifications from this request, they will never run because this promise will
|
package/libEs6/components/Personalization/in-app-message-actions/actions/displayIframeContent.js
CHANGED
|
@@ -13,7 +13,7 @@ governing permissions and limitations under the License.
|
|
|
13
13
|
import { getNonce } from "../../dom-actions/dom/index.js";
|
|
14
14
|
import { parseAnchor, removeElementById } from "../utils.js";
|
|
15
15
|
import { TEXT_HTML } from "../../../../constants/contentType.js";
|
|
16
|
-
import {
|
|
16
|
+
import { isNonEmptyString } from "../../../../utils/index.js";
|
|
17
17
|
import { createNode } from "../../../../utils/dom/index.js";
|
|
18
18
|
import { objectOf } from "../../../../utils/validation/index.js";
|
|
19
19
|
import { PropositionEventType } from "../../../../constants/propositionEventType.js";
|
|
@@ -94,7 +94,10 @@ const renderMessage = (iframe, webParameters, container, overlay) => {
|
|
|
94
94
|
style = {},
|
|
95
95
|
params = {}
|
|
96
96
|
} = webParameters[id];
|
|
97
|
-
|
|
97
|
+
element.style = {
|
|
98
|
+
...element.style,
|
|
99
|
+
...style
|
|
100
|
+
};
|
|
98
101
|
const {
|
|
99
102
|
parentElement = "body",
|
|
100
103
|
insertionMethod = "appendChild",
|
|
@@ -178,13 +181,13 @@ const isValidWebParameters = webParameters => {
|
|
|
178
181
|
return false;
|
|
179
182
|
}
|
|
180
183
|
const ids = Object.keys(webParameters);
|
|
181
|
-
if (!includes(
|
|
184
|
+
if (!ids.includes(MESSAGING_CONTAINER_ID)) {
|
|
182
185
|
return false;
|
|
183
186
|
}
|
|
184
|
-
if (!includes(
|
|
187
|
+
if (!ids.includes(OVERLAY_CONTAINER_ID)) {
|
|
185
188
|
return false;
|
|
186
189
|
}
|
|
187
|
-
const valuesArray = values(webParameters);
|
|
190
|
+
const valuesArray = Object.values(webParameters);
|
|
188
191
|
for (let i = 0; i < valuesArray.length; i += 1) {
|
|
189
192
|
if (!objectOf(valuesArray[i], "style")) {
|
|
190
193
|
return false;
|
|
@@ -9,7 +9,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import { isNonEmptyArray, queryString
|
|
12
|
+
import { isNonEmptyArray, queryString } from "../../../utils/index.js";
|
|
13
13
|
import { removeNode, selectNodes } from "../../../utils/dom/index.js";
|
|
14
14
|
export const removeElementById = id => {
|
|
15
15
|
const element = selectNodes(`#${id}`, document);
|
|
@@ -25,7 +25,7 @@ export const parseAnchor = anchor => {
|
|
|
25
25
|
const {
|
|
26
26
|
href
|
|
27
27
|
} = anchor;
|
|
28
|
-
if (!href || !startsWith(
|
|
28
|
+
if (!href || !href.startsWith("adbinapp://")) {
|
|
29
29
|
return nothing;
|
|
30
30
|
}
|
|
31
31
|
const hrefParts = href.split("?");
|
|
@@ -13,12 +13,12 @@ governing permissions and limitations under the License.
|
|
|
13
13
|
import { anyOf, boolean, literal, objectOf, string } from "../../utils/validation/index.js";
|
|
14
14
|
import createComponent from "./createComponent.js";
|
|
15
15
|
import { initDomActionsModules } from "./dom-actions/index.js";
|
|
16
|
-
import createCollect from "
|
|
17
|
-
import {
|
|
16
|
+
import createCollect from "../../utils/createCollect.js";
|
|
17
|
+
import { createHideContainers, createShowContainers } from "./flicker/index.js";
|
|
18
18
|
import createFetchDataHandler from "./createFetchDataHandler.js";
|
|
19
19
|
import collectClicks from "./dom-actions/clicks/collectClicks.js";
|
|
20
20
|
import isAuthoringModeEnabled from "./utils/isAuthoringModeEnabled.js";
|
|
21
|
-
import { mergeDecisionsMeta, mergeQuery } from "
|
|
21
|
+
import { mergeDecisionsMeta, mergeQuery } from "../../utils/event.js";
|
|
22
22
|
import createOnClickHandler from "./createOnClickHandler.js";
|
|
23
23
|
import createViewCacheManager from "./createViewCacheManager.js";
|
|
24
24
|
import createViewChangeHandler from "./createViewChangeHandler.js";
|
|
@@ -63,6 +63,8 @@ const createPersonalization = ({
|
|
|
63
63
|
eventManager,
|
|
64
64
|
mergeDecisionsMeta
|
|
65
65
|
});
|
|
66
|
+
const showContainers = createShowContainers(logger);
|
|
67
|
+
const hideContainers = createHideContainers(logger);
|
|
66
68
|
const {
|
|
67
69
|
storeInteractionMeta,
|
|
68
70
|
getInteractionMetas
|
|
@@ -124,7 +126,8 @@ const createPersonalization = ({
|
|
|
124
126
|
processPropositions,
|
|
125
127
|
createProposition,
|
|
126
128
|
notificationHandler,
|
|
127
|
-
consent
|
|
129
|
+
consent,
|
|
130
|
+
logger
|
|
128
131
|
});
|
|
129
132
|
const onClickHandler = createOnClickHandler({
|
|
130
133
|
mergeDecisionsMeta,
|
|
@@ -137,7 +140,8 @@ const createPersonalization = ({
|
|
|
137
140
|
});
|
|
138
141
|
const viewChangeHandler = createViewChangeHandler({
|
|
139
142
|
processPropositions,
|
|
140
|
-
viewCache
|
|
143
|
+
viewCache,
|
|
144
|
+
logger
|
|
141
145
|
});
|
|
142
146
|
const applyPropositions = createApplyPropositions({
|
|
143
147
|
processPropositions,
|
|
@@ -10,12 +10,12 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { assign } from "../../../utils/index.js";
|
|
14
13
|
export default (({
|
|
15
14
|
decisions,
|
|
16
15
|
renderAttempted
|
|
17
16
|
}) => {
|
|
18
|
-
return decisions.map(decision =>
|
|
19
|
-
renderAttempted
|
|
20
|
-
|
|
17
|
+
return decisions.map(decision => ({
|
|
18
|
+
renderAttempted,
|
|
19
|
+
...decision
|
|
20
|
+
}));
|
|
21
21
|
});
|
|
@@ -11,7 +11,7 @@ governing permissions and limitations under the License.
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { WEB, WEBAPP, SURFACE_TYPE_DELIMITER, FRAGMENT_DELIMITER } from "../constants/surface.js";
|
|
14
|
-
import {
|
|
14
|
+
import { isNil, isNonEmptyString } from "../../../utils/index.js";
|
|
15
15
|
const SURFACE_REGEX = /^(\w+):\/\/([^/#]+)(\/[^#]*)?(#.*)?$/;
|
|
16
16
|
const AUTHORITY_REGEX = /^(?:.*@)?(?:[a-z\d\u00a1-\uffff.-]+|\[[a-f\d:]+])(?::\d+)?$/;
|
|
17
17
|
const PATH_REGEX = /^\/(?:[/\w\u00a1-\uffff-.~]|%[a-fA-F\d]{2})*$/;
|
|
@@ -42,7 +42,7 @@ export const buildPageSurface = getPageLocation => {
|
|
|
42
42
|
const path = location.pathname;
|
|
43
43
|
return WEB + SURFACE_TYPE_DELIMITER + host + normalizePath(path);
|
|
44
44
|
};
|
|
45
|
-
const expandFragmentSurface = (surface, getPageLocation) => startsWith(
|
|
45
|
+
const expandFragmentSurface = (surface, getPageLocation) => surface.startsWith(FRAGMENT_DELIMITER) ? buildPageSurface(getPageLocation) + surface : surface;
|
|
46
46
|
const validateSurface = (surface, getPageLocation, logger) => {
|
|
47
47
|
const invalidateSurface = validationError => {
|
|
48
48
|
logger.warn(validationError);
|
|
@@ -56,7 +56,7 @@ const validateSurface = (surface, getPageLocation, logger) => {
|
|
|
56
56
|
if (parsed === null) {
|
|
57
57
|
return invalidateSurface(`Invalid surface: ${surface}`);
|
|
58
58
|
}
|
|
59
|
-
if (!
|
|
59
|
+
if (![WEB, WEBAPP].includes(parsed.surfaceType)) {
|
|
60
60
|
return invalidateSurface(`Unsupported surface type ${parsed.surfaceType} in surface: ${surface}`);
|
|
61
61
|
}
|
|
62
62
|
if (!parsed.authority || !AUTHORITY_REGEX.test(parsed.authority)) {
|
|
@@ -9,5 +9,6 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
+
export const PERSONALIZATION_DECISIONS_HANDLE = "personalization:decisions";
|
|
12
13
|
export const ADOBE_JOURNEY_OPTIMIZER = "AJO";
|
|
13
14
|
export const ADOBE_TARGET = "TGT";
|
|
@@ -17,6 +17,6 @@ export const JSON_CONTENT_ITEM = "https://ns.adobe.com/personalization/json-cont
|
|
|
17
17
|
export const RULESET_ITEM = "https://ns.adobe.com/personalization/ruleset-item";
|
|
18
18
|
export const REDIRECT_ITEM = "https://ns.adobe.com/personalization/redirect-item";
|
|
19
19
|
export const MESSAGE_IN_APP = "https://ns.adobe.com/personalization/message/in-app";
|
|
20
|
-
export const
|
|
20
|
+
export const MESSAGE_CONTENT_CARD = "https://ns.adobe.com/personalization/message/content-card";
|
|
21
21
|
export const MESSAGE_NATIVE_ALERT = "https://ns.adobe.com/personalization/message/native-alert";
|
|
22
22
|
export const MEASUREMENT_SCHEMA = "https://ns.adobe.com/personalization/measurement";
|
|
@@ -9,7 +9,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
const CONFIG_DOC_URI = "https://adobe.ly/3sHh553";
|
|
14
14
|
const transformOptions = ({
|
|
15
15
|
combinedConfigValidator,
|
|
@@ -30,10 +30,13 @@ const buildAllOnInstanceConfiguredExtraParams = (config, logger, componentCreato
|
|
|
30
30
|
buildOnInstanceConfiguredExtraParams
|
|
31
31
|
}) => {
|
|
32
32
|
if (buildOnInstanceConfiguredExtraParams) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
memo = {
|
|
34
|
+
...memo,
|
|
35
|
+
...buildOnInstanceConfiguredExtraParams({
|
|
36
|
+
config,
|
|
37
|
+
logger
|
|
38
|
+
})
|
|
39
|
+
};
|
|
37
40
|
}
|
|
38
41
|
return memo;
|
|
39
42
|
}, {});
|
|
@@ -10,46 +10,17 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
// This
|
|
14
|
-
//
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/* @skipwhen ENV.alloy_personalization === false */
|
|
28
|
-
import createPersonalization from "../components/Personalization/index.js";
|
|
29
|
-
|
|
30
|
-
/* @skipwhen ENV.alloy_context === false */
|
|
31
|
-
import createContext from "../components/Context/index.js";
|
|
32
|
-
|
|
33
|
-
/* @skipwhen ENV.alloy_privacy === false */
|
|
34
|
-
import createPrivacy from "../components/Privacy/index.js";
|
|
35
|
-
|
|
36
|
-
/* @skipwhen ENV.alloy_eventmerge === false */
|
|
37
|
-
import createEventMerge from "../components/EventMerge/index.js";
|
|
38
|
-
import createLibraryInfo from "../components/LibraryInfo/index.js";
|
|
39
|
-
|
|
40
|
-
/* @skipwhen ENV.alloy_decisioningengine === false */
|
|
41
|
-
import createDecisioningEngine from "../components/DecisioningEngine/index.js";
|
|
42
|
-
|
|
43
|
-
/* @skipwhen ENV.alloy_machinelearning === false */
|
|
44
|
-
import createMachineLearning from "../components/MachineLearning/index.js";
|
|
45
|
-
|
|
46
|
-
/* @skipwhen ENV.alloy_streamingmedia === false */
|
|
47
|
-
import createStreamingMedia from "../components/StreamingMedia/index.js";
|
|
48
|
-
|
|
49
|
-
/* @skipwhen ENV.alloy_legacymediaanalytics === false */
|
|
50
|
-
import createLegacyMediaAnalytics from "../components/LegacyMediaAnalytics/index.js";
|
|
51
|
-
|
|
52
|
-
// TODO: Register the Components here statically for now. They might be registered differently.
|
|
53
|
-
// TODO: Figure out how sub-components will be made available/registered
|
|
54
|
-
|
|
55
|
-
export default [createDataCollector, createActivityCollector, createIdentity, createAudiences, createPersonalization, createContext, createPrivacy, createEventMerge, createLibraryInfo, createMachineLearning, createDecisioningEngine, createLegacyMediaAnalytics, createStreamingMedia];
|
|
13
|
+
// This file contains the optional components that can be included in an alloy build.
|
|
14
|
+
// The exports names must have the camel case format. If you need to add a required
|
|
15
|
+
// module, you should add it to the core/requiredComponentCreators.js file.
|
|
16
|
+
|
|
17
|
+
export { default as activityCollector } from "../components/ActivityCollector/index.js";
|
|
18
|
+
export { default as audiences } from "../components/Audiences/index.js";
|
|
19
|
+
export { default as context } from "../components/Context/index.js";
|
|
20
|
+
export { default as decisioningEngine } from "../components/DecisioningEngine/index.js";
|
|
21
|
+
export { default as eventMerge } from "../components/EventMerge/index.js";
|
|
22
|
+
export { default as legacyMediaAnalytics } from "../components/LegacyMediaAnalytics/index.js";
|
|
23
|
+
export { default as machineLearning } from "../components/MachineLearning/index.js";
|
|
24
|
+
export { default as personalization } from "../components/Personalization/index.js";
|
|
25
|
+
export { default as privacy } from "../components/Privacy/index.js";
|
|
26
|
+
export { default as streamingMedia } from "../components/StreamingMedia/index.js";
|
|
@@ -10,8 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { assign } from "../../utils/index.js";
|
|
14
13
|
const createConfig = options => {
|
|
15
|
-
return
|
|
14
|
+
return {
|
|
15
|
+
...options
|
|
16
|
+
};
|
|
16
17
|
};
|
|
17
18
|
export default createConfig;
|
|
@@ -9,8 +9,6 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
import { endsWith } from "../utils/index.js";
|
|
14
12
|
const STATE_STORE_HANDLE_TYPE = "state:store";
|
|
15
13
|
export default (({
|
|
16
14
|
cookieJar,
|
|
@@ -25,7 +23,7 @@ export default (({
|
|
|
25
23
|
* the request body so they can be read by the server.
|
|
26
24
|
*/
|
|
27
25
|
cookiesToPayload(payload, endpointDomain) {
|
|
28
|
-
const isEndpointFirstParty = endsWith(
|
|
26
|
+
const isEndpointFirstParty = endpointDomain.endsWith(apexDomain);
|
|
29
27
|
const state = {
|
|
30
28
|
domain: apexDomain,
|
|
31
29
|
cookiesEnabled: true
|
|
@@ -11,15 +11,7 @@ governing permissions and limitations under the License.
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
export default (executeCommand => {
|
|
14
|
-
return
|
|
15
|
-
// Would use destructuring, but destructuring doesn't work on IE
|
|
16
|
-
// without polyfilling Symbol.
|
|
17
|
-
// https://github.com/babel/babel/issues/7597
|
|
18
|
-
const resolve = args[0];
|
|
19
|
-
const reject = args[1];
|
|
20
|
-
const userProvidedArgs = args[2];
|
|
21
|
-
const commandName = userProvidedArgs[0];
|
|
22
|
-
const options = userProvidedArgs[1];
|
|
14
|
+
return ([resolve, reject, [commandName, options]]) => {
|
|
23
15
|
executeCommand(commandName, options).then(resolve, reject);
|
|
24
16
|
};
|
|
25
17
|
});
|
|
@@ -10,7 +10,6 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { assign } from "../utils/index.js";
|
|
14
13
|
export default (({
|
|
15
14
|
getDebugEnabled,
|
|
16
15
|
console,
|
|
@@ -24,7 +23,10 @@ export default (({
|
|
|
24
23
|
const notifyMonitors = (method, data) => {
|
|
25
24
|
const monitors = getMonitors();
|
|
26
25
|
if (monitors.length > 0) {
|
|
27
|
-
const dataWithContext =
|
|
26
|
+
const dataWithContext = {
|
|
27
|
+
...context,
|
|
28
|
+
...data
|
|
29
|
+
};
|
|
28
30
|
monitors.forEach(monitor => {
|
|
29
31
|
if (monitor[method]) {
|
|
30
32
|
monitor[method](dataWithContext);
|
|
@@ -78,6 +80,19 @@ export default (({
|
|
|
78
80
|
notifyMonitors("onNetworkError", data);
|
|
79
81
|
log("error", `Request ${data.requestId}: Network request failed.`, data.error);
|
|
80
82
|
},
|
|
83
|
+
logOnContentHiding(data) {
|
|
84
|
+
notifyMonitors("onContentHiding", {
|
|
85
|
+
status: data.status
|
|
86
|
+
});
|
|
87
|
+
log(data.logLevel, data.message);
|
|
88
|
+
},
|
|
89
|
+
logOnContentRendering(data) {
|
|
90
|
+
notifyMonitors("onContentRendering", {
|
|
91
|
+
status: data.status,
|
|
92
|
+
payload: data.detail
|
|
93
|
+
});
|
|
94
|
+
log(data.logLevel, data.message);
|
|
95
|
+
},
|
|
81
96
|
/**
|
|
82
97
|
* Outputs informational message to the web console. In some
|
|
83
98
|
* browsers a small "i" icon is displayed next to these items
|