@go1/go1-embedding-react-sdk 0.5.0 → 0.6.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/README.md CHANGED
@@ -51,12 +51,17 @@ export type SendMessageToGo1 = (message: Go1Message) => void;
51
51
 
52
52
  export type IframesMap = { [key: string]: HTMLIFrameElement };
53
53
 
54
- export interface AdditionalInfoMessage {
55
- additionalUserInfo?: AdditionalUserInfo;
56
- featureAttributes?: FeatureAttributes;
57
- themeInformation?: ThemeInformation;
54
+ export interface FeatureAttributeCommon {
55
+ shouldSuppressPreview?: boolean;
56
+ shouldSuppressOpeningPlayer?: boolean;
57
+ shouldShowSelectWelcomeModal?: boolean;
58
+ shouldSuppressBookmark?: boolean;
59
+ shouldSuppressPlaylistAdministration?: boolean;
60
+ shouldSuppressShareLink?: boolean;
61
+ contentScope?: 'subscription' | 'library';
58
62
  }
59
63
 
64
+
60
65
  export interface ThemeInformation {
61
66
  /** Hex string, starting with a #. Example #0437F2 */
62
67
  accent: string;
@@ -84,18 +89,21 @@ export type Go1MessageType =
84
89
  | 'swap_out_open'
85
90
  | 'swap_out_close'
86
91
  | 'play_content'
87
- | 'go1pay_custom_data';
92
+ | 'library_content_added';
88
93
 
89
94
  export interface Go1Message {
90
95
  type: Go1MessageType;
91
96
  payload?: any;
92
97
  }
93
98
 
94
- export type Experience = 'manager' | 'learner' | 'role-aware'
95
99
 
96
- interface FeatureAttributeCommon {
100
+ export interface FeatureAttributeCommon {
97
101
  shouldSuppressPreview?: boolean;
98
- experience?: Experience; // Defaults to `manager`
102
+ shouldSuppressOpeningPlayer?: boolean;
103
+ shouldShowSelectWelcomeModal?: boolean;
104
+ shouldSuppressBookmark?: boolean;
105
+ shouldSuppressPlaylistAdministration?: boolean;
106
+ shouldSuppressShareLink?: boolean;
99
107
  contentScope?: 'subscription' | 'library';
100
108
  }
101
109
 
@@ -130,11 +138,6 @@ export interface FeatureAttributesWallet extends FeatureAttributeCommon {
130
138
  oneClickBuyUrl?: string;
131
139
  }
132
140
 
133
- export interface FeatureAttributesLearnerSearch extends FeatureAttributeCommon {
134
- isGo1MobileApp?: boolean;
135
- experience?: 'learner';
136
- }
137
-
138
141
  export interface FeatureAttributesLibrary extends FeatureAttributeCommon, FeatureAttributesRetirement {
139
142
  libraryEmptyStateDescription?: string;
140
143
  shouldShowLibraryTabs?: boolean;
@@ -154,7 +157,13 @@ export interface FeatureAttributesMyPlaylists extends FeatureAttributesPreviewCo
154
157
 
155
158
  export interface FeatureAttributesMyLearning extends FeatureAttributeCommon {}
156
159
 
157
- export interface FeatureAttributesGo1LearnSearch extends FeatureAttributeCommon {
160
+ export interface FeatureAttributesProspect {
161
+ isProspectExperience?: boolean;
162
+ }
163
+
164
+ export interface FeatureAttributesGo1LearnSearch
165
+ extends FeatureAttributeCommon,
166
+ FeatureAttributesProspect {
158
167
  searchTerm?: string; // If the embedding search feature includes a search term, the app will initialize with the pre-filled search term.
159
168
  searchProvider?: string; // If the embedding search feature includes a search provider, the app will initialize with the pre-filled search provider.
160
169
  }
@@ -184,13 +193,8 @@ export type FeatureType =
184
193
  | 'ai-chat'
185
194
  | 'content-hub'
186
195
  | 'preview'
187
- | 'library'
188
196
  | 'search'
189
- | 'wallet'
190
- | 'content-retirement'
191
- | 'my-playlists'
192
- | 'activity-feed'
193
- | 'my-learning';
197
+ | 'admin-curation';
194
198
 
195
199
  export interface InitOptions {
196
200
  /** Mandatory identifier for the embedded feature */
@@ -209,8 +213,10 @@ export interface InitOptions {
209
213
  additionalUserInfo?: AdditionalUserInfo;
210
214
  /** Optional UI configuration */
211
215
  themeInformation?: ThemeInformation;
212
- /** Optional token that is used to pre-authorize the user without them needing to log in */
216
+ /** Optional one time token that is used to pre-authorize the user without them needing to log in */
213
217
  oneTimeToken?: string;
218
+ /** Optional OAuth token that is used to pre-authorize the user without them needing to log in */
219
+ accessToken?: string;
214
220
  /** Optional Id that let us know which integration system users are coming from (will be required in the future)*/
215
221
  integrationSystemId?: string;
216
222
  /** Optional Id that let us know which integration system users are coming from, if using an intermediary system to embed */
@@ -245,7 +251,7 @@ const options = useMemo<ContentViewProps>(() => {
245
251
  feature: 'ai-chat',
246
252
  portalURL: 'learning-incorporated-usa.mygo1.com',
247
253
  featureAttributes: {
248
- experience: 'manager',
254
+ shouldSuppressShareLink: true,
249
255
  },
250
256
  onGo1MessageReceived,
251
257
  additionalUserInfo: {
@@ -268,7 +274,7 @@ const { sendMessageToGo1, ContentView } = useGo1ContentView(options);
268
274
 
269
275
  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.)
270
276
 
271
- A currently supported message is `update_experience`, this will update the experience Feature Attribute. An example of its usage is below.
277
+ An example of its usage is below.
272
278
 
273
279
  ```typescript
274
280
  function sendMessageToGo1(message: Go1Message): void;
@@ -278,8 +284,8 @@ function sendMessageToGo1(message: Go1Message): void;
278
284
 
279
285
  ```typescript
280
286
  const message = {
281
- type: 'update_experience',
282
- payload: { experience: 'learner' },
287
+ type: 'logout',
288
+ payload: {},
283
289
  };
284
290
  sendMessageToGo1(message);
285
291
  ```
@@ -317,7 +323,8 @@ Item has been added to the library
317
323
  {
318
324
  "type": "library_content_added",
319
325
  "payload": {
320
- "id": "3510462"
326
+ "id": "3510462",
327
+ "type": "lo"
321
328
  }
322
329
  }
323
330
  ```
package/dist/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @go1/go1-embedding-react-sdk
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - - Adding isProspectExperience to featureAttributes. Allowing partners to use the Prospect experience
8
+
3
9
  ## 0.5.0
4
10
 
5
11
  ### Minor Changes
package/dist/README.md CHANGED
@@ -51,12 +51,17 @@ export type SendMessageToGo1 = (message: Go1Message) => void;
51
51
 
52
52
  export type IframesMap = { [key: string]: HTMLIFrameElement };
53
53
 
54
- export interface AdditionalInfoMessage {
55
- additionalUserInfo?: AdditionalUserInfo;
56
- featureAttributes?: FeatureAttributes;
57
- themeInformation?: ThemeInformation;
54
+ export interface FeatureAttributeCommon {
55
+ shouldSuppressPreview?: boolean;
56
+ shouldSuppressOpeningPlayer?: boolean;
57
+ shouldShowSelectWelcomeModal?: boolean;
58
+ shouldSuppressBookmark?: boolean;
59
+ shouldSuppressPlaylistAdministration?: boolean;
60
+ shouldSuppressShareLink?: boolean;
61
+ contentScope?: 'subscription' | 'library';
58
62
  }
59
63
 
64
+
60
65
  export interface ThemeInformation {
61
66
  /** Hex string, starting with a #. Example #0437F2 */
62
67
  accent: string;
@@ -84,18 +89,21 @@ export type Go1MessageType =
84
89
  | 'swap_out_open'
85
90
  | 'swap_out_close'
86
91
  | 'play_content'
87
- | 'go1pay_custom_data';
92
+ | 'library_content_added';
88
93
 
89
94
  export interface Go1Message {
90
95
  type: Go1MessageType;
91
96
  payload?: any;
92
97
  }
93
98
 
94
- export type Experience = 'manager' | 'learner' | 'role-aware'
95
99
 
96
- interface FeatureAttributeCommon {
100
+ export interface FeatureAttributeCommon {
97
101
  shouldSuppressPreview?: boolean;
98
- experience?: Experience; // Defaults to `manager`
102
+ shouldSuppressOpeningPlayer?: boolean;
103
+ shouldShowSelectWelcomeModal?: boolean;
104
+ shouldSuppressBookmark?: boolean;
105
+ shouldSuppressPlaylistAdministration?: boolean;
106
+ shouldSuppressShareLink?: boolean;
99
107
  contentScope?: 'subscription' | 'library';
100
108
  }
101
109
 
@@ -130,11 +138,6 @@ export interface FeatureAttributesWallet extends FeatureAttributeCommon {
130
138
  oneClickBuyUrl?: string;
131
139
  }
132
140
 
133
- export interface FeatureAttributesLearnerSearch extends FeatureAttributeCommon {
134
- isGo1MobileApp?: boolean;
135
- experience?: 'learner';
136
- }
137
-
138
141
  export interface FeatureAttributesLibrary extends FeatureAttributeCommon, FeatureAttributesRetirement {
139
142
  libraryEmptyStateDescription?: string;
140
143
  shouldShowLibraryTabs?: boolean;
@@ -154,7 +157,13 @@ export interface FeatureAttributesMyPlaylists extends FeatureAttributesPreviewCo
154
157
 
155
158
  export interface FeatureAttributesMyLearning extends FeatureAttributeCommon {}
156
159
 
157
- export interface FeatureAttributesGo1LearnSearch extends FeatureAttributeCommon {
160
+ export interface FeatureAttributesProspect {
161
+ isProspectExperience?: boolean;
162
+ }
163
+
164
+ export interface FeatureAttributesGo1LearnSearch
165
+ extends FeatureAttributeCommon,
166
+ FeatureAttributesProspect {
158
167
  searchTerm?: string; // If the embedding search feature includes a search term, the app will initialize with the pre-filled search term.
159
168
  searchProvider?: string; // If the embedding search feature includes a search provider, the app will initialize with the pre-filled search provider.
160
169
  }
@@ -184,13 +193,8 @@ export type FeatureType =
184
193
  | 'ai-chat'
185
194
  | 'content-hub'
186
195
  | 'preview'
187
- | 'library'
188
196
  | 'search'
189
- | 'wallet'
190
- | 'content-retirement'
191
- | 'my-playlists'
192
- | 'activity-feed'
193
- | 'my-learning';
197
+ | 'admin-curation';
194
198
 
195
199
  export interface InitOptions {
196
200
  /** Mandatory identifier for the embedded feature */
@@ -209,8 +213,10 @@ export interface InitOptions {
209
213
  additionalUserInfo?: AdditionalUserInfo;
210
214
  /** Optional UI configuration */
211
215
  themeInformation?: ThemeInformation;
212
- /** Optional token that is used to pre-authorize the user without them needing to log in */
216
+ /** Optional one time token that is used to pre-authorize the user without them needing to log in */
213
217
  oneTimeToken?: string;
218
+ /** Optional OAuth token that is used to pre-authorize the user without them needing to log in */
219
+ accessToken?: string;
214
220
  /** Optional Id that let us know which integration system users are coming from (will be required in the future)*/
215
221
  integrationSystemId?: string;
216
222
  /** Optional Id that let us know which integration system users are coming from, if using an intermediary system to embed */
@@ -245,7 +251,7 @@ const options = useMemo<ContentViewProps>(() => {
245
251
  feature: 'ai-chat',
246
252
  portalURL: 'learning-incorporated-usa.mygo1.com',
247
253
  featureAttributes: {
248
- experience: 'manager',
254
+ shouldSuppressShareLink: true,
249
255
  },
250
256
  onGo1MessageReceived,
251
257
  additionalUserInfo: {
@@ -268,7 +274,7 @@ const { sendMessageToGo1, ContentView } = useGo1ContentView(options);
268
274
 
269
275
  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.)
270
276
 
271
- A currently supported message is `update_experience`, this will update the experience Feature Attribute. An example of its usage is below.
277
+ An example of its usage is below.
272
278
 
273
279
  ```typescript
274
280
  function sendMessageToGo1(message: Go1Message): void;
@@ -278,8 +284,8 @@ function sendMessageToGo1(message: Go1Message): void;
278
284
 
279
285
  ```typescript
280
286
  const message = {
281
- type: 'update_experience',
282
- payload: { experience: 'learner' },
287
+ type: 'logout',
288
+ payload: {},
283
289
  };
284
290
  sendMessageToGo1(message);
285
291
  ```
@@ -317,7 +323,8 @@ Item has been added to the library
317
323
  {
318
324
  "type": "library_content_added",
319
325
  "payload": {
320
- "id": "3510462"
326
+ "id": "3510462",
327
+ "type": "lo"
321
328
  }
322
329
  }
323
330
  ```
@@ -38,6 +38,7 @@ export interface FeatureAttributeCommon {
38
38
  shouldShowSelectWelcomeModal?: boolean;
39
39
  shouldSuppressBookmark?: boolean;
40
40
  shouldSuppressPlaylistAdministration?: boolean;
41
+ shouldSuppressShareLink?: boolean;
41
42
  experience?: ExternalExperience;
42
43
  contentScope?: 'subscription' | 'library';
43
44
  }
@@ -91,7 +92,10 @@ export interface FeatureAttributesMyPlaylists extends FeatureAttributesPreviewCo
91
92
  export interface FeatureAttributesMyLearning extends FeatureAttributeCommon {
92
93
  selectingTab?: 'saved' | 'in-progress' | 'assigned' | 'completed';
93
94
  }
94
- export interface FeatureAttributesGo1LearnSearch extends FeatureAttributeCommon {
95
+ export interface FeatureAttributesProspect {
96
+ isProspectExperience?: boolean;
97
+ }
98
+ export interface FeatureAttributesGo1LearnSearch extends FeatureAttributeCommon, FeatureAttributesProspect {
95
99
  searchTerm?: string;
96
100
  searchProvider?: string;
97
101
  }
@@ -106,7 +110,7 @@ export type FeatureAttributes = FeatureAttributesAIChat | FeatureAttributesPrevi
106
110
  export interface AdditionalUserInfo {
107
111
  jobTitle: string;
108
112
  }
109
- export declare const features: readonly ["auth-clients", "go1-learn/learner-content", "go1-learn/library", "go1-learn/my-learning", "go1-learn/search", "insights", "activity-feed", "ai-chat", "bulk-upload", "content-hub", "content-retirement", "content-status", "home", "library", "my-learning", "my-playlists", "partner-sales", "preview", "recommendations", "search", "wallet"];
113
+ export declare const features: readonly ["auth-clients", "go1-learn/library", "go1-learn/my-learning", "go1-learn/search", "admin-curation", "activity-feed", "ai-chat", "bulk-upload", "content-hub", "content-retirement", "content-status", "library", "my-learning", "my-playlists", "partner-sales", "preview", "recommendations", "search", "wallet"];
110
114
  export type FeatureType = (typeof features)[number];
111
115
  export interface InitOptions {
112
116
  feature: FeatureType;
@@ -3,18 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.features = void 0;
4
4
  exports.features = [
5
5
  'auth-clients',
6
- 'go1-learn/learner-content',
7
6
  'go1-learn/library',
8
7
  'go1-learn/my-learning',
9
8
  'go1-learn/search',
10
- 'insights',
9
+ 'admin-curation',
11
10
  'activity-feed',
12
11
  'ai-chat',
13
12
  'bulk-upload',
14
13
  'content-hub',
15
14
  'content-retirement',
16
15
  'content-status',
17
- 'home',
18
16
  'library',
19
17
  'my-learning',
20
18
  'my-playlists',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go1/go1-embedding-react-sdk",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
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": [
@@ -15,9 +15,6 @@
15
15
  "@go1/go1-embedding-js-sdk",
16
16
  "Go1"
17
17
  ],
18
- "scripts": {
19
- "test": "jest"
20
- },
21
18
  "license": "ISC",
22
19
  "devDependencies": {
23
20
  "@testing-library/jest-dom": "5.17.0",
@@ -31,5 +28,8 @@
31
28
  },
32
29
  "peerDependencies": {
33
30
  "react": ">=16.8"
31
+ },
32
+ "scripts": {
33
+ "test": "jest"
34
34
  }
35
- }
35
+ }