@antv/g-lite 2.5.1 → 2.6.0

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 (40) hide show
  1. package/dist/index.esm.js +1698 -6
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/index.js +1705 -5
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.umd.min.js +7 -7
  6. package/dist/index.umd.min.js.map +1 -1
  7. package/package.json +5 -5
  8. package/types/dom/MutationEvent.d.ts +4 -3
  9. package/types/dom/MutationEvent.d.ts.map +1 -1
  10. package/types/dom/index.d.ts +0 -1
  11. package/types/dom/index.d.ts.map +1 -1
  12. package/types/index.d.ts +6 -0
  13. package/types/index.d.ts.map +1 -1
  14. package/types/plugins/MutationObserver.d.ts +49 -0
  15. package/types/plugins/MutationObserver.d.ts.map +1 -0
  16. package/types/plugins/dom-interaction/DOMInteractionPlugin.d.ts +10 -0
  17. package/types/plugins/dom-interaction/DOMInteractionPlugin.d.ts.map +1 -0
  18. package/types/plugins/dom-interaction/index.d.ts +7 -0
  19. package/types/plugins/dom-interaction/index.d.ts.map +1 -0
  20. package/types/plugins/html-renderer/HTMLRenderingPlugin.d.ts +19 -0
  21. package/types/plugins/html-renderer/HTMLRenderingPlugin.d.ts.map +1 -0
  22. package/types/plugins/html-renderer/index.d.ts +7 -0
  23. package/types/plugins/html-renderer/index.d.ts.map +1 -0
  24. package/types/plugins/html-renderer/interface.d.ts +2 -0
  25. package/types/plugins/html-renderer/interface.d.ts.map +1 -0
  26. package/types/plugins/image-loader/ImagePool.d.ts +37 -0
  27. package/types/plugins/image-loader/ImagePool.d.ts.map +1 -0
  28. package/types/plugins/image-loader/ImageSlicer.d.ts +38 -0
  29. package/types/plugins/image-loader/ImageSlicer.d.ts.map +1 -0
  30. package/types/plugins/image-loader/LoadImagePlugin.d.ts +9 -0
  31. package/types/plugins/image-loader/LoadImagePlugin.d.ts.map +1 -0
  32. package/types/plugins/image-loader/RefCountCache.d.ts +14 -0
  33. package/types/plugins/image-loader/RefCountCache.d.ts.map +1 -0
  34. package/types/plugins/image-loader/index.d.ts +9 -0
  35. package/types/plugins/image-loader/index.d.ts.map +1 -0
  36. package/types/plugins/mobile-interaction/MobileInteractionPlugin.d.ts +9 -0
  37. package/types/plugins/mobile-interaction/MobileInteractionPlugin.d.ts.map +1 -0
  38. package/types/plugins/mobile-interaction/index.d.ts +7 -0
  39. package/types/plugins/mobile-interaction/index.d.ts.map +1 -0
  40. package/types/services/OffscreenCanvasCreator.d.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/g-lite",
3
- "version": "2.5.1",
3
+ "version": "2.6.0",
4
4
  "description": "A core module for rendering engine implements DOM API.",
5
5
  "keywords": [
6
6
  "antv",
@@ -42,7 +42,7 @@
42
42
  "eventemitter3": "^5.0.1",
43
43
  "gl-matrix": "^3.4.3",
44
44
  "tslib": "^2.5.3",
45
- "@antv/g-math": "3.0.1"
45
+ "@antv/g-math": "3.1.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/d3-color": "^3.0.2",
@@ -54,9 +54,9 @@
54
54
  "access": "public"
55
55
  },
56
56
  "scripts": {
57
- "build:types": "tsc --emitDeclarationOnly --noCheck",
58
- "build": "npm run clean && npm run build:types && rollup -c",
59
- "clean": "rimraf dist",
57
+ "build:js": "rimraf dist && rollup -c",
58
+ "build:types": "rimraf types && tsc --emitDeclarationOnly --noCheck",
59
+ "build": "npm run build:js && npm run build:types",
60
60
  "sync": "tnpm sync",
61
61
  "watch": "rollup -c -w"
62
62
  }
