Skip to content

Commit 13026a1

Browse files
committed
Editor Proto 0
0 parents  commit 13026a1

53 files changed

Lines changed: 7760 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"plugins": ["import"],
3+
"rules": {
4+
"import/order": [
5+
"error",
6+
{
7+
"alphabetize": {
8+
"order": "asc",
9+
"caseInsensitive": true
10+
},
11+
"groups": [
12+
"builtin",
13+
"external",
14+
"internal",
15+
"parent",
16+
"sibling",
17+
"index",
18+
"object",
19+
"type"
20+
],
21+
"newlines-between": "always"
22+
}
23+
]
24+
}
25+
}

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# 🧠 GraphScript Engine (Frontend)
2+
3+
The **GraphScript Engine** frontend is the UI layer of the GraphScript visual scripting environment. Built using **Vite**, **React**, and **TypeScript (TSX)**, it provides an intuitive and dynamic interface for creating and interacting with logic flows using **node-based scripting**.
4+
5+
## 🔍 What is GraphScript (GS)?
6+
7+
**GraphScript (GS)** is a general-purpose **visual scripting language** that represents logic and behavior as connected nodes, forming a **graph**. Instead of writing code line-by-line, users define scripts by visually linking components like **conditions**, **actions**, **loops**, and **input/output** elements.
8+
9+
Each node represents a **component**, and connections between them define **execution flow**.
10+
11+
## 💡 What the Engine Does
12+
13+
The **GraphScript Engine frontend** allows users to:
14+
15+
- 🎛️ Visually build logic graphs using modular nodes.
16+
- ✍️ Define custom behaviors using pre-defined components (`input`, `output`, `if`, `loop`, etc.).
17+
- 🧩 Nest components and use node arguments that can themselves be graphs or values.
18+
- 💾 Load/save projects seamlessly.
19+
20+
---
21+
22+
## ⚙️ Tech Stack
23+
24+
- **Frontend:** Vite + React + TypeScript
25+
- **Styling:** CSS Modules / Tailwind (optional)
26+
- **State Management:** React Context / Local State
27+
- **Runtime:** Communicates with a backend runtime (e.g., Python engine) via API or RPC.
28+
29+
---
30+
31+
## 🛠️ Development
32+
33+
```bash
34+
# Install dependencies
35+
npm install
36+
37+
# Run dev server
38+
npm start
39+
40+
# Build for production
41+
npm run build
42+
```
43+
44+
## 📌 Note
45+
46+
This is the frontend interface only. To fully run the GraphScript Engine, it needs to be connected to a compatible GS backend runtime (e.g., Python-based interpreter) that understands and executes the logic graphs.
47+
48+
## ✨ Credits
49+
50+
Built with ❤️ by AttAditya
51+

eslint.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import js from '@eslint/js'
2+
import globals from 'globals'
3+
import reactHooks from 'eslint-plugin-react-hooks'
4+
import reactRefresh from 'eslint-plugin-react-refresh'
5+
import tseslint from 'typescript-eslint'
6+
7+
export default tseslint.config(
8+
{ ignores: ['dist'] },
9+
{
10+
extends: [js.configs.recommended, ...tseslint.configs.recommended],
11+
files: ['**/*.{ts,tsx}'],
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
globals: globals.browser,
15+
},
16+
plugins: {
17+
'react-hooks': reactHooks,
18+
'react-refresh': reactRefresh,
19+
},
20+
rules: {
21+
...reactHooks.configs.recommended.rules,
22+
'react-refresh/only-export-components': [
23+
'warn',
24+
{ allowConstantExport: true },
25+
],
26+
},
27+
},
28+
)

index.html

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/GraphScript.png" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>GraphScript Engine</title>
8+
9+
<style>
10+
.pywebview-drag-region {
11+
position: fixed;
12+
display: none;
13+
top: 0.375rem;
14+
left: 5.25rem;
15+
width: 12rem;
16+
height: 1.75rem;
17+
background: transparent;
18+
opacity: 0%;
19+
z-index: 1;
20+
}
21+
</style>
22+
</head>
23+
<body>
24+
<span class="pywebview-drag-region"></span>
25+
<div id="root"></div>
26+
27+
<script type="module" src="/src/main.tsx"></script>
28+
29+
<script defer>
30+
let checkCount = 0;
31+
32+
const pwvCheckInterval = setInterval(() => {
33+
if (window.pywebview !== undefined) {
34+
const dragRegion = document.querySelector('.pywebview-drag-region');
35+
if (dragRegion) dragRegion.style.display = 'block';
36+
}
37+
38+
if (checkCount > 1000 || window.pywebview !== undefined) {
39+
clearInterval(pwvCheckInterval);
40+
return;
41+
}
42+
43+
checkCount++;
44+
}, 10);
45+
</script>
46+
47+
<script>
48+
document.addEventListener("contextmenu", (event) => {
49+
event.preventDefault();
50+
});
51+
</script>
52+
</body>
53+
</html>

0 commit comments

Comments
 (0)