@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.
- package/dist/components/action/action-group.vue.d.ts +2 -2
- package/dist/components/action/action.vue.d.ts +1 -1
- package/dist/components/auto-complete/auto-complete.js +1 -0
- package/dist/components/auto-complete/auto-complete.js.map +1 -1
- package/dist/components/batch-edit/batch-edit-form.js +12 -5
- package/dist/components/batch-edit/batch-edit-form.js.map +1 -1
- package/dist/components/batch-edit/batch-edit.js +8 -3
- package/dist/components/batch-edit/batch-edit.js.map +1 -1
- package/dist/components/batch-edit/batch-edit.vue.d.ts +40 -35
- package/dist/components/batch-edit/di.js.map +1 -1
- package/dist/components/batch-edit/use-edit.js +41 -23
- package/dist/components/batch-edit/use-edit.js.map +1 -1
- package/dist/components/cascade/cascade.js +1 -0
- package/dist/components/cascade/cascade.js.map +1 -1
- package/dist/components/cascade/cascade.vue.d.ts +5 -5
- package/dist/components/checkbox/checkbox-button.js +1 -0
- package/dist/components/checkbox/checkbox-button.js.map +1 -1
- package/dist/components/checkbox/checkbox-button.vue.d.ts +1 -1
- package/dist/components/checkbox/checkbox.js +1 -0
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/checkbox-group/checkbox-group.js +1 -0
- package/dist/components/checkbox-group/checkbox-group.js.map +1 -1
- package/dist/components/checkbox-group/checkbox-group.vue.d.ts +2 -2
- package/dist/components/code-editor/code-editor.js +1 -0
- package/dist/components/code-editor/code-editor.js.map +1 -1
- package/dist/components/condition-editor/core/evaluator.js +3 -3
- package/dist/components/condition-editor/core/evaluator.js.map +1 -1
- package/dist/components/date-panel/date-panel.vue.d.ts +1 -1
- package/dist/components/date-picker/date-picker.js +1 -0
- package/dist/components/date-picker/date-picker.js.map +1 -1
- package/dist/components/date-picker/date-picker.vue.d.ts +1 -1
- package/dist/components/date-range-picker/date-range-picker.js +2 -0
- package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.vue.d.ts +1 -1
- package/dist/components/dialog/use-maximum.js +7 -1
- package/dist/components/dialog/use-maximum.js.map +1 -1
- package/dist/components/empty/empty.vue.d.ts +1 -1
- package/dist/components/expression-editor/expression-editor.js +1 -0
- package/dist/components/expression-editor/expression-editor.js.map +1 -1
- package/dist/components/file-picker/file-picker.js +1 -0
- package/dist/components/file-picker/file-picker.js.map +1 -1
- package/dist/components/form/form.js.map +1 -1
- package/dist/components/form/form.vue.d.ts +11 -19
- package/dist/components/form/form.vue_vue_type_script_setup_true_lang.js +24 -26
- package/dist/components/form/form.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/form/index.d.ts +0 -3
- package/dist/components/form/use-form-fields.js +88 -0
- package/dist/components/form/use-form-fields.js.map +1 -0
- package/dist/components/form/use-node-interceptor.js +19 -30
- package/dist/components/form/use-node-interceptor.js.map +1 -1
- package/dist/components/form-item/form-item.js.map +1 -1
- package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js +44 -18
- package/dist/components/form-item/form-item.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/form-item/helper.js +4 -1
- package/dist/components/form-item/helper.js.map +1 -1
- package/dist/components/form-item/validate.d.ts +26 -0
- package/dist/components/form-item/validate.js +97 -0
- package/dist/components/form-item/validate.js.map +1 -0
- package/dist/components/group-input/group-input.js +1 -0
- package/dist/components/group-input/group-input.js.map +1 -1
- package/dist/components/index.d.ts +0 -3
- package/dist/components/index.js +0 -7
- package/dist/components/input/input.vue_vue_type_script_setup_true_lang.js +1 -0
- package/dist/components/input/input.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/components/loading/style2.css +90 -159
- package/dist/components/multi-select/multi-select.js +1 -0
- package/dist/components/multi-select/multi-select.js.map +1 -1
- package/dist/components/multi-select/multi-select.vue.d.ts +3 -3
- package/dist/components/multi-tree-select/multi-tree-select.js +1 -0
- package/dist/components/multi-tree-select/multi-tree-select.js.map +1 -1
- package/dist/components/multi-tree-select/multi-tree-select.vue.d.ts +4 -4
- package/dist/components/number-input/number-input.js +1 -0
- package/dist/components/number-input/number-input.js.map +1 -1
- package/dist/components/number-range-input/number-range-input.js +1 -0
- package/dist/components/number-range-input/number-range-input.js.map +1 -1
- package/dist/components/palette/palette.js +1 -0
- package/dist/components/palette/palette.js.map +1 -1
- package/dist/components/password-input/password-input.js +1 -0
- package/dist/components/password-input/password-input.js.map +1 -1
- package/dist/components/pop-confirm/pop-confirm.vue.d.ts +1 -1
- package/dist/components/radio/radio.js +1 -0
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/radio-group/radio-group.js +1 -0
- package/dist/components/radio-group/radio-group.js.map +1 -1
- package/dist/components/radio-group/radio-group.vue.d.ts +2 -2
- package/dist/components/rich-text-editor/rich-text-editor.js +3 -2
- package/dist/components/rich-text-editor/rich-text-editor.js.map +1 -1
- package/dist/components/rich-text-editor/toolbar.js +10 -7
- package/dist/components/rich-text-editor/toolbar.js.map +1 -1
- package/dist/components/select/select.js +6 -3
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/select/select.vue.d.ts +2 -2
- package/dist/components/slider/slider.js +15 -2
- package/dist/components/slider/slider.js.map +1 -1
- package/dist/components/steps/steps.vue.d.ts +1 -1
- package/dist/components/switch/switch.js +1 -0
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/components/table/style2.css +4 -7
- package/dist/components/textarea/textarea.js +1 -0
- package/dist/components/textarea/textarea.js.map +1 -1
- package/dist/components/tip/tip.vue.d.ts +1 -1
- package/dist/components/tree-select/tree-select.js +1 -0
- package/dist/components/tree-select/tree-select.js.map +1 -1
- package/dist/components/tree-select/tree-select.vue.d.ts +4 -4
- package/dist/components/watermark/watermark.vue.d.ts +1 -1
- package/dist/index.d.ts +5 -6
- package/dist/index.js +1 -4
- package/dist/types/auto-complete.d.ts +3 -2
- package/dist/types/batch-edit.d.ts +4 -5
- package/dist/types/cascade.d.ts +3 -2
- package/dist/types/checkbox-group.d.ts +2 -2
- package/dist/types/checkbox.d.ts +4 -3
- package/dist/types/code-editor.d.ts +3 -2
- package/dist/types/date-picker.d.ts +3 -2
- package/dist/types/date-range-picker.d.ts +3 -2
- package/dist/types/expression-editor.d.ts +3 -2
- package/dist/types/file-picker.d.ts +3 -2
- package/dist/types/form-field.d.ts +12 -0
- package/dist/types/form-item.d.ts +2 -2
- package/dist/types/form.d.ts +9 -48
- package/dist/types/group-input.d.ts +3 -2
- package/dist/types/index.d.ts +4 -2
- package/dist/types/input.d.ts +3 -2
- package/dist/types/loading.d.ts +1 -1
- package/dist/types/multi-select.d.ts +3 -2
- package/dist/types/multi-tree-select.d.ts +3 -2
- package/dist/types/palette.d.ts +3 -2
- package/dist/types/radio-group.d.ts +3 -2
- package/dist/types/radio.d.ts +3 -2
- package/dist/types/rich-text-editor.d.ts +3 -2
- package/dist/types/select.d.ts +3 -2
- package/dist/types/slider.d.ts +3 -2
- package/dist/types/switch.d.ts +3 -2
- package/dist/types/text-editor.d.ts +3 -2
- package/dist/types/textarea.d.ts +3 -2
- package/dist/types/tree-select.d.ts +3 -2
- package/package.json +6 -6
- package/src/components/batch-edit/batch-edit-form.vue +20 -13
- package/src/components/batch-edit/batch-edit.vue +7 -8
- package/src/components/batch-edit/di.ts +1 -2
- package/src/components/batch-edit/use-edit.ts +58 -36
- package/src/components/date-range-picker/date-range-picker.vue +2 -0
- package/src/components/dialog/use-maximum.ts +8 -1
- package/src/components/form/form.vue +22 -38
- package/src/components/form/index.ts +0 -6
- package/src/components/form/use-form-fields.ts +126 -0
- package/src/components/form/use-node-interceptor.ts +27 -56
- package/src/components/form-item/form-item.vue +69 -18
- package/src/components/form-item/helper.ts +10 -4
- package/src/components/form-item/validate.ts +155 -0
- package/src/components/loading/style.scss +126 -355
- package/src/components/rich-text-editor/rich-text-editor.vue +28 -25
- package/src/components/rich-text-editor/toolbar.vue +23 -19
- package/src/components/select/select.vue +6 -4
- package/src/components/slider/slider.vue +12 -2
- package/src/components/table/style.scss +4 -14
- package/src/types/auto-complete.ts +4 -2
- package/src/types/batch-edit.ts +4 -5
- package/src/types/cascade.ts +4 -2
- package/src/types/checkbox-group.ts +2 -2
- package/src/types/checkbox.ts +5 -3
- package/src/types/code-editor.ts +4 -2
- package/src/types/date-picker.ts +4 -2
- package/src/types/date-range-picker.ts +4 -2
- package/src/types/expression-editor.ts +4 -2
- package/src/types/file-picker.ts +4 -2
- package/src/types/form-field.ts +11 -0
- package/src/types/form-item.ts +2 -2
- package/src/types/form.ts +9 -82
- package/src/types/group-input.ts +4 -2
- package/src/types/index.ts +1 -0
- package/src/types/input.ts +4 -2
- package/src/types/loading.ts +1 -1
- package/src/types/multi-select.ts +4 -2
- package/src/types/multi-tree-select.ts +5 -2
- package/src/types/palette.ts +4 -2
- package/src/types/radio-group.ts +4 -2
- package/src/types/radio.ts +4 -2
- package/src/types/rich-text-editor.ts +4 -2
- package/src/types/select.ts +4 -2
- package/src/types/slider.ts +4 -2
- package/src/types/switch.ts +4 -2
- package/src/types/text-editor.ts +4 -2
- package/src/types/textarea.ts +4 -2
- package/src/types/tree-select.ts +5 -2
- package/dist/components/form/dynamic-form-model.d.ts +0 -73
- package/dist/components/form/dynamic-form-model.js +0 -184
- package/dist/components/form/dynamic-form-model.js.map +0 -1
- package/dist/components/form/form-model.d.ts +0 -73
- package/dist/components/form/form-model.js +0 -179
- package/dist/components/form/form-model.js.map +0 -1
- package/dist/components/form/helper.d.ts +0 -16
- package/dist/components/form/helper.js +0 -20
- package/dist/components/form/helper.js.map +0 -1
- package/src/components/form/__test__/form-model.test.ts +0 -190
- package/src/components/form/dynamic-form-model.ts +0 -258
- package/src/components/form/form-model.ts +0 -255
- 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
|
-
//
|
|
21
|
-
|
|
19
|
+
// ============================================================
|
|
20
|
+
// spinner — 渐变圆弧旋转
|
|
21
|
+
// 使用 conic-gradient + mask 实现缺口圆环旋转
|
|
22
|
+
// ============================================================
|
|
23
|
+
@include m.e(spinner) {
|
|
22
24
|
@include m.bem($root-name, loader) {
|
|
23
|
-
|
|
24
|
-
width: 40px;
|
|
25
|
+
width: 42px;
|
|
25
26
|
aspect-ratio: 1;
|
|
26
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
43
|
-
|
|
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
|
-
//
|
|
49
|
-
|
|
72
|
+
// ============================================================
|
|
73
|
+
// line — 流光扫过
|
|
74
|
+
// 半透明底轨 + 渐变光条水平扫过
|
|
75
|
+
// ============================================================
|
|
76
|
+
@include m.e(line) {
|
|
50
77
|
@include m.bem($root-name, loader) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
background:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
//
|
|
79
|
-
|
|
101
|
+
// ============================================================
|
|
102
|
+
// classic — 雷达波纹扩散
|
|
103
|
+
// 两个同心圆环交替向外扩散并淡出
|
|
104
|
+
// ============================================================
|
|
105
|
+
@include m.e(classic) {
|
|
80
106
|
@include m.bem($root-name, loader) {
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
93
|
-
|
|
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
|
|
108
|
-
width: 8px;
|
|
109
|
-
height: 8px;
|
|
115
|
+
inset: 0;
|
|
110
116
|
border-radius: 50%;
|
|
111
|
-
|
|
112
|
-
animation:
|
|
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
|
-
//
|
|
118
|
-
|
|
127
|
+
// ============================================================
|
|
128
|
+
// morph — 形态变换
|
|
129
|
+
// 方块 ⟷ 圆形 来回变换,配合旋转
|
|
130
|
+
// ============================================================
|
|
131
|
+
@include m.e(morph) {
|
|
119
132
|
@include m.bem($root-name, loader) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
|
151
|
+
@keyframes loading-dot {
|
|
216
152
|
0%,
|
|
217
|
-
|
|
218
|
-
background-position:
|
|
219
|
-
0 0,
|
|
220
|
-
100% 0,
|
|
221
|
-
100% 100%,
|
|
222
|
-
0 100%;
|
|
223
|
-
}
|
|
224
|
-
50%,
|
|
153
|
+
80%,
|
|
225
154
|
100% {
|
|
226
|
-
|
|
227
|
-
|
|
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
|
-
|
|
242
|
-
|
|
243
|
-
|
|
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
|
-
|
|
361
|
-
|
|
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
|
|
376
|
-
0
|
|
377
|
-
|
|
378
|
-
|
|
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
|
-
|
|
401
|
-
|
|
402
|
-
50% 0;
|
|
179
|
+
transform: scale(1.35);
|
|
180
|
+
opacity: 0;
|
|
403
181
|
}
|
|
404
182
|
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
}
|
|
409
|
-
95% {
|
|
410
|
-
transform: translateY(15px);
|
|
411
|
-
}
|
|
183
|
+
|
|
184
|
+
@keyframes loading-morph {
|
|
185
|
+
0%,
|
|
412
186
|
100% {
|
|
413
|
-
|
|
414
|
-
|
|
187
|
+
border-radius: 50%;
|
|
188
|
+
transform: rotate(0deg) scale(1);
|
|
415
189
|
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
top: -0.1px;
|
|
190
|
+
25% {
|
|
191
|
+
border-radius: 8px;
|
|
192
|
+
transform: rotate(45deg) scale(0.7);
|
|
420
193
|
}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
80%,
|
|
425
|
-
100% {
|
|
426
|
-
transform: translate(0);
|
|
194
|
+
50% {
|
|
195
|
+
border-radius: 2px;
|
|
196
|
+
transform: rotate(90deg) scale(1);
|
|
427
197
|
}
|
|
428
|
-
|
|
429
|
-
|
|
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
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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.
|
|
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
|
-
|
|
89
|
-
|
|
87
|
+
editorState.read(
|
|
88
|
+
() => {
|
|
89
|
+
const selection = $getSelection()
|
|
90
|
+
if (!$isRangeSelection(selection)) return
|
|
90
91
|
|
|
91
|
-
|
|
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
|
-
|
|
241
|
+
let shouldRemoveLink = false
|
|
242
|
+
|
|
243
|
+
editorInstance.read(() => {
|
|
239
244
|
const selection = $getSelection()
|
|
240
245
|
if (!$isRangeSelection(selection)) return
|
|
241
246
|
|
|
242
|
-
const
|
|
243
|
-
|
|
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 {
|