@uniformdev/context-react 20.3.1-alpha.7 → 20.4.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.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +5 -2
- package/dist/index.js +5 -2
- package/dist/index.mjs +5 -2
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
@@ -86,6 +86,8 @@ type PersonalizeComponentProps<TVariation extends PersonalizedVariant> = {
|
|
86
86
|
* This name is emitted to analytics after personalization executes.
|
87
87
|
*/
|
88
88
|
name: string;
|
89
|
+
/** The algorithm to use for personalization, if not the default. */
|
90
|
+
algorithm?: string;
|
89
91
|
/** The possible variations of the content to render depending on personalization conditions */
|
90
92
|
variations: TVariation[];
|
91
93
|
/** A React component to use to render a selected variant. */
|
package/dist/index.d.ts
CHANGED
@@ -86,6 +86,8 @@ type PersonalizeComponentProps<TVariation extends PersonalizedVariant> = {
|
|
86
86
|
* This name is emitted to analytics after personalization executes.
|
87
87
|
*/
|
88
88
|
name: string;
|
89
|
+
/** The algorithm to use for personalization, if not the default. */
|
90
|
+
algorithm?: string;
|
89
91
|
/** The possible variations of the content to render depending on personalization conditions */
|
90
92
|
variations: TVariation[];
|
91
93
|
/** A React component to use to render a selected variant. */
|
package/dist/index.esm.js
CHANGED
@@ -83,7 +83,8 @@ function PersonalizeEdge(props) {
|
|
83
83
|
const { variations, count, component } = props;
|
84
84
|
const options = {
|
85
85
|
name: props.name,
|
86
|
-
count: count != null ? count : 1
|
86
|
+
count: count != null ? count : 1,
|
87
|
+
algorithm: props.algorithm
|
87
88
|
};
|
88
89
|
const Component = component;
|
89
90
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
@@ -120,6 +121,7 @@ function PersonalizeStandard({
|
|
120
121
|
component,
|
121
122
|
wrapperComponent,
|
122
123
|
name,
|
124
|
+
algorithm,
|
123
125
|
count = 1
|
124
126
|
}) {
|
125
127
|
const { context } = useUniformContext();
|
@@ -129,7 +131,8 @@ function PersonalizeStandard({
|
|
129
131
|
() => context.personalize({
|
130
132
|
name,
|
131
133
|
variations,
|
132
|
-
take: count
|
134
|
+
take: count,
|
135
|
+
algorithm
|
133
136
|
}),
|
134
137
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
135
138
|
[scores, quirks, context, count, name, variations]
|
package/dist/index.js
CHANGED
@@ -125,7 +125,8 @@ function PersonalizeEdge(props) {
|
|
125
125
|
const { variations, count, component } = props;
|
126
126
|
const options = {
|
127
127
|
name: props.name,
|
128
|
-
count: count != null ? count : 1
|
128
|
+
count: count != null ? count : 1,
|
129
|
+
algorithm: props.algorithm
|
129
130
|
};
|
130
131
|
const Component = component;
|
131
132
|
return /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, /* @__PURE__ */ import_react6.default.createElement(
|
@@ -162,6 +163,7 @@ function PersonalizeStandard({
|
|
162
163
|
component,
|
163
164
|
wrapperComponent,
|
164
165
|
name,
|
166
|
+
algorithm,
|
165
167
|
count = 1
|
166
168
|
}) {
|
167
169
|
const { context } = useUniformContext();
|
@@ -171,7 +173,8 @@ function PersonalizeStandard({
|
|
171
173
|
() => context.personalize({
|
172
174
|
name,
|
173
175
|
variations,
|
174
|
-
take: count
|
176
|
+
take: count,
|
177
|
+
algorithm
|
175
178
|
}),
|
176
179
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
177
180
|
[scores, quirks, context, count, name, variations]
|
package/dist/index.mjs
CHANGED
@@ -83,7 +83,8 @@ function PersonalizeEdge(props) {
|
|
83
83
|
const { variations, count, component } = props;
|
84
84
|
const options = {
|
85
85
|
name: props.name,
|
86
|
-
count: count != null ? count : 1
|
86
|
+
count: count != null ? count : 1,
|
87
|
+
algorithm: props.algorithm
|
87
88
|
};
|
88
89
|
const Component = component;
|
89
90
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
@@ -120,6 +121,7 @@ function PersonalizeStandard({
|
|
120
121
|
component,
|
121
122
|
wrapperComponent,
|
122
123
|
name,
|
124
|
+
algorithm,
|
123
125
|
count = 1
|
124
126
|
}) {
|
125
127
|
const { context } = useUniformContext();
|
@@ -129,7 +131,8 @@ function PersonalizeStandard({
|
|
129
131
|
() => context.personalize({
|
130
132
|
name,
|
131
133
|
variations,
|
132
|
-
take: count
|
134
|
+
take: count,
|
135
|
+
algorithm
|
133
136
|
}),
|
134
137
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
135
138
|
[scores, quirks, context, count, name, variations]
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uniformdev/context-react",
|
3
|
-
"version": "20.
|
3
|
+
"version": "20.4.1-alpha.15+73b27bfcce",
|
4
4
|
"description": "Uniform Context React integration package",
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
6
6
|
"main": "./dist/index.js",
|
@@ -30,7 +30,7 @@
|
|
30
30
|
"react-dom": "18.3.1"
|
31
31
|
},
|
32
32
|
"dependencies": {
|
33
|
-
"@uniformdev/context": "20.
|
33
|
+
"@uniformdev/context": "20.4.1-alpha.15+73b27bfcce",
|
34
34
|
"cookie": "1.0.1",
|
35
35
|
"dequal": "2.0.3"
|
36
36
|
},
|
@@ -44,5 +44,5 @@
|
|
44
44
|
"publishConfig": {
|
45
45
|
"access": "public"
|
46
46
|
},
|
47
|
-
"gitHead": "
|
47
|
+
"gitHead": "73b27bfcce749c31e7ab50bdc9bb86ac1294903d"
|
48
48
|
}
|