@antv/g 5.0.19 → 5.0.22-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.umd.min.js +16 -17
- package/es/Canvas.d.ts +39 -6
- package/es/Canvas.js +59 -23
- package/es/camera/Camera.d.ts +14 -7
- package/es/camera/Camera.js +56 -25
- package/es/camera/Landmark.d.ts +2 -0
- package/es/camera/Landmark.js +9 -3
- package/es/css/CSS.d.ts +84 -0
- package/es/css/CSS.js +113 -0
- package/es/css/CSSProperty.d.ts +40 -0
- package/es/css/CSSProperty.js +1 -0
- package/es/css/LayoutRegistry.d.ts +11 -0
- package/es/css/LayoutRegistry.js +22 -0
- package/es/css/StyleValueRegistry.d.ts +113 -0
- package/es/css/StyleValueRegistry.js +887 -0
- package/es/css/cssom/CSSColorValue.d.ts +23 -0
- package/es/css/cssom/CSSColorValue.js +43 -0
- package/es/css/cssom/CSSGradientValue.d.ts +39 -0
- package/es/css/cssom/CSSGradientValue.js +54 -0
- package/es/css/cssom/CSSImageValue.d.ts +1 -0
- package/es/css/cssom/CSSImageValue.js +0 -0
- package/es/css/cssom/CSSKeywordValue.d.ts +15 -0
- package/es/css/cssom/CSSKeywordValue.js +37 -0
- package/es/css/cssom/CSSMathInvert.d.ts +14 -0
- package/es/css/cssom/CSSMathInvert.js +84 -0
- package/es/css/cssom/CSSMathMax.d.ts +17 -0
- package/es/css/cssom/CSSMathMax.js +118 -0
- package/es/css/cssom/CSSMathMin.d.ts +17 -0
- package/es/css/cssom/CSSMathMin.js +119 -0
- package/es/css/cssom/CSSMathNegate.d.ts +14 -0
- package/es/css/cssom/CSSMathNegate.js +80 -0
- package/es/css/cssom/CSSMathOperator.d.ts +11 -0
- package/es/css/cssom/CSSMathOperator.js +32 -0
- package/es/css/cssom/CSSMathProduct.d.ts +16 -0
- package/es/css/cssom/CSSMathProduct.js +109 -0
- package/es/css/cssom/CSSMathSum.d.ts +17 -0
- package/es/css/cssom/CSSMathSum.js +117 -0
- package/es/css/cssom/CSSMathValue.d.ts +11 -0
- package/es/css/cssom/CSSMathValue.js +27 -0
- package/es/css/cssom/CSSMathVariadic.d.ts +9 -0
- package/es/css/cssom/CSSMathVariadic.js +44 -0
- package/es/css/cssom/CSSNumericSumValue.d.ts +7 -0
- package/es/css/cssom/CSSNumericSumValue.js +1 -0
- package/es/css/cssom/CSSNumericValue.d.ts +75 -0
- package/es/css/cssom/CSSNumericValue.js +500 -0
- package/es/css/cssom/CSSNumericValueType.d.ts +33 -0
- package/es/css/cssom/CSSNumericValueType.js +259 -0
- package/es/css/cssom/CSSRGB.d.ts +25 -0
- package/es/css/cssom/CSSRGB.js +48 -0
- package/es/css/cssom/CSSStyleValue.d.ts +53 -0
- package/es/css/cssom/CSSStyleValue.js +625 -0
- package/es/css/cssom/CSSTransformComponent.d.ts +22 -0
- package/es/css/cssom/CSSTransformComponent.js +32 -0
- package/es/css/cssom/CSSTransformValue.d.ts +30 -0
- package/es/css/cssom/CSSTransformValue.js +48 -0
- package/es/css/cssom/CSSTranslate.d.ts +15 -0
- package/es/css/cssom/CSSTranslate.js +44 -0
- package/es/css/cssom/CSSUnitValue.d.ts +33 -0
- package/es/css/cssom/CSSUnitValue.js +252 -0
- package/es/css/cssom/index.d.ts +29 -0
- package/es/css/cssom/index.js +29 -0
- package/es/css/cssom/types.d.ts +86 -0
- package/es/css/cssom/types.js +119 -0
- package/es/css/index.d.ts +10 -0
- package/es/css/index.js +10 -0
- package/es/css/parser/color.d.ts +6 -0
- package/es/{property-handlers → css/parser}/color.js +26 -43
- package/es/css/parser/dimension.d.ts +36 -0
- package/es/css/parser/dimension.js +146 -0
- package/es/css/parser/filter.d.ts +7 -0
- package/es/{property-handlers → css/parser}/filter.js +0 -0
- package/es/css/parser/index.d.ts +15 -0
- package/es/css/parser/index.js +15 -0
- package/es/css/parser/numeric.d.ts +19 -0
- package/es/css/parser/numeric.js +62 -0
- package/es/css/parser/path.d.ts +5 -0
- package/es/{property-handlers → css/parser}/path.js +4 -4
- package/es/{property-handlers → css/parser}/points.d.ts +1 -1
- package/es/{property-handlers → css/parser}/points.js +5 -0
- package/es/css/parser/transform-origin.d.ts +6 -0
- package/es/css/parser/transform-origin.js +45 -0
- package/es/css/parser/transform.d.ts +15 -0
- package/es/{property-handlers → css/parser}/transform.js +16 -139
- package/es/css/parser/types.d.ts +2 -0
- package/es/css/parser/types.js +1 -0
- package/es/css/properties/CSSPropertyAnchor.d.ts +6 -0
- package/es/css/properties/CSSPropertyAnchor.js +24 -0
- package/es/{property-handlers/clipPath.d.ts → css/properties/CSSPropertyClipPath.d.ts} +4 -2
- package/es/css/properties/CSSPropertyClipPath.js +50 -0
- package/es/css/properties/CSSPropertyColor.d.ts +13 -0
- package/es/css/properties/CSSPropertyColor.js +30 -0
- package/es/css/properties/CSSPropertyFilter.d.ts +5 -0
- package/es/css/properties/CSSPropertyFilter.js +16 -0
- package/es/css/properties/CSSPropertyLengthOrPercentage.d.ts +19 -0
- package/es/css/properties/CSSPropertyLengthOrPercentage.js +74 -0
- package/es/css/properties/CSSPropertyLineDash.d.ts +7 -0
- package/es/css/properties/CSSPropertyLineDash.js +25 -0
- package/es/css/properties/CSSPropertyLocalPosition.d.ts +20 -0
- package/es/css/properties/CSSPropertyLocalPosition.js +46 -0
- package/es/css/properties/CSSPropertyOffsetDistance.d.ts +7 -0
- package/es/css/properties/CSSPropertyOffsetDistance.js +33 -0
- package/es/css/properties/CSSPropertyOffsetPath.d.ts +4 -0
- package/es/css/properties/CSSPropertyOffsetPath.js +31 -0
- package/es/css/properties/CSSPropertyOpacity.d.ts +9 -0
- package/es/css/properties/CSSPropertyOpacity.js +20 -0
- package/es/css/properties/CSSPropertyPath.d.ts +14 -0
- package/es/css/properties/CSSPropertyPath.js +51 -0
- package/es/css/properties/CSSPropertyPoints.d.ts +17 -0
- package/es/css/properties/CSSPropertyPoints.js +28 -0
- package/es/css/properties/CSSPropertyShadowBlur.d.ts +4 -0
- package/es/css/properties/CSSPropertyShadowBlur.js +22 -0
- package/es/css/properties/CSSPropertyText.d.ts +6 -0
- package/es/css/properties/CSSPropertyText.js +30 -0
- package/es/css/properties/CSSPropertyTextTransform.d.ts +4 -0
- package/es/css/properties/CSSPropertyTextTransform.js +29 -0
- package/es/{property-handlers/transform.d.ts → css/properties/CSSPropertyTransform.d.ts} +7 -15
- package/es/css/properties/CSSPropertyTransform.js +157 -0
- package/es/css/properties/CSSPropertyTransformOrigin.d.ts +10 -0
- package/es/css/properties/CSSPropertyTransformOrigin.js +21 -0
- package/es/css/properties/CSSPropertyVisibility.d.ts +11 -0
- package/es/css/properties/CSSPropertyVisibility.js +24 -0
- package/es/css/properties/CSSPropertyZIndex.d.ts +6 -0
- package/es/css/properties/CSSPropertyZIndex.js +33 -0
- package/es/css/properties/index.d.ts +18 -0
- package/es/css/properties/index.js +18 -0
- package/es/display-objects/Circle.d.ts +3 -4
- package/es/display-objects/Circle.js +3 -2
- package/es/display-objects/DisplayObject.d.ts +27 -10
- package/es/display-objects/DisplayObject.js +131 -149
- package/es/display-objects/Ellipse.d.ts +5 -7
- package/es/display-objects/Ellipse.js +4 -3
- package/es/display-objects/Group.d.ts +14 -11
- package/es/display-objects/Group.js +12 -4
- package/es/display-objects/HTML.d.ts +3 -3
- package/es/display-objects/Image.d.ts +3 -5
- package/es/display-objects/Image.js +3 -3
- package/es/display-objects/Line.d.ts +7 -6
- package/es/display-objects/Line.js +3 -5
- package/es/display-objects/Path.d.ts +2 -2
- package/es/display-objects/Path.js +1 -3
- package/es/display-objects/Polyline.js +1 -3
- package/es/display-objects/Rect.d.ts +5 -7
- package/es/display-objects/Rect.js +4 -3
- package/es/display-objects/Text.d.ts +15 -19
- package/es/display-objects/Text.js +13 -14
- package/es/dom/AnimationTimeline.d.ts +3 -0
- package/es/dom/AnimationTimeline.js +5 -5
- package/es/dom/Document.d.ts +12 -0
- package/es/dom/Document.js +133 -11
- package/es/dom/Element.d.ts +6 -1
- package/es/dom/Element.js +13 -3
- package/es/dom/FederatedEvent.d.ts +1 -5
- package/es/dom/FederatedEvent.js +0 -10
- package/es/dom/MutationObserver.d.ts +0 -1
- package/es/dom/MutationObserver.js +6 -3
- package/es/dom/interfaces.d.ts +14 -2
- package/es/dom/interfaces.js +1 -0
- package/es/global-module.d.ts +0 -8
- package/es/global-module.js +25 -71
- package/es/index.d.ts +4 -5
- package/es/index.js +9 -10
- package/es/plugins/CullingPlugin.js +2 -2
- package/es/plugins/DirtyCheckPlugin.d.ts +0 -1
- package/es/plugins/DirtyCheckPlugin.js +5 -8
- package/es/plugins/EventPlugin.d.ts +1 -0
- package/es/plugins/EventPlugin.js +74 -19
- package/es/plugins/PrepareRendererPlugin.d.ts +1 -0
- package/es/plugins/PrepareRendererPlugin.js +13 -19
- package/es/services/EventService.d.ts +1 -0
- package/es/services/EventService.js +59 -21
- package/es/services/OffscreenCanvasCreator.d.ts +13 -0
- package/es/services/{text/OffscreenCanvasCreator.js → OffscreenCanvasCreator.js} +23 -12
- package/es/services/RenderingContext.d.ts +2 -1
- package/es/services/RenderingContext.js +3 -1
- package/es/services/RenderingService.d.ts +35 -2
- package/es/services/RenderingService.js +52 -11
- package/es/services/SceneGraphSelector.d.ts +3 -1
- package/es/services/SceneGraphSelector.js +43 -12
- package/es/services/SceneGraphService.d.ts +7 -1
- package/es/services/SceneGraphService.js +15 -12
- package/es/services/{text/index.d.ts → TextService.d.ts} +5 -4
- package/es/services/{text/index.js → TextService.js} +35 -39
- package/es/services/aabb/CircleUpdater.js +6 -17
- package/es/services/aabb/EllipseUpdater.js +6 -23
- package/es/services/aabb/LineUpdater.js +4 -4
- package/es/services/aabb/RectUpdater.d.ts +2 -2
- package/es/services/aabb/RectUpdater.js +21 -16
- package/es/services/aabb/TextUpdater.d.ts +3 -1
- package/es/services/aabb/TextUpdater.js +63 -25
- package/es/services/aabb/interfaces.d.ts +3 -2
- package/es/services/aabb/interfaces.js +3 -2
- package/es/services/index.d.ts +2 -2
- package/es/services/index.js +2 -2
- package/es/shapes/index.d.ts +0 -1
- package/es/shapes/index.js +1 -2
- package/es/types.d.ts +64 -28
- package/es/types.js +2 -1
- package/es/utils/animation.js +1 -1
- package/es/utils/assert.d.ts +3 -0
- package/es/utils/assert.js +15 -0
- package/es/utils/custom-easing.d.ts +0 -9
- package/es/utils/custom-easing.js +37 -53
- package/es/utils/event.d.ts +41 -9
- package/es/utils/event.js +2 -65
- package/es/utils/index.d.ts +1 -1
- package/es/utils/index.js +1 -1
- package/es/utils/interpolation.js +39 -37
- package/es/utils/math.d.ts +5 -0
- package/es/utils/math.js +54 -0
- package/es/utils/path.d.ts +1 -1
- package/es/utils/path.js +27 -29
- package/es/utils/text.js +3 -7
- package/lib/Canvas.d.ts +39 -6
- package/lib/Canvas.js +62 -27
- package/lib/camera/Camera.d.ts +14 -7
- package/lib/camera/Camera.js +59 -25
- package/lib/camera/Landmark.d.ts +2 -0
- package/lib/camera/Landmark.js +9 -3
- package/lib/css/CSS.d.ts +84 -0
- package/lib/css/CSS.js +125 -0
- package/lib/css/CSSProperty.d.ts +40 -0
- package/lib/css/CSSProperty.js +5 -0
- package/lib/css/LayoutRegistry.d.ts +11 -0
- package/lib/css/LayoutRegistry.js +30 -0
- package/lib/css/StyleValueRegistry.d.ts +113 -0
- package/lib/css/StyleValueRegistry.js +903 -0
- package/lib/css/cssom/CSSColorValue.d.ts +23 -0
- package/lib/css/cssom/CSSColorValue.js +51 -0
- package/lib/css/cssom/CSSGradientValue.d.ts +39 -0
- package/lib/css/cssom/CSSGradientValue.js +64 -0
- package/lib/css/cssom/CSSImageValue.d.ts +1 -0
- package/lib/css/cssom/CSSImageValue.js +1 -0
- package/lib/css/cssom/CSSKeywordValue.d.ts +15 -0
- package/lib/css/cssom/CSSKeywordValue.js +45 -0
- package/lib/css/cssom/CSSMathInvert.d.ts +14 -0
- package/lib/css/cssom/CSSMathInvert.js +94 -0
- package/lib/css/cssom/CSSMathMax.d.ts +17 -0
- package/lib/css/cssom/CSSMathMax.js +128 -0
- package/lib/css/cssom/CSSMathMin.d.ts +17 -0
- package/lib/css/cssom/CSSMathMin.js +128 -0
- package/lib/css/cssom/CSSMathNegate.d.ts +14 -0
- package/lib/css/cssom/CSSMathNegate.js +89 -0
- package/lib/css/cssom/CSSMathOperator.d.ts +11 -0
- package/lib/css/cssom/CSSMathOperator.js +40 -0
- package/lib/css/cssom/CSSMathProduct.d.ts +16 -0
- package/lib/css/cssom/CSSMathProduct.js +119 -0
- package/lib/css/cssom/CSSMathSum.d.ts +17 -0
- package/lib/css/cssom/CSSMathSum.js +129 -0
- package/lib/css/cssom/CSSMathValue.d.ts +11 -0
- package/lib/css/cssom/CSSMathValue.js +35 -0
- package/lib/css/cssom/CSSMathVariadic.d.ts +9 -0
- package/lib/css/cssom/CSSMathVariadic.js +55 -0
- package/lib/css/cssom/CSSNumericSumValue.d.ts +7 -0
- package/lib/css/cssom/CSSNumericSumValue.js +5 -0
- package/lib/css/cssom/CSSNumericValue.d.ts +75 -0
- package/lib/css/cssom/CSSNumericValue.js +511 -0
- package/lib/css/cssom/CSSNumericValueType.d.ts +33 -0
- package/lib/css/cssom/CSSNumericValueType.js +272 -0
- package/lib/css/cssom/CSSRGB.d.ts +25 -0
- package/lib/css/cssom/CSSRGB.js +56 -0
- package/lib/css/cssom/CSSStyleValue.d.ts +53 -0
- package/lib/css/cssom/CSSStyleValue.js +634 -0
- package/lib/css/cssom/CSSTransformComponent.d.ts +22 -0
- package/lib/css/cssom/CSSTransformComponent.js +39 -0
- package/lib/css/cssom/CSSTransformValue.d.ts +30 -0
- package/lib/css/cssom/CSSTransformValue.js +56 -0
- package/lib/css/cssom/CSSTranslate.d.ts +15 -0
- package/lib/css/cssom/CSSTranslate.js +53 -0
- package/lib/css/cssom/CSSUnitValue.d.ts +33 -0
- package/lib/css/cssom/CSSUnitValue.js +267 -0
- package/lib/css/cssom/index.d.ts +29 -0
- package/lib/css/cssom/index.js +278 -0
- package/lib/css/cssom/types.d.ts +86 -0
- package/lib/css/cssom/types.js +130 -0
- package/lib/css/index.d.ts +10 -0
- package/lib/css/index.js +96 -0
- package/lib/css/parser/color.d.ts +6 -0
- package/lib/{property-handlers → css/parser}/color.js +25 -44
- package/lib/css/parser/dimension.d.ts +36 -0
- package/lib/css/parser/dimension.js +173 -0
- package/lib/css/parser/filter.d.ts +7 -0
- package/lib/{property-handlers → css/parser}/filter.js +0 -0
- package/lib/css/parser/index.d.ts +15 -0
- package/lib/css/parser/index.js +122 -0
- package/lib/css/parser/numeric.d.ts +19 -0
- package/lib/css/parser/numeric.js +81 -0
- package/lib/css/parser/path.d.ts +5 -0
- package/lib/{property-handlers → css/parser}/path.js +4 -4
- package/lib/{property-handlers → css/parser}/points.d.ts +1 -1
- package/lib/{property-handlers → css/parser}/points.js +6 -0
- package/lib/css/parser/transform-origin.d.ts +6 -0
- package/lib/css/parser/transform-origin.js +52 -0
- package/lib/css/parser/transform.d.ts +15 -0
- package/lib/{property-handlers → css/parser}/transform.js +22 -146
- package/lib/css/parser/types.d.ts +2 -0
- package/lib/css/parser/types.js +5 -0
- package/lib/css/properties/CSSPropertyAnchor.d.ts +6 -0
- package/lib/css/properties/CSSPropertyAnchor.js +33 -0
- package/lib/{property-handlers/clipPath.d.ts → css/properties/CSSPropertyClipPath.d.ts} +4 -2
- package/lib/css/properties/CSSPropertyClipPath.js +59 -0
- package/lib/css/properties/CSSPropertyColor.d.ts +13 -0
- package/lib/css/properties/CSSPropertyColor.js +40 -0
- package/lib/css/properties/CSSPropertyFilter.d.ts +5 -0
- package/lib/css/properties/CSSPropertyFilter.js +25 -0
- package/lib/css/properties/CSSPropertyLengthOrPercentage.d.ts +19 -0
- package/lib/css/properties/CSSPropertyLengthOrPercentage.js +83 -0
- package/lib/css/properties/CSSPropertyLineDash.d.ts +7 -0
- package/lib/css/properties/CSSPropertyLineDash.js +34 -0
- package/lib/css/properties/CSSPropertyLocalPosition.d.ts +20 -0
- package/lib/css/properties/CSSPropertyLocalPosition.js +56 -0
- package/lib/css/properties/CSSPropertyOffsetDistance.d.ts +7 -0
- package/lib/css/properties/CSSPropertyOffsetDistance.js +42 -0
- package/lib/css/properties/CSSPropertyOffsetPath.d.ts +4 -0
- package/lib/css/properties/CSSPropertyOffsetPath.js +39 -0
- package/lib/css/properties/CSSPropertyOpacity.d.ts +9 -0
- package/lib/css/properties/CSSPropertyOpacity.js +29 -0
- package/lib/css/properties/CSSPropertyPath.d.ts +14 -0
- package/lib/css/properties/CSSPropertyPath.js +60 -0
- package/lib/css/properties/CSSPropertyPoints.d.ts +17 -0
- package/lib/css/properties/CSSPropertyPoints.js +37 -0
- package/lib/css/properties/CSSPropertyShadowBlur.d.ts +4 -0
- package/lib/css/properties/CSSPropertyShadowBlur.js +32 -0
- package/lib/css/properties/CSSPropertyText.d.ts +6 -0
- package/lib/css/properties/CSSPropertyText.js +39 -0
- package/lib/css/properties/CSSPropertyTextTransform.d.ts +4 -0
- package/lib/css/properties/CSSPropertyTextTransform.js +38 -0
- package/lib/{property-handlers/transform.d.ts → css/properties/CSSPropertyTransform.d.ts} +7 -15
- package/lib/css/properties/CSSPropertyTransform.js +168 -0
- package/lib/css/properties/CSSPropertyTransformOrigin.d.ts +10 -0
- package/lib/css/properties/CSSPropertyTransformOrigin.js +30 -0
- package/lib/css/properties/CSSPropertyVisibility.d.ts +11 -0
- package/lib/css/properties/CSSPropertyVisibility.js +32 -0
- package/lib/css/properties/CSSPropertyZIndex.d.ts +6 -0
- package/lib/css/properties/CSSPropertyZIndex.js +42 -0
- package/lib/css/properties/index.d.ts +18 -0
- package/lib/css/properties/index.js +239 -0
- package/lib/display-objects/Circle.d.ts +3 -4
- package/lib/display-objects/Circle.js +3 -2
- package/lib/display-objects/DisplayObject.d.ts +27 -10
- package/lib/display-objects/DisplayObject.js +132 -148
- package/lib/display-objects/Ellipse.d.ts +5 -7
- package/lib/display-objects/Ellipse.js +4 -3
- package/lib/display-objects/Group.d.ts +14 -11
- package/lib/display-objects/Group.js +12 -4
- package/lib/display-objects/HTML.d.ts +3 -3
- package/lib/display-objects/Image.d.ts +3 -5
- package/lib/display-objects/Image.js +3 -3
- package/lib/display-objects/Line.d.ts +7 -6
- package/lib/display-objects/Line.js +2 -4
- package/lib/display-objects/Path.d.ts +2 -2
- package/lib/display-objects/Path.js +0 -2
- package/lib/display-objects/Polyline.js +0 -2
- package/lib/display-objects/Rect.d.ts +5 -7
- package/lib/display-objects/Rect.js +4 -3
- package/lib/display-objects/Text.d.ts +15 -19
- package/lib/display-objects/Text.js +12 -13
- package/lib/dom/AnimationTimeline.d.ts +3 -0
- package/lib/dom/AnimationTimeline.js +5 -6
- package/lib/dom/Document.d.ts +12 -0
- package/lib/dom/Document.js +134 -10
- package/lib/dom/Element.d.ts +6 -1
- package/lib/dom/Element.js +14 -4
- package/lib/dom/FederatedEvent.d.ts +1 -5
- package/lib/dom/FederatedEvent.js +0 -10
- package/lib/dom/MutationObserver.d.ts +0 -1
- package/lib/dom/MutationObserver.js +6 -4
- package/lib/dom/interfaces.d.ts +14 -2
- package/lib/dom/interfaces.js +1 -0
- package/lib/global-module.d.ts +0 -8
- package/lib/global-module.js +42 -104
- package/lib/index.d.ts +4 -5
- package/lib/index.js +41 -54
- package/lib/plugins/CullingPlugin.js +2 -2
- package/lib/plugins/DirtyCheckPlugin.d.ts +0 -1
- package/lib/plugins/DirtyCheckPlugin.js +5 -8
- package/lib/plugins/EventPlugin.d.ts +1 -0
- package/lib/plugins/EventPlugin.js +74 -18
- package/lib/plugins/PrepareRendererPlugin.d.ts +1 -0
- package/lib/plugins/PrepareRendererPlugin.js +10 -20
- package/lib/services/EventService.d.ts +1 -0
- package/lib/services/EventService.js +60 -22
- package/lib/services/OffscreenCanvasCreator.d.ts +13 -0
- package/lib/services/{text/OffscreenCanvasCreator.js → OffscreenCanvasCreator.js} +23 -12
- package/lib/services/RenderingContext.d.ts +2 -1
- package/lib/services/RenderingContext.js +4 -1
- package/lib/services/RenderingService.d.ts +35 -2
- package/lib/services/RenderingService.js +52 -11
- package/lib/services/SceneGraphSelector.d.ts +3 -1
- package/lib/services/SceneGraphSelector.js +45 -15
- package/lib/services/SceneGraphService.d.ts +7 -1
- package/lib/services/SceneGraphService.js +15 -11
- package/lib/services/{text/index.d.ts → TextService.d.ts} +5 -4
- package/lib/services/{text/index.js → TextService.js} +36 -41
- package/lib/services/aabb/CircleUpdater.js +6 -17
- package/lib/services/aabb/EllipseUpdater.js +6 -23
- package/lib/services/aabb/LineUpdater.js +4 -4
- package/lib/services/aabb/RectUpdater.d.ts +2 -2
- package/lib/services/aabb/RectUpdater.js +22 -16
- package/lib/services/aabb/TextUpdater.d.ts +3 -1
- package/lib/services/aabb/TextUpdater.js +65 -26
- package/lib/services/aabb/interfaces.d.ts +3 -2
- package/lib/services/aabb/interfaces.js +8 -2
- package/lib/services/index.d.ts +2 -2
- package/lib/services/index.js +8 -8
- package/lib/shapes/index.d.ts +0 -1
- package/lib/shapes/index.js +0 -13
- package/lib/types.d.ts +64 -28
- package/lib/types.js +5 -1
- package/lib/utils/animation.js +1 -1
- package/lib/utils/assert.d.ts +3 -0
- package/lib/utils/assert.js +26 -0
- package/lib/utils/custom-easing.d.ts +0 -9
- package/lib/utils/custom-easing.js +41 -65
- package/lib/utils/event.d.ts +41 -9
- package/lib/utils/event.js +2 -76
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +13 -13
- package/lib/utils/interpolation.js +35 -30
- package/lib/utils/math.d.ts +5 -0
- package/lib/utils/math.js +64 -0
- package/lib/utils/path.d.ts +1 -1
- package/lib/utils/path.js +27 -29
- package/lib/utils/text.js +2 -6
- package/package.json +3 -4
- package/es/property-handlers/aabb.d.ts +0 -2
- package/es/property-handlers/aabb.js +0 -134
- package/es/property-handlers/anchor.d.ts +0 -4
- package/es/property-handlers/anchor.js +0 -21
- package/es/property-handlers/clipPath.js +0 -36
- package/es/property-handlers/color.d.ts +0 -34
- package/es/property-handlers/dimension.d.ts +0 -31
- package/es/property-handlers/dimension.js +0 -192
- package/es/property-handlers/filter.d.ts +0 -8
- package/es/property-handlers/index.d.ts +0 -21
- package/es/property-handlers/index.js +0 -21
- package/es/property-handlers/inherit.d.ts +0 -6
- package/es/property-handlers/inherit.js +0 -25
- package/es/property-handlers/interfaces.d.ts +0 -20
- package/es/property-handlers/interfaces.js +0 -6
- package/es/property-handlers/lineDash.d.ts +0 -6
- package/es/property-handlers/lineDash.js +0 -27
- package/es/property-handlers/localPosition.d.ts +0 -2
- package/es/property-handlers/localPosition.js +0 -11
- package/es/property-handlers/numeric.d.ts +0 -5
- package/es/property-handlers/numeric.js +0 -34
- package/es/property-handlers/offsetDistance.d.ts +0 -5
- package/es/property-handlers/offsetDistance.js +0 -20
- package/es/property-handlers/offsetPath.d.ts +0 -5
- package/es/property-handlers/offsetPath.js +0 -18
- package/es/property-handlers/origin.d.ts +0 -11
- package/es/property-handlers/origin.js +0 -68
- package/es/property-handlers/path.d.ts +0 -4
- package/es/property-handlers/text.d.ts +0 -2
- package/es/property-handlers/text.js +0 -3
- package/es/property-handlers/textTransform.d.ts +0 -6
- package/es/property-handlers/textTransform.js +0 -19
- package/es/property-handlers/zIndex.d.ts +0 -2
- package/es/property-handlers/zIndex.js +0 -16
- package/es/services/text/OffscreenCanvasCreator.d.ts +0 -6
- package/es/shapes/Polygon.d.ts +0 -9
- package/es/shapes/Polygon.js +0 -64
- package/es/shapes/Rect.d.ts +0 -12
- package/es/shapes/Rect.js +0 -24
- package/es/utils/raf.d.ts +0 -6
- package/es/utils/raf.js +0 -13
- package/lib/property-handlers/aabb.d.ts +0 -2
- package/lib/property-handlers/aabb.js +0 -150
- package/lib/property-handlers/anchor.d.ts +0 -4
- package/lib/property-handlers/anchor.js +0 -34
- package/lib/property-handlers/clipPath.js +0 -43
- package/lib/property-handlers/color.d.ts +0 -34
- package/lib/property-handlers/dimension.d.ts +0 -31
- package/lib/property-handlers/dimension.js +0 -217
- package/lib/property-handlers/filter.d.ts +0 -8
- package/lib/property-handlers/index.d.ts +0 -21
- package/lib/property-handlers/index.js +0 -265
- package/lib/property-handlers/inherit.d.ts +0 -6
- package/lib/property-handlers/inherit.js +0 -34
- package/lib/property-handlers/interfaces.d.ts +0 -20
- package/lib/property-handlers/interfaces.js +0 -18
- package/lib/property-handlers/lineDash.d.ts +0 -6
- package/lib/property-handlers/lineDash.js +0 -36
- package/lib/property-handlers/localPosition.d.ts +0 -2
- package/lib/property-handlers/localPosition.js +0 -18
- package/lib/property-handlers/numeric.d.ts +0 -5
- package/lib/property-handlers/numeric.js +0 -50
- package/lib/property-handlers/offsetDistance.d.ts +0 -5
- package/lib/property-handlers/offsetDistance.js +0 -27
- package/lib/property-handlers/offsetPath.d.ts +0 -5
- package/lib/property-handlers/offsetPath.js +0 -25
- package/lib/property-handlers/origin.d.ts +0 -11
- package/lib/property-handlers/origin.js +0 -79
- package/lib/property-handlers/path.d.ts +0 -4
- package/lib/property-handlers/text.d.ts +0 -2
- package/lib/property-handlers/text.js +0 -10
- package/lib/property-handlers/textTransform.d.ts +0 -6
- package/lib/property-handlers/textTransform.js +0 -27
- package/lib/property-handlers/zIndex.d.ts +0 -2
- package/lib/property-handlers/zIndex.js +0 -23
- package/lib/services/text/OffscreenCanvasCreator.d.ts +0 -6
- package/lib/shapes/Polygon.d.ts +0 -9
- package/lib/shapes/Polygon.js +0 -71
- package/lib/shapes/Rect.d.ts +0 -12
- package/lib/shapes/Rect.js +0 -31
- package/lib/utils/raf.d.ts +0 -6
- package/lib/utils/raf.js +0 -26
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { DCHECK_EQ, DCHECK_NE } from '../../utils';
|
|
2
|
+
import { UnitType } from '.'; // https://drafts.css-houdini.org/css-typed-om/#enumdef-cssnumericbasetype
|
|
3
|
+
|
|
4
|
+
export var BaseType;
|
|
5
|
+
|
|
6
|
+
(function (BaseType) {
|
|
7
|
+
BaseType[BaseType["kLength"] = 0] = "kLength";
|
|
8
|
+
BaseType[BaseType["kAngle"] = 1] = "kAngle";
|
|
9
|
+
BaseType[BaseType["kTime"] = 2] = "kTime";
|
|
10
|
+
BaseType[BaseType["kFrequency"] = 3] = "kFrequency";
|
|
11
|
+
BaseType[BaseType["kResolution"] = 4] = "kResolution";
|
|
12
|
+
BaseType[BaseType["kFlex"] = 5] = "kFlex";
|
|
13
|
+
BaseType[BaseType["kPercent"] = 6] = "kPercent";
|
|
14
|
+
BaseType[BaseType["kNumBaseTypes"] = 7] = "kNumBaseTypes";
|
|
15
|
+
})(BaseType || (BaseType = {}));
|
|
16
|
+
|
|
17
|
+
export function unitTypeToBaseType(unit) {
|
|
18
|
+
DCHECK_NE(unit, UnitType.kNumber);
|
|
19
|
+
|
|
20
|
+
switch (unit) {
|
|
21
|
+
case UnitType.kEms:
|
|
22
|
+
case UnitType.kExs:
|
|
23
|
+
case UnitType.kPixels:
|
|
24
|
+
case UnitType.kCentimeters:
|
|
25
|
+
case UnitType.kMillimeters:
|
|
26
|
+
case UnitType.kQuarterMillimeters:
|
|
27
|
+
case UnitType.kInches:
|
|
28
|
+
case UnitType.kPoints:
|
|
29
|
+
case UnitType.kPicas:
|
|
30
|
+
case UnitType.kUserUnits:
|
|
31
|
+
case UnitType.kViewportWidth:
|
|
32
|
+
case UnitType.kViewportHeight:
|
|
33
|
+
case UnitType.kViewportInlineSize:
|
|
34
|
+
case UnitType.kViewportBlockSize:
|
|
35
|
+
case UnitType.kViewportMin:
|
|
36
|
+
case UnitType.kViewportMax:
|
|
37
|
+
case UnitType.kSmallViewportWidth:
|
|
38
|
+
case UnitType.kSmallViewportHeight:
|
|
39
|
+
case UnitType.kSmallViewportInlineSize:
|
|
40
|
+
case UnitType.kSmallViewportBlockSize:
|
|
41
|
+
case UnitType.kSmallViewportMin:
|
|
42
|
+
case UnitType.kSmallViewportMax:
|
|
43
|
+
case UnitType.kLargeViewportWidth:
|
|
44
|
+
case UnitType.kLargeViewportHeight:
|
|
45
|
+
case UnitType.kLargeViewportInlineSize:
|
|
46
|
+
case UnitType.kLargeViewportBlockSize:
|
|
47
|
+
case UnitType.kLargeViewportMin:
|
|
48
|
+
case UnitType.kLargeViewportMax:
|
|
49
|
+
case UnitType.kDynamicViewportWidth:
|
|
50
|
+
case UnitType.kDynamicViewportHeight:
|
|
51
|
+
case UnitType.kDynamicViewportInlineSize:
|
|
52
|
+
case UnitType.kDynamicViewportBlockSize:
|
|
53
|
+
case UnitType.kDynamicViewportMin:
|
|
54
|
+
case UnitType.kDynamicViewportMax:
|
|
55
|
+
case UnitType.kContainerWidth:
|
|
56
|
+
case UnitType.kContainerHeight:
|
|
57
|
+
case UnitType.kContainerInlineSize:
|
|
58
|
+
case UnitType.kContainerBlockSize:
|
|
59
|
+
case UnitType.kContainerMin:
|
|
60
|
+
case UnitType.kContainerMax:
|
|
61
|
+
case UnitType.kRems:
|
|
62
|
+
case UnitType.kChs:
|
|
63
|
+
return BaseType.kLength;
|
|
64
|
+
|
|
65
|
+
case UnitType.kMilliseconds:
|
|
66
|
+
case UnitType.kSeconds:
|
|
67
|
+
return BaseType.kTime;
|
|
68
|
+
|
|
69
|
+
case UnitType.kDegrees:
|
|
70
|
+
case UnitType.kRadians:
|
|
71
|
+
case UnitType.kGradians:
|
|
72
|
+
case UnitType.kTurns:
|
|
73
|
+
return BaseType.kAngle;
|
|
74
|
+
|
|
75
|
+
case UnitType.kHertz:
|
|
76
|
+
case UnitType.kKilohertz:
|
|
77
|
+
return BaseType.kFrequency;
|
|
78
|
+
|
|
79
|
+
case UnitType.kDotsPerPixel:
|
|
80
|
+
case UnitType.kDotsPerInch:
|
|
81
|
+
case UnitType.kDotsPerCentimeter:
|
|
82
|
+
return BaseType.kResolution;
|
|
83
|
+
|
|
84
|
+
case UnitType.kFraction:
|
|
85
|
+
return BaseType.kFlex;
|
|
86
|
+
|
|
87
|
+
case UnitType.kPercentage:
|
|
88
|
+
return BaseType.kPercent;
|
|
89
|
+
|
|
90
|
+
default:
|
|
91
|
+
return BaseType.kLength;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
export function baseTypeToString(baseType) {
|
|
95
|
+
switch (baseType) {
|
|
96
|
+
case BaseType.kLength:
|
|
97
|
+
return 'length';
|
|
98
|
+
|
|
99
|
+
case BaseType.kAngle:
|
|
100
|
+
return 'angle';
|
|
101
|
+
|
|
102
|
+
case BaseType.kTime:
|
|
103
|
+
return 'time';
|
|
104
|
+
|
|
105
|
+
case BaseType.kFrequency:
|
|
106
|
+
return 'frequency';
|
|
107
|
+
|
|
108
|
+
case BaseType.kResolution:
|
|
109
|
+
return 'resolution';
|
|
110
|
+
|
|
111
|
+
case BaseType.kFlex:
|
|
112
|
+
return 'flex';
|
|
113
|
+
|
|
114
|
+
case BaseType.kPercent:
|
|
115
|
+
return 'percent';
|
|
116
|
+
|
|
117
|
+
default:
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return '';
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
var CSSNumericValueType =
|
|
125
|
+
/** @class */
|
|
126
|
+
function () {
|
|
127
|
+
function CSSNumericValueType(unit, exponent) {
|
|
128
|
+
if (unit === void 0) {
|
|
129
|
+
unit = UnitType.kNumber;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (exponent === void 0) {
|
|
133
|
+
exponent = 1;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
this.exponents = [];
|
|
137
|
+
this.numNonZeroEntries = 0;
|
|
138
|
+
this.percentHint = BaseType.kPercent;
|
|
139
|
+
this.hasPercentHint = false;
|
|
140
|
+
this.exponents = new Array(BaseType.kNumBaseTypes).fill(0);
|
|
141
|
+
|
|
142
|
+
if (unit !== UnitType.kNumber) {
|
|
143
|
+
this.setExponent(unitTypeToBaseType(unit), exponent);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
CSSNumericValueType.prototype.applyPercentHint = function (hint) {
|
|
148
|
+
DCHECK_NE(hint, BaseType.kPercent);
|
|
149
|
+
this.setExponent(hint, this.exponent(hint) + this.exponent(BaseType.kPercent));
|
|
150
|
+
this.setExponent(BaseType.kPercent, 0);
|
|
151
|
+
this.percentHint = hint;
|
|
152
|
+
this.hasPercentHint = true;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
CSSNumericValueType.prototype.hasNonZeroEntries = function () {
|
|
156
|
+
return this.numNonZeroEntries > 0;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
CSSNumericValueType.prototype.isOnlyNonZeroEntry = function (baseType, value) {
|
|
160
|
+
DCHECK_NE(value, 0);
|
|
161
|
+
return this.numNonZeroEntries === 1 && this.exponent(baseType) === value;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
CSSNumericValueType.prototype.exponent = function (type) {
|
|
165
|
+
return this.exponents[type];
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
CSSNumericValueType.prototype.setExponent = function (type, newValue) {
|
|
169
|
+
var oldValue = this.exponents[type];
|
|
170
|
+
|
|
171
|
+
if (oldValue == 0 && newValue !== 0) {
|
|
172
|
+
this.numNonZeroEntries++;
|
|
173
|
+
} else if (oldValue !== 0 && newValue == 0) {
|
|
174
|
+
this.numNonZeroEntries--;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
this.exponents[type] = newValue;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
CSSNumericValueType.negateExponents = function (type) {
|
|
181
|
+
type.exponents.forEach(function (v) {
|
|
182
|
+
return v *= -1;
|
|
183
|
+
});
|
|
184
|
+
return type;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
CSSNumericValueType.prototype.matchesBaseType = function (baseType) {
|
|
188
|
+
DCHECK_NE(baseType, BaseType.kPercent);
|
|
189
|
+
return this.isOnlyNonZeroEntry(baseType, 1) && !this.hasPercentHint;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
CSSNumericValueType.prototype.matchesPercentage = function () {
|
|
193
|
+
return this.isOnlyNonZeroEntry(BaseType.kPercent, 1);
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
CSSNumericValueType.prototype.matchesBaseTypePercentage = function (baseType) {
|
|
197
|
+
DCHECK_NE(baseType, BaseType.kPercent);
|
|
198
|
+
return this.isOnlyNonZeroEntry(baseType, 1) || this.isOnlyNonZeroEntry(BaseType.kPercent, 1);
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
CSSNumericValueType.prototype.matchesNumber = function () {
|
|
202
|
+
return !this.hasNonZeroEntries() && !this.hasPercentHint;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
CSSNumericValueType.prototype.matchesNumberPercentage = function () {
|
|
206
|
+
return !this.hasNonZeroEntries() || this.isOnlyNonZeroEntry(BaseType.kPercent, 1);
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
CSSNumericValueType.add = function (type1, type2, error) {
|
|
210
|
+
if (type1.hasPercentHint && type2.hasPercentHint && type1.percentHint != type2.percentHint) {
|
|
211
|
+
error = true;
|
|
212
|
+
return type1;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
if (type1.hasPercentHint) type2.applyPercentHint(type1.percentHint);else if (type2.hasPercentHint) type1.applyPercentHint(type2.percentHint);
|
|
216
|
+
DCHECK_EQ(type1.percentHint, type2.percentHint); // Match up base types. Try to use the percent hint to match up any
|
|
217
|
+
// differences.
|
|
218
|
+
|
|
219
|
+
for (var i = 0; i < BaseType.kNumBaseTypes; ++i) {
|
|
220
|
+
var base_type = i;
|
|
221
|
+
|
|
222
|
+
if (type1.exponents[i] !== type2.exponents[i]) {
|
|
223
|
+
if (base_type !== BaseType.kPercent) {
|
|
224
|
+
type1.applyPercentHint(base_type);
|
|
225
|
+
type2.applyPercentHint(base_type);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
if (type1.exponents[i] !== type2.exponents[i]) {
|
|
229
|
+
error = true;
|
|
230
|
+
return type1;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
error = false;
|
|
236
|
+
return type1;
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
CSSNumericValueType.multiply = function (type1, type2, error) {
|
|
240
|
+
if (type1.hasPercentHint && type2.hasPercentHint && type1.percentHint != type2.percentHint) {
|
|
241
|
+
error = true;
|
|
242
|
+
return type1;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (type1.hasPercentHint) type2.applyPercentHint(type1.percentHint);else if (type2.hasPercentHint) type1.applyPercentHint(type2.percentHint);
|
|
246
|
+
|
|
247
|
+
for (var i = 0; i < BaseType.kNumBaseTypes; ++i) {
|
|
248
|
+
var base_type = i;
|
|
249
|
+
type1.setExponent(base_type, type1.exponent(base_type) + type2.exponent(base_type));
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
error = false;
|
|
253
|
+
return type1;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
return CSSNumericValueType;
|
|
257
|
+
}();
|
|
258
|
+
|
|
259
|
+
export { CSSNumericValueType };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CSSColorValue } from './CSSColorValue';
|
|
2
|
+
import type { CSSColorRGBComp, CSSColorPercent } from './CSSColorValue';
|
|
3
|
+
import type { Nested, ParenLess } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* The CSSRGB class represents the CSS rgb()/rgba() functions.
|
|
6
|
+
*
|
|
7
|
+
* @see https://drafts.css-houdini.org/css-typed-om-1/#cssrgb
|
|
8
|
+
*/
|
|
9
|
+
export declare class CSSRGB extends CSSColorValue {
|
|
10
|
+
r: CSSColorRGBComp;
|
|
11
|
+
g: CSSColorRGBComp;
|
|
12
|
+
b: CSSColorRGBComp;
|
|
13
|
+
alpha: CSSColorPercent;
|
|
14
|
+
/**
|
|
15
|
+
* 'transparent' & 'none' has the same rgba data
|
|
16
|
+
*/
|
|
17
|
+
isNone: boolean;
|
|
18
|
+
constructor(r: CSSColorRGBComp, g: CSSColorRGBComp, b: CSSColorRGBComp, alpha?: CSSColorPercent,
|
|
19
|
+
/**
|
|
20
|
+
* 'transparent' & 'none' has the same rgba data
|
|
21
|
+
*/
|
|
22
|
+
isNone?: boolean);
|
|
23
|
+
clone(): CSSRGB;
|
|
24
|
+
buildCSSText(n: Nested, p: ParenLess, result: string): string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { CSSColorValue } from './CSSColorValue';
|
|
3
|
+
/**
|
|
4
|
+
* The CSSRGB class represents the CSS rgb()/rgba() functions.
|
|
5
|
+
*
|
|
6
|
+
* @see https://drafts.css-houdini.org/css-typed-om-1/#cssrgb
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
var CSSRGB =
|
|
10
|
+
/** @class */
|
|
11
|
+
function (_super) {
|
|
12
|
+
__extends(CSSRGB, _super);
|
|
13
|
+
|
|
14
|
+
function CSSRGB(r, g, b, alpha,
|
|
15
|
+
/**
|
|
16
|
+
* 'transparent' & 'none' has the same rgba data
|
|
17
|
+
*/
|
|
18
|
+
isNone) {
|
|
19
|
+
if (alpha === void 0) {
|
|
20
|
+
alpha = 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (isNone === void 0) {
|
|
24
|
+
isNone = false;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var _this = _super.call(this, 'rgb') || this;
|
|
28
|
+
|
|
29
|
+
_this.r = r;
|
|
30
|
+
_this.g = g;
|
|
31
|
+
_this.b = b;
|
|
32
|
+
_this.alpha = alpha;
|
|
33
|
+
_this.isNone = isNone;
|
|
34
|
+
return _this;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
CSSRGB.prototype.clone = function () {
|
|
38
|
+
return new CSSRGB(this.r, this.g, this.b, this.alpha);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
CSSRGB.prototype.buildCSSText = function (n, p, result) {
|
|
42
|
+
return result + "rgba(".concat(this.r, ",").concat(this.g, ",").concat(this.b, ",").concat(this.alpha, ")");
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return CSSRGB;
|
|
46
|
+
}(CSSColorValue);
|
|
47
|
+
|
|
48
|
+
export { CSSRGB };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Nested, ParenLess, UnitType, UnitCategory } from './types';
|
|
2
|
+
export declare enum CSSStyleValueType {
|
|
3
|
+
kUnknownType = 0,
|
|
4
|
+
kUnparsedType = 1,
|
|
5
|
+
kKeywordType = 2,
|
|
6
|
+
kUnitType = 3,
|
|
7
|
+
kSumType = 4,
|
|
8
|
+
kProductType = 5,
|
|
9
|
+
kNegateType = 6,
|
|
10
|
+
kInvertType = 7,
|
|
11
|
+
kMinType = 8,
|
|
12
|
+
kMaxType = 9,
|
|
13
|
+
kClampType = 10,
|
|
14
|
+
kTransformType = 11,
|
|
15
|
+
kPositionType = 12,
|
|
16
|
+
kURLImageType = 13,
|
|
17
|
+
kColorType = 14,
|
|
18
|
+
kUnsupportedColorType = 15
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* CSSStyleValue is the base class for all CSS values accessible from Typed OM.
|
|
22
|
+
* Values that are not yet supported as specific types are also returned as base CSSStyleValues.
|
|
23
|
+
*
|
|
24
|
+
* Spec @see https://drafts.css-houdini.org/css-typed-om/#stylevalue-objects
|
|
25
|
+
* Docs @see https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleValue
|
|
26
|
+
*/
|
|
27
|
+
export declare abstract class CSSStyleValue {
|
|
28
|
+
static parse(propertyName: string, value: string): CSSStyleValue;
|
|
29
|
+
static parseAll(propertyName: string, value: string): CSSStyleValue[];
|
|
30
|
+
static unitFromName(name: string): UnitType;
|
|
31
|
+
static unitTypeToUnitCategory(type: UnitType): UnitCategory;
|
|
32
|
+
static unitTypeToString(type: UnitType): "" | "em" | "px" | "deg" | "rad" | "grad" | "ms" | "s" | "rem" | "turn" | "%";
|
|
33
|
+
static stringToUnitType(name: string): UnitType;
|
|
34
|
+
static canonicalUnitTypeForCategory(category: UnitCategory): UnitType.kUnknown | UnitType.kNumber | UnitType.kPixels | UnitType.kDegrees | UnitType.kSeconds | UnitType.kHertz | UnitType.kDotsPerPixel;
|
|
35
|
+
/**
|
|
36
|
+
* @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/css_primitive_value.cc#353
|
|
37
|
+
*/
|
|
38
|
+
static conversionToCanonicalUnitsScaleFactor(unit_type: UnitType): number;
|
|
39
|
+
static isAngle(unit: UnitType): boolean;
|
|
40
|
+
static isViewportPercentageLength(type: UnitType): boolean;
|
|
41
|
+
static isContainerPercentageLength(type: UnitType): boolean;
|
|
42
|
+
static isLength(type: UnitType): boolean;
|
|
43
|
+
static isRelativeUnit(type: UnitType): boolean;
|
|
44
|
+
static isTime(unit: UnitType): boolean;
|
|
45
|
+
static isFrequency(unit: UnitType): boolean;
|
|
46
|
+
static isResolution(type: UnitType): boolean;
|
|
47
|
+
static isFlex(unit: UnitType): boolean;
|
|
48
|
+
protected abstract getType(): CSSStyleValueType;
|
|
49
|
+
abstract buildCSSText(n: Nested, p: ParenLess, result: string): string;
|
|
50
|
+
abstract clone(): CSSStyleValue;
|
|
51
|
+
toString(): string;
|
|
52
|
+
isNumericValue(): boolean;
|
|
53
|
+
}
|