@antv/g-lite 1.0.1 → 1.0.2
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/display-objects/Text.d.ts +69 -17
- package/dist/display-objects/Text.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +7 -5
- package/dist/index.js +7 -5
- package/dist/index.umd.js +3141 -3140
- package/dist/index.umd.min.js +16 -2
- package/package.json +4 -3
|
@@ -7,28 +7,88 @@ export interface TextStyleProps extends BaseStyleProps {
|
|
|
7
7
|
x?: number | string;
|
|
8
8
|
y?: number | string;
|
|
9
9
|
text: string;
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* The text-align property sets the horizontal alignment of the inline-level content.
|
|
12
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/text-align
|
|
13
|
+
*/
|
|
11
14
|
textAlign?: CSSGlobalKeywords | 'start' | 'center' | 'end' | 'left' | 'right';
|
|
12
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* It specifies the current text baseline used when drawing text.
|
|
17
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/textBaseline
|
|
18
|
+
*/
|
|
13
19
|
textBaseline?: CSSGlobalKeywords | 'top' | 'hanging' | 'middle' | 'alphabetic' | 'ideographic' | 'bottom';
|
|
14
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* The text-overflow property sets how hidden overflow content is signaled to users.
|
|
22
|
+
* It can be clipped, display an ellipsis ('…'), or display a custom string.
|
|
23
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/text-overflow#values
|
|
24
|
+
*/
|
|
25
|
+
textOverflow?: 'clip' | 'ellipsis' | '';
|
|
26
|
+
/**
|
|
27
|
+
* The font-style property sets whether a font should be styled with a normal, italic, or oblique face from its font-family.
|
|
28
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-style
|
|
29
|
+
*/
|
|
15
30
|
fontStyle?: CSSGlobalKeywords | 'normal' | 'italic' | 'oblique';
|
|
16
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* The font-size property sets the size of the font.
|
|
33
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-size
|
|
34
|
+
*/
|
|
17
35
|
fontSize?: number | string;
|
|
18
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* The font-family property specifies a prioritized list of one or more font family names and/or generic family names for the selected element.
|
|
38
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-family
|
|
39
|
+
*/
|
|
19
40
|
fontFamily?: string;
|
|
20
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* The font-weight property sets the weight (or boldness) of the font. The weights available depend on the font-family that is currently set.
|
|
43
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight
|
|
44
|
+
*/
|
|
21
45
|
fontWeight?: CSSGlobalKeywords | 'normal' | 'bold' | 'bolder' | 'lighter' | number;
|
|
22
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* The font-variant shorthand property allows you to set all the font variants for a font.
|
|
48
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant
|
|
49
|
+
*/
|
|
23
50
|
fontVariant?: CSSGlobalKeywords | 'normal' | 'small-caps' | string;
|
|
24
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* The line-height property sets the height of a line box.
|
|
53
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height
|
|
54
|
+
*/
|
|
25
55
|
lineHeight?: number | string;
|
|
56
|
+
/**
|
|
57
|
+
* It specifies the spacing between letters when drawing text.
|
|
58
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/letterSpacing
|
|
59
|
+
*/
|
|
26
60
|
letterSpacing?: number | string;
|
|
27
|
-
|
|
61
|
+
/**
|
|
62
|
+
* The white-space property sets how white space inside an element is handled.
|
|
63
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/white-space
|
|
64
|
+
*/
|
|
65
|
+
/**
|
|
66
|
+
* There is no "CSS leading" property
|
|
67
|
+
* @see https://css-tricks.com/how-to-tame-line-height-in-css/
|
|
68
|
+
*/
|
|
28
69
|
leading?: number;
|
|
70
|
+
/**
|
|
71
|
+
* The overflow-wrap CSS property applies to inline elements,
|
|
72
|
+
* setting whether the browser should insert line breaks within an otherwise unbreakable string to prevent text from overflowing its line box.
|
|
73
|
+
*
|
|
74
|
+
* The overflow-wrap property acts in the same way as the non-standard property word-wrap.
|
|
75
|
+
* The word-wrap property is now treated by browsers as an alias of the standard property.
|
|
76
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap
|
|
77
|
+
*/
|
|
29
78
|
wordWrap?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Max width of overflowing box.
|
|
81
|
+
*/
|
|
30
82
|
wordWrapWidth?: number;
|
|
83
|
+
/**
|
|
84
|
+
* The dx attribute indicates a shift along the x-axis on the position of an element or its content.
|
|
85
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/dx
|
|
86
|
+
*/
|
|
31
87
|
dx?: number | string;
|
|
88
|
+
/**
|
|
89
|
+
* The dy attribute indicates a shift along the y-axis on the position of an element or its content.
|
|
90
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/dy
|
|
91
|
+
*/
|
|
32
92
|
dy?: number | string;
|
|
33
93
|
}
|
|
34
94
|
export interface ParsedTextStyleProps extends ParsedBaseStyleProps {
|
|
@@ -36,22 +96,14 @@ export interface ParsedTextStyleProps extends ParsedBaseStyleProps {
|
|
|
36
96
|
y: number;
|
|
37
97
|
text: string;
|
|
38
98
|
textAlign?: 'start' | 'center' | 'end' | 'left' | 'right';
|
|
39
|
-
/** 设置在绘制文本时使用的当前文本基线 */
|
|
40
99
|
textBaseline?: 'top' | 'hanging' | 'middle' | 'alphabetic' | 'ideographic' | 'bottom';
|
|
41
|
-
/** 字体样式 */
|
|
42
100
|
fontStyle?: 'normal' | 'italic' | 'oblique';
|
|
43
|
-
/** 文本字体大小 */
|
|
44
101
|
fontSize?: number;
|
|
45
|
-
/** 文本字体 */
|
|
46
102
|
fontFamily?: string;
|
|
47
|
-
/** 文本粗细 */
|
|
48
103
|
fontWeight?: 'normal' | 'bold' | 'bolder' | 'lighter' | number;
|
|
49
|
-
/** 字体变体 */
|
|
50
104
|
fontVariant?: 'normal' | 'small-caps' | string;
|
|
51
|
-
/** 文本行高 */
|
|
52
105
|
lineHeight?: number;
|
|
53
106
|
letterSpacing?: number;
|
|
54
|
-
whiteSpace?: 'pre';
|
|
55
107
|
leading?: number;
|
|
56
108
|
wordWrap?: boolean;
|
|
57
109
|
wordWrapWidth?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../src/display-objects/Text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,WAAW,cAAe,SAAQ,cAAc;IACpD,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../src/display-objects/Text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAA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C3E;;OAEG;gBAKS,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAE,mBAAmB,CAAC,cAAc,CAAM;IAqCxE;;OAEG;IACH,qBAAqB,IAAI,MAAM;IA4B/B,oBAAoB;CAGrB"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAG3C,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC/F,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,GAAG,EACH,gBAAgB,EAChB,eAAe,EACf,MAAM,EACN,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,SAAS,EACT,cAAc,EACd,cAAc,EACd,UAAU,EACV,SAAS,EACT,WAAW,EACX,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,mBAAmB,GACpB,MAAM,OAAO,CAAC;AACf,cAAc,mBAAmB,CAAC;AAClC,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,aAAa,EACb,OAAO,EACP,QAAQ,EACR,gCAAgC,EAChC,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,sBAAsB,EACtB,OAAO,EACP,UAAU,EACV,qBAAqB,EACrB,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,yBAAyB,EACzB,6BAA6B,EAC7B,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,EAAE,CAAC;AAKjB,eAAO,MAAM,kBAAkB,oBAA8D,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
1
2
|
import { Syringe, GlobalContainer, singleton, inject, injectable, contrib, Module, Contribution } from 'mana-syringe';
|
|
2
3
|
export { GlobalContainer, Module, Syringe, inject, injectable, singleton } from 'mana-syringe';
|
|
3
4
|
import RBush from 'rbush';
|
|
@@ -11915,7 +11916,7 @@ var Text = /*#__PURE__*/function (_DisplayObject) {
|
|
|
11915
11916
|
letterSpacing: '',
|
|
11916
11917
|
lineHeight: '',
|
|
11917
11918
|
miterLimit: '',
|
|
11918
|
-
whiteSpace: 'pre',
|
|
11919
|
+
// whiteSpace: 'pre',
|
|
11919
11920
|
wordWrap: false,
|
|
11920
11921
|
wordWrapWidth: 0,
|
|
11921
11922
|
leading: 0,
|
|
@@ -16684,10 +16685,11 @@ var BUILT_IN_PROPERTIES = [{
|
|
|
16684
16685
|
inh: true,
|
|
16685
16686
|
k: ['start', 'center', 'end', 'left', 'right'],
|
|
16686
16687
|
d: 'start'
|
|
16687
|
-
}, {
|
|
16688
|
-
|
|
16689
|
-
|
|
16690
|
-
},
|
|
16688
|
+
}, // {
|
|
16689
|
+
// n: 'whiteSpace',
|
|
16690
|
+
// l: true,
|
|
16691
|
+
// },
|
|
16692
|
+
{
|
|
16691
16693
|
n: 'markerStart',
|
|
16692
16694
|
syntax: PropertySyntax.MARKER
|
|
16693
16695
|
}, {
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('reflect-metadata');
|
|
5
6
|
var manaSyringe = require('mana-syringe');
|
|
6
7
|
var RBush = require('rbush');
|
|
7
8
|
var util = require('@antv/util');
|
|
@@ -11905,7 +11906,7 @@ var Text = /*#__PURE__*/function (_DisplayObject) {
|
|
|
11905
11906
|
letterSpacing: '',
|
|
11906
11907
|
lineHeight: '',
|
|
11907
11908
|
miterLimit: '',
|
|
11908
|
-
whiteSpace: 'pre',
|
|
11909
|
+
// whiteSpace: 'pre',
|
|
11909
11910
|
wordWrap: false,
|
|
11910
11911
|
wordWrapWidth: 0,
|
|
11911
11912
|
leading: 0,
|
|
@@ -16659,10 +16660,11 @@ var BUILT_IN_PROPERTIES = [{
|
|
|
16659
16660
|
inh: true,
|
|
16660
16661
|
k: ['start', 'center', 'end', 'left', 'right'],
|
|
16661
16662
|
d: 'start'
|
|
16662
|
-
}, {
|
|
16663
|
-
|
|
16664
|
-
|
|
16665
|
-
},
|
|
16663
|
+
}, // {
|
|
16664
|
+
// n: 'whiteSpace',
|
|
16665
|
+
// l: true,
|
|
16666
|
+
// },
|
|
16667
|
+
{
|
|
16666
16668
|
n: 'markerStart',
|
|
16667
16669
|
syntax: exports.PropertySyntax.MARKER
|
|
16668
16670
|
}, {
|