@antv/g-lite 1.3.0-next.1 → 1.3.0-next.10

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
@@ -3186,7 +3186,7 @@ var getOrCreateUnitValue = function (value, unitOrName) {
3186
3186
  if (unitOrName === void 0) { unitOrName = exports.UnitType.kNumber; }
3187
3187
  return new CSSUnitValue(value, unitOrName);
3188
3188
  };
3189
- var PECENTAGE_50 = new CSSUnitValue(50, '%');
3189
+ new CSSUnitValue(50, '%');
3190
3190
 
3191
3191
  /**
3192
3192
  * @see https://doc.babylonjs.com/how_to/optimizing_your_scene#changing-mesh-culling-strategy
@@ -4128,19 +4128,17 @@ function parseDimensionArray(string) {
4128
4128
  // },
4129
4129
  // ];
4130
4130
  // }
4131
- function convertPercentUnit(valueWithUnit, vec3Index, target) {
4132
- if (valueWithUnit.value === 0) {
4133
- return 0;
4134
- }
4131
+ function convertPercentUnit(valueWithUnit, vec3Index, target, useMin) {
4132
+ if (useMin === void 0) { useMin = false; }
4135
4133
  if (valueWithUnit.unit === exports.UnitType.kPixels) {
4136
4134
  return Number(valueWithUnit.value);
4137
4135
  }
4138
4136
  else if (valueWithUnit.unit === exports.UnitType.kPercentage && target) {
4139
4137
  var bounds = target.nodeName === exports.Shape.GROUP
4140
4138
  ? target.getLocalBounds()
4141
- : // : target.getGeometryBounds();
4142
- target.geometry.contentBounds;
4143
- return (valueWithUnit.value / 100) * bounds.halfExtents[vec3Index] * 2;
4139
+ : target.getGeometryBounds();
4140
+ return ((useMin ? bounds.min[vec3Index] : 0) +
4141
+ (valueWithUnit.value / 100) * bounds.halfExtents[vec3Index] * 2);
4144
4142
  }
4145
4143
  return 0;
4146
4144
  }
@@ -5979,7 +5977,7 @@ function convertKeyword2Percent(keyword) {
5979
5977
  return '50%';
5980
5978
  }
5981
5979
  else if (keyword === 'left' || keyword === 'top') {
5982
- return '0';
5980
+ return '0%';
5983
5981
  }
5984
5982
  else if (keyword === 'right' || keyword === 'bottom') {
5985
5983
  return '100%';
@@ -6247,16 +6245,17 @@ var BUILT_IN_PROPERTIES = [
6247
6245
  {
6248
6246
  n: 'transformOrigin',
6249
6247
  p: 100,
6250
- // int: true,
6251
- d: function (nodeName) {
6252
- if (nodeName === exports.Shape.CIRCLE || nodeName === exports.Shape.ELLIPSE) {
6253
- return 'center';
6254
- }
6255
- if (nodeName === exports.Shape.TEXT) {
6256
- return 'text-anchor';
6257
- }
6258
- return 'left top';
6259
- },
6248
+ d: '0 0',
6249
+ // // int: true,
6250
+ // d: (nodeName: string) => {
6251
+ // if (nodeName === Shape.CIRCLE || nodeName === Shape.ELLIPSE) {
6252
+ // return 'center';
6253
+ // }
6254
+ // if (nodeName === Shape.TEXT) {
6255
+ // return 'text-anchor';
6256
+ // }
6257
+ // return 'left top';
6258
+ // },
6260
6259
  l: true,
6261
6260
  syntax: exports.PropertySyntax.TRANSFORM_ORIGIN,
6262
6261
  },
@@ -6728,7 +6727,9 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
6728
6727
  this.runtime.CSSPropertySyntaxFactory['<transform>'].postProcessor(object, attributeNames_1);
6729
6728
  }
6730
6729
  if (needUpdateGeometry_1) {
6731
- this.updateGeometry(object);
6730
+ object.geometry.dirty = true;
6731
+ // FIXME setOrigin may have already dirtified to root.
6732
+ this.runtime.sceneGraphService.dirtifyToRoot(object);
6732
6733
  }
6733
6734
  return;
6734
6735
  }
@@ -6787,9 +6788,9 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
6787
6788
  // }
6788
6789
  // update geometry
6789
6790
  if (needUpdateGeometry) {
6790
- // object.geometry.dirty = true;
6791
- // runtime.sceneGraphService.dirtifyToRoot(object);
6792
- this.updateGeometry(object);
6791
+ object.geometry.dirty = true;
6792
+ // FIXME setOrigin may have already dirtified to root.
6793
+ this.runtime.sceneGraphService.dirtifyToRoot(object);
6793
6794
  }
6794
6795
  attributeNames.forEach(function (name) {
6795
6796
  if (name in object.parsedStyle) {
@@ -7076,25 +7077,22 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
7076
7077
  geometry_1.renderBounds.setMinMax(min, max);
7077
7078
  }
7078
7079
  });
7079
- // if (nodeName === Shape.RECT) {
7080
- // account for negative width / height of Rect
7080
+ object.geometry.dirty = false;
7081
7081
  // @see https://github.com/antvis/g/issues/957
7082
7082
  var flipY = hwidth < 0;
7083
7083
  var flipX = hheight < 0;
7084
- // } else {
7085
- // }
7086
7084
  // set transform origin
7087
7085
  var usedOriginXValue = (flipY ? -1 : 1) *
7088
7086
  (transformOrigin
7089
- ? convertPercentUnit(transformOrigin[0], 0, object)
7087
+ ? convertPercentUnit(transformOrigin[0], 0, object, true)
7090
7088
  : 0);
7091
7089
  var usedOriginYValue = (flipX ? -1 : 1) *
7092
7090
  (transformOrigin
7093
- ? convertPercentUnit(transformOrigin[1], 1, object)
7091
+ ? convertPercentUnit(transformOrigin[1], 1, object, true)
7094
7092
  : 0);
7095
- object.setOrigin(cx - hwidth + usedOriginXValue, cy - hheight + usedOriginYValue);
7096
- // FIXME setOrigin may have already dirtified to root.
7097
- this.runtime.sceneGraphService.dirtifyToRoot(object);
7093
+ if (usedOriginXValue || usedOriginYValue) {
7094
+ object.setOrigin(usedOriginXValue, usedOriginYValue);
7095
+ }
7098
7096
  }
7099
7097
  };
7100
7098
  DefaultStyleValueRegistry.prototype.isPropertyInheritable = function (name) {
@@ -7831,92 +7829,121 @@ function toFontString(attributes) {
7831
7829
  return "".concat(fontStyle, " ").concat(fontVariant, " ").concat(fontWeight, " ").concat(fontSizeString, " ").concat(fontFamilies.join(','));
7832
7830
  }
7833
7831
 
7834
- var tmpMat4 = glMatrix.mat4.create();
7832
+ function createSkewMatrix(skewMatrix, skewX, skewY) {
7833
+ // Create an identity matrix
7834
+ glMatrix.mat4.identity(skewMatrix);
7835
+ // Apply skew to the matrix
7836
+ skewMatrix[4] = Math.tan(skewX); // Skew Y axis in X direction
7837
+ skewMatrix[1] = Math.tan(skewY); // Skew X axis in Y direction
7838
+ return skewMatrix;
7839
+ }
7840
+ var tmpMat1 = glMatrix.mat4.create();
7841
+ var tmpMat2 = glMatrix.mat4.create();
7835
7842
  function parsedTransformToMat4(transform, object) {
7836
- // reset transform
7837
- object.resetLocalTransform();
7838
- transform.forEach(function (parsed) {
7839
- var t = parsed.t, d = parsed.d;
7840
- if (t === 'scale') {
7841
- // scale(1) scale(1, 1)
7842
- var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1, 1];
7843
- object.scaleLocal(newScale[0], newScale[1], 1);
7844
- }
7845
- else if (t === 'scalex') {
7846
- var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1];
7847
- object.scaleLocal(newScale[0], 1, 1);
7848
- }
7849
- else if (t === 'scaley') {
7850
- var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1];
7851
- object.scaleLocal(1, newScale[0], 1);
7852
- }
7853
- else if (t === 'scalez') {
7854
- var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1];
7855
- object.scaleLocal(1, 1, newScale[0]);
7856
- }
7857
- else if (t === 'scale3d') {
7858
- var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1, 1, 1];
7859
- object.scaleLocal(newScale[0], newScale[1], newScale[2]);
7860
- }
7861
- else if (t === 'translate') {
7862
- var newTranslation = d || [Opx, Opx];
7863
- object.translateLocal(newTranslation[0].value, newTranslation[1].value, 0);
7864
- }
7865
- else if (t === 'translatex') {
7866
- var newTranslation = d || [Opx];
7867
- object.translateLocal(newTranslation[0].value, 0, 0);
7868
- }
7869
- else if (t === 'translatey') {
7870
- var newTranslation = d || [Opx];
7871
- object.translateLocal(0, newTranslation[0].value, 0);
7872
- }
7873
- else if (t === 'translatez') {
7874
- var newTranslation = d || [Opx];
7875
- object.translateLocal(0, 0, newTranslation[0].value);
7876
- }
7877
- else if (t === 'translate3d') {
7878
- var newTranslation = d || [Opx, Opx, Opx];
7879
- object.translateLocal(newTranslation[0].value, newTranslation[1].value, newTranslation[2].value);
7880
- }
7881
- else if (t === 'rotate') {
7882
- var newAngles = d || [Odeg];
7883
- object.rotateLocal(0, 0, convertAngleUnit(newAngles[0]));
7884
- }
7885
- else if (t === 'rotatex') {
7886
- var newAngles = d || [Odeg];
7887
- object.rotateLocal(convertAngleUnit(newAngles[0]), 0, 0);
7888
- }
7889
- else if (t === 'rotatey') {
7890
- var newAngles = d || [Odeg];
7891
- object.rotateLocal(0, convertAngleUnit(newAngles[0]), 0);
7892
- }
7893
- else if (t === 'rotatez') {
7894
- var newAngles = d || [Odeg];
7895
- object.rotateLocal(0, 0, convertAngleUnit(newAngles[0]));
7896
- }
7897
- else if (t === 'rotate3d') ;
7898
- else if (t === 'skew') {
7899
- var newSkew = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [0, 0];
7900
- object.setLocalSkew(deg2rad(newSkew[0]), deg2rad(newSkew[1]));
7901
- }
7902
- else if (t === 'skewx') {
7903
- var newSkew = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [0];
7904
- object.setLocalSkew(deg2rad(newSkew[0]), object.getLocalSkew()[1]);
7905
- }
7906
- else if (t === 'skewy') {
7907
- var newSkew = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [0];
7908
- object.setLocalSkew(object.getLocalSkew()[0], deg2rad(newSkew[0]));
7909
- }
7910
- else if (t === 'matrix') {
7911
- var _a = tslib.__read(d.map(function (s) { return s.value; }), 6), a = _a[0], b = _a[1], c = _a[2], dd = _a[3], tx = _a[4], ty = _a[5];
7912
- object.setLocalTransform(glMatrix.mat4.set(tmpMat4, a, b, 0, 0, c, dd, 0, 0, 0, 0, 1, 0, tx, ty, 0, 1));
7913
- }
7914
- else if (t === 'matrix3d') {
7915
- // @ts-ignore
7916
- glMatrix.mat4.set.apply(glMatrix.mat4, tslib.__spreadArray([tmpMat4], tslib.__read(d.map(function (s) { return s.value; })), false));
7917
- object.setLocalTransform(tmpMat4);
7918
- }
7919
- });
7843
+ if (transform.length) {
7844
+ var m_1 = glMatrix.mat4.identity(tmpMat1);
7845
+ transform.forEach(function (parsed) {
7846
+ var t = parsed.t, d = parsed.d;
7847
+ if (t === 'scale') {
7848
+ // scale(1) scale(1, 1)
7849
+ var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1, 1];
7850
+ glMatrix.mat4.fromScaling(tmpMat2, [newScale[0], newScale[1], 1]);
7851
+ }
7852
+ else if (t === 'scalex') {
7853
+ var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1];
7854
+ glMatrix.mat4.fromScaling(tmpMat2, [newScale[0], 1, 1]);
7855
+ }
7856
+ else if (t === 'scaley') {
7857
+ var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1];
7858
+ glMatrix.mat4.fromScaling(tmpMat2, [1, newScale[0], 1]);
7859
+ }
7860
+ else if (t === 'scalez') {
7861
+ var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1];
7862
+ glMatrix.mat4.fromScaling(tmpMat2, [1, 1, newScale[0]]);
7863
+ }
7864
+ else if (t === 'scale3d') {
7865
+ var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1, 1, 1];
7866
+ glMatrix.mat4.fromScaling(tmpMat2, [newScale[0], newScale[1], newScale[2]]);
7867
+ }
7868
+ else if (t === 'translate') {
7869
+ var newTranslation = d || [Opx, Opx];
7870
+ glMatrix.mat4.fromTranslation(tmpMat2, [
7871
+ newTranslation[0].value,
7872
+ newTranslation[1].value,
7873
+ 0,
7874
+ ]);
7875
+ }
7876
+ else if (t === 'translatex') {
7877
+ var newTranslation = d || [Opx];
7878
+ glMatrix.mat4.fromTranslation(tmpMat2, [newTranslation[0].value, 0, 0]);
7879
+ }
7880
+ else if (t === 'translatey') {
7881
+ var newTranslation = d || [Opx];
7882
+ glMatrix.mat4.fromTranslation(tmpMat2, [0, newTranslation[0].value, 0]);
7883
+ }
7884
+ else if (t === 'translatez') {
7885
+ var newTranslation = d || [Opx];
7886
+ glMatrix.mat4.fromTranslation(tmpMat2, [0, 0, newTranslation[0].value]);
7887
+ }
7888
+ else if (t === 'translate3d') {
7889
+ var newTranslation = d || [Opx, Opx, Opx];
7890
+ glMatrix.mat4.fromTranslation(tmpMat2, [
7891
+ newTranslation[0].value,
7892
+ newTranslation[1].value,
7893
+ newTranslation[2].value,
7894
+ ]);
7895
+ }
7896
+ else if (t === 'rotate') {
7897
+ var newAngles = d || [Odeg];
7898
+ glMatrix.mat4.fromZRotation(tmpMat2, deg2rad(convertAngleUnit(newAngles[0])));
7899
+ }
7900
+ else if (t === 'rotatex') {
7901
+ var newAngles = d || [Odeg];
7902
+ glMatrix.mat4.fromXRotation(tmpMat2, deg2rad(convertAngleUnit(newAngles[0])));
7903
+ }
7904
+ else if (t === 'rotatey') {
7905
+ var newAngles = d || [Odeg];
7906
+ glMatrix.mat4.fromYRotation(tmpMat2, deg2rad(convertAngleUnit(newAngles[0])));
7907
+ }
7908
+ else if (t === 'rotatez') {
7909
+ var newAngles = d || [Odeg];
7910
+ glMatrix.mat4.fromZRotation(tmpMat2, deg2rad(convertAngleUnit(newAngles[0])));
7911
+ }
7912
+ else if (t === 'rotate3d') {
7913
+ var newAngles = d || [Opx, Opx, Opx, Odeg];
7914
+ glMatrix.mat4.fromRotation(tmpMat2, deg2rad(convertAngleUnit(newAngles[3])), [
7915
+ newAngles[0].value,
7916
+ newAngles[1].value,
7917
+ newAngles[2].value,
7918
+ ]);
7919
+ }
7920
+ else if (t === 'skew') {
7921
+ var newSkew = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [0, 0];
7922
+ createSkewMatrix(tmpMat2, deg2rad(newSkew[0]), deg2rad(newSkew[1]));
7923
+ }
7924
+ else if (t === 'skewx') {
7925
+ var newSkew = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [0];
7926
+ createSkewMatrix(tmpMat2, deg2rad(newSkew[0]), 0);
7927
+ }
7928
+ else if (t === 'skewy') {
7929
+ var newSkew = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [0];
7930
+ createSkewMatrix(tmpMat2, 0, deg2rad(newSkew[0]));
7931
+ }
7932
+ else if (t === 'matrix') {
7933
+ var _a = tslib.__read(d.map(function (s) { return s.value; }), 6), a = _a[0], b = _a[1], c = _a[2], dd = _a[3], tx = _a[4], ty = _a[5];
7934
+ glMatrix.mat4.set(tmpMat2, a, b, 0, 0, c, dd, 0, 0, 0, 0, 1, 0, tx, ty, 0, 1);
7935
+ }
7936
+ else if (t === 'matrix3d') {
7937
+ // @ts-ignore
7938
+ glMatrix.mat4.set.apply(glMatrix.mat4, tslib.__spreadArray([tmpMat2], tslib.__read(d.map(function (s) { return s.value; })), false));
7939
+ }
7940
+ glMatrix.mat4.mul(m_1, m_1, tmpMat2);
7941
+ });
7942
+ object.setLocalTransform(m_1);
7943
+ }
7944
+ else {
7945
+ object.resetLocalTransform();
7946
+ }
7920
7947
  return object.getLocalTransform();
7921
7948
  }
7922
7949
 
@@ -7980,17 +8007,18 @@ var CSSPropertyTransformOrigin = /** @class */ (function () {
7980
8007
  function CSSPropertyTransformOrigin() {
7981
8008
  this.parser = parseTransformOrigin;
7982
8009
  this.parserUnmemoize = parseTransformOriginUnmemoize;
7983
- // calculator(
7984
- // name: string,
7985
- // oldParsed: [CSSUnitValue, CSSUnitValue],
7986
- // parsed: [CSSUnitValue, CSSUnitValue],
7987
- // object: DisplayObject,
7988
- // ): [number, number] {
7989
- // console.log(object, parsed);
7990
- // return [parsed[0].value, parsed[1].value];
7991
- // // return [convertPercentUnit(parsed[0], 0, object), convertPercentUnit(parsed[1], 1, object)];
7992
- // }
7993
8010
  }
8011
+ CSSPropertyTransformOrigin.prototype.postProcessor = function (object) {
8012
+ var transformOrigin = object.parsedStyle.transformOrigin;
8013
+ if (transformOrigin[0].unit === exports.UnitType.kPixels &&
8014
+ transformOrigin[1].unit === exports.UnitType.kPixels) {
8015
+ object.setOrigin(transformOrigin[0].value, transformOrigin[1].value);
8016
+ }
8017
+ else {
8018
+ // Relative to geometry bounds, calculate later.
8019
+ object.getGeometryBounds();
8020
+ }
8021
+ };
7994
8022
  return CSSPropertyTransformOrigin;
7995
8023
  }());
