@veltra/desktop 1.1.35 → 1.2.0

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 (198) hide show
  1. package/dist/components/action/action-group.vue.d.ts +2 -2
  2. package/dist/components/action/action.vue.d.ts +1 -1
  3. package/dist/components/auto-complete/auto-complete.js +1 -0
  4. package/dist/components/auto-complete/auto-complete.js.map +1 -1
  5. package/dist/components/batch-edit/batch-edit-form.js +12 -5
  6. package/dist/components/batch-edit/batch-edit-form.js.map +1 -1
  7. package/dist/components/batch-edit/batch-edit.js +8 -3
  8. package/dist/components/batch-edit/batch-edit.js.map +1 -1
  9. package/dist/components/batch-edit/batch-edit.vue.d.ts +40 -35
  10. package/dist/components/batch-edit/di.js.map +1 -1
  11. package/dist/components/batch-edit/use-edit.js +41 -23
  12. package/dist/components/batch-edit/use-edit.js.map +1 -1
  13. package/dist/components/cascade/cascade.js +1 -0
  14. package/dist/components/cascade/cascade.js.map +1 -1
  15. package/dist/components/cascade/cascade.vue.d.ts +5 -5
  16. package/dist/components/checkbox/checkbox-button.js +1 -0
  17. package/dist/components/checkbox/checkbox-button.js.map +1 -1
  18. package/dist/components/checkbox/checkbox-button.vue.d.ts +1 -1
  19. package/dist/components/checkbox/checkbox.js +1 -0
  20. package/dist/components/checkbox/checkbox.js.map +1 -1
  21. package/dist/components/checkbox-group/checkbox-group.js +1 -0
  22. package/dist/components/checkbox-group/checkbox-group.js.map +1 -1
  23. package/dist/components/checkbox-group/checkbox-group.vue.d.ts +2 -2
  24. package/dist/components/code-editor/code-editor.js +1 -0
  25. package/dist/components/code-editor/code-editor.js.map +1 -1
  26. package/dist/components/condition-editor/core/evaluator.js +3 -3
  27. package/dist/components/condition-editor/core/evaluator.js.map +1 -1
  28. package/dist/components/date-panel/date-panel.vue.d.ts +1 -1
  29. package/dist/components/date-picker/date-picker.js +1 -0
  30. package/dist/components/date-picker/date-picker.js.map +1 -1
  31. package/dist/components/date-picker/date-picker.vue.d.ts +1 -1
  32. package/dist/components/date-range-picker/date-range-picker.js +2 -0
  33. package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
  34. package/dist/components/date-range-picker/date-range-picker.vue.d.ts +1 -1
  35. package/dist/components/dialog/use-maximum.js +7 -1
  36. package/dist/components/dialog/use-maximum.js.map +1 -1
  37. package/dist/components/empty/empty.vue.d.ts +1 -1
  38. package/dist/components/expression-editor/expression-editor.js +1 -0
  39. package/dist/components/expression-editor/expression-editor.js.map +1 -1
  40. package/dist/components/file-picker/file-picker.js +1 -0
  41. package/dist/components/file-picker/file-picker.js.map +1 -1
  42. package/dist/components/form/form.js.map +1 -1
  43. package/dist/components/form/form.vue.d.ts +11 -19
  44. package/dist/components/form/form.vue_vue_type_script_setup_true_lang.js +24 -26
  45. package/dist/components/form/form.vue_vue_type_script_setup_true_lang.js.map +1 -1
  46. package/dist/components/form/index.d.ts +0 -3
  47. package/dist/components/form/use-form-fields.js +88 -0
  48. package/dist/components/form/use-form-fields.js.map +1 -0
  49. package/dist/components/form/use-node-interceptor.js +19 -30
  50. package/dist/components/form/use-node-interceptor.js.map +1 -1
  51. package/dist/components/form-item/form-item.js.map +1 -1
  52. package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js +44 -18
  53. package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js.map +1 -1
  54. package/dist/components/form-item/helper.js +4 -1
  55. package/dist/components/form-item/helper.js.map +1 -1
  56. package/dist/components/form-item/validate.d.ts +26 -0
  57. package/dist/components/form-item/validate.js +97 -0
  58. package/dist/components/form-item/validate.js.map +1 -0
  59. package/dist/components/group-input/group-input.js +1 -0
  60. package/dist/components/group-input/group-input.js.map +1 -1
  61. package/dist/components/index.d.ts +0 -3
  62. package/dist/components/index.js +0 -7
  63. package/dist/components/input/input.vue_vue_type_script_setup_true_lang.js +1 -0
  64. package/dist/components/input/input.vue_vue_type_script_setup_true_lang.js.map +1 -1
  65. package/dist/components/loading/style2.css +90 -159
  66. package/dist/components/multi-select/multi-select.js +1 -0
  67. package/dist/components/multi-select/multi-select.js.map +1 -1
  68. package/dist/components/multi-select/multi-select.vue.d.ts +3 -3
  69. package/dist/components/multi-tree-select/multi-tree-select.js +1 -0
  70. package/dist/components/multi-tree-select/multi-tree-select.js.map +1 -1
  71. package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +4 -4
  72. package/dist/components/number-input/number-input.js +1 -0
  73. package/dist/components/number-input/number-input.js.map +1 -1
  74. package/dist/components/number-range-input/number-range-input.js +1 -0
  75. package/dist/components/number-range-input/number-range-input.js.map +1 -1
  76. package/dist/components/palette/palette.js +1 -0
  77. package/dist/components/palette/palette.js.map +1 -1
  78. package/dist/components/password-input/password-input.js +1 -0
  79. package/dist/components/password-input/password-input.js.map +1 -1
  80. package/dist/components/pop-confirm/pop-confirm.vue.d.ts +1 -1
  81. package/dist/components/radio/radio.js +1 -0
  82. package/dist/components/radio/radio.js.map +1 -1
  83. package/dist/components/radio-group/radio-group.js +1 -0
  84. package/dist/components/radio-group/radio-group.js.map +1 -1
  85. package/dist/components/radio-group/radio-group.vue.d.ts +2 -2
  86. package/dist/components/rich-text-editor/rich-text-editor.js +3 -2
  87. package/dist/components/rich-text-editor/rich-text-editor.js.map +1 -1
  88. package/dist/components/rich-text-editor/toolbar.js +10 -7
  89. package/dist/components/rich-text-editor/toolbar.js.map +1 -1
  90. package/dist/components/select/select.js +6 -3
  91. package/dist/components/select/select.js.map +1 -1
  92. package/dist/components/select/select.vue.d.ts +2 -2
  93. package/dist/components/slider/slider.js +15 -2
  94. package/dist/components/slider/slider.js.map +1 -1
  95. package/dist/components/steps/steps.vue.d.ts +1 -1
  96. package/dist/components/switch/switch.js +1 -0
  97. package/dist/components/switch/switch.js.map +1 -1
  98. package/dist/components/table/style2.css +4 -7
  99. package/dist/components/textarea/textarea.js +1 -0
  100. package/dist/components/textarea/textarea.js.map +1 -1
  101. package/dist/components/tip/tip.vue.d.ts +1 -1
  102. package/dist/components/tree-select/tree-select.js +1 -0
  103. package/dist/components/tree-select/tree-select.js.map +1 -1
  104. package/dist/components/tree-select/tree-select.vue.d.ts +4 -4
  105. package/dist/components/watermark/watermark.vue.d.ts +1 -1
  106. package/dist/index.d.ts +5 -6
  107. package/dist/index.js +1 -4
  108. package/dist/types/auto-complete.d.ts +3 -2
  109. package/dist/types/batch-edit.d.ts +4 -5
  110. package/dist/types/cascade.d.ts +3 -2
  111. package/dist/types/checkbox-group.d.ts +2 -2
  112. package/dist/types/checkbox.d.ts +4 -3
  113. package/dist/types/code-editor.d.ts +3 -2
  114. package/dist/types/date-picker.d.ts +3 -2
  115. package/dist/types/date-range-picker.d.ts +3 -2
  116. package/dist/types/expression-editor.d.ts +3 -2
  117. package/dist/types/file-picker.d.ts +3 -2
  118. package/dist/types/form-field.d.ts +12 -0
  119. package/dist/types/form-item.d.ts +2 -2
  120. package/dist/types/form.d.ts +9 -48
  121. package/dist/types/group-input.d.ts +3 -2
  122. package/dist/types/index.d.ts +4 -2
  123. package/dist/types/input.d.ts +3 -2
  124. package/dist/types/loading.d.ts +1 -1
  125. package/dist/types/multi-select.d.ts +3 -2
  126. package/dist/types/multi-tree-select.d.ts +3 -2
  127. package/dist/types/palette.d.ts +3 -2
  128. package/dist/types/radio-group.d.ts +3 -2
  129. package/dist/types/radio.d.ts +3 -2
  130. package/dist/types/rich-text-editor.d.ts +3 -2
  131. package/dist/types/select.d.ts +3 -2
  132. package/dist/types/slider.d.ts +3 -2
  133. package/dist/types/switch.d.ts +3 -2
  134. package/dist/types/text-editor.d.ts +3 -2
  135. package/dist/types/textarea.d.ts +3 -2
  136. package/dist/types/tree-select.d.ts +3 -2
  137. package/package.json +6 -6
  138. package/src/components/batch-edit/batch-edit-form.vue +20 -13
  139. package/src/components/batch-edit/batch-edit.vue +7 -8
  140. package/src/components/batch-edit/di.ts +1 -2
  141. package/src/components/batch-edit/use-edit.ts +58 -36
  142. package/src/components/date-range-picker/date-range-picker.vue +2 -0
  143. package/src/components/dialog/use-maximum.ts +8 -1
  144. package/src/components/form/form.vue +22 -38
  145. package/src/components/form/index.ts +0 -6
  146. package/src/components/form/use-form-fields.ts +126 -0
  147. package/src/components/form/use-node-interceptor.ts +27 -56
  148. package/src/components/form-item/form-item.vue +69 -18
  149. package/src/components/form-item/helper.ts +10 -4
  150. package/src/components/form-item/validate.ts +155 -0
  151. package/src/components/loading/style.scss +126 -355
  152. package/src/components/rich-text-editor/rich-text-editor.vue +28 -25
  153. package/src/components/rich-text-editor/toolbar.vue +23 -19
  154. package/src/components/select/select.vue +6 -4
  155. package/src/components/slider/slider.vue +12 -2
  156. package/src/components/table/style.scss +4 -14
  157. package/src/types/auto-complete.ts +4 -2
  158. package/src/types/batch-edit.ts +4 -5
  159. package/src/types/cascade.ts +4 -2
  160. package/src/types/checkbox-group.ts +2 -2
  161. package/src/types/checkbox.ts +5 -3
  162. package/src/types/code-editor.ts +4 -2
  163. package/src/types/date-picker.ts +4 -2
  164. package/src/types/date-range-picker.ts +4 -2
  165. package/src/types/expression-editor.ts +4 -2
  166. package/src/types/file-picker.ts +4 -2
  167. package/src/types/form-field.ts +11 -0
  168. package/src/types/form-item.ts +2 -2
  169. package/src/types/form.ts +9 -82
  170. package/src/types/group-input.ts +4 -2
  171. package/src/types/index.ts +1 -0
  172. package/src/types/input.ts +4 -2
  173. package/src/types/loading.ts +1 -1
  174. package/src/types/multi-select.ts +4 -2
  175. package/src/types/multi-tree-select.ts +5 -2
  176. package/src/types/palette.ts +4 -2
  177. package/src/types/radio-group.ts +4 -2
  178. package/src/types/radio.ts +4 -2
  179. package/src/types/rich-text-editor.ts +4 -2
  180. package/src/types/select.ts +4 -2
  181. package/src/types/slider.ts +4 -2
  182. package/src/types/switch.ts +4 -2
  183. package/src/types/text-editor.ts +4 -2
  184. package/src/types/textarea.ts +4 -2
  185. package/src/types/tree-select.ts +5 -2
  186. package/dist/components/form/dynamic-form-model.d.ts +0 -73
  187. package/dist/components/form/dynamic-form-model.js +0 -184
  188. package/dist/components/form/dynamic-form-model.js.map +0 -1
  189. package/dist/components/form/form-model.d.ts +0 -73
  190. package/dist/components/form/form-model.js +0 -179
  191. package/dist/components/form/form-model.js.map +0 -1
  192. package/dist/components/form/helper.d.ts +0 -16
  193. package/dist/components/form/helper.js +0 -20
  194. package/dist/components/form/helper.js.map +0 -1
  195. package/src/components/form/__test__/form-model.test.ts +0 -190
  196. package/src/components/form/dynamic-form-model.ts +0 -258
  197. package/src/components/form/form-model.ts +0 -255
  198. package/src/components/form/helper.ts +0 -23
