mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-15 06:12:18 +00:00
Final step of the Stage3D migration. The lib now exposes a single
top-level component:
<Stage3D adapter={adapter} sceneToken={...} cacheJsonString={...}
onSceneSerialized={...} />
…that owns the EngineProvider, body composition (canvas, outliner,
control panel, prompt box, model selector, controls, etc.), and
the React-lifecycle-driven set3DPageMounted. Hosts only build their
own PageSceneAdapter and decide where to stash the cache string.
Lib additions:
- src/lib/Stage3D.tsx — top-level shell (provider + drag/loading
layer + body)
- src/lib/Stage3DBody.tsx — ex-PageEditor; consumes adapter for
uploadImage / uploadPlaneFromMediaToken / getViewportSize
- Public re-export of Stage3D + Stage3DProps
Apps changes:
- pages/PageScene/PageScene.tsx reduced to a 50-line wrapper that
builds the Tauri adapter, owns the host-specific concerns
(tab-cache via useTabStore, URL ↔ scene-token sync via react-
router-dom, currentUserToken mirror), and renders <Stage3D />
- pages/PageScene/PageEditor.tsx — deleted (now Stage3DBody in lib)
Apps PageScene/ is now exactly three files, all genuinely host-
specific:
- PageScene.tsx (Tauri-flavored wrapper)
- useTauriPageSceneAdapter.tsx (Tauri-bound adapter implementation)
- index.tsx (exports PageScene)
The artcraft-website can now mount the same 3D editor by writing its
own ~50-line wrapper + a useWebPageSceneAdapter, with zero duplicated
editor body or controls.
Typecheck stays at 47, lib build clean.
124 lines
2.5 KiB
JSON
124 lines
2.5 KiB
JSON
{
|
|
"extends": "../../../tsconfig.base.json",
|
|
"compilerOptions": {
|
|
"outDir": "dist",
|
|
"lib": ["dom", "esnext"],
|
|
"types": [
|
|
"node",
|
|
"@nx/react/typings/cssmodule.d.ts",
|
|
"@nx/react/typings/image.d.ts",
|
|
"vite/client"
|
|
],
|
|
"rootDir": "src",
|
|
"jsx": "react-jsx",
|
|
"tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo",
|
|
"allowJs": true,
|
|
"checkJs": false,
|
|
"noEmitOnError": false,
|
|
"noUnusedLocals": false,
|
|
"strictNullChecks": false,
|
|
"noImplicitAny": false
|
|
},
|
|
"exclude": [
|
|
"out-tsc",
|
|
"dist",
|
|
"**/*.spec.ts",
|
|
"**/*.test.ts",
|
|
"**/*.spec.tsx",
|
|
"**/*.test.tsx",
|
|
"**/*.spec.js",
|
|
"**/*.test.js",
|
|
"**/*.spec.jsx",
|
|
"**/*.test.jsx",
|
|
"vite.config.ts",
|
|
"vite.config.mts",
|
|
"vitest.config.ts",
|
|
"vitest.config.mts",
|
|
"src/**/*.test.ts",
|
|
"src/**/*.spec.ts",
|
|
"src/**/*.test.tsx",
|
|
"src/**/*.spec.tsx",
|
|
"src/**/*.test.js",
|
|
"src/**/*.spec.js",
|
|
"src/**/*.test.jsx",
|
|
"src/**/*.spec.jsx"
|
|
],
|
|
"include": [
|
|
"src/**/*.js",
|
|
"src/**/*.jsx",
|
|
"src/**/*.ts",
|
|
"src/**/*.tsx"
|
|
],
|
|
"references": [
|
|
{
|
|
"path": "../button-icon/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../loading-spinner/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../label/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../settings-modal/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../button-icon-select/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../badge/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../input/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../close-button/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../modal/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../checkbox/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../tooltip/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../button/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../button-dropdown/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../popover/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../promptbox/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../loading/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../pricing-modal/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../help-menu/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../../api-enums/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../../model-list/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../model-selector/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../gallery-modal/tsconfig.lib.json"
|
|
},
|
|
{
|
|
"path": "../../common/tsconfig.lib.json"
|
|
}
|
|
]
|
|
}
|