diff --git a/.vscode/settings.json b/.vscode/settings.json index 3a595b0..65876d1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,6 +12,7 @@ "Karim", "katex", "Latext", + "mathml", "Popconfirm", "queryqlent", "registraion", diff --git a/index.html b/index.html index a28d54b..b0ccb01 100644 --- a/index.html +++ b/index.html @@ -4,9 +4,9 @@ - - - + + + =v12.22.7" } }, + "node_modules/saxon-js": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/saxon-js/-/saxon-js-2.6.0.tgz", + "integrity": "sha512-4dinQEGz/OQX0cnmwLTbjVFY9KciMGRyfA6AUsMCO/mKDOwDxOJFmzoLStieTpEiOB/98E1E4VKV1ElsiD88yQ==", + "dependencies": { + "axios": "^1.5.1" + } + }, "node_modules/scheduler": { "version": "0.23.2", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", @@ -14568,6 +14605,11 @@ "csstype": "^3.0.2" } }, + "domino": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/domino/-/domino-2.1.6.tgz", + "integrity": "sha512-3VdM/SXBZX2omc9JF9nOPCtDaYQ67BGp5CoLpIQlO2KCAPETs8TcDHacF26jXadGbvUteZzRTeos2fhID5+ucQ==" + }, "ejs": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", @@ -16451,6 +16493,11 @@ "remove-accents": "0.5.0" } }, + "mathjax": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/mathjax/-/mathjax-3.2.2.tgz", + "integrity": "sha512-Bt+SSVU8eBG27zChVewOicYs7Xsdt40qm4+UpHyX7k0/O9NliPc+x77k1/FEsPsjKPZGJvtRZM1vO+geW0OhGw==" + }, "mathjax-full": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/mathjax-full/-/mathjax-full-3.2.2.tgz", @@ -16470,6 +16517,14 @@ "@xmldom/xmldom": "^0.8.10" } }, + "mathml2latex": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/mathml2latex/-/mathml2latex-1.1.3.tgz", + "integrity": "sha512-/ykNcqkOyxl3V2U/avnMMK0BHGASbQZzsLJU6f98BdP96XR6VXcpRarfpRM3Td7hxHomr7JK5XDC4Enzbhy6/g==", + "requires": { + "domino": "^2.1.6" + } + }, "memoize-one": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz", @@ -16545,6 +16600,14 @@ "resolved": "https://registry.npmjs.org/mj-context-menu/-/mj-context-menu-0.6.1.tgz", "integrity": "sha512-7NO5s6n10TIV96d4g2uDpG7ZDpIhMh0QNfGdJw/W47JswFcosz457wqz/b5sAKvl12sxINGFCn80NZHKwxQEXA==" }, + "mml2tex": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/mml2tex/-/mml2tex-0.0.2.tgz", + "integrity": "sha512-GQkRPDSKjYjCS8zV1CrysqdzHwiB8hrIKdp2kRyTsvAN1MA95eGQbO0hNawwHS1B8sAHfRqbcFon4d8FUZQHqQ==", + "requires": { + "saxon-js": "^2.0.2" + } + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -17766,6 +17829,14 @@ "xmlchars": "^2.2.0" } }, + "saxon-js": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/saxon-js/-/saxon-js-2.6.0.tgz", + "integrity": "sha512-4dinQEGz/OQX0cnmwLTbjVFY9KciMGRyfA6AUsMCO/mKDOwDxOJFmzoLStieTpEiOB/98E1E4VKV1ElsiD88yQ==", + "requires": { + "axios": "^1.5.1" + } + }, "scheduler": { "version": "0.23.2", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", diff --git a/package.json b/package.json index 337da57..5c659c5 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,11 @@ "i18next": "^23.11.5", "katex": "^0.16.11", "lottie-react": "^2.4.0", + "mathjax": "^3.2.2", "mathjax-full": "^3.2.2", "mathml-to-latex": "^1.4.1", + "mathml2latex": "^1.1.3", + "mml2tex": "^0.0.2", "react": "^18.3.1", "react-beautiful-dnd": "^13.1.1", "react-dom": "^18.3.1", diff --git a/public/App/Logo.png b/public/App/Logo.png deleted file mode 100644 index 5983996..0000000 Binary files a/public/App/Logo.png and /dev/null differ diff --git a/public/App/Logo.svg b/public/App/Logo.svg new file mode 100644 index 0000000..74adce7 --- /dev/null +++ b/public/App/Logo.svg @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/App/Logo2.png b/public/App/Logo2.png deleted file mode 100644 index 57e6f35..0000000 Binary files a/public/App/Logo2.png and /dev/null differ diff --git a/public/App/SyriaLogo.webp b/public/App/SyriaLogo.webp deleted file mode 100644 index e39e7f6..0000000 Binary files a/public/App/SyriaLogo.webp and /dev/null differ diff --git a/public/App/whiteLogo.png b/public/App/whiteLogo.png new file mode 100644 index 0000000..0905b6c Binary files /dev/null and b/public/App/whiteLogo.png differ diff --git a/public/site.webmanifest b/public/site.webmanifest index 6687a12..06bbef3 100644 --- a/public/site.webmanifest +++ b/public/site.webmanifest @@ -8,17 +8,17 @@ "theme_color": "#000000", "icons": [ { - "src": "/App/Logo.png", + "src": "/App/Logo.svg", "sizes": "81x113", "type": "image/png" }, { - "src": "/App/Logo.png", + "src": "/App/Logo.svg", "sizes": "81x113", "type": "image/png" }, { - "src": "/App/Logo.png", + "src": "/App/Logo.svg", "sizes": "81x113", "type": "image/png", "purpose": "maskable" diff --git a/src/Components/LatextInput/AddLaTexModal.tsx b/src/Components/LatextInput/AddLaTexModal.tsx index b6df44d..bc4cf0a 100644 --- a/src/Components/LatextInput/AddLaTexModal.tsx +++ b/src/Components/LatextInput/AddLaTexModal.tsx @@ -18,14 +18,10 @@ const AddLaTexModal = ({name,setLatex,Latex,setIsModalOpen,isModalOpen,setCurren const {values,setFieldValue} = useFormikContext() - const handleOk = () => { - console.log(1); - - const oldValue = values?.[name]; + const handleOk = () => { + const oldValue = values?.[name] ?? ""; const newLatex = convertMathMLToLaTeX(Latex); - console.log(newLatex,'Latex'); - console.log(newLatex); - + if(newLatex){ setFieldValue(name, oldValue + " $$ " +newLatex +" $$ "); setCurrentValue(oldValue + " $$ " +newLatex +" $$ ") diff --git a/src/Components/LatextInput/LaTeXInput.tsx b/src/Components/LatextInput/LaTeXInput.tsx deleted file mode 100644 index a7be123..0000000 --- a/src/Components/LatextInput/LaTeXInput.tsx +++ /dev/null @@ -1,110 +0,0 @@ -import TextArea from 'antd/es/input/TextArea' -import { useFormikContext } from 'formik'; -import React, { Suspense, useState } from 'react' -import { parseTextAndLatex } from '../../utils/parseTextAndLatex'; -import LatexPreview from '../../Components/CustomFields/MathComponent'; -import { Checkbox } from 'antd'; -import { CheckboxProps } from 'antd/lib'; -import { useTranslation } from 'react-i18next'; -import { FaPlus } from 'react-icons/fa'; -import { useObjectToEdit } from '../../zustand/ObjectToEditState'; -import { TextAreaProps } from 'antd/lib/input'; -import SpinContainer from '../Layout/SpinContainer'; - const AddLazyModal = React.lazy(()=> import("./AddLaTexModal")); - const EditLazyModal = React.lazy(()=> import("./EditLaTexModal")); -interface ILaTeXInput extends TextAreaProps { - name:string,label:string -} -const LaTeXInput = ({name,label,...props}:ILaTeXInput) => { - - - const {values,setFieldValue,getFieldProps} = useFormikContext() - const { ShowLatexOption } = useObjectToEdit(); - const [showPreview, setShowPreview] = useState(false) ; - const value = getFieldProps(name)?.value - - const Preview = parseTextAndLatex(value ?? "") ; - - const onPreviewChange: CheckboxProps['onChange'] = (e) => { - const value = e.target.checked - setShowPreview(value) - }; - const [t] = useTranslation() - - const [isModalOpen, setIsModalOpen] = useState(false); - const [isEditModalOpen, setIsEditModalOpen] = useState(false); - - const [Latex, setLatex] = useState("") - - - const showModal = () => { - setIsModalOpen(true); - }; - - - const handelEditModal = (item:any)=>{ - console.log(item); - - setLatex(item) - setIsEditModalOpen(true) - } - - const [curCentValue, setCurrentValue] = useState(value) - const handleChangeInput = (e: React.ChangeEvent) => { - setFieldValue(name, e.target.value); - setCurrentValue(e.target.value) - }; - return ( -
- - - -
-