@copilotkit/web-inspector 1.55.0-next.7 → 1.55.0-next.9

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/index.umd.js CHANGED
@@ -220,6 +220,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
220
220
  this.dockMode = "floating";
221
221
  this.previousBodyMargins = null;
222
222
  this.transitionTimeoutId = null;
223
+ this.bodyTransitionTimeoutIds = /* @__PURE__ */ new Set();
223
224
  this.pendingSelectedContext = null;
224
225
  this.autoAttachCore = true;
225
226
  this.attemptedAutoAttach = false;
@@ -968,7 +969,13 @@ ${argsString}</pre
968
969
  window.removeEventListener("resize", this.handleResize);
969
970
  window.removeEventListener("pointerdown", this.handleGlobalPointerDown);
970
971
  }
971
- this.removeDockStyles();
972
+ for (const id of this.bodyTransitionTimeoutIds) clearTimeout(id);
973
+ this.bodyTransitionTimeoutIds.clear();
974
+ if (this.transitionTimeoutId !== null) {
975
+ clearTimeout(this.transitionTimeoutId);
976
+ this.transitionTimeoutId = null;
977
+ }
978
+ this.removeDockStyles(true);
972
979
  this.detachFromCore();
973
980
  }
974
981
  firstUpdated() {
@@ -1355,13 +1362,17 @@ ${argsString}</pre
1355
1362
  };
1356
1363
  if (!this.isResizing && !skipTransition) document.body.style.transition = "margin 300ms ease";
1357
1364
  if (this.dockMode === "docked-left") document.body.style.marginLeft = `${this.contextState.window.size.width}px`;
1358
- if (!this.isResizing && !skipTransition) setTimeout(() => {
1359
- if (document.body) document.body.style.transition = "";
1360
- }, 300);
1365
+ if (!this.isResizing && !skipTransition) {
1366
+ const id = setTimeout(() => {
1367
+ this.bodyTransitionTimeoutIds.delete(id);
1368
+ if (typeof document !== "undefined" && document.body) document.body.style.transition = "";
1369
+ }, 300);
1370
+ this.bodyTransitionTimeoutIds.add(id);
1371
+ }
1361
1372
  }
1362
- removeDockStyles() {
1373
+ removeDockStyles(skipTransition = false) {
1363
1374
  if (typeof document === "undefined" || !document.body) return;
1364
- if (!this.isResizing) document.body.style.transition = "margin 300ms ease";
1375
+ if (!this.isResizing && !skipTransition) document.body.style.transition = "margin 300ms ease";
1365
1376
  if (this.previousBodyMargins) {
1366
1377
  document.body.style.marginLeft = this.previousBodyMargins.left;
1367
1378
  document.body.style.marginBottom = this.previousBodyMargins.bottom;
@@ -1370,9 +1381,13 @@ ${argsString}</pre
1370
1381
  document.body.style.marginLeft = "";
1371
1382
  document.body.style.marginBottom = "";
1372
1383
  }
1373
- setTimeout(() => {
1374
- if (document.body) document.body.style.transition = "";
1375
- }, 300);
1384
+ if (!skipTransition) {
1385
+ const id = setTimeout(() => {
1386
+ this.bodyTransitionTimeoutIds.delete(id);
1387
+ if (typeof document !== "undefined" && document.body) document.body.style.transition = "";
1388
+ }, 300);
1389
+ this.bodyTransitionTimeoutIds.add(id);
1390
+ } else document.body.style.transition = "";
1376
1391
  }
1377
1392
  updateHostTransform(context = this.activeContext) {
1378
1393
  if (context !== this.activeContext) return;