diff --git a/index.html b/index.html index 313de99..d51b804 100755 --- a/index.html +++ b/index.html @@ -1,14 +1,24 @@ - - - - - - - QMolSim - - -
- - - - + + + + + + + QMolSim + + + +
+ + + diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..f1437e7 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..e543358 --- /dev/null +++ b/public/index.html @@ -0,0 +1,5975 @@ + + + + + + + + + + + +
+ + diff --git a/src/Api/PluginLoader/PluginLoader.tsx b/src/Api/PluginLoader/PluginLoader.tsx new file mode 100644 index 0000000..48e46a1 --- /dev/null +++ b/src/Api/PluginLoader/PluginLoader.tsx @@ -0,0 +1,82 @@ +import React, { useRef, useEffect, useState, useMemo } from "react"; +import { useUserPreferencesStore } from "Stores/PreferencesStore"; +import type { TaskData } from "Types/Experiment/Experiment"; + +interface IframePluginProps { + pluginUrl: string; + mode: "list" | "editor"; + taskData: TaskData; + onUpdate?: (data: any) => void; +} + +export const IframePlugin: React.FC = ({ + pluginUrl, + mode, + taskData, + onUpdate, +}) => { + const iframeRef = useRef(null); + const theme = useUserPreferencesStore(); + const [isIframeReady, setIsIframeReady] = useState(false); + + // Memoize the iframe component to prevent recreation when taskData changes + const memoizedIframe = useMemo(() => { + const url = `${pluginUrl}?mode=${mode}`; + return ( +