@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/components/Geometry.d.ts +4 -0
- package/dist/css/StyleValueRegistry.d.ts +1 -1
- package/dist/css/cssom/CSSStyleValue.d.ts +1 -1
- package/dist/css/parser/dimension.d.ts +1 -1
- package/dist/css/properties/CSSPropertyTransformOrigin.d.ts +3 -1
- package/dist/display-objects/Circle.d.ts +1 -1
- package/dist/display-objects/Ellipse.d.ts +1 -1
- package/dist/dom/Element.d.ts +1 -0
- package/dist/dom/Node.d.ts +1 -0
- package/dist/dom/interfaces.d.ts +1 -1
- package/dist/index.esm.js +356 -309
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +356 -308
- package/dist/index.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/services/SceneGraphService.d.ts +12 -12
- package/dist/services/aabb/GroupUpdater.d.ts +10 -0
- package/dist/services/aabb/index.d.ts +1 -0
- package/dist/utils/path.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -3165,7 +3165,7 @@ var getOrCreateUnitValue = function (value, unitOrName) {
|
|
|
3165
3165
|
if (unitOrName === void 0) { unitOrName = UnitType.kNumber; }
|
|
3166
3166
|
return new CSSUnitValue(value, unitOrName);
|
|
3167
3167
|
};
|
|
3168
|
-
|
|
3168
|
+
new CSSUnitValue(50, '%');
|
|
3169
3169
|
|
|
3170
3170
|
/**
|
|
3171
3171
|
* @see https://doc.babylonjs.com/how_to/optimizing_your_scene#changing-mesh-culling-strategy
|
|
@@ -4107,19 +4107,17 @@ function parseDimensionArray(string) {
|
|
|
4107
4107
|
// },
|
|
4108
4108
|
// ];
|
|
4109
4109
|
// }
|
|
4110
|
-
function convertPercentUnit(valueWithUnit, vec3Index, target) {
|
|
4111
|
-
if (
|
|
4112
|
-
return 0;
|
|
4113
|
-
}
|
|
4110
|
+
function convertPercentUnit(valueWithUnit, vec3Index, target, useMin) {
|
|
4111
|
+
if (useMin === void 0) { useMin = false; }
|
|
4114
4112
|
if (valueWithUnit.unit === UnitType.kPixels) {
|
|
4115
4113
|
return Number(valueWithUnit.value);
|
|
4116
4114
|
}
|
|
4117
4115
|
else if (valueWithUnit.unit === UnitType.kPercentage && target) {
|
|
4118
4116
|
var bounds = target.nodeName === Shape.GROUP
|
|
4119
4117
|
? target.getLocalBounds()
|
|
4120
|
-
:
|
|
4121
|
-
|
|
4122
|
-
|
|
4118
|
+
: target.getGeometryBounds();
|
|
4119
|
+
return ((useMin ? bounds.min[vec3Index] : 0) +
|
|
4120
|
+
(valueWithUnit.value / 100) * bounds.halfExtents[vec3Index] * 2);
|
|
4123
4121
|
}
|
|
4124
4122
|
return 0;
|
|
4125
4123
|
}
|
|
@@ -5958,7 +5956,7 @@ function convertKeyword2Percent(keyword) {
|
|
|
5958
5956
|
return '50%';
|
|
5959
5957
|
}
|
|
5960
5958
|
else if (keyword === 'left' || keyword === 'top') {
|
|
5961
|
-
return '0';
|
|
5959
|
+
return '0%';
|
|
5962
5960
|
}
|
|
5963
5961
|
else if (keyword === 'right' || keyword === 'bottom') {
|
|
5964
5962
|
return '100%';
|
|
@@ -6226,16 +6224,17 @@ var BUILT_IN_PROPERTIES = [
|
|
|
6226
6224
|
{
|
|
6227
6225
|
n: 'transformOrigin',
|
|
6228
6226
|
p: 100,
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6227
|
+
d: '0 0',
|
|
6228
|
+
// // int: true,
|
|
6229
|
+
// d: (nodeName: string) => {
|
|
6230
|
+
// if (nodeName === Shape.CIRCLE || nodeName === Shape.ELLIPSE) {
|
|
6231
|
+
// return 'center';
|
|
6232
|
+
// }
|
|
6233
|
+
// if (nodeName === Shape.TEXT) {
|
|
6234
|
+
// return 'text-anchor';
|
|
6235
|
+
// }
|
|
6236
|
+
// return 'left top';
|
|
6237
|
+
// },
|
|
6239
6238
|
l: true,
|
|
6240
6239
|
syntax: PropertySyntax.TRANSFORM_ORIGIN,
|
|
6241
6240
|
},
|
|
@@ -6707,7 +6706,9 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
|
|
|
6707
6706
|
this.runtime.CSSPropertySyntaxFactory['<transform>'].postProcessor(object, attributeNames_1);
|
|
6708
6707
|
}
|
|
6709
6708
|
if (needUpdateGeometry_1) {
|
|
6710
|
-
|
|
6709
|
+
object.geometry.dirty = true;
|
|
6710
|
+
// FIXME setOrigin may have already dirtified to root.
|
|
6711
|
+
this.runtime.sceneGraphService.dirtifyToRoot(object);
|
|
6711
6712
|
}
|
|
6712
6713
|
return;
|
|
6713
6714
|
}
|
|
@@ -6766,9 +6767,9 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
|
|
|
6766
6767
|
// }
|
|
6767
6768
|
// update geometry
|
|
6768
6769
|
if (needUpdateGeometry) {
|
|
6769
|
-
|
|
6770
|
-
//
|
|
6771
|
-
this.
|
|
6770
|
+
object.geometry.dirty = true;
|
|
6771
|
+
// FIXME setOrigin may have already dirtified to root.
|
|
6772
|
+
this.runtime.sceneGraphService.dirtifyToRoot(object);
|
|
6772
6773
|
}
|
|
6773
6774
|
attributeNames.forEach(function (name) {
|
|
6774
6775
|
if (name in object.parsedStyle) {
|
|
@@ -7055,25 +7056,22 @@ var DefaultStyleValueRegistry = /** @class */ (function () {
|
|
|
7055
7056
|
geometry_1.renderBounds.setMinMax(min, max);
|
|
7056
7057
|
}
|
|
7057
7058
|
});
|
|
7058
|
-
|
|
7059
|
-
// account for negative width / height of Rect
|
|
7059
|
+
object.geometry.dirty = false;
|
|
7060
7060
|
// @see https://github.com/antvis/g/issues/957
|
|
7061
7061
|
var flipY = hwidth < 0;
|
|
7062
7062
|
var flipX = hheight < 0;
|
|
7063
|
-
// } else {
|
|
7064
|
-
// }
|
|
7065
7063
|
// set transform origin
|
|
7066
7064
|
var usedOriginXValue = (flipY ? -1 : 1) *
|
|
7067
7065
|
(transformOrigin
|
|
7068
|
-
? convertPercentUnit(transformOrigin[0], 0, object)
|
|
7066
|
+
? convertPercentUnit(transformOrigin[0], 0, object, true)
|
|
7069
7067
|
: 0);
|
|
7070
7068
|
var usedOriginYValue = (flipX ? -1 : 1) *
|
|
7071
7069
|
(transformOrigin
|
|
7072
|
-
? convertPercentUnit(transformOrigin[1], 1, object)
|
|
7070
|
+
? convertPercentUnit(transformOrigin[1], 1, object, true)
|
|
7073
7071
|
: 0);
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
|
|
7072
|
+
if (usedOriginXValue || usedOriginYValue) {
|
|
7073
|
+
object.setOrigin(usedOriginXValue, usedOriginYValue);
|
|
7074
|
+
}
|
|
7077
7075
|
}
|
|
7078
7076
|
};
|
|
7079
7077
|
DefaultStyleValueRegistry.prototype.isPropertyInheritable = function (name) {
|
|
@@ -7810,92 +7808,121 @@ function toFontString(attributes) {
|
|
|
7810
7808
|
return "".concat(fontStyle, " ").concat(fontVariant, " ").concat(fontWeight, " ").concat(fontSizeString, " ").concat(fontFamilies.join(','));
|
|
7811
7809
|
}
|
|
7812
7810
|
|
|
7813
|
-
|
|
7811
|
+
function createSkewMatrix(skewMatrix, skewX, skewY) {
|
|
7812
|
+
// Create an identity matrix
|
|
7813
|
+
mat4.identity(skewMatrix);
|
|
7814
|
+
// Apply skew to the matrix
|
|
7815
|
+
skewMatrix[4] = Math.tan(skewX); // Skew Y axis in X direction
|
|
7816
|
+
skewMatrix[1] = Math.tan(skewY); // Skew X axis in Y direction
|
|
7817
|
+
return skewMatrix;
|
|
7818
|
+
}
|
|
7819
|
+
var tmpMat1 = mat4.create();
|
|
7820
|
+
var tmpMat2 = mat4.create();
|
|
7814
7821
|
function parsedTransformToMat4(transform, object) {
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7832
|
-
|
|
7833
|
-
|
|
7834
|
-
|
|
7835
|
-
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
7839
|
-
|
|
7840
|
-
|
|
7841
|
-
|
|
7842
|
-
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
7848
|
-
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
|
|
7857
|
-
|
|
7858
|
-
|
|
7859
|
-
|
|
7860
|
-
|
|
7861
|
-
|
|
7862
|
-
|
|
7863
|
-
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
|
|
7874
|
-
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
|
|
7878
|
-
|
|
7879
|
-
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
7889
|
-
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7822
|
+
if (transform.length) {
|
|
7823
|
+
var m_1 = mat4.identity(tmpMat1);
|
|
7824
|
+
transform.forEach(function (parsed) {
|
|
7825
|
+
var t = parsed.t, d = parsed.d;
|
|
7826
|
+
if (t === 'scale') {
|
|
7827
|
+
// scale(1) scale(1, 1)
|
|
7828
|
+
var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1, 1];
|
|
7829
|
+
mat4.fromScaling(tmpMat2, [newScale[0], newScale[1], 1]);
|
|
7830
|
+
}
|
|
7831
|
+
else if (t === 'scalex') {
|
|
7832
|
+
var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1];
|
|
7833
|
+
mat4.fromScaling(tmpMat2, [newScale[0], 1, 1]);
|
|
7834
|
+
}
|
|
7835
|
+
else if (t === 'scaley') {
|
|
7836
|
+
var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1];
|
|
7837
|
+
mat4.fromScaling(tmpMat2, [1, newScale[0], 1]);
|
|
7838
|
+
}
|
|
7839
|
+
else if (t === 'scalez') {
|
|
7840
|
+
var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1];
|
|
7841
|
+
mat4.fromScaling(tmpMat2, [1, 1, newScale[0]]);
|
|
7842
|
+
}
|
|
7843
|
+
else if (t === 'scale3d') {
|
|
7844
|
+
var newScale = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [1, 1, 1];
|
|
7845
|
+
mat4.fromScaling(tmpMat2, [newScale[0], newScale[1], newScale[2]]);
|
|
7846
|
+
}
|
|
7847
|
+
else if (t === 'translate') {
|
|
7848
|
+
var newTranslation = d || [Opx, Opx];
|
|
7849
|
+
mat4.fromTranslation(tmpMat2, [
|
|
7850
|
+
newTranslation[0].value,
|
|
7851
|
+
newTranslation[1].value,
|
|
7852
|
+
0,
|
|
7853
|
+
]);
|
|
7854
|
+
}
|
|
7855
|
+
else if (t === 'translatex') {
|
|
7856
|
+
var newTranslation = d || [Opx];
|
|
7857
|
+
mat4.fromTranslation(tmpMat2, [newTranslation[0].value, 0, 0]);
|
|
7858
|
+
}
|
|
7859
|
+
else if (t === 'translatey') {
|
|
7860
|
+
var newTranslation = d || [Opx];
|
|
7861
|
+
mat4.fromTranslation(tmpMat2, [0, newTranslation[0].value, 0]);
|
|
7862
|
+
}
|
|
7863
|
+
else if (t === 'translatez') {
|
|
7864
|
+
var newTranslation = d || [Opx];
|
|
7865
|
+
mat4.fromTranslation(tmpMat2, [0, 0, newTranslation[0].value]);
|
|
7866
|
+
}
|
|
7867
|
+
else if (t === 'translate3d') {
|
|
7868
|
+
var newTranslation = d || [Opx, Opx, Opx];
|
|
7869
|
+
mat4.fromTranslation(tmpMat2, [
|
|
7870
|
+
newTranslation[0].value,
|
|
7871
|
+
newTranslation[1].value,
|
|
7872
|
+
newTranslation[2].value,
|
|
7873
|
+
]);
|
|
7874
|
+
}
|
|
7875
|
+
else if (t === 'rotate') {
|
|
7876
|
+
var newAngles = d || [Odeg];
|
|
7877
|
+
mat4.fromZRotation(tmpMat2, deg2rad(convertAngleUnit(newAngles[0])));
|
|
7878
|
+
}
|
|
7879
|
+
else if (t === 'rotatex') {
|
|
7880
|
+
var newAngles = d || [Odeg];
|
|
7881
|
+
mat4.fromXRotation(tmpMat2, deg2rad(convertAngleUnit(newAngles[0])));
|
|
7882
|
+
}
|
|
7883
|
+
else if (t === 'rotatey') {
|
|
7884
|
+
var newAngles = d || [Odeg];
|
|
7885
|
+
mat4.fromYRotation(tmpMat2, deg2rad(convertAngleUnit(newAngles[0])));
|
|
7886
|
+
}
|
|
7887
|
+
else if (t === 'rotatez') {
|
|
7888
|
+
var newAngles = d || [Odeg];
|
|
7889
|
+
mat4.fromZRotation(tmpMat2, deg2rad(convertAngleUnit(newAngles[0])));
|
|
7890
|
+
}
|
|
7891
|
+
else if (t === 'rotate3d') {
|
|
7892
|
+
var newAngles = d || [Opx, Opx, Opx, Odeg];
|
|
7893
|
+
mat4.fromRotation(tmpMat2, deg2rad(convertAngleUnit(newAngles[3])), [
|
|
7894
|
+
newAngles[0].value,
|
|
7895
|
+
newAngles[1].value,
|
|
7896
|
+
newAngles[2].value,
|
|
7897
|
+
]);
|
|
7898
|
+
}
|
|
7899
|
+
else if (t === 'skew') {
|
|
7900
|
+
var newSkew = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [0, 0];
|
|
7901
|
+
createSkewMatrix(tmpMat2, deg2rad(newSkew[0]), deg2rad(newSkew[1]));
|
|
7902
|
+
}
|
|
7903
|
+
else if (t === 'skewx') {
|
|
7904
|
+
var newSkew = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [0];
|
|
7905
|
+
createSkewMatrix(tmpMat2, deg2rad(newSkew[0]), 0);
|
|
7906
|
+
}
|
|
7907
|
+
else if (t === 'skewy') {
|
|
7908
|
+
var newSkew = (d === null || d === void 0 ? void 0 : d.map(function (s) { return s.value; })) || [0];
|
|
7909
|
+
createSkewMatrix(tmpMat2, 0, deg2rad(newSkew[0]));
|
|
7910
|
+
}
|
|
7911
|
+
else if (t === 'matrix') {
|
|
7912
|
+
var _a = __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];
|
|
7913
|
+
mat4.set(tmpMat2, a, b, 0, 0, c, dd, 0, 0, 0, 0, 1, 0, tx, ty, 0, 1);
|
|
7914
|
+
}
|
|
7915
|
+
else if (t === 'matrix3d') {
|
|
7916
|
+
// @ts-ignore
|
|
7917
|
+
mat4.set.apply(mat4, __spreadArray([tmpMat2], __read(d.map(function (s) { return s.value; })), false));
|
|
7918
|
+
}
|
|
7919
|
+
mat4.mul(m_1, m_1, tmpMat2);
|
|
7920
|
+
});
|
|
7921
|
+
object.setLocalTransform(m_1);
|
|
7922
|
+
}
|
|
7923
|
+
else {
|
|
7924
|
+
object.resetLocalTransform();
|
|
7925
|
+
}
|
|
7899
7926
|
return object.getLocalTransform();
|
|
7900
7927
|
}
|
|
7901
7928
|
|
|
@@ -7959,17 +7986,18 @@ var CSSPropertyTransformOrigin = /** @class */ (function () {
|
|
|
7959
7986
|
function CSSPropertyTransformOrigin() {
|
|
7960
7987
|
this.parser = parseTransformOrigin;
|
|
7961
7988
|
this.parserUnmemoize = parseTransformOriginUnmemoize;
|
|
7962
|
-
// calculator(
|
|
7963
|
-
// name: string,
|
|
7964
|
-
// oldParsed: [CSSUnitValue, CSSUnitValue],
|
|
7965
|
-
// parsed: [CSSUnitValue, CSSUnitValue],
|
|
7966
|
-
// object: DisplayObject,
|
|
7967
|
-
// ): [number, number] {
|
|
7968
|
-
// console.log(object, parsed);
|
|
7969
|
-
// return [parsed[0].value, parsed[1].value];
|
|
7970
|
-
// // return [convertPercentUnit(parsed[0], 0, object), convertPercentUnit(parsed[1], 1, object)];
|
|
7971
|
-
// }
|
|
7972
7989
|
}
|
|
7990
|
+
CSSPropertyTransformOrigin.prototype.postProcessor = function (object) {
|
|
7991
|
+
var transformOrigin = object.parsedStyle.transformOrigin;
|
|
7992
|
+
if (transformOrigin[0].unit === UnitType.kPixels &&
|
|
7993
|
+
transformOrigin[1].unit === UnitType.kPixels) {
|
|
7994
|
+
object.setOrigin(transformOrigin[0].value, transformOrigin[1].value);
|
|
7995
|
+
}
|
|
7996
|
+
else {
|
|
7997
|
+
// Relative to geometry bounds, calculate later.
|
|
7998
|
+
object.getGeometryBounds();
|
|
7999
|
+
}
|
|
8000
|
+
};
|
|
7973
8001
|
return CSSPropertyTransformOrigin;
|
|
7974
8002
|
}());
|
|
7975
8003
|
|
|
@@ -8219,6 +8247,20 @@ var TextUpdater = /** @class */ (function () {
|
|
|
8219
8247
|
return TextUpdater;
|
|
8220
8248
|
}());
|
|
8221
8249
|
|
|
8250
|
+
var GroupUpdater = /** @class */ (function () {
|
|
8251
|
+
function GroupUpdater() {
|
|
8252
|
+
}
|
|
8253
|
+
GroupUpdater.prototype.update = function (parsedStyle, object) {
|
|
8254
|
+
return {
|
|
8255
|
+
cx: 0,
|
|
8256
|
+
cy: 0,
|
|
8257
|
+
hwidth: 0,
|
|
8258
|
+
hheight: 0,
|
|
8259
|
+
};
|
|
8260
|
+
};
|
|
8261
|
+
return GroupUpdater;
|
|
8262
|
+
}());
|
|
8263
|
+
|
|
8222
8264
|
function isFederatedEvent(value) {
|
|
8223
8265
|
return !!value.type;
|
|
8224
8266
|
}
|
|
@@ -8769,7 +8811,7 @@ var EventTarget = /** @class */ (function () {
|
|
|
8769
8811
|
var Node = /** @class */ (function (_super) {
|
|
8770
8812
|
__extends(Node, _super);
|
|
8771
8813
|
function Node() {
|
|
8772
|
-
var _this = _super.
|
|
8814
|
+
var _this = _super.call(this) || this;
|
|
8773
8815
|
_this.shadow = false;
|
|
8774
8816
|
/**
|
|
8775
8817
|
* points to canvas.document
|
|
@@ -10318,9 +10360,10 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10318
10360
|
*/
|
|
10319
10361
|
this.rotate = (function () {
|
|
10320
10362
|
var parentInvertRotation = quat$1.create();
|
|
10321
|
-
return function (element, degrees, y, z) {
|
|
10363
|
+
return function (element, degrees, y, z, dirtify) {
|
|
10322
10364
|
if (y === void 0) { y = 0; }
|
|
10323
10365
|
if (z === void 0) { z = 0; }
|
|
10366
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10324
10367
|
if (typeof degrees === 'number') {
|
|
10325
10368
|
degrees = vec3.fromValues(degrees, y, z);
|
|
10326
10369
|
}
|
|
@@ -10339,7 +10382,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10339
10382
|
quat$1.multiply(rotation, parentInvertRotation, rotation);
|
|
10340
10383
|
quat$1.multiply(transform.localRotation, rotation, rot);
|
|
10341
10384
|
quat$1.normalize(transform.localRotation, transform.localRotation);
|
|
10342
|
-
|
|
10385
|
+
if (dirtify) {
|
|
10386
|
+
_this.dirtifyLocal(element, transform);
|
|
10387
|
+
}
|
|
10343
10388
|
}
|
|
10344
10389
|
};
|
|
10345
10390
|
})();
|
|
@@ -10349,16 +10394,19 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10349
10394
|
*/
|
|
10350
10395
|
this.rotateLocal = (function () {
|
|
10351
10396
|
var rotation = quat$1.create();
|
|
10352
|
-
return function (element, degrees, y, z) {
|
|
10397
|
+
return function (element, degrees, y, z, dirtify) {
|
|
10353
10398
|
if (y === void 0) { y = 0; }
|
|
10354
10399
|
if (z === void 0) { z = 0; }
|
|
10400
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10355
10401
|
if (typeof degrees === 'number') {
|
|
10356
10402
|
degrees = vec3.fromValues(degrees, y, z);
|
|
10357
10403
|
}
|
|
10358
10404
|
var transform = element.transformable;
|
|
10359
10405
|
quat$1.fromEuler(rotation, degrees[0], degrees[1], degrees[2]);
|
|
10360
10406
|
quat$1.mul(transform.localRotation, transform.localRotation, rotation);
|
|
10361
|
-
|
|
10407
|
+
if (dirtify) {
|
|
10408
|
+
_this.dirtifyLocal(element, transform);
|
|
10409
|
+
}
|
|
10362
10410
|
};
|
|
10363
10411
|
})();
|
|
10364
10412
|
/**
|
|
@@ -10366,9 +10414,10 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10366
10414
|
*/
|
|
10367
10415
|
this.setEulerAngles = (function () {
|
|
10368
10416
|
var invParentRot = quat$1.create();
|
|
10369
|
-
return function (element, degrees, y, z) {
|
|
10417
|
+
return function (element, degrees, y, z, dirtify) {
|
|
10370
10418
|
if (y === void 0) { y = 0; }
|
|
10371
10419
|
if (z === void 0) { z = 0; }
|
|
10420
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10372
10421
|
if (typeof degrees === 'number') {
|
|
10373
10422
|
degrees = vec3.fromValues(degrees, y, z);
|
|
10374
10423
|
}
|
|
@@ -10382,7 +10431,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10382
10431
|
var parentRotation = _this.getRotation(element.parentNode);
|
|
10383
10432
|
quat$1.copy(invParentRot, quat$1.invert(quat$1.create(), parentRotation));
|
|
10384
10433
|
quat$1.mul(transform.localRotation, transform.localRotation, invParentRot);
|
|
10385
|
-
|
|
10434
|
+
if (dirtify) {
|
|
10435
|
+
_this.dirtifyLocal(element, transform);
|
|
10436
|
+
}
|
|
10386
10437
|
}
|
|
10387
10438
|
};
|
|
10388
10439
|
})();
|
|
@@ -10396,9 +10447,10 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10396
10447
|
* ```
|
|
10397
10448
|
*/
|
|
10398
10449
|
this.translateLocal = (function () {
|
|
10399
|
-
return function (element, translation, y, z) {
|
|
10450
|
+
return function (element, translation, y, z, dirtify) {
|
|
10400
10451
|
if (y === void 0) { y = 0; }
|
|
10401
10452
|
if (z === void 0) { z = 0; }
|
|
10453
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10402
10454
|
if (typeof translation === 'number') {
|
|
10403
10455
|
translation = vec3.fromValues(translation, y, z);
|
|
10404
10456
|
}
|
|
@@ -10408,7 +10460,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10408
10460
|
}
|
|
10409
10461
|
vec3.transformQuat(translation, translation, transform.localRotation);
|
|
10410
10462
|
vec3.add(transform.localPosition, transform.localPosition, translation);
|
|
10411
|
-
|
|
10463
|
+
if (dirtify) {
|
|
10464
|
+
_this.dirtifyLocal(element, transform);
|
|
10465
|
+
}
|
|
10412
10466
|
};
|
|
10413
10467
|
})();
|
|
10414
10468
|
/**
|
|
@@ -10420,7 +10474,8 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10420
10474
|
this.setPosition = (function () {
|
|
10421
10475
|
var parentInvertMatrix = mat4.create();
|
|
10422
10476
|
var tmpPosition = vec3.create();
|
|
10423
|
-
return function (element, position) {
|
|
10477
|
+
return function (element, position, dirtify) {
|
|
10478
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10424
10479
|
var transform = element.transformable;
|
|
10425
10480
|
tmpPosition[0] = position[0];
|
|
10426
10481
|
tmpPosition[1] = position[1];
|
|
@@ -10439,7 +10494,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10439
10494
|
mat4.invert(parentInvertMatrix, parentInvertMatrix);
|
|
10440
10495
|
vec3.transformMat4(transform.localPosition, tmpPosition, parentInvertMatrix);
|
|
10441
10496
|
}
|
|
10442
|
-
|
|
10497
|
+
if (dirtify) {
|
|
10498
|
+
_this.dirtifyLocal(element, transform);
|
|
10499
|
+
}
|
|
10443
10500
|
};
|
|
10444
10501
|
})();
|
|
10445
10502
|
/**
|
|
@@ -10447,7 +10504,8 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10447
10504
|
*/
|
|
10448
10505
|
this.setLocalPosition = (function () {
|
|
10449
10506
|
var tmpPosition = vec3.create();
|
|
10450
|
-
return function (element, position) {
|
|
10507
|
+
return function (element, position, dirtify) {
|
|
10508
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10451
10509
|
var transform = element.transformable;
|
|
10452
10510
|
tmpPosition[0] = position[0];
|
|
10453
10511
|
tmpPosition[1] = position[1];
|
|
@@ -10456,7 +10514,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10456
10514
|
return;
|
|
10457
10515
|
}
|
|
10458
10516
|
vec3.copy(transform.localPosition, tmpPosition);
|
|
10459
|
-
|
|
10517
|
+
if (dirtify) {
|
|
10518
|
+
_this.dirtifyLocal(element, transform);
|
|
10519
|
+
}
|
|
10460
10520
|
};
|
|
10461
10521
|
})();
|
|
10462
10522
|
/**
|
|
@@ -10475,9 +10535,10 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10475
10535
|
var zeroVec3 = vec3.create();
|
|
10476
10536
|
var tmpVec3 = vec3.create();
|
|
10477
10537
|
var tr = vec3.create();
|
|
10478
|
-
return function (element, translation, y, z) {
|
|
10538
|
+
return function (element, translation, y, z, dirtify) {
|
|
10479
10539
|
if (y === void 0) { y = 0; }
|
|
10480
10540
|
if (z === void 0) { z = 0; }
|
|
10541
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10481
10542
|
if (typeof translation === 'number') {
|
|
10482
10543
|
translation = vec3.set(tmpVec3, translation, y, z);
|
|
10483
10544
|
}
|
|
@@ -10485,12 +10546,13 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10485
10546
|
return;
|
|
10486
10547
|
}
|
|
10487
10548
|
vec3.add(tr, _this.getPosition(element), translation);
|
|
10488
|
-
_this.setPosition(element, tr);
|
|
10549
|
+
_this.setPosition(element, tr, dirtify);
|
|
10489
10550
|
};
|
|
10490
10551
|
})();
|
|
10491
10552
|
this.setRotation = function () {
|
|
10492
10553
|
var parentInvertRotation = quat$1.create();
|
|
10493
|
-
return function (element, rotation, y, z, w) {
|
|
10554
|
+
return function (element, rotation, y, z, w, dirtify) {
|
|
10555
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10494
10556
|
var transform = element.transformable;
|
|
10495
10557
|
if (typeof rotation === 'number') {
|
|
10496
10558
|
rotation = quat$1.fromValues(rotation, y, z, w);
|
|
@@ -10505,7 +10567,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10505
10567
|
quat$1.invert(parentInvertRotation, parentInvertRotation);
|
|
10506
10568
|
quat$1.multiply(transform.localRotation, parentInvertRotation, rotation);
|
|
10507
10569
|
quat$1.normalize(transform.localRotation, transform.localRotation);
|
|
10508
|
-
|
|
10570
|
+
if (dirtify) {
|
|
10571
|
+
_this.dirtifyLocal(element, transform);
|
|
10572
|
+
}
|
|
10509
10573
|
}
|
|
10510
10574
|
};
|
|
10511
10575
|
};
|
|
@@ -10546,7 +10610,7 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10546
10610
|
// .filter((node) => !node.shadow);
|
|
10547
10611
|
};
|
|
10548
10612
|
DefaultSceneGraphService.prototype.attach = function (child, parent, index) {
|
|
10549
|
-
var _a
|
|
10613
|
+
var _a;
|
|
10550
10614
|
var detached = false;
|
|
10551
10615
|
if (child.parentNode) {
|
|
10552
10616
|
detached = child.parentNode !== parent;
|
|
@@ -10562,7 +10626,7 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10562
10626
|
// parent needs re-sort
|
|
10563
10627
|
var sortable = parent.sortable;
|
|
10564
10628
|
if (((_a = sortable === null || sortable === void 0 ? void 0 : sortable.sorted) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
10565
|
-
|
|
10629
|
+
child.parsedStyle.zIndex) {
|
|
10566
10630
|
if (sortable.dirtyChildren.indexOf(child) === -1) {
|
|
10567
10631
|
sortable.dirtyChildren.push(child);
|
|
10568
10632
|
}
|
|
@@ -10647,40 +10711,52 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10647
10711
|
/**
|
|
10648
10712
|
* set euler angles(degrees) in local space
|
|
10649
10713
|
*/
|
|
10650
|
-
DefaultSceneGraphService.prototype.setLocalEulerAngles = function (element, degrees, y, z) {
|
|
10714
|
+
DefaultSceneGraphService.prototype.setLocalEulerAngles = function (element, degrees, y, z, dirtify) {
|
|
10651
10715
|
if (y === void 0) { y = 0; }
|
|
10652
10716
|
if (z === void 0) { z = 0; }
|
|
10717
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10653
10718
|
if (typeof degrees === 'number') {
|
|
10654
10719
|
degrees = vec3.fromValues(degrees, y, z);
|
|
10655
10720
|
}
|
|
10656
10721
|
var transform = element.transformable;
|
|
10657
10722
|
quat$1.fromEuler(transform.localRotation, degrees[0], degrees[1], degrees[2]);
|
|
10658
|
-
|
|
10723
|
+
if (dirtify) {
|
|
10724
|
+
this.dirtifyLocal(element, transform);
|
|
10725
|
+
}
|
|
10659
10726
|
};
|
|
10660
10727
|
/**
|
|
10661
10728
|
* scale in local space
|
|
10662
10729
|
*/
|
|
10663
|
-
DefaultSceneGraphService.prototype.scaleLocal = function (element, scaling) {
|
|
10730
|
+
DefaultSceneGraphService.prototype.scaleLocal = function (element, scaling, dirtify) {
|
|
10731
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10664
10732
|
var transform = element.transformable;
|
|
10665
10733
|
vec3.multiply(transform.localScale, transform.localScale, vec3.fromValues(scaling[0], scaling[1], scaling[2] || 1));
|
|
10666
|
-
|
|
10734
|
+
if (dirtify) {
|
|
10735
|
+
this.dirtifyLocal(element, transform);
|
|
10736
|
+
}
|
|
10667
10737
|
};
|
|
10668
|
-
DefaultSceneGraphService.prototype.setLocalScale = function (element, scaling) {
|
|
10738
|
+
DefaultSceneGraphService.prototype.setLocalScale = function (element, scaling, dirtify) {
|
|
10739
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10669
10740
|
var transform = element.transformable;
|
|
10670
10741
|
var updatedScaling = vec3.fromValues(scaling[0], scaling[1], scaling[2] || transform.localScale[2]);
|
|
10671
10742
|
if (vec3.equals(updatedScaling, transform.localScale)) {
|
|
10672
10743
|
return;
|
|
10673
10744
|
}
|
|
10674
10745
|
vec3.copy(transform.localScale, updatedScaling);
|
|
10675
|
-
|
|
10746
|
+
if (dirtify) {
|
|
10747
|
+
this.dirtifyLocal(element, transform);
|
|
10748
|
+
}
|
|
10676
10749
|
};
|
|
10677
|
-
DefaultSceneGraphService.prototype.setLocalRotation = function (element, rotation, y, z, w) {
|
|
10750
|
+
DefaultSceneGraphService.prototype.setLocalRotation = function (element, rotation, y, z, w, dirtify) {
|
|
10751
|
+
if (dirtify === void 0) { dirtify = true; }
|
|
10678
10752
|
if (typeof rotation === 'number') {
|
|
10679
10753
|
rotation = quat$1.fromValues(rotation, y, z, w);
|
|
10680
10754
|
}
|
|
10681
10755
|
var transform = element.transformable;
|
|
10682
10756
|
quat$1.copy(transform.localRotation, rotation);
|
|
10683
|
-
|
|
10757
|
+
if (dirtify) {
|
|
10758
|
+
this.dirtifyLocal(element, transform);
|
|
10759
|
+
}
|
|
10684
10760
|
};
|
|
10685
10761
|
DefaultSceneGraphService.prototype.setLocalSkew = function (element, skew, y) {
|
|
10686
10762
|
if (typeof skew === 'number') {
|
|
@@ -10844,9 +10920,10 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10844
10920
|
var t = mat4.getTranslation(vec3.create(), transform);
|
|
10845
10921
|
var r = mat4.getRotation(quat$1.create(), transform);
|
|
10846
10922
|
var s = mat4.getScaling(vec3.create(), transform);
|
|
10847
|
-
this.setLocalScale(element, s);
|
|
10848
|
-
this.setLocalPosition(element, t);
|
|
10849
|
-
this.setLocalRotation(element, r);
|
|
10923
|
+
this.setLocalScale(element, s, false);
|
|
10924
|
+
this.setLocalPosition(element, t, false);
|
|
10925
|
+
this.setLocalRotation(element, r, undefined, undefined, undefined, false);
|
|
10926
|
+
this.dirtifyLocal(element, element.transformable);
|
|
10850
10927
|
};
|
|
10851
10928
|
DefaultSceneGraphService.prototype.resetLocalTransform = function (element) {
|
|
10852
10929
|
this.setLocalScale(element, [1, 1, 1]);
|
|
@@ -10872,6 +10949,9 @@ var DefaultSceneGraphService = /** @class */ (function () {
|
|
|
10872
10949
|
DefaultSceneGraphService.prototype.getGeometryBounds = function (element, render) {
|
|
10873
10950
|
if (render === void 0) { render = false; }
|
|
10874
10951
|
var geometry = element.geometry;
|
|
10952
|
+
if (geometry.dirty) {
|
|
10953
|
+
runtime.styleValueRegistry.updateGeometry(element);
|
|
10954
|
+
}
|
|
10875
10955
|
var bounds = render
|
|
10876
10956
|
? geometry.renderBounds
|
|
10877
10957
|
: geometry.contentBounds || null;
|
|
@@ -11462,7 +11542,7 @@ var geometryUpdaterFactory = (function () {
|
|
|
11462
11542
|
_a[Shape.ELLIPSE] = new EllipseUpdater(),
|
|
11463
11543
|
_a[Shape.RECT] = rectUpdater,
|
|
11464
11544
|
_a[Shape.IMAGE] = rectUpdater,
|
|
11465
|
-
_a[Shape.GROUP] =
|
|
11545
|
+
_a[Shape.GROUP] = new GroupUpdater(),
|
|
11466
11546
|
_a[Shape.LINE] = new LineUpdater(),
|
|
11467
11547
|
_a[Shape.TEXT] = new TextUpdater(runtime),
|
|
11468
11548
|
_a[Shape.POLYLINE] = polylineUpdater,
|
|
@@ -11556,7 +11636,7 @@ var destroyEvent = new CustomEvent(ElementEvent.DESTROY);
|
|
|
11556
11636
|
var Element = /** @class */ (function (_super) {
|
|
11557
11637
|
__extends(Element, _super);
|
|
11558
11638
|
function Element() {
|
|
11559
|
-
var _this = _super.
|
|
11639
|
+
var _this = _super.call(this) || this;
|
|
11560
11640
|
/**
|
|
11561
11641
|
* Unique id.
|
|
11562
11642
|
*/
|
|
@@ -11600,6 +11680,7 @@ var Element = /** @class */ (function (_super) {
|
|
|
11600
11680
|
_this.geometry = {
|
|
11601
11681
|
contentBounds: undefined,
|
|
11602
11682
|
renderBounds: undefined,
|
|
11683
|
+
dirty: true,
|
|
11603
11684
|
};
|
|
11604
11685
|
_this.rBushNode = {
|
|
11605
11686
|
aabb: undefined,
|
|
@@ -11783,11 +11864,8 @@ var Element = /** @class */ (function (_super) {
|
|
|
11783
11864
|
if ((_a = this.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) {
|
|
11784
11865
|
this.ownerDocument.defaultView.mountChildren(child);
|
|
11785
11866
|
}
|
|
11786
|
-
|
|
11787
|
-
|
|
11788
|
-
insertedEvent.relatedNode = this;
|
|
11789
|
-
child.dispatchEvent(insertedEvent);
|
|
11790
|
-
}
|
|
11867
|
+
insertedEvent.relatedNode = this;
|
|
11868
|
+
child.dispatchEvent(insertedEvent);
|
|
11791
11869
|
return child;
|
|
11792
11870
|
};
|
|
11793
11871
|
Element.prototype.insertBefore = function (newChild, refChild) {
|
|
@@ -12229,8 +12307,6 @@ var DisplayObject = /** @class */ (function (_super) {
|
|
|
12229
12307
|
// assign name, id to config
|
|
12230
12308
|
// eg. group.get('name')
|
|
12231
12309
|
_this.config = config;
|
|
12232
|
-
// compatible with G 3.0
|
|
12233
|
-
// this.config.interactive = this.config.capture ?? this.config.interactive;
|
|
12234
12310
|
// init scene graph node
|
|
12235
12311
|
_this.id = _this.config.id || '';
|
|
12236
12312
|
_this.name = _this.config.name || '';
|
|
@@ -12238,23 +12314,6 @@ var DisplayObject = /** @class */ (function (_super) {
|
|
|
12238
12314
|
_this.className = _this.config.className || _this.config.class;
|
|
12239
12315
|
}
|
|
12240
12316
|
_this.nodeName = _this.config.type || Shape.GROUP;
|
|
12241
|
-
// // compatible with G 3.0
|
|
12242
|
-
// this.config.style =
|
|
12243
|
-
// this.config.style || this.config.attrs || ({} as StyleProps);
|
|
12244
|
-
// // Object.assign(this.config.style, this.config.attrs);
|
|
12245
|
-
// // this.config.style = {
|
|
12246
|
-
// // // ...DEFAULT_STYLE_PROPS,
|
|
12247
|
-
// // ...this.config.style,
|
|
12248
|
-
// // ...this.config.attrs,
|
|
12249
|
-
// // };
|
|
12250
|
-
// if (this.config.visible != null) {
|
|
12251
|
-
// this.config.style.visibility =
|
|
12252
|
-
// this.config.visible === false ? 'hidden' : 'visible';
|
|
12253
|
-
// }
|
|
12254
|
-
// if (this.config.interactive != null) {
|
|
12255
|
-
// this.config.style.pointerEvents =
|
|
12256
|
-
// this.config.interactive === false ? 'none' : 'auto';
|
|
12257
|
-
// }
|
|
12258
12317
|
// merge parsed value
|
|
12259
12318
|
Object.assign(_this.parsedStyle, runtime.enableCSSParsing
|
|
12260
12319
|
? DEFAULT_PARSED_STYLE_PROPS
|
|
@@ -12901,124 +12960,13 @@ var DisplayObject = /** @class */ (function (_super) {
|
|
|
12901
12960
|
return DisplayObject;
|
|
12902
12961
|
}(Element));
|
|
12903
12962
|
|
|
12904
|
-
/**
|
|
12905
|
-
* holds useful CSS-related methods.
|
|
12906
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSS
|
|
12907
|
-
*
|
|
12908
|
-
* * CSS Typed OM @see https://developer.mozilla.org/en-US/docs/Web/API/CSS/factory_functions
|
|
12909
|
-
* * register property @see https://developer.mozilla.org/en-US/docs/Web/API/CSS/RegisterProperty
|
|
12910
|
-
* * CSS Layout API
|
|
12911
|
-
*/
|
|
12912
|
-
var CSS = {
|
|
12913
|
-
/**
|
|
12914
|
-
* <number>
|
|
12915
|
-
* @see https://drafts.csswg.org/css-values-4/#number-value
|
|
12916
|
-
*/
|
|
12917
|
-
number: function (n) {
|
|
12918
|
-
return new CSSUnitValue(n);
|
|
12919
|
-
},
|
|
12920
|
-
/**
|
|
12921
|
-
* <percentage>
|
|
12922
|
-
* @see https://drafts.csswg.org/css-values-4/#percentage-value
|
|
12923
|
-
*/
|
|
12924
|
-
percent: function (n) {
|
|
12925
|
-
return new CSSUnitValue(n, '%');
|
|
12926
|
-
},
|
|
12927
|
-
/**
|
|
12928
|
-
* <length>
|
|
12929
|
-
*/
|
|
12930
|
-
px: function (n) {
|
|
12931
|
-
return new CSSUnitValue(n, 'px');
|
|
12932
|
-
},
|
|
12933
|
-
/**
|
|
12934
|
-
* <length>
|
|
12935
|
-
*/
|
|
12936
|
-
em: function (n) {
|
|
12937
|
-
return new CSSUnitValue(n, 'em');
|
|
12938
|
-
},
|
|
12939
|
-
rem: function (n) {
|
|
12940
|
-
return new CSSUnitValue(n, 'rem');
|
|
12941
|
-
},
|
|
12942
|
-
/**
|
|
12943
|
-
* <angle>
|
|
12944
|
-
*/
|
|
12945
|
-
deg: function (n) {
|
|
12946
|
-
return new CSSUnitValue(n, 'deg');
|
|
12947
|
-
},
|
|
12948
|
-
/**
|
|
12949
|
-
* <angle>
|
|
12950
|
-
*/
|
|
12951
|
-
grad: function (n) {
|
|
12952
|
-
return new CSSUnitValue(n, 'grad');
|
|
12953
|
-
},
|
|
12954
|
-
/**
|
|
12955
|
-
* <angle>
|
|
12956
|
-
*/
|
|
12957
|
-
rad: function (n) {
|
|
12958
|
-
return new CSSUnitValue(n, 'rad');
|
|
12959
|
-
},
|
|
12960
|
-
/**
|
|
12961
|
-
* <angle>
|
|
12962
|
-
*/
|
|
12963
|
-
turn: function (n) {
|
|
12964
|
-
return new CSSUnitValue(n, 'turn');
|
|
12965
|
-
},
|
|
12966
|
-
/**
|
|
12967
|
-
* <time>
|
|
12968
|
-
*/
|
|
12969
|
-
s: function (n) {
|
|
12970
|
-
return new CSSUnitValue(n, 's');
|
|
12971
|
-
},
|
|
12972
|
-
/**
|
|
12973
|
-
* <time>
|
|
12974
|
-
*/
|
|
12975
|
-
ms: function (n) {
|
|
12976
|
-
return new CSSUnitValue(n, 'ms');
|
|
12977
|
-
},
|
|
12978
|
-
/**
|
|
12979
|
-
* CSS Properties & Values API
|
|
12980
|
-
*
|
|
12981
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSS_Properties_and_Values_API
|
|
12982
|
-
* @see https://drafts.css-houdini.org/css-properties-values-api/#registering-custom-properties
|
|
12983
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSS/RegisterProperty
|
|
12984
|
-
*/
|
|
12985
|
-
registerProperty: function (definition) {
|
|
12986
|
-
var name = definition.name, inherits = definition.inherits, interpolable = definition.interpolable, initialValue = definition.initialValue, syntax = definition.syntax;
|
|
12987
|
-
runtime.styleValueRegistry.registerMetadata({
|
|
12988
|
-
n: name,
|
|
12989
|
-
inh: inherits,
|
|
12990
|
-
int: interpolable,
|
|
12991
|
-
d: initialValue,
|
|
12992
|
-
syntax: syntax,
|
|
12993
|
-
});
|
|
12994
|
-
},
|
|
12995
|
-
/**
|
|
12996
|
-
* CSS Layout API
|
|
12997
|
-
* register layout
|
|
12998
|
-
*
|
|
12999
|
-
* @see https://github.com/w3c/css-houdini-drafts/blob/main/css-layout-api/EXPLAINER.md
|
|
13000
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/Guide/Houdini#css_layout_api
|
|
13001
|
-
*/
|
|
13002
|
-
registerLayout: function (name, clazz) {
|
|
13003
|
-
runtime.layoutRegistry.registerLayout(name, clazz);
|
|
13004
|
-
},
|
|
13005
|
-
};
|
|
13006
|
-
|
|
13007
12963
|
var Circle = /** @class */ (function (_super) {
|
|
13008
12964
|
__extends(Circle, _super);
|
|
13009
|
-
|
|
13010
|
-
|
|
13011
|
-
|
|
13012
|
-
|
|
13013
|
-
|
|
13014
|
-
if (_a === void 0) { _a = {}; }
|
|
13015
|
-
var style = _a.style, rest = __rest(_a, ["style"]);
|
|
13016
|
-
return _super.call(this, __assign({ type: Shape.CIRCLE, style: runtime.enableCSSParsing
|
|
13017
|
-
? __assign({ cx: '', cy: '', r: '' }, style) : __assign({}, style), initialParsedStyle: {
|
|
13018
|
-
transformOrigin: runtime.enableCSSParsing
|
|
13019
|
-
? null
|
|
13020
|
-
: [PECENTAGE_50, PECENTAGE_50],
|
|
13021
|
-
} }, rest)) || this;
|
|
12965
|
+
function Circle(options) {
|
|
12966
|
+
if (options === void 0) { options = {}; }
|
|
12967
|
+
var _this = _super.call(this, options) || this;
|
|
12968
|
+
_this.nodeName = Shape.CIRCLE;
|
|
12969
|
+
return _this;
|
|
13022
12970
|
}
|
|
13023
12971
|
return Circle;
|
|
13024
12972
|
}(DisplayObject));
|
|
@@ -13047,15 +12995,11 @@ var CustomElement = /** @class */ (function (_super) {
|
|
|
13047
12995
|
|
|
13048
12996
|
var Ellipse = /** @class */ (function (_super) {
|
|
13049
12997
|
__extends(Ellipse, _super);
|
|
13050
|
-
function Ellipse(
|
|
13051
|
-
if (
|
|
13052
|
-
var
|
|
13053
|
-
|
|
13054
|
-
|
|
13055
|
-
transformOrigin: runtime.enableCSSParsing
|
|
13056
|
-
? null
|
|
13057
|
-
: [PECENTAGE_50, PECENTAGE_50],
|
|
13058
|
-
} }, rest)) || this;
|
|
12998
|
+
function Ellipse(options) {
|
|
12999
|
+
if (options === void 0) { options = {}; }
|
|
13000
|
+
var _this = _super.call(this, options) || this;
|
|
13001
|
+
_this.nodeName = Shape.ELLIPSE;
|
|
13002
|
+
return _this;
|
|
13059
13003
|
}
|
|
13060
13004
|
return Ellipse;
|
|
13061
13005
|
}(DisplayObject));
|
|
@@ -13806,6 +13750,109 @@ var CustomElementRegistry = /** @class */ (function () {
|
|
|
13806
13750
|
return CustomElementRegistry;
|
|
13807
13751
|
}());
|
|
13808
13752
|
|
|
13753
|
+
/**
|
|
13754
|
+
* holds useful CSS-related methods.
|
|
13755
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSS
|
|
13756
|
+
*
|
|
13757
|
+
* * CSS Typed OM @see https://developer.mozilla.org/en-US/docs/Web/API/CSS/factory_functions
|
|
13758
|
+
* * register property @see https://developer.mozilla.org/en-US/docs/Web/API/CSS/RegisterProperty
|
|
13759
|
+
* * CSS Layout API
|
|
13760
|
+
*/
|
|
13761
|
+
var CSS = {
|
|
13762
|
+
/**
|
|
13763
|
+
* <number>
|
|
13764
|
+
* @see https://drafts.csswg.org/css-values-4/#number-value
|
|
13765
|
+
*/
|
|
13766
|
+
number: function (n) {
|
|
13767
|
+
return new CSSUnitValue(n);
|
|
13768
|
+
},
|
|
13769
|
+
/**
|
|
13770
|
+
* <percentage>
|
|
13771
|
+
* @see https://drafts.csswg.org/css-values-4/#percentage-value
|
|
13772
|
+
*/
|
|
13773
|
+
percent: function (n) {
|
|
13774
|
+
return new CSSUnitValue(n, '%');
|
|
13775
|
+
},
|
|
13776
|
+
/**
|
|
13777
|
+
* <length>
|
|
13778
|
+
*/
|
|
13779
|
+
px: function (n) {
|
|
13780
|
+
return new CSSUnitValue(n, 'px');
|
|
13781
|
+
},
|
|
13782
|
+
/**
|
|
13783
|
+
* <length>
|
|
13784
|
+
*/
|
|
13785
|
+
em: function (n) {
|
|
13786
|
+
return new CSSUnitValue(n, 'em');
|
|
13787
|
+
},
|
|
13788
|
+
rem: function (n) {
|
|
13789
|
+
return new CSSUnitValue(n, 'rem');
|
|
13790
|
+
},
|
|
13791
|
+
/**
|
|
13792
|
+
* <angle>
|
|
13793
|
+
*/
|
|
13794
|
+
deg: function (n) {
|
|
13795
|
+
return new CSSUnitValue(n, 'deg');
|
|
13796
|
+
},
|
|
13797
|
+
/**
|
|
13798
|
+
* <angle>
|
|
13799
|
+
*/
|
|
13800
|
+
grad: function (n) {
|
|
13801
|
+
return new CSSUnitValue(n, 'grad');
|
|
13802
|
+
},
|
|
13803
|
+
/**
|
|
13804
|
+
* <angle>
|
|
13805
|
+
*/
|
|
13806
|
+
rad: function (n) {
|
|
13807
|
+
return new CSSUnitValue(n, 'rad');
|
|
13808
|
+
},
|
|
13809
|
+
/**
|
|
13810
|
+
* <angle>
|
|
13811
|
+
*/
|
|
13812
|
+
turn: function (n) {
|
|
13813
|
+
return new CSSUnitValue(n, 'turn');
|
|
13814
|
+
},
|
|
13815
|
+
/**
|
|
13816
|
+
* <time>
|
|
13817
|
+
*/
|
|
13818
|
+
s: function (n) {
|
|
13819
|
+
return new CSSUnitValue(n, 's');
|
|
13820
|
+
},
|
|
13821
|
+
/**
|
|
13822
|
+
* <time>
|
|
13823
|
+
*/
|
|
13824
|
+
ms: function (n) {
|
|
13825
|
+
return new CSSUnitValue(n, 'ms');
|
|
13826
|
+
},
|
|
13827
|
+
/**
|
|
13828
|
+
* CSS Properties & Values API
|
|
13829
|
+
*
|
|
13830
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSS_Properties_and_Values_API
|
|
13831
|
+
* @see https://drafts.css-houdini.org/css-properties-values-api/#registering-custom-properties
|
|
13832
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSS/RegisterProperty
|
|
13833
|
+
*/
|
|
13834
|
+
registerProperty: function (definition) {
|
|
13835
|
+
var name = definition.name, inherits = definition.inherits, interpolable = definition.interpolable, initialValue = definition.initialValue, syntax = definition.syntax;
|
|
13836
|
+
runtime.styleValueRegistry.registerMetadata({
|
|
13837
|
+
n: name,
|
|
13838
|
+
inh: inherits,
|
|
13839
|
+
int: interpolable,
|
|
13840
|
+
d: initialValue,
|
|
13841
|
+
syntax: syntax,
|
|
13842
|
+
});
|
|
13843
|
+
},
|
|
13844
|
+
/**
|
|
13845
|
+
* CSS Layout API
|
|
13846
|
+
* register layout
|
|
13847
|
+
*
|
|
13848
|
+
* @see https://github.com/w3c/css-houdini-drafts/blob/main/css-layout-api/EXPLAINER.md
|
|
13849
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/Guide/Houdini#css_layout_api
|
|
13850
|
+
*/
|
|
13851
|
+
registerLayout: function (name, clazz) {
|
|
13852
|
+
runtime.layoutRegistry.registerLayout(name, clazz);
|
|
13853
|
+
},
|
|
13854
|
+
};
|
|
13855
|
+
|
|
13809
13856
|
/**
|
|
13810
13857
|
* the entry of DOM tree
|
|
13811
13858
|
* Document -> Node -> EventTarget
|
|
@@ -15275,5 +15322,5 @@ var Canvas = /** @class */ (function (_super) {
|
|
|
15275
15322
|
return Canvas;
|
|
15276
15323
|
}(EventTarget));
|
|
15277
15324
|
|
|
15278
|
-
export { AABB, AbstractRenderer, AbstractRendererPlugin, BUILT_IN_PROPERTIES, CSS, CSSGradientValue, CSSKeywordValue, CSSRGB, CSSStyleValue, CSSUnitValue, Camera, CameraEvent, CameraProjectionMode, CameraTrackingMode, CameraType, Canvas, CanvasEvent, Circle, CircleUpdater, ClipSpaceNearZ, CustomElement, CustomElementRegistry, CustomEvent, DefaultSceneGraphSelector, DefaultSceneGraphService, DisplayObject, Document, ERROR_MSG_METHOD_NOT_IMPLEMENTED, Element, ElementEvent, Ellipse, EllipseUpdater, EventService, EventTarget, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, Frustum, GradientType, Group, HTML, Image, Line, LineUpdater, Mask, MutationEvent, Node, OffscreenCanvasCreator, Path, PathUpdater, Plane, Point, Polygon, Polyline, PolylineUpdater, PropertySyntax, RBush, Rect, RectUpdater, Rectangle, RenderReason, RenderingService, Shape, SortReason, Strategy, Text, TextService, TextUpdater, UnitType, computeLinearGradient, computeRadialGradient, convertToPath, createVec3, decompose, definedProps, deg2rad, deg2turn, findClosestClipPathTarget, fromRotationTranslationScale, getAngle, getEuler, getOrCalculatePathTotalLength, grad2deg, isBrowser, isCSSGradientValue, isCSSRGB, isCanvas, isDisplayObject, isFederatedEvent, isFillOrStrokeAffected, isPattern, mergeColors, parseColor, parseLength, parsePath, parseTransform, parsedTransformToMat4, propertyMetadataCache, rad2deg, resetEntityCounter, runtime, setDOMSize, translatePathToString, turn2deg };
|
|
15325
|
+
export { AABB, AbstractRenderer, AbstractRendererPlugin, BUILT_IN_PROPERTIES, CSS, CSSGradientValue, CSSKeywordValue, CSSRGB, CSSStyleValue, CSSUnitValue, Camera, CameraEvent, CameraProjectionMode, CameraTrackingMode, CameraType, Canvas, CanvasEvent, Circle, CircleUpdater, ClipSpaceNearZ, CustomElement, CustomElementRegistry, CustomEvent, DefaultSceneGraphSelector, DefaultSceneGraphService, DisplayObject, Document, ERROR_MSG_METHOD_NOT_IMPLEMENTED, Element, ElementEvent, Ellipse, EllipseUpdater, EventService, EventTarget, FederatedEvent, FederatedMouseEvent, FederatedPointerEvent, FederatedWheelEvent, Frustum, GradientType, Group, GroupUpdater, HTML, Image, Line, LineUpdater, Mask, MutationEvent, Node, OffscreenCanvasCreator, Path, PathUpdater, Plane, Point, Polygon, Polyline, PolylineUpdater, PropertySyntax, RBush, Rect, RectUpdater, Rectangle, RenderReason, RenderingService, Shape, SortReason, Strategy, Text, TextService, TextUpdater, UnitType, computeLinearGradient, computeRadialGradient, convertToPath, createVec3, decompose, definedProps, deg2rad, deg2turn, findClosestClipPathTarget, fromRotationTranslationScale, getAngle, getEuler, getOrCalculatePathTotalLength, grad2deg, isBrowser, isCSSGradientValue, isCSSRGB, isCanvas, isDisplayObject, isFederatedEvent, isFillOrStrokeAffected, isPattern, mergeColors, parseColor, parseLength, parsePath, parseTransform, parsedTransformToMat4, propertyMetadataCache, rad2deg, resetEntityCounter, runtime, setDOMSize, translatePathToString, turn2deg };
|
|
15279
15326
|
//# sourceMappingURL=index.esm.js.map
|