next-ui3 1.5.5 → 1.5.7

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.
Files changed (63) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.full.min.js +38 -89
  3. package/dist/index.full.min.mjs +41 -92
  4. package/dist/locale/en.min.js +1 -1
  5. package/dist/locale/en.min.mjs +1 -1
  6. package/dist/locale/zh-cn.min.js +1 -1
  7. package/dist/locale/zh-cn.min.mjs +1 -1
  8. package/dist/utils/index.min.js +2 -2
  9. package/dist/utils/index.min.mjs +2 -2
  10. package/es/components/index.d.ts +1 -0
  11. package/es/components/preview/src/audio/index.vue.d.ts +5 -0
  12. package/es/components/preview/src/html/index.vue.d.ts +51 -0
  13. package/es/components/preview/src/index.vue.d.ts +2 -2
  14. package/es/components/preview/src/markdown/index.vue.d.ts +55 -0
  15. package/es/components/preview/src/video/index.vue.d.ts +4 -3
  16. package/es/components/slider/index.d.ts +2 -0
  17. package/es/components/slider/src/index.vue.d.ts +30 -0
  18. package/es/config/enums.d.ts +2 -1
  19. package/es/config/preview.d.ts +1 -0
  20. package/es/hooks/index.d.ts +2 -0
  21. package/es/hooks/use-audio/index.d.ts +41 -0
  22. package/es/hooks/use-preview-config/index.d.ts +4 -8
  23. package/es/hooks/use-video/index.d.ts +46 -0
  24. package/es/locale/lang/en.d.ts +4 -0
  25. package/es/locale/lang/en.mjs +5 -1
  26. package/es/locale/lang/en.mjs.map +1 -1
  27. package/es/locale/lang/zh-cn.d.ts +4 -0
  28. package/es/locale/lang/zh-cn.mjs +5 -1
  29. package/es/locale/lang/zh-cn.mjs.map +1 -1
  30. package/es/utils/format.d.ts +2 -0
  31. package/es/version.d.ts +1 -1
  32. package/lib/components/index.d.ts +1 -0
  33. package/lib/components/preview/src/audio/index.vue.d.ts +5 -0
  34. package/lib/components/preview/src/html/index.vue.d.ts +51 -0
  35. package/lib/components/preview/src/index.vue.d.ts +2 -2
  36. package/lib/components/preview/src/markdown/index.vue.d.ts +55 -0
  37. package/lib/components/preview/src/video/index.vue.d.ts +4 -3
  38. package/lib/components/slider/index.d.ts +2 -0
  39. package/lib/components/slider/src/index.vue.d.ts +30 -0
  40. package/lib/config/enums.d.ts +2 -1
  41. package/lib/config/preview.d.ts +1 -0
  42. package/lib/hooks/index.d.ts +2 -0
  43. package/lib/hooks/use-audio/index.d.ts +41 -0
  44. package/lib/hooks/use-preview-config/index.d.ts +4 -8
  45. package/lib/hooks/use-video/index.d.ts +46 -0
  46. package/lib/locale/lang/en.d.ts +4 -0
  47. package/lib/locale/lang/en.js +5 -1
  48. package/lib/locale/lang/en.js.map +1 -1
  49. package/lib/locale/lang/zh-cn.d.ts +4 -0
  50. package/lib/locale/lang/zh-cn.js +5 -1
  51. package/lib/locale/lang/zh-cn.js.map +1 -1
  52. package/lib/utils/format.d.ts +2 -0
  53. package/lib/version.d.ts +1 -1
  54. package/package.json +1 -1
  55. package/theme-chalk/index.css +1 -1
  56. package/theme-chalk/nt-slider.css +1 -0
  57. package/theme-chalk/src/index.scss +1 -0
  58. package/theme-chalk/src/preview/audio.scss +236 -26
  59. package/theme-chalk/src/preview/index.scss +1 -0
  60. package/theme-chalk/src/preview/markdown.scss +153 -0
  61. package/theme-chalk/src/preview/text.scss +6 -0
  62. package/theme-chalk/src/preview/video.scss +345 -6
  63. package/theme-chalk/src/slider.scss +74 -0
