@visactor/vrender 1.0.0-alpha.6 → 1.0.0-alpha.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.
package/dist/index.js CHANGED
@@ -9163,12 +9163,13 @@
9163
9163
  this._emitCustomEvent("animate-bind", animate);
9164
9164
  }
9165
9165
  tryUpdateAABBBounds() {
9166
+ var _a, _b;
9166
9167
  const full = "imprecise" === this.attribute.boundsMode;
9167
9168
  if (!this.shouldUpdateAABBBounds()) return this._AABBBounds;
9168
9169
  if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
9169
- application.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
9170
+ null === (_a = this.stage) || void 0 === _a || _a.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
9170
9171
  const bounds = this.doUpdateAABBBounds(full);
9171
- return application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0), "empty" === this.attribute.boundsMode && bounds.clear(), bounds;
9172
+ return null === (_b = this.stage) || void 0 === _b || _b.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0), "empty" === this.attribute.boundsMode && bounds.clear(), bounds;
9172
9173
  }
9173
9174
  tryUpdateOBBBounds() {
9174
9175
  if (this._OBBBounds || (this._OBBBounds = new OBBBounds()), this.tryUpdateAABBBounds(), this.updateOBBBoundsStamp === this.updateAABBBoundsStamp) return this._OBBBounds;
@@ -9456,7 +9457,8 @@
9456
9457
  return this;
9457
9458
  }
9458
9459
  onAttributeUpdate(context) {
9459
- context && context.skipUpdateCallback || (application.graphicService.onAttributeUpdate(this), this._emitCustomEvent("afterAttributeUpdate", context));
9460
+ var _a;
9461
+ context && context.skipUpdateCallback || (null === (_a = this.stage) || void 0 === _a || _a.graphicService.onAttributeUpdate(this), this._emitCustomEvent("afterAttributeUpdate", context));
9460
9462
  }
9461
9463
  update(d) {
9462
9464
  d ? (d.bounds && this.tryUpdateAABBBounds(), d.trans && this.tryUpdateLocalTransMatrix()) : (this.tryUpdateAABBBounds(), this.tryUpdateLocalTransMatrix());
@@ -9643,6 +9645,7 @@
9643
9645
  }
9644
9646
  }
9645
9647
  setStage(stage, layer) {
9648
+ var _a;
9646
9649
  if (this.stage !== stage) {
9647
9650
  if (this.stage = stage, this.layer = layer, this.setStageToShadowRoot(stage, layer), this.animates && this.animates.size) {
9648
9651
  const timeline = stage.getTimeline();
@@ -9650,7 +9653,7 @@
9650
9653
  a.timeline.isGlobal && (a.setTimeline(timeline), timeline.addAnimate(a));
9651
9654
  });
9652
9655
  }
9653
- this._onSetStage && this._onSetStage(this, stage, layer), application.graphicService.onSetStage(this, stage);
9656
+ this._onSetStage && this._onSetStage(this, stage, layer), null === (_a = this.stage) || void 0 === _a || _a.graphicService.onSetStage(this, stage);
9654
9657
  }
9655
9658
  }
9656
9659
  setStageToShadowRoot(stage, layer) {
@@ -9798,11 +9801,12 @@
9798
9801
  return !!super.shouldUpdateAABBBounds() || !!(this._childUpdateTag & exports.UpdateTag.UPDATE_BOUNDS);
9799
9802
  }
9800
9803
  tryUpdateAABBBounds() {
9804
+ var _a, _b;
9801
9805
  if (!this.shouldUpdateAABBBounds()) return this._AABBBounds;
9802
- application.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
9806
+ null === (_a = this.stage) || void 0 === _a || _a.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
9803
9807
  const selfChange = this.shouldSelfChangeUpdateAABBBounds(),
9804
9808
  bounds = this.doUpdateAABBBounds();
9805
- return this.addUpdateLayoutTag(), application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, selfChange), "empty" === this.attribute.boundsMode && bounds.clear(), bounds;
9809
+ return this.addUpdateLayoutTag(), null === (_b = this.stage) || void 0 === _b || _b.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, selfChange), "empty" === this.attribute.boundsMode && bounds.clear(), bounds;
9806
9810
  }
