Refactoring editor
This commit is contained in:
41
editor/.gitignore
vendored
Normal file
41
editor/.gitignore
vendored
Normal 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
8
editor/next.config.ts
Normal 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
23
editor/package.json
Normal 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
23
editor/src/app/layout.tsx
Normal 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
9
editor/src/app/page.tsx
Normal 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>
|
||||
);
|
||||
}
|
||||
17
editor/src/app/texture-creator/page.tsx
Normal file
17
editor/src/app/texture-creator/page.tsx
Normal 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;
|
||||
12
editor/src/components/Navbar/Navbar.tsx
Normal file
12
editor/src/components/Navbar/Navbar.tsx
Normal 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;
|
||||
14
editor/src/objects/Typography/Typography.tsx
Normal file
14
editor/src/objects/Typography/Typography.tsx
Normal 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;
|
||||
17
editor/src/pages/TextureCreator/TextureCreator.tsx
Normal file
17
editor/src/pages/TextureCreator/TextureCreator.tsx
Normal 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;
|
||||
4
editor/src/styles/elements/a.scss
Normal file
4
editor/src/styles/elements/a.scss
Normal file
@@ -0,0 +1,4 @@
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
3
editor/src/styles/elements/all.scss
Normal file
3
editor/src/styles/elements/all.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
8
editor/src/styles/elements/body.scss
Normal file
8
editor/src/styles/elements/body.scss
Normal 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;
|
||||
}
|
||||
6
editor/src/styles/elements/html.scss
Normal file
6
editor/src/styles/elements/html.scss
Normal file
@@ -0,0 +1,6 @@
|
||||
html {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
max-width: 100vw;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
3
editor/src/styles/elements/root.scss
Normal file
3
editor/src/styles/elements/root.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
:root {
|
||||
|
||||
}
|
||||
12
editor/src/styles/styles.scss
Normal file
12
editor/src/styles/styles.scss
Normal 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
34
editor/tsconfig.json
Normal 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"]
|
||||
}
|
||||
Reference in New Issue
Block a user