xshell 0.0.15 → 0.0.16
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/chalk.browser.ts +41 -0
- package/myfont.sass +11 -0
- package/package.json +1 -1
- package/scroll-bar.sass +35 -0
- package/toaster.browser.ts +50 -0
- package/toaster.d.ts +9 -0
- package/toaster.sass +22 -0
- package/tsconfig.json +1 -1
package/chalk.browser.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Instance as Chalk } from 'chalk'
|
|
2
|
+
|
|
3
|
+
const chalk = new Chalk({ level: 2 })
|
|
4
|
+
|
|
5
|
+
const {
|
|
6
|
+
red,
|
|
7
|
+
green,
|
|
8
|
+
yellow,
|
|
9
|
+
blue,
|
|
10
|
+
magenta,
|
|
11
|
+
cyan,
|
|
12
|
+
grey,
|
|
13
|
+
|
|
14
|
+
redBright: red_,
|
|
15
|
+
greenBright: green_,
|
|
16
|
+
yellowBright: yellow_,
|
|
17
|
+
blueBright: blue_,
|
|
18
|
+
magentaBright: magenta_,
|
|
19
|
+
cyanBright: cyan_,
|
|
20
|
+
|
|
21
|
+
underline,
|
|
22
|
+
} = chalk
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
red,
|
|
26
|
+
green,
|
|
27
|
+
yellow,
|
|
28
|
+
blue,
|
|
29
|
+
magenta,
|
|
30
|
+
cyan,
|
|
31
|
+
grey,
|
|
32
|
+
|
|
33
|
+
red_,
|
|
34
|
+
green_,
|
|
35
|
+
yellow_,
|
|
36
|
+
blue_,
|
|
37
|
+
magenta_,
|
|
38
|
+
cyan_,
|
|
39
|
+
|
|
40
|
+
underline
|
|
41
|
+
}
|
package/myfont.sass
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@font-face
|
|
2
|
+
font-family: 'MyFont'
|
|
3
|
+
src: local('MyFont'), url('https://cos.shenhongfei.com/myfont.woff2')
|
|
4
|
+
|
|
5
|
+
@font-face
|
|
6
|
+
font-family: 'MyFont'
|
|
7
|
+
src: local('MyFont Bold'), url('https://cos.shenhongfei.com/myfontb.woff2')
|
|
8
|
+
font-weight: bold
|
|
9
|
+
|
|
10
|
+
html
|
|
11
|
+
font-family: 'MyFont', sans-serif
|
package/package.json
CHANGED
package/scroll-bar.sass
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
::-webkit-scrollbar, ::-webkit-scrollbar:horizontal, ::-webkit-scrollbar:vertical
|
|
2
|
+
width: 8px !important
|
|
3
|
+
height: 8px !important
|
|
4
|
+
background-color: #000000 !important
|
|
5
|
+
|
|
6
|
+
::-webkit-scrollbar-track-piece
|
|
7
|
+
background-color: #ffffff !important
|
|
8
|
+
box-shadow: inset 0 0 0px #000000 !important
|
|
9
|
+
border: 0px solid #000000 !important
|
|
10
|
+
border-radius: 0px !important
|
|
11
|
+
&:vertical
|
|
12
|
+
background-image: ''
|
|
13
|
+
&:hover
|
|
14
|
+
background-image: ''
|
|
15
|
+
&:horizontal
|
|
16
|
+
background-image: ''
|
|
17
|
+
&:hover
|
|
18
|
+
background-image: ''
|
|
19
|
+
&:hover
|
|
20
|
+
background-color: #D9D9D9 !important
|
|
21
|
+
box-shadow: inset 0 0 0px #000000 !important
|
|
22
|
+
|
|
23
|
+
::-webkit-scrollbar-thumb
|
|
24
|
+
background-color: #303030 !important
|
|
25
|
+
box-shadow: inset 0 0 0px #000000 !important
|
|
26
|
+
border-radius: 0px !important
|
|
27
|
+
border: 0px solid #000000 !important
|
|
28
|
+
&:vertical
|
|
29
|
+
background-image: ''
|
|
30
|
+
&:horizontal
|
|
31
|
+
background-image: ''
|
|
32
|
+
|
|
33
|
+
::-webkit-scrollbar-corner
|
|
34
|
+
background-color: #B0BEC5 !important
|
|
35
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import './toaster.sass'
|
|
2
|
+
|
|
3
|
+
import { delay } from './utils.browser'
|
|
4
|
+
|
|
5
|
+
export let toaster = {
|
|
6
|
+
messages: [ ] as string[],
|
|
7
|
+
|
|
8
|
+
state: 'IDLE' as 'IDLE' | 'SHOW',
|
|
9
|
+
|
|
10
|
+
async toast (message: string) {
|
|
11
|
+
this.messages.push(message)
|
|
12
|
+
this.show()
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
async show () {
|
|
16
|
+
if (this.state === 'SHOW') return
|
|
17
|
+
this.state = 'SHOW'
|
|
18
|
+
|
|
19
|
+
let div = document.createElement('div')
|
|
20
|
+
div.className = 'toast'
|
|
21
|
+
document.body.appendChild(div)
|
|
22
|
+
|
|
23
|
+
for (let i = 0; i < this.messages.length; i++) {
|
|
24
|
+
const message = this.messages[i]
|
|
25
|
+
let span: HTMLSpanElement
|
|
26
|
+
if (i === 0) {
|
|
27
|
+
span = document.createElement('span')
|
|
28
|
+
span.className = 'text'
|
|
29
|
+
span.textContent = message
|
|
30
|
+
div.appendChild(span)
|
|
31
|
+
} else {
|
|
32
|
+
span = div.children[0] as HTMLSpanElement
|
|
33
|
+
span.textContent = message
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
div.classList.add('active')
|
|
37
|
+
await delay(2 * 1000)
|
|
38
|
+
div.classList.remove('active')
|
|
39
|
+
await delay(500)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
document.body.removeChild(div)
|
|
43
|
+
this.messages = [ ]
|
|
44
|
+
this.state = 'IDLE'
|
|
45
|
+
},
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const toast = toaster.toast.bind(toaster) as (typeof toaster)['toast']
|
|
49
|
+
|
|
50
|
+
export default toast
|
package/toaster.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './toaster.sass';
|
|
2
|
+
export declare let toaster: {
|
|
3
|
+
messages: string[];
|
|
4
|
+
state: "IDLE" | "SHOW";
|
|
5
|
+
toast(message: string): Promise<void>;
|
|
6
|
+
show(): Promise<void>;
|
|
7
|
+
};
|
|
8
|
+
export declare const toast: (message: string) => Promise<void>;
|
|
9
|
+
export default toast;
|
package/toaster.sass
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.toast
|
|
2
|
+
position: absolute
|
|
3
|
+
left: 0
|
|
4
|
+
right: 0
|
|
5
|
+
bottom: 12%
|
|
6
|
+
z-index: 1000
|
|
7
|
+
|
|
8
|
+
display: flex
|
|
9
|
+
justify-content: center
|
|
10
|
+
|
|
11
|
+
.text
|
|
12
|
+
background-color: #f6f6f6
|
|
13
|
+
color: #333333
|
|
14
|
+
border-radius: 24px
|
|
15
|
+
padding: 15px 30px
|
|
16
|
+
font-size: 16px
|
|
17
|
+
|
|
18
|
+
opacity: 0
|
|
19
|
+
transition: opacity 0.5s
|
|
20
|
+
|
|
21
|
+
&.active .text
|
|
22
|
+
opacity: 1
|