@visactor/vrender-core 1.1.0-alpha.14 → 1.1.0-alpha.15
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/canvas-utils.js +1 -0
- package/cjs/common/diff.js +1 -2
- package/cjs/common/explicit-binding.js +1 -1
- package/cjs/common/generator.js +1 -1
- package/cjs/common/matrix.js +1 -1
- package/cjs/common/morphing-utils.js +1 -1
- package/cjs/common/path-svg.js +1 -1
- package/cjs/common/performance-raf.js +1 -1
- package/cjs/common/polygon.js +2 -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 +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/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 +2 -0
- 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 +2 -1
- package/cjs/core/layer.js +1 -1
- package/cjs/core/light.js +1 -1
- package/cjs/core/stage.js +1 -1
- package/cjs/core/window.js +1 -1
- package/cjs/entries/app-context.js +1 -1
- package/cjs/entries/browser.js +1 -1
- package/cjs/entries/index.js +1 -1
- package/cjs/entries/miniapp.js +1 -1
- package/cjs/entries/node.js +1 -1
- package/cjs/entries/runtime-installer.js +1 -1
- package/cjs/entries/types.js +1 -1
- package/cjs/graphic/graphic.js +4 -4
- package/cjs/graphic/graphic.js.map +1 -1
- package/dist/index.es.js +3 -4
- package/es/common/canvas-utils.js +2 -1
- package/es/common/diff.js +1 -2
- package/es/common/explicit-binding.js +1 -1
- package/es/common/generator.js +1 -1
- package/es/common/matrix.js +1 -1
- package/es/common/morphing-utils.js +1 -1
- package/es/common/path-svg.js +1 -1
- package/es/common/performance-raf.js +1 -1
- package/es/common/polygon.js +1 -1
- 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 +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/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 +2 -0
- 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 +2 -1
- package/es/core/layer.js +1 -1
- package/es/core/light.js +1 -1
- package/es/core/stage.js +1 -1
- package/es/core/window.js +1 -1
- package/es/entries/app-context.js +1 -1
- package/es/entries/browser.js +1 -1
- package/es/entries/index.js +1 -1
- package/es/entries/miniapp.js +1 -1
- package/es/entries/node.js +1 -1
- package/es/entries/runtime-installer.js +1 -1
- package/es/entries/types.js +1 -1
- package/es/graphic/graphic.js +4 -4
- package/es/graphic/graphic.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/graphic/graphic.ts"],"names":[],"mappings":";;;AACA,6CAkB0B;AAW1B,2CAAmC;AAanC,oCAAoD;AACpD,qCAA4C;AAC5C,gDAA6C;AAC7C,2DAAuD;AACvD,sDAA2D;AAC3D,2CAAoF;AACpF,6DAAyD;AACzD,uEAAkE;AAClE,2CAA+C;AAC/C,qDAA6F;AAC7F,uCAAiD;AACjD,2CAAoF;AACpF,8CAA8D;AAC9D,sCAA2C;AAE3C,iFAA4E;AAC5E,uDAAmD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CAAC;KACb;IACD,IAAI,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QACpE,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAY;IACrC,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,KAAK,CAAC;KACd;IACD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,IAAI,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACpC,OAAO,KAAK,CAAC;SACd;QACD,OAAO,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,IAAA,mBAAU,EAAC,OAAO,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAA,iBAAQ,EAAC,OAAO,CAAC,CAAC;KACxG;IACD,OAAO,IAAA,iBAAQ,EAAC,OAAO,CAAC,CAAC;AAC3B,CAAC","file":"graphic.js","sourcesContent":["import type { ICustomPath2D } from './../interface/path';\nimport {\n AABBBounds,\n isArray,\n isEqual,\n max,\n Matrix,\n OBBBounds,\n normalTransform,\n Point,\n type Dict,\n type IAABBBounds,\n type IOBBBounds,\n type IPointLike,\n isNil,\n isString,\n isValidUrl,\n isBase64,\n isObject\n} from '@visactor/vutils';\nimport type {\n GraphicType,\n IAnimateConfig,\n IGraphicAttribute,\n IGraphic,\n IGraphicJson,\n ISetAttributeContext,\n ITransform,\n GraphicReleaseStatus\n} from '../interface/graphic';\nimport { Node } from './node-tree';\nimport type {\n IAnimate,\n IAnimateTarget,\n IGlyphGraphicAttribute,\n IGroup,\n ILayer,\n IPickerService,\n IShadowRoot,\n IStage,\n IStep,\n ISymbolClass\n} from '../interface';\nimport { EventTarget, CustomEvent } from '../event';\nimport { DefaultTransform } from './config';\nimport { application } from '../application';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { ResourceLoader } from '../resource-loader/loader';\nimport { AttributeUpdateType, IContainPointMode, UpdateTag } from '../common/enums';\nimport { BoundsContext } from '../common/bounds-context';\nimport { renderCommandList } from '../common/render-command-list';\nimport { parsePadding } from '../common/utils';\nimport { builtinSymbolsMap, builtInSymbolStrMap, CustomSymbolClass } from './builtin-symbol';\nimport { isSvg, XMLParser } from '../common/xml';\nimport { SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS } from './constants';\nimport { DefaultStateAnimateConfig } from '../animate/config';\nimport { EmptyContext2d } from '../canvas';\nimport type { CompiledStateDefinition, StateDefinition, StateDefinitionsInput } from './state/state-definition';\nimport { StateDefinitionCompiler } from './state/state-definition-compiler';\nimport { StateEngine } from './state/state-engine';\nimport { StateModel } from './state/state-model';\nimport { UpdateCategory, classifyAttributeDelta } from './state/attribute-update-classifier';\nimport { StateStyleResolver, type StateMergeMode } from './state/state-style-resolver';\nimport { StateTransitionOrchestrator } from './state/state-transition-orchestrator';\nimport {\n collectSharedStateScopeChain,\n ensureSharedStateScopeFresh,\n type SharedStateScope\n} from './state/shared-state-scope';\nimport { enqueueGraphicSharedStateRefresh, scheduleStageSharedStateRefresh } from './state/shared-state-refresh';\nimport { getStageStatePerfMonitor } from './state/state-perf-monitor';\n\ndeclare const require: (id: string) => unknown;\n\nconst _tempBounds = new AABBBounds();\ntype TShadowRootModule = {\n createShadowRoot: (graphic?: IGraphic) => IShadowRoot;\n};\nconst loadShadowRootFactory = () => require('./shadow-root') as TShadowRootModule;\n/**\n * pathProxy参考自zrender\n * BSD 3-Clause License\n\n Copyright (c) 2017, Baidu Inc.\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n * Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst tempMatrix = new Matrix();\nexport const PURE_STYLE_KEY = [\n 'stroke',\n 'opacity',\n 'strokeOpacity',\n 'lineDash',\n 'lineDashOffset',\n 'lineCap',\n 'lineJoin',\n 'miterLimit',\n 'fill',\n 'fillOpacity'\n];\n\nexport const GRAPHIC_UPDATE_TAG_KEY = [\n 'lineWidth',\n // 'lineCap',\n // 'lineJoin',\n // 'miterLimit',\n 'scaleX',\n 'scaleY',\n 'angle',\n 'anchor',\n 'visible'\n];\n\nconst tempConstantXYKey = ['x', 'y'];\nconst tempConstantScaleXYKey = ['scaleX', 'scaleY'];\nconst tempConstantAngleKey = ['angle'];\nconst builtinTextureTypes = new Set([\n 'circle',\n 'diamond',\n 'rect',\n 'vertical-line',\n 'horizontal-line',\n 'bias-lr',\n 'bias-rl',\n 'grid',\n 'wave'\n]);\n\nconst point = new Point();\n\ntype AttributeDelta = Map<string, { prev: unknown; next: unknown }>;\n\nfunction isPlainObjectValue(value: unknown): value is Record<string, any> {\n return typeof value === 'object' && value != null && !isArray(value);\n}\n\nfunction cloneAttributeValue<T>(value: T): T {\n if (!isPlainObjectValue(value)) {\n return value;\n }\n\n const source = value as Record<string, any>;\n const clone: Record<string, any> = {};\n Object.keys(source).forEach(key => {\n const nextValue = source[key];\n clone[key] = isPlainObjectValue(nextValue) ? cloneAttributeValue(nextValue) : nextValue;\n });\n return clone as T;\n}\n\nfunction cloneSimpleAttributeRecord<T>(value: T): T {\n if (!isPlainObjectValue(value)) {\n return value;\n }\n\n return { ...(value as Record<string, any>) } as T;\n}\n\nexport function shouldUseSimpleAttributeFastPath(value: unknown): value is Record<string, any> {\n if (!isPlainObjectValue(value)) {\n return false;\n }\n\n return !Object.keys(value).some(key => isPlainObjectValue((value as Record<string, any>)[key]));\n}\n\nfunction cloneAttributeSurface<T>(value: T): T {\n if (!isPlainObjectValue(value)) {\n return value;\n }\n\n const source = value as Record<string, any>;\n const clone: Record<string, any> = {};\n Object.keys(source).forEach(key => {\n const nextValue = source[key];\n clone[key] = isPlainObjectValue(nextValue) ? { ...nextValue } : nextValue;\n });\n return clone as T;\n}\n\nfunction deepMergeAttributeValue(base: Record<string, any>, value: Record<string, any>): Record<string, any> {\n const result: Record<string, any> = cloneAttributeValue(base) ?? {};\n\n Object.keys(value).forEach(key => {\n const nextValue = value[key];\n const previousValue = result[key];\n\n if (isPlainObjectValue(previousValue) && isPlainObjectValue(nextValue)) {\n result[key] = deepMergeAttributeValue(previousValue, nextValue);\n return;\n }\n\n result[key] = cloneAttributeValue(nextValue);\n });\n\n return result;\n}\n\nexport const NOWORK_ANIMATE_ATTR = {\n strokeSeg: 1,\n boundsPadding: 2,\n pickMode: 1,\n boundsMode: 1,\n customPickShape: 1,\n pickable: 1,\n childrenPickable: 1,\n visible: 1,\n zIndex: 1,\n layout: 1,\n keepDirIn3d: 1,\n globalZIndex: 1,\n\n outerBorder: 1,\n innerBorder: 1,\n lineDash: 1,\n lineCap: 1,\n lineJoin: 1,\n miterLimit: 2,\n strokeBoundsBuffer: 2,\n\n scaleCenter: 1,\n anchor: 1,\n anchor3d: 1,\n postMatrix: 1,\n\n backgroundMode: 2,\n background: 1,\n texture: 1,\n cursor: 1,\n html: 1\n};\n\n// function createTrackableObject(obj: any) {\n// // const accessedProperties = new Set(); // 记录被读取的属性\n// // const modifiedProperties = new Set(); // 记录被设置/修改的属性\n\n// const handler = {\n// get(target: any, property: any) {\n// // accessedProperties.add(property); // 记录读取操作\n// return Reflect.get(target, property);\n// },\n// set(target: any, property: any, value: any) {\n// if (property === 'size' && !isFinite(value)) {\n// console.log('set', property, value);\n// }\n// // modifiedProperties.add(property); // 记录设置/修改操作\n// return Reflect.set(target, property, value);\n// }\n// };\n\n// const proxy = new Proxy(obj, handler);\n\n// // 提供方法获取被追踪的属性\n// // proxy.getAccessedProperties = () => [...accessedProperties];\n// // proxy.getModifiedProperties = () => [...modifiedProperties];\n\n// return proxy;\n// }\n\n/**\n * globalTransMatrix更新逻辑\n * 1. group的transform修改,会下发到所有下层group,将所有下层的tag修改\n * 2. 叶子graphic每次获取globalTransMatrix都重新计算\n * 3. 所有节点的transform修改,或者globalTransform修改,都会下发到自己的shadowRoot上\n */\n\nexport abstract class Graphic<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>>\n extends Node\n implements IGraphic<T>, IAnimateTarget\n{\n /**\n * Mixes all enumerable properties and methods from a source object to Element.\n * @param source - The source of properties and methods to mix in.\n */\n static mixin(source: Dict<any>): void {\n // in ES8/ES2017, this would be really easy:\n // Object.defineProperties(Element.prototype, Object.getOwnPropertyDescriptors(source));\n\n // get all the enumerable property keys\n const keys = Object.keys(source);\n\n // loop through properties\n for (let i = 0; i < keys.length; ++i) {\n const propertyName = keys[i];\n\n // Set the property using the property descriptor - this works for accessors and normal value properties\n Object.defineProperty(\n Graphic.prototype,\n propertyName,\n Object.getOwnPropertyDescriptor(source, propertyName) as PropertyDecorator\n );\n }\n }\n\n declare _events?: any;\n\n // 保存语法上下文\n declare context?: Record<string, any>;\n private transientFromAttrsBeforePreventAnimate?: Record<string, any> | null;\n private transientFromAttrsBeforePreventAnimateDiffAttrs?: Record<string, any> | null;\n\n static userSymbolMap: Record<string, ISymbolClass> = {};\n\n declare onBeforeAttributeUpdate?: (\n val: any,\n attributes: Partial<T>,\n key: null | string | string[],\n context?: ISetAttributeContext\n ) => T | undefined;\n declare parent: any;\n\n declare resources?: Map<\n string | HTMLImageElement | HTMLCanvasElement,\n { state: 'init' | 'loading' | 'success' | 'fail'; data?: HTMLImageElement | HTMLCanvasElement }\n >;\n declare backgroundImg?: boolean;\n\n declare type: GraphicType;\n declare prefixed: string;\n declare numberType: number;\n declare isContainer?: boolean;\n declare valid: boolean;\n declare stage?: IStage;\n declare layer?: ILayer;\n declare incremental?: number;\n declare glyphHost?: IGraphic<IGlyphGraphicAttribute>;\n declare _onSetStage?: (g: IGraphic, stage: IStage, layer: ILayer) => void;\n // declare _beforeAttributeUpdate?: (key: string | string, value: any) => void;\n // 标记是否是在3d模式下\n declare in3dMode?: boolean;\n\n // 不考虑transform的宽高,特殊情况下会使用到\n declare widthWithoutTransform?: number;\n declare heightWithoutTransform?: number;\n declare x1WithoutTransform?: number;\n declare y1WithoutTransform?: number;\n\n // aabbBounds,所有图形都需要有,所以初始化即赋值\n protected declare _AABBBounds: IAABBBounds;\n get AABBBounds(): IAABBBounds {\n return this.tryUpdateAABBBounds();\n }\n // 具有旋转的包围盒,部分图元需要,动态初始化\n protected declare _OBBBounds?: IOBBBounds;\n get OBBBounds(): IOBBBounds {\n return this.tryUpdateOBBBounds();\n }\n protected declare _globalAABBBounds: IAABBBounds;\n // 全局包围盒,部分图元需要,动态初始化,建议使用AABBBounds\n get globalAABBBounds(): IAABBBounds {\n return this.tryUpdateGlobalAABBBounds();\n }\n protected declare _transMatrix: Matrix;\n get transMatrix(): Matrix {\n return this.tryUpdateLocalTransMatrix(true);\n }\n protected declare _globalTransMatrix: Matrix;\n get globalTransMatrix(): Matrix {\n return this.tryUpdateGlobalTransMatrix(true);\n }\n protected declare _updateTag: number;\n\n // 上次更新的stamp\n declare stamp?: number;\n\n declare attribute: T;\n declare baseAttributes: Partial<T>;\n\n declare shadowRoot?: IShadowRoot;\n\n declare releaseStatus?: GraphicReleaseStatus;\n\n /** 记录state对应的图形属性 */\n declare states?: StateDefinitionsInput<T>;\n /** 当前state值 */\n declare currentStates?: string[];\n declare effectiveStates?: string[];\n declare resolvedStatePatch?: Partial<T>;\n declare boundSharedStateScope?: SharedStateScope<T>;\n declare boundSharedStateRevision?: number;\n declare sharedStateDirty?: boolean;\n declare registeredActiveScopes?: Set<SharedStateScope<T>>;\n declare localFallbackCompiledDefinitions?: Map<string, CompiledStateDefinition<T>>;\n declare localFallbackVersion?: number;\n /** TODO: state更新对应的动画配置 */\n declare stateAnimateConfig?: IAnimateConfig;\n /** 获取state图形属性的方法 */\n declare stateProxy?: (stateName: string, targetStates?: string[]) => Partial<T>;\n /** 状态样式合并模式,默认浅合并,可选深度合并 */\n declare stateMergeMode?: StateMergeMode;\n declare animates: Map<string | number, IAnimate>;\n\n declare animate?: () => IAnimate;\n\n // declare nextAttrs?: T;\n // declare prevAttrs?: T;\n // declare finalAttrs?: T;\n\n declare pathProxy?: ICustomPath2D;\n // 依附于某个theme,如果该节点不存在parent,那么这个Theme就作为节点的Theme,避免添加到节点前计算属性\n declare attachedThemeGraphic?: IGraphic;\n protected updateAABBBoundsStamp: number;\n protected updateOBBBoundsStamp?: number;\n declare clipPathMap?: Map<string, ISymbolClass>;\n\n // 外部设置,用于选择所使用的textMeasureId\n declare textMeasureId?: string;\n\n // state 排序方法\n protected stateSort?: (stateA: string, stateB: string) => number;\n protected compiledStateDefinitions?: Map<string, CompiledStateDefinition<T>>;\n protected compiledStateDefinitionsCacheKey?: string;\n protected stateEngine?: StateEngine<T>;\n protected stateEngineCompiledDefinitions?: Map<string, CompiledStateDefinition<T>>;\n protected stateEngineStateProxy?: (stateName: string, targetStates?: string[]) => Partial<T>;\n protected stateEngineStateSort?: (stateA: string, stateB: string) => number;\n protected stateEngineMergeMode?: StateMergeMode;\n protected stateEngineStateProxyModeKey?: string;\n protected stateStyleResolver?: StateStyleResolver<T>;\n protected deepStateStyleResolver?: StateStyleResolver<T>;\n protected stateTransitionOrchestrator?: StateTransitionOrchestrator<T>;\n protected _deprecatedNormalAttrsView?: Partial<T> | null;\n protected localStateDefinitionsSource?: StateDefinitionsInput<T>;\n protected resolverEpoch: number = 0;\n\n constructor(params: T = {} as T) {\n super();\n this._AABBBounds = new AABBBounds();\n this._updateTag = UpdateTag.INIT;\n const useSimpleAttributeFastPath = shouldUseSimpleAttributeFastPath(params);\n const initialBaseAttributes = (\n useSimpleAttributeFastPath ? cloneSimpleAttributeRecord(params) : cloneAttributeValue(params)\n ) as Partial<T>;\n this.baseAttributes = initialBaseAttributes;\n this.attribute = (\n useSimpleAttributeFastPath\n ? cloneSimpleAttributeRecord(initialBaseAttributes)\n : cloneAttributeSurface(initialBaseAttributes)\n ) as T;\n this.valid = this.isValid();\n this.updateAABBBoundsStamp = 0;\n if (params.background) {\n this.loadImage((params.background as any).background ?? params.background, true);\n }\n if (isExternalTexture(params.texture)) {\n this.loadImage(params.texture, false);\n }\n if (params.shadowGraphic) {\n this.setShadowGraphic(params.shadowGraphic);\n }\n // this.attribute = createTrackableObject(this.attribute);\n }\n\n get normalAttrs(): Partial<T> | undefined {\n return this.baseAttributes;\n }\n\n set normalAttrs(value: Partial<T> | undefined) {\n this._deprecatedNormalAttrsView = value ?? undefined;\n }\n\n getGraphicService() {\n return this.stage?.graphicService ?? application.graphicService;\n }\n\n getAttributes(): T {\n return this.attribute;\n }\n\n protected getStateStyleResolver(mergeMode?: StateMergeMode): StateStyleResolver<T> {\n if (mergeMode === 'deep') {\n if (!this.deepStateStyleResolver) {\n this.deepStateStyleResolver = new StateStyleResolver<T>({ mergeMode: 'deep' });\n }\n return this.deepStateStyleResolver;\n }\n\n if (!this.stateStyleResolver) {\n this.stateStyleResolver = new StateStyleResolver<T>();\n }\n\n return this.stateStyleResolver;\n }\n\n protected getStateTransitionOrchestrator(): StateTransitionOrchestrator<T> {\n if (!this.stateTransitionOrchestrator) {\n this.stateTransitionOrchestrator = new StateTransitionOrchestrator<T>();\n }\n\n return this.stateTransitionOrchestrator;\n }\n\n protected resolveBoundSharedStateScope(): SharedStateScope<T> | SharedStateScope<Record<string, any>> | undefined {\n let parent = this.parent as IGroup | null;\n\n while (parent) {\n if ((parent as any).sharedStateScope) {\n return (parent as any).sharedStateScope;\n }\n parent = parent.parent as IGroup | null;\n }\n\n return this.stage?.rootSharedStateScope as SharedStateScope<Record<string, any>> | undefined;\n }\n\n protected syncSharedStateScopeBindingFromTree(markDirty: boolean = true): boolean {\n const nextScope = this.resolveBoundSharedStateScope();\n if (this.boundSharedStateScope === nextScope) {\n this.syncSharedStateActiveRegistrations();\n return false;\n }\n\n this.boundSharedStateScope = nextScope as SharedStateScope<T> | undefined;\n this.boundSharedStateRevision = undefined;\n this.localFallbackCompiledDefinitions = undefined;\n this.compiledStateDefinitions = undefined;\n this.compiledStateDefinitionsCacheKey = undefined;\n this.stateEngine = undefined;\n this.stateEngineCompiledDefinitions = undefined;\n this.stateEngineStateProxyModeKey = undefined;\n this.syncSharedStateActiveRegistrations();\n\n if (markDirty && this.currentStates?.length) {\n this.markSharedStateDirty();\n }\n\n return true;\n }\n\n protected syncSharedStateActiveRegistrations(): void {\n const nextScopes =\n this.currentStates?.length && this.boundSharedStateScope\n ? new Set(collectSharedStateScopeChain(this.boundSharedStateScope))\n : new Set<SharedStateScope<T>>();\n const previousScopes = this.registeredActiveScopes ?? new Set<SharedStateScope<T>>();\n\n previousScopes.forEach(scope => {\n if (!nextScopes.has(scope)) {\n scope.subtreeActiveDescendants.delete(this);\n }\n });\n\n nextScopes.forEach(scope => {\n scope.subtreeActiveDescendants.add(this);\n });\n\n this.registeredActiveScopes = nextScopes;\n }\n\n protected clearSharedStateActiveRegistrations(): void {\n const previousScopes = this.registeredActiveScopes;\n if (previousScopes) {\n previousScopes.forEach(scope => {\n scope.subtreeActiveDescendants.delete(this);\n });\n previousScopes.clear();\n }\n this.registeredActiveScopes = undefined;\n }\n\n protected markSharedStateDirty(): void {\n this.sharedStateDirty = true;\n enqueueGraphicSharedStateRefresh(this.stage, this);\n scheduleStageSharedStateRefresh(this.stage);\n }\n\n onParentSharedStateTreeChanged(stage?: IStage, layer?: ILayer): void {\n if (this.stage !== stage || this.layer !== layer) {\n this.setStage(stage, layer);\n return;\n }\n\n this.syncSharedStateScopeBindingFromTree();\n }\n\n refreshSharedStateBeforeRender(): void {\n if (!this.currentStates?.length) {\n this.sharedStateDirty = false;\n return;\n }\n\n this.syncSharedStateScopeBindingFromTree(false);\n if (this.boundSharedStateScope) {\n ensureSharedStateScopeFresh(this.boundSharedStateScope);\n }\n\n this.recomputeCurrentStatePatch();\n this.stopStateAnimates();\n this._restoreAttributeFromStaticTruth({ type: AttributeUpdateType.STATE });\n this._emitCustomEvent('afterStateUpdate', { type: AttributeUpdateType.STATE });\n this.sharedStateDirty = false;\n }\n\n protected getLocalStatesVersion(): number {\n if (this.localStateDefinitionsSource !== this.states) {\n this.localStateDefinitionsSource = this.states;\n this.localFallbackVersion = (this.localFallbackVersion ?? 0) + 1;\n }\n\n return this.localFallbackVersion ?? 0;\n }\n\n protected resolveEffectiveCompiledDefinitions(): {\n compiledDefinitions?: Map<string, CompiledStateDefinition<T>>;\n stateProxyModeKey: string;\n stateProxyEligibility?: (stateName: string) => boolean;\n } {\n this.syncSharedStateScopeBindingFromTree(false);\n const boundScope = this.boundSharedStateScope;\n if (boundScope) {\n ensureSharedStateScopeFresh(boundScope);\n this.boundSharedStateRevision = boundScope.revision;\n }\n\n const hasStates = !!this.states && Object.keys(this.states).length > 0;\n if (!boundScope) {\n if (!hasStates) {\n return {\n compiledDefinitions: undefined,\n stateProxyModeKey: 'none'\n };\n }\n\n const localStatesVersion = this.getLocalStatesVersion();\n const cacheKey = `local:${localStatesVersion}`;\n if (!this.compiledStateDefinitions || this.compiledStateDefinitionsCacheKey !== cacheKey) {\n this.compiledStateDefinitions = new StateDefinitionCompiler<T>().compile(this.states);\n this.compiledStateDefinitionsCacheKey = cacheKey;\n }\n\n return {\n compiledDefinitions: this.compiledStateDefinitions,\n stateProxyModeKey: this.stateProxy ? 'legacy-all' : 'none'\n };\n }\n\n const sharedCompiledDefinitions = boundScope.effectiveCompiledDefinitions as Map<\n string,\n CompiledStateDefinition<T>\n >;\n const sharedStateProxyModeKey = this.stateProxy ? 'shared-missing-only' : 'none';\n const sharedStateProxyEligibility = this.stateProxy\n ? (stateName: string) => !sharedCompiledDefinitions.has(stateName)\n : undefined;\n if (!hasStates) {\n this.localFallbackCompiledDefinitions = undefined;\n return {\n compiledDefinitions: sharedCompiledDefinitions,\n stateProxyModeKey: sharedStateProxyModeKey,\n stateProxyEligibility: sharedStateProxyEligibility\n };\n }\n\n const localStates = this.states as StateDefinitionsInput<T>;\n const missingLocalStateDefinitions = {} as StateDefinitionsInput<T>;\n const missingStateNames: string[] = [];\n Object.keys(localStates).forEach(stateName => {\n if (sharedCompiledDefinitions.has(stateName)) {\n return;\n }\n missingLocalStateDefinitions[stateName] = localStates[stateName];\n missingStateNames.push(stateName);\n });\n\n if (!missingStateNames.length) {\n this.localFallbackCompiledDefinitions = undefined;\n return {\n compiledDefinitions: sharedCompiledDefinitions,\n stateProxyModeKey: sharedStateProxyModeKey,\n stateProxyEligibility: sharedStateProxyEligibility\n };\n }\n\n const localStatesVersion = this.getLocalStatesVersion();\n const stateProxyModeKey = this.stateProxy ? `missing:${missingStateNames.sort().join('|')}` : 'none';\n const cacheKey = `shared:${boundScope.revision}:fallback:${localStatesVersion}:${stateProxyModeKey}`;\n if (!this.localFallbackCompiledDefinitions || this.compiledStateDefinitionsCacheKey !== cacheKey) {\n this.localFallbackCompiledDefinitions = new StateDefinitionCompiler<T>().compile({\n ...(boundScope.effectiveSourceDefinitions as StateDefinitionsInput<T>),\n ...missingLocalStateDefinitions\n });\n this.compiledStateDefinitionsCacheKey = cacheKey;\n }\n\n return {\n compiledDefinitions: this.localFallbackCompiledDefinitions,\n stateProxyModeKey,\n stateProxyEligibility: sharedStateProxyEligibility\n };\n }\n\n protected recomputeCurrentStatePatch(): void {\n if (!this.currentStates?.length) {\n this.effectiveStates = [];\n this.resolvedStatePatch = undefined;\n this.syncSharedStateActiveRegistrations();\n return;\n }\n\n const stateResolveBaseAttrs = (this.baseAttributes ?? this.attribute) as Partial<T>;\n const stateModel = this.createStateModel();\n this.stateEngine?.setResolveContext(this, stateResolveBaseAttrs);\n const transition = stateModel.useStates(this.currentStates);\n const effectiveStates = transition.effectiveStates ?? transition.states;\n const resolvedStateAttrs =\n this.stateEngine && this.compiledStateDefinitions\n ? { ...(this.stateEngine.resolvedPatch as Partial<T>) }\n : this.getStateStyleResolver(this.stateMergeMode).resolve(\n stateResolveBaseAttrs,\n this.states as any,\n this.stateProxy as any,\n transition.states,\n this.stateSort\n );\n\n this.currentStates = transition.states;\n this.effectiveStates = [...effectiveStates];\n this.resolvedStatePatch = { ...resolvedStateAttrs };\n this.syncSharedStateActiveRegistrations();\n }\n\n protected buildStaticAttributeSnapshot(): Partial<T> {\n const snapshot = cloneAttributeValue((this.baseAttributes ?? {}) as Partial<T>) as Partial<T>;\n const resolvedPatch = this.resolvedStatePatch;\n\n if (!resolvedPatch) {\n return snapshot;\n }\n\n Object.keys(resolvedPatch).forEach(key => {\n const nextValue = (resolvedPatch as Record<string, any>)[key];\n const previousValue = (snapshot as Record<string, any>)[key];\n\n if (this.stateMergeMode === 'deep' && isPlainObjectValue(previousValue) && isPlainObjectValue(nextValue)) {\n (snapshot as Record<string, any>)[key] = deepMergeAttributeValue(previousValue, nextValue);\n return;\n }\n\n (snapshot as Record<string, any>)[key] = cloneAttributeValue(nextValue);\n });\n\n return snapshot;\n }\n\n protected buildRemovedStateAnimationAttrs(\n targetStateAttrs: Partial<T>,\n previousResolvedStatePatch?: Partial<T>\n ): Partial<T> {\n const extraAttrs: Record<string, any> = {};\n\n if (!previousResolvedStatePatch) {\n return extraAttrs as Partial<T>;\n }\n\n const snapshot = this.buildStaticAttributeSnapshot() as Record<string, any>;\n const staticTargetAttrs = snapshot as Partial<T>;\n Object.keys(previousResolvedStatePatch).forEach(key => {\n const hasTargetAttr = Object.prototype.hasOwnProperty.call(targetStateAttrs, key);\n if (hasTargetAttr && (targetStateAttrs as Record<string, any>)[key] !== undefined) {\n return;\n }\n\n const assignFallbackAttr = (value: any): void => {\n if (value === undefined && this.shouldSkipStateTransitionDefaultAttribute(key, staticTargetAttrs)) {\n return;\n }\n extraAttrs[key] = value === undefined ? value : cloneAttributeValue(value);\n };\n\n if (hasTargetAttr) {\n assignFallbackAttr(this.getStateTransitionDefaultAttribute(key, staticTargetAttrs));\n return;\n }\n\n if (Object.prototype.hasOwnProperty.call(snapshot, key)) {\n const snapshotValue = snapshot[key];\n assignFallbackAttr(\n snapshotValue === undefined ? this.getStateTransitionDefaultAttribute(key, staticTargetAttrs) : snapshotValue\n );\n return;\n }\n\n assignFallbackAttr(this.getStateTransitionDefaultAttribute(key, staticTargetAttrs));\n });\n\n return extraAttrs as Partial<T>;\n }\n\n protected syncObjectToSnapshot(target: Record<string, any>, snapshot: Record<string, any>): AttributeDelta {\n const delta: AttributeDelta = new Map();\n const keySet = new Set<string>([...Object.keys(target), ...Object.keys(snapshot)]);\n\n keySet.forEach(key => {\n const hasNext = Object.prototype.hasOwnProperty.call(snapshot, key);\n const previousValue = target[key];\n\n if (!hasNext) {\n if (Object.prototype.hasOwnProperty.call(target, key)) {\n delta.set(key, { prev: previousValue, next: undefined });\n delete target[key];\n }\n return;\n }\n\n const nextValue = snapshot[key];\n if (isEqual(previousValue, nextValue)) {\n return;\n }\n\n delta.set(key, { prev: previousValue, next: nextValue });\n target[key] = cloneAttributeValue(nextValue);\n });\n\n return delta;\n }\n\n protected _syncAttribute(): AttributeDelta {\n const snapshot = this.buildStaticAttributeSnapshot() as Record<string, any>;\n const delta = this.syncObjectToSnapshot(this.attribute as Record<string, any>, snapshot);\n this.valid = this.isValid();\n return delta;\n }\n\n protected _syncFinalAttributeFromStaticTruth(): void {\n const target = (this as any).finalAttribute;\n if (!target) {\n return;\n }\n const snapshot = this.buildStaticAttributeSnapshot() as Record<string, any>;\n this.syncObjectToSnapshot(target, snapshot);\n }\n\n protected submitUpdateByDelta(delta: AttributeDelta, forceUpdateTag: boolean = false): void {\n if (forceUpdateTag) {\n this.addUpdateShapeAndBoundsTag();\n this.addUpdatePositionTag();\n this.addUpdateLayoutTag();\n return;\n }\n\n let category = UpdateCategory.NONE;\n\n delta.forEach((entry, key) => {\n let nextCategory = classifyAttributeDelta(key, entry.prev, entry.next);\n if (nextCategory & UpdateCategory.PICK) {\n // Phase 2 keeps PICK invalidation on the existing bounds path instead of adding a dedicated pick tag.\n nextCategory |= UpdateCategory.BOUNDS;\n }\n if (nextCategory === UpdateCategory.PAINT && this.needUpdateTag(key)) {\n nextCategory = UpdateCategory.SHAPE | UpdateCategory.BOUNDS;\n }\n category |= nextCategory;\n });\n\n if (category !== UpdateCategory.NONE) {\n getStageStatePerfMonitor(this.stage)?.recordCategory(category);\n }\n\n if (category & UpdateCategory.SHAPE) {\n this.addUpdateShapeAndBoundsTag();\n } else if (category & UpdateCategory.BOUNDS) {\n this.addUpdateBoundTag();\n }\n\n if (category & UpdateCategory.PAINT) {\n this.addUpdatePaintTag();\n }\n\n if (category & UpdateCategory.TRANSFORM) {\n this.addUpdatePositionTag();\n }\n\n if (category & UpdateCategory.LAYOUT) {\n this.addUpdateLayoutTag();\n }\n }\n\n protected commitBaseAttributeMutation(forceUpdateTag: boolean = false, context?: ISetAttributeContext): void {\n if (this.currentStates?.length) {\n this.resolverEpoch += 1;\n this.stateEngine?.invalidateResolverCache();\n this.recomputeCurrentStatePatch();\n }\n const delta = this._syncAttribute();\n this.submitUpdateByDelta(delta, forceUpdateTag);\n this.onAttributeUpdate(context);\n }\n\n protected applyBaseAttributes(params: Partial<T>) {\n const keys = Object.keys(params);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n (this.baseAttributes as any)[key] = cloneAttributeValue((params as any)[key]);\n }\n }\n\n protected applyTransientAttributes(\n params: Partial<T>,\n forceUpdateTag: boolean = false,\n context?: ISetAttributeContext\n ) {\n const delta: AttributeDelta = new Map();\n const keys = Object.keys(params);\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const previousValue = (this.attribute as Record<string, any>)[key];\n const nextValue = (params as Record<string, any>)[key];\n if (isEqual(previousValue, nextValue)) {\n continue;\n }\n delta.set(key, { prev: previousValue, next: nextValue });\n (this.attribute as Record<string, any>)[key] = cloneAttributeValue(nextValue);\n }\n\n this.valid = this.isValid();\n this.submitUpdateByDelta(delta, forceUpdateTag);\n this.onAttributeUpdate(context);\n }\n\n protected _restoreAttributeFromStaticTruth(context?: ISetAttributeContext): void {\n this._syncFinalAttributeFromStaticTruth();\n const delta = this._syncAttribute();\n this.submitUpdateByDelta(delta);\n this.onAttributeUpdate(context);\n }\n\n setMode(mode: '2d' | '3d') {\n mode === '3d' ? this.set3dMode() : this.set2dMode();\n }\n\n set3dMode() {\n this.in3dMode = true;\n }\n set2dMode() {\n this.in3dMode = false;\n }\n getOffsetXY(attr?: ITransform, includeScroll: boolean = false) {\n const { dx = attr.dx, dy = attr.dy } = this.attribute;\n if (includeScroll && this.parent) {\n // const groupTheme = getTheme(this.parent).group;\n const attribute = this.parent.attribute;\n point.x = dx + (attribute.scrollX ?? 0);\n point.y = dy + (attribute.scrollY ?? 0);\n } else {\n point.x = dx;\n point.y = dy;\n }\n return point;\n }\n\n onAnimateBind(animate: IAnimate) {\n this._emitCustomEvent('animate-bind', animate);\n }\n\n protected visitTrackedAnimates(cb: (animate: IAnimate) => void) {\n const hook = (this as any).forEachTrackedAnimate;\n if (typeof hook === 'function') {\n hook.call(this, cb);\n return;\n }\n this.animates && this.animates.forEach(cb);\n }\n\n protected hasAnyTrackedAnimate() {\n const hook = (this as any).hasTrackedAnimate;\n if (typeof hook === 'function') {\n return hook.call(this);\n }\n const getTrackedAnimates = (this as any).getTrackedAnimates;\n if (typeof getTrackedAnimates === 'function') {\n return getTrackedAnimates.call(this).size > 0;\n }\n return !!this.animates?.size;\n }\n\n protected tryUpdateAABBBounds(): IAABBBounds {\n const full = this.attribute.boundsMode === 'imprecise';\n if (!this.shouldUpdateAABBBounds()) {\n return this._AABBBounds;\n }\n if (!this.valid) {\n this._AABBBounds.clear();\n return this._AABBBounds;\n }\n\n this.getGraphicService().beforeUpdateAABBBounds(this, this.stage, true, this._AABBBounds);\n const bounds = this.doUpdateAABBBounds(full);\n // this.addUpdateLayoutTag();\n this.getGraphicService().afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, true);\n\n // 直接返回空Bounds,但是前面的流程还是要走\n if (this.attribute.boundsMode === 'empty') {\n bounds.clear();\n }\n return bounds;\n }\n\n protected tryUpdateOBBBounds(): IOBBBounds {\n if (!this._OBBBounds) {\n this._OBBBounds = new OBBBounds();\n }\n // 尝试更新AABBBounds\n this.tryUpdateAABBBounds();\n // 如果AABBBounds和OBBBounds不一致,则重新计算OBBBounds\n if (this.updateOBBBoundsStamp === this.updateAABBBoundsStamp) {\n return this._OBBBounds;\n }\n this.updateOBBBoundsStamp = this.updateAABBBoundsStamp;\n if (!this.valid) {\n this._OBBBounds.clear();\n return this._OBBBounds;\n }\n\n const bounds = this.doUpdateOBBBounds();\n return bounds;\n }\n\n protected combindShadowAABBBounds(bounds: IAABBBounds) {\n // 合并shadowRoot的Bounds\n if (this.shadowRoot) {\n const b = this.shadowRoot.AABBBounds.clone();\n bounds.union(b);\n }\n }\n\n abstract getGraphicTheme(): T;\n\n protected doUpdateOBBBounds(): IOBBBounds {\n return this._OBBBounds;\n }\n\n protected abstract updateAABBBounds(\n attribute: T,\n symbolTheme: Required<T>,\n aabbBounds: IAABBBounds,\n full?: boolean\n ): IAABBBounds;\n\n getClipPath() {\n const { clipConfig } = this.attribute;\n if (!clipConfig) {\n return null;\n }\n if (!this.clipPathMap) {\n this.clipPathMap = new Map();\n }\n\n const { shape } = clipConfig;\n let path = this.clipPathMap.get(shape) || null;\n if (!path) {\n // 即使清理,避免内存溢出\n if (this.clipPathMap.size > 10) {\n this.clipPathMap.clear();\n }\n path = this.parsePath(shape);\n path && this.clipPathMap.set(shape, path);\n }\n return path;\n }\n\n parsePath(symbolType: string) {\n if (!symbolType) {\n return null;\n }\n let path = builtinSymbolsMap[symbolType];\n if (path) {\n return path;\n }\n path = Graphic.userSymbolMap[symbolType];\n if (path) {\n return path;\n }\n const _symbolType = builtInSymbolStrMap[symbolType];\n symbolType = _symbolType || symbolType;\n const valid = isSvg(symbolType);\n if (valid === true) {\n const parser = new XMLParser();\n const { svg } = parser.parse(symbolType);\n if (!svg) {\n return null;\n }\n const path = isArray(svg.path) ? svg.path : [svg.path];\n _tempBounds.clear();\n const cacheList: { path: CustomPath2D; attribute: Record<string, any> }[] = [];\n path.forEach((item: any) => {\n const cache = new CustomPath2D().fromString(item.d);\n const attribute: any = {};\n SVG_PARSE_ATTRIBUTE_MAP_KEYS.forEach(k => {\n if (item[k]) {\n (attribute as any)[(SVG_PARSE_ATTRIBUTE_MAP as any)[k]] = item[k];\n }\n });\n // 查找\n cacheList.push({\n path: cache,\n attribute\n });\n _tempBounds.union(cache.bounds);\n });\n const width = _tempBounds.width();\n const height = _tempBounds.height();\n // 规范化到1\n const maxWH = max(width, height);\n const scale = 1 / maxWH;\n cacheList.forEach(cache => cache.path.transform(0, 0, scale, scale));\n\n const _parsedPath = new CustomSymbolClass(symbolType, cacheList, true);\n Graphic.userSymbolMap[symbolType] = _parsedPath;\n return _parsedPath;\n }\n\n const cache = new CustomPath2D().fromString(symbolType);\n const width = cache.bounds.width();\n const height = cache.bounds.height();\n // 规范化到1\n const maxWH = max(width, height);\n const scale = 1 / maxWH;\n cache.transform(0, 0, scale, scale);\n const _parsedPath = new CustomSymbolClass(symbolType, cache);\n Graphic.userSymbolMap[symbolType] = _parsedPath;\n return _parsedPath;\n }\n\n protected doUpdateAABBBounds(full?: boolean): IAABBBounds {\n this.updateAABBBoundsStamp++;\n const graphicTheme = this.getGraphicTheme();\n this._AABBBounds.clear();\n const attribute = this.attribute;\n const bounds = this.updateAABBBounds(attribute, graphicTheme as Required<T>, this._AABBBounds, full) as AABBBounds;\n\n const { boundsPadding = graphicTheme.boundsPadding } = attribute;\n const paddingArray = parsePadding(boundsPadding);\n if (paddingArray) {\n bounds.expand(paddingArray);\n }\n\n this.clearUpdateBoundTag();\n return bounds;\n }\n\n updatePathProxyAABBBounds(aabbBounds: IAABBBounds): boolean {\n const path = typeof this.pathProxy === 'function' ? (this.pathProxy as any)(this.attribute) : this.pathProxy;\n if (!path) {\n return false;\n }\n const boundsContext = new BoundsContext(aabbBounds);\n renderCommandList(path.commandList, boundsContext, 0, 0);\n return true;\n }\n\n protected tryUpdateGlobalAABBBounds(): IAABBBounds {\n const b = this.AABBBounds;\n if (!this._globalAABBBounds) {\n this._globalAABBBounds = b.clone();\n } else {\n this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2);\n }\n if (this._globalAABBBounds.empty()) {\n return this._globalAABBBounds;\n }\n // 使用parent的grloalAABBBounds\n // todo: 考虑是否需要性能优化\n if (this.parent) {\n this._globalAABBBounds.transformWithMatrix((this.parent as IGroup).globalTransMatrix);\n }\n return this._globalAABBBounds;\n }\n\n /**\n * 这里都是叶子节点的UpdateGlobalTransMatrix函数,只要走进来就直接计算\n * @param clearTag\n * @returns\n */\n protected tryUpdateGlobalTransMatrix(clearTag: boolean = true): Matrix {\n if (!this._globalTransMatrix) {\n this._globalTransMatrix = this.parent\n ? (this.parent as IGroup).globalTransMatrix.clone()\n : this.transMatrix.clone();\n } else if (this.parent) {\n const m = (this.parent as IGroup).globalTransMatrix;\n this._globalTransMatrix.setValue(m.a, m.b, m.c, m.d, m.e, m.f);\n }\n if (this.shouldUpdateGlobalMatrix()) {\n this.doUpdateGlobalMatrix();\n }\n return this._globalTransMatrix;\n }\n\n shouldUpdateGlobalMatrix(): boolean {\n return true;\n }\n\n protected tryUpdateLocalTransMatrix(clearTag: boolean = true) {\n if (!this._transMatrix) {\n this._transMatrix = new Matrix();\n }\n if (this.shouldUpdateLocalMatrix()) {\n this.doUpdateLocalMatrix();\n clearTag && this.clearUpdateLocalPositionTag();\n }\n return this._transMatrix;\n }\n\n shouldUpdateAABBBounds(): boolean {\n // 如果存在shadowRoot,那么判断shadowRoot是否需要更新\n if (this.shadowRoot) {\n return (\n (!!(this._updateTag & UpdateTag.UPDATE_BOUNDS) || this.shadowRoot.shouldUpdateAABBBounds()) &&\n this.getGraphicService().validCheck(\n this.attribute,\n this.getGraphicTheme() as Required<T>,\n this._AABBBounds,\n this\n )\n );\n }\n return (\n !!(this._updateTag & UpdateTag.UPDATE_BOUNDS) &&\n this.getGraphicService().validCheck(this.attribute, this.getGraphicTheme() as Required<T>, this._AABBBounds, this)\n );\n }\n\n // 自身变化导致的AABBBounds的变化\n shouldSelfChangeUpdateAABBBounds(): boolean {\n // 如果存在shadowRoot,那么判断shadowRoot是否需要更新\n if (this.shadowRoot) {\n return !!(this._updateTag & UpdateTag.UPDATE_BOUNDS) || this.shadowRoot.shouldUpdateAABBBounds();\n }\n return !!(this._updateTag & UpdateTag.UPDATE_BOUNDS);\n }\n\n protected shouldUpdateLocalMatrix(): boolean {\n return !!(this._updateTag & UpdateTag.UPDATE_LOCAL_MATRIX);\n }\n\n isValid(): boolean {\n const attribute = this.attribute;\n return Number.isFinite((attribute.x ?? 0) + (attribute.y ?? 0));\n }\n\n protected _validNumber(num?: number) {\n return num == null || Number.isFinite(num);\n }\n\n shouldUpdateShape(): boolean {\n return !!(this._updateTag & UpdateTag.UPDATE_SHAPE);\n }\n clearUpdateShapeTag() {\n this._updateTag &= UpdateTag.CLEAR_SHAPE;\n }\n\n /**\n * 是否包含某个点(点需要是全局坐标系)\n * @param x\n * @param y\n * @param mode\n * @returns\n */\n containsPoint(x: number, y: number, mode: IContainPointMode, picker?: IPickerService): boolean {\n if (!picker) {\n return false;\n }\n if (mode === IContainPointMode.GLOBAL) {\n // 转换x,y更精准\n const point = new Point(x, y);\n if (this.parent) {\n this.parent.globalTransMatrix.transformPoint(point, point);\n }\n x = point.x;\n y = point.y;\n }\n return picker.containsPoint(this, { x, y });\n }\n\n protected setWidthHeightWithoutTransform(aabbBounds: IAABBBounds) {\n this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1;\n this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;\n }\n setAttributesAndPreventAnimate(\n params: Partial<T>,\n forceUpdateTag: boolean = false,\n context?: ISetAttributeContext,\n ignorePriority?: boolean\n ) {\n if (!params) {\n return;\n }\n const keys = Object.keys(params);\n this.captureTransientFromAttrsBeforePreventAnimate(params, keys, context);\n this.visitTrackedAnimates(animate => {\n // 优先级最高的动画(一般是循环动画),不屏蔽\n if (animate.priority === Infinity && !ignorePriority) {\n return;\n }\n animate.preventAttrs(keys);\n });\n this.applyTransientAttributes(params, forceUpdateTag, context);\n }\n\n protected captureTransientFromAttrsBeforePreventAnimate(\n params: Partial<T>,\n keys: string[],\n context?: ISetAttributeContext\n ) {\n const graphicContext = this.context as Record<string, any> | undefined;\n const diffAttrs = graphicContext?.diffAttrs as Record<string, any> | undefined;\n const updateType = context?.type;\n if (\n !keys.length ||\n !graphicContext ||\n !diffAttrs ||\n updateType === AttributeUpdateType.STATE ||\n (updateType != null &&\n updateType >= AttributeUpdateType.ANIMATE_BIND &&\n updateType <= AttributeUpdateType.ANIMATE_END)\n ) {\n return;\n }\n\n const sameDiffAttrs = this.transientFromAttrsBeforePreventAnimateDiffAttrs === diffAttrs;\n let fromAttrs: Record<string, any> | null = sameDiffAttrs\n ? this.transientFromAttrsBeforePreventAnimate ?? null\n : null;\n if (!sameDiffAttrs) {\n this.transientFromAttrsBeforePreventAnimate = null;\n this.transientFromAttrsBeforePreventAnimateDiffAttrs = null;\n }\n let captured = false;\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!Object.prototype.hasOwnProperty.call(diffAttrs, key)) {\n continue;\n }\n\n const previousValue = (this.attribute as Record<string, any>)[key];\n const nextValue = (params as Record<string, any>)[key];\n if (isEqual(previousValue, nextValue)) {\n continue;\n }\n\n fromAttrs ?? (fromAttrs = {});\n fromAttrs[key] = cloneAttributeValue(previousValue);\n captured = true;\n }\n\n if (captured) {\n this.transientFromAttrsBeforePreventAnimate = fromAttrs;\n this.transientFromAttrsBeforePreventAnimateDiffAttrs = diffAttrs;\n }\n }\n\n protected consumeTransientFromAttrsBeforePreventAnimate(diffAttrs: Record<string, any>): Record<string, any> | null {\n const transientFromAttrs = this.transientFromAttrsBeforePreventAnimate;\n const sourceDiffAttrs = this.transientFromAttrsBeforePreventAnimateDiffAttrs;\n if (!transientFromAttrs || !sourceDiffAttrs) {\n return null;\n }\n for (const key in diffAttrs) {\n if (\n Object.prototype.hasOwnProperty.call(diffAttrs, key) &&\n (!Object.prototype.hasOwnProperty.call(sourceDiffAttrs, key) || !isEqual(sourceDiffAttrs[key], diffAttrs[key]))\n ) {\n return null;\n }\n }\n\n let fromAttrs: Record<string, any> | null = null;\n let remaining = false;\n for (const key in transientFromAttrs) {\n if (!Object.prototype.hasOwnProperty.call(transientFromAttrs, key)) {\n continue;\n }\n\n if (Object.prototype.hasOwnProperty.call(diffAttrs, key)) {\n fromAttrs ?? (fromAttrs = {});\n fromAttrs[key] = transientFromAttrs[key];\n continue;\n }\n\n remaining = true;\n }\n\n if (remaining) {\n const nextTransientFromAttrs: Record<string, any> = {};\n for (const key in transientFromAttrs) {\n if (\n Object.prototype.hasOwnProperty.call(transientFromAttrs, key) &&\n !Object.prototype.hasOwnProperty.call(diffAttrs, key)\n ) {\n nextTransientFromAttrs[key] = transientFromAttrs[key];\n }\n }\n this.transientFromAttrsBeforePreventAnimate = nextTransientFromAttrs;\n } else {\n this.transientFromAttrsBeforePreventAnimate = null;\n this.transientFromAttrsBeforePreventAnimateDiffAttrs = null;\n }\n\n return fromAttrs;\n }\n\n setAttributes(params: Partial<T>, forceUpdateTag: boolean = false, context?: ISetAttributeContext) {\n if (!params) {\n return;\n }\n params =\n (this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context)) || params;\n\n if (params.background) {\n this.loadImage(params.background, true);\n }\n if (isExternalTexture(params.texture)) {\n this.loadImage(params.texture, false);\n }\n if (params.shadowGraphic) {\n this.setShadowGraphic(params.shadowGraphic);\n }\n this._setAttributes(params, forceUpdateTag, context);\n }\n\n _setAttributes(params: Partial<T>, forceUpdateTag: boolean = false, context?: ISetAttributeContext) {\n this.applyBaseAttributes(params);\n this.commitBaseAttributeMutation(forceUpdateTag, context);\n }\n\n setAttribute(key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) {\n const params =\n this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({ [key]: value }, this.attribute, key, context);\n if (!params) {\n this.applyBaseAttributes({ [key]: value } as Partial<T>);\n this.commitBaseAttributeMutation(!!forceUpdateTag, context);\n } else {\n this._setAttributes(params, forceUpdateTag, context);\n }\n if (key === 'background') {\n this.loadImage(value, true);\n } else if (key === 'texture' && isExternalTexture(value)) {\n this.loadImage(value, false);\n } else if (key === 'shadowGraphic') {\n this.setShadowGraphic(value);\n }\n }\n\n protected needUpdateTags(keys: string[], k: string[] = GRAPHIC_UPDATE_TAG_KEY): boolean {\n for (let i = 0; i < k.length; i++) {\n const attrKey = k[i];\n if (keys.indexOf(attrKey) !== -1) {\n return true;\n }\n }\n return false;\n }\n\n protected needUpdateTag(key: string, k: string[] = GRAPHIC_UPDATE_TAG_KEY): boolean {\n for (let i = 0; i < k.length; i++) {\n const attrKey = k[i];\n if (key === attrKey) {\n return true;\n }\n }\n return false;\n }\n\n initAttributes(params: T) {\n // this.setAttributes(params, true);\n const context = { type: AttributeUpdateType.INIT };\n params =\n (this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context)) || params;\n this.baseAttributes = cloneAttributeValue(params) as Partial<T>;\n if (!this.attribute) {\n this.attribute = {} as T;\n }\n this.resolvedStatePatch = undefined;\n this._syncAttribute();\n if (params.background) {\n this.loadImage(params.background, true);\n }\n if (isExternalTexture(params.texture)) {\n this.loadImage(params.texture, false);\n }\n if (params.shadowGraphic) {\n this.setShadowGraphic(params.shadowGraphic);\n }\n this._updateTag = UpdateTag.INIT;\n this.valid = this.isValid();\n this.onAttributeUpdate(context);\n }\n\n translate(x: number, y: number) {\n if (x === 0 && y === 0) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.TRANSLATE\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ x, y }, this.attribute, tempConstantXYKey, context);\n if (params) {\n x = params.x;\n y = params.y;\n delete params.x;\n delete params.y;\n this.applyBaseAttributes(params);\n }\n const attribute = this.baseAttributes as T;\n const postMatrix = attribute.postMatrix;\n if (!postMatrix) {\n attribute.x = (attribute.x ?? DefaultTransform.x) + x;\n attribute.y = (attribute.y ?? DefaultTransform.y) + y;\n } else {\n application.transformUtil.fromMatrix(postMatrix, postMatrix).translate(x, y);\n }\n\n this.commitBaseAttributeMutation(false, context);\n return this;\n }\n\n translateTo(x: number, y: number) {\n const attribute = this.baseAttributes as T;\n if (attribute.x === x && attribute.y === y) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.TRANSLATE_TO\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ x, y }, this.attribute, tempConstantXYKey, context);\n if (params) {\n this.applyBaseAttributes(params);\n this.commitBaseAttributeMutation(false, context);\n return this;\n }\n attribute.x = x;\n attribute.y = y;\n this.commitBaseAttributeMutation(false, context);\n return this;\n }\n\n scale(scaleX: number, scaleY: number, scaleCenter?: IPointLike) {\n if (scaleX === 1 && scaleY === 1) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.SCALE\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ scaleX, scaleY, scaleCenter }, this.attribute, tempConstantScaleXYKey, context);\n if (params) {\n scaleX = params.scaleX;\n scaleY = params.scaleY;\n delete params.scaleX;\n delete params.scaleY;\n this.applyBaseAttributes(params);\n }\n const attribute = this.baseAttributes as T;\n if (!scaleCenter) {\n attribute.scaleX = (attribute.scaleX ?? DefaultTransform.scaleX) * scaleX;\n attribute.scaleY = (attribute.scaleY ?? DefaultTransform.scaleY) * scaleY;\n } else {\n let { postMatrix } = this.attribute;\n if (!postMatrix) {\n postMatrix = new Matrix();\n attribute.postMatrix = postMatrix;\n }\n application.transformUtil.fromMatrix(postMatrix, postMatrix).scale(scaleX, scaleY, scaleCenter);\n }\n this.commitBaseAttributeMutation(false, context);\n return this;\n }\n\n scaleTo(scaleX: number, scaleY: number) {\n const attribute = this.baseAttributes as T;\n if (attribute.scaleX === scaleX && attribute.scaleY === scaleY) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.SCALE_TO\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ scaleX, scaleY }, this.attribute, tempConstantScaleXYKey, context);\n if (params) {\n this.applyBaseAttributes(params);\n this.commitBaseAttributeMutation(false, context);\n return this;\n }\n attribute.scaleX = scaleX;\n attribute.scaleY = scaleY;\n this.commitBaseAttributeMutation(false, context);\n return this;\n }\n\n rotate(angle: number, rotateCenter?: IPointLike) {\n if (angle === 0) {\n return this;\n }\n const context = { type: AttributeUpdateType.ROTATE };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ angle, rotateCenter }, this.attribute, tempConstantAngleKey, context);\n if (params) {\n delete params.angle;\n this.applyBaseAttributes(params);\n // return this;\n }\n const attribute = this.baseAttributes as T;\n if (!rotateCenter) {\n attribute.angle = (attribute.angle ?? DefaultTransform.angle) + angle;\n } else {\n let { postMatrix } = this.baseAttributes as T;\n if (!postMatrix) {\n postMatrix = new Matrix();\n (this.baseAttributes as T).postMatrix = postMatrix;\n }\n application.transformUtil.fromMatrix(postMatrix, postMatrix).rotate(angle, rotateCenter);\n }\n this.commitBaseAttributeMutation(false, context);\n return this;\n }\n\n rotateTo(angle: number) {\n const attribute = this.baseAttributes as T;\n if (attribute.angle === angle) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.ROTATE_TO\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate(angle, this.attribute, tempConstantAngleKey, context);\n if (params) {\n this.applyBaseAttributes(params);\n this.commitBaseAttributeMutation(false, context);\n return this;\n }\n attribute.angle = angle;\n this.commitBaseAttributeMutation(false, context);\n return this;\n }\n\n skewTo(b: number, c: number) {\n return this;\n }\n\n onAttributeUpdate(context?: ISetAttributeContext) {\n if (context && context.skipUpdateCallback) {\n return;\n }\n this.getGraphicService().onAttributeUpdate(this);\n this._emitCustomEvent('afterAttributeUpdate', context);\n }\n\n // hasListener(event: string) {\n // const prefix = this.prefixed;\n // var evt = prefix ? prefix + event : event;\n // return this._events[evt];\n // }\n\n update(d?: { bounds: boolean; trans: boolean }) {\n if (d) {\n d.bounds && this.tryUpdateAABBBounds();\n d.trans && this.tryUpdateLocalTransMatrix();\n } else {\n this.tryUpdateAABBBounds();\n this.tryUpdateLocalTransMatrix();\n }\n }\n\n hasState(stateName?: string) {\n if (!this.currentStates || !this.currentStates.length) {\n return false;\n }\n\n if (!isNil(stateName)) {\n return this.currentStates.includes(stateName);\n }\n\n return true;\n }\n getState(stateName: string): Partial<T> | StateDefinition<T> | undefined {\n return this.states?.[stateName];\n }\n\n protected createStateModel() {\n const { compiledDefinitions, stateProxyEligibility, stateProxyModeKey } =\n this.resolveEffectiveCompiledDefinitions();\n this.compiledStateDefinitions = compiledDefinitions;\n\n if (!compiledDefinitions) {\n this.stateEngine = undefined;\n this.stateEngineCompiledDefinitions = undefined;\n this.stateEngineStateProxyModeKey = undefined;\n } else if (\n !this.stateEngine ||\n this.stateEngineCompiledDefinitions !== compiledDefinitions ||\n this.stateEngineStateProxy !== this.stateProxy ||\n this.stateEngineStateSort !== this.stateSort ||\n this.stateEngineMergeMode !== this.stateMergeMode ||\n this.stateEngineStateProxyModeKey !== stateProxyModeKey\n ) {\n this.stateEngine = new StateEngine<T>({\n compiledDefinitions,\n stateSort: this.stateSort,\n stateProxy: this.stateProxy as any,\n stateProxyEligibility,\n states: this.states,\n mergeMode: this.stateMergeMode\n });\n this.stateEngineCompiledDefinitions = compiledDefinitions;\n this.stateEngineStateProxy = this.stateProxy as any;\n this.stateEngineStateSort = this.stateSort;\n this.stateEngineMergeMode = this.stateMergeMode;\n this.stateEngineStateProxyModeKey = stateProxyModeKey;\n }\n\n return new StateModel<T>({\n states: this.states,\n currentStates: this.currentStates,\n stateSort: this.stateSort,\n stateProxy: this.stateProxy as any,\n stateEngine: this.stateEngine\n });\n }\n\n protected resolveStateAnimateConfig(animateConfig?: IAnimateConfig) {\n return animateConfig ?? this.stateAnimateConfig ?? this.context?.stateAnimateConfig ?? DefaultStateAnimateConfig;\n }\n\n applyStateAttrs(\n attrs: Partial<T>,\n stateNames: string[],\n hasAnimation?: boolean,\n isClear?: boolean,\n animateConfig?: IAnimateConfig,\n extraAnimateAttrs?: Partial<T>\n ) {\n const resolvedAnimateConfig = hasAnimation ? this.resolveStateAnimateConfig(animateConfig) : undefined;\n const transitionOptions = resolvedAnimateConfig\n ? {\n animateConfig: resolvedAnimateConfig,\n extraAnimateAttrs: extraAnimateAttrs as Record<string, unknown>,\n shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this) as (\n key: string,\n targetAttrs: Record<string, unknown>\n ) => boolean\n }\n : undefined;\n\n if (isClear) {\n this.getStateTransitionOrchestrator().applyClearTransition(\n this as any,\n attrs,\n hasAnimation,\n stateNames,\n transitionOptions\n );\n return;\n }\n\n const plan = this.getStateTransitionOrchestrator().analyzeTransition({}, attrs, stateNames, hasAnimation, {\n noWorkAnimateAttr: this.getNoWorkAnimateAttr(),\n animateConfig: resolvedAnimateConfig,\n extraAnimateAttrs: extraAnimateAttrs as Record<string, unknown>,\n shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this) as (\n key: string,\n targetAttrs: Record<string, unknown>\n ) => boolean\n });\n\n this.getStateTransitionOrchestrator().applyTransition(this as any, plan, hasAnimation, transitionOptions);\n }\n\n updateNormalAttrs(stateAttrs: Partial<T>) {\n this._deprecatedNormalAttrsView = cloneAttributeValue(this.baseAttributes);\n }\n\n protected getStateTransitionDefaultAttribute(key: string, targetAttrs?: Partial<T>) {\n return this.getDefaultAttribute(key);\n }\n\n protected shouldSkipStateTransitionDefaultAttribute(_key: string, _targetAttrs?: Partial<T>): boolean {\n return false;\n }\n\n protected stopStateAnimates(type: 'start' | 'end' = 'end') {\n const stopAnimationState = (this as any).stopAnimationState;\n if (typeof stopAnimationState === 'function') {\n stopAnimationState.call(this, 'state', type);\n return;\n }\n\n const stateAnimates: IAnimate[] = [];\n this.visitTrackedAnimates(animate => {\n if ((animate as any).stateNames) {\n stateAnimates.push(animate);\n }\n });\n stateAnimates.forEach(animate => animate.stop(type));\n }\n\n private getNormalAttribute(key: string) {\n const value = (this.attribute as any)[key];\n\n if (this.hasAnyTrackedAnimate()) {\n // this.animates.forEach(animate => {\n // if ((animate as any).stateNames) {\n // const endProps = animate.getEndProps();\n // if (has(endProps, key)) {\n // value = endProps[key];\n // }\n // }\n // });\n // console.log(this.finalAttrs);\n return (this as any).finalAttribute?.[key];\n }\n\n return value ?? (this as any).finalAttribute?.[key];\n }\n\n clearStates(hasAnimation?: boolean) {\n const previousStates = this.currentStates ? this.currentStates.slice() : [];\n const previousResolvedStatePatch = this.resolvedStatePatch\n ? cloneAttributeValue(this.resolvedStatePatch)\n : undefined;\n const transition = this.createStateModel().clearStates();\n if (!transition.changed && previousStates.length === 0) {\n this.currentStates = [];\n this.effectiveStates = [];\n this.resolvedStatePatch = undefined;\n this.sharedStateDirty = false;\n this.clearSharedStateActiveRegistrations();\n return;\n }\n const resolvedStateAttrs = cloneAttributeValue((this.baseAttributes ?? {}) as Partial<T>) as Partial<T>;\n\n if (\n transition.changed &&\n !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, true)\n ) {\n return;\n }\n\n this.currentStates = transition.states;\n this.effectiveStates = [];\n this.resolvedStatePatch = undefined;\n this.sharedStateDirty = false;\n this.clearSharedStateActiveRegistrations();\n getStageStatePerfMonitor(this.stage)?.incrementCounter('stateCommits');\n getStageStatePerfMonitor(this.stage)?.recordEvent('state-commit', {\n graphicId: this._uid,\n targetStates: []\n });\n if (hasAnimation) {\n this._syncFinalAttributeFromStaticTruth();\n this.applyStateAttrs(\n resolvedStateAttrs,\n transition.states,\n hasAnimation,\n true,\n undefined,\n this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch)\n );\n } else {\n this.stopStateAnimates();\n this._restoreAttributeFromStaticTruth({ type: AttributeUpdateType.STATE });\n this._emitCustomEvent('afterStateUpdate', { type: AttributeUpdateType.STATE });\n }\n }\n\n removeState(stateName: string | string[], hasAnimation?: boolean) {\n const transition = this.createStateModel().removeState(stateName);\n if (transition.changed) {\n this.useStates(transition.states, hasAnimation);\n }\n }\n\n toggleState(stateName: string, hasAnimation?: boolean) {\n const transition = this.createStateModel().toggleState(stateName);\n if (transition.changed) {\n this.useStates(transition.states, hasAnimation);\n }\n }\n\n addState(stateName: string, keepCurrentStates?: boolean, hasAnimation?: boolean) {\n const transition = this.createStateModel().addState(stateName, keepCurrentStates);\n if (!transition.changed) {\n return;\n }\n this.useStates(transition.states, hasAnimation);\n }\n\n useStates(states: string[], hasAnimation?: boolean) {\n if (!states.length) {\n this.clearStates(hasAnimation);\n return;\n }\n\n const previousStates = this.currentStates ? this.currentStates.slice() : [];\n const previousResolvedStatePatch = this.resolvedStatePatch\n ? cloneAttributeValue(this.resolvedStatePatch)\n : undefined;\n const stateResolveBaseAttrs = (this.baseAttributes ?? this.attribute) as Partial<T>;\n const stateModel = this.createStateModel();\n this.stateEngine?.setResolveContext(this, stateResolveBaseAttrs);\n const transition = stateModel.useStates(states);\n if (!transition.changed && this.sameStateNames(previousStates, transition.states)) {\n return;\n }\n\n const effectiveStates = transition.effectiveStates ?? transition.states;\n const resolvedStateAttrs =\n this.stateEngine && this.compiledStateDefinitions\n ? { ...(this.stateEngine.resolvedPatch as Partial<T>) }\n : this.getStateStyleResolver(this.stateMergeMode).resolve(\n stateResolveBaseAttrs,\n this.states as any,\n this.stateProxy as any,\n transition.states,\n this.stateSort\n );\n\n if (!this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, false)) {\n return;\n }\n\n this.currentStates = transition.states;\n this.effectiveStates = [...effectiveStates];\n this.resolvedStatePatch = { ...resolvedStateAttrs };\n this.sharedStateDirty = false;\n this.syncSharedStateActiveRegistrations();\n getStageStatePerfMonitor(this.stage)?.incrementCounter('stateCommits');\n getStageStatePerfMonitor(this.stage)?.recordEvent('state-commit', {\n graphicId: this._uid,\n targetStates: [...transition.states]\n });\n if (hasAnimation) {\n this._syncFinalAttributeFromStaticTruth();\n this.applyStateAttrs(\n resolvedStateAttrs,\n transition.states,\n hasAnimation,\n false,\n undefined,\n this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch)\n );\n } else {\n this.stopStateAnimates();\n this._restoreAttributeFromStaticTruth({ type: AttributeUpdateType.STATE });\n this._emitCustomEvent('afterStateUpdate', { type: AttributeUpdateType.STATE });\n }\n }\n\n invalidateResolver() {\n if (!this.stateEngine || !this.currentStates?.length || !this.compiledStateDefinitions) {\n return;\n }\n\n const stateResolveBaseAttrs = (this.baseAttributes ?? this.attribute) as Partial<T>;\n this.stateEngine.setResolveContext(this, stateResolveBaseAttrs);\n this.resolverEpoch += 1;\n this.stateEngine.invalidateResolverCache();\n const transition = this.stateEngine.applyStates(this.currentStates);\n const resolvedStateAttrs = { ...(this.stateEngine.resolvedPatch as Partial<T>) };\n this.effectiveStates = [...transition.effectiveStates];\n this.resolvedStatePatch = { ...resolvedStateAttrs };\n this.sharedStateDirty = false;\n this.syncSharedStateActiveRegistrations();\n this.stopStateAnimates();\n this._restoreAttributeFromStaticTruth({ type: AttributeUpdateType.STATE });\n this._emitCustomEvent('afterStateUpdate', { type: AttributeUpdateType.STATE });\n }\n\n private sameStateNames(left?: readonly string[], right?: readonly string[]): boolean {\n const normalizedLeft = left ?? [];\n const normalizedRight = right ?? [];\n if (normalizedLeft.length !== normalizedRight.length) {\n return false;\n }\n\n for (let index = 0; index < normalizedLeft.length; index++) {\n if (normalizedLeft[index] !== normalizedRight[index]) {\n return false;\n }\n }\n\n return true;\n }\n\n addUpdateBoundTag() {\n this._updateTag |= UpdateTag.UPDATE_BOUNDS; // for bounds\n if (this.parent) {\n this.parent.addChildUpdateBoundTag();\n }\n if (this.glyphHost) {\n this.glyphHost.addUpdateBoundTag();\n }\n }\n\n addUpdatePaintTag() {\n this._updateTag |= UpdateTag.UPDATE_PAINT;\n }\n\n addUpdateShapeTag() {\n this._updateTag |= UpdateTag.UPDATE_SHAPE; // for shape\n }\n\n addUpdateShapeAndBoundsTag() {\n this._updateTag |= UpdateTag.UPDATE_SHAPE_AND_BOUNDS; // for shape&bounds\n if (this.parent) {\n this.parent.addChildUpdateBoundTag();\n }\n if (this.glyphHost) {\n this.glyphHost.addUpdateBoundTag();\n }\n }\n\n protected updateShapeAndBoundsTagSetted(): boolean {\n return (this._updateTag & UpdateTag.UPDATE_SHAPE_AND_BOUNDS) === UpdateTag.UPDATE_SHAPE_AND_BOUNDS;\n }\n\n protected clearUpdateBoundTag() {\n this._updateTag &= UpdateTag.CLEAR_BOUNDS;\n }\n\n protected clearUpdatePaintTag() {\n this._updateTag &= UpdateTag.CLEAR_PAINT;\n }\n /**\n * 更新位置tag,包括全局tag和局部tag\n */\n addUpdatePositionTag() {\n // 更新shadowRoot的全局位置\n this.shadowRoot && this.shadowRoot.addUpdateGlobalPositionTag();\n this._updateTag |= UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX;\n }\n /**\n * 更新全局位置tag\n */\n addUpdateGlobalPositionTag() {\n // 更新shadowRoot的全局位置\n this.shadowRoot && this.shadowRoot.addUpdateGlobalPositionTag();\n this._updateTag |= UpdateTag.UPDATE_GLOBAL_MATRIX;\n }\n /**\n * 清除局部位置tag\n */\n protected clearUpdateLocalPositionTag() {\n this._updateTag &= UpdateTag.CLEAR_LOCAL_MATRIX;\n }\n /**\n * 清除全局位置tag\n */\n protected clearUpdateGlobalPositionTag() {\n this._updateTag &= UpdateTag.CLEAR_GLOBAL_MATRIX;\n }\n\n addUpdateLayoutTag() {\n this._updateTag |= UpdateTag.UPDATE_LAYOUT;\n }\n\n protected clearUpdateLayoutTag() {\n this._updateTag &= UpdateTag.CLEAR_LAYOUT;\n }\n\n protected needUpdateLayout(): boolean {\n return !!(this._updateTag & UpdateTag.UPDATE_LAYOUT);\n }\n\n protected getAnchor(anchor: [string | number, string | number], params: { b?: IAABBBounds }, resetScale?: boolean) {\n const _anchor: [number, number] = [0, 0];\n const getBounds = () => {\n if (params.b) {\n return params.b;\n }\n // 拷贝一份,避免计算bounds的过程中计算matrix,然后matrix又修改了bounds\n const graphic = this.clone();\n graphic.attribute.angle = 0;\n graphic.attribute.scaleCenter = null;\n if (resetScale) {\n graphic.attribute.scaleX = 1;\n graphic.attribute.scaleY = 1;\n }\n // @ts-ignore\n // this.setAttributes({ angle: 0, scaleCenter: null });\n params.b = graphic.AABBBounds;\n\n return params.b;\n };\n if (typeof anchor[0] === 'string') {\n const ratio = parseFloat(anchor[0]) / 100;\n const bounds = getBounds();\n _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;\n } else {\n _anchor[0] = anchor[0];\n }\n if (typeof anchor[1] === 'string') {\n const ratio = parseFloat(anchor[1]) / 100;\n const bounds = getBounds();\n _anchor[1] = bounds.y1 + (bounds.y2 - bounds.y1) * ratio;\n } else {\n _anchor[1] = anchor[1];\n }\n\n return _anchor;\n }\n\n /**\n * 更新局部matrix的具体函数\n */\n protected doUpdateLocalMatrix() {\n const {\n x = DefaultTransform.x,\n y = DefaultTransform.y,\n scaleX = DefaultTransform.scaleX,\n scaleY = DefaultTransform.scaleY,\n angle = DefaultTransform.angle,\n scaleCenter,\n anchor,\n postMatrix\n } = this.attribute;\n let _anchor: [number, number] = [0, 0];\n const params = {};\n if (anchor && angle) {\n _anchor = this.getAnchor(anchor, params);\n }\n if (scaleCenter && (scaleX !== 1 || scaleY !== 1)) {\n const m = this._transMatrix;\n m.reset();\n m.translate(_anchor[0], _anchor[1]);\n m.rotate(angle);\n m.translate(-_anchor[0], -_anchor[1]);\n\n m.translate(x, y);\n // m.translate(scaleCenter[0] * scaleX, scaleCenter[1] * scaleY);\n // 计算bounds\n _anchor = this.getAnchor(scaleCenter, params, true);\n application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, { x: _anchor[0], y: _anchor[1] });\n // m.translate(-scaleCenter[0], -scaleCenter[1]);\n } else {\n normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);\n }\n const p = this.getOffsetXY(DefaultTransform);\n this._transMatrix.e += p.x;\n this._transMatrix.f += p.y;\n\n if (postMatrix) {\n const m1 = tempMatrix.setValue(\n postMatrix.a,\n postMatrix.b,\n postMatrix.c,\n postMatrix.d,\n postMatrix.e,\n postMatrix.f\n );\n const m2 = this._transMatrix;\n m1.multiply(m2.a, m2.b, m2.c, m2.d, m2.e, m2.f);\n m2.setValue(m1.a, m1.b, m1.c, m1.d, m1.e, m1.f);\n }\n }\n /**\n * 更新全局matrix的具体函数\n */\n protected doUpdateGlobalMatrix() {\n // 基于parent的matrix修改\n if (this.parent) {\n this._globalTransMatrix.multiply(\n this.transMatrix.a,\n this.transMatrix.b,\n this.transMatrix.c,\n this.transMatrix.d,\n this.transMatrix.e,\n this.transMatrix.f\n );\n const { scrollX = 0, scrollY = 0 } = this.parent.attribute;\n this._globalTransMatrix.translate(scrollX, scrollY);\n }\n }\n\n setStage(stage?: IStage, layer?: ILayer) {\n const graphicService = stage?.graphicService ?? this.stage?.graphicService ?? application.graphicService;\n const previousStage = this.stage;\n if (this.stage !== stage || this.layer !== layer) {\n this.stage = stage;\n this.layer = layer;\n this.syncSharedStateScopeBindingFromTree(!!this.currentStates?.length);\n this.setStageToShadowRoot(stage, layer);\n if (this.hasAnyTrackedAnimate()) {\n const previousTimeline = previousStage?.getTimeline?.();\n const nextTimeline = stage?.getTimeline?.();\n const detachedStageAnimates: IAnimate[] = [];\n this.visitTrackedAnimates(a => {\n const boundToPreviousStage = !!previousTimeline && a.timeline === previousTimeline;\n\n if (!boundToPreviousStage && !a.timeline.isGlobal) {\n return;\n }\n\n if (!nextTimeline) {\n if (previousTimeline && a.timeline === previousTimeline) {\n previousTimeline.removeAnimate(a, false);\n detachedStageAnimates.push(a);\n }\n return;\n }\n\n if (a.timeline !== nextTimeline) {\n if (previousTimeline && a.timeline === previousTimeline) {\n previousTimeline.removeAnimate(a, false);\n }\n a.setTimeline(nextTimeline);\n nextTimeline.addAnimate(a);\n }\n });\n\n if (detachedStageAnimates.length) {\n detachedStageAnimates.forEach(animate => {\n animate.stop();\n const untrackAnimate = (this as any).untrackAnimate;\n if (typeof untrackAnimate === 'function') {\n untrackAnimate.call(this, animate.id);\n } else {\n this.animates?.delete(animate.id);\n }\n });\n this._restoreAttributeFromStaticTruth({ type: AttributeUpdateType.ANIMATE_END });\n }\n }\n this._onSetStage && this._onSetStage(this, stage, layer);\n graphicService?.onSetStage?.(this, stage);\n return;\n }\n\n this.syncSharedStateScopeBindingFromTree(!!this.currentStates?.length);\n }\n\n setStageToShadowRoot(stage?: IStage, layer?: ILayer) {\n if (this.shadowRoot) {\n this.shadowRoot.setStage(stage, layer);\n }\n }\n\n onAddStep(step: IStep) {\n return;\n }\n onStop(props?: Partial<T>): void {\n this._restoreAttributeFromStaticTruth({ type: AttributeUpdateType.ANIMATE_END });\n }\n\n getDefaultAttribute(name: string) {\n return (this.getGraphicTheme() as any)[name];\n }\n\n // 获取属性\n getComputedAttribute(name: string) {\n return (this.attribute as any)[name] ?? this.getDefaultAttribute(name);\n }\n /**\n * 添加onSetStage钩子\n * @param cb 回调函数\n * @param immediate 是否立刻执行,如果在回调添加之前stage就已经绑定,那么如果第二个参数为true就立刻执行回调\n */\n onSetStage(cb: (g: IGraphic, stage: IStage) => void, immediate: boolean = false) {\n this._onSetStage = cb;\n if (immediate && this.stage) {\n cb(this, this.stage);\n }\n }\n\n /******************** shadow graphic *********************/\n attachShadow(shadowRoot?: IShadowRoot) {\n if (shadowRoot) {\n shadowRoot.shadowHost = this;\n }\n\n this.shadowRoot =\n shadowRoot ??\n application.graphicService.creator.shadowRoot?.(this) ??\n (loadShadowRootFactory().createShadowRoot(this) as IShadowRoot);\n this.addUpdateBoundTag();\n this.shadowRoot.setStage(this.stage, this.layer);\n return this.shadowRoot;\n }\n\n detachShadow() {\n if (this.shadowRoot) {\n this.addUpdateBoundTag();\n this.shadowRoot.release(true);\n this.shadowRoot = null;\n }\n }\n\n toJson(): IGraphicJson {\n return {\n attribute: this.attribute,\n _uid: this._uid,\n type: this.type,\n name: this.name,\n children: this.children.map((item: IGraphic) => item.toJson())\n };\n }\n\n createPathProxy(path?: string) {\n if (isString(path, true)) {\n this.pathProxy = new CustomPath2D().fromString(path as string);\n } else {\n this.pathProxy = new CustomPath2D();\n }\n\n return this.pathProxy;\n }\n\n loadImage(image: any, background: boolean = false) {\n if (background && image?.background) {\n image = image.background;\n }\n if (background && (!image || backgroundNotImage(image))) {\n this.backgroundImg = false;\n return;\n }\n if (!image) {\n return;\n }\n const url = image;\n if (!this.resources) {\n this.resources = new Map();\n }\n const cache: {\n state: 'loading' | 'success' | 'init' | 'fail';\n data: any;\n } = {\n data: 'init',\n state: null\n };\n this.resources.set(url, cache);\n if (typeof image === 'string') {\n cache.state = 'loading';\n if (image.startsWith('<svg')) {\n // TODO 封装isSvg到@visactor/vutils\n ResourceLoader.GetSvg(image, this);\n this.backgroundImg = this.backgroundImg || background;\n } else if (isValidUrl(image) || image.includes('/') || isBase64(image)) {\n ResourceLoader.GetImage(image, this);\n this.backgroundImg = this.backgroundImg || background;\n }\n } else if (isObject(image)) {\n (cache.state = 'success'), (cache.data = image);\n this.backgroundImg = this.backgroundImg || background;\n } else {\n cache.state = 'fail';\n }\n }\n\n setShadowGraphic(graphic: IGraphic) {\n if (!graphic) {\n this.detachShadow();\n } else {\n const root = this.attachShadow();\n root.add(graphic);\n }\n }\n\n imageLoadSuccess(url: string, image: HTMLImageElement, cb?: () => void) {\n // 更新属性\n // this.resourceState = 'success';\n // this.resource = image;\n if (!this.resources) {\n return;\n }\n const res = this.resources.get(url);\n if (!res) {\n return;\n }\n res.state = 'success';\n res.data = image;\n\n cb && cb();\n\n // 触发重绘\n // 暂时全量,TODO 启动局部重绘\n // this.stage.enableDirtyBounds();\n // this.stage.dirty(this.AABBBounds);\n this.addUpdateBoundTag(); // 添加bounds更新tag重绘才会绘制这个mark\n this.stage && this.stage.renderNextFrame();\n }\n\n imageLoadFail(url: string, cb?: () => void) {\n if (!this.resources) {\n return;\n }\n const res = this.resources.get(url);\n if (!res) {\n return;\n }\n res.state = 'fail';\n\n cb && cb();\n }\n\n private _stopAnimates() {\n const animates: IAnimate[] = [];\n this.visitTrackedAnimates(animate => {\n animates.push(animate);\n });\n animates.forEach(animate => {\n animate.stop();\n });\n }\n\n stopAnimates(stopChildren: boolean = false) {\n this._stopAnimates();\n\n if (this.shadowRoot) {\n // 停止所有影子节点的动画\n this.shadowRoot.stopAnimates(true);\n }\n if (this.isContainer && stopChildren) {\n this.forEachChildren((c: IGraphic) => {\n c.stopAnimates(stopChildren);\n });\n }\n }\n\n release(): void {\n this.releaseStatus = 'released';\n this.clearSharedStateActiveRegistrations();\n this.stopAnimates();\n const graphicService = this.stage?.graphicService ?? application.graphicService;\n graphicService?.onRelease?.(this);\n super.release();\n }\n\n protected _dispatchCustomEvent(type: string, context?: any) {\n if (this._events && type in this._events) {\n const changeEvent = new CustomEvent(type, context);\n changeEvent.bubbles = false;\n const manager = (this.stage as any)?.eventSystem?.manager;\n\n if (manager) {\n (changeEvent as any).manager = manager;\n return this.dispatchEvent(changeEvent);\n }\n\n return Node.prototype.dispatchEvent.call(this, changeEvent);\n }\n return true;\n }\n\n protected beforeStateUpdate(\n attrs: Partial<T>,\n prevStates: string[],\n nextStates: string[],\n hasAnimation?: boolean,\n isClear?: boolean\n ) {\n return this._dispatchCustomEvent('beforeStateUpdate', {\n type: AttributeUpdateType.STATE,\n attrs: { ...attrs },\n prevStates: prevStates.slice(),\n nextStates: nextStates.slice(),\n hasAnimation: !!hasAnimation,\n isClear: !!isClear\n });\n }\n\n protected _emitCustomEvent(type: string, context?: any) {\n this._dispatchCustomEvent(type, context);\n }\n\n abstract getNoWorkAnimateAttr(): Record<string, number>;\n\n abstract clone(): IGraphic<any>;\n\n toCustomPath(): ICustomPath2D {\n // throw new Error('暂不支持');\n const renderer = (this.stage?.renderService || application.renderService)?.drawContribution?.getRenderContribution(\n this\n );\n if (renderer) {\n const context = new EmptyContext2d(null, 1);\n renderer.drawShape(this, context, 0, 0, {} as any, {});\n return context.path;\n }\n return null;\n }\n}\n\nGraphic.mixin(EventTarget);\n\nfunction backgroundNotImage(image: any) {\n if (typeof image === 'string') {\n return !(image.startsWith('<svg') || isValidUrl(image) || image.includes('/') || isBase64(image));\n }\n if (image.fill || image.stroke) {\n return true;\n }\n if (typeof image.gradient === 'string' && Array.isArray(image.stops)) {\n return true;\n }\n return false;\n}\n\nfunction isExternalTexture(texture: any) {\n if (!texture) {\n return false;\n }\n if (typeof texture === 'string') {\n if (builtinTextureTypes.has(texture)) {\n return false;\n }\n return texture.startsWith('<svg') || isValidUrl(texture) || texture.includes('/') || isBase64(texture);\n }\n return isObject(texture);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/graphic/graphic.ts"],"names":[],"mappings":";;;AACA,6CAkB0B;AAW1B,2CAAmC;AAanC,oCAAoD;AACpD,qCAA4C;AAC5C,gDAA6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AU,EAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAA,iBAAQ,EAAC,KAAK,CAAC,CAAC,CAAC;KACnG;IACD,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,EAAE;QAC9B,OAAO,IAAI,CAAC;KACb;IACD,IAAI,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QACpE,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAY;IACrC,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,KAAK,CAAC;KACd;IACD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,IAAI,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACpC,OAAO,KAAK,CAAC;SACd;QACD,OAAO,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,IAAA,mBAAU,EAAC,OAAO,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAA,iBAAQ,EAAC,OAAO,CAAC,CAAC;KACxG;IACD,OAAO,IAAA,iBAAQ,EAAC,OAAO,CAAC,CAAC;AAC3B,CAAC","file":"graphic.js","sourcesContent":["import type { ICustomPath2D } from './../interface/path';\nimport {\n AABBBounds,\n isArray,\n isEqual,\n max,\n Matrix,\n OBBBounds,\n normalTransform,\n Point,\n type Dict,\n type IAABBBounds,\n type IOBBBounds,\n type IPointLike,\n isNil,\n isString,\n isValidUrl,\n isBase64,\n isObject\n} from '@visactor/vutils';\nimport type {\n GraphicType,\n IAnimateConfig,\n IGraphicAttribute,\n IGraphic,\n IGraphicJson,\n ISetAttributeContext,\n ITransform,\n GraphicReleaseStatus\n} from '../interface/graphic';\nimport { Node } from './node-tree';\nimport type {\n IAnimate,\n IAnimateTarget,\n IGlyphGraphicAttribute,\n IGroup,\n ILayer,\n IPickerService,\n IShadowRoot,\n IStage,\n IStep,\n ISymbolClass\n} from '../interface';\nimport { EventTarget, CustomEvent } from '../event';\nimport { DefaultTransform } from './config';\nimport { application } from '../application';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { ResourceLoader } from '../resource-loader/loader';\nimport { AttributeUpdateType, IContainPointMode, UpdateTag } from '../common/enums';\nimport { BoundsContext } from '../common/bounds-context';\nimport { renderCommandList } from '../common/render-command-list';\nimport { parsePadding } from '../common/utils';\nimport { builtinSymbolsMap, builtInSymbolStrMap, CustomSymbolClass } from './builtin-symbol';\nimport { isSvg, XMLParser } from '../common/xml';\nimport { SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS } from './constants';\nimport { DefaultStateAnimateConfig } from '../animate/config';\nimport { EmptyContext2d } from '../canvas';\nimport type { CompiledStateDefinition, StateDefinition, StateDefinitionsInput } from './state/state-definition';\nimport { StateDefinitionCompiler } from './state/state-definition-compiler';\nimport { StateEngine } from './state/state-engine';\nimport { StateModel } from './state/state-model';\nimport { UpdateCategory, classifyAttributeDelta } from './state/attribute-update-classifier';\nimport { StateStyleResolver, type StateMergeMode } from './state/state-style-resolver';\nimport { StateTransitionOrchestrator } from './state/state-transition-orchestrator';\nimport {\n collectSharedStateScopeChain,\n ensureSharedStateScopeFresh,\n type SharedStateScope\n} from './state/shared-state-scope';\nimport { enqueueGraphicSharedStateRefresh, scheduleStageSharedStateRefresh } from './state/shared-state-refresh';\nimport { getStageStatePerfMonitor } from './state/state-perf-monitor';\n\ndeclare const require: (id: string) => unknown;\n\nconst _tempBounds = new AABBBounds();\ntype TShadowRootModule = {\n createShadowRoot: (graphic?: IGraphic) => IShadowRoot;\n};\nconst loadShadowRootFactory = () => require('./shadow-root') as TShadowRootModule;\n/**\n * pathProxy参考自zrender\n * BSD 3-Clause License\n\n Copyright (c) 2017, Baidu Inc.\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n * Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst tempMatrix = new Matrix();\nexport const PURE_STYLE_KEY = [\n 'stroke',\n 'opacity',\n 'strokeOpacity',\n 'lineDash',\n 'lineDashOffset',\n 'lineCap',\n 'lineJoin',\n 'miterLimit',\n 'fill',\n 'fillOpacity'\n];\n\nexport const GRAPHIC_UPDATE_TAG_KEY = [\n 'lineWidth',\n // 'lineCap',\n // 'lineJoin',\n // 'miterLimit',\n 'scaleX',\n 'scaleY',\n 'angle',\n 'anchor',\n 'visible'\n];\n\nconst tempConstantXYKey = ['x', 'y'];\nconst tempConstantScaleXYKey = ['scaleX', 'scaleY'];\nconst tempConstantAngleKey = ['angle'];\nconst builtinTextureTypes = new Set([\n 'circle',\n 'diamond',\n 'rect',\n 'vertical-line',\n 'horizontal-line',\n 'bias-lr',\n 'bias-rl',\n 'grid',\n 'wave'\n]);\n\nconst point = new Point();\n\ntype AttributeDelta = Map<string, { prev: unknown; next: unknown }>;\n\nfunction isPlainObjectValue(value: unknown): value is Record<string, any> {\n return typeof value === 'object' && value != null && !isArray(value);\n}\n\nfunction cloneAttributeValue<T>(value: T): T {\n if (!isPlainObjectValue(value)) {\n return value;\n }\n\n const source = value as Record<string, any>;\n const clone: Record<string, any> = {};\n Object.keys(source).forEach(key => {\n const nextValue = source[key];\n clone[key] = isPlainObjectValue(nextValue) ? cloneAttributeValue(nextValue) : nextValue;\n });\n return clone as T;\n}\n\nfunction cloneSimpleAttributeRecord<T>(value: T): T {\n if (!isPlainObjectValue(value)) {\n return value;\n }\n\n return { ...(value as Record<string, any>) } as T;\n}\n\nexport function shouldUseSimpleAttributeFastPath(value: unknown): value is Record<string, any> {\n if (!isPlainObjectValue(value)) {\n return false;\n }\n\n return !Object.keys(value).some(key => isPlainObjectValue((value as Record<string, any>)[key]));\n}\n\nfunction cloneAttributeSurface<T>(value: T): T {\n if (!isPlainObjectValue(value)) {\n return value;\n }\n\n const source = value as Record<string, any>;\n const clone: Record<string, any> = {};\n Object.keys(source).forEach(key => {\n const nextValue = source[key];\n clone[key] = isPlainObjectValue(nextValue) ? { ...nextValue } : nextValue;\n });\n return clone as T;\n}\n\nfunction deepMergeAttributeValue(base: Record<string, any>, value: Record<string, any>): Record<string, any> {\n const result: Record<string, any> = cloneAttributeValue(base) ?? {};\n\n Object.keys(value).forEach(key => {\n const nextValue = value[key];\n const previousValue = result[key];\n\n if (isPlainObjectValue(previousValue) && isPlainObjectValue(nextValue)) {\n result[key] = deepMergeAttributeValue(previousValue, nextValue);\n return;\n }\n\n result[key] = cloneAttributeValue(nextValue);\n });\n\n return result;\n}\n\nexport const NOWORK_ANIMATE_ATTR = {\n strokeSeg: 1,\n boundsPadding: 2,\n pickMode: 1,\n boundsMode: 1,\n customPickShape: 1,\n pickable: 1,\n childrenPickable: 1,\n visible: 1,\n zIndex: 1,\n layout: 1,\n keepDirIn3d: 1,\n globalZIndex: 1,\n\n outerBorder: 1,\n innerBorder: 1,\n lineDash: 1,\n lineCap: 1,\n lineJoin: 1,\n miterLimit: 2,\n strokeBoundsBuffer: 2,\n\n scaleCenter: 1,\n anchor: 1,\n anchor3d: 1,\n postMatrix: 1,\n\n backgroundMode: 2,\n background: 1,\n texture: 1,\n cursor: 1,\n html: 1\n};\n\n// function createTrackableObject(obj: any) {\n// // const accessedProperties = new Set(); // 记录被读取的属性\n// // const modifiedProperties = new Set(); // 记录被设置/修改的属性\n\n// const handler = {\n// get(target: any, property: any) {\n// // accessedProperties.add(property); // 记录读取操作\n// return Reflect.get(target, property);\n// },\n// set(target: any, property: any, value: any) {\n// if (property === 'size' && !isFinite(value)) {\n// console.log('set', property, value);\n// }\n// // modifiedProperties.add(property); // 记录设置/修改操作\n// return Reflect.set(target, property, value);\n// }\n// };\n\n// const proxy = new Proxy(obj, handler);\n\n// // 提供方法获取被追踪的属性\n// // proxy.getAccessedProperties = () => [...accessedProperties];\n// // proxy.getModifiedProperties = () => [...modifiedProperties];\n\n// return proxy;\n// }\n\n/**\n * globalTransMatrix更新逻辑\n * 1. group的transform修改,会下发到所有下层group,将所有下层的tag修改\n * 2. 叶子graphic每次获取globalTransMatrix都重新计算\n * 3. 所有节点的transform修改,或者globalTransform修改,都会下发到自己的shadowRoot上\n */\n\nexport abstract class Graphic<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>>\n extends Node\n implements IGraphic<T>, IAnimateTarget\n{\n /**\n * Mixes all enumerable properties and methods from a source object to Element.\n * @param source - The source of properties and methods to mix in.\n */\n static mixin(source: Dict<any>): void {\n // in ES8/ES2017, this would be really easy:\n // Object.defineProperties(Element.prototype, Object.getOwnPropertyDescriptors(source));\n\n // get all the enumerable property keys\n const keys = Object.keys(source);\n\n // loop through properties\n for (let i = 0; i < keys.length; ++i) {\n const propertyName = keys[i];\n\n // Set the property using the property descriptor - this works for accessors and normal value properties\n Object.defineProperty(\n Graphic.prototype,\n propertyName,\n Object.getOwnPropertyDescriptor(source, propertyName) as PropertyDecorator\n );\n }\n }\n\n declare _events?: any;\n\n // 保存语法上下文\n declare context?: Record<string, any>;\n private transientFromAttrsBeforePreventAnimate?: Record<string, any> | null;\n private transientFromAttrsBeforePreventAnimateDiffAttrs?: Record<string, any> | null;\n\n static userSymbolMap: Record<string, ISymbolClass> = {};\n\n declare onBeforeAttributeUpdate?: (\n val: any,\n attributes: Partial<T>,\n key: null | string | string[],\n context?: ISetAttributeContext\n ) => T | undefined;\n declare parent: any;\n\n declare resources?: Map<\n string | HTMLImageElement | HTMLCanvasElement,\n { state: 'init' | 'loading' | 'success' | 'fail'; data?: HTMLImageElement | HTMLCanvasElement }\n >;\n declare backgroundImg?: boolean;\n\n declare type: GraphicType;\n declare prefixed: string;\n declare numberType: number;\n declare isContainer?: boolean;\n declare valid: boolean;\n declare stage?: IStage;\n declare layer?: ILayer;\n declare incremental?: number;\n declare glyphHost?: IGraphic<IGlyphGraphicAttribute>;\n declare _onSetStage?: (g: IGraphic, stage: IStage, layer: ILayer) => void;\n // declare _beforeAttributeUpdate?: (key: string | string, value: any) => void;\n // 标记是否是在3d模式下\n declare in3dMode?: boolean;\n\n // 不考虑transform的宽高,特殊情况下会使用到\n declare widthWithoutTransform?: number;\n declare heightWithoutTransform?: number;\n declare x1WithoutTransform?: number;\n declare y1WithoutTransform?: number;\n\n // aabbBounds,所有图形都需要有,所以初始化即赋值\n protected declare _AABBBounds: IAABBBounds;\n get AABBBounds(): IAABBBounds {\n return this.tryUpdateAABBBounds();\n }\n // 具有旋转的包围盒,部分图元需要,动态初始化\n protected declare _OBBBounds?: IOBBBounds;\n get OBBBounds(): IOBBBounds {\n return this.tryUpdateOBBBounds();\n }\n protected declare _globalAABBBounds: IAABBBounds;\n // 全局包围盒,部分图元需要,动态初始化,建议使用AABBBounds\n get globalAABBBounds(): IAABBBounds {\n return this.tryUpdateGlobalAABBBounds();\n }\n protected declare _transMatrix: Matrix;\n get transMatrix(): Matrix {\n return this.tryUpdateLocalTransMatrix(true);\n }\n protected declare _globalTransMatrix: Matrix;\n get globalTransMatrix(): Matrix {\n return this.tryUpdateGlobalTransMatrix(true);\n }\n protected declare _updateTag: number;\n\n // 上次更新的stamp\n declare stamp?: number;\n\n declare attribute: T;\n declare baseAttributes: Partial<T>;\n\n declare shadowRoot?: IShadowRoot;\n\n declare releaseStatus?: GraphicReleaseStatus;\n\n /** 记录state对应的图形属性 */\n declare states?: StateDefinitionsInput<T>;\n /** 当前state值 */\n declare currentStates?: string[];\n declare effectiveStates?: string[];\n declare resolvedStatePatch?: Partial<T>;\n declare boundSharedStateScope?: SharedStateScope<T>;\n declare boundSharedStateRevision?: number;\n declare sharedStateDirty?: boolean;\n declare registeredActiveScopes?: Set<SharedStateScope<T>>;\n declare localFallbackCompiledDefinitions?: Map<string, CompiledStateDefinition<T>>;\n declare localFallbackVersion?: number;\n /** TODO: state更新对应的动画配置 */\n declare stateAnimateConfig?: IAnimateConfig;\n /** 获取state图形属性的方法 */\n declare stateProxy?: (stateName: string, targetStates?: string[]) => Partial<T>;\n /** 状态样式合并模式,默认浅合并,可选深度合并 */\n declare stateMergeMode?: StateMergeMode;\n declare animates: Map<string | number, IAnimate>;\n\n declare animate?: () => IAnimate;\n\n // declare nextAttrs?: T;\n // declare prevAttrs?: T;\n // declare finalAttrs?: T;\n\n declare pathProxy?: ICustomPath2D;\n // 依附于某个theme,如果该节点不存在parent,那么这个Theme就作为节点的Theme,避免添加到节点前计算属性\n declare attachedThemeGraphic?: IGraphic;\n protected updateAABBBoundsStamp: number;\n protected updateOBBBoundsStamp?: number;\n declare clipPathMap?: Map<string, ISymbolClass>;\n\n // 外部设置,用于选择所使用的textMeasureId\n declare textMeasureId?: string;\n\n // state 排序方法\n protected stateSort?: (stateA: string, stateB: string) => number;\n protected compiledStateDefinitions?: Map<string, CompiledStateDefinition<T>>;\n protected compiledStateDefinitionsCacheKey?: string;\n protected stateEngine?: StateEngine<T>;\n protected stateEngineCompiledDefinitions?: Map<string, CompiledStateDefinition<T>>;\n protected stateEngineStateProxy?: (stateName: string, targetStates?: string[]) => Partial<T>;\n protected stateEngineStateSort?: (stateA: string, stateB: string) => number;\n protected stateEngineMergeMode?: StateMergeMode;\n protected stateEngineStateProxyModeKey?: string;\n protected stateStyleResolver?: StateStyleResolver<T>;\n protected deepStateStyleResolver?: StateStyleResolver<T>;\n protected stateTransitionOrchestrator?: StateTransitionOrchestrator<T>;\n protected _deprecatedNormalAttrsView?: Partial<T> | null;\n protected localStateDefinitionsSource?: StateDefinitionsInput<T>;\n protected resolverEpoch: number = 0;\n\n constructor(params: T = {} as T) {\n super();\n this._AABBBounds = new AABBBounds();\n this._updateTag = UpdateTag.INIT;\n const useSimpleAttributeFastPath = shouldUseSimpleAttributeFastPath(params);\n const initialBaseAttributes = (\n useSimpleAttributeFastPath ? cloneSimpleAttributeRecord(params) : cloneAttributeValue(params)\n ) as Partial<T>;\n this.baseAttributes = initialBaseAttributes;\n this.attribute = (\n useSimpleAttributeFastPath\n ? cloneSimpleAttributeRecord(initialBaseAttributes)\n : cloneAttributeSurface(initialBaseAttributes)\n ) as T;\n this.valid = this.isValid();\n this.updateAABBBoundsStamp = 0;\n if (params.background) {\n this.loadImage((params.background as any).background ?? params.background, true);\n }\n if (isExternalTexture(params.texture)) {\n this.loadImage(params.texture, false);\n }\n if (params.shadowGraphic) {\n this.setShadowGraphic(params.shadowGraphic);\n }\n // this.attribute = createTrackableObject(this.attribute);\n }\n\n get normalAttrs(): Partial<T> | undefined {\n return this.baseAttributes;\n }\n\n set normalAttrs(value: Partial<T> | undefined) {\n this._deprecatedNormalAttrsView = value ?? undefined;\n }\n\n getGraphicService() {\n return this.stage?.graphicService ?? application.graphicService;\n }\n\n getAttributes(): T {\n return this.attribute;\n }\n\n protected getStateStyleResolver(mergeMode?: StateMergeMode): StateStyleResolver<T> {\n if (mergeMode === 'deep') {\n if (!this.deepStateStyleResolver) {\n this.deepStateStyleResolver = new StateStyleResolver<T>({ mergeMode: 'deep' });\n }\n return this.deepStateStyleResolver;\n }\n\n if (!this.stateStyleResolver) {\n this.stateStyleResolver = new StateStyleResolver<T>();\n }\n\n return this.stateStyleResolver;\n }\n\n protected getStateTransitionOrchestrator(): StateTransitionOrchestrator<T> {\n if (!this.stateTransitionOrchestrator) {\n this.stateTransitionOrchestrator = new StateTransitionOrchestrator<T>();\n }\n\n return this.stateTransitionOrchestrator;\n }\n\n protected resolveBoundSharedStateScope(): SharedStateScope<T> | SharedStateScope<Record<string, any>> | undefined {\n let parent = this.parent as IGroup | null;\n\n while (parent) {\n if ((parent as any).sharedStateScope) {\n return (parent as any).sharedStateScope;\n }\n parent = parent.parent as IGroup | null;\n }\n\n return this.stage?.rootSharedStateScope as SharedStateScope<Record<string, any>> | undefined;\n }\n\n protected syncSharedStateScopeBindingFromTree(markDirty: boolean = true): boolean {\n const nextScope = this.resolveBoundSharedStateScope();\n if (this.boundSharedStateScope === nextScope) {\n this.syncSharedStateActiveRegistrations();\n return false;\n }\n\n this.boundSharedStateScope = nextScope as SharedStateScope<T> | undefined;\n this.boundSharedStateRevision = undefined;\n this.localFallbackCompiledDefinitions = undefined;\n this.compiledStateDefinitions = undefined;\n this.compiledStateDefinitionsCacheKey = undefined;\n this.stateEngine = undefined;\n this.stateEngineCompiledDefinitions = undefined;\n this.stateEngineStateProxyModeKey = undefined;\n this.syncSharedStateActiveRegistrations();\n\n if (markDirty && this.currentStates?.length) {\n this.markSharedStateDirty();\n }\n\n return true;\n }\n\n protected syncSharedStateActiveRegistrations(): void {\n const nextScopes =\n this.currentStates?.length && this.boundSharedStateScope\n ? new Set(collectSharedStateScopeChain(this.boundSharedStateScope))\n : new Set<SharedStateScope<T>>();\n const previousScopes = this.registeredActiveScopes ?? new Set<SharedStateScope<T>>();\n\n previousScopes.forEach(scope => {\n if (!nextScopes.has(scope)) {\n scope.subtreeActiveDescendants.delete(this);\n }\n });\n\n nextScopes.forEach(scope => {\n scope.subtreeActiveDescendants.add(this);\n });\n\n this.registeredActiveScopes = nextScopes;\n }\n\n protected clearSharedStateActiveRegistrations(): void {\n const previousScopes = this.registeredActiveScopes;\n if (previousScopes) {\n previousScopes.forEach(scope => {\n scope.subtreeActiveDescendants.delete(this);\n });\n previousScopes.clear();\n }\n this.registeredActiveScopes = undefined;\n }\n\n protected markSharedStateDirty(): void {\n this.sharedStateDirty = true;\n enqueueGraphicSharedStateRefresh(this.stage, this);\n scheduleStageSharedStateRefresh(this.stage);\n }\n\n onParentSharedStateTreeChanged(stage?: IStage, layer?: ILayer): void {\n if (this.stage !== stage || this.layer !== layer) {\n this.setStage(stage, layer);\n return;\n }\n\n this.syncSharedStateScopeBindingFromTree();\n }\n\n refreshSharedStateBeforeRender(): void {\n if (!this.currentStates?.length) {\n this.sharedStateDirty = false;\n return;\n }\n\n this.syncSharedStateScopeBindingFromTree(false);\n if (this.boundSharedStateScope) {\n ensureSharedStateScopeFresh(this.boundSharedStateScope);\n }\n\n this.recomputeCurrentStatePatch();\n this.stopStateAnimates();\n this._restoreAttributeFromStaticTruth({ type: AttributeUpdateType.STATE });\n this._emitCustomEvent('afterStateUpdate', { type: AttributeUpdateType.STATE });\n this.sharedStateDirty = false;\n }\n\n protected getLocalStatesVersion(): number {\n if (this.localStateDefinitionsSource !== this.states) {\n this.localStateDefinitionsSource = this.states;\n this.localFallbackVersion = (this.localFallbackVersion ?? 0) + 1;\n }\n\n return this.localFallbackVersion ?? 0;\n }\n\n protected resolveEffectiveCompiledDefinitions(): {\n compiledDefinitions?: Map<string, CompiledStateDefinition<T>>;\n stateProxyModeKey: string;\n stateProxyEligibility?: (stateName: string) => boolean;\n } {\n this.syncSharedStateScopeBindingFromTree(false);\n const boundScope = this.boundSharedStateScope;\n if (boundScope) {\n ensureSharedStateScopeFresh(boundScope);\n this.boundSharedStateRevision = boundScope.revision;\n }\n\n const hasStates = !!this.states && Object.keys(this.states).length > 0;\n if (!boundScope) {\n if (!hasStates) {\n return {\n compiledDefinitions: undefined,\n stateProxyModeKey: 'none'\n };\n }\n\n const localStatesVersion = this.getLocalStatesVersion();\n const cacheKey = `local:${localStatesVersion}`;\n if (!this.compiledStateDefinitions || this.compiledStateDefinitionsCacheKey !== cacheKey) {\n this.compiledStateDefinitions = new StateDefinitionCompiler<T>().compile(this.states);\n this.compiledStateDefinitionsCacheKey = cacheKey;\n }\n\n return {\n compiledDefinitions: this.compiledStateDefinitions,\n stateProxyModeKey: this.stateProxy ? 'legacy-all' : 'none'\n };\n }\n\n const sharedCompiledDefinitions = boundScope.effectiveCompiledDefinitions as Map<\n string,\n CompiledStateDefinition<T>\n >;\n const sharedStateProxyModeKey = this.stateProxy ? 'shared-missing-only' : 'none';\n const sharedStateProxyEligibility = this.stateProxy\n ? (stateName: string) => !sharedCompiledDefinitions.has(stateName)\n : undefined;\n if (!hasStates) {\n this.localFallbackCompiledDefinitions = undefined;\n return {\n compiledDefinitions: sharedCompiledDefinitions,\n stateProxyModeKey: sharedStateProxyModeKey,\n stateProxyEligibility: sharedStateProxyEligibility\n };\n }\n\n const localStates = this.states as StateDefinitionsInput<T>;\n const missingLocalStateDefinitions = {} as StateDefinitionsInput<T>;\n const missingStateNames: string[] = [];\n Object.keys(localStates).forEach(stateName => {\n if (sharedCompiledDefinitions.has(stateName)) {\n return;\n }\n missingLocalStateDefinitions[stateName] = localStates[stateName];\n missingStateNames.push(stateName);\n });\n\n if (!missingStateNames.length) {\n this.localFallbackCompiledDefinitions = undefined;\n return {\n compiledDefinitions: sharedCompiledDefinitions,\n stateProxyModeKey: sharedStateProxyModeKey,\n stateProxyEligibility: sharedStateProxyEligibility\n };\n }\n\n const localStatesVersion = this.getLocalStatesVersion();\n const stateProxyModeKey = this.stateProxy ? `missing:${missingStateNames.sort().join('|')}` : 'none';\n const cacheKey = `shared:${boundScope.revision}:fallback:${localStatesVersion}:${stateProxyModeKey}`;\n if (!this.localFallbackCompiledDefinitions || this.compiledStateDefinitionsCacheKey !== cacheKey) {\n this.localFallbackCompiledDefinitions = new StateDefinitionCompiler<T>().compile({\n ...(boundScope.effectiveSourceDefinitions as StateDefinitionsInput<T>),\n ...missingLocalStateDefinitions\n });\n this.compiledStateDefinitionsCacheKey = cacheKey;\n }\n\n return {\n compiledDefinitions: this.localFallbackCompiledDefinitions,\n stateProxyModeKey,\n stateProxyEligibility: sharedStateProxyEligibility\n };\n }\n\n protected recomputeCurrentStatePatch(): void {\n if (!this.currentStates?.length) {\n this.effectiveStates = [];\n this.resolvedStatePatch = undefined;\n this.syncSharedStateActiveRegistrations();\n return;\n }\n\n const stateResolveBaseAttrs = (this.baseAttributes ?? this.attribute) as Partial<T>;\n const stateModel = this.createStateModel();\n this.stateEngine?.setResolveContext(this, stateResolveBaseAttrs);\n const transition = stateModel.useStates(this.currentStates);\n const effectiveStates = transition.effectiveStates ?? transition.states;\n const resolvedStateAttrs =\n this.stateEngine && this.compiledStateDefinitions\n ? { ...(this.stateEngine.resolvedPatch as Partial<T>) }\n : this.getStateStyleResolver(this.stateMergeMode).resolve(\n stateResolveBaseAttrs,\n this.states as any,\n this.stateProxy as any,\n transition.states,\n this.stateSort\n );\n\n this.currentStates = transition.states;\n this.effectiveStates = [...effectiveStates];\n this.resolvedStatePatch = { ...resolvedStateAttrs };\n this.syncSharedStateActiveRegistrations();\n }\n\n protected buildStaticAttributeSnapshot(): Partial<T> {\n const snapshot = cloneAttributeValue((this.baseAttributes ?? {}) as Partial<T>) as Partial<T>;\n const resolvedPatch = this.resolvedStatePatch;\n\n if (!resolvedPatch) {\n return snapshot;\n }\n\n Object.keys(resolvedPatch).forEach(key => {\n const nextValue = (resolvedPatch as Record<string, any>)[key];\n const previousValue = (snapshot as Record<string, any>)[key];\n\n if (this.stateMergeMode === 'deep' && isPlainObjectValue(previousValue) && isPlainObjectValue(nextValue)) {\n (snapshot as Record<string, any>)[key] = deepMergeAttributeValue(previousValue, nextValue);\n return;\n }\n\n (snapshot as Record<string, any>)[key] = cloneAttributeValue(nextValue);\n });\n\n return snapshot;\n }\n\n protected buildRemovedStateAnimationAttrs(\n targetStateAttrs: Partial<T>,\n previousResolvedStatePatch?: Partial<T>\n ): Partial<T> {\n const extraAttrs: Record<string, any> = {};\n\n if (!previousResolvedStatePatch) {\n return extraAttrs as Partial<T>;\n }\n\n const snapshot = this.buildStaticAttributeSnapshot() as Record<string, any>;\n const staticTargetAttrs = snapshot as Partial<T>;\n Object.keys(previousResolvedStatePatch).forEach(key => {\n const hasTargetAttr = Object.prototype.hasOwnProperty.call(targetStateAttrs, key);\n if (hasTargetAttr && (targetStateAttrs as Record<string, any>)[key] !== undefined) {\n return;\n }\n\n const assignFallbackAttr = (value: any): void => {\n if (value === undefined && this.shouldSkipStateTransitionDefaultAttribute(key, staticTargetAttrs)) {\n return;\n }\n extraAttrs[key] = value === undefined ? value : cloneAttributeValue(value);\n };\n\n if (hasTargetAttr) {\n assignFallbackAttr(this.getStateTransitionDefaultAttribute(key, staticTargetAttrs));\n return;\n }\n\n if (Object.prototype.hasOwnProperty.call(snapshot, key)) {\n const snapshotValue = snapshot[key];\n assignFallbackAttr(\n snapshotValue === undefined ? this.getStateTransitionDefaultAttribute(key, staticTargetAttrs) : snapshotValue\n );\n return;\n }\n\n assignFallbackAttr(this.getStateTransitionDefaultAttribute(key, staticTargetAttrs));\n });\n\n return extraAttrs as Partial<T>;\n }\n\n protected syncObjectToSnapshot(target: Record<string, any>, snapshot: Record<string, any>): AttributeDelta {\n const delta: AttributeDelta = new Map();\n const keySet = new Set<string>([...Object.keys(target), ...Object.keys(snapshot)]);\n\n keySet.forEach(key => {\n const hasNext = Object.prototype.hasOwnProperty.call(snapshot, key);\n const previousValue = target[key];\n\n if (!hasNext) {\n if (Object.prototype.hasOwnProperty.call(target, key)) {\n delta.set(key, { prev: previousValue, next: undefined });\n delete target[key];\n }\n return;\n }\n\n const nextValue = snapshot[key];\n if (isEqual(previousValue, nextValue)) {\n return;\n }\n\n delta.set(key, { prev: previousValue, next: nextValue });\n target[key] = cloneAttributeValue(nextValue);\n });\n\n return delta;\n }\n\n protected _syncAttribute(): AttributeDelta {\n const snapshot = this.buildStaticAttributeSnapshot() as Record<string, any>;\n const delta = this.syncObjectToSnapshot(this.attribute as Record<string, any>, snapshot);\n this.valid = this.isValid();\n return delta;\n }\n\n protected _syncFinalAttributeFromStaticTruth(): void {\n const target = (this as any).finalAttribute;\n if (!target) {\n return;\n }\n const snapshot = this.buildStaticAttributeSnapshot() as Record<string, any>;\n this.syncObjectToSnapshot(target, snapshot);\n }\n\n protected submitUpdateByDelta(delta: AttributeDelta, forceUpdateTag: boolean = false): void {\n if (forceUpdateTag) {\n this.addUpdateShapeAndBoundsTag();\n this.addUpdatePositionTag();\n this.addUpdateLayoutTag();\n return;\n }\n\n let category = UpdateCategory.NONE;\n\n delta.forEach((entry, key) => {\n let nextCategory = classifyAttributeDelta(key, entry.prev, entry.next);\n if (nextCategory & UpdateCategory.PICK) {\n // Phase 2 keeps PICK invalidation on the existing bounds path instead of adding a dedicated pick tag.\n nextCategory |= UpdateCategory.BOUNDS;\n }\n if (nextCategory === UpdateCategory.PAINT && this.needUpdateTag(key)) {\n nextCategory = UpdateCategory.SHAPE | UpdateCategory.BOUNDS;\n }\n category |= nextCategory;\n });\n\n if (category !== UpdateCategory.NONE) {\n getStageStatePerfMonitor(this.stage)?.recordCategory(category);\n }\n\n if (category & UpdateCategory.SHAPE) {\n this.addUpdateShapeAndBoundsTag();\n } else if (category & UpdateCategory.BOUNDS) {\n this.addUpdateBoundTag();\n }\n\n if (category & UpdateCategory.PAINT) {\n this.addUpdatePaintTag();\n }\n\n if (category & UpdateCategory.TRANSFORM) {\n this.addUpdatePositionTag();\n }\n\n if (category & UpdateCategory.LAYOUT) {\n this.addUpdateLayoutTag();\n }\n }\n\n protected commitBaseAttributeMutation(forceUpdateTag: boolean = false, context?: ISetAttributeContext): void {\n if (this.currentStates?.length) {\n this.resolverEpoch += 1;\n this.stateEngine?.invalidateResolverCache();\n this.recomputeCurrentStatePatch();\n }\n const delta = this._syncAttribute();\n this.submitUpdateByDelta(delta, forceUpdateTag);\n this.onAttributeUpdate(context);\n }\n\n protected applyBaseAttributes(params: Partial<T>) {\n const keys = Object.keys(params);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n (this.baseAttributes as any)[key] = cloneAttributeValue((params as any)[key]);\n }\n }\n\n protected applyTransientAttributes(\n params: Partial<T>,\n forceUpdateTag: boolean = false,\n context?: ISetAttributeContext\n ) {\n const delta: AttributeDelta = new Map();\n const keys = Object.keys(params);\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const previousValue = (this.attribute as Record<string, any>)[key];\n const nextValue = (params as Record<string, any>)[key];\n if (isEqual(previousValue, nextValue)) {\n continue;\n }\n delta.set(key, { prev: previousValue, next: nextValue });\n (this.attribute as Record<string, any>)[key] = cloneAttributeValue(nextValue);\n }\n\n this.valid = this.isValid();\n this.submitUpdateByDelta(delta, forceUpdateTag);\n this.onAttributeUpdate(context);\n }\n\n protected _restoreAttributeFromStaticTruth(context?: ISetAttributeContext): void {\n this._syncFinalAttributeFromStaticTruth();\n const delta = this._syncAttribute();\n this.submitUpdateByDelta(delta);\n this.onAttributeUpdate(context);\n }\n\n setMode(mode: '2d' | '3d') {\n mode === '3d' ? this.set3dMode() : this.set2dMode();\n }\n\n set3dMode() {\n this.in3dMode = true;\n }\n set2dMode() {\n this.in3dMode = false;\n }\n getOffsetXY(attr?: ITransform, includeScroll: boolean = false) {\n const { dx = attr.dx, dy = attr.dy } = this.attribute;\n if (includeScroll && this.parent) {\n // const groupTheme = getTheme(this.parent).group;\n const attribute = this.parent.attribute;\n point.x = dx + (attribute.scrollX ?? 0);\n point.y = dy + (attribute.scrollY ?? 0);\n } else {\n point.x = dx;\n point.y = dy;\n }\n return point;\n }\n\n onAnimateBind(animate: IAnimate) {\n this._emitCustomEvent('animate-bind', animate);\n }\n\n protected visitTrackedAnimates(cb: (animate: IAnimate) => void) {\n const hook = (this as any).forEachTrackedAnimate;\n if (typeof hook === 'function') {\n hook.call(this, cb);\n return;\n }\n this.animates && this.animates.forEach(cb);\n }\n\n protected hasAnyTrackedAnimate() {\n const hook = (this as any).hasTrackedAnimate;\n if (typeof hook === 'function') {\n return hook.call(this);\n }\n const getTrackedAnimates = (this as any).getTrackedAnimates;\n if (typeof getTrackedAnimates === 'function') {\n return getTrackedAnimates.call(this).size > 0;\n }\n return !!this.animates?.size;\n }\n\n protected tryUpdateAABBBounds(): IAABBBounds {\n const full = this.attribute.boundsMode === 'imprecise';\n if (!this.shouldUpdateAABBBounds()) {\n return this._AABBBounds;\n }\n if (!this.valid) {\n this._AABBBounds.clear();\n return this._AABBBounds;\n }\n\n this.getGraphicService().beforeUpdateAABBBounds(this, this.stage, true, this._AABBBounds);\n const bounds = this.doUpdateAABBBounds(full);\n // this.addUpdateLayoutTag();\n this.getGraphicService().afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, true);\n\n // 直接返回空Bounds,但是前面的流程还是要走\n if (this.attribute.boundsMode === 'empty') {\n bounds.clear();\n }\n return bounds;\n }\n\n protected tryUpdateOBBBounds(): IOBBBounds {\n if (!this._OBBBounds) {\n this._OBBBounds = new OBBBounds();\n }\n // 尝试更新AABBBounds\n this.tryUpdateAABBBounds();\n // 如果AABBBounds和OBBBounds不一致,则重新计算OBBBounds\n if (this.updateOBBBoundsStamp === this.updateAABBBoundsStamp) {\n return this._OBBBounds;\n }\n this.updateOBBBoundsStamp = this.updateAABBBoundsStamp;\n if (!this.valid) {\n this._OBBBounds.clear();\n return this._OBBBounds;\n }\n\n const bounds = this.doUpdateOBBBounds();\n return bounds;\n }\n\n protected combindShadowAABBBounds(bounds: IAABBBounds) {\n // 合并shadowRoot的Bounds\n if (this.shadowRoot) {\n const b = this.shadowRoot.AABBBounds.clone();\n bounds.union(b);\n }\n }\n\n abstract getGraphicTheme(): T;\n\n protected doUpdateOBBBounds(): IOBBBounds {\n return this._OBBBounds;\n }\n\n protected abstract updateAABBBounds(\n attribute: T,\n symbolTheme: Required<T>,\n aabbBounds: IAABBBounds,\n full?: boolean\n ): IAABBBounds;\n\n getClipPath() {\n const { clipConfig } = this.attribute;\n if (!clipConfig) {\n return null;\n }\n if (!this.clipPathMap) {\n this.clipPathMap = new Map();\n }\n\n const { shape } = clipConfig;\n let path = this.clipPathMap.get(shape) || null;\n if (!path) {\n // 即使清理,避免内存溢出\n if (this.clipPathMap.size > 10) {\n this.clipPathMap.clear();\n }\n path = this.parsePath(shape);\n path && this.clipPathMap.set(shape, path);\n }\n return path;\n }\n\n parsePath(symbolType: string) {\n if (!symbolType) {\n return null;\n }\n let path = builtinSymbolsMap[symbolType];\n if (path) {\n return path;\n }\n path = Graphic.userSymbolMap[symbolType];\n if (path) {\n return path;\n }\n const _symbolType = builtInSymbolStrMap[symbolType];\n symbolType = _symbolType || symbolType;\n const valid = isSvg(symbolType);\n if (valid === true) {\n const parser = new XMLParser();\n const { svg } = parser.parse(symbolType);\n if (!svg) {\n return null;\n }\n const path = isArray(svg.path) ? svg.path : [svg.path];\n _tempBounds.clear();\n const cacheList: { path: CustomPath2D; attribute: Record<string, any> }[] = [];\n path.forEach((item: any) => {\n const cache = new CustomPath2D().fromString(item.d);\n const attribute: any = {};\n SVG_PARSE_ATTRIBUTE_MAP_KEYS.forEach(k => {\n if (item[k]) {\n (attribute as any)[(SVG_PARSE_ATTRIBUTE_MAP as any)[k]] = item[k];\n }\n });\n // 查找\n cacheList.push({\n path: cache,\n attribute\n });\n _tempBounds.union(cache.bounds);\n });\n const width = _tempBounds.width();\n const height = _tempBounds.height();\n // 规范化到1\n const maxWH = max(width, height);\n const scale = 1 / maxWH;\n cacheList.forEach(cache => cache.path.transform(0, 0, scale, scale));\n\n const _parsedPath = new CustomSymbolClass(symbolType, cacheList, true);\n Graphic.userSymbolMap[symbolType] = _parsedPath;\n return _parsedPath;\n }\n\n const cache = new CustomPath2D().fromString(symbolType);\n const width = cache.bounds.width();\n const height = cache.bounds.height();\n // 规范化到1\n const maxWH = max(width, height);\n const scale = 1 / maxWH;\n cache.transform(0, 0, scale, scale);\n const _parsedPath = new CustomSymbolClass(symbolType, cache);\n Graphic.userSymbolMap[symbolType] = _parsedPath;\n return _parsedPath;\n }\n\n protected doUpdateAABBBounds(full?: boolean): IAABBBounds {\n this.updateAABBBoundsStamp++;\n const graphicTheme = this.getGraphicTheme();\n this._AABBBounds.clear();\n const attribute = this.attribute;\n const bounds = this.updateAABBBounds(attribute, graphicTheme as Required<T>, this._AABBBounds, full) as AABBBounds;\n\n const { boundsPadding = graphicTheme.boundsPadding } = attribute;\n const paddingArray = parsePadding(boundsPadding);\n if (paddingArray) {\n bounds.expand(paddingArray);\n }\n\n this.clearUpdateBoundTag();\n return bounds;\n }\n\n updatePathProxyAABBBounds(aabbBounds: IAABBBounds): boolean {\n const path = typeof this.pathProxy === 'function' ? (this.pathProxy as any)(this.attribute) : this.pathProxy;\n if (!path) {\n return false;\n }\n const boundsContext = new BoundsContext(aabbBounds);\n renderCommandList(path.commandList, boundsContext, 0, 0);\n return true;\n }\n\n protected tryUpdateGlobalAABBBounds(): IAABBBounds {\n const b = this.AABBBounds;\n if (!this._globalAABBBounds) {\n this._globalAABBBounds = b.clone();\n } else {\n this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2);\n }\n if (this._globalAABBBounds.empty()) {\n return this._globalAABBBounds;\n }\n // 使用parent的grloalAABBBounds\n // todo: 考虑是否需要性能优化\n if (this.parent) {\n this._globalAABBBounds.transformWithMatrix((this.parent as IGroup).globalTransMatrix);\n }\n return this._globalAABBBounds;\n }\n\n /**\n * 这里都是叶子节点的UpdateGlobalTransMatrix函数,只要走进来就直接计算\n * @param clearTag\n * @returns\n */\n protected tryUpdateGlobalTransMatrix(clearTag: boolean = true): Matrix {\n if (!this._globalTransMatrix) {\n this._globalTransMatrix = this.parent\n ? (this.parent as IGroup).globalTransMatrix.clone()\n : this.transMatrix.clone();\n } else if (this.parent) {\n const m = (this.parent as IGroup).globalTransMatrix;\n this._globalTransMatrix.setValue(m.a, m.b, m.c, m.d, m.e, m.f);\n }\n if (this.shouldUpdateGlobalMatrix()) {\n this.doUpdateGlobalMatrix();\n }\n return this._globalTransMatrix;\n }\n\n shouldUpdateGlobalMatrix(): boolean {\n return true;\n }\n\n protected tryUpdateLocalTransMatrix(clearTag: boolean = true) {\n if (!this._transMatrix) {\n this._transMatrix = new Matrix();\n }\n if (this.shouldUpdateLocalMatrix()) {\n this.doUpdateLocalMatrix();\n clearTag && this.clearUpdateLocalPositionTag();\n }\n return this._transMatrix;\n }\n\n shouldUpdateAABBBounds(): boolean {\n // 如果存在shadowRoot,那么判断shadowRoot是否需要更新\n if (this.shadowRoot) {\n return (\n (!!(this._updateTag & UpdateTag.UPDATE_BOUNDS) || this.shadowRoot.shouldUpdateAABBBounds()) &&\n this.getGraphicService().validCheck(\n this.attribute,\n this.getGraphicTheme() as Required<T>,\n this._AABBBounds,\n this\n )\n );\n }\n return (\n !!(this._updateTag & UpdateTag.UPDATE_BOUNDS) &&\n this.getGraphicService().validCheck(this.attribute, this.getGraphicTheme() as Required<T>, this._AABBBounds, this)\n );\n }\n\n // 自身变化导致的AABBBounds的变化\n shouldSelfChangeUpdateAABBBounds(): boolean {\n // 如果存在shadowRoot,那么判断shadowRoot是否需要更新\n if (this.shadowRoot) {\n return !!(this._updateTag & UpdateTag.UPDATE_BOUNDS) || this.shadowRoot.shouldUpdateAABBBounds();\n }\n return !!(this._updateTag & UpdateTag.UPDATE_BOUNDS);\n }\n\n protected shouldUpdateLocalMatrix(): boolean {\n return !!(this._updateTag & UpdateTag.UPDATE_LOCAL_MATRIX);\n }\n\n isValid(): boolean {\n const attribute = this.attribute;\n return Number.isFinite((attribute.x ?? 0) + (attribute.y ?? 0));\n }\n\n protected _validNumber(num?: number) {\n return num == null || Number.isFinite(num);\n }\n\n shouldUpdateShape(): boolean {\n return !!(this._updateTag & UpdateTag.UPDATE_SHAPE);\n }\n clearUpdateShapeTag() {\n this._updateTag &= UpdateTag.CLEAR_SHAPE;\n }\n\n /**\n * 是否包含某个点(点需要是全局坐标系)\n * @param x\n * @param y\n * @param mode\n * @returns\n */\n containsPoint(x: number, y: number, mode: IContainPointMode, picker?: IPickerService): boolean {\n if (!picker) {\n return false;\n }\n if (mode === IContainPointMode.GLOBAL) {\n // 转换x,y更精准\n const point = new Point(x, y);\n if (this.parent) {\n this.parent.globalTransMatrix.transformPoint(point, point);\n }\n x = point.x;\n y = point.y;\n }\n return picker.containsPoint(this, { x, y });\n }\n\n protected setWidthHeightWithoutTransform(aabbBounds: IAABBBounds) {\n this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1;\n this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;\n }\n setAttributesAndPreventAnimate(\n params: Partial<T>,\n forceUpdateTag: boolean = false,\n context?: ISetAttributeContext,\n ignorePriority?: boolean\n ) {\n if (!params) {\n return;\n }\n const keys = Object.keys(params);\n this.captureTransientFromAttrsBeforePreventAnimate(params, keys, context);\n this.visitTrackedAnimates(animate => {\n // 优先级最高的动画(一般是循环动画),不屏蔽\n if (animate.priority === Infinity && !ignorePriority) {\n return;\n }\n animate.preventAttrs(keys);\n });\n this.applyTransientAttributes(params, forceUpdateTag, context);\n }\n\n protected captureTransientFromAttrsBeforePreventAnimate(\n params: Partial<T>,\n keys: string[],\n context?: ISetAttributeContext\n ) {\n const graphicContext = this.context as Record<string, any> | undefined;\n const diffAttrs = (graphicContext?.diffAttrs as Record<string, any> | undefined) ?? (params as Record<string, any>);\n const updateType = context?.type;\n if (\n !keys.length ||\n !diffAttrs ||\n updateType === AttributeUpdateType.STATE ||\n (updateType != null &&\n updateType >= AttributeUpdateType.ANIMATE_BIND &&\n updateType <= AttributeUpdateType.ANIMATE_END)\n ) {\n return;\n }\n\n const sameDiffAttrs = this.transientFromAttrsBeforePreventAnimateDiffAttrs === diffAttrs;\n let fromAttrs: Record<string, any> | null = sameDiffAttrs\n ? this.transientFromAttrsBeforePreventAnimate ?? null\n : null;\n if (!sameDiffAttrs) {\n this.transientFromAttrsBeforePreventAnimate = null;\n this.transientFromAttrsBeforePreventAnimateDiffAttrs = null;\n }\n let captured = false;\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (!Object.prototype.hasOwnProperty.call(diffAttrs, key)) {\n continue;\n }\n\n const previousValue = (this.attribute as Record<string, any>)[key];\n const nextValue = (params as Record<string, any>)[key];\n if (isEqual(previousValue, nextValue)) {\n continue;\n }\n\n fromAttrs ?? (fromAttrs = {});\n fromAttrs[key] = cloneAttributeValue(previousValue);\n captured = true;\n }\n\n if (captured) {\n this.transientFromAttrsBeforePreventAnimate = fromAttrs;\n this.transientFromAttrsBeforePreventAnimateDiffAttrs = diffAttrs;\n }\n }\n\n protected consumeTransientFromAttrsBeforePreventAnimate(diffAttrs: Record<string, any>): Record<string, any> | null {\n const transientFromAttrs = this.transientFromAttrsBeforePreventAnimate;\n const sourceDiffAttrs = this.transientFromAttrsBeforePreventAnimateDiffAttrs;\n if (!transientFromAttrs || !sourceDiffAttrs) {\n return null;\n }\n for (const key in diffAttrs) {\n if (\n Object.prototype.hasOwnProperty.call(diffAttrs, key) &&\n (!Object.prototype.hasOwnProperty.call(sourceDiffAttrs, key) || !isEqual(sourceDiffAttrs[key], diffAttrs[key]))\n ) {\n return null;\n }\n }\n\n let fromAttrs: Record<string, any> | null = null;\n let remaining = false;\n for (const key in transientFromAttrs) {\n if (!Object.prototype.hasOwnProperty.call(transientFromAttrs, key)) {\n continue;\n }\n\n if (Object.prototype.hasOwnProperty.call(diffAttrs, key)) {\n fromAttrs ?? (fromAttrs = {});\n fromAttrs[key] = transientFromAttrs[key];\n continue;\n }\n\n remaining = true;\n }\n\n if (remaining) {\n const nextTransientFromAttrs: Record<string, any> = {};\n for (const key in transientFromAttrs) {\n if (\n Object.prototype.hasOwnProperty.call(transientFromAttrs, key) &&\n !Object.prototype.hasOwnProperty.call(diffAttrs, key)\n ) {\n nextTransientFromAttrs[key] = transientFromAttrs[key];\n }\n }\n this.transientFromAttrsBeforePreventAnimate = nextTransientFromAttrs;\n } else {\n this.transientFromAttrsBeforePreventAnimate = null;\n this.transientFromAttrsBeforePreventAnimateDiffAttrs = null;\n }\n\n return fromAttrs;\n }\n\n setAttributes(params: Partial<T>, forceUpdateTag: boolean = false, context?: ISetAttributeContext) {\n if (!params) {\n return;\n }\n params =\n (this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context)) || params;\n\n if (params.background) {\n this.loadImage(params.background, true);\n }\n if (isExternalTexture(params.texture)) {\n this.loadImage(params.texture, false);\n }\n if (params.shadowGraphic) {\n this.setShadowGraphic(params.shadowGraphic);\n }\n this._setAttributes(params, forceUpdateTag, context);\n }\n\n _setAttributes(params: Partial<T>, forceUpdateTag: boolean = false, context?: ISetAttributeContext) {\n this.applyBaseAttributes(params);\n this.commitBaseAttributeMutation(forceUpdateTag, context);\n }\n\n setAttribute(key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) {\n const params =\n this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({ [key]: value }, this.attribute, key, context);\n if (!params) {\n this.applyBaseAttributes({ [key]: value } as Partial<T>);\n this.commitBaseAttributeMutation(!!forceUpdateTag, context);\n } else {\n this._setAttributes(params, forceUpdateTag, context);\n }\n if (key === 'background') {\n this.loadImage(value, true);\n } else if (key === 'texture' && isExternalTexture(value)) {\n this.loadImage(value, false);\n } else if (key === 'shadowGraphic') {\n this.setShadowGraphic(value);\n }\n }\n\n protected needUpdateTags(keys: string[], k: string[] = GRAPHIC_UPDATE_TAG_KEY): boolean {\n for (let i = 0; i < k.length; i++) {\n const attrKey = k[i];\n if (keys.indexOf(attrKey) !== -1) {\n return true;\n }\n }\n return false;\n }\n\n protected needUpdateTag(key: string, k: string[] = GRAPHIC_UPDATE_TAG_KEY): boolean {\n for (let i = 0; i < k.length; i++) {\n const attrKey = k[i];\n if (key === attrKey) {\n return true;\n }\n }\n return false;\n }\n\n initAttributes(params: T) {\n // this.setAttributes(params, true);\n const context = { type: AttributeUpdateType.INIT };\n params =\n (this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context)) || params;\n this.baseAttributes = cloneAttributeValue(params) as Partial<T>;\n if (!this.attribute) {\n this.attribute = {} as T;\n }\n this.resolvedStatePatch = undefined;\n this._syncAttribute();\n if (params.background) {\n this.loadImage(params.background, true);\n }\n if (isExternalTexture(params.texture)) {\n this.loadImage(params.texture, false);\n }\n if (params.shadowGraphic) {\n this.setShadowGraphic(params.shadowGraphic);\n }\n this._updateTag = UpdateTag.INIT;\n this.valid = this.isValid();\n this.onAttributeUpdate(context);\n }\n\n translate(x: number, y: number) {\n if (x === 0 && y === 0) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.TRANSLATE\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ x, y }, this.attribute, tempConstantXYKey, context);\n if (params) {\n x = params.x;\n y = params.y;\n delete params.x;\n delete params.y;\n this.applyBaseAttributes(params);\n }\n const attribute = this.baseAttributes as T;\n const postMatrix = attribute.postMatrix;\n if (!postMatrix) {\n attribute.x = (attribute.x ?? DefaultTransform.x) + x;\n attribute.y = (attribute.y ?? DefaultTransform.y) + y;\n } else {\n application.transformUtil.fromMatrix(postMatrix, postMatrix).translate(x, y);\n }\n\n this.commitBaseAttributeMutation(false, context);\n return this;\n }\n\n translateTo(x: number, y: number) {\n const attribute = this.baseAttributes as T;\n if (attribute.x === x && attribute.y === y) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.TRANSLATE_TO\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ x, y }, this.attribute, tempConstantXYKey, context);\n if (params) {\n this.applyBaseAttributes(params);\n this.commitBaseAttributeMutation(false, context);\n return this;\n }\n attribute.x = x;\n attribute.y = y;\n this.commitBaseAttributeMutation(false, context);\n return this;\n }\n\n scale(scaleX: number, scaleY: number, scaleCenter?: IPointLike) {\n if (scaleX === 1 && scaleY === 1) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.SCALE\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ scaleX, scaleY, scaleCenter }, this.attribute, tempConstantScaleXYKey, context);\n if (params) {\n scaleX = params.scaleX;\n scaleY = params.scaleY;\n delete params.scaleX;\n delete params.scaleY;\n this.applyBaseAttributes(params);\n }\n const attribute = this.baseAttributes as T;\n if (!scaleCenter) {\n attribute.scaleX = (attribute.scaleX ?? DefaultTransform.scaleX) * scaleX;\n attribute.scaleY = (attribute.scaleY ?? DefaultTransform.scaleY) * scaleY;\n } else {\n let { postMatrix } = this.attribute;\n if (!postMatrix) {\n postMatrix = new Matrix();\n attribute.postMatrix = postMatrix;\n }\n application.transformUtil.fromMatrix(postMatrix, postMatrix).scale(scaleX, scaleY, scaleCenter);\n }\n this.commitBaseAttributeMutation(false, context);\n return this;\n }\n\n scaleTo(scaleX: number, scaleY: number) {\n const attribute = this.baseAttributes as T;\n if (attribute.scaleX === scaleX && attribute.scaleY === scaleY) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.SCALE_TO\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ scaleX, scaleY }, this.attribute, tempConstantScaleXYKey, context);\n if (params) {\n this.applyBaseAttributes(params);\n this.commitBaseAttributeMutation(false, context);\n return this;\n }\n attribute.scaleX = scaleX;\n attribute.scaleY = scaleY;\n this.commitBaseAttributeMutation(false, context);\n return this;\n }\n\n rotate(angle: number, rotateCenter?: IPointLike) {\n if (angle === 0) {\n return this;\n }\n const context = { type: AttributeUpdateType.ROTATE };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ angle, rotateCenter }, this.attribute, tempConstantAngleKey, context);\n if (params) {\n delete params.angle;\n this.applyBaseAttributes(params);\n // return this;\n }\n const attribute = this.baseAttributes as T;\n if (!rotateCenter) {\n attribute.angle = (attribute.angle ?? DefaultTransform.angle) + angle;\n } else {\n let { postMatrix } = this.baseAttributes as T;\n if (!postMatrix) {\n postMatrix = new Matrix();\n (this.baseAttributes as T).postMatrix = postMatrix;\n }\n application.transformUtil.fromMatrix(postMatrix, postMatrix).rotate(angle, rotateCenter);\n }\n this.commitBaseAttributeMutation(false, context);\n return this;\n }\n\n rotateTo(angle: number) {\n const attribute = this.baseAttributes as T;\n if (attribute.angle === angle) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.ROTATE_TO\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate(angle, this.attribute, tempConstantAngleKey, context);\n if (params) {\n this.applyBaseAttributes(params);\n this.commitBaseAttributeMutation(false, context);\n return this;\n }\n attribute.angle = angle;\n this.commitBaseAttributeMutation(false, context);\n return this;\n }\n\n skewTo(b: number, c: number) {\n return this;\n }\n\n onAttributeUpdate(context?: ISetAttributeContext) {\n if (context && context.skipUpdateCallback) {\n return;\n }\n this.getGraphicService().onAttributeUpdate(this);\n this._emitCustomEvent('afterAttributeUpdate', context);\n }\n\n // hasListener(event: string) {\n // const prefix = this.prefixed;\n // var evt = prefix ? prefix + event : event;\n // return this._events[evt];\n // }\n\n update(d?: { bounds: boolean; trans: boolean }) {\n if (d) {\n d.bounds && this.tryUpdateAABBBounds();\n d.trans && this.tryUpdateLocalTransMatrix();\n } else {\n this.tryUpdateAABBBounds();\n this.tryUpdateLocalTransMatrix();\n }\n }\n\n hasState(stateName?: string) {\n if (!this.currentStates || !this.currentStates.length) {\n return false;\n }\n\n if (!isNil(stateName)) {\n return this.currentStates.includes(stateName);\n }\n\n return true;\n }\n getState(stateName: string): Partial<T> | StateDefinition<T> | undefined {\n return this.states?.[stateName];\n }\n\n protected createStateModel() {\n const { compiledDefinitions, stateProxyEligibility, stateProxyModeKey } =\n this.resolveEffectiveCompiledDefinitions();\n this.compiledStateDefinitions = compiledDefinitions;\n\n if (!compiledDefinitions) {\n this.stateEngine = undefined;\n this.stateEngineCompiledDefinitions = undefined;\n this.stateEngineStateProxyModeKey = undefined;\n } else if (\n !this.stateEngine ||\n this.stateEngineCompiledDefinitions !== compiledDefinitions ||\n this.stateEngineStateProxy !== this.stateProxy ||\n this.stateEngineStateSort !== this.stateSort ||\n this.stateEngineMergeMode !== this.stateMergeMode ||\n this.stateEngineStateProxyModeKey !== stateProxyModeKey\n ) {\n this.stateEngine = new StateEngine<T>({\n compiledDefinitions,\n stateSort: this.stateSort,\n stateProxy: this.stateProxy as any,\n stateProxyEligibility,\n states: this.states,\n mergeMode: this.stateMergeMode\n });\n this.stateEngineCompiledDefinitions = compiledDefinitions;\n this.stateEngineStateProxy = this.stateProxy as any;\n this.stateEngineStateSort = this.stateSort;\n this.stateEngineMergeMode = this.stateMergeMode;\n this.stateEngineStateProxyModeKey = stateProxyModeKey;\n }\n\n return new StateModel<T>({\n states: this.states,\n currentStates: this.currentStates,\n stateSort: this.stateSort,\n stateProxy: this.stateProxy as any,\n stateEngine: this.stateEngine\n });\n }\n\n protected resolveStateAnimateConfig(animateConfig?: IAnimateConfig) {\n return animateConfig ?? this.stateAnimateConfig ?? this.context?.stateAnimateConfig ?? DefaultStateAnimateConfig;\n }\n\n applyStateAttrs(\n attrs: Partial<T>,\n stateNames: string[],\n hasAnimation?: boolean,\n isClear?: boolean,\n animateConfig?: IAnimateConfig,\n extraAnimateAttrs?: Partial<T>\n ) {\n const resolvedAnimateConfig = hasAnimation ? this.resolveStateAnimateConfig(animateConfig) : undefined;\n const transitionOptions = resolvedAnimateConfig\n ? {\n animateConfig: resolvedAnimateConfig,\n extraAnimateAttrs: extraAnimateAttrs as Record<string, unknown>,\n shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this) as (\n key: string,\n targetAttrs: Record<string, unknown>\n ) => boolean\n }\n : undefined;\n\n if (isClear) {\n this.getStateTransitionOrchestrator().applyClearTransition(\n this as any,\n attrs,\n hasAnimation,\n stateNames,\n transitionOptions\n );\n return;\n }\n\n const plan = this.getStateTransitionOrchestrator().analyzeTransition({}, attrs, stateNames, hasAnimation, {\n noWorkAnimateAttr: this.getNoWorkAnimateAttr(),\n animateConfig: resolvedAnimateConfig,\n extraAnimateAttrs: extraAnimateAttrs as Record<string, unknown>,\n shouldSkipDefaultAttribute: this.shouldSkipStateTransitionDefaultAttribute.bind(this) as (\n key: string,\n targetAttrs: Record<string, unknown>\n ) => boolean\n });\n\n this.getStateTransitionOrchestrator().applyTransition(this as any, plan, hasAnimation, transitionOptions);\n }\n\n updateNormalAttrs(stateAttrs: Partial<T>) {\n this._deprecatedNormalAttrsView = cloneAttributeValue(this.baseAttributes);\n }\n\n protected getStateTransitionDefaultAttribute(key: string, targetAttrs?: Partial<T>) {\n return this.getDefaultAttribute(key);\n }\n\n protected shouldSkipStateTransitionDefaultAttribute(_key: string, _targetAttrs?: Partial<T>): boolean {\n return false;\n }\n\n protected stopStateAnimates(type: 'start' | 'end' = 'end') {\n const stopAnimationState = (this as any).stopAnimationState;\n if (typeof stopAnimationState === 'function') {\n stopAnimationState.call(this, 'state', type);\n return;\n }\n\n const stateAnimates: IAnimate[] = [];\n this.visitTrackedAnimates(animate => {\n if ((animate as any).stateNames) {\n stateAnimates.push(animate);\n }\n });\n stateAnimates.forEach(animate => animate.stop(type));\n }\n\n private getNormalAttribute(key: string) {\n const value = (this.attribute as any)[key];\n\n if (this.hasAnyTrackedAnimate()) {\n // this.animates.forEach(animate => {\n // if ((animate as any).stateNames) {\n // const endProps = animate.getEndProps();\n // if (has(endProps, key)) {\n // value = endProps[key];\n // }\n // }\n // });\n // console.log(this.finalAttrs);\n return (this as any).finalAttribute?.[key];\n }\n\n return value ?? (this as any).finalAttribute?.[key];\n }\n\n clearStates(hasAnimation?: boolean) {\n const previousStates = this.currentStates ? this.currentStates.slice() : [];\n const previousResolvedStatePatch = this.resolvedStatePatch\n ? cloneAttributeValue(this.resolvedStatePatch)\n : undefined;\n const transition = this.createStateModel().clearStates();\n if (!transition.changed && previousStates.length === 0) {\n this.currentStates = [];\n this.effectiveStates = [];\n this.resolvedStatePatch = undefined;\n this.sharedStateDirty = false;\n this.clearSharedStateActiveRegistrations();\n return;\n }\n const resolvedStateAttrs = cloneAttributeValue((this.baseAttributes ?? {}) as Partial<T>) as Partial<T>;\n\n if (\n transition.changed &&\n !this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, true)\n ) {\n return;\n }\n\n this.currentStates = transition.states;\n this.effectiveStates = [];\n this.resolvedStatePatch = undefined;\n this.sharedStateDirty = false;\n this.clearSharedStateActiveRegistrations();\n getStageStatePerfMonitor(this.stage)?.incrementCounter('stateCommits');\n getStageStatePerfMonitor(this.stage)?.recordEvent('state-commit', {\n graphicId: this._uid,\n targetStates: []\n });\n if (hasAnimation) {\n this._syncFinalAttributeFromStaticTruth();\n this.applyStateAttrs(\n resolvedStateAttrs,\n transition.states,\n hasAnimation,\n true,\n undefined,\n this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch)\n );\n } else {\n this.stopStateAnimates();\n this._restoreAttributeFromStaticTruth({ type: AttributeUpdateType.STATE });\n this._emitCustomEvent('afterStateUpdate', { type: AttributeUpdateType.STATE });\n }\n }\n\n removeState(stateName: string | string[], hasAnimation?: boolean) {\n const transition = this.createStateModel().removeState(stateName);\n if (transition.changed) {\n this.useStates(transition.states, hasAnimation);\n }\n }\n\n toggleState(stateName: string, hasAnimation?: boolean) {\n const transition = this.createStateModel().toggleState(stateName);\n if (transition.changed) {\n this.useStates(transition.states, hasAnimation);\n }\n }\n\n addState(stateName: string, keepCurrentStates?: boolean, hasAnimation?: boolean) {\n const transition = this.createStateModel().addState(stateName, keepCurrentStates);\n if (!transition.changed) {\n return;\n }\n this.useStates(transition.states, hasAnimation);\n }\n\n useStates(states: string[], hasAnimation?: boolean) {\n if (!states.length) {\n this.clearStates(hasAnimation);\n return;\n }\n\n const previousStates = this.currentStates ? this.currentStates.slice() : [];\n const previousResolvedStatePatch = this.resolvedStatePatch\n ? cloneAttributeValue(this.resolvedStatePatch)\n : undefined;\n const stateResolveBaseAttrs = (this.baseAttributes ?? this.attribute) as Partial<T>;\n const stateModel = this.createStateModel();\n this.stateEngine?.setResolveContext(this, stateResolveBaseAttrs);\n const transition = stateModel.useStates(states);\n if (!transition.changed && this.sameStateNames(previousStates, transition.states)) {\n return;\n }\n\n const effectiveStates = transition.effectiveStates ?? transition.states;\n const resolvedStateAttrs =\n this.stateEngine && this.compiledStateDefinitions\n ? { ...(this.stateEngine.resolvedPatch as Partial<T>) }\n : this.getStateStyleResolver(this.stateMergeMode).resolve(\n stateResolveBaseAttrs,\n this.states as any,\n this.stateProxy as any,\n transition.states,\n this.stateSort\n );\n\n if (!this.beforeStateUpdate(resolvedStateAttrs, previousStates, transition.states, hasAnimation, false)) {\n return;\n }\n\n this.currentStates = transition.states;\n this.effectiveStates = [...effectiveStates];\n this.resolvedStatePatch = { ...resolvedStateAttrs };\n this.sharedStateDirty = false;\n this.syncSharedStateActiveRegistrations();\n getStageStatePerfMonitor(this.stage)?.incrementCounter('stateCommits');\n getStageStatePerfMonitor(this.stage)?.recordEvent('state-commit', {\n graphicId: this._uid,\n targetStates: [...transition.states]\n });\n if (hasAnimation) {\n this._syncFinalAttributeFromStaticTruth();\n this.applyStateAttrs(\n resolvedStateAttrs,\n transition.states,\n hasAnimation,\n false,\n undefined,\n this.buildRemovedStateAnimationAttrs(resolvedStateAttrs, previousResolvedStatePatch)\n );\n } else {\n this.stopStateAnimates();\n this._restoreAttributeFromStaticTruth({ type: AttributeUpdateType.STATE });\n this._emitCustomEvent('afterStateUpdate', { type: AttributeUpdateType.STATE });\n }\n }\n\n invalidateResolver() {\n if (!this.stateEngine || !this.currentStates?.length || !this.compiledStateDefinitions) {\n return;\n }\n\n const stateResolveBaseAttrs = (this.baseAttributes ?? this.attribute) as Partial<T>;\n this.stateEngine.setResolveContext(this, stateResolveBaseAttrs);\n this.resolverEpoch += 1;\n this.stateEngine.invalidateResolverCache();\n const transition = this.stateEngine.applyStates(this.currentStates);\n const resolvedStateAttrs = { ...(this.stateEngine.resolvedPatch as Partial<T>) };\n this.effectiveStates = [...transition.effectiveStates];\n this.resolvedStatePatch = { ...resolvedStateAttrs };\n this.sharedStateDirty = false;\n this.syncSharedStateActiveRegistrations();\n this.stopStateAnimates();\n this._restoreAttributeFromStaticTruth({ type: AttributeUpdateType.STATE });\n this._emitCustomEvent('afterStateUpdate', { type: AttributeUpdateType.STATE });\n }\n\n private sameStateNames(left?: readonly string[], right?: readonly string[]): boolean {\n const normalizedLeft = left ?? [];\n const normalizedRight = right ?? [];\n if (normalizedLeft.length !== normalizedRight.length) {\n return false;\n }\n\n for (let index = 0; index < normalizedLeft.length; index++) {\n if (normalizedLeft[index] !== normalizedRight[index]) {\n return false;\n }\n }\n\n return true;\n }\n\n addUpdateBoundTag() {\n this._updateTag |= UpdateTag.UPDATE_BOUNDS; // for bounds\n if (this.parent) {\n this.parent.addChildUpdateBoundTag();\n }\n if (this.glyphHost) {\n this.glyphHost.addUpdateBoundTag();\n }\n }\n\n addUpdatePaintTag() {\n this._updateTag |= UpdateTag.UPDATE_PAINT;\n }\n\n addUpdateShapeTag() {\n this._updateTag |= UpdateTag.UPDATE_SHAPE; // for shape\n }\n\n addUpdateShapeAndBoundsTag() {\n this._updateTag |= UpdateTag.UPDATE_SHAPE_AND_BOUNDS; // for shape&bounds\n if (this.parent) {\n this.parent.addChildUpdateBoundTag();\n }\n if (this.glyphHost) {\n this.glyphHost.addUpdateBoundTag();\n }\n }\n\n protected updateShapeAndBoundsTagSetted(): boolean {\n return (this._updateTag & UpdateTag.UPDATE_SHAPE_AND_BOUNDS) === UpdateTag.UPDATE_SHAPE_AND_BOUNDS;\n }\n\n protected clearUpdateBoundTag() {\n this._updateTag &= UpdateTag.CLEAR_BOUNDS;\n }\n\n protected clearUpdatePaintTag() {\n this._updateTag &= UpdateTag.CLEAR_PAINT;\n }\n /**\n * 更新位置tag,包括全局tag和局部tag\n */\n addUpdatePositionTag() {\n // 更新shadowRoot的全局位置\n this.shadowRoot && this.shadowRoot.addUpdateGlobalPositionTag();\n this._updateTag |= UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX;\n }\n /**\n * 更新全局位置tag\n */\n addUpdateGlobalPositionTag() {\n // 更新shadowRoot的全局位置\n this.shadowRoot && this.shadowRoot.addUpdateGlobalPositionTag();\n this._updateTag |= UpdateTag.UPDATE_GLOBAL_MATRIX;\n }\n /**\n * 清除局部位置tag\n */\n protected clearUpdateLocalPositionTag() {\n this._updateTag &= UpdateTag.CLEAR_LOCAL_MATRIX;\n }\n /**\n * 清除全局位置tag\n */\n protected clearUpdateGlobalPositionTag() {\n this._updateTag &= UpdateTag.CLEAR_GLOBAL_MATRIX;\n }\n\n addUpdateLayoutTag() {\n this._updateTag |= UpdateTag.UPDATE_LAYOUT;\n }\n\n protected clearUpdateLayoutTag() {\n this._updateTag &= UpdateTag.CLEAR_LAYOUT;\n }\n\n protected needUpdateLayout(): boolean {\n return !!(this._updateTag & UpdateTag.UPDATE_LAYOUT);\n }\n\n protected getAnchor(anchor: [string | number, string | number], params: { b?: IAABBBounds }, resetScale?: boolean) {\n const _anchor: [number, number] = [0, 0];\n const getBounds = () => {\n if (params.b) {\n return params.b;\n }\n // 拷贝一份,避免计算bounds的过程中计算matrix,然后matrix又修改了bounds\n const graphic = this.clone();\n graphic.attribute.angle = 0;\n graphic.attribute.scaleCenter = null;\n if (resetScale) {\n graphic.attribute.scaleX = 1;\n graphic.attribute.scaleY = 1;\n }\n // @ts-ignore\n // this.setAttributes({ angle: 0, scaleCenter: null });\n params.b = graphic.AABBBounds;\n\n return params.b;\n };\n if (typeof anchor[0] === 'string') {\n const ratio = parseFloat(anchor[0]) / 100;\n const bounds = getBounds();\n _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;\n } else {\n _anchor[0] = anchor[0];\n }\n if (typeof anchor[1] === 'string') {\n const ratio = parseFloat(anchor[1]) / 100;\n const bounds = getBounds();\n _anchor[1] = bounds.y1 + (bounds.y2 - bounds.y1) * ratio;\n } else {\n _anchor[1] = anchor[1];\n }\n\n return _anchor;\n }\n\n /**\n * 更新局部matrix的具体函数\n */\n protected doUpdateLocalMatrix() {\n const {\n x = DefaultTransform.x,\n y = DefaultTransform.y,\n scaleX = DefaultTransform.scaleX,\n scaleY = DefaultTransform.scaleY,\n angle = DefaultTransform.angle,\n scaleCenter,\n anchor,\n postMatrix\n } = this.attribute;\n let _anchor: [number, number] = [0, 0];\n const params = {};\n if (anchor && angle) {\n _anchor = this.getAnchor(anchor, params);\n }\n if (scaleCenter && (scaleX !== 1 || scaleY !== 1)) {\n const m = this._transMatrix;\n m.reset();\n m.translate(_anchor[0], _anchor[1]);\n m.rotate(angle);\n m.translate(-_anchor[0], -_anchor[1]);\n\n m.translate(x, y);\n // m.translate(scaleCenter[0] * scaleX, scaleCenter[1] * scaleY);\n // 计算bounds\n _anchor = this.getAnchor(scaleCenter, params, true);\n application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, { x: _anchor[0], y: _anchor[1] });\n // m.translate(-scaleCenter[0], -scaleCenter[1]);\n } else {\n normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);\n }\n const p = this.getOffsetXY(DefaultTransform);\n this._transMatrix.e += p.x;\n this._transMatrix.f += p.y;\n\n if (postMatrix) {\n const m1 = tempMatrix.setValue(\n postMatrix.a,\n postMatrix.b,\n postMatrix.c,\n postMatrix.d,\n postMatrix.e,\n postMatrix.f\n );\n const m2 = this._transMatrix;\n m1.multiply(m2.a, m2.b, m2.c, m2.d, m2.e, m2.f);\n m2.setValue(m1.a, m1.b, m1.c, m1.d, m1.e, m1.f);\n }\n }\n /**\n * 更新全局matrix的具体函数\n */\n protected doUpdateGlobalMatrix() {\n // 基于parent的matrix修改\n if (this.parent) {\n this._globalTransMatrix.multiply(\n this.transMatrix.a,\n this.transMatrix.b,\n this.transMatrix.c,\n this.transMatrix.d,\n this.transMatrix.e,\n this.transMatrix.f\n );\n const { scrollX = 0, scrollY = 0 } = this.parent.attribute;\n this._globalTransMatrix.translate(scrollX, scrollY);\n }\n }\n\n setStage(stage?: IStage, layer?: ILayer) {\n const graphicService = stage?.graphicService ?? this.stage?.graphicService ?? application.graphicService;\n const previousStage = this.stage;\n if (this.stage !== stage || this.layer !== layer) {\n this.stage = stage;\n this.layer = layer;\n this.syncSharedStateScopeBindingFromTree(!!this.currentStates?.length);\n this.setStageToShadowRoot(stage, layer);\n if (this.hasAnyTrackedAnimate()) {\n const previousTimeline = previousStage?.getTimeline?.();\n const nextTimeline = stage?.getTimeline?.();\n const detachedStageAnimates: IAnimate[] = [];\n this.visitTrackedAnimates(a => {\n const boundToPreviousStage = !!previousTimeline && a.timeline === previousTimeline;\n\n if (!boundToPreviousStage && !a.timeline.isGlobal) {\n return;\n }\n\n if (!nextTimeline) {\n if (previousTimeline && a.timeline === previousTimeline) {\n previousTimeline.removeAnimate(a, false);\n detachedStageAnimates.push(a);\n }\n return;\n }\n\n if (a.timeline !== nextTimeline) {\n if (previousTimeline && a.timeline === previousTimeline) {\n previousTimeline.removeAnimate(a, false);\n }\n a.setTimeline(nextTimeline);\n nextTimeline.addAnimate(a);\n }\n });\n\n if (detachedStageAnimates.length) {\n detachedStageAnimates.forEach(animate => {\n animate.stop();\n const untrackAnimate = (this as any).untrackAnimate;\n if (typeof untrackAnimate === 'function') {\n untrackAnimate.call(this, animate.id);\n } else {\n this.animates?.delete(animate.id);\n }\n });\n this._restoreAttributeFromStaticTruth({ type: AttributeUpdateType.ANIMATE_END });\n }\n }\n this._onSetStage && this._onSetStage(this, stage, layer);\n graphicService?.onSetStage?.(this, stage);\n return;\n }\n\n this.syncSharedStateScopeBindingFromTree(!!this.currentStates?.length);\n }\n\n setStageToShadowRoot(stage?: IStage, layer?: ILayer) {\n if (this.shadowRoot) {\n this.shadowRoot.setStage(stage, layer);\n }\n }\n\n onAddStep(step: IStep) {\n return;\n }\n onStop(props?: Partial<T>): void {\n this._restoreAttributeFromStaticTruth({ type: AttributeUpdateType.ANIMATE_END });\n }\n\n getDefaultAttribute(name: string) {\n return (this.getGraphicTheme() as any)[name];\n }\n\n // 获取属性\n getComputedAttribute(name: string) {\n return (this.attribute as any)[name] ?? this.getDefaultAttribute(name);\n }\n /**\n * 添加onSetStage钩子\n * @param cb 回调函数\n * @param immediate 是否立刻执行,如果在回调添加之前stage就已经绑定,那么如果第二个参数为true就立刻执行回调\n */\n onSetStage(cb: (g: IGraphic, stage: IStage) => void, immediate: boolean = false) {\n this._onSetStage = cb;\n if (immediate && this.stage) {\n cb(this, this.stage);\n }\n }\n\n /******************** shadow graphic *********************/\n attachShadow(shadowRoot?: IShadowRoot) {\n if (shadowRoot) {\n shadowRoot.shadowHost = this;\n }\n\n this.shadowRoot =\n shadowRoot ??\n application.graphicService.creator.shadowRoot?.(this) ??\n (loadShadowRootFactory().createShadowRoot(this) as IShadowRoot);\n this.addUpdateBoundTag();\n this.shadowRoot.setStage(this.stage, this.layer);\n return this.shadowRoot;\n }\n\n detachShadow() {\n if (this.shadowRoot) {\n this.addUpdateBoundTag();\n this.shadowRoot.release(true);\n this.shadowRoot = null;\n }\n }\n\n toJson(): IGraphicJson {\n return {\n attribute: this.attribute,\n _uid: this._uid,\n type: this.type,\n name: this.name,\n children: this.children.map((item: IGraphic) => item.toJson())\n };\n }\n\n createPathProxy(path?: string) {\n if (isString(path, true)) {\n this.pathProxy = new CustomPath2D().fromString(path as string);\n } else {\n this.pathProxy = new CustomPath2D();\n }\n\n return this.pathProxy;\n }\n\n loadImage(image: any, background: boolean = false) {\n if (background && image?.background) {\n image = image.background;\n }\n if (background && (!image || backgroundNotImage(image))) {\n this.backgroundImg = false;\n return;\n }\n if (!image) {\n return;\n }\n const url = image;\n if (!this.resources) {\n this.resources = new Map();\n }\n const cache: {\n state: 'loading' | 'success' | 'init' | 'fail';\n data: any;\n } = {\n data: 'init',\n state: null\n };\n this.resources.set(url, cache);\n if (typeof image === 'string') {\n cache.state = 'loading';\n if (image.startsWith('<svg')) {\n // TODO 封装isSvg到@visactor/vutils\n ResourceLoader.GetSvg(image, this);\n this.backgroundImg = this.backgroundImg || background;\n } else if (isValidUrl(image) || image.includes('/') || isBase64(image)) {\n ResourceLoader.GetImage(image, this);\n this.backgroundImg = this.backgroundImg || background;\n }\n } else if (isObject(image)) {\n (cache.state = 'success'), (cache.data = image);\n this.backgroundImg = this.backgroundImg || background;\n } else {\n cache.state = 'fail';\n }\n }\n\n setShadowGraphic(graphic: IGraphic) {\n if (!graphic) {\n this.detachShadow();\n } else {\n const root = this.attachShadow();\n root.add(graphic);\n }\n }\n\n imageLoadSuccess(url: string, image: HTMLImageElement, cb?: () => void) {\n // 更新属性\n // this.resourceState = 'success';\n // this.resource = image;\n if (!this.resources) {\n return;\n }\n const res = this.resources.get(url);\n if (!res) {\n return;\n }\n res.state = 'success';\n res.data = image;\n\n cb && cb();\n\n // 触发重绘\n // 暂时全量,TODO 启动局部重绘\n // this.stage.enableDirtyBounds();\n // this.stage.dirty(this.AABBBounds);\n this.addUpdateBoundTag(); // 添加bounds更新tag重绘才会绘制这个mark\n this.stage && this.stage.renderNextFrame();\n }\n\n imageLoadFail(url: string, cb?: () => void) {\n if (!this.resources) {\n return;\n }\n const res = this.resources.get(url);\n if (!res) {\n return;\n }\n res.state = 'fail';\n\n cb && cb();\n }\n\n private _stopAnimates() {\n const animates: IAnimate[] = [];\n this.visitTrackedAnimates(animate => {\n animates.push(animate);\n });\n animates.forEach(animate => {\n animate.stop();\n });\n }\n\n stopAnimates(stopChildren: boolean = false) {\n this._stopAnimates();\n\n if (this.shadowRoot) {\n // 停止所有影子节点的动画\n this.shadowRoot.stopAnimates(true);\n }\n if (this.isContainer && stopChildren) {\n this.forEachChildren((c: IGraphic) => {\n c.stopAnimates(stopChildren);\n });\n }\n }\n\n release(): void {\n this.releaseStatus = 'released';\n this.clearSharedStateActiveRegistrations();\n this.stopAnimates();\n const graphicService = this.stage?.graphicService ?? application.graphicService;\n graphicService?.onRelease?.(this);\n super.release();\n }\n\n protected _dispatchCustomEvent(type: string, context?: any) {\n if (this._events && type in this._events) {\n const changeEvent = new CustomEvent(type, context);\n changeEvent.bubbles = false;\n const manager = (this.stage as any)?.eventSystem?.manager;\n\n if (manager) {\n (changeEvent as any).manager = manager;\n return this.dispatchEvent(changeEvent);\n }\n\n return Node.prototype.dispatchEvent.call(this, changeEvent);\n }\n return true;\n }\n\n protected beforeStateUpdate(\n attrs: Partial<T>,\n prevStates: string[],\n nextStates: string[],\n hasAnimation?: boolean,\n isClear?: boolean\n ) {\n return this._dispatchCustomEvent('beforeStateUpdate', {\n type: AttributeUpdateType.STATE,\n attrs: { ...attrs },\n prevStates: prevStates.slice(),\n nextStates: nextStates.slice(),\n hasAnimation: !!hasAnimation,\n isClear: !!isClear\n });\n }\n\n protected _emitCustomEvent(type: string, context?: any) {\n this._dispatchCustomEvent(type, context);\n }\n\n abstract getNoWorkAnimateAttr(): Record<string, number>;\n\n abstract clone(): IGraphic<any>;\n\n toCustomPath(): ICustomPath2D {\n // throw new Error('暂不支持');\n const renderer = (this.stage?.renderService || application.renderService)?.drawContribution?.getRenderContribution(\n this\n );\n if (renderer) {\n const context = new EmptyContext2d(null, 1);\n renderer.drawShape(this, context, 0, 0, {} as any, {});\n return context.path;\n }\n return null;\n }\n}\n\nGraphic.mixin(EventTarget);\n\nfunction backgroundNotImage(image: any) {\n if (typeof image === 'string') {\n return !(image.startsWith('<svg') || isValidUrl(image) || image.includes('/') || isBase64(image));\n }\n if (image.fill || image.stroke) {\n return true;\n }\n if (typeof image.gradient === 'string' && Array.isArray(image.stops)) {\n return true;\n }\n return false;\n}\n\nfunction isExternalTexture(texture: any) {\n if (!texture) {\n return false;\n }\n if (typeof texture === 'string') {\n if (builtinTextureTypes.has(texture)) {\n return false;\n }\n return texture.startsWith('<svg') || isValidUrl(texture) || texture.includes('/') || isBase64(texture);\n }\n return isObject(texture);\n}\n"]}
|