Commit Graph

7 Commits

Author SHA1 Message Date
AR 15 M4 5b54ad5c23 feat(sprint-5.5): add block version snapshots with switching between versions
- Add BlockSnapshot Prisma model (html, css, version, changelog) + migration
- Add API endpoints: POST/GET /blocks/snapshots, GET /blocks/snapshots/:id
- BlockMetaBar: version dropdown, HTML capture on save, onSnapshotSelect prop
- "Сохранить версию" now captures innerHTML snapshot + CSS and stores in DB
- Selecting archived version shows stored HTML snapshot instead of live component
- Yellow banner "Архивная версия" with link to return to current
- Split all 8 block pages into Server Component (metadata) + Client Component
- Add data-block-capture attribute for snapshot capture targeting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 00:17:25 +05:00
AR 15 M4 196526ffc4 feat(sprint-5.5): add "Save version" button, update navigation block and block components
- Add "Сохранить версию" button to BlockMetaBar that persists current
  version + changelog from code to PostgreSQL via PATCH API
- Update navigation page: menu items section now renders like live example
  with underlined links, hover dropdowns, and submenus
- Restore uncommitted changes from previous session (thirsty-mayer worktree):
  navigation v1.3 with dropdowns, updated hero/ceo/doctors/reviews/news/
  contact-forms/footer blocks, navData.ts extraction, seed updates
- Extract nav menu data to shared navData.ts module

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 23:28:05 +05:00
AR 15 M4 e20d222183 feat(sprint-5.5): store block metadata (version, changelog) in PostgreSQL
- Prisma schema: added `changelog Json @default("[]")` to Block model
- Migration: 20260324141120_add_changelog_field
- Seed: 8 blocks with actual versions (v1.0–v1.2) and changelog entries
- API: PATCH /blocks/by-path accepts changelog field
- CORS: accept any localhost port (regex pattern)
- BlockChangelog component: renders version history from API or fallback
- BlockMetaBar: loads changelog from API, passes to BlockChangelog
  - Removed "API офлайн" text, replaced with subtle gray dot
  - Added defaultChangelog prop for offline fallback
- Block pages: removed hardcoded changelog JSX, use defaultChangelog prop
- Updated SPRINTS.md with completed tasks

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 19:21:56 +05:00
AR 15 M4 36d5faf67d fix(preview): enable block toggle via localStorage when API is offline
BlockMetaBar now falls back to localStorage for preview toggle when
NestJS API is unavailable. PreviewClient reads localStorage state
and listens for bb-preview-change events to stay in sync.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 18:52:21 +05:00
AR 15 M4 2ed7eee63d feat(sprint-5.5): add NestJS API, BlockMetaBar, block components + fix Vercel build
- Add vercel.json to build only apps/web (fix Vercel build failure)
- NestJS API: BlocksModule, BlocksController, BlocksService with Prisma 7
- PostgreSQL migration: Block model (path, version, isInPreview)
- BlockMetaBar component: inline version edit, API fetch with offline fallback
- New block components: CeoBlock, ContactFormsBlock, FooterBlock, NewsBlock, ReviewsBlock
- PreviewClient: fetch isInPreview from API, block visibility toggle
- Pages updated: hero, doctors, ceo, contact-forms, contact, news, reviews
- docker-compose: PostgreSQL on port 5434

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 10:38:12 +05:00
AR 15 M4 c1731615ab fix(buttons): переделаны кнопки под реальный сайт oclinica.ru
Анализ CSS сайта (style.css темы clinic_bootstrap_mobile) выявил
4 реальных типа кнопок — заменены ранее придуманные варианты:

- primary  → коралловый #FFA39C + shadow (форм-сабмит «Запишите меня!»)
- outline  → белый + бежевая рамка #BF9975 («Записаться на прием»)
- teal     → бирюзовый #60959c («Позвонить»)
- pill     → кремовый #e9e4d4 + radius 25px («Заказать звонок»)

Удалены: secondary, ghost, danger (не существуют на реальном сайте)
Добавлен раздел «CSS с сайта» с точными значениями
Добавлена таблица «Где применяется» с реальными CSS-классами сайта
LLM-блок обновлён до v2.0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 20:41:27 +05:00
AR 15 M4 0855892643 feat(sprint3): кнопки, форм-контролы, LLM-блоки — Sprint 3 v0.3.0
- components/ui/Button.tsx — компонент Button (primary/secondary/ghost/danger, sm/md/lg, loading/disabled)
- components/ui/CodeCopy.tsx — компонент копирования кода (clipboard API)
- components/ui/Toggle.tsx — тумблер (client component, bb-toggle-track/thumb)
- globals.css — CSS-классы: bb-btn, bb-input/textarea/select, bb-checkbox/radio, bb-toggle, @keyframes bb-spin
- app/components/buttons/page.tsx — страница «Кнопки» (варианты, размеры, состояния, code copy, LLM-блок)
- app/components/forms/page.tsx — страница «Форм-контролы» (Input/Textarea/Select/Checkbox/Radio/Toggle, LLM-блок)
- foundation/logo/page.tsx — добавлен LLM-блок v1.0
- Sidebar: убраны «скоро» с Кнопок и Форм-контролов, версия Sprint 3 · v0.3.0
- docs/LLM_CONTEXT.md → версия 3.0, добавлена секция 9a с компонентами

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 20:20:41 +05:00