@antv/g-lite 1.0.22 → 1.0.23

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
@@ -12359,19 +12359,13 @@
12359
12359
  };
12360
12360
  _proto.hasChildNodes = function hasChildNodes() {
12361
12361
  return this.childNodes.length > 0;
12362
- }
12363
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
12364
- ;
12362
+ };
12365
12363
  _proto.isDefaultNamespace = function isDefaultNamespace(namespace) {
12366
12364
  throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);
12367
- }
12368
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
12369
- ;
12365
+ };
12370
12366
  _proto.lookupNamespaceURI = function lookupNamespaceURI(prefix) {
12371
12367
  throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);
12372
- }
12373
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
12374
- ;
12368
+ };
12375
12369
  _proto.lookupPrefix = function lookupPrefix(namespace) {
12376
12370
  throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);
12377
12371
  };
@@ -12633,9 +12627,7 @@
12633
12627
  };
12634
12628
  _proto.createElementNS = function createElementNS(namespaceURI, tagName, options) {
12635
12629
  return this.createElement(tagName, options);
12636
- }
12637
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
12638
- ;
12630
+ };
12639
12631
  _proto.cloneNode = function cloneNode(deep) {
12640
12632
  throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);
12641
12633
  };
@@ -12869,33 +12861,22 @@
12869
12861
  /**
12870
12862
  * eg. Uncaught DOMException: Failed to execute 'appendChild' on 'Node': Only one element on document allowed.
12871
12863
  */
12872
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
12873
12864
  ;
12874
12865
  _proto.appendChild = function appendChild(newChild, index) {
12875
12866
  throw new Error(ERROR_MSG_USE_DOCUMENT_ELEMENT);
12876
- }
12877
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
12878
- ;
12867
+ };
12879
12868
  _proto.insertBefore = function insertBefore(newChild, refChild) {
12880
12869
  throw new Error(ERROR_MSG_USE_DOCUMENT_ELEMENT);
12881
- }
12882
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
12883
- ;
12870
+ };
12884
12871
  _proto.removeChild = function removeChild(oldChild, destroy) {
12885
12872
  throw new Error(ERROR_MSG_USE_DOCUMENT_ELEMENT);
12886
- }
12887
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
12888
- ;
12873
+ };
12889
12874
  _proto.replaceChild = function replaceChild(newChild, oldChild, destroy) {
12890
12875
  throw new Error(ERROR_MSG_USE_DOCUMENT_ELEMENT);
12891
- }
12892
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
12893
- ;
12876
+ };
12894
12877
  _proto.append = function append() {
12895
12878
  throw new Error(ERROR_MSG_USE_DOCUMENT_ELEMENT);
12896
- }
12897
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
12898
- ;
12879
+ };
12899
12880
  _proto.prepend = function prepend() {
12900
12881
  throw new Error(ERROR_MSG_USE_DOCUMENT_ELEMENT);
12901
12882
  }
@@ -13160,7 +13141,6 @@
13160
13141
  * Unique id.
13161
13142
  */;
13162
13143
  var _proto = Element.prototype;
13163
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
13164
13144
  _proto.cloneNode = function cloneNode(deep) {
13165
13145
  throw new Error(ERROR_MSG_METHOD_NOT_IMPLEMENTED);
13166
13146
  };
@@ -13466,9 +13446,7 @@
13466
13446
  /**
13467
13447
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute
13468
13448
  */;
