@adobe/alloy 2.30.1-beta.9 → 2.31.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/libEs5/components/Advertising/createComponent.js +7 -3
- package/libEs5/components/Advertising/handlers/onBeforeSendEventHandler.js +8 -2
- package/libEs5/components/Advertising/handlers/sendAdConversion.js +11 -6
- package/libEs5/components/Advertising/handlers/viewThroughHandler.js +8 -2
- package/libEs5/components/Advertising/identities/collectSurferId.js +8 -1
- package/libEs5/components/Advertising/index.js +2 -1
- package/libEs5/components/BrandConcierge/configValidators.js +25 -0
- package/libEs5/components/BrandConcierge/constants.js +16 -0
- package/libEs5/components/BrandConcierge/createBuildEndpointUrl.js +33 -0
- package/libEs5/components/BrandConcierge/createConversationServiceRequest.js +35 -0
- package/libEs5/components/BrandConcierge/createSendConversationEvent.js +148 -0
- package/libEs5/components/BrandConcierge/createSendConversationServiceRequest.js +85 -0
- package/libEs5/components/BrandConcierge/createStreamParser.js +131 -0
- package/libEs5/components/BrandConcierge/createTimeoutWrapper.js +79 -0
- package/libEs5/components/BrandConcierge/index.js +102 -0
- package/libEs5/components/BrandConcierge/utils.js +33 -0
- package/libEs5/components/BrandConcierge/validateMessage.js +44 -0
- package/libEs5/components/Consent/types.js +12 -0
- package/libEs5/components/Context/createComponent.js +1 -2
- package/libEs5/components/Context/implementationDetails.js +7 -9
- package/libEs5/components/Context/index.js +4 -1
- package/libEs5/components/Context/injectDevice.js +2 -2
- package/libEs5/components/Context/injectEnvironment.js +2 -2
- package/libEs5/components/Context/injectHighEntropyUserAgentHints.js +2 -2
- package/libEs5/components/Context/injectOneTimeAnalyticsReferrer.js +52 -0
- package/libEs5/components/Context/injectPlaceContext.js +2 -2
- package/libEs5/components/Context/injectTimestamp.js +2 -3
- package/libEs5/components/Context/injectWeb.js +9 -11
- package/libEs5/components/EventMerge/createEventMergeId.js +1 -1
- package/libEs5/components/Personalization/createComponent.js +3 -1
- package/libEs5/components/Personalization/createFetchDataHandler.js +10 -4
- package/libEs5/components/Personalization/createNotificationHandler.js +5 -3
- package/libEs5/components/Personalization/createOnDecisionHandler.js +4 -3
- package/libEs5/components/Personalization/createPersonalizationDetails.js +1 -1
- package/libEs5/components/Personalization/dom-actions/initDomActionsModules.js +1 -1
- package/libEs5/components/Personalization/dom-actions/remapHeadOffers.js +5 -0
- package/libEs5/components/Personalization/handlers/createProcessInAppMessage.js +2 -1
- package/libEs5/components/Personalization/handlers/createProcessRedirect.js +2 -1
- package/libEs5/components/Personalization/handlers/injectCreateProposition.js +4 -1
- package/libEs5/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +4 -2
- package/libEs5/components/Personalization/index.js +2 -2
- package/libEs5/components/PushNotifications/types.js +12 -0
- package/libEs5/components/RulesEngine/createApplyResponse.js +3 -1
- package/libEs5/components/RulesEngine/types.js +12 -0
- package/libEs5/components/StreamingMedia/createMediaEventManager.js +1 -1
- package/libEs5/constants/libraryVersion.js +1 -1
- package/libEs5/constants/surface.js +19 -0
- package/libEs5/core/componentCreators.js +8 -1
- package/libEs5/core/consent/types.js +12 -0
- package/libEs5/core/createEvent.js +7 -0
- package/libEs5/core/edgeNetwork/injectSendEdgeNetworkRequest.js +23 -0
- package/libEs5/core/edgeNetwork/types.js +12 -0
- package/libEs5/core/identity/types.js +12 -0
- package/libEs5/core/index.js +5 -1
- package/libEs5/core/types.js +12 -0
- package/libEs5/utils/clamp.js +25 -0
- package/libEs5/utils/createCollect.js +4 -2
- package/libEs5/utils/deepAssign.js +5 -0
- package/libEs5/utils/dom/createGetPageLocation.js +20 -0
- package/libEs5/utils/filterObject.js +1 -1
- package/libEs5/utils/index.js +8 -1
- package/libEs5/utils/prepareConfigOverridesForEdge.js +4 -2
- package/libEs5/utils/request/createDataCollectionRequestPayload.js +3 -0
- package/libEs5/utils/request/createRequest.js +5 -1
- package/libEs5/utils/request/createRequestParams.js +1 -0
- package/libEs5/utils/request/createRequestPayload.js +11 -1
- package/libEs5/utils/request/types.js +13 -0
- package/libEs5/utils/surfaceUtils.js +82 -0
- package/libEs5/utils/types.js +12 -0
- package/libEs6/components/Advertising/createComponent.js +7 -3
- package/libEs6/components/Advertising/handlers/onBeforeSendEventHandler.js +8 -2
- package/libEs6/components/Advertising/handlers/sendAdConversion.js +11 -6
- package/libEs6/components/Advertising/handlers/viewThroughHandler.js +8 -2
- package/libEs6/components/Advertising/identities/collectSurferId.js +8 -1
- package/libEs6/components/Advertising/index.js +2 -1
- package/libEs6/components/BrandConcierge/configValidators.js +22 -0
- package/libEs6/components/BrandConcierge/constants.js +13 -0
- package/libEs6/components/BrandConcierge/createBuildEndpointUrl.js +30 -0
- package/libEs6/components/BrandConcierge/createConversationServiceRequest.js +31 -0
- package/libEs6/components/BrandConcierge/createSendConversationEvent.js +144 -0
- package/libEs6/components/BrandConcierge/createSendConversationServiceRequest.js +81 -0
- package/libEs6/components/BrandConcierge/createStreamParser.js +127 -0
- package/libEs6/components/BrandConcierge/createTimeoutWrapper.js +76 -0
- package/libEs6/components/BrandConcierge/index.js +98 -0
- package/libEs6/components/BrandConcierge/utils.js +27 -0
- package/libEs6/components/BrandConcierge/validateMessage.js +40 -0
- package/libEs6/components/Consent/types.js +12 -0
- package/libEs6/components/Context/createComponent.js +1 -2
- package/libEs6/components/Context/implementationDetails.js +7 -9
- package/libEs6/components/Context/index.js +4 -1
- package/libEs6/components/Context/injectDevice.js +3 -3
- package/libEs6/components/Context/injectEnvironment.js +3 -3
- package/libEs6/components/Context/injectHighEntropyUserAgentHints.js +3 -3
- package/libEs6/components/Context/injectOneTimeAnalyticsReferrer.js +48 -0
- package/libEs6/components/Context/injectPlaceContext.js +3 -3
- package/libEs6/components/Context/injectTimestamp.js +2 -3
- package/libEs6/components/Context/injectWeb.js +9 -11
- package/libEs6/components/EventMerge/createEventMergeId.js +1 -1
- package/libEs6/components/Personalization/createComponent.js +3 -1
- package/libEs6/components/Personalization/createFetchDataHandler.js +10 -4
- package/libEs6/components/Personalization/createNotificationHandler.js +5 -3
- package/libEs6/components/Personalization/createOnDecisionHandler.js +4 -3
- package/libEs6/components/Personalization/createPersonalizationDetails.js +1 -1
- package/libEs6/components/Personalization/dom-actions/initDomActionsModules.js +1 -1
- package/libEs6/components/Personalization/dom-actions/remapHeadOffers.js +6 -1
- package/libEs6/components/Personalization/handlers/createProcessInAppMessage.js +2 -1
- package/libEs6/components/Personalization/handlers/createProcessRedirect.js +2 -1
- package/libEs6/components/Personalization/handlers/injectCreateProposition.js +4 -1
- package/libEs6/components/Personalization/in-app-message-actions/actions/displayIframeContent.js +4 -2
- package/libEs6/components/Personalization/index.js +2 -2
- package/libEs6/components/PushNotifications/types.js +12 -0
- package/libEs6/components/RulesEngine/createApplyResponse.js +3 -1
- package/libEs6/components/RulesEngine/types.js +12 -0
- package/libEs6/components/StreamingMedia/createMediaEventManager.js +1 -1
- package/libEs6/constants/libraryVersion.js +1 -1
- package/libEs6/constants/surface.js +16 -0
- package/libEs6/core/componentCreators.js +2 -1
- package/libEs6/core/consent/types.js +12 -0
- package/libEs6/core/createEvent.js +7 -0
- package/libEs6/core/edgeNetwork/injectSendEdgeNetworkRequest.js +23 -0
- package/libEs6/core/edgeNetwork/types.js +12 -0
- package/libEs6/core/identity/types.js +12 -0
- package/libEs6/core/index.js +5 -1
- package/libEs6/core/types.js +12 -0
- package/libEs6/utils/clamp.js +22 -0
- package/libEs6/utils/createCollect.js +4 -2
- package/libEs6/utils/deepAssign.js +6 -0
- package/libEs6/utils/dom/createGetPageLocation.js +17 -0
- package/libEs6/utils/filterObject.js +1 -1
- package/libEs6/utils/index.js +2 -1
- package/libEs6/utils/prepareConfigOverridesForEdge.js +4 -2
- package/libEs6/utils/request/createDataCollectionRequestPayload.js +3 -0
- package/libEs6/utils/request/createRequest.js +5 -1
- package/libEs6/utils/request/createRequestParams.js +1 -0
- package/libEs6/utils/request/createRequestPayload.js +11 -1
- package/libEs6/utils/request/types.js +13 -0
- package/libEs6/utils/surfaceUtils.js +76 -0
- package/libEs6/utils/types.js +12 -0
- package/package.json +32 -36
- package/scripts/helpers/path.js +12 -0
- package/scripts/helpers/versionBabelPlugin.js +12 -0
- package/types/components/Advertising/createComponent.d.ts +3 -2
- package/types/components/Advertising/createComponent.d.ts.map +1 -1
- package/types/components/Advertising/handlers/onBeforeSendEventHandler.d.ts.map +1 -1
- package/types/components/Advertising/handlers/sendAdConversion.d.ts +2 -1
- package/types/components/Advertising/handlers/sendAdConversion.d.ts.map +1 -1
- package/types/components/Advertising/handlers/viewThroughHandler.d.ts.map +1 -1
- package/types/components/Advertising/identities/collectSurferId.d.ts.map +1 -1
- package/types/components/Advertising/index.d.ts +1 -1
- package/types/components/Advertising/index.d.ts.map +1 -1
- package/types/components/BrandConcierge/configValidators.d.ts +3 -0
- package/types/components/BrandConcierge/configValidators.d.ts.map +1 -0
- package/types/components/BrandConcierge/constants.d.ts +3 -0
- package/types/components/BrandConcierge/constants.d.ts.map +1 -0
- package/types/components/BrandConcierge/createBuildEndpointUrl.d.ts +9 -0
- package/types/components/BrandConcierge/createBuildEndpointUrl.d.ts.map +1 -0
- package/types/components/BrandConcierge/createConversationServiceRequest.d.ts +7 -0
- package/types/components/BrandConcierge/createConversationServiceRequest.d.ts.map +1 -0
- package/types/components/BrandConcierge/createSendConversationEvent.d.ts +15 -0
- package/types/components/BrandConcierge/createSendConversationEvent.d.ts.map +1 -0
- package/types/components/BrandConcierge/createSendConversationServiceRequest.d.ts +11 -0
- package/types/components/BrandConcierge/createSendConversationServiceRequest.d.ts.map +1 -0
- package/types/components/BrandConcierge/createStreamParser.d.ts +7 -0
- package/types/components/BrandConcierge/createStreamParser.d.ts.map +1 -0
- package/types/components/BrandConcierge/createTimeoutWrapper.d.ts +6 -0
- package/types/components/BrandConcierge/createTimeoutWrapper.d.ts.map +1 -0
- package/types/components/BrandConcierge/index.d.ts +32 -0
- package/types/components/BrandConcierge/index.d.ts.map +1 -0
- package/types/components/BrandConcierge/utils.d.ts +6 -0
- package/types/components/BrandConcierge/utils.d.ts.map +1 -0
- package/types/components/BrandConcierge/validateMessage.d.ts +5 -0
- package/types/components/BrandConcierge/validateMessage.d.ts.map +1 -0
- package/types/components/Consent/types.d.ts.map +1 -1
- package/types/components/Context/createComponent.d.ts +1 -1
- package/types/components/Context/createComponent.d.ts.map +1 -1
- package/types/components/Context/implementationDetails.d.ts +1 -1
- package/types/components/Context/implementationDetails.d.ts.map +1 -1
- package/types/components/Context/index.d.ts +1 -1
- package/types/components/Context/index.d.ts.map +1 -1
- package/types/components/Context/injectDevice.d.ts +1 -1
- package/types/components/Context/injectDevice.d.ts.map +1 -1
- package/types/components/Context/injectEnvironment.d.ts +1 -1
- package/types/components/Context/injectEnvironment.d.ts.map +1 -1
- package/types/components/Context/injectHighEntropyUserAgentHints.d.ts +1 -1
- package/types/components/Context/injectHighEntropyUserAgentHints.d.ts.map +1 -1
- package/types/components/Context/injectOneTimeAnalyticsReferrer.d.ts +3 -0
- package/types/components/Context/injectOneTimeAnalyticsReferrer.d.ts.map +1 -0
- package/types/components/Context/injectPlaceContext.d.ts +1 -1
- package/types/components/Context/injectPlaceContext.d.ts.map +1 -1
- package/types/components/Context/injectTimestamp.d.ts +1 -1
- package/types/components/Context/injectTimestamp.d.ts.map +1 -1
- package/types/components/Context/injectWeb.d.ts +1 -1
- package/types/components/Context/injectWeb.d.ts.map +1 -1
- package/types/components/Personalization/createComponent.d.ts.map +1 -1
- package/types/components/Personalization/createFetchDataHandler.d.ts +2 -1
- package/types/components/Personalization/createFetchDataHandler.d.ts.map +1 -1
- package/types/components/Personalization/createNotificationHandler.d.ts +1 -1
- package/types/components/Personalization/createNotificationHandler.d.ts.map +1 -1
- package/types/components/Personalization/createOnDecisionHandler.d.ts +2 -1
- package/types/components/Personalization/createOnDecisionHandler.d.ts.map +1 -1
- package/types/components/Personalization/createPersonalizationDetails.d.ts.map +1 -1
- package/types/components/Personalization/dom-actions/remapHeadOffers.d.ts.map +1 -1
- package/types/components/Personalization/handlers/createProcessInAppMessage.d.ts.map +1 -1
- package/types/components/Personalization/handlers/createProcessRedirect.d.ts.map +1 -1
- package/types/components/Personalization/handlers/injectCreateProposition.d.ts +2 -1
- package/types/components/Personalization/handlers/injectCreateProposition.d.ts.map +1 -1
- package/types/components/Personalization/in-app-message-actions/actions/displayIframeContent.d.ts.map +1 -1
- package/types/components/Personalization/index.d.ts.map +1 -1
- package/types/components/PushNotifications/types.d.ts.map +1 -1
- package/types/components/RulesEngine/createApplyResponse.d.ts.map +1 -1
- package/types/components/RulesEngine/index.d.ts.map +1 -1
- package/types/components/RulesEngine/types.d.ts.map +1 -1
- package/types/constants/surface.d.ts +5 -0
- package/types/constants/surface.d.ts.map +1 -0
- package/types/core/componentCreators.d.ts +1 -0
- package/types/core/consent/types.d.ts.map +1 -1
- package/types/core/createEvent.d.ts +2 -0
- package/types/core/createEvent.d.ts.map +1 -1
- package/types/core/edgeNetwork/injectSendEdgeNetworkRequest.d.ts.map +1 -1
- package/types/core/edgeNetwork/types.d.ts.map +1 -1
- package/types/core/identity/types.d.ts.map +1 -1
- package/types/core/index.d.ts.map +1 -1
- package/types/core/types.d.ts.map +1 -1
- package/types/utils/clamp.d.ts +3 -0
- package/types/utils/clamp.d.ts.map +1 -0
- package/types/utils/createCollect.d.ts +2 -1
- package/types/utils/createCollect.d.ts.map +1 -1
- package/types/utils/deepAssign.d.ts.map +1 -1
- package/types/utils/dom/createGetPageLocation.d.ts +5 -0
- package/types/utils/dom/createGetPageLocation.d.ts.map +1 -0
- package/types/utils/index.d.ts +1 -0
- package/types/utils/prepareConfigOverridesForEdge.d.ts.map +1 -1
- package/types/utils/request/createDataCollectionRequestPayload.d.ts.map +1 -1
- package/types/utils/request/createRequest.d.ts.map +1 -1
- package/types/utils/request/createRequestParams.d.ts.map +1 -1
- package/types/utils/request/createRequestPayload.d.ts.map +1 -1
- package/types/utils/request/types.d.ts +2 -0
- package/types/utils/request/types.d.ts.map +1 -1
- package/types/utils/surfaceUtils.d.ts +4 -0
- package/types/utils/surfaceUtils.d.ts.map +1 -0
- package/types/utils/types.d.ts.map +1 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2024 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import validateMessage from "./validateMessage.js";
|
|
13
|
+
import createSendConversationEvent from "./createSendConversationEvent.js";
|
|
14
|
+
import createBuildEndpointUrl from "./createBuildEndpointUrl.js";
|
|
15
|
+
import queryString from "@adobe/reactor-query-string";
|
|
16
|
+
import { getNamespacedCookieName } from "../../utils/index.js";
|
|
17
|
+
import { BC_SESSION_COOKIE_NAME } from "./constants.js";
|
|
18
|
+
import createGetEcidFromCookie from "../../utils/createDecodeKndctrCookie.js";
|
|
19
|
+
import createSendConversationServiceRequest from "./createSendConversationServiceRequest.js";
|
|
20
|
+
import configValidators from "./configValidators.js";
|
|
21
|
+
const createConciergeComponent = ({
|
|
22
|
+
loggingCookieJar,
|
|
23
|
+
logger,
|
|
24
|
+
eventManager,
|
|
25
|
+
consent,
|
|
26
|
+
instanceName,
|
|
27
|
+
sendEdgeNetworkRequest,
|
|
28
|
+
config,
|
|
29
|
+
lifecycle,
|
|
30
|
+
cookieTransfer,
|
|
31
|
+
createResponse,
|
|
32
|
+
apexDomain
|
|
33
|
+
}) => {
|
|
34
|
+
const {
|
|
35
|
+
fetch
|
|
36
|
+
} = window;
|
|
37
|
+
if (!config.conversation.stickyConversationSession) {
|
|
38
|
+
loggingCookieJar.remove(getNamespacedCookieName(config.orgId, BC_SESSION_COOKIE_NAME), {
|
|
39
|
+
domain: apexDomain
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
const buildEndpointUrl = createBuildEndpointUrl({
|
|
43
|
+
queryString
|
|
44
|
+
});
|
|
45
|
+
const sendConversationServiceRequest = createSendConversationServiceRequest({
|
|
46
|
+
logger,
|
|
47
|
+
fetch,
|
|
48
|
+
config
|
|
49
|
+
});
|
|
50
|
+
const decodeKndctrCookie = createGetEcidFromCookie({
|
|
51
|
+
orgId: config.orgId,
|
|
52
|
+
cookieJar: loggingCookieJar,
|
|
53
|
+
logger
|
|
54
|
+
});
|
|
55
|
+
const sendConversationEvent = createSendConversationEvent({
|
|
56
|
+
loggingCookieJar,
|
|
57
|
+
logger,
|
|
58
|
+
eventManager,
|
|
59
|
+
consent,
|
|
60
|
+
instanceName,
|
|
61
|
+
sendEdgeNetworkRequest,
|
|
62
|
+
config,
|
|
63
|
+
buildEndpointUrl,
|
|
64
|
+
lifecycle,
|
|
65
|
+
cookieTransfer,
|
|
66
|
+
createResponse,
|
|
67
|
+
sendConversationServiceRequest,
|
|
68
|
+
decodeKndctrCookie
|
|
69
|
+
});
|
|
70
|
+
return {
|
|
71
|
+
lifecycle: {
|
|
72
|
+
onBeforeEvent({
|
|
73
|
+
event
|
|
74
|
+
}) {
|
|
75
|
+
const parsedParams = queryString.parse(window.location.search);
|
|
76
|
+
if (parsedParams.source) {
|
|
77
|
+
const source = parsedParams.source;
|
|
78
|
+
event.mergeXdm({
|
|
79
|
+
channel: {
|
|
80
|
+
referringSource: source
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
commands: {
|
|
87
|
+
sendConversationEvent: {
|
|
88
|
+
optionsValidator: options => validateMessage({
|
|
89
|
+
options
|
|
90
|
+
}),
|
|
91
|
+
run: sendConversationEvent
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
createConciergeComponent.namespace = "BrandConcierge";
|
|
97
|
+
createConciergeComponent.configValidators = configValidators;
|
|
98
|
+
export default createConciergeComponent;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2025 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { getNamespacedCookieName, createGetPageLocation } from "../../utils/index.js";
|
|
13
|
+
import { buildPageSurface } from "../../utils/surfaceUtils.js";
|
|
14
|
+
import { BC_SESSION_COOKIE_NAME } from "./constants.js";
|
|
15
|
+
export const getPageSurface = () => {
|
|
16
|
+
const pageLocation = createGetPageLocation({
|
|
17
|
+
window: window
|
|
18
|
+
});
|
|
19
|
+
return buildPageSurface(pageLocation);
|
|
20
|
+
};
|
|
21
|
+
export const getConciergeSessionCookie = ({
|
|
22
|
+
loggingCookieJar,
|
|
23
|
+
config
|
|
24
|
+
}) => {
|
|
25
|
+
const cookieName = getNamespacedCookieName(config.orgId, BC_SESSION_COOKIE_NAME);
|
|
26
|
+
return loggingCookieJar.get(cookieName);
|
|
27
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2025 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { anyOf, arrayOf, objectOf, string, callback } from "../../utils/validation/index.js";
|
|
13
|
+
import { noop } from "../../utils/index.js";
|
|
14
|
+
export default ({
|
|
15
|
+
options
|
|
16
|
+
}) => {
|
|
17
|
+
const brandConciergeEventValidator = anyOf([objectOf({
|
|
18
|
+
message: string().required(),
|
|
19
|
+
onStreamResponse: callback().default(noop)
|
|
20
|
+
}), objectOf({
|
|
21
|
+
xdm: objectOf({
|
|
22
|
+
interactionId: string(),
|
|
23
|
+
conversationId: string(),
|
|
24
|
+
conversation: objectOf({
|
|
25
|
+
feedback: objectOf({
|
|
26
|
+
classification: string(),
|
|
27
|
+
comment: string(),
|
|
28
|
+
reasons: arrayOf(string())
|
|
29
|
+
})
|
|
30
|
+
})
|
|
31
|
+
})
|
|
32
|
+
}).required(), objectOf({
|
|
33
|
+
data: objectOf({
|
|
34
|
+
type: string().required(),
|
|
35
|
+
payload: objectOf({})
|
|
36
|
+
}).required(),
|
|
37
|
+
onStreamResponse: callback().default(noop)
|
|
38
|
+
})]);
|
|
39
|
+
return brandConciergeEventValidator(options);
|
|
40
|
+
};
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2025 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
1
13
|
/**
|
|
2
14
|
* Request payload object with methods for merging different types of data.
|
|
3
15
|
*
|
|
@@ -24,8 +24,7 @@ export default (config, logger, optionalContexts, requiredContexts) => {
|
|
|
24
24
|
onBeforeEvent({
|
|
25
25
|
event
|
|
26
26
|
}) {
|
|
27
|
-
|
|
28
|
-
return Promise.all(contexts.map(context => Promise.resolve(context(xdm, logger)))).then(() => event.mergeXdm(xdm));
|
|
27
|
+
return Promise.all(contexts.map(context => Promise.resolve(context(event, logger))));
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
30
|
};
|
|
@@ -9,16 +9,14 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import { deepAssign } from "../../utils/index.js";
|
|
13
12
|
import libraryName from "../../constants/libraryName.js";
|
|
14
13
|
import libraryVersion from "../../constants/libraryVersion.js";
|
|
15
|
-
export default
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
implementationDetails
|
|
14
|
+
export default event => {
|
|
15
|
+
event.mergeXdm({
|
|
16
|
+
implementationDetails: {
|
|
17
|
+
name: libraryName,
|
|
18
|
+
version: libraryVersion,
|
|
19
|
+
environment: "browser"
|
|
20
|
+
}
|
|
23
21
|
});
|
|
24
22
|
};
|
|
@@ -18,6 +18,7 @@ import injectTimestamp from "./injectTimestamp.js";
|
|
|
18
18
|
import implementationDetails from "./implementationDetails.js";
|
|
19
19
|
import createComponent from "./createComponent.js";
|
|
20
20
|
import injectHighEntropyUserAgentHints from "./injectHighEntropyUserAgentHints.js";
|
|
21
|
+
import injectOneTimeAnalyticsReferrer from "./injectOneTimeAnalyticsReferrer.js";
|
|
21
22
|
import { arrayOf, objectOf, string } from "../../utils/validation/index.js";
|
|
22
23
|
const web = injectWeb(window);
|
|
23
24
|
const device = injectDevice(window);
|
|
@@ -25,6 +26,7 @@ const environment = injectEnvironment(window);
|
|
|
25
26
|
const placeContext = injectPlaceContext(() => new Date());
|
|
26
27
|
const timestamp = injectTimestamp(() => new Date());
|
|
27
28
|
const highEntropyUserAgentHints = injectHighEntropyUserAgentHints(navigator);
|
|
29
|
+
const oneTimeAnalyticsReferrer = injectOneTimeAnalyticsReferrer(window);
|
|
28
30
|
const defaultEnabledContexts = {
|
|
29
31
|
web,
|
|
30
32
|
device,
|
|
@@ -32,7 +34,8 @@ const defaultEnabledContexts = {
|
|
|
32
34
|
placeContext
|
|
33
35
|
};
|
|
34
36
|
const defaultDisabledContexts = {
|
|
35
|
-
highEntropyUserAgentHints
|
|
37
|
+
highEntropyUserAgentHints,
|
|
38
|
+
oneTimeAnalyticsReferrer
|
|
36
39
|
};
|
|
37
40
|
const optionalContexts = {
|
|
38
41
|
...defaultEnabledContexts,
|
|
@@ -10,7 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { isFunction, toInteger } from "../../utils/index.js";
|
|
14
14
|
const getScreenOrientationViaProperty = window => {
|
|
15
15
|
const {
|
|
16
16
|
screen: {
|
|
@@ -41,7 +41,7 @@ const getScreenOrientationViaMediaQuery = window => {
|
|
|
41
41
|
return null;
|
|
42
42
|
};
|
|
43
43
|
export default window => {
|
|
44
|
-
return
|
|
44
|
+
return event => {
|
|
45
45
|
const {
|
|
46
46
|
screen: {
|
|
47
47
|
width,
|
|
@@ -62,7 +62,7 @@ export default window => {
|
|
|
62
62
|
device.screenOrientation = orientation;
|
|
63
63
|
}
|
|
64
64
|
if (Object.keys(device).length > 0) {
|
|
65
|
-
|
|
65
|
+
event.mergeXdm({
|
|
66
66
|
device
|
|
67
67
|
});
|
|
68
68
|
}
|
|
@@ -10,9 +10,9 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { toInteger } from "../../utils/index.js";
|
|
14
14
|
export default window => {
|
|
15
|
-
return
|
|
15
|
+
return event => {
|
|
16
16
|
const {
|
|
17
17
|
document: {
|
|
18
18
|
documentElement: {
|
|
@@ -35,7 +35,7 @@ export default window => {
|
|
|
35
35
|
environment.browserDetails = environment.browserDetails || {};
|
|
36
36
|
environment.browserDetails.viewportHeight = viewportHeight;
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
event.mergeXdm({
|
|
39
39
|
environment
|
|
40
40
|
});
|
|
41
41
|
};
|
|
@@ -10,7 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { noop } from "../../utils/index.js";
|
|
14
14
|
import highEntropyUserAgentHints from "../../constants/highEntropyUserAgentClientHints.js";
|
|
15
15
|
const browserSupportsUserAgentClientHints = navigator => {
|
|
16
16
|
return "userAgentData" in navigator;
|
|
@@ -19,7 +19,7 @@ export default navigator => {
|
|
|
19
19
|
if (!browserSupportsUserAgentClientHints(navigator)) {
|
|
20
20
|
return noop;
|
|
21
21
|
}
|
|
22
|
-
return (
|
|
22
|
+
return (event, logger) => {
|
|
23
23
|
try {
|
|
24
24
|
// eslint-disable-next-line compat/compat -- userAgentData support is checked before calling
|
|
25
25
|
return navigator.userAgentData.getHighEntropyValues(highEntropyUserAgentHints.map(hint => hint[0])).then(hints => {
|
|
@@ -30,7 +30,7 @@ export default navigator => {
|
|
|
30
30
|
userAgentClientHints[hintName] = hints[hintName];
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
|
-
|
|
33
|
+
event.mergeXdm({
|
|
34
34
|
environment: {
|
|
35
35
|
browserDetails: {
|
|
36
36
|
userAgentClientHints
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2025 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Because these events are originated by the SDK rather than user actions, don't change the referrer
|
|
14
|
+
const IGNORED_EVENT_TYPES = new Set(["decisioning.propositionFetch", "decisioning.propositionDisplay", "decisioning.propositionInteract"]);
|
|
15
|
+
export default window => {
|
|
16
|
+
let lastReferrerSent = null;
|
|
17
|
+
return event => {
|
|
18
|
+
const content = event.getContent();
|
|
19
|
+
const eventType = content.xdm?.eventType;
|
|
20
|
+
if (IGNORED_EVENT_TYPES.has(eventType)) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Allow customers to explicitly set the referrer (for SPA view changes)
|
|
25
|
+
// Otherwise, use document.referrer
|
|
26
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
27
|
+
const explicitReferrer = content.data?.__adobe?.analytics?.referrer;
|
|
28
|
+
const currentReferrer = explicitReferrer !== undefined ? explicitReferrer : window.document.referrer;
|
|
29
|
+
if (currentReferrer === lastReferrerSent) {
|
|
30
|
+
event.mergeData({
|
|
31
|
+
__adobe: {
|
|
32
|
+
analytics: {
|
|
33
|
+
referrer: ""
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
event.mergeData({
|
|
40
|
+
__adobe: {
|
|
41
|
+
analytics: {
|
|
42
|
+
referrer: currentReferrer
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
lastReferrerSent = currentReferrer;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -9,9 +9,9 @@ the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTA
|
|
|
9
9
|
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
12
|
+
import { toISOStringLocal, toInteger } from "../../utils/index.js";
|
|
13
13
|
export default dateProvider => {
|
|
14
|
-
return
|
|
14
|
+
return event => {
|
|
15
15
|
const date = dateProvider();
|
|
16
16
|
const placeContext = {};
|
|
17
17
|
const localTimezoneOffset = toInteger(date.getTimezoneOffset());
|
|
@@ -22,7 +22,7 @@ export default dateProvider => {
|
|
|
22
22
|
if (localTimezoneOffset === undefined || Math.abs(localTimezoneOffset) < 6000) {
|
|
23
23
|
placeContext.localTime = toISOStringLocal(date);
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
event.mergeXdm({
|
|
26
26
|
placeContext
|
|
27
27
|
});
|
|
28
28
|
};
|
|
@@ -10,11 +10,10 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { deepAssign } from "../../utils/index.js";
|
|
14
13
|
export default dateProvider => {
|
|
15
|
-
return
|
|
14
|
+
return event => {
|
|
16
15
|
const timestamp = dateProvider().toISOString();
|
|
17
|
-
|
|
16
|
+
event.mergeXdm({
|
|
18
17
|
timestamp
|
|
19
18
|
});
|
|
20
19
|
};
|
|
@@ -10,19 +10,17 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { deepAssign } from "../../utils/index.js";
|
|
14
13
|
export default window => {
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
return event => {
|
|
15
|
+
event.mergeXdm({
|
|
16
|
+
web: {
|
|
17
|
+
webPageDetails: {
|
|
18
|
+
URL: window.location.href || window.location
|
|
19
|
+
},
|
|
20
|
+
webReferrer: {
|
|
21
|
+
URL: window.document.referrer
|
|
22
|
+
}
|
|
22
23
|
}
|
|
23
|
-
};
|
|
24
|
-
deepAssign(xdm, {
|
|
25
|
-
web
|
|
26
24
|
});
|
|
27
25
|
};
|
|
28
26
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright
|
|
2
|
+
Copyright 2025 Adobe. All rights reserved.
|
|
3
3
|
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
5
|
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
@@ -82,11 +82,13 @@ export default ({
|
|
|
82
82
|
if (personalizationDetails.shouldFetchData()) {
|
|
83
83
|
const cacheUpdate = viewCache.createCacheUpdate(personalizationDetails.getViewName());
|
|
84
84
|
onRequestFailure(() => cacheUpdate.cancel());
|
|
85
|
+
const identityMap = event.getUserIdentityMap();
|
|
85
86
|
fetchDataHandler({
|
|
86
87
|
cacheUpdate,
|
|
87
88
|
personalizationDetails,
|
|
88
89
|
event,
|
|
89
|
-
onResponse
|
|
90
|
+
onResponse,
|
|
91
|
+
identityMap
|
|
90
92
|
});
|
|
91
93
|
} else if (personalizationDetails.shouldUseCachedData()) {
|
|
92
94
|
decisionsMetaPromises.push(viewChangeHandler({
|
|
@@ -11,6 +11,7 @@ governing permissions and limitations under the License.
|
|
|
11
11
|
*/
|
|
12
12
|
import { groupBy, isNonEmptyArray } from "../../utils/index.js";
|
|
13
13
|
import PAGE_WIDE_SCOPE from "../../constants/pageWideScope.js";
|
|
14
|
+
import { REDIRECT_ITEM } from "../../constants/schema.js";
|
|
14
15
|
const DECISIONS_HANDLE = "personalization:decisions";
|
|
15
16
|
export default ({
|
|
16
17
|
logger,
|
|
@@ -27,7 +28,8 @@ export default ({
|
|
|
27
28
|
cacheUpdate,
|
|
28
29
|
personalizationDetails,
|
|
29
30
|
event,
|
|
30
|
-
onResponse
|
|
31
|
+
onResponse,
|
|
32
|
+
identityMap
|
|
31
33
|
}) => {
|
|
32
34
|
const {
|
|
33
35
|
state,
|
|
@@ -44,7 +46,7 @@ export default ({
|
|
|
44
46
|
|
|
45
47
|
// This needs to be called before the response so that future sendEvent calls
|
|
46
48
|
// can know to wait until this request is complete for pending display notifications.
|
|
47
|
-
const handleNotifications = notificationHandler(personalizationDetails.isRenderDecisions(), personalizationDetails.isSendDisplayEvent(), personalizationDetails.getViewName());
|
|
49
|
+
const handleNotifications = notificationHandler(personalizationDetails.isRenderDecisions(), personalizationDetails.isSendDisplayEvent(), personalizationDetails.getViewName(), identityMap);
|
|
48
50
|
onResponse(({
|
|
49
51
|
response
|
|
50
52
|
}) => {
|
|
@@ -59,7 +61,7 @@ export default ({
|
|
|
59
61
|
}
|
|
60
62
|
});
|
|
61
63
|
}
|
|
62
|
-
const propositions = handles.map(handle => createProposition(handle));
|
|
64
|
+
const propositions = handles.map(handle => createProposition(handle, true, false, identityMap));
|
|
63
65
|
const {
|
|
64
66
|
page: pagePropositions = [],
|
|
65
67
|
view: viewPropositions = [],
|
|
@@ -102,7 +104,11 @@ export default ({
|
|
|
102
104
|
// Render could take a long time especially if one of the renders
|
|
103
105
|
// is waiting for html to appear on the page. We show the containers
|
|
104
106
|
// immediately, and whatever renders quickly will not have flicker.
|
|
105
|
-
|
|
107
|
+
// However, skip showing containers if there's only one page proposition with a single REDIRECT_ITEM
|
|
108
|
+
const shouldSkipShowContainers = pagePropositions.length === 1 && pagePropositions[0].getItems().every(p => p.getSchema() === REDIRECT_ITEM);
|
|
109
|
+
if (!shouldSkipShowContainers) {
|
|
110
|
+
showContainers();
|
|
111
|
+
}
|
|
106
112
|
} else {
|
|
107
113
|
({
|
|
108
114
|
returnedPropositions,
|
|
@@ -13,7 +13,7 @@ import { defer } from "../../utils/index.js";
|
|
|
13
13
|
import { SUPPRESS } from "../../constants/eventType.js";
|
|
14
14
|
import isNonEmptyArray from "../../utils/isNonEmptyArray.js";
|
|
15
15
|
export default (collect, renderedPropositions) => {
|
|
16
|
-
return (isRenderDecisions, isSendDisplayEvent, viewName) => {
|
|
16
|
+
return (isRenderDecisions, isSendDisplayEvent, viewName, identityMap) => {
|
|
17
17
|
if (!isRenderDecisions) {
|
|
18
18
|
// If we aren't rendering anything, then we don't need to sendDisplayEvents.
|
|
19
19
|
return () => undefined;
|
|
@@ -27,7 +27,8 @@ export default (collect, renderedPropositions) => {
|
|
|
27
27
|
if (isNonEmptyArray(decisionsMetaDisplay)) {
|
|
28
28
|
collect({
|
|
29
29
|
decisionsMeta: decisionsMetaDisplay,
|
|
30
|
-
viewName
|
|
30
|
+
viewName,
|
|
31
|
+
identityMap
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
if (isNonEmptyArray(decisionsMetaSuppressed)) {
|
|
@@ -37,7 +38,8 @@ export default (collect, renderedPropositions) => {
|
|
|
37
38
|
propositionAction: {
|
|
38
39
|
reason: "Conflict"
|
|
39
40
|
},
|
|
40
|
-
viewName
|
|
41
|
+
viewName,
|
|
42
|
+
identityMap
|
|
41
43
|
});
|
|
42
44
|
}
|
|
43
45
|
};
|
|
@@ -38,7 +38,8 @@ export default ({
|
|
|
38
38
|
renderDecisions,
|
|
39
39
|
propositions,
|
|
40
40
|
event,
|
|
41
|
-
personalization = {}
|
|
41
|
+
personalization = {},
|
|
42
|
+
identityMap
|
|
42
43
|
}) => {
|
|
43
44
|
if (!renderDecisions) {
|
|
44
45
|
return Promise.resolve();
|
|
@@ -48,12 +49,12 @@ export default ({
|
|
|
48
49
|
} = personalization;
|
|
49
50
|
const viewName = event ? event.getViewName() : undefined;
|
|
50
51
|
const shouldSuppressDisplay = createShouldSuppressDisplay();
|
|
51
|
-
const propositionsToExecute = propositions.map(proposition => createProposition(proposition, true, shouldSuppressDisplay(proposition)));
|
|
52
|
+
const propositionsToExecute = propositions.map(proposition => createProposition(proposition, true, shouldSuppressDisplay(proposition), identityMap));
|
|
52
53
|
const {
|
|
53
54
|
render,
|
|
54
55
|
returnedPropositions
|
|
55
56
|
} = processPropositions(propositionsToExecute);
|
|
56
|
-
const handleNotifications = notificationHandler(renderDecisions, sendDisplayEvent, viewName);
|
|
57
|
+
const handleNotifications = notificationHandler(renderDecisions, sendDisplayEvent, viewName, identityMap);
|
|
57
58
|
const propositionsById = propositionsToExecute.reduce((tot, proposition) => {
|
|
58
59
|
tot[proposition.getId()] = proposition;
|
|
59
60
|
return tot;
|
|
@@ -11,9 +11,9 @@ governing permissions and limitations under the License.
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { isNonEmptyString, isNonEmptyArray } from "../../utils/index.js";
|
|
14
|
-
import { buildPageSurface, normalizeSurfaces } from "./utils/surfaceUtils.js";
|
|
15
14
|
import PAGE_WIDE_SCOPE from "../../constants/pageWideScope.js";
|
|
16
15
|
import { DEFAULT_CONTENT_ITEM, DOM_ACTION, HTML_CONTENT_ITEM, MESSAGE_IN_APP, JSON_CONTENT_ITEM, REDIRECT_ITEM, RULESET_ITEM, MESSAGE_CONTENT_CARD } from "../../constants/schema.js";
|
|
16
|
+
import { buildPageSurface, normalizeSurfaces } from "../../utils/surfaceUtils.js";
|
|
17
17
|
const addPageWideScope = scopes => {
|
|
18
18
|
if (!scopes.includes(PAGE_WIDE_SCOPE)) {
|
|
19
19
|
scopes.push(PAGE_WIDE_SCOPE);
|
|
@@ -46,7 +46,7 @@ export const DOM_ACTION_COLLECT_INTERACTIONS = "collectInteractions";
|
|
|
46
46
|
export default () => {
|
|
47
47
|
return {
|
|
48
48
|
[DOM_ACTION_SET_HTML]: createAction(setHtml, true),
|
|
49
|
-
[DOM_ACTION_CUSTOM_CODE]: createAction(prependHtml),
|
|
49
|
+
[DOM_ACTION_CUSTOM_CODE]: createAction(prependHtml, true),
|
|
50
50
|
[DOM_ACTION_SET_TEXT]: createAction(setText, true),
|
|
51
51
|
[DOM_ACTION_SET_ATTRIBUTE]: createAction(setAttributes, true),
|
|
52
52
|
[DOM_ACTION_SET_IMAGE_SOURCE]: createAction(swapImage, true),
|
|
@@ -21,7 +21,7 @@ import { is } from "./scripts.js";
|
|
|
21
21
|
import { createFragment, selectNodesWithEq } from "./dom/index.js";
|
|
22
22
|
import isBlankString from "../../../utils/isBlankString.js";
|
|
23
23
|
import { HEAD } from "../../../constants/tagName.js";
|
|
24
|
-
import { DOM_ACTION_APPEND_HTML } from "./initDomActionsModules.js";
|
|
24
|
+
import { DOM_ACTION_APPEND_HTML, DOM_ACTION_CUSTOM_CODE } from "./initDomActionsModules.js";
|
|
25
25
|
const HEAD_TAGS_SELECTOR = "SCRIPT,LINK,STYLE";
|
|
26
26
|
const filterHeadContent = content => {
|
|
27
27
|
const container = createFragment(content);
|
|
@@ -36,6 +36,11 @@ export default action => {
|
|
|
36
36
|
content,
|
|
37
37
|
selector
|
|
38
38
|
} = result;
|
|
39
|
+
|
|
40
|
+
// Custom code actions have a "HEAD" selector, but are handled differently.
|
|
41
|
+
if (result.type === DOM_ACTION_CUSTOM_CODE) {
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
39
44
|
if (isBlankString(content)) {
|
|
40
45
|
return result;
|
|
41
46
|
}
|
|
@@ -27,7 +27,8 @@ export default ({
|
|
|
27
27
|
hideElements(REDIRECT_HIDING_ELEMENT);
|
|
28
28
|
return collect({
|
|
29
29
|
decisionsMeta: [item.getProposition().getNotification()],
|
|
30
|
-
documentMayUnload: true
|
|
30
|
+
documentMayUnload: true,
|
|
31
|
+
identityMap: item.getProposition().getIdentityMap()
|
|
31
32
|
}).then(() => {
|
|
32
33
|
logger.logOnContentRendering({
|
|
33
34
|
status: "rendering-redirect",
|
|
@@ -57,7 +57,7 @@ export default ({
|
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
|
-
return (payload, visibleInReturnedItems = true, shouldSuppressDisplay = false) => {
|
|
60
|
+
return (payload, visibleInReturnedItems = true, shouldSuppressDisplay = false, identityMap = undefined) => {
|
|
61
61
|
const {
|
|
62
62
|
id,
|
|
63
63
|
scope,
|
|
@@ -95,6 +95,9 @@ export default ({
|
|
|
95
95
|
getId() {
|
|
96
96
|
return id;
|
|
97
97
|
},
|
|
98
|
+
getIdentityMap() {
|
|
99
|
+
return identityMap;
|
|
100
|
+
},
|
|
98
101
|
toJSON() {
|
|
99
102
|
return payload;
|
|
100
103
|
},
|