9807
9811
  doUpdateLocalMatrix() {
9808
9812
  const {
@@ -9862,11 +9866,13 @@
9862
9866
  return this.theme.getTheme(this);
9863
9867
  }
9864
9868
  incrementalAppendChild(node) {
9869
+ var _a;
9865
9870
  const data = super.appendChild(node);
9866
- return this.stage && data && (data.stage = this.stage, data.layer = this.layer), this.addUpdateBoundTag(), application.graphicService.onAddIncremental(node, this, this.stage), data;
9871
+ return this.stage && data && (data.stage = this.stage, data.layer = this.layer), this.addUpdateBoundTag(), null === (_a = this.stage) || void 0 === _a || _a.graphicService.onAddIncremental(node, this, this.stage), data;
9867
9872
  }
9868
9873
  incrementalClearChild() {
9869
- super.removeAllChild(), this.addUpdateBoundTag(), application.graphicService.onClearIncremental(this, this.stage);
9874
+ var _a;
9875
+ super.removeAllChild(), this.addUpdateBoundTag(), null === (_a = this.stage) || void 0 === _a || _a.graphicService.onClearIncremental(this, this.stage);
9870
9876
  }
9871
9877
  _updateChildToStage(child) {
9872
9878
  return this.stage && child && child.setStage(this.stage, this.layer), this.addUpdateBoundTag(), child;
@@ -9886,17 +9892,20 @@
9886
9892
  return this._updateChildToStage(super.insertInto(newNode, idx));
9887
9893
  }
9888
9894
  removeChild(child) {
9895
+ var _a;
9889
9896
  const data = super.removeChild(child);
9890
- return child.stage = null, application.graphicService.onRemove(child), this.addUpdateBoundTag(), data;
9897
+ return child.stage = null, null === (_a = this.stage) || void 0 === _a || _a.graphicService.onRemove(child), this.addUpdateBoundTag(), data;
9891
9898
  }
9892
9899
  removeAllChild() {
9893
9900
  let deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !1;
9894
9901
  this.forEachChildren(child => {
9895
- application.graphicService.onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
9902
+ var _a;
9903
+ null === (_a = this.stage) || void 0 === _a || _a.graphicService.onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
9896
9904
  }), super.removeAllChild(), this.addUpdateBoundTag();
9897
9905
  }
9898
9906
  setStage(stage, layer) {
9899
- this.stage !== stage && (this.stage = stage, this.layer = layer, this.setStageToShadowRoot(stage, layer), this._onSetStage && this._onSetStage(this, stage, layer), application.graphicService.onSetStage(this, stage), this.forEachChildren(item => {
9907
+ var _a;
9908
+ this.stage !== stage && (this.stage = stage, this.layer = layer, this.setStageToShadowRoot(stage, layer), this._onSetStage && this._onSetStage(this, stage, layer), null === (_a = this.stage) || void 0 === _a || _a.graphicService.onSetStage(this, stage), this.forEachChildren(item => {
9900
9909
  item.setStage(stage, this.layer);
9901
9910
  }));
9902
9911
  }
@@ -16344,7 +16353,7 @@
16344
16353
  });
16345
16354
 
16346
16355
  var graphicModule = new ContainerModule(bind => {
16347
- bind(GraphicService).to(exports.DefaultGraphicService).inSingletonScope(), bind(GraphicCreator$1).toConstantValue(graphicCreator);
16356
+ bind(GraphicService).to(exports.DefaultGraphicService), bind(GraphicCreator$1).toConstantValue(graphicCreator);
16348
16357
  });
16349
16358
 
16350
16359
  const AutoEnablePlugins = Symbol.for("AutoEnablePlugins");
@@ -16662,7 +16671,7 @@
16662
16671
  dirtyBounds.x1 = Math.floor(b.x1), dirtyBounds.y1 = Math.floor(b.y1), dirtyBounds.x2 = Math.ceil(b.x2), dirtyBounds.y2 = Math.ceil(b.y2);
16663
16672
  }
16664
16673
  const d = context.dpr % 1;
16665
- (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.save(), context.reset(!1), context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f), context.clearMatrix(!1), context.translate(viewBox.x1, viewBox.y1, !0), context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip(), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), renderService.renderTreeRoots.sort((a, b) => {
16674
+ (d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.reset(!1), context.save(), context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f), context.clearMatrix(!1), context.translate(viewBox.x1, viewBox.y1, !0), context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip(), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), renderService.renderTreeRoots.sort((a, b) => {
16666
16675
  var _a, _b;
16667
16676
  return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
16668
16677
  }).forEach(group => {
@@ -17098,11 +17107,14 @@
17098
17107
  };
17099
17108
  }
17100
17109
  activate(context) {
17101
- this.pluginService = context, application.graphicService.hooks.onAttributeUpdate.tap(this.key, this.handleChange), application.graphicService.hooks.onSetStage.tap(this.key, this.handleChange), application.graphicService.hooks.onRemove.tap(this.key, this.handleChange);
17110
+ this.pluginService = context;
17111
+ const stage = this.pluginService.stage;
17112
+ stage && (stage.graphicService.hooks.onAttributeUpdate.tap(this.key, this.handleChange), stage.graphicService.hooks.onSetStage.tap(this.key, this.handleChange), stage.graphicService.hooks.onRemove.tap(this.key, this.handleChange));
17102
17113
  }
17103
17114
  deactivate(context) {
17104
- const filterByName = taps => taps.filter(item => item.name !== this.key);
17105
- application.graphicService.hooks.onAttributeUpdate.taps = filterByName(application.graphicService.hooks.onAttributeUpdate.taps), application.graphicService.hooks.onSetStage.taps = filterByName(application.graphicService.hooks.onSetStage.taps), application.graphicService.hooks.onRemove.taps = filterByName(application.graphicService.hooks.onRemove.taps);
17115
+ const filterByName = taps => taps.filter(item => item.name !== this.key),
17116
+ stage = this.pluginService.stage;
17117
+ stage && (stage.graphicService.hooks.onAttributeUpdate.taps = filterByName(stage.graphicService.hooks.onAttributeUpdate.taps), stage.graphicService.hooks.onSetStage.taps = filterByName(stage.graphicService.hooks.onSetStage.taps), stage.graphicService.hooks.onRemove.taps = filterByName(stage.graphicService.hooks.onRemove.taps));
17106
17118
  }
17107
17119
  }
