obi-sdk 0.2.0 → 0.2.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.
@@ -13,6 +13,15 @@ function mountWidget() {
13
13
  function processQueue() {
14
14
  const w = window;
15
15
  if (w.ObiSDK && Array.isArray(w.ObiSDK.q)) {
16
+ w.ObiSDK.q.forEach((args) => {
17
+ const [command, config] = args;
18
+ if (command === "update" && config) {
19
+ w.obiWidgetConfig = {
20
+ ...w.obiWidgetConfig,
21
+ ...config
22
+ };
23
+ }
24
+ });
16
25
  w.ObiSDK.q = [];
17
26
  }
18
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/core/init.ts"],"sourcesContent":["import { ObiWidget } from \"../ui/components/obi-widget\"\n\nif (!customElements.get(\"obi-widget\")) {\n customElements.define(\"obi-widget\", ObiWidget)\n}\n\n// Mount the widget if not already present\nfunction mountWidget() {\n if (!document.querySelector(\"obi-widget\")) {\n const widget = document.createElement(\"obi-widget\")\n document.body.appendChild(widget)\n console.log(\"Obi Widget mounted\")\n }\n}\n\n// Optionally process a queue if you want to support it\nfunction processQueue() {\n const w = window as any\n if (w.ObiSDK && Array.isArray(w.ObiSDK.q)) {\n // ...process commands as needed...\n w.ObiSDK.q = []\n }\n}\n\n// Main init\nexport function initializeObiWidget() {\n mountWidget()\n processQueue()\n}\n\n// Auto-initialize\ninitializeObiWidget()\n"],"names":[],"mappings":";;AAEA,IAAI,CAAC,eAAe,IAAI,YAAY,GAAG;AACtB,iBAAA,OAAO,cAAc,SAAS;AAC/C;AAGA,SAAS,cAAc;AACrB,MAAI,CAAC,SAAS,cAAc,YAAY,GAAG;AACnC,UAAA,SAAS,SAAS,cAAc,YAAY;AACzC,aAAA,KAAK,YAAY,MAAM;AAChC,YAAQ,IAAI,oBAAoB;AAAA,EAClC;AACF;AAGA,SAAS,eAAe;AACtB,QAAM,IAAI;AACV,MAAI,EAAE,UAAU,MAAM,QAAQ,EAAE,OAAO,CAAC,GAAG;AAEvC,MAAA,OAAO,IAAI;EACf;AACF;AAGO,SAAS,sBAAsB;AACxB;AACC;AACf;AAGA,oBAAoB;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/core/init.ts"],"sourcesContent":["import { ObiWidget } from \"../ui/components/obi-widget\"\n\nif (!customElements.get(\"obi-widget\")) {\n customElements.define(\"obi-widget\", ObiWidget)\n}\n\n// Mount the widget if not already present\nfunction mountWidget() {\n if (!document.querySelector(\"obi-widget\")) {\n const widget = document.createElement(\"obi-widget\")\n document.body.appendChild(widget)\n console.log(\"Obi Widget mounted\")\n }\n}\n\n// Optionally process a queue if you want to support it\nfunction processQueue() {\n const w = window as any\n if (w.ObiSDK && Array.isArray(w.ObiSDK.q)) {\n // Process each command in the queue\n w.ObiSDK.q.forEach((args: any[]) => {\n const [command, config] = args\n if (command === \"update\" && config) {\n w.obiWidgetConfig = {\n ...w.obiWidgetConfig,\n ...config,\n }\n }\n })\n w.ObiSDK.q = []\n }\n}\n\n// Main init\nexport function initializeObiWidget() {\n mountWidget()\n processQueue()\n}\n\n// Auto-initialize\ninitializeObiWidget()\n"],"names":[],"mappings":";;AAEA,IAAI,CAAC,eAAe,IAAI,YAAY,GAAG;AACtB,iBAAA,OAAO,cAAc,SAAS;AAC/C;AAGA,SAAS,cAAc;AACrB,MAAI,CAAC,SAAS,cAAc,YAAY,GAAG;AACnC,UAAA,SAAS,SAAS,cAAc,YAAY;AACzC,aAAA,KAAK,YAAY,MAAM;AAChC,YAAQ,IAAI,oBAAoB;AAAA,EAClC;AACF;AAGA,SAAS,eAAe;AACtB,QAAM,IAAI;AACV,MAAI,EAAE,UAAU,MAAM,QAAQ,EAAE,OAAO,CAAC,GAAG;AAEzC,MAAE,OAAO,EAAE,QAAQ,CAAC,SAAgB;AAC5B,YAAA,CAAC,SAAS,MAAM,IAAI;AACtB,UAAA,YAAY,YAAY,QAAQ;AAClC,UAAE,kBAAkB;AAAA,UAClB,GAAG,EAAE;AAAA,UACL,GAAG;AAAA,QAAA;AAAA,MAEP;AAAA,IAAA,CACD;AACC,MAAA,OAAO,IAAI;EACf;AACF;AAGO,SAAS,sBAAsB;AACxB;AACC;AACf;AAGA,oBAAoB;"}
@@ -21057,7 +21057,13 @@ function Pm() {
21057
21057
  }
