diff --git a/CLAUDE.md b/CLAUDE.md index c5e6f2c..27b1c26 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,5 +1,11 @@ # Site Builder - Project Documentation +> **LEGACY:** This is the original GrapesJS-based site builder. It has been superseded by the +> Craft.js rebuild located at `/workspace/site-builder/craft/`. All new development happens there. +> This file is preserved as historical reference for the GrapesJS architecture. +> +> The active version: **`/workspace/site-builder/craft/CLAUDE.md`** + ## Overview A visual drag-and-drop website builder using GrapesJS. Users can create multi-page websites without writing code, with server-side file storage for assets and localStorage persistence for editor state. diff --git a/craft/src/constants/presets.ts b/craft/src/constants/presets.ts index 812d2cd..6c7de6d 100644 --- a/craft/src/constants/presets.ts +++ b/craft/src/constants/presets.ts @@ -64,6 +64,16 @@ export const RADIUS_PRESETS = [ { label: 'Full', value: '9999px' }, ]; +// Images need a larger radius scale than buttons/containers to be visually +// distinct on typical photo dimensions. +export const IMAGE_RADIUS_PRESETS = [ + { label: 'None', value: '0' }, + { label: 'S', value: '24px' }, + { label: 'M', value: '48px' }, + { label: 'L', value: '96px' }, + { label: 'Full', value: '9999px' }, +]; + export const GRADIENTS = [ { label: 'Purple Dream', value: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)' }, { label: 'Pink Sunset', value: 'linear-gradient(135deg, #f093fb 0%, #f5576c 100%)' }, diff --git a/craft/src/panels/right/styles/ImageStylePanel.tsx b/craft/src/panels/right/styles/ImageStylePanel.tsx index 21c8acf..dcaa3ac 100644 --- a/craft/src/panels/right/styles/ImageStylePanel.tsx +++ b/craft/src/panels/right/styles/ImageStylePanel.tsx @@ -1,7 +1,7 @@ import React, { useState, useCallback, useRef, CSSProperties } from 'react'; import { useEditor } from '@craftjs/core'; import { - RADIUS_PRESETS, + IMAGE_RADIUS_PRESETS, } from '../../../constants/presets'; import { StylePanelProps, @@ -195,7 +195,7 @@ export const ImageStylePanel: React.FC = ({ selectedId, nodePro
Border Radius setPropStyle('borderRadius', v)} /> diff --git a/css/editor.css b/css/editor.css index d928512..90f9005 100644 --- a/css/editor.css +++ b/css/editor.css @@ -92,6 +92,26 @@ html, body { background: #2563eb; } +.nav-btn.nav-btn-live { + background: #059669; + border-color: #059669; + color: #fff; +} + +.nav-btn.nav-btn-live:hover { + background: #047857; +} + +.nav-btn.nav-btn-coming-soon { + background: #d97706; + border-color: #d97706; + color: #fff; +} + +.nav-btn.nav-btn-coming-soon:hover { + background: #b45309; +} + .divider { width: 1px; height: 24px; @@ -116,6 +136,7 @@ html, body { } .panel-right { + width: 320px; border-right: none; border-left: 1px solid #2d2d3a; } @@ -301,6 +322,52 @@ html, body { } /* Size/Spacing/Radius/Thickness Presets */ +/* Hide GrapesJS default panel buttons and views that conflict with our custom UI */ +.gjs-pn-views, +.gjs-pn-views-container, +.gjs-pn-commands { + display: none !important; +} + +/* Ensure the GrapesJS editor fills all available width */ +.gjs-editor-cont { + width: 100% !important; +} + +.gjs-cv-canvas { + width: 100% !important; + left: 0 !important; +} + +.alignment-presets { + display: flex; + gap: 4px; +} + +.alignment-preset { + flex: 1; + padding: 8px 4px; + background: #2d2d3a; + border: 1px solid #3f3f46; + border-radius: 4px; + color: #a1a1aa; + cursor: pointer; + font-size: 14px; + text-align: center; + transition: all 0.2s; +} + +.alignment-preset:hover { + background: #3f3f46; + color: #e4e4e7; +} + +.alignment-preset.active { + background: #3b82f6; + border-color: #3b82f6; + color: #fff; +} + .size-presets, .spacing-presets, .radius-presets, .thickness-presets { display: flex; gap: 4px; @@ -1650,6 +1717,7 @@ html, body { .asset-browser-grid { display: grid; grid-template-columns: repeat(3, 1fr); + grid-auto-rows: min-content; gap: 10px; padding: 16px; max-height: 400px; @@ -1670,6 +1738,13 @@ html, body { transition: all 0.15s; } +.asset-browser-item img { + width: 100%; + height: 100%; + object-fit: cover; + display: block; +} + .asset-browser-item:hover { border-color: #3b82f6; transform: scale(1.02); diff --git a/index.html b/index.html index ab4285e..1b0fcfe 100644 --- a/index.html +++ b/index.html @@ -346,6 +346,57 @@
+ + + + + + + + +