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,63 +1,273 @@
1
+ /** 默认浅色主题;`.nt-preview-audio--theme-dark` 内覆盖同色名变量为深色。 */
1
2
  .nt-preview-audio {
3
+ /* 水平内边距:外层 frame 与卡片与内容区左右对齐 */
4
+ --nt-audio-inset-x: 24px;
5
+ /* 垂直内边距:外层与卡片上下留白 */
6
+ --nt-audio-inset-y: 16px;
7
+ /* 主色:时间、播放/静音图标与按钮默认色 */
8
+ --nt-audio-color-text: #303133;
9
+ /* 轨道底色:进度未播段、音量滑条跑道 */
10
+ --nt-audio-color-rail: rgba(0, 0, 0, 0.18);
11
+ /* 已播进度、音量已选段 */
12
+ --nt-audio-color-played: #303133;
13
+ /* 进度与音量滑块的拖钮填充色 */
14
+ --nt-audio-color-thumb: #303133;
15
+ /* 加载失败等错误态图标 */
16
+ --nt-audio-color-error: #dc2626;
17
+ /* 可交互图标悬停时的前景色 */
18
+ --nt-audio-color-icon-hover: #000000;
19
+ /* 卡片背景(含渐变) */
20
+ --nt-audio-card-bg: #fff;
21
+ /* 卡片投影(双层叠加) */
22
+ --nt-audio-card-shadow:
23
+ 0 4px 24px rgba(0, 0, 0, 0.1),
24
+ 0 1px 4px rgba(0, 0, 0, 0.06);
25
+
2
26
  width: 100%;
3
27
  height: 100%;
4
28
  display: flex;
5
29
  align-items: center;
6
30
  justify-content: center;
7
31
 
8
- &__player {
32
+ &--theme-dark {
33
+ --nt-audio-color-text: #ffffff;
34
+ --nt-audio-color-rail: rgba(255, 255, 255, 0.32);
35
+ --nt-audio-color-played: #ffffff;
36
+ --nt-audio-color-thumb: #ffffff;
37
+ --nt-audio-color-error: #fca5a5;
38
+ --nt-audio-color-icon-hover: rgba(255, 255, 255, 0.92);
39
+ --nt-audio-card-bg: #606266;
40
+ --nt-audio-card-shadow:
41
+ 0 10px 40px rgba(0, 0, 0, 0.35),
42
+ 0 2px 10px rgba(0, 0, 0, 0.22);
43
+ }
44
+
45
+ &__frame {
46
+ width: 100%;
47
+ max-width: 720px;
48
+ padding: var(--nt-audio-inset-y) var(--nt-audio-inset-x);
49
+ }
50
+
51
+ &__card {
52
+ position: relative;
9
53
  width: 100%;
10
- max-width: 600px;
11
- padding: 20px;
54
+ border-radius: 10px;
55
+ overflow: hidden;
56
+ padding: var(--nt-audio-inset-y) var(--nt-audio-inset-x);
57
+ box-sizing: border-box;
58
+ background: var(--nt-audio-card-bg);
59
+ backdrop-filter: blur(10px);
60
+ box-shadow: var(--nt-audio-card-shadow);
61
+ transition: box-shadow 0.2s ease;
62
+ }
63
+
64
+ .nt-slider {
65
+ --nt-slider-color-rail: var(--nt-audio-color-rail);
66
+ --nt-slider-color-played: var(--nt-audio-color-played);
67
+ --nt-slider-color-thumb: var(--nt-audio-color-thumb);
12
68
  }
13
69
 
14
- &__controls {
70
+ &__toolbar {
71
+ position: relative;
72
+ z-index: 0;
15
73
  display: flex;
16
74
  align-items: center;
75
+ justify-content: space-between;
17
76
  gap: 12px;
77
+ padding: 10px 0 0;
78
+ // min-height: 44px;
79
+ overflow: visible;
18
80
  }
19
81
 
20
- &__play-btn,
21
- &__mute-btn {
22
- display: inline-flex;
82
+ &__toolbar-leading {
83
+ display: flex;
23
84
  align-items: center;
24
- justify-content: center;
85
+ gap: 10px;
86
+ min-width: 0;
87
+ flex: 1;
88
+ }
89
+
90
+ &__toolbar-trailing {
91
+ display: flex;
92
+ align-items: center;
93
+ flex-shrink: 0;
94
+ overflow: visible;
95
+ }
96
+
97
+ &__transport {
25
98
  flex-shrink: 0;
99
+ // width: 36px;
100
+ height: 36px;
101
+ display: flex;
102
+ align-items: center;
103
+ justify-content: center;
104
+ }
105
+
106
+ &__status-icon {
107
+ color: var(--nt-audio-color-text);
108
+
109
+ &--error {
110
+ color: var(--nt-audio-color-error);
111
+ cursor: pointer;
112
+ }
113
+ }
114
+
115
+ &__play {
116
+ // width: 36px;
117
+ height: 36px;
26
118
  padding: 0;
119
+ display: inline-flex;
120
+ align-items: center;
121
+ justify-content: center;
27
122
  border: none;
28
- background: none;
123
+ border-radius: 50%;
124
+ background: transparent;
125
+ color: var(--nt-audio-color-text);
29
126
  cursor: pointer;
30
- color: var(--el-text-color-primary);
31
- transition: color 0.2s ease;
127
+ transition:
128
+ color 0.2s ease,
129
+ opacity 0.2s ease,
130
+ transform 0.15s ease;
32
131
  outline: none;
33
132
 
34
- &:hover {
35
- color: var(--el-color-primary);
133
+ &:hover:not(:disabled) {
134
+ color: var(--nt-audio-color-icon-hover);
135
+ }
136
+
137
+ &:active:not(:disabled) {
138
+ transform: scale(0.94);
139
+ }
140
+
141
+ &:disabled {
142
+ cursor: not-allowed;
143
+ opacity: 0.45;
144
+ }
145
+
146
+ .nt-icon {
147
+ font-size: 22px;
148
+ margin-left: -4px;
36
149
  }
37
150
  }
38
151
 
39
- &__progress {
40
- flex: 1;
152
+ &__clock {
153
+ font-size: 13px;
154
+ line-height: 1;
155
+ color: var(--nt-audio-color-text);
156
+ font-family:
157
+ ui-monospace,
158
+ SFMono-Regular,
159
+ 'SF Mono',
160
+ Menlo,
161
+ Monaco,
162
+ Consolas,
163
+ 'Liberation Mono',
164
+ monospace;
165
+ font-variant-numeric: tabular-nums;
166
+ font-feature-settings: 'tnum' 1;
167
+ white-space: nowrap;
168
+ user-select: none;
169
+ }
170
+
171
+ &__sound {
172
+ display: inline-flex;
173
+ flex-direction: row;
174
+ align-items: center;
175
+ flex-shrink: 0;
176
+ justify-content: flex-end;
177
+ overflow: visible;
178
+
179
+ &:not(.nt-preview-audio__sound--disabled):hover,
180
+ &:not(.nt-preview-audio__sound--disabled):focus-within {
181
+ .nt-preview-audio__sound-expand {
182
+ max-width: 104px;
183
+ opacity: 1;
184
+ margin-right: 6px;
185
+ overflow: visible;
186
+ padding: 0 8px;
187
+ box-sizing: border-box;
188
+ }
189
+ }
41
190
 
42
- .el-slider {
43
- width: 100%;
191
+ &--disabled {
192
+ pointer-events: none;
193
+ opacity: 0.45;
44
194
  }
45
195
  }
46
196
 
47
- &__volume {
48
- width: 80px;
197
+ &__sound-expand {
198
+ max-width: 0;
199
+ opacity: 0;
200
+ overflow: hidden;
201
+ transition: none;
202
+ margin-right: 0;
203
+ display: flex;
204
+ align-items: center;
205
+ justify-content: flex-end;
49
206
  flex-shrink: 0;
207
+ box-sizing: border-box;
208
+ }
209
+
210
+ &__sound-slider.el-slider {
211
+ --el-slider-height: 4px;
212
+ --el-slider-button-wrapper-offset: -16px;
213
+
214
+ display: flex;
215
+ align-items: center;
216
+ flex: 0 0 88px;
217
+ width: 88px;
218
+ max-width: 88px;
219
+ margin: 0;
220
+ overflow: visible;
221
+
222
+ .el-slider__runway {
223
+ height: var(--el-slider-height);
224
+ margin: 0;
225
+ overflow: visible;
226
+ background-color: var(--nt-audio-color-rail);
227
+ }
50
228
 
51
- .el-slider {
52
- width: 100%;
229
+ .el-slider__bar {
230
+ height: var(--el-slider-height);
231
+ background-color: var(--nt-audio-color-played);
232
+ }
233
+
234
+ .el-slider__button {
235
+ width: 10px;
236
+ height: 10px;
237
+ border-width: 2px;
238
+ border-color: var(--nt-audio-color-thumb);
239
+ background-color: var(--nt-audio-color-thumb);
53
240
  }
54
241
  }
55
242
 
56
- &__time {
57
- font-size: 12px;
58
- color: var(--el-text-color-secondary);
59
- white-space: nowrap;
60
- font-variant-numeric: tabular-nums;
243
+ &__sound-mute {
244
+ display: inline-flex;
245
+ align-items: center;
246
+ justify-content: center;
61
247
  flex-shrink: 0;
248
+ // width: 36px;
249
+ height: 36px;
250
+ padding: 0;
251
+ border: none;
252
+ border-radius: 50%;
253
+ background: transparent;
254
+ cursor: pointer;
255
+ color: var(--nt-audio-color-text);
256
+ transition: color 0.2s ease;
257
+ outline: none;
258
+
259
+ .nt-icon {
260
+ font-size: 22px;
261
+ margin-right: -2px;
262
+ }
263
+
264
+ &:hover:not(:disabled) {
265
+ color: var(--nt-audio-color-icon-hover);
266
+ }
267
+
268
+ &:disabled {
269
+ cursor: not-allowed;
270
+ opacity: 0.45;
271
+ }
62
272
  }
63
273
  }
@@ -3,4 +3,5 @@
3
3
  @import './audio.scss';
4
4
  @import './video.scss';
5
5
  @import './text.scss';
6
+ @import './markdown.scss';
6
7
  @import './document.scss';
@@ -0,0 +1,153 @@
1
+ /* 结构与 nt-preview-text 一致,独立 BEM 块供 Markdown 源码预览使用 */
2
+
3
+ .nt-preview-markdown {
4
+ width: 100%;
5
+ height: 100%;
6
+ display: flex;
7
+ flex-direction: column;
8
+ overflow: hidden;
9
+
10
+ &--light {
11
+ background: #fff;
12
+
13
+ pre,
14
+ code {
15
+ background: #fff;
16
+ color: #24292e;
17
+ }
18
+ }
19
+
20
+ &--dark {
21
+ background: #1e1e1e;
22
+
23
+ pre,
24
+ code {
25
+ background: #1e1e1e;
26
+ color: #d4d4d4;
27
+ }
28
+
29
+ .nt-preview-markdown__toolbar {
30
+ border-bottom-color: #333;
31
+ }
32
+ }
33
+
34
+ &--wrap {
35
+ pre {
36
+ white-space: pre-wrap;
37
+ word-break: break-all;
38
+ }
39
+ }
40
+
41
+ &__toolbar {
42
+ display: flex;
43
+ align-items: center;
44
+ justify-content: space-between;
45
+ padding: 8px 16px;
46
+ border-bottom: 1px solid var(--el-border-color-lighter);
47
+ flex-shrink: 0;
48
+ padding-left: 10px;
49
+ min-height: 40px;
50
+ box-sizing: border-box;
51
+ }
52
+
53
+ &__language {
54
+ font-size: 12px;
55
+ color: var(--el-text-color-secondary);
56
+ text-transform: uppercase;
57
+ }
58
+
59
+ &__mode {
60
+ font-size: 12px;
61
+ color: var(--el-text-color-secondary);
62
+ text-transform: uppercase;
63
+
64
+ &-item {
65
+ cursor: pointer;
66
+ padding: 3px 6px;
67
+ border-radius: 3px;
68
+
69
+ &:hover {
70
+ background: var(--el-color-info-light-7);
71
+ }
72
+
73
+ &.is-active {
74
+ color: #fff;
75
+ background: var(--el-color-info-light-5);
76
+ }
77
+ }
78
+
79
+ &-item + &-item {
80
+ margin-left: 8px;
81
+ }
82
+ }
83
+
84
+ &__toolbar-actions {
85
+ display: flex;
86
+ align-items: center;
87
+ gap: 20px;
88
+ }
89
+
90
+ &__switch-item {
91
+ display: inline-flex;
92
+ align-items: center;
93
+ gap: 6px;
94
+ cursor: pointer;
95
+ font-size: 12px;
96
+ color: var(--el-text-color-secondary);
97
+ }
98
+
99
+ &__copy-button {
100
+ font-size: 12px;
101
+ color: var(--el-text-color-secondary);
102
+ font-weight: normal;
103
+ }
104
+
105
+ &__content {
106
+ flex: 1;
107
+ overflow: auto;
108
+ }
109
+
110
+ &__source {
111
+ pre {
112
+ margin: 0;
113
+ padding: 16px;
114
+ font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
115
+ font-size: 13px;
116
+ line-height: 1.6;
117
+ tab-size: 2;
118
+ }
119
+
120
+ code {
121
+ font-family: inherit;
122
+ }
123
+ }
124
+ &__preview {
125
+ padding: 16px;
126
+ }
127
+
128
+ &__line-numbers {
129
+ counter-reset: line;
130
+
131
+ .line {
132
+ display: block;
133
+ width: 100%;
134
+ position: relative;
135
+ padding-left: 4em;
136
+ box-sizing: border-box;
137
+
138
+ &::before {
139
+ position: absolute;
140
+ left: 0;
141
+ top: 0;
142
+ counter-increment: line;
143
+ content: counter(line);
144
+ display: inline-block;
145
+ width: 3em;
146
+ margin-right: 1em;
147
+ text-align: right;
148
+ color: var(--el-text-color-placeholder);
149
+ user-select: none;
150
+ }
151
+ }
152
+ }
153
+ }
@@ -66,6 +66,12 @@
66
66
  color: var(--el-text-color-secondary);
67
67
  }
68
68
 
69
+ &__copy-button {
70
+ font-size: 12px;
71
+ color: var(--el-text-color-secondary);
72
+ font-weight: normal;
73
+ }
74
+
69
75
  &__content {
70
76
  flex: 1;
71
77
  overflow: auto;