7996
8024
 
@@ -8240,6 +8268,20 @@ var TextUpdater = /** @class */ (function () {
8240
8268
  return TextUpdater;
8241
8269
  }());
8242
8270
 
8271
+ var GroupUpdater = /** @class */ (function () {
8272
+ function GroupUpdater() {
8273
+ }
8274
+ GroupUpdater.prototype.update = function (parsedStyle, object) {
8275
+ return {
8276
+ cx: 0,
8277
+ cy: 0,
8278
+ hwidth: 0,
8279
+ hheight: 0,
8280
+ };
8281
+ };
8282
+ return GroupUpdater;
8283
+ }());
8284
+
8243
8285
  function isFederatedEvent(value) {
8244
8286
  return !!value.type;
8245
8287
  }
@@ -8790,7 +8832,7 @@ var EventTarget = /** @class */ (function () {
8790
8832
  var Node = /** @class */ (function (_super) {
8791
8833
  tslib.__extends(Node, _super);
8792
8834
  function Node() {
8793
- var _this = _super.apply(this, tslib.__spreadArray([], tslib.__read(arguments), false)) || this;
8835
+ var _this = _super.call(this) || this;
8794
8836
  _this.shadow = false;
8795
8837
  /**
8796
8838
  * points to canvas.document
@@ -10339,9 +10381,10 @@ var DefaultSceneGraphService = /** @class */ (function () {
10339
10381
  */
10340
10382
  this.rotate = (function () {
10341
10383
  var parentInvertRotation = glMatrix.quat.create();
10342
- return function (element, degrees, y, z) {
10384
+ return function (element, degrees, y, z, dirtify) {
10343
10385
  if (y === void 0) { y = 0; }
10344
10386
  if (z === void 0) { z = 0; }
10387
+ if (dirtify === void 0) { dirtify = true; }
10345
10388
  if (typeof degrees === 'number') {
10346
10389
  degrees = glMatrix.vec3.fromValues(degrees, y, z);
10347
10390
  }
@@ -10360,7 +10403,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
10360
10403
  glMatrix.quat.multiply(rotation, parentInvertRotation, rotation);
10361
10404
  glMatrix.quat.multiply(transform.localRotation, rotation, rot);
10362
10405
  glMatrix.quat.normalize(transform.localRotation, transform.localRotation);
10363
- _this.dirtifyLocal(element, transform);
10406
+ if (dirtify) {
10407
+ _this.dirtifyLocal(element, transform);
10408
+ }
10364
10409
  }
10365
10410
  };
10366
10411
  })();
@@ -10370,16 +10415,19 @@ var DefaultSceneGraphService = /** @class */ (function () {
10370
10415
  */
10371
10416
  this.rotateLocal = (function () {
10372
10417
  var rotation = glMatrix.quat.create();
10373
- return function (element, degrees, y, z) {
10418
+ return function (element, degrees, y, z, dirtify) {
10374
10419
  if (y === void 0) { y = 0; }
10375
10420
  if (z === void 0) { z = 0; }
10421
+ if (dirtify === void 0) { dirtify = true; }
10376
10422
  if (typeof degrees === 'number') {
10377
10423
  degrees = glMatrix.vec3.fromValues(degrees, y, z);
10378
10424
  }
10379
10425
  var transform = element.transformable;
10380
10426
  glMatrix.quat.fromEuler(rotation, degrees[0], degrees[1], degrees[2]);
10381
10427
  glMatrix.quat.mul(transform.localRotation, transform.localRotation, rotation);
10382
- _this.dirtifyLocal(element, transform);
10428
+ if (dirtify) {
10429
+ _this.dirtifyLocal(element, transform);
10430
+ }
10383
10431
  };
10384
10432
  })();
10385
10433
  /**
@@ -10387,9 +10435,10 @@ var DefaultSceneGraphService = /** @class */ (function () {
10387
10435
  */
10388
10436
  this.setEulerAngles = (function () {
10389
10437
  var invParentRot = glMatrix.quat.create();
10390
- return function (element, degrees, y, z) {
10438
+ return function (element, degrees, y, z, dirtify) {
10391
10439
  if (y === void 0) { y = 0; }
10392
10440
  if (z === void 0) { z = 0; }
10441
+ if (dirtify === void 0) { dirtify = true; }
10393
10442
  if (typeof degrees === 'number') {
10394
10443
  degrees = glMatrix.vec3.fromValues(degrees, y, z);
10395
10444
  }
@@ -10403,7 +10452,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
10403
10452
  var parentRotation = _this.getRotation(element.parentNode);
10404
10453
  glMatrix.quat.copy(invParentRot, glMatrix.quat.invert(glMatrix.quat.create(), parentRotation));
10405
10454
  glMatrix.quat.mul(transform.localRotation, transform.localRotation, invParentRot);
10406
- _this.dirtifyLocal(element, transform);
10455
+ if (dirtify) {
10456
+ _this.dirtifyLocal(element, transform);
10457
+ }
10407
10458
  }
10408
10459
  };
10409
10460
  })();
@@ -10417,9 +10468,10 @@ var DefaultSceneGraphService = /** @class */ (function () {
10417
10468
  * ```
10418
10469
  */
10419
10470
  this.translateLocal = (function () {
10420
- return function (element, translation, y, z) {
10471
+ return function (element, translation, y, z, dirtify) {
10421
10472
  if (y === void 0) { y = 0; }
10422
10473
  if (z === void 0) { z = 0; }
10474
+ if (dirtify === void 0) { dirtify = true; }
10423
10475
  if (typeof translation === 'number') {
10424
10476
  translation = glMatrix.vec3.fromValues(translation, y, z);
10425
10477
  }
@@ -10429,7 +10481,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
10429
10481
  }
10430
10482
  glMatrix.vec3.transformQuat(translation, translation, transform.localRotation);
10431
10483
  glMatrix.vec3.add(transform.localPosition, transform.localPosition, translation);
10432
- _this.dirtifyLocal(element, transform);
10484
+ if (dirtify) {
10485
+ _this.dirtifyLocal(element, transform);
10486
+ }
10433
10487
  };
10434
10488
  })();
10435
10489
  /**
@@ -10441,7 +10495,8 @@ var DefaultSceneGraphService = /** @class */ (function () {
10441
10495
  this.setPosition = (function () {
10442
10496
  var parentInvertMatrix = glMatrix.mat4.create();
10443
10497
  var tmpPosition = glMatrix.vec3.create();
10444
- return function (element, position) {
10498
+ return function (element, position, dirtify) {
10499
+ if (dirtify === void 0) { dirtify = true; }
10445
10500
  var transform = element.transformable;
10446
10501
  tmpPosition[0] = position[0];
10447
10502
  tmpPosition[1] = position[1];
@@ -10460,7 +10515,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
10460
10515
  glMatrix.mat4.invert(parentInvertMatrix, parentInvertMatrix);
10461
10516
  glMatrix.vec3.transformMat4(transform.localPosition, tmpPosition, parentInvertMatrix);
10462
10517
  }
10463
- _this.dirtifyLocal(element, transform);
10518
+ if (dirtify) {
10519
+ _this.dirtifyLocal(element, transform);
10520
+ }
10464
10521
  };
10465
10522
  })();
10466
10523
  /**
@@ -10468,7 +10525,8 @@ var DefaultSceneGraphService = /** @class */ (function () {
10468
10525
  */
10469
10526
  this.setLocalPosition = (function () {
10470
10527
  var tmpPosition = glMatrix.vec3.create();
10471
- return function (element, position) {
10528
+ return function (element, position, dirtify) {
10529
+ if (dirtify === void 0) { dirtify = true; }
10472
10530
  var transform = element.transformable;
10473
10531
  tmpPosition[0] = position[0];
10474
10532
  tmpPosition[1] = position[1];
@@ -10477,7 +10535,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
10477
10535
  return;
10478
10536
  }
10479
10537
  glMatrix.vec3.copy(transform.localPosition, tmpPosition);
10480
- _this.dirtifyLocal(element, transform);
10538
+ if (dirtify) {
10539
+ _this.dirtifyLocal(element, transform);
10540
+ }
10481
10541
  };
10482
10542
  })();
10483
10543
  /**
@@ -10496,9 +10556,10 @@ var DefaultSceneGraphService = /** @class */ (function () {
10496
10556
  var zeroVec3 = glMatrix.vec3.create();
10497
10557
  var tmpVec3 = glMatrix.vec3.create();
10498
10558
  var tr = glMatrix.vec3.create();
10499
- return function (element, translation, y, z) {
10559
+ return function (element, translation, y, z, dirtify) {
10500
10560
  if (y === void 0) { y = 0; }
10501
10561
  if (z === void 0) { z = 0; }
10562
+ if (dirtify === void 0) { dirtify = true; }
10502
10563
  if (typeof translation === 'number') {
10503
10564
  translation = glMatrix.vec3.set(tmpVec3, translation, y, z);
10504
10565
  }
@@ -10506,12 +10567,13 @@ var DefaultSceneGraphService = /** @class */ (function () {
10506
10567
  return;
10507
10568
  }
10508
10569
  glMatrix.vec3.add(tr, _this.getPosition(element), translation);
10509
- _this.setPosition(element, tr);
10570
+ _this.setPosition(element, tr, dirtify);
10510
10571
  };
10511
10572
  })();
10512
10573
  this.setRotation = function () {
10513
10574
  var parentInvertRotation = glMatrix.quat.create();
10514
- return function (element, rotation, y, z, w) {
10575
+ return function (element, rotation, y, z, w, dirtify) {
10576
+ if (dirtify === void 0) { dirtify = true; }
10515
10577
  var transform = element.transformable;
10516
10578
  if (typeof rotation === 'number') {
10517
10579
  rotation = glMatrix.quat.fromValues(rotation, y, z, w);
@@ -10526,7 +10588,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
10526
10588
  glMatrix.quat.invert(parentInvertRotation, parentInvertRotation);
10527
10589
  glMatrix.quat.multiply(transform.localRotation, parentInvertRotation, rotation);
10528
10590
  glMatrix.quat.normalize(transform.localRotation, transform.localRotation);
10529
- _this.dirtifyLocal(element, transform);
10591
+ if (dirtify) {
10592
+ _this.dirtifyLocal(element, transform);
10593
+ }
10530
10594
  }
10531
10595
  };
10532
10596
  };
@@ -10567,7 +10631,7 @@ var DefaultSceneGraphService = /** @class */ (function () {
10567
10631
  // .filter((node) => !node.shadow);
10568
10632
  };
10569
10633
  DefaultSceneGraphService.prototype.attach = function (child, parent, index) {
10570
- var _a, _b;
10634
+ var _a;
10571
10635
  var detached = false;
10572
10636
  if (child.parentNode) {
10573
10637
  detached = child.parentNode !== parent;
@@ -10583,7 +10647,7 @@ var DefaultSceneGraphService = /** @class */ (function () {
10583
10647
  // parent needs re-sort
10584
10648
  var sortable = parent.sortable;
10585
10649
  if (((_a = sortable === null || sortable === void 0 ? void 0 : sortable.sorted) === null || _a === void 0 ? void 0 : _a.length) ||
10586
- ((_b = child.style) === null || _b === void 0 ? void 0 : _b.zIndex)) {
10650
+ child.parsedStyle.zIndex) {
10587
10651
  if (sortable.dirtyChildren.indexOf(child) === -1) {
10588
10652
  sortable.dirtyChildren.push(child);
10589
10653
  }
@@ -10668,40 +10732,52 @@ var DefaultSceneGraphService = /** @class */ (function () {
10668
10732
  /**
10669
10733
  * set euler angles(degrees) in local space
10670
10734
  */
10671
- DefaultSceneGraphService.prototype.setLocalEulerAngles = function (element, degrees, y, z) {
10735
+ DefaultSceneGraphService.prototype.setLocalEulerAngles = function (element, degrees, y, z, dirtify) {
10672
10736
  if (y === void 0) { y = 0; }
10673
10737
  if (z === void 0) { z = 0; }
10738
+ if (dirtify === void 0) { dirtify = true; }
10674
10739
  if (typeof degrees === 'number') {
10675
10740
  degrees = glMatrix.vec3.fromValues(degrees, y, z);
10676
10741
  }
10677
10742
  var transform = element.transformable;
10678
10743
  glMatrix.quat.fromEuler(transform.localRotation, degrees[0], degrees[1], degrees[2]);
10679
- this.dirtifyLocal(element, transform);
10744
+ if (dirtify) {
10745
+ this.dirtifyLocal(element, transform);
10746
+ }
10680
10747
  };
10681
10748
  /**
10682
10749
  * scale in local space
10683
10750
  */
10684
- DefaultSceneGraphService.prototype.scaleLocal = function (element, scaling) {
10751
+ DefaultSceneGraphService.prototype.scaleLocal = function (element, scaling, dirtify) {
10752
+ if (dirtify === void 0) { dirtify = true; }
10685
10753
  var transform = element.transformable;
10686
10754
  glMatrix.vec3.multiply(transform.localScale, transform.localScale, glMatrix.vec3.fromValues(scaling[0], scaling[1], scaling[2] || 1));
10687
- this.dirtifyLocal(element, transform);
10755
+ if (dirtify) {
10756
+ this.dirtifyLocal(element, transform);
10757
+ }
10688
10758
  };
10689
- DefaultSceneGraphService.prototype.setLocalScale = function (element, scaling) {
10759
+ DefaultSceneGraphService.prototype.setLocalScale = function (element, scaling, dirtify) {
10760
+ if (dirtify === void 0) { dirtify = true; }
10690
10761
  var transform = element.transformable;
10691
10762
  var updatedScaling = glMatrix.vec3.fromValues(scaling[0], scaling[1], scaling[2] || transform.localScale[2]);
10692
10763
  if (glMatrix.vec3.equals(updatedScaling, transform.localScale)) {
10693
10764
  return;
10694
10765
  }
10695
10766
  glMatrix.vec3.copy(transform.localScale, updatedScaling);
10696
- this.dirtifyLocal(element, transform);
10767
+ if (dirtify) {
10768
+ this.dirtifyLocal(element, transform);
10769
+ }
10697
10770
  };
10698
- DefaultSceneGraphService.prototype.setLocalRotation = function (element, rotation, y, z, w) {
10771
+ DefaultSceneGraphService.prototype.setLocalRotation = function (element, rotation, y, z, w, dirtify) {
10772
+ if (dirtify === void 0) { dirtify = true; }
10699
10773
  if (typeof rotation === 'number') {
10700
10774
  rotation = glMatrix.quat.fromValues(rotation, y, z, w);
10701
10775
  }
10702
10776
  var transform = element.transformable;
10703
10777
  glMatrix.quat.copy(transform.localRotation, rotation);
10704
- this.dirtifyLocal(element, transform);
10778
+ if (dirtify) {
10779
+ this.dirtifyLocal(element, transform);
10780
+ }
10705
10781
  };
10706
10782
  DefaultSceneGraphService.prototype.setLocalSkew = function (element, skew, y) {
10707
10783
  if (typeof skew === 'number') {
@@ -10865,9 +10941,10 @@ var DefaultSceneGraphService = /** @class */ (function () {
10865
10941
  var t = glMatrix.mat4.getTranslation(glMatrix.vec3.create(), transform);
10866
10942
  var r = glMatrix.mat4.getRotation(glMatrix.quat.create(), transform);
10867
10943
  var s = glMatrix.mat4.getScaling(glMatrix.vec3.create(), transform);
10868
- this.setLocalScale(element, s);
10869
- this.setLocalPosition(element, t);
10870
- this.setLocalRotation(element, r);
10944
+ this.setLocalScale(element, s, false);
10945
+ this.setLocalPosition(element, t, false);
10946
+ this.setLocalRotation(element, r, undefined, undefined, undefined, false);
10947
+ this.dirtifyLocal(element, element.transformable);
10871
10948
  };
10872
10949
  DefaultSceneGraphService.prototype.resetLocalTransform = function (element) {
10873
10950
  this.setLocalScale(element, [1, 1, 1]);
@@ -10893,6 +10970,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
10893
10970
  DefaultSceneGraphService.prototype.getGeometryBounds = function (element, render) {
10894
10971
  if (render === void 0) { render = false; }
10895
10972
  var geometry = element.geometry;
10973
+ if (geometry.dirty) {
10974
+ runtime.styleValueRegistry.updateGeometry(element);
10975
+ }
10896
10976
  var bounds = render
10897
10977
  ? geometry.renderBounds
10898
10978
  : geometry.contentBounds || null;
@@ -11483,7 +11563,7 @@ var geometryUpdaterFactory = (function () {
11483
11563
  _a[exports.Shape.ELLIPSE] = new EllipseUpdater(),
11484
11564
  _a[exports.Shape.RECT] = rectUpdater,
11485
11565
  _a[exports.Shape.IMAGE] = rectUpdater,
11486
- _a[exports.Shape.GROUP] = rectUpdater,
11566
+ _a[exports.Shape.GROUP] = new GroupUpdater(),
11487
11567
  _a[exports.Shape.LINE] = new LineUpdater(),
11488
11568
  _a[exports.Shape.TEXT] = new TextUpdater(runtime),
11489
11569
  _a[exports.Shape.POLYLINE] = polylineUpdater,
@@ -11577,7 +11657,7 @@ var destroyEvent = new CustomEvent(exports.ElementEvent.DESTROY);
11577
11657
  var Element = /** @class */ (function (_super) {
11578
11658
  tslib.__extends(Element, _super);
11579
11659
  function Element() {
11580
- var _this = _super.apply(this, tslib.__spreadArray([], tslib.__read(arguments), false)) || this;
11660
+ var _this = _super.call(this) || this;
11581
11661
  /**
11582
11662
  * Unique id.
11583
11663
  */
@@ -11621,6 +11701,7 @@ var Element = /** @class */ (function (_super) {
11621
11701
  _this.geometry = {
11622
11702
  contentBounds: undefined,
11623
11703
  renderBounds: undefined,
11704
+ dirty: true,
11624
11705
  };
11625
11706
  _this.rBushNode = {
11626
11707
  aabb: undefined,
@@ -11804,11 +11885,8 @@ var Element = /** @class */ (function (_super) {
11804
11885
  if ((_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) {
11805
11886
  this.ownerDocument.defaultView.mountChildren(child);
11806
11887
  }
11807
- // @ts-ignore
11808
- if (child.isMutationObserved) {
11809
- insertedEvent.relatedNode = this;
11810
- child.dispatchEvent(insertedEvent);
11811
- }
11888
+ insertedEvent.relatedNode = this;
11889
+ child.dispatchEvent(insertedEvent);
11812
11890
  return child;
11813
11891
  };
11814
11892
  Element.prototype.insertBefore = function (newChild, refChild) {
@@ -12250,8 +12328,6 @@ var DisplayObject = /** @class */ (function (_super) {
12250
12328
  // assign name, id to config
12251
12329
  // eg. group.get('name')
12252
12330
  _this.config = config;
12253
- // compatible with G 3.0
12254
- // this.config.interactive = this.config.capture ?? this.config.interactive;
12255
12331
  // init scene graph node
12256
12332
  _this.id = _this.config.id || '';
12257
12333
  _this.name = _this.config.name || '';
@@ -12259,23 +12335,6 @@ var DisplayObject = /** @class */ (function (_super) {
12259
12335
  _this.className = _this.config.className || _this.config.class;
12260
12336
  }
12261
12337
  _this.nodeName = _this.config.type || exports.Shape.GROUP;
12262
- // // compatible with G 3.0
12263
- // this.config.style =
12264
- // this.config.style || this.config.attrs || ({} as StyleProps);
12265
- // // Object.assign(this.config.style, this.config.attrs);
12266
- // // this.config.style = {
12267
- // // // ...DEFAULT_STYLE_PROPS,
12268
- // // ...this.config.style,
12269
- // // ...this.config.attrs,
12270
- // // };
12271
- // if (this.config.visible != null) {
12272
- // this.config.style.visibility =
12273
- // this.config.visible === false ? 'hidden' : 'visible';
12274
- // }
12275
- // if (this.config.interactive != null) {
12276
- // this.config.style.pointerEvents =
12277
- // this.config.interactive === false ? 'none' : 'auto';
12278
- // }
12279
12338
  // merge parsed value
12280
12339
  Object.assign(_this.parsedStyle, runtime.enableCSSParsing
12281
12340
  ? DEFAULT_PARSED_STYLE_PROPS
@@ -12922,124 +12981,13 @@ var DisplayObject = /** @class */ (function (_super) {
12922
12981
  return DisplayObject;
12923
12982
  }(Element));
12924
12983
 
12925
- /**
12926
- * holds useful CSS-related methods.
12927
- * @see https://developer.mozilla.org/en-US/docs/Web/API/CSS
12928
- *
12929
- * * CSS Typed OM @see https://developer.mozilla.org/en-US/docs/Web/API/CSS/factory_functions
12930
- * * register property @see https://developer.mozilla.org/en-US/docs/Web/API/CSS/RegisterProperty
12931
- * * CSS Layout API
12932
- */
12933
- var CSS = {
12934
- /**
12935
- * <number>
12936
- * @see https://drafts.csswg.org/css-values-4/#number-value
12937
- */
12938
- number: function (n) {
12939
- return new CSSUnitValue(n);
12940
- },
12941
- /**
12942
- * <percentage>
12943
- * @see https://drafts.csswg.org/css-values-4/#percentage-value
12944
- */
12945
- percent: function (n) {
12946
- return new CSSUnitValue(n, '%');
12947
- },
12948
- /**
12949
- * <length>
12950
- */
12951
- px: function (n) {
12952
- return new CSSUnitValue(n, 'px');
12953
- },
12954
- /**
12955
- * <length>
12956
- */
12957
- em: function (n) {
12958
- return new CSSUnitValue(n, 'em');
12959
- },
12960
- rem: function (n) {
12961
- return new CSSUnitValue(n, 'rem');
12962
- },
12963
- /**
12964
- * <angle>
12965
- */
12966
- deg: function (n) {
12967
- return new CSSUnitValue(n, 'deg');
12968
- },
12969
- /**
12970
- * <angle>
12971
- */
12972
- grad: function (n) {
12973
- return new CSSUnitValue(n, 'grad');
12974
- },
12975
- /**
12976
- * <angle>
12977
- */
12978
- rad: function (n) {
12979
- return new CSSUnitValue(n, 'rad');
12980
- },
12981
- /**
12982
- * <angle>
12983
- */
12984
- turn: function (n) {
12985
- return new CSSUnitValue(n, 'turn');
12986
- },
12987
- /**
12988
- * <time>
12989
- */
12990
- s: function (n) {
12991
- return new CSSUnitValue(n, 's');
12992
- },
12993
- /**
12994
- * <time>
12995
- */
12996
- ms: function (n) {
12997
- return new CSSUnitValue(n, 'ms');
12998
- },
12999
- /**
13000
- * CSS Properties & Values API
13001
- *
13002
- * @see https://developer.mozilla.org/en-US/docs/Web/API/CSS_Properties_and_Values_API
13003
- * @see https://drafts.css-houdini.org/css-properties-values-api/#registering-custom-properties
13004
- * @see https://developer.mozilla.org/en-US/docs/Web/API/CSS/RegisterProperty
13005
- */
13006
- registerProperty: function (definition) {
13007
- var name = definition.name, inherits = definition.inherits, interpolable = definition.interpolable, initialValue = definition.initialValue, syntax = definition.syntax;
13008
- runtime.styleValueRegistry.registerMetadata({
13009
- n: name,
13010
- inh: inherits,
13011
- int: interpolable,
13012
- d: initialValue,
13013
- syntax: syntax,
13014
- });
13015
- },
13016
- /**
13017
- * CSS Layout API
13018
- * register layout
13019
- *
13020
- * @see https://github.com/w3c/css-houdini-drafts/blob/main/css-layout-api/EXPLAINER.md
13021
- * @see https://developer.mozilla.org/en-US/docs/Web/Guide/Houdini#css_layout_api
13022
- */
13023
- registerLayout: function (name, clazz) {
13024
- runtime.layoutRegistry.registerLayout(name, clazz);
13025
- },
13026
- };
13027
-
13028
12984
  var Circle = /** @class */ (function (_super) {
13029
12985
  tslib.__extends(Circle, _super);
13030
- // constructor(options: DisplayObjectConfig<CircleStyleProps> = {}) {
13031
- // super(options);
13032
- // this.nodeName = Shape.CIRCLE;
13033
- // }
13034
- function Circle(_a) {
13035
- if (_a === void 0) { _a = {}; }
13036
- var style = _a.style, rest = tslib.__rest(_a, ["style"]);
13037
- return _super.call(this, tslib.__assign({ type: exports.Shape.CIRCLE, style: runtime.enableCSSParsing
13038
- ? tslib.__assign({ cx: '', cy: '', r: '' }, style) : tslib.__assign({}, style), initialParsedStyle: {
13039
- transformOrigin: runtime.enableCSSParsing
13040
- ? null
13041
- : [PECENTAGE_50, PECENTAGE_50],
13042
- } }, rest)) || this;
12986
+ function Circle(options) {
12987
+ if (options === void 0) { options = {}; }
12988
+ var _this = _super.call(this, options) || this;
12989
+ _this.nodeName = exports.Shape.CIRCLE;
12990
+ return _this;
13043
12991
  }
13044
12992
  return Circle;
13045
12993
  }(DisplayObject));
@@ -13068,15 +13016,11 @@ var CustomElement = /** @class */ (function (_super) {
13068
13016
 
13069
13017
  var Ellipse = /** @class */ (function (_super) {
13070
13018
  tslib.__extends(Ellipse, _super);
13071
- function Ellipse(_a) {
13072
- if (_a === void 0) { _a = {}; }
13073
- var style = _a.style, rest = tslib.__rest(_a, ["style"]);
13074
- return _super.call(this, tslib.__assign({ type: exports.Shape.ELLIPSE, style: runtime.enableCSSParsing
13075
- ? tslib.__assign({ cx: '', cy: '', rx: '', ry: '' }, style) : tslib.__assign({}, style), initialParsedStyle: {
13076
- transformOrigin: runtime.enableCSSParsing
13077
- ? null
13078
- : [PECENTAGE_50, PECENTAGE_50],
13079
- } }, rest)) || this;
13019
+ function Ellipse(options) {
13020
+ if (options === void 0) { options = {}; }
13021
+ var _this = _super.call(this, options) || this;
13022
+ _this.nodeName = exports.Shape.ELLIPSE;
13023
+ return _this;
13080
13024
  }
13081
13025
  return Ellipse;
13082
13026
  }(DisplayObject));
@@ -13827,6 +13771,109 @@ var CustomElementRegistry = /** @class */ (function () {
13827
13771
  return CustomElementRegistry;
13828
13772
  }());
13829
13773
 
13774
+ /**
13775
+ * holds useful CSS-related methods.
13776
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/CSS
13777
+ *
13778
+ * * CSS Typed OM @see https://developer.mozilla.org/en-US/docs/Web/API/CSS/factory_functions
13779
+ * * register property @see https://developer.mozilla.org/en-US/docs/Web/API/CSS/RegisterProperty
13780
+ * * CSS Layout API
13781
+ */
13782
+ var CSS = {
13783
+ /**
13784
+ * <number>
13785
+ * @see https://drafts.csswg.org/css-values-4/#number-value
13786
+ */
13787
+ number: function (n) {
13788
+ return new CSSUnitValue(n);
13789
+ },
13790
+ /**
13791
+ * <percentage>
13792
+ * @see https://drafts.csswg.org/css-values-4/#percentage-value
13793
+ */
13794
+ percent: function (n) {
13795
+ return new CSSUnitValue(n, '%');
13796
+ },
13797
+ /**
13798
+ * <length>
13799
+ */
13800
+ px: function (n) {
13801
+ return new CSSUnitValue(n, 'px');
13802
+ },
13803
+ /**
13804
+ * <length>
13805
+ */
13806
+ em: function (n) {
13807
+ return new CSSUnitValue(n, 'em');
13808
+ },
13809
+ rem: function (n) {
13810
+ return new CSSUnitValue(n, 'rem');
13811
+ },
13812
+ /**
13813
+ * <angle>
13814
+ */
13815
+ deg: function (n) {
13816
+ return new CSSUnitValue(n, 'deg');
13817
+ },
13818
+ /**
13819
+ * <angle>
13820
+ */
13821
+ grad: function (n) {
13822
+ return new CSSUnitValue(n, 'grad');
13823
+ },
13824
+ /**
13825
+ * <angle>
13826
+ */
13827
+ rad: function (n) {
13828
+ return new CSSUnitValue(n, 'rad');
13829
+ },
13830
+ /**
13831
+ * <angle>
13832
+ */
13833
+ turn: function (n) {
13834
+ return new CSSUnitValue(n, 'turn');
13835
+ },
13836
+ /**
13837
+ * <time>
13838
+ */
13839
+ s: function (n) {
13840
+ return new CSSUnitValue(n, 's');
13841
+ },
13842
+ /**
13843
+ * <time>
13844
+ */
13845
+ ms: function (n) {
13846
+ return new CSSUnitValue(n, 'ms');
13847
+ },
13848
+ /**
13849
+ * CSS Properties & Values API
13850
+ *
13851
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/CSS_Properties_and_Values_API
13852
+ * @see https://drafts.css-houdini.org/css-properties-values-api/#registering-custom-properties
13853
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/CSS/RegisterProperty
13854
+ */
13855
+ registerProperty: function (definition) {
13856
+ var name = definition.name, inherits = definition.inherits, interpolable = definition.interpolable, initialValue = definition.initialValue, syntax = definition.syntax;
13857
+ runtime.styleValueRegistry.registerMetadata({
13858
+ n: name,
13859
+ inh: inherits,
13860
+ int: interpolable,
13861
+ d: initialValue,
13862
+ syntax: syntax,
13863
+ });
13864
+ },
13865
+ /**
13866
+ * CSS Layout API
13867
+ * register layout
13868
+ *
13869
+ * @see https://github.com/w3c/css-houdini-drafts/blob/main/css-layout-api/EXPLAINER.md
13870
+ * @see https://developer.mozilla.org/en-US/docs/Web/Guide/Houdini#css_layout_api
13871
+ */
13872
+ registerLayout: function (name, clazz) {
13873
+ runtime.layoutRegistry.registerLayout(name, clazz);
13874
+ },
13875
+ };
13876
+
13830
13877
  /**
13831
13878
  * the entry of DOM tree
13832
13879
  * Document -> Node -> EventTarget
@@ -15330,6 +15377,7 @@ exports.FederatedPointerEvent = FederatedPointerEvent;
15330
15377
  exports.FederatedWheelEvent = FederatedWheelEvent;
15331
15378
  exports.Frustum = Frustum;
15332
15379
  exports.Group = Group;
15380
+ exports.GroupUpdater = GroupUpdater;
15333
15381
  exports.HTML = HTML;
15334
15382
  exports.Image = Image;
15335
15383
  exports.Line = Line;