@blueking/monitor-apm-log 2.3.24 → 2.3.25

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.
Files changed (2) hide show
  1. package/main.js +16 -10
  2. package/package.json +1 -1
package/main.js CHANGED
@@ -115745,13 +115745,6 @@ class TaskEventManager {
115745
115745
  }
115746
115746
  const taskEventManager = new TaskEventManager();
115747
115747
  class UseSegmentProp {
115748
- /**
115749
- * 全局实例递增计数器。
115750
- * 同一页面可能同时加载多个检索包(例如 apm + trace),它们会共享 document.body。
115751
- * 这里通过递增计数为每个 UseSegmentProp 实例生成稳定且唯一的 owner id,
115752
- * 用于隔离弹层 DOM 的查询与复用,避免“后加载包误复用先加载包节点”。
115753
- */
115754
- static instanceCounter = 0;
115755
115748
  className = 'bklog-segment-pop-content';
115756
115749
  wrapperClassName = 'bklog-pop-wrapper';
115757
115750
  wrapperIdName = 'bklog_pop_wrapper';
@@ -115764,6 +115757,20 @@ class UseSegmentProp {
115764
115757
  stopPropagation;
115765
115758
  aiBluekingEnabled;
115766
115759
  highlightEnabled;
115760
+ /**
115761
+ * 生成实例 owner id(跨 bundle 全局唯一)。
115762
+ *
115763
+ * 注意:APM 和 Trace 在宿主页里可能是两个独立构建产物,
115764
+ * 如果只使用“模块内 static 计数器”,每个 bundle 都会从 1 开始计数,
115765
+ * 最终产生同名 owner(例如都叫 segment-pop-1),依然会误复用对方节点。
115766
+ *
115767
+ * 这里把计数器提升到 window 级别,确保两个独立包共享同一计数空间。
115768
+ */
115769
+ static getNextInstanceId() {
115770
+ const nextCounter = (window.__BKLOG_SEGMENT_POP_COUNTER__ ?? 0) + 1;
115771
+ window.__BKLOG_SEGMENT_POP_COUNTER__ = nextCounter;
115772
+ return `segment-pop-${nextCounter}`;
115773
+ }
115767
115774
  constructor() {
115768
115775
  let {
115769
115776
  delineate = false,
@@ -115775,9 +115782,8 @@ class UseSegmentProp {
115775
115782
  const {
115776
115783
  $t
115777
115784
  } = use_locale();
115778
- // 生成实例唯一 owner,后续会写到 DOM data 属性中做精确定位。
115779
- UseSegmentProp.instanceCounter += 1;
115780
- this.instanceId = `segment-pop-${UseSegmentProp.instanceCounter}`;
115785
+ // 生成全局唯一 owner,后续会写到 DOM data 属性中做精确定位。
115786
+ this.instanceId = UseSegmentProp.getNextInstanceId();
115781
115787
  this.$t = $t;
115782
115788
  this.refContent = (0,external_vue_.ref)();
115783
115789
  this.delineate = delineate;
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@blueking/monitor-apm-log","version":"2.3.24","description":"","main":"main.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"MIT"}
1
+ {"name":"@blueking/monitor-apm-log","version":"2.3.25","description":"","main":"main.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":"","license":"MIT"}