@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.umd.js CHANGED
@@ -17924,14 +17924,15 @@
17924
17924
  if (distanceIsNumber && distance <= 0) {
17925
17925
  POINT = { x: x, y: y };
17926
17926
  }
17927
- var sampleSize = 300;
17927
+ // bad perf when size = 300
17928
+ var sampleSize = 100;
17928
17929
  for (var j = 0; j <= sampleSize; j += 1) {
17929
17930
  t = j / sampleSize;
17930
17931
  (_a = getPointAtArcSegmentLength(X1, Y1, RX, RY, angle, LAF, SF, X2, Y2, t), x = _a.x, y = _a.y);
17931
- POINTS = __spreadArray(__spreadArray([], POINTS, true), [{ x: x, y: y }], false);
17932
+ POINTS = POINTS.concat({ x: x, y: y });
17932
17933
  LENGTH += distanceSquareRoot(cur, [x, y]);
17933
17934
  cur = [x, y];
17934
- if (distanceIsNumber && LENGTH > distance && distance > prev[2]) {
17935
+ if (distanceIsNumber && LENGTH >= distance && distance > prev[2]) {
17935
17936
  var dv = (LENGTH - distance) / (LENGTH - prev[2]);
17936
17937
  POINT = {
17937
17938
  x: cur[0] * (1 - dv) + prev[0] * dv,
@@ -17987,14 +17988,14 @@
17987
17988
  POINT = { x: x, y: y };
17988
17989
  }
17989
17990
  // bad perf when size = 300
17990
- var sampleSize = 20;
17991
+ var sampleSize = 30;
17991
17992
  for (var j = 0; j <= sampleSize; j += 1) {
17992
17993
  t = j / sampleSize;
17993
17994
  (_a = getPointAtCubicSegmentLength(x1, y1, c1x, c1y, c2x, c2y, x2, y2, t), x = _a.x, y = _a.y);
17994
- POINTS = __spreadArray(__spreadArray([], POINTS, true), [{ x: x, y: y }], false);
17995
+ POINTS = POINTS.concat({ x: x, y: y });
17995
17996
  LENGTH += distanceSquareRoot(cur, [x, y]);
17996
17997
  cur = [x, y];
17997
- if (distanceIsNumber && LENGTH > distance && distance > prev[2]) {
17998
+ if (distanceIsNumber && LENGTH >= distance && distance > prev[2]) {
17998
17999
  var dv = (LENGTH - distance) / (LENGTH - prev[2]);
17999
18000
  POINT = {
18000
18001
  x: cur[0] * (1 - dv) + prev[0] * dv,
@@ -18051,14 +18052,14 @@
18051
18052
  if (distanceIsNumber && distance <= 0) {
18052
18053
  POINT = { x: x, y: y };
18053
18054
  }
18054
- var sampleSize = 300;
18055
+ var sampleSize = 30;
18055
18056
  for (var j = 0; j <= sampleSize; j += 1) {
18056
18057
  t = j / sampleSize;
18057
18058
  (_a = getPointAtQuadSegmentLength(x1, y1, qx, qy, x2, y2, t), x = _a.x, y = _a.y);
18058
- POINTS = __spreadArray(__spreadArray([], POINTS, true), [{ x: x, y: y }], false);
18059
+ POINTS = POINTS.concat({ x: x, y: y });
18059
18060
  LENGTH += distanceSquareRoot(cur, [x, y]);
18060
18061
  cur = [x, y];
18061
- if (distanceIsNumber && LENGTH > distance && distance > prev[2]) {
18062
+ if (distanceIsNumber && LENGTH >= distance && distance > prev[2]) {
18062
18063
  var dv = (LENGTH - distance) / (LENGTH - prev[2]);
18063
18064
  POINT = {
18064
18065
  x: cur[0] * (1 - dv) + prev[0] * dv,
@@ -20055,6 +20056,10 @@
20055
20056
 
20056
20057
  function parseTransformOrigin(value) {
20057
20058
  if (isString(value)) {
20059
+ if (value === 'text-anchor') {
20060
+ return [new CSSUnitValue(0, 'px'), new CSSUnitValue(0, 'px')];
20061
+ }
20062
+
20058
20063
  var values = value.split(' ');
20059
20064
 
20060
20065
  if (values.length === 1) {
@@ -21608,7 +21613,8 @@
21608
21613
  textBaseline: '',
21609
21614
  textTransform: '',
21610
21615
  zIndex: '',
21611
- filter: ''
21616
+ filter: '',
21617
+ shadowType: ''
21612
21618
  };
21613
21619
  /**
21614
21620
  * prototype chains: DisplayObject -> Element -> Node -> EventTarget
@@ -22698,7 +22704,7 @@
22698
22704
  type: exports.Shape.PATH,
22699
22705
  style: _extends({
22700
22706
  path: '',
22701
- miterLimit: 4
22707
+ miterLimit: ''
22702
22708
  }, style)
22703
22709
  }, rest)) || this;
22704
22710
  }
@@ -22799,7 +22805,7 @@
22799
22805
  type: exports.Shape.POLYGON,
22800
22806
  style: _extends({
22801
22807
  points: '',
22802
- miterLimit: 4
22808
+ miterLimit: ''
22803
22809
  }, style)
22804
22810
  }, rest)) || this;
22805
22811
  }
@@ -22820,7 +22826,7 @@
22820
22826
  type: exports.Shape.POLYLINE,
22821
22827
  style: _extends({
22822
22828
  points: '',
22823
- miterLimit: 4
22829
+ miterLimit: ''
22824
22830
  }, style)
22825
22831
  }, rest)) || this;
22826
22832
  }
@@ -22911,14 +22917,15 @@
22911
22917
  /**
22912
22918
  * @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement#constants
22913
22919
  */
22920
+ // LENGTHADJUST_SPACING: number = 1;
22921
+ // LENGTHADJUST_SPACINGANDGLYPHS: number = 2;
22922
+ // LENGTHADJUST_UNKNOWN: number = 0;
22914
22923
  function Text(_temp) {
22915
- var _this;
22916
-
22917
22924
  var _ref = _temp === void 0 ? {} : _temp,
22918
22925
  style = _ref.style,
22919
22926
  rest = _objectWithoutPropertiesLoose(_ref, _excluded$a);
22920
22927
 
22921
- _this = _DisplayObject.call(this, _extends({
22928
+ return _DisplayObject.call(this, _extends({
22922
22929
  type: exports.Shape.TEXT,
22923
22930
  style: _extends({
22924
22931
  x: '',
@@ -22932,17 +22939,10 @@
22932
22939
  textAlign: '',
22933
22940
  textBaseline: '',
22934
22941
  textTransform: '',
22935
- // dropShadow: false,
22936
- // dropShadowAlpha: 1,
22937
- // dropShadowAngle: Math.PI / 6,
22938
- // dropShadowBlur: 0,
22939
- // dropShadowColor: '#000',
22940
- // dropShadowDistance: 5,
22941
22942
  fill: 'black',
22942
- // stroke: 'black',
22943
- letterSpacing: 0,
22944
- lineHeight: 0,
22945
- miterLimit: 10,
22943
+ letterSpacing: '',
22944
+ lineHeight: '',
22945
+ miterLimit: '',
22946
22946
  whiteSpace: 'pre',
22947
22947
  wordWrap: false,
22948
22948
  wordWrapWidth: 0,
@@ -22951,57 +22951,45 @@
22951
22951
  dy: ''
22952
22952
  }, style)
22953
22953
  }, rest)) || this;
22954
- _this.LENGTHADJUST_SPACING = 1;
22955
- _this.LENGTHADJUST_SPACINGANDGLYPHS = 2;
22956
- _this.LENGTHADJUST_UNKNOWN = 0;
22957
- _this.lengthAdjust = void 0;
22958
- _this.textLength = void 0;
22959
- return _this;
22960
- }
22961
-
22962
- var _proto = Text.prototype;
22954
+ } // lengthAdjust: SVGAnimatedEnumeration;
22955
+ // textLength: SVGAnimatedLength;
22956
+ // getCharNumAtPosition(point?: DOMPointInit): number {
22957
+ // throw new Error('Method not implemented.');
22958
+ // }
22963
22959
 
22964
- _proto.getCharNumAtPosition = function getCharNumAtPosition(point) {
22965
- throw new Error('Method not implemented.');
22966
- }
22967
22960
  /**
22968
22961
  * @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement
22969
22962
  */
22970
- ;
22963
+
22964
+
22965
+ var _proto = Text.prototype;
22971
22966
 
22972
22967
  _proto.getComputedTextLength = function getComputedTextLength() {
22973
22968
  var _this$parsedStyle$met;
22974
22969
 
22975
22970
  return ((_this$parsedStyle$met = this.parsedStyle.metrics) === null || _this$parsedStyle$met === void 0 ? void 0 : _this$parsedStyle$met.maxLineWidth) || 0;
22976
- };
22977
-
22978
- _proto.getEndPositionOfChar = function getEndPositionOfChar(charnum) {
22979
- throw new Error('Method not implemented.');
22980
- };
22981
-
22982
- _proto.getExtentOfChar = function getExtentOfChar(charnum) {
22983
- throw new Error('Method not implemented.');
22984
- };
22985
-
22986
- _proto.getNumberOfChars = function getNumberOfChars() {
22987
- throw new Error('Method not implemented.');
22988
- };
22989
-
22990
- _proto.getRotationOfChar = function getRotationOfChar(charnum) {
22991
- throw new Error('Method not implemented.');
22992
- };
22993
-
22994
- _proto.getStartPositionOfChar = function getStartPositionOfChar(charnum) {
22995
- throw new Error('Method not implemented.');
22996
- };
22997
-
22998
- _proto.getSubStringLength = function getSubStringLength(charnum, nchars) {
22999
- throw new Error('Method not implemented.');
23000
- };
23001
-
23002
- _proto.selectSubString = function selectSubString(charnum, nchars) {
23003
- throw new Error('Method not implemented.');
23004
- };
22971
+ } // getEndPositionOfChar(charnum: number): DOMPoint {
22972
+ // throw new Error('Method not implemented.');
22973
+ // }
22974
+ // getExtentOfChar(charnum: number): DOMRect {
22975
+ // throw new Error('Method not implemented.');
22976
+ // }
22977
+ // getNumberOfChars(): number {
22978
+ // throw new Error('Method not implemented.');
22979
+ // }
22980
+ // getRotationOfChar(charnum: number): number {
22981
+ // throw new Error('Method not implemented.');
22982
+ // }
22983
+ // getStartPositionOfChar(charnum: number): DOMPoint {
22984
+ // throw new Error('Method not implemented.');
22985
+ // }
22986
+ // getSubStringLength(charnum: number, nchars: number): number {
22987
+ // throw new Error('Method not implemented.');
22988
+ // }
22989
+ // selectSubString(charnum: number, nchars: number): void {
22990
+ // throw new Error('Method not implemented.');
22991
+ // }
22992
+ ;
23005
22993
 
23006
22994
  _proto.getLineBoundingRects = function getLineBoundingRects() {
23007
22995
  var _this$parsedStyle$met2;
@@ -23943,7 +23931,9 @@
23943
23931
  clazz = tagName === 'tspan' ? Text : Group;
23944
23932
  }
23945
23933
 
23946
- return new clazz(options);
23934
+ var shape = new clazz(options);
23935
+ shape.ownerDocument = this;
23936
+ return shape;
23947
23937
  };
23948
23938
 
23949
23939
  _proto.createElementNS = function createElementNS(namespaceURI, tagName, options) {
@@ -24250,6 +24240,16 @@
24250
24240
  get: function get() {
24251
24241
  return this.client.y;
24252
24242
  }
24243
+ }, {
24244
+ key: "x",
24245
+ get: function get() {
24246
+ return this.clientX;
24247
+ }
24248
+ }, {
24249
+ key: "y",
24250
+ get: function get() {
24251
+ return this.clientY;
24252
+ }
24253
24253
  /**
24254
24254
  * The movement in this pointer relative to the last `mousemove` event.
24255
24255
  */
@@ -27593,20 +27593,15 @@
27593
27593
 
27594
27594
  if (this.renderingContext.renderReasons.size && this.inited) {
27595
27595
  this.renderDisplayObject(this.renderingContext.root, canvasConfig);
27596
+ this.hooks.beginFrame.call();
27597
+ this.renderingContext.renderListCurrentFrame.forEach(function (object) {
27598
+ _this2.hooks.beforeRender.call(object);
27596
27599
 
27597
- if (this.renderingContext.renderListCurrentFrame.length || this.renderingContext.renderListLastFrame.length !== this.renderingContext.renderListCurrentFrame.length) {
27598
- this.hooks.beginFrame.call();
27599
- this.renderingContext.renderListCurrentFrame.forEach(function (object) {
27600
- _this2.hooks.beforeRender.call(object);
27601
-
27602
- _this2.hooks.render.call(object);
27603
-
27604
- _this2.hooks.afterRender.call(object);
27605
- });
27606
- this.hooks.endFrame.call();
27607
- }
27600
+ _this2.hooks.render.call(object);
27608
27601
 
27609
- this.renderingContext.renderListLastFrame = [].concat(this.renderingContext.renderListCurrentFrame);
27602
+ _this2.hooks.afterRender.call(object);
27603
+ });
27604
+ this.hooks.endFrame.call();
27610
27605
  this.renderingContext.renderListCurrentFrame = [];
27611
27606
  this.renderingContext.renderReasons.clear();
27612
27607
  } // console.log('stats', this.stats);
@@ -27767,7 +27762,7 @@
27767
27762
 
27768
27763
  _this.onPointerUp = /*#__PURE__*/function () {
27769
27764
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(from) {
27770
- var now, e, isRightButton, trackingData, pressTarget, clickTarget, currentTarget, _isRightButton, clickEvent, clickHistory;
27765
+ var now, e, isRightButton, trackingData, pressTarget, clickTarget, currentTarget, _isRightButton, _e$detail, clickEvent, clickHistory;
27771
27766
 
27772
27767
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
27773
27768
  while (1) {
@@ -27853,12 +27848,14 @@
27853
27848
 
27854
27849
  clickHistory.target = clickEvent.target;
27855
27850
  clickHistory.timeStamp = now;
27856
- clickEvent.detail = clickHistory.clickCount;
27851
+ clickEvent.detail = clickHistory.clickCount; // @see https://github.com/antvis/G/issues/1091
27857
27852
 
27858
- if (clickEvent.pointerType === 'mouse' || clickEvent.pointerType === 'touch') {
27859
- _this.dispatchEvent(clickEvent, 'click');
27860
- } else {
27861
- _this.dispatchEvent(clickEvent, 'pointertap');
27853
+ if (!((_e$detail = e.detail) === null || _e$detail === void 0 ? void 0 : _e$detail.preventClick)) {
27854
+ if (clickEvent.pointerType === 'mouse' || clickEvent.pointerType === 'touch') {
27855
+ _this.dispatchEvent(clickEvent, 'click');
27856
+ } else {
27857
+ _this.dispatchEvent(clickEvent, 'pointertap');
27858
+ }
27862
27859
  }
27863
27860
 
27864
27861
  _this.freeEvent(clickEvent);
@@ -29102,13 +29099,11 @@
29102
29099
  _proto.measureText = function measureText(text, parsedStyle, offscreenCanvas) {
29103
29100
  var fontSize = parsedStyle.fontSize,
29104
29101
  wordWrap = parsedStyle.wordWrap,
29105
- _parsedStyle$lineHeig = parsedStyle.lineHeight,
29106
- strokeHeight = _parsedStyle$lineHeig === void 0 ? 0 : _parsedStyle$lineHeig,
29102
+ strokeHeight = parsedStyle.lineHeight,
29107
29103
  lineWidth = parsedStyle.lineWidth,
29108
29104
  textBaseline = parsedStyle.textBaseline,
29109
29105
  textAlign = parsedStyle.textAlign,
29110
- _parsedStyle$letterSp = parsedStyle.letterSpacing,
29111
- letterSpacing = _parsedStyle$letterSp === void 0 ? 0 : _parsedStyle$letterSp,
29106
+ letterSpacing = parsedStyle.letterSpacing,
29112
29107
  _parsedStyle$leading = parsedStyle.leading,
29113
29108
  leading = _parsedStyle$leading === void 0 ? 0 : _parsedStyle$leading;
29114
29109
  var font = toFontString(parsedStyle);
@@ -29128,7 +29123,7 @@
29128
29123
  var maxLineWidth = 0;
29129
29124
 
29130
29125
  for (var i = 0; i < lines.length; i++) {
29131
- var _lineWidth = context.measureText(lines[i]).width + (lines[i].length - 1) * letterSpacing;
29126
+ var _lineWidth = context.measureText(lines[i]).width + (lines[i].length - 1) * letterSpacing.value;
29132
29127
 
29133
29128
  lineWidths[i] = _lineWidth;
29134
29129
  maxLineWidth = Math.max(maxLineWidth, _lineWidth);
@@ -29138,7 +29133,7 @@
29138
29133
  // width += dropShadowDistance;
29139
29134
  // }
29140
29135
 
29141
- var lineHeight = strokeHeight || fontProperties.fontSize + lineWidth.value;
29136
+ var lineHeight = strokeHeight.value || fontProperties.fontSize + lineWidth.value;
29142
29137
  var height = Math.max(lineHeight, fontProperties.fontSize + lineWidth.value) + (lines.length - 1) * (lineHeight + leading); // if (dropShadow) {
29143
29138
  // height += dropShadowDistance;
29144
29139
  // }
@@ -29183,17 +29178,16 @@
29183
29178
 
29184
29179
  var _ref$wordWrapWidth = _ref.wordWrapWidth,
29185
29180
  wordWrapWidth = _ref$wordWrapWidth === void 0 ? 0 : _ref$wordWrapWidth,
29186
- _ref$letterSpacing = _ref.letterSpacing,
29187
- letterSpacing = _ref$letterSpacing === void 0 ? 0 : _ref$letterSpacing;
29181
+ letterSpacing = _ref.letterSpacing;
29188
29182
  var context = this.offscreenCanvas.getOrCreateContext(offscreenCanvas);
29189
- var maxWidth = wordWrapWidth + letterSpacing;
29183
+ var maxWidth = wordWrapWidth + letterSpacing.value;
29190
29184
  var lines = [];
29191
29185
  var currentIndex = 0;
29192
29186
  var currentWidth = 0;
29193
29187
  var cache = {};
29194
29188
 
29195
29189
  var calcWidth = function calcWidth(char) {
29196
- return _this2.getFromCache(char, letterSpacing, cache, context);
29190
+ return _this2.getFromCache(char, letterSpacing.value, cache, context);
29197
29191
  };
29198
29192
 
29199
29193
  Array.from(text).forEach(function (char, i) {
@@ -29778,7 +29772,7 @@
29778
29772
  return fontSize.clone();
29779
29773
  }
29780
29774
 
29781
- return new CSSUnitValue(0, 'px');
29775
+ return null;
29782
29776
  }
29783
29777
  /**
29784
29778
  * <length> & <percentage>
@@ -29806,8 +29800,13 @@
29806
29800
  } else if (computed.unit === exports.UnitType.kEms) {
29807
29801
  if (object.parentNode) {
29808
29802
  var fontSize = getFontSize(object.parentNode);
29809
- fontSize.value *= computed.value;
29810
- return fontSize;
29803
+
29804
+ if (fontSize) {
29805
+ fontSize.value *= computed.value;
29806
+ return fontSize;
29807
+ } else {
29808
+ registry.addUnresolveProperty(object, name);
29809
+ }
29811
29810
  }
29812
29811
 
29813
29812
  return new CSSUnitValue(0, 'px');
@@ -29817,8 +29816,12 @@
29817
29816
  if (object === null || object === void 0 ? void 0 : (_object$ownerDocument = object.ownerDocument) === null || _object$ownerDocument === void 0 ? void 0 : _object$ownerDocument.documentElement) {
29818
29817
  var _fontSize = getFontSize(object.ownerDocument.documentElement);
29819
29818
 
29820
- _fontSize.value *= computed.value;
29821
- return _fontSize;
29819
+ if (_fontSize) {
29820
+ _fontSize.value *= computed.value;
29821
+ return _fontSize;
29822
+ } else {
29823
+ registry.addUnresolveProperty(object, name);
29824
+ }
29822
29825
  }
29823
29826
 
29824
29827
  return new CSSUnitValue(0, 'px');
@@ -29977,7 +29980,11 @@
29977
29980
  z = 0;
29978
29981
  break;
29979
29982
 
29980
- default:
29983
+ case exports.Shape.RECT:
29984
+ case exports.Shape.IMAGE:
29985
+ case exports.Shape.GROUP:
29986
+ case exports.Shape.HTML:
29987
+ case exports.Shape.TEXT:
29981
29988
  if (!isNil(object.parsedStyle.x)) {
29982
29989
  x = object.parsedStyle.x.value;
29983
29990
  }
@@ -29989,15 +29996,21 @@
29989
29996
  break;
29990
29997
  }
29991
29998
 
29992
- object.parsedStyle.defX = x || 0;
29993
- object.parsedStyle.defY = y || 0;
29999
+ if (object.nodeName !== exports.Shape.PATH && object.nodeName !== exports.Shape.POLYLINE && object.nodeName !== exports.Shape.POLYGON) {
30000
+ object.parsedStyle.defX = x || 0;
30001
+ object.parsedStyle.defY = y || 0;
30002
+ }
30003
+
30004
+ var needResetLocalPosition = !isNil(x) || !isNil(y) || !isNil(z);
29994
30005
 
29995
- var _object$getLocalPosit = object.getLocalPosition(),
29996
- ox = _object$getLocalPosit[0],
29997
- oy = _object$getLocalPosit[1],
29998
- oz = _object$getLocalPosit[2];
30006
+ if (needResetLocalPosition) {
30007
+ var _object$getLocalPosit = object.getLocalPosition(),
30008
+ ox = _object$getLocalPosit[0],
30009
+ oy = _object$getLocalPosit[1],
30010
+ oz = _object$getLocalPosit[2];
29999
30011
 
30000
- object.setLocalPosition(isNil(x) ? ox : x, isNil(y) ? oy : y, isNil(z) ? oz : z);
30012
+ object.setLocalPosition(isNil(x) ? ox : x, isNil(y) ? oy : y, isNil(z) ? oz : z);
30013
+ }
30001
30014
  };
30002
30015
 
30003
30016
  return CSSPropertyLocalPosition;
@@ -30564,6 +30577,11 @@
30564
30577
  keywords: ['none'],
30565
30578
  defaultValue: 'none',
30566
30579
  syntax: exports.PropertySyntax.PAINT
30580
+ }, {
30581
+ name: 'shadowType',
30582
+ keywords: ['inner', 'outer', 'both'],
30583
+ defaultValue: 'outer',
30584
+ layoutDependent: true
30567
30585
  }, {
30568
30586
  name: 'shadowColor',
30569
30587
  interpolable: true,
@@ -30700,6 +30718,10 @@
30700
30718
  return 'center';
30701
30719
  }
30702
30720
 
30721
+ if (nodeName === exports.Shape.TEXT) {
30722
+ return 'text-anchor';
30723
+ }
30724
+
30703
30725
  return 'left top';
30704
30726
  },
30705
30727
  layoutDependent: true,
@@ -30830,12 +30852,14 @@
30830
30852
  layoutDependent: true,
30831
30853
  defaultValue: '',
30832
30854
  alias: ['d'],
30833
- syntax: exports.PropertySyntax.PATH
30855
+ syntax: exports.PropertySyntax.PATH,
30856
+ parsePriority: 50
30834
30857
  }, // Polyline & Polygon
30835
30858
  {
30836
30859
  name: 'points',
30837
30860
  layoutDependent: true,
30838
- syntax: exports.PropertySyntax.LIST_OF_POINTS
30861
+ syntax: exports.PropertySyntax.LIST_OF_POINTS,
30862
+ parsePriority: 50
30839
30863
  }, // Text
30840
30864
  {
30841
30865
  name: 'text',
@@ -30891,16 +30915,27 @@
30891
30915
  defaultValue: 'normal'
30892
30916
  }, {
30893
30917
  name: 'lineHeight',
30894
- layoutDependent: true // interpolable: true,
30895
- // inherited: true,
30896
- // defaultValue: '-100%'
30897
-
30918
+ layoutDependent: true,
30919
+ syntax: exports.PropertySyntax.LENGTH,
30920
+ interpolable: true,
30921
+ defaultValue: '0'
30898
30922
  }, {
30899
30923
  name: 'letterSpacing',
30900
- layoutDependent: true // interpolable: true,
30901
- // inherited: true,
30902
- // defaultValue: '0',
30924
+ layoutDependent: true,
30925
+ syntax: exports.PropertySyntax.LENGTH,
30926
+ interpolable: true,
30927
+ defaultValue: '0'
30928
+ }, {
30929
+ name: 'miterLimit',
30930
+ layoutDependent: true,
30931
+ syntax: exports.PropertySyntax.NUMBER,
30932
+ defaultValue: function defaultValue(nodeName) {
30933
+ if (nodeName === exports.Shape.PATH || nodeName === exports.Shape.POLYGON || nodeName === exports.Shape.POLYLINE) {
30934
+ return '4';
30935
+ }
30903
30936
 
30937
+ return '10';
30938
+ }
30904
30939
  }, {
30905
30940
  name: 'wordWrap',
30906
30941
  layoutDependent: true
@@ -31296,6 +31331,7 @@
31296
31331
  var stroke = parsedStyle.stroke,
31297
31332
  lineWidth = parsedStyle.lineWidth,
31298
31333
  increasedLineWidthForHitTesting = parsedStyle.increasedLineWidthForHitTesting,
31334
+ shadowType = parsedStyle.shadowType,
31299
31335
  shadowColor = parsedStyle.shadowColor,
31300
31336
  _parsedStyle$filter = parsedStyle.filter,
31301
31337
  filter = _parsedStyle$filter === void 0 ? [] : _parsedStyle$filter,
@@ -31327,7 +31363,7 @@
31327
31363
 
31328
31364
  geometry.renderBounds.update(center, halfExtents); // account for shadow, only support constant value now
31329
31365
 
31330
- if (shadowColor) {
31366
+ if (shadowColor && (shadowType === null || shadowType === void 0 ? void 0 : shadowType.value) !== 'inner') {
31331
31367
  var _geometry$renderBound = geometry.renderBounds,
31332
31368
  min = _geometry$renderBound.min,
31333
31369
  max = _geometry$renderBound.max;
@@ -31579,6 +31615,9 @@
31579
31615
  });
31580
31616
  });
31581
31617
 
31618
+ var AbstractRendererPlugin = function AbstractRendererPlugin() {
31619
+ this.container = void 0;
31620
+ };
31582
31621
  var AbstractRenderer = /*#__PURE__*/function () {
31583
31622
  function AbstractRenderer(config) {
31584
31623
  this.plugins = [];
@@ -31689,9 +31728,8 @@
31689
31728
  if (!cullable.isCulled() && object.isVisible()) {
31690
31729
  return object;
31691
31730
  } else {
31692
- if (_this.renderingContext.renderListLastFrame.indexOf(object) > -1) {
31693
- object.dispatchEvent(new CustomEvent(exports.ElementEvent.CULLED));
31694
- }
31731
+ // if (this.renderingContext.renderListLastFrame.indexOf(object) > -1) {
31732
+ object.dispatchEvent(new CustomEvent(exports.ElementEvent.CULLED)); // }
31695
31733
  }
31696
31734
 
31697
31735
  return null;
@@ -31888,9 +31926,7 @@
31888
31926
  renderingService.hooks.pointerOut.tap(EventPlugin_1.tag, this.onPointerMove);
31889
31927
  };
31890
31928
 
31891
- _proto.bootstrapEvent = function bootstrapEvent(e, nativeEvent, view) {
31892
- e.pointerType = nativeEvent.pointerType;
31893
- var event = e;
31929
+ _proto.bootstrapEvent = function bootstrapEvent(event, nativeEvent, view) {
31894
31930
  event.view = view;
31895
31931
  event.originalEvent = null;
31896
31932
  event.nativeEvent = nativeEvent;
@@ -31898,6 +31934,7 @@
31898
31934
  event.width = nativeEvent.width;
31899
31935
  event.height = nativeEvent.height;
31900
31936
  event.isPrimary = nativeEvent.isPrimary;
31937
+ event.pointerType = nativeEvent.pointerType;
31901
31938
  event.pressure = nativeEvent.pressure;
31902
31939
  event.tangentialPressure = nativeEvent.tangentialPressure;
31903
31940
  event.tiltX = nativeEvent.tiltX;
@@ -31971,6 +32008,7 @@
31971
32008
 
31972
32009
  _proto.transferMouseData = function transferMouseData(event, nativeEvent) {
31973
32010
  event.isTrusted = nativeEvent.isTrusted;
32011
+ event.srcElement = nativeEvent.srcElement;
31974
32012
  event.timeStamp = performance.now();
31975
32013
  event.type = nativeEvent.type;
31976
32014
  event.altKey = nativeEvent.altKey;
@@ -32002,8 +32040,8 @@
32002
32040
  var touch = event.changedTouches[i]; // use changedTouches instead of touches since touchend has no touches
32003
32041
  // @see https://stackoverflow.com/a/10079076
32004
32042
 
32005
- if (isUndefined(touch.button)) touch.button = event.touches.length ? 1 : 0;
32006
- if (isUndefined(touch.buttons)) touch.buttons = event.touches.length ? 1 : 0;
32043
+ if (isUndefined(touch.button)) touch.button = 0;
32044
+ if (isUndefined(touch.buttons)) touch.buttons = 1;
32007
32045
 
32008
32046
  if (isUndefined(touch.isPrimary)) {
32009
32047
  touch.isPrimary = event.touches.length === 1 && event.type === 'touchstart';
@@ -32564,7 +32602,6 @@
32564
32602
  * the root node in scene graph
32565
32603
  */
32566
32604
  root: this.document.documentElement,
32567
- renderListLastFrame: [],
32568
32605
  renderListCurrentFrame: [],
32569
32606
  unculledEntities: [],
32570
32607
  renderReasons: new Set(),
@@ -32845,14 +32882,13 @@
32845
32882
  // load other container modules provided by g-canvas/g-svg/g-webgl
32846
32883
  var plugins = renderer.getPlugins();
32847
32884
  plugins.forEach(function (plugin) {
32848
- plugin.init(_this4.container);
32885
+ plugin.container = _this4.container;
32886
+ plugin.init();
32849
32887
  });
32850
32888
  };
32851
32889
 
32852
32890
  _proto.setRenderer = /*#__PURE__*/function () {
32853
32891
  var _setRenderer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(renderer) {
32854
- var _this5 = this;
32855
-
32856
32892
  var canvasConfig, oldRenderer;
32857
32893
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
32858
32894
  while (1) {
@@ -32875,7 +32911,7 @@
32875
32911
  this.destroy(false, true); // destroy all plugins, reverse will mutate origin array
32876
32912
 
32877
32913
  [].concat(oldRenderer === null || oldRenderer === void 0 ? void 0 : oldRenderer.getPlugins()).reverse().forEach(function (plugin) {
32878
- plugin.destroy(_this5.container);
32914
+ plugin.destroy();
32879
32915
  });
32880
32916
  _context3.next = 9;
32881
32917
  return this.initRenderer(renderer);
@@ -32900,7 +32936,7 @@
32900
32936
  };
32901
32937
 
32902
32938
  _proto.unmountChildren = function unmountChildren(parent) {
32903
- var _this6 = this;
32939
+ var _this5 = this;
32904
32940
 
32905
32941
  if (this.inited) {
32906
32942
  var path = [];
@@ -32920,7 +32956,7 @@
32920
32956
 
32921
32957
  child.dispatchEvent(new CustomEvent(exports.ElementEvent.UNMOUNTED)); // skip document.documentElement
32922
32958
 
32923
- if (child !== _this6.document.documentElement) {
32959
+ if (child !== _this5.document.documentElement) {
32924
32960
  child.ownerDocument = null;
32925
32961
  }
32926
32962
 
@@ -32930,12 +32966,12 @@
32930
32966
  };
32931
32967
 
32932
32968
  _proto.mountChildren = function mountChildren(parent) {
32933
- var _this7 = this;
32969
+ var _this6 = this;
32934
32970
 
32935
32971
  if (this.inited) {
32936
32972
  parent.forEach(function (child) {
32937
32973
  if (!child.isConnected) {
32938
- child.ownerDocument = _this7.document;
32974
+ child.ownerDocument = _this6.document;
32939
32975
  child.isConnected = true;
32940
32976
  child.dispatchEvent(new CustomEvent(exports.ElementEvent.MOUNTED)); // trigger after mounted
32941
32977
 
@@ -32994,12 +33030,12 @@
32994
33030
  _createClass$5(Canvas, [{
32995
33031
  key: "ready",
32996
33032
  get: function get() {
32997
- var _this8 = this;
33033
+ var _this7 = this;
32998
33034
 
32999
33035
  if (!this.readyPromise) {
33000
33036
  this.readyPromise = new Promise(function (resolve) {
33001
- _this8.resolveReadyPromise = function () {
33002
- resolve(_this8);
33037
+ _this7.resolveReadyPromise = function () {
33038
+ resolve(_this7);
33003
33039
  };
33004
33040
  });
33005
33041
 
@@ -33015,13 +33051,13 @@
33015
33051
  return Canvas;
33016
33052
  }(EventTarget);
33017
33053
 
33018
- // import * as ManaSyringe from 'mana-syringe';
33019
33054
  GlobalContainer$1.load(containerModule);
33020
33055
  var layoutEngine = GlobalContainer$1.get(exports.LayoutEngine);
33021
33056
 
33022
33057
  exports.AABB = AABB;
33023
33058
  exports.AbstractLayoutDefinition = AbstractLayoutDefinition;
33024
33059
  exports.AbstractRenderer = AbstractRenderer;
33060
+ exports.AbstractRendererPlugin = AbstractRendererPlugin;
33025
33061
  exports.Animation = Animation;
33026
33062
  exports.AnimationEffectTiming = AnimationEffectTiming;
33027
33063
  exports.AnimationEvent = AnimationEvent;