obi-sdk 0.3.9 → 0.3.10
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-d6306b0d.js → obi-widget-c60b2f9f.js} +2 -2
- package/dist/modular/chunks/{obi-widget-d6306b0d.js.map → obi-widget-c60b2f9f.js.map} +1 -1
- package/dist/modular/index.js +1 -1
- package/dist/modular/ui.js +10 -10
- package/dist/obi-sdk.es.js +10 -10
- package/dist/obi-sdk.standalone.iife.js +1 -1
- package/dist/obi-sdk.standalone.iife.js.map +1 -1
- package/dist/obi-sdk.umd.js +1 -1
- package/package.json +1 -1
package/dist/modular/index.js
CHANGED
package/dist/modular/ui.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { S as SDKState } from "./chunks/types-82772f00.js";
|
|
2
|
-
import { i, n, a as i$1, x } from "./chunks/obi-widget-
|
|
3
|
-
import { A, C, c, d, D, N, b, O, S } from "./chunks/obi-widget-
|
|
2
|
+
import { i, n, a as i$1, x } from "./chunks/obi-widget-c60b2f9f.js";
|
|
3
|
+
import { A, C, c, d, D, N, b, O, S } from "./chunks/obi-widget-c60b2f9f.js";
|
|
4
4
|
var __defProp$1 = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
6
6
|
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
@@ -227,14 +227,14 @@ const controlPanel = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.define
|
|
|
227
227
|
function defineCustomElements() {
|
|
228
228
|
Promise.resolve().then(() => statusWidget);
|
|
229
229
|
Promise.resolve().then(() => controlPanel);
|
|
230
|
-
import("./chunks/obi-widget-
|
|
231
|
-
import("./chunks/obi-widget-
|
|
232
|
-
import("./chunks/obi-widget-
|
|
233
|
-
import("./chunks/obi-widget-
|
|
234
|
-
import("./chunks/obi-widget-
|
|
235
|
-
import("./chunks/obi-widget-
|
|
236
|
-
import("./chunks/obi-widget-
|
|
237
|
-
import("./chunks/obi-widget-
|
|
230
|
+
import("./chunks/obi-widget-c60b2f9f.js").then((n2) => n2.o);
|
|
231
|
+
import("./chunks/obi-widget-c60b2f9f.js").then((n2) => n2.j);
|
|
232
|
+
import("./chunks/obi-widget-c60b2f9f.js").then((n2) => n2.k);
|
|
233
|
+
import("./chunks/obi-widget-c60b2f9f.js").then((n2) => n2.e);
|
|
234
|
+
import("./chunks/obi-widget-c60b2f9f.js").then((n2) => n2.f);
|
|
235
|
+
import("./chunks/obi-widget-c60b2f9f.js").then((n2) => n2.s);
|
|
236
|
+
import("./chunks/obi-widget-c60b2f9f.js").then((n2) => n2.g);
|
|
237
|
+
import("./chunks/obi-widget-c60b2f9f.js").then((n2) => n2.h);
|
|
238
238
|
}
|
|
239
239
|
export {
|
|
240
240
|
A as AudioEqualizer,
|
package/dist/obi-sdk.es.js
CHANGED
|
@@ -22464,18 +22464,18 @@ class MA extends HA {
|
|
|
22464
22464
|
this.onClose && this.onClose();
|
|
22465
22465
|
}
|
|
22466
22466
|
async fetchCourses() {
|
|
22467
|
-
var e
|
|
22467
|
+
var e;
|
|
22468
22468
|
try {
|
|
22469
22469
|
this.loading = !0;
|
|
22470
|
-
const
|
|
22471
|
-
id:
|
|
22472
|
-
name:
|
|
22473
|
-
description:
|
|
22474
|
-
imageSrc:
|
|
22475
|
-
}))).filter((
|
|
22476
|
-
this.courses = [...
|
|
22477
|
-
} catch (
|
|
22478
|
-
console.error("Fetch error:",
|
|
22470
|
+
const r = ((e = (await (await fetch(`${this.apiBaseUrl}/sessions?token=${this.apiKey}`)).json()).sessions) == null ? void 0 : e.map((s) => ({
|
|
22471
|
+
id: s.uuid,
|
|
22472
|
+
name: s.onboarding_plan.name,
|
|
22473
|
+
description: s.onboarding_plan.description,
|
|
22474
|
+
imageSrc: s.onboarding_plan.screen_url || "https://corproductionsydney-storagebucket5cb7c8ea-atg4gmftc6sk.s3.amazonaws.com/static/generic-course.png"
|
|
22475
|
+
}))).filter((s) => !!s.name);
|
|
22476
|
+
this.courses = [...r], this.requestUpdate();
|
|
22477
|
+
} catch (A) {
|
|
22478
|
+
console.error("Fetch error:", A), this.error = "Failed to fetch courses";
|
|
22479
22479
|
} finally {
|
|
22480
22480
|
this.loading = !1, this.requestUpdate();
|
|
22481
22481
|
}
|
|
@@ -240,7 +240,7 @@ var A=function(A){"use strict";const e="https://obi.getcor.io/api";function t(A)
|
|
|
240
240
|
.error {
|
|
241
241
|
color: #ef4444;
|
|
242
242
|
}
|
|
243
|
-
`,hB([Jf({type:Array})],pB.prototype,"courses",2),hB([Jf({type:Boolean})],pB.prototype,"loading",2),hB([Jf({type:String})],pB.prototype,"error",2),hB([Jf({type:Function})],pB.prototype,"onCourseSelect",2),customElements.get("obi-course")||customElements.define("obi-course",gB),customElements.get("obi-course-list")||customElements.define("obi-course-list",pB);var mB=Object.defineProperty,fB=Object.getOwnPropertyDescriptor,BB=(A,e,t,n)=>{for(var i,r=n>1?void 0:n?fB(e,t):e,s=A.length-1;s>=0;s--)(i=A[s])&&(r=(n?i(e,t,r):i(r))||r);return n&&r&&mB(e,t,r),r};class wB extends _f{constructor(){super(...arguments),this.courses=[],this.loading=!0,this.error="",this.apiKey="",this.apiBaseUrl=""}handleCourseSelect(A){this.onCourseSelect&&this.onCourseSelect(A.detail.id)}handleClose(){this.onClose&&this.onClose()}async fetchCourses(){try{this.loading=!0;const A=await fetch(`${this.apiBaseUrl}/sessions?token=${this.apiKey}`),e=await A.json(),t=e.sessions?.
|
|
243
|
+
`,hB([Jf({type:Array})],pB.prototype,"courses",2),hB([Jf({type:Boolean})],pB.prototype,"loading",2),hB([Jf({type:String})],pB.prototype,"error",2),hB([Jf({type:Function})],pB.prototype,"onCourseSelect",2),customElements.get("obi-course")||customElements.define("obi-course",gB),customElements.get("obi-course-list")||customElements.define("obi-course-list",pB);var mB=Object.defineProperty,fB=Object.getOwnPropertyDescriptor,BB=(A,e,t,n)=>{for(var i,r=n>1?void 0:n?fB(e,t):e,s=A.length-1;s>=0;s--)(i=A[s])&&(r=(n?i(e,t,r):i(r))||r);return n&&r&&mB(e,t,r),r};class wB extends _f{constructor(){super(...arguments),this.courses=[],this.loading=!0,this.error="",this.apiKey="",this.apiBaseUrl=""}handleCourseSelect(A){this.onCourseSelect&&this.onCourseSelect(A.detail.id)}handleClose(){this.onClose&&this.onClose()}async fetchCourses(){try{this.loading=!0;const A=await fetch(`${this.apiBaseUrl}/sessions?token=${this.apiKey}`),e=await A.json(),t=e.sessions?.map((A=>({id:A.uuid,name:A.onboarding_plan.name,description:A.onboarding_plan.description,imageSrc:A.onboarding_plan.screen_url||"https://corproductionsydney-storagebucket5cb7c8ea-atg4gmftc6sk.s3.amazonaws.com/static/generic-course.png"}))),n=t.filter((A=>!!A.name));this.courses=[...n],this.requestUpdate()}catch(A){console.error("Fetch error:",A),this.error="Failed to fetch courses"}finally{this.loading=!1,this.requestUpdate()}}connectedCallback(){super.connectedCallback(),window.obiWidgetConfig?.apiKey&&(this.apiKey=window.obiWidgetConfig.apiKey),this.apiBaseUrl=e,this.apiBaseUrl&&this.apiKey?this.fetchCourses():(this.loading=!1,this.error="API base URL or API key is missing")}render(){return Qf`
|
|
244
244
|
<div class="backdrop" @click=${this.handleClose}></div>
|
|
245
245
|
<div class="container">
|
|
246
246
|
<button class="close-button" @click=${this.handleClose}>×</button>
|