@visactor/vrender 1.0.8-alpha.2 → 1.0.9-alpha.1
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 +106 -62
- package/dist/index.js +106 -61
- 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 => {
|
|
@@ -16661,7 +16663,7 @@
|
|
|
16661
16663
|
return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
|
|
16662
16664
|
}
|
|
16663
16665
|
clearScreen(renderService, context, drawContext) {
|
|
16664
|
-
var _a, _b;
|
|
16666
|
+
var _a, _b, _c;
|
|
16665
16667
|
const {
|
|
16666
16668
|
clear: clear,
|
|
16667
16669
|
viewBox: viewBox
|
|
@@ -16669,9 +16671,9 @@
|
|
|
16669
16671
|
width = viewBox.width(),
|
|
16670
16672
|
height = viewBox.height();
|
|
16671
16673
|
if (clear) {
|
|
16672
|
-
context.clearRect(0, 0, width, height);
|
|
16673
|
-
const stage = null === (
|
|
16674
|
-
if (stage && (context.globalAlpha = null !== (
|
|
16674
|
+
context.clearRect(0, 0, width, height), (null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage) && renderService.drawParams.stage.hooks.afterClearScreen.call(renderService.drawParams);
|
|
16675
|
+
const stage = null === (_b = renderService.drawParams) || void 0 === _b ? void 0 : _b.stage;
|
|
16676
|
+
if (stage && (context.globalAlpha = null !== (_c = stage.attribute.opacity) && void 0 !== _c ? _c : 1), stage && stage.backgroundImg && stage.resources) {
|
|
16675
16677
|
const res = stage.resources.get(clear);
|
|
16676
16678
|
res && "success" === res.state && res.data && context.drawImage(res.data, 0, 0, width, height);
|
|
16677
16679
|
} else context.fillStyle = createColor(context, clear, {
|
|
@@ -17207,13 +17209,19 @@
|
|
|
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);
|
|
17214
|
+
}, this.afterClearRect = drawParams => {
|
|
17215
|
+
this._afterClearRect && this._afterClearRect(drawParams);
|
|
17210
17216
|
}, this.afterRender = stage => {
|
|
17211
17217
|
this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null, this.tickedBeforeRender = !1;
|
|
17212
17218
|
}, this.afterTickCb = () => {
|
|
17213
17219
|
this.tickedBeforeRender = !0, "rendering" !== this.state && this.renderNextFrame();
|
|
17214
17220
|
}, this.params = params, this.theme = new Theme(), this.hooks = {
|
|
17215
17221
|
beforeRender: new SyncHook(["stage"]),
|
|
17216
|
-
afterRender: new SyncHook(["stage"])
|
|
17222
|
+
afterRender: new SyncHook(["stage"]),
|
|
17223
|
+
afterClearScreen: new SyncHook(["stage"]),
|
|
17224
|
+
afterClearRect: new SyncHook(["stage"])
|
|
17217
17225
|
}, 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
17226
|
width: params.width,
|
|
17219
17227
|
height: params.height,
|
|
@@ -17225,7 +17233,7 @@
|
|
|
17225
17233
|
canvas: params.canvas
|
|
17226
17234
|
}), 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
17235
|
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 = {
|
|
17236
|
+
})), 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.hooks.afterClearRect.tap("constructor", this.afterClearRect), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this._afterClearScreen = params.afterClearScreen, this._afterClearRect = params.afterClearRect, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
|
|
17229
17237
|
tickRenderMode: "effect"
|
|
17230
17238
|
}), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
|
|
17231
17239
|
background: this._background
|
|
@@ -17620,7 +17628,7 @@
|
|
|
17620
17628
|
return this._cursor;
|
|
17621
17629
|
}
|
|
17622
17630
|
eventPointTransform(e) {
|
|
17623
|
-
const point = this.global.mapToCanvasPoint(e, this.window
|
|
17631
|
+
const point = this.global.mapToCanvasPoint(e, this.window);
|
|
17624
17632
|
return this.stage.window.pointTransform(point.x, point.y);
|
|
17625
17633
|
}
|
|
17626
17634
|
pauseTriggerEvent() {
|
|
@@ -30504,7 +30512,7 @@
|
|
|
30504
30512
|
return this._animateCount;
|
|
30505
30513
|
}
|
|
30506
30514
|
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;
|
|
30515
|
+
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
30516
|
}
|
|
30509
30517
|
isRunning() {
|
|
30510
30518
|
return !this.paused && this._animateCount > 0;
|
|
@@ -30533,10 +30541,11 @@
|
|
|
30533
30541
|
}
|
|
30534
30542
|
tick(delta) {
|
|
30535
30543
|
if (this.paused) return;
|
|
30544
|
+
this._animationEndFlag && (this._animationEndFlag = !1, this.emit("animationStart"));
|
|
30536
30545
|
const scaledDelta = delta * this._playSpeed;
|
|
30537
30546
|
this._currentTime += scaledDelta, this.forEachAccessAnimate((animate, i) => {
|
|
30538
30547
|
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");
|
|
30548
|
+
}), 0 === this._animateCount && (this._animationEndFlag = !0, this.emit("animationEnd"));
|
|
30540
30549
|
}
|
|
30541
30550
|
clear() {
|
|
30542
30551
|
this.forEachAccessAnimate(animate => {
|
|
@@ -30600,7 +30609,9 @@
|
|
|
30600
30609
|
return this._timeline;
|
|
30601
30610
|
}
|
|
30602
30611
|
bind(target) {
|
|
30603
|
-
return this.target = target, this.target.
|
|
30612
|
+
return this.target = target, this.target.animates || (this.target.animates = new Map()), this.target.animates.set(this.id, this), this.onRemove(() => {
|
|
30613
|
+
this.stop(), this.target.animates.delete(this.id);
|
|
30614
|
+
}), this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
|
|
30604
30615
|
}
|
|
30605
30616
|
to(props, duration = 300, easing = "linear") {
|
|
30606
30617
|
const step = new Step(exports.AnimateStepType.to, props, duration, easing);
|
|
@@ -30814,8 +30825,8 @@
|
|
|
30814
30825
|
}
|
|
30815
30826
|
init() {
|
|
30816
30827
|
this.interval = 16, this.status = exports.STATUS.INITIAL, application.global.hooks.onSetEnv.tap("graph-ticker", () => {
|
|
30817
|
-
this.initHandler();
|
|
30818
|
-
}), application.global.env && this.initHandler();
|
|
30828
|
+
this.initHandler(!1);
|
|
30829
|
+
}), application.global.env && this.initHandler(!1);
|
|
30819
30830
|
}
|
|
30820
30831
|
addTimeline(timeline) {
|
|
30821
30832
|
this.timelines.push(timeline);
|
|
@@ -30826,10 +30837,11 @@
|
|
|
30826
30837
|
getTimelines() {
|
|
30827
30838
|
return this.timelines;
|
|
30828
30839
|
}
|
|
30829
|
-
initHandler() {
|
|
30830
|
-
this.setupTickHandler();
|
|
30840
|
+
initHandler(force = !1) {
|
|
30841
|
+
this.setupTickHandler(force);
|
|
30831
30842
|
}
|
|
30832
|
-
setupTickHandler() {
|
|
30843
|
+
setupTickHandler(force = !1) {
|
|
30844
|
+
if (!force && this.tickerHandler) return !0;
|
|
30833
30845
|
const handler = new RAFTickHandler();
|
|
30834
30846
|
return this.tickerHandler && this.tickerHandler.release(), this.tickerHandler = handler, !0;
|
|
30835
30847
|
}
|
|
@@ -30880,7 +30892,7 @@
|
|
|
30880
30892
|
return this.status = exports.STATUS.RUNNING, this.tickerHandler.tick(0, this.handleTick), !0;
|
|
30881
30893
|
}
|
|
30882
30894
|
stop() {
|
|
30883
|
-
this.status = exports.STATUS.INITIAL, this.setupTickHandler(), this.lastFrameTime = -1;
|
|
30895
|
+
this.status = exports.STATUS.INITIAL, this.setupTickHandler(!0), this.lastFrameTime = -1;
|
|
30884
30896
|
}
|
|
30885
30897
|
trySyncTickStatus() {
|
|
30886
30898
|
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 +30902,8 @@
|
|
|
30890
30902
|
this.stop(), this.timelines = [], null === (_a = this.tickerHandler) || void 0 === _a || _a.release(), this.tickerHandler = null, this.lastFrameTime = -1;
|
|
30891
30903
|
}
|
|
30892
30904
|
checkSkip(delta) {
|
|
30893
|
-
|
|
30905
|
+
var _a, _b, _c;
|
|
30906
|
+
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
30907
|
return delta < this.interval + 2 * (Math.random() - .5) * this._jitter;
|
|
30895
30908
|
}
|
|
30896
30909
|
}
|
|
@@ -31193,10 +31206,11 @@
|
|
|
31193
31206
|
_handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic) {
|
|
31194
31207
|
var _a, _b, _c, _d;
|
|
31195
31208
|
if (custom && customType) {
|
|
31196
|
-
const customParams =
|
|
31209
|
+
const customParams = Object.assign({
|
|
31197
31210
|
width: graphic.stage.width,
|
|
31198
|
-
height: graphic.stage.height
|
|
31199
|
-
|
|
31211
|
+
height: graphic.stage.height,
|
|
31212
|
+
group: this._target.parent
|
|
31213
|
+
}, this.resolveValue(customParameters, graphic)),
|
|
31200
31214
|
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
31215
|
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
31216
|
} else "to" === type ? animate.to(props, duration, easing) : "from" === type && animate.from(props, duration, easing);
|
|
@@ -31414,6 +31428,14 @@
|
|
|
31414
31428
|
state.executor.stop();
|
|
31415
31429
|
}), this.stateList = null;
|
|
31416
31430
|
}
|
|
31431
|
+
reApplyState(state) {
|
|
31432
|
+
var _a;
|
|
31433
|
+
const stateInfo = null === (_a = this.stateList) || void 0 === _a ? void 0 : _a.find(stateInfo => stateInfo.state === state);
|
|
31434
|
+
if (stateInfo) {
|
|
31435
|
+
const stateList = this.stateList.slice();
|
|
31436
|
+
stateInfo.executor.stop(), this.stateList = stateList, stateInfo.executor.execute(stateInfo.animationConfig);
|
|
31437
|
+
}
|
|
31438
|
+
}
|
|
31417
31439
|
}
|
|
31418
31440
|
|
|
31419
31441
|
class GraphicStateExtension {
|
|
@@ -31444,11 +31466,20 @@
|
|
|
31444
31466
|
applyUnhighlightState(animationConfig, callback) {
|
|
31445
31467
|
return this._getAnimationStateManager(this).applyUnhighlightState(animationConfig, callback), this;
|
|
31446
31468
|
}
|
|
31447
|
-
stopAnimationState(state, type) {
|
|
31448
|
-
return this._getAnimationStateManager(this).stopState(state, type), this
|
|
31469
|
+
stopAnimationState(state, type, deep = !1) {
|
|
31470
|
+
return this._getAnimationStateManager(this).stopState(state, type), deep && this.isContainer && this.forEachChildren(child => {
|
|
31471
|
+
child.stopAnimationState(state, type, deep);
|
|
31472
|
+
}), this;
|
|
31449
31473
|
}
|
|
31450
31474
|
clearAnimationStates() {
|
|
31451
|
-
|
|
31475
|
+
const stateManager = this._animationStateManager;
|
|
31476
|
+
return stateManager && stateManager.clearState(), this;
|
|
31477
|
+
}
|
|
31478
|
+
reApplyAnimationState(state, deep = !1) {
|
|
31479
|
+
const stateManager = this._animationStateManager;
|
|
31480
|
+
return stateManager && stateManager.reApplyState(state), deep && this.isContainer && this.forEachChildren(child => {
|
|
31481
|
+
child.reApplyAnimationState(state, deep);
|
|
31482
|
+
}), this;
|
|
31452
31483
|
}
|
|
31453
31484
|
static extend(graphic) {
|
|
31454
31485
|
return new GraphicStateExtension()._getAnimationStateManager(graphic), graphic;
|
|
@@ -31461,7 +31492,6 @@
|
|
|
31461
31492
|
}
|
|
31462
31493
|
animate(params) {
|
|
31463
31494
|
var _a, _b, _c;
|
|
31464
|
-
this.animates || (this.animates = new Map());
|
|
31465
31495
|
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
31496
|
if (animate.bind(this), params) {
|
|
31467
31497
|
const {
|
|
@@ -31471,9 +31501,7 @@
|
|
|
31471
31501
|
} = params;
|
|
31472
31502
|
null != onStart && animate.onStart(onStart), null != onEnd && animate.onEnd(onEnd), null != onRemove && animate.onRemove(onRemove);
|
|
31473
31503
|
}
|
|
31474
|
-
return this.
|
|
31475
|
-
animate.stop(), this.animates.delete(animate.id);
|
|
31476
|
-
}), null === (_c = this.stage) || void 0 === _c || _c.ticker.start(), animate;
|
|
31504
|
+
return null === (_c = this.stage) || void 0 === _c || _c.ticker.start(), animate;
|
|
31477
31505
|
}
|
|
31478
31506
|
createTimeline() {
|
|
31479
31507
|
return new DefaultTimeline();
|
|
@@ -31504,6 +31532,21 @@
|
|
|
31504
31532
|
getGraphicAttribute(key, prev = !1) {
|
|
31505
31533
|
return !prev && this.finalAttribute ? this.finalAttribute[key] : this.attribute[key];
|
|
31506
31534
|
}
|
|
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
|
+
}
|
|
31507
31550
|
}
|
|
31508
31551
|
|
|
31509
31552
|
function registerAnimate() {
|
|
@@ -31512,7 +31555,7 @@
|
|
|
31512
31555
|
|
|
31513
31556
|
class ACustomAnimate extends Step {
|
|
31514
31557
|
constructor(customFrom, customTo, duration, easing, params) {
|
|
31515
|
-
super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params;
|
|
31558
|
+
super("customAnimate", customTo, duration, easing), this.type = "customAnimate", this.customFrom = customFrom, this.params = params, this.from = customFrom, this.to = customTo;
|
|
31516
31559
|
}
|
|
31517
31560
|
update(end, ratio, out) {
|
|
31518
31561
|
if (this.onStart(), !this.props || !this.propKeys) return;
|
|
@@ -32669,7 +32712,7 @@
|
|
|
32669
32712
|
super(from, to, duration, easing, params);
|
|
32670
32713
|
}
|
|
32671
32714
|
onBind() {
|
|
32672
|
-
var _a, _b;
|
|
32715
|
+
var _a, _b, _c;
|
|
32673
32716
|
super.onBind();
|
|
32674
32717
|
const {
|
|
32675
32718
|
from: from,
|
|
@@ -32678,7 +32721,7 @@
|
|
|
32678
32721
|
fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
|
|
32679
32722
|
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
|
|
32680
32723
|
const finalAttribute = this.target.getFinalAttribute();
|
|
32681
|
-
finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
|
|
32724
|
+
finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(fromAttrs);
|
|
32682
32725
|
}
|
|
32683
32726
|
onEnd(cb) {
|
|
32684
32727
|
super.onEnd(cb);
|
|
@@ -32776,7 +32819,7 @@
|
|
|
32776
32819
|
super(from, to, duration, easing, params);
|
|
32777
32820
|
}
|
|
32778
32821
|
onBind() {
|
|
32779
|
-
var _a, _b;
|
|
32822
|
+
var _a, _b, _c;
|
|
32780
32823
|
super.onBind();
|
|
32781
32824
|
const {
|
|
32782
32825
|
from: from,
|
|
@@ -32785,7 +32828,7 @@
|
|
|
32785
32828
|
fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
|
|
32786
32829
|
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
|
|
32787
32830
|
const finalAttribute = this.target.getFinalAttribute();
|
|
32788
|
-
finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
|
|
32831
|
+
finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(fromAttrs);
|
|
32789
32832
|
}
|
|
32790
32833
|
onEnd(cb) {
|
|
32791
32834
|
super.onEnd(cb);
|
|
@@ -34636,16 +34679,15 @@
|
|
|
34636
34679
|
changedY = 0;
|
|
34637
34680
|
"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
34681
|
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;
|
|
34682
|
+
finalAttrsX = graphic.getGraphicAttribute("x"),
|
|
34683
|
+
finalAttrsY = graphic.getGraphicAttribute("y"),
|
|
34684
|
+
fromX = excludeChannels.includes("x") ? finalAttrsX : point && isValidNumber$1(point.x) ? point.x : changedX,
|
|
34685
|
+
fromY = excludeChannels.includes("y") ? finalAttrsY : point && isValidNumber$1(point.y) ? point.y : changedY;
|
|
34644
34686
|
switch (direction) {
|
|
34645
34687
|
case "x":
|
|
34646
34688
|
return {
|
|
34647
34689
|
from: {
|
|
34648
|
-
x: fromX
|
|
34690
|
+
x: excludeChannels.includes("x") ? finalAttrsX : fromX
|
|
34649
34691
|
},
|
|
34650
34692
|
to: {
|
|
34651
34693
|
x: finalAttrsX
|
|
@@ -34674,25 +34716,26 @@
|
|
|
34674
34716
|
}
|
|
34675
34717
|
};
|
|
34676
34718
|
const moveOut = (graphic, options, animationParameters) => {
|
|
34677
|
-
var _a, _b, _c, _d
|
|
34719
|
+
var _a, _b, _c, _d;
|
|
34678
34720
|
const {
|
|
34679
34721
|
offset = 0,
|
|
34680
34722
|
orient: orient,
|
|
34681
34723
|
direction: direction,
|
|
34682
34724
|
point: pointOpt
|
|
34683
34725
|
} = null != options ? options : {},
|
|
34684
|
-
|
|
34685
|
-
|
|
34726
|
+
groupBounds = animationParameters.group ? animationParameters.group.AABBBounds : null,
|
|
34727
|
+
groupWidth = null !== (_a = groupBounds.width()) && void 0 !== _a ? _a : animationParameters.width,
|
|
34728
|
+
groupHeight = null !== (_b = groupBounds.height()) && void 0 !== _b ? _b : animationParameters.height,
|
|
34686
34729
|
changedX = ("negative" === orient ? groupWidth : 0) + offset,
|
|
34687
34730
|
changedY = ("negative" === orient ? groupHeight : 0) + offset,
|
|
34688
|
-
point = isFunction$1(pointOpt) ? pointOpt.call(null, null === (
|
|
34731
|
+
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
34732
|
fromX = point && isValidNumber$1(point.x) ? point.x : changedX,
|
|
34690
34733
|
fromY = point && isValidNumber$1(point.y) ? point.y : changedY;
|
|
34691
34734
|
switch (direction) {
|
|
34692
34735
|
case "x":
|
|
34693
34736
|
return {
|
|
34694
34737
|
from: {
|
|
34695
|
-
x: graphic.
|
|
34738
|
+
x: graphic.getGraphicAttribute("x")
|
|
34696
34739
|
},
|
|
34697
34740
|
to: {
|
|
34698
34741
|
x: fromX
|
|
@@ -34701,7 +34744,7 @@
|
|
|
34701
34744
|
case "y":
|
|
34702
34745
|
return {
|
|
34703
34746
|
from: {
|
|
34704
|
-
y: graphic.
|
|
34747
|
+
y: graphic.getGraphicAttribute("y")
|
|
34705
34748
|
},
|
|
34706
34749
|
to: {
|
|
34707
34750
|
y: fromY
|
|
@@ -34710,8 +34753,8 @@
|
|
|
34710
34753
|
default:
|
|
34711
34754
|
return {
|
|
34712
34755
|
from: {
|
|
34713
|
-
x: graphic.
|
|
34714
|
-
y: graphic.
|
|
34756
|
+
x: graphic.getGraphicAttribute("x"),
|
|
34757
|
+
y: graphic.getGraphicAttribute("y")
|
|
34715
34758
|
},
|
|
34716
34759
|
to: {
|
|
34717
34760
|
x: fromX,
|
|
@@ -34858,6 +34901,9 @@
|
|
|
34858
34901
|
this.from[key] = null !== (_a = this.from[key]) && void 0 !== _a ? _a : startProps[key];
|
|
34859
34902
|
}), this.target.setAttributes(this.from);
|
|
34860
34903
|
}
|
|
34904
|
+
deleteSelfAttr(key) {
|
|
34905
|
+
super.deleteSelfAttr(key), delete this.from[key];
|
|
34906
|
+
}
|
|
34861
34907
|
update(end, ratio, out) {
|
|
34862
34908
|
if (this.onStart(), !this.props || !this.propKeys) return;
|
|
34863
34909
|
const easedRatio = this.easing(ratio);
|
|
@@ -34926,9 +34972,8 @@
|
|
|
34926
34972
|
w = Math.min(Math.min(currentX + maxLength, maxLength), streamLength - currentX),
|
|
34927
34973
|
width = w + x > parentWidth ? Math.max(parentWidth - x, 0) : w;
|
|
34928
34974
|
this.rect.setAttributes({
|
|
34929
|
-
x: x,
|
|
34930
|
-
width: width
|
|
34931
|
-
dx: Math.min(parentAttr.x1 - parentAttr.x, 0)
|
|
34975
|
+
x: x + Math.min(parentAttr.x1 - parentAttr.x, 0),
|
|
34976
|
+
width: width
|
|
34932
34977
|
}, !1, {
|
|
34933
34978
|
type: exports.AttributeUpdateType.ANIMATE_PLAY,
|
|
34934
34979
|
animationState: {
|
|
@@ -34945,9 +34990,8 @@
|
|
|
34945
34990
|
const h = Math.min(parentHeight - currentY, maxLength);
|
|
34946
34991
|
let height;
|
|
34947
34992
|
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)
|
|
34993
|
+
y: y + Math.min(parentAttr.y1 - parentAttr.y, 0),
|
|
34994
|
+
height: height
|
|
34951
34995
|
}, !1, {
|
|
34952
34996
|
type: exports.AttributeUpdateType.ANIMATE_PLAY,
|
|
34953
34997
|
animationState: {
|
|
@@ -35054,7 +35098,7 @@
|
|
|
35054
35098
|
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
35099
|
};
|
|
35056
35100
|
|
|
35057
|
-
const version = "1.0.
|
|
35101
|
+
const version = "1.0.9-alpha.1";
|
|
35058
35102
|
preLoadAllModule();
|
|
35059
35103
|
if (isBrowserEnv()) {
|
|
35060
35104
|
loadBrowserEnv(container);
|
|
@@ -35223,6 +35267,7 @@
|
|
|
35223
35267
|
exports.DrawContribution = DrawContribution;
|
|
35224
35268
|
exports.DrawItemInterceptor = DrawItemInterceptor;
|
|
35225
35269
|
exports.DynamicLayerHandlerContribution = DynamicLayerHandlerContribution;
|
|
35270
|
+
exports.Easing = Easing;
|
|
35226
35271
|
exports.EditModule = EditModule;
|
|
35227
35272
|
exports.EnvContribution = EnvContribution;
|
|
35228
35273
|
exports.EventManager = EventManager;
|