@uniformdev/context-react 20.33.1-alpha.53 → 20.34.1
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 +1 -5
- package/dist/index.d.ts +1 -5
- package/dist/index.esm.js +5 -9
- package/dist/index.js +5 -9
- package/dist/index.mjs +5 -9
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Quirks, ScoreVector, Context, PersonalizedVariant,
|
1
|
+
import { Quirks, ScoreVector, Context, PersonalizedVariant, TestVariant, EnrichmentData } from '@uniformdev/context';
|
2
2
|
import * as react from 'react';
|
3
3
|
import react__default, { ReactNode, ReactElement, HTMLAttributes } from 'react';
|
4
4
|
|
@@ -90,8 +90,6 @@ type PersonalizeComponentProps<TVariation extends PersonalizedVariant> = {
|
|
90
90
|
algorithm?: string;
|
91
91
|
/** The possible variations of the content to render depending on personalization conditions */
|
92
92
|
variations: TVariation[];
|
93
|
-
/** Composition metadata where the personalization is being rendered for analytics tracking */
|
94
|
-
compositionMetadata?: CompositionMetadata;
|
95
93
|
/** A React component to use to render a selected variant. */
|
96
94
|
component: PersonalizedVariationComponent<TVariation>;
|
97
95
|
/** A React component that will be used to wrap all personalized variants. If no variants match, the wrapper is not rendered. */
|
@@ -107,8 +105,6 @@ interface TestComponentProps<TVariation extends TestVariant> {
|
|
107
105
|
name: string;
|
108
106
|
/** Variation list that this test will selected from. */
|
109
107
|
variations: TVariation[];
|
110
|
-
/** Composition metadata where the A/B test is being rendered for analytics tracking */
|
111
|
-
compositionMetadata?: CompositionMetadata;
|
112
108
|
/**
|
113
109
|
* Determines what should be rendered if testing is in a "loading" state.
|
114
110
|
* default: shows the default variation while loading
|
package/dist/index.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Quirks, ScoreVector, Context, PersonalizedVariant,
|
1
|
+
import { Quirks, ScoreVector, Context, PersonalizedVariant, TestVariant, EnrichmentData } from '@uniformdev/context';
|
2
2
|
import * as react from 'react';
|
3
3
|
import react__default, { ReactNode, ReactElement, HTMLAttributes } from 'react';
|
4
4
|
|
@@ -90,8 +90,6 @@ type PersonalizeComponentProps<TVariation extends PersonalizedVariant> = {
|
|
90
90
|
algorithm?: string;
|
91
91
|
/** The possible variations of the content to render depending on personalization conditions */
|
92
92
|
variations: TVariation[];
|
93
|
-
/** Composition metadata where the personalization is being rendered for analytics tracking */
|
94
|
-
compositionMetadata?: CompositionMetadata;
|
95
93
|
/** A React component to use to render a selected variant. */
|
96
94
|
component: PersonalizedVariationComponent<TVariation>;
|
97
95
|
/** A React component that will be used to wrap all personalized variants. If no variants match, the wrapper is not rendered. */
|
@@ -107,8 +105,6 @@ interface TestComponentProps<TVariation extends TestVariant> {
|
|
107
105
|
name: string;
|
108
106
|
/** Variation list that this test will selected from. */
|
109
107
|
variations: TVariation[];
|
110
|
-
/** Composition metadata where the A/B test is being rendered for analytics tracking */
|
111
|
-
compositionMetadata?: CompositionMetadata;
|
112
108
|
/**
|
113
109
|
* Determines what should be rendered if testing is in a "loading" state.
|
114
110
|
* default: shows the default variation while loading
|
package/dist/index.esm.js
CHANGED
@@ -122,8 +122,7 @@ function PersonalizeStandard({
|
|
122
122
|
wrapperComponent,
|
123
123
|
name,
|
124
124
|
algorithm,
|
125
|
-
count = 1
|
126
|
-
compositionMetadata
|
125
|
+
count = 1
|
127
126
|
}) {
|
128
127
|
const { context } = useUniformContext();
|
129
128
|
const scores = useScores();
|
@@ -133,11 +132,10 @@ function PersonalizeStandard({
|
|
133
132
|
name,
|
134
133
|
variations,
|
135
134
|
take: count,
|
136
|
-
algorithm
|
137
|
-
compositionMetadata
|
135
|
+
algorithm
|
138
136
|
}),
|
139
137
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
140
|
-
[scores, quirks, context, count, name, variations
|
138
|
+
[scores, quirks, context, count, name, variations]
|
141
139
|
);
|
142
140
|
const Wrapper = wrapperComponent != null ? wrapperComponent : ({ children }) => /* @__PURE__ */ React2.createElement(React2.Fragment, null, children);
|
143
141
|
const Component = component;
|
@@ -207,14 +205,12 @@ import React5 from "react";
|
|
207
205
|
var TestStandard = ({
|
208
206
|
name,
|
209
207
|
variations,
|
210
|
-
component
|
211
|
-
compositionMetadata
|
208
|
+
component
|
212
209
|
}) => {
|
213
210
|
const { context } = useUniformContext();
|
214
211
|
const { result } = context.test({
|
215
212
|
name,
|
216
|
-
variations
|
217
|
-
compositionMetadata
|
213
|
+
variations
|
218
214
|
});
|
219
215
|
if (!result) {
|
220
216
|
return null;
|
package/dist/index.js
CHANGED
@@ -164,8 +164,7 @@ function PersonalizeStandard({
|
|
164
164
|
wrapperComponent,
|
165
165
|
name,
|
166
166
|
algorithm,
|
167
|
-
count = 1
|
168
|
-
compositionMetadata
|
167
|
+
count = 1
|
169
168
|
}) {
|
170
169
|
const { context } = useUniformContext();
|
171
170
|
const scores = useScores();
|
@@ -175,11 +174,10 @@ function PersonalizeStandard({
|
|
175
174
|
name,
|
176
175
|
variations,
|
177
176
|
take: count,
|
178
|
-
algorithm
|
179
|
-
compositionMetadata
|
177
|
+
algorithm
|
180
178
|
}),
|
181
179
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
182
|
-
[scores, quirks, context, count, name, variations
|
180
|
+
[scores, quirks, context, count, name, variations]
|
183
181
|
);
|
184
182
|
const Wrapper = wrapperComponent != null ? wrapperComponent : ({ children }) => /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, children);
|
185
183
|
const Component = component;
|
@@ -249,14 +247,12 @@ var import_react10 = __toESM(require("react"));
|
|
249
247
|
var TestStandard = ({
|
250
248
|
name,
|
251
249
|
variations,
|
252
|
-
component
|
253
|
-
compositionMetadata
|
250
|
+
component
|
254
251
|
}) => {
|
255
252
|
const { context } = useUniformContext();
|
256
253
|
const { result } = context.test({
|
257
254
|
name,
|
258
|
-
variations
|
259
|
-
compositionMetadata
|
255
|
+
variations
|
260
256
|
});
|
261
257
|
if (!result) {
|
262
258
|
return null;
|
package/dist/index.mjs
CHANGED
@@ -122,8 +122,7 @@ function PersonalizeStandard({
|
|
122
122
|
wrapperComponent,
|
123
123
|
name,
|
124
124
|
algorithm,
|
125
|
-
count = 1
|
126
|
-
compositionMetadata
|
125
|
+
count = 1
|
127
126
|
}) {
|
128
127
|
const { context } = useUniformContext();
|
129
128
|
const scores = useScores();
|
@@ -133,11 +132,10 @@ function PersonalizeStandard({
|
|
133
132
|
name,
|
134
133
|
variations,
|
135
134
|
take: count,
|
136
|
-
algorithm
|
137
|
-
compositionMetadata
|
135
|
+
algorithm
|
138
136
|
}),
|
139
137
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
140
|
-
[scores, quirks, context, count, name, variations
|
138
|
+
[scores, quirks, context, count, name, variations]
|
141
139
|
);
|
142
140
|
const Wrapper = wrapperComponent != null ? wrapperComponent : ({ children }) => /* @__PURE__ */ React2.createElement(React2.Fragment, null, children);
|
143
141
|
const Component = component;
|
@@ -207,14 +205,12 @@ import React5 from "react";
|
|
207
205
|
var TestStandard = ({
|
208
206
|
name,
|
209
207
|
variations,
|
210
|
-
component
|
211
|
-
compositionMetadata
|
208
|
+
component
|
212
209
|
}) => {
|
213
210
|
const { context } = useUniformContext();
|
214
211
|
const { result } = context.test({
|
215
212
|
name,
|
216
|
-
variations
|
217
|
-
compositionMetadata
|
213
|
+
variations
|
218
214
|
});
|
219
215
|
if (!result) {
|
220
216
|
return null;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uniformdev/context-react",
|
3
|
-
"version": "20.
|
3
|
+
"version": "20.34.1",
|
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.34.1",
|
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": "e118be221d19f1e59da7c5845bc3e784e0b42cf3"
|
48
48
|
}
|