@go1/go1-embedding-react-sdk 0.0.6 → 0.0.9

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,9 +49,11 @@ 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';
53
+
52
54
  interface Go1Message {
53
- type: string;
54
- payload?: any; //optional
55
+ type: Go1MessageType;
56
+ payload?: any;
55
57
  }
56
58
 
57
59
  interface ThemeInformation {
@@ -64,13 +66,21 @@ interface ThemeInformation {
64
66
  */
65
67
  export interface FeatureAttributesAIChat {
66
68
  experience: 'manager' | 'learner';
67
- intent?: 'skill_gap' | 'improve_skills' | 'next_role' | 'aspirational';
69
+ intent?: 'skill_gap' | 'improve_skills' | 'next_role' | 'aspirations';
68
70
  message?: string; // The desired message to start the chat, which will be shown to the user
69
71
  existingSkills?: string[]; // max items 7, any more are discarded
70
72
  desiredSkills?: string[]; // max items 7, any more are discarded
73
+ desiredRole?: string; // e.g. "Senior Account Manager"
74
+ }
75
+
76
+ /**
77
+ * Used to configure the `preview` feature
78
+ */
79
+ export interface FeatureAttributesPreview {
80
+ id: number
71
81
  }
72
82
 
73
- export type FeatureAttributes = FeatureAttributesAIChat
83
+ export type FeatureAttributes = FeatureAttributesAIChat | FeatureAttributesPreview;
74
84
 
75
85
  export interface AdditionalUserInfo {
76
86
  jobTitle: string;
package/dist/README.md CHANGED
@@ -49,9 +49,11 @@ 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';
53
+
52
54
  interface Go1Message {
53
- type: string;
54
- payload?: any; //optional
55
+ type: Go1MessageType;
56
+ payload?: any;
55
57
  }
56
58
 
57
59
  interface ThemeInformation {
@@ -64,13 +66,21 @@ interface ThemeInformation {
64
66
  */
65
67
  export interface FeatureAttributesAIChat {
66
68
  experience: 'manager' | 'learner';
67
- intent?: 'skill_gap' | 'improve_skills' | 'next_role' | 'aspirational';
69
+ intent?: 'skill_gap' | 'improve_skills' | 'next_role' | 'aspirations';
68
70
  message?: string; // The desired message to start the chat, which will be shown to the user
69
71
  existingSkills?: string[]; // max items 7, any more are discarded
70
72
  desiredSkills?: string[]; // max items 7, any more are discarded
73
+ desiredRole?: string; // e.g. "Senior Account Manager"
74
+ }
75
+
76
+ /**
77
+ * Used to configure the `preview` feature
78
+ */
79
+ export interface FeatureAttributesPreview {
80
+ id: number
71
81
  }
72
82
 
73
- export type FeatureAttributes = FeatureAttributesAIChat
83
+ export type FeatureAttributes = FeatureAttributesAIChat | FeatureAttributesPreview;
74
84
 
75
85
  export interface AdditionalUserInfo {
76
86
  jobTitle: string;
@@ -11,23 +11,28 @@ 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
15
  export interface Go1Message {
15
- type: string;
16
+ type: Go1MessageType;
16
17
  payload?: any;
17
18
  }
18
19
  export interface FeatureAttributesAIChat {
19
20
  experience: 'manager' | 'learner';
20
- intent?: 'skill_gap' | 'improve_skills' | 'next_role' | 'aspirational';
21
+ intent?: 'skill_gap' | 'improve_skills' | 'next_role' | 'aspirations';
21
22
  message?: string;
22
23
  existingSkills?: string[];
23
24
  desiredSkills?: string[];
25
+ desiredRole?: string;
24
26
  }
25
- export type FeatureAttributes = FeatureAttributesAIChat;
27
+ export interface FeatureAttributesPreview {
28
+ id: number;
29
+ }
30
+ export type FeatureAttributes = FeatureAttributesAIChat | FeatureAttributesPreview;
26
31
  export interface AdditionalUserInfo {
27
32
  jobTitle: string;
28
33
  }
29
34
  export interface InitOptions {
30
- feature: 'ai-chat' | 'content-hub' | 'preview';
35
+ feature: 'ai-chat' | 'content-hub' | 'preview' | 'library' | 'search';
31
36
  iframeParentId?: string;
32
37
  iframeParentElement?: HTMLElement;
33
38
  featureAttributes?: FeatureAttributes;
@@ -30,11 +30,11 @@ function useGo1ContentView(props) {
30
30
  let payload = {
31
31
  additionalUserInfo,
32
32
  themeInformation,
33
- featureAttributes
33
+ featureAttributes,
34
34
  };
35
35
  sendMessageToGo1({
36
36
  type: 'set_additional_embedding_data',
37
- payload
37
+ payload,
38
38
  });
39
39
  }
40
40
  else {
@@ -48,7 +48,7 @@ function useGo1ContentView(props) {
48
48
  sendMessageToGo1,
49
49
  onGo1MessageReceived,
50
50
  themeInformation,
51
- featureAttributes
51
+ featureAttributes,
52
52
  ]);
53
53
  (0, react_1.useEffect)(() => {
54
54
  window.addEventListener('message', eventListenerInstance);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go1/go1-embedding-react-sdk",
3
- "version": "0.0.6",
3
+ "version": "0.0.9",
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": [
@@ -20,10 +20,10 @@
20
20
  },
21
21
  "license": "ISC",
22
22
  "devDependencies": {
23
- "@testing-library/jest-dom": "5.16.5",
23
+ "@testing-library/jest-dom": "5.17.0",
24
24
  "@testing-library/react": "14.0.0",
25
25
  "@testing-library/user-event": "14.4.3",
26
- "jest": "^29.6.1",
26
+ "jest": "^29.6.2",
27
27
  "react": "18.2.0",
28
28
  "react-dom": "^18.2.0",
29
29
  "ts-jest": "^29.1.1",