@visactor/vrender-core 1.1.0-alpha.15 → 1.1.0-alpha.17
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/common/diff.js +2 -1
- package/cjs/common/event-transformer.js +1 -2
- package/cjs/common/rect-utils.js +1 -1
- package/cjs/common/render-area.js +1 -1
- package/cjs/common/render-command-list.js +1 -1
- package/cjs/common/render-curve.js +1 -1
- package/cjs/common/render-utils.js +1 -1
- package/cjs/common/seg-context.js +2 -1
- 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/store.js +1 -1
- package/cjs/common/text.js +1 -1
- package/cjs/common/utils.js +1 -1
- package/cjs/core/camera.js +1 -1
- package/cjs/core/constants.js +1 -1
- package/cjs/core/core-modules.js +1 -1
- package/cjs/core/global-module.js +0 -2
- package/cjs/core/global.js +1 -1
- package/cjs/core/graphic-utils.js +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/layer-service.js +1 -2
- package/cjs/core/layer.js +1 -1
- package/cjs/core/light.js +1 -1
- package/cjs/core/stage.d.ts +4 -1
- package/cjs/core/stage.js +24 -12
- package/cjs/core/stage.js.map +1 -1
- package/cjs/core/window.js +1 -1
- package/cjs/graphic/graphic-service/graphic-service.d.ts +4 -0
- package/cjs/graphic/graphic-service/graphic-service.js +6 -5
- package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
- package/cjs/graphic/graphic.d.ts +41 -8
- package/cjs/graphic/graphic.js +383 -146
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/group.d.ts +5 -1
- package/cjs/graphic/group.js +37 -18
- package/cjs/graphic/group.js.map +1 -1
- package/cjs/graphic/state/shared-state-refresh.js +3 -3
- package/cjs/graphic/state/shared-state-refresh.js.map +1 -1
- package/cjs/graphic/state/shared-state-scope.js +1 -1
- package/cjs/graphic/state/shared-state-scope.js.map +1 -1
- package/cjs/graphic/state/state-engine.js +2 -2
- package/cjs/graphic/state/state-engine.js.map +1 -1
- package/cjs/graphic/state/state-perf-monitor.d.ts +1 -0
- package/cjs/graphic/state/state-perf-monitor.js +9 -2
- package/cjs/graphic/state/state-perf-monitor.js.map +1 -1
- package/cjs/graphic/state/state-style-resolver.d.ts +0 -9
- package/cjs/graphic/state/state-style-resolver.js +0 -23
- package/cjs/graphic/state/state-style-resolver.js.map +1 -1
- package/cjs/interface/graphic.d.ts +2 -0
- package/cjs/interface/graphic.js.map +1 -1
- package/cjs/interface/node-tree.js.map +1 -1
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.d.ts +4 -1
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +20 -10
- package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +3 -2
- package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/cjs/render/contributions/render/base-render.js +8 -7
- package/cjs/render/contributions/render/base-render.js.map +1 -1
- package/dist/index.es.js +806 -263
- package/es/common/diff.js +2 -1
- package/es/common/event-transformer.js +1 -2
- package/es/common/rect-utils.js +1 -1
- package/es/common/render-area.js +1 -1
- package/es/common/render-command-list.js +1 -1
- package/es/common/render-curve.js +1 -1
- package/es/common/render-utils.js +1 -1
- package/es/common/seg-context.js +2 -1
- 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/store.js +1 -1
- package/es/common/text.js +1 -1
- package/es/common/utils.js +1 -1
- package/es/core/camera.js +1 -1
- package/es/core/constants.js +1 -1
- package/es/core/core-modules.js +1 -1
- package/es/core/global-module.js +0 -2
- package/es/core/global.js +1 -1
- package/es/core/graphic-utils.js +1 -1
- package/es/core/index.js +1 -1
- package/es/core/layer-service.js +1 -2
- package/es/core/layer.js +1 -1
- package/es/core/light.js +1 -1
- package/es/core/stage.d.ts +4 -1
- package/es/core/stage.js +22 -11
- package/es/core/stage.js.map +1 -1
- package/es/core/window.js +1 -1
- package/es/graphic/graphic-service/graphic-service.d.ts +4 -0
- package/es/graphic/graphic-service/graphic-service.js +6 -5
- package/es/graphic/graphic-service/graphic-service.js.map +1 -1
- package/es/graphic/graphic.d.ts +41 -8
- package/es/graphic/graphic.js +379 -139
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/group.d.ts +5 -1
- package/es/graphic/group.js +36 -18
- package/es/graphic/group.js.map +1 -1
- package/es/graphic/state/shared-state-refresh.js +4 -4
- package/es/graphic/state/shared-state-refresh.js.map +1 -1
- package/es/graphic/state/shared-state-scope.js +2 -2
- package/es/graphic/state/shared-state-scope.js.map +1 -1
- package/es/graphic/state/state-engine.js +3 -3
- package/es/graphic/state/state-engine.js.map +1 -1
- package/es/graphic/state/state-perf-monitor.d.ts +1 -0
- package/es/graphic/state/state-perf-monitor.js +7 -0
- package/es/graphic/state/state-perf-monitor.js.map +1 -1
- package/es/graphic/state/state-style-resolver.d.ts +0 -9
- package/es/graphic/state/state-style-resolver.js +0 -23
- package/es/graphic/state/state-style-resolver.js.map +1 -1
- package/es/interface/graphic.d.ts +2 -0
- package/es/interface/graphic.js.map +1 -1
- package/es/interface/node-tree.js.map +1 -1
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.d.ts +4 -1
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +20 -10
- package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
- package/es/plugins/builtin-plugin/flex-layout-plugin.js +3 -2
- package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
- package/es/render/contributions/render/base-render.js +8 -6
- package/es/render/contributions/render/base-render.js.map +1 -1
- package/package.json +3 -3
package/cjs/graphic/graphic.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { CustomSymbolClass } from './builtin-symbol';
|
|
|
8
8
|
import type { CompiledStateDefinition, StateDefinition, StateDefinitionsInput } from './state/state-definition';
|
|
9
9
|
import { StateEngine } from './state/state-engine';
|
|
10
10
|
import { StateModel } from './state/state-model';
|
|
11
|
+
import { UpdateCategory } from './state/attribute-update-classifier';
|
|
11
12
|
import { StateStyleResolver, type StateMergeMode } from './state/state-style-resolver';
|
|
12
13
|
import { StateTransitionOrchestrator } from './state/state-transition-orchestrator';
|
|
13
14
|
import { type SharedStateScope } from './state/shared-state-scope';
|
|
@@ -17,7 +18,6 @@ type AttributeDelta = Map<string, {
|
|
|
17
18
|
prev: unknown;
|
|
18
19
|
next: unknown;
|
|
19
20
|
}>;
|
|
20
|
-
export declare function shouldUseSimpleAttributeFastPath(value: unknown): value is Record<string, any>;
|
|
21
21
|
export declare const NOWORK_ANIMATE_ATTR: {
|
|
22
22
|
strokeSeg: number;
|
|
23
23
|
boundsPadding: number;
|
|
@@ -90,7 +90,9 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
90
90
|
protected _updateTag: number;
|
|
91
91
|
stamp?: number;
|
|
92
92
|
attribute: T;
|
|
93
|
-
|
|
93
|
+
protected _baseAttributes?: Partial<T>;
|
|
94
|
+
get baseAttributes(): Partial<T>;
|
|
95
|
+
set baseAttributes(value: Partial<T>);
|
|
94
96
|
shadowRoot?: IShadowRoot;
|
|
95
97
|
releaseStatus?: GraphicReleaseStatus;
|
|
96
98
|
states?: StateDefinitionsInput<T>;
|
|
@@ -126,18 +128,20 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
126
128
|
protected stateStyleResolver?: StateStyleResolver<T>;
|
|
127
129
|
protected deepStateStyleResolver?: StateStyleResolver<T>;
|
|
128
130
|
protected stateTransitionOrchestrator?: StateTransitionOrchestrator<T>;
|
|
129
|
-
protected _deprecatedNormalAttrsView?: Partial<T> | null;
|
|
130
131
|
protected localStateDefinitionsSource?: StateDefinitionsInput<T>;
|
|
131
|
-
protected resolverEpoch
|
|
132
|
+
protected resolverEpoch?: number;
|
|
133
|
+
protected attributeMayContainTransientAttrs?: boolean;
|
|
132
134
|
constructor(params?: T);
|
|
133
135
|
get normalAttrs(): Partial<T> | undefined;
|
|
134
|
-
set normalAttrs(
|
|
136
|
+
set normalAttrs(_value: Partial<T> | undefined);
|
|
137
|
+
protected getBaseAttributesStorage(): Partial<T>;
|
|
135
138
|
getGraphicService(): import("../interface").IGraphicService;
|
|
136
139
|
getAttributes(): T;
|
|
137
140
|
protected getStateStyleResolver(mergeMode?: StateMergeMode): StateStyleResolver<T>;
|
|
138
141
|
protected getStateTransitionOrchestrator(): StateTransitionOrchestrator<T>;
|
|
139
142
|
protected resolveBoundSharedStateScope(): SharedStateScope<T> | SharedStateScope<Record<string, any>> | undefined;
|
|
140
143
|
protected syncSharedStateScopeBindingFromTree(markDirty?: boolean): boolean;
|
|
144
|
+
protected syncSharedStateScopeBindingOnTreeChange(markDirty?: boolean): boolean;
|
|
141
145
|
protected syncSharedStateActiveRegistrations(): void;
|
|
142
146
|
protected clearSharedStateActiveRegistrations(): void;
|
|
143
147
|
protected markSharedStateDirty(): void;
|
|
@@ -155,11 +159,28 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
155
159
|
protected syncObjectToSnapshot(target: Record<string, any>, snapshot: Record<string, any>): AttributeDelta;
|
|
156
160
|
protected _syncAttribute(): AttributeDelta;
|
|
157
161
|
protected _syncFinalAttributeFromStaticTruth(): void;
|
|
162
|
+
protected mergeAttributeDeltaCategory(category: UpdateCategory, key: string, prev: unknown, next: unknown): number;
|
|
163
|
+
protected submitUpdateByCategory(category: UpdateCategory, forceUpdateTag?: boolean): void;
|
|
158
164
|
protected submitUpdateByDelta(delta: AttributeDelta, forceUpdateTag?: boolean): void;
|
|
165
|
+
protected submitTouchedKeyUpdate(keys: string[], forceUpdateTag?: boolean): void;
|
|
166
|
+
protected submitTouchedUpdate(needsShapeAndBounds: boolean): void;
|
|
159
167
|
protected commitBaseAttributeMutation(forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
|
|
168
|
+
protected canCommitBaseAttributesByTouchedKeys(): boolean;
|
|
169
|
+
protected detachAttributeFromBaseAttributes(): void;
|
|
170
|
+
protected commitInternalBaseAttributes(params: Partial<T>, context?: ISetAttributeContext): void;
|
|
171
|
+
protected commitBaseAttributesByTouchedKeys(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
|
|
172
|
+
protected commitBaseAttributeBySingleKey(key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
|
|
160
173
|
protected applyBaseAttributes(params: Partial<T>): void;
|
|
174
|
+
applyAnimationTransientAttributes(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
|
|
161
175
|
protected applyTransientAttributes(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
|
|
162
176
|
protected _restoreAttributeFromStaticTruth(context?: ISetAttributeContext): void;
|
|
177
|
+
protected collectStatePatchDeltaKeys(previousPatch?: Partial<T>, nextPatch?: Partial<T>): string[];
|
|
178
|
+
protected getStaticTruthValueForStateKey(key: string, nextPatch?: Partial<T>): {
|
|
179
|
+
hasValue: boolean;
|
|
180
|
+
value: any;
|
|
181
|
+
};
|
|
182
|
+
protected syncStatePatchDeltaToTarget(target: Record<string, any>, keys: string[], nextPatch?: Partial<T>, collectCategory?: boolean): UpdateCategory;
|
|
183
|
+
protected restoreAttributeFromStatePatchDelta(previousPatch?: Partial<T>, nextPatch?: Partial<T>, context?: ISetAttributeContext): void;
|
|
163
184
|
setMode(mode: '2d' | '3d'): void;
|
|
164
185
|
set3dMode(): void;
|
|
165
186
|
set2dMode(): void;
|
|
@@ -167,6 +188,7 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
167
188
|
onAnimateBind(animate: IAnimate): void;
|
|
168
189
|
protected visitTrackedAnimates(cb: (animate: IAnimate) => void): void;
|
|
169
190
|
protected hasAnyTrackedAnimate(): any;
|
|
191
|
+
protected mayHaveTrackedAnimates(): boolean;
|
|
170
192
|
protected tryUpdateAABBBounds(): IAABBBounds;
|
|
171
193
|
protected tryUpdateOBBBounds(): IOBBBounds;
|
|
172
194
|
protected combindShadowAABBBounds(bounds: IAABBBounds): void;
|
|
@@ -175,7 +197,7 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
175
197
|
protected abstract updateAABBBounds(attribute: T, symbolTheme: Required<T>, aabbBounds: IAABBBounds, full?: boolean): IAABBBounds;
|
|
176
198
|
getClipPath(): ISymbolClass;
|
|
177
199
|
parsePath(symbolType: string): ISymbolClass | CustomSymbolClass;
|
|
178
|
-
protected doUpdateAABBBounds(full?: boolean): IAABBBounds;
|
|
200
|
+
protected doUpdateAABBBounds(full?: boolean, graphicTheme?: Required<T>): IAABBBounds;
|
|
179
201
|
updatePathProxyAABBBounds(aabbBounds: IAABBBounds): boolean;
|
|
180
202
|
protected tryUpdateGlobalAABBBounds(): IAABBBounds;
|
|
181
203
|
protected tryUpdateGlobalTransMatrix(clearTag?: boolean): Matrix;
|
|
@@ -214,9 +236,15 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
214
236
|
hasState(stateName?: string): boolean;
|
|
215
237
|
getState(stateName: string): Partial<T> | StateDefinition<T> | undefined;
|
|
216
238
|
protected createStateModel(): StateModel<T>;
|
|
239
|
+
protected resolveSimpleLocalStateTransition(states: string[], previousStates: readonly string[]): {
|
|
240
|
+
changed: boolean;
|
|
241
|
+
states: string[];
|
|
242
|
+
effectiveStates: string[];
|
|
243
|
+
resolvedStateAttrs: Partial<T>;
|
|
244
|
+
} | null;
|
|
217
245
|
protected resolveStateAnimateConfig(animateConfig?: IAnimateConfig): any;
|
|
218
246
|
applyStateAttrs(attrs: Partial<T>, stateNames: string[], hasAnimation?: boolean, isClear?: boolean, animateConfig?: IAnimateConfig, extraAnimateAttrs?: Partial<T>): void;
|
|
219
|
-
updateNormalAttrs(
|
|
247
|
+
updateNormalAttrs(_stateAttrs: Partial<T>): void;
|
|
220
248
|
protected getStateTransitionDefaultAttribute(key: string, targetAttrs?: Partial<T>): any;
|
|
221
249
|
protected shouldSkipStateTransitionDefaultAttribute(_key: string, _targetAttrs?: Partial<T>): boolean;
|
|
222
250
|
protected stopStateAnimates(type?: 'start' | 'end'): void;
|
|
@@ -225,6 +253,7 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
225
253
|
removeState(stateName: string | string[], hasAnimation?: boolean): void;
|
|
226
254
|
toggleState(stateName: string, hasAnimation?: boolean): void;
|
|
227
255
|
addState(stateName: string, keepCurrentStates?: boolean, hasAnimation?: boolean): void;
|
|
256
|
+
setStates(states?: string[] | null, hasAnimation?: boolean): void;
|
|
228
257
|
useStates(states: string[], hasAnimation?: boolean): void;
|
|
229
258
|
invalidateResolver(): void;
|
|
230
259
|
private sameStateNames;
|
|
@@ -232,6 +261,7 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
232
261
|
addUpdatePaintTag(): void;
|
|
233
262
|
addUpdateShapeTag(): void;
|
|
234
263
|
addUpdateShapeAndBoundsTag(): void;
|
|
264
|
+
protected addBroadUpdateTag(): void;
|
|
235
265
|
protected updateShapeAndBoundsTagSetted(): boolean;
|
|
236
266
|
protected clearUpdateBoundTag(): void;
|
|
237
267
|
protected clearUpdatePaintTag(): void;
|
|
@@ -248,6 +278,7 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
248
278
|
protected doUpdateLocalMatrix(): void;
|
|
249
279
|
protected doUpdateGlobalMatrix(): void;
|
|
250
280
|
setStage(stage?: IStage, layer?: ILayer): void;
|
|
281
|
+
detachStageForRelease(): void;
|
|
251
282
|
setStageToShadowRoot(stage?: IStage, layer?: ILayer): void;
|
|
252
283
|
onAddStep(step: IStep): void;
|
|
253
284
|
onStop(props?: Partial<T>): void;
|
|
@@ -265,8 +296,10 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
|
|
|
265
296
|
private _stopAnimates;
|
|
266
297
|
stopAnimates(stopChildren?: boolean): void;
|
|
267
298
|
release(): void;
|
|
299
|
+
protected hasCustomEvent(type: string): boolean;
|
|
268
300
|
protected _dispatchCustomEvent(type: string, context?: any): any;
|
|
269
|
-
protected beforeStateUpdate(attrs: Partial<T>, prevStates: string[], nextStates: string[], hasAnimation?: boolean, isClear?: boolean): any;
|
|
301
|
+
protected beforeStateUpdate(attrs: Partial<T>, prevStates: readonly string[], nextStates: readonly string[], hasAnimation?: boolean, isClear?: boolean): any;
|
|
302
|
+
protected emitStateUpdateEvent(): void;
|
|
270
303
|
protected _emitCustomEvent(type: string, context?: any): void;
|
|
271
304
|
abstract getNoWorkAnimateAttr(): Record<string, number>;
|
|
272
305
|
abstract clone(): IGraphic<any>;
|