@antv/g 5.6.0 → 5.6.3

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/index.esm.js CHANGED
@@ -9077,6 +9077,10 @@ function mergeTransforms(left, right, target) {
9077
9077
 
9078
9078
  function parseTransformOrigin(value) {
9079
9079
  if (isString(value)) {
9080
+ if (value === 'text-anchor') {
9081
+ return [new CSSUnitValue(0, 'px'), new CSSUnitValue(0, 'px')];
9082
+ }
9083
+
9080
9084
  var values = value.split(' ');
9081
9085
 
9082
9086
  if (values.length === 1) {
@@ -10632,7 +10636,8 @@ var DEFAULT_STYLE_PROPS = {
10632
10636
  textBaseline: '',
10633
10637
  textTransform: '',
10634
10638
  zIndex: '',
10635
- filter: ''
10639
+ filter: '',
10640
+ shadowType: ''
10636
10641
  };
10637
10642
  /**
10638
10643
  * prototype chains: DisplayObject -> Element -> Node -> EventTarget
@@ -11722,7 +11727,7 @@ var Path = /*#__PURE__*/function (_DisplayObject) {
11722
11727
  type: Shape.PATH,
11723
11728
  style: _extends({
11724
11729
  path: '',
11725
- miterLimit: 4
11730
+ miterLimit: ''
11726
11731
  }, style)
11727
11732
  }, rest)) || this;
11728
11733
  }
@@ -11823,7 +11828,7 @@ var Polygon = /*#__PURE__*/function (_DisplayObject) {
11823
11828
  type: Shape.POLYGON,
11824
11829
  style: _extends({
11825
11830
  points: '',
11826
- miterLimit: 4
11831
+ miterLimit: ''
11827
11832
  }, style)
11828
11833
  }, rest)) || this;
11829
11834
  }
@@ -11844,7 +11849,7 @@ var Polyline = /*#__PURE__*/function (_DisplayObject) {
11844
11849
  type: Shape.POLYLINE,
11845
11850
  style: _extends({
11846
11851
  points: '',
11847
- miterLimit: 4
11852
+ miterLimit: ''
11848
11853
  }, style)
11849
11854
  }, rest)) || this;
11850
11855
  }
