@go1/go1-embedding-react-sdk 0.0.36 → 0.0.38
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 +4 -3
- package/dist/README.md +4 -3
- package/dist/common/types.d.ts +4 -0
- package/dist/go1-embedding-react-sdk/src/index.js +13 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -108,6 +108,7 @@ export interface FeatureAttributesPreview extends FeatureAttributeCommon {
|
|
|
108
108
|
id: number;
|
|
109
109
|
startWith1Player?: boolean;
|
|
110
110
|
showFooter?: boolean;
|
|
111
|
+
contentRatingType?: 'no rating' | 'five star rating' | 'like rating';
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
/**
|
|
@@ -157,7 +158,6 @@ export type FeatureType =
|
|
|
157
158
|
export interface InitOptions {
|
|
158
159
|
/** Mandatory identifier for the embedded feature */
|
|
159
160
|
feature: FeatureType;
|
|
160
|
-
// eslint-disable-next-line max-len
|
|
161
161
|
/** Optional element id to search for, and use as the parent for the Go1 content view (use either this or `iframeParentElement`, not both) */
|
|
162
162
|
iframeParentId?: string;
|
|
163
163
|
/** Optional element to use as the parent for the Go1 content view (use either this or `iframeParentId`, not both) */
|
|
@@ -168,15 +168,16 @@ export interface InitOptions {
|
|
|
168
168
|
portalURL?: string;
|
|
169
169
|
/** Optional function that is invoked when the Go1 content view emits a message */
|
|
170
170
|
onGo1MessageReceived?: OnGo1MessageReceived;
|
|
171
|
-
// eslint-disable-next-line max-len
|
|
172
171
|
/** Optional end user information that can enhance the context and provide a better experience. No PII is needed, please do not send any. */
|
|
173
172
|
additionalUserInfo?: AdditionalUserInfo;
|
|
174
173
|
/** Optional UI configuration */
|
|
175
174
|
themeInformation?: ThemeInformation;
|
|
176
175
|
/** Optional token that is used to pre-authorize the user without them needing to log in */
|
|
177
176
|
oneTimeToken?: string;
|
|
178
|
-
/** Optional Id that let us know users are coming from
|
|
177
|
+
/** Optional Id that let us know which integration system users are coming from (will be required in the future)*/
|
|
179
178
|
integrationSystemId?: string;
|
|
179
|
+
/** Optional Id that let us know which integration system users are coming from, if using an intermediary system to embed */
|
|
180
|
+
presentingIntegrationSystemId?: string;
|
|
180
181
|
}
|
|
181
182
|
```
|
|
182
183
|
|
package/dist/README.md
CHANGED
|
@@ -108,6 +108,7 @@ export interface FeatureAttributesPreview extends FeatureAttributeCommon {
|
|
|
108
108
|
id: number;
|
|
109
109
|
startWith1Player?: boolean;
|
|
110
110
|
showFooter?: boolean;
|
|
111
|
+
contentRatingType?: 'no rating' | 'five star rating' | 'like rating';
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
/**
|
|
@@ -157,7 +158,6 @@ export type FeatureType =
|
|
|
157
158
|
export interface InitOptions {
|
|
158
159
|
/** Mandatory identifier for the embedded feature */
|
|
159
160
|
feature: FeatureType;
|
|
160
|
-
// eslint-disable-next-line max-len
|
|
161
161
|
/** Optional element id to search for, and use as the parent for the Go1 content view (use either this or `iframeParentElement`, not both) */
|
|
162
162
|
iframeParentId?: string;
|
|
163
163
|
/** Optional element to use as the parent for the Go1 content view (use either this or `iframeParentId`, not both) */
|
|
@@ -168,15 +168,16 @@ export interface InitOptions {
|
|
|
168
168
|
portalURL?: string;
|
|
169
169
|
/** Optional function that is invoked when the Go1 content view emits a message */
|
|
170
170
|
onGo1MessageReceived?: OnGo1MessageReceived;
|
|
171
|
-
// eslint-disable-next-line max-len
|
|
172
171
|
/** Optional end user information that can enhance the context and provide a better experience. No PII is needed, please do not send any. */
|
|
173
172
|
additionalUserInfo?: AdditionalUserInfo;
|
|
174
173
|
/** Optional UI configuration */
|
|
175
174
|
themeInformation?: ThemeInformation;
|
|
176
175
|
/** Optional token that is used to pre-authorize the user without them needing to log in */
|
|
177
176
|
oneTimeToken?: string;
|
|
178
|
-
/** Optional Id that let us know users are coming from
|
|
177
|
+
/** Optional Id that let us know which integration system users are coming from (will be required in the future)*/
|
|
179
178
|
integrationSystemId?: string;
|
|
179
|
+
/** Optional Id that let us know which integration system users are coming from, if using an intermediary system to embed */
|
|
180
|
+
presentingIntegrationSystemId?: string;
|
|
180
181
|
}
|
|
181
182
|
```
|
|
182
183
|
|
package/dist/common/types.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export interface AdditionalInfoMessage {
|
|
|
7
7
|
additionalUserInfo?: AdditionalUserInfo;
|
|
8
8
|
featureAttributes?: FeatureAttributes;
|
|
9
9
|
themeInformation?: ThemeInformation;
|
|
10
|
+
integrationSystemId?: string;
|
|
11
|
+
presentingIntegrationSystemId?: string;
|
|
10
12
|
}
|
|
11
13
|
export interface ThemeInformation {
|
|
12
14
|
accent: string;
|
|
@@ -24,6 +26,7 @@ export interface FeatureAttributeCommon {
|
|
|
24
26
|
interface FeatureAttributesPreviewCommon extends FeatureAttributeCommon {
|
|
25
27
|
startWith1Player?: boolean;
|
|
26
28
|
showFooter?: boolean;
|
|
29
|
+
contentRatingType?: 'no rating' | 'five star rating' | 'like rating';
|
|
27
30
|
}
|
|
28
31
|
export interface FeatureAttributesAIChat extends FeatureAttributesPreviewCommon {
|
|
29
32
|
intent?: 'skill_gap' | 'improve_skills' | 'next_role' | 'aspirations';
|
|
@@ -72,5 +75,6 @@ export interface InitOptions {
|
|
|
72
75
|
themeInformation?: ThemeInformation;
|
|
73
76
|
oneTimeToken?: string;
|
|
74
77
|
integrationSystemId?: string;
|
|
78
|
+
presentingIntegrationSystemId?: string;
|
|
75
79
|
}
|
|
76
80
|
export {};
|
|
@@ -6,7 +6,7 @@ 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, integrationSystemId, env = 'production', } = props;
|
|
9
|
+
const { feature, featureAttributes, portalURL, oneTimeToken, onGo1MessageReceived, additionalUserInfo, themeInformation, integrationSystemId, presentingIntegrationSystemId, env = 'production', } = props;
|
|
10
10
|
const iframeRef = (0, react_1.useRef)(null);
|
|
11
11
|
let url = 'https://embedding.go1.com';
|
|
12
12
|
if (env === 'staging') {
|
|
@@ -26,12 +26,9 @@ function useGo1ContentView(props) {
|
|
|
26
26
|
if (oneTimeToken) {
|
|
27
27
|
(0, params_1.addOneTimeToken)(iframeURL, oneTimeToken);
|
|
28
28
|
}
|
|
29
|
-
if (integrationSystemId) {
|
|
30
|
-
iframeURL.searchParams.append('integration_system_id', integrationSystemId);
|
|
31
|
-
}
|
|
32
29
|
const iframeID = `go1-iframe-${feature}`;
|
|
33
30
|
return { iframeURL, iframeID };
|
|
34
|
-
}, [url, feature, portalURL, oneTimeToken,
|
|
31
|
+
}, [url, feature, portalURL, oneTimeToken, env]);
|
|
35
32
|
const eventListenerInstance = (0, react_1.useCallback)((event) => {
|
|
36
33
|
const { _type, ...rest } = event.data;
|
|
37
34
|
if (_type === constants_1.GO1_MESSAGE) {
|
|
@@ -40,6 +37,8 @@ function useGo1ContentView(props) {
|
|
|
40
37
|
additionalUserInfo,
|
|
41
38
|
themeInformation,
|
|
42
39
|
featureAttributes,
|
|
40
|
+
integrationSystemId,
|
|
41
|
+
presentingIntegrationSystemId,
|
|
43
42
|
};
|
|
44
43
|
sendMessageToGo1({
|
|
45
44
|
type: 'set_additional_embedding_data',
|
|
@@ -52,7 +51,15 @@ function useGo1ContentView(props) {
|
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
|
-
}, [
|
|
54
|
+
}, [
|
|
55
|
+
additionalUserInfo,
|
|
56
|
+
themeInformation,
|
|
57
|
+
featureAttributes,
|
|
58
|
+
integrationSystemId,
|
|
59
|
+
presentingIntegrationSystemId,
|
|
60
|
+
sendMessageToGo1,
|
|
61
|
+
onGo1MessageReceived,
|
|
62
|
+
]);
|
|
56
63
|
(0, react_1.useEffect)(() => {
|
|
57
64
|
window.addEventListener('message', eventListenerInstance);
|
|
58
65
|
return () => {
|