Skip to content

Commit

Permalink
Merge pull request #35 from AniMathIO/staging
Browse files Browse the repository at this point in the history
fix: added dynamic loading for windows binary compilation
  • Loading branch information
MemerGamer committed May 20, 2024
2 parents b17732f + 11943b1 commit a534e18
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

- [Table of Contents](#table-of-contents)
- [OS Support](#os-support)
- [Installation (binaries are coming soon)](#installation-binaries-are-coming-soon)
- [Installation](#installation)
- [Development build](#development-build)
- [Canvas build fix](#canvas-build-fix)
- [NOTE: If you want proper development you will need to follow the steps regarding the canvas build and install all the necessary dependencies](#note-if-you-want-proper-development-you-will-need-to-follow-the-steps-regarding-the-canvas-build-and-install-all-the-necessary-dependencies)
Expand All @@ -20,7 +20,7 @@

We are supporting the following operating systems: macOS(coming soon), Windows, Linux (via AppImage).

## Installation (binaries are coming soon)
## Installation

Please download the latest version of the project binaries from the [release page](https://github.com/AniMathIO/AniMathIO/releases)

Expand Down
4 changes: 2 additions & 2 deletions renderer/pages/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Menu from "./Menu";
import Timeline from "./components/Timeline";
import { State } from '../states/state';
import Head from "next/head";

import AniMathIO from "../public/images/AniMathIO.png";
export const EditorWithStore = () => {
const [state] = useState(new State());
return (
Expand Down Expand Up @@ -51,7 +51,7 @@ const Editor = observer(() => {
<React.Fragment>
<Head>
<title>AniMathIO - Editor</title>
<link rel="icon" href="../images/AniMathIO.png" />
<link rel="icon" href={AniMathIO.src} />
</Head>

<div className="grid grid-rows-[500px_1fr_20px] grid-cols-[90px_300px_250px_1fr] h-[100svh]">
Expand Down
4 changes: 3 additions & 1 deletion renderer/pages/components/partials/MafsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import * as htmlToImage from 'html-to-image';
import { MafsModalProps, LatexProps } from "@/types";
import katex from "katex";
import Modal from 'react-modal';
import dynamic from "next/dynamic";

import LineInputs from "./mafsmodal/LineInputs";
import PointInputs from "./mafsmodal/PointInputs";
import CircleInputs from "./mafsmodal/CircleInputs";
Expand Down Expand Up @@ -342,4 +344,4 @@ const MafsModal = observer(({ isOpen, onClose, mafsElement }: MafsModalProps) =>
);
});

export default MafsModal;
export default dynamic(() => Promise.resolve(MafsModal), { ssr: false });
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { CircleProps } from "mafs";
import dynamic from "next/dynamic";

type CircleInputsProps = {
circleProps: CircleProps;
Expand Down Expand Up @@ -63,4 +64,4 @@ const CircleInputs = ({ circleProps, setCircleProps }: CircleInputsProps) => {
)
}

export default CircleInputs;
export default dynamic(() => Promise.resolve(CircleInputs), { ssr: false });
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { EllipseProps } from "mafs";
import dynamic from "next/dynamic";

type EllipseInputsProps = {
ellipseProps: EllipseProps;
Expand Down Expand Up @@ -80,4 +81,4 @@ const EllipseInputs = ({ ellipseProps, setEllipseProps }: EllipseInputsProps) =>
);
}

export default EllipseInputs;
export default dynamic(() => Promise.resolve(EllipseInputs), { ssr: false });
3 changes: 2 additions & 1 deletion renderer/pages/components/partials/mafsmodal/LatexInputs.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { LatexProps } from "@/types";
import dynamic from "next/dynamic";

type LatexInputsProps = {
latexProps: LatexProps;
Expand Down Expand Up @@ -72,4 +73,4 @@ const LatexInputs = ({
);
};

export default LatexInputs;
export default dynamic(() => Promise.resolve(LatexInputs), { ssr: false });
4 changes: 2 additions & 2 deletions renderer/pages/components/partials/mafsmodal/LineInputs.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SegmentProps } from "mafs"

import dynamic from "next/dynamic";
type LineInputsProps = {
lineProps: SegmentProps;
setLineProps: (props: SegmentProps) => void;
Expand Down Expand Up @@ -79,4 +79,4 @@ const LineInputs = ({ lineProps, setLineProps }: LineInputsProps) => {
</>
);
}
export default LineInputs;
export default dynamic(() => Promise.resolve(LineInputs), { ssr: false });
4 changes: 3 additions & 1 deletion renderer/pages/components/partials/mafsmodal/PlotInputs.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import dynamic from "next/dynamic";

type PlotInputsProps = {
plotProps: {
y: (x: number) => number;
Expand Down Expand Up @@ -30,4 +32,4 @@ const PlotInputs = ({ plotProps, setPlotProps, plotInput, setPlotInput, handlePl
);
}

export default PlotInputs;
export default dynamic(() => Promise.resolve(PlotInputs), { ssr: false });
3 changes: 2 additions & 1 deletion renderer/pages/components/partials/mafsmodal/PointInputs.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { PointProps } from "mafs";
import dynamic from "next/dynamic";

type PointInputsProps = {
pointProps: PointProps;
Expand Down Expand Up @@ -45,4 +46,4 @@ const PointInputs = ({ pointProps, setPointProps }: PointInputsProps) => {
);
}

export default PointInputs;
export default dynamic(() => Promise.resolve(PointInputs), { ssr: false });
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { vec } from "mafs";
import dynamic from "next/dynamic";

type PolygonInputsProps = {
polygonPoints: vec.Vector2[];
Expand Down Expand Up @@ -50,4 +51,4 @@ const PolygonInputs = ({ polygonPoints, setPolygonPoints }: PolygonInputsProps)
</>
);
}
export default PolygonInputs;
export default dynamic(() => Promise.resolve(PolygonInputs), { ssr: false });
3 changes: 2 additions & 1 deletion renderer/pages/components/partials/mafsmodal/TextInputs.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { TextProps } from "mafs";
import dynamic from "next/dynamic";

type TextInputsProps = {
textProps: TextProps;
Expand Down Expand Up @@ -62,4 +63,4 @@ const TextInputs = ({ textProps, setTextProps }: TextInputsProps) => {
);
}

export default TextInputs;
export default dynamic(() => Promise.resolve(TextInputs), { ssr: false });
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { VectorProps } from "mafs";
import dynamic from "next/dynamic";

type VectorInputsProps = {
vectorProps: VectorProps;
Expand Down Expand Up @@ -78,4 +79,4 @@ const VectorInputs = ({ vectorProps, setVectorProps }: VectorInputsProps) => {
</>
);
}
export default VectorInputs;
export default dynamic(() => Promise.resolve(VectorInputs), { ssr: false });

0 comments on commit a534e18

Please sign in to comment.