@antv/g 5.0.23-alpha.13 → 5.0.23-alpha.14
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 +2 -2
- package/es/css/StyleValueRegistry.d.ts +6 -1
- package/es/css/StyleValueRegistry.js +24 -23
- package/es/display-objects/DisplayObject.d.ts +1 -2
- package/es/global-module.js +4 -8
- package/es/plugins/PrepareRendererPlugin.js +1 -2
- package/es/services/RenderingService.js +1 -1
- package/es/services/SceneGraphService.js +3 -1
- package/lib/css/StyleValueRegistry.d.ts +6 -1
- package/lib/css/StyleValueRegistry.js +27 -24
- package/lib/display-objects/DisplayObject.d.ts +1 -2
- package/lib/global-module.js +2 -6
- package/lib/plugins/PrepareRendererPlugin.js +1 -2
- package/lib/services/RenderingService.js +1 -1
- package/lib/services/SceneGraphService.js +3 -1
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Syringe } from 'mana-syringe';
|
|
1
2
|
import type { DisplayObject } from '../display-objects';
|
|
2
3
|
import type { BaseStyleProps } from '../types';
|
|
3
4
|
import { CSSStyleValue } from './cssom';
|
|
@@ -65,7 +66,11 @@ export interface PropertyMetadata {
|
|
|
65
66
|
* Blink used them in code generation(css_properties.json5)
|
|
66
67
|
*/
|
|
67
68
|
export declare const BUILT_IN_PROPERTIES: PropertyMetadata[];
|
|
68
|
-
export declare
|
|
69
|
+
export declare const StyleValueRegistry: Syringe.DefinedToken;
|
|
70
|
+
export interface StyleValueRegistry {
|
|
71
|
+
recalc(displayObject: DisplayObject): void;
|
|
72
|
+
}
|
|
73
|
+
export declare class DefaultStyleValueRegistry implements StyleValueRegistry {
|
|
69
74
|
/**
|
|
70
75
|
* need recalc later
|
|
71
76
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __metadata, __read, __spreadArray } from "tslib";
|
|
2
|
-
import { postConstruct, singleton, GlobalContainer } from 'mana-syringe';
|
|
2
|
+
import { postConstruct, singleton, GlobalContainer, Syringe } from 'mana-syringe';
|
|
3
3
|
import { vec3 } from 'gl-matrix';
|
|
4
4
|
import { GeometryUpdaterFactory } from '../services/aabb/interfaces';
|
|
5
5
|
import { dirtifyToRoot } from '../services/SceneGraphService';
|
|
@@ -410,14 +410,13 @@ export var BUILT_IN_PROPERTIES = [{
|
|
|
410
410
|
}, {
|
|
411
411
|
name: 'whiteSpace',
|
|
412
412
|
layoutDependent: true
|
|
413
|
-
}];
|
|
414
|
-
|
|
415
|
-
// });
|
|
413
|
+
}];
|
|
414
|
+
export var StyleValueRegistry = Syringe.defineToken('StyleValueRegistry');
|
|
416
415
|
|
|
417
|
-
var
|
|
416
|
+
var DefaultStyleValueRegistry =
|
|
418
417
|
/** @class */
|
|
419
418
|
function () {
|
|
420
|
-
function
|
|
419
|
+
function DefaultStyleValueRegistry() {
|
|
421
420
|
/**
|
|
422
421
|
* need recalc later
|
|
423
422
|
*/
|
|
@@ -453,7 +452,7 @@ function () {
|
|
|
453
452
|
// > = {};
|
|
454
453
|
|
|
455
454
|
|
|
456
|
-
|
|
455
|
+
DefaultStyleValueRegistry.prototype.init = function () {
|
|
457
456
|
var _this = this;
|
|
458
457
|
|
|
459
458
|
BUILT_IN_PROPERTIES.forEach(function (property) {
|
|
@@ -461,7 +460,7 @@ function () {
|
|
|
461
460
|
});
|
|
462
461
|
};
|
|
463
462
|
|
|
464
|
-
|
|
463
|
+
DefaultStyleValueRegistry.prototype.registerMetadata = function (metadata) {
|
|
465
464
|
var _this = this;
|
|
466
465
|
|
|
467
466
|
__spreadArray([metadata.name], __read(metadata.alias || []), false).forEach(function (name) {
|
|
@@ -469,7 +468,7 @@ function () {
|
|
|
469
468
|
});
|
|
470
469
|
};
|
|
471
470
|
|
|
472
|
-
|
|
471
|
+
DefaultStyleValueRegistry.prototype.getMetadata = function (name) {
|
|
473
472
|
return this.cache[name];
|
|
474
473
|
};
|
|
475
474
|
/**
|
|
@@ -483,7 +482,7 @@ function () {
|
|
|
483
482
|
*/
|
|
484
483
|
|
|
485
484
|
|
|
486
|
-
|
|
485
|
+
DefaultStyleValueRegistry.prototype.processProperties = function (object, attributes, options) {
|
|
487
486
|
var _this = this;
|
|
488
487
|
|
|
489
488
|
if (options === void 0) {
|
|
@@ -564,7 +563,7 @@ function () {
|
|
|
564
563
|
*/
|
|
565
564
|
|
|
566
565
|
|
|
567
|
-
|
|
566
|
+
DefaultStyleValueRegistry.prototype.parseProperty = function (name, value) {
|
|
568
567
|
var metadata = this.getMetadata(name);
|
|
569
568
|
var computed = value;
|
|
570
569
|
|
|
@@ -600,7 +599,7 @@ function () {
|
|
|
600
599
|
*/
|
|
601
600
|
|
|
602
601
|
|
|
603
|
-
|
|
602
|
+
DefaultStyleValueRegistry.prototype.computeProperty = function (name, computed, object) {
|
|
604
603
|
var metadata = this.getMetadata(name);
|
|
605
604
|
var isDocumentElement = object.id === 'g-root';
|
|
606
605
|
var used = computed instanceof CSSStyleValue ? computed.clone() : computed;
|
|
@@ -664,7 +663,7 @@ function () {
|
|
|
664
663
|
return false;
|
|
665
664
|
};
|
|
666
665
|
|
|
667
|
-
|
|
666
|
+
DefaultStyleValueRegistry.prototype.postProcessProperty = function (name, object) {
|
|
668
667
|
var metadata = this.getMetadata(name);
|
|
669
668
|
|
|
670
669
|
if (metadata && metadata.handler) {
|
|
@@ -676,7 +675,7 @@ function () {
|
|
|
676
675
|
}
|
|
677
676
|
};
|
|
678
677
|
|
|
679
|
-
|
|
678
|
+
DefaultStyleValueRegistry.prototype.isPropertyResolved = function (object, name) {
|
|
680
679
|
if (!this.unresolvedProperties[object.entity] || this.unresolvedProperties[object.entity].length === 0) {
|
|
681
680
|
return true;
|
|
682
681
|
}
|
|
@@ -688,7 +687,7 @@ function () {
|
|
|
688
687
|
*/
|
|
689
688
|
|
|
690
689
|
|
|
691
|
-
|
|
690
|
+
DefaultStyleValueRegistry.prototype.addUnresolveProperty = function (object, name) {
|
|
692
691
|
if (!this.unresolvedProperties[object.entity]) {
|
|
693
692
|
this.unresolvedProperties[object.entity] = [];
|
|
694
693
|
}
|
|
@@ -698,7 +697,7 @@ function () {
|
|
|
698
697
|
}
|
|
699
698
|
};
|
|
700
699
|
|
|
701
|
-
|
|
700
|
+
DefaultStyleValueRegistry.prototype.tryToResolveProperty = function (object, name, options) {
|
|
702
701
|
if (options === void 0) {
|
|
703
702
|
options = {};
|
|
704
703
|
}
|
|
@@ -722,7 +721,7 @@ function () {
|
|
|
722
721
|
return false;
|
|
723
722
|
};
|
|
724
723
|
|
|
725
|
-
|
|
724
|
+
DefaultStyleValueRegistry.prototype.recalc = function (object) {
|
|
726
725
|
var properties = this.unresolvedProperties[object.entity];
|
|
727
726
|
|
|
728
727
|
if (properties && properties.length) {
|
|
@@ -740,7 +739,7 @@ function () {
|
|
|
740
739
|
*/
|
|
741
740
|
|
|
742
741
|
|
|
743
|
-
|
|
742
|
+
DefaultStyleValueRegistry.prototype.updateGeometry = function (object) {
|
|
744
743
|
var _a;
|
|
745
744
|
|
|
746
745
|
var geometryUpdaterFactory = GlobalContainer.get(GeometryUpdaterFactory);
|
|
@@ -875,7 +874,7 @@ function () {
|
|
|
875
874
|
}
|
|
876
875
|
};
|
|
877
876
|
|
|
878
|
-
|
|
877
|
+
DefaultStyleValueRegistry.prototype.isPropertyInheritable = function (name) {
|
|
879
878
|
var metadata = this.getMetadata(name);
|
|
880
879
|
|
|
881
880
|
if (!metadata) {
|
|
@@ -885,10 +884,12 @@ function () {
|
|
|
885
884
|
return metadata.inherited;
|
|
886
885
|
};
|
|
887
886
|
|
|
888
|
-
__decorate([postConstruct(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0)],
|
|
887
|
+
__decorate([postConstruct(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0)], DefaultStyleValueRegistry.prototype, "init", null);
|
|
889
888
|
|
|
890
|
-
|
|
891
|
-
|
|
889
|
+
DefaultStyleValueRegistry = __decorate([singleton({
|
|
890
|
+
token: StyleValueRegistry
|
|
891
|
+
})], DefaultStyleValueRegistry);
|
|
892
|
+
return DefaultStyleValueRegistry;
|
|
892
893
|
}();
|
|
893
894
|
|
|
894
|
-
export {
|
|
895
|
+
export { DefaultStyleValueRegistry };
|
|
@@ -5,7 +5,6 @@ import { Element } from '../dom/Element';
|
|
|
5
5
|
import type { DisplayObjectConfig, IChildNode } from '../dom/interfaces';
|
|
6
6
|
import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
|
|
7
7
|
import type { PropertyParseOptions } from '../css/StyleValueRegistry';
|
|
8
|
-
import { StyleValueRegistry } from '../css/StyleValueRegistry';
|
|
9
8
|
/**
|
|
10
9
|
* prototype chains: DisplayObject -> Element -> Node -> EventTarget
|
|
11
10
|
*
|
|
@@ -29,7 +28,7 @@ export declare class DisplayObject<StyleProps extends BaseStyleProps = any, Pars
|
|
|
29
28
|
* contains style props in constructor's params, eg. fill, stroke...
|
|
30
29
|
*/
|
|
31
30
|
config: DisplayObjectConfig<StyleProps>;
|
|
32
|
-
styleValueRegistry:
|
|
31
|
+
styleValueRegistry: any;
|
|
33
32
|
/**
|
|
34
33
|
* push to active animations after calling `animate()`
|
|
35
34
|
*/
|
package/es/global-module.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Module, injectable, decorate } from 'mana-syringe';
|
|
2
2
|
import { EventEmitter } from 'eventemitter3';
|
|
3
3
|
import { DisplayObjectPool } from './DisplayObjectPool';
|
|
4
|
-
import { CircleUpdater, EllipseUpdater, GeometryAABBUpdater, GeometryUpdaterFactory, LineUpdater, PathUpdater, PolylineUpdater, RectUpdater, TextUpdater, TextService, OffscreenCanvasCreator, DefaultSceneGraphService,
|
|
5
|
-
import { LayoutRegistry,
|
|
4
|
+
import { CircleUpdater, EllipseUpdater, GeometryAABBUpdater, GeometryUpdaterFactory, LineUpdater, PathUpdater, PolylineUpdater, RectUpdater, TextUpdater, TextService, OffscreenCanvasCreator, DefaultSceneGraphService, DefaultSceneGraphSelector, SceneGraphSelector, SceneGraphSelectorFactory } from './services';
|
|
5
|
+
import { LayoutRegistry, CSSPropertyLocalPosition, CSSPropertyLengthOrPercentage, CSSPropertyAnchor, CSSPropertyClipPath, CSSPropertyColor, CSSPropertyFilter, CSSPropertyLineDash, CSSPropertyOffsetDistance, CSSPropertyOffsetPath, CSSPropertyOpacity, CSSPropertyPath, CSSPropertyPoints, CSSPropertyText, CSSPropertyTextTransform, CSSPropertyTransform, CSSPropertyTransformOrigin, CSSPropertyZIndex, CSSPropertyShadowBlur, DefaultStyleValueRegistry } from './css';
|
|
6
6
|
export var containerModule = Module(function (register) {
|
|
7
7
|
decorate(injectable(), EventEmitter); // bind DisplayObject pool
|
|
8
8
|
|
|
@@ -18,10 +18,7 @@ export var containerModule = Module(function (register) {
|
|
|
18
18
|
}
|
|
19
19
|
}); // bind scenegraph service
|
|
20
20
|
|
|
21
|
-
register(
|
|
22
|
-
token: SceneGraphService,
|
|
23
|
-
useClass: DefaultSceneGraphService
|
|
24
|
-
}); // bind text service
|
|
21
|
+
register(DefaultSceneGraphService); // bind text service
|
|
25
22
|
|
|
26
23
|
register(OffscreenCanvasCreator);
|
|
27
24
|
register(TextService); // bind aabb updater
|
|
@@ -50,8 +47,7 @@ export var containerModule = Module(function (register) {
|
|
|
50
47
|
}); // bind CSS property handlers
|
|
51
48
|
|
|
52
49
|
register(LayoutRegistry);
|
|
53
|
-
register(
|
|
54
|
-
|
|
50
|
+
register(DefaultStyleValueRegistry);
|
|
55
51
|
register(CSSPropertyLengthOrPercentage);
|
|
56
52
|
register(CSSPropertyLocalPosition);
|
|
57
53
|
register(CSSPropertyOpacity);
|
|
@@ -28,7 +28,6 @@ function () {
|
|
|
28
28
|
|
|
29
29
|
_this.styleValueRegistry.recalc(object);
|
|
30
30
|
|
|
31
|
-
console.log(object);
|
|
32
31
|
dirtifyToRoot(object);
|
|
33
32
|
renderingService.dirtify();
|
|
34
33
|
};
|
|
@@ -64,7 +63,7 @@ function () {
|
|
|
64
63
|
|
|
65
64
|
__decorate([inject(RenderingContext), __metadata("design:type", Object)], PrepareRendererPlugin.prototype, "renderingContext", void 0);
|
|
66
65
|
|
|
67
|
-
__decorate([inject(StyleValueRegistry), __metadata("design:type",
|
|
66
|
+
__decorate([inject(StyleValueRegistry), __metadata("design:type", Object)], PrepareRendererPlugin.prototype, "styleValueRegistry", void 0);
|
|
68
67
|
|
|
69
68
|
PrepareRendererPlugin = __decorate([singleton({
|
|
70
69
|
contrib: RenderingPluginContribution
|
|
@@ -219,7 +219,7 @@ function () {
|
|
|
219
219
|
|
|
220
220
|
__decorate([inject(SceneGraphService), __metadata("design:type", Object)], RenderingService.prototype, "sceneGraphService", void 0);
|
|
221
221
|
|
|
222
|
-
__decorate([inject(StyleValueRegistry), __metadata("design:type",
|
|
222
|
+
__decorate([inject(StyleValueRegistry), __metadata("design:type", Object)], RenderingService.prototype, "styleValueRegistry", void 0);
|
|
223
223
|
|
|
224
224
|
RenderingService = __decorate([singleton()], RenderingService);
|
|
225
225
|
return RenderingService;
|
|
@@ -801,7 +801,9 @@ function () {
|
|
|
801
801
|
|
|
802
802
|
__decorate([inject(SceneGraphSelectorFactory), __metadata("design:type", Function)], DefaultSceneGraphService.prototype, "sceneGraphSelectorFactory", void 0);
|
|
803
803
|
|
|
804
|
-
DefaultSceneGraphService = __decorate([singleton(
|
|
804
|
+
DefaultSceneGraphService = __decorate([singleton({
|
|
805
|
+
token: SceneGraphService
|
|
806
|
+
})], DefaultSceneGraphService);
|
|
805
807
|
return DefaultSceneGraphService;
|
|
806
808
|
}();
|
|
807
809
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Syringe } from 'mana-syringe';
|
|
1
2
|
import type { DisplayObject } from '../display-objects';
|
|
2
3
|
import type { BaseStyleProps } from '../types';
|
|
3
4
|
import { CSSStyleValue } from './cssom';
|
|
@@ -65,7 +66,11 @@ export interface PropertyMetadata {
|
|
|
65
66
|
* Blink used them in code generation(css_properties.json5)
|
|
66
67
|
*/
|
|
67
68
|
export declare const BUILT_IN_PROPERTIES: PropertyMetadata[];
|
|
68
|
-
export declare
|
|
69
|
+
export declare const StyleValueRegistry: Syringe.DefinedToken;
|
|
70
|
+
export interface StyleValueRegistry {
|
|
71
|
+
recalc(displayObject: DisplayObject): void;
|
|
72
|
+
}
|
|
73
|
+
export declare class DefaultStyleValueRegistry implements StyleValueRegistry {
|
|
69
74
|
/**
|
|
70
75
|
* need recalc later
|
|
71
76
|
*/
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.StyleValueRegistry = exports.PropertySyntax = exports.BUILT_IN_PROPERTIES = void 0;
|
|
6
|
+
exports.StyleValueRegistry = exports.PropertySyntax = exports.DefaultStyleValueRegistry = exports.BUILT_IN_PROPERTIES = void 0;
|
|
7
7
|
|
|
8
8
|
var _tslib = require("tslib");
|
|
9
9
|
|
|
@@ -430,16 +430,17 @@ var BUILT_IN_PROPERTIES = [{
|
|
|
430
430
|
}, {
|
|
431
431
|
name: 'whiteSpace',
|
|
432
432
|
layoutDependent: true
|
|
433
|
-
}];
|
|
434
|
-
// multiple: false,
|
|
435
|
-
// });
|
|
436
|
-
|
|
433
|
+
}];
|
|
437
434
|
exports.BUILT_IN_PROPERTIES = BUILT_IN_PROPERTIES;
|
|
438
435
|
|
|
439
|
-
var StyleValueRegistry =
|
|
436
|
+
var StyleValueRegistry = _manaSyringe.Syringe.defineToken('StyleValueRegistry');
|
|
437
|
+
|
|
438
|
+
exports.StyleValueRegistry = StyleValueRegistry;
|
|
439
|
+
|
|
440
|
+
var DefaultStyleValueRegistry =
|
|
440
441
|
/** @class */
|
|
441
442
|
function () {
|
|
442
|
-
function
|
|
443
|
+
function DefaultStyleValueRegistry() {
|
|
443
444
|
/**
|
|
444
445
|
* need recalc later
|
|
445
446
|
*/
|
|
@@ -475,7 +476,7 @@ function () {
|
|
|
475
476
|
// > = {};
|
|
476
477
|
|
|
477
478
|
|
|
478
|
-
|
|
479
|
+
DefaultStyleValueRegistry.prototype.init = function () {
|
|
479
480
|
var _this = this;
|
|
480
481
|
|
|
481
482
|
BUILT_IN_PROPERTIES.forEach(function (property) {
|
|
@@ -483,7 +484,7 @@ function () {
|
|
|
483
484
|
});
|
|
484
485
|
};
|
|
485
486
|
|
|
486
|
-
|
|
487
|
+
DefaultStyleValueRegistry.prototype.registerMetadata = function (metadata) {
|
|
487
488
|
var _this = this;
|
|
488
489
|
|
|
489
490
|
(0, _tslib.__spreadArray)([metadata.name], (0, _tslib.__read)(metadata.alias || []), false).forEach(function (name) {
|
|
@@ -491,7 +492,7 @@ function () {
|
|
|
491
492
|
});
|
|
492
493
|
};
|
|
493
494
|
|
|
494
|
-
|
|
495
|
+
DefaultStyleValueRegistry.prototype.getMetadata = function (name) {
|
|
495
496
|
return this.cache[name];
|
|
496
497
|
};
|
|
497
498
|
/**
|
|
@@ -505,7 +506,7 @@ function () {
|
|
|
505
506
|
*/
|
|
506
507
|
|
|
507
508
|
|
|
508
|
-
|
|
509
|
+
DefaultStyleValueRegistry.prototype.processProperties = function (object, attributes, options) {
|
|
509
510
|
var _this = this;
|
|
510
511
|
|
|
511
512
|
if (options === void 0) {
|
|
@@ -586,7 +587,7 @@ function () {
|
|
|
586
587
|
*/
|
|
587
588
|
|
|
588
589
|
|
|
589
|
-
|
|
590
|
+
DefaultStyleValueRegistry.prototype.parseProperty = function (name, value) {
|
|
590
591
|
var metadata = this.getMetadata(name);
|
|
591
592
|
var computed = value;
|
|
592
593
|
|
|
@@ -622,7 +623,7 @@ function () {
|
|
|
622
623
|
*/
|
|
623
624
|
|
|
624
625
|
|
|
625
|
-
|
|
626
|
+
DefaultStyleValueRegistry.prototype.computeProperty = function (name, computed, object) {
|
|
626
627
|
var metadata = this.getMetadata(name);
|
|
627
628
|
var isDocumentElement = object.id === 'g-root';
|
|
628
629
|
var used = computed instanceof _cssom.CSSStyleValue ? computed.clone() : computed;
|
|
@@ -687,7 +688,7 @@ function () {
|
|
|
687
688
|
return false;
|
|
688
689
|
};
|
|
689
690
|
|
|
690
|
-
|
|
691
|
+
DefaultStyleValueRegistry.prototype.postProcessProperty = function (name, object) {
|
|
691
692
|
var metadata = this.getMetadata(name);
|
|
692
693
|
|
|
693
694
|
if (metadata && metadata.handler) {
|
|
@@ -699,7 +700,7 @@ function () {
|
|
|
699
700
|
}
|
|
700
701
|
};
|
|
701
702
|
|
|
702
|
-
|
|
703
|
+
DefaultStyleValueRegistry.prototype.isPropertyResolved = function (object, name) {
|
|
703
704
|
if (!this.unresolvedProperties[object.entity] || this.unresolvedProperties[object.entity].length === 0) {
|
|
704
705
|
return true;
|
|
705
706
|
}
|
|
@@ -711,7 +712,7 @@ function () {
|
|
|
711
712
|
*/
|
|
712
713
|
|
|
713
714
|
|
|
714
|
-
|
|
715
|
+
DefaultStyleValueRegistry.prototype.addUnresolveProperty = function (object, name) {
|
|
715
716
|
if (!this.unresolvedProperties[object.entity]) {
|
|
716
717
|
this.unresolvedProperties[object.entity] = [];
|
|
717
718
|
}
|
|
@@ -721,7 +722,7 @@ function () {
|
|
|
721
722
|
}
|
|
722
723
|
};
|
|
723
724
|
|
|
724
|
-
|
|
725
|
+
DefaultStyleValueRegistry.prototype.tryToResolveProperty = function (object, name, options) {
|
|
725
726
|
if (options === void 0) {
|
|
726
727
|
options = {};
|
|
727
728
|
}
|
|
@@ -745,7 +746,7 @@ function () {
|
|
|
745
746
|
return false;
|
|
746
747
|
};
|
|
747
748
|
|
|
748
|
-
|
|
749
|
+
DefaultStyleValueRegistry.prototype.recalc = function (object) {
|
|
749
750
|
var properties = this.unresolvedProperties[object.entity];
|
|
750
751
|
|
|
751
752
|
if (properties && properties.length) {
|
|
@@ -763,7 +764,7 @@ function () {
|
|
|
763
764
|
*/
|
|
764
765
|
|
|
765
766
|
|
|
766
|
-
|
|
767
|
+
DefaultStyleValueRegistry.prototype.updateGeometry = function (object) {
|
|
767
768
|
var _a;
|
|
768
769
|
|
|
769
770
|
var geometryUpdaterFactory = _manaSyringe.GlobalContainer.get(_interfaces.GeometryUpdaterFactory);
|
|
@@ -901,7 +902,7 @@ function () {
|
|
|
901
902
|
}
|
|
902
903
|
};
|
|
903
904
|
|
|
904
|
-
|
|
905
|
+
DefaultStyleValueRegistry.prototype.isPropertyInheritable = function (name) {
|
|
905
906
|
var metadata = this.getMetadata(name);
|
|
906
907
|
|
|
907
908
|
if (!metadata) {
|
|
@@ -911,9 +912,11 @@ function () {
|
|
|
911
912
|
return metadata.inherited;
|
|
912
913
|
};
|
|
913
914
|
|
|
914
|
-
(0, _tslib.__decorate)([(0, _manaSyringe.postConstruct)(), (0, _tslib.__metadata)("design:type", Function), (0, _tslib.__metadata)("design:paramtypes", []), (0, _tslib.__metadata)("design:returntype", void 0)],
|
|
915
|
-
|
|
916
|
-
|
|
915
|
+
(0, _tslib.__decorate)([(0, _manaSyringe.postConstruct)(), (0, _tslib.__metadata)("design:type", Function), (0, _tslib.__metadata)("design:paramtypes", []), (0, _tslib.__metadata)("design:returntype", void 0)], DefaultStyleValueRegistry.prototype, "init", null);
|
|
916
|
+
DefaultStyleValueRegistry = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)({
|
|
917
|
+
token: StyleValueRegistry
|
|
918
|
+
})], DefaultStyleValueRegistry);
|
|
919
|
+
return DefaultStyleValueRegistry;
|
|
917
920
|
}();
|
|
918
921
|
|
|
919
|
-
exports.
|
|
922
|
+
exports.DefaultStyleValueRegistry = DefaultStyleValueRegistry;
|
|
@@ -5,7 +5,6 @@ import { Element } from '../dom/Element';
|
|
|
5
5
|
import type { DisplayObjectConfig, IChildNode } from '../dom/interfaces';
|
|
6
6
|
import type { BaseStyleProps, ParsedBaseStyleProps } from '../types';
|
|
7
7
|
import type { PropertyParseOptions } from '../css/StyleValueRegistry';
|
|
8
|
-
import { StyleValueRegistry } from '../css/StyleValueRegistry';
|
|
9
8
|
/**
|
|
10
9
|
* prototype chains: DisplayObject -> Element -> Node -> EventTarget
|
|
11
10
|
*
|
|
@@ -29,7 +28,7 @@ export declare class DisplayObject<StyleProps extends BaseStyleProps = any, Pars
|
|
|
29
28
|
* contains style props in constructor's params, eg. fill, stroke...
|
|
30
29
|
*/
|
|
31
30
|
config: DisplayObjectConfig<StyleProps>;
|
|
32
|
-
styleValueRegistry:
|
|
31
|
+
styleValueRegistry: any;
|
|
33
32
|
/**
|
|
34
33
|
* push to active animations after calling `animate()`
|
|
35
34
|
*/
|
package/lib/global-module.js
CHANGED
|
@@ -30,10 +30,7 @@ var containerModule = (0, _manaSyringe.Module)(function (register) {
|
|
|
30
30
|
}
|
|
31
31
|
}); // bind scenegraph service
|
|
32
32
|
|
|
33
|
-
register(
|
|
34
|
-
token: _services.SceneGraphService,
|
|
35
|
-
useClass: _services.DefaultSceneGraphService
|
|
36
|
-
}); // bind text service
|
|
33
|
+
register(_services.DefaultSceneGraphService); // bind text service
|
|
37
34
|
|
|
38
35
|
register(_services.OffscreenCanvasCreator);
|
|
39
36
|
register(_services.TextService); // bind aabb updater
|
|
@@ -62,8 +59,7 @@ var containerModule = (0, _manaSyringe.Module)(function (register) {
|
|
|
62
59
|
}); // bind CSS property handlers
|
|
63
60
|
|
|
64
61
|
register(_css.LayoutRegistry);
|
|
65
|
-
register(_css.
|
|
66
|
-
|
|
62
|
+
register(_css.DefaultStyleValueRegistry);
|
|
67
63
|
register(_css.CSSPropertyLengthOrPercentage);
|
|
68
64
|
register(_css.CSSPropertyLocalPosition);
|
|
69
65
|
register(_css.CSSPropertyOpacity);
|
|
@@ -39,7 +39,6 @@ function () {
|
|
|
39
39
|
|
|
40
40
|
_this.styleValueRegistry.recalc(object);
|
|
41
41
|
|
|
42
|
-
console.log(object);
|
|
43
42
|
(0, _services.dirtifyToRoot)(object);
|
|
44
43
|
renderingService.dirtify();
|
|
45
44
|
};
|
|
@@ -74,7 +73,7 @@ function () {
|
|
|
74
73
|
};
|
|
75
74
|
|
|
76
75
|
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_services.RenderingContext), (0, _tslib.__metadata)("design:type", Object)], PrepareRendererPlugin.prototype, "renderingContext", void 0);
|
|
77
|
-
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_StyleValueRegistry.StyleValueRegistry), (0, _tslib.__metadata)("design:type",
|
|
76
|
+
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_StyleValueRegistry.StyleValueRegistry), (0, _tslib.__metadata)("design:type", Object)], PrepareRendererPlugin.prototype, "styleValueRegistry", void 0);
|
|
78
77
|
PrepareRendererPlugin = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)({
|
|
79
78
|
contrib: _services.RenderingPluginContribution
|
|
80
79
|
})], PrepareRendererPlugin);
|
|
@@ -233,7 +233,7 @@ function () {
|
|
|
233
233
|
(0, _tslib.__decorate)([(0, _manaSyringe.contrib)(RenderingPluginContribution), (0, _tslib.__metadata)("design:type", Object)], RenderingService.prototype, "renderingPluginProvider", void 0);
|
|
234
234
|
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_RenderingContext.RenderingContext), (0, _tslib.__metadata)("design:type", Object)], RenderingService.prototype, "renderingContext", void 0);
|
|
235
235
|
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_SceneGraphService.SceneGraphService), (0, _tslib.__metadata)("design:type", Object)], RenderingService.prototype, "sceneGraphService", void 0);
|
|
236
|
-
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_StyleValueRegistry.StyleValueRegistry), (0, _tslib.__metadata)("design:type",
|
|
236
|
+
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_StyleValueRegistry.StyleValueRegistry), (0, _tslib.__metadata)("design:type", Object)], RenderingService.prototype, "styleValueRegistry", void 0);
|
|
237
237
|
RenderingService = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)()], RenderingService);
|
|
238
238
|
return RenderingService;
|
|
239
239
|
}();
|
|
@@ -854,7 +854,9 @@ function () {
|
|
|
854
854
|
};
|
|
855
855
|
|
|
856
856
|
(0, _tslib.__decorate)([(0, _manaSyringe.inject)(_SceneGraphSelector.SceneGraphSelectorFactory), (0, _tslib.__metadata)("design:type", Function)], DefaultSceneGraphService.prototype, "sceneGraphSelectorFactory", void 0);
|
|
857
|
-
DefaultSceneGraphService = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)(
|
|
857
|
+
DefaultSceneGraphService = (0, _tslib.__decorate)([(0, _manaSyringe.singleton)({
|
|
858
|
+
token: SceneGraphService
|
|
859
|
+
})], DefaultSceneGraphService);
|
|
858
860
|
return DefaultSceneGraphService;
|
|
859
861
|
}();
|
|
860
862
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antv/g",
|
|
3
|
-
"version": "5.0.23-alpha.
|
|
3
|
+
"version": "5.0.23-alpha.14",
|
|
4
4
|
"description": "A core module including ECS and DI container.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://github.com/antvis/g#readme",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@antv/g-math": "^1.0.20-alpha.
|
|
41
|
+
"@antv/g-math": "^1.0.20-alpha.14",
|
|
42
42
|
"@antv/util": "^3.0.0",
|
|
43
43
|
"@types/offscreencanvas": "^2019.6.4",
|
|
44
44
|
"d3-color": "^1.4.0",
|