@adobe/alloy 2.32.1-beta.0 → 2.33.0-beta.2
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/components.json +9 -0
- package/dist/alloy.js +13696 -12143
- package/dist/alloy.min.js +1 -1
- package/dist/alloyServiceWorker.js +8 -20
- package/dist/alloyServiceWorker.min.js +1 -1
- package/dist/types/browser/src/allOptionalComponents.d.ts +2 -0
- package/dist/types/{core → browser}/src/components/Advertising/constants/index.d.ts +3 -0
- package/dist/types/{core → browser}/src/components/Advertising/handlers/createOnBeforeSendEventHandler.d.ts +4 -1
- package/dist/types/{core → browser}/src/components/Advertising/handlers/sendAdConversion.d.ts +3 -1
- package/dist/types/{core → browser}/src/components/Advertising/handlers/viewThroughHandler.d.ts +3 -1
- package/dist/types/{core → browser}/src/components/Advertising/identities/collectAllIdentities.d.ts +1 -1
- package/dist/types/browser/src/components/Advertising/identities/collectSurferId.d.ts +15 -0
- package/dist/types/browser/src/components/Advertising/identities/createHashedIpHandler.d.ts +9 -0
- package/dist/types/browser/src/components/Advertising/identities/initiateAdvertisingIdentityCall.d.ts +5 -0
- package/dist/types/{core → browser}/src/components/Advertising/utils/helpers.d.ts +14 -0
- package/dist/types/browser/src/components/Advertising/utils/murmurHash128GuavaHex.d.ts +2 -0
- package/dist/types/browser/src/components/Personalization/constants/surface.d.ts +4 -0
- package/dist/types/browser/src/components/Personalization/dom-actions/dom/isDomElement.d.ts +2 -0
- package/dist/types/browser/src/components/Personalization/utils/addRenderAttemptedToDecisions.d.ts +5 -0
- package/dist/types/browser/src/components/Personalization/utils/surfaceUtils.d.ts +3 -0
- package/dist/types/{core → browser}/src/components/PushNotifications/helpers/saveToIndexedDb.d.ts +1 -1
- package/dist/types/{core → browser}/src/components/PushNotifications/index.d.ts +6 -6
- package/dist/types/{core → browser}/src/components/PushNotifications/request/createSendPushSubscriptionPayload.d.ts +2 -2
- package/dist/types/browser/src/components/PushNotifications/request/createSendPushSubscriptionRequest.d.ts +6 -0
- package/dist/types/{core → browser}/src/components/PushNotifications/request/makeSendPushSubscriptionRequest.d.ts +6 -6
- package/dist/types/{core → browser}/src/components/PushNotifications/types.d.ts +1 -1
- package/dist/types/browser/src/components/componentCreators.d.ts +4 -0
- package/dist/types/browser/src/components/requiredComponentCreators.d.ts +1 -0
- package/dist/types/browser/src/index.d.ts +4 -2
- package/dist/types/browser/src/initializeStandalone.d.ts +4 -0
- package/dist/types/core/src/components/Identity/injectAddQueryStringIdentityToPayload.d.ts +2 -1
- package/dist/types/core/src/components/MediaAnalyticsBridge/createGetInstance.d.ts +1 -1
- package/dist/types/core/src/components/MediaAnalyticsBridge/createMediaHelper.d.ts +7 -56
- package/dist/types/core/src/core/componentCreators.d.ts +0 -4
- package/dist/types/core/src/core/requiredComponentCreators.d.ts +0 -1
- package/dist/types/core/src/types.d.ts +0 -4
- package/dist/utils/createEventMergeId.js +38 -30
- package/dist/utils/deepAssign.js +10 -4
- package/package.json +9 -13
- package/rollup.config.js +9 -15
- package/scripts/alloyBuilder.js +34 -42
- package/scripts/helpers/componentMetadata.js +25 -0
- package/scripts/helpers/generateEntryPoint.js +29 -0
- package/src/allOptionalComponents.js +14 -0
- package/src/components/ActivityCollector/attachClickActivityCollector.js +55 -0
- package/src/components/ActivityCollector/configValidators.js +52 -0
- package/src/components/ActivityCollector/createClickActivityStorage.js +33 -0
- package/src/components/ActivityCollector/createClickedElementProperties.js +224 -0
- package/src/components/ActivityCollector/createGetClickedElementProperties.js +68 -0
- package/src/components/ActivityCollector/createInjectClickedElementProperties.js +80 -0
- package/src/components/ActivityCollector/createRecallAndInjectClickedElementProperties.js +45 -0
- package/src/components/ActivityCollector/createStorePageViewProperties.js +20 -0
- package/src/components/ActivityCollector/getLinkName.js +145 -0
- package/src/components/ActivityCollector/getLinkRegion.js +65 -0
- package/src/components/ActivityCollector/index.js +132 -0
- package/src/components/ActivityCollector/utils/activityMapExtensionEnabled.js +16 -0
- package/src/components/ActivityCollector/utils/createTransientStorage.js +26 -0
- package/src/components/ActivityCollector/utils/determineLinkType.js +27 -0
- package/src/components/ActivityCollector/utils/dom/elementHasClickHandler.js +15 -0
- package/src/components/ActivityCollector/utils/dom/extractDomain.js +20 -0
- package/src/components/ActivityCollector/utils/dom/findClickableElement.js +36 -0
- package/src/components/ActivityCollector/utils/dom/getAbsoluteUrlFromAnchorElement.js +25 -0
- package/src/components/ActivityCollector/utils/dom/isButtonSubmitElement.js +15 -0
- package/src/components/ActivityCollector/utils/dom/isDownloadLink.js +27 -0
- package/src/components/ActivityCollector/utils/dom/isExitLink.js +24 -0
- package/src/components/ActivityCollector/utils/dom/isInputSubmitElement.js +26 -0
- package/src/components/ActivityCollector/utils/dom/isSupportedAnchorElement.js +24 -0
- package/src/components/ActivityCollector/utils/dom/isSupportedTextNode.js +27 -0
- package/src/components/ActivityCollector/utils/hasPageName.js +23 -0
- package/src/components/ActivityCollector/utils/isDifferentDomains.js +19 -0
- package/src/components/ActivityCollector/utils/trimQueryFromUrl.js +31 -0
- package/src/components/ActivityCollector/utils/truncateWhiteSpace.js +22 -0
- package/src/components/ActivityCollector/validateClickCollectionConfig.js +47 -0
- package/src/components/Advertising/configValidators.js +32 -0
- package/src/components/Advertising/constants/index.js +80 -0
- package/src/components/Advertising/createComponent.js +24 -0
- package/src/components/Advertising/handlers/clickThroughHandler.js +94 -0
- package/src/components/Advertising/handlers/createAdConversionHandler.js +50 -0
- package/src/components/Advertising/handlers/createOnBeforeSendEventHandler.js +177 -0
- package/src/components/Advertising/handlers/sendAdConversion.js +74 -0
- package/src/components/Advertising/handlers/viewThroughHandler.js +107 -0
- package/src/components/Advertising/identities/collectAllIdentities.js +57 -0
- package/src/components/Advertising/identities/collectID5Id.js +133 -0
- package/src/components/Advertising/identities/collectRampId.js +265 -0
- package/src/components/Advertising/identities/collectSurferId.js +72 -0
- package/src/components/Advertising/identities/createHashedIpHandler.js +36 -0
- package/src/components/Advertising/identities/initiateAdvertisingIdentityCall.js +153 -0
- package/src/components/Advertising/index.js +109 -0
- package/src/components/Advertising/utils/advertisingCookieManager.js +92 -0
- package/src/components/Advertising/utils/helpers.js +190 -0
- package/src/components/Advertising/utils/murmurHash128GuavaHex.js +195 -0
- package/src/components/Context/createComponent.js +35 -0
- package/src/components/Context/implementationDetails.js +23 -0
- package/src/components/Context/index.js +56 -0
- package/src/components/Context/injectDevice.js +77 -0
- package/src/components/Context/injectEnvironment.js +38 -0
- package/src/components/Context/injectHighEntropyUserAgentHints.js +55 -0
- package/src/components/Context/injectOneTimeAnalyticsReferrer.js +61 -0
- package/src/components/Context/injectPlaceContext.js +38 -0
- package/src/components/Context/injectWeb.js +26 -0
- package/src/components/Personalization/constants/loggerMessage.js +14 -0
- package/src/components/Personalization/constants/scopeType.js +15 -0
- package/src/components/Personalization/constants/surface.js +16 -0
- package/src/components/Personalization/createApplyPropositions.js +136 -0
- package/src/components/Personalization/createClickStorage.js +56 -0
- package/src/components/Personalization/createComponent.js +133 -0
- package/src/components/Personalization/createFetchDataHandler.js +149 -0
- package/src/components/Personalization/createGetPageLocation.js +16 -0
- package/src/components/Personalization/createHandleConsentFlicker.js +22 -0
- package/src/components/Personalization/createInteractionStorage.js +104 -0
- package/src/components/Personalization/createNotificationHandler.js +49 -0
- package/src/components/Personalization/createOnClickHandler.js +102 -0
- package/src/components/Personalization/createOnDecisionHandler.js +98 -0
- package/src/components/Personalization/createPersonalizationDetails.js +138 -0
- package/src/components/Personalization/createSetTargetMigration.js +22 -0
- package/src/components/Personalization/createViewCacheManager.js +101 -0
- package/src/components/Personalization/createViewChangeHandler.js +53 -0
- package/src/components/Personalization/dom-actions/action.js +97 -0
- package/src/components/Personalization/dom-actions/addNonceToInlineStyleElements.js +37 -0
- package/src/components/Personalization/dom-actions/appendHtml.js +42 -0
- package/src/components/Personalization/dom-actions/clicks/collectClicks.js +89 -0
- package/src/components/Personalization/dom-actions/clicks/collectInteractions.js +113 -0
- package/src/components/Personalization/dom-actions/collectInteractions.js +15 -0
- package/src/components/Personalization/dom-actions/createPreprocess.js +21 -0
- package/src/components/Personalization/dom-actions/createRedirect.js +23 -0
- package/src/components/Personalization/dom-actions/dom/createFragment.js +18 -0
- package/src/components/Personalization/dom-actions/dom/getAttribute.js +15 -0
- package/src/components/Personalization/dom-actions/dom/getChildNodes.js +23 -0
- package/src/components/Personalization/dom-actions/dom/getChildren.js +23 -0
- package/src/components/Personalization/dom-actions/dom/getElementById.js +21 -0
- package/src/components/Personalization/dom-actions/dom/getFirstChild.js +15 -0
- package/src/components/Personalization/dom-actions/dom/getNextSibling.js +15 -0
- package/src/components/Personalization/dom-actions/dom/getNonce.js +33 -0
- package/src/components/Personalization/dom-actions/dom/getParent.js +15 -0
- package/src/components/Personalization/dom-actions/dom/helperForEq.js +22 -0
- package/src/components/Personalization/dom-actions/dom/index.js +26 -0
- package/src/components/Personalization/dom-actions/dom/insertAfter.js +26 -0
- package/src/components/Personalization/dom-actions/dom/insertBefore.js +25 -0
- package/src/components/Personalization/dom-actions/dom/isDomElement.js +13 -0
- package/src/components/Personalization/dom-actions/dom/matchesSelectorWithEq.js +37 -0
- package/src/components/Personalization/dom-actions/dom/removeAttribute.js +15 -0
- package/src/components/Personalization/dom-actions/dom/selectNodesWithEq.js +101 -0
- package/src/components/Personalization/dom-actions/dom/setAttribute.js +15 -0
- package/src/components/Personalization/dom-actions/dom/setStyle.js +23 -0
- package/src/components/Personalization/dom-actions/dom/util.js +17 -0
- package/src/components/Personalization/dom-actions/images.js +34 -0
- package/src/components/Personalization/dom-actions/index.js +13 -0
- package/src/components/Personalization/dom-actions/initDomActionsModules.js +67 -0
- package/src/components/Personalization/dom-actions/insertHtmlAfter.js +43 -0
- package/src/components/Personalization/dom-actions/insertHtmlBefore.js +40 -0
- package/src/components/Personalization/dom-actions/move.js +28 -0
- package/src/components/Personalization/dom-actions/prependHtml.js +60 -0
- package/src/components/Personalization/dom-actions/rearrangeChildren.js +34 -0
- package/src/components/Personalization/dom-actions/remapCustomCodeOffers.js +33 -0
- package/src/components/Personalization/dom-actions/remapHeadOffers.js +63 -0
- package/src/components/Personalization/dom-actions/replaceHtml.js +20 -0
- package/src/components/Personalization/dom-actions/resize.js +28 -0
- package/src/components/Personalization/dom-actions/scripts.js +106 -0
- package/src/components/Personalization/dom-actions/setAttributes.js +21 -0
- package/src/components/Personalization/dom-actions/setHtml.js +27 -0
- package/src/components/Personalization/dom-actions/setStyles.js +23 -0
- package/src/components/Personalization/dom-actions/setText.js +16 -0
- package/src/components/Personalization/dom-actions/swapImage.js +32 -0
- package/src/components/Personalization/flicker/index.js +106 -0
- package/src/components/Personalization/handlers/createDecorateProposition.js +100 -0
- package/src/components/Personalization/handlers/createProcessDomAction.js +79 -0
- package/src/components/Personalization/handlers/createProcessHtmlContent.js +60 -0
- package/src/components/Personalization/handlers/createProcessInAppMessage.js +91 -0
- package/src/components/Personalization/handlers/createProcessPropositions.js +228 -0
- package/src/components/Personalization/handlers/createProcessRedirect.js +54 -0
- package/src/components/Personalization/handlers/createRenderStatusHandler.js +62 -0
- package/src/components/Personalization/handlers/injectCreateProposition.js +121 -0
- package/src/components/Personalization/handlers/processDefaultContent.js +20 -0
- package/src/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +309 -0
- package/src/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.js +18 -0
- package/src/components/Personalization/in-app-message-actions/utils.js +55 -0
- package/src/components/Personalization/index.js +223 -0
- package/src/components/Personalization/utils/addRenderAttemptedToDecisions.js +15 -0
- package/src/components/Personalization/utils/createAsyncArray.js +37 -0
- package/src/components/Personalization/utils/isAuthoringModeEnabled.js +15 -0
- package/src/components/Personalization/utils/metaUtils.js +27 -0
- package/src/components/Personalization/utils/surfaceUtils.js +120 -0
- package/src/components/Personalization/validateApplyPropositionsOptions.js +56 -0
- package/src/components/PushNotifications/helpers/constants.js +16 -0
- package/src/components/PushNotifications/helpers/getPushSubscriptionDetails.js +122 -0
- package/src/components/PushNotifications/helpers/readFromIndexedDb.js +50 -0
- package/src/components/PushNotifications/helpers/saveToIndexedDb.js +64 -0
- package/src/components/PushNotifications/helpers/serviceWorkerNotificationClickListener.js +84 -0
- package/src/components/PushNotifications/helpers/serviceWorkerPushListener.js +72 -0
- package/src/components/PushNotifications/index.js +128 -0
- package/src/components/PushNotifications/request/createSendPushSubscriptionPayload.js +66 -0
- package/src/components/PushNotifications/request/createSendPushSubscriptionRequest.js +35 -0
- package/src/components/PushNotifications/request/makeSendPushSubscriptionRequest.js +98 -0
- package/src/components/PushNotifications/request/makeSendServiceWorkerTrackingData.js +154 -0
- package/src/components/PushNotifications/types.js +104 -0
- package/src/components/componentCreators.js +16 -0
- package/src/components/requiredComponentCreators.js +13 -0
- package/src/createEventListeners.js +81 -0
- package/src/index.js +14 -2
- package/src/initializeStandalone.js +34 -0
- package/src/serviceWorker.js +2 -2
- package/src/standalone.js +3 -26
- package/.browserslistrc +0 -2
- package/babel.config.js +0 -76
- package/dist/types/core/src/components/Advertising/identities/collectSurferId.d.ts +0 -2
- package/dist/types/core/src/components/PushNotifications/request/createSendPushSubscriptionRequest.d.ts +0 -6
- package/dist/types/core/src/constants/sessionDataKeys.d.ts +0 -1
- package/scripts/helpers/entryPointGeneratorBabelPlugin.js +0 -101
- /package/dist/types/{core → browser}/src/components/ActivityCollector/attachClickActivityCollector.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/configValidators.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/createClickActivityStorage.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/createClickedElementProperties.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/createGetClickedElementProperties.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/createInjectClickedElementProperties.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/createRecallAndInjectClickedElementProperties.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/createStorePageViewProperties.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/getLinkName.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/getLinkRegion.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/index.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/utils/activityMapExtensionEnabled.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/utils/createTransientStorage.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/utils/determineLinkType.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/utils/dom/elementHasClickHandler.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/utils/dom/extractDomain.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/utils/dom/findClickableElement.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/utils/dom/getAbsoluteUrlFromAnchorElement.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/utils/dom/isButtonSubmitElement.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/utils/dom/isDownloadLink.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/utils/dom/isExitLink.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/utils/dom/isInputSubmitElement.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/utils/dom/isSupportedAnchorElement.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/utils/dom/isSupportedTextNode.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/utils/hasPageName.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/utils/isDifferentDomains.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/utils/trimQueryFromUrl.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/utils/truncateWhiteSpace.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/ActivityCollector/validateClickCollectionConfig.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Advertising/configValidators.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Advertising/createComponent.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Advertising/handlers/clickThroughHandler.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Advertising/handlers/createAdConversionHandler.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Advertising/identities/collectID5Id.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Advertising/identities/collectRampId.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Advertising/index.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Advertising/utils/advertisingCookieManager.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Context/createComponent.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Context/implementationDetails.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Context/index.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Context/injectDevice.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Context/injectEnvironment.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Context/injectHighEntropyUserAgentHints.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Context/injectOneTimeAnalyticsReferrer.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Context/injectPlaceContext.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Context/injectWeb.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/constants/loggerMessage.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/constants/scopeType.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/createApplyPropositions.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/createClickStorage.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/createComponent.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/createFetchDataHandler.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/createGetPageLocation.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/createHandleConsentFlicker.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/createInteractionStorage.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/createNotificationHandler.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/createOnClickHandler.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/createOnDecisionHandler.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/createPersonalizationDetails.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/createSetTargetMigration.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/createViewCacheManager.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/createViewChangeHandler.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/action.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/addNonceToInlineStyleElements.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/appendHtml.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/clicks/collectClicks.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/clicks/collectInteractions.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/collectInteractions.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/createPreprocess.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/createRedirect.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/createFragment.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getAttribute.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getChildNodes.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getChildren.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getElementById.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getFirstChild.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getNextSibling.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getNonce.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/getParent.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/helperForEq.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/index.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/insertAfter.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/insertBefore.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/matchesSelectorWithEq.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/removeAttribute.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/selectNodesWithEq.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/setAttribute.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/setStyle.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/dom/util.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/images.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/index.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/initDomActionsModules.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/insertHtmlAfter.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/insertHtmlBefore.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/move.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/prependHtml.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/rearrangeChildren.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/remapCustomCodeOffers.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/remapHeadOffers.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/replaceHtml.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/resize.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/scripts.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/setAttributes.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/setHtml.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/setStyles.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/setText.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/dom-actions/swapImage.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/flicker/index.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/handlers/createDecorateProposition.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessDomAction.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessHtmlContent.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessInAppMessage.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessPropositions.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/handlers/createProcessRedirect.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/handlers/createRenderStatusHandler.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/handlers/injectCreateProposition.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/handlers/processDefaultContent.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/in-app-message-actions/actions/displayIframeContent.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/in-app-message-actions/initInAppMessageActionsModules.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/in-app-message-actions/utils.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/index.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/utils/createAsyncArray.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/utils/isAuthoringModeEnabled.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/utils/metaUtils.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/Personalization/validateApplyPropositionsOptions.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/constants.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/getPushSubscriptionDetails.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/readFromIndexedDb.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/serviceWorkerNotificationClickListener.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/PushNotifications/helpers/serviceWorkerPushListener.d.ts +0 -0
- /package/dist/types/{core → browser}/src/components/PushNotifications/request/makeSendServiceWorkerTrackingData.d.ts +0 -0
- /package/dist/types/{core → browser}/src/createEventListeners.d.ts +0 -0
- /package/dist/types/core/src/{components/Context → utils}/injectTimestamp.d.ts +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import isSupportedAnchorElement from "./isSupportedAnchorElement.js";
|
|
14
|
+
import elementHasClickHandler from "./elementHasClickHandler.js";
|
|
15
|
+
import isInputSubmitElement from "./isInputSubmitElement.js";
|
|
16
|
+
import isButtonSubmitElement from "./isButtonSubmitElement.js";
|
|
17
|
+
|
|
18
|
+
export default (element) => {
|
|
19
|
+
let node = element;
|
|
20
|
+
while (node) {
|
|
21
|
+
// Stop looking when BODY is reached
|
|
22
|
+
if (node.nodeName && node.nodeName === "BODY") {
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
if (
|
|
26
|
+
isSupportedAnchorElement(node) ||
|
|
27
|
+
elementHasClickHandler(node) ||
|
|
28
|
+
isInputSubmitElement(node) ||
|
|
29
|
+
isButtonSubmitElement(node)
|
|
30
|
+
) {
|
|
31
|
+
return node;
|
|
32
|
+
}
|
|
33
|
+
node = node.parentNode;
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export default (window, element) => {
|
|
14
|
+
const base = window.location.href;
|
|
15
|
+
let href = element.href || "";
|
|
16
|
+
// Some objects (like SVG animations) can contain a href object instead of a string
|
|
17
|
+
if (typeof href !== "string") {
|
|
18
|
+
href = "";
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
return new URL(href, base).href;
|
|
22
|
+
} catch {
|
|
23
|
+
return base;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export default (element) => {
|
|
14
|
+
return element.tagName === "BUTTON" && element.type === "submit";
|
|
15
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import trimQueryFromUrl from "../trimQueryFromUrl.js";
|
|
14
|
+
|
|
15
|
+
export default (downloadLinkQualifier, linkUrl, clickedObj) => {
|
|
16
|
+
let result = false;
|
|
17
|
+
if (linkUrl) {
|
|
18
|
+
if (clickedObj && clickedObj.download) {
|
|
19
|
+
result = true;
|
|
20
|
+
} else if (downloadLinkQualifier) {
|
|
21
|
+
const re = new RegExp(downloadLinkQualifier);
|
|
22
|
+
const trimmedLinkUrl = trimQueryFromUrl(linkUrl).toLowerCase();
|
|
23
|
+
result = re.test(trimmedLinkUrl);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import trimQueryFromUrl from "../trimQueryFromUrl.js";
|
|
14
|
+
|
|
15
|
+
export default (window, linkUrl) => {
|
|
16
|
+
let result = false;
|
|
17
|
+
// window.location.hostname should always be defined, but checking just in case
|
|
18
|
+
if (linkUrl && window.location.hostname) {
|
|
19
|
+
const currentHostname = window.location.hostname.toLowerCase();
|
|
20
|
+
const trimmedLinkUrl = trimQueryFromUrl(linkUrl).toLowerCase();
|
|
21
|
+
result = trimmedLinkUrl.indexOf(currentHostname) < 0;
|
|
22
|
+
}
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export default (element) => {
|
|
14
|
+
if (element.tagName === "INPUT") {
|
|
15
|
+
const type = element.getAttribute("type");
|
|
16
|
+
if (type === "submit") {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
// Image type input elements are considered submit elements.
|
|
20
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/image
|
|
21
|
+
if (type === "image" && element.src) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export default (element) => {
|
|
14
|
+
if (
|
|
15
|
+
element.href &&
|
|
16
|
+
(element.tagName === "A" || element.tagName === "AREA") &&
|
|
17
|
+
(!element.onclick ||
|
|
18
|
+
!element.protocol ||
|
|
19
|
+
element.protocol.toLowerCase().indexOf("javascript") < 0)
|
|
20
|
+
) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const unsupportedNodeNames = /^(SCRIPT|STYLE|LINK|CANVAS|NOSCRIPT|#COMMENT)$/i;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Determines if a node qualifies as a supported link text node.
|
|
17
|
+
* @param {*} node Node to determine support for.
|
|
18
|
+
* @returns {boolean}
|
|
19
|
+
*/
|
|
20
|
+
export default (node) => {
|
|
21
|
+
if (node && node.nodeName) {
|
|
22
|
+
if (node.nodeName.match(unsupportedNodeNames)) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export default (event) => {
|
|
14
|
+
const content = event.getContent();
|
|
15
|
+
return (
|
|
16
|
+
content.xdm !== undefined &&
|
|
17
|
+
// NOTE: A page view event should "ideally" include the pageViews type
|
|
18
|
+
// && event.xdm.eventType === "web.webpagedetails.pageViews"
|
|
19
|
+
content.xdm.web !== undefined &&
|
|
20
|
+
content.xdm.web.webPageDetails !== undefined &&
|
|
21
|
+
content.xdm.web.webPageDetails.name !== undefined
|
|
22
|
+
);
|
|
23
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import extractDomain from "./dom/extractDomain.js";
|
|
14
|
+
|
|
15
|
+
export default (uri1, uri2) => {
|
|
16
|
+
const domain1 = extractDomain(uri1);
|
|
17
|
+
const domain2 = extractDomain(uri2);
|
|
18
|
+
return domain1 !== domain2;
|
|
19
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Trims the query from the URL.
|
|
15
|
+
* @param {string} url
|
|
16
|
+
* @returns {string}
|
|
17
|
+
*/
|
|
18
|
+
export default (url) => {
|
|
19
|
+
const questionMarkIndex = url.indexOf("?");
|
|
20
|
+
const hashIndex = url.indexOf("#");
|
|
21
|
+
if (
|
|
22
|
+
questionMarkIndex >= 0 &&
|
|
23
|
+
(questionMarkIndex < hashIndex || hashIndex < 0)
|
|
24
|
+
) {
|
|
25
|
+
return url.substring(0, questionMarkIndex);
|
|
26
|
+
}
|
|
27
|
+
if (hashIndex >= 0) {
|
|
28
|
+
return url.substring(0, hashIndex);
|
|
29
|
+
}
|
|
30
|
+
return url;
|
|
31
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Reduces repeated whitespace within a string. Whitespace surrounding the string
|
|
15
|
+
* is trimmed and any occurrence of whitespace within the string is replaced with
|
|
16
|
+
* a single space.
|
|
17
|
+
* @param {string} str String to be formatted.
|
|
18
|
+
* @returns {string} Formatted string.
|
|
19
|
+
*/
|
|
20
|
+
export default (str) => {
|
|
21
|
+
return str && str.replace(/\s+/g, " ").trim();
|
|
22
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
// src/components/ActivityCollector/validateClickCollectionConfig.js
|
|
13
|
+
/*
|
|
14
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
15
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
16
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
17
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
|
|
19
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
20
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
21
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
22
|
+
governing permissions and limitations under the License.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { DEFAULT_DOWNLOAD_QUALIFIER } from "./configValidators.js";
|
|
26
|
+
|
|
27
|
+
export default (config, logger) => {
|
|
28
|
+
const {
|
|
29
|
+
clickCollectionEnabled,
|
|
30
|
+
onBeforeLinkClickSend,
|
|
31
|
+
downloadLinkQualifier: dlq,
|
|
32
|
+
} = config;
|
|
33
|
+
|
|
34
|
+
if (clickCollectionEnabled === false) {
|
|
35
|
+
if (onBeforeLinkClickSend) {
|
|
36
|
+
logger.warn(
|
|
37
|
+
"The 'onBeforeLinkClickSend' configuration was provided but will be ignored because clickCollectionEnabled is false.",
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (dlq && dlq !== DEFAULT_DOWNLOAD_QUALIFIER) {
|
|
42
|
+
logger.warn(
|
|
43
|
+
"The 'downloadLinkQualifier' configuration was provided but will be ignored because clickCollectionEnabled is false.",
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
objectOf,
|
|
15
|
+
string,
|
|
16
|
+
arrayOf,
|
|
17
|
+
boolean,
|
|
18
|
+
} from "@adobe/alloy-core/utils/validation";
|
|
19
|
+
|
|
20
|
+
export default objectOf({
|
|
21
|
+
advertising: objectOf({
|
|
22
|
+
id5PartnerId: string(),
|
|
23
|
+
rampIdJSPath: string(),
|
|
24
|
+
dspEnabled: boolean(),
|
|
25
|
+
advertiserSettings: arrayOf(
|
|
26
|
+
objectOf({
|
|
27
|
+
advertiserId: string().required(),
|
|
28
|
+
enabled: boolean().required(),
|
|
29
|
+
}).noUnknownFields(),
|
|
30
|
+
),
|
|
31
|
+
}).noUnknownFields(),
|
|
32
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2025 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Cookie Keys
|
|
14
|
+
export const ADVERTISING_COOKIE_KEY = "advertising";
|
|
15
|
+
export const SURFER_ID_COOKIE_KEY = "surfer_id";
|
|
16
|
+
export const RAMP_ID_COOKIE_KEY = "ramp_id";
|
|
17
|
+
export const ID5_COOKIE_KEY = "id5_id";
|
|
18
|
+
export const LAST_CLICK_COOKIE_KEY = "_les_lsc";
|
|
19
|
+
export const LAST_CONVERSION_TIME_KEY = "lastConversionTime";
|
|
20
|
+
export const DISPLAY_CLICK_COOKIE_KEY_EXPIRES = "displayClickCookieExpires";
|
|
21
|
+
export const RAMP_ID_EXPIRES = "rampIdExpires";
|
|
22
|
+
export const LAST_CONVERSION_TIME_KEY_EXPIRES = "lastConversionTimeExpires";
|
|
23
|
+
// URL Parameters
|
|
24
|
+
export const SKWCID_PARAM = "s_kwcid";
|
|
25
|
+
export const EFID_PARAM = "ef_id";
|
|
26
|
+
|
|
27
|
+
// Identity Types
|
|
28
|
+
export const SURFER_ID = "surferId";
|
|
29
|
+
export const HASHED_IP = "hashedIp"; // logical key — matches surferId/id5Id/rampId casing
|
|
30
|
+
export const HASHED_IP_ADDR = "hashedIPAddr"; // cookie key only
|
|
31
|
+
export const RAMP_ID = "rampId";
|
|
32
|
+
export const ID5_ID = "id5Id";
|
|
33
|
+
|
|
34
|
+
// Default Values
|
|
35
|
+
export const UNKNOWN_ADVERTISER = "";
|
|
36
|
+
export const DEFAULT_THROTTLE_MINUTES = 30;
|
|
37
|
+
export const DEFAULT_COOKIE_EXPIRATION_MINUTES = 527040; // 365 days
|
|
38
|
+
|
|
39
|
+
// Event Types
|
|
40
|
+
export const AD_CONVERSION_CLICK_EVENT_TYPE = "advertising.enrichment_ct";
|
|
41
|
+
export const AD_CONVERSION_VIEW_EVENT_TYPE = "advertising.enrichment";
|
|
42
|
+
|
|
43
|
+
// XDM Paths
|
|
44
|
+
export const XDM_AD_CLOUD_PATH = "_experience.adloud";
|
|
45
|
+
export const XDM_AD_ASSET_REFERENCE = "adAssetReference";
|
|
46
|
+
export const XDM_AD_STITCH_DATA = "adStitchData";
|
|
47
|
+
export const XDM_AD_ASSET_DATA = "adAssetData";
|
|
48
|
+
export const XDM_ADVERTISER = "advertiser";
|
|
49
|
+
export const TRACKING_CODE = "trackingCode";
|
|
50
|
+
export const TRACKING_IDENTITIES = "trackingIdentities";
|
|
51
|
+
|
|
52
|
+
// Script URLs
|
|
53
|
+
export const ID5_SCRIPT_URL = "https://www.everestjs.net/static/id5-api.js";
|
|
54
|
+
|
|
55
|
+
// Surfer ID Configuration
|
|
56
|
+
export const SURFER_PIXEL_HOST = "pixel.everesttech.net";
|
|
57
|
+
export const SURFER_USER_ID = "1";
|
|
58
|
+
export const SURFER_TIMEOUT_MS = 5000;
|
|
59
|
+
export const SURFER_TRUSTED_ORIGIN = "www.everestjs.net";
|
|
60
|
+
export const SURFER_PARAM_KEY = "gsurfer";
|
|
61
|
+
export const SURFER_IP = "clientIp";
|
|
62
|
+
|
|
63
|
+
// Error Messages
|
|
64
|
+
export const ERROR_ID5_PARTNER_ID_REQUIRED = "ID5 partner ID is required";
|
|
65
|
+
export const ERROR_RAMP_ID_MAX_RETRIES =
|
|
66
|
+
"Failed to retrieve RampID after maximum retries";
|
|
67
|
+
|
|
68
|
+
// Log Messages
|
|
69
|
+
export const LOG_AD_CONVERSION_START = "Processing ad conversion";
|
|
70
|
+
export const LOG_COOKIE_WRITTEN = "Ad tracking data saved";
|
|
71
|
+
export const LOG_CONVERSION_TIME_UPDATED = "Conversion timing recorded";
|
|
72
|
+
export const LOG_SENDING_CONVERSION = "Submitting ad conversion data";
|
|
73
|
+
export const LOG_ALL_IDS_THROTTLED =
|
|
74
|
+
"Ad conversion paused to prevent duplicate submissions";
|
|
75
|
+
export const LOG_ALL_IDS_USED = "Ad conversion already processed";
|
|
76
|
+
export const LOG_ID_RESOLVED = "Ad identity available";
|
|
77
|
+
export const LOG_ERROR_RESOLVING_ID = "Unable to obtain ad identity";
|
|
78
|
+
export const LOG_ID_CONVERSION_SUCCESS = "Ad conversion submitted successfully";
|
|
79
|
+
export const LOG_AD_CONVERSION_FAILED = "Ad conversion submission failed";
|
|
80
|
+
export const DISPLAY_CLICK_COOKIE_KEY = "ev_lcc";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export default ({ handleOnBeforeSendEvent, sendAdConversionHandler }) => {
|
|
14
|
+
return {
|
|
15
|
+
lifecycle: {
|
|
16
|
+
onComponentsRegistered() {
|
|
17
|
+
// Fire-and-forget: don't return the promise so we don't block
|
|
18
|
+
// the configure command from resolving while waiting for consent.
|
|
19
|
+
sendAdConversionHandler();
|
|
20
|
+
},
|
|
21
|
+
onBeforeEvent: handleOnBeforeSendEvent,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
LAST_CLICK_COOKIE_KEY,
|
|
15
|
+
LAST_CONVERSION_TIME_KEY,
|
|
16
|
+
LOG_AD_CONVERSION_START,
|
|
17
|
+
LOG_AD_CONVERSION_FAILED,
|
|
18
|
+
AD_CONVERSION_CLICK_EVENT_TYPE,
|
|
19
|
+
TRACKING_CODE,
|
|
20
|
+
TRACKING_IDENTITIES,
|
|
21
|
+
LAST_CONVERSION_TIME_KEY_EXPIRES,
|
|
22
|
+
} from "../constants/index.js";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Handles click-through ad conversions
|
|
26
|
+
* @param {Object} params - All required parameters
|
|
27
|
+
* @param {Object} params.eventManager - Event manager for creating events
|
|
28
|
+
* @param {Object} params.cookieManager - Session manager for cookie operations
|
|
29
|
+
* @param {Object} params.adConversionHandler - Handler for sending ad conversion events
|
|
30
|
+
* @param {Object} params.logger - Logger instance
|
|
31
|
+
* @param {string | string[]} params.skwcid - Search keyword click ID
|
|
32
|
+
* @param {string | string[]} params.efid - EF ID parameter
|
|
33
|
+
* @param {Object} params.optionsFromCommand - Additional options from command
|
|
34
|
+
* @returns {Promise} Result of the ad conversion tracking
|
|
35
|
+
*/
|
|
36
|
+
export default async function handleClickThrough({
|
|
37
|
+
eventManager,
|
|
38
|
+
cookieManager,
|
|
39
|
+
adConversionHandler,
|
|
40
|
+
logger,
|
|
41
|
+
skwcid: rawSkwcid,
|
|
42
|
+
efid: rawEfId,
|
|
43
|
+
}) {
|
|
44
|
+
const skwcid = Array.isArray(rawSkwcid) ? rawSkwcid[0] : rawSkwcid;
|
|
45
|
+
const efid = Array.isArray(rawEfId) ? rawEfId[0] : rawEfId;
|
|
46
|
+
|
|
47
|
+
logger.info(LOG_AD_CONVERSION_START, { skwcid: skwcid, efid });
|
|
48
|
+
|
|
49
|
+
const event = eventManager.createEvent();
|
|
50
|
+
if (
|
|
51
|
+
typeof skwcid !== "undefined" &&
|
|
52
|
+
typeof efid !== "undefined" &&
|
|
53
|
+
skwcid.startsWith("AL!")
|
|
54
|
+
) {
|
|
55
|
+
const clickData = {
|
|
56
|
+
click_time: Date.now(),
|
|
57
|
+
skwcid,
|
|
58
|
+
efid,
|
|
59
|
+
};
|
|
60
|
+
cookieManager.setValue(LAST_CLICK_COOKIE_KEY, clickData);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const xdm = {
|
|
64
|
+
_experience: {
|
|
65
|
+
adcloud: {
|
|
66
|
+
conversionDetails: {
|
|
67
|
+
...(typeof skwcid !== "undefined" && {
|
|
68
|
+
[TRACKING_CODE]: skwcid,
|
|
69
|
+
}),
|
|
70
|
+
...(typeof efid !== "undefined" && {
|
|
71
|
+
[TRACKING_IDENTITIES]: efid,
|
|
72
|
+
}),
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
eventType: AD_CONVERSION_CLICK_EVENT_TYPE,
|
|
77
|
+
timestamp: new Date().toISOString(),
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
event.setUserXdm(xdm);
|
|
81
|
+
|
|
82
|
+
cookieManager.setValue(LAST_CONVERSION_TIME_KEY);
|
|
83
|
+
cookieManager.setValue(
|
|
84
|
+
LAST_CONVERSION_TIME_KEY_EXPIRES,
|
|
85
|
+
Date.now() + 91 * 24 * 60 * 60 * 1000,
|
|
86
|
+
); //expires in 91 days
|
|
87
|
+
|
|
88
|
+
try {
|
|
89
|
+
return await adConversionHandler.trackAdConversion({ event });
|
|
90
|
+
} catch (error) {
|
|
91
|
+
logger.error(LOG_AD_CONVERSION_FAILED, error);
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2023 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Creates a specialized handler for ad conversion events.
|
|
15
|
+
* This follows a similar pattern to the media event handling in the StreamingMedia component.
|
|
16
|
+
*/
|
|
17
|
+
export default ({
|
|
18
|
+
sendEdgeNetworkRequest,
|
|
19
|
+
consent,
|
|
20
|
+
createDataCollectionRequest,
|
|
21
|
+
createDataCollectionRequestPayload,
|
|
22
|
+
logger,
|
|
23
|
+
}) => {
|
|
24
|
+
/**
|
|
25
|
+
* Tracks an ad conversion event by sending it directly to the Edge Network
|
|
26
|
+
*/
|
|
27
|
+
const trackAdConversion = ({ event }) => {
|
|
28
|
+
const dataCollectionRequestPayload = createDataCollectionRequestPayload();
|
|
29
|
+
dataCollectionRequestPayload.addEvent(event);
|
|
30
|
+
event.finalize();
|
|
31
|
+
const request = createDataCollectionRequest({
|
|
32
|
+
payload: dataCollectionRequestPayload,
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
return consent.awaitConsent().then(() => {
|
|
36
|
+
return sendEdgeNetworkRequest({ request })
|
|
37
|
+
.then(() => {
|
|
38
|
+
return { success: true };
|
|
39
|
+
})
|
|
40
|
+
.catch((error) => {
|
|
41
|
+
logger.error("Failed to send ad conversion event", error);
|
|
42
|
+
throw error;
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
trackAdConversion,
|
|
49
|
+
};
|
|
50
|
+
};
|