mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-13 05:12:50 +00:00
Wires creation, deletion, lock, visibility, and paste through the new HistoryManager. Mutator-recorded — every external call site keeps the same signature it had before; recording happens inside the mutator or its dep callback, so callers don't grow new responsibilities. Recordings added: - actions/addObject, addCharacter, addShape: editor.history.recordCreate(obj) replaces the legacy add_creation_undostack call. - editor.deleteObject: snapshots the target before delegating to utils.deleteObject so undo can fully reconstruct it. - SelectionBridge.lockUnlockObject: takes a recordLockChange dep callback, records before/after locked state inline. No coupling back to HistoryManager from the bridge. - Outliner.handleToggleVisibility: records visible before/after at the call site (hideObject lives on SceneManager which has no history dep). - SceneManager.paste: now returns the new Object3D so keymap's paste handler can record it via editor.history.recordCreate. The legacy add_creation_undostack call inside paste is removed. keymap.ts: undo/redo target editor.history; deleteSelected routes through editor.deleteObject (so history records); paste captures the returned object and records. Transform recording (gizmo drag, panel inputs) and color stay on the old check_scene_for_updates diff path until follow-up commits. Old SceneManager undo machinery (undoStack, undo/redo methods, add_creation_undostack, the diff helpers) is still in place but only the diff path drives transforms now.
Frontend
This is an nx monorepo that can contain multiple apps and shared libraries.
All commands to run these projects are performed from this directory.
Install dependencies
npm install
Editor2d
Run dev server:
nx dev editor2d
artcraft
Run dev server:
nx dev artcraft
call when starting on main or a new branch:
./clean_modules
The names for @frontend and @storyteller come from the package.json file in the libs folder.
import { Login } from "@frontend/login";
import { api } from "@storyteller/api";
For shared UI components, import from @storyteller/ui-[componentname].
import { Button } from "@storyteller/ui-button";
import { Modal } from "@storyteller/ui-modal";
building:
npx nx build artcraft
npx nx build editor2d
dev:
npx nx dev artcraft
npx nx dev editor2d
# component build
1.
npx nx g @nx/react:library libs/components/toaster --import-path=@storyteller/ui-toaster --bundler=vite
npm install
2.import it first in code
3.nx sync
4.nx build
or
# frontend build
in frontend folder
% nx build -project type
% nx build artcraft
% nx dev artcraft