Add browser-only editor export and 2.5D runtime presentation

This commit is contained in:
emil28092005
2026-09-12 00:05:19 +03:00
parent a25ed40805
commit 1a0bf725fa
16 changed files with 883 additions and 53 deletions
+20
View File
@@ -0,0 +1,20 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import Editor from './Editor.tsx';
import { validateProject } from '../engine/schema.ts';
const root = document.getElementById('root')!;
async function start() {
const response = await fetch('./project.forma.json');
if (!response.ok) throw Error('Не удалось загрузить проект Forma');
const project = await response.json();
validateProject(project);
createRoot(root).render(<Editor initialProject={project} browserOnly />);
}
void start().catch((error) => {
root.replaceChildren();
const message = document.createElement('p');
message.style.cssText = 'padding:32px;font:16px/1.6 system-ui';
message.textContent = 'Не удалось открыть проект. Обнови страницу. ' + String(error.message || error);
root.append(message);
});