feat(builder): add project editor

This commit is contained in:
sdarbinyan
2026-07-10 13:43:53 +04:00
parent 7161a81068
commit e2c8747fcc
50 changed files with 1656 additions and 42 deletions

138
docs/Project-Editor.md Normal file
View File

@@ -0,0 +1,138 @@
# Marketplace Project Editor - Sprint 13
## Scope
Sprint 13 introduces first version of Marketplace Project Editor.
Editor only manages bootstrap configuration.
Out of scope:
- products
- categories
- orders
- analytics management
## Architecture
```text
src/app/features/project-editor/
pages/
components/
sections/
models/
services/
facade/
```
Editor uses strongly typed bootstrap models and isolated feature state.
Components do not call APIs directly.
## Facade API
`ProjectEditorFacade` exposes:
- `loadBootstrap()`
- `updateBootstrap()`
- `exportBootstrap()`
- `importBootstrap()`
- `preview()`
Current source of truth:
- existing bootstrap provider via `ConfigService`
Future backend integration:
- replace local import/export/save flow with builder endpoints
- keep component contracts unchanged
## Supported Sections
- General
- marketplace name
- domain
- description
- default language
- supported languages
- Branding
- logo
- small logo
- favicon
- marketplace title
- Theme
- palette tokens via color pickers
- Header
- logo/search/categories/languages/cart/profile/wishlist/compare/region toggles
- Footer
- company information
- address
- phone
- email
- copyright
- payment icons
- social links
- static pages
- Homepage
- home page sections list
- visibility
- order
- layout
- drag-and-drop ordering
- Widgets
- homepage widget configuration
- typed shortcuts for hero/categories/product collection widgets
- JSON fallback for other widget props
- Marketplace Features
- feature flags
- search suggestions/history
- recently viewed
- reviews/questions/recommendations
- Preview
- export JSON
- import JSON
- runtime preview without full browser refresh
## Preview Strategy
Preview updates bootstrap snapshot in memory and re-applies:
- theme
- branding
- runtime state
- route-based page rendering on next Angular navigation
This keeps bootstrap engine intact while enabling fast local preview.
## Widget Configuration
Current widget editor supports explicit fields for:
- Hero
- layout
- height
- overlay
- autoplay
- Categories
- layout
- columns
- Product Collection
- layout
- cards per row
- filters
- badges
- rating
- price
Other widgets use JSON props fallback until dedicated editors are added.
## Future Backend Endpoints
Recommended future builder endpoints:
- `GET /builder/bootstrap`
- `PUT /builder/bootstrap`
- `POST /builder/bootstrap/preview`
- `POST /builder/bootstrap/validate`
- `POST /builder/bootstrap/import`
- `GET /builder/bootstrap/export`
## Constraints
- runtime bootstrap engine not replaced
- configuration stays source of truth
- no hardcoded marketplace values
- no business domain management mixed into editor