@antv/g-lite 1.0.19 → 1.0.20

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.
@@ -1 +1 @@
1
- {"version":3,"file":"StyleValueRegistry.d.ts","sourceRoot":"","sources":["../src/css/StyleValueRegistry.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,UAAU,CAAC;AAGrE,OAAO,KAAK,EAAU,aAAa,EAAE,MAAM,SAAS,CAAC;AAGrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAM/F,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,EAAE,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAAgB,EAsjBjD,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAM,CAAC;AAoB1E,qBAAa,yBAA0B,YAAW,kBAAkB;IAClE;;OAEG;;IASH,gBAAgB,CAAC,QAAQ,EAAE,gBAAgB;IAO3C,kBAAkB,CAAC,IAAI,EAAE,MAAM;IAI/B,iBAAiB,CAAC,MAAM,EAAE,MAAM;IAIhC;;;;;;;;OAQG;IACH,iBAAiB,CACf,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,cAAc,EAC1B,OAAO,GAAE,OAAO,CAAC,oBAAoB,CAKpC;IAiFH;;OAEG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,aAAa,GAAG,aAAa;IA8B7E;;OAEG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa;IAgE5E,mBAAmB,CAAC,IAAI,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G;IACH,aAAa,CACX,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,GAAG,EACV,MAAM,EAAE,aAAa,GACpB,aAAa;IA8BhB;;OAEG;IACH,eAAe,CACb,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,aAAa;IAqEvB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa;IAcvD;;OAEG;IACH,oBAAoB,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM;IAYxD,oBAAoB,CAClB,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAO;IAkCvC,MAAM,CAAC,MAAM,EAAE,aAAa;IAa5B;;;OAGG;IACH,OAAO,CAAC,cAAc;IA+KtB,OAAO,CAAC,qBAAqB;CAQ9B"}
package/dist/index.esm.js CHANGED
@@ -723,14 +723,9 @@ function _regeneratorRuntime() {
723
723
  };
724
724
  }
725
725
  function maybeInvokeDelegate(delegate, context) {
726
- var method = delegate.iterator[context.method];
727
- if (undefined === method) {
728
- if (context.delegate = null, "throw" === context.method) {
729
- if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
730
- context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
731
- }
732
- return ContinueSentinel;
733
- }
726
+ var methodName = context.method,
727
+ method = delegate.iterator[methodName];
728
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
734
729
  var record = tryCatch(method, delegate.iterator, context.arg);
735
730
  if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
736
731
  var info = record.arg;
@@ -930,7 +925,7 @@ function _defineProperties(target, props) {
930
925
  descriptor.enumerable = descriptor.enumerable || false;
931
926
  descriptor.configurable = true;
932
927
  if ("value" in descriptor) descriptor.writable = true;
933
- Object.defineProperty(target, descriptor.key, descriptor);
928
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
934
929
  }
935
930
  }
936
931
  function _createClass(Constructor, protoProps, staticProps) {
@@ -1016,6 +1011,20 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
1016
1011
  }
1017
1012
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1018
1013
  }
1014
+ function _toPrimitive(input, hint) {
1015
+ if (typeof input !== "object" || input === null) return input;
1016
+ var prim = input[Symbol.toPrimitive];
1017
+ if (prim !== undefined) {
1018
+ var res = prim.call(input, hint || "default");
1019
+ if (typeof res !== "object") return res;
1020
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1021
+ }
1022
+ return (hint === "string" ? String : Number)(input);
1023
+ }
1024
+ function _toPropertyKey(arg) {
1025
+ var key = _toPrimitive(arg, "string");
1026
+ return typeof key === "symbol" ? key : String(key);
1027
+ }
1019
1028
 
1020
1029
  // These units are iterated through, so be careful when adding or changing the
1021
1030
  // order.
