@mathwiz/ui-components 0.1.30 → 0.1.31
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/AICopilot/AICopilot.css +237 -0
- package/dist/components/AICopilot/AICopilot.d.ts +10 -0
- package/dist/components/AICopilot/AICopilot.d.ts.map +1 -0
- package/dist/components/AICopilot/components/ChatContainer.d.ts +9 -0
- package/dist/components/AICopilot/components/ChatContainer.d.ts.map +1 -0
- package/dist/components/AICopilot/components/ChatInput.d.ts +9 -0
- package/dist/components/AICopilot/components/ChatInput.d.ts.map +1 -0
- package/dist/components/AICopilot/components/ChatMessage.d.ts +9 -0
- package/dist/components/AICopilot/components/ChatMessage.d.ts.map +1 -0
- package/dist/components/AICopilot/components/CollapsibleContextBar.d.ts +9 -0
- package/dist/components/AICopilot/components/CollapsibleContextBar.d.ts.map +1 -0
- package/dist/components/AICopilot/components/QuickActions.d.ts +9 -0
- package/dist/components/AICopilot/components/QuickActions.d.ts.map +1 -0
- package/dist/components/AICopilot/components/StreamMessage.d.ts +9 -0
- package/dist/components/AICopilot/components/StreamMessage.d.ts.map +1 -0
- package/dist/components/AICopilot/index.d.ts +12 -0
- package/dist/components/AICopilot/index.d.ts.map +1 -0
- package/dist/components/AICopilot/store.d.ts +30 -0
- package/dist/components/AICopilot/store.d.ts.map +1 -0
- package/dist/components/AICopilot/types.d.ts +219 -0
- package/dist/components/AICopilot/types.d.ts.map +1 -0
- package/dist/components/MathCardV2/MathCardV2.types.d.ts +20 -1
- package/dist/components/MathCardV2/MathCardV2.types.d.ts.map +1 -1
- package/dist/components/MathCardV2/components/content/MathContainerContent.d.ts +16 -0
- package/dist/components/MathCardV2/components/content/MathContainerContent.d.ts.map +1 -0
- package/dist/components/MathCardV2/components/renderers/ContentRenderer.d.ts.map +1 -1
- package/dist/components/MathCardV2/hooks/useDataAdapter.d.ts.map +1 -1
- package/dist/components/MathCardV2/hooks/useMeetingProblemAdapter.d.ts.map +1 -1
- package/dist/components/MathCell/MathCell.d.ts +35 -0
- package/dist/components/MathCell/MathCell.d.ts.map +1 -0
- package/dist/components/MathCell/MathCell.styles.d.ts +149 -0
- package/dist/components/MathCell/MathCell.styles.d.ts.map +1 -0
- package/dist/components/MathCell/MathCell.types.d.ts +76 -0
- package/dist/components/MathCell/MathCell.types.d.ts.map +1 -0
- package/dist/components/MathCell/index.d.ts +11 -0
- package/dist/components/MathCell/index.d.ts.map +1 -0
- package/dist/components/MathContainer/FactorTable/FactorTable.d.ts +17 -0
- package/dist/components/MathContainer/FactorTable/FactorTable.d.ts.map +1 -0
- package/dist/components/MathContainer/FactorTable/FactorTable.types.d.ts +55 -0
- package/dist/components/MathContainer/FactorTable/FactorTable.types.d.ts.map +1 -0
- package/dist/components/MathContainer/FactorTable/FactorTableView.d.ts +28 -0
- package/dist/components/MathContainer/FactorTable/FactorTableView.d.ts.map +1 -0
- package/dist/components/MathContainer/FactorTable/index.d.ts +7 -0
- package/dist/components/MathContainer/FactorTable/index.d.ts.map +1 -0
- package/dist/components/MathContainer/LongDivision/LongDivision.d.ts +12 -0
- package/dist/components/MathContainer/LongDivision/LongDivision.d.ts.map +1 -0
- package/dist/components/MathContainer/LongDivision/LongDivision.layout.d.ts +81 -0
- package/dist/components/MathContainer/LongDivision/LongDivision.layout.d.ts.map +1 -0
- package/dist/components/MathContainer/LongDivision/LongDivision.types.d.ts +37 -0
- package/dist/components/MathContainer/LongDivision/LongDivision.types.d.ts.map +1 -0
- package/dist/components/MathContainer/LongDivision/LongDivisionView.d.ts +37 -0
- package/dist/components/MathContainer/LongDivision/LongDivisionView.d.ts.map +1 -0
- package/dist/components/MathContainer/LongDivision/index.d.ts +7 -0
- package/dist/components/MathContainer/LongDivision/index.d.ts.map +1 -0
- package/dist/components/MathContainer/MathContainer.types.d.ts +151 -0
- package/dist/components/MathContainer/MathContainer.types.d.ts.map +1 -0
- package/dist/components/MathContainer/ShortDivision/ShortDivision.d.ts +15 -0
- package/dist/components/MathContainer/ShortDivision/ShortDivision.d.ts.map +1 -0
- package/dist/components/MathContainer/ShortDivision/ShortDivision.types.d.ts +67 -0
- package/dist/components/MathContainer/ShortDivision/ShortDivision.types.d.ts.map +1 -0
- package/dist/components/MathContainer/ShortDivision/ShortDivisionView.d.ts +16 -0
- package/dist/components/MathContainer/ShortDivision/ShortDivisionView.d.ts.map +1 -0
- package/dist/components/MathContainer/ShortDivision/index.d.ts +8 -0
- package/dist/components/MathContainer/ShortDivision/index.d.ts.map +1 -0
- package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplication.d.ts +16 -0
- package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplication.d.ts.map +1 -0
- package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplication.types.d.ts +42 -0
- package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplication.types.d.ts.map +1 -0
- package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplicationView.d.ts +22 -0
- package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplicationView.d.ts.map +1 -0
- package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplicationView.utils.d.ts +19 -0
- package/dist/components/MathContainer/VerticalMultiplication/VerticalMultiplicationView.utils.d.ts.map +1 -0
- package/dist/components/MathContainer/VerticalMultiplication/index.d.ts +9 -0
- package/dist/components/MathContainer/VerticalMultiplication/index.d.ts.map +1 -0
- package/dist/components/MathContainer/hooks/index.d.ts +15 -0
- package/dist/components/MathContainer/hooks/index.d.ts.map +1 -0
- package/dist/components/MathContainer/hooks/useFactorTable.d.ts +39 -0
- package/dist/components/MathContainer/hooks/useFactorTable.d.ts.map +1 -0
- package/dist/components/MathContainer/hooks/useLongDivision.d.ts +51 -0
- package/dist/components/MathContainer/hooks/useLongDivision.d.ts.map +1 -0
- package/dist/components/MathContainer/hooks/useLongDivision.utils.d.ts +15 -0
- package/dist/components/MathContainer/hooks/useLongDivision.utils.d.ts.map +1 -0
- package/dist/components/MathContainer/hooks/useShortDivision.d.ts +41 -0
- package/dist/components/MathContainer/hooks/useShortDivision.d.ts.map +1 -0
- package/dist/components/MathContainer/hooks/useVerticalMultiplication.d.ts +28 -0
- package/dist/components/MathContainer/hooks/useVerticalMultiplication.d.ts.map +1 -0
- package/dist/components/MathContainer/hooks/useVerticalMultiplication.utils.d.ts +30 -0
- package/dist/components/MathContainer/hooks/useVerticalMultiplication.utils.d.ts.map +1 -0
- package/dist/components/MathContainer/index.d.ts +17 -0
- package/dist/components/MathContainer/index.d.ts.map +1 -0
- package/dist/components/dashboard/atoms/Badge/Badge.d.ts +32 -0
- package/dist/components/dashboard/atoms/Badge/Badge.d.ts.map +1 -0
- package/dist/components/dashboard/atoms/Badge/index.d.ts +4 -0
- package/dist/components/dashboard/atoms/Badge/index.d.ts.map +1 -0
- package/dist/index.cjs +129 -101
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +6214 -4315
- package/dist/index.mjs.map +1 -1
- package/dist/mathwiz-ui.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Copilot 组件样式
|
|
3
|
+
* 组件前缀: mathwiz-
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* ============================================
|
|
7
|
+
主容器
|
|
8
|
+
============================================ */
|
|
9
|
+
|
|
10
|
+
.mathwiz-copilot {
|
|
11
|
+
--copilot-header-height: 64px;
|
|
12
|
+
--copilot-input-height: auto;
|
|
13
|
+
--copilot-context-bar-height: auto;
|
|
14
|
+
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
height: 100%;
|
|
18
|
+
min-height: 400px;
|
|
19
|
+
background-color: var(--background);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* ============================================
|
|
23
|
+
Header
|
|
24
|
+
============================================ */
|
|
25
|
+
|
|
26
|
+
.mathwiz-copilot-header {
|
|
27
|
+
height: var(--copilot-header-height);
|
|
28
|
+
flex-shrink: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* ============================================
|
|
32
|
+
Context Bar
|
|
33
|
+
============================================ */
|
|
34
|
+
|
|
35
|
+
.mathwiz-context-bar {
|
|
36
|
+
flex-shrink: 0;
|
|
37
|
+
transition: all 0.2s ease;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.mathwiz-context-bar:hover {
|
|
41
|
+
box-shadow: var(--shadow-md);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* ============================================
|
|
45
|
+
Chat Container
|
|
46
|
+
============================================ */
|
|
47
|
+
|
|
48
|
+
.mathwiz-chat-container {
|
|
49
|
+
flex: 1;
|
|
50
|
+
overflow-y: auto;
|
|
51
|
+
scroll-behavior: smooth;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* ============================================
|
|
55
|
+
Empty State
|
|
56
|
+
============================================ */
|
|
57
|
+
|
|
58
|
+
.mathwiz-empty-state {
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
height: 100%;
|
|
64
|
+
padding: 2rem;
|
|
65
|
+
text-align: center;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* ============================================
|
|
69
|
+
Chat Message
|
|
70
|
+
============================================ */
|
|
71
|
+
|
|
72
|
+
.mathwiz-chat-message {
|
|
73
|
+
display: flex;
|
|
74
|
+
gap: 0.75rem;
|
|
75
|
+
padding: 1rem;
|
|
76
|
+
transition: background-color 0.2s ease;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.mathwiz-chat-message:hover {
|
|
80
|
+
background-color: var(--default-50);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.mathwiz-chat-message--user {
|
|
84
|
+
flex-direction: row-reverse;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.mathwiz-chat-message--assistant {
|
|
88
|
+
flex-direction: row;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.mathwiz-chat-bubble--user {
|
|
92
|
+
background-color: var(--primary-100);
|
|
93
|
+
color: var(--primary-900);
|
|
94
|
+
border-radius: 1rem 1rem 0.25rem 1rem;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.mathwiz-chat-bubble--assistant {
|
|
98
|
+
background-color: var(--default-100);
|
|
99
|
+
color: var(--default-900);
|
|
100
|
+
border-radius: 1rem 1rem 1rem 0.25rem;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.mathwiz-chat-avatar {
|
|
104
|
+
flex-shrink: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.mathwiz-chat-image-preview {
|
|
108
|
+
width: 5rem;
|
|
109
|
+
height: 5rem;
|
|
110
|
+
border-radius: 0.5rem;
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
border: 1px solid var(--default-200);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.mathwiz-chat-image-preview img {
|
|
116
|
+
width: 100%;
|
|
117
|
+
height: 100%;
|
|
118
|
+
object-fit: cover;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* ============================================
|
|
122
|
+
Stream Message
|
|
123
|
+
============================================ */
|
|
124
|
+
|
|
125
|
+
.mathwiz-stream-message {
|
|
126
|
+
display: flex;
|
|
127
|
+
gap: 0.75rem;
|
|
128
|
+
padding: 1rem;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.mathwiz-typing-indicator {
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
gap: 0.25rem;
|
|
135
|
+
padding: 0.5rem 1rem;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.mathwiz-typing-indicator span {
|
|
139
|
+
width: 0.5rem;
|
|
140
|
+
height: 0.5rem;
|
|
141
|
+
border-radius: 50%;
|
|
142
|
+
background-color: var(--default-400);
|
|
143
|
+
animation: bounce 1s infinite;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.mathwiz-typing-indicator span:nth-child(2) {
|
|
147
|
+
animation-delay: 0.15s;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.mathwiz-typing-indicator span:nth-child(3) {
|
|
151
|
+
animation-delay: 0.3s;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@keyframes bounce {
|
|
155
|
+
0%,
|
|
156
|
+
80%,
|
|
157
|
+
100% {
|
|
158
|
+
transform: translateY(0);
|
|
159
|
+
}
|
|
160
|
+
40% {
|
|
161
|
+
transform: translateY(-0.25rem);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* ============================================
|
|
166
|
+
Chat Input
|
|
167
|
+
============================================ */
|
|
168
|
+
|
|
169
|
+
.mathwiz-chat-input {
|
|
170
|
+
flex-shrink: 0;
|
|
171
|
+
border-top: 1px solid var(--default-200);
|
|
172
|
+
background-color: var(--background);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.mathwiz-pending-image {
|
|
176
|
+
position: relative;
|
|
177
|
+
flex-shrink: 0;
|
|
178
|
+
width: 4rem;
|
|
179
|
+
height: 4rem;
|
|
180
|
+
border-radius: 0.5rem;
|
|
181
|
+
overflow: hidden;
|
|
182
|
+
border: 1px solid var(--default-200);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.mathwiz-pending-image img {
|
|
186
|
+
width: 100%;
|
|
187
|
+
height: 100%;
|
|
188
|
+
object-fit: cover;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.mathwiz-pending-image button {
|
|
192
|
+
position: absolute;
|
|
193
|
+
top: 0.125rem;
|
|
194
|
+
right: 0.125rem;
|
|
195
|
+
padding: 0.125rem;
|
|
196
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
197
|
+
border-radius: 50%;
|
|
198
|
+
color: white;
|
|
199
|
+
transition: background-color 0.2s ease;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.mathwiz-pending-image button:hover {
|
|
203
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* ============================================
|
|
207
|
+
Quick Actions
|
|
208
|
+
============================================ */
|
|
209
|
+
|
|
210
|
+
.mathwiz-quick-actions {
|
|
211
|
+
flex-shrink: 0;
|
|
212
|
+
width: 100%;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.mathwiz-quick-action-btn {
|
|
216
|
+
flex-shrink: 0;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/* ============================================
|
|
220
|
+
Responsive
|
|
221
|
+
============================================ */
|
|
222
|
+
|
|
223
|
+
@media (max-width: 640px) {
|
|
224
|
+
.mathwiz-chat-message {
|
|
225
|
+
padding: 0.75rem;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.mathwiz-chat-bubble--user,
|
|
229
|
+
.mathwiz-chat-bubble--assistant {
|
|
230
|
+
max-width: 90%;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.mathwiz-chat-image-preview {
|
|
234
|
+
width: 4rem;
|
|
235
|
+
height: 4rem;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AICopilotProps } from './types';
|
|
3
|
+
import './AICopilot.css';
|
|
4
|
+
/**
|
|
5
|
+
* AICopilot 主组件
|
|
6
|
+
* AI 数学助手容器组件,整合所有子组件
|
|
7
|
+
*/
|
|
8
|
+
export declare const AICopilot: React.FC<AICopilotProps>;
|
|
9
|
+
export default AICopilot;
|
|
10
|
+
//# sourceMappingURL=AICopilot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AICopilot.d.ts","sourceRoot":"","sources":["../../../src/components/AICopilot/AICopilot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAG3C,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,SAAS,CAAC;AAY3D,OAAO,iBAAiB,CAAC;AA4DzB;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAiG7C,CAAC;AAIH,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ChatContainerProps } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* ChatContainer 组件
|
|
5
|
+
* 消息列表容器,管理消息渲染和空状态
|
|
6
|
+
*/
|
|
7
|
+
export declare const ChatContainer: React.FC<ChatContainerProps>;
|
|
8
|
+
export default ChatContainer;
|
|
9
|
+
//# sourceMappingURL=ChatContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/AICopilot/components/ChatContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAgCnD;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA2DrD,CAAC;AAIH,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ChatInputProps } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* ChatInput 组件
|
|
5
|
+
* 聊天输入框组合,包含图片上传、文本输入、发送/停止按钮
|
|
6
|
+
*/
|
|
7
|
+
export declare const ChatInput: React.FC<ChatInputProps>;
|
|
8
|
+
export default ChatInput;
|
|
9
|
+
//# sourceMappingURL=ChatInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatInput.d.ts","sourceRoot":"","sources":["../../../../src/components/AICopilot/components/ChatInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAYnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAyK7C,CAAC;AAIH,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ChatMessageComponentProps } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* ChatMessage 组件
|
|
5
|
+
* 渲染单条聊天消息,支持用户消息和AI助手消息
|
|
6
|
+
*/
|
|
7
|
+
export declare const ChatMessage: React.FC<ChatMessageComponentProps>;
|
|
8
|
+
export default ChatMessage;
|
|
9
|
+
//# sourceMappingURL=ChatMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/AICopilot/components/ChatMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAkB1D;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAmG1D,CAAC;AAIH,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CollapsibleContextBarProps } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* CollapsibleContextBar 组件
|
|
5
|
+
* 可折叠的题目上下文信息条
|
|
6
|
+
*/
|
|
7
|
+
export declare const CollapsibleContextBar: React.FC<CollapsibleContextBarProps>;
|
|
8
|
+
export default CollapsibleContextBar;
|
|
9
|
+
//# sourceMappingURL=CollapsibleContextBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CollapsibleContextBar.d.ts","sourceRoot":"","sources":["../../../../src/components/AICopilot/components/CollapsibleContextBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAe1B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AA0B3D;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAmFrE,CAAC;AAIH,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { QuickActionsProps } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* QuickActions 组件
|
|
5
|
+
* 快捷操作按钮组,横向滚动布局
|
|
6
|
+
*/
|
|
7
|
+
export declare const QuickActions: React.FC<QuickActionsProps>;
|
|
8
|
+
export default QuickActions;
|
|
9
|
+
//# sourceMappingURL=QuickActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QuickActions.d.ts","sourceRoot":"","sources":["../../../../src/components/AICopilot/components/QuickActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,iBAAiB,EAAe,MAAM,UAAU,CAAC;AAsB/D;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAmCnD,CAAC;AAIH,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { StreamMessageProps } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* StreamMessage 组件
|
|
5
|
+
* 渲染AI流式输出消息,包含打字指示器和流式内容
|
|
6
|
+
*/
|
|
7
|
+
export declare const StreamMessage: React.FC<StreamMessageProps>;
|
|
8
|
+
export default StreamMessage;
|
|
9
|
+
//# sourceMappingURL=StreamMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StreamMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/AICopilot/components/StreamMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AA0BnD;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAoDrD,CAAC;AAIH,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { AICopilot } from './AICopilot';
|
|
2
|
+
export { default } from './AICopilot';
|
|
3
|
+
export { ChatMessage as ChatMessageComponent } from './components/ChatMessage';
|
|
4
|
+
export { StreamMessage } from './components/StreamMessage';
|
|
5
|
+
export { ChatInput } from './components/ChatInput';
|
|
6
|
+
export { QuickActions } from './components/QuickActions';
|
|
7
|
+
export { ChatContainer } from './components/ChatContainer';
|
|
8
|
+
export { CollapsibleContextBar } from './components/CollapsibleContextBar';
|
|
9
|
+
export { createAICopilotStore, useAICopilotStore, useInputState, useImageState, usePanelState, useAbortController, } from './store';
|
|
10
|
+
export type { MessageRole, IntentType, ImageStatus, UploadedImage, KnowledgePoint, ChatMessage, ProblemContext, QuickAction, AICopilotProps, ChatMessageComponentProps, StreamMessageProps, ChatInputProps, QuickActionsProps, ChatContainerProps, CollapsibleContextBarProps, AICopilotState, AICopilotActions, AICopilotStore, } from './types';
|
|
11
|
+
export { MessageRole as MessageRoleConst, IntentType as IntentTypeConst, ImageStatus as ImageStatusConst, DEFAULT_WELCOME_MESSAGE, DEFAULT_PLACEHOLDER, DEFAULT_MAX_IMAGES, DEFAULT_QUICK_ACTIONS, } from './types';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AICopilot/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAG3E,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,aAAa,EACb,kBAAkB,GACnB,MAAM,SAAS,CAAC;AAGjB,YAAY,EAEV,WAAW,EACX,UAAU,EACV,WAAW,EACX,aAAa,EACb,cAAc,EACd,WAAW,EACX,cAAc,EACd,WAAW,EAEX,cAAc,EACd,yBAAyB,EACzB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,EAE1B,cAAc,EACd,gBAAgB,EAChB,cAAc,GACf,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,WAAW,IAAI,gBAAgB,EAC/B,UAAU,IAAI,eAAe,EAC7B,WAAW,IAAI,gBAAgB,EAC/B,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AICopilotStore } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* 创建 AI Copilot Store 的工厂函数
|
|
4
|
+
* 每个调用返回独立的 store 实例,支持 Storybook 多故事状态隔离
|
|
5
|
+
*/
|
|
6
|
+
export declare const createAICopilotStore: () => import("zustand").UseBoundStore<import("zustand").StoreApi<AICopilotStore>>;
|
|
7
|
+
/**
|
|
8
|
+
* 全局 AI Copilot Store 单例
|
|
9
|
+
* 用于向后兼容和简单场景
|
|
10
|
+
* 注意:在 Storybook 环境中,所有故事共享此全局 store 实例
|
|
11
|
+
*/
|
|
12
|
+
export declare const useAICopilotStore: import("zustand").UseBoundStore<import("zustand").StoreApi<AICopilotStore>>;
|
|
13
|
+
/**
|
|
14
|
+
* 自定义 Hook - 获取输入相关状态和操作
|
|
15
|
+
* 使用 useShallow 优化性能
|
|
16
|
+
*/
|
|
17
|
+
export declare const useInputState: () => Pick<AICopilotStore, "inputValue" | "setInputValue" | "isInputFocused" | "setInputFocused" | "clearInput">;
|
|
18
|
+
/**
|
|
19
|
+
* 自定义 Hook - 获取图片相关状态和操作
|
|
20
|
+
*/
|
|
21
|
+
export declare const useImageState: () => Pick<AICopilotStore, "pendingImages" | "addPendingImage" | "removePendingImage" | "clearPendingImages" | "updateImageStatus">;
|
|
22
|
+
/**
|
|
23
|
+
* 自定义 Hook - 获取面板相关状态和操作
|
|
24
|
+
*/
|
|
25
|
+
export declare const usePanelState: () => Pick<AICopilotStore, "isContextBarCollapsed" | "isHistoryOpen" | "toggleContextBar" | "collapseContextBar" | "expandContextBar" | "setHistoryOpen" | "toggleHistory">;
|
|
26
|
+
/**
|
|
27
|
+
* 自定义 Hook - 获取 AbortController
|
|
28
|
+
*/
|
|
29
|
+
export declare const useAbortController: () => Pick<AICopilotStore, "abortController" | "setAbortController">;
|
|
30
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/components/AICopilot/store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EAKf,MAAM,SAAS,CAAC;AAcjB;;;GAGG;AACH,eAAO,MAAM,oBAAoB,mFAgFhC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,6EAAyB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,aAAa,kHAYzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,qIAYzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,6KAczB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,sEAS9B,CAAC"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Copilot 组件类型定义
|
|
3
|
+
* 遵循设计规范: docs/specs/design/ai-copilot/design-spec.md
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 消息角色类型
|
|
7
|
+
*/
|
|
8
|
+
export declare const MessageRole: {
|
|
9
|
+
readonly USER: "user";
|
|
10
|
+
readonly ASSISTANT: "assistant";
|
|
11
|
+
readonly SYSTEM: "system";
|
|
12
|
+
};
|
|
13
|
+
export type MessageRole = typeof MessageRole[keyof typeof MessageRole];
|
|
14
|
+
/**
|
|
15
|
+
* 意图类型
|
|
16
|
+
*/
|
|
17
|
+
export declare const IntentType: {
|
|
18
|
+
readonly HINT: "hint";
|
|
19
|
+
readonly EXPLANATION: "explanation";
|
|
20
|
+
readonly SOLUTION: "solution";
|
|
21
|
+
readonly FOLLOW_UP: "follow_up";
|
|
22
|
+
readonly GENERAL: "general";
|
|
23
|
+
};
|
|
24
|
+
export type IntentType = typeof IntentType[keyof typeof IntentType];
|
|
25
|
+
/**
|
|
26
|
+
* 图片上传状态
|
|
27
|
+
*/
|
|
28
|
+
export declare const ImageStatus: {
|
|
29
|
+
readonly PENDING: "pending";
|
|
30
|
+
readonly UPLOADING: "uploading";
|
|
31
|
+
readonly SUCCESS: "success";
|
|
32
|
+
readonly ERROR: "error";
|
|
33
|
+
};
|
|
34
|
+
export type ImageStatus = typeof ImageStatus[keyof typeof ImageStatus];
|
|
35
|
+
/**
|
|
36
|
+
* 上传图片信息
|
|
37
|
+
*/
|
|
38
|
+
export interface UploadedImage {
|
|
39
|
+
id: string;
|
|
40
|
+
url: string;
|
|
41
|
+
file?: File;
|
|
42
|
+
status: ImageStatus;
|
|
43
|
+
errorMessage?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 知识点
|
|
47
|
+
*/
|
|
48
|
+
export interface KnowledgePoint {
|
|
49
|
+
id: string;
|
|
50
|
+
name: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 聊天消息
|
|
54
|
+
*/
|
|
55
|
+
export interface ChatMessage {
|
|
56
|
+
messageId: string;
|
|
57
|
+
role: MessageRole;
|
|
58
|
+
content: string;
|
|
59
|
+
timestamp: string;
|
|
60
|
+
intentType?: IntentType;
|
|
61
|
+
referencedProblemId?: string;
|
|
62
|
+
referencedProblemTitle?: string;
|
|
63
|
+
isStreaming?: boolean;
|
|
64
|
+
images?: UploadedImage[];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 题目上下文
|
|
68
|
+
*/
|
|
69
|
+
export interface ProblemContext {
|
|
70
|
+
problemId: string;
|
|
71
|
+
title: string;
|
|
72
|
+
difficulty: number;
|
|
73
|
+
knowledgePoints: KnowledgePoint[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* 快捷操作
|
|
77
|
+
*/
|
|
78
|
+
export interface QuickAction {
|
|
79
|
+
id: string;
|
|
80
|
+
label: string;
|
|
81
|
+
message: string;
|
|
82
|
+
icon?: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* AI Copilot 主组件 Props
|
|
86
|
+
*/
|
|
87
|
+
export interface AICopilotProps {
|
|
88
|
+
messages: ChatMessage[];
|
|
89
|
+
problemContext?: ProblemContext;
|
|
90
|
+
sessionId?: string | null;
|
|
91
|
+
isStreaming?: boolean;
|
|
92
|
+
streamingContent?: string;
|
|
93
|
+
onSendMessage: (message: string, options?: {
|
|
94
|
+
problemId?: string;
|
|
95
|
+
images?: UploadedImage[];
|
|
96
|
+
}) => void;
|
|
97
|
+
onAbortStreaming?: () => void;
|
|
98
|
+
onLoadHistory?: () => void;
|
|
99
|
+
onNewSession?: () => void;
|
|
100
|
+
onChangeProblem?: () => void;
|
|
101
|
+
onImageUpload?: (file: File) => Promise<UploadedImage>;
|
|
102
|
+
quickActions?: QuickAction[];
|
|
103
|
+
welcomeMessage?: string;
|
|
104
|
+
placeholder?: string;
|
|
105
|
+
maxImages?: number;
|
|
106
|
+
className?: string;
|
|
107
|
+
theme?: 'light' | 'dark';
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* ChatMessage 组件 Props
|
|
111
|
+
*/
|
|
112
|
+
export interface ChatMessageComponentProps {
|
|
113
|
+
message: ChatMessage;
|
|
114
|
+
showProblemTag?: boolean;
|
|
115
|
+
className?: string;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* StreamMessage 组件 Props
|
|
119
|
+
*/
|
|
120
|
+
export interface StreamMessageProps {
|
|
121
|
+
content: string;
|
|
122
|
+
className?: string;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* ChatInput 组件 Props
|
|
126
|
+
*/
|
|
127
|
+
export interface ChatInputProps {
|
|
128
|
+
value: string;
|
|
129
|
+
onChange: (value: string) => void;
|
|
130
|
+
onSend: () => void;
|
|
131
|
+
onAbort?: () => void;
|
|
132
|
+
isStreaming?: boolean;
|
|
133
|
+
pendingImages: UploadedImage[];
|
|
134
|
+
onImageAdd: (image: UploadedImage) => void;
|
|
135
|
+
onImageRemove: (imageId: string) => void;
|
|
136
|
+
onImageUpload?: (file: File) => Promise<UploadedImage>;
|
|
137
|
+
placeholder?: string;
|
|
138
|
+
maxImages?: number;
|
|
139
|
+
disabled?: boolean;
|
|
140
|
+
className?: string;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* QuickActions 组件 Props
|
|
144
|
+
*/
|
|
145
|
+
export interface QuickActionsProps {
|
|
146
|
+
actions: QuickAction[];
|
|
147
|
+
onActionClick: (action: QuickAction) => void;
|
|
148
|
+
className?: string;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* ChatContainer 组件 Props
|
|
152
|
+
*/
|
|
153
|
+
export interface ChatContainerProps {
|
|
154
|
+
messages: ChatMessage[];
|
|
155
|
+
isStreaming?: boolean;
|
|
156
|
+
streamingContent?: string;
|
|
157
|
+
welcomeMessage?: string;
|
|
158
|
+
className?: string;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* CollapsibleContextBar 组件 Props
|
|
162
|
+
*/
|
|
163
|
+
export interface CollapsibleContextBarProps {
|
|
164
|
+
problemContext: ProblemContext;
|
|
165
|
+
isCollapsed: boolean;
|
|
166
|
+
onToggle: () => void;
|
|
167
|
+
onChangeProblem?: () => void;
|
|
168
|
+
className?: string;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* AI Copilot UI 状态
|
|
172
|
+
*/
|
|
173
|
+
export interface AICopilotState {
|
|
174
|
+
inputValue: string;
|
|
175
|
+
isInputFocused: boolean;
|
|
176
|
+
pendingImages: UploadedImage[];
|
|
177
|
+
isContextBarCollapsed: boolean;
|
|
178
|
+
isHistoryOpen: boolean;
|
|
179
|
+
abortController: AbortController | null;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* AI Copilot UI 操作
|
|
183
|
+
*/
|
|
184
|
+
export interface AICopilotActions {
|
|
185
|
+
setInputValue: (value: string) => void;
|
|
186
|
+
setInputFocused: (focused: boolean) => void;
|
|
187
|
+
clearInput: () => void;
|
|
188
|
+
addPendingImage: (image: UploadedImage) => void;
|
|
189
|
+
removePendingImage: (imageId: string) => void;
|
|
190
|
+
clearPendingImages: () => void;
|
|
191
|
+
updateImageStatus: (imageId: string, status: ImageStatus) => void;
|
|
192
|
+
toggleContextBar: () => void;
|
|
193
|
+
collapseContextBar: () => void;
|
|
194
|
+
expandContextBar: () => void;
|
|
195
|
+
setHistoryOpen: (open: boolean) => void;
|
|
196
|
+
toggleHistory: () => void;
|
|
197
|
+
setAbortController: (controller: AbortController | null) => void;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* 完整的 Store 类型
|
|
201
|
+
*/
|
|
202
|
+
export type AICopilotStore = AICopilotState & AICopilotActions;
|
|
203
|
+
/**
|
|
204
|
+
* 默认欢迎消息
|
|
205
|
+
*/
|
|
206
|
+
export declare const DEFAULT_WELCOME_MESSAGE = "\u4F60\u597D\uFF01\u6211\u662F\u4F60\u7684\u6570\u5B66\u5B66\u4E60\u52A9\u624B\u3002\u4F60\u53EF\u4EE5\u95EE\u6211\u4EFB\u4F55\u6570\u5B66\u95EE\u9898\uFF0C\u6216\u8005\u4E0A\u4F20\u9898\u76EE\u56FE\u7247\u8BA9\u6211\u5E2E\u4F60\u89E3\u7B54\u3002";
|
|
207
|
+
/**
|
|
208
|
+
* 默认输入框占位符
|
|
209
|
+
*/
|
|
210
|
+
export declare const DEFAULT_PLACEHOLDER = "\u8F93\u5165\u6D88\u606F...";
|
|
211
|
+
/**
|
|
212
|
+
* 默认最大图片数量
|
|
213
|
+
*/
|
|
214
|
+
export declare const DEFAULT_MAX_IMAGES = 4;
|
|
215
|
+
/**
|
|
216
|
+
* 默认快捷操作
|
|
217
|
+
*/
|
|
218
|
+
export declare const DEFAULT_QUICK_ACTIONS: QuickAction[];
|
|
219
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/AICopilot/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;GAEG;AACH,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,UAAU;;;;;;CAMb,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;CAKd,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,C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zC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAE/B,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,UAAU,EAAE,MAAM,IAAI,CAAC;IAGvB,eAAe,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAChD,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAGlE,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,cAAc,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,aAAa,EAAE,MAAM,IAAI,CAAC;IAG1B,kBAAkB,EAAE,CAAC,UAAU,EAAE,eAAe,GAAG,IAAI,KAAK,IAAI,CAAC;CAClE;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,gBAAgB,CAAC;AAM/D;;GAEG;AACH,eAAO,MAAM,uBAAuB,2PAA8C,CAAC;AAEnF;;GAEG;AACH,eAAO,MAAM,mBAAmB,gCAAY,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,WAAW,EAK9C,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export type ContentType = 'text' | 'formula' | 'image' | 'graph' | 'interactive' | 'hundredGrid' | 'placeValueChart' | 'geometryTransform' | 'optionGroup';
|
|
1
|
+
export type ContentType = 'text' | 'formula' | 'image' | 'graph' | 'interactive' | 'hundredGrid' | 'placeValueChart' | 'geometryTransform' | 'optionGroup' | 'mathContainer';
|
|
2
|
+
/** MathContainer 容器类型 */
|
|
3
|
+
export type ContainerType = 'factorTable' | 'shortDivision' | 'verticalMultiplication' | 'longDivision';
|
|
2
4
|
export type LayoutType = 'card' | 'grid' | 'flow' | 'custom';
|
|
3
5
|
export type RenderMode = 'default' | 'list' | 'template';
|
|
4
6
|
export type MathCardV2Scene = 'question' | 'solve' | 'review';
|
|
@@ -384,4 +386,21 @@ export interface OptionGroupContentProps {
|
|
|
384
386
|
disabled?: boolean;
|
|
385
387
|
className?: string;
|
|
386
388
|
}
|
|
389
|
+
import type { ContainerConfig, ContainerAnswers } from '@/components/MathContainer/MathContainer.types';
|
|
390
|
+
/**
|
|
391
|
+
* MathContainer 内容块
|
|
392
|
+
*/
|
|
393
|
+
export interface MathContainerContentBlock extends ContentBlock {
|
|
394
|
+
type: 'mathContainer';
|
|
395
|
+
containerType: ContainerType;
|
|
396
|
+
config: ContainerConfig;
|
|
397
|
+
onAnswerChange?: (answers: ContainerAnswers) => void;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* MathContainerContent 内容组件 Props
|
|
401
|
+
*/
|
|
402
|
+
export interface MathContainerContentProps {
|
|
403
|
+
block: MathContainerContentBlock;
|
|
404
|
+
onInteraction?: (interaction: any) => void;
|
|
405
|
+
}
|
|
387
406
|
//# sourceMappingURL=MathCardV2.types.d.ts.map
|