17108
17120
 
@@ -17153,14 +17165,17 @@
17153
17165
  this.name = "IncrementalAutoRenderPlugin", this.activeEvent = "onRegister", this.nextFrameRenderGroupSet = new Set(), this.willNextFrameRender = !1, this.nextUserParams = {}, this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid;
17154
17166
  }
17155
17167
  activate(context) {
17156
- this.pluginService = context, application.graphicService.hooks.onAddIncremental.tap(this.key, (graphic, group, stage) => {
17168
+ this.pluginService = context;
17169
+ const stage = this.pluginService.stage;
17170
+ stage && (stage.graphicService.hooks.onAddIncremental.tap(this.key, (graphic, group, stage) => {
17157
17171
  graphic.glyphHost && (graphic = graphic.glyphHost), graphic.stage === context.stage && null != graphic.stage && (this.nextUserParams.startAtId = group._uid, this.renderNextFrame(group));
17158
- }), application.graphicService.hooks.onClearIncremental.tap(this.key, (group, stage) => {
17172
+ }), stage.graphicService.hooks.onClearIncremental.tap(this.key, (group, stage) => {
17159
17173
  group.stage === context.stage && null != group.stage && (this.nextUserParams.startAtId = group._uid, this.nextUserParams.restartIncremental = !0, this.renderNextFrame(group));
17160
- });
17174
+ }));
17161
17175
  }
17162
17176
  deactivate(context) {
17163
- application.graphicService.hooks.onAddIncremental.taps = application.graphicService.hooks.onAddIncremental.taps.filter(item => item.name !== this.key), application.graphicService.hooks.onClearIncremental.taps = application.graphicService.hooks.onClearIncremental.taps.filter(item => item.name !== this.key);
17177
+ const stage = this.pluginService.stage;
17178
+ stage && (stage.graphicService.hooks.onAddIncremental.taps = stage.graphicService.hooks.onAddIncremental.taps.filter(item => item.name !== this.key), stage.graphicService.hooks.onClearIncremental.taps = stage.graphicService.hooks.onClearIncremental.taps.filter(item => item.name !== this.key));
17164
17179
  }
