obi-sdk 0.4.1 → 0.4.2

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.
@@ -11155,7 +11155,7 @@ class SessionStartModal extends i$1 {
11155
11155
  <p class="subtitle">${this.session.description}</p>
11156
11156
  </div>
11157
11157
 
11158
- <button class="button button-primary" @click=${this.handleStart}>Continue →</button>
11158
+ <button class="button button-primary" @click=${this.handleStart}>Continue</button>
11159
11159
  </div>
11160
11160
  `;
11161
11161
  }
@@ -11164,6 +11164,7 @@ SessionStartModal.styles = i$4`
11164
11164
  :host {
11165
11165
  display: block;
11166
11166
  font-family: "Inter", sans-serif;
11167
+ box-sizing: border-box;
11167
11168
  }
11168
11169
 
11169
11170
  .backdrop {
@@ -11177,18 +11178,18 @@ SessionStartModal.styles = i$4`
11177
11178
  }
11178
11179
 
11179
11180
  .container {
11181
+ box-sizing: border-box;
11180
11182
  position: fixed;
11181
11183
  top: 50%;
11182
11184
  left: 50%;
11183
11185
  transform: translate(-50%, -50%);
11184
11186
  z-index: 50;
11185
- gap: 32px;
11186
11187
 
11187
11188
  /* Layout from user specifications */
11188
11189
  display: flex;
11189
11190
  width: 640px;
11190
11191
  min-height: 380px;
11191
- padding: 48px 48px 32px 48px;
11192
+ padding: 32px;
11192
11193
  flex-direction: column;
11193
11194
  justify-content: space-between;
11194
11195
  align-items: center;
@@ -11207,20 +11208,17 @@ SessionStartModal.styles = i$4`
11207
11208
  flex-direction: column;
11208
11209
  align-items: center;
11209
11210
  text-align: center;
11210
- gap: 16px;
11211
11211
  }
11212
11212
 
11213
11213
  .logo {
11214
11214
  display: flex;
11215
11215
  width: 96px;
11216
11216
  height: 96px;
11217
- padding: 8px;
11218
11217
  justify-content: center;
11219
11218
  align-items: center;
11220
- gap: 8px;
11221
11219
  aspect-ratio: 1/1;
11222
- border-radius: var(--border-radius-lg, 12px);
11223
- background: var(--tailwind-colors-violet-600, #7c3aed);
11220
+ border-radius: 8px;
11221
+ background: var(--obi-primary, #a10fff);
11224
11222
  box-shadow:
11225
11223
  0px 0px 8px 0px rgba(168, 85, 247, 0.12),
11226
11224
  0px 0px 8px 0px rgba(192, 132, 252, 0.24),
@@ -11238,32 +11236,36 @@ SessionStartModal.styles = i$4`
11238
11236
  }
11239
11237
 
11240
11238
  h1 {
11241
- font-family: "Syne", sans-serif;
11239
+ font-family: "Satoshi", sans-serif;
11242
11240
  font-size: 32px;
11243
11241
  font-weight: 700;
11244
11242
  color: #111827;
11245
11243
  margin: 0;
11244
+ margin-top: 32px;
11245
+ margin-bottom: 16px;
11246
11246
  }
11247
11247
 
11248
11248
  .subtitle {
11249
+ font-family: "Satoshi", sans-serif;
11250
+ font-weight: 300;
11249
11251
  font-size: 16px;
11250
- color: #6b7280;
11251
- line-height: 1.5;
11252
+ color: #18181b;
11253
+ line-height: 1.4;
11252
11254
  margin: 0;
11253
11255
  }
11254
11256
 
11255
11257
  .button {
11258
+ font-family: "Satoshi", sans-serif;
11259
+ font-weight: 400;
11260
+ font-size: 16px;
11256
11261
  padding: 12px 24px;
11257
11262
  border-radius: 8px;
11258
11263
  border: none;
11259
- font-size: 16px;
11260
- font-weight: 500;
11261
11264
  cursor: pointer;
11262
11265
  transition: all 0.2s ease;
11263
11266
  display: flex;
11264
11267
  align-items: center;
11265
11268
  justify-content: center;
11266
- gap: 8px;
11267
11269
  }
11268
11270
 
11269
11271
  .button-primary {
@@ -11287,21 +11289,19 @@ SessionStartModal.styles = i$4`
11287
11289
 
11288
11290
  .close-button {
11289
11291
  position: absolute;
11290
- top: 16px;
11292
+ top: 12px;
11291
11293
  right: 16px;
11292
11294
  background: none;
11293
11295
  border: none;
11294
11296
  cursor: pointer;
11295
11297
  font-size: 24px;
11296
11298
  color: #6b7280;
11297
- padding: 4px;
11298
- border-radius: 4px;
11299
- transition: all 0.2s ease;
11300
- }
11301
-
11302
- .close-button:hover {
11303
- color: #374151;
11304
- background: #f3f4f6;
11299
+ padding: 0;
11300
+ margin: 0;
11301
+ line-height: 1;
11302
+ display: inline-flex;
11303
+ align-items: center;
11304
+ justify-content: center;
11305
11305
  }
11306
11306
  `;
11307
11307
  __decorateClass$1([
@@ -11327,7 +11327,6 @@ var __decorateClass = (decorators, target, key, kind) => {
11327
11327
  __defProp(target, key, result);
11328
11328
  return result;
11329
11329
  };
11330
- const WIDGET_PARAMS_KEY = "io.obi.widget-parameters";
11331
11330
  class ObiWidget extends i$1 {
11332
11331
  constructor() {
11333
11332
  super();
@@ -11421,9 +11420,12 @@ class ObiWidget extends i$1 {
11421
11420
  url.searchParams.delete(SESSION_URL_PARAM);
11422
11421
  window.history.replaceState({}, "", url.toString());
11423
11422
  try {
11424
- localStorage.removeItem(WIDGET_PARAMS_KEY);
11423
+ if (window.__obiUrlParams) {
11424
+ ;
11425
+ window.__obiUrlParams = null;
11426
+ }
11425
11427
  } catch (error) {
11426
- console.warn("Failed to remove widget parameters from localStorage:", error);
11428
+ console.warn("Failed to clean up window URL parameters:", error);
11427
11429
  }
11428
11430
  }
11429
11431
  /**
@@ -11613,13 +11615,8 @@ class ObiWidget extends i$1 {
11613
11615
  await this.checkExistingSession();
11614
11616
  if (!this.activeSession) {
11615
11617
  let storedParams = {};
11616
- try {
11617
- const storedParamsJson = localStorage.getItem(WIDGET_PARAMS_KEY);
11618
- if (storedParamsJson) {
11619
- storedParams = JSON.parse(storedParamsJson);
11620
- }
11621
- } catch (error) {
11622
- console.warn("Failed to parse stored widget parameters:", error);
11618
+ if (window.__obiUrlParams) {
11619
+ storedParams = window.__obiUrlParams;
11623
11620
  }
11624
11621
  if (Object.keys(storedParams).length === 0) {
11625
11622
  const urlParams = new URLSearchParams(window.location.search);
@@ -11630,8 +11627,13 @@ class ObiWidget extends i$1 {
11630
11627
  const sessionId = storedParams[SESSION_URL_PARAM];
11631
11628
  if (sessionId && this.apiKey) {
11632
11629
  await this.handleUrlSessionEvent(sessionId);
11633
- } else {
11634
- console.log("No session ID found or API key is not set");
11630
+ } else if (sessionId && !this.apiKey) {
11631
+ console.log("Session ID found but API key not ready, retrying...");
11632
+ setTimeout(() => {
11633
+ if (this.apiKey) {
11634
+ this.handleUrlSessionEvent(sessionId);
11635
+ }
11636
+ }, 100);
11635
11637
  }
11636
11638
  }
11637
11639
  }
@@ -11642,7 +11644,17 @@ class ObiWidget extends i$1 {
11642
11644
  this.boundSaveSessionData = this.saveSessionData.bind(this);
11643
11645
  window.addEventListener("beforeunload", this.boundSaveSessionData);
11644
11646
  window.addEventListener("pagehide", this.boundSaveSessionData);
11645
- this.sessionConnectionCheck();
11647
+ if (document.readyState === "complete") {
11648
+ Promise.resolve().then(() => this.sessionConnectionCheck());
11649
+ } else {
11650
+ window.addEventListener(
11651
+ "load",
11652
+ () => {
11653
+ Promise.resolve().then(() => this.sessionConnectionCheck());
11654
+ },
11655
+ { once: true }
11656
+ );
11657
+ }
11646
11658
  }
11647
11659
  disconnectedCallback() {
11648
11660
  if (this.closeNavTimeoutRef !== null) {
@@ -11956,4 +11968,4 @@ export {
11956
11968
  searchingLoader as s,
11957
11969
  x
11958
11970
  };
11959
- //# sourceMappingURL=obi-widget-58dc98b0.js.map
11971
+ //# sourceMappingURL=obi-widget-2ba751b3.js.map