@antv/g-lite 1.2.18 → 1.2.20
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/global-runtime.d.ts +0 -2
- package/dist/index.esm.js +32 -29
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +32 -29
- package/dist/index.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/services/EventService.d.ts +5 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7622,7 +7622,7 @@ var CSSPropertyPoints = /** @class */ (function () {
|
|
|
7622
7622
|
var CSSPropertyShadowBlur = /** @class */ (function (_super) {
|
|
7623
7623
|
tslib.__extends(CSSPropertyShadowBlur, _super);
|
|
7624
7624
|
function CSSPropertyShadowBlur() {
|
|
7625
|
-
var _this = _super
|
|
7625
|
+
var _this = _super.apply(this, tslib.__spreadArray([], tslib.__read(arguments), false)) || this;
|
|
7626
7626
|
_this.mixer = clampedMergeNumbers(0, Infinity);
|
|
7627
7627
|
return _this;
|
|
7628
7628
|
}
|
|
@@ -8534,7 +8534,7 @@ var FederatedEvent = /** @class */ (function () {
|
|
|
8534
8534
|
var FederatedMouseEvent = /** @class */ (function (_super) {
|
|
8535
8535
|
tslib.__extends(FederatedMouseEvent, _super);
|
|
8536
8536
|
function FederatedMouseEvent() {
|
|
8537
|
-
var _this = _super
|
|
8537
|
+
var _this = _super.apply(this, tslib.__spreadArray([], tslib.__read(arguments), false)) || this;
|
|
8538
8538
|
/**
|
|
8539
8539
|
* The coordinates of the mouse event relative to the canvas.
|
|
8540
8540
|
*/
|
|
@@ -8642,7 +8642,7 @@ var FederatedMouseEvent = /** @class */ (function (_super) {
|
|
|
8642
8642
|
var FederatedPointerEvent = /** @class */ (function (_super) {
|
|
8643
8643
|
tslib.__extends(FederatedPointerEvent, _super);
|
|
8644
8644
|
function FederatedPointerEvent() {
|
|
8645
|
-
var _this = _super
|
|
8645
|
+
var _this = _super.apply(this, tslib.__spreadArray([], tslib.__read(arguments), false)) || this;
|
|
8646
8646
|
/**
|
|
8647
8647
|
* The width of the pointer's contact along the x-axis, measured in CSS pixels.
|
|
8648
8648
|
* radiusX of TouchEvents will be represented by this value.
|
|
@@ -8882,7 +8882,7 @@ var EventTarget = /** @class */ (function () {
|
|
|
8882
8882
|
var Node = /** @class */ (function (_super) {
|
|
8883
8883
|
tslib.__extends(Node, _super);
|
|
8884
8884
|
function Node() {
|
|
8885
|
-
var _this = _super
|
|
8885
|
+
var _this = _super.apply(this, tslib.__spreadArray([], tslib.__read(arguments), false)) || this;
|
|
8886
8886
|
_this.shadow = false;
|
|
8887
8887
|
/**
|
|
8888
8888
|
* points to canvas.document
|
|
@@ -9210,6 +9210,10 @@ var EventService = /** @class */ (function () {
|
|
|
9210
9210
|
this.globalRuntime = globalRuntime;
|
|
9211
9211
|
this.context = context;
|
|
9212
9212
|
this.emitter = new EventEmitter();
|
|
9213
|
+
/**
|
|
9214
|
+
* Store HTML elements in current canvas.
|
|
9215
|
+
*/
|
|
9216
|
+
this.nativeHTMLMap = new WeakMap();
|
|
9213
9217
|
this.cursor = 'default';
|
|
9214
9218
|
this.mappingTable = {};
|
|
9215
9219
|
this.mappingState = {
|
|
@@ -9694,7 +9698,7 @@ var EventService = /** @class */ (function () {
|
|
|
9694
9698
|
try {
|
|
9695
9699
|
for (var _b = tslib.__values(event.nativeEvent.composedPath()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
9696
9700
|
var eventTarget = _c.value;
|
|
9697
|
-
var existed = this.
|
|
9701
|
+
var existed = this.nativeHTMLMap.get(eventTarget);
|
|
9698
9702
|
if (existed) {
|
|
9699
9703
|
return existed;
|
|
9700
9704
|
}
|
|
@@ -9947,13 +9951,13 @@ var OffscreenCanvasCreator = /** @class */ (function () {
|
|
|
9947
9951
|
// user-defined offscreen canvas
|
|
9948
9952
|
if (offscreenCanvas || runtime.offscreenCanvas) {
|
|
9949
9953
|
this.canvas = offscreenCanvas || runtime.offscreenCanvas;
|
|
9950
|
-
this.context = this.canvas.getContext('2d', contextAttributes);
|
|
9954
|
+
this.context = this.canvas.getContext('2d', tslib.__assign({ willReadFrequently: true }, contextAttributes));
|
|
9951
9955
|
}
|
|
9952
9956
|
else {
|
|
9953
9957
|
try {
|
|
9954
9958
|
// OffscreenCanvas2D measureText can be up to 40% faster.
|
|
9955
9959
|
this.canvas = new window.OffscreenCanvas(0, 0);
|
|
9956
|
-
this.context = this.canvas.getContext('2d', contextAttributes);
|
|
9960
|
+
this.context = this.canvas.getContext('2d', tslib.__assign({ willReadFrequently: true }, contextAttributes));
|
|
9957
9961
|
if (!this.context || !this.context.measureText) {
|
|
9958
9962
|
this.canvas = document.createElement('canvas');
|
|
9959
9963
|
this.context = this.canvas.getContext('2d');
|
|
@@ -9961,7 +9965,7 @@ var OffscreenCanvasCreator = /** @class */ (function () {
|
|
|
9961
9965
|
}
|
|
9962
9966
|
catch (ex) {
|
|
9963
9967
|
this.canvas = document.createElement('canvas');
|
|
9964
|
-
this.context = this.canvas.getContext('2d', contextAttributes);
|
|
9968
|
+
this.context = this.canvas.getContext('2d', tslib.__assign({ willReadFrequently: true }, contextAttributes));
|
|
9965
9969
|
}
|
|
9966
9970
|
}
|
|
9967
9971
|
this.canvas.width = 10;
|
|
@@ -11158,23 +11162,23 @@ var TEXT_METRICS = {
|
|
|
11158
11162
|
BaselineMultiplier: 1.4,
|
|
11159
11163
|
HeightMultiplier: 2,
|
|
11160
11164
|
Newlines: [
|
|
11161
|
-
0x000a,
|
|
11165
|
+
0x000a, // line feed
|
|
11162
11166
|
0x000d, // carriage return
|
|
11163
11167
|
],
|
|
11164
11168
|
BreakingSpaces: [
|
|
11165
|
-
0x0009,
|
|
11166
|
-
0x0020,
|
|
11167
|
-
0x2000,
|
|
11168
|
-
0x2001,
|
|
11169
|
-
0x2002,
|
|
11170
|
-
0x2003,
|
|
11171
|
-
0x2004,
|
|
11172
|
-
0x2005,
|
|
11173
|
-
0x2006,
|
|
11174
|
-
0x2008,
|
|
11175
|
-
0x2009,
|
|
11176
|
-
0x200a,
|
|
11177
|
-
0x205f,
|
|
11169
|
+
0x0009, // character tabulation
|
|
11170
|
+
0x0020, // space
|
|
11171
|
+
0x2000, // en quad
|
|
11172
|
+
0x2001, // em quad
|
|
11173
|
+
0x2002, // en space
|
|
11174
|
+
0x2003, // em space
|
|
11175
|
+
0x2004, // three-per-em space
|
|
11176
|
+
0x2005, // four-per-em space
|
|
11177
|
+
0x2006, // six-per-em space
|
|
11178
|
+
0x2008, // punctuation space
|
|
11179
|
+
0x2009, // thin space
|
|
11180
|
+
0x200a, // hair space
|
|
11181
|
+
0x205f, // medium mathematical space
|
|
11178
11182
|
0x3000, // ideographic space
|
|
11179
11183
|
],
|
|
11180
11184
|
};
|
|
@@ -11637,7 +11641,6 @@ runtime.CameraContribution = Camera;
|
|
|
11637
11641
|
runtime.AnimationTimeline = null;
|
|
11638
11642
|
runtime.EasingFunction = null;
|
|
11639
11643
|
runtime.offscreenCanvasCreator = new OffscreenCanvasCreator();
|
|
11640
|
-
runtime.nativeHTMLMap = new WeakMap();
|
|
11641
11644
|
runtime.sceneGraphSelector = new DefaultSceneGraphSelector();
|
|
11642
11645
|
runtime.sceneGraphService = new DefaultSceneGraphService(runtime);
|
|
11643
11646
|
runtime.textService = new TextService(runtime);
|
|
@@ -11666,7 +11669,7 @@ var destroyEvent = new CustomEvent(exports.ElementEvent.DESTROY);
|
|
|
11666
11669
|
var Element = /** @class */ (function (_super) {
|
|
11667
11670
|
tslib.__extends(Element, _super);
|
|
11668
11671
|
function Element() {
|
|
11669
|
-
var _this = _super
|
|
11672
|
+
var _this = _super.apply(this, tslib.__spreadArray([], tslib.__read(arguments), false)) || this;
|
|
11670
11673
|
/**
|
|
11671
11674
|
* Unique id.
|
|
11672
11675
|
*/
|
|
@@ -13138,8 +13141,8 @@ var CustomElement = /** @class */ (function (_super) {
|
|
|
13138
13141
|
tslib.__extends(CustomElement, _super);
|
|
13139
13142
|
// private shadowNodes: DisplayObject[] = [];
|
|
13140
13143
|
function CustomElement(_a) {
|
|
13141
|
-
var _this = this;
|
|
13142
13144
|
if (_a === void 0) { _a = {}; }
|
|
13145
|
+
var _this = this;
|
|
13143
13146
|
var style = _a.style, rest = tslib.__rest(_a, ["style"]);
|
|
13144
13147
|
_this = _super.call(this, tslib.__assign({ style: runtime.enableCSSParsing
|
|
13145
13148
|
? tslib.__assign({ x: '', y: '' }, style) : tslib.__assign({}, style) }, rest)) || this;
|
|
@@ -13196,8 +13199,8 @@ var Group = /** @class */ (function (_super) {
|
|
|
13196
13199
|
var HTML = /** @class */ (function (_super) {
|
|
13197
13200
|
tslib.__extends(HTML, _super);
|
|
13198
13201
|
function HTML(_a) {
|
|
13199
|
-
var _this = this;
|
|
13200
13202
|
if (_a === void 0) { _a = {}; }
|
|
13203
|
+
var _this = this;
|
|
13201
13204
|
var style = _a.style, rest = tslib.__rest(_a, ["style"]);
|
|
13202
13205
|
_this = _super.call(this, tslib.__assign({ type: exports.Shape.HTML, style: runtime.enableCSSParsing
|
|
13203
13206
|
? tslib.__assign({ x: '', y: '', width: 'auto', height: 'auto', innerHTML: '' }, style) : tslib.__assign({}, style) }, rest)) || this;
|
|
@@ -13275,8 +13278,8 @@ var Image = /** @class */ (function (_super) {
|
|
|
13275
13278
|
var Line = /** @class */ (function (_super) {
|
|
13276
13279
|
tslib.__extends(Line, _super);
|
|
13277
13280
|
function Line(_a) {
|
|
13278
|
-
var _this = this;
|
|
13279
13281
|
if (_a === void 0) { _a = {}; }
|
|
13282
|
+
var _this = this;
|
|
13280
13283
|
var style = _a.style, rest = tslib.__rest(_a, ["style"]);
|
|
13281
13284
|
_this = _super.call(this, tslib.__assign({ type: exports.Shape.LINE, style: tslib.__assign({ x1: 0, y1: 0, x2: 0, y2: 0, z1: 0, z2: 0 }, style) }, rest)) || this;
|
|
13282
13285
|
_this.markerStartAngle = 0;
|
|
@@ -13386,8 +13389,8 @@ var Line = /** @class */ (function (_super) {
|
|
|
13386
13389
|
var Path = /** @class */ (function (_super) {
|
|
13387
13390
|
tslib.__extends(Path, _super);
|
|
13388
13391
|
function Path(_a) {
|
|
13389
|
-
var _this = this;
|
|
13390
13392
|
if (_a === void 0) { _a = {}; }
|
|
13393
|
+
var _this = this;
|
|
13391
13394
|
var style = _a.style, rest = tslib.__rest(_a, ["style"]);
|
|
13392
13395
|
_this = _super.call(this, tslib.__assign({ type: exports.Shape.PATH, style: runtime.enableCSSParsing
|
|
13393
13396
|
? tslib.__assign({ path: '', miterLimit: '' }, style) : tslib.__assign({}, style), initialParsedStyle: runtime.enableCSSParsing
|
|
@@ -13587,8 +13590,8 @@ var Path = /** @class */ (function (_super) {
|
|
|
13587
13590
|
var Polygon = /** @class */ (function (_super) {
|
|
13588
13591
|
tslib.__extends(Polygon, _super);
|
|
13589
13592
|
function Polygon(_a) {
|
|
13590
|
-
var _this = this;
|
|
13591
13593
|
if (_a === void 0) { _a = {}; }
|
|
13594
|
+
var _this = this;
|
|
13592
13595
|
var style = _a.style, rest = tslib.__rest(_a, ["style"]);
|
|
13593
13596
|
_this = _super.call(this, tslib.__assign({ type: exports.Shape.POLYGON, style: runtime.enableCSSParsing
|
|
13594
13597
|
? tslib.__assign({ points: '', miterLimit: '', isClosed: true }, style) : tslib.__assign({}, style), initialParsedStyle: runtime.enableCSSParsing
|