21058
21058
  function Rm() {
21059
21059
  const n = window;
21060
- n.ObiSDK && Array.isArray(n.ObiSDK.q) && (n.ObiSDK.q = []);
21060
+ n.ObiSDK && Array.isArray(n.ObiSDK.q) && (n.ObiSDK.q.forEach((e) => {
21061
+ const [t, i] = e;
21062
+ t === "update" && i && (n.obiWidgetConfig = {
21063
+ ...n.obiWidgetConfig,
21064
+ ...i
21065
+ });
21066
+ }), n.ObiSDK.q = []);
21061
21067
  }
21062
21068
  function xm() {
21063
21069
  Pm(), Rm();
@@ -554,5 +554,5 @@ var e=function(e){"use strict";const t=globalThis,i=t.ShadowRoot&&(void 0===t.Sh
554
554
  .pulse {
555
555
  animation: pulse-shadow 2s ease-in-out infinite;
556
556
  }
557
- `,up([he()],hp.prototype,"apiKey",2),up([he()],hp.prototype,"isActive",2),up([he()],hp.prototype,"position",2),up([he()],hp.prototype,"user",2),up([he()],hp.prototype,"state",2),up([he()],hp.prototype,"storedActiveState",2),up([he()],hp.prototype,"showCourseModal",2),up([he()],hp.prototype,"isHovering",2),up([he()],hp.prototype,"navVisible",2),up([he()],hp.prototype,"activeSession",2),up([he()],hp.prototype,"volume",2),customElements.get("obi-widget")||customElements.define("obi-widget",hp),customElements.get("obi-widget")||customElements.define("obi-widget",hp),function(){if(!document.querySelector("obi-widget")){const e=document.createElement("obi-widget");document.body.appendChild(e),console.log("Obi Widget mounted")}}(),function(){const e=window;e.ObiSDK&&Array.isArray(e.ObiSDK.q)&&(e.ObiSDK.q=[])}(),e.EventType=gh,e.ObiWidget=hp,e.SDKState=fh,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),e}({});
557
+ `,up([he()],hp.prototype,"apiKey",2),up([he()],hp.prototype,"isActive",2),up([he()],hp.prototype,"position",2),up([he()],hp.prototype,"user",2),up([he()],hp.prototype,"state",2),up([he()],hp.prototype,"storedActiveState",2),up([he()],hp.prototype,"showCourseModal",2),up([he()],hp.prototype,"isHovering",2),up([he()],hp.prototype,"navVisible",2),up([he()],hp.prototype,"activeSession",2),up([he()],hp.prototype,"volume",2),customElements.get("obi-widget")||customElements.define("obi-widget",hp),customElements.get("obi-widget")||customElements.define("obi-widget",hp),function(){if(!document.querySelector("obi-widget")){const e=document.createElement("obi-widget");document.body.appendChild(e),console.log("Obi Widget mounted")}}(),function(){const e=window;e.ObiSDK&&Array.isArray(e.ObiSDK.q)&&(e.ObiSDK.q.forEach((t=>{const[i,n]=t;"update"===i&&n&&(e.obiWidgetConfig={...e.obiWidgetConfig,...n})})),e.ObiSDK.q=[])}(),e.EventType=gh,e.ObiWidget=hp,e.SDKState=fh,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),e}({});
558
558
  //# sourceMappingURL=obi-sdk.standalone.iife.js.map