@ninetailed/experience.js-plugin-preview 4.0.0-beta.4 → 4.0.0-beta.6

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.
Files changed (3) hide show
  1. package/index.cjs +11 -4
  2. package/index.js +11 -4
  3. package/package.json +7 -7
package/index.cjs CHANGED
@@ -3186,6 +3186,13 @@ class NinetailedPreviewPlugin extends experience_jsPluginAnalytics.NinetailedPlu
3186
3186
  console.log(`You cannot activate an unkown audience (id: ${id}).`);
3187
3187
  return;
3188
3188
  }
3189
+ // When a audience is activated, they should show their natural state
3190
+ this.experiences.filter(experience => {
3191
+ var _b;
3192
+ return ((_b = experience.audience) === null || _b === void 0 ? void 0 : _b.id) === id;
3193
+ }).forEach(experience => {
3194
+ this.resetExperience(experience.id);
3195
+ });
3189
3196
  this.audienceOverwrites = Object.assign(Object.assign({}, this.audienceOverwrites), {
3190
3197
  [id]: true
3191
3198
  });
@@ -3196,10 +3203,6 @@ class NinetailedPreviewPlugin extends experience_jsPluginAnalytics.NinetailedPlu
3196
3203
  console.log(`You cannot deactivate an unkown audience (id: ${id}). How did you get it in the first place?`);
3197
3204
  return;
3198
3205
  }
3199
- this.audienceOverwrites = Object.assign(Object.assign({}, this.audienceOverwrites), {
3200
- [id]: false
3201
- });
3202
- this.onChange();
3203
3206
  // When a audience is deactivated, the normal state will be that the experience goes into the control
3204
3207
  this.experiences.filter(experience => {
3205
3208
  var _b;
@@ -3210,6 +3213,10 @@ class NinetailedPreviewPlugin extends experience_jsPluginAnalytics.NinetailedPlu
3210
3213
  variantIndex: 0
3211
3214
  });
3212
3215
  });
3216
+ this.audienceOverwrites = Object.assign(Object.assign({}, this.audienceOverwrites), {
3217
+ [id]: false
3218
+ });
3219
+ this.onChange();
3213
3220
  }
3214
3221
  resetAudience(id) {
3215
3222
  if (!this.isKnownAudience(id)) {
package/index.js CHANGED
@@ -3164,6 +3164,13 @@ class NinetailedPreviewPlugin extends NinetailedPlugin {
3164
3164
  console.log(`You cannot activate an unkown audience (id: ${id}).`);
3165
3165
  return;
3166
3166
  }
3167
+ // When a audience is activated, they should show their natural state
3168
+ this.experiences.filter(experience => {
3169
+ var _b;
3170
+ return ((_b = experience.audience) === null || _b === void 0 ? void 0 : _b.id) === id;
3171
+ }).forEach(experience => {
3172
+ this.resetExperience(experience.id);
3173
+ });
3167
3174
  this.audienceOverwrites = Object.assign(Object.assign({}, this.audienceOverwrites), {
3168
3175
  [id]: true
3169
3176
  });
@@ -3174,10 +3181,6 @@ class NinetailedPreviewPlugin extends NinetailedPlugin {
3174
3181
  console.log(`You cannot deactivate an unkown audience (id: ${id}). How did you get it in the first place?`);
3175
3182
  return;
3176
3183
  }
3177
- this.audienceOverwrites = Object.assign(Object.assign({}, this.audienceOverwrites), {
3178
- [id]: false
3179
- });
3180
- this.onChange();
3181
3184
  // When a audience is deactivated, the normal state will be that the experience goes into the control
3182
3185
  this.experiences.filter(experience => {
3183
3186
  var _b;
@@ -3188,6 +3191,10 @@ class NinetailedPreviewPlugin extends NinetailedPlugin {
3188
3191
  variantIndex: 0
3189
3192
  });
3190
3193
  });
3194
+ this.audienceOverwrites = Object.assign(Object.assign({}, this.audienceOverwrites), {
3195
+ [id]: false
3196
+ });
3197
+ this.onChange();
3191
3198
  }
3192
3199
  resetAudience(id) {
3193
3200
  if (!this.isKnownAudience(id)) {
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@ninetailed/experience.js-plugin-preview",
3
- "version": "4.0.0-beta.4",
3
+ "version": "4.0.0-beta.6",
4
4
  "module": "./index.js",
5
5
  "main": "./index.cjs",
6
6
  "type": "module",
7
7
  "types": "./index.d.ts",
8
8
  "dependencies": {
9
- "@ninetailed/experience.js-shared": "4.0.0-beta.4",
10
- "@ninetailed/experience.js": "4.0.0-beta.4",
11
- "@ninetailed/experience.js-plugin-analytics": "4.0.0-beta.4",
12
- "@ninetailed/experience.js-utils": "4.0.0-beta.3",
13
- "@ninetailed/experience.js-react": "4.0.0-beta.4",
14
- "@ninetailed/experience.js-preview-bridge": "4.0.0-beta.4",
9
+ "@ninetailed/experience.js-shared": "4.0.0-beta.6",
10
+ "@ninetailed/experience.js": "4.0.0-beta.6",
11
+ "@ninetailed/experience.js-plugin-analytics": "4.0.0-beta.6",
12
+ "@ninetailed/experience.js-utils": "4.0.0-beta.5",
13
+ "@ninetailed/experience.js-react": "4.0.0-beta.6",
14
+ "@ninetailed/experience.js-preview-bridge": "4.0.0-beta.6",
15
15
  "react": "18.2.0",
16
16
  "uuid": "9.0.0"
17
17
  },