13469
- _proto.setAttribute = function setAttribute(attributeName, value,
13470
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
13471
- force) {
13449
+ _proto.setAttribute = function setAttribute(attributeName, value, force) {
13472
13450
  this.attributes[attributeName] = value;
13473
13451
  };
13474
13452
  _proto.getAttributeNS = function getAttributeNS(namespace, localName) {
@@ -13792,7 +13770,8 @@
13792
13770
  filter: [],
13793
13771
  shadowType: 'outer'
13794
13772
  };
13795
- var INHERITABLE_STYLE_PROPS = ['opacity', 'fillOpacity', 'strokeOpacity', 'transformOrigin', 'visibility', 'pointerEvents', 'lineWidth', 'lineCap', 'lineJoin', 'increasedLineWidthForHitTesting', 'fontSize', 'fontFamily', 'fontStyle', 'fontWeight', 'fontVariant', 'textAlign', 'textBaseline', 'textTransform'];
13773
+ var INHERITABLE_BASE_STYLE_PROPS = ['opacity', 'fillOpacity', 'strokeOpacity', 'transformOrigin', 'visibility', 'pointerEvents', 'lineWidth', 'lineCap', 'lineJoin', 'increasedLineWidthForHitTesting'];
13774
+ var INHERITABLE_STYLE_PROPS = [].concat(INHERITABLE_BASE_STYLE_PROPS, ['fontSize', 'fontFamily', 'fontStyle', 'fontWeight', 'fontVariant', 'textAlign', 'textBaseline', 'textTransform']);
13796
13775
  /**
13797
13776
  * prototype chains: DisplayObject -> Element -> Node -> EventTarget
13798
13777
  *
@@ -13945,7 +13924,9 @@
13945
13924
  // account for FCP, process properties as less as possible
13946
13925
  runtime.styleValueRegistry.processProperties(this, attributes, {
13947
13926
  forceUpdateGeometry: true,
13948
- usedAttributes: INHERITABLE_STYLE_PROPS
13927
+ usedAttributes:
13928
+ // only Group / Text should account for text relative props
13929
+ this.tagName === exports.Shape.GROUP || this.tagName === exports.Shape.TEXT ? INHERITABLE_STYLE_PROPS : INHERITABLE_BASE_STYLE_PROPS
13949
13930
  });
13950
13931
  // redraw at next frame
13951
13932
  renderable.dirty = true;
@@ -21022,9 +21003,7 @@
21022
21003
  return root !== node && node.nodeName === query;
21023
21004
  });
21024
21005
  }
21025
- }
21026
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
21027
- ;
21006
+ };
21028
21007
  _proto.is = function is(query, node) {
21029
21008
  // a simple `matches` implementation
21030
21009
  if (query.startsWith('.')) {
@@ -21972,7 +21951,6 @@
21972
21951
  // account for textPath
21973
21952
  if (textPath) {
21974
21953
  var totalPathLength = textPath.getTotalLength();
21975
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
21976
21954
  var startingPoint = textPath.getPoint(0);
21977
21955
  for (var i = 0; i < lines.length; i++) {
21978
21956
  var width = context.measureText(lines[i]).width + (lines[i].length - 1) * letterSpacing;
@@ -22184,6 +22162,7 @@
22184
22162
  return TextService;
22185
22163
  }();
22186
22164
 
22165
+ var _this = undefined;
22187
22166
  var runtime = {};
22188
22167
  /**
22189
22168
  * Replace with IoC container
@@ -22200,6 +22179,15 @@
22200
22179
  var length = new CSSPropertyLengthOrPercentage();
22201
22180
  return _ref2 = {}, _ref2[exports.PropertySyntax.PERCENTAGE] = null, _ref2[exports.PropertySyntax.NUMBER] = new CSSPropertyNumber(), _ref2[exports.PropertySyntax.ANGLE] = new CSSPropertyAngle(), _ref2[exports.PropertySyntax.DEFINED_PATH] = new CSSPropertyClipPath(), _ref2[exports.PropertySyntax.PAINT] = color, _ref2[exports.PropertySyntax.COLOR] = color, _ref2[exports.PropertySyntax.FILTER] = new CSSPropertyFilter(), _ref2[exports.PropertySyntax.LENGTH] = length, _ref2[exports.PropertySyntax.LENGTH_PERCENTAGE] = length, _ref2[exports.PropertySyntax.LENGTH_PERCENTAGE_12] = new CSSPropertyLengthOrPercentage12(), _ref2[exports.PropertySyntax.LENGTH_PERCENTAGE_14] = new CSSPropertyLengthOrPercentage14(), _ref2[exports.PropertySyntax.COORDINATE] = new CSSPropertyLocalPosition(), _ref2[exports.PropertySyntax.OFFSET_DISTANCE] = new CSSPropertyOffsetDistance(), _ref2[exports.PropertySyntax.OPACITY_VALUE] = new CSSPropertyOpacity(), _ref2[exports.PropertySyntax.PATH] = new CSSPropertyPath(), _ref2[exports.PropertySyntax.LIST_OF_POINTS] = new CSSPropertyPoints(), _ref2[exports.PropertySyntax.SHADOW_BLUR] = new CSSPropertyShadowBlur(), _ref2[exports.PropertySyntax.TEXT] = new CSSPropertyText(), _ref2[exports.PropertySyntax.TEXT_TRANSFORM] = new CSSPropertyTextTransform(), _ref2[exports.PropertySyntax.TRANSFORM] = new CSSPropertyTransform(), _ref2[exports.PropertySyntax.TRANSFORM_ORIGIN] = new CSSPropertyTransformOrigin(), _ref2[exports.PropertySyntax.Z_INDEX] = new CSSPropertyZIndex(), _ref2[exports.PropertySyntax.MARKER] = new CSSPropertyMarker(), _ref2;
22202
22181
  }();
22182
+ var getGlobalThis = function getGlobalThis() {
22183
+ if (typeof globalThis !== 'undefined') return globalThis;
22184
+ if (typeof self !== 'undefined') return self;
22185
+ if (typeof window !== 'undefined') return window;
22186
+ // @ts-ignore
22187
+ if (typeof global !== 'undefined') return global;
22188
+ if (typeof _this !== 'undefined') return _this;
22189
+ throw new Error('Unable to locate global `this`');
22190
+ };
22203
22191
  /**
22204
22192
  * Camera
22205
22193
  * `g-camera-api` will provide an advanced implementation
@@ -22219,6 +22207,7 @@
22219
22207
  runtime.CSSPropertySyntaxFactory = CSSPropertySyntaxFactory;
22220
22208
  runtime.styleValueRegistry = new DefaultStyleValueRegistry();
22221
22209
  runtime.layoutRegistry = null;
22210
+ runtime.globalThis = getGlobalThis();
22222
22211
 
22223
22212
  var AbstractRendererPlugin = /*#__PURE__*/function () {
22224
22213
  function AbstractRendererPlugin() {
@@ -22990,20 +22979,20 @@
22990
22979
  * implements `Window` interface
22991
22980
  */
22992
22981
  _this.devicePixelRatio = dpr;
22993
- _this.requestAnimationFrame = requestAnimationFrame !== null && requestAnimationFrame !== void 0 ? requestAnimationFrame : raf.bind(globalThis);
22994
- _this.cancelAnimationFrame = cancelAnimationFrame !== null && cancelAnimationFrame !== void 0 ? cancelAnimationFrame : caf.bind(globalThis);
22982
+ _this.requestAnimationFrame = requestAnimationFrame !== null && requestAnimationFrame !== void 0 ? requestAnimationFrame : raf.bind(runtime.globalThis);
22983
+ _this.cancelAnimationFrame = cancelAnimationFrame !== null && cancelAnimationFrame !== void 0 ? cancelAnimationFrame : caf.bind(runtime.globalThis);
22995
22984
  /**
22996
22985
  * limits query
22997
22986
  */
22998
22987
  // the following feature-detect from hammer.js
22999
22988
  // @see https://github.com/hammerjs/hammer.js/blob/master/src/inputjs/input-consts.js#L5
23000
- _this.supportsTouchEvents = supportsTouchEvents !== null && supportsTouchEvents !== void 0 ? supportsTouchEvents : 'ontouchstart' in globalThis;
23001
- _this.supportsPointerEvents = supportsPointerEvents !== null && supportsPointerEvents !== void 0 ? supportsPointerEvents : !!globalThis.PointerEvent;
22989
+ _this.supportsTouchEvents = supportsTouchEvents !== null && supportsTouchEvents !== void 0 ? supportsTouchEvents : 'ontouchstart' in runtime.globalThis;
22990
+ _this.supportsPointerEvents = supportsPointerEvents !== null && supportsPointerEvents !== void 0 ? supportsPointerEvents : !!runtime.globalThis.PointerEvent;
23002
22991
  _this.isTouchEvent = isTouchEvent !== null && isTouchEvent !== void 0 ? isTouchEvent : function (event) {
23003
- return _this.supportsTouchEvents && event instanceof globalThis.TouchEvent;
22992
+ return _this.supportsTouchEvents && event instanceof runtime.globalThis.TouchEvent;
23004
22993
  };
23005
22994
  _this.isMouseEvent = isMouseEvent !== null && isMouseEvent !== void 0 ? isMouseEvent : function (event) {
23006
- return !globalThis.MouseEvent || event instanceof globalThis.MouseEvent && (!_this.supportsPointerEvents || !(event instanceof globalThis.PointerEvent));
22995
+ return !runtime.globalThis.MouseEvent || event instanceof runtime.globalThis.MouseEvent && (!_this.supportsPointerEvents || !(event instanceof runtime.globalThis.PointerEvent));
23007
22996
  };
23008
22997
  _this.initRenderingContext({
23009
22998
  container: container,