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
|
@@ -6,121 +6,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.MobileAccordionView = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("@chakra-ui/react");
|
|
9
|
-
const react_2 = require("react");
|
|
10
9
|
const FlashcardContainer_1 = __importDefault(require("./FlashcardContainer"));
|
|
11
10
|
const contentUtils_1 = require("../../../utils/contentUtils");
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const colorMap = (0, react_2.useMemo)(() => {
|
|
19
|
-
const map = {};
|
|
20
|
-
const buildColorMap = (nodeData, level = 0, parentColorKey = null) => {
|
|
21
|
-
if (!nodeData) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
let colorKey;
|
|
25
|
-
if (level === 0) {
|
|
26
|
-
colorKey = "root";
|
|
27
|
-
}
|
|
28
|
-
else if (level === 1) {
|
|
29
|
-
// Count how many level 1 siblings we've already processed
|
|
30
|
-
let level1Index = 0;
|
|
31
|
-
const countLevel1Siblings = (node, targetId) => {
|
|
32
|
-
if (node._id === targetId)
|
|
33
|
-
return level1Index;
|
|
34
|
-
if (node.children) {
|
|
35
|
-
for (let child of node.children) {
|
|
36
|
-
if (child.children) {
|
|
37
|
-
const result = countLevel1Siblings(child, targetId);
|
|
38
|
-
if (result !== null)
|
|
39
|
-
return result;
|
|
40
|
-
}
|
|
41
|
-
level1Index++;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return null;
|
|
45
|
-
};
|
|
46
|
-
// Simpler: just count position among siblings at level 1
|
|
47
|
-
const parentChildren = jsonData.children || [];
|
|
48
|
-
const siblingIndex = parentChildren.findIndex((c) => c._id === nodeData._id);
|
|
49
|
-
colorKey = String(siblingIndex % 8);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
// Child levels inherit parent's color key
|
|
53
|
-
colorKey = parentColorKey;
|
|
54
|
-
}
|
|
55
|
-
map[nodeData._id] = {
|
|
56
|
-
colorKey,
|
|
57
|
-
level,
|
|
58
|
-
};
|
|
59
|
-
if (nodeData.children?.length) {
|
|
60
|
-
nodeData.children.forEach((child) => {
|
|
61
|
-
buildColorMap(child, level + 1, colorKey);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
if (jsonData) {
|
|
66
|
-
buildColorMap(jsonData);
|
|
67
|
-
}
|
|
68
|
-
return map;
|
|
69
|
-
}, [jsonData]);
|
|
70
|
-
const getNodeColor = (nodeId, level, colorKey) => {
|
|
71
|
-
if (level === 0) {
|
|
72
|
-
return contentUtils_1.COLOR_MAP.root;
|
|
73
|
-
}
|
|
74
|
-
if (level === 1) {
|
|
75
|
-
return contentUtils_1.COLOR_MAP[colorKey];
|
|
76
|
-
}
|
|
77
|
-
// Level 2+ use light color
|
|
78
|
-
return contentUtils_1.LIGHT_COLOR_MAP[colorKey];
|
|
79
|
-
};
|
|
80
|
-
const renderNode = (nodeData, level = 0) => {
|
|
81
|
-
console.log("node data:", nodeData);
|
|
82
|
-
const nodeContent = contentMap[nodeData._id] || null;
|
|
83
|
-
const hasContent = nodeContent &&
|
|
84
|
-
(nodeContent.videos?.length > 0 ||
|
|
85
|
-
(nodeContent.recap && Object.keys(nodeContent.recap).length > 0));
|
|
11
|
+
const useRecapGraphLogic_1 = require("../RecapGraph/useRecapGraphLogic");
|
|
12
|
+
const MobileAccordionView = ({ jsonData = null, contentMap = {}, onContentUpdate, onIconDataUpdate, isAdmin = false, iconConfig = [], playicon, }) => {
|
|
13
|
+
const logic = (0, useRecapGraphLogic_1.useRecapGraphLogic)(jsonData, contentMap, iconConfig);
|
|
14
|
+
const renderNode = (nodeData) => {
|
|
15
|
+
const { nodeContent, hasContent } = logic.getNodeContent(nodeData._id);
|
|
16
|
+
const { headerColor, bgColor, colorInfo } = logic.getNodeColors(nodeData._id);
|
|
86
17
|
const hasChildren = nodeData.children?.length > 0;
|
|
87
18
|
const availableContentTypes = hasContent
|
|
88
19
|
? (0, contentUtils_1.getAvailableContentTypes)(nodeContent)
|
|
89
20
|
: [];
|
|
90
21
|
const availableIcons = iconConfig.filter((icon) => availableContentTypes.includes(icon.type));
|
|
91
|
-
const displayType = displayTypes[nodeData._id] ||
|
|
92
|
-
const isNodeExpanded = expandedNodes[nodeData._id] || false;
|
|
93
|
-
const isContentExpanded = contentExpanded[nodeData._id] || false;
|
|
94
|
-
const currentVideoIdx = videoIndices[nodeData._id] || 0;
|
|
95
|
-
|
|
96
|
-
const nodeColorInfo = colorMap[nodeData._id] || { colorKey: "0", level: 0 };
|
|
97
|
-
const bgColor = getNodeColor(nodeData._id, nodeColorInfo.level, nodeColorInfo.colorKey);
|
|
98
|
-
const handleChevronClick = () => {
|
|
99
|
-
setExpandedNodes((prev) => ({
|
|
100
|
-
...prev,
|
|
101
|
-
[nodeData._id]: !prev[nodeData._id],
|
|
102
|
-
}));
|
|
103
|
-
};
|
|
104
|
-
const handleIconClick = (type) => {
|
|
105
|
-
const isSame = displayTypes[nodeData._id] === type;
|
|
106
|
-
setContentExpanded((prev) => ({
|
|
107
|
-
...prev,
|
|
108
|
-
[nodeData._id]: isSame ? !prev[nodeData._id] : true,
|
|
109
|
-
}));
|
|
110
|
-
setDisplayTypes((prev) => ({
|
|
111
|
-
...prev,
|
|
112
|
-
[nodeData._id]: type,
|
|
113
|
-
}));
|
|
114
|
-
};
|
|
115
|
-
const setCurrentVideoIdx = (idx) => {
|
|
116
|
-
setVideoIndices((prev) => ({
|
|
117
|
-
...prev,
|
|
118
|
-
[nodeData._id]: idx,
|
|
119
|
-
}));
|
|
120
|
-
};
|
|
121
|
-
return ((0, jsx_runtime_1.jsxs)(react_1.Box, { mb: "8px", children: [(0, jsx_runtime_1.jsx)(FlashcardContainer_1.default, { label: nodeData.description || nodeData.name, color: bgColor, hasContent: hasContent, isNodeExpanded: isNodeExpanded, isContentExpanded: isContentExpanded, displayType: displayType, availableIcons: availableIcons, handleIconClick: handleIconClick, content: nodeContent, currentVideoIdx: currentVideoIdx, setCurrentVideoIdx: setCurrentVideoIdx, isAdmin: isAdmin, onContentUpdate: onContentUpdate, nodeId: nodeData._id, rootNodeId: nodeData._id, onIconDataUpdate: onIconDataUpdate, hasChildren: hasChildren, onChevronClick: handleChevronClick, isMobile: true }), isNodeExpanded && hasChildren && ((0, jsx_runtime_1.jsx)(react_1.Box, { ml: "6px", mr: "6px", mt: "8px", bg: "#F8F8F8", children: nodeData.children.map((child) => renderNode(child, level + 1)) }))] }, nodeData._id));
|
|
22
|
+
const displayType = logic.displayTypes[nodeData._id] || null;
|
|
23
|
+
const isNodeExpanded = logic.expandedNodes[nodeData._id] || false;
|
|
24
|
+
const isContentExpanded = logic.contentExpanded[nodeData._id] || false;
|
|
25
|
+
const currentVideoIdx = logic.videoIndices[nodeData._id] || 0;
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Box, { mb: "8px", children: [(0, jsx_runtime_1.jsx)(FlashcardContainer_1.default, { label: nodeData.description || nodeData.name, color: headerColor, bgColor: bgColor, hasContent: hasContent, isNodeExpanded: isNodeExpanded, isContentExpanded: isContentExpanded, displayType: displayType, availableIcons: availableIcons, handleIconClick: (type) => logic.handleIconClick(nodeData._id, type, availableContentTypes), content: nodeContent, currentVideoIdx: currentVideoIdx, setCurrentVideoIdx: (idx) => logic.setCurrentVideoIdx(nodeData._id, idx), isAdmin: isAdmin, onContentUpdate: onContentUpdate, nodeId: nodeData._id, rootNodeId: jsonData._id, onIconDataUpdate: onIconDataUpdate, hasChildren: hasChildren, onChevronClick: () => logic.handleChevronClick(nodeData._id), isMobile: true, colorKey: colorInfo.colorKey, level: colorInfo.level, playicon: playicon }), isNodeExpanded && hasChildren && ((0, jsx_runtime_1.jsx)(react_1.Box, { px: "8px", mt: colorInfo.level === 0 ? "10px" : "", mb: "2px", bg: colorInfo.level === 0 ? "" : bgColor, children: nodeData.children.map((child) => renderNode(child)) }))] }, nodeData._id));
|
|
122
27
|
};
|
|
123
|
-
return ((0, jsx_runtime_1.jsx)(react_1.Box, { p: "16px", bg: "#f8fafc", children: (0, jsx_runtime_1.jsx)(react_1.VStack, { align: "stretch", spacing: "0", children: jsonData && renderNode(jsonData) }) }));
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(react_1.Box, { p: "16px", bg: "#f8fafc", minW: "340px", overflowX: "scroll", children: (0, jsx_runtime_1.jsx)(react_1.VStack, { align: "stretch", spacing: "0", children: jsonData && renderNode(jsonData) }) }));
|
|
124
29
|
};
|
|
125
30
|
exports.MobileAccordionView = MobileAccordionView;
|
|
126
31
|
exports.default = exports.MobileAccordionView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MobileAccordionView.js","sourceRoot":"","sources":["../../../../src/components/Organisms/FlashCardNode/MobileAccordionView.jsx"],"names":[],"mappings":";;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"MobileAccordionView.js","sourceRoot":"","sources":["../../../../src/components/Organisms/FlashCardNode/MobileAccordionView.jsx"],"names":[],"mappings":";;;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AC,EAAE,EACvC,EAAE,EAAC,KAAK,EACR,EAAE,EAAE,SAAS,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,YAEvC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,GAChD,CACP,KAxCO,QAAQ,CAAC,GAAG,CAyChB,CACP,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,uBAAC,WAAG,IAAC,CAAC,EAAC,MAAM,EAAC,EAAE,EAAC,SAAS,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,YAC3D,uBAAC,cAAM,IAAC,KAAK,EAAC,SAAS,EAAC,OAAO,EAAC,GAAG,YAChC,QAAQ,IAAI,UAAU,CAAC,QAAQ,CAAC,GAC1B,GACL,CACP,CAAC;AACJ,CAAC,CAAC;AArFW,QAAA,mBAAmB,uBAqF9B;AAEF,kBAAe,2BAAmB,CAAC"}
|
|
@@ -7,10 +7,15 @@ exports.DefaultTimerClock = void 0;
|
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const RecapData_1 = require("../../../utils/RecapData");
|
|
9
9
|
const Reactgraphflow_1 = __importDefault(require("./Reactgraphflow"));
|
|
10
|
-
const defination_svg_1 = __importDefault(require("../../../assests/
|
|
11
|
-
const formula_svg_1 = __importDefault(require("../../../assests/
|
|
12
|
-
const videoplay_svg_1 = __importDefault(require("../../../assests/
|
|
13
|
-
const equations_svg_1 = __importDefault(require("../../../assests/
|
|
10
|
+
const defination_svg_1 = __importDefault(require("../../../assests/recap/defination.svg"));
|
|
11
|
+
const formula_svg_1 = __importDefault(require("../../../assests/recap/formula.svg"));
|
|
12
|
+
const videoplay_svg_1 = __importDefault(require("../../../assests/recap/videoplay.svg"));
|
|
13
|
+
const equations_svg_1 = __importDefault(require("../../../assests/recap/equations.svg"));
|
|
14
|
+
const theorem_svg_1 = __importDefault(require("../../../assests/recap/theorem.svg"));
|
|
15
|
+
const timeline_svg_1 = __importDefault(require("../../../assests/recap/timeline.svg"));
|
|
16
|
+
const processes_svg_1 = __importDefault(require("../../../assests/recap/processes.svg"));
|
|
17
|
+
const lawsandapp_svg_1 = __importDefault(require("../../../assests/recap/lawsandapp.svg"));
|
|
18
|
+
const factualPlay_svg_1 = __importDefault(require("../../../assests/revision/factualPlay.svg"));
|
|
14
19
|
exports.default = {
|
|
15
20
|
title: "Components/Organisms/Graph/ReactFlowELKView",
|
|
16
21
|
component: Reactgraphflow_1.default,
|
|
@@ -19,18 +24,27 @@ const Template = (args) => (0, jsx_runtime_1.jsx)(Reactgraphflow_1.default, { ..
|
|
|
19
24
|
const customIcons = [
|
|
20
25
|
{ src: equations_svg_1.default, type: "equations" },
|
|
21
26
|
{ src: videoplay_svg_1.default, type: "videos" },
|
|
22
|
-
{ src: formula_svg_1.default, type: "
|
|
27
|
+
{ src: formula_svg_1.default, type: "formulae" },
|
|
23
28
|
{ src: defination_svg_1.default, type: "definitions" },
|
|
29
|
+
{ src: defination_svg_1.default, type: "keyConcepts" },
|
|
30
|
+
{ src: theorem_svg_1.default, type: "theorems" },
|
|
31
|
+
{ src: processes_svg_1.default, type: "processes" },
|
|
32
|
+
{ src: lawsandapp_svg_1.default, type: "laws" },
|
|
33
|
+
{ src: lawsandapp_svg_1.default, type: "applications" },
|
|
34
|
+
{ src: timeline_svg_1.default, type: "Timeline" },
|
|
24
35
|
];
|
|
25
|
-
console.log("
|
|
36
|
+
console.log("contentmap:", RecapData_1.contentMap);
|
|
26
37
|
exports.DefaultTimerClock = Template.bind({});
|
|
27
38
|
exports.DefaultTimerClock.args = {
|
|
28
39
|
jsonData: RecapData_1.jsonData,
|
|
29
40
|
contentMap: RecapData_1.contentMap,
|
|
30
41
|
iconConfig: customIcons,
|
|
31
|
-
onContentUpdate: () => {
|
|
42
|
+
onContentUpdate: (payload) => {
|
|
43
|
+
console.log("onContentUpdate payload:", payload);
|
|
44
|
+
},
|
|
32
45
|
onIconDataUpdate: () => { },
|
|
33
|
-
|
|
46
|
+
isAdmin: true,
|
|
47
|
+
playicon: factualPlay_svg_1.default,
|
|
34
48
|
// isMobile: true,
|
|
35
49
|
};
|
|
36
50
|
//# sourceMappingURL=Example.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Example.stories.js","sourceRoot":"","sources":["../../../../src/components/Organisms/RecapGraph/Example.stories.tsx"],"names":[],"mappings":";;;;;;;AAEA,wDAA+E;AAC/E,sEAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"Example.stories.js","sourceRoot":"","sources":["../../../../src/components/Organisms/RecapGraph/Example.stories.tsx"],"names":[],"mappings":";;;;;;;AAEA,wDAA+E;AAC/E,sEAA0C;AAC1C,2FAAmE;AACnE,qFAA6D;AAC7D,yFAAiE;AACjE,yFAAgE;AAChE,qFAA6D;AAC7D,uFAA+D;AAC/D,yFAAiE;AACjE,2FAAmE;AACnE,gGAAiE;AAEjE,kBAAe;IACb,KAAK,EAAE,6CAA6C;IACpD,SAAS,EAAE,wBAAU;CACd,CAAC;AAEV,MAAM,QAAQ,GAAe,CAAC,IAAI,EAAE,EAAE,CAAC,uBAAC,wBAAU,OAAK,IAAI,GAAI,CAAC;AAEhE,MAAM,WAAW,GAAG;IAClB,EAAE,GAAG,EAAE,uBAAY,EAAE,IAAI,EAAE,WAAW,EAAE;IACxC,EAAE,GAAG,EAAE,uBAAa,EAAE,IAAI,EAAE,QAAQ,EAAE;IACtC,EAAE,GAAG,EAAE,qBAAW,EAAE,IAAI,EAAE,UAAU,EAAE;IACtC,EAAE,GAAG,EAAE,wBAAc,EAAE,IAAI,EAAE,aAAa,EAAE;IAC5C,EAAE,GAAG,EAAE,wBAAc,EAAE,IAAI,EAAE,aAAa,EAAE;IAC5C,EAAE,GAAG,EAAE,qBAAW,EAAE,IAAI,EAAE,UAAU,EAAE;IACtC,EAAE,GAAG,EAAE,uBAAa,EAAE,IAAI,EAAE,WAAW,EAAE;IACzC,EAAE,GAAG,EAAE,wBAAc,EAAE,IAAI,EAAE,MAAM,EAAE;IACrC,EAAE,GAAG,EAAE,wBAAc,EAAE,IAAI,EAAE,cAAc,EAAE;IAC7C,EAAE,GAAG,EAAE,sBAAY,EAAE,IAAI,EAAE,UAAU,EAAE;CACxC,CAAC;AACF,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,sBAAU,CAAC,CAAC;AAE1B,QAAA,iBAAiB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACnD,yBAAiB,CAAC,IAAI,GAAG;IACvB,QAAQ,EAAE,oBAAQ;IAClB,UAAU,EAAE,sBAAU;IACtB,UAAU,EAAE,WAAW;IACvB,eAAe,EAAE,CAAC,OAAY,EAAE,EAAE;QAChC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IACD,gBAAgB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC1B,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,yBAAQ;IAClB,kBAAkB;CACnB,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export default RecapGraph;
|
|
2
|
-
declare function RecapGraph({ jsonData, contentMap, iconConfig, onContentUpdate, onIconDataUpdate, isAdmin, isMobile, }: {
|
|
2
|
+
declare function RecapGraph({ jsonData, contentMap, iconConfig, onContentUpdate, onIconDataUpdate, isAdmin, isMobile, playicon, }: {
|
|
3
3
|
jsonData?: null | undefined;
|
|
4
4
|
contentMap?: {} | undefined;
|
|
5
5
|
iconConfig?: any[] | undefined;
|
|
6
6
|
onContentUpdate: any;
|
|
7
7
|
onIconDataUpdate: any;
|
|
8
8
|
isAdmin?: boolean | undefined;
|
|
9
|
-
isMobile
|
|
9
|
+
isMobile?: boolean | undefined;
|
|
10
|
+
playicon?: {} | undefined;
|
|
10
11
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -32,230 +32,70 @@ const reactflow_1 = __importStar(require("reactflow"));
|
|
|
32
32
|
// import "reactflow/dist/style.css";
|
|
33
33
|
const FlashCardNode_1 = __importDefault(require("../FlashCardNode/FlashCardNode"));
|
|
34
34
|
const MobileAccordionView_1 = require("../FlashCardNode/MobileAccordionView");
|
|
35
|
-
const
|
|
36
|
-
const RecapGraph = ({ jsonData = null, contentMap = {}, iconConfig = [], onContentUpdate, onIconDataUpdate, isAdmin = false, isMobile, }) => {
|
|
37
|
-
const [layout, setLayout] = (0, react_1.useState)({
|
|
35
|
+
const useRecapGraphLogic_1 = require("./useRecapGraphLogic");
|
|
36
|
+
const RecapGraph = ({ jsonData = null, contentMap = {}, iconConfig = [], onContentUpdate, onIconDataUpdate, isAdmin = false, isMobile = false, playicon = {}, }) => {
|
|
37
|
+
const [layout, setLayout] = (0, react_1.useState)({
|
|
38
|
+
nodes: [],
|
|
39
|
+
edges: [],
|
|
40
|
+
bounds: null,
|
|
41
|
+
});
|
|
42
|
+
const logic = (0, useRecapGraphLogic_1.useRecapGraphLogic)(jsonData, contentMap, iconConfig);
|
|
38
43
|
const nodeTypes = (0, react_1.useMemo)(() => ({
|
|
39
|
-
flashcard: (props) => ((0, jsx_runtime_1.jsx)(FlashCardNode_1.default, { ...props, rootNodeId:
|
|
40
|
-
}), [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const nodes = [];
|
|
44
|
-
let level1ColorIndex = 0;
|
|
45
|
-
const processNode = (nodeData, lvl, parentColorKey = null) => {
|
|
46
|
-
let colorKey;
|
|
47
|
-
let nodeColor;
|
|
48
|
-
if (lvl === 0) {
|
|
49
|
-
nodeColor = contentUtils_1.COLOR_MAP.root;
|
|
50
|
-
colorKey = "root";
|
|
51
|
-
}
|
|
52
|
-
else if (lvl === 1) {
|
|
53
|
-
colorKey = String(level1ColorIndex % 8);
|
|
54
|
-
nodeColor = contentUtils_1.COLOR_MAP[colorKey];
|
|
55
|
-
level1ColorIndex++;
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
colorKey = parentColorKey;
|
|
59
|
-
nodeColor = contentUtils_1.LIGHT_COLOR_MAP[colorKey];
|
|
60
|
-
}
|
|
61
|
-
const nodeContent = contentMap[nodeData._id] || null;
|
|
62
|
-
const hasContent = nodeContent &&
|
|
63
|
-
((nodeContent.videos && nodeContent.videos.length > 0) ||
|
|
64
|
-
(nodeContent.recap && Object.keys(nodeContent.recap).length > 0));
|
|
65
|
-
const node = {
|
|
66
|
-
id: nodeData._id,
|
|
67
|
-
type: "flashcard",
|
|
68
|
-
data: {
|
|
69
|
-
id: nodeData._id,
|
|
70
|
-
label: nodeData?.description,
|
|
71
|
-
color: nodeColor,
|
|
72
|
-
content: nodeContent,
|
|
73
|
-
hasContent: hasContent,
|
|
74
|
-
bgColor: contentUtils_1.LIGHT_COLOR_MAP[colorKey],
|
|
75
|
-
colorKey,
|
|
76
|
-
level: lvl,
|
|
77
|
-
hasMultipleChildren: nodeData.children && nodeData.children.length > 1,
|
|
78
|
-
icons: iconConfig,
|
|
79
|
-
},
|
|
80
|
-
position: { x: 0, y: 0 },
|
|
81
|
-
draggable: true,
|
|
82
|
-
};
|
|
83
|
-
nodes.push(node);
|
|
84
|
-
if (nodeData.children?.length) {
|
|
85
|
-
nodeData.children.forEach((child) => {
|
|
86
|
-
processNode(child, lvl + 1, colorKey);
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
if (data)
|
|
91
|
-
processNode(data, level);
|
|
92
|
-
return nodes;
|
|
93
|
-
};
|
|
94
|
-
// Build edges from hierarchical data
|
|
95
|
-
const buildEdges = (data, nodes, level = 0) => {
|
|
96
|
-
const edges = [];
|
|
97
|
-
const nodeColorMap = {};
|
|
98
|
-
nodes.forEach((n) => {
|
|
99
|
-
nodeColorMap[n.id] = n.data.color;
|
|
100
|
-
});
|
|
101
|
-
const processNode = (nodeData, lvl) => {
|
|
102
|
-
if (nodeData.children && nodeData.children.length > 0) {
|
|
103
|
-
nodeData.children.forEach((child) => {
|
|
104
|
-
const sourceColor = nodeColorMap[nodeData._id] || "#94a3b8";
|
|
105
|
-
// Determine handle positions based on level and number of children
|
|
106
|
-
let sourceHandle = "bottom";
|
|
107
|
-
let targetHandle = "top";
|
|
108
|
-
// For level 1 nodes with multiple children: use bottom-to-left
|
|
109
|
-
if (lvl >= 1 && nodeData.children.length > 1) {
|
|
110
|
-
sourceHandle = "bottom";
|
|
111
|
-
targetHandle = "left";
|
|
112
|
-
}
|
|
113
|
-
// For all other cases: use bottom-to-top (straight line)
|
|
114
|
-
else {
|
|
115
|
-
sourceHandle = "bottom";
|
|
116
|
-
targetHandle = "top";
|
|
117
|
-
}
|
|
118
|
-
edges.push({
|
|
119
|
-
id: `${nodeData._id}-${child._id}`,
|
|
120
|
-
source: nodeData._id,
|
|
121
|
-
target: child._id,
|
|
122
|
-
sourceHandle: sourceHandle,
|
|
123
|
-
targetHandle: targetHandle,
|
|
124
|
-
type: "bezier",
|
|
125
|
-
style: {
|
|
126
|
-
stroke: sourceColor,
|
|
127
|
-
strokeWidth: 2,
|
|
128
|
-
},
|
|
129
|
-
markerEnd: {
|
|
130
|
-
type: "arrowclosed",
|
|
131
|
-
color: sourceColor,
|
|
132
|
-
width: 10,
|
|
133
|
-
height: 10,
|
|
134
|
-
},
|
|
135
|
-
});
|
|
136
|
-
processNode(child, lvl + 1);
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
if (data)
|
|
141
|
-
processNode(data, level);
|
|
142
|
-
return edges;
|
|
143
|
-
};
|
|
144
|
-
// Calculate subtree height for vertical stacking
|
|
145
|
-
const calculateSubtreeHeight = (nodeId, edges) => {
|
|
146
|
-
const childEdges = edges.filter((e) => e.source === nodeId);
|
|
147
|
-
if (childEdges.length === 0) {
|
|
148
|
-
return 80;
|
|
149
|
-
}
|
|
150
|
-
const childHeights = childEdges.map((edge) => {
|
|
151
|
-
return calculateSubtreeHeight(edge.target, edges);
|
|
152
|
-
});
|
|
153
|
-
const totalHeight = childHeights.reduce((sum, h) => sum + h, 0) +
|
|
154
|
-
(childHeights.length - 1) * 20;
|
|
155
|
-
return totalHeight + 150;
|
|
156
|
-
};
|
|
157
|
-
// Compute layout
|
|
158
|
-
const computeLayout = (inputNodes, inputEdges) => {
|
|
159
|
-
if (!inputNodes || inputNodes.length === 0) {
|
|
44
|
+
flashcard: (props) => ((0, jsx_runtime_1.jsx)(FlashCardNode_1.default, { ...props, rootNodeId: jsonData?._id, onContentUpdate: onContentUpdate, onIconDataUpdate: onIconDataUpdate, isAdmin: isAdmin, isMobile: isMobile, playicon: playicon })),
|
|
45
|
+
}), [onContentUpdate, onIconDataUpdate, isAdmin, isMobile, jsonData?._id]);
|
|
46
|
+
const graphData = (0, react_1.useMemo)(() => {
|
|
47
|
+
if (!jsonData)
|
|
160
48
|
return { nodes: [], edges: [] };
|
|
49
|
+
const nodes = logic.buildNodes(jsonData);
|
|
50
|
+
const edges = logic.buildEdges(jsonData, nodes);
|
|
51
|
+
return { nodes, edges };
|
|
52
|
+
}, [jsonData, logic?.activeExpandedNodeId]);
|
|
53
|
+
const computeBounds = (nodes) => {
|
|
54
|
+
if (!nodes || nodes.length === 0) {
|
|
55
|
+
return {
|
|
56
|
+
minX: -2000,
|
|
57
|
+
minY: -2000,
|
|
58
|
+
maxX: 2000,
|
|
59
|
+
maxY: 2000,
|
|
60
|
+
};
|
|
161
61
|
}
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
const
|
|
165
|
-
const
|
|
166
|
-
const
|
|
167
|
-
const rightColumnOffset = 250;
|
|
168
|
-
const childSpacing = 20;
|
|
169
|
-
const getNodeLevel = (nodeId) => {
|
|
170
|
-
const node = nodeMap[nodeId];
|
|
171
|
-
return node?.data?.level || 0;
|
|
172
|
-
};
|
|
173
|
-
const getNodeHeight = (nodeId) => {
|
|
174
|
-
const node = nodeMap[nodeId];
|
|
175
|
-
return node?.data?.height || baseNodeHeight;
|
|
176
|
-
};
|
|
177
|
-
const positionNode = (nodeId, x, y) => {
|
|
178
|
-
if (!nodeMap[nodeId])
|
|
179
|
-
return;
|
|
180
|
-
const level = getNodeLevel(nodeId);
|
|
181
|
-
const nodeHeight = getNodeHeight(nodeId);
|
|
182
|
-
const verticalGap = nodeHeight * verticalGapMultiplier;
|
|
183
|
-
nodeMap[nodeId].position = { x, y };
|
|
184
|
-
const childEdges = inputEdges.filter((e) => e.source === nodeId);
|
|
185
|
-
if (childEdges.length === 0)
|
|
186
|
-
return;
|
|
187
|
-
const childIds = childEdges.map((e) => e.target);
|
|
188
|
-
if (level === 0) {
|
|
189
|
-
const totalWidth = (childIds.length - 1) * horizontalGap;
|
|
190
|
-
childIds.forEach((childId, idx) => {
|
|
191
|
-
const childX = idx * horizontalGap - totalWidth / 2;
|
|
192
|
-
positionNode(childId, childX, y + verticalGap);
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
else if (level === 1) {
|
|
196
|
-
if (childIds.length === 1) {
|
|
197
|
-
positionNode(childIds[0], x, y + verticalGap);
|
|
198
|
-
}
|
|
199
|
-
else {
|
|
200
|
-
const childHeights = childIds.map((id) => calculateSubtreeHeight(id, inputEdges));
|
|
201
|
-
const totalHeight = childHeights.reduce((sum, h) => sum + h, 0) +
|
|
202
|
-
(childHeights.length - 1) * childSpacing;
|
|
203
|
-
let currentY = y - totalHeight / 2;
|
|
204
|
-
childIds.forEach((childId, idx) => {
|
|
205
|
-
const childHeight = childHeights[idx];
|
|
206
|
-
const childCenterY = currentY + childHeight / 2;
|
|
207
|
-
positionNode(childId, x + rightColumnOffset, childCenterY + verticalGap * 1.5);
|
|
208
|
-
currentY += childHeight + childSpacing;
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
else {
|
|
213
|
-
if (childIds.length === 1) {
|
|
214
|
-
positionNode(childIds[0], x, y + verticalGap);
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
const childHeights = childIds.map((id) => calculateSubtreeHeight(id, inputEdges));
|
|
218
|
-
const totalHeight = childHeights.reduce((sum, h) => sum + h, 0) +
|
|
219
|
-
(childHeights.length - 1) * childSpacing;
|
|
220
|
-
let currentY = y - totalHeight / 2;
|
|
221
|
-
childIds.forEach((childId, idx) => {
|
|
222
|
-
const childHeight = childHeights[idx];
|
|
223
|
-
const childCenterY = currentY + childHeight / 2;
|
|
224
|
-
positionNode(childId, x + rightColumnOffset, childCenterY + verticalGap * 1.5);
|
|
225
|
-
currentY += childHeight + childSpacing;
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
const rootNode = inputNodes.find((n) => n.data.level === 0) || inputNodes[0];
|
|
231
|
-
if (rootNode) {
|
|
232
|
-
positionNode(rootNode.id, 0, 0);
|
|
233
|
-
}
|
|
62
|
+
const minX = Math.min(...nodes.map((n) => n.position.x));
|
|
63
|
+
const maxX = Math.max(...nodes.map((n) => n.position.x + (n.width || 260)));
|
|
64
|
+
const minY = Math.min(...nodes.map((n) => n.position.y));
|
|
65
|
+
const maxY = Math.max(...nodes.map((n) => n.position.y + (n.height || 150)));
|
|
66
|
+
const PAD = 400;
|
|
234
67
|
return {
|
|
235
|
-
|
|
236
|
-
|
|
68
|
+
minX: minX - PAD,
|
|
69
|
+
minY: minY - PAD,
|
|
70
|
+
maxX: maxX + PAD,
|
|
71
|
+
maxY: maxY + PAD,
|
|
237
72
|
};
|
|
238
73
|
};
|
|
239
|
-
// Build graph data from jsonData
|
|
240
|
-
const graphData = (0, react_1.useMemo)(() => {
|
|
241
|
-
if (!jsonData) {
|
|
242
|
-
return { nodes: [], edges: [] };
|
|
243
|
-
}
|
|
244
|
-
const nodes = buildNodes(jsonData, contentMap);
|
|
245
|
-
const edges = buildEdges(jsonData, nodes);
|
|
246
|
-
return { nodes, edges };
|
|
247
|
-
}, [contentMap, iconConfig]);
|
|
248
|
-
// Compute layout when graph data changes
|
|
249
74
|
(0, react_1.useEffect)(() => {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
75
|
+
const res = logic.computeCustomLayout(graphData.nodes, graphData.edges);
|
|
76
|
+
setLayout((prev) => ({
|
|
77
|
+
nodes: graphData.nodes.map((n) => ({
|
|
78
|
+
...n,
|
|
79
|
+
position: res.nodes.find((m) => m.id === n.id)?.position || n.position,
|
|
80
|
+
})),
|
|
81
|
+
edges: graphData.edges,
|
|
82
|
+
bounds: computeBounds(res.nodes),
|
|
83
|
+
}));
|
|
84
|
+
}, [logic.expandedNodeId, logic.expandedNodeHeight]);
|
|
85
|
+
const bounds = layout.bounds || {
|
|
86
|
+
minX: -2000,
|
|
87
|
+
minY: -2000,
|
|
88
|
+
maxX: 2000,
|
|
89
|
+
maxY: 2000,
|
|
90
|
+
};
|
|
254
91
|
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
255
|
-
width: isAdmin ? "100vw" : "",
|
|
92
|
+
width: isAdmin ? "100vw" : "100%",
|
|
256
93
|
height: isAdmin ? "100vh" : "90%",
|
|
257
94
|
backgroundColor: "#f8fafc",
|
|
258
|
-
}, children: isMobile ? ((0, jsx_runtime_1.jsx)(MobileAccordionView_1.MobileAccordionView, { jsonData: jsonData, contentMap: contentMap, iconConfig: iconConfig, onContentUpdate: onContentUpdate, onIconDataUpdate: onIconDataUpdate, isAdmin: isAdmin })) : ((0, jsx_runtime_1.jsxs)(reactflow_1.default, { nodes: layout.nodes, edges: layout.edges, nodeTypes: nodeTypes,
|
|
95
|
+
}, children: isMobile ? ((0, jsx_runtime_1.jsx)(MobileAccordionView_1.MobileAccordionView, { jsonData: jsonData, contentMap: contentMap, iconConfig: iconConfig, onContentUpdate: onContentUpdate, onIconDataUpdate: onIconDataUpdate, isAdmin: isAdmin, playicon: playicon })) : ((0, jsx_runtime_1.jsxs)(reactflow_1.default, { nodes: layout.nodes, edges: layout.edges, nodeTypes: nodeTypes, proOptions: { hideAttribution: true }, fitView: true, panOnScroll: true, panOnScrollMode: "free", zoomOnPinch: true, zoomOnScroll: false, panOnDrag: true, minZoom: 0.4, maxZoom: 1.6, translateExtent: [
|
|
96
|
+
[bounds.minX, bounds.minY],
|
|
97
|
+
[bounds.maxX, bounds.maxY],
|
|
98
|
+
], children: [(0, jsx_runtime_1.jsx)(reactflow_1.Controls, { showFitView: false, showInteractive: false }), (0, jsx_runtime_1.jsx)(reactflow_1.Background, { variant: "none" })] })) }));
|
|
259
99
|
};
|
|
260
100
|
exports.default = RecapGraph;
|
|
261
101
|
//# sourceMappingURL=Reactgraphflow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Reactgraphflow.js","sourceRoot":"","sources":["../../../../src/components/Organisms/RecapGraph/Reactgraphflow.jsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA4D;AAC5D,uDAA4D;AAC5D,qCAAqC;AACrC,mFAA2D;AAC3D,8EAA2E;AAC3E,
|
|
1
|
+
{"version":3,"file":"Reactgraphflow.js","sourceRoot":"","sources":["../../../../src/components/Organisms/RecapGraph/Reactgraphflow.jsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA4D;AAC5D,uDAA4D;AAC5D,qCAAqC;AACrC,mFAA2D;AAC3D,8EAA2E;AAC3E,6DAA0D;AAE1D,MAAM,UAAU,GAAG,CAAC,EAClB,QAAQ,GAAG,IAAI,EACf,UAAU,GAAG,EAAE,EACf,UAAU,GAAG,EAAE,EACf,eAAe,EACf,gBAAgB,EAChB,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,QAAQ,GAAG,EAAE,GACd,EAAE,EAAE;IACH,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAC;QACnC,KAAK,EAAE,EAAE;QACT,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,IAAI;KACb,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG,IAAA,uCAAkB,EAAC,Q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AK,EACnB,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,eAAe,EAAE;gBACf,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC;gBAC1B,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC;aAC3B,aAED,uBAAC,oBAAQ,IAAC,WAAW,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,GAAI,EACxD,uBAAC,sBAAU,IAAC,OAAO,EAAC,MAAM,GAAG,IACnB,CACb,GACG,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export function useRecapGraphLogic(jsonData: any, contentMap: any, iconConfig: any): {
|
|
2
|
+
expandedNodeId: null;
|
|
3
|
+
expandedNodeHeight: number;
|
|
4
|
+
activeExpandedNodeId: null;
|
|
5
|
+
isTransitioning: boolean;
|
|
6
|
+
expandedNodes: {};
|
|
7
|
+
contentExpanded: {};
|
|
8
|
+
displayTypes: {};
|
|
9
|
+
videoIndices: {};
|
|
10
|
+
colorMap: {};
|
|
11
|
+
getNodeColors: (nodeId: any) => {
|
|
12
|
+
headerColor: any;
|
|
13
|
+
bgColor: any;
|
|
14
|
+
colorInfo: any;
|
|
15
|
+
};
|
|
16
|
+
getNodeContent: (nodeId: any) => {
|
|
17
|
+
nodeContent: any;
|
|
18
|
+
hasContent: any;
|
|
19
|
+
};
|
|
20
|
+
buildNodes: (data: any) => any[];
|
|
21
|
+
buildEdges: (data: any, nodes: any) => any[];
|
|
22
|
+
computeCustomLayout: (inputNodes: any, inputEdges: any) => {
|
|
23
|
+
nodes: any;
|
|
24
|
+
edges: any;
|
|
25
|
+
};
|
|
26
|
+
handleChevronClick: (nodeId: any) => void;
|
|
27
|
+
handleIconClick: (nodeId: any, type: any, availableContentTypes: any) => void;
|
|
28
|
+
setCurrentVideoIdx: (nodeId: any, idxOrUpdater: any) => void;
|
|
29
|
+
};
|