@visactor/vrender-core 1.1.8-alpha.1 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/allocator/bounds-allocate.js +1 -2
- package/cjs/animate/config.js +2 -1
- package/cjs/color-string/colorName.js +1 -1
- package/cjs/color-string/index.js +1 -1
- package/cjs/color-string/interpolate.js +1 -1
- package/cjs/color-string/store.js +1 -1
- package/cjs/common/bounds-context.js +2 -1
- package/cjs/common/contribution-store-state.js +1 -2
- package/cjs/common/performance-raf.js +2 -1
- package/cjs/common/render-command-list.js +1 -2
- package/cjs/common/simplify.js +1 -1
- package/cjs/common/sort.js +1 -1
- package/cjs/common/split-path.js +1 -1
- package/cjs/common/text.js +1 -1
- package/cjs/graphic/graphic.d.ts +1 -0
- package/cjs/graphic/graphic.js +9 -4
- package/cjs/graphic/graphic.js.map +1 -1
- package/dist/index.es.js +21 -0
- package/es/allocator/bounds-allocate.js +1 -2
- package/es/animate/config.js +2 -1
- package/es/color-string/colorName.js +1 -1
- package/es/color-string/index.js +1 -1
- package/es/color-string/interpolate.js +1 -1
- package/es/color-string/store.js +1 -1
- package/es/common/bounds-context.js +2 -1
- package/es/common/contribution-store-state.js +1 -2
- package/es/common/performance-raf.js +2 -1
- package/es/common/render-command-list.js +1 -2
- package/es/common/simplify.js +1 -1
- package/es/common/sort.js +1 -1
- package/es/common/split-path.js +1 -1
- package/es/common/text.js +1 -1
- package/es/graphic/graphic.d.ts +1 -0
- package/es/graphic/graphic.js +9 -4
- package/es/graphic/graphic.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -11409,6 +11409,17 @@ class GraphicImpl extends Node {
|
|
|
11409
11409
|
}
|
|
11410
11410
|
return true;
|
|
11411
11411
|
}
|
|
11412
|
+
hasStatePatch(patch) {
|
|
11413
|
+
if (!patch) {
|
|
11414
|
+
return false;
|
|
11415
|
+
}
|
|
11416
|
+
for (const key in patch) {
|
|
11417
|
+
if (Object.prototype.hasOwnProperty.call(patch, key)) {
|
|
11418
|
+
return true;
|
|
11419
|
+
}
|
|
11420
|
+
}
|
|
11421
|
+
return false;
|
|
11422
|
+
}
|
|
11412
11423
|
commitSameStatePatchRefresh(states, hasAnimation, animateSameStatePatchChange = false) {
|
|
11413
11424
|
var _a;
|
|
11414
11425
|
const previousStates = (_a = this.currentStates) !== null && _a !== void 0 ? _a : EMPTY_STATE_NAMES;
|
|
@@ -11524,6 +11535,10 @@ class GraphicImpl extends Node {
|
|
|
11524
11535
|
this.resolvedStatePatch = undefined;
|
|
11525
11536
|
this.sharedStateDirty = false;
|
|
11526
11537
|
this.clearSharedStateActiveRegistrations();
|
|
11538
|
+
if (!this.attributeMayContainTransientAttrs && !this.hasStatePatch(previousResolvedStatePatch)) {
|
|
11539
|
+
this.emitStateUpdateEvent();
|
|
11540
|
+
return;
|
|
11541
|
+
}
|
|
11527
11542
|
if (hasAnimation) {
|
|
11528
11543
|
this._syncFinalAttributeFromStaticTruth();
|
|
11529
11544
|
const removedStateAnimationAttrs = this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch);
|
|
@@ -11608,6 +11623,12 @@ class GraphicImpl extends Node {
|
|
|
11608
11623
|
this.resolvedStatePatch = resolvedStateAttrs;
|
|
11609
11624
|
this.sharedStateDirty = false;
|
|
11610
11625
|
this.syncSharedStateActiveRegistrations();
|
|
11626
|
+
if (!this.attributeMayContainTransientAttrs &&
|
|
11627
|
+
!this.hasStatePatch(previousResolvedStatePatch) &&
|
|
11628
|
+
!this.hasStatePatch(resolvedStateAttrs)) {
|
|
11629
|
+
this.emitStateUpdateEvent();
|
|
11630
|
+
return;
|
|
11631
|
+
}
|
|
11611
11632
|
if (hasAnimation) {
|
|
11612
11633
|
this._syncFinalAttributeFromStaticTruth();
|
|
11613
11634
|
const removedStateAnimationAttrs = this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch);
|
package/es/animate/config.js
CHANGED
package/es/color-string/index.js
CHANGED
|
@@ -104,4 +104,4 @@ export function colorStringInterpolationToStr(fromColor, toColor, ratio) {
|
|
|
104
104
|
return ColorStore.Get(fromColor, ColorType.Color255, _fromColorRGB), ColorStore.Get(toColor, ColorType.Color255, _toColorRGB),
|
|
105
105
|
`rgba(${Math.round(_fromColorRGB[0] + (_toColorRGB[0] - _fromColorRGB[0]) * ratio)},${Math.round(_fromColorRGB[1] + (_toColorRGB[1] - _fromColorRGB[1]) * ratio)},${Math.round(_fromColorRGB[2] + (_toColorRGB[2] - _fromColorRGB[2]) * ratio)},${_fromColorRGB[3] + (_toColorRGB[3] - _fromColorRGB[3]) * ratio})`;
|
|
106
106
|
}
|
|
107
|
-
//# sourceMappingURL=interpolate.js.map
|
|
107
|
+
//# sourceMappingURL=interpolate.js.map
|
package/es/color-string/store.js
CHANGED
|
@@ -10,5 +10,4 @@ export function getContributionStoreState() {
|
|
|
10
10
|
const scope = globalThis;
|
|
11
11
|
return scope[CONTRIBUTION_STORE_STATE_SYMBOL] || (scope[CONTRIBUTION_STORE_STATE_SYMBOL] = createContributionStoreState()),
|
|
12
12
|
scope[CONTRIBUTION_STORE_STATE_SYMBOL];
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=contribution-store-state.js.map
|
|
13
|
+
}
|
package/es/common/simplify.js
CHANGED
|
@@ -30,4 +30,4 @@ export function flatten_simplify(points, tolerance, highestQuality) {
|
|
|
30
30
|
if (points.length <= 10) return points;
|
|
31
31
|
return points = highestQuality ? points : simplifyRadialDist(points, void 0 !== tolerance ? tolerance * tolerance : 1);
|
|
32
32
|
}
|
|
33
|
-
//# sourceMappingURL=simplify.js.map
|
|
33
|
+
//# sourceMappingURL=simplify.js.map
|
package/es/common/sort.js
CHANGED
package/es/common/split-path.js
CHANGED
package/es/common/text.js
CHANGED
|
@@ -24,4 +24,4 @@ export function textAttributesToStyle(attrs) {
|
|
|
24
24
|
attrs.underline ? style["text-decoration"] = "underline" : attrs.lineThrough && (style["text-decoration"] = "line-through"),
|
|
25
25
|
attrs.fill && isString(attrs.fill) && (style.color = attrs.fill), style;
|
|
26
26
|
}
|
|
27
|
-
//# sourceMappingURL=text.js.map
|
|
27
|
+
//# sourceMappingURL=text.js.map
|
package/es/graphic/graphic.d.ts
CHANGED
|
@@ -262,6 +262,7 @@ declare abstract class GraphicImpl<T extends Partial<IGraphicAttribute> = Partia
|
|
|
262
262
|
shouldRefreshSameStatePatch: boolean;
|
|
263
263
|
};
|
|
264
264
|
protected sameStatePatches(left?: Partial<T>, right?: Partial<T>): boolean;
|
|
265
|
+
protected hasStatePatch(patch?: Partial<T>): boolean;
|
|
265
266
|
protected commitSameStatePatchRefresh(states: string[], hasAnimation?: boolean, animateSameStatePatchChange?: boolean): void;
|
|
266
267
|
protected resolveStateAnimateConfig(animateConfig?: IAnimateConfig): any;
|
|
267
268
|
applyStateAttrs(attrs: Partial<T>, stateNames: string[], hasAnimation?: boolean, isClear?: boolean, animateConfig?: IAnimateConfig, extraAnimateAttrs?: Partial<T>, stateTransitionTargetAttrs?: Partial<T>): void;
|
package/es/graphic/graphic.js
CHANGED
|
@@ -993,6 +993,11 @@ class GraphicImpl extends Node {
|
|
|
993
993
|
}
|
|
994
994
|
return !0;
|
|
995
995
|
}
|
|
996
|
+
hasStatePatch(patch) {
|
|
997
|
+
if (!patch) return !1;
|
|
998
|
+
for (const key in patch) if (Object.prototype.hasOwnProperty.call(patch, key)) return !0;
|
|
999
|
+
return !1;
|
|
1000
|
+
}
|
|
996
1001
|
commitSameStatePatchRefresh(states, hasAnimation, animateSameStatePatchChange = !1) {
|
|
997
1002
|
var _a;
|
|
998
1003
|
const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, {transition: transition, effectiveStates: effectiveStates, resolvedStateAttrs: resolvedStateAttrs} = this.resolveGraphicStateTransition(states, !0), patchChanged = !this.sameStatePatches(previousResolvedStatePatch, resolvedStateAttrs);
|
|
@@ -1056,7 +1061,7 @@ class GraphicImpl extends Node {
|
|
|
1056
1061
|
const resolvedStateAttrs = hasAnimation || this.hasCustomEvent("beforeStateUpdate") ? cloneAttributeValue(null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : {}) : null !== (_c = this.baseAttributes) && void 0 !== _c ? _c : {};
|
|
1057
1062
|
if (!transition.changed || this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !0)) if (this.currentStates = transition.states,
|
|
1058
1063
|
this.effectiveStates = [], this.resolvedStatePatch = void 0, this.sharedStateDirty = !1,
|
|
1059
|
-
this.clearSharedStateActiveRegistrations(), hasAnimation) {
|
|
1064
|
+
this.clearSharedStateActiveRegistrations(), this.attributeMayContainTransientAttrs || this.hasStatePatch(previousResolvedStatePatch)) if (hasAnimation) {
|
|
1060
1065
|
this._syncFinalAttributeFromStaticTruth();
|
|
1061
1066
|
const removedStateAnimationAttrs = this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch);
|
|
1062
1067
|
this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !0, void 0, null == removedStateAnimationAttrs ? void 0 : removedStateAnimationAttrs.extraAttrs, null == removedStateAnimationAttrs ? void 0 : removedStateAnimationAttrs.stateTransitionTargetAttrs);
|
|
@@ -1064,7 +1069,7 @@ class GraphicImpl extends Node {
|
|
|
1064
1069
|
type: AttributeUpdateType.STATE
|
|
1065
1070
|
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, void 0, {
|
|
1066
1071
|
type: AttributeUpdateType.STATE
|
|
1067
|
-
}), this.emitStateUpdateEvent();
|
|
1072
|
+
}), this.emitStateUpdateEvent(); else this.emitStateUpdateEvent();
|
|
1068
1073
|
}
|
|
1069
1074
|
removeState(stateName, hasAnimation) {
|
|
1070
1075
|
const transition = this.resolveRemoveStateTransition(stateName);
|
|
@@ -1095,7 +1100,7 @@ class GraphicImpl extends Node {
|
|
|
1095
1100
|
const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES, previousResolvedStatePatch = this.resolvedStatePatch, {transition: transition, effectiveStates: effectiveStates, resolvedStateAttrs: resolvedStateAttrs} = this.resolveGraphicStateTransition(states);
|
|
1096
1101
|
if ((transition.changed || !this.sameStateNames(previousStates, transition.states)) && this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1)) if (this.currentStates = transition.states,
|
|
1097
1102
|
this.effectiveStates = [ ...effectiveStates ], this.resolvedStatePatch = resolvedStateAttrs,
|
|
1098
|
-
this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), hasAnimation) {
|
|
1103
|
+
this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), this.attributeMayContainTransientAttrs || this.hasStatePatch(previousResolvedStatePatch) || this.hasStatePatch(resolvedStateAttrs)) if (hasAnimation) {
|
|
1099
1104
|
this._syncFinalAttributeFromStaticTruth();
|
|
1100
1105
|
const removedStateAnimationAttrs = this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch);
|
|
1101
1106
|
this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, null == removedStateAnimationAttrs ? void 0 : removedStateAnimationAttrs.extraAttrs, null == removedStateAnimationAttrs ? void 0 : removedStateAnimationAttrs.stateTransitionTargetAttrs);
|
|
@@ -1103,7 +1108,7 @@ class GraphicImpl extends Node {
|
|
|
1103
1108
|
type: AttributeUpdateType.STATE
|
|
1104
1109
|
}) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
|
|
1105
1110
|
type: AttributeUpdateType.STATE
|
|
1106
|
-
}), this.emitStateUpdateEvent();
|
|
1111
|
+
}), this.emitStateUpdateEvent(); else this.emitStateUpdateEvent();
|
|
1107
1112
|
}
|
|
1108
1113
|
invalidateResolver() {
|
|
1109
1114
|
var _a, _b;
|