@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
|
@@ -4,16 +4,16 @@ exports.default = void 0;
|
|
|
4
4
|
var _index = require("../../utils/validation/index.js");
|
|
5
5
|
var _createComponent = require("./createComponent.js");
|
|
6
6
|
var _index2 = require("./dom-actions/index.js");
|
|
7
|
-
var _createCollect = require("
|
|
7
|
+
var _createCollect = require("../../utils/createCollect.js");
|
|
8
8
|
var _index3 = require("./flicker/index.js");
|
|
9
9
|
var _createFetchDataHandler = require("./createFetchDataHandler.js");
|
|
10
10
|
var _collectClicks = require("./dom-actions/clicks/collectClicks.js");
|
|
11
11
|
var _isAuthoringModeEnabled = require("./utils/isAuthoringModeEnabled.js");
|
|
12
|
-
var _event = require("
|
|
12
|
+
var _event = require("../../utils/event.js");
|
|
13
13
|
var _createOnClickHandler = require("./createOnClickHandler.js");
|
|
14
14
|
var _createViewCacheManager = require("./createViewCacheManager.js");
|
|
15
15
|
var _createViewChangeHandler = require("./createViewChangeHandler.js");
|
|
16
|
-
var
|
|
16
|
+
var _createClickStorage = require("./createClickStorage.js");
|
|
17
17
|
var _createInteractionStorage = require("./createInteractionStorage.js");
|
|
18
18
|
var _createApplyPropositions = require("./createApplyPropositions.js");
|
|
19
19
|
var _createGetPageLocation = require("./createGetPageLocation.js");
|
|
@@ -39,10 +39,7 @@ var _createHandleConsentFlicker = require("./createHandleConsentFlicker.js");
|
|
|
39
39
|
var _collectInteractions = require("./dom-actions/clicks/collectInteractions.js");
|
|
40
40
|
var _propositionInteractionType = require("../../constants/propositionInteractionType.js");
|
|
41
41
|
var _decisionProvider = require("../../constants/decisionProvider.js");
|
|
42
|
-
|
|
43
|
-
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; }
|
|
44
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
45
|
-
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); } /*
|
|
42
|
+
/*
|
|
46
43
|
Copyright 2019 Adobe. Ackll rights reserved.
|
|
47
44
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
48
45
|
you may not use this file except in compliance with the License. You may obtain a copy
|
|
@@ -53,129 +50,149 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
53
50
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
54
51
|
governing permissions and limitations under the License.
|
|
55
52
|
*/
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
53
|
+
|
|
54
|
+
const createPersonalization = ({
|
|
55
|
+
config,
|
|
56
|
+
logger,
|
|
57
|
+
eventManager,
|
|
58
|
+
consent
|
|
59
|
+
}) => {
|
|
60
|
+
const {
|
|
61
|
+
targetMigrationEnabled,
|
|
62
|
+
prehidingStyle,
|
|
63
|
+
autoCollectPropositionInteractions
|
|
64
|
+
} = config;
|
|
65
|
+
const collect = (0, _createCollect.default)({
|
|
66
|
+
eventManager,
|
|
66
67
|
mergeDecisionsMeta: _event.mergeDecisionsMeta
|
|
67
68
|
});
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
const showContainers = (0, _index3.createShowContainers)(logger);
|
|
70
|
+
const hideContainers = (0, _index3.createHideContainers)(logger);
|
|
71
|
+
const {
|
|
72
|
+
storeInteractionMeta,
|
|
73
|
+
getInteractionMetas
|
|
74
|
+
} = (0, _createInteractionStorage.default)();
|
|
75
|
+
const {
|
|
76
|
+
storeClickMeta,
|
|
77
|
+
getClickSelectors,
|
|
78
|
+
getClickMetas
|
|
79
|
+
} = (0, _createClickStorage.default)();
|
|
80
|
+
const getPageLocation = (0, _createGetPageLocation.default)({
|
|
81
|
+
window
|
|
77
82
|
});
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
preprocess
|
|
83
|
+
const domActionsModules = (0, _index2.initDomActionsModules)();
|
|
84
|
+
const preprocess = (0, _createPreprocess.default)([_remapHeadOffers.default, _remapCustomCodeOffers.default]);
|
|
85
|
+
const createProposition = (0, _injectCreateProposition.default)({
|
|
86
|
+
preprocess,
|
|
82
87
|
isPageWideSurface: _surfaceUtils.isPageWideSurface
|
|
83
88
|
});
|
|
84
|
-
|
|
85
|
-
createProposition
|
|
89
|
+
const viewCache = (0, _createViewCacheManager.default)({
|
|
90
|
+
createProposition
|
|
86
91
|
});
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
92
|
+
const executeRedirect = (0, _createRedirect.default)(window);
|
|
93
|
+
const schemaProcessors = {
|
|
94
|
+
[schema.DEFAULT_CONTENT_ITEM]: _processDefaultContent.default,
|
|
95
|
+
[schema.DOM_ACTION]: (0, _createProcessDomAction.default)({
|
|
96
|
+
modules: domActionsModules,
|
|
97
|
+
logger,
|
|
98
|
+
storeInteractionMeta,
|
|
99
|
+
storeClickMeta,
|
|
100
|
+
autoCollectPropositionInteractions
|
|
101
|
+
}),
|
|
102
|
+
[schema.HTML_CONTENT_ITEM]: (0, _createProcessHtmlContent.default)({
|
|
103
|
+
modules: domActionsModules,
|
|
104
|
+
logger,
|
|
105
|
+
storeInteractionMeta,
|
|
106
|
+
autoCollectPropositionInteractions
|
|
107
|
+
}),
|
|
108
|
+
[schema.REDIRECT_ITEM]: (0, _createProcessRedirect.default)({
|
|
109
|
+
logger,
|
|
110
|
+
executeRedirect,
|
|
111
|
+
collect
|
|
112
|
+
}),
|
|
113
|
+
[schema.MESSAGE_IN_APP]: (0, _createProcessInAppMessage.default)({
|
|
114
|
+
modules: (0, _initInAppMessageActionsModules.default)(collect),
|
|
115
|
+
logger
|
|
116
|
+
})
|
|
117
|
+
};
|
|
118
|
+
const processPropositions = (0, _createProcessPropositions.default)({
|
|
119
|
+
schemaProcessors,
|
|
120
|
+
logger
|
|
110
121
|
});
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
prehidingStyle
|
|
115
|
-
showContainers
|
|
116
|
-
hideContainers
|
|
122
|
+
const renderedPropositions = (0, _createAsyncArray.default)();
|
|
123
|
+
const notificationHandler = (0, _createNotificationHandler.default)(collect, renderedPropositions);
|
|
124
|
+
const fetchDataHandler = (0, _createFetchDataHandler.default)({
|
|
125
|
+
prehidingStyle,
|
|
126
|
+
showContainers,
|
|
127
|
+
hideContainers,
|
|
117
128
|
mergeQuery: _event.mergeQuery,
|
|
118
|
-
processPropositions
|
|
119
|
-
createProposition
|
|
120
|
-
notificationHandler
|
|
121
|
-
consent
|
|
129
|
+
processPropositions,
|
|
130
|
+
createProposition,
|
|
131
|
+
notificationHandler,
|
|
132
|
+
consent,
|
|
133
|
+
logger
|
|
122
134
|
});
|
|
123
|
-
|
|
135
|
+
const onClickHandler = (0, _createOnClickHandler.default)({
|
|
124
136
|
mergeDecisionsMeta: _event.mergeDecisionsMeta,
|
|
125
137
|
collectInteractions: _collectInteractions.default,
|
|
126
138
|
collectClicks: _collectClicks.default,
|
|
127
|
-
getInteractionMetas
|
|
128
|
-
getClickMetas
|
|
129
|
-
getClickSelectors
|
|
130
|
-
autoCollectPropositionInteractions
|
|
139
|
+
getInteractionMetas,
|
|
140
|
+
getClickMetas,
|
|
141
|
+
getClickSelectors,
|
|
142
|
+
autoCollectPropositionInteractions
|
|
131
143
|
});
|
|
132
|
-
|
|
133
|
-
processPropositions
|
|
134
|
-
viewCache
|
|
144
|
+
const viewChangeHandler = (0, _createViewChangeHandler.default)({
|
|
145
|
+
processPropositions,
|
|
146
|
+
viewCache,
|
|
147
|
+
logger
|
|
135
148
|
});
|
|
136
|
-
|
|
137
|
-
processPropositions
|
|
138
|
-
createProposition
|
|
139
|
-
renderedPropositions
|
|
140
|
-
viewCache
|
|
149
|
+
const applyPropositions = (0, _createApplyPropositions.default)({
|
|
150
|
+
processPropositions,
|
|
151
|
+
createProposition,
|
|
152
|
+
renderedPropositions,
|
|
153
|
+
viewCache
|
|
141
154
|
});
|
|
142
|
-
|
|
143
|
-
targetMigrationEnabled
|
|
155
|
+
const setTargetMigration = (0, _createSetTargetMigration.default)({
|
|
156
|
+
targetMigrationEnabled
|
|
144
157
|
});
|
|
145
|
-
|
|
146
|
-
processPropositions
|
|
147
|
-
createProposition
|
|
148
|
-
notificationHandler
|
|
158
|
+
const onDecisionHandler = (0, _createOnDecisionHandler.default)({
|
|
159
|
+
processPropositions,
|
|
160
|
+
createProposition,
|
|
161
|
+
notificationHandler
|
|
149
162
|
});
|
|
150
|
-
|
|
151
|
-
showContainers
|
|
152
|
-
consent
|
|
163
|
+
const handleConsentFlicker = (0, _createHandleConsentFlicker.default)({
|
|
164
|
+
showContainers,
|
|
165
|
+
consent
|
|
153
166
|
});
|
|
154
167
|
return (0, _createComponent.default)({
|
|
155
|
-
getPageLocation
|
|
156
|
-
logger
|
|
157
|
-
fetchDataHandler
|
|
158
|
-
viewChangeHandler
|
|
159
|
-
onClickHandler
|
|
168
|
+
getPageLocation,
|
|
169
|
+
logger,
|
|
170
|
+
fetchDataHandler,
|
|
171
|
+
viewChangeHandler,
|
|
172
|
+
onClickHandler,
|
|
160
173
|
isAuthoringModeEnabled: _isAuthoringModeEnabled.default,
|
|
161
174
|
mergeQuery: _event.mergeQuery,
|
|
162
|
-
viewCache
|
|
163
|
-
showContainers
|
|
164
|
-
applyPropositions
|
|
165
|
-
setTargetMigration
|
|
175
|
+
viewCache,
|
|
176
|
+
showContainers,
|
|
177
|
+
applyPropositions,
|
|
178
|
+
setTargetMigration,
|
|
166
179
|
mergeDecisionsMeta: _event.mergeDecisionsMeta,
|
|
167
|
-
renderedPropositions
|
|
168
|
-
onDecisionHandler
|
|
169
|
-
handleConsentFlicker
|
|
180
|
+
renderedPropositions,
|
|
181
|
+
onDecisionHandler,
|
|
182
|
+
handleConsentFlicker
|
|
170
183
|
});
|
|
171
184
|
};
|
|
172
185
|
createPersonalization.namespace = "Personalization";
|
|
173
|
-
|
|
174
|
-
return (0, _index.literal)(propositionInteractionType);
|
|
175
|
-
});
|
|
186
|
+
const interactionConfigOptions = _propositionInteractionType.PROPOSITION_INTERACTION_TYPES.map(propositionInteractionType => (0, _index.literal)(propositionInteractionType));
|
|
176
187
|
createPersonalization.configValidators = (0, _index.objectOf)({
|
|
177
188
|
prehidingStyle: (0, _index.string)().nonEmpty(),
|
|
178
189
|
targetMigrationEnabled: (0, _index.boolean)().default(false),
|
|
179
|
-
autoCollectPropositionInteractions: (0, _index.objectOf)(
|
|
190
|
+
autoCollectPropositionInteractions: (0, _index.objectOf)({
|
|
191
|
+
[_decisionProvider.ADOBE_JOURNEY_OPTIMIZER]: (0, _index.anyOf)(interactionConfigOptions).default(_propositionInteractionType.ALWAYS),
|
|
192
|
+
[_decisionProvider.ADOBE_TARGET]: (0, _index.anyOf)(interactionConfigOptions).default(_propositionInteractionType.NEVER)
|
|
193
|
+
}).default({
|
|
194
|
+
[_decisionProvider.ADOBE_JOURNEY_OPTIMIZER]: _propositionInteractionType.ALWAYS,
|
|
195
|
+
[_decisionProvider.ADOBE_TARGET]: _propositionInteractionType.NEVER
|
|
196
|
+
}).noUnknownFields()
|
|
180
197
|
});
|
|
181
198
|
var _default = exports.default = createPersonalization;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
|
-
var _index = require("../../../utils/index.js");
|
|
5
4
|
/*
|
|
6
5
|
Copyright 2021 Adobe. All rights reserved.
|
|
7
6
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -13,12 +12,13 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
13
12
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
13
|
governing permissions and limitations under the License.
|
|
15
14
|
*/
|
|
16
|
-
var _default =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
24
|
-
};
|
|
15
|
+
var _default = ({
|
|
16
|
+
decisions,
|
|
17
|
+
renderAttempted
|
|
18
|
+
}) => {
|
|
19
|
+
return decisions.map(decision => ({
|
|
20
|
+
renderAttempted,
|
|
21
|
+
...decision
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
exports.default = _default;
|
|
@@ -12,14 +12,14 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
12
12
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
13
|
governing permissions and limitations under the License.
|
|
14
14
|
*/
|
|
15
|
-
var _default =
|
|
16
|
-
|
|
15
|
+
var _default = () => {
|
|
16
|
+
let latest = Promise.resolve([]);
|
|
17
17
|
return {
|
|
18
|
-
concat
|
|
19
|
-
latest = latest.then(
|
|
20
|
-
return promise.then(
|
|
18
|
+
concat(promise) {
|
|
19
|
+
latest = latest.then(existingPropositions => {
|
|
20
|
+
return promise.then(newPropositions => {
|
|
21
21
|
return existingPropositions.concat(newPropositions);
|
|
22
|
-
}).catch(
|
|
22
|
+
}).catch(() => {
|
|
23
23
|
return existingPropositions;
|
|
24
24
|
});
|
|
25
25
|
});
|
|
@@ -29,10 +29,11 @@ var _default = exports.default = function _default() {
|
|
|
29
29
|
*
|
|
30
30
|
* @returns {Promise<Array>} A promise that resolves to the latest propositions.
|
|
31
31
|
*/
|
|
32
|
-
clear
|
|
33
|
-
|
|
32
|
+
clear() {
|
|
33
|
+
const oldLatest = latest;
|
|
34
34
|
latest = Promise.resolve([]);
|
|
35
35
|
return oldLatest;
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
};
|
|
38
|
+
};
|
|
39
|
+
exports.default = _default;
|
|
@@ -12,7 +12,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
12
12
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
13
13
|
governing permissions and limitations under the License.
|
|
14
14
|
*/
|
|
15
|
-
var _default =
|
|
16
|
-
var doc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
|
15
|
+
var _default = (doc = document) => {
|
|
17
16
|
return doc.location.href.indexOf("adobe_authoring_enabled") !== -1;
|
|
18
|
-
};
|
|
17
|
+
};
|
|
18
|
+
exports.default = _default;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.dedupeMetas = exports.cleanMetas = void 0;
|
|
4
|
-
var _excluded = ["trackingLabel", "scopeType"];
|
|
5
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
6
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
7
4
|
/*
|
|
8
5
|
Copyright 2024 Adobe. All rights reserved.
|
|
9
6
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -15,19 +12,17 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
15
12
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
16
13
|
governing permissions and limitations under the License.
|
|
17
14
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
});
|
|
33
|
-
};
|
|
15
|
+
const cleanMetas = metas => metas.map(meta => {
|
|
16
|
+
const {
|
|
17
|
+
trackingLabel,
|
|
18
|
+
scopeType,
|
|
19
|
+
...rest
|
|
20
|
+
} = meta;
|
|
21
|
+
return rest;
|
|
22
|
+
});
|
|
23
|
+
exports.cleanMetas = cleanMetas;
|
|
24
|
+
const dedupeMetas = metas => metas.filter((meta, index) => {
|
|
25
|
+
const stringifiedMeta = JSON.stringify(meta);
|
|
26
|
+
return index === metas.findIndex(innerMeta => JSON.stringify(innerMeta) === stringifiedMeta);
|
|
27
|
+
});
|
|
28
|
+
exports.dedupeMetas = dedupeMetas;
|
|
@@ -15,29 +15,22 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
15
15
|
governing permissions and limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var end = path.length;
|
|
18
|
+
const SURFACE_REGEX = /^(\w+):\/\/([^/#]+)(\/[^#]*)?(#.*)?$/;
|
|
19
|
+
const AUTHORITY_REGEX = /^(?:.*@)?(?:[a-z\d\u00a1-\uffff.-]+|\[[a-f\d:]+])(?::\d+)?$/;
|
|
20
|
+
const PATH_REGEX = /^\/(?:[/\w\u00a1-\uffff-.~]|%[a-fA-F\d]{2})*$/;
|
|
21
|
+
const FRAGMENT_REGEX = /^#(?:[/\w\u00a1-\uffff-.~]|%[a-fA-F\d]{2})+$/;
|
|
22
|
+
const normalizePath = (path = "/") => {
|
|
23
|
+
let end = path.length;
|
|
25
24
|
while (end > 0 && "/".indexOf(path.charAt(end - 1)) !== -1) {
|
|
26
25
|
end -= 1;
|
|
27
26
|
}
|
|
28
27
|
return path.substring(0, end) || "/";
|
|
29
28
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
var getPath = function getPath(pathMatch) {
|
|
37
|
-
return (0, _index.isNonEmptyString)(pathMatch) ? normalizePath(pathMatch) : "/";
|
|
38
|
-
};
|
|
39
|
-
var parseSurface = function parseSurface(surfaceString) {
|
|
40
|
-
var matched = surfaceString.match(SURFACE_REGEX);
|
|
29
|
+
const getSurfaceType = surfaceTypeMatch => (0, _index.isNonEmptyString)(surfaceTypeMatch) ? surfaceTypeMatch.toLowerCase() : "";
|
|
30
|
+
const getAuthority = authorityMatch => (0, _index.isNonEmptyString)(authorityMatch) ? authorityMatch.toLowerCase() : "";
|
|
31
|
+
const getPath = pathMatch => (0, _index.isNonEmptyString)(pathMatch) ? normalizePath(pathMatch) : "/";
|
|
32
|
+
const parseSurface = surfaceString => {
|
|
33
|
+
const matched = surfaceString.match(SURFACE_REGEX);
|
|
41
34
|
return matched ? {
|
|
42
35
|
surfaceType: getSurfaceType(matched[1]),
|
|
43
36
|
authority: getAuthority(matched[2]),
|
|
@@ -45,32 +38,29 @@ var parseSurface = function parseSurface(surfaceString) {
|
|
|
45
38
|
fragment: matched[4]
|
|
46
39
|
} : null;
|
|
47
40
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
var host = location.host.toLowerCase();
|
|
54
|
-
var path = location.pathname;
|
|
41
|
+
const stringifySurface = surface => "" + surface.surfaceType + _surface.SURFACE_TYPE_DELIMITER + surface.authority + (surface.path || "") + (surface.fragment || "");
|
|
42
|
+
const buildPageSurface = getPageLocation => {
|
|
43
|
+
const location = getPageLocation();
|
|
44
|
+
const host = location.host.toLowerCase();
|
|
45
|
+
const path = location.pathname;
|
|
55
46
|
return _surface.WEB + _surface.SURFACE_TYPE_DELIMITER + host + normalizePath(path);
|
|
56
47
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
var invalidateSurface = function invalidateSurface(validationError) {
|
|
48
|
+
exports.buildPageSurface = buildPageSurface;
|
|
49
|
+
const expandFragmentSurface = (surface, getPageLocation) => surface.startsWith(_surface.FRAGMENT_DELIMITER) ? buildPageSurface(getPageLocation) + surface : surface;
|
|
50
|
+
const validateSurface = (surface, getPageLocation, logger) => {
|
|
51
|
+
const invalidateSurface = validationError => {
|
|
62
52
|
logger.warn(validationError);
|
|
63
53
|
return null;
|
|
64
54
|
};
|
|
65
55
|
if (!(0, _index.isNonEmptyString)(surface)) {
|
|
66
56
|
return invalidateSurface("Invalid surface: " + surface);
|
|
67
57
|
}
|
|
68
|
-
|
|
69
|
-
|
|
58
|
+
const expanded = expandFragmentSurface(surface, getPageLocation);
|
|
59
|
+
const parsed = parseSurface(expanded);
|
|
70
60
|
if (parsed === null) {
|
|
71
61
|
return invalidateSurface("Invalid surface: " + surface);
|
|
72
62
|
}
|
|
73
|
-
if (!
|
|
63
|
+
if (![_surface.WEB, _surface.WEBAPP].includes(parsed.surfaceType)) {
|
|
74
64
|
return invalidateSurface("Unsupported surface type " + parsed.surfaceType + " in surface: " + surface);
|
|
75
65
|
}
|
|
76
66
|
if (!parsed.authority || !AUTHORITY_REGEX.test(parsed.authority)) {
|
|
@@ -84,18 +74,9 @@ var validateSurface = function validateSurface(surface, getPageLocation, logger)
|
|
|
84
74
|
}
|
|
85
75
|
return parsed;
|
|
86
76
|
};
|
|
87
|
-
|
|
88
|
-
return !!scope && scope.indexOf(_surface.WEB + _surface.SURFACE_TYPE_DELIMITER) === 0 && scope.indexOf(_surface.FRAGMENT_DELIMITER) === -1;
|
|
89
|
-
};
|
|
77
|
+
const isPageWideSurface = scope => !!scope && scope.indexOf(_surface.WEB + _surface.SURFACE_TYPE_DELIMITER) === 0 && scope.indexOf(_surface.FRAGMENT_DELIMITER) === -1;
|
|
90
78
|
|
|
91
79
|
// eslint-disable-next-line default-param-last
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
var logger = arguments.length > 2 ? arguments[2] : undefined;
|
|
96
|
-
return surfaces.map(function (surface) {
|
|
97
|
-
return validateSurface(surface, getPageLocation, logger);
|
|
98
|
-
}).filter(function (surface) {
|
|
99
|
-
return !(0, _index.isNil)(surface);
|
|
100
|
-
}).map(stringifySurface);
|
|
101
|
-
};
|
|
80
|
+
exports.isPageWideSurface = isPageWideSurface;
|
|
81
|
+
const normalizeSurfaces = (surfaces = [], getPageLocation, logger) => surfaces.map(surface => validateSurface(surface, getPageLocation, logger)).filter(surface => !(0, _index.isNil)(surface)).map(stringifySurface);
|
|
82
|
+
exports.normalizeSurfaces = normalizeSurfaces;
|
|
@@ -14,13 +14,14 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
const EMPTY_PROPOSITIONS = exports.EMPTY_PROPOSITIONS = {
|
|
18
18
|
propositions: []
|
|
19
19
|
};
|
|
20
|
-
var _default =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
var _default = ({
|
|
21
|
+
logger,
|
|
22
|
+
options
|
|
23
|
+
}) => {
|
|
24
|
+
const applyPropositionsOptionsValidator = (0, _index.objectOf)({
|
|
24
25
|
propositions: (0, _index.arrayOf)((0, _index.objectOf)({
|
|
25
26
|
id: (0, _index.string)().required(),
|
|
26
27
|
scope: (0, _index.string)().required(),
|
|
@@ -42,4 +43,5 @@ var _default = exports.default = function _default(_ref) {
|
|
|
42
43
|
logger.warn("Invalid options for applyPropositions. No propositions will be applied.", e);
|
|
43
44
|
return EMPTY_PROPOSITIONS;
|
|
44
45
|
}
|
|
45
|
-
};
|
|
46
|
+
};
|
|
47
|
+
exports.default = _default;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
4
|
var _index = require("../../utils/index.js");
|
|
5
|
-
|
|
5
|
+
/*
|
|
6
6
|
Copyright 2020 Adobe. All rights reserved.
|
|
7
7
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
8
|
you may not use this file except in compliance with the License. You may obtain a copy
|
|
@@ -13,21 +13,21 @@ 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
|
+
|
|
16
17
|
// serialize an object with a consistent ordering
|
|
17
|
-
|
|
18
|
+
const serialize = obj => {
|
|
18
19
|
if (Array.isArray(obj)) {
|
|
19
|
-
return obj.map(
|
|
20
|
-
return serialize(i);
|
|
21
|
-
});
|
|
20
|
+
return obj.map(i => serialize(i));
|
|
22
21
|
}
|
|
23
|
-
if (
|
|
24
|
-
return Object.keys(obj).sort().reduce(
|
|
22
|
+
if (typeof obj === "object" && obj !== null) {
|
|
23
|
+
return Object.keys(obj).sort().reduce((memo, key) => {
|
|
25
24
|
memo[key] = serialize(obj[key]);
|
|
26
25
|
return memo;
|
|
27
26
|
}, {});
|
|
28
27
|
}
|
|
29
28
|
return obj;
|
|
30
29
|
};
|
|
31
|
-
var _default =
|
|
30
|
+
var _default = obj => {
|
|
32
31
|
return (0, _index.crc32)(JSON.stringify(serialize(obj)));
|
|
33
|
-
};
|
|
32
|
+
};
|
|
33
|
+
exports.default = _default;
|