@antv/g 5.0.22-alpha.0 → 5.0.22-alpha.3
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/es/AbstractRenderer.js +1 -3
- package/es/Canvas.js +1 -3
- package/es/DisplayObjectPool.js +1 -3
- package/es/camera/Camera.js +1 -3
- package/es/camera/Landmark.js +1 -3
- package/es/components/Cullable.js +1 -3
- package/es/components/Geometry.js +1 -3
- package/es/components/Renderable.js +1 -3
- package/es/components/Sortable.js +1 -3
- package/es/components/Transform.js +1 -3
- package/es/css/CSSProperty.d.ts +1 -1
- package/es/css/LayoutRegistry.js +1 -3
- package/es/css/StyleValueRegistry.js +2 -4
- package/es/css/cssom/CSSColorValue.js +1 -3
- package/es/css/cssom/CSSGradientValue.js +6 -8
- package/es/css/cssom/CSSKeywordValue.js +1 -3
- package/es/css/cssom/CSSMathInvert.js +1 -3
- package/es/css/cssom/CSSMathMax.js +1 -3
- package/es/css/cssom/CSSMathMin.js +1 -3
- package/es/css/cssom/CSSMathNegate.js +1 -3
- package/es/css/cssom/CSSMathProduct.js +1 -3
- package/es/css/cssom/CSSMathSum.js +1 -3
- package/es/css/cssom/CSSMathValue.js +1 -3
- package/es/css/cssom/CSSMathVariadic.js +1 -3
- package/es/css/cssom/CSSNumericValue.js +1 -3
- package/es/css/cssom/CSSNumericValueType.d.ts +1 -1
- package/es/css/cssom/CSSNumericValueType.js +1 -3
- package/es/css/cssom/CSSRGB.js +2 -4
- package/es/css/cssom/CSSStyleValue.d.ts +2 -2
- package/es/css/cssom/CSSStyleValue.js +2 -4
- package/es/css/cssom/CSSTransformComponent.js +1 -3
- package/es/css/cssom/CSSTransformValue.js +1 -3
- package/es/css/cssom/CSSTranslate.js +1 -3
- package/es/css/cssom/CSSUnitValue.js +2 -4
- package/es/css/parser/color.js +1 -1
- package/es/css/parser/dimension.js +1 -1
- package/es/css/parser/transform.d.ts +1 -1
- package/es/css/parser/transform.js +2 -2
- package/es/css/properties/CSSPropertyAnchor.js +1 -3
- package/es/css/properties/CSSPropertyClipPath.js +1 -3
- package/es/css/properties/CSSPropertyColor.js +1 -3
- package/es/css/properties/CSSPropertyFilter.js +1 -3
- package/es/css/properties/CSSPropertyLengthOrPercentage.js +1 -3
- package/es/css/properties/CSSPropertyLineDash.js +1 -3
- package/es/css/properties/CSSPropertyLocalPosition.js +1 -3
- package/es/css/properties/CSSPropertyOffsetDistance.js +1 -3
- package/es/css/properties/CSSPropertyOffsetPath.js +1 -3
- package/es/css/properties/CSSPropertyOpacity.js +1 -3
- package/es/css/properties/CSSPropertyPath.js +1 -3
- package/es/css/properties/CSSPropertyPoints.js +1 -3
- package/es/css/properties/CSSPropertyShadowBlur.js +1 -3
- package/es/css/properties/CSSPropertyText.js +2 -4
- package/es/css/properties/CSSPropertyTextTransform.js +1 -3
- package/es/css/properties/CSSPropertyTransform.js +1 -3
- package/es/css/properties/CSSPropertyTransformOrigin.js +1 -3
- package/es/css/properties/CSSPropertyVisibility.js +1 -3
- package/es/css/properties/CSSPropertyZIndex.js +1 -3
- package/es/display-objects/Circle.js +1 -3
- package/es/display-objects/CustomElement.js +1 -3
- package/es/display-objects/DisplayObject.js +3 -6
- package/es/display-objects/Ellipse.js +1 -3
- package/es/display-objects/Group.js +1 -3
- package/es/display-objects/HTML.js +3 -6
- package/es/display-objects/Image.js +1 -3
- package/es/display-objects/Line.js +1 -3
- package/es/display-objects/Path.js +1 -3
- package/es/display-objects/Polygon.js +1 -3
- package/es/display-objects/Polyline.js +1 -3
- package/es/display-objects/Rect.js +1 -3
- package/es/display-objects/Text.js +3 -6
- package/es/dom/Animation.js +2 -4
- package/es/dom/AnimationEffectTiming.js +1 -3
- package/es/dom/AnimationEvent.js +1 -3
- package/es/dom/AnimationTimeline.js +1 -3
- package/es/dom/CustomElementRegistry.js +1 -3
- package/es/dom/CustomEvent.js +1 -3
- package/es/dom/Document.js +1 -3
- package/es/dom/Element.js +4 -6
- package/es/dom/EventTarget.js +3 -5
- package/es/dom/FederatedEvent.js +1 -3
- package/es/dom/FederatedMouseEvent.js +1 -3
- package/es/dom/FederatedPointerEvent.js +1 -3
- package/es/dom/FederatedWheelEvent.js +1 -3
- package/es/dom/KeyframeEffect.js +1 -3
- package/es/dom/KeyframeList.js +1 -1
- package/es/dom/MutationEvent.js +1 -3
- package/es/dom/MutationObserver.js +3 -10
- package/es/dom/MutationRecord.js +1 -3
- package/es/dom/Node.js +2 -4
- package/es/plugins/CullingPlugin.js +1 -3
- package/es/plugins/DirtyCheckPlugin.js +1 -3
- package/es/plugins/EventPlugin.js +1 -3
- package/es/plugins/FrustumCullingStrategy.js +2 -4
- package/es/plugins/PrepareRendererPlugin.js +1 -3
- package/es/services/EventService.js +3 -5
- package/es/services/OffscreenCanvasCreator.js +1 -3
- package/es/services/RenderingService.js +1 -3
- package/es/services/SceneGraphSelector.js +1 -3
- package/es/services/SceneGraphService.js +1 -3
- package/es/services/TextService.js +3 -5
- package/es/services/aabb/CircleUpdater.js +1 -3
- package/es/services/aabb/EllipseUpdater.js +1 -3
- package/es/services/aabb/LineUpdater.js +1 -3
- package/es/services/aabb/PathUpdater.js +1 -3
- package/es/services/aabb/PolylineUpdater.js +1 -3
- package/es/services/aabb/RectUpdater.js +1 -3
- package/es/services/aabb/TextUpdater.js +1 -3
- package/es/shapes/AABB.js +1 -3
- package/es/shapes/BoundingSphere.js +1 -3
- package/es/shapes/Frustum.js +1 -3
- package/es/shapes/Plane.js +1 -3
- package/es/shapes/Point.js +1 -3
- package/es/shapes/Ray.js +1 -3
- package/es/shapes/Rectangle.js +1 -3
- package/es/types.d.ts +1 -2
- package/es/utils/custom-easing.js +1 -1
- package/es/utils/path.d.ts +1 -1
- package/es/utils/path.js +3 -3
- package/es/utils/text.js +3 -3
- package/lib/AbstractRenderer.js +1 -3
- package/lib/Canvas.js +2 -4
- package/lib/DisplayObjectPool.js +1 -3
- package/lib/camera/Camera.js +2 -4
- package/lib/camera/Landmark.js +1 -3
- package/lib/components/Cullable.js +2 -4
- package/lib/components/Geometry.js +1 -3
- package/lib/components/Renderable.js +1 -3
- package/lib/components/Sortable.js +1 -3
- package/lib/components/Transform.js +1 -3
- package/lib/css/CSSProperty.d.ts +1 -1
- package/lib/css/LayoutRegistry.js +1 -3
- package/lib/css/StyleValueRegistry.js +4 -4
- package/lib/css/cssom/CSSColorValue.js +1 -3
- package/lib/css/cssom/CSSGradientValue.js +7 -9
- package/lib/css/cssom/CSSKeywordValue.js +1 -3
- package/lib/css/cssom/CSSMathInvert.js +1 -3
- package/lib/css/cssom/CSSMathMax.js +1 -3
- package/lib/css/cssom/CSSMathMin.js +1 -3
- package/lib/css/cssom/CSSMathNegate.js +1 -3
- package/lib/css/cssom/CSSMathOperator.js +1 -1
- package/lib/css/cssom/CSSMathProduct.js +1 -3
- package/lib/css/cssom/CSSMathSum.js +1 -3
- package/lib/css/cssom/CSSMathValue.js +1 -3
- package/lib/css/cssom/CSSMathVariadic.js +2 -4
- package/lib/css/cssom/CSSNumericValue.js +1 -3
- package/lib/css/cssom/CSSNumericValueType.d.ts +1 -1
- package/lib/css/cssom/CSSNumericValueType.js +3 -5
- package/lib/css/cssom/CSSRGB.js +2 -4
- package/lib/css/cssom/CSSStyleValue.d.ts +2 -2
- package/lib/css/cssom/CSSStyleValue.js +108 -110
- package/lib/css/cssom/CSSTransformComponent.js +2 -4
- package/lib/css/cssom/CSSTransformValue.js +1 -3
- package/lib/css/cssom/CSSTranslate.js +1 -3
- package/lib/css/cssom/CSSUnitValue.js +2 -4
- package/lib/css/cssom/types.js +1 -1
- package/lib/css/parser/color.js +3 -3
- package/lib/css/parser/dimension.js +6 -7
- package/lib/css/parser/numeric.js +3 -3
- package/lib/css/parser/path.js +1 -1
- package/lib/css/parser/transform.d.ts +1 -1
- package/lib/css/parser/transform.js +11 -11
- package/lib/css/properties/CSSPropertyAnchor.js +1 -3
- package/lib/css/properties/CSSPropertyClipPath.js +1 -3
- package/lib/css/properties/CSSPropertyColor.js +1 -3
- package/lib/css/properties/CSSPropertyFilter.js +1 -3
- package/lib/css/properties/CSSPropertyLengthOrPercentage.js +1 -3
- package/lib/css/properties/CSSPropertyLineDash.js +1 -3
- package/lib/css/properties/CSSPropertyLocalPosition.js +1 -3
- package/lib/css/properties/CSSPropertyOffsetDistance.js +1 -3
- package/lib/css/properties/CSSPropertyOffsetPath.js +1 -3
- package/lib/css/properties/CSSPropertyOpacity.js +1 -3
- package/lib/css/properties/CSSPropertyPath.js +1 -3
- package/lib/css/properties/CSSPropertyPoints.js +1 -3
- package/lib/css/properties/CSSPropertyShadowBlur.js +1 -3
- package/lib/css/properties/CSSPropertyText.js +2 -4
- package/lib/css/properties/CSSPropertyTextTransform.js +1 -3
- package/lib/css/properties/CSSPropertyTransform.js +1 -3
- package/lib/css/properties/CSSPropertyTransformOrigin.js +1 -3
- package/lib/css/properties/CSSPropertyVisibility.js +1 -3
- package/lib/css/properties/CSSPropertyZIndex.js +1 -3
- package/lib/display-objects/Circle.js +1 -3
- package/lib/display-objects/CustomElement.js +1 -3
- package/lib/display-objects/DisplayObject.js +3 -6
- package/lib/display-objects/Ellipse.js +1 -3
- package/lib/display-objects/Group.js +1 -3
- package/lib/display-objects/HTML.js +4 -6
- package/lib/display-objects/Image.js +1 -3
- package/lib/display-objects/Line.js +1 -3
- package/lib/display-objects/Path.js +1 -3
- package/lib/display-objects/Polygon.js +1 -3
- package/lib/display-objects/Polyline.js +1 -3
- package/lib/display-objects/Rect.js +1 -3
- package/lib/display-objects/Text.js +4 -6
- package/lib/dom/Animation.js +2 -4
- package/lib/dom/AnimationEffectTiming.js +1 -3
- package/lib/dom/AnimationEvent.js +1 -3
- package/lib/dom/AnimationTimeline.js +2 -4
- package/lib/dom/CustomElementRegistry.js +1 -3
- package/lib/dom/CustomEvent.js +1 -3
- package/lib/dom/Document.js +1 -3
- package/lib/dom/Element.js +4 -6
- package/lib/dom/EventTarget.js +3 -5
- package/lib/dom/FederatedEvent.js +1 -3
- package/lib/dom/FederatedMouseEvent.js +1 -3
- package/lib/dom/FederatedPointerEvent.js +1 -3
- package/lib/dom/FederatedWheelEvent.js +1 -3
- package/lib/dom/KeyframeEffect.js +2 -4
- package/lib/dom/KeyframeList.js +1 -1
- package/lib/dom/MutationEvent.js +1 -3
- package/lib/dom/MutationObserver.js +4 -11
- package/lib/dom/MutationRecord.js +1 -3
- package/lib/dom/Node.js +2 -4
- package/lib/index.js +1 -1
- package/lib/plugins/CullingPlugin.js +2 -4
- package/lib/plugins/DirtyCheckPlugin.js +1 -3
- package/lib/plugins/EventPlugin.js +1 -3
- package/lib/plugins/FrustumCullingStrategy.js +3 -5
- package/lib/plugins/PrepareRendererPlugin.js +1 -3
- package/lib/services/EventService.js +3 -5
- package/lib/services/OffscreenCanvasCreator.js +1 -3
- package/lib/services/RenderingService.js +1 -3
- package/lib/services/SceneGraphSelector.js +2 -4
- package/lib/services/SceneGraphService.js +3 -5
- package/lib/services/TextService.js +3 -5
- package/lib/services/aabb/CircleUpdater.js +1 -3
- package/lib/services/aabb/EllipseUpdater.js +1 -3
- package/lib/services/aabb/LineUpdater.js +1 -3
- package/lib/services/aabb/PathUpdater.js +1 -3
- package/lib/services/aabb/PolylineUpdater.js +1 -3
- package/lib/services/aabb/RectUpdater.js +1 -3
- package/lib/services/aabb/TextUpdater.js +1 -3
- package/lib/services/aabb/index.js +10 -10
- package/lib/services/aabb/interfaces.js +1 -1
- package/lib/shapes/AABB.js +1 -3
- package/lib/shapes/BoundingSphere.js +1 -3
- package/lib/shapes/Frustum.js +2 -4
- package/lib/shapes/Plane.js +1 -3
- package/lib/shapes/Point.js +1 -3
- package/lib/shapes/Ray.js +1 -3
- package/lib/shapes/Rectangle.js +1 -3
- package/lib/types.d.ts +1 -2
- package/lib/types.js +1 -1
- package/lib/utils/animation.js +2 -3
- package/lib/utils/bezier-easing.js +1 -1
- package/lib/utils/custom-easing.js +2 -2
- package/lib/utils/math.js +9 -9
- package/lib/utils/path.d.ts +1 -1
- package/lib/utils/path.js +6 -6
- package/lib/utils/text.js +3 -3
- package/package.json +3 -3
- package/dist/index.umd.min.js +0 -30
|
@@ -19,9 +19,7 @@ var _ = require(".");
|
|
|
19
19
|
*/
|
|
20
20
|
// Represents the minimum of one or more CSSNumericValues.
|
|
21
21
|
// @see https://drafts.css-houdini.org/css-typed-om/#cssmathsum
|
|
22
|
-
var CSSMathMin =
|
|
23
|
-
/** @class */
|
|
24
|
-
function (_super) {
|
|
22
|
+
var CSSMathMin = function (_super) {
|
|
25
23
|
(0, _tslib.__extends)(CSSMathMin, _super);
|
|
26
24
|
|
|
27
25
|
function CSSMathMin() {
|
|
@@ -11,9 +11,7 @@ var _CSSMathValue = require("./CSSMathValue");
|
|
|
11
11
|
|
|
12
12
|
var _ = require(".");
|
|
13
13
|
|
|
14
|
-
var CSSMathNegate =
|
|
15
|
-
/** @class */
|
|
16
|
-
function (_super) {
|
|
14
|
+
var CSSMathNegate = function (_super) {
|
|
17
15
|
(0, _tslib.__extends)(CSSMathNegate, _super);
|
|
18
16
|
|
|
19
17
|
function CSSMathNegate(value, type) {
|
|
@@ -17,9 +17,7 @@ var _ = require(".");
|
|
|
17
17
|
* Represents the product of one or more CSSNumericValues.
|
|
18
18
|
* @see https://drafts.css-houdini.org/css-typed-om/#cssmathproduct
|
|
19
19
|
*/
|
|
20
|
-
var CSSMathProduct =
|
|
21
|
-
/** @class */
|
|
22
|
-
function (_super) {
|
|
20
|
+
var CSSMathProduct = function (_super) {
|
|
23
21
|
(0, _tslib.__extends)(CSSMathProduct, _super);
|
|
24
22
|
|
|
25
23
|
function CSSMathProduct() {
|
|
@@ -17,9 +17,7 @@ var _ = require(".");
|
|
|
17
17
|
* Represents the sum of one or more CSSNumericValues.
|
|
18
18
|
* @see https://drafts.css-houdini.org/css-typed-om/#cssmathsum
|
|
19
19
|
*/
|
|
20
|
-
var CSSMathSum =
|
|
21
|
-
/** @class */
|
|
22
|
-
function (_super) {
|
|
20
|
+
var CSSMathSum = function (_super) {
|
|
23
21
|
(0, _tslib.__extends)(CSSMathSum, _super);
|
|
24
22
|
|
|
25
23
|
function CSSMathSum() {
|
|
@@ -15,9 +15,7 @@ var _CSSNumericValue = require("./CSSNumericValue");
|
|
|
15
15
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSSMathValue
|
|
16
16
|
* @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_math_value.idl
|
|
17
17
|
*/
|
|
18
|
-
var CSSMathValue =
|
|
19
|
-
/** @class */
|
|
20
|
-
function (_super) {
|
|
18
|
+
var CSSMathValue = function (_super) {
|
|
21
19
|
(0, _tslib.__extends)(CSSMathValue, _super);
|
|
22
20
|
|
|
23
21
|
function CSSMathValue() {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.CSSMathVariadic = void 0;
|
|
7
6
|
exports.typeCheck = typeCheck;
|
|
7
|
+
exports.CSSMathVariadic = void 0;
|
|
8
8
|
|
|
9
9
|
var _tslib = require("tslib");
|
|
10
10
|
|
|
@@ -23,9 +23,7 @@ function typeCheck(values, op, error) {
|
|
|
23
23
|
} // Represents an arithmetic operation with one or more CSSNumericValues.
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var CSSMathVariadic =
|
|
27
|
-
/** @class */
|
|
28
|
-
function (_super) {
|
|
26
|
+
var CSSMathVariadic = function (_super) {
|
|
29
27
|
(0, _tslib.__extends)(CSSMathVariadic, _super);
|
|
30
28
|
|
|
31
29
|
function CSSMathVariadic(values, type) {
|
|
@@ -19,9 +19,7 @@ var _ = require(".");
|
|
|
19
19
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericValue
|
|
20
20
|
* @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_numeric_value.idl
|
|
21
21
|
*/
|
|
22
|
-
var CSSNumericValue =
|
|
23
|
-
/** @class */
|
|
24
|
-
function (_super) {
|
|
22
|
+
var CSSNumericValue = function (_super) {
|
|
25
23
|
(0, _tslib.__extends)(CSSNumericValue, _super);
|
|
26
24
|
|
|
27
25
|
function CSSNumericValue(type_) {
|
|
@@ -10,7 +10,7 @@ export declare enum BaseType {
|
|
|
10
10
|
kNumBaseTypes = 7
|
|
11
11
|
}
|
|
12
12
|
export declare function unitTypeToBaseType(unit: UnitType): BaseType.kLength | BaseType.kAngle | BaseType.kTime | BaseType.kFrequency | BaseType.kResolution | BaseType.kFlex | BaseType.kPercent;
|
|
13
|
-
export declare function baseTypeToString(baseType: BaseType): "" | "
|
|
13
|
+
export declare function baseTypeToString(baseType: BaseType): "" | "time" | "flex" | "percent" | "length" | "angle" | "frequency" | "resolution";
|
|
14
14
|
export declare class CSSNumericValueType {
|
|
15
15
|
private exponents;
|
|
16
16
|
private numNonZeroEntries;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.CSSNumericValueType = exports.BaseType = void 0;
|
|
7
|
-
exports.baseTypeToString = baseTypeToString;
|
|
8
6
|
exports.unitTypeToBaseType = unitTypeToBaseType;
|
|
7
|
+
exports.baseTypeToString = baseTypeToString;
|
|
8
|
+
exports.CSSNumericValueType = exports.BaseType = void 0;
|
|
9
9
|
|
|
10
10
|
var _utils = require("../../utils");
|
|
11
11
|
|
|
@@ -134,9 +134,7 @@ function baseTypeToString(baseType) {
|
|
|
134
134
|
return '';
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
var CSSNumericValueType =
|
|
138
|
-
/** @class */
|
|
139
|
-
function () {
|
|
137
|
+
var CSSNumericValueType = function () {
|
|
140
138
|
function CSSNumericValueType(unit, exponent) {
|
|
141
139
|
if (unit === void 0) {
|
|
142
140
|
unit = _.UnitType.kNumber;
|
package/lib/css/cssom/CSSRGB.js
CHANGED
|
@@ -14,9 +14,7 @@ var _CSSColorValue = require("./CSSColorValue");
|
|
|
14
14
|
*
|
|
15
15
|
* @see https://drafts.css-houdini.org/css-typed-om-1/#cssrgb
|
|
16
16
|
*/
|
|
17
|
-
var CSSRGB =
|
|
18
|
-
/** @class */
|
|
19
|
-
function (_super) {
|
|
17
|
+
var CSSRGB = function (_super) {
|
|
20
18
|
(0, _tslib.__extends)(CSSRGB, _super);
|
|
21
19
|
|
|
22
20
|
function CSSRGB(r, g, b, alpha,
|
|
@@ -47,7 +45,7 @@ function (_super) {
|
|
|
47
45
|
};
|
|
48
46
|
|
|
49
47
|
CSSRGB.prototype.buildCSSText = function (n, p, result) {
|
|
50
|
-
return result + "rgba("
|
|
48
|
+
return result + ("rgba(" + this.r + "," + this.g + "," + this.b + "," + this.alpha + ")");
|
|
51
49
|
};
|
|
52
50
|
|
|
53
51
|
return CSSRGB;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Nested, ParenLess, UnitType, UnitCategory } from '
|
|
1
|
+
import { Nested, ParenLess, UnitType, UnitCategory } from './types';
|
|
2
2
|
export declare enum CSSStyleValueType {
|
|
3
3
|
kUnknownType = 0,
|
|
4
4
|
kUnparsedType = 1,
|
|
@@ -29,7 +29,7 @@ export declare abstract class CSSStyleValue {
|
|
|
29
29
|
static parseAll(propertyName: string, value: string): CSSStyleValue[];
|
|
30
30
|
static unitFromName(name: string): UnitType;
|
|
31
31
|
static unitTypeToUnitCategory(type: UnitType): UnitCategory;
|
|
32
|
-
static unitTypeToString(type: UnitType): "" | "em" | "px" | "deg" | "rad" | "grad" | "ms" | "
|
|
32
|
+
static unitTypeToString(type: UnitType): "" | "em" | "s" | "px" | "deg" | "rad" | "grad" | "ms" | "rem" | "turn" | "%";
|
|
33
33
|
static stringToUnitType(name: string): UnitType;
|
|
34
34
|
static canonicalUnitTypeForCategory(category: UnitCategory): UnitType.kUnknown | UnitType.kNumber | UnitType.kPixels | UnitType.kDegrees | UnitType.kSeconds | UnitType.kHertz | UnitType.kDotsPerPixel;
|
|
35
35
|
/**
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.CSSStyleValue = exports.CSSStyleValueType = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _types = require("./types");
|
|
9
9
|
|
|
10
10
|
// import type { CSSValue } from '../CSSValue';
|
|
11
11
|
// import { CSSPropertyID, cssPropertyID } from '../properties/CSSPropertyNames';
|
|
@@ -13,14 +13,14 @@ var _ = require(".");
|
|
|
13
13
|
// This file specifies the unit strings used in CSSPrimitiveValues.
|
|
14
14
|
var data = [{
|
|
15
15
|
name: 'em',
|
|
16
|
-
unit_type:
|
|
16
|
+
unit_type: _types.UnitType.kEms
|
|
17
17
|
}, // {
|
|
18
18
|
// name: 'ex',
|
|
19
19
|
// unit_type: UnitType.kExs,
|
|
20
20
|
// },
|
|
21
21
|
{
|
|
22
22
|
name: 'px',
|
|
23
|
-
unit_type:
|
|
23
|
+
unit_type: _types.UnitType.kPixels
|
|
24
24
|
}, // {
|
|
25
25
|
// name: "cm",
|
|
26
26
|
// unit_type: UnitType.kCentimeters,
|
|
@@ -47,19 +47,19 @@ var data = [{
|
|
|
47
47
|
// },
|
|
48
48
|
{
|
|
49
49
|
name: 'deg',
|
|
50
|
-
unit_type:
|
|
50
|
+
unit_type: _types.UnitType.kDegrees
|
|
51
51
|
}, {
|
|
52
52
|
name: 'rad',
|
|
53
|
-
unit_type:
|
|
53
|
+
unit_type: _types.UnitType.kRadians
|
|
54
54
|
}, {
|
|
55
55
|
name: 'grad',
|
|
56
|
-
unit_type:
|
|
56
|
+
unit_type: _types.UnitType.kGradians
|
|
57
57
|
}, {
|
|
58
58
|
name: 'ms',
|
|
59
|
-
unit_type:
|
|
59
|
+
unit_type: _types.UnitType.kMilliseconds
|
|
60
60
|
}, {
|
|
61
61
|
name: 's',
|
|
62
|
-
unit_type:
|
|
62
|
+
unit_type: _types.UnitType.kSeconds
|
|
63
63
|
}, // {
|
|
64
64
|
// name: "hz",
|
|
65
65
|
// unit_type: UnitType.kHertz,
|
|
@@ -206,14 +206,14 @@ var data = [{
|
|
|
206
206
|
// },
|
|
207
207
|
{
|
|
208
208
|
name: 'rem',
|
|
209
|
-
unit_type:
|
|
209
|
+
unit_type: _types.UnitType.kRems
|
|
210
210
|
}, // {
|
|
211
211
|
// name: 'fr',
|
|
212
212
|
// unit_type: UnitType.kFraction,
|
|
213
213
|
// },
|
|
214
214
|
{
|
|
215
215
|
name: 'turn',
|
|
216
|
-
unit_type:
|
|
216
|
+
unit_type: _types.UnitType.kTurns
|
|
217
217
|
} // {
|
|
218
218
|
// name: 'ch',
|
|
219
219
|
// unit_type: UnitType.kChs,
|
|
@@ -265,9 +265,7 @@ function parseCSSStyleValue(propertyName, value) {
|
|
|
265
265
|
*/
|
|
266
266
|
|
|
267
267
|
|
|
268
|
-
var CSSStyleValue =
|
|
269
|
-
/** @class */
|
|
270
|
-
function () {
|
|
268
|
+
var CSSStyleValue = function () {
|
|
271
269
|
function CSSStyleValue() {}
|
|
272
270
|
|
|
273
271
|
CSSStyleValue.parse = function (propertyName, value) {
|
|
@@ -280,15 +278,15 @@ function () {
|
|
|
280
278
|
|
|
281
279
|
CSSStyleValue.unitFromName = function (name) {
|
|
282
280
|
if (!name) {
|
|
283
|
-
return
|
|
281
|
+
return _types.UnitType.kUnknown;
|
|
284
282
|
}
|
|
285
283
|
|
|
286
284
|
if (name === 'number') {
|
|
287
|
-
return
|
|
285
|
+
return _types.UnitType.kNumber;
|
|
288
286
|
}
|
|
289
287
|
|
|
290
288
|
if (name === 'percent' || name === '%') {
|
|
291
|
-
return
|
|
289
|
+
return _types.UnitType.kPercentage;
|
|
292
290
|
}
|
|
293
291
|
|
|
294
292
|
return this.stringToUnitType(name);
|
|
@@ -296,69 +294,69 @@ function () {
|
|
|
296
294
|
|
|
297
295
|
CSSStyleValue.unitTypeToUnitCategory = function (type) {
|
|
298
296
|
switch (type) {
|
|
299
|
-
case
|
|
300
|
-
case
|
|
301
|
-
return
|
|
302
|
-
|
|
303
|
-
case
|
|
304
|
-
return
|
|
305
|
-
|
|
306
|
-
case
|
|
307
|
-
case
|
|
308
|
-
case
|
|
309
|
-
case
|
|
310
|
-
case
|
|
311
|
-
case
|
|
312
|
-
case
|
|
313
|
-
case
|
|
314
|
-
return
|
|
315
|
-
|
|
316
|
-
case
|
|
317
|
-
case
|
|
318
|
-
return
|
|
319
|
-
|
|
320
|
-
case
|
|
321
|
-
case
|
|
322
|
-
case
|
|
323
|
-
case
|
|
324
|
-
return
|
|
325
|
-
|
|
326
|
-
case
|
|
327
|
-
case
|
|
328
|
-
return
|
|
329
|
-
|
|
330
|
-
case
|
|
331
|
-
case
|
|
332
|
-
case
|
|
333
|
-
return
|
|
297
|
+
case _types.UnitType.kNumber:
|
|
298
|
+
case _types.UnitType.kInteger:
|
|
299
|
+
return _types.UnitCategory.kUNumber;
|
|
300
|
+
|
|
301
|
+
case _types.UnitType.kPercentage:
|
|
302
|
+
return _types.UnitCategory.kUPercent;
|
|
303
|
+
|
|
304
|
+
case _types.UnitType.kPixels:
|
|
305
|
+
case _types.UnitType.kCentimeters:
|
|
306
|
+
case _types.UnitType.kMillimeters:
|
|
307
|
+
case _types.UnitType.kQuarterMillimeters:
|
|
308
|
+
case _types.UnitType.kInches:
|
|
309
|
+
case _types.UnitType.kPoints:
|
|
310
|
+
case _types.UnitType.kPicas:
|
|
311
|
+
case _types.UnitType.kUserUnits:
|
|
312
|
+
return _types.UnitCategory.kULength;
|
|
313
|
+
|
|
314
|
+
case _types.UnitType.kMilliseconds:
|
|
315
|
+
case _types.UnitType.kSeconds:
|
|
316
|
+
return _types.UnitCategory.kUTime;
|
|
317
|
+
|
|
318
|
+
case _types.UnitType.kDegrees:
|
|
319
|
+
case _types.UnitType.kRadians:
|
|
320
|
+
case _types.UnitType.kGradians:
|
|
321
|
+
case _types.UnitType.kTurns:
|
|
322
|
+
return _types.UnitCategory.kUAngle;
|
|
323
|
+
|
|
324
|
+
case _types.UnitType.kHertz:
|
|
325
|
+
case _types.UnitType.kKilohertz:
|
|
326
|
+
return _types.UnitCategory.kUFrequency;
|
|
327
|
+
|
|
328
|
+
case _types.UnitType.kDotsPerPixel:
|
|
329
|
+
case _types.UnitType.kDotsPerInch:
|
|
330
|
+
case _types.UnitType.kDotsPerCentimeter:
|
|
331
|
+
return _types.UnitCategory.kUResolution;
|
|
334
332
|
|
|
335
333
|
default:
|
|
336
|
-
return
|
|
334
|
+
return _types.UnitCategory.kUOther;
|
|
337
335
|
}
|
|
338
336
|
};
|
|
339
337
|
|
|
340
338
|
CSSStyleValue.unitTypeToString = function (type) {
|
|
341
339
|
switch (type) {
|
|
342
|
-
case
|
|
343
|
-
case
|
|
344
|
-
case
|
|
340
|
+
case _types.UnitType.kNumber:
|
|
341
|
+
case _types.UnitType.kInteger:
|
|
342
|
+
case _types.UnitType.kUserUnits:
|
|
345
343
|
return '';
|
|
346
344
|
|
|
347
|
-
case
|
|
345
|
+
case _types.UnitType.kPercentage:
|
|
348
346
|
return '%';
|
|
349
347
|
|
|
350
|
-
case
|
|
351
|
-
case
|
|
348
|
+
case _types.UnitType.kEms:
|
|
349
|
+
case _types.UnitType.kQuirkyEms:
|
|
352
350
|
return 'em';
|
|
353
351
|
// case UnitType.kExs:
|
|
354
352
|
// return 'ex';
|
|
355
353
|
|
|
356
|
-
case
|
|
354
|
+
case _types.UnitType.kRems:
|
|
357
355
|
return 'rem';
|
|
358
356
|
// case UnitType.kChs:
|
|
359
357
|
// return 'ch';
|
|
360
358
|
|
|
361
|
-
case
|
|
359
|
+
case _types.UnitType.kPixels:
|
|
362
360
|
return 'px';
|
|
363
361
|
// case UnitType.kCentimeters:
|
|
364
362
|
// return 'cm';
|
|
@@ -379,26 +377,26 @@ function () {
|
|
|
379
377
|
// case UnitType.kPicas:
|
|
380
378
|
// return 'pc';
|
|
381
379
|
|
|
382
|
-
case
|
|
380
|
+
case _types.UnitType.kDegrees:
|
|
383
381
|
return 'deg';
|
|
384
382
|
|
|
385
|
-
case
|
|
383
|
+
case _types.UnitType.kRadians:
|
|
386
384
|
return 'rad';
|
|
387
385
|
|
|
388
|
-
case
|
|
386
|
+
case _types.UnitType.kGradians:
|
|
389
387
|
return 'grad';
|
|
390
388
|
|
|
391
|
-
case
|
|
389
|
+
case _types.UnitType.kMilliseconds:
|
|
392
390
|
return 'ms';
|
|
393
391
|
|
|
394
|
-
case
|
|
392
|
+
case _types.UnitType.kSeconds:
|
|
395
393
|
return 's';
|
|
396
394
|
// case UnitType.kHertz:
|
|
397
395
|
// return 'hz';
|
|
398
396
|
// case UnitType.kKilohertz:
|
|
399
397
|
// return 'khz';
|
|
400
398
|
|
|
401
|
-
case
|
|
399
|
+
case _types.UnitType.kTurns:
|
|
402
400
|
return 'turn';
|
|
403
401
|
// case UnitType.kFraction:
|
|
404
402
|
// return 'fr';
|
|
@@ -481,30 +479,30 @@ function () {
|
|
|
481
479
|
// CSSPropertyParser.ValidUnit() chooses the default unit in each category
|
|
482
480
|
// (based on unitflags).
|
|
483
481
|
switch (category) {
|
|
484
|
-
case
|
|
485
|
-
return
|
|
482
|
+
case _types.UnitCategory.kUNumber:
|
|
483
|
+
return _types.UnitType.kNumber;
|
|
486
484
|
|
|
487
|
-
case
|
|
488
|
-
return
|
|
485
|
+
case _types.UnitCategory.kULength:
|
|
486
|
+
return _types.UnitType.kPixels;
|
|
489
487
|
|
|
490
|
-
case
|
|
491
|
-
return
|
|
488
|
+
case _types.UnitCategory.kUPercent:
|
|
489
|
+
return _types.UnitType.kUnknown;
|
|
492
490
|
// Cannot convert between numbers and percent.
|
|
493
491
|
|
|
494
|
-
case
|
|
495
|
-
return
|
|
492
|
+
case _types.UnitCategory.kUTime:
|
|
493
|
+
return _types.UnitType.kSeconds;
|
|
496
494
|
|
|
497
|
-
case
|
|
498
|
-
return
|
|
495
|
+
case _types.UnitCategory.kUAngle:
|
|
496
|
+
return _types.UnitType.kDegrees;
|
|
499
497
|
|
|
500
|
-
case
|
|
501
|
-
return
|
|
498
|
+
case _types.UnitCategory.kUFrequency:
|
|
499
|
+
return _types.UnitType.kHertz;
|
|
502
500
|
|
|
503
|
-
case
|
|
504
|
-
return
|
|
501
|
+
case _types.UnitCategory.kUResolution:
|
|
502
|
+
return _types.UnitType.kDotsPerPixel;
|
|
505
503
|
|
|
506
504
|
default:
|
|
507
|
-
return
|
|
505
|
+
return _types.UnitType.kUnknown;
|
|
508
506
|
}
|
|
509
507
|
};
|
|
510
508
|
/**
|
|
@@ -517,62 +515,62 @@ function () {
|
|
|
517
515
|
|
|
518
516
|
switch (unit_type) {
|
|
519
517
|
// These are "canonical" units in their respective categories.
|
|
520
|
-
case
|
|
521
|
-
case
|
|
522
|
-
case
|
|
523
|
-
case
|
|
524
|
-
case
|
|
518
|
+
case _types.UnitType.kPixels:
|
|
519
|
+
case _types.UnitType.kUserUnits:
|
|
520
|
+
case _types.UnitType.kDegrees:
|
|
521
|
+
case _types.UnitType.kSeconds:
|
|
522
|
+
case _types.UnitType.kHertz:
|
|
525
523
|
break;
|
|
526
524
|
|
|
527
|
-
case
|
|
525
|
+
case _types.UnitType.kMilliseconds:
|
|
528
526
|
factor = 0.001;
|
|
529
527
|
break;
|
|
530
528
|
|
|
531
|
-
case
|
|
529
|
+
case _types.UnitType.kCentimeters:
|
|
532
530
|
// factor = kCssPixelsPerCentimeter;
|
|
533
531
|
break;
|
|
534
532
|
|
|
535
|
-
case
|
|
533
|
+
case _types.UnitType.kDotsPerCentimeter:
|
|
536
534
|
// factor = 1 / kCssPixelsPerCentimeter;
|
|
537
535
|
break;
|
|
538
536
|
|
|
539
|
-
case
|
|
537
|
+
case _types.UnitType.kMillimeters:
|
|
540
538
|
// factor = kCssPixelsPerMillimeter;
|
|
541
539
|
break;
|
|
542
540
|
|
|
543
|
-
case
|
|
541
|
+
case _types.UnitType.kQuarterMillimeters:
|
|
544
542
|
// factor = kCssPixelsPerQuarterMillimeter;
|
|
545
543
|
break;
|
|
546
544
|
|
|
547
|
-
case
|
|
545
|
+
case _types.UnitType.kInches:
|
|
548
546
|
// factor = kCssPixelsPerInch;
|
|
549
547
|
break;
|
|
550
548
|
|
|
551
|
-
case
|
|
549
|
+
case _types.UnitType.kDotsPerInch:
|
|
552
550
|
// factor = 1 / kCssPixelsPerInch;
|
|
553
551
|
break;
|
|
554
552
|
|
|
555
|
-
case
|
|
553
|
+
case _types.UnitType.kPoints:
|
|
556
554
|
// factor = kCssPixelsPerPoint;
|
|
557
555
|
break;
|
|
558
556
|
|
|
559
|
-
case
|
|
557
|
+
case _types.UnitType.kPicas:
|
|
560
558
|
// factor = kCssPixelsPerPica;
|
|
561
559
|
break;
|
|
562
560
|
|
|
563
|
-
case
|
|
561
|
+
case _types.UnitType.kRadians:
|
|
564
562
|
factor = 180 / Math.PI;
|
|
565
563
|
break;
|
|
566
564
|
|
|
567
|
-
case
|
|
565
|
+
case _types.UnitType.kGradians:
|
|
568
566
|
factor = 0.9;
|
|
569
567
|
break;
|
|
570
568
|
|
|
571
|
-
case
|
|
569
|
+
case _types.UnitType.kTurns:
|
|
572
570
|
factor = 360;
|
|
573
571
|
break;
|
|
574
572
|
|
|
575
|
-
case
|
|
573
|
+
case _types.UnitType.kKilohertz:
|
|
576
574
|
factor = 1000;
|
|
577
575
|
break;
|
|
578
576
|
|
|
@@ -584,44 +582,44 @@ function () {
|
|
|
584
582
|
};
|
|
585
583
|
|
|
586
584
|
CSSStyleValue.isAngle = function (unit) {
|
|
587
|
-
return unit ===
|
|
585
|
+
return unit === _types.UnitType.kDegrees || unit === _types.UnitType.kRadians || unit === _types.UnitType.kGradians || unit === _types.UnitType.kTurns;
|
|
588
586
|
};
|
|
589
587
|
|
|
590
588
|
CSSStyleValue.isViewportPercentageLength = function (type) {
|
|
591
|
-
return type >=
|
|
589
|
+
return type >= _types.UnitType.kViewportWidth && type <= _types.UnitType.kDynamicViewportMax;
|
|
592
590
|
};
|
|
593
591
|
|
|
594
592
|
CSSStyleValue.isContainerPercentageLength = function (type) {
|
|
595
|
-
return type >=
|
|
593
|
+
return type >= _types.UnitType.kContainerWidth && type <= _types.UnitType.kContainerMax;
|
|
596
594
|
};
|
|
597
595
|
|
|
598
596
|
CSSStyleValue.isLength = function (type) {
|
|
599
|
-
return type >=
|
|
597
|
+
return type >= _types.UnitType.kEms && type <= _types.UnitType.kUserUnits || type == _types.UnitType.kQuirkyEms;
|
|
600
598
|
};
|
|
601
599
|
|
|
602
600
|
CSSStyleValue.isRelativeUnit = function (type) {
|
|
603
|
-
return type ===
|
|
601
|
+
return type === _types.UnitType.kPercentage || type === _types.UnitType.kEms || type === _types.UnitType.kExs || type === _types.UnitType.kRems || type === _types.UnitType.kChs || this.isViewportPercentageLength(type) || this.isContainerPercentageLength(type);
|
|
604
602
|
};
|
|
605
603
|
|
|
606
604
|
CSSStyleValue.isTime = function (unit) {
|
|
607
|
-
return unit ===
|
|
605
|
+
return unit === _types.UnitType.kSeconds || unit === _types.UnitType.kMilliseconds;
|
|
608
606
|
};
|
|
609
607
|
|
|
610
608
|
CSSStyleValue.isFrequency = function (unit) {
|
|
611
|
-
return unit ==
|
|
609
|
+
return unit == _types.UnitType.kHertz || unit == _types.UnitType.kKilohertz;
|
|
612
610
|
};
|
|
613
611
|
|
|
614
612
|
CSSStyleValue.isResolution = function (type) {
|
|
615
|
-
return type >=
|
|
613
|
+
return type >= _types.UnitType.kDotsPerPixel && type <= _types.UnitType.kDotsPerCentimeter;
|
|
616
614
|
};
|
|
617
615
|
|
|
618
616
|
CSSStyleValue.isFlex = function (unit) {
|
|
619
|
-
return unit ===
|
|
617
|
+
return unit === _types.UnitType.kFraction;
|
|
620
618
|
}; // protected abstract toCSSValue(): CSSValue;
|
|
621
619
|
|
|
622
620
|
|
|
623
621
|
CSSStyleValue.prototype.toString = function () {
|
|
624
|
-
return this.buildCSSText(
|
|
622
|
+
return this.buildCSSText(_types.Nested.kNo, _types.ParenLess.kNo, '');
|
|
625
623
|
};
|
|
626
624
|
|
|
627
625
|
CSSStyleValue.prototype.isNumericValue = function () {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.CSSTransformComponent = exports.TransformComponentType = void 0;
|
|
7
7
|
var TransformComponentType;
|
|
8
8
|
exports.TransformComponentType = TransformComponentType;
|
|
9
9
|
|
|
@@ -26,9 +26,7 @@ exports.TransformComponentType = TransformComponentType;
|
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
var CSSTransformComponent =
|
|
30
|
-
/** @class */
|
|
31
|
-
function () {
|
|
29
|
+
var CSSTransformComponent = function () {
|
|
32
30
|
function CSSTransformComponent(is2D) {
|
|
33
31
|
this.is2D = is2D;
|
|
34
32
|
}
|
|
@@ -14,9 +14,7 @@ var _CSSStyleValue = require("./CSSStyleValue");
|
|
|
14
14
|
*
|
|
15
15
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSSTransformValue
|
|
16
16
|
*/
|
|
17
|
-
var CSSTransformValue =
|
|
18
|
-
/** @class */
|
|
19
|
-
function (_super) {
|
|
17
|
+
var CSSTransformValue = function (_super) {
|
|
20
18
|
(0, _tslib.__extends)(CSSTransformValue, _super);
|
|
21
19
|
|
|
22
20
|
function CSSTransformValue(transforms) {
|
|
@@ -17,9 +17,7 @@ var _CSSTransformComponent = require("./CSSTransformComponent");
|
|
|
17
17
|
*
|
|
18
18
|
* @see https://drafts.css-houdini.org/css-typed-om/#csstranslate
|
|
19
19
|
*/
|
|
20
|
-
var CSSTranslate =
|
|
21
|
-
/** @class */
|
|
22
|
-
function (_super) {
|
|
20
|
+
var CSSTranslate = function (_super) {
|
|
23
21
|
(0, _tslib.__extends)(CSSTranslate, _super);
|
|
24
22
|
|
|
25
23
|
function CSSTranslate(x, y, z, is2D) {
|
|
@@ -31,9 +31,7 @@ var _CSSStyleValue = require("./CSSStyleValue");
|
|
|
31
31
|
* unit (or a naked number or percentage).
|
|
32
32
|
* @see https://drafts.css-houdini.org/css-typed-om/#cssunitvalue
|
|
33
33
|
*/
|
|
34
|
-
var CSSUnitValue =
|
|
35
|
-
/** @class */
|
|
36
|
-
function (_super) {
|
|
34
|
+
var CSSUnitValue = function (_super) {
|
|
37
35
|
(0, _tslib.__extends)(CSSUnitValue, _super);
|
|
38
36
|
|
|
39
37
|
function CSSUnitValue(value, unitOrName) {
|
|
@@ -252,7 +250,7 @@ function (_super) {
|
|
|
252
250
|
text = CSSUnitValue.formatNumber(value, unit_1);
|
|
253
251
|
}
|
|
254
252
|
} else {
|
|
255
|
-
text = ""
|
|
253
|
+
text = "" + value + unit;
|
|
256
254
|
}
|
|
257
255
|
}
|
|
258
256
|
}
|