@uniformdev/optimize-tracker-react
Advanced tools
Comparing version 7.0.2-alpha.5 to 7.0.2-alpha.11
@@ -1,2 +0,2 @@ | ||
import { ListPersonalizerArguments, PersonalizableListItem } from '@uniformdev/optimize-tracker-common'; | ||
import { ListPersonalizerArguments, PersonalizableListItem, PersonalizeListFunction } from '@uniformdev/optimize-tracker-common'; | ||
import React, { ReactElement } from 'react'; | ||
@@ -36,5 +36,6 @@ import { Scope } from '@uniformdev/optimize-common'; | ||
loadingMode?: 'default' | 'none' | React.ComponentType<TComponentProps>; | ||
personalizeListOverride?: PersonalizeListFunction; | ||
/** All other props, if any, are passed through as props to the `component` or `componentMapping` */ | ||
[key: string]: any; | ||
}; | ||
export declare function Personalize<TVariation extends PersonalizableListItem, TComponentProps>({ variations, componentMapping, component, fallbackSort, count, children, matchFilter, trackingEventName, disableComponentGeneration, testSampleScope, testSampleSize, loadingMode, ...otherProps }: PersonalizedComponentProps<TVariation, TComponentProps>): ReactElement | null; | ||
export declare function Personalize<TVariation extends PersonalizableListItem, TComponentProps>({ variations, componentMapping, component, fallbackSort, count, children, matchFilter, trackingEventName, disableComponentGeneration, testSampleScope, testSampleSize, loadingMode, personalizeListOverride, ...otherProps }: PersonalizedComponentProps<TVariation, TComponentProps>): ReactElement | null; |
@@ -89,3 +89,3 @@ "use strict"; | ||
var _this = this; | ||
var variations = _a.variations, componentMapping = _a.componentMapping, component = _a.component, fallbackSort = _a.fallbackSort, _b = _a.count, count = _b === void 0 ? 1 : _b, children = _a.children, matchFilter = _a.matchFilter, trackingEventName = _a.trackingEventName, disableComponentGeneration = _a.disableComponentGeneration, testSampleScope = _a.testSampleScope, testSampleSize = _a.testSampleSize, loadingMode = _a.loadingMode, otherProps = __rest(_a, ["variations", "componentMapping", "component", "fallbackSort", "count", "children", "matchFilter", "trackingEventName", "disableComponentGeneration", "testSampleScope", "testSampleSize", "loadingMode"]); | ||
var variations = _a.variations, componentMapping = _a.componentMapping, component = _a.component, fallbackSort = _a.fallbackSort, _b = _a.count, count = _b === void 0 ? 1 : _b, children = _a.children, matchFilter = _a.matchFilter, trackingEventName = _a.trackingEventName, disableComponentGeneration = _a.disableComponentGeneration, testSampleScope = _a.testSampleScope, testSampleSize = _a.testSampleSize, loadingMode = _a.loadingMode, personalizeListOverride = _a.personalizeListOverride, otherProps = __rest(_a, ["variations", "componentMapping", "component", "fallbackSort", "count", "children", "matchFilter", "trackingEventName", "disableComponentGeneration", "testSampleScope", "testSampleSize", "loadingMode", "personalizeListOverride"]); | ||
var _c = useUniformTracker_1.useUniformTracker(), tracker = _c.tracker, intentScores = _c.intentScores, loading = _c.loading; | ||
@@ -115,3 +115,4 @@ var _d = react_1.useState(), analyticsTracked = _d[0], setAnalyticsTracked = _d[1]; | ||
} | ||
var personalization = optimize_tracker_1.personalizeList({ | ||
var listFunction = personalizeListOverride || optimize_tracker_1.personalizeList; | ||
var personalization = listFunction({ | ||
list: variations, | ||
@@ -118,0 +119,0 @@ intentScores: intentScores !== null && intentScores !== void 0 ? intentScores : {}, |
@@ -80,3 +80,16 @@ "use strict"; | ||
} | ||
return (react_1.default.createElement(Personalize_1.Personalize, __assign({}, personalizeProps), function (renderProps) { | ||
return (react_1.default.createElement(Personalize_1.Personalize, __assign({}, personalizeProps, { personalizeListOverride: function (options) { | ||
return { | ||
intentScores: {}, | ||
personalized: false, | ||
result: options.list.map(function (item) { | ||
return { | ||
isDefault: false, | ||
relevancy: 0, | ||
tagStrength: 0, | ||
item: item, | ||
}; | ||
}), | ||
}; | ||
} }), function (renderProps) { | ||
return (react_1.default.createElement(NesiPersonalizeList, __assign({}, renderProps, { options: { | ||
@@ -83,0 +96,0 @@ name: name, |
@@ -1,2 +0,2 @@ | ||
import { ListPersonalizerArguments, PersonalizableListItem } from '@uniformdev/optimize-tracker-common'; | ||
import { ListPersonalizerArguments, PersonalizableListItem, PersonalizeListFunction } from '@uniformdev/optimize-tracker-common'; | ||
import React, { ReactElement } from 'react'; | ||
@@ -36,5 +36,6 @@ import { Scope } from '@uniformdev/optimize-common'; | ||
loadingMode?: 'default' | 'none' | React.ComponentType<TComponentProps>; | ||
personalizeListOverride?: PersonalizeListFunction; | ||
/** All other props, if any, are passed through as props to the `component` or `componentMapping` */ | ||
[key: string]: any; | ||
}; | ||
export declare function Personalize<TVariation extends PersonalizableListItem, TComponentProps>({ variations, componentMapping, component, fallbackSort, count, children, matchFilter, trackingEventName, disableComponentGeneration, testSampleScope, testSampleSize, loadingMode, ...otherProps }: PersonalizedComponentProps<TVariation, TComponentProps>): ReactElement | null; | ||
export declare function Personalize<TVariation extends PersonalizableListItem, TComponentProps>({ variations, componentMapping, component, fallbackSort, count, children, matchFilter, trackingEventName, disableComponentGeneration, testSampleScope, testSampleSize, loadingMode, personalizeListOverride, ...otherProps }: PersonalizedComponentProps<TVariation, TComponentProps>): ReactElement | null; |
@@ -67,3 +67,3 @@ var __assign = (this && this.__assign) || function () { | ||
var _this = this; | ||
var variations = _a.variations, componentMapping = _a.componentMapping, component = _a.component, fallbackSort = _a.fallbackSort, _b = _a.count, count = _b === void 0 ? 1 : _b, children = _a.children, matchFilter = _a.matchFilter, trackingEventName = _a.trackingEventName, disableComponentGeneration = _a.disableComponentGeneration, testSampleScope = _a.testSampleScope, testSampleSize = _a.testSampleSize, loadingMode = _a.loadingMode, otherProps = __rest(_a, ["variations", "componentMapping", "component", "fallbackSort", "count", "children", "matchFilter", "trackingEventName", "disableComponentGeneration", "testSampleScope", "testSampleSize", "loadingMode"]); | ||
var variations = _a.variations, componentMapping = _a.componentMapping, component = _a.component, fallbackSort = _a.fallbackSort, _b = _a.count, count = _b === void 0 ? 1 : _b, children = _a.children, matchFilter = _a.matchFilter, trackingEventName = _a.trackingEventName, disableComponentGeneration = _a.disableComponentGeneration, testSampleScope = _a.testSampleScope, testSampleSize = _a.testSampleSize, loadingMode = _a.loadingMode, personalizeListOverride = _a.personalizeListOverride, otherProps = __rest(_a, ["variations", "componentMapping", "component", "fallbackSort", "count", "children", "matchFilter", "trackingEventName", "disableComponentGeneration", "testSampleScope", "testSampleSize", "loadingMode", "personalizeListOverride"]); | ||
var _c = useUniformTracker(), tracker = _c.tracker, intentScores = _c.intentScores, loading = _c.loading; | ||
@@ -93,3 +93,4 @@ var _d = useState(), analyticsTracked = _d[0], setAnalyticsTracked = _d[1]; | ||
} | ||
var personalization = personalizeList({ | ||
var listFunction = personalizeListOverride || personalizeList; | ||
var personalization = listFunction({ | ||
list: variations, | ||
@@ -96,0 +97,0 @@ intentScores: intentScores !== null && intentScores !== void 0 ? intentScores : {}, |
@@ -58,3 +58,16 @@ var __assign = (this && this.__assign) || function () { | ||
} | ||
return (React.createElement(Personalize, __assign({}, personalizeProps), function (renderProps) { | ||
return (React.createElement(Personalize, __assign({}, personalizeProps, { personalizeListOverride: function (options) { | ||
return { | ||
intentScores: {}, | ||
personalized: false, | ||
result: options.list.map(function (item) { | ||
return { | ||
isDefault: false, | ||
relevancy: 0, | ||
tagStrength: 0, | ||
item: item, | ||
}; | ||
}), | ||
}; | ||
} }), function (renderProps) { | ||
return (React.createElement(NesiPersonalizeList, __assign({}, renderProps, { options: { | ||
@@ -61,0 +74,0 @@ name: name, |
{ | ||
"name": "@uniformdev/optimize-tracker-react", | ||
"version": "7.0.2-alpha.5+7092bbc", | ||
"version": "7.0.2-alpha.11+f8b2f5a", | ||
"description": "Uniform Optimize tracker bindings for React", | ||
@@ -33,5 +33,5 @@ "repository": { | ||
"dependencies": { | ||
"@uniformdev/optimize-common": "^7.0.2-alpha.5+7092bbc", | ||
"@uniformdev/optimize-tracker": "^7.0.2-alpha.5+7092bbc", | ||
"@uniformdev/optimize-tracker-browser": "^7.0.2-alpha.5+7092bbc", | ||
"@uniformdev/optimize-common": "^7.0.2-alpha.11+f8b2f5a", | ||
"@uniformdev/optimize-tracker": "^7.0.2-alpha.11+f8b2f5a", | ||
"@uniformdev/optimize-tracker-browser": "^7.0.2-alpha.11+f8b2f5a", | ||
"react-use": "^17.2.1" | ||
@@ -62,3 +62,3 @@ }, | ||
}, | ||
"gitHead": "7092bbc23baa766db1722c2a4717bc329447dba2" | ||
"gitHead": "f8b2f5a26d476d2113510fab31e13d13eee205dc" | ||
} |
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
147191
2529