@@ -1,30 +1,369 @@
1
1
  .nt-preview-video {
2
+ --nt-video-color-text: #ffffff;
3
+ --nt-video-color-rail: rgba(255, 255, 255, 0.35);
4
+ --nt-video-color-played: #ffffff;
5
+ --nt-video-color-thumb: #ffffff;
6
+ --nt-video-color-error: #fca5a5;
7
+ --nt-video-color-icon-hover: rgba(255, 255, 255, 0.92);
8
+
9
+ padding: 12px;
2
10
  width: 100%;
3
11
  height: 100%;
4
12
  display: flex;
5
13
  align-items: center;
6
14
  justify-content: center;
7
15
  position: relative;
8
- background: #000;
16
+ // background: #000;
17
+ box-sizing: border-box;
9
18
 
10
- &__player {
19
+ /* 始终占满父级宽度,内部 shell 水平(及垂直)居中 */
20
+ &__stage {
21
+ width: 100%;
22
+ height: 100%;
23
+ min-height: 0;
24
+ display: flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ box-sizing: border-box;
28
+ }
29
+
30
+ &__shell {
31
+ position: relative;
32
+ width: 100%;
33
+ height: 100%;
34
+ min-height: 200px;
11
35
  max-width: 100%;
12
- max-height: 100%;
13
- object-fit: contain;
36
+ border-radius: 8px;
37
+ overflow: hidden;
38
+ background: #000;
39
+
40
+ /* 横屏 w/h≥1:宽贴满 stage,高随比例;由 JS 设置 aspect-ratio */
41
+ &--intrinsic-wide {
42
+ width: 100%;
43
+ height: auto;
44
+ min-height: 0;
45
+ max-height: 100%;
46
+ flex-shrink: 0;
47
+ }
48
+
49
+ /* 竖屏 w/h<1:高贴满 stage,宽随比例,在 stage 内水平居中 */
50
+ &--intrinsic-tall {
51
+ width: auto;
52
+ height: 100%;
53
+ min-height: 0;
54
+ max-width: 100%;
55
+ flex-shrink: 0;
56
+ }
14
57
  }
15
58
 
16
- &__loading {
59
+ &__player {
17
60
  position: absolute;
18
61
  inset: 0;
62
+ display: block;
63
+ width: 100%;
64
+ height: 100%;
65
+ margin: auto;
66
+ object-fit: contain;
67
+ outline: none;
68
+ }
69
+
70
+ &__chrome {
71
+ position: absolute;
72
+ left: 0;
73
+ right: 0;
74
+ bottom: 0;
75
+ z-index: 2;
76
+ padding: 10px 24px 24px;
77
+ box-sizing: border-box;
78
+ background: linear-gradient(
79
+ to top,
80
+ rgba(0, 0, 0, 0.78) 0%,
81
+ rgba(0, 0, 0, 0.38) 50%,
82
+ transparent 100%
83
+ );
84
+ transition: opacity 0.22s ease;
85
+
86
+ &--error {
87
+ pointer-events: auto;
88
+ }
89
+ }
90
+
91
+ /* 有精细指针悬停能力时:默认隐藏控制条,悬停 / 焦点在 shell 内时展示 */
92
+ @media (hover: hover) {
93
+ &__chrome {
94
+ opacity: 0;
95
+ pointer-events: none;
96
+
97
+ &--loading,
98
+ &--error {
99
+ opacity: 1;
100
+ pointer-events: auto;
101
+ }
102
+ }
103
+
104
+ &__shell:hover &__chrome,
105
+ &__shell:focus-within &__chrome {
106
+ opacity: 1;
107
+ pointer-events: auto;
108
+ }
109
+ }
110
+
111
+ .nt-slider {
112
+ --nt-slider-color-rail: var(--nt-video-color-rail);
113
+ --nt-slider-color-played: var(--nt-video-color-played);
114
+ --nt-slider-color-thumb: var(--nt-video-color-thumb);
115
+ }
116
+
117
+ &__toolbar {
118
+ display: flex;
119
+ align-items: center;
120
+ justify-content: space-between;
121
+ gap: 12px;
122
+ padding-top: 8px;
123
+ min-height: 40px;
124
+ }
125
+
126
+ &__toolbar-leading {
127
+ display: flex;
128
+ align-items: center;
129
+ gap: 10px;
130
+ min-width: 0;
131
+ flex: 1;
132
+ }
133
+
134
+ &__toolbar-trailing {
135
+ display: flex;
136
+ align-items: center;
137
+ flex-shrink: 0;
138
+ gap: 8px;
139
+ }
140
+
141
+ &__transport {
142
+ flex-shrink: 0;
143
+ height: 36px;
144
+ display: flex;
145
+ align-items: center;
146
+ justify-content: center;
147
+ }
148
+
149
+ &__status-icon {
150
+ color: var(--nt-video-color-text);
151
+
152
+ &--error {
153
+ color: var(--nt-video-color-error);
154
+ cursor: pointer;
155
+ }
156
+ }
157
+
158
+ &__play {
159
+ height: 36px;
160
+ padding: 0;
161
+ display: inline-flex;
162
+ align-items: center;
163
+ justify-content: center;
164
+ border: none;
165
+ border-radius: 50%;
166
+ background: transparent;
167
+ color: var(--nt-video-color-text);
168
+ cursor: pointer;
169
+ transition:
170
+ color 0.2s ease,
171
+ opacity 0.2s ease,
172
+ transform 0.15s ease;
173
+ outline: none;
174
+
175
+ &:hover:not(:disabled) {
176
+ color: var(--nt-video-color-icon-hover);
177
+ }
178
+
179
+ &:active:not(:disabled) {
180
+ transform: scale(0.94);
181
+ }
182
+
183
+ &:disabled {
184
+ cursor: not-allowed;
185
+ opacity: 0.45;
186
+ }
187
+
188
+ .nt-icon {
189
+ font-size: 22px;
190
+ margin-left: -4px;
191
+ }
192
+ }
193
+
194
+ &__clock {
195
+ font-size: 13px;
196
+ line-height: 1;
197
+ color: var(--nt-video-color-text);
198
+ font-family:
199
+ ui-monospace,
200
+ SFMono-Regular,
201
+ 'SF Mono',
202
+ Menlo,
203
+ Monaco,
204
+ Consolas,
205
+ 'Liberation Mono',
206
+ monospace;
207
+ font-variant-numeric: tabular-nums;
208
+ font-feature-settings: 'tnum' 1;
209
+ white-space: nowrap;
210
+ user-select: none;
211
+ }
212
+
213
+ &__sound {
214
+ display: inline-flex;
215
+ flex-direction: row;
216
+ align-items: center;
217
+ flex-shrink: 0;
218
+ justify-content: flex-end;
219
+ overflow: visible;
220
+
221
+ &:not(.nt-preview-video__sound--disabled):hover,
222
+ &:not(.nt-preview-video__sound--disabled):focus-within {
223
+ .nt-preview-video__sound-expand {
224
+ max-width: 104px;
225
+ opacity: 1;
226
+ margin-right: 6px;
227
+ overflow: visible;
228
+ padding: 0 8px;
229
+ box-sizing: border-box;
230
+ }
231
+ }
232
+
233
+ &--disabled {
234
+ pointer-events: none;
235
+ opacity: 0.45;
236
+ }
237
+ }
238
+
239
+ &__sound-expand {
240
+ max-width: 0;
241
+ opacity: 0;
242
+ overflow: hidden;
243
+ transition: none;
244
+ margin-right: 0;
245
+ display: flex;
246
+ align-items: center;
247
+ justify-content: flex-end;
248
+ flex-shrink: 0;
249
+ box-sizing: border-box;
250
+ }
251
+
252
+ &__sound-slider.el-slider {
253
+ --el-slider-height: 4px;
254
+ --el-slider-button-wrapper-offset: -16px;
255
+
19
256
  display: flex;
20
257
  align-items: center;
258
+ flex: 0 0 88px;
259
+ width: 88px;
260
+ max-width: 88px;
261
+ margin: 0;
262
+ overflow: visible;
263
+
264
+ .el-slider__runway {
265
+ height: var(--el-slider-height);
266
+ margin: 0;
267
+ overflow: visible;
268
+ background-color: var(--nt-video-color-rail);
269
+ }
270
+
271
+ .el-slider__bar {
272
+ height: var(--el-slider-height);
273
+ background-color: var(--nt-video-color-played);
274
+ }
275
+
276
+ .el-slider__button {
277
+ width: 10px;
278
+ height: 10px;
279
+ border-width: 2px;
280
+ border-color: var(--nt-video-color-thumb);
281
+ background-color: var(--nt-video-color-thumb);
282
+ }
283
+ }
284
+
285
+ &__sound-mute {
286
+ display: inline-flex;
287
+ align-items: center;
21
288
  justify-content: center;
289
+ flex-shrink: 0;
290
+ width: 36px;
291
+ height: 36px;
292
+ padding: 0;
293
+ border: none;
294
+ border-radius: 50%;
295
+ background: transparent;
296
+ cursor: pointer;
297
+ color: var(--nt-video-color-text);
298
+ transition: color 0.2s ease;
299
+ outline: none;
300
+
301
+ .nt-icon {
302
+ font-size: 22px;
303
+ }
304
+
305
+ &:hover:not(:disabled) {
306
+ color: var(--nt-video-color-icon-hover);
307
+ }
308
+
309
+ &:disabled {
310
+ cursor: not-allowed;
311
+ opacity: 0.45;
312
+ }
22
313
  }
23
314
 
24
- &:fullscreen {
315
+ &__fullscreen {
316
+ display: inline-flex;
317
+ align-items: center;
318
+ justify-content: center;
319
+ flex-shrink: 0;
320
+ // width: 36px;
321
+ height: 36px;
322
+ padding: 0;
323
+ border: none;
324
+ border-radius: 50%;
325
+ background: transparent;
326
+ cursor: pointer;
327
+ color: var(--nt-video-color-text);
328
+ transition: color 0.2s ease;
329
+ outline: none;
330
+
331
+ .nt-icon {
332
+ font-size: 22px;
333
+ margin-right: -2px;
334
+ }
335
+
336
+ &:hover {
337
+ color: var(--nt-video-color-icon-hover);
338
+ }
339
+ }
340
+
341
+ &:fullscreen,
342
+ &--fs {
343
+ width: 100%;
344
+ height: 100%;
345
+ padding: 0;
346
+
347
+ .nt-preview-video__stage {
348
+ width: 100%;
349
+ height: 100%;
350
+ }
351
+
352
+ .nt-preview-video__shell {
353
+ width: 100%;
354
+ height: 100%;
355
+ max-width: none;
356
+ max-height: none;
357
+ aspect-ratio: auto;
358
+ border-radius: 0;
359
+ }
360
+
25
361
  .nt-preview-video__player {
362
+ position: absolute;
363
+ inset: 0;
26
364
  width: 100%;
27
365
  height: 100%;
366
+ object-fit: contain;
28
367
  }
29
368
  }
30
369
  }
@@ -0,0 +1,74 @@
1
+ .nt-slider {
2
+ --nt-slider-color-rail: rgba(0, 0, 0, 0.18);
3
+ --nt-slider-color-played: #303133;
4
+ --nt-slider-color-thumb: #303133;
5
+
6
+ position: relative;
7
+ z-index: 1;
8
+ display: flex;
9
+ align-items: center;
10
+ width: 100%;
11
+ min-height: 22px;
12
+ margin: 4px 0 0;
13
+ overflow: visible;
14
+ cursor: pointer;
15
+ box-sizing: border-box;
16
+
17
+ &--hover {
18
+ cursor: grab;
19
+ }
20
+
21
+ &:active {
22
+ cursor: grabbing;
23
+ }
24
+
25
+ &[aria-disabled='true'] {
26
+ cursor: not-allowed;
27
+ opacity: 0.65;
28
+ }
29
+
30
+ &__rail {
31
+ position: relative;
32
+ width: 100%;
33
+ height: 2px;
34
+ border-radius: 999px;
35
+ background-color: var(--nt-slider-color-rail);
36
+ transition: height 0.12s ease;
37
+ }
38
+
39
+ &--hover &__rail {
40
+ height: 5px;
41
+ }
42
+
43
+ &__fill {
44
+ position: absolute;
45
+ left: 0;
46
+ top: 0;
47
+ bottom: 0;
48
+ height: 100%;
49
+ background-color: var(--nt-slider-color-played);
50
+ border-radius: 0 999px 999px 0;
51
+ transition: none;
52
+
53
+ // &--indeterminate {
54
+ // width: 32%;
55
+ // border-radius: 0;
56
+ // animation: none;
57
+ // }
58
+ }
59
+
60
+ &__thumb {
61
+ position: absolute;
62
+ top: 50%;
63
+ z-index: 1;
64
+ width: 10px;
65
+ height: 10px;
66
+ border-radius: 50%;
67
+ background-color: var(--nt-slider-color-thumb);
68
+ border: none;
69
+ box-shadow: none;
70
+ filter: none;
71
+ pointer-events: none;
72
+ transform: translate(-50%, -50%);
73
+ }
74
+ }