17165
17180
  renderNextFrame(group) {
17166
17181
  this.nextFrameRenderGroupSet.add(group), this.willNextFrameRender || (this.willNextFrameRender = !0, application.global.getRequestAnimationFrame()(() => {
@@ -17196,19 +17211,22 @@
17196
17211
  activate(context) {
17197
17212
  this.pluginService = context, context.stage.hooks.afterRender.tap(this.key, stage => {
17198
17213
  stage && stage === this.pluginService.stage && stage.dirtyBounds.clear();
17199
- }), application.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, (graphic, stage, willUpdate, bounds) => {
17214
+ });
17215
+ const stage = this.pluginService.stage;
17216
+ stage && (stage.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, (graphic, stage, willUpdate, bounds) => {
17200
17217
  graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === this.pluginService.stage && stage.renderCount && (graphic.isContainer && !graphic.shouldSelfChangeUpdateAABBBounds() || willUpdate && (globalBounds.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2), stage.dirty(globalBounds, graphic.parent && graphic.parent.globalTransMatrix)));
17201
- }), application.graphicService.hooks.afterUpdateAABBBounds.tap(this.key, (graphic, stage, bounds, params, selfChange) => {
17218
+ }), stage.graphicService.hooks.afterUpdateAABBBounds.tap(this.key, (graphic, stage, bounds, params, selfChange) => {
17202
17219
  stage && stage === this.pluginService.stage && stage.renderCount && (graphic.isContainer && !selfChange || stage.dirty(params.globalAABBBounds));
17203
- }), application.graphicService.hooks.clearAABBBounds.tap(this.key, (graphic, stage, bounds) => {
17220
+ }), stage.graphicService.hooks.clearAABBBounds.tap(this.key, (graphic, stage, bounds) => {
17204
17221
  stage && stage === this.pluginService.stage && stage.renderCount && stage && stage.dirty(bounds);
17205
- }), application.graphicService.hooks.onRemove.tap(this.key, graphic => {
17222
+ }), stage.graphicService.hooks.onRemove.tap(this.key, graphic => {
17206
17223
  const stage = graphic.stage;
17207
17224
  stage && stage === this.pluginService.stage && stage.renderCount && stage && stage.dirty(graphic.globalAABBBounds);
17208
- });
17225
+ }));
17209
17226
  }
17210
17227
  deactivate(context) {
17211
- application.graphicService.hooks.beforeUpdateAABBBounds.taps = application.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(item => item.name !== this.key), application.graphicService.hooks.afterUpdateAABBBounds.taps = application.graphicService.hooks.afterUpdateAABBBounds.taps.filter(item => item.name !== this.key), application.graphicService.hooks.clearAABBBounds.taps = application.graphicService.hooks.clearAABBBounds.taps.filter(item => item.name !== this.key), context.stage.hooks.afterRender.taps = context.stage.hooks.afterRender.taps.filter(item => item.name !== this.key), application.graphicService.hooks.onRemove.taps = application.graphicService.hooks.onRemove.taps.filter(item => item.name !== this.key);
17228
+ const stage = this.pluginService.stage;
17229
+ stage && (stage.graphicService.hooks.beforeUpdateAABBBounds.taps = stage.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(item => item.name !== this.key), stage.graphicService.hooks.afterUpdateAABBBounds.taps = stage.graphicService.hooks.afterUpdateAABBBounds.taps.filter(item => item.name !== this.key), stage.graphicService.hooks.clearAABBBounds.taps = stage.graphicService.hooks.clearAABBBounds.taps.filter(item => item.name !== this.key), stage.hooks.afterRender.taps = stage.hooks.afterRender.taps.filter(item => item.name !== this.key), stage.graphicService.hooks.onRemove.taps = stage.graphicService.hooks.onRemove.taps.filter(item => item.name !== this.key));
17212
17230
  }
17213
17231
  }
17214
17232
 
@@ -17343,7 +17361,7 @@
17343
17361
  }, this.params = params, this.theme = new Theme(), this.hooks = {
17344
17362
  beforeRender: new SyncHook(["stage"]),
17345
17363
  afterRender: new SyncHook(["stage"])
17346
- }, this.global = application.global, !this.global.env && isBrowserEnv() && this.global.setEnv("browser"), this.window = container.get(VWindow), this.renderService = container.get(RenderService), this.pluginService = container.get(PluginService), this.layerService = container.get(LayerService), this.pluginService.active(this, params), this.window.create({
17364
+ }, this.global = application.global, !this.global.env && isBrowserEnv() && this.global.setEnv("browser"), this.window = container.get(VWindow), this.renderService = container.get(RenderService), this.pluginService = container.get(PluginService), this.layerService = container.get(LayerService), this.graphicService = container.get(GraphicService), this.pluginService.active(this, params), this.window.create({
17347
17365
  width: params.width,
17348
17366
  height: params.height,
17349
17367
  viewBox: params.viewBox,
@@ -17355,7 +17373,7 @@
17355
17373
  }), this.state = "normal", this.renderCount = 0, this.tryInitEventSystem(), this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig.BACKGROUND, this.appendChild(this.layerService.createLayer(this, {
17356
17374
  main: !0
17357
17375
  })), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
17358
- tickRenderMode: "performance"
17376
+ tickRenderMode: "effect"
17359
17377
  }), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
