@antv/g-lite 1.0.22 → 1.0.24
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/Canvas.d.ts.map +1 -1
- package/dist/css/StyleValueRegistry.d.ts.map +1 -1
- package/dist/css/parser/color.d.ts.map +1 -1
- package/dist/css/parser/dimension.d.ts.map +1 -1
- package/dist/css/parser/gradient.d.ts.map +1 -1
- package/dist/css/parser/numeric.d.ts.map +1 -1
- package/dist/css/parser/path.d.ts.map +1 -1
- package/dist/css/parser/transform-origin.d.ts.map +1 -1
- package/dist/display-objects/DisplayObject.d.ts.map +1 -1
- package/dist/display-objects/Rect.d.ts +2 -2
- package/dist/display-objects/Rect.d.ts.map +1 -1
- package/dist/dom/Document.d.ts.map +1 -1
- package/dist/dom/Element.d.ts.map +1 -1
- package/dist/global-runtime.d.ts +1 -0
- package/dist/global-runtime.d.ts.map +1 -1
- package/dist/index.esm.js +100 -55
- package/dist/index.js +115 -70
- package/dist/index.umd.js +104 -99
- package/dist/index.umd.min.js +1 -1
- package/dist/services/EventService.d.ts +1 -0
- package/dist/services/EventService.d.ts.map +1 -1
- package/dist/services/SceneGraphSelector.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/memoize.d.ts +8 -0
- package/dist/utils/memoize.d.ts.map +1 -0
- package/package.json +3 -3
package/dist/index.umd.js
CHANGED
|
@@ -5355,13 +5355,6 @@
|
|
|
5355
5355
|
return result[0].length === result[1].length ? result : equalizeSegments(result[0], result[1], tl);
|
|
5356
5356
|
}
|
|
5357
5357
|
|
|
5358
|
-
/**
|
|
5359
|
-
* @see https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_isfunction
|
|
5360
|
-
*/
|
|
5361
|
-
var isFunction = (function (value) {
|
|
5362
|
-
return typeof value === 'function';
|
|
5363
|
-
});
|
|
5364
|
-
|
|
5365
5358
|
// isFinite,
|
|
5366
5359
|
var isNil = function (value) {
|
|
5367
5360
|
/**
|
|
@@ -5487,36 +5480,6 @@
|
|
|
5487
5480
|
return value === undefined;
|
|
5488
5481
|
};
|
|
5489
5482
|
|
|
5490
|
-
/**
|
|
5491
|
-
* _.memoize(calColor);
|
|
5492
|
-
* _.memoize(calColor, (...args) => args[0]);
|
|
5493
|
-
* @param f
|
|
5494
|
-
* @param resolver
|
|
5495
|
-
*/
|
|
5496
|
-
var memoize = (function (f, resolver) {
|
|
5497
|
-
if (!isFunction(f)) {
|
|
5498
|
-
throw new TypeError('Expected a function');
|
|
5499
|
-
}
|
|
5500
|
-
var memoized = function () {
|
|
5501
|
-
var args = [];
|
|
5502
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
5503
|
-
args[_i] = arguments[_i];
|
|
5504
|
-
}
|
|
5505
|
-
// 使用方法构造 key,如果不存在 resolver,则直接取第一个参数作为 key
|
|
5506
|
-
var key = resolver ? resolver.apply(this, args) : args[0];
|
|
5507
|
-
var cache = memoized.cache;
|
|
5508
|
-
if (cache.has(key)) {
|
|
5509
|
-
return cache.get(key);
|
|
5510
|
-
}
|
|
5511
|
-
var result = f.apply(this, args);
|
|
5512
|
-
// 缓存起来
|
|
5513
|
-
cache.set(key, result);
|
|
5514
|
-
return result;
|
|
5515
|
-
};
|
|
5516
|
-
memoized.cache = new Map();
|
|
5517
|
-
return memoized;
|
|
5518
|
-
});
|
|
5519
|
-
|
|
5520
5483
|
/**
|
|
5521
5484
|
* Axis-Aligned Bounding Box
|
|
5522
5485
|
* 为了便于后续 Frustum Culling,通过查找表定义 p-vertex 和 n-vertex
|
|
@@ -5892,6 +5855,28 @@
|
|
|
5892
5855
|
Shape["MESH"] = "mesh";
|
|
5893
5856
|
})(exports.Shape || (exports.Shape = {}));
|
|
5894
5857
|
|
|
5858
|
+
function memoize(func, resolver) {
|
|
5859
|
+
if (typeof func !== 'function' || resolver != null && typeof resolver !== 'function') {
|
|
5860
|
+
throw new TypeError('Expected a function');
|
|
5861
|
+
}
|
|
5862
|
+
var memoized = function memoized() {
|
|
5863
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
5864
|
+
args[_key] = arguments[_key];
|
|
5865
|
+
}
|
|
5866
|
+
var key = resolver ? resolver.apply(this, args) : args[0];
|
|
5867
|
+
var cache = memoized.cache;
|
|
5868
|
+
if (cache.has(key)) {
|
|
5869
|
+
return cache.get(key);
|
|
5870
|
+
}
|
|
5871
|
+
var result = func.apply(this, args);
|
|
5872
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
5873
|
+
return result;
|
|
5874
|
+
};
|
|
5875
|
+
memoized.cache = new (memoize.Cache || Map)();
|
|
5876
|
+
return memoized;
|
|
5877
|
+
}
|
|
5878
|
+
memoize.Cache = Map;
|
|
5879
|
+
|
|
5895
5880
|
var camelCase = memoize(function (str) {
|
|
5896
5881
|
if (str === void 0) {
|
|
5897
5882
|
str = '';
|
|
@@ -5916,7 +5901,7 @@
|
|
|
5916
5901
|
throw new Error();
|
|
5917
5902
|
}
|
|
5918
5903
|
}
|
|
5919
|
-
function isFunction
|
|
5904
|
+
function isFunction(func) {
|
|
5920
5905
|
return typeof func === 'function';
|
|
5921
5906
|
}
|
|
5922
5907
|
var definedProps = function definedProps(obj) {
|
|
@@ -12204,7 +12189,7 @@
|
|
|
12204
12189
|
_proto.addEventListener = function addEventListener(type, listener, options) {
|
|
12205
12190
|
var capture = isBoolean(options) && options || isObject(options) && options.capture;
|
|
12206
12191
|
var once = isObject(options) && options.once;
|
|
12207
|
-
var context = isFunction
|
|
12192
|
+
var context = isFunction(listener) ? undefined : listener;
|
|
12208
12193
|
// compatible with G 3.0
|
|
12209
12194
|
// support using delegate name in event type, eg. 'node:click'
|
|
12210
12195
|
var useDelegatedName = false;
|
|
@@ -12218,7 +12203,7 @@
|
|
|
12218
12203
|
useDelegatedName = true;
|
|
12219
12204
|
}
|
|
12220
12205
|
type = capture ? type + "capture" : type;
|
|
12221
|
-
listener = isFunction
|
|
12206
|
+
listener = isFunction(listener) ? listener : listener.handleEvent;
|
|
12222
12207
|
// compatible with G 3.0
|
|
12223
12208
|
if (useDelegatedName) {
|
|
12224
12209
|
var originListener = listener;
|
|
@@ -12260,9 +12245,9 @@
|
|
|
12260
12245
|
_proto.removeEventListener = function removeEventListener(type, listener, options) {
|
|
12261
12246
|
var _listener;
|
|
12262
12247
|
var capture = isBoolean(options) && options || isObject(options) && options.capture;
|
|
12263
|
-
var context = isFunction
|
|
12248
|
+
var context = isFunction(listener) ? undefined : listener;
|
|
12264
12249
|
type = capture ? type + "capture" : type;
|
|
12265
|
-
listener = isFunction
|
|
12250
|
+
listener = isFunction(listener) ? listener : (_listener = listener) === null || _listener === void 0 ? void 0 : _listener.handleEvent;
|
|
12266
12251
|
this.emitter.off(type, listener, context);
|
|
12267
12252
|
return this;
|
|
12268
12253
|
}
|
|
@@ -12359,19 +12344,13 @@
|
|
|
12359
12344
|
};
|
|
12360
12345
|
_proto.hasChildNodes = function hasChildNodes() {
|
|
12361
12346
|
return this.childNodes.length > 0;
|
|
12362
|
-
}
|
|
12363
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12364
|
-
;
|
|
12347
|
+
};
|
|
12365
12348
|
_proto.isDefaultNamespace = function isDefaultNamespace(namespace) {
|
|
12366
12349
|
throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);
|
|
12367
|
-
}
|
|
12368
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12369
|
-
;
|
|
12350
|
+
};
|
|
12370
12351
|
_proto.lookupNamespaceURI = function lookupNamespaceURI(prefix) {
|
|
12371
12352
|
throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);
|
|
12372
|
-
}
|
|
12373
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12374
|
-
;
|
|
12353
|
+
};
|
|
12375
12354
|
_proto.lookupPrefix = function lookupPrefix(namespace) {
|
|
12376
12355
|
throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);
|
|
12377
12356
|
};
|
|
@@ -12599,7 +12578,7 @@
|
|
|
12599
12578
|
inh = _ref.inh,
|
|
12600
12579
|
d = _ref.d;
|
|
12601
12580
|
if (inh && d) {
|
|
12602
|
-
initialStyle[n] = isFunction
|
|
12581
|
+
initialStyle[n] = isFunction(d) ? d(exports.Shape.GROUP) : d;
|
|
12603
12582
|
}
|
|
12604
12583
|
});
|
|
12605
12584
|
// like <html> in DOM tree
|
|
@@ -12633,15 +12612,17 @@
|
|
|
12633
12612
|
};
|
|
12634
12613
|
_proto.createElementNS = function createElementNS(namespaceURI, tagName, options) {
|
|
12635
12614
|
return this.createElement(tagName, options);
|
|
12636
|
-
}
|
|
12637
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12638
|
-
;
|
|
12615
|
+
};
|
|
12639
12616
|
_proto.cloneNode = function cloneNode(deep) {
|
|
12640
12617
|
throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);
|
|
12641
12618
|
};
|
|
12642
12619
|
_proto.destroy = function destroy() {
|
|
12643
12620
|
try {
|
|
12644
|
-
this.documentElement.
|
|
12621
|
+
[].concat(this.documentElement.childNodes).forEach(function (child, i) {
|
|
12622
|
+
child.forEach(function (object) {
|
|
12623
|
+
object.destroy();
|
|
12624
|
+
});
|
|
12625
|
+
});
|
|
12645
12626
|
this.timeline.destroy();
|
|
12646
12627
|
} catch (e) {}
|
|
12647
12628
|
}
|
|
@@ -12869,33 +12850,22 @@
|
|
|
12869
12850
|
/**
|
|
12870
12851
|
* eg. Uncaught DOMException: Failed to execute 'appendChild' on 'Node': Only one element on document allowed.
|
|
12871
12852
|
*/
|
|
12872
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12873
12853
|
;
|
|
12874
12854
|
_proto.appendChild = function appendChild(newChild, index) {
|
|
12875
12855
|
throw new Error(ERROR_MSG_USE_DOCUMENT_ELEMENT);
|
|
12876
|
-
}
|
|
12877
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12878
|
-
;
|
|
12856
|
+
};
|
|
12879
12857
|
_proto.insertBefore = function insertBefore(newChild, refChild) {
|
|
12880
12858
|
throw new Error(ERROR_MSG_USE_DOCUMENT_ELEMENT);
|
|
12881
|
-
}
|
|
12882
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12883
|
-
;
|
|
12859
|
+
};
|
|
12884
12860
|
_proto.removeChild = function removeChild(oldChild, destroy) {
|
|
12885
12861
|
throw new Error(ERROR_MSG_USE_DOCUMENT_ELEMENT);
|
|
12886
|
-
}
|
|
12887
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12888
|
-
;
|
|
12862
|
+
};
|
|
12889
12863
|
_proto.replaceChild = function replaceChild(newChild, oldChild, destroy) {
|
|
12890
12864
|
throw new Error(ERROR_MSG_USE_DOCUMENT_ELEMENT);
|
|
12891
|
-
}
|
|
12892
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12893
|
-
;
|
|
12865
|
+
};
|
|
12894
12866
|
_proto.append = function append() {
|
|
12895
12867
|
throw new Error(ERROR_MSG_USE_DOCUMENT_ELEMENT);
|
|
12896
|
-
}
|
|
12897
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12898
|
-
;
|
|
12868
|
+
};
|
|
12899
12869
|
_proto.prepend = function prepend() {
|
|
12900
12870
|
throw new Error(ERROR_MSG_USE_DOCUMENT_ELEMENT);
|
|
12901
12871
|
}
|
|
@@ -13160,7 +13130,6 @@
|
|
|
13160
13130
|
* Unique id.
|
|
13161
13131
|
*/;
|
|
13162
13132
|
var _proto = Element.prototype;
|
|
13163
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13164
13133
|
_proto.cloneNode = function cloneNode(deep) {
|
|
13165
13134
|
throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);
|
|
13166
13135
|
};
|
|
@@ -13466,9 +13435,7 @@
|
|
|
13466
13435
|
/**
|
|
13467
13436
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute
|
|
13468
13437
|
*/;
|
|
13469
|
-
_proto.setAttribute = function setAttribute(attributeName, value,
|
|
13470
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13471
|
-
force) {
|
|
13438
|
+
_proto.setAttribute = function setAttribute(attributeName, value, force) {
|
|
13472
13439
|
this.attributes[attributeName] = value;
|
|
13473
13440
|
};
|
|
13474
13441
|
_proto.getAttributeNS = function getAttributeNS(namespace, localName) {
|
|
@@ -13792,7 +13759,8 @@
|
|
|
13792
13759
|
filter: [],
|
|
13793
13760
|
shadowType: 'outer'
|
|
13794
13761
|
};
|
|
13795
|
-
var
|
|
13762
|
+
var INHERITABLE_BASE_STYLE_PROPS = ['opacity', 'fillOpacity', 'strokeOpacity', 'transformOrigin', 'visibility', 'pointerEvents', 'lineWidth', 'lineCap', 'lineJoin', 'increasedLineWidthForHitTesting'];
|
|
13763
|
+
var INHERITABLE_STYLE_PROPS = [].concat(INHERITABLE_BASE_STYLE_PROPS, ['fontSize', 'fontFamily', 'fontStyle', 'fontWeight', 'fontVariant', 'textAlign', 'textBaseline', 'textTransform']);
|
|
13796
13764
|
/**
|
|
13797
13765
|
* prototype chains: DisplayObject -> Element -> Node -> EventTarget
|
|
13798
13766
|
*
|
|
@@ -13899,6 +13867,12 @@
|
|
|
13899
13867
|
this.getAnimations().forEach(function (animation) {
|
|
13900
13868
|
animation.cancel();
|
|
13901
13869
|
});
|
|
13870
|
+
this.renderable = null;
|
|
13871
|
+
this.cullable = null;
|
|
13872
|
+
this.transformable = null;
|
|
13873
|
+
this.rBushNode = null;
|
|
13874
|
+
this.geometry = null;
|
|
13875
|
+
this.sortable = null;
|
|
13902
13876
|
};
|
|
13903
13877
|
_proto.cloneNode = function cloneNode(deep, customCloneFunc) {
|
|
13904
13878
|
var clonedStyle = _extends({}, this.attributes);
|
|
@@ -13945,7 +13919,9 @@
|
|
|
13945
13919
|
// account for FCP, process properties as less as possible
|
|
13946
13920
|
runtime.styleValueRegistry.processProperties(this, attributes, {
|
|
13947
13921
|
forceUpdateGeometry: true,
|
|
13948
|
-
usedAttributes:
|
|
13922
|
+
usedAttributes:
|
|
13923
|
+
// only Group / Text should account for text relative props
|
|
13924
|
+
this.tagName === exports.Shape.GROUP || this.tagName === exports.Shape.TEXT ? INHERITABLE_STYLE_PROPS : INHERITABLE_BASE_STYLE_PROPS
|
|
13949
13925
|
});
|
|
13950
13926
|
// redraw at next frame
|
|
13951
13927
|
renderable.dirty = true;
|
|
@@ -18422,12 +18398,7 @@
|
|
|
18422
18398
|
}];
|
|
18423
18399
|
var propertyMetadataCache = {};
|
|
18424
18400
|
var unresolvedProperties = new WeakMap();
|
|
18425
|
-
|
|
18426
|
-
var sortAttributeNames = memoize(function (attributeNames) {
|
|
18427
|
-
return attributeNames.sort(function (a, b) {
|
|
18428
|
-
return priorityMap[a] - priorityMap[b];
|
|
18429
|
-
});
|
|
18430
|
-
});
|
|
18401
|
+
// const uniqueAttributeSet = new Set<string>();
|
|
18431
18402
|
var tmpVec3a = create$2();
|
|
18432
18403
|
var tmpVec3b = create$2();
|
|
18433
18404
|
var tmpVec3c = create$2();
|
|
@@ -18453,7 +18424,6 @@
|
|
|
18453
18424
|
_proto.registerMetadata = function registerMetadata(metadata) {
|
|
18454
18425
|
[metadata.n].concat(metadata.a || []).forEach(function (name) {
|
|
18455
18426
|
propertyMetadataCache[name] = metadata;
|
|
18456
|
-
priorityMap[name] = metadata.p || 0;
|
|
18457
18427
|
});
|
|
18458
18428
|
};
|
|
18459
18429
|
_proto.unregisterMetadata = function unregisterMetadata(name) {
|
|
@@ -18505,8 +18475,24 @@
|
|
|
18505
18475
|
}
|
|
18506
18476
|
// let hasUnresolvedProperties = false;
|
|
18507
18477
|
// parse according to priority
|
|
18508
|
-
|
|
18509
|
-
//
|
|
18478
|
+
// path 50
|
|
18479
|
+
// points 50
|
|
18480
|
+
// text 50
|
|
18481
|
+
// textTransform 51
|
|
18482
|
+
// anchor 99
|
|
18483
|
+
// transform 100
|
|
18484
|
+
// transformOrigin 100
|
|
18485
|
+
if (usedAttributes === null || usedAttributes === void 0 ? void 0 : usedAttributes.length) {
|
|
18486
|
+
// uniqueAttributeSet.clear();
|
|
18487
|
+
attributeNames = Array.from(new Set(attributeNames.concat(usedAttributes)));
|
|
18488
|
+
}
|
|
18489
|
+
['path', 'points', 'text', 'textTransform', 'anchor', 'transform', 'transformOrigin'].forEach(function (name) {
|
|
18490
|
+
var index = attributeNames.indexOf(name);
|
|
18491
|
+
if (index > -1) {
|
|
18492
|
+
attributeNames.splice(index, 1);
|
|
18493
|
+
attributeNames.push(name);
|
|
18494
|
+
}
|
|
18495
|
+
});
|
|
18510
18496
|
attributeNames.forEach(function (name) {
|
|
18511
18497
|
// some style props maybe deleted after parsing such as `anchor` in Text
|
|
18512
18498
|
if (name in object.computedStyle) {
|
|
@@ -18596,7 +18582,7 @@
|
|
|
18596
18582
|
if (value === 'initial') {
|
|
18597
18583
|
// @see https://developer.mozilla.org/en-US/docs/Web/CSS/initial
|
|
18598
18584
|
if (!isNil(defaultValue)) {
|
|
18599
|
-
computed = this.parseProperty(name, isFunction
|
|
18585
|
+
computed = this.parseProperty(name, isFunction(defaultValue) ? defaultValue(object.nodeName) : defaultValue, object);
|
|
18600
18586
|
}
|
|
18601
18587
|
} else if (value === 'inherit') {
|
|
18602
18588
|
// @see https://developer.mozilla.org/en-US/docs/Web/CSS/inherit
|
|
@@ -20183,6 +20169,12 @@
|
|
|
20183
20169
|
this.addEventMapping('pointerupoutside', this.onPointerUpOutside);
|
|
20184
20170
|
this.addEventMapping('wheel', this.onWheel);
|
|
20185
20171
|
};
|
|
20172
|
+
_proto.destroy = function destroy() {
|
|
20173
|
+
this.emitter.removeAllListeners();
|
|
20174
|
+
this.mappingTable = {};
|
|
20175
|
+
this.mappingState = {};
|
|
20176
|
+
this.eventPool.clear();
|
|
20177
|
+
};
|
|
20186
20178
|
_proto.client2Viewport = function client2Viewport(client) {
|
|
20187
20179
|
var bbox = this.context.contextService.getBoundingClientRect();
|
|
20188
20180
|
return new Point(client.x - ((bbox === null || bbox === void 0 ? void 0 : bbox.left) || 0), client.y - ((bbox === null || bbox === void 0 ? void 0 : bbox.top) || 0));
|
|
@@ -21022,9 +21014,7 @@
|
|
|
21022
21014
|
return root !== node && node.nodeName === query;
|
|
21023
21015
|
});
|
|
21024
21016
|
}
|
|
21025
|
-
}
|
|
21026
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
21027
|
-
;
|
|
21017
|
+
};
|
|
21028
21018
|
_proto.is = function is(query, node) {
|
|
21029
21019
|
// a simple `matches` implementation
|
|
21030
21020
|
if (query.startsWith('.')) {
|
|
@@ -21972,8 +21962,7 @@
|
|
|
21972
21962
|
// account for textPath
|
|
21973
21963
|
if (textPath) {
|
|
21974
21964
|
var totalPathLength = textPath.getTotalLength();
|
|
21975
|
-
//
|
|
21976
|
-
var startingPoint = textPath.getPoint(0);
|
|
21965
|
+
// const startingPoint = textPath.getPoint(0);
|
|
21977
21966
|
for (var i = 0; i < lines.length; i++) {
|
|
21978
21967
|
var width = context.measureText(lines[i]).width + (lines[i].length - 1) * letterSpacing;
|
|
21979
21968
|
// for (
|
|
@@ -22184,6 +22173,7 @@
|
|
|
22184
22173
|
return TextService;
|
|
22185
22174
|
}();
|
|
22186
22175
|
|
|
22176
|
+
var _this = undefined;
|
|
22187
22177
|
var runtime = {};
|
|
22188
22178
|
/**
|
|
22189
22179
|
* Replace with IoC container
|
|
@@ -22200,6 +22190,15 @@
|
|
|
22200
22190
|
var length = new CSSPropertyLengthOrPercentage();
|
|
22201
22191
|
return _ref2 = {}, _ref2[exports.PropertySyntax.PERCENTAGE] = null, _ref2[exports.PropertySyntax.NUMBER] = new CSSPropertyNumber(), _ref2[exports.PropertySyntax.ANGLE] = new CSSPropertyAngle(), _ref2[exports.PropertySyntax.DEFINED_PATH] = new CSSPropertyClipPath(), _ref2[exports.PropertySyntax.PAINT] = color, _ref2[exports.PropertySyntax.COLOR] = color, _ref2[exports.PropertySyntax.FILTER] = new CSSPropertyFilter(), _ref2[exports.PropertySyntax.LENGTH] = length, _ref2[exports.PropertySyntax.LENGTH_PERCENTAGE] = length, _ref2[exports.PropertySyntax.LENGTH_PERCENTAGE_12] = new CSSPropertyLengthOrPercentage12(), _ref2[exports.PropertySyntax.LENGTH_PERCENTAGE_14] = new CSSPropertyLengthOrPercentage14(), _ref2[exports.PropertySyntax.COORDINATE] = new CSSPropertyLocalPosition(), _ref2[exports.PropertySyntax.OFFSET_DISTANCE] = new CSSPropertyOffsetDistance(), _ref2[exports.PropertySyntax.OPACITY_VALUE] = new CSSPropertyOpacity(), _ref2[exports.PropertySyntax.PATH] = new CSSPropertyPath(), _ref2[exports.PropertySyntax.LIST_OF_POINTS] = new CSSPropertyPoints(), _ref2[exports.PropertySyntax.SHADOW_BLUR] = new CSSPropertyShadowBlur(), _ref2[exports.PropertySyntax.TEXT] = new CSSPropertyText(), _ref2[exports.PropertySyntax.TEXT_TRANSFORM] = new CSSPropertyTextTransform(), _ref2[exports.PropertySyntax.TRANSFORM] = new CSSPropertyTransform(), _ref2[exports.PropertySyntax.TRANSFORM_ORIGIN] = new CSSPropertyTransformOrigin(), _ref2[exports.PropertySyntax.Z_INDEX] = new CSSPropertyZIndex(), _ref2[exports.PropertySyntax.MARKER] = new CSSPropertyMarker(), _ref2;
|
|
22202
22192
|
}();
|
|
22193
|
+
var getGlobalThis = function getGlobalThis() {
|
|
22194
|
+
if (typeof globalThis !== 'undefined') return globalThis;
|
|
22195
|
+
if (typeof self !== 'undefined') return self;
|
|
22196
|
+
if (typeof window !== 'undefined') return window;
|
|
22197
|
+
// @ts-ignore
|
|
22198
|
+
if (typeof global !== 'undefined') return global;
|
|
22199
|
+
if (typeof _this !== 'undefined') return _this;
|
|
22200
|
+
throw new Error('Unable to locate global `this`');
|
|
22201
|
+
};
|
|
22203
22202
|
/**
|
|
22204
22203
|
* Camera
|
|
22205
22204
|
* `g-camera-api` will provide an advanced implementation
|
|
@@ -22219,6 +22218,7 @@
|
|
|
22219
22218
|
runtime.CSSPropertySyntaxFactory = CSSPropertySyntaxFactory;
|
|
22220
22219
|
runtime.styleValueRegistry = new DefaultStyleValueRegistry();
|
|
22221
22220
|
runtime.layoutRegistry = null;
|
|
22221
|
+
runtime.globalThis = getGlobalThis();
|
|
22222
22222
|
|
|
22223
22223
|
var AbstractRendererPlugin = /*#__PURE__*/function () {
|
|
22224
22224
|
function AbstractRendererPlugin() {
|
|
@@ -22990,20 +22990,20 @@
|
|
|
22990
22990
|
* implements `Window` interface
|
|
22991
22991
|
*/
|
|
22992
22992
|
_this.devicePixelRatio = dpr;
|
|
22993
|
-
_this.requestAnimationFrame = requestAnimationFrame !== null && requestAnimationFrame !== void 0 ? requestAnimationFrame : raf.bind(globalThis);
|
|
22994
|
-
_this.cancelAnimationFrame = cancelAnimationFrame !== null && cancelAnimationFrame !== void 0 ? cancelAnimationFrame : caf.bind(globalThis);
|
|
22993
|
+
_this.requestAnimationFrame = requestAnimationFrame !== null && requestAnimationFrame !== void 0 ? requestAnimationFrame : raf.bind(runtime.globalThis);
|
|
22994
|
+
_this.cancelAnimationFrame = cancelAnimationFrame !== null && cancelAnimationFrame !== void 0 ? cancelAnimationFrame : caf.bind(runtime.globalThis);
|
|
22995
22995
|
/**
|
|
22996
22996
|
* limits query
|
|
22997
22997
|
*/
|
|
22998
22998
|
// the following feature-detect from hammer.js
|
|
22999
22999
|
// @see https://github.com/hammerjs/hammer.js/blob/master/src/inputjs/input-consts.js#L5
|
|
23000
|
-
_this.supportsTouchEvents = supportsTouchEvents !== null && supportsTouchEvents !== void 0 ? supportsTouchEvents : 'ontouchstart' in globalThis;
|
|
23001
|
-
_this.supportsPointerEvents = supportsPointerEvents !== null && supportsPointerEvents !== void 0 ? supportsPointerEvents : !!globalThis.PointerEvent;
|
|
23000
|
+
_this.supportsTouchEvents = supportsTouchEvents !== null && supportsTouchEvents !== void 0 ? supportsTouchEvents : 'ontouchstart' in runtime.globalThis;
|
|
23001
|
+
_this.supportsPointerEvents = supportsPointerEvents !== null && supportsPointerEvents !== void 0 ? supportsPointerEvents : !!runtime.globalThis.PointerEvent;
|
|
23002
23002
|
_this.isTouchEvent = isTouchEvent !== null && isTouchEvent !== void 0 ? isTouchEvent : function (event) {
|
|
23003
|
-
return _this.supportsTouchEvents && event instanceof globalThis.TouchEvent;
|
|
23003
|
+
return _this.supportsTouchEvents && event instanceof runtime.globalThis.TouchEvent;
|
|
23004
23004
|
};
|
|
23005
23005
|
_this.isMouseEvent = isMouseEvent !== null && isMouseEvent !== void 0 ? isMouseEvent : function (event) {
|
|
23006
|
-
return !globalThis.MouseEvent || event instanceof globalThis.MouseEvent && (!_this.supportsPointerEvents || !(event instanceof globalThis.PointerEvent));
|
|
23006
|
+
return !runtime.globalThis.MouseEvent || event instanceof runtime.globalThis.MouseEvent && (!_this.supportsPointerEvents || !(event instanceof runtime.globalThis.PointerEvent));
|
|
23007
23007
|
};
|
|
23008
23008
|
_this.initRenderingContext({
|
|
23009
23009
|
container: container,
|
|
@@ -23136,6 +23136,11 @@
|
|
|
23136
23136
|
// destroy services
|
|
23137
23137
|
this.getRenderingService().destroy();
|
|
23138
23138
|
this.getContextService().destroy();
|
|
23139
|
+
this.getEventService().destroy();
|
|
23140
|
+
// clear rbush
|
|
23141
|
+
this.context.rBushRoot.clear();
|
|
23142
|
+
this.context.rBushRoot = null;
|
|
23143
|
+
this.context.renderingContext.root = null;
|
|
23139
23144
|
if (!skipTriggerEvent) {
|
|
23140
23145
|
this.dispatchEvent(new CustomEvent(exports.CanvasEvent.AFTER_DESTROY));
|
|
23141
23146
|
}
|