@visactor/vrender 1.0.9 → 1.0.11
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 +4 -3
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +95 -38
- package/dist/index.js +95 -37
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +4 -2
- package/es/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -4377,7 +4377,8 @@
|
|
|
4377
4377
|
y1: 0,
|
|
4378
4378
|
strokeBoundsBuffer: 0,
|
|
4379
4379
|
cornerRadius: 0,
|
|
4380
|
-
cornerType: "round"
|
|
4380
|
+
cornerType: "round",
|
|
4381
|
+
drawStrokeWhenZeroWH: !1
|
|
4381
4382
|
});
|
|
4382
4383
|
const DefaultRect3dAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
4383
4384
|
width: 0,
|
|
@@ -4386,7 +4387,8 @@
|
|
|
4386
4387
|
y1: 0,
|
|
4387
4388
|
cornerRadius: 0,
|
|
4388
4389
|
length: 0,
|
|
4389
|
-
cornerType: "round"
|
|
4390
|
+
cornerType: "round",
|
|
4391
|
+
drawStrokeWhenZeroWH: !1
|
|
4390
4392
|
});
|
|
4391
4393
|
const DefaultSymbolAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
4392
4394
|
symbolType: "circle",
|
|
@@ -9205,7 +9207,7 @@
|
|
|
9205
9207
|
});
|
|
9206
9208
|
}
|
|
9207
9209
|
setAttributes(params, forceUpdateTag = !1, context) {
|
|
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);
|
|
9210
|
+
params && ((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
9211
|
}
|
|
9210
9212
|
_setAttributes(params, forceUpdateTag = !1, context) {
|
|
9211
9213
|
const keys = Object.keys(params);
|
|
@@ -10030,8 +10032,8 @@
|
|
|
10030
10032
|
function strokeVisible(opacity, strokeOpacity) {
|
|
10031
10033
|
return opacity * strokeOpacity > 0;
|
|
10032
10034
|
}
|
|
10033
|
-
function rectStrokeVisible(opacity, strokeOpacity, width, height) {
|
|
10034
|
-
return opacity * strokeOpacity > 0 && 0 !== width && 0 !== height;
|
|
10035
|
+
function rectStrokeVisible(opacity, strokeOpacity, width, height, drawStrokeWhenZeroWH) {
|
|
10036
|
+
return drawStrokeWhenZeroWH ? opacity * strokeOpacity > 0 : opacity * strokeOpacity > 0 && 0 !== width && 0 !== height;
|
|
10035
10037
|
}
|
|
10036
10038
|
function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
|
|
10037
10039
|
const x10 = x1 - x0,
|
|
@@ -11639,14 +11641,10 @@
|
|
|
11639
11641
|
attrs && (Object.assign(stateAttrs, attrs.attributes), (null === (_a = attrs.subAttributes) || void 0 === _a ? void 0 : _a.length) && subAttrs.forEach((subAttrs, index) => {
|
|
11640
11642
|
Object.assign(subAttrs, attrs.subAttributes[index]);
|
|
11641
11643
|
}));
|
|
11642
|
-
}), this.subGraphic.forEach((graphic, index) => {
|
|
11643
|
-
graphic.updateNormalAttrs(subAttrs[index]), graphic.applyStateAttrs(subAttrs[index], states, hasAnimation);
|
|
11644
11644
|
}), this.updateNormalAttrs(stateAttrs), this.currentStates = states, this.applyStateAttrs(stateAttrs, states, hasAnimation);
|
|
11645
11645
|
}
|
|
11646
11646
|
clearStates(hasAnimation) {
|
|
11647
|
-
this.stopStateAnimates(), this.hasState() && this.normalAttrs ? (this.currentStates = [], this.
|
|
11648
|
-
graphic.applyStateAttrs(graphic.normalAttrs, this.currentStates, hasAnimation, !0), graphic.normalAttrs = null;
|
|
11649
|
-
}), this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0)) : this.currentStates = [], this.normalAttrs = null;
|
|
11647
|
+
this.stopStateAnimates(), this.hasState() && this.normalAttrs ? (this.currentStates = [], this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, !0)) : this.currentStates = [], this.normalAttrs = null;
|
|
11650
11648
|
}
|
|
11651
11649
|
clone() {
|
|
11652
11650
|
const glyph = new Glyph(Object.assign({}, this.attribute));
|
|
@@ -15116,7 +15114,8 @@
|
|
|
15116
15114
|
y1: y1,
|
|
15117
15115
|
x: originX = rectAttribute.x,
|
|
15118
15116
|
y: originY = rectAttribute.y,
|
|
15119
|
-
fillStrokeOrder = rectAttribute.fillStrokeOrder
|
|
15117
|
+
fillStrokeOrder = rectAttribute.fillStrokeOrder,
|
|
15118
|
+
drawStrokeWhenZeroWH = rectAttribute.drawStrokeWhenZeroWH
|
|
15120
15119
|
} = rect.attribute;
|
|
15121
15120
|
let {
|
|
15122
15121
|
width: width,
|
|
@@ -15124,7 +15123,7 @@
|
|
|
15124
15123
|
} = rect.attribute;
|
|
15125
15124
|
width = (null != width ? width : x1 - originX) || 0, height = (null != height ? height : y1 - originY) || 0;
|
|
15126
15125
|
const fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
|
|
15127
|
-
sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
|
|
15126
|
+
sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height, drawStrokeWhenZeroWH),
|
|
15128
15127
|
doFill = runFill(fill, background),
|
|
15129
15128
|
doStroke = runStroke(stroke, lineWidth);
|
|
15130
15129
|
if (!rect.valid || !visible) return;
|
|
@@ -17208,13 +17207,13 @@
|
|
|
17208
17207
|
this._skipRender > 1 && this.renderNextFrame(), this._skipRender = 0;
|
|
17209
17208
|
} else this._skipRender = 1;
|
|
17210
17209
|
}, this.beforeRender = stage => {
|
|
17211
|
-
this.
|
|
17210
|
+
this._beforeRenderList.forEach(cb => cb(stage));
|
|
17212
17211
|
}, this.afterClearScreen = drawParams => {
|
|
17213
17212
|
this._afterClearScreen && this._afterClearScreen(drawParams);
|
|
17214
17213
|
}, this.afterClearRect = drawParams => {
|
|
17215
17214
|
this._afterClearRect && this._afterClearRect(drawParams);
|
|
17216
17215
|
}, this.afterRender = stage => {
|
|
17217
|
-
this.renderCount++, this.
|
|
17216
|
+
this.renderCount++, this._afterRenderList.forEach(cb => cb(stage)), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null, this.tickedBeforeRender = !1;
|
|
17218
17217
|
}, this.afterTickCb = () => {
|
|
17219
17218
|
this.tickedBeforeRender = !0, "rendering" !== this.state && this.renderNextFrame();
|
|
17220
17219
|
}, this.params = params, this.theme = new Theme(), this.hooks = {
|
|
@@ -17222,7 +17221,7 @@
|
|
|
17222
17221
|
afterRender: new SyncHook(["stage"]),
|
|
17223
17222
|
afterClearScreen: new SyncHook(["stage"]),
|
|
17224
17223
|
afterClearRect: new SyncHook(["stage"])
|
|
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({
|
|
17224
|
+
}, 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._beforeRenderList = [], this._afterRenderList = [], this.window.create({
|
|
17226
17225
|
width: params.width,
|
|
17227
17226
|
height: params.height,
|
|
17228
17227
|
viewBox: params.viewBox,
|
|
@@ -17233,7 +17232,7 @@
|
|
|
17233
17232
|
canvas: params.canvas
|
|
17234
17233
|
}), 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, {
|
|
17235
17234
|
main: !0
|
|
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.
|
|
17235
|
+
})), 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), params.beforeRender && this._beforeRenderList.push(params.beforeRender), params.afterRender && this._afterRenderList.push(params.afterRender), this.hooks.afterClearScreen.tap("constructor", this.afterClearScreen), this.hooks.afterClearRect.tap("constructor", this.afterClearRect), this._afterClearScreen = params.afterClearScreen, this._afterClearRect = params.afterClearRect, this.supportInteractiveLayer = !1 !== params.interactiveLayer, params.optimize || (params.optimize = {
|
|
17237
17236
|
tickRenderMode: "effect"
|
|
17238
17237
|
}), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
|
|
17239
17238
|
background: this._background
|
|
@@ -17348,10 +17347,16 @@
|
|
|
17348
17347
|
options.enableView3dTransform && this.enableView3dTransform();
|
|
17349
17348
|
}
|
|
17350
17349
|
setBeforeRender(cb) {
|
|
17351
|
-
this.
|
|
17350
|
+
this._beforeRenderList.push(cb);
|
|
17351
|
+
}
|
|
17352
|
+
removeBeforeRender(cb) {
|
|
17353
|
+
this._beforeRenderList = this._beforeRenderList.filter(c => c !== cb);
|
|
17352
17354
|
}
|
|
17353
17355
|
setAfterRender(cb) {
|
|
17354
|
-
this.
|
|
17356
|
+
this._afterRenderList.push(cb);
|
|
17357
|
+
}
|
|
17358
|
+
removeAfterRender(cb) {
|
|
17359
|
+
this._afterRenderList = this._afterRenderList.filter(c => c !== cb);
|
|
17355
17360
|
}
|
|
17356
17361
|
afterNextRender(cb) {
|
|
17357
17362
|
this._afterNextRenderCbs || (this._afterNextRenderCbs = []), this._afterNextRenderCbs.push(cb);
|
|
@@ -18824,7 +18829,7 @@
|
|
|
18824
18829
|
});
|
|
18825
18830
|
}, this.container = null != container ? container : document.body;
|
|
18826
18831
|
const textAreaDom = document.createElement("textarea");
|
|
18827
|
-
textAreaDom.autocomplete = "off", textAreaDom.innerText = "", this.applyStyle(textAreaDom), this.container.append(textAreaDom), this.textAreaDom = textAreaDom, this.isComposing = !1, this.composingConfigIdx = -1, this.onInputCbList = [], this.onChangeCbList = [], this.onFocusInList = [], this.onFocusOutList = [];
|
|
18832
|
+
textAreaDom.autocomplete = "off", textAreaDom.spellcheck = !1, textAreaDom.innerText = "", this.applyStyle(textAreaDom), this.container.append(textAreaDom), this.textAreaDom = textAreaDom, this.isComposing = !1, this.composingConfigIdx = -1, this.onInputCbList = [], this.onChangeCbList = [], this.onFocusInList = [], this.onFocusOutList = [];
|
|
18828
18833
|
}
|
|
18829
18834
|
onInput(cb) {
|
|
18830
18835
|
this.onInputCbList.push(cb);
|
|
@@ -18839,7 +18844,7 @@
|
|
|
18839
18844
|
this.onFocusOutList.push(cb);
|
|
18840
18845
|
}
|
|
18841
18846
|
applyStyle(textAreaDom) {
|
|
18842
|
-
textAreaDom.setAttribute("style", "width: 100px; height: 30px; left: 0; top: 0; position: absolute; z-index: -1; outline: none; resize: none; border: none; overflow: hidden; color: transparent; user-select: none; caret-color: transparent;background-color: transparent;"), textAreaDom.addEventListener("input", this.handleInput), textAreaDom.addEventListener("compositionstart", this.handleCompositionStart), textAreaDom.addEventListener("compositionend", this.handleCompositionEnd), textAreaDom.addEventListener("focusin", this.handleFocusIn), textAreaDom.addEventListener("focusout", this.handleFocusOut), application.global.addEventListener("keydown", this.handleKeyDown);
|
|
18847
|
+
textAreaDom.setAttribute("style", "width: 100px; height: 30px; left: 0; top: 0; position: absolute; z-index: -1; outline: none; resize: none; border: none; overflow: hidden; color: transparent; user-select: none; caret-color: transparent;background-color: transparent;opacity: 0;pointer-events: none;"), textAreaDom.addEventListener("input", this.handleInput), textAreaDom.addEventListener("compositionstart", this.handleCompositionStart), textAreaDom.addEventListener("compositionend", this.handleCompositionEnd), textAreaDom.addEventListener("focusin", this.handleFocusIn), textAreaDom.addEventListener("focusout", this.handleFocusOut), application.global.addEventListener("keydown", this.handleKeyDown);
|
|
18843
18848
|
}
|
|
18844
18849
|
parseCompositionStr(configIdx) {
|
|
18845
18850
|
var _a;
|
|
@@ -20090,7 +20095,7 @@
|
|
|
20090
20095
|
super(...arguments), this.type = "rect3d", this.numberType = RECT3D_NUMBER_TYPE;
|
|
20091
20096
|
}
|
|
20092
20097
|
drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
20093
|
-
var _a;
|
|
20098
|
+
var _a, _b;
|
|
20094
20099
|
const rectAttribute = getTheme(rect, null == params ? void 0 : params.theme).rect,
|
|
20095
20100
|
{
|
|
20096
20101
|
fill = rectAttribute.fill,
|
|
@@ -20103,16 +20108,17 @@
|
|
|
20103
20108
|
fillOpacity = rectAttribute.fillOpacity,
|
|
20104
20109
|
lineWidth = rectAttribute.lineWidth,
|
|
20105
20110
|
strokeOpacity = rectAttribute.strokeOpacity,
|
|
20106
|
-
visible = rectAttribute.visible
|
|
20111
|
+
visible = rectAttribute.visible,
|
|
20112
|
+
drawStrokeWhenZeroWH = null !== (_a = rectAttribute.drawStrokeWhenZeroWH) && void 0 !== _a && _a
|
|
20107
20113
|
} = rect.attribute;
|
|
20108
20114
|
let {
|
|
20109
20115
|
width: width,
|
|
20110
20116
|
height: height
|
|
20111
20117
|
} = rect.attribute;
|
|
20112
20118
|
width = (null != width ? width : x1 - originX) || 0, height = (null != height ? height : y1 - originY) || 0;
|
|
20113
|
-
const z = null !== (
|
|
20119
|
+
const z = null !== (_b = this.z) && void 0 !== _b ? _b : 0,
|
|
20114
20120
|
fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
|
|
20115
|
-
sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
|
|
20121
|
+
sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height, drawStrokeWhenZeroWH),
|
|
20116
20122
|
doFill = runFill(fill),
|
|
20117
20123
|
doStroke = runStroke(stroke, lineWidth);
|
|
20118
20124
|
if (!rect.valid || !visible) return;
|
|
@@ -30489,6 +30495,7 @@
|
|
|
30489
30495
|
return this.getEndProps();
|
|
30490
30496
|
}
|
|
30491
30497
|
stop() {}
|
|
30498
|
+
release() {}
|
|
30492
30499
|
}
|
|
30493
30500
|
class WaitStep extends Step {
|
|
30494
30501
|
constructor(type, props, duration, easing) {
|
|
@@ -30706,7 +30713,9 @@
|
|
|
30706
30713
|
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));
|
|
30707
30714
|
}
|
|
30708
30715
|
release() {
|
|
30709
|
-
this.status = exports.AnimateStatus.END, this._onRemove && this._onRemove.forEach(cb => cb()), this._onStart = [], this._onFrame = [], this._onEnd = [], this._onRemove = []
|
|
30716
|
+
this.status = exports.AnimateStatus.END, this._onRemove && this._onRemove.forEach(cb => cb()), this._onStart = [], this._onFrame = [], this._onEnd = [], this._onRemove = [], this.forEachStep(step => {
|
|
30717
|
+
step.release();
|
|
30718
|
+
});
|
|
30710
30719
|
}
|
|
30711
30720
|
getDuration() {
|
|
30712
30721
|
return this._duration;
|
|
@@ -30780,6 +30789,10 @@
|
|
|
30780
30789
|
getLoop() {
|
|
30781
30790
|
return this._loopCount;
|
|
30782
30791
|
}
|
|
30792
|
+
forEachStep(cb) {
|
|
30793
|
+
let step = this._firstStep;
|
|
30794
|
+
for (; step;) cb(step), step = step.next;
|
|
30795
|
+
}
|
|
30783
30796
|
}
|
|
30784
30797
|
|
|
30785
30798
|
const performanceRAF = new PerformanceRAF();
|
|
@@ -31064,6 +31077,9 @@
|
|
|
31064
31077
|
constructor(target) {
|
|
31065
31078
|
this._animates = [], this._startCallbacks = [], this._endCallbacks = [], this._started = !1, this._activeCount = 0, this._target = target;
|
|
31066
31079
|
}
|
|
31080
|
+
get started() {
|
|
31081
|
+
return this._started;
|
|
31082
|
+
}
|
|
31067
31083
|
onStart(cb) {
|
|
31068
31084
|
cb ? (this._startCallbacks.push(cb), this._started && this._activeCount > 0 && cb()) : this._startCallbacks.forEach(cb => {
|
|
31069
31085
|
cb();
|
|
@@ -31204,14 +31220,14 @@
|
|
|
31204
31220
|
return delayAfterValue > 0 && (totalDelay += delayAfterValue), totalDelay > 0 && animate.wait(totalDelay), loop && loop > 0 && animate.loop(loop), bounce && animate.bounce(!0), animate;
|
|
31205
31221
|
}
|
|
31206
31222
|
_handleRunAnimate(animate, custom, customType, from, props, duration, easing, customParameters, controlOptions, options, type, graphic) {
|
|
31207
|
-
var _a, _b, _c, _d;
|
|
31223
|
+
var _a, _b, _c, _d, _e, _f;
|
|
31208
31224
|
if (custom && customType) {
|
|
31209
31225
|
const customParams = Object.assign({
|
|
31210
|
-
width: graphic.stage.width,
|
|
31211
|
-
height: graphic.stage.height,
|
|
31226
|
+
width: (null === (_a = graphic.stage) || void 0 === _a ? void 0 : _a.width) || 0,
|
|
31227
|
+
height: (null === (_b = graphic.stage) || void 0 === _b ? void 0 : _b.height) || 0,
|
|
31212
31228
|
group: this._target.parent
|
|
31213
31229
|
}, this.resolveValue(customParameters, graphic)),
|
|
31214
|
-
objOptions = isFunction$1(options) ? options.call(null, null !== (
|
|
31230
|
+
objOptions = isFunction$1(options) ? options.call(null, null !== (_d = customParams && (null === (_c = customParams.data) || void 0 === _c ? void 0 : _c[0])) && void 0 !== _d ? _d : null === (_f = null === (_e = graphic.context) || void 0 === _e ? void 0 : _e.data) || void 0 === _f ? void 0 : _f[0], graphic, customParams) : options;
|
|
31215
31231
|
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);
|
|
31216
31232
|
} else "to" === type ? animate.to(props, duration, easing) : "from" === type && animate.from(props, duration, easing);
|
|
31217
31233
|
}
|
|
@@ -31431,7 +31447,7 @@
|
|
|
31431
31447
|
reApplyState(state) {
|
|
31432
31448
|
var _a;
|
|
31433
31449
|
const stateInfo = null === (_a = this.stateList) || void 0 === _a ? void 0 : _a.find(stateInfo => stateInfo.state === state);
|
|
31434
|
-
if (stateInfo) {
|
|
31450
|
+
if (stateInfo && stateInfo.executor.started) {
|
|
31435
31451
|
const stateList = this.stateList.slice();
|
|
31436
31452
|
stateInfo.executor.stop(), this.stateList = stateList, stateInfo.executor.execute(stateInfo.animationConfig);
|
|
31437
31453
|
}
|
|
@@ -31574,6 +31590,45 @@
|
|
|
31574
31590
|
this._animator && this._animator.stop();
|
|
31575
31591
|
}
|
|
31576
31592
|
}
|
|
31593
|
+
class AStageAnimate extends ACustomAnimate {
|
|
31594
|
+
constructor(customFrom, customTo, duration, easing, params) {
|
|
31595
|
+
super(customFrom, customTo, duration, easing, params), this.willCallBeforeStageRender = !0, this.willCallAfterStageRender = !0, this._beforeStageRender = () => {
|
|
31596
|
+
if (!this.willCallBeforeStageRender) return;
|
|
31597
|
+
this.willCallBeforeStageRender = !1;
|
|
31598
|
+
const stage = this.target.stage,
|
|
31599
|
+
canvas = stage.window.getContext().canvas.nativeCanvas,
|
|
31600
|
+
outputCanvas = this.beforeStageRender(stage, canvas);
|
|
31601
|
+
outputCanvas && this.renderToStage(stage, outputCanvas);
|
|
31602
|
+
}, this._afterStageRender = () => {
|
|
31603
|
+
if (!this.willCallAfterStageRender) return;
|
|
31604
|
+
this.willCallAfterStageRender = !1;
|
|
31605
|
+
const stage = this.target.stage,
|
|
31606
|
+
canvas = stage.window.getContext().canvas.nativeCanvas,
|
|
31607
|
+
outputCanvas = this.afterStageRender(stage, canvas);
|
|
31608
|
+
outputCanvas && this.renderToStage(stage, outputCanvas);
|
|
31609
|
+
}, this.props = {};
|
|
31610
|
+
}
|
|
31611
|
+
beforeStageRender(stage, canvas) {
|
|
31612
|
+
return !1;
|
|
31613
|
+
}
|
|
31614
|
+
afterStageRender(stage, canvas) {
|
|
31615
|
+
return !1;
|
|
31616
|
+
}
|
|
31617
|
+
onFirstRun() {
|
|
31618
|
+
super.onFirstRun(), this.target.stage.setBeforeRender(this._beforeStageRender), this.target.stage.setAfterRender(this._afterStageRender), this.target.stage.disableDirtyBounds();
|
|
31619
|
+
}
|
|
31620
|
+
stop() {
|
|
31621
|
+
super.stop(), this.target.stage.removeBeforeRender(this._beforeStageRender), this.target.stage.removeAfterRender(this._afterStageRender);
|
|
31622
|
+
}
|
|
31623
|
+
onUpdate(end, ratio, out) {
|
|
31624
|
+
super.onUpdate(end, ratio, out), this.willCallBeforeStageRender = !0, this.willCallAfterStageRender = !0;
|
|
31625
|
+
}
|
|
31626
|
+
renderToStage(stage, canvas) {
|
|
31627
|
+
const stageCanvas = stage.window.getContext().canvas.nativeCanvas,
|
|
31628
|
+
ctx = stageCanvas.getContext("2d");
|
|
31629
|
+
return !!ctx && (ctx.clearRect(0, 0, stageCanvas.width, stageCanvas.height), ctx.drawImage(canvas, 0, 0), stageCanvas);
|
|
31630
|
+
}
|
|
31631
|
+
}
|
|
31577
31632
|
|
|
31578
31633
|
class ComponentAnimator {
|
|
31579
31634
|
constructor(component) {
|
|
@@ -32560,7 +32615,7 @@
|
|
|
32560
32615
|
}
|
|
32561
32616
|
class GrowAngleIn extends GrowAngleBase {
|
|
32562
32617
|
onBind() {
|
|
32563
|
-
var _a, _b;
|
|
32618
|
+
var _a, _b, _c;
|
|
32564
32619
|
super.onBind();
|
|
32565
32620
|
const {
|
|
32566
32621
|
from: from,
|
|
@@ -32569,7 +32624,7 @@
|
|
|
32569
32624
|
fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
|
|
32570
32625
|
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
|
|
32571
32626
|
const finalAttribute = this.target.getFinalAttribute();
|
|
32572
|
-
finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs), this.determineUpdateFunction();
|
|
32627
|
+
finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(fromAttrs), this.determineUpdateFunction();
|
|
32573
32628
|
}
|
|
32574
32629
|
}
|
|
32575
32630
|
class GrowAngleOut extends GrowAngleBase {
|
|
@@ -33177,7 +33232,7 @@
|
|
|
33177
33232
|
}
|
|
33178
33233
|
class GrowRadiusIn extends GrowPointsBase {
|
|
33179
33234
|
onBind() {
|
|
33180
|
-
var _a, _b;
|
|
33235
|
+
var _a, _b, _c;
|
|
33181
33236
|
super.onBind();
|
|
33182
33237
|
const {
|
|
33183
33238
|
from: from,
|
|
@@ -33186,7 +33241,7 @@
|
|
|
33186
33241
|
fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
|
|
33187
33242
|
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
|
|
33188
33243
|
const finalAttribute = this.target.getFinalAttribute();
|
|
33189
|
-
finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
|
|
33244
|
+
finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(fromAttrs);
|
|
33190
33245
|
}
|
|
33191
33246
|
}
|
|
33192
33247
|
class GrowRadiusOut extends GrowPointsBase {
|
|
@@ -33301,7 +33356,7 @@
|
|
|
33301
33356
|
super(from, to, duration, easing, params);
|
|
33302
33357
|
}
|
|
33303
33358
|
onBind() {
|
|
33304
|
-
var _a, _b;
|
|
33359
|
+
var _a, _b, _c;
|
|
33305
33360
|
super.onBind();
|
|
33306
33361
|
const {
|
|
33307
33362
|
from: from,
|
|
@@ -33310,7 +33365,7 @@
|
|
|
33310
33365
|
fromAttrs = null !== (_b = null === (_a = this.target.context) || void 0 === _a ? void 0 : _a.lastAttrs) && void 0 !== _b ? _b : from;
|
|
33311
33366
|
this.props = to, this.propKeys = Object.keys(to).filter(key => null != to[key]), this.from = fromAttrs, this.to = to;
|
|
33312
33367
|
const finalAttribute = this.target.getFinalAttribute();
|
|
33313
|
-
finalAttribute && this.target.setAttributes(finalAttribute), this.target.setAttributes(fromAttrs);
|
|
33368
|
+
finalAttribute && this.target.setAttributes(finalAttribute), !1 !== (null === (_c = this.params.controlOptions) || void 0 === _c ? void 0 : _c.immediatelyApply) && this.target.setAttributes(fromAttrs);
|
|
33314
33369
|
}
|
|
33315
33370
|
onEnd(cb) {
|
|
33316
33371
|
super.onEnd(cb);
|
|
@@ -35098,7 +35153,7 @@
|
|
|
35098
35153
|
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);
|
|
35099
35154
|
};
|
|
35100
35155
|
|
|
35101
|
-
const version = "1.0.
|
|
35156
|
+
const version = "1.0.11";
|
|
35102
35157
|
preLoadAllModule();
|
|
35103
35158
|
if (isBrowserEnv()) {
|
|
35104
35159
|
loadBrowserEnv(container);
|
|
@@ -35131,12 +35186,15 @@
|
|
|
35131
35186
|
registerReactAttributePlugin();
|
|
35132
35187
|
registerDirectionalLight();
|
|
35133
35188
|
registerOrthoCamera();
|
|
35189
|
+
registerCustomAnimate();
|
|
35190
|
+
registerAnimate();
|
|
35134
35191
|
|
|
35135
35192
|
exports.AComponentAnimate = AComponentAnimate;
|
|
35136
35193
|
exports.ACustomAnimate = ACustomAnimate;
|
|
35137
35194
|
exports.ARC3D_NUMBER_TYPE = ARC3D_NUMBER_TYPE;
|
|
35138
35195
|
exports.ARC_NUMBER_TYPE = ARC_NUMBER_TYPE;
|
|
35139
35196
|
exports.AREA_NUMBER_TYPE = AREA_NUMBER_TYPE;
|
|
35197
|
+
exports.AStageAnimate = AStageAnimate;
|
|
35140
35198
|
exports.Animate = Animate;
|
|
35141
35199
|
exports.AnimateExecutor = AnimateExecutor;
|
|
35142
35200
|
exports.AnimateStep = Step;
|