@ninetailed/experience.js-plugin-preview 7.4.3 → 7.5.0-beta.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/README.md CHANGED
@@ -1,7 +1,32 @@
1
- # experience-sdk-preview-experience-sdk-preview
1
+ # @ninetailed/experience.js-plugin-preview
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-plugin-preview"><img src="https://img.shields.io/npm/v/@ninetailed/experience.js-plugin-preview.svg" alt="NPM Version" /></a>
7
+ <a href="https://www.npmjs.com/package/@ninetailed/experience.js-plugin-preview"><img src="https://img.shields.io/npm/l/@ninetailed/experience.js-plugin-preview.svg" alt="Package License" /></a>
8
+ <a href="https://www.npmjs.com/package/@ninetailed/experience.js-plugin-preview"><img src="https://img.shields.io/npm/dm/@ninetailed/experience.js-plugin-preview.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 build plugins-preview` to build the library.
4
29
 
5
30
  ## Running unit tests
6
31
 
7
- Run `nx test experience-sdk-preview-experience-sdk-preview` to execute the unit tests via [Jest](https://jestjs.io).
32
+ Run `nx test plugins-preview` to execute the unit tests via [Jest](https://jestjs.io).
package/index.cjs CHANGED
@@ -283,15 +283,6 @@ class NinetailedPreviewPlugin extends experience_js.NinetailedPlugin {
283
283
  console.log(`You cannot deactivate an unkown audience (id: ${id}). How did you get it in the first place?`);
284
284
  return;
285
285
  }
286
- // // When a audience is deactivated, the normal state will be that the experience goes into the control
287
- // this.experiences
288
- // .filter((experience) => experience.audience?.id === id)
289
- // .forEach((experience) => {
290
- // this.setExperienceVariant({
291
- // experienceId: experience.id,
292
- // variantIndex: 0,
293
- // });
294
- // });
295
286
  this.experienceVariantIndexOverwrites = Object.entries(this.experienceVariantIndexOverwrites).filter(([key, _]) => {
296
287
  return !this.experiences.filter(experience => {
297
288
  var _b;
@@ -306,7 +297,6 @@ class NinetailedPreviewPlugin extends experience_js.NinetailedPlugin {
306
297
  [id]: false
307
298
  });
308
299
  this.onChange();
309
- // When a audience is deactivated, the normal state will be that the experience goes into the control
310
300
  this.experiences.filter(experience => {
311
301
  var _b;
312
302
  return ((_b = experience.audience) === null || _b === void 0 ? void 0 : _b.id) === id;
@@ -342,9 +332,7 @@ class NinetailedPreviewPlugin extends experience_js.NinetailedPlugin {
342
332
  console.log(`You cannot active a variant for an unknown experience (id: ${experienceId})`);
343
333
  return;
344
334
  }
345
- if (experience.audience &&
346
- // if the experience has no audience, it's a all visitors experience
347
- !this.activeAudiences.some(id => {
335
+ if (experience.audience && !this.activeAudiences.some(id => {
348
336
  var _b;
349
337
  return id === ((_b = experience.audience) === null || _b === void 0 ? void 0 : _b.id);
350
338
  })) {
package/index.js CHANGED
@@ -261,15 +261,6 @@ class NinetailedPreviewPlugin extends NinetailedPlugin {
261
261
  console.log(`You cannot deactivate an unkown audience (id: ${id}). How did you get it in the first place?`);
262
262
  return;
263
263
  }
264
- // // When a audience is deactivated, the normal state will be that the experience goes into the control
265
- // this.experiences
266
- // .filter((experience) => experience.audience?.id === id)
267
- // .forEach((experience) => {
268
- // this.setExperienceVariant({
269
- // experienceId: experience.id,
270
- // variantIndex: 0,
271
- // });
272
- // });
273
264
  this.experienceVariantIndexOverwrites = Object.entries(this.experienceVariantIndexOverwrites).filter(([key, _]) => {
274
265
  return !this.experiences.filter(experience => {
275
266
  var _b;
@@ -284,7 +275,6 @@ class NinetailedPreviewPlugin extends NinetailedPlugin {
284
275
  [id]: false
285
276
  });
286
277
  this.onChange();
287
- // When a audience is deactivated, the normal state will be that the experience goes into the control
288
278
  this.experiences.filter(experience => {
289
279
  var _b;
290
280
  return ((_b = experience.audience) === null || _b === void 0 ? void 0 : _b.id) === id;
@@ -320,9 +310,7 @@ class NinetailedPreviewPlugin extends NinetailedPlugin {
320
310
  console.log(`You cannot active a variant for an unknown experience (id: ${experienceId})`);
321
311
  return;
322
312
  }
323
- if (experience.audience &&
324
- // if the experience has no audience, it's a all visitors experience
325
- !this.activeAudiences.some(id => {
313
+ if (experience.audience && !this.activeAudiences.some(id => {
326
314
  var _b;
327
315
  return id === ((_b = experience.audience) === null || _b === void 0 ? void 0 : _b.id);
328
316
  })) {
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@ninetailed/experience.js-plugin-preview",
3
- "version": "7.4.3",
3
+ "version": "7.5.0-beta.1",
4
+ "license": "BSL-1.1",
4
5
  "module": "./index.js",
5
6
  "main": "./index.cjs",
6
7
  "type": "module",
7
- "types": "./index.d.ts",
8
+ "types": "./src/index.d.ts",
8
9
  "dependencies": {
9
- "@ninetailed/experience.js-shared": "7.4.3",
10
- "@ninetailed/experience.js": "7.4.3",
11
- "@ninetailed/experience.js-preview-bridge": "7.4.3"
10
+ "@ninetailed/experience.js": "7.5.0-beta.1",
11
+ "@ninetailed/experience.js-preview-bridge": "7.5.0-beta.1",
12
+ "@ninetailed/experience.js-shared": "7.5.0-beta.1"
12
13
  },
13
14
  "peerDependencies": {}
14
15
  }
File without changes
File without changes
File without changes
File without changes