@antv/g 5.4.0 → 5.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/components/Transform.d.ts +5 -1
  2. package/dist/components/Transform.d.ts.map +1 -1
  3. package/dist/css/StyleValueRegistry.d.ts +1 -0
  4. package/dist/css/StyleValueRegistry.d.ts.map +1 -1
  5. package/dist/css/cssom/CSSNumericValue.d.ts +1 -1
  6. package/dist/css/cssom/CSSStyleValue.d.ts +2 -2
  7. package/dist/css/cssom/CSSStyleValue.d.ts.map +1 -1
  8. package/dist/css/interfaces.d.ts +1 -1
  9. package/dist/css/interfaces.d.ts.map +1 -1
  10. package/dist/css/layout/LayoutObject.d.ts +2 -2
  11. package/dist/css/layout/LayoutObject.d.ts.map +1 -1
  12. package/dist/css/parser/dimension.d.ts +1 -0
  13. package/dist/css/parser/dimension.d.ts.map +1 -1
  14. package/dist/css/parser/path.d.ts +2 -2
  15. package/dist/css/parser/path.d.ts.map +1 -1
  16. package/dist/css/parser/transform.d.ts +1 -0
  17. package/dist/css/parser/transform.d.ts.map +1 -1
  18. package/dist/css/properties/CSSPropertyClipPath.d.ts +1 -0
  19. package/dist/css/properties/CSSPropertyClipPath.d.ts.map +1 -1
  20. package/dist/css/properties/CSSPropertyLengthOrPercentage.d.ts.map +1 -1
  21. package/dist/css/properties/CSSPropertyNumber.d.ts +8 -0
  22. package/dist/css/properties/CSSPropertyNumber.d.ts.map +1 -0
  23. package/dist/css/properties/CSSPropertyTransform.d.ts.map +1 -1
  24. package/dist/css/properties/index.d.ts +1 -0
  25. package/dist/css/properties/index.d.ts.map +1 -1
  26. package/dist/display-objects/Circle.d.ts.map +1 -1
  27. package/dist/display-objects/DisplayObject.d.ts +3 -0
  28. package/dist/display-objects/DisplayObject.d.ts.map +1 -1
  29. package/dist/display-objects/Ellipse.d.ts.map +1 -1
  30. package/dist/display-objects/Line.d.ts.map +1 -1
  31. package/dist/display-objects/Path.d.ts +1 -1
  32. package/dist/display-objects/Path.d.ts.map +1 -1
  33. package/dist/display-objects/Polyline.d.ts.map +1 -1
  34. package/dist/dom/interfaces.d.ts +1 -1
  35. package/dist/dom/interfaces.d.ts.map +1 -1
  36. package/dist/global-module.d.ts.map +1 -1
  37. package/dist/index.esm.js +747 -292
  38. package/dist/index.js +707 -251
  39. package/dist/index.umd.js +1696 -680
  40. package/dist/index.umd.min.js +2 -2
  41. package/dist/plugins/DirtyCheckPlugin.d.ts +0 -1
  42. package/dist/plugins/DirtyCheckPlugin.d.ts.map +1 -1
  43. package/dist/plugins/PrepareRendererPlugin.d.ts +1 -0
  44. package/dist/plugins/PrepareRendererPlugin.d.ts.map +1 -1
  45. package/dist/services/RenderingService.d.ts +9 -1
  46. package/dist/services/RenderingService.d.ts.map +1 -1
  47. package/dist/services/SceneGraphSelector.d.ts.map +1 -1
  48. package/dist/services/SceneGraphService.d.ts +12 -3
  49. package/dist/services/SceneGraphService.d.ts.map +1 -1
  50. package/dist/types.d.ts +0 -5
  51. package/dist/types.d.ts.map +1 -1
  52. package/dist/utils/interpolation.d.ts.map +1 -1
  53. package/dist/utils/string.d.ts +4 -1
  54. package/dist/utils/string.d.ts.map +1 -1
  55. package/package.json +6 -5
package/dist/index.esm.js CHANGED
@@ -4,11 +4,12 @@ import RBush from 'rbush';
4
4
  export { default as RBush } from 'rbush';
5
5
  import 'reflect-metadata';
6
6
  import { __decorate, __param, __metadata } from 'tslib';
7
- import { vec3, mat3, mat4, quat, vec4 } from 'gl-matrix';
7
+ import { vec3, mat3, mat4, quat as quat$1, vec2, vec4 } from 'gl-matrix';
8
8
  import { EventEmitter } from 'eventemitter3';
9
9
  import { color } from 'd3-color';
10
- import { normalizePath, path2Curve, getPathBBoxTotalLength, equalizeSegments, getDrawDirection, reverseCurve, clonePath, getRotatedCurve, getPointAtLength } from '@antv/util';
10
+ import { path2String, normalizePath, path2Curve, getPathBBoxTotalLength, equalizeSegments, getDrawDirection, reverseCurve, clonePath, getRotatedCurve, getPointAtLength } from '@antv/util';
11
11
  import { Polyline as Polyline$1, Line as Line$1 } from '@antv/g-math';
12
+ import decomposeMatrix from 'mat4-decompose';
12
13
  import { requestAnimationFrame as requestAnimationFrame$1, cancelAnimationFrame as cancelAnimationFrame$1 } from 'request-animation-frame-polyfill';
13
14
 
14
15
  function _regeneratorRuntime() {
@@ -1233,7 +1234,7 @@ var convertToDash = function convertToDash(str) {
1233
1234
  return "-" + letter.toLowerCase();
1234
1235
  }); // Remove first dash
1235
1236
 
1236
- return str.charAt(0) === '-' ? str.substr(1) : str;
1237
+ return str.charAt(0) === '-' ? str.substring(1) : str;
1237
1238
  };
1238
1239
  /**
1239
1240
  Easing Functions from anime.js, they are tried and true, so, its better to use them instead of other alternatives
@@ -2332,20 +2333,45 @@ function calculateIterationProgress(activeDuration, localTime, timing) {
2332
2333
  return timing.easingFunction(directedProgress);
2333
2334
  }
2334
2335
 
2335
- var cache = {};
2336
- function camelCase(str) {
2337
- if (str === void 0) {
2338
- str = '';
2336
+ /**
2337
+ * @see https://github.com/lodash/lodash/blob/master/memoize.js
2338
+ */
2339
+ function memoize(func, resolver) {
2340
+ if (typeof func !== 'function' || resolver != null && typeof resolver !== 'function') {
2341
+ throw new TypeError('Expected a function');
2339
2342
  }
2340
2343
 
2341
- if (!cache[str]) {
2342
- cache[str] = str.replace(/-([a-z])/g, function (g) {
2343
- return g[1].toUpperCase();
2344
- });
2345
- }
2344
+ var memoized = function memoized() {
2345
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2346
+ args[_key] = arguments[_key];
2347
+ }
2348
+
2349
+ var key = resolver ? resolver.apply(this, args) : args[0];
2350
+ var cache = memoized.cache;
2351
+
2352
+ if (cache.has(key)) {
2353
+ return cache.get(key);
2354
+ }
2346
2355
 
2347
- return cache[str];
2356
+ var result = func.apply(this, args);
2357
+ memoized.cache = cache.set(key, result) || cache;
2358
+ return result;
2359
+ };
2360
+
2361
+ memoized.cache = new (memoize.Cache || Map)();
2362
+ return memoized;
2348
2363
  }
2364
+ memoize.Cache = Map;
2365
+
2366
+ var camelCase = memoize(function (str) {
2367
+ if (str === void 0) {
2368
+ str = '';
2369
+ }
2370
+
2371
+ return str.replace(/-([a-z])/g, function (g) {
2372
+ return g[1].toUpperCase();
2373
+ });
2374
+ });
2349
2375
  function isString(str) {
2350
2376
  if (!isNil(str) && typeof str === 'string') {
2351
2377
  return true;
@@ -2551,45 +2577,33 @@ var FORMAT_ATTR_MAP = {
2551
2577
  alias: 'img'
2552
2578
  }
2553
2579
  };
2554
- function formatAttribute(name, value) {
2555
- var _map$values;
2556
-
2580
+ var formatAttributeName = memoize(function (name) {
2557
2581
  var attributeName = camelCase(name);
2558
2582
  var map = FORMAT_ATTR_MAP[attributeName];
2559
2583
  attributeName = (map === null || map === void 0 ? void 0 : map.alias) || attributeName;
2560
- var attributeValue = (map === null || map === void 0 ? void 0 : (_map$values = map.values) === null || _map$values === void 0 ? void 0 : _map$values[value]) || value;
2561
- return [attributeName, attributeValue];
2562
- }
2563
-
2564
- /**
2565
- * @see https://github.com/lodash/lodash/blob/master/memoize.js
2566
- */
2567
- function memoize(func, resolver) {
2568
- if (typeof func !== 'function' || resolver != null && typeof resolver !== 'function') {
2569
- throw new TypeError('Expected a function');
2570
- }
2571
-
2572
- var memoized = function memoized() {
2573
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2574
- args[_key] = arguments[_key];
2575
- }
2576
-
2577
- var key = resolver ? resolver.apply(this, args) : args[0];
2578
- var cache = memoized.cache;
2579
-
2580
- if (cache.has(key)) {
2581
- return cache.get(key);
2582
- }
2584
+ return [attributeName, map];
2585
+ });
2586
+ function formatAttribute(name, value) {
2587
+ var _map$values;
2583
2588
 
2584
- var result = func.apply(this, args);
2585
- memoized.cache = cache.set(key, result) || cache;
2586
- return result;
2587
- };
2589
+ var _formatAttributeName = formatAttributeName(name),
2590
+ attributeName = _formatAttributeName[0],
2591
+ map = _formatAttributeName[1];
2588
2592
 
2589
- memoized.cache = new (memoize.Cache || Map)();
2590
- return memoized;
2591
- }
2592
- memoize.Cache = Map;
2593
+ var attributeValue = isString(value) && (map === null || map === void 0 ? void 0 : (_map$values = map.values) === null || _map$values === void 0 ? void 0 : _map$values[value]) || value;
2594
+ return [attributeName, attributeValue];
2595
+ } // export const formatAttribute = memoize(
2596
+ // (name: string, value: any): [string, any] => {
2597
+ // let attributeName = camelCase(name);
2598
+ // const map = FORMAT_ATTR_MAP[attributeName];
2599
+ // attributeName = map?.alias || attributeName;
2600
+ // const attributeValue = map?.values?.[value] || value;
2601
+ // return [attributeName, attributeValue];
2602
+ // },
2603
+ // (name: string, value: any) => {
2604
+ // return `${name}${value}`;
2605
+ // },
2606
+ // );
2593
2607
 
2594
2608
  var Shape;
2595
2609
 
