sfc-utils 1.4.93 → 1.4.95
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/package.json +1 -1
- package/personalize.js +29 -4
- package/styles/variables.less +2 -2
package/package.json
CHANGED
package/personalize.js
CHANGED
|
@@ -40,7 +40,7 @@ const setProfileProperty = (property, value, merge = false) => {
|
|
|
40
40
|
return new Promise((resolve, reject) => {
|
|
41
41
|
if (window) {
|
|
42
42
|
if (window.blueConicClient) {
|
|
43
|
-
// Prepare merging
|
|
43
|
+
// Prepare merging (note: this only handles objects, not arrays or other types)
|
|
44
44
|
let conditionalPromise = Promise.resolve();
|
|
45
45
|
if (merge && typeof value === "object") {
|
|
46
46
|
conditionalPromise = getProfileProperty(property);
|
|
@@ -49,8 +49,10 @@ const setProfileProperty = (property, value, merge = false) => {
|
|
|
49
49
|
conditionalPromise.then((existingValue) => {
|
|
50
50
|
// Finish merging
|
|
51
51
|
if (merge && typeof value === "object") {
|
|
52
|
-
console.log("Merging values...", existingValue, value);
|
|
53
|
-
value = JSON.stringify(
|
|
52
|
+
console.log("Merging values...", JSON.parse(existingValue), value);
|
|
53
|
+
value = JSON.stringify(
|
|
54
|
+
Object.assign({}, JSON.parse(existingValue), value)
|
|
55
|
+
);
|
|
54
56
|
console.log("Merged value", value);
|
|
55
57
|
}
|
|
56
58
|
// Make sure property to save is a string
|
|
@@ -77,4 +79,27 @@ const setProfileProperty = (property, value, merge = false) => {
|
|
|
77
79
|
});
|
|
78
80
|
};
|
|
79
81
|
|
|
80
|
-
|
|
82
|
+
const clearProfileProperty = (property) => {
|
|
83
|
+
return new Promise((resolve, reject) => {
|
|
84
|
+
if (window) {
|
|
85
|
+
if (window.blueConicClient) {
|
|
86
|
+
const profile = window.blueConicClient.profile.getProfile();
|
|
87
|
+
const properties = [property];
|
|
88
|
+
profile.loadValues(properties, this, function () {
|
|
89
|
+
profile.setValue(property, "");
|
|
90
|
+
resolve(true);
|
|
91
|
+
});
|
|
92
|
+
} else {
|
|
93
|
+
resolve("Personalize: No BlueConic client found");
|
|
94
|
+
}
|
|
95
|
+
} else {
|
|
96
|
+
resolve("Personalize: No window found");
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
module.exports = {
|
|
102
|
+
getProfileProperty,
|
|
103
|
+
setProfileProperty,
|
|
104
|
+
clearProfileProperty,
|
|
105
|
+
};
|
package/styles/variables.less
CHANGED
|
@@ -87,14 +87,14 @@
|
|
|
87
87
|
@purple-pale: #F8F5F8;
|
|
88
88
|
|
|
89
89
|
//color scales - 100 is the base, higher values are darker, lower values are lighter
|
|
90
|
-
@red-300: #
|
|
90
|
+
@red-300: #95130B;
|
|
91
91
|
@red-100: #BA142D;
|
|
92
92
|
@red-75: #D06566;
|
|
93
93
|
@red-50: #D18786;
|
|
94
94
|
@red-25: #DDABAA;
|
|
95
95
|
@red-0: #F2E1E1;
|
|
96
96
|
|
|
97
|
-
@blue-300: #
|
|
97
|
+
@blue-300: #001E37;
|
|
98
98
|
@blue-100: #025BAF;
|
|
99
99
|
@blue-75: #428BCA;
|
|
100
100
|
@blue-50: #67A2D4;
|