@go1/go1-embedding-react-sdk 0.0.10 → 0.0.12

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
@@ -49,7 +49,15 @@ type OnGo1MessageReceived = (message: Go1Message) => void;
49
49
 
50
50
  type SendMessageToGo1 = (message: Go1Message) => void;
51
51
 
52
- type Go1MessageType = 'preview_start_content' | 'set_additional_embedding_data' | 'go1_app_initialised';
52
+ type Go1MessageType =
53
+ 'preview_start_content' |
54
+ 'preview_close' |
55
+ 'preview_add_content_success' |
56
+ 'preview_add_content_failure' |
57
+ 'preview_remove_content_success' |
58
+ 'preview_remove_content_failure' |
59
+ 'set_additional_embedding_data' |
60
+ 'go1_app_initialised';
53
61
 
54
62
  interface Go1Message {
55
63
  type: Go1MessageType;
@@ -77,7 +85,9 @@ export interface FeatureAttributesAIChat {
77
85
  * Used to configure the `preview` feature
78
86
  */
79
87
  export interface FeatureAttributesPreview {
80
- id: number
88
+ id: number;
89
+ experience?: 'manager' | 'learner';
90
+ uiConfig?: UIConfig;
81
91
  }
82
92
 
83
93
  export type FeatureAttributes = FeatureAttributesAIChat | FeatureAttributesPreview;
package/dist/README.md CHANGED
@@ -49,7 +49,15 @@ type OnGo1MessageReceived = (message: Go1Message) => void;
49
49
 
50
50
  type SendMessageToGo1 = (message: Go1Message) => void;
51
51
 
52
- type Go1MessageType = 'preview_start_content' | 'set_additional_embedding_data' | 'go1_app_initialised';
52
+ type Go1MessageType =
53
+ 'preview_start_content' |
54
+ 'preview_close' |
55
+ 'preview_add_content_success' |
56
+ 'preview_add_content_failure' |
57
+ 'preview_remove_content_success' |
58
+ 'preview_remove_content_failure' |
59
+ 'set_additional_embedding_data' |
60
+ 'go1_app_initialised';
53
61
 
54
62
  interface Go1Message {
55
63
  type: Go1MessageType;
@@ -77,7 +85,9 @@ export interface FeatureAttributesAIChat {
77
85
  * Used to configure the `preview` feature
78
86
  */
79
87
  export interface FeatureAttributesPreview {
80
- id: number
88
+ id: number;
89
+ experience?: 'manager' | 'learner';
90
+ uiConfig?: UIConfig;
81
91
  }
82
92
 
83
93
  export type FeatureAttributes = FeatureAttributesAIChat | FeatureAttributesPreview;
@@ -1,3 +1,3 @@
1
- export declare function addPortalURL(url: URL, portalURL: string, env?: 'qa' | 'prod'): void;
1
+ export declare function addPortalURL(url: URL, portalURL: string, env?: 'staging' | 'production'): void;
2
2
  export declare function addOneTimeToken(url: URL, oneTimeToken: string): void;
3
3
  export declare function isValidFeature(feature: string): boolean;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isValidFeature = exports.addOneTimeToken = exports.addPortalURL = void 0;
4
- function addPortalURL(url, portalURL, env = 'prod') {
4
+ function addPortalURL(url, portalURL, env = 'production') {
5
5
  let validPortalURL = /^(?=.{1,255}$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,245}[a-zA-Z0-9])?\.mygo1\.com$/;
6
- if (env === 'qa') {
6
+ if (env === 'staging') {
7
7
  validPortalURL = /^(?=.{1,255}$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,245}[a-zA-Z0-9])?\.qa\.go1\.cloud$/;
8
8
  }
9
9
  if (validPortalURL.test(portalURL)) {
@@ -11,7 +11,7 @@ export interface AdditionalInfoMessage {
11
11
  export interface ThemeInformation {
12
12
  accent: string;
13
13
  }
14
- export type Go1MessageType = 'preview_start_content' | 'set_additional_embedding_data' | 'go1_app_initialised';
14
+ export type Go1MessageType = 'preview_start_content' | 'preview_close' | 'preview_add_content_success' | 'preview_add_content_failure' | 'preview_remove_content_success' | 'preview_remove_content_failure' | 'set_additional_embedding_data' | 'go1_app_initialised';
15
15
  export interface Go1Message {
16
16
  type: Go1MessageType;
17
17
  payload?: any;
@@ -26,6 +26,7 @@ export interface FeatureAttributesAIChat {
26
26
  }
27
27
  export interface FeatureAttributesPreview {
28
28
  id: number;
29
+ experience?: 'manager' | 'learner';
29
30
  }
30
31
  export type FeatureAttributes = FeatureAttributesAIChat | FeatureAttributesPreview;
31
32
  export interface AdditionalUserInfo {
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { InitOptions, SendMessageToGo1 } from '../../common/types';
3
3
  export type ContentViewProps = Omit<InitOptions, 'iframeParentId' | 'iframeParentElement'>;
4
4
  type EnvProps = {
5
- env?: 'qa' | 'prod';
5
+ env?: 'staging' | 'production';
6
6
  };
7
7
  export declare function useGo1ContentView(props: ContentViewProps & EnvProps): {
8
8
  sendMessageToGo1: SendMessageToGo1;
@@ -6,10 +6,10 @@ const react_1 = require("react");
6
6
  const constants_1 = require("../../common/constants");
7
7
  const params_1 = require("../../common/params");
8
8
  function useGo1ContentView(props) {
9
- const { feature, featureAttributes, portalURL, oneTimeToken, onGo1MessageReceived, additionalUserInfo, themeInformation, env = 'prod', } = props;
9
+ const { feature, featureAttributes, portalURL, oneTimeToken, onGo1MessageReceived, additionalUserInfo, themeInformation, env = 'production', } = props;
10
10
  const iframeRef = (0, react_1.useRef)(null);
11
11
  let url = 'https://embedding.go1.com';
12
- if (env === 'qa') {
12
+ if (env === 'staging') {
13
13
  url = 'https://embedding.qa.go1.cloud';
14
14
  }
15
15
  if (!(0, params_1.isValidFeature)(feature)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go1/go1-embedding-react-sdk",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "A React library to embed Go1 content into your website.",
5
5
  "main": "dist/go1-embedding-react-sdk/src/index.js",
6
6
  "files": [