diff --git a/src/cli/commands/create.ts b/src/cli/commands/create.ts index 9dccb64..8159085 100644 --- a/src/cli/commands/create.ts +++ b/src/cli/commands/create.ts @@ -34,6 +34,19 @@ export const createCommand = new Command('create') process.exit(1); } + // The app template (the full BIM viewer) currently depends on engine APIs + // that only exist in the beta libraries. Until the public engine catches up + // (October release), scaffolding the app without --beta would produce a + // project that doesn't type-check or run — so require --beta explicitly. + if (template === 'app' && !opts.beta) { + console.error( + 'The "app" template currently requires the beta engine libraries.\n\n' + + ` thatopen create ${projectName} --beta\n\n` + + 'Public (non-beta) engine support is coming with the October release.', + ); + process.exit(1); + } + const isCloud = template === 'cloud-component'; const projectKind = isCloud ? 'cloud component' : 'app'; const useCurrentDir = projectName === '.'; diff --git a/src/cli/templates/app/index.html b/src/cli/templates/app/index.html index ea77511..7819bd5 100644 --- a/src/cli/templates/app/index.html +++ b/src/cli/templates/app/index.html @@ -8,6 +8,14 @@ *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; } html, body { width: 100%; height: 100%; overflow: hidden; font-family: system-ui, -apple-system, sans-serif; } #that-open-app { width: 100%; height: 100%; } + /* Scrollbar rail = the panel surface (#262629). Every panel (app .xxx-vp + tracks) and every bim-* shadow-DOM scrollbar reads var(--bim-scrollbar--bgc, + …), so defining it once here makes all rails match the surface instead of + falling back to the lighter bg-contrast-40 (#5F5F64). + NOTE: must use --bim-ui_gray-1 (defined UNCONDITIONALLY at :root = #262629), + not --bim-ui_bg-contrast-* (only defined under @media/theme-class scopes, so + it doesn't resolve at :root and left --bim-scrollbar--bgc unset). */ + :root { --bim-scrollbar--bgc: var(--bim-ui_gray-1, #262629); }
diff --git a/src/cli/templates/app/package.json b/src/cli/templates/app/package.json index ee06720..dca07d7 100644 --- a/src/cli/templates/app/package.json +++ b/src/cli/templates/app/package.json @@ -17,7 +17,11 @@ "@thatopen/fragments": "~3.4.0", "@thatopen/services": "file:../../../..", "@thatopen/ui": "~3.4.0", - "three": "^0.182.0" + "three": "^0.182.0", + "@sparkjsdev/spark": "^0.1.10", + "3d-tiles-renderer": "^0.4.28", + "camera-controls": "^3.1.2", + "web-ifc": "^0.0.77" }, "devDependencies": { "@types/three": "^0.182.0", diff --git a/src/cli/templates/app/src/app.ts b/src/cli/templates/app/src/app.ts new file mode 100644 index 0000000..9652b81 --- /dev/null +++ b/src/cli/templates/app/src/app.ts @@ -0,0 +1,37 @@ +import { PlatformClient, ProjectData } from "@thatopen/services"; + +// ─── A2 migration shim ─────────────────────────────────────────────────────── +// Pre-A2 the platform `AppManager` built-in held the platform `client` + +// `projectData`, reached via `components.get(AppManager)`. Juan removed +// AppManager (consolidated into UIManager / top-app). top-app now owns that +// state and exposes it via lit contexts — but a few non-lit call sites +// (CloudRunner, data-table-panel, app-info-section) just need `.client` / +// `.projectData` synchronously. This tiny module holds them, set once from +// main.ts, and keeps `getAppManager(...)` returning the same `{ client, +// projectData }` shape those call sites expect. + +let _client: PlatformClient | undefined; +let _projectData: ProjectData | undefined; + +/** Called once from main.ts after the platform client (and projectData) exist. */ +export const setAppContext = ( + client: PlatformClient, + projectData?: ProjectData, +) => { + _client = client; + _projectData = projectData; +}; + +/** + * Back-compat accessor mirroring the old `components.get(AppManager)` surface + * the remaining call sites use (`.client` / `.projectData`). The `components` + * arg is ignored — kept only for signature compatibility with existing callers. + */ +export const getAppManager = (_components?: unknown) => ({ + get client() { + return _client; + }, + get projectData() { + return _projectData; + }, +}); diff --git a/src/cli/templates/app/src/assets/tool-placeholder.ts b/src/cli/templates/app/src/assets/tool-placeholder.ts new file mode 100644 index 0000000..9b1afb1 --- /dev/null +++ b/src/cli/templates/app/src/assets/tool-placeholder.ts @@ -0,0 +1,50 @@ +/** + * Empty-state illustration for the helper panel (from + * "Frame 691314571.svg" — a translucent stacked-cards glyph with a check badge). + * Stored as a string and served as a data URI so it needs no import/build + * config. Theme-safe: all fills are translucent white/#F8F8F8 over transparent, + * so it reads correctly on the dark bg-base card. + */ +export const toolPlaceholderSvg = ``; + +/** The illustration as a data URI, ready for an `