@visactor/vrender 1.1.0-alpha.17 → 1.1.0-alpha.19

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Direction } from '@visactor/vrender-core';
2
- export declare const version = "1.1.0-alpha.17";
2
+ export declare const version = "1.1.0-alpha.19";
3
3
  export * from '@visactor/vrender-core';
4
4
  export * from '@visactor/vrender-kits';
5
5
  export * from '@visactor/vrender-animate';
package/cjs/index.js CHANGED
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "Direction", {
26
26
  get: function() {
27
27
  return vrender_core_1.Direction;
28
28
  }
29
- }), exports.version = "1.1.0-alpha.17", __exportStar(require("@visactor/vrender-core"), exports),
29
+ }), exports.version = "1.1.0-alpha.19", __exportStar(require("@visactor/vrender-core"), exports),
30
30
  __exportStar(require("@visactor/vrender-kits"), exports), __exportStar(require("@visactor/vrender-animate"), exports),
31
31
  __exportStar(require("@visactor/vrender-components"), exports), __exportStar(require("./entries"), exports);
32
32
 
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAmD;AAa1C,0FAbA,wBAAS,OAaA;AAXL,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,yDAAuC;AACvC,yDAAuC;AACvC,4DAA0C;AAC1C,+DAA6C;AAC7C,4CAA0B;AAC1B,mCAAuC;AAA9B,qGAAA,WAAW,OAAA;AAGpB,6DAAkD;AAAzC,wGAAA,KAAK,OAAA","file":"index.js","sourcesContent":["import { Direction } from '@visactor/vrender-core';\n// 导出版本号\nexport const version = \"1.1.0-alpha.17\";\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\nexport * from '@visactor/vrender-animate';\nexport * from '@visactor/vrender-components';\nexport * from './entries';\nexport { createStage } from './legacy';\n\n// avoid naming conflicts with 'State' & 'Direction' in '@visactor/vrender-components'\nexport { State } from '@visactor/vrender-animate';\nexport { Direction };\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yDAAmD;AAa1C,0FAbA,wBAAS,OAaA;AAXL,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,yDAAuC;AACvC,yDAAuC;AACvC,4DAA0C;AAC1C,+DAA6C;AAC7C,4CAA0B;AAC1B,mCAAuC;AAA9B,qGAAA,WAAW,OAAA;AAGpB,6DAAkD;AAAzC,wGAAA,KAAK,OAAA","file":"index.js","sourcesContent":["import { Direction } from '@visactor/vrender-core';\n// 导出版本号\nexport const version = \"1.1.0-alpha.19\";\n\nexport * from '@visactor/vrender-core';\nexport * from '@visactor/vrender-kits';\nexport * from '@visactor/vrender-animate';\nexport * from '@visactor/vrender-components';\nexport * from './entries';\nexport { createStage } from './legacy';\n\n// avoid naming conflicts with 'State' & 'Direction' in '@visactor/vrender-components'\nexport { State } from '@visactor/vrender-animate';\nexport { Direction };\n"]}
package/dist/index.es.js CHANGED
@@ -8778,6 +8778,7 @@ function flushStageSharedStateRefresh(stage) {
8778
8778
  pending.clear(), null == perfMonitor || perfMonitor.recordRefresh("flushedGraphics", graphics.length), graphics.forEach(graphic => {
8779
8779
  if ("released" === graphic.releaseStatus) return;
8780
8780
  if (graphic.stage !== stage) return;
8781
+ if (!graphic.sharedStateDirty) return;
8781
8782
  const refresh = graphic.refreshSharedStateBeforeRender;
8782
8783
  "function" == typeof refresh && (refresh.call(graphic), null == perfMonitor || perfMonitor.incrementCounter("sharedRefreshCommits"));
8783
8784
  }), perfMonitor && (perfMonitor.recordCost("sharedRefresh", performance.now() - start), perfMonitor.recordEvent("shared-refresh-flush", {
@@ -9015,13 +9016,11 @@ class Graphic extends Node {
9015
9016
  };
9016
9017
  }
9017
9018
  recomputeCurrentStatePatch() {
9018
- var _a, _b, _c, _d;
9019
+ var _a, _b;
9019
9020
  if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)) return this.effectiveStates = [], this.resolvedStatePatch = void 0, void this.syncSharedStateActiveRegistrations();
9020
- const stateResolveBaseAttrs = null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : this.attribute,
9021
- stateModel = this.createStateModel();
9022
- null === (_c = this.stateEngine) || void 0 === _c || _c.setResolveContext(this, stateResolveBaseAttrs);
9023
- const transition = stateModel.useStates(this.currentStates),
9024
- effectiveStates = null !== (_d = transition.effectiveStates) && void 0 !== _d ? _d : transition.states,
9021
+ const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(),
9022
+ transition = this.createStateModel(stateResolveBaseAttrs).useStates(this.currentStates),
9023
+ effectiveStates = null !== (_b = transition.effectiveStates) && void 0 !== _b ? _b : transition.states,
9025
9024
  resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : this.getStateStyleResolver(this.stateMergeMode).resolve(stateResolveBaseAttrs, this.states, this.stateProxy, transition.states, this.stateSort);
9026
9025
  this.currentStates = transition.states, this.effectiveStates = [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.syncSharedStateActiveRegistrations();
9027
9026
  }
@@ -9614,7 +9613,15 @@ class Graphic extends Node {
9614
9613
  var _a;
9615
9614
  return null === (_a = this.states) || void 0 === _a ? void 0 : _a[stateName];
9616
9615
  }
9617
- createStateModel() {
9616
+ getStateResolveBaseAttrs() {
9617
+ var _a;
9618
+ return null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : this.attribute;
9619
+ }
9620
+ syncStateResolveContext(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
9621
+ var _a;
9622
+ return null === (_a = this.stateEngine) || void 0 === _a || _a.setResolveContext(this, stateResolveBaseAttrs), stateResolveBaseAttrs;
9623
+ }
9624
+ createStateModel(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
9618
9625
  const {
9619
9626
  compiledDefinitions: compiledDefinitions,
9620
9627
  stateProxyEligibility: stateProxyEligibility,
@@ -9627,7 +9634,7 @@ class Graphic extends Node {
9627
9634
  stateProxyEligibility: stateProxyEligibility,
9628
9635
  states: this.states,
9629
9636
  mergeMode: this.stateMergeMode
9630
- }), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateProxy = this.stateProxy, this.stateEngineStateSort = this.stateSort, this.stateEngineMergeMode = this.stateMergeMode, this.stateEngineStateProxyModeKey = stateProxyModeKey) : (this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0), new StateModel({
9637
+ }), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateProxy = this.stateProxy, this.stateEngineStateSort = this.stateSort, this.stateEngineMergeMode = this.stateMergeMode, this.stateEngineStateProxyModeKey = stateProxyModeKey) : (this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0), this.syncStateResolveContext(stateResolveBaseAttrs), new StateModel({
9631
9638
  states: this.states,
9632
9639
  currentStates: this.currentStates,
9633
9640
  stateSort: this.stateSort,
@@ -9696,6 +9703,70 @@ class Graphic extends Node {
9696
9703
  resolvedStateAttrs: resolvedStateAttrs
9697
9704
  };
9698
9705
  }
9706
+ resolveGraphicStateTransition(states, previousStates, forceResolverRefresh = !1) {
9707
+ var _a, _b;
9708
+ let transition = this.resolveSimpleLocalStateTransition(states, previousStates);
9709
+ const isSimpleLocalTransition = !!transition;
9710
+ let resolvedStateAttrs;
9711
+ if (transition) resolvedStateAttrs = transition.resolvedStateAttrs;else {
9712
+ const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(),
9713
+ stateModel = this.createStateModel(stateResolveBaseAttrs);
9714
+ forceResolverRefresh && (null === (_a = this.stateEngine) || void 0 === _a || _a.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 !== (_b = transition.effectiveStates) && void 0 !== _b ? _b : 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: AttributeUpdateType.STATE
9765
+ }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
9766
+ type: AttributeUpdateType.STATE
9767
+ }), this.emitStateUpdateEvent());
9768
+ }
9769
+ }
9699
9770
  resolveStateAnimateConfig(animateConfig) {
9700
9771
  var _a, _b, _c;
9701
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;
@@ -9771,34 +9842,35 @@ class Graphic extends Node {
9771
9842
  const transition = this.createStateModel().addState(stateName, keepCurrentStates);
9772
9843
  transition.changed && this.useStates(transition.states, hasAnimation);
9773
9844
  }
9774
- setStates(states, hasAnimation) {
9845
+ setStates(states, options) {
9775
9846
  var _a, _b, _c;
9776
- const nextStates = (null == states ? void 0 : states.length) ? states : EMPTY_STATE_NAMES,
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,
9777
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));
9778
- if (nextStates.length) this.sameStateNames(this.currentStates, nextStates) ? this.sharedStateDirty && this.refreshSharedStateBeforeRender() : this.useStates(nextStates, hasAnimation);else {
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 {
9779
9858
  if (!hasCurrentState && !this.sharedStateDirty) return;
9780
9859
  this.clearStates(hasAnimation);
9781
9860
  }
9782
9861
  }
9783
9862
  useStates(states, hasAnimation) {
9784
- var _a, _b, _c, _d;
9863
+ var _a;
9785
9864
  if (!states.length) return void this.clearStates(hasAnimation);
9786
9865
  const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES,
9787
- previousResolvedStatePatch = this.resolvedStatePatch;
9788
- let transition = this.resolveSimpleLocalStateTransition(states, previousStates);
9789
- const isSimpleLocalTransition = !!transition;
9790
- let resolvedStateAttrs;
9791
- if (transition) {
9792
- if (!transition.changed) return;
9793
- resolvedStateAttrs = transition.resolvedStateAttrs;
9794
- } else {
9795
- const stateResolveBaseAttrs = null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : this.attribute,
9796
- stateModel = this.createStateModel();
9797
- if (null === (_c = this.stateEngine) || void 0 === _c || _c.setResolveContext(this, stateResolveBaseAttrs), transition = stateModel.useStates(states), !transition.changed && this.sameStateNames(previousStates, transition.states)) return;
9798
- resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : this.getStateStyleResolver(this.stateMergeMode).resolve(stateResolveBaseAttrs, this.states, this.stateProxy, transition.states, this.stateSort);
9799
- }
9800
- const effectiveStates = null !== (_d = transition.effectiveStates) && void 0 !== _d ? _d : transition.states;
9801
- if (this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1)) {
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)) {
9802
9874
  if (this.currentStates = transition.states, this.effectiveStates = isSimpleLocalTransition ? effectiveStates : [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), this.stage) {
9803
9875
  const perfMonitor = getActiveStageStatePerfMonitor(this.stage);
9804
9876
  null == perfMonitor || perfMonitor.incrementCounter("stateCommits"), null == perfMonitor || perfMonitor.recordEvent("state-commit", {
@@ -9814,10 +9886,10 @@ class Graphic extends Node {
9814
9886
  }
9815
9887
  }
9816
9888
  invalidateResolver() {
9817
- var _a, _b, _c;
9889
+ var _a, _b;
9818
9890
  if (!this.stateEngine || !(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || !this.compiledStateDefinitions) return;
9819
- const stateResolveBaseAttrs = null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : this.attribute;
9820
- this.stateEngine.setResolveContext(this, stateResolveBaseAttrs), this.resolverEpoch = (null !== (_c = this.resolverEpoch) && void 0 !== _c ? _c : 0) + 1, this.stateEngine.invalidateResolverCache();
9891
+ this.syncStateResolveContext();
9892
+ this.resolverEpoch = (null !== (_b = this.resolverEpoch) && void 0 !== _b ? _b : 0) + 1, this.stateEngine.invalidateResolverCache();
9821
9893
  const transition = this.stateEngine.applyStates(this.currentStates),
9822
9894
  resolvedStateAttrs = Object.assign({}, this.stateEngine.resolvedPatch);
9823
9895
  this.effectiveStates = [...transition.effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), this.stopStateAnimates(), this._restoreAttributeFromStaticTruth({
@@ -55232,6 +55304,6 @@ function createStage(params) {
55232
55304
  return resolveLegacyApp().createStage(params);
55233
55305
  }
55234
55306
 
55235
- const version = "1.1.0-alpha.17";
55307
+ const version = "1.1.0-alpha.19";
55236
55308
 
55237
55309
  export { AComponentAnimate, ACustomAnimate, ARC3D_NUMBER_TYPE, ARC_NUMBER_TYPE, AREA_NUMBER_TYPE, AStageAnimate, AXIS_ELEMENT_NAME, AbstractComponent, AbstractGraphicRender, Animate, AnimateExecutor, AnimateMode, AnimateStatus, Step as AnimateStep, AnimateStepType, AnimationStateManager, AnimationStateStore, AnimationStates, AnimationTransitionRegistry, AppContext, Application, Arc, Arc3d, Arc3dRender, ArcInfo, ArcLabel, ArcRender, ArcRenderContribution, ArcSegment, Area, AreaRender, AreaRenderContribution, AttributeUpdateType, AutoEnablePlugins, AxisStateValue, BaseCanvas, BaseEnvContribution, BasePlayer, BaseRender, BaseRenderContributionTime, BaseWindowHandlerContribution, Basis, BeforeRenderConstribution, BoundsContext, BoundsPicker, BrowserEntry, BrowserEnvContribution, Brush, CIRCLE_NUMBER_TYPE, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasArc3dPicker, CanvasArcPicker, CanvasAreaPicker, CanvasCirclePicker, CanvasFactory, CanvasGifImagePicker, CanvasGlyphPicker, CanvasGroupPicker, CanvasImagePicker, CanvasLinePicker, CanvasLottiePicker, CanvasPathPicker, CanvasPickerContribution, CanvasPolygonPicker, CanvasPyramid3dPicker, CanvasRect3dPicker, CanvasRectPicker, CanvasRichTextPicker, CanvasStarPicker, CanvasSymbolPicker, CanvasTextLayout, CanvasTextPicker, CheckBox, Circle, CircleAxis, CircleAxisGrid, CircleCrosshair, CircleRender, CircleRenderContribution, ClipAngleAnimate, ClipDirectionAnimate, ClipGraphicAnimate, ClipIn, ClipOut, ClipRadiusAnimate, ColorContinuousLegend, ColorInterpolate, ColorStore, ColorType, CommonDrawItemInterceptorContribution, CommonRenderContribution, ComponentAnimator, Context2dFactory, ContinuousPlayer, ContributionProvider, ContributionRegistry, ContributionStore, CubicBezierCurve, CurveContext, CurveTypeEnum, CustomEvent, CustomPath2D, CustomSymbolClass, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TEXT_FONT_FAMILY$1 as DEFAULT_TEXT_FONT_FAMILY, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DebugDrawItemInterceptorContribution, DefaultArcAllocate, DefaultArcAttribute, DefaultArcRenderContribution, DefaultAreaAllocate, DefaultAreaAttribute, DefaultAreaTextureRenderContribution, DefaultAttribute, DefaultBaseBackgroundRenderContribution, DefaultBaseClipRenderAfterContribution, DefaultBaseClipRenderBeforeContribution, DefaultBaseInteractiveRenderContribution, DefaultBaseTextureRenderContribution, DefaultCanvasAllocate, DefaultCanvasArcRender, DefaultCanvasAreaRender, DefaultCanvasCircleRender, DefaultCanvasGroupRender, DefaultCanvasImageRender, DefaultCanvasLineRender, DefaultCanvasPathRender, DefaultCanvasPolygonRender, DefaultCanvasRectRender, DefaultCanvasSymbolRender, DefaultCanvasTextRender, DefaultCircleAllocate, DefaultCircleAttribute, DefaultCircleRenderContribution, DefaultConnectAttribute, DefaultDebugAttribute, DefaultFillStyle, DefaultGlobal, DefaultGlobalPickerService, DefaultGlyphAttribute, DefaultGraphicAllocate, DefaultGraphicMemoryManager, DefaultGraphicService, DefaultGraphicUtil, DefaultGroupAttribute, DefaultGroupBackgroundRenderContribution, DefaultImageAttribute, DefaultImageRenderContribution, DefaultLayerService, DefaultLayout, DefaultLineAllocate, DefaultLineAttribute, DefaultMat4Allocate, DefaultMatrixAllocate, DefaultPathAllocate, DefaultPathAttribute, DefaultPickService, DefaultPickStyle, DefaultPolygonAttribute, DefaultRect3dAttribute, DefaultRectAllocate, DefaultRectAttribute, DefaultRectRenderContribution, DefaultRenderService, DefaultRichTextAttribute, DefaultRichTextIconAttribute, DefaultStarAttribute, DefaultStrokeStyle, DefaultStyle, DefaultSymbolAllocate, DefaultSymbolAttribute, DefaultSymbolClipRangeStrokeRenderContribution, DefaultSymbolRenderContribution, DefaultTextAllocate, DefaultTextAttribute, DefaultTextMeasureContribution, DefaultTextStyle, DefaultTicker, DefaultTimeline, DefaultTransform, DefaultTransformUtil, DefaultWindow, Direction, DirectionEnum, DirectionalLight, DiscreteLegend, DiscretePlayer, Dissolve, Distortion, DragNDrop, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Easing, Edge, EditModule, EmptyContext2d, EmptyTip, EnvContribution, EventManager, EventSystem, EventTarget, FORMAT_ALL_TEXT_COMMAND, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, Factory, FadeIn, FadeOut, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FlexLayoutPlugin, Fragment, FromTo, GLYPH_NUMBER_TYPE, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, GaussianBlur, Generator, Gesture, GifImage, Glitch, GlobalPickerService, Glyph, GlyphRender, GradientParser, Graphic, GraphicCreator$1 as GraphicCreator, GraphicFactory, GraphicPicker, GraphicRender, GraphicService, GraphicStateExtension, GraphicUtil, Grayscale, Group, GroupFadeIn, GroupFadeOut, GroupRender, GroupRenderContribution, GroupTransition, GroupUpdateAABBBoundsMode, GrowAngleIn, GrowAngleOut, GrowCenterIn, GrowCenterOut, GrowHeightIn, GrowHeightOut, GrowIn, GrowOut, GrowPointsIn, GrowPointsOut, GrowPointsXIn, GrowPointsXOut, GrowPointsYIn, GrowPointsYOut, GrowRadiusIn, GrowRadiusOut, GrowWidthIn, GrowWidthOut, HtmlAttributePlugin, IContainPointMode, IDataZoomEvent, IDataZoomInteractiveEvent, IMAGE_NUMBER_TYPE, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Image$1 as Image, ImageRender, ImageRenderContribution, IncreaseCount, IncrementalDrawContribution, Indicator, InputRichText, InputText, InteractiveDrawItemInterceptorContribution, InteractivePickItemInterceptorContribution, InteractiveSubRenderContribution, LEGEND_ELEMENT_NAME, LINE_NUMBER_TYPE, LabelBase, LabelItemAppear, LabelItemDisappear, Layer, LayerFactory, LayerService, LegendEvent, LegendStateValue, Line$1 as Line, LineAxis, LineAxisGrid, LineCrosshair, LineLabel, LineRender, Linear, LinearClosed, LinkPath, Lottie, ManualTicker, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Mat4Allocate, MathArcPicker, MathAreaPicker, MathCirclePicker, MathGlyphPicker, MathImagePicker, MathLinePicker, MathPathPicker, MathPickerContribution, MathPolygonPicker, MathRectPicker, MathRichTextPicker, MathSymbolPicker, MathTextPicker, MatrixAllocate, MeasureModeEnum, MiniappEntry, MonotoneX, MonotoneY, MorphingPath, MotionPath, MoveIn, MoveOut, MoveRotateIn, MoveRotateOut, MoveScaleIn, MoveScaleOut, MultiToOneMorphingPath, NOWORK_ANIMATE_ATTR, Node, NodeEntry, OrthoCamera, OutputRichText, PATH_NUMBER_TYPE, POLYGON_NUMBER_TYPE, PURE_STYLE_KEY, PYRAMID3D_NUMBER_TYPE, Pager, Particle, Path, PathRender, PathRenderContribution, PerformanceRAF, PickItemInterceptor, PickServiceInterceptor, PickerRegistry, PickerService, Pixelation, PlayerEventEnum, PluginRegistry, PluginService, Polygon, PolygonCrosshair, PolygonRender, PolygonRenderContribution, PolygonSectorCrosshair, PopTip, PoptipAppear, PoptipDisappear, PulseAnimate, Pyramid3d, Pyramid3dRender, REACT_TO_CANOPUS_EVENTS, REACT_TO_CANOPUS_EVENTS_LIST, RECT3D_NUMBER_TYPE, RECT_NUMBER_TYPE, RICHTEXT_NUMBER_TYPE, Radio, RafBasedSTO, ReactAttributePlugin, Rect, Rect3DRender, Rect3d, RectCrosshair, RectLabel, RectRender, RectRenderContribution, ReflectSegContext, RenderSelector, RenderService, RendererRegistry, ResourceLoader, RichText, RichTextEditPlugin, RichTextRender, RotateBySphereAnimate, RotateIn, RotateOut, SLIDER_ELEMENT_NAME, STAR_NUMBER_TYPE, STATUS$1 as STATUS, SVG_ATTRIBUTE_MAP, SVG_ATTRIBUTE_MAP_KEYS, SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS, SYMBOL_NUMBER_TYPE, ScaleIn, ScaleOut, ScrollBar, SectorCrosshair, SegContext, Segment, SeriesNumberCellStateValue, SeriesNumberEvent, ShadowPickServiceInterceptorContribution, ShadowRoot, ShadowRootDrawItemInterceptorContribution, ShadowRootPickItemInterceptorContribution, SizeContinuousLegend, SlideIn, SlideOut, SlideOutRichText, SlideRichText, Slider, SpinIn, SpinOut, SplitRectAfterRenderContribution, SplitRectBeforeRenderContribution, Stage, StageFactory, Star, StarRender, StarRenderContribution, State, StateDefinitionCompiler, StateEngine, StaticLayerHandlerContribution, Step$1 as Step, StepClosed, StoryLabelItem, StreamLight, StrokeIn, StrokeOut, Switch, Symbol$1 as Symbol, SymbolLabel, SymbolRender, SymbolRenderContribution, TEXT_NUMBER_TYPE, TableSeriesNumber, Tag, TagPointsUpdate, Text, TextDirection, TextMeasureContribution, TextRender, TextRenderContribution, Theme, Timeline, Title, Tooltip, TopZIndex, TransformUtil, Update, UpdateTag, VArc, VArc3d, VArea, VCircle, VGlobal, VGlyph, VGroup, VImage, VLine, VPath, VPolygon, VPyramid3d, VRect, VRect3d, VRichText, VSymbol, VTag, VText, VWindow, ViewTransform3dPlugin, VirtualLayerHandlerContribution, WILDCARD, WeatherBox, WindowHandlerContribution, WrapText, XMLParser, _calculateLineHeight, _interpolateColor, _registerArc, addArcToBezierPath$1 as addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, alignTextInLine, alternatingWave, angle, angleLabelOrientAttribute, angleTo, application, applyTransformOnBezierCurves, arc3dModule, arcModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindArc3dCanvasPickerContribution, bindArc3dRenderModule, bindArcCanvasPickerContribution, bindArcMathPickerContribution, bindArcRenderModule, bindAreaCanvasPickerContribution, bindAreaMathPickerContribution, bindAreaRenderModule, bindBrowserEnv, bindCircleCanvasPickerContribution, bindCircleMathPickerContribution, bindCircleRenderModule, bindContributionProvider, bindContributionProviderNoSingletonScope, bindFeishuEnv, bindGifImageCanvasPickerContribution, bindGifImageRenderContribution, bindGlyphCanvasPickerContribution, bindGlyphMathPickerContribution, bindGlyphRenderModule, bindHarmonyEnv, bindImageCanvasPickerContribution, bindImageMathPickerContribution, bindImageRenderModule, bindLineCanvasPickerContribution, bindLineMathPickerContribution, bindLineRenderModule, bindLottieCanvasPickerContribution, bindLottieRenderContribution, bindLynxEnv, bindMathPicker, bindNodeEnv, bindPathCanvasPickerContribution, bindPathMathPickerContribution, bindPathRenderModule, bindPolygonCanvasPickerContribution, bindPolygonMathPickerContribution, bindPolygonRenderModule, bindPyramid3dCanvasPickerContribution, bindPyramid3dRenderModule, bindRect3dCanvasPickerContribution, bindRect3dRenderModule, bindRectCanvasPickerContribution, bindRectMathPickerContribution, bindRectRenderModule, bindRichTextMathPickerContribution, bindRichtextCanvasPickerContribution, bindRichtextRenderModule, bindStarRenderModule, bindSymbolCanvasPickerContribution, bindSymbolMathPickerContribution, bindSymbolRenderModule, bindTTEnv, bindTaroEnv, bindTextCanvasPickerContribution, bindTextMathPickerContribution, bindTextRenderModule, bindWxEnv, bootstrapLegacyVRenderRuntime, bootstrapVRenderBrowserApp, bootstrapVRenderNodeApp, boundStroke, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache, calculateArcCornerRadius, calculateLineHeight, canvasAllocate, cartesianTicks, centerToCorner, centroidOfSubpath, circleBounds, circleModule, clampRadian, clock, colorEqual, colorStringInterpolationToStr, columnCenterToEdge, columnEdgeToCenter, columnLeftToRight, columnRightToLeft, computeOffsetForlimit, configureRuntimeApplicationForApp, container, continuousTicks, contrastAccessibilityChecker, convertDomainToTickData, cornerTangents, cornerToCenter, createBrowserApp$1 as createApp, createArc, createArc3d, createArea, createBrowserApp$1 as createBrowserApp, createBrowserVRenderApp, createCanvasEventTransformer, createCircle, createColor, createComponentAnimator, createConicalGradient, createContributionProvider$1 as createContributionProvider, createEventTransformer, createGifImage, createGlyph, createGraphic$1 as createGraphic, createGroup, createImage, createImageElement$1 as createImageElement, createLine, createLottie, createMat4, createMiniappApp, createNodeApp$1 as createNodeApp, createNodeVRenderApp, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createStar, createSymbol, createText, createTextGraphicByType, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, decodeReactDom, defaultArcAllocate, defaultArcBackgroundRenderContribution, defaultArcRenderContribution, defaultArcTextureRenderContribution, defaultAreaAllocate, defaultBaseBackgroundRenderContribution, defaultBaseClipRenderAfterContribution, defaultBaseClipRenderBeforeContribution, defaultBaseTextureRenderContribution, defaultCircleAllocate, defaultCircleBackgroundRenderContribution, defaultCircleRenderContribution, defaultCircleTextureRenderContribution, defaultGraphicMemoryManager, defaultGroupBackgroundRenderContribution, defaultImageBackgroundRenderContribution, defaultImageRenderContribution, defaultLineAllocate, defaultPathAllocate, defaultRectAllocate, defaultRectBackgroundRenderContribution, defaultRectRenderContribution, defaultRectTextureRenderContribution, defaultStarBackgroundRenderContribution, defaultStarTextureRenderContribution, defaultSymbolAllocate, defaultSymbolBackgroundRenderContribution, defaultSymbolClipRangeStrokeRenderContribution, defaultSymbolRenderContribution, defaultSymbolTextureRenderContribution, defaultTextAllocate, defaultTicker, defaultTimeline, deltaXYToAngle, diagonalCenterToEdge, diagonalTopLeftToBottomRight, diff, divideCubic, drawArc, drawArcPath$1 as drawArcPath, drawAreaSegments, drawBackgroundImage, drawImageWithLayout, drawIncrementalAreaSegments, drawIncrementalSegments, drawSegments, enumCommandMap, fillVisible, findBestMorphingRotation, findConfigIndexByCursorIdx, findCursorIdxByConfigIndex, findNextGraphic, flatten_simplify, foreach, foreachAsync, fuzzyEqualNumber, genBasisSegments, genBasisTypeSegments, genLinearClosedSegments, genLinearClosedTypeSegments, genLinearSegments, genLinearTypeSegments, genMonotoneXSegments, genMonotoneXTypeSegments, genMonotoneYSegments, genMonotoneYTypeSegments, genNumberType, genStepClosedSegments, genStepSegments, genStepTypeSegments, generatorPathEasingFunc, getAttributeFromDefaultAttrList, getAxisBreakSymbolAttrs, getBackgroundImage, getCircleLabelPosition, getCirclePoints, getCircleVerticalVector, getConicGradientAt, getCurrentEnv, getDefaultCharacterConfig, getElMap, getExtraModelMatrix, getHorizontalPath, getLegacyBindingContext, getMarksByName, getModelMatrix, getNoneGroupMarksByName, getPolarAngleLabelPosition, getPolygonPath, getRichTextBounds, getRuntimeInstallerBindingContext, getRuntimeInstallerGlobal, getScaledStroke, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextBounds, getTextType, getTheme, getThemeFromGroup, getVerticalCoord, getVerticalPath, globalTheme, glyphModule, graphicCreator$1 as graphicCreator, graphicService, graphicUtil, hasOverlap, htmlAttributeTransform, identityMat4, imageModule, incrementalAddTo, initAllEnv, initBrowserEnv, initFeishuEnv, initHarmonyEnv, initLynxEnv, initNodeEnv, initTTEnv, initTaroEnv, initTextMeasure, initWxEnv, installBrowserEnvToApp, installBrowserPickersToApp, installDefaultGraphicsToApp, installNodeEnvToApp, installNodePickersToApp, installPoptipToApp, installRuntimeDrawContributionsToApp, installRuntimeGraphicRenderersToApp, installRuntimePickersToApp, installScrollbarToApp, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, interpolatePureColorArrayToStr, intersect, isBrowserEnv, isInRange, isNoRepeatSizingMode, isNodeEnv, isPostiveXAxis, isRichText, isSvg, isVisible, isXML, jsx, labelSmartInvert, layerService, length, limitShapeInBounds, lineModule, linearDiscreteTicks, loadAllEnv, loadAllModule, loadBrowserEnv, loadFeishuEnv, loadHarmonyEnv, loadLynxEnv, loadMathPicker, loadNodeEnv, loadPoptip, loadScrollbar, loadTTEnv, loadTaroEnv, loadWxEnv, lookAt, mapToCanvasPointForCanvas, mat3Tomat4, mat4Allocate, matrixAllocate, measureTextSize, morphPath, multiToOneMorph, multiplyMat4Mat3, multiplyMat4Mat4, newThemeObj, normalize$1 as normalize, oneToMultiMorph, ortho, parsePadding, parseStroke, parseSvgPath, particleEffect, pathModule, pathToBezierCurves, point$3 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polarAngleAxisDiscreteTicks, polarTicks, polygonModule, preLoadAllModule, pulseWave, pyramid3dModule, quadCalc, quadLength, quadPointAt, rafBasedSto, randomOpacity, reactAttributeTransform, rect3dModule, rectFillVisible, rectModule, rectStrokeVisible, recursiveCallBinarySplit, refreshRuntimeInstallerContributions, registerAnimate, registerArc, registerArc3d, registerArc3dGraphic, registerArcDataLabel, registerArcGraphic, registerArea, registerAreaGraphic, registerCircle, registerCircleGraphic, registerCustomAnimate, registerDirectionalLight, registerFlexLayoutPlugin, registerGifGraphic, registerGifImage, registerGlobalEventTransformer, registerGlyph, registerGlyphGraphic, registerGraphic, registerGroup, registerGroupGraphic, registerHtmlAttributePlugin, registerImage, registerImageGraphic, registerLine, registerLineDataLabel, registerLineGraphic, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, registerOrthoCamera, registerPath, registerPathGraphic, registerPolygon, registerPolygonGraphic, registerPyramid3d, registerPyramid3dGraphic, registerReactAttributePlugin, registerRect, registerRect3d, registerRect3dGraphic, registerRectDataLabel, registerRectGraphic, registerRichtext, registerRichtextGraphic, registerShadowRoot, registerShadowRootGraphic, registerStar, registerStarGraphic, registerSymbol, registerSymbolDataLabel, registerSymbolGraphic, registerText, registerTextGraphic, registerViewTransform3dPlugin, registerWindowEventTransformer, registerWrapText, registerWrapTextGraphic, removeRepeatPoint, renderCommandList, resolveBackgroundDrawMode, resolveBackgroundParamsByImageSizing, resolveBackgroundPosition, resolveBackgroundSizing, resolveContainerBinding$1 as resolveContainerBinding, resolveImageMode, resolveImageRepeatMode, resolveRenderableImageSize, rewriteProto, richTextAttributeTransform, richtextModule, rippleEffect, rotateX, rotateY, rotateZ, rotationScan, roughModule, rowBottomToTop, rowCenterToEdge, rowEdgeToCenter, rowTopToBottom, runFill, runStroke, scale, scaleMat4, segments, setPoptipTheme, shouldClipImageByLayout, shouldUseMat4, smartInvertStrategy, snakeWave, snapLength, spiralEffect, splitArc, splitArea, splitCircle, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, starModule, strCommandMap, strokeVisible, symbolModule, tan2AngleToAngle, textAttributesToStyle, textDrawOffsetX, textDrawOffsetY, textIntersect, textLayoutOffsetY, textModule, ticks, transformMat4, transformPointForCanvas, transformUtil, transitionRegistry, translate, traverseGroup, version, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, xul };
package/dist/index.js CHANGED
@@ -8784,6 +8784,7 @@
8784
8784
  pending.clear(), null == perfMonitor || perfMonitor.recordRefresh("flushedGraphics", graphics.length), graphics.forEach(graphic => {
8785
8785
  if ("released" === graphic.releaseStatus) return;
8786
8786
  if (graphic.stage !== stage) return;
8787
+ if (!graphic.sharedStateDirty) return;
8787
8788
  const refresh = graphic.refreshSharedStateBeforeRender;
8788
8789
  "function" == typeof refresh && (refresh.call(graphic), null == perfMonitor || perfMonitor.incrementCounter("sharedRefreshCommits"));
8789
8790
  }), perfMonitor && (perfMonitor.recordCost("sharedRefresh", performance.now() - start), perfMonitor.recordEvent("shared-refresh-flush", {
@@ -9021,13 +9022,11 @@
9021
9022
  };
9022
9023
  }
9023
9024
  recomputeCurrentStatePatch() {
9024
- var _a, _b, _c, _d;
9025
+ var _a, _b;
9025
9026
  if (!(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length)) return this.effectiveStates = [], this.resolvedStatePatch = void 0, void this.syncSharedStateActiveRegistrations();
9026
- const stateResolveBaseAttrs = null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : this.attribute,
9027
- stateModel = this.createStateModel();
9028
- null === (_c = this.stateEngine) || void 0 === _c || _c.setResolveContext(this, stateResolveBaseAttrs);
9029
- const transition = stateModel.useStates(this.currentStates),
9030
- effectiveStates = null !== (_d = transition.effectiveStates) && void 0 !== _d ? _d : transition.states,
9027
+ const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(),
9028
+ transition = this.createStateModel(stateResolveBaseAttrs).useStates(this.currentStates),
9029
+ effectiveStates = null !== (_b = transition.effectiveStates) && void 0 !== _b ? _b : transition.states,
9031
9030
  resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : this.getStateStyleResolver(this.stateMergeMode).resolve(stateResolveBaseAttrs, this.states, this.stateProxy, transition.states, this.stateSort);
9032
9031
  this.currentStates = transition.states, this.effectiveStates = [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.syncSharedStateActiveRegistrations();
9033
9032
  }
@@ -9620,7 +9619,15 @@
9620
9619
  var _a;
9621
9620
  return null === (_a = this.states) || void 0 === _a ? void 0 : _a[stateName];
9622
9621
  }
9623
- createStateModel() {
9622
+ getStateResolveBaseAttrs() {
9623
+ var _a;
9624
+ return null !== (_a = this.baseAttributes) && void 0 !== _a ? _a : this.attribute;
9625
+ }
9626
+ syncStateResolveContext(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
9627
+ var _a;
9628
+ return null === (_a = this.stateEngine) || void 0 === _a || _a.setResolveContext(this, stateResolveBaseAttrs), stateResolveBaseAttrs;
9629
+ }
9630
+ createStateModel(stateResolveBaseAttrs = this.getStateResolveBaseAttrs()) {
9624
9631
  const {
9625
9632
  compiledDefinitions: compiledDefinitions,
9626
9633
  stateProxyEligibility: stateProxyEligibility,
@@ -9633,7 +9640,7 @@
9633
9640
  stateProxyEligibility: stateProxyEligibility,
9634
9641
  states: this.states,
9635
9642
  mergeMode: this.stateMergeMode
9636
- }), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateProxy = this.stateProxy, this.stateEngineStateSort = this.stateSort, this.stateEngineMergeMode = this.stateMergeMode, this.stateEngineStateProxyModeKey = stateProxyModeKey) : (this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0), new StateModel({
9643
+ }), this.stateEngineCompiledDefinitions = compiledDefinitions, this.stateEngineStateProxy = this.stateProxy, this.stateEngineStateSort = this.stateSort, this.stateEngineMergeMode = this.stateMergeMode, this.stateEngineStateProxyModeKey = stateProxyModeKey) : (this.stateEngine = void 0, this.stateEngineCompiledDefinitions = void 0, this.stateEngineStateProxyModeKey = void 0), this.syncStateResolveContext(stateResolveBaseAttrs), new StateModel({
9637
9644
  states: this.states,
9638
9645
  currentStates: this.currentStates,
9639
9646
  stateSort: this.stateSort,
@@ -9702,6 +9709,70 @@
9702
9709
  resolvedStateAttrs: resolvedStateAttrs
9703
9710
  };
9704
9711
  }
9712
+ resolveGraphicStateTransition(states, previousStates, forceResolverRefresh = !1) {
9713
+ var _a, _b;
9714
+ let transition = this.resolveSimpleLocalStateTransition(states, previousStates);
9715
+ const isSimpleLocalTransition = !!transition;
9716
+ let resolvedStateAttrs;
9717
+ if (transition) resolvedStateAttrs = transition.resolvedStateAttrs;else {
9718
+ const stateResolveBaseAttrs = this.getStateResolveBaseAttrs(),
9719
+ stateModel = this.createStateModel(stateResolveBaseAttrs);
9720
+ forceResolverRefresh && (null === (_a = this.stateEngine) || void 0 === _a || _a.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);
9721
+ }
9722
+ return {
9723
+ transition: transition,
9724
+ effectiveStates: null !== (_b = transition.effectiveStates) && void 0 !== _b ? _b : transition.states,
9725
+ resolvedStateAttrs: resolvedStateAttrs,
9726
+ isSimpleLocalTransition: isSimpleLocalTransition
9727
+ };
9728
+ }
9729
+ normalizeSetStatesOptions(options) {
9730
+ return options && "object" == typeof options ? {
9731
+ hasAnimation: options.animate,
9732
+ animateSameStatePatchChange: !0 === options.animateSameStatePatchChange,
9733
+ shouldRefreshSameStatePatch: !0
9734
+ } : {
9735
+ hasAnimation: "boolean" == typeof options ? options : void 0,
9736
+ animateSameStatePatchChange: !1,
9737
+ shouldRefreshSameStatePatch: !1
9738
+ };
9739
+ }
9740
+ sameStatePatches(left, right) {
9741
+ const leftRecord = null != left ? left : {},
9742
+ rightRecord = null != right ? right : {},
9743
+ keys = new Set([...Object.keys(leftRecord), ...Object.keys(rightRecord)]);
9744
+ for (const key of keys) {
9745
+ if (Object.prototype.hasOwnProperty.call(leftRecord, key) !== Object.prototype.hasOwnProperty.call(rightRecord, key)) return !1;
9746
+ if (!areAttributeValuesEqual(leftRecord[key], rightRecord[key])) return !1;
9747
+ }
9748
+ return !0;
9749
+ }
9750
+ commitSameStatePatchRefresh(states, hasAnimation, animateSameStatePatchChange = !1) {
9751
+ var _a;
9752
+ const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES,
9753
+ previousResolvedStatePatch = this.resolvedStatePatch,
9754
+ {
9755
+ transition: transition,
9756
+ effectiveStates: effectiveStates,
9757
+ resolvedStateAttrs: resolvedStateAttrs,
9758
+ isSimpleLocalTransition: isSimpleLocalTransition
9759
+ } = this.resolveGraphicStateTransition(states, previousStates, !0),
9760
+ patchChanged = !this.sameStatePatches(previousResolvedStatePatch, resolvedStateAttrs);
9761
+ 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)) {
9762
+ if (this.stage) {
9763
+ const perfMonitor = getActiveStageStatePerfMonitor(this.stage);
9764
+ null == perfMonitor || perfMonitor.incrementCounter("stateCommits"), null == perfMonitor || perfMonitor.recordEvent("state-commit", {
9765
+ graphicId: this._uid,
9766
+ targetStates: [...transition.states]
9767
+ });
9768
+ }
9769
+ hasAnimation && animateSameStatePatchChange ? (this._syncFinalAttributeFromStaticTruth(), this.applyStateAttrs(resolvedStateAttrs, transition.states, hasAnimation, !1, void 0, this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch))) : (this.stopStateAnimates(), this.attributeMayContainTransientAttrs ? this._restoreAttributeFromStaticTruth({
9770
+ type: exports.AttributeUpdateType.STATE
9771
+ }) : this.restoreAttributeFromStatePatchDelta(previousResolvedStatePatch, this.resolvedStatePatch, {
9772
+ type: exports.AttributeUpdateType.STATE
9773
+ }), this.emitStateUpdateEvent());
9774
+ }
9775
+ }
9705
9776
  resolveStateAnimateConfig(animateConfig) {
9706
9777
  var _a, _b, _c;
9707
9778
  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;
@@ -9777,34 +9848,35 @@
9777
9848
  const transition = this.createStateModel().addState(stateName, keepCurrentStates);
9778
9849
  transition.changed && this.useStates(transition.states, hasAnimation);
9779
9850
  }
9780
- setStates(states, hasAnimation) {
9851
+ setStates(states, options) {
9781
9852
  var _a, _b, _c;
9782
- const nextStates = (null == states ? void 0 : states.length) ? states : EMPTY_STATE_NAMES,
9853
+ const {
9854
+ hasAnimation: hasAnimation,
9855
+ animateSameStatePatchChange: animateSameStatePatchChange,
9856
+ shouldRefreshSameStatePatch: shouldRefreshSameStatePatch
9857
+ } = this.normalizeSetStatesOptions(options),
9858
+ nextStates = (null == states ? void 0 : states.length) ? states : EMPTY_STATE_NAMES,
9783
9859
  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));
9784
- if (nextStates.length) this.sameStateNames(this.currentStates, nextStates) ? this.sharedStateDirty && this.refreshSharedStateBeforeRender() : this.useStates(nextStates, hasAnimation);else {
9860
+ if (nextStates.length) {
9861
+ if (this.sameStateNames(this.currentStates, nextStates)) return shouldRefreshSameStatePatch ? void this.commitSameStatePatchRefresh(nextStates, hasAnimation, animateSameStatePatchChange) : void (this.sharedStateDirty && this.refreshSharedStateBeforeRender());
9862
+ this.useStates(nextStates, hasAnimation);
9863
+ } else {
9785
9864
  if (!hasCurrentState && !this.sharedStateDirty) return;
9786
9865
  this.clearStates(hasAnimation);
9787
9866
  }
9788
9867
  }
9789
9868
  useStates(states, hasAnimation) {
9790
- var _a, _b, _c, _d;
9869
+ var _a;
9791
9870
  if (!states.length) return void this.clearStates(hasAnimation);
9792
9871
  const previousStates = null !== (_a = this.currentStates) && void 0 !== _a ? _a : EMPTY_STATE_NAMES,
9793
- previousResolvedStatePatch = this.resolvedStatePatch;
9794
- let transition = this.resolveSimpleLocalStateTransition(states, previousStates);
9795
- const isSimpleLocalTransition = !!transition;
9796
- let resolvedStateAttrs;
9797
- if (transition) {
9798
- if (!transition.changed) return;
9799
- resolvedStateAttrs = transition.resolvedStateAttrs;
9800
- } else {
9801
- const stateResolveBaseAttrs = null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : this.attribute,
9802
- stateModel = this.createStateModel();
9803
- if (null === (_c = this.stateEngine) || void 0 === _c || _c.setResolveContext(this, stateResolveBaseAttrs), transition = stateModel.useStates(states), !transition.changed && this.sameStateNames(previousStates, transition.states)) return;
9804
- resolvedStateAttrs = this.stateEngine && this.compiledStateDefinitions ? Object.assign({}, this.stateEngine.resolvedPatch) : this.getStateStyleResolver(this.stateMergeMode).resolve(stateResolveBaseAttrs, this.states, this.stateProxy, transition.states, this.stateSort);
9805
- }
9806
- const effectiveStates = null !== (_d = transition.effectiveStates) && void 0 !== _d ? _d : transition.states;
9807
- if (this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1)) {
9872
+ previousResolvedStatePatch = this.resolvedStatePatch,
9873
+ {
9874
+ transition: transition,
9875
+ effectiveStates: effectiveStates,
9876
+ resolvedStateAttrs: resolvedStateAttrs,
9877
+ isSimpleLocalTransition: isSimpleLocalTransition
9878
+ } = this.resolveGraphicStateTransition(states, previousStates);
9879
+ if ((transition.changed || !this.sameStateNames(previousStates, transition.states)) && this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, !1)) {
9808
9880
  if (this.currentStates = transition.states, this.effectiveStates = isSimpleLocalTransition ? effectiveStates : [...effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), this.stage) {
9809
9881
  const perfMonitor = getActiveStageStatePerfMonitor(this.stage);
9810
9882
  null == perfMonitor || perfMonitor.incrementCounter("stateCommits"), null == perfMonitor || perfMonitor.recordEvent("state-commit", {
@@ -9820,10 +9892,10 @@
9820
9892
  }
9821
9893
  }
9822
9894
  invalidateResolver() {
9823
- var _a, _b, _c;
9895
+ var _a, _b;
9824
9896
  if (!this.stateEngine || !(null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.length) || !this.compiledStateDefinitions) return;
9825
- const stateResolveBaseAttrs = null !== (_b = this.baseAttributes) && void 0 !== _b ? _b : this.attribute;
9826
- this.stateEngine.setResolveContext(this, stateResolveBaseAttrs), this.resolverEpoch = (null !== (_c = this.resolverEpoch) && void 0 !== _c ? _c : 0) + 1, this.stateEngine.invalidateResolverCache();
9897
+ this.syncStateResolveContext();
9898
+ this.resolverEpoch = (null !== (_b = this.resolverEpoch) && void 0 !== _b ? _b : 0) + 1, this.stateEngine.invalidateResolverCache();
9827
9899
  const transition = this.stateEngine.applyStates(this.currentStates),
9828
9900
  resolvedStateAttrs = Object.assign({}, this.stateEngine.resolvedPatch);
9829
9901
  this.effectiveStates = [...transition.effectiveStates], this.resolvedStatePatch = resolvedStateAttrs, this.sharedStateDirty = !1, this.syncSharedStateActiveRegistrations(), this.stopStateAnimates(), this._restoreAttributeFromStaticTruth({
@@ -55238,7 +55310,7 @@
55238
55310
  return resolveLegacyApp().createStage(params);
55239
55311
  }
55240
55312
 
55241
- const version = "1.1.0-alpha.17";
55313
+ const version = "1.1.0-alpha.19";
55242
55314
 
55243
55315
  exports.AComponentAnimate = AComponentAnimate;
55244
55316
  exports.ACustomAnimate = ACustomAnimate;