texteditorrefactor 0.0.12 → 0.0.13
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/Molecules/PerformanceScreen/PreformanceResultScreenSkeleton.d.ts +6 -0
- package/dist/components/Molecules/PerformanceScreen/PreformanceResultScreenSkeleton.js +12 -0
- package/dist/components/Molecules/PerformanceScreen/PreformanceResultScreenSkeleton.js.map +1 -0
- package/dist/components/Molecules/RecapNode/ContentView.js +2 -2
- package/dist/components/Molecules/RecapNode/ContentView.js.map +1 -1
- package/dist/components/Molecules/RecapNode/SectionView.js +70 -10
- package/dist/components/Molecules/RecapNode/SectionView.js.map +1 -1
- package/dist/components/Molecules/RecapNode/VideoView.d.ts +6 -1
- package/dist/components/Molecules/RecapNode/VideoView.js +47 -6
- package/dist/components/Molecules/RecapNode/VideoView.js.map +1 -1
- package/dist/components/Organisms/FlashCardNode/FlashCardNode.js +46 -3
- package/dist/components/Organisms/FlashCardNode/FlashCardNode.js.map +1 -1
- package/dist/components/Organisms/FlashCardNode/FlashcardContainer.d.ts +2 -1
- package/dist/components/Organisms/FlashCardNode/FlashcardContainer.js +6 -30
- package/dist/components/Organisms/FlashCardNode/FlashcardContainer.js.map +1 -1
- package/dist/components/Organisms/FlashCardNode/IconBar.d.ts +3 -1
- package/dist/components/Organisms/FlashCardNode/IconBar.js +3 -3
- package/dist/components/Organisms/FlashCardNode/IconBar.js.map +1 -1
- package/dist/components/Organisms/FlashCardNode/MobileAccordionView.d.ts +2 -1
- package/dist/components/Organisms/FlashCardNode/MobileAccordionView.js +12 -107
- package/dist/components/Organisms/FlashCardNode/MobileAccordionView.js.map +1 -1
- package/dist/components/Organisms/RecapGraph/Example.stories.js +22 -8
- package/dist/components/Organisms/RecapGraph/Example.stories.js.map +1 -1
- package/dist/components/Organisms/RecapGraph/Reactgraphflow.d.ts +3 -2
- package/dist/components/Organisms/RecapGraph/Reactgraphflow.js +54 -214
- package/dist/components/Organisms/RecapGraph/Reactgraphflow.js.map +1 -1
- package/dist/components/Organisms/RecapGraph/useRecapGraphLogic.d.ts +29 -0
- package/dist/components/Organisms/RecapGraph/useRecapGraphLogic.js +357 -0
- package/dist/components/Organisms/RecapGraph/useRecapGraphLogic.js.map +1 -0
- package/dist/components/Organisms/StudentEditor/components/EditorComponent.d.ts +0 -1
- package/dist/components/Organisms/StudentEditor/components/EditorComponent.js +4 -32
- package/dist/components/Organisms/StudentEditor/components/EditorComponent.js.map +1 -1
- package/dist/components/Organisms/StudentEditor/components/TextEditor.js +28 -63
- package/dist/components/Organisms/StudentEditor/components/TextEditor.js.map +1 -1
- package/dist/utils/RecapData.d.ts +504 -33
- package/dist/utils/RecapData.js +1999 -538
- package/dist/utils/RecapData.js.map +1 -1
- package/dist/utils/contentUtils.js +12 -5
- package/dist/utils/contentUtils.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useRecapGraphLogic = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const contentUtils_1 = require("../../../utils/contentUtils");
|
|
6
|
+
const useRecapGraphLogic = (jsonData, contentMap, iconConfig) => {
|
|
7
|
+
const [expandedNodeId, setExpandedNodeId] = (0, react_1.useState)(null);
|
|
8
|
+
const [expandedNodeHeight, setExpandedNodeHeight] = (0, react_1.useState)(0);
|
|
9
|
+
const [activeExpandedNodeId, setActiveExpandedNodeId] = (0, react_1.useState)(null);
|
|
10
|
+
const [isTransitioning, setIsTransitioning] = (0, react_1.useState)(false);
|
|
11
|
+
const [expandedNodes, setExpandedNodes] = (0, react_1.useState)({});
|
|
12
|
+
const [contentExpanded, setContentExpanded] = (0, react_1.useState)({});
|
|
13
|
+
const [displayTypes, setDisplayTypes] = (0, react_1.useState)({});
|
|
14
|
+
const [videoIndices, setVideoIndices] = (0, react_1.useState)({});
|
|
15
|
+
// Build color map with consistent logic
|
|
16
|
+
const colorMap = (0, react_1.useMemo)(() => {
|
|
17
|
+
const map = {};
|
|
18
|
+
let level1ColorIndex = 0;
|
|
19
|
+
const buildColorMap = (nodeData, level = 0, parentColorKey = null) => {
|
|
20
|
+
if (!nodeData)
|
|
21
|
+
return;
|
|
22
|
+
let colorKey;
|
|
23
|
+
if (level === 0) {
|
|
24
|
+
colorKey = "root";
|
|
25
|
+
}
|
|
26
|
+
else if (level === 1) {
|
|
27
|
+
colorKey = String(level1ColorIndex % 8);
|
|
28
|
+
level1ColorIndex++;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
colorKey = parentColorKey;
|
|
32
|
+
}
|
|
33
|
+
map[nodeData._id] = { level, colorKey };
|
|
34
|
+
if (nodeData.children?.length) {
|
|
35
|
+
nodeData.children.forEach((child) => {
|
|
36
|
+
buildColorMap(child, level + 1, colorKey);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
if (jsonData)
|
|
41
|
+
buildColorMap(jsonData);
|
|
42
|
+
return map;
|
|
43
|
+
}, [jsonData]);
|
|
44
|
+
// Get colors for a node
|
|
45
|
+
const getNodeColors = (nodeId) => {
|
|
46
|
+
const colorInfo = colorMap[nodeId] || { level: 0, colorKey: "root" };
|
|
47
|
+
const headerColor = colorInfo.level === 0 ? contentUtils_1.COLOR_MAP.root : contentUtils_1.COLOR_MAP[colorInfo.colorKey];
|
|
48
|
+
const bgColor = colorInfo.level === 0
|
|
49
|
+
? contentUtils_1.LIGHT_COLOR_MAP.root
|
|
50
|
+
: contentUtils_1.LIGHT_COLOR_MAP[colorInfo.colorKey];
|
|
51
|
+
return { headerColor, bgColor, colorInfo };
|
|
52
|
+
};
|
|
53
|
+
// Check if node has content
|
|
54
|
+
const getNodeContent = (nodeId) => {
|
|
55
|
+
const nodeContent = contentMap[nodeId] || null;
|
|
56
|
+
const hasContent = nodeContent &&
|
|
57
|
+
((nodeContent.videos && nodeContent.videos.length > 0) ||
|
|
58
|
+
(nodeContent.recap && Object.keys(nodeContent.recap).length > 0));
|
|
59
|
+
return { nodeContent, hasContent };
|
|
60
|
+
};
|
|
61
|
+
// Build nodes for RecapGraph
|
|
62
|
+
const buildNodes = (data) => {
|
|
63
|
+
const nodes = [];
|
|
64
|
+
let level1ColorIndex = 0;
|
|
65
|
+
const processNode = (nodeData, lvl, parentColorKey = null) => {
|
|
66
|
+
let colorKey, nodeColor;
|
|
67
|
+
if (lvl === 0) {
|
|
68
|
+
colorKey = "root";
|
|
69
|
+
nodeColor = contentUtils_1.COLOR_MAP.root;
|
|
70
|
+
}
|
|
71
|
+
else if (lvl === 1) {
|
|
72
|
+
colorKey = String(level1ColorIndex % 8);
|
|
73
|
+
nodeColor = contentUtils_1.COLOR_MAP[colorKey];
|
|
74
|
+
level1ColorIndex++;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
colorKey = parentColorKey;
|
|
78
|
+
nodeColor = contentUtils_1.LIGHT_COLOR_MAP[colorKey];
|
|
79
|
+
}
|
|
80
|
+
const { hasContent } = getNodeContent(nodeData._id);
|
|
81
|
+
nodes.push({
|
|
82
|
+
id: nodeData._id,
|
|
83
|
+
type: "flashcard",
|
|
84
|
+
data: {
|
|
85
|
+
id: nodeData._id,
|
|
86
|
+
label: nodeData?.description,
|
|
87
|
+
color: nodeColor,
|
|
88
|
+
content: contentMap[nodeData._id] || null,
|
|
89
|
+
hasContent,
|
|
90
|
+
bgColor: contentUtils_1.LIGHT_COLOR_MAP[colorKey],
|
|
91
|
+
colorKey,
|
|
92
|
+
level: lvl,
|
|
93
|
+
hasMultipleChildren: nodeData.children?.length > 1,
|
|
94
|
+
icons: iconConfig,
|
|
95
|
+
onExpandChange: (nodeId, isExpanded, height) => {
|
|
96
|
+
setIsTransitioning(true);
|
|
97
|
+
if (isExpanded) {
|
|
98
|
+
setExpandedNodeId(nodeId);
|
|
99
|
+
setExpandedNodeHeight(height);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
setExpandedNodeId(null);
|
|
103
|
+
setExpandedNodeHeight(0);
|
|
104
|
+
}
|
|
105
|
+
const timer = setTimeout(() => {
|
|
106
|
+
setIsTransitioning(false);
|
|
107
|
+
}, 350);
|
|
108
|
+
return () => clearTimeout(timer);
|
|
109
|
+
},
|
|
110
|
+
onNodeExpand: (nodeId) => {
|
|
111
|
+
setIsTransitioning(true);
|
|
112
|
+
setActiveExpandedNodeId(nodeId);
|
|
113
|
+
},
|
|
114
|
+
shouldClose: activeExpandedNodeId !== null &&
|
|
115
|
+
activeExpandedNodeId !== nodeData._id,
|
|
116
|
+
},
|
|
117
|
+
position: { x: 0, y: 0 },
|
|
118
|
+
draggable: false,
|
|
119
|
+
style: {
|
|
120
|
+
zIndex: 1,
|
|
121
|
+
transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
nodeData.children?.forEach((child) => processNode(child, lvl + 1, colorKey));
|
|
125
|
+
};
|
|
126
|
+
if (data)
|
|
127
|
+
processNode(data, 0);
|
|
128
|
+
return nodes;
|
|
129
|
+
};
|
|
130
|
+
// Build edges for RecapGraph
|
|
131
|
+
const buildEdges = (data, nodes) => {
|
|
132
|
+
const edges = [];
|
|
133
|
+
const nodeColorMap = {};
|
|
134
|
+
nodes.forEach((n) => {
|
|
135
|
+
nodeColorMap[n.id] = n.data.color;
|
|
136
|
+
});
|
|
137
|
+
const processNode = (nodeData, parentLevel = 0) => {
|
|
138
|
+
const hasMultipleChildren = (nodeData.children?.length || 0) > 1;
|
|
139
|
+
nodeData.children?.forEach((child) => {
|
|
140
|
+
const sourceColor = nodeColorMap[nodeData._id] || "#94a3b8";
|
|
141
|
+
let sourceHandle = "bottom";
|
|
142
|
+
let targetHandle = "top";
|
|
143
|
+
if (parentLevel >= 1 && hasMultipleChildren) {
|
|
144
|
+
targetHandle = "left";
|
|
145
|
+
}
|
|
146
|
+
else if (parentLevel >= 1) {
|
|
147
|
+
targetHandle = "top";
|
|
148
|
+
}
|
|
149
|
+
edges.push({
|
|
150
|
+
id: `${nodeData._id}-${child._id}`,
|
|
151
|
+
source: nodeData._id,
|
|
152
|
+
target: child._id,
|
|
153
|
+
sourceHandle,
|
|
154
|
+
targetHandle,
|
|
155
|
+
type: "bezier",
|
|
156
|
+
style: { stroke: sourceColor, strokeWidth: 2 },
|
|
157
|
+
markerEnd: {
|
|
158
|
+
type: "arrowclosed",
|
|
159
|
+
color: sourceColor,
|
|
160
|
+
width: 10,
|
|
161
|
+
height: 10,
|
|
162
|
+
},
|
|
163
|
+
});
|
|
164
|
+
processNode(child, parentLevel + 1);
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
if (data)
|
|
168
|
+
processNode(data, 0);
|
|
169
|
+
return edges;
|
|
170
|
+
};
|
|
171
|
+
// Compute layout for RecapGraph
|
|
172
|
+
const computeCustomLayout = (inputNodes, inputEdges) => {
|
|
173
|
+
if (!inputNodes.length || !jsonData)
|
|
174
|
+
return { nodes: [], edges: [] };
|
|
175
|
+
const NODE_WIDTH = 390;
|
|
176
|
+
const NODE_HEIGHT = 80;
|
|
177
|
+
const HORIZONTAL_SPACING = 240;
|
|
178
|
+
const VERTICAL_SPACING = 120;
|
|
179
|
+
const VERTICAL_STACK_SPACING = 30;
|
|
180
|
+
const HORIZONTAL_OFFSET = 225;
|
|
181
|
+
const positions = {};
|
|
182
|
+
const childrenMap = {};
|
|
183
|
+
const levelMap = {};
|
|
184
|
+
const nodeHeights = {};
|
|
185
|
+
inputNodes.forEach((n) => {
|
|
186
|
+
if (n.id === expandedNodeId) {
|
|
187
|
+
nodeHeights[n.id] = NODE_HEIGHT + expandedNodeHeight + 100;
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
nodeHeights[n.id] = NODE_HEIGHT;
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
const buildMaps = (node, level = 0, parentId = null) => {
|
|
194
|
+
levelMap[node._id] = level;
|
|
195
|
+
if (parentId) {
|
|
196
|
+
if (!childrenMap[parentId])
|
|
197
|
+
childrenMap[parentId] = [];
|
|
198
|
+
childrenMap[parentId].push(node._id);
|
|
199
|
+
}
|
|
200
|
+
if (node.children) {
|
|
201
|
+
node.children.forEach((child) => buildMaps(child, level + 1, node._id));
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
buildMaps(jsonData);
|
|
205
|
+
const subtreeWidths = {};
|
|
206
|
+
const subtreeHeights = {};
|
|
207
|
+
const calcSubtreeDimensions = (nodeId) => {
|
|
208
|
+
const children = childrenMap[nodeId] || [];
|
|
209
|
+
const level = levelMap[nodeId];
|
|
210
|
+
const currentNodeHeight = nodeHeights[nodeId];
|
|
211
|
+
if (children.length === 0) {
|
|
212
|
+
subtreeWidths[nodeId] = NODE_WIDTH;
|
|
213
|
+
subtreeHeights[nodeId] = currentNodeHeight;
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
const hasMultipleChildren = children.length > 1;
|
|
217
|
+
if (level >= 1 && hasMultipleChildren) {
|
|
218
|
+
children.forEach((childId) => calcSubtreeDimensions(childId));
|
|
219
|
+
const maxChildWidth = Math.max(...children.map((cid) => subtreeWidths[cid]));
|
|
220
|
+
const totalHeight = children.reduce((sum, cid) => sum + subtreeHeights[cid], 0);
|
|
221
|
+
const spacing = (children.length - 1) * VERTICAL_STACK_SPACING;
|
|
222
|
+
subtreeWidths[nodeId] = NODE_WIDTH + HORIZONTAL_OFFSET + maxChildWidth;
|
|
223
|
+
subtreeHeights[nodeId] = Math.max(currentNodeHeight, totalHeight + spacing);
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
children.forEach((childId) => calcSubtreeDimensions(childId));
|
|
227
|
+
const childrenTotalWidth = children.reduce((sum, cid) => sum + subtreeWidths[cid], 0);
|
|
228
|
+
const spacing = (children.length - 1) * HORIZONTAL_SPACING;
|
|
229
|
+
subtreeWidths[nodeId] = Math.max(NODE_WIDTH, childrenTotalWidth + spacing);
|
|
230
|
+
subtreeHeights[nodeId] = currentNodeHeight;
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
const getAllNodeIds = (node) => {
|
|
234
|
+
let ids = [node._id];
|
|
235
|
+
if (node.children) {
|
|
236
|
+
node.children.forEach((child) => {
|
|
237
|
+
ids = ids.concat(getAllNodeIds(child));
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
return ids;
|
|
241
|
+
};
|
|
242
|
+
getAllNodeIds(jsonData).forEach((id) => calcSubtreeDimensions(id));
|
|
243
|
+
const positionNodes = () => {
|
|
244
|
+
positions[jsonData._id] = { x: 0, y: 0 };
|
|
245
|
+
const level1Children = childrenMap[jsonData._id] || [];
|
|
246
|
+
if (level1Children.length === 0)
|
|
247
|
+
return;
|
|
248
|
+
const totalWidth = level1Children.length * NODE_WIDTH;
|
|
249
|
+
const totalSpacing = (level1Children.length - 1) * HORIZONTAL_SPACING;
|
|
250
|
+
const fullWidth = totalWidth + totalSpacing;
|
|
251
|
+
let currentX = -fullWidth / 2;
|
|
252
|
+
const level1Y = nodeHeights[jsonData._id] + VERTICAL_SPACING;
|
|
253
|
+
level1Children.forEach((childId) => {
|
|
254
|
+
positions[childId] = {
|
|
255
|
+
x: currentX + NODE_WIDTH / 2,
|
|
256
|
+
y: level1Y,
|
|
257
|
+
};
|
|
258
|
+
currentX += NODE_WIDTH + HORIZONTAL_SPACING;
|
|
259
|
+
});
|
|
260
|
+
const positionSubtree = (parentId) => {
|
|
261
|
+
const children = childrenMap[parentId] || [];
|
|
262
|
+
if (children.length === 0)
|
|
263
|
+
return;
|
|
264
|
+
const parentPos = positions[parentId];
|
|
265
|
+
const parentLevel = levelMap[parentId];
|
|
266
|
+
const hasMultipleChildren = children.length > 1;
|
|
267
|
+
if (parentLevel >= 1 && hasMultipleChildren) {
|
|
268
|
+
let currentY = parentPos.y + nodeHeights[parentId] + VERTICAL_SPACING - 80;
|
|
269
|
+
const childX = parentPos.x + HORIZONTAL_OFFSET;
|
|
270
|
+
children.forEach((childId) => {
|
|
271
|
+
positions[childId] = {
|
|
272
|
+
x: childX,
|
|
273
|
+
y: currentY,
|
|
274
|
+
};
|
|
275
|
+
currentY += nodeHeights[childId] + VERTICAL_STACK_SPACING;
|
|
276
|
+
positionSubtree(childId);
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
const childrenTotalWidth = children.reduce((sum, cid) => sum + subtreeWidths[cid], 0);
|
|
281
|
+
const spacing = (children.length - 1) * HORIZONTAL_SPACING;
|
|
282
|
+
const fullChildrenWidth = childrenTotalWidth + spacing;
|
|
283
|
+
let childX = parentPos.x - fullChildrenWidth / 2;
|
|
284
|
+
const childY = parentPos.y + nodeHeights[parentId] + VERTICAL_SPACING;
|
|
285
|
+
children.forEach((childId) => {
|
|
286
|
+
const childWidth = subtreeWidths[childId];
|
|
287
|
+
positions[childId] = {
|
|
288
|
+
x: childX + childWidth / 2,
|
|
289
|
+
y: childY,
|
|
290
|
+
};
|
|
291
|
+
positionSubtree(childId);
|
|
292
|
+
childX += childWidth + HORIZONTAL_SPACING;
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
level1Children.forEach((childId) => positionSubtree(childId));
|
|
297
|
+
};
|
|
298
|
+
positionNodes();
|
|
299
|
+
const layoutNodes = inputNodes.map((n) => ({
|
|
300
|
+
...n,
|
|
301
|
+
position: positions[n.id] || { x: 0, y: 0 },
|
|
302
|
+
}));
|
|
303
|
+
return { nodes: layoutNodes, edges: inputEdges };
|
|
304
|
+
};
|
|
305
|
+
// Event handlers for mobile accordion view
|
|
306
|
+
const handleChevronClick = (nodeId) => {
|
|
307
|
+
setExpandedNodes((prev) => ({
|
|
308
|
+
...prev,
|
|
309
|
+
[nodeId]: !prev[nodeId],
|
|
310
|
+
}));
|
|
311
|
+
};
|
|
312
|
+
const handleIconClick = (nodeId, type, availableContentTypes) => {
|
|
313
|
+
const isSame = displayTypes[nodeId] === type;
|
|
314
|
+
setActiveExpandedNodeId(nodeId);
|
|
315
|
+
setContentExpanded((prev) => ({
|
|
316
|
+
...prev,
|
|
317
|
+
[nodeId]: isSame ? !prev[nodeId] : true,
|
|
318
|
+
}));
|
|
319
|
+
setDisplayTypes((prev) => ({
|
|
320
|
+
...prev,
|
|
321
|
+
[nodeId]: type,
|
|
322
|
+
}));
|
|
323
|
+
};
|
|
324
|
+
const setCurrentVideoIdx = (nodeId, idxOrUpdater) => {
|
|
325
|
+
setVideoIndices((prev) => {
|
|
326
|
+
const currentIdx = prev[nodeId] || 0;
|
|
327
|
+
const newIdx = idxOrUpdater(currentIdx);
|
|
328
|
+
return {
|
|
329
|
+
...prev,
|
|
330
|
+
[nodeId]: newIdx,
|
|
331
|
+
};
|
|
332
|
+
});
|
|
333
|
+
};
|
|
334
|
+
return {
|
|
335
|
+
// State
|
|
336
|
+
expandedNodeId,
|
|
337
|
+
expandedNodeHeight,
|
|
338
|
+
activeExpandedNodeId,
|
|
339
|
+
isTransitioning,
|
|
340
|
+
expandedNodes,
|
|
341
|
+
contentExpanded,
|
|
342
|
+
displayTypes,
|
|
343
|
+
videoIndices,
|
|
344
|
+
colorMap,
|
|
345
|
+
// Methods
|
|
346
|
+
getNodeColors,
|
|
347
|
+
getNodeContent,
|
|
348
|
+
buildNodes,
|
|
349
|
+
buildEdges,
|
|
350
|
+
computeCustomLayout,
|
|
351
|
+
handleChevronClick,
|
|
352
|
+
handleIconClick,
|
|
353
|
+
setCurrentVideoIdx,
|
|
354
|
+
};
|
|
355
|
+
};
|
|
356
|
+
exports.useRecapGraphLogic = useRecapGraphLogic;
|
|
357
|
+
//# sourceMappingURL=useRecapGraphLogic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRecapGraphLogic.js","sourceRoot":"","sources":["../../../../src/components/Organisms/RecapGraph/useRecapGraphLogic.js"],"names":[],"mappings":";;;AAAA,iCAAqD;AACrD,8DAAyE;AAElE,MAAM,kBAAkB,GAAG,CAAC,QAAQ,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;QAClB,oBAAoB;QACpB,eAAe;QACf,aAAa;QACb,eAAe;QACf,YAAY;QACZ,YAAY;QACZ,QAAQ;QACR,UAAU;QACV,aAAa;QACb,cAAc;QACd,UAAU;QACV,UAAU;QACV,mBAAmB;QACnB,kBAAkB;QAClB,eAAe;QACf,kBAAkB;KACnB,CAAC;AACJ,CAAC,CAAC;AAraW,QAAA,kBAAkB,sBAqa7B"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export const EditorBox: React.NamedExoticComponent<object>;
|
|
2
|
-
export const Topsection: React.NamedExoticComponent<object>;
|
|
3
2
|
export const MobileBottonIcons: React.NamedExoticComponent<object>;
|
|
4
3
|
export const Desktopicons: React.NamedExoticComponent<object>;
|
|
5
4
|
export const LearningCreditsWarning: React.NamedExoticComponent<object>;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.LearningCreditsWarning = exports.Desktopicons = exports.MobileBottonIcons = exports.
|
|
6
|
+
exports.LearningCreditsWarning = exports.Desktopicons = exports.MobileBottonIcons = exports.EditorBox = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("@chakra-ui/react");
|
|
9
9
|
const common_utils_1 = require("../../../../utils/common-utils");
|
|
@@ -11,7 +11,7 @@ const EditorStyles_1 = require("./EditorStyles");
|
|
|
11
11
|
const LearningPathUtils_1 = require("../../../../utils/LearningPathUtils");
|
|
12
12
|
const react_2 = __importDefault(require("react"));
|
|
13
13
|
const slate_react_1 = require("slate-react");
|
|
14
|
-
exports.EditorBox = react_2.default.memo(({ editorRef, handleClick,
|
|
14
|
+
exports.EditorBox = react_2.default.memo(({ editorRef, handleClick, height, handleFocus, handleBlur, handleKeyDown, handlePaste, handleDrop, handleDragOver, handleDragEnter, handleDragLeave, handleDragStart, isDisabled, showBottomBar, isRevision, renderElement, }) => {
|
|
15
15
|
return ((0, jsx_runtime_1.jsx)(react_1.Box, { ref: editorRef, onClick: handleClick, flex: 1, width: ["100%", "auto"], sx: {
|
|
16
16
|
position: "relative",
|
|
17
17
|
minH: "0px",
|
|
@@ -19,8 +19,6 @@ exports.EditorBox = react_2.default.memo(({ editorRef, handleClick, showTopSecti
|
|
|
19
19
|
overflow: "auto",
|
|
20
20
|
cursor: "text",
|
|
21
21
|
mt: 2,
|
|
22
|
-
pt: showTopSection ? "60px" : "0px",
|
|
23
|
-
transition: "padding-top 0.3s ease-in-out",
|
|
24
22
|
}, children: (0, jsx_runtime_1.jsx)(react_1.Box, { sx: {
|
|
25
23
|
"[data-slate-placeholder]": {
|
|
26
24
|
display: isDisabled ? "none !important" : "block !important",
|
|
@@ -28,9 +26,6 @@ exports.EditorBox = react_2.default.memo(({ editorRef, handleClick, showTopSecti
|
|
|
28
26
|
pointerEvents: "none !important",
|
|
29
27
|
fontWeight: "400 !important",
|
|
30
28
|
fontSize: "16px !important",
|
|
31
|
-
position: "absolute !important",
|
|
32
|
-
top: "0px !important",
|
|
33
|
-
left: "4px !important",
|
|
34
29
|
},
|
|
35
30
|
}, children: (0, jsx_runtime_1.jsx)(slate_react_1.Editable, { "data-testid": "input-editor", renderElement: renderElement, placeholder: showBottomBar
|
|
36
31
|
? isRevision
|
|
@@ -41,7 +36,9 @@ exports.EditorBox = react_2.default.memo(({ editorRef, handleClick, showTopSecti
|
|
|
41
36
|
outline: "none",
|
|
42
37
|
minHeight: "50px",
|
|
43
38
|
zIndex: 1,
|
|
39
|
+
backgroundColor: "transparent",
|
|
44
40
|
cursor: isDisabled ? "not-allowed" : "text",
|
|
41
|
+
userSelect: isDisabled ? "none" : "auto",
|
|
45
42
|
pointerEvents: isDisabled ? "none" : "auto",
|
|
46
43
|
paddingLeft: "4px",
|
|
47
44
|
width: "100%",
|
|
@@ -54,30 +51,6 @@ exports.EditorBox = react_2.default.memo(({ editorRef, handleClick, showTopSecti
|
|
|
54
51
|
scrollbarWidth: "none",
|
|
55
52
|
} }) }) }));
|
|
56
53
|
});
|
|
57
|
-
exports.Topsection = react_2.default.memo(({ showTopSection, tutorMode, taskType, isDisabled }) => {
|
|
58
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Box, { position: "absolute", top: "0", left: "0", right: "0", zIndex: 10, overflow: "hidden", sx: {
|
|
59
|
-
height: showTopSection ? "auto" : "0px",
|
|
60
|
-
opacity: showTopSection ? 1 : 0,
|
|
61
|
-
transition: showTopSection
|
|
62
|
-
? "opacity 0.2s ease-in-out 0.1s, height 0.3s ease-in-out"
|
|
63
|
-
: "opacity 0.15s ease-in-out, height 0.25s ease-in-out 0.1s",
|
|
64
|
-
}, children: (0, jsx_runtime_1.jsxs)(react_1.Box, { sx: {
|
|
65
|
-
transform: showTopSection ? "translateY(0)" : "translateY(-100%)",
|
|
66
|
-
transition: showTopSection
|
|
67
|
-
? "transform 0.3s ease-out 0.15s"
|
|
68
|
-
: "transform 0.2s ease-in",
|
|
69
|
-
backgroundColor: tutorMode || (!tutorMode && taskType === LearningPathUtils_1.taskTypes.assessment)
|
|
70
|
-
? "white"
|
|
71
|
-
: "#F8F3D8",
|
|
72
|
-
borderRadius: "12px 12px 0 0",
|
|
73
|
-
px: 4,
|
|
74
|
-
pt: 3,
|
|
75
|
-
}, children: [(0, jsx_runtime_1.jsxs)(react_1.HStack, { justifyContent: "space-between", position: "relative", userSelect: "none", pb: 2, children: [(0, jsx_runtime_1.jsx)(react_1.Box, { ml: 2, display: "flex", children: !isDisabled && ((0, jsx_runtime_1.jsx)(react_1.Text, { as: "div", sx: EditorStyles_1.styles.multiLineText, children: "Press Enter to send, Shift+Enter for new line" })) }), (0, jsx_runtime_1.jsxs)(react_1.HStack, { spacing: "0px", display: ["none", "flex"], mr: 2, children: [(0, jsx_runtime_1.jsx)(react_1.Text, { as: "div", sx: EditorStyles_1.styles.multiLineBox, children: "Shift" }), (0, jsx_runtime_1.jsx)(react_1.Text, { as: "div", ml: 2, mr: 2, children: "+" }), (0, jsx_runtime_1.jsx)(react_1.Text, { as: "div", sx: EditorStyles_1.styles.multiLineBox, children: "Enter" })] })] }), (0, jsx_runtime_1.jsx)(react_1.Box, { sx: {
|
|
76
|
-
height: "1px",
|
|
77
|
-
backgroundColor: "#E0DBDB",
|
|
78
|
-
width: "100%",
|
|
79
|
-
} })] }) }));
|
|
80
|
-
});
|
|
81
54
|
exports.MobileBottonIcons = react_2.default.memo(({ tutorMode, taskType, icons, isDisabled, openMathEditor, addImageRender, data, handleSubmit, handleChange, }) => {
|
|
82
55
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_1.Box, { sx: {
|
|
83
56
|
height: "1px",
|
|
@@ -147,7 +120,6 @@ exports.LearningCreditsWarning = react_2.default.memo(({ icons, data, handleSubm
|
|
|
147
120
|
}
|
|
148
121
|
} }))] })));
|
|
149
122
|
exports.EditorBox.displayName = "EditorBox";
|
|
150
|
-
exports.Topsection.displayName = "Topsection";
|
|
151
123
|
exports.MobileBottonIcons.displayName = "MobileBottonIcons";
|
|
152
124
|
exports.Desktopicons.displayName = "Desktopicons";
|
|
153
125
|
exports.LearningCreditsWarning.displayName = "LearningCreditsWarning";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorComponent.js","sourceRoot":"","sources":["../../../../../src/components/Organisms/StudentEditor/components/EditorComponent.jsx"],"names":[],"mappings":";;;;;;;AAAA,4CAQ0B;AAC1B,iEAA+D;AAC/D,iDAAwC;AACxC,2EAAgE;AAChE,kDAA0B;AAC1B,6CAAuC;AAE1B,QAAA,SAAS,GAAG,eAAK,CAAC,IAAI,CACjC,CAAC,EACC,SAAS,EACT,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"EditorComponent.js","sourceRoot":"","sources":["../../../../../src/components/Organisms/StudentEditor/components/EditorComponent.jsx"],"names":[],"mapp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ACQ,aAAa,EACzB,EAAE,EAAE;gBACF,CAAC,EAAE,MAAM;gBACT,CAAC,EAAE,MAAM;gBACT,MAAM,EAAE,CAAC;gBACT,MAAM,EAAE,IAAA,4BAAa,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS;gBACvD,OAAO,EAAE,IAAA,4BAAa,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;aACvC,EACD,GAAG,EAAE,KAAK,EAAE,MAAM,EAClB,GAAG,EAAC,QAAQ,EACZ,OAAO,EAAE,GAAG,EAAE;gBACZ,IAAI,CAAC,IAAA,4BAAa,EAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE;oBAChC,YAAY,EAAE,CAAC;oBACf,YAAY,IAAI,YAAY,CAAC,EAAE,CAAC,CAAC;iBAClC;YACH,CAAC,GACD,CACH,IACM,CACV,CACF,CAAC;AACF,iBAAS,CAAC,WAAW,GAAG,WAAW,CAAC;AACpC,yBAAiB,CAAC,WAAW,GAAG,mBAAmB,CAAC;AACpD,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAC1C,8BAAsB,CAAC,WAAW,GAAG,wBAAwB,CAAC"}
|
|
@@ -69,8 +69,6 @@ const TextEditor = (props) => {
|
|
|
69
69
|
const [currentLatex, setCurrentLatex] = (0, react_1.useState)("");
|
|
70
70
|
const [editingPath, setEditingPath] = (0, react_1.useState)(null);
|
|
71
71
|
const editorRef = (0, react_1.useRef)(null);
|
|
72
|
-
const [isFocused, setIsFocused] = (0, react_1.useState)(false);
|
|
73
|
-
const [isHovered, setIsHovered] = (0, react_1.useState)(false);
|
|
74
72
|
const isDisabledRevision = isDisabled && isRevision;
|
|
75
73
|
(0, react_1.useEffect)(() => {
|
|
76
74
|
setValue((0, slate_conversions_1.textToSlate)(data));
|
|
@@ -82,17 +80,18 @@ const TextEditor = (props) => {
|
|
|
82
80
|
handleOpenMath && openMathEditor();
|
|
83
81
|
}, [handleOpenMath]);
|
|
84
82
|
// Focus the editor when it first mounts
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
83
|
+
(0, react_1.useEffect)(() => {
|
|
84
|
+
if (!isDisabled) {
|
|
85
|
+
setTimeout(() => {
|
|
86
|
+
try {
|
|
87
|
+
slate_react_1.ReactEditor.focus(editor);
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
console.error("Error focusing editor on mount:", error);
|
|
91
|
+
}
|
|
92
|
+
}, 100);
|
|
93
|
+
}
|
|
94
|
+
}, [editor, isDisabled]);
|
|
96
95
|
// Function to open the math editor modal for new entries
|
|
97
96
|
const openMathEditor = (0, react_1.useCallback)(() => {
|
|
98
97
|
const { selection } = editor;
|
|
@@ -270,40 +269,8 @@ const TextEditor = (props) => {
|
|
|
270
269
|
const handleDragLeave = (0, react_1.useCallback)((event) => {
|
|
271
270
|
event.preventDefault();
|
|
272
271
|
}, []);
|
|
273
|
-
const handleFocus = (0, react_1.useCallback)(() => {
|
|
274
|
-
|
|
275
|
-
}, []);
|
|
276
|
-
const handleBlur = (0, react_1.useCallback)(() => {
|
|
277
|
-
setIsFocused(false);
|
|
278
|
-
}, []);
|
|
279
|
-
const showTopSection = !isMobile &&
|
|
280
|
-
(isFocused || isHovered) &&
|
|
281
|
-
tutorMode &&
|
|
282
|
-
!isRevision &&
|
|
283
|
-
showBottomBar;
|
|
284
|
-
const handleEditorMouseEnter = (0, react_1.useCallback)(() => {
|
|
285
|
-
if (!isMobile) {
|
|
286
|
-
setIsHovered(true);
|
|
287
|
-
}
|
|
288
|
-
}, [isMobile]);
|
|
289
|
-
const handleEditorMouseLeave = (0, react_1.useCallback)(() => {
|
|
290
|
-
if (!isMobile) {
|
|
291
|
-
setIsHovered(false);
|
|
292
|
-
setIsFocused(false);
|
|
293
|
-
}
|
|
294
|
-
}, [isMobile]);
|
|
295
|
-
// Use effect to handle clicks outside the editor
|
|
296
|
-
// useEffect(() => {
|
|
297
|
-
// const handleClickOutside = (event) => {
|
|
298
|
-
// if (editorRef.current && !editorRef.current.contains(event.target)) {
|
|
299
|
-
// setIsFocused(false);
|
|
300
|
-
// }
|
|
301
|
-
// };
|
|
302
|
-
// document.addEventListener('mousedown', handleClickOutside);
|
|
303
|
-
// return () => {
|
|
304
|
-
// document.removeEventListener('mousedown', handleClickOutside);
|
|
305
|
-
// };
|
|
306
|
-
// }, []);
|
|
272
|
+
const handleFocus = (0, react_1.useCallback)(() => { }, []);
|
|
273
|
+
const handleBlur = (0, react_1.useCallback)(() => { }, []);
|
|
307
274
|
// Alternative onKeyDown handler approach for the Editable component
|
|
308
275
|
const handleKeyDown = (0, react_1.useCallback)((event) => {
|
|
309
276
|
if (isDisabled || !onSubmit)
|
|
@@ -314,25 +281,24 @@ const TextEditor = (props) => {
|
|
|
314
281
|
event.preventDefault();
|
|
315
282
|
}
|
|
316
283
|
if (event.key === "Enter") {
|
|
317
|
-
if (isMobile) {
|
|
318
|
-
|
|
319
|
-
}
|
|
320
|
-
if (event.shiftKey) {
|
|
321
|
-
|
|
322
|
-
}
|
|
323
|
-
// Regular Enter should submit
|
|
324
|
-
event.preventDefault();
|
|
325
|
-
const currentText =
|
|
326
|
-
if (!
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
}
|
|
284
|
+
// if (isMobile) {
|
|
285
|
+
return; // Let the default behavior happen (new line)
|
|
286
|
+
// }
|
|
287
|
+
// if (event.shiftKey) {
|
|
288
|
+
// return; // Let the default behavior happen (new line)
|
|
289
|
+
// }
|
|
290
|
+
// // Regular Enter should submit
|
|
291
|
+
// event.preventDefault();
|
|
292
|
+
// const currentText = slateToText(value);
|
|
293
|
+
// if (!isEmptyOrNull(currentText?.trim()) && showBottomBar == true) {
|
|
294
|
+
// handleSubmit();
|
|
295
|
+
// handleChange && handleChange("");
|
|
296
|
+
// }
|
|
330
297
|
}
|
|
331
298
|
}, [value, handleSubmit, handleChange, isDisabled, onSubmit]);
|
|
332
299
|
const editorBoxProps = (0, react_1.useMemo)(() => ({
|
|
333
300
|
editorRef,
|
|
334
301
|
handleClick,
|
|
335
|
-
showTopSection,
|
|
336
302
|
height,
|
|
337
303
|
handleFocus,
|
|
338
304
|
handleBlur,
|
|
@@ -350,7 +316,6 @@ const TextEditor = (props) => {
|
|
|
350
316
|
}), [
|
|
351
317
|
editorRef,
|
|
352
318
|
handleClick,
|
|
353
|
-
showTopSection,
|
|
354
319
|
height,
|
|
355
320
|
handleFocus,
|
|
356
321
|
handleBlur,
|
|
@@ -381,7 +346,7 @@ const TextEditor = (props) => {
|
|
|
381
346
|
const IconsComponent = isMobile ? EditorComponent_1.MobileBottonIcons : EditorComponent_1.Desktopicons;
|
|
382
347
|
return ((0, jsx_runtime_1.jsx)(react_2.ChakraProvider, { theme: theme, children: (0, jsx_runtime_1.jsxs)(react_2.Box, { "data-testid": "studenteditor", w: "100%", borderRadius: "8px", p: "24px", border: showBottomBar ? "1px solid #BFBEDC" : "none", pointerEvents: isDisabled ? "none" : "auto", opacity: tutorMode === false ? 1 : isDisabled ? 0.5 : 1, bg: tutorMode || (!tutorMode && taskType === LearningPathUtils_1.taskTypes.assessment)
|
|
383
348
|
? "white"
|
|
384
|
-
: "#F8F3D8",
|
|
349
|
+
: "#F8F3D8", children: [(tutorMode || (!tutorMode && taskType === LearningPathUtils_1.taskTypes.assessment)) && ((0, jsx_runtime_1.jsx)(slate_react_1.Slate, { editor: editor, initialValue: value, onChange: (newValue) => {
|
|
385
350
|
setValue(newValue);
|
|
386
351
|
handleChange && handleChange((0, slate_conversions_1.slateToText)(newValue));
|
|
387
352
|
}, children: (0, jsx_runtime_1.jsxs)(StackWrapper, { spacing: 0, alignItems: isMobile ? "stretch" : "flex-end", width: "100%", children: [(0, jsx_runtime_1.jsx)(EditorComponent_1.EditorBox, { ...editorBoxProps }), (0, jsx_runtime_1.jsx)(IconsComponent, { ...iconProps, isDisabledRevision: !isMobile ? isDisabledRevision : "" })] }) })), !tutorMode && taskType !== LearningPathUtils_1.taskTypes.assessment && !isRevision && ((0, jsx_runtime_1.jsx)(EditorComponent_1.LearningCreditsWarning, { icons: icons, data: data, handleSubmit: handleSubmit, handleChange: handleChange })), (0, jsx_runtime_1.jsx)(MathModal_1.default, { isOpen: isModalOpen, onClose: handleModalClose, onSave: handleSaveMath, initialLatex: currentLatex, subject: props.subject })] }) }));
|