@@ -2,7 +2,6 @@
2
2
  @use 'pkg:@veltra/styles/functions' as fn;
3
3
  @use 'pkg:@veltra/styles/vars';
4
4
 
5
- // 方便拼接
6
5
  $root-name: loading;
7
6
 
8
7
  @include m.b($root-name) {
@@ -17,415 +16,187 @@ $root-name: loading;
17
16
  position: relative;
18
17
  }
19
18
 
20
- // line
21
- @include m.e(line) {
19
+ // ============================================================
20
+ // spinner — 渐变圆弧旋转
21
+ // 使用 conic-gradient + mask 实现缺口圆环旋转
22
+ // ============================================================
23
+ @include m.e(spinner) {
22
24
  @include m.bem($root-name, loader) {
23
- $c: no-repeat linear-gradient(#{fn.use-var(text-color, main)} 0 0);
24
- width: 40px;
25
+ width: 42px;
25
26
  aspect-ratio: 1;
26
- display: grid;
27
+ border-radius: 50%;
28
+ background: conic-gradient(from 0deg, transparent 25%, currentColor 70%, transparent 100%);
29
+ mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
30
+ animation: loading-spin 0.85s linear infinite;
31
+ }
32
+ }
33
+
34
+ // ============================================================
35
+ // dot — 三点波浪弹跳
36
+ // 元素自身 + 两个伪元素,交错弹跳
37
+ // ============================================================
38
+ @include m.e(dot) {
39
+ @include m.bem($root-name, loader) {
40
+ width: 10px;
41
+ height: 10px;
42
+ border-radius: 50%;
43
+ background: currentColor;
44
+ position: relative;
45
+ animation: loading-dot 1.4s ease-in-out infinite;
27
46
 
28
47
  &::before,
29
48
  &::after {
30
49
  content: '';
31
- grid-area: 1/1;
32
- background:
33
- #{$c} 0 0,
34
- #{$c} 100% 0,
35
- #{$c} 100% 100%,
36
- #{$c} 0 100%;
37
- animation:
38
- line-1 2s infinite linear,
39
- line-2 2s infinite linear;
50
+ position: absolute;
51
+ top: 0;
52
+ width: 10px;
53
+ height: 10px;
54
+ border-radius: 50%;
55
+ background: currentColor;
40
56
  }
57
+
58
+ &::before {
59
+ left: -20px;
60
+ animation: loading-dot 1.4s ease-in-out infinite;
61
+ animation-delay: 0.2s;
62
+ }
63
+
41
64
  &::after {
42
- margin: 25%;
43
- transform: scale(-1);
65
+ right: -20px;
66
+ animation: loading-dot 1.4s ease-in-out infinite;
67
+ animation-delay: 0.4s;
44
68
  }
45
69
  }
46
70
  }
47
71
 
48
- // spinner
49
- @include m.e(spinner) {
72
+ // ============================================================
73
+ // line — 流光扫过
74
+ // 半透明底轨 + 渐变光条水平扫过
75
+ // ============================================================
76
+ @include m.e(line) {
50
77
  @include m.bem($root-name, loader) {
51
- $c: no-repeat radial-gradient(farthest-side, #{fn.use-var(text-color, main)} 92%, #0000);
52
- width: 50px;
53
- aspect-ratio: 1;
54
- display: grid;
78
+ width: 160px;
79
+ height: 3px;
80
+ border-radius: 1.5px;
81
+ background: fn.use-var(bg-color, hover);
82
+ overflow: hidden;
83
+ position: relative;
55
84
 
56
- &::before,
57
85
  &::after {
58
86
  content: '';
59
- grid-area: 1/1;
60
-
61
- background:
62
- #{$c} 50% 0,
63
- #{$c} 50% 100%,
64
- #{$c} 100% 50%,
65
- #{$c} 0 50%;
66
- background-size: 12px 12px;
67
- animation: spinner 1s infinite;
68
- }
69
- &::before {
70
- margin: 4px;
71
- filter: hue-rotate(45deg);
72
- background-size: 8px 8px;
73
- animation-timing-function: linear;
87
+ position: absolute;
88
+ inset: 0;
89
+ background: linear-gradient(
90
+ 90deg,
91
+ transparent 0%,
92
+ currentColor 40%,
93
+ currentColor 60%,
94
+ transparent 100%
95
+ );
96
+ animation: loading-shimmer 1.4s ease-in-out infinite;
74
97
  }
75
98
  }
76
99
  }
77
100
 
78
- // dot
79
- @include m.e(dot) {
101
+ // ============================================================
102
+ // classic — 雷达波纹扩散
103
+ // 两个同心圆环交替向外扩散并淡出
104
+ // ============================================================
105
+ @include m.e(classic) {
80
106
  @include m.bem($root-name, loader) {
81
- $c: no-repeat radial-gradient(farthest-side, #{fn.use-var(text-color, main)} 93%, #0000);
82
- width: 40px;
83
- height: 20px;
84
- background:
85
- #{$c} 0 0,
86
- #{$c} 50% 0;
87
- background-size: 8px 8px;
107
+ width: 44px;
108
+ aspect-ratio: 1;
88
109
  position: relative;
89
- clip-path: inset(-200% -100% 0 0);
90
- animation: dot-0 1.5s linear infinite;
91
110
 
92
- &:before {
93
- content: '';
94
- position: absolute;
95
- width: 8px;
96
- height: 12px;
97
- background: fn.use-var(text-color, main);
98
- left: -16px;
99
- top: 0;
100
- animation:
101
- dot-1 1.5s linear infinite,
102
- dot-2 0.5s cubic-bezier(0, 200, 0.8, 200) infinite;
103
- }
104
- &:after {
111
+ &::before,
112
+ &::after {
105
113
  content: '';
106
114
  position: absolute;
107
- inset: 0 0 auto auto;
108
- width: 8px;
109
- height: 8px;
115
+ inset: 0;
110
116
  border-radius: 50%;
111
- background: fn.use-var(text-color, main);
112
- animation: dot-3 1.5s linear infinite;
117
+ border: 3px solid currentColor;
118
+ animation: loading-pulse 1.6s ease-out infinite;
119
+ }
120
+
121
+ &::after {
122
+ animation-delay: 0.8s;
113
123
  }
114
124
  }
115
125
  }
116
126
 
117
- // classic
118
- @include m.e(classic) {
127
+ // ============================================================
128
+ // morph — 形态变换
129
+ // 方块 ⟷ 圆形 来回变换,配合旋转
130
+ // ============================================================
131
+ @include m.e(morph) {
119
132
  @include m.bem($root-name, loader) {
120
- font-size: fn.use-var(font-size, title, default);
121
- line-height: 1.4em;
122
- letter-spacing: 6ch;
123
- width: 6ch;
124
- overflow: hidden;
125
- white-space: nowrap;
126
- color: #0000;
127
- text-shadow:
128
- calc(0 * 6ch) 0 #{fn.use-var(text-color, main)},
129
- calc(-1 * 6ch) 0 #{fn.use-var(text-color, main)},
130
- calc(-2 * 6ch) 0 #{fn.use-var(text-color, main)},
131
- calc(-3 * 6ch) 0 #{fn.use-var(text-color, main)},
132
- calc(-4 * 6ch) 0 #{fn.use-var(text-color, main)},
133
- calc(-5 * 6ch) 0 #{fn.use-var(text-color, main)};
134
- // calc(-6 * 6ch) 0 #{fn.use-var(text-color, main)},
135
- // calc(-7 * 6ch) 0 #{fn.use-var(text-color, main)},
136
- // calc(-8 * 6ch) 0 #{fn.use-var(text-color, main)},
137
- // calc(-9 * 6ch) 0 #{fn.use-var(text-color, main)};
138
- animation: classic 2s infinite linear;
139
-
140
- &::before {
141
- content: '加载中...';
142
- }
133
+ width: 34px;
134
+ aspect-ratio: 1;
135
+ background: currentColor;
136
+ animation: loading-morph 2.4s ease-in-out infinite;
143
137
  }
144
138
  }
145
139
  }
146
140
 
147
- // 线条
148
- @keyframes line-1 {
149
- 0% {
150
- background-size:
151
- 0 4px,
152
- 4px 0,
153
- 0 4px,
154
- 4px 0;
155
- }
156
- 12.5% {
157
- background-size:
158
- 100% 4px,
159
- 4px 0,
160
- 0 4px,
161
- 4px 0;
162
- }
163
- 25% {
164
- background-size:
165
- 100% 4px,
166
- 4px 100%,
167
- 0 4px,
168
- 4px 0;
169
- }
170
- 37.5% {
171
- background-size:
172
- 100% 4px,
173
- 4px 100%,
174
- 100% 4px,
175
- 4px 0;
176
- }
177
- 45%,
178
- 55% {
179
- background-size:
180
- 100% 4px,
181
- 4px 100%,
182
- 100% 4px,
183
- 4px 100%;
184
- }
185
- 62.5% {
186
- background-size:
187
- 0 4px,
188
- 4px 100%,
189
- 100% 4px,
190
- 4px 100%;
191
- }
192
- 75% {
193
- background-size:
194
- 0 4px,
195
- 4px 0,
196
- 100% 4px,
197
- 4px 100%;
198
- }
199
- 87.5% {
200
- background-size:
201
- 0 4px,
202
- 4px 0,
203
- 0 4px,
204
- 4px 100%;
205
- }
206
- 100% {
207
- background-size:
208
- 0 4px,
209
- 4px 0,
210
- 0 4px,
211
- 4px 0;
141
+ // ================================================================
142
+ // 关键帧
143
+ // ================================================================
144
+
145
+ @keyframes loading-spin {
146
+ to {
147
+ transform: rotate(1turn);
212
148
  }
213
149
  }
214
150
 
215
- @keyframes line-2 {
151
+ @keyframes loading-dot {
216
152
  0%,
217
- 49.9% {
218
- background-position:
219
- 0 0,
220
- 100% 0,
221
- 100% 100%,
222
- 0 100%;
223
- }
224
- 50%,
153
+ 80%,
225
154
  100% {
226
- background-position:
227
- 100% 0,
228
- 100% 100%,
229
- 0 100%,
230
- 0 0;
155
+ transform: scale(0.4);
156
+ opacity: 0.25;
231
157
  }
232
- }
233
-
234
- // 旋转
235
- @keyframes spinner {
236
- 100% {
237
- transform: rotate(0.5turn);
158
+ 40% {
159
+ transform: scale(1);
160
+ opacity: 1;
238
161
  }
239
162
  }
240
163
 
241
- // classic
242
- @keyframes classic {
243
- 9.09% {
244
- text-shadow:
245
- calc(0 * 6ch) -10px #{fn.use-var(text-color, main)},
246
- calc(-1 * 6ch) 0 #{fn.use-var(text-color, main)},
247
- calc(-2 * 6ch) 0 #{fn.use-var(text-color, main)},
248
- calc(-3 * 6ch) 0 #{fn.use-var(text-color, main)},
249
- calc(-4 * 6ch) 0 #{fn.use-var(text-color, main)},
250
- calc(-5 * 6ch) 0 #{fn.use-var(text-color, main)};
251
- // calc(-6 * 6ch) 0 #{fn.use-var(text-color, main)},
252
- // calc(-7 * 6ch) 0 #{fn.use-var(text-color, main)},
253
- // calc(-8 * 6ch) 0 #{fn.use-var(text-color, main)},
254
- // calc(-9 * 6ch) 0 #{fn.use-var(text-color, main)};
255
- }
256
- 18.18% {
257
- text-shadow:
258
- calc(0 * 6ch) 0 #{fn.use-var(text-color, main)},
259
- calc(-1 * 6ch) -10px #{fn.use-var(text-color, main)},
260
- calc(-2 * 6ch) 0 #{fn.use-var(text-color, main)},
261
- calc(-3 * 6ch) 0 #{fn.use-var(text-color, main)},
262
- calc(-4 * 6ch) 0 #{fn.use-var(text-color, main)},
263
- calc(-5 * 6ch) 0 #{fn.use-var(text-color, main)};
264
- // calc(-6 * 6ch) 0 #{fn.use-var(text-color, main)},
265
- // calc(-7 * 6ch) 0 #{fn.use-var(text-color, main)},
266
- // calc(-8 * 6ch) 0 #{fn.use-var(text-color, main)},
267
- // calc(-9 * 6ch) 0 #{fn.use-var(text-color, main)};
268
- }
269
- 27.27% {
270
- text-shadow:
271
- calc(0 * 6ch) 0 #{fn.use-var(text-color, main)},
272
- calc(-1 * 6ch) 0 #{fn.use-var(text-color, main)},
273
- calc(-2 * 6ch) -10px #{fn.use-var(text-color, main)},
274
- calc(-3 * 6ch) 0 #{fn.use-var(text-color, main)},
275
- calc(-4 * 6ch) 0 #{fn.use-var(text-color, main)},
276
- calc(-5 * 6ch) 0 #{fn.use-var(text-color, main)};
277
- // calc(-6 * 6ch) 0 #{fn.use-var(text-color, main)},
278
- // calc(-7 * 6ch) 0 #{fn.use-var(text-color, main)},
279
- // calc(-8 * 6ch) 0 #{fn.use-var(text-color, main)},
280
- // calc(-9 * 6ch) 0 #{fn.use-var(text-color, main)};
281
- }
282
- 36.36% {
283
- text-shadow:
284
- calc(0 * 6ch) 0 #{fn.use-var(text-color, main)},
285
- calc(-1 * 6ch) 0 #{fn.use-var(text-color, main)},
286
- calc(-2 * 6ch) 0 #{fn.use-var(text-color, main)},
287
- calc(-3 * 6ch) -10px #{fn.use-var(text-color, main)},
288
- calc(-4 * 6ch) 0 #{fn.use-var(text-color, main)},
289
- calc(-5 * 6ch) 0 #{fn.use-var(text-color, main)};
290
- // calc(-6 * 6ch) 0 #{fn.use-var(text-color, main)},
291
- // calc(-7 * 6ch) 0 #{fn.use-var(text-color, main)},
292
- // calc(-8 * 6ch) 0 #{fn.use-var(text-color, main)},
293
- // calc(-9 * 6ch) 0 #{fn.use-var(text-color, main)};
294
- }
295
- 45.45% {
296
- text-shadow:
297
- calc(0 * 6ch) 0 #{fn.use-var(text-color, main)},
298
- calc(-1 * 6ch) 0 #{fn.use-var(text-color, main)},
299
- calc(-2 * 6ch) 0 #{fn.use-var(text-color, main)},
300
- calc(-3 * 6ch) 0 #{fn.use-var(text-color, main)},
301
- calc(-4 * 6ch) -10px #{fn.use-var(text-color, main)},
302
- calc(-5 * 6ch) 0 #{fn.use-var(text-color, main)};
303
- // calc(-6 * 6ch) 0 #{fn.use-var(text-color, main)},
304
- // calc(-7 * 6ch) 0 #{fn.use-var(text-color, main)},
305
- // calc(-8 * 6ch) 0 #{fn.use-var(text-color, main)},
306
- // calc(-9 * 6ch) 0 #{fn.use-var(text-color, main)};
307
- }
308
- 54.54% {
309
- text-shadow:
310
- calc(0 * 6ch) 0 #{fn.use-var(text-color, main)},
311
- calc(-1 * 6ch) 0 #{fn.use-var(text-color, main)},
312
- calc(-2 * 6ch) 0 #{fn.use-var(text-color, main)},
313
- calc(-3 * 6ch) 0 #{fn.use-var(text-color, main)},
314
- calc(-4 * 6ch) 0 #{fn.use-var(text-color, main)},
315
- calc(-5 * 6ch) -10px #{fn.use-var(text-color, main)};
316
- // calc(-6 * 6ch) 0 #{fn.use-var(text-color, main)},
317
- // calc(-7 * 6ch) 0 #{fn.use-var(text-color, main)},
318
- // calc(-8 * 6ch) 0 #{fn.use-var(text-color, main)},
319
- // calc(-9 * 6ch) 0 #{fn.use-var(text-color, main)};
320
- }
321
- 63.63% {
322
- text-shadow:
323
- calc(0 * 6ch) 0 #{fn.use-var(text-color, main)},
324
- calc(-1 * 6ch) 0 #{fn.use-var(text-color, main)},
325
- calc(-2 * 6ch) 0 #{fn.use-var(text-color, main)},
326
- calc(-3 * 6ch) 0 #{fn.use-var(text-color, main)},
327
- calc(-4 * 6ch) 0 #{fn.use-var(text-color, main)},
328
- calc(-5 * 6ch) 0 #{fn.use-var(text-color, main)};
329
- // calc(-6 * 6ch) -10px #{fn.use-var(text-color, main)},
330
- // calc(-7 * 6ch) 0 #{fn.use-var(text-color, main)},
331
- // calc(-8 * 6ch) 0 #{fn.use-var(text-color, main)},
332
- // calc(-9 * 6ch) 0 #{fn.use-var(text-color, main)};
333
- }
334
- 72.72% {
335
- text-shadow:
336
- calc(0 * 6ch) 0 #{fn.use-var(text-color, main)},
337
- calc(-1 * 6ch) 0 #{fn.use-var(text-color, main)},
338
- calc(-2 * 6ch) 0 #{fn.use-var(text-color, main)},
339
- calc(-3 * 6ch) 0 #{fn.use-var(text-color, main)},
340
- calc(-4 * 6ch) 0 #{fn.use-var(text-color, main)},
341
- calc(-5 * 6ch) 0 #{fn.use-var(text-color, main)};
342
- // calc(-6 * 6ch) 0 #{fn.use-var(text-color, main)},
343
- // calc(-7 * 6ch) -10px #{fn.use-var(text-color, main)},
344
- // calc(-8 * 6ch) 0 #{fn.use-var(text-color, main)},
345
- // calc(-9 * 6ch) 0 #{fn.use-var(text-color, main)};
346
- }
347
- 81.81% {
348
- text-shadow:
349
- calc(0 * 6ch) 0 #{fn.use-var(text-color, main)},
350
- calc(-1 * 6ch) 0 #{fn.use-var(text-color, main)},
351
- calc(-2 * 6ch) 0 #{fn.use-var(text-color, main)},
352
- calc(-3 * 6ch) 0 #{fn.use-var(text-color, main)},
353
- calc(-4 * 6ch) 0 #{fn.use-var(text-color, main)},
354
- calc(-5 * 6ch) 0 #{fn.use-var(text-color, main)};
355
- // calc(-6 * 6ch) 0 #{fn.use-var(text-color, main)},
356
- // calc(-7 * 6ch) 0 #{fn.use-var(text-color, main)},
357
- // calc(-8 * 6ch) -10px #{fn.use-var(text-color, main)},
358
- // calc(-9 * 6ch) 0 #{fn.use-var(text-color, main)};
164
+ @keyframes loading-shimmer {
165
+ 0% {
166
+ transform: translateX(-100%);
359
167
  }
360
- 90.90% {
361
- text-shadow:
362
- calc(0 * 6ch) 0 #{fn.use-var(text-color, main)},
363
- calc(-1 * 6ch) 0 #{fn.use-var(text-color, main)},
364
- calc(-2 * 6ch) 0 #{fn.use-var(text-color, main)},
365
- calc(-3 * 6ch) 0 #{fn.use-var(text-color, main)},
366
- calc(-4 * 6ch) 0 #{fn.use-var(text-color, main)},
367
- calc(-5 * 6ch) 0 #{fn.use-var(text-color, main)};
368
- // calc(-6 * 6ch) 0 #{fn.use-var(text-color, main)},
369
- // calc(-7 * 6ch) 0 #{fn.use-var(text-color, main)},
370
- // calc(-8 * 6ch) 0 #{fn.use-var(text-color, main)},
371
- // calc(-9 * 6ch) -10px #{fn.use-var(text-color, main)};
168
+ 100% {
169
+ transform: translateX(100%);
372
170
  }
373
171
  }
374
172
 
375
- @keyframes dot-0 {
376
- 0%,
377
- 30% {
378
- background-position:
379
- 0 0,
380
- 50% 0;
381
- }
382
- 33% {
383
- background-position:
384
- 0 100%,
385
- 50% 0;
386
- }
387
- 41%,
388
- 63% {
389
- background-position:
390
- 0 0,
391
- 50% 0;
392
- }
393
- 66% {
394
- background-position:
395
- 0 0,
396
- 50% 100%;
173
+ @keyframes loading-pulse {
174
+ 0% {
175
+ transform: scale(0.2);
176
+ opacity: 1;
397
177
  }
398
- 74%,
399
178
  100% {
400
- background-position:
401
- 0 0,
402
- 50% 0;
179
+ transform: scale(1.35);
180
+ opacity: 0;
403
181
  }
404
182
  }
405
- @keyframes dot-1 {
406
- 90% {
407
- transform: translateY(0);
408
- }
409
- 95% {
410
- transform: translateY(15px);
411
- }
183
+
184
+ @keyframes loading-morph {
185
+ 0%,
412
186
  100% {
413
- transform: translateY(15px);
414
- left: calc(100% - 8px);
187
+ border-radius: 50%;
188
+ transform: rotate(0deg) scale(1);
415
189
  }
416
- }
417
- @keyframes dot-2 {
418
- 100% {
419
- top: -0.1px;
190
+ 25% {
191
+ border-radius: 8px;
192
+ transform: rotate(45deg) scale(0.7);
420
193
  }
421
- }
422
- @keyframes dot-3 {
423
- 0%,
424
- 80%,
425
- 100% {
426
- transform: translate(0);
194
+ 50% {
195
+ border-radius: 2px;
196
+ transform: rotate(90deg) scale(1);
427
197
  }
428
- 90% {
429
- transform: translate(26px);
198
+ 75% {
199
+ border-radius: 8px;
200
+ transform: rotate(135deg) scale(0.7);
430
201
  }
431
202
  }
@@ -152,30 +152,33 @@ function initEditor() {
152
152
  // Listen for content changes
153
153
  cleanupFns.push(
154
154
  editorInstance.registerUpdateListener(({ editorState }) => {
155
- editorState.read(() => {
156
- const root = $getRoot()
157
- const textContent = root.getTextContent()
158
- showPlaceholder.value = textContent.trim().length === 0
159
-
160
- if (isComposing) return
161
-
162
- let value: string
163
- if (props.format === 'json') {
164
- value = JSON.stringify(editorState.toJSON())
165
- } else {
166
- value = $generateHtmlFromNodes(editorInstance)
167
- }
168
-
169
- // Avoid circular updates: only emit if content really changed
170
- if (value !== model.value) {
171
- isComposing = true
172
- model.value = value
173
- // Use microtask to reset after Vue processes the update
174
- queueMicrotask(() => {
175
- isComposing = false
176
- })
177
- }
178
- })
155
+ editorState.read(
156
+ () => {
157
+ const root = $getRoot()
158
+ const textContent = root.getTextContent()
159
+ showPlaceholder.value = textContent.trim().length === 0
160
+
161
+ if (isComposing) return
162
+
163
+ let value: string
164
+ if (props.format === 'json') {
165
+ value = JSON.stringify(editorState.toJSON())
166
+ } else {
167
+ value = $generateHtmlFromNodes(editorInstance)
168
+ }
169
+
170
+ // Avoid circular updates: only emit if content really changed
171
+ if (value !== model.value) {
172
+ isComposing = true
173
+ model.value = value
174
+ // Use microtask to reset after Vue processes the update
175
+ queueMicrotask(() => {
176
+ isComposing = false
177
+ })
178
+ }
179
+ },
180
+ { editor: editorInstance }
181
+ )
179
182
  })
180
183
  )
181
184
 
@@ -229,7 +232,7 @@ watch(model, (newVal) => {
229
232
  const editorInstance = editor.value
230
233
 
231
234
  // Compare current content to avoid circular updates
232
- editorInstance.getEditorState().read(() => {
235
+ editorInstance.read(() => {
233
236
  let currentValue: string
234
237
  if (props.format === 'json') {
235
238
  currentValue = JSON.stringify(editorInstance.getEditorState().toJSON())
@@ -84,12 +84,15 @@ let cleanupListener: (() => void) | null = null
84
84
  function setupListener(editorInstance: LexicalEditor) {
85
85
  cleanupListener?.()
86
86
  cleanupListener = editorInstance.registerUpdateListener(({ editorState }) => {
87
- editorState.read(() => {
88
- const selection = $getSelection()
89
- if (!$isRangeSelection(selection)) return
87
+ editorState.read(
88
+ () => {
89
+ const selection = $getSelection()
90
+ if (!$isRangeSelection(selection)) return
90
91
 
91
- updateToolbarState(selection)
92
- })
92
+ updateToolbarState(selection)
93
+ },
94
+ { editor: editorInstance }
95
+ )
93
96
  })
94
97
  }
95
98
 
@@ -235,24 +238,25 @@ function onHeadingChange(event: Event) {
235
238
  }
236
239
 
237
240
  function toggleLink(editorInstance: LexicalEditor) {
238
- editorInstance.getEditorState().read(() => {
241
+ let shouldRemoveLink = false
242
+
243
+ editorInstance.read(() => {
239
244
  const selection = $getSelection()
240
245
  if (!$isRangeSelection(selection)) return
241
246
 
242
- const anchorNode = selection.anchor.getNode()
243
- const parent = anchorNode.getParent()
244
-
245
- if ($isLinkNode(parent)) {
246
- // Remove link
247
- editorInstance.dispatchCommand(TOGGLE_LINK_COMMAND, null)
248
- } else {
249
- // Insert link with prompt
250
- const url = prompt('请输入链接地址:', 'https://')
251
- if (url && url !== 'https://') {
252
- editorInstance.dispatchCommand(TOGGLE_LINK_COMMAND, url)
253
- }
254
- }
247
+ const parent = selection.anchor.getNode().getParent()
248
+ shouldRemoveLink = $isLinkNode(parent)
255
249
  })
250
+
251
+ if (shouldRemoveLink) {
252
+ editorInstance.dispatchCommand(TOGGLE_LINK_COMMAND, null)
253
+ return
254
+ }
255
+
256
+ const url = prompt('请输入链接地址:', 'https://')
257
+ if (url && url !== 'https://') {
258
+ editorInstance.dispatchCommand(TOGGLE_LINK_COMMAND, url)
259
+ }
256
260
  }
257
261
 
258
262
  function getTitle(item: ToolbarItem): string {