@adobe/alloy 2.21.1 → 2.22.0-alpha.0
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 +49 -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 +25 -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 +34 -31
- 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 +91 -107
- package/libEs5/components/Personalization/handlers/createProcessRedirect.js +30 -29
- package/libEs5/components/Personalization/handlers/injectCreateProposition.js +59 -64
- 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 +112 -99
- 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 +28 -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/createPersonalizationDetails.js +6 -6
- package/libEs6/components/Personalization/createViewCacheManager.js +5 -2
- 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/handlers/createDecorateProposition.js +2 -2
- 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 +2 -2
- 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 +4 -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
|
@@ -12,20 +12,16 @@ 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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var findIndex = function findIndex(array, item, isEqual) {
|
|
19
|
-
for (var i = 0; i < array.length; i += 1) {
|
|
15
|
+
const REFERENCE_EQUALITY = (a, b) => a === b;
|
|
16
|
+
const findIndex = (array, item, isEqual) => {
|
|
17
|
+
for (let i = 0; i < array.length; i += 1) {
|
|
20
18
|
if (isEqual(array[i], item)) {
|
|
21
19
|
return i;
|
|
22
20
|
}
|
|
23
21
|
}
|
|
24
22
|
return -1;
|
|
25
23
|
};
|
|
26
|
-
var _default =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
-
};
|
|
24
|
+
var _default = (array, isEqual = REFERENCE_EQUALITY) => {
|
|
25
|
+
return array.filter((item, index) => findIndex(array, item, isEqual) === index);
|
|
26
|
+
};
|
|
27
|
+
exports.default = _default;
|
|
@@ -15,8 +15,8 @@ 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
|
-
Object.keys(source).forEach(
|
|
18
|
+
const deepAssignObject = (target, source) => {
|
|
19
|
+
Object.keys(source).forEach(key => {
|
|
20
20
|
if ((0, _isObject.default)(target[key]) && (0, _isObject.default)(source[key])) {
|
|
21
21
|
deepAssignObject(target[key], source[key]);
|
|
22
22
|
return;
|
|
@@ -33,16 +33,12 @@ var deepAssignObject = function deepAssignObject(target, source) {
|
|
|
33
33
|
* deepAssign({ a: 'a', b: 'b' }, { b: 'B', c: 'c' });
|
|
34
34
|
* // { a: 'a', b: 'B', c: 'c' }
|
|
35
35
|
*/
|
|
36
|
-
var _default =
|
|
36
|
+
var _default = (target, ...sources) => {
|
|
37
37
|
if ((0, _isNil.default)(target)) {
|
|
38
38
|
throw new TypeError('deepAssign "target" cannot be null or undefined');
|
|
39
39
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
sources[_key - 1] = arguments[_key];
|
|
43
|
-
}
|
|
44
|
-
sources.forEach(function (source) {
|
|
45
|
-
return deepAssignObject(result, Object(source));
|
|
46
|
-
});
|
|
40
|
+
const result = Object(target);
|
|
41
|
+
sources.forEach(source => deepAssignObject(result, Object(source)));
|
|
47
42
|
return result;
|
|
48
|
-
};
|
|
43
|
+
};
|
|
44
|
+
exports.default = _default;
|
package/libEs5/utils/defer.js
CHANGED
|
@@ -16,11 +16,12 @@ governing permissions and limitations under the License.
|
|
|
16
16
|
* A simple utility for managing a promise's state outside of
|
|
17
17
|
* the promise's "executor" (the function passed into the constructor).
|
|
18
18
|
*/
|
|
19
|
-
var _default =
|
|
20
|
-
|
|
21
|
-
deferred.promise = new Promise(
|
|
19
|
+
var _default = () => {
|
|
20
|
+
const deferred = {};
|
|
21
|
+
deferred.promise = new Promise((resolve, reject) => {
|
|
22
22
|
deferred.resolve = resolve;
|
|
23
23
|
deferred.reject = reject;
|
|
24
24
|
});
|
|
25
25
|
return deferred;
|
|
26
|
-
};
|
|
26
|
+
};
|
|
27
|
+
exports.default = _default;
|
|
@@ -12,6 +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 =
|
|
15
|
+
var _default = (parent, node) => {
|
|
16
16
|
return parent.appendChild(node);
|
|
17
|
-
};
|
|
17
|
+
};
|
|
18
|
+
exports.default = _default;
|
|
@@ -16,30 +16,31 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
16
16
|
governing permissions and limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const MUTATION_OBSERVER = "MutationObserver";
|
|
20
|
+
const RAF = "requestAnimationFrame";
|
|
21
|
+
const MUTATION_OBSERVER_CONFIG = {
|
|
22
22
|
childList: true,
|
|
23
23
|
subtree: true
|
|
24
24
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
const VISIBILITY_STATE = "visibilityState";
|
|
26
|
+
const VISIBLE = "visible";
|
|
27
|
+
const DELAY = 100;
|
|
28
|
+
const MAX_POLLING_TIMEOUT = 5000;
|
|
29
|
+
const createError = selector => {
|
|
30
30
|
return new Error("Could not find: " + selector);
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
const createPromise = executor => {
|
|
33
33
|
return new Promise(executor);
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
const canUseMutationObserver = win => {
|
|
36
36
|
return (0, _isFunction.default)(win[MUTATION_OBSERVER]);
|
|
37
37
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
exports.canUseMutationObserver = canUseMutationObserver;
|
|
39
|
+
const awaitUsingMutationObserver = (win, doc, selector, timeout, selectFunc) => {
|
|
40
|
+
return createPromise((resolve, reject) => {
|
|
41
|
+
let timer;
|
|
42
|
+
const mutationObserver = new win[MUTATION_OBSERVER](() => {
|
|
43
|
+
const nodes = selectFunc(selector);
|
|
43
44
|
if ((0, _isNonEmptyArray.default)(nodes)) {
|
|
44
45
|
mutationObserver.disconnect();
|
|
45
46
|
if (timer) {
|
|
@@ -48,20 +49,22 @@ var awaitUsingMutationObserver = exports.awaitUsingMutationObserver = function a
|
|
|
48
49
|
resolve(nodes);
|
|
49
50
|
}
|
|
50
51
|
});
|
|
51
|
-
timer = setTimeout(
|
|
52
|
+
timer = setTimeout(() => {
|
|
52
53
|
mutationObserver.disconnect();
|
|
53
54
|
reject(createError(selector));
|
|
54
55
|
}, timeout);
|
|
55
56
|
mutationObserver.observe(doc, MUTATION_OBSERVER_CONFIG);
|
|
56
57
|
});
|
|
57
58
|
};
|
|
58
|
-
|
|
59
|
+
exports.awaitUsingMutationObserver = awaitUsingMutationObserver;
|
|
60
|
+
const canUseRequestAnimationFrame = doc => {
|
|
59
61
|
return doc[VISIBILITY_STATE] === VISIBLE;
|
|
60
62
|
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
exports.canUseRequestAnimationFrame = canUseRequestAnimationFrame;
|
|
64
|
+
const awaitUsingRequestAnimation = (win, selector, timeout, selectFunc) => {
|
|
65
|
+
return createPromise((resolve, reject) => {
|
|
66
|
+
const execute = () => {
|
|
67
|
+
const nodes = selectFunc(selector);
|
|
65
68
|
if ((0, _isNonEmptyArray.default)(nodes)) {
|
|
66
69
|
resolve(nodes);
|
|
67
70
|
return;
|
|
@@ -69,15 +72,16 @@ var awaitUsingRequestAnimation = exports.awaitUsingRequestAnimation = function a
|
|
|
69
72
|
win[RAF](execute);
|
|
70
73
|
};
|
|
71
74
|
execute();
|
|
72
|
-
setTimeout(
|
|
75
|
+
setTimeout(() => {
|
|
73
76
|
reject(createError(selector));
|
|
74
77
|
}, timeout);
|
|
75
78
|
});
|
|
76
79
|
};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
exports.awaitUsingRequestAnimation = awaitUsingRequestAnimation;
|
|
81
|
+
const awaitUsingTimer = (selector, timeout, selectFunc) => {
|
|
82
|
+
return createPromise((resolve, reject) => {
|
|
83
|
+
const execute = () => {
|
|
84
|
+
const nodes = selectFunc(selector);
|
|
81
85
|
if ((0, _isNonEmptyArray.default)(nodes)) {
|
|
82
86
|
resolve(nodes);
|
|
83
87
|
return;
|
|
@@ -85,17 +89,14 @@ var awaitUsingTimer = exports.awaitUsingTimer = function awaitUsingTimer(selecto
|
|
|
85
89
|
setTimeout(execute, DELAY);
|
|
86
90
|
};
|
|
87
91
|
execute();
|
|
88
|
-
setTimeout(
|
|
92
|
+
setTimeout(() => {
|
|
89
93
|
reject(createError(selector));
|
|
90
94
|
}, timeout);
|
|
91
95
|
});
|
|
92
96
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
var win = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : window;
|
|
97
|
-
var doc = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : document;
|
|
98
|
-
var nodes = selectFunc(selector);
|
|
97
|
+
exports.awaitUsingTimer = awaitUsingTimer;
|
|
98
|
+
var _default = (selector, selectFunc = _selectNodes.default, timeout = MAX_POLLING_TIMEOUT, win = window, doc = document) => {
|
|
99
|
+
const nodes = selectFunc(selector);
|
|
99
100
|
if ((0, _isNonEmptyArray.default)(nodes)) {
|
|
100
101
|
return Promise.resolve(nodes);
|
|
101
102
|
}
|
|
@@ -106,4 +107,5 @@ var _default = exports.default = function _default(selector) {
|
|
|
106
107
|
return awaitUsingRequestAnimation(win, selector, timeout, selectFunc);
|
|
107
108
|
}
|
|
108
109
|
return awaitUsingTimer(selector, timeout, selectFunc);
|
|
109
|
-
};
|
|
110
|
+
};
|
|
111
|
+
exports.default = _default;
|
|
@@ -15,12 +15,12 @@ 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
|
-
Object.keys(props).forEach(
|
|
18
|
+
const populateElementProperties = (element, props) => {
|
|
19
|
+
Object.keys(props).forEach(key => {
|
|
20
20
|
// The following is to support setting style properties to avoid CSP errors.
|
|
21
21
|
if (key === "style" && (0, _isObject.default)(props[key])) {
|
|
22
|
-
|
|
23
|
-
Object.keys(styleProps).forEach(
|
|
22
|
+
const styleProps = props[key];
|
|
23
|
+
Object.keys(styleProps).forEach(styleKey => {
|
|
24
24
|
element.style[styleKey] = styleProps[styleKey];
|
|
25
25
|
});
|
|
26
26
|
} else {
|
|
@@ -28,20 +28,15 @@ var populateElementProperties = function populateElementProperties(element, prop
|
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
};
|
|
31
|
-
var _default =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var children = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
35
|
-
var doc = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : document;
|
|
36
|
-
var result = doc.createElement(tag);
|
|
37
|
-
Object.keys(attrs).forEach(function (key) {
|
|
31
|
+
var _default = (tag, attrs = {}, props = {}, children = [], doc = document) => {
|
|
32
|
+
const result = doc.createElement(tag);
|
|
33
|
+
Object.keys(attrs).forEach(key => {
|
|
38
34
|
// TODO: To highlight CSP problems consider throwing a descriptive error
|
|
39
35
|
// if nonce is available and key is style.
|
|
40
36
|
result.setAttribute(key, attrs[key]);
|
|
41
37
|
});
|
|
42
38
|
populateElementProperties(result, props);
|
|
43
|
-
children.forEach(
|
|
44
|
-
return (0, _appendNode.default)(result, child);
|
|
45
|
-
});
|
|
39
|
+
children.forEach(child => (0, _appendNode.default)(result, child));
|
|
46
40
|
return result;
|
|
47
|
-
};
|
|
41
|
+
};
|
|
42
|
+
exports.default = _default;
|
|
@@ -2,49 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "appendNode", {
|
|
4
4
|
enumerable: true,
|
|
5
|
-
get: function
|
|
5
|
+
get: function () {
|
|
6
6
|
return _appendNode.default;
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
9
|
Object.defineProperty(exports, "awaitSelector", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function
|
|
11
|
+
get: function () {
|
|
12
12
|
return _awaitSelector.default;
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "createNode", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function
|
|
17
|
+
get: function () {
|
|
18
18
|
return _createNode.default;
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "matchesSelector", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function
|
|
23
|
+
get: function () {
|
|
24
24
|
return _matchesSelector.default;
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "querySelectorAll", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function
|
|
29
|
+
get: function () {
|
|
30
30
|
return _querySelectorAll.default;
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "removeNode", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function
|
|
35
|
+
get: function () {
|
|
36
36
|
return _removeNode.default;
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, "selectNodes", {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function
|
|
41
|
+
get: function () {
|
|
42
42
|
return _selectNodes.default;
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "selectNodesWithShadow", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function
|
|
47
|
+
get: function () {
|
|
48
48
|
return _selectNodesWithShadow.default;
|
|
49
49
|
}
|
|
50
50
|
});
|
|
@@ -13,6 +13,5 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
13
13
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
var _default =
|
|
17
|
-
|
|
18
|
-
};
|
|
16
|
+
var _default = str => str.indexOf(_shadowSeparator.default) !== -1;
|
|
17
|
+
exports.default = _default;
|
|
@@ -18,11 +18,12 @@ governing permissions and limitations under the License.
|
|
|
18
18
|
* @param {Node} [element]
|
|
19
19
|
* @returns {Boolean}
|
|
20
20
|
*/
|
|
21
|
-
var _default =
|
|
21
|
+
var _default = (selector, element) => {
|
|
22
22
|
if (element.matches) {
|
|
23
23
|
return element.matches(selector);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
// Making IE 11 happy
|
|
27
27
|
return element.msMatchesSelector(selector);
|
|
28
|
-
};
|
|
28
|
+
};
|
|
29
|
+
exports.default = _default;
|
|
@@ -14,19 +14,11 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
14
14
|
governing permissions and limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
var _default =
|
|
17
|
+
const SIBLING_PATTERN = /^\s*>/;
|
|
18
|
+
var _default = (context, selector) => {
|
|
19
19
|
if (!SIBLING_PATTERN.test(selector)) {
|
|
20
20
|
return (0, _toArray.default)(context.querySelectorAll(selector));
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// so we add a dummy css class to be able to select the children
|
|
26
|
-
try {
|
|
27
|
-
context.classList.add(tag);
|
|
28
|
-
return (0, _toArray.default)(context.querySelectorAll("." + tag + " " + selector));
|
|
29
|
-
} finally {
|
|
30
|
-
context.classList.remove(tag);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
22
|
+
return (0, _toArray.default)(context.querySelectorAll(":scope " + selector));
|
|
23
|
+
};
|
|
24
|
+
exports.default = _default;
|
|
@@ -12,10 +12,11 @@ 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 = node => {
|
|
16
|
+
const parent = node.parentNode;
|
|
17
17
|
if (parent) {
|
|
18
18
|
return parent.removeChild(node);
|
|
19
19
|
}
|
|
20
20
|
return null;
|
|
21
|
-
};
|
|
21
|
+
};
|
|
22
|
+
exports.default = _default;
|
|
@@ -21,10 +21,10 @@ governing permissions and limitations under the License.
|
|
|
21
21
|
* @param {Node} [context=document] defaults to document
|
|
22
22
|
* @returns {Array} an array of DOM nodes
|
|
23
23
|
*/
|
|
24
|
-
var _default =
|
|
25
|
-
var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
|
|
24
|
+
var _default = (selector, context = document) => {
|
|
26
25
|
if (!(0, _isShadowSelector.default)(selector)) {
|
|
27
26
|
return (0, _querySelectorAll.default)(context, selector);
|
|
28
27
|
}
|
|
29
28
|
return (0, _selectNodesWithShadow.default)(context, selector);
|
|
30
|
-
};
|
|
29
|
+
};
|
|
30
|
+
exports.default = _default;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
4
|
var _querySelectorAll = require("./querySelectorAll.js");
|
|
5
|
-
var _startsWith = require("../startsWith.js");
|
|
6
5
|
var _shadowSeparator = require("../../constants/shadowSeparator.js");
|
|
7
6
|
/*
|
|
8
7
|
Copyright 2021 Adobe. All rights reserved.
|
|
@@ -16,51 +15,43 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
16
15
|
governing permissions and limitations under the License.
|
|
17
16
|
*/
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
const splitWithShadow = selector => {
|
|
20
19
|
return selector.split(_shadowSeparator.default);
|
|
21
20
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const transformPrefix = (parent, selector) => {
|
|
22
|
+
const result = selector;
|
|
23
|
+
const hasChildCombinatorPrefix = result.startsWith(">");
|
|
25
24
|
if (!hasChildCombinatorPrefix) {
|
|
26
25
|
return result;
|
|
27
26
|
}
|
|
28
|
-
|
|
29
|
-
// IE doesn't support :scope
|
|
30
|
-
if (window.document.documentMode) {
|
|
31
|
-
return result.substring(1).trim();
|
|
32
|
-
}
|
|
33
|
-
var prefix = parent instanceof Element || parent instanceof HTMLDocument ? ":scope" : ":host"; // see https://bugs.webkit.org/show_bug.cgi?id=233380
|
|
27
|
+
const prefix = parent instanceof Element || parent instanceof Document ? ":scope" : ":host"; // see https://bugs.webkit.org/show_bug.cgi?id=233380
|
|
34
28
|
|
|
35
29
|
return prefix + " " + result;
|
|
36
30
|
};
|
|
37
|
-
var _default =
|
|
38
|
-
|
|
39
|
-
if (!window.document.documentElement.attachShadow) {
|
|
40
|
-
return (0, _querySelectorAll.default)(context, selector.replace(_shadowSeparator.default, ""));
|
|
41
|
-
}
|
|
42
|
-
var parts = splitWithShadow(selector);
|
|
31
|
+
var _default = (context, selector) => {
|
|
32
|
+
const parts = splitWithShadow(selector);
|
|
43
33
|
if (parts.length < 2) {
|
|
44
34
|
return (0, _querySelectorAll.default)(context, selector);
|
|
45
35
|
}
|
|
46
36
|
|
|
47
37
|
// split the selector into parts separated by :shadow pseudo-selectors
|
|
48
38
|
// find each subselector element based on the previously selected node's shadowRoot
|
|
49
|
-
|
|
50
|
-
for (
|
|
51
|
-
|
|
39
|
+
let parent = context;
|
|
40
|
+
for (let i = 0; i < parts.length; i += 1) {
|
|
41
|
+
const part = parts[i].trim();
|
|
52
42
|
// if part is empty, it means there's a chained :eq:shadow selector
|
|
53
43
|
if (part === "" && parent.shadowRoot) {
|
|
54
44
|
parent = parent.shadowRoot;
|
|
55
45
|
// eslint-disable-next-line no-continue
|
|
56
46
|
continue;
|
|
57
47
|
}
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
const prefixed = transformPrefix(parent, part);
|
|
49
|
+
const partNode = (0, _querySelectorAll.default)(parent, prefixed);
|
|
60
50
|
if (partNode.length === 0 || !partNode[0] || !partNode[0].shadowRoot) {
|
|
61
51
|
return partNode;
|
|
62
52
|
}
|
|
63
53
|
parent = partNode[0].shadowRoot;
|
|
64
54
|
}
|
|
65
55
|
return undefined;
|
|
66
|
-
};
|
|
56
|
+
};
|
|
57
|
+
exports.default = _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.mergeQuery = exports.mergeDecisionsMeta = void 0;
|
|
4
|
+
var _eventType = require("../constants/eventType.js");
|
|
5
|
+
/*
|
|
6
|
+
Copyright 2019 Adobe. All rights reserved.
|
|
7
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
9
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
12
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
13
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
14
|
+
governing permissions and limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/* eslint-disable no-underscore-dangle */
|
|
18
|
+
const mergeDecisionsMeta = (event, decisionsMeta, propositionEventTypes, propositionAction) => {
|
|
19
|
+
// Do not send a display notification with no decisions. Even empty view changes
|
|
20
|
+
// should include a proposition.
|
|
21
|
+
if (decisionsMeta.length === 0) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const propositionEventType = {};
|
|
25
|
+
propositionEventTypes.forEach(type => {
|
|
26
|
+
propositionEventType[type] = _eventType.EVENT_TYPE_TRUE;
|
|
27
|
+
});
|
|
28
|
+
const xdm = {
|
|
29
|
+
_experience: {
|
|
30
|
+
decisioning: {
|
|
31
|
+
propositions: decisionsMeta,
|
|
32
|
+
propositionEventType
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
if (propositionAction) {
|
|
37
|
+
xdm._experience.decisioning.propositionAction = propositionAction;
|
|
38
|
+
}
|
|
39
|
+
event.mergeXdm(xdm);
|
|
40
|
+
};
|
|
41
|
+
exports.mergeDecisionsMeta = mergeDecisionsMeta;
|
|
42
|
+
const mergeQuery = (event, details) => {
|
|
43
|
+
event.mergeQuery({
|
|
44
|
+
personalization: {
|
|
45
|
+
...details
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
exports.mergeQuery = mergeQuery;
|
|
@@ -4,12 +4,7 @@ exports.default = void 0;
|
|
|
4
4
|
var _isEmptyObject = require("./isEmptyObject.js");
|
|
5
5
|
var _isNil = require("./isNil.js");
|
|
6
6
|
var _isObject = require("./isObject.js");
|
|
7
|
-
|
|
8
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
|
-
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; }
|
|
11
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
|
-
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); } /*
|
|
7
|
+
/*
|
|
13
8
|
Copyright 2022 Adobe. All rights reserved.
|
|
14
9
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
15
10
|
you may not use this file except in compliance with the License. You may obtain a copy
|
|
@@ -20,6 +15,7 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
20
15
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
21
16
|
governing permissions and limitations under the License.
|
|
22
17
|
*/
|
|
18
|
+
|
|
23
19
|
/**
|
|
24
20
|
* Given an object and a function that takes a value and returns a predicate, filter out
|
|
25
21
|
* all non-object deeply nested values that do not pass the predicate.
|
|
@@ -31,23 +27,29 @@ governing permissions and limitations under the License.
|
|
|
31
27
|
* representing if it should be included in the result object or not.
|
|
32
28
|
* @returns A copy of the original object with the values that fail the predicate, filtered out.
|
|
33
29
|
*/
|
|
34
|
-
|
|
30
|
+
const filterObject = (obj, predicate) => {
|
|
35
31
|
if ((0, _isNil.default)(obj) || !(0, _isObject.default)(obj)) {
|
|
36
32
|
return obj;
|
|
37
33
|
}
|
|
38
|
-
return Object.keys(obj).reduce(
|
|
39
|
-
|
|
34
|
+
return Object.keys(obj).reduce((result, key) => {
|
|
35
|
+
const value = obj[key];
|
|
40
36
|
if ((0, _isObject.default)(value)) {
|
|
41
37
|
// value is object, go deeper
|
|
42
|
-
|
|
38
|
+
const filteredValue = filterObject(value, predicate);
|
|
43
39
|
if ((0, _isEmptyObject.default)(filteredValue)) {
|
|
44
40
|
return result;
|
|
45
41
|
}
|
|
46
|
-
return
|
|
42
|
+
return {
|
|
43
|
+
...result,
|
|
44
|
+
[key]: filteredValue
|
|
45
|
+
};
|
|
47
46
|
}
|
|
48
47
|
// value is not an object, test predicate
|
|
49
48
|
if (predicate(value)) {
|
|
50
|
-
return
|
|
49
|
+
return {
|
|
50
|
+
...result,
|
|
51
|
+
[key]: value
|
|
52
|
+
};
|
|
51
53
|
}
|
|
52
54
|
return result;
|
|
53
55
|
}, {});
|
|
@@ -20,19 +20,20 @@ governing permissions and limitations under the License.
|
|
|
20
20
|
* @param {string} src
|
|
21
21
|
* @returns {Promise}
|
|
22
22
|
*/
|
|
23
|
-
var _default =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return new Promise(
|
|
28
|
-
|
|
29
|
-
src
|
|
23
|
+
var _default = ({
|
|
24
|
+
src,
|
|
25
|
+
currentDocument = document
|
|
26
|
+
}) => {
|
|
27
|
+
return new Promise((resolve, reject) => {
|
|
28
|
+
const attrs = {
|
|
29
|
+
src
|
|
30
30
|
};
|
|
31
|
-
|
|
31
|
+
const props = {
|
|
32
32
|
onload: resolve,
|
|
33
33
|
onerror: reject,
|
|
34
34
|
onabort: reject
|
|
35
35
|
};
|
|
36
36
|
(0, _createNode.default)(_tagName.IMG, attrs, props, [], currentDocument);
|
|
37
37
|
});
|
|
38
|
-
};
|
|
38
|
+
};
|
|
39
|
+
exports.default = _default;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.default = void 0;
|
|
4
|
-
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
5
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
7
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
8
|
-
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
9
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
10
4
|
/*
|
|
11
5
|
Copyright 2023 Adobe. All rights reserved.
|
|
12
6
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -18,15 +12,14 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
18
12
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
19
13
|
governing permissions and limitations under the License.
|
|
20
14
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var flat = [];
|
|
15
|
+
const flattenArray = (items = []) => {
|
|
16
|
+
const flat = [];
|
|
24
17
|
if (!Array.isArray(items)) {
|
|
25
18
|
return items;
|
|
26
19
|
}
|
|
27
|
-
items.forEach(
|
|
20
|
+
items.forEach(item => {
|
|
28
21
|
if (Array.isArray(item)) {
|
|
29
|
-
flat.push
|
|
22
|
+
flat.push(...flattenArray(item));
|
|
30
23
|
} else {
|
|
31
24
|
flat.push(item);
|
|
32
25
|
}
|