@@ -5171,8 +5185,8 @@ var CSSStyleValue = /*#__PURE__*/function () {
5171
5185
  return UnitType.kPixels;
5172
5186
 
5173
5187
  case UnitCategory.kUPercent:
5174
- return UnitType.kUnknown;
5175
- // Cannot convert between numbers and percent.
5188
+ return UnitType.kPercentage;
5189
+ // return UnitType.kUnknown; // Cannot convert between numbers and percent.
5176
5190
 
5177
5191
  case UnitCategory.kUTime:
5178
5192
  return UnitType.kSeconds;
@@ -8020,6 +8034,10 @@ function parserPercentage(css) {
8020
8034
  */
8021
8035
 
8022
8036
  function parseLengthOrPercentage(css) {
8037
+ if (isNumber(css)) {
8038
+ return new CSSUnitValue(css, 'px');
8039
+ }
8040
+
8023
8041
  return parseDimension(new RegExp('px|%|em|rem', 'g'), css);
8024
8042
  }
8025
8043
  function parseAngle(css) {
@@ -8031,6 +8049,7 @@ function parseAngle(css) {
8031
8049
  * @example
8032
8050
  * 10px + 20px = 30px
8033
8051
  * 10deg + 10rad
8052
+ * 10% + 20% = 30%
8034
8053
  */
8035
8054
 
8036
8055
  function mergeDimensions(left, right, target, nonNegative, index) {
@@ -8040,23 +8059,29 @@ function mergeDimensions(left, right, target, nonNegative, index) {
8040
8059
 
8041
8060
  var unit = '';
8042
8061
  var leftValue = left.value || 0;
8043
- var rightValue = right.value || 0; // const canonicalUnit = CSSUnitValue.toCanonicalUnit(left.unit);
8044
- // const leftCanonicalUnitValue = left.convertTo(canonicalUnit);
8045
- // const rightCanonicalUnitValue = right.convertTo(canonicalUnit);
8046
- // format '%' to 'px'
8047
-
8048
- if (CSSUnitValue.isLength(left.unit) || CSSUnitValue.isLength(right.unit)) {
8049
- leftValue = convertPercentUnit(left, index, target);
8050
- rightValue = convertPercentUnit(right, index, target);
8051
- unit = 'px';
8052
- } // format 'rad' 'turn' to 'deg'
8053
-
8062
+ var rightValue = right.value || 0;
8063
+ var canonicalUnit = CSSUnitValue.toCanonicalUnit(left.unit);
8064
+ var leftCanonicalUnitValue = left.convertTo(canonicalUnit);
8065
+ var rightCanonicalUnitValue = right.convertTo(canonicalUnit);
8066
+
8067
+ if (leftCanonicalUnitValue && rightCanonicalUnitValue) {
8068
+ leftValue = leftCanonicalUnitValue.value;
8069
+ rightValue = rightCanonicalUnitValue.value;
8070
+ unit = CSSUnitValue.unitTypeToString(left.unit);
8071
+ } else {
8072
+ // format '%' to 'px'
8073
+ if (CSSUnitValue.isLength(left.unit) || CSSUnitValue.isLength(right.unit)) {
8074
+ leftValue = convertPercentUnit(left, index, target);
8075
+ rightValue = convertPercentUnit(right, index, target);
8076
+ unit = 'px';
8077
+ }
8078
+ } // // format 'rad' 'turn' to 'deg'
8079
+ // if (CSSUnitValue.isAngle(left.unit) || CSSUnitValue.isAngle(right.unit)) {
8080
+ // leftValue = convertAngleUnit(left);
8081
+ // rightValue = convertAngleUnit(right);
8082
+ // unit = 'deg';
8083
+ // }
8054
8084
 
8055
- if (CSSUnitValue.isAngle(left.unit) || CSSUnitValue.isAngle(right.unit)) {
8056
- leftValue = convertAngleUnit(left);
8057
- rightValue = convertAngleUnit(right);
8058
- unit = 'deg';
8059
- }
8060
8085
 
8061
8086
  return [leftValue, rightValue, function (value) {
8062
8087
  if (nonNegative) {
@@ -8186,7 +8211,7 @@ function mergeNumberLists(left, right) {
8186
8211
  }];
8187
8212
  }
8188
8213
 
8189
- function parsePath(path, object) {
8214
+ var memoizedParsePath = memoize(function (path) {
8190
8215
  var absolutePath;
8191
8216
 
8192
8217
  try {
@@ -8218,11 +8243,6 @@ function parsePath(path, object) {
8218
8243
  height = _getPathBBoxTotalLeng.height,
8219
8244
  length = _getPathBBoxTotalLeng.length;
8220
8245
 
8221
- if (object) {
8222
- object.parsedStyle.defX = x;
8223
- object.parsedStyle.defY = y;
8224
- }
8225
-
8226
8246
  return {
8227
8247
  absolutePath: absolutePath,
8228
8248
  hasArc: hasArc,
@@ -8234,6 +8254,18 @@ function parsePath(path, object) {
8234
8254
  zCommandIndexes: zCommandIndexes,
8235
8255
  rect: new Rectangle(x, y, width, height)
8236
8256
  };
8257
+ }, function (path) {
8258
+ return isString(path) ? path : path2String(path);
8259
+ });
8260
+ function parsePath(path, object) {
8261
+ var result = memoizedParsePath(path);
8262
+
8263
+ if (object) {
8264
+ object.parsedStyle.defX = result.rect.x;
8265
+ object.parsedStyle.defY = result.rect.y;
8266
+ }
8267
+
8268
+ return result;
8237
8269
  }
8238
8270
  function mergePaths(left, right, object) {
8239
8271
  var curve1 = left.curve;
@@ -8490,22 +8522,23 @@ function id$1(x) {
8490
8522
 
8491
8523
 
8492
8524
  var transformFunctions = {
8493
- // matrix: ['NNNNNN', [_, _, 0, 0, _, _, 0, 0, 0, 0, 1, 0, _, _, 0, 1], id],
8494
- // matrix3d: ['NNNNNNNNNNNNNNNN', id],
8525
+ // @ts-ignore
8526
+ matrix: ['NNNNNN', [_, _, 0, 0, _, _, 0, 0, 0, 0, 1, 0, _, _, 0, 1], id$1],
8527
+ matrix3d: ['NNNNNNNNNNNNNNNN', id$1],
8495
8528
  rotate: ['A'],
8496
8529
  rotatex: ['A'],
8497
8530
  rotatey: ['A'],
8498
8531
  rotatez: ['A'],
8499
8532
  rotate3d: ['NNNA'],
8500
- // perspective: ['L'],
8533
+ perspective: ['L'],
8501
8534
  scale: ['Nn', cast([_, _, CSS.number(1)]), id$1],
8502
8535
  scalex: ['N', cast([_, CSS.number(1), CSS.number(1)]), cast([_, CSS.number(1)])],
8503
8536
  scaley: ['N', cast([CSS.number(1), _, CSS.number(1)]), cast([CSS.number(1), _])],
8504
8537
  scalez: ['N', cast([CSS.number(1), CSS.number(1), _])],
8505
8538
  scale3d: ['NNN', id$1],
8506
- // skew: ['Aa', null, id],
8507
- // skewx: ['A', null, cast([_, Odeg])],
8508
- // skewy: ['A', null, cast([Odeg, _])],
8539
+ skew: ['Aa', null, id$1],
8540
+ skewx: ['A', null, cast([_, Odeg])],
8541
+ skewy: ['A', null, cast([Odeg, _])],
8509
8542
  translate: ['Tt', cast([_, _, Opx]), id$1],
8510
8543
  translatex: ['T', cast([_, Opx, Opx]), cast([_, Opx])],
8511
8544
  translatey: ['T', cast([Opx, _, Opx]), cast([Opx, _])],
@@ -8598,33 +8631,289 @@ function parseTransform(string) {
8598
8631
  }
8599
8632
 
8600
8633
  return [];
8601
- } // function mergeMatrices(left: number[][], right: number[][]): [
8602
- // number[][], number[][], () => string,
8603
- // ] {
8604
- // if (left.decompositionPair !== right) {
8605
- // left.decompositionPair = right;
8606
- // var leftArgs = makeMatrixDecomposition(left);
8607
- // }
8608
- // if (right.decompositionPair !== left) {
8609
- // right.decompositionPair = left;
8610
- // var rightArgs = makeMatrixDecomposition(right);
8611
- // }
8612
- // if (leftArgs[0] === null || rightArgs[0] === null)
8613
- // return [[false], [true], (x) => { return x ? right[0].d : left[0].d; }];
8614
- // leftArgs[0].push(0);
8615
- // rightArgs[0].push(1);
8616
- // return [
8617
- // leftArgs,
8618
- // rightArgs,
8619
- // (list) => {
8620
- // const q = quat(leftArgs[0][3], rightArgs[0][3], list[5]);
8621
- // const mat = composeMatrix(list[0], list[1], list[2], q, list[4]);
8622
- // const stringifiedArgs = mat.map(numberToLongString).join(',');
8623
- // return stringifiedArgs;
8624
- // }
8625
- // ];
8626
- // }
8627
- // scalex/y/z -> scale
8634
+ }
8635
+ function convertItemToMatrix(item) {
8636
+ var x;
8637
+ var y;
8638
+ var z;
8639
+ var angle;
8640
+
8641
+ switch (item.t) {
8642
+ case 'rotatex':
8643
+ angle = deg2rad(convertAngleUnit(item.d[0]));
8644
+ return [1, 0, 0, 0, 0, Math.cos(angle), Math.sin(angle), 0, 0, -Math.sin(angle), Math.cos(angle), 0, 0, 0, 0, 1];
8645
+
8646
+ case 'rotatey':
8647
+ angle = deg2rad(convertAngleUnit(item.d[0]));
8648
+ return [Math.cos(angle), 0, -Math.sin(angle), 0, 0, 1, 0, 0, Math.sin(angle), 0, Math.cos(angle), 0, 0, 0, 0, 1];
8649
+
8650
+ case 'rotate':
8651
+ case 'rotatez':
8652
+ angle = deg2rad(convertAngleUnit(item.d[0]));
8653
+ return [Math.cos(angle), Math.sin(angle), 0, 0, -Math.sin(angle), Math.cos(angle), 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
8654
+
8655
+ case 'rotate3d':
8656
+ x = item.d[0].value;
8657
+ y = item.d[1].value;
8658
+ z = item.d[2].value;
8659
+ angle = deg2rad(convertAngleUnit(item.d[3]));
8660
+ var sqrLength = x * x + y * y + z * z;
8661
+
8662
+ if (sqrLength === 0) {
8663
+ x = 1;
8664
+ y = 0;
8665
+ z = 0;
8666
+ } else if (sqrLength !== 1) {
8667
+ var length = Math.sqrt(sqrLength);
8668
+ x /= length;
8669
+ y /= length;
8670
+ z /= length;
8671
+ }
8672
+
8673
+ var s = Math.sin(angle / 2);
8674
+ var sc = s * Math.cos(angle / 2);
8675
+ var sq = s * s;
8676
+ return [1 - 2 * (y * y + z * z) * sq, 2 * (x * y * sq + z * sc), 2 * (x * z * sq - y * sc), 0, 2 * (x * y * sq - z * sc), 1 - 2 * (x * x + z * z) * sq, 2 * (y * z * sq + x * sc), 0, 2 * (x * z * sq + y * sc), 2 * (y * z * sq - x * sc), 1 - 2 * (x * x + y * y) * sq, 0, 0, 0, 0, 1];
8677
+
8678
+ case 'scale':
8679
+ return [item.d[0].value, 0, 0, 0, 0, item.d[1].value, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
8680
+
8681
+ case 'scalex':
8682
+ return [item.d[0].value, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
8683
+
8684
+ case 'scaley':
8685
+ return [1, 0, 0, 0, 0, item.d[0].value, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
8686
+
8687
+ case 'scalez':
8688
+ return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, item.d[0].value, 0, 0, 0, 0, 1];
8689
+
8690
+ case 'scale3d':
8691
+ return [item.d[0].value, 0, 0, 0, 0, item.d[1].value, 0, 0, 0, 0, item.d[2].value, 0, 0, 0, 0, 1];
8692
+
8693
+ case 'skew':
8694
+ var xAngle = deg2rad(convertAngleUnit(item.d[0]));
8695
+ var yAngle = deg2rad(convertAngleUnit(item.d[1]));
8696
+ return [1, Math.tan(yAngle), 0, 0, Math.tan(xAngle), 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
8697
+
8698
+ case 'skewx':
8699
+ angle = deg2rad(convertAngleUnit(item.d[0]));
8700
+ return [1, 0, 0, 0, Math.tan(angle), 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
8701
+
8702
+ case 'skewy':
8703
+ angle = deg2rad(convertAngleUnit(item.d[0]));
8704
+ return [1, Math.tan(angle), 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
8705
+
8706
+ case 'translate':
8707
+ // TODO: pass target
8708
+ x = convertPercentUnit(item.d[0], 0, null) || 0;
8709
+ y = convertPercentUnit(item.d[1], 0, null) || 0;
8710
+ return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x, y, 0, 1];
8711
+
8712
+ case 'translatex':
8713
+ x = convertPercentUnit(item.d[0], 0, null) || 0;
8714
+ return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x, 0, 0, 1];
8715
+
8716
+ case 'translatey':
8717
+ y = convertPercentUnit(item.d[0], 0, null) || 0;
8718
+ return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, y, 0, 1];
8719
+
8720
+ case 'translatez':
8721
+ z = convertPercentUnit(item.d[0], 0, null) || 0;
8722
+ return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, z, 1];
8723
+
8724
+ case 'translate3d':
8725
+ x = convertPercentUnit(item.d[0], 0, null) || 0;
8726
+ y = convertPercentUnit(item.d[1], 0, null) || 0;
8727
+ z = convertPercentUnit(item.d[2], 0, null) || 0;
8728
+ return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x, y, z, 1];
8729
+
8730
+ case 'perspective':
8731
+ var t = convertPercentUnit(item.d[0], 0, null) || 0;
8732
+ var p = t ? -1 / t : 0;
8733
+ return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, p, 0, 0, 0, 1];
8734
+
8735
+ case 'matrix':
8736
+ return [item.d[0].value, item.d[1].value, 0, 0, item.d[2].value, item.d[3].value, 0, 0, 0, 0, 1, 0, item.d[4].value, item.d[5].value, 0, 1];
8737
+
8738
+ case 'matrix3d':
8739
+ return item.d.map(function (d) {
8740
+ return d.value;
8741
+ });
8742
+ }
8743
+ }
8744
+
8745
+ function multiplyMatrices(a, b) {
8746
+ return [a[0] * b[0] + a[4] * b[1] + a[8] * b[2] + a[12] * b[3], a[1] * b[0] + a[5] * b[1] + a[9] * b[2] + a[13] * b[3], a[2] * b[0] + a[6] * b[1] + a[10] * b[2] + a[14] * b[3], a[3] * b[0] + a[7] * b[1] + a[11] * b[2] + a[15] * b[3], a[0] * b[4] + a[4] * b[5] + a[8] * b[6] + a[12] * b[7], a[1] * b[4] + a[5] * b[5] + a[9] * b[6] + a[13] * b[7], a[2] * b[4] + a[6] * b[5] + a[10] * b[6] + a[14] * b[7], a[3] * b[4] + a[7] * b[5] + a[11] * b[6] + a[15] * b[7], a[0] * b[8] + a[4] * b[9] + a[8] * b[10] + a[12] * b[11], a[1] * b[8] + a[5] * b[9] + a[9] * b[10] + a[13] * b[11], a[2] * b[8] + a[6] * b[9] + a[10] * b[10] + a[14] * b[11], a[3] * b[8] + a[7] * b[9] + a[11] * b[10] + a[15] * b[11], a[0] * b[12] + a[4] * b[13] + a[8] * b[14] + a[12] * b[15], a[1] * b[12] + a[5] * b[13] + a[9] * b[14] + a[13] * b[15], a[2] * b[12] + a[6] * b[13] + a[10] * b[14] + a[14] * b[15], a[3] * b[12] + a[7] * b[13] + a[11] * b[14] + a[15] * b[15]];
8747
+ }
8748
+
8749
+ function convertToMatrix(transformList) {
8750
+ if (transformList.length === 0) {
8751
+ return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
8752
+ }
8753
+
8754
+ return transformList.map(convertItemToMatrix).reduce(multiplyMatrices);
8755
+ }
8756
+
8757
+ function makeMatrixDecomposition(transformList) {
8758
+ var translate = [0, 0, 0];
8759
+ var scale = [0, 0, 0];
8760
+ var skew = [0, 0, 0];
8761
+ var perspective = [0, 0, 0, 1];
8762
+ var quaternion = [0, 0, 0, 1];
8763
+ decomposeMatrix(convertToMatrix(transformList), translate, scale, skew, perspective, quaternion);
8764
+ return [translate, scale, skew, quaternion, perspective];
8765
+ }
8766
+
8767
+ var composeMatrix = function () {
8768
+ function multiply(a, b) {
8769
+ var result = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]];
8770
+
8771
+ for (var i = 0; i < 4; i++) {
8772
+ for (var j = 0; j < 4; j++) {
8773
+ for (var k = 0; k < 4; k++) {
8774
+ result[i][j] += b[i][k] * a[k][j];
8775
+ }
8776
+ }
8777
+ }
8778
+
8779
+ return result;
8780
+ }
8781
+
8782
+ function is2D(m) {
8783
+ return m[0][2] == 0 && m[0][3] == 0 && m[1][2] == 0 && m[1][3] == 0 && m[2][0] == 0 && m[2][1] == 0 && m[2][2] == 1 && m[2][3] == 0 && m[3][2] == 0 && m[3][3] == 1;
8784
+ }
8785
+
8786
+ function composeMatrix(translate, scale, skew, quat, perspective) {
8787
+ var matrix = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]];
8788
+
8789
+ for (var i = 0; i < 4; i++) {
8790
+ matrix[i][3] = perspective[i];
8791
+ }
8792
+
8793
+ for (var _i = 0; _i < 3; _i++) {
8794
+ for (var j = 0; j < 3; j++) {
8795
+ matrix[3][_i] += translate[j] * matrix[j][_i];
8796
+ }
8797
+ }
8798
+
8799
+ var x = quat[0],
8800
+ y = quat[1],
8801
+ z = quat[2],
8802
+ w = quat[3];
8803
+ var rotMatrix = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]];
8804
+ rotMatrix[0][0] = 1 - 2 * (y * y + z * z);
8805
+ rotMatrix[0][1] = 2 * (x * y - z * w);
8806
+ rotMatrix[0][2] = 2 * (x * z + y * w);
8807
+ rotMatrix[1][0] = 2 * (x * y + z * w);
8808
+ rotMatrix[1][1] = 1 - 2 * (x * x + z * z);
8809
+ rotMatrix[1][2] = 2 * (y * z - x * w);
8810
+ rotMatrix[2][0] = 2 * (x * z - y * w);
8811
+ rotMatrix[2][1] = 2 * (y * z + x * w);
8812
+ rotMatrix[2][2] = 1 - 2 * (x * x + y * y);
8813
+ matrix = multiply(matrix, rotMatrix);
8814
+ var temp = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]];
8815
+
8816
+ if (skew[2]) {
8817
+ temp[2][1] = skew[2];
8818
+ matrix = multiply(matrix, temp);
8819
+ }
8820
+
8821
+ if (skew[1]) {
8822
+ temp[2][1] = 0;
8823
+ temp[2][0] = skew[0];
8824
+ matrix = multiply(matrix, temp);
8825
+ }
8826
+
8827
+ if (skew[0]) {
8828
+ temp[2][0] = 0;
8829
+ temp[1][0] = skew[0];
8830
+ matrix = multiply(matrix, temp);
8831
+ }
8832
+
8833
+ for (var _i2 = 0; _i2 < 3; _i2++) {
8834
+ for (var _j = 0; _j < 3; _j++) {
8835
+ matrix[_i2][_j] *= scale[_i2];
8836
+ }
8837
+ }
8838
+
8839
+ if (is2D(matrix)) {
8840
+ return [matrix[0][0], matrix[0][1], matrix[1][0], matrix[1][1], matrix[3][0], matrix[3][1]];
8841
+ }
8842
+
8843
+ return matrix[0].concat(matrix[1], matrix[2], matrix[3]);
8844
+ }
8845
+
8846
+ return composeMatrix;
8847
+ }();
8848
+
8849
+ function numberToLongString(x) {
8850
+ return x.toFixed(6).replace('.000000', '');
8851
+ }
8852
+
8853
+ function mergeMatrices(left, right) {
8854
+ var leftArgs;
8855
+ var rightArgs; // @ts-ignore
8856
+
8857
+ if (left.decompositionPair !== right) {
8858
+ // @ts-ignore
8859
+ left.decompositionPair = right;
8860
+ leftArgs = makeMatrixDecomposition(left);
8861
+ } // @ts-ignore
8862
+
8863
+
8864
+ if (right.decompositionPair !== left) {
8865
+ // @ts-ignore
8866
+ right.decompositionPair = left;
8867
+ rightArgs = makeMatrixDecomposition(right);
8868
+ }
8869
+
8870
+ if (leftArgs[0] === null || rightArgs[0] === null) return [// @ts-ignore
8871
+ [false], // @ts-ignore
8872
+ [true], // @ts-ignore
8873
+ function (x) {
8874
+ return x ? right[0].d : left[0].d;
8875
+ }];
8876
+ leftArgs[0].push(0);
8877
+ rightArgs[0].push(1);
8878
+ return [leftArgs, rightArgs, // @ts-ignore
8879
+ function (list) {
8880
+ // @ts-ignore
8881
+ var q = quat(leftArgs[0][3], rightArgs[0][3], list[5]);
8882
+ var mat = composeMatrix(list[0], list[1], list[2], q, list[4]);
8883
+ var stringifiedArgs = mat.map(numberToLongString).join(',');
8884
+ return stringifiedArgs;
8885
+ }];
8886
+ }
8887
+
8888
+ function dot(v1, v2) {
8889
+ var result = 0;
8890
+
8891
+ for (var i = 0; i < v1.length; i++) {
8892
+ result += v1[i] * v2[i];
8893
+ }
8894
+
8895
+ return result;
8896
+ }
8897
+
8898
+ function quat(fromQ, toQ, f) {
8899
+ var product = dot(fromQ, toQ);
8900
+ product = clamp(product, -1.0, 1.0);
8901
+ var quat = [];
8902
+
8903
+ if (product === 1.0) {
8904
+ quat = fromQ;
8905
+ } else {
8906
+ var theta = Math.acos(product);
8907
+ var w = Math.sin(f * theta) * 1 / Math.sqrt(1 - product * product);
8908
+
8909
+ for (var i = 0; i < 4; i++) {
8910
+ quat.push(fromQ[i] * (Math.cos(f * theta) - product * w) + toQ[i] * w);
8911
+ }
8912
+ }
8913
+
8914
+ return quat;
8915
+ } // scalex/y/z -> scale
8916
+
8628
8917
 
8629
8918
  function typeTo2D(type) {
8630
8919
  return type.replace(/[xy]/, '');
@@ -8654,7 +8943,7 @@ function mergeTransforms(left, right, target) {
8654
8943
  type = _left$i.t,
8655
8944
  args = _left$i.d; // none -> scale(1)/translateX(0)
8656
8945
 
8657
- var defaultValue = type.substr(0, 5) === 'scale' ? 1 : 0;
8946
+ var defaultValue = type.substring(0, 5) === 'scale' ? 1 : 0;
8658
8947
  right.push({
8659
8948
  t: type,
8660
8949
  d: args.map(function (arg) {
@@ -8679,21 +8968,31 @@ function mergeTransforms(left, right, target) {
8679
8968
  var rightResult = [];
8680
8969
  var types = []; // merge matrix() with matrix3d()
8681
8970
 
8682
- if (left.length !== right.length) ; else {
8683
- for (var _i = 0; _i < left.length; _i++) {
8684
- var leftType = left[_i].t;
8685
- var rightType = right[_i].t;
8686
- var leftArgs = left[_i].d;
8687
- var rightArgs = right[_i].d;
8971
+ if (left.length !== right.length) {
8972
+ var merged = mergeMatrices(left, right); // @ts-ignore
8973
+
8974
+ leftResult = [merged[0]]; // @ts-ignore
8975
+
8976
+ rightResult = [merged[1]];
8977
+ types = [['matrix', [merged[2]]]];
8978
+ } else {
8979
+ for (var _i3 = 0; _i3 < left.length; _i3++) {
8980
+ var leftType = left[_i3].t;
8981
+ var rightType = right[_i3].t;
8982
+ var leftArgs = left[_i3].d;
8983
+ var rightArgs = right[_i3].d;
8688
8984
  var leftFunctionData = transformFunctions[leftType];
8689
8985
  var rightFunctionData = transformFunctions[rightType];
8690
8986
  var type = void 0;
8691
8987
 
8692
8988
  if (isMatrixOrPerspective(leftType, rightType)) {
8693
- // const merged = mergeMatrices([left[i]], [right[i]]);
8694
- // leftResult.push(merged[0]);
8695
- // rightResult.push(merged[1]);
8696
- // types.push(['matrix', [merged[2]]]);
8989
+ var _merged = mergeMatrices([left[_i3]], [right[_i3]]); // @ts-ignore
8990
+
8991
+
8992
+ leftResult.push(_merged[0]); // @ts-ignore
8993
+
8994
+ rightResult.push(_merged[1]);
8995
+ types.push(['matrix', [_merged[2]]]);
8697
8996
  continue;
8698
8997
  } else if (leftType === rightType) {
8699
8998
  type = leftType;
@@ -8710,10 +9009,13 @@ function mergeTransforms(left, right, target) {
8710
9009
 
8711
9010
  rightArgs = rightFunctionData[1](rightArgs);
8712
9011
  } else {
8713
- // const merged = mergeMatrices(left, right);
8714
- // leftResult = [merged[0]];
8715
- // rightResult = [merged[1]];
8716
- // types = [['matrix', [merged[2]]]];
9012
+ var _merged2 = mergeMatrices(left, right); // @ts-ignore
9013
+
9014
+
9015
+ leftResult = [_merged2[0]]; // @ts-ignore
9016
+
9017
+ rightResult = [_merged2[1]];
9018
+ types = [['matrix', [_merged2[2]]]];
8717
9019
  break;
8718
9020
  }
8719
9021
 
@@ -8724,10 +9026,11 @@ function mergeTransforms(left, right, target) {
8724
9026
  for (var j = 0; j < leftArgs.length; j++) {
8725
9027
  var merge = leftArgs[j].unit === UnitType.kNumber ? mergeNumbers : mergeDimensions; // @ts-ignore
8726
9028
 
8727
- var merged = merge(leftArgs[j], rightArgs[j], target, false, j);
8728
- leftArgsCopy[j] = merged[0];
8729
- rightArgsCopy[j] = merged[1];
8730
- stringConversions.push(merged[2]);
9029
+ var _merged3 = merge(leftArgs[j], rightArgs[j], target, false, j);
9030
+
9031
+ leftArgsCopy[j] = _merged3[0];
9032
+ rightArgsCopy[j] = _merged3[1];
9033
+ stringConversions.push(_merged3[2]);
8731
9034
  }
8732
9035
 
8733
9036
  leftResult.push(leftArgsCopy);
@@ -8869,8 +9172,8 @@ var ElementEvent;
8869
9172
  */
8870
9173
 
8871
9174
  ElementEvent["UNMOUNTED"] = "DOMNodeRemovedFromDocument";
8872
- ElementEvent["BOUNDS_CHANGED"] = "bounds-changed";
8873
- ElementEvent["GEOMETRY_BOUNDS_CHANGED"] = "geometry-bounds-changed";
9175
+ ElementEvent["BOUNDS_CHANGED"] = "bounds-changed"; // GEOMETRY_BOUNDS_CHANGED = 'geometry-bounds-changed',
9176
+
8874
9177
  /**
8875
9178
  * trigger when z-index changed
8876
9179
  */
@@ -9630,11 +9933,12 @@ var Transform = function Transform() {
9630
9933
  this.localDirtyFlag = false;
9631
9934
  this.frozen = false;
9632
9935
  this.localPosition = vec3.fromValues(0, 0, 0);
9633
- this.localRotation = quat.fromValues(0, 0, 0, 1);
9936
+ this.localRotation = quat$1.fromValues(0, 0, 0, 1);
9634
9937
  this.localScale = vec3.fromValues(1, 1, 1);
9635
9938
  this.localTransform = mat4.create();
9939
+ this.localSkew = vec2.fromValues(0, 0);
9636
9940
  this.position = vec3.fromValues(0, 0, 0);
9637
- this.rotation = quat.fromValues(0, 0, 0, 1);
9941
+ this.rotation = quat$1.fromValues(0, 0, 0, 1);
9638
9942
  this.scaling = vec3.fromValues(1, 1, 1);
9639
9943
  this.worldTransform = mat4.create();
9640
9944
  this.origin = vec3.fromValues(0, 0, 0);
@@ -11085,7 +11389,8 @@ var DEFAULT_STYLE_PROPS = {
11085
11389
  fontVariant: '',
11086
11390
  textAlign: '',
11087
11391
  textBaseline: '',
11088
- textTransform: ''
11392
+ textTransform: '',
11393
+ zIndex: ''
11089
11394
  };
11090
11395
  /**
11091
11396
  * prototype chains: DisplayObject -> Element -> Node -> EventTarget
@@ -11117,7 +11422,7 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
11117
11422
  * push to active animations after calling `animate()`
11118
11423
  */
11119
11424
  function DisplayObject(config) {
11120
- var _this$config$capture, _this$config$zIndex, _this$config$interact;
11425
+ var _this$config$capture;
11121
11426
 
11122
11427
  var _this;
11123
11428
 
@@ -11128,6 +11433,7 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
11128
11433
  _this.styleValueRegistry = GlobalContainer.get(StyleValueRegistry);
11129
11434
  _this.isCustomElement = false;
11130
11435
  _this.activeAnimations = [];
11436
+ _this.mutationEvent = new MutationEvent(ElementEvent.ATTR_MODIFIED, _assertThisInitialized(_this), null, null, null, MutationEvent.MODIFICATION, null, null);
11131
11437
  _this.config = config; // compatible with G 3.0
11132
11438
 
11133
11439
  _this.config.interactive = (_this$config$capture = _this.config.capture) !== null && _this$config$capture !== void 0 ? _this$config$capture : _this.config.interactive; // init scene graph node
@@ -11141,10 +11447,7 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
11141
11447
 
11142
11448
  _this.nodeName = _this.config.type || Shape.GROUP; // compatible with G 3.0
11143
11449
 
11144
- _this.config.style = _extends({}, DEFAULT_STYLE_PROPS, {
11145
- zIndex: (_this$config$zIndex = _this.config.zIndex) !== null && _this$config$zIndex !== void 0 ? _this$config$zIndex : 0,
11146
- interactive: (_this$config$interact = _this.config.interactive) !== null && _this$config$interact !== void 0 ? _this$config$interact : true
11147
- }, _this.config.style, _this.config.attrs);
11450
+ _this.config.style = _extends({}, DEFAULT_STYLE_PROPS, _this.config.style, _this.config.attrs);
11148
11451
 
11149
11452
  if (_this.config.visible != null) {
11150
11453
  _this.config.style.visibility = _this.config.visible === false ? 'hidden' : 'visible';
@@ -11275,9 +11578,10 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
11275
11578
  var oldParsedValue = this.parsedStyle[name];
11276
11579
  this.styleValueRegistry.processProperties(this, (_this$styleValueRegis = {}, _this$styleValueRegis[name] = value, _this$styleValueRegis), parseOptions); // inform clip path targets
11277
11580
 
11278
- if (this.attributes.clipPathTargets && this.attributes.clipPathTargets.length) {
11279
- this.attributes.clipPathTargets.forEach(function (target) {
11280
- dirtifyToRoot(target);
11581
+ if (this.parsedStyle.clipPathTargets && this.parsedStyle.clipPathTargets.length) {
11582
+ this.parsedStyle.clipPathTargets.forEach(function (target) {
11583
+ _this2.sceneGraphService.dirtifyToRoot(target);
11584
+
11281
11585
  target.dispatchEvent(new MutationEvent(ElementEvent.ATTR_MODIFIED, target, _this2, _this2, 'clipPath', MutationEvent.MODIFICATION, _this2, _this2));
11282
11586
 
11283
11587
  if (target.isCustomElement && target.isConnected) {
@@ -11289,8 +11593,15 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
11289
11593
  } // redraw at next frame
11290
11594
 
11291
11595
 
11292
- renderable.dirty = true;
11293
- this.dispatchEvent(new MutationEvent(ElementEvent.ATTR_MODIFIED, this, oldValue, value, name, MutationEvent.MODIFICATION, oldParsedValue, this.parsedStyle[name]));
11596
+ renderable.dirty = true; // trigger later
11597
+ // this.sceneGraphService.pendingEvents.push([ElementEvent.ATTR_MODIFIED, { affectChildren }]);
11598
+
11599
+ this.mutationEvent.prevValue = oldValue;
11600
+ this.mutationEvent.newValue = value;
11601
+ this.mutationEvent.attrName = name;
11602
+ this.mutationEvent.prevParsedValue = oldParsedValue;
11603
+ this.mutationEvent.newParsedValue = this.parsedStyle[name];
11604
+ this.dispatchEvent(this.mutationEvent);
11294
11605
 
11295
11606
  if (this.isCustomElement && this.isConnected) {
11296
11607
  if (this.attributeChangedCallback) {
@@ -11546,6 +11857,11 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
11546
11857
  return this;
11547
11858
  };
11548
11859
 
11860
+ _proto.setLocalSkew = function setLocalSkew(skew, y) {
11861
+ this.sceneGraphService.setLocalSkew(this, skew, y);
11862
+ return this;
11863
+ };
11864
+
11549
11865
  _proto.getRotation = function getRotation() {
11550
11866
  return this.sceneGraphService.getRotation(this);
11551
11867
  };
@@ -11554,6 +11870,10 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
11554
11870
  return this.sceneGraphService.getLocalRotation(this);
11555
11871
  };
11556
11872
 
11873
+ _proto.getLocalSkew = function getLocalSkew() {
11874
+ return this.sceneGraphService.getLocalSkew(this);
11875
+ };
11876
+
11557
11877
  _proto.getLocalTransform = function getLocalTransform() {
11558
11878
  return this.sceneGraphService.getLocalTransform(this);
11559
11879
  };
@@ -11592,10 +11912,10 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
11592
11912
 
11593
11913
  var timeline = (_this$ownerDocument = this.ownerDocument) === null || _this$ownerDocument === void 0 ? void 0 : _this$ownerDocument.timeline; // account for clip path, use target's timeline
11594
11914
 
11595
- if (this.attributes.clipPathTargets && this.attributes.clipPathTargets.length) {
11915
+ if (this.parsedStyle.clipPathTargets && this.parsedStyle.clipPathTargets.length) {
11596
11916
  var _target$ownerDocument;
11597
11917
 
11598
- var target = this.attributes.clipPathTargets[0];
11918
+ var target = this.parsedStyle.clipPathTargets[0];
11599
11919
  timeline = (_target$ownerDocument = target.ownerDocument) === null || _target$ownerDocument === void 0 ? void 0 : _target$ownerDocument.timeline;
11600
11920
  } // clear old parsed transform
11601
11921
 
@@ -11889,7 +12209,7 @@ var DisplayObject = /*#__PURE__*/function (_Element) {
11889
12209
  sx = _mat4$getScaling[0],
11890
12210
  sy = _mat4$getScaling[1];
11891
12211
 
11892
- var rotation = mat4.getRotation(quat.create(), transform); // eslint-disable-next-line @typescript-eslint/no-unused-vars
12212
+ var rotation = mat4.getRotation(quat$1.create(), transform); // eslint-disable-next-line @typescript-eslint/no-unused-vars
11893
12213
 
11894
12214
  var _getEuler3 = getEuler(vec3.create(), rotation),
11895
12215
  eux = _getEuler3[0],
@@ -12001,9 +12321,7 @@ var Circle = /*#__PURE__*/function (_DisplayObject) {
12001
12321
  style: _extends({
12002
12322
  cx: '',
12003
12323
  cy: '',
12004
- r: '',
12005
- anchor: '0.5 0.5',
12006
- transformOrigin: 'center'
12324
+ r: ''
12007
12325
  }, style)
12008
12326
  }, rest)) || this;
12009
12327
  }
@@ -12026,9 +12344,7 @@ var Ellipse = /*#__PURE__*/function (_DisplayObject) {
12026
12344
  cx: '',
12027
12345
  cy: '',
12028
12346
  rx: '',
12029
- ry: '',
12030
- anchor: '0.5 0.5',
12031
- transformOrigin: 'center'
12347
+ ry: ''
12032
12348
  }, style)
12033
12349
  }, rest)) || this;
12034
12350
  }
@@ -12125,9 +12441,17 @@ var Line = /*#__PURE__*/function (_DisplayObject) {
12125
12441
  x1 = _this$parsedStyle.x1,
12126
12442
  y1 = _this$parsedStyle.y1,
12127
12443
  x2 = _this$parsedStyle.x2,
12128
- y2 = _this$parsedStyle.y2;
12129
- var point = Line$1.pointAt(x1.value, y1.value, x2.value, y2.value, ratio);
12130
- return new Point(point.x, point.y);
12444
+ y2 = _this$parsedStyle.y2,
12445
+ defX = _this$parsedStyle.defX,
12446
+ defY = _this$parsedStyle.defY;
12447
+
12448
+ var _LineUtil$pointAt = Line$1.pointAt(x1.value, y1.value, x2.value, y2.value, ratio),
12449
+ x = _LineUtil$pointAt.x,
12450
+ y = _LineUtil$pointAt.y;
12451
+
12452
+ var transformed = vec3.transformMat4(vec3.create(), vec3.fromValues(x - defX, y - defY, 0), this.getLocalTransform()); // apply local transformation
12453
+
12454
+ return new Point(transformed[0], transformed[1]);
12131
12455
  };
12132
12456
 
12133
12457
  _proto.getTotalLength = function getTotalLength() {
@@ -12172,7 +12496,10 @@ var Path = /*#__PURE__*/function (_DisplayObject) {
12172
12496
  ;
12173
12497
 
12174
12498
  _proto.getPoint = function getPoint(ratio) {
12175
- var _this$parsedStyle$pat = this.parsedStyle.path,
12499
+ var _this$parsedStyle = this.parsedStyle,
12500
+ defX = _this$parsedStyle.defX,
12501
+ defY = _this$parsedStyle.defY,
12502
+ _this$parsedStyle$pat = _this$parsedStyle.path,
12176
12503
  totalLength = _this$parsedStyle$pat.totalLength,
12177
12504
  absolutePath = _this$parsedStyle$pat.absolutePath;
12178
12505
 
@@ -12180,7 +12507,9 @@ var Path = /*#__PURE__*/function (_DisplayObject) {
12180
12507
  x = _getPointAtLength.x,
12181
12508
  y = _getPointAtLength.y;
12182
12509
 
12183
- return new Point(x, y);
12510
+ var transformed = vec3.transformMat4(vec3.create(), vec3.fromValues(x - defX, y - defY, 0), this.getLocalTransform()); // apply local transformation
12511
+
12512
+ return new Point(transformed[0], transformed[1]);
12184
12513
  }
12185
12514
  /**
12186
12515
  * Get start tangent vector
@@ -12285,7 +12614,10 @@ var Polyline = /*#__PURE__*/function (_DisplayObject) {
12285
12614
  };
12286
12615
 
12287
12616
  _proto.getPoint = function getPoint(ratio) {
12288
- var _this$parsedStyle$poi = this.parsedStyle.points,
12617
+ var _this$parsedStyle = this.parsedStyle,
12618
+ defX = _this$parsedStyle.defX,
12619
+ defY = _this$parsedStyle.defY,
12620
+ _this$parsedStyle$poi = _this$parsedStyle.points,
12289
12621
  points = _this$parsedStyle$poi.points,
12290
12622
  segments = _this$parsedStyle$poi.segments;
12291
12623
  var subt = 0;
@@ -12301,7 +12633,9 @@ var Polyline = /*#__PURE__*/function (_DisplayObject) {
12301
12633
  x = _LineUtil$pointAt.x,
12302
12634
  y = _LineUtil$pointAt.y;
12303
12635
 
12304
- return new Point(x, y);
12636
+ var transformed = vec3.transformMat4(vec3.create(), vec3.fromValues(x - defX, y - defY, 0), this.getLocalTransform()); // apply local transformation
12637
+
12638
+ return new Point(transformed[0], transformed[1]);
12305
12639
  };
12306
12640
 
12307
12641
  _proto.getStartTangent = function getStartTangent() {
@@ -13958,7 +14292,7 @@ var DefaultSceneGraphSelector = /*#__PURE__*/function () {
13958
14292
  if (query.startsWith('.')) {
13959
14293
  return root.find(function (node) {
13960
14294
  // return !node.shadow && node.id === query.substring(1);
13961
- return node.className === _this.getIdOrClassname(query);
14295
+ return ((node === null || node === void 0 ? void 0 : node.classList) || []).indexOf(_this.getIdOrClassname(query)) > -1;
13962
14296
  });
13963
14297
  } else if (query.startsWith('#')) {
13964
14298
  // getElementById('id')
@@ -13995,7 +14329,7 @@ var DefaultSceneGraphSelector = /*#__PURE__*/function () {
13995
14329
  // getElementsByClassName('className');
13996
14330
  // should not include itself
13997
14331
  return root.findAll(function (node) {
13998
- return root !== node && node.className === _this2.getIdOrClassname(query);
14332
+ return root !== node && ((node === null || node === void 0 ? void 0 : node.classList) || []).indexOf(_this2.getIdOrClassname(query)) > -1;
13999
14333
  });
14000
14334
  } else if (query.startsWith('#')) {
14001
14335
  return root.findAll(function (node) {
@@ -14101,29 +14435,6 @@ function sortByZIndex(o1, o2) {
14101
14435
 
14102
14436
  return zIndex1 - zIndex2;
14103
14437
  }
14104
- function dirtifyToRoot(element, affectChildren) {
14105
- if (affectChildren === void 0) {
14106
- affectChildren = false;
14107
- }
14108
-
14109
- var p = element;
14110
-
14111
- while (p) {
14112
- var renderable = p.renderable;
14113
-
14114
- if (renderable) {
14115
- renderable.renderBoundsDirty = true;
14116
- renderable.boundsDirty = true;
14117
- renderable.dirty = true;
14118
- }
14119
-
14120
- p = p.parentNode;
14121
- }
14122
-
14123
- element.dispatchEvent(new CustomEvent(ElementEvent.BOUNDS_CHANGED, {
14124
- affectChildren: affectChildren
14125
- }));
14126
- }
14127
14438
  var SceneGraphService = Syringe.defineToken('SceneGraphService');
14128
14439
  /**
14129
14440
  * update transform in scene graph
@@ -14136,9 +14447,11 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14136
14447
  var _this = this;
14137
14448
 
14138
14449
  this.sceneGraphSelectorFactory = void 0;
14450
+ this.pendingEvents = [];
14451
+ this.boundsChangedEvent = new CustomEvent(ElementEvent.BOUNDS_CHANGED);
14139
14452
 
14140
14453
  this.rotate = function () {
14141
- var parentInvertRotation = quat.create();
14454
+ var parentInvertRotation = quat$1.create();
14142
14455
  return function (element, degrees, y, z) {
14143
14456
  if (y === void 0) {
14144
14457
  y = 0;
@@ -14157,18 +14470,18 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14157
14470
  if (element.parentNode === null || !element.parentNode.transformable) {
14158
14471
  _this.rotateLocal(element, degrees);
14159
14472
  } else {
14160
- var rotation = quat.create();
14161
- quat.fromEuler(rotation, degrees[0], degrees[1], degrees[2]);
14473
+ var rotation = quat$1.create();
14474
+ quat$1.fromEuler(rotation, degrees[0], degrees[1], degrees[2]);
14162
14475
 
14163
14476
  var rot = _this.getRotation(element);
14164
14477
 
14165
14478
  var parentRot = _this.getRotation(element.parentNode);
14166
14479
 
14167
- quat.copy(parentInvertRotation, parentRot);
14168
- quat.invert(parentInvertRotation, parentInvertRotation);
14169
- quat.multiply(rotation, parentInvertRotation, rotation);
14170
- quat.multiply(transform.localRotation, rotation, rot);
14171
- quat.normalize(transform.localRotation, transform.localRotation);
14480
+ quat$1.copy(parentInvertRotation, parentRot);
14481
+ quat$1.invert(parentInvertRotation, parentInvertRotation);
14482
+ quat$1.multiply(rotation, parentInvertRotation, rotation);
14483
+ quat$1.multiply(transform.localRotation, rotation, rot);
14484
+ quat$1.normalize(transform.localRotation, transform.localRotation);
14172
14485
 
14173
14486
  _this.dirtifyLocal(element, transform);
14174
14487
  }
@@ -14176,7 +14489,7 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14176
14489
  }();
14177
14490
 
14178
14491
  this.rotateLocal = function () {
14179
- var rotation = quat.create();
14492
+ var rotation = quat$1.create();
14180
14493
  return function (element, degrees, y, z) {
14181
14494
  if (y === void 0) {
14182
14495
  y = 0;
@@ -14191,15 +14504,15 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14191
14504
  }
14192
14505
 
14193
14506
  var transform = element.transformable;
14194
- quat.fromEuler(rotation, degrees[0], degrees[1], degrees[2]);
14195
- quat.mul(transform.localRotation, transform.localRotation, rotation);
14507
+ quat$1.fromEuler(rotation, degrees[0], degrees[1], degrees[2]);
14508
+ quat$1.mul(transform.localRotation, transform.localRotation, rotation);
14196
14509
 
14197
14510
  _this.dirtifyLocal(element, transform);
14198
14511
  };
14199
14512
  }();
14200
14513
 
14201
14514
  this.setEulerAngles = function () {
14202
- var invParentRot = quat.create();
14515
+ var invParentRot = quat$1.create();
14203
14516
  return function (element, degrees, y, z) {
14204
14517
  if (y === void 0) {
14205
14518
  y = 0;
@@ -14218,12 +14531,12 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14218
14531
  if (element.parentNode === null || !element.parentNode.transformable) {
14219
14532
  _this.setLocalEulerAngles(element, degrees);
14220
14533
  } else {
14221
- quat.fromEuler(transform.localRotation, degrees[0], degrees[1], degrees[2]);
14534
+ quat$1.fromEuler(transform.localRotation, degrees[0], degrees[1], degrees[2]);
14222
14535
 
14223
14536
  var parentRotation = _this.getRotation(element.parentNode);
14224
14537
 
14225
- quat.copy(invParentRot, quat.invert(quat.create(), parentRotation));
14226
- quat.mul(transform.localRotation, transform.localRotation, invParentRot);
14538
+ quat$1.copy(invParentRot, quat$1.invert(quat$1.create(), parentRotation));
14539
+ quat$1.mul(transform.localRotation, transform.localRotation, invParentRot);
14227
14540
 
14228
14541
  _this.dirtifyLocal(element, transform);
14229
14542
  }
@@ -14308,12 +14621,12 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14308
14621
  }();
14309
14622
 
14310
14623
  this.setRotation = function () {
14311
- var parentInvertRotation = quat.create();
14624
+ var parentInvertRotation = quat$1.create();
14312
14625
  return function (element, rotation, y, z, w) {
14313
14626
  var transform = element.transformable;
14314
14627
 
14315
14628
  if (typeof rotation === 'number') {
14316
- rotation = quat.fromValues(rotation, y, z, w);
14629
+ rotation = quat$1.fromValues(rotation, y, z, w);
14317
14630
  }
14318
14631
 
14319
14632
  if (element.parentNode === null || !element.parentNode.transformable) {
@@ -14321,10 +14634,10 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14321
14634
  } else {
14322
14635
  var parentRot = _this.getRotation(element.parentNode);
14323
14636
 
14324
- quat.copy(parentInvertRotation, parentRot);
14325
- quat.invert(parentInvertRotation, parentInvertRotation);
14326
- quat.multiply(transform.localRotation, parentInvertRotation, rotation);
14327
- quat.normalize(transform.localRotation, transform.localRotation);
14637
+ quat$1.copy(parentInvertRotation, parentRot);
14638
+ quat$1.invert(parentInvertRotation, parentInvertRotation);
14639
+ quat$1.multiply(transform.localRotation, parentInvertRotation, rotation);
14640
+ quat$1.normalize(transform.localRotation, transform.localRotation);
14328
14641
 
14329
14642
  _this.dirtifyLocal(element, transform);
14330
14643
  }
@@ -14469,7 +14782,7 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14469
14782
  }
14470
14783
 
14471
14784
  var transform = element.transformable;
14472
- quat.fromEuler(transform.localRotation, degrees[0], degrees[1], degrees[2]);
14785
+ quat$1.fromEuler(transform.localRotation, degrees[0], degrees[1], degrees[2]);
14473
14786
  this.dirtifyLocal(element, transform);
14474
14787
  }
14475
14788
  /**
@@ -14535,11 +14848,21 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14535
14848
 
14536
14849
  _proto.setLocalRotation = function setLocalRotation(element, rotation, y, z, w) {
14537
14850
  if (typeof rotation === 'number') {
14538
- rotation = quat.fromValues(rotation, y, z, w);
14851
+ rotation = quat$1.fromValues(rotation, y, z, w);
14539
14852
  }
14540
14853
 
14541
14854
  var transform = element.transformable;
14542
- quat.copy(transform.localRotation, rotation);
14855
+ quat$1.copy(transform.localRotation, rotation);
14856
+ this.dirtifyLocal(element, transform);
14857
+ };
14858
+
14859
+ _proto.setLocalSkew = function setLocalSkew(element, skew, y) {
14860
+ if (typeof skew === 'number') {
14861
+ skew = vec2.fromValues(skew, y);
14862
+ }
14863
+
14864
+ var transform = element.transformable;
14865
+ vec2.copy(transform.localSkew, skew);
14543
14866
  this.dirtifyLocal(element, transform);
14544
14867
  };
14545
14868
 
@@ -14559,7 +14882,60 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14559
14882
  }
14560
14883
 
14561
14884
  this.dirtifyWorldInternal(element, transform);
14562
- dirtifyToRoot(element, true);
14885
+ this.dirtifyToRoot(element, true);
14886
+ };
14887
+
14888
+ _proto.triggerPendingEvents = function triggerPendingEvents() {
14889
+ var _this2 = this;
14890
+
14891
+ var set = new Set();
14892
+
14893
+ var trigger = function trigger(element, detail) {
14894
+ if (!set.has(element.entity)) {
14895
+ _this2.boundsChangedEvent.detail = detail;
14896
+ element.dispatchEvent(_this2.boundsChangedEvent);
14897
+ set.add(element.entity);
14898
+ }
14899
+ };
14900
+
14901
+ this.pendingEvents.forEach(function (_ref) {
14902
+ var element = _ref[0],
14903
+ detail = _ref[1];
14904
+
14905
+ if (detail.affectChildren) {
14906
+ element.forEach(function (e) {
14907
+ trigger(e, detail);
14908
+ });
14909
+ } else {
14910
+ trigger(element, detail);
14911
+ }
14912
+ });
14913
+ this.pendingEvents = [];
14914
+ };
14915
+
14916
+ _proto.dirtifyToRoot = function dirtifyToRoot(element, affectChildren) {
14917
+ if (affectChildren === void 0) {
14918
+ affectChildren = false;
14919
+ }
14920
+
14921
+ var p = element;
14922
+
14923
+ while (p) {
14924
+ var renderable = p.renderable;
14925
+
14926
+ if (renderable) {
14927
+ renderable.renderBoundsDirty = true;
14928
+ renderable.boundsDirty = true;
14929
+ renderable.dirty = true;
14930
+ }
14931
+
14932
+ p = p.parentNode;
14933
+ } // reuse the same custom event
14934
+
14935
+
14936
+ this.pendingEvents.push([element, {
14937
+ affectChildren: affectChildren
14938
+ }]);
14563
14939
  };
14564
14940
 
14565
14941
  _proto.getPosition = function getPosition(element) {
@@ -14606,11 +14982,37 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14606
14982
  return element.transformable.localScale;
14607
14983
  };
14608
14984
 
14985
+ _proto.getLocalSkew = function getLocalSkew(element) {
14986
+ return element.transformable.localSkew;
14987
+ };
14988
+
14989
+ _proto.calcLocalTransform = function calcLocalTransform(transform) {
14990
+ // @see https://github.com/mattdesl/css-mat4/blob/master/index.js
14991
+ // mat4.fromRotationTranslationScaleOrigin(
14992
+ // transform.localTransform,
14993
+ // transform.localRotation,
14994
+ // transform.localPosition,
14995
+ // transform.localScale,
14996
+ // transform.origin,
14997
+ // );
14998
+ mat4.fromRotationTranslationScaleOrigin(transform.localTransform, transform.localRotation, transform.localPosition, vec3.fromValues(1, 1, 1), transform.origin); // apply skew2D
14999
+
15000
+ if (transform.localSkew[0] !== 0 || transform.localSkew[1] !== 0) {
15001
+ var tmpMat4 = mat4.identity(mat4.create());
15002
+ tmpMat4[4] = Math.tan(transform.localSkew[0]);
15003
+ tmpMat4[1] = Math.tan(transform.localSkew[1]);
15004
+ mat4.multiply(transform.localTransform, transform.localTransform, tmpMat4);
15005
+ }
15006
+
15007
+ var scaling = mat4.fromRotationTranslationScaleOrigin(mat4.create(), quat$1.fromValues(0, 0, 0, 1), vec3.create(), transform.localScale, transform.origin);
15008
+ mat4.multiply(transform.localTransform, transform.localTransform, scaling);
15009
+ };
15010
+
14609
15011
  _proto.getLocalTransform = function getLocalTransform(element) {
14610
15012
  var transform = element.transformable;
14611
15013
 
14612
15014
  if (transform.localDirtyFlag) {
14613
- mat4.fromRotationTranslationScaleOrigin(transform.localTransform, transform.localRotation, transform.localPosition, transform.localScale, transform.origin);
15015
+ this.calcLocalTransform(transform);
14614
15016
  transform.localDirtyFlag = false;
14615
15017
  }
14616
15018
 
@@ -14619,7 +15021,7 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14619
15021
 
14620
15022
  _proto.setLocalTransform = function setLocalTransform(element, transform) {
14621
15023
  var t = mat4.getTranslation(vec3.create(), transform);
14622
- var r = mat4.getRotation(quat.create(), transform);
15024
+ var r = mat4.getRotation(quat$1.create(), transform);
14623
15025
  var s = mat4.getScaling(vec3.create(), transform);
14624
15026
  this.setLocalScale(element, s);
14625
15027
  this.setLocalPosition(element, t);
@@ -14630,6 +15032,7 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14630
15032
  this.setLocalScale(element, [1, 1, 1]);
14631
15033
  this.setLocalPosition(element, [0, 0, 0]);
14632
15034
  this.setLocalEulerAngles(element, [0, 0, 0]);
15035
+ this.setLocalSkew(element, [0, 0]);
14633
15036
  };
14634
15037
 
14635
15038
  _proto.getTransformedGeometryBounds = function getTransformedGeometryBounds(element, render) {
@@ -14658,8 +15061,9 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14658
15061
  }
14659
15062
 
14660
15063
  var geometry = element.geometry;
14661
- var bounds = render ? geometry.renderBounds : geometry.contentBounds || null;
14662
- return bounds && new AABB(bounds.center, bounds.halfExtents) || new AABB();
15064
+ var bounds = render ? geometry.renderBounds : geometry.contentBounds || null; // return (bounds && new AABB(bounds.center, bounds.halfExtents)) || new AABB();
15065
+
15066
+ return bounds || new AABB();
14663
15067
  }
14664
15068
  /**
14665
15069
  * account for children in world space
@@ -14667,7 +15071,7 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14667
15071
  ;
14668
15072
 
14669
15073
  _proto.getBounds = function getBounds(element, render) {
14670
- var _this2 = this;
15074
+ var _this3 = this;
14671
15075
 
14672
15076
  if (render === void 0) {
14673
15077
  render = false;
@@ -14688,7 +15092,7 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14688
15092
 
14689
15093
  var children = element.childNodes;
14690
15094
  children.forEach(function (child) {
14691
- var childBounds = _this2.getBounds(child, render);
15095
+ var childBounds = _this3.getBounds(child, render);
14692
15096
 
14693
15097
  if (childBounds) {
14694
15098
  if (!aabb) {
@@ -14700,7 +15104,7 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14700
15104
  }
14701
15105
  }); // account for clip path
14702
15106
 
14703
- var clipPath = element.style.clipPath;
15107
+ var clipPath = element.parsedStyle.clipPath;
14704
15108
 
14705
15109
  if (clipPath) {
14706
15110
  var clipPathBounds = this.getTransformedGeometryBounds(clipPath, true);
@@ -14791,7 +15195,7 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14791
15195
  };
14792
15196
 
14793
15197
  _proto.dirtifyWorldInternal = function dirtifyWorldInternal(element, transform) {
14794
- var _this3 = this;
15198
+ var _this4 = this;
14795
15199
 
14796
15200
  if (!transform.dirtyFlag) {
14797
15201
  transform.dirtyFlag = true;
@@ -14800,7 +15204,7 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14800
15204
  var childTransform = child.transformable;
14801
15205
 
14802
15206
  if (!childTransform.dirtyFlag) {
14803
- _this3.dirtifyWorldInternal(child, childTransform);
15207
+ _this4.dirtifyWorldInternal(child, childTransform);
14804
15208
  }
14805
15209
  });
14806
15210
  var renderable = element.renderable;
@@ -14810,8 +15214,6 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14810
15214
  renderable.boundsDirty = true;
14811
15215
  renderable.dirty = true;
14812
15216
  }
14813
-
14814
- element.dispatchEvent(new MutationEvent(ElementEvent.ATTR_MODIFIED, element, null, null, 'modelMatrix', MutationEvent.MODIFICATION, null, null));
14815
15217
  }
14816
15218
  };
14817
15219
 
@@ -14837,7 +15239,7 @@ var DefaultSceneGraphService = /*#__PURE__*/function () {
14837
15239
 
14838
15240
  _proto.sync = function sync(element, transform) {
14839
15241
  if (transform.localDirtyFlag) {
14840
- mat4.fromRotationTranslationScaleOrigin(transform.localTransform, transform.localRotation, transform.localPosition, transform.localScale, transform.origin);
15242
+ this.calcLocalTransform(transform);
14841
15243
  transform.localDirtyFlag = false;
14842
15244
  }
14843
15245
 
@@ -15641,11 +16043,11 @@ var Camera = /*#__PURE__*/function (_EventEmitter) {
15641
16043
  this.roll += this.relRoll;
15642
16044
 
15643
16045
  if (this.type === CameraType.EXPLORING) {
15644
- var rotX = quat.setAxisAngle(quat.create(), [1, 0, 0], (this.rotateWorld ? 1 : -1) * this.relElevation * DEG_2_RAD);
15645
- var rotY = quat.setAxisAngle(quat.create(), [0, 1, 0], (this.rotateWorld ? 1 : -1) * this.relAzimuth * DEG_2_RAD);
15646
- var rotZ = quat.setAxisAngle(quat.create(), [0, 0, 1], this.relRoll * DEG_2_RAD);
15647
- var rotQ = quat.multiply(quat.create(), rotY, rotX);
15648
- rotQ = quat.multiply(quat.create(), rotQ, rotZ);
16046
+ var rotX = quat$1.setAxisAngle(quat$1.create(), [1, 0, 0], (this.rotateWorld ? 1 : -1) * this.relElevation * DEG_2_RAD);
16047
+ var rotY = quat$1.setAxisAngle(quat$1.create(), [0, 1, 0], (this.rotateWorld ? 1 : -1) * this.relAzimuth * DEG_2_RAD);
16048
+ var rotZ = quat$1.setAxisAngle(quat$1.create(), [0, 0, 1], this.relRoll * DEG_2_RAD);
16049
+ var rotQ = quat$1.multiply(quat$1.create(), rotY, rotX);
16050
+ rotQ = quat$1.multiply(quat$1.create(), rotQ, rotZ);
15649
16051
  var rotMatrix = mat4.fromQuat(mat4.create(), rotQ);
15650
16052
  mat4.translate(this.matrix, this.matrix, [0, 0, -this.distance]);
15651
16053
  mat4.multiply(this.matrix, this.matrix, rotMatrix);
@@ -15899,13 +16301,13 @@ var Camera = /*#__PURE__*/function (_EventEmitter) {
15899
16301
  _proto.computeMatrix = function computeMatrix() {
15900
16302
  // 使用四元数描述 3D 旋转
15901
16303
  // @see https://xiaoiver.github.io/coding/2018/12/28/Camera-%E8%AE%BE%E8%AE%A1-%E4%B8%80.html
15902
- var rotZ = quat.setAxisAngle(quat.create(), [0, 0, 1], this.roll * DEG_2_RAD);
16304
+ var rotZ = quat$1.setAxisAngle(quat$1.create(), [0, 0, 1], this.roll * DEG_2_RAD);
15903
16305
  mat4.identity(this.matrix); // only consider HCS for EXPLORING and ORBITING cameras
15904
16306
 
15905
- var rotX = quat.setAxisAngle(quat.create(), [1, 0, 0], (this.rotateWorld && this.type !== CameraType.TRACKING || this.type === CameraType.TRACKING ? 1 : -1) * this.elevation * DEG_2_RAD);
15906
- var rotY = quat.setAxisAngle(quat.create(), [0, 1, 0], (this.rotateWorld && this.type !== CameraType.TRACKING || this.type === CameraType.TRACKING ? 1 : -1) * this.azimuth * DEG_2_RAD);
15907
- var rotQ = quat.multiply(quat.create(), rotY, rotX);
15908
- rotQ = quat.multiply(quat.create(), rotQ, rotZ);
16307
+ var rotX = quat$1.setAxisAngle(quat$1.create(), [1, 0, 0], (this.rotateWorld && this.type !== CameraType.TRACKING || this.type === CameraType.TRACKING ? 1 : -1) * this.elevation * DEG_2_RAD);
16308
+ var rotY = quat$1.setAxisAngle(quat$1.create(), [0, 1, 0], (this.rotateWorld && this.type !== CameraType.TRACKING || this.type === CameraType.TRACKING ? 1 : -1) * this.azimuth * DEG_2_RAD);
16309
+ var rotQ = quat$1.multiply(quat$1.create(), rotY, rotX);
16310
+ rotQ = quat$1.multiply(quat$1.create(), rotQ, rotZ);
15909
16311
  var rotMatrix = mat4.fromQuat(mat4.create(), rotQ);
15910
16312
 
15911
16313
  if (this.type === CameraType.ORBITING || this.type === CameraType.EXPLORING) {
@@ -16014,7 +16416,7 @@ var Camera = /*#__PURE__*/function (_EventEmitter) {
16014
16416
  }
16015
16417
 
16016
16418
  var position = this.position;
16017
- var rotZ = quat.setAxisAngle(quat.create(), [0, 0, 1], -this.roll * Math.PI / 180);
16419
+ var rotZ = quat$1.setAxisAngle(quat$1.create(), [0, 0, 1], -this.roll * Math.PI / 180);
16018
16420
  mat4.fromRotationTranslationScaleOrigin(this.orthoMatrix, rotZ, vec3.fromValues((this.rright - this.left) / 2 - position[0], (this.top - this.bottom) / 2 - position[1], 0), vec3.fromValues(this.zoom, this.zoom, 1), position);
16019
16421
  };
16020
16422
 
@@ -16064,6 +16466,7 @@ var RenderingPluginContribution = Syringe.defineToken('RenderingPluginContributi
16064
16466
  var RenderingService = /*#__PURE__*/function () {
16065
16467
  function RenderingService() {
16066
16468
  this.renderingPluginProvider = void 0;
16469
+ this.canvasConfig = void 0;
16067
16470
  this.renderingContext = void 0;
16068
16471
  this.sceneGraphService = void 0;
16069
16472
  this.styleValueRegistry = void 0;
@@ -16177,6 +16580,21 @@ var RenderingService = /*#__PURE__*/function () {
16177
16580
 
16178
16581
  _proto.getStats = function getStats() {
16179
16582
  return this.stats;
16583
+ }
16584
+ /**
16585
+ * Meet the following conditions:
16586
+ * * disable DirtyRectangleRendering
16587
+ * * camera changed
16588
+ */
16589
+ ;
16590
+
16591
+ _proto.disableDirtyRectangleRendering = function disableDirtyRectangleRendering() {
16592
+ var renderer = this.canvasConfig.renderer;
16593
+
16594
+ var _renderer$getConfig = renderer.getConfig(),
16595
+ enableDirtyRectangleRendering = _renderer$getConfig.enableDirtyRectangleRendering;
16596
+
16597
+ return !enableDirtyRectangleRendering || this.renderingContext.renderReasons.has(RenderReason.CAMERA_CHANGED);
16180
16598
  };
16181
16599
 
16182
16600
  _proto.render = function render(canvasConfig) {
@@ -16186,6 +16604,7 @@ var RenderingService = /*#__PURE__*/function () {
16186
16604
  this.stats.rendered = 0;
16187
16605
  this.zIndexCounter = 0;
16188
16606
  this.sceneGraphService.syncHierarchy(this.renderingContext.root);
16607
+ this.sceneGraphService.triggerPendingEvents();
16189
16608
 
16190
16609
  if (this.renderingContext.renderReasons.size && this.inited) {
16191
16610
  this.renderDisplayObject(this.renderingContext.root, canvasConfig);
@@ -16273,6 +16692,8 @@ var RenderingService = /*#__PURE__*/function () {
16273
16692
 
16274
16693
  __decorate([contrib(RenderingPluginContribution), __metadata("design:type", Object)], RenderingService.prototype, "renderingPluginProvider", void 0);
16275
16694
 
16695
+ __decorate([inject(CanvasConfig), __metadata("design:type", Object)], RenderingService.prototype, "canvasConfig", void 0);
16696
+
16276
16697
  __decorate([inject(RenderingContext), __metadata("design:type", Object)], RenderingService.prototype, "renderingContext", void 0);
16277
16698
 
16278
16699
  __decorate([inject(SceneGraphService), __metadata("design:type", Object)], RenderingService.prototype, "sceneGraphService", void 0);
@@ -18266,7 +18687,9 @@ PathUpdater = __decorate([singleton({
18266
18687
  */
18267
18688
 
18268
18689
  var CSSPropertyClipPath = /*#__PURE__*/function () {
18269
- function CSSPropertyClipPath() {}
18690
+ function CSSPropertyClipPath() {
18691
+ this.sceneGraphService = void 0;
18692
+ }
18270
18693
 
18271
18694
  var _proto = CSSPropertyClipPath.prototype;
18272
18695
 
@@ -18277,26 +18700,28 @@ var CSSPropertyClipPath = /*#__PURE__*/function () {
18277
18700
  } // clear ref to old clip path
18278
18701
 
18279
18702
 
18280
- if (oldClipPath && oldClipPath !== newClipPath && oldClipPath.style.clipPathTargets) {
18281
- var index = oldClipPath.style.clipPathTargets.indexOf(object);
18282
- oldClipPath.style.clipPathTargets.splice(index, 1);
18703
+ if (oldClipPath && oldClipPath !== newClipPath && oldClipPath.parsedStyle.clipPathTargets) {
18704
+ var index = oldClipPath.parsedStyle.clipPathTargets.indexOf(object);
18705
+ oldClipPath.parsedStyle.clipPathTargets.splice(index, 1);
18283
18706
  }
18284
18707
 
18285
18708
  if (newClipPath) {
18286
- if (!newClipPath.style.clipPathTargets) {
18287
- newClipPath.style.clipPathTargets = [];
18709
+ if (!newClipPath.parsedStyle.clipPathTargets) {
18710
+ newClipPath.parsedStyle.clipPathTargets = [];
18288
18711
  }
18289
18712
 
18290
- newClipPath.style.clipPathTargets.push(object);
18713
+ newClipPath.parsedStyle.clipPathTargets.push(object);
18291
18714
  }
18292
18715
 
18293
- dirtifyToRoot(object);
18716
+ this.sceneGraphService.dirtifyToRoot(object);
18294
18717
  return newClipPath;
18295
18718
  };
18296
18719
 
18297
18720
  return CSSPropertyClipPath;
18298
18721
  }();
18299
18722
 
18723
+ __decorate([inject(SceneGraphService), __metadata("design:type", Object)], CSSPropertyClipPath.prototype, "sceneGraphService", void 0);
18724
+
18300
18725
  CSSPropertyClipPath = __decorate([singleton({
18301
18726
  token: {
18302
18727
  token: CSSProperty,
@@ -18376,21 +18801,6 @@ var CSSPropertyLengthOrPercentage = /*#__PURE__*/function () {
18376
18801
  _proto.calculator = function calculator(name, oldParsed, computed, object, registry) {
18377
18802
  if (CSSUnitValue.isRelativeUnit(computed.unit)) {
18378
18803
  if (computed.unit === UnitType.kPercentage) {
18379
- // try to resolve according to parent's geometry bounds
18380
- // if (object.parentElement) {
18381
- // // registry.registerParentGeometryBoundsChangedHandler(object, name);
18382
- // return this.calculateUsedValueWithParentBounds(object, name);
18383
- // } else {
18384
- // registry.addUnresolveProperty(object, name);
18385
- // // defer calculation after mounted
18386
- // // object.addEventListener(
18387
- // // ElementEvent.MOUNTED,
18388
- // // () => {
18389
- // // registry.registerParentGeometryBoundsChangedHandler(object, name);
18390
- // // },
18391
- // // { once: true },
18392
- // // );
18393
- // }
18394
18804
  return new CSSUnitValue(0, 'px');
18395
18805
  } else if (computed.unit === UnitType.kEms) {
18396
18806
  if (object.parentNode) {
@@ -18424,10 +18834,13 @@ var CSSPropertyLengthOrPercentage = /*#__PURE__*/function () {
18424
18834
  }();
18425
18835
 
18426
18836
  CSSPropertyLengthOrPercentage = __decorate([singleton({
18427
- token: {
18837
+ token: [{
18428
18838
  token: CSSProperty,
18429
18839
  named: PropertySyntax.LENGTH_PERCENTAGE
18430
- }
18840
+ }, {
18841
+ token: CSSProperty,
18842
+ named: PropertySyntax.LENGTH
18843
+ }]
18431
18844
  })], CSSPropertyLengthOrPercentage);
18432
18845
 
18433
18846
  /**
@@ -18596,6 +19009,18 @@ CSSPropertyLocalPosition = __decorate([singleton({
18596
19009
  }
18597
19010
  })], CSSPropertyLocalPosition);
18598
19011
 
19012
+ var CSSPropertyNumber = function CSSPropertyNumber() {
19013
+ this.mixer = mergeNumbers;
19014
+ this.parser = parseNumber;
19015
+ };
19016
+
19017
+ CSSPropertyNumber = __decorate([singleton({
19018
+ token: {
19019
+ token: CSSProperty,
19020
+ named: PropertySyntax.NUMBER
19021
+ }
19022
+ })], CSSPropertyNumber);
19023
+
18599
19024
  var CSSPropertyOffsetDistance = /*#__PURE__*/function () {
18600
19025
  function CSSPropertyOffsetDistance() {
18601
19026
  this.parser = parseNumber;
@@ -18904,9 +19329,9 @@ var CSSPropertyTransform = /*#__PURE__*/function () {
18904
19329
  // reset transform
18905
19330
  object.resetLocalTransform();
18906
19331
  object.setLocalPosition(defX, defY);
18907
- transform.forEach(function (_ref) {
18908
- var t = _ref.t,
18909
- d = _ref.d;
19332
+ transform.forEach(function (parsed) {
19333
+ var t = parsed.t,
19334
+ d = parsed.d;
18910
19335
 
18911
19336
  if (t === 'scale') {
18912
19337
  // scale(1) scale(1, 1)
@@ -18972,7 +19397,24 @@ var CSSPropertyTransform = /*#__PURE__*/function () {
18972
19397
  var _newAngles3 = d || [Odeg];
18973
19398
 
18974
19399
  object.rotateLocal(0, 0, _newAngles3[0].value);
18975
- } else ;
19400
+ } else if (t === 'rotate3d') ; else if (t === 'skew') {
19401
+ var newSkew = d.map(function (s) {
19402
+ return s.value;
19403
+ }) || [0, 0];
19404
+ object.setLocalSkew(deg2rad(newSkew[0]), deg2rad(newSkew[1]));
19405
+ } else if (t === 'skewx') {
19406
+ var _newSkew = d.map(function (s) {
19407
+ return s.value;
19408
+ }) || [0];
19409
+
19410
+ object.setLocalSkew(deg2rad(_newSkew[0]), object.getLocalSkew()[1]);
19411
+ } else if (t === 'skewy') {
19412
+ var _newSkew2 = d.map(function (s) {
19413
+ return s.value;
19414
+ }) || [0];
19415
+
19416
+ object.setLocalSkew(object.getLocalSkew()[0], deg2rad(_newSkew2[0]));
19417
+ }
18976
19418
  });
18977
19419
  }
18978
19420
  };
@@ -19227,13 +19669,25 @@ var BUILT_IN_PROPERTIES = [{
19227
19669
  name: 'transformOrigin',
19228
19670
  parsePriority: 100,
19229
19671
  // interpolable: true,
19230
- defaultValue: 'left top',
19672
+ defaultValue: function defaultValue(nodeName) {
19673
+ if (nodeName === Shape.CIRCLE || nodeName === Shape.ELLIPSE) {
19674
+ return 'center';
19675
+ }
19676
+
19677
+ return 'left top';
19678
+ },
19231
19679
  layoutDependent: true,
19232
19680
  syntax: PropertySyntax.TRANSFORM_ORIGIN
19233
19681
  }, {
19234
19682
  name: 'anchor',
19235
19683
  parsePriority: 99,
19236
- defaultValue: '0 0',
19684
+ defaultValue: function defaultValue(nodeName) {
19685
+ if (nodeName === Shape.CIRCLE || nodeName === Shape.ELLIPSE) {
19686
+ return '0.5 0.5';
19687
+ }
19688
+
19689
+ return '0 0';
19690
+ },
19237
19691
  layoutDependent: true,
19238
19692
  syntax: PropertySyntax.LENGTH_PERCENTAGE_12
19239
19693
  }, // <circle> & <ellipse>
@@ -19453,6 +19907,7 @@ var DefaultStyleValueRegistry = /*#__PURE__*/function () {
19453
19907
  this.cache = {};
19454
19908
  this.unresolvedProperties = {};
19455
19909
  this.propertySyntaxFactory = void 0;
19910
+ this.sceneGraphService = void 0;
19456
19911
  this.cascadeProperties = {};
19457
19912
  }
19458
19913
 
@@ -19658,7 +20113,7 @@ var DefaultStyleValueRegistry = /*#__PURE__*/function () {
19658
20113
  if (value === 'initial') {
19659
20114
  // @see https://developer.mozilla.org/en-US/docs/Web/CSS/initial
19660
20115
  if (!isNil(defaultValue)) {
19661
- computed = this.parseProperty(name, defaultValue, object);
20116
+ computed = this.parseProperty(name, isFunction(defaultValue) ? defaultValue(object.nodeName) : defaultValue, object);
19662
20117
  }
19663
20118
  } else if (value === 'inherit') {
19664
20119
  // @see https://developer.mozilla.org/en-US/docs/Web/CSS/inherit
@@ -19899,8 +20354,7 @@ var DefaultStyleValueRegistry = /*#__PURE__*/function () {
19899
20354
  usedOriginXValue = usedOriginXValue - (flipY ? -1 : 1) * (anchor && anchor[0].value || 0) * geometry.contentBounds.halfExtents[0] * 2;
19900
20355
  usedOriginYValue = usedOriginYValue - (flipX ? -1 : 1) * (anchor && anchor[1].value || 0) * geometry.contentBounds.halfExtents[1] * 2;
19901
20356
  object.setOrigin(usedOriginXValue, usedOriginYValue);
19902
- object.dispatchEvent(new CustomEvent(ElementEvent.GEOMETRY_BOUNDS_CHANGED));
19903
- dirtifyToRoot(object);
20357
+ this.sceneGraphService.dirtifyToRoot(object);
19904
20358
  }
19905
20359
  };
19906
20360
 
@@ -19919,6 +20373,8 @@ var DefaultStyleValueRegistry = /*#__PURE__*/function () {
19919
20373
 
19920
20374
  __decorate([inject(CSSPropertySyntaxFactory), __metadata("design:type", Function)], DefaultStyleValueRegistry.prototype, "propertySyntaxFactory", void 0);
19921
20375
 
20376
+ __decorate([inject(SceneGraphService), __metadata("design:type", Object)], DefaultStyleValueRegistry.prototype, "sceneGraphService", void 0);
20377
+
19922
20378
  __decorate([postConstruct(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0)], DefaultStyleValueRegistry.prototype, "init", null);
19923
20379
 
19924
20380
  DefaultStyleValueRegistry = __decorate([singleton({
@@ -19968,6 +20424,7 @@ var containerModule = Module(function (register) {
19968
20424
  }
19969
20425
  }); // bind CSS property handlers
19970
20426
 
20427
+ register(CSSPropertyNumber);
19971
20428
  register(CSSPropertyAngle);
19972
20429
  register(CSSPropertyClipPath);
19973
20430
  register(CSSPropertyColor);
@@ -20099,7 +20556,7 @@ var AbstractRenderer = /*#__PURE__*/function () {
20099
20556
  * only dirty object will cause re-render
20100
20557
  */
20101
20558
  enableDirtyCheck: true,
20102
- enableCulling: true,
20559
+ enableCulling: false,
20103
20560
 
20104
20561
  /**
20105
20562
  * enable auto rendering by default
@@ -20171,26 +20628,29 @@ var CullingPlugin = CullingPlugin_1 = (_class$1 = /*#__PURE__*/function () {
20171
20628
  _proto.apply = function apply(renderingService) {
20172
20629
  var _this = this;
20173
20630
 
20174
- // const strategies = this.strategyProvider.getContributions();
20631
+ var strategies = this.strategyProvider.getContributions();
20175
20632
  renderingService.hooks.cull.tap(CullingPlugin_1.tag, function (object) {
20176
20633
  if (object) {
20177
- var cullable = object.cullable;
20178
- cullable.visible = true; // // const renderBounds = object.getRenderBounds();
20179
- // // if (AABB.isEmpty(renderBounds)) {
20180
- // // cullable.visible = false;
20181
- // // } else {
20182
- // // const isShape2D = shape2D.indexOf(object.nodeName as Shape) > -1;
20183
- // // const [p0, p1, p2, p3] = camera.getFrustum().planes;
20184
- // // tmpAABB.setMinMax([-p1.distance, -p3.distance, 0], [p0.distance, p2.distance, 0]);
20185
- // // cullable.visible = isShape2D ? renderBounds.intersects(tmpAABB) : true;
20186
- // // }
20187
- // if (strategies.length === 0) {
20188
- // cullable.visible = this.renderingContext.unculledEntities.indexOf(object.entity) > -1;
20634
+ var cullable = object.cullable; // cullable.visible = true;
20635
+ // const renderBounds = object.getRenderBounds();
20636
+ // if (AABB.isEmpty(renderBounds)) {
20637
+ // cullable.visible = false;
20189
20638
  // } else {
20190
- // // eg. implemented by g-webgl(frustum culling)
20191
- // cullable.visible = strategies.every((strategy) => strategy.isVisible(object));
20639
+ // const isShape2D = shape2D.indexOf(object.nodeName as Shape) > -1;
20640
+ // const [p0, p1, p2, p3] = camera.getFrustum().planes;
20641
+ // tmpAABB.setMinMax([-p1.distance, -p3.distance, 0], [p0.distance, p2.distance, 0]);
20642
+ // cullable.visible = isShape2D ? renderBounds.intersects(tmpAABB) : true;
20192
20643
  // }
20193
20644
 
20645
+ if (strategies.length === 0) {
20646
+ cullable.visible = _this.renderingContext.unculledEntities.indexOf(object.entity) > -1;
20647
+ } else {
20648
+ // eg. implemented by g-webgl(frustum culling)
20649
+ cullable.visible = strategies.every(function (strategy) {
20650
+ return strategy.isVisible(object);
20651
+ });
20652
+ }
20653
+
20194
20654
  if (!cullable.isCulled() && object.isVisible()) {
20195
20655
  return object;
20196
20656
  } else {
@@ -20228,22 +20688,15 @@ var DirtyCheckPlugin_1;
20228
20688
  */
20229
20689
 
20230
20690
  var DirtyCheckPlugin = DirtyCheckPlugin_1 = (_class$2 = /*#__PURE__*/function () {
20231
- function DirtyCheckPlugin() {
20232
- this.renderingContext = void 0;
20233
- }
20691
+ function DirtyCheckPlugin() {}
20234
20692
 
20235
20693
  var _proto = DirtyCheckPlugin.prototype;
20236
20694
 
20237
20695
  _proto.apply = function apply(renderingService) {
20238
- var _this = this;
20239
-
20240
20696
  renderingService.hooks.dirtycheck.tap(DirtyCheckPlugin_1.tag, function (object) {
20241
20697
  if (object) {
20242
20698
  var renderable = object.renderable;
20243
-
20244
- var isCameraDirty = _this.renderingContext.renderReasons.has(RenderReason.CAMERA_CHANGED);
20245
-
20246
- var isDirty = renderable.dirty || isCameraDirty;
20699
+ var isDirty = renderable.dirty || renderingService.disableDirtyRectangleRendering();
20247
20700
 
20248
20701
  if (isDirty) {
20249
20702
  return object;
@@ -20258,9 +20711,6 @@ var DirtyCheckPlugin = DirtyCheckPlugin_1 = (_class$2 = /*#__PURE__*/function ()
20258
20711
 
20259
20712
  return DirtyCheckPlugin;
20260
20713
  }(), _class$2.tag = 'DirtyCheck', _class$2);
20261
-
20262
- __decorate([inject(RenderingContext), __metadata("design:type", Object)], DirtyCheckPlugin.prototype, "renderingContext", void 0);
20263
-
20264
20714
  DirtyCheckPlugin = DirtyCheckPlugin_1 = __decorate([singleton({
20265
20715
  contrib: RenderingPluginContribution
20266
20716
  })], DirtyCheckPlugin);
@@ -20685,6 +21135,7 @@ var PrepareRendererPlugin = PrepareRendererPlugin_1 = (_class$4 = /*#__PURE__*/f
20685
21135
  function PrepareRendererPlugin() {
20686
21136
  this.renderingContext = void 0;
20687
21137
  this.styleValueRegistry = void 0;
21138
+ this.sceneGraphService = void 0;
20688
21139
  this.rBush = void 0;
20689
21140
  this.toSync = new Set();
20690
21141
  }
@@ -20731,7 +21182,8 @@ var PrepareRendererPlugin = PrepareRendererPlugin_1 = (_class$4 = /*#__PURE__*/f
20731
21182
 
20732
21183
  _this2.styleValueRegistry.recalc(object);
20733
21184
 
20734
- dirtifyToRoot(object);
21185
+ _this2.sceneGraphService.dirtifyToRoot(object);
21186
+
20735
21187
  renderingService.dirtify();
20736
21188
  };
20737
21189
 
@@ -20745,7 +21197,8 @@ var PrepareRendererPlugin = PrepareRendererPlugin_1 = (_class$4 = /*#__PURE__*/f
20745
21197
  _this2.toSync.delete(object);
20746
21198
  }
20747
21199
 
20748
- dirtifyToRoot(e.target);
21200
+ _this2.sceneGraphService.dirtifyToRoot(e.target);
21201
+
20749
21202
  renderingService.dirtify();
20750
21203
  };
20751
21204
 
@@ -20835,6 +21288,8 @@ __decorate([inject(RenderingContext), __metadata("design:type", Object)], Prepar
20835
21288
 
20836
21289
  __decorate([inject(StyleValueRegistry), __metadata("design:type", Object)], PrepareRendererPlugin.prototype, "styleValueRegistry", void 0);
20837
21290
 
21291
+ __decorate([inject(SceneGraphService), __metadata("design:type", Object)], PrepareRendererPlugin.prototype, "sceneGraphService", void 0);
21292
+
20838
21293
  __decorate([inject(RBushRoot), __metadata("design:type", RBush)], PrepareRendererPlugin.prototype, "rBush", void 0);
20839
21294
 
20840
21295
  PrepareRendererPlugin = PrepareRendererPlugin_1 = __decorate([singleton({
@@ -21530,4 +21985,4 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
21530
21985
  GlobalContainer.load(containerModule);
21531
21986
  var layoutEngine = GlobalContainer.get(LayoutEngine);
21532
21987
 
21533
- export { AABB, AbstractLayoutDefinition, AbstractRenderer, Animation, AnimationEffectTiming, AnimationEvent, AnimationTimeline, AsyncParallelHook, AsyncSeriesWaterfallHook, BUILT_IN_PROPERTIES, BaseType, BoundingSphere, CSS, CSSColorValue, CSSGradientValue, CSSKeywordValue, CSSMathInvert, CSSMathMax, CSSMathMin, CSSMathNegate, CSSMathOperator, CSSMathProduct, CSSMathSum, CSSMathValue, CSSMathVariadic, CSSNumericValue, CSSNumericValueType, CSSProperty, CSSPropertyAngle, CSSPropertyClipPath, CSSPropertyColor, CSSPropertyFilter, CSSPropertyLengthOrPercentage, CSSPropertyLengthOrPercentage12, CSSPropertyLengthOrPercentage14, CSSPropertyLocalPosition, CSSPropertyOffsetDistance, CSSPropertyOffsetPath, CSSPropertyOpacity, CSSPropertyPath, CSSPropertyPoints, CSSPropertyShadowBlur, CSSPropertySyntaxFactory, CSSPropertyText, CSSPropertyTextTransform, CSSPropertyTransform, CSSPropertyTransformOrigin, CSSPropertyZIndex, CSSRGB, CSSStyleValue, CSSStyleValueType, CSSUnitValue, Camera, CameraEvent, CameraProjectionMode, CameraTrackingMode, CameraType, Canvas, CanvasConfig, CanvasEvent, Circle, CircleUpdater, ContextNode, ContextService, Cullable, CustomElement, CustomElementRegistry, CustomEvent, DCHECK, DCHECK_EQ, DCHECK_NE, DELEGATION_SPLITTER, DefaultCamera, DefaultSceneGraphSelector, DefaultSceneGraphService, DefaultStyleValueRegistry, Deferred, DisplayObject, DisplayObjectPool, Document, EasingFunctions, Element, ElementEvent, Ellipse, EllipseUpdater, EventService, EventTarget, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FragmentResult, FragmentResultFactory, FragmentResultOptions, Frustum, Geometry, GeometryAABBUpdater, GeometryUpdaterFactory, GradientType, Group, HTML, Image, KeyframeEffect, LayoutChildren, LayoutChildrenFactory, LayoutChildrenOptions, LayoutContext, LayoutContextFactory, LayoutContextOptions, LayoutEdges, LayoutEdgesFactory, LayoutEdgesOptions, LayoutEngine, LayoutFragment, LayoutFragmentFactory, LayoutFragmentOptions, LayoutObject, LayoutRegistry, LayoutTaskType, Line, LineUpdater, MOUSE_POINTER_ID, Mask, MutationEvent, MutationObserver, MutationRecord, Nested, Node, ObjectTyped, Odeg, OffscreenCanvasCreator, Opx, ParenLess, Path, PathUpdater, Plane, Point, Polygon, Polyline, PolylineUpdater, PropertyName, PropertySyntax, RBushNode, RBushRoot, Ray, Rect, RectUpdater, Rectangle, Registration, RenderReason, Renderable, RenderingContext, RenderingPluginContribution, RenderingService, SceneGraphSelector, SceneGraphSelectorFactory, SceneGraphService, Shape, Sortable, Strategy, StyleValueRegistry, SyncHook, SyncWaterfallHook, TOUCH_TO_POINTER, Text, TextService, TextUpdater, Transform, UnitCategory, UnitType, ValueRange, baseTypeToString, camelCase, clamp, clampedMergeNumbers, cleanExistedCanvas, colorStopToString, compareAnimations, computeLinearGradient, computeRadialGradient, convertAngleUnit, convertEffectInput, convertPercentUnit, convertToDash, convertToPath, createVec3, decompose, deg2rad, deg2turn, dirtifyToRoot, equalSet, extractPolygons, formatAttribute, fromRotationTranslationScale, getAngle, getEasingFunction, getEuler, getHeight, getRotationInRadians, getScaling, getStyle, getTranslation, getWidth, grad2deg, hasArcOrBezier, isBoolean, isBrowser, isComparison, isFunction, isNil, isNumber, isObject, isPattern, isString, isUndefined, layoutEngine, makePerspective, makeQuerablePromise, makeTiming, memoize, mergeColors, mergeDimensionList, mergeDimensions, mergeNumberLists, mergeNumbers, mergePaths, mergeTransforms, normalizeKeyframes, normalizeTimingInput, numberToString, numericTimingToObject, parseAngle, parseColor, parseDimension, parseDimensionArray, parseFilter, parseGradient, parseLength, parseLengthOrPercentage, parseNumber, parseNumberList, parseParam, parsePath, parsePoints, parseTransform, parseTransformOrigin, parserPercentage, path2Segments, rad2deg, setDOMSize, sortByZIndex, toFontString, translatePathToString, turn2deg, typeCheck, unitTypeToBaseType };
21988
+ export { AABB, AbstractLayoutDefinition, AbstractRenderer, Animation, AnimationEffectTiming, AnimationEvent, AnimationTimeline, AsyncParallelHook, AsyncSeriesWaterfallHook, BUILT_IN_PROPERTIES, BaseType, BoundingSphere, CSS, CSSColorValue, CSSGradientValue, CSSKeywordValue, CSSMathInvert, CSSMathMax, CSSMathMin, CSSMathNegate, CSSMathOperator, CSSMathProduct, CSSMathSum, CSSMathValue, CSSMathVariadic, CSSNumericValue, CSSNumericValueType, CSSProperty, CSSPropertyAngle, CSSPropertyClipPath, CSSPropertyColor, CSSPropertyFilter, CSSPropertyLengthOrPercentage, CSSPropertyLengthOrPercentage12, CSSPropertyLengthOrPercentage14, CSSPropertyLocalPosition, CSSPropertyNumber, CSSPropertyOffsetDistance, CSSPropertyOffsetPath, CSSPropertyOpacity, CSSPropertyPath, CSSPropertyPoints, CSSPropertyShadowBlur, CSSPropertySyntaxFactory, CSSPropertyText, CSSPropertyTextTransform, CSSPropertyTransform, CSSPropertyTransformOrigin, CSSPropertyZIndex, CSSRGB, CSSStyleValue, CSSStyleValueType, CSSUnitValue, Camera, CameraEvent, CameraProjectionMode, CameraTrackingMode, CameraType, Canvas, CanvasConfig, CanvasEvent, Circle, CircleUpdater, ContextNode, ContextService, Cullable, CustomElement, CustomElementRegistry, CustomEvent, DCHECK, DCHECK_EQ, DCHECK_NE, DELEGATION_SPLITTER, DefaultCamera, DefaultSceneGraphSelector, DefaultSceneGraphService, DefaultStyleValueRegistry, Deferred, DisplayObject, DisplayObjectPool, Document, EasingFunctions, Element, ElementEvent, Ellipse, EllipseUpdater, EventService, EventTarget, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, FragmentResult, FragmentResultFactory, FragmentResultOptions, Frustum, Geometry, GeometryAABBUpdater, GeometryUpdaterFactory, GradientType, Group, HTML, Image, KeyframeEffect, LayoutChildren, LayoutChildrenFactory, LayoutChildrenOptions, LayoutContext, LayoutContextFactory, LayoutContextOptions, LayoutEdges, LayoutEdgesFactory, LayoutEdgesOptions, LayoutEngine, LayoutFragment, LayoutFragmentFactory, LayoutFragmentOptions, LayoutObject, LayoutRegistry, LayoutTaskType, Line, LineUpdater, MOUSE_POINTER_ID, Mask, MutationEvent, MutationObserver, MutationRecord, Nested, Node, ObjectTyped, Odeg, OffscreenCanvasCreator, Opx, ParenLess, Path, PathUpdater, Plane, Point, Polygon, Polyline, PolylineUpdater, PropertyName, PropertySyntax, RBushNode, RBushRoot, Ray, Rect, RectUpdater, Rectangle, Registration, RenderReason, Renderable, RenderingContext, RenderingPluginContribution, RenderingService, SceneGraphSelector, SceneGraphSelectorFactory, SceneGraphService, Shape, Sortable, Strategy, StyleValueRegistry, SyncHook, SyncWaterfallHook, TOUCH_TO_POINTER, Text, TextService, TextUpdater, Transform, UnitCategory, UnitType, ValueRange, baseTypeToString, camelCase, clamp, clampedMergeNumbers, cleanExistedCanvas, colorStopToString, compareAnimations, computeLinearGradient, computeRadialGradient, convertAngleUnit, convertEffectInput, convertItemToMatrix, convertPercentUnit, convertToDash, convertToPath, createVec3, decompose, deg2rad, deg2turn, equalSet, extractPolygons, formatAttribute, fromRotationTranslationScale, getAngle, getEasingFunction, getEuler, getHeight, getRotationInRadians, getScaling, getStyle, getTranslation, getWidth, grad2deg, hasArcOrBezier, isBoolean, isBrowser, isComparison, isFunction, isNil, isNumber, isObject, isPattern, isString, isUndefined, layoutEngine, makePerspective, makeQuerablePromise, makeTiming, memoize, mergeColors, mergeDimensionList, mergeDimensions, mergeNumberLists, mergeNumbers, mergePaths, mergeTransforms, normalizeKeyframes, normalizeTimingInput, numberToString, numericTimingToObject, parseAngle, parseColor, parseDimension, parseDimensionArray, parseFilter, parseGradient, parseLength, parseLengthOrPercentage, parseNumber, parseNumberList, parseParam, parsePath, parsePoints, parseTransform, parseTransformOrigin, parserPercentage, path2Segments, rad2deg, setDOMSize, sortByZIndex, toFontString, translatePathToString, turn2deg, typeCheck, unitTypeToBaseType };