performanceresultscreens 0.0.26 → 0.0.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/Atoms/AssistantImageModal/ImageModal.js +2 -1
- package/dist/components/Atoms/AssistantImageModal/ImageModal.js.map +1 -1
- package/dist/components/Atoms/ExtractedDiagramView/ExtractedDiagramView.d.ts +3 -7
- package/dist/components/Atoms/ExtractedDiagramView/ExtractedDiagramView.js +37 -11
- package/dist/components/Atoms/ExtractedDiagramView/ExtractedDiagramView.js.map +1 -1
- package/dist/components/Atoms/PrivacyTouchPoint/PrivacyTouchPoint.js +2 -2
- package/dist/components/Atoms/PrivacyTouchPoint/PrivacyTouchPoint.js.map +1 -1
- package/dist/components/Atoms/TranscriptionImagePreview/ImageAnnotation.js +3 -3
- package/dist/components/Atoms/TranscriptionImagePreview/ImageAnnotation.js.map +1 -1
- package/dist/components/Atoms/TranscriptionImagePreview/ImageTranscriptionStyles.d.ts +1 -75
- package/dist/components/Atoms/TranscriptionImagePreview/ImageTranscriptionStyles.js +122 -7
- package/dist/components/Atoms/TranscriptionImagePreview/ImageTranscriptionStyles.js.map +1 -1
- package/dist/components/Atoms/TranscriptionImagePreview/TranscriptionImagePreview.js +9 -1
- package/dist/components/Atoms/TranscriptionImagePreview/TranscriptionImagePreview.js.map +1 -1
- package/dist/components/Atoms/TranscriptionImagePreview/TranscriptionImagePreview.stories.d.ts +1 -0
- package/dist/components/Atoms/TranscriptionImagePreview/TranscriptionImagePreview.stories.js +49 -1
- package/dist/components/Atoms/TranscriptionImagePreview/TranscriptionImagePreview.stories.js.map +1 -1
- package/dist/components/Molecules/AccordianPay4/Accordian.d.ts +2 -13
- package/dist/components/Molecules/AccordianPay4/Accordian.js +13 -14
- package/dist/components/Molecules/AccordianPay4/Accordian.js.map +1 -1
- package/dist/components/Molecules/AccordianPay4/Accordian.stories.js.map +1 -1
- package/dist/components/Molecules/ActivityBanner/ActivityBanner.js +12 -8
- package/dist/components/Molecules/ActivityBanner/ActivityBanner.js.map +1 -1
- package/dist/components/Molecules/DashPlayer/DashPlayer.stories.js +1 -1
- package/dist/components/Molecules/DashPlayer/DashPlayer.stories.js.map +1 -1
- package/dist/components/Molecules/DescriptiveAnswer/DescriptiveAnswerV1.js +15 -4
- package/dist/components/Molecules/DescriptiveAnswer/DescriptiveAnswerV1.js.map +1 -1
- package/dist/components/Molecules/FactualCard/FactualCard.d.ts +3 -1
- package/dist/components/Molecules/FactualCard/FactualCard.js +15 -9
- package/dist/components/Molecules/FactualCard/FactualCard.js.map +1 -1
- package/dist/components/Molecules/PerformanceScreen/PreformanceResultScreen.d.ts +1 -0
- package/dist/components/Molecules/PerformanceScreen/PreformanceResultScreen.js +31 -36
- package/dist/components/Molecules/PerformanceScreen/PreformanceResultScreen.js.map +1 -1
- package/dist/components/Molecules/PerformanceScreen/PreformanceResultScreen.stories.js +5 -4
- package/dist/components/Molecules/PerformanceScreen/PreformanceResultScreen.stories.js.map +1 -1
- package/dist/components/Molecules/PostCard/PostCard.js +4 -4
- package/dist/components/Molecules/PostCard/PostCard.js.map +1 -1
- package/dist/components/Molecules/RecapNode/ContentView.d.ts +2 -0
- package/dist/components/Molecules/RecapNode/ContentView.js +43 -0
- package/dist/components/Molecules/RecapNode/ContentView.js.map +1 -0
- package/dist/components/Molecules/RecapNode/FlashcardNode.d.ts +0 -0
- package/dist/components/Molecules/RecapNode/FlashcardNode.js +2 -0
- package/dist/components/Molecules/RecapNode/FlashcardNode.js.map +1 -0
- package/dist/components/Molecules/RecapNode/Node.d.ts +3 -0
- package/dist/components/Molecules/RecapNode/Node.js +60 -0
- package/dist/components/Molecules/RecapNode/Node.js.map +1 -0
- package/dist/components/Molecules/RecapNode/Node.stories.d.ts +10 -0
- package/dist/components/Molecules/RecapNode/Node.stories.js +117 -0
- package/dist/components/Molecules/RecapNode/Node.stories.js.map +1 -0
- package/dist/components/Molecules/RecapNode/Node.styles.d.ts +11 -0
- package/dist/components/Molecules/RecapNode/Node.styles.js +53 -0
- package/dist/components/Molecules/RecapNode/Node.styles.js.map +1 -0
- package/dist/components/Molecules/RecapNode/SectionView.d.ts +6 -0
- package/dist/components/Molecules/RecapNode/SectionView.js +92 -0
- package/dist/components/Molecules/RecapNode/SectionView.js.map +1 -0
- package/dist/components/Molecules/RecapNode/VideoView.d.ts +5 -0
- package/dist/components/Molecules/RecapNode/VideoView.js +23 -0
- package/dist/components/Molecules/RecapNode/VideoView.js.map +1 -0
- package/dist/components/Molecules/Revision/Revision.d.ts +2 -0
- package/dist/components/Molecules/Revision/Revision.js +201 -0
- package/dist/components/Molecules/Revision/Revision.js.map +1 -0
- package/dist/components/Molecules/SmartLearn/SmartLearn.js +14 -11
- package/dist/components/Molecules/SmartLearn/SmartLearn.js.map +1 -1
- package/dist/components/Molecules/SmartLearn/SmartLearn.stories.js +13 -10
- package/dist/components/Molecules/SmartLearn/SmartLearn.stories.js.map +1 -1
- package/dist/components/Molecules/SmartLearn/types.d.ts +18 -1
- package/dist/components/Molecules/Tutor/User/User.js +7 -3
- package/dist/components/Molecules/Tutor/User/User.js.map +1 -1
- package/dist/components/Molecules/VideoView/VideoModal.js +2 -2
- package/dist/components/Molecules/VideoView/VideoModal.js.map +1 -1
- package/dist/components/Molecules/comprehension/ComprehensionLayout.js +9 -5
- package/dist/components/Molecules/comprehension/ComprehensionLayout.js.map +1 -1
- package/dist/components/Molecules/comprehension/SubQuestionLayout.js +1 -1
- package/dist/components/Molecules/comprehension/SubQuestionLayout.js.map +1 -1
- package/dist/components/Molecules/optionLayouts/Scq.d.ts +2 -0
- package/dist/components/Molecules/optionLayouts/Scq.js +427 -0
- package/dist/components/Molecules/optionLayouts/Scq.js.map +1 -0
- package/dist/components/Molecules/optionLayouts/Scqnew.d.ts +2 -0
- package/dist/components/Molecules/optionLayouts/Scqnew.js +491 -0
- package/dist/components/Molecules/optionLayouts/Scqnew.js.map +1 -0
- package/dist/components/Molecules/questionLayouts/AnswerLayoutnew.d.ts +1 -0
- package/dist/components/Molecules/questionLayouts/AnswerLayoutnew.js +61 -0
- package/dist/components/Molecules/questionLayouts/AnswerLayoutnew.js.map +1 -0
- package/dist/components/Molecules/questionLayouts/AnswerView.d.ts +1 -0
- package/dist/components/Molecules/questionLayouts/AnswerView.js +66 -0
- package/dist/components/Molecules/questionLayouts/AnswerView.js.map +1 -0
- package/dist/components/Molecules/questionLayouts/Question.styles.d.ts +115 -0
- package/dist/components/Molecules/questionLayouts/Question.styles.js +119 -0
- package/dist/components/Molecules/questionLayouts/Question.styles.js.map +1 -0
- package/dist/components/Molecules/questionLayouts/QuestionLayoutnew.d.ts +2 -0
- package/dist/components/Molecules/questionLayouts/QuestionLayoutnew.js +285 -0
- package/dist/components/Molecules/questionLayouts/QuestionLayoutnew.js.map +1 -0
- package/dist/components/Molecules/questionLayouts/QuestionView.d.ts +2 -0
- package/dist/components/Molecules/questionLayouts/QuestionView.js +106 -0
- package/dist/components/Molecules/questionLayouts/QuestionView.js.map +1 -0
- package/dist/components/Molecules/questionLayouts/QuestionsLayout.js +5 -2
- package/dist/components/Molecules/questionLayouts/QuestionsLayout.js.map +1 -1
- package/dist/components/Organisms/D3Graphs/Reactflow.d.ts +1 -0
- package/dist/components/Organisms/D3Graphs/Reactflow.js +244 -0
- package/dist/components/Organisms/D3Graphs/Reactflow.js.map +1 -0
- package/dist/components/Organisms/FlashCardNode/AccordionChildItem.d.ts +1 -0
- package/dist/components/Organisms/FlashCardNode/AccordionChildItem.js +37 -0
- package/dist/components/Organisms/FlashCardNode/AccordionChildItem.js.map +1 -0
- package/dist/components/Organisms/FlashCardNode/FlashCardNode.d.ts +3 -0
- package/dist/components/Organisms/FlashCardNode/FlashCardNode.js +93 -0
- package/dist/components/Organisms/FlashCardNode/FlashCardNode.js.map +1 -0
- package/dist/components/Organisms/FlashCardNode/FlashcardContainer.d.ts +26 -0
- package/dist/components/Organisms/FlashCardNode/FlashcardContainer.js +50 -0
- package/dist/components/Organisms/FlashCardNode/FlashcardContainer.js.map +1 -0
- package/dist/components/Organisms/FlashCardNode/FlashcardNode.stories.d.ts +15 -0
- package/dist/components/Organisms/FlashCardNode/FlashcardNode.stories.js +301 -0
- package/dist/components/Organisms/FlashCardNode/FlashcardNode.stories.js.map +1 -0
- package/dist/components/Organisms/FlashCardNode/IconBar.d.ts +5 -0
- package/dist/components/Organisms/FlashCardNode/IconBar.js +22 -0
- package/dist/components/Organisms/FlashCardNode/IconBar.js.map +1 -0
- package/dist/components/Organisms/FlashCardNode/MobileAccordionView.d.ts +9 -0
- package/dist/components/Organisms/FlashCardNode/MobileAccordionView.js +32 -0
- package/dist/components/Organisms/FlashCardNode/MobileAccordionView.js.map +1 -0
- package/dist/components/Organisms/FlashCardNode/NodeHandles.d.ts +3 -0
- package/dist/components/Organisms/FlashCardNode/NodeHandles.js +22 -0
- package/dist/components/Organisms/FlashCardNode/NodeHandles.js.map +1 -0
- package/dist/components/Organisms/PostDetails/ImageGallery.js +7 -4
- package/dist/components/Organisms/PostDetails/ImageGallery.js.map +1 -1
- package/dist/components/Organisms/RecapGraph/Example.stories.d.ts +3 -0
- package/dist/components/Organisms/RecapGraph/Example.stories.js +38 -0
- package/dist/components/Organisms/RecapGraph/Example.stories.js.map +1 -0
- package/dist/components/Organisms/RecapGraph/FlashCardNode.d.ts +3 -0
- package/dist/components/Organisms/RecapGraph/FlashCardNode.js +48 -0
- package/dist/components/Organisms/RecapGraph/FlashCardNode.js.map +1 -0
- package/dist/components/Organisms/RecapGraph/IconBar.d.ts +5 -0
- package/dist/components/Organisms/RecapGraph/IconBar.js +19 -0
- package/dist/components/Organisms/RecapGraph/IconBar.js.map +1 -0
- package/dist/components/Organisms/RecapGraph/NodeHandles.d.ts +4 -0
- package/dist/components/Organisms/RecapGraph/NodeHandles.js +21 -0
- package/dist/components/Organisms/RecapGraph/NodeHandles.js.map +1 -0
- package/dist/components/Organisms/RecapGraph/Reactgraphflow.d.ts +10 -0
- package/dist/components/Organisms/RecapGraph/Reactgraphflow.js +60 -0
- package/dist/components/Organisms/RecapGraph/Reactgraphflow.js.map +1 -0
- package/dist/components/Organisms/RecapGraph/useRecapGraphLogic.d.ts +29 -0
- package/dist/components/Organisms/RecapGraph/useRecapGraphLogic.js +354 -0
- package/dist/components/Organisms/RecapGraph/useRecapGraphLogic.js.map +1 -0
- package/dist/components/Organisms/ReviewComponent/ChatPresenter.js +2 -2
- package/dist/components/Organisms/ReviewComponent/ChatPresenter.js.map +1 -1
- package/dist/components/Organisms/ReviewComponent/Review.d.ts +2 -1
- package/dist/components/Organisms/ReviewComponent/Review.js +4 -4
- package/dist/components/Organisms/ReviewComponent/Review.js.map +1 -1
- package/dist/components/Organisms/ReviewComponent/ReviewPresenter.d.ts +3 -1
- package/dist/components/Organisms/ReviewComponent/ReviewPresenter.js +4 -3
- package/dist/components/Organisms/ReviewComponent/ReviewPresenter.js.map +1 -1
- package/dist/components/Organisms/StudentEditor/components/EditorComponent.d.ts +6 -0
- package/dist/components/Organisms/StudentEditor/components/EditorComponent.js +154 -0
- package/dist/components/Organisms/StudentEditor/components/EditorComponent.js.map +1 -0
- package/dist/components/Organisms/StudentEditor/components/MathModal.js +3 -0
- package/dist/components/Organisms/StudentEditor/components/MathModal.js.map +1 -1
- package/dist/components/Organisms/StudentEditor/components/TextEditor.js +24 -15
- package/dist/components/Organisms/StudentEditor/components/TextEditor.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/RecapData.d.ts +113 -0
- package/dist/utils/RecapData.js +1093 -0
- package/dist/utils/RecapData.js.map +1 -0
- package/dist/utils/accordionConstants.d.ts +15 -0
- package/dist/utils/accordionConstants.js +23 -0
- package/dist/utils/accordionConstants.js.map +1 -0
- package/dist/utils/common-utils.js +4 -0
- package/dist/utils/common-utils.js.map +1 -1
- package/dist/utils/contentUtils.d.ts +41 -0
- package/dist/utils/contentUtils.js +60 -0
- package/dist/utils/contentUtils.js.map +1 -0
- package/dist/utils/revision-utils.d.ts +13 -0
- package/dist/utils/revision-utils.js +90 -0
- package/dist/utils/revision-utils.js.map +1 -0
- package/package.json +5 -2
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DefaultTimerClock = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const RecapData_1 = require("../../../utils/RecapData");
|
|
9
|
+
const Reactgraphflow_1 = __importDefault(require("./Reactgraphflow"));
|
|
10
|
+
const defination_svg_1 = __importDefault(require("../../../assests/revision/defination.svg"));
|
|
11
|
+
const formula_svg_1 = __importDefault(require("../../../assests/revision/formula.svg"));
|
|
12
|
+
const videoplay_svg_1 = __importDefault(require("../../../assests/revision/videoplay.svg"));
|
|
13
|
+
const equations_svg_1 = __importDefault(require("../../../assests/revision/equations.svg"));
|
|
14
|
+
exports.default = {
|
|
15
|
+
title: "Components/Organisms/Graph/ReactFlowELKView",
|
|
16
|
+
component: Reactgraphflow_1.default,
|
|
17
|
+
};
|
|
18
|
+
const Template = (args) => (0, jsx_runtime_1.jsx)(Reactgraphflow_1.default, { ...args });
|
|
19
|
+
const customIcons = [
|
|
20
|
+
{ src: equations_svg_1.default, type: "equations" },
|
|
21
|
+
{ src: videoplay_svg_1.default, type: "videos" },
|
|
22
|
+
{ src: formula_svg_1.default, type: "formula" },
|
|
23
|
+
{ src: defination_svg_1.default, type: "definitions" },
|
|
24
|
+
];
|
|
25
|
+
console.log("content:", RecapData_1.contentMap);
|
|
26
|
+
exports.DefaultTimerClock = Template.bind({});
|
|
27
|
+
exports.DefaultTimerClock.args = {
|
|
28
|
+
jsonData: RecapData_1.jsonData,
|
|
29
|
+
contentMap: RecapData_1.contentMap,
|
|
30
|
+
iconConfig: customIcons,
|
|
31
|
+
onContentUpdate: (payload) => {
|
|
32
|
+
console.log("onContentUpdate payload:", payload);
|
|
33
|
+
},
|
|
34
|
+
onIconDataUpdate: () => { },
|
|
35
|
+
isAdmin: true,
|
|
36
|
+
isMobile: true,
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=Example.stories.js.map
|
|
@@ -0,0 +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,8FAAsE;AACtE,wFAAgE;AAChE,4FAAoE;AACpE,4FAAmE;AAEnE,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,SAAS,EAAE;IACrC,EAAE,GAAG,EAAE,wBAAc,EAAE,IAAI,EAAE,aAAa,EAAE;CAC7C,CAAC;AACF,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,sBAAU,CAAC,CAAC;AAEvB,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,IAAI;CACf,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const react_2 = require("@chakra-ui/react");
|
|
29
|
+
const ContentView_1 = require("../../Molecules/RecapNode/ContentView");
|
|
30
|
+
const NodeHandles_1 = require("./NodeHandles");
|
|
31
|
+
const IconBar_1 = require("./IconBar");
|
|
32
|
+
const contentUtils_1 = require("../../../utils/contentUtils");
|
|
33
|
+
const FlashcardNode = (0, react_1.memo)(({ data }) => {
|
|
34
|
+
const [currentVideoIdx, setCurrentVideoIdx] = (0, react_1.useState)(0);
|
|
35
|
+
const [isExpanded, setIsExpanded] = (0, react_1.useState)(false);
|
|
36
|
+
const { hasContent, level, hasMultipleChildren, color, label, icons = [], content } = data;
|
|
37
|
+
const availableTypes = (0, contentUtils_1.getAvailableContentTypes)(content);
|
|
38
|
+
const [displayType, setDisplayType] = (0, react_1.useState)(availableTypes[0] || null);
|
|
39
|
+
const availableIcons = icons.filter(icon => availableTypes.includes(icon.type));
|
|
40
|
+
const handleIconClick = (iconType) => {
|
|
41
|
+
setIsExpanded(true);
|
|
42
|
+
setDisplayType(iconType);
|
|
43
|
+
};
|
|
44
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { minWidth: "280px", maxWidth: "350px", zIndex: "10" }, children: [(0, jsx_runtime_1.jsx)(NodeHandles_1.NodeHandles, { level: level, hasMultipleChildren: hasMultipleChildren }), (0, jsx_runtime_1.jsxs)(react_2.Box, { p: "4px", bg: "#FFE0DD", borderRadius: "4px", children: [(0, jsx_runtime_1.jsxs)(react_2.Flex, { bg: color, p: "8px 12px", align: "center", borderRadius: "4px", justify: "space-between", gap: "12px", children: [(0, jsx_runtime_1.jsx)(react_2.Box, { w: "100%", children: (0, jsx_runtime_1.jsx)(react_2.Text, { fontFamily: "Inter", fontWeight: "600", fontSize: "12px", children: label }) }), hasContent && ((0, jsx_runtime_1.jsx)(IconBar_1.IconBar, { icons: availableIcons, displayType: displayType, onIconClick: handleIconClick }))] }), hasContent && isExpanded && ((0, jsx_runtime_1.jsx)(react_2.Box, { p: "12px", fontSize: "13px", lineHeight: "1.6", borderRadius: "4px", bg: "#fff", mt: "8px", children: (0, jsx_runtime_1.jsx)(ContentView_1.ContentView, { displayType: displayType, content: content, currentVideoIdx: currentVideoIdx, setCurrentVideoIdx: setCurrentVideoIdx }) }))] })] }));
|
|
45
|
+
});
|
|
46
|
+
FlashcardNode.displayName = 'FlashcardNode';
|
|
47
|
+
exports.default = FlashcardNode;
|
|
48
|
+
//# sourceMappingURL=FlashCardNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlashCardNode.js","sourceRoot":"","sources":["../../../../src/components/Organisms/RecapGraph/FlashCardNode.jsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA8C;AAC9C,4CAAmD;AACnD,uEAAoE;AACpE,+CAA4C;AAC5C,uCAAoC;AACpC,8DAAuE;AAEvE,MAAM,aAAa,GAAG,IAAA,YAAI,EAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;IACtC,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,IAAA,gBAAQ,EAAC,CAAC,CAAC,CAAC;IAC1D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAEpD,MAAM,EACJ,UAAU,EACV,KAAK,EACL,mBAAmB,EACnB,KAAK,EACL,KAAK,EACL,KAAK,GAAG,EAAE,EACV,OAAO,EACR,GAAG,IAAI,CAAC;IAET,MAAM,cAAc,GAAG,IAAA,uCAAwB,EAAC,OAAO,CAAC,CAAC;IACzD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAC,cAAc,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC;IAE1E,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAEhF,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,EAAE;QACnC,aAAa,CAAC,IAAI,CAAC,CAAC;QACpB,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC,CAAC;IAEF,OAAO,CACL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importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.IconBar = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const react_2 = require("@chakra-ui/react");
|
|
10
|
+
const IconBar = ({ icons, displayType, onIconClick }) => {
|
|
11
|
+
if (!icons || icons.length === 0)
|
|
12
|
+
return null;
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(react_2.Flex, { align: "center", gap: "6px", flexShrink: 0, children: icons.map((iconObj, i) => ((0, jsx_runtime_1.jsx)(react_2.Flex, { w: "26px", h: "26px", borderRadius: "4px", align: "center", justify: "center", cursor: "pointer", onClick: (e) => {
|
|
14
|
+
e.stopPropagation();
|
|
15
|
+
onIconClick(iconObj.type);
|
|
16
|
+
}, opacity: displayType === iconObj.type ? 1 : 0.4, transition: "opacity 0.2s", _hover: { transform: "scale(1.1)" }, children: (0, jsx_runtime_1.jsx)(react_2.Image, { src: iconObj.src, w: "14px", h: "14px", alt: iconObj.type }) }, i))) }));
|
|
17
|
+
};
|
|
18
|
+
exports.IconBar = IconBar;
|
|
19
|
+
//# sourceMappingURL=IconBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconBar.js","sourceRoot":"","sources":["../../../../src/components/Organisms/RecapGraph/IconBar.jsx"],"names":[],"mappings":";;;;;;;AAAA,kDAA0B;AAC1B,4CAA+C;AAExC,MAAM,OAAO,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,EAAE;IAC7D,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAE9C,OAAO,CACL,uBAAC,YAAI,IAAC,KAAK,EAAC,QAAQ,EAAC,GAAG,EAAC,KAAK,EAAC,UAAU,EAAE,CAAC,YACzC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CACzB,uBAAC,YAAI,IAEH,CAAC,EAAC,MAAM,EACR,CAAC,EAAC,MAAM,EACR,YAAY,EAAC,KAAK,EAClB,KAAK,EAAC,QAAQ,EACd,OAAO,EAAC,QAAQ,EAChB,MAAM,EAAC,SAAS,EAChB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;gBACb,CAAC,CAAC,eAAe,EAAE,CAAC;gBACpB,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAC5B,CAAC,EACD,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAC/C,UAAU,EAAC,cAAc,EACzB,MAAM,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,YAEnC,uBAAC,aAAK,IAAC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,EAAC,MAAM,EAAC,CAAC,EAAC,MAAM,EAAC,GAAG,EAAE,OAAO,CAAC,IAAI,GAAI,IAf3D,CAAC,CAgBD,CACR,CAAC,GACG,CACR,CAAC;AACJ,CAAC,CAAC;AA3BW,QAAA,OAAO,WA2BlB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NodeHandles = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const reactflow_1 = require("reactflow");
|
|
10
|
+
const NodeHandles = ({ level, hasMultipleChildren }) => {
|
|
11
|
+
const isRoot = level === 0;
|
|
12
|
+
const isLevel1 = level === 1;
|
|
13
|
+
const isLevel2Plus = level >= 2;
|
|
14
|
+
const shouldShowTopHandle = isLevel1 || (isLevel2Plus && !hasMultipleChildren);
|
|
15
|
+
const shouldShowLeftHandle = isLevel2Plus && hasMultipleChildren;
|
|
16
|
+
const shouldShowBottomHandle = isRoot || isLevel1 || (isLevel2Plus && !hasMultipleChildren);
|
|
17
|
+
const shouldShowRightHandle = isLevel2Plus && hasMultipleChildren;
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [shouldShowTopHandle && ((0, jsx_runtime_1.jsx)(reactflow_1.Handle, { type: "target", position: reactflow_1.Position.Top, style: { background: "#555" }, id: "top" })), shouldShowLeftHandle && ((0, jsx_runtime_1.jsx)(reactflow_1.Handle, { type: "target", position: reactflow_1.Position.Left, style: { background: "#555" }, id: "left" })), shouldShowBottomHandle && ((0, jsx_runtime_1.jsx)(reactflow_1.Handle, { type: "source", position: reactflow_1.Position.Bottom, style: { background: "#555" }, id: "bottom" })), shouldShowRightHandle && ((0, jsx_runtime_1.jsx)(reactflow_1.Handle, { type: "source", position: reactflow_1.Position.Right, style: { background: "#555" }, id: "right" }))] }));
|
|
19
|
+
};
|
|
20
|
+
exports.NodeHandles = NodeHandles;
|
|
21
|
+
//# sourceMappingURL=NodeHandles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NodeHandles.js","sourceRoot":"","sources":["../../../../src/components/Organisms/RecapGraph/NodeHandles.jsx"],"names":[],"mappings":";;;;;;;AAAA,kDAA0B;AAC1B,yCAA6C;AAEtC,MAAM,WAAW,GAAG,CAAC,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAAE,EAAE;IAC5D,MAAM,MAAM,GAAG,KAAK,KAAK,CAAC,CAAC;IAC3B,MAAM,QAAQ,GAAG,KAAK,KAAK,CAAC,CAAC;IAC7B,MAAM,YAAY,GAAG,KAAK,IAAI,CAAC,CAAC;IAEhC,MAAM,mBAAmB,GAAG,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
|
+
jsonData?: null | undefined;
|
|
4
|
+
contentMap?: {} | undefined;
|
|
5
|
+
iconConfig?: any[] | undefined;
|
|
6
|
+
onContentUpdate: any;
|
|
7
|
+
onIconDataUpdate: any;
|
|
8
|
+
isAdmin?: boolean | undefined;
|
|
9
|
+
isMobile: any;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const reactflow_1 = __importStar(require("reactflow"));
|
|
32
|
+
// import "reactflow/dist/style.css";
|
|
33
|
+
const FlashCardNode_1 = __importDefault(require("../FlashCardNode/FlashCardNode"));
|
|
34
|
+
const MobileAccordionView_1 = require("../FlashCardNode/MobileAccordionView");
|
|
35
|
+
const useRecapGraphLogic_1 = require("./useRecapGraphLogic");
|
|
36
|
+
const RecapGraph = ({ jsonData = null, contentMap = {}, iconConfig = [], onContentUpdate, onIconDataUpdate, isAdmin = false, isMobile, }) => {
|
|
37
|
+
const [layout, setLayout] = (0, react_1.useState)({ nodes: [], edges: [] });
|
|
38
|
+
const logic = (0, useRecapGraphLogic_1.useRecapGraphLogic)(jsonData, contentMap, iconConfig);
|
|
39
|
+
const nodeTypes = (0, react_1.useMemo)(() => ({
|
|
40
|
+
flashcard: (props) => ((0, jsx_runtime_1.jsx)(FlashCardNode_1.default, { ...props, rootNodeId: jsonData?._id, onContentUpdate: onContentUpdate, onIconDataUpdate: onIconDataUpdate, isAdmin: isAdmin, isMobile: isMobile })),
|
|
41
|
+
}), [onContentUpdate, onIconDataUpdate, isAdmin, isMobile, jsonData?._id]);
|
|
42
|
+
const graphData = (0, react_1.useMemo)(() => {
|
|
43
|
+
if (!jsonData)
|
|
44
|
+
return { nodes: [], edges: [] };
|
|
45
|
+
const nodes = logic.buildNodes(jsonData);
|
|
46
|
+
const edges = logic.buildEdges(jsonData, nodes);
|
|
47
|
+
return { nodes, edges };
|
|
48
|
+
}, [jsonData, contentMap, iconConfig, logic.activeExpandedNodeId]);
|
|
49
|
+
(0, react_1.useEffect)(() => {
|
|
50
|
+
const res = logic.computeCustomLayout(graphData.nodes, graphData.edges);
|
|
51
|
+
setLayout(res);
|
|
52
|
+
}, [graphData, jsonData, logic.expandedNodeId, logic.expandedNodeHeight]);
|
|
53
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
54
|
+
width: isAdmin ? "100vw" : "",
|
|
55
|
+
height: isAdmin ? "100vh" : "90%",
|
|
56
|
+
backgroundColor: "#f8fafc",
|
|
57
|
+
}, 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, fitView: true, proOptions: { hideAttribution: true }, zoomOnScroll: true, panOnDrag: true, selectionOnDrag: false, elementsSelectable: true, nodesConnectable: false, children: [(0, jsx_runtime_1.jsx)(reactflow_1.Controls, { showFitView: false, showInteractive: false }), (0, jsx_runtime_1.jsx)(reactflow_1.Background, { variant: "none" })] })) }));
|
|
58
|
+
};
|
|
59
|
+
exports.default = RecapGraph;
|
|
60
|
+
//# sourceMappingURL=Reactgraphflow.js.map
|
|
@@ -0,0 +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,6DAA0D;AAC1D,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,GACT,EAAE,EAAE;IACH,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAC,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAE/D,MAAM,KAAK,GAAG,IAAA,uCAAkB,E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ACL,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YAC7B,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK;YACjC,eAAe,EAAE,SAAS;SAC3B,YAEA,QAAQ,CAAC,CAAC,CAAC,CACV,uBAAC,yCAAmB,IAClB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,OAAO,GAChB,CACH,CAAC,CAAC,CAAC,CACF,wBAAC,mBAAS,IACR,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,KAAK,EAAE,MAAM,CAAC,KAAK,EACnB,SAAS,EAAE,SAAS,EACpB,OAAO,QACP,UAAU,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EACrC,YAAY,QACZ,SAAS,QACT,eAAe,EAAE,KAAK,EACtB,kBAAkB,EAAE,IAAI,EACxB,gBAAgB,EAAE,KAAK,aAEvB,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, idx: any) => void;
|
|
29
|
+
};
|
|
@@ -0,0 +1,354 @@
|
|
|
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
|
|
48
|
+
? contentUtils_1.COLOR_MAP.root
|
|
49
|
+
: contentUtils_1.COLOR_MAP[colorInfo.colorKey];
|
|
50
|
+
const bgColor = colorInfo.level === 0
|
|
51
|
+
? contentUtils_1.LIGHT_COLOR_MAP.root
|
|
52
|
+
: contentUtils_1.LIGHT_COLOR_MAP[colorInfo.colorKey];
|
|
53
|
+
return { headerColor, bgColor, colorInfo };
|
|
54
|
+
};
|
|
55
|
+
// Check if node has content
|
|
56
|
+
const getNodeContent = (nodeId) => {
|
|
57
|
+
const nodeContent = contentMap[nodeId] || null;
|
|
58
|
+
const hasContent = nodeContent &&
|
|
59
|
+
((nodeContent.videos && nodeContent.videos.length > 0) ||
|
|
60
|
+
(nodeContent.recap && Object.keys(nodeContent.recap).length > 0));
|
|
61
|
+
return { nodeContent, hasContent };
|
|
62
|
+
};
|
|
63
|
+
// Build nodes for RecapGraph
|
|
64
|
+
const buildNodes = (data) => {
|
|
65
|
+
const nodes = [];
|
|
66
|
+
let level1ColorIndex = 0;
|
|
67
|
+
const processNode = (nodeData, lvl, parentColorKey = null) => {
|
|
68
|
+
let colorKey, nodeColor;
|
|
69
|
+
if (lvl === 0) {
|
|
70
|
+
colorKey = "root";
|
|
71
|
+
nodeColor = contentUtils_1.COLOR_MAP.root;
|
|
72
|
+
}
|
|
73
|
+
else if (lvl === 1) {
|
|
74
|
+
colorKey = String(level1ColorIndex % 8);
|
|
75
|
+
nodeColor = contentUtils_1.COLOR_MAP[colorKey];
|
|
76
|
+
level1ColorIndex++;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
colorKey = parentColorKey;
|
|
80
|
+
nodeColor = contentUtils_1.LIGHT_COLOR_MAP[colorKey];
|
|
81
|
+
}
|
|
82
|
+
const { hasContent } = getNodeContent(nodeData._id);
|
|
83
|
+
nodes.push({
|
|
84
|
+
id: nodeData._id,
|
|
85
|
+
type: "flashcard",
|
|
86
|
+
data: {
|
|
87
|
+
id: nodeData._id,
|
|
88
|
+
label: nodeData?.description,
|
|
89
|
+
color: nodeColor,
|
|
90
|
+
content: contentMap[nodeData._id] || null,
|
|
91
|
+
hasContent,
|
|
92
|
+
bgColor: contentUtils_1.LIGHT_COLOR_MAP[colorKey],
|
|
93
|
+
colorKey,
|
|
94
|
+
level: lvl,
|
|
95
|
+
hasMultipleChildren: nodeData.children?.length > 1,
|
|
96
|
+
icons: iconConfig,
|
|
97
|
+
onExpandChange: (nodeId, isExpanded, height) => {
|
|
98
|
+
setIsTransitioning(true);
|
|
99
|
+
if (isExpanded) {
|
|
100
|
+
setExpandedNodeId(nodeId);
|
|
101
|
+
setExpandedNodeHeight(height);
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
setExpandedNodeId(null);
|
|
105
|
+
setExpandedNodeHeight(0);
|
|
106
|
+
}
|
|
107
|
+
const timer = setTimeout(() => {
|
|
108
|
+
setIsTransitioning(false);
|
|
109
|
+
}, 350);
|
|
110
|
+
return () => clearTimeout(timer);
|
|
111
|
+
},
|
|
112
|
+
onNodeExpand: (nodeId) => {
|
|
113
|
+
setIsTransitioning(true);
|
|
114
|
+
setActiveExpandedNodeId(nodeId);
|
|
115
|
+
},
|
|
116
|
+
shouldClose: activeExpandedNodeId !== null &&
|
|
117
|
+
activeExpandedNodeId !== nodeData._id,
|
|
118
|
+
},
|
|
119
|
+
position: { x: 0, y: 0 },
|
|
120
|
+
draggable: false,
|
|
121
|
+
style: {
|
|
122
|
+
zIndex: 1,
|
|
123
|
+
transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
nodeData.children?.forEach((child) => processNode(child, lvl + 1, colorKey));
|
|
127
|
+
};
|
|
128
|
+
if (data)
|
|
129
|
+
processNode(data, 0);
|
|
130
|
+
return nodes;
|
|
131
|
+
};
|
|
132
|
+
// Build edges for RecapGraph
|
|
133
|
+
const buildEdges = (data, nodes) => {
|
|
134
|
+
const edges = [];
|
|
135
|
+
const nodeColorMap = {};
|
|
136
|
+
nodes.forEach((n) => {
|
|
137
|
+
nodeColorMap[n.id] = n.data.color;
|
|
138
|
+
});
|
|
139
|
+
const processNode = (nodeData, parentLevel = 0) => {
|
|
140
|
+
const hasMultipleChildren = (nodeData.children?.length || 0) > 1;
|
|
141
|
+
nodeData.children?.forEach((child) => {
|
|
142
|
+
const sourceColor = nodeColorMap[nodeData._id] || "#94a3b8";
|
|
143
|
+
let sourceHandle = "bottom";
|
|
144
|
+
let targetHandle = "top";
|
|
145
|
+
if (parentLevel >= 1 && hasMultipleChildren) {
|
|
146
|
+
targetHandle = "left";
|
|
147
|
+
}
|
|
148
|
+
else if (parentLevel >= 1) {
|
|
149
|
+
targetHandle = "top";
|
|
150
|
+
}
|
|
151
|
+
edges.push({
|
|
152
|
+
id: `${nodeData._id}-${child._id}`,
|
|
153
|
+
source: nodeData._id,
|
|
154
|
+
target: child._id,
|
|
155
|
+
sourceHandle,
|
|
156
|
+
targetHandle,
|
|
157
|
+
type: "bezier",
|
|
158
|
+
style: { stroke: sourceColor, strokeWidth: 2 },
|
|
159
|
+
markerEnd: {
|
|
160
|
+
type: "arrowclosed",
|
|
161
|
+
color: sourceColor,
|
|
162
|
+
width: 10,
|
|
163
|
+
height: 10,
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
processNode(child, parentLevel + 1);
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
if (data)
|
|
170
|
+
processNode(data, 0);
|
|
171
|
+
return edges;
|
|
172
|
+
};
|
|
173
|
+
// Compute layout for RecapGraph
|
|
174
|
+
const computeCustomLayout = (inputNodes, inputEdges) => {
|
|
175
|
+
if (!inputNodes.length || !jsonData)
|
|
176
|
+
return { nodes: [], edges: [] };
|
|
177
|
+
const NODE_WIDTH = 390;
|
|
178
|
+
const NODE_HEIGHT = 80;
|
|
179
|
+
const HORIZONTAL_SPACING = 240;
|
|
180
|
+
const VERTICAL_SPACING = 120;
|
|
181
|
+
const VERTICAL_STACK_SPACING = 30;
|
|
182
|
+
const HORIZONTAL_OFFSET = 225;
|
|
183
|
+
const positions = {};
|
|
184
|
+
const childrenMap = {};
|
|
185
|
+
const levelMap = {};
|
|
186
|
+
const nodeHeights = {};
|
|
187
|
+
inputNodes.forEach((n) => {
|
|
188
|
+
if (n.id === expandedNodeId) {
|
|
189
|
+
nodeHeights[n.id] = NODE_HEIGHT + expandedNodeHeight + 100;
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
nodeHeights[n.id] = NODE_HEIGHT;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
const buildMaps = (node, level = 0, parentId = null) => {
|
|
196
|
+
levelMap[node._id] = level;
|
|
197
|
+
if (parentId) {
|
|
198
|
+
if (!childrenMap[parentId])
|
|
199
|
+
childrenMap[parentId] = [];
|
|
200
|
+
childrenMap[parentId].push(node._id);
|
|
201
|
+
}
|
|
202
|
+
if (node.children) {
|
|
203
|
+
node.children.forEach((child) => buildMaps(child, level + 1, node._id));
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
buildMaps(jsonData);
|
|
207
|
+
const subtreeWidths = {};
|
|
208
|
+
const subtreeHeights = {};
|
|
209
|
+
const calcSubtreeDimensions = (nodeId) => {
|
|
210
|
+
const children = childrenMap[nodeId] || [];
|
|
211
|
+
const level = levelMap[nodeId];
|
|
212
|
+
const currentNodeHeight = nodeHeights[nodeId];
|
|
213
|
+
if (children.length === 0) {
|
|
214
|
+
subtreeWidths[nodeId] = NODE_WIDTH;
|
|
215
|
+
subtreeHeights[nodeId] = currentNodeHeight;
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
const hasMultipleChildren = children.length > 1;
|
|
219
|
+
if (level >= 1 && hasMultipleChildren) {
|
|
220
|
+
children.forEach((childId) => calcSubtreeDimensions(childId));
|
|
221
|
+
const maxChildWidth = Math.max(...children.map((cid) => subtreeWidths[cid]));
|
|
222
|
+
const totalHeight = children.reduce((sum, cid) => sum + subtreeHeights[cid], 0);
|
|
223
|
+
const spacing = (children.length - 1) * VERTICAL_STACK_SPACING;
|
|
224
|
+
subtreeWidths[nodeId] = NODE_WIDTH + HORIZONTAL_OFFSET + maxChildWidth;
|
|
225
|
+
subtreeHeights[nodeId] = Math.max(currentNodeHeight, totalHeight + spacing);
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
children.forEach((childId) => calcSubtreeDimensions(childId));
|
|
229
|
+
const childrenTotalWidth = children.reduce((sum, cid) => sum + subtreeWidths[cid], 0);
|
|
230
|
+
const spacing = (children.length - 1) * HORIZONTAL_SPACING;
|
|
231
|
+
subtreeWidths[nodeId] = Math.max(NODE_WIDTH, childrenTotalWidth + spacing);
|
|
232
|
+
subtreeHeights[nodeId] = currentNodeHeight;
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
const getAllNodeIds = (node) => {
|
|
236
|
+
let ids = [node._id];
|
|
237
|
+
if (node.children) {
|
|
238
|
+
node.children.forEach((child) => {
|
|
239
|
+
ids = ids.concat(getAllNodeIds(child));
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
return ids;
|
|
243
|
+
};
|
|
244
|
+
getAllNodeIds(jsonData).forEach((id) => calcSubtreeDimensions(id));
|
|
245
|
+
const positionNodes = () => {
|
|
246
|
+
positions[jsonData._id] = { x: 0, y: 0 };
|
|
247
|
+
const level1Children = childrenMap[jsonData._id] || [];
|
|
248
|
+
if (level1Children.length === 0)
|
|
249
|
+
return;
|
|
250
|
+
const totalWidth = level1Children.length * NODE_WIDTH;
|
|
251
|
+
const totalSpacing = (level1Children.length - 1) * HORIZONTAL_SPACING;
|
|
252
|
+
const fullWidth = totalWidth + totalSpacing;
|
|
253
|
+
let currentX = -fullWidth / 2;
|
|
254
|
+
const level1Y = nodeHeights[jsonData._id] + VERTICAL_SPACING;
|
|
255
|
+
level1Children.forEach((childId) => {
|
|
256
|
+
positions[childId] = {
|
|
257
|
+
x: currentX + NODE_WIDTH / 2,
|
|
258
|
+
y: level1Y,
|
|
259
|
+
};
|
|
260
|
+
currentX += NODE_WIDTH + HORIZONTAL_SPACING;
|
|
261
|
+
});
|
|
262
|
+
const positionSubtree = (parentId) => {
|
|
263
|
+
const children = childrenMap[parentId] || [];
|
|
264
|
+
if (children.length === 0)
|
|
265
|
+
return;
|
|
266
|
+
const parentPos = positions[parentId];
|
|
267
|
+
const parentLevel = levelMap[parentId];
|
|
268
|
+
const hasMultipleChildren = children.length > 1;
|
|
269
|
+
if (parentLevel >= 1 && hasMultipleChildren) {
|
|
270
|
+
let currentY = parentPos.y + nodeHeights[parentId] + VERTICAL_SPACING - 80;
|
|
271
|
+
const childX = parentPos.x + HORIZONTAL_OFFSET;
|
|
272
|
+
children.forEach((childId) => {
|
|
273
|
+
positions[childId] = {
|
|
274
|
+
x: childX,
|
|
275
|
+
y: currentY,
|
|
276
|
+
};
|
|
277
|
+
currentY += nodeHeights[childId] + VERTICAL_STACK_SPACING;
|
|
278
|
+
positionSubtree(childId);
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
const childrenTotalWidth = children.reduce((sum, cid) => sum + subtreeWidths[cid], 0);
|
|
283
|
+
const spacing = (children.length - 1) * HORIZONTAL_SPACING;
|
|
284
|
+
const fullChildrenWidth = childrenTotalWidth + spacing;
|
|
285
|
+
let childX = parentPos.x - fullChildrenWidth / 2;
|
|
286
|
+
const childY = parentPos.y + nodeHeights[parentId] + VERTICAL_SPACING;
|
|
287
|
+
children.forEach((childId) => {
|
|
288
|
+
const childWidth = subtreeWidths[childId];
|
|
289
|
+
positions[childId] = {
|
|
290
|
+
x: childX + childWidth / 2,
|
|
291
|
+
y: childY,
|
|
292
|
+
};
|
|
293
|
+
positionSubtree(childId);
|
|
294
|
+
childX += childWidth + HORIZONTAL_SPACING;
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
level1Children.forEach((childId) => positionSubtree(childId));
|
|
299
|
+
};
|
|
300
|
+
positionNodes();
|
|
301
|
+
const layoutNodes = inputNodes.map((n) => ({
|
|
302
|
+
...n,
|
|
303
|
+
position: positions[n.id] || { x: 0, y: 0 },
|
|
304
|
+
}));
|
|
305
|
+
return { nodes: layoutNodes, edges: inputEdges };
|
|
306
|
+
};
|
|
307
|
+
// Event handlers for mobile accordion view
|
|
308
|
+
const handleChevronClick = (nodeId) => {
|
|
309
|
+
setExpandedNodes((prev) => ({
|
|
310
|
+
...prev,
|
|
311
|
+
[nodeId]: !prev[nodeId],
|
|
312
|
+
}));
|
|
313
|
+
};
|
|
314
|
+
const handleIconClick = (nodeId, type, availableContentTypes) => {
|
|
315
|
+
const isSame = displayTypes[nodeId] === type;
|
|
316
|
+
setContentExpanded((prev) => ({
|
|
317
|
+
...prev,
|
|
318
|
+
[nodeId]: isSame ? !prev[nodeId] : true,
|
|
319
|
+
}));
|
|
320
|
+
setDisplayTypes((prev) => ({
|
|
321
|
+
...prev,
|
|
322
|
+
[nodeId]: type,
|
|
323
|
+
}));
|
|
324
|
+
};
|
|
325
|
+
const setCurrentVideoIdx = (nodeId, idx) => {
|
|
326
|
+
setVideoIndices((prev) => ({
|
|
327
|
+
...prev,
|
|
328
|
+
[nodeId]: idx,
|
|
329
|
+
}));
|
|
330
|
+
};
|
|
331
|
+
return {
|
|
332
|
+
// State
|
|
333
|
+
expandedNodeId,
|
|
334
|
+
expandedNodeHeight,
|
|
335
|
+
activeExpandedNodeId,
|
|
336
|
+
isTransitioning,
|
|
337
|
+
expandedNodes,
|
|
338
|
+
contentExpanded,
|
|
339
|
+
displayTypes,
|
|
340
|
+
videoIndices,
|
|
341
|
+
colorMap,
|
|
342
|
+
// Methods
|
|
343
|
+
getNodeColors,
|
|
344
|
+
getNodeContent,
|
|
345
|
+
buildNodes,
|
|
346
|
+
buildEdges,
|
|
347
|
+
computeCustomLayout,
|
|
348
|
+
handleChevronClick,
|
|
349
|
+
handleIconClick,
|
|
350
|
+
setCurrentVideoIdx,
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
exports.useRecapGraphLogic = useRecapGraphLogic;
|
|
354
|
+
//# sourceMappingURL=useRecapGraphLogic.js.map
|