17360
17378
  background: this._background
17361
17379
  }), this.initAnimate(params), this.rafId = null !== (_b = params.rafId) && void 0 !== _b ? _b : Math.floor(6 * Math.random());
@@ -20465,7 +20483,7 @@
20465
20483
  });
20466
20484
  }
20467
20485
  deactivate(context) {
20468
- context.stage.hooks.afterRender.taps = context.stage.hooks.afterRender.taps.filter(item => item.name !== this.key), application.graphicService.hooks.onRemove.unTap(this.key), application.graphicService.hooks.onRelease.unTap(this.key), this.release();
20486
+ context.stage.hooks.afterRender.taps = context.stage.hooks.afterRender.taps.filter(item => item.name !== this.key), this.release();
20469
20487
  }
20470
20488
  getWrapContainer(stage, userContainer, domParams) {
20471
20489
  let nativeContainer;
@@ -20984,18 +21002,21 @@
20984
21002
  }
20985
21003
  }
20986
21004
  activate(context) {
20987
- this.pluginService = context, application.graphicService.hooks.onAttributeUpdate.tap(this.key, graphic => {
21005
+ this.pluginService = context;
21006
+ const stage = this.pluginService.stage;
21007
+ stage && (stage.graphicService.hooks.onAttributeUpdate.tap(this.key, graphic => {
20988
21008
  graphic.glyphHost && (graphic = graphic.glyphHost), graphic.stage && graphic.stage === this.pluginService.stage && this.tryLayout(graphic, !1);
20989
- }), application.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, (graphic, stage, willUpdate, bounds) => {
21009
+ }), stage.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, (graphic, stage, willUpdate, bounds) => {
20990
21010
  graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === this.pluginService.stage && graphic.isContainer && !this.skipBoundsTrigger && _tempBounds.copy(bounds);
20991
- }), application.graphicService.hooks.afterUpdateAABBBounds.tap(this.key, (graphic, stage, bounds, params, selfChange) => {
21011
+ }), stage.graphicService.hooks.afterUpdateAABBBounds.tap(this.key, (graphic, stage, bounds, params, selfChange) => {
20992
21012
  stage && stage === this.pluginService.stage && graphic.isContainer && !this.skipBoundsTrigger && (_tempBounds.equals(bounds) || this.tryLayout(graphic, !1));
20993
- }), application.graphicService.hooks.onSetStage.tap(this.key, graphic => {
21013
+ }), stage.graphicService.hooks.onSetStage.tap(this.key, graphic => {
20994
21014
  graphic.glyphHost && (graphic = graphic.glyphHost), this.tryLayout(graphic, !1);
20995
- });
21015
+ }));
20996
21016
  }
20997
21017
  deactivate(context) {
20998
- application.graphicService.hooks.onAttributeUpdate.taps = application.graphicService.hooks.onAttributeUpdate.taps.filter(item => item.name !== this.key), application.graphicService.hooks.beforeUpdateAABBBounds.taps = application.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(item => item.name !== this.key), application.graphicService.hooks.afterUpdateAABBBounds.taps = application.graphicService.hooks.afterUpdateAABBBounds.taps.filter(item => item.name !== this.key), application.graphicService.hooks.onSetStage.taps = application.graphicService.hooks.onSetStage.taps.filter(item => item.name !== this.key);
21018
+ const stage = this.pluginService.stage;
21019
+ stage && (stage.graphicService.hooks.onAttributeUpdate.taps = stage.graphicService.hooks.onAttributeUpdate.taps.filter(item => item.name !== this.key), stage.graphicService.hooks.beforeUpdateAABBBounds.taps = stage.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(item => item.name !== this.key), stage.graphicService.hooks.afterUpdateAABBBounds.taps = stage.graphicService.hooks.afterUpdateAABBBounds.taps.filter(item => item.name !== this.key), stage.graphicService.hooks.onSetStage.taps = stage.graphicService.hooks.onSetStage.taps.filter(item => item.name !== this.key));
20999
21020
  }
21000
21021
  }
21001
21022
  function getPadding(graphic, field) {
@@ -32385,7 +32406,7 @@
32385
32406
  points: points
32386
32407
  });
32387
32408
  });
32388
- this.target.attribute.points = segments;
32409
+ this.target.attribute.segments = segments;
32389
32410
  } else this.target.attribute.points = this.points;
32390
32411
  this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
32391
32412
  }
