@visactor/vrender-core 0.20.11-alpha.1 → 0.20.11-alpha.3

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 (36) hide show
  1. package/cjs/animate/animate.js +1 -1
  2. package/cjs/animate/animate.js.map +1 -1
  3. package/cjs/interface/animate.d.ts +1 -0
  4. package/cjs/interface/animate.js.map +1 -1
  5. package/cjs/interface/picker.d.ts +13 -0
  6. package/cjs/interface/picker.js.map +1 -1
  7. package/cjs/picker/constants.d.ts +2 -0
  8. package/cjs/picker/constants.js +3 -2
  9. package/cjs/picker/constants.js.map +1 -1
  10. package/cjs/picker/pick-interceptor.d.ts +7 -2
  11. package/cjs/picker/pick-interceptor.js +19 -2
  12. package/cjs/picker/pick-interceptor.js.map +1 -1
  13. package/cjs/picker/pick-modules.js +7 -4
  14. package/cjs/picker/pick-modules.js.map +1 -1
  15. package/cjs/picker/picker-service.d.ts +4 -2
  16. package/cjs/picker/picker-service.js +13 -12
  17. package/cjs/picker/picker-service.js.map +1 -1
  18. package/dist/index.es.js +49 -19
  19. package/es/animate/animate.js +1 -1
  20. package/es/animate/animate.js.map +1 -1
  21. package/es/interface/animate.d.ts +1 -0
  22. package/es/interface/animate.js.map +1 -1
  23. package/es/interface/picker.d.ts +13 -0
  24. package/es/interface/picker.js.map +1 -1
  25. package/es/picker/constants.d.ts +2 -0
  26. package/es/picker/constants.js +4 -0
  27. package/es/picker/constants.js.map +1 -1
  28. package/es/picker/pick-interceptor.d.ts +7 -2
  29. package/es/picker/pick-interceptor.js +19 -1
  30. package/es/picker/pick-interceptor.js.map +1 -1
  31. package/es/picker/pick-modules.js +5 -3
  32. package/es/picker/pick-modules.js.map +1 -1
  33. package/es/picker/picker-service.d.ts +4 -2
  34. package/es/picker/picker-service.js +13 -13
  35. package/es/picker/picker-service.js.map +1 -1
  36. package/package.json +1 -1
