diff --git a/.changeset/kind-starfishes-learn.md b/.changeset/kind-starfishes-learn.md new file mode 100644 index 000000000..9d972dc73 --- /dev/null +++ b/.changeset/kind-starfishes-learn.md @@ -0,0 +1,7 @@ +--- +'@antv/g-plugin-rough-svg-renderer': patch +'@antv/g-plugin-zdog-svg-renderer': patch +'@antv/g-gesture': patch +--- + +Revert stopPropagation in g-gesture diff --git a/.changeset/thirty-wasps-train.md b/.changeset/thirty-wasps-train.md new file mode 100644 index 000000000..5bbed0a5e --- /dev/null +++ b/.changeset/thirty-wasps-train.md @@ -0,0 +1,6 @@ +--- +'@antv/g-plugin-rough-svg-renderer': patch +'@antv/g-plugin-zdog-svg-renderer': patch +--- + +Pass global runtime in svg element lifecycle contribution. diff --git a/packages/g-gesture/src/gesture.ts b/packages/g-gesture/src/gesture.ts index 222acd78f..3a853d311 100644 --- a/packages/g-gesture/src/gesture.ts +++ b/packages/g-gesture/src/gesture.ts @@ -91,7 +91,6 @@ class Gesture extends EventEmitter { } else { el.isMutationObserved = true; el.on(ElementEvent.MOUNTED, (e) => { - e.stopPropagation(); el.ownerDocument?.defaultView.addEventListener( 'pointermove', // @ts-ignore @@ -107,7 +106,6 @@ class Gesture extends EventEmitter { el.ownerDocument?.defaultView.addEventListener('pointerup', this._end); } else { el.on(ElementEvent.MOUNTED, (e) => { - e.stopPropagation(); // @ts-ignore el.ownerDocument?.defaultView.addEventListener('pointerup', this._end); }); diff --git a/packages/g-plugin-rough-svg-renderer/src/index.ts b/packages/g-plugin-rough-svg-renderer/src/index.ts index 28c207ed1..395a44c56 100644 --- a/packages/g-plugin-rough-svg-renderer/src/index.ts +++ b/packages/g-plugin-rough-svg-renderer/src/index.ts @@ -1,13 +1,15 @@ -import { AbstractRendererPlugin } from '@antv/g-lite'; +import { AbstractRendererPlugin, GlobalRuntime } from '@antv/g-lite'; import { RoughElementLifeCycleContribution } from './RoughElementLifeCycleContribution'; import { RoughRendererPlugin } from './RoughRendererPlugin'; export class Plugin extends AbstractRendererPlugin { name = 'rough-svg-renderer'; - init(): void { - const roughElementLifeCycleContribution = new RoughElementLifeCycleContribution(this.context); + init(runtime: GlobalRuntime): void { + const roughElementLifeCycleContribution = + new RoughElementLifeCycleContribution(this.context, runtime); // @ts-ignore - this.context.SVGElementLifeCycleContribution = roughElementLifeCycleContribution; + this.context.SVGElementLifeCycleContribution = + roughElementLifeCycleContribution; this.addRenderingPlugin(new RoughRendererPlugin()); } @@ -15,6 +17,7 @@ export class Plugin extends AbstractRendererPlugin { this.removeAllRenderingPlugins(); // @ts-ignore - this.context.SVGElementLifeCycleContribution = this.context.defaultElementLifeCycleContribution; + this.context.SVGElementLifeCycleContribution = + this.context.defaultElementLifeCycleContribution; } } diff --git a/packages/g-plugin-zdog-svg-renderer/src/index.ts b/packages/g-plugin-zdog-svg-renderer/src/index.ts index 3556c70d8..993883e92 100644 --- a/packages/g-plugin-zdog-svg-renderer/src/index.ts +++ b/packages/g-plugin-zdog-svg-renderer/src/index.ts @@ -1,11 +1,11 @@ -import { AbstractRendererPlugin } from '@antv/g-lite'; +import { AbstractRendererPlugin, GlobalRuntime } from '@antv/g-lite'; import { ZdogElementLifeCycleContribution } from './ZdogElementLifeCycleContribution'; import { ZdogRendererPlugin } from './ZdogRendererPlugin'; export class Plugin extends AbstractRendererPlugin { name = 'zdog-svg-renderer'; - init(): void { + init(runtime: GlobalRuntime): void { const zdogElementLifeCycleContribution = - new ZdogElementLifeCycleContribution(this.context); + new ZdogElementLifeCycleContribution(this.context, runtime); // @ts-ignore this.context.SVGElementLifeCycleContribution =