More work

This commit is contained in:
Greg Shuflin 2024-11-20 03:30:48 -08:00
parent 95ca7301d6
commit 515cdc5c0f
6 changed files with 17 additions and 7 deletions

Binary file not shown.

View File

@ -5,7 +5,7 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "tsc && vite build", "build": "tsc && vite build --jsx",
"preview": "vite preview", "preview": "vite preview",
"tauri": "tauri" "tauri": "tauri"
}, },
@ -19,6 +19,7 @@
}, },
"devDependencies": { "devDependencies": {
"@tauri-apps/cli": "^2", "@tauri-apps/cli": "^2",
"@vitejs/plugin-react": "^4.2.1",
"vite": "^5.3.1", "vite": "^5.3.1",
"typescript": "^5.2.2" "typescript": "^5.2.2"
} }

View File

@ -1,4 +1,4 @@
import React, { useState, useEffect } from 'react'; import { useState, useEffect } from 'react';
import Card from '@mui/material/Card'; import Card from '@mui/material/Card';
import Button from '@mui/material/Button'; import Button from '@mui/material/Button';
import { import {

View File

@ -1,14 +1,19 @@
import { invoke } from "@tauri-apps/api/core"; import { invoke } from "@tauri-apps/api/core";
import { createRoot } from 'react-dom/client';
import React, { useState, useEffect } from 'react';
import React from 'react';
// @ts-ignore
import ReactDOM from "react-dom/client";
import NoteEditor from "./claude-generated-code"; import NoteEditor from "./claude-generated-code";
const domElem = document.getElementById("editor"); const domElem = document.getElementById("editor");
console.log(domElem);
const root = createRoot(domElem); ReactDOM.createRoot(domElem).render(
root.render(<NoteEditor/>); <React.StrictMode>
<NoteEditor/>
</React.StrictMode>,
);
let greetInputEl: HTMLInputElement | null; let greetInputEl: HTMLInputElement | null;
let greetMsgEl: HTMLElement | null; let greetMsgEl: HTMLElement | null;

View File

@ -12,6 +12,7 @@
"resolveJsonModule": true, "resolveJsonModule": true,
"isolatedModules": true, "isolatedModules": true,
"noEmit": true, "noEmit": true,
"jsx": "react-jsx",
/* Linting */ /* Linting */
"strict": true, "strict": true,

View File

@ -1,10 +1,13 @@
import { defineConfig } from "vite"; import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// @ts-expect-error process is a nodejs global // @ts-expect-error process is a nodejs global
const host = process.env.TAURI_DEV_HOST; const host = process.env.TAURI_DEV_HOST;
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig(async () => ({ export default defineConfig(async () => ({
plugins: [react()],
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build` // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
// //