@@ -263,7 +263,7 @@ class SubAnimate {
263
263
  (null == duration || duration < 0) && (duration = 0);
264
264
  const easingFunc = "string" == typeof easing ? easing_1.Easing[easing] : easing, step = this._addStep(duration, null, easingFunc);
265
265
  return step.type = enums_1.AnimateStepType.to, this._appendProps(props, step, !!params && params.tempProps),
266
- step.propKeys || (step.propKeys = Object.keys(step.props)), params && params.noPreventAttrs || this.target.animates.forEach((a => {
266
+ step.propKeys || (step.propKeys = Object.keys(step.props)), params && params.noPreventAttrs || this.target.animates && this.target.animates.forEach((a => {
267
267
  a.id !== this.animate.id && a.preventAttrs(step.propKeys);
268
268
  })), this;
269
269
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/animate/animate.ts"],"names":[],"mappings":";;;AAaA,2CAAmG;AACnG,qCAAkC;AAClC,6CAA+C;AAC/C,yCAA6C;AAC7C,mDAAgD;AA2BhD,MAAsB,cAAc;IAgBlC,YAAY,IAAO,EAAE,EAAK,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAAY;QAC5E,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;IACvB,CAAC;IAED,IAAI,CAAC,MAAsB,EAAE,MAAmB;QAC9C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;QACzB,IAAI,CAAC,MAAM,EAAE,CAAC;IAChB,CAAC;IAGD,MAAM;QACJ,OAAO;IACT,CAAC;IAGD,UAAU;QACR,OAAO;IACT,CAAC;IAGD,OAAO;QACL,OAAO;IACT,CAAC;IAGD,KAAK;QACH,OAAO;IACT,CAAC;IAED,WAAW;QACT,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CA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AAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,IAAU;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,YAAY;QACV,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,OAAO,IAAI,EAAE;YACX,IAAI,IAAI,CAAC,KAAK,EAAE;gBACd,OAAO,IAAI,CAAC,KAAK,CAAC;aACnB;iBAAM,IAAI,IAAI,CAAC,aAAa,EAAE;gBAC7B,OAAO,IAAI,CAAC,aAAa,CAAC,iBAAiB,EAAE,CAAC;aAC/C;YACD,IAAI,GAAG,IAAI,CAAC,IAAW,CAAC;SACzB;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF","file":"animate.js","sourcesContent":["import type {\n EasingType,\n EasingTypeFunc,\n IAnimate,\n IAnimateStepType,\n IAnimateTarget,\n ICustomAnimate,\n IGraphic,\n IStep,\n IStepConfig,\n ISubAnimate,\n ITimeline\n} from '../interface';\nimport { AnimateMode, AnimateStatus, AnimateStepType, AttributeUpdateType } from '../common/enums';\nimport { Easing } from './easing';\nimport { Logger, max } from '@visactor/vutils';\nimport { defaultTimeline } from './timeline';\nimport { Generator } from '../common/generator';\n\n// 参考TweenJS\n// https://github.com/CreateJS/TweenJS/tree/master/src/tweenjs\n/**\n * The MIT License (MIT)\n\n Copyright (c) 2014 gskinner.com, inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\nexport abstract class ACustomAnimate<T> implements ICustomAnimate {\n declare from: T;\n declare to: T;\n declare duration: number;\n declare easing: EasingType;\n declare params: any;\n declare target: IAnimateTarget;\n declare updateCount: number;\n declare subAnimate: ISubAnimate;\n declare step?: IStep;\n declare mode?: AnimateMode;\n\n // 用于判断是否一致\n declare _endProps?: any;\n declare _mergedEndProps?: any;\n\n constructor(from: T, to: T, duration: number, easing: EasingType, params?: any) {\n this.from = from;\n this.to = to;\n this.duration = duration;\n this.easing = easing;\n this.params = params;\n this.updateCount = 0;\n }\n\n bind(target: IAnimateTarget, subAni: ISubAnimate) {\n this.target = target;\n this.subAnimate = subAni;\n this.onBind();\n }\n\n // 在第一次调用的时候触发\n onBind() {\n return;\n }\n\n // 第一次执行的时候调用\n onFirstRun() {\n return;\n }\n\n // 开始执行的时候调用(如果有循环,那每个周期都会调用)\n onStart() {\n return;\n }\n\n // 结束执行的时候调用(如果有循环,那每个周期都会调用)\n onEnd() {\n return;\n }\n\n getEndProps(): Record<string, any> | void {\n return this.to;\n }\n\n getFromProps(): Record<string, any> | void {\n return this.from;\n }\n\n getMergedEndProps(): Record<string, any> | void {\n const thisEndProps = this.getEndProps();\n if (thisEndProps) {\n if (this._endProps === thisEndProps) {\n return this._mergedEndProps;\n }\n this._endProps = thisEndProps;\n this._mergedEndProps = Object.assign({}, this.step.prev.getLastProps() ?? {}, thisEndProps);\n return;\n }\n return this.step.prev ? this.step.prev.getLastProps() : thisEndProps;\n }\n\n // abstract getFromValue(key: string): any;\n // abstract getToValue(key: string): any;\n\n abstract onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;\n\n update(end: boolean, ratio: number, out: Record<string, any>): void {\n if (this.updateCount === 0) {\n this.onFirstRun();\n // out添加之前的props\n const props = this.step.getLastProps();\n Object.keys(props).forEach(k => {\n if (this.subAnimate.animate.validAttr(k)) {\n out[k] = props[k];\n }\n });\n }\n this.updateCount += 1;\n this.onUpdate(end, ratio, out);\n if (end) {\n this.onEnd();\n }\n }\n}\n\nexport class CbAnimate extends ACustomAnimate<null> {\n cb: () => void;\n\n constructor(cb: () => void) {\n super(null, null, 0, 'linear');\n this.cb = cb;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n return;\n }\n\n onStart(): void {\n this.cb();\n }\n}\n\ntype InterpolateFunc = (\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IAnimateTarget,\n out: Record<string, any>\n) => boolean;\n\nexport class Animate implements IAnimate {\n static mode: AnimateMode = AnimateMode.NORMAL;\n declare target: IAnimateTarget;\n declare timeline: ITimeline;\n declare nextAnimate?: IAnimate;\n declare prevAnimate?: IAnimate;\n // 当前Animate的状态,正常,暂停,结束\n declare status: AnimateStatus;\n declare readonly id: string | number;\n // 开始时间\n protected declare _startTime: number;\n protected declare _duringTime: number;\n declare subAnimates: SubAnimate[];\n declare tailAnimate: SubAnimate;\n\n // 绝对的位置\n declare rawPosition: number;\n // 时间倍速缩放\n declare timeScale: number;\n\n declare interpolateFunc: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n\n declare _onStart?: (() => void)[];\n declare _onFrame?: ((step: IStep, ratio: number) => void)[];\n declare _onEnd?: (() => void)[];\n declare _onRemove?: (() => void)[];\n declare _preventAttrs?: Set<string>;\n static interpolateMap: Map<string, InterpolateFunc> = new Map();\n slience?: boolean;\n\n constructor(\n id: string | number = Generator.GenAutoIncrementId(),\n timeline: ITimeline = defaultTimeline,\n slience?: boolean\n ) {\n this.id = id;\n this.timeline = timeline;\n this.status = AnimateStatus.INITIAL;\n this.tailAnimate = new SubAnimate(this);\n this.subAnimates = [this.tailAnimate];\n this.timeScale = 1;\n this.rawPosition = -1;\n this._startTime = 0;\n this._duringTime = 0;\n this.timeline.addAnimate(this);\n this.slience = slience;\n }\n\n setTimeline(timeline: ITimeline) {\n if (timeline === this.timeline) {\n return;\n }\n this.timeline.removeAnimate(this, false);\n timeline.addAnimate(this);\n }\n\n getStartTime(): number {\n return this._startTime;\n }\n\n getDuration(): number {\n return this.subAnimates.reduce((t, subAnimate) => t + subAnimate.totalDuration, 0);\n }\n\n after(animate: IAnimate) {\n const t = animate.getDuration();\n this._startTime = t;\n return this;\n }\n\n afterAll(list: IAnimate[]) {\n let maxT = -Infinity;\n list.forEach(a => {\n maxT = max(a.getDuration(), maxT);\n });\n this._startTime = maxT;\n return this;\n }\n\n parallel(animate: IAnimate) {\n this._startTime = animate.getStartTime();\n return this;\n }\n\n static AddInterpolate(name: string, cb: InterpolateFunc) {\n Animate.interpolateMap.set(name, cb);\n }\n\n play(customAnimate: ICustomAnimate) {\n this.tailAnimate.play(customAnimate);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n if (this.subAnimates.length === 1 && this.tailAnimate.totalDuration === customAnimate.duration) {\n this.trySetAttribute(customAnimate.getFromProps(), customAnimate.mode);\n }\n return this;\n }\n\n trySetAttribute(attr: Record<string, any> | void, mode: AnimateMode = Animate.mode) {\n if (attr && mode & AnimateMode.SET_ATTR_IMMEDIATELY) {\n (this.target as any).setAttributes &&\n (this.target as any).setAttributes(attr, false, { type: AttributeUpdateType.ANIMATE_PLAY });\n }\n }\n\n runCb(cb: (a: IAnimate, step: IStep) => void) {\n // this.tailAnimate.runCb(cb);\n const customAnimate = new CbAnimate(() => {\n cb(this, customAnimate.step.prev);\n });\n this.tailAnimate.play(customAnimate);\n return this;\n }\n\n /**\n * 自定义插值,返回false表示没有匹配上\n * @param key\n * @param from\n * @param to\n */\n customInterpolate(\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IAnimateTarget,\n ret: Record<string, any>\n ): boolean {\n const func = Animate.interpolateMap.get(key) || Animate.interpolateMap.get('');\n if (!func) {\n return false;\n }\n return func(key, ratio, from, to, target, ret);\n }\n\n pause() {\n if (this.status === AnimateStatus.RUNNING) {\n this.status = AnimateStatus.PAUSED;\n }\n }\n\n resume() {\n if (this.status === AnimateStatus.PAUSED) {\n this.status = AnimateStatus.RUNNING;\n }\n }\n\n to(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n this.tailAnimate.to(props, duration, easing, params);\n // 默认开始动画\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n // if (this.subAnimates.length === 1 && this.tailAnimate.duration === duration) {\n // this.trySetAttribute(props);\n // }\n return this;\n }\n from(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n this.tailAnimate.from(props, duration, easing, params);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n wait(duration: number) {\n this.tailAnimate.wait(duration);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n startAt(t: number) {\n this.tailAnimate.startAt(t);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n loop(l: number) {\n this.tailAnimate.loop = l;\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n reversed(r: boolean) {\n this.tailAnimate.reversed = r;\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n bounce(b: boolean) {\n this.tailAnimate.bounce = b;\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n subAnimate() {\n const sa = new SubAnimate(this, this.tailAnimate);\n this.tailAnimate = sa;\n this.subAnimates.push(sa);\n sa.bind(this.target);\n return this;\n }\n\n getStartProps(): Record<string, any> {\n return this.subAnimates[0].getStartProps();\n }\n\n getEndProps(): Record<string, any> {\n return this.tailAnimate.getEndProps();\n }\n\n depreventAttr(key: string) {\n if (!this._preventAttrs) {\n return;\n }\n this._preventAttrs.delete(key);\n }\n preventAttr(key: string) {\n if (!this._preventAttrs) {\n this._preventAttrs = new Set();\n }\n this._preventAttrs.add(key);\n }\n preventAttrs(keys: string[]) {\n keys.forEach(key => this.preventAttr(key));\n }\n validAttr(key: string): boolean {\n if (!this._preventAttrs) {\n return true;\n }\n return !this._preventAttrs.has(key);\n }\n\n bind(target: IAnimateTarget) {\n this.target = target;\n\n if (this.target.onAnimateBind && !this.slience) {\n this.target.onAnimateBind(this);\n }\n\n this.subAnimates.forEach(sa => {\n sa.bind(target);\n });\n return this;\n }\n\n advance(delta: number) {\n // startTime之前的时间不计入耗时\n if (this._duringTime < this._startTime) {\n if (this._duringTime + delta * this.timeScale < this._startTime) {\n this._duringTime += delta * this.timeScale;\n return;\n }\n delta = this._duringTime + delta * this.timeScale - this._startTime;\n this._duringTime = this._startTime;\n }\n // 执行advance\n if (this.status === AnimateStatus.INITIAL) {\n this.status = AnimateStatus.RUNNING;\n this._onStart && this._onStart.forEach(cb => cb());\n }\n const end = this.setPosition(Math.max(this.rawPosition, 0) + delta * this.timeScale);\n if (end && this.status === AnimateStatus.RUNNING) {\n this.status = AnimateStatus.END;\n this._onEnd && this._onEnd.forEach(cb => cb());\n }\n }\n\n setPosition(rawPosition: number): boolean {\n let d = 0;\n let sa: SubAnimate | undefined;\n const prevRawPos = this.rawPosition;\n const maxRawPos = this.subAnimates.reduce((a, b) => a + b.totalDuration, 0);\n\n if (rawPosition < 0) {\n rawPosition = 0;\n }\n\n const end = rawPosition >= maxRawPos;\n\n if (end) {\n rawPosition = maxRawPos;\n }\n\n if (rawPosition === prevRawPos) {\n return end;\n }\n\n // 查找对应的subAnimate\n for (let i = 0; i < this.subAnimates.length; i++) {\n sa = this.subAnimates[i];\n if (d + sa.totalDuration >= rawPosition) {\n break;\n } else {\n d += sa.totalDuration;\n sa = undefined;\n }\n }\n this.rawPosition = rawPosition;\n sa.setPosition(rawPosition - d);\n\n return end;\n }\n\n onStart(cb: () => void) {\n if (!this._onStart) {\n this._onStart = [];\n }\n this._onStart.push(cb);\n }\n onEnd(cb: () => void) {\n if (!this._onEnd) {\n this._onEnd = [];\n }\n this._onEnd.push(cb);\n }\n onRemove(cb: () => void) {\n if (!this._onRemove) {\n this._onRemove = [];\n }\n this._onRemove.push(cb);\n }\n onFrame(cb: (step: IStep, ratio: number) => void) {\n if (!this._onFrame) {\n this._onFrame = [];\n }\n this._onFrame.push(cb);\n }\n release() {\n this.status = AnimateStatus.END;\n return;\n }\n\n stop(nextVal?: 'start' | 'end' | Record<string, any>) {\n if (!nextVal) {\n this.target.onStop();\n }\n if (nextVal === 'start') {\n this.target.onStop(this.getStartProps());\n } else if (nextVal === 'end') {\n this.target.onStop(this.getEndProps());\n } else {\n this.target.onStop(nextVal);\n }\n this.release();\n }\n}\n\n// Animate.mode |= AnimateMode.SET_ATTR_IMMEDIATELY;\n\nexport class SubAnimate implements ISubAnimate {\n declare target: IAnimateTarget;\n declare animate: IAnimate;\n // 默认的初始step,一定存在,且stepHead的props一定保存整个subAnimate阶段所有属性的最初\n protected declare stepHead: Step;\n protected declare stepTail: Step;\n // 结束时反转动画\n declare bounce: boolean;\n // 是否reverse\n declare reversed: boolean;\n // 循环次数,0为执行一次,1为执行两次,Infinity为无限循环\n declare loop: number;\n // 持续时间,不包括循环\n declare duration: number;\n // 位置,在[0, duration]之间\n declare position: number;\n // 绝对的位置,在[0, loops * duration]之间\n declare rawPosition: number;\n declare dirty: boolean;\n\n declare _totalDuration: number;\n declare _startAt: number;\n declare _lastStep: IStep;\n declare _deltaPosition: number;\n\n get totalDuration(): number {\n this.calcAttr();\n return this._totalDuration + this._startAt;\n }\n\n constructor(animate: IAnimate, lastSubAnimate?: SubAnimate) {\n this.rawPosition = -1;\n this.position = 0;\n this.loop = 0;\n this.duration = 0;\n this.animate = animate;\n if (lastSubAnimate) {\n this.stepHead = new Step(0, 0, Object.assign({}, lastSubAnimate.stepTail.props));\n } else {\n this.stepHead = new Step(0, 0, {});\n }\n this.stepTail = this.stepHead;\n this.dirty = true;\n this._startAt = 0;\n }\n\n // 计算按需计算的属性\n protected calcAttr() {\n if (!this.dirty) {\n return;\n }\n\n this._totalDuration = this.duration * (this.loop + 1);\n }\n\n bind(target: IAnimateTarget) {\n this.target = target;\n return this;\n }\n\n play(customAnimate: ICustomAnimate) {\n let duration = customAnimate.duration;\n if (duration == null || duration < 0) {\n duration = 0;\n }\n const easing = customAnimate.easing;\n const easingFunc = typeof easing === 'string' ? Easing[easing] : easing;\n const step = this._addStep(duration, null, easingFunc);\n step.type = AnimateStepType.customAnimate;\n this._appendProps(customAnimate.getEndProps(), step, false);\n this._appendCustomAnimate(customAnimate, step);\n return this;\n }\n\n // _appendPlayProps(step: IStep) {\n\n // return;\n // }\n\n to(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n if (duration == null || duration < 0) {\n duration = 0;\n }\n\n const easingFunc = typeof easing === 'string' ? Easing[easing] : easing;\n\n const step = this._addStep(duration, null, easingFunc);\n step.type = AnimateStepType.to;\n this._appendProps(props, step, params ? params.tempProps : false);\n // this._appendPlayProps(step);\n\n if (!step.propKeys) {\n step.propKeys = Object.keys(step.props);\n }\n if (!(params && params.noPreventAttrs)) {\n this.target.animates.forEach(a => {\n if (a.id !== this.animate.id) {\n a.preventAttrs(step.propKeys);\n }\n });\n }\n return this;\n }\n\n from(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n this.to(props, 0, easing, params);\n const toProps = {};\n if (!this.stepTail.propKeys) {\n this.stepTail.propKeys = Object.keys(this.stepTail.props);\n }\n this.stepTail.propKeys.forEach(k => {\n toProps[k] = this.getLastPropByName(k, this.stepTail);\n });\n this.to(toProps, duration, easing, params);\n this.stepTail.type = AnimateStepType.from;\n }\n\n startAt(t: number) {\n if (t < 0) {\n t = 0;\n }\n this._startAt = t;\n return this;\n }\n\n getStartProps() {\n return this.stepHead?.props;\n }\n\n getEndProps() {\n return this.stepTail.props;\n }\n\n getLastStep() {\n return this._lastStep;\n }\n\n wait(duration: number) {\n if (duration > 0) {\n const step = this._addStep(+duration, null);\n\n step.type = AnimateStepType.wait;\n // TODO 这里如果跳帧的话会存在bug\n if (step.prev.customAnimate) {\n step.props = step.prev.customAnimate.getEndProps();\n } else {\n step.props = step.prev.props;\n }\n if (this.target.onAddStep) {\n this.target.onAddStep(step);\n }\n // this._appendPlayProps(step);\n }\n return this;\n }\n\n protected _addStep(duration: number, props: any, easingFunc?: EasingTypeFunc) {\n const step = new Step(this.duration, duration, props, easingFunc);\n this.duration += duration;\n this.stepTail.append(step);\n this.stepTail = step;\n return step;\n }\n\n protected _appendProps(props: any, step: Step, tempProps?: boolean) {\n if (tempProps) {\n step.props = props;\n } else {\n // todo: 是否需要深拷贝props\n step.props = Object.assign({}, props);\n }\n let lastStep = step.prev;\n const _props = step.props;\n // 将undefined的属性设置到默认值\n if (!step.propKeys) {\n step.propKeys = Object.keys(step.props);\n }\n step.propKeys.forEach(k => {\n if (step.props[k] === undefined) {\n step.props[k] = this.target.getDefaultAttribute(k);\n }\n });\n // 拷贝之前的step阶段属性\n while (lastStep.prev) {\n if (lastStep.props) {\n if (!lastStep.propKeys) {\n lastStep.propKeys = Object.keys(lastStep.props);\n }\n lastStep.propKeys.forEach(key => {\n if (_props[key] === undefined) {\n _props[key] = lastStep.props[key];\n }\n });\n }\n // 重置propKeys\n step.propKeys = Object.keys(step.props);\n lastStep = lastStep.prev;\n }\n\n // 设置最初的props属性\n const initProps = this.stepHead.props;\n if (!step.propKeys) {\n step.propKeys = Object.keys(_props);\n }\n step.propKeys.forEach(key => {\n if (initProps[key] === undefined) {\n const parentAnimateInitProps = this.animate.getStartProps();\n initProps[key] = parentAnimateInitProps[key] = this.target.getComputedAttribute(key);\n }\n });\n\n if (this.target.onAddStep) {\n this.target.onAddStep(step);\n }\n }\n\n protected _appendCustomAnimate(customAnimate: ICustomAnimate, step: Step) {\n step.customAnimate = customAnimate;\n customAnimate.step = step;\n customAnimate.bind(this.target, this);\n }\n\n setPosition(rawPosition: number) {\n const d = this.duration;\n const loopCount = this.loop;\n const prevRawPos = this.rawPosition;\n let end = false;\n let loop: number; // 当前是第几次循环\n let position: number; // 当前周期的时间\n const startAt = this._startAt ?? 0;\n\n if (rawPosition < 0) {\n rawPosition = 0;\n }\n if (rawPosition < startAt) {\n this.rawPosition = rawPosition;\n return false;\n }\n rawPosition = rawPosition - startAt;\n if (d <= 0) {\n // 如果不用执行,跳过\n end = true;\n // 小于0的话,直接return,如果等于0,那还是得走动画逻辑,将end属性设置上去\n if (d < 0) {\n return end;\n }\n }\n loop = Math.floor(rawPosition / d);\n position = rawPosition - loop * d;\n\n // 计算rawPosition\n end = rawPosition >= loopCount * d + d;\n // 如果结束,跳过\n if (end) {\n position = d;\n loop = loopCount;\n rawPosition = position * loop + d;\n }\n\n if (rawPosition === prevRawPos) {\n return end;\n }\n\n // reverse动画\n const rev = !this.reversed !== !(this.bounce && loop % 2);\n if (rev) {\n position = d - position;\n }\n\n this._deltaPosition = position - this.position;\n this.position = position;\n this.rawPosition = rawPosition + startAt;\n\n this.updatePosition(end, rev);\n\n return end;\n }\n\n protected updatePosition(end: boolean, rev: boolean) {\n if (!this.stepHead) {\n return;\n }\n let step = this.stepHead.next;\n const position = this.position;\n const duration = this.duration;\n if (this.target && step) {\n let stepNext = step.next;\n while (stepNext && stepNext.position <= position) {\n step = stepNext;\n stepNext = step.next;\n }\n let ratio = end ? (duration === 0 ? 1 : position / duration) : (position - step.position) / step.duration; // TODO: revisit this.\n if (step.easing) {\n ratio = step.easing(ratio);\n }\n // 判断这次和上次过程中是否经历了自定义step,如果跳过了自定义step那么执行自定义step的onEnd\n this.tryCallCustomAnimateLifeCycle(step, this._lastStep || (rev ? this.stepTail : this.stepHead), rev);\n // if (step !== this._lastStep) {\n // if (this._deltaPosition > 0) {\n // let _step = step.prev;\n // while (_step && _step !== this._lastStep) {\n // if (_step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // _step = _step.prev;\n // }\n // if (_step && _step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // } else if (this._deltaPosition < 0) {\n // let _step = step.next;\n // while (_step && _step !== this._lastStep) {\n // if (_step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // _step = _step.next;\n // }\n // if (_step && _step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // }\n // }\n this.updateTarget(step, ratio, end);\n this._lastStep = step;\n\n this.animate._onFrame && this.animate._onFrame.forEach(cb => cb(step, ratio));\n }\n }\n\n // 如果动画卡顿跳过了自定义动画,那么尝试执行自定义动画的生命周期\n tryCallCustomAnimateLifeCycle(step: IStep, lastStep: IStep, rev: boolean) {\n if (step === lastStep) {\n return;\n }\n if (rev) {\n let _step = lastStep.prev;\n while (_step && _step !== step) {\n if (_step.customAnimate) {\n _step.customAnimate.onStart && _step.customAnimate.onStart();\n _step.customAnimate.onEnd && _step.customAnimate.onEnd();\n }\n _step = step.prev;\n }\n // 执行lastStep的onEnd和currentStep的onStart\n if (lastStep && lastStep.customAnimate) {\n lastStep.customAnimate.onEnd && lastStep.customAnimate.onEnd();\n }\n if (step && step.customAnimate) {\n step.customAnimate.onStart && step.customAnimate.onStart();\n }\n } else {\n let _step = lastStep.next;\n while (_step && _step !== step) {\n if (_step.customAnimate) {\n _step.customAnimate.onStart && _step.customAnimate.onStart();\n _step.customAnimate.onEnd && _step.customAnimate.onEnd();\n }\n _step = _step.next;\n }\n // 执行lastStep的onEnd和currentStep的onStart\n if (lastStep && lastStep.customAnimate) {\n lastStep.customAnimate.onEnd && lastStep.customAnimate.onEnd();\n }\n if (step && step.customAnimate) {\n step.customAnimate.onStart && step.customAnimate.onStart();\n }\n }\n }\n\n /**\n * 获取这个属性的上一个值\n * @param name\n * @param step\n * @returns\n */\n getLastPropByName(name: string, step: Step): any {\n let lastStep = step.prev;\n while (lastStep) {\n if (lastStep.props && lastStep.props[name] !== undefined) {\n return lastStep.props[name];\n } else if (lastStep.customAnimate) {\n const val = lastStep.customAnimate.getEndProps()[name];\n if (val !== undefined) {\n return val;\n }\n }\n lastStep = lastStep.prev;\n }\n\n Logger.getInstance().warn('未知错误,step中找不到属性');\n return step.props[name];\n }\n\n protected updateTarget(step: Step, ratio: number, end: boolean) {\n if (step.props == null && step.customAnimate == null) {\n return;\n }\n this.target.onStep(this, this.animate, step, ratio, end);\n }\n}\n\n// export class Animate implements IAnimate {\n// declare target: IAnimateTarget;\n// declare timeline: ITimeline;\n// protected declare stepHead: Step;\n// protected declare stepTail: Step;\n// declare nextAnimate?: Animate;\n// declare prevAnimate?: Animate;\n// // 结束时反转动画\n// declare bounce: boolean;\n// // 是否reverse\n// declare reversed: boolean;\n// // 循环次数,0为执行一次,1为执行两次,Infinity为无限循环\n// declare loop: number;\n// // 持续时间,不包括循环\n// declare duration: number;\n// // 当前Animate的状态,正常,暂停,结束\n// declare status: AnimateStatus;\n// // 位置,在[0, duration]之间\n// declare position: number;\n// // 绝对的位置,在[0, loops * duration]之间\n// declare rawPosition: number;\n// // 开始时间\n// protected declare _startAt: number;\n// // 时间的缩放,例如2表示2倍速\n// declare timeScale: number;\n// declare props: Record<string, any>;\n// declare readonly id: string | number;\n\n// protected declare _onStart?: (() => void)[];\n// protected declare _onFrame?: ((step: IStep, ratio: number) => void)[];\n// protected declare _onEnd?: (() => void)[];\n// declare _onRemove?: (() => void)[];\n// declare _preventAttrs?: Set<string>;\n\n// constructor(id: string | number = Generator.GenAutoIncrementId(), timeline: ITimeline = defaultTimeline) {\n// this.timeline = timeline;\n// this.status = AnimateStatus.INITIAL;\n// this.rawPosition = -1;\n// this.position = 0;\n// this.loop = 0;\n// this.timeline.addAnimate(this);\n// this.timeScale = 1;\n// this.id = id;\n// this.props = {};\n// this.stepHead = new Step(0, 0, {});\n// this.stepTail = this.stepHead;\n// }\n\n// preventAttr(key: string) {\n// if (!this._preventAttrs) {\n// this._preventAttrs = new Set();\n// }\n// this._preventAttrs.add(key);\n// }\n// preventAttrs(keys: string[]) {\n// keys.forEach(key => this.preventAttr(key));\n// }\n// validAttr(key: string): boolean {\n// if (!this._preventAttrs) {\n// return true;\n// }\n// return !this._preventAttrs.has(key);\n// }\n\n// getLastPropByName(name: string, step: Step): any {\n// let lastStep = step.prev;\n// while (lastStep) {\n// if (lastStep.props && lastStep.props[name] !== undefined) {\n// return lastStep.props[name];\n// }\n// lastStep = lastStep.prev;\n// }\n// let val = this.props[name];\n// if (!val) {\n// console.warn('未知错误,step中找不到属性');\n// val = this.target.getComputedAttribute(name);\n// this.props[name] = val;\n// }\n\n// return val;\n// }\n\n// bind(target: IAnimateTarget) {\n// this.target = target;\n// this.duration = 0;\n// return this;\n// }\n\n// startAt(t: number) {\n// if (t < 0) {\n// return this;\n// }\n// this._startAt = t;\n// return this;\n// }\n\n// to(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n// if (duration == null || duration < 0) {\n// duration = 0;\n// }\n\n// const easingFunc = typeof easing === 'string' ? Easing[easing] : easing;\n\n// const step = this._addStep(duration, null, easingFunc);\n// this._appendProps(props, step, params ? params.tempProps : false);\n// return this;\n// }\n\n// wait(duration: number) {\n// if (duration > 0) {\n// const step = this._addStep(+duration, null);\n// if (step.prev) {\n// step.props = step.prev.props;\n// }\n// if (this.target.onAddStep) {\n// this.target.onAddStep(step);\n// }\n// }\n// return this;\n// }\n\n// protected _addStep(duration: number, props: any, easingFunc?: EasingTypeFunc) {\n// const step = new Step(this.duration, duration, props, easingFunc);\n// this.duration += duration;\n// this.stepTail.append(step);\n// this.stepTail = step;\n// return step;\n// }\n\n// protected _appendProps(props: any, step: Step, tempProps?: boolean) {\n// if (tempProps) {\n// step.props = props;\n// } else {\n// // todo: 是否需要深拷贝props\n// step.props = Object.assign({}, props);\n// }\n// let lastStep = step.prev;\n// const _props = step.props;\n// // 拷贝之前的step阶段属性\n// while (lastStep.prev) {\n// if (lastStep.props) {\n// if (!lastStep.propKeys) {\n// lastStep.propKeys = Object.keys(lastStep.props);\n// }\n// lastStep.propKeys.forEach(key => {\n// if (_props[key] === undefined) {\n// _props[key] = lastStep.props[key];\n// }\n// });\n// }\n// lastStep = lastStep.prev;\n// }\n\n// // 设置最初的props属性\n// const initProps = this.stepHead.props;\n// if (!step.propKeys) {\n// step.propKeys = Object.keys(_props);\n// step.propKeys.forEach(key => {\n// initProps[key] = this.target.getComputedAttribute(key);\n// });\n// }\n\n// if (this.target.onAddStep) {\n// this.target.onAddStep(step);\n// }\n// }\n\n// advance(delta: number) {\n// if (this.status === AnimateStatus.INITIAL) {\n// this.status = AnimateStatus.RUNNING;\n// this._onStart && this._onStart.forEach(cb => cb());\n// }\n// const end = this.setPosition(this.rawPosition + delta * this.timeScale);\n// if (end && this.status === AnimateStatus.RUNNING) {\n// this.status = AnimateStatus.END;\n// this._onEnd && this._onEnd.forEach(cb => cb());\n// }\n// }\n\n// setPosition(rawPosition: number) {\n// const d = this.duration;\n// const loopCount = this.loop;\n// const prevRawPos = this.rawPosition;\n// let end = false;\n// let loop: number; // 当前是第几次循环\n// let position: number; // 当前周期的时间\n// const startAt = this._startAt ?? 0;\n\n// if (rawPosition < 0) {\n// rawPosition = 0;\n// }\n// if (rawPosition < startAt) {\n// this.rawPosition = rawPosition;\n// return false;\n// }\n// rawPosition = rawPosition - startAt;\n// if (d <= 0) {\n// // 如果不用执行,跳过\n// end = true;\n// return end;\n// }\n// loop = Math.floor(rawPosition / d);\n// position = rawPosition - loop * d;\n\n// // 计算rawPosition\n// end = rawPosition >= loopCount * d + d;\n// // 如果结束,跳过\n// if (end) {\n// position = d;\n// loop = loopCount;\n// rawPosition = position * loop + d;\n// }\n\n// if (rawPosition === prevRawPos) {\n// return end;\n// }\n\n// // reverse动画\n// const rev = !this.reversed !== !(this.bounce && loop % 2);\n// if (rev) {\n// position = d - position;\n// }\n\n// this.position = position;\n// this.rawPosition = rawPosition + startAt;\n\n// this.updatePosition(end);\n\n// return end;\n// }\n\n// protected updatePosition(end: boolean) {\n// if (!this.stepHead) {\n// return;\n// }\n// let step = this.stepHead;\n// const position = this.position;\n// const duration = this.duration;\n// if (this.target && step) {\n// let stepNext = step.next;\n// while (stepNext && stepNext.position <= position) {\n// step = step.next;\n// stepNext = step.next;\n// }\n// let ratio = end ? (duration === 0 ? 1 : position / duration) : (position - step.position) / step.duration; // TODO: revisit this.\n// if (step.easing) {\n// ratio = step.easing(ratio);\n// }\n// this.updateTarget(step, ratio, end);\n// this._onFrame && this._onFrame.forEach(cb => cb(step, ratio));\n// }\n// }\n\n// protected updateTarget(step: Step, ratio: number, end: boolean) {\n// if (step.props == null) {\n// return;\n// }\n// this.target.onStep(this, step, ratio, end);\n// }\n\n// onStart(cb: () => void) {\n// if (!this._onStart) {\n// this._onStart = [];\n// }\n// this._onStart.push(cb);\n// }\n// onEnd(cb: () => void) {\n// if (!this._onEnd) {\n// this._onEnd = [];\n// }\n// this._onEnd.push(cb);\n// }\n// onRemove(cb: () => void) {\n// if (!this._onRemove) {\n// this._onRemove = [];\n// }\n// this._onRemove.push(cb);\n// }\n// onFrame(cb: (step: IStep, ratio: number) => void) {\n// if (!this._onFrame) {\n// this._onFrame = [];\n// }\n// this._onFrame.push(cb);\n// }\n\n// getStartProps() {\n// return this.stepHead?.props;\n// }\n\n// getEndProps(target: Record<string, any> = {}) {\n// let step = this.stepHead;\n// while (step) {\n// if (step.props) {\n// Object.assign(target, step.props);\n// }\n// step = step.next;\n// }\n\n// return target;\n// }\n\n// stop(nextVal?: 'start' | 'end' | Record<string, any>) {\n// this.status = AnimateStatus.END;\n// if (!nextVal) {\n// this.target.onStop();\n// }\n// if (nextVal === 'start') {\n// this.target.onStop(this.getStartProps());\n// } else if (nextVal === 'end') {\n// this.target.onStop(this.getEndProps());\n// } else {\n// this.target.onStop(nextVal);\n// }\n// }\n\n// release() {\n// this.status = AnimateStatus.END;\n// return;\n// }\n// }\n\nclass Step implements IStep {\n declare prev?: Step;\n // 持续时间\n declare duration: number;\n // 在animate中的位置\n declare position: number;\n declare next?: Step;\n declare props: any;\n // 保存解析后的props,用于性能优化\n declare parsedProps?: any;\n declare propKeys?: string[];\n declare easing?: EasingTypeFunc;\n declare customAnimate?: ICustomAnimate;\n // passive: boolean;\n // index: number;\n type: IAnimateStepType;\n\n constructor(position: number, duration: number, props?: any, easing?: EasingTypeFunc) {\n this.duration = duration;\n this.position = position;\n this.props = props;\n this.easing = easing;\n }\n\n append(step: Step) {\n step.prev = this;\n step.next = this.next;\n this.next = step;\n }\n\n getLastProps() {\n let step = this.prev;\n while (step) {\n if (step.props) {\n return step.props;\n } else if (step.customAnimate) {\n return step.customAnimate.getMergedEndProps();\n }\n step = step.prev as any;\n }\n return null;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/animate/animate.ts"],"names":[],"mappings":";;;AAaA,2CAAmG;AACnG,qCAAkC;AAClC,6CAA+C;AAC/C,yCAA6C;AAC7C,mDAAgD;AA2BhD,MAAsB,cAAc;IAgBlC,YAAY,IAAO,EAAE,EAAK,EAAE,QAAgB,EAAE,MAAkB,EAAE,MAAY;QAC5E,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,EAAE,GAAG,EAAE,C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AI,CAAC,IAAW,CAAC;SACzB;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF","file":"animate.js","sourcesContent":["import type {\n EasingType,\n EasingTypeFunc,\n IAnimate,\n IAnimateStepType,\n IAnimateTarget,\n ICustomAnimate,\n IGraphic,\n IStep,\n IStepConfig,\n ISubAnimate,\n ITimeline\n} from '../interface';\nimport { AnimateMode, AnimateStatus, AnimateStepType, AttributeUpdateType } from '../common/enums';\nimport { Easing } from './easing';\nimport { Logger, max } from '@visactor/vutils';\nimport { defaultTimeline } from './timeline';\nimport { Generator } from '../common/generator';\n\n// 参考TweenJS\n// https://github.com/CreateJS/TweenJS/tree/master/src/tweenjs\n/**\n * The MIT License (MIT)\n\n Copyright (c) 2014 gskinner.com, inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\nexport abstract class ACustomAnimate<T> implements ICustomAnimate {\n declare from: T;\n declare to: T;\n declare duration: number;\n declare easing: EasingType;\n declare params: any;\n declare target: IAnimateTarget;\n declare updateCount: number;\n declare subAnimate: ISubAnimate;\n declare step?: IStep;\n declare mode?: AnimateMode;\n\n // 用于判断是否一致\n declare _endProps?: any;\n declare _mergedEndProps?: any;\n\n constructor(from: T, to: T, duration: number, easing: EasingType, params?: any) {\n this.from = from;\n this.to = to;\n this.duration = duration;\n this.easing = easing;\n this.params = params;\n this.updateCount = 0;\n }\n\n bind(target: IAnimateTarget, subAni: ISubAnimate) {\n this.target = target;\n this.subAnimate = subAni;\n this.onBind();\n }\n\n // 在第一次调用的时候触发\n onBind() {\n return;\n }\n\n // 第一次执行的时候调用\n onFirstRun() {\n return;\n }\n\n // 开始执行的时候调用(如果有循环,那每个周期都会调用)\n onStart() {\n return;\n }\n\n // 结束执行的时候调用(如果有循环,那每个周期都会调用)\n onEnd() {\n return;\n }\n\n getEndProps(): Record<string, any> | void {\n return this.to;\n }\n\n getFromProps(): Record<string, any> | void {\n return this.from;\n }\n\n getMergedEndProps(): Record<string, any> | void {\n const thisEndProps = this.getEndProps();\n if (thisEndProps) {\n if (this._endProps === thisEndProps) {\n return this._mergedEndProps;\n }\n this._endProps = thisEndProps;\n this._mergedEndProps = Object.assign({}, this.step.prev.getLastProps() ?? {}, thisEndProps);\n return;\n }\n return this.step.prev ? this.step.prev.getLastProps() : thisEndProps;\n }\n\n // abstract getFromValue(key: string): any;\n // abstract getToValue(key: string): any;\n\n abstract onUpdate(end: boolean, ratio: number, out: Record<string, any>): void;\n\n update(end: boolean, ratio: number, out: Record<string, any>): void {\n if (this.updateCount === 0) {\n this.onFirstRun();\n // out添加之前的props\n const props = this.step.getLastProps();\n Object.keys(props).forEach(k => {\n if (this.subAnimate.animate.validAttr(k)) {\n out[k] = props[k];\n }\n });\n }\n this.updateCount += 1;\n this.onUpdate(end, ratio, out);\n if (end) {\n this.onEnd();\n }\n }\n}\n\nexport class CbAnimate extends ACustomAnimate<null> {\n cb: () => void;\n\n constructor(cb: () => void) {\n super(null, null, 0, 'linear');\n this.cb = cb;\n }\n\n onUpdate(end: boolean, ratio: number, out: Record<string, any>): void {\n return;\n }\n\n onStart(): void {\n this.cb();\n }\n}\n\ntype InterpolateFunc = (\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IAnimateTarget,\n out: Record<string, any>\n) => boolean;\n\nexport class Animate implements IAnimate {\n static mode: AnimateMode = AnimateMode.NORMAL;\n declare target: IAnimateTarget;\n declare timeline: ITimeline;\n declare nextAnimate?: IAnimate;\n declare prevAnimate?: IAnimate;\n // 当前Animate的状态,正常,暂停,结束\n declare status: AnimateStatus;\n declare readonly id: string | number;\n // 开始时间\n protected declare _startTime: number;\n protected declare _duringTime: number;\n declare subAnimates: SubAnimate[];\n declare tailAnimate: SubAnimate;\n\n // 绝对的位置\n declare rawPosition: number;\n // 时间倍速缩放\n declare timeScale: number;\n\n declare interpolateFunc: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n\n declare _onStart?: (() => void)[];\n declare _onFrame?: ((step: IStep, ratio: number) => void)[];\n declare _onEnd?: (() => void)[];\n declare _onRemove?: (() => void)[];\n declare _preventAttrs?: Set<string>;\n static interpolateMap: Map<string, InterpolateFunc> = new Map();\n slience?: boolean;\n\n constructor(\n id: string | number = Generator.GenAutoIncrementId(),\n timeline: ITimeline = defaultTimeline,\n slience?: boolean\n ) {\n this.id = id;\n this.timeline = timeline;\n this.status = AnimateStatus.INITIAL;\n this.tailAnimate = new SubAnimate(this);\n this.subAnimates = [this.tailAnimate];\n this.timeScale = 1;\n this.rawPosition = -1;\n this._startTime = 0;\n this._duringTime = 0;\n this.timeline.addAnimate(this);\n this.slience = slience;\n }\n\n setTimeline(timeline: ITimeline) {\n if (timeline === this.timeline) {\n return;\n }\n this.timeline.removeAnimate(this, false);\n timeline.addAnimate(this);\n }\n\n getStartTime(): number {\n return this._startTime;\n }\n\n getDuration(): number {\n return this.subAnimates.reduce((t, subAnimate) => t + subAnimate.totalDuration, 0);\n }\n\n after(animate: IAnimate) {\n const t = animate.getDuration();\n this._startTime = t;\n return this;\n }\n\n afterAll(list: IAnimate[]) {\n let maxT = -Infinity;\n list.forEach(a => {\n maxT = max(a.getDuration(), maxT);\n });\n this._startTime = maxT;\n return this;\n }\n\n parallel(animate: IAnimate) {\n this._startTime = animate.getStartTime();\n return this;\n }\n\n static AddInterpolate(name: string, cb: InterpolateFunc) {\n Animate.interpolateMap.set(name, cb);\n }\n\n play(customAnimate: ICustomAnimate) {\n this.tailAnimate.play(customAnimate);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n if (this.subAnimates.length === 1 && this.tailAnimate.totalDuration === customAnimate.duration) {\n this.trySetAttribute(customAnimate.getFromProps(), customAnimate.mode);\n }\n return this;\n }\n\n trySetAttribute(attr: Record<string, any> | void, mode: AnimateMode = Animate.mode) {\n if (attr && mode & AnimateMode.SET_ATTR_IMMEDIATELY) {\n (this.target as any).setAttributes &&\n (this.target as any).setAttributes(attr, false, { type: AttributeUpdateType.ANIMATE_PLAY });\n }\n }\n\n runCb(cb: (a: IAnimate, step: IStep) => void) {\n // this.tailAnimate.runCb(cb);\n const customAnimate = new CbAnimate(() => {\n cb(this, customAnimate.step.prev);\n });\n this.tailAnimate.play(customAnimate);\n return this;\n }\n\n /**\n * 自定义插值,返回false表示没有匹配上\n * @param key\n * @param from\n * @param to\n */\n customInterpolate(\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IAnimateTarget,\n ret: Record<string, any>\n ): boolean {\n const func = Animate.interpolateMap.get(key) || Animate.interpolateMap.get('');\n if (!func) {\n return false;\n }\n return func(key, ratio, from, to, target, ret);\n }\n\n pause() {\n if (this.status === AnimateStatus.RUNNING) {\n this.status = AnimateStatus.PAUSED;\n }\n }\n\n resume() {\n if (this.status === AnimateStatus.PAUSED) {\n this.status = AnimateStatus.RUNNING;\n }\n }\n\n to(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n this.tailAnimate.to(props, duration, easing, params);\n // 默认开始动画\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n // if (this.subAnimates.length === 1 && this.tailAnimate.duration === duration) {\n // this.trySetAttribute(props);\n // }\n return this;\n }\n from(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n this.tailAnimate.from(props, duration, easing, params);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n wait(duration: number) {\n this.tailAnimate.wait(duration);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n startAt(t: number) {\n this.tailAnimate.startAt(t);\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n loop(l: number) {\n this.tailAnimate.loop = l;\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n reversed(r: boolean) {\n this.tailAnimate.reversed = r;\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n bounce(b: boolean) {\n this.tailAnimate.bounce = b;\n // todo: 考虑使用绑定的ticker执行\n if (this.target) {\n const stage = (this.target as IGraphic).stage;\n stage && stage.renderNextFrame();\n }\n return this;\n }\n\n subAnimate() {\n const sa = new SubAnimate(this, this.tailAnimate);\n this.tailAnimate = sa;\n this.subAnimates.push(sa);\n sa.bind(this.target);\n return this;\n }\n\n getStartProps(): Record<string, any> {\n return this.subAnimates[0].getStartProps();\n }\n\n getEndProps(): Record<string, any> {\n return this.tailAnimate.getEndProps();\n }\n\n depreventAttr(key: string) {\n if (!this._preventAttrs) {\n return;\n }\n this._preventAttrs.delete(key);\n }\n preventAttr(key: string) {\n if (!this._preventAttrs) {\n this._preventAttrs = new Set();\n }\n this._preventAttrs.add(key);\n }\n preventAttrs(keys: string[]) {\n keys.forEach(key => this.preventAttr(key));\n }\n validAttr(key: string): boolean {\n if (!this._preventAttrs) {\n return true;\n }\n return !this._preventAttrs.has(key);\n }\n\n bind(target: IAnimateTarget) {\n this.target = target;\n\n if (this.target.onAnimateBind && !this.slience) {\n this.target.onAnimateBind(this);\n }\n\n this.subAnimates.forEach(sa => {\n sa.bind(target);\n });\n return this;\n }\n\n advance(delta: number) {\n // startTime之前的时间不计入耗时\n if (this._duringTime < this._startTime) {\n if (this._duringTime + delta * this.timeScale < this._startTime) {\n this._duringTime += delta * this.timeScale;\n return;\n }\n delta = this._duringTime + delta * this.timeScale - this._startTime;\n this._duringTime = this._startTime;\n }\n // 执行advance\n if (this.status === AnimateStatus.INITIAL) {\n this.status = AnimateStatus.RUNNING;\n this._onStart && this._onStart.forEach(cb => cb());\n }\n const end = this.setPosition(Math.max(this.rawPosition, 0) + delta * this.timeScale);\n if (end && this.status === AnimateStatus.RUNNING) {\n this.status = AnimateStatus.END;\n this._onEnd && this._onEnd.forEach(cb => cb());\n }\n }\n\n setPosition(rawPosition: number): boolean {\n let d = 0;\n let sa: SubAnimate | undefined;\n const prevRawPos = this.rawPosition;\n const maxRawPos = this.subAnimates.reduce((a, b) => a + b.totalDuration, 0);\n\n if (rawPosition < 0) {\n rawPosition = 0;\n }\n\n const end = rawPosition >= maxRawPos;\n\n if (end) {\n rawPosition = maxRawPos;\n }\n\n if (rawPosition === prevRawPos) {\n return end;\n }\n\n // 查找对应的subAnimate\n for (let i = 0; i < this.subAnimates.length; i++) {\n sa = this.subAnimates[i];\n if (d + sa.totalDuration >= rawPosition) {\n break;\n } else {\n d += sa.totalDuration;\n sa = undefined;\n }\n }\n this.rawPosition = rawPosition;\n sa.setPosition(rawPosition - d);\n\n return end;\n }\n\n onStart(cb: () => void) {\n if (!this._onStart) {\n this._onStart = [];\n }\n this._onStart.push(cb);\n }\n onEnd(cb: () => void) {\n if (!this._onEnd) {\n this._onEnd = [];\n }\n this._onEnd.push(cb);\n }\n onRemove(cb: () => void) {\n if (!this._onRemove) {\n this._onRemove = [];\n }\n this._onRemove.push(cb);\n }\n onFrame(cb: (step: IStep, ratio: number) => void) {\n if (!this._onFrame) {\n this._onFrame = [];\n }\n this._onFrame.push(cb);\n }\n release() {\n this.status = AnimateStatus.END;\n return;\n }\n\n stop(nextVal?: 'start' | 'end' | Record<string, any>) {\n if (!nextVal) {\n this.target.onStop();\n }\n if (nextVal === 'start') {\n this.target.onStop(this.getStartProps());\n } else if (nextVal === 'end') {\n this.target.onStop(this.getEndProps());\n } else {\n this.target.onStop(nextVal);\n }\n this.release();\n }\n}\n\n// Animate.mode |= AnimateMode.SET_ATTR_IMMEDIATELY;\n\nexport class SubAnimate implements ISubAnimate {\n declare target: IAnimateTarget;\n declare animate: IAnimate;\n // 默认的初始step,一定存在,且stepHead的props一定保存整个subAnimate阶段所有属性的最初\n protected declare stepHead: Step;\n protected declare stepTail: Step;\n // 结束时反转动画\n declare bounce: boolean;\n // 是否reverse\n declare reversed: boolean;\n // 循环次数,0为执行一次,1为执行两次,Infinity为无限循环\n declare loop: number;\n // 持续时间,不包括循环\n declare duration: number;\n // 位置,在[0, duration]之间\n declare position: number;\n // 绝对的位置,在[0, loops * duration]之间\n declare rawPosition: number;\n declare dirty: boolean;\n\n declare _totalDuration: number;\n declare _startAt: number;\n declare _lastStep: IStep;\n declare _deltaPosition: number;\n\n get totalDuration(): number {\n this.calcAttr();\n return this._totalDuration + this._startAt;\n }\n\n constructor(animate: IAnimate, lastSubAnimate?: SubAnimate) {\n this.rawPosition = -1;\n this.position = 0;\n this.loop = 0;\n this.duration = 0;\n this.animate = animate;\n if (lastSubAnimate) {\n this.stepHead = new Step(0, 0, Object.assign({}, lastSubAnimate.stepTail.props));\n } else {\n this.stepHead = new Step(0, 0, {});\n }\n this.stepTail = this.stepHead;\n this.dirty = true;\n this._startAt = 0;\n }\n\n // 计算按需计算的属性\n protected calcAttr() {\n if (!this.dirty) {\n return;\n }\n\n this._totalDuration = this.duration * (this.loop + 1);\n }\n\n bind(target: IAnimateTarget) {\n this.target = target;\n return this;\n }\n\n play(customAnimate: ICustomAnimate) {\n let duration = customAnimate.duration;\n if (duration == null || duration < 0) {\n duration = 0;\n }\n const easing = customAnimate.easing;\n const easingFunc = typeof easing === 'string' ? Easing[easing] : easing;\n const step = this._addStep(duration, null, easingFunc);\n step.type = AnimateStepType.customAnimate;\n this._appendProps(customAnimate.getEndProps(), step, false);\n this._appendCustomAnimate(customAnimate, step);\n return this;\n }\n\n // _appendPlayProps(step: IStep) {\n\n // return;\n // }\n\n to(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n if (duration == null || duration < 0) {\n duration = 0;\n }\n\n const easingFunc = typeof easing === 'string' ? Easing[easing] : easing;\n\n const step = this._addStep(duration, null, easingFunc);\n step.type = AnimateStepType.to;\n this._appendProps(props, step, params ? params.tempProps : false);\n // this._appendPlayProps(step);\n\n if (!step.propKeys) {\n step.propKeys = Object.keys(step.props);\n }\n if (!(params && params.noPreventAttrs)) {\n this.target.animates &&\n this.target.animates.forEach(a => {\n if (a.id !== this.animate.id) {\n a.preventAttrs(step.propKeys);\n }\n });\n }\n return this;\n }\n\n from(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n this.to(props, 0, easing, params);\n const toProps = {};\n if (!this.stepTail.propKeys) {\n this.stepTail.propKeys = Object.keys(this.stepTail.props);\n }\n this.stepTail.propKeys.forEach(k => {\n toProps[k] = this.getLastPropByName(k, this.stepTail);\n });\n this.to(toProps, duration, easing, params);\n this.stepTail.type = AnimateStepType.from;\n }\n\n startAt(t: number) {\n if (t < 0) {\n t = 0;\n }\n this._startAt = t;\n return this;\n }\n\n getStartProps() {\n return this.stepHead?.props;\n }\n\n getEndProps() {\n return this.stepTail.props;\n }\n\n getLastStep() {\n return this._lastStep;\n }\n\n wait(duration: number) {\n if (duration > 0) {\n const step = this._addStep(+duration, null);\n\n step.type = AnimateStepType.wait;\n // TODO 这里如果跳帧的话会存在bug\n if (step.prev.customAnimate) {\n step.props = step.prev.customAnimate.getEndProps();\n } else {\n step.props = step.prev.props;\n }\n if (this.target.onAddStep) {\n this.target.onAddStep(step);\n }\n // this._appendPlayProps(step);\n }\n return this;\n }\n\n protected _addStep(duration: number, props: any, easingFunc?: EasingTypeFunc) {\n const step = new Step(this.duration, duration, props, easingFunc);\n this.duration += duration;\n this.stepTail.append(step);\n this.stepTail = step;\n return step;\n }\n\n protected _appendProps(props: any, step: Step, tempProps?: boolean) {\n if (tempProps) {\n step.props = props;\n } else {\n // todo: 是否需要深拷贝props\n step.props = Object.assign({}, props);\n }\n let lastStep = step.prev;\n const _props = step.props;\n // 将undefined的属性设置到默认值\n if (!step.propKeys) {\n step.propKeys = Object.keys(step.props);\n }\n step.propKeys.forEach(k => {\n if (step.props[k] === undefined) {\n step.props[k] = this.target.getDefaultAttribute(k);\n }\n });\n // 拷贝之前的step阶段属性\n while (lastStep.prev) {\n if (lastStep.props) {\n if (!lastStep.propKeys) {\n lastStep.propKeys = Object.keys(lastStep.props);\n }\n lastStep.propKeys.forEach(key => {\n if (_props[key] === undefined) {\n _props[key] = lastStep.props[key];\n }\n });\n }\n // 重置propKeys\n step.propKeys = Object.keys(step.props);\n lastStep = lastStep.prev;\n }\n\n // 设置最初的props属性\n const initProps = this.stepHead.props;\n if (!step.propKeys) {\n step.propKeys = Object.keys(_props);\n }\n step.propKeys.forEach(key => {\n if (initProps[key] === undefined) {\n const parentAnimateInitProps = this.animate.getStartProps();\n initProps[key] = parentAnimateInitProps[key] = this.target.getComputedAttribute(key);\n }\n });\n\n if (this.target.onAddStep) {\n this.target.onAddStep(step);\n }\n }\n\n protected _appendCustomAnimate(customAnimate: ICustomAnimate, step: Step) {\n step.customAnimate = customAnimate;\n customAnimate.step = step;\n customAnimate.bind(this.target, this);\n }\n\n setPosition(rawPosition: number) {\n const d = this.duration;\n const loopCount = this.loop;\n const prevRawPos = this.rawPosition;\n let end = false;\n let loop: number; // 当前是第几次循环\n let position: number; // 当前周期的时间\n const startAt = this._startAt ?? 0;\n\n if (rawPosition < 0) {\n rawPosition = 0;\n }\n if (rawPosition < startAt) {\n this.rawPosition = rawPosition;\n return false;\n }\n rawPosition = rawPosition - startAt;\n if (d <= 0) {\n // 如果不用执行,跳过\n end = true;\n // 小于0的话,直接return,如果等于0,那还是得走动画逻辑,将end属性设置上去\n if (d < 0) {\n return end;\n }\n }\n loop = Math.floor(rawPosition / d);\n position = rawPosition - loop * d;\n\n // 计算rawPosition\n end = rawPosition >= loopCount * d + d;\n // 如果结束,跳过\n if (end) {\n position = d;\n loop = loopCount;\n rawPosition = position * loop + d;\n }\n\n if (rawPosition === prevRawPos) {\n return end;\n }\n\n // reverse动画\n const rev = !this.reversed !== !(this.bounce && loop % 2);\n if (rev) {\n position = d - position;\n }\n\n this._deltaPosition = position - this.position;\n this.position = position;\n this.rawPosition = rawPosition + startAt;\n\n this.updatePosition(end, rev);\n\n return end;\n }\n\n protected updatePosition(end: boolean, rev: boolean) {\n if (!this.stepHead) {\n return;\n }\n let step = this.stepHead.next;\n const position = this.position;\n const duration = this.duration;\n if (this.target && step) {\n let stepNext = step.next;\n while (stepNext && stepNext.position <= position) {\n step = stepNext;\n stepNext = step.next;\n }\n let ratio = end ? (duration === 0 ? 1 : position / duration) : (position - step.position) / step.duration; // TODO: revisit this.\n if (step.easing) {\n ratio = step.easing(ratio);\n }\n // 判断这次和上次过程中是否经历了自定义step,如果跳过了自定义step那么执行自定义step的onEnd\n this.tryCallCustomAnimateLifeCycle(step, this._lastStep || (rev ? this.stepTail : this.stepHead), rev);\n // if (step !== this._lastStep) {\n // if (this._deltaPosition > 0) {\n // let _step = step.prev;\n // while (_step && _step !== this._lastStep) {\n // if (_step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // _step = _step.prev;\n // }\n // if (_step && _step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // } else if (this._deltaPosition < 0) {\n // let _step = step.next;\n // while (_step && _step !== this._lastStep) {\n // if (_step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // _step = _step.next;\n // }\n // if (_step && _step.customAnimate) {\n // _step.customAnimate.onEnd();\n // }\n // }\n // }\n this.updateTarget(step, ratio, end);\n this._lastStep = step;\n\n this.animate._onFrame && this.animate._onFrame.forEach(cb => cb(step, ratio));\n }\n }\n\n // 如果动画卡顿跳过了自定义动画,那么尝试执行自定义动画的生命周期\n tryCallCustomAnimateLifeCycle(step: IStep, lastStep: IStep, rev: boolean) {\n if (step === lastStep) {\n return;\n }\n if (rev) {\n let _step = lastStep.prev;\n while (_step && _step !== step) {\n if (_step.customAnimate) {\n _step.customAnimate.onStart && _step.customAnimate.onStart();\n _step.customAnimate.onEnd && _step.customAnimate.onEnd();\n }\n _step = step.prev;\n }\n // 执行lastStep的onEnd和currentStep的onStart\n if (lastStep && lastStep.customAnimate) {\n lastStep.customAnimate.onEnd && lastStep.customAnimate.onEnd();\n }\n if (step && step.customAnimate) {\n step.customAnimate.onStart && step.customAnimate.onStart();\n }\n } else {\n let _step = lastStep.next;\n while (_step && _step !== step) {\n if (_step.customAnimate) {\n _step.customAnimate.onStart && _step.customAnimate.onStart();\n _step.customAnimate.onEnd && _step.customAnimate.onEnd();\n }\n _step = _step.next;\n }\n // 执行lastStep的onEnd和currentStep的onStart\n if (lastStep && lastStep.customAnimate) {\n lastStep.customAnimate.onEnd && lastStep.customAnimate.onEnd();\n }\n if (step && step.customAnimate) {\n step.customAnimate.onStart && step.customAnimate.onStart();\n }\n }\n }\n\n /**\n * 获取这个属性的上一个值\n * @param name\n * @param step\n * @returns\n */\n getLastPropByName(name: string, step: Step): any {\n let lastStep = step.prev;\n while (lastStep) {\n if (lastStep.props && lastStep.props[name] !== undefined) {\n return lastStep.props[name];\n } else if (lastStep.customAnimate) {\n const val = lastStep.customAnimate.getEndProps()[name];\n if (val !== undefined) {\n return val;\n }\n }\n lastStep = lastStep.prev;\n }\n\n Logger.getInstance().warn('未知错误,step中找不到属性');\n return step.props[name];\n }\n\n protected updateTarget(step: Step, ratio: number, end: boolean) {\n if (step.props == null && step.customAnimate == null) {\n return;\n }\n this.target.onStep(this, this.animate, step, ratio, end);\n }\n}\n\n// export class Animate implements IAnimate {\n// declare target: IAnimateTarget;\n// declare timeline: ITimeline;\n// protected declare stepHead: Step;\n// protected declare stepTail: Step;\n// declare nextAnimate?: Animate;\n// declare prevAnimate?: Animate;\n// // 结束时反转动画\n// declare bounce: boolean;\n// // 是否reverse\n// declare reversed: boolean;\n// // 循环次数,0为执行一次,1为执行两次,Infinity为无限循环\n// declare loop: number;\n// // 持续时间,不包括循环\n// declare duration: number;\n// // 当前Animate的状态,正常,暂停,结束\n// declare status: AnimateStatus;\n// // 位置,在[0, duration]之间\n// declare position: number;\n// // 绝对的位置,在[0, loops * duration]之间\n// declare rawPosition: number;\n// // 开始时间\n// protected declare _startAt: number;\n// // 时间的缩放,例如2表示2倍速\n// declare timeScale: number;\n// declare props: Record<string, any>;\n// declare readonly id: string | number;\n\n// protected declare _onStart?: (() => void)[];\n// protected declare _onFrame?: ((step: IStep, ratio: number) => void)[];\n// protected declare _onEnd?: (() => void)[];\n// declare _onRemove?: (() => void)[];\n// declare _preventAttrs?: Set<string>;\n\n// constructor(id: string | number = Generator.GenAutoIncrementId(), timeline: ITimeline = defaultTimeline) {\n// this.timeline = timeline;\n// this.status = AnimateStatus.INITIAL;\n// this.rawPosition = -1;\n// this.position = 0;\n// this.loop = 0;\n// this.timeline.addAnimate(this);\n// this.timeScale = 1;\n// this.id = id;\n// this.props = {};\n// this.stepHead = new Step(0, 0, {});\n// this.stepTail = this.stepHead;\n// }\n\n// preventAttr(key: string) {\n// if (!this._preventAttrs) {\n// this._preventAttrs = new Set();\n// }\n// this._preventAttrs.add(key);\n// }\n// preventAttrs(keys: string[]) {\n// keys.forEach(key => this.preventAttr(key));\n// }\n// validAttr(key: string): boolean {\n// if (!this._preventAttrs) {\n// return true;\n// }\n// return !this._preventAttrs.has(key);\n// }\n\n// getLastPropByName(name: string, step: Step): any {\n// let lastStep = step.prev;\n// while (lastStep) {\n// if (lastStep.props && lastStep.props[name] !== undefined) {\n// return lastStep.props[name];\n// }\n// lastStep = lastStep.prev;\n// }\n// let val = this.props[name];\n// if (!val) {\n// console.warn('未知错误,step中找不到属性');\n// val = this.target.getComputedAttribute(name);\n// this.props[name] = val;\n// }\n\n// return val;\n// }\n\n// bind(target: IAnimateTarget) {\n// this.target = target;\n// this.duration = 0;\n// return this;\n// }\n\n// startAt(t: number) {\n// if (t < 0) {\n// return this;\n// }\n// this._startAt = t;\n// return this;\n// }\n\n// to(props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) {\n// if (duration == null || duration < 0) {\n// duration = 0;\n// }\n\n// const easingFunc = typeof easing === 'string' ? Easing[easing] : easing;\n\n// const step = this._addStep(duration, null, easingFunc);\n// this._appendProps(props, step, params ? params.tempProps : false);\n// return this;\n// }\n\n// wait(duration: number) {\n// if (duration > 0) {\n// const step = this._addStep(+duration, null);\n// if (step.prev) {\n// step.props = step.prev.props;\n// }\n// if (this.target.onAddStep) {\n// this.target.onAddStep(step);\n// }\n// }\n// return this;\n// }\n\n// protected _addStep(duration: number, props: any, easingFunc?: EasingTypeFunc) {\n// const step = new Step(this.duration, duration, props, easingFunc);\n// this.duration += duration;\n// this.stepTail.append(step);\n// this.stepTail = step;\n// return step;\n// }\n\n// protected _appendProps(props: any, step: Step, tempProps?: boolean) {\n// if (tempProps) {\n// step.props = props;\n// } else {\n// // todo: 是否需要深拷贝props\n// step.props = Object.assign({}, props);\n// }\n// let lastStep = step.prev;\n// const _props = step.props;\n// // 拷贝之前的step阶段属性\n// while (lastStep.prev) {\n// if (lastStep.props) {\n// if (!lastStep.propKeys) {\n// lastStep.propKeys = Object.keys(lastStep.props);\n// }\n// lastStep.propKeys.forEach(key => {\n// if (_props[key] === undefined) {\n// _props[key] = lastStep.props[key];\n// }\n// });\n// }\n// lastStep = lastStep.prev;\n// }\n\n// // 设置最初的props属性\n// const initProps = this.stepHead.props;\n// if (!step.propKeys) {\n// step.propKeys = Object.keys(_props);\n// step.propKeys.forEach(key => {\n// initProps[key] = this.target.getComputedAttribute(key);\n// });\n// }\n\n// if (this.target.onAddStep) {\n// this.target.onAddStep(step);\n// }\n// }\n\n// advance(delta: number) {\n// if (this.status === AnimateStatus.INITIAL) {\n// this.status = AnimateStatus.RUNNING;\n// this._onStart && this._onStart.forEach(cb => cb());\n// }\n// const end = this.setPosition(this.rawPosition + delta * this.timeScale);\n// if (end && this.status === AnimateStatus.RUNNING) {\n// this.status = AnimateStatus.END;\n// this._onEnd && this._onEnd.forEach(cb => cb());\n// }\n// }\n\n// setPosition(rawPosition: number) {\n// const d = this.duration;\n// const loopCount = this.loop;\n// const prevRawPos = this.rawPosition;\n// let end = false;\n// let loop: number; // 当前是第几次循环\n// let position: number; // 当前周期的时间\n// const startAt = this._startAt ?? 0;\n\n// if (rawPosition < 0) {\n// rawPosition = 0;\n// }\n// if (rawPosition < startAt) {\n// this.rawPosition = rawPosition;\n// return false;\n// }\n// rawPosition = rawPosition - startAt;\n// if (d <= 0) {\n// // 如果不用执行,跳过\n// end = true;\n// return end;\n// }\n// loop = Math.floor(rawPosition / d);\n// position = rawPosition - loop * d;\n\n// // 计算rawPosition\n// end = rawPosition >= loopCount * d + d;\n// // 如果结束,跳过\n// if (end) {\n// position = d;\n// loop = loopCount;\n// rawPosition = position * loop + d;\n// }\n\n// if (rawPosition === prevRawPos) {\n// return end;\n// }\n\n// // reverse动画\n// const rev = !this.reversed !== !(this.bounce && loop % 2);\n// if (rev) {\n// position = d - position;\n// }\n\n// this.position = position;\n// this.rawPosition = rawPosition + startAt;\n\n// this.updatePosition(end);\n\n// return end;\n// }\n\n// protected updatePosition(end: boolean) {\n// if (!this.stepHead) {\n// return;\n// }\n// let step = this.stepHead;\n// const position = this.position;\n// const duration = this.duration;\n// if (this.target && step) {\n// let stepNext = step.next;\n// while (stepNext && stepNext.position <= position) {\n// step = step.next;\n// stepNext = step.next;\n// }\n// let ratio = end ? (duration === 0 ? 1 : position / duration) : (position - step.position) / step.duration; // TODO: revisit this.\n// if (step.easing) {\n// ratio = step.easing(ratio);\n// }\n// this.updateTarget(step, ratio, end);\n// this._onFrame && this._onFrame.forEach(cb => cb(step, ratio));\n// }\n// }\n\n// protected updateTarget(step: Step, ratio: number, end: boolean) {\n// if (step.props == null) {\n// return;\n// }\n// this.target.onStep(this, step, ratio, end);\n// }\n\n// onStart(cb: () => void) {\n// if (!this._onStart) {\n// this._onStart = [];\n// }\n// this._onStart.push(cb);\n// }\n// onEnd(cb: () => void) {\n// if (!this._onEnd) {\n// this._onEnd = [];\n// }\n// this._onEnd.push(cb);\n// }\n// onRemove(cb: () => void) {\n// if (!this._onRemove) {\n// this._onRemove = [];\n// }\n// this._onRemove.push(cb);\n// }\n// onFrame(cb: (step: IStep, ratio: number) => void) {\n// if (!this._onFrame) {\n// this._onFrame = [];\n// }\n// this._onFrame.push(cb);\n// }\n\n// getStartProps() {\n// return this.stepHead?.props;\n// }\n\n// getEndProps(target: Record<string, any> = {}) {\n// let step = this.stepHead;\n// while (step) {\n// if (step.props) {\n// Object.assign(target, step.props);\n// }\n// step = step.next;\n// }\n\n// return target;\n// }\n\n// stop(nextVal?: 'start' | 'end' | Record<string, any>) {\n// this.status = AnimateStatus.END;\n// if (!nextVal) {\n// this.target.onStop();\n// }\n// if (nextVal === 'start') {\n// this.target.onStop(this.getStartProps());\n// } else if (nextVal === 'end') {\n// this.target.onStop(this.getEndProps());\n// } else {\n// this.target.onStop(nextVal);\n// }\n// }\n\n// release() {\n// this.status = AnimateStatus.END;\n// return;\n// }\n// }\n\nclass Step implements IStep {\n declare prev?: Step;\n // 持续时间\n declare duration: number;\n // 在animate中的位置\n declare position: number;\n declare next?: Step;\n declare props: any;\n // 保存解析后的props,用于性能优化\n declare parsedProps?: any;\n declare propKeys?: string[];\n declare easing?: EasingTypeFunc;\n declare customAnimate?: ICustomAnimate;\n // passive: boolean;\n // index: number;\n type: IAnimateStepType;\n\n constructor(position: number, duration: number, props?: any, easing?: EasingTypeFunc) {\n this.duration = duration;\n this.position = position;\n this.props = props;\n this.easing = easing;\n }\n\n append(step: Step) {\n step.prev = this;\n step.next = this.next;\n this.next = step;\n }\n\n getLastProps() {\n let step = this.prev;\n while (step) {\n if (step.props) {\n return step.props;\n } else if (step.customAnimate) {\n return step.customAnimate.getMergedEndProps();\n }\n step = step.prev as any;\n }\n return null;\n }\n}\n"]}
@@ -102,6 +102,7 @@ export interface IAnimate {
102
102
  getStartProps: () => Record<string, any>;
103
103
  getEndProps: () => Record<string, any>;
104
104
  setTimeline: (timeline: ITimeline) => void;
105
+ readonly timeline: ITimeline;
105
106
  bind: (target: IAnimateTarget) => this;
106
107
  to: (props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) => this;
107
108
  from: (props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) => this;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/animate.ts"],"names":[],"mappings":"","file":"animate.js","sourcesContent":["import type { AnimateMode, AnimateStatus, AnimateStepType } from '../common/enums';\nimport type { Releaseable } from './common';\nimport type { IGraphic } from './graphic';\n\n// export type EasingType = (...args: any) => any;\n\nexport declare class Easing {\n static linear(t: number): number;\n static none(): typeof Easing.linear;\n /**\n * 获取缓动函数,amount指示这个缓动函数的插值方式\n * @param amount\n * @returns\n */\n static get(amount: number): (t: number) => number;\n static getPowIn(pow: number): (t: number) => number;\n static getPowOut(pow: number): (t: number) => number;\n static getPowInOut(pow: number): (t: number) => number;\n static quadIn: (t: number) => number;\n static quadOut: (t: number) => number;\n static quadInOut: (t: number) => number;\n static cubicIn: (t: number) => number;\n static cubicOut: (t: number) => number;\n static cubicInOut: (t: number) => number;\n static quartIn: (t: number) => number;\n static quartOut: (t: number) => number;\n static quartInOut: (t: number) => number;\n static quintIn: (t: number) => number;\n static quintOut: (t: number) => number;\n static quintInOut: (t: number) => number;\n static getBackIn(amount: number): (t: number) => number;\n static getBackOut(amount: number): (t: number) => number;\n static getBackInOut(amount: number): (t: number) => number;\n static backIn: (t: number) => number;\n static backOut: (t: number) => number;\n static backInOut: (t: number) => number;\n static circIn(t: number): number;\n static circOut(t: number): number;\n static circInOut(t: number): number;\n static bounceOut(t: number): number;\n static bounceIn(t: number): number;\n static bounceInOut(t: number): number;\n static getElasticIn(amplitude: number, period: number): (t: number) => number;\n static getElasticOut(amplitude: number, period: number): (t: number) => number;\n static getElasticInOut(amplitude: number, period: number): (t: number) => number;\n static elasticIn: (t: number) => number;\n static elasticOut: (t: number) => number;\n static elasticInOut: (t: number) => number;\n}\n\n// timeline管理一堆的animate,多个timeline互不影响\n// timeline主要作用是基于layer层面的整体管理\n// 每个layer默认带有一个timeline\nexport interface Timeline {\n AnimateList: IAnimate[];\n}\n\ntype IStopType = 'end' | 'start' | 'current';\n\n// TODO: 提供options配置可序列化\ninterface AnimateSpecItem {\n type: 'to' | 'delay' | 'stop' | 'any';\n params: any[];\n}\n\nexport type EasingTypeStr =\n | 'linear'\n | 'quadIn'\n | 'quadOut'\n | 'quadInOut'\n | 'quadInOut'\n | 'cubicIn'\n | 'cubicOut'\n | 'cubicInOut'\n | 'quartIn'\n | 'quartOut'\n | 'quartInOut'\n | 'quintIn'\n | 'quintOut'\n | 'quintInOut'\n | 'backIn'\n | 'backOut'\n | 'backInOut'\n | 'circIn'\n | 'circOut'\n | 'circInOut'\n | 'bounceOut'\n | 'bounceIn'\n | 'bounceInOut'\n | 'elasticIn'\n | 'elasticOut'\n | 'elasticInOut'\n | 'sineIn'\n | 'sineOut'\n | 'sineInOut'\n | 'expoIn'\n | 'expoOut'\n | 'expoInOut'\n | '';\nexport type EasingTypeFunc = (t: number) => number;\n\nexport type EasingType = EasingTypeStr | EasingTypeFunc;\n\nexport type IAnimateStepType = keyof typeof AnimateStepType;\n\nexport interface IStep {\n type: IAnimateStepType;\n prev?: IStep;\n // 持续时间\n duration: number;\n // 在animate中的位置\n position: number;\n next?: IStep;\n props?: any;\n parsedProps?: any;\n propKeys?: string[];\n easing?: EasingTypeFunc;\n customAnimate?: ICustomAnimate;\n\n append: (step: IStep) => void;\n getLastProps: () => any;\n}\n\nexport interface IStepConfig {\n tempProps?: boolean; // props为临时props,可以直接使用不用拷贝\n noPreventAttrs?: boolean;\n}\n\nexport interface IAnimateTarget {\n onAnimateBind?: (animte: IAnimate | ISubAnimate) => void;\n // 添加动画step的时候调用\n onAddStep?: (step: IStep) => void;\n // step时调用\n onStep: (subAnimate: ISubAnimate, animate: IAnimate, step: IStep, ratio: number, end: boolean) => void;\n // 插值函数\n stepInterpolate: (\n subAnimate: ISubAnimate,\n animate: IAnimate,\n nextAttributes: Record<string, any>,\n step: IStep,\n ratio: number,\n end: boolean,\n nextProps: Record<string, any>,\n lastProps?: Record<string, any>,\n nextParsedProps?: any,\n propKeys?: string[]\n ) => void;\n // 获取属性\n getComputedAttribute: (name: string) => any;\n // 获取默认属性\n getDefaultAttribute: (name: string) => any;\n onStop: (props?: Record<string, any>) => void;\n animates: Map<string | number, IAnimate>;\n [key: string]: any;\n}\n\nexport interface ICustomAnimate {\n duration: number;\n easing: EasingType;\n step?: IStep;\n mode?: AnimateMode;\n\n bind: (target: IAnimateTarget, subAni: ISubAnimate) => void;\n // 在第一次调用的时候触发\n onBind: () => void;\n // 第一次执行的时候调用\n onFirstRun: () => void;\n // 开始执行的时候调用(如果有循环,那每个周期都会调用)\n onStart: () => void;\n // 结束执行的时候调用(如果有循环,那每个周期都会调用)\n onEnd: () => void;\n onUpdate: (end: boolean, ratio: number, out: Record<string, any>) => void;\n update: (end: boolean, ratio: number, out: Record<string, any>) => void;\n getEndProps: () => Record<string, any> | void;\n getFromProps: () => Record<string, any> | void;\n getMergedEndProps: () => Record<string, any> | void;\n}\n\n// 每一个animate绑定一个graphic,用于描述这个graphic的动画内容\n// 在timeline层面,animate相当于是一段timeslice\nexport interface IAnimate {\n readonly id: string | number;\n status: AnimateStatus;\n\n interpolateFunc: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n\n _onStart?: (() => void)[];\n _onFrame?: ((step: IStep, ratio: number) => void)[];\n _onEnd?: (() => void)[];\n _onRemove?: (() => void)[];\n\n getStartProps: () => Record<string, any>;\n getEndProps: () => Record<string, any>;\n\n setTimeline: (timeline: ITimeline) => void;\n\n bind: (target: IAnimateTarget) => this;\n to: (props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) => this;\n from: (props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) => this;\n pause: () => void;\n resume: () => void;\n onStart: (cb: () => void) => void;\n onEnd: (cb: () => void) => void;\n onFrame: (cb: (step: IStep, ratio: number) => void) => void;\n // 屏蔽属性\n preventAttr: (key: string) => void;\n // 屏蔽属性\n preventAttrs: (key: string[]) => void;\n // 属性是否合法\n validAttr: (key: string) => boolean;\n\n runCb: (cb: (a: IAnimate, step: IStep) => void) => IAnimate;\n\n // 自定义插值,返回false表示没有匹配上\n customInterpolate: (\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IAnimateTarget,\n ret: Record<string, any>\n ) => boolean;\n //\n play: (customAnimate: ICustomAnimate) => this;\n\n // 获取该属性的上一个值\n // getLastPropByName: (name: string, step: IStep) => any;\n // delay: (duration: number) => IAnimate;\n stop: (type?: 'start' | 'end' | Record<string, any>) => void;\n /** 打上END标志,下一帧被删除 */\n release: () => void;\n // 获取持续的时长\n getDuration: () => number;\n // 获取动画开始时间(注意并不是子动画的startAt)\n getStartTime: () => number;\n // done: (cb: (_: any) => any) => IAnimate;\n // pause: () => IAnimate;\n // spec: (spec: AnimateSpecItem[]) => IAnimate;\n // start: () => void; // 有start方法,避免动画提前开始(VGrammar需要时间处理数据)\n wait: (delay: number) => this;\n\n // // 编排\n afterAll: (list: IAnimate[]) => this;\n after: (animate: IAnimate) => this;\n parallel: (animate: IAnimate) => this;\n\n // // timislice (getter)\n // startTime: number;\n // endTime: number;\n // startTimes: number[];\n // endTimes: number[];\n\n // // 高级参数,frame到frameEnd之间可以进行reverse,loop,bounce效果\n // frame: () => IAnimate;\n // frameEnd: () => IAnimate;\n reversed: (r: boolean) => IAnimate;\n loop: (n: number) => IAnimate;\n bounce: (b: boolean) => IAnimate;\n\n nextAnimate?: IAnimate;\n prevAnimate?: IAnimate;\n\n advance: (delta: number) => void;\n\n startAt: (t: number) => IAnimate;\n\n // // 语法糖\n // create: (duration: number) => IAnimate;\n // fadeIn: (duration: number) => IAnimate;\n}\n\nexport interface ISubAnimate {\n getLastStep: () => IStep;\n animate: IAnimate;\n // 获取该属性的上一个值\n getLastPropByName: (name: string, step: IStep) => any;\n}\n\n// rect.animate().abc().to({}, 1000).delay(1000).frame().to().delay().to().frameEnd().loop().bounce()\n\nexport interface BaseAnimateConfig {\n id?: number | string;\n interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n onStart?: () => void;\n onFrame?: (step: IStep, ratio: number) => void;\n onEnd?: () => void;\n onRemove?: () => void;\n}\n\n// VGrammar和 vrender命名不一致,好尴尬\nexport interface MorphingAnimateConfig extends Omit<BaseAnimateConfig, 'interpolate'> {\n duration?: number;\n easing?: EasingType; // 统一到easing\n delay?: number;\n}\n\nexport interface MultiMorphingAnimateConfig extends MorphingAnimateConfig {\n splitPath?: 'clone' | ((graphic: IGraphic, count: number, needAppend?: boolean) => IGraphic[]);\n individualDelay?: (index: number, count: number, fromGraphic: IGraphic, toGraphic: IGraphic) => number;\n}\n\nexport interface ITimeline {\n id: number;\n animateCount: number;\n addAnimate: (animate: IAnimate) => void;\n removeAnimate: (animate: IAnimate, release?: boolean) => void;\n tick: (delta: number) => void;\n clear: () => void;\n pause: () => void;\n resume: () => void;\n}\n\nexport interface ITickHandler extends Releaseable {\n avaliable: () => boolean;\n /**\n * 开始执行tick\n * @param interval 延时 ms\n * @param cb 执行的回调\n */\n tick: (interval: number, cb: (handler: ITickHandler) => void) => void; // 开始\n tickTo?: (t: number, cb: (handler: ITickHandler, params?: { once: boolean }) => void) => void;\n getTime: () => number; // 获取时间\n}\n\nexport interface ITickerHandlerStatic {\n Avaliable: () => boolean;\n new (): ITickHandler;\n}\n\nexport interface ITicker {\n setFPS?: (fps: number) => void;\n setInterval?: (interval: number) => void;\n getFPS?: () => number;\n getInterval?: () => number;\n tick: (interval: number) => void;\n tickAt?: (time: number) => void;\n pause: () => boolean;\n resume: () => boolean;\n /**\n * 开启tick,force为true强制开启,否则如果timeline为空则不开启\n */\n start: (force?: boolean) => boolean;\n stop: () => void;\n addTimeline: (timeline: ITimeline) => void;\n remTimeline: (timeline: ITimeline) => void;\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/animate.ts"],"names":[],"mappings":"","file":"animate.js","sourcesContent":["import type { AnimateMode, AnimateStatus, AnimateStepType } from '../common/enums';\nimport type { Releaseable } from './common';\nimport type { IGraphic } from './graphic';\n\n// export type EasingType = (...args: any) => any;\n\nexport declare class Easing {\n static linear(t: number): number;\n static none(): typeof Easing.linear;\n /**\n * 获取缓动函数,amount指示这个缓动函数的插值方式\n * @param amount\n * @returns\n */\n static get(amount: number): (t: number) => number;\n static getPowIn(pow: number): (t: number) => number;\n static getPowOut(pow: number): (t: number) => number;\n static getPowInOut(pow: number): (t: number) => number;\n static quadIn: (t: number) => number;\n static quadOut: (t: number) => number;\n static quadInOut: (t: number) => number;\n static cubicIn: (t: number) => number;\n static cubicOut: (t: number) => number;\n static cubicInOut: (t: number) => number;\n static quartIn: (t: number) => number;\n static quartOut: (t: number) => number;\n static quartInOut: (t: number) => number;\n static quintIn: (t: number) => number;\n static quintOut: (t: number) => number;\n static quintInOut: (t: number) => number;\n static getBackIn(amount: number): (t: number) => number;\n static getBackOut(amount: number): (t: number) => number;\n static getBackInOut(amount: number): (t: number) => number;\n static backIn: (t: number) => number;\n static backOut: (t: number) => number;\n static backInOut: (t: number) => number;\n static circIn(t: number): number;\n static circOut(t: number): number;\n static circInOut(t: number): number;\n static bounceOut(t: number): number;\n static bounceIn(t: number): number;\n static bounceInOut(t: number): number;\n static getElasticIn(amplitude: number, period: number): (t: number) => number;\n static getElasticOut(amplitude: number, period: number): (t: number) => number;\n static getElasticInOut(amplitude: number, period: number): (t: number) => number;\n static elasticIn: (t: number) => number;\n static elasticOut: (t: number) => number;\n static elasticInOut: (t: number) => number;\n}\n\n// timeline管理一堆的animate,多个timeline互不影响\n// timeline主要作用是基于layer层面的整体管理\n// 每个layer默认带有一个timeline\nexport interface Timeline {\n AnimateList: IAnimate[];\n}\n\ntype IStopType = 'end' | 'start' | 'current';\n\n// TODO: 提供options配置可序列化\ninterface AnimateSpecItem {\n type: 'to' | 'delay' | 'stop' | 'any';\n params: any[];\n}\n\nexport type EasingTypeStr =\n | 'linear'\n | 'quadIn'\n | 'quadOut'\n | 'quadInOut'\n | 'quadInOut'\n | 'cubicIn'\n | 'cubicOut'\n | 'cubicInOut'\n | 'quartIn'\n | 'quartOut'\n | 'quartInOut'\n | 'quintIn'\n | 'quintOut'\n | 'quintInOut'\n | 'backIn'\n | 'backOut'\n | 'backInOut'\n | 'circIn'\n | 'circOut'\n | 'circInOut'\n | 'bounceOut'\n | 'bounceIn'\n | 'bounceInOut'\n | 'elasticIn'\n | 'elasticOut'\n | 'elasticInOut'\n | 'sineIn'\n | 'sineOut'\n | 'sineInOut'\n | 'expoIn'\n | 'expoOut'\n | 'expoInOut'\n | '';\nexport type EasingTypeFunc = (t: number) => number;\n\nexport type EasingType = EasingTypeStr | EasingTypeFunc;\n\nexport type IAnimateStepType = keyof typeof AnimateStepType;\n\nexport interface IStep {\n type: IAnimateStepType;\n prev?: IStep;\n // 持续时间\n duration: number;\n // 在animate中的位置\n position: number;\n next?: IStep;\n props?: any;\n parsedProps?: any;\n propKeys?: string[];\n easing?: EasingTypeFunc;\n customAnimate?: ICustomAnimate;\n\n append: (step: IStep) => void;\n getLastProps: () => any;\n}\n\nexport interface IStepConfig {\n tempProps?: boolean; // props为临时props,可以直接使用不用拷贝\n noPreventAttrs?: boolean;\n}\n\nexport interface IAnimateTarget {\n onAnimateBind?: (animte: IAnimate | ISubAnimate) => void;\n // 添加动画step的时候调用\n onAddStep?: (step: IStep) => void;\n // step时调用\n onStep: (subAnimate: ISubAnimate, animate: IAnimate, step: IStep, ratio: number, end: boolean) => void;\n // 插值函数\n stepInterpolate: (\n subAnimate: ISubAnimate,\n animate: IAnimate,\n nextAttributes: Record<string, any>,\n step: IStep,\n ratio: number,\n end: boolean,\n nextProps: Record<string, any>,\n lastProps?: Record<string, any>,\n nextParsedProps?: any,\n propKeys?: string[]\n ) => void;\n // 获取属性\n getComputedAttribute: (name: string) => any;\n // 获取默认属性\n getDefaultAttribute: (name: string) => any;\n onStop: (props?: Record<string, any>) => void;\n animates: Map<string | number, IAnimate>;\n [key: string]: any;\n}\n\nexport interface ICustomAnimate {\n duration: number;\n easing: EasingType;\n step?: IStep;\n mode?: AnimateMode;\n\n bind: (target: IAnimateTarget, subAni: ISubAnimate) => void;\n // 在第一次调用的时候触发\n onBind: () => void;\n // 第一次执行的时候调用\n onFirstRun: () => void;\n // 开始执行的时候调用(如果有循环,那每个周期都会调用)\n onStart: () => void;\n // 结束执行的时候调用(如果有循环,那每个周期都会调用)\n onEnd: () => void;\n onUpdate: (end: boolean, ratio: number, out: Record<string, any>) => void;\n update: (end: boolean, ratio: number, out: Record<string, any>) => void;\n getEndProps: () => Record<string, any> | void;\n getFromProps: () => Record<string, any> | void;\n getMergedEndProps: () => Record<string, any> | void;\n}\n\n// 每一个animate绑定一个graphic,用于描述这个graphic的动画内容\n// 在timeline层面,animate相当于是一段timeslice\nexport interface IAnimate {\n readonly id: string | number;\n status: AnimateStatus;\n\n interpolateFunc: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n\n _onStart?: (() => void)[];\n _onFrame?: ((step: IStep, ratio: number) => void)[];\n _onEnd?: (() => void)[];\n _onRemove?: (() => void)[];\n\n getStartProps: () => Record<string, any>;\n getEndProps: () => Record<string, any>;\n\n setTimeline: (timeline: ITimeline) => void;\n // getTimeline: () => ITimeline;\n readonly timeline: ITimeline;\n\n bind: (target: IAnimateTarget) => this;\n to: (props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) => this;\n from: (props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) => this;\n pause: () => void;\n resume: () => void;\n onStart: (cb: () => void) => void;\n onEnd: (cb: () => void) => void;\n onFrame: (cb: (step: IStep, ratio: number) => void) => void;\n // 屏蔽属性\n preventAttr: (key: string) => void;\n // 屏蔽属性\n preventAttrs: (key: string[]) => void;\n // 属性是否合法\n validAttr: (key: string) => boolean;\n\n runCb: (cb: (a: IAnimate, step: IStep) => void) => IAnimate;\n\n // 自定义插值,返回false表示没有匹配上\n customInterpolate: (\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IAnimateTarget,\n ret: Record<string, any>\n ) => boolean;\n //\n play: (customAnimate: ICustomAnimate) => this;\n\n // 获取该属性的上一个值\n // getLastPropByName: (name: string, step: IStep) => any;\n // delay: (duration: number) => IAnimate;\n stop: (type?: 'start' | 'end' | Record<string, any>) => void;\n /** 打上END标志,下一帧被删除 */\n release: () => void;\n // 获取持续的时长\n getDuration: () => number;\n // 获取动画开始时间(注意并不是子动画的startAt)\n getStartTime: () => number;\n // done: (cb: (_: any) => any) => IAnimate;\n // pause: () => IAnimate;\n // spec: (spec: AnimateSpecItem[]) => IAnimate;\n // start: () => void; // 有start方法,避免动画提前开始(VGrammar需要时间处理数据)\n wait: (delay: number) => this;\n\n // // 编排\n afterAll: (list: IAnimate[]) => this;\n after: (animate: IAnimate) => this;\n parallel: (animate: IAnimate) => this;\n\n // // timislice (getter)\n // startTime: number;\n // endTime: number;\n // startTimes: number[];\n // endTimes: number[];\n\n // // 高级参数,frame到frameEnd之间可以进行reverse,loop,bounce效果\n // frame: () => IAnimate;\n // frameEnd: () => IAnimate;\n reversed: (r: boolean) => IAnimate;\n loop: (n: number) => IAnimate;\n bounce: (b: boolean) => IAnimate;\n\n nextAnimate?: IAnimate;\n prevAnimate?: IAnimate;\n\n advance: (delta: number) => void;\n\n startAt: (t: number) => IAnimate;\n\n // // 语法糖\n // create: (duration: number) => IAnimate;\n // fadeIn: (duration: number) => IAnimate;\n}\n\nexport interface ISubAnimate {\n getLastStep: () => IStep;\n animate: IAnimate;\n // 获取该属性的上一个值\n getLastPropByName: (name: string, step: IStep) => any;\n}\n\n// rect.animate().abc().to({}, 1000).delay(1000).frame().to().delay().to().frameEnd().loop().bounce()\n\nexport interface BaseAnimateConfig {\n id?: number | string;\n interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n onStart?: () => void;\n onFrame?: (step: IStep, ratio: number) => void;\n onEnd?: () => void;\n onRemove?: () => void;\n}\n\n// VGrammar和 vrender命名不一致,好尴尬\nexport interface MorphingAnimateConfig extends Omit<BaseAnimateConfig, 'interpolate'> {\n duration?: number;\n easing?: EasingType; // 统一到easing\n delay?: number;\n}\n\nexport interface MultiMorphingAnimateConfig extends MorphingAnimateConfig {\n splitPath?: 'clone' | ((graphic: IGraphic, count: number, needAppend?: boolean) => IGraphic[]);\n individualDelay?: (index: number, count: number, fromGraphic: IGraphic, toGraphic: IGraphic) => number;\n}\n\nexport interface ITimeline {\n id: number;\n animateCount: number;\n addAnimate: (animate: IAnimate) => void;\n removeAnimate: (animate: IAnimate, release?: boolean) => void;\n tick: (delta: number) => void;\n clear: () => void;\n pause: () => void;\n resume: () => void;\n}\n\nexport interface ITickHandler extends Releaseable {\n avaliable: () => boolean;\n /**\n * 开始执行tick\n * @param interval 延时 ms\n * @param cb 执行的回调\n */\n tick: (interval: number, cb: (handler: ITickHandler) => void) => void; // 开始\n tickTo?: (t: number, cb: (handler: ITickHandler, params?: { once: boolean }) => void) => void;\n getTime: () => number; // 获取时间\n}\n\nexport interface ITickerHandlerStatic {\n Avaliable: () => boolean;\n new (): ITickHandler;\n}\n\nexport interface ITicker {\n setFPS?: (fps: number) => void;\n setInterval?: (interval: number) => void;\n getFPS?: () => number;\n getInterval?: () => number;\n tick: (interval: number) => void;\n tickAt?: (time: number) => void;\n pause: () => boolean;\n resume: () => boolean;\n /**\n * 开启tick,force为true强制开启,否则如果timeline为空则不开启\n */\n start: (force?: boolean) => boolean;\n stop: () => void;\n addTimeline: (timeline: ITimeline) => void;\n remTimeline: (timeline: ITimeline) => void;\n}\n"]}
@@ -57,6 +57,19 @@ export interface IPickItemInterceptorContribution {
57
57
  parentMatrix: IMatrix;
58
58
  }) => PickResult | null;
59
59
  }
60
+ export interface IPickServiceInterceptorContribution {
61
+ order: number;
62
+ beforePickItem?: (result: PickResult, pickerService: IPickerService, point: IPointLike, drawContext: {
63
+ in3dInterceptor?: boolean;
64
+ }, params?: {
65
+ parentMatrix: IMatrix;
66
+ }) => PickResult | null;
67
+ afterPickItem?: (result: PickResult, pickerService: IPickerService, point: IPointLike, drawContext: {
68
+ in3dInterceptor?: boolean;
69
+ }, params?: {
70
+ parentMatrix: IMatrix;
71
+ }) => PickResult | null;
72
+ }
60
73
  export interface IBoundsPicker {
61
74
  type: string;
62
75
  numberType?: number;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/picker.ts"],"names":[],"mappings":"","file":"picker.js","sourcesContent":["import type { IBounds, IMatrix, IPoint, IPointLike } from '@visactor/vutils';\nimport type { IGraphic } from './graphic';\nimport type { IContext2d } from './context';\nimport type { EnvType, IGlobal } from './global';\nimport type { IGroup } from './graphic/group';\nimport type { IDrawContribution } from './render';\n\ntype ISubPickEventParams =\n | boolean\n | {\n graphic?: any;\n group?: any;\n params: ISubPickEventParams;\n };\n\nexport type IPickEventParams =\n | {\n shadowTarget?: IGraphic;\n }\n | ISubPickEventParams;\n\nexport type PickResult = {\n graphic?: IGraphic | null;\n group?: IGroup | null;\n params?:\n | {\n shadowTarget?: IGraphic;\n }\n | ISubPickEventParams;\n};\n\nexport interface IGraphicPicker {\n type: string;\n numberType: number;\n\n contains: (graphic: IGraphic, point: IPointLike, params?: IPickParams) => boolean | any;\n}\n\nexport interface IPickParams {\n group?: boolean;\n graphic?: boolean;\n bounds?: IBounds;\n pickContext?: IContext2d;\n pickerService?: IPickerService;\n // 内部设置\n in3dInterceptor?: boolean;\n hack_pieFace?: string;\n}\n\nexport interface IPickerService {\n type: string;\n\n pickContext?: IContext2d;\n pickerMap: Map<number, IGraphicPicker>;\n configure: (global: IGlobal, env: EnvType) => void;\n pick: (group: IGraphic[], point: IPoint, params?: IPickParams) => PickResult;\n pickGroup: (group: IGroup, point: IPointLike, parentMatrix: IMatrix, params: IPickParams) => PickResult;\n pickItem: (\n graphic: IGraphic,\n point: IPointLike,\n parentMatrix: IMatrix | null,\n params?: IPickParams\n ) => PickResult | null;\n containsPoint: (graphic: IGraphic, point: IPointLike, params?: IPickParams) => boolean;\n drawContribution?: IDrawContribution;\n}\n\nexport interface IPickItemInterceptorContribution {\n order: number;\n // null代表没匹配到,boolean代表是否pick中\n beforePickItem?: (\n graphic: IGraphic,\n pickerService: IPickerService,\n point: IPointLike,\n drawContext: {\n in3dInterceptor?: boolean;\n },\n params?: {\n parentMatrix: IMatrix;\n }\n ) => PickResult | null;\n\n afterPickItem?: (\n graphic: IGraphic,\n pickerService: IPickerService,\n point: IPointLike,\n drawContext: {\n in3dInterceptor?: boolean;\n },\n params?: {\n parentMatrix: IMatrix;\n }\n ) => PickResult | null;\n // afterPickItem?: (\n // graphic: IGraphic,\n // pickerService: IPickerService,\n // ) => boolean;\n}\n\nexport interface IBoundsPicker {\n type: string;\n numberType?: number;\n\n contains: (graphic: IGraphic, point: IPointLike, params?: IPickParams) => boolean;\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/picker.ts"],"names":[],"mappings":"","file":"picker.js","sourcesContent":["import type { IBounds, IMatrix, IPoint, IPointLike } from '@visactor/vutils';\nimport type { IGraphic } from './graphic';\nimport type { IContext2d } from './context';\nimport type { EnvType, IGlobal } from './global';\nimport type { IGroup } from './graphic/group';\nimport type { IDrawContribution } from './render';\n\ntype ISubPickEventParams =\n | boolean\n | {\n graphic?: any;\n group?: any;\n params: ISubPickEventParams;\n };\n\nexport type IPickEventParams =\n | {\n shadowTarget?: IGraphic;\n }\n | ISubPickEventParams;\n\nexport type PickResult = {\n graphic?: IGraphic | null;\n group?: IGroup | null;\n params?:\n | {\n shadowTarget?: IGraphic;\n }\n | ISubPickEventParams;\n};\n\nexport interface IGraphicPicker {\n type: string;\n numberType: number;\n\n contains: (graphic: IGraphic, point: IPointLike, params?: IPickParams) => boolean | any;\n}\n\nexport interface IPickParams {\n group?: boolean;\n graphic?: boolean;\n bounds?: IBounds;\n pickContext?: IContext2d;\n pickerService?: IPickerService;\n // 内部设置\n in3dInterceptor?: boolean;\n hack_pieFace?: string;\n}\n\nexport interface IPickerService {\n type: string;\n\n pickContext?: IContext2d;\n pickerMap: Map<number, IGraphicPicker>;\n configure: (global: IGlobal, env: EnvType) => void;\n pick: (group: IGraphic[], point: IPoint, params?: IPickParams) => PickResult;\n pickGroup: (group: IGroup, point: IPointLike, parentMatrix: IMatrix, params: IPickParams) => PickResult;\n pickItem: (\n graphic: IGraphic,\n point: IPointLike,\n parentMatrix: IMatrix | null,\n params?: IPickParams\n ) => PickResult | null;\n containsPoint: (graphic: IGraphic, point: IPointLike, params?: IPickParams) => boolean;\n drawContribution?: IDrawContribution;\n}\n\nexport interface IPickItemInterceptorContribution {\n order: number;\n // null代表没匹配到,boolean代表是否pick中\n beforePickItem?: (\n graphic: IGraphic,\n pickerService: IPickerService,\n point: IPointLike,\n drawContext: {\n in3dInterceptor?: boolean;\n },\n params?: {\n parentMatrix: IMatrix;\n }\n ) => PickResult | null;\n\n afterPickItem?: (\n graphic: IGraphic,\n pickerService: IPickerService,\n point: IPointLike,\n drawContext: {\n in3dInterceptor?: boolean;\n },\n params?: {\n parentMatrix: IMatrix;\n }\n ) => PickResult | null;\n // afterPickItem?: (\n // graphic: IGraphic,\n // pickerService: IPickerService,\n // ) => boolean;\n}\nexport interface IPickServiceInterceptorContribution {\n order: number;\n // null代表没匹配到,boolean代表是否pick中\n beforePickItem?: (\n result: PickResult,\n pickerService: IPickerService,\n point: IPointLike,\n drawContext: {\n in3dInterceptor?: boolean;\n },\n params?: {\n parentMatrix: IMatrix;\n }\n ) => PickResult | null;\n\n afterPickItem?: (\n result: PickResult,\n pickerService: IPickerService,\n point: IPointLike,\n drawContext: {\n in3dInterceptor?: boolean;\n },\n params?: {\n parentMatrix: IMatrix;\n }\n ) => PickResult | null;\n // afterPickItem?: (\n // graphic: IGraphic,\n // pickerService: IPickerService,\n // ) => boolean;\n}\n\nexport interface IBoundsPicker {\n type: string;\n numberType?: number;\n\n contains: (graphic: IGraphic, point: IPointLike, params?: IPickParams) => boolean;\n}\n"]}
@@ -2,3 +2,5 @@ export declare const GraphicPicker: unique symbol;
2
2
  export declare const PickerService: unique symbol;
3
3
  export declare const BoundsPicker: unique symbol;
4
4
  export declare const GlobalPickerService: unique symbol;
5
+ export declare const PickItemInterceptor: unique symbol;
6
+ export declare const PickServiceInterceptor: unique symbol;
@@ -2,7 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.GlobalPickerService = exports.BoundsPicker = exports.PickerService = exports.GraphicPicker = void 0,
5
+ }), exports.PickServiceInterceptor = exports.PickItemInterceptor = exports.GlobalPickerService = exports.BoundsPicker = exports.PickerService = exports.GraphicPicker = void 0,
6
6
  exports.GraphicPicker = Symbol.for("GraphicPicker"), exports.PickerService = Symbol.for("PickerService"),
7
- exports.BoundsPicker = Symbol.for("BoundsPicker"), exports.GlobalPickerService = Symbol.for("GlobalPickerService");
7
+ exports.BoundsPicker = Symbol.for("BoundsPicker"), exports.GlobalPickerService = Symbol.for("GlobalPickerService"),
8
+ exports.PickItemInterceptor = Symbol.for("PickItemInterceptor"), exports.PickServiceInterceptor = Symbol.for("PickServiceInterceptor");
8
9
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/picker/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AAC5C,QAAA,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AAE5C,QAAA,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AAC1C,QAAA,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC","file":"constants.js","sourcesContent":["export const GraphicPicker = Symbol.for('GraphicPicker');\nexport const PickerService = Symbol.for('PickerService');\n\nexport const BoundsPicker = Symbol.for('BoundsPicker');\nexport const GlobalPickerService = Symbol.for('GlobalPickerService');\n"]}
1
+ {"version":3,"sources":["../src/picker/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AAC5C,QAAA,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AAE5C,QAAA,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AAC1C,QAAA,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;AAGxD,QAAA,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;AAExD,QAAA,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC","file":"constants.js","sourcesContent":["export const GraphicPicker = Symbol.for('GraphicPicker');\nexport const PickerService = Symbol.for('PickerService');\n\nexport const BoundsPicker = Symbol.for('BoundsPicker');\nexport const GlobalPickerService = Symbol.for('GlobalPickerService');\n\n// 拦截器\nexport const PickItemInterceptor = Symbol.for('PickItemInterceptor');\n// pickService的拦截器\nexport const PickServiceInterceptor = Symbol.for('PickServiceInterceptor');\n"]}
@@ -1,6 +1,11 @@
1
1
  import type { IMatrix, IPointLike } from '@visactor/vutils';
2
- import type { IContext2d, IGraphic, IPickItemInterceptorContribution, IPickParams, IPickerService, PickResult } from '../interface';
3
- export declare const PickItemInterceptor: unique symbol;
2
+ import type { IContext2d, IGraphic, IPickItemInterceptorContribution, IPickParams, IPickServiceInterceptorContribution, IPickerService, PickResult } from '../interface';
3
+ export declare class ShadowPickServiceInterceptorContribution implements IPickServiceInterceptorContribution {
4
+ order: number;
5
+ afterPickItem(result: PickResult, pickerService: IPickerService, point: IPointLike, pickParams: IPickParams, params?: {
6
+ parentMatrix: IMatrix;
7
+ }): null | PickResult;
8
+ }
4
9
  export declare class ShadowRootPickItemInterceptorContribution implements IPickItemInterceptorContribution {
5
10
  order: number;
6
11
  afterPickItem(graphic: IGraphic, pickerService: IPickerService, point: IPointLike, pickParams: IPickParams, params?: {
@@ -8,11 +8,28 @@ var __decorate = this && this.__decorate || function(decorators, target, key, de
8
8
 
9
9
  Object.defineProperty(exports, "__esModule", {
10
10
  value: !0
11
- }), exports.Canvas3DPickItemInterceptor = exports.InteractivePickItemInterceptorContribution = exports.ShadowRootPickItemInterceptorContribution = exports.PickItemInterceptor = void 0;
11
+ }), exports.Canvas3DPickItemInterceptor = exports.InteractivePickItemInterceptorContribution = exports.ShadowRootPickItemInterceptorContribution = exports.ShadowPickServiceInterceptorContribution = void 0;
12
12
 
13
13
  const vutils_1 = require("@visactor/vutils"), inversify_lite_1 = require("../common/inversify-lite"), matrix_allocate_1 = require("../allocator/matrix-allocate"), _3d_interceptor_1 = require("../common/3d-interceptor"), graphic_1 = require("../graphic");
14
14
 
15
- exports.PickItemInterceptor = Symbol.for("PickItemInterceptor");
15
+ let ShadowPickServiceInterceptorContribution = class {
16
+ constructor() {
17
+ this.order = 1;
18
+ }
19
+ afterPickItem(result, pickerService, point, pickParams, params) {
20
+ if (result.graphic) {
21
+ let g = result.graphic;
22
+ for (;g.parent; ) g = g.parent;
23
+ g.shadowHost && (result.params = {
24
+ shadowTarget: result.graphic
25
+ }, result.graphic = g.shadowHost);
26
+ }
27
+ return result;
28
+ }
29
+ };
30
+
31
+ ShadowPickServiceInterceptorContribution = __decorate([ (0, inversify_lite_1.injectable)() ], ShadowPickServiceInterceptorContribution),
32
+ exports.ShadowPickServiceInterceptorContribution = ShadowPickServiceInterceptorContribution;
16
33
 
17
34
  let ShadowRootPickItemInterceptorContribution = class {
18
35
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/picker/pick-interceptor.ts"],"names":[],"mappings":";;;;;;;;;AACA,6CAAyC;AACzC,6DAAsD;AAUtD,kEAA8D;AAC9D,8DAAsD;AACtD,wCAAsC;AAGzB,QAAA,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;AAM9D,IAAM,yCAAyC,GAA/C,MAAM,yCAAyC;IAA/C;QACL,UAAK,GAAW,CAAC,CAAC;IAiFpB,CAAC;IAhFC,aAAa,CACX,OAAiB,EACjB,aAA6B,EAC7B,KAAiB,EACjB,UAAuB,EACvB,MAEC;QAED,IAAI,OAAO,CAAC,SAAS,CAAC,aAAa,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,EAAE;YAC3E,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;SAC1E;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,cAAc,CACZ,OAAiB,EACjB,aAA6B,EAC7B,KAAiB,EACjB,UAAuB,EACvB,MAEC;QAED,IAAI,OAAO,CAAC,SAAS,CAAC,aAAa,GAAG,CAAC,EAAE;YACvC,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;SAC1E;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAES,SAAS,CACjB,OAAiB,EACjB,aAA6B,EAC7B,KAAiB,EACjB,UAAuB,EACvB,MAEC;;QAED,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,OAAO,IAAI,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iB,EACjB,UAAuB,EACvB,MAEC;QAED,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,UAAU,CAAC,eAAe,EAAE;YACnD,OAAO,IAAI,CAAC;SACb;QAED,MAAM,OAAO,GAAG,aAAa,CAAC,WAAW,CAAC;QAC1C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC5B,IAAI,CAAC,CAAC,OAAO,IAAI,KAAK,CAAC,EAAE;YACvB,OAAO,IAAI,CAAC;SACb;QACD,UAAU,CAAC,eAAe,GAAG,IAAI,CAAC;QAGlC,OAAO,CAAC,IAAI,EAAE,CAAC;QACf,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC5B,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAG9B,IAAI,OAAO,CAAC,WAAW,EAAE;YACvB,MAAM,MAAM,GAAG,IAAA,4BAAU,EACvB,OAAO,EACP,OAAO,EACP,GAAG,EAAE;gBACH,OAAO,aAAa,CAAC,SAAS,CAAC,OAAiB,EAAE,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;YAC5F,CAAC,EACD,UAAU,CACX,CAAC;YAEF,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;YAEtB,UAAU,CAAC,eAAe,GAAG,KAAK,CAAC;YACnC,OAAO,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,MAAM,CAAC;SACf;QACD,OAAO,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,aAAa,CAAC,OAAmB;QAC/B,OAAO,CAAC,sBAAsB,EAAE,CAAC;IACnC,CAAC;CACF,CAAA;AArDY,2BAA2B;IADvC,IAAA,2BAAU,GAAE;GACA,2BAA2B,CAqDvC;AArDY,kEAA2B","file":"pick-interceptor.js","sourcesContent":["import type { IMatrix, IPointLike } from '@visactor/vutils';\nimport { Point } from '@visactor/vutils';\nimport { injectable } from '../common/inversify-lite';\nimport type {\n IContext2d,\n IGraphic,\n IGroup,\n IPickItemInterceptorContribution,\n IPickParams,\n IPickerService,\n PickResult\n} from '../interface';\nimport { matrixAllocate } from '../allocator/matrix-allocate';\nimport { draw3dItem } from '../common/3d-interceptor';\nimport { getTheme } from '../graphic';\n\n// 拦截器\nexport const PickItemInterceptor = Symbol.for('PickItemInterceptor');\n\n/**\n * 影子节点拦截器,用于渲染影子节点\n */\n@injectable()\nexport class ShadowRootPickItemInterceptorContribution implements IPickItemInterceptorContribution {\n order: number = 1;\n afterPickItem(\n graphic: IGraphic,\n pickerService: IPickerService,\n point: IPointLike,\n pickParams: IPickParams,\n params?: {\n parentMatrix: IMatrix;\n }\n ): null | PickResult {\n if (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) {\n return this._pickItem(graphic, pickerService, point, pickParams, params);\n }\n return null;\n }\n\n beforePickItem(\n graphic: IGraphic,\n pickerService: IPickerService,\n point: IPointLike,\n pickParams: IPickParams,\n params?: {\n parentMatrix: IMatrix;\n }\n ): null | PickResult {\n if (graphic.attribute.shadowRootIdx < 0) {\n return this._pickItem(graphic, pickerService, point, pickParams, params);\n }\n return null;\n }\n\n protected _pickItem(\n graphic: IGraphic,\n pickerService: IPickerService,\n point: IPointLike,\n pickParams: IPickParams,\n params?: {\n parentMatrix: IMatrix;\n }\n ): PickResult | null {\n if (!graphic.shadowRoot) {\n return null;\n }\n const { parentMatrix } = params || {};\n if (!parentMatrix) {\n return null;\n }\n\n const context = pickerService.pickContext;\n context.highPerformanceSave();\n\n const theme = (getTheme(graphic) as any)?.[graphic.type];\n const { shadowPickMode = theme?.shadowPickMode } = graphic.attribute;\n const g = graphic.shadowRoot;\n const currentGroupMatrix = matrixAllocate.allocateByObj(parentMatrix);\n const newPoint = new Point(\n currentGroupMatrix.a * point.x + currentGroupMatrix.c * point.y + currentGroupMatrix.e,\n currentGroupMatrix.b * point.x + currentGroupMatrix.d * point.y + currentGroupMatrix.f\n );\n // const transMatrix = graphic.transMatrix;\n // currentGroupMatrix.multiply(\n // transMatrix.a,\n // transMatrix.b,\n // transMatrix.c,\n // transMatrix.d,\n // transMatrix.e,\n // transMatrix.f\n // );\n\n // currentGroupMatrix.transformPoint(newPoint, newPoint);\n const result = pickerService.pickGroup(g, newPoint, currentGroupMatrix, pickParams);\n\n context.highPerformanceRestore();\n\n // 影子节点pick到group也算pick到graphic\n if (!result.graphic && result.group && shadowPickMode === 'full') {\n result.graphic = result.group;\n }\n\n return result;\n }\n}\n\n@injectable()\nexport class InteractivePickItemInterceptorContribution implements IPickItemInterceptorContribution {\n order: number = 1;\n\n beforePickItem(\n graphic: IGraphic,\n pickerService: IPickerService,\n point: IPointLike,\n pickParams: IPickParams,\n params?: {\n parentMatrix: IMatrix;\n }\n ): null | PickResult {\n const originGraphic = graphic.baseGraphic;\n if (originGraphic && originGraphic.parent) {\n const newPoint = new Point(point.x, point.y);\n const context = pickerService.pickContext;\n context.highPerformanceSave();\n const parentMatrix = originGraphic.parent.globalTransMatrix;\n parentMatrix.transformPoint(newPoint, newPoint);\n\n const result = originGraphic.isContainer\n ? pickerService.pickGroup(originGraphic, newPoint.clone(), parentMatrix, pickParams)\n : pickerService.pickItem(originGraphic, newPoint.clone(), parentMatrix, pickParams);\n context.highPerformanceRestore();\n return result;\n }\n return null;\n }\n}\n\n/**\n * 3d拦截器,用于渲染3d视角\n */\n@injectable()\nexport class Canvas3DPickItemInterceptor implements IPickItemInterceptorContribution {\n // canvas?: ICanvas;\n order: number = 1;\n\n beforePickItem(\n graphic: IGraphic,\n pickerService: IPickerService,\n point: IPointLike,\n pickParams: IPickParams,\n params?: {\n parentMatrix: IMatrix;\n }\n ) {\n if (!graphic.in3dMode || pickParams.in3dInterceptor) {\n return null;\n }\n\n const context = pickerService.pickContext;\n const stage = graphic.stage;\n if (!(context && stage)) {\n return null;\n }\n pickParams.in3dInterceptor = true;\n\n // 使用3d模式渲染\n context.save();\n this.initCanvasCtx(context);\n context.camera = stage.camera;\n\n // 设置context的transform到上一个节点\n if (graphic.isContainer) {\n const result = draw3dItem(\n context,\n graphic,\n () => {\n return pickerService.pickGroup(graphic as IGroup, point, params.parentMatrix, pickParams);\n },\n pickParams\n );\n\n context.camera = null;\n\n pickParams.in3dInterceptor = false;\n context.restore();\n return result;\n }\n context.restore();\n return null;\n }\n\n initCanvasCtx(context: IContext2d) {\n context.setTransformForCurrent();\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/picker/pick-interceptor.ts"],"names":[],"mappings":";;;;;;;;;AACA,6CAAyC;AACzC,6DAAsD;AAWtD,kEAA8D;AAC9D,8DAAsD;AACtD,wCAAsC;AAG/B,IAAM,wCAAwC,GAA9C,MAAM,wCAAwC;IAA9C;QACL,UAAK,GAAW,CAAC,CAAC;IAwBpB,CAAC;IAvBC,aAAa,CACX,MAAkB,EAClB,aAA6B,EAC7B,KAAiB,EACjB,UAAuB,EACvB,MAEC;QAED,IAAI,MAAM,CAAC,OAAO,EAAE;YAClB,IAAI,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC;YACvB,OAAO,CAAC,CAAC,MAAM,EAAE;gBACf,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;aACd;YACD,IAAI,CAAC,CAAC,UAAU,EAAE;gBAChB,MAAM,CAAC,MAAM,GAAG;oBACd,YAAY,EAAE,MAAM,CAAC,OAAO;iBAC7B,CAAC;gBACF,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC,UAAU,CAAC;aAC/B;SACF;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAA;AAzBY,wCAAwC;IADpD,IAAA,2BAAU,GAAE;GACA,wCAAwC,CAyBpD;AAzBY,4FAAwC;AA+B9C,IAAM,yCAAyC,GAA/C,MAAM,yCAAyC;IAA/C;QACL,UAAK,GAAW,CAAC,CAAC;IAiFpB,CAAC;IAhFC,aAAa,CACX,OAAiB,EACjB,aAA6B,EAC7B,KAAiB,EACjB,UAAuB,EACvB,MAEC;QAED,IAAI,OAAO,CAAC,SAA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E;gBACH,OAAO,aAAa,CAAC,SAAS,CAAC,OAAiB,EAAE,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;YAC5F,CAAC,EACD,UAAU,CACX,CAAC;YAEF,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;YAEtB,UAAU,CAAC,eAAe,GAAG,KAAK,CAAC;YACnC,OAAO,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,MAAM,CAAC;SACf;QACD,OAAO,CAAC,OAAO,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,aAAa,CAAC,OAAmB;QAC/B,OAAO,CAAC,sBAAsB,EAAE,CAAC;IACnC,CAAC;CACF,CAAA;AArDY,2BAA2B;IADvC,IAAA,2BAAU,GAAE;GACA,2BAA2B,CAqDvC;AArDY,kEAA2B","file":"pick-interceptor.js","sourcesContent":["import type { IMatrix, IPointLike } from '@visactor/vutils';\nimport { Point } from '@visactor/vutils';\nimport { injectable } from '../common/inversify-lite';\nimport type {\n IContext2d,\n IGraphic,\n IGroup,\n IPickItemInterceptorContribution,\n IPickParams,\n IPickServiceInterceptorContribution,\n IPickerService,\n PickResult\n} from '../interface';\nimport { matrixAllocate } from '../allocator/matrix-allocate';\nimport { draw3dItem } from '../common/3d-interceptor';\nimport { getTheme } from '../graphic';\n\n@injectable()\nexport class ShadowPickServiceInterceptorContribution implements IPickServiceInterceptorContribution {\n order: number = 1;\n afterPickItem(\n result: PickResult,\n pickerService: IPickerService,\n point: IPointLike,\n pickParams: IPickParams,\n params?: {\n parentMatrix: IMatrix;\n }\n ): null | PickResult {\n if (result.graphic) {\n let g = result.graphic;\n while (g.parent) {\n g = g.parent;\n }\n if (g.shadowHost) {\n result.params = {\n shadowTarget: result.graphic\n };\n result.graphic = g.shadowHost;\n }\n }\n return result;\n }\n}\n\n/**\n * 影子节点拦截器,用于渲染影子节点\n */\n@injectable()\nexport class ShadowRootPickItemInterceptorContribution implements IPickItemInterceptorContribution {\n order: number = 1;\n afterPickItem(\n graphic: IGraphic,\n pickerService: IPickerService,\n point: IPointLike,\n pickParams: IPickParams,\n params?: {\n parentMatrix: IMatrix;\n }\n ): null | PickResult {\n if (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) {\n return this._pickItem(graphic, pickerService, point, pickParams, params);\n }\n return null;\n }\n\n beforePickItem(\n graphic: IGraphic,\n pickerService: IPickerService,\n point: IPointLike,\n pickParams: IPickParams,\n params?: {\n parentMatrix: IMatrix;\n }\n ): null | PickResult {\n if (graphic.attribute.shadowRootIdx < 0) {\n return this._pickItem(graphic, pickerService, point, pickParams, params);\n }\n return null;\n }\n\n protected _pickItem(\n graphic: IGraphic,\n pickerService: IPickerService,\n point: IPointLike,\n pickParams: IPickParams,\n params?: {\n parentMatrix: IMatrix;\n }\n ): PickResult | null {\n if (!graphic.shadowRoot) {\n return null;\n }\n const { parentMatrix } = params || {};\n if (!parentMatrix) {\n return null;\n }\n\n const context = pickerService.pickContext;\n context.highPerformanceSave();\n\n const theme = (getTheme(graphic) as any)?.[graphic.type];\n const { shadowPickMode = theme?.shadowPickMode } = graphic.attribute;\n const g = graphic.shadowRoot;\n const currentGroupMatrix = matrixAllocate.allocateByObj(parentMatrix);\n const newPoint = new Point(\n currentGroupMatrix.a * point.x + currentGroupMatrix.c * point.y + currentGroupMatrix.e,\n currentGroupMatrix.b * point.x + currentGroupMatrix.d * point.y + currentGroupMatrix.f\n );\n // const transMatrix = graphic.transMatrix;\n // currentGroupMatrix.multiply(\n // transMatrix.a,\n // transMatrix.b,\n // transMatrix.c,\n // transMatrix.d,\n // transMatrix.e,\n // transMatrix.f\n // );\n\n // currentGroupMatrix.transformPoint(newPoint, newPoint);\n const result = pickerService.pickGroup(g, newPoint, currentGroupMatrix, pickParams);\n\n context.highPerformanceRestore();\n\n // 影子节点pick到group也算pick到graphic\n if (!result.graphic && result.group && shadowPickMode === 'full') {\n result.graphic = result.group;\n }\n\n return result;\n }\n}\n\n@injectable()\nexport class InteractivePickItemInterceptorContribution implements IPickItemInterceptorContribution {\n order: number = 1;\n\n beforePickItem(\n graphic: IGraphic,\n pickerService: IPickerService,\n point: IPointLike,\n pickParams: IPickParams,\n params?: {\n parentMatrix: IMatrix;\n }\n ): null | PickResult {\n const originGraphic = graphic.baseGraphic;\n if (originGraphic && originGraphic.parent) {\n const newPoint = new Point(point.x, point.y);\n const context = pickerService.pickContext;\n context.highPerformanceSave();\n const parentMatrix = originGraphic.parent.globalTransMatrix;\n parentMatrix.transformPoint(newPoint, newPoint);\n\n const result = originGraphic.isContainer\n ? pickerService.pickGroup(originGraphic, newPoint.clone(), parentMatrix, pickParams)\n : pickerService.pickItem(originGraphic, newPoint.clone(), parentMatrix, pickParams);\n context.highPerformanceRestore();\n return result;\n }\n return null;\n }\n}\n\n/**\n * 3d拦截器,用于渲染3d视角\n */\n@injectable()\nexport class Canvas3DPickItemInterceptor implements IPickItemInterceptorContribution {\n // canvas?: ICanvas;\n order: number = 1;\n\n beforePickItem(\n graphic: IGraphic,\n pickerService: IPickerService,\n point: IPointLike,\n pickParams: IPickParams,\n params?: {\n parentMatrix: IMatrix;\n }\n ) {\n if (!graphic.in3dMode || pickParams.in3dInterceptor) {\n return null;\n }\n\n const context = pickerService.pickContext;\n const stage = graphic.stage;\n if (!(context && stage)) {\n return null;\n }\n pickParams.in3dInterceptor = true;\n\n // 使用3d模式渲染\n context.save();\n this.initCanvasCtx(context);\n context.camera = stage.camera;\n\n // 设置context的transform到上一个节点\n if (graphic.isContainer) {\n const result = draw3dItem(\n context,\n graphic,\n () => {\n return pickerService.pickGroup(graphic as IGroup, point, params.parentMatrix, pickParams);\n },\n pickParams\n );\n\n context.camera = null;\n\n pickParams.in3dInterceptor = false;\n context.restore();\n return result;\n }\n context.restore();\n return null;\n }\n\n initCanvasCtx(context: IContext2d) {\n context.setTransformForCurrent();\n }\n}\n"]}
@@ -9,11 +9,14 @@ const inversify_lite_1 = require("../common/inversify-lite"), constants_1 = requ
9
9
  exports.default = new inversify_lite_1.ContainerModule(((bind, unbind, isBound) => {
10
10
  isBound(constants_1.PickerService) || (bind(constants_1.GlobalPickerService).toSelf(),
11
11
  bind(constants_1.PickerService).toService(constants_1.GlobalPickerService)), bind(pick_interceptor_1.Canvas3DPickItemInterceptor).toSelf().inSingletonScope(),
12
- bind(pick_interceptor_1.PickItemInterceptor).toService(pick_interceptor_1.Canvas3DPickItemInterceptor),
12
+ bind(constants_1.PickItemInterceptor).toService(pick_interceptor_1.Canvas3DPickItemInterceptor),
13
13
  bind(pick_interceptor_1.ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(),
14
- bind(pick_interceptor_1.PickItemInterceptor).toService(pick_interceptor_1.ShadowRootPickItemInterceptorContribution),
14
+ bind(constants_1.PickItemInterceptor).toService(pick_interceptor_1.ShadowRootPickItemInterceptorContribution),
15
15
  bind(pick_interceptor_1.InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(),
16
- bind(pick_interceptor_1.PickItemInterceptor).toService(pick_interceptor_1.InteractivePickItemInterceptorContribution),
17
- (0, contribution_provider_1.bindContributionProvider)(bind, pick_interceptor_1.PickItemInterceptor);
16
+ bind(constants_1.PickItemInterceptor).toService(pick_interceptor_1.InteractivePickItemInterceptorContribution),
17
+ (0, contribution_provider_1.bindContributionProvider)(bind, constants_1.PickItemInterceptor),
18
+ bind(pick_interceptor_1.ShadowPickServiceInterceptorContribution).toSelf().inSingletonScope(),
19
+ bind(constants_1.PickServiceInterceptor).toService(pick_interceptor_1.ShadowPickServiceInterceptorContribution),
20
+ (0, contribution_provider_1.bindContributionProvider)(bind, constants_1.PickServiceInterceptor);
18
21
  }));
19
22
  //# sourceMappingURL=pick-modules.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/picker/pick-modules.ts"],"names":[],"mappings":";;AAAA,6DAA2D;AAC3D,2CAAiE;AAIjE,yDAK4B;AAC5B,2EAA2E;AAE3E,kBAAe,IAAI,gCAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;IAC3D,IAAI,CAAC,OAAO,CAAC,yBAAa,CAAC,EAAE;QAC3B,IAAI,CAAC,+BAAmB,CAAC,CAAC,MAAM,EAAE,CAAC;QACnC,IAAI,CAAC,yBAAa,CAAC,CAAC,SAAS,CAAC,+BAAmB,CAAC,CAAC;KACpD;IAOD,IAAI,CAAC,8CAA2B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC9D,IAAI,CAAC,sCAAmB,CAAC,CAAC,SAAS,CAAC,8CAA2B,CAAC,CAAC;IAGjE,IAAI,CAAC,4DAAyC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC5E,IAAI,CAAC,sCAAmB,CAAC,CAAC,SAAS,CAAC,4DAAyC,CAAC,CAAC;IAG/E,IAAI,CAAC,6DAA0C,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC7E,IAAI,CAAC,sCAAmB,CAAC,CAAC,SAAS,CAAC,6DAA0C,CAAC,CAAC;IAChF,IAAA,gDAAwB,EAAC,IAAI,EAAE,sCAAmB,CAAC,CAAC;AACtD,CAAC,CAAC,CAAC","file":"pick-modules.js","sourcesContent":["import { ContainerModule } from '../common/inversify-lite';\nimport { PickerService, GlobalPickerService } from './constants';\nimport { DefaultGlobalPickerService } from './global-picker-service';\n// import { DefaultCanvasPickerService } from './canvas-picker-service';\n// import { DefaultMathPickerService } from './math-picker-service';\nimport {\n Canvas3DPickItemInterceptor,\n InteractivePickItemInterceptorContribution,\n PickItemInterceptor,\n ShadowRootPickItemInterceptorContribution\n} from './pick-interceptor';\nimport { bindContributionProvider } from '../common/contribution-provider';\n\nexport default new ContainerModule((bind, unbind, isBound) => {\n if (!isBound(PickerService)) {\n bind(GlobalPickerService).toSelf();\n bind(PickerService).toService(GlobalPickerService);\n }\n // bind(PickerService).toService(GlobalPickerService);\n\n // bind(DefaultGlobalPickerService).toSelf().inSingletonScope();\n // bind(GlobalPickerService).toService(DefaultGlobalPickerService);\n\n // interceptor\n bind(Canvas3DPickItemInterceptor).toSelf().inSingletonScope();\n bind(PickItemInterceptor).toService(Canvas3DPickItemInterceptor);\n\n // shadow root\n bind(ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope();\n bind(PickItemInterceptor).toService(ShadowRootPickItemInterceptorContribution);\n\n // interactive\n bind(InteractivePickItemInterceptorContribution).toSelf().inSingletonScope();\n bind(PickItemInterceptor).toService(InteractivePickItemInterceptorContribution);\n bindContributionProvider(bind, PickItemInterceptor);\n});\n"]}
1
+ {"version":3,"sources":["../src/picker/pick-modules.ts"],"names":[],"mappings":";;AAAA,6DAA2D;AAC3D,2CAA8G;AAI9G,yDAK4B;AAC5B,2EAA2E;AAE3E,kBAAe,IAAI,gCAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;IAC3D,IAAI,CAAC,OAAO,CAAC,yBAAa,CAAC,EAAE;QAC3B,IAAI,CAAC,+BAAmB,CAAC,CAAC,MAAM,EAAE,CAAC;QACnC,IAAI,CAAC,yBAAa,CAAC,CAAC,SAAS,CAAC,+BAAmB,CAAC,CAAC;KACpD;IAOD,IAAI,CAAC,8CAA2B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC9D,IAAI,CAAC,+BAAmB,CAAC,CAAC,SAAS,CAAC,8CAA2B,CAAC,CAAC;IAGjE,IAAI,CAAC,4DAAyC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC5E,IAAI,CAAC,+BAAmB,CAAC,CAAC,SAAS,CAAC,4DAAyC,CAAC,CAAC;IAG/E,IAAI,CAAC,6DAA0C,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC7E,IAAI,CAAC,+BAAmB,CAAC,CAAC,SAAS,CAAC,6DAA0C,CAAC,CAAC;IAChF,IAAA,gDAAwB,EAAC,IAAI,EAAE,+BAAmB,CAAC,CAAC;IAEpD,IAAI,CAAC,2DAAwC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC3E,IAAI,CAAC,kCAAsB,CAAC,CAAC,SAAS,CAAC,2DAAwC,CAAC,CAAC;IAEjF,IAAA,gDAAwB,EAAC,IAAI,EAAE,kCAAsB,CAAC,CAAC;AACzD,CAAC,CAAC,CAAC","file":"pick-modules.js","sourcesContent":["import { ContainerModule } from '../common/inversify-lite';\nimport { PickerService, GlobalPickerService, PickItemInterceptor, PickServiceInterceptor } from './constants';\nimport { DefaultGlobalPickerService } from './global-picker-service';\n// import { DefaultCanvasPickerService } from './canvas-picker-service';\n// import { DefaultMathPickerService } from './math-picker-service';\nimport {\n Canvas3DPickItemInterceptor,\n InteractivePickItemInterceptorContribution,\n ShadowPickServiceInterceptorContribution,\n ShadowRootPickItemInterceptorContribution\n} from './pick-interceptor';\nimport { bindContributionProvider } from '../common/contribution-provider';\n\nexport default new ContainerModule((bind, unbind, isBound) => {\n if (!isBound(PickerService)) {\n bind(GlobalPickerService).toSelf();\n bind(PickerService).toService(GlobalPickerService);\n }\n // bind(PickerService).toService(GlobalPickerService);\n\n // bind(DefaultGlobalPickerService).toSelf().inSingletonScope();\n // bind(GlobalPickerService).toService(DefaultGlobalPickerService);\n\n // interceptor\n bind(Canvas3DPickItemInterceptor).toSelf().inSingletonScope();\n bind(PickItemInterceptor).toService(Canvas3DPickItemInterceptor);\n\n // shadow root\n bind(ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope();\n bind(PickItemInterceptor).toService(ShadowRootPickItemInterceptorContribution);\n\n // interactive\n bind(InteractivePickItemInterceptorContribution).toSelf().inSingletonScope();\n bind(PickItemInterceptor).toService(InteractivePickItemInterceptorContribution);\n bindContributionProvider(bind, PickItemInterceptor);\n\n bind(ShadowPickServiceInterceptorContribution).toSelf().inSingletonScope();\n bind(PickServiceInterceptor).toService(ShadowPickServiceInterceptorContribution);\n\n bindContributionProvider(bind, PickServiceInterceptor);\n});\n"]}