obi-sdk 0.4.0 → 0.4.1
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/dist/modular/chunks/{obi-widget-9ef6796a.js → obi-widget-58dc98b0.js} +12 -19
- package/dist/modular/chunks/{obi-widget-9ef6796a.js.map → obi-widget-58dc98b0.js.map} +1 -1
- package/dist/modular/chunks/{types-82772f00.js → types-e0297e7b.js} +2 -2
- package/dist/modular/chunks/{types-82772f00.js.map → types-e0297e7b.js.map} +1 -1
- package/dist/modular/core.js +1 -1
- package/dist/modular/index.js +95 -14
- package/dist/modular/index.js.map +1 -1
- package/dist/modular/ui.js +11 -11
- package/dist/obi-sdk.es.js +110 -36
- package/dist/obi-sdk.es.js.map +1 -1
- package/dist/obi-sdk.standalone.iife.js +47 -46
- package/dist/obi-sdk.standalone.iife.js.map +1 -1
- package/dist/obi-sdk.umd.js +36 -35
- package/dist/obi-sdk.umd.js.map +1 -1
- package/dist/ui/components/session-start-modal.d.ts +0 -1
- package/index.d.ts +0 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as SDKState, E as EventEmitter, R as RoomEvent, T as Track, z as z$2, a as Room, A as API_BASE_URL, N as N$1 } from "./types-
|
|
1
|
+
import { S as SDKState, E as EventEmitter, R as RoomEvent, T as Track, z as z$2, a as Room, A as API_BASE_URL, N as N$1 } from "./types-e0297e7b.js";
|
|
2
2
|
const PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
3
3
|
function randomID() {
|
|
4
4
|
return Math.random().toString(36).slice(2, 11);
|
|
@@ -878,7 +878,6 @@ class ObiSession {
|
|
|
878
878
|
}
|
|
879
879
|
}
|
|
880
880
|
const SESSION_URL_PARAM = "49206C6F7665204F6269_session";
|
|
881
|
-
const API_KEY_URL_PARAM = "49206C6F7665204F6269_client";
|
|
882
881
|
var extendStatics = function(d2, b2) {
|
|
883
882
|
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
|
|
884
883
|
d3.__proto__ = b3;
|
|
@@ -11144,14 +11143,9 @@ class SessionStartModal extends i$1 {
|
|
|
11144
11143
|
this.onClose();
|
|
11145
11144
|
}
|
|
11146
11145
|
}
|
|
11147
|
-
handleBackdropClick(e2) {
|
|
11148
|
-
if (e2.target === e2.currentTarget) {
|
|
11149
|
-
this.handleClose();
|
|
11150
|
-
}
|
|
11151
|
-
}
|
|
11152
11146
|
render() {
|
|
11153
11147
|
return x`
|
|
11154
|
-
<div class="backdrop"
|
|
11148
|
+
<div class="backdrop"></div>
|
|
11155
11149
|
<div class="container">
|
|
11156
11150
|
<button class="close-button" @click=${this.handleClose}>×</button>
|
|
11157
11151
|
|
|
@@ -11188,11 +11182,12 @@ SessionStartModal.styles = i$4`
|
|
|
11188
11182
|
left: 50%;
|
|
11189
11183
|
transform: translate(-50%, -50%);
|
|
11190
11184
|
z-index: 50;
|
|
11185
|
+
gap: 32px;
|
|
11191
11186
|
|
|
11192
11187
|
/* Layout from user specifications */
|
|
11193
11188
|
display: flex;
|
|
11194
11189
|
width: 640px;
|
|
11195
|
-
height: 380px;
|
|
11190
|
+
min-height: 380px;
|
|
11196
11191
|
padding: 48px 48px 32px 48px;
|
|
11197
11192
|
flex-direction: column;
|
|
11198
11193
|
justify-content: space-between;
|
|
@@ -11246,15 +11241,15 @@ SessionStartModal.styles = i$4`
|
|
|
11246
11241
|
font-family: "Syne", sans-serif;
|
|
11247
11242
|
font-size: 32px;
|
|
11248
11243
|
font-weight: 700;
|
|
11249
|
-
margin: 32px 0 0 0;
|
|
11250
11244
|
color: #111827;
|
|
11245
|
+
margin: 0;
|
|
11251
11246
|
}
|
|
11252
11247
|
|
|
11253
11248
|
.subtitle {
|
|
11254
11249
|
font-size: 16px;
|
|
11255
11250
|
color: #6b7280;
|
|
11256
|
-
margin: 16px 0 0 0;
|
|
11257
11251
|
line-height: 1.5;
|
|
11252
|
+
margin: 0;
|
|
11258
11253
|
}
|
|
11259
11254
|
|
|
11260
11255
|
.button {
|
|
@@ -11384,6 +11379,7 @@ class ObiWidget extends i$1 {
|
|
|
11384
11379
|
name: sessionWithPlan.onboarding_plan?.name || "",
|
|
11385
11380
|
description: sessionWithPlan.onboarding_plan?.description || ""
|
|
11386
11381
|
};
|
|
11382
|
+
this.state = SDKState.LOADING;
|
|
11387
11383
|
this.showSessionStartModal = true;
|
|
11388
11384
|
} else {
|
|
11389
11385
|
console.log("No session found with token:", sessionToken);
|
|
@@ -11423,7 +11419,6 @@ class ObiWidget extends i$1 {
|
|
|
11423
11419
|
removeSessionUrlParams() {
|
|
11424
11420
|
const url = new URL(window.location.href);
|
|
11425
11421
|
url.searchParams.delete(SESSION_URL_PARAM);
|
|
11426
|
-
url.searchParams.delete(API_KEY_URL_PARAM);
|
|
11427
11422
|
window.history.replaceState({}, "", url.toString());
|
|
11428
11423
|
try {
|
|
11429
11424
|
localStorage.removeItem(WIDGET_PARAMS_KEY);
|
|
@@ -11633,14 +11628,10 @@ class ObiWidget extends i$1 {
|
|
|
11633
11628
|
});
|
|
11634
11629
|
}
|
|
11635
11630
|
const sessionId = storedParams[SESSION_URL_PARAM];
|
|
11636
|
-
const urlApiKey = storedParams[API_KEY_URL_PARAM];
|
|
11637
|
-
if (urlApiKey) {
|
|
11638
|
-
this.apiKey = urlApiKey;
|
|
11639
|
-
} else if (!this.apiKey && window.obiWidgetConfig?.apiKey) {
|
|
11640
|
-
this.apiKey = window.obiWidgetConfig.apiKey;
|
|
11641
|
-
}
|
|
11642
11631
|
if (sessionId && this.apiKey) {
|
|
11643
11632
|
await this.handleUrlSessionEvent(sessionId);
|
|
11633
|
+
} else {
|
|
11634
|
+
console.log("No session ID found or API key is not set");
|
|
11644
11635
|
}
|
|
11645
11636
|
}
|
|
11646
11637
|
}
|
|
@@ -11766,6 +11757,8 @@ class ObiWidget extends i$1 {
|
|
|
11766
11757
|
.onClose=${() => {
|
|
11767
11758
|
this.showSessionStartModal = false;
|
|
11768
11759
|
this.selectedCourse = null;
|
|
11760
|
+
this.state = SDKState.READY;
|
|
11761
|
+
this.removeSessionUrlParams();
|
|
11769
11762
|
}}
|
|
11770
11763
|
></obi-session-start-modal>` : E}
|
|
11771
11764
|
`;
|
|
@@ -11963,4 +11956,4 @@ export {
|
|
|
11963
11956
|
searchingLoader as s,
|
|
11964
11957
|
x
|
|
11965
11958
|
};
|
|
11966
|
-
//# sourceMappingURL=obi-widget-
|
|
11959
|
+
//# sourceMappingURL=obi-widget-58dc98b0.js.map
|