@uniformdev/context 19.128.1-alpha.13 → 19.128.1-alpha.15
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/dist/index.esm.js +13 -9
- package/dist/index.js +13 -9
- package/dist/index.mjs +13 -9
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
@@ -649,27 +649,31 @@ function personalizeVariations({
|
|
649
649
|
}
|
650
650
|
if (evaluateVariantMatch(variant.id, variant.pz, scores, onLogMessage)) {
|
651
651
|
let variantToAdd = variant;
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
652
|
+
let isControl = false;
|
653
|
+
const isDefault = defaultVariants.find((v) => v.id === variant.id);
|
654
|
+
if (take === 1 && !isDefault && defaultVariants.length && typeof variant.pz.control === "number") {
|
655
|
+
isControl = context.getPersonalizeVariantControl(name, currentIndex);
|
656
|
+
if (typeof isControl === "undefined") {
|
657
|
+
isControl = rollForControlGroup(variant.pz.control);
|
657
658
|
context.storage.updateData([
|
658
659
|
{
|
659
660
|
type: "setpersonalizecontrol",
|
660
661
|
data: {
|
661
662
|
personlizationName: name,
|
662
663
|
index: currentIndex,
|
663
|
-
control:
|
664
|
+
control: isControl
|
664
665
|
}
|
665
666
|
}
|
666
667
|
]);
|
667
668
|
}
|
668
|
-
if (
|
669
|
-
variantToAdd =
|
669
|
+
if (isControl) {
|
670
|
+
variantToAdd = {
|
671
|
+
...defaultVariants[0],
|
672
|
+
id: variant.id
|
673
|
+
};
|
670
674
|
}
|
671
675
|
}
|
672
|
-
personalized =
|
676
|
+
personalized = personalized || typeof variantToAdd.pz !== "undefined";
|
673
677
|
results.push({
|
674
678
|
...variantToAdd,
|
675
679
|
control: isControl
|
package/dist/index.js
CHANGED
@@ -719,27 +719,31 @@ function personalizeVariations({
|
|
719
719
|
}
|
720
720
|
if (evaluateVariantMatch(variant.id, variant.pz, scores, onLogMessage)) {
|
721
721
|
let variantToAdd = variant;
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
722
|
+
let isControl = false;
|
723
|
+
const isDefault = defaultVariants.find((v) => v.id === variant.id);
|
724
|
+
if (take === 1 && !isDefault && defaultVariants.length && typeof variant.pz.control === "number") {
|
725
|
+
isControl = context.getPersonalizeVariantControl(name, currentIndex);
|
726
|
+
if (typeof isControl === "undefined") {
|
727
|
+
isControl = rollForControlGroup(variant.pz.control);
|
727
728
|
context.storage.updateData([
|
728
729
|
{
|
729
730
|
type: "setpersonalizecontrol",
|
730
731
|
data: {
|
731
732
|
personlizationName: name,
|
732
733
|
index: currentIndex,
|
733
|
-
control:
|
734
|
+
control: isControl
|
734
735
|
}
|
735
736
|
}
|
736
737
|
]);
|
737
738
|
}
|
738
|
-
if (
|
739
|
-
variantToAdd =
|
739
|
+
if (isControl) {
|
740
|
+
variantToAdd = {
|
741
|
+
...defaultVariants[0],
|
742
|
+
id: variant.id
|
743
|
+
};
|
740
744
|
}
|
741
745
|
}
|
742
|
-
personalized =
|
746
|
+
personalized = personalized || typeof variantToAdd.pz !== "undefined";
|
743
747
|
results.push({
|
744
748
|
...variantToAdd,
|
745
749
|
control: isControl
|
package/dist/index.mjs
CHANGED
@@ -649,27 +649,31 @@ function personalizeVariations({
|
|
649
649
|
}
|
650
650
|
if (evaluateVariantMatch(variant.id, variant.pz, scores, onLogMessage)) {
|
651
651
|
let variantToAdd = variant;
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
652
|
+
let isControl = false;
|
653
|
+
const isDefault = defaultVariants.find((v) => v.id === variant.id);
|
654
|
+
if (take === 1 && !isDefault && defaultVariants.length && typeof variant.pz.control === "number") {
|
655
|
+
isControl = context.getPersonalizeVariantControl(name, currentIndex);
|
656
|
+
if (typeof isControl === "undefined") {
|
657
|
+
isControl = rollForControlGroup(variant.pz.control);
|
657
658
|
context.storage.updateData([
|
658
659
|
{
|
659
660
|
type: "setpersonalizecontrol",
|
660
661
|
data: {
|
661
662
|
personlizationName: name,
|
662
663
|
index: currentIndex,
|
663
|
-
control:
|
664
|
+
control: isControl
|
664
665
|
}
|
665
666
|
}
|
666
667
|
]);
|
667
668
|
}
|
668
|
-
if (
|
669
|
-
variantToAdd =
|
669
|
+
if (isControl) {
|
670
|
+
variantToAdd = {
|
671
|
+
...defaultVariants[0],
|
672
|
+
id: variant.id
|
673
|
+
};
|
670
674
|
}
|
671
675
|
}
|
672
|
-
personalized =
|
676
|
+
personalized = personalized || typeof variantToAdd.pz !== "undefined";
|
673
677
|
results.push({
|
674
678
|
...variantToAdd,
|
675
679
|
control: isControl
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uniformdev/context",
|
3
|
-
"version": "19.128.1-alpha.
|
3
|
+
"version": "19.128.1-alpha.15+d7032015de",
|
4
4
|
"description": "Uniform Context core package",
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
6
6
|
"main": "./dist/index.js",
|
@@ -66,5 +66,5 @@
|
|
66
66
|
"publishConfig": {
|
67
67
|
"access": "public"
|
68
68
|
},
|
69
|
-
"gitHead": "
|
69
|
+
"gitHead": "d7032015def2ebc8d52cec9c207a8b863421cc47"
|
70
70
|
}
|