@antv/g-lite 1.2.19 → 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 +29 -26
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +29 -26
- 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/global-runtime.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import type { LayoutRegistry } from './css';
|
|
|
3
3
|
import type { CSSProperty } from './css/CSSProperty';
|
|
4
4
|
import { DefaultStyleValueRegistry } from './css/StyleValueRegistry';
|
|
5
5
|
import { PropertySyntax } from './css/interfaces';
|
|
6
|
-
import type { HTML } from './display-objects';
|
|
7
6
|
import type { GeometryAABBUpdater, SceneGraphSelector, SceneGraphService } from './services';
|
|
8
7
|
import { OffscreenCanvasCreator, TextService } from './services';
|
|
9
8
|
import { CanvasLike, Shape } from './types';
|
|
@@ -23,7 +22,6 @@ export interface GlobalRuntime {
|
|
|
23
22
|
CSSPropertySyntaxFactory: Record<PropertySyntax, Partial<CSSProperty<any, any>>>;
|
|
24
23
|
globalThis: any;
|
|
25
24
|
enableCSSParsing: boolean;
|
|
26
|
-
nativeHTMLMap: WeakMap<HTMLElement, HTML>;
|
|
27
25
|
/**
|
|
28
26
|
* Enable using dataset property.
|
|
29
27
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset
|
package/dist/index.esm.js
CHANGED
|
@@ -7601,7 +7601,7 @@ var CSSPropertyPoints = /** @class */ (function () {
|
|
|
7601
7601
|
var CSSPropertyShadowBlur = /** @class */ (function (_super) {
|
|
7602
7602
|
__extends(CSSPropertyShadowBlur, _super);
|
|
7603
7603
|
function CSSPropertyShadowBlur() {
|
|
7604
|
-
var _this = _super
|
|
7604
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
7605
7605
|
_this.mixer = clampedMergeNumbers(0, Infinity);
|
|
7606
7606
|
return _this;
|
|
7607
7607
|
}
|
|
@@ -8513,7 +8513,7 @@ var FederatedEvent = /** @class */ (function () {
|
|
|
8513
8513
|
var FederatedMouseEvent = /** @class */ (function (_super) {
|
|
8514
8514
|
__extends(FederatedMouseEvent, _super);
|
|
8515
8515
|
function FederatedMouseEvent() {
|
|
8516
|
-
var _this = _super
|
|
8516
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
8517
8517
|
/**
|
|
8518
8518
|
* The coordinates of the mouse event relative to the canvas.
|
|
8519
8519
|
*/
|
|
@@ -8621,7 +8621,7 @@ var FederatedMouseEvent = /** @class */ (function (_super) {
|
|
|
8621
8621
|
var FederatedPointerEvent = /** @class */ (function (_super) {
|
|
8622
8622
|
__extends(FederatedPointerEvent, _super);
|
|
8623
8623
|
function FederatedPointerEvent() {
|
|
8624
|
-
var _this = _super
|
|
8624
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
8625
8625
|
/**
|
|
8626
8626
|
* The width of the pointer's contact along the x-axis, measured in CSS pixels.
|
|
8627
8627
|
* radiusX of TouchEvents will be represented by this value.
|
|
@@ -8861,7 +8861,7 @@ var EventTarget = /** @class */ (function () {
|
|
|
8861
8861
|
var Node = /** @class */ (function (_super) {
|
|
8862
8862
|
__extends(Node, _super);
|
|
8863
8863
|
function Node() {
|
|
8864
|
-
var _this = _super
|
|
8864
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
8865
8865
|
_this.shadow = false;
|
|
8866
8866
|
/**
|
|
8867
8867
|
* points to canvas.document
|
|
@@ -9189,6 +9189,10 @@ var EventService = /** @class */ (function () {
|
|
|
9189
9189
|
this.globalRuntime = globalRuntime;
|
|
9190
9190
|
this.context = context;
|
|
9191
9191
|
this.emitter = new EventEmitter();
|
|
9192
|
+
/**
|
|
9193
|
+
* Store HTML elements in current canvas.
|
|
9194
|
+
*/
|
|
9195
|
+
this.nativeHTMLMap = new WeakMap();
|
|
9192
9196
|
this.cursor = 'default';
|
|
9193
9197
|
this.mappingTable = {};
|
|
9194
9198
|
this.mappingState = {
|
|
@@ -9673,7 +9677,7 @@ var EventService = /** @class */ (function () {
|
|
|
9673
9677
|
try {
|
|
9674
9678
|
for (var _b = __values(event.nativeEvent.composedPath()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
9675
9679
|
var eventTarget = _c.value;
|
|
9676
|
-
var existed = this.
|
|
9680
|
+
var existed = this.nativeHTMLMap.get(eventTarget);
|
|
9677
9681
|
if (existed) {
|
|
9678
9682
|
return existed;
|
|
9679
9683
|
}
|
|
@@ -11137,23 +11141,23 @@ var TEXT_METRICS = {
|
|
|
11137
11141
|
BaselineMultiplier: 1.4,
|
|
11138
11142
|
HeightMultiplier: 2,
|
|
11139
11143
|
Newlines: [
|
|
11140
|
-
0x000a,
|
|
11144
|
+
0x000a, // line feed
|
|
11141
11145
|
0x000d, // carriage return
|
|
11142
11146
|
],
|
|
11143
11147
|
BreakingSpaces: [
|
|
11144
|
-
0x0009,
|
|
11145
|
-
0x0020,
|
|
11146
|
-
0x2000,
|
|
11147
|
-
0x2001,
|
|
11148
|
-
0x2002,
|
|
11149
|
-
0x2003,
|
|
11150
|
-
0x2004,
|
|
11151
|
-
0x2005,
|
|
11152
|
-
0x2006,
|
|
11153
|
-
0x2008,
|
|
11154
|
-
0x2009,
|
|
11155
|
-
0x200a,
|
|
11156
|
-
0x205f,
|
|
11148
|
+
0x0009, // character tabulation
|
|
11149
|
+
0x0020, // space
|
|
11150
|
+
0x2000, // en quad
|
|
11151
|
+
0x2001, // em quad
|
|
11152
|
+
0x2002, // en space
|
|
11153
|
+
0x2003, // em space
|
|
11154
|
+
0x2004, // three-per-em space
|
|
11155
|
+
0x2005, // four-per-em space
|
|
11156
|
+
0x2006, // six-per-em space
|
|
11157
|
+
0x2008, // punctuation space
|
|
11158
|
+
0x2009, // thin space
|
|
11159
|
+
0x200a, // hair space
|
|
11160
|
+
0x205f, // medium mathematical space
|
|
11157
11161
|
0x3000, // ideographic space
|
|
11158
11162
|
],
|
|
11159
11163
|
};
|
|
@@ -11616,7 +11620,6 @@ runtime.CameraContribution = Camera;
|
|
|
11616
11620
|
runtime.AnimationTimeline = null;
|
|
11617
11621
|
runtime.EasingFunction = null;
|
|
11618
11622
|
runtime.offscreenCanvasCreator = new OffscreenCanvasCreator();
|
|
11619
|
-
runtime.nativeHTMLMap = new WeakMap();
|
|
11620
11623
|
runtime.sceneGraphSelector = new DefaultSceneGraphSelector();
|
|
11621
11624
|
runtime.sceneGraphService = new DefaultSceneGraphService(runtime);
|
|
11622
11625
|
runtime.textService = new TextService(runtime);
|
|
@@ -11645,7 +11648,7 @@ var destroyEvent = new CustomEvent(ElementEvent.DESTROY);
|
|
|
11645
11648
|
var Element = /** @class */ (function (_super) {
|
|
11646
11649
|
__extends(Element, _super);
|
|
11647
11650
|
function Element() {
|
|
11648
|
-
var _this = _super
|
|
11651
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
|
11649
11652
|
/**
|
|
11650
11653
|
* Unique id.
|
|
11651
11654
|
*/
|
|
@@ -13117,8 +13120,8 @@ var CustomElement = /** @class */ (function (_super) {
|
|
|
13117
13120
|
__extends(CustomElement, _super);
|
|
13118
13121
|
// private shadowNodes: DisplayObject[] = [];
|
|
13119
13122
|
function CustomElement(_a) {
|
|
13120
|
-
var _this = this;
|
|
13121
13123
|
if (_a === void 0) { _a = {}; }
|
|
13124
|
+
var _this = this;
|
|
13122
13125
|
var style = _a.style, rest = __rest(_a, ["style"]);
|
|
13123
13126
|
_this = _super.call(this, __assign({ style: runtime.enableCSSParsing
|
|
13124
13127
|
? __assign({ x: '', y: '' }, style) : __assign({}, style) }, rest)) || this;
|
|
@@ -13175,8 +13178,8 @@ var Group = /** @class */ (function (_super) {
|
|
|
13175
13178
|
var HTML = /** @class */ (function (_super) {
|
|
13176
13179
|
__extends(HTML, _super);
|
|
13177
13180
|
function HTML(_a) {
|
|
13178
|
-
var _this = this;
|
|
13179
13181
|
if (_a === void 0) { _a = {}; }
|
|
13182
|
+
var _this = this;
|
|
13180
13183
|
var style = _a.style, rest = __rest(_a, ["style"]);
|
|
13181
13184
|
_this = _super.call(this, __assign({ type: Shape.HTML, style: runtime.enableCSSParsing
|
|
13182
13185
|
? __assign({ x: '', y: '', width: 'auto', height: 'auto', innerHTML: '' }, style) : __assign({}, style) }, rest)) || this;
|
|
@@ -13254,8 +13257,8 @@ var Image = /** @class */ (function (_super) {
|
|
|
13254
13257
|
var Line = /** @class */ (function (_super) {
|
|
13255
13258
|
__extends(Line, _super);
|
|
13256
13259
|
function Line(_a) {
|
|
13257
|
-
var _this = this;
|
|
13258
13260
|
if (_a === void 0) { _a = {}; }
|
|
13261
|
+
var _this = this;
|
|
13259
13262
|
var style = _a.style, rest = __rest(_a, ["style"]);
|
|
13260
13263
|
_this = _super.call(this, __assign({ type: Shape.LINE, style: __assign({ x1: 0, y1: 0, x2: 0, y2: 0, z1: 0, z2: 0 }, style) }, rest)) || this;
|
|
13261
13264
|
_this.markerStartAngle = 0;
|
|
@@ -13365,8 +13368,8 @@ var Line = /** @class */ (function (_super) {
|
|
|
13365
13368
|
var Path = /** @class */ (function (_super) {
|
|
13366
13369
|
__extends(Path, _super);
|
|
13367
13370
|
function Path(_a) {
|
|
13368
|
-
var _this = this;
|
|
13369
13371
|
if (_a === void 0) { _a = {}; }
|
|
13372
|
+
var _this = this;
|
|
13370
13373
|
var style = _a.style, rest = __rest(_a, ["style"]);
|
|
13371
13374
|
_this = _super.call(this, __assign({ type: Shape.PATH, style: runtime.enableCSSParsing
|
|
13372
13375
|
? __assign({ path: '', miterLimit: '' }, style) : __assign({}, style), initialParsedStyle: runtime.enableCSSParsing
|
|
@@ -13566,8 +13569,8 @@ var Path = /** @class */ (function (_super) {
|
|
|
13566
13569
|
var Polygon = /** @class */ (function (_super) {
|
|
13567
13570
|
__extends(Polygon, _super);
|
|
13568
13571
|
function Polygon(_a) {
|
|
13569
|
-
var _this = this;
|
|
13570
13572
|
if (_a === void 0) { _a = {}; }
|
|
13573
|
+
var _this = this;
|
|
13571
13574
|
var style = _a.style, rest = __rest(_a, ["style"]);
|
|
13572
13575
|
_this = _super.call(this, __assign({ type: Shape.POLYGON, style: runtime.enableCSSParsing
|
|
13573
13576
|
? __assign({ points: '', miterLimit: '', isClosed: true }, style) : __assign({}, style), initialParsedStyle: runtime.enableCSSParsing
|