@visactor/vrender-core 1.1.4-alpha.0 → 1.1.4-alpha.2

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.
Files changed (48) hide show
  1. package/cjs/graphic/graphic.d.ts +15 -5
  2. package/cjs/graphic/graphic.js +53 -18
  3. package/cjs/graphic/graphic.js.map +1 -1
  4. package/cjs/graphic/group.d.ts +7 -4
  5. package/cjs/graphic/group.js +31 -17
  6. package/cjs/graphic/group.js.map +1 -1
  7. package/cjs/graphic/node-tree.d.ts +2 -1
  8. package/cjs/graphic/node-tree.js +1 -1
  9. package/cjs/graphic/node-tree.js.map +1 -1
  10. package/cjs/graphic/richtext/utils.js +3 -0
  11. package/cjs/graphic/richtext/utils.js.map +1 -1
  12. package/cjs/graphic/richtext.d.ts +4 -1
  13. package/cjs/graphic/richtext.js +2 -2
  14. package/cjs/graphic/richtext.js.map +1 -1
  15. package/cjs/graphic/state/state-engine.d.ts +1 -0
  16. package/cjs/graphic/state/state-engine.js +17 -0
  17. package/cjs/graphic/state/state-engine.js.map +1 -1
  18. package/cjs/interface/graphic/richText.d.ts +2 -0
  19. package/cjs/interface/graphic/richText.js.map +1 -1
  20. package/cjs/interface/graphic.d.ts +1 -1
  21. package/cjs/interface/graphic.js.map +1 -1
  22. package/cjs/interface/node-tree.d.ts +2 -1
  23. package/cjs/interface/node-tree.js.map +1 -1
  24. package/dist/index.es.js +151 -40
  25. package/es/graphic/graphic.d.ts +15 -5
  26. package/es/graphic/graphic.js +53 -14
  27. package/es/graphic/graphic.js.map +1 -1
  28. package/es/graphic/group.d.ts +7 -4
  29. package/es/graphic/group.js +31 -17
  30. package/es/graphic/group.js.map +1 -1
  31. package/es/graphic/node-tree.d.ts +2 -1
  32. package/es/graphic/node-tree.js +1 -1
  33. package/es/graphic/node-tree.js.map +1 -1
  34. package/es/graphic/richtext/utils.js +3 -0
  35. package/es/graphic/richtext/utils.js.map +1 -1
  36. package/es/graphic/richtext.d.ts +4 -1
  37. package/es/graphic/richtext.js +2 -2
  38. package/es/graphic/richtext.js.map +1 -1
  39. package/es/graphic/state/state-engine.d.ts +1 -0
  40. package/es/graphic/state/state-engine.js +17 -0
  41. package/es/graphic/state/state-engine.js.map +1 -1
  42. package/es/interface/graphic/richText.d.ts +2 -0
  43. package/es/interface/graphic/richText.js.map +1 -1
  44. package/es/interface/graphic.d.ts +1 -1
  45. package/es/interface/graphic.js.map +1 -1
  46. package/es/interface/node-tree.d.ts +2 -1
  47. package/es/interface/node-tree.js.map +1 -1
  48. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/graphic.ts"],"names":[],"mappings":"","file":"graphic.js","sourcesContent":["import type { IAABBBounds, IMatrix, IPointLike, IPoint, BoundsAnchorType, IOBBBounds } from '@visactor/vutils';\nimport type { IAnimate, IStep, EasingType, IAnimateTarget, ITimeline } from './animation';\nimport type { IColor } from './color';\nimport type { IGroup } from './graphic/group';\nimport type { IShadowRoot } from './graphic/shadow-root';\nimport type { ILayer } from './layer';\nimport type { INode } from './node-tree';\nimport type { ICustomPath2D } from './path';\nimport type { IStage } from './stage';\nimport type { IGlyphGraphicAttribute } from './graphic/glyph';\nimport type { IContainPointMode } from '../common/enums';\nimport type { IFace3d } from './graphic/face3d';\nimport type { IPickerService } from './picker';\nimport type { ISymbolClass } from './graphic/symbol';\nimport type { StateDefinition, StateDefinitionsInput, StateMergeMode } from '../graphic/state/state-definition';\nimport type { SharedStateScope } from '../graphic/state/shared-state-scope';\n\ntype IStrokeSeg = {\n /**\n * 百分比\n */\n start: number;\n /**\n * 百分比\n * end和length二选一\n */\n end: number;\n /**\n * 像素长度\n */\n length: number;\n};\n\n// TODO 最后加一个any\nexport type GraphicType =\n | 'area'\n | 'circle'\n | 'ellipse'\n | 'line'\n | 'rect'\n | 'rect3d'\n | 'path'\n | 'richtext'\n | 'text'\n | 'arc'\n | 'arc3d'\n | 'image'\n | 'symbol'\n | 'group'\n | 'shadowroot'\n | 'polygon'\n | 'pyramid3d'\n | 'glyph'\n | string;\n\n// Cursor style\n// See: https://developer.mozilla.org/en-US/docs/Web/CSS/cursor\nexport type Cursor =\n | 'auto'\n | 'default'\n | 'none'\n | 'context-menu'\n | 'help'\n | 'pointer'\n | 'progress'\n | 'wait'\n | 'cell'\n | 'crosshair'\n | 'text'\n | 'vertical-text'\n | 'alias'\n | 'copy'\n | 'move'\n | 'no-drop'\n | 'not-allowed'\n | 'grab'\n | 'grabbing'\n | 'all-scroll'\n | 'col-resize'\n | 'row-resize'\n | 'n-resize'\n | 'e-resize'\n | 's-resize'\n | 'w-resize'\n | 'ne-resize'\n | 'nw-resize'\n | 'se-resize'\n | 'sw-resize'\n | 'ew-resize'\n | 'ns-resize'\n | 'nesw-resize'\n | 'nwse-resize'\n | 'zoom-in'\n | 'zoom-out';\n\nexport type ITransform = {\n /**\n * x坐标\n */\n x: number;\n /**\n * y坐标\n */\n y: number;\n /**\n * z坐标\n */\n z: number;\n /**\n * x方向偏移量\n */\n dx: number;\n /**\n * y方向偏移量\n */\n dy: number;\n /**\n * z方向偏移量\n */\n dz: number;\n /**\n * x方向的滚动值\n */\n scrollX: number;\n /**\n * y方向的滚动值\n */\n scrollY: number;\n /**\n * x方向的缩放值\n */\n scaleX: number;\n /**\n * y方向的缩放值\n */\n scaleY: number;\n /**\n * z方向的缩放值\n */\n scaleZ: number;\n /**\n * 绕z轴的转角,即xy平面上的旋转角度\n */\n angle: number;\n /**\n * 绕x轴的转角\n */\n alpha: number;\n /**\n * 绕y轴的转角\n */\n beta: number;\n /**\n * 应用缩放的中心\n */\n scaleCenter: [number | string, number | string];\n /**\n * 基于AABB的锚点位置,用于简单的定位某些path\n */\n anchor: [number | string, number | string];\n /**\n * 3d的锚点位置\n */\n anchor3d: [number | string, number | string, number] | [number | string, number | string];\n /**\n * 处理矩阵,在正常计算完变换矩阵之后,会将该矩阵乘到变换矩阵上得到最终的变换矩阵\n */\n postMatrix: IMatrix;\n};\n\nexport type IFillType = boolean | string | IColor;\nexport type IFillStyle = {\n /**\n * 图形的填充透明度\n */\n fillOpacity: number;\n /**\n * 图形模糊效果程度\n */\n shadowBlur: number;\n /**\n * 图形的阴影颜色\n */\n shadowColor: string;\n /**\n * 阴影水平偏移距离\n */\n shadowOffsetX: number;\n /**\n * 阴影垂直偏移距离\n */\n shadowOffsetY: number;\n /**\n * 图形的填充颜色\n */\n fill: IFillType;\n};\n\nexport type ILayout = {\n /**\n * 设置对齐方式\n */\n alignSelf: 'auto' | 'flex-start' | 'flex-end' | 'center';\n};\n\nexport type IBorderStyle = Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> & {\n /**\n * 边距离边缘的距离\n */\n distance: number | string;\n /**\n * 是否显示边框,默认是不显示的\n */\n visible?: boolean;\n};\n\nexport type IStrokeType = boolean | string | IColor | null;\nexport type IStrokeStyle = {\n /**\n * 外部边框的样式配置,默认不展示外部边框\n */\n outerBorder: Partial<IBorderStyle>;\n /**\n * 内部边框的样式配置\n */\n innerBorder: Partial<IBorderStyle>;\n /**\n * 描边的透明度\n */\n strokeOpacity: number;\n /**\n * 设置线条虚线样式的属性,它通过定义实线和空白的交替长度来创建虚线效果\n */\n lineDash: number[];\n\n /**\n * 设置虚线样式的起始偏移量\n */\n lineDashOffset: number;\n\n /**\n * 设置线条的宽度\n */\n lineWidth: number;\n\n /**\n * 设置线条末端的样式\n */\n lineCap: CanvasLineCap;\n\n /**\n * 设置线条拐角的样式\n */\n lineJoin: CanvasLineJoin;\n\n /**\n * 设置线条拐角处的斜接限制\n */\n miterLimit: number;\n /**\n * 描边的boundsBuffer,用于控制bounds的buffer\n */\n strokeBoundsBuffer: number;\n /**\n * stroke - true 全描边\n * stroke - false/null 不描边\n * stroke 为数值类型,适用于rect\\arc等图形,用于配置部分描边的场景,其中\n *\n * 0b00000 - 不描边\n * 0b000001 - top\n * 0b000010 - right\n * 0b000100 - bottom\n * 0b001000 - left\n * 相应的:\n * 0b000011 - top + right\n * 0b000111 - top + right + bottom\n * 0b001111 - 全描边\n *\n * stroke - boolean[],适用于rect\\arc等图形,用于配置部分描边的场景\n * 对rect分边描边,数组项为false/null时表示对应边不描边\n */\n stroke: IStrokeType[] | IStrokeType;\n};\n\ntype TextureType = 'circle' | 'diamond' | 'rect' | 'vertical-line' | 'horizontal-line' | 'bias-lr' | 'bias-rl' | 'grid';\n\nexport type IConnectedStyle = {\n /**\n * 连接,取零或者断开\n */\n connectedType: 'connect' | 'none';\n /**\n * 连接线的样式配置\n */\n connectedStyle: {\n stroke: IStrokeStyle['stroke'];\n strokeOpacity: IStrokeStyle['strokeOpacity'];\n lineDash: IStrokeStyle['lineDash'];\n lineDashOffset: IStrokeStyle['lineDashOffset'];\n lineCap: IStrokeStyle['lineCap'];\n lineJoin: IStrokeStyle['lineJoin'];\n lineWidth: IStrokeStyle['lineWidth'];\n fill: IFillStyle['fill'];\n fillOpacity: IFillStyle['fillOpacity'];\n };\n connectedX: number;\n connectedY: number;\n};\n\nexport type IBackgroundConfig = {\n stroke?: string | boolean;\n fill?: string | boolean;\n lineWidth?: number;\n cornerRadius?: number;\n expandX?: number;\n expandY?: number;\n};\n\nexport type BackgroundSizing = 'cover' | 'contain' | 'fill' | 'auto';\nexport type BackgroundRepeatMode = 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat';\nexport type BackgroundSizingShorthand = 'no-repeat-cover' | 'no-repeat-contain' | 'no-repeat-fill' | 'no-repeat-auto';\nexport type BackgroundMode = BackgroundRepeatMode | BackgroundSizingShorthand;\nexport type BackgroundPositionHorizontalKeyword = 'left' | 'center' | 'right';\nexport type BackgroundPositionVerticalKeyword = 'top' | 'center' | 'bottom';\nexport type BackgroundPositionKeyword = BackgroundPositionHorizontalKeyword | BackgroundPositionVerticalKeyword;\nexport type BackgroundPositionPercent = `${number}%`;\nexport type BackgroundPositionValue = number | BackgroundPositionKeyword | BackgroundPositionPercent;\nexport type BackgroundPositionPreset =\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'center-left'\n | 'center'\n | 'center-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right';\nexport type BackgroundPosition =\n | BackgroundPositionKeyword\n | BackgroundPositionPreset\n | [BackgroundPositionValue, BackgroundPositionValue];\n\nexport type IBackgroundType = string | HTMLImageElement | HTMLCanvasElement | IBackgroundConfig;\n\nexport interface SimpleDomStyleOptions {\n /**\n * 容器的宽度\n */\n width: number;\n /**\n * 容器的高度\n */\n height: number;\n /**\n * 容器的样式设置\n */\n style?:\n | string\n | Record<string, any>\n | ((\n pos: { top: number; left: number; width: number; height: number },\n graphic: IGraphic,\n wrapContainer: HTMLElement\n ) => Record<string, any>); // 容器的样式\n}\n\nexport interface CommonDomOptions {\n /**\n * 全局唯一的id\n */\n id?: string;\n /**\n * 容器元素的id或者dom元素\n */\n container: string | HTMLElement | null;\n /**\n * 是否显示\n */\n visible?: boolean;\n /**\n * 是否支持事件冒泡\n */\n pointerEvents?: boolean | string;\n /**\n * 可穿透的事件列表\n * @since 0.21.2\n */\n penetrateEventList?: string[];\n /**\n * 定位类型\n * 'position' - 根据挂载图形节点的坐标也就是x,y进行定位\n * 'boundsLeftTop' - 定位到挂载图形节点bounds的左上角\n * 'left' - 定位到挂载图形节点bounds 的左侧\n * 'right' - 定位到挂载图形节点bounds 的右侧\n * 'bottom' - 定位到挂载图形节点bounds 的底部\n * 'top' - 定位到挂载图形节点bounds 的顶部\n * 'center' - 定位到挂载图形节点bounds 的中心\n * 'top-left' - 定位到挂载图形节点bounds 的左上角\n * 'top-right' - 定位到挂载图形节点bounds 的右上角\n * 'bottom-left' - 定位到挂载图形节点bounds 的左下角\n * 'bottom-right' - 定位到挂载图形节点bounds 的右下角\n */\n anchorType?: 'position' | 'boundsLeftTop' | BoundsAnchorType;\n}\n\nexport type IRoughStyle = {\n fillStyle: 'hachure' | 'solid' | 'zigzag' | 'cross-hatch' | 'dots' | 'sunburst' | 'dashed' | 'zigzag-line';\n roughness: number;\n bowing: number;\n};\n\nexport type IGraphicStyle = ILayout &\n IFillStyle &\n IStrokeStyle &\n IPickStyle & {\n /**\n * 强制设置的bounds宽度,主要用于使用html或者react展示图形的时候,设置一个固定的宽度\n */\n forceBoundsWidth: number | (() => number) | undefined;\n /**\n * 强制设置的bounds高度,主要用于使用html或者react展示图形的时候,设置一个固定的高度\n */\n forceBoundsHeight: number | (() => number) | undefined;\n /**\n * 透明度,会同时影响填充和描边\n */\n opacity: number;\n /**\n * 影子节点\n */\n shadowGraphic?: IGraphic | undefined;\n /**\n * 背景填充模式(与具体图元有关)\n */\n backgroundMode: BackgroundMode;\n /**\n * 是否正好填充,只在repeat-x或者repeat-y以及no-repeat的时候生效\n */\n backgroundFit: boolean;\n /**\n * 是否保持背景图的宽高比\n */\n backgroundKeepAspectRatio: boolean;\n /**\n * 背景图缩放,只在no-repeat的时候生效\n */\n backgroundScale: number;\n /**\n * 背景图偏移,只在no-repeat的时候生效\n */\n backgroundOffsetX: number;\n /**\n * 背景图偏移,只在no-repeat的时候生效\n */\n backgroundOffsetY: number;\n /**\n * 背景图锚定位置(类似 CSS background-position),仅在 no-repeat 的图片背景下生效。\n */\n backgroundPosition: BackgroundPosition;\n /**\n * 背景图是否裁切,是否调用clip避免绘制到图元外部\n */\n backgroundClip: boolean;\n /**\n * 背景圆角半径\n */\n backgroundCornerRadius: number | number[];\n /**\n * 背景透明度\n */\n backgroundOpacity: number;\n /**\n * 背景,支持颜色字符串、html image元素、html canvas元素\n */\n // 纹理是否自动做动画\n autoAnimateTexture: boolean;\n // 如果做动画的话,这里代表ratio\n textureRatio: number;\n textureOptions: any;\n background:\n | IBackgroundType\n | {\n /**\n * 背景,支持颜色字符串、html image元素、html canvas元素\n */\n background: IBackgroundType;\n /**\n * 背景的x方向偏移量\n */\n dx?: number;\n /**\n * 背景的y方向偏移量\n */\n dy?: number;\n /**\n * 背景宽度\n */\n width?: number;\n /**\n * 背景高度\n */\n height?: number;\n /**\n * 背景的x坐标\n */\n x?: number;\n /**\n * 背景的y坐标\n */\n y?: number;\n }\n | null; // 背景,可以与fill同时存在\n /**\n * 纹理的类型\n */\n texture: TextureType | string;\n /**\n * 纹理的颜色\n */\n textureColor: string;\n /**\n * 纹理的大小\n */\n textureSize: number;\n /**\n * 纹理的间隙\n */\n texturePadding: number;\n\n blur: number;\n /**\n * 设置图形对应的鼠标样式\n */\n cursor: Cursor | null;\n // @deprecated 用处少废弃,后续考虑新设计API\n filter: string;\n renderStyle?: 'default' | 'rough' | any;\n roughStyle?: IRoughStyle | null;\n /**\n * HTML的dom或者string\n */\n html:\n | ({\n /**\n * dom字符串或者dom\n */\n dom: string | HTMLElement;\n } & SimpleDomStyleOptions &\n CommonDomOptions)\n | null;\n /**\n * 使用react元素渲染内容\n */\n react:\n | ({\n /**\n * react场景节点\n */\n element: any;\n } & SimpleDomStyleOptions &\n CommonDomOptions)\n | null;\n /**\n * 使用vue组件渲染内容\n */\n vue:\n | ({\n /**\n * vue 虚拟节点\n */\n element: any;\n } & SimpleDomStyleOptions &\n CommonDomOptions)\n | null;\n };\n\nexport type IPickStyle = {\n /**\n * 给stroke模式的pick额外加的buffer,用于外界控制stroke区域的pick范围\n */\n pickStrokeBuffer: number;\n};\n\nexport type IDebugType = {\n _debug_bounds: boolean | ((c: any, g: any) => void);\n};\nexport type IGraphicAttribute = IDebugType &\n IGraphicStyle &\n ITransform & {\n /**\n * stroke百分比\n */\n strokeSeg: IStrokeSeg | null;\n /**\n * 包围盒的padding\n */\n boundsPadding: number | number[];\n /**\n * 选择模式,精确模式,粗糙模式(包围盒模式),自定义模式\n */\n pickMode: 'accurate' | 'imprecise' | 'custom';\n boundsMode: 'accurate' | 'imprecise' | 'empty';\n customPickShape: () => boolean | null;\n /**\n * 是否支持事件拾取,默认为 true。\n * @default true\n */\n pickable: boolean;\n /**\n * 是否支持fill拾取,默认为 true。\n * @experimental\n * @default true\n */\n fillPickable: boolean;\n /**\n * 是否支持stroke拾取,默认为 true。\n * @experimental\n * @default true\n */\n strokePickable: boolean;\n /**\n * 对于 group 节点,是否支持其子元素的事件拾取,默认为 true。\n * 如果 group `pickable` 关闭,`childrenPickable` 开启,那么 group 的子节点仍参与事件拾取\n * @default true\n */\n childrenPickable: boolean;\n /**\n * 元素是否可见。\n * @default true\n */\n visible: boolean;\n /**\n * 分组下的层级,层级越小越先绘制\n */\n zIndex: number;\n layout: any;\n /**\n * 是否隐藏元素(只是绘制的时候不绘制)\n */\n renderable: boolean;\n /**\n * 是否在3d中控制方向\n * false: 不控制方向\n * true: 始终控制方向朝摄像机\n */\n keepDirIn3d?: boolean;\n shadowRootIdx: number;\n shadowPickMode?: 'full' | 'graphic';\n /**\n * 全局范围的层级,设置了这个属性的图形,会提取到交互层进行渲染\n */\n globalZIndex: number;\n /**\n * canvas 的合成方式\n */\n globalCompositeOperation: CanvasRenderingContext2D['globalCompositeOperation'] | '';\n /**\n * 完全支持滚动 | 完全不支持滚动 | 支持x方向的滚动 | 支持y方向的滚动\n */\n overflow: 'scroll' | 'hidden' | 'scroll-x' | 'scroll-y';\n /**\n * 绘制fill和stroke的顺序,为0表示fill先绘制,1表示stroke先绘制\n */\n fillStrokeOrder: number;\n /**\n * @since 0.20.15\n * 保持stroke的scale,默认为false,为true的话stroke显示的宽度会随着scale变化\n */\n keepStrokeScale: boolean;\n\n /**\n * @since 0.22.2\n * 裁剪路径,用于裁剪图形,用于普通图元的裁剪\n * 由于一般情况下普通图元只需要一个形状即可,所以这里不需要配置具体的位置和大小,强制中心在图元中心,宽高和图元Bounds宽高一致\n * 不考虑其他复杂情况,否则配置项就非常多了,比如多路径,或者配置位置大小等,如果配置大小那还得用户自己去拿图元的大小,目前没有这种需求\n */\n clipConfig: {\n shape: string;\n } | null;\n };\n\nexport interface IGraphicJson<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>> {\n attribute: Partial<T>;\n baseAttributes?: Partial<T>;\n _uid: number;\n type: string;\n name: string;\n children: IGraphicJson<T>[];\n}\n\n/** the context of setAttribute */\nexport type ISetAttributeContext = {\n /** type of setAttribute */\n type?: number;\n animationState?: {\n step?: IStep;\n isFirstFrameOfStep?: boolean;\n /** ratio of animation */\n ratio?: number;\n /** is animation end? */\n end?: boolean;\n };\n skipUpdateCallback?: boolean;\n};\n\nexport type IGraphicAnimateParams = {\n slience?: boolean;\n id?: number | string;\n timeline?: ITimeline;\n onStart?: () => void;\n onFrame?: (step: IStep, ratio: number) => void;\n onEnd?: () => void;\n onRemove?: () => void;\n interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n};\n\nexport interface IGraphic<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>>\n extends INode,\n IAnimateTarget {\n type?: GraphicType;\n numberType?: number;\n stage?: IStage;\n layer?: ILayer;\n shadowRoot?: IShadowRoot;\n glyphHost?: IGraphic<IGlyphGraphicAttribute>;\n backgroundImg?: boolean;\n attachedThemeGraphic?: IGraphic<any>;\n /**\n * 保存语法上下文\n */\n context?: Record<string, any>;\n bindDom?: Map<\n string | HTMLElement,\n { container: HTMLElement | string; dom: HTMLElement | any; wrapGroup: HTMLDivElement | any; root?: any }\n >;\n\n valid: boolean;\n parent: IGroup | null;\n isContainer?: boolean;\n // 是否是3d模式(是否应用3d视角)\n in3dMode?: boolean;\n\n // 不考虑transform的宽高,特殊情况下会使用到\n widthWithoutTransform?: number;\n heightWithoutTransform?: number;\n\n // 上次更新的stamp\n stamp?: number;\n animationBackUps?: {\n from: Record<string, any>;\n to: Record<string, any>;\n };\n\n attribute: Partial<T>;\n\n /** 用于实现morph动画场景,转换成bezier曲线渲染 */\n pathProxy?: ICustomPath2D | ((attrs: T) => ICustomPath2D);\n incremental?: number;\n incrementalAt?: number;\n\n /** 记录state对应的图形属性 */\n states?: StateDefinitionsInput<T>;\n effectiveStates?: string[];\n resolvedStatePatch?: Partial<T>;\n normalAttrs?: Partial<T>;\n baseAttributes?: Partial<T>;\n boundSharedStateScope?: SharedStateScope<T>;\n boundSharedStateRevision?: number;\n sharedStateDirty?: boolean;\n registeredActiveScopes?: Set<SharedStateScope<T>>;\n stateMergeMode?: StateMergeMode;\n findFace?: () => IFace3d;\n toggleState: (stateName: string, hasAnimation?: boolean) => void;\n removeState: (stateName: string | string[], hasAnimation?: boolean) => void;\n clearStates: (hasAnimation?: boolean) => void;\n setStates: {\n (states?: string[] | null, hasAnimation?: boolean): void;\n (states?: string[] | null, options?: ISetStatesOptions): void;\n };\n useStates: (states: string[], hasAnimation?: boolean) => void;\n addState: (stateName: string, keepCurrentStates?: boolean, hasAnimation?: boolean) => void;\n invalidateResolver: () => void;\n hasState: (stateName?: string) => boolean;\n getState: (stateName: string) => Partial<T> | StateDefinition<T>;\n onBeforeAttributeUpdate?: (\n val: any,\n attributes: Partial<T>,\n key: null | string | string[],\n context?: ISetAttributeContext\n ) => T | undefined;\n applyStateAttrs: (\n attrs: Partial<T>,\n stateNames: string[],\n hasAnimation?: boolean,\n isClear?: boolean,\n animateConfig?: IAnimateConfig\n ) => void;\n updateNormalAttrs: (stateAttrs: Partial<T>) => void;\n\n // get\n readonly AABBBounds: IAABBBounds; // 用于获取当前节点的AABB包围盒\n readonly OBBBounds: IOBBBounds; // 获取OBB包围盒,旋转防重叠需要用\n readonly globalAABBBounds: IAABBBounds; // 全局AABB包围盒\n readonly transMatrix: IMatrix; // 变换矩阵,动态计算\n readonly globalTransMatrix: IMatrix; // 变换矩阵,动态计算\n\n getOffsetXY: (attr?: ITransform) => IPoint;\n\n // function\n containsPoint: (x: number, y: number, mode?: IContainPointMode, picker?: IPickerService) => boolean;\n\n setMode: (mode: '3d' | '2d') => void;\n isValid: () => boolean;\n\n getClipPath: () => ISymbolClass | null;\n\n // TODO: transform API\n // 基于当前transform的变换,普通用户尽量别用,拿捏不住的~\n translate: (x: number, y: number) => this;\n translateTo: (x: number, y: number) => this;\n scale: (scaleX: number, scaleY: number, scaleCenter?: IPointLike) => this;\n scaleTo: (scaleX: number, scaleY: number) => this;\n rotate: (angle: number, rotateCenter?: IPointLike) => this;\n rotateTo: (angle: number) => this;\n skewTo: (b: number, c: number) => this;\n addUpdateBoundTag: () => void;\n addUpdatePaintTag: () => void;\n addUpdateShapeAndBoundsTag: () => void;\n addUpdateLayoutTag: () => void;\n\n update: (d?: { bounds: boolean; trans: boolean }) => void;\n\n // animate\n animate?: (params?: IGraphicAnimateParams) => IAnimate;\n\n // 语法糖,可有可无,有的为了首屏性能考虑做成get方法,有的由外界直接托管,内部不赋值\n name?: string;\n\n // 供render处理shape缓存tag\n shouldUpdateShape: () => boolean;\n clearUpdateShapeTag: () => void;\n\n // // 供render缓存shape\n // cacheShape?: ICustomPath2D;\n // // 线段使用的path2D\n // cacheLine?: ISegPath2D | ISegPath2D[];\n // // 面积图使用的path2D\n // cacheArea?: IAreaCacheItem | IAreaCacheItem[];\n\n setAttributes: (params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext) => void;\n\n initAttributes: (params: Partial<T>) => void;\n\n setAttribute: (key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) => void;\n\n setStage: (stage?: IStage, layer?: ILayer) => void;\n detachStageForRelease: () => void;\n onSetStage: (cb: (g: IGraphic, stage: IStage) => void) => void;\n\n shouldUpdateAABBBounds: () => boolean;\n shouldSelfChangeUpdateAABBBounds: () => boolean;\n shouldUpdateGlobalMatrix: () => boolean;\n\n addUpdatePositionTag: () => void;\n addUpdateGlobalPositionTag: () => void;\n\n attachShadow: () => IShadowRoot;\n detachShadow: () => void;\n\n toJson: () => IGraphicJson;\n\n /** 创建pathProxy */\n createPathProxy: (path?: string) => void;\n /** 将图形转换成CustomPath2D */\n toCustomPath?: () => ICustomPath2D;\n\n resources?: Map<\n string | HTMLImageElement | HTMLCanvasElement | IBackgroundConfig,\n { state: 'init' | 'loading' | 'success' | 'fail'; data?: HTMLImageElement | HTMLCanvasElement }\n >;\n imageLoadSuccess: (url: string, data: HTMLImageElement) => void;\n imageLoadFail: (url: string) => void;\n\n clone: () => IGraphic;\n stopAnimates: (stopChildren?: boolean) => void;\n getNoWorkAnimateAttr: () => Record<string, number>;\n getGraphicTheme: () => T;\n\n getAttributes: (final?: boolean) => Partial<T>;\n\n pauseAnimation?: (deep?: boolean) => void;\n resumeAnimation?: (deep?: boolean) => void;\n stopAnimation?: (deep?: boolean) => void;\n reApplyAnimationState?: (state: string, deep?: boolean) => this;\n}\n\nexport interface IRoot extends IGraphic {\n pick: (x: number, y: number) => IGraphic;\n}\n\n/**\n * 动画配置\n */\nexport type IAnimateConfig = {\n duration?: number;\n easing?: EasingType;\n noAnimateAttrs?: string[] | Record<string, boolean | number>;\n};\n\nexport type ISetStatesOptions = {\n animate?: boolean;\n animateSameStatePatchChange?: boolean;\n};\n\nexport type GraphicReleaseStatus = 'released' | 'willRelease';\n"]}
