@antv/g-lite 1.3.0-next.14 → 1.3.0-next.16

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.js CHANGED
@@ -11668,16 +11668,7 @@ var entityCounter = 0;
11668
11668
  function resetEntityCounter() {
11669
11669
  entityCounter = 0;
11670
11670
  }
11671
- // const insertedEvent = new MutationEvent(
11672
- // ElementEvent.INSERTED,
11673
- // null,
11674
- // '',
11675
- // '',
11676
- // '',
11677
- // 0,
11678
- // '',
11679
- // '',
11680
- // );
11671
+ var insertedEvent = new MutationEvent(exports.ElementEvent.INSERTED, null, '', '', '', 0, '', '');
11681
11672
  var removedEvent = new MutationEvent(exports.ElementEvent.REMOVED, null, '', '', '', 0, '', '');
11682
11673
  var destroyEvent = new CustomEvent(exports.ElementEvent.DESTROY);
11683
11674
  /**
@@ -11917,8 +11908,11 @@ var Element = /** @class */ (function (_super) {
11917
11908
  if ((_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) {
11918
11909
  this.ownerDocument.defaultView.mountChildren(child);
11919
11910
  }
11920
- // insertedEvent.relatedNode = this as IElement;
11921
- // child.dispatchEvent(insertedEvent);
11911
+ // @ts-ignore
11912
+ if (this.isMutationObserved) {
11913
+ insertedEvent.relatedNode = this;
11914
+ child.dispatchEvent(insertedEvent);
11915
+ }
11922
11916
  return child;
11923
11917
  };
11924
11918
  Element.prototype.insertBefore = function (newChild, refChild) {
@@ -14733,6 +14727,7 @@ var PrepareRendererPlugin = /** @class */ (function () {
14733
14727
  }
14734
14728
  PrepareRendererPlugin.prototype.apply = function (context) {
14735
14729
  var _this = this;
14730
+ var _a;
14736
14731
  var renderingService = context.renderingService, renderingContext = context.renderingContext, rBushRoot = context.rBushRoot;
14737
14732
  var canvas = renderingContext.root.ownerDocument.defaultView;
14738
14733
  this.rBush = rBushRoot;
@@ -14791,11 +14786,12 @@ var PrepareRendererPlugin = /** @class */ (function () {
14791
14786
  canvas.removeEventListener(exports.ElementEvent.BOUNDS_CHANGED, handleBoundsChanged);
14792
14787
  _this.toSync.clear();
14793
14788
  });
14789
+ var ric = (_a = runtime.globalThis.requestIdleCallback) !== null && _a !== void 0 ? _a : raf.bind(runtime.globalThis);
14794
14790
  renderingService.hooks.endFrame.tap(PrepareRendererPlugin.tag, function () {
14795
14791
  if (_this.isFirstTimeRendering) {
14796
14792
  _this.isFirstTimeRendering = false;
14797
14793
  _this.syncing = true;
14798
- requestIdleCallback(function () {
14794
+ ric(function () {
14799
14795
  _this.syncRTree(true);
14800
14796
  });
14801
14797
  }