Files
artcraft/frontend
Tanish Manku abf2e1d6c2 PageScene: extract GizmoController from editor.ts
Third step of the editor.ts decomposition. Pulls TransformControls
ownership and the gizmo lifecycle out of Editor into a focused module.

GizmoController owns:
  control (TransformControls).

Methods take their dependencies as method arguments — no `editor`
reference, no `import type Editor`, no circular import:
  configure(camera, domElement, scene, callbacks)
  changeMode(type, space)
  setSpace(space)
  canToggleSpace()
  attach(object), detach()
  addToScene(scene), removeFromScene(scene)
  setVisible(v), isVisible()

Editor exposes the gizmo as `editor.gizmo` and constructs it empty in
the constructor; configure() is called from initialize() once camera
and renderer exist. The two existing public methods stay on Editor as
facades, so the external callers (actions/setTransformMode.ts,
comps/Controls3D.tsx, engine/keymap.ts) keep working unchanged:
  Editor.change_mode reads the store's transformSpace and forwards.
  Editor.toggleTransformSpace toggles the store and pushes into gizmo.

External readers updated:
  helper.ts (SceneUtils.lockUnlockObject + removeTransformControls)
    routes through editor.gizmo.attach/detach/addToScene/removeFromScene
    instead of poking editor.control directly.
  Editor.snapShotOfCurrentFrame uses editor.gizmo.setVisible /
    isVisible instead of touching control.visible.
  Editor passes editor.gizmo.control to the MouseControls constructor
    where it previously passed editor.control.

Dead code removed:
  - transform_interaction on Editor: passed by value to MouseControls
    (which has its own internal copy that overrides) and the `= true`
    write in change_mode mutated a field nothing read. Pure dead code.
  - The "if (this.control == undefined) return;" guard immediately
    after `new TransformControls(...)` — that branch was unreachable.
  - Unused TransformControls import in editor.ts.

Net: editor.ts down to 1196 LOC. Typecheck error count drops by 3.
2026-04-30 11:05:00 -07:00
..
2026-03-12 15:49:24 +07:00
…
2026-03-12 15:49:24 +07:00
2026-03-12 15:49:24 +07:00
2026-03-12 21:18:51 +07:00

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