@visactor/vrender 1.1.0-alpha.16 → 1.1.0-alpha.18
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 +851 -229
- package/dist/index.js +850 -229
- 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 +5 -5
package/dist/index.js
CHANGED
|
@@ -8214,6 +8214,12 @@
|
|
|
8214
8214
|
function getStageStatePerfMonitor(stage) {
|
|
8215
8215
|
if (stage) return stage[STAGE_PERF_MONITOR];
|
|
8216
8216
|
}
|
|
8217
|
+
function getActiveStageStatePerfMonitor(stage) {
|
|
8218
|
+
var _a;
|
|
8219
|
+
if (!stage) return;
|
|
8220
|
+
const current = getStageStatePerfMonitor(stage);
|
|
8221
|
+
return current || (!0 === (null === (_a = stage.statePerfConfig) || void 0 === _a ? void 0 : _a.enabled) ? ensureStageStatePerfMonitor(stage) : void 0);
|
|
8222
|
+
}
|
|
8217
8223
|
|
|
8218
8224
|
function isPlainObject$1(value) {
|
|
8219
8225
|
return null != value && "object" == typeof value && !Array.isArray(value);
|
|
@@ -8309,7 +8315,7 @@
|
|
|
8309
8315
|
}
|
|
8310
8316
|
invalidateResolverCache() {
|
|
8311
8317
|
var _a, _b;
|
|
8312
|
-
this.resolverPatchCache.clear(), this.resolverCacheKey = "", this.resolverCacheValid = !1, null === (_b =
|
|
8318
|
+
this.resolverPatchCache.clear(), this.resolverCacheKey = "", this.resolverCacheValid = !1, null === (_b = getActiveStageStatePerfMonitor(null === (_a = this.graphic) || void 0 === _a ? void 0 : _a.stage)) || void 0 === _b || _b.recordResolver("invalidations");
|
|
8313
8319
|
}
|
|
8314
8320
|
hasState(stateName) {
|
|
8315
8321
|
return !!this._activeStates.length && (null == stateName || this._activeStates.includes(stateName));
|
|
@@ -8356,7 +8362,7 @@
|
|
|
8356
8362
|
}
|
|
8357
8363
|
recomputePatch(effectiveStates) {
|
|
8358
8364
|
var _a;
|
|
8359
|
-
const perfMonitor =
|
|
8365
|
+
const perfMonitor = getActiveStageStatePerfMonitor(null === (_a = this.graphic) || void 0 === _a ? void 0 : _a.stage),
|
|
8360
8366
|
patchStart = perfMonitor ? performance.now() : 0;
|
|
8361
8367
|
let resolverCost = 0;
|
|
8362
8368
|
const cacheKey = effectiveStates.join(","),
|
|
@@ -8604,32 +8610,6 @@
|
|
|
8604
8610
|
}
|
|
8605
8611
|
}), resolvedAttrs;
|
|
8606
8612
|
}
|
|
8607
|
-
resolveWithCompiled(normalAttrs, compiledDefinitions, stateProxy, effectiveStates, resolvedPatch) {
|
|
8608
|
-
var _a, _b;
|
|
8609
|
-
const mergeMode = null !== (_a = this.options.mergeMode) && void 0 !== _a ? _a : "shallow",
|
|
8610
|
-
resolvedAttrs = null !== (_b = cloneValue(resolvedPatch)) && void 0 !== _b ? _b : {};
|
|
8611
|
-
return effectiveStates.forEach(stateName => {
|
|
8612
|
-
const proxyPatch = null == stateProxy ? void 0 : stateProxy(stateName, effectiveStates);
|
|
8613
|
-
null != proxyPatch && Object.keys(proxyPatch).forEach(key => {
|
|
8614
|
-
const nextValue = proxyPatch[key],
|
|
8615
|
-
hasCompiledDefinition = compiledDefinitions.has(stateName);
|
|
8616
|
-
if ("deep" === mergeMode && isPlainObject(nextValue) && (isPlainObject(resolvedAttrs[key]) || !hasCompiledDefinition && isPlainObject(normalAttrs[key]))) {
|
|
8617
|
-
const baseValue = isPlainObject(resolvedAttrs[key]) ? resolvedAttrs[key] : isPlainObject(normalAttrs[key]) ? normalAttrs[key] : {};
|
|
8618
|
-
resolvedAttrs[key] = deepMerge(baseValue, nextValue);
|
|
8619
|
-
} else resolvedAttrs[key] = cloneValue(nextValue);
|
|
8620
|
-
});
|
|
8621
|
-
}), resolvedAttrs;
|
|
8622
|
-
}
|
|
8623
|
-
computeNormalAttrsBackup(normalAttrs, targetAttrs, finalAttribute) {
|
|
8624
|
-
const nextNormalAttrs = {},
|
|
8625
|
-
nextTargetAttrs = Object.assign({}, targetAttrs);
|
|
8626
|
-
for (const key in targetAttrs) Object.prototype.hasOwnProperty.call(targetAttrs, key) && (nextNormalAttrs[key] = cloneValue(normalAttrs && key in normalAttrs ? normalAttrs[key] : finalAttribute[key]));
|
|
8627
|
-
if (normalAttrs) for (const key in normalAttrs) Object.prototype.hasOwnProperty.call(normalAttrs, key) && !(key in targetAttrs) && (nextTargetAttrs[key] = cloneValue(normalAttrs[key]));
|
|
8628
|
-
return {
|
|
8629
|
-
attrs: nextTargetAttrs,
|
|
8630
|
-
normalAttrs: nextNormalAttrs
|
|
8631
|
-
};
|
|
8632
|
-
}
|
|
8633
8613
|
}
|
|
8634
8614
|
|
|
8635
8615
|
function hasOwnKeys(value) {
|
|
@@ -8764,7 +8744,7 @@
|
|
|
8764
8744
|
}
|
|
8765
8745
|
function ensureSharedStateScopeFresh(scope) {
|
|
8766
8746
|
var _a;
|
|
8767
|
-
if (scope) return null === (_a =
|
|
8747
|
+
if (scope) return null === (_a = getActiveStageStatePerfMonitor(scope.ownerStage)) || void 0 === _a || _a.recordRefresh("ensureFreshCalls"), scope.parentScope && ensureSharedStateScopeFresh(scope.parentScope), (scope.dirty || scope.parentScope && scope.parentRevisionAtBuild !== scope.parentScope.revision) && rebuildSharedStateScope(scope), scope;
|
|
8768
8748
|
}
|
|
8769
8749
|
function collectSharedStateScopeChain(scope) {
|
|
8770
8750
|
const chain = [];
|
|
@@ -8775,7 +8755,7 @@
|
|
|
8775
8755
|
|
|
8776
8756
|
function scheduleStageSharedStateRefresh(stage) {
|
|
8777
8757
|
var _a;
|
|
8778
|
-
stage && "released" !== stage.releaseStatus && (null === (_a =
|
|
8758
|
+
stage && "released" !== stage.releaseStatus && (null === (_a = getActiveStageStatePerfMonitor(stage)) || void 0 === _a || _a.recordRefresh("renderScheduled"), stage.renderNextFrame());
|
|
8779
8759
|
}
|
|
8780
8760
|
function enqueueGraphicSharedStateRefresh(stage, graphic) {
|
|
8781
8761
|
var _a;
|
|
@@ -8783,7 +8763,7 @@
|
|
|
8783
8763
|
const pending = null !== (_a = stage._pendingSharedStateRefreshGraphics) && void 0 !== _a ? _a : stage._pendingSharedStateRefreshGraphics = new Set();
|
|
8784
8764
|
if (!pending.has(graphic)) {
|
|
8785
8765
|
pending.add(graphic);
|
|
8786
|
-
const perfMonitor =
|
|
8766
|
+
const perfMonitor = getActiveStageStatePerfMonitor(stage);
|
|
8787
8767
|
null == perfMonitor || perfMonitor.recordRefresh("queuedGraphics"), null == perfMonitor || perfMonitor.recordAllocation("refreshQueuePushes");
|
|
8788
8768
|
}
|
|
8789
8769
|
}
|
|
@@ -8798,12 +8778,13 @@
|
|
|
8798
8778
|
function flushStageSharedStateRefresh(stage) {
|
|
8799
8779
|
const pending = stage._pendingSharedStateRefreshGraphics;
|
|
8800
8780
|
if (!pending || !pending.size) return;
|
|
8801
|
-
const perfMonitor =
|
|
8781
|
+
const perfMonitor = getActiveStageStatePerfMonitor(stage),
|
|
8802
8782
|
start = perfMonitor ? performance.now() : 0,
|
|
8803
8783
|
graphics = Array.from(pending.values());
|
|
8804
8784
|
pending.clear(), null == perfMonitor || perfMonitor.recordRefresh("flushedGraphics", graphics.length), graphics.forEach(graphic => {
|
|
8805
8785
|
if ("released" === graphic.releaseStatus) return;
|
|
8806
8786
|
if (graphic.stage !== stage) return;
|
|
8787
|
+
if (!graphic.sharedStateDirty) return;
|
|
8807
8788
|
const refresh = graphic.refreshSharedStateBeforeRender;
|
|
8808
8789
|
"function" == typeof refresh && (refresh.call(graphic), null == perfMonitor || perfMonitor.incrementCounter("sharedRefreshCommits"));
|
|
8809
8790
|
}), perfMonitor && (perfMonitor.recordCost("sharedRefresh", performance.now() - start), perfMonitor.recordEvent("shared-refresh-flush", {
|
|
@@ -8820,9 +8801,12 @@
|
|
|
8820
8801
|
tempConstantScaleXYKey = ["scaleX", "scaleY"],
|
|
8821
8802
|
tempConstantAngleKey = ["angle"],
|
|
8822
8803
|
builtinTextureTypes = new Set(["circle", "diamond", "rect", "vertical-line", "horizontal-line", "bias-lr", "bias-rl", "grid", "wave"]),
|
|
8823
|
-
|
|
8804
|
+
FULL_STATE_DEFINITION_KEYS = new Set(["name", "patch", "priority", "exclude", "suppress", "resolver", "declaredAffectedKeys"]),
|
|
8805
|
+
point = new Point(),
|
|
8806
|
+
EMPTY_STATE_NAMES = [],
|
|
8807
|
+
BROAD_UPDATE_CATEGORY = UpdateCategory.PAINT | UpdateCategory.SHAPE | UpdateCategory.BOUNDS | UpdateCategory.TRANSFORM | UpdateCategory.LAYOUT;
|
|
8824
8808
|
function isPlainObjectValue(value) {
|
|
8825
|
-
return "object" == typeof value && null != value && !isArray
|
|
8809
|
+
return "object" == typeof value && null != value && !Array.isArray(value);
|
|
8826
8810
|
}
|
|
8827
8811
|
function cloneAttributeValue(value) {
|
|
8828
8812
|
if (!isPlainObjectValue(value)) return value;
|
|
@@ -8833,12 +8817,6 @@
|
|
|
8833
8817
|
clone[key] = isPlainObjectValue(nextValue) ? cloneAttributeValue(nextValue) : nextValue;
|
|
8834
8818
|
}), clone;
|
|
8835
8819
|
}
|
|
8836
|
-
function cloneSimpleAttributeRecord(value) {
|
|
8837
|
-
return isPlainObjectValue(value) ? Object.assign({}, value) : value;
|
|
8838
|
-
}
|
|
8839
|
-
function shouldUseSimpleAttributeFastPath(value) {
|
|
8840
|
-
return !!isPlainObjectValue(value) && !Object.keys(value).some(key => isPlainObjectValue(value[key]));
|
|
8841
|
-
}
|
|
8842
8820
|
function cloneAttributeSurface(value) {
|
|
8843
8821
|
if (!isPlainObjectValue(value)) return value;
|
|
8844
8822
|
const source = value,
|
|
@@ -8848,6 +8826,9 @@
|
|
|
8848
8826
|
clone[key] = isPlainObjectValue(nextValue) ? Object.assign({}, nextValue) : nextValue;
|
|
8849
8827
|
}), clone;
|
|
8850
8828
|
}
|
|
8829
|
+
function areAttributeValuesEqual(left, right) {
|
|
8830
|
+
return left === right || !!(isPlainObjectValue(left) || isPlainObjectValue(right) || Array.isArray(left) || Array.isArray(right)) && isEqual(left, right);
|
|
8831
|
+
}
|
|
8851
8832
|
function deepMergeAttributeValue(base, value) {
|
|
8852
8833
|
var _a;
|
|
8853
8834
|
const result = null !== (_a = cloneAttributeValue(base)) && void 0 !== _a ? _a : {};
|
|
@@ -8910,18 +8891,24 @@
|
|
|
8910
8891
|
get globalTransMatrix() {
|
|
8911
8892
|
return this.tryUpdateGlobalTransMatrix(!0);
|
|
8912
8893
|
}
|
|
8894
|
+
get baseAttributes() {
|
|
8895
|
+
var _a;
|
|
8896
|
+
return null !== (_a = this._baseAttributes) && void 0 !== _a ? _a : this.attribute;
|
|
8897
|
+
}
|
|
8898
|
+
set baseAttributes(value) {
|
|
8899
|
+
value !== this.attribute ? this._baseAttributes = value : this._baseAttributes = void 0;
|
|
8900
|
+
}
|
|
8913
8901
|
constructor(params = {}) {
|
|
8914
8902
|
var _a;
|
|
8915
|
-
super(), this.
|
|
8916
|
-
const useSimpleAttributeFastPath = shouldUseSimpleAttributeFastPath(params),
|
|
8917
|
-
initialBaseAttributes = useSimpleAttributeFastPath ? cloneSimpleAttributeRecord(params) : cloneAttributeValue(params);
|
|
8918
|
-
this.baseAttributes = initialBaseAttributes, this.attribute = useSimpleAttributeFastPath ? cloneSimpleAttributeRecord(initialBaseAttributes) : cloneAttributeSurface(initialBaseAttributes), this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background && this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0), isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
|
|
8903
|
+
super(), this._AABBBounds = new AABBBounds(), this._updateTag = exports.UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), this.updateAABBBoundsStamp = 0, params.background && this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0), params.texture && isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic);
|
|
8919
8904
|
}
|
|
8920
8905
|
get normalAttrs() {
|
|
8921
8906
|
return this.baseAttributes;
|
|
8922
8907
|
}
|
|
8923
|
-
set normalAttrs(
|
|
8924
|
-
|
|
8908
|
+
set normalAttrs(_value) {}
|
|
8909
|
+
getBaseAttributesStorage() {
|
|
8910
|
+
var _a;
|
|
8911
|
+
return null !== (_a = this._baseAttributes) && void 0 !== _a ? _a : this.attribute;
|
|
8925
8912
|
}
|
|
8926
8913
|
getGraphicService() {
|
|
8927
8914
|
var _a, _b;
|
|
@@ -8952,10 +8939,18 @@
|
|
|
8952
8939
|
const nextScope = this.resolveBoundSharedStateScope();
|
|
8953
8940
|
return this.boundSharedStateScope === nextScope ? (this.syncSharedStateActiveRegistrations(), !1) : (this.boundSharedStateScope = nextScope, this.boundSharedStateRevision = void 0, this.localFallbackCompiledDefinitions = void 0, this.compiledStateDefinitions = void 0, this.compiledStateDefinitionsCacheKey = void 0, this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0, this.syncSharedStateActiveRegistrations(), markDirty && (null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && this.markSharedStateDirty(), !0);
|
|
8954
8941
|
}
|
|
8955
|
-
|
|
8942
|
+
syncSharedStateScopeBindingOnTreeChange(markDirty = !0) {
|
|
8956
8943
|
var _a, _b;
|
|
8957
|
-
|
|
8958
|
-
|
|
8944
|
+
return !!((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || this.boundSharedStateScope || (null === (_b = this.registeredActiveScopes) || void 0 === _b ? void 0 : _b.size) || this.sharedStateDirty) && this.syncSharedStateScopeBindingFromTree(markDirty);
|
|
8945
|
+
}
|
|
8946
|
+
syncSharedStateActiveRegistrations() {
|
|
8947
|
+
var _a;
|
|
8948
|
+
const previousScopes = this.registeredActiveScopes;
|
|
8949
|
+
if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || !this.boundSharedStateScope) return (null == previousScopes ? void 0 : previousScopes.size) && (previousScopes.forEach(scope => {
|
|
8950
|
+
scope.subtreeActiveDescendants.delete(this);
|
|
8951
|
+
}), previousScopes.clear()), void (this.registeredActiveScopes = void 0);
|
|
8952
|
+
const nextScopes = new Set(collectSharedStateScopeChain(this.boundSharedStateScope));
|
|
8953
|
+
null == previousScopes || previousScopes.forEach(scope => {
|
|
8959
8954
|
nextScopes.has(scope) || scope.subtreeActiveDescendants.delete(this);
|
|
8960
8955
|
}), nextScopes.forEach(scope => {
|
|
8961
8956
|
scope.subtreeActiveDescendants.add(this);
|
|
@@ -8971,15 +8966,13 @@
|
|
|
8971
8966
|
this.sharedStateDirty = !0, enqueueGraphicSharedStateRefresh(this.stage, this), scheduleStageSharedStateRefresh(this.stage);
|
|
8972
8967
|
}
|
|
8973
8968
|
onParentSharedStateTreeChanged(stage, layer) {
|
|
8974
|
-
this.stage === stage && this.layer === layer ? this.
|
|
8969
|
+
this.stage === stage && this.layer === layer ? this.syncSharedStateScopeBindingOnTreeChange() : this.setStage(stage, layer);
|
|
8975
8970
|
}
|
|
8976
8971
|
refreshSharedStateBeforeRender() {
|
|
8977
8972
|
var _a;
|
|
8978
8973
|
(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) ? (this.syncSharedStateScopeBindingFromTree(!1), this.boundSharedStateScope && ensureSharedStateScopeFresh(this.boundSharedStateScope), this.recomputeCurrentStatePatch(), this.stopStateAnimates(), this._restoreAttributeFromStaticTruth({
|
|
8979
8974
|
type: exports.AttributeUpdateType.STATE
|
|
8980
|
-
}), this.
|
|
8981
|
-
type: exports.AttributeUpdateType.STATE
|
|
8982
|
-
}), this.sharedStateDirty = !1) : this.sharedStateDirty = !1;
|
|
8975
|
+
}), this.emitStateUpdateEvent(), this.sharedStateDirty = !1) : this.sharedStateDirty = !1;
|
|
8983
8976
|
}
|
|
8984
8977
|
getLocalStatesVersion() {
|
|
8985
8978
|
var _a, _b;
|
|
@@ -9037,7 +9030,7 @@
|
|
|
9037
9030
|
const transition = stateModel.useStates(this.currentStates),
|
|
9038
9031
|
effectiveStates = null !== (_d = transition.effectiveStates) && void 0 !== _d ? _d : transition.states,
|
|
9039
9032
|
resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : this.getStateStyleResolver(this.stateMergeMode).resolve(stateResolveBaseAttrs, this.states, this.stateProxy, transition.states, this.stateSort);
|
|
9040
|
-
this.currentStates = transition.states, this.effectiveStates = [...effectiveStates], this.resolvedStatePatch =
|
|
9033
|
+
this.currentStates = transition.states, this.effectiveStates = [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.syncSharedStateActiveRegistrations();
|
|
9041
9034
|
}
|
|
9042
9035
|
buildStaticAttributeSnapshot() {
|
|
9043
9036
|
var _a;
|
|
@@ -9076,16 +9069,17 @@
|
|
|
9076
9069
|
next: void 0
|
|
9077
9070
|
}), delete target[key]));
|
|
9078
9071
|
const nextValue = snapshot[key];
|
|
9079
|
-
|
|
9072
|
+
areAttributeValuesEqual(previousValue, nextValue) || (delta.set(key, {
|
|
9080
9073
|
prev: previousValue,
|
|
9081
9074
|
next: nextValue
|
|
9082
9075
|
}), target[key] = cloneAttributeValue(nextValue));
|
|
9083
9076
|
}), delta;
|
|
9084
9077
|
}
|
|
9085
9078
|
_syncAttribute() {
|
|
9079
|
+
this.attribute === this.baseAttributes && this.resolvedStatePatch && this.detachAttributeFromBaseAttributes();
|
|
9086
9080
|
const snapshot = this.buildStaticAttributeSnapshot(),
|
|
9087
9081
|
delta = this.syncObjectToSnapshot(this.attribute, snapshot);
|
|
9088
|
-
return this.valid = this.isValid(), delta;
|
|
9082
|
+
return this.valid = this.isValid(), this.attributeMayContainTransientAttrs = !1, delta;
|
|
9089
9083
|
}
|
|
9090
9084
|
_syncFinalAttributeFromStaticTruth() {
|
|
9091
9085
|
const target = this.finalAttribute;
|
|
@@ -9093,47 +9087,146 @@
|
|
|
9093
9087
|
const snapshot = this.buildStaticAttributeSnapshot();
|
|
9094
9088
|
this.syncObjectToSnapshot(target, snapshot);
|
|
9095
9089
|
}
|
|
9096
|
-
|
|
9090
|
+
mergeAttributeDeltaCategory(category, key, prev, next) {
|
|
9091
|
+
var _a;
|
|
9092
|
+
let nextCategory = "stroke" === key || "shadowBlur" === key ? classifyAttributeDelta(key, prev, next) : null !== (_a = ATTRIBUTE_CATEGORY[key]) && void 0 !== _a ? _a : UpdateCategory.PAINT;
|
|
9093
|
+
return nextCategory & UpdateCategory.PICK && (nextCategory |= UpdateCategory.BOUNDS), nextCategory === UpdateCategory.PAINT && this.needUpdateTag(key) && (nextCategory = UpdateCategory.SHAPE | UpdateCategory.BOUNDS), category | nextCategory;
|
|
9094
|
+
}
|
|
9095
|
+
submitUpdateByCategory(category, forceUpdateTag = !1) {
|
|
9097
9096
|
var _a;
|
|
9098
9097
|
if (forceUpdateTag) return this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), void this.addUpdateLayoutTag();
|
|
9098
|
+
if (category !== UpdateCategory.NONE) {
|
|
9099
|
+
const stage = this.stage;
|
|
9100
|
+
stage && (null === (_a = getActiveStageStatePerfMonitor(stage)) || void 0 === _a || _a.recordCategory(category));
|
|
9101
|
+
}
|
|
9102
|
+
(category & BROAD_UPDATE_CATEGORY) !== BROAD_UPDATE_CATEGORY ? (category & UpdateCategory.SHAPE ? this.addUpdateShapeAndBoundsTag() : category & UpdateCategory.BOUNDS && this.addUpdateBoundTag(), category & UpdateCategory.PAINT && this.addUpdatePaintTag(), category & UpdateCategory.TRANSFORM && this.addUpdatePositionTag(), category & UpdateCategory.LAYOUT && this.addUpdateLayoutTag()) : this.addBroadUpdateTag();
|
|
9103
|
+
}
|
|
9104
|
+
submitUpdateByDelta(delta, forceUpdateTag = !1) {
|
|
9099
9105
|
let category = UpdateCategory.NONE;
|
|
9100
9106
|
delta.forEach((entry, key) => {
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9107
|
+
category = this.mergeAttributeDeltaCategory(category, key, entry.prev, entry.next);
|
|
9108
|
+
}), this.submitUpdateByCategory(category, forceUpdateTag);
|
|
9109
|
+
}
|
|
9110
|
+
submitTouchedKeyUpdate(keys, forceUpdateTag = !1) {
|
|
9111
|
+
this.submitTouchedUpdate(forceUpdateTag || this.needUpdateTags(keys));
|
|
9112
|
+
}
|
|
9113
|
+
submitTouchedUpdate(needsShapeAndBounds) {
|
|
9114
|
+
!this.updateShapeAndBoundsTagSetted() && needsShapeAndBounds ? this.addUpdateShapeAndBoundsTag() : this.addUpdateBoundTag(), this.addUpdatePositionTag(), this.addUpdateLayoutTag();
|
|
9104
9115
|
}
|
|
9105
9116
|
commitBaseAttributeMutation(forceUpdateTag = !1, context) {
|
|
9106
|
-
var _a, _b;
|
|
9107
|
-
(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && (this.resolverEpoch
|
|
9117
|
+
var _a, _b, _c;
|
|
9118
|
+
(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) && (this.resolverEpoch = (null !== (_b = this.resolverEpoch) && void 0 !== _b ? _b : 0) + 1, null === (_c = this.stateEngine) || void 0 === _c || _c.invalidateResolverCache(), this.recomputeCurrentStatePatch());
|
|
9108
9119
|
const delta = this._syncAttribute();
|
|
9109
9120
|
this.submitUpdateByDelta(delta, forceUpdateTag), this.onAttributeUpdate(context);
|
|
9110
9121
|
}
|
|
9122
|
+
canCommitBaseAttributesByTouchedKeys() {
|
|
9123
|
+
var _a, _b;
|
|
9124
|
+
return !((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || this.resolvedStatePatch || this.attributeMayContainTransientAttrs) && (!(null === (_b = this.animates) || void 0 === _b ? void 0 : _b.size) && !this._animationStateManager || !this.hasAnyTrackedAnimate());
|
|
9125
|
+
}
|
|
9126
|
+
detachAttributeFromBaseAttributes() {
|
|
9127
|
+
this.attribute === this.baseAttributes && (this._baseAttributes = this.attribute, this.attribute = cloneAttributeSurface(this.attribute));
|
|
9128
|
+
}
|
|
9129
|
+
commitInternalBaseAttributes(params, context) {
|
|
9130
|
+
params && Object.keys(params).length && (this.canCommitBaseAttributesByTouchedKeys() ? this.commitBaseAttributesByTouchedKeys(params, !1, context) : (this.detachAttributeFromBaseAttributes(), this.applyBaseAttributes(params), this.commitBaseAttributeMutation(!1, context)));
|
|
9131
|
+
}
|
|
9132
|
+
commitBaseAttributesByTouchedKeys(params, forceUpdateTag = !1, context) {
|
|
9133
|
+
const source = params,
|
|
9134
|
+
baseAttributes = this.getBaseAttributesStorage();
|
|
9135
|
+
let hasKeys = !1,
|
|
9136
|
+
needsShapeAndBounds = forceUpdateTag;
|
|
9137
|
+
for (const key in source) Object.prototype.hasOwnProperty.call(source, key) && (hasKeys = !0, baseAttributes[key] = source[key], !needsShapeAndBounds && this.needUpdateTag(key) && (needsShapeAndBounds = !0));
|
|
9138
|
+
hasKeys && (this.attribute = baseAttributes, this._baseAttributes = void 0, this.valid = this.isValid(), this.attributeMayContainTransientAttrs = !1, this.submitTouchedUpdate(needsShapeAndBounds), this.onAttributeUpdate(context));
|
|
9139
|
+
}
|
|
9140
|
+
commitBaseAttributeBySingleKey(key, value, forceUpdateTag = !1, context) {
|
|
9141
|
+
this.getBaseAttributesStorage()[key] = value, this.attribute = this.getBaseAttributesStorage(), this._baseAttributes = void 0, this.valid = this.isValid(), this.attributeMayContainTransientAttrs = !1, this.submitTouchedUpdate(forceUpdateTag || this.needUpdateTag(key)), this.onAttributeUpdate(context);
|
|
9142
|
+
}
|
|
9111
9143
|
applyBaseAttributes(params) {
|
|
9112
9144
|
const keys = Object.keys(params);
|
|
9113
9145
|
for (let i = 0; i < keys.length; i++) {
|
|
9114
9146
|
const key = keys[i];
|
|
9115
|
-
this.
|
|
9147
|
+
this.getBaseAttributesStorage()[key] = params[key];
|
|
9116
9148
|
}
|
|
9117
9149
|
}
|
|
9150
|
+
applyAnimationTransientAttributes(params, forceUpdateTag = !1, context) {
|
|
9151
|
+
const source = params;
|
|
9152
|
+
let target,
|
|
9153
|
+
needsShapeAndBounds = forceUpdateTag;
|
|
9154
|
+
for (const key in source) Object.prototype.hasOwnProperty.call(source, key) && (target || (this.detachAttributeFromBaseAttributes(), target = this.attribute), target[key] = source[key], !needsShapeAndBounds && this.needUpdateTag(key) && (needsShapeAndBounds = !0));
|
|
9155
|
+
target && (this.attributeMayContainTransientAttrs = !0, this.valid = this.isValid(), this.submitTouchedUpdate(needsShapeAndBounds), this.onAttributeUpdate(context));
|
|
9156
|
+
}
|
|
9118
9157
|
applyTransientAttributes(params, forceUpdateTag = !1, context) {
|
|
9158
|
+
this.detachAttributeFromBaseAttributes();
|
|
9119
9159
|
const delta = new Map(),
|
|
9120
9160
|
keys = Object.keys(params);
|
|
9121
9161
|
for (let i = 0; i < keys.length; i++) {
|
|
9122
9162
|
const key = keys[i],
|
|
9123
9163
|
previousValue = this.attribute[key],
|
|
9124
9164
|
nextValue = params[key];
|
|
9125
|
-
|
|
9165
|
+
areAttributeValuesEqual(previousValue, nextValue) || (delta.set(key, {
|
|
9126
9166
|
prev: previousValue,
|
|
9127
9167
|
next: nextValue
|
|
9128
|
-
}), this.attribute[key] =
|
|
9168
|
+
}), this.attribute[key] = nextValue);
|
|
9129
9169
|
}
|
|
9130
|
-
this.valid = this.isValid(), this.submitUpdateByDelta(delta, forceUpdateTag), this.onAttributeUpdate(context);
|
|
9170
|
+
delta.size && (this.attributeMayContainTransientAttrs = !0), this.valid = this.isValid(), this.submitUpdateByDelta(delta, forceUpdateTag), this.onAttributeUpdate(context);
|
|
9131
9171
|
}
|
|
9132
9172
|
_restoreAttributeFromStaticTruth(context) {
|
|
9133
9173
|
this._syncFinalAttributeFromStaticTruth();
|
|
9134
9174
|
const delta = this._syncAttribute();
|
|
9135
9175
|
this.submitUpdateByDelta(delta), this.onAttributeUpdate(context);
|
|
9136
9176
|
}
|
|
9177
|
+
collectStatePatchDeltaKeys(previousPatch, nextPatch) {
|
|
9178
|
+
const keys = previousPatch ? Object.keys(previousPatch) : [];
|
|
9179
|
+
if (!nextPatch) return keys;
|
|
9180
|
+
for (const key in nextPatch) Object.prototype.hasOwnProperty.call(nextPatch, key) && !Object.prototype.hasOwnProperty.call(null != previousPatch ? previousPatch : {}, key) && keys.push(key);
|
|
9181
|
+
return keys;
|
|
9182
|
+
}
|
|
9183
|
+
getStaticTruthValueForStateKey(key, nextPatch) {
|
|
9184
|
+
var _a;
|
|
9185
|
+
const baseAttributes = null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : {},
|
|
9186
|
+
patch = nextPatch;
|
|
9187
|
+
if (patch && Object.prototype.hasOwnProperty.call(patch, key)) {
|
|
9188
|
+
const patchValue = patch[key],
|
|
9189
|
+
baseValue = baseAttributes[key];
|
|
9190
|
+
return "deep" === this.stateMergeMode && isPlainObjectValue(baseValue) && isPlainObjectValue(patchValue) ? {
|
|
9191
|
+
hasValue: !0,
|
|
9192
|
+
value: deepMergeAttributeValue(baseValue, patchValue)
|
|
9193
|
+
} : {
|
|
9194
|
+
hasValue: !0,
|
|
9195
|
+
value: patchValue
|
|
9196
|
+
};
|
|
9197
|
+
}
|
|
9198
|
+
return Object.prototype.hasOwnProperty.call(baseAttributes, key) ? {
|
|
9199
|
+
hasValue: !0,
|
|
9200
|
+
value: baseAttributes[key]
|
|
9201
|
+
} : {
|
|
9202
|
+
hasValue: !1,
|
|
9203
|
+
value: void 0
|
|
9204
|
+
};
|
|
9205
|
+
}
|
|
9206
|
+
syncStatePatchDeltaToTarget(target, keys, nextPatch, collectCategory = !1) {
|
|
9207
|
+
let category = UpdateCategory.NONE;
|
|
9208
|
+
for (let i = 0; i < keys.length; i++) {
|
|
9209
|
+
const key = keys[i],
|
|
9210
|
+
previousValue = target[key],
|
|
9211
|
+
next = this.getStaticTruthValueForStateKey(key, nextPatch);
|
|
9212
|
+
if (!next.hasValue) {
|
|
9213
|
+
Object.prototype.hasOwnProperty.call(target, key) && (delete target[key], collectCategory && (category = this.mergeAttributeDeltaCategory(category, key, previousValue, void 0)));
|
|
9214
|
+
continue;
|
|
9215
|
+
}
|
|
9216
|
+
if (areAttributeValuesEqual(previousValue, next.value)) continue;
|
|
9217
|
+
const nextValue = cloneAttributeValue(next.value);
|
|
9218
|
+
target[key] = nextValue, collectCategory && (category = this.mergeAttributeDeltaCategory(category, key, previousValue, nextValue));
|
|
9219
|
+
}
|
|
9220
|
+
return category;
|
|
9221
|
+
}
|
|
9222
|
+
restoreAttributeFromStatePatchDelta(previousPatch, nextPatch, context) {
|
|
9223
|
+
this.detachAttributeFromBaseAttributes();
|
|
9224
|
+
const keys = this.collectStatePatchDeltaKeys(previousPatch, nextPatch),
|
|
9225
|
+
finalAttribute = this.finalAttribute;
|
|
9226
|
+
finalAttribute && this.syncStatePatchDeltaToTarget(finalAttribute, keys, nextPatch, !1);
|
|
9227
|
+
const category = this.syncStatePatchDeltaToTarget(this.attribute, keys, nextPatch, !0);
|
|
9228
|
+
this.valid = this.isValid(), this.attributeMayContainTransientAttrs = !1, this.submitUpdateByCategory(category), this.onAttributeUpdate(context);
|
|
9229
|
+
}
|
|
9137
9230
|
setMode(mode) {
|
|
9138
9231
|
"3d" === mode ? this.set3dMode() : this.set2dMode();
|
|
9139
9232
|
}
|
|
@@ -9156,7 +9249,7 @@
|
|
|
9156
9249
|
return point;
|
|
9157
9250
|
}
|
|
9158
9251
|
onAnimateBind(animate) {
|
|
9159
|
-
this._emitCustomEvent("animate-bind", animate);
|
|
9252
|
+
this.detachAttributeFromBaseAttributes(), this._emitCustomEvent("animate-bind", animate);
|
|
9160
9253
|
}
|
|
9161
9254
|
visitTrackedAnimates(cb) {
|
|
9162
9255
|
const hook = this.forEachTrackedAnimate;
|
|
@@ -9169,8 +9262,22 @@
|
|
|
9169
9262
|
const getTrackedAnimates = this.getTrackedAnimates;
|
|
9170
9263
|
return "function" == typeof getTrackedAnimates ? getTrackedAnimates.call(this).size > 0 : !!(null === (_a = this.animates) || void 0 === _a ? void 0 : _a.size);
|
|
9171
9264
|
}
|
|
9265
|
+
mayHaveTrackedAnimates() {
|
|
9266
|
+
var _a;
|
|
9267
|
+
return !!(null === (_a = this.animates) || void 0 === _a ? void 0 : _a.size) || !!this._animationStateManager;
|
|
9268
|
+
}
|
|
9172
9269
|
tryUpdateAABBBounds() {
|
|
9270
|
+
if (!(this.shadowRoot || this._updateTag & exports.UpdateTag.UPDATE_BOUNDS)) return this._AABBBounds;
|
|
9173
9271
|
const full = "imprecise" === this.attribute.boundsMode;
|
|
9272
|
+
if (!this.shadowRoot) {
|
|
9273
|
+
const graphicService = this.getGraphicService(),
|
|
9274
|
+
graphicTheme = this.getGraphicTheme();
|
|
9275
|
+
if (!graphicService.validCheck(this.attribute, graphicTheme, this._AABBBounds, this)) return this._AABBBounds;
|
|
9276
|
+
if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
|
|
9277
|
+
graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
|
|
9278
|
+
const bounds = this.doUpdateAABBBounds(full, graphicTheme);
|
|
9279
|
+
return graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0), "empty" === this.attribute.boundsMode && bounds.clear(), bounds;
|
|
9280
|
+
}
|
|
9174
9281
|
if (!this.shouldUpdateAABBBounds()) return this._AABBBounds;
|
|
9175
9282
|
if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
|
|
9176
9283
|
this.getGraphicService().beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
|
|
@@ -9243,14 +9350,14 @@
|
|
|
9243
9350
|
const _parsedPath = new CustomSymbolClass(symbolType, cache);
|
|
9244
9351
|
return Graphic.userSymbolMap[symbolType] = _parsedPath, _parsedPath;
|
|
9245
9352
|
}
|
|
9246
|
-
doUpdateAABBBounds(full) {
|
|
9353
|
+
doUpdateAABBBounds(full, graphicTheme) {
|
|
9247
9354
|
this.updateAABBBoundsStamp++;
|
|
9248
|
-
const
|
|
9355
|
+
const resolvedGraphicTheme = null != graphicTheme ? graphicTheme : this.getGraphicTheme();
|
|
9249
9356
|
this._AABBBounds.clear();
|
|
9250
9357
|
const attribute = this.attribute,
|
|
9251
|
-
bounds = this.updateAABBBounds(attribute,
|
|
9358
|
+
bounds = this.updateAABBBounds(attribute, resolvedGraphicTheme, this._AABBBounds, full),
|
|
9252
9359
|
{
|
|
9253
|
-
boundsPadding =
|
|
9360
|
+
boundsPadding = resolvedGraphicTheme.boundsPadding
|
|
9254
9361
|
} = attribute,
|
|
9255
9362
|
paddingArray = parsePadding(boundsPadding);
|
|
9256
9363
|
return paddingArray && bounds.expand(paddingArray), this.clearUpdateBoundTag(), bounds;
|
|
@@ -9359,18 +9466,22 @@
|
|
|
9359
9466
|
return fromAttrs;
|
|
9360
9467
|
}
|
|
9361
9468
|
setAttributes(params, forceUpdateTag = !1, context) {
|
|
9362
|
-
params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background && this.loadImage(params.background, !0), isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context));
|
|
9469
|
+
params && ((params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params).background && this.loadImage(params.background, !0), params.texture && isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._setAttributes(params, forceUpdateTag, context));
|
|
9363
9470
|
}
|
|
9364
9471
|
_setAttributes(params, forceUpdateTag = !1, context) {
|
|
9365
|
-
this.applyBaseAttributes(params), this.commitBaseAttributeMutation(forceUpdateTag, context);
|
|
9472
|
+
this.canCommitBaseAttributesByTouchedKeys() ? this.commitBaseAttributesByTouchedKeys(params, forceUpdateTag, context) : (this.detachAttributeFromBaseAttributes(), this.applyBaseAttributes(params), this.commitBaseAttributeMutation(forceUpdateTag, context));
|
|
9366
9473
|
}
|
|
9367
9474
|
setAttribute(key, value, forceUpdateTag, context) {
|
|
9368
9475
|
const params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({
|
|
9369
9476
|
[key]: value
|
|
9370
9477
|
}, this.attribute, key, context);
|
|
9371
|
-
params
|
|
9372
|
-
|
|
9373
|
-
|
|
9478
|
+
if (params) this._setAttributes(params, forceUpdateTag, context);else if (this.canCommitBaseAttributesByTouchedKeys()) this.commitBaseAttributeBySingleKey(key, value, !!forceUpdateTag, context);else {
|
|
9479
|
+
const nextAttrs = {
|
|
9480
|
+
[key]: value
|
|
9481
|
+
};
|
|
9482
|
+
this.applyBaseAttributes(nextAttrs), this.commitBaseAttributeMutation(!!forceUpdateTag, context);
|
|
9483
|
+
}
|
|
9484
|
+
"background" === key ? this.loadImage(value, !0) : "texture" === key && isExternalTexture(value) ? this.loadImage(value, !1) : "shadowGraphic" === key && this.setShadowGraphic(value);
|
|
9374
9485
|
}
|
|
9375
9486
|
needUpdateTags(keys, k = GRAPHIC_UPDATE_TAG_KEY) {
|
|
9376
9487
|
for (let i = 0; i < k.length; i++) {
|
|
@@ -9389,7 +9500,7 @@
|
|
|
9389
9500
|
const context = {
|
|
9390
9501
|
type: exports.AttributeUpdateType.INIT
|
|
9391
9502
|
};
|
|
9392
|
-
params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.
|
|
9503
|
+
params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context) || params, this.attribute = params, this._baseAttributes = void 0, this.resolvedStatePatch = void 0, this.attributeMayContainTransientAttrs = !1, this.valid = this.isValid(), params.background && this.loadImage(params.background, !0), params.texture && isExternalTexture(params.texture) && this.loadImage(params.texture, !1), params.shadowGraphic && this.setShadowGraphic(params.shadowGraphic), this._updateTag = exports.UpdateTag.INIT, this.valid = this.isValid(), this.onAttributeUpdate(context);
|
|
9393
9504
|
}
|
|
9394
9505
|
translate(x, y) {
|
|
9395
9506
|
var _a, _b;
|
|
@@ -9401,10 +9512,15 @@
|
|
|
9401
9512
|
x: x,
|
|
9402
9513
|
y: y
|
|
9403
9514
|
}, this.attribute, tempConstantXYKey, context);
|
|
9404
|
-
params && (x = params.x, y = params.y, delete params.x, delete params.y
|
|
9515
|
+
params && (x = params.x, y = params.y, delete params.x, delete params.y);
|
|
9405
9516
|
const attribute = this.baseAttributes,
|
|
9406
|
-
postMatrix = attribute.postMatrix
|
|
9407
|
-
|
|
9517
|
+
postMatrix = attribute.postMatrix,
|
|
9518
|
+
nextAttrs = params || {};
|
|
9519
|
+
if (postMatrix) {
|
|
9520
|
+
const nextPostMatrix = postMatrix.clone();
|
|
9521
|
+
application.transformUtil.fromMatrix(nextPostMatrix, nextPostMatrix).translate(x, y), nextAttrs.postMatrix = nextPostMatrix;
|
|
9522
|
+
} else nextAttrs.x = (null !== (_a = attribute.x) && void 0 !== _a ? _a : DefaultTransform.x) + x, nextAttrs.y = (null !== (_b = attribute.y) && void 0 !== _b ? _b : DefaultTransform.y) + y;
|
|
9523
|
+
return this.commitInternalBaseAttributes(nextAttrs, context), this;
|
|
9408
9524
|
}
|
|
9409
9525
|
translateTo(x, y) {
|
|
9410
9526
|
const attribute = this.baseAttributes;
|
|
@@ -9416,7 +9532,10 @@
|
|
|
9416
9532
|
x: x,
|
|
9417
9533
|
y: y
|
|
9418
9534
|
}, this.attribute, tempConstantXYKey, context);
|
|
9419
|
-
return params ? (this.
|
|
9535
|
+
return params ? (this.commitInternalBaseAttributes(params, context), this) : (this.commitInternalBaseAttributes({
|
|
9536
|
+
x: x,
|
|
9537
|
+
y: y
|
|
9538
|
+
}, context), this);
|
|
9420
9539
|
}
|
|
9421
9540
|
scale(scaleX, scaleY, scaleCenter) {
|
|
9422
9541
|
var _a, _b;
|
|
@@ -9429,15 +9548,16 @@
|
|
|
9429
9548
|
scaleY: scaleY,
|
|
9430
9549
|
scaleCenter: scaleCenter
|
|
9431
9550
|
}, this.attribute, tempConstantScaleXYKey, context);
|
|
9432
|
-
params && (scaleX = params.scaleX, scaleY = params.scaleY, delete params.scaleX, delete params.scaleY
|
|
9433
|
-
const attribute = this.baseAttributes
|
|
9551
|
+
params && (scaleX = params.scaleX, scaleY = params.scaleY, delete params.scaleX, delete params.scaleY);
|
|
9552
|
+
const attribute = this.baseAttributes,
|
|
9553
|
+
nextAttrs = params || {};
|
|
9434
9554
|
if (scaleCenter) {
|
|
9435
9555
|
let {
|
|
9436
9556
|
postMatrix: postMatrix
|
|
9437
|
-
} = this.
|
|
9438
|
-
postMatrix
|
|
9439
|
-
} else
|
|
9440
|
-
return this.
|
|
9557
|
+
} = this.baseAttributes;
|
|
9558
|
+
postMatrix = postMatrix ? postMatrix.clone() : new Matrix(), application.transformUtil.fromMatrix(postMatrix, postMatrix).scale(scaleX, scaleY, scaleCenter), nextAttrs.postMatrix = postMatrix;
|
|
9559
|
+
} else nextAttrs.scaleX = (null !== (_a = attribute.scaleX) && void 0 !== _a ? _a : DefaultTransform.scaleX) * scaleX, nextAttrs.scaleY = (null !== (_b = attribute.scaleY) && void 0 !== _b ? _b : DefaultTransform.scaleY) * scaleY;
|
|
9560
|
+
return this.commitInternalBaseAttributes(nextAttrs, context), this;
|
|
9441
9561
|
}
|
|
9442
9562
|
scaleTo(scaleX, scaleY) {
|
|
9443
9563
|
const attribute = this.baseAttributes;
|
|
@@ -9449,7 +9569,10 @@
|
|
|
9449
9569
|
scaleX: scaleX,
|
|
9450
9570
|
scaleY: scaleY
|
|
9451
9571
|
}, this.attribute, tempConstantScaleXYKey, context);
|
|
9452
|
-
return params ? (this.
|
|
9572
|
+
return params ? (this.commitInternalBaseAttributes(params, context), this) : (this.commitInternalBaseAttributes({
|
|
9573
|
+
scaleX: scaleX,
|
|
9574
|
+
scaleY: scaleY
|
|
9575
|
+
}, context), this);
|
|
9453
9576
|
}
|
|
9454
9577
|
rotate(angle, rotateCenter) {
|
|
9455
9578
|
var _a;
|
|
@@ -9461,24 +9584,26 @@
|
|
|
9461
9584
|
angle: angle,
|
|
9462
9585
|
rotateCenter: rotateCenter
|
|
9463
9586
|
}, this.attribute, tempConstantAngleKey, context);
|
|
9464
|
-
params &&
|
|
9465
|
-
const attribute = this.baseAttributes
|
|
9587
|
+
params && delete params.angle;
|
|
9588
|
+
const attribute = this.baseAttributes,
|
|
9589
|
+
nextAttrs = params || {};
|
|
9466
9590
|
if (rotateCenter) {
|
|
9467
9591
|
let {
|
|
9468
9592
|
postMatrix: postMatrix
|
|
9469
9593
|
} = this.baseAttributes;
|
|
9470
|
-
postMatrix
|
|
9471
|
-
} else
|
|
9472
|
-
return this.
|
|
9594
|
+
postMatrix = postMatrix ? postMatrix.clone() : new Matrix(), application.transformUtil.fromMatrix(postMatrix, postMatrix).rotate(angle, rotateCenter), nextAttrs.postMatrix = postMatrix;
|
|
9595
|
+
} else nextAttrs.angle = (null !== (_a = attribute.angle) && void 0 !== _a ? _a : DefaultTransform.angle) + angle;
|
|
9596
|
+
return this.commitInternalBaseAttributes(nextAttrs, context), this;
|
|
9473
9597
|
}
|
|
9474
9598
|
rotateTo(angle) {
|
|
9475
|
-
|
|
9476
|
-
if (attribute.angle === angle) return this;
|
|
9599
|
+
if (this.baseAttributes.angle === angle) return this;
|
|
9477
9600
|
const context = {
|
|
9478
9601
|
type: exports.AttributeUpdateType.ROTATE_TO
|
|
9479
9602
|
},
|
|
9480
9603
|
params = this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(angle, this.attribute, tempConstantAngleKey, context);
|
|
9481
|
-
return params ? (this.
|
|
9604
|
+
return params ? (this.commitInternalBaseAttributes(params, context), this) : (this.commitInternalBaseAttributes({
|
|
9605
|
+
angle: angle
|
|
9606
|
+
}, context), this);
|
|
9482
9607
|
}
|
|
9483
9608
|
skewTo(b, c) {
|
|
9484
9609
|
return this;
|
|
@@ -9517,6 +9642,131 @@
|
|
|
9517
9642
|
stateEngine: this.stateEngine
|
|
9518
9643
|
});
|
|
9519
9644
|
}
|
|
9645
|
+
resolveSimpleLocalStateTransition(states, previousStates) {
|
|
9646
|
+
var _a;
|
|
9647
|
+
if (!this.states || this.stateProxy || this.stateSort || "deep" === this.stateMergeMode || this.parent || (null === (_a = this.stage) || void 0 === _a ? void 0 : _a.rootSharedStateScope) || this.boundSharedStateScope) return null;
|
|
9648
|
+
if (1 === states.length) {
|
|
9649
|
+
const stateName = states[0],
|
|
9650
|
+
hasDefinition = Object.prototype.hasOwnProperty.call(this.states, stateName),
|
|
9651
|
+
nextStates = [stateName],
|
|
9652
|
+
changed = !this.sameStateNames(previousStates, nextStates),
|
|
9653
|
+
resolvedStateAttrs = {};
|
|
9654
|
+
if (hasDefinition) {
|
|
9655
|
+
const attrs = this.states[stateName];
|
|
9656
|
+
if (null != attrs) {
|
|
9657
|
+
if (!isPlainObjectValue(attrs)) return null;
|
|
9658
|
+
const keys = Object.keys(attrs);
|
|
9659
|
+
for (let keyIndex = 0; keyIndex < keys.length; keyIndex++) {
|
|
9660
|
+
const key = keys[keyIndex];
|
|
9661
|
+
if (FULL_STATE_DEFINITION_KEYS.has(key)) return null;
|
|
9662
|
+
const attrValue = attrs[key];
|
|
9663
|
+
resolvedStateAttrs[key] = isPlainObjectValue(attrValue) ? cloneAttributeValue(attrValue) : attrValue;
|
|
9664
|
+
}
|
|
9665
|
+
}
|
|
9666
|
+
}
|
|
9667
|
+
return {
|
|
9668
|
+
changed: changed,
|
|
9669
|
+
states: nextStates,
|
|
9670
|
+
effectiveStates: nextStates,
|
|
9671
|
+
resolvedStateAttrs: resolvedStateAttrs
|
|
9672
|
+
};
|
|
9673
|
+
}
|
|
9674
|
+
const uniqueStates = Array.from(new Set(states)),
|
|
9675
|
+
withDefinition = [],
|
|
9676
|
+
withoutDefinition = [];
|
|
9677
|
+
for (let i = 0; i < uniqueStates.length; i++) {
|
|
9678
|
+
const stateName = uniqueStates[i];
|
|
9679
|
+
Object.prototype.hasOwnProperty.call(this.states, stateName) ? withDefinition.push(stateName) : withoutDefinition.push(stateName);
|
|
9680
|
+
}
|
|
9681
|
+
withDefinition.sort((left, right) => left.localeCompare(right));
|
|
9682
|
+
const nextStates = withDefinition.concat(withoutDefinition),
|
|
9683
|
+
changed = !this.sameStateNames(previousStates, nextStates),
|
|
9684
|
+
resolvedStateAttrs = {};
|
|
9685
|
+
for (let i = 0; i < nextStates.length; i++) {
|
|
9686
|
+
const stateName = nextStates[i];
|
|
9687
|
+
if (!Object.prototype.hasOwnProperty.call(this.states, stateName)) continue;
|
|
9688
|
+
const attrs = this.states[stateName];
|
|
9689
|
+
if (null == attrs) continue;
|
|
9690
|
+
if (!isPlainObjectValue(attrs)) return null;
|
|
9691
|
+
const keys = Object.keys(attrs);
|
|
9692
|
+
for (let keyIndex = 0; keyIndex < keys.length; keyIndex++) {
|
|
9693
|
+
const key = keys[keyIndex];
|
|
9694
|
+
if (FULL_STATE_DEFINITION_KEYS.has(key)) return null;
|
|
9695
|
+
const attrValue = attrs[key];
|
|
9696
|
+
resolvedStateAttrs[key] = isPlainObjectValue(attrValue) ? cloneAttributeValue(attrValue) : attrValue;
|
|
9697
|
+
}
|
|
9698
|
+
}
|
|
9699
|
+
return {
|
|
9700
|
+
changed: changed,
|
|
9701
|
+
states: nextStates,
|
|
9702
|
+
effectiveStates: nextStates,
|
|
9703
|
+
resolvedStateAttrs: resolvedStateAttrs
|
|
9704
|
+
};
|
|
9705
|
+
}
|
|
9706
|
+
resolveGraphicStateTransition(states, previousStates, forceResolverRefresh = !1) {
|
|
9707
|
+
var _a, _b, _c, _d;
|
|
9708
|
+
let transition = this.resolveSimpleLocalStateTransition(states, previousStates);
|
|
9709
|
+
const isSimpleLocalTransition = !!transition;
|
|
9710
|
+
let resolvedStateAttrs;
|
|
9711
|
+
if (transition) resolvedStateAttrs = transition.resolvedStateAttrs;else {
|
|
9712
|
+
const stateResolveBaseAttrs = null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : this.attribute,
|
|
9713
|
+
stateModel = this.createStateModel();
|
|
9714
|
+
null === (_b = this.stateEngine) || void 0 === _b || _b.setResolveContext(this, stateResolveBaseAttrs), forceResolverRefresh && (null === (_c = this.stateEngine) || void 0 === _c || _c.invalidateResolverCache()), transition = stateModel.useStates(states), resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : this.getStateStyleResolver(this.stateMergeMode).resolve(stateResolveBaseAttrs, this.states, this.stateProxy, transition.states, this.stateSort);
|
|
9715
|
+
}
|
|
9716
|
+
return {
|
|
9717
|
+
transition: transition,
|
|
9718
|
+
effectiveStates: null !== (_d = transition.effectiveStates) && void 0 !== _d ? _d : transition.states,
|
|
9719
|
+
resolvedStateAttrs: resolvedStateAttrs,
|
|
9720
|
+
isSimpleLocalTransition: isSimpleLocalTransition
|
|
9721
|
+
};
|
|
9722
|
+
}
|
|
9723
|
+
normalizeSetStatesOptions(options) {
|
|
9724
|
+
return options && "object" == typeof options ? {
|
|
9725
|
+
hasAnimation: options.animate,
|
|
9726
|
+
animateSameStatePatchChange: !0 === options.animateSameStatePatchChange,
|
|
9727
|
+
shouldRefreshSameStatePatch: !0
|
|
9728
|
+
} : {
|
|
9729
|
+
hasAnimation: "boolean" == typeof options ? options : void 0,
|
|
9730
|
+
animateSameStatePatchChange: !1,
|
|
9731
|
+
shouldRefreshSameStatePatch: !1
|
|
9732
|
+
};
|
|
9733
|
+
}
|
|
9734
|
+
sameStatePatches(left, right) {
|
|
9735
|
+
const leftRecord = null != left ? left : {},
|
|
9736
|
+
rightRecord = null != right ? right : {},
|
|
9737
|
+
keys = new Set([...Object.keys(leftRecord), ...Object.keys(rightRecord)]);
|
|
9738
|
+
for (const key of keys) {
|
|
9739
|
+
if (Object.prototype.hasOwnProperty.call(leftRecord, key) !== Object.prototype.hasOwnProperty.call(rightRecord, key)) return !1;
|
|
9740
|
+
if (!areAttributeValuesEqual(leftRecord[key], rightRecord[key])) return !1;
|
|
9741
|
+
}
|
|
9742
|
+
return !0;
|
|
9743
|
+
}
|
|
9744
|
+
commitSameStatePatchRefresh(states, hasAnimation, animateSameStatePatchChange = !1) {
|
|
9745
|
+
var _a;
|
|
9746
|
+
const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES,
|
|
9747
|
+
previousResolvedStatePatch = this.resolvedStatePatch,
|
|
9748
|
+
{
|
|
9749
|
+
transition: transition,
|
|
9750
|
+
effectiveStates: effectiveStates,
|
|
9751
|
+
resolvedStateAttrs: resolvedStateAttrs,
|
|
9752
|
+
isSimpleLocalTransition: isSimpleLocalTransition
|
|
9753
|
+
} = this.resolveGraphicStateTransition(states, previousStates, !0),
|
|
9754
|
+
patchChanged = !this.sameStatePatches(previousResolvedStatePatch, resolvedStateAttrs);
|
|
9755
|
+
if ((!patchChanged || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1)) && (this.currentStates = transition.states, this.effectiveStates = isSimpleLocalTransition ? effectiveStates : [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), patchChanged)) {
|
|
9756
|
+
if (this.stage) {
|
|
9757
|
+
const perfMonitor = getActiveStageStatePerfMonitor(this.stage);
|
|
9758
|
+
null == perfMonitor || perfMonitor.incrementCounter("stateCommits"), null == perfMonitor || perfMonitor.recordEvent("state-commit", {
|
|
9759
|
+
graphicId: this._uid,
|
|
9760
|
+
targetStates: [...transition.states]
|
|
9761
|
+
});
|
|
9762
|
+
}
|
|
9763
|
+
hasAnimation && animateSameStatePatchChange ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
9764
|
+
type: exports.AttributeUpdateType.STATE
|
|
9765
|
+
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
|
|
9766
|
+
type: exports.AttributeUpdateType.STATE
|
|
9767
|
+
}), this.emitStateUpdateEvent());
|
|
9768
|
+
}
|
|
9769
|
+
}
|
|
9520
9770
|
resolveStateAnimateConfig(animateConfig) {
|
|
9521
9771
|
var _a, _b, _c;
|
|
9522
9772
|
return null !== (_c = null !== (_a = null != animateConfig ? animateConfig : this.stateAnimateConfig) && void 0 !== _a ? _a : null === (_b = this.context) || void 0 === _b ? void 0 : _b.stateAnimateConfig) && void 0 !== _c ? _c : DefaultStateAnimateConfig;
|
|
@@ -9537,9 +9787,7 @@
|
|
|
9537
9787
|
});
|
|
9538
9788
|
this.getStateTransitionOrchestrator().applyTransition(this, plan, hasAnimation, transitionOptions);
|
|
9539
9789
|
}
|
|
9540
|
-
updateNormalAttrs(
|
|
9541
|
-
this._deprecatedNormalAttrsView = cloneAttributeValue(this.baseAttributes);
|
|
9542
|
-
}
|
|
9790
|
+
updateNormalAttrs(_stateAttrs) {}
|
|
9543
9791
|
getStateTransitionDefaultAttribute(key, targetAttrs) {
|
|
9544
9792
|
return this.getDefaultAttribute(key);
|
|
9545
9793
|
}
|
|
@@ -9549,6 +9797,7 @@
|
|
|
9549
9797
|
stopStateAnimates(type = "end") {
|
|
9550
9798
|
const stopAnimationState = this.stopAnimationState;
|
|
9551
9799
|
if ("function" == typeof stopAnimationState) return void stopAnimationState.call(this, "state", type);
|
|
9800
|
+
if (!this.mayHaveTrackedAnimates()) return;
|
|
9552
9801
|
const stateAnimates = [];
|
|
9553
9802
|
this.visitTrackedAnimates(animate => {
|
|
9554
9803
|
animate.stateNames && stateAnimates.push(animate);
|
|
@@ -9561,19 +9810,25 @@
|
|
|
9561
9810
|
}
|
|
9562
9811
|
clearStates(hasAnimation) {
|
|
9563
9812
|
var _a, _b, _c;
|
|
9564
|
-
const previousStates =
|
|
9565
|
-
previousResolvedStatePatch = this.resolvedStatePatch
|
|
9813
|
+
const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES,
|
|
9814
|
+
previousResolvedStatePatch = this.resolvedStatePatch,
|
|
9566
9815
|
transition = this.createStateModel().clearStates();
|
|
9567
9816
|
if (!transition.changed && 0 === previousStates.length) return this.currentStates = [], this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1, void this.clearSharedStateActiveRegistrations();
|
|
9568
|
-
const resolvedStateAttrs = cloneAttributeValue(null !== (
|
|
9569
|
-
transition.changed
|
|
9570
|
-
|
|
9571
|
-
|
|
9572
|
-
|
|
9573
|
-
|
|
9574
|
-
|
|
9575
|
-
|
|
9576
|
-
|
|
9817
|
+
const resolvedStateAttrs = hasAnimation || this.hasCustomEvent("beforeStateUpdate") ? cloneAttributeValue(null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : {}) : null !== (_c = this.baseAttributes) && void 0 !== _c ? _c : {};
|
|
9818
|
+
if (!transition.changed || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0)) {
|
|
9819
|
+
if (this.currentStates = transition.states, this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1, this.clearSharedStateActiveRegistrations(), this.stage) {
|
|
9820
|
+
const perfMonitor = getActiveStageStatePerfMonitor(this.stage);
|
|
9821
|
+
null == perfMonitor || perfMonitor.incrementCounter("stateCommits"), null == perfMonitor || perfMonitor.recordEvent("state-commit", {
|
|
9822
|
+
graphicId: this._uid,
|
|
9823
|
+
targetStates: []
|
|
9824
|
+
});
|
|
9825
|
+
}
|
|
9826
|
+
hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
9827
|
+
type: exports.AttributeUpdateType.STATE
|
|
9828
|
+
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, void 0, {
|
|
9829
|
+
type: exports.AttributeUpdateType.STATE
|
|
9830
|
+
}), this.emitStateUpdateEvent());
|
|
9831
|
+
}
|
|
9577
9832
|
}
|
|
9578
9833
|
removeState(stateName, hasAnimation) {
|
|
9579
9834
|
const transition = this.createStateModel().removeState(stateName);
|
|
@@ -9587,39 +9842,59 @@
|
|
|
9587
9842
|
const transition = this.createStateModel().addState(stateName, keepCurrentStates);
|
|
9588
9843
|
transition.changed && this.useStates(transition.states, hasAnimation);
|
|
9589
9844
|
}
|
|
9845
|
+
setStates(states, options) {
|
|
9846
|
+
var _a, _b, _c;
|
|
9847
|
+
const {
|
|
9848
|
+
hasAnimation: hasAnimation,
|
|
9849
|
+
animateSameStatePatchChange: animateSameStatePatchChange,
|
|
9850
|
+
shouldRefreshSameStatePatch: shouldRefreshSameStatePatch
|
|
9851
|
+
} = this.normalizeSetStatesOptions(options),
|
|
9852
|
+
nextStates = (null == states ? void 0 : states.length) ? states : EMPTY_STATE_NAMES,
|
|
9853
|
+
hasCurrentState = !!((null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || (null === (_b = this.effectiveStates) || void 0 === _b ? void 0 : _b.length) || this.resolvedStatePatch || (null === (_c = this.registeredActiveScopes) || void 0 === _c ? void 0 : _c.size));
|
|
9854
|
+
if (nextStates.length) {
|
|
9855
|
+
if (this.sameStateNames(this.currentStates, nextStates)) return shouldRefreshSameStatePatch ? void this.commitSameStatePatchRefresh(nextStates, hasAnimation, animateSameStatePatchChange) : void (this.sharedStateDirty && this.refreshSharedStateBeforeRender());
|
|
9856
|
+
this.useStates(nextStates, hasAnimation);
|
|
9857
|
+
} else {
|
|
9858
|
+
if (!hasCurrentState && !this.sharedStateDirty) return;
|
|
9859
|
+
this.clearStates(hasAnimation);
|
|
9860
|
+
}
|
|
9861
|
+
}
|
|
9590
9862
|
useStates(states, hasAnimation) {
|
|
9591
|
-
var _a
|
|
9863
|
+
var _a;
|
|
9592
9864
|
if (!states.length) return void this.clearStates(hasAnimation);
|
|
9593
|
-
const previousStates =
|
|
9594
|
-
previousResolvedStatePatch = this.resolvedStatePatch
|
|
9595
|
-
|
|
9596
|
-
|
|
9597
|
-
|
|
9598
|
-
|
|
9599
|
-
|
|
9600
|
-
|
|
9601
|
-
|
|
9602
|
-
|
|
9603
|
-
|
|
9604
|
-
|
|
9605
|
-
|
|
9606
|
-
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9865
|
+
const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES,
|
|
9866
|
+
previousResolvedStatePatch = this.resolvedStatePatch,
|
|
9867
|
+
{
|
|
9868
|
+
transition: transition,
|
|
9869
|
+
effectiveStates: effectiveStates,
|
|
9870
|
+
resolvedStateAttrs: resolvedStateAttrs,
|
|
9871
|
+
isSimpleLocalTransition: isSimpleLocalTransition
|
|
9872
|
+
} = this.resolveGraphicStateTransition(states, previousStates);
|
|
9873
|
+
if ((transition.changed || !this.sameStateNames(previousStates, transition.states)) && this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1)) {
|
|
9874
|
+
if (this.currentStates = transition.states, this.effectiveStates = isSimpleLocalTransition ? effectiveStates : [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), this.stage) {
|
|
9875
|
+
const perfMonitor = getActiveStageStatePerfMonitor(this.stage);
|
|
9876
|
+
null == perfMonitor || perfMonitor.incrementCounter("stateCommits"), null == perfMonitor || perfMonitor.recordEvent("state-commit", {
|
|
9877
|
+
graphicId: this._uid,
|
|
9878
|
+
targetStates: [...transition.states]
|
|
9879
|
+
});
|
|
9880
|
+
}
|
|
9881
|
+
hasAnimation ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
|
|
9882
|
+
type: exports.AttributeUpdateType.STATE
|
|
9883
|
+
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
|
|
9884
|
+
type: exports.AttributeUpdateType.STATE
|
|
9885
|
+
}), this.emitStateUpdateEvent());
|
|
9886
|
+
}
|
|
9610
9887
|
}
|
|
9611
9888
|
invalidateResolver() {
|
|
9612
|
-
var _a, _b;
|
|
9889
|
+
var _a, _b, _c;
|
|
9613
9890
|
if (!this.stateEngine || !(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || !this.compiledStateDefinitions) return;
|
|
9614
9891
|
const stateResolveBaseAttrs = null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : this.attribute;
|
|
9615
|
-
this.stateEngine.setResolveContext(this, stateResolveBaseAttrs), this.resolverEpoch
|
|
9892
|
+
this.stateEngine.setResolveContext(this, stateResolveBaseAttrs), this.resolverEpoch = (null !== (_c = this.resolverEpoch) && void 0 !== _c ? _c : 0) + 1, this.stateEngine.invalidateResolverCache();
|
|
9616
9893
|
const transition = this.stateEngine.applyStates(this.currentStates),
|
|
9617
9894
|
resolvedStateAttrs = Object.assign({}, this.stateEngine.resolvedPatch);
|
|
9618
|
-
this.effectiveStates = [...transition.effectiveStates], this.resolvedStatePatch =
|
|
9619
|
-
type: exports.AttributeUpdateType.STATE
|
|
9620
|
-
}), this._emitCustomEvent("afterStateUpdate", {
|
|
9895
|
+
this.effectiveStates = [...transition.effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), this.stopStateAnimates(), this._restoreAttributeFromStaticTruth({
|
|
9621
9896
|
type: exports.AttributeUpdateType.STATE
|
|
9622
|
-
});
|
|
9897
|
+
}), this.emitStateUpdateEvent();
|
|
9623
9898
|
}
|
|
9624
9899
|
sameStateNames(left, right) {
|
|
9625
9900
|
const normalizedLeft = null != left ? left : [],
|
|
@@ -9640,6 +9915,9 @@
|
|
|
9640
9915
|
addUpdateShapeAndBoundsTag() {
|
|
9641
9916
|
this._updateTag |= exports.UpdateTag.UPDATE_SHAPE_AND_BOUNDS, this.parent && this.parent.addChildUpdateBoundTag(), this.glyphHost && this.glyphHost.addUpdateBoundTag();
|
|
9642
9917
|
}
|
|
9918
|
+
addBroadUpdateTag() {
|
|
9919
|
+
this.shadowRoot && this.shadowRoot.addUpdateGlobalPositionTag(), this._updateTag |= exports.UpdateTag.UPDATE_SHAPE_AND_BOUNDS | exports.UpdateTag.UPDATE_PAINT | exports.UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX | exports.UpdateTag.UPDATE_LAYOUT, this.parent && this.parent.addChildUpdateBoundTag(), this.glyphHost && this.glyphHost.addUpdateBoundTag();
|
|
9920
|
+
}
|
|
9643
9921
|
updateShapeAndBoundsTagSetted() {
|
|
9644
9922
|
return (this._updateTag & exports.UpdateTag.UPDATE_SHAPE_AND_BOUNDS) === exports.UpdateTag.UPDATE_SHAPE_AND_BOUNDS;
|
|
9645
9923
|
}
|
|
@@ -9727,13 +10005,13 @@
|
|
|
9727
10005
|
}
|
|
9728
10006
|
}
|
|
9729
10007
|
setStage(stage, layer) {
|
|
9730
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
10008
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
9731
10009
|
const graphicService = null !== (_c = null !== (_a = null == stage ? void 0 : stage.graphicService) && void 0 !== _a ? _a : null === (_b = this.stage) || void 0 === _b ? void 0 : _b.graphicService) && void 0 !== _c ? _c : application.graphicService,
|
|
9732
10010
|
previousStage = this.stage;
|
|
9733
10011
|
if (this.stage !== stage || this.layer !== layer) {
|
|
9734
|
-
if (this.stage = stage, this.layer = layer,
|
|
9735
|
-
const previousTimeline = null === (
|
|
9736
|
-
nextTimeline = null === (
|
|
10012
|
+
if (this.stage = stage, this.layer = layer, ((null === (_d = this.currentStates) || void 0 === _d ? void 0 : _d.length) || this.boundSharedStateScope || (null === (_e = this.registeredActiveScopes) || void 0 === _e ? void 0 : _e.size) || this.sharedStateDirty) && this.syncSharedStateScopeBindingOnTreeChange(!0), this.setStageToShadowRoot(stage, layer), this.mayHaveTrackedAnimates() && this.hasAnyTrackedAnimate()) {
|
|
10013
|
+
const previousTimeline = null === (_f = null == previousStage ? void 0 : previousStage.getTimeline) || void 0 === _f ? void 0 : _f.call(previousStage),
|
|
10014
|
+
nextTimeline = null === (_g = null == stage ? void 0 : stage.getTimeline) || void 0 === _g ? void 0 : _g.call(stage),
|
|
9737
10015
|
detachedStageAnimates = [];
|
|
9738
10016
|
this.visitTrackedAnimates(a => {
|
|
9739
10017
|
(!!previousTimeline && a.timeline === previousTimeline || a.timeline.isGlobal) && (nextTimeline ? a.timeline !== nextTimeline && (previousTimeline && a.timeline === previousTimeline && previousTimeline.removeAnimate(a, !1), a.setTimeline(nextTimeline), nextTimeline.addAnimate(a)) : previousTimeline && a.timeline === previousTimeline && (previousTimeline.removeAnimate(a, !1), detachedStageAnimates.push(a)));
|
|
@@ -9746,9 +10024,13 @@
|
|
|
9746
10024
|
type: exports.AttributeUpdateType.ANIMATE_END
|
|
9747
10025
|
}));
|
|
9748
10026
|
}
|
|
9749
|
-
return this._onSetStage && this._onSetStage(this, stage, layer), void (null === (
|
|
10027
|
+
return this._onSetStage && this._onSetStage(this, stage, layer), void (null === (_h = null == graphicService ? void 0 : graphicService.onSetStage) || void 0 === _h || _h.call(graphicService, this, stage));
|
|
9750
10028
|
}
|
|
9751
|
-
|
|
10029
|
+
((null === (_j = this.currentStates) || void 0 === _j ? void 0 : _j.length) || this.boundSharedStateScope || (null === (_k = this.registeredActiveScopes) || void 0 === _k ? void 0 : _k.size) || this.sharedStateDirty) && this.syncSharedStateScopeBindingOnTreeChange(!0);
|
|
10030
|
+
}
|
|
10031
|
+
detachStageForRelease() {
|
|
10032
|
+
var _a, _b, _c;
|
|
10033
|
+
(null === (_a = this.registeredActiveScopes) || void 0 === _a ? void 0 : _a.size) && this.clearSharedStateActiveRegistrations(), (this.mayHaveTrackedAnimates() || this.shadowRoot) && this.stopAnimates(), this.boundSharedStateScope = void 0, this.boundSharedStateRevision = void 0, this.localFallbackCompiledDefinitions = void 0, this.compiledStateDefinitions = void 0, this.compiledStateDefinitionsCacheKey = void 0, this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0, this.sharedStateDirty = !1, this.stage = null, this.layer = null, this.shadowRoot && (null === (_c = (_b = this.shadowRoot).detachStageForRelease) || void 0 === _c || _c.call(_b));
|
|
9752
10034
|
}
|
|
9753
10035
|
setStageToShadowRoot(stage, layer) {
|
|
9754
10036
|
this.shadowRoot && this.shadowRoot.setStage(stage, layer);
|
|
@@ -9815,6 +10097,7 @@
|
|
|
9815
10097
|
res && (res.state = "fail", cb && cb());
|
|
9816
10098
|
}
|
|
9817
10099
|
_stopAnimates() {
|
|
10100
|
+
if (!this.mayHaveTrackedAnimates()) return;
|
|
9818
10101
|
const animates = [];
|
|
9819
10102
|
this.visitTrackedAnimates(animate => {
|
|
9820
10103
|
animates.push(animate);
|
|
@@ -9828,14 +10111,17 @@
|
|
|
9828
10111
|
});
|
|
9829
10112
|
}
|
|
9830
10113
|
release() {
|
|
9831
|
-
var _a, _b, _c;
|
|
9832
|
-
this.releaseStatus = "released", this.clearSharedStateActiveRegistrations(), this.stopAnimates();
|
|
9833
|
-
const graphicService = null !== (
|
|
9834
|
-
null === (
|
|
10114
|
+
var _a, _b, _c, _d;
|
|
10115
|
+
this.releaseStatus = "released", (null === (_a = this.registeredActiveScopes) || void 0 === _a ? void 0 : _a.size) && this.clearSharedStateActiveRegistrations(), (this.mayHaveTrackedAnimates() || this.shadowRoot) && this.stopAnimates();
|
|
10116
|
+
const graphicService = null !== (_c = null === (_b = this.stage) || void 0 === _b ? void 0 : _b.graphicService) && void 0 !== _c ? _c : application.graphicService;
|
|
10117
|
+
null === (_d = null == graphicService ? void 0 : graphicService.onRelease) || void 0 === _d || _d.call(graphicService, this), super.release();
|
|
10118
|
+
}
|
|
10119
|
+
hasCustomEvent(type) {
|
|
10120
|
+
return !!this._events && type in this._events;
|
|
9835
10121
|
}
|
|
9836
10122
|
_dispatchCustomEvent(type, context) {
|
|
9837
10123
|
var _a, _b;
|
|
9838
|
-
if (this.
|
|
10124
|
+
if (this.hasCustomEvent(type)) {
|
|
9839
10125
|
const changeEvent = new CustomEvent(type, context);
|
|
9840
10126
|
changeEvent.bubbles = !1;
|
|
9841
10127
|
const manager = null === (_b = null === (_a = this.stage) || void 0 === _a ? void 0 : _a.eventSystem) || void 0 === _b ? void 0 : _b.manager;
|
|
@@ -9844,7 +10130,7 @@
|
|
|
9844
10130
|
return !0;
|
|
9845
10131
|
}
|
|
9846
10132
|
beforeStateUpdate(attrs, prevStates, nextStates, hasAnimation, isClear) {
|
|
9847
|
-
return this._dispatchCustomEvent("beforeStateUpdate", {
|
|
10133
|
+
return !this.hasCustomEvent("beforeStateUpdate") || this._dispatchCustomEvent("beforeStateUpdate", {
|
|
9848
10134
|
type: exports.AttributeUpdateType.STATE,
|
|
9849
10135
|
attrs: Object.assign({}, attrs),
|
|
9850
10136
|
prevStates: prevStates.slice(),
|
|
@@ -9853,6 +10139,11 @@
|
|
|
9853
10139
|
isClear: !!isClear
|
|
9854
10140
|
});
|
|
9855
10141
|
}
|
|
10142
|
+
emitStateUpdateEvent() {
|
|
10143
|
+
this.hasCustomEvent("afterStateUpdate") && this._emitCustomEvent("afterStateUpdate", {
|
|
10144
|
+
type: exports.AttributeUpdateType.STATE
|
|
10145
|
+
});
|
|
10146
|
+
}
|
|
9856
10147
|
_emitCustomEvent(type, context) {
|
|
9857
10148
|
this._dispatchCustomEvent(type, context);
|
|
9858
10149
|
}
|
|
@@ -12859,13 +13150,15 @@
|
|
|
12859
13150
|
}(exports.GroupUpdateAABBBoundsMode || (exports.GroupUpdateAABBBoundsMode = {}));
|
|
12860
13151
|
class Group extends Graphic {
|
|
12861
13152
|
constructor(params) {
|
|
12862
|
-
super(params), this.type = "group", this.parent = null, this.isContainer = !0, this.numberType = GROUP_NUMBER_TYPE, this._childUpdateTag = exports.UpdateTag.UPDATE_BOUNDS;
|
|
13153
|
+
super(params), this.type = "group", this.parent = null, this.isContainer = !0, this._hasSharedStateDefinitions = !1, this.numberType = GROUP_NUMBER_TYPE, this._childUpdateTag = exports.UpdateTag.UPDATE_BOUNDS;
|
|
12863
13154
|
}
|
|
12864
13155
|
get sharedStateDefinitions() {
|
|
12865
13156
|
return this._sharedStateDefinitions;
|
|
12866
13157
|
}
|
|
12867
13158
|
set sharedStateDefinitions(value) {
|
|
12868
|
-
|
|
13159
|
+
if (this._sharedStateDefinitions === value) return;
|
|
13160
|
+
const previousScope = this.sharedStateScope;
|
|
13161
|
+
this._sharedStateDefinitions = value, this._hasSharedStateDefinitions = !!value && Object.keys(value).length > 0, this.ensureSharedStateScopeBound(), this.sharedStateScope && (setSharedStateScopeLocalDefinitions(this.sharedStateScope, value), markScopeActiveDescendantsDirty(this.sharedStateScope, this.stage)), previousScope !== this.sharedStateScope && this.notifyChildrenSharedStateTreeChanged();
|
|
12869
13162
|
}
|
|
12870
13163
|
setMode(mode) {
|
|
12871
13164
|
"3d" === mode ? this.set3dMode() : this.set2dMode();
|
|
@@ -12990,9 +13283,10 @@
|
|
|
12990
13283
|
insertInto(newNode, idx) {
|
|
12991
13284
|
return this._updateChildToStage(super.insertInto(newNode, idx));
|
|
12992
13285
|
}
|
|
12993
|
-
removeChild(child) {
|
|
13286
|
+
removeChild(child, highPerformance = !1) {
|
|
13287
|
+
var _a;
|
|
12994
13288
|
const data = super.removeChild(child);
|
|
12995
|
-
return this.getGraphicService().onRemove(child), child.setStage(null, null), this.addUpdateBoundTag(), data;
|
|
13289
|
+
return data ? highPerformance ? (null === (_a = child.detachStageForRelease) || void 0 === _a || _a.call(child), data) : (this.getGraphicService().onRemove(child), child.setStage(null, null), this.addUpdateBoundTag(), data) : data;
|
|
12996
13290
|
}
|
|
12997
13291
|
removeAllChild(deep = !1) {
|
|
12998
13292
|
const children = this.children.slice();
|
|
@@ -13004,11 +13298,13 @@
|
|
|
13004
13298
|
}
|
|
13005
13299
|
setStage(stage, layer) {
|
|
13006
13300
|
var _a, _b, _c, _d, _e, _f;
|
|
13007
|
-
const graphicService = null !== (_c = null !== (_a = null == stage ? void 0 : stage.graphicService) && void 0 !== _a ? _a : null === (_b = this.stage) || void 0 === _b ? void 0 : _b.graphicService) && void 0 !== _c ? _c : application.graphicService
|
|
13008
|
-
|
|
13301
|
+
const graphicService = null !== (_c = null !== (_a = null == stage ? void 0 : stage.graphicService) && void 0 !== _a ? _a : null === (_b = this.stage) || void 0 === _b ? void 0 : _b.graphicService) && void 0 !== _c ? _c : application.graphicService,
|
|
13302
|
+
needsSharedStateTreeSync = this._hasSharedStateDefinitions || this.sharedStateScope || (null === (_d = this.currentStates) || void 0 === _d ? void 0 : _d.length) || this.boundSharedStateScope || (null === (_e = this.registeredActiveScopes) || void 0 === _e ? void 0 : _e.size) || this.sharedStateDirty;
|
|
13303
|
+
if (this.stage !== stage) return this.stage = stage, this.layer = layer, needsSharedStateTreeSync && (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0)), this.setStageToShadowRoot(stage, layer), this._onSetStage && this._onSetStage(this, stage, layer), null === (_f = null == graphicService ? void 0 : graphicService.onSetStage) || void 0 === _f || _f.call(graphicService, this, stage), void this.forEachChildren(item => {
|
|
13009
13304
|
item.setStage(stage, this.layer);
|
|
13010
13305
|
});
|
|
13011
|
-
|
|
13306
|
+
const layerChanged = this.layer !== layer;
|
|
13307
|
+
layerChanged && (this.layer = layer), needsSharedStateTreeSync ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!0), this.notifyChildrenSharedStateTreeChanged()) : layerChanged && this.forEachChildren(item => {
|
|
13012
13308
|
item.onParentSharedStateTreeChanged && item.onParentSharedStateTreeChanged(stage, this.layer);
|
|
13013
13309
|
});
|
|
13014
13310
|
}
|
|
@@ -13055,15 +13351,29 @@
|
|
|
13055
13351
|
g.release(all);
|
|
13056
13352
|
}), super.release();
|
|
13057
13353
|
}
|
|
13354
|
+
detachStageForRelease() {
|
|
13355
|
+
super.detachStageForRelease(), this.sharedStateScope = void 0, this.forEachChildren(item => {
|
|
13356
|
+
var _a;
|
|
13357
|
+
null === (_a = item.detachStageForRelease) || void 0 === _a || _a.call(item);
|
|
13358
|
+
});
|
|
13359
|
+
}
|
|
13058
13360
|
ensureSharedStateScopeBound() {
|
|
13059
13361
|
var _a, _b, _c;
|
|
13362
|
+
if (!this.hasSharedStateDefinitions()) return void (this.sharedStateScope = void 0);
|
|
13060
13363
|
const parentScope = null !== (_b = null === (_a = this.parent) || void 0 === _a ? void 0 : _a.sharedStateScope) && void 0 !== _b ? _b : null === (_c = this.stage) || void 0 === _c ? void 0 : _c.rootSharedStateScope;
|
|
13061
13364
|
this.sharedStateScope ? (this.sharedStateScope.ownerGroup = this, this.sharedStateScope.ownerStage = this.stage, setSharedStateScopeParent(this.sharedStateScope, parentScope), this.sharedStateScope.localStateDefinitions !== this._sharedStateDefinitions && setSharedStateScopeLocalDefinitions(this.sharedStateScope, this._sharedStateDefinitions)) : this.sharedStateScope = createGroupSharedStateScope(this, parentScope, this._sharedStateDefinitions);
|
|
13062
13365
|
}
|
|
13366
|
+
hasSharedStateDefinitions() {
|
|
13367
|
+
return this._hasSharedStateDefinitions;
|
|
13368
|
+
}
|
|
13369
|
+
notifyChildrenSharedStateTreeChanged() {
|
|
13370
|
+
this.forEachChildren(item => {
|
|
13371
|
+
item.onParentSharedStateTreeChanged && item.onParentSharedStateTreeChanged(this.stage, this.layer);
|
|
13372
|
+
});
|
|
13373
|
+
}
|
|
13063
13374
|
onParentSharedStateTreeChanged(stage, layer) {
|
|
13064
|
-
|
|
13065
|
-
|
|
13066
|
-
})) : this.setStage(stage, layer);
|
|
13375
|
+
var _a;
|
|
13376
|
+
this.stage === stage && this.layer === layer ? (this.ensureSharedStateScopeBound(), this.syncSharedStateScopeBindingOnTreeChange(!!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)), this.notifyChildrenSharedStateTreeChanged()) : this.setStage(stage, layer);
|
|
13067
13377
|
}
|
|
13068
13378
|
}
|
|
13069
13379
|
Group.NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;
|
|
@@ -13411,7 +13721,10 @@
|
|
|
13411
13721
|
beforeUpdateAABBBounds: new SyncHook(["graphic", "stage", "willUpdate", "aabbBounds"]),
|
|
13412
13722
|
afterUpdateAABBBounds: new SyncHook(["graphic", "stage", "aabbBounds", "globalAABBBounds", "selfChange"]),
|
|
13413
13723
|
clearAABBBounds: new SyncHook(["graphic", "stage", "aabbBounds"])
|
|
13414
|
-
}, this.tempAABBBounds1 = new AABBBounds(), this.tempAABBBounds2 = new AABBBounds()
|
|
13724
|
+
}, this.tempAABBBounds1 = new AABBBounds(), this.tempAABBBounds2 = new AABBBounds(), this.tempAABBBoundsResult = {
|
|
13725
|
+
tb1: this.tempAABBBounds1,
|
|
13726
|
+
tb2: this.tempAABBBounds2
|
|
13727
|
+
};
|
|
13415
13728
|
}
|
|
13416
13729
|
onAttributeUpdate(graphic) {
|
|
13417
13730
|
this.hooks.onAttributeUpdate.taps.length && this.hooks.onAttributeUpdate.call(graphic);
|
|
@@ -13511,10 +13824,7 @@
|
|
|
13511
13824
|
updateTempAABBBounds(aabbBounds) {
|
|
13512
13825
|
const tb1 = this.tempAABBBounds1,
|
|
13513
13826
|
tb2 = this.tempAABBBounds2;
|
|
13514
|
-
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2),
|
|
13515
|
-
tb1: tb1,
|
|
13516
|
-
tb2: tb2
|
|
13517
|
-
};
|
|
13827
|
+
return tb1.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), tb2.setValue(aabbBounds.x1, aabbBounds.y1, aabbBounds.x2, aabbBounds.y2), this.tempAABBBoundsResult;
|
|
13518
13828
|
}
|
|
13519
13829
|
}
|
|
13520
13830
|
|
|
@@ -14856,7 +15166,7 @@
|
|
|
14856
15166
|
const globalBounds = new AABBBounds();
|
|
14857
15167
|
class DirtyBoundsPlugin {
|
|
14858
15168
|
constructor() {
|
|
14859
|
-
this.name = "DirtyBoundsPlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid, this.handlePaintOnlyUpdate = graphic => {
|
|
15169
|
+
this.name = "DirtyBoundsPlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid, this.dirtyBoundsHooksRegistered = !1, this.handlePaintOnlyUpdate = graphic => {
|
|
14860
15170
|
var _a, _b, _c, _d;
|
|
14861
15171
|
const stage = this.pluginService.stage;
|
|
14862
15172
|
if (!stage || stage !== graphic.stage || !stage.renderCount) return;
|
|
@@ -14876,12 +15186,13 @@
|
|
|
14876
15186
|
owner._AABBBounds && "function" == typeof owner._AABBBounds.empty && !owner._AABBBounds.empty() || "function" != typeof owner.doUpdateAABBBounds || owner.doUpdateAABBBounds("imprecise" === (null === (_a = owner.attribute) || void 0 === _a ? void 0 : _a.boundsMode));
|
|
14877
15187
|
return owner._globalAABBBounds && "function" == typeof owner._globalAABBBounds.empty && !owner._globalAABBBounds.empty() || "function" != typeof owner.tryUpdateGlobalAABBBounds || owner.tryUpdateGlobalAABBBounds(), null !== (_b = owner._globalAABBBounds) && void 0 !== _b ? _b : owner.globalAABBBounds;
|
|
14878
15188
|
}
|
|
14879
|
-
|
|
14880
|
-
|
|
14881
|
-
|
|
14882
|
-
|
|
14883
|
-
|
|
14884
|
-
|
|
15189
|
+
getRemoveDirtyBounds(graphic) {
|
|
15190
|
+
var _a;
|
|
15191
|
+
const cachedBounds = (null !== (_a = graphic.glyphHost) && void 0 !== _a ? _a : graphic)._globalAABBBounds;
|
|
15192
|
+
if (cachedBounds && "function" == typeof cachedBounds.empty && !cachedBounds.empty()) return cachedBounds;
|
|
15193
|
+
}
|
|
15194
|
+
registerDirtyBoundsHooks(stage) {
|
|
15195
|
+
this.dirtyBoundsHooksRegistered || (stage.graphicService.hooks.onAttributeUpdate.tap(this.key, this.handlePaintOnlyUpdate), stage.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key, (graphic, stage, willUpdate, bounds) => {
|
|
14885
15196
|
graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === this.pluginService.stage && stage.renderCount && (graphic.isContainer && !graphic.shouldSelfChangeUpdateAABBBounds() || willUpdate && (globalBounds.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2), stage.dirty(globalBounds, graphic.parent && graphic.parent.globalTransMatrix)));
|
|
14886
15197
|
}), stage.graphicService.hooks.afterUpdateAABBBounds.tap(this.key, (graphic, stage, bounds, params, selfChange) => {
|
|
14887
15198
|
stage && stage === this.pluginService.stage && stage.renderCount && (graphic.isContainer && !selfChange || stage.dirty(params.globalAABBBounds));
|
|
@@ -14889,12 +15200,21 @@
|
|
|
14889
15200
|
stage && stage === this.pluginService.stage && stage.renderCount && stage && stage.dirty(bounds);
|
|
14890
15201
|
}), stage.graphicService.hooks.onRemove.tap(this.key, graphic => {
|
|
14891
15202
|
const stage = graphic.stage;
|
|
14892
|
-
stage
|
|
14893
|
-
|
|
15203
|
+
if (!stage || stage !== this.pluginService.stage || !stage.renderCount) return;
|
|
15204
|
+
const bounds = this.getRemoveDirtyBounds(graphic);
|
|
15205
|
+
bounds && !bounds.empty() && stage.dirty(bounds);
|
|
15206
|
+
}), this.dirtyBoundsHooksRegistered = !0);
|
|
15207
|
+
}
|
|
15208
|
+
activate(context) {
|
|
15209
|
+
this.pluginService = context, context.stage.hooks.afterRender.tap(this.key, stage => {
|
|
15210
|
+
stage && stage === this.pluginService.stage && (stage.dirtyBounds.clear(), this.registerDirtyBoundsHooks(stage));
|
|
15211
|
+
});
|
|
15212
|
+
const stage = this.pluginService.stage;
|
|
15213
|
+
stage && stage.renderCount && this.registerDirtyBoundsHooks(stage);
|
|
14894
15214
|
}
|
|
14895
15215
|
deactivate(context) {
|
|
14896
15216
|
const stage = this.pluginService.stage;
|
|
14897
|
-
stage && (stage.graphicService.hooks.onAttributeUpdate.taps = stage.graphicService.hooks.onAttributeUpdate.taps.filter(item => item.name !== this.key), stage.graphicService.hooks.beforeUpdateAABBBounds.taps = stage.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(item => item.name !== this.key), stage.graphicService.hooks.afterUpdateAABBBounds.taps = stage.graphicService.hooks.afterUpdateAABBBounds.taps.filter(item => item.name !== this.key), stage.graphicService.hooks.clearAABBBounds.taps = stage.graphicService.hooks.clearAABBBounds.taps.filter(item => item.name !== this.key), stage.hooks.afterRender.taps = stage.hooks.afterRender.taps.filter(item => item.name !== this.key), stage.graphicService.hooks.onRemove.taps = stage.graphicService.hooks.onRemove.taps.filter(item => item.name !== this.key));
|
|
15217
|
+
stage && (stage.graphicService.hooks.onAttributeUpdate.taps = stage.graphicService.hooks.onAttributeUpdate.taps.filter(item => item.name !== this.key), this.dirtyBoundsHooksRegistered = !1, stage.graphicService.hooks.beforeUpdateAABBBounds.taps = stage.graphicService.hooks.beforeUpdateAABBBounds.taps.filter(item => item.name !== this.key), stage.graphicService.hooks.afterUpdateAABBBounds.taps = stage.graphicService.hooks.afterUpdateAABBBounds.taps.filter(item => item.name !== this.key), stage.graphicService.hooks.clearAABBBounds.taps = stage.graphicService.hooks.clearAABBBounds.taps.filter(item => item.name !== this.key), stage.hooks.afterRender.taps = stage.hooks.afterRender.taps.filter(item => item.name !== this.key), stage.graphicService.hooks.onRemove.taps = stage.graphicService.hooks.onRemove.taps.filter(item => item.name !== this.key));
|
|
14898
15218
|
}
|
|
14899
15219
|
}
|
|
14900
15220
|
|
|
@@ -15250,7 +15570,7 @@
|
|
|
15250
15570
|
ticker.bindStage(this), this._ticker && this._ticker.removeListener("tick", this.afterTickCb), ticker.addTimeline(this.timeline), this._ticker = ticker, this._ticker.on("tick", this.afterTickCb);
|
|
15251
15571
|
}
|
|
15252
15572
|
constructor(params = {}, deps = {}) {
|
|
15253
|
-
var _a, _b, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
|
15573
|
+
var _a, _b, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
15254
15574
|
super({}), this.tickedBeforeRender = !0, this._onVisibleChange = visible => {
|
|
15255
15575
|
if (!(this._skipRender < 0)) if (visible) {
|
|
15256
15576
|
if (this.dirtyBounds) {
|
|
@@ -15260,7 +15580,8 @@
|
|
|
15260
15580
|
this._skipRender > 1 && this.renderNextFrame(), this._skipRender = 0;
|
|
15261
15581
|
} else this._skipRender = 1;
|
|
15262
15582
|
}, this.beforeRender = stage => {
|
|
15263
|
-
|
|
15583
|
+
const pendingSharedRefresh = this._pendingSharedStateRefreshGraphics;
|
|
15584
|
+
(null == pendingSharedRefresh ? void 0 : pendingSharedRefresh.size) && flushStageSharedStateRefresh(this), this._beforeRenderList.forEach(cb => cb(stage));
|
|
15264
15585
|
}, this.afterClearScreen = drawParams => {
|
|
15265
15586
|
this._afterClearScreen && this._afterClearScreen(drawParams);
|
|
15266
15587
|
}, this.afterClearRect = drawParams => {
|
|
@@ -15285,14 +15606,17 @@
|
|
|
15285
15606
|
canvas: params.canvas
|
|
15286
15607
|
}), this.state = "normal", this.renderCount = 0, this.tryInitEventSystem(), this._background = null !== (_w = params.background) && void 0 !== _w ? _w : DefaultConfig.BACKGROUND, this.stage = this, this.appendChild(this.layerService.createLayer(this, {
|
|
15287
15608
|
main: !0
|
|
15288
|
-
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1,
|
|
15609
|
+
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.theme.onStateDefinitionsChange = () => {
|
|
15289
15610
|
var _a;
|
|
15290
|
-
|
|
15611
|
+
const definitions = null === (_a = this.theme) || void 0 === _a ? void 0 : _a.stateDefinitions;
|
|
15612
|
+
if (!definitions || !Object.keys(definitions).length) return void (this.rootSharedStateScope && (setRootSharedStateScopeThemeDefinitions(this.rootSharedStateScope, definitions), markScopeActiveDescendantsDirty(this.rootSharedStateScope, this)));
|
|
15613
|
+
const rootScope = this.ensureRootSharedStateScope(definitions);
|
|
15614
|
+
setRootSharedStateScopeThemeDefinitions(rootScope, definitions), markScopeActiveDescendantsDirty(rootScope, this);
|
|
15291
15615
|
}, 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 = {
|
|
15292
15616
|
tickRenderMode: "effect"
|
|
15293
15617
|
}), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
|
|
15294
15618
|
background: this._background
|
|
15295
|
-
}), this.initAnimate(params), this.rafId = null !== (
|
|
15619
|
+
}), this.initAnimate(params), this.rafId = null !== (_x = params.rafId) && void 0 !== _x ? _x : Math.floor(6 * Math.random());
|
|
15296
15620
|
}
|
|
15297
15621
|
initAnimate(params) {
|
|
15298
15622
|
var _a;
|
|
@@ -15552,8 +15876,14 @@
|
|
|
15552
15876
|
this._doRenderInThisFrame(), this.willNextFrameRender = !1;
|
|
15553
15877
|
}));
|
|
15554
15878
|
}
|
|
15879
|
+
ensureRootSharedStateScope(themeStateDefinitions) {
|
|
15880
|
+
return this.rootSharedStateScope ? (this.rootSharedStateScope.ownerStage = this, this.rootSharedStateScope) : (this.rootSharedStateScope = createRootSharedStateScope(this, themeStateDefinitions), this.rootSharedStateScope);
|
|
15881
|
+
}
|
|
15882
|
+
getStateBatchScheduler() {
|
|
15883
|
+
return this._stateBatchScheduler || (this._stateBatchScheduler = new StateBatchScheduler(this, ensureStageStatePerfMonitor(this))), this._stateBatchScheduler;
|
|
15884
|
+
}
|
|
15555
15885
|
scheduleStateBatch(graphics, targetStates) {
|
|
15556
|
-
this.
|
|
15886
|
+
this.getStateBatchScheduler().schedule(graphics, targetStates);
|
|
15557
15887
|
}
|
|
15558
15888
|
getStatePerfSnapshot() {
|
|
15559
15889
|
return ensureStageStatePerfMonitor(this).getSnapshot();
|
|
@@ -18054,7 +18384,11 @@
|
|
|
18054
18384
|
};
|
|
18055
18385
|
class BaseRender {
|
|
18056
18386
|
init(contributions) {
|
|
18057
|
-
|
|
18387
|
+
this.builtinContributions || (this.builtinContributions = []), this._renderContribitions = contributions ? contributions.getContributions().slice() : [];
|
|
18388
|
+
const addContribution = item => {
|
|
18389
|
+
this._renderContribitions.includes(item) || this._renderContribitions.push(item);
|
|
18390
|
+
};
|
|
18391
|
+
this.builtinContributions.forEach(addContribution), addContribution(defaultBaseClipRenderBeforeContribution), addContribution(defaultBaseClipRenderAfterContribution), this._renderContribitions.length ? (this._renderContribitions.sort((a, b) => b.order - a.order), this._beforeRenderContribitions = this._renderContribitions.filter(c => c.time === exports.BaseRenderContributionTime.beforeFillStroke), this._afterRenderContribitions = this._renderContribitions.filter(c => c.time === exports.BaseRenderContributionTime.afterFillStroke)) : (this._beforeRenderContribitions = [], this._afterRenderContribitions = []);
|
|
18058
18392
|
}
|
|
18059
18393
|
reInit() {
|
|
18060
18394
|
this.init(this.graphicRenderContributions);
|
|
@@ -23103,8 +23437,8 @@
|
|
|
23103
23437
|
graphic.glyphHost && (graphic = graphic.glyphHost), stage && stage === this.pluginService.stage && graphic.isContainer && !this.skipBoundsTrigger && _tempBounds.copy(bounds);
|
|
23104
23438
|
}), stage.graphicService.hooks.afterUpdateAABBBounds.tap(this.key, (graphic, stage, bounds, params, selfChange) => {
|
|
23105
23439
|
stage && stage === this.pluginService.stage && graphic.isContainer && !this.skipBoundsTrigger && (_tempBounds.equals(bounds) || this.tryLayout(graphic, !1));
|
|
23106
|
-
}), stage.graphicService.hooks.onSetStage.tap(this.key, graphic => {
|
|
23107
|
-
graphic.glyphHost && (graphic = graphic.glyphHost), this.tryLayout(graphic, !1);
|
|
23440
|
+
}), stage.graphicService.hooks.onSetStage.tap(this.key, (graphic, nextStage) => {
|
|
23441
|
+
nextStage && nextStage === this.pluginService.stage && (graphic.glyphHost && (graphic = graphic.glyphHost), this.tryLayout(graphic, !1));
|
|
23108
23442
|
}));
|
|
23109
23443
|
}
|
|
23110
23444
|
deactivate(context) {
|
|
@@ -23667,7 +24001,6 @@
|
|
|
23667
24001
|
segments: segments,
|
|
23668
24002
|
shouldClipImageByLayout: shouldClipImageByLayout,
|
|
23669
24003
|
shouldUseMat4: shouldUseMat4,
|
|
23670
|
-
shouldUseSimpleAttributeFastPath: shouldUseSimpleAttributeFastPath,
|
|
23671
24004
|
snapLength: snapLength,
|
|
23672
24005
|
splitArc: splitArc,
|
|
23673
24006
|
splitArea: splitArea,
|
|
@@ -32467,25 +32800,56 @@
|
|
|
32467
32800
|
}
|
|
32468
32801
|
|
|
32469
32802
|
const animateUpdateContext = {
|
|
32470
|
-
|
|
32471
|
-
|
|
32803
|
+
type: exports.AttributeUpdateType.ANIMATE_UPDATE
|
|
32804
|
+
},
|
|
32805
|
+
animateBindContext = {
|
|
32806
|
+
type: exports.AttributeUpdateType.ANIMATE_BIND
|
|
32807
|
+
},
|
|
32808
|
+
animateStartContext = {
|
|
32809
|
+
type: exports.AttributeUpdateType.ANIMATE_START
|
|
32810
|
+
};
|
|
32811
|
+
function getAnimationContext(type) {
|
|
32812
|
+
switch (type) {
|
|
32813
|
+
case exports.AttributeUpdateType.ANIMATE_UPDATE:
|
|
32814
|
+
return animateUpdateContext;
|
|
32815
|
+
case exports.AttributeUpdateType.ANIMATE_BIND:
|
|
32816
|
+
return animateBindContext;
|
|
32817
|
+
case exports.AttributeUpdateType.ANIMATE_START:
|
|
32818
|
+
return animateStartContext;
|
|
32819
|
+
default:
|
|
32820
|
+
return {
|
|
32821
|
+
type: type
|
|
32822
|
+
};
|
|
32823
|
+
}
|
|
32824
|
+
}
|
|
32825
|
+
function prepareAnimationFrameAttribute(target) {
|
|
32826
|
+
const transientTarget = target;
|
|
32827
|
+
return transientTarget.attribute || (transientTarget.attribute = {}), transientTarget.attribute === transientTarget.baseAttributes && "function" == typeof transientTarget.detachAttributeFromBaseAttributes && transientTarget.detachAttributeFromBaseAttributes(), transientTarget.attributeMayContainTransientAttrs = !0, transientTarget.attribute;
|
|
32828
|
+
}
|
|
32829
|
+
function commitAnimationFrameAttribute(target) {
|
|
32830
|
+
var _a, _b;
|
|
32831
|
+
null === (_b = (_a = target).onAttributeUpdate) || void 0 === _b || _b.call(_a, animateUpdateContext);
|
|
32832
|
+
}
|
|
32472
32833
|
function applyAnimationFrameAttributes(target, attributes) {
|
|
32473
|
-
var _a;
|
|
32474
32834
|
if (!attributes) return;
|
|
32475
|
-
const
|
|
32476
|
-
transientTarget.attribute || (transientTarget.attribute = {});
|
|
32477
|
-
const targetAttribute = transientTarget.attribute;
|
|
32835
|
+
const targetAttribute = prepareAnimationFrameAttribute(target);
|
|
32478
32836
|
for (const key in attributes) Object.prototype.hasOwnProperty.call(attributes, key) && (targetAttribute[key] = attributes[key]);
|
|
32479
|
-
|
|
32837
|
+
commitAnimationFrameAttribute(target);
|
|
32838
|
+
}
|
|
32839
|
+
function applyAnimationFrameNumberAttributes(target, keys, from, to, ratio) {
|
|
32840
|
+
const targetAttribute = prepareAnimationFrameAttribute(target);
|
|
32841
|
+
for (let i = 0; i < keys.length; i++) {
|
|
32842
|
+
const key = keys[i];
|
|
32843
|
+
targetAttribute[key] = from[key] + (to[key] - from[key]) * ratio;
|
|
32844
|
+
}
|
|
32845
|
+
commitAnimationFrameAttribute(target);
|
|
32480
32846
|
}
|
|
32481
32847
|
function applyAnimationTransientAttributes(target, attributes, type = exports.AttributeUpdateType.ANIMATE_UPDATE) {
|
|
32482
32848
|
var _a;
|
|
32483
32849
|
if (!attributes) return;
|
|
32484
|
-
const context =
|
|
32485
|
-
type: type
|
|
32486
|
-
},
|
|
32850
|
+
const context = getAnimationContext(type),
|
|
32487
32851
|
transientTarget = target;
|
|
32488
|
-
"function" != typeof transientTarget.applyTransientAttributes ? "function" != typeof transientTarget.setAttributesAndPreventAnimate ? (transientTarget.attribute || (transientTarget.attribute = {}), Object.assign(transientTarget.attribute, attributes), null === (_a = transientTarget.onAttributeUpdate) || void 0 === _a || _a.call(transientTarget, context)) : transientTarget.setAttributesAndPreventAnimate(attributes, !1, context) : transientTarget.applyTransientAttributes(attributes, !1, context);
|
|
32852
|
+
"function" != typeof transientTarget.applyAnimationTransientAttributes ? "function" != typeof transientTarget.applyTransientAttributes ? "function" != typeof transientTarget.setAttributesAndPreventAnimate ? (transientTarget.attribute || (transientTarget.attribute = {}), Object.assign(transientTarget.attribute, attributes), null === (_a = transientTarget.onAttributeUpdate) || void 0 === _a || _a.call(transientTarget, context)) : transientTarget.setAttributesAndPreventAnimate(attributes, !1, context) : transientTarget.applyTransientAttributes(attributes, !1, context) : transientTarget.applyAnimationTransientAttributes(attributes, !1, context);
|
|
32489
32853
|
}
|
|
32490
32854
|
function applyAppearStartAttributes(target, attributes) {
|
|
32491
32855
|
applyAnimationTransientAttributes(target, attributes, exports.AttributeUpdateType.ANIMATE_BIND);
|
|
@@ -32882,7 +33246,7 @@
|
|
|
32882
33246
|
bind(target) {
|
|
32883
33247
|
this.target = target;
|
|
32884
33248
|
const trackerTarget = this.target;
|
|
32885
|
-
return "function" == typeof trackerTarget.trackAnimate ? trackerTarget.trackAnimate(this) : (this.target.animates || (this.target.animates = new Map()), this.target.animates.set(this.id, this)), this.onRemove(() => {
|
|
33249
|
+
return "function" == typeof trackerTarget.detachAttributeFromBaseAttributes && trackerTarget.detachAttributeFromBaseAttributes(), "function" == typeof trackerTarget.trackAnimate ? trackerTarget.trackAnimate(this) : (this.target.animates || (this.target.animates = new Map()), this.target.animates.set(this.id, this)), this.onRemove(() => {
|
|
32886
33250
|
this.stop(), this.__skipRestoreStaticAttributeOnRemove || "function" != typeof trackerTarget.restoreStaticAttribute || trackerTarget.restoreStaticAttribute(), "function" == typeof trackerTarget.untrackAnimate ? trackerTarget.untrackAnimate(this.id) : this.target.animates.delete(this.id);
|
|
32887
33251
|
}), this.target.onAnimateBind && !this.slience && this.target.onAnimateBind(this), this.target.animationAttribute || (this.target.animationAttribute = {}), this;
|
|
32888
33252
|
}
|
|
@@ -33378,6 +33742,33 @@
|
|
|
33378
33742
|
cb();
|
|
33379
33743
|
});
|
|
33380
33744
|
}
|
|
33745
|
+
getActiveAttrKeys() {
|
|
33746
|
+
const keys = [];
|
|
33747
|
+
for (let i = 0; i < this._animates.length; i++) {
|
|
33748
|
+
const animate = this._animates[i];
|
|
33749
|
+
if (animate.status === exports.AnimateStatus.END) continue;
|
|
33750
|
+
const endProps = animate.getEndProps();
|
|
33751
|
+
if (endProps) for (const key in endProps) Object.prototype.hasOwnProperty.call(endProps, key) && keys.indexOf(key) < 0 && keys.push(key);
|
|
33752
|
+
}
|
|
33753
|
+
return keys;
|
|
33754
|
+
}
|
|
33755
|
+
hasActiveAttrs() {
|
|
33756
|
+
for (let i = 0; i < this._animates.length; i++) {
|
|
33757
|
+
const animate = this._animates[i];
|
|
33758
|
+
if (animate.status === exports.AnimateStatus.END) continue;
|
|
33759
|
+
const endProps = animate.getEndProps();
|
|
33760
|
+
if (endProps) for (const key in endProps) if (Object.prototype.hasOwnProperty.call(endProps, key)) return !0;
|
|
33761
|
+
}
|
|
33762
|
+
return !1;
|
|
33763
|
+
}
|
|
33764
|
+
preventAttrs(keys) {
|
|
33765
|
+
if (!(null == keys ? void 0 : keys.length)) return this.hasActiveAttrs();
|
|
33766
|
+
for (let i = 0; i < this._animates.length; i++) {
|
|
33767
|
+
const animate = this._animates[i];
|
|
33768
|
+
animate.status !== exports.AnimateStatus.END && animate.preventAttrs(keys);
|
|
33769
|
+
}
|
|
33770
|
+
return this.hasActiveAttrs();
|
|
33771
|
+
}
|
|
33381
33772
|
_trackAnimation(animate) {
|
|
33382
33773
|
this._animates.push(animate), this._activeCount++, 1 !== this._activeCount || this._started || (this._started = !0, this.onStart()), animate.onEnd(() => {
|
|
33383
33774
|
this._activeCount--;
|
|
@@ -33683,8 +34074,22 @@
|
|
|
33683
34074
|
hasTrackedAnimate() {
|
|
33684
34075
|
return this.trackedAnimates.size > 0;
|
|
33685
34076
|
}
|
|
34077
|
+
hasStateInfo(list, target) {
|
|
34078
|
+
for (let i = 0; i < list.length; i++) if (list[i] === target) return !0;
|
|
34079
|
+
return !1;
|
|
34080
|
+
}
|
|
34081
|
+
takeOverUpdateAttrs(nextState, currentStates, shouldStopState) {
|
|
34082
|
+
if (nextState.state !== AnimationStates.UPDATE || !currentStates.length) return;
|
|
34083
|
+
const nextKeys = nextState.executor.getActiveAttrKeys();
|
|
34084
|
+
if (nextKeys.length) for (let i = 0; i < currentStates.length; i++) {
|
|
34085
|
+
const currentState = currentStates[i];
|
|
34086
|
+
currentState.state !== AnimationStates.UPDATE || currentState === nextState || this.hasStateInfo(shouldStopState, currentState) || currentState.executor.preventAttrs(nextKeys) || (currentState.executor.stop(null, !1), shouldStopState.push(currentState));
|
|
34087
|
+
}
|
|
34088
|
+
}
|
|
33686
34089
|
applyState(nextState, animationConfig, callback) {
|
|
34090
|
+
var _a;
|
|
33687
34091
|
const registry = AnimationTransitionRegistry.getInstance(),
|
|
34092
|
+
currentStateList = null !== (_a = this.stateList) && void 0 !== _a ? _a : [],
|
|
33688
34093
|
shouldStopState = [],
|
|
33689
34094
|
shouldApplyState = [];
|
|
33690
34095
|
if (this.stateList && this.stateList.length ? nextState.forEach((state, index) => {
|
|
@@ -33692,14 +34097,14 @@
|
|
|
33692
34097
|
allowTransition: !0,
|
|
33693
34098
|
stopOriginalTransition: !0
|
|
33694
34099
|
};
|
|
33695
|
-
|
|
34100
|
+
currentStateList.forEach(currState => {
|
|
33696
34101
|
const _result = registry.isTransitionAllowed(currState.state, state, this.graphic);
|
|
33697
34102
|
result.allowTransition = result.allowTransition && _result.allowTransition;
|
|
33698
34103
|
}), result.allowTransition && (shouldApplyState.push({
|
|
33699
34104
|
state: state,
|
|
33700
34105
|
animationConfig: isArray$1(animationConfig[index]) ? animationConfig[index].map(item => item.animation) : animationConfig[index].animation,
|
|
33701
34106
|
executor: new AnimateExecutor(this.graphic)
|
|
33702
|
-
}),
|
|
34107
|
+
}), currentStateList.forEach(currState => {
|
|
33703
34108
|
registry.isTransitionAllowed(currState.state, state, this.graphic).stopOriginalTransition && shouldStopState.push(currState);
|
|
33704
34109
|
}));
|
|
33705
34110
|
}) : nextState.forEach((state, index) => {
|
|
@@ -33711,12 +34116,18 @@
|
|
|
33711
34116
|
}), shouldStopState.forEach(state => {
|
|
33712
34117
|
state.executor.stop(null, !1);
|
|
33713
34118
|
}), shouldApplyState.length) {
|
|
33714
|
-
shouldApplyState[0].executor.execute(shouldApplyState[0].animationConfig);
|
|
34119
|
+
shouldApplyState[0].executor.execute(shouldApplyState[0].animationConfig), this.takeOverUpdateAttrs(shouldApplyState[0], currentStateList, shouldStopState);
|
|
33715
34120
|
for (let i = 0; i < shouldApplyState.length; i++) {
|
|
33716
34121
|
const nextState = shouldApplyState[i + 1],
|
|
33717
34122
|
currentState = shouldApplyState[i];
|
|
33718
34123
|
currentState.executor.onEnd(() => {
|
|
33719
|
-
|
|
34124
|
+
var _a;
|
|
34125
|
+
if (nextState) {
|
|
34126
|
+
nextState.executor.execute(nextState.animationConfig);
|
|
34127
|
+
const stoppedStates = [];
|
|
34128
|
+
this.takeOverUpdateAttrs(nextState, null !== (_a = this.stateList) && void 0 !== _a ? _a : [], stoppedStates), stoppedStates.length && this.stateList && (this.stateList = this.stateList.filter(state => !this.hasStateInfo(stoppedStates, state)));
|
|
34129
|
+
}
|
|
34130
|
+
this.stateList = this.stateList.filter(state => state !== currentState), i === shouldApplyState.length - 1 && callback && callback(!1);
|
|
33720
34131
|
});
|
|
33721
34132
|
}
|
|
33722
34133
|
} else callback && callback(!0);
|
|
@@ -35214,10 +35625,7 @@
|
|
|
35214
35625
|
super.onEnd(cb);
|
|
35215
35626
|
}
|
|
35216
35627
|
onUpdate(end, ratio, out) {
|
|
35217
|
-
|
|
35218
|
-
this.propKeys.forEach(key => {
|
|
35219
|
-
attrs[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
|
|
35220
|
-
}), applyAnimationFrameAttributes(this.target, attrs), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
|
|
35628
|
+
applyAnimationFrameNumberAttributes(this.target, this.propKeys, this.from, this.to, ratio), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
|
|
35221
35629
|
}
|
|
35222
35630
|
}
|
|
35223
35631
|
function growHeightOutIndividual(graphic, options, animationParameters) {
|
|
@@ -35275,10 +35683,7 @@
|
|
|
35275
35683
|
super.onEnd(cb);
|
|
35276
35684
|
}
|
|
35277
35685
|
onUpdate(end, ratio, out) {
|
|
35278
|
-
|
|
35279
|
-
this.propKeys.forEach(key => {
|
|
35280
|
-
attrs[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
|
|
35281
|
-
}), applyAnimationFrameAttributes(this.target, attrs), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
|
|
35686
|
+
applyAnimationFrameNumberAttributes(this.target, this.propKeys, this.from, this.to, ratio), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
|
|
35282
35687
|
}
|
|
35283
35688
|
}
|
|
35284
35689
|
|
|
@@ -35688,10 +36093,7 @@
|
|
|
35688
36093
|
super.onEnd(cb);
|
|
35689
36094
|
}
|
|
35690
36095
|
onUpdate(end, ratio, out) {
|
|
35691
|
-
|
|
35692
|
-
this.propKeys.forEach(key => {
|
|
35693
|
-
attrs[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
|
|
35694
|
-
}), applyAnimationFrameAttributes(this.target, attrs), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
|
|
36096
|
+
applyAnimationFrameNumberAttributes(this.target, this.propKeys, this.from, this.to, ratio), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
|
|
35695
36097
|
}
|
|
35696
36098
|
}
|
|
35697
36099
|
class GrowWidthOut extends ACustomAnimate {
|
|
@@ -35711,10 +36113,7 @@
|
|
|
35711
36113
|
super.onEnd(cb);
|
|
35712
36114
|
}
|
|
35713
36115
|
onUpdate(end, ratio, out) {
|
|
35714
|
-
|
|
35715
|
-
this.propKeys.forEach(key => {
|
|
35716
|
-
attrs[key] = this.from[key] + (this.to[key] - this.from[key]) * ratio;
|
|
35717
|
-
}), applyAnimationFrameAttributes(this.target, attrs), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
|
|
36116
|
+
applyAnimationFrameNumberAttributes(this.target, this.propKeys, this.from, this.to, ratio), this.target.addUpdatePositionTag(), this.target.addUpdateShapeAndBoundsTag();
|
|
35718
36117
|
}
|
|
35719
36118
|
}
|
|
35720
36119
|
|
|
@@ -41086,6 +41485,33 @@
|
|
|
41086
41485
|
});
|
|
41087
41486
|
}
|
|
41088
41487
|
|
|
41488
|
+
function collectTrackedAnimates(graphic, animates = [], visited = new Set()) {
|
|
41489
|
+
var _a, _b, _c, _d, _e;
|
|
41490
|
+
const trackedAnimates = null !== (_c = null === (_b = (_a = graphic).getTrackedAnimates) || void 0 === _b ? void 0 : _b.call(_a)) && void 0 !== _c ? _c : graphic.animates;
|
|
41491
|
+
return null == trackedAnimates || trackedAnimates.forEach(animate => {
|
|
41492
|
+
animate && !visited.has(animate) && (visited.add(animate), animates.push(animate));
|
|
41493
|
+
}), null === (_e = (_d = graphic).forEachChildren) || void 0 === _e || _e.call(_d, child => {
|
|
41494
|
+
collectTrackedAnimates(child, animates, visited);
|
|
41495
|
+
}), animates;
|
|
41496
|
+
}
|
|
41497
|
+
function appendExitReleaseCallback(state, callback) {
|
|
41498
|
+
callback && (null == state || state.onComplete.push(callback));
|
|
41499
|
+
}
|
|
41500
|
+
function runExitReleaseCallbacks(callbacks) {
|
|
41501
|
+
callbacks.forEach(callback => {
|
|
41502
|
+
callback();
|
|
41503
|
+
});
|
|
41504
|
+
}
|
|
41505
|
+
function bindExitReleaseAnimates(exitAnimates, getState, finalize) {
|
|
41506
|
+
const finish = animate => {
|
|
41507
|
+
const state = getState();
|
|
41508
|
+
state && !state.finalized && state.pendingAnimates.has(animate) && (state.pendingAnimates.delete(animate), state.pendingAnimates.size || finalize());
|
|
41509
|
+
};
|
|
41510
|
+
exitAnimates.forEach(animate => {
|
|
41511
|
+
animate.onEnd(() => finish(animate)), animate.onRemove(() => finish(animate));
|
|
41512
|
+
});
|
|
41513
|
+
}
|
|
41514
|
+
|
|
41089
41515
|
const DefaultAxisAnimation = {
|
|
41090
41516
|
type: "default",
|
|
41091
41517
|
duration: 300,
|
|
@@ -41117,12 +41543,65 @@
|
|
|
41117
41543
|
});
|
|
41118
41544
|
return this.add(offscreenGroup), this._renderInner(offscreenGroup), this.removeChild(offscreenGroup), this.attribute = currentAttribute, offscreenGroup.AABBBounds;
|
|
41119
41545
|
}
|
|
41546
|
+
_finalizeExitRelease() {
|
|
41547
|
+
var _a, _b;
|
|
41548
|
+
const state = this._exitReleaseState;
|
|
41549
|
+
if (null == state ? void 0 : state.finalized) return;
|
|
41550
|
+
state && (state.finalized = !0);
|
|
41551
|
+
const parent = this.parent,
|
|
41552
|
+
removeFromParent = !!(null == state ? void 0 : state.removeFromParent),
|
|
41553
|
+
callbacks = null !== (_a = null == state ? void 0 : state.onComplete) && void 0 !== _a ? _a : [];
|
|
41554
|
+
this._exitReleaseState = void 0, this._prevInnerView = null, this._innerView = null, this.axisLabelsContainer = null, this.axisContainer = null, this.removeAllChild(!0), super.release(!0), removeFromParent && (null === (_b = null != parent ? parent : this.parent) || void 0 === _b || _b.removeChild(this)), runExitReleaseCallbacks(callbacks);
|
|
41555
|
+
}
|
|
41556
|
+
_runExitAnimationBeforeRelease(options = {}) {
|
|
41557
|
+
var _a, _b, _c;
|
|
41558
|
+
if (this._exitReleaseState && !this._exitReleaseState.finalized) return this._exitReleaseState.removeFromParent = this._exitReleaseState.removeFromParent || !!options.removeFromParent, appendExitReleaseCallback(this._exitReleaseState, options.onComplete), !0;
|
|
41559
|
+
if (!this.stage || !1 === this.attribute.animation || !1 === this.attribute.animationExit || !this._innerView) return !1;
|
|
41560
|
+
if (this._prepare(), !(null === (_a = this._animationConfig) || void 0 === _a ? void 0 : _a.exit)) return !1;
|
|
41561
|
+
const exitTargets = new Set();
|
|
41562
|
+
if (traverseGroup(this._innerView, el => {
|
|
41563
|
+
"group" !== el.type && exitTargets.add(el);
|
|
41564
|
+
}), !exitTargets.size) return !1;
|
|
41565
|
+
const existingAnimates = collectTrackedAnimates(this),
|
|
41566
|
+
{
|
|
41567
|
+
delay = 0,
|
|
41568
|
+
duration = DefaultAxisAnimation.duration,
|
|
41569
|
+
easing = DefaultAxisAnimation.easing
|
|
41570
|
+
} = this._animationConfig.exit;
|
|
41571
|
+
exitTargets.forEach(target => {
|
|
41572
|
+
var _a, _b, _c;
|
|
41573
|
+
const startAttrs = {
|
|
41574
|
+
opacity: null !== (_a = target.attribute.opacity) && void 0 !== _a ? _a : 1,
|
|
41575
|
+
fillOpacity: null !== (_b = target.attribute.fillOpacity) && void 0 !== _b ? _b : 1,
|
|
41576
|
+
strokeOpacity: null !== (_c = target.attribute.strokeOpacity) && void 0 !== _c ? _c : 1
|
|
41577
|
+
},
|
|
41578
|
+
endAttrs = {
|
|
41579
|
+
opacity: 0,
|
|
41580
|
+
fillOpacity: 0,
|
|
41581
|
+
strokeOpacity: 0
|
|
41582
|
+
};
|
|
41583
|
+
commitUpdateAnimationTarget(target, endAttrs, startAttrs), target.animate().wait(delay).to(endAttrs, duration, easing);
|
|
41584
|
+
});
|
|
41585
|
+
const exitAnimates = collectTrackedAnimates(this).filter(animate => !existingAnimates.includes(animate));
|
|
41586
|
+
if (!exitAnimates.length) return !1;
|
|
41587
|
+
this.setAttribute("childrenPickable", !1), null === (_c = (_b = this._innerView).removeAllEventListeners) || void 0 === _c || _c.call(_b), this.releaseStatus = "willRelease";
|
|
41588
|
+
const pendingAnimates = new Set(exitAnimates);
|
|
41589
|
+
return this._exitReleaseState = {
|
|
41590
|
+
pendingAnimates: pendingAnimates,
|
|
41591
|
+
finalized: !1,
|
|
41592
|
+
removeFromParent: !!options.removeFromParent,
|
|
41593
|
+
onComplete: options.onComplete ? [options.onComplete] : []
|
|
41594
|
+
}, bindExitReleaseAnimates(exitAnimates, () => this._exitReleaseState, () => this._finalizeExitRelease()), !0;
|
|
41595
|
+
}
|
|
41596
|
+
releaseWithExitAnimation(options = {}) {
|
|
41597
|
+
return "released" !== this.releaseStatus && this._runExitAnimationBeforeRelease(options);
|
|
41598
|
+
}
|
|
41120
41599
|
render() {
|
|
41121
|
-
this._prepare(), this._prevInnerView = this._innerView && getElMap(this._innerView), this.removeAllChild(!0), this._innerView = graphicCreator.group({
|
|
41600
|
+
this._exitReleaseState || (this._prepare(), this._prevInnerView = this._innerView && getElMap(this._innerView), this.removeAllChild(!0), this._innerView = graphicCreator.group({
|
|
41122
41601
|
x: 0,
|
|
41123
41602
|
y: 0,
|
|
41124
41603
|
pickable: !1
|
|
41125
|
-
}), this.add(this._innerView), this._renderInner(this._innerView), this._bindEvent(), this.runAnimation();
|
|
41604
|
+
}), this.add(this._innerView), this._renderInner(this._innerView), this._bindEvent(), this.runAnimation());
|
|
41126
41605
|
}
|
|
41127
41606
|
_prepare() {
|
|
41128
41607
|
this._prepareAnimate(DefaultAxisAnimation);
|
|
@@ -41454,8 +41933,8 @@
|
|
|
41454
41933
|
});
|
|
41455
41934
|
}
|
|
41456
41935
|
}
|
|
41457
|
-
release() {
|
|
41458
|
-
super.release(), this._prevInnerView = null, this._innerView = null;
|
|
41936
|
+
release(all) {
|
|
41937
|
+
this._exitReleaseState ? this._finalizeExitRelease() : (all && this.removeAllChild(!0), super.release(all), all && this.removeAllChild(!0), this._prevInnerView = null, this._innerView = null);
|
|
41459
41938
|
}
|
|
41460
41939
|
}
|
|
41461
41940
|
|
|
@@ -42370,8 +42849,8 @@
|
|
|
42370
42849
|
const orient = this.attribute.orient;
|
|
42371
42850
|
return "left" === orient || "right" === orient ? this.attribute.width ? this.attribute.width : (this.attribute.maxWidth && (offset = Math.min(offset, this.attribute.maxWidth)), this.attribute.minWidth && (offset = Math.max(offset, this.attribute.minWidth)), offset) : offset;
|
|
42372
42851
|
}
|
|
42373
|
-
release() {
|
|
42374
|
-
super.release(), this._breaks = null;
|
|
42852
|
+
release(all) {
|
|
42853
|
+
super.release(all), this._breaks = null;
|
|
42375
42854
|
}
|
|
42376
42855
|
}
|
|
42377
42856
|
LineAxis.defaultAttributes = DEFAULT_AXIS_THEME, mixin(LineAxis, LineAxisMixin);
|
|
@@ -44343,6 +44822,14 @@
|
|
|
44343
44822
|
}
|
|
44344
44823
|
return t;
|
|
44345
44824
|
};
|
|
44825
|
+
function cloneAttributeSnapshot(value) {
|
|
44826
|
+
if (!isObject$1(value) || isArray$1(value)) return value;
|
|
44827
|
+
const snapshot = {};
|
|
44828
|
+
return Object.keys(value).forEach(key => {
|
|
44829
|
+
const nextValue = value[key];
|
|
44830
|
+
snapshot[key] = isObject$1(nextValue) && !isArray$1(nextValue) ? cloneAttributeSnapshot(nextValue) : nextValue;
|
|
44831
|
+
}), snapshot;
|
|
44832
|
+
}
|
|
44346
44833
|
loadLabelComponent();
|
|
44347
44834
|
class LabelBase extends AnimateComponent {
|
|
44348
44835
|
setBitmap(bitmap) {
|
|
@@ -44407,11 +44894,56 @@
|
|
|
44407
44894
|
return baseMark && baseMark.getAttributes(!0).fill && lineGraphic.setAttribute("stroke", baseMark.getAttributes(!0).fill), this.attribute.line && !isEmpty(this.attribute.line.style) && lineGraphic.setAttributes(this.attribute.line.style), this._setStatesOfLabelLine(lineGraphic), lineGraphic;
|
|
44408
44895
|
}
|
|
44409
44896
|
}
|
|
44897
|
+
_finalizeExitRelease() {
|
|
44898
|
+
var _a, _b, _c, _d;
|
|
44899
|
+
const state = this._exitReleaseState;
|
|
44900
|
+
if (null == state ? void 0 : state.finalized) return;
|
|
44901
|
+
state && (state.finalized = !0);
|
|
44902
|
+
const parent = this.parent,
|
|
44903
|
+
removeFromParent = !!(null == state ? void 0 : state.removeFromParent),
|
|
44904
|
+
callbacks = null !== (_a = null == state ? void 0 : state.onComplete) && void 0 !== _a ? _a : [];
|
|
44905
|
+
this._exitReleaseState = void 0, this._graphicToText = new Map(), null === (_b = this._idToGraphic) || void 0 === _b || _b.clear(), null === (_c = this._idToPoint) || void 0 === _c || _c.clear(), this._baseMarks = void 0, this.removeAllChild(!0), super.release(!0), removeFromParent && (null === (_d = null != parent ? parent : this.parent) || void 0 === _d || _d.removeChild(this)), runExitReleaseCallbacks(callbacks);
|
|
44906
|
+
}
|
|
44907
|
+
_runExitAnimationBeforeRelease(options = {}) {
|
|
44908
|
+
var _a, _b;
|
|
44909
|
+
if (this._exitReleaseState && !this._exitReleaseState.finalized) return this._exitReleaseState.removeFromParent = this._exitReleaseState.removeFromParent || !!options.removeFromParent, appendExitReleaseCallback(this._exitReleaseState, options.onComplete), !0;
|
|
44910
|
+
if (!this.stage || !1 === this.attribute.animation || !1 === this.attribute.animationExit || !(null === (_a = this._graphicToText) || void 0 === _a ? void 0 : _a.size)) return !1;
|
|
44911
|
+
if (this._prepareAnimate(DefaultLabelAnimation), !(null === (_b = this._animationConfig) || void 0 === _b ? void 0 : _b.exit)) return !1;
|
|
44912
|
+
const exitTargets = new Set();
|
|
44913
|
+
if (this._graphicToText.forEach(label => {
|
|
44914
|
+
(null == label ? void 0 : label.text) && exitTargets.add(label.text), (null == label ? void 0 : label.labelLine) && exitTargets.add(label.labelLine);
|
|
44915
|
+
}), !exitTargets.size) return !1;
|
|
44916
|
+
const existingAnimates = collectTrackedAnimates(this);
|
|
44917
|
+
exitTargets.forEach(target => {
|
|
44918
|
+
var _a;
|
|
44919
|
+
target.applyAnimationState(["exit"], [{
|
|
44920
|
+
name: "exit",
|
|
44921
|
+
animation: Object.assign(Object.assign({}, this._animationConfig.exit), {
|
|
44922
|
+
type: null !== (_a = this._animationConfig.exit.type) && void 0 !== _a ? _a : "fadeOut",
|
|
44923
|
+
selfOnly: !0
|
|
44924
|
+
})
|
|
44925
|
+
}]);
|
|
44926
|
+
});
|
|
44927
|
+
const exitAnimates = collectTrackedAnimates(this).filter(animate => !existingAnimates.includes(animate));
|
|
44928
|
+
if (!exitAnimates.length) return !1;
|
|
44929
|
+
this.setAttribute("childrenPickable", !1), this.releaseStatus = "willRelease";
|
|
44930
|
+
const pendingAnimates = new Set(exitAnimates);
|
|
44931
|
+
return this._exitReleaseState = {
|
|
44932
|
+
pendingAnimates: pendingAnimates,
|
|
44933
|
+
finalized: !1,
|
|
44934
|
+
removeFromParent: !!options.removeFromParent,
|
|
44935
|
+
onComplete: options.onComplete ? [options.onComplete] : []
|
|
44936
|
+
}, bindExitReleaseAnimates(exitAnimates, () => this._exitReleaseState, () => this._finalizeExitRelease()), !0;
|
|
44937
|
+
}
|
|
44938
|
+
releaseWithExitAnimation(options = {}) {
|
|
44939
|
+
return "released" !== this.releaseStatus && this._runExitAnimationBeforeRelease(options);
|
|
44940
|
+
}
|
|
44410
44941
|
render() {
|
|
44942
|
+
if (this._exitReleaseState) return;
|
|
44411
44943
|
if (this._prepare(), isNil$1(this._idToGraphic) || this._isCollectionBase && isNil$1(this._idToPoint)) return;
|
|
44412
44944
|
const markAttributeList = [];
|
|
44413
44945
|
!1 !== this._enableAnimation && this._baseMarks.forEach(mark => {
|
|
44414
|
-
markAttributeList.push(mark.attribute), mark.initAttributes(mark.getAttributes(!0));
|
|
44946
|
+
markAttributeList.push(cloneAttributeSnapshot(mark.attribute)), mark.initAttributes(mark.getAttributes(!0));
|
|
44415
44947
|
});
|
|
44416
44948
|
const {
|
|
44417
44949
|
overlap: overlap,
|
|
@@ -44977,6 +45509,10 @@
|
|
|
44977
45509
|
_canPlaceInside(textBound, shapeBound) {
|
|
44978
45510
|
return !(!textBound || !shapeBound) && shapeBound.encloses(textBound);
|
|
44979
45511
|
}
|
|
45512
|
+
release(all) {
|
|
45513
|
+
var _a, _b;
|
|
45514
|
+
this._exitReleaseState ? this._finalizeExitRelease() : (all && this.removeAllChild(!0), super.release(all), this._graphicToText = new Map(), null === (_a = this._idToGraphic) || void 0 === _a || _a.clear(), null === (_b = this._idToPoint) || void 0 === _b || _b.clear(), this._baseMarks = void 0);
|
|
45515
|
+
}
|
|
44980
45516
|
setLocation(point) {
|
|
44981
45517
|
this.translateTo(point.x, point.y);
|
|
44982
45518
|
}
|
|
@@ -45746,6 +46282,7 @@
|
|
|
45746
46282
|
}
|
|
45747
46283
|
render() {
|
|
45748
46284
|
var _a;
|
|
46285
|
+
if (this._exitReleaseState) return;
|
|
45749
46286
|
const {
|
|
45750
46287
|
dataLabels: dataLabels,
|
|
45751
46288
|
size: size
|
|
@@ -45780,6 +46317,47 @@
|
|
|
45780
46317
|
currentComponentMap.get(key) || this.removeChild(cp);
|
|
45781
46318
|
}), this._componentMap = currentComponentMap;
|
|
45782
46319
|
}
|
|
46320
|
+
_finalizeExitRelease() {
|
|
46321
|
+
var _a, _b, _c;
|
|
46322
|
+
const state = this._exitReleaseState;
|
|
46323
|
+
if (null == state ? void 0 : state.finalized) return;
|
|
46324
|
+
state && (state.finalized = !0);
|
|
46325
|
+
const parent = this.parent,
|
|
46326
|
+
removeFromParent = !!(null == state ? void 0 : state.removeFromParent),
|
|
46327
|
+
callbacks = null !== (_a = null == state ? void 0 : state.onComplete) && void 0 !== _a ? _a : [];
|
|
46328
|
+
this._exitReleaseState = void 0, null === (_b = this._componentMap) || void 0 === _b || _b.clear(), this.removeAllChild(!0), super.release(!0), removeFromParent && (null === (_c = null != parent ? parent : this.parent) || void 0 === _c || _c.removeChild(this)), runExitReleaseCallbacks(callbacks);
|
|
46329
|
+
}
|
|
46330
|
+
releaseWithExitAnimation(options = {}) {
|
|
46331
|
+
var _a;
|
|
46332
|
+
if ("released" === this.releaseStatus) return !1;
|
|
46333
|
+
if (this._exitReleaseState && !this._exitReleaseState.finalized) return this._exitReleaseState.removeFromParent = this._exitReleaseState.removeFromParent || !!options.removeFromParent, appendExitReleaseCallback(this._exitReleaseState, options.onComplete), !0;
|
|
46334
|
+
if (!this.stage || !(null === (_a = this._componentMap) || void 0 === _a ? void 0 : _a.size)) return !1;
|
|
46335
|
+
const state = {
|
|
46336
|
+
pendingCount: 0,
|
|
46337
|
+
finalized: !1,
|
|
46338
|
+
removeFromParent: !!options.removeFromParent,
|
|
46339
|
+
onComplete: options.onComplete ? [options.onComplete] : []
|
|
46340
|
+
},
|
|
46341
|
+
exitingComponents = [],
|
|
46342
|
+
fallbackComponents = [];
|
|
46343
|
+
let initializing = !0;
|
|
46344
|
+
const finish = () => {
|
|
46345
|
+
state.finalized || (state.pendingCount -= 1, state.pendingCount <= 0 && !initializing && this._finalizeExitRelease());
|
|
46346
|
+
};
|
|
46347
|
+
return this._exitReleaseState = state, this._componentMap.forEach(component => {
|
|
46348
|
+
state.pendingCount += 1;
|
|
46349
|
+
component.releaseWithExitAnimation({
|
|
46350
|
+
removeFromParent: !1,
|
|
46351
|
+
onComplete: finish
|
|
46352
|
+
}) ? exitingComponents.push(component) : (state.pendingCount -= 1, fallbackComponents.push(component));
|
|
46353
|
+
}), exitingComponents.length ? (fallbackComponents.forEach(component => {
|
|
46354
|
+
component.release(!0), this.removeChild(component);
|
|
46355
|
+
}), this.setAttribute("childrenPickable", !1), this.releaseStatus = "willRelease", initializing = !1, state.pendingCount <= 0 && this._finalizeExitRelease(), !0) : (this._exitReleaseState = void 0, !1);
|
|
46356
|
+
}
|
|
46357
|
+
release(all) {
|
|
46358
|
+
var _a;
|
|
46359
|
+
this._exitReleaseState ? this._finalizeExitRelease() : (all && this.removeAllChild(!0), super.release(all), null === (_a = this._componentMap) || void 0 === _a || _a.clear());
|
|
46360
|
+
}
|
|
45783
46361
|
setLocation(point) {
|
|
45784
46362
|
this.translateTo(point.x, point.y);
|
|
45785
46363
|
}
|
|
@@ -47413,14 +47991,51 @@
|
|
|
47413
47991
|
y: clipInRange ? -(null !== (_b = limitRect.y) && void 0 !== _b ? _b : 0) : 0
|
|
47414
47992
|
});
|
|
47415
47993
|
}
|
|
47416
|
-
|
|
47994
|
+
_finalizeExitRelease() {
|
|
47995
|
+
var _a, _b;
|
|
47996
|
+
const state = this._exitReleaseState;
|
|
47997
|
+
if (null == state ? void 0 : state.finalized) return;
|
|
47998
|
+
state && (state.finalized = !0);
|
|
47999
|
+
const parent = this.parent,
|
|
48000
|
+
removeFromParent = !!(null == state ? void 0 : state.removeFromParent),
|
|
48001
|
+
releaseSelf = !!(null == state ? void 0 : state.releaseSelf),
|
|
48002
|
+
callbacks = null !== (_a = null == state ? void 0 : state.onComplete) && void 0 !== _a ? _a : [];
|
|
48003
|
+
this._exitReleaseState = void 0, this._releaseEvent(), this._container = null, this._containerClip = null, this.removeAllChild(!0), releaseSelf && (super.release(!0), removeFromParent && (null === (_b = null != parent ? parent : this.parent) || void 0 === _b || _b.removeChild(this))), runExitReleaseCallbacks(callbacks);
|
|
48004
|
+
}
|
|
48005
|
+
_runExitAnimationBeforeCleanup(options = {}) {
|
|
47417
48006
|
var _a;
|
|
48007
|
+
const releaseSelf = !!options.releaseSelf;
|
|
48008
|
+
if (this._exitReleaseState && !this._exitReleaseState.finalized) return this._exitReleaseState.releaseSelf = this._exitReleaseState.releaseSelf || releaseSelf, this._exitReleaseState.removeFromParent = this._exitReleaseState.removeFromParent || !!options.removeFromParent, appendExitReleaseCallback(this._exitReleaseState, options.onComplete), !0;
|
|
48009
|
+
if (!this.stage || !1 === this.attribute.animation || !1 === this.attribute.animationExit || !this._container) return !1;
|
|
48010
|
+
if (this.transAnimationConfig(), !(null === (_a = this._animationConfig) || void 0 === _a ? void 0 : _a.exit)) return !1;
|
|
48011
|
+
const existingAnimates = collectTrackedAnimates(this);
|
|
48012
|
+
this.markerAnimate("exit");
|
|
48013
|
+
const exitAnimates = collectTrackedAnimates(this).filter(animate => !existingAnimates.includes(animate));
|
|
48014
|
+
if (!exitAnimates.length) return !1;
|
|
48015
|
+
this._releaseEvent(), this.setAttribute("childrenPickable", !1), releaseSelf && (this.releaseStatus = "willRelease");
|
|
48016
|
+
const pendingAnimates = new Set(exitAnimates);
|
|
48017
|
+
return this._exitReleaseState = {
|
|
48018
|
+
pendingAnimates: pendingAnimates,
|
|
48019
|
+
finalized: !1,
|
|
48020
|
+
releaseSelf: releaseSelf,
|
|
48021
|
+
removeFromParent: !!options.removeFromParent,
|
|
48022
|
+
onComplete: options.onComplete ? [options.onComplete] : []
|
|
48023
|
+
}, bindExitReleaseAnimates(exitAnimates, () => this._exitReleaseState, () => this._finalizeExitRelease()), !0;
|
|
48024
|
+
}
|
|
48025
|
+
releaseWithExitAnimation(options = {}) {
|
|
48026
|
+
return "released" !== this.releaseStatus && this._runExitAnimationBeforeCleanup(Object.assign(Object.assign({}, options), {
|
|
48027
|
+
releaseSelf: !0
|
|
48028
|
+
}));
|
|
48029
|
+
}
|
|
48030
|
+
render() {
|
|
48031
|
+
var _a, _b;
|
|
48032
|
+
if (null === (_a = this._exitReleaseState) || void 0 === _a ? void 0 : _a.releaseSelf) return;
|
|
47418
48033
|
this.transAnimationConfig(), this.setAttribute("pickable", !1);
|
|
47419
|
-
const markerVisible = null === (
|
|
47420
|
-
!1 === this.attribute.interactive && this.setAttribute("childrenPickable", !1), markerVisible && this.isValidPoints() ? this._container ? (this._updateContainer(), this.updateMarker(), this.markerAnimate("update")) : (this._initContainer(), this.initMarker(this._container), this.markerAnimate("enter")) :
|
|
48034
|
+
const markerVisible = null === (_b = this.attribute.visible) || void 0 === _b || _b;
|
|
48035
|
+
!1 === this.attribute.interactive && this.setAttribute("childrenPickable", !1), markerVisible && this.isValidPoints() ? (this._exitReleaseState && this._finalizeExitRelease(), this._container ? (this._updateContainer(), this.updateMarker(), this.markerAnimate("update")) : (this._initContainer(), this.initMarker(this._container), this.markerAnimate("enter"))) : this._runExitAnimationBeforeCleanup() || (this._container = null, this._containerClip = null, this.removeAllChild(!0)), this._releaseEvent(), this._bindEvent();
|
|
47421
48036
|
}
|
|
47422
|
-
release() {
|
|
47423
|
-
this.markerAnimate("exit"), super.release(), this._releaseEvent(), this._container = null;
|
|
48037
|
+
release(all) {
|
|
48038
|
+
this._exitReleaseState ? this._finalizeExitRelease() : (!1 !== this.attribute.animation && !1 !== this.attribute.animationExit && this.markerAnimate("exit"), all && this.removeAllChild(!0), super.release(all), this._releaseEvent(), this._container = null, this._containerClip = null);
|
|
47424
48039
|
}
|
|
47425
48040
|
}
|
|
47426
48041
|
|
|
@@ -49683,7 +50298,10 @@
|
|
|
49683
50298
|
const innerGroupHeight = innerGroupBounds.height(),
|
|
49684
50299
|
itemGroupWidth = isValid$1(this.attribute.item.width) ? this.attribute.item.width : innerGroupWidth + parsedPadding[1] + parsedPadding[3],
|
|
49685
50300
|
itemGroupHeight = this._itemHeightByUser || innerGroupHeight + parsedPadding[0] + parsedPadding[2];
|
|
49686
|
-
return itemGroup.
|
|
50301
|
+
return itemGroup.setAttributes({
|
|
50302
|
+
width: itemGroupWidth,
|
|
50303
|
+
height: itemGroupHeight
|
|
50304
|
+
}), focusShape && focusShape.setAttribute("visible", !1), innerGroup.translateTo(-innerGroupBounds.x1 + parsedPadding[3], -innerGroupBounds.y1 + parsedPadding[0]), itemGroup;
|
|
49687
50305
|
}
|
|
49688
50306
|
_createPager(compStyle) {
|
|
49689
50307
|
var _a, _b;
|
|
@@ -51320,7 +51938,11 @@
|
|
|
51320
51938
|
subTextBoundsWidth = this._subTitle ? this._subTitle.AABBBounds.width() : 0;
|
|
51321
51939
|
let totalWidth = Math.max(mainTextBoundsWidth, subTextBoundsWidth),
|
|
51322
51940
|
totalHeight = mainTextBoundsHeight + (null !== (_q = subtextStyle.height) && void 0 !== _q ? _q : subTextBoundsHeight);
|
|
51323
|
-
if (isValid$1(width) && (totalWidth = width), isValid$1(height) && (totalHeight = height), isValid$1(minWidth) && totalWidth < minWidth && (totalWidth = minWidth), isValid$1(maxWidth) && totalWidth > maxWidth && (totalWidth = maxWidth), isValid$1(minHeight) && totalHeight < minHeight && (totalHeight = minHeight), isValid$1(maxHeight) && totalHeight > maxHeight && (totalHeight = maxHeight), group.
|
|
51941
|
+
if (isValid$1(width) && (totalWidth = width), isValid$1(height) && (totalHeight = height), isValid$1(minWidth) && totalWidth < minWidth && (totalWidth = minWidth), isValid$1(maxWidth) && totalWidth > maxWidth && (totalWidth = maxWidth), isValid$1(minHeight) && totalHeight < minHeight && (totalHeight = minHeight), isValid$1(maxHeight) && totalHeight > maxHeight && (totalHeight = maxHeight), group.setAttributes({
|
|
51942
|
+
width: totalWidth,
|
|
51943
|
+
height: totalHeight,
|
|
51944
|
+
boundsPadding: parsedPadding
|
|
51945
|
+
}), this._mainTitle) {
|
|
51324
51946
|
if (isValid$1(align) || isValid$1(textStyle.align)) {
|
|
51325
51947
|
const mainTitleAlign = textStyle.align ? textStyle.align : align,
|
|
51326
51948
|
mainTitleWidth = null !== (_r = textStyle.width) && void 0 !== _r ? _r : totalWidth;
|
|
@@ -54682,7 +55304,7 @@
|
|
|
54682
55304
|
return resolveLegacyApp().createStage(params);
|
|
54683
55305
|
}
|
|
54684
55306
|
|
|
54685
|
-
const version = "1.1.0-alpha.
|
|
55307
|
+
const version = "1.1.0-alpha.18";
|
|
54686
55308
|
|
|
54687
55309
|
exports.AComponentAnimate = AComponentAnimate;
|
|
54688
55310
|
exports.ACustomAnimate = ACustomAnimate;
|
|
@@ -55607,7 +56229,6 @@
|
|
|
55607
56229
|
exports.setPoptipTheme = setPoptipTheme;
|
|
55608
56230
|
exports.shouldClipImageByLayout = shouldClipImageByLayout;
|
|
55609
56231
|
exports.shouldUseMat4 = shouldUseMat4;
|
|
55610
|
-
exports.shouldUseSimpleAttributeFastPath = shouldUseSimpleAttributeFastPath;
|
|
55611
56232
|
exports.smartInvertStrategy = smartInvertStrategy;
|
|
55612
56233
|
exports.snakeWave = snakeWave;
|
|
55613
56234
|
exports.snapLength = snapLength;
|