1
+ {"version":3,"sources":["../src/interface/graphic.ts"],"names":[],"mappings":"","file":"graphic.js","sourcesContent":["import type { IAABBBounds, IMatrix, IPointLike, IPoint, BoundsAnchorType, IOBBBounds } from '@visactor/vutils';\nimport type { IAnimate, IStep, EasingType, IAnimateTarget, ITimeline } from './animation';\nimport type { IColor } from './color';\nimport type { IGroup } from './graphic/group';\nimport type { IShadowRoot } from './graphic/shadow-root';\nimport type { ILayer } from './layer';\nimport type { INode } from './node-tree';\nimport type { ICustomPath2D } from './path';\nimport type { IStage } from './stage';\nimport type { IGlyphGraphicAttribute } from './graphic/glyph';\nimport type { IContainPointMode } from '../common/enums';\nimport type { IFace3d } from './graphic/face3d';\nimport type { IPickerService } from './picker';\nimport type { ISymbolClass } from './graphic/symbol';\nimport type { StateDefinition, StateDefinitionsInput, StateMergeMode } from '../graphic/state/state-definition';\nimport type { SharedStateScope } from '../graphic/state/shared-state-scope';\n\ntype IStrokeSeg = {\n /**\n * 百分比\n */\n start: number;\n /**\n * 百分比\n * end和length二选一\n */\n end: number;\n /**\n * 像素长度\n */\n length: number;\n};\n\n// TODO 最后加一个any\nexport type GraphicType =\n | 'area'\n | 'circle'\n | 'ellipse'\n | 'line'\n | 'rect'\n | 'rect3d'\n | 'path'\n | 'richtext'\n | 'text'\n | 'arc'\n | 'arc3d'\n | 'image'\n | 'symbol'\n | 'group'\n | 'shadowroot'\n | 'polygon'\n | 'pyramid3d'\n | 'glyph'\n | string;\n\n// Cursor style\n// See: https://developer.mozilla.org/en-US/docs/Web/CSS/cursor\nexport type Cursor =\n | 'auto'\n | 'default'\n | 'none'\n | 'context-menu'\n | 'help'\n | 'pointer'\n | 'progress'\n | 'wait'\n | 'cell'\n | 'crosshair'\n | 'text'\n | 'vertical-text'\n | 'alias'\n | 'copy'\n | 'move'\n | 'no-drop'\n | 'not-allowed'\n | 'grab'\n | 'grabbing'\n | 'all-scroll'\n | 'col-resize'\n | 'row-resize'\n | 'n-resize'\n | 'e-resize'\n | 's-resize'\n | 'w-resize'\n | 'ne-resize'\n | 'nw-resize'\n | 'se-resize'\n | 'sw-resize'\n | 'ew-resize'\n | 'ns-resize'\n | 'nesw-resize'\n | 'nwse-resize'\n | 'zoom-in'\n | 'zoom-out';\n\nexport type ITransform = {\n /**\n * x坐标\n */\n x: number;\n /**\n * y坐标\n */\n y: number;\n /**\n * z坐标\n */\n z: number;\n /**\n * x方向偏移量\n */\n dx: number;\n /**\n * y方向偏移量\n */\n dy: number;\n /**\n * z方向偏移量\n */\n dz: number;\n /**\n * x方向的滚动值\n */\n scrollX: number;\n /**\n * y方向的滚动值\n */\n scrollY: number;\n /**\n * x方向的缩放值\n */\n scaleX: number;\n /**\n * y方向的缩放值\n */\n scaleY: number;\n /**\n * z方向的缩放值\n */\n scaleZ: number;\n /**\n * 绕z轴的转角,即xy平面上的旋转角度\n */\n angle: number;\n /**\n * 绕x轴的转角\n */\n alpha: number;\n /**\n * 绕y轴的转角\n */\n beta: number;\n /**\n * 应用缩放的中心\n */\n scaleCenter: [number | string, number | string];\n /**\n * 基于AABB的锚点位置,用于简单的定位某些path\n */\n anchor: [number | string, number | string];\n /**\n * 3d的锚点位置\n */\n anchor3d: [number | string, number | string, number] | [number | string, number | string];\n /**\n * 处理矩阵,在正常计算完变换矩阵之后,会将该矩阵乘到变换矩阵上得到最终的变换矩阵\n */\n postMatrix: IMatrix;\n};\n\nexport type IFillType = boolean | string | IColor;\nexport type IFillStyle = {\n /**\n * 图形的填充透明度\n */\n fillOpacity: number;\n /**\n * 图形模糊效果程度\n */\n shadowBlur: number;\n /**\n * 图形的阴影颜色\n */\n shadowColor: string;\n /**\n * 阴影水平偏移距离\n */\n shadowOffsetX: number;\n /**\n * 阴影垂直偏移距离\n */\n shadowOffsetY: number;\n /**\n * 图形的填充颜色\n */\n fill: IFillType;\n};\n\nexport type ILayout = {\n /**\n * 设置对齐方式\n */\n alignSelf: 'auto' | 'flex-start' | 'flex-end' | 'center';\n};\n\nexport type IBorderStyle = Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> & {\n /**\n * 边距离边缘的距离\n */\n distance: number | string;\n /**\n * 是否显示边框,默认是不显示的\n */\n visible?: boolean;\n};\n\nexport type IStrokeType = boolean | string | IColor | null;\nexport type IStrokeStyle = {\n /**\n * 外部边框的样式配置,默认不展示外部边框\n */\n outerBorder: Partial<IBorderStyle>;\n /**\n * 内部边框的样式配置\n */\n innerBorder: Partial<IBorderStyle>;\n /**\n * 描边的透明度\n */\n strokeOpacity: number;\n /**\n * 设置线条虚线样式的属性,它通过定义实线和空白的交替长度来创建虚线效果\n */\n lineDash: number[];\n\n /**\n * 设置虚线样式的起始偏移量\n */\n lineDashOffset: number;\n\n /**\n * 设置线条的宽度\n */\n lineWidth: number;\n\n /**\n * 设置线条末端的样式\n */\n lineCap: CanvasLineCap;\n\n /**\n * 设置线条拐角的样式\n */\n lineJoin: CanvasLineJoin;\n\n /**\n * 设置线条拐角处的斜接限制\n */\n miterLimit: number;\n /**\n * 描边的boundsBuffer,用于控制bounds的buffer\n */\n strokeBoundsBuffer: number;\n /**\n * stroke - true 全描边\n * stroke - false/null 不描边\n * stroke 为数值类型,适用于rect\\arc等图形,用于配置部分描边的场景,其中\n *\n * 0b00000 - 不描边\n * 0b000001 - top\n * 0b000010 - right\n * 0b000100 - bottom\n * 0b001000 - left\n * 相应的:\n * 0b000011 - top + right\n * 0b000111 - top + right + bottom\n * 0b001111 - 全描边\n *\n * stroke - boolean[],适用于rect\\arc等图形,用于配置部分描边的场景\n * 对rect分边描边,数组项为false/null时表示对应边不描边\n */\n stroke: IStrokeType[] | IStrokeType;\n};\n\ntype TextureType = 'circle' | 'diamond' | 'rect' | 'vertical-line' | 'horizontal-line' | 'bias-lr' | 'bias-rl' | 'grid';\n\nexport type IConnectedStyle = {\n /**\n * 连接,取零或者断开\n */\n connectedType: 'connect' | 'none';\n /**\n * 连接线的样式配置\n */\n connectedStyle: {\n stroke: IStrokeStyle['stroke'];\n strokeOpacity: IStrokeStyle['strokeOpacity'];\n lineDash: IStrokeStyle['lineDash'];\n lineDashOffset: IStrokeStyle['lineDashOffset'];\n lineCap: IStrokeStyle['lineCap'];\n lineJoin: IStrokeStyle['lineJoin'];\n lineWidth: IStrokeStyle['lineWidth'];\n fill: IFillStyle['fill'];\n fillOpacity: IFillStyle['fillOpacity'];\n };\n connectedX: number;\n connectedY: number;\n};\n\nexport type IBackgroundConfig = {\n stroke?: string | boolean;\n fill?: string | boolean;\n lineWidth?: number;\n cornerRadius?: number;\n expandX?: number;\n expandY?: number;\n};\n\nexport type BackgroundSizing = 'cover' | 'contain' | 'fill' | 'auto';\nexport type BackgroundRepeatMode = 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat';\nexport type BackgroundSizingShorthand = 'no-repeat-cover' | 'no-repeat-contain' | 'no-repeat-fill' | 'no-repeat-auto';\nexport type BackgroundMode = BackgroundRepeatMode | BackgroundSizingShorthand;\nexport type BackgroundPositionHorizontalKeyword = 'left' | 'center' | 'right';\nexport type BackgroundPositionVerticalKeyword = 'top' | 'center' | 'bottom';\nexport type BackgroundPositionKeyword = BackgroundPositionHorizontalKeyword | BackgroundPositionVerticalKeyword;\nexport type BackgroundPositionPercent = `${number}%`;\nexport type BackgroundPositionValue = number | BackgroundPositionKeyword | BackgroundPositionPercent;\nexport type BackgroundPositionPreset =\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'center-left'\n | 'center'\n | 'center-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right';\nexport type BackgroundPosition =\n | BackgroundPositionKeyword\n | BackgroundPositionPreset\n | [BackgroundPositionValue, BackgroundPositionValue];\n\nexport type IBackgroundType = string | HTMLImageElement | HTMLCanvasElement | IBackgroundConfig;\n\nexport interface SimpleDomStyleOptions {\n /**\n * 容器的宽度\n */\n width: number;\n /**\n * 容器的高度\n */\n height: number;\n /**\n * 容器的样式设置\n */\n style?:\n | string\n | Record<string, any>\n | ((\n pos: { top: number; left: number; width: number; height: number },\n graphic: IGraphic,\n wrapContainer: HTMLElement\n ) => Record<string, any>); // 容器的样式\n}\n\nexport interface CommonDomOptions {\n /**\n * 全局唯一的id\n */\n id?: string;\n /**\n * 容器元素的id或者dom元素\n */\n container: string | HTMLElement | null;\n /**\n * 是否显示\n */\n visible?: boolean;\n /**\n * 是否支持事件冒泡\n */\n pointerEvents?: boolean | string;\n /**\n * 可穿透的事件列表\n * @since 0.21.2\n */\n penetrateEventList?: string[];\n /**\n * 定位类型\n * 'position' - 根据挂载图形节点的坐标也就是x,y进行定位\n * 'boundsLeftTop' - 定位到挂载图形节点bounds的左上角\n * 'left' - 定位到挂载图形节点bounds 的左侧\n * 'right' - 定位到挂载图形节点bounds 的右侧\n * 'bottom' - 定位到挂载图形节点bounds 的底部\n * 'top' - 定位到挂载图形节点bounds 的顶部\n * 'center' - 定位到挂载图形节点bounds 的中心\n * 'top-left' - 定位到挂载图形节点bounds 的左上角\n * 'top-right' - 定位到挂载图形节点bounds 的右上角\n * 'bottom-left' - 定位到挂载图形节点bounds 的左下角\n * 'bottom-right' - 定位到挂载图形节点bounds 的右下角\n */\n anchorType?: 'position' | 'boundsLeftTop' | BoundsAnchorType;\n}\n\nexport type IRoughStyle = {\n fillStyle: 'hachure' | 'solid' | 'zigzag' | 'cross-hatch' | 'dots' | 'sunburst' | 'dashed' | 'zigzag-line';\n roughness: number;\n bowing: number;\n};\n\nexport type IGraphicStyle = ILayout &\n IFillStyle &\n IStrokeStyle &\n IPickStyle & {\n /**\n * 强制设置的bounds宽度,主要用于使用html或者react展示图形的时候,设置一个固定的宽度\n */\n forceBoundsWidth: number | (() => number) | undefined;\n /**\n * 强制设置的bounds高度,主要用于使用html或者react展示图形的时候,设置一个固定的高度\n */\n forceBoundsHeight: number | (() => number) | undefined;\n /**\n * 透明度,会同时影响填充和描边\n */\n opacity: number;\n /**\n * 影子节点\n */\n shadowGraphic?: IGraphic | undefined;\n /**\n * 背景填充模式(与具体图元有关)\n */\n backgroundMode: BackgroundMode;\n /**\n * 是否正好填充,只在repeat-x或者repeat-y以及no-repeat的时候生效\n */\n backgroundFit: boolean;\n /**\n * 是否保持背景图的宽高比\n */\n backgroundKeepAspectRatio: boolean;\n /**\n * 背景图缩放,只在no-repeat的时候生效\n */\n backgroundScale: number;\n /**\n * 背景图偏移,只在no-repeat的时候生效\n */\n backgroundOffsetX: number;\n /**\n * 背景图偏移,只在no-repeat的时候生效\n */\n backgroundOffsetY: number;\n /**\n * 背景图锚定位置(类似 CSS background-position),仅在 no-repeat 的图片背景下生效。\n */\n backgroundPosition: BackgroundPosition;\n /**\n * 背景图是否裁切,是否调用clip避免绘制到图元外部\n */\n backgroundClip: boolean;\n /**\n * 背景圆角半径\n */\n backgroundCornerRadius: number | number[];\n /**\n * 背景透明度\n */\n backgroundOpacity: number;\n /**\n * 背景,支持颜色字符串、html image元素、html canvas元素\n */\n // 纹理是否自动做动画\n autoAnimateTexture: boolean;\n // 如果做动画的话,这里代表ratio\n textureRatio: number;\n textureOptions: any;\n background:\n | IBackgroundType\n | {\n /**\n * 背景,支持颜色字符串、html image元素、html canvas元素\n */\n background: IBackgroundType;\n /**\n * 背景的x方向偏移量\n */\n dx?: number;\n /**\n * 背景的y方向偏移量\n */\n dy?: number;\n /**\n * 背景宽度\n */\n width?: number;\n /**\n * 背景高度\n */\n height?: number;\n /**\n * 背景的x坐标\n */\n x?: number;\n /**\n * 背景的y坐标\n */\n y?: number;\n }\n | null; // 背景,可以与fill同时存在\n /**\n * 纹理的类型\n */\n texture: TextureType | string;\n /**\n * 纹理的颜色\n */\n textureColor: string;\n /**\n * 纹理的大小\n */\n textureSize: number;\n /**\n * 纹理的间隙\n */\n texturePadding: number;\n\n blur: number;\n /**\n * 设置图形对应的鼠标样式\n */\n cursor: Cursor | null;\n // @deprecated 用处少废弃,后续考虑新设计API\n filter: string;\n renderStyle?: 'default' | 'rough' | any;\n roughStyle?: IRoughStyle | null;\n /**\n * HTML的dom或者string\n */\n html:\n | ({\n /**\n * dom字符串或者dom\n */\n dom: string | HTMLElement;\n } & SimpleDomStyleOptions &\n CommonDomOptions)\n | null;\n /**\n * 使用react元素渲染内容\n */\n react:\n | ({\n /**\n * react场景节点\n */\n element: any;\n } & SimpleDomStyleOptions &\n CommonDomOptions)\n | null;\n /**\n * 使用vue组件渲染内容\n */\n vue:\n | ({\n /**\n * vue 虚拟节点\n */\n element: any;\n } & SimpleDomStyleOptions &\n CommonDomOptions)\n | null;\n };\n\nexport type IPickStyle = {\n /**\n * 给stroke模式的pick额外加的buffer,用于外界控制stroke区域的pick范围\n */\n pickStrokeBuffer: number;\n};\n\nexport type IDebugType = {\n _debug_bounds: boolean | ((c: any, g: any) => void);\n};\nexport type IGraphicAttribute = IDebugType &\n IGraphicStyle &\n ITransform & {\n /**\n * stroke百分比\n */\n strokeSeg: IStrokeSeg | null;\n /**\n * 包围盒的padding\n */\n boundsPadding: number | number[];\n /**\n * 选择模式,精确模式,粗糙模式(包围盒模式),自定义模式\n */\n pickMode: 'accurate' | 'imprecise' | 'custom';\n boundsMode: 'accurate' | 'imprecise' | 'empty';\n customPickShape: () => boolean | null;\n /**\n * 是否支持事件拾取,默认为 true。\n * @default true\n */\n pickable: boolean;\n /**\n * 是否支持fill拾取,默认为 true。\n * @experimental\n * @default true\n */\n fillPickable: boolean;\n /**\n * 是否支持stroke拾取,默认为 true。\n * @experimental\n * @default true\n */\n strokePickable: boolean;\n /**\n * 对于 group 节点,是否支持其子元素的事件拾取,默认为 true。\n * 如果 group `pickable` 关闭,`childrenPickable` 开启,那么 group 的子节点仍参与事件拾取\n * @default true\n */\n childrenPickable: boolean;\n /**\n * 元素是否可见。\n * @default true\n */\n visible: boolean;\n /**\n * 分组下的层级,层级越小越先绘制\n */\n zIndex: number;\n layout: any;\n /**\n * 是否隐藏元素(只是绘制的时候不绘制)\n */\n renderable: boolean;\n /**\n * 是否在3d中控制方向\n * false: 不控制方向\n * true: 始终控制方向朝摄像机\n */\n keepDirIn3d?: boolean;\n shadowRootIdx: number;\n shadowPickMode?: 'full' | 'graphic';\n /**\n * 全局范围的层级,设置了这个属性的图形,会提取到交互层进行渲染\n */\n globalZIndex: number;\n /**\n * canvas 的合成方式\n */\n globalCompositeOperation: CanvasRenderingContext2D['globalCompositeOperation'] | '';\n /**\n * 完全支持滚动 | 完全不支持滚动 | 支持x方向的滚动 | 支持y方向的滚动\n */\n overflow: 'scroll' | 'hidden' | 'scroll-x' | 'scroll-y';\n /**\n * 绘制fill和stroke的顺序,为0表示fill先绘制,1表示stroke先绘制\n */\n fillStrokeOrder: number;\n /**\n * @since 0.20.15\n * 保持stroke的scale,默认为false,为true的话stroke显示的宽度会随着scale变化\n */\n keepStrokeScale: boolean;\n\n /**\n * @since 0.22.2\n * 裁剪路径,用于裁剪图形,用于普通图元的裁剪\n * 由于一般情况下普通图元只需要一个形状即可,所以这里不需要配置具体的位置和大小,强制中心在图元中心,宽高和图元Bounds宽高一致\n * 不考虑其他复杂情况,否则配置项就非常多了,比如多路径,或者配置位置大小等,如果配置大小那还得用户自己去拿图元的大小,目前没有这种需求\n */\n clipConfig: {\n shape: string;\n } | null;\n };\n\nexport interface IGraphicJson<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>> {\n attribute: Partial<T>;\n baseAttributes?: Partial<T>;\n _uid: number;\n type: string;\n name: string;\n children: IGraphicJson<T>[];\n}\n\n/** the context of setAttribute */\nexport type ISetAttributeContext = {\n /** type of setAttribute */\n type?: number;\n animationState?: {\n step?: IStep;\n isFirstFrameOfStep?: boolean;\n /** ratio of animation */\n ratio?: number;\n /** is animation end? */\n end?: boolean;\n };\n skipUpdateCallback?: boolean;\n};\n\nexport type IGraphicAnimateParams = {\n slience?: boolean;\n id?: number | string;\n timeline?: ITimeline;\n onStart?: () => void;\n onFrame?: (step: IStep, ratio: number) => void;\n onEnd?: () => void;\n onRemove?: () => void;\n interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n};\n\nexport interface IGraphic<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>>\n extends INode,\n IAnimateTarget {\n type?: GraphicType;\n numberType?: number;\n stage?: IStage;\n layer?: ILayer;\n shadowRoot?: IShadowRoot;\n glyphHost?: IGraphic<IGlyphGraphicAttribute>;\n backgroundImg?: boolean;\n attachedThemeGraphic?: IGraphic<any>;\n /**\n * 保存语法上下文\n */\n context?: Record<string, any>;\n bindDom?: Map<\n string | HTMLElement,\n { container: HTMLElement | string; dom: HTMLElement | any; wrapGroup: HTMLDivElement | any; root?: any }\n >;\n\n valid: boolean;\n parent: IGroup | null;\n isContainer?: boolean;\n // 是否是3d模式(是否应用3d视角)\n in3dMode?: boolean;\n\n // 不考虑transform的宽高,特殊情况下会使用到\n widthWithoutTransform?: number;\n heightWithoutTransform?: number;\n\n // 上次更新的stamp\n stamp?: number;\n animationBackUps?: {\n from: Record<string, any>;\n to: Record<string, any>;\n };\n\n attribute: Partial<T>;\n\n /** 用于实现morph动画场景,转换成bezier曲线渲染 */\n pathProxy?: ICustomPath2D | ((attrs: T) => ICustomPath2D);\n incremental?: number;\n incrementalAt?: number;\n\n /** 记录state对应的图形属性 */\n states?: StateDefinitionsInput<T>;\n effectiveStates?: string[];\n resolvedStatePatch?: Partial<T>;\n normalAttrs?: Partial<T>;\n baseAttributes?: Partial<T>;\n boundSharedStateScope?: SharedStateScope<T>;\n boundSharedStateRevision?: number;\n sharedStateDirty?: boolean;\n registeredActiveScopes?: Set<SharedStateScope<T>>;\n stateMergeMode?: StateMergeMode;\n findFace?: () => IFace3d;\n toggleState: (stateName: string, hasAnimation?: boolean) => void;\n removeState: (stateName: string | string[], hasAnimation?: boolean) => void;\n clearStates: (hasAnimation?: boolean) => void;\n setStates: {\n (states?: string[] | null, hasAnimation?: boolean): void;\n (states?: string[] | null, options?: ISetStatesOptions): void;\n };\n useStates: (states: string[], hasAnimation?: boolean) => void;\n addState: (stateName: string, keepCurrentStates?: boolean, hasAnimation?: boolean) => void;\n invalidateResolver: () => void;\n hasState: (stateName?: string) => boolean;\n getState: (stateName: string) => Partial<T> | StateDefinition<T>;\n onBeforeAttributeUpdate?: (\n val: any,\n attributes: Partial<T>,\n key: null | string | string[],\n context?: ISetAttributeContext\n ) => T | undefined;\n applyStateAttrs: (\n attrs: Partial<T>,\n stateNames: string[],\n hasAnimation?: boolean,\n isClear?: boolean,\n animateConfig?: IAnimateConfig\n ) => void;\n updateNormalAttrs: (stateAttrs: Partial<T>) => void;\n\n // get\n readonly AABBBounds: IAABBBounds; // 用于获取当前节点的AABB包围盒\n readonly OBBBounds: IOBBBounds; // 获取OBB包围盒,旋转防重叠需要用\n readonly globalAABBBounds: IAABBBounds; // 全局AABB包围盒\n readonly transMatrix: IMatrix; // 变换矩阵,动态计算\n readonly globalTransMatrix: IMatrix; // 变换矩阵,动态计算\n\n getOffsetXY: (attr?: ITransform) => IPoint;\n\n // function\n containsPoint: (x: number, y: number, mode?: IContainPointMode, picker?: IPickerService) => boolean;\n\n setMode: (mode: '3d' | '2d') => void;\n isValid: () => boolean;\n\n getClipPath: () => ISymbolClass | null;\n\n // TODO: transform API\n // 基于当前transform的变换,普通用户尽量别用,拿捏不住的~\n translate: (x: number, y: number) => this;\n translateTo: (x: number, y: number) => this;\n scale: (scaleX: number, scaleY: number, scaleCenter?: IPointLike) => this;\n scaleTo: (scaleX: number, scaleY: number) => this;\n rotate: (angle: number, rotateCenter?: IPointLike) => this;\n rotateTo: (angle: number) => this;\n skewTo: (b: number, c: number) => this;\n addUpdateBoundTag: () => void;\n addUpdatePaintTag: () => void;\n addUpdateShapeAndBoundsTag: () => void;\n addUpdateLayoutTag: () => void;\n\n update: (d?: { bounds: boolean; trans: boolean }) => void;\n\n // animate\n animate?: (params?: IGraphicAnimateParams) => IAnimate;\n\n // 语法糖,可有可无,有的为了首屏性能考虑做成get方法,有的由外界直接托管,内部不赋值\n name?: string;\n\n // 供render处理shape缓存tag\n shouldUpdateShape: () => boolean;\n clearUpdateShapeTag: () => void;\n\n // // 供render缓存shape\n // cacheShape?: ICustomPath2D;\n // // 线段使用的path2D\n // cacheLine?: ISegPath2D | ISegPath2D[];\n // // 面积图使用的path2D\n // cacheArea?: IAreaCacheItem | IAreaCacheItem[];\n\n setAttributes: (params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext) => void;\n\n initAttributes: (params: Partial<T>) => void;\n\n setAttribute: (key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) => void;\n\n setStage: (\n stage?: IStage,\n layer?: ILayer,\n inheritedSharedStateScope?: SharedStateScope<Record<string, any>> | null\n ) => void;\n detachStageForRelease: () => void;\n onSetStage: (cb: (g: IGraphic, stage: IStage) => void) => void;\n\n shouldUpdateAABBBounds: () => boolean;\n shouldSelfChangeUpdateAABBBounds: () => boolean;\n shouldUpdateGlobalMatrix: () => boolean;\n\n addUpdatePositionTag: () => void;\n addUpdateGlobalPositionTag: () => void;\n\n attachShadow: () => IShadowRoot;\n detachShadow: () => void;\n\n toJson: () => IGraphicJson;\n\n /** 创建pathProxy */\n createPathProxy: (path?: string) => void;\n /** 将图形转换成CustomPath2D */\n toCustomPath?: () => ICustomPath2D;\n\n resources?: Map<\n string | HTMLImageElement | HTMLCanvasElement | IBackgroundConfig,\n { state: 'init' | 'loading' | 'success' | 'fail'; data?: HTMLImageElement | HTMLCanvasElement }\n >;\n imageLoadSuccess: (url: string, data: HTMLImageElement) => void;\n imageLoadFail: (url: string) => void;\n\n clone: () => IGraphic;\n stopAnimates: (stopChildren?: boolean) => void;\n getNoWorkAnimateAttr: () => Record<string, number>;\n getGraphicTheme: () => T;\n\n getAttributes: (final?: boolean) => Partial<T>;\n\n pauseAnimation?: (deep?: boolean) => void;\n resumeAnimation?: (deep?: boolean) => void;\n stopAnimation?: (deep?: boolean) => void;\n reApplyAnimationState?: (state: string, deep?: boolean) => this;\n}\n\nexport interface IRoot extends IGraphic {\n pick: (x: number, y: number) => IGraphic;\n}\n\n/**\n * 动画配置\n */\nexport type IAnimateConfig = {\n duration?: number;\n easing?: EasingType;\n noAnimateAttrs?: string[] | Record<string, boolean | number>;\n};\n\nexport type ISetStatesOptions = {\n animate?: boolean;\n animateSameStatePatchChange?: boolean;\n};\n\nexport type GraphicReleaseStatus = 'released' | 'willRelease';\n"]}
@@ -1,6 +1,7 @@
1
1
  import type { IEventElement, Releaseable } from './common';
