@ninetailed/experience.js-plugin-preview 7.14.0 → 7.15.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 CHANGED
@@ -157,7 +157,8 @@ class NinetailedPreviewPlugin extends experience_jsPluginAnalytics.NinetailedPlu
157
157
  ui: this.options.ui
158
158
  });
159
159
  this.bridge = PreviewBridge({
160
- url: this.options.url
160
+ url: this.options.url,
161
+ nonce: this.options.nonce
161
162
  });
162
163
  this.bridge.render(this.container.element);
163
164
  window.ninetailed = Object.assign({}, window.ninetailed, {
@@ -542,7 +543,11 @@ class NinetailedPreviewPlugin extends experience_jsPluginAnalytics.NinetailedPlu
542
543
  openExperienceEditor(experience) {
543
544
  if (this.onOpenExperienceEditor && typeof this.onOpenExperienceEditor === 'function') return this.onOpenExperienceEditor(experience);
544
545
  }
546
+ /**
547
+ * @deprecated This method will be removed in a future release. Use `openExperienceEditor` instead to see the experience insights.
548
+ */
545
549
  openExperienceAnalytics(experience) {
550
+ experience_jsShared.logger.warn('The `openExperienceAnalytics` method is deprecated and will be removed in a future release. Use `openExperienceEditor` instead to see the experience insights.');
546
551
  window.open(`https://app.ninetailed.io/${this.clientId}/${this.environment}/experiences/${experience.id}`, '_blank');
547
552
  }
548
553
  openAudienceEditor(audience) {
@@ -551,7 +556,7 @@ class NinetailedPreviewPlugin extends experience_jsPluginAnalytics.NinetailedPlu
551
556
  get pluginApi() {
552
557
  var _b;
553
558
  return {
554
- version: "7.14.0" ,
559
+ version: "7.15.0" ,
555
560
  open: this.open.bind(this),
556
561
  close: this.close.bind(this),
557
562
  toggle: this.toggle.bind(this),
package/index.esm.js CHANGED
@@ -128,7 +128,8 @@ class NinetailedPreviewPlugin extends NinetailedPlugin {
128
128
  ui: _this.options.ui
129
129
  });
130
130
  _this.bridge = PreviewBridge({
131
- url: _this.options.url
131
+ url: _this.options.url,
132
+ nonce: _this.options.nonce
132
133
  });
133
134
  _this.bridge.render(_this.container.element);
134
135
  window.ninetailed = Object.assign({}, window.ninetailed, {
@@ -527,7 +528,12 @@ class NinetailedPreviewPlugin extends NinetailedPlugin {
527
528
  openExperienceEditor(experience) {
528
529
  if (this.onOpenExperienceEditor && typeof this.onOpenExperienceEditor === 'function') return this.onOpenExperienceEditor(experience);
529
530
  }
531
+
532
+ /**
533
+ * @deprecated This method will be removed in a future release. Use `openExperienceEditor` instead to see the experience insights.
534
+ */
530
535
  openExperienceAnalytics(experience) {
536
+ logger.warn('The `openExperienceAnalytics` method is deprecated and will be removed in a future release. Use `openExperienceEditor` instead to see the experience insights.');
531
537
  window.open(`https://app.ninetailed.io/${this.clientId}/${this.environment}/experiences/${experience.id}`, '_blank');
532
538
  }
533
539
  openAudienceEditor(audience) {
@@ -536,7 +542,7 @@ class NinetailedPreviewPlugin extends NinetailedPlugin {
536
542
  get pluginApi() {
537
543
  var _this$profile;
538
544
  return {
539
- version: "7.14.0" ,
545
+ version: "7.15.0" ,
540
546
  open: this.open.bind(this),
541
547
  close: this.close.bind(this),
542
548
  toggle: this.toggle.bind(this),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ninetailed/experience.js-plugin-preview",
3
- "version": "7.14.0",
3
+ "version": "7.15.0",
4
4
  "description": "Ninetailed SDK plugin for preview",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -15,10 +15,10 @@
15
15
  "a/b testing"
16
16
  ],
17
17
  "dependencies": {
18
- "@ninetailed/experience.js-shared": "7.14.0",
19
- "@ninetailed/experience.js": "7.14.0",
20
- "@ninetailed/experience.js-preview-bridge": "7.14.0",
21
- "@ninetailed/experience.js-plugin-analytics": "7.14.0"
18
+ "@ninetailed/experience.js-shared": "7.15.0",
19
+ "@ninetailed/experience.js": "7.15.0",
20
+ "@ninetailed/experience.js-preview-bridge": "7.15.0",
21
+ "@ninetailed/experience.js-plugin-analytics": "7.15.0"
22
22
  },
23
23
  "module": "./index.esm.js",
24
24
  "main": "./index.cjs.js"
@@ -1,23 +1,18 @@
1
1
  import { Reference, AllowedVariableType } from '@ninetailed/experience.js-shared';
2
2
  import { ExperienceConfiguration, PROFILE_CHANGE, HasExperienceSelectionMiddleware, BuildExperienceSelectionMiddleware, HasChangesModificationMiddleware, BuildChangesModificationMiddleware, type ProfileChangedPayload, type InterestedInProfileChange } from '@ninetailed/experience.js';
3
- import type { ExposedAudienceDefinition } from '@ninetailed/experience.js-preview-bridge';
3
+ import type { ExposedAudienceDefinition, PreviewBridgeOptions } from '@ninetailed/experience.js-preview-bridge';
4
4
  import { type EventHandler, NinetailedPlugin } from '@ninetailed/experience.js-plugin-analytics';
5
+ import { WidgetContainerOptions } from './WidgetContainer';
5
6
  export declare const NINETAILED_PREVIEW_EVENTS: {
6
7
  previewAudiences: string;
7
8
  previewTraits: string;
8
9
  };
9
10
  type NinetailedPreviewPluginOptions = {
10
- url?: string;
11
11
  experiences: ExperienceConfiguration[];
12
12
  audiences: ExposedAudienceDefinition[];
13
13
  onOpenExperienceEditor?: (experience: ExperienceConfiguration) => void;
14
14
  onOpenAudienceEditor?: (audience: ExposedAudienceDefinition) => void;
15
- ui?: {
16
- opener?: {
17
- hide: boolean;
18
- };
19
- };
20
- };
15
+ } & PreviewBridgeOptions & WidgetContainerOptions;
21
16
  export declare class NinetailedPreviewPlugin extends NinetailedPlugin implements HasExperienceSelectionMiddleware<Reference, Reference>, HasChangesModificationMiddleware, InterestedInProfileChange {
22
17
  private readonly options;
23
18
  name: string;
@@ -72,6 +67,9 @@ export declare class NinetailedPreviewPlugin extends NinetailedPlugin implements
72
67
  }): void;
73
68
  getExperienceSelectionMiddleware: BuildExperienceSelectionMiddleware<Reference, Reference>;
74
69
  openExperienceEditor(experience: ExperienceConfiguration): void;
70
+ /**
71
+ * @deprecated This method will be removed in a future release. Use `openExperienceEditor` instead to see the experience insights.
72
+ */
75
73
  openExperienceAnalytics(experience: ExperienceConfiguration): void;
76
74
  openAudienceEditor(audience: ExposedAudienceDefinition): void;
77
75
  private get pluginApi();
@@ -1,4 +1,4 @@
1
- type WidgetContainerOptions = {
1
+ export type WidgetContainerOptions = {
2
2
  ui?: {
3
3
  opener?: {
4
4
  hide: boolean;
@@ -15,4 +15,3 @@ export declare class WidgetContainer {
15
15
  get element(): HTMLDivElement;
16
16
  static isContainerAttached(): boolean;
17
17
  }
18
- export {};