@visactor/vrender 1.0.8-alpha.1 → 1.0.8-alpha.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.
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +3 -4
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +53 -140
- package/dist/index.js +52 -141
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +2 -4
- package/es/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -9197,15 +9197,15 @@
|
|
|
9197
9197
|
setWidthHeightWithoutTransform(aabbBounds) {
|
|
9198
9198
|
this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
|
|
9199
9199
|
}
|
|
9200
|
-
setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context
|
|
9200
|
+
setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context) {
|
|
9201
9201
|
this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach(animate => {
|
|
9202
|
-
|
|
9202
|
+
Object.keys(params).forEach(key => {
|
|
9203
9203
|
animate.preventAttr(key);
|
|
9204
9204
|
});
|
|
9205
9205
|
});
|
|
9206
9206
|
}
|
|
9207
9207
|
setAttributes(params, forceUpdateTag = !1, context) {
|
|
9208
|
-
|
|
9208
|
+
(params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background ? this.loadImage(params.background, !0) : params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context);
|
|
9209
9209
|
}
|
|
9210
9210
|
_setAttributes(params, forceUpdateTag = !1, context) {
|
|
9211
9211
|
const keys = Object.keys(params);
|
|
@@ -9370,7 +9370,7 @@
|
|
|
9370
9370
|
});
|
|
9371
9371
|
} else this.stopStateAnimates(), this.setAttributesAndPreventAnimate(attrs, !1, {
|
|
9372
9372
|
type: exports.AttributeUpdateType.STATE
|
|
9373
|
-
})
|
|
9373
|
+
});
|
|
9374
9374
|
this._emitCustomEvent("afterStateUpdate", {
|
|
9375
9375
|
type: exports.AttributeUpdateType.STATE
|
|
9376
9376
|
});
|
|
@@ -9763,7 +9763,7 @@
|
|
|
9763
9763
|
}
|
|
9764
9764
|
removeChild(child) {
|
|
9765
9765
|
const data = super.removeChild(child);
|
|
9766
|
-
return this.getGraphicService().onRemove(child),
|
|
9766
|
+
return child.stage = null, this.getGraphicService().onRemove(child), this.addUpdateBoundTag(), data;
|
|
9767
9767
|
}
|
|
9768
9768
|
removeAllChild(deep = !1) {
|
|
9769
9769
|
this.forEachChildren(child => {
|
|
@@ -17206,15 +17206,15 @@
|
|
|
17206
17206
|
this._skipRender > 1 && this.renderNextFrame(), this._skipRender = 0;
|
|
17207
17207
|
} else this._skipRender = 1;
|
|
17208
17208
|
}, this.beforeRender = stage => {
|
|
17209
|
-
this.
|
|
17209
|
+
this._beforeRender && this._beforeRender(stage);
|
|
17210
17210
|
}, this.afterRender = stage => {
|
|
17211
|
-
this.renderCount++, this.
|
|
17211
|
+
this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null, this.tickedBeforeRender = !1;
|
|
17212
17212
|
}, this.afterTickCb = () => {
|
|
17213
17213
|
this.tickedBeforeRender = !0, "rendering" !== this.state && this.renderNextFrame();
|
|
17214
17214
|
}, this.params = params, this.theme = new Theme(), this.hooks = {
|
|
17215
17215
|
beforeRender: new SyncHook(["stage"]),
|
|
17216
17216
|
afterRender: new SyncHook(["stage"])
|
|
17217
|
-
}, 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.
|
|
17217
|
+
}, 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({
|
|
17218
17218
|
width: params.width,
|
|
17219
17219
|
height: params.height,
|
|
17220
17220
|
viewBox: params.viewBox,
|
|
@@ -17225,7 +17225,7 @@
|
|
|
17225
17225
|
canvas: params.canvas
|
|
17226
17226
|
}), 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, {
|
|
17227
17227
|
main: !0
|
|
17228
|
-
})), 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),
|
|
17228
|
+
})), 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 = {
|
|
17229
17229
|
tickRenderMode: "effect"
|
|
17230
17230
|
}), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
|
|
17231
17231
|
background: this._background
|
|
@@ -17340,16 +17340,10 @@
|
|
|
17340
17340
|
options.enableView3dTransform && this.enableView3dTransform();
|
|
17341
17341
|
}
|
|
17342
17342
|
setBeforeRender(cb) {
|
|
17343
|
-
this.
|
|
17344
|
-
}
|
|
17345
|
-
removeBeforeRender(cb) {
|
|
17346
|
-
this._beforeRenderList = this._beforeRenderList.filter(c => c !== cb);
|
|
17343
|
+
this._beforeRender = cb;
|
|
17347
17344
|
}
|
|
17348
17345
|
setAfterRender(cb) {
|
|
17349
|
-
this.
|
|
17350
|
-
}
|
|
17351
|
-
removeAfterRender(cb) {
|
|
17352
|
-
this._afterRenderList = this._afterRenderList.filter(c => c !== cb);
|
|
17346
|
+
this._afterRender = cb;
|
|
17353
17347
|
}
|
|
17354
17348
|
afterNextRender(cb) {
|
|
17355
17349
|
this._afterNextRenderCbs || (this._afterNextRenderCbs = []), this._afterNextRenderCbs.push(cb);
|
|
@@ -17626,7 +17620,7 @@
|
|
|
17626
17620
|
return this._cursor;
|
|
17627
17621
|
}
|
|
17628
17622
|
eventPointTransform(e) {
|
|
17629
|
-
const point = this.global.mapToCanvasPoint(e, this.window);
|
|
17623
|
+
const point = this.global.mapToCanvasPoint(e, this.window.getContext().canvas.nativeCanvas);
|
|
17630
17624
|
return this.stage.window.pointTransform(point.x, point.y);
|
|
17631
17625
|
}
|
|
17632
17626
|
pauseTriggerEvent() {
|
|
@@ -30487,7 +30481,6 @@
|
|
|
30487
30481
|
return this.getEndProps();
|
|
30488
30482
|
}
|
|
30489
30483
|
stop() {}
|
|
30490
|
-
release() {}
|
|
30491
30484
|
}
|
|
30492
30485
|
class WaitStep extends Step {
|
|
30493
30486
|
constructor(type, props, duration, easing) {
|
|
@@ -30511,7 +30504,7 @@
|
|
|
30511
30504
|
return this._animateCount;
|
|
30512
30505
|
}
|
|
30513
30506
|
constructor() {
|
|
30514
|
-
super(), this.head = null, this.tail = null, this.animateMap = new Map(), this._animateCount = 0, this._playSpeed = 1, this._totalDuration = 0, this._startTime = 0, this._currentTime = 0, this.
|
|
30507
|
+
super(), this.head = null, this.tail = null, this.animateMap = new Map(), this._animateCount = 0, this._playSpeed = 1, this._totalDuration = 0, this._startTime = 0, this._currentTime = 0, this.id = Generator.GenAutoIncrementId(), this.paused = !1;
|
|
30515
30508
|
}
|
|
30516
30509
|
isRunning() {
|
|
30517
30510
|
return !this.paused && this._animateCount > 0;
|
|
@@ -30540,11 +30533,10 @@
|
|
|
30540
30533
|
}
|
|
30541
30534
|
tick(delta) {
|
|
30542
30535
|
if (this.paused) return;
|
|
30543
|
-
this._animationEndFlag && (this._animationEndFlag = !1, this.emit("animationStart"));
|
|
30544
30536
|
const scaledDelta = delta * this._playSpeed;
|
|
30545
30537
|
this._currentTime += scaledDelta, this.forEachAccessAnimate((animate, i) => {
|
|
30546
30538
|
animate.status === exports.AnimateStatus.END ? this.removeAnimate(animate, !0) : animate.status !== exports.AnimateStatus.RUNNING && animate.status !== exports.AnimateStatus.INITIAL || animate.advance(scaledDelta);
|
|
30547
|
-
}), 0 === this._animateCount &&
|
|
30539
|
+
}), 0 === this._animateCount && this.emit("animationEnd");
|
|
30548
30540
|
}
|
|
30549
30541
|
clear() {
|
|
30550
30542
|
this.forEachAccessAnimate(animate => {
|
|
@@ -30608,9 +30600,7 @@
|
|
|
30608
30600
|
return this._timeline;
|
|
30609
30601
|
}
|
|
30610
30602
|
bind(target) {
|
|
30611
|
-
return this.target = target, this.target.
|
|
30612
|
-
this.stop(), this.target.animates.delete(this.id);
|
|
30613
|
-
}), this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
|
|
30603
|
+
return this.target = target, this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
|
|
30614
30604
|
}
|
|
30615
30605
|
to(props, duration = 300, easing = "linear") {
|
|
30616
30606
|
const step = new Step(exports.AnimateStepType.to, props, duration, easing);
|
|
@@ -30705,9 +30695,7 @@
|
|
|
30705
30695
|
this.status !== exports.AnimateStatus.END && this.onEnd(), this.status = exports.AnimateStatus.END, this.target && ("start" === type ? this.target.setAttributes(this._startProps) : "end" === type ? this.target.setAttributes(this._endProps) : type && this.target.setAttributes(type));
|
|
30706
30696
|
}
|
|
30707
30697
|
release() {
|
|
30708
|
-
this.status = exports.AnimateStatus.END, this._onRemove && this._onRemove.forEach(cb => cb()), this._onStart = [], this._onFrame = [], this._onEnd = [], this._onRemove = []
|
|
30709
|
-
step.release();
|
|
30710
|
-
});
|
|
30698
|
+
this.status = exports.AnimateStatus.END, this._onRemove && this._onRemove.forEach(cb => cb()), this._onStart = [], this._onFrame = [], this._onEnd = [], this._onRemove = [];
|
|
30711
30699
|
}
|
|
30712
30700
|
getDuration() {
|
|
30713
30701
|
return this._duration;
|
|
@@ -30781,10 +30769,6 @@
|
|
|
30781
30769
|
getLoop() {
|
|
30782
30770
|
return this._loopCount;
|
|
30783
30771
|
}
|
|
30784
|
-
forEachStep(cb) {
|
|
30785
|
-
let step = this._firstStep;
|
|
30786
|
-
for (; step;) cb(step), step = step.next;
|
|
30787
|
-
}
|
|
30788
30772
|
}
|
|
30789
30773
|
|
|
30790
30774
|
const performanceRAF = new PerformanceRAF();
|
|
@@ -30830,8 +30814,8 @@
|
|
|
30830
30814
|
}
|
|
30831
30815
|
init() {
|
|
30832
30816
|
this.interval = 16, this.status = exports.STATUS.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker", () => {
|
|
30833
|
-
this.initHandler(
|
|
30834
|
-
}), application.global.env && this.initHandler(
|
|
30817
|
+
this.initHandler();
|
|
30818
|
+
}), application.global.env && this.initHandler();
|
|
30835
30819
|
}
|
|
30836
30820
|
addTimeline(timeline) {
|
|
30837
30821
|
this.timelines.push(timeline);
|
|
@@ -30842,11 +30826,10 @@
|
|
|
30842
30826
|
getTimelines() {
|
|
30843
30827
|
return this.timelines;
|
|
30844
30828
|
}
|
|
30845
|
-
initHandler(
|
|
30846
|
-
this.setupTickHandler(
|
|
30829
|
+
initHandler() {
|
|
30830
|
+
this.setupTickHandler();
|
|
30847
30831
|
}
|
|
30848
|
-
setupTickHandler(
|
|
30849
|
-
if (!force && this.tickerHandler) return !0;
|
|
30832
|
+
setupTickHandler() {
|
|
30850
30833
|
const handler = new RAFTickHandler();
|
|
30851
30834
|
return this.tickerHandler && this.tickerHandler.release(), this.tickerHandler = handler, !0;
|
|
30852
30835
|
}
|
|
@@ -30897,7 +30880,7 @@
|
|
|
30897
30880
|
return this.status = exports.STATUS.RUNNING, this.tickerHandler.tick(0, this.handleTick), !0;
|
|
30898
30881
|
}
|
|
30899
30882
|
stop() {
|
|
30900
|
-
this.status = exports.STATUS.INITIAL, this.setupTickHandler(
|
|
30883
|
+
this.status = exports.STATUS.INITIAL, this.setupTickHandler(), this.lastFrameTime = -1;
|
|
30901
30884
|
}
|
|
30902
30885
|
trySyncTickStatus() {
|
|
30903
30886
|
this.status === exports.STATUS.INITIAL && this.timelines.some(timeline => timeline.isRunning()) ? this.start() : this.status === exports.STATUS.RUNNING && this.timelines.every(timeline => !timeline.isRunning()) && this.stop();
|
|
@@ -30907,8 +30890,7 @@
|
|
|
30907
30890
|
this.stop(), this.timelines = [], null === (_a = this.tickerHandler) || void 0 === _a || _a.release(), this.tickerHandler = null, this.lastFrameTime = -1;
|
|
30908
30891
|
}
|
|
30909
30892
|
checkSkip(delta) {
|
|
30910
|
-
|
|
30911
|
-
if ("performance" === (null === (_c = null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.params) || void 0 === _b ? void 0 : _b.optimize) || void 0 === _c ? void 0 : _c.tickRenderMode)) return !1;
|
|
30893
|
+
if ("performance" === this.stage.params.optimize.tickRenderMode) return !1;
|
|
30912
30894
|
return delta < this.interval + 2 * (Math.random() - .5) * this._jitter;
|
|
30913
30895
|
}
|
|
30914
30896
|
}
|
|
@@ -31211,11 +31193,10 @@
|
|
|
31211
31193
|
_handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic) {
|
|
31212
31194
|
var _a, _b, _c, _d;
|
|
31213
31195
|
if (custom && customType) {
|
|
31214
|
-
const customParams =
|
|
31196
|
+
const customParams = this.resolveValue(customParameters, graphic, {
|
|
31215
31197
|
width: graphic.stage.width,
|
|
31216
|
-
height: graphic.stage.height
|
|
31217
|
-
|
|
31218
|
-
}, this.resolveValue(customParameters, graphic)),
|
|
31198
|
+
height: graphic.stage.height
|
|
31199
|
+
}),
|
|
31219
31200
|
objOptions = isFunction$1(options) ? options.call(null, null !== (_b = customParams && (null === (_a = customParams.data) || void 0 === _a ? void 0 : _a[0])) && void 0 !== _b ? _b : null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, customParams) : options;
|
|
31220
31201
|
customParams.options = objOptions, customParams.controlOptions = controlOptions, 1 === customType ? this.createCustomAnimation(animate, custom, from, props, duration, easing, customParams) : 2 === customType && this.createCustomInterpolatorAnimation(animate, custom, props, duration, easing, customParams);
|
|
31221
31202
|
} else "to" === type ? animate.to(props, duration, easing) : "from" === type && animate.from(props, duration, easing);
|
|
@@ -31433,11 +31414,6 @@
|
|
|
31433
31414
|
state.executor.stop();
|
|
31434
31415
|
}), this.stateList = null;
|
|
31435
31416
|
}
|
|
31436
|
-
reApplyState(state) {
|
|
31437
|
-
var _a;
|
|
31438
|
-
const stateInfo = null === (_a = this.stateList) || void 0 === _a ? void 0 : _a.find(stateInfo => stateInfo.state === state);
|
|
31439
|
-
stateInfo && (stateInfo.executor.stop(), stateInfo.executor.execute(stateInfo.animationConfig));
|
|
31440
|
-
}
|
|
31441
31417
|
}
|
|
31442
31418
|
|
|
31443
31419
|
class GraphicStateExtension {
|
|
@@ -31468,19 +31444,12 @@
|
|
|
31468
31444
|
applyUnhighlightState(animationConfig, callback) {
|
|
31469
31445
|
return this._getAnimationStateManager(this).applyUnhighlightState(animationConfig, callback), this;
|
|
31470
31446
|
}
|
|
31471
|
-
stopAnimationState(state, type
|
|
31472
|
-
return this._getAnimationStateManager(this).stopState(state, type),
|
|
31473
|
-
child.stopAnimationState(state, type, deep);
|
|
31474
|
-
}), this;
|
|
31447
|
+
stopAnimationState(state, type) {
|
|
31448
|
+
return this._getAnimationStateManager(this).stopState(state, type), this;
|
|
31475
31449
|
}
|
|
31476
31450
|
clearAnimationStates() {
|
|
31477
31451
|
return this._getAnimationStateManager(this).clearState(), this;
|
|
31478
31452
|
}
|
|
31479
|
-
reApplyAnimationState(state, deep = !1) {
|
|
31480
|
-
return this._getAnimationStateManager(this).reApplyState(state), deep && this.isContainer && this.forEachChildren(child => {
|
|
31481
|
-
child.reApplyAnimationState(state, deep);
|
|
31482
|
-
}), this;
|
|
31483
|
-
}
|
|
31484
31453
|
static extend(graphic) {
|
|
31485
31454
|
return new GraphicStateExtension()._getAnimationStateManager(graphic), graphic;
|
|
31486
31455
|
}
|
|
@@ -31492,6 +31461,7 @@
|
|
|
31492
31461
|
}
|
|
31493
31462
|
animate(params) {
|
|
31494
31463
|
var _a, _b, _c;
|
|
31464
|
+
this.animates || (this.animates = new Map());
|
|
31495
31465
|
const animate = new Animate(null == params ? void 0 : params.id, null !== (_b = null !== (_a = null == params ? void 0 : params.timeline) && void 0 !== _a ? _a : this.stage && this.stage.getTimeline()) && void 0 !== _b ? _b : defaultTimeline, null == params ? void 0 : params.slience);
|
|
31496
31466
|
if (animate.bind(this), params) {
|
|
31497
31467
|
const {
|
|
@@ -31501,7 +31471,9 @@
|
|
|
31501
31471
|
} = params;
|
|
31502
31472
|
null != onStart && animate.onStart(onStart), null != onEnd && animate.onEnd(onEnd), null != onRemove && animate.onRemove(onRemove);
|
|
31503
31473
|
}
|
|
31504
|
-
return
|
|
31474
|
+
return this.animates.set(animate.id, animate), animate.onRemove(() => {
|
|
31475
|
+
animate.stop(), this.animates.delete(animate.id);
|
|
31476
|
+
}), null === (_c = this.stage) || void 0 === _c || _c.ticker.start(), animate;
|
|
31505
31477
|
}
|
|
31506
31478
|
createTimeline() {
|
|
31507
31479
|
return new DefaultTimeline();
|
|
@@ -31532,21 +31504,6 @@
|
|
|
31532
31504
|
getGraphicAttribute(key, prev = !1) {
|
|
31533
31505
|
return !prev && this.finalAttribute ? this.finalAttribute[key] : this.attribute[key];
|
|
31534
31506
|
}
|
|
31535
|
-
pauseAnimation(deep = !1) {
|
|
31536
|
-
this.animates && this.animates.forEach(animate => animate.pause()), deep && this.isContainer && this.forEachChildren(child => {
|
|
31537
|
-
child.pauseAnimation(deep);
|
|
31538
|
-
});
|
|
31539
|
-
}
|
|
31540
|
-
resumeAnimation(deep = !1) {
|
|
31541
|
-
this.animates && this.animates.forEach(animate => animate.resume()), deep && this.isContainer && this.forEachChildren(child => {
|
|
31542
|
-
child.resumeAnimation(deep);
|
|
31543
|
-
});
|
|
31544
|
-
}
|
|
31545
|
-
stopAnimation(deep = !1) {
|
|
31546
|
-
this.animates && this.animates.forEach(animate => animate.stop()), deep && this.isContainer && this.forEachChildren(child => {
|
|
31547
|
-
child.stopAnimation(deep);
|
|
31548
|
-
});
|
|
31549
|
-
}
|
|
31550
31507
|
}
|
|
31551
31508
|
|
|
31552
31509
|
function registerAnimate() {
|
|
@@ -31555,7 +31512,7 @@
|
|
|
31555
31512
|
|
|
31556
31513
|
class ACustomAnimate extends Step {
|
|
31557
31514
|
constructor(customFrom, customTo, duration, easing, params) {
|
|
31558
|
-
super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params
|
|
31515
|
+
super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params;
|
|
31559
31516
|
}
|
|
31560
31517
|
update(end, ratio, out) {
|
|
31561
31518
|
if (this.onStart(), !this.props || !this.propKeys) return;
|
|
@@ -31574,45 +31531,6 @@
|
|
|
31574
31531
|
this._animator && this._animator.stop();
|
|
31575
31532
|
}
|
|
31576
31533
|
}
|
|
31577
|
-
class AStageAnimate extends ACustomAnimate {
|
|
31578
|
-
constructor(customFrom, customTo, duration, easing, params) {
|
|
31579
|
-
super(customFrom, customTo, duration, easing, params), this.willCallBeforeStageRender = !0, this.willCallAfterStageRender = !0, this._beforeStageRender = () => {
|
|
31580
|
-
if (!this.willCallBeforeStageRender) return;
|
|
31581
|
-
this.willCallBeforeStageRender = !1;
|
|
31582
|
-
const stage = this.target.stage,
|
|
31583
|
-
canvas = stage.window.getContext().canvas.nativeCanvas,
|
|
31584
|
-
outputCanvas = this.beforeStageRender(stage, canvas);
|
|
31585
|
-
outputCanvas && this.renderToStage(stage, outputCanvas);
|
|
31586
|
-
}, this._afterStageRender = () => {
|
|
31587
|
-
if (!this.willCallAfterStageRender) return;
|
|
31588
|
-
this.willCallAfterStageRender = !1;
|
|
31589
|
-
const stage = this.target.stage,
|
|
31590
|
-
canvas = stage.window.getContext().canvas.nativeCanvas,
|
|
31591
|
-
outputCanvas = this.afterStageRender(stage, canvas);
|
|
31592
|
-
outputCanvas && this.renderToStage(stage, outputCanvas);
|
|
31593
|
-
}, this.props = {};
|
|
31594
|
-
}
|
|
31595
|
-
beforeStageRender(stage, canvas) {
|
|
31596
|
-
return !1;
|
|
31597
|
-
}
|
|
31598
|
-
afterStageRender(stage, canvas) {
|
|
31599
|
-
return !1;
|
|
31600
|
-
}
|
|
31601
|
-
onFirstRun() {
|
|
31602
|
-
super.onFirstRun(), this.target.stage.setBeforeRender(this._beforeStageRender), this.target.stage.setAfterRender(this._afterStageRender), this.target.stage.disableDirtyBounds();
|
|
31603
|
-
}
|
|
31604
|
-
stop() {
|
|
31605
|
-
super.stop(), this.target.stage.removeBeforeRender(this._beforeStageRender), this.target.stage.removeAfterRender(this._afterStageRender);
|
|
31606
|
-
}
|
|
31607
|
-
onUpdate(end, ratio, out) {
|
|
31608
|
-
super.onUpdate(end, ratio, out), this.willCallBeforeStageRender = !0, this.willCallAfterStageRender = !0;
|
|
31609
|
-
}
|
|
31610
|
-
renderToStage(stage, canvas) {
|
|
31611
|
-
const stageCanvas = stage.window.getContext().canvas.nativeCanvas,
|
|
31612
|
-
ctx = stageCanvas.getContext("2d");
|
|
31613
|
-
return !!ctx && (ctx.clearRect(0, 0, stageCanvas.width, stageCanvas.height), ctx.drawImage(canvas, 0, 0), stageCanvas);
|
|
31614
|
-
}
|
|
31615
|
-
}
|
|
31616
31534
|
|
|
31617
31535
|
class ComponentAnimator {
|
|
31618
31536
|
constructor(component) {
|
|
@@ -32751,7 +32669,7 @@
|
|
|
32751
32669
|
super(from, to, duration, easing, params);
|
|
32752
32670
|
}
|
|
32753
32671
|
onBind() {
|
|
32754
|
-
var _a, _b
|
|
32672
|
+
var _a, _b;
|
|
32755
32673
|
super.onBind();
|
|
32756
32674
|
const {
|
|
32757
32675
|
from: from,
|
|
@@ -32760,7 +32678,7 @@
|
|
|
32760
32678
|
fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
|
|
32761
32679
|
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
|
|
32762
32680
|
const finalAttribute = this.target.getFinalAttribute();
|
|
32763
|
-
finalAttribute && this.target.setAttributes(finalAttribute),
|
|
32681
|
+
finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
|
|
32764
32682
|
}
|
|
32765
32683
|
onEnd(cb) {
|
|
32766
32684
|
super.onEnd(cb);
|
|
@@ -32858,7 +32776,7 @@
|
|
|
32858
32776
|
super(from, to, duration, easing, params);
|
|
32859
32777
|
}
|
|
32860
32778
|
onBind() {
|
|
32861
|
-
var _a, _b
|
|
32779
|
+
var _a, _b;
|
|
32862
32780
|
super.onBind();
|
|
32863
32781
|
const {
|
|
32864
32782
|
from: from,
|
|
@@ -32867,7 +32785,7 @@
|
|
|
32867
32785
|
fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
|
|
32868
32786
|
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
|
|
32869
32787
|
const finalAttribute = this.target.getFinalAttribute();
|
|
32870
|
-
finalAttribute && this.target.setAttributes(finalAttribute),
|
|
32788
|
+
finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
|
|
32871
32789
|
}
|
|
32872
32790
|
onEnd(cb) {
|
|
32873
32791
|
super.onEnd(cb);
|
|
@@ -34718,15 +34636,16 @@
|
|
|
34718
34636
|
changedY = 0;
|
|
34719
34637
|
"negative" === orient && (changedX = null !== (_a = layoutRect.width) && void 0 !== _a ? _a : graphic.stage.viewWidth, changedY = null !== (_b = layoutRect.height) && void 0 !== _b ? _b : graphic.stage.viewHeight), changedX += offset, changedY += offset;
|
|
34720
34638
|
const point = isFunction$1(pointOpt) ? pointOpt.call(null, null === (_d = null === (_c = graphic.context) || void 0 === _c ? void 0 : _c.data) || void 0 === _d ? void 0 : _d[0], graphic, animationParameters) : pointOpt,
|
|
34721
|
-
|
|
34722
|
-
|
|
34723
|
-
|
|
34724
|
-
|
|
34639
|
+
fromX = point && isValidNumber$1(point.x) ? point.x : changedX,
|
|
34640
|
+
fromY = point && isValidNumber$1(point.y) ? point.y : changedY,
|
|
34641
|
+
finalAttrs = graphic.getFinalAttribute(),
|
|
34642
|
+
finalAttrsX = excludeChannels.includes("x") ? graphic.attribute.x : finalAttrs.x,
|
|
34643
|
+
finalAttrsY = excludeChannels.includes("y") ? graphic.attribute.y : finalAttrs.y;
|
|
34725
34644
|
switch (direction) {
|
|
34726
34645
|
case "x":
|
|
34727
34646
|
return {
|
|
34728
34647
|
from: {
|
|
34729
|
-
x:
|
|
34648
|
+
x: fromX
|
|
34730
34649
|
},
|
|
34731
34650
|
to: {
|
|
34732
34651
|
x: finalAttrsX
|
|
@@ -34755,26 +34674,25 @@
|
|
|
34755
34674
|
}
|
|
34756
34675
|
};
|
|
34757
34676
|
const moveOut = (graphic, options, animationParameters) => {
|
|
34758
|
-
var _a, _b, _c, _d;
|
|
34677
|
+
var _a, _b, _c, _d, _e, _f;
|
|
34759
34678
|
const {
|
|
34760
34679
|
offset = 0,
|
|
34761
34680
|
orient: orient,
|
|
34762
34681
|
direction: direction,
|
|
34763
34682
|
point: pointOpt
|
|
34764
34683
|
} = null != options ? options : {},
|
|
34765
|
-
|
|
34766
|
-
|
|
34767
|
-
groupHeight = null !== (_b = groupBounds.height()) && void 0 !== _b ? _b : animationParameters.height,
|
|
34684
|
+
groupWidth = null !== (_b = null === (_a = options.layoutRect) || void 0 === _a ? void 0 : _a.width) && void 0 !== _b ? _b : graphic.stage.viewWidth,
|
|
34685
|
+
groupHeight = null !== (_d = null === (_c = options.layoutRect) || void 0 === _c ? void 0 : _c.height) && void 0 !== _d ? _d : graphic.stage.viewHeight,
|
|
34768
34686
|
changedX = ("negative" === orient ? groupWidth : 0) + offset,
|
|
34769
34687
|
changedY = ("negative" === orient ? groupHeight : 0) + offset,
|
|
34770
|
-
point = isFunction$1(pointOpt) ? pointOpt.call(null, null === (
|
|
34688
|
+
point = isFunction$1(pointOpt) ? pointOpt.call(null, null === (_f = null === (_e = graphic.context) || void 0 === _e ? void 0 : _e.data) || void 0 === _f ? void 0 : _f[0], graphic, animationParameters) : pointOpt,
|
|
34771
34689
|
fromX = point && isValidNumber$1(point.x) ? point.x : changedX,
|
|
34772
34690
|
fromY = point && isValidNumber$1(point.y) ? point.y : changedY;
|
|
34773
34691
|
switch (direction) {
|
|
34774
34692
|
case "x":
|
|
34775
34693
|
return {
|
|
34776
34694
|
from: {
|
|
34777
|
-
x: graphic.
|
|
34695
|
+
x: graphic.attribute.x
|
|
34778
34696
|
},
|
|
34779
34697
|
to: {
|
|
34780
34698
|
x: fromX
|
|
@@ -34783,7 +34701,7 @@
|
|
|
34783
34701
|
case "y":
|
|
34784
34702
|
return {
|
|
34785
34703
|
from: {
|
|
34786
|
-
y: graphic.
|
|
34704
|
+
y: graphic.attribute.y
|
|
34787
34705
|
},
|
|
34788
34706
|
to: {
|
|
34789
34707
|
y: fromY
|
|
@@ -34792,8 +34710,8 @@
|
|
|
34792
34710
|
default:
|
|
34793
34711
|
return {
|
|
34794
34712
|
from: {
|
|
34795
|
-
x: graphic.
|
|
34796
|
-
y: graphic.
|
|
34713
|
+
x: graphic.attribute.x,
|
|
34714
|
+
y: graphic.attribute.y
|
|
34797
34715
|
},
|
|
34798
34716
|
to: {
|
|
34799
34717
|
x: fromX,
|
|
@@ -34940,9 +34858,6 @@
|
|
|
34940
34858
|
this.from[key] = null !== (_a = this.from[key]) && void 0 !== _a ? _a : startProps[key];
|
|
34941
34859
|
}), this.target.setAttributes(this.from);
|
|
34942
34860
|
}
|
|
34943
|
-
deleteSelfAttr(key) {
|
|
34944
|
-
super.deleteSelfAttr(key), delete this.from[key];
|
|
34945
|
-
}
|
|
34946
34861
|
update(end, ratio, out) {
|
|
34947
34862
|
if (this.onStart(), !this.props || !this.propKeys) return;
|
|
34948
34863
|
const easedRatio = this.easing(ratio);
|
|
@@ -35139,7 +35054,7 @@
|
|
|
35139
35054
|
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);
|
|
35140
35055
|
};
|
|
35141
35056
|
|
|
35142
|
-
const version = "1.0.8-alpha.
|
|
35057
|
+
const version = "1.0.8-alpha.2";
|
|
35143
35058
|
preLoadAllModule();
|
|
35144
35059
|
if (isBrowserEnv()) {
|
|
35145
35060
|
loadBrowserEnv(container);
|
|
@@ -35172,15 +35087,12 @@
|
|
|
35172
35087
|
registerReactAttributePlugin();
|
|
35173
35088
|
registerDirectionalLight();
|
|
35174
35089
|
registerOrthoCamera();
|
|
35175
|
-
registerCustomAnimate();
|
|
35176
|
-
registerAnimate();
|
|
35177
35090
|
|
|
35178
35091
|
exports.AComponentAnimate = AComponentAnimate;
|
|
35179
35092
|
exports.ACustomAnimate = ACustomAnimate;
|
|
35180
35093
|
exports.ARC3D_NUMBER_TYPE = ARC3D_NUMBER_TYPE;
|
|
35181
35094
|
exports.ARC_NUMBER_TYPE = ARC_NUMBER_TYPE;
|
|
35182
35095
|
exports.AREA_NUMBER_TYPE = AREA_NUMBER_TYPE;
|
|
35183
|
-
exports.AStageAnimate = AStageAnimate;
|
|
35184
35096
|
exports.Animate = Animate;
|
|
35185
35097
|
exports.AnimateExecutor = AnimateExecutor;
|
|
35186
35098
|
exports.AnimateStep = Step;
|
|
@@ -35311,7 +35223,6 @@
|
|
|
35311
35223
|
exports.DrawContribution = DrawContribution;
|
|
35312
35224
|
exports.DrawItemInterceptor = DrawItemInterceptor;
|
|
35313
35225
|
exports.DynamicLayerHandlerContribution = DynamicLayerHandlerContribution;
|
|
35314
|
-
exports.Easing = Easing;
|
|
35315
35226
|
exports.EditModule = EditModule;
|
|
35316
35227
|
exports.EnvContribution = EnvContribution;
|
|
35317
35228
|
exports.EventManager = EventManager;
|