bruce-models 2.5.7 → 2.5.8

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.
@@ -11449,20 +11449,30 @@
11449
11449
  const paramsId = exports.ObjectUtils.UId();
11450
11450
  window[paramsId] = pluginParams ? pluginParams : {};
11451
11451
  const disposeId = exports.ObjectUtils.UId();
11452
+ const elementId = exports.ObjectUtils.UId();
11452
11453
  let script = `
11453
11454
  function run() {
11454
11455
  ${fileContent}
11455
11456
 
11456
11457
  const paramsId = "${paramsId}";
11457
- const containerId = "${container ? container.id : ""}";
11458
+ const containerId = "${containerId}";
11458
11459
  let container;
11459
11460
  if (containerId) {
11460
- container = document.getElementById("${container === null || container === void 0 ? void 0 : container.id}");
11461
+ container = document.getElementById("${containerId}");
11461
11462
  }
11463
+
11464
+ let pluginHTML = null;
11465
+ if (container) {
11466
+ pluginHTML = document.createElement("div");
11467
+ pluginHTML.id = "${elementId}";
11468
+ container.appendChild(pluginHTML);
11469
+ }
11470
+
11462
11471
  {TEMPLATE_CODE}
11463
11472
  const params = window["${paramsId}"];
11464
11473
 
11465
11474
  window["${disposeId}"] = Run({
11475
+ element: pluginHTML,
11466
11476
  container: container,
11467
11477
  pluginParams: params
11468
11478
  });
@@ -11490,7 +11500,15 @@
11490
11500
  };
11491
11501
  }
11492
11502
  const callDispose = window[disposeId];
11493
- return () => callDispose();
11503
+ return () => {
11504
+ if (elementId) {
11505
+ const element = document.getElementById(elementId);
11506
+ if (element && element.parentElement) {
11507
+ element.parentElement.removeChild(element);
11508
+ }
11509
+ }
11510
+ callDispose();
11511
+ };
11494
11512
  }
11495
11513
  };
11496
11514
  });