@@ -11935,14 +11940,15 @@ var Text = /*#__PURE__*/function (_DisplayObject) {
11935
11940
  /**
11936
11941
  * @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement#constants
11937
11942
  */
11943
+ // LENGTHADJUST_SPACING: number = 1;
11944
+ // LENGTHADJUST_SPACINGANDGLYPHS: number = 2;
11945
+ // LENGTHADJUST_UNKNOWN: number = 0;
11938
11946
  function Text(_temp) {
11939
- var _this;
11940
-
11941
11947
  var _ref = _temp === void 0 ? {} : _temp,
11942
11948
  style = _ref.style,
11943
11949
  rest = _objectWithoutPropertiesLoose(_ref, _excluded$a);
11944
11950
 
11945
- _this = _DisplayObject.call(this, _extends({
11951
+ return _DisplayObject.call(this, _extends({
11946
11952
  type: Shape.TEXT,
11947
11953
  style: _extends({
11948
11954
  x: '',
@@ -11956,17 +11962,10 @@ var Text = /*#__PURE__*/function (_DisplayObject) {
11956
11962
  textAlign: '',
11957
11963
  textBaseline: '',
11958
11964
  textTransform: '',
11959
- // dropShadow: false,
11960
- // dropShadowAlpha: 1,
11961
- // dropShadowAngle: Math.PI / 6,
11962
- // dropShadowBlur: 0,
11963
- // dropShadowColor: '#000',
11964
- // dropShadowDistance: 5,
11965
11965
  fill: 'black',
11966
- // stroke: 'black',
11967
- letterSpacing: 0,
11968
- lineHeight: 0,
11969
- miterLimit: 10,
11966
+ letterSpacing: '',
11967
+ lineHeight: '',
11968
+ miterLimit: '',
11970
11969
  whiteSpace: 'pre',
11971
11970
  wordWrap: false,
11972
11971
  wordWrapWidth: 0,
@@ -11975,57 +11974,45 @@ var Text = /*#__PURE__*/function (_DisplayObject) {
11975
11974
  dy: ''
11976
11975
  }, style)
11977
11976
  }, rest)) || this;
11978
- _this.LENGTHADJUST_SPACING = 1;
11979
- _this.LENGTHADJUST_SPACINGANDGLYPHS = 2;
11980
- _this.LENGTHADJUST_UNKNOWN = 0;
11981
- _this.lengthAdjust = void 0;
11982
- _this.textLength = void 0;
11983
- return _this;
11984
- }
11985
-
11986
- var _proto = Text.prototype;
11977
+ } // lengthAdjust: SVGAnimatedEnumeration;
11978
+ // textLength: SVGAnimatedLength;
11979
+ // getCharNumAtPosition(point?: DOMPointInit): number {
11980
+ // throw new Error('Method not implemented.');
11981
+ // }
11987
11982
 
11988
- _proto.getCharNumAtPosition = function getCharNumAtPosition(point) {
11989
- throw new Error('Method not implemented.');
11990
- }
11991
11983
  /**
11992
11984
  * @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement
11993
11985
  */
11994
- ;
11986
+
11987
+
11988
+ var _proto = Text.prototype;
11995
11989
 
11996
11990
  _proto.getComputedTextLength = function getComputedTextLength() {
11997
11991
  var _this$parsedStyle$met;
11998
11992
 
11999
11993
  return ((_this$parsedStyle$met = this.parsedStyle.metrics) === null || _this$parsedStyle$met === void 0 ? void 0 : _this$parsedStyle$met.maxLineWidth) || 0;
12000
- };
12001
-
12002
- _proto.getEndPositionOfChar = function getEndPositionOfChar(charnum) {
12003
- throw new Error('Method not implemented.');
12004
- };
12005
-
12006
- _proto.getExtentOfChar = function getExtentOfChar(charnum) {
12007
- throw new Error('Method not implemented.');
12008
- };
12009
-
12010
- _proto.getNumberOfChars = function getNumberOfChars() {
12011
- throw new Error('Method not implemented.');
12012
- };
12013
-
12014
- _proto.getRotationOfChar = function getRotationOfChar(charnum) {
12015
- throw new Error('Method not implemented.');
12016
- };
12017
-
12018
- _proto.getStartPositionOfChar = function getStartPositionOfChar(charnum) {
12019
- throw new Error('Method not implemented.');
12020
- };
12021
-
12022
- _proto.getSubStringLength = function getSubStringLength(charnum, nchars) {
12023
- throw new Error('Method not implemented.');
12024
- };
12025
-
12026
- _proto.selectSubString = function selectSubString(charnum, nchars) {
12027
- throw new Error('Method not implemented.');
12028
- };
11994
+ } // getEndPositionOfChar(charnum: number): DOMPoint {
11995
+ // throw new Error('Method not implemented.');
11996
+ // }
11997
+ // getExtentOfChar(charnum: number): DOMRect {
11998
+ // throw new Error('Method not implemented.');
11999
+ // }
12000
+ // getNumberOfChars(): number {
12001
+ // throw new Error('Method not implemented.');
12002
+ // }
12003
+ // getRotationOfChar(charnum: number): number {
12004
+ // throw new Error('Method not implemented.');
12005
+ // }
12006
+ // getStartPositionOfChar(charnum: number): DOMPoint {
12007
+ // throw new Error('Method not implemented.');
12008
+ // }
12009
+ // getSubStringLength(charnum: number, nchars: number): number {
12010
+ // throw new Error('Method not implemented.');
12011
+ // }
12012
+ // selectSubString(charnum: number, nchars: number): void {
12013
+ // throw new Error('Method not implemented.');
12014
+ // }
12015
+ ;
12029
12016
 
12030
12017
  _proto.getLineBoundingRects = function getLineBoundingRects() {
12031
12018
  var _this$parsedStyle$met2;
@@ -12967,7 +12954,9 @@ var Document = /*#__PURE__*/function (_Node) {
12967
12954
  clazz = tagName === 'tspan' ? Text : Group;
12968
12955
  }
12969
12956
 
12970
- return new clazz(options);
12957
+ var shape = new clazz(options);
12958
+ shape.ownerDocument = this;
12959
+ return shape;
12971
12960
  };
12972
12961
 
12973
12962
  _proto.createElementNS = function createElementNS(namespaceURI, tagName, options) {
@@ -13274,6 +13263,16 @@ var FederatedMouseEvent = /*#__PURE__*/function (_FederatedEvent) {
13274
13263
  get: function get() {
13275
13264
  return this.client.y;
13276
13265
  }
13266
+ }, {
13267
+ key: "x",
13268
+ get: function get() {
13269
+ return this.clientX;
13270
+ }
13271
+ }, {
13272
+ key: "y",
13273
+ get: function get() {
13274
+ return this.clientY;
13275
+ }
13277
13276
  /**
13278
13277
  * The movement in this pointer relative to the last `mousemove` event.
13279
13278
  */
@@ -16632,20 +16631,15 @@ var RenderingService = /*#__PURE__*/function () {
16632
16631
 
16633
16632
  if (this.renderingContext.renderReasons.size && this.inited) {
16634
16633
  this.renderDisplayObject(this.renderingContext.root, canvasConfig);
16634
+ this.hooks.beginFrame.call();
16635
+ this.renderingContext.renderListCurrentFrame.forEach(function (object) {
16636
+ _this2.hooks.beforeRender.call(object);
16635
16637
 
16636
- if (this.renderingContext.renderListCurrentFrame.length || this.renderingContext.renderListLastFrame.length !== this.renderingContext.renderListCurrentFrame.length) {
16637
- this.hooks.beginFrame.call();
16638
- this.renderingContext.renderListCurrentFrame.forEach(function (object) {
16639
- _this2.hooks.beforeRender.call(object);
16640
-
16641
- _this2.hooks.render.call(object);
16638
+ _this2.hooks.render.call(object);
16642
16639
 
16643
- _this2.hooks.afterRender.call(object);
16644
- });
16645
- this.hooks.endFrame.call();
16646
- }
16647
-
16648
- this.renderingContext.renderListLastFrame = [].concat(this.renderingContext.renderListCurrentFrame);
16640
+ _this2.hooks.afterRender.call(object);
16641
+ });
16642
+ this.hooks.endFrame.call();
16649
16643
  this.renderingContext.renderListCurrentFrame = [];
16650
16644
  this.renderingContext.renderReasons.clear();
16651
16645
  } // console.log('stats', this.stats);
@@ -16806,7 +16800,7 @@ var EventService = /*#__PURE__*/function (_EventEmitter) {
16806
16800
 
16807
16801
  _this.onPointerUp = /*#__PURE__*/function () {
16808
16802
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(from) {
16809
- var now, e, isRightButton, trackingData, pressTarget, clickTarget, currentTarget, _isRightButton, clickEvent, clickHistory;
16803
+ var now, e, isRightButton, trackingData, pressTarget, clickTarget, currentTarget, _isRightButton, _e$detail, clickEvent, clickHistory;
16810
16804
 
16811
16805
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
16812
16806
  while (1) {
@@ -16892,12 +16886,14 @@ var EventService = /*#__PURE__*/function (_EventEmitter) {
16892
16886
 
16893
16887
  clickHistory.target = clickEvent.target;
16894
16888
  clickHistory.timeStamp = now;
16895
- clickEvent.detail = clickHistory.clickCount;
16889
+ clickEvent.detail = clickHistory.clickCount; // @see https://github.com/antvis/G/issues/1091
16896
16890
 
16897
- if (clickEvent.pointerType === 'mouse' || clickEvent.pointerType === 'touch') {
16898
- _this.dispatchEvent(clickEvent, 'click');
16899
- } else {
16900
- _this.dispatchEvent(clickEvent, 'pointertap');
16891
+ if (!((_e$detail = e.detail) === null || _e$detail === void 0 ? void 0 : _e$detail.preventClick)) {
16892
+ if (clickEvent.pointerType === 'mouse' || clickEvent.pointerType === 'touch') {
16893
+ _this.dispatchEvent(clickEvent, 'click');
16894
+ } else {
16895
+ _this.dispatchEvent(clickEvent, 'pointertap');
16896
+ }
16901
16897
  }
16902
16898
 
16903
16899
  _this.freeEvent(clickEvent);
@@ -18141,13 +18137,11 @@ var TextService = /*#__PURE__*/function () {
18141
18137
  _proto.measureText = function measureText(text, parsedStyle, offscreenCanvas) {
18142
18138
  var fontSize = parsedStyle.fontSize,
18143
18139
  wordWrap = parsedStyle.wordWrap,
18144
- _parsedStyle$lineHeig = parsedStyle.lineHeight,
18145
- strokeHeight = _parsedStyle$lineHeig === void 0 ? 0 : _parsedStyle$lineHeig,
18140
+ strokeHeight = parsedStyle.lineHeight,
18146
18141
  lineWidth = parsedStyle.lineWidth,
18147
18142
  textBaseline = parsedStyle.textBaseline,
18148
18143
  textAlign = parsedStyle.textAlign,
18149
- _parsedStyle$letterSp = parsedStyle.letterSpacing,
18150
- letterSpacing = _parsedStyle$letterSp === void 0 ? 0 : _parsedStyle$letterSp,
18144
+ letterSpacing = parsedStyle.letterSpacing,
18151
18145
  _parsedStyle$leading = parsedStyle.leading,
18152
18146
  leading = _parsedStyle$leading === void 0 ? 0 : _parsedStyle$leading;
18153
18147
  var font = toFontString(parsedStyle);
@@ -18167,7 +18161,7 @@ var TextService = /*#__PURE__*/function () {
18167
18161
  var maxLineWidth = 0;
18168
18162
 
18169
18163
  for (var i = 0; i < lines.length; i++) {
18170
- var _lineWidth = context.measureText(lines[i]).width + (lines[i].length - 1) * letterSpacing;
18164
+ var _lineWidth = context.measureText(lines[i]).width + (lines[i].length - 1) * letterSpacing.value;
18171
18165
 
18172
18166
  lineWidths[i] = _lineWidth;
18173
18167
  maxLineWidth = Math.max(maxLineWidth, _lineWidth);
@@ -18177,7 +18171,7 @@ var TextService = /*#__PURE__*/function () {
18177
18171
  // width += dropShadowDistance;
18178
18172
  // }
18179
18173
 
18180
- var lineHeight = strokeHeight || fontProperties.fontSize + lineWidth.value;
18174
+ var lineHeight = strokeHeight.value || fontProperties.fontSize + lineWidth.value;
18181
18175
  var height = Math.max(lineHeight, fontProperties.fontSize + lineWidth.value) + (lines.length - 1) * (lineHeight + leading); // if (dropShadow) {
18182
18176
  // height += dropShadowDistance;
18183
18177
  // }
@@ -18222,17 +18216,16 @@ var TextService = /*#__PURE__*/function () {
18222
18216
 
18223
18217
  var _ref$wordWrapWidth = _ref.wordWrapWidth,
18224
18218
  wordWrapWidth = _ref$wordWrapWidth === void 0 ? 0 : _ref$wordWrapWidth,
18225
- _ref$letterSpacing = _ref.letterSpacing,
18226
- letterSpacing = _ref$letterSpacing === void 0 ? 0 : _ref$letterSpacing;
18219
+ letterSpacing = _ref.letterSpacing;
18227
18220
  var context = this.offscreenCanvas.getOrCreateContext(offscreenCanvas);
18228
- var maxWidth = wordWrapWidth + letterSpacing;
18221
+ var maxWidth = wordWrapWidth + letterSpacing.value;
18229
18222
  var lines = [];
18230
18223
  var currentIndex = 0;
18231
18224
  var currentWidth = 0;
18232
18225
  var cache = {};
18233
18226
 
18234
18227
  var calcWidth = function calcWidth(char) {
18235
- return _this2.getFromCache(char, letterSpacing, cache, context);
18228
+ return _this2.getFromCache(char, letterSpacing.value, cache, context);
18236
18229
  };
18237
18230
 
18238
18231
  Array.from(text).forEach(function (char, i) {
@@ -18817,7 +18810,7 @@ function getFontSize(object) {
18817
18810
  return fontSize.clone();
18818
18811
  }
18819
18812
 
18820
- return new CSSUnitValue(0, 'px');
18813
+ return null;
18821
18814
  }
18822
18815
  /**
18823
18816
  * <length> & <percentage>
@@ -18845,8 +18838,13 @@ var CSSPropertyLengthOrPercentage = /*#__PURE__*/function () {
18845
18838
  } else if (computed.unit === UnitType.kEms) {
18846
18839
  if (object.parentNode) {
18847
18840
  var fontSize = getFontSize(object.parentNode);
18848
- fontSize.value *= computed.value;
18849
- return fontSize;
18841
+
18842
+ if (fontSize) {
18843
+ fontSize.value *= computed.value;
18844
+ return fontSize;
18845
+ } else {
18846
+ registry.addUnresolveProperty(object, name);
18847
+ }
18850
18848
  }
18851
18849
 
18852
18850
  return new CSSUnitValue(0, 'px');
@@ -18856,8 +18854,12 @@ var CSSPropertyLengthOrPercentage = /*#__PURE__*/function () {
18856
18854
  if (object === null || object === void 0 ? void 0 : (_object$ownerDocument = object.ownerDocument) === null || _object$ownerDocument === void 0 ? void 0 : _object$ownerDocument.documentElement) {
18857
18855
  var _fontSize = getFontSize(object.ownerDocument.documentElement);
18858
18856
 
18859
- _fontSize.value *= computed.value;
18860
- return _fontSize;
18857
+ if (_fontSize) {
18858
+ _fontSize.value *= computed.value;
18859
+ return _fontSize;
18860
+ } else {
18861
+ registry.addUnresolveProperty(object, name);
18862
+ }
18861
18863
  }
18862
18864
 
18863
18865
  return new CSSUnitValue(0, 'px');
@@ -19016,7 +19018,11 @@ var CSSPropertyLocalPosition = /*#__PURE__*/function (_CSSPropertyLengthOrP) {
19016
19018
  z = 0;
19017
19019
  break;
19018
19020
 
19019
- default:
19021
+ case Shape.RECT:
19022
+ case Shape.IMAGE:
19023
+ case Shape.GROUP:
19024
+ case Shape.HTML:
19025
+ case Shape.TEXT:
19020
19026
  if (!isNil(object.parsedStyle.x)) {
19021
19027
  x = object.parsedStyle.x.value;
19022
19028
  }
@@ -19028,15 +19034,21 @@ var CSSPropertyLocalPosition = /*#__PURE__*/function (_CSSPropertyLengthOrP) {
19028
19034
  break;
19029
19035
  }
19030
19036
 
19031
- object.parsedStyle.defX = x || 0;
19032
- object.parsedStyle.defY = y || 0;
19037
+ if (object.nodeName !== Shape.PATH && object.nodeName !== Shape.POLYLINE && object.nodeName !== Shape.POLYGON) {
19038
+ object.parsedStyle.defX = x || 0;
19039
+ object.parsedStyle.defY = y || 0;
19040
+ }
19041
+
19042
+ var needResetLocalPosition = !isNil(x) || !isNil(y) || !isNil(z);
19033
19043
 
19034
- var _object$getLocalPosit = object.getLocalPosition(),
19035
- ox = _object$getLocalPosit[0],
19036
- oy = _object$getLocalPosit[1],
19037
- oz = _object$getLocalPosit[2];
19044
+ if (needResetLocalPosition) {
19045
+ var _object$getLocalPosit = object.getLocalPosition(),
19046
+ ox = _object$getLocalPosit[0],
19047
+ oy = _object$getLocalPosit[1],
19048
+ oz = _object$getLocalPosit[2];
19038
19049
 
19039
- object.setLocalPosition(isNil(x) ? ox : x, isNil(y) ? oy : y, isNil(z) ? oz : z);
19050
+ object.setLocalPosition(isNil(x) ? ox : x, isNil(y) ? oy : y, isNil(z) ? oz : z);
19051
+ }
19040
19052
  };
19041
19053
 
19042
19054
  return CSSPropertyLocalPosition;
@@ -19603,6 +19615,11 @@ var BUILT_IN_PROPERTIES = [{
19603
19615
  keywords: ['none'],
19604
19616
  defaultValue: 'none',
19605
19617
  syntax: PropertySyntax.PAINT
19618
+ }, {
19619
+ name: 'shadowType',
19620
+ keywords: ['inner', 'outer', 'both'],
19621
+ defaultValue: 'outer',
19622
+ layoutDependent: true
19606
19623
  }, {
19607
19624
  name: 'shadowColor',
19608
19625
  interpolable: true,
@@ -19739,6 +19756,10 @@ var BUILT_IN_PROPERTIES = [{
19739
19756
  return 'center';
19740
19757
  }
19741
19758
 
19759
+ if (nodeName === Shape.TEXT) {
19760
+ return 'text-anchor';
19761
+ }
19762
+
19742
19763
  return 'left top';
19743
19764
  },
19744
19765
  layoutDependent: true,
@@ -19869,12 +19890,14 @@ var BUILT_IN_PROPERTIES = [{
19869
19890
  layoutDependent: true,
19870
19891
  defaultValue: '',
19871
19892
  alias: ['d'],
19872
- syntax: PropertySyntax.PATH
19893
+ syntax: PropertySyntax.PATH,
19894
+ parsePriority: 50
19873
19895
  }, // Polyline & Polygon
19874
19896
  {
19875
19897
  name: 'points',
19876
19898
  layoutDependent: true,
19877
- syntax: PropertySyntax.LIST_OF_POINTS
19899
+ syntax: PropertySyntax.LIST_OF_POINTS,
19900
+ parsePriority: 50
19878
19901
  }, // Text
19879
19902
  {
19880
19903
  name: 'text',
@@ -19930,16 +19953,27 @@ var BUILT_IN_PROPERTIES = [{
19930
19953
  defaultValue: 'normal'
19931
19954
  }, {
19932
19955
  name: 'lineHeight',
19933
- layoutDependent: true // interpolable: true,
19934
- // inherited: true,
19935
- // defaultValue: '-100%'
19936
-
19956
+ layoutDependent: true,
19957
+ syntax: PropertySyntax.LENGTH,
19958
+ interpolable: true,
19959
+ defaultValue: '0'
19937
19960
  }, {
19938
19961
  name: 'letterSpacing',
19939
- layoutDependent: true // interpolable: true,
19940
- // inherited: true,
19941
- // defaultValue: '0',
19962
+ layoutDependent: true,
19963
+ syntax: PropertySyntax.LENGTH,
19964
+ interpolable: true,
19965
+ defaultValue: '0'
19966
+ }, {
19967
+ name: 'miterLimit',
19968
+ layoutDependent: true,
19969
+ syntax: PropertySyntax.NUMBER,
19970
+ defaultValue: function defaultValue(nodeName) {
19971
+ if (nodeName === Shape.PATH || nodeName === Shape.POLYGON || nodeName === Shape.POLYLINE) {
19972
+ return '4';
19973
+ }
19942
19974
 
19975
+ return '10';
19976
+ }
19943
19977
  }, {
19944
19978
  name: 'wordWrap',
19945
19979
  layoutDependent: true
@@ -20335,6 +20369,7 @@ var DefaultStyleValueRegistry = /*#__PURE__*/function () {
20335
20369
  var stroke = parsedStyle.stroke,
20336
20370
  lineWidth = parsedStyle.lineWidth,
20337
20371
  increasedLineWidthForHitTesting = parsedStyle.increasedLineWidthForHitTesting,
20372
+ shadowType = parsedStyle.shadowType,
20338
20373
  shadowColor = parsedStyle.shadowColor,
20339
20374
  _parsedStyle$filter = parsedStyle.filter,
20340
20375
  filter = _parsedStyle$filter === void 0 ? [] : _parsedStyle$filter,
@@ -20366,7 +20401,7 @@ var DefaultStyleValueRegistry = /*#__PURE__*/function () {
20366
20401
 
20367
20402
  geometry.renderBounds.update(center, halfExtents); // account for shadow, only support constant value now
20368
20403
 
20369
- if (shadowColor) {
20404
+ if (shadowColor && (shadowType === null || shadowType === void 0 ? void 0 : shadowType.value) !== 'inner') {
20370
20405
  var _geometry$renderBound = geometry.renderBounds,
20371
20406
  min = _geometry$renderBound.min,
20372
20407
  max = _geometry$renderBound.max;
@@ -20729,9 +20764,8 @@ var CullingPlugin = CullingPlugin_1 = (_class$1 = /*#__PURE__*/function () {
20729
20764
  if (!cullable.isCulled() && object.isVisible()) {
20730
20765
  return object;
20731
20766
  } else {
20732
- if (_this.renderingContext.renderListLastFrame.indexOf(object) > -1) {
20733
- object.dispatchEvent(new CustomEvent(ElementEvent.CULLED));
20734
- }
20767
+ // if (this.renderingContext.renderListLastFrame.indexOf(object) > -1) {
20768
+ object.dispatchEvent(new CustomEvent(ElementEvent.CULLED)); // }
20735
20769
  }
20736
20770
 
20737
20771
  return null;
@@ -20928,9 +20962,7 @@ var EventPlugin = EventPlugin_1 = (_class$3 = /*#__PURE__*/function () {
20928
20962
  renderingService.hooks.pointerOut.tap(EventPlugin_1.tag, this.onPointerMove);
20929
20963
  };
20930
20964
 
20931
- _proto.bootstrapEvent = function bootstrapEvent(e, nativeEvent, view) {
20932
- e.pointerType = nativeEvent.pointerType;
20933
- var event = e;
20965
+ _proto.bootstrapEvent = function bootstrapEvent(event, nativeEvent, view) {
20934
20966
  event.view = view;
20935
20967
  event.originalEvent = null;
20936
20968
  event.nativeEvent = nativeEvent;
@@ -20938,6 +20970,7 @@ var EventPlugin = EventPlugin_1 = (_class$3 = /*#__PURE__*/function () {
20938
20970
  event.width = nativeEvent.width;
20939
20971
  event.height = nativeEvent.height;
20940
20972
  event.isPrimary = nativeEvent.isPrimary;
20973
+ event.pointerType = nativeEvent.pointerType;
20941
20974
  event.pressure = nativeEvent.pressure;
20942
20975
  event.tangentialPressure = nativeEvent.tangentialPressure;
20943
20976
  event.tiltX = nativeEvent.tiltX;
@@ -21011,6 +21044,7 @@ var EventPlugin = EventPlugin_1 = (_class$3 = /*#__PURE__*/function () {
21011
21044
 
21012
21045
  _proto.transferMouseData = function transferMouseData(event, nativeEvent) {
21013
21046
  event.isTrusted = nativeEvent.isTrusted;
21047
+ event.srcElement = nativeEvent.srcElement;
21014
21048
  event.timeStamp = performance.now();
21015
21049
  event.type = nativeEvent.type;
21016
21050
  event.altKey = nativeEvent.altKey;
@@ -21042,8 +21076,8 @@ var EventPlugin = EventPlugin_1 = (_class$3 = /*#__PURE__*/function () {
21042
21076
  var touch = event.changedTouches[i]; // use changedTouches instead of touches since touchend has no touches
21043
21077
  // @see https://stackoverflow.com/a/10079076
21044
21078
 
21045
- if (isUndefined(touch.button)) touch.button = event.touches.length ? 1 : 0;
21046
- if (isUndefined(touch.buttons)) touch.buttons = event.touches.length ? 1 : 0;
21079
+ if (isUndefined(touch.button)) touch.button = 0;
21080
+ if (isUndefined(touch.buttons)) touch.buttons = 1;
21047
21081
 
21048
21082
  if (isUndefined(touch.isPrimary)) {
21049
21083
  touch.isPrimary = event.touches.length === 1 && event.type === 'touchstart';
@@ -21504,6 +21538,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
21504
21538
  devicePixelRatio = config.devicePixelRatio,
21505
21539
  renderer = config.renderer,
21506
21540
  background = config.background,
21541
+ cursor = config.cursor,
21507
21542
  document = config.document,
21508
21543
  requestAnimationFrame = config.requestAnimationFrame,
21509
21544
  cancelAnimationFrame = config.cancelAnimationFrame,
@@ -21555,7 +21590,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
21555
21590
  renderer: renderer,
21556
21591
  offscreenCanvas: offscreenCanvas,
21557
21592
  devicePixelRatio: dpr,
21558
- cursor: 'default',
21593
+ cursor: cursor || 'default',
21559
21594
  background: background,
21560
21595
  createImage: createImage,
21561
21596
  document: document
@@ -21606,7 +21641,6 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
21606
21641
  * the root node in scene graph
21607
21642
  */
21608
21643
  root: this.document.documentElement,
21609
- renderListLastFrame: [],
21610
21644
  renderListCurrentFrame: [],
21611
21645
  unculledEntities: [],
21612
21646
  renderReasons: new Set(),
@@ -21937,6 +21971,8 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
21937
21971
  }();
21938
21972
 
21939
21973
  _proto.setCursor = function setCursor(cursor) {
21974
+ var canvasConfig = this.container.get(CanvasConfig);
21975
+ canvasConfig.cursor = cursor;
21940
21976
  this.getContextService().applyCursorStyle(cursor);
21941
21977
  };
21942
21978
 
@@ -22056,7 +22092,6 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
22056
22092
  return Canvas;
22057
22093
  }(EventTarget);
22058
22094
 
22059
- // import * as ManaSyringe from 'mana-syringe';
22060
22095
  GlobalContainer.load(containerModule);
22061
22096
  var layoutEngine = GlobalContainer.get(LayoutEngine);
22062
22097