2
2
  import type { ILayer } from './layer';
3
3
  import type { IStage } from './stage';
4
+ import type { SharedStateScope } from '../graphic/state/shared-state-scope';
4
5
  export interface INode extends Releaseable, IEventElement {
5
6
  _prev?: INode;
6
7
  _next?: INode;
@@ -24,7 +25,7 @@ export interface INode extends Releaseable, IEventElement {
24
25
  forEachChildrenAsync: (cb: (n: INode, i: number) => Promise<void | boolean> | void | boolean, reverse?: boolean) => Promise<void>;
25
26
  appendChild: (node: INode, highPerformance?: boolean) => INode | null;
26
27
  add: (node: INode, highPerformance?: boolean) => INode | null;
27
- onParentSharedStateTreeChanged: (stage?: IStage, layer?: ILayer) => void;
28
+ onParentSharedStateTreeChanged: (stage?: IStage, layer?: ILayer, inheritedSharedStateScope?: SharedStateScope<Record<string, any>> | null) => void;
28
29
  delete: () => void;
29
30
  removeChild: (node: INode, highPerformance?: boolean) => INode | null;
30
31
  removeAllChild: (deep?: boolean) => void;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/node-tree.ts"],"names":[],"mappings":"","file":"node-tree.js","sourcesContent":["import type { IEventElement, Releaseable } from './common';\nimport type { ILayer } from './layer';\nimport type { IStage } from './stage';\n\nexport interface INode extends Releaseable, IEventElement {\n _prev?: INode;\n _next?: INode;\n /**\n * 内部图形的唯一标识\n */\n _uid: number;\n\n /**\n * 用户配置的图形唯一标识\n */\n id?: number | string;\n /** 图形名称标识 */\n name?: string;\n /**\n * 图形类型\n */\n type?: string;\n parent: INode | null;\n // dirty: boolean; // 脏位,标记当前节点和子节点是否有修改\n count: number;\n childrenCount: number;\n firstChild: INode | null;\n lastChild: INode | null;\n /**\n * 获取子节点数组\n */\n getChildren: () => INode[];\n /**\n * 获取某个idx的节点\n */\n getChildAt: (idx: number) => INode | null;\n at: (idx: number) => INode | null;\n\n insertBefore: (newNode: INode, referenceNode: INode) => INode | null;\n insertAfter: (newNode: INode, referenceNode: INode) => INode | null;\n\n /**\n * 向某个位置插入\n */\n insertInto: (ele: INode, idx: number) => INode | null;\n\n insertIntoKeepIdx: (ele: INode, idx: number) => INode | null;\n /**\n * 遍历子节点\n * @param cb 返回true则停止遍历\n */\n forEachChildren: (cb: (n: INode, i: number) => void | boolean, reverse?: boolean) => void;\n forEachChildrenAsync: (\n cb: (n: INode, i: number) => Promise<void | boolean> | void | boolean,\n reverse?: boolean\n ) => Promise<void>;\n /**\n * 添加子节点\n * @param node\n * @param highPerformance 是否高性能模式(不检查是否合法)\n */\n appendChild: (node: INode, highPerformance?: boolean) => INode | null;\n /**\n * 添加子节点\n * @param node\n * @param highPerformance 是否高性能模式(不检查是否合法)\n */\n add: (node: INode, highPerformance?: boolean) => INode | null;\n /**\n * Rebinds stage/layer derived state when this node is attached to a different parent tree.\n */\n onParentSharedStateTreeChanged: (stage?: IStage, layer?: ILayer) => void;\n /**\n * 从当前节点的父节点删除当前节点\n */\n delete: () => void;\n /**\n * 删除节点\n * @param node\n * @param highPerformance 是否高性能模式;仅用于释放/批量清理,跳过更新和通知链路\n */\n removeChild: (node: INode, highPerformance?: boolean) => INode | null;\n /**\n * 移除所有节点\n */\n removeAllChild: (deep?: boolean) => void;\n /**\n * 判断该节点是否是node的子节点\n * @param node\n */\n isChildOf: (node: INode) => boolean;\n /**\n * 判断该节点是否是node的父节点\n * @param node\n */\n isParentOf: (node: INode) => boolean;\n /**\n * 判断节点是否是node的后代节点\n * @param node\n */\n isDescendantsOf: (node: INode) => boolean;\n /**\n * 判断节点是否是node的祖先节点\n * @param node\n */\n isAncestorsOf: (node: INode) => boolean;\n\n // 事件相关的别名\n /**\n * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.\n * */\n dispatchEvent: (event: Event) => boolean;\n\n /**\n * 返回的是一个布尔值,来表示传入的节点是否为该节点的后代节点。\n * @param node 判断是否包含的节点\n */\n containNode: (node: INode) => boolean;\n\n /**\n * 设置该节点的所有后代节点某个属性\n * @param propsName 属性名\n * @param propsValue 属性值\n */\n setAllDescendantsProps: (propsName: string, propsValue: any) => any;\n\n // 查找相关的接口\n /**\n * 根据自定义逻辑查找元素,返回单一图形元素\n * @param callback 自定义查找过滤器\n * @param deep 是否进行深度查找,默认为 false\n * @returns 返回匹配的图形元素\n */\n find: (callback: (node: INode, index: number) => boolean, deep: boolean) => INode | null;\n /**\n * 根据自定义逻辑查找元素,返回匹配的元素集合\n * @param callback 自定义查找过滤器\n * @param deep 是否进行深度查找,默认为 false\n * @returns 返回匹配的图形元素集合\n */\n findAll: (callback: (node: INode, index: number) => boolean, deep: boolean) => INode[];\n /**\n * 通过用户设置的 id 查找对应的图形元素\n * @param id 子节点的 id\n */\n getElementById: (id: string | number) => INode | null;\n /**\n * @alias getElementById\n * 通过用户设置的 id 查找对应的图形元素\n * @param id 子节点的 id\n */\n findChildById: (id: string | number) => INode | null;\n /**\n * 通过内部生成的节点 id:_uid 查找对应的图形元素\n * @param id 子节点的key\n */\n findChildByUid: (uid: number) => INode | null;\n /**\n * 根据用户传入的 name 查找元素,返回匹配的元素集合\n * @param name 用户设置的图形名称\n * @returns 匹配 name 的元素集合\n */\n getElementsByName: (name: string) => INode[];\n /**\n * @alias getElementsByName\n * 根据用户传入的 name 查找元素,返回匹配的元素集合\n * @param name 用户设置的图形名称\n * @returns 匹配 name 的元素集合\n */\n findChildrenByName: (name: string) => INode[];\n /**\n * 根据用户传入的 name 查找元素,返回匹配的元素集合\n * @param name 用户设置的图形名称\n * @returns 匹配 name 的元素集合\n */\n getElementsByType: (type: string) => INode[];\n // 其他不常用\n\n [key: string]: any;\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/node-tree.ts"],"names":[],"mappings":"","file":"node-tree.js","sourcesContent":["import type { IEventElement, Releaseable } from './common';\nimport type { ILayer } from './layer';\nimport type { IStage } from './stage';\nimport type { SharedStateScope } from '../graphic/state/shared-state-scope';\n\nexport interface INode extends Releaseable, IEventElement {\n _prev?: INode;\n _next?: INode;\n /**\n * 内部图形的唯一标识\n */\n _uid: number;\n\n /**\n * 用户配置的图形唯一标识\n */\n id?: number | string;\n /** 图形名称标识 */\n name?: string;\n /**\n * 图形类型\n */\n type?: string;\n parent: INode | null;\n // dirty: boolean; // 脏位,标记当前节点和子节点是否有修改\n count: number;\n childrenCount: number;\n firstChild: INode | null;\n lastChild: INode | null;\n /**\n * 获取子节点数组\n */\n getChildren: () => INode[];\n /**\n * 获取某个idx的节点\n */\n getChildAt: (idx: number) => INode | null;\n at: (idx: number) => INode | null;\n\n insertBefore: (newNode: INode, referenceNode: INode) => INode | null;\n insertAfter: (newNode: INode, referenceNode: INode) => INode | null;\n\n /**\n * 向某个位置插入\n */\n insertInto: (ele: INode, idx: number) => INode | null;\n\n insertIntoKeepIdx: (ele: INode, idx: number) => INode | null;\n /**\n * 遍历子节点\n * @param cb 返回true则停止遍历\n */\n forEachChildren: (cb: (n: INode, i: number) => void | boolean, reverse?: boolean) => void;\n forEachChildrenAsync: (\n cb: (n: INode, i: number) => Promise<void | boolean> | void | boolean,\n reverse?: boolean\n ) => Promise<void>;\n /**\n * 添加子节点\n * @param node\n * @param highPerformance 是否高性能模式(不检查是否合法)\n */\n appendChild: (node: INode, highPerformance?: boolean) => INode | null;\n /**\n * 添加子节点\n * @param node\n * @param highPerformance 是否高性能模式(不检查是否合法)\n */\n add: (node: INode, highPerformance?: boolean) => INode | null;\n /**\n * Rebinds stage/layer derived state when this node is attached to a different parent tree.\n */\n onParentSharedStateTreeChanged: (\n stage?: IStage,\n layer?: ILayer,\n inheritedSharedStateScope?: SharedStateScope<Record<string, any>> | null\n ) => void;\n /**\n * 从当前节点的父节点删除当前节点\n */\n delete: () => void;\n /**\n * 删除节点\n * @param node\n * @param highPerformance 是否高性能模式;仅用于释放/批量清理,跳过更新和通知链路\n */\n removeChild: (node: INode, highPerformance?: boolean) => INode | null;\n /**\n * 移除所有节点\n */\n removeAllChild: (deep?: boolean) => void;\n /**\n * 判断该节点是否是node的子节点\n * @param node\n */\n isChildOf: (node: INode) => boolean;\n /**\n * 判断该节点是否是node的父节点\n * @param node\n */\n isParentOf: (node: INode) => boolean;\n /**\n * 判断节点是否是node的后代节点\n * @param node\n */\n isDescendantsOf: (node: INode) => boolean;\n /**\n * 判断节点是否是node的祖先节点\n * @param node\n */\n isAncestorsOf: (node: INode) => boolean;\n\n // 事件相关的别名\n /**\n * Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.\n * */\n dispatchEvent: (event: Event) => boolean;\n\n /**\n * 返回的是一个布尔值,来表示传入的节点是否为该节点的后代节点。\n * @param node 判断是否包含的节点\n */\n containNode: (node: INode) => boolean;\n\n /**\n * 设置该节点的所有后代节点某个属性\n * @param propsName 属性名\n * @param propsValue 属性值\n */\n setAllDescendantsProps: (propsName: string, propsValue: any) => any;\n\n // 查找相关的接口\n /**\n * 根据自定义逻辑查找元素,返回单一图形元素\n * @param callback 自定义查找过滤器\n * @param deep 是否进行深度查找,默认为 false\n * @returns 返回匹配的图形元素\n */\n find: (callback: (node: INode, index: number) => boolean, deep: boolean) => INode | null;\n /**\n * 根据自定义逻辑查找元素,返回匹配的元素集合\n * @param callback 自定义查找过滤器\n * @param deep 是否进行深度查找,默认为 false\n * @returns 返回匹配的图形元素集合\n */\n findAll: (callback: (node: INode, index: number) => boolean, deep: boolean) => INode[];\n /**\n * 通过用户设置的 id 查找对应的图形元素\n * @param id 子节点的 id\n */\n getElementById: (id: string | number) => INode | null;\n /**\n * @alias getElementById\n * 通过用户设置的 id 查找对应的图形元素\n * @param id 子节点的 id\n */\n findChildById: (id: string | number) => INode | null;\n /**\n * 通过内部生成的节点 id:_uid 查找对应的图形元素\n * @param id 子节点的key\n */\n findChildByUid: (uid: number) => INode | null;\n /**\n * 根据用户传入的 name 查找元素,返回匹配的元素集合\n * @param name 用户设置的图形名称\n * @returns 匹配 name 的元素集合\n */\n getElementsByName: (name: string) => INode[];\n /**\n * @alias getElementsByName\n * 根据用户传入的 name 查找元素,返回匹配的元素集合\n * @param name 用户设置的图形名称\n * @returns 匹配 name 的元素集合\n */\n findChildrenByName: (name: string) => INode[];\n /**\n * 根据用户传入的 name 查找元素,返回匹配的元素集合\n * @param name 用户设置的图形名称\n * @returns 匹配 name 的元素集合\n */\n getElementsByType: (type: string) => INode[];\n // 其他不常用\n\n [key: string]: any;\n}\n"]}
package/dist/index.es.js CHANGED
@@ -711,7 +711,7 @@ class Node extends EventEmitter {
711
711
  this.parent = null;
712
712
  this._count = 1;
713
713
  }
714
- onParentSharedStateTreeChanged(_stage, _layer) {
714
+ onParentSharedStateTreeChanged(_stage, _layer, _inheritedSharedStateScope) {
715
715
  return;
716
716
  }
717
717
  forEachChildren(cb, reverse = false) {
@@ -9222,6 +9222,10 @@ class StateEngine {
9222
9222
  this.baseAttributes = baseAttributes;
9223
9223
  }
9224
9224
  applyStates(stateNames) {
9225
+ const singleStaticStateResult = this.tryApplySingleStaticState(stateNames);
9226
+ if (singleStaticStateResult) {
9227
+ return singleStaticStateResult;
9228
+ }
9225
9229
  const uniqueStates = Array.from(new Set(stateNames));
9226
9230
  const sortedStates = this.sortStates(uniqueStates);
9227
9231
  const adjudicated = this.adjudicate(sortedStates);
@@ -9244,6 +9248,36 @@ class StateEngine {
9244
9248
  suppressed: [...this._suppressed]
9245
9249
  };
9246
9250
  }
9251
+ tryApplySingleStaticState(stateNames) {
9252
+ if (stateNames.length !== 1 || this.mergeMode !== 'shallow') {
9253
+ return undefined;
9254
+ }
9255
+ const stateName = stateNames[0];
9256
+ const definition = this.compiledDefinitions.get(stateName);
9257
+ if (definition && (definition.hasResolver || definition.exclude.size || definition.suppress.size)) {
9258
+ return undefined;
9259
+ }
9260
+ const changed = this._activeStates.length !== 1 ||
9261
+ this._activeStates[0] !== stateName ||
9262
+ this._effectiveStates.length !== 1 ||
9263
+ this._effectiveStates[0] !== stateName ||
9264
+ this._suppressed.length !== 0;
9265
+ this._activeStates = [stateName];
9266
+ this._effectiveStates = [stateName];
9267
+ this._suppressed = [];
9268
+ if (changed || !this.resolverCacheValid) {
9269
+ this.resolverPatchCache.clear();
9270
+ this.resolverCacheKey = stateName;
9271
+ this.resolverCacheValid = true;
9272
+ this._resolvedPatch = (definition === null || definition === void 0 ? void 0 : definition.patch) ? cloneValue(definition.patch) : {};
9273
+ }
9274
+ return {
9275
+ changed,
9276
+ activeStates: [...this._activeStates],
9277
+ effectiveStates: [...this._effectiveStates],
9278
+ suppressed: []
9279
+ };
9280
+ }
9247
9281
  addState(stateName, keepCurrentStates) {
9248
9282
  if (this._activeStates.includes(stateName) && (keepCurrentStates || this._activeStates.length === 1)) {
9249
9283
  return {
@@ -9875,12 +9909,12 @@ const NOWORK_ANIMATE_ATTR = {
9875
9909
  cursor: 1,
9876
9910
  html: 1
9877
9911
  };
9878
- class Graphic extends Node {
9912
+ class GraphicImpl extends Node {
9879
9913
  static mixin(source) {
9880
9914
  const keys = Object.keys(source);
9881
9915
  for (let i = 0; i < keys.length; ++i) {
9882
9916
  const propertyName = keys[i];
9883
- Object.defineProperty(Graphic.prototype, propertyName, Object.getOwnPropertyDescriptor(source, propertyName));
9917
+ Object.defineProperty(this.prototype, propertyName, Object.getOwnPropertyDescriptor(source, propertyName));
9884
9918
  }
9885
9919
  }
9886
9920
  get AABBBounds() {
@@ -9960,9 +9994,8 @@ class Graphic extends Node {
9960
9994
  }
9961
9995
  return (_a = this.stage) === null || _a === void 0 ? void 0 : _a.rootSharedStateScope;
9962
9996
  }
9963
- syncSharedStateScopeBindingFromTree(markDirty = true) {
9997
+ syncSharedStateScopeBinding(nextScope, markDirty = true) {
9964
9998
  var _a;
9965
- const nextScope = this.resolveBoundSharedStateScope();
9966
9999
  if (this.boundSharedStateScope === nextScope) {
9967
10000
  this.syncSharedStateActiveRegistrations();
9968
10001
  return false;
@@ -9979,7 +10012,13 @@ class Graphic extends Node {
9979
10012
  }
9980
10013
  return true;
9981
10014
  }
9982
- syncSharedStateScopeBindingOnTreeChange(markDirty = true) {
10015
+ syncSharedStateScopeBindingFromTree(markDirty = true, inheritedSharedStateScope) {
10016
+ const nextScope = inheritedSharedStateScope === undefined
10017
+ ? this.resolveBoundSharedStateScope()
10018
+ : inheritedSharedStateScope !== null && inheritedSharedStateScope !== void 0 ? inheritedSharedStateScope : undefined;
10019
+ return this.syncSharedStateScopeBinding(nextScope, markDirty);
10020
+ }
10021
+ syncSharedStateScopeBindingOnTreeChange(markDirty = true, inheritedSharedStateScope) {
9983
10022
  var _a, _b;
9984
10023
  if (!((_a = this.currentStates) === null || _a === void 0 ? void 0 : _a.length) &&
9985
10024
  !this.boundSharedStateScope &&
@@ -9987,7 +10026,7 @@ class Graphic extends Node {
9987
10026
  !this.sharedStateDirty) {
9988
10027
  return false;
9989
10028
  }
9990
- return this.syncSharedStateScopeBindingFromTree(markDirty);
10029
+ return this.syncSharedStateScopeBindingFromTree(markDirty, inheritedSharedStateScope);
9991
10030
  }
9992
10031
  syncSharedStateActiveRegistrations() {
9993
10032
  var _a;
@@ -10002,6 +10041,9 @@ class Graphic extends Node {
10002
10041
  this.registeredActiveScopes = undefined;
10003
10042
  return;
10004
10043
  }
10044
+ if ((previousScopes === null || previousScopes === void 0 ? void 0 : previousScopes.size) && this.isSharedStateScopeChainRegistered(previousScopes)) {
10045
+ return;
10046
+ }
10005
10047
  const nextScopes = new Set(collectSharedStateScopeChain(this.boundSharedStateScope));
10006
10048
  previousScopes === null || previousScopes === void 0 ? void 0 : previousScopes.forEach(scope => {
10007
10049
  if (!nextScopes.has(scope)) {
@@ -10013,6 +10055,18 @@ class Graphic extends Node {
10013
10055
  });
10014
10056
  this.registeredActiveScopes = nextScopes;
10015
10057
  }
10058
+ isSharedStateScopeChainRegistered(previousScopes) {
10059
+ let scope = this.boundSharedStateScope;
10060
+ let scopeCount = 0;
10061
+ while (scope) {
10062
+ if (!previousScopes.has(scope)) {
10063
+ return false;
10064
+ }
10065
+ scopeCount += 1;
10066
+ scope = scope.parentScope;
10067
+ }
10068
+ return scopeCount === previousScopes.size;
10069
+ }
10016
10070
  clearSharedStateActiveRegistrations() {
10017
10071
  const previousScopes = this.registeredActiveScopes;
10018
10072
  if (previousScopes) {
@@ -10028,12 +10082,12 @@ class Graphic extends Node {
10028
10082
  enqueueGraphicSharedStateRefresh(this.stage, this);
10029
10083
  scheduleStageSharedStateRefresh(this.stage);
10030
10084
  }
10031
- onParentSharedStateTreeChanged(stage, layer) {
10085
+ onParentSharedStateTreeChanged(stage, layer, inheritedSharedStateScope) {
10032
10086
  if (this.stage !== stage || this.layer !== layer) {
10033
- this.setStage(stage, layer);
10087
+ this.setStage(stage, layer, inheritedSharedStateScope);
10034
10088
  return;
10035
10089
  }
10036
- this.syncSharedStateScopeBindingOnTreeChange();
10090
+ this.syncSharedStateScopeBindingOnTreeChange(true, inheritedSharedStateScope);
10037
10091
  }
10038
10092
  refreshSharedStateBeforeRender() {
10039
10093
  var _a;
@@ -11190,6 +11244,16 @@ class Graphic extends Node {
11190
11244
  var _a;
11191
11245
  return (_a = this.states) === null || _a === void 0 ? void 0 : _a[stateName];
11192
11246
  }
11247
+ setStateDefinitionsWithCompiled(definitions, compiledDefinitions) {
11248
+ var _a;
11249
+ this.states = definitions;
11250
+ if (this.localStateDefinitionsSource !== definitions) {
11251
+ this.localStateDefinitionsSource = definitions;
11252
+ this.localStateDefinitionsVersion = ((_a = this.localStateDefinitionsVersion) !== null && _a !== void 0 ? _a : 0) + 1;
11253
+ }
11254
+ this.compiledStateDefinitions = compiledDefinitions;
11255
+ this.compiledStateDefinitionsCacheKey = `local:${this.localStateDefinitionsVersion}`;
11256
+ }
11193
11257
  getStateResolveBaseAttrs() {
11194
11258
  var _a;
11195
11259
  return ((_a = this.baseAttributes) !== null && _a !== void 0 ? _a : this.attribute);
@@ -11506,11 +11570,12 @@ class Graphic extends Node {
11506
11570
  }
11507
11571
  }
11508
11572
  addState(stateName, keepCurrentStates, hasAnimation) {
11509
- const transition = this.resolveAddStateTransition(stateName, keepCurrentStates);
11510
- if (!transition.changed) {
11573
+ const currentStates = this.currentStates;
11574
+ if ((currentStates === null || currentStates === void 0 ? void 0 : currentStates.includes(stateName)) && (keepCurrentStates || currentStates.length === 1)) {
11511
11575
  return;
11512
11576
  }
11513
- this.useStates(transition.states, hasAnimation);
11577
+ const nextStates = keepCurrentStates && (currentStates === null || currentStates === void 0 ? void 0 : currentStates.length) ? currentStates.concat([stateName]) : [stateName];
11578
+ this.useStates(nextStates, hasAnimation);
11514
11579
  }
11515
11580
  setStates(states, options) {
11516
11581
  var _a, _b, _c;
@@ -11748,7 +11813,7 @@ class Graphic extends Node {
11748
11813
  this._globalTransMatrix.translate(scrollX, scrollY);
11749
11814
  }
11750
11815
  }
11751
- setStage(stage, layer) {
11816
+ setStage(stage, layer, inheritedSharedStateScope) {
11752
11817
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
11753
11818
  const graphicService = (_c = (_a = stage === null || stage === void 0 ? void 0 : stage.graphicService) !== null && _a !== void 0 ? _a : (_b = this.stage) === null || _b === void 0 ? void 0 : _b.graphicService) !== null && _c !== void 0 ? _c : application.graphicService;
11754
11819
  const previousStage = this.stage;
@@ -11759,7 +11824,7 @@ class Graphic extends Node {
11759
11824
  this.boundSharedStateScope ||
11760
11825
  ((_e = this.registeredActiveScopes) === null || _e === void 0 ? void 0 : _e.size) ||
11761
11826
  this.sharedStateDirty) {
11762
- this.syncSharedStateScopeBindingOnTreeChange(true);
11827
+ this.syncSharedStateScopeBindingOnTreeChange(true, inheritedSharedStateScope);
11763
11828
  }
11764
11829
  this.setStageToShadowRoot(stage, layer);
11765
11830
  if (this.mayHaveTrackedAnimates() && this.hasAnyTrackedAnimate()) {
@@ -11809,7 +11874,7 @@ class Graphic extends Node {
11809
11874
  this.boundSharedStateScope ||
11810
11875
  ((_k = this.registeredActiveScopes) === null || _k === void 0 ? void 0 : _k.size) ||
11811
11876
  this.sharedStateDirty) {
11812
- this.syncSharedStateScopeBindingOnTreeChange(true);
11877
+ this.syncSharedStateScopeBindingOnTreeChange(true, inheritedSharedStateScope);
11813
11878
  }
11814
11879
  }
11815
11880
  detachStageForRelease() {
@@ -12051,7 +12116,20 @@ class Graphic extends Node {
12051
12116
  return null;
12052
12117
  }
12053
12118
  }
12054
- Graphic.userSymbolMap = {};
12119
+ GraphicImpl.userSymbolMap = {};
12120
+ const GRAPHIC_CLASS_SYMBOL = Symbol.for('@visactor/vrender-core/graphic-class');
12121
+ function createGraphicClassState() {
12122
+ return {
12123
+ Graphic: GraphicImpl
12124
+ };
12125
+ }
12126
+ function getGraphicClassState() {
12127
+ var _a;
12128
+ const globalScope = globalThis;
12129
+ (_a = globalScope[GRAPHIC_CLASS_SYMBOL]) !== null && _a !== void 0 ? _a : (globalScope[GRAPHIC_CLASS_SYMBOL] = createGraphicClassState());
12130
+ return globalScope[GRAPHIC_CLASS_SYMBOL];
12131
+ }
12132
+ const Graphic = getGraphicClassState().Graphic;
12055
12133
  Graphic.mixin(EventTarget);
12056
12134
  function backgroundNotImage(image) {
12057
12135
  if (typeof image === 'string') {
@@ -13922,6 +14000,7 @@ function applyFillStyle(ctx, character, b) {
13922
14000
  setTextStyle(ctx, character);
13923
14001
  }
13924
14002
  function applyStrokeStyle(ctx, character) {
14003
+ var _a, _b;
13925
14004
  const strokeStyle = (character && character.stroke) || defaultFormatting.stroke;
13926
14005
  if (!strokeStyle) {
13927
14006
  ctx.globalAlpha = 0;
@@ -13930,6 +14009,8 @@ function applyStrokeStyle(ctx, character) {
13930
14009
  const { strokeOpacity = 1, opacity = 1 } = character;
13931
14010
  ctx.globalAlpha = strokeOpacity * opacity;
13932
14011
  ctx.lineWidth = character && typeof character.lineWidth === 'number' ? character.lineWidth : 1;
14012
+ ctx.setLineDash((_a = character.lineDash) !== null && _a !== void 0 ? _a : []);
14013
+ ctx.lineDashOffset = (_b = character.lineDashOffset) !== null && _b !== void 0 ? _b : 0;
13933
14014
  ctx.strokeStyle = strokeStyle;
13934
14015
  setTextStyle(ctx, character);
13935
14016
  }
@@ -15580,8 +15661,8 @@ class RichText extends Graphic {
15580
15661
  clone() {
15581
15662
  return new RichText(Object.assign({}, this.attribute));
15582
15663
  }
15583
- setStage(stage, layer) {
15584
- super.setStage(stage, layer);
15664
+ setStage(stage, layer, inheritedSharedStateScope) {
15665
+ super.setStage(stage, layer, inheritedSharedStateScope);
15585
15666
  const frameCache = this.getFrameCache();
15586
15667
  frameCache.icons.forEach(icon => {
15587
15668
  icon.setStage(stage, layer);
@@ -16435,7 +16516,7 @@ class Group extends Graphic {
16435
16516
  }
16436
16517
  incrementalAppendChild(node) {
16437
16518
  const data = super.appendChild(node);
16438
- if (data) {
16519
+ if (data && this.shouldSyncChildSharedStateTreeBinding(data)) {
16439
16520
  this.syncChildSharedStateTreeBinding(data);
16440
16521
  }
16441
16522
  this.addUpdateBoundTag();
@@ -16449,7 +16530,7 @@ class Group extends Graphic {
16449
16530
  return;
16450
16531
  }
16451
16532
  _updateChildToStage(child) {
16452
- if (child) {
16533
+ if (child && this.shouldSyncChildSharedStateTreeBinding(child)) {
16453
16534
  this.syncChildSharedStateTreeBinding(child);
16454
16535
  }
16455
16536
  this.addUpdateBoundTag();
@@ -16457,10 +16538,8 @@ class Group extends Graphic {
16457
16538
  }
16458
16539
  appendChild(node, addStage = true) {
16459
16540
  const data = super.appendChild(node);
16460
- if (data) {
16461
- if (addStage) {
16462
- this.syncChildSharedStateTreeBinding(data);
16463
- }
16541
+ if (data && addStage && this.shouldSyncChildSharedStateTreeBinding(data)) {
16542
+ this.syncChildSharedStateTreeBinding(data);
16464
16543
  }
16465
16544
  this.addUpdateBoundTag();
16466
16545
  return data;
@@ -16502,7 +16581,7 @@ class Group extends Graphic {
16502
16581
  });
16503
16582
  this.addUpdateBoundTag();
16504
16583
  }
16505
- setStage(stage, layer) {
16584
+ setStage(stage, layer, inheritedSharedStateScope) {
16506
16585
  var _a, _b, _c, _d, _e, _f;
16507
16586
  const graphicService = (_c = (_a = stage === null || stage === void 0 ? void 0 : stage.graphicService) !== null && _a !== void 0 ? _a : (_b = this.stage) === null || _b === void 0 ? void 0 : _b.graphicService) !== null && _c !== void 0 ? _c : application.graphicService;
16508
16587
  const needsSharedStateTreeSync = this.hasSharedStateDefinitions() ||
@@ -16516,12 +16595,12 @@ class Group extends Graphic {
16516
16595
  this.layer = layer;
16517
16596
  if (needsSharedStateTreeSync) {
16518
16597
  this.ensureSharedStateScopeBound();
16519
- this.syncSharedStateScopeBindingOnTreeChange(true);
16598
+ this.syncSharedStateScopeBindingOnTreeChange(true, inheritedSharedStateScope);
16520
16599
  }
16521
16600
  this.setStageToShadowRoot(stage, layer);
16522
16601
  this._onSetStage && this._onSetStage(this, stage, layer);
16523
16602
  (_f = graphicService === null || graphicService === void 0 ? void 0 : graphicService.onSetStage) === null || _f === void 0 ? void 0 : _f.call(graphicService, this, stage);
16524
- this.notifyChildrenSharedStateTreeChanged();
16603
+ this.notifyChildrenSharedStateTreeChanged(inheritedSharedStateScope);
16525
16604
  return;
16526
16605
  }
16527
16606
  const layerChanged = this.layer !== layer;
@@ -16530,11 +16609,11 @@ class Group extends Graphic {
16530
16609
  }
16531
16610
  if (needsSharedStateTreeSync) {
16532
16611
  this.ensureSharedStateScopeBound();
16533
- this.syncSharedStateScopeBindingOnTreeChange(true);
16534
- this.notifyChildrenSharedStateTreeChanged();
16612
+ this.syncSharedStateScopeBindingOnTreeChange(true, inheritedSharedStateScope);
16613
+ this.notifyChildrenSharedStateTreeChanged(inheritedSharedStateScope);
16535
16614
  }
16536
16615
  else if (layerChanged) {
16537
- this.notifyChildrenSharedStateTreeChanged();
16616
+ this.notifyChildrenSharedStateTreeChanged(inheritedSharedStateScope);
16538
16617
  }
16539
16618
  }
16540
16619
  addUpdatePositionTag() {
@@ -16629,23 +16708,55 @@ class Group extends Graphic {
16629
16708
  hasSharedStateDefinitions() {
16630
16709
  return !!this._sharedStateDefinitions && Object.keys(this._sharedStateDefinitions).length > 0;
16631
16710
  }
16632
- notifyChildrenSharedStateTreeChanged() {
16711
+ resolveChildSharedStateScope(inheritedSharedStateScope) {
16712
+ var _a;
16713
+ if (this.sharedStateScope) {
16714
+ return this.sharedStateScope;
16715
+ }
16716
+ if (inheritedSharedStateScope !== undefined) {
16717
+ return inheritedSharedStateScope;
16718
+ }
16719
+ return (_a = this.resolveBoundSharedStateScope()) !== null && _a !== void 0 ? _a : null;
16720
+ }
16721
+ notifyChildrenSharedStateTreeChanged(inheritedSharedStateScope) {
16722
+ const childSharedStateScope = this.resolveChildSharedStateScope(inheritedSharedStateScope);
16633
16723
  this.forEachChildren(item => {
16634
- this.syncChildSharedStateTreeBinding(item);
16724
+ this.setStageToChild(item, childSharedStateScope);
16635
16725
  });
16636
16726
  }
16637
- syncChildSharedStateTreeBinding(child) {
16638
- child.onParentSharedStateTreeChanged(this.stage, this.layer);
16727
+ shouldSyncChildSharedStateTreeBinding(child) {
16728
+ if (this.stage || this.layer) {
16729
+ return true;
16730
+ }
16731
+ return (child.onParentSharedStateTreeChanged !== Graphic.prototype.onParentSharedStateTreeChanged &&
16732
+ child.onParentSharedStateTreeChanged !== Group.prototype.onParentSharedStateTreeChanged);
16733
+ }
16734
+ setStageToChild(child, inheritedSharedStateScope) {
16735
+ const graphic = child;
16736
+ if (typeof graphic.setStage === 'function' &&
16737
+ (child.onParentSharedStateTreeChanged === Graphic.prototype.onParentSharedStateTreeChanged ||
16738
+ child.onParentSharedStateTreeChanged === Group.prototype.onParentSharedStateTreeChanged) &&
16739
+ (graphic.stage !== this.stage || graphic.layer !== this.layer)) {
16740
+ graphic.setStage(this.stage, this.layer, inheritedSharedStateScope);
16741
+ return;
16742
+ }
16743
+ child.onParentSharedStateTreeChanged(this.stage, this.layer, inheritedSharedStateScope);
16744
+ }
16745
+ syncChildSharedStateTreeBinding(child, inheritedSharedStateScope) {
16746
+ if (inheritedSharedStateScope === undefined) {
16747
+ inheritedSharedStateScope = this.resolveChildSharedStateScope();
16748
+ }
16749
+ this.setStageToChild(child, inheritedSharedStateScope);
16639
16750
  }
16640
- onParentSharedStateTreeChanged(stage, layer) {
16751
+ onParentSharedStateTreeChanged(stage, layer, inheritedSharedStateScope) {
16641
16752
  var _a;
16642
16753
  if (this.stage !== stage || this.layer !== layer) {
16643
- this.setStage(stage, layer);
16754
+ this.setStage(stage, layer, inheritedSharedStateScope);
16644
16755
  return;
16645
16756
  }
16646
16757
  this.ensureSharedStateScopeBound();
16647
- this.syncSharedStateScopeBindingOnTreeChange(!!((_a = this.currentStates) === null || _a === void 0 ? void 0 : _a.length));
16648
- this.notifyChildrenSharedStateTreeChanged();
16758
+ this.syncSharedStateScopeBindingOnTreeChange(!!((_a = this.currentStates) === null || _a === void 0 ? void 0 : _a.length), inheritedSharedStateScope);
16759
+ this.notifyChildrenSharedStateTreeChanged(inheritedSharedStateScope);
16649
16760
  }
16650
16761
  }
16651
16762
  Group.NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;
@@ -30818,4 +30929,4 @@ const registerFlexLayoutPlugin = () => {
30818
30929
  Factory.registerPlugin('FlexLayoutPlugin', FlexLayoutPlugin);
30819
30930
  };
30820
30931
 
30821
- export { APPLICATION_STATE_SYMBOL, ARC3D_NUMBER_TYPE, ARC_NUMBER_TYPE, AREA_NUMBER_TYPE, AbstractGraphicRender, AnimateMode, AnimateStatus, AnimateStepType, AppContext, Application, Arc, Arc3d, Arc3dRender, ArcRender, ArcRenderContribution, Area, AreaRender, AreaRenderContribution, AttributeUpdateType, AutoEnablePlugins, Base3dRender, BaseCanvas, BaseEnvContribution, BaseRender, BaseRenderContributionTime, BaseWindowHandlerContribution, Basis, BeforeRenderConstribution, BoundsContext, BoundsPicker, BrowserEntry, CIRCLE_NUMBER_TYPE, CONTRIBUTION_STORE_STATE_SYMBOL, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasFactory, CanvasTextLayout, Circle, CircleRender, CircleRenderContribution, ColorInterpolate, ColorStore, ColorType, CommonDrawItemInterceptorContribution, CommonRenderContribution, Context2dFactory, ContributionProvider, ContributionRegistry, ContributionStore, CubicBezierCurve, CurveContext, CurveTypeEnum, CustomEvent, CustomPath2D, CustomSymbolClass, DEFAULT_TEXT_FONT_FAMILY, DebugDrawItemInterceptorContribution, DefaultArcAllocate, DefaultArcAttribute, DefaultArcRenderContribution, DefaultAreaAllocate, DefaultAreaAttribute, DefaultAreaTextureRenderContribution, DefaultAttribute, DefaultBaseBackgroundRenderContribution, DefaultBaseClipRenderAfterContribution, DefaultBaseClipRenderBeforeContribution, DefaultBaseInteractiveRenderContribution, DefaultBaseTextureRenderContribution, DefaultCanvasAllocate, DefaultCanvasArc3DRender, DefaultCanvasArcRender, DefaultCanvasAreaRender, DefaultCanvasCircleRender, DefaultCanvasGroupRender, DefaultCanvasImageRender, DefaultCanvasLineRender, DefaultCanvasPathRender, DefaultCanvasPolygonRender, DefaultCanvasPyramid3dRender, DefaultCanvasRect3dRender, DefaultCanvasRectRender, DefaultCanvasSymbolRender, DefaultCanvasTextRender, DefaultCircleAllocate, DefaultCircleAttribute, DefaultCircleRenderContribution, DefaultConnectAttribute, DefaultDebugAttribute, DefaultFillStyle, DefaultGlobal, DefaultGlobalPickerService, DefaultGlyphAttribute, DefaultGraphicAllocate, DefaultGraphicMemoryManager, DefaultGraphicService, DefaultGraphicUtil, DefaultGroupAttribute, DefaultGroupBackgroundRenderContribution, DefaultImageAttribute, DefaultImageRenderContribution, DefaultLayerService, DefaultLayout, DefaultLineAllocate, DefaultLineAttribute, DefaultMat4Allocate, DefaultMatrixAllocate, DefaultPathAllocate, DefaultPathAttribute, DefaultPickService, DefaultPickStyle, DefaultPolygonAttribute, DefaultRect3dAttribute, DefaultRectAllocate, DefaultRectAttribute, DefaultRectRenderContribution, DefaultRenderService, DefaultRichTextAttribute, DefaultRichTextIconAttribute, DefaultStarAttribute, DefaultStrokeStyle, DefaultStyle, DefaultSymbolAllocate, DefaultSymbolAttribute, DefaultSymbolClipRangeStrokeRenderContribution, DefaultSymbolRenderContribution, DefaultTextAllocate, DefaultTextAttribute, DefaultTextMeasureContribution, DefaultTextStyle, DefaultTransform, DefaultTransformUtil, DefaultWindow, Direction, DirectionalLight, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Edge, EditModule, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FACTORY_STATE_SYMBOL, FORMAT_ALL_TEXT_COMMAND, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, Factory, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FlexLayoutPlugin, GLYPH_NUMBER_TYPE, GRAPHIC_REGISTRY_SYMBOL, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, GlobalPickerService, Glyph, GlyphRender, GradientParser, Graphic, GraphicCreator$1 as GraphicCreator, GraphicFactory, GraphicPicker, GraphicRender, GraphicService, GraphicUtil, Group, GroupRender, GroupRenderContribution, GroupUpdateAABBBoundsMode, HtmlAttributePlugin, IContainPointMode, IMAGE_NUMBER_TYPE, Image, ImageRender, ImageRenderContribution, IncrementalDrawContribution, InteractiveDrawItemInterceptorContribution, InteractivePickItemInterceptorContribution, InteractiveSubRenderContribution, LINE_NUMBER_TYPE, Layer, LayerFactory, LayerService, Line$1 as Line, LineRender, Linear, LinearClosed, Mat4Allocate, MatrixAllocate, MeasureModeEnum, MiniappEntry, MonotoneX, MonotoneY, NOWORK_ANIMATE_ATTR, Node, NodeEntry, OrthoCamera, PATH_NUMBER_TYPE, POLYGON_NUMBER_TYPE, PURE_STYLE_KEY, PYRAMID3D_NUMBER_TYPE, Path, PathRender, PathRenderContribution, PerformanceRAF, PickItemInterceptor, PickServiceInterceptor, PickerRegistry, PickerService, PluginRegistry, PluginService, Polygon, PolygonRender, PolygonRenderContribution, Pyramid3d, Pyramid3dRender, RECT3D_NUMBER_TYPE, RECT_NUMBER_TYPE, RICHTEXT_NUMBER_TYPE, RUNTIME_INSTALLER_STATE_SYMBOL, RafBasedSTO, ReactAttributePlugin, Rect, Rect3DRender, Rect3d, RectRender, RectRenderContribution, ReflectSegContext, RenderSelector, RenderService, RendererRegistry, ResourceLoader, RichText, RichTextEditPlugin, RichTextRender, STAR_NUMBER_TYPE, STATUS$1 as STATUS, SVG_ATTRIBUTE_MAP, SVG_ATTRIBUTE_MAP_KEYS, SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS, SYMBOL_NUMBER_TYPE, SegContext, ShadowPickServiceInterceptorContribution, ShadowRoot, ShadowRootDrawItemInterceptorContribution, ShadowRootPickItemInterceptorContribution, SplitRectAfterRenderContribution, SplitRectBeforeRenderContribution, Stage, StageFactory, Star, StarRender, StarRenderContribution, StateDefinitionCompiler, StateEngine, StaticLayerHandlerContribution, Step, StepClosed, Symbol$1 as Symbol, SymbolRender, SymbolRenderContribution, TEXT_NUMBER_TYPE, Text, TextDirection, TextMeasureContribution, TextRender, TextRenderContribution, Theme, TransformUtil, UpdateTag, VGlobal, VWindow, ViewTransform3dPlugin, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, _calculateLineHeight, _interpolateColor, addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dModule, arcModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindArc3dRenderModule, bindArcRenderModule, bindAreaRenderModule, bindCircleRenderModule, bindContributionProvider, bindContributionProviderNoSingletonScope, bindGlyphRenderModule, bindImageRenderModule, bindLineRenderModule, bindPathRenderModule, bindPolygonRenderModule, bindPyramid3dRenderModule, bindRect3dRenderModule, bindRectRenderModule, bindRichtextRenderModule, bindStarRenderModule, bindSymbolRenderModule, bindTextRenderModule, boundStroke, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache, calculateArcCornerRadius, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleModule, clock, colorEqual, colorStringInterpolationToStr, configureRuntimeApplicationForApp, container, cornerTangents, createBrowserApp as createApp, createArc, createArc3d, createArea, createBrowserApp, createCanvasEventTransformer, createCircle, createColor, createConicalGradient, createContributionProvider, createEventTransformer, createGlyph, createGraphic, createGroup, createImage, createLine, createMat4, createMiniappApp, createNodeApp, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createStar, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, defaultArcAllocate, defaultArcBackgroundRenderContribution, defaultArcRenderContribution, defaultArcTextureRenderContribution, defaultAreaAllocate, defaultBaseBackgroundRenderContribution, defaultBaseClipRenderAfterContribution, defaultBaseClipRenderBeforeContribution, defaultBaseTextureRenderContribution, defaultCircleAllocate, defaultCircleBackgroundRenderContribution, defaultCircleRenderContribution, defaultCircleTextureRenderContribution, defaultGraphicMemoryManager, defaultGroupBackgroundRenderContribution, defaultImageBackgroundRenderContribution, defaultImageRenderContribution, defaultLineAllocate, defaultPathAllocate, defaultRectAllocate, defaultRectBackgroundRenderContribution, defaultRectRenderContribution, defaultRectTextureRenderContribution, defaultStarBackgroundRenderContribution, defaultStarTextureRenderContribution, defaultSymbolAllocate, defaultSymbolBackgroundRenderContribution, defaultSymbolClipRangeStrokeRenderContribution, defaultSymbolRenderContribution, defaultSymbolTextureRenderContribution, defaultTextAllocate, diff, divideCubic, drawArc, drawArcPath$1 as drawArcPath, drawAreaSegments, drawBackgroundImage, drawImageWithLayout, drawIncrementalAreaSegments, drawIncrementalSegments, drawSegments, enumCommandMap, fillVisible, findBestMorphingRotation, findConfigIndexByCursorIdx, findCursorIdxByConfigIndex, findNextGraphic, flatten_simplify, foreach, foreachAsync, genBasisSegments, genBasisTypeSegments, genLinearClosedSegments, genLinearClosedTypeSegments, genLinearSegments, genLinearTypeSegments, genMonotoneXSegments, genMonotoneXTypeSegments, genMonotoneYSegments, genMonotoneYTypeSegments, genNumberType, genStepClosedSegments, genStepSegments, genStepTypeSegments, getApplicationState, getAttributeFromDefaultAttrList, getBackgroundImage, getConicGradientAt, getContributionStoreState, getCurrentEnv, getDefaultCharacterConfig, getExtraModelMatrix, getFactoryState, getGraphicRegistryState, getLegacyBindingContext, getModelMatrix, getRichTextBounds, getRuntimeInstallerBindingContext, getRuntimeInstallerGlobal, getRuntimeInstallerState, getScaledStroke, getTextBounds, getTheme, getThemeFromGroup, globalTheme, glyphModule, graphicCreator, graphicService, graphicUtil, identityMat4, imageModule, incrementalAddTo, installRuntimeContributionModule, installRuntimeDrawContributionsToApp, installRuntimeGraphicRenderersToApp, installRuntimePickersToApp, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, interpolatePureColorArrayToStr, intersect, isBrowserEnv, isNoRepeatSizingMode, isNodeEnv, isSvg, isXML, layerService, lineModule, lookAt, mapToCanvasPointForCanvas, mat3Tomat4, mat4Allocate, matrixAllocate, multiplyMat4Mat3, multiplyMat4Mat4, newThemeObj, ortho, parsePadding, parseStroke, parseSvgPath, pathModule, pathToBezierCurves, point$3 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonModule, preLoadAllModule, pyramid3dModule, quadCalc, quadLength, quadPointAt, rafBasedSto, rect3dModule, rectFillVisible, rectModule, rectStrokeVisible, recursiveCallBinarySplit, refreshRuntimeInstallerContributions, registerArc3dGraphic, registerArcGraphic, registerAreaGraphic, registerCircleGraphic, registerDirectionalLight, registerFlexLayoutPlugin, registerGlobalEventTransformer, registerGlyphGraphic, registerGraphic, registerGroupGraphic, registerHtmlAttributePlugin, registerImageGraphic, registerLineGraphic, registerOrthoCamera, registerPathGraphic, registerPolygonGraphic, registerPyramid3dGraphic, registerReactAttributePlugin, registerRect3dGraphic, registerRectGraphic, registerRichtextGraphic, registerShadowRootGraphic, registerStarGraphic, registerSymbolGraphic, registerTextGraphic, registerViewTransform3dPlugin, registerWindowEventTransformer, registerWrapTextGraphic, renderCommandList, resolveBackgroundDrawMode, resolveBackgroundParamsByImageSizing, resolveBackgroundPosition, resolveBackgroundSizing, resolveContainerBinding, resolveImageMode, resolveImageRepeatMode, resolveRenderableImageSize, rewriteProto, richtextModule, rotateX, rotateY, rotateZ, runFill, runStroke, scaleMat4, segments, shouldClipImageByLayout, shouldUseMat4, snapLength, splitArc, splitArea, splitCircle, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, starModule, strCommandMap, strokeVisible, symbolModule, textAttributesToStyle, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textModule, transformMat4, transformPointForCanvas, transformUtil, translate, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, xul };
30932
+ export { APPLICATION_STATE_SYMBOL, ARC3D_NUMBER_TYPE, ARC_NUMBER_TYPE, AREA_NUMBER_TYPE, AbstractGraphicRender, AnimateMode, AnimateStatus, AnimateStepType, AppContext, Application, Arc, Arc3d, Arc3dRender, ArcRender, ArcRenderContribution, Area, AreaRender, AreaRenderContribution, AttributeUpdateType, AutoEnablePlugins, Base3dRender, BaseCanvas, BaseEnvContribution, BaseRender, BaseRenderContributionTime, BaseWindowHandlerContribution, Basis, BeforeRenderConstribution, BoundsContext, BoundsPicker, BrowserEntry, CIRCLE_NUMBER_TYPE, CONTRIBUTION_STORE_STATE_SYMBOL, Canvas3DDrawItemInterceptor, Canvas3DPickItemInterceptor, CanvasFactory, CanvasTextLayout, Circle, CircleRender, CircleRenderContribution, ColorInterpolate, ColorStore, ColorType, CommonDrawItemInterceptorContribution, CommonRenderContribution, Context2dFactory, ContributionProvider, ContributionRegistry, ContributionStore, CubicBezierCurve, CurveContext, CurveTypeEnum, CustomEvent, CustomPath2D, CustomSymbolClass, DEFAULT_TEXT_FONT_FAMILY, DebugDrawItemInterceptorContribution, DefaultArcAllocate, DefaultArcAttribute, DefaultArcRenderContribution, DefaultAreaAllocate, DefaultAreaAttribute, DefaultAreaTextureRenderContribution, DefaultAttribute, DefaultBaseBackgroundRenderContribution, DefaultBaseClipRenderAfterContribution, DefaultBaseClipRenderBeforeContribution, DefaultBaseInteractiveRenderContribution, DefaultBaseTextureRenderContribution, DefaultCanvasAllocate, DefaultCanvasArc3DRender, DefaultCanvasArcRender, DefaultCanvasAreaRender, DefaultCanvasCircleRender, DefaultCanvasGroupRender, DefaultCanvasImageRender, DefaultCanvasLineRender, DefaultCanvasPathRender, DefaultCanvasPolygonRender, DefaultCanvasPyramid3dRender, DefaultCanvasRect3dRender, DefaultCanvasRectRender, DefaultCanvasSymbolRender, DefaultCanvasTextRender, DefaultCircleAllocate, DefaultCircleAttribute, DefaultCircleRenderContribution, DefaultConnectAttribute, DefaultDebugAttribute, DefaultFillStyle, DefaultGlobal, DefaultGlobalPickerService, DefaultGlyphAttribute, DefaultGraphicAllocate, DefaultGraphicMemoryManager, DefaultGraphicService, DefaultGraphicUtil, DefaultGroupAttribute, DefaultGroupBackgroundRenderContribution, DefaultImageAttribute, DefaultImageRenderContribution, DefaultLayerService, DefaultLayout, DefaultLineAllocate, DefaultLineAttribute, DefaultMat4Allocate, DefaultMatrixAllocate, DefaultPathAllocate, DefaultPathAttribute, DefaultPickService, DefaultPickStyle, DefaultPolygonAttribute, DefaultRect3dAttribute, DefaultRectAllocate, DefaultRectAttribute, DefaultRectRenderContribution, DefaultRenderService, DefaultRichTextAttribute, DefaultRichTextIconAttribute, DefaultStarAttribute, DefaultStrokeStyle, DefaultStyle, DefaultSymbolAllocate, DefaultSymbolAttribute, DefaultSymbolClipRangeStrokeRenderContribution, DefaultSymbolRenderContribution, DefaultTextAllocate, DefaultTextAttribute, DefaultTextMeasureContribution, DefaultTextStyle, DefaultTransform, DefaultTransformUtil, DefaultWindow, Direction, DirectionalLight, DrawContribution, DrawItemInterceptor, DynamicLayerHandlerContribution, Edge, EditModule, EmptyContext2d, EnvContribution, EventManager, EventSystem, EventTarget, FACTORY_STATE_SYMBOL, FORMAT_ALL_TEXT_COMMAND, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, Factory, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FlexLayoutPlugin, GLYPH_NUMBER_TYPE, GRAPHIC_CLASS_SYMBOL, GRAPHIC_REGISTRY_SYMBOL, GRAPHIC_UPDATE_TAG_KEY, GROUP_NUMBER_TYPE, Generator, GlobalPickerService, Glyph, GlyphRender, GradientParser, Graphic, GraphicCreator$1 as GraphicCreator, GraphicFactory, GraphicPicker, GraphicRender, GraphicService, GraphicUtil, Group, GroupRender, GroupRenderContribution, GroupUpdateAABBBoundsMode, HtmlAttributePlugin, IContainPointMode, IMAGE_NUMBER_TYPE, Image, ImageRender, ImageRenderContribution, IncrementalDrawContribution, InteractiveDrawItemInterceptorContribution, InteractivePickItemInterceptorContribution, InteractiveSubRenderContribution, LINE_NUMBER_TYPE, Layer, LayerFactory, LayerService, Line$1 as Line, LineRender, Linear, LinearClosed, Mat4Allocate, MatrixAllocate, MeasureModeEnum, MiniappEntry, MonotoneX, MonotoneY, NOWORK_ANIMATE_ATTR, Node, NodeEntry, OrthoCamera, PATH_NUMBER_TYPE, POLYGON_NUMBER_TYPE, PURE_STYLE_KEY, PYRAMID3D_NUMBER_TYPE, Path, PathRender, PathRenderContribution, PerformanceRAF, PickItemInterceptor, PickServiceInterceptor, PickerRegistry, PickerService, PluginRegistry, PluginService, Polygon, PolygonRender, PolygonRenderContribution, Pyramid3d, Pyramid3dRender, RECT3D_NUMBER_TYPE, RECT_NUMBER_TYPE, RICHTEXT_NUMBER_TYPE, RUNTIME_INSTALLER_STATE_SYMBOL, RafBasedSTO, ReactAttributePlugin, Rect, Rect3DRender, Rect3d, RectRender, RectRenderContribution, ReflectSegContext, RenderSelector, RenderService, RendererRegistry, ResourceLoader, RichText, RichTextEditPlugin, RichTextRender, STAR_NUMBER_TYPE, STATUS$1 as STATUS, SVG_ATTRIBUTE_MAP, SVG_ATTRIBUTE_MAP_KEYS, SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS, SYMBOL_NUMBER_TYPE, SegContext, ShadowPickServiceInterceptorContribution, ShadowRoot, ShadowRootDrawItemInterceptorContribution, ShadowRootPickItemInterceptorContribution, SplitRectAfterRenderContribution, SplitRectBeforeRenderContribution, Stage, StageFactory, Star, StarRender, StarRenderContribution, StateDefinitionCompiler, StateEngine, StaticLayerHandlerContribution, Step, StepClosed, Symbol$1 as Symbol, SymbolRender, SymbolRenderContribution, TEXT_NUMBER_TYPE, Text, TextDirection, TextMeasureContribution, TextRender, TextRenderContribution, Theme, TransformUtil, UpdateTag, VGlobal, VWindow, ViewTransform3dPlugin, VirtualLayerHandlerContribution, WILDCARD, WindowHandlerContribution, WrapText, XMLParser, _calculateLineHeight, _interpolateColor, addArcToBezierPath, addAttributeToPrototype, alignBezierCurves, alignSubpath, application, applyTransformOnBezierCurves, arc3dModule, arcModule, areaModule, bezier, bezierCurversToPath, binarySplitPolygon, bindArc3dRenderModule, bindArcRenderModule, bindAreaRenderModule, bindCircleRenderModule, bindContributionProvider, bindContributionProviderNoSingletonScope, bindGlyphRenderModule, bindImageRenderModule, bindLineRenderModule, bindPathRenderModule, bindPolygonRenderModule, bindPyramid3dRenderModule, bindRect3dRenderModule, bindRectRenderModule, bindRichtextRenderModule, bindStarRenderModule, bindSymbolRenderModule, bindTextRenderModule, boundStroke, builtInSymbolStrMap, builtinSymbols, builtinSymbolsMap, calcLineCache, calculateArcCornerRadius, calculateLineHeight, canvasAllocate, centroidOfSubpath, circleBounds, circleModule, clock, colorEqual, colorStringInterpolationToStr, configureRuntimeApplicationForApp, container, cornerTangents, createBrowserApp as createApp, createArc, createArc3d, createArea, createBrowserApp, createCanvasEventTransformer, createCircle, createColor, createConicalGradient, createContributionProvider, createEventTransformer, createGlyph, createGraphic, createGroup, createImage, createLine, createMat4, createMiniappApp, createNodeApp, createPath, createPolygon, createPyramid3d, createRect, createRect3d, createRectPath, createRichText, createShadowRoot, createStage, createStar, createSymbol, createText, createWrapText, cubicCalc, cubicLength, cubicPointAt, cubicSubdivide, defaultArcAllocate, defaultArcBackgroundRenderContribution, defaultArcRenderContribution, defaultArcTextureRenderContribution, defaultAreaAllocate, defaultBaseBackgroundRenderContribution, defaultBaseClipRenderAfterContribution, defaultBaseClipRenderBeforeContribution, defaultBaseTextureRenderContribution, defaultCircleAllocate, defaultCircleBackgroundRenderContribution, defaultCircleRenderContribution, defaultCircleTextureRenderContribution, defaultGraphicMemoryManager, defaultGroupBackgroundRenderContribution, defaultImageBackgroundRenderContribution, defaultImageRenderContribution, defaultLineAllocate, defaultPathAllocate, defaultRectAllocate, defaultRectBackgroundRenderContribution, defaultRectRenderContribution, defaultRectTextureRenderContribution, defaultStarBackgroundRenderContribution, defaultStarTextureRenderContribution, defaultSymbolAllocate, defaultSymbolBackgroundRenderContribution, defaultSymbolClipRangeStrokeRenderContribution, defaultSymbolRenderContribution, defaultSymbolTextureRenderContribution, defaultTextAllocate, diff, divideCubic, drawArc, drawArcPath$1 as drawArcPath, drawAreaSegments, drawBackgroundImage, drawImageWithLayout, drawIncrementalAreaSegments, drawIncrementalSegments, drawSegments, enumCommandMap, fillVisible, findBestMorphingRotation, findConfigIndexByCursorIdx, findCursorIdxByConfigIndex, findNextGraphic, flatten_simplify, foreach, foreachAsync, genBasisSegments, genBasisTypeSegments, genLinearClosedSegments, genLinearClosedTypeSegments, genLinearSegments, genLinearTypeSegments, genMonotoneXSegments, genMonotoneXTypeSegments, genMonotoneYSegments, genMonotoneYTypeSegments, genNumberType, genStepClosedSegments, genStepSegments, genStepTypeSegments, getApplicationState, getAttributeFromDefaultAttrList, getBackgroundImage, getConicGradientAt, getContributionStoreState, getCurrentEnv, getDefaultCharacterConfig, getExtraModelMatrix, getFactoryState, getGraphicClassState, getGraphicRegistryState, getLegacyBindingContext, getModelMatrix, getRichTextBounds, getRuntimeInstallerBindingContext, getRuntimeInstallerGlobal, getRuntimeInstallerState, getScaledStroke, getTextBounds, getTheme, getThemeFromGroup, globalTheme, glyphModule, graphicCreator, graphicService, graphicUtil, identityMat4, imageModule, incrementalAddTo, installRuntimeContributionModule, installRuntimeDrawContributionsToApp, installRuntimeGraphicRenderersToApp, installRuntimePickersToApp, interpolateColor, interpolateGradientConicalColor, interpolateGradientLinearColor, interpolateGradientRadialColor, interpolatePureColorArray, interpolatePureColorArrayToStr, intersect, isBrowserEnv, isNoRepeatSizingMode, isNodeEnv, isSvg, isXML, layerService, lineModule, lookAt, mapToCanvasPointForCanvas, mat3Tomat4, mat4Allocate, matrixAllocate, multiplyMat4Mat3, multiplyMat4Mat4, newThemeObj, ortho, parsePadding, parseStroke, parseSvgPath, pathModule, pathToBezierCurves, point$3 as point, pointEqual, pointInterpolation, pointInterpolationHighPerformance, pointsEqual, pointsInterpolation, polygonModule, preLoadAllModule, pyramid3dModule, quadCalc, quadLength, quadPointAt, rafBasedSto, rect3dModule, rectFillVisible, rectModule, rectStrokeVisible, recursiveCallBinarySplit, refreshRuntimeInstallerContributions, registerArc3dGraphic, registerArcGraphic, registerAreaGraphic, registerCircleGraphic, registerDirectionalLight, registerFlexLayoutPlugin, registerGlobalEventTransformer, registerGlyphGraphic, registerGraphic, registerGroupGraphic, registerHtmlAttributePlugin, registerImageGraphic, registerLineGraphic, registerOrthoCamera, registerPathGraphic, registerPolygonGraphic, registerPyramid3dGraphic, registerReactAttributePlugin, registerRect3dGraphic, registerRectGraphic, registerRichtextGraphic, registerShadowRootGraphic, registerStarGraphic, registerSymbolGraphic, registerTextGraphic, registerViewTransform3dPlugin, registerWindowEventTransformer, registerWrapTextGraphic, renderCommandList, resolveBackgroundDrawMode, resolveBackgroundParamsByImageSizing, resolveBackgroundPosition, resolveBackgroundSizing, resolveContainerBinding, resolveImageMode, resolveImageRepeatMode, resolveRenderableImageSize, rewriteProto, richtextModule, rotateX, rotateY, rotateZ, runFill, runStroke, scaleMat4, segments, shouldClipImageByLayout, shouldUseMat4, snapLength, splitArc, splitArea, splitCircle, splitLine, splitPath, splitPolygon, splitRect, splitToGrids, starModule, strCommandMap, strokeVisible, symbolModule, textAttributesToStyle, textDrawOffsetX, textDrawOffsetY, textLayoutOffsetY, textModule, transformMat4, transformPointForCanvas, transformUtil, translate, verticalLayout, vglobal, waitForAllSubLayers, wrapCanvas, wrapContext, xul };