@antv/g 5.0.19 → 5.0.21
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 +61 -23
- package/es/camera/Camera.d.ts +2 -0
- package/es/camera/Camera.js +3 -4
- 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 +125 -148
- 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 +71 -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 +37 -20
- package/es/services/OffscreenCanvasCreator.d.ts +13 -0
- package/es/services/{text/OffscreenCanvasCreator.js → OffscreenCanvasCreator.js} +23 -12
- 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 +5 -0
- package/es/services/SceneGraphService.js +13 -10
- 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/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 +62 -27
- 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/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 +64 -27
- package/lib/camera/Camera.d.ts +2 -0
- package/lib/camera/Camera.js +3 -5
- 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 +127 -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 +71 -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 +38 -21
- package/lib/services/OffscreenCanvasCreator.d.ts +13 -0
- package/lib/services/{text/OffscreenCanvasCreator.js → OffscreenCanvasCreator.js} +23 -12
- 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 +5 -0
- package/lib/services/SceneGraphService.js +13 -10
- 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/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 +62 -27
- 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/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,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CSSPropertyLocalPosition = void 0;
|
|
7
|
+
|
|
8
|
+
var _tslib = require("tslib");
|
|
9
|
+
|
|
10
|
+
var _manaSyringe = require("mana-syringe");
|
|
11
|
+
|
|
12
|
+
var _ = require("../..");
|
|
13
|
+
|
|
14
|
+
var _CSSPropertyLengthOrPercentage = require("./CSSPropertyLengthOrPercentage");
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* local position
|
|
18
|
+
*/
|
|
19
|
+
var CSSPropertyLocalPosition =
|
|
20
|
+
/** @class */
|
|
21
|
+
function (_super) {
|
|
22
|
+
(0, _tslib.__extends)(CSSPropertyLocalPosition, _super);
|
|
23
|
+
|
|
24
|
+
function CSSPropertyLocalPosition() {
|
|
25
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
+
/**
|
|
27
|
+
* <length> & <percentage>
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
_this.parser = _.parseLengthOrPercentage;
|
|
32
|
+
/**
|
|
33
|
+
* mix between CSS.px(x)
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
_this.mixer = _.mergeDimensions;
|
|
37
|
+
return _this;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* update local position
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
CSSPropertyLocalPosition.prototype.postProcessor = function (object) {
|
|
45
|
+
var _a = object.parsedStyle,
|
|
46
|
+
x = _a.x,
|
|
47
|
+
y = _a.y,
|
|
48
|
+
z = _a.z;
|
|
49
|
+
object.setLocalPosition(x && x.value || 0, y && y.value || 0, z && z.value || 0);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
CSSPropertyLocalPosition = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)()], CSSPropertyLocalPosition);
|
|
53
|
+
return CSSPropertyLocalPosition;
|
|
54
|
+
}(_CSSPropertyLengthOrPercentage.CSSPropertyLengthOrPercentage);
|
|
55
|
+
|
|
56
|
+
exports.CSSPropertyLocalPosition = CSSPropertyLocalPosition;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CSSUnitValue, CSSProperty, DisplayObject } from '../..';
|
|
2
|
+
import { parseNumber } from '../..';
|
|
3
|
+
export declare class CSSPropertyOffsetDistance implements Partial<CSSProperty<CSSUnitValue, CSSUnitValue>> {
|
|
4
|
+
parser: typeof parseNumber;
|
|
5
|
+
mixer: (left: CSSUnitValue, right: CSSUnitValue) => [number, number, (i: number) => string];
|
|
6
|
+
postProcessor(object: DisplayObject): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CSSPropertyOffsetDistance = void 0;
|
|
7
|
+
|
|
8
|
+
var _tslib = require("tslib");
|
|
9
|
+
|
|
10
|
+
var _manaSyringe = require("mana-syringe");
|
|
11
|
+
|
|
12
|
+
var _ = require("../..");
|
|
13
|
+
|
|
14
|
+
var CSSPropertyOffsetDistance =
|
|
15
|
+
/** @class */
|
|
16
|
+
function () {
|
|
17
|
+
function CSSPropertyOffsetDistance() {
|
|
18
|
+
this.parser = _.parseNumber;
|
|
19
|
+
this.mixer = (0, _.clampedMergeNumbers)(0, 1);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
CSSPropertyOffsetDistance.prototype.postProcessor = function (object) {
|
|
23
|
+
if (!object.attributes.offsetPath) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var offsetPathNodeName = object.attributes.offsetPath.nodeName;
|
|
28
|
+
|
|
29
|
+
if (offsetPathNodeName === _.Shape.LINE || offsetPathNodeName === _.Shape.PATH || offsetPathNodeName === _.Shape.POLYLINE) {
|
|
30
|
+
var point = object.attributes.offsetPath.getPoint(object.parsedStyle.offsetDistance.value);
|
|
31
|
+
|
|
32
|
+
if (point) {
|
|
33
|
+
object.setLocalPosition(point.x, point.y);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
CSSPropertyOffsetDistance = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)()], CSSPropertyOffsetDistance);
|
|
39
|
+
return CSSPropertyOffsetDistance;
|
|
40
|
+
}();
|
|
41
|
+
|
|
42
|
+
exports.CSSPropertyOffsetDistance = CSSPropertyOffsetDistance;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CSSProperty, DisplayObject } from '../..';
|
|
2
|
+
export declare class CSSPropertyOffsetPath implements Partial<CSSProperty<DisplayObject, DisplayObject>> {
|
|
3
|
+
calculator(name: string, oldOffsetPath: DisplayObject, newOffsetPath: DisplayObject, object: DisplayObject): DisplayObject<any, any>;
|
|
4
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CSSPropertyOffsetPath = void 0;
|
|
7
|
+
|
|
8
|
+
var _tslib = require("tslib");
|
|
9
|
+
|
|
10
|
+
var _manaSyringe = require("mana-syringe");
|
|
11
|
+
|
|
12
|
+
var CSSPropertyOffsetPath =
|
|
13
|
+
/** @class */
|
|
14
|
+
function () {
|
|
15
|
+
function CSSPropertyOffsetPath() {}
|
|
16
|
+
|
|
17
|
+
CSSPropertyOffsetPath.prototype.calculator = function (name, oldOffsetPath, newOffsetPath, object) {
|
|
18
|
+
// clear ref to old clip path
|
|
19
|
+
if (oldOffsetPath && oldOffsetPath !== newOffsetPath && oldOffsetPath.style.offsetPathTargets) {
|
|
20
|
+
var index = oldOffsetPath.style.offsetPathTargets.indexOf(object);
|
|
21
|
+
oldOffsetPath.style.offsetPathTargets.splice(index, 1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (newOffsetPath) {
|
|
25
|
+
if (!newOffsetPath.style.offsetPathTargets) {
|
|
26
|
+
newOffsetPath.style.offsetPathTargets = [];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
newOffsetPath.style.offsetPathTargets.push(object);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return newOffsetPath;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
CSSPropertyOffsetPath = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)()], CSSPropertyOffsetPath);
|
|
36
|
+
return CSSPropertyOffsetPath;
|
|
37
|
+
}();
|
|
38
|
+
|
|
39
|
+
exports.CSSPropertyOffsetPath = CSSPropertyOffsetPath;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CSSUnitValue, CSSProperty } from '../..';
|
|
2
|
+
import { parseNumber } from '../..';
|
|
3
|
+
/**
|
|
4
|
+
* opacity
|
|
5
|
+
*/
|
|
6
|
+
export declare class CSSPropertyOpacity implements Partial<CSSProperty<CSSUnitValue, CSSUnitValue>> {
|
|
7
|
+
parser: typeof parseNumber;
|
|
8
|
+
mixer: (left: CSSUnitValue, right: CSSUnitValue) => [number, number, (i: number) => string];
|
|
9
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CSSPropertyOpacity = void 0;
|
|
7
|
+
|
|
8
|
+
var _tslib = require("tslib");
|
|
9
|
+
|
|
10
|
+
var _manaSyringe = require("mana-syringe");
|
|
11
|
+
|
|
12
|
+
var _ = require("../..");
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* opacity
|
|
16
|
+
*/
|
|
17
|
+
var CSSPropertyOpacity =
|
|
18
|
+
/** @class */
|
|
19
|
+
function () {
|
|
20
|
+
function CSSPropertyOpacity() {
|
|
21
|
+
this.parser = _.parseNumber;
|
|
22
|
+
this.mixer = (0, _.clampedMergeNumbers)(0, 1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
CSSPropertyOpacity = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)()], CSSPropertyOpacity);
|
|
26
|
+
return CSSPropertyOpacity;
|
|
27
|
+
}();
|
|
28
|
+
|
|
29
|
+
exports.CSSPropertyOpacity = CSSPropertyOpacity;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DisplayObject, CSSProperty, ParsedPathStyleProps } from '../..';
|
|
2
|
+
import { parsePath, mergePaths } from '../..';
|
|
3
|
+
export declare class CSSPropertyPath implements Partial<CSSProperty<ParsedPathStyleProps, ParsedPathStyleProps>> {
|
|
4
|
+
/**
|
|
5
|
+
* path2Curve
|
|
6
|
+
*/
|
|
7
|
+
parser: typeof parsePath;
|
|
8
|
+
calculator(name: string, oldParsed: ParsedPathStyleProps, parsed: ParsedPathStyleProps): ParsedPathStyleProps;
|
|
9
|
+
mixer: typeof mergePaths;
|
|
10
|
+
/**
|
|
11
|
+
* update local position
|
|
12
|
+
*/
|
|
13
|
+
postProcessor(object: DisplayObject): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CSSPropertyPath = void 0;
|
|
7
|
+
|
|
8
|
+
var _tslib = require("tslib");
|
|
9
|
+
|
|
10
|
+
var _manaSyringe = require("mana-syringe");
|
|
11
|
+
|
|
12
|
+
var _ = require("../..");
|
|
13
|
+
|
|
14
|
+
var CSSPropertyPath =
|
|
15
|
+
/** @class */
|
|
16
|
+
function () {
|
|
17
|
+
function CSSPropertyPath() {
|
|
18
|
+
/**
|
|
19
|
+
* path2Curve
|
|
20
|
+
*/
|
|
21
|
+
this.parser = _.parsePath;
|
|
22
|
+
this.mixer = _.mergePaths;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
CSSPropertyPath.prototype.calculator = function (name, oldParsed, parsed) {
|
|
26
|
+
if (parsed instanceof _.CSSKeywordValue) {
|
|
27
|
+
return {
|
|
28
|
+
absolutePath: [],
|
|
29
|
+
hasArc: false,
|
|
30
|
+
segments: [],
|
|
31
|
+
polygons: [],
|
|
32
|
+
polylines: [],
|
|
33
|
+
curve: [],
|
|
34
|
+
totalLength: 0,
|
|
35
|
+
curveSegments: [],
|
|
36
|
+
zCommandIndexes: [],
|
|
37
|
+
rect: new _.Rectangle(0, 0, 0, 0)
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return parsed;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* update local position
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
CSSPropertyPath.prototype.postProcessor = function (object) {
|
|
49
|
+
var _a = object.parsedStyle,
|
|
50
|
+
x = _a.x,
|
|
51
|
+
y = _a.y,
|
|
52
|
+
z = _a.z;
|
|
53
|
+
object.setLocalPosition(x && x.value || 0, y && y.value || 0, z && z.value || 0);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
CSSPropertyPath = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)()], CSSPropertyPath);
|
|
57
|
+
return CSSPropertyPath;
|
|
58
|
+
}();
|
|
59
|
+
|
|
60
|
+
exports.CSSPropertyPath = CSSPropertyPath;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CSSProperty, DisplayObject } from '../..';
|
|
2
|
+
import { parsePoints } from '../..';
|
|
3
|
+
export declare class CSSPropertyPoints implements Partial<CSSProperty<{
|
|
4
|
+
points: [number, number][];
|
|
5
|
+
totalLength: number;
|
|
6
|
+
segments: [number, number][];
|
|
7
|
+
}, {
|
|
8
|
+
points: [number, number][];
|
|
9
|
+
totalLength: number;
|
|
10
|
+
segments: [number, number][];
|
|
11
|
+
}>> {
|
|
12
|
+
parser: typeof parsePoints;
|
|
13
|
+
/**
|
|
14
|
+
* update local position
|
|
15
|
+
*/
|
|
16
|
+
postProcessor(object: DisplayObject): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CSSPropertyPoints = void 0;
|
|
7
|
+
|
|
8
|
+
var _tslib = require("tslib");
|
|
9
|
+
|
|
10
|
+
var _manaSyringe = require("mana-syringe");
|
|
11
|
+
|
|
12
|
+
var _ = require("../..");
|
|
13
|
+
|
|
14
|
+
var CSSPropertyPoints =
|
|
15
|
+
/** @class */
|
|
16
|
+
function () {
|
|
17
|
+
function CSSPropertyPoints() {
|
|
18
|
+
this.parser = _.parsePoints;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* update local position
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
CSSPropertyPoints.prototype.postProcessor = function (object) {
|
|
26
|
+
var _a = object.parsedStyle,
|
|
27
|
+
x = _a.x,
|
|
28
|
+
y = _a.y,
|
|
29
|
+
z = _a.z;
|
|
30
|
+
object.setLocalPosition(x && x.value || 0, y && y.value || 0, z && z.value || 0);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
CSSPropertyPoints = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)()], CSSPropertyPoints);
|
|
34
|
+
return CSSPropertyPoints;
|
|
35
|
+
}();
|
|
36
|
+
|
|
37
|
+
exports.CSSPropertyPoints = CSSPropertyPoints;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CSSPropertyLengthOrPercentage } from './CSSPropertyLengthOrPercentage';
|
|
2
|
+
export declare class CSSPropertyShadowBlur extends CSSPropertyLengthOrPercentage {
|
|
3
|
+
mixer: (left: import("../..").CSSUnitValue, right: import("../..").CSSUnitValue) => [number, number, (i: number) => string];
|
|
4
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CSSPropertyShadowBlur = void 0;
|
|
7
|
+
|
|
8
|
+
var _tslib = require("tslib");
|
|
9
|
+
|
|
10
|
+
var _manaSyringe = require("mana-syringe");
|
|
11
|
+
|
|
12
|
+
var _ = require("../..");
|
|
13
|
+
|
|
14
|
+
var _CSSPropertyLengthOrPercentage = require("./CSSPropertyLengthOrPercentage");
|
|
15
|
+
|
|
16
|
+
var CSSPropertyShadowBlur =
|
|
17
|
+
/** @class */
|
|
18
|
+
function (_super) {
|
|
19
|
+
(0, _tslib.__extends)(CSSPropertyShadowBlur, _super);
|
|
20
|
+
|
|
21
|
+
function CSSPropertyShadowBlur() {
|
|
22
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
23
|
+
|
|
24
|
+
_this.mixer = (0, _.clampedMergeNumbers)(0, Infinity);
|
|
25
|
+
return _this;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
CSSPropertyShadowBlur = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)()], CSSPropertyShadowBlur);
|
|
29
|
+
return CSSPropertyShadowBlur;
|
|
30
|
+
}(_CSSPropertyLengthOrPercentage.CSSPropertyLengthOrPercentage);
|
|
31
|
+
|
|
32
|
+
exports.CSSPropertyShadowBlur = CSSPropertyShadowBlur;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CSSProperty, DisplayObject } from '../..';
|
|
2
|
+
import { CSSKeywordValue } from '../..';
|
|
3
|
+
export declare class CSSPropertyText implements Partial<CSSProperty<CSSKeywordValue | string, string>> {
|
|
4
|
+
calculator(name: string, oldParsed: CSSKeywordValue | string, parsed: CSSKeywordValue | string, object: DisplayObject): string;
|
|
5
|
+
postProcessor(object: DisplayObject): void;
|
|
6
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CSSPropertyText = void 0;
|
|
7
|
+
|
|
8
|
+
var _tslib = require("tslib");
|
|
9
|
+
|
|
10
|
+
var _manaSyringe = require("mana-syringe");
|
|
11
|
+
|
|
12
|
+
var _ = require("../..");
|
|
13
|
+
|
|
14
|
+
var CSSPropertyText =
|
|
15
|
+
/** @class */
|
|
16
|
+
function () {
|
|
17
|
+
function CSSPropertyText() {}
|
|
18
|
+
|
|
19
|
+
CSSPropertyText.prototype.calculator = function (name, oldParsed, parsed, object) {
|
|
20
|
+
if (parsed instanceof _.CSSKeywordValue) {
|
|
21
|
+
if (parsed.value === 'unset') {
|
|
22
|
+
return '';
|
|
23
|
+
} else {
|
|
24
|
+
return parsed.value;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return parsed;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
CSSPropertyText.prototype.postProcessor = function (object) {
|
|
32
|
+
object.nodeValue = "".concat(object.parsedStyle.text) || '';
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
CSSPropertyText = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)()], CSSPropertyText);
|
|
36
|
+
return CSSPropertyText;
|
|
37
|
+
}();
|
|
38
|
+
|
|
39
|
+
exports.CSSPropertyText = CSSPropertyText;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CSSPropertyTextTransform = void 0;
|
|
7
|
+
|
|
8
|
+
var _tslib = require("tslib");
|
|
9
|
+
|
|
10
|
+
var _manaSyringe = require("mana-syringe");
|
|
11
|
+
|
|
12
|
+
var _ = require("../..");
|
|
13
|
+
|
|
14
|
+
var CSSPropertyTextTransform =
|
|
15
|
+
/** @class */
|
|
16
|
+
function () {
|
|
17
|
+
function CSSPropertyTextTransform() {}
|
|
18
|
+
|
|
19
|
+
CSSPropertyTextTransform.prototype.postProcessor = function (o) {
|
|
20
|
+
if (o.nodeName === _.Shape.TEXT) {
|
|
21
|
+
var object = o;
|
|
22
|
+
var newTextTransform = object.parsedStyle.textTransform.value;
|
|
23
|
+
|
|
24
|
+
if (newTextTransform === _.TextTransform.CAPITALIZE) {
|
|
25
|
+
object.style.text = object.style.text.charAt(0).toUpperCase() + object.style.text.slice(1);
|
|
26
|
+
} else if (newTextTransform === _.TextTransform.LOWERCASE) {
|
|
27
|
+
object.style.text = object.style.text.toLowerCase();
|
|
28
|
+
} else if (newTextTransform === _.TextTransform.UPPERCASE) {
|
|
29
|
+
object.style.text = object.style.text.toUpperCase(); // } else if (newTextTransform === TextTransform.NONE) {
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
CSSPropertyTextTransform = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)()], CSSPropertyTextTransform);
|
|
35
|
+
return CSSPropertyTextTransform;
|
|
36
|
+
}();
|
|
37
|
+
|
|
38
|
+
exports.CSSPropertyTextTransform = CSSPropertyTextTransform;
|
|
@@ -1,16 +1,5 @@
|
|
|
1
|
-
import type { DisplayObject } from '
|
|
2
|
-
import
|
|
3
|
-
interface ParsedTransform {
|
|
4
|
-
t: string;
|
|
5
|
-
d: (number | ParsedElement)[];
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* none
|
|
9
|
-
* scale(1) scale(1, 2)
|
|
10
|
-
* scaleX(1)
|
|
11
|
-
*/
|
|
12
|
-
export declare function parseTransform(string: string): ParsedTransform[];
|
|
13
|
-
export declare function mergeTransforms(left: ParsedTransform[], right: ParsedTransform[], target: DisplayObject | null): [number[][], number[][], (d: number[][]) => string];
|
|
1
|
+
import type { CSSProperty, DisplayObject } from '../..';
|
|
2
|
+
import { parseTransform, mergeTransforms } from '../..';
|
|
14
3
|
/**
|
|
15
4
|
* @see /zh/docs/api/animation#支持变换的属性
|
|
16
5
|
*
|
|
@@ -41,5 +30,8 @@ export declare function mergeTransforms(left: ParsedTransform[], right: ParsedTr
|
|
|
41
30
|
* * skew/skewX/skewY
|
|
42
31
|
* * perspective
|
|
43
32
|
*/
|
|
44
|
-
export declare
|
|
45
|
-
|
|
33
|
+
export declare class CSSPropertyTransform implements Partial<CSSProperty<any[], any[]>> {
|
|
34
|
+
parser: typeof parseTransform;
|
|
35
|
+
mixer: typeof mergeTransforms;
|
|
36
|
+
calculator(name: string, oldValue: any[], newValue: any[], object: DisplayObject): any[];
|
|
37
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CSSPropertyTransform = void 0;
|
|
7
|
+
|
|
8
|
+
var _tslib = require("tslib");
|
|
9
|
+
|
|
10
|
+
var _manaSyringe = require("mana-syringe");
|
|
11
|
+
|
|
12
|
+
var _ = require("../..");
|
|
13
|
+
|
|
14
|
+
var _cssom = require("../cssom");
|
|
15
|
+
|
|
16
|
+
// import { uniq } from '@antv/util';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @see /zh/docs/api/animation#支持变换的属性
|
|
20
|
+
*
|
|
21
|
+
* support the following formats like CSS Transform:
|
|
22
|
+
*
|
|
23
|
+
* scale
|
|
24
|
+
* * scale(x, y)
|
|
25
|
+
* * scaleX(x)
|
|
26
|
+
* * scaleY(x)
|
|
27
|
+
* * scaleZ(z)
|
|
28
|
+
* * scale3d(x, y, z)
|
|
29
|
+
*
|
|
30
|
+
* translate (unit: none, px, %(relative to its bounds))
|
|
31
|
+
* * translate(x, y) eg. translate(0, 0) translate(0, 30px) translate(100%, 100%)
|
|
32
|
+
* * translateX(0)
|
|
33
|
+
* * translateY(0)
|
|
34
|
+
* * translateZ(0)
|
|
35
|
+
* * translate3d(0, 0, 0)
|
|
36
|
+
*
|
|
37
|
+
* rotate (unit: deg rad turn)
|
|
38
|
+
* * rotate(0.5turn) rotate(30deg) rotate(1rad)
|
|
39
|
+
*
|
|
40
|
+
* none
|
|
41
|
+
*
|
|
42
|
+
* unsupported for now:
|
|
43
|
+
* * calc() eg. translate(calc(100% + 10px))
|
|
44
|
+
* * matrix/matrix3d()
|
|
45
|
+
* * skew/skewX/skewY
|
|
46
|
+
* * perspective
|
|
47
|
+
*/
|
|
48
|
+
var CSSPropertyTransform =
|
|
49
|
+
/** @class */
|
|
50
|
+
function () {
|
|
51
|
+
function CSSPropertyTransform() {
|
|
52
|
+
this.parser = _.parseTransform;
|
|
53
|
+
this.mixer = _.mergeTransforms;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
CSSPropertyTransform.prototype.calculator = function (name, oldValue, newValue, object) {
|
|
57
|
+
if (newValue instanceof _cssom.CSSKeywordValue) {
|
|
58
|
+
newValue = [];
|
|
59
|
+
} // const uniqTypes = uniq([
|
|
60
|
+
// ...(oldValue || []).map(({ t }) => t),
|
|
61
|
+
// ...(newValue || []).map(({ t }) => t),
|
|
62
|
+
// ]);
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
newValue.forEach(function (transform) {
|
|
66
|
+
var t = transform.t;
|
|
67
|
+
var value = (newValue || []).find(function (o) {
|
|
68
|
+
return o.t === t;
|
|
69
|
+
});
|
|
70
|
+
var old = (oldValue || []).find(function (o) {
|
|
71
|
+
return o.t === t;
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
if (t === 'scale') {
|
|
75
|
+
// scale(1) scale(1, 1)
|
|
76
|
+
var newScale = value && value.d && value.d.map(function (s) {
|
|
77
|
+
return s.value;
|
|
78
|
+
}) || [1, 1];
|
|
79
|
+
var oldScale = old && old.d && old.d.map(function (s) {
|
|
80
|
+
return s.value;
|
|
81
|
+
}) || [1, 1];
|
|
82
|
+
object.scaleLocal(newScale[0] / oldScale[0], newScale[1] / oldScale[1], 1);
|
|
83
|
+
} else if (t === 'scalex') {
|
|
84
|
+
var newScale = value && value.d && value.d.map(function (s) {
|
|
85
|
+
return s.value;
|
|
86
|
+
}) || [1];
|
|
87
|
+
var oldScale = old && old.d && old.d.map(function (s) {
|
|
88
|
+
return s.value;
|
|
89
|
+
}) || [1];
|
|
90
|
+
object.scaleLocal(newScale[0] / oldScale[0], 1, 1);
|
|
91
|
+
} else if (t === 'scaley') {
|
|
92
|
+
var newScale = value && value.d && value.d.map(function (s) {
|
|
93
|
+
return s.value;
|
|
94
|
+
}) || [1];
|
|
95
|
+
var oldScale = old && old.d && old.d.map(function (s) {
|
|
96
|
+
return s.value;
|
|
97
|
+
}) || [1];
|
|
98
|
+
object.scaleLocal(1, newScale[0] / oldScale[0], 1);
|
|
99
|
+
} else if (t === 'scalez') {
|
|
100
|
+
var newScale = value && value.d && value.d.map(function (s) {
|
|
101
|
+
return s.value;
|
|
102
|
+
}) || [1];
|
|
103
|
+
var oldScale = old && old.d && old.d.map(function (s) {
|
|
104
|
+
return s.value;
|
|
105
|
+
}) || [1];
|
|
106
|
+
object.scaleLocal(1, 1, newScale[0] / oldScale[0]);
|
|
107
|
+
} else if (t === 'scale3d') {
|
|
108
|
+
var newScale = value && value.d && value.d.map(function (s) {
|
|
109
|
+
return s.value;
|
|
110
|
+
}) || [1, 1, 1];
|
|
111
|
+
var oldScale = old && old.d && old.d.map(function (s) {
|
|
112
|
+
return s.value;
|
|
113
|
+
}) || [1, 1, 1];
|
|
114
|
+
object.scaleLocal(newScale[0] / oldScale[0], newScale[1] / oldScale[1], newScale[2] / oldScale[2]);
|
|
115
|
+
} else if (t === 'translate') {
|
|
116
|
+
var newTranslation = value && value.d || [_.Opx, _.Opx];
|
|
117
|
+
var oldTranslation = old && old.d || [_.Opx, _.Opx];
|
|
118
|
+
object.translateLocal(newTranslation[0].value - oldTranslation[0].value, newTranslation[1].value - oldTranslation[1].value, 0);
|
|
119
|
+
} else if (t === 'translatex') {
|
|
120
|
+
var newTranslation = value && value.d || [_.Opx];
|
|
121
|
+
var oldTranslation = old && old.d || [_.Opx];
|
|
122
|
+
object.translateLocal(newTranslation[0].value - oldTranslation[0].value, 0, 0);
|
|
123
|
+
} else if (t === 'translatey') {
|
|
124
|
+
var newTranslation = value && value.d || [_.Opx];
|
|
125
|
+
var oldTranslation = old && old.d || [_.Opx];
|
|
126
|
+
object.translateLocal(0, newTranslation[0].value - oldTranslation[0].value, 0);
|
|
127
|
+
} else if (t === 'translatez') {
|
|
128
|
+
var newTranslation = value && value.d || [_.Opx];
|
|
129
|
+
var oldTranslation = old && old.d || [_.Opx];
|
|
130
|
+
object.translateLocal(0, 0, newTranslation[0].value - oldTranslation[0].value);
|
|
131
|
+
} else if (t === 'translate3d') {
|
|
132
|
+
var newTranslation = value && value.d || [_.Opx, _.Opx, _.Opx];
|
|
133
|
+
var oldTranslation = old && old.d || [_.Opx, _.Opx, _.Opx];
|
|
134
|
+
object.translateLocal(newTranslation[0].value - oldTranslation[0].value, newTranslation[1].value - oldTranslation[1].value, newTranslation[2].value - oldTranslation[2].value);
|
|
135
|
+
} else if (t === 'rotate') {
|
|
136
|
+
var newAngles = value && value.d || [_.Odeg];
|
|
137
|
+
var oldAngles = old && old.d || [_.Odeg];
|
|
138
|
+
object.rotateLocal(0, 0, newAngles[0].value - oldAngles[0].value);
|
|
139
|
+
} else if (t === 'rotatex') {
|
|
140
|
+
var newAngles = value && value.d || [_.Odeg];
|
|
141
|
+
var oldAngles = old && old.d || [_.Odeg];
|
|
142
|
+
object.rotateLocal(newAngles[0].value - oldAngles[0].value, 0, 0);
|
|
143
|
+
} else if (t === 'rotatey') {
|
|
144
|
+
var newAngles = value && value.d || [_.Odeg];
|
|
145
|
+
var oldAngles = old && old.d || [_.Odeg];
|
|
146
|
+
object.rotateLocal(0, newAngles[0].value - oldAngles[0].value, 0);
|
|
147
|
+
} else if (t === 'rotatez') {
|
|
148
|
+
var newAngles = value && value.d || [_.Odeg];
|
|
149
|
+
var oldAngles = old && old.d || [_.Odeg];
|
|
150
|
+
object.rotateLocal(0, 0, newAngles[0].value - oldAngles[0].value);
|
|
151
|
+
} else if (t === 'rotate3d') {// 暂不支持绕指定轴旋转
|
|
152
|
+
// const newAngles = value && value.d || [Odeg, Odeg, Odeg];
|
|
153
|
+
// const oldAngles = old && old.d || [Odeg, Odeg, Odeg];
|
|
154
|
+
// object.rotateLocal(
|
|
155
|
+
// newAngles[0].value - oldAngles[0].value,
|
|
156
|
+
// newAngles[1].value - oldAngles[1].value,
|
|
157
|
+
// newAngles[2].value - oldAngles[2].value,
|
|
158
|
+
// );
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
return newValue;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
CSSPropertyTransform = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)()], CSSPropertyTransform);
|
|
165
|
+
return CSSPropertyTransform;
|
|
166
|
+
}();
|
|
167
|
+
|
|
168
|
+
exports.CSSPropertyTransform = CSSPropertyTransform;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CSSProperty, CSSUnitValue } from '../..';
|
|
2
|
+
import { parseTransformOrigin } from '../..';
|
|
3
|
+
/**
|
|
4
|
+
* @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/transform-origin
|
|
5
|
+
* @example
|
|
6
|
+
* [10px, 10px] [10%, 10%]
|
|
7
|
+
*/
|
|
8
|
+
export declare class CSSPropertyTransformOrigin implements Partial<CSSProperty<[CSSUnitValue, CSSUnitValue], [CSSUnitValue, CSSUnitValue]>> {
|
|
9
|
+
parser: typeof parseTransformOrigin;
|
|
10
|
+
}
|