@antv/g 5.0.22-alpha.4 → 5.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.umd.min.js +30 -0
- package/es/AbstractRenderer.js +3 -1
- package/es/Canvas.d.ts +1 -1
- package/es/Canvas.js +5 -3
- package/es/DisplayObjectPool.js +3 -1
- package/es/camera/Camera.d.ts +105 -66
- package/es/camera/Camera.js +307 -171
- package/es/camera/Landmark.d.ts +18 -25
- package/es/camera/Landmark.js +1 -72
- package/es/canvas-module.js +2 -4
- package/es/components/Cullable.js +3 -1
- package/es/components/Geometry.js +3 -1
- package/es/components/Renderable.js +3 -1
- package/es/components/Sortable.js +3 -1
- package/es/components/Transform.js +3 -1
- package/es/css/LayoutRegistry.js +3 -1
- package/es/css/StyleValueRegistry.d.ts +8 -0
- package/es/css/StyleValueRegistry.js +24 -19
- package/es/css/cssom/CSSColorValue.js +3 -1
- package/es/css/cssom/CSSGradientValue.js +8 -6
- package/es/css/cssom/CSSKeywordValue.js +3 -1
- package/es/css/cssom/CSSMathInvert.js +3 -1
- package/es/css/cssom/CSSMathMax.js +3 -1
- package/es/css/cssom/CSSMathMin.js +3 -1
- package/es/css/cssom/CSSMathNegate.js +3 -1
- package/es/css/cssom/CSSMathProduct.js +3 -1
- package/es/css/cssom/CSSMathSum.js +3 -1
- package/es/css/cssom/CSSMathValue.js +3 -1
- package/es/css/cssom/CSSMathVariadic.js +3 -1
- package/es/css/cssom/CSSNumericValue.js +3 -1
- package/es/css/cssom/CSSNumericValueType.d.ts +1 -1
- package/es/css/cssom/CSSNumericValueType.js +3 -1
- package/es/css/cssom/CSSRGB.js +4 -2
- package/es/css/cssom/CSSStyleValue.d.ts +1 -1
- package/es/css/cssom/CSSStyleValue.js +3 -1
- package/es/css/cssom/CSSTransformComponent.js +3 -1
- package/es/css/cssom/CSSTransformValue.js +3 -1
- package/es/css/cssom/CSSTranslate.js +3 -1
- package/es/css/cssom/CSSUnitValue.js +4 -2
- package/es/css/parser/color.js +2 -2
- package/es/css/parser/dimension.d.ts +2 -1
- package/es/css/parser/dimension.js +2 -2
- package/es/css/parser/numeric.js +1 -1
- package/es/css/parser/path.d.ts +1 -1
- package/es/css/parser/points.js +1 -1
- package/es/css/parser/transform-origin.js +1 -1
- package/es/css/properties/CSSPropertyAnchor.d.ts +4 -2
- package/es/css/properties/CSSPropertyAnchor.js +5 -2
- package/es/css/properties/CSSPropertyClipPath.d.ts +2 -1
- package/es/css/properties/CSSPropertyClipPath.js +4 -2
- package/es/css/properties/CSSPropertyColor.d.ts +3 -2
- package/es/css/properties/CSSPropertyColor.js +4 -2
- package/es/css/properties/CSSPropertyFilter.d.ts +3 -2
- package/es/css/properties/CSSPropertyFilter.js +4 -2
- package/es/css/properties/CSSPropertyLengthOrPercentage.d.ts +4 -2
- package/es/css/properties/CSSPropertyLengthOrPercentage.js +5 -2
- package/es/css/properties/CSSPropertyLineDash.d.ts +4 -2
- package/es/css/properties/CSSPropertyLineDash.js +4 -2
- package/es/css/properties/CSSPropertyLocalPosition.d.ts +4 -2
- package/es/css/properties/CSSPropertyLocalPosition.js +4 -2
- package/es/css/properties/CSSPropertyOffsetDistance.d.ts +4 -2
- package/es/css/properties/CSSPropertyOffsetDistance.js +5 -2
- package/es/css/properties/CSSPropertyOffsetPath.d.ts +2 -1
- package/es/css/properties/CSSPropertyOffsetPath.js +3 -1
- package/es/css/properties/CSSPropertyOpacity.d.ts +3 -2
- package/es/css/properties/CSSPropertyOpacity.js +4 -2
- package/es/css/properties/CSSPropertyPath.d.ts +3 -2
- package/es/css/properties/CSSPropertyPath.js +6 -2
- package/es/css/properties/CSSPropertyPoints.d.ts +3 -2
- package/es/css/properties/CSSPropertyPoints.js +4 -2
- package/es/css/properties/CSSPropertyShadowBlur.d.ts +1 -1
- package/es/css/properties/CSSPropertyShadowBlur.js +4 -2
- package/es/css/properties/CSSPropertyText.d.ts +3 -2
- package/es/css/properties/CSSPropertyText.js +5 -3
- package/es/css/properties/CSSPropertyTextTransform.d.ts +2 -1
- package/es/css/properties/CSSPropertyTextTransform.js +4 -2
- package/es/css/properties/CSSPropertyTransform.d.ts +3 -2
- package/es/css/properties/CSSPropertyTransform.js +5 -3
- package/es/css/properties/CSSPropertyTransformOrigin.d.ts +3 -2
- package/es/css/properties/CSSPropertyTransformOrigin.js +4 -2
- package/es/css/properties/CSSPropertyVisibility.d.ts +3 -1
- package/es/css/properties/CSSPropertyVisibility.js +3 -1
- package/es/css/properties/CSSPropertyZIndex.d.ts +4 -2
- package/es/css/properties/CSSPropertyZIndex.js +4 -2
- package/es/display-objects/Circle.js +3 -1
- package/es/display-objects/CustomElement.js +3 -1
- package/es/display-objects/DisplayObject.js +7 -4
- package/es/display-objects/Ellipse.js +3 -1
- package/es/display-objects/Group.js +3 -1
- package/es/display-objects/HTML.js +6 -3
- package/es/display-objects/Image.js +3 -1
- package/es/display-objects/Line.js +3 -1
- package/es/display-objects/Path.js +5 -3
- package/es/display-objects/Polygon.js +3 -1
- package/es/display-objects/Polyline.js +3 -1
- package/es/display-objects/Rect.js +3 -1
- package/es/display-objects/Text.js +6 -3
- package/es/dom/Animation.js +4 -2
- package/es/dom/AnimationEffectTiming.js +3 -1
- package/es/dom/AnimationEvent.js +3 -1
- package/es/dom/AnimationTimeline.js +3 -1
- package/es/dom/CustomElementRegistry.js +3 -1
- package/es/dom/CustomEvent.js +3 -1
- package/es/dom/Document.js +3 -1
- package/es/dom/Element.js +7 -5
- package/es/dom/EventTarget.js +6 -4
- package/es/dom/FederatedEvent.js +3 -1
- package/es/dom/FederatedMouseEvent.js +3 -1
- package/es/dom/FederatedPointerEvent.js +3 -1
- package/es/dom/FederatedTouchEvent.d.ts +13 -0
- package/es/dom/FederatedTouchEvent.js +19 -0
- package/es/dom/FederatedWheelEvent.js +3 -1
- package/es/dom/KeyframeEffect.js +3 -1
- package/es/dom/KeyframeList.js +1 -1
- package/es/dom/MutationEvent.js +3 -1
- package/es/dom/MutationObserver.js +10 -3
- package/es/dom/MutationRecord.js +3 -1
- package/es/dom/Node.js +4 -2
- package/es/plugins/CullingPlugin.js +3 -1
- package/es/plugins/DirtyCheckPlugin.js +3 -1
- package/es/plugins/EventPlugin.js +4 -2
- package/es/plugins/FrustumCullingStrategy.js +3 -1
- package/es/plugins/PrepareRendererPlugin.js +3 -1
- package/es/services/EventService.js +5 -3
- package/es/services/OffscreenCanvasCreator.js +3 -1
- package/es/services/RenderingService.js +3 -1
- package/es/services/SceneGraphSelector.js +3 -1
- package/es/services/SceneGraphService.js +4 -2
- package/es/services/TextService.js +5 -3
- package/es/services/aabb/CircleUpdater.js +3 -1
- package/es/services/aabb/EllipseUpdater.js +3 -1
- package/es/services/aabb/LineUpdater.js +3 -1
- package/es/services/aabb/PathUpdater.js +3 -1
- package/es/services/aabb/PolylineUpdater.js +3 -1
- package/es/services/aabb/RectUpdater.js +4 -2
- package/es/services/aabb/TextUpdater.d.ts +1 -2
- package/es/services/aabb/TextUpdater.js +3 -1
- package/es/shapes/AABB.js +3 -1
- package/es/shapes/BoundingSphere.js +3 -1
- package/es/shapes/Frustum.js +3 -1
- package/es/shapes/Plane.js +3 -1
- package/es/shapes/Point.js +3 -1
- package/es/shapes/Ray.js +3 -1
- package/es/shapes/Rectangle.js +3 -1
- package/es/types.d.ts +4 -0
- package/es/utils/custom-easing.js +1 -1
- package/es/utils/math.d.ts +1 -2
- package/es/utils/math.js +11 -6
- package/es/utils/path.d.ts +1 -1
- package/es/utils/path.js +3 -3
- package/es/utils/text.js +4 -4
- package/lib/AbstractRenderer.js +3 -1
- package/lib/Canvas.d.ts +1 -1
- package/lib/Canvas.js +5 -3
- package/lib/DisplayObjectPool.js +3 -1
- package/lib/camera/Camera.d.ts +105 -66
- package/lib/camera/Camera.js +314 -179
- package/lib/camera/Landmark.d.ts +18 -25
- package/lib/camera/Landmark.js +1 -75
- package/lib/canvas-module.js +1 -3
- package/lib/components/Cullable.js +4 -2
- package/lib/components/Geometry.js +3 -1
- package/lib/components/Renderable.js +3 -1
- package/lib/components/Sortable.js +3 -1
- package/lib/components/Transform.js +3 -1
- package/lib/css/LayoutRegistry.js +3 -1
- package/lib/css/StyleValueRegistry.d.ts +8 -0
- package/lib/css/StyleValueRegistry.js +27 -20
- package/lib/css/cssom/CSSColorValue.js +3 -1
- package/lib/css/cssom/CSSGradientValue.js +9 -7
- package/lib/css/cssom/CSSKeywordValue.js +3 -1
- package/lib/css/cssom/CSSMathInvert.js +3 -1
- package/lib/css/cssom/CSSMathMax.js +3 -1
- package/lib/css/cssom/CSSMathMin.js +3 -1
- package/lib/css/cssom/CSSMathNegate.js +3 -1
- package/lib/css/cssom/CSSMathOperator.js +1 -1
- package/lib/css/cssom/CSSMathProduct.js +3 -1
- package/lib/css/cssom/CSSMathSum.js +3 -1
- package/lib/css/cssom/CSSMathValue.js +3 -1
- package/lib/css/cssom/CSSMathVariadic.js +4 -2
- package/lib/css/cssom/CSSNumericValue.js +3 -1
- package/lib/css/cssom/CSSNumericValueType.d.ts +1 -1
- package/lib/css/cssom/CSSNumericValueType.js +5 -3
- package/lib/css/cssom/CSSRGB.js +4 -2
- package/lib/css/cssom/CSSStyleValue.d.ts +1 -1
- package/lib/css/cssom/CSSStyleValue.js +4 -2
- package/lib/css/cssom/CSSTransformComponent.js +4 -2
- package/lib/css/cssom/CSSTransformValue.js +3 -1
- package/lib/css/cssom/CSSTranslate.js +3 -1
- package/lib/css/cssom/CSSUnitValue.js +4 -2
- package/lib/css/cssom/types.js +1 -1
- package/lib/css/parser/color.js +7 -7
- package/lib/css/parser/dimension.d.ts +2 -1
- package/lib/css/parser/dimension.js +9 -8
- package/lib/css/parser/numeric.js +6 -6
- package/lib/css/parser/path.d.ts +1 -1
- package/lib/css/parser/path.js +1 -1
- package/lib/css/parser/points.js +2 -2
- package/lib/css/parser/transform-origin.js +2 -2
- package/lib/css/parser/transform.js +2 -2
- package/lib/css/properties/CSSPropertyAnchor.d.ts +4 -2
- package/lib/css/properties/CSSPropertyAnchor.js +8 -4
- package/lib/css/properties/CSSPropertyClipPath.d.ts +2 -1
- package/lib/css/properties/CSSPropertyClipPath.js +5 -3
- package/lib/css/properties/CSSPropertyColor.d.ts +3 -2
- package/lib/css/properties/CSSPropertyColor.js +6 -4
- package/lib/css/properties/CSSPropertyFilter.d.ts +3 -2
- package/lib/css/properties/CSSPropertyFilter.js +5 -3
- package/lib/css/properties/CSSPropertyLengthOrPercentage.d.ts +4 -2
- package/lib/css/properties/CSSPropertyLengthOrPercentage.js +14 -10
- package/lib/css/properties/CSSPropertyLineDash.d.ts +4 -2
- package/lib/css/properties/CSSPropertyLineDash.js +6 -4
- package/lib/css/properties/CSSPropertyLocalPosition.d.ts +4 -2
- package/lib/css/properties/CSSPropertyLocalPosition.js +6 -4
- package/lib/css/properties/CSSPropertyOffsetDistance.d.ts +4 -2
- package/lib/css/properties/CSSPropertyOffsetDistance.js +9 -5
- package/lib/css/properties/CSSPropertyOffsetPath.d.ts +2 -1
- package/lib/css/properties/CSSPropertyOffsetPath.js +3 -1
- package/lib/css/properties/CSSPropertyOpacity.d.ts +3 -2
- package/lib/css/properties/CSSPropertyOpacity.js +6 -4
- package/lib/css/properties/CSSPropertyPath.d.ts +3 -2
- package/lib/css/properties/CSSPropertyPath.js +12 -6
- package/lib/css/properties/CSSPropertyPoints.d.ts +3 -2
- package/lib/css/properties/CSSPropertyPoints.js +5 -3
- package/lib/css/properties/CSSPropertyShadowBlur.d.ts +1 -1
- package/lib/css/properties/CSSPropertyShadowBlur.js +5 -3
- package/lib/css/properties/CSSPropertyText.d.ts +3 -2
- package/lib/css/properties/CSSPropertyText.js +6 -4
- package/lib/css/properties/CSSPropertyTextTransform.d.ts +2 -1
- package/lib/css/properties/CSSPropertyTextTransform.js +8 -6
- package/lib/css/properties/CSSPropertyTransform.d.ts +3 -2
- package/lib/css/properties/CSSPropertyTransform.js +26 -24
- package/lib/css/properties/CSSPropertyTransformOrigin.d.ts +3 -2
- package/lib/css/properties/CSSPropertyTransformOrigin.js +5 -3
- package/lib/css/properties/CSSPropertyVisibility.d.ts +3 -1
- package/lib/css/properties/CSSPropertyVisibility.js +3 -1
- package/lib/css/properties/CSSPropertyZIndex.d.ts +4 -2
- package/lib/css/properties/CSSPropertyZIndex.js +5 -3
- package/lib/display-objects/Circle.js +3 -1
- package/lib/display-objects/CustomElement.js +3 -1
- package/lib/display-objects/DisplayObject.js +14 -11
- package/lib/display-objects/Ellipse.js +3 -1
- package/lib/display-objects/Group.js +3 -1
- package/lib/display-objects/HTML.js +6 -4
- package/lib/display-objects/Image.js +3 -1
- package/lib/display-objects/Line.js +3 -1
- package/lib/display-objects/Path.js +8 -6
- package/lib/display-objects/Polygon.js +3 -1
- package/lib/display-objects/Polyline.js +3 -1
- package/lib/display-objects/Rect.js +3 -1
- package/lib/display-objects/Text.js +6 -4
- package/lib/dom/Animation.js +4 -2
- package/lib/dom/AnimationEffectTiming.js +3 -1
- package/lib/dom/AnimationEvent.js +3 -1
- package/lib/dom/AnimationTimeline.js +4 -2
- package/lib/dom/CustomElementRegistry.js +3 -1
- package/lib/dom/CustomEvent.js +3 -1
- package/lib/dom/Document.js +3 -1
- package/lib/dom/Element.js +8 -6
- package/lib/dom/EventTarget.js +13 -11
- package/lib/dom/FederatedEvent.js +3 -1
- package/lib/dom/FederatedMouseEvent.js +3 -1
- package/lib/dom/FederatedPointerEvent.js +3 -1
- package/lib/dom/FederatedTouchEvent.d.ts +13 -0
- package/lib/dom/FederatedTouchEvent.js +27 -0
- package/lib/dom/FederatedWheelEvent.js +3 -1
- package/lib/dom/KeyframeEffect.js +4 -2
- package/lib/dom/KeyframeList.js +1 -1
- package/lib/dom/MutationEvent.js +3 -1
- package/lib/dom/MutationObserver.js +11 -4
- package/lib/dom/MutationRecord.js +3 -1
- package/lib/dom/Node.js +4 -2
- package/lib/index.js +1 -1
- package/lib/plugins/CullingPlugin.js +4 -2
- package/lib/plugins/DirtyCheckPlugin.js +3 -1
- package/lib/plugins/EventPlugin.js +26 -24
- package/lib/plugins/FrustumCullingStrategy.js +3 -1
- package/lib/plugins/PrepareRendererPlugin.js +3 -1
- package/lib/services/EventService.js +5 -3
- package/lib/services/OffscreenCanvasCreator.js +3 -1
- package/lib/services/RenderingService.js +3 -1
- package/lib/services/SceneGraphSelector.js +4 -2
- package/lib/services/SceneGraphService.js +7 -5
- package/lib/services/TextService.js +5 -3
- package/lib/services/aabb/CircleUpdater.js +3 -1
- package/lib/services/aabb/EllipseUpdater.js +3 -1
- package/lib/services/aabb/LineUpdater.js +3 -1
- package/lib/services/aabb/PathUpdater.js +3 -1
- package/lib/services/aabb/PolylineUpdater.js +3 -1
- package/lib/services/aabb/RectUpdater.js +5 -3
- package/lib/services/aabb/TextUpdater.d.ts +1 -2
- package/lib/services/aabb/TextUpdater.js +3 -1
- package/lib/services/aabb/index.js +10 -10
- package/lib/services/aabb/interfaces.js +1 -1
- package/lib/shapes/AABB.js +3 -1
- package/lib/shapes/BoundingSphere.js +3 -1
- package/lib/shapes/Frustum.js +4 -2
- package/lib/shapes/Plane.js +3 -1
- package/lib/shapes/Point.js +3 -1
- package/lib/shapes/Ray.js +3 -1
- package/lib/shapes/Rectangle.js +3 -1
- package/lib/types.d.ts +4 -0
- package/lib/types.js +1 -1
- package/lib/utils/animation.js +3 -2
- package/lib/utils/bezier-easing.js +1 -1
- package/lib/utils/custom-easing.js +2 -2
- package/lib/utils/math.d.ts +1 -2
- package/lib/utils/math.js +20 -17
- package/lib/utils/path.d.ts +1 -1
- package/lib/utils/path.js +6 -6
- package/lib/utils/text.js +5 -5
- package/package.json +7 -5
|
@@ -15,7 +15,9 @@ var _manaSyringe = require("mana-syringe");
|
|
|
15
15
|
* - g-plugin-canvas-picker `ctx.isPointInPath`
|
|
16
16
|
* - g-plugin-webgl-renderer `ctx.createLinearGradient` and generate texture
|
|
17
17
|
*/
|
|
18
|
-
var OffscreenCanvasCreator =
|
|
18
|
+
var OffscreenCanvasCreator =
|
|
19
|
+
/** @class */
|
|
20
|
+
function () {
|
|
19
21
|
function OffscreenCanvasCreator() {}
|
|
20
22
|
|
|
21
23
|
OffscreenCanvasCreator.prototype.getOrCreateCanvas = function (offscreenCanvas) {
|
|
@@ -33,7 +33,9 @@ var RenderingPluginContribution = _manaSyringe.Syringe.defineToken('RenderingPlu
|
|
|
33
33
|
|
|
34
34
|
exports.RenderingPluginContribution = RenderingPluginContribution;
|
|
35
35
|
|
|
36
|
-
var RenderingService =
|
|
36
|
+
var RenderingService =
|
|
37
|
+
/** @class */
|
|
38
|
+
function () {
|
|
37
39
|
function RenderingService() {
|
|
38
40
|
this.inited = false;
|
|
39
41
|
this.stats = {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.SceneGraphSelectorFactory = exports.SceneGraphSelector = exports.DefaultSceneGraphSelector = void 0;
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
@@ -29,7 +29,9 @@ var NAME_REGEXP = /\[\s*name=(.*)\s*\]/;
|
|
|
29
29
|
* * querySelectorAll
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
|
-
var DefaultSceneGraphSelector =
|
|
32
|
+
var DefaultSceneGraphSelector =
|
|
33
|
+
/** @class */
|
|
34
|
+
function () {
|
|
33
35
|
function DefaultSceneGraphSelector() {}
|
|
34
36
|
|
|
35
37
|
DefaultSceneGraphSelector.prototype.selectOne = function (query, root) {
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.SceneGraphService = exports.DefaultSceneGraphService = void 0;
|
|
7
7
|
exports.dirtifyToRoot = dirtifyToRoot;
|
|
8
|
-
exports.
|
|
8
|
+
exports.sortByZIndex = sortByZIndex;
|
|
9
9
|
|
|
10
10
|
var _tslib = require("tslib");
|
|
11
11
|
|
|
12
12
|
var _manaSyringe = require("mana-syringe");
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _lodashEs = require("lodash-es");
|
|
15
15
|
|
|
16
16
|
var _glMatrix = require("gl-matrix");
|
|
17
17
|
|
|
@@ -74,7 +74,9 @@ var SceneGraphService = _manaSyringe.Syringe.defineToken('SceneGraphService');
|
|
|
74
74
|
|
|
75
75
|
exports.SceneGraphService = SceneGraphService;
|
|
76
76
|
|
|
77
|
-
var DefaultSceneGraphService =
|
|
77
|
+
var DefaultSceneGraphService =
|
|
78
|
+
/** @class */
|
|
79
|
+
function () {
|
|
78
80
|
function DefaultSceneGraphService() {
|
|
79
81
|
var _this = this;
|
|
80
82
|
/**
|
|
@@ -356,7 +358,7 @@ var DefaultSceneGraphService = function () {
|
|
|
356
358
|
|
|
357
359
|
child.parentNode = parent;
|
|
358
360
|
|
|
359
|
-
if (!(0,
|
|
361
|
+
if (!(0, _lodashEs.isNil)(index)) {
|
|
360
362
|
child.parentNode.childNodes.splice(index, 0, child);
|
|
361
363
|
} else {
|
|
362
364
|
child.parentNode.childNodes.push(child);
|
|
@@ -36,10 +36,12 @@ var regexCannotStartJaJp = /[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾー
|
|
|
36
36
|
var regexCannotEndJaJp = /[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/;
|
|
37
37
|
var regexCannotStartKoKr = /[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/;
|
|
38
38
|
var regexCannotEndKoKr = /[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/;
|
|
39
|
-
var regexCannotStart = new RegExp(regexCannotStartZhCn.source
|
|
40
|
-
var regexCannotEnd = new RegExp(regexCannotEndZhCn.source
|
|
39
|
+
var regexCannotStart = new RegExp("".concat(regexCannotStartZhCn.source, "|").concat(regexCannotStartZhTw.source, "|").concat(regexCannotStartJaJp.source, "|").concat(regexCannotStartKoKr.source));
|
|
40
|
+
var regexCannotEnd = new RegExp("".concat(regexCannotEndZhCn.source, "|").concat(regexCannotEndZhTw.source, "|").concat(regexCannotEndJaJp.source, "|").concat(regexCannotEndKoKr.source));
|
|
41
41
|
|
|
42
|
-
var TextService =
|
|
42
|
+
var TextService =
|
|
43
|
+
/** @class */
|
|
44
|
+
function () {
|
|
43
45
|
function TextService() {
|
|
44
46
|
var _this = this;
|
|
45
47
|
|
|
@@ -13,7 +13,9 @@ var _interfaces = require("./interfaces");
|
|
|
13
13
|
|
|
14
14
|
var _types = require("../../types");
|
|
15
15
|
|
|
16
|
-
var CircleUpdater =
|
|
16
|
+
var CircleUpdater =
|
|
17
|
+
/** @class */
|
|
18
|
+
function () {
|
|
17
19
|
function CircleUpdater() {}
|
|
18
20
|
|
|
19
21
|
CircleUpdater.prototype.update = function (parsedStyle, object) {
|
|
@@ -13,7 +13,9 @@ var _interfaces = require("./interfaces");
|
|
|
13
13
|
|
|
14
14
|
var _types = require("../../types");
|
|
15
15
|
|
|
16
|
-
var EllipseUpdater =
|
|
16
|
+
var EllipseUpdater =
|
|
17
|
+
/** @class */
|
|
18
|
+
function () {
|
|
17
19
|
function EllipseUpdater() {}
|
|
18
20
|
|
|
19
21
|
EllipseUpdater.prototype.update = function (parsedStyle, object) {
|
|
@@ -13,7 +13,9 @@ var _interfaces = require("./interfaces");
|
|
|
13
13
|
|
|
14
14
|
var _types = require("../../types");
|
|
15
15
|
|
|
16
|
-
var LineUpdater =
|
|
16
|
+
var LineUpdater =
|
|
17
|
+
/** @class */
|
|
18
|
+
function () {
|
|
17
19
|
function LineUpdater() {}
|
|
18
20
|
|
|
19
21
|
LineUpdater.prototype.update = function (parsedStyle) {
|
|
@@ -13,7 +13,9 @@ var _interfaces = require("./interfaces");
|
|
|
13
13
|
|
|
14
14
|
var _types = require("../../types");
|
|
15
15
|
|
|
16
|
-
var PathUpdater =
|
|
16
|
+
var PathUpdater =
|
|
17
|
+
/** @class */
|
|
18
|
+
function () {
|
|
17
19
|
function PathUpdater() {}
|
|
18
20
|
|
|
19
21
|
PathUpdater.prototype.update = function (parsedStyle) {
|
|
@@ -13,7 +13,9 @@ var _interfaces = require("./interfaces");
|
|
|
13
13
|
|
|
14
14
|
var _types = require("../../types");
|
|
15
15
|
|
|
16
|
-
var PolylineUpdater =
|
|
16
|
+
var PolylineUpdater =
|
|
17
|
+
/** @class */
|
|
18
|
+
function () {
|
|
17
19
|
function PolylineUpdater() {}
|
|
18
20
|
|
|
19
21
|
PolylineUpdater.prototype.update = function (parsedStyle) {
|
|
@@ -9,7 +9,7 @@ var _tslib = require("tslib");
|
|
|
9
9
|
|
|
10
10
|
var _manaSyringe = require("mana-syringe");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _lodashEs = require("lodash-es");
|
|
13
13
|
|
|
14
14
|
var _interfaces = require("./interfaces");
|
|
15
15
|
|
|
@@ -17,7 +17,9 @@ var _types = require("../../types");
|
|
|
17
17
|
|
|
18
18
|
var _css = require("../../css");
|
|
19
19
|
|
|
20
|
-
var RectUpdater =
|
|
20
|
+
var RectUpdater =
|
|
21
|
+
/** @class */
|
|
22
|
+
function () {
|
|
21
23
|
function RectUpdater() {}
|
|
22
24
|
|
|
23
25
|
RectUpdater.prototype.update = function (parsedStyle, object) {
|
|
@@ -42,7 +44,7 @@ var RectUpdater = function () {
|
|
|
42
44
|
} // resize with HTMLImageElement's size
|
|
43
45
|
|
|
44
46
|
|
|
45
|
-
if (img && !(0,
|
|
47
|
+
if (img && !(0, _lodashEs.isString)(img)) {
|
|
46
48
|
if (!contentWidth) {
|
|
47
49
|
contentWidth = img.width;
|
|
48
50
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GeometryAABBUpdater } from './interfaces';
|
|
2
|
-
import type { ParsedTextStyleProps } from '../../display-objects
|
|
3
|
-
import type { DisplayObject } from '../..';
|
|
2
|
+
import type { DisplayObject, ParsedTextStyleProps } from '../../display-objects';
|
|
4
3
|
export declare class TextUpdater implements GeometryAABBUpdater<ParsedTextStyleProps> {
|
|
5
4
|
private textService;
|
|
6
5
|
private isReadyToMeasure;
|
|
@@ -19,7 +19,9 @@ var _types = require("../../types");
|
|
|
19
19
|
|
|
20
20
|
var _css = require("../../css");
|
|
21
21
|
|
|
22
|
-
var TextUpdater =
|
|
22
|
+
var TextUpdater =
|
|
23
|
+
/** @class */
|
|
24
|
+
function () {
|
|
23
25
|
function TextUpdater() {}
|
|
24
26
|
|
|
25
27
|
TextUpdater.prototype.isReadyToMeasure = function (parsedStyle, object) {
|
|
@@ -24,34 +24,34 @@ Object.defineProperty(exports, "EllipseUpdater", {
|
|
|
24
24
|
return _EllipseUpdater.EllipseUpdater;
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
-
Object.defineProperty(exports, "
|
|
27
|
+
Object.defineProperty(exports, "LineUpdater", {
|
|
28
28
|
enumerable: true,
|
|
29
29
|
get: function get() {
|
|
30
|
-
return
|
|
30
|
+
return _LineUpdater.LineUpdater;
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
|
-
Object.defineProperty(exports, "
|
|
33
|
+
Object.defineProperty(exports, "PathUpdater", {
|
|
34
34
|
enumerable: true,
|
|
35
35
|
get: function get() {
|
|
36
|
-
return
|
|
36
|
+
return _PathUpdater.PathUpdater;
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
-
Object.defineProperty(exports, "
|
|
39
|
+
Object.defineProperty(exports, "PolylineUpdater", {
|
|
40
40
|
enumerable: true,
|
|
41
41
|
get: function get() {
|
|
42
|
-
return
|
|
42
|
+
return _PolylineUpdater.PolylineUpdater;
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
|
-
Object.defineProperty(exports, "
|
|
45
|
+
Object.defineProperty(exports, "RectUpdater", {
|
|
46
46
|
enumerable: true,
|
|
47
47
|
get: function get() {
|
|
48
|
-
return
|
|
48
|
+
return _RectUpdater.RectUpdater;
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
|
-
Object.defineProperty(exports, "
|
|
51
|
+
Object.defineProperty(exports, "TextUpdater", {
|
|
52
52
|
enumerable: true,
|
|
53
53
|
get: function get() {
|
|
54
|
-
return
|
|
54
|
+
return _TextUpdater.TextUpdater;
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
|
package/lib/shapes/AABB.js
CHANGED
|
@@ -12,7 +12,9 @@ var _glMatrix = require("gl-matrix");
|
|
|
12
12
|
* 为了便于后续 Frustum Culling,通过查找表定义 p-vertex 和 n-vertex
|
|
13
13
|
* @see https://github.com/antvis/GWebGPUEngine/issues/3
|
|
14
14
|
*/
|
|
15
|
-
var AABB =
|
|
15
|
+
var AABB =
|
|
16
|
+
/** @class */
|
|
17
|
+
function () {
|
|
16
18
|
function AABB(center, halfExtents) {
|
|
17
19
|
this.min = _glMatrix.vec3.create();
|
|
18
20
|
this.max = _glMatrix.vec3.create();
|
|
@@ -9,7 +9,9 @@ var _glMatrix = require("gl-matrix");
|
|
|
9
9
|
|
|
10
10
|
var tmpVecA = _glMatrix.vec3.create();
|
|
11
11
|
|
|
12
|
-
var BoundingSphere =
|
|
12
|
+
var BoundingSphere =
|
|
13
|
+
/** @class */
|
|
14
|
+
function () {
|
|
13
15
|
function BoundingSphere(center, radius) {
|
|
14
16
|
this.center = center || _glMatrix.vec3.create();
|
|
15
17
|
this.radius = radius || 0.5;
|
package/lib/shapes/Frustum.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.Mask = exports.Frustum = void 0;
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
@@ -20,7 +20,9 @@ exports.Mask = Mask;
|
|
|
20
20
|
Mask[Mask["INDETERMINATE"] = 2147483647] = "INDETERMINATE";
|
|
21
21
|
})(Mask || (exports.Mask = Mask = {}));
|
|
22
22
|
|
|
23
|
-
var Frustum =
|
|
23
|
+
var Frustum =
|
|
24
|
+
/** @class */
|
|
25
|
+
function () {
|
|
24
26
|
function Frustum(planes) {
|
|
25
27
|
this.planes = [];
|
|
26
28
|
|
package/lib/shapes/Plane.js
CHANGED
|
@@ -7,7 +7,9 @@ exports.Plane = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _glMatrix = require("gl-matrix");
|
|
9
9
|
|
|
10
|
-
var Plane =
|
|
10
|
+
var Plane =
|
|
11
|
+
/** @class */
|
|
12
|
+
function () {
|
|
11
13
|
function Plane(distance, normal) {
|
|
12
14
|
this.distance = distance || 0;
|
|
13
15
|
this.normal = normal || _glMatrix.vec3.fromValues(0, 1, 0);
|
package/lib/shapes/Point.js
CHANGED
package/lib/shapes/Ray.js
CHANGED
|
@@ -24,7 +24,9 @@ var tmpVecE = _glMatrix.vec3.create();
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var Ray =
|
|
27
|
+
var Ray =
|
|
28
|
+
/** @class */
|
|
29
|
+
function () {
|
|
28
30
|
function Ray(origin, direction) {
|
|
29
31
|
this.origin = origin || _glMatrix.vec3.create();
|
|
30
32
|
this.direction = direction || _glMatrix.vec3.fromValues(0, 0, -1);
|
package/lib/shapes/Rectangle.js
CHANGED
package/lib/types.d.ts
CHANGED
|
@@ -120,6 +120,10 @@ export interface BaseStyleProps {
|
|
|
120
120
|
opacity?: number;
|
|
121
121
|
/** 线宽 */
|
|
122
122
|
lineWidth?: string | number;
|
|
123
|
+
/**
|
|
124
|
+
* 交互区域
|
|
125
|
+
*/
|
|
126
|
+
hitArea?: DisplayObject | null;
|
|
123
127
|
/** 指定如何绘制每一条线段末端 */
|
|
124
128
|
lineCap?: CanvasLineCap;
|
|
125
129
|
/** 用来设置2个长度不为0的相连部分(线段,圆弧,曲线)如何连接在一起的属性(长度为0的变形部分,其指定的末端和控制点在同一位置,会被忽略) */
|
package/lib/types.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.TextTransform = exports.TextAlign = exports.Shape = exports.LineJoin = exports.LineCap = exports.CanvasConfig = void 0;
|
|
7
7
|
|
|
8
8
|
var _manaSyringe = require("mana-syringe");
|
|
9
9
|
|
package/lib/utils/animation.js
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.EasingKeys = exports.EASINGS = void 0;
|
|
7
7
|
exports.calculateActiveDuration = calculateActiveDuration;
|
|
8
8
|
exports.calculateIterationProgress = calculateIterationProgress;
|
|
9
|
-
exports.
|
|
9
|
+
exports.linear = exports.getEase = void 0;
|
|
10
|
+
exports.parseEasingFunction = parseEasingFunction;
|
|
10
11
|
|
|
11
12
|
var _tslib = require("tslib");
|
|
12
13
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.newtonRaphsonIterate = exports.kSplineTableSize = exports.kSampleStepSize = exports.getSlope = exports.float32ArraySupported = exports.calcBezier = exports.binarySubdivide = exports.bezier = exports.SUBDIVISION_PRECISION = exports.SUBDIVISION_MAX_ITERATIONS = exports.NEWTON_MIN_SLOPE = exports.NEWTON_ITERATIONS = exports.C = exports.B = exports.A = void 0;
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* https://github.com/gre/bezier-easing
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.parseEasingParameters = exports.limit = exports.getEasingFunction = exports.easein = exports.convertToDash = exports.complexEasingSyntax = exports.Steps = exports.Spring = exports.Sine = exports.Quint = exports.Quart = exports.Quad = exports.INTINITE_LOOP_LIMIT = exports.Expo = exports.Elastic = exports.EasingFunctions = exports.EasingDurationCache = exports.EaseOutIn = exports.EaseOut = exports.EaseInOut = exports.Cubic = exports.Circ = exports.Bounce = exports.Bezier = exports.Back = void 0;
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
@@ -14,7 +14,7 @@ var _bezierEasing = require("./bezier-easing");
|
|
|
14
14
|
*/
|
|
15
15
|
var convertToDash = function convertToDash(str) {
|
|
16
16
|
str = str.replace(/([A-Z])/g, function (letter) {
|
|
17
|
-
return "-"
|
|
17
|
+
return "-".concat(letter.toLowerCase());
|
|
18
18
|
}); // Remove first dash
|
|
19
19
|
|
|
20
20
|
return str.charAt(0) === '-' ? str.substr(1) : str;
|
package/lib/utils/math.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { quat, vec2, vec4 } from 'gl-matrix';
|
|
2
2
|
import { mat3, mat4, vec3 } from 'gl-matrix';
|
|
3
|
-
export declare function getAngle(angle
|
|
3
|
+
export declare function getAngle(angle?: number): number;
|
|
4
4
|
export declare function createVec3(x: number | vec2 | vec3 | vec4, y?: number, z?: number): vec3;
|
|
5
5
|
export declare function deg2rad(deg: number): number;
|
|
6
6
|
export declare function rad2deg(rad: number): number;
|
|
@@ -25,5 +25,4 @@ export declare function getRotationInRadians(mat: mat3): number;
|
|
|
25
25
|
export declare function getEuler(out: vec3, quat: quat | mat4): vec3;
|
|
26
26
|
export declare function fromRotationTranslationScale(rotation: number, x: number, y: number, scaleX: number, scaleY: number): mat3;
|
|
27
27
|
export declare function makePerspective(out: mat4, left: number, right: number, top: number, bottom: number, near: number, far: number): mat4;
|
|
28
|
-
export declare function blend(from: number, to: number, progress: number): number;
|
|
29
28
|
export declare function decompose(mat: mat3): number[];
|
package/lib/utils/math.js
CHANGED
|
@@ -3,25 +3,24 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getAngle = getAngle;
|
|
7
6
|
exports.createVec3 = createVec3;
|
|
7
|
+
exports.decompose = decompose;
|
|
8
8
|
exports.deg2rad = deg2rad;
|
|
9
|
-
exports.rad2deg = rad2deg;
|
|
10
|
-
exports.grad2deg = grad2deg;
|
|
11
9
|
exports.deg2turn = deg2turn;
|
|
12
|
-
exports.
|
|
10
|
+
exports.fromRotationTranslationScale = fromRotationTranslationScale;
|
|
11
|
+
exports.getAngle = getAngle;
|
|
12
|
+
exports.getEuler = getEuler;
|
|
13
|
+
exports.getRotationInRadians = getRotationInRadians;
|
|
13
14
|
exports.getScaling = getScaling;
|
|
14
15
|
exports.getTranslation = getTranslation;
|
|
15
|
-
exports.
|
|
16
|
-
exports.getEuler = getEuler;
|
|
17
|
-
exports.fromRotationTranslationScale = fromRotationTranslationScale;
|
|
16
|
+
exports.grad2deg = grad2deg;
|
|
18
17
|
exports.makePerspective = makePerspective;
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
18
|
+
exports.rad2deg = rad2deg;
|
|
19
|
+
exports.turn2deg = turn2deg;
|
|
21
20
|
|
|
22
21
|
var _tslib = require("tslib");
|
|
23
22
|
|
|
24
|
-
var
|
|
23
|
+
var _lodashEs = require("lodash-es");
|
|
25
24
|
|
|
26
25
|
var _glMatrix = require("gl-matrix");
|
|
27
26
|
|
|
@@ -36,15 +35,23 @@ function getAngle(angle) {
|
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
function createVec3(x, y, z) {
|
|
39
|
-
if (
|
|
38
|
+
if (y === void 0) {
|
|
39
|
+
y = 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (z === void 0) {
|
|
43
|
+
z = 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if ((0, _lodashEs.isNumber)(x)) {
|
|
40
47
|
return _glMatrix.vec3.fromValues(x, y, z);
|
|
41
48
|
}
|
|
42
49
|
|
|
43
|
-
if (x.length === 3) {
|
|
50
|
+
if ((0, _lodashEs.isArray)(x) && x.length === 3) {
|
|
44
51
|
return _glMatrix.vec3.clone(x);
|
|
45
52
|
}
|
|
46
53
|
|
|
47
|
-
return _glMatrix.vec3.fromValues(x[0], x[1], x[2] ||
|
|
54
|
+
return _glMatrix.vec3.fromValues(x[0], x[1] || y, x[2] || z);
|
|
48
55
|
}
|
|
49
56
|
|
|
50
57
|
function deg2rad(deg) {
|
|
@@ -214,10 +221,6 @@ function makePerspective(out, left, right, top, bottom, near, far) {
|
|
|
214
221
|
return out;
|
|
215
222
|
}
|
|
216
223
|
|
|
217
|
-
function blend(from, to, progress) {
|
|
218
|
-
return from + (to - from) * progress;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
224
|
function decompose(mat) {
|
|
222
225
|
var row0x = mat[0];
|
|
223
226
|
var row0y = mat[3];
|
package/lib/utils/path.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare function getDrawDirection(pathArray: PathCommand[]): boolean;
|
|
|
5
5
|
export declare function getPathArea(pathArray: PathCommand[]): number;
|
|
6
6
|
export declare function reverseCurve(pathArray: PathCommand[]): PathCommand[];
|
|
7
7
|
export declare function clonePath(pathArray: PathCommand[]): PathCommand[];
|
|
8
|
-
export declare function getRotatedCurve(a: PathCommand[], b: PathCommand[]): (string[] | ["a" | "A", number, number, number, number, number, number, number] | ["
|
|
8
|
+
export declare function getRotatedCurve(a: PathCommand[], b: PathCommand[]): (string[] | ["a" | "A", number, number, number, number, number, number, number] | ["C" | "c", number, number, number, number, number, number] | ["o" | "O", number, number] | ["h" | "H", number] | ["l" | "L", number, number] | ["m" | "M", number, number] | ["r" | "R", number, number, number, number] | ["q" | "Q", number, number, number, number] | ["s" | "S", number, number, number, number, number, number, number] | ["t" | "T", number, number] | ["v" | "V", number] | ["U" | "u", number, number, number])[];
|
|
9
9
|
/**
|
|
10
10
|
* convert object to path, should account for:
|
|
11
11
|
* * transform & origin
|
package/lib/utils/path.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.clonePath = clonePath;
|
|
7
|
+
exports.convertToPath = convertToPath;
|
|
6
8
|
exports.equalizeSegments = equalizeSegments;
|
|
7
9
|
exports.getDrawDirection = getDrawDirection;
|
|
8
10
|
exports.getPathArea = getPathArea;
|
|
9
|
-
exports.reverseCurve = reverseCurve;
|
|
10
|
-
exports.clonePath = clonePath;
|
|
11
11
|
exports.getRotatedCurve = getRotatedCurve;
|
|
12
|
-
exports.
|
|
12
|
+
exports.reverseCurve = reverseCurve;
|
|
13
13
|
|
|
14
14
|
var _tslib = require("tslib");
|
|
15
15
|
|
|
@@ -236,7 +236,7 @@ function commandsToPathString(commands, localTransform, anchor, parsedStyle) {
|
|
|
236
236
|
|
|
237
237
|
_glMatrix.vec3.transformMat4(p, p, localTransform);
|
|
238
238
|
|
|
239
|
-
path = ""
|
|
239
|
+
path = "".concat(cur[0]).concat(p[0], ",").concat(p[1]);
|
|
240
240
|
} else if (cur[0] === 'Z') {
|
|
241
241
|
path = cur[0];
|
|
242
242
|
} else if (cur[0] === 'C') {
|
|
@@ -252,13 +252,13 @@ function commandsToPathString(commands, localTransform, anchor, parsedStyle) {
|
|
|
252
252
|
|
|
253
253
|
_glMatrix.vec3.transformMat4(p3, p3, localTransform);
|
|
254
254
|
|
|
255
|
-
path = ""
|
|
255
|
+
path = "".concat(cur[0]).concat(p1[0], ",").concat(p1[1], ",").concat(p2[0], ",").concat(p2[1], ",").concat(p3[0], ",").concat(p3[1]);
|
|
256
256
|
} else if (cur[0] === 'A') {
|
|
257
257
|
var c = _glMatrix.vec3.fromValues(cur[6] - defX, cur[7] - defY, 0);
|
|
258
258
|
|
|
259
259
|
_glMatrix.vec3.transformMat4(c, c, localTransform);
|
|
260
260
|
|
|
261
|
-
path = ""
|
|
261
|
+
path = "".concat(cur[0]).concat(cur[1], ",").concat(cur[2], ",").concat(cur[3], ",").concat(cur[4], ",").concat(cur[5], ",").concat(c[0], ",").concat(c[1]);
|
|
262
262
|
}
|
|
263
263
|
|
|
264
264
|
return prev += path;
|
package/lib/utils/text.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.toFontString = toFontString;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _lodashEs = require("lodash-es");
|
|
9
9
|
|
|
10
10
|
var genericFontFamilies = ['serif', 'sans-serif', 'monospace', 'cursive', 'fantasy', 'system-ui'];
|
|
11
11
|
|
|
@@ -16,22 +16,22 @@ function toFontString(attributes) {
|
|
|
16
16
|
fontVariant = attributes.fontVariant,
|
|
17
17
|
fontWeight = attributes.fontWeight; // build canvas api font setting from individual components. Convert a numeric this.fontSize to px
|
|
18
18
|
|
|
19
|
-
var fontSizeString = (0,
|
|
19
|
+
var fontSizeString = (0, _lodashEs.isNumber)(fontSize) ? "".concat(fontSize, "px") : fontSize.toString(); // Clean-up fontFamily property by quoting each font name
|
|
20
20
|
// this will support font names with spaces
|
|
21
21
|
// @ts-ignore
|
|
22
22
|
|
|
23
|
-
var fontFamilies = (0,
|
|
23
|
+
var fontFamilies = (0, _lodashEs.isString)(fontFamily) ? fontFamily.split(',') : [fontFamily.value];
|
|
24
24
|
|
|
25
25
|
for (var i = fontFamilies.length - 1; i >= 0; i--) {
|
|
26
26
|
// Trim any extra white-space
|
|
27
27
|
var fontFamily_1 = fontFamilies[i].trim(); // Check if font already contains strings
|
|
28
28
|
|
|
29
29
|
if (!/([\"\'])[^\'\"]+\1/.test(fontFamily_1) && genericFontFamilies.indexOf(fontFamily_1) < 0) {
|
|
30
|
-
fontFamily_1 = "\""
|
|
30
|
+
fontFamily_1 = "\"".concat(fontFamily_1, "\"");
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
fontFamilies[i] = fontFamily_1;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
return fontStyle
|
|
36
|
+
return "".concat(fontStyle, " ").concat(fontVariant, " ").concat(fontWeight, " ").concat(fontSizeString, " ").concat(fontFamilies.join(','));
|
|
37
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g",
|
|
3
|
-
"version": "5.0.22
|
|
3
|
+
"version": "5.0.22",
|
|
4
4
|
"description": "A core module including ECS and DI container.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -32,18 +32,20 @@
|
|
|
32
32
|
"url": "https://github.com/antvis/g/issues"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
+
"@types/d3-color": "^3.0.2",
|
|
35
36
|
"@types/gl-matrix": "^2.4.5",
|
|
37
|
+
"@types/lodash-es": "^4.17.6",
|
|
36
38
|
"@types/offscreencanvas": "^2019.6.1"
|
|
37
39
|
},
|
|
38
40
|
"homepage": "https://github.com/antvis/g#readme",
|
|
39
41
|
"dependencies": {
|
|
40
|
-
"@antv/g-math": "^1.0.19
|
|
41
|
-
"@antv/path-util": "^
|
|
42
|
-
"@antv/util": "^2.0.13",
|
|
42
|
+
"@antv/g-math": "^1.0.19",
|
|
43
|
+
"@antv/path-util": "^3.0.1",
|
|
43
44
|
"@types/offscreencanvas": "^2019.6.4",
|
|
44
45
|
"d3-color": "^1.4.0",
|
|
45
46
|
"eventemitter3": "^4.0.0",
|
|
46
47
|
"gl-matrix": "^3.1.0",
|
|
48
|
+
"lodash-es": "^4.17.21",
|
|
47
49
|
"mana-syringe": "^0.3.0",
|
|
48
50
|
"reflect-metadata": "^0.1.13",
|
|
49
51
|
"request-animation-frame-polyfill": "^1.1.2",
|
|
@@ -53,5 +55,5 @@
|
|
|
53
55
|
"scripts": {
|
|
54
56
|
"umd": "webpack"
|
|
55
57
|
},
|
|
56
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "a52a7c8d754925e5732baf3faea156332748365f"
|
|
57
59
|
}
|