@@ -32407,7 +32428,7 @@
32407
32428
  to[key] = null !== (_a = null == attrs ? void 0 : attrs[key]) && void 0 !== _a ? _a : 1, from[key] = null !== (_c = null !== (_b = from[key]) && void 0 !== _b ? _b : fromAttrs[key]) && void 0 !== _c ? _c : 0;
32408
32429
  });
32409
32430
  const finalAttribute = this.target.getFinalAttribute();
32410
- finalAttribute && Object.assign(this.target.attribute, finalAttribute), this.props = to, this.propKeys = this.keys, this.from = from, this.to = to, !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(from);
32431
+ finalAttribute && this.target.setAttributes(finalAttribute), this.props = to, this.propKeys = this.keys, this.from = from, this.to = to, !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(from);
32411
32432
  }
32412
32433
  onUpdate(end, ratio, out) {
32413
32434
  const attribute = this.target.attribute;
@@ -32655,7 +32676,7 @@
32655
32676
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
32656
32677
  this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
32657
32678
  const finalAttribute = this.target.getFinalAttribute();
32658
- finalAttribute && Object.assign(this.target.attribute, finalAttribute), this.target.setAttributes(fromAttrs), this.determineUpdateFunction();
32679
+ finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs), this.determineUpdateFunction();
32659
32680
  }
32660
32681
  }
32661
32682
  class GrowAngleOut extends GrowAngleBase {
@@ -32807,7 +32828,7 @@
32807
32828
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
32808
32829
  this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
32809
32830
  const finalAttribute = this.target.getFinalAttribute();
32810
- finalAttribute && Object.assign(this.target.attribute, finalAttribute), this.target.setAttributes(fromAttrs);
32831
+ finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
32811
32832
  }
32812
32833
  onEnd(cb) {
32813
32834
  super.onEnd(cb);
@@ -32914,7 +32935,7 @@
32914
32935
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
32915
32936
  this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
32916
32937
  const finalAttribute = this.target.getFinalAttribute();
32917
- finalAttribute && Object.assign(this.target.attribute, finalAttribute), this.target.setAttributes(fromAttrs);
32938
+ finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
32918
32939
  }
32919
32940
  onEnd(cb) {
32920
32941
  super.onEnd(cb);
@@ -33030,7 +33051,7 @@
33030
33051
  } = growPointsIn(this.target, this.params.options, this.params);
33031
33052
  this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to;
33032
33053
  const finalAttribute = this.target.getFinalAttribute();
33033
- finalAttribute && Object.assign(this.target.attribute, finalAttribute), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && this.target.setAttributes(from);
33054
+ finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && this.target.setAttributes(from);
33034
33055
  } else this.valid = !1;
33035
33056
  }
33036
33057
  }
@@ -33094,7 +33115,7 @@
33094
33115
  } = growPointsXIn(this.target, this.params.options, this.params);
33095
33116
  this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to;
33096
33117
  const finalAttribute = this.target.getFinalAttribute();
33097
- finalAttribute && Object.assign(this.target.attribute, finalAttribute), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && this.target.setAttributes(from);
33118
+ finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && this.target.setAttributes(from);
33098
33119
  } else this.valid = !1;
33099
33120
  }
33100
33121
  }
@@ -33158,7 +33179,7 @@
33158
33179
  } = growPointsYIn(this.target, this.params.options, this.params);
33159
33180
  this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to;
33160
33181
  const finalAttribute = this.target.getFinalAttribute();
33161
- finalAttribute && Object.assign(this.target.attribute, finalAttribute), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && this.target.setAttributes(from);
33182
+ finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && this.target.setAttributes(from);
33162
33183
  } else this.valid = !1;
33163
33184
  }
33164
33185
  }
@@ -33272,7 +33293,7 @@
33272
33293
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
33273
33294
  this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
33274
33295
  const finalAttribute = this.target.getFinalAttribute();
33275
- finalAttribute && Object.assign(this.target.attribute, finalAttribute), this.target.setAttributes(fromAttrs);
33296
+ finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
33276
33297
  }
33277
33298
  }
33278
33299
  class GrowRadiusOut extends GrowPointsBase {
@@ -33396,7 +33417,7 @@
33396
33417
  fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
33397
33418
  this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
33398
33419
  const finalAttribute = this.target.getFinalAttribute();
33399
- finalAttribute && Object.assign(this.target.attribute, finalAttribute), this.target.setAttributes(fromAttrs);
33420
+ finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
33400
33421
  }
