@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.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,
@@ -18483,11 +18484,13 @@
18483
18484
  * @param {number} y2 结束点 y
18484
18485
  * @return {number} 距离
18485
18486
  */
18487
+
18486
18488
  function distance$1(x1, y1, x2, y2) {
18487
18489
  var dx = x1 - x2;
18488
18490
  var dy = y1 - y2;
18489
18491
  return Math.sqrt(dx * dx + dy * dy);
18490
18492
  }
18493
+
18491
18494
  function getBBoxByArray(xArr, yArr) {
18492
18495
  var minX = Math.min.apply(Math, xArr);
18493
18496
  var minY = Math.min.apply(Math, yArr);
@@ -18500,7 +18503,6 @@
18500
18503
  height: maxY - minY
18501
18504
  };
18502
18505
  }
18503
-
18504
18506
  var line = {
18505
18507
  /**
18506
18508
  * 计算线段的包围盒
@@ -18652,6 +18654,7 @@
18652
18654
  * @return {object} 点的坐标
18653
18655
  */
18654
18656
 
18657
+
18655
18658
  function pointAtSegments(points, t) {
18656
18659
  // 边界判断
18657
18660
  if (t > 1 || t < 0 || points.length < 2) {
@@ -18697,6 +18700,7 @@
18697
18700
  * @param {number} t 百分比 0-1
18698
18701
  */
18699
18702
 
18703
+
18700
18704
  function angleAtSegments(points, t) {
18701
18705
  // 边界判断
18702
18706
  if (t > 1 || t < 0 || points.length < 2) {
@@ -18727,6 +18731,7 @@
18727
18731
 
18728
18732
  return angle;
18729
18733
  }
18734
+
18730
18735
  function distanceAtSegment(points, x, y) {
18731
18736
  var minDistance = Infinity;
18732
18737
 
@@ -20051,6 +20056,10 @@
20051
20056
 
20052
20057
  function parseTransformOrigin(value) {
20053
20058
  if (isString(value)) {
20059
+ if (value === 'text-anchor') {
20060
+ return [new CSSUnitValue(0, 'px'), new CSSUnitValue(0, 'px')];
20061
+ }
20062
+
20054
20063
  var values = value.split(' ');
20055
20064
 
20056
20065
  if (values.length === 1) {
@@ -21604,7 +21613,8 @@
21604
21613
  textBaseline: '',
21605
21614
  textTransform: '',
21606
21615
  zIndex: '',
21607
- filter: ''
21616
+ filter: '',
21617
+ shadowType: ''
21608
21618
  };
21609
21619
  /**
21610
21620
  * prototype chains: DisplayObject -> Element -> Node -> EventTarget
@@ -22694,7 +22704,7 @@
22694
22704
  type: exports.Shape.PATH,
22695
22705
  style: _extends({
22696
22706
  path: '',
22697
- miterLimit: 4
22707
+ miterLimit: ''
22698
22708
  }, style)
22699
22709
  }, rest)) || this;
22700
22710
  }
@@ -22795,7 +22805,7 @@
22795
22805
  type: exports.Shape.POLYGON,
22796
22806
  style: _extends({
22797
22807
  points: '',
22798
- miterLimit: 4
22808
+ miterLimit: ''
22799
22809
  }, style)
22800
22810
  }, rest)) || this;
22801
22811
  }
@@ -22816,7 +22826,7 @@
22816
22826
  type: exports.Shape.POLYLINE,
22817
22827
  style: _extends({
22818
22828
  points: '',
22819
- miterLimit: 4
22829
+ miterLimit: ''
22820
22830
  }, style)
22821
22831
  }, rest)) || this;
22822
22832
  }
@@ -22907,14 +22917,15 @@
22907
22917
  /**
22908
22918
  * @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement#constants
22909
22919
  */
22920
+ // LENGTHADJUST_SPACING: number = 1;
22921
+ // LENGTHADJUST_SPACINGANDGLYPHS: number = 2;
22922
+ // LENGTHADJUST_UNKNOWN: number = 0;
22910
22923
  function Text(_temp) {
22911
- var _this;
22912
-
22913
22924
  var _ref = _temp === void 0 ? {} : _temp,
22914
22925
  style = _ref.style,
22915
22926
  rest = _objectWithoutPropertiesLoose(_ref, _excluded$a);
22916
22927
 
22917
- _this = _DisplayObject.call(this, _extends({
22928
+ return _DisplayObject.call(this, _extends({
22918
22929
  type: exports.Shape.TEXT,
22919
22930
  style: _extends({
22920
22931
  x: '',
@@ -22928,17 +22939,10 @@
22928
22939
  textAlign: '',
22929
22940
  textBaseline: '',
22930
22941
  textTransform: '',
22931
- // dropShadow: false,
22932
- // dropShadowAlpha: 1,
22933
- // dropShadowAngle: Math.PI / 6,
22934
- // dropShadowBlur: 0,
22935
- // dropShadowColor: '#000',
22936
- // dropShadowDistance: 5,
22937
22942
  fill: 'black',
22938
- // stroke: 'black',
22939
- letterSpacing: 0,
22940
- lineHeight: 0,
22941
- miterLimit: 10,
22943
+ letterSpacing: '',
22944
+ lineHeight: '',
22945
+ miterLimit: '',
22942
22946
  whiteSpace: 'pre',
22943
22947
  wordWrap: false,
22944
22948
  wordWrapWidth: 0,
@@ -22947,57 +22951,45 @@
22947
22951
  dy: ''
22948
22952
  }, style)
22949
22953
  }, rest)) || this;
22950
- _this.LENGTHADJUST_SPACING = 1;
22951
- _this.LENGTHADJUST_SPACINGANDGLYPHS = 2;
22952
- _this.LENGTHADJUST_UNKNOWN = 0;
22953
- _this.lengthAdjust = void 0;
22954
- _this.textLength = void 0;
22955
- return _this;
22956
- }
22957
-
22958
- var _proto = Text.prototype;
22954
+ } // lengthAdjust: SVGAnimatedEnumeration;
22955
+ // textLength: SVGAnimatedLength;
22956
+ // getCharNumAtPosition(point?: DOMPointInit): number {
22957
+ // throw new Error('Method not implemented.');
22958
+ // }
22959
22959
 
22960
- _proto.getCharNumAtPosition = function getCharNumAtPosition(point) {
22961
- throw new Error('Method not implemented.');
22962
- }
22963
22960
  /**
22964
22961
  * @see https://developer.mozilla.org/en-US/docs/Web/API/SVGTextContentElement
22965
22962
  */
22966
- ;
22963
+
22964
+
22965
+ var _proto = Text.prototype;
22967
22966
 
22968
22967
  _proto.getComputedTextLength = function getComputedTextLength() {
22969
22968
  var _this$parsedStyle$met;
22970
22969
 
22971
22970
  return ((_this$parsedStyle$met = this.parsedStyle.metrics) === null || _this$parsedStyle$met === void 0 ? void 0 : _this$parsedStyle$met.maxLineWidth) || 0;
22972
- };
22973
-
22974
- _proto.getEndPositionOfChar = function getEndPositionOfChar(charnum) {
22975
- throw new Error('Method not implemented.');
22976
- };
22977
-
22978
- _proto.getExtentOfChar = function getExtentOfChar(charnum) {
22979
- throw new Error('Method not implemented.');
22980
- };
22981
-
22982
- _proto.getNumberOfChars = function getNumberOfChars() {
22983
- throw new Error('Method not implemented.');
22984
- };
22985
-
22986
- _proto.getRotationOfChar = function getRotationOfChar(charnum) {
22987
- throw new Error('Method not implemented.');
22988
- };
22989
-
22990
- _proto.getStartPositionOfChar = function getStartPositionOfChar(charnum) {
22991
- throw new Error('Method not implemented.');
22992
- };
22993
-
22994
- _proto.getSubStringLength = function getSubStringLength(charnum, nchars) {
22995
- throw new Error('Method not implemented.');
22996
- };
22997
-
22998
- _proto.selectSubString = function selectSubString(charnum, nchars) {
22999
- throw new Error('Method not implemented.');
23000
- };
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
+ ;
23001
22993
 
23002
22994
  _proto.getLineBoundingRects = function getLineBoundingRects() {
23003
22995
  var _this$parsedStyle$met2;
@@ -23939,7 +23931,9 @@
23939
23931
  clazz = tagName === 'tspan' ? Text : Group;
23940
23932
  }
23941
23933
 
23942
- return new clazz(options);
23934
+ var shape = new clazz(options);
23935
+ shape.ownerDocument = this;
23936
+ return shape;
23943
23937
  };
23944
23938
 
23945
23939
  _proto.createElementNS = function createElementNS(namespaceURI, tagName, options) {
@@ -24246,6 +24240,16 @@
24246
24240
  get: function get() {
24247
24241
  return this.client.y;
24248
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
+ }
24249
24253
  /**
24250
24254
  * The movement in this pointer relative to the last `mousemove` event.
24251
24255
  */
@@ -27589,20 +27593,15 @@
27589
27593
 
27590
27594
  if (this.renderingContext.renderReasons.size && this.inited) {
27591
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);
27592
27599
 
27593
- if (this.renderingContext.renderListCurrentFrame.length || this.renderingContext.renderListLastFrame.length !== this.renderingContext.renderListCurrentFrame.length) {
27594
- this.hooks.beginFrame.call();
27595
- this.renderingContext.renderListCurrentFrame.forEach(function (object) {
27596
- _this2.hooks.beforeRender.call(object);
27597
-
27598
- _this2.hooks.render.call(object);
27599
-
27600
- _this2.hooks.afterRender.call(object);
27601
- });
27602
- this.hooks.endFrame.call();
27603
- }
27600
+ _this2.hooks.render.call(object);
27604
27601
 
27605
- this.renderingContext.renderListLastFrame = [].concat(this.renderingContext.renderListCurrentFrame);
27602
+ _this2.hooks.afterRender.call(object);
27603
+ });
27604
+ this.hooks.endFrame.call();
27606
27605
  this.renderingContext.renderListCurrentFrame = [];
27607
27606
  this.renderingContext.renderReasons.clear();
27608
27607
  } // console.log('stats', this.stats);
@@ -27763,7 +27762,7 @@
27763
27762
 
27764
27763
  _this.onPointerUp = /*#__PURE__*/function () {
27765
27764
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(from) {
27766
- 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;
27767
27766
 
27768
27767
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
27769
27768
  while (1) {
@@ -27849,12 +27848,14 @@
27849
27848
 
27850
27849
  clickHistory.target = clickEvent.target;
27851
27850
  clickHistory.timeStamp = now;
27852
- clickEvent.detail = clickHistory.clickCount;
27851
+ clickEvent.detail = clickHistory.clickCount; // @see https://github.com/antvis/G/issues/1091
27853
27852
 
27854
- if (clickEvent.pointerType === 'mouse' || clickEvent.pointerType === 'touch') {
27855
- _this.dispatchEvent(clickEvent, 'click');
27856
- } else {
27857
- _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
+ }
27858
27859
  }
27859
27860
 
27860
27861
  _this.freeEvent(clickEvent);
@@ -29098,13 +29099,11 @@
29098
29099
  _proto.measureText = function measureText(text, parsedStyle, offscreenCanvas) {
29099
29100
  var fontSize = parsedStyle.fontSize,
29100
29101
  wordWrap = parsedStyle.wordWrap,
29101
- _parsedStyle$lineHeig = parsedStyle.lineHeight,
29102
- strokeHeight = _parsedStyle$lineHeig === void 0 ? 0 : _parsedStyle$lineHeig,
29102
+ strokeHeight = parsedStyle.lineHeight,
29103
29103
  lineWidth = parsedStyle.lineWidth,
29104
29104
  textBaseline = parsedStyle.textBaseline,
29105
29105
  textAlign = parsedStyle.textAlign,
29106
- _parsedStyle$letterSp = parsedStyle.letterSpacing,
29107
- letterSpacing = _parsedStyle$letterSp === void 0 ? 0 : _parsedStyle$letterSp,
29106
+ letterSpacing = parsedStyle.letterSpacing,
29108
29107
  _parsedStyle$leading = parsedStyle.leading,
29109
29108
  leading = _parsedStyle$leading === void 0 ? 0 : _parsedStyle$leading;
29110
29109
  var font = toFontString(parsedStyle);
@@ -29124,7 +29123,7 @@
29124
29123
  var maxLineWidth = 0;
29125
29124
 
29126
29125
  for (var i = 0; i < lines.length; i++) {
29127
- 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;
29128
29127
 
29129
29128
  lineWidths[i] = _lineWidth;
29130
29129
  maxLineWidth = Math.max(maxLineWidth, _lineWidth);
@@ -29134,7 +29133,7 @@
29134
29133
  // width += dropShadowDistance;
29135
29134
  // }
29136
29135
 
29137
- var lineHeight = strokeHeight || fontProperties.fontSize + lineWidth.value;
29136
+ var lineHeight = strokeHeight.value || fontProperties.fontSize + lineWidth.value;
29138
29137
  var height = Math.max(lineHeight, fontProperties.fontSize + lineWidth.value) + (lines.length - 1) * (lineHeight + leading); // if (dropShadow) {
29139
29138
  // height += dropShadowDistance;
29140
29139
  // }
@@ -29179,17 +29178,16 @@
29179
29178
 
29180
29179
  var _ref$wordWrapWidth = _ref.wordWrapWidth,
29181
29180
  wordWrapWidth = _ref$wordWrapWidth === void 0 ? 0 : _ref$wordWrapWidth,
29182
- _ref$letterSpacing = _ref.letterSpacing,
29183
- letterSpacing = _ref$letterSpacing === void 0 ? 0 : _ref$letterSpacing;
29181
+ letterSpacing = _ref.letterSpacing;
29184
29182
  var context = this.offscreenCanvas.getOrCreateContext(offscreenCanvas);
29185
- var maxWidth = wordWrapWidth + letterSpacing;
29183
+ var maxWidth = wordWrapWidth + letterSpacing.value;
29186
29184
  var lines = [];
29187
29185
  var currentIndex = 0;
29188
29186
  var currentWidth = 0;
29189
29187
  var cache = {};
29190
29188
 
29191
29189
  var calcWidth = function calcWidth(char) {
29192
- return _this2.getFromCache(char, letterSpacing, cache, context);
29190
+ return _this2.getFromCache(char, letterSpacing.value, cache, context);
29193
29191
  };
29194
29192
 
29195
29193
  Array.from(text).forEach(function (char, i) {
@@ -29774,7 +29772,7 @@
29774
29772
  return fontSize.clone();
29775
29773
  }
29776
29774
 
29777
- return new CSSUnitValue(0, 'px');
29775
+ return null;
29778
29776
  }
29779
29777
  /**
29780
29778
  * <length> & <percentage>
@@ -29802,8 +29800,13 @@
29802
29800
  } else if (computed.unit === exports.UnitType.kEms) {
29803
29801
  if (object.parentNode) {
29804
29802
  var fontSize = getFontSize(object.parentNode);
29805
- fontSize.value *= computed.value;
29806
- return fontSize;
29803
+
29804
+ if (fontSize) {
29805
+ fontSize.value *= computed.value;
29806
+ return fontSize;
29807
+ } else {
29808
+ registry.addUnresolveProperty(object, name);
29809
+ }
29807
29810
  }
29808
29811
 
29809
29812
  return new CSSUnitValue(0, 'px');
@@ -29813,8 +29816,12 @@
29813
29816
  if (object === null || object === void 0 ? void 0 : (_object$ownerDocument = object.ownerDocument) === null || _object$ownerDocument === void 0 ? void 0 : _object$ownerDocument.documentElement) {
29814
29817
  var _fontSize = getFontSize(object.ownerDocument.documentElement);
29815
29818
 
29816
- _fontSize.value *= computed.value;
29817
- return _fontSize;
29819
+ if (_fontSize) {
29820
+ _fontSize.value *= computed.value;
29821
+ return _fontSize;
29822
+ } else {
29823
+ registry.addUnresolveProperty(object, name);
29824
+ }
29818
29825
  }
29819
29826
 
29820
29827
  return new CSSUnitValue(0, 'px');
@@ -29973,7 +29980,11 @@
29973
29980
  z = 0;
29974
29981
  break;
29975
29982
 
29976
- 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:
29977
29988
  if (!isNil(object.parsedStyle.x)) {
29978
29989
  x = object.parsedStyle.x.value;
29979
29990
  }
@@ -29985,15 +29996,21 @@
29985
29996
  break;
29986
29997
  }
29987
29998
 
29988
- object.parsedStyle.defX = x || 0;
29989
- 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);
29990
30005
 
29991
- var _object$getLocalPosit = object.getLocalPosition(),
29992
- ox = _object$getLocalPosit[0],
29993
- oy = _object$getLocalPosit[1],
29994
- 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];
29995
30011
 
29996
- 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
+ }
29997
30014
  };
29998
30015
 
29999
30016
  return CSSPropertyLocalPosition;
@@ -30560,6 +30577,11 @@
30560
30577
  keywords: ['none'],
30561
30578
  defaultValue: 'none',
30562
30579
  syntax: exports.PropertySyntax.PAINT
30580
+ }, {
30581
+ name: 'shadowType',
30582
+ keywords: ['inner', 'outer', 'both'],
30583
+ defaultValue: 'outer',
30584
+ layoutDependent: true
30563
30585
  }, {
30564
30586
  name: 'shadowColor',
30565
30587
  interpolable: true,
@@ -30696,6 +30718,10 @@
30696
30718
  return 'center';
30697
30719
  }
30698
30720
 
30721
+ if (nodeName === exports.Shape.TEXT) {
30722
+ return 'text-anchor';
30723
+ }
30724
+
30699
30725
  return 'left top';
30700
30726
  },
30701
30727
  layoutDependent: true,
@@ -30826,12 +30852,14 @@
30826
30852
  layoutDependent: true,
30827
30853
  defaultValue: '',
30828
30854
  alias: ['d'],
30829
- syntax: exports.PropertySyntax.PATH
30855
+ syntax: exports.PropertySyntax.PATH,
30856
+ parsePriority: 50
30830
30857
  }, // Polyline & Polygon
30831
30858
  {
30832
30859
  name: 'points',
30833
30860
  layoutDependent: true,
30834
- syntax: exports.PropertySyntax.LIST_OF_POINTS
30861
+ syntax: exports.PropertySyntax.LIST_OF_POINTS,
30862
+ parsePriority: 50
30835
30863
  }, // Text
30836
30864
  {
30837
30865
  name: 'text',
@@ -30887,16 +30915,27 @@
30887
30915
  defaultValue: 'normal'
30888
30916
  }, {
30889
30917
  name: 'lineHeight',
30890
- layoutDependent: true // interpolable: true,
30891
- // inherited: true,
30892
- // defaultValue: '-100%'
30893
-
30918
+ layoutDependent: true,
30919
+ syntax: exports.PropertySyntax.LENGTH,
30920
+ interpolable: true,
30921
+ defaultValue: '0'
30894
30922
  }, {
30895
30923
  name: 'letterSpacing',
30896
- layoutDependent: true // interpolable: true,
30897
- // inherited: true,
30898
- // 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
+ }
30899
30936
 
30937
+ return '10';
30938
+ }
30900
30939
  }, {
30901
30940
  name: 'wordWrap',
30902
30941
  layoutDependent: true
@@ -31292,6 +31331,7 @@
31292
31331
  var stroke = parsedStyle.stroke,
31293
31332
  lineWidth = parsedStyle.lineWidth,
31294
31333
  increasedLineWidthForHitTesting = parsedStyle.increasedLineWidthForHitTesting,
31334
+ shadowType = parsedStyle.shadowType,
31295
31335
  shadowColor = parsedStyle.shadowColor,
31296
31336
  _parsedStyle$filter = parsedStyle.filter,
31297
31337
  filter = _parsedStyle$filter === void 0 ? [] : _parsedStyle$filter,
@@ -31323,7 +31363,7 @@
31323
31363
 
31324
31364
  geometry.renderBounds.update(center, halfExtents); // account for shadow, only support constant value now
31325
31365
 
31326
- if (shadowColor) {
31366
+ if (shadowColor && (shadowType === null || shadowType === void 0 ? void 0 : shadowType.value) !== 'inner') {
31327
31367
  var _geometry$renderBound = geometry.renderBounds,
31328
31368
  min = _geometry$renderBound.min,
31329
31369
  max = _geometry$renderBound.max;
@@ -31688,9 +31728,8 @@
31688
31728
  if (!cullable.isCulled() && object.isVisible()) {
31689
31729
  return object;
31690
31730
  } else {
31691
- if (_this.renderingContext.renderListLastFrame.indexOf(object) > -1) {
31692
- object.dispatchEvent(new CustomEvent(exports.ElementEvent.CULLED));
31693
- }
31731
+ // if (this.renderingContext.renderListLastFrame.indexOf(object) > -1) {
31732
+ object.dispatchEvent(new CustomEvent(exports.ElementEvent.CULLED)); // }
31694
31733
  }
31695
31734
 
31696
31735
  return null;
@@ -31887,9 +31926,7 @@
31887
31926
  renderingService.hooks.pointerOut.tap(EventPlugin_1.tag, this.onPointerMove);
31888
31927
  };
31889
31928
 
31890
- _proto.bootstrapEvent = function bootstrapEvent(e, nativeEvent, view) {
31891
- e.pointerType = nativeEvent.pointerType;
31892
- var event = e;
31929
+ _proto.bootstrapEvent = function bootstrapEvent(event, nativeEvent, view) {
31893
31930
  event.view = view;
31894
31931
  event.originalEvent = null;
31895
31932
  event.nativeEvent = nativeEvent;
@@ -31897,6 +31934,7 @@
31897
31934
  event.width = nativeEvent.width;
31898
31935
  event.height = nativeEvent.height;
31899
31936
  event.isPrimary = nativeEvent.isPrimary;
31937
+ event.pointerType = nativeEvent.pointerType;
31900
31938
  event.pressure = nativeEvent.pressure;
31901
31939
  event.tangentialPressure = nativeEvent.tangentialPressure;
31902
31940
  event.tiltX = nativeEvent.tiltX;
@@ -31970,6 +32008,7 @@
31970
32008
 
31971
32009
  _proto.transferMouseData = function transferMouseData(event, nativeEvent) {
31972
32010
  event.isTrusted = nativeEvent.isTrusted;
32011
+ event.srcElement = nativeEvent.srcElement;
31973
32012
  event.timeStamp = performance.now();
31974
32013
  event.type = nativeEvent.type;
31975
32014
  event.altKey = nativeEvent.altKey;
@@ -32001,8 +32040,8 @@
32001
32040
  var touch = event.changedTouches[i]; // use changedTouches instead of touches since touchend has no touches
32002
32041
  // @see https://stackoverflow.com/a/10079076
32003
32042
 
32004
- if (isUndefined(touch.button)) touch.button = event.touches.length ? 1 : 0;
32005
- 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;
32006
32045
 
32007
32046
  if (isUndefined(touch.isPrimary)) {
32008
32047
  touch.isPrimary = event.touches.length === 1 && event.type === 'touchstart';
@@ -32461,6 +32500,7 @@
32461
32500
  devicePixelRatio = config.devicePixelRatio,
32462
32501
  renderer = config.renderer,
32463
32502
  background = config.background,
32503
+ cursor = config.cursor,
32464
32504
  document = config.document,
32465
32505
  requestAnimationFrame = config.requestAnimationFrame,
32466
32506
  cancelAnimationFrame = config.cancelAnimationFrame,
@@ -32512,7 +32552,7 @@
32512
32552
  renderer: renderer,
32513
32553
  offscreenCanvas: offscreenCanvas,
32514
32554
  devicePixelRatio: dpr,
32515
- cursor: 'default',
32555
+ cursor: cursor || 'default',
32516
32556
  background: background,
32517
32557
  createImage: createImage,
32518
32558
  document: document
@@ -32563,7 +32603,6 @@
32563
32603
  * the root node in scene graph
32564
32604
  */
32565
32605
  root: this.document.documentElement,
32566
- renderListLastFrame: [],
32567
32606
  renderListCurrentFrame: [],
32568
32607
  unculledEntities: [],
32569
32608
  renderReasons: new Set(),
@@ -32894,6 +32933,8 @@
32894
32933
  }();
32895
32934
 
32896
32935
  _proto.setCursor = function setCursor(cursor) {
32936
+ var canvasConfig = this.container.get(CanvasConfig);
32937
+ canvasConfig.cursor = cursor;
32897
32938
  this.getContextService().applyCursorStyle(cursor);
32898
32939
  };
32899
32940
 
@@ -33013,7 +33054,6 @@
33013
33054
  return Canvas;
33014
33055
  }(EventTarget);
33015
33056
 
33016
- // import * as ManaSyringe from 'mana-syringe';
33017
33057
  GlobalContainer$1.load(containerModule);
33018
33058
  var layoutEngine = GlobalContainer$1.get(exports.LayoutEngine);
33019
33059