@@ -10964,10 +10973,10 @@ var BUILT_IN_PROPERTIES = [{
10964
10973
  ind: true,
10965
10974
  inh: true,
10966
10975
  /**
10967
- * TODO: support interpolation
10976
+ * support interpolation
10968
10977
  * @see https://developer.mozilla.org/en-US/docs/Web/CSS/visibility#interpolation
10969
10978
  */
10970
- // int: true,
10979
+ int: true,
10971
10980
  d: 'visible'
10972
10981
  }, {
10973
10982
  n: 'pointerEvents',
@@ -14960,9 +14969,10 @@ var TextService = /*#__PURE__*/function () {
14960
14969
  // @see https://developer.mozilla.org/en-US/docs/Web/CSS/text-overflow#values
14961
14970
  if (ellipsisWidth > 0 && ellipsisWidth <= maxWidth) {
14962
14971
  // Backspace from line's end.
14972
+ var currentLineLength = lines[currentIndex].length;
14963
14973
  var lastLineWidth = 0;
14964
- var lastLineIndex = 0;
14965
- for (var _i2 = 0; _i2 < lines[currentIndex].length; _i2++) {
14974
+ var lastLineIndex = currentLineLength;
14975
+ for (var _i2 = 0; _i2 < currentLineLength; _i2++) {
14966
14976
  var width = calcWidth(lines[currentIndex][_i2]);
14967
14977
  if (lastLineWidth + width + ellipsisWidth > maxWidth) {
14968
14978
  lastLineIndex = _i2;
@@ -15325,11 +15335,13 @@ var EventPlugin = /*#__PURE__*/function () {
15325
15335
  if (canvas.supportsTouchEvents && nativeEvent.pointerType === 'touch') return;
15326
15336
  // account for element in SVG
15327
15337
  var $element = _this2.context.contextService.getDomElement();
15328
- var outside = $element && nativeEvent.target && nativeEvent.target !== $element &&
15329
- // @ts-ignore
15330
- $element.contains &&
15331
- // @ts-ignore
15332
- !$element.contains(nativeEvent.target) ? 'outside' : '';
15338
+ var outside = 'outside';
15339
+ try {
15340
+ outside = $element && nativeEvent.target && nativeEvent.target !== $element && $element.contains && !$element.contains(nativeEvent.target) ? 'outside' : '';
15341
+ } catch (e) {
15342
+ // nativeEvent.target maybe not Node, such as Window
15343
+ // @see https://github.com/antvis/G/issues/1235
15344
+ }
15333
15345
  var normalizedEvents = _this2.normalizeToPointerEvent(nativeEvent, canvas);
15334
15346
  for (var _iterator3 = _createForOfIteratorHelperLoose(normalizedEvents), _step3; !(_step3 = _iterator3()).done;) {
15335
15347
  var normalizedEvent = _step3.value;
package/dist/index.js CHANGED
@@ -728,14 +728,9 @@ function _regeneratorRuntime() {
728
728
  };
729
729
  }
730
730
  function maybeInvokeDelegate(delegate, context) {
731
- var method = delegate.iterator[context.method];
732
- if (undefined === method) {
733
- if (context.delegate = null, "throw" === context.method) {
734
- if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
735
- context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
736
- }
737
- return ContinueSentinel;
738
- }
731
+ var methodName = context.method,
732
+ method = delegate.iterator[methodName];
733
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
739
734
  var record = tryCatch(method, delegate.iterator, context.arg);
740
735
  if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
741
736
  var info = record.arg;
@@ -935,7 +930,7 @@ function _defineProperties(target, props) {
935
930
  descriptor.enumerable = descriptor.enumerable || false;
936
931
  descriptor.configurable = true;
937
932
  if ("value" in descriptor) descriptor.writable = true;
938
- Object.defineProperty(target, descriptor.key, descriptor);
933
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
939
934
  }
940
935
  }
941
936
  function _createClass(Constructor, protoProps, staticProps) {
@@ -1021,6 +1016,20 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
1021
1016
  }
1022
1017
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1023
1018
  }
1019
+ function _toPrimitive(input, hint) {
1020
+ if (typeof input !== "object" || input === null) return input;
1021
+ var prim = input[Symbol.toPrimitive];
1022
+ if (prim !== undefined) {
1023
+ var res = prim.call(input, hint || "default");
1024
+ if (typeof res !== "object") return res;
1025
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1026
+ }
1027
+ return (hint === "string" ? String : Number)(input);
1028
+ }
1029
+ function _toPropertyKey(arg) {
1030
+ var key = _toPrimitive(arg, "string");
1031
+ return typeof key === "symbol" ? key : String(key);
1032
+ }
1024
1033
 
1025
1034
  // These units are iterated through, so be careful when adding or changing the
1026
1035
  (function (UnitType) {
@@ -10964,10 +10973,10 @@ var BUILT_IN_PROPERTIES = [{
10964
10973
  ind: true,
10965
10974
  inh: true,
10966
10975
  /**
10967
- * TODO: support interpolation
10976
+ * support interpolation
10968
10977
  * @see https://developer.mozilla.org/en-US/docs/Web/CSS/visibility#interpolation
10969
10978
  */
10970
- // int: true,
10979
+ int: true,
10971
10980
  d: 'visible'
10972
10981
  }, {
10973
10982
  n: 'pointerEvents',
@@ -14953,9 +14962,10 @@ var TextService = /*#__PURE__*/function () {
14953
14962
  // @see https://developer.mozilla.org/en-US/docs/Web/CSS/text-overflow#values
14954
14963
  if (ellipsisWidth > 0 && ellipsisWidth <= maxWidth) {
14955
14964
  // Backspace from line's end.
14965
+ var currentLineLength = lines[currentIndex].length;
14956
14966
  var lastLineWidth = 0;
14957
- var lastLineIndex = 0;
14958
- for (var _i2 = 0; _i2 < lines[currentIndex].length; _i2++) {
14967
+ var lastLineIndex = currentLineLength;
14968
+ for (var _i2 = 0; _i2 < currentLineLength; _i2++) {
14959
14969
  var width = calcWidth(lines[currentIndex][_i2]);
14960
14970
  if (lastLineWidth + width + ellipsisWidth > maxWidth) {
14961
14971
  lastLineIndex = _i2;
@@ -15318,11 +15328,13 @@ var EventPlugin = /*#__PURE__*/function () {
15318
15328
  if (canvas.supportsTouchEvents && nativeEvent.pointerType === 'touch') return;
15319
15329
  // account for element in SVG
15320
15330
  var $element = _this2.context.contextService.getDomElement();
15321
- var outside = $element && nativeEvent.target && nativeEvent.target !== $element &&
15322
- // @ts-ignore
15323
- $element.contains &&
15324
- // @ts-ignore
15325
- !$element.contains(nativeEvent.target) ? 'outside' : '';
15331
+ var outside = 'outside';
15332
+ try {
15333
+ outside = $element && nativeEvent.target && nativeEvent.target !== $element && $element.contains && !$element.contains(nativeEvent.target) ? 'outside' : '';
15334
+ } catch (e) {
15335
+ // nativeEvent.target maybe not Node, such as Window
15336
+ // @see https://github.com/antvis/G/issues/1235
15337
+ }
15326
15338
  var normalizedEvents = _this2.normalizeToPointerEvent(nativeEvent, canvas);
15327
15339
  for (var _iterator3 = _createForOfIteratorHelperLoose(normalizedEvents), _step3; !(_step3 = _iterator3()).done;) {
15328
15340
  var normalizedEvent = _step3.value;
package/dist/index.umd.js CHANGED
@@ -6139,14 +6139,9 @@
6139
6139
  };
6140
6140
  }
6141
6141
  function maybeInvokeDelegate(delegate, context) {
6142
- var method = delegate.iterator[context.method];
6143
- if (undefined === method) {
6144
- if (context.delegate = null, "throw" === context.method) {
6145
- if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
6146
- context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
6147
- }
6148
- return ContinueSentinel;
6149
- }
6142
+ var methodName = context.method,
6143
+ method = delegate.iterator[methodName];
6144
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
6150
6145
  var record = tryCatch(method, delegate.iterator, context.arg);
6151
6146
  if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
6152
6147
  var info = record.arg;
@@ -6346,7 +6341,7 @@
6346
6341
  descriptor.enumerable = descriptor.enumerable || false;
6347
6342
  descriptor.configurable = true;
6348
6343
  if ("value" in descriptor) descriptor.writable = true;
6349
- Object.defineProperty(target, descriptor.key, descriptor);
6344
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
6350
6345
  }
6351
6346
  }
6352
6347
  function _createClass(Constructor, protoProps, staticProps) {
@@ -6432,6 +6427,20 @@
6432
6427
  }
6433
6428
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6434
6429
  }
6430
+ function _toPrimitive(input, hint) {
6431
+ if (typeof input !== "object" || input === null) return input;
6432
+ var prim = input[Symbol.toPrimitive];
6433
+ if (prim !== undefined) {
6434
+ var res = prim.call(input, hint || "default");
6435
+ if (typeof res !== "object") return res;
6436
+ throw new TypeError("@@toPrimitive must return a primitive value.");
6437
+ }
6438
+ return (hint === "string" ? String : Number)(input);
6439
+ }
6440
+ function _toPropertyKey(arg) {
6441
+ var key = _toPrimitive(arg, "string");
6442
+ return typeof key === "symbol" ? key : String(key);
6443
+ }
6435
6444
 
6436
6445
  // These units are iterated through, so be careful when adding or changing the
6437
6446
  (function (UnitType) {
@@ -17999,10 +18008,10 @@
17999
18008
  ind: true,
18000
18009
  inh: true,
18001
18010
  /**
18002
- * TODO: support interpolation
18011
+ * support interpolation
18003
18012
  * @see https://developer.mozilla.org/en-US/docs/Web/CSS/visibility#interpolation
18004
18013
  */
18005
- // int: true,
18014
+ int: true,
18006
18015
  d: 'visible'
18007
18016
  }, {
18008
18017
  n: 'pointerEvents',
@@ -21988,9 +21997,10 @@
21988
21997
  // @see https://developer.mozilla.org/en-US/docs/Web/CSS/text-overflow#values
21989
21998
  if (ellipsisWidth > 0 && ellipsisWidth <= maxWidth) {
21990
21999
  // Backspace from line's end.
22000
+ var currentLineLength = lines[currentIndex].length;
21991
22001
  var lastLineWidth = 0;
21992
- var lastLineIndex = 0;
21993
- for (var _i2 = 0; _i2 < lines[currentIndex].length; _i2++) {
22002
+ var lastLineIndex = currentLineLength;
22003
+ for (var _i2 = 0; _i2 < currentLineLength; _i2++) {
21994
22004
  var width = calcWidth(lines[currentIndex][_i2]);
21995
22005
  if (lastLineWidth + width + ellipsisWidth > maxWidth) {
21996
22006
  lastLineIndex = _i2;
@@ -22355,11 +22365,13 @@
22355
22365
  if (canvas.supportsTouchEvents && nativeEvent.pointerType === 'touch') return;
22356
22366
  // account for element in SVG
22357
22367
  var $element = _this2.context.contextService.getDomElement();
22358
- var outside = $element && nativeEvent.target && nativeEvent.target !== $element &&
22359
- // @ts-ignore
22360
- $element.contains &&
22361
- // @ts-ignore
22362
- !$element.contains(nativeEvent.target) ? 'outside' : '';
22368
+ var outside = 'outside';
22369
+ try {
22370
+ outside = $element && nativeEvent.target && nativeEvent.target !== $element && $element.contains && !$element.contains(nativeEvent.target) ? 'outside' : '';
22371
+ } catch (e) {
22372
+ // nativeEvent.target maybe not Node, such as Window
22373
+ // @see https://github.com/antvis/G/issues/1235
22374
+ }
22363
22375
  var normalizedEvents = _this2.normalizeToPointerEvent(nativeEvent, canvas);
22364
22376
  for (var _iterator3 = _createForOfIteratorHelperLoose(normalizedEvents), _step3; !(_step3 = _iterator3()).done;) {
22365
22377
  var normalizedEvent = _step3.value;