@visactor/vrender 1.0.8-alpha.2 → 1.0.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/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +99 -58
- package/dist/index.js +99 -57
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -9197,9 +9197,9 @@
|
|
|
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, ignorePriority) {
|
|
9201
9201
|
this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach(animate => {
|
|
9202
|
-
Object.keys(params).forEach(key => {
|
|
9202
|
+
(animate.priority !== 1 / 0 || ignorePriority) && Object.keys(params).forEach(key => {
|
|
9203
9203
|
animate.preventAttr(key);
|
|
9204
9204
|
});
|
|
9205
9205
|
});
|
|
@@ -9370,7 +9370,7 @@
|
|
|
9370
9370
|
});
|
|
9371
9371
|
} else this.stopStateAnimates(), this.setAttributesAndPreventAnimate(attrs, !1, {
|
|
9372
9372
|
type: exports.AttributeUpdateType.STATE
|
|
9373
|
-
});
|
|
9373
|
+
}), this.finalAttribute && Object.assign(this.finalAttribute, attrs);
|
|
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
|
|
9766
|
+
return this.getGraphicService().onRemove(child), child.stage = null, this.addUpdateBoundTag(), data;
|
|
9767
9767
|
}
|
|
9768
9768
|
removeAllChild(deep = !1) {
|
|
9769
9769
|
this.forEachChildren(child => {
|
|
@@ -13132,9 +13132,10 @@
|
|
|
13132
13132
|
return super.needUpdateTag(key, POLYGON_UPDATE_TAG_KEY);
|
|
13133
13133
|
}
|
|
13134
13134
|
toCustomPath() {
|
|
13135
|
-
|
|
13136
|
-
|
|
13137
|
-
|
|
13135
|
+
let path = super.toCustomPath();
|
|
13136
|
+
if (path) return path;
|
|
13137
|
+
const points = this.attribute.points;
|
|
13138
|
+
return path = new CustomPath2D(), points.forEach((point, index) => {
|
|
13138
13139
|
0 === index ? path.moveTo(point.x, point.y) : path.lineTo(point.x, point.y);
|
|
13139
13140
|
}), path.closePath(), path;
|
|
13140
13141
|
}
|
|
@@ -16511,6 +16512,7 @@
|
|
|
16511
16512
|
drawContext.updateBounds ? this.useDirtyBounds = !0 : this.useDirtyBounds = !drawContext.stage.params.optimize.disableCheckGraphicWidthOutRange;
|
|
16512
16513
|
}
|
|
16513
16514
|
draw(renderService, drawContext) {
|
|
16515
|
+
var _a;
|
|
16514
16516
|
this.prepareForDraw(renderService, drawContext), drawContext.drawContribution = this, this.currentRenderMap = this.styleRenderMap.get(drawContext.renderStyle) || this.defaultRenderMap, this.currentRenderService = renderService;
|
|
16515
16517
|
const {
|
|
16516
16518
|
context: context,
|
|
@@ -16525,7 +16527,7 @@
|
|
|
16525
16527
|
dirtyBounds.x1 = Math.floor(b.x1), dirtyBounds.y1 = Math.floor(b.y1), dirtyBounds.x2 = Math.ceil(b.x2), dirtyBounds.y2 = Math.ceil(b.y2);
|
|
16526
16528
|
}
|
|
16527
16529
|
const d = context.dpr % 1;
|
|
16528
|
-
(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) => {
|
|
16530
|
+
(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), (null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage) && renderService.drawParams.stage.hooks.afterClearScreen.call(renderService.drawParams), renderService.renderTreeRoots.sort((a, b) => {
|
|
16529
16531
|
var _a, _b;
|
|
16530
16532
|
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
16531
16533
|
}).forEach(group => {
|
|
@@ -17207,13 +17209,16 @@
|
|
|
17207
17209
|
} else this._skipRender = 1;
|
|
17208
17210
|
}, this.beforeRender = stage => {
|
|
17209
17211
|
this._beforeRender && this._beforeRender(stage);
|
|
17212
|
+
}, this.afterClearScreen = drawParams => {
|
|
17213
|
+
this._afterClearScreen && this._afterClearScreen(drawParams);
|
|
17210
17214
|
}, this.afterRender = stage => {
|
|
17211
17215
|
this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null, this.tickedBeforeRender = !1;
|
|
17212
17216
|
}, this.afterTickCb = () => {
|
|
17213
17217
|
this.tickedBeforeRender = !0, "rendering" !== this.state && this.renderNextFrame();
|
|
17214
17218
|
}, this.params = params, this.theme = new Theme(), this.hooks = {
|
|
17215
17219
|
beforeRender: new SyncHook(["stage"]),
|
|
17216
|
-
afterRender: new SyncHook(["stage"])
|
|
17220
|
+
afterRender: new SyncHook(["stage"]),
|
|
17221
|
+
afterClearScreen: new SyncHook(["stage"])
|
|
17217
17222
|
}, 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
17223
|
width: params.width,
|
|
17219
17224
|
height: params.height,
|
|
@@ -17225,7 +17230,7 @@
|
|
|
17225
17230
|
canvas: params.canvas
|
|
17226
17231
|
}), 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
17232
|
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), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
|
|
17233
|
+
})), 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.hooks.afterClearScreen.tap("constructor", this.afterClearScreen), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this._afterClearScreen = params.afterClearScreen, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
|
|
17229
17234
|
tickRenderMode: "effect"
|
|
17230
17235
|
}), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
|
|
17231
17236
|
background: this._background
|
|
@@ -17620,7 +17625,7 @@
|
|
|
17620
17625
|
return this._cursor;
|
|
17621
17626
|
}
|
|
17622
17627
|
eventPointTransform(e) {
|
|
17623
|
-
const point = this.global.mapToCanvasPoint(e, this.window
|
|
17628
|
+
const point = this.global.mapToCanvasPoint(e, this.window);
|
|
17624
17629
|
return this.stage.window.pointTransform(point.x, point.y);
|
|
17625
17630
|
}
|
|
17626
17631
|
pauseTriggerEvent() {
|
|
@@ -30504,7 +30509,7 @@
|
|
|
30504
30509
|
return this._animateCount;
|
|
30505
30510
|
}
|
|
30506
30511
|
constructor() {
|
|
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;
|
|
30512
|
+
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._animationEndFlag = !0, this.id = Generator.GenAutoIncrementId(), this.paused = !1;
|
|
30508
30513
|
}
|
|
30509
30514
|
isRunning() {
|
|
30510
30515
|
return !this.paused && this._animateCount > 0;
|
|
@@ -30533,10 +30538,11 @@
|
|
|
30533
30538
|
}
|
|
30534
30539
|
tick(delta) {
|
|
30535
30540
|
if (this.paused) return;
|
|
30541
|
+
this._animationEndFlag && (this._animationEndFlag = !1, this.emit("animationStart"));
|
|
30536
30542
|
const scaledDelta = delta * this._playSpeed;
|
|
30537
30543
|
this._currentTime += scaledDelta, this.forEachAccessAnimate((animate, i) => {
|
|
30538
30544
|
animate.status === exports.AnimateStatus.END ? this.removeAnimate(animate, !0) : animate.status !== exports.AnimateStatus.RUNNING && animate.status !== exports.AnimateStatus.INITIAL || animate.advance(scaledDelta);
|
|
30539
|
-
}), 0 === this._animateCount && this.emit("animationEnd");
|
|
30545
|
+
}), 0 === this._animateCount && (this._animationEndFlag = !0, this.emit("animationEnd"));
|
|
30540
30546
|
}
|
|
30541
30547
|
clear() {
|
|
30542
30548
|
this.forEachAccessAnimate(animate => {
|
|
@@ -30600,7 +30606,9 @@
|
|
|
30600
30606
|
return this._timeline;
|
|
30601
30607
|
}
|
|
30602
30608
|
bind(target) {
|
|
30603
|
-
return this.target = target, this.target.
|
|
30609
|
+
return this.target = target, this.target.animates || (this.target.animates = new Map()), this.target.animates.set(this.id, this), this.onRemove(() => {
|
|
30610
|
+
this.stop(), this.target.animates.delete(this.id);
|
|
30611
|
+
}), this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
|
|
30604
30612
|
}
|
|
30605
30613
|
to(props, duration = 300, easing = "linear") {
|
|
30606
30614
|
const step = new Step(exports.AnimateStepType.to, props, duration, easing);
|
|
@@ -30814,8 +30822,8 @@
|
|
|
30814
30822
|
}
|
|
30815
30823
|
init() {
|
|
30816
30824
|
this.interval = 16, this.status = exports.STATUS.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker", () => {
|
|
30817
|
-
this.initHandler();
|
|
30818
|
-
}), application.global.env && this.initHandler();
|
|
30825
|
+
this.initHandler(!1);
|
|
30826
|
+
}), application.global.env && this.initHandler(!1);
|
|
30819
30827
|
}
|
|
30820
30828
|
addTimeline(timeline) {
|
|
30821
30829
|
this.timelines.push(timeline);
|
|
@@ -30826,10 +30834,11 @@
|
|
|
30826
30834
|
getTimelines() {
|
|
30827
30835
|
return this.timelines;
|
|
30828
30836
|
}
|
|
30829
|
-
initHandler() {
|
|
30830
|
-
this.setupTickHandler();
|
|
30837
|
+
initHandler(force = !1) {
|
|
30838
|
+
this.setupTickHandler(force);
|
|
30831
30839
|
}
|
|
30832
|
-
setupTickHandler() {
|
|
30840
|
+
setupTickHandler(force = !1) {
|
|
30841
|
+
if (!force && this.tickerHandler) return !0;
|
|
30833
30842
|
const handler = new RAFTickHandler();
|
|
30834
30843
|
return this.tickerHandler && this.tickerHandler.release(), this.tickerHandler = handler, !0;
|
|
30835
30844
|
}
|
|
@@ -30880,7 +30889,7 @@
|
|
|
30880
30889
|
return this.status = exports.STATUS.RUNNING, this.tickerHandler.tick(0, this.handleTick), !0;
|
|
30881
30890
|
}
|
|
30882
30891
|
stop() {
|
|
30883
|
-
this.status = exports.STATUS.INITIAL, this.setupTickHandler(), this.lastFrameTime = -1;
|
|
30892
|
+
this.status = exports.STATUS.INITIAL, this.setupTickHandler(!0), this.lastFrameTime = -1;
|
|
30884
30893
|
}
|
|
30885
30894
|
trySyncTickStatus() {
|
|
30886
30895
|
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();
|
|
@@ -30890,7 +30899,8 @@
|
|
|
30890
30899
|
this.stop(), this.timelines = [], null === (_a = this.tickerHandler) || void 0 === _a || _a.release(), this.tickerHandler = null, this.lastFrameTime = -1;
|
|
30891
30900
|
}
|
|
30892
30901
|
checkSkip(delta) {
|
|
30893
|
-
|
|
30902
|
+
var _a, _b, _c;
|
|
30903
|
+
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;
|
|
30894
30904
|
return delta < this.interval + 2 * (Math.random() - .5) * this._jitter;
|
|
30895
30905
|
}
|
|
30896
30906
|
}
|
|
@@ -31193,10 +31203,11 @@
|
|
|
31193
31203
|
_handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic) {
|
|
31194
31204
|
var _a, _b, _c, _d;
|
|
31195
31205
|
if (custom && customType) {
|
|
31196
|
-
const customParams =
|
|
31206
|
+
const customParams = Object.assign({
|
|
31197
31207
|
width: graphic.stage.width,
|
|
31198
|
-
height: graphic.stage.height
|
|
31199
|
-
|
|
31208
|
+
height: graphic.stage.height,
|
|
31209
|
+
group: this._target.parent
|
|
31210
|
+
}, this.resolveValue(customParameters, graphic)),
|
|
31200
31211
|
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;
|
|
31201
31212
|
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);
|
|
31202
31213
|
} else "to" === type ? animate.to(props, duration, easing) : "from" === type && animate.from(props, duration, easing);
|
|
@@ -31414,6 +31425,14 @@
|
|
|
31414
31425
|
state.executor.stop();
|
|
31415
31426
|
}), this.stateList = null;
|
|
31416
31427
|
}
|
|
31428
|
+
reApplyState(state) {
|
|
31429
|
+
var _a;
|
|
31430
|
+
const stateInfo = null === (_a = this.stateList) || void 0 === _a ? void 0 : _a.find(stateInfo => stateInfo.state === state);
|
|
31431
|
+
if (stateInfo) {
|
|
31432
|
+
const stateList = this.stateList.slice();
|
|
31433
|
+
stateInfo.executor.stop(), this.stateList = stateList, stateInfo.executor.execute(stateInfo.animationConfig);
|
|
31434
|
+
}
|
|
31435
|
+
}
|
|
31417
31436
|
}
|
|
31418
31437
|
|
|
31419
31438
|
class GraphicStateExtension {
|
|
@@ -31444,11 +31463,20 @@
|
|
|
31444
31463
|
applyUnhighlightState(animationConfig, callback) {
|
|
31445
31464
|
return this._getAnimationStateManager(this).applyUnhighlightState(animationConfig, callback), this;
|
|
31446
31465
|
}
|
|
31447
|
-
stopAnimationState(state, type) {
|
|
31448
|
-
return this._getAnimationStateManager(this).stopState(state, type), this
|
|
31466
|
+
stopAnimationState(state, type, deep = !1) {
|
|
31467
|
+
return this._getAnimationStateManager(this).stopState(state, type), deep && this.isContainer && this.forEachChildren(child => {
|
|
31468
|
+
child.stopAnimationState(state, type, deep);
|
|
31469
|
+
}), this;
|
|
31449
31470
|
}
|
|
31450
31471
|
clearAnimationStates() {
|
|
31451
|
-
|
|
31472
|
+
const stateManager = this._animationStateManager;
|
|
31473
|
+
return stateManager && stateManager.clearState(), this;
|
|
31474
|
+
}
|
|
31475
|
+
reApplyAnimationState(state, deep = !1) {
|
|
31476
|
+
const stateManager = this._animationStateManager;
|
|
31477
|
+
return stateManager && stateManager.reApplyState(state), deep && this.isContainer && this.forEachChildren(child => {
|
|
31478
|
+
child.reApplyAnimationState(state, deep);
|
|
31479
|
+
}), this;
|
|
31452
31480
|
}
|
|
31453
31481
|
static extend(graphic) {
|
|
31454
31482
|
return new GraphicStateExtension()._getAnimationStateManager(graphic), graphic;
|
|
@@ -31461,7 +31489,6 @@
|
|
|
31461
31489
|
}
|
|
31462
31490
|
animate(params) {
|
|
31463
31491
|
var _a, _b, _c;
|
|
31464
|
-
this.animates || (this.animates = new Map());
|
|
31465
31492
|
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);
|
|
31466
31493
|
if (animate.bind(this), params) {
|
|
31467
31494
|
const {
|
|
@@ -31471,9 +31498,7 @@
|
|
|
31471
31498
|
} = params;
|
|
31472
31499
|
null != onStart && animate.onStart(onStart), null != onEnd && animate.onEnd(onEnd), null != onRemove && animate.onRemove(onRemove);
|
|
31473
31500
|
}
|
|
31474
|
-
return this.
|
|
31475
|
-
animate.stop(), this.animates.delete(animate.id);
|
|
31476
|
-
}), null === (_c = this.stage) || void 0 === _c || _c.ticker.start(), animate;
|
|
31501
|
+
return null === (_c = this.stage) || void 0 === _c || _c.ticker.start(), animate;
|
|
31477
31502
|
}
|
|
31478
31503
|
createTimeline() {
|
|
31479
31504
|
return new DefaultTimeline();
|
|
@@ -31504,6 +31529,21 @@
|
|
|
31504
31529
|
getGraphicAttribute(key, prev = !1) {
|
|
31505
31530
|
return !prev && this.finalAttribute ? this.finalAttribute[key] : this.attribute[key];
|
|
31506
31531
|
}
|
|
31532
|
+
pauseAnimation(deep = !1) {
|
|
31533
|
+
this.animates && this.animates.forEach(animate => animate.pause()), deep && this.isContainer && this.forEachChildren(child => {
|
|
31534
|
+
child.pauseAnimation(deep);
|
|
31535
|
+
});
|
|
31536
|
+
}
|
|
31537
|
+
resumeAnimation(deep = !1) {
|
|
31538
|
+
this.animates && this.animates.forEach(animate => animate.resume()), deep && this.isContainer && this.forEachChildren(child => {
|
|
31539
|
+
child.resumeAnimation(deep);
|
|
31540
|
+
});
|
|
31541
|
+
}
|
|
31542
|
+
stopAnimation(deep = !1) {
|
|
31543
|
+
this.animates && this.animates.forEach(animate => animate.stop()), deep && this.isContainer && this.forEachChildren(child => {
|
|
31544
|
+
child.stopAnimation(deep);
|
|
31545
|
+
});
|
|
31546
|
+
}
|
|
31507
31547
|
}
|
|
31508
31548
|
|
|
31509
31549
|
function registerAnimate() {
|
|
@@ -31512,7 +31552,7 @@
|
|
|
31512
31552
|
|
|
31513
31553
|
class ACustomAnimate extends Step {
|
|
31514
31554
|
constructor(customFrom, customTo, duration, easing, params) {
|
|
31515
|
-
super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params;
|
|
31555
|
+
super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params, this.from = customFrom, this.to = customTo;
|
|
31516
31556
|
}
|
|
31517
31557
|
update(end, ratio, out) {
|
|
31518
31558
|
if (this.onStart(), !this.props || !this.propKeys) return;
|
|
@@ -32669,7 +32709,7 @@
|
|
|
32669
32709
|
super(from, to, duration, easing, params);
|
|
32670
32710
|
}
|
|
32671
32711
|
onBind() {
|
|
32672
|
-
var _a, _b;
|
|
32712
|
+
var _a, _b, _c;
|
|
32673
32713
|
super.onBind();
|
|
32674
32714
|
const {
|
|
32675
32715
|
from: from,
|
|
@@ -32678,7 +32718,7 @@
|
|
|
32678
32718
|
fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
|
|
32679
32719
|
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
|
|
32680
32720
|
const finalAttribute = this.target.getFinalAttribute();
|
|
32681
|
-
finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
|
|
32721
|
+
finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(fromAttrs);
|
|
32682
32722
|
}
|
|
32683
32723
|
onEnd(cb) {
|
|
32684
32724
|
super.onEnd(cb);
|
|
@@ -32776,7 +32816,7 @@
|
|
|
32776
32816
|
super(from, to, duration, easing, params);
|
|
32777
32817
|
}
|
|
32778
32818
|
onBind() {
|
|
32779
|
-
var _a, _b;
|
|
32819
|
+
var _a, _b, _c;
|
|
32780
32820
|
super.onBind();
|
|
32781
32821
|
const {
|
|
32782
32822
|
from: from,
|
|
@@ -32785,7 +32825,7 @@
|
|
|
32785
32825
|
fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
|
|
32786
32826
|
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
|
|
32787
32827
|
const finalAttribute = this.target.getFinalAttribute();
|
|
32788
|
-
finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
|
|
32828
|
+
finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(fromAttrs);
|
|
32789
32829
|
}
|
|
32790
32830
|
onEnd(cb) {
|
|
32791
32831
|
super.onEnd(cb);
|
|
@@ -34636,16 +34676,15 @@
|
|
|
34636
34676
|
changedY = 0;
|
|
34637
34677
|
"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;
|
|
34638
34678
|
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,
|
|
34639
|
-
|
|
34640
|
-
|
|
34641
|
-
|
|
34642
|
-
|
|
34643
|
-
finalAttrsY = excludeChannels.includes("y") ? graphic.attribute.y : finalAttrs.y;
|
|
34679
|
+
finalAttrsX = graphic.getGraphicAttribute("x"),
|
|
34680
|
+
finalAttrsY = graphic.getGraphicAttribute("y"),
|
|
34681
|
+
fromX = excludeChannels.includes("x") ? finalAttrsX : point && isValidNumber$1(point.x) ? point.x : changedX,
|
|
34682
|
+
fromY = excludeChannels.includes("y") ? finalAttrsY : point && isValidNumber$1(point.y) ? point.y : changedY;
|
|
34644
34683
|
switch (direction) {
|
|
34645
34684
|
case "x":
|
|
34646
34685
|
return {
|
|
34647
34686
|
from: {
|
|
34648
|
-
x: fromX
|
|
34687
|
+
x: excludeChannels.includes("x") ? finalAttrsX : fromX
|
|
34649
34688
|
},
|
|
34650
34689
|
to: {
|
|
34651
34690
|
x: finalAttrsX
|
|
@@ -34674,25 +34713,26 @@
|
|
|
34674
34713
|
}
|
|
34675
34714
|
};
|
|
34676
34715
|
const moveOut = (graphic, options, animationParameters) => {
|
|
34677
|
-
var _a, _b, _c, _d
|
|
34716
|
+
var _a, _b, _c, _d;
|
|
34678
34717
|
const {
|
|
34679
34718
|
offset = 0,
|
|
34680
34719
|
orient: orient,
|
|
34681
34720
|
direction: direction,
|
|
34682
34721
|
point: pointOpt
|
|
34683
34722
|
} = null != options ? options : {},
|
|
34684
|
-
|
|
34685
|
-
|
|
34723
|
+
groupBounds = animationParameters.group ? animationParameters.group.AABBBounds : null,
|
|
34724
|
+
groupWidth = null !== (_a = groupBounds.width()) && void 0 !== _a ? _a : animationParameters.width,
|
|
34725
|
+
groupHeight = null !== (_b = groupBounds.height()) && void 0 !== _b ? _b : animationParameters.height,
|
|
34686
34726
|
changedX = ("negative" === orient ? groupWidth : 0) + offset,
|
|
34687
34727
|
changedY = ("negative" === orient ? groupHeight : 0) + offset,
|
|
34688
|
-
point = isFunction$1(pointOpt) ? pointOpt.call(null, null === (
|
|
34728
|
+
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,
|
|
34689
34729
|
fromX = point && isValidNumber$1(point.x) ? point.x : changedX,
|
|
34690
34730
|
fromY = point && isValidNumber$1(point.y) ? point.y : changedY;
|
|
34691
34731
|
switch (direction) {
|
|
34692
34732
|
case "x":
|
|
34693
34733
|
return {
|
|
34694
34734
|
from: {
|
|
34695
|
-
x: graphic.
|
|
34735
|
+
x: graphic.getGraphicAttribute("x")
|
|
34696
34736
|
},
|
|
34697
34737
|
to: {
|
|
34698
34738
|
x: fromX
|
|
@@ -34701,7 +34741,7 @@
|
|
|
34701
34741
|
case "y":
|
|
34702
34742
|
return {
|
|
34703
34743
|
from: {
|
|
34704
|
-
y: graphic.
|
|
34744
|
+
y: graphic.getGraphicAttribute("y")
|
|
34705
34745
|
},
|
|
34706
34746
|
to: {
|
|
34707
34747
|
y: fromY
|
|
@@ -34710,8 +34750,8 @@
|
|
|
34710
34750
|
default:
|
|
34711
34751
|
return {
|
|
34712
34752
|
from: {
|
|
34713
|
-
x: graphic.
|
|
34714
|
-
y: graphic.
|
|
34753
|
+
x: graphic.getGraphicAttribute("x"),
|
|
34754
|
+
y: graphic.getGraphicAttribute("y")
|
|
34715
34755
|
},
|
|
34716
34756
|
to: {
|
|
34717
34757
|
x: fromX,
|
|
@@ -34858,6 +34898,9 @@
|
|
|
34858
34898
|
this.from[key] = null !== (_a = this.from[key]) && void 0 !== _a ? _a : startProps[key];
|
|
34859
34899
|
}), this.target.setAttributes(this.from);
|
|
34860
34900
|
}
|
|
34901
|
+
deleteSelfAttr(key) {
|
|
34902
|
+
super.deleteSelfAttr(key), delete this.from[key];
|
|
34903
|
+
}
|
|
34861
34904
|
update(end, ratio, out) {
|
|
34862
34905
|
if (this.onStart(), !this.props || !this.propKeys) return;
|
|
34863
34906
|
const easedRatio = this.easing(ratio);
|
|
@@ -34926,9 +34969,8 @@
|
|
|
34926
34969
|
w = Math.min(Math.min(currentX + maxLength, maxLength), streamLength - currentX),
|
|
34927
34970
|
width = w + x > parentWidth ? Math.max(parentWidth - x, 0) : w;
|
|
34928
34971
|
this.rect.setAttributes({
|
|
34929
|
-
x: x,
|
|
34930
|
-
width: width
|
|
34931
|
-
dx: Math.min(parentAttr.x1 - parentAttr.x, 0)
|
|
34972
|
+
x: x + Math.min(parentAttr.x1 - parentAttr.x, 0),
|
|
34973
|
+
width: width
|
|
34932
34974
|
}, !1, {
|
|
34933
34975
|
type: exports.AttributeUpdateType.ANIMATE_PLAY,
|
|
34934
34976
|
animationState: {
|
|
@@ -34945,9 +34987,8 @@
|
|
|
34945
34987
|
const h = Math.min(parentHeight - currentY, maxLength);
|
|
34946
34988
|
let height;
|
|
34947
34989
|
y <= 0 ? (height = Math.max(y + h, 0), y = 0) : height = h, this.rect.setAttributes({
|
|
34948
|
-
y: y,
|
|
34949
|
-
height: height
|
|
34950
|
-
dy: Math.min(parentAttr.y1 - parentAttr.y, 0)
|
|
34990
|
+
y: y + Math.min(parentAttr.y1 - parentAttr.y, 0),
|
|
34991
|
+
height: height
|
|
34951
34992
|
}, !1, {
|
|
34952
34993
|
type: exports.AttributeUpdateType.ANIMATE_PLAY,
|
|
34953
34994
|
animationState: {
|
|
@@ -35054,7 +35095,7 @@
|
|
|
35054
35095
|
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);
|
|
35055
35096
|
};
|
|
35056
35097
|
|
|
35057
|
-
const version = "1.0.8
|
|
35098
|
+
const version = "1.0.8";
|
|
35058
35099
|
preLoadAllModule();
|
|
35059
35100
|
if (isBrowserEnv()) {
|
|
35060
35101
|
loadBrowserEnv(container);
|
|
@@ -35223,6 +35264,7 @@
|
|
|
35223
35264
|
exports.DrawContribution = DrawContribution;
|
|
35224
35265
|
exports.DrawItemInterceptor = DrawItemInterceptor;
|
|
35225
35266
|
exports.DynamicLayerHandlerContribution = DynamicLayerHandlerContribution;
|
|
35267
|
+
exports.Easing = Easing;
|
|
35226
35268
|
exports.EditModule = EditModule;
|
|
35227
35269
|
exports.EnvContribution = EnvContribution;
|
|
35228
35270
|
exports.EventManager = EventManager;
|