@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
|
@@ -3,12 +3,7 @@
|
|
|
3
3
|
exports.default = void 0;
|
|
4
4
|
var _pageWideScope = require("../../../constants/pageWideScope.js");
|
|
5
5
|
var _scopeType = require("../constants/scopeType.js");
|
|
6
|
-
|
|
7
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
10
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
11
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*
|
|
6
|
+
/*
|
|
12
7
|
Copyright 2023 Adobe. All rights reserved.
|
|
13
8
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
14
9
|
you may not use this file except in compliance with the License. You may obtain a copy
|
|
@@ -19,67 +14,68 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
19
14
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
20
15
|
governing permissions and limitations under the License.
|
|
21
16
|
*/
|
|
22
|
-
var _default =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
17
|
+
var _default = ({
|
|
18
|
+
preprocess,
|
|
19
|
+
isPageWideSurface
|
|
20
|
+
}) => {
|
|
21
|
+
const createItem = (item, proposition) => {
|
|
22
|
+
const {
|
|
23
|
+
id,
|
|
24
|
+
schema,
|
|
25
|
+
data,
|
|
26
|
+
characteristics: {
|
|
27
|
+
trackingLabel
|
|
28
|
+
} = {}
|
|
29
|
+
} = item;
|
|
30
|
+
const schemaType = data ? data.type : undefined;
|
|
31
|
+
const processedData = preprocess(data);
|
|
34
32
|
return {
|
|
35
|
-
getId
|
|
33
|
+
getId() {
|
|
36
34
|
return id;
|
|
37
35
|
},
|
|
38
|
-
getSchema
|
|
36
|
+
getSchema() {
|
|
39
37
|
return schema;
|
|
40
38
|
},
|
|
41
|
-
getSchemaType
|
|
39
|
+
getSchemaType() {
|
|
42
40
|
return schemaType;
|
|
43
41
|
},
|
|
44
|
-
getData
|
|
42
|
+
getData() {
|
|
45
43
|
return processedData;
|
|
46
44
|
},
|
|
47
|
-
getProposition
|
|
45
|
+
getProposition() {
|
|
48
46
|
return proposition;
|
|
49
47
|
},
|
|
50
|
-
getTrackingLabel
|
|
48
|
+
getTrackingLabel() {
|
|
51
49
|
return trackingLabel;
|
|
52
50
|
},
|
|
53
|
-
getOriginalItem
|
|
51
|
+
getOriginalItem() {
|
|
54
52
|
return item;
|
|
55
53
|
},
|
|
56
|
-
toString
|
|
54
|
+
toString() {
|
|
57
55
|
return JSON.stringify(item);
|
|
58
56
|
},
|
|
59
|
-
toJSON
|
|
57
|
+
toJSON() {
|
|
60
58
|
return item;
|
|
61
59
|
}
|
|
62
60
|
};
|
|
63
61
|
};
|
|
64
|
-
return
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
scope
|
|
68
|
-
scopeDetails
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
return (payload, visibleInReturnedItems = true) => {
|
|
63
|
+
const {
|
|
64
|
+
id,
|
|
65
|
+
scope,
|
|
66
|
+
scopeDetails,
|
|
67
|
+
items = []
|
|
68
|
+
} = payload;
|
|
69
|
+
const {
|
|
70
|
+
characteristics: {
|
|
71
|
+
scopeType
|
|
72
|
+
} = {}
|
|
73
|
+
} = scopeDetails || {};
|
|
75
74
|
return {
|
|
76
|
-
getScope
|
|
77
|
-
if (!scope) {
|
|
78
|
-
return scope;
|
|
79
|
-
}
|
|
75
|
+
getScope() {
|
|
80
76
|
return scope;
|
|
81
77
|
},
|
|
82
|
-
getScopeType
|
|
78
|
+
getScopeType() {
|
|
83
79
|
if (scope === _pageWideScope.default || isPageWideSurface(scope)) {
|
|
84
80
|
return _scopeType.PAGE_SCOPE_TYPE;
|
|
85
81
|
}
|
|
@@ -88,42 +84,38 @@ var _default = exports.default = function _default(_ref) {
|
|
|
88
84
|
}
|
|
89
85
|
return _scopeType.PROPOSITION_SCOPE_TYPE;
|
|
90
86
|
},
|
|
91
|
-
getItems
|
|
92
|
-
|
|
93
|
-
return items.map(function (item) {
|
|
94
|
-
return createItem(item, _this);
|
|
95
|
-
});
|
|
87
|
+
getItems() {
|
|
88
|
+
return items.map(item => createItem(item, this));
|
|
96
89
|
},
|
|
97
|
-
getNotification
|
|
90
|
+
getNotification() {
|
|
98
91
|
return {
|
|
99
|
-
id
|
|
100
|
-
scope
|
|
101
|
-
scopeDetails
|
|
92
|
+
id,
|
|
93
|
+
scope,
|
|
94
|
+
scopeDetails
|
|
102
95
|
};
|
|
103
96
|
},
|
|
104
|
-
getId
|
|
97
|
+
getId() {
|
|
105
98
|
return id;
|
|
106
99
|
},
|
|
107
|
-
toJSON
|
|
100
|
+
toJSON() {
|
|
108
101
|
return payload;
|
|
109
102
|
},
|
|
110
|
-
addToReturnValues
|
|
103
|
+
addToReturnValues(propositions, decisions, includedItems, renderAttempted) {
|
|
111
104
|
if (visibleInReturnedItems) {
|
|
112
|
-
propositions.push(
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}));
|
|
105
|
+
propositions.push({
|
|
106
|
+
...payload,
|
|
107
|
+
items: includedItems.map(i => i.getOriginalItem()),
|
|
108
|
+
renderAttempted
|
|
109
|
+
});
|
|
118
110
|
if (!renderAttempted) {
|
|
119
|
-
decisions.push(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}));
|
|
111
|
+
decisions.push({
|
|
112
|
+
...payload,
|
|
113
|
+
items: includedItems.map(i => i.getOriginalItem())
|
|
114
|
+
});
|
|
124
115
|
}
|
|
125
116
|
}
|
|
126
117
|
}
|
|
127
118
|
};
|
|
128
119
|
};
|
|
129
|
-
};
|
|
120
|
+
};
|
|
121
|
+
exports.default = _default;
|
|
@@ -12,9 +12,10 @@ 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 =
|
|
15
|
+
var _default = () => {
|
|
16
16
|
return {
|
|
17
17
|
setRenderAttempted: true,
|
|
18
18
|
includeInNotification: true
|
|
19
19
|
};
|
|
20
|
-
};
|
|
20
|
+
};
|
|
21
|
+
exports.default = _default;
|
package/libEs5/components/Personalization/in-app-message-actions/actions/displayIframeContent.js
CHANGED
|
@@ -10,10 +10,7 @@ var _index4 = require("../../../../utils/validation/index.js");
|
|
|
10
10
|
var _propositionEventType = require("../../../../constants/propositionEventType.js");
|
|
11
11
|
var _eventType = require("../../../../constants/eventType.js");
|
|
12
12
|
var _createRedirect = require("../../dom-actions/createRedirect.js");
|
|
13
|
-
|
|
14
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
15
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
16
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*
|
|
13
|
+
/*
|
|
17
14
|
Copyright 2023 Adobe. All rights reserved.
|
|
18
15
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
19
16
|
you may not use this file except in compliance with the License. You may obtain a copy
|
|
@@ -24,33 +21,34 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
24
21
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
25
22
|
governing permissions and limitations under the License.
|
|
26
23
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var navigateToUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _createRedirect.default)(window);
|
|
35
|
-
return function (event) {
|
|
24
|
+
|
|
25
|
+
const MESSAGING_CONTAINER_ID = "alloy-messaging-container";
|
|
26
|
+
const OVERLAY_CONTAINER_ID = "alloy-overlay-container";
|
|
27
|
+
const IFRAME_ID = "alloy-content-iframe";
|
|
28
|
+
const dismissMessage = () => [MESSAGING_CONTAINER_ID, OVERLAY_CONTAINER_ID].forEach(_utils.removeElementById);
|
|
29
|
+
const createIframeClickHandler = (interact, navigateToUrl = (0, _createRedirect.default)(window)) => {
|
|
30
|
+
return event => {
|
|
36
31
|
event.preventDefault();
|
|
37
32
|
event.stopImmediatePropagation();
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
const {
|
|
34
|
+
target
|
|
35
|
+
} = event;
|
|
36
|
+
const anchor = target.tagName.toLowerCase() === "a" ? target : target.closest("a");
|
|
40
37
|
if (!anchor) {
|
|
41
38
|
return;
|
|
42
39
|
}
|
|
43
|
-
|
|
44
|
-
action
|
|
45
|
-
interaction
|
|
46
|
-
link
|
|
47
|
-
label
|
|
48
|
-
uuid
|
|
40
|
+
const {
|
|
41
|
+
action,
|
|
42
|
+
interaction,
|
|
43
|
+
link,
|
|
44
|
+
label,
|
|
45
|
+
uuid
|
|
46
|
+
} = (0, _utils.parseAnchor)(anchor);
|
|
49
47
|
interact(action, {
|
|
50
|
-
label
|
|
48
|
+
label,
|
|
51
49
|
id: interaction,
|
|
52
|
-
uuid
|
|
53
|
-
link
|
|
50
|
+
uuid,
|
|
51
|
+
link
|
|
54
52
|
});
|
|
55
53
|
if (action === "dismiss") {
|
|
56
54
|
dismissMessage();
|
|
@@ -60,27 +58,30 @@ var createIframeClickHandler = exports.createIframeClickHandler = function creat
|
|
|
60
58
|
}
|
|
61
59
|
};
|
|
62
60
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
exports.createIframeClickHandler = createIframeClickHandler;
|
|
62
|
+
const createIframe = (htmlContent, clickHandler) => {
|
|
63
|
+
const parser = new DOMParser();
|
|
64
|
+
const htmlDocument = parser.parseFromString(htmlContent, _contentType.TEXT_HTML);
|
|
65
|
+
const scriptTag = htmlDocument.querySelector("script");
|
|
67
66
|
if (scriptTag) {
|
|
68
67
|
scriptTag.setAttribute("nonce", (0, _index.getNonce)());
|
|
69
68
|
}
|
|
70
|
-
|
|
69
|
+
const element = (0, _index3.createNode)("iframe", {
|
|
71
70
|
src: URL.createObjectURL(new Blob([htmlDocument.documentElement.outerHTML], {
|
|
72
71
|
type: "text/html"
|
|
73
72
|
})),
|
|
74
73
|
id: IFRAME_ID
|
|
75
74
|
});
|
|
76
|
-
element.addEventListener("load",
|
|
77
|
-
|
|
78
|
-
addEventListener
|
|
75
|
+
element.addEventListener("load", () => {
|
|
76
|
+
const {
|
|
77
|
+
addEventListener
|
|
78
|
+
} = element.contentDocument || element.contentWindow.document;
|
|
79
79
|
addEventListener("click", clickHandler);
|
|
80
80
|
});
|
|
81
81
|
return element;
|
|
82
82
|
};
|
|
83
|
-
|
|
83
|
+
exports.createIframe = createIframe;
|
|
84
|
+
const renderMessage = (iframe, webParameters, container, overlay) => {
|
|
84
85
|
[{
|
|
85
86
|
id: OVERLAY_CONTAINER_ID,
|
|
86
87
|
element: overlay
|
|
@@ -90,39 +91,42 @@ var renderMessage = function renderMessage(iframe, webParameters, container, ove
|
|
|
90
91
|
}, {
|
|
91
92
|
id: IFRAME_ID,
|
|
92
93
|
element: iframe
|
|
93
|
-
}].forEach(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
style =
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
94
|
+
}].forEach(({
|
|
95
|
+
id,
|
|
96
|
+
element
|
|
97
|
+
}) => {
|
|
98
|
+
const {
|
|
99
|
+
style = {},
|
|
100
|
+
params = {}
|
|
101
|
+
} = webParameters[id];
|
|
102
|
+
element.style = {
|
|
103
|
+
...element.style,
|
|
104
|
+
...style
|
|
105
|
+
};
|
|
106
|
+
const {
|
|
107
|
+
parentElement = "body",
|
|
108
|
+
insertionMethod = "appendChild",
|
|
109
|
+
enabled = true
|
|
110
|
+
} = params;
|
|
111
|
+
const parent = document.querySelector(parentElement);
|
|
109
112
|
if (enabled && parent && typeof parent[insertionMethod] === "function") {
|
|
110
113
|
parent[insertionMethod](element);
|
|
111
114
|
}
|
|
112
115
|
});
|
|
113
116
|
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
uiTakeover =
|
|
125
|
-
|
|
117
|
+
const buildStyleFromMobileParameters = mobileParameters => {
|
|
118
|
+
const {
|
|
119
|
+
verticalAlign,
|
|
120
|
+
width,
|
|
121
|
+
horizontalAlign,
|
|
122
|
+
backdropColor,
|
|
123
|
+
height,
|
|
124
|
+
cornerRadius,
|
|
125
|
+
horizontalInset,
|
|
126
|
+
verticalInset,
|
|
127
|
+
uiTakeover = false
|
|
128
|
+
} = mobileParameters;
|
|
129
|
+
const style = {
|
|
126
130
|
width: width ? width + "%" : "100%",
|
|
127
131
|
backgroundColor: backdropColor || "rgba(0, 0, 0, 0.5)",
|
|
128
132
|
borderRadius: cornerRadius ? cornerRadius + "px" : "0px",
|
|
@@ -157,44 +161,48 @@ var buildStyleFromMobileParameters = exports.buildStyleFromMobileParameters = fu
|
|
|
157
161
|
}
|
|
158
162
|
return style;
|
|
159
163
|
};
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
exports.buildStyleFromMobileParameters = buildStyleFromMobileParameters;
|
|
165
|
+
const mobileOverlay = mobileParameters => {
|
|
166
|
+
const {
|
|
167
|
+
backdropOpacity,
|
|
168
|
+
backdropColor
|
|
169
|
+
} = mobileParameters;
|
|
170
|
+
const opacity = backdropOpacity || 0.5;
|
|
171
|
+
const color = backdropColor || "#FFFFFF";
|
|
172
|
+
const style = {
|
|
166
173
|
position: "fixed",
|
|
167
174
|
top: "0",
|
|
168
175
|
left: "0",
|
|
169
176
|
width: "100%",
|
|
170
177
|
height: "100%",
|
|
171
178
|
background: "transparent",
|
|
172
|
-
opacity
|
|
179
|
+
opacity,
|
|
173
180
|
backgroundColor: color
|
|
174
181
|
};
|
|
175
182
|
return style;
|
|
176
183
|
};
|
|
177
|
-
|
|
178
|
-
|
|
184
|
+
exports.mobileOverlay = mobileOverlay;
|
|
185
|
+
const REQUIRED_PARAMS = ["enabled", "parentElement", "insertionMethod"];
|
|
186
|
+
const isValidWebParameters = webParameters => {
|
|
179
187
|
if (!webParameters) {
|
|
180
188
|
return false;
|
|
181
189
|
}
|
|
182
|
-
|
|
183
|
-
if (!
|
|
190
|
+
const ids = Object.keys(webParameters);
|
|
191
|
+
if (!ids.includes(MESSAGING_CONTAINER_ID)) {
|
|
184
192
|
return false;
|
|
185
193
|
}
|
|
186
|
-
if (!
|
|
194
|
+
if (!ids.includes(OVERLAY_CONTAINER_ID)) {
|
|
187
195
|
return false;
|
|
188
196
|
}
|
|
189
|
-
|
|
190
|
-
for (
|
|
197
|
+
const valuesArray = Object.values(webParameters);
|
|
198
|
+
for (let i = 0; i < valuesArray.length; i += 1) {
|
|
191
199
|
if (!(0, _index4.objectOf)(valuesArray[i], "style")) {
|
|
192
200
|
return false;
|
|
193
201
|
}
|
|
194
202
|
if (!(0, _index4.objectOf)(valuesArray[i], "params")) {
|
|
195
203
|
return false;
|
|
196
204
|
}
|
|
197
|
-
for (
|
|
205
|
+
for (let j = 0; j < REQUIRED_PARAMS.length; j += 1) {
|
|
198
206
|
if (!(0, _index4.objectOf)(valuesArray[i].params, REQUIRED_PARAMS[j])) {
|
|
199
207
|
return false;
|
|
200
208
|
}
|
|
@@ -202,57 +210,64 @@ var isValidWebParameters = function isValidWebParameters(webParameters) {
|
|
|
202
210
|
}
|
|
203
211
|
return true;
|
|
204
212
|
};
|
|
205
|
-
|
|
213
|
+
const generateWebParameters = mobileParameters => {
|
|
206
214
|
if (!mobileParameters) {
|
|
207
215
|
return undefined;
|
|
208
216
|
}
|
|
209
|
-
|
|
210
|
-
uiTakeover =
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
217
|
+
const {
|
|
218
|
+
uiTakeover = false
|
|
219
|
+
} = mobileParameters;
|
|
220
|
+
return {
|
|
221
|
+
[IFRAME_ID]: {
|
|
222
|
+
style: {
|
|
223
|
+
border: "none",
|
|
224
|
+
width: "100%",
|
|
225
|
+
height: "100%"
|
|
226
|
+
},
|
|
227
|
+
params: {
|
|
228
|
+
enabled: true,
|
|
229
|
+
parentElement: "#alloy-messaging-container",
|
|
230
|
+
insertionMethod: "appendChild"
|
|
231
|
+
}
|
|
216
232
|
},
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
enabled: uiTakeover === true,
|
|
233
|
-
parentElement: "body",
|
|
234
|
-
insertionMethod: "appendChild"
|
|
233
|
+
[MESSAGING_CONTAINER_ID]: {
|
|
234
|
+
style: buildStyleFromMobileParameters(mobileParameters),
|
|
235
|
+
params: {
|
|
236
|
+
enabled: true,
|
|
237
|
+
parentElement: "body",
|
|
238
|
+
insertionMethod: "appendChild"
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
[OVERLAY_CONTAINER_ID]: {
|
|
242
|
+
style: mobileOverlay(mobileParameters),
|
|
243
|
+
params: {
|
|
244
|
+
enabled: uiTakeover === true,
|
|
245
|
+
parentElement: "body",
|
|
246
|
+
insertionMethod: "appendChild"
|
|
247
|
+
}
|
|
235
248
|
}
|
|
236
|
-
}
|
|
249
|
+
};
|
|
237
250
|
};
|
|
238
251
|
|
|
239
252
|
// eslint-disable-next-line default-param-last
|
|
240
|
-
|
|
241
|
-
var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
242
|
-
var interact = arguments.length > 1 ? arguments[1] : undefined;
|
|
253
|
+
const displayHTMLContentInIframe = (settings = {}, interact) => {
|
|
243
254
|
dismissMessage();
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
255
|
+
const {
|
|
256
|
+
content,
|
|
257
|
+
contentType,
|
|
258
|
+
mobileParameters
|
|
259
|
+
} = settings;
|
|
260
|
+
let {
|
|
261
|
+
webParameters
|
|
262
|
+
} = settings;
|
|
248
263
|
if (contentType !== _contentType.TEXT_HTML) {
|
|
249
264
|
return;
|
|
250
265
|
}
|
|
251
|
-
|
|
266
|
+
const container = (0, _index3.createNode)("div", {
|
|
252
267
|
id: MESSAGING_CONTAINER_ID
|
|
253
268
|
});
|
|
254
|
-
|
|
255
|
-
|
|
269
|
+
const iframe = createIframe(content, createIframeClickHandler(interact));
|
|
270
|
+
const overlay = (0, _index3.createNode)("div", {
|
|
256
271
|
id: OVERLAY_CONTAINER_ID
|
|
257
272
|
});
|
|
258
273
|
if (!isValidWebParameters(webParameters)) {
|
|
@@ -263,24 +278,28 @@ var displayHTMLContentInIframe = exports.displayHTMLContentInIframe = function d
|
|
|
263
278
|
}
|
|
264
279
|
renderMessage(iframe, webParameters, container, overlay);
|
|
265
280
|
};
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
281
|
+
exports.displayHTMLContentInIframe = displayHTMLContentInIframe;
|
|
282
|
+
var _default = (settings, collect) => {
|
|
283
|
+
return new Promise(resolve => {
|
|
284
|
+
const {
|
|
285
|
+
meta
|
|
286
|
+
} = settings;
|
|
287
|
+
displayHTMLContentInIframe(settings, (action, propositionAction) => {
|
|
288
|
+
const propositionEventTypes = {};
|
|
271
289
|
propositionEventTypes[_propositionEventType.PropositionEventType.INTERACT] = _eventType.EVENT_TYPE_TRUE;
|
|
272
290
|
if (Object.values(_propositionEventType.PropositionEventType).indexOf(action) !== -1) {
|
|
273
291
|
propositionEventTypes[action] = _eventType.EVENT_TYPE_TRUE;
|
|
274
292
|
}
|
|
275
293
|
collect({
|
|
276
294
|
decisionsMeta: [meta],
|
|
277
|
-
propositionAction
|
|
295
|
+
propositionAction,
|
|
278
296
|
eventType: _eventType.INTERACT,
|
|
279
297
|
propositionEventTypes: Object.keys(propositionEventTypes)
|
|
280
298
|
});
|
|
281
299
|
});
|
|
282
300
|
resolve({
|
|
283
|
-
meta
|
|
301
|
+
meta
|
|
284
302
|
});
|
|
285
303
|
});
|
|
286
|
-
};
|
|
304
|
+
};
|
|
305
|
+
exports.default = _default;
|
package/libEs5/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js
CHANGED
|
@@ -13,10 +13,9 @@ 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 =
|
|
16
|
+
var _default = collect => {
|
|
17
17
|
return {
|
|
18
|
-
defaultContent:
|
|
19
|
-
return (0, _displayIframeContent.default)(settings, collect);
|
|
20
|
-
}
|
|
18
|
+
defaultContent: settings => (0, _displayIframeContent.default)(settings, collect)
|
|
21
19
|
};
|
|
22
|
-
};
|
|
20
|
+
};
|
|
21
|
+
exports.default = _default;
|
|
@@ -15,37 +15,41 @@ 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
|
-
|
|
18
|
+
const removeElementById = id => {
|
|
19
|
+
const element = (0, _index2.selectNodes)("#" + id, document);
|
|
20
20
|
if (element && element.length > 0) {
|
|
21
21
|
(0, _index2.removeNode)(element[0]);
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
exports.removeElementById = removeElementById;
|
|
25
|
+
const parseAnchor = anchor => {
|
|
26
|
+
const nothing = {};
|
|
26
27
|
if (!anchor || anchor.tagName.toLowerCase() !== "a") {
|
|
27
28
|
return nothing;
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
const {
|
|
31
|
+
href
|
|
32
|
+
} = anchor;
|
|
33
|
+
if (!href || !href.startsWith("adbinapp://")) {
|
|
31
34
|
return nothing;
|
|
32
35
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
const hrefParts = href.split("?");
|
|
37
|
+
const action = hrefParts[0].split("://")[1];
|
|
38
|
+
const label = anchor.innerText;
|
|
39
|
+
const uuid = anchor.getAttribute("data-uuid") || "";
|
|
40
|
+
let interaction;
|
|
41
|
+
let link;
|
|
39
42
|
if ((0, _index.isNonEmptyArray)(hrefParts)) {
|
|
40
|
-
|
|
43
|
+
const queryParams = _index.queryString.parse(hrefParts[1]);
|
|
41
44
|
interaction = queryParams.interaction || "";
|
|
42
45
|
link = decodeURIComponent(queryParams.link || "");
|
|
43
46
|
}
|
|
44
47
|
return {
|
|
45
|
-
action
|
|
46
|
-
interaction
|
|
47
|
-
link
|
|
48
|
-
label
|
|
49
|
-
uuid
|
|
48
|
+
action,
|
|
49
|
+
interaction,
|
|
50
|
+
link,
|
|
51
|
+
label,
|
|
52
|
+
uuid
|
|
50
53
|
};
|
|
51
|
-
};
|
|
54
|
+
};
|
|
55
|
+
exports.parseAnchor = parseAnchor;
|