@antv/g 5.6.0-alpha.0 → 5.6.2

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.js CHANGED
@@ -9053,6 +9053,10 @@ function mergeTransforms(left, right, target) {
9053
9053
 
9054
9054
  function parseTransformOrigin(value) {
9055
9055
  if (isString(value)) {
9056
+ if (value === 'text-anchor') {
9057
+ return [new CSSUnitValue(0, 'px'), new CSSUnitValue(0, 'px')];
9058
+ }
9059
+
9056
9060
  var values = value.split(' ');
9057
9061
 
9058
9062
  if (values.length === 1) {
@@ -10606,7 +10610,8 @@ var DEFAULT_STYLE_PROPS = {
10606
10610
  textBaseline: '',
10607
10611
  textTransform: '',
10608
10612
  zIndex: '',
10609
- filter: ''
10613
+ filter: '',
10614
+ shadowType: ''
10610
10615
  };
10611
10616
  /**
10612
10617
  * prototype chains: DisplayObject -> Element -> Node -> EventTarget
@@ -11696,7 +11701,7 @@ var Path = /*#__PURE__*/function (_DisplayObject) {
11696
11701
  type: exports.Shape.PATH,
11697
11702
  style: _extends({
11698
11703
  path: '',
11699
- miterLimit: 4
11704
+ miterLimit: ''
11700
11705
  }, style)
11701
11706
  }, rest)) || this;
11702
11707
  }
@@ -11797,7 +11802,7 @@ var Polygon = /*#__PURE__*/function (_DisplayObject) {
11797
11802
  type: exports.Shape.POLYGON,
11798
11803
  style: _extends({
11799
11804
  points: '',
11800
- miterLimit: 4
11805
+ miterLimit: ''
11801
11806
  }, style)
11802
11807
  }, rest)) || this;
11803
11808
  }
@@ -11818,7 +11823,7 @@ var Polyline = /*#__PURE__*/function (_DisplayObject) {
11818
11823
  type: exports.Shape.POLYLINE,
11819
11824
  style: _extends({
11820
11825
  points: '',
11821
- miterLimit: 4
11826
+ miterLimit: ''
11822
11827
  }, style)
11823
11828
  }, rest)) || this;
11824
11829
  }
