@antv/g 5.1.2 → 5.1.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/dist/AbstractRenderer.d.ts +38 -0
- package/dist/AbstractRenderer.d.ts.map +1 -0
- package/dist/Canvas.d.ts +150 -0
- package/dist/Canvas.d.ts.map +1 -0
- package/dist/DisplayObjectPool.d.ts +10 -0
- package/dist/DisplayObjectPool.d.ts.map +1 -0
- package/dist/__tests__/utils.d.ts +2 -0
- package/dist/__tests__/utils.d.ts.map +1 -0
- package/dist/camera/Camera.d.ts +328 -0
- package/dist/camera/Camera.d.ts.map +1 -0
- package/dist/camera/Landmark.d.ts +24 -0
- package/dist/camera/Landmark.d.ts.map +1 -0
- package/dist/camera/index.d.ts +3 -0
- package/dist/camera/index.d.ts.map +1 -0
- package/dist/canvas-module.d.ts +2 -0
- package/dist/canvas-module.d.ts.map +1 -0
- package/dist/components/Cullable.d.ts +15 -0
- package/dist/components/Cullable.d.ts.map +1 -0
- package/dist/components/Geometry.d.ts +13 -0
- package/dist/components/Geometry.d.ts.map +1 -0
- package/dist/components/Renderable.d.ts +25 -0
- package/dist/components/Renderable.d.ts.map +1 -0
- package/dist/components/Sortable.d.ts +21 -0
- package/dist/components/Sortable.d.ts.map +1 -0
- package/dist/components/Transform.d.ts +29 -0
- package/dist/components/Transform.d.ts.map +1 -0
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/css/CSS.d.ts +89 -0
- package/dist/css/CSS.d.ts.map +1 -0
- package/dist/css/CSSProperty.d.ts +42 -0
- package/dist/css/CSSProperty.d.ts.map +1 -0
- package/dist/css/StyleValueRegistry.d.ts +124 -0
- package/dist/css/StyleValueRegistry.d.ts.map +1 -0
- package/dist/css/cssom/CSSColorValue.d.ts +24 -0
- package/dist/css/cssom/CSSColorValue.d.ts.map +1 -0
- package/dist/css/cssom/CSSGradientValue.d.ts +40 -0
- package/dist/css/cssom/CSSGradientValue.d.ts.map +1 -0
- package/dist/css/cssom/CSSKeywordValue.d.ts +16 -0
- package/dist/css/cssom/CSSKeywordValue.d.ts.map +1 -0
- package/dist/css/cssom/CSSMathOperator.d.ts +12 -0
- package/dist/css/cssom/CSSMathOperator.d.ts.map +1 -0
- package/dist/css/cssom/CSSNumericSumValue.d.ts +8 -0
- package/dist/css/cssom/CSSNumericSumValue.d.ts.map +1 -0
- package/dist/css/cssom/CSSNumericValue.d.ts +213 -0
- package/dist/css/cssom/CSSNumericValue.d.ts.map +1 -0
- package/dist/css/cssom/CSSRGB.d.ts +26 -0
- package/dist/css/cssom/CSSRGB.d.ts.map +1 -0
- package/dist/css/cssom/CSSStyleValue.d.ts +54 -0
- package/dist/css/cssom/CSSStyleValue.d.ts.map +1 -0
- package/dist/css/cssom/index.d.ts +18 -0
- package/dist/css/cssom/index.d.ts.map +1 -0
- package/dist/css/cssom/types.d.ts +87 -0
- package/dist/css/cssom/types.d.ts.map +1 -0
- package/dist/css/index.d.ts +12 -0
- package/dist/css/index.d.ts.map +1 -0
- package/dist/css/interfaces.d.ts +117 -0
- package/dist/css/interfaces.d.ts.map +1 -0
- package/dist/css/layout/FragmentResult.d.ts +33 -0
- package/dist/css/layout/FragmentResult.d.ts.map +1 -0
- package/dist/css/layout/LayoutChildren.d.ts +24 -0
- package/dist/css/layout/LayoutChildren.d.ts.map +1 -0
- package/dist/css/layout/LayoutContext.d.ts +36 -0
- package/dist/css/layout/LayoutContext.d.ts.map +1 -0
- package/dist/css/layout/LayoutDefinition.d.ts +21 -0
- package/dist/css/layout/LayoutDefinition.d.ts.map +1 -0
- package/dist/css/layout/LayoutEdges.d.ts +25 -0
- package/dist/css/layout/LayoutEdges.d.ts.map +1 -0
- package/dist/css/layout/LayoutEngine.d.ts +42 -0
- package/dist/css/layout/LayoutEngine.d.ts.map +1 -0
- package/dist/css/layout/LayoutFragment.d.ts +27 -0
- package/dist/css/layout/LayoutFragment.d.ts.map +1 -0
- package/dist/css/layout/LayoutObject.d.ts +47 -0
- package/dist/css/layout/LayoutObject.d.ts.map +1 -0
- package/dist/css/layout/LayoutRegistry.d.ts +17 -0
- package/dist/css/layout/LayoutRegistry.d.ts.map +1 -0
- package/dist/css/layout/LayoutWorkTask.d.ts +15 -0
- package/dist/css/layout/LayoutWorkTask.d.ts.map +1 -0
- package/dist/css/layout/index.d.ts +12 -0
- package/dist/css/layout/index.d.ts.map +1 -0
- package/dist/css/layout/types.d.ts +105 -0
- package/dist/css/layout/types.d.ts.map +1 -0
- package/dist/css/parser/color.d.ts +7 -0
- package/dist/css/parser/color.d.ts.map +1 -0
- package/dist/css/parser/dimension.d.ts +38 -0
- package/dist/css/parser/dimension.d.ts.map +1 -0
- package/dist/css/parser/filter.d.ts +8 -0
- package/dist/css/parser/filter.d.ts.map +1 -0
- package/dist/css/parser/index.d.ts +16 -0
- package/dist/css/parser/index.d.ts.map +1 -0
- package/dist/css/parser/numeric.d.ts +20 -0
- package/dist/css/parser/numeric.d.ts.map +1 -0
- package/dist/css/parser/path.d.ts +6 -0
- package/dist/css/parser/path.d.ts.map +1 -0
- package/dist/css/parser/points.d.ts +13 -0
- package/dist/css/parser/points.d.ts.map +1 -0
- package/dist/css/parser/transform-origin.d.ts +7 -0
- package/dist/css/parser/transform-origin.d.ts.map +1 -0
- package/dist/css/parser/transform.d.ts +14 -0
- package/dist/css/parser/transform.d.ts.map +1 -0
- package/dist/css/parser/types.d.ts +3 -0
- package/dist/css/parser/types.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyClipPath.d.ts +21 -0
- package/dist/css/properties/CSSPropertyClipPath.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyColor.d.ts +5 -0
- package/dist/css/properties/CSSPropertyColor.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyFilter.d.ts +4 -0
- package/dist/css/properties/CSSPropertyFilter.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyLengthOrPercentage.d.ts +7 -0
- package/dist/css/properties/CSSPropertyLengthOrPercentage.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyLengthOrPercentage12.d.ts +12 -0
- package/dist/css/properties/CSSPropertyLengthOrPercentage12.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyLengthOrPercentage14.d.ts +22 -0
- package/dist/css/properties/CSSPropertyLengthOrPercentage14.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyLocalPosition.d.ts +7 -0
- package/dist/css/properties/CSSPropertyLocalPosition.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyOffsetDistance.d.ts +4 -0
- package/dist/css/properties/CSSPropertyOffsetDistance.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyOffsetPath.d.ts +4 -0
- package/dist/css/properties/CSSPropertyOffsetPath.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyOpacity.d.ts +7 -0
- package/dist/css/properties/CSSPropertyOpacity.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyPath.d.ts +4 -0
- package/dist/css/properties/CSSPropertyPath.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyPoints.d.ts +11 -0
- package/dist/css/properties/CSSPropertyPoints.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyShadowBlur.d.ts +3 -0
- package/dist/css/properties/CSSPropertyShadowBlur.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyText.d.ts +4 -0
- package/dist/css/properties/CSSPropertyText.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyTextTransform.d.ts +4 -0
- package/dist/css/properties/CSSPropertyTextTransform.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyTransform.d.ts +33 -0
- package/dist/css/properties/CSSPropertyTransform.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyTransformOrigin.d.ts +9 -0
- package/dist/css/properties/CSSPropertyTransformOrigin.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyZIndex.d.ts +4 -0
- package/dist/css/properties/CSSPropertyZIndex.d.ts.map +1 -0
- package/dist/css/properties/index.d.ts +19 -0
- package/dist/css/properties/index.d.ts.map +1 -0
- package/dist/display-objects/Circle.d.ts +18 -0
- package/dist/display-objects/Circle.d.ts.map +1 -0
- package/dist/display-objects/CustomElement.d.ts +25 -0
- package/dist/display-objects/CustomElement.d.ts.map +1 -0
- package/dist/display-objects/DisplayObject.d.ts +275 -0
- package/dist/display-objects/DisplayObject.d.ts.map +1 -0
- package/dist/display-objects/Ellipse.d.ts +20 -0
- package/dist/display-objects/Ellipse.d.ts.map +1 -0
- package/dist/display-objects/Group.d.ts +30 -0
- package/dist/display-objects/Group.d.ts.map +1 -0
- package/dist/display-objects/HTML.d.ts +42 -0
- package/dist/display-objects/HTML.d.ts.map +1 -0
- package/dist/display-objects/Image.d.ts +24 -0
- package/dist/display-objects/Image.d.ts.map +1 -0
- package/dist/display-objects/Line.d.ts +31 -0
- package/dist/display-objects/Line.d.ts.map +1 -0
- package/dist/display-objects/Path.d.ts +49 -0
- package/dist/display-objects/Path.d.ts.map +1 -0
- package/dist/display-objects/Polygon.d.ts +17 -0
- package/dist/display-objects/Polygon.d.ts.map +1 -0
- package/dist/display-objects/Polyline.d.ts +22 -0
- package/dist/display-objects/Polyline.d.ts.map +1 -0
- package/dist/display-objects/Rect.d.ts +25 -0
- package/dist/display-objects/Rect.d.ts.map +1 -0
- package/dist/display-objects/Text.d.ts +92 -0
- package/dist/display-objects/Text.d.ts.map +1 -0
- package/dist/display-objects/index.d.ts +14 -0
- package/dist/display-objects/index.d.ts.map +1 -0
- package/dist/dom/Animation.d.ts +133 -0
- package/dist/dom/Animation.d.ts.map +1 -0
- package/dist/dom/AnimationEffectTiming.d.ts +59 -0
- package/dist/dom/AnimationEffectTiming.d.ts.map +1 -0
- package/dist/dom/AnimationEvent.d.ts +12 -0
- package/dist/dom/AnimationEvent.d.ts.map +1 -0
- package/dist/dom/AnimationTimeline.d.ts +41 -0
- package/dist/dom/AnimationTimeline.d.ts.map +1 -0
- package/dist/dom/CustomElementRegistry.d.ts +16 -0
- package/dist/dom/CustomElementRegistry.d.ts.map +1 -0
- package/dist/dom/CustomEvent.d.ts +17 -0
- package/dist/dom/CustomEvent.d.ts.map +1 -0
- package/dist/dom/Document.d.ts +73 -0
- package/dist/dom/Document.d.ts.map +1 -0
- package/dist/dom/Element.d.ts +188 -0
- package/dist/dom/Element.d.ts.map +1 -0
- package/dist/dom/EventTarget.d.ts +41 -0
- package/dist/dom/EventTarget.d.ts.map +1 -0
- package/dist/dom/FederatedEvent.d.ts +146 -0
- package/dist/dom/FederatedEvent.d.ts.map +1 -0
- package/dist/dom/FederatedMouseEvent.d.ts +53 -0
- package/dist/dom/FederatedMouseEvent.d.ts.map +1 -0
- package/dist/dom/FederatedPointerEvent.d.ts +76 -0
- package/dist/dom/FederatedPointerEvent.d.ts.map +1 -0
- package/dist/dom/FederatedWheelEvent.d.ts +21 -0
- package/dist/dom/FederatedWheelEvent.d.ts.map +1 -0
- package/dist/dom/KeyframeEffect.d.ts +48 -0
- package/dist/dom/KeyframeEffect.d.ts.map +1 -0
- package/dist/dom/KeyframeList.d.ts +3 -0
- package/dist/dom/KeyframeList.d.ts.map +1 -0
- package/dist/dom/MutationEvent.d.ts +16 -0
- package/dist/dom/MutationEvent.d.ts.map +1 -0
- package/dist/dom/MutationObserver.d.ts +37 -0
- package/dist/dom/MutationObserver.d.ts.map +1 -0
- package/dist/dom/MutationRecord.d.ts +15 -0
- package/dist/dom/MutationRecord.d.ts.map +1 -0
- package/dist/dom/Node.d.ts +139 -0
- package/dist/dom/Node.d.ts.map +1 -0
- package/dist/dom/index.d.ts +21 -0
- package/dist/dom/index.d.ts.map +1 -0
- package/dist/dom/interfaces.d.ts +373 -0
- package/dist/dom/interfaces.d.ts.map +1 -0
- package/dist/global-module.d.ts +2 -0
- package/dist/global-module.d.ts.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +20766 -0
- package/dist/index.js +20942 -0
- package/dist/index.umd.js +29076 -0
- package/dist/index.umd.min.js +14 -28
- package/dist/plugins/CullingPlugin.d.ts +18 -0
- package/dist/plugins/CullingPlugin.d.ts.map +1 -0
- package/dist/plugins/DirtyCheckPlugin.d.ts +11 -0
- package/dist/plugins/DirtyCheckPlugin.d.ts.map +1 -0
- package/dist/plugins/EventPlugin.d.ts +30 -0
- package/dist/plugins/EventPlugin.d.ts.map +1 -0
- package/dist/plugins/FrustumCullingStrategy.d.ts +22 -0
- package/dist/plugins/FrustumCullingStrategy.d.ts.map +1 -0
- package/dist/plugins/PrepareRendererPlugin.d.ts +8 -0
- package/dist/plugins/PrepareRendererPlugin.d.ts.map +1 -0
- package/dist/services/ContextService.d.ts +14 -0
- package/dist/services/ContextService.d.ts.map +1 -0
- package/dist/services/EventService.d.ts +72 -0
- package/dist/services/EventService.d.ts.map +1 -0
- package/dist/services/OffscreenCanvasCreator.d.ts +14 -0
- package/dist/services/OffscreenCanvasCreator.d.ts.map +1 -0
- package/dist/services/RenderingContext.d.ts +27 -0
- package/dist/services/RenderingContext.d.ts.map +1 -0
- package/dist/services/RenderingService.d.ts +103 -0
- package/dist/services/RenderingService.d.ts.map +1 -0
- package/dist/services/SceneGraphSelector.d.ts +24 -0
- package/dist/services/SceneGraphSelector.d.ts.map +1 -0
- package/dist/services/SceneGraphService.d.ts +154 -0
- package/dist/services/SceneGraphService.d.ts.map +1 -0
- package/dist/services/TextService.d.ts +37 -0
- package/dist/services/TextService.d.ts.map +1 -0
- package/dist/services/aabb/CircleUpdater.d.ts +9 -0
- package/dist/services/aabb/CircleUpdater.d.ts.map +1 -0
- package/dist/services/aabb/EllipseUpdater.d.ts +9 -0
- package/dist/services/aabb/EllipseUpdater.d.ts.map +1 -0
- package/dist/services/aabb/LineUpdater.d.ts +9 -0
- package/dist/services/aabb/LineUpdater.d.ts.map +1 -0
- package/dist/services/aabb/PathUpdater.d.ts +9 -0
- package/dist/services/aabb/PathUpdater.d.ts.map +1 -0
- package/dist/services/aabb/PolylineUpdater.d.ts +9 -0
- package/dist/services/aabb/PolylineUpdater.d.ts.map +1 -0
- package/dist/services/aabb/RectUpdater.d.ts +9 -0
- package/dist/services/aabb/RectUpdater.d.ts.map +1 -0
- package/dist/services/aabb/TextUpdater.d.ts +22 -0
- package/dist/services/aabb/TextUpdater.d.ts.map +1 -0
- package/dist/services/aabb/index.d.ts +9 -0
- package/dist/services/aabb/index.d.ts.map +1 -0
- package/dist/services/aabb/interfaces.d.ts +16 -0
- package/dist/services/aabb/interfaces.d.ts.map +1 -0
- package/dist/services/index.d.ts +11 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/shapes/AABB.d.ts +36 -0
- package/dist/shapes/AABB.d.ts.map +1 -0
- package/dist/shapes/BoundingSphere.d.ts +9 -0
- package/dist/shapes/BoundingSphere.d.ts.map +1 -0
- package/dist/shapes/Frustum.d.ts +17 -0
- package/dist/shapes/Frustum.d.ts.map +1 -0
- package/dist/shapes/Plane.d.ts +15 -0
- package/dist/shapes/Plane.d.ts.map +1 -0
- package/dist/shapes/Point.d.ts +12 -0
- package/dist/shapes/Point.d.ts.map +1 -0
- package/dist/shapes/Ray.d.ts +25 -0
- package/dist/shapes/Ray.d.ts.map +1 -0
- package/dist/shapes/Rectangle.d.ts +13 -0
- package/dist/shapes/Rectangle.d.ts.map +1 -0
- package/dist/shapes/index.d.ts +8 -0
- package/dist/shapes/index.d.ts.map +1 -0
- package/dist/types.d.ts +270 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/animation.d.ts +16 -0
- package/dist/utils/animation.d.ts.map +1 -0
- package/dist/utils/assert.d.ts +10 -0
- package/dist/utils/assert.d.ts.map +1 -0
- package/dist/utils/bezier-easing.d.ts +21 -0
- package/dist/utils/bezier-easing.d.ts.map +1 -0
- package/dist/utils/canvas.d.ts +7 -0
- package/dist/utils/canvas.d.ts.map +1 -0
- package/dist/utils/custom-easing.d.ts +16 -0
- package/dist/utils/custom-easing.d.ts.map +1 -0
- package/dist/utils/deferred.d.ts +44 -0
- package/dist/utils/deferred.d.ts.map +1 -0
- package/dist/utils/dom.d.ts +3 -0
- package/dist/utils/dom.d.ts.map +1 -0
- package/dist/utils/event.d.ts +36 -0
- package/dist/utils/event.d.ts.map +1 -0
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/interpolation.d.ts +5 -0
- package/dist/utils/interpolation.d.ts.map +1 -0
- package/dist/utils/math.d.ts +30 -0
- package/dist/utils/math.d.ts.map +1 -0
- package/dist/utils/path.d.ts +16 -0
- package/dist/utils/path.d.ts.map +1 -0
- package/dist/utils/string.d.ts +3 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/tapable/AsyncParallelHook.d.ts +6 -0
- package/dist/utils/tapable/AsyncParallelHook.d.ts.map +1 -0
- package/dist/utils/tapable/AsyncSeriesWaterfallHook.d.ts +6 -0
- package/dist/utils/tapable/AsyncSeriesWaterfallHook.d.ts.map +1 -0
- package/dist/utils/tapable/Hook.d.ts +52 -0
- package/dist/utils/tapable/Hook.d.ts.map +1 -0
- package/dist/utils/tapable/HookCodeFactory.d.ts +47 -0
- package/dist/utils/tapable/HookCodeFactory.d.ts.map +1 -0
- package/dist/utils/tapable/SyncHook.d.ts +6 -0
- package/dist/utils/tapable/SyncHook.d.ts.map +1 -0
- package/dist/utils/tapable/SyncWaterfallHook.d.ts +6 -0
- package/dist/utils/tapable/SyncWaterfallHook.d.ts.map +1 -0
- package/dist/utils/tapable/index.d.ts +5 -0
- package/dist/utils/tapable/index.d.ts.map +1 -0
- package/dist/utils/text.d.ts +3 -0
- package/dist/utils/text.d.ts.map +1 -0
- package/package.json +28 -35
- package/es/AbstractRenderer.d.ts +0 -37
- package/es/AbstractRenderer.js +0 -62
- package/es/Canvas.d.ts +0 -149
- package/es/Canvas.js +0 -518
- package/es/DisplayObjectPool.d.ts +0 -7
- package/es/DisplayObjectPool.js +0 -27
- package/es/camera/Camera.d.ts +0 -327
- package/es/camera/Camera.js +0 -1154
- package/es/camera/Landmark.d.ts +0 -23
- package/es/camera/Landmark.js +0 -1
- package/es/camera/index.d.ts +0 -2
- package/es/camera/index.js +0 -2
- package/es/canvas-module.d.ts +0 -1
- package/es/canvas-module.js +0 -25
- package/es/components/Cullable.d.ts +0 -14
- package/es/components/Cullable.js +0 -28
- package/es/components/Geometry.d.ts +0 -12
- package/es/components/Geometry.js +0 -10
- package/es/components/Renderable.d.ts +0 -24
- package/es/components/Renderable.js +0 -18
- package/es/components/Sortable.d.ts +0 -20
- package/es/components/Sortable.js +0 -20
- package/es/components/Transform.d.ts +0 -28
- package/es/components/Transform.js +0 -64
- package/es/components/index.d.ts +0 -5
- package/es/components/index.js +0 -5
- package/es/css/CSS.d.ts +0 -87
- package/es/css/CSS.js +0 -121
- package/es/css/CSSProperty.d.ts +0 -41
- package/es/css/CSSProperty.js +0 -1
- package/es/css/StyleValueRegistry.d.ts +0 -92
- package/es/css/StyleValueRegistry.js +0 -882
- package/es/css/cssom/CSSColorValue.d.ts +0 -23
- package/es/css/cssom/CSSColorValue.js +0 -43
- package/es/css/cssom/CSSGradientValue.d.ts +0 -39
- package/es/css/cssom/CSSGradientValue.js +0 -54
- package/es/css/cssom/CSSImageValue.d.ts +0 -1
- package/es/css/cssom/CSSImageValue.js +0 -0
- package/es/css/cssom/CSSKeywordValue.d.ts +0 -15
- package/es/css/cssom/CSSKeywordValue.js +0 -37
- package/es/css/cssom/CSSMathOperator.d.ts +0 -11
- package/es/css/cssom/CSSMathOperator.js +0 -32
- package/es/css/cssom/CSSNumericSumValue.d.ts +0 -7
- package/es/css/cssom/CSSNumericSumValue.js +0 -1
- package/es/css/cssom/CSSNumericValue.d.ts +0 -212
- package/es/css/cssom/CSSNumericValue.js +0 -1661
- package/es/css/cssom/CSSRGB.d.ts +0 -25
- package/es/css/cssom/CSSRGB.js +0 -48
- package/es/css/cssom/CSSStyleValue.d.ts +0 -53
- package/es/css/cssom/CSSStyleValue.js +0 -625
- package/es/css/cssom/CSSTransformComponent.d.ts +0 -22
- package/es/css/cssom/CSSTransformComponent.js +0 -32
- package/es/css/cssom/CSSTransformValue.d.ts +0 -30
- package/es/css/cssom/CSSTransformValue.js +0 -48
- package/es/css/cssom/CSSTranslate.d.ts +0 -15
- package/es/css/cssom/CSSTranslate.js +0 -44
- package/es/css/cssom/index.d.ts +0 -19
- package/es/css/cssom/index.js +0 -19
- package/es/css/cssom/types.d.ts +0 -86
- package/es/css/cssom/types.js +0 -119
- package/es/css/index.d.ts +0 -11
- package/es/css/index.js +0 -11
- package/es/css/interfaces.d.ts +0 -116
- package/es/css/interfaces.js +0 -77
- package/es/css/layout/FragmentResult.d.ts +0 -32
- package/es/css/layout/FragmentResult.js +0 -32
- package/es/css/layout/LayoutChildren.d.ts +0 -23
- package/es/css/layout/LayoutChildren.js +0 -55
- package/es/css/layout/LayoutContext.d.ts +0 -35
- package/es/css/layout/LayoutContext.js +0 -35
- package/es/css/layout/LayoutDefinition.d.ts +0 -20
- package/es/css/layout/LayoutDefinition.js +0 -9
- package/es/css/layout/LayoutEdges.d.ts +0 -24
- package/es/css/layout/LayoutEdges.js +0 -41
- package/es/css/layout/LayoutEngine.d.ts +0 -41
- package/es/css/layout/LayoutEngine.js +0 -332
- package/es/css/layout/LayoutFragment.d.ts +0 -26
- package/es/css/layout/LayoutFragment.js +0 -28
- package/es/css/layout/LayoutObject.d.ts +0 -46
- package/es/css/layout/LayoutObject.js +0 -172
- package/es/css/layout/LayoutRegistry.d.ts +0 -16
- package/es/css/layout/LayoutRegistry.js +0 -78
- package/es/css/layout/LayoutWorkTask.d.ts +0 -14
- package/es/css/layout/LayoutWorkTask.js +0 -1
- package/es/css/layout/index.d.ts +0 -11
- package/es/css/layout/index.js +0 -11
- package/es/css/layout/types.d.ts +0 -104
- package/es/css/layout/types.js +0 -66
- package/es/css/parser/color.d.ts +0 -6
- package/es/css/parser/color.js +0 -241
- package/es/css/parser/dimension.d.ts +0 -37
- package/es/css/parser/dimension.js +0 -149
- package/es/css/parser/filter.d.ts +0 -7
- package/es/css/parser/filter.js +0 -43
- package/es/css/parser/index.d.ts +0 -15
- package/es/css/parser/index.js +0 -15
- package/es/css/parser/numeric.d.ts +0 -19
- package/es/css/parser/numeric.js +0 -62
- package/es/css/parser/path.d.ts +0 -5
- package/es/css/parser/path.js +0 -207
- package/es/css/parser/points.d.ts +0 -12
- package/es/css/parser/points.js +0 -58
- package/es/css/parser/transform-origin.d.ts +0 -6
- package/es/css/parser/transform-origin.js +0 -45
- package/es/css/parser/transform.d.ts +0 -13
- package/es/css/parser/transform.js +0 -289
- package/es/css/parser/types.d.ts +0 -2
- package/es/css/parser/types.js +0 -1
- package/es/css/properties/CSSPropertyClipPath.d.ts +0 -22
- package/es/css/properties/CSSPropertyClipPath.js +0 -56
- package/es/css/properties/CSSPropertyColor.d.ts +0 -14
- package/es/css/properties/CSSPropertyColor.js +0 -30
- package/es/css/properties/CSSPropertyFilter.d.ts +0 -6
- package/es/css/properties/CSSPropertyFilter.js +0 -16
- package/es/css/properties/CSSPropertyLengthOrPercentage.d.ts +0 -20
- package/es/css/properties/CSSPropertyLengthOrPercentage.js +0 -95
- package/es/css/properties/CSSPropertyLengthOrPercentage12.d.ts +0 -15
- package/es/css/properties/CSSPropertyLengthOrPercentage12.js +0 -38
- package/es/css/properties/CSSPropertyLengthOrPercentage14.d.ts +0 -25
- package/es/css/properties/CSSPropertyLengthOrPercentage14.js +0 -42
- package/es/css/properties/CSSPropertyLocalPosition.d.ts +0 -13
- package/es/css/properties/CSSPropertyLocalPosition.js +0 -85
- package/es/css/properties/CSSPropertyOffsetDistance.d.ts +0 -9
- package/es/css/properties/CSSPropertyOffsetDistance.js +0 -34
- package/es/css/properties/CSSPropertyOffsetPath.d.ts +0 -5
- package/es/css/properties/CSSPropertyOffsetPath.js +0 -31
- package/es/css/properties/CSSPropertyOpacity.d.ts +0 -10
- package/es/css/properties/CSSPropertyOpacity.js +0 -20
- package/es/css/properties/CSSPropertyPath.d.ts +0 -27
- package/es/css/properties/CSSPropertyPath.js +0 -58
- package/es/css/properties/CSSPropertyPoints.d.ts +0 -18
- package/es/css/properties/CSSPropertyPoints.js +0 -30
- package/es/css/properties/CSSPropertyShadowBlur.d.ts +0 -4
- package/es/css/properties/CSSPropertyShadowBlur.js +0 -22
- package/es/css/properties/CSSPropertyText.d.ts +0 -7
- package/es/css/properties/CSSPropertyText.js +0 -30
- package/es/css/properties/CSSPropertyTextTransform.d.ts +0 -5
- package/es/css/properties/CSSPropertyTextTransform.js +0 -29
- package/es/css/properties/CSSPropertyTransform.d.ts +0 -38
- package/es/css/properties/CSSPropertyTransform.js +0 -128
- package/es/css/properties/CSSPropertyTransformOrigin.d.ts +0 -11
- package/es/css/properties/CSSPropertyTransformOrigin.js +0 -21
- package/es/css/properties/CSSPropertyVisibility.d.ts +0 -13
- package/es/css/properties/CSSPropertyVisibility.js +0 -24
- package/es/css/properties/CSSPropertyZIndex.d.ts +0 -8
- package/es/css/properties/CSSPropertyZIndex.js +0 -33
- package/es/css/properties/index.d.ts +0 -18
- package/es/css/properties/index.js +0 -18
- package/es/display-objects/Circle.d.ts +0 -17
- package/es/display-objects/Circle.js +0 -34
- package/es/display-objects/CustomElement.d.ts +0 -26
- package/es/display-objects/CustomElement.js +0 -102
- package/es/display-objects/DisplayObject.d.ts +0 -274
- package/es/display-objects/DisplayObject.js +0 -887
- package/es/display-objects/Ellipse.d.ts +0 -19
- package/es/display-objects/Ellipse.js +0 -35
- package/es/display-objects/Group.d.ts +0 -29
- package/es/display-objects/Group.js +0 -42
- package/es/display-objects/HTML.d.ts +0 -41
- package/es/display-objects/HTML.js +0 -100
- package/es/display-objects/Image.d.ts +0 -23
- package/es/display-objects/Image.js +0 -34
- package/es/display-objects/Line.d.ts +0 -30
- package/es/display-objects/Line.js +0 -63
- package/es/display-objects/Path.d.ts +0 -48
- package/es/display-objects/Path.js +0 -131
- package/es/display-objects/Polygon.d.ts +0 -16
- package/es/display-objects/Polygon.js +0 -31
- package/es/display-objects/Polyline.d.ts +0 -21
- package/es/display-objects/Polyline.js +0 -74
- package/es/display-objects/Rect.d.ts +0 -24
- package/es/display-objects/Rect.js +0 -34
- package/es/display-objects/Text.d.ts +0 -91
- package/es/display-objects/Text.js +0 -118
- package/es/display-objects/index.d.ts +0 -13
- package/es/display-objects/index.js +0 -13
- package/es/dom/Animation.d.ts +0 -132
- package/es/dom/Animation.js +0 -503
- package/es/dom/AnimationEffectTiming.d.ts +0 -58
- package/es/dom/AnimationEffectTiming.js +0 -68
- package/es/dom/AnimationEvent.d.ts +0 -11
- package/es/dom/AnimationEvent.js +0 -34
- package/es/dom/AnimationTimeline.d.ts +0 -40
- package/es/dom/AnimationTimeline.js +0 -217
- package/es/dom/CustomElementRegistry.d.ts +0 -15
- package/es/dom/CustomElementRegistry.js +0 -42
- package/es/dom/CustomEvent.d.ts +0 -16
- package/es/dom/CustomEvent.js +0 -35
- package/es/dom/Document.d.ts +0 -72
- package/es/dom/Document.js +0 -316
- package/es/dom/Element.d.ts +0 -187
- package/es/dom/Element.js +0 -604
- package/es/dom/EventTarget.d.ts +0 -40
- package/es/dom/EventTarget.js +0 -157
- package/es/dom/FederatedEvent.d.ts +0 -145
- package/es/dom/FederatedEvent.js +0 -222
- package/es/dom/FederatedMouseEvent.d.ts +0 -52
- package/es/dom/FederatedMouseEvent.js +0 -124
- package/es/dom/FederatedPointerEvent.d.ts +0 -75
- package/es/dom/FederatedPointerEvent.js +0 -61
- package/es/dom/FederatedTouchEvent.d.ts +0 -15
- package/es/dom/FederatedTouchEvent.js +0 -19
- package/es/dom/FederatedWheelEvent.d.ts +0 -20
- package/es/dom/FederatedWheelEvent.js +0 -27
- package/es/dom/KeyframeEffect.d.ts +0 -47
- package/es/dom/KeyframeEffect.js +0 -174
- package/es/dom/KeyframeList.d.ts +0 -2
- package/es/dom/KeyframeList.js +0 -176
- package/es/dom/MutationEvent.d.ts +0 -15
- package/es/dom/MutationEvent.js +0 -29
- package/es/dom/MutationObserver.d.ts +0 -36
- package/es/dom/MutationObserver.js +0 -416
- package/es/dom/MutationRecord.d.ts +0 -14
- package/es/dom/MutationRecord.js +0 -31
- package/es/dom/Node.d.ts +0 -138
- package/es/dom/Node.js +0 -387
- package/es/dom/index.d.ts +0 -20
- package/es/dom/index.js +0 -20
- package/es/dom/interfaces.d.ts +0 -372
- package/es/dom/interfaces.js +0 -56
- package/es/global-module.d.ts +0 -1
- package/es/global-module.js +0 -155
- package/es/index.d.ts +0 -18
- package/es/index.js +0 -21
- package/es/plugins/CullingPlugin.d.ts +0 -17
- package/es/plugins/CullingPlugin.js +0 -58
- package/es/plugins/DirtyCheckPlugin.d.ts +0 -10
- package/es/plugins/DirtyCheckPlugin.js +0 -55
- package/es/plugins/EventPlugin.d.ts +0 -30
- package/es/plugins/EventPlugin.js +0 -374
- package/es/plugins/FrustumCullingStrategy.d.ts +0 -21
- package/es/plugins/FrustumCullingStrategy.js +0 -108
- package/es/plugins/PrepareRendererPlugin.d.ts +0 -7
- package/es/plugins/PrepareRendererPlugin.js +0 -79
- package/es/services/ContextService.d.ts +0 -13
- package/es/services/ContextService.js +0 -5
- package/es/services/EventService.d.ts +0 -73
- package/es/services/EventService.js +0 -1238
- package/es/services/OffscreenCanvasCreator.d.ts +0 -13
- package/es/services/OffscreenCanvasCreator.js +0 -58
- package/es/services/RenderingContext.d.ts +0 -26
- package/es/services/RenderingContext.js +0 -14
- package/es/services/RenderingService.d.ts +0 -102
- package/es/services/RenderingService.js +0 -231
- package/es/services/SceneGraphSelector.d.ts +0 -23
- package/es/services/SceneGraphSelector.js +0 -100
- package/es/services/SceneGraphService.d.ts +0 -153
- package/es/services/SceneGraphService.js +0 -819
- package/es/services/TextService.d.ts +0 -36
- package/es/services/TextService.js +0 -350
- package/es/services/aabb/CircleUpdater.d.ts +0 -8
- package/es/services/aabb/CircleUpdater.js +0 -30
- package/es/services/aabb/EllipseUpdater.d.ts +0 -8
- package/es/services/aabb/EllipseUpdater.js +0 -31
- package/es/services/aabb/LineUpdater.d.ts +0 -8
- package/es/services/aabb/LineUpdater.js +0 -37
- package/es/services/aabb/PathUpdater.d.ts +0 -8
- package/es/services/aabb/PathUpdater.js +0 -168
- package/es/services/aabb/PolylineUpdater.d.ts +0 -8
- package/es/services/aabb/PolylineUpdater.js +0 -46
- package/es/services/aabb/RectUpdater.d.ts +0 -8
- package/es/services/aabb/RectUpdater.js +0 -72
- package/es/services/aabb/TextUpdater.d.ts +0 -21
- package/es/services/aabb/TextUpdater.js +0 -136
- package/es/services/aabb/index.d.ts +0 -8
- package/es/services/aabb/index.js +0 -8
- package/es/services/aabb/interfaces.d.ts +0 -15
- package/es/services/aabb/interfaces.js +0 -3
- package/es/services/index.d.ts +0 -10
- package/es/services/index.js +0 -10
- package/es/shapes/AABB.d.ts +0 -35
- package/es/shapes/AABB.js +0 -230
- package/es/shapes/BoundingSphere.d.ts +0 -8
- package/es/shapes/BoundingSphere.js +0 -31
- package/es/shapes/Frustum.d.ts +0 -16
- package/es/shapes/Frustum.js +0 -79
- package/es/shapes/Plane.d.ts +0 -14
- package/es/shapes/Plane.js +0 -42
- package/es/shapes/Point.d.ts +0 -11
- package/es/shapes/Point.js +0 -31
- package/es/shapes/Ray.d.ts +0 -24
- package/es/shapes/Ray.js +0 -138
- package/es/shapes/Rectangle.d.ts +0 -12
- package/es/shapes/Rectangle.js +0 -20
- package/es/shapes/index.d.ts +0 -7
- package/es/shapes/index.js +0 -7
- package/es/types.d.ts +0 -289
- package/es/types.js +0 -54
- package/es/utils/animation.d.ts +0 -15
- package/es/utils/animation.js +0 -251
- package/es/utils/assert.d.ts +0 -9
- package/es/utils/assert.js +0 -33
- package/es/utils/bezier-easing.d.ts +0 -20
- package/es/utils/bezier-easing.js +0 -90
- package/es/utils/canvas.d.ts +0 -6
- package/es/utils/canvas.js +0 -18
- package/es/utils/custom-easing.d.ts +0 -64
- package/es/utils/custom-easing.js +0 -317
- package/es/utils/deferred.d.ts +0 -43
- package/es/utils/deferred.js +0 -117
- package/es/utils/dom.d.ts +0 -2
- package/es/utils/dom.js +0 -8
- package/es/utils/event.d.ts +0 -45
- package/es/utils/event.js +0 -9
- package/es/utils/index.d.ts +0 -10
- package/es/utils/index.js +0 -10
- package/es/utils/interpolation.d.ts +0 -4
- package/es/utils/interpolation.js +0 -212
- package/es/utils/math.d.ts +0 -29
- package/es/utils/math.js +0 -236
- package/es/utils/path.d.ts +0 -15
- package/es/utils/path.js +0 -387
- package/es/utils/string.d.ts +0 -2
- package/es/utils/string.js +0 -17
- package/es/utils/text.d.ts +0 -2
- package/es/utils/text.js +0 -29
- package/lib/AbstractRenderer.d.ts +0 -37
- package/lib/AbstractRenderer.js +0 -69
- package/lib/Canvas.d.ts +0 -149
- package/lib/Canvas.js +0 -540
- package/lib/DisplayObjectPool.d.ts +0 -7
- package/lib/DisplayObjectPool.js +0 -35
- package/lib/camera/Camera.d.ts +0 -327
- package/lib/camera/Camera.js +0 -1232
- package/lib/camera/Landmark.d.ts +0 -23
- package/lib/camera/Landmark.js +0 -5
- package/lib/camera/index.d.ts +0 -2
- package/lib/camera/index.js +0 -31
- package/lib/canvas-module.d.ts +0 -1
- package/lib/canvas-module.js +0 -41
- package/lib/components/Cullable.d.ts +0 -14
- package/lib/components/Cullable.js +0 -36
- package/lib/components/Geometry.d.ts +0 -12
- package/lib/components/Geometry.js +0 -17
- package/lib/components/Renderable.d.ts +0 -24
- package/lib/components/Renderable.js +0 -25
- package/lib/components/Sortable.d.ts +0 -20
- package/lib/components/Sortable.js +0 -27
- package/lib/components/Transform.d.ts +0 -28
- package/lib/components/Transform.js +0 -71
- package/lib/components/index.d.ts +0 -5
- package/lib/components/index.js +0 -70
- package/lib/css/CSS.d.ts +0 -87
- package/lib/css/CSS.js +0 -135
- package/lib/css/CSSProperty.d.ts +0 -41
- package/lib/css/CSSProperty.js +0 -5
- package/lib/css/StyleValueRegistry.d.ts +0 -92
- package/lib/css/StyleValueRegistry.js +0 -909
- package/lib/css/cssom/CSSColorValue.d.ts +0 -23
- package/lib/css/cssom/CSSColorValue.js +0 -51
- package/lib/css/cssom/CSSGradientValue.d.ts +0 -39
- package/lib/css/cssom/CSSGradientValue.js +0 -64
- package/lib/css/cssom/CSSImageValue.d.ts +0 -1
- package/lib/css/cssom/CSSImageValue.js +0 -1
- package/lib/css/cssom/CSSKeywordValue.d.ts +0 -15
- package/lib/css/cssom/CSSKeywordValue.js +0 -45
- package/lib/css/cssom/CSSMathOperator.d.ts +0 -11
- package/lib/css/cssom/CSSMathOperator.js +0 -40
- package/lib/css/cssom/CSSNumericSumValue.d.ts +0 -7
- package/lib/css/cssom/CSSNumericSumValue.js +0 -5
- package/lib/css/cssom/CSSNumericValue.d.ts +0 -212
- package/lib/css/cssom/CSSNumericValue.js +0 -1685
- package/lib/css/cssom/CSSRGB.d.ts +0 -25
- package/lib/css/cssom/CSSRGB.js +0 -56
- package/lib/css/cssom/CSSStyleValue.d.ts +0 -53
- package/lib/css/cssom/CSSStyleValue.js +0 -634
- package/lib/css/cssom/CSSTransformComponent.d.ts +0 -22
- package/lib/css/cssom/CSSTransformComponent.js +0 -39
- package/lib/css/cssom/CSSTransformValue.d.ts +0 -30
- package/lib/css/cssom/CSSTransformValue.js +0 -56
- package/lib/css/cssom/CSSTranslate.d.ts +0 -15
- package/lib/css/cssom/CSSTranslate.js +0 -53
- package/lib/css/cssom/index.d.ts +0 -19
- package/lib/css/cssom/index.js +0 -148
- package/lib/css/cssom/types.d.ts +0 -86
- package/lib/css/cssom/types.js +0 -130
- package/lib/css/index.d.ts +0 -11
- package/lib/css/index.js +0 -109
- package/lib/css/interfaces.d.ts +0 -116
- package/lib/css/interfaces.js +0 -87
- package/lib/css/layout/FragmentResult.d.ts +0 -32
- package/lib/css/layout/FragmentResult.js +0 -51
- package/lib/css/layout/LayoutChildren.d.ts +0 -23
- package/lib/css/layout/LayoutChildren.js +0 -72
- package/lib/css/layout/LayoutContext.d.ts +0 -35
- package/lib/css/layout/LayoutContext.js +0 -49
- package/lib/css/layout/LayoutDefinition.d.ts +0 -20
- package/lib/css/layout/LayoutDefinition.js +0 -16
- package/lib/css/layout/LayoutEdges.d.ts +0 -24
- package/lib/css/layout/LayoutEdges.js +0 -56
- package/lib/css/layout/LayoutEngine.d.ts +0 -41
- package/lib/css/layout/LayoutEngine.js +0 -345
- package/lib/css/layout/LayoutFragment.d.ts +0 -26
- package/lib/css/layout/LayoutFragment.js +0 -44
- package/lib/css/layout/LayoutObject.d.ts +0 -46
- package/lib/css/layout/LayoutObject.js +0 -182
- package/lib/css/layout/LayoutRegistry.d.ts +0 -16
- package/lib/css/layout/LayoutRegistry.js +0 -87
- package/lib/css/layout/LayoutWorkTask.d.ts +0 -14
- package/lib/css/layout/LayoutWorkTask.js +0 -5
- package/lib/css/layout/index.d.ts +0 -11
- package/lib/css/layout/index.js +0 -148
- package/lib/css/layout/types.d.ts +0 -104
- package/lib/css/layout/types.js +0 -74
- package/lib/css/parser/color.d.ts +0 -6
- package/lib/css/parser/color.js +0 -260
- package/lib/css/parser/dimension.d.ts +0 -37
- package/lib/css/parser/dimension.js +0 -175
- package/lib/css/parser/filter.d.ts +0 -7
- package/lib/css/parser/filter.js +0 -56
- package/lib/css/parser/index.d.ts +0 -15
- package/lib/css/parser/index.js +0 -122
- package/lib/css/parser/numeric.d.ts +0 -19
- package/lib/css/parser/numeric.js +0 -81
- package/lib/css/parser/path.d.ts +0 -5
- package/lib/css/parser/path.js +0 -221
- package/lib/css/parser/points.d.ts +0 -12
- package/lib/css/parser/points.js +0 -69
- package/lib/css/parser/transform-origin.d.ts +0 -6
- package/lib/css/parser/transform-origin.js +0 -54
- package/lib/css/parser/transform.d.ts +0 -13
- package/lib/css/parser/transform.js +0 -303
- package/lib/css/parser/types.d.ts +0 -2
- package/lib/css/parser/types.js +0 -5
- package/lib/css/properties/CSSPropertyClipPath.d.ts +0 -22
- package/lib/css/properties/CSSPropertyClipPath.js +0 -66
- package/lib/css/properties/CSSPropertyColor.d.ts +0 -14
- package/lib/css/properties/CSSPropertyColor.js +0 -40
- package/lib/css/properties/CSSPropertyFilter.d.ts +0 -6
- package/lib/css/properties/CSSPropertyFilter.js +0 -25
- package/lib/css/properties/CSSPropertyLengthOrPercentage.d.ts +0 -20
- package/lib/css/properties/CSSPropertyLengthOrPercentage.js +0 -105
- package/lib/css/properties/CSSPropertyLengthOrPercentage12.d.ts +0 -15
- package/lib/css/properties/CSSPropertyLengthOrPercentage12.js +0 -48
- package/lib/css/properties/CSSPropertyLengthOrPercentage14.d.ts +0 -25
- package/lib/css/properties/CSSPropertyLengthOrPercentage14.js +0 -52
- package/lib/css/properties/CSSPropertyLocalPosition.d.ts +0 -13
- package/lib/css/properties/CSSPropertyLocalPosition.js +0 -96
- package/lib/css/properties/CSSPropertyOffsetDistance.d.ts +0 -9
- package/lib/css/properties/CSSPropertyOffsetDistance.js +0 -44
- package/lib/css/properties/CSSPropertyOffsetPath.d.ts +0 -5
- package/lib/css/properties/CSSPropertyOffsetPath.js +0 -39
- package/lib/css/properties/CSSPropertyOpacity.d.ts +0 -10
- package/lib/css/properties/CSSPropertyOpacity.js +0 -29
- package/lib/css/properties/CSSPropertyPath.d.ts +0 -27
- package/lib/css/properties/CSSPropertyPath.js +0 -70
- package/lib/css/properties/CSSPropertyPoints.d.ts +0 -18
- package/lib/css/properties/CSSPropertyPoints.js +0 -40
- package/lib/css/properties/CSSPropertyShadowBlur.d.ts +0 -4
- package/lib/css/properties/CSSPropertyShadowBlur.js +0 -32
- package/lib/css/properties/CSSPropertyText.d.ts +0 -7
- package/lib/css/properties/CSSPropertyText.js +0 -39
- package/lib/css/properties/CSSPropertyTextTransform.d.ts +0 -5
- package/lib/css/properties/CSSPropertyTextTransform.js +0 -38
- package/lib/css/properties/CSSPropertyTransform.d.ts +0 -38
- package/lib/css/properties/CSSPropertyTransform.js +0 -138
- package/lib/css/properties/CSSPropertyTransformOrigin.d.ts +0 -11
- package/lib/css/properties/CSSPropertyTransformOrigin.js +0 -30
- package/lib/css/properties/CSSPropertyVisibility.d.ts +0 -13
- package/lib/css/properties/CSSPropertyVisibility.js +0 -32
- package/lib/css/properties/CSSPropertyZIndex.d.ts +0 -8
- package/lib/css/properties/CSSPropertyZIndex.js +0 -42
- package/lib/css/properties/index.d.ts +0 -18
- package/lib/css/properties/index.js +0 -239
- package/lib/display-objects/Circle.d.ts +0 -17
- package/lib/display-objects/Circle.js +0 -42
- package/lib/display-objects/CustomElement.d.ts +0 -26
- package/lib/display-objects/CustomElement.js +0 -109
- package/lib/display-objects/DisplayObject.d.ts +0 -274
- package/lib/display-objects/DisplayObject.js +0 -910
- package/lib/display-objects/Ellipse.d.ts +0 -19
- package/lib/display-objects/Ellipse.js +0 -43
- package/lib/display-objects/Group.d.ts +0 -29
- package/lib/display-objects/Group.js +0 -50
- package/lib/display-objects/HTML.d.ts +0 -41
- package/lib/display-objects/HTML.js +0 -111
- package/lib/display-objects/Image.d.ts +0 -23
- package/lib/display-objects/Image.js +0 -42
- package/lib/display-objects/Line.d.ts +0 -30
- package/lib/display-objects/Line.js +0 -75
- package/lib/display-objects/Path.d.ts +0 -48
- package/lib/display-objects/Path.js +0 -142
- package/lib/display-objects/Polygon.d.ts +0 -16
- package/lib/display-objects/Polygon.js +0 -39
- package/lib/display-objects/Polyline.d.ts +0 -21
- package/lib/display-objects/Polyline.js +0 -84
- package/lib/display-objects/Rect.d.ts +0 -24
- package/lib/display-objects/Rect.js +0 -42
- package/lib/display-objects/Text.d.ts +0 -91
- package/lib/display-objects/Text.js +0 -126
- package/lib/display-objects/index.d.ts +0 -13
- package/lib/display-objects/index.js +0 -174
- package/lib/dom/Animation.d.ts +0 -132
- package/lib/dom/Animation.js +0 -511
- package/lib/dom/AnimationEffectTiming.d.ts +0 -58
- package/lib/dom/AnimationEffectTiming.js +0 -75
- package/lib/dom/AnimationEvent.d.ts +0 -11
- package/lib/dom/AnimationEvent.js +0 -42
- package/lib/dom/AnimationTimeline.d.ts +0 -40
- package/lib/dom/AnimationTimeline.js +0 -228
- package/lib/dom/CustomElementRegistry.d.ts +0 -15
- package/lib/dom/CustomElementRegistry.js +0 -50
- package/lib/dom/CustomEvent.d.ts +0 -16
- package/lib/dom/CustomEvent.js +0 -42
- package/lib/dom/Document.d.ts +0 -72
- package/lib/dom/Document.js +0 -329
- package/lib/dom/Element.d.ts +0 -187
- package/lib/dom/Element.js +0 -619
- package/lib/dom/EventTarget.d.ts +0 -40
- package/lib/dom/EventTarget.js +0 -171
- package/lib/dom/FederatedEvent.d.ts +0 -145
- package/lib/dom/FederatedEvent.js +0 -229
- package/lib/dom/FederatedMouseEvent.d.ts +0 -52
- package/lib/dom/FederatedMouseEvent.js +0 -133
- package/lib/dom/FederatedPointerEvent.d.ts +0 -75
- package/lib/dom/FederatedPointerEvent.js +0 -69
- package/lib/dom/FederatedTouchEvent.d.ts +0 -15
- package/lib/dom/FederatedTouchEvent.js +0 -27
- package/lib/dom/FederatedWheelEvent.d.ts +0 -20
- package/lib/dom/FederatedWheelEvent.js +0 -35
- package/lib/dom/KeyframeEffect.d.ts +0 -47
- package/lib/dom/KeyframeEffect.js +0 -192
- package/lib/dom/KeyframeList.d.ts +0 -2
- package/lib/dom/KeyframeList.js +0 -183
- package/lib/dom/MutationEvent.d.ts +0 -15
- package/lib/dom/MutationEvent.js +0 -37
- package/lib/dom/MutationObserver.d.ts +0 -36
- package/lib/dom/MutationObserver.js +0 -426
- package/lib/dom/MutationRecord.d.ts +0 -14
- package/lib/dom/MutationRecord.js +0 -38
- package/lib/dom/Node.d.ts +0 -138
- package/lib/dom/Node.js +0 -397
- package/lib/dom/index.d.ts +0 -20
- package/lib/dom/index.js +0 -265
- package/lib/dom/interfaces.d.ts +0 -372
- package/lib/dom/interfaces.js +0 -64
- package/lib/global-module.d.ts +0 -1
- package/lib/global-module.js +0 -170
- package/lib/index.d.ts +0 -18
- package/lib/index.js +0 -198
- package/lib/plugins/CullingPlugin.d.ts +0 -17
- package/lib/plugins/CullingPlugin.js +0 -69
- package/lib/plugins/DirtyCheckPlugin.d.ts +0 -10
- package/lib/plugins/DirtyCheckPlugin.js +0 -63
- package/lib/plugins/EventPlugin.d.ts +0 -30
- package/lib/plugins/EventPlugin.js +0 -382
- package/lib/plugins/FrustumCullingStrategy.d.ts +0 -21
- package/lib/plugins/FrustumCullingStrategy.js +0 -121
- package/lib/plugins/PrepareRendererPlugin.d.ts +0 -7
- package/lib/plugins/PrepareRendererPlugin.js +0 -87
- package/lib/services/ContextService.d.ts +0 -13
- package/lib/services/ContextService.js +0 -15
- package/lib/services/EventService.d.ts +0 -73
- package/lib/services/EventService.js +0 -1263
- package/lib/services/OffscreenCanvasCreator.d.ts +0 -13
- package/lib/services/OffscreenCanvasCreator.js +0 -66
- package/lib/services/RenderingContext.d.ts +0 -26
- package/lib/services/RenderingContext.js +0 -24
- package/lib/services/RenderingService.d.ts +0 -102
- package/lib/services/RenderingService.js +0 -244
- package/lib/services/SceneGraphSelector.d.ts +0 -23
- package/lib/services/SceneGraphSelector.js +0 -114
- package/lib/services/SceneGraphService.d.ts +0 -153
- package/lib/services/SceneGraphService.js +0 -875
- package/lib/services/TextService.d.ts +0 -36
- package/lib/services/TextService.js +0 -359
- package/lib/services/aabb/CircleUpdater.d.ts +0 -8
- package/lib/services/aabb/CircleUpdater.js +0 -40
- package/lib/services/aabb/EllipseUpdater.d.ts +0 -8
- package/lib/services/aabb/EllipseUpdater.js +0 -41
- package/lib/services/aabb/LineUpdater.d.ts +0 -8
- package/lib/services/aabb/LineUpdater.js +0 -47
- package/lib/services/aabb/PathUpdater.d.ts +0 -8
- package/lib/services/aabb/PathUpdater.js +0 -179
- package/lib/services/aabb/PolylineUpdater.d.ts +0 -8
- package/lib/services/aabb/PolylineUpdater.js +0 -56
- package/lib/services/aabb/RectUpdater.d.ts +0 -8
- package/lib/services/aabb/RectUpdater.js +0 -84
- package/lib/services/aabb/TextUpdater.d.ts +0 -21
- package/lib/services/aabb/TextUpdater.js +0 -149
- package/lib/services/aabb/index.d.ts +0 -8
- package/lib/services/aabb/index.js +0 -84
- package/lib/services/aabb/interfaces.d.ts +0 -15
- package/lib/services/aabb/interfaces.js +0 -16
- package/lib/services/index.d.ts +0 -10
- package/lib/services/index.js +0 -122
- package/lib/shapes/AABB.d.ts +0 -35
- package/lib/shapes/AABB.js +0 -248
- package/lib/shapes/BoundingSphere.d.ts +0 -8
- package/lib/shapes/BoundingSphere.js +0 -41
- package/lib/shapes/Frustum.d.ts +0 -16
- package/lib/shapes/Frustum.js +0 -96
- package/lib/shapes/Plane.d.ts +0 -14
- package/lib/shapes/Plane.js +0 -51
- package/lib/shapes/Point.d.ts +0 -11
- package/lib/shapes/Point.js +0 -38
- package/lib/shapes/Ray.d.ts +0 -24
- package/lib/shapes/Ray.js +0 -169
- package/lib/shapes/Rectangle.d.ts +0 -12
- package/lib/shapes/Rectangle.js +0 -27
- package/lib/shapes/index.d.ts +0 -7
- package/lib/shapes/index.js +0 -96
- package/lib/types.d.ts +0 -289
- package/lib/types.js +0 -69
- package/lib/utils/animation.d.ts +0 -15
- package/lib/utils/animation.js +0 -275
- package/lib/utils/assert.d.ts +0 -9
- package/lib/utils/assert.js +0 -56
- package/lib/utils/bezier-easing.d.ts +0 -20
- package/lib/utils/bezier-easing.js +0 -128
- package/lib/utils/canvas.d.ts +0 -6
- package/lib/utils/canvas.js +0 -27
- package/lib/utils/custom-easing.d.ts +0 -64
- package/lib/utils/custom-easing.js +0 -392
- package/lib/utils/deferred.d.ts +0 -43
- package/lib/utils/deferred.js +0 -131
- package/lib/utils/dom.d.ts +0 -2
- package/lib/utils/dom.js +0 -17
- package/lib/utils/event.d.ts +0 -45
- package/lib/utils/event.js +0 -17
- package/lib/utils/index.d.ts +0 -10
- package/lib/utils/index.js +0 -135
- package/lib/utils/interpolation.d.ts +0 -4
- package/lib/utils/interpolation.js +0 -229
- package/lib/utils/math.d.ts +0 -29
- package/lib/utils/math.js +0 -273
- package/lib/utils/path.d.ts +0 -15
- package/lib/utils/path.js +0 -409
- package/lib/utils/string.d.ts +0 -2
- package/lib/utils/string.js +0 -27
- package/lib/utils/text.d.ts +0 -2
- package/lib/utils/text.js +0 -39
|
@@ -1,1661 +0,0 @@
|
|
|
1
|
-
import { __assign, __extends, __read, __spreadArray, __values } from "tslib";
|
|
2
|
-
import { DCHECK, DCHECK_EQ, DCHECK_NE } from '../../utils/assert';
|
|
3
|
-
import { CSSMathOperator } from './CSSMathOperator';
|
|
4
|
-
import { CSSStyleValue, CSSStyleValueType } from './CSSStyleValue';
|
|
5
|
-
import { Nested, ParenLess, UnitType } from './types'; // https://drafts.css-houdini.org/css-typed-om/#enumdef-cssnumericbasetype
|
|
6
|
-
|
|
7
|
-
export var BaseType;
|
|
8
|
-
|
|
9
|
-
(function (BaseType) {
|
|
10
|
-
BaseType[BaseType["kLength"] = 0] = "kLength";
|
|
11
|
-
BaseType[BaseType["kAngle"] = 1] = "kAngle";
|
|
12
|
-
BaseType[BaseType["kTime"] = 2] = "kTime";
|
|
13
|
-
BaseType[BaseType["kFrequency"] = 3] = "kFrequency";
|
|
14
|
-
BaseType[BaseType["kResolution"] = 4] = "kResolution";
|
|
15
|
-
BaseType[BaseType["kFlex"] = 5] = "kFlex";
|
|
16
|
-
BaseType[BaseType["kPercent"] = 6] = "kPercent";
|
|
17
|
-
BaseType[BaseType["kNumBaseTypes"] = 7] = "kNumBaseTypes";
|
|
18
|
-
})(BaseType || (BaseType = {}));
|
|
19
|
-
|
|
20
|
-
export function unitTypeToBaseType(unit) {
|
|
21
|
-
DCHECK_NE(unit, UnitType.kNumber);
|
|
22
|
-
|
|
23
|
-
switch (unit) {
|
|
24
|
-
case UnitType.kEms:
|
|
25
|
-
case UnitType.kExs:
|
|
26
|
-
case UnitType.kPixels:
|
|
27
|
-
case UnitType.kCentimeters:
|
|
28
|
-
case UnitType.kMillimeters:
|
|
29
|
-
case UnitType.kQuarterMillimeters:
|
|
30
|
-
case UnitType.kInches:
|
|
31
|
-
case UnitType.kPoints:
|
|
32
|
-
case UnitType.kPicas:
|
|
33
|
-
case UnitType.kUserUnits:
|
|
34
|
-
case UnitType.kViewportWidth:
|
|
35
|
-
case UnitType.kViewportHeight:
|
|
36
|
-
case UnitType.kViewportInlineSize:
|
|
37
|
-
case UnitType.kViewportBlockSize:
|
|
38
|
-
case UnitType.kViewportMin:
|
|
39
|
-
case UnitType.kViewportMax:
|
|
40
|
-
case UnitType.kSmallViewportWidth:
|
|
41
|
-
case UnitType.kSmallViewportHeight:
|
|
42
|
-
case UnitType.kSmallViewportInlineSize:
|
|
43
|
-
case UnitType.kSmallViewportBlockSize:
|
|
44
|
-
case UnitType.kSmallViewportMin:
|
|
45
|
-
case UnitType.kSmallViewportMax:
|
|
46
|
-
case UnitType.kLargeViewportWidth:
|
|
47
|
-
case UnitType.kLargeViewportHeight:
|
|
48
|
-
case UnitType.kLargeViewportInlineSize:
|
|
49
|
-
case UnitType.kLargeViewportBlockSize:
|
|
50
|
-
case UnitType.kLargeViewportMin:
|
|
51
|
-
case UnitType.kLargeViewportMax:
|
|
52
|
-
case UnitType.kDynamicViewportWidth:
|
|
53
|
-
case UnitType.kDynamicViewportHeight:
|
|
54
|
-
case UnitType.kDynamicViewportInlineSize:
|
|
55
|
-
case UnitType.kDynamicViewportBlockSize:
|
|
56
|
-
case UnitType.kDynamicViewportMin:
|
|
57
|
-
case UnitType.kDynamicViewportMax:
|
|
58
|
-
case UnitType.kContainerWidth:
|
|
59
|
-
case UnitType.kContainerHeight:
|
|
60
|
-
case UnitType.kContainerInlineSize:
|
|
61
|
-
case UnitType.kContainerBlockSize:
|
|
62
|
-
case UnitType.kContainerMin:
|
|
63
|
-
case UnitType.kContainerMax:
|
|
64
|
-
case UnitType.kRems:
|
|
65
|
-
case UnitType.kChs:
|
|
66
|
-
return BaseType.kLength;
|
|
67
|
-
|
|
68
|
-
case UnitType.kMilliseconds:
|
|
69
|
-
case UnitType.kSeconds:
|
|
70
|
-
return BaseType.kTime;
|
|
71
|
-
|
|
72
|
-
case UnitType.kDegrees:
|
|
73
|
-
case UnitType.kRadians:
|
|
74
|
-
case UnitType.kGradians:
|
|
75
|
-
case UnitType.kTurns:
|
|
76
|
-
return BaseType.kAngle;
|
|
77
|
-
|
|
78
|
-
case UnitType.kHertz:
|
|
79
|
-
case UnitType.kKilohertz:
|
|
80
|
-
return BaseType.kFrequency;
|
|
81
|
-
|
|
82
|
-
case UnitType.kDotsPerPixel:
|
|
83
|
-
case UnitType.kDotsPerInch:
|
|
84
|
-
case UnitType.kDotsPerCentimeter:
|
|
85
|
-
return BaseType.kResolution;
|
|
86
|
-
|
|
87
|
-
case UnitType.kFraction:
|
|
88
|
-
return BaseType.kFlex;
|
|
89
|
-
|
|
90
|
-
case UnitType.kPercentage:
|
|
91
|
-
return BaseType.kPercent;
|
|
92
|
-
|
|
93
|
-
default:
|
|
94
|
-
return BaseType.kLength;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
export function baseTypeToString(baseType) {
|
|
98
|
-
switch (baseType) {
|
|
99
|
-
case BaseType.kLength:
|
|
100
|
-
return 'length';
|
|
101
|
-
|
|
102
|
-
case BaseType.kAngle:
|
|
103
|
-
return 'angle';
|
|
104
|
-
|
|
105
|
-
case BaseType.kTime:
|
|
106
|
-
return 'time';
|
|
107
|
-
|
|
108
|
-
case BaseType.kFrequency:
|
|
109
|
-
return 'frequency';
|
|
110
|
-
|
|
111
|
-
case BaseType.kResolution:
|
|
112
|
-
return 'resolution';
|
|
113
|
-
|
|
114
|
-
case BaseType.kFlex:
|
|
115
|
-
return 'flex';
|
|
116
|
-
|
|
117
|
-
case BaseType.kPercent:
|
|
118
|
-
return 'percent';
|
|
119
|
-
|
|
120
|
-
default:
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return '';
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
var CSSNumericValueType =
|
|
128
|
-
/** @class */
|
|
129
|
-
function () {
|
|
130
|
-
function CSSNumericValueType(unit, exponent) {
|
|
131
|
-
if (unit === void 0) {
|
|
132
|
-
unit = UnitType.kNumber;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (exponent === void 0) {
|
|
136
|
-
exponent = 1;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
this.exponents = [];
|
|
140
|
-
this.numNonZeroEntries = 0;
|
|
141
|
-
this.percentHint = BaseType.kPercent;
|
|
142
|
-
this.hasPercentHint = false;
|
|
143
|
-
this.exponents = new Array(BaseType.kNumBaseTypes).fill(0);
|
|
144
|
-
|
|
145
|
-
if (unit !== UnitType.kNumber) {
|
|
146
|
-
this.setExponent(unitTypeToBaseType(unit), exponent);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
CSSNumericValueType.prototype.applyPercentHint = function (hint) {
|
|
151
|
-
DCHECK_NE(hint, BaseType.kPercent);
|
|
152
|
-
this.setExponent(hint, this.exponent(hint) + this.exponent(BaseType.kPercent));
|
|
153
|
-
this.setExponent(BaseType.kPercent, 0);
|
|
154
|
-
this.percentHint = hint;
|
|
155
|
-
this.hasPercentHint = true;
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
CSSNumericValueType.prototype.hasNonZeroEntries = function () {
|
|
159
|
-
return this.numNonZeroEntries > 0;
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
CSSNumericValueType.prototype.isOnlyNonZeroEntry = function (baseType, value) {
|
|
163
|
-
DCHECK_NE(value, 0);
|
|
164
|
-
return this.numNonZeroEntries === 1 && this.exponent(baseType) === value;
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
CSSNumericValueType.prototype.exponent = function (type) {
|
|
168
|
-
return this.exponents[type];
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
CSSNumericValueType.prototype.setExponent = function (type, newValue) {
|
|
172
|
-
var oldValue = this.exponents[type];
|
|
173
|
-
|
|
174
|
-
if (oldValue == 0 && newValue !== 0) {
|
|
175
|
-
this.numNonZeroEntries++;
|
|
176
|
-
} else if (oldValue !== 0 && newValue == 0) {
|
|
177
|
-
this.numNonZeroEntries--;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
this.exponents[type] = newValue;
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
CSSNumericValueType.negateExponents = function (type) {
|
|
184
|
-
type.exponents.forEach(function (v) {
|
|
185
|
-
return v *= -1;
|
|
186
|
-
});
|
|
187
|
-
return type;
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
CSSNumericValueType.prototype.matchesBaseType = function (baseType) {
|
|
191
|
-
DCHECK_NE(baseType, BaseType.kPercent);
|
|
192
|
-
return this.isOnlyNonZeroEntry(baseType, 1) && !this.hasPercentHint;
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
CSSNumericValueType.prototype.matchesPercentage = function () {
|
|
196
|
-
return this.isOnlyNonZeroEntry(BaseType.kPercent, 1);
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
CSSNumericValueType.prototype.matchesBaseTypePercentage = function (baseType) {
|
|
200
|
-
DCHECK_NE(baseType, BaseType.kPercent);
|
|
201
|
-
return this.isOnlyNonZeroEntry(baseType, 1) || this.isOnlyNonZeroEntry(BaseType.kPercent, 1);
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
CSSNumericValueType.prototype.matchesNumber = function () {
|
|
205
|
-
return !this.hasNonZeroEntries() && !this.hasPercentHint;
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
CSSNumericValueType.prototype.matchesNumberPercentage = function () {
|
|
209
|
-
return !this.hasNonZeroEntries() || this.isOnlyNonZeroEntry(BaseType.kPercent, 1);
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
CSSNumericValueType.add = function (type1, type2, error) {
|
|
213
|
-
if (type1.hasPercentHint && type2.hasPercentHint && type1.percentHint != type2.percentHint) {
|
|
214
|
-
error = true;
|
|
215
|
-
return type1;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
if (type1.hasPercentHint) type2.applyPercentHint(type1.percentHint);else if (type2.hasPercentHint) type1.applyPercentHint(type2.percentHint);
|
|
219
|
-
DCHECK_EQ(type1.percentHint, type2.percentHint); // Match up base types. Try to use the percent hint to match up any
|
|
220
|
-
// differences.
|
|
221
|
-
|
|
222
|
-
for (var i = 0; i < BaseType.kNumBaseTypes; ++i) {
|
|
223
|
-
var base_type = i;
|
|
224
|
-
|
|
225
|
-
if (type1.exponents[i] !== type2.exponents[i]) {
|
|
226
|
-
if (base_type !== BaseType.kPercent) {
|
|
227
|
-
type1.applyPercentHint(base_type);
|
|
228
|
-
type2.applyPercentHint(base_type);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
if (type1.exponents[i] !== type2.exponents[i]) {
|
|
232
|
-
error = true;
|
|
233
|
-
return type1;
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
error = false;
|
|
239
|
-
return type1;
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
CSSNumericValueType.multiply = function (type1, type2, error) {
|
|
243
|
-
if (type1.hasPercentHint && type2.hasPercentHint && type1.percentHint != type2.percentHint) {
|
|
244
|
-
error = true;
|
|
245
|
-
return type1;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
if (type1.hasPercentHint) type2.applyPercentHint(type1.percentHint);else if (type2.hasPercentHint) type1.applyPercentHint(type2.percentHint);
|
|
249
|
-
|
|
250
|
-
for (var i = 0; i < BaseType.kNumBaseTypes; ++i) {
|
|
251
|
-
var base_type = i;
|
|
252
|
-
type1.setExponent(base_type, type1.exponent(base_type) + type2.exponent(base_type));
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
error = false;
|
|
256
|
-
return type1;
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
return CSSNumericValueType;
|
|
260
|
-
}();
|
|
261
|
-
|
|
262
|
-
export { CSSNumericValueType };
|
|
263
|
-
/**
|
|
264
|
-
* CSSNumericValue is the base class for numeric and length typed CSS Values.
|
|
265
|
-
* @see https://drafts.css-houdini.org/css-typed-om/#numeric-objects
|
|
266
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericValue
|
|
267
|
-
* @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_numeric_value.idl
|
|
268
|
-
*/
|
|
269
|
-
|
|
270
|
-
var CSSNumericValue =
|
|
271
|
-
/** @class */
|
|
272
|
-
function (_super) {
|
|
273
|
-
__extends(CSSNumericValue, _super);
|
|
274
|
-
|
|
275
|
-
function CSSNumericValue(type_) {
|
|
276
|
-
var _this = _super.call(this) || this;
|
|
277
|
-
|
|
278
|
-
_this.type_ = type_;
|
|
279
|
-
return _this;
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_numeric_value.cc#296
|
|
283
|
-
*/
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
CSSNumericValue.fromNumberish = function (value) {
|
|
287
|
-
if (typeof value === 'number') {
|
|
288
|
-
return new CSSUnitValue(value, UnitType.kNumber);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
return value;
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
CSSNumericValue.fromPercentish = function (value) {
|
|
295
|
-
if (typeof value === 'number') {
|
|
296
|
-
return new CSSUnitValue(value * 100, UnitType.kPercentage);
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
return value;
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
CSSNumericValue.prototype.getType = function () {
|
|
303
|
-
return CSSStyleValueType.kUnknownType;
|
|
304
|
-
}; // toCSSValue() {
|
|
305
|
-
// return null;
|
|
306
|
-
// }
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericValue/equals
|
|
310
|
-
*/
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
CSSNumericValue.prototype.equals = function () {
|
|
314
|
-
var _this = this;
|
|
315
|
-
|
|
316
|
-
var numberishes = [];
|
|
317
|
-
|
|
318
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
319
|
-
numberishes[_i] = arguments[_i];
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
var values = cssNumberishesToNumericValues(numberishes);
|
|
323
|
-
return values.every(function (value) {
|
|
324
|
-
return _this.equals(value);
|
|
325
|
-
});
|
|
326
|
-
};
|
|
327
|
-
/**
|
|
328
|
-
* @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_numeric_value.cc#439
|
|
329
|
-
*/
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
CSSNumericValue.prototype.add = function () {
|
|
333
|
-
var numberishes = [];
|
|
334
|
-
|
|
335
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
336
|
-
numberishes[_i] = arguments[_i];
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
var values = cssNumberishesToNumericValues(numberishes);
|
|
340
|
-
prependValueForArithmetic(CSSStyleValueType.kSumType, values, this); // eg. 1px + 2px = 3px
|
|
341
|
-
|
|
342
|
-
var unitValue = maybeSimplifyAsUnitValue(values, CSSMathOperator.kAdd);
|
|
343
|
-
|
|
344
|
-
if (unitValue) {
|
|
345
|
-
return unitValue;
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
return CSSMathSum.create(values);
|
|
349
|
-
};
|
|
350
|
-
/**
|
|
351
|
-
* @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_numeric_value.cc#452
|
|
352
|
-
*/
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
CSSNumericValue.prototype.sub = function () {
|
|
356
|
-
var numberishes = [];
|
|
357
|
-
|
|
358
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
359
|
-
numberishes[_i] = arguments[_i];
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
var values = cssNumberishesToNumericValues(numberishes);
|
|
363
|
-
values = values.map(function (value) {
|
|
364
|
-
return value.negate();
|
|
365
|
-
});
|
|
366
|
-
prependValueForArithmetic(CSSStyleValueType.kSumType, values, this); // eg. 3px - 2px = 1px
|
|
367
|
-
|
|
368
|
-
var unitValue = maybeSimplifyAsUnitValue(values, CSSMathOperator.kAdd);
|
|
369
|
-
|
|
370
|
-
if (unitValue) {
|
|
371
|
-
return unitValue;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
return CSSMathSum.create(values);
|
|
375
|
-
};
|
|
376
|
-
/**
|
|
377
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericValue/mul
|
|
378
|
-
*/
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
CSSNumericValue.prototype.mul = function () {
|
|
382
|
-
var numberishes = [];
|
|
383
|
-
|
|
384
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
385
|
-
numberishes[_i] = arguments[_i];
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
var values = cssNumberishesToNumericValues(numberishes);
|
|
389
|
-
prependValueForArithmetic(CSSStyleValueType.kProductType, values, this);
|
|
390
|
-
var unitValue = maybeMultiplyAsUnitValue(values);
|
|
391
|
-
|
|
392
|
-
if (unitValue) {
|
|
393
|
-
return unitValue;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
return CSSMathProduct.create(values);
|
|
397
|
-
};
|
|
398
|
-
/**
|
|
399
|
-
* eg. calc(24px / 4%)
|
|
400
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericValue/div
|
|
401
|
-
*/
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
CSSNumericValue.prototype.div = function () {
|
|
405
|
-
var numberishes = [];
|
|
406
|
-
|
|
407
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
408
|
-
numberishes[_i] = arguments[_i];
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
var values = cssNumberishesToNumericValues(numberishes);
|
|
412
|
-
values = values.map(function (value) {
|
|
413
|
-
return value.invert();
|
|
414
|
-
});
|
|
415
|
-
prependValueForArithmetic(CSSStyleValueType.kProductType, values, this);
|
|
416
|
-
var unitValue = maybeMultiplyAsUnitValue(values);
|
|
417
|
-
|
|
418
|
-
if (unitValue) {
|
|
419
|
-
return unitValue;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
return CSSMathProduct.create(values);
|
|
423
|
-
};
|
|
424
|
-
|
|
425
|
-
CSSNumericValue.prototype.min = function () {
|
|
426
|
-
var numberishes = [];
|
|
427
|
-
|
|
428
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
429
|
-
numberishes[_i] = arguments[_i];
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
var values = cssNumberishesToNumericValues(numberishes);
|
|
433
|
-
prependValueForArithmetic(CSSStyleValueType.kMinType, values, this);
|
|
434
|
-
var unitValue = maybeSimplifyAsUnitValue(values, CSSMathOperator.kMin);
|
|
435
|
-
|
|
436
|
-
if (unitValue) {
|
|
437
|
-
return unitValue;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
return CSSMathMin.create(values);
|
|
441
|
-
};
|
|
442
|
-
|
|
443
|
-
CSSNumericValue.prototype.max = function () {
|
|
444
|
-
var numberishes = [];
|
|
445
|
-
|
|
446
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
447
|
-
numberishes[_i] = arguments[_i];
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
var values = cssNumberishesToNumericValues(numberishes);
|
|
451
|
-
prependValueForArithmetic(CSSStyleValueType.kMaxType, values, this);
|
|
452
|
-
var unitValue = maybeSimplifyAsUnitValue(values, CSSMathOperator.kMax);
|
|
453
|
-
|
|
454
|
-
if (unitValue) {
|
|
455
|
-
return unitValue;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
return CSSMathMax.create(values);
|
|
459
|
-
};
|
|
460
|
-
/**
|
|
461
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericValue/to
|
|
462
|
-
* @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_numeric_value.cc#331
|
|
463
|
-
*/
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
CSSNumericValue.prototype.to = function (unitOrName) {
|
|
467
|
-
var sum = this.sumValue();
|
|
468
|
-
if (sum.length === 0 || sum.length !== 1) return null;
|
|
469
|
-
var value = cssNumericSumValueEntryToUnitValue(sum[0]);
|
|
470
|
-
if (!value) return null;
|
|
471
|
-
var unit;
|
|
472
|
-
|
|
473
|
-
if (typeof unitOrName === 'string') {
|
|
474
|
-
unit = CSSUnitValue.unitFromName(unitOrName);
|
|
475
|
-
} else {
|
|
476
|
-
unit = unitOrName;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
return value.convertTo(unit);
|
|
480
|
-
};
|
|
481
|
-
/**
|
|
482
|
-
* converts the object's value to a CSSMathSum object to values of the specified unit.
|
|
483
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericValue/toSum
|
|
484
|
-
*/
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
CSSNumericValue.prototype.toSum = function () {
|
|
488
|
-
var e_1, _a, e_2, _b, e_3, _c;
|
|
489
|
-
|
|
490
|
-
var unit_strings = [];
|
|
491
|
-
|
|
492
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
493
|
-
unit_strings[_i] = arguments[_i];
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
try {
|
|
497
|
-
for (var unit_strings_1 = __values(unit_strings), unit_strings_1_1 = unit_strings_1.next(); !unit_strings_1_1.done; unit_strings_1_1 = unit_strings_1.next()) {
|
|
498
|
-
var unit_string = unit_strings_1_1.value;
|
|
499
|
-
|
|
500
|
-
if (!CSSNumericValue.isValidUnit(CSSNumericValue.unitFromName(unit_string))) {
|
|
501
|
-
return null;
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
} catch (e_1_1) {
|
|
505
|
-
e_1 = {
|
|
506
|
-
error: e_1_1
|
|
507
|
-
};
|
|
508
|
-
} finally {
|
|
509
|
-
try {
|
|
510
|
-
if (unit_strings_1_1 && !unit_strings_1_1.done && (_a = unit_strings_1.return)) _a.call(unit_strings_1);
|
|
511
|
-
} finally {
|
|
512
|
-
if (e_1) throw e_1.error;
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
var sum = this.sumValue();
|
|
517
|
-
|
|
518
|
-
if (!sum.length) {
|
|
519
|
-
return null;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
var values = [];
|
|
523
|
-
|
|
524
|
-
try {
|
|
525
|
-
for (var sum_1 = __values(sum), sum_1_1 = sum_1.next(); !sum_1_1.done; sum_1_1 = sum_1.next()) {
|
|
526
|
-
var term = sum_1_1.value;
|
|
527
|
-
var value = cssNumericSumValueEntryToUnitValue(term);
|
|
528
|
-
|
|
529
|
-
if (!value) {
|
|
530
|
-
return null;
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
values.push(value);
|
|
534
|
-
}
|
|
535
|
-
} catch (e_2_1) {
|
|
536
|
-
e_2 = {
|
|
537
|
-
error: e_2_1
|
|
538
|
-
};
|
|
539
|
-
} finally {
|
|
540
|
-
try {
|
|
541
|
-
if (sum_1_1 && !sum_1_1.done && (_b = sum_1.return)) _b.call(sum_1);
|
|
542
|
-
} finally {
|
|
543
|
-
if (e_2) throw e_2.error;
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
if (unit_strings.length === 0) {
|
|
548
|
-
values.sort(function (a, b) {
|
|
549
|
-
return a.unit - b.unit;
|
|
550
|
-
}); // We got 'values' from a sum value, so it must be a valid CSSMathSum.
|
|
551
|
-
|
|
552
|
-
var result_1 = CSSMathSum.create(values);
|
|
553
|
-
DCHECK(!!result_1);
|
|
554
|
-
return result_1;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
var result = [];
|
|
558
|
-
|
|
559
|
-
var _loop_1 = function _loop_1(unit_string) {
|
|
560
|
-
var target_unit = CSSNumericValue.unitFromName(unit_string);
|
|
561
|
-
DCHECK(CSSNumericValue.isValidUnit(target_unit)); // Collect all the terms that are compatible with this unit.
|
|
562
|
-
// We mark used terms as null so we don't use them again.
|
|
563
|
-
|
|
564
|
-
var total_value = values.reduce(function (cur_sum, value, i) {
|
|
565
|
-
if (value) {
|
|
566
|
-
var unit_value = value;
|
|
567
|
-
var converted_value = unit_value.convertTo(target_unit);
|
|
568
|
-
|
|
569
|
-
if (converted_value) {
|
|
570
|
-
cur_sum += converted_value.value;
|
|
571
|
-
values[i] = null;
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
return cur_sum;
|
|
576
|
-
}, 0);
|
|
577
|
-
result.push(new CSSUnitValue(total_value, target_unit));
|
|
578
|
-
};
|
|
579
|
-
|
|
580
|
-
try {
|
|
581
|
-
for (var unit_strings_2 = __values(unit_strings), unit_strings_2_1 = unit_strings_2.next(); !unit_strings_2_1.done; unit_strings_2_1 = unit_strings_2.next()) {
|
|
582
|
-
var unit_string = unit_strings_2_1.value;
|
|
583
|
-
|
|
584
|
-
_loop_1(unit_string);
|
|
585
|
-
}
|
|
586
|
-
} catch (e_3_1) {
|
|
587
|
-
e_3 = {
|
|
588
|
-
error: e_3_1
|
|
589
|
-
};
|
|
590
|
-
} finally {
|
|
591
|
-
try {
|
|
592
|
-
if (unit_strings_2_1 && !unit_strings_2_1.done && (_c = unit_strings_2.return)) _c.call(unit_strings_2);
|
|
593
|
-
} finally {
|
|
594
|
-
if (e_3) throw e_3.error;
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
if (values.some(function (v) {
|
|
599
|
-
return !!v;
|
|
600
|
-
})) {
|
|
601
|
-
throw new Error('There were leftover terms that were not converted');
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
return CSSMathSum.create(result);
|
|
605
|
-
};
|
|
606
|
-
/**
|
|
607
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSSNumericValue/type
|
|
608
|
-
* @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_numeric_value.cc#414
|
|
609
|
-
*/
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
CSSNumericValue.prototype.type = function () {
|
|
613
|
-
var type = {
|
|
614
|
-
length: 0,
|
|
615
|
-
angle: 0,
|
|
616
|
-
time: 0,
|
|
617
|
-
frequency: 0,
|
|
618
|
-
resolution: 0,
|
|
619
|
-
flex: 0,
|
|
620
|
-
percent: 0,
|
|
621
|
-
percentHint: 'length'
|
|
622
|
-
};
|
|
623
|
-
var exponent = this.type_.exponent(BaseType.kLength);
|
|
624
|
-
|
|
625
|
-
if (exponent) {
|
|
626
|
-
type.length = exponent;
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
exponent = this.type_.exponent(BaseType.kAngle);
|
|
630
|
-
|
|
631
|
-
if (exponent) {
|
|
632
|
-
type.angle = exponent;
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
exponent = this.type_.exponent(BaseType.kTime);
|
|
636
|
-
|
|
637
|
-
if (exponent) {
|
|
638
|
-
type.time = exponent;
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
exponent = this.type_.exponent(BaseType.kFrequency);
|
|
642
|
-
|
|
643
|
-
if (exponent) {
|
|
644
|
-
type.frequency = exponent;
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
exponent = this.type_.exponent(BaseType.kResolution);
|
|
648
|
-
|
|
649
|
-
if (exponent) {
|
|
650
|
-
type.resolution = exponent;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
exponent = this.type_.exponent(BaseType.kFlex);
|
|
654
|
-
|
|
655
|
-
if (exponent) {
|
|
656
|
-
type.flex = exponent;
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
exponent = this.type_.exponent(BaseType.kPercent);
|
|
660
|
-
|
|
661
|
-
if (exponent) {
|
|
662
|
-
type.percent = exponent;
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
if (this.type_.hasPercentHint) {
|
|
666
|
-
type.percentHint = baseTypeToString(this.type_.percentHint);
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
return type;
|
|
670
|
-
};
|
|
671
|
-
|
|
672
|
-
CSSNumericValue.isValidUnit = function (unit) {
|
|
673
|
-
if (unit === UnitType.kUserUnits) return false;
|
|
674
|
-
if (unit === UnitType.kNumber || unit == UnitType.kPercentage || this.isLength(unit) || this.isAngle(unit) || this.isTime(unit) || this.isFrequency(unit) || this.isResolution(unit) || this.isFlex(unit)) return true;
|
|
675
|
-
return false;
|
|
676
|
-
};
|
|
677
|
-
|
|
678
|
-
CSSNumericValue.prototype.negate = function () {
|
|
679
|
-
return CSSMathNegate.create(this);
|
|
680
|
-
};
|
|
681
|
-
|
|
682
|
-
CSSNumericValue.prototype.invert = function () {
|
|
683
|
-
return CSSMathInvert.create(this);
|
|
684
|
-
};
|
|
685
|
-
|
|
686
|
-
return CSSNumericValue;
|
|
687
|
-
}(CSSStyleValue);
|
|
688
|
-
|
|
689
|
-
export { CSSNumericValue };
|
|
690
|
-
|
|
691
|
-
function cssNumberishesToNumericValues(values) {
|
|
692
|
-
return values.map(CSSNumericValue.fromNumberish);
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
function prependValueForArithmetic(type, values, value) {
|
|
696
|
-
DCHECK(!!value);
|
|
697
|
-
|
|
698
|
-
if (value.getType() === type) {
|
|
699
|
-
values.unshift.apply(values, __spreadArray([], __read(value.numericValues()), false));
|
|
700
|
-
} else {
|
|
701
|
-
values.unshift(value);
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
function cssNumericSumValueEntryToUnitValue(term) {
|
|
706
|
-
if (Object.keys(term.units).length === 0) {
|
|
707
|
-
return new CSSUnitValue(term.value);
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
if (Object.keys(term.units).length === 1 && term.units[Object.keys(term.units)[0]] === 1) {
|
|
711
|
-
return new CSSUnitValue(term.value, Number(Object.keys(term.units)[0]));
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
return null;
|
|
715
|
-
}
|
|
716
|
-
|
|
717
|
-
function maybeSimplifyAsUnitValue(values, operator) {
|
|
718
|
-
DCHECK(!!values.length);
|
|
719
|
-
var first_unit_value = values[0] instanceof CSSUnitValue ? values[0] : null;
|
|
720
|
-
if (!first_unit_value) return null;
|
|
721
|
-
var final_value = first_unit_value.value;
|
|
722
|
-
|
|
723
|
-
for (var i = 1; i < values.length; i++) {
|
|
724
|
-
var unit_value = values[i] instanceof CSSUnitValue ? values[i] : null;
|
|
725
|
-
if (!unit_value || unit_value.unit !== first_unit_value.unit) return null;
|
|
726
|
-
|
|
727
|
-
if (operator === CSSMathOperator.kAdd) {
|
|
728
|
-
final_value += unit_value.value;
|
|
729
|
-
} else if (operator === CSSMathOperator.kMax) {
|
|
730
|
-
final_value = Math.max(final_value, unit_value.value);
|
|
731
|
-
} else if (operator === CSSMathOperator.kMin) {
|
|
732
|
-
final_value = Math.min(final_value, unit_value.value);
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
return new CSSUnitValue(final_value, first_unit_value.unit);
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
function maybeMultiplyAsUnitValue(values) {
|
|
740
|
-
DCHECK(!!values.length); // We are allowed one unit value with type other than kNumber.
|
|
741
|
-
|
|
742
|
-
var unit_other_than_number = UnitType.kNumber;
|
|
743
|
-
var final_value = 1.0;
|
|
744
|
-
|
|
745
|
-
for (var i = 0; i < values.length; i++) {
|
|
746
|
-
var unit_value = values[i] instanceof CSSUnitValue ? values[i] : null;
|
|
747
|
-
if (!unit_value) return null;
|
|
748
|
-
|
|
749
|
-
if (unit_value.unit !== UnitType.kNumber) {
|
|
750
|
-
if (unit_other_than_number !== UnitType.kNumber) return null;
|
|
751
|
-
unit_other_than_number = unit_value.unit;
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
final_value *= unit_value.value;
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
return new CSSUnitValue(final_value, unit_other_than_number);
|
|
758
|
-
}
|
|
759
|
-
/**
|
|
760
|
-
* Represents numeric values that can be expressed as a single number plus a
|
|
761
|
-
* unit (or a naked number or percentage).
|
|
762
|
-
* @see https://drafts.css-houdini.org/css-typed-om/#cssunitvalue
|
|
763
|
-
*/
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
var CSSUnitValue =
|
|
767
|
-
/** @class */
|
|
768
|
-
function (_super) {
|
|
769
|
-
__extends(CSSUnitValue, _super);
|
|
770
|
-
|
|
771
|
-
function CSSUnitValue(value, unitOrName) {
|
|
772
|
-
if (unitOrName === void 0) {
|
|
773
|
-
unitOrName = UnitType.kNumber;
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
var _this = this;
|
|
777
|
-
|
|
778
|
-
var unit;
|
|
779
|
-
|
|
780
|
-
if (typeof unitOrName === 'string') {
|
|
781
|
-
unit = CSSUnitValue.unitFromName(unitOrName);
|
|
782
|
-
} else {
|
|
783
|
-
unit = unitOrName;
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
DCHECK(CSSUnitValue.isValidUnit(unit));
|
|
787
|
-
_this = _super.call(this, new CSSNumericValueType(unit)) || this;
|
|
788
|
-
_this.unit = unit;
|
|
789
|
-
_this.value = value;
|
|
790
|
-
return _this;
|
|
791
|
-
} // static fromCSSValue(value: CSSNumericLiteralValue) {
|
|
792
|
-
// let unit = value.type;
|
|
793
|
-
// if (unit === UnitType.kInteger) unit = UnitType.kNumber;
|
|
794
|
-
// if (!this.isValidUnit(unit)) return null;
|
|
795
|
-
// return new CSSUnitValue(value.getDoubleValue(), unit);
|
|
796
|
-
// }
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
CSSUnitValue.toCanonicalUnit = function (unit) {
|
|
800
|
-
return this.canonicalUnitTypeForCategory(this.unitTypeToUnitCategory(unit));
|
|
801
|
-
};
|
|
802
|
-
|
|
803
|
-
CSSUnitValue.toCanonicalUnitIfPossible = function (unit) {
|
|
804
|
-
var canonical_unit = this.toCanonicalUnit(unit);
|
|
805
|
-
if (canonical_unit === UnitType.kUnknown) return unit;
|
|
806
|
-
return canonical_unit;
|
|
807
|
-
};
|
|
808
|
-
|
|
809
|
-
CSSUnitValue.formatInfinityOrNaN = function (number, suffix) {
|
|
810
|
-
if (suffix === void 0) {
|
|
811
|
-
suffix = '';
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
var result = '';
|
|
815
|
-
|
|
816
|
-
if (!Number.isFinite(number)) {
|
|
817
|
-
if (number > 0) result = 'infinity';else result = '-infinity';
|
|
818
|
-
} else {
|
|
819
|
-
DCHECK(Number.isNaN(number));
|
|
820
|
-
result = 'NaN';
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
return result += suffix;
|
|
824
|
-
};
|
|
825
|
-
|
|
826
|
-
CSSUnitValue.formatNumber = function (number, suffix) {
|
|
827
|
-
if (suffix === void 0) {
|
|
828
|
-
suffix = '';
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
return number + suffix;
|
|
832
|
-
};
|
|
833
|
-
|
|
834
|
-
CSSUnitValue.prototype.clone = function () {
|
|
835
|
-
return new CSSUnitValue(this.value, this.unit);
|
|
836
|
-
};
|
|
837
|
-
|
|
838
|
-
CSSUnitValue.prototype.convertTo = function (target_unit) {
|
|
839
|
-
if (this.unit === target_unit) {
|
|
840
|
-
return new CSSUnitValue(this.value, this.unit);
|
|
841
|
-
} // Instead of defining the scale factors for every unit to every other unit,
|
|
842
|
-
// we simply convert to the canonical unit and back since we already have
|
|
843
|
-
// the scale factors for canonical units.
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
var canonical_unit = CSSUnitValue.toCanonicalUnit(this.unit);
|
|
847
|
-
|
|
848
|
-
if (canonical_unit !== CSSUnitValue.toCanonicalUnit(target_unit) || canonical_unit === UnitType.kUnknown) {
|
|
849
|
-
return null;
|
|
850
|
-
}
|
|
851
|
-
|
|
852
|
-
var scale_factor = CSSStyleValue.conversionToCanonicalUnitsScaleFactor(this.unit) / CSSStyleValue.conversionToCanonicalUnitsScaleFactor(target_unit);
|
|
853
|
-
return new CSSUnitValue(this.value * scale_factor, target_unit);
|
|
854
|
-
};
|
|
855
|
-
|
|
856
|
-
CSSUnitValue.prototype.equals = function (other) {
|
|
857
|
-
var other_unit_value = other;
|
|
858
|
-
return this.value === other_unit_value.value && this.unit === other_unit_value.unit;
|
|
859
|
-
};
|
|
860
|
-
|
|
861
|
-
CSSUnitValue.prototype.getType = function () {
|
|
862
|
-
return CSSStyleValueType.kUnitType;
|
|
863
|
-
}; // toCSSValue() {
|
|
864
|
-
// return new CSSNumericLiteralValue(this.value, this.unit);
|
|
865
|
-
// }
|
|
866
|
-
// // const CSSPrimitiveValue* ToCSSValueWithProperty(CSSPropertyID) const final;
|
|
867
|
-
// toCalcExpressionNode() {
|
|
868
|
-
// return CSSMathExpressionNumericLiteral.create(
|
|
869
|
-
// new CSSNumericLiteralValue(this.value, this.unit),
|
|
870
|
-
// );
|
|
871
|
-
// }
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
CSSUnitValue.prototype.sumValue = function () {
|
|
875
|
-
var sum = [];
|
|
876
|
-
var unit_map = {};
|
|
877
|
-
|
|
878
|
-
if (this.unit !== UnitType.kNumber) {
|
|
879
|
-
unit_map[CSSUnitValue.toCanonicalUnitIfPossible(this.unit)] = 1;
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
sum.push({
|
|
883
|
-
value: this.value * CSSStyleValue.conversionToCanonicalUnitsScaleFactor(this.unit),
|
|
884
|
-
units: unit_map
|
|
885
|
-
});
|
|
886
|
-
return sum;
|
|
887
|
-
};
|
|
888
|
-
|
|
889
|
-
CSSUnitValue.prototype.negate = function () {
|
|
890
|
-
return new CSSUnitValue(-this.value, this.unit);
|
|
891
|
-
};
|
|
892
|
-
|
|
893
|
-
CSSUnitValue.prototype.invert = function () {
|
|
894
|
-
if (this.unit === UnitType.kNumber) {
|
|
895
|
-
if (this.value === 0) return null;
|
|
896
|
-
return new CSSUnitValue(1.0 / this.value, this.unit);
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
return CSSMathInvert.create(this);
|
|
900
|
-
};
|
|
901
|
-
|
|
902
|
-
CSSUnitValue.prototype.buildCSSText = function (n, p, result) {
|
|
903
|
-
var text;
|
|
904
|
-
|
|
905
|
-
switch (this.unit) {
|
|
906
|
-
case UnitType.kUnknown:
|
|
907
|
-
// FIXME
|
|
908
|
-
break;
|
|
909
|
-
|
|
910
|
-
case UnitType.kInteger:
|
|
911
|
-
text = Number(this.value).toFixed(0);
|
|
912
|
-
break;
|
|
913
|
-
|
|
914
|
-
case UnitType.kNumber:
|
|
915
|
-
case UnitType.kPercentage:
|
|
916
|
-
case UnitType.kEms:
|
|
917
|
-
case UnitType.kQuirkyEms:
|
|
918
|
-
case UnitType.kExs:
|
|
919
|
-
case UnitType.kRems:
|
|
920
|
-
case UnitType.kChs:
|
|
921
|
-
case UnitType.kPixels:
|
|
922
|
-
case UnitType.kCentimeters:
|
|
923
|
-
case UnitType.kDotsPerPixel:
|
|
924
|
-
case UnitType.kDotsPerInch:
|
|
925
|
-
case UnitType.kDotsPerCentimeter:
|
|
926
|
-
case UnitType.kMillimeters:
|
|
927
|
-
case UnitType.kQuarterMillimeters:
|
|
928
|
-
case UnitType.kInches:
|
|
929
|
-
case UnitType.kPoints:
|
|
930
|
-
case UnitType.kPicas:
|
|
931
|
-
case UnitType.kUserUnits:
|
|
932
|
-
case UnitType.kDegrees:
|
|
933
|
-
case UnitType.kRadians:
|
|
934
|
-
case UnitType.kGradians:
|
|
935
|
-
case UnitType.kMilliseconds:
|
|
936
|
-
case UnitType.kSeconds:
|
|
937
|
-
case UnitType.kHertz:
|
|
938
|
-
case UnitType.kKilohertz:
|
|
939
|
-
case UnitType.kTurns:
|
|
940
|
-
case UnitType.kFraction:
|
|
941
|
-
case UnitType.kViewportWidth:
|
|
942
|
-
case UnitType.kViewportHeight:
|
|
943
|
-
case UnitType.kViewportInlineSize:
|
|
944
|
-
case UnitType.kViewportBlockSize:
|
|
945
|
-
case UnitType.kViewportMin:
|
|
946
|
-
case UnitType.kViewportMax:
|
|
947
|
-
case UnitType.kSmallViewportWidth:
|
|
948
|
-
case UnitType.kSmallViewportHeight:
|
|
949
|
-
case UnitType.kSmallViewportInlineSize:
|
|
950
|
-
case UnitType.kSmallViewportBlockSize:
|
|
951
|
-
case UnitType.kSmallViewportMin:
|
|
952
|
-
case UnitType.kSmallViewportMax:
|
|
953
|
-
case UnitType.kLargeViewportWidth:
|
|
954
|
-
case UnitType.kLargeViewportHeight:
|
|
955
|
-
case UnitType.kLargeViewportInlineSize:
|
|
956
|
-
case UnitType.kLargeViewportBlockSize:
|
|
957
|
-
case UnitType.kLargeViewportMin:
|
|
958
|
-
case UnitType.kLargeViewportMax:
|
|
959
|
-
case UnitType.kDynamicViewportWidth:
|
|
960
|
-
case UnitType.kDynamicViewportHeight:
|
|
961
|
-
case UnitType.kDynamicViewportInlineSize:
|
|
962
|
-
case UnitType.kDynamicViewportBlockSize:
|
|
963
|
-
case UnitType.kDynamicViewportMin:
|
|
964
|
-
case UnitType.kDynamicViewportMax:
|
|
965
|
-
case UnitType.kContainerWidth:
|
|
966
|
-
case UnitType.kContainerHeight:
|
|
967
|
-
case UnitType.kContainerInlineSize:
|
|
968
|
-
case UnitType.kContainerBlockSize:
|
|
969
|
-
case UnitType.kContainerMin:
|
|
970
|
-
case UnitType.kContainerMax:
|
|
971
|
-
{
|
|
972
|
-
var kMinInteger = -999999;
|
|
973
|
-
var kMaxInteger = 999999;
|
|
974
|
-
var value = this.value;
|
|
975
|
-
var unit = CSSUnitValue.unitTypeToString(this.unit);
|
|
976
|
-
|
|
977
|
-
if (value < kMinInteger || value > kMaxInteger) {
|
|
978
|
-
var unit_1 = CSSUnitValue.unitTypeToString(this.unit);
|
|
979
|
-
|
|
980
|
-
if (!Number.isFinite(value) || Number.isNaN(value)) {
|
|
981
|
-
text = CSSUnitValue.formatInfinityOrNaN(value, unit_1);
|
|
982
|
-
} else {
|
|
983
|
-
text = CSSUnitValue.formatNumber(value, unit_1);
|
|
984
|
-
}
|
|
985
|
-
} else {
|
|
986
|
-
text = "".concat(value).concat(unit);
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
result += text;
|
|
992
|
-
return result;
|
|
993
|
-
};
|
|
994
|
-
|
|
995
|
-
return CSSUnitValue;
|
|
996
|
-
}(CSSNumericValue);
|
|
997
|
-
|
|
998
|
-
export { CSSUnitValue };
|
|
999
|
-
/**
|
|
1000
|
-
* The CSSMathValue interface of the CSS_Object_Model a base class for classes representing complex numeric values.
|
|
1001
|
-
*
|
|
1002
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/CSSMathValue
|
|
1003
|
-
* @see https://chromium.googlesource.com/chromium/src/+/refs/heads/main/third_party/blink/renderer/core/css/cssom/css_math_value.idl
|
|
1004
|
-
*/
|
|
1005
|
-
|
|
1006
|
-
var CSSMathValue =
|
|
1007
|
-
/** @class */
|
|
1008
|
-
function (_super) {
|
|
1009
|
-
__extends(CSSMathValue, _super);
|
|
1010
|
-
|
|
1011
|
-
function CSSMathValue() {
|
|
1012
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
1013
|
-
} // From CSSNumericValue
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
CSSMathValue.prototype.isUnitValue = function () {
|
|
1017
|
-
return false;
|
|
1018
|
-
};
|
|
1019
|
-
|
|
1020
|
-
return CSSMathValue;
|
|
1021
|
-
}(CSSNumericValue);
|
|
1022
|
-
|
|
1023
|
-
export { CSSMathValue };
|
|
1024
|
-
|
|
1025
|
-
var CSSMathInvert =
|
|
1026
|
-
/** @class */
|
|
1027
|
-
function (_super) {
|
|
1028
|
-
__extends(CSSMathInvert, _super);
|
|
1029
|
-
|
|
1030
|
-
function CSSMathInvert(value, type) {
|
|
1031
|
-
var _this = _super.call(this, type) || this;
|
|
1032
|
-
|
|
1033
|
-
_this.value = value;
|
|
1034
|
-
_this.operator = 'invert';
|
|
1035
|
-
return _this;
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
CSSMathInvert.create = function (value) {
|
|
1039
|
-
var type = CSSNumericValueType.negateExponents(value.type_);
|
|
1040
|
-
return new CSSMathInvert(value, type);
|
|
1041
|
-
};
|
|
1042
|
-
|
|
1043
|
-
CSSMathInvert.prototype.clone = function () {
|
|
1044
|
-
return new CSSMathInvert(this.value, this.type_);
|
|
1045
|
-
};
|
|
1046
|
-
|
|
1047
|
-
CSSMathInvert.prototype.getType = function () {
|
|
1048
|
-
return CSSStyleValueType.kInvertType;
|
|
1049
|
-
};
|
|
1050
|
-
|
|
1051
|
-
CSSMathInvert.prototype.equals = function (other) {
|
|
1052
|
-
if (other.getType() !== CSSStyleValueType.kInvertType) {
|
|
1053
|
-
return false;
|
|
1054
|
-
} // We can safely cast here as we know 'other' has the same type as us.
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
var other_invert = other;
|
|
1058
|
-
return this.value.equals(other_invert.value);
|
|
1059
|
-
};
|
|
1060
|
-
|
|
1061
|
-
CSSMathInvert.prototype.sumValue = function () {
|
|
1062
|
-
var sum = this.value.sumValue();
|
|
1063
|
-
|
|
1064
|
-
if (sum.length === 0 || sum.length !== 1 || sum[0].value === 0) {
|
|
1065
|
-
return null;
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
Object.keys(sum[0].units).forEach(function (key) {
|
|
1069
|
-
sum[0].units[key] *= -1;
|
|
1070
|
-
});
|
|
1071
|
-
sum[0].value = 1.0 / sum[0].value;
|
|
1072
|
-
return sum;
|
|
1073
|
-
}; // toCalcExpressionNode(): CSSMathExpressionNode {
|
|
1074
|
-
// const right_side = this.value.toCalcExpressionNode();
|
|
1075
|
-
// if (!right_side) {
|
|
1076
|
-
// return null;
|
|
1077
|
-
// }
|
|
1078
|
-
// // return CSSMathExpressionOperation::CreateArithmeticOperation(
|
|
1079
|
-
// // CSSMathExpressionNumericLiteral::Create(
|
|
1080
|
-
// // 1, UnitType.kNumber),
|
|
1081
|
-
// // right_side, CSSMathOperator.kDivide);
|
|
1082
|
-
// return null;
|
|
1083
|
-
// }
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
CSSMathInvert.prototype.buildCSSText = function (nested, paren_less, result) {
|
|
1087
|
-
if (paren_less == ParenLess.kNo) {
|
|
1088
|
-
result += nested === Nested.kYes ? '(' : 'calc(';
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
|
-
result += '1 / ';
|
|
1092
|
-
result = this.value.buildCSSText(Nested.kYes, ParenLess.kNo, result);
|
|
1093
|
-
|
|
1094
|
-
if (paren_less === ParenLess.kNo) {
|
|
1095
|
-
result += ')';
|
|
1096
|
-
}
|
|
1097
|
-
|
|
1098
|
-
return result;
|
|
1099
|
-
};
|
|
1100
|
-
|
|
1101
|
-
return CSSMathInvert;
|
|
1102
|
-
}(CSSMathValue);
|
|
1103
|
-
|
|
1104
|
-
export { CSSMathInvert };
|
|
1105
|
-
|
|
1106
|
-
var CSSMathNegate =
|
|
1107
|
-
/** @class */
|
|
1108
|
-
function (_super) {
|
|
1109
|
-
__extends(CSSMathNegate, _super);
|
|
1110
|
-
|
|
1111
|
-
function CSSMathNegate(value, type) {
|
|
1112
|
-
var _this = _super.call(this, type) || this;
|
|
1113
|
-
|
|
1114
|
-
_this.value = value;
|
|
1115
|
-
_this.operator = 'negate';
|
|
1116
|
-
return _this;
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
CSSMathNegate.create = function (value) {
|
|
1120
|
-
return new CSSMathNegate(value, value.type_);
|
|
1121
|
-
};
|
|
1122
|
-
|
|
1123
|
-
CSSMathNegate.prototype.clone = function () {
|
|
1124
|
-
return new CSSMathNegate(this.value, this.type_);
|
|
1125
|
-
};
|
|
1126
|
-
|
|
1127
|
-
CSSMathNegate.prototype.getType = function () {
|
|
1128
|
-
return CSSStyleValueType.kNegateType;
|
|
1129
|
-
};
|
|
1130
|
-
|
|
1131
|
-
CSSMathNegate.prototype.equals = function (other) {
|
|
1132
|
-
if (other.getType() !== CSSStyleValueType.kNegateType) {
|
|
1133
|
-
return false;
|
|
1134
|
-
}
|
|
1135
|
-
|
|
1136
|
-
var other_invert = other;
|
|
1137
|
-
return this.value.equals(other_invert.value);
|
|
1138
|
-
};
|
|
1139
|
-
|
|
1140
|
-
CSSMathNegate.prototype.sumValue = function () {
|
|
1141
|
-
var sum = this.value.sumValue();
|
|
1142
|
-
|
|
1143
|
-
if (sum.length === 0) {
|
|
1144
|
-
return null;
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
sum.forEach(function (term) {
|
|
1148
|
-
term.value *= -1;
|
|
1149
|
-
});
|
|
1150
|
-
return sum;
|
|
1151
|
-
}; // toCalcExpressionNode(): CSSMathExpressionNode {
|
|
1152
|
-
// const right_side = this.value.toCalcExpressionNode();
|
|
1153
|
-
// if (!right_side) {
|
|
1154
|
-
// return null;
|
|
1155
|
-
// }
|
|
1156
|
-
// // return CSSMathExpressionOperation::CreateArithmeticOperationSimplified(
|
|
1157
|
-
// // CSSMathExpressionNumericLiteral::Create(
|
|
1158
|
-
// // -1, CSSPrimitiveValue::UnitType::kNumber),
|
|
1159
|
-
// // right_side, CSSMathOperator::kMultiply);
|
|
1160
|
-
// }
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
CSSMathNegate.prototype.buildCSSText = function (nested, paren_less, result) {
|
|
1164
|
-
if (paren_less == ParenLess.kNo) {
|
|
1165
|
-
result += nested === Nested.kYes ? '(' : 'calc(';
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
|
-
result += '-';
|
|
1169
|
-
result = this.value.buildCSSText(Nested.kYes, ParenLess.kNo, result);
|
|
1170
|
-
|
|
1171
|
-
if (paren_less === ParenLess.kNo) {
|
|
1172
|
-
result += ')';
|
|
1173
|
-
}
|
|
1174
|
-
|
|
1175
|
-
return result;
|
|
1176
|
-
};
|
|
1177
|
-
|
|
1178
|
-
return CSSMathNegate;
|
|
1179
|
-
}(CSSMathValue);
|
|
1180
|
-
|
|
1181
|
-
export { CSSMathNegate };
|
|
1182
|
-
export function typeCheck(values, op, error) {
|
|
1183
|
-
error = false;
|
|
1184
|
-
var final_type = values[0].type_;
|
|
1185
|
-
|
|
1186
|
-
for (var i = 1; i < values.length; i++) {
|
|
1187
|
-
final_type = op(final_type, values[i].type_, error);
|
|
1188
|
-
if (error) return final_type;
|
|
1189
|
-
}
|
|
1190
|
-
|
|
1191
|
-
return final_type;
|
|
1192
|
-
} // Represents an arithmetic operation with one or more CSSNumericValues.
|
|
1193
|
-
|
|
1194
|
-
var CSSMathVariadic =
|
|
1195
|
-
/** @class */
|
|
1196
|
-
function (_super) {
|
|
1197
|
-
__extends(CSSMathVariadic, _super);
|
|
1198
|
-
|
|
1199
|
-
function CSSMathVariadic(values, type) {
|
|
1200
|
-
var _this = _super.call(this, type) || this;
|
|
1201
|
-
|
|
1202
|
-
_this.values = values;
|
|
1203
|
-
return _this;
|
|
1204
|
-
}
|
|
1205
|
-
|
|
1206
|
-
CSSMathVariadic.prototype.numericValues = function () {
|
|
1207
|
-
return this.values;
|
|
1208
|
-
};
|
|
1209
|
-
|
|
1210
|
-
CSSMathVariadic.prototype.equals = function (other) {
|
|
1211
|
-
if (this.getType() !== other.getType()) {
|
|
1212
|
-
return false;
|
|
1213
|
-
}
|
|
1214
|
-
|
|
1215
|
-
return this.values.every(function (value, i) {
|
|
1216
|
-
return value.equals(other.values[i]);
|
|
1217
|
-
});
|
|
1218
|
-
};
|
|
1219
|
-
|
|
1220
|
-
return CSSMathVariadic;
|
|
1221
|
-
}(CSSMathValue);
|
|
1222
|
-
|
|
1223
|
-
export { CSSMathVariadic }; // Represents the minimum of one or more CSSNumericValues.
|
|
1224
|
-
// @see https://drafts.css-houdini.org/css-typed-om/#cssmathsum
|
|
1225
|
-
|
|
1226
|
-
var CSSMathMin =
|
|
1227
|
-
/** @class */
|
|
1228
|
-
function (_super) {
|
|
1229
|
-
__extends(CSSMathMin, _super);
|
|
1230
|
-
|
|
1231
|
-
function CSSMathMin() {
|
|
1232
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
1233
|
-
|
|
1234
|
-
_this.operator = 'min';
|
|
1235
|
-
return _this;
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
CSSMathMin.create = function (values) {
|
|
1239
|
-
var error = false;
|
|
1240
|
-
var final_type = typeCheck(values, CSSNumericValueType.add, error);
|
|
1241
|
-
return error ? null : new CSSMathMin(values, final_type);
|
|
1242
|
-
};
|
|
1243
|
-
|
|
1244
|
-
CSSMathMin.prototype.clone = function () {
|
|
1245
|
-
return new CSSMathMin(this.values, this.type_);
|
|
1246
|
-
};
|
|
1247
|
-
|
|
1248
|
-
CSSMathMin.prototype.getType = function () {
|
|
1249
|
-
return CSSStyleValueType.kMinType;
|
|
1250
|
-
};
|
|
1251
|
-
|
|
1252
|
-
CSSMathMin.prototype.sumValue = function () {
|
|
1253
|
-
var e_4, _a;
|
|
1254
|
-
|
|
1255
|
-
var cur_min = this.numericValues()[0].sumValue();
|
|
1256
|
-
|
|
1257
|
-
if (!cur_min.length) {
|
|
1258
|
-
return null;
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
try {
|
|
1262
|
-
for (var _b = __values(this.numericValues()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1263
|
-
var value = _c.value;
|
|
1264
|
-
var child_sum = value.sumValue();
|
|
1265
|
-
|
|
1266
|
-
if (!child_sum.length || JSON.stringify(child_sum[0].units) !== JSON.stringify(cur_min[0].units)) {
|
|
1267
|
-
return null;
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
if (child_sum[0].value < cur_min[0].value) {
|
|
1271
|
-
cur_min = child_sum;
|
|
1272
|
-
}
|
|
1273
|
-
}
|
|
1274
|
-
} catch (e_4_1) {
|
|
1275
|
-
e_4 = {
|
|
1276
|
-
error: e_4_1
|
|
1277
|
-
};
|
|
1278
|
-
} finally {
|
|
1279
|
-
try {
|
|
1280
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1281
|
-
} finally {
|
|
1282
|
-
if (e_4) throw e_4.error;
|
|
1283
|
-
}
|
|
1284
|
-
}
|
|
1285
|
-
|
|
1286
|
-
return cur_min;
|
|
1287
|
-
}; // toCalcExpressionNode() {
|
|
1288
|
-
// const operands: CSSMathExpressionOperation[] = [];
|
|
1289
|
-
// for (const value of this.numericValues()) {
|
|
1290
|
-
// const operand = value.toCalcExpressionNode();
|
|
1291
|
-
// if (!operand) {
|
|
1292
|
-
// continue;
|
|
1293
|
-
// }
|
|
1294
|
-
// operands.push(operand as CSSMathExpressionOperation);
|
|
1295
|
-
// }
|
|
1296
|
-
// return CSSMathExpressionOperation.createComparisonFunction(operands, CSSMathOperator.kMin);
|
|
1297
|
-
// }
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
CSSMathMin.prototype.buildCSSText = function (nested, paren_less, result) {
|
|
1301
|
-
var e_5, _a;
|
|
1302
|
-
|
|
1303
|
-
result += 'min(';
|
|
1304
|
-
var first_iteration = true;
|
|
1305
|
-
|
|
1306
|
-
try {
|
|
1307
|
-
for (var _b = __values(this.numericValues()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1308
|
-
var value = _c.value;
|
|
1309
|
-
if (!first_iteration) result += ', ';
|
|
1310
|
-
first_iteration = false;
|
|
1311
|
-
result = value.buildCSSText(Nested.kYes, ParenLess.kYes, result);
|
|
1312
|
-
}
|
|
1313
|
-
} catch (e_5_1) {
|
|
1314
|
-
e_5 = {
|
|
1315
|
-
error: e_5_1
|
|
1316
|
-
};
|
|
1317
|
-
} finally {
|
|
1318
|
-
try {
|
|
1319
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1320
|
-
} finally {
|
|
1321
|
-
if (e_5) throw e_5.error;
|
|
1322
|
-
}
|
|
1323
|
-
}
|
|
1324
|
-
|
|
1325
|
-
result += ')';
|
|
1326
|
-
return result;
|
|
1327
|
-
};
|
|
1328
|
-
|
|
1329
|
-
return CSSMathMin;
|
|
1330
|
-
}(CSSMathVariadic);
|
|
1331
|
-
|
|
1332
|
-
export { CSSMathMin }; // Represents the maximum of one or more CSSNumericValues.
|
|
1333
|
-
// @see https://drafts.css-houdini.org/css-typed-om/#cssmathsum
|
|
1334
|
-
|
|
1335
|
-
var CSSMathMax =
|
|
1336
|
-
/** @class */
|
|
1337
|
-
function (_super) {
|
|
1338
|
-
__extends(CSSMathMax, _super);
|
|
1339
|
-
|
|
1340
|
-
function CSSMathMax() {
|
|
1341
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
1342
|
-
|
|
1343
|
-
_this.operator = 'max';
|
|
1344
|
-
return _this;
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1347
|
-
CSSMathMax.create = function (values) {
|
|
1348
|
-
var error = false;
|
|
1349
|
-
var final_type = typeCheck(values, CSSNumericValueType.add, error);
|
|
1350
|
-
return error ? null : new CSSMathMax(values, final_type);
|
|
1351
|
-
};
|
|
1352
|
-
|
|
1353
|
-
CSSMathMax.prototype.clone = function () {
|
|
1354
|
-
return new CSSMathMax(this.values, this.type_);
|
|
1355
|
-
};
|
|
1356
|
-
|
|
1357
|
-
CSSMathMax.prototype.getType = function () {
|
|
1358
|
-
return CSSStyleValueType.kMaxType;
|
|
1359
|
-
};
|
|
1360
|
-
|
|
1361
|
-
CSSMathMax.prototype.sumValue = function () {
|
|
1362
|
-
var e_6, _a;
|
|
1363
|
-
|
|
1364
|
-
var cur_max = this.numericValues()[0].sumValue();
|
|
1365
|
-
|
|
1366
|
-
if (!cur_max.length) {
|
|
1367
|
-
return null;
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1370
|
-
try {
|
|
1371
|
-
for (var _b = __values(this.numericValues()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1372
|
-
var value = _c.value;
|
|
1373
|
-
var child_sum = value.sumValue();
|
|
1374
|
-
|
|
1375
|
-
if (!child_sum.length || JSON.stringify(child_sum[0].units) !== JSON.stringify(cur_max[0].units)) {
|
|
1376
|
-
return null;
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
|
-
if (child_sum[0].value < cur_max[0].value) {
|
|
1380
|
-
cur_max = child_sum;
|
|
1381
|
-
}
|
|
1382
|
-
}
|
|
1383
|
-
} catch (e_6_1) {
|
|
1384
|
-
e_6 = {
|
|
1385
|
-
error: e_6_1
|
|
1386
|
-
};
|
|
1387
|
-
} finally {
|
|
1388
|
-
try {
|
|
1389
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1390
|
-
} finally {
|
|
1391
|
-
if (e_6) throw e_6.error;
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
|
|
1395
|
-
return cur_max;
|
|
1396
|
-
}; // toCalcExpressionNode() {
|
|
1397
|
-
// const operands: CSSMathExpressionOperation[] = [];
|
|
1398
|
-
// for (const value of this.numericValues()) {
|
|
1399
|
-
// const operand = value.toCalcExpressionNode();
|
|
1400
|
-
// if (!operand) {
|
|
1401
|
-
// continue;
|
|
1402
|
-
// }
|
|
1403
|
-
// operands.push(operand as CSSMathExpressionOperation);
|
|
1404
|
-
// }
|
|
1405
|
-
// return CSSMathExpressionOperation.createComparisonFunction(operands, CSSMathOperator.kMax);
|
|
1406
|
-
// }
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
CSSMathMax.prototype.buildCSSText = function (nested, paren_less, result) {
|
|
1410
|
-
var e_7, _a;
|
|
1411
|
-
|
|
1412
|
-
result += 'max(';
|
|
1413
|
-
var first_iteration = true;
|
|
1414
|
-
|
|
1415
|
-
try {
|
|
1416
|
-
for (var _b = __values(this.numericValues()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1417
|
-
var value = _c.value;
|
|
1418
|
-
if (!first_iteration) result += ', ';
|
|
1419
|
-
first_iteration = false;
|
|
1420
|
-
result = value.buildCSSText(Nested.kYes, ParenLess.kYes, result);
|
|
1421
|
-
}
|
|
1422
|
-
} catch (e_7_1) {
|
|
1423
|
-
e_7 = {
|
|
1424
|
-
error: e_7_1
|
|
1425
|
-
};
|
|
1426
|
-
} finally {
|
|
1427
|
-
try {
|
|
1428
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1429
|
-
} finally {
|
|
1430
|
-
if (e_7) throw e_7.error;
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
|
|
1434
|
-
result += ')';
|
|
1435
|
-
return result;
|
|
1436
|
-
};
|
|
1437
|
-
|
|
1438
|
-
return CSSMathMax;
|
|
1439
|
-
}(CSSMathVariadic);
|
|
1440
|
-
|
|
1441
|
-
export { CSSMathMax };
|
|
1442
|
-
/**
|
|
1443
|
-
* Represents the sum of one or more CSSNumericValues.
|
|
1444
|
-
* @see https://drafts.css-houdini.org/css-typed-om/#cssmathsum
|
|
1445
|
-
*/
|
|
1446
|
-
|
|
1447
|
-
var CSSMathSum =
|
|
1448
|
-
/** @class */
|
|
1449
|
-
function (_super) {
|
|
1450
|
-
__extends(CSSMathSum, _super);
|
|
1451
|
-
|
|
1452
|
-
function CSSMathSum() {
|
|
1453
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
1454
|
-
|
|
1455
|
-
_this.operator = 'sum';
|
|
1456
|
-
return _this;
|
|
1457
|
-
}
|
|
1458
|
-
|
|
1459
|
-
CSSMathSum.create = function (values) {
|
|
1460
|
-
var error = false;
|
|
1461
|
-
var finalType = typeCheck(values, CSSNumericValueType.add, error);
|
|
1462
|
-
return error ? null : new CSSMathSum(values, finalType);
|
|
1463
|
-
};
|
|
1464
|
-
|
|
1465
|
-
CSSMathSum.numericTypeFromUnitMap = function (units) {
|
|
1466
|
-
var type = new CSSNumericValueType();
|
|
1467
|
-
Object.keys(units).forEach(function (key) {
|
|
1468
|
-
var exp = units[key];
|
|
1469
|
-
var error = false;
|
|
1470
|
-
type = CSSNumericValueType.multiply(type, new CSSNumericValueType(Number(key), exp), error);
|
|
1471
|
-
DCHECK(!error);
|
|
1472
|
-
});
|
|
1473
|
-
return type;
|
|
1474
|
-
};
|
|
1475
|
-
|
|
1476
|
-
CSSMathSum.canCreateNumericTypeFromSumValue = function (sum) {
|
|
1477
|
-
var _this = this;
|
|
1478
|
-
|
|
1479
|
-
DCHECK(!!sum.length);
|
|
1480
|
-
var first_type = this.numericTypeFromUnitMap(sum[0].units);
|
|
1481
|
-
return sum.every(function (term) {
|
|
1482
|
-
var error = false;
|
|
1483
|
-
CSSNumericValueType.add(first_type, _this.numericTypeFromUnitMap(term.units), error);
|
|
1484
|
-
return !error;
|
|
1485
|
-
});
|
|
1486
|
-
};
|
|
1487
|
-
|
|
1488
|
-
CSSMathSum.prototype.clone = function () {
|
|
1489
|
-
return new CSSMathSum(this.values, this.type_);
|
|
1490
|
-
};
|
|
1491
|
-
|
|
1492
|
-
CSSMathSum.prototype.getType = function () {
|
|
1493
|
-
return CSSStyleValueType.kSumType;
|
|
1494
|
-
}; // toCalcExpressionNode() {
|
|
1495
|
-
// return this.toCalcExporessionNodeForVariadic(CSSMathOperator.kAdd);
|
|
1496
|
-
// }
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
CSSMathSum.prototype.sumValue = function () {
|
|
1500
|
-
var sum = [];
|
|
1501
|
-
this.numericValues().forEach(function (value) {
|
|
1502
|
-
var child_sum = value.sumValue();
|
|
1503
|
-
|
|
1504
|
-
if (!child_sum.length) {
|
|
1505
|
-
return null;
|
|
1506
|
-
}
|
|
1507
|
-
|
|
1508
|
-
child_sum.forEach(function (term) {
|
|
1509
|
-
var index = sum.findIndex(function (s) {
|
|
1510
|
-
return JSON.stringify(s.units) === JSON.stringify(term.units);
|
|
1511
|
-
});
|
|
1512
|
-
|
|
1513
|
-
if (index === -1) {
|
|
1514
|
-
sum.push(__assign({}, term));
|
|
1515
|
-
} else {
|
|
1516
|
-
sum[index].value += term.value;
|
|
1517
|
-
}
|
|
1518
|
-
});
|
|
1519
|
-
});
|
|
1520
|
-
if (!CSSMathSum.canCreateNumericTypeFromSumValue(sum)) return null;
|
|
1521
|
-
return sum;
|
|
1522
|
-
};
|
|
1523
|
-
|
|
1524
|
-
CSSMathSum.prototype.buildCSSText = function (nested, paren_less, result) {
|
|
1525
|
-
if (paren_less == ParenLess.kNo) {
|
|
1526
|
-
result += nested === Nested.kYes ? '(' : 'calc(';
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
var values = this.numericValues();
|
|
1530
|
-
result = values[0].buildCSSText(Nested.kYes, ParenLess.kNo, result);
|
|
1531
|
-
|
|
1532
|
-
for (var i = 1; i < values.length; i++) {
|
|
1533
|
-
var arg = values[i];
|
|
1534
|
-
|
|
1535
|
-
if (arg.getType() === CSSStyleValueType.kNegateType) {
|
|
1536
|
-
result += ' - ';
|
|
1537
|
-
result = arg.value.buildCSSText(Nested.kYes, ParenLess.kNo, result);
|
|
1538
|
-
} else {
|
|
1539
|
-
result += ' + ';
|
|
1540
|
-
result = arg.buildCSSText(Nested.kYes, ParenLess.kNo, result);
|
|
1541
|
-
}
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1544
|
-
if (paren_less === ParenLess.kNo) {
|
|
1545
|
-
result += ')';
|
|
1546
|
-
}
|
|
1547
|
-
|
|
1548
|
-
return result;
|
|
1549
|
-
};
|
|
1550
|
-
|
|
1551
|
-
return CSSMathSum;
|
|
1552
|
-
}(CSSMathVariadic);
|
|
1553
|
-
|
|
1554
|
-
export { CSSMathSum };
|
|
1555
|
-
/**
|
|
1556
|
-
* Represents the product of one or more CSSNumericValues.
|
|
1557
|
-
* @see https://drafts.css-houdini.org/css-typed-om/#cssmathproduct
|
|
1558
|
-
*/
|
|
1559
|
-
|
|
1560
|
-
var CSSMathProduct =
|
|
1561
|
-
/** @class */
|
|
1562
|
-
function (_super) {
|
|
1563
|
-
__extends(CSSMathProduct, _super);
|
|
1564
|
-
|
|
1565
|
-
function CSSMathProduct() {
|
|
1566
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
1567
|
-
|
|
1568
|
-
_this.operator = 'product';
|
|
1569
|
-
return _this;
|
|
1570
|
-
}
|
|
1571
|
-
|
|
1572
|
-
CSSMathProduct.create = function (values) {
|
|
1573
|
-
var error = false;
|
|
1574
|
-
var finalType = typeCheck(values, CSSNumericValueType.multiply, error);
|
|
1575
|
-
return error ? null : new CSSMathProduct(values, finalType);
|
|
1576
|
-
};
|
|
1577
|
-
|
|
1578
|
-
CSSMathProduct.multiplyUnitMaps = function (a, b) {
|
|
1579
|
-
Object.keys(b).forEach(function (key) {
|
|
1580
|
-
DCHECK_NE(b[key].value, 0);
|
|
1581
|
-
var old_value = key in a ? a[key].value : 0;
|
|
1582
|
-
|
|
1583
|
-
if (old_value + b[key].value === 0) {
|
|
1584
|
-
delete a[key];
|
|
1585
|
-
} else {
|
|
1586
|
-
a[key] = old_value + b[key].value;
|
|
1587
|
-
}
|
|
1588
|
-
});
|
|
1589
|
-
return a;
|
|
1590
|
-
};
|
|
1591
|
-
|
|
1592
|
-
CSSMathProduct.prototype.clone = function () {
|
|
1593
|
-
return new CSSMathProduct(this.values, this.type_);
|
|
1594
|
-
};
|
|
1595
|
-
|
|
1596
|
-
CSSMathProduct.prototype.getType = function () {
|
|
1597
|
-
return CSSStyleValueType.kProductType;
|
|
1598
|
-
}; // toCalcExpressionNode() {
|
|
1599
|
-
// return this.toCalcExporessionNodeForVariadic(CSSMathOperator.kMultiply);
|
|
1600
|
-
// }
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
CSSMathProduct.prototype.sumValue = function () {
|
|
1604
|
-
var sum = [{
|
|
1605
|
-
value: 1,
|
|
1606
|
-
units: {}
|
|
1607
|
-
}];
|
|
1608
|
-
this.numericValues().forEach(function (value) {
|
|
1609
|
-
var child_sum = value.sumValue();
|
|
1610
|
-
|
|
1611
|
-
if (!child_sum.length) {
|
|
1612
|
-
return null;
|
|
1613
|
-
}
|
|
1614
|
-
|
|
1615
|
-
var new_sum = [];
|
|
1616
|
-
sum.forEach(function (a) {
|
|
1617
|
-
child_sum.forEach(function (b) {
|
|
1618
|
-
new_sum.push({
|
|
1619
|
-
value: a.value * b.value,
|
|
1620
|
-
units: CSSMathProduct.multiplyUnitMaps(a.units, b.units)
|
|
1621
|
-
});
|
|
1622
|
-
});
|
|
1623
|
-
});
|
|
1624
|
-
sum = new_sum;
|
|
1625
|
-
});
|
|
1626
|
-
return sum;
|
|
1627
|
-
};
|
|
1628
|
-
|
|
1629
|
-
CSSMathProduct.prototype.buildCSSText = function (nested, paren_less, result) {
|
|
1630
|
-
if (paren_less == ParenLess.kNo) {
|
|
1631
|
-
result += nested === Nested.kYes ? '(' : 'calc(';
|
|
1632
|
-
}
|
|
1633
|
-
|
|
1634
|
-
var values = this.numericValues();
|
|
1635
|
-
result = values[0].buildCSSText(Nested.kYes, ParenLess.kNo, result);
|
|
1636
|
-
|
|
1637
|
-
for (var i = 1; i < values.length; i++) {
|
|
1638
|
-
var arg = values[i];
|
|
1639
|
-
|
|
1640
|
-
if (arg.getType() === CSSStyleValueType.kInvertType) {
|
|
1641
|
-
result += ' / ';
|
|
1642
|
-
result = arg.value.buildCSSText(Nested.kYes, ParenLess.kNo, result);
|
|
1643
|
-
} else {
|
|
1644
|
-
result += ' * ';
|
|
1645
|
-
result = arg.buildCSSText(Nested.kYes, ParenLess.kNo, result);
|
|
1646
|
-
}
|
|
1647
|
-
}
|
|
1648
|
-
|
|
1649
|
-
if (paren_less === ParenLess.kNo) {
|
|
1650
|
-
result += ')';
|
|
1651
|
-
}
|
|
1652
|
-
|
|
1653
|
-
return result;
|
|
1654
|
-
};
|
|
1655
|
-
|
|
1656
|
-
return CSSMathProduct;
|
|
1657
|
-
}(CSSMathVariadic);
|
|
1658
|
-
|
|
1659
|
-
export { CSSMathProduct };
|
|
1660
|
-
export var Opx = new CSSUnitValue(0, 'px');
|
|
1661
|
-
export var Odeg = new CSSUnitValue(0, 'deg');
|