33401
33422
  onEnd(cb) {
33402
33423
  super.onEnd(cb);
@@ -34187,7 +34208,7 @@
34187
34208
  }, this._updateFunction = this.updateXY;
34188
34209
  }
34189
34210
  const finalAttribute = this.target.getFinalAttribute();
34190
- finalAttribute && Object.assign(this.target.attribute, finalAttribute), this.props = to, this.from = from, this.to = to, !1 !== (null === (_l = this.params.controlOptions) || void 0 === _l ? void 0 : _l.immediatelyApply) && this.target.setAttributes(from);
34211
+ finalAttribute && this.target.setAttributes(finalAttribute), this.props = to, this.from = from, this.to = to, !1 !== (null === (_l = this.params.controlOptions) || void 0 === _l ? void 0 : _l.immediatelyApply) && this.target.setAttributes(from);
34191
34212
  }
34192
34213
  onEnd(cb) {
34193
34214
  super.onEnd(cb);
@@ -34870,7 +34891,7 @@
34870
34891
  } = moveIn(this.target, this.params.options, this.params);
34871
34892
  this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = from, this.to = to;
34872
34893
  const finalAttribute = this.target.getFinalAttribute();
34873
- finalAttribute && Object.assign(this.target.attribute, finalAttribute), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && this.target.setAttributes(from);
34894
+ finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && this.target.setAttributes(from);
34874
34895
  }
34875
34896
  }
34876
34897
  class MoveOut extends MoveBase {
@@ -34931,7 +34952,7 @@
34931
34952
  } = rotateIn(this.target, this.params.options);
34932
34953
  this.props = to, this.propKeys = ["angle"], this.from = from, this.to = to;
34933
34954
  const finalAttribute = this.target.getFinalAttribute();
34934
- finalAttribute && Object.assign(this.target.attribute, finalAttribute), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && this.target.setAttributes(from);
34955
+ finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_a = this.params.controlOptions) || void 0 === _a ? void 0 : _a.immediatelyApply) && this.target.setAttributes(from);
34935
34956
  }
34936
34957
  }
34937
34958
  class RotateOut extends RotateBase {
@@ -34977,20 +34998,15 @@
34977
34998
  const finalAttribute = this.target.getFinalAttribute();
34978
34999
  Object.keys(this.from).forEach(key => {
34979
35000
  null == this.props[key] && (this.props[key] = finalAttribute[key]);
34980
- }), "appear" === (null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.animationState) && finalAttribute && Object.assign(this.target.attribute, finalAttribute), !1 !== (null === (_b = this.params.controlOptions) || void 0 === _b ? void 0 : _b.immediatelyApply) && this.target.setAttributes(this.from);
35001
+ }), "appear" === (null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.animationState) && finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_b = this.params.controlOptions) || void 0 === _b ? void 0 : _b.immediatelyApply) && this.target.setAttributes(this.from);
34981
35002
  }
34982
35003
  onFirstRun() {
34983
- var _a;
34984
35004
  this.from = Object.assign(Object.assign({}, this.getLastProps()), this.from);
34985
35005
  const startProps = this.animate.getStartProps();
34986
- if (this.propKeys && this.propKeys.forEach(key => {
35006
+ this.propKeys && this.propKeys.forEach(key => {
34987
35007
  var _a;
34988
35008
  this.from[key] = null !== (_a = this.from[key]) && void 0 !== _a ? _a : startProps[key];
34989
- }), "appear" === (null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.animationState)) {
34990
- const finalAttribute = this.target.getFinalAttribute();
34991
- this.target.setAttributes(finalAttribute);
34992
- }
34993
- this.target.setAttributes(this.from);
35009
+ }), this.target.setAttributes(this.from);
34994
35010
  }
