Refactoring editor

This commit is contained in:
2026-03-31 10:56:44 -05:00
parent 0885da8d44
commit 888918face
21 changed files with 235 additions and 111 deletions

41
editor/.gitignore vendored Normal file
View File

@@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*
# env files (can opt-in for committing if needed)
.env*
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts

8
editor/next.config.ts Normal file
View File

@@ -0,0 +1,8 @@
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
/* config options here */
reactCompiler: true,
};
export default nextConfig;

23
editor/package.json Normal file
View File

@@ -0,0 +1,23 @@
{
"name": "dusk-editor",
"version": "0.1.0",
"private": true,
"scripts": {
"start:dev": "next dev",
"build:prod": "next build",
"start:prod": "next start"
},
"dependencies": {
"next": "16.2.1",
"react": "19.2.4",
"react-dom": "19.2.4",
"sass": "^1.98.0"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"babel-plugin-react-compiler": "1.0.0",
"typescript": "^5"
}
}

23
editor/src/app/layout.tsx Normal file
View File

@@ -0,0 +1,23 @@
import type { Metadata } from "next";
import "@/styles/styles.scss";
import Navbar from "@/components/Navbar/Navbar";
export const metadata: Metadata = {
title: "Dusk Editor",
description: "Editor for the Dusk Game Engine",
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body>
<Navbar />
{children}
</body>
</html>
);
}

9
editor/src/app/page.tsx Normal file
View File

@@ -0,0 +1,9 @@
import Link from "next/link";
export default function Home() {
return (
<div>
<Link href="/texture-creator">Go to Texture Creator</Link>
</div>
);
}

View File

@@ -0,0 +1,17 @@
'use client';
import React, { createContext, useContext, useState } from "react";
type TexturePageContextType = {
};
const TexturePageContext = createContext<TexturePageContextType | undefined>(undefined);
const TextureCreatorPage: React.FC<{ children: React.ReactNode }> = (props) => {
return (
<TexturePageContext.Provider value={{ }}>
<Typography</Typography>
</TexturePageContext.Provider>
);
}
export default TextureCreatorPage;

View File

@@ -0,0 +1,12 @@
import React from 'react';
import * as styles from './Navbar.module.scss';
const Navbar:React.FC<{}> = (props) => {
return (
<nav className={styles.navbar}>
navbar
</nav>
);
}
export default Navbar;

View File

@@ -0,0 +1,14 @@
const Typography:React.FC<{
element?:string|React.JSXElementConstructor<any>;
}> = (props) => {
const Element = props.element || 'p';
return (
<Element>
{props.children}
</Element>
)
};
export default Typography;

View File

@@ -0,0 +1,17 @@
import React, { createContext, useContext, useState } from "react";
type TextureContextType = {
};
const TextureContext = createContext<TextureContextType | undefined>(undefined);
const TextureCreator: React.FC<{ children: React.ReactNode }> = (props) => {
return (
<TextureContext.Provider value={{ }}>
{props.children}
</TextureContext.Provider>
);
}
export default TextureCreator;

View File

@@ -0,0 +1,4 @@
a {
color: inherit;
text-decoration: none;
}

View File

@@ -0,0 +1,3 @@
* {
box-sizing: border-box;
}

View File

@@ -0,0 +1,8 @@
body {
margin: 0;
padding: 0;
max-width: 100vw;
overflow-x: hidden;
font-size: 16px;
font-family: Arial, Helvetica, sans-serif;
}

View File

@@ -0,0 +1,6 @@
html {
margin: 0;
padding: 0;
max-width: 100vw;
overflow-x: hidden;
}

View File

@@ -0,0 +1,3 @@
:root {
}

View File

@@ -0,0 +1,12 @@
// Elements
@use './elements/root.scss';
@use './elements/all.scss';
@use './elements/a.scss';
@use './elements/html.scss';
@use './elements/body.scss';
// Objects
// Components
// Utilities

34
editor/tsconfig.json Normal file
View File

@@ -0,0 +1,34 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": ["./src/*"]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
".next/dev/types/**/*.ts",
"**/*.mts"
],
"exclude": ["node_modules"]
}