diff --git a/AGENTS.md b/AGENTS.md index 97996a8..8d67451 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -50,7 +50,7 @@ All components use Svelte 5 runes syntax — **never** `export let`, `$:`, or `o Pages are composed of `ContentBlock[]`. Each block has `{ id, type, data }`. Block types are defined in `$lib/types.ts`: `text | image | image_text | timeline | testimonials | services | cta | spacer | horizontal_cards` -- **Public renderers**: `$lib/blocks/Block.svelte` — one per type, receives `data` prop +- **Public renderers**: `$lib/blocks/Block.svelte` — one per type, receives `data` prop. Currently active: `TextBlock`, `ImageTextBlock`, `TimelineBlock`, `HeroBlock`. - **Admin editors**: `$lib/admin/editors/BlockEditor.svelte` — switches editor UI by type - **Defaults**: `$lib/admin/blockDefaults.ts` — `createBlock(type)` generates a new block with sensible defaults - **Block list**: `$lib/admin/BlockList.svelte` — draggable reorder, select, delete diff --git a/app/src/lib/admin/blockDefaults.ts b/app/src/lib/admin/blockDefaults.ts index 8ee4e6f..2c09c89 100644 --- a/app/src/lib/admin/blockDefaults.ts +++ b/app/src/lib/admin/blockDefaults.ts @@ -3,21 +3,9 @@ import type { BlockType, ContentBlock } from '$lib/types'; export const blockLabels: Record = { text: 'Text', - image: 'Image', image_text: 'Image + Text', timeline: 'Timeline', - testimonials: 'Testimonials', - services: 'Services', - cta: 'Call to Action', - spacer: 'Spacer', - horizontal_cards: 'Horizontal Cards', - hero: 'Hero', - columns: 'Columns', - pricing_table: 'Pricing Table', - newsletter: 'Newsletter', - articles_list: 'Articles List', - profile_card: 'Profile Card', - features_list: 'Features List' + hero: 'Hero' }; export const blockTypes = Object.keys(blockLabels) as BlockType[]; @@ -28,30 +16,12 @@ export function createBlock(type: BlockType): ContentBlock { case 'text': base.data = { content: '

New text block

Add your copy here.

' }; break; - case 'image': - base.data = { url: '', alt: '', caption: '' }; - break; case 'image_text': base.data = { url: '', alt: '', content: '

Image and text

Add content here.

', imagePosition: 'left' }; break; case 'timeline': base.data = { items: [{ year: '2026', title: 'Milestone', description: 'Describe this moment.' }] }; break; - case 'testimonials': - base.data = { items: [{ name: 'Client name', text: 'A beautiful experience.', rating: 5 }] }; - break; - case 'services': - base.data = { items: [{ title: 'Massage session', description: 'Describe the service.', duration: '60 min', price: '£70' }] }; - break; - case 'cta': - base.data = { heading: 'Ready to book?', subtext: 'Start your next moment of calm.', buttonLabel: 'Book Now', buttonUrl: '/book' }; - break; - case 'spacer': - base.data = { size: 'md' }; - break; - case 'horizontal_cards': - base.data = { items: [{ title: 'Card title', description: 'Card description', url: '', link: '' }] }; - break; case 'hero': base.data = { heading: 'Holistic and Experiential Learning about Happiness', @@ -61,76 +31,6 @@ export function createBlock(type: BlockType): ContentBlock { backgroundImage: '' }; break; - case 'columns': - base.data = { - heading: 'Elements of Holistic Sexology', - items: [ - { title: 'Coaching and Mind Work', content: '

Explore beliefs, thoughts and emotions associated with your sexuality.

', icon: '🧠' }, - { title: 'Somatic Practices', content: '

Use sound, breathing, movement, touch to increase sensitivity.

', icon: '🧘' }, - { title: 'Harmonizing the Energy System', content: '

Techniques of Shiatsu based on Chinese medicine to resolve blockages.

', icon: '⚡' } - ] - }; - break; - case 'pricing_table': - base.data = { - heading: 'Prices', - items: [ - { duration: '60 min', price: '2000 NOK' }, - { duration: '90 min', price: '2500 NOK' }, - { duration: '120 min', price: '3000 NOK' }, - { duration: '150 min', price: '3500 NOK' }, - { duration: '180 min', price: '4000 NOK' } - ] - }; - break; - case 'newsletter': - base.data = { - heading: 'Want to stay connected?', - subtext: 'Sign up to receive my free videos and articles that allow you to know more about the secrets of sexual bliss.', - buttonLabel: 'Yes, please!', - placeholder: 'Your email address' - }; - break; - case 'articles_list': - base.data = { - heading: 'My Favourite Articles', - items: [ - { title: 'As a "real" man you need to be hard! Sexual performance anxiety in men', url: '/article1' }, - { title: 'Listen to your body! What numbness is communicating to you?', url: '/article2' }, - { title: 'Reclaim your pleasure and joy! Consent and clear empowered communication are the basis', url: '/article3' } - ] - }; - break; - case 'profile_card': - base.data = { - name: 'Alegría', - tagline: 'Holistic Sensual Massage Therapist', - image: '', - description: '

Let yourself be pampered like Caesar by Cleopatra.

', - education: ['Professional training in holistic sensual massage Core Touch I and II'], - contact: '+47 40158395', - profileUrl: '' - }; - break; - case 'features_list': - base.data = { - heading: 'In my sessions, I teach...', - categories: [ - { - title: 'For men', - items: ['Overcome sexual anxiety', 'Last as long as you want', 'Treat erectile dysfunction without drugs'] - }, - { - title: 'For women', - items: ['Increase sensitivity in the whole body', 'Unlock every possible kind of orgasm', 'Release fear, shame and trauma'] - }, - { - title: 'For couples', - items: ['Feel more connected while lovemaking', 'Master the art of Tantric sex', 'Deepen your relationship'] - } - ] - }; - break; } base.data._background = { type: 'none', color: '', imageUrl: '', attachment: 'scroll', overlay: false, overlayOpacity: 40 }; return base; diff --git a/app/src/lib/admin/editors/BlockEditor.svelte b/app/src/lib/admin/editors/BlockEditor.svelte index c0c49b1..49cfa1c 100644 --- a/app/src/lib/admin/editors/BlockEditor.svelte +++ b/app/src/lib/admin/editors/BlockEditor.svelte @@ -41,19 +41,10 @@ {#if block.type === 'text'} updateData({ content })} /> - {:else if block.type === 'image'} - updateData(image)} /> - {:else if block.type === 'image_text'} updateData(image)} />
updateData({ content })} />
- {:else if block.type === 'spacer'} - - {:else if block.type === 'cta'} - {#each ['heading', 'subtext', 'buttonLabel', 'buttonUrl'] as field} - - {/each} {:else if block.type === 'timeline'} {#each block.data.items || [] as item, i}
@@ -64,118 +55,10 @@
{/each} - {:else if block.type === 'testimonials'} - {#each block.data.items || [] as item, i} -
- updateArray('items', i, { name: e.currentTarget.value })} /> - - updateArray('items', i, { rating: Number(e.currentTarget.value) })} /> - -
- {/each} - - {:else if block.type === 'services'} - {#each block.data.items || [] as item, i} -
- {#each ['title', 'description', 'duration', 'price'] as field} - updateArray('items', i, { [field]: e.currentTarget.value })} /> - {/each} - -
- {/each} - - {:else if block.type === 'horizontal_cards'} - {#each block.data.items || [] as item, i} -
- {#each ['title', 'description', 'url', 'link'] as field} - updateArray('items', i, { [field]: e.currentTarget.value })} /> - {/each} - -
- {/each} - {:else if block.type === 'hero'} {#each ['heading', 'subheading', 'buttonLabel', 'buttonUrl', 'backgroundImage'] as field} {/each} - {:else if block.type === 'columns'} - {#each ['heading'] as field} - - {/each} -

Columns

- {#each block.data.items || [] as item, i} -
- updateArray('items', i, { title: e.currentTarget.value })} /> - updateArray('items', i, { icon: e.currentTarget.value })} /> - - -
- {/each} - - {:else if block.type === 'pricing_table'} - {#each ['heading'] as field} - - {/each} -

Price rows

- {#each block.data.items || [] as item, i} -
- updateArray('items', i, { duration: e.currentTarget.value })} /> - updateArray('items', i, { price: e.currentTarget.value })} /> - -
- {/each} - - {:else if block.type === 'newsletter'} - {#each ['heading', 'subtext', 'buttonLabel', 'placeholder'] as field} - - {/each} - {:else if block.type === 'articles_list'} - {#each ['heading'] as field} - - {/each} -

Articles

- {#each block.data.items || [] as item, i} -
- updateArray('items', i, { title: e.currentTarget.value })} /> - updateArray('items', i, { url: e.currentTarget.value })} /> - -
- {/each} - - {:else if block.type === 'profile_card'} - {#each ['name', 'tagline', 'image', 'contact', 'profileUrl'] as field} - - {/each} - -

Education

- {#each block.data.education || [] as edu, i} -
- { - const arr = [...(block.data.education || [])]; - arr[i] = e.currentTarget.value; - updateData({ education: arr }); - }} /> - -
- {/each} - - {:else if block.type === 'features_list'} - {#each ['heading'] as field} - - {/each} -

Categories

- {#each block.data.categories || [] as cat, ci} -
- updateArray('categories', ci, { title: e.currentTarget.value })} /> -

Items (one per line)

- - -
- {/each} - {/if}
diff --git a/app/src/lib/blocks/ArticlesListBlock.svelte b/app/src/lib/blocks/ArticlesListBlock.svelte deleted file mode 100644 index 12d32da..0000000 --- a/app/src/lib/blocks/ArticlesListBlock.svelte +++ /dev/null @@ -1,25 +0,0 @@ - - -
- {#if data.heading} -

{data.heading}

- {/if} -
- {#each items as item} - -
- {item.title} - → -
-
- {/each} -
-
diff --git a/app/src/lib/blocks/BlockRenderer.svelte b/app/src/lib/blocks/BlockRenderer.svelte index c581bb1..d308264 100644 --- a/app/src/lib/blocks/BlockRenderer.svelte +++ b/app/src/lib/blocks/BlockRenderer.svelte @@ -2,21 +2,9 @@ import type { ContentBlock, BlockBackground, BlockForeground } from '$lib/types'; import BackgroundWrapper from './BackgroundWrapper.svelte'; import TextBlock from './TextBlock.svelte'; - import ImageBlock from './ImageBlock.svelte'; import ImageTextBlock from './ImageTextBlock.svelte'; import TimelineBlock from './TimelineBlock.svelte'; - import TestimonialsBlock from './TestimonialsBlock.svelte'; - import ServicesBlock from './ServicesBlock.svelte'; - import CtaBlock from './CtaBlock.svelte'; - import SpacerBlock from './SpacerBlock.svelte'; - import HorizontalCardsBlock from './HorizontalCardsBlock.svelte'; import HeroBlock from './HeroBlock.svelte'; - import ColumnsBlock from './ColumnsBlock.svelte'; - import PricingTableBlock from './PricingTableBlock.svelte'; - import NewsletterBlock from './NewsletterBlock.svelte'; - import ArticlesListBlock from './ArticlesListBlock.svelte'; - import ProfileCardBlock from './ProfileCardBlock.svelte'; - import FeaturesListBlock from './FeaturesListBlock.svelte'; let { blocks = [] } = $props<{ blocks: ContentBlock[] }>(); @@ -33,36 +21,12 @@ {#if block.type === 'text'} - {:else if block.type === 'image'} - {:else if block.type === 'image_text'} {:else if block.type === 'timeline'} - {:else if block.type === 'testimonials'} - - {:else if block.type === 'services'} - - {:else if block.type === 'cta'} - - {:else if block.type === 'spacer'} - - {:else if block.type === 'horizontal_cards'} - {:else if block.type === 'hero'} - {:else if block.type === 'columns'} - - {:else if block.type === 'pricing_table'} - - {:else if block.type === 'newsletter'} - - {:else if block.type === 'articles_list'} - - {:else if block.type === 'profile_card'} - - {:else if block.type === 'features_list'} - {/if} {/each} diff --git a/app/src/lib/blocks/ColumnsBlock.svelte b/app/src/lib/blocks/ColumnsBlock.svelte deleted file mode 100644 index 3e40748..0000000 --- a/app/src/lib/blocks/ColumnsBlock.svelte +++ /dev/null @@ -1,26 +0,0 @@ - - -
- {#if data.heading} -

{data.heading}

- {/if} -
- {#each items as item, i} -
- {#if item.icon} - {item.icon} - {/if} -

{item.title}

-
{@html item.content}
-
- {/each} -
-
diff --git a/app/src/lib/blocks/CtaBlock.svelte b/app/src/lib/blocks/CtaBlock.svelte deleted file mode 100644 index b7dce10..0000000 --- a/app/src/lib/blocks/CtaBlock.svelte +++ /dev/null @@ -1,17 +0,0 @@ - - -
-
-

{data.heading || 'Ready to feel restored?'}

-

{data.subtext || 'Book a massage session designed around your body, pace, and needs.'}

- {#if data.buttonLabel} - {data.buttonLabel} - {/if} -
-
diff --git a/app/src/lib/blocks/FeaturesListBlock.svelte b/app/src/lib/blocks/FeaturesListBlock.svelte deleted file mode 100644 index 01524ef..0000000 --- a/app/src/lib/blocks/FeaturesListBlock.svelte +++ /dev/null @@ -1,30 +0,0 @@ - - -
- {#if data.heading} -

{data.heading}

- {/if} -
- {#each categories as cat, i} -
-

{cat.title}

-
    - {#each cat.items as item} -
  • - ✓ - {item} -
  • - {/each} -
-
- {/each} -
-
diff --git a/app/src/lib/blocks/HorizontalCardsBlock.svelte b/app/src/lib/blocks/HorizontalCardsBlock.svelte deleted file mode 100644 index 9b3768e..0000000 --- a/app/src/lib/blocks/HorizontalCardsBlock.svelte +++ /dev/null @@ -1,29 +0,0 @@ - - -
-
-

Explore

-

Studio highlights

-
- -
diff --git a/app/src/lib/blocks/ImageBlock.svelte b/app/src/lib/blocks/ImageBlock.svelte deleted file mode 100644 index 20cf144..0000000 --- a/app/src/lib/blocks/ImageBlock.svelte +++ /dev/null @@ -1,18 +0,0 @@ - - -
-
- {#if data.url} - {data.alt - {:else} -
Image coming soon
- {/if} - {#if data.caption} -
{data.caption}
- {/if} -
-
diff --git a/app/src/lib/blocks/NewsletterBlock.svelte b/app/src/lib/blocks/NewsletterBlock.svelte deleted file mode 100644 index 1a476e0..0000000 --- a/app/src/lib/blocks/NewsletterBlock.svelte +++ /dev/null @@ -1,23 +0,0 @@ - - -
-
-

{data.heading || 'Want to stay connected?'}

-

{data.subtext || 'Sign up to receive updates.'}

-
e.preventDefault()}> - - -
-
-
diff --git a/app/src/lib/blocks/PricingTableBlock.svelte b/app/src/lib/blocks/PricingTableBlock.svelte deleted file mode 100644 index ca0c81b..0000000 --- a/app/src/lib/blocks/PricingTableBlock.svelte +++ /dev/null @@ -1,33 +0,0 @@ - - -
- {#if data.heading} -

{data.heading}

- {/if} -
- - - - - - - - - {#each items as item} - - - - - {/each} - -
DurationPrice
{item.duration}{item.price}
-
-
diff --git a/app/src/lib/blocks/ProfileCardBlock.svelte b/app/src/lib/blocks/ProfileCardBlock.svelte deleted file mode 100644 index feea4d0..0000000 --- a/app/src/lib/blocks/ProfileCardBlock.svelte +++ /dev/null @@ -1,57 +0,0 @@ - - -
-
-
- {#if data.image} - {data.name - {:else} -
Photo
- {/if} -
-
- {#if data.name} -

{data.name}

- {/if} - {#if data.tagline} -

{data.tagline}

- {/if} - {#if data.description} -
{@html data.description}
- {/if} - {#if data.education?.length} -
-

Education

-
    - {#each data.education as edu} -
  • - - {edu} -
  • - {/each} -
-
- {/if} - {#if data.contact} -

Contact: {data.contact}

- {/if} - {#if data.profileUrl} - View full profile - {/if} -
-
-
diff --git a/app/src/lib/blocks/ServicesBlock.svelte b/app/src/lib/blocks/ServicesBlock.svelte deleted file mode 100644 index a41e3c2..0000000 --- a/app/src/lib/blocks/ServicesBlock.svelte +++ /dev/null @@ -1,28 +0,0 @@ - - -
-
-

Treatments

-

Services

-
-
- {#each items as item, i} -
-
-

{item.title}

- {item.duration} -
-

{item.description}

-

{item.price}

-
- {/each} -
-
diff --git a/app/src/lib/blocks/SpacerBlock.svelte b/app/src/lib/blocks/SpacerBlock.svelte deleted file mode 100644 index 8ff7f06..0000000 --- a/app/src/lib/blocks/SpacerBlock.svelte +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/app/src/lib/blocks/TestimonialsBlock.svelte b/app/src/lib/blocks/TestimonialsBlock.svelte deleted file mode 100644 index dcf4564..0000000 --- a/app/src/lib/blocks/TestimonialsBlock.svelte +++ /dev/null @@ -1,55 +0,0 @@ - - -
(paused = true)} onmouseleave={() => (paused = false)} role="region" aria-label="Testimonials carousel"> -
-
-
-

Kind words

-

Client experiences

-
-
- - -
-
- - -
-
diff --git a/app/src/lib/types.ts b/app/src/lib/types.ts index 17df8af..b076c8a 100644 --- a/app/src/lib/types.ts +++ b/app/src/lib/types.ts @@ -1,20 +1,8 @@ export type BlockType = | 'text' - | 'image' | 'image_text' | 'timeline' - | 'testimonials' - | 'services' - | 'cta' - | 'spacer' - | 'horizontal_cards' - | 'hero' - | 'columns' - | 'pricing_table' - | 'newsletter' - | 'articles_list' - | 'profile_card' - | 'features_list'; + | 'hero'; export type BlockBackground = { type: 'none' | 'color' | 'image';