@waline/client 2.5.0 → 2.5.1

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.
@@ -1,151 +1,70 @@
1
- @mixin gif() {
2
- .wl-gif-popup {
3
- position: absolute;
4
- top: 100%;
5
- left: 1.25em;
6
- z-index: 10;
7
-
8
- width: 436px;
9
- padding: 12px 12px 4px;
10
- border: var(--waline-border);
11
- border-radius: 6px;
12
-
13
- background: var(--waline-bgcolor);
14
- box-shadow: var(--waline-box-shadow);
15
-
16
- opacity: 0;
17
- visibility: hidden;
18
-
19
- transition: transform 0.2s ease-out, opacity 0.2s ease-out;
20
- transform: scale(0.9, 0.9);
21
- transform-origin: 0 0;
22
-
23
- &.display {
24
- opacity: 1;
25
- visibility: visible;
26
- transform: none;
27
- }
28
-
29
- input {
30
- box-sizing: border-box;
31
-
32
- width: 100%;
33
- margin-bottom: 10px;
34
- padding: 3px 5px;
35
- border: var(--waline-border);
36
- }
37
-
38
- img {
39
- display: block;
40
-
41
- box-sizing: border-box;
42
-
43
- width: 100%;
44
- border-width: 2px;
45
- border-style: solid;
46
- border-color: #fff;
47
-
48
- cursor: pointer;
49
-
50
- &:hover {
51
- border-color: var(--waline-theme-color);
52
- border-radius: 2px;
53
- }
54
- }
55
-
56
- .wl-gif-waterfall {
57
- overflow-y: auto;
58
- max-height: 800px;
59
- }
60
-
61
- button {
62
- display: inline-block;
63
- vertical-align: middle;
64
-
65
- width: 2em;
66
- margin: 0.125em;
67
- padding: 0;
68
- border-width: 0;
69
-
70
- background: transparent;
71
-
72
- font-size: inherit;
73
- line-height: 2;
74
- text-align: center;
75
-
76
- cursor: pointer;
77
-
78
- &:hover {
79
- background: var(--waline-bgcolor-hover);
80
- }
81
- }
82
-
83
- .wl-gif {
84
- display: inline-block;
85
- vertical-align: middle;
86
- max-width: 1.5em;
87
- max-height: 1.5em;
88
- }
89
-
90
- .wl-tab-wrapper {
91
- overflow-y: auto;
92
- max-height: 145px;
93
- padding: 0.5em;
94
-
95
- &::-webkit-scrollbar {
96
- width: 6px;
97
- height: 6px;
98
- }
1
+ .wl-gif-popup {
2
+ position: absolute;
3
+ top: 100%;
4
+ left: 1.25em;
5
+ z-index: 10;
6
+
7
+ width: calc(100% - 3em);
8
+ padding: 0.75em 0.75em 0.25em;
9
+ border: var(--waline-border);
10
+ border-radius: 6px;
11
+
12
+ background: var(--waline-bgcolor);
13
+ box-shadow: var(--waline-box-shadow);
14
+
15
+ opacity: 0;
16
+ visibility: hidden;
17
+
18
+ transition: transform 0.2s ease-out, opacity 0.2s ease-out;
19
+ transform: scale(0.9, 0.9);
20
+ transform-origin: 0 0;
21
+
22
+ &.display {
23
+ opacity: 1;
24
+ visibility: visible;
25
+ transform: none;
26
+ }
99
27
 
100
- &::-webkit-scrollbar-track-piece:vertical {
101
- -webkit-border-radius: 6px;
102
- border-radius: 6px;
103
- background: rgb(0 0 0 / 10%);
104
- }
28
+ input {
29
+ box-sizing: border-box;
105
30
 
106
- &::-webkit-scrollbar-thumb:vertical {
107
- width: 6px;
108
- -webkit-border-radius: 6px;
109
- border-radius: 6px;
110
- background: var(--waline-theme-color);
111
- }
112
- }
31
+ width: 100%;
32
+ margin-bottom: 10px;
33
+ padding: 3px 5px;
34
+ border: var(--waline-border);
35
+ }
113
36
 
114
- .wl-tabs {
115
- position: relative;
116
- height: 2em;
117
- padding: 0 6px 1px;
37
+ img {
38
+ display: block;
118
39
 
119
- &::before {
120
- content: ' ';
40
+ box-sizing: border-box;
121
41
 
122
- position: absolute;
123
- top: 0;
124
- right: 0;
125
- left: 0;
126
- z-index: 2;
42
+ width: 100%;
43
+ border-width: 2px;
44
+ border-style: solid;
45
+ border-color: #fff;
127
46
 
128
- height: 1px;
47
+ cursor: pointer;
129
48
 
130
- background: var(--waline-border-color);
131
- }
49
+ &:hover {
50
+ border-color: var(--waline-theme-color);
51
+ border-radius: 2px;
132
52
  }
53
+ }
54
+ }
133
55
 
134
- .wl-tab {
135
- position: relative;
136
- margin: 0;
137
- padding: 0 0.5em;
138
-
139
- &.active {
140
- z-index: 3;
56
+ .wl-gallery {
57
+ max-height: 80vh;
58
+ display: flex;
59
+ overflow-y: auto;
60
+ }
141
61
 
142
- border: 1px solid var(--waline-border-color);
143
- border-top-width: 0;
144
- border-bottom-right-radius: 6px;
145
- border-bottom-left-radius: 6px;
62
+ .wl-gallery-column {
63
+ height: -webkit-max-content;
64
+ height: -moz-max-content;
65
+ height: max-content;
146
66
 
147
- background: var(--waline-bgcolor);
148
- }
149
- }
150
- }
67
+ flex: 1;
68
+ display: flex;
69
+ flex-direction: column;
151
70
  }
@@ -4,6 +4,9 @@
4
4
  @use 'base';
5
5
 
6
6
  @use 'panel';
7
+ @use 'emoji';
8
+ @use 'gif';
9
+
7
10
  @use 'card';
8
11
  @use 'layout';
9
12
 
@@ -1,6 +1,3 @@
1
- @use 'emoji';
2
- @use 'gif';
3
-
4
1
  .wl-comment {
5
2
  position: relative;
6
3
  display: flex;
@@ -287,6 +284,3 @@
287
284
  }
288
285
  }
289
286
  }
290
-
291
- @include emoji.emoji;
292
- @include gif.gif;
@@ -56,6 +56,7 @@ export const fetchGif = ({
56
56
 
57
57
  return fetch(`${baseUrl}?${query.toString()}`, {
58
58
  headers: {
59
+ // eslint-disable-next-line @typescript-eslint/naming-convention
59
60
  'Content-Type': 'application/json',
60
61
  },
61
62
  }).then((resp) => resp.json() as Promise<FetchGifResponse>);
@@ -1,16 +1,15 @@
1
- export function throttle(
1
+ export const throttle = (
2
2
  func: (...args: any[]) => void,
3
3
  timeout = 300
4
- ): (...args: []) => void {
4
+ ): ((...args: []) => void) => {
5
5
  let timer: number | null;
6
+
6
7
  return (...args: []): void => {
7
- if (timer) {
8
- clearTimeout(timer);
9
- }
8
+ if (timer) clearTimeout(timer);
10
9
 
11
10
  timer = window.setTimeout(() => {
12
11
  func(...args);
13
12
  timer = null;
14
13
  }, timeout);
15
14
  };
16
- }
15
+ };