@antv/g-lite 1.0.29-alpha.0 → 1.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AbstractRenderer.d.ts +5 -4
- package/dist/AbstractRenderer.d.ts.map +1 -1
- package/dist/Canvas.d.ts +1 -0
- package/dist/Canvas.d.ts.map +1 -1
- package/dist/dom/Element.d.ts.map +1 -1
- package/dist/index.esm.js +105 -104
- package/dist/index.js +105 -104
- package/dist/index.umd.js +105 -104
- package/dist/index.umd.min.js +1 -1
- package/dist/services/EventService.d.ts +7 -7
- package/dist/services/EventService.d.ts.map +1 -1
- package/dist/services/RenderingService.d.ts +2 -2
- package/dist/services/RenderingService.d.ts.map +1 -1
- package/dist/services/SceneGraphService.d.ts +1 -0
- package/dist/services/SceneGraphService.d.ts.map +1 -1
- package/dist/services/interfaces.d.ts +1 -0
- package/dist/services/interfaces.d.ts.map +1 -1
- package/dist/utils/assert.d.ts +1 -0
- package/dist/utils/assert.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { CanvasContext } from './dom';
|
|
2
|
+
import { GlobalRuntime } from './global-runtime';
|
|
2
3
|
import type { RenderingPlugin } from './services';
|
|
3
4
|
import type { RendererConfig } from './types';
|
|
4
5
|
export interface RendererPlugin {
|
|
5
6
|
name: string;
|
|
6
7
|
context: CanvasContext;
|
|
7
|
-
init: () => void;
|
|
8
|
-
destroy: () => void;
|
|
8
|
+
init: (runtime: GlobalRuntime) => void;
|
|
9
|
+
destroy: (runtime: GlobalRuntime) => void;
|
|
9
10
|
}
|
|
10
11
|
export declare abstract class AbstractRendererPlugin<T = any> implements RendererPlugin {
|
|
11
12
|
context: CanvasContext & T;
|
|
@@ -13,8 +14,8 @@ export declare abstract class AbstractRendererPlugin<T = any> implements Rendere
|
|
|
13
14
|
protected addRenderingPlugin(plugin: RenderingPlugin): void;
|
|
14
15
|
protected removeAllRenderingPlugins(): void;
|
|
15
16
|
abstract name: string;
|
|
16
|
-
abstract init(): void;
|
|
17
|
-
abstract destroy(): void;
|
|
17
|
+
abstract init(runtime: GlobalRuntime): void;
|
|
18
|
+
abstract destroy(runtime: GlobalRuntime): void;
|
|
18
19
|
}
|
|
19
20
|
export interface IRenderer {
|
|
20
21
|
getConfig: () => RendererConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractRenderer.d.ts","sourceRoot":"","sources":["../src/AbstractRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,aAAa,CAAC;IACvB,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"AbstractRenderer.d.ts","sourceRoot":"","sources":["../src/AbstractRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,aAAa,CAAC;IACvB,IAAI,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IACvC,OAAO,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;CAC3C;AAED,8BAAsB,sBAAsB,CAAC,CAAC,GAAG,GAAG,CAClD,YAAW,cAAc;IAEzB,OAAO,EAAE,aAAa,GAAG,CAAC,CAAC;IAC3B,SAAS,CAAC,OAAO,QAAM;IAEvB,SAAS,CAAC,kBAAkB,CAAC,MAAM,EAAE,eAAe;IAKpD,SAAS,CAAC,yBAAyB;IASnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAC3C,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;CAC/C;AAED,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,cAAc,CAAC;IAEhC;;OAEG;IACH,cAAc,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAEjD;;OAEG;IACH,gBAAgB,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAEnD;;OAEG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,cAAc,CAAC;IAE5C;;OAEG;IACH,UAAU,EAAE,MAAM,cAAc,EAAE,CAAC;CACpC;AAED,qBAAa,gBAAiB,YAAW,SAAS;IAChD,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,MAAM,CAAiB;gBAEnB,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC;IAoB5C,cAAc,CAAC,MAAM,EAAE,cAAc;IAOrC,gBAAgB,CAAC,MAAM,EAAE,cAAc;IAOvC,UAAU;IAIV,SAAS,CAAC,IAAI,EAAE,MAAM;IAItB,SAAS;IAIT,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC;CAG1C"}
|
package/dist/Canvas.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare function isCanvas(value: any): value is Canvas;
|
|
|
11
11
|
export declare enum CanvasEvent {
|
|
12
12
|
READY = "ready",
|
|
13
13
|
BEFORE_RENDER = "beforerender",
|
|
14
|
+
RERENDER = "rerender",
|
|
14
15
|
AFTER_RENDER = "afterrender",
|
|
15
16
|
BEFORE_DESTROY = "beforedestroy",
|
|
16
17
|
AFTER_DESTROY = "afterdestroy",
|
package/dist/Canvas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Canvas.d.ts","sourceRoot":"","sources":["../src/Canvas.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AASpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAW,UAAU,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAe,QAAQ,EAAgB,WAAW,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAMhD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAgB,MAAM,YAAY,CAAC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAU7E,wBAAgB,QAAQ,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAEpD;AAED,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,aAAa,iBAAiB;IAC9B,YAAY,gBAAgB;IAC5B,cAAc,kBAAkB;IAChC,aAAa,iBAAiB;IAC9B,MAAM,WAAW;IACjB,eAAe,mBAAmB;CACnC;
|
|
1
|
+
{"version":3,"file":"Canvas.d.ts","sourceRoot":"","sources":["../src/Canvas.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AASpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAW,UAAU,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAe,QAAQ,EAAgB,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e,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS;IAI7C,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS;IAI7C,eAAe,CAAC,QAAQ,EAAE,SAAS,GAAG,SAAS;IAI/C,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS;IAI7C;;;OAGG;IACH,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS;IAI7D;;;OAGG;IACH,gBAAgB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS;CAGlD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Element.d.ts","sourceRoot":"","sources":["../src/dom/Element.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,UAAU,EACV,QAAQ,EACR,SAAS,EACV,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Element.d.ts","sourceRoot":"","sources":["../src/dom/Element.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,UAAU,EACV,QAAQ,EACR,SAAS,EACV,MAAM,eAAe,CAAC;AAGvB,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAQrE,OAAO,KAAK,EAEV,oBAAoB,EACpB,QAAQ,EACR,YAAY,EACZ,KAAK,EACN,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAI9B,wBAAgB,kBAAkB,SAEjC;AAwBD;;;;;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;;OAEG;IACH,YAAY,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO;IAI5C;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;;OAGG;IACH,eAAe,CAAC,aAAa,EAAE,MAAM,UAAU;IAK/C;;OAEG;IACH,YAAY,CAAC,GAAG,SAAS,MAAM,UAAU,EACvC,aAAa,EAAE,GAAG,EAClB,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,EAEtB,KAAK,UAAQ;IAKf,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM;IAI5D,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI;IAG7C,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;IAI9D,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO;IAI7D,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;IAG7D,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAIrC,cAAc,CACZ,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,GACZ,IAAI;IAGP,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAGlC,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAIpC,eAAe,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO;CAGjE"}
|
package/dist/index.esm.js
CHANGED
|
@@ -499,6 +499,10 @@ function DCHECK_NE(a, b) {
|
|
|
499
499
|
function isFunction(func) {
|
|
500
500
|
return typeof func === 'function';
|
|
501
501
|
}
|
|
502
|
+
function isSymbol(value) {
|
|
503
|
+
// @see https://github.com/lodash/lodash/blob/master/isSymbol.js
|
|
504
|
+
return typeof value === 'symbol';
|
|
505
|
+
}
|
|
502
506
|
var definedProps = function definedProps(obj) {
|
|
503
507
|
return Object.fromEntries(Object.entries(obj).filter(function (_ref) {
|
|
504
508
|
var v = _ref[1];
|
|
@@ -6401,6 +6405,10 @@ var Element = /*#__PURE__*/function (_Node) {
|
|
|
6401
6405
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute
|
|
6402
6406
|
*/;
|
|
6403
6407
|
_proto.getAttribute = function getAttribute(name) {
|
|
6408
|
+
// @see https://github.com/antvis/G/issues/1267
|
|
6409
|
+
if (isSymbol(name)) {
|
|
6410
|
+
return null;
|
|
6411
|
+
}
|
|
6404
6412
|
var value = this.attributes[name];
|
|
6405
6413
|
if (value === undefined) {
|
|
6406
6414
|
var attributeName = formatAttributeName(name);
|
|
@@ -12739,15 +12747,9 @@ var EventService = /*#__PURE__*/function () {
|
|
|
12739
12747
|
while (1) {
|
|
12740
12748
|
switch (_context.prev = _context.next) {
|
|
12741
12749
|
case 0:
|
|
12742
|
-
|
|
12743
|
-
_context.next = 2;
|
|
12744
|
-
break;
|
|
12745
|
-
}
|
|
12746
|
-
return _context.abrupt("return");
|
|
12747
|
-
case 2:
|
|
12748
|
-
_context.next = 4;
|
|
12750
|
+
_context.next = 2;
|
|
12749
12751
|
return _this.createPointerEvent(from);
|
|
12750
|
-
case
|
|
12752
|
+
case 2:
|
|
12751
12753
|
e = _context.sent;
|
|
12752
12754
|
_this.dispatchEvent(e, 'pointerdown');
|
|
12753
12755
|
if (e.pointerType === 'touch') {
|
|
@@ -12759,7 +12761,7 @@ var EventService = /*#__PURE__*/function () {
|
|
|
12759
12761
|
trackingData = _this.trackingData(from.pointerId);
|
|
12760
12762
|
trackingData.pressTargetsByButton[from.button] = e.composedPath();
|
|
12761
12763
|
_this.freeEvent(e);
|
|
12762
|
-
case
|
|
12764
|
+
case 8:
|
|
12763
12765
|
case "end":
|
|
12764
12766
|
return _context.stop();
|
|
12765
12767
|
}
|
|
@@ -12777,16 +12779,13 @@ var EventService = /*#__PURE__*/function () {
|
|
|
12777
12779
|
while (1) {
|
|
12778
12780
|
switch (_context2.prev = _context2.next) {
|
|
12779
12781
|
case 0:
|
|
12780
|
-
if (from instanceof FederatedPointerEvent) {
|
|
12781
|
-
|
|
12782
|
-
|
|
12783
|
-
}
|
|
12784
|
-
return _context2.abrupt("return");
|
|
12785
|
-
case 2:
|
|
12782
|
+
// if (!(from instanceof FederatedPointerEvent)) {
|
|
12783
|
+
// return;
|
|
12784
|
+
// }
|
|
12786
12785
|
now = performance.now();
|
|
12787
|
-
_context2.next =
|
|
12786
|
+
_context2.next = 3;
|
|
12788
12787
|
return _this.createPointerEvent(from);
|
|
12789
|
-
case
|
|
12788
|
+
case 3:
|
|
12790
12789
|
e = _context2.sent;
|
|
12791
12790
|
_this.dispatchEvent(e, 'pointerup');
|
|
12792
12791
|
if (e.pointerType === 'touch') {
|
|
@@ -12849,7 +12848,7 @@ var EventService = /*#__PURE__*/function () {
|
|
|
12849
12848
|
_this.freeEvent(clickEvent);
|
|
12850
12849
|
}
|
|
12851
12850
|
_this.freeEvent(e);
|
|
12852
|
-
case
|
|
12851
|
+
case 12:
|
|
12853
12852
|
case "end":
|
|
12854
12853
|
return _context2.stop();
|
|
12855
12854
|
}
|
|
@@ -12867,40 +12866,34 @@ var EventService = /*#__PURE__*/function () {
|
|
|
12867
12866
|
while (1) {
|
|
12868
12867
|
switch (_context3.prev = _context3.next) {
|
|
12869
12868
|
case 0:
|
|
12870
|
-
|
|
12871
|
-
_context3.next = 2;
|
|
12872
|
-
break;
|
|
12873
|
-
}
|
|
12874
|
-
return _context3.abrupt("return");
|
|
12875
|
-
case 2:
|
|
12876
|
-
_context3.next = 4;
|
|
12869
|
+
_context3.next = 2;
|
|
12877
12870
|
return _this.createPointerEvent(from);
|
|
12878
|
-
case
|
|
12871
|
+
case 2:
|
|
12879
12872
|
e = _context3.sent;
|
|
12880
12873
|
isMouse = e.pointerType === 'mouse' || e.pointerType === 'pen';
|
|
12881
12874
|
trackingData = _this.trackingData(from.pointerId);
|
|
12882
12875
|
outTarget = _this.findMountedTarget(trackingData.overTargets); // First pointerout/pointerleave
|
|
12883
12876
|
if (!(trackingData.overTargets && outTarget !== e.target)) {
|
|
12884
|
-
_context3.next =
|
|
12877
|
+
_context3.next = 21;
|
|
12885
12878
|
break;
|
|
12886
12879
|
}
|
|
12887
12880
|
// pointerout always occurs on the overTarget when the pointer hovers over another element.
|
|
12888
12881
|
outType = from.type === 'mousemove' ? 'mouseout' : 'pointerout';
|
|
12889
|
-
_context3.next =
|
|
12882
|
+
_context3.next = 10;
|
|
12890
12883
|
return _this.createPointerEvent(from, outType, outTarget || undefined);
|
|
12891
|
-
case
|
|
12884
|
+
case 10:
|
|
12892
12885
|
outEvent = _context3.sent;
|
|
12893
12886
|
_this.dispatchEvent(outEvent, 'pointerout');
|
|
12894
12887
|
if (isMouse) _this.dispatchEvent(outEvent, 'mouseout');
|
|
12895
12888
|
// If the pointer exits overTarget and its descendants, then a pointerleave event is also fired. This event
|
|
12896
12889
|
// is dispatched to all ancestors that no longer capture the pointer.
|
|
12897
12890
|
if (e.composedPath().includes(outTarget)) {
|
|
12898
|
-
_context3.next =
|
|
12891
|
+
_context3.next = 20;
|
|
12899
12892
|
break;
|
|
12900
12893
|
}
|
|
12901
|
-
_context3.next =
|
|
12894
|
+
_context3.next = 16;
|
|
12902
12895
|
return _this.createPointerEvent(from, 'pointerleave', outTarget || undefined);
|
|
12903
|
-
case
|
|
12896
|
+
case 16:
|
|
12904
12897
|
leaveEvent = _context3.sent;
|
|
12905
12898
|
leaveEvent.eventPhase = leaveEvent.AT_TARGET;
|
|
12906
12899
|
while (leaveEvent.target && !e.composedPath().includes(leaveEvent.target)) {
|
|
@@ -12914,11 +12907,11 @@ var EventService = /*#__PURE__*/function () {
|
|
|
12914
12907
|
}
|
|
12915
12908
|
}
|
|
12916
12909
|
_this.freeEvent(leaveEvent);
|
|
12917
|
-
case
|
|
12910
|
+
case 20:
|
|
12918
12911
|
_this.freeEvent(outEvent);
|
|
12919
|
-
case
|
|
12912
|
+
case 21:
|
|
12920
12913
|
if (!(outTarget !== e.target)) {
|
|
12921
|
-
_context3.next =
|
|
12914
|
+
_context3.next = 36;
|
|
12922
12915
|
break;
|
|
12923
12916
|
}
|
|
12924
12917
|
// pointerover always occurs on the new overTarget
|
|
@@ -12928,21 +12921,21 @@ var EventService = /*#__PURE__*/function () {
|
|
|
12928
12921
|
if (isMouse) _this.dispatchEvent(overEvent, 'mouseover');
|
|
12929
12922
|
// Probe whether the newly hovered Node is an ancestor of the original overTarget.
|
|
12930
12923
|
overTargetAncestor = outTarget && Node.isNode(outTarget) && outTarget.parentNode;
|
|
12931
|
-
case
|
|
12924
|
+
case 27:
|
|
12932
12925
|
if (!(overTargetAncestor && overTargetAncestor !== (Node.isNode(_this.rootTarget) && _this.rootTarget.parentNode))) {
|
|
12933
|
-
_context3.next =
|
|
12926
|
+
_context3.next = 33;
|
|
12934
12927
|
break;
|
|
12935
12928
|
}
|
|
12936
12929
|
if (!(overTargetAncestor === e.target)) {
|
|
12937
|
-
_context3.next =
|
|
12930
|
+
_context3.next = 30;
|
|
12938
12931
|
break;
|
|
12939
12932
|
}
|
|
12940
|
-
return _context3.abrupt("break",
|
|
12941
|
-
case
|
|
12933
|
+
return _context3.abrupt("break", 33);
|
|
12934
|
+
case 30:
|
|
12942
12935
|
overTargetAncestor = overTargetAncestor.parentNode;
|
|
12943
|
-
_context3.next =
|
|
12936
|
+
_context3.next = 27;
|
|
12944
12937
|
break;
|
|
12945
|
-
case
|
|
12938
|
+
case 33:
|
|
12946
12939
|
// The pointer has entered a non-ancestor of the original overTarget. This means we need a pointerentered
|
|
12947
12940
|
// event.
|
|
12948
12941
|
didPointerEnter = !overTargetAncestor || overTargetAncestor === (Node.isNode(_this.rootTarget) && _this.rootTarget.parentNode);
|
|
@@ -12960,7 +12953,7 @@ var EventService = /*#__PURE__*/function () {
|
|
|
12960
12953
|
_this.freeEvent(enterEvent);
|
|
12961
12954
|
}
|
|
12962
12955
|
_this.freeEvent(overEvent);
|
|
12963
|
-
case
|
|
12956
|
+
case 36:
|
|
12964
12957
|
// Then pointermove
|
|
12965
12958
|
_this.dispatchEvent(e, 'pointermove');
|
|
12966
12959
|
if (e.pointerType === 'touch') _this.dispatchEvent(e, 'touchmove');
|
|
@@ -12970,7 +12963,7 @@ var EventService = /*#__PURE__*/function () {
|
|
|
12970
12963
|
}
|
|
12971
12964
|
trackingData.overTargets = e.composedPath();
|
|
12972
12965
|
_this.freeEvent(e);
|
|
12973
|
-
case
|
|
12966
|
+
case 41:
|
|
12974
12967
|
case "end":
|
|
12975
12968
|
return _context3.stop();
|
|
12976
12969
|
}
|
|
@@ -12988,30 +12981,27 @@ var EventService = /*#__PURE__*/function () {
|
|
|
12988
12981
|
while (1) {
|
|
12989
12982
|
switch (_context4.prev = _context4.next) {
|
|
12990
12983
|
case 0:
|
|
12991
|
-
if (from instanceof FederatedPointerEvent) {
|
|
12992
|
-
|
|
12993
|
-
|
|
12994
|
-
}
|
|
12995
|
-
return _context4.abrupt("return");
|
|
12996
|
-
case 2:
|
|
12984
|
+
// if (!(from instanceof FederatedPointerEvent)) {
|
|
12985
|
+
// return;
|
|
12986
|
+
// }
|
|
12997
12987
|
trackingData = _this.trackingData(from.pointerId);
|
|
12998
12988
|
if (!trackingData.overTargets) {
|
|
12999
|
-
_context4.next =
|
|
12989
|
+
_context4.next = 17;
|
|
13000
12990
|
break;
|
|
13001
12991
|
}
|
|
13002
12992
|
isMouse = from.pointerType === 'mouse' || from.pointerType === 'pen';
|
|
13003
12993
|
outTarget = _this.findMountedTarget(trackingData.overTargets); // pointerout first
|
|
13004
|
-
_context4.next =
|
|
12994
|
+
_context4.next = 6;
|
|
13005
12995
|
return _this.createPointerEvent(from, 'pointerout', outTarget || undefined);
|
|
13006
|
-
case
|
|
12996
|
+
case 6:
|
|
13007
12997
|
outEvent = _context4.sent;
|
|
13008
12998
|
_this.dispatchEvent(outEvent);
|
|
13009
12999
|
if (isMouse) _this.dispatchEvent(outEvent, 'mouseout');
|
|
13010
13000
|
// pointerleave(s) are also dispatched b/c the pointer must've left rootTarget and its descendants to
|
|
13011
13001
|
// get an upstream pointerout event (upstream events do not know rootTarget has descendants).
|
|
13012
|
-
_context4.next =
|
|
13002
|
+
_context4.next = 11;
|
|
13013
13003
|
return _this.createPointerEvent(from, 'pointerleave', outTarget || undefined);
|
|
13014
|
-
case
|
|
13004
|
+
case 11:
|
|
13015
13005
|
leaveEvent = _context4.sent;
|
|
13016
13006
|
leaveEvent.eventPhase = leaveEvent.AT_TARGET;
|
|
13017
13007
|
while (leaveEvent.target && leaveEvent.target !== (Node.isNode(_this.rootTarget) && _this.rootTarget.parentNode)) {
|
|
@@ -13027,9 +13017,9 @@ var EventService = /*#__PURE__*/function () {
|
|
|
13027
13017
|
trackingData.overTargets = null;
|
|
13028
13018
|
_this.freeEvent(outEvent);
|
|
13029
13019
|
_this.freeEvent(leaveEvent);
|
|
13030
|
-
case
|
|
13020
|
+
case 17:
|
|
13031
13021
|
_this.cursor = null;
|
|
13032
|
-
case
|
|
13022
|
+
case 18:
|
|
13033
13023
|
case "end":
|
|
13034
13024
|
return _context4.stop();
|
|
13035
13025
|
}
|
|
@@ -13047,16 +13037,13 @@ var EventService = /*#__PURE__*/function () {
|
|
|
13047
13037
|
while (1) {
|
|
13048
13038
|
switch (_context5.prev = _context5.next) {
|
|
13049
13039
|
case 0:
|
|
13050
|
-
if (from instanceof FederatedPointerEvent) {
|
|
13051
|
-
|
|
13052
|
-
|
|
13053
|
-
}
|
|
13054
|
-
return _context5.abrupt("return");
|
|
13055
|
-
case 2:
|
|
13040
|
+
// if (!(from instanceof FederatedPointerEvent)) {
|
|
13041
|
+
// return;
|
|
13042
|
+
// }
|
|
13056
13043
|
trackingData = _this.trackingData(from.pointerId);
|
|
13057
|
-
_context5.next =
|
|
13044
|
+
_context5.next = 3;
|
|
13058
13045
|
return _this.createPointerEvent(from);
|
|
13059
|
-
case
|
|
13046
|
+
case 3:
|
|
13060
13047
|
e = _context5.sent;
|
|
13061
13048
|
isMouse = e.pointerType === 'mouse' || e.pointerType === 'pen';
|
|
13062
13049
|
_this.dispatchEvent(e, 'pointerover');
|
|
@@ -13080,7 +13067,7 @@ var EventService = /*#__PURE__*/function () {
|
|
|
13080
13067
|
trackingData.overTargets = e.composedPath();
|
|
13081
13068
|
_this.freeEvent(e);
|
|
13082
13069
|
_this.freeEvent(enterEvent);
|
|
13083
|
-
case
|
|
13070
|
+
case 14:
|
|
13084
13071
|
case "end":
|
|
13085
13072
|
return _context5.stop();
|
|
13086
13073
|
}
|
|
@@ -13098,17 +13085,14 @@ var EventService = /*#__PURE__*/function () {
|
|
|
13098
13085
|
while (1) {
|
|
13099
13086
|
switch (_context6.prev = _context6.next) {
|
|
13100
13087
|
case 0:
|
|
13101
|
-
if (from instanceof FederatedPointerEvent) {
|
|
13102
|
-
|
|
13103
|
-
|
|
13104
|
-
}
|
|
13105
|
-
return _context6.abrupt("return");
|
|
13106
|
-
case 2:
|
|
13088
|
+
// if (!(from instanceof FederatedPointerEvent)) {
|
|
13089
|
+
// return;
|
|
13090
|
+
// }
|
|
13107
13091
|
trackingData = _this.trackingData(from.pointerId);
|
|
13108
13092
|
pressTarget = _this.findMountedTarget(trackingData.pressTargetsByButton[from.button]);
|
|
13109
|
-
_context6.next =
|
|
13093
|
+
_context6.next = 4;
|
|
13110
13094
|
return _this.createPointerEvent(from);
|
|
13111
|
-
case
|
|
13095
|
+
case 4:
|
|
13112
13096
|
e = _context6.sent;
|
|
13113
13097
|
if (pressTarget) {
|
|
13114
13098
|
currentTarget = pressTarget;
|
|
@@ -13125,7 +13109,7 @@ var EventService = /*#__PURE__*/function () {
|
|
|
13125
13109
|
delete trackingData.pressTargetsByButton[from.button];
|
|
13126
13110
|
}
|
|
13127
13111
|
_this.freeEvent(e);
|
|
13128
|
-
case
|
|
13112
|
+
case 7:
|
|
13129
13113
|
case "end":
|
|
13130
13114
|
return _context6.stop();
|
|
13131
13115
|
}
|
|
@@ -13143,19 +13127,13 @@ var EventService = /*#__PURE__*/function () {
|
|
|
13143
13127
|
while (1) {
|
|
13144
13128
|
switch (_context7.prev = _context7.next) {
|
|
13145
13129
|
case 0:
|
|
13146
|
-
|
|
13147
|
-
_context7.next = 2;
|
|
13148
|
-
break;
|
|
13149
|
-
}
|
|
13150
|
-
return _context7.abrupt("return");
|
|
13151
|
-
case 2:
|
|
13152
|
-
_context7.next = 4;
|
|
13130
|
+
_context7.next = 2;
|
|
13153
13131
|
return _this.createWheelEvent(from);
|
|
13154
|
-
case
|
|
13132
|
+
case 2:
|
|
13155
13133
|
wheelEvent = _context7.sent;
|
|
13156
13134
|
_this.dispatchEvent(wheelEvent);
|
|
13157
13135
|
_this.freeEvent(wheelEvent);
|
|
13158
|
-
case
|
|
13136
|
+
case 5:
|
|
13159
13137
|
case "end":
|
|
13160
13138
|
return _context7.stop();
|
|
13161
13139
|
}
|
|
@@ -13568,7 +13546,13 @@ var EventService = /*#__PURE__*/function () {
|
|
|
13568
13546
|
return event;
|
|
13569
13547
|
};
|
|
13570
13548
|
_proto.copyPointerData = function copyPointerData(from, to) {
|
|
13571
|
-
if (
|
|
13549
|
+
// if (
|
|
13550
|
+
// !(
|
|
13551
|
+
// from instanceof FederatedPointerEvent &&
|
|
13552
|
+
// to instanceof FederatedPointerEvent
|
|
13553
|
+
// )
|
|
13554
|
+
// )
|
|
13555
|
+
// return;
|
|
13572
13556
|
to.pointerId = from.pointerId;
|
|
13573
13557
|
to.width = from.width;
|
|
13574
13558
|
to.height = from.height;
|
|
@@ -13581,7 +13565,12 @@ var EventService = /*#__PURE__*/function () {
|
|
|
13581
13565
|
to.twist = from.twist;
|
|
13582
13566
|
};
|
|
13583
13567
|
_proto.copyMouseData = function copyMouseData(from, to) {
|
|
13584
|
-
if (
|
|
13568
|
+
// if (
|
|
13569
|
+
// !(
|
|
13570
|
+
// from instanceof FederatedMouseEvent && to instanceof FederatedMouseEvent
|
|
13571
|
+
// )
|
|
13572
|
+
// )
|
|
13573
|
+
// return;
|
|
13585
13574
|
to.altKey = from.altKey;
|
|
13586
13575
|
to.button = from.button;
|
|
13587
13576
|
to.buttons = from.buttons;
|
|
@@ -13843,7 +13832,7 @@ var RenderingService = /*#__PURE__*/function () {
|
|
|
13843
13832
|
case 0:
|
|
13844
13833
|
context = _extends({}, this.globalRuntime, this.context); // register rendering plugins
|
|
13845
13834
|
this.context.renderingPlugins.forEach(function (plugin) {
|
|
13846
|
-
plugin.apply(context);
|
|
13835
|
+
plugin.apply(context, runtime);
|
|
13847
13836
|
});
|
|
13848
13837
|
// await this.hooks.init.callPromise();
|
|
13849
13838
|
_context.next = 4;
|
|
@@ -13876,7 +13865,7 @@ var RenderingService = /*#__PURE__*/function () {
|
|
|
13876
13865
|
enableDirtyRectangleRendering = _renderer$getConfig.enableDirtyRectangleRendering;
|
|
13877
13866
|
return !enableDirtyRectangleRendering || this.context.renderingContext.renderReasons.has(RenderReason.CAMERA_CHANGED);
|
|
13878
13867
|
};
|
|
13879
|
-
_proto.render = function render(canvasConfig) {
|
|
13868
|
+
_proto.render = function render(canvasConfig, rerenderCallback) {
|
|
13880
13869
|
var _this = this;
|
|
13881
13870
|
this.stats.total = 0;
|
|
13882
13871
|
this.stats.rendered = 0;
|
|
@@ -13895,6 +13884,7 @@ var RenderingService = /*#__PURE__*/function () {
|
|
|
13895
13884
|
this.hooks.endFrame.call();
|
|
13896
13885
|
renderingContext.renderListCurrentFrame = [];
|
|
13897
13886
|
renderingContext.renderReasons.clear();
|
|
13887
|
+
rerenderCallback();
|
|
13898
13888
|
}
|
|
13899
13889
|
// console.log('stats', this.stats);
|
|
13900
13890
|
};
|
|
@@ -13943,6 +13933,7 @@ var RenderingService = /*#__PURE__*/function () {
|
|
|
13943
13933
|
_proto.destroy = function destroy() {
|
|
13944
13934
|
this.inited = false;
|
|
13945
13935
|
this.hooks.destroy.call();
|
|
13936
|
+
this.globalRuntime.sceneGraphService.clearPendingEvents();
|
|
13946
13937
|
};
|
|
13947
13938
|
_proto.dirtify = function dirtify() {
|
|
13948
13939
|
// need re-render
|
|
@@ -14494,9 +14485,12 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
|
|
|
14494
14485
|
trigger(element, detail);
|
|
14495
14486
|
}
|
|
14496
14487
|
});
|
|
14497
|
-
this.
|
|
14488
|
+
this.clearPendingEvents();
|
|
14498
14489
|
set.clear();
|
|
14499
14490
|
};
|
|
14491
|
+
_proto.clearPendingEvents = function clearPendingEvents() {
|
|
14492
|
+
this.pendingEvents = [];
|
|
14493
|
+
};
|
|
14500
14494
|
_proto.dirtifyToRoot = function dirtifyToRoot(element, affectChildren) {
|
|
14501
14495
|
if (affectChildren === void 0) {
|
|
14502
14496
|
affectChildren = false;
|
|
@@ -15878,6 +15872,7 @@ var CanvasEvent;
|
|
|
15878
15872
|
(function (CanvasEvent) {
|
|
15879
15873
|
CanvasEvent["READY"] = "ready";
|
|
15880
15874
|
CanvasEvent["BEFORE_RENDER"] = "beforerender";
|
|
15875
|
+
CanvasEvent["RERENDER"] = "rerender";
|
|
15881
15876
|
CanvasEvent["AFTER_RENDER"] = "afterrender";
|
|
15882
15877
|
CanvasEvent["BEFORE_DESTROY"] = "beforedestroy";
|
|
15883
15878
|
CanvasEvent["AFTER_DESTROY"] = "afterdestroy";
|
|
@@ -15893,6 +15888,7 @@ var DEFAULT_CAMERA_FAR = 1000;
|
|
|
15893
15888
|
var mountedEvent = new CustomEvent(ElementEvent.MOUNTED);
|
|
15894
15889
|
var unmountedEvent = new CustomEvent(ElementEvent.UNMOUNTED);
|
|
15895
15890
|
var beforeRenderEvent = new CustomEvent(CanvasEvent.BEFORE_RENDER);
|
|
15891
|
+
var rerenderEvent = new CustomEvent(CanvasEvent.RERENDER);
|
|
15896
15892
|
var afterRenderEvent = new CustomEvent(CanvasEvent.AFTER_RENDER);
|
|
15897
15893
|
/**
|
|
15898
15894
|
* can be treated like Window in DOM
|
|
@@ -16218,16 +16214,21 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
|
16218
16214
|
this.document.documentElement.destroyChildren();
|
|
16219
16215
|
};
|
|
16220
16216
|
_proto.render = function render() {
|
|
16217
|
+
var _this3 = this;
|
|
16221
16218
|
this.dispatchEvent(beforeRenderEvent);
|
|
16222
16219
|
var renderingService = this.getRenderingService();
|
|
16223
|
-
renderingService.render(this.getConfig())
|
|
16220
|
+
renderingService.render(this.getConfig(), function () {
|
|
16221
|
+
// trigger actual rerender event
|
|
16222
|
+
// @see https://github.com/antvis/G/issues/1268
|
|
16223
|
+
_this3.dispatchEvent(rerenderEvent);
|
|
16224
|
+
});
|
|
16224
16225
|
this.dispatchEvent(afterRenderEvent);
|
|
16225
16226
|
};
|
|
16226
16227
|
_proto.run = function run() {
|
|
16227
|
-
var
|
|
16228
|
+
var _this4 = this;
|
|
16228
16229
|
var tick = function tick() {
|
|
16229
|
-
|
|
16230
|
-
|
|
16230
|
+
_this4.render();
|
|
16231
|
+
_this4.frameId = requestAnimationFrame(tick);
|
|
16231
16232
|
};
|
|
16232
16233
|
tick();
|
|
16233
16234
|
};
|
|
@@ -16293,12 +16294,12 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
|
16293
16294
|
return initRenderer;
|
|
16294
16295
|
}();
|
|
16295
16296
|
_proto.loadRendererContainerModule = function loadRendererContainerModule(renderer) {
|
|
16296
|
-
var
|
|
16297
|
+
var _this5 = this;
|
|
16297
16298
|
// load other container modules provided by g-canvas/g-svg/g-webgl
|
|
16298
16299
|
var plugins = renderer.getPlugins();
|
|
16299
16300
|
plugins.forEach(function (plugin) {
|
|
16300
|
-
plugin.context =
|
|
16301
|
-
plugin.init();
|
|
16301
|
+
plugin.context = _this5.context;
|
|
16302
|
+
plugin.init(runtime);
|
|
16302
16303
|
});
|
|
16303
16304
|
};
|
|
16304
16305
|
_proto.setRenderer = /*#__PURE__*/function () {
|
|
@@ -16322,7 +16323,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
|
16322
16323
|
this.destroy(false, true);
|
|
16323
16324
|
// destroy all plugins, reverse will mutate origin array
|
|
16324
16325
|
[].concat(oldRenderer === null || oldRenderer === void 0 ? void 0 : oldRenderer.getPlugins()).reverse().forEach(function (plugin) {
|
|
16325
|
-
plugin.destroy();
|
|
16326
|
+
plugin.destroy(runtime);
|
|
16326
16327
|
});
|
|
16327
16328
|
_context3.next = 9;
|
|
16328
16329
|
return this.initRenderer(renderer);
|
|
@@ -16344,10 +16345,10 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
|
16344
16345
|
this.getContextService().applyCursorStyle(cursor);
|
|
16345
16346
|
};
|
|
16346
16347
|
_proto.unmountChildren = function unmountChildren(parent) {
|
|
16347
|
-
var
|
|
16348
|
+
var _this6 = this;
|
|
16348
16349
|
// unmountChildren recursively
|
|
16349
16350
|
parent.childNodes.forEach(function (child) {
|
|
16350
|
-
|
|
16351
|
+
_this6.unmountChildren(child);
|
|
16351
16352
|
});
|
|
16352
16353
|
if (this.inited) {
|
|
16353
16354
|
if (parent.isMutationObserved) {
|
|
@@ -16370,7 +16371,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
|
16370
16371
|
}
|
|
16371
16372
|
};
|
|
16372
16373
|
_proto.mountChildren = function mountChildren(parent) {
|
|
16373
|
-
var
|
|
16374
|
+
var _this7 = this;
|
|
16374
16375
|
if (this.inited) {
|
|
16375
16376
|
if (!parent.isConnected) {
|
|
16376
16377
|
parent.ownerDocument = this.document;
|
|
@@ -16387,7 +16388,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
|
16387
16388
|
}
|
|
16388
16389
|
// recursively mount children
|
|
16389
16390
|
parent.childNodes.forEach(function (child) {
|
|
16390
|
-
|
|
16391
|
+
_this7.mountChildren(child);
|
|
16391
16392
|
});
|
|
16392
16393
|
// trigger after mounted
|
|
16393
16394
|
if (parent.isCustomElement) {
|
|
@@ -16431,11 +16432,11 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
|
|
|
16431
16432
|
_createClass(Canvas, [{
|
|
16432
16433
|
key: "ready",
|
|
16433
16434
|
get: function get() {
|
|
16434
|
-
var
|
|
16435
|
+
var _this8 = this;
|
|
16435
16436
|
if (!this.readyPromise) {
|
|
16436
16437
|
this.readyPromise = new Promise(function (resolve) {
|
|
16437
|
-
|
|
16438
|
-
resolve(
|
|
16438
|
+
_this8.resolveReadyPromise = function () {
|
|
16439
|
+
resolve(_this8);
|
|
16439
16440
|
};
|
|
16440
16441
|
});
|
|
16441
16442
|
if (this.inited) {
|