@ninetailed/experience.js-react 7.4.3 → 7.5.0-beta.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/README.md CHANGED
@@ -1,7 +1,32 @@
1
- # experience-sdk-react
1
+ # @ninetailed/experience.js-react
2
2
 
3
- This library was generated with [Nx](https://nx.dev).
3
+ <!--Insert badges begin-->
4
+ <!--GENERATED TEXT - DO NOT EDIT HERE -->
5
+ <p align="center">
6
+ <a href="https://www.npmjs.com/package/@ninetailed/experience.js-react"><img src="https://img.shields.io/npm/v/@ninetailed/experience.js-react.svg" alt="NPM Version" /></a>
7
+ <a href="https://www.npmjs.com/package/@ninetailed/experience.js-react"><img src="https://img.shields.io/npm/l/@ninetailed/experience.js-react.svg" alt="Package License" /></a>
8
+ <a href="https://www.npmjs.com/package/@ninetailed/experience.js-react"><img src="https://img.shields.io/npm/dm/@ninetailed/experience.js-react.svg" alt="NPM Downloads" /></a>
9
+ <a href="https://docs.ninetailed.io/" target="_blank"><img src="https://img.shields.io/badge/%F0%9F%93%96-Documentation-green.svg" alt="Documentation"/></a>
10
+ <a href="ninetailed-community.slack.com" target="_blank"><img src="https://img.shields.io/badge/Slack-Ninetailed%20Community-blue.svg" alt="Join the official Slack community"/>
11
+ </p>
12
+
13
+ <!--Insert badges end-->
14
+
15
+ <!--Insert template begin-->
16
+ <!--GENERATED TEXT - DO NOT EDIT HERE -->
17
+
18
+ ## About Ninetailed
19
+
20
+ Our extensible [Experience SDKs](https://docs.ninetailed.io/#getting-started-for-developers) help you integrate Ninetailed Experiences into your JavaScript / TypeScript applications. With support for ESR and SSR, out-of-the-box utilities, and plugins, you have all the tools you need to get started.
21
+
22
+ Using a framework we don't currently support? No problem! Our [Experience API](https://docs.ninetailed.io/for-developers/experience-api) enables you to use Ninetailed Experiences virtually anywhere.
23
+
24
+ <!--Insert template end-->
25
+
26
+ ## Building
27
+
28
+ Run `nx test sdks-react` to build the library.
4
29
 
5
30
  ## Running unit tests
6
31
 
7
- Run `nx test experience-sdk-react` to execute the unit tests via [Jest](https://jestjs.io).
32
+ Run `nx test sdks-react` to execute the unit tests via [Jest](https://jestjs.io).
package/index.cjs CHANGED
@@ -32,6 +32,7 @@ const NinetailedProvider = props => {
32
32
  onLog,
33
33
  onError,
34
34
  buildClientContext,
35
+ onInitProfileId,
35
36
  componentViewTrackingThreshold,
36
37
  storageImpl
37
38
  } = props;
@@ -47,6 +48,7 @@ const NinetailedProvider = props => {
47
48
  onLog,
48
49
  onError,
49
50
  buildClientContext,
51
+ onInitProfileId,
50
52
  componentViewTrackingThreshold,
51
53
  storageImpl
52
54
  });
@@ -118,15 +120,6 @@ const useProfile = () => {
118
120
  }
119
121
  });
120
122
  }, []);
121
- /**
122
- * Old implementation without profile state deep comparison
123
- */
124
- /*useEffect(() => {
125
- return ninetailed.onProfileChange((profileState) => {
126
- console.log('profileState', profileState);
127
- setProfileState(profileState);
128
- });
129
- }, []);*/
130
123
  const profileStateWithoutExperiences = __rest(profileState, ["experiences"]);
131
124
  return Object.assign(Object.assign({}, profileStateWithoutExperiences), {
132
125
  loading: profileState.status === 'loading'
@@ -481,7 +474,6 @@ const Experience = _a => {
481
474
  unobserveElement,
482
475
  logger
483
476
  } = useNinetailed();
484
- // TODO we actually could hook into the experience hook here with the plugins
485
477
  const {
486
478
  status,
487
479
  hasVariants,
package/index.js CHANGED
@@ -24,6 +24,7 @@ const NinetailedProvider = props => {
24
24
  onLog,
25
25
  onError,
26
26
  buildClientContext,
27
+ onInitProfileId,
27
28
  componentViewTrackingThreshold,
28
29
  storageImpl
29
30
  } = props;
@@ -39,6 +40,7 @@ const NinetailedProvider = props => {
39
40
  onLog,
40
41
  onError,
41
42
  buildClientContext,
43
+ onInitProfileId,
42
44
  componentViewTrackingThreshold,
43
45
  storageImpl
44
46
  });
@@ -110,15 +112,6 @@ const useProfile = () => {
110
112
  }
111
113
  });
112
114
  }, []);
113
- /**
114
- * Old implementation without profile state deep comparison
115
- */
116
- /*useEffect(() => {
117
- return ninetailed.onProfileChange((profileState) => {
118
- console.log('profileState', profileState);
119
- setProfileState(profileState);
120
- });
121
- }, []);*/
122
115
  const profileStateWithoutExperiences = __rest(profileState, ["experiences"]);
123
116
  return Object.assign(Object.assign({}, profileStateWithoutExperiences), {
124
117
  loading: profileState.status === 'loading'
@@ -473,7 +466,6 @@ const Experience = _a => {
473
466
  unobserveElement,
474
467
  logger
475
468
  } = useNinetailed();
476
- // TODO we actually could hook into the experience hook here with the plugins
477
469
  const {
478
470
  status,
479
471
  hasVariants,
package/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "@ninetailed/experience.js-react",
3
- "version": "7.4.3",
3
+ "version": "7.5.0-beta.0",
4
4
  "peerDependencies": {
5
5
  "react": ">=16.8.0"
6
6
  },
7
+ "license": "BSL-1.1",
7
8
  "module": "./index.js",
8
9
  "main": "./index.cjs",
9
10
  "type": "module",
10
- "types": "./index.d.ts",
11
+ "types": "./src/index.d.ts",
11
12
  "dependencies": {
12
- "@ninetailed/experience.js": "7.4.3",
13
- "react-is": "18.2.0",
14
- "@ninetailed/experience.js-shared": "7.4.3",
13
+ "@ninetailed/experience.js": "7.5.0-beta.0",
14
+ "@ninetailed/experience.js-shared": "7.5.0-beta.0",
15
15
  "radash": "10.9.0",
16
- "react-intersection-observer": "8.34.0"
16
+ "react-intersection-observer": "8.34.0",
17
+ "react-is": "18.2.0"
17
18
  }
18
19
  }
@@ -14,6 +14,7 @@ export type NinetailedProviderInstantiationProps = {
14
14
  onError?: OnErrorHandler;
15
15
  componentViewTrackingThreshold?: number;
16
16
  buildClientContext?: () => NinetailedRequestContext;
17
+ onInitProfileId?: (profileId?: string) => string | undefined;
17
18
  storageImpl?: Storage;
18
19
  };
19
20
  export type NinetailedProviderProps = NinetailedProviderInstantiationProps | {
@@ -0,0 +1 @@
1
+ export declare const useNinetailed: () => import("dist/packages/sdks/javascript/src").NinetailedInstance;
@@ -1 +0,0 @@
1
- export declare const useNinetailed: () => import("@ninetailed/experience.js").NinetailedInstance;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes