@oxog/devinspector 1.5.0 → 1.5.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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  generateId,
3
3
  parseStackFrame
4
- } from "./chunk-NP2SAIEA.js";
4
+ } from "./chunk-D4LKJXON.js";
5
5
 
6
6
  // src/monitors/error/error-tracker.ts
7
7
  function isInstance(value, name) {
@@ -396,4 +396,4 @@ var ErrorMonitor = class {
396
396
  export {
397
397
  ErrorMonitor
398
398
  };
399
- //# sourceMappingURL=error-monitor-AVTYBTS7.js.map
399
+ //# sourceMappingURL=error-monitor-I6H3VVLI.js.map
package/dist/index.cjs CHANGED
@@ -91,7 +91,7 @@ function throttle(func, wait, options = {}) {
91
91
  result = func.apply(thisArg, args);
92
92
  return result;
93
93
  };
94
- return function throttled(...args) {
94
+ const throttled = function(...args) {
95
95
  const now = Date.now();
96
96
  const remaining = wait - (now - lastCallTime);
97
97
  lastThis = this;
@@ -116,6 +116,14 @@ function throttle(func, wait, options = {}) {
116
116
  }
117
117
  return result;
118
118
  };
119
+ throttled.cancel = () => {
120
+ if (timeout) {
121
+ clearTimeout(timeout);
122
+ timeout = null;
123
+ }
124
+ lastArgs = lastThis = null;
125
+ };
126
+ return throttled;
119
127
  }
120
128
  function generateId() {
121
129
  return `${Date.now()}-${Math.random().toString(36).slice(2, 11)}`;
@@ -471,9 +479,10 @@ var init_xhr_interceptor = __esm({
471
479
  install() {
472
480
  if (this.installed || typeof XMLHttpRequest === "undefined") return;
473
481
  const self = this;
474
- XMLHttpRequest.prototype.open = function(method, url, async = true, username, password) {
482
+ XMLHttpRequest.prototype.open = function(...args) {
475
483
  var _a;
476
- const result = self.originalOpen.apply(this, [method, url, async, username, password]);
484
+ const result = self.originalOpen.apply(this, args);
485
+ const [method, url] = args;
477
486
  (_a = this._devinspectorCancel) == null ? void 0 : _a.call(this);
478
487
  this._devinspectorId = generateId();
479
488
  this._devinspectorMethod = method;
@@ -2076,7 +2085,9 @@ var init_performance_monitor = __esm({
2076
2085
  this.memoryMonitor = new MemoryMonitor(this.handleMemoryData.bind(this));
2077
2086
  this.metricsCollector = new MetricsCollector(this.handleMetrics.bind(this));
2078
2087
  this.longTaskDetector = new LongTaskDetector(this.handleLongTask.bind(this));
2079
- this.emitPerformanceData = throttle(this.emitPerformanceData.bind(this), 100);
2088
+ const throttledEmit = throttle(this.emitPerformanceData.bind(this), 100);
2089
+ this.emitPerformanceData = throttledEmit;
2090
+ this.cancelPendingEmit = throttledEmit.cancel;
2080
2091
  }
2081
2092
  start() {
2082
2093
  if (this.isActive) return;
@@ -2094,6 +2105,7 @@ var init_performance_monitor = __esm({
2094
2105
  this.memoryMonitor.stop();
2095
2106
  this.metricsCollector.stop();
2096
2107
  this.longTaskDetector.stop();
2108
+ this.cancelPendingEmit();
2097
2109
  this.isActive = false;
2098
2110
  }
2099
2111
  handleFPSData(data) {
@@ -4287,7 +4299,7 @@ var BasePlugin = class {
4287
4299
  };
4288
4300
 
4289
4301
  // src/version.ts
4290
- var VERSION = "1.5.0";
4302
+ var VERSION = "1.5.2";
4291
4303
 
4292
4304
  // src/enhanced-simple.ts
4293
4305
  var CONSOLE_METHODS = ["log", "info", "warn", "error", "debug"];
@@ -4536,7 +4548,7 @@ var _EnhancedDevInspector = class _EnhancedDevInspector {
4536
4548
  minimize() {
4537
4549
  if (!this.isEnabled) return;
4538
4550
  this.isMinimized = !this.isMinimized;
4539
- if (this.panel) this.panel.style.height = this.isMinimized ? "48px" : "650px";
4551
+ if (this.panel) this.panel.style.height = this.isMinimized ? "auto" : "650px";
4540
4552
  this.render();
4541
4553
  this.events.emit("inspector:minimize", this.isMinimized);
4542
4554
  }