@@ -1,10 +1,11 @@
1
1
  import { FederatedEvent } from './FederatedEvent';
2
- import type { ElementEvent, IElement } from './interfaces';
2
+ import type { ElementEvent } from './interfaces';
3
+ import type { Node } from './Node';
3
4
  /**
4
5
  * @deprecated https://developer.chrome.com/blog/mutation-events-deprecation
5
6
  */
6
7
  export declare class MutationEvent extends FederatedEvent {
7
- relatedNode: IElement;
8
+ relatedNode: Node;
8
9
  prevValue: any;
9
10
  newValue: any;
10
11
  attrName: string;
@@ -14,6 +15,6 @@ export declare class MutationEvent extends FederatedEvent {
14
15
  static readonly ADDITION: number;
15
16
  static readonly MODIFICATION: number;
16
17
  static readonly REMOVAL: number;
17
- constructor(typeArg: ElementEvent, relatedNode: IElement, prevValue: any, newValue: any, attrName: string, attrChange: number, prevParsedValue: any, newParsedValue: any);
18
+ constructor(typeArg: ElementEvent, relatedNode: Node, prevValue: any, newValue: any, attrName: string, attrChange: number, prevParsedValue: any, newParsedValue: any);
18
19
  }
19
20
  //# sourceMappingURL=MutationEvent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MutationEvent.d.ts","sourceRoot":"","sources":["../../src/dom/MutationEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE3D;;GAEG;AACH,qBAAa,aAAc,SAAQ,cAAc;IAOtC,WAAW,EAAE,QAAQ;IACrB,SAAS,EAAE,GAAG;IACd,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,MAAM;IAClB,eAAe,EAAE,GAAG;IACpB,cAAc,EAAE,GAAG;IAZ5B,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAK;IACrC,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAK;IACzC,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAK;gBAGlC,OAAO,EAAE,YAAY,EACd,WAAW,EAAE,QAAQ,EACrB,SAAS,EAAE,GAAG,EACd,QAAQ,EAAE,GAAG,EACb,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,GAAG,EACpB,cAAc,EAAE,GAAG;CAM7B"}
1
+ {"version":3,"file":"MutationEvent.d.ts","sourceRoot":"","sources":["../../src/dom/MutationEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC;;GAEG;AACH,qBAAa,aAAc,SAAQ,cAAc;IAOtC,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,GAAG;IACd,QAAQ,EAAE,GAAG;IACb,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,MAAM;IAClB,eAAe,EAAE,GAAG;IACpB,cAAc,EAAE,GAAG;IAZ5B,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAK;IACrC,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAK;IACzC,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAK;gBAGlC,OAAO,EAAE,YAAY,EACd,WAAW,EAAE,IAAI,EACjB,SAAS,EAAE,GAAG,EACd,QAAQ,EAAE,GAAG,EACb,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,GAAG,EACpB,cAAc,EAAE,GAAG;CAM7B"}
@@ -9,6 +9,5 @@ export * from './FederatedPointerEvent';
9
9
  export * from './FederatedWheelEvent';
10
10
  export * from './interfaces';
11
11
  export * from './MutationEvent';
12
- export * from './MutationObserver';
13
12
  export * from './Node';
14
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dom/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dom/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAEhC,cAAc,QAAQ,CAAC"}
package/types/index.d.ts CHANGED
@@ -11,4 +11,10 @@ export * from './services';
11
11
  export * from './shapes';
12
12
  export * from './types';
13
13
  export { ERROR_MSG_METHOD_NOT_IMPLEMENTED, computeLinearGradient, computeRadialGradient, convertToPath, createVec3, decompose, definedProps, deg2rad, deg2turn, findClosestClipPathTarget, fromRotationTranslationScale, getAngle, getEuler, getOrCalculatePathTotalLength, grad2deg, isBrowser, isFillOrStrokeAffected, parsedTransformToMat4, rad2deg, setDOMSize, translatePathToString, turn2deg, } from './utils';
14
+ export * from './plugins/MutationObserver';
15
+ export * as ImageLoader from './plugins/image-loader';
16
+ export { ImagePool, type ImageCache } from './plugins/image-loader';
17
+ export * as HTMLRenderer from './plugins/html-renderer';
18
+ export * as DomInteraction from './plugins/dom-interaction';
19
+ export * as MobileInteraction from './plugins/mobile-interaction';
14
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,mBAAmB,EACnB,GAAG,EACH,gBAAgB,EAChB,eAAe,EACf,MAAM,EACN,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,WAAW,EACX,UAAU,EACV,WAAW,EACX,SAAS,EACT,cAAc,EACd,qBAAqB,GACtB,MAAM,OAAO,CAAC;AACf,YAAY,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,EACf,OAAO,EACP,cAAc,EACd,kBAAkB,GACnB,MAAM,OAAO,CAAC;AACf,cAAc,mBAAmB,CAAC;AAClC,cAAc,OAAO,CAAC;AACtB,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,OAAO,EACL,gCAAgC,EAChC,qBAAqB,EACrB,qBAAqB,EACrB,aAAa,EACb,UAAU,EACV,SAAS,EACT,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,yBAAyB,EACzB,4BAA4B,EAC5B,QAAQ,EACR,QAAQ,EACR,6BAA6B,EAC7B,QAAQ,EACR,SAAS,EACT,sBAAsB,EACtB,qBAAqB,EACrB,OAAO,EACP,UAAU,EACV,qBAAqB,EACrB,QAAQ,GACT,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,mBAAmB,EACnB,GAAG,EACH,gBAAgB,EAChB,eAAe,EACf,MAAM,EACN,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,WAAW,EACX,UAAU,EACV,WAAW,EACX,SAAS,EACT,cAAc,EACd,qBAAqB,GACtB,MAAM,OAAO,CAAC;AACf,YAAY,EACV,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,EACf,OAAO,EACP,cAAc,EACd,kBAAkB,GACnB,MAAM,OAAO,CAAC;AACf,cAAc,mBAAmB,CAAC;AAClC,cAAc,OAAO,CAAC;AACtB,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,OAAO,EACL,gCAAgC,EAChC,qBAAqB,EACrB,qBAAqB,EACrB,aAAa,EACb,UAAU,EACV,SAAS,EACT,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,yBAAyB,EACzB,4BAA4B,EAC5B,QAAQ,EACR,QAAQ,EACR,6BAA6B,EAC7B,QAAQ,EACR,SAAS,EACT,sBAAsB,EACtB,qBAAqB,EACrB,OAAO,EACP,UAAU,EACV,qBAAqB,EACrB,QAAQ,GACT,MAAM,SAAS,CAAC;AAGjB,cAAc,4BAA4B,CAAC;AAC3C,OAAO,KAAK,WAAW,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,cAAc,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,iBAAiB,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,49 @@
1
+ import type { DisplayObject, Node } from '..';
2
+ import { MutationEvent } from '..';
3
+ import type { MutationRecord as IMutationRecord } from '../dom/MutationObserver';
4
+ export declare class MutationRecord implements IMutationRecord {
5
+ type: MutationRecordType;
6
+ target: Node;
7
+ static copy(original: MutationRecord): MutationRecord;
8
+ addedNodes: Node[];
9
+ attributeName: string;
10
+ attributeNamespace: string;
11
+ nextSibling: Node;
12
+ oldValue: string;
13
+ previousSibling: Node;
14
+ removedNodes: Node[];
15
+ constructor(type: MutationRecordType, target: Node);
16
+ }
17
+ export declare class Registration {
18
+ observer: MutationObserver;
19
+ target: Node;
20
+ options?: MutationObserverInit;
21
+ private transientObservedNodes;
22
+ constructor(observer: MutationObserver, target: Node, options?: MutationObserverInit);
23
+ enqueue(record: MutationRecord): void;
24
+ addListeners(): void;
25
+ private addListeners_;
26
+ removeListeners(): void;
27
+ removeListeners_(node: Node): void;
28
+ /**
29
+ * Adds a transient observer on node. The transient observer gets removed
30
+ * next time we deliver the change records.
31
+ */
32
+ removeTransientObservers(): void;
33
+ handleEvent(e: MutationEvent): void;
34
+ }
35
+ /**
36
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver
37
+ * @see https://github.com/googlearchive/MutationObservers/blob/master/MutationObserver.js
38
+ */
39
+ export declare class MutationObserver {
40
+ callback: MutationCallback;
41
+ nodes: Node[];
42
+ records: MutationRecord[];
43
+ uid: number;
44
+ constructor(callback: MutationCallback);
45
+ observe(target: DisplayObject, options?: MutationObserverInit): void;
46
+ disconnect(): void;
47
+ takeRecords(): MutationRecord[];
48
+ }
49
+ //# sourceMappingURL=MutationObserver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MutationObserver.d.ts","sourceRoot":"","sources":["../../src/plugins/MutationObserver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAgB,aAAa,EAAW,MAAM,IAAI,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,IAAI,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAKjF,qBAAa,cAAe,YAAW,eAAe;IAqB3C,IAAI,EAAE,kBAAkB;IACxB,MAAM,EAAE,IAAI;IArBrB,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc;IAYpC,UAAU,EAAE,IAAI,EAAE,CAAM;IACxB,aAAa,EAAE,MAAM,CAAQ;IAC7B,kBAAkB,EAAE,MAAM,CAAQ;IAClC,WAAW,EAAE,IAAI,CAAQ;IACzB,QAAQ,EAAE,MAAM,CAAQ;IACxB,eAAe,EAAE,IAAI,CAAQ;IAC7B,YAAY,EAAE,IAAI,EAAE,CAAM;gBAEjB,IAAI,EAAE,kBAAkB,EACxB,MAAM,EAAE,IAAI;CAEtB;AAED,qBAAa,YAAY;IAId,QAAQ,EAAE,gBAAgB;IAC1B,MAAM,EAAE,IAAI;IACZ,OAAO,CAAC,EAAE,oBAAoB;IALvC,OAAO,CAAC,sBAAsB,CAAM;gBAG3B,QAAQ,EAAE,gBAAgB,EAC1B,MAAM,EAAE,IAAI,EACZ,OAAO,CAAC,EAAE,oBAAoB;IAGvC,OAAO,CAAC,MAAM,EAAE,cAAc;IAsB9B,YAAY;IAIZ,OAAO,CAAC,aAAa;IAcrB,eAAe;IAIf,gBAAgB,CAAC,IAAI,EAAE,IAAI;IAc3B;;;OAGG;IAgBH,wBAAwB;IAoBxB,WAAW,CAAC,CAAC,EAAE,aAAa;CA+G7B;AAED;;;GAGG;AACH,qBAAa,gBAAgB;IAKR,QAAQ,EAAE,gBAAgB;IAJ7C,KAAK,EAAE,IAAI,EAAE,CAAM;IACnB,OAAO,EAAE,cAAc,EAAE,CAAM;IAC/B,GAAG,SAAgB;gBAEA,QAAQ,EAAE,gBAAgB;IAE7C,OAAO,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,oBAAoB;IA+C7D,UAAU;IAiBV,WAAW;CAKZ"}
@@ -0,0 +1,10 @@
1
+ import type { GlobalRuntime, RenderingPlugin, RenderingPluginContext } from '../..';
2
+ /**
3
+ * listen to mouse/touch/pointer events on DOM wrapper, trigger pointer events
4
+ */
5
+ export declare class DOMInteractionPlugin implements RenderingPlugin {
6
+ static tag: string;
7
+ private context;
8
+ apply(context: RenderingPluginContext, runtime: GlobalRuntime): void;
9
+ }
10
+ //# sourceMappingURL=DOMInteractionPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DOMInteractionPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/dom-interaction/DOMInteractionPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAEb,eAAe,EACf,sBAAsB,EACvB,MAAM,OAAO,CAAC;AAIf;;GAEG;AACH,qBAAa,oBAAqB,YAAW,eAAe;IAC1D,MAAM,CAAC,GAAG,SAAoB;IAE9B,OAAO,CAAC,OAAO,CAAyB;IAExC,KAAK,CAAC,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,aAAa;CAkL9D"}
@@ -0,0 +1,7 @@
1
+ import { AbstractRendererPlugin } from '../..';
2
+ export declare class Plugin extends AbstractRendererPlugin {
3
+ name: string;
4
+ init(): void;
5
+ destroy(): void;
6
+ }
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/dom-interaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAG/C,qBAAa,MAAO,SAAQ,sBAAsB;IAChD,IAAI,SAAqB;IAEzB,IAAI,IAAI,IAAI;IAGZ,OAAO,IAAI,IAAI;CAGhB"}
@@ -0,0 +1,19 @@
1
+ import { GlobalRuntime, RenderingPlugin, RenderingPluginContext } from '../..';
2
+ export declare class HTMLRenderingPlugin implements RenderingPlugin {
3
+ static tag: string;
4
+ private context;
5
+ /**
6
+ * wrapper for camera
7
+ */
8
+ private $camera;
9
+ private displayObjectHTMLElementMap;
10
+ /**
11
+ * ! The reason for adding `offset` is that the `transform-origin` coordinate system of DOM is the local coordinate system of the element, while the `transform-origin` coordinate system of canvas drawing is the local coordinate system of the element's parent element. At the same time, the `transform` attribute value of the DOM element does not include `transform-origin`.
12
+ */
13
+ private joinTransformMatrix;
14
+ apply(context: RenderingPluginContext, runtime: GlobalRuntime): void;
15
+ private createCamera;
16
+ private getOrCreateEl;
17
+ private updateAttribute;
18
+ }
19
+ //# sourceMappingURL=HTMLRenderingPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HTMLRenderingPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/html-renderer/HTMLRenderingPlugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,aAAa,EAKb,eAAe,EACf,sBAAsB,EAOvB,MAAM,OAAO,CAAC;AAIf,qBAAa,mBAAoB,YAAW,eAAe;IACzD,MAAM,CAAC,GAAG,SAAmB;IAE7B,OAAO,CAAC,OAAO,CAAyB;IAExC;;OAEG;IACH,OAAO,CAAC,OAAO,CAAiB;IAEhC,OAAO,CAAC,2BAA2B,CAG/B;IAEJ;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAW3B,KAAK,CAAC,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,aAAa;IA0H7D,OAAO,CAAC,YAAY;IA+CpB,OAAO,CAAC,aAAa;IAgCrB,OAAO,CAAC,eAAe;CAyGxB"}
@@ -0,0 +1,7 @@
1
+ import { AbstractRendererPlugin } from '../..';
2
+ export declare class Plugin extends AbstractRendererPlugin {
3
+ name: string;
4
+ init(): void;
5
+ destroy(): void;
6
+ }
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/html-renderer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAG/C,qBAAa,MAAO,SAAQ,sBAAsB;IAChD,IAAI,SAAmB;IACvB,IAAI,IAAI,IAAI;IAGZ,OAAO,IAAI,IAAI;CAGhB"}
@@ -0,0 +1,2 @@
1
+ export declare const HTMLRendererPluginConfig = "HTMLRendererPluginConfig";
2
+ //# sourceMappingURL=interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/plugins/html-renderer/interface.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,6BAA6B,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { DisplayObject, GradientType, LinearGradient, Pattern, RadialGradient, Tuple3Number, Image, type CanvasContext, type GlobalRuntime } from '../..';
2
+ import { type SliceResult } from './ImageSlicer';
3
+ export interface ImageCache extends Partial<SliceResult> {
4
+ img: HTMLImageElement;
5
+ /** [width, height] */
6
+ size: [number, number];
7
+ downSampled?: ImageBitmap | HTMLImageElement;
8
+ downSamplingRate?: number;
9
+ }
10
+ export type GradientParams = (LinearGradient & RadialGradient) & {
11
+ width: number;
12
+ height: number;
13
+ /**
14
+ * Top-left corner
15
+ */
16
+ min: [number, number];
17
+ type: GradientType;
18
+ };
19
+ export declare class ImagePool {
20
+ context: CanvasContext;
21
+ private runtime;
22
+ static isSupportTile: boolean;
23
+ private gradientCache;
24
+ private patternCache;
25
+ constructor(context: CanvasContext, runtime: GlobalRuntime);
26
+ getImageSync(src: Image['attributes']['src'], ref: DisplayObject, callback?: (cache: ImageCache) => void): ImageCache | null;
27
+ getOrCreateImage(src: Image['attributes']['src'], ref: DisplayObject): Promise<ImageCache>;
28
+ createDownSampledImage(src: Image['attributes']['src'], ref: DisplayObject): Promise<ImageCache>;
29
+ createImageTiles(src: Image['attributes']['src'], tiles: [number, number][], rerender: () => void, ref: DisplayObject): Promise<ImageCache>;
30
+ releaseImage(src: Image['attributes']['src'], ref: DisplayObject): void;
31
+ releaseImageRef(ref: DisplayObject): void;
32
+ getOrCreatePatternSync(object: DisplayObject, pattern: Pattern, context: CanvasRenderingContext2D, $offscreenCanvas: HTMLCanvasElement, dpr: number, min: Tuple3Number, callback: () => void): CanvasPattern;
33
+ getOrCreateGradient(params: GradientParams, context: CanvasRenderingContext2D): CanvasGradient;
34
+ private generateGradientKey;
35
+ private generatePatternKey;
36
+ }
37
+ //# sourceMappingURL=ImagePool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImagePool.d.ts","sourceRoot":"","sources":["../../../src/plugins/image-loader/ImagePool.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,YAAY,EACZ,cAAc,EACd,OAAO,EACP,cAAc,EAEd,YAAY,EAMZ,KAAK,EAGL,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,WAAW,EAAe,MAAM,eAAe,CAAC;AAE9D,MAAM,WAAW,UAAW,SAAQ,OAAO,CAAC,WAAW,CAAC;IACtD,GAAG,EAAE,gBAAgB,CAAC;IACtB,sBAAsB;IACtB,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvB,WAAW,CAAC,EAAE,WAAW,GAAG,gBAAgB,CAAC;IAC7C,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAgBD,MAAM,MAAM,cAAc,GAAG,CAAC,cAAc,GAAG,cAAc,CAAC,GAAG;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtB,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC;AAEF,qBAAa,SAAS;IAMX,OAAO,EAAE,aAAa;IAC7B,OAAO,CAAC,OAAO;IANjB,MAAM,CAAC,aAAa,UAA2C;IAC/D,OAAO,CAAC,aAAa,CAAsC;IAC3D,OAAO,CAAC,YAAY,CAAqC;gBAGhD,OAAO,EAAE,aAAa,EACrB,OAAO,EAAE,aAAa;IAGhC,YAAY,CACV,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,EAC/B,GAAG,EAAE,aAAa,EAClB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GACrC,UAAU,GAAG,IAAI;IAwBpB,gBAAgB,CACd,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,EAC/B,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,UAAU,CAAC;IAkEhB,sBAAsB,CAC1B,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,EAC/B,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,UAAU,CAAC;IAoDhB,gBAAgB,CACpB,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,EAC/B,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EACzB,QAAQ,EAAE,MAAM,IAAI,EACpB,GAAG,EAAE,aAAa,GACjB,OAAO,CAAC,UAAU,CAAC;IA0BtB,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,aAAa;IAIhE,eAAe,CAAC,GAAG,EAAE,aAAa;IAIlC,sBAAsB,CACpB,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,wBAAwB,EACjC,gBAAgB,EAAE,iBAAiB,EACnC,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,YAAY,EACjB,QAAQ,EAAE,MAAM,IAAI;IAyDtB,mBAAmB,CACjB,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,wBAAwB;IA6CnC,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,kBAAkB;CAU3B"}
@@ -0,0 +1,38 @@
1
+ interface API {
2
+ requestAnimationFrame: typeof requestAnimationFrame;
3
+ cancelAnimationFrame: typeof cancelAnimationFrame;
4
+ createCanvas: () => HTMLCanvasElement | OffscreenCanvas;
5
+ }
6
+ export interface SliceResult {
7
+ tileSize: [number, number];
8
+ /** [rows, cols] */
9
+ gridSize: [number, number];
10
+ /**
11
+ * @example
12
+ * ```
13
+ * [
14
+ * // tileY=0
15
+ * [tileX=0, tileX=1, ...],
16
+ * // tileY=1
17
+ * [tileX=0, tileX=1, ...],
18
+ * ]
19
+ * ```
20
+ */
21
+ tiles: (null | {
22
+ x: number;
23
+ y: number;
24
+ tileX: number;
25
+ tileY: number;
26
+ data: HTMLCanvasElement | OffscreenCanvas;
27
+ })[][];
28
+ }
29
+ export declare class ImageSlicer {
30
+ static api: API;
31
+ static TASK_NUM_PER_FRAME: number;
32
+ static rafId: ReturnType<typeof requestAnimationFrame>;
33
+ static stop(api?: API): void;
34
+ static executeTask(api?: API): void;
35
+ static sliceImage(image: HTMLImageElement, sliceWidth: number, sliceHeight: number, rerender: () => void, overlap?: number, api?: API): SliceResult;
36
+ }
37
+ export {};
38
+ //# sourceMappingURL=ImageSlicer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageSlicer.d.ts","sourceRoot":"","sources":["../../../src/plugins/image-loader/ImageSlicer.ts"],"names":[],"mappings":"AAGA,UAAU,GAAG;IACX,qBAAqB,EAAE,OAAO,qBAAqB,CAAC;IACpD,oBAAoB,EAAE,OAAO,oBAAoB,CAAC;IAClD,YAAY,EAAE,MAAM,iBAAiB,GAAG,eAAe,CAAC;CACzD;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,mBAAmB;IACnB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B;;;;;;;;;;OAUG;IACH,KAAK,EAAE,CAAC,IAAI,GAAG;QACb,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,iBAAiB,GAAG,eAAe,CAAC;KAC3C,CAAC,EAAE,EAAE,CAAC;CACR;AAED,qBAAa,WAAW;IACtB,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC;IAChB,MAAM,CAAC,kBAAkB,SAAM;IAC/B,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;IAEvD,MAAM,CAAC,IAAI,CAAC,GAAG,MAAkB;IAOjC,MAAM,CAAC,WAAW,CAAC,GAAG,MAAkB;IAaxC,MAAM,CAAC,UAAU,CACf,KAAK,EAAE,gBAAgB,EACvB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,IAAI,EACpB,OAAO,SAAI,EACX,GAAG,MAAkB;CAyExB"}
@@ -0,0 +1,9 @@
1
+ import type { RenderingPlugin, RenderingPluginContext } from '../..';
2
+ import { ImagePool } from './ImagePool';
3
+ export declare class LoadImagePlugin implements RenderingPlugin {
4
+ static tag: string;
5
+ apply(context: RenderingPluginContext & {
6
+ imagePool: ImagePool;
7
+ }): void;
8
+ }
9
+ //# sourceMappingURL=LoadImagePlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoadImagePlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/image-loader/LoadImagePlugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAIV,eAAe,EACf,sBAAsB,EAEvB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,eAAgB,YAAW,eAAe;IACrD,MAAM,CAAC,GAAG,SAAe;IAEzB,KAAK,CAAC,OAAO,EAAE,sBAAsB,GAAG;QAAE,SAAS,EAAE,SAAS,CAAA;KAAE;CAsFjE"}
@@ -0,0 +1,14 @@
1
+ import { DisplayObject } from '../..';
2
+ export declare class RefCountCache<CacheValue> {
3
+ private cacheStore;
4
+ onRefAdded(ref: DisplayObject): void;
5
+ has(key: string): boolean;
6
+ put(key: string, item: CacheValue, ref: DisplayObject): boolean;
7
+ get(key: string, ref: DisplayObject): CacheValue;
8
+ update(key: string, value: CacheValue, ref: DisplayObject): boolean;
9
+ release(key: string, ref: DisplayObject): boolean;
10
+ releaseRef(ref: DisplayObject): void;
11
+ getSize(): number;
12
+ clear(): void;
13
+ }
14
+ //# sourceMappingURL=RefCountCache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RefCountCache.d.ts","sourceRoot":"","sources":["../../../src/plugins/image-loader/RefCountCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,qBAAa,aAAa,CAAC,UAAU;IACnC,OAAO,CAAC,UAAU,CAGd;IAEJ,UAAU,CAAC,GAAG,EAAE,aAAa;IAE7B,GAAG,CAAC,GAAG,EAAE,MAAM;IAIf,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa;IAcrD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa;IAcnC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa;IAezD,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa;IAevC,UAAU,CAAC,GAAG,EAAE,aAAa;IAM7B,OAAO;IAIP,KAAK;CAGN"}
@@ -0,0 +1,9 @@
1
+ import { AbstractRendererPlugin, type GlobalRuntime } from '../..';
2
+ import { ImagePool, type ImageCache } from './ImagePool';
3
+ export { ImagePool, type ImageCache };
4
+ export declare class Plugin extends AbstractRendererPlugin {
5
+ name: string;
6
+ init(runtime: GlobalRuntime): void;
7
+ destroy(): void;
8
+ }
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/image-loader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzD,OAAO,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,CAAC;AAEtC,qBAAa,MAAO,SAAQ,sBAAsB;IAChD,IAAI,SAAkB;IACtB,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAKlC,OAAO,IAAI,IAAI;CAGhB"}
@@ -0,0 +1,9 @@
1
+ import type { RenderingPlugin, RenderingPluginContext } from '../..';
2
+ /**
3
+ * listen to mouse/touch/pointer events on DOM wrapper, trigger pointer events
4
+ */
5
+ export declare class MobileInteractionPlugin implements RenderingPlugin {
6
+ static tag: string;
7
+ apply(context: RenderingPluginContext): void;
8
+ }
9
+ //# sourceMappingURL=MobileInteractionPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MobileInteractionPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/mobile-interaction/MobileInteractionPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,eAAe,EACf,sBAAsB,EACvB,MAAM,OAAO,CAAC;AACf;;GAEG;AACH,qBAAa,uBAAwB,YAAW,eAAe;IAC7D,MAAM,CAAC,GAAG,SAAuB;IAEjC,KAAK,CAAC,OAAO,EAAE,sBAAsB;CAuEtC"}
@@ -0,0 +1,7 @@
1
+ import { AbstractRendererPlugin } from '../..';
2
+ export declare class Plugin extends AbstractRendererPlugin {
3
+ name: string;
4
+ init(): void;
5
+ destroy(): void;
6
+ }
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/mobile-interaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAG/C,qBAAa,MAAO,SAAQ,sBAAsB;IAChD,IAAI,SAAwB;IAC5B,IAAI,IAAI,IAAI;IAGZ,OAAO,IAAI,IAAI;CAGhB"}
@@ -2,7 +2,7 @@ import type { CanvasLike } from '..';
2
2
  /**
3
3
  * used in following scenes:
4
4
  * - g `ctx.measureText`
5
- * - g-plugin-canvas-picker `ctx.isPointInPath`
5
+ * - canvas-picker `ctx.isPointInPath`
6
6
  * - g-plugin-device-renderer `ctx.createLinearGradient` and generate texture
7
7
  *
8
8
  * @see https://blog.scottlogic.com/2020/03/19/offscreen-canvas.html