Prepping editor.
This commit is contained in:
19
editor/src/App.tsx
Normal file
19
editor/src/App.tsx
Normal file
@ -0,0 +1,19 @@
|
||||
import { VNSceneEditor } from "./views/VNSceneEditor";
|
||||
|
||||
export const App = () => {
|
||||
return (
|
||||
<>
|
||||
<header>
|
||||
Header
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<VNSceneEditor />
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
Footer
|
||||
</footer>
|
||||
</>
|
||||
);
|
||||
}
|
4
editor/src/api/base.ts
Normal file
4
editor/src/api/base.ts
Normal file
@ -0,0 +1,4 @@
|
||||
//@ts-ignore
|
||||
const wdawnapi = (globalThis['dawnapi'] as any);
|
||||
|
||||
export const API_BASE = wdawnapi;
|
1
editor/src/api/index.ts
Normal file
1
editor/src/api/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './vnscene';
|
3
editor/src/api/vnscene.ts
Normal file
3
editor/src/api/vnscene.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import { API_BASE } from "./base";
|
||||
|
||||
export const doVnTest = API_BASE['vnscene:test'] as (bruh1:string, bruh2:string) => Promise<string>;
|
4
editor/src/index.css
Normal file
4
editor/src/index.css
Normal file
@ -0,0 +1,4 @@
|
||||
html,body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
17
editor/src/index.tsx
Normal file
17
editor/src/index.tsx
Normal file
@ -0,0 +1,17 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import './index.css';
|
||||
import { App } from './App';
|
||||
import reportWebVitals from './reportWebVitals';
|
||||
|
||||
const root = ReactDOM.createRoot(document.getElementById('root')!);
|
||||
root.render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
||||
// If you want to start measuring performance in your app, pass a function
|
||||
// to log results (for example: reportWebVitals(console.log))
|
||||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
|
||||
reportWebVitals();
|
1
editor/src/react-app-env.d.ts
vendored
Normal file
1
editor/src/react-app-env.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
/// <reference types="react-scripts" />
|
15
editor/src/reportWebVitals.ts
Normal file
15
editor/src/reportWebVitals.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { ReportHandler } from 'web-vitals';
|
||||
|
||||
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
|
||||
if (onPerfEntry && onPerfEntry instanceof Function) {
|
||||
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
||||
getCLS(onPerfEntry);
|
||||
getFID(onPerfEntry);
|
||||
getFCP(onPerfEntry);
|
||||
getLCP(onPerfEntry);
|
||||
getTTFB(onPerfEntry);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
export default reportWebVitals;
|
5
editor/src/setupTests.ts
Normal file
5
editor/src/setupTests.ts
Normal file
@ -0,0 +1,5 @@
|
||||
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
||||
// allows you to do things like:
|
||||
// expect(element).toHaveTextContent(/react/i)
|
||||
// learn more: https://github.com/testing-library/jest-dom
|
||||
import '@testing-library/jest-dom';
|
16
editor/src/views/VNSceneEditor.tsx
Normal file
16
editor/src/views/VNSceneEditor.tsx
Normal file
@ -0,0 +1,16 @@
|
||||
import React, { useState } from 'react';
|
||||
import { doVnTest } from '../api';
|
||||
|
||||
export const VNSceneEditor = () => {
|
||||
const [ test, setTest ] = useState('');
|
||||
|
||||
return (
|
||||
<div>
|
||||
VN Scene Editor
|
||||
|
||||
<button onClick={() => {
|
||||
doVnTest('bruh1', 'bruh2').then(e => console.log(e)).catch(e => console.error(e));
|
||||
}}>Clicky</button>
|
||||
</div>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user