@go1/go1-embedding-react-sdk 0.0.45 → 0.0.48

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
@@ -77,7 +77,8 @@ export type Go1MessageType =
77
77
  | 'search_filter_toggle'
78
78
  | 'pass_ott'
79
79
  | 'logout',
80
- | 'sync_content';
80
+ | 'sync_content'
81
+ | 'inter_feature_navigation';
81
82
 
82
83
  export interface Go1Message {
83
84
  type: Go1MessageType;
@@ -88,7 +89,6 @@ interface FeatureAttributeCommon {
88
89
  shouldSuppressPreview?: boolean;
89
90
  experience?: 'manager' | 'learner';
90
91
  shouldShowGo1FeedbackButton?: boolean;
91
- shouldShowSaveToPlaylistButton?: boolean;
92
92
  contentScope?: 'subscription' | 'library';
93
93
  }
94
94
 
@@ -136,13 +136,17 @@ export interface FeatureAttributesRetirement extends FeatureAttributeCommon {
136
136
  }
137
137
 
138
138
  export interface FeatureAttributesSearch extends FeatureAttributeCommon {}
139
+ export interface FeatureAttributesMyPlaylists extends FeatureAttributesPreviewCommon {
140
+ playlistId?: number; // If embedding my-playlists feature with playlistId, the app will initialise with the specified playlistId page.
141
+ }
139
142
 
140
143
  export type FeatureAttributes =
141
144
  | FeatureAttributesAIChat
142
145
  | FeatureAttributesPreview
143
146
  | FeatureAttributesWallet
144
147
  | FeatureAttributesLibrary
145
- | FeatureAttributesSearch;
148
+ | FeatureAttributesSearch
149
+ | FeatureAttributesMyPlaylists;
146
150
 
147
151
  export interface AdditionalUserInfo {
148
152
  jobTitle: string;
@@ -156,7 +160,8 @@ export type FeatureType =
156
160
  | 'search'
157
161
  | 'wallet'
158
162
  | 'content-retirement'
159
- | 'my-playlists';
163
+ | 'my-playlists'
164
+ | 'activity-feed';
160
165
 
161
166
  export interface InitOptions {
162
167
  /** Mandatory identifier for the embedded feature */
@@ -234,6 +239,8 @@ const { sendMessageToGo1, ContentView } = useGo1ContentView(options);
234
239
 
235
240
  Send a message to the Go1 content view. Useful to control the user experience when an event starts on your website and the Go1 content view needs to be aware of it (and potentially perform other actions - this is `feature` dependent.)
236
241
 
242
+ A currently supported message is `update_experience`, this will update the experience Feature Attribute. An example of its usage is below.
243
+
237
244
  ```typescript
238
245
  function sendMessageToGo1(message: Go1Message): void;
239
246
  ```
@@ -242,7 +249,8 @@ function sendMessageToGo1(message: Go1Message): void;
242
249
 
243
250
  ```typescript
244
251
  const message = {
245
- type: 'return_to_home_screen',
252
+ type: 'update_experience',
253
+ payload: { experience: 'learner' },
246
254
  };
247
255
  sendMessageToGo1(message);
248
256
  ```
package/dist/README.md CHANGED
@@ -77,7 +77,8 @@ export type Go1MessageType =
77
77
  | 'search_filter_toggle'
78
78
  | 'pass_ott'
79
79
  | 'logout',
80
- | 'sync_content';
80
+ | 'sync_content'
81
+ | 'inter_feature_navigation';
81
82
 
82
83
  export interface Go1Message {
83
84
  type: Go1MessageType;
@@ -88,7 +89,6 @@ interface FeatureAttributeCommon {
88
89
  shouldSuppressPreview?: boolean;
89
90
  experience?: 'manager' | 'learner';
90
91
  shouldShowGo1FeedbackButton?: boolean;
91
- shouldShowSaveToPlaylistButton?: boolean;
92
92
  contentScope?: 'subscription' | 'library';
93
93
  }
94
94
 
@@ -136,13 +136,17 @@ export interface FeatureAttributesRetirement extends FeatureAttributeCommon {
136
136
  }
137
137
 
138
138
  export interface FeatureAttributesSearch extends FeatureAttributeCommon {}
139
+ export interface FeatureAttributesMyPlaylists extends FeatureAttributesPreviewCommon {
140
+ playlistId?: number; // If embedding my-playlists feature with playlistId, the app will initialise with the specified playlistId page.
141
+ }
139
142
 
140
143
  export type FeatureAttributes =
141
144
  | FeatureAttributesAIChat
142
145
  | FeatureAttributesPreview
143
146
  | FeatureAttributesWallet
144
147
  | FeatureAttributesLibrary
145
- | FeatureAttributesSearch;
148
+ | FeatureAttributesSearch
149
+ | FeatureAttributesMyPlaylists;
146
150
 
147
151
  export interface AdditionalUserInfo {
148
152
  jobTitle: string;
@@ -156,7 +160,8 @@ export type FeatureType =
156
160
  | 'search'
157
161
  | 'wallet'
158
162
  | 'content-retirement'
159
- | 'my-playlists';
163
+ | 'my-playlists'
164
+ | 'activity-feed';
160
165
 
161
166
  export interface InitOptions {
162
167
  /** Mandatory identifier for the embedded feature */
@@ -234,6 +239,8 @@ const { sendMessageToGo1, ContentView } = useGo1ContentView(options);
234
239
 
235
240
  Send a message to the Go1 content view. Useful to control the user experience when an event starts on your website and the Go1 content view needs to be aware of it (and potentially perform other actions - this is `feature` dependent.)
236
241
 
242
+ A currently supported message is `update_experience`, this will update the experience Feature Attribute. An example of its usage is below.
243
+
237
244
  ```typescript
238
245
  function sendMessageToGo1(message: Go1Message): void;
239
246
  ```
@@ -242,7 +249,8 @@ function sendMessageToGo1(message: Go1Message): void;
242
249
 
243
250
  ```typescript
244
251
  const message = {
245
- type: 'return_to_home_screen',
252
+ type: 'update_experience',
253
+ payload: { experience: 'learner' },
246
254
  };
247
255
  sendMessageToGo1(message);
248
256
  ```
@@ -9,20 +9,21 @@ export interface AdditionalInfoMessage {
9
9
  themeInformation?: ThemeInformation;
10
10
  integrationSystemId?: string;
11
11
  presentingIntegrationSystemId?: string;
12
+ experience?: FeatureAttributes['experience'];
12
13
  }
13
14
  export interface ThemeInformation {
14
15
  accent: string;
15
16
  }
16
- export type Go1MessageType = 'preview_start_content' | 'preview_close' | 'preview_add_content_success' | 'preview_add_content_failure' | 'preview_remove_content_success' | 'preview_remove_content_failure' | 'parent_show_preview' | 'set_additional_embedding_data' | 'go1_app_initialised' | 'ott_required' | 'search_result_selected' | 'search_filter_toggle' | 'search_redirected' | 'pass_ott' | 'logout' | 'sync_content' | 'open_save_to_playlist_modal';
17
+ export type Go1MessageType = 'preview_start_content' | 'preview_close' | 'preview_add_content_success' | 'preview_add_content_failure' | 'preview_remove_content_success' | 'preview_remove_content_failure' | 'parent_show_preview' | 'set_additional_embedding_data' | 'go1_app_initialised' | 'ott_required' | 'search_result_selected' | 'search_filter_toggle' | 'search_redirected' | 'pass_ott' | 'logout' | 'sync_content' | 'open_save_to_playlist_modal' | 'update_experience' | 'inter_feature_navigation';
17
18
  export interface Go1Message {
18
19
  type: Go1MessageType;
19
20
  payload?: any;
20
21
  }
22
+ type go1OnlyEnabledFeatures = Array<'ai-chat' | 'library' | 'my-playlists' | 'search'>;
21
23
  export interface FeatureAttributeCommon {
22
24
  shouldSuppressPreview?: boolean;
23
25
  experience?: 'manager' | 'learner';
24
26
  shouldShowGo1FeedbackButton?: boolean;
25
- shouldShowSaveToPlaylistButton?: boolean;
26
27
  featureName?: string;
27
28
  contentScope?: 'subscription' | 'library';
28
29
  }
@@ -37,6 +38,8 @@ export interface FeatureAttributesAIChat extends FeatureAttributesPreviewCommon
37
38
  existingSkills?: string[];
38
39
  desiredSkills?: string[];
39
40
  desiredRole?: string;
41
+ go1OnlySaveToMyPlaylistsOverride?: boolean;
42
+ go1OnlyEnabledFeatures?: go1OnlyEnabledFeatures;
40
43
  }
41
44
  export interface FeatureAttributesPreview extends FeatureAttributesPreviewCommon {
42
45
  id: number;
@@ -52,20 +55,26 @@ export interface FeatureAttributesLearnerSearch extends FeatureAttributeCommon {
52
55
  export interface FeatureAttributesLibrary extends FeatureAttributesPreviewCommon, FeatureAttributesRetirement {
53
56
  libraryEmptyStateDescription?: string;
54
57
  shouldShowLibraryTabs?: boolean;
58
+ go1OnlyEnabledFeatures?: go1OnlyEnabledFeatures;
55
59
  }
56
60
  export interface FeatureAttributesRetirement extends FeatureAttributesPreviewCommon {
57
61
  shouldShowAlternativesSearchButton?: boolean;
58
62
  shouldShowNotificationEmailRegisterSwitch?: boolean;
59
63
  }
60
64
  export interface FeatureAttributesSearch extends FeatureAttributesPreviewCommon {
65
+ go1OnlyEnabledFeatures?: go1OnlyEnabledFeatures;
61
66
  }
62
67
  export interface FeatureAttributesContentHub extends FeatureAttributesPreviewCommon {
63
68
  }
64
- export type FeatureAttributes = FeatureAttributesAIChat | FeatureAttributesPreview | FeatureAttributesWallet | FeatureAttributesLibrary | FeatureAttributesSearch;
69
+ export interface FeatureAttributesMyPlaylists extends FeatureAttributesPreviewCommon {
70
+ playlistId?: number;
71
+ go1OnlyEnabledFeatures?: go1OnlyEnabledFeatures;
72
+ }
73
+ export type FeatureAttributes = FeatureAttributesAIChat | FeatureAttributesPreview | FeatureAttributesWallet | FeatureAttributesLibrary | FeatureAttributesSearch | FeatureAttributesMyPlaylists;
65
74
  export interface AdditionalUserInfo {
66
75
  jobTitle: string;
67
76
  }
68
- export declare const features: readonly ["ai-chat", "content-hub", "preview", "library", "search", "wallet", "content-retirement", "my-playlists"];
77
+ export declare const features: readonly ["ai-chat", "content-hub", "preview", "library", "search", "wallet", "content-retirement", "my-playlists", "activity-feed"];
69
78
  export type FeatureType = (typeof features)[number];
70
79
  export interface InitOptions {
71
80
  feature: FeatureType;
@@ -10,4 +10,5 @@ exports.features = [
10
10
  'wallet',
11
11
  'content-retirement',
12
12
  'my-playlists',
13
+ 'activity-feed',
13
14
  ];
@@ -19,7 +19,7 @@ function useGo1ContentView(props) {
19
19
  iframeRef.current?.contentWindow?.postMessage(message, url);
20
20
  }, [url]);
21
21
  let { iframeURL, iframeID } = (0, react_1.useMemo)(() => {
22
- let iframeURL = new URL(`${url}/${feature === 'my-playlists' ? 'my-playlists/own' : `${feature}`}`);
22
+ let iframeURL = new URL(`${url}/${feature}`);
23
23
  if (portalURL) {
24
24
  (0, params_1.addPortalURL)(iframeURL, portalURL, env);
25
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go1/go1-embedding-react-sdk",
3
- "version": "0.0.45",
3
+ "version": "0.0.48",
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": [