@ninetailed/experience.js-react 7.17.5 → 7.18.0
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/index.cjs.js +14 -0
- package/index.esm.js +23 -9
- package/package.json +23 -12
- package/src/lib/EntryAnalytics/EntryAnalytics.d.ts +4 -0
- package/src/lib/EntryAnalytics/index.d.ts +2 -0
- package/src/lib/index.d.ts +2 -0
package/index.cjs.js
CHANGED
|
@@ -726,9 +726,23 @@ const ESRLoadingComponent = _a => {
|
|
|
726
726
|
}));
|
|
727
727
|
};
|
|
728
728
|
|
|
729
|
+
const EntryAnalytics = _a => {
|
|
730
|
+
var {
|
|
731
|
+
component: Component,
|
|
732
|
+
passthroughProps
|
|
733
|
+
} = _a,
|
|
734
|
+
entry = __rest(_a, ["component", "passthroughProps"]);
|
|
735
|
+
return jsxRuntime.jsx(Experience, Object.assign({}, passthroughProps, entry, {
|
|
736
|
+
id: entry.id,
|
|
737
|
+
component: Component,
|
|
738
|
+
experiences: []
|
|
739
|
+
}));
|
|
740
|
+
};
|
|
741
|
+
|
|
729
742
|
exports.DefaultExperienceLoadingComponent = DefaultExperienceLoadingComponent;
|
|
730
743
|
exports.ESRLoadingComponent = ESRLoadingComponent;
|
|
731
744
|
exports.ESRProvider = ESRProvider;
|
|
745
|
+
exports.EntryAnalytics = EntryAnalytics;
|
|
732
746
|
exports.Experience = Experience;
|
|
733
747
|
exports.MergeTag = MergeTag;
|
|
734
748
|
exports.NinetailedProvider = NinetailedProvider;
|
package/index.esm.js
CHANGED
|
@@ -76,10 +76,10 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
76
76
|
return target;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
const _excluded$
|
|
79
|
+
const _excluded$4 = ["experiences"];
|
|
80
80
|
function formatProfileForHook(profile) {
|
|
81
81
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
82
|
-
const profileStateWithoutExperiences = _objectWithoutPropertiesLoose(profile, _excluded$
|
|
82
|
+
const profileStateWithoutExperiences = _objectWithoutPropertiesLoose(profile, _excluded$4);
|
|
83
83
|
return Object.assign({}, profileStateWithoutExperiences, {
|
|
84
84
|
loading: profile.status === 'loading'
|
|
85
85
|
});
|
|
@@ -288,7 +288,7 @@ const TrackHasSeenComponent = ({
|
|
|
288
288
|
});
|
|
289
289
|
};
|
|
290
290
|
|
|
291
|
-
const _excluded$
|
|
291
|
+
const _excluded$3 = ["component", "loadingComponent", "variants", "holdout"];
|
|
292
292
|
const Personalize = _ref => {
|
|
293
293
|
let {
|
|
294
294
|
component: Component,
|
|
@@ -296,7 +296,7 @@ const Personalize = _ref => {
|
|
|
296
296
|
variants = [],
|
|
297
297
|
holdout = -1
|
|
298
298
|
} = _ref,
|
|
299
|
-
baseline = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
299
|
+
baseline = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
|
300
300
|
const {
|
|
301
301
|
loading,
|
|
302
302
|
variant,
|
|
@@ -470,7 +470,7 @@ const getObservableElement = element => {
|
|
|
470
470
|
return getObservableElement(parentElement);
|
|
471
471
|
};
|
|
472
472
|
|
|
473
|
-
const _excluded$
|
|
473
|
+
const _excluded$2 = ["component", "unhideAfterMs", "passthroughProps"],
|
|
474
474
|
_excluded2 = ["experiences", "component", "loadingComponent", "passthroughProps"];
|
|
475
475
|
const DefaultExperienceLoadingComponent = _ref => {
|
|
476
476
|
let {
|
|
@@ -478,7 +478,7 @@ const DefaultExperienceLoadingComponent = _ref => {
|
|
|
478
478
|
unhideAfterMs = 5000,
|
|
479
479
|
passthroughProps
|
|
480
480
|
} = _ref,
|
|
481
|
-
baseline = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
481
|
+
baseline = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
482
482
|
const {
|
|
483
483
|
logger
|
|
484
484
|
} = useNinetailed();
|
|
@@ -622,7 +622,7 @@ const Experience = _ref2 => {
|
|
|
622
622
|
});
|
|
623
623
|
};
|
|
624
624
|
|
|
625
|
-
const _excluded = ["experiences", "component", "passthroughProps"];
|
|
625
|
+
const _excluded$1 = ["experiences", "component", "passthroughProps"];
|
|
626
626
|
const ESRContext = /*#__PURE__*/React.createContext(undefined);
|
|
627
627
|
const ESRProvider = ({
|
|
628
628
|
experienceVariantsMap,
|
|
@@ -650,7 +650,7 @@ const ESRLoadingComponent = _ref => {
|
|
|
650
650
|
component: Component,
|
|
651
651
|
passthroughProps
|
|
652
652
|
} = _ref,
|
|
653
|
-
baseline = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
653
|
+
baseline = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
654
654
|
const {
|
|
655
655
|
experienceVariantsMap
|
|
656
656
|
} = useESR();
|
|
@@ -715,4 +715,18 @@ const ESRLoadingComponent = _ref => {
|
|
|
715
715
|
}));
|
|
716
716
|
};
|
|
717
717
|
|
|
718
|
-
|
|
718
|
+
const _excluded = ["component", "passthroughProps"];
|
|
719
|
+
const EntryAnalytics = _ref => {
|
|
720
|
+
let {
|
|
721
|
+
component: Component,
|
|
722
|
+
passthroughProps
|
|
723
|
+
} = _ref,
|
|
724
|
+
entry = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
725
|
+
return /*#__PURE__*/jsx(Experience, Object.assign({}, passthroughProps, entry, {
|
|
726
|
+
id: entry.id,
|
|
727
|
+
component: Component,
|
|
728
|
+
experiences: []
|
|
729
|
+
}));
|
|
730
|
+
};
|
|
731
|
+
|
|
732
|
+
export { DefaultExperienceLoadingComponent, ESRLoadingComponent, ESRProvider, EntryAnalytics, Experience, MergeTag, NinetailedProvider, Personalize, TrackHasSeenComponent, useExperience, useFlag, useFlagWithManualTracking, useNinetailed, usePersonalize, useProfile };
|
package/package.json
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ninetailed/experience.js-react",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.18.0",
|
|
4
4
|
"description": "Ninetailed SDK for React",
|
|
5
|
-
"dependencies": {
|
|
6
|
-
"@ninetailed/experience.js": "7.17.5",
|
|
7
|
-
"@ninetailed/experience.js-shared": "7.17.5",
|
|
8
|
-
"@ninetailed/experience.js-plugin-analytics": "7.17.5",
|
|
9
|
-
"radash": "10.9.0",
|
|
10
|
-
"react-is": "18.2.0"
|
|
11
|
-
},
|
|
12
|
-
"peerDependencies": {
|
|
13
|
-
"react": ">=16.8.0"
|
|
14
|
-
},
|
|
15
5
|
"license": "MIT",
|
|
16
6
|
"repository": {
|
|
17
7
|
"type": "git",
|
|
@@ -24,6 +14,27 @@
|
|
|
24
14
|
"personalization",
|
|
25
15
|
"a/b testing"
|
|
26
16
|
],
|
|
17
|
+
"main": "./index.cjs.js",
|
|
27
18
|
"module": "./index.esm.js",
|
|
28
|
-
"
|
|
19
|
+
"types": "./index.cjs.d.ts",
|
|
20
|
+
"exports": {
|
|
21
|
+
".": {
|
|
22
|
+
"types": "./index.cjs.d.ts",
|
|
23
|
+
"import": "./index.esm.js",
|
|
24
|
+
"require": "./index.cjs.js",
|
|
25
|
+
"default": "./index.esm.js"
|
|
26
|
+
},
|
|
27
|
+
"./package.json": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
"sideEffects": false,
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@ninetailed/experience.js": "7.18.0",
|
|
32
|
+
"@ninetailed/experience.js-shared": "7.18.0",
|
|
33
|
+
"@ninetailed/experience.js-plugin-analytics": "7.18.0",
|
|
34
|
+
"radash": "10.9.0",
|
|
35
|
+
"react-is": "18.2.0"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"react": ">=16.8.0"
|
|
39
|
+
}
|
|
29
40
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Baseline } from '@ninetailed/experience.js';
|
|
2
|
+
import { ExperienceProps } from '../Experience';
|
|
3
|
+
export type EntryAnalyticsProps<P> = Omit<ExperienceProps<P>, 'experiences'> & Baseline<P>;
|
|
4
|
+
export declare const EntryAnalytics: <P>({ component: Component, passthroughProps, ...entry }: EntryAnalyticsProps<P>) => import("react/jsx-runtime").JSX.Element;
|
package/src/lib/index.d.ts
CHANGED
|
@@ -13,3 +13,5 @@ export { MergeTag } from './MergeTag';
|
|
|
13
13
|
export { TrackHasSeenComponent } from './TrackHasSeenComponent';
|
|
14
14
|
export { Experience, ESRProvider, ESRLoadingComponent, DefaultExperienceLoadingComponent, useExperience, } from './Experience';
|
|
15
15
|
export type { ExperienceProps, ExperienceBaseProps, ExperienceComponent, ExperienceLoadingComponent, } from './Experience';
|
|
16
|
+
export { EntryAnalytics } from './EntryAnalytics';
|
|
17
|
+
export type { EntryAnalyticsProps } from './EntryAnalytics';
|