@antv/g 5.0.11 → 5.0.14

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 (50) hide show
  1. package/dist/index.umd.min.js +2 -2
  2. package/es/Canvas.js +41 -15
  3. package/es/display-objects/DisplayObject.d.ts +2 -0
  4. package/es/display-objects/DisplayObject.js +10 -0
  5. package/es/display-objects/Polygon.d.ts +2 -5
  6. package/es/display-objects/Polyline.d.ts +2 -6
  7. package/es/display-objects/Text.d.ts +0 -2
  8. package/es/display-objects/Text.js +1 -1
  9. package/es/dom/Element.js +2 -1
  10. package/es/dom/FederatedPointerEvent.d.ts +6 -0
  11. package/es/dom/FederatedPointerEvent.js +8 -0
  12. package/es/global-module.js +2 -1
  13. package/es/property-handlers/aabb.js +28 -24
  14. package/es/services/RenderingService.d.ts +2 -2
  15. package/es/services/RenderingService.js +2 -2
  16. package/es/services/SceneGraphService.d.ts +4 -2
  17. package/es/services/SceneGraphService.js +89 -67
  18. package/es/services/aabb/RectUpdater.js +3 -0
  19. package/es/services/aabb/interfaces.d.ts +2 -1
  20. package/es/services/aabb/interfaces.js +1 -1
  21. package/es/types.d.ts +2 -7
  22. package/es/utils/canvas.d.ts +1 -0
  23. package/es/utils/canvas.js +2 -1
  24. package/es/utils/raf.d.ts +6 -2
  25. package/es/utils/raf.js +15 -2
  26. package/lib/Canvas.js +39 -12
  27. package/lib/display-objects/DisplayObject.d.ts +2 -0
  28. package/lib/display-objects/DisplayObject.js +10 -0
  29. package/lib/display-objects/Polygon.d.ts +2 -5
  30. package/lib/display-objects/Polyline.d.ts +2 -6
  31. package/lib/display-objects/Text.d.ts +0 -2
  32. package/lib/display-objects/Text.js +1 -1
  33. package/lib/dom/Element.js +2 -1
  34. package/lib/dom/FederatedPointerEvent.d.ts +6 -0
  35. package/lib/dom/FederatedPointerEvent.js +8 -0
  36. package/lib/global-module.js +2 -1
  37. package/lib/property-handlers/aabb.js +28 -24
  38. package/lib/services/RenderingService.d.ts +2 -2
  39. package/lib/services/RenderingService.js +1 -1
  40. package/lib/services/SceneGraphService.d.ts +4 -2
  41. package/lib/services/SceneGraphService.js +95 -67
  42. package/lib/services/aabb/RectUpdater.js +3 -0
  43. package/lib/services/aabb/interfaces.d.ts +2 -1
  44. package/lib/services/aabb/interfaces.js +1 -1
  45. package/lib/types.d.ts +2 -7
  46. package/lib/utils/canvas.d.ts +1 -0
  47. package/lib/utils/canvas.js +5 -1
  48. package/lib/utils/raf.d.ts +6 -2
  49. package/lib/utils/raf.js +22 -13
  50. package/package.json +3 -3
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.cleanExistedCanvas = cleanExistedCanvas;
7
+ exports.isBrowser = void 0;
7
8
  var canvasMap = {};
8
9
  var defaultCanvasIdCounter = 0;
9
10
  /**
@@ -20,4 +21,7 @@ function cleanExistedCanvas(container, canvas) {
20
21
 
21
22
  canvasMap[id] = canvas;
22
23
  }
23
- }
24
+ }
25
+
26
+ var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
27
+ exports.isBrowser = isBrowser;
@@ -1,2 +1,6 @@
1
- import { requestAnimationFrame, cancelAnimationFrame } from 'request-animation-frame-polyfill';
2
- export { requestAnimationFrame, cancelAnimationFrame };
1
+ /**
2
+ * use user-defined raf instead of requestAnimationFrame
3
+ */
4
+ export declare function patch(requestAFPatch: (callback: Function) => number, cancelAFPatch: (id: number) => void): void;
5
+ export declare const requestAnimationFrame: (callback: Function) => number;
6
+ export declare const cancelAnimationFrame: (id: number) => void;
package/lib/utils/raf.js CHANGED
@@ -3,17 +3,26 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "cancelAnimationFrame", {
7
- enumerable: true,
8
- get: function get() {
9
- return _requestAnimationFramePolyfill.cancelAnimationFrame;
10
- }
11
- });
12
- Object.defineProperty(exports, "requestAnimationFrame", {
13
- enumerable: true,
14
- get: function get() {
15
- return _requestAnimationFramePolyfill.requestAnimationFrame;
16
- }
17
- });
6
+ exports.cancelAnimationFrame = void 0;
7
+ exports.patch = patch;
8
+ exports.requestAnimationFrame = void 0;
9
+
10
+ var _requestAnimationFramePolyfill = require("request-animation-frame-polyfill");
11
+
12
+ // import { requestAnimationFrame, cancelAnimationFrame } from 'request-animation-frame-polyfill';
13
+ // export { requestAnimationFrame, cancelAnimationFrame };
14
+ var requestAF = _requestAnimationFramePolyfill.requestAnimationFrame;
15
+ var cancelAF = _requestAnimationFramePolyfill.cancelAnimationFrame;
16
+ /**
17
+ * use user-defined raf instead of requestAnimationFrame
18
+ */
19
+
20
+ function patch(requestAFPatch, cancelAFPatch) {
21
+ requestAF = requestAFPatch;
22
+ cancelAF = cancelAFPatch;
23
+ }
18
24
 
19
- var _requestAnimationFramePolyfill = require("request-animation-frame-polyfill");
25
+ var requestAnimationFrame = requestAF;
26
+ exports.requestAnimationFrame = requestAnimationFrame;
27
+ var cancelAnimationFrame = cancelAF;
28
+ exports.cancelAnimationFrame = cancelAnimationFrame;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/g",
3
- "version": "5.0.11",
3
+ "version": "5.0.14",
4
4
  "description": "A core module including ECS and DI container.",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "homepage": "https://github.com/antvis/g#readme",
39
39
  "dependencies": {
40
- "@antv/g-math": "^1.0.9",
40
+ "@antv/g-math": "^1.0.11",
41
41
  "@antv/path-util": "^2.0.14",
42
42
  "@antv/util": "^2.0.13",
43
43
  "@types/offscreencanvas": "^2019.6.4",
@@ -52,5 +52,5 @@
52
52
  "scripts": {
53
53
  "umd": "webpack"
54
54
  },
55
- "gitHead": "6b7cd8851e36923301115549bef7b003ae09a4b0"
55
+ "gitHead": "688274a67997224971b11c806a0e363ea1326240"
56
56
  }