@@ -11909,14 +11914,15 @@ var Text = /*#__PURE__*/function (_DisplayObject) {
11909
11914
  /**
11910
11915
  * @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement#constants
11911
11916
  */
11917
+ // LENGTHADJUST_SPACING: number = 1;
11918
+ // LENGTHADJUST_SPACINGANDGLYPHS: number = 2;
11919
+ // LENGTHADJUST_UNKNOWN: number = 0;
11912
11920
  function Text(_temp) {
11913
- var _this;
11914
-
11915
11921
  var _ref = _temp === void 0 ? {} : _temp,
11916
11922
  style = _ref.style,
11917
11923
  rest = _objectWithoutPropertiesLoose(_ref, _excluded$a);
11918
11924
 
11919
- _this = _DisplayObject.call(this, _extends({
11925
+ return _DisplayObject.call(this, _extends({
11920
11926
  type: exports.Shape.TEXT,
11921
11927
  style: _extends({
11922
11928
  x: '',
@@ -11930,17 +11936,10 @@ var Text = /*#__PURE__*/function (_DisplayObject) {
11930
11936
  textAlign: '',
11931
11937
  textBaseline: '',
11932
11938
  textTransform: '',
11933
- // dropShadow: false,
11934
- // dropShadowAlpha: 1,
11935
- // dropShadowAngle: Math.PI / 6,
11936
- // dropShadowBlur: 0,
11937
- // dropShadowColor: '#000',
11938
- // dropShadowDistance: 5,
11939
11939
  fill: 'black',
11940
- // stroke: 'black',
11941
- letterSpacing: 0,
11942
- lineHeight: 0,
11943
- miterLimit: 10,
11940
+ letterSpacing: '',
11941
+ lineHeight: '',
11942
+ miterLimit: '',
11944
11943
  whiteSpace: 'pre',
11945
11944
  wordWrap: false,
11946
11945
  wordWrapWidth: 0,
@@ -11949,57 +11948,45 @@ var Text = /*#__PURE__*/function (_DisplayObject) {
11949
11948
  dy: ''
11950
11949
  }, style)
11951
11950
  }, rest)) || this;
11952
- _this.LENGTHADJUST_SPACING = 1;
11953
- _this.LENGTHADJUST_SPACINGANDGLYPHS = 2;
11954
- _this.LENGTHADJUST_UNKNOWN = 0;
11955
- _this.lengthAdjust = void 0;
11956
- _this.textLength = void 0;
11957
- return _this;
11958
- }
11959
-
11960
- var _proto = Text.prototype;
11951
+ } // lengthAdjust: SVGAnimatedEnumeration;
11952
+ // textLength: SVGAnimatedLength;
11953
+ // getCharNumAtPosition(point?: DOMPointInit): number {
11954
+ // throw new Error('Method not implemented.');
11955
+ // }
11961
11956
 
11962
- _proto.getCharNumAtPosition = function getCharNumAtPosition(point) {
11963
- throw new Error('Method not implemented.');
11964
- }
11965
11957
  /**
11966
11958
  * @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement
11967
11959
  */
11968
- ;
11960
+
11961
+
11962
+ var _proto = Text.prototype;
11969
11963
 
11970
11964
  _proto.getComputedTextLength = function getComputedTextLength() {
11971
11965
  var _this$parsedStyle$met;
11972
11966
 
11973
11967
  return ((_this$parsedStyle$met = this.parsedStyle.metrics) === null || _this$parsedStyle$met === void 0 ? void 0 : _this$parsedStyle$met.maxLineWidth) || 0;
11974
- };
11975
-
11976
- _proto.getEndPositionOfChar = function getEndPositionOfChar(charnum) {
11977
- throw new Error('Method not implemented.');
11978
- };
11979
-
11980
- _proto.getExtentOfChar = function getExtentOfChar(charnum) {
11981
- throw new Error('Method not implemented.');
11982
- };
11983
-
11984
- _proto.getNumberOfChars = function getNumberOfChars() {
11985
- throw new Error('Method not implemented.');
11986
- };
11987
-
11988
- _proto.getRotationOfChar = function getRotationOfChar(charnum) {
11989
- throw new Error('Method not implemented.');
11990
- };
11991
-
11992
- _proto.getStartPositionOfChar = function getStartPositionOfChar(charnum) {
11993
- throw new Error('Method not implemented.');
11994
- };
11995
-
11996
- _proto.getSubStringLength = function getSubStringLength(charnum, nchars) {
11997
- throw new Error('Method not implemented.');
11998
- };
11999
-
12000
- _proto.selectSubString = function selectSubString(charnum, nchars) {
12001
- throw new Error('Method not implemented.');
12002
- };
11968
+ } // getEndPositionOfChar(charnum: number): DOMPoint {
11969
+ // throw new Error('Method not implemented.');
11970
+ // }
11971
+ // getExtentOfChar(charnum: number): DOMRect {
11972
+ // throw new Error('Method not implemented.');
11973
+ // }
11974
+ // getNumberOfChars(): number {
11975
+ // throw new Error('Method not implemented.');
11976
+ // }
11977
+ // getRotationOfChar(charnum: number): number {
11978
+ // throw new Error('Method not implemented.');
11979
+ // }
11980
+ // getStartPositionOfChar(charnum: number): DOMPoint {
11981
+ // throw new Error('Method not implemented.');
11982
+ // }
11983
+ // getSubStringLength(charnum: number, nchars: number): number {
11984
+ // throw new Error('Method not implemented.');
11985
+ // }
11986
+ // selectSubString(charnum: number, nchars: number): void {
11987
+ // throw new Error('Method not implemented.');
11988
+ // }
11989
+ ;
12003
11990
 
12004
11991
  _proto.getLineBoundingRects = function getLineBoundingRects() {
12005
11992
  var _this$parsedStyle$met2;
@@ -12941,7 +12928,9 @@ var Document = /*#__PURE__*/function (_Node) {
12941
12928
  clazz = tagName === 'tspan' ? Text : Group;
12942
12929
  }
12943
12930
 
12944
- return new clazz(options);
12931
+ var shape = new clazz(options);
12932
+ shape.ownerDocument = this;
12933
+ return shape;
12945
12934
  };
12946
12935
 
12947
12936
  _proto.createElementNS = function createElementNS(namespaceURI, tagName, options) {
@@ -13248,6 +13237,16 @@ var FederatedMouseEvent = /*#__PURE__*/function (_FederatedEvent) {
13248
13237
  get: function get() {
13249
13238
  return this.client.y;
13250
13239
  }
13240
+ }, {
13241
+ key: "x",
13242
+ get: function get() {
13243
+ return this.clientX;
13244
+ }
13245
+ }, {
13246
+ key: "y",
13247
+ get: function get() {
13248
+ return this.clientY;
13249
+ }
13251
13250
  /**
13252
13251
  * The movement in this pointer relative to the last `mousemove` event.
13253
13252
  */
@@ -16591,20 +16590,15 @@ exports.RenderingService = /*#__PURE__*/function () {
16591
16590
 
16592
16591
  if (this.renderingContext.renderReasons.size && this.inited) {
16593
16592
  this.renderDisplayObject(this.renderingContext.root, canvasConfig);
16593
+ this.hooks.beginFrame.call();
16594
+ this.renderingContext.renderListCurrentFrame.forEach(function (object) {
16595
+ _this2.hooks.beforeRender.call(object);
16594
16596
 
16595
- if (this.renderingContext.renderListCurrentFrame.length || this.renderingContext.renderListLastFrame.length !== this.renderingContext.renderListCurrentFrame.length) {
16596
- this.hooks.beginFrame.call();
16597
- this.renderingContext.renderListCurrentFrame.forEach(function (object) {
16598
- _this2.hooks.beforeRender.call(object);
16599
-
16600
- _this2.hooks.render.call(object);
16601
-
16602
- _this2.hooks.afterRender.call(object);
16603
- });
16604
- this.hooks.endFrame.call();
16605
- }
16597
+ _this2.hooks.render.call(object);
16606
16598
 
16607
- this.renderingContext.renderListLastFrame = [].concat(this.renderingContext.renderListCurrentFrame);
16599
+ _this2.hooks.afterRender.call(object);
16600
+ });
16601
+ this.hooks.endFrame.call();
16608
16602
  this.renderingContext.renderListCurrentFrame = [];
16609
16603
  this.renderingContext.renderReasons.clear();
16610
16604
  } // console.log('stats', this.stats);
@@ -16765,7 +16759,7 @@ exports.EventService = /*#__PURE__*/function (_EventEmitter) {
16765
16759
 
16766
16760
  _this.onPointerUp = /*#__PURE__*/function () {
16767
16761
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(from) {
16768
- var now, e, isRightButton, trackingData, pressTarget, clickTarget, currentTarget, _isRightButton, clickEvent, clickHistory;
16762
+ var now, e, isRightButton, trackingData, pressTarget, clickTarget, currentTarget, _isRightButton, _e$detail, clickEvent, clickHistory;
16769
16763
 
16770
16764
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
16771
16765
  while (1) {
@@ -16851,12 +16845,14 @@ exports.EventService = /*#__PURE__*/function (_EventEmitter) {
16851
16845
 
16852
16846
  clickHistory.target = clickEvent.target;
16853
16847
  clickHistory.timeStamp = now;
16854
- clickEvent.detail = clickHistory.clickCount;
16848
+ clickEvent.detail = clickHistory.clickCount; // @see https://github.com/antvis/G/issues/1091
16855
16849
 
16856
- if (clickEvent.pointerType === 'mouse' || clickEvent.pointerType === 'touch') {
16857
- _this.dispatchEvent(clickEvent, 'click');
16858
- } else {
16859
- _this.dispatchEvent(clickEvent, 'pointertap');
16850
+ if (!((_e$detail = e.detail) === null || _e$detail === void 0 ? void 0 : _e$detail.preventClick)) {
16851
+ if (clickEvent.pointerType === 'mouse' || clickEvent.pointerType === 'touch') {
16852
+ _this.dispatchEvent(clickEvent, 'click');
16853
+ } else {
16854
+ _this.dispatchEvent(clickEvent, 'pointertap');
16855
+ }
16860
16856
  }
16861
16857
 
16862
16858
  _this.freeEvent(clickEvent);
@@ -18100,13 +18096,11 @@ exports.TextService = /*#__PURE__*/function () {
18100
18096
  _proto.measureText = function measureText(text, parsedStyle, offscreenCanvas) {
18101
18097
  var fontSize = parsedStyle.fontSize,
18102
18098
  wordWrap = parsedStyle.wordWrap,
18103
- _parsedStyle$lineHeig = parsedStyle.lineHeight,
18104
- strokeHeight = _parsedStyle$lineHeig === void 0 ? 0 : _parsedStyle$lineHeig,
18099
+ strokeHeight = parsedStyle.lineHeight,
18105
18100
  lineWidth = parsedStyle.lineWidth,
18106
18101
  textBaseline = parsedStyle.textBaseline,
18107
18102
  textAlign = parsedStyle.textAlign,
18108
- _parsedStyle$letterSp = parsedStyle.letterSpacing,
18109
- letterSpacing = _parsedStyle$letterSp === void 0 ? 0 : _parsedStyle$letterSp,
18103
+ letterSpacing = parsedStyle.letterSpacing,
18110
18104
  _parsedStyle$leading = parsedStyle.leading,
18111
18105
  leading = _parsedStyle$leading === void 0 ? 0 : _parsedStyle$leading;
18112
18106
  var font = toFontString(parsedStyle);
@@ -18126,7 +18120,7 @@ exports.TextService = /*#__PURE__*/function () {
18126
18120
  var maxLineWidth = 0;
18127
18121
 
18128
18122
  for (var i = 0; i < lines.length; i++) {
18129
- var _lineWidth = context.measureText(lines[i]).width + (lines[i].length - 1) * letterSpacing;
18123
+ var _lineWidth = context.measureText(lines[i]).width + (lines[i].length - 1) * letterSpacing.value;
18130
18124
 
18131
18125
  lineWidths[i] = _lineWidth;
18132
18126
  maxLineWidth = Math.max(maxLineWidth, _lineWidth);
@@ -18136,7 +18130,7 @@ exports.TextService = /*#__PURE__*/function () {
18136
18130
  // width += dropShadowDistance;
18137
18131
  // }
18138
18132
 
18139
- var lineHeight = strokeHeight || fontProperties.fontSize + lineWidth.value;
18133
+ var lineHeight = strokeHeight.value || fontProperties.fontSize + lineWidth.value;
18140
18134
  var height = Math.max(lineHeight, fontProperties.fontSize + lineWidth.value) + (lines.length - 1) * (lineHeight + leading); // if (dropShadow) {
18141
18135
  // height += dropShadowDistance;
18142
18136
  // }
@@ -18181,17 +18175,16 @@ exports.TextService = /*#__PURE__*/function () {
18181
18175
 
18182
18176
  var _ref$wordWrapWidth = _ref.wordWrapWidth,
18183
18177
  wordWrapWidth = _ref$wordWrapWidth === void 0 ? 0 : _ref$wordWrapWidth,
18184
- _ref$letterSpacing = _ref.letterSpacing,
18185
- letterSpacing = _ref$letterSpacing === void 0 ? 0 : _ref$letterSpacing;
18178
+ letterSpacing = _ref.letterSpacing;
18186
18179
  var context = this.offscreenCanvas.getOrCreateContext(offscreenCanvas);
18187
- var maxWidth = wordWrapWidth + letterSpacing;
18180
+ var maxWidth = wordWrapWidth + letterSpacing.value;
18188
18181
  var lines = [];
18189
18182
  var currentIndex = 0;
18190
18183
  var currentWidth = 0;
18191
18184
  var cache = {};
18192
18185
 
18193
18186
  var calcWidth = function calcWidth(char) {
18194
- return _this2.getFromCache(char, letterSpacing, cache, context);
18187
+ return _this2.getFromCache(char, letterSpacing.value, cache, context);
18195
18188
  };
18196
18189
 
18197
18190
  Array.from(text).forEach(function (char, i) {
@@ -18776,7 +18769,7 @@ function getFontSize(object) {
18776
18769
  return fontSize.clone();
18777
18770
  }
18778
18771
 
18779
- return new CSSUnitValue(0, 'px');
18772
+ return null;
18780
18773
  }
18781
18774
  /**
18782
18775
  * <length> & <percentage>
@@ -18804,8 +18797,13 @@ exports.CSSPropertyLengthOrPercentage = /*#__PURE__*/function () {
18804
18797
  } else if (computed.unit === exports.UnitType.kEms) {
18805
18798
  if (object.parentNode) {
18806
18799
  var fontSize = getFontSize(object.parentNode);
18807
- fontSize.value *= computed.value;
18808
- return fontSize;
18800
+
18801
+ if (fontSize) {
18802
+ fontSize.value *= computed.value;
18803
+ return fontSize;
18804
+ } else {
18805
+ registry.addUnresolveProperty(object, name);
18806
+ }
18809
18807
  }
18810
18808
 
18811
18809
  return new CSSUnitValue(0, 'px');
@@ -18815,8 +18813,12 @@ exports.CSSPropertyLengthOrPercentage = /*#__PURE__*/function () {
18815
18813
  if (object === null || object === void 0 ? void 0 : (_object$ownerDocument = object.ownerDocument) === null || _object$ownerDocument === void 0 ? void 0 : _object$ownerDocument.documentElement) {
18816
18814
  var _fontSize = getFontSize(object.ownerDocument.documentElement);
18817
18815
 
18818
- _fontSize.value *= computed.value;
18819
- return _fontSize;
18816
+ if (_fontSize) {
18817
+ _fontSize.value *= computed.value;
18818
+ return _fontSize;
18819
+ } else {
18820
+ registry.addUnresolveProperty(object, name);
18821
+ }
18820
18822
  }
18821
18823
 
18822
18824
  return new CSSUnitValue(0, 'px');
@@ -18975,7 +18977,11 @@ exports.CSSPropertyLocalPosition = /*#__PURE__*/function (_CSSPropertyLengthOrP)
18975
18977
  z = 0;
18976
18978
  break;
18977
18979
 
18978
- default:
18980
+ case exports.Shape.RECT:
18981
+ case exports.Shape.IMAGE:
18982
+ case exports.Shape.GROUP:
18983
+ case exports.Shape.HTML:
18984
+ case exports.Shape.TEXT:
18979
18985
  if (!isNil(object.parsedStyle.x)) {
18980
18986
  x = object.parsedStyle.x.value;
18981
18987
  }
@@ -18987,15 +18993,21 @@ exports.CSSPropertyLocalPosition = /*#__PURE__*/function (_CSSPropertyLengthOrP)
18987
18993
  break;
18988
18994
  }
18989
18995
 
18990
- object.parsedStyle.defX = x || 0;
18991
- object.parsedStyle.defY = y || 0;
18996
+ if (object.nodeName !== exports.Shape.PATH && object.nodeName !== exports.Shape.POLYLINE && object.nodeName !== exports.Shape.POLYGON) {
18997
+ object.parsedStyle.defX = x || 0;
18998
+ object.parsedStyle.defY = y || 0;
18999
+ }
19000
+
19001
+ var needResetLocalPosition = !isNil(x) || !isNil(y) || !isNil(z);
18992
19002
 
18993
- var _object$getLocalPosit = object.getLocalPosition(),
18994
- ox = _object$getLocalPosit[0],
18995
- oy = _object$getLocalPosit[1],
18996
- oz = _object$getLocalPosit[2];
19003
+ if (needResetLocalPosition) {
19004
+ var _object$getLocalPosit = object.getLocalPosition(),
19005
+ ox = _object$getLocalPosit[0],
19006
+ oy = _object$getLocalPosit[1],
19007
+ oz = _object$getLocalPosit[2];
18997
19008
 
18998
- object.setLocalPosition(isNil(x) ? ox : x, isNil(y) ? oy : y, isNil(z) ? oz : z);
19009
+ object.setLocalPosition(isNil(x) ? ox : x, isNil(y) ? oy : y, isNil(z) ? oz : z);
19010
+ }
18999
19011
  };
19000
19012
 
19001
19013
  return CSSPropertyLocalPosition;
@@ -19562,6 +19574,11 @@ var BUILT_IN_PROPERTIES = [{
19562
19574
  keywords: ['none'],
19563
19575
  defaultValue: 'none',
19564
19576
  syntax: exports.PropertySyntax.PAINT
19577
+ }, {
19578
+ name: 'shadowType',
19579
+ keywords: ['inner', 'outer', 'both'],
19580
+ defaultValue: 'outer',
19581
+ layoutDependent: true
19565
19582
  }, {
19566
19583
  name: 'shadowColor',
19567
19584
  interpolable: true,
@@ -19698,6 +19715,10 @@ var BUILT_IN_PROPERTIES = [{
19698
19715
  return 'center';
19699
19716
  }
19700
19717
 
19718
+ if (nodeName === exports.Shape.TEXT) {
19719
+ return 'text-anchor';
19720
+ }
19721
+
19701
19722
  return 'left top';
19702
19723
  },
19703
19724
  layoutDependent: true,
@@ -19828,12 +19849,14 @@ var BUILT_IN_PROPERTIES = [{
19828
19849
  layoutDependent: true,
19829
19850
  defaultValue: '',
19830
19851
  alias: ['d'],
19831
- syntax: exports.PropertySyntax.PATH
19852
+ syntax: exports.PropertySyntax.PATH,
19853
+ parsePriority: 50
19832
19854
  }, // Polyline & Polygon
19833
19855
  {
19834
19856
  name: 'points',
19835
19857
  layoutDependent: true,
19836
- syntax: exports.PropertySyntax.LIST_OF_POINTS
19858
+ syntax: exports.PropertySyntax.LIST_OF_POINTS,
19859
+ parsePriority: 50
19837
19860
  }, // Text
19838
19861
  {
19839
19862
  name: 'text',
@@ -19889,16 +19912,27 @@ var BUILT_IN_PROPERTIES = [{
19889
19912
  defaultValue: 'normal'
19890
19913
  }, {
19891
19914
  name: 'lineHeight',
19892
- layoutDependent: true // interpolable: true,
19893
- // inherited: true,
19894
- // defaultValue: '-100%'
19895
-
19915
+ layoutDependent: true,
19916
+ syntax: exports.PropertySyntax.LENGTH,
19917
+ interpolable: true,
19918
+ defaultValue: '0'
19896
19919
  }, {
19897
19920
  name: 'letterSpacing',
19898
- layoutDependent: true // interpolable: true,
19899
- // inherited: true,
19900
- // defaultValue: '0',
19921
+ layoutDependent: true,
19922
+ syntax: exports.PropertySyntax.LENGTH,
19923
+ interpolable: true,
19924
+ defaultValue: '0'
19925
+ }, {
19926
+ name: 'miterLimit',
19927
+ layoutDependent: true,
19928
+ syntax: exports.PropertySyntax.NUMBER,
19929
+ defaultValue: function defaultValue(nodeName) {
19930
+ if (nodeName === exports.Shape.PATH || nodeName === exports.Shape.POLYGON || nodeName === exports.Shape.POLYLINE) {
19931
+ return '4';
19932
+ }
19901
19933
 
19934
+ return '10';
19935
+ }
19902
19936
  }, {
19903
19937
  name: 'wordWrap',
19904
19938
  layoutDependent: true
@@ -20294,6 +20328,7 @@ exports.DefaultStyleValueRegistry = /*#__PURE__*/function () {
20294
20328
  var stroke = parsedStyle.stroke,
20295
20329
  lineWidth = parsedStyle.lineWidth,
20296
20330
  increasedLineWidthForHitTesting = parsedStyle.increasedLineWidthForHitTesting,
20331
+ shadowType = parsedStyle.shadowType,
20297
20332
  shadowColor = parsedStyle.shadowColor,
20298
20333
  _parsedStyle$filter = parsedStyle.filter,
20299
20334
  filter = _parsedStyle$filter === void 0 ? [] : _parsedStyle$filter,
@@ -20325,7 +20360,7 @@ exports.DefaultStyleValueRegistry = /*#__PURE__*/function () {
20325
20360
 
20326
20361
  geometry.renderBounds.update(center, halfExtents); // account for shadow, only support constant value now
20327
20362
 
20328
- if (shadowColor) {
20363
+ if (shadowColor && (shadowType === null || shadowType === void 0 ? void 0 : shadowType.value) !== 'inner') {
20329
20364
  var _geometry$renderBound = geometry.renderBounds,
20330
20365
  min = _geometry$renderBound.min,
20331
20366
  max = _geometry$renderBound.max;
@@ -20577,6 +20612,9 @@ var containerModule = manaSyringe.Module(function (register) {
20577
20612
  });
20578
20613
  });
20579
20614
 
20615
+ var AbstractRendererPlugin = function AbstractRendererPlugin() {
20616
+ this.container = void 0;
20617
+ };
20580
20618
  var AbstractRenderer = /*#__PURE__*/function () {
20581
20619
  function AbstractRenderer(config) {
20582
20620
  this.plugins = [];
@@ -20685,9 +20723,8 @@ var CullingPlugin = CullingPlugin_1 = (_class$1 = /*#__PURE__*/function () {
20685
20723
  if (!cullable.isCulled() && object.isVisible()) {
20686
20724
  return object;
20687
20725
  } else {
20688
- if (_this.renderingContext.renderListLastFrame.indexOf(object) > -1) {
20689
- object.dispatchEvent(new CustomEvent(exports.ElementEvent.CULLED));
20690
- }
20726
+ // if (this.renderingContext.renderListLastFrame.indexOf(object) > -1) {
20727
+ object.dispatchEvent(new CustomEvent(exports.ElementEvent.CULLED)); // }
20691
20728
  }
20692
20729
 
20693
20730
  return null;
@@ -20884,9 +20921,7 @@ var EventPlugin = EventPlugin_1 = (_class$3 = /*#__PURE__*/function () {
20884
20921
  renderingService.hooks.pointerOut.tap(EventPlugin_1.tag, this.onPointerMove);
20885
20922
  };
20886
20923
 
20887
- _proto.bootstrapEvent = function bootstrapEvent(e, nativeEvent, view) {
20888
- e.pointerType = nativeEvent.pointerType;
20889
- var event = e;
20924
+ _proto.bootstrapEvent = function bootstrapEvent(event, nativeEvent, view) {
20890
20925
  event.view = view;
20891
20926
  event.originalEvent = null;
20892
20927
  event.nativeEvent = nativeEvent;
@@ -20894,6 +20929,7 @@ var EventPlugin = EventPlugin_1 = (_class$3 = /*#__PURE__*/function () {
20894
20929
  event.width = nativeEvent.width;
20895
20930
  event.height = nativeEvent.height;
20896
20931
  event.isPrimary = nativeEvent.isPrimary;
20932
+ event.pointerType = nativeEvent.pointerType;
20897
20933
  event.pressure = nativeEvent.pressure;
20898
20934
  event.tangentialPressure = nativeEvent.tangentialPressure;
20899
20935
  event.tiltX = nativeEvent.tiltX;
@@ -20967,6 +21003,7 @@ var EventPlugin = EventPlugin_1 = (_class$3 = /*#__PURE__*/function () {
20967
21003
 
20968
21004
  _proto.transferMouseData = function transferMouseData(event, nativeEvent) {
20969
21005
  event.isTrusted = nativeEvent.isTrusted;
21006
+ event.srcElement = nativeEvent.srcElement;
20970
21007
  event.timeStamp = performance.now();
20971
21008
  event.type = nativeEvent.type;
20972
21009
  event.altKey = nativeEvent.altKey;
@@ -20998,8 +21035,8 @@ var EventPlugin = EventPlugin_1 = (_class$3 = /*#__PURE__*/function () {
20998
21035
  var touch = event.changedTouches[i]; // use changedTouches instead of touches since touchend has no touches
20999
21036
  // @see https://stackoverflow.com/a/10079076
21000
21037
 
21001
- if (isUndefined(touch.button)) touch.button = event.touches.length ? 1 : 0;
21002
- if (isUndefined(touch.buttons)) touch.buttons = event.touches.length ? 1 : 0;
21038
+ if (isUndefined(touch.button)) touch.button = 0;
21039
+ if (isUndefined(touch.buttons)) touch.buttons = 1;
21003
21040
 
21004
21041
  if (isUndefined(touch.isPrimary)) {
21005
21042
  touch.isPrimary = event.touches.length === 1 && event.type === 'touchstart';
@@ -21560,7 +21597,6 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
21560
21597
  * the root node in scene graph
21561
21598
  */
21562
21599
  root: this.document.documentElement,
21563
- renderListLastFrame: [],
21564
21600
  renderListCurrentFrame: [],
21565
21601
  unculledEntities: [],
21566
21602
  renderReasons: new Set(),
@@ -21841,14 +21877,13 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
21841
21877
  // load other container modules provided by g-canvas/g-svg/g-webgl
21842
21878
  var plugins = renderer.getPlugins();
21843
21879
  plugins.forEach(function (plugin) {
21844
- plugin.init(_this4.container);
21880
+ plugin.container = _this4.container;
21881
+ plugin.init();
21845
21882
  });
21846
21883
  };
21847
21884
 
21848
21885
  _proto.setRenderer = /*#__PURE__*/function () {
21849
21886
  var _setRenderer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(renderer) {
21850
- var _this5 = this;
21851
-
21852
21887
  var canvasConfig, oldRenderer;
21853
21888
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
21854
21889
  while (1) {
@@ -21871,7 +21906,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
21871
21906
  this.destroy(false, true); // destroy all plugins, reverse will mutate origin array
21872
21907
 
21873
21908
  [].concat(oldRenderer === null || oldRenderer === void 0 ? void 0 : oldRenderer.getPlugins()).reverse().forEach(function (plugin) {
21874
- plugin.destroy(_this5.container);
21909
+ plugin.destroy();
21875
21910
  });
21876
21911
  _context3.next = 9;
21877
21912
  return this.initRenderer(renderer);
@@ -21896,7 +21931,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
21896
21931
  };
21897
21932
 
21898
21933
  _proto.unmountChildren = function unmountChildren(parent) {
21899
- var _this6 = this;
21934
+ var _this5 = this;
21900
21935
 
21901
21936
  if (this.inited) {
21902
21937
  var path = [];
@@ -21916,7 +21951,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
21916
21951
 
21917
21952
  child.dispatchEvent(new CustomEvent(exports.ElementEvent.UNMOUNTED)); // skip document.documentElement
21918
21953
 
21919
- if (child !== _this6.document.documentElement) {
21954
+ if (child !== _this5.document.documentElement) {
21920
21955
  child.ownerDocument = null;
21921
21956
  }
21922
21957
 
@@ -21926,12 +21961,12 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
21926
21961
  };
21927
21962
 
21928
21963
  _proto.mountChildren = function mountChildren(parent) {
21929
- var _this7 = this;
21964
+ var _this6 = this;
21930
21965
 
21931
21966
  if (this.inited) {
21932
21967
  parent.forEach(function (child) {
21933
21968
  if (!child.isConnected) {
21934
- child.ownerDocument = _this7.document;
21969
+ child.ownerDocument = _this6.document;
21935
21970
  child.isConnected = true;
21936
21971
  child.dispatchEvent(new CustomEvent(exports.ElementEvent.MOUNTED)); // trigger after mounted
21937
21972
 
@@ -21990,12 +22025,12 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
21990
22025
  _createClass(Canvas, [{
21991
22026
  key: "ready",
21992
22027
  get: function get() {
21993
- var _this8 = this;
22028
+ var _this7 = this;
21994
22029
 
21995
22030
  if (!this.readyPromise) {
21996
22031
  this.readyPromise = new Promise(function (resolve) {
21997
- _this8.resolveReadyPromise = function () {
21998
- resolve(_this8);
22032
+ _this7.resolveReadyPromise = function () {
22033
+ resolve(_this7);
21999
22034
  };
22000
22035
  });
22001
22036
 
@@ -22011,7 +22046,6 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
22011
22046
  return Canvas;
22012
22047
  }(EventTarget);
22013
22048
 
22014
- // import * as ManaSyringe from 'mana-syringe';
22015
22049
  manaSyringe.GlobalContainer.load(containerModule);
22016
22050
  var layoutEngine = manaSyringe.GlobalContainer.get(exports.LayoutEngine);
22017
22051
 
@@ -22032,6 +22066,7 @@ Object.defineProperty(exports, 'RBush', {
22032
22066
  exports.AABB = AABB;
22033
22067
  exports.AbstractLayoutDefinition = AbstractLayoutDefinition;
22034
22068
  exports.AbstractRenderer = AbstractRenderer;
22069
+ exports.AbstractRendererPlugin = AbstractRendererPlugin;
22035
22070
  exports.Animation = Animation;
22036
22071
  exports.AnimationEffectTiming = AnimationEffectTiming;
22037
22072
  exports.AnimationEvent = AnimationEvent;