@adobe/alloy 2.9.0-alpha.3 → 2.9.0-alpha.6
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/DataCollector/index.js +1 -1
- package/libEs5/components/Personalization/constants/schema.js +3 -1
- package/libEs5/components/Personalization/constants/scopeType.js +17 -0
- package/libEs5/components/Personalization/createAutoRenderingHandler.js +66 -39
- package/libEs5/components/Personalization/createCollect.js +23 -6
- package/libEs5/components/Personalization/createComponent.js +3 -1
- package/libEs5/components/Personalization/createExecuteDecisions.js +9 -12
- package/libEs5/components/Personalization/createPersonalizationDetails.js +1 -1
- package/libEs5/components/Personalization/createViewChangeHandler.js +28 -18
- package/libEs5/components/Personalization/dom-actions/initDomActionsModules.js +5 -0
- package/libEs5/components/Personalization/groupDecisions.js +37 -18
- package/libEs5/components/Personalization/index.js +6 -24
- package/libEs5/components/Personalization/utils/composePersonalizationResultingObject.js +24 -0
- package/libEs5/constants/libraryVersion.js +1 -1
- package/libEs5/core/buildAndValidateConfig.js +1 -1
- package/libEs5/core/validateCommandOptions.js +1 -1
- package/libEs6/components/DataCollector/index.js +1 -1
- package/libEs6/components/Personalization/constants/schema.js +1 -0
- package/libEs6/components/Personalization/constants/scopeType.js +12 -0
- package/libEs6/components/Personalization/createAutoRenderingHandler.js +59 -33
- package/libEs6/components/Personalization/createCollect.js +21 -6
- package/libEs6/components/Personalization/createComponent.js +3 -1
- package/libEs6/components/Personalization/createExecuteDecisions.js +9 -13
- package/libEs6/components/Personalization/createPersonalizationDetails.js +2 -2
- package/libEs6/components/Personalization/createViewChangeHandler.js +27 -18
- package/libEs6/components/Personalization/dom-actions/initDomActionsModules.js +4 -1
- package/libEs6/components/Personalization/groupDecisions.js +32 -20
- package/libEs6/components/Personalization/index.js +6 -22
- package/libEs6/components/Personalization/utils/composePersonalizationResultingObject.js +15 -0
- package/libEs6/constants/libraryVersion.js +1 -1
- package/libEs6/core/buildAndValidateConfig.js +1 -1
- package/libEs6/core/validateCommandOptions.js +1 -1
- package/package.json +2 -2
- package/libEs5/components/Personalization/createExecuteCachedViewDecisions.js +0 -47
- package/libEs5/components/Personalization/createViewCollect.js +0 -48
- package/libEs6/components/Personalization/createExecuteCachedViewDecisions.js +0 -41
- package/libEs6/components/Personalization/createViewCollect.js +0 -42
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020 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 isNonEmptyArray from "../../utils/isNonEmptyArray";
|
|
13
|
-
export default (({
|
|
14
|
-
executeViewDecisions,
|
|
15
|
-
collect
|
|
16
|
-
}) => {
|
|
17
|
-
return ({
|
|
18
|
-
viewName,
|
|
19
|
-
viewDecisions
|
|
20
|
-
}) => {
|
|
21
|
-
// if there are viewDecisions for current view we will execute them and then send the collect call
|
|
22
|
-
if (isNonEmptyArray(viewDecisions)) {
|
|
23
|
-
executeViewDecisions(viewDecisions);
|
|
24
|
-
return; // return here is to avoid the following code to be executed, that one is meant for the condition when viewDecisions is empty
|
|
25
|
-
} // if there are no viewDecisions for current view we will send a collect call
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const xdm = {
|
|
29
|
-
web: {
|
|
30
|
-
webPageDetails: {
|
|
31
|
-
viewName
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}; // This collect function is not from createCollect. It's the function from createViewCollect.
|
|
35
|
-
|
|
36
|
-
collect({
|
|
37
|
-
decisionsMeta: [],
|
|
38
|
-
xdm
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright 2020 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 { isNonEmptyArray } from "../../utils";
|
|
13
|
-
import { DISPLAY } from "./constants/eventType";
|
|
14
|
-
export default (({
|
|
15
|
-
eventManager,
|
|
16
|
-
mergeDecisionsMeta
|
|
17
|
-
}) => {
|
|
18
|
-
// Called when an offer for a specific SPA view is auto-rendered.
|
|
19
|
-
return ({
|
|
20
|
-
decisionsMeta,
|
|
21
|
-
xdm
|
|
22
|
-
}) => {
|
|
23
|
-
const data = {
|
|
24
|
-
eventType: DISPLAY
|
|
25
|
-
};
|
|
26
|
-
const event = eventManager.createEvent();
|
|
27
|
-
|
|
28
|
-
if (isNonEmptyArray(decisionsMeta)) {
|
|
29
|
-
const viewName = decisionsMeta[0].scope;
|
|
30
|
-
data.web = {
|
|
31
|
-
webPageDetails: {
|
|
32
|
-
viewName
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
mergeDecisionsMeta(event, decisionsMeta);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
event.mergeXdm(data);
|
|
39
|
-
event.mergeXdm(xdm);
|
|
40
|
-
return eventManager.sendEvent(event);
|
|
41
|
-
};
|
|
42
|
-
});
|