34995
35011
  update(end, ratio, out) {
34996
35012
  if (this.onStart(), !this.props || !this.propKeys) return;
@@ -35188,7 +35204,7 @@
35188
35204
  AnimateExecutor.registerBuiltInAnimate("increaseCount", IncreaseCount), AnimateExecutor.registerBuiltInAnimate("fromTo", FromTo), AnimateExecutor.registerBuiltInAnimate("scaleIn", ScaleIn), AnimateExecutor.registerBuiltInAnimate("scaleOut", ScaleOut), AnimateExecutor.registerBuiltInAnimate("growHeightIn", GrowHeightIn), AnimateExecutor.registerBuiltInAnimate("growHeightOut", GrowHeightOut), AnimateExecutor.registerBuiltInAnimate("growWidthIn", GrowWidthIn), AnimateExecutor.registerBuiltInAnimate("growWidthOut", GrowWidthOut), AnimateExecutor.registerBuiltInAnimate("growCenterIn", GrowCenterIn), AnimateExecutor.registerBuiltInAnimate("growCenterOut", GrowCenterOut), AnimateExecutor.registerBuiltInAnimate("clipIn", ClipIn), AnimateExecutor.registerBuiltInAnimate("clipOut", ClipOut), AnimateExecutor.registerBuiltInAnimate("fadeIn", FadeIn), AnimateExecutor.registerBuiltInAnimate("fadeOut", FadeOut), AnimateExecutor.registerBuiltInAnimate("growPointsIn", GrowPointsIn), AnimateExecutor.registerBuiltInAnimate("growPointsOut", GrowPointsOut), AnimateExecutor.registerBuiltInAnimate("growPointsXIn", GrowPointsXIn), AnimateExecutor.registerBuiltInAnimate("growPointsXOut", GrowPointsXOut), AnimateExecutor.registerBuiltInAnimate("growPointsYIn", GrowPointsYIn), AnimateExecutor.registerBuiltInAnimate("growPointsYOut", GrowPointsYOut), AnimateExecutor.registerBuiltInAnimate("growAngleIn", GrowAngleIn), AnimateExecutor.registerBuiltInAnimate("growAngleOut", GrowAngleOut), AnimateExecutor.registerBuiltInAnimate("growRadiusIn", GrowRadiusIn), AnimateExecutor.registerBuiltInAnimate("growRadiusOut", GrowRadiusOut), AnimateExecutor.registerBuiltInAnimate("moveIn", MoveIn), AnimateExecutor.registerBuiltInAnimate("moveOut", MoveOut), AnimateExecutor.registerBuiltInAnimate("rotateIn", RotateIn), AnimateExecutor.registerBuiltInAnimate("rotateOut", RotateOut), AnimateExecutor.registerBuiltInAnimate("update", Update), AnimateExecutor.registerBuiltInAnimate("state", State), AnimateExecutor.registerBuiltInAnimate("labelItemAppear", LabelItemAppear), AnimateExecutor.registerBuiltInAnimate("labelItemDisappear", LabelItemDisappear), AnimateExecutor.registerBuiltInAnimate("poptipAppear", PoptipAppear), AnimateExecutor.registerBuiltInAnimate("poptipDisappear", PoptipDisappear), AnimateExecutor.registerBuiltInAnimate("inputText", InputText), AnimateExecutor.registerBuiltInAnimate("inputRichText", InputRichText), AnimateExecutor.registerBuiltInAnimate("outputRichText", OutputRichText), AnimateExecutor.registerBuiltInAnimate("slideRichText", SlideRichText), AnimateExecutor.registerBuiltInAnimate("slideOutRichText", SlideOutRichText), AnimateExecutor.registerBuiltInAnimate("slideIn", SlideIn), AnimateExecutor.registerBuiltInAnimate("growIn", GrowIn), AnimateExecutor.registerBuiltInAnimate("spinIn", SpinIn), AnimateExecutor.registerBuiltInAnimate("moveScaleIn", MoveScaleIn), AnimateExecutor.registerBuiltInAnimate("moveRotateIn", MoveRotateIn), AnimateExecutor.registerBuiltInAnimate("strokeIn", StrokeIn), AnimateExecutor.registerBuiltInAnimate("slideOut", SlideOut), AnimateExecutor.registerBuiltInAnimate("growOut", GrowOut), AnimateExecutor.registerBuiltInAnimate("spinOut", SpinOut), AnimateExecutor.registerBuiltInAnimate("moveScaleOut", MoveScaleOut), AnimateExecutor.registerBuiltInAnimate("moveRotateOut", MoveRotateOut), AnimateExecutor.registerBuiltInAnimate("strokeOut", StrokeOut), AnimateExecutor.registerBuiltInAnimate("pulse", PulseAnimate), AnimateExecutor.registerBuiltInAnimate("MotionPath", MotionPath), AnimateExecutor.registerBuiltInAnimate("streamLight", StreamLight);
35189
35205
  };
35190
35206
 
35191
- const version = "1.0.0-alpha.6";
35207
+ const version = "1.0.0-alpha.8";
35192
35208
  preLoadAllModule();
35193
35209
  if (isBrowserEnv()) {
35194
35210
  loadBrowserEnv(container);