x4js 2.2.59 → 2.2.60
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/package.json +1 -1
- package/src/components/monaco/monaco.ts +6 -0
- package/src/components/sizers/sizer.module.scss +1 -0
- package/src/components/sizers/sizer.ts +1 -0
- package/src/components/tabs/tabs.module.scss +6 -0
- package/src/components/tickline/tickline.module.scss +1 -1
- package/src/components/tickline/tickline.ts +9 -5
- package/src/core/core_colors.ts +3 -3
package/package.json
CHANGED
|
@@ -4,6 +4,12 @@ import { Component, ComponentProps } from '../../core/component';
|
|
|
4
4
|
import Monaco from './bin/monaco';
|
|
5
5
|
import "./monaco.module.scss"
|
|
6
6
|
|
|
7
|
+
export type IMonarchLanguage = monaco.languages.IMonarchLanguage;
|
|
8
|
+
export type CompletionItem = monaco.languages.CompletionItem;
|
|
9
|
+
export type CompletionItemProvider = monaco.languages.CompletionItemProvider;
|
|
10
|
+
|
|
11
|
+
export { IRange, }
|
|
12
|
+
|
|
7
13
|
|
|
8
14
|
interface MonacoEditorProps extends ComponentProps {
|
|
9
15
|
language: "typescript" | "javascript" | "json" | "css" | "html" | string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SvgBuilder, SvgComponent } from '../../core/core_svg';
|
|
2
2
|
import { Color } from '../../core/core_colors';
|
|
3
3
|
import { Component, ComponentProps } from '../../core/component';
|
|
4
|
+
import { class_ns } from '../../core/core_tools';
|
|
4
5
|
|
|
5
6
|
import "./tickline.module.scss"
|
|
6
7
|
|
|
@@ -23,6 +24,7 @@ interface TickLineProps extends ComponentProps {
|
|
|
23
24
|
* ```
|
|
24
25
|
*/
|
|
25
26
|
|
|
27
|
+
@class_ns( "x4" )
|
|
26
28
|
export class TickLine extends Component<TickLineProps> {
|
|
27
29
|
|
|
28
30
|
constructor( props: TickLineProps ) {
|
|
@@ -47,6 +49,8 @@ export class TickLine extends Component<TickLineProps> {
|
|
|
47
49
|
const xmul = rc.width/vals.length;
|
|
48
50
|
const ymul = rc.height/(max-min);
|
|
49
51
|
|
|
52
|
+
const b = rc.height;
|
|
53
|
+
|
|
50
54
|
const bld = new SvgBuilder( );
|
|
51
55
|
|
|
52
56
|
if( props.background ) {
|
|
@@ -56,8 +60,8 @@ export class TickLine extends Component<TickLineProps> {
|
|
|
56
60
|
|
|
57
61
|
if( min!=0 ) {
|
|
58
62
|
bld.path( )
|
|
59
|
-
.moveTo( 0, 0-min )
|
|
60
|
-
.lineTo( rc.width, 0-min )
|
|
63
|
+
.moveTo( 0, b-(0-min)*ymul )
|
|
64
|
+
.lineTo( rc.width, b-(0-min)*ymul )
|
|
61
65
|
.stroke( "var(--tickline-axis-color)", 1 )
|
|
62
66
|
.antiAlias( false )
|
|
63
67
|
}
|
|
@@ -66,10 +70,10 @@ export class TickLine extends Component<TickLineProps> {
|
|
|
66
70
|
const pth = bld.path( );
|
|
67
71
|
for( let x=0; x<vals.length; x++ ) {
|
|
68
72
|
if( x==0 ) {
|
|
69
|
-
pth.moveTo( x*xmul, (vals[x]-min)*ymul );
|
|
73
|
+
pth.moveTo( x*xmul, b-(vals[x]-min)*ymul );
|
|
70
74
|
}
|
|
71
75
|
else {
|
|
72
|
-
pth.lineTo( x*xmul, (vals[x]-min)*ymul );
|
|
76
|
+
pth.lineTo( x*xmul, b-(vals[x]-min)*ymul );
|
|
73
77
|
}
|
|
74
78
|
}
|
|
75
79
|
|
|
@@ -78,7 +82,7 @@ export class TickLine extends Component<TickLineProps> {
|
|
|
78
82
|
}
|
|
79
83
|
else {
|
|
80
84
|
for( let x=0; x<vals.length; x++ ) {
|
|
81
|
-
bld.rect( x*xmul, (0-min)*ymul, xmul-1, vals[x]*ymul )
|
|
85
|
+
bld.rect( x*xmul, b-(0-min)*ymul, xmul-1, b-vals[x]*ymul )
|
|
82
86
|
.fill( props.color ? props.color.toHexString() : "var(--tickline-color)" )
|
|
83
87
|
.antiAlias( false );
|
|
84
88
|
}
|
package/src/core/core_colors.ts
CHANGED
|
@@ -88,7 +88,7 @@ export class Color {
|
|
|
88
88
|
if( value.startsWith('#') ) {
|
|
89
89
|
if (value.length == 7 && /#[0-9a-fA-F]{6}/.test(value)) {
|
|
90
90
|
const hex = parseInt(value.slice(1), 16);
|
|
91
|
-
return this.setRgb( hex >> 16, hex >> 8, hex, 1.0 );
|
|
91
|
+
return this.setRgb( (hex >> 16)&0xff, (hex >> 8)&0xff, (hex)&0xff, 1.0 );
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
if (value.length == 4 && /#[0-9a-fA-F]{3}/.test(value)) {
|
|
@@ -98,7 +98,7 @@ export class Color {
|
|
|
98
98
|
|
|
99
99
|
if (value.length == 9 && /#[0-9a-fA-F]{8}/.test(value)) {
|
|
100
100
|
const hex = parseInt(value.slice(1), 16) >>> 0;
|
|
101
|
-
return this.setRgb( hex >> 24, hex >> 16, hex >> 8, (hex & 0xFF) / 255.0 );
|
|
101
|
+
return this.setRgb( (hex >> 24)&0xff, (hex >> 16)&0xff, (hex >> 8)&0xff, (hex & 0xFF) / 255.0 );
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
else {
|
|
@@ -131,7 +131,7 @@ export class Color {
|
|
|
131
131
|
else {
|
|
132
132
|
const xx = CSS_COLORS[value];
|
|
133
133
|
if( xx!==undefined ) {
|
|
134
|
-
return this.setRgb( xx>>16, xx>>8, xx, 1.0 );
|
|
134
|
+
return this.setRgb( (xx>>16)&0xff, (xx>>8)&0xff, (xx)&0xff, 1.0 );
|
|
135
135
|
}
|
|
136
136
|
else if( value=="transparent" ) {
|
|
137
137
|
return this.setRgb( 0, 0, 0, 0 );
|