@kustomizer/visual-editor 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"kustomizer-visual-editor.mjs","sources":["../../../projects/visual-editor/src/lib/navigation/visual-editor-navigation.types.ts","../../../projects/visual-editor/src/lib/navigation/default-router-navigation.service.ts","../../../projects/visual-editor/src/lib/services/page-memory.repository.ts","../../../projects/visual-editor/src/lib/models/page.model.ts","../../../projects/visual-editor/src/lib/services/shopify-graphql-client.service.ts","../../../projects/visual-editor/src/lib/services/shopify-metafield-repository.service.ts","../../../projects/visual-editor/src/lib/services/page-shopify-repository.service.ts","../../../projects/visual-editor/src/lib/services/page.service.ts","../../../projects/visual-editor/src/lib/page-loading/page-loading-strategy.types.ts","../../../projects/visual-editor/src/lib/config/visual-editor-config.types.ts","../../../projects/visual-editor/src/lib/provide-visual-editor.ts","../../../projects/visual-editor/src/lib/store/visual-editor.state.ts","../../../projects/visual-editor/src/lib/store/visual-editor.actions.ts","../../../projects/visual-editor/src/lib/store/visual-editor.reducer.ts","../../../projects/visual-editor/src/lib/store/visual-editor.selectors.ts","../../../projects/visual-editor/src/lib/store/provide-visual-editor-store.ts","../../../projects/visual-editor/src/lib/registry/provide-editor-components.ts","../../../projects/visual-editor/src/lib/registry/component-registry.service.ts","../../../projects/visual-editor/src/lib/components/dynamic-renderer.component.ts","../../../projects/visual-editor/src/lib/components/slot-renderer.component.ts","../../../projects/visual-editor/src/lib/services/visual-editor-facade.service.ts","../../../projects/visual-editor/src/lib/services/iframe-bridge.service.ts","../../../projects/visual-editor/src/lib/dnd/drag-drop.service.ts","../../../projects/visual-editor/src/lib/components/editor/block-tree-item.component.ts","../../../projects/visual-editor/src/lib/services/shopify-files.service.ts","../../../projects/visual-editor/src/lib/components/editor/shopify-file-picker.component.ts","../../../projects/visual-editor/src/lib/components/editor/visual-editor.component.ts","../../../projects/visual-editor/src/lib/components/page-manager/page-manager.component.ts","../../../projects/visual-editor/src/lib/services/storefront-graphql-client.service.ts","../../../projects/visual-editor/src/lib/services/storefront-metafield-repository.service.ts","../../../projects/visual-editor/src/lib/services/page-storefront-repository.service.ts","../../../projects/visual-editor/src/lib/services/manifest-loader.service.ts","../../../projects/visual-editor/src/lib/visual-editor.ts","../../../projects/visual-editor/src/public-api.ts","../../../projects/visual-editor/src/kustomizer-visual-editor.ts"],"sourcesContent":["import { Observable } from 'rxjs';\n\n/**\n * Navigation target for the visual editor\n */\nexport type VisualEditorNavigationTarget =\n | { type: 'page-list' }\n | { type: 'page-edit'; pageId: string }\n | { type: 'page-preview'; pageId: string }\n | { type: 'setup' };\n\n/**\n * Confirmation dialog options\n */\nexport interface ConfirmDialogOptions {\n title: string;\n message: string;\n confirmText?: string;\n cancelText?: string;\n}\n\n/**\n * Abstract navigation service that consumers can implement\n * to customize how the visual editor navigates between views\n */\nexport abstract class VisualEditorNavigation {\n /**\n * Navigate to a target within the editor context\n */\n abstract navigate(target: VisualEditorNavigationTarget): void;\n\n /**\n * Show a confirmation dialog\n * Returns Observable<boolean> to support async dialogs (e.g., Material Dialog)\n */\n abstract confirm(options: ConfirmDialogOptions): Observable<boolean>;\n\n /**\n * Get the current page ID from the navigation context\n * Returns null if not on a page edit route\n */\n abstract getCurrentPageId(): Observable<string | null>;\n}\n","import { inject, Injectable, InjectionToken } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { map, Observable, of, startWith } from 'rxjs';\nimport {\n ConfirmDialogOptions,\n VisualEditorNavigation,\n VisualEditorNavigationTarget,\n} from './visual-editor-navigation.types';\n\n/**\n * Configuration for the default router navigation\n */\nexport interface RouterNavigationConfig {\n /** Route path for page list (default: '/admin') */\n pageListPath: string;\n /** Route path pattern for page edit (default: '/admin/pages/:pageId') */\n pageEditPath: string;\n /** Route path pattern for preview (optional) */\n pagePreviewPath?: string;\n /** Route param name for page ID (default: 'pageId') */\n pageIdParam: string;\n}\n\n/**\n * Default router navigation configuration\n */\nexport const DEFAULT_ROUTER_NAVIGATION_CONFIG: RouterNavigationConfig = {\n pageListPath: '/admin',\n pageEditPath: '/admin/pages/:pageId',\n pageIdParam: 'pageId',\n};\n\n/**\n * Injection token for router navigation configuration\n */\nexport const ROUTER_NAVIGATION_CONFIG = new InjectionToken<RouterNavigationConfig>(\n 'ROUTER_NAVIGATION_CONFIG',\n {\n providedIn: 'root',\n factory: () => DEFAULT_ROUTER_NAVIGATION_CONFIG,\n }\n);\n\n/**\n * Default navigation service implementation using Angular Router\n */\n@Injectable()\nexport class DefaultRouterNavigationService extends VisualEditorNavigation {\n private readonly router = inject(Router);\n private readonly route = inject(ActivatedRoute);\n private readonly config = inject(ROUTER_NAVIGATION_CONFIG);\n\n navigate(target: VisualEditorNavigationTarget): void {\n switch (target.type) {\n case 'page-list':\n this.router.navigate([this.config.pageListPath]);\n break;\n case 'page-edit': {\n const editPath = this.config.pageEditPath.replace(\n `:${this.config.pageIdParam}`,\n target.pageId\n );\n this.router.navigate([editPath]);\n break;\n }\n case 'page-preview':\n if (this.config.pagePreviewPath) {\n const previewPath = this.config.pagePreviewPath.replace(\n `:${this.config.pageIdParam}`,\n target.pageId\n );\n this.router.navigate([previewPath]);\n }\n break;\n case 'setup':\n this.router.navigate(['/setup']);\n break;\n }\n }\n\n confirm(options: ConfirmDialogOptions): Observable<boolean> {\n // Default to window.confirm - consumers can override with custom dialogs\n // eslint-disable-next-line no-restricted-globals\n return of(confirm(options.message));\n }\n\n getCurrentPageId(): Observable<string | null> {\n // Extract pageId from URL using the configured path pattern\n const extractPageIdFromUrl = (): string | null => {\n const url = this.router.url;\n // Convert pageEditPath pattern to regex\n // e.g., '/admin/pages/:pageId' -> /\\/admin\\/pages\\/([^\\/]+)/\n const paramPlaceholder = `:${this.config.pageIdParam}`;\n const pattern = this.config.pageEditPath\n .replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&') // Escape regex special chars\n .replace(paramPlaceholder.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), '([^/]+)');\n\n const regex = new RegExp(pattern);\n const match = url.match(regex);\n return match ? match[1] : null;\n };\n\n // Emit initial value immediately, then on each navigation event\n return this.router.events.pipe(\n startWith(null), // Trigger initial emission\n map(() => extractPageIdFromUrl())\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Observable, of, delay, throwError } from 'rxjs';\nimport {\n CreatePageRequest,\n Page,\n PageSummary,\n PublishPageRequest,\n UpdatePageRequest,\n} from '../models/page.model';\n\n/**\n * In-memory page repository for development/testing.\n * Simulates backend API with artificial delay.\n */\n@Injectable({ providedIn: 'root' })\nexport class PageMemoryRepository {\n private pages: Map<string, Page> = new Map();\n private readonly DELAY_MS = 300;\n\n constructor() {\n this.seedData();\n }\n\n private seedData(): void {\n const samplePages: Page[] = [\n {\n id: 'page-1',\n slug: 'home',\n title: 'Home Page',\n description: 'The main landing page',\n sections: [\n {\n id: 'section-1',\n type: 'hero-section',\n props: {\n title: 'Welcome to Our Store',\n subtitle: 'Discover amazing products',\n ctaText: 'Shop Now',\n ctaUrl: '/products',\n backgroundImage: '',\n backgroundColor: '#1a1a2e',\n },\n elements: [],\n },\n ],\n status: 'published',\n createdAt: '2024-01-15T10:00:00Z',\n updatedAt: '2024-01-20T14:30:00Z',\n publishedAt: '2024-01-20T14:30:00Z',\n version: 3,\n },\n {\n id: 'page-2',\n slug: 'about',\n title: 'About Us',\n description: 'Learn more about our company',\n sections: [\n {\n id: 'section-2',\n type: 'hero-section',\n props: {\n title: 'About Our Company',\n subtitle: 'Building the future, one product at a time',\n ctaText: 'Contact Us',\n ctaUrl: '/contact',\n backgroundColor: '#2d3436',\n },\n elements: [],\n },\n {\n id: 'section-3',\n type: 'features-grid',\n props: {\n title: 'Our Values',\n columns: 3,\n },\n elements: [\n {\n id: 'feature-1',\n type: 'feature-item',\n slotName: 'features',\n props: {\n icon: '🎯',\n title: 'Quality First',\n description: 'We never compromise on quality',\n },\n },\n {\n id: 'feature-2',\n type: 'feature-item',\n slotName: 'features',\n props: {\n icon: '💡',\n title: 'Innovation',\n description: 'Always pushing boundaries',\n },\n },\n {\n id: 'feature-3',\n type: 'feature-item',\n slotName: 'features',\n props: {\n icon: '🤝',\n title: 'Trust',\n description: 'Building lasting relationships',\n },\n },\n ],\n },\n ],\n status: 'draft',\n createdAt: '2024-02-01T09:00:00Z',\n updatedAt: '2024-02-05T11:00:00Z',\n version: 2,\n },\n {\n id: 'page-3',\n slug: 'contact',\n title: 'Contact Us',\n description: 'Get in touch with our team',\n sections: [],\n status: 'draft',\n createdAt: '2024-02-10T08:00:00Z',\n updatedAt: '2024-02-10T08:00:00Z',\n version: 1,\n },\n ];\n\n samplePages.forEach((page) => this.pages.set(page.id, page));\n }\n\n private generateId(): string {\n return `page-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;\n }\n\n private toSummary(page: Page): PageSummary {\n return {\n id: page.id,\n slug: page.slug,\n title: page.title,\n status: page.status,\n updatedAt: page.updatedAt,\n publishedAt: page.publishedAt,\n };\n }\n\n getPages(): Observable<PageSummary[]> {\n const summaries = Array.from(this.pages.values())\n .map((p) => this.toSummary(p))\n .sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime());\n return of(summaries).pipe(delay(this.DELAY_MS));\n }\n\n getPage(id: string): Observable<Page> {\n const page = this.pages.get(id);\n if (!page) {\n return throwError(() => new Error(`Page not found: ${id}`)).pipe(delay(this.DELAY_MS));\n }\n return of(structuredClone(page)).pipe(delay(this.DELAY_MS));\n }\n\n getPublishedPageBySlug(slug: string): Observable<Page> {\n const page = Array.from(this.pages.values()).find(\n (p) => p.slug === slug && p.status === 'published'\n );\n if (!page) {\n return throwError(() => new Error(`Published page not found: ${slug}`)).pipe(\n delay(this.DELAY_MS)\n );\n }\n return of(structuredClone(page)).pipe(delay(this.DELAY_MS));\n }\n\n createPage(request: CreatePageRequest): Observable<Page> {\n // Check for duplicate slug\n const existingSlug = Array.from(this.pages.values()).find((p) => p.slug === request.slug);\n if (existingSlug) {\n return throwError(() => new Error(`Slug already exists: ${request.slug}`)).pipe(\n delay(this.DELAY_MS)\n );\n }\n\n const now = new Date().toISOString();\n const page: Page = {\n id: this.generateId(),\n slug: request.slug,\n title: request.title,\n description: request.description,\n sections: [],\n status: 'draft',\n createdAt: now,\n updatedAt: now,\n version: 1,\n };\n\n this.pages.set(page.id, page);\n console.log('[PageMemoryRepository] Created page:', page.id, page.title);\n return of(structuredClone(page)).pipe(delay(this.DELAY_MS));\n }\n\n updatePage(id: string, request: UpdatePageRequest): Observable<Page> {\n const page = this.pages.get(id);\n if (!page) {\n return throwError(() => new Error(`Page not found: ${id}`)).pipe(delay(this.DELAY_MS));\n }\n\n // Optimistic locking check\n if (request.version !== page.version) {\n return throwError(\n () => new Error(`Version conflict. Expected ${page.version}, got ${request.version}`)\n ).pipe(delay(this.DELAY_MS));\n }\n\n // Check for duplicate slug if changing\n if (request.slug && request.slug !== page.slug) {\n const existingSlug = Array.from(this.pages.values()).find(\n (p) => p.slug === request.slug && p.id !== id\n );\n if (existingSlug) {\n return throwError(() => new Error(`Slug already exists: ${request.slug}`)).pipe(\n delay(this.DELAY_MS)\n );\n }\n }\n\n const updatedPage: Page = {\n ...page,\n title: request.title ?? page.title,\n slug: request.slug ?? page.slug,\n description: request.description ?? page.description,\n sections: request.sections ?? page.sections,\n updatedAt: new Date().toISOString(),\n version: page.version + 1,\n };\n\n this.pages.set(id, updatedPage);\n console.log('[PageMemoryRepository] Updated page:', id, 'v' + updatedPage.version);\n console.log('[PageMemoryRepository] Sections JSON:', JSON.stringify(updatedPage.sections, null, 2));\n return of(structuredClone(updatedPage)).pipe(delay(this.DELAY_MS));\n }\n\n deletePage(id: string): Observable<void> {\n if (!this.pages.has(id)) {\n return throwError(() => new Error(`Page not found: ${id}`)).pipe(delay(this.DELAY_MS));\n }\n\n this.pages.delete(id);\n console.log('[PageMemoryRepository] Deleted page:', id);\n return of(undefined).pipe(delay(this.DELAY_MS));\n }\n\n publishPage(id: string, request: PublishPageRequest): Observable<Page> {\n const page = this.pages.get(id);\n if (!page) {\n return throwError(() => new Error(`Page not found: ${id}`)).pipe(delay(this.DELAY_MS));\n }\n\n if (request.version !== page.version) {\n return throwError(\n () => new Error(`Version conflict. Expected ${page.version}, got ${request.version}`)\n ).pipe(delay(this.DELAY_MS));\n }\n\n const now = new Date().toISOString();\n const updatedPage: Page = {\n ...page,\n status: 'published',\n publishedAt: now,\n updatedAt: now,\n version: page.version + 1,\n };\n\n this.pages.set(id, updatedPage);\n console.log('[PageMemoryRepository] Published page:', id);\n return of(structuredClone(updatedPage)).pipe(delay(this.DELAY_MS));\n }\n\n unpublishPage(id: string, request: PublishPageRequest): Observable<Page> {\n const page = this.pages.get(id);\n if (!page) {\n return throwError(() => new Error(`Page not found: ${id}`)).pipe(delay(this.DELAY_MS));\n }\n\n if (request.version !== page.version) {\n return throwError(\n () => new Error(`Version conflict. Expected ${page.version}, got ${request.version}`)\n ).pipe(delay(this.DELAY_MS));\n }\n\n const updatedPage: Page = {\n ...page,\n status: 'draft',\n updatedAt: new Date().toISOString(),\n version: page.version + 1,\n };\n\n this.pages.set(id, updatedPage);\n console.log('[PageMemoryRepository] Unpublished page:', id);\n return of(structuredClone(updatedPage)).pipe(delay(this.DELAY_MS));\n }\n\n duplicatePage(id: string): Observable<Page> {\n const page = this.pages.get(id);\n if (!page) {\n return throwError(() => new Error(`Page not found: ${id}`)).pipe(delay(this.DELAY_MS));\n }\n\n const now = new Date().toISOString();\n const newPage: Page = {\n ...structuredClone(page),\n id: this.generateId(),\n slug: `${page.slug}-copy-${Date.now()}`,\n title: `${page.title} (Copy)`,\n status: 'draft',\n createdAt: now,\n updatedAt: now,\n publishedAt: undefined,\n version: 1,\n };\n\n this.pages.set(newPage.id, newPage);\n console.log('[PageMemoryRepository] Duplicated page:', id, '->', newPage.id);\n return of(structuredClone(newPage)).pipe(delay(this.DELAY_MS));\n }\n\n // Utility method to reset to initial state (useful for testing)\n reset(): void {\n this.pages.clear();\n this.seedData();\n console.log('[PageMemoryRepository] Reset to initial state');\n }\n\n // Utility method to get all pages (useful for debugging)\n getAllPages(): Page[] {\n return Array.from(this.pages.values());\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { EditorSection } from '../store/visual-editor.state';\n\n/**\n * Shopify configuration for GraphQL API access\n */\nexport interface ShopifyConfig {\n shopDomain: string;\n accessToken: string;\n apiVersion: string;\n /** Optional proxy URL for development (bypasses CORS) */\n proxyUrl?: string;\n}\n\n/**\n * Injection token for Shopify configuration\n * Can be provided as a static object or as an Observable for dynamic config\n */\nexport const SHOPIFY_CONFIG = new InjectionToken<ShopifyConfig | Observable<ShopifyConfig>>('SHOPIFY_CONFIG', {\n providedIn: 'root',\n factory: () => ({\n shopDomain: '',\n accessToken: '',\n apiVersion: '2026-01',\n proxyUrl: '/shopify-api/graphql.json',\n }),\n});\n\n/**\n * Metafield representation from Shopify\n */\nexport interface Metafield {\n id: string;\n namespace: string;\n key: string;\n value: string;\n type: string;\n createdAt?: string;\n updatedAt?: string;\n}\n\n/**\n * Page status - draft pages are only visible in admin, published pages are public\n */\nexport type PageStatus = 'draft' | 'published';\n\n/**\n * Entry in the pages index (lightweight reference)\n */\nexport interface PageIndexEntry {\n id: string;\n slug: string;\n title: string;\n status: PageStatus;\n updatedAt: string;\n publishedAt?: string;\n size: number;\n /** MetafieldDefinition ID for this page's metafield (enables Storefront API access) */\n definitionId?: string;\n}\n\n/**\n * Index of all pages stored in a single metafield\n */\nexport interface PagesIndex {\n version: number;\n lastUpdated: string;\n pages: PageIndexEntry[];\n}\n\n/**\n * Full page model with all content\n */\nexport interface Page {\n id: string;\n slug: string;\n title: string;\n description?: string;\n sections: EditorSection[];\n status: PageStatus;\n createdAt: string;\n updatedAt: string;\n publishedAt?: string;\n version: number;\n}\n\n/**\n * Lightweight page summary for listing\n */\nexport interface PageSummary {\n id: string;\n slug: string;\n title: string;\n status: PageStatus;\n updatedAt: string;\n publishedAt?: string;\n}\n\n/**\n * Page context stored in editor state (minimal info needed while editing)\n */\nexport interface PageContext {\n id: string;\n slug: string;\n title: string;\n status: PageStatus;\n version: number;\n}\n\n/**\n * Request payload for creating a new page\n */\nexport interface CreatePageRequest {\n title: string;\n slug: string;\n description?: string;\n}\n\n/**\n * Request payload for updating an existing page\n */\nexport interface UpdatePageRequest {\n title?: string;\n slug?: string;\n description?: string;\n sections?: EditorSection[];\n version: number;\n}\n\n/**\n * Request payload for publishing/unpublishing\n */\nexport interface PublishPageRequest {\n version: number;\n}\n\n/**\n * Shopify Storefront API configuration (read-only, public access)\n */\nexport interface StorefrontConfig {\n shopDomain: string;\n storefrontAccessToken: string;\n apiVersion: string;\n /** Optional proxy URL for SSR (avoids CORS) */\n proxyUrl?: string;\n}\n\n/**\n * Injection token for Storefront API configuration.\n * Used by the public-storefront to read metafields via the Storefront API.\n */\nexport const STOREFRONT_CONFIG = new InjectionToken<StorefrontConfig>('STOREFRONT_CONFIG');\n\n/**\n * Injection token for the client storefront URL.\n * The editor uses this to:\n * 1. Fetch the component manifest (`{url}/kustomizer/manifest.json`)\n * 2. Embed the live preview iframe (`{url}/kustomizer/editor`)\n */\nexport const STOREFRONT_URL = new InjectionToken<string>('STOREFRONT_URL', {\n providedIn: 'root',\n factory: () => '',\n});\n","import { HttpClient, HttpErrorResponse } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { Observable, throwError, isObservable } from 'rxjs';\nimport { catchError, map, switchMap } from 'rxjs/operators';\nimport { SHOPIFY_CONFIG, ShopifyConfig } from '../models/page.model';\n\ninterface GraphQLRequest {\n query: string;\n variables?: Record<string, any>;\n}\n\ninterface GraphQLResponse<T = any> {\n data?: T;\n errors?: Array<{\n message: string;\n locations?: Array<{ line: number; column: number }>;\n path?: string[];\n extensions?: Record<string, any>;\n }>;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ShopifyGraphQLClient {\n private readonly http = inject(HttpClient);\n private readonly config = inject(SHOPIFY_CONFIG);\n\n query<T>(query: string, variables?: Record<string, any>): Observable<T> {\n return this.executeOperation<T>(query, variables);\n }\n\n mutate<T>(mutation: string, variables?: Record<string, any>): Observable<T> {\n return this.executeOperation<T>(mutation, variables);\n }\n\n private executeOperation<T>(operation: string, variables?: Record<string, any>): Observable<T> {\n const config$ = isObservable(this.config)\n ? this.config as Observable<ShopifyConfig>\n : new Observable<ShopifyConfig>(subscriber => {\n subscriber.next(this.config as ShopifyConfig);\n subscriber.complete();\n });\n\n return config$.pipe(\n switchMap((config: ShopifyConfig) => {\n // Use proxy URL if available (for development), otherwise direct Shopify URL\n const url = config.proxyUrl\n ? config.proxyUrl\n : `https://${config.shopDomain}/admin/api/${config.apiVersion}/graphql.json`;\n\n const request: GraphQLRequest = {\n query: operation,\n variables,\n };\n\n // When using proxy, headers are set by the proxy config\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n };\n\n // Only add access token header when not using proxy\n if (!config.proxyUrl) {\n headers['X-Shopify-Access-Token'] = config.accessToken;\n }\n\n return this.http.post<GraphQLResponse<T>>(url, request, { headers }).pipe(\n map(response => this.handleResponse<T>(response)),\n catchError(error => this.handleError(error))\n );\n })\n );\n }\n\n private handleResponse<T>(response: GraphQLResponse<T>): T {\n if (response.errors && response.errors.length > 0) {\n throw {\n code: 'GRAPHQL_ERROR',\n message: response.errors[0].message,\n errors: response.errors,\n };\n }\n\n if (!response.data) {\n throw {\n code: 'EMPTY_RESPONSE',\n message: 'GraphQL response contains no data',\n };\n }\n\n return response.data;\n }\n\n private handleError(error: HttpErrorResponse): Observable<never> {\n let errorCode = 'UNKNOWN_ERROR';\n let errorMessage = 'An unknown error occurred';\n\n if (typeof ErrorEvent !== 'undefined' && error.error instanceof ErrorEvent) {\n errorCode = 'NETWORK_ERROR';\n errorMessage = error.error.message;\n } else {\n switch (error.status) {\n case 401:\n errorCode = 'UNAUTHORIZED';\n errorMessage = 'Invalid or expired access token';\n break;\n case 403:\n errorCode = 'FORBIDDEN';\n errorMessage = 'Insufficient permissions';\n break;\n case 429:\n errorCode = 'RATE_LIMIT';\n errorMessage = 'Rate limit exceeded';\n break;\n case 500:\n case 502:\n case 503:\n case 504:\n errorCode = 'SERVER_ERROR';\n errorMessage = 'Shopify server error';\n break;\n default:\n errorCode = 'HTTP_ERROR';\n errorMessage = `HTTP ${error.status}: ${error.statusText}`;\n }\n }\n\n return throwError(() => ({\n code: errorCode,\n message: errorMessage,\n status: error.status,\n original: error,\n }));\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { Observable, of, throwError } from 'rxjs';\nimport { map, switchMap } from 'rxjs/operators';\nimport { Metafield, Page, PagesIndex } from '../models/page.model';\nimport { ShopifyGraphQLClient } from './shopify-graphql-client.service';\n\nexport const NAMESPACE = 'kustomizer';\nexport const INDEX_KEY = 'pages_index';\nexport const MAX_METAFIELD_SIZE = 64 * 1024;\n\nexport const GET_SHOP_METAFIELD_QUERY = `\n query GetShopMetafield($namespace: String!, $key: String!) {\n shop {\n id\n metafield(namespace: $namespace, key: $key) {\n id\n value\n createdAt\n updatedAt\n }\n }\n }\n`;\n\nexport const SET_METAFIELD_MUTATION = `\n mutation SetMetafield($metafields: [MetafieldsSetInput!]!) {\n metafieldsSet(metafields: $metafields) {\n metafields {\n id\n namespace\n key\n value\n }\n userErrors {\n field\n message\n }\n }\n }\n`;\n\nexport const DELETE_METAFIELDS_MUTATION = `\n mutation DeleteMetafields($metafields: [MetafieldIdentifierInput!]!) {\n metafieldsDelete(metafields: $metafields) {\n deletedMetafields {\n key\n namespace\n }\n userErrors {\n field\n message\n }\n }\n }\n`;\n\nexport const CREATE_METAFIELD_DEFINITION_MUTATION = `\n mutation CreateMetafieldDefinition($definition: MetafieldDefinitionInput!) {\n metafieldDefinitionCreate(definition: $definition) {\n createdDefinition {\n id\n }\n userErrors {\n field\n message\n code\n }\n }\n }\n`;\n\nexport const DELETE_METAFIELD_DEFINITION_MUTATION = `\n mutation DeleteMetafieldDefinition($id: ID!) {\n metafieldDefinitionDelete(id: $id) {\n deletedDefinitionId\n userErrors {\n field\n message\n code\n }\n }\n }\n`;\n\nexport const GET_METAFIELD_DEFINITION_QUERY = `\n query GetMetafieldDefinition($ownerType: MetafieldOwnerType!, $namespace: String, $key: String!) {\n metafieldDefinition(identifier: { ownerType: $ownerType, namespace: $namespace, key: $key }) {\n id\n }\n }\n`;\n\nexport const GET_SHOP_ID_QUERY = `\n query GetShopId {\n shop {\n id\n }\n }\n`;\n\ninterface GetMetafieldResponse {\n shop: {\n id: string;\n metafield: {\n id: string;\n value: string;\n createdAt?: string;\n updatedAt?: string;\n } | null;\n };\n}\n\ninterface SetMetafieldResponse {\n metafieldsSet: {\n metafields: Array<{\n id: string;\n namespace: string;\n key: string;\n value: string;\n }>;\n userErrors: Array<{\n field: string;\n message: string;\n }>;\n };\n}\n\ninterface DeleteMetafieldsResponse {\n metafieldsDelete: {\n deletedMetafields: Array<{\n key: string;\n namespace: string;\n }>;\n userErrors: Array<{\n field: string;\n message: string;\n }>;\n };\n}\n\ninterface CreateMetafieldDefinitionResponse {\n metafieldDefinitionCreate: {\n createdDefinition: { id: string } | null;\n userErrors: Array<{\n field: string;\n message: string;\n code: string;\n }>;\n };\n}\n\ninterface DeleteMetafieldDefinitionResponse {\n metafieldDefinitionDelete: {\n deletedDefinitionId: string | null;\n userErrors: Array<{\n field: string;\n message: string;\n code: string;\n }>;\n };\n}\n\ninterface GetMetafieldDefinitionResponse {\n metafieldDefinition: { id: string } | null;\n}\n\ninterface GetShopIdResponse {\n shop: {\n id: string;\n };\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ShopifyMetafieldRepository {\n private readonly client = inject(ShopifyGraphQLClient);\n\n getMetafield(namespace: string, key: string): Observable<Metafield | null> {\n return this.client.query<GetMetafieldResponse>(GET_SHOP_METAFIELD_QUERY, { namespace, key }).pipe(\n map(response => {\n if (!response.shop.metafield) {\n return null;\n }\n\n return {\n id: response.shop.metafield.id,\n namespace,\n key,\n value: response.shop.metafield.value,\n type: 'json',\n createdAt: response.shop.metafield.createdAt,\n updatedAt: response.shop.metafield.updatedAt,\n };\n })\n );\n }\n\n setMetafield(namespace: string, key: string, value: any, ownerId: string): Observable<Metafield> {\n const valueString = typeof value === 'string' ? value : JSON.stringify(value);\n\n const validation = this.validateSize(value);\n if (!validation.valid) {\n return throwError(() => ({\n code: 'SIZE_EXCEEDED',\n message: `Metafield size exceeds ${MAX_METAFIELD_SIZE} bytes limit`,\n size: validation.size,\n maxSize: MAX_METAFIELD_SIZE,\n percentUsed: validation.percentUsed,\n }));\n }\n\n const metafields = [{\n namespace,\n key,\n value: valueString,\n type: 'json',\n ownerId,\n }];\n\n return this.client.mutate<SetMetafieldResponse>(SET_METAFIELD_MUTATION, { metafields }).pipe(\n map(response => {\n if (response.metafieldsSet.userErrors.length > 0) {\n throw {\n code: 'SHOPIFY_METAFIELD_ERROR',\n message: response.metafieldsSet.userErrors[0].message,\n errors: response.metafieldsSet.userErrors,\n };\n }\n\n const metafield = response.metafieldsSet.metafields[0];\n return {\n id: metafield.id,\n namespace: metafield.namespace,\n key: metafield.key,\n value: metafield.value,\n type: 'json',\n };\n })\n );\n }\n\n deleteMetafield(namespace: string, key: string): Observable<void> {\n return this.getShopId().pipe(\n switchMap(shopId => {\n const metafields = [{\n ownerId: shopId,\n namespace,\n key,\n }];\n\n return this.client.mutate<DeleteMetafieldsResponse>(DELETE_METAFIELDS_MUTATION, { metafields }).pipe(\n map(response => {\n if (response.metafieldsDelete.userErrors.length > 0) {\n throw {\n code: 'SHOPIFY_METAFIELD_ERROR',\n message: response.metafieldsDelete.userErrors[0].message,\n errors: response.metafieldsDelete.userErrors,\n };\n }\n })\n );\n })\n );\n }\n\n getShopId(): Observable<string> {\n return this.client.query<GetShopIdResponse>(GET_SHOP_ID_QUERY).pipe(\n map(response => response.shop.id)\n );\n }\n\n getPageIndex(): Observable<PagesIndex> {\n return this.getMetafield(NAMESPACE, INDEX_KEY).pipe(\n map(metafield => {\n if (!metafield) {\n return this.getDefaultIndex();\n }\n\n try {\n const parsed = JSON.parse(metafield.value);\n if (!parsed.pages || !Array.isArray(parsed.pages)) {\n throw new Error('Invalid index structure');\n }\n return parsed as PagesIndex;\n } catch (error) {\n throw {\n code: 'INDEX_PARSE_ERROR',\n message: 'Stored index data is corrupted',\n original: error,\n };\n }\n })\n );\n }\n\n updatePageIndex(index: PagesIndex): Observable<PagesIndex> {\n return this.getShopId().pipe(\n switchMap(shopId => {\n const updatedIndex: PagesIndex = {\n ...index,\n version: index.version + 1,\n lastUpdated: new Date().toISOString(),\n };\n\n return this.setMetafield(NAMESPACE, INDEX_KEY, updatedIndex, shopId).pipe(\n map(() => updatedIndex)\n );\n })\n );\n }\n\n getPageMetafield(pageId: string): Observable<Page | null> {\n const key = `page_${pageId}`;\n return this.getMetafield(NAMESPACE, key).pipe(\n map(metafield => {\n if (!metafield) {\n return null;\n }\n\n try {\n return JSON.parse(metafield.value) as Page;\n } catch (error) {\n throw {\n code: 'PAGE_PARSE_ERROR',\n message: 'Stored page data is corrupted',\n original: error,\n };\n }\n })\n );\n }\n\n setPageMetafield(pageId: string, page: Page): Observable<Page> {\n const key = `page_${pageId}`;\n return this.getShopId().pipe(\n switchMap(shopId => {\n return this.setMetafield(NAMESPACE, key, page, shopId).pipe(\n map(() => page)\n );\n })\n );\n }\n\n deletePageMetafield(pageId: string): Observable<void> {\n const key = `page_${pageId}`;\n return this.deleteMetafield(NAMESPACE, key);\n }\n\n /**\n * Create a MetafieldDefinition with PUBLIC_READ storefront access.\n * Idempotent: if definition already exists, returns the existing ID.\n */\n createMetafieldDefinition(namespace: string, key: string, name: string): Observable<string> {\n return this.client.mutate<CreateMetafieldDefinitionResponse>(CREATE_METAFIELD_DEFINITION_MUTATION, {\n definition: {\n namespace,\n key,\n name,\n ownerType: 'SHOP',\n type: 'json',\n access: {\n storefront: 'PUBLIC_READ',\n },\n },\n }).pipe(\n switchMap(response => {\n const { createdDefinition, userErrors } = response.metafieldDefinitionCreate;\n if (createdDefinition) {\n return of(createdDefinition.id);\n }\n // If definition already exists, look it up instead of failing\n const alreadyExists = userErrors.some(e => e.code === 'TAKEN' || e.code === 'ALREADY_EXISTS');\n if (alreadyExists) {\n return this.getMetafieldDefinitionId(namespace, key);\n }\n throw {\n code: 'METAFIELD_DEFINITION_ERROR',\n message: userErrors[0]?.message || 'Failed to create metafield definition',\n errors: userErrors,\n };\n })\n );\n }\n\n /**\n * Delete a MetafieldDefinition by ID. Does not delete associated metafields.\n */\n deleteMetafieldDefinition(definitionId: string): Observable<void> {\n return this.client.mutate<DeleteMetafieldDefinitionResponse>(DELETE_METAFIELD_DEFINITION_MUTATION, {\n id: definitionId,\n }).pipe(\n map(response => {\n if (response.metafieldDefinitionDelete.userErrors.length > 0) {\n throw {\n code: 'METAFIELD_DEFINITION_ERROR',\n message: response.metafieldDefinitionDelete.userErrors[0].message,\n errors: response.metafieldDefinitionDelete.userErrors,\n };\n }\n })\n );\n }\n\n /**\n * Look up a MetafieldDefinition ID by namespace and key.\n */\n getMetafieldDefinitionId(namespace: string, key: string): Observable<string> {\n return this.client.query<GetMetafieldDefinitionResponse>(GET_METAFIELD_DEFINITION_QUERY, {\n ownerType: 'SHOP',\n namespace,\n key,\n }).pipe(\n map(response => {\n if (!response.metafieldDefinition) {\n throw {\n code: 'DEFINITION_NOT_FOUND',\n message: `MetafieldDefinition not found for ${namespace}.${key}`,\n };\n }\n return response.metafieldDefinition.id;\n })\n );\n }\n\n validateSize(data: any): { valid: boolean; size: number; percentUsed: number } {\n const json = JSON.stringify(data);\n const size = new Blob([json]).size;\n const percentUsed = (size / MAX_METAFIELD_SIZE) * 100;\n\n return {\n valid: size <= MAX_METAFIELD_SIZE,\n size,\n percentUsed: parseFloat(percentUsed.toFixed(2)),\n };\n }\n\n private getDefaultIndex(): PagesIndex {\n return {\n version: 0,\n lastUpdated: new Date().toISOString(),\n pages: [],\n };\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { Observable, of, throwError } from 'rxjs';\nimport { catchError, map, switchMap } from 'rxjs/operators';\nimport {\n CreatePageRequest,\n Page,\n PageIndexEntry,\n PageSummary,\n PagesIndex,\n PublishPageRequest,\n UpdatePageRequest,\n} from '../models/page.model';\nimport { ShopifyMetafieldRepository } from './shopify-metafield-repository.service';\n\n@Injectable({ providedIn: 'root' })\nexport class PageShopifyRepository {\n private readonly metafieldRepo = inject(ShopifyMetafieldRepository);\n\n getPages(): Observable<PageSummary[]> {\n return this.metafieldRepo.getPageIndex().pipe(\n map(index => {\n return index.pages\n .map(entry => this.mapIndexEntryToSummary(entry))\n .sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));\n })\n );\n }\n\n getPage(id: string): Observable<Page> {\n return this.metafieldRepo.getPageMetafield(id).pipe(\n map(page => {\n if (!page) {\n throw {\n code: 'PAGE_NOT_FOUND',\n message: `Page with id ${id} not found`,\n };\n }\n return page;\n })\n );\n }\n\n getPublishedPageBySlug(slug: string): Observable<Page> {\n return this.metafieldRepo.getPageIndex().pipe(\n switchMap(index => {\n const entry = index.pages.find(\n p => p.slug === slug && p.status === 'published'\n );\n\n if (!entry) {\n return throwError(() => ({\n code: 'PAGE_NOT_FOUND',\n message: `Published page with slug '${slug}' not found`,\n }));\n }\n\n return this.getPage(entry.id);\n })\n );\n }\n\n createPage(request: CreatePageRequest): Observable<Page> {\n return this.metafieldRepo.getPageIndex().pipe(\n switchMap(index => {\n this.validateUniqueSlug(request.slug, index);\n\n const newPage: Page = {\n id: crypto.randomUUID(),\n slug: request.slug,\n title: request.title,\n description: request.description,\n sections: [],\n status: 'draft',\n version: 1,\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n };\n\n const validation = this.metafieldRepo.validateSize(newPage);\n if (!validation.valid) {\n return throwError(() => ({\n code: 'SIZE_EXCEEDED',\n message: 'Page content exceeds 64KB limit',\n size: validation.size,\n maxSize: 64 * 1024,\n percentUsed: validation.percentUsed,\n }));\n }\n\n return this.metafieldRepo.setPageMetafield(newPage.id, newPage).pipe(\n switchMap(() => {\n // Create MetafieldDefinition with PUBLIC_READ for Storefront API access\n return this.metafieldRepo.createMetafieldDefinition(\n 'kustomizer',\n `page_${newPage.id}`,\n `Kustomizer Page: ${newPage.title}`,\n ).pipe(\n catchError(() => of(null as string | null)),\n );\n }),\n switchMap((definitionId) => {\n const updatedIndex = this.addPageToIndex(index, newPage, validation.size, definitionId ?? undefined);\n return this.metafieldRepo.updatePageIndex(updatedIndex);\n }),\n map(() => newPage)\n );\n })\n );\n }\n\n updatePage(id: string, request: UpdatePageRequest): Observable<Page> {\n return this.getPage(id).pipe(\n switchMap(currentPage => {\n if (currentPage.version !== request.version) {\n return throwError(() => ({\n code: 'VERSION_CONFLICT',\n message: `Version mismatch: expected ${request.version}, got ${currentPage.version}`,\n currentVersion: currentPage.version,\n }));\n }\n\n return this.metafieldRepo.getPageIndex().pipe(\n switchMap(index => {\n if (request.slug && request.slug !== currentPage.slug) {\n this.validateUniqueSlug(request.slug, index, id);\n }\n\n const updatedPage: Page = {\n ...currentPage,\n title: request.title !== undefined ? request.title : currentPage.title,\n slug: request.slug !== undefined ? request.slug : currentPage.slug,\n description: request.description !== undefined ? request.description : currentPage.description,\n sections: request.sections !== undefined ? request.sections : currentPage.sections,\n version: currentPage.version + 1,\n updatedAt: new Date().toISOString(),\n };\n\n const validation = this.metafieldRepo.validateSize(updatedPage);\n if (!validation.valid) {\n return throwError(() => ({\n code: 'SIZE_EXCEEDED',\n message: 'Page content exceeds 64KB limit',\n size: validation.size,\n maxSize: 64 * 1024,\n percentUsed: validation.percentUsed,\n }));\n }\n\n return this.metafieldRepo.setPageMetafield(id, updatedPage).pipe(\n switchMap(() => {\n const updatedIndex = this.updatePageInIndex(index, updatedPage, validation.size);\n return this.metafieldRepo.updatePageIndex(updatedIndex);\n }),\n map(() => updatedPage)\n );\n })\n );\n })\n );\n }\n\n deletePage(id: string): Observable<void> {\n return this.metafieldRepo.getPageIndex().pipe(\n switchMap(index => {\n const entry = index.pages.find(p => p.id === id);\n return this.metafieldRepo.deletePageMetafield(id).pipe(\n switchMap(() => {\n // Delete the MetafieldDefinition if we have its ID\n if (entry?.definitionId) {\n return this.metafieldRepo.deleteMetafieldDefinition(entry.definitionId).pipe(\n catchError(() => of(undefined)),\n );\n }\n return of(undefined);\n }),\n switchMap(() => {\n const updatedIndex = this.removePageFromIndex(index, id);\n return this.metafieldRepo.updatePageIndex(updatedIndex);\n }),\n map(() => undefined)\n );\n })\n );\n }\n\n publishPage(id: string, request: PublishPageRequest): Observable<Page> {\n return this.getPage(id).pipe(\n switchMap(currentPage => {\n if (currentPage.version !== request.version) {\n return throwError(() => ({\n code: 'VERSION_CONFLICT',\n message: `Version mismatch: expected ${request.version}, got ${currentPage.version}`,\n currentVersion: currentPage.version,\n }));\n }\n\n const publishedPage: Page = {\n ...currentPage,\n status: 'published',\n publishedAt: new Date().toISOString(),\n version: currentPage.version + 1,\n updatedAt: new Date().toISOString(),\n };\n\n const validation = this.metafieldRepo.validateSize(publishedPage);\n\n return this.metafieldRepo.setPageMetafield(id, publishedPage).pipe(\n switchMap(() => this.metafieldRepo.getPageIndex()),\n switchMap(index => {\n const updatedIndex = this.updatePageInIndex(index, publishedPage, validation.size);\n return this.metafieldRepo.updatePageIndex(updatedIndex);\n }),\n map(() => publishedPage)\n );\n })\n );\n }\n\n unpublishPage(id: string, request: PublishPageRequest): Observable<Page> {\n return this.getPage(id).pipe(\n switchMap(currentPage => {\n if (currentPage.version !== request.version) {\n return throwError(() => ({\n code: 'VERSION_CONFLICT',\n message: `Version mismatch: expected ${request.version}, got ${currentPage.version}`,\n currentVersion: currentPage.version,\n }));\n }\n\n if (currentPage.status !== 'published') {\n return throwError(() => ({\n code: 'PAGE_NOT_PUBLISHED',\n message: 'Page is not published',\n }));\n }\n\n const unpublishedPage: Page = {\n ...currentPage,\n status: 'draft',\n publishedAt: undefined,\n version: currentPage.version + 1,\n updatedAt: new Date().toISOString(),\n };\n\n const validation = this.metafieldRepo.validateSize(unpublishedPage);\n\n return this.metafieldRepo.setPageMetafield(id, unpublishedPage).pipe(\n switchMap(() => this.metafieldRepo.getPageIndex()),\n switchMap(index => {\n const updatedIndex = this.updatePageInIndex(index, unpublishedPage, validation.size);\n return this.metafieldRepo.updatePageIndex(updatedIndex);\n }),\n map(() => unpublishedPage)\n );\n })\n );\n }\n\n duplicatePage(id: string): Observable<Page> {\n return this.getPage(id).pipe(\n switchMap(sourcePage => {\n return this.metafieldRepo.getPageIndex().pipe(\n switchMap(index => {\n const newSlug = this.generateUniqueSlug(sourcePage.slug, index);\n\n const duplicatedPage: Page = {\n ...sourcePage,\n id: crypto.randomUUID(),\n slug: newSlug,\n title: `${sourcePage.title} (Copy)`,\n status: 'draft',\n version: 1,\n publishedAt: undefined,\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n };\n\n const validation = this.metafieldRepo.validateSize(duplicatedPage);\n if (!validation.valid) {\n return throwError(() => ({\n code: 'SIZE_EXCEEDED',\n message: 'Duplicated page content exceeds 64KB limit',\n size: validation.size,\n maxSize: 64 * 1024,\n percentUsed: validation.percentUsed,\n }));\n }\n\n return this.metafieldRepo.setPageMetafield(duplicatedPage.id, duplicatedPage).pipe(\n switchMap(() => {\n return this.metafieldRepo.createMetafieldDefinition(\n 'kustomizer',\n `page_${duplicatedPage.id}`,\n `Kustomizer Page: ${duplicatedPage.title}`,\n ).pipe(\n catchError(() => of(null as string | null)),\n );\n }),\n switchMap((definitionId) => {\n const updatedIndex = this.addPageToIndex(index, duplicatedPage, validation.size, definitionId ?? undefined);\n return this.metafieldRepo.updatePageIndex(updatedIndex);\n }),\n map(() => duplicatedPage)\n );\n })\n );\n })\n );\n }\n\n /**\n * Backfill MetafieldDefinitions for existing pages that don't have one.\n * Creates definitions with PUBLIC_READ storefront access.\n */\n ensureDefinitionsExist(): Observable<{ created: number; skipped: number }> {\n // Ensure the pages_index definition exists with PUBLIC_READ\n return this.metafieldRepo.createMetafieldDefinition(\n 'kustomizer',\n 'pages_index',\n 'Kustomizer Pages Index',\n ).pipe(\n catchError(() => of(null)),\n switchMap(() => this.metafieldRepo.getPageIndex()),\n switchMap(index => {\n const pagesWithoutDefinition = index.pages.filter(p => !p.definitionId);\n if (pagesWithoutDefinition.length === 0) {\n return of({ created: 0, skipped: index.pages.length, index: null });\n }\n\n // Create definitions sequentially to avoid rate limits\n let chain$ = of({ created: 0, skipped: 0, updatedPages: [...index.pages] });\n\n for (const page of pagesWithoutDefinition) {\n chain$ = chain$.pipe(\n switchMap(acc => {\n return this.metafieldRepo.createMetafieldDefinition(\n 'kustomizer',\n `page_${page.id}`,\n `Kustomizer Page: ${page.title}`,\n ).pipe(\n map(definitionId => {\n const updatedPages = acc.updatedPages.map(p =>\n p.id === page.id ? { ...p, definitionId } : p\n );\n return { created: acc.created + 1, skipped: acc.skipped, updatedPages };\n }),\n catchError(() => of({ ...acc, skipped: acc.skipped + 1 })),\n );\n }),\n );\n }\n\n return chain$.pipe(\n switchMap(result => {\n const updatedIndex: PagesIndex = { ...index, pages: result.updatedPages };\n if (result.created > 0) {\n return this.metafieldRepo.updatePageIndex(updatedIndex).pipe(\n map(() => ({ created: result.created, skipped: result.skipped })),\n );\n }\n return of({ created: result.created, skipped: result.skipped });\n }),\n );\n }),\n );\n }\n\n private validateUniqueSlug(slug: string, index: PagesIndex, excludeId?: string): void {\n const existingPage = index.pages.find(p => p.slug === slug && p.id !== excludeId);\n\n if (existingPage) {\n throw {\n code: 'DUPLICATE_SLUG',\n message: `Page with slug '${slug}' already exists`,\n };\n }\n }\n\n private generateUniqueSlug(baseSlug: string, index: PagesIndex): string {\n let counter = 1;\n let newSlug = `${baseSlug}-copy`;\n\n while (index.pages.some(p => p.slug === newSlug)) {\n counter++;\n newSlug = `${baseSlug}-copy-${counter}`;\n }\n\n return newSlug;\n }\n\n private addPageToIndex(index: PagesIndex, page: Page, size: number, definitionId?: string): PagesIndex {\n const entry: PageIndexEntry = {\n id: page.id,\n slug: page.slug,\n title: page.title,\n status: page.status,\n updatedAt: page.updatedAt,\n publishedAt: page.publishedAt,\n size,\n ...(definitionId ? { definitionId } : {}),\n };\n\n return {\n ...index,\n pages: [...index.pages, entry],\n };\n }\n\n private updatePageInIndex(index: PagesIndex, page: Page, size: number): PagesIndex {\n const updatedPages = index.pages.map(entry => {\n if (entry.id === page.id) {\n return {\n id: page.id,\n slug: page.slug,\n title: page.title,\n status: page.status,\n updatedAt: page.updatedAt,\n publishedAt: page.publishedAt,\n size,\n };\n }\n return entry;\n });\n\n return {\n ...index,\n pages: updatedPages,\n };\n }\n\n private removePageFromIndex(index: PagesIndex, pageId: string): PagesIndex {\n return {\n ...index,\n pages: index.pages.filter(entry => entry.id !== pageId),\n };\n }\n\n private mapIndexEntryToSummary(entry: PageIndexEntry): PageSummary {\n return {\n id: entry.id,\n slug: entry.slug,\n title: entry.title,\n status: entry.status,\n updatedAt: entry.updatedAt,\n publishedAt: entry.publishedAt,\n };\n }\n}\n","import { inject, Injectable, InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport {\n CreatePageRequest,\n Page,\n PageSummary,\n PublishPageRequest,\n UpdatePageRequest,\n} from '../models/page.model';\nimport { PageMemoryRepository } from './page-memory.repository';\nimport { PageShopifyRepository } from './page-shopify-repository.service';\n\n/**\n * Injection token to enable in-memory page storage (for development)\n * When false (default), uses Shopify metafields via GraphQL API\n */\nexport const USE_IN_MEMORY_PAGES = new InjectionToken<boolean>('USE_IN_MEMORY_PAGES', {\n providedIn: 'root',\n factory: () => false,\n});\n\n@Injectable({ providedIn: 'root' })\nexport class PageService {\n private readonly useInMemory = inject(USE_IN_MEMORY_PAGES);\n private readonly memoryRepo = inject(PageMemoryRepository);\n private readonly shopifyRepo = inject(PageShopifyRepository);\n\n /**\n * Get all pages (summaries only for listing)\n */\n getPages(): Observable<PageSummary[]> {\n if (this.useInMemory) {\n return this.memoryRepo.getPages();\n }\n return this.shopifyRepo.getPages();\n }\n\n /**\n * Get a single page by ID (full content)\n */\n getPage(id: string): Observable<Page> {\n if (this.useInMemory) {\n return this.memoryRepo.getPage(id);\n }\n return this.shopifyRepo.getPage(id);\n }\n\n /**\n * Get a published page by slug (for public rendering)\n */\n getPublishedPageBySlug(slug: string): Observable<Page> {\n if (this.useInMemory) {\n return this.memoryRepo.getPublishedPageBySlug(slug);\n }\n return this.shopifyRepo.getPublishedPageBySlug(slug);\n }\n\n /**\n * Create a new page\n */\n createPage(request: CreatePageRequest): Observable<Page> {\n if (this.useInMemory) {\n return this.memoryRepo.createPage(request);\n }\n return this.shopifyRepo.createPage(request);\n }\n\n /**\n * Update an existing page\n */\n updatePage(id: string, request: UpdatePageRequest): Observable<Page> {\n if (this.useInMemory) {\n return this.memoryRepo.updatePage(id, request);\n }\n return this.shopifyRepo.updatePage(id, request);\n }\n\n /**\n * Delete a page\n */\n deletePage(id: string): Observable<void> {\n if (this.useInMemory) {\n return this.memoryRepo.deletePage(id);\n }\n return this.shopifyRepo.deletePage(id);\n }\n\n /**\n * Publish a page (changes status to 'published')\n */\n publishPage(id: string, request: PublishPageRequest): Observable<Page> {\n if (this.useInMemory) {\n return this.memoryRepo.publishPage(id, request);\n }\n return this.shopifyRepo.publishPage(id, request);\n }\n\n /**\n * Unpublish a page (changes status to 'draft')\n */\n unpublishPage(id: string, request: PublishPageRequest): Observable<Page> {\n if (this.useInMemory) {\n return this.memoryRepo.unpublishPage(id, request);\n }\n return this.shopifyRepo.unpublishPage(id, request);\n }\n\n /**\n * Duplicate an existing page\n */\n duplicatePage(id: string): Observable<Page> {\n if (this.useInMemory) {\n return this.memoryRepo.duplicatePage(id);\n }\n return this.shopifyRepo.duplicatePage(id);\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { Page } from '../models/page.model';\nimport { PageService } from '../services/page.service';\nimport { VisualEditorNavigation } from '../navigation/visual-editor-navigation.types';\n\n/**\n * Abstract strategy for loading pages into the editor\n * Consumers can implement custom strategies for different use cases\n */\nexport abstract class PageLoadingStrategy {\n /**\n * Load a page by ID\n */\n abstract loadPage(pageId: string): Observable<Page>;\n\n /**\n * Get the current page ID to load\n * This abstracts the source of the page ID (route, input, etc.)\n */\n abstract getPageIdToLoad(): Observable<string | null>;\n}\n\n/**\n * Default strategy that uses route params via the navigation service\n */\n@Injectable()\nexport class RoutePageLoadingStrategy extends PageLoadingStrategy {\n private readonly pageService = inject(PageService);\n private readonly navigation = inject(VisualEditorNavigation);\n\n loadPage(pageId: string): Observable<Page> {\n return this.pageService.getPage(pageId);\n }\n\n getPageIdToLoad(): Observable<string | null> {\n return this.navigation.getCurrentPageId();\n }\n}\n\n/**\n * Input-based strategy for when page is passed via component input\n * Useful for embedding the editor in modals or custom layouts\n */\n@Injectable()\nexport class InputPageLoadingStrategy extends PageLoadingStrategy {\n private readonly pageService = inject(PageService);\n private readonly pageId$ = new BehaviorSubject<string | null>(null);\n\n /**\n * Set the page ID to load\n * Call this when the input changes\n */\n setPageId(pageId: string | null): void {\n this.pageId$.next(pageId);\n }\n\n loadPage(pageId: string): Observable<Page> {\n return this.pageService.getPage(pageId);\n }\n\n getPageIdToLoad(): Observable<string | null> {\n return this.pageId$.asObservable();\n }\n}\n","import { InjectionToken, Type } from '@angular/core';\nimport { VisualEditorNavigation } from '../navigation/visual-editor-navigation.types';\nimport { PageLoadingStrategy } from '../page-loading/page-loading-strategy.types';\nimport { RouterNavigationConfig } from '../navigation/default-router-navigation.service';\n\n/**\n * Main configuration interface for the Visual Editor library\n */\nexport interface VisualEditorConfig {\n /**\n * Navigation configuration\n */\n navigation?: {\n /**\n * Custom navigation service class\n * If provided, routerConfig is ignored\n */\n navigationService?: Type<VisualEditorNavigation>;\n\n /**\n * Router-based config (used with DefaultRouterNavigationService)\n * Only used if navigationService is not provided\n */\n routerConfig?: Partial<RouterNavigationConfig>;\n };\n\n /**\n * Page loading configuration\n */\n pageLoading?: {\n /**\n * Custom page loading strategy\n * Defaults to RoutePageLoadingStrategy\n */\n strategy?: Type<PageLoadingStrategy>;\n };\n\n /**\n * Page service configuration\n */\n pages?: {\n /**\n * Use in-memory storage instead of Shopify\n * Useful for development and demos\n * Defaults to false (uses Shopify)\n */\n useInMemory?: boolean;\n };\n\n /**\n * UI configuration\n */\n ui?: {\n /**\n * Show back button in editor toolbar\n * Defaults to true\n */\n showBackButton?: boolean;\n\n /**\n * Show publish/unpublish buttons\n * Defaults to true\n */\n showPublishButtons?: boolean;\n\n /**\n * Show save button\n * Defaults to true\n */\n showSaveButton?: boolean;\n };\n}\n\n/**\n * Injection token for the Visual Editor configuration\n */\nexport const VISUAL_EDITOR_CONFIG = new InjectionToken<VisualEditorConfig>(\n 'VISUAL_EDITOR_CONFIG',\n {\n providedIn: 'root',\n factory: () => ({}),\n }\n);\n\n/**\n * Default configuration values\n */\nexport const DEFAULT_VISUAL_EDITOR_CONFIG: Required<VisualEditorConfig> = {\n navigation: {},\n pageLoading: {},\n pages: {\n useInMemory: false,\n },\n ui: {\n showBackButton: true,\n showPublishButtons: true,\n showSaveButton: true,\n },\n};\n","import { EnvironmentProviders, makeEnvironmentProviders, Provider } from '@angular/core';\n\n// Note: NgRx store should be provided by the consumer app via provideStore()\n// We only provide our feature state through provideVisualEditorStore()\n\n// Navigation\nimport { VisualEditorNavigation } from './navigation/visual-editor-navigation.types';\nimport {\n DefaultRouterNavigationService,\n DEFAULT_ROUTER_NAVIGATION_CONFIG,\n ROUTER_NAVIGATION_CONFIG,\n} from './navigation/default-router-navigation.service';\n\n// Page Loading\nimport { PageLoadingStrategy, RoutePageLoadingStrategy } from './page-loading/page-loading-strategy.types';\n\n// Config\nimport { VisualEditorConfig, VISUAL_EDITOR_CONFIG } from './config/visual-editor-config.types';\n\n// Services\nimport { USE_IN_MEMORY_PAGES } from './services/page.service';\n\n/**\n * Provides all necessary services and configuration for the Visual Editor\n *\n * Note: You must also call provideVisualEditorStore() to set up the NgRx state.\n *\n * @example\n * ```typescript\n * // Minimal setup (uses Shopify by default)\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideStore(),\n * provideVisualEditorStore(), // Required: sets up NgRx state\n * provideVisualEditor(), // Sets up services and config\n * provideEditorComponents(myComponents),\n * ],\n * };\n *\n * // With custom configuration\n * provideVisualEditor({\n * navigation: {\n * routerConfig: {\n * pageListPath: '/cms',\n * pageEditPath: '/cms/editor/:id',\n * pageIdParam: 'id',\n * }\n * },\n * pages: {\n * useInMemory: true // Use in-memory storage for development\n * }\n * })\n * ```\n */\nexport function provideVisualEditor(config: VisualEditorConfig = {}): EnvironmentProviders {\n const providers: Provider[] = [\n // Configuration\n { provide: VISUAL_EDITOR_CONFIG, useValue: config },\n\n // Page storage configuration\n {\n provide: USE_IN_MEMORY_PAGES,\n useValue: config.pages?.useInMemory ?? false,\n },\n ];\n\n // Navigation provider\n if (config.navigation?.navigationService) {\n // Custom navigation service provided\n providers.push({\n provide: VisualEditorNavigation,\n useClass: config.navigation.navigationService,\n });\n } else {\n // Use default router-based navigation\n providers.push(\n {\n provide: ROUTER_NAVIGATION_CONFIG,\n useValue: {\n ...DEFAULT_ROUTER_NAVIGATION_CONFIG,\n ...config.navigation?.routerConfig,\n },\n },\n {\n provide: VisualEditorNavigation,\n useClass: DefaultRouterNavigationService,\n }\n );\n }\n\n // Page loading strategy\n if (config.pageLoading?.strategy) {\n providers.push({\n provide: PageLoadingStrategy,\n useClass: config.pageLoading.strategy,\n });\n } else {\n providers.push({\n provide: PageLoadingStrategy,\n useClass: RoutePageLoadingStrategy,\n });\n }\n\n return makeEnvironmentProviders(providers);\n}\n","import { PageContext } from '../models/page.model';\n\nexport interface EditorElement {\n id: string;\n type: string;\n props: Record<string, unknown>;\n slotName?: string;\n children?: EditorElement[];\n adminLabel?: string;\n}\n\nexport interface EditorSection {\n id: string;\n type: string;\n props: Record<string, unknown>;\n elements: EditorElement[];\n adminLabel?: string;\n}\n\nexport interface HistoryEntry {\n sections: EditorSection[];\n timestamp: number;\n actionType: string;\n}\n\nexport interface VisualEditorState {\n sections: EditorSection[];\n selectedElementId: string | null;\n selectedSectionId: string | null;\n isDragging: boolean;\n draggedElementId: string | null;\n history: HistoryEntry[];\n historyIndex: number;\n maxHistorySize: number;\n // Page management\n currentPage: PageContext | null;\n isDirty: boolean;\n}\n\nexport const initialVisualEditorState: VisualEditorState = {\n sections: [],\n selectedElementId: null,\n selectedSectionId: null,\n isDragging: false,\n draggedElementId: null,\n history: [],\n historyIndex: -1,\n maxHistorySize: 50,\n currentPage: null,\n isDirty: false,\n};\n\nexport const VISUAL_EDITOR_FEATURE_KEY = 'visualEditor';","import { createActionGroup, emptyProps, props } from '@ngrx/store';\nimport { EditorElement, EditorSection } from './visual-editor.state';\nimport { Page, PageContext } from '../models/page.model';\n\nexport const VisualEditorActions = createActionGroup({\n source: 'Visual Editor',\n events: {\n // Section actions\n 'Add Section': props<{ section: EditorSection; index?: number }>(),\n 'Remove Section': props<{ sectionId: string }>(),\n 'Move Section': props<{ sectionId: string; newIndex: number }>(),\n 'Update Section': props<{ sectionId: string; changes: Partial<EditorSection> }>(),\n 'Update Section Props': props<{ sectionId: string; props: Record<string, unknown> }>(),\n\n // Element actions\n 'Add Element': props<{ sectionId: string; element: EditorElement; index?: number }>(),\n 'Remove Element': props<{ sectionId: string; elementId: string }>(),\n 'Move Element': props<{\n sourceSectionId: string;\n targetSectionId: string;\n elementId: string;\n newIndex: number;\n }>(),\n 'Update Element': props<{\n sectionId: string;\n elementId: string;\n changes: Partial<EditorElement>;\n }>(),\n 'Update Element Props': props<{\n sectionId: string;\n elementId: string;\n props: Record<string, unknown>;\n }>(),\n\n // Block actions (elements within section slots)\n 'Add Block': props<{\n sectionId: string;\n slotName: string;\n element: EditorElement;\n index?: number;\n }>(),\n 'Remove Block': props<{ sectionId: string; elementId: string }>(),\n 'Move Block': props<{\n sectionId: string;\n elementId: string;\n targetSlotName: string;\n newIndex: number;\n }>(),\n 'Update Block Props': props<{\n sectionId: string;\n elementId: string;\n props: Record<string, unknown>;\n }>(),\n\n // Rename actions\n 'Rename Section': props<{ sectionId: string; adminLabel: string }>(),\n 'Rename Block': props<{ sectionId: string; elementId: string; adminLabel: string }>(),\n\n // Duplicate actions\n 'Duplicate Section': props<{ sectionId: string }>(),\n 'Duplicate Block': props<{ sectionId: string; elementId: string }>(),\n 'Duplicate Nested Block': props<{ sectionId: string; parentPath: string[]; elementId: string }>(),\n\n // Nested block actions (blocks within blocks)\n 'Add Nested Block': props<{\n sectionId: string;\n parentPath: string[]; // IDs from section to parent element\n slotName: string;\n element: EditorElement;\n index?: number;\n }>(),\n 'Remove Nested Block': props<{\n sectionId: string;\n parentPath: string[];\n elementId: string;\n }>(),\n 'Update Nested Block Props': props<{\n sectionId: string;\n parentPath: string[];\n elementId: string;\n props: Record<string, unknown>;\n }>(),\n 'Move Nested Block': props<{\n sectionId: string;\n parentPath: string[];\n elementId: string;\n targetSlotName: string;\n newIndex: number;\n }>(),\n 'Reparent Block': props<{\n sourceSectionId: string;\n sourceParentPath: string[];\n elementId: string;\n targetSectionId: string;\n targetParentPath: string[];\n targetSlotName: string;\n targetIndex: number;\n }>(),\n\n // Selection actions\n 'Select Element': props<{ sectionId: string | null; elementId: string | null }>(),\n 'Clear Selection': emptyProps(),\n\n // Drag actions\n 'Start Drag': props<{ elementId: string }>(),\n 'End Drag': emptyProps(),\n\n // History actions\n 'Undo': emptyProps(),\n 'Redo': emptyProps(),\n 'Clear History': emptyProps(),\n\n // Bulk actions\n 'Load Sections': props<{ sections: EditorSection[] }>(),\n 'Reset Editor': emptyProps(),\n\n // Page actions\n 'Load Page': props<{ page: Page }>(),\n 'Update Page Context': props<{ context: Partial<PageContext> }>(),\n 'Mark Dirty': emptyProps(),\n 'Mark Clean': emptyProps(),\n 'Clear Page': emptyProps(),\n },\n});","import { createReducer, on } from '@ngrx/store';\nimport { VisualEditorActions } from './visual-editor.actions';\nimport {\n EditorElement,\n EditorSection,\n HistoryEntry,\n initialVisualEditorState,\n VisualEditorState,\n} from './visual-editor.state';\n\nfunction pushToHistory(\n state: VisualEditorState,\n actionType: string\n): Pick<VisualEditorState, 'history' | 'historyIndex' | 'isDirty'> {\n const entry: HistoryEntry = {\n sections: structuredClone(state.sections),\n timestamp: Date.now(),\n actionType,\n };\n\n const newHistory = state.history.slice(0, state.historyIndex + 1);\n newHistory.push(entry);\n\n if (newHistory.length > state.maxHistorySize) {\n newHistory.shift();\n }\n\n return {\n history: newHistory,\n historyIndex: newHistory.length - 1,\n isDirty: true,\n };\n}\n\nfunction updateSection(\n sections: EditorSection[],\n sectionId: string,\n updater: (section: EditorSection) => EditorSection\n): EditorSection[] {\n return sections.map((section) => (section.id === sectionId ? updater(section) : section));\n}\n\nfunction deepCloneElement(element: EditorElement): EditorElement {\n return {\n ...element,\n id: crypto.randomUUID(),\n props: { ...element.props },\n children: element.children?.map((child) => deepCloneElement(child)),\n };\n}\n\n/**\n * Recursively find and update an element by following a path of IDs\n * @param elements - Array of elements to search in\n * @param path - Array of element IDs to follow (excluding the target)\n * @param updater - Function to update the parent element's children\n */\nfunction updateNestedElements(\n elements: EditorElement[],\n path: string[],\n updater: (children: EditorElement[]) => EditorElement[]\n): EditorElement[] {\n if (path.length === 0) {\n return updater(elements);\n }\n\n const [currentId, ...remainingPath] = path;\n\n return elements.map((element) => {\n if (element.id !== currentId) {\n return element;\n }\n\n if (remainingPath.length === 0) {\n // We've reached the parent, update its children\n return {\n ...element,\n children: updater(element.children ?? []),\n };\n }\n\n // Continue down the path\n return {\n ...element,\n children: updateNestedElements(element.children ?? [], remainingPath, updater),\n };\n });\n}\n\n/**\n * Add a child element to a nested parent\n */\nfunction addNestedChild(\n elements: EditorElement[],\n path: string[],\n child: EditorElement,\n slotName: string,\n index?: number\n): EditorElement[] {\n const childWithSlot = { ...child, slotName };\n\n return updateNestedElements(elements, path, (children) => {\n const slotChildren = children.filter((c) => c.slotName === slotName);\n const otherChildren = children.filter((c) => c.slotName !== slotName);\n const insertIndex = index !== undefined ? index : slotChildren.length;\n\n const newSlotChildren = [\n ...slotChildren.slice(0, insertIndex),\n childWithSlot,\n ...slotChildren.slice(insertIndex),\n ];\n\n return [...otherChildren, ...newSlotChildren];\n });\n}\n\n/**\n * Remove a child element from a nested parent\n */\nfunction removeNestedChild(\n elements: EditorElement[],\n path: string[],\n childId: string\n): EditorElement[] {\n return updateNestedElements(elements, path, (children) =>\n children.filter((c) => c.id !== childId)\n );\n}\n\n/**\n * Update props of a nested child element\n */\nfunction updateNestedChildProps(\n elements: EditorElement[],\n path: string[],\n childId: string,\n props: Record<string, unknown>\n): EditorElement[] {\n return updateNestedElements(elements, path, (children) =>\n children.map((c) =>\n c.id === childId ? { ...c, props: { ...c.props, ...props } } : c\n )\n );\n}\n\n/**\n * Recursively update adminLabel of an element by ID anywhere in the tree\n */\nfunction updateElementAdminLabelRecursive(\n elements: EditorElement[],\n elementId: string,\n adminLabel: string\n): EditorElement[] {\n return elements.map((element) => {\n if (element.id === elementId) {\n return { ...element, adminLabel: adminLabel || undefined };\n }\n if (element.children && element.children.length > 0) {\n return {\n ...element,\n children: updateElementAdminLabelRecursive(element.children, elementId, adminLabel),\n };\n }\n return element;\n });\n}\n\n/**\n * Recursively update props of an element by ID anywhere in the tree\n */\nfunction updateElementPropsRecursive(\n elements: EditorElement[],\n elementId: string,\n props: Record<string, unknown>\n): EditorElement[] {\n return elements.map((element) => {\n if (element.id === elementId) {\n return { ...element, props: { ...element.props, ...props } };\n }\n if (element.children && element.children.length > 0) {\n return {\n ...element,\n children: updateElementPropsRecursive(element.children, elementId, props),\n };\n }\n return element;\n });\n}\n\n/**\n * Move a nested child within its parent (can change slots)\n */\nfunction moveNestedChild(\n elements: EditorElement[],\n path: string[],\n childId: string,\n targetSlotName: string,\n newIndex: number\n): EditorElement[] {\n return updateNestedElements(elements, path, (children) => {\n const child = children.find((c) => c.id === childId);\n if (!child) return children;\n\n const updatedChild = { ...child, slotName: targetSlotName };\n const childrenWithoutTarget = children.filter((c) => c.id !== childId);\n const targetSlotChildren = childrenWithoutTarget.filter((c) => c.slotName === targetSlotName);\n const otherChildren = childrenWithoutTarget.filter((c) => c.slotName !== targetSlotName);\n\n const newTargetChildren = [\n ...targetSlotChildren.slice(0, newIndex),\n updatedChild,\n ...targetSlotChildren.slice(newIndex),\n ];\n\n return [...otherChildren, ...newTargetChildren];\n });\n}\n\n/**\n * Find an element by ID anywhere in the tree and return it\n */\nfunction findNestedElement(elements: EditorElement[], elementId: string): EditorElement | null {\n for (const el of elements) {\n if (el.id === elementId) return el;\n if (el.children?.length) {\n const found = findNestedElement(el.children, elementId);\n if (found) return found;\n }\n }\n return null;\n}\n\nexport const visualEditorReducer = createReducer(\n initialVisualEditorState,\n\n // Section actions\n on(VisualEditorActions.addSection, (state, { section, index }) => {\n const sections =\n index !== undefined\n ? [...state.sections.slice(0, index), section, ...state.sections.slice(index)]\n : [...state.sections, section];\n\n return {\n ...state,\n sections,\n ...pushToHistory(state, 'Add Section'),\n };\n }),\n\n on(VisualEditorActions.removeSection, (state, { sectionId }) => ({\n ...state,\n sections: state.sections.filter((s) => s.id !== sectionId),\n selectedSectionId: state.selectedSectionId === sectionId ? null : state.selectedSectionId,\n selectedElementId:\n state.sections.find((s) => s.id === sectionId)?.elements.some((e) => e.id === state.selectedElementId)\n ? null\n : state.selectedElementId,\n ...pushToHistory(state, 'Remove Section'),\n })),\n\n on(VisualEditorActions.moveSection, (state, { sectionId, newIndex }) => {\n const currentIndex = state.sections.findIndex((s) => s.id === sectionId);\n if (currentIndex === -1 || currentIndex === newIndex) return state;\n\n const sections = [...state.sections];\n const [removed] = sections.splice(currentIndex, 1);\n sections.splice(newIndex, 0, removed);\n\n return {\n ...state,\n sections,\n ...pushToHistory(state, 'Move Section'),\n };\n }),\n\n on(VisualEditorActions.updateSection, (state, { sectionId, changes }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n ...changes,\n })),\n ...pushToHistory(state, 'Update Section'),\n })),\n\n on(VisualEditorActions.updateSectionProps, (state, { sectionId, props }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n props: { ...section.props, ...props },\n })),\n ...pushToHistory(state, 'Update Section Props'),\n })),\n\n // Rename actions\n on(VisualEditorActions.renameSection, (state, { sectionId, adminLabel }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n adminLabel: adminLabel || undefined,\n })),\n ...pushToHistory(state, 'Rename Section'),\n })),\n\n on(VisualEditorActions.renameBlock, (state, { sectionId, elementId, adminLabel }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: updateElementAdminLabelRecursive(section.elements, elementId, adminLabel),\n })),\n ...pushToHistory(state, 'Rename Block'),\n })),\n\n // Element actions\n on(VisualEditorActions.addElement, (state, { sectionId, element, index }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements:\n index !== undefined\n ? [...section.elements.slice(0, index), element, ...section.elements.slice(index)]\n : [...section.elements, element],\n })),\n ...pushToHistory(state, 'Add Element'),\n })),\n\n on(VisualEditorActions.removeElement, (state, { sectionId, elementId }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: section.elements.filter((e) => e.id !== elementId),\n })),\n selectedElementId: state.selectedElementId === elementId ? null : state.selectedElementId,\n ...pushToHistory(state, 'Remove Element'),\n })),\n\n on(VisualEditorActions.moveElement, (state, { sourceSectionId, targetSectionId, elementId, newIndex }) => {\n const sourceSection = state.sections.find((s) => s.id === sourceSectionId);\n const element = sourceSection?.elements.find((e) => e.id === elementId);\n if (!element) return state;\n\n let sections = updateSection(state.sections, sourceSectionId, (section) => ({\n ...section,\n elements: section.elements.filter((e) => e.id !== elementId),\n }));\n\n sections = updateSection(sections, targetSectionId, (section) => ({\n ...section,\n elements: [...section.elements.slice(0, newIndex), element, ...section.elements.slice(newIndex)],\n }));\n\n return {\n ...state,\n sections,\n ...pushToHistory(state, 'Move Element'),\n };\n }),\n\n on(VisualEditorActions.updateElement, (state, { sectionId, elementId, changes }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: section.elements.map((e) => (e.id === elementId ? { ...e, ...changes } : e)),\n })),\n ...pushToHistory(state, 'Update Element'),\n })),\n\n on(VisualEditorActions.updateElementProps, (state, { sectionId, elementId, props }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: section.elements.map((e) =>\n e.id === elementId ? { ...e, props: { ...e.props, ...props } } : e\n ),\n })),\n ...pushToHistory(state, 'Update Element Props'),\n })),\n\n // Block actions (elements within section slots)\n on(VisualEditorActions.addBlock, (state, { sectionId, slotName, element, index }) => {\n const blockWithSlot = { ...element, slotName };\n return {\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => {\n const slotBlocks = section.elements.filter((e) => e.slotName === slotName);\n const otherBlocks = section.elements.filter((e) => e.slotName !== slotName);\n const insertIndex = index !== undefined ? index : slotBlocks.length;\n const newSlotBlocks = [\n ...slotBlocks.slice(0, insertIndex),\n blockWithSlot,\n ...slotBlocks.slice(insertIndex),\n ];\n return {\n ...section,\n elements: [...otherBlocks, ...newSlotBlocks],\n };\n }),\n ...pushToHistory(state, 'Add Block'),\n };\n }),\n\n on(VisualEditorActions.removeBlock, (state, { sectionId, elementId }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: section.elements.filter((e) => e.id !== elementId),\n })),\n selectedElementId: state.selectedElementId === elementId ? null : state.selectedElementId,\n ...pushToHistory(state, 'Remove Block'),\n })),\n\n on(VisualEditorActions.moveBlock, (state, { sectionId, elementId, targetSlotName, newIndex }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => {\n const block = section.elements.find((e) => e.id === elementId);\n if (!block) return section;\n\n const updatedBlock = { ...block, slotName: targetSlotName };\n const elementsWithoutBlock = section.elements.filter((e) => e.id !== elementId);\n const targetSlotBlocks = elementsWithoutBlock.filter((e) => e.slotName === targetSlotName);\n const otherBlocks = elementsWithoutBlock.filter((e) => e.slotName !== targetSlotName);\n\n const newTargetBlocks = [\n ...targetSlotBlocks.slice(0, newIndex),\n updatedBlock,\n ...targetSlotBlocks.slice(newIndex),\n ];\n\n return {\n ...section,\n elements: [...otherBlocks, ...newTargetBlocks],\n };\n }),\n ...pushToHistory(state, 'Move Block'),\n })),\n\n // Duplicate actions\n on(VisualEditorActions.duplicateSection, (state, { sectionId }) => {\n const index = state.sections.findIndex((s) => s.id === sectionId);\n if (index === -1) return state;\n\n const original = state.sections[index];\n const clone: EditorSection = {\n ...original,\n id: crypto.randomUUID(),\n props: { ...original.props },\n elements: original.elements.map((el) => deepCloneElement(el)),\n };\n\n const sections = [\n ...state.sections.slice(0, index + 1),\n clone,\n ...state.sections.slice(index + 1),\n ];\n\n return {\n ...state,\n sections,\n ...pushToHistory(state, 'Duplicate Section'),\n };\n }),\n\n on(VisualEditorActions.duplicateBlock, (state, { sectionId, elementId }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => {\n const index = section.elements.findIndex((e) => e.id === elementId);\n if (index === -1) return section;\n\n const clone = deepCloneElement(section.elements[index]);\n return {\n ...section,\n elements: [\n ...section.elements.slice(0, index + 1),\n clone,\n ...section.elements.slice(index + 1),\n ],\n };\n }),\n ...pushToHistory(state, 'Duplicate Block'),\n })),\n\n on(VisualEditorActions.duplicateNestedBlock, (state, { sectionId, parentPath, elementId }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: updateNestedElements(section.elements, parentPath, (children) => {\n const index = children.findIndex((c) => c.id === elementId);\n if (index === -1) return children;\n\n const clone = deepCloneElement(children[index]);\n return [\n ...children.slice(0, index + 1),\n clone,\n ...children.slice(index + 1),\n ];\n }),\n })),\n ...pushToHistory(state, 'Duplicate Nested Block'),\n })),\n\n on(VisualEditorActions.updateBlockProps, (state, { sectionId, elementId, props }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n // Use recursive function to find and update nested blocks\n elements: updateElementPropsRecursive(section.elements, elementId, props),\n })),\n ...pushToHistory(state, 'Update Block Props'),\n })),\n\n // Nested block actions (blocks within blocks, up to 12 levels deep)\n on(VisualEditorActions.addNestedBlock, (state, { sectionId, parentPath, slotName, element, index }) => {\n // Validate max depth (12 levels)\n if (parentPath.length >= 12) {\n console.warn('Maximum nesting depth (12) reached');\n return state;\n }\n\n return {\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: addNestedChild(section.elements, parentPath, element, slotName, index),\n })),\n ...pushToHistory(state, 'Add Nested Block'),\n };\n }),\n\n on(VisualEditorActions.removeNestedBlock, (state, { sectionId, parentPath, elementId }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: removeNestedChild(section.elements, parentPath, elementId),\n })),\n selectedElementId: state.selectedElementId === elementId ? null : state.selectedElementId,\n ...pushToHistory(state, 'Remove Nested Block'),\n })),\n\n on(VisualEditorActions.updateNestedBlockProps, (state, { sectionId, parentPath, elementId, props }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: updateNestedChildProps(section.elements, parentPath, elementId, props),\n })),\n ...pushToHistory(state, 'Update Nested Block Props'),\n })),\n\n on(VisualEditorActions.moveNestedBlock, (state, { sectionId, parentPath, elementId, targetSlotName, newIndex }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: moveNestedChild(section.elements, parentPath, elementId, targetSlotName, newIndex),\n })),\n ...pushToHistory(state, 'Move Nested Block'),\n })),\n\n on(VisualEditorActions.reparentBlock, (state, {\n sourceSectionId, sourceParentPath, elementId,\n targetSectionId, targetParentPath, targetSlotName, targetIndex,\n }) => {\n // 1. Find the element in its source location\n const sourceSection = state.sections.find((s) => s.id === sourceSectionId);\n if (!sourceSection) return state;\n\n let element: EditorElement | null = null;\n if (sourceParentPath.length === 0) {\n element = sourceSection.elements.find((e) => e.id === elementId) ?? null;\n } else {\n element = findNestedElement(sourceSection.elements, elementId);\n }\n if (!element) return state;\n\n // 2. Remove from source\n let sections = state.sections;\n if (sourceParentPath.length === 0) {\n sections = updateSection(sections, sourceSectionId, (section) => ({\n ...section,\n elements: section.elements.filter((e) => e.id !== elementId),\n }));\n } else {\n sections = updateSection(sections, sourceSectionId, (section) => ({\n ...section,\n elements: removeNestedChild(section.elements, sourceParentPath, elementId),\n }));\n }\n\n // 3. Update slotName and insert at target\n const reparentedElement = { ...element, slotName: targetSlotName };\n\n if (targetParentPath.length === 0) {\n sections = updateSection(sections, targetSectionId, (section) => {\n const slotChildren = section.elements.filter((e) => e.slotName === targetSlotName);\n const otherChildren = section.elements.filter((e) => e.slotName !== targetSlotName);\n const insertIdx = Math.min(targetIndex, slotChildren.length);\n const newSlotChildren = [\n ...slotChildren.slice(0, insertIdx),\n reparentedElement,\n ...slotChildren.slice(insertIdx),\n ];\n return {\n ...section,\n elements: [...otherChildren, ...newSlotChildren],\n };\n });\n } else {\n sections = updateSection(sections, targetSectionId, (section) => ({\n ...section,\n elements: addNestedChild(section.elements, targetParentPath, reparentedElement, targetSlotName, targetIndex),\n }));\n }\n\n return {\n ...state,\n sections,\n ...pushToHistory(state, 'Reparent Block'),\n };\n }),\n\n // Selection actions\n on(VisualEditorActions.selectElement, (state, { sectionId, elementId }) => ({\n ...state,\n selectedSectionId: sectionId,\n selectedElementId: elementId,\n })),\n\n on(VisualEditorActions.clearSelection, (state) => ({\n ...state,\n selectedSectionId: null,\n selectedElementId: null,\n })),\n\n // Drag actions\n on(VisualEditorActions.startDrag, (state, { elementId }) => ({\n ...state,\n isDragging: true,\n draggedElementId: elementId,\n })),\n\n on(VisualEditorActions.endDrag, (state) => ({\n ...state,\n isDragging: false,\n draggedElementId: null,\n })),\n\n // History actions\n on(VisualEditorActions.undo, (state) => {\n if (state.historyIndex <= 0) return state;\n\n const newIndex = state.historyIndex - 1;\n const entry = state.history[newIndex];\n\n return {\n ...state,\n sections: structuredClone(entry.sections),\n historyIndex: newIndex,\n };\n }),\n\n on(VisualEditorActions.redo, (state) => {\n if (state.historyIndex >= state.history.length - 1) return state;\n\n const newIndex = state.historyIndex + 1;\n const entry = state.history[newIndex];\n\n return {\n ...state,\n sections: structuredClone(entry.sections),\n historyIndex: newIndex,\n };\n }),\n\n on(VisualEditorActions.clearHistory, (state) => ({\n ...state,\n history: [],\n historyIndex: -1,\n })),\n\n // Bulk actions\n on(VisualEditorActions.loadSections, (state, { sections }) => ({\n ...state,\n sections,\n ...pushToHistory(state, 'Load Sections'),\n })),\n\n on(VisualEditorActions.resetEditor, () => initialVisualEditorState),\n\n // Page actions\n on(VisualEditorActions.loadPage, (state, { page }) => ({\n ...initialVisualEditorState,\n sections: page.sections,\n currentPage: {\n id: page.id,\n slug: page.slug,\n title: page.title,\n status: page.status,\n version: page.version,\n },\n isDirty: false,\n })),\n\n on(VisualEditorActions.updatePageContext, (state, { context }) => ({\n ...state,\n currentPage: state.currentPage ? { ...state.currentPage, ...context } : null,\n })),\n\n on(VisualEditorActions.markDirty, (state) => ({\n ...state,\n isDirty: true,\n })),\n\n on(VisualEditorActions.markClean, (state) => ({\n ...state,\n isDirty: false,\n })),\n\n on(VisualEditorActions.clearPage, () => initialVisualEditorState)\n);","import { createFeatureSelector, createSelector } from '@ngrx/store';\nimport { EditorElement, VISUAL_EDITOR_FEATURE_KEY, VisualEditorState } from './visual-editor.state';\n\n/**\n * Recursively find an element by ID in a tree of elements\n */\nfunction findElementRecursive(elements: EditorElement[], elementId: string): EditorElement | null {\n for (const element of elements) {\n if (element.id === elementId) {\n return element;\n }\n if (element.children && element.children.length > 0) {\n const found = findElementRecursive(element.children, elementId);\n if (found) {\n return found;\n }\n }\n }\n return null;\n}\n\nexport const selectVisualEditorState =\n createFeatureSelector<VisualEditorState>(VISUAL_EDITOR_FEATURE_KEY);\n\nexport const selectSections = createSelector(selectVisualEditorState, (state) => state.sections);\n\nexport const selectSelectedElementId = createSelector(\n selectVisualEditorState,\n (state) => state.selectedElementId\n);\n\nexport const selectSelectedSectionId = createSelector(\n selectVisualEditorState,\n (state) => state.selectedSectionId\n);\n\nexport const selectIsDragging = createSelector(selectVisualEditorState, (state) => state.isDragging);\n\nexport const selectDraggedElementId = createSelector(\n selectVisualEditorState,\n (state) => state.draggedElementId\n);\n\nexport const selectHistoryIndex = createSelector(\n selectVisualEditorState,\n (state) => state.historyIndex\n);\n\nexport const selectHistoryLength = createSelector(\n selectVisualEditorState,\n (state) => state.history.length\n);\n\nexport const selectCanUndo = createSelector(selectVisualEditorState, (state) => state.historyIndex > 0);\n\nexport const selectCanRedo = createSelector(\n selectVisualEditorState,\n (state) => state.historyIndex < state.history.length - 1\n);\n\nexport const selectSelectedSection = createSelector(\n selectSections,\n selectSelectedSectionId,\n (sections, sectionId) => sections.find((s) => s.id === sectionId) ?? null\n);\n\nexport const selectSelectedElement = createSelector(\n selectSelectedSection,\n selectSelectedElementId,\n (section, elementId) => {\n if (!section || !elementId) return null;\n // Search recursively to find nested elements\n return findElementRecursive(section.elements, elementId);\n }\n);\n\nexport const selectSectionById = (sectionId: string) =>\n createSelector(selectSections, (sections) => sections.find((s) => s.id === sectionId) ?? null);\n\nexport const selectElementById = (sectionId: string, elementId: string) =>\n createSelector(selectSectionById(sectionId), (section) => {\n if (!section) return null;\n // Search recursively to find nested elements\n return findElementRecursive(section.elements, elementId);\n });\n\nexport const selectHistory = createSelector(selectVisualEditorState, (state) => state.history);\n\nexport const selectLastAction = createSelector(selectHistory, selectHistoryIndex, (history, index) =>\n index >= 0 && index < history.length ? history[index].actionType : null\n);\n\nexport const selectSelectedElementType = createSelector(\n selectSelectedElement,\n (element) => element?.type ?? null\n);\n\nexport const selectSelectedSectionType = createSelector(\n selectSelectedSection,\n (section) => section?.type ?? null\n);\n\n// Block selectors\nexport const selectBlocksForSection = (sectionId: string) =>\n createSelector(selectSectionById(sectionId), (section) => section?.elements ?? []);\n\nexport const selectBlocksForSlot = (sectionId: string, slotName: string) =>\n createSelector(selectBlocksForSection(sectionId), (elements) =>\n elements.filter((e) => e.slotName === slotName)\n );\n\nexport const selectSelectedBlock = createSelector(\n selectSelectedSection,\n selectSelectedElementId,\n (section, elementId) => {\n if (!section || !elementId) return null;\n // Search recursively to find nested blocks\n return findElementRecursive(section.elements, elementId);\n }\n);\n\nexport const selectSelectedBlockSlotName = createSelector(\n selectSelectedBlock,\n (block) => block?.slotName ?? null\n);\n\n// Page selectors\nexport const selectCurrentPage = createSelector(\n selectVisualEditorState,\n (state) => state.currentPage\n);\n\nexport const selectCurrentPageId = createSelector(\n selectCurrentPage,\n (page) => page?.id ?? null\n);\n\nexport const selectCurrentPageSlug = createSelector(\n selectCurrentPage,\n (page) => page?.slug ?? null\n);\n\nexport const selectCurrentPageTitle = createSelector(\n selectCurrentPage,\n (page) => page?.title ?? null\n);\n\nexport const selectCurrentPageStatus = createSelector(\n selectCurrentPage,\n (page) => page?.status ?? null\n);\n\nexport const selectCurrentPageVersion = createSelector(\n selectCurrentPage,\n (page) => page?.version ?? null\n);\n\nexport const selectIsDirty = createSelector(selectVisualEditorState, (state) => state.isDirty);\n\nexport const selectIsPageLoaded = createSelector(selectCurrentPage, (page) => page !== null);","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { provideState } from '@ngrx/store';\nimport { VISUAL_EDITOR_FEATURE_KEY } from './visual-editor.state';\nimport { visualEditorReducer } from './visual-editor.reducer';\n\nexport function provideVisualEditorStore(): EnvironmentProviders {\n return makeEnvironmentProviders([provideState(VISUAL_EDITOR_FEATURE_KEY, visualEditorReducer)]);\n}","import { EnvironmentProviders, InjectionToken, makeEnvironmentProviders } from '@angular/core';\nimport { ComponentDefinition } from './component-definition.types';\n\n/**\n * Injection token for editor component definitions\n */\nexport const EDITOR_COMPONENT_DEFINITIONS = new InjectionToken<ComponentDefinition[][]>(\n 'EDITOR_COMPONENT_DEFINITIONS'\n);\n\n/**\n * Provider function to register editor components.\n *\n * @example\n * ```typescript\n * // app.config.ts\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideStore(),\n * provideVisualEditorStore(),\n * provideEditorComponents([\n * heroSectionDefinition,\n * textBlockDefinition,\n * ]),\n * ],\n * };\n * ```\n */\nexport function provideEditorComponents(\n definitions: ComponentDefinition[]\n): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: EDITOR_COMPONENT_DEFINITIONS,\n useValue: definitions,\n multi: true,\n },\n ]);\n}\n","import { Injectable, Type, inject } from '@angular/core';\nimport { ComponentDefinition, ComponentCategory, ComponentPreset } from './component-definition.types';\nimport { PropSchemaMap } from './prop-schema.types';\nimport { SlotDefinition } from './slot.types';\nimport { EDITOR_COMPONENT_DEFINITIONS } from './provide-editor-components';\n\n/**\n * A resolved preset entry for use in pickers.\n * If the component has no presets, preset is null and display fields come from the definition.\n */\nexport interface ResolvedPreset {\n definition: ComponentDefinition;\n preset: ComponentPreset | null;\n displayName: string;\n displayCategory: string;\n displayIcon: string | undefined;\n displayDescription: string | undefined;\n}\n\n/**\n * Central service for registering and querying editor components\n */\n@Injectable({ providedIn: 'root' })\nexport class ComponentRegistryService {\n private readonly definitions = new Map<string, ComponentDefinition>();\n private readonly injectedDefinitions = inject(EDITOR_COMPONENT_DEFINITIONS, { optional: true }) ?? [];\n\n constructor() {\n this.injectedDefinitions.flat().forEach((def) => this.register(def));\n }\n\n /**\n * Register a component definition\n */\n register(definition: ComponentDefinition): void {\n if (this.definitions.has(definition.type)) {\n console.warn(\n `ComponentRegistry: Component type \"${definition.type}\" is already registered. Overwriting.`\n );\n }\n this.definitions.set(definition.type, definition);\n }\n\n /**\n * Register multiple definitions\n */\n registerAll(definitions: ComponentDefinition[]): void {\n definitions.forEach((def) => this.register(def));\n }\n\n /**\n * Get a definition by type\n */\n get(type: string): ComponentDefinition | undefined {\n return this.definitions.get(type);\n }\n\n /**\n * Check if a type is registered\n */\n has(type: string): boolean {\n return this.definitions.has(type);\n }\n\n /**\n * Get the Angular component for a type\n */\n getComponent(type: string): Type<unknown> | undefined {\n return this.definitions.get(type)?.component;\n }\n\n /**\n * Get the props schema for a type\n */\n getPropsSchema(type: string): PropSchemaMap | undefined {\n return this.definitions.get(type)?.props;\n }\n\n /**\n * Get the slots for a type\n */\n getSlots(type: string): SlotDefinition[] {\n return this.definitions.get(type)?.slots ?? [];\n }\n\n /**\n * Check if a component type has slots (can contain nested blocks)\n */\n hasSlots(type: string): boolean {\n const slots = this.getSlots(type);\n return slots.length > 0;\n }\n\n /**\n * Get all definitions\n */\n getAll(): ComponentDefinition[] {\n return Array.from(this.definitions.values());\n }\n\n /**\n * Get definitions filtered by category\n */\n getByCategory(category: ComponentCategory): ComponentDefinition[] {\n return this.getAll()\n .filter((def) => def.category === category)\n .sort((a, b) => (a.order ?? 999) - (b.order ?? 999));\n }\n\n /**\n * Get only section components\n */\n getSections(): ComponentDefinition[] {\n return this.getAll()\n .filter((def) => def.isSection === true)\n .sort((a, b) => (a.order ?? 999) - (b.order ?? 999));\n }\n\n /**\n * Get only element components (non-sections, non-blocks)\n */\n getElements(): ComponentDefinition[] {\n return this.getAll()\n .filter((def) => def.isSection !== true && def.isBlock !== true)\n .sort((a, b) => (a.order ?? 999) - (b.order ?? 999));\n }\n\n /**\n * Get only block components (elements that live inside section slots)\n */\n getBlocks(): ComponentDefinition[] {\n return this.getAll()\n .filter((def) => def.isBlock === true)\n .sort((a, b) => (a.order ?? 999) - (b.order ?? 999));\n }\n\n /**\n * Get blocks available for a specific section type\n * Returns theme blocks (global) + section blocks specific to this section type\n */\n getBlocksForSectionType(sectionType: string): ComponentDefinition[] {\n return this.getBlocks().filter((def) => {\n // Theme blocks (or no scope specified) are available everywhere\n if (!def.blockScope || def.blockScope === 'theme') {\n return true;\n }\n // Section blocks are only available in their specified sections\n if (def.blockScope === 'section') {\n return def.sectionTypes?.includes(sectionType) ?? false;\n }\n return false;\n });\n }\n\n /**\n * Search components by name or tags\n */\n search(query: string): ComponentDefinition[] {\n const normalizedQuery = query.toLowerCase().trim();\n if (!normalizedQuery) return this.getAll();\n\n return this.getAll().filter((def) => {\n const nameMatch = def.name.toLowerCase().includes(normalizedQuery);\n const tagMatch = def.tags?.some((tag) => tag.toLowerCase().includes(normalizedQuery));\n const descMatch = def.description?.toLowerCase().includes(normalizedQuery);\n return nameMatch || tagMatch || descMatch;\n });\n }\n\n /**\n * Generate default props for a type\n */\n getDefaultProps(type: string): Record<string, unknown> {\n const schema = this.getPropsSchema(type);\n if (!schema) return {};\n\n const defaults: Record<string, unknown> = {};\n for (const [key, propSchema] of Object.entries(schema)) {\n defaults[key] = propSchema.defaultValue;\n }\n return defaults;\n }\n\n /**\n * Resolve a definition into ResolvedPreset entries.\n * If it has presets, returns one entry per preset; otherwise one entry for the definition itself.\n */\n resolvePresets(definition: ComponentDefinition): ResolvedPreset[] {\n if (definition.presets && definition.presets.length > 0) {\n return definition.presets.map((preset) => ({\n definition,\n preset,\n displayName: preset.name,\n displayCategory: preset.category ?? definition.category,\n displayIcon: preset.icon ?? definition.icon,\n displayDescription: preset.description ?? definition.description,\n }));\n }\n\n return [\n {\n definition,\n preset: null,\n displayName: definition.name,\n displayCategory: definition.category,\n displayIcon: definition.icon,\n displayDescription: definition.description,\n },\n ];\n }\n\n /**\n * Get all section definitions expanded into presets\n */\n getSectionPresets(): ResolvedPreset[] {\n return this.getSections().flatMap((def) => this.resolvePresets(def));\n }\n\n /**\n * Get all block definitions expanded into presets\n */\n getBlockPresets(): ResolvedPreset[] {\n return this.getBlocks().flatMap((def) => this.resolvePresets(def));\n }\n\n /**\n * Get block presets available for a specific section type\n */\n getBlockPresetsForSectionType(sectionType: string): ResolvedPreset[] {\n return this.getBlocksForSectionType(sectionType).flatMap((def) => this.resolvePresets(def));\n }\n\n /**\n * Merge schema defaults with preset settings to produce final props\n */\n getPresetProps(type: string, preset: ComponentPreset | null): Record<string, unknown> {\n const defaults = this.getDefaultProps(type);\n if (!preset?.settings) return defaults;\n return { ...defaults, ...preset.settings };\n }\n\n /**\n * Validate props against the schema\n */\n validateProps(type: string, props: Record<string, unknown>): Map<string, string> {\n const errors = new Map<string, string>();\n const schema = this.getPropsSchema(type);\n if (!schema) return errors;\n\n for (const [key, propSchema] of Object.entries(schema)) {\n const value = props[key];\n const validation = propSchema.validation;\n\n if (!validation) continue;\n\n if (validation.required && (value === undefined || value === null || value === '')) {\n errors.set(key, `${propSchema.label} is required`);\n continue;\n }\n\n if (value === undefined || value === null) continue;\n\n if (typeof value === 'number') {\n if (validation.min !== undefined && value < validation.min) {\n errors.set(key, `${propSchema.label} must be at least ${validation.min}`);\n }\n if (validation.max !== undefined && value > validation.max) {\n errors.set(key, `${propSchema.label} must be at most ${validation.max}`);\n }\n }\n\n if (typeof value === 'string') {\n if (validation.minLength !== undefined && value.length < validation.minLength) {\n errors.set(key, `${propSchema.label} must be at least ${validation.minLength} characters`);\n }\n if (validation.maxLength !== undefined && value.length > validation.maxLength) {\n errors.set(key, `${propSchema.label} must be at most ${validation.maxLength} characters`);\n }\n if (validation.pattern && !new RegExp(validation.pattern).test(value)) {\n errors.set(key, `${propSchema.label} format is invalid`);\n }\n }\n }\n\n return errors;\n }\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n input,\n inject,\n ViewContainerRef,\n effect,\n ComponentRef,\n DestroyRef,\n reflectComponentType,\n Type,\n} from '@angular/core';\nimport { ComponentRegistryService } from '../registry/component-registry.service';\nimport { EditorElement } from '../store/visual-editor.state';\n\n/**\n * Component that dynamically renders an EditorElement\n * based on its type registered in the ComponentRegistry\n */\n@Component({\n selector: 'lib-dynamic-renderer',\n template: `\n @if (error()) {\n <div class=\"dynamic-renderer-error\">\n <span>Unknown component type: {{ element().type }}</span>\n </div>\n }\n `,\n styles: `\n :host {\n display: contents;\n }\n .dynamic-renderer-error {\n padding: 1rem;\n background: #fee2e2;\n border: 1px dashed #ef4444;\n color: #dc2626;\n border-radius: 4px;\n font-size: 0.875rem;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DynamicRendererComponent {\n private readonly registry = inject(ComponentRegistryService);\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly destroyRef = inject(DestroyRef);\n\n /** Element to render */\n readonly element = input.required<EditorElement>();\n\n /** Additional context (sectionId, index, etc.) */\n readonly context = input<Record<string, unknown>>({});\n\n /** Error state signal */\n private _error = false;\n error = () => this._error;\n\n private componentRef: ComponentRef<unknown> | null = null;\n private currentType: string | null = null;\n private currentAvailableInputs: Set<string> | null = null;\n private previousInputs = new Map<string, unknown>();\n\n constructor() {\n effect(() => {\n const el = this.element();\n const ctx = this.context();\n\n if (this.componentRef && this.currentType === el.type) {\n // Same type: update only inputs that changed\n this.updateInputs(el, ctx);\n } else {\n // Different type or first render: full create\n this.renderComponent(el, ctx);\n }\n });\n\n this.destroyRef.onDestroy(() => {\n this.cleanup();\n });\n }\n\n private renderComponent(element: EditorElement, context: Record<string, unknown>): void {\n this.cleanup();\n\n const componentType = this.registry.getComponent(element.type);\n if (!componentType) {\n this._error = true;\n this.currentType = null;\n this.currentAvailableInputs = null;\n console.warn(`DynamicRenderer: No component registered for type \"${element.type}\"`);\n return;\n }\n\n this._error = false;\n this.currentType = element.type;\n this.previousInputs.clear();\n this.componentRef = this.viewContainerRef.createComponent(componentType);\n this.currentAvailableInputs = this.getComponentInputs(componentType);\n\n // Stamp the host element so canvas elements are discoverable by ID\n const hostEl = this.componentRef.location.nativeElement as HTMLElement;\n if (hostEl?.setAttribute) {\n hostEl.setAttribute('data-element-id', element.id);\n }\n\n this.updateInputs(element, context);\n }\n\n private updateInputs(element: EditorElement, context: Record<string, unknown>): void {\n if (!this.componentRef || !this.currentAvailableInputs) return;\n\n const availableInputs = this.currentAvailableInputs;\n\n // Pass props — only call setInput when the value actually changed\n for (const [key, value] of Object.entries(element.props)) {\n if (availableInputs.has(key)) {\n this.setInputIfChanged(key, value);\n }\n }\n\n // Pass special editor props (only if the component declares them)\n if (availableInputs.has('_elementId')) {\n this.setInputIfChanged('_elementId', element.id);\n }\n\n // Pass children: for sections use 'elements', for elements use 'children'\n if (availableInputs.has('_children')) {\n const children = (element as unknown as { elements?: unknown[] }).elements ?? element.children;\n this.setInputIfChanged('_children', children ?? []);\n }\n\n if (availableInputs.has('_context')) {\n this.setInputIfChanged('_context', context);\n }\n }\n\n private setInputIfChanged(key: string, value: unknown): void {\n if (this.previousInputs.get(key) !== value) {\n this.previousInputs.set(key, value);\n this.componentRef!.setInput(key, value);\n }\n }\n\n private getComponentInputs(componentType: Type<unknown>): Set<string> {\n const mirror = reflectComponentType(componentType);\n if (!mirror) {\n return new Set();\n }\n return new Set(mirror.inputs.map(i => i.propName));\n }\n\n private cleanup(): void {\n if (this.componentRef) {\n this.componentRef.destroy();\n this.componentRef = null;\n }\n this.viewContainerRef.clear();\n }\n}\n","import { Component, ChangeDetectionStrategy, input, computed, inject } from '@angular/core';\nimport { ComponentRegistryService } from '../registry/component-registry.service';\nimport { EditorElement } from '../store/visual-editor.state';\nimport { SlotDefinition } from '../registry/slot.types';\nimport { DynamicRendererComponent } from './dynamic-renderer.component';\n\n/**\n * Renders child elements within a specific slot\n */\n@Component({\n selector: 'lib-slot-renderer',\n imports: [DynamicRendererComponent],\n template: `\n @if (filteredChildren().length === 0 && slot().emptyPlaceholder) {\n <div class=\"slot-empty\" [attr.data-slot]=\"slot().name\">\n {{ slot().emptyPlaceholder }}\n </div>\n } @else {\n @for (child of filteredChildren(); track child.id; let idx = $index) {\n <lib-dynamic-renderer\n [element]=\"child\"\n [context]=\"{ slotName: slot().name, index: idx, parentId: parentElementId() }\"\n />\n }\n }\n `,\n styles: `\n :host {\n display: contents;\n }\n .slot-empty {\n padding: 2rem;\n border: 2px dashed #d1d5db;\n color: #9ca3af;\n text-align: center;\n border-radius: 4px;\n font-size: 0.875rem;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SlotRendererComponent {\n private readonly registry = inject(ComponentRegistryService);\n\n /** Slot definition */\n readonly slot = input.required<SlotDefinition>();\n\n /** All children of the parent element */\n readonly children = input.required<EditorElement[]>();\n\n /** Parent element ID */\n readonly parentElementId = input.required<string>();\n\n /** Children filtered by slot name and constraints */\n readonly filteredChildren = computed(() => {\n const slotDef = this.slot();\n const allChildren = this.children() ?? [];\n\n return allChildren.filter((child) => {\n // Filter by slot name - children must match the slot they belong to\n // Children without slotName go to the 'default' slot (or first slot)\n const childSlot = child.slotName ?? 'default';\n if (childSlot !== slotDef.name && slotDef.name !== 'default') {\n return false;\n }\n\n // Check allowed types\n if (slotDef.constraints?.allowedTypes?.length) {\n if (!slotDef.constraints.allowedTypes.includes(child.type)) {\n return false;\n }\n }\n\n // Check disallowed types\n if (slotDef.constraints?.disallowedTypes?.length) {\n if (slotDef.constraints.disallowedTypes.includes(child.type)) {\n return false;\n }\n }\n\n return true;\n });\n });\n}\n","import { Injectable, computed, inject } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { Observable, tap } from 'rxjs';\nimport { ComponentRegistryService } from '../registry/component-registry.service';\nimport { ComponentDefinition, ComponentPreset, PresetBlockConfig } from '../registry/component-definition.types';\nimport { ResolvedPreset } from '../registry/component-registry.service';\nimport { SlotDefinition } from '../registry/slot.types';\nimport { VisualEditorActions } from '../store/visual-editor.actions';\nimport {\n selectSelectedElement,\n selectSelectedSection,\n selectSections,\n selectCanUndo,\n selectCanRedo,\n selectIsDragging,\n selectSelectedBlock,\n selectSelectedBlockSlotName,\n selectCurrentPage,\n selectCurrentPageId,\n selectIsDirty,\n selectIsPageLoaded,\n} from '../store/visual-editor.selectors';\nimport { EditorElement, EditorSection } from '../store/visual-editor.state';\nimport { PageService } from './page.service';\nimport {\n CreatePageRequest,\n Page,\n PageContext,\n PageSummary,\n UpdatePageRequest,\n} from '../models/page.model';\n\n/**\n * Recursively find an element by ID in a tree of elements\n */\nfunction findElementRecursive(elements: EditorElement[], elementId: string): EditorElement | null {\n for (const element of elements) {\n if (element.id === elementId) {\n return element;\n }\n if (element.children && element.children.length > 0) {\n const found = findElementRecursive(element.children, elementId);\n if (found) {\n return found;\n }\n }\n }\n return null;\n}\n\n/**\n * Facade service that combines Store operations with ComponentRegistry\n */\n@Injectable({ providedIn: 'root' })\nexport class VisualEditorFacade {\n private readonly store = inject(Store);\n private readonly registry = inject(ComponentRegistryService);\n private readonly pageService = inject(PageService);\n\n // State signals\n readonly sections = toSignal(this.store.select(selectSections), { initialValue: [] });\n readonly selectedElement = toSignal(this.store.select(selectSelectedElement), {\n initialValue: null,\n });\n readonly selectedSection = toSignal(this.store.select(selectSelectedSection), {\n initialValue: null,\n });\n readonly canUndo = toSignal(this.store.select(selectCanUndo), { initialValue: false });\n readonly canRedo = toSignal(this.store.select(selectCanRedo), { initialValue: false });\n readonly isDragging = toSignal(this.store.select(selectIsDragging), { initialValue: false });\n readonly selectedBlock = toSignal(this.store.select(selectSelectedBlock), { initialValue: null });\n readonly selectedBlockSlotName = toSignal(this.store.select(selectSelectedBlockSlotName), {\n initialValue: null,\n });\n\n // Page state signals\n readonly currentPage = toSignal(this.store.select(selectCurrentPage), { initialValue: null });\n readonly currentPageId = toSignal(this.store.select(selectCurrentPageId), { initialValue: null });\n readonly isDirty = toSignal(this.store.select(selectIsDirty), { initialValue: false });\n readonly isPageLoaded = toSignal(this.store.select(selectIsPageLoaded), { initialValue: false });\n\n // Computed: definition of selected element\n readonly selectedElementDefinition = computed<ComponentDefinition | null>(() => {\n const element = this.selectedElement();\n if (!element) return null;\n return this.registry.get(element.type) ?? null;\n });\n\n // Computed: definition of selected section\n readonly selectedSectionDefinition = computed<ComponentDefinition | null>(() => {\n const section = this.selectedSection();\n if (!section) return null;\n return this.registry.get(section.type) ?? null;\n });\n\n // Computed: definition of selected block\n readonly selectedBlockDefinition = computed<ComponentDefinition | null>(() => {\n const block = this.selectedBlock();\n if (!block) return null;\n return this.registry.get(block.type) ?? null;\n });\n\n // Registry access\n readonly availableSections = computed(() => this.registry.getSections());\n readonly availableElements = computed(() => this.registry.getElements());\n readonly availableBlocks = computed(() => this.registry.getBlocks());\n\n // Preset-aware computed signals\n readonly availableSectionPresets = computed(() => this.registry.getSectionPresets());\n readonly availableBlockPresets = computed(() => this.registry.getBlockPresets());\n\n /**\n * Create a new element with default props from registry\n */\n createElementWithDefaults(type: string, overrides?: Partial<EditorElement>): EditorElement {\n const defaultProps = this.registry.getDefaultProps(type);\n return {\n id: crypto.randomUUID(),\n type,\n props: { ...defaultProps, ...overrides?.props },\n children: overrides?.children,\n };\n }\n\n /**\n * Create a new section with default props from registry\n */\n createSectionWithDefaults(type: string, overrides?: Partial<EditorSection>): EditorSection {\n const defaultProps = this.registry.getDefaultProps(type);\n return {\n id: crypto.randomUUID(),\n type,\n props: { ...defaultProps, ...overrides?.props },\n elements: overrides?.elements ?? [],\n };\n }\n\n /**\n * Add a section to the editor\n */\n addSection(type: string, index?: number): void {\n const section = this.createSectionWithDefaults(type);\n this.store.dispatch(VisualEditorActions.addSection({ section, index }));\n }\n\n /**\n * Add an element to a section\n */\n addElement(sectionId: string, type: string, index?: number): void {\n const element = this.createElementWithDefaults(type);\n this.store.dispatch(VisualEditorActions.addElement({ sectionId, element, index }));\n }\n\n /**\n * Remove a section\n */\n removeSection(sectionId: string): void {\n this.store.dispatch(VisualEditorActions.removeSection({ sectionId }));\n }\n\n /**\n * Remove an element\n */\n removeElement(sectionId: string, elementId: string): void {\n this.store.dispatch(VisualEditorActions.removeElement({ sectionId, elementId }));\n }\n\n /**\n * Move a section to a new index\n */\n moveSection(sectionId: string, newIndex: number): void {\n this.store.dispatch(VisualEditorActions.moveSection({ sectionId, newIndex }));\n }\n\n /**\n * Move an element within or between sections\n */\n moveElement(\n sourceSectionId: string,\n targetSectionId: string,\n elementId: string,\n newIndex: number\n ): void {\n this.store.dispatch(\n VisualEditorActions.moveElement({ sourceSectionId, targetSectionId, elementId, newIndex })\n );\n }\n\n // ========== Rename Operations ==========\n\n /**\n * Rename a section (set adminLabel)\n */\n renameSection(sectionId: string, adminLabel: string): void {\n this.store.dispatch(VisualEditorActions.renameSection({ sectionId, adminLabel }));\n }\n\n /**\n * Rename a block (set adminLabel)\n */\n renameBlock(sectionId: string, elementId: string, adminLabel: string): void {\n this.store.dispatch(VisualEditorActions.renameBlock({ sectionId, elementId, adminLabel }));\n }\n\n // ========== Block Operations ==========\n\n /**\n * Create a block element with default props and slotName\n */\n createBlockWithDefaults(\n type: string,\n slotName: string,\n overrides?: Partial<EditorElement>\n ): EditorElement {\n const defaultProps = this.registry.getDefaultProps(type);\n // Initialize children array if the block type has slots\n const hasSlots = this.registry.hasSlots(type);\n return {\n id: crypto.randomUUID(),\n type,\n props: { ...defaultProps, ...overrides?.props },\n slotName,\n children: overrides?.children ?? (hasSlots ? [] : undefined),\n };\n }\n\n /**\n * Add a block to a section's slot\n */\n addBlock(sectionId: string, slotName: string, type: string, index?: number): void {\n const element = this.createBlockWithDefaults(type, slotName);\n this.store.dispatch(VisualEditorActions.addBlock({ sectionId, slotName, element, index }));\n }\n\n // ========== Preset Operations ==========\n\n /**\n * Add a section from a resolved preset.\n * Merges preset settings into default props and creates pre-configured blocks.\n */\n addSectionFromPreset(resolvedPreset: ResolvedPreset, index?: number): void {\n const { definition, preset } = resolvedPreset;\n const props = this.registry.getPresetProps(definition.type, preset);\n const elements = this.createPresetBlocks(definition, preset);\n\n const section: EditorSection = {\n id: crypto.randomUUID(),\n type: definition.type,\n props,\n elements,\n };\n\n this.store.dispatch(VisualEditorActions.addSection({ section, index }));\n }\n\n /**\n * Add a block from a resolved preset to a section's slot.\n */\n addBlockFromPreset(\n sectionId: string,\n slotName: string,\n resolvedPreset: ResolvedPreset,\n index?: number\n ): void {\n const { definition, preset } = resolvedPreset;\n const props = this.registry.getPresetProps(definition.type, preset);\n const hasSlots = this.registry.hasSlots(definition.type);\n\n const element: EditorElement = {\n id: crypto.randomUUID(),\n type: definition.type,\n props,\n slotName,\n children: hasSlots ? this.createPresetBlockChildren(preset?.blocks) : undefined,\n };\n\n this.store.dispatch(VisualEditorActions.addBlock({ sectionId, slotName, element, index }));\n }\n\n /**\n * Generate EditorElement[] from a preset's blocks configuration\n */\n private createPresetBlocks(\n definition: ComponentDefinition,\n preset: ComponentPreset | null\n ): EditorElement[] {\n if (!preset?.blocks || preset.blocks.length === 0) return [];\n\n const defaultSlotName = definition.slots?.[0]?.name ?? 'default';\n\n return preset.blocks.map((blockConfig) => {\n const blockProps = this.registry.getPresetProps(blockConfig.type, {\n name: blockConfig.type,\n settings: blockConfig.settings,\n });\n const hasSlots = this.registry.hasSlots(blockConfig.type);\n\n return {\n id: crypto.randomUUID(),\n type: blockConfig.type,\n props: blockProps,\n slotName: blockConfig.slotName ?? defaultSlotName,\n children: hasSlots ? this.createPresetBlockChildren(blockConfig.blocks) : undefined,\n };\n });\n }\n\n /**\n * Generate children for blocks that have slots, from preset block configs\n */\n private createPresetBlockChildren(blockConfigs?: PresetBlockConfig[]): EditorElement[] {\n if (!blockConfigs || blockConfigs.length === 0) return [];\n\n return blockConfigs.map((blockConfig) => {\n const blockProps = this.registry.getPresetProps(blockConfig.type, {\n name: blockConfig.type,\n settings: blockConfig.settings,\n });\n const hasSlots = this.registry.hasSlots(blockConfig.type);\n\n return {\n id: crypto.randomUUID(),\n type: blockConfig.type,\n props: blockProps,\n slotName: blockConfig.slotName ?? 'default',\n children: hasSlots ? this.createPresetBlockChildren(blockConfig.blocks) : undefined,\n };\n });\n }\n\n /**\n * Remove a block from a section\n */\n removeBlock(sectionId: string, elementId: string): void {\n this.store.dispatch(VisualEditorActions.removeBlock({ sectionId, elementId }));\n }\n\n /**\n * Move a block within a section (can change slots)\n */\n moveBlock(sectionId: string, elementId: string, targetSlotName: string, newIndex: number): void {\n this.store.dispatch(\n VisualEditorActions.moveBlock({ sectionId, elementId, targetSlotName, newIndex })\n );\n }\n\n // ========== Duplicate Operations ==========\n\n /**\n * Check if a section type can be duplicated\n */\n isSectionDuplicable(type: string): boolean {\n const def = this.registry.get(type);\n return def?.duplicable !== false;\n }\n\n /**\n * Check if a block type can be duplicated\n */\n isBlockDuplicable(type: string): boolean {\n const def = this.registry.get(type);\n return def?.duplicable !== false;\n }\n\n /**\n * Duplicate a section (deep clone with new IDs)\n */\n duplicateSection(sectionId: string): void {\n this.store.dispatch(VisualEditorActions.duplicateSection({ sectionId }));\n }\n\n /**\n * Duplicate a block within a section\n */\n duplicateBlock(sectionId: string, elementId: string): void {\n this.store.dispatch(VisualEditorActions.duplicateBlock({ sectionId, elementId }));\n }\n\n /**\n * Duplicate a nested block\n */\n duplicateNestedBlock(sectionId: string, parentPath: string[], elementId: string): void {\n this.store.dispatch(\n VisualEditorActions.duplicateNestedBlock({ sectionId, parentPath, elementId })\n );\n }\n\n /**\n * Update block props with validation (works for both direct and nested blocks)\n */\n updateBlockProps(sectionId: string, elementId: string, props: Record<string, unknown>): void {\n const section = this.sections().find((s) => s.id === sectionId);\n if (!section) return;\n\n // Search recursively for the block (may be nested)\n const block = findElementRecursive(section.elements, elementId);\n\n if (block) {\n const errors = this.registry.validateProps(block.type, { ...block.props, ...props });\n if (errors.size === 0) {\n this.store.dispatch(VisualEditorActions.updateBlockProps({ sectionId, elementId, props }));\n } else {\n console.warn('Validation errors:', Object.fromEntries(errors));\n }\n }\n }\n\n /**\n * Get blocks for a specific slot in a section\n */\n getBlocksForSlot(sectionId: string, slotName: string): EditorElement[] {\n const section = this.sections().find((s) => s.id === sectionId);\n if (!section) return [];\n return section.elements.filter((e) => e.slotName === slotName);\n }\n\n /**\n * Get allowed block types for a slot\n */\n getAllowedBlocksForSlot(sectionType: string, slotName: string): ComponentDefinition[] {\n const slots = this.registry.getSlots(sectionType);\n const slot = slots.find((s) => s.name === slotName);\n const allowedTypes = slot?.constraints?.allowedTypes;\n\n if (!allowedTypes || allowedTypes.length === 0) {\n return this.availableBlocks();\n }\n\n return this.availableBlocks().filter((block) => allowedTypes.includes(block.type));\n }\n\n // ========== Nested Block Operations ==========\n\n /**\n * Check if a component type has slots (can contain nested blocks)\n */\n hasSlots(type: string): boolean {\n return this.registry.hasSlots(type);\n }\n\n /**\n * Get slots for a block type\n */\n getBlockSlots(type: string): SlotDefinition[] {\n return this.registry.getSlots(type);\n }\n\n /**\n * Check if adding a nested block is allowed (max 12 levels)\n */\n canAddNestedBlock(parentPath: string[]): boolean {\n return parentPath.length < 12;\n }\n\n /**\n * Add a nested block to a parent element\n */\n addNestedBlock(\n sectionId: string,\n parentPath: string[],\n slotName: string,\n type: string,\n index?: number\n ): void {\n if (!this.canAddNestedBlock(parentPath)) {\n console.warn('Maximum nesting depth (12) reached');\n return;\n }\n\n const element = this.createBlockWithDefaults(type, slotName);\n this.store.dispatch(\n VisualEditorActions.addNestedBlock({ sectionId, parentPath, slotName, element, index })\n );\n }\n\n /**\n * Remove a nested block from a parent element\n */\n removeNestedBlock(sectionId: string, parentPath: string[], elementId: string): void {\n this.store.dispatch(\n VisualEditorActions.removeNestedBlock({ sectionId, parentPath, elementId })\n );\n }\n\n /**\n * Update nested block props\n */\n updateNestedBlockProps(\n sectionId: string,\n parentPath: string[],\n elementId: string,\n props: Record<string, unknown>\n ): void {\n this.store.dispatch(\n VisualEditorActions.updateNestedBlockProps({ sectionId, parentPath, elementId, props })\n );\n }\n\n /**\n * Move a nested block within its parent\n */\n moveNestedBlock(\n sectionId: string,\n parentPath: string[],\n elementId: string,\n targetSlotName: string,\n newIndex: number\n ): void {\n this.store.dispatch(\n VisualEditorActions.moveNestedBlock({ sectionId, parentPath, elementId, targetSlotName, newIndex })\n );\n }\n\n /**\n * Reparent a block: move it from one parent/section to another\n */\n reparentBlock(\n sourceSectionId: string,\n sourceParentPath: string[],\n elementId: string,\n targetSectionId: string,\n targetParentPath: string[],\n targetSlotName: string,\n targetIndex: number\n ): void {\n this.store.dispatch(\n VisualEditorActions.reparentBlock({\n sourceSectionId,\n sourceParentPath,\n elementId,\n targetSectionId,\n targetParentPath,\n targetSlotName,\n targetIndex,\n })\n );\n }\n\n /**\n * Get children of an element filtered by slot\n */\n getElementChildren(element: EditorElement, slotName?: string): EditorElement[] {\n const children = element.children ?? [];\n if (!slotName) return children;\n return children.filter((c) => c.slotName === slotName);\n }\n\n /**\n * Get allowed blocks for a nested slot\n */\n getAllowedBlocksForNestedSlot(parentType: string, slotName: string): ComponentDefinition[] {\n const slots = this.registry.getSlots(parentType);\n const slot = slots.find((s) => s.name === slotName);\n const allowedTypes = slot?.constraints?.allowedTypes;\n\n if (!allowedTypes || allowedTypes.length === 0) {\n return this.availableBlocks();\n }\n\n return this.availableBlocks().filter((block) => allowedTypes.includes(block.type));\n }\n\n /**\n * Select an element\n */\n selectElement(sectionId: string | null, elementId: string | null): void {\n this.store.dispatch(VisualEditorActions.selectElement({ sectionId, elementId }));\n }\n\n /**\n * Clear selection\n */\n clearSelection(): void {\n this.store.dispatch(VisualEditorActions.clearSelection());\n }\n\n /**\n * Update element props with validation\n */\n updateElementProps(sectionId: string, elementId: string, props: Record<string, unknown>): void {\n const element = this.sections()\n .find((s) => s.id === sectionId)\n ?.elements.find((e) => e.id === elementId);\n\n if (element) {\n const errors = this.registry.validateProps(element.type, { ...element.props, ...props });\n if (errors.size === 0) {\n this.store.dispatch(VisualEditorActions.updateElementProps({ sectionId, elementId, props }));\n } else {\n console.warn('Validation errors:', Object.fromEntries(errors));\n }\n }\n }\n\n /**\n * Update section props with validation\n */\n updateSectionProps(sectionId: string, props: Record<string, unknown>): void {\n const section = this.sections().find((s) => s.id === sectionId);\n\n if (section) {\n const errors = this.registry.validateProps(section.type, { ...section.props, ...props });\n if (errors.size === 0) {\n this.store.dispatch(VisualEditorActions.updateSectionProps({ sectionId, props }));\n } else {\n console.warn('Validation errors:', Object.fromEntries(errors));\n }\n }\n }\n\n /**\n * Undo last action\n */\n undo(): void {\n this.store.dispatch(VisualEditorActions.undo());\n }\n\n /**\n * Redo last undone action\n */\n redo(): void {\n this.store.dispatch(VisualEditorActions.redo());\n }\n\n /**\n * Load sections into the editor\n */\n loadSections(sections: EditorSection[]): void {\n this.store.dispatch(VisualEditorActions.loadSections({ sections }));\n }\n\n /**\n * Reset editor to initial state\n */\n resetEditor(): void {\n this.store.dispatch(VisualEditorActions.resetEditor());\n }\n\n /**\n * Get component definition by type\n */\n getDefinition(type: string): ComponentDefinition | undefined {\n return this.registry.get(type);\n }\n\n /**\n * Search components\n */\n searchComponents(query: string): ComponentDefinition[] {\n return this.registry.search(query);\n }\n\n // ========== Page Operations ==========\n\n /**\n * Get all pages (summaries)\n */\n getPages(): Observable<PageSummary[]> {\n return this.pageService.getPages();\n }\n\n /**\n * Get a page by ID and load it into the editor\n */\n getPage(id: string): Observable<Page> {\n return this.pageService.getPage(id);\n }\n\n /**\n * Get a published page by slug (for public rendering)\n */\n getPublishedPageBySlug(slug: string): Observable<Page> {\n return this.pageService.getPublishedPageBySlug(slug);\n }\n\n /**\n * Load a page into the editor\n */\n loadPage(page: Page): void {\n this.store.dispatch(VisualEditorActions.loadPage({ page }));\n }\n\n /**\n * Create a new page\n */\n createPage(request: CreatePageRequest): Observable<Page> {\n return this.pageService.createPage(request);\n }\n\n /**\n * Save current editor state to a page\n */\n savePage(pageId: string): Observable<Page> {\n const currentPage = this.currentPage();\n if (!currentPage) {\n throw new Error('No page loaded in editor');\n }\n\n const request: UpdatePageRequest = {\n sections: this.sections(),\n version: currentPage.version,\n };\n\n console.log('Saving page:', request);\n\n return this.pageService.updatePage(pageId, request).pipe(\n tap((page) => {\n this.store.dispatch(\n VisualEditorActions.updatePageContext({\n context: { version: page.version },\n })\n );\n this.store.dispatch(VisualEditorActions.markClean());\n })\n );\n }\n\n /**\n * Update page metadata (title, slug, etc.)\n */\n updatePageMetadata(pageId: string, metadata: Partial<PageContext>): Observable<Page> {\n const currentPage = this.currentPage();\n if (!currentPage) {\n throw new Error('No page loaded in editor');\n }\n\n const request: UpdatePageRequest = {\n ...metadata,\n version: currentPage.version,\n };\n\n return this.pageService.updatePage(pageId, request).pipe(\n tap((page) => {\n this.store.dispatch(\n VisualEditorActions.updatePageContext({\n context: {\n title: page.title,\n slug: page.slug,\n version: page.version,\n },\n })\n );\n })\n );\n }\n\n /**\n * Delete a page\n */\n deletePage(id: string): Observable<void> {\n return this.pageService.deletePage(id);\n }\n\n /**\n * Publish a page\n */\n publishPage(pageId: string): Observable<Page> {\n const currentPage = this.currentPage();\n if (!currentPage) {\n throw new Error('No page loaded in editor');\n }\n\n return this.pageService.publishPage(pageId, { version: currentPage.version }).pipe(\n tap((page) => {\n this.store.dispatch(\n VisualEditorActions.updatePageContext({\n context: { status: page.status, version: page.version },\n })\n );\n })\n );\n }\n\n /**\n * Unpublish a page\n */\n unpublishPage(pageId: string): Observable<Page> {\n const currentPage = this.currentPage();\n if (!currentPage) {\n throw new Error('No page loaded in editor');\n }\n\n return this.pageService.unpublishPage(pageId, { version: currentPage.version }).pipe(\n tap((page) => {\n this.store.dispatch(\n VisualEditorActions.updatePageContext({\n context: { status: page.status, version: page.version },\n })\n );\n })\n );\n }\n\n /**\n * Duplicate a page\n */\n duplicatePage(id: string): Observable<Page> {\n return this.pageService.duplicatePage(id);\n }\n\n /**\n * Clear the current page from editor\n */\n clearPage(): void {\n this.store.dispatch(VisualEditorActions.clearPage());\n }\n\n /**\n * Mark editor as dirty (has unsaved changes)\n */\n markDirty(): void {\n this.store.dispatch(VisualEditorActions.markDirty());\n }\n\n /**\n * Mark editor as clean (no unsaved changes)\n */\n markClean(): void {\n this.store.dispatch(VisualEditorActions.markClean());\n }\n}\n","import { Injectable, NgZone, inject, OnDestroy } from '@angular/core';\nimport { Observable, Subject, filter, map } from 'rxjs';\nimport { EditorSection } from '../store/visual-editor.state';\n\n// ─── Message Protocol ───────────────────────────────────────────────────────\n\n/** Parent → Iframe */\nexport interface PageUpdateMessage {\n type: 'kustomizer:page-update';\n sections: EditorSection[];\n}\n\nexport interface SelectElementMessage {\n type: 'kustomizer:select-element';\n elementId: string;\n}\n\nexport interface DeselectMessage {\n type: 'kustomizer:deselect';\n}\n\n/** Iframe → Parent */\nexport interface ReadyMessage {\n type: 'kustomizer:ready';\n}\n\nexport interface ElementClickedMessage {\n type: 'kustomizer:element-clicked';\n elementId: string;\n sectionId: string;\n}\n\nexport interface ElementHoverMessage {\n type: 'kustomizer:element-hover';\n elementId: string | null;\n}\n\nexport interface ElementMovedMessage {\n type: 'kustomizer:element-moved';\n elementId: string;\n newIndex: number;\n targetSectionId?: string;\n}\n\ntype OutboundMessage = PageUpdateMessage | SelectElementMessage | DeselectMessage;\ntype InboundMessage =\n | ReadyMessage\n | ElementClickedMessage\n | ElementHoverMessage\n | ElementMovedMessage;\n\n/**\n * Manages postMessage communication between the editor (parent) and the\n * storefront preview (iframe).\n */\n@Injectable()\nexport class IframeBridgeService implements OnDestroy {\n private readonly zone = inject(NgZone);\n private iframe: HTMLIFrameElement | null = null;\n private origin = '*';\n private readonly messages$ = new Subject<InboundMessage>();\n private readonly messageHandler = (event: MessageEvent) => this.handleMessage(event);\n\n constructor() {\n this.zone.runOutsideAngular(() => {\n window.addEventListener('message', this.messageHandler);\n });\n }\n\n ngOnDestroy(): void {\n window.removeEventListener('message', this.messageHandler);\n this.messages$.complete();\n }\n\n /**\n * Connect to an iframe element. Must be called after the iframe loads.\n */\n connect(iframe: HTMLIFrameElement, origin: string): void {\n this.iframe = iframe;\n this.origin = origin || '*';\n }\n\n /**\n * Disconnect from the current iframe.\n */\n disconnect(): void {\n this.iframe = null;\n }\n\n // ─── Outbound (Parent → Iframe) ──────────────────────────────────────────\n\n sendPageUpdate(sections: EditorSection[]): void {\n this.send({ type: 'kustomizer:page-update', sections });\n }\n\n sendSelectElement(elementId: string): void {\n this.send({ type: 'kustomizer:select-element', elementId });\n }\n\n sendDeselect(): void {\n this.send({ type: 'kustomizer:deselect' });\n }\n\n // ─── Inbound (Iframe → Parent) ───────────────────────────────────────────\n\n onReady(): Observable<void> {\n return this.messages$.pipe(\n filter((msg): msg is ReadyMessage => msg.type === 'kustomizer:ready'),\n map(() => undefined),\n );\n }\n\n onElementClicked(): Observable<{ elementId: string; sectionId: string }> {\n return this.messages$.pipe(\n filter(\n (msg): msg is ElementClickedMessage =>\n msg.type === 'kustomizer:element-clicked',\n ),\n map(({ elementId, sectionId }) => ({ elementId, sectionId })),\n );\n }\n\n onElementHover(): Observable<string | null> {\n return this.messages$.pipe(\n filter(\n (msg): msg is ElementHoverMessage =>\n msg.type === 'kustomizer:element-hover',\n ),\n map(({ elementId }) => elementId),\n );\n }\n\n onElementMoved(): Observable<{\n elementId: string;\n newIndex: number;\n targetSectionId?: string;\n }> {\n return this.messages$.pipe(\n filter(\n (msg): msg is ElementMovedMessage =>\n msg.type === 'kustomizer:element-moved',\n ),\n map(({ elementId, newIndex, targetSectionId }) => ({\n elementId,\n newIndex,\n targetSectionId,\n })),\n );\n }\n\n // ─── Private ─────────────────────────────────────────────────────────────\n\n private send(message: OutboundMessage): void {\n if (!this.iframe?.contentWindow) return;\n this.iframe.contentWindow.postMessage(message, this.origin);\n }\n\n private handleMessage(event: MessageEvent): void {\n const data = event.data as InboundMessage | null;\n if (!data?.type?.startsWith('kustomizer:')) return;\n\n // Only accept messages from the connected iframe's origin\n if (this.origin !== '*' && event.origin !== this.origin) return;\n\n this.zone.run(() => {\n this.messages$.next(data);\n });\n }\n}\n","import { Injectable, inject, signal, computed } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { DragItem, DropTarget, DropZone } from './drag-drop.types';\nimport { VisualEditorActions } from '../store/visual-editor.actions';\nimport { selectSections } from '../store/visual-editor.selectors';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { EditorElement } from '../store/visual-editor.state';\nimport { ComponentRegistryService } from '../registry/component-registry.service';\n\nconst MAX_DEPTH = 12;\n\n@Injectable({ providedIn: 'root' })\nexport class DragDropService {\n private readonly store = inject(Store);\n private readonly registry = inject(ComponentRegistryService);\n private readonly sections = toSignal(this.store.select(selectSections), { initialValue: [] });\n\n readonly dragItem = signal<DragItem | null>(null);\n readonly dropTarget = signal<DropTarget | null>(null);\n readonly isDragging = computed(() => this.dragItem() !== null);\n\n startDrag(item: DragItem, event: DragEvent): void {\n this.dragItem.set(item);\n this.store.dispatch(VisualEditorActions.startDrag({ elementId: item.elementId }));\n\n if (event.dataTransfer) {\n event.dataTransfer.effectAllowed = 'move';\n event.dataTransfer.setData('text/plain', item.elementId);\n }\n }\n\n endDrag(): void {\n this.dragItem.set(null);\n this.dropTarget.set(null);\n this.store.dispatch(VisualEditorActions.endDrag());\n }\n\n updateDropTarget(target: DropTarget | null): void {\n this.dropTarget.set(target);\n }\n\n computeDropZone(event: DragEvent, element: HTMLElement, canDropInside: boolean): DropZone {\n const rect = element.getBoundingClientRect();\n const y = event.clientY - rect.top;\n const ratio = y / rect.height;\n\n if (canDropInside) {\n if (ratio < 0.25) return 'before';\n if (ratio > 0.75) return 'after';\n return 'inside';\n }\n\n return ratio < 0.5 ? 'before' : 'after';\n }\n\n validateDrop(item: DragItem, target: DropTarget): boolean {\n // Rule 1: Cannot drop on itself\n if (item.elementId === target.sectionId && target.parentPath.length === 0 && item.kind === 'section') {\n return false;\n }\n\n // Rule 2: Sections only reorder among sections\n if (item.kind === 'section' && target.kind !== 'section') {\n return false;\n }\n if (item.kind !== 'section' && target.kind === 'section') {\n return false;\n }\n\n // For blocks:\n if (item.kind === 'block') {\n // Rule 1 for blocks: cannot drop on itself\n if (target.zone === 'inside' && this.isDropOnSelf(item, target)) {\n return false;\n }\n\n // Rule 3: Cannot create circular reference\n if (target.zone === 'inside' && this.wouldCreateCircular(item, target)) {\n return false;\n }\n\n // Rule 4: Respect slot type constraints\n if (!this.isTypeAllowedInSlot(item, target)) {\n return false;\n }\n\n // Rule 5: Max depth\n if (target.zone === 'inside' && target.depth + 1 >= MAX_DEPTH) {\n return false;\n }\n }\n\n return true;\n }\n\n executeDrop(): void {\n const item = this.dragItem();\n const target = this.dropTarget();\n if (!item || !target) return;\n\n if (!this.validateDrop(item, target)) {\n this.endDrag();\n return;\n }\n\n if (item.kind === 'section') {\n this.executeSectionDrop(item, target);\n } else {\n this.executeBlockDrop(item, target);\n }\n\n this.endDrag();\n }\n\n private executeSectionDrop(item: DragItem, target: DropTarget): void {\n const sections = this.sections();\n const currentIndex = sections.findIndex((s) => s.id === item.elementId);\n if (currentIndex === -1) return;\n\n let newIndex = target.index;\n if (currentIndex < newIndex) {\n newIndex--;\n }\n\n this.store.dispatch(VisualEditorActions.moveSection({ sectionId: item.elementId, newIndex }));\n }\n\n private executeBlockDrop(item: DragItem, target: DropTarget): void {\n const isSameParent =\n item.sectionId === target.sectionId &&\n this.pathsEqual(item.parentPath, target.parentPath);\n\n if (isSameParent && target.zone !== 'inside') {\n // Same parent - reorder\n const slotName = target.slotName;\n let newIndex = target.index;\n\n // Adjust index if moving within same slot\n if (item.slotName === slotName && item.sourceIndex < newIndex) {\n newIndex--;\n }\n\n if (item.parentPath.length === 0) {\n this.store.dispatch(VisualEditorActions.moveBlock({\n sectionId: item.sectionId,\n elementId: item.elementId,\n targetSlotName: slotName,\n newIndex,\n }));\n } else {\n this.store.dispatch(VisualEditorActions.moveNestedBlock({\n sectionId: item.sectionId,\n parentPath: item.parentPath,\n elementId: item.elementId,\n targetSlotName: slotName,\n newIndex,\n }));\n }\n } else {\n // Different parent or drop inside - reparent\n let targetParentPath: string[];\n let targetSlotName: string;\n let targetIndex: number;\n\n if (target.zone === 'inside') {\n // Dropping inside a block - the target block becomes the parent\n targetParentPath = target.parentPath;\n targetSlotName = target.slotName;\n targetIndex = target.index;\n } else {\n targetParentPath = target.parentPath;\n targetSlotName = target.slotName;\n targetIndex = target.index;\n }\n\n this.store.dispatch(VisualEditorActions.reparentBlock({\n sourceSectionId: item.sectionId,\n sourceParentPath: item.parentPath,\n elementId: item.elementId,\n targetSectionId: target.sectionId,\n targetParentPath,\n targetSlotName,\n targetIndex,\n }));\n }\n }\n\n private isDropOnSelf(item: DragItem, target: DropTarget): boolean {\n // Check if we're trying to drop an element inside itself\n return target.parentPath.includes(item.elementId);\n }\n\n private wouldCreateCircular(item: DragItem, target: DropTarget): boolean {\n // Cannot drop a parent inside its own descendant\n if (target.parentPath.includes(item.elementId)) {\n return true;\n }\n\n // If the target's parentPath ends with the dragged element, it would be circular\n const lastPathId = target.parentPath[target.parentPath.length - 1];\n if (lastPathId === item.elementId) {\n return true;\n }\n\n // Check if any element in the dragged subtree contains the target parent\n const sections = this.sections();\n const section = sections.find((s) => s.id === item.sectionId);\n if (!section) return false;\n\n const draggedElement = this.findElementInTree(section.elements, item.elementId);\n if (!draggedElement) return false;\n\n // Check if the target element is a descendant of the dragged element\n const targetParentId = target.parentPath[target.parentPath.length - 1];\n if (targetParentId && this.isDescendant(draggedElement, targetParentId)) {\n return true;\n }\n\n return false;\n }\n\n private isTypeAllowedInSlot(item: DragItem, target: DropTarget): boolean {\n // Find the parent element to check its slot constraints\n if (target.parentPath.length === 0) {\n // Dropping at section level\n const section = this.sections().find((s) => s.id === target.sectionId);\n if (!section) return true;\n\n const sectionDef = this.registry.get(section.type);\n if (!sectionDef?.slots) return true;\n\n const slot = sectionDef.slots.find((s) => s.name === target.slotName);\n if (!slot?.constraints?.allowedTypes) return true;\n\n return slot.constraints.allowedTypes.includes(item.elementType);\n }\n\n // Dropping inside a nested block\n const parentId = target.parentPath[target.parentPath.length - 1];\n const section = this.sections().find((s) => s.id === target.sectionId);\n if (!section) return true;\n\n const parentElement = this.findElementInTree(section.elements, parentId);\n if (!parentElement) return true;\n\n const parentDef = this.registry.get(parentElement.type);\n if (!parentDef?.slots) return true;\n\n const slot = parentDef.slots.find((s) => s.name === target.slotName);\n if (!slot?.constraints?.allowedTypes) return true;\n\n return slot.constraints.allowedTypes.includes(item.elementType);\n }\n\n private findElementInTree(elements: EditorElement[], elementId: string): EditorElement | null {\n for (const el of elements) {\n if (el.id === elementId) return el;\n if (el.children?.length) {\n const found = this.findElementInTree(el.children, elementId);\n if (found) return found;\n }\n }\n return null;\n }\n\n private isDescendant(parent: EditorElement, targetId: string): boolean {\n if (!parent.children) return false;\n for (const child of parent.children) {\n if (child.id === targetId) return true;\n if (this.isDescendant(child, targetId)) return true;\n }\n return false;\n }\n\n private pathsEqual(a: string[], b: string[]): boolean {\n if (a.length !== b.length) return false;\n return a.every((id, i) => id === b[i]);\n }\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n input,\n output,\n inject,\n signal,\n computed,\n ElementRef,\n viewChild,\n} from '@angular/core';\nimport { VisualEditorFacade } from '../../services/visual-editor-facade.service';\nimport { DragDropService } from '../../dnd/drag-drop.service';\nimport type { DragItem, DropTarget, DropZone } from '../../dnd/drag-drop.types';\nimport { EditorElement } from '../../store/visual-editor.state';\nimport { SlotDefinition } from '../../registry/slot.types';\n\n/**\n * Context for a block in the tree hierarchy\n */\nexport interface BlockTreeContext {\n sectionId: string;\n parentPath: string[];\n depth: number;\n}\n\n/**\n * Target information for opening the block picker\n */\nexport interface BlockPickerTarget {\n sectionId: string;\n parentPath: string[];\n parentType: string;\n slots: SlotDefinition[];\n}\n\n/**\n * Recursive component for rendering a block in the sidebar tree\n * Supports nested blocks with expand/collapse functionality\n */\n@Component({\n selector: 'lib-block-tree-item',\n imports: [BlockTreeItemComponent],\n template: `\n <div\n class=\"tree-block\"\n #treeBlock\n draggable=\"true\"\n [class.selected]=\"facade.selectedBlock()?.id === block().id\"\n [class.has-children]=\"blockHasSlots()\"\n [class.drag-over-before]=\"dropZone() === 'before'\"\n [class.drag-over-inside]=\"dropZone() === 'inside'\"\n [class.drag-over-after]=\"dropZone() === 'after'\"\n [class.is-dragging]=\"isDragSource()\"\n [style.paddingLeft.rem]=\"0.75 + context().depth * 0.75\"\n [attr.data-drag-id]=\"block().id\"\n (click)=\"onSelect($event)\"\n (dragstart)=\"onDragStart($event)\"\n (dragend)=\"onDragEnd($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n (drop)=\"onDrop($event)\"\n >\n @if (blockHasSlots()) {\n <button\n class=\"expand-btn\"\n [class.expanded]=\"isExpanded()\"\n (click)=\"toggleExpand($event)\"\n [attr.aria-expanded]=\"isExpanded()\"\n [attr.aria-label]=\"isExpanded() ? 'Collapse' : 'Expand'\"\n >\n <span class=\"expand-icon\">&#9654;</span>\n </button>\n } @else {\n <span class=\"block-indent\"></span>\n }\n <span class=\"icon-drag-wrapper\">\n <span class=\"block-icon\">{{ blockIcon() }}</span>\n <span\n class=\"drag-handle\"\n role=\"button\"\n [attr.aria-label]=\"'Drag ' + blockName() + ' to reorder'\"\n [attr.aria-roledescription]=\"'draggable'\"\n tabindex=\"0\"\n (keydown)=\"onDragHandleKeydown($event)\"\n >\n <svg width=\"10\" height=\"16\" viewBox=\"0 0 10 16\" fill=\"currentColor\" aria-hidden=\"true\">\n <circle cx=\"3\" cy=\"2\" r=\"1.5\"/>\n <circle cx=\"7\" cy=\"2\" r=\"1.5\"/>\n <circle cx=\"3\" cy=\"8\" r=\"1.5\"/>\n <circle cx=\"7\" cy=\"8\" r=\"1.5\"/>\n <circle cx=\"3\" cy=\"14\" r=\"1.5\"/>\n <circle cx=\"7\" cy=\"14\" r=\"1.5\"/>\n </svg>\n </span>\n </span>\n <span class=\"block-name\">{{ blockName() }}</span>\n <div class=\"tree-actions\">\n @if (index() > 0) {\n <button class=\"tree-btn\" (click)=\"onMoveUp($event)\" title=\"Move up\">&#8593;</button>\n }\n @if (index() < totalSiblings() - 1) {\n <button class=\"tree-btn\" (click)=\"onMoveDown($event)\" title=\"Move down\">&#8595;</button>\n }\n @if (duplicable()) {\n <button class=\"tree-btn\" (click)=\"onDuplicate($event)\" title=\"Duplicate\">\n <span class=\"material-icon\">content_copy</span>\n </button>\n }\n <button class=\"tree-btn delete\" (click)=\"onDelete($event)\" title=\"Delete\">&times;</button>\n </div>\n </div>\n\n @if (isExpanded() && blockHasSlots()) {\n <div class=\"nested-content\">\n @for (child of children(); track child.id; let childIdx = $index) {\n <lib-block-tree-item\n [block]=\"child\"\n [context]=\"childContext()\"\n [index]=\"childIdx\"\n [totalSiblings]=\"children().length\"\n [expandAll]=\"expandAll()\"\n (selectBlock)=\"selectBlock.emit($event)\"\n (deleteBlock)=\"deleteBlock.emit($event)\"\n (duplicateBlock)=\"duplicateBlock.emit($event)\"\n (moveBlock)=\"moveBlock.emit($event)\"\n (openBlockPicker)=\"openBlockPicker.emit($event)\"\n />\n }\n @if (canAddMore()) {\n <button\n class=\"add-block-btn nested\"\n [style.marginLeft.rem]=\"0.75 + (context().depth + 1) * 0.75\"\n (click)=\"onAddBlock($event)\"\n >\n <span class=\"add-icon-circle\">\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" aria-hidden=\"true\">\n <circle cx=\"10\" cy=\"10\" r=\"9\"/>\n <line x1=\"10\" y1=\"6\" x2=\"10\" y2=\"14\"/>\n <line x1=\"6\" y1=\"10\" x2=\"14\" y2=\"10\"/>\n </svg>\n </span> Add block\n </button>\n }\n </div>\n }\n `,\n styles: `\n :host {\n display: block;\n }\n\n .tree-block {\n display: flex;\n align-items: center;\n gap: 0.375rem;\n padding: 0.5rem;\n padding-right: 0.75rem;\n cursor: pointer;\n transition: background 0.2s;\n position: relative;\n }\n\n .tree-block:hover {\n background: #f5f5f5;\n border-radius: 8px;\n margin-right: 0.375rem;\n }\n\n .tree-block.selected {\n background: #005bd3;\n color: #fff;\n border-radius: 8px;\n margin-right: 0.375rem;\n }\n\n .tree-block.selected .block-icon,\n .tree-block.selected .block-name,\n .tree-block.selected .expand-btn,\n .tree-block.selected .drag-handle,\n .tree-block.selected .tree-btn {\n color: inherit;\n }\n\n .tree-block.drag-over-before {\n box-shadow: inset 0 2px 0 0 #4a90d9;\n }\n\n .tree-block.drag-over-inside {\n background: rgba(74, 144, 217, 0.1);\n box-shadow: inset 0 0 0 2px #4a90d9;\n }\n\n .tree-block.drag-over-after {\n box-shadow: inset 0 -2px 0 0 #4a90d9;\n }\n\n .tree-block.is-dragging {\n opacity: 0.4;\n cursor: grabbing;\n }\n\n .drag-handle {\n cursor: grab;\n color: #999;\n opacity: 0;\n transition: opacity 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n padding: 0.125rem;\n border: none;\n background: none;\n border-radius: 2px;\n }\n\n .drag-handle:hover {\n color: #666;\n background: #e0e0e0;\n }\n\n .drag-handle:focus-visible {\n opacity: 1;\n outline: 2px solid #4a90d9;\n outline-offset: 1px;\n }\n\n .tree-block:hover .drag-handle {\n opacity: 1;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .tree-block,\n .drag-handle,\n .tree-actions,\n .expand-icon {\n transition: none;\n }\n }\n\n .expand-btn {\n width: 16px;\n height: 16px;\n padding: 0;\n border: none;\n background: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #666;\n flex-shrink: 0;\n }\n\n .expand-btn.expanded .expand-icon {\n transform: rotate(90deg);\n }\n\n .expand-icon {\n font-size: 0.5rem;\n transition: transform 0.2s;\n }\n\n .block-indent {\n width: 18px;\n height: 1px;\n background: #ddd;\n flex-shrink: 0;\n }\n\n .icon-drag-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .icon-drag-wrapper .drag-handle {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .tree-block:hover .icon-drag-wrapper .block-icon,\n .icon-drag-wrapper:has(.drag-handle:focus-visible) .block-icon {\n visibility: hidden;\n }\n\n .block-icon {\n font-size: 0.875rem;\n flex-shrink: 0;\n }\n\n .block-name {\n flex: 1;\n font-size: 0.75rem;\n color: #555;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .tree-actions {\n display: flex;\n gap: 0.125rem;\n opacity: 0;\n transition: opacity 0.2s;\n }\n\n .tree-block:hover .tree-actions {\n opacity: 1;\n }\n\n .tree-btn {\n padding: 0.125rem 0.375rem;\n border: none;\n border-radius: 3px;\n background: #e0e0e0;\n cursor: pointer;\n font-size: 0.6875rem;\n color: #666;\n }\n\n .tree-btn:hover {\n background: #d0d0d0;\n }\n\n .tree-btn.delete:hover {\n background: #e74c3c;\n color: #fff;\n }\n\n .material-icon {\n font-family: 'Material Icons', sans-serif;\n font-size: 0.75rem;\n font-weight: normal;\n font-style: normal;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n white-space: nowrap;\n word-wrap: normal;\n direction: ltr;\n -webkit-font-smoothing: antialiased;\n text-rendering: optimizeLegibility;\n }\n\n .nested-content {\n border-left: 1px solid #e0e0e0;\n margin-left: 1.25rem;\n }\n\n .add-block-btn {\n display: flex;\n align-items: center;\n gap: 0.375rem;\n width: calc(100% - 1rem);\n margin: 0.375rem 0.5rem;\n padding: 0.375rem 0.5rem;\n border: none;\n border-radius: 4px;\n background: transparent;\n cursor: pointer;\n font-size: 0.6875rem;\n color: #005bd3;\n transition: all 0.2s;\n }\n\n .add-block-btn:hover {\n background: #f0f5ff;\n color: #004299;\n }\n\n .add-icon {\n font-size: 0.75rem;\n font-weight: 600;\n }\n\n .add-icon-circle {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BlockTreeItemComponent {\n readonly facade = inject(VisualEditorFacade);\n private readonly dndService = inject(DragDropService);\n\n private readonly treeBlock = viewChild<ElementRef<HTMLElement>>('treeBlock');\n\n readonly block = input.required<EditorElement>();\n readonly context = input.required<BlockTreeContext>();\n readonly index = input.required<number>();\n readonly totalSiblings = input.required<number>();\n readonly expandAll = input(false);\n\n readonly selectBlock = output<{ block: EditorElement; context: BlockTreeContext }>();\n readonly deleteBlock = output<{ block: EditorElement; context: BlockTreeContext }>();\n readonly duplicateBlock = output<{ block: EditorElement; context: BlockTreeContext }>();\n readonly moveBlock = output<{ block: EditorElement; context: BlockTreeContext; newIndex: number }>();\n readonly openBlockPicker = output<BlockPickerTarget>();\n\n private readonly expanded = signal(false);\n readonly dropZone = signal<DropZone | null>(null);\n\n readonly isDragSource = computed(() => {\n const dragItem = this.dndService.dragItem();\n return dragItem !== null && dragItem.elementId === this.block().id;\n });\n\n readonly blockHasSlots = computed(() => this.facade.hasSlots(this.block().type));\n readonly blockSlots = computed(() => this.facade.getBlockSlots(this.block().type));\n readonly children = computed(() => this.block().children ?? []);\n readonly childContext = computed<BlockTreeContext>(() => ({\n sectionId: this.context().sectionId,\n parentPath: [...this.context().parentPath, this.block().id],\n depth: this.context().depth + 1,\n }));\n readonly blockIcon = computed(() => {\n const iconMap: Record<string, string> = {\n 'text-block': '📝',\n 'button-block': '🔘',\n 'image-block': '🖼️',\n 'icon-block': '⭐',\n 'feature-item': '⭐',\n 'card-block': '🃏',\n };\n return iconMap[this.block().type] ?? '🧩';\n });\n readonly blockName = computed(() => {\n const block = this.block();\n if (block.adminLabel) return block.adminLabel;\n const def = this.facade.getDefinition(block.type);\n const preview = String(block.props['content'] ?? block.props['label'] ?? block.props['text'] ?? '');\n if (preview && preview.length > 20) {\n return preview.substring(0, 20) + '...';\n }\n return preview || def?.name || block.type;\n });\n readonly duplicable = computed(() => this.facade.isBlockDuplicable(this.block().type));\n readonly canAddMore = computed(() => {\n const newDepth = this.context().depth + 1;\n return this.facade.canAddNestedBlock([...this.context().parentPath, this.block().id]) && newDepth < 12;\n });\n\n isExpanded(): boolean {\n return this.expandAll() || this.expanded();\n }\n\n toggleExpand(event: Event): void {\n event.stopPropagation();\n this.expanded.update((v) => !v);\n }\n\n hasSlots(): boolean {\n return this.blockHasSlots();\n }\n\n getBlockSlots(): SlotDefinition[] {\n return this.blockSlots();\n }\n\n onDuplicate(event: Event): void {\n event.stopPropagation();\n this.duplicateBlock.emit({ block: this.block(), context: this.context() });\n }\n\n onSelect(event: Event): void {\n event.stopPropagation();\n this.selectBlock.emit({ block: this.block(), context: this.context() });\n }\n\n onDelete(event: Event): void {\n event.stopPropagation();\n this.deleteBlock.emit({ block: this.block(), context: this.context() });\n }\n\n onMoveUp(event: Event): void {\n event.stopPropagation();\n this.moveBlock.emit({ block: this.block(), context: this.context(), newIndex: this.index() - 1 });\n }\n\n onMoveDown(event: Event): void {\n event.stopPropagation();\n this.moveBlock.emit({ block: this.block(), context: this.context(), newIndex: this.index() + 1 });\n }\n\n onAddBlock(event: Event): void {\n event.stopPropagation();\n const slots = this.getBlockSlots();\n this.openBlockPicker.emit({\n sectionId: this.context().sectionId,\n parentPath: [...this.context().parentPath, this.block().id],\n parentType: this.block().type,\n slots,\n });\n this.expanded.set(true);\n }\n\n // Drag & Drop handlers\n\n onDragStart(event: DragEvent): void {\n event.stopPropagation();\n const block = this.block();\n const ctx = this.context();\n const item: DragItem = {\n kind: 'block',\n elementId: block.id,\n elementType: block.type,\n sectionId: ctx.sectionId,\n parentPath: ctx.parentPath,\n slotName: block.slotName,\n sourceIndex: this.index(),\n };\n this.dndService.startDrag(item, event);\n }\n\n onDragEnd(event: DragEvent): void {\n event.stopPropagation();\n this.dndService.endDrag();\n this.dropZone.set(null);\n }\n\n onDragOver(event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n\n const dragItem = this.dndService.dragItem();\n if (!dragItem || dragItem.kind !== 'block') return;\n\n const el = this.treeBlock()?.nativeElement;\n if (!el) return;\n\n const canDropInside = this.hasSlots();\n const zone = this.dndService.computeDropZone(event, el, canDropInside);\n const target = this.buildDropTarget(zone);\n\n if (this.dndService.validateDrop(dragItem, target)) {\n event.dataTransfer!.dropEffect = 'move';\n this.dropZone.set(zone);\n this.dndService.updateDropTarget(target);\n } else {\n event.dataTransfer!.dropEffect = 'none';\n this.dropZone.set(null);\n this.dndService.updateDropTarget(null);\n }\n }\n\n onDragLeave(event: DragEvent): void {\n const el = this.treeBlock()?.nativeElement;\n if (!el) return;\n\n // Only clear if we're actually leaving this element (not entering a child)\n const relatedTarget = event.relatedTarget as Node | null;\n if (relatedTarget && el.contains(relatedTarget)) {\n return;\n }\n\n this.dropZone.set(null);\n }\n\n onDrop(event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.dropZone.set(null);\n this.dndService.executeDrop();\n }\n\n onDragHandleKeydown(event: KeyboardEvent): void {\n if (event.key === 'ArrowUp' && this.index() > 0) {\n event.preventDefault();\n this.moveBlock.emit({ block: this.block(), context: this.context(), newIndex: this.index() - 1 });\n } else if (event.key === 'ArrowDown' && this.index() < this.totalSiblings() - 1) {\n event.preventDefault();\n this.moveBlock.emit({ block: this.block(), context: this.context(), newIndex: this.index() + 1 });\n }\n }\n\n private buildDropTarget(zone: DropZone): DropTarget {\n const ctx = this.context();\n const block = this.block();\n\n if (zone === 'inside') {\n // Dropping inside this block: becomes a child\n const slots = this.blockSlots();\n const slotName = slots[0]?.name ?? 'default';\n return {\n kind: 'block',\n sectionId: ctx.sectionId,\n parentPath: [...ctx.parentPath, block.id],\n slotName,\n index: this.children().length,\n depth: ctx.depth + 1,\n zone,\n };\n }\n\n // Dropping before/after this block: sibling position\n const slotName = block.slotName ?? 'default';\n return {\n kind: 'block',\n sectionId: ctx.sectionId,\n parentPath: ctx.parentPath,\n slotName,\n index: zone === 'before' ? this.index() : this.index() + 1,\n depth: ctx.depth,\n zone,\n };\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { ShopifyGraphQLClient } from './shopify-graphql-client.service';\n\nexport interface ShopifyFile {\n id: string;\n alt: string;\n url: string;\n filename: string;\n mediaType: 'IMAGE' | 'VIDEO';\n mimeType: string;\n width?: number;\n height?: number;\n createdAt: string;\n}\n\nexport interface ShopifyFilesPage {\n files: ShopifyFile[];\n pageInfo: {\n hasNextPage: boolean;\n endCursor: string | null;\n };\n}\n\nexport const FILES_QUERY = `\n query GetFiles($first: Int!, $after: String, $query: String) {\n files(first: $first, after: $after, query: $query) {\n edges {\n node {\n ... on MediaImage {\n id\n alt\n createdAt\n mimeType\n image {\n url\n width\n height\n }\n originalSource {\n fileSize\n }\n }\n ... on Video {\n id\n alt\n createdAt\n filename\n originalSource {\n mimeType\n url\n }\n sources {\n url\n mimeType\n width\n height\n }\n }\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n`;\n\ninterface MediaImageNode {\n id: string;\n alt: string;\n createdAt: string;\n mimeType: string;\n image: {\n url: string;\n width: number;\n height: number;\n };\n originalSource?: {\n fileSize?: number;\n };\n}\n\ninterface VideoNode {\n id: string;\n alt: string;\n createdAt: string;\n filename: string;\n originalSource?: {\n mimeType?: string;\n url?: string;\n };\n sources: Array<{\n url: string;\n mimeType: string;\n width: number;\n height: number;\n }>;\n}\n\ninterface FilesResponse {\n files: {\n edges: Array<{\n node: MediaImageNode | VideoNode;\n cursor: string;\n }>;\n pageInfo: {\n hasNextPage: boolean;\n endCursor: string | null;\n };\n };\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ShopifyFilesService {\n private readonly client = inject(ShopifyGraphQLClient);\n\n getFiles(\n mediaType: 'IMAGE' | 'VIDEO',\n search?: string,\n first = 24,\n after?: string\n ): Observable<ShopifyFilesPage> {\n const queryParts = [`media_type:${mediaType}`];\n if (search?.trim()) {\n queryParts.push(search.trim());\n }\n\n const variables: Record<string, unknown> = {\n first,\n query: queryParts.join(' '),\n };\n if (after) {\n variables['after'] = after;\n }\n\n return this.client.query<FilesResponse>(FILES_QUERY, variables).pipe(\n map(response => ({\n files: response.files.edges\n .map(edge => this.mapNode(edge.node, mediaType))\n .filter((f): f is ShopifyFile => f !== null),\n pageInfo: response.files.pageInfo,\n }))\n );\n }\n\n private mapNode(node: MediaImageNode | VideoNode, mediaType: 'IMAGE' | 'VIDEO'): ShopifyFile | null {\n if (mediaType === 'IMAGE' && 'image' in node) {\n const img = node as MediaImageNode;\n if (!img.image?.url) return null;\n return {\n id: img.id,\n alt: img.alt ?? '',\n url: img.image.url,\n filename: this.extractFilename(img.image.url),\n mediaType: 'IMAGE',\n mimeType: img.mimeType ?? 'image/jpeg',\n width: img.image.width,\n height: img.image.height,\n createdAt: img.createdAt,\n };\n }\n\n if (mediaType === 'VIDEO' && 'sources' in node) {\n const vid = node as VideoNode;\n const source = vid.sources[0];\n const url = source?.url ?? vid.originalSource?.url ?? '';\n if (!url) return null;\n return {\n id: vid.id,\n alt: vid.alt ?? '',\n url,\n filename: vid.filename ?? this.extractFilename(url),\n mediaType: 'VIDEO',\n mimeType: source?.mimeType ?? vid.originalSource?.mimeType ?? 'video/mp4',\n width: source?.width,\n height: source?.height,\n createdAt: vid.createdAt,\n };\n }\n\n return null;\n }\n\n private extractFilename(url: string): string {\n try {\n const pathname = new URL(url).pathname;\n return pathname.split('/').pop() ?? 'unknown';\n } catch {\n return 'unknown';\n }\n }\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n input,\n output,\n signal,\n inject,\n OnInit,\n OnDestroy,\n ElementRef,\n viewChild,\n} from '@angular/core';\nimport { Subject, takeUntil, debounceTime, switchMap, tap } from 'rxjs';\nimport { ShopifyFilesService, ShopifyFile } from '../../services/shopify-files.service';\n\n@Component({\n selector: 'lib-shopify-file-picker',\n template: `\n <div\n class=\"file-picker-overlay\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"mediaType() === 'IMAGE' ? 'Select Image' : 'Select Video'\"\n (click)=\"onBackdropClick($event)\"\n (keydown.escape)=\"close()\"\n >\n <div class=\"file-picker\" (click)=\"$event.stopPropagation()\">\n <div class=\"picker-header\">\n <h3>{{ mediaType() === 'IMAGE' ? 'Select Image' : 'Select Video' }}</h3>\n <button class=\"close-btn\" (click)=\"close()\" aria-label=\"Close\">×</button>\n </div>\n\n <div class=\"picker-search\">\n <input\n #searchInput\n type=\"text\"\n class=\"picker-search-input\"\n placeholder=\"Search files...\"\n [value]=\"searchTerm()\"\n (input)=\"onSearchInput($event)\"\n aria-label=\"Search files\"\n />\n </div>\n\n <div\n class=\"picker-content\"\n role=\"listbox\"\n [attr.aria-label]=\"mediaType() === 'IMAGE' ? 'Images' : 'Videos'\"\n #scrollContainer\n (scroll)=\"onScroll()\"\n >\n @if (isLoading() && files().length === 0) {\n <div class=\"picker-loading\">Loading...</div>\n } @else if (error()) {\n <div class=\"picker-error\" role=\"alert\">\n <p>Failed to load files</p>\n <button class=\"retry-btn\" (click)=\"loadFiles()\">Retry</button>\n </div>\n } @else if (files().length === 0 && !isLoading()) {\n <div class=\"picker-empty\">No files found</div>\n } @else {\n <div class=\"file-grid\">\n @for (file of files(); track file.id) {\n <button\n class=\"file-card\"\n role=\"option\"\n [attr.aria-selected]=\"selectedFile()?.id === file.id\"\n [class.selected]=\"selectedFile()?.id === file.id\"\n [class.current]=\"file.url === currentValue()\"\n (click)=\"selectFile(file)\"\n (dblclick)=\"confirmSelection()\"\n (keydown.enter)=\"selectAndConfirm(file)\"\n >\n @if (mediaType() === 'IMAGE') {\n <img\n class=\"file-thumbnail\"\n [src]=\"getThumbnailUrl(file.url)\"\n [alt]=\"file.alt || file.filename\"\n loading=\"lazy\"\n />\n } @else {\n <div class=\"video-thumbnail\">\n <svg class=\"video-icon\" width=\"32\" height=\"32\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M8 5v14l11-7z\"/>\n </svg>\n </div>\n }\n <span class=\"file-name\">{{ file.filename }}</span>\n @if (file.url === currentValue()) {\n <span class=\"current-badge\">Current</span>\n }\n </button>\n }\n </div>\n @if (isLoading() && files().length > 0) {\n <div class=\"picker-loading\">Loading more...</div>\n }\n }\n </div>\n\n <div class=\"picker-footer\">\n <button class=\"cancel-btn\" (click)=\"close()\">Cancel</button>\n <button\n class=\"select-btn\"\n [disabled]=\"!selectedFile()\"\n (click)=\"confirmSelection()\"\n >\n Select\n </button>\n </div>\n </div>\n </div>\n `,\n styles: `\n .file-picker-overlay {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1100;\n }\n\n .file-picker {\n background: #fff;\n border-radius: 12px;\n width: 560px;\n max-height: 70vh;\n display: flex;\n flex-direction: column;\n box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);\n }\n\n .picker-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 1rem 1.25rem;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .picker-header h3 {\n margin: 0;\n font-size: 1rem;\n font-weight: 600;\n color: #303030;\n }\n\n .close-btn {\n border: none;\n background: none;\n font-size: 1.5rem;\n cursor: pointer;\n color: #666;\n line-height: 1;\n padding: 0.25rem;\n border-radius: 4px;\n }\n\n .close-btn:hover {\n background: #f0f2f5;\n color: #303030;\n }\n\n .picker-search {\n padding: 0.75rem 1.25rem;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .picker-search-input {\n width: 100%;\n padding: 0.5rem 0.75rem;\n border: 1px solid #c9cccf;\n border-radius: 8px;\n font-size: 0.875rem;\n outline: none;\n transition: border-color 0.2s;\n box-sizing: border-box;\n }\n\n .picker-search-input:focus {\n border-color: #005bd3;\n box-shadow: 0 0 0 1px #005bd3;\n }\n\n .picker-content {\n flex: 1;\n overflow-y: auto;\n padding: 1rem 1.25rem;\n min-height: 200px;\n }\n\n .file-grid {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: 0.75rem;\n }\n\n .file-card {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 0.5rem;\n border: 2px solid #e0e0e0;\n border-radius: 8px;\n background: #fff;\n cursor: pointer;\n transition: all 0.15s;\n position: relative;\n text-align: center;\n }\n\n .file-card:hover {\n border-color: #005bd3;\n background: #f8fafe;\n }\n\n .file-card:focus-visible {\n outline: 2px solid #005bd3;\n outline-offset: 2px;\n }\n\n .file-card.selected {\n border-color: #005bd3;\n background: #f0f5ff;\n box-shadow: 0 0 0 1px #005bd3;\n }\n\n .file-card.current {\n border-color: #008060;\n }\n\n .file-thumbnail {\n width: 100%;\n aspect-ratio: 1;\n object-fit: cover;\n border-radius: 4px;\n background: #f0f2f5;\n }\n\n .video-thumbnail {\n width: 100%;\n aspect-ratio: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n background: #1a1a1a;\n border-radius: 4px;\n color: #fff;\n }\n\n .video-icon {\n opacity: 0.8;\n }\n\n .file-name {\n display: block;\n margin-top: 0.375rem;\n font-size: 0.6875rem;\n color: #616161;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n }\n\n .current-badge {\n position: absolute;\n top: 0.25rem;\n right: 0.25rem;\n padding: 0.125rem 0.375rem;\n background: #008060;\n color: #fff;\n font-size: 0.625rem;\n font-weight: 600;\n border-radius: 4px;\n }\n\n .picker-loading {\n padding: 2rem;\n text-align: center;\n color: #616161;\n font-size: 0.875rem;\n }\n\n .picker-error {\n padding: 2rem;\n text-align: center;\n color: #d72c0d;\n }\n\n .picker-error p {\n margin: 0 0 0.75rem;\n font-size: 0.875rem;\n }\n\n .retry-btn {\n padding: 0.375rem 0.75rem;\n border: 1px solid #d72c0d;\n border-radius: 6px;\n background: #fff;\n color: #d72c0d;\n cursor: pointer;\n font-size: 0.8125rem;\n }\n\n .retry-btn:hover {\n background: #fef2f0;\n }\n\n .picker-empty {\n padding: 2rem;\n text-align: center;\n color: #616161;\n font-size: 0.875rem;\n }\n\n .picker-footer {\n display: flex;\n justify-content: flex-end;\n gap: 0.5rem;\n padding: 0.75rem 1.25rem;\n border-top: 1px solid #e0e0e0;\n }\n\n .cancel-btn {\n padding: 0.5rem 1rem;\n border: 1px solid #c9cccf;\n border-radius: 8px;\n background: #fff;\n cursor: pointer;\n font-size: 0.8125rem;\n color: #303030;\n }\n\n .cancel-btn:hover {\n background: #f0f2f5;\n }\n\n .select-btn {\n padding: 0.5rem 1rem;\n border: none;\n border-radius: 8px;\n background: #005bd3;\n color: #fff;\n cursor: pointer;\n font-size: 0.8125rem;\n font-weight: 500;\n }\n\n .select-btn:hover:not(:disabled) {\n background: #004299;\n }\n\n .select-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ShopifyFilePickerComponent implements OnInit, OnDestroy {\n readonly mediaType = input.required<'IMAGE' | 'VIDEO'>();\n readonly currentValue = input<string>('');\n readonly fileSelected = output<string>();\n readonly closed = output<void>();\n\n private readonly filesService = inject(ShopifyFilesService);\n private readonly destroy$ = new Subject<void>();\n private readonly searchSubject = new Subject<string>();\n private readonly searchInput = viewChild<ElementRef<HTMLInputElement>>('searchInput');\n private readonly scrollContainer = viewChild<ElementRef<HTMLElement>>('scrollContainer');\n\n readonly files = signal<ShopifyFile[]>([]);\n readonly selectedFile = signal<ShopifyFile | null>(null);\n readonly isLoading = signal(false);\n readonly error = signal<string | null>(null);\n readonly searchTerm = signal('');\n\n private endCursor: string | null = null;\n private hasNextPage = false;\n\n ngOnInit(): void {\n this.searchSubject.pipe(\n debounceTime(300),\n tap(() => {\n this.files.set([]);\n this.endCursor = null;\n this.hasNextPage = false;\n this.selectedFile.set(null);\n }),\n switchMap(term => {\n this.searchTerm.set(term);\n this.isLoading.set(true);\n this.error.set(null);\n return this.filesService.getFiles(this.mediaType(), term || undefined);\n }),\n takeUntil(this.destroy$)\n ).subscribe({\n next: page => {\n this.files.set(page.files);\n this.endCursor = page.pageInfo.endCursor;\n this.hasNextPage = page.pageInfo.hasNextPage;\n this.isLoading.set(false);\n },\n error: () => {\n this.error.set('Failed to load files');\n this.isLoading.set(false);\n },\n });\n\n this.loadFiles();\n\n // Focus search input on open\n requestAnimationFrame(() => {\n this.searchInput()?.nativeElement.focus();\n });\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n loadFiles(): void {\n this.isLoading.set(true);\n this.error.set(null);\n\n this.filesService\n .getFiles(this.mediaType(), this.searchTerm() || undefined)\n .pipe(takeUntil(this.destroy$))\n .subscribe({\n next: page => {\n this.files.set(page.files);\n this.endCursor = page.pageInfo.endCursor;\n this.hasNextPage = page.pageInfo.hasNextPage;\n this.isLoading.set(false);\n },\n error: () => {\n this.error.set('Failed to load files');\n this.isLoading.set(false);\n },\n });\n }\n\n onSearchInput(event: Event): void {\n const value = (event.target as HTMLInputElement).value;\n this.searchSubject.next(value);\n }\n\n onScroll(): void {\n if (!this.hasNextPage || this.isLoading()) return;\n\n const el = this.scrollContainer()?.nativeElement;\n if (!el) return;\n\n const nearBottom = el.scrollHeight - el.scrollTop - el.clientHeight < 100;\n if (nearBottom) {\n this.loadMore();\n }\n }\n\n selectFile(file: ShopifyFile): void {\n this.selectedFile.set(file);\n }\n\n selectAndConfirm(file: ShopifyFile): void {\n this.selectedFile.set(file);\n this.confirmSelection();\n }\n\n confirmSelection(): void {\n const file = this.selectedFile();\n if (file) {\n this.fileSelected.emit(file.url);\n }\n }\n\n close(): void {\n this.closed.emit();\n }\n\n onBackdropClick(event: Event): void {\n if (event.target === event.currentTarget) {\n this.close();\n }\n }\n\n getThumbnailUrl(url: string): string {\n // Shopify CDN supports image transforms via URL params\n if (url.includes('cdn.shopify.com')) {\n return url + (url.includes('?') ? '&' : '?') + 'width=300';\n }\n return url;\n }\n\n private loadMore(): void {\n if (!this.endCursor || this.isLoading()) return;\n\n this.isLoading.set(true);\n\n this.filesService\n .getFiles(this.mediaType(), this.searchTerm() || undefined, 24, this.endCursor)\n .pipe(takeUntil(this.destroy$))\n .subscribe({\n next: page => {\n this.files.update(current => [...current, ...page.files]);\n this.endCursor = page.pageInfo.endCursor;\n this.hasNextPage = page.pageInfo.hasNextPage;\n this.isLoading.set(false);\n },\n error: () => {\n this.isLoading.set(false);\n },\n });\n }\n}\n","import { Component, ChangeDetectionStrategy, inject, signal, computed, OnInit, OnDestroy, ElementRef, viewChild, effect } from '@angular/core';\nimport { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';\nimport { Subject, takeUntil, switchMap, filter } from 'rxjs';\nimport { VisualEditorFacade } from '../../services/visual-editor-facade.service';\nimport { IframeBridgeService } from '../../services/iframe-bridge.service';\nimport { ComponentRegistryService } from '../../registry/component-registry.service';\nimport { ComponentDefinition } from '../../registry/component-definition.types';\nimport { ResolvedPreset } from '../../registry/component-registry.service';\nimport { SlotDefinition } from '../../registry/slot.types';\nimport { EditorSection, EditorElement } from '../../store/visual-editor.state';\nimport { DynamicRendererComponent } from '../dynamic-renderer.component';\nimport { VisualEditorNavigation } from '../../navigation/visual-editor-navigation.types';\nimport { PageLoadingStrategy } from '../../page-loading/page-loading-strategy.types';\nimport { VISUAL_EDITOR_CONFIG, VisualEditorConfig } from '../../config/visual-editor-config.types';\nimport { STOREFRONT_URL } from '../../models/page.model';\nimport { BlockTreeItemComponent, BlockTreeContext, BlockPickerTarget } from './block-tree-item.component';\nimport { ShopifyFilePickerComponent } from './shopify-file-picker.component';\nimport { DragDropService } from '../../dnd/drag-drop.service';\nimport type { DragItem, DropZone } from '../../dnd/drag-drop.types';\n\n/**\n * Main Visual Editor component\n * Provides a complete editing interface with:\n * - Sidebar with hierarchical tree view\n * - Canvas with live preview\n * - Properties panel for editing section/block properties\n */\n@Component({\n selector: 'lib-visual-editor',\n imports: [DynamicRendererComponent, BlockTreeItemComponent, ShopifyFilePickerComponent],\n providers: [IframeBridgeService],\n template: `\n <div class=\"editor-layout\">\n <!-- Sidebar: Hierarchical Tree -->\n <aside class=\"sidebar\">\n <div class=\"sidebar-header\">\n <h2>Page Structure</h2>\n <div class=\"search-box\">\n <span class=\"search-icon\">🔍</span>\n <input\n type=\"text\"\n class=\"search-input\"\n placeholder=\"Search sections & blocks...\"\n [value]=\"searchQuery()\"\n (input)=\"onSearchInput($event)\"\n aria-label=\"Search sections and blocks\"\n />\n @if (searchQuery()) {\n <button class=\"search-clear\" (click)=\"clearSearch()\" aria-label=\"Clear search\">×</button>\n }\n </div>\n </div>\n <div class=\"section-tree\">\n @if (searchQuery() && filteredSections().length === 0) {\n <div class=\"search-no-results\">\n <p>No results for \"{{ searchQuery() }}\"</p>\n </div>\n }\n @for (section of filteredSections(); track section.id; let idx = $index) {\n <div\n class=\"tree-section\"\n [class.selected]=\"facade.selectedSection()?.id === section.id && !facade.selectedBlock()\"\n [class.drag-over-before]=\"sectionDropZone() === section.id + ':before'\"\n [class.drag-over-after]=\"sectionDropZone() === section.id + ':after'\"\n [class.is-section-dragging]=\"isSectionDragSource(section.id)\"\n >\n <div\n class=\"tree-section-header\"\n draggable=\"true\"\n (click)=\"selectSection(section, $event)\"\n (dragstart)=\"onSectionDragStart(section, idx, $event)\"\n (dragend)=\"onSectionDragEnd($event)\"\n (dragover)=\"onSectionDragOver(section, idx, $event)\"\n (dragleave)=\"onSectionDragLeave($event)\"\n (drop)=\"onSectionDrop($event)\"\n >\n <button\n class=\"expand-btn\"\n [class.expanded]=\"isSectionExpanded(section.id)\"\n (click)=\"toggleSectionExpand(section.id, $event)\"\n [attr.aria-expanded]=\"isSectionExpanded(section.id)\"\n [attr.aria-label]=\"isSectionExpanded(section.id) ? 'Collapse' : 'Expand'\"\n >\n <span class=\"expand-icon\">&#9654;</span>\n </button>\n <span class=\"icon-drag-wrapper\">\n <span class=\"section-icon\">{{ getSectionIcon(section.type) }}</span>\n <span\n class=\"drag-handle section-drag-handle\"\n role=\"button\"\n [attr.aria-label]=\"'Drag ' + getSectionName(section) + ' to reorder'\"\n [attr.aria-roledescription]=\"'draggable'\"\n tabindex=\"0\"\n (keydown)=\"onSectionDragHandleKeydown(section.id, idx, $event)\"\n >\n <svg width=\"10\" height=\"16\" viewBox=\"0 0 10 16\" fill=\"currentColor\" aria-hidden=\"true\">\n <circle cx=\"3\" cy=\"2\" r=\"1.5\"/>\n <circle cx=\"7\" cy=\"2\" r=\"1.5\"/>\n <circle cx=\"3\" cy=\"8\" r=\"1.5\"/>\n <circle cx=\"7\" cy=\"8\" r=\"1.5\"/>\n <circle cx=\"3\" cy=\"14\" r=\"1.5\"/>\n <circle cx=\"7\" cy=\"14\" r=\"1.5\"/>\n </svg>\n </span>\n </span>\n <span class=\"section-name\">{{ getSectionName(section) }}</span>\n <div class=\"tree-actions\">\n @if (idx > 0) {\n<!-- <button class=\"tree-btn\" (click)=\"moveUp(section.id, idx, $event)\" title=\"Move up\">&#8593;</button>-->\n }\n @if (idx < facade.sections().length - 1) {\n<!-- <button class=\"tree-btn\" (click)=\"moveDown(section.id, idx, $event)\" title=\"Move down\">&#8595;</button>-->\n }\n @if (facade.isSectionDuplicable(section.type)) {\n <button class=\"tree-btn\" (click)=\"duplicateSection(section.id, $event)\" title=\"Duplicate\">\n <span class=\"material-icon\">content_copy</span>\n </button>\n }\n <button class=\"tree-btn delete\" (click)=\"deleteSection(section.id, $event)\" title=\"Delete\">&times;</button>\n </div>\n </div>\n @if (isSectionExpanded(section.id)) {\n <div\n class=\"tree-section-content\"\n (dragover)=\"onSectionContentDragOver(section, $event)\"\n (dragleave)=\"onSectionContentDragLeave($event)\"\n (drop)=\"onSectionContentDrop($event)\"\n >\n @let sectionBlocks = getSectionBlocks(section);\n @for (block of sectionBlocks; track block.id; let blockIdx = $index) {\n <lib-block-tree-item\n [block]=\"block\"\n [context]=\"getRootBlockContext(section.id)\"\n [index]=\"blockIdx\"\n [totalSiblings]=\"sectionBlocks.length\"\n [expandAll]=\"isAllBlocksExpanded(section.id)\"\n (selectBlock)=\"onBlockSelect($event)\"\n (deleteBlock)=\"onBlockDelete($event)\"\n (duplicateBlock)=\"onBlockDuplicate($event)\"\n (moveBlock)=\"onBlockMove($event)\"\n (openBlockPicker)=\"onOpenNestedBlockPicker($event)\"\n />\n }\n <button class=\"add-block-btn\" (click)=\"openBlockPicker(section, $event)\">\n <span class=\"add-icon-circle\">\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" aria-hidden=\"true\">\n <circle cx=\"10\" cy=\"10\" r=\"9\"/>\n <line x1=\"10\" y1=\"6\" x2=\"10\" y2=\"14\"/>\n <line x1=\"6\" y1=\"10\" x2=\"14\" y2=\"10\"/>\n </svg>\n </span> Add block\n </button>\n </div>\n }\n </div>\n }\n <div class=\"sr-only\" aria-live=\"polite\" role=\"status\">{{ dndAnnouncement() }}</div>\n </div>\n <!-- Add Section Button -->\n <div class=\"add-section-area\">\n <button class=\"add-section-btn\" (click)=\"toggleSectionPicker()\">\n <span class=\"add-icon-circle\">\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" aria-hidden=\"true\">\n <circle cx=\"10\" cy=\"10\" r=\"9\"/>\n <line x1=\"10\" y1=\"6\" x2=\"10\" y2=\"14\"/>\n <line x1=\"6\" y1=\"10\" x2=\"14\" y2=\"10\"/>\n </svg>\n </span> Add section\n </button>\n @if (showSectionPicker()) {\n <div class=\"section-picker\">\n <div class=\"picker-search\">\n <input\n type=\"text\"\n class=\"picker-search-input\"\n placeholder=\"Search sections...\"\n [value]=\"sectionPickerSearch()\"\n (input)=\"onSectionPickerSearch($event)\"\n aria-label=\"Search available sections\"\n />\n </div>\n @for (group of groupedSectionPresets(); track group.category) {\n <div class=\"picker-category\">\n @if (groupedSectionPresets().length > 1) {\n <div class=\"picker-category-label\">{{ group.category }}</div>\n }\n @for (rp of group.presets; track rp.displayName + '-' + rp.definition.type) {\n <button class=\"picker-item\" (click)=\"addSectionFromPreset(rp)\">\n <span class=\"picker-icon\">{{ getSectionPresetIcon(rp) }}</span>\n <div class=\"picker-info\">\n <span class=\"picker-name\">{{ rp.displayName }}</span>\n @if (rp.displayDescription) {\n <span class=\"picker-desc\">{{ rp.displayDescription }}</span>\n }\n </div>\n </button>\n }\n </div>\n }\n @if (filteredAvailableSectionPresets().length === 0) {\n <div class=\"picker-empty\">No sections match your search</div>\n }\n </div>\n }\n </div>\n <!-- Block Picker Modal (for sections) -->\n @if (blockPickerSection()) {\n <div class=\"block-picker-overlay\" (click)=\"closeBlockPicker()\">\n <div class=\"block-picker\" (click)=\"$event.stopPropagation()\">\n <div class=\"picker-header\">\n <h3>Add block to {{ getSectionName(blockPickerSection()!) }}</h3>\n <button class=\"close-btn\" (click)=\"closeBlockPicker()\">×</button>\n </div>\n <div class=\"picker-search\">\n <input\n type=\"text\"\n class=\"picker-search-input\"\n placeholder=\"Search blocks...\"\n [value]=\"blockPickerSearch()\"\n (input)=\"onBlockPickerSearch($event)\"\n aria-label=\"Search available blocks\"\n />\n </div>\n <div class=\"picker-content\">\n @for (rp of filteredBlockPresetsForSection(); track rp.displayName + '-' + rp.definition.type) {\n <button class=\"picker-item\" (click)=\"addBlockToSectionFromPreset(blockPickerSection()!, rp)\">\n <span class=\"picker-icon\">{{ getBlockPresetIcon(rp) }}</span>\n <div class=\"picker-info\">\n <span class=\"picker-name\">{{ rp.displayName }}</span>\n @if (rp.displayDescription) {\n <span class=\"picker-desc\">{{ rp.displayDescription }}</span>\n }\n </div>\n </button>\n }\n @if (filteredBlockPresetsForSection().length === 0) {\n <div class=\"picker-empty\">\n @if (blockPickerSearch()) {\n No blocks match \"{{ blockPickerSearch() }}\"\n } @else {\n No blocks available for this section\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n <!-- Nested Block Picker Modal (for blocks with slots) -->\n @if (nestedBlockPickerTarget()) {\n <div class=\"block-picker-overlay\" (click)=\"closeNestedBlockPicker()\">\n <div class=\"block-picker\" (click)=\"$event.stopPropagation()\">\n <div class=\"picker-header\">\n <h3>Add nested block</h3>\n <button class=\"close-btn\" (click)=\"closeNestedBlockPicker()\">×</button>\n </div>\n <div class=\"picker-search\">\n <input\n type=\"text\"\n class=\"picker-search-input\"\n placeholder=\"Search blocks...\"\n [value]=\"nestedBlockPickerSearch()\"\n (input)=\"onNestedBlockPickerSearch($event)\"\n aria-label=\"Search available blocks\"\n />\n </div>\n <div class=\"picker-content\">\n @for (rp of filteredBlockPresetsForNestedSlot(); track rp.displayName + '-' + rp.definition.type) {\n <button class=\"picker-item\" (click)=\"addNestedBlockFromPreset(rp)\">\n <span class=\"picker-icon\">{{ getBlockPresetIcon(rp) }}</span>\n <div class=\"picker-info\">\n <span class=\"picker-name\">{{ rp.displayName }}</span>\n @if (rp.displayDescription) {\n <span class=\"picker-desc\">{{ rp.displayDescription }}</span>\n }\n </div>\n </button>\n }\n @if (filteredBlockPresetsForNestedSlot().length === 0) {\n <div class=\"picker-empty\">\n @if (nestedBlockPickerSearch()) {\n No blocks match \"{{ nestedBlockPickerSearch() }}\"\n } @else {\n No blocks available\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n </aside>\n\n <!-- Main: Canvas -->\n <main class=\"canvas-area\">\n <!-- Toolbar -->\n <div class=\"toolbar\">\n <div class=\"toolbar-left\">\n <button class=\"toolbar-btn back-btn\" (click)=\"goBack()\" title=\"Back to pages\">\n ← Back\n </button>\n <button\n class=\"toolbar-btn\"\n [disabled]=\"!facade.canUndo()\"\n (click)=\"facade.undo()\"\n title=\"Undo\"\n >\n ↩ Undo\n </button>\n <button\n class=\"toolbar-btn\"\n [disabled]=\"!facade.canRedo()\"\n (click)=\"facade.redo()\"\n title=\"Redo\"\n >\n ↪ Redo\n </button>\n </div>\n <div class=\"toolbar-center\">\n @if (facade.currentPage(); as page) {\n @if (page.status === 'published') {\n <a\n class=\"page-title page-title-link\"\n [href]=\"'/pages/' + page.slug\"\n target=\"_blank\"\n rel=\"noopener\"\n >{{ page.title }}</a>\n } @else {\n <span class=\"page-title\">{{ page.title }}</span>\n }\n <span class=\"status-badge\" [class.published]=\"page.status === 'published'\">\n {{ page.status }}\n </span>\n @if (facade.isDirty()) {\n <span class=\"dirty-indicator\">• Unsaved changes</span>\n }\n } @else {\n <span class=\"section-count\">{{ facade.sections().length }} sections</span>\n }\n </div>\n <div class=\"toolbar-right\">\n @if (facade.currentPage() && showSaveButton()) {\n <button\n class=\"toolbar-btn\"\n [disabled]=\"!facade.isDirty() || isSaving()\"\n (click)=\"savePage()\"\n title=\"Save changes\"\n >\n {{ isSaving() ? 'Saving...' : '💾 Save' }}\n </button>\n }\n @if (facade.currentPage() && showPublishButtons()) {\n @if (facade.currentPage()?.status === 'draft') {\n <button\n class=\"toolbar-btn publish-btn\"\n [disabled]=\"facade.isDirty() || isPublishing()\"\n (click)=\"publishPage()\"\n title=\"Publish page\"\n >\n {{ isPublishing() ? 'Publishing...' : '🚀 Publish' }}\n </button>\n } @else {\n <button\n class=\"toolbar-btn\"\n [disabled]=\"isPublishing()\"\n (click)=\"unpublishPage()\"\n title=\"Unpublish page\"\n >\n {{ isPublishing() ? 'Unpublishing...' : '📥 Unpublish' }}\n </button>\n }\n }\n <button class=\"toolbar-btn preview-btn\" (click)=\"togglePreview()\">\n {{ isPreviewMode() ? '✏️ Edit' : '👁 Preview' }}\n </button>\n </div>\n </div>\n\n <!-- Canvas Content -->\n <div class=\"canvas\" #canvasEl [class.preview-mode]=\"isPreviewMode()\">\n @if (previewUrl()) {\n <iframe\n #previewFrame\n class=\"preview-iframe\"\n [src]=\"previewUrl()!\"\n (load)=\"onIframeLoad()\"\n allow=\"clipboard-read; clipboard-write\"\n ></iframe>\n } @else {\n <!-- Fallback: direct rendering when no storefront URL configured -->\n @if (facade.sections().length === 0) {\n <div class=\"empty-state\">\n <div class=\"empty-icon\">📄</div>\n <h3>Start Building</h3>\n <p>Click on a component from the sidebar to add it to your page</p>\n </div>\n } @else {\n @for (section of facade.sections(); track section.id; let idx = $index) {\n <div\n class=\"section-outer\"\n [class.selected]=\"facade.selectedSection()?.id === section.id\"\n >\n @if (!isPreviewMode()) {\n <div class=\"section-controls\">\n <span class=\"section-label\">{{ getSectionName(section) }}</span>\n <div class=\"section-actions\">\n @if (idx > 0) {\n <button class=\"action-btn\" (click)=\"moveUp(section.id, idx, $event)\" title=\"Move up\">↑</button>\n }\n @if (idx < facade.sections().length - 1) {\n <button class=\"action-btn\" (click)=\"moveDown(section.id, idx, $event)\" title=\"Move down\">↓</button>\n }\n @if (facade.isSectionDuplicable(section.type)) {\n <button class=\"action-btn\" (click)=\"duplicateSection(section.id, $event)\" title=\"Duplicate\">\n <span class=\"material-icon\">content_copy</span>\n </button>\n }\n <button class=\"action-btn delete\" (click)=\"deleteSection(section.id, $event)\" title=\"Delete\">×</button>\n </div>\n </div>\n }\n <div\n class=\"section-wrapper\"\n [attr.data-section-id]=\"section.id\"\n (click)=\"selectSection(section, $event)\"\n >\n <lib-dynamic-renderer [element]=\"section\" [context]=\"editorContext()\" />\n </div>\n </div>\n }\n }\n }\n </div>\n </main>\n\n <!-- Right Panel: Properties -->\n @if (!isPreviewMode()) {\n <aside class=\"properties-panel\" [class.has-selection]=\"facade.selectedSection()\">\n @if (facade.selectedSectionDefinition(); as def) {\n <!-- Tabs for Section Props / Blocks -->\n <div class=\"panel-tabs\">\n <button\n class=\"panel-tab\"\n [class.active]=\"propertiesTab() === 'props'\"\n (click)=\"propertiesTab.set('props')\"\n >\n Properties\n </button>\n <button\n class=\"panel-tab\"\n [class.active]=\"propertiesTab() === 'blocks'\"\n (click)=\"propertiesTab.set('blocks')\"\n >\n Blocks ({{ getBlockCount() }})\n </button>\n </div>\n\n @if (propertiesTab() === 'props') {\n <!-- Section Properties -->\n <div class=\"properties-header\">\n @if (isEditingName()) {\n <input\n #nameInput\n type=\"text\"\n class=\"name-edit-input\"\n [value]=\"editingNameValue()\"\n [placeholder]=\"getSelectedDefaultName(def)\"\n (keydown.enter)=\"saveEditingName($event)\"\n (keydown.escape)=\"cancelEditingName()\"\n (blur)=\"saveEditingName($event)\"\n aria-label=\"Rename\"\n />\n } @else {\n <h3\n class=\"editable-name\"\n (click)=\"startEditingName()\"\n title=\"Click to rename\"\n >\n {{ getSelectedDisplayName(def) }}\n <span class=\"edit-icon\" aria-hidden=\"true\">\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"currentColor\">\n <path d=\"M9.1 1.2L10.8 2.9 3.6 10.1 1.2 10.8 1.9 8.4z\"/>\n </svg>\n </span>\n </h3>\n }\n <button class=\"more-menu-btn\" (click)=\"facade.clearSelection()\" aria-label=\"Close\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\">\n <circle cx=\"4\" cy=\"8\" r=\"1.5\"/>\n <circle cx=\"8\" cy=\"8\" r=\"1.5\"/>\n <circle cx=\"12\" cy=\"8\" r=\"1.5\"/>\n </svg>\n </button>\n </div>\n <div class=\"properties-content\">\n @if (facade.selectedBlock(); as block) {\n <!-- Block Properties -->\n @for (group of getBlockPropertyGroups(); track group) {\n <div class=\"property-group\">\n <button\n class=\"group-title\"\n type=\"button\"\n [attr.aria-expanded]=\"!isGroupCollapsed(block.id, group)\"\n (click)=\"toggleGroup(block.id, group)\"\n >\n <span class=\"group-title-text\">{{ group }}</span>\n <span class=\"group-toggle-icon\" [class.collapsed]=\"isGroupCollapsed(block.id, group)\">&#9660;</span>\n </button>\n @if (!isGroupCollapsed(block.id, group)) {\n @for (prop of getBlockPropsForGroup(group); track prop.key) {\n <div class=\"property-field\">\n <label class=\"property-label\">{{ prop.schema.label }}</label>\n @switch (prop.schema.type) {\n @case ('string') {\n <input\n type=\"text\"\n class=\"property-input\"\n [value]=\"getBlockPropertyValue(prop.key)\"\n [placeholder]=\"prop.schema.placeholder ?? ''\"\n (input)=\"updateBlockProperty(prop.key, $event)\"\n />\n }\n @case ('textarea') {\n <textarea\n class=\"property-textarea\"\n [value]=\"getBlockPropertyValue(prop.key)\"\n [placeholder]=\"prop.schema.placeholder ?? ''\"\n (input)=\"updateBlockProperty(prop.key, $event)\"\n rows=\"3\"\n ></textarea>\n }\n @case ('number') {\n <input\n type=\"number\"\n class=\"property-input\"\n [value]=\"getBlockPropertyValue(prop.key)\"\n (input)=\"updateBlockProperty(prop.key, $event)\"\n />\n }\n @case ('boolean') {\n <div class=\"toggle-field\">\n <span class=\"toggle-label\">{{ prop.schema.label }}</span>\n <label class=\"toggle-switch\">\n <input\n type=\"checkbox\"\n class=\"toggle-input\"\n [checked]=\"getBlockPropertyValue(prop.key) === 'true'\"\n (change)=\"updateBlockBooleanProperty(prop.key, $event)\"\n />\n <span class=\"toggle-track\">\n <span class=\"toggle-thumb\"></span>\n </span>\n </label>\n </div>\n @if (prop.schema.description) {\n <span class=\"toggle-description\">{{ prop.schema.description }}</span>\n }\n }\n @case ('color') {\n <div class=\"color-field\">\n <input\n type=\"color\"\n class=\"color-picker\"\n [value]=\"getBlockPropertyValue(prop.key)\"\n (input)=\"updateBlockProperty(prop.key, $event)\"\n />\n <input\n type=\"text\"\n class=\"property-input color-text\"\n [value]=\"getBlockPropertyValue(prop.key)\"\n (input)=\"updateBlockProperty(prop.key, $event)\"\n />\n </div>\n }\n @case ('image') {\n <div class=\"media-field\">\n @if (getBlockPropertyValue(prop.key)) {\n <div class=\"media-preview\">\n <img\n class=\"media-thumbnail\"\n [src]=\"getBlockPropertyValue(prop.key)\"\n [alt]=\"prop.schema.label\"\n />\n <button\n class=\"media-remove-btn\"\n (click)=\"clearBlockProperty(prop.key)\"\n aria-label=\"Remove image\"\n >×</button>\n </div>\n }\n <button class=\"media-browse-btn\" (click)=\"openFilePicker('IMAGE', prop.key, 'block')\">\n Browse images\n </button>\n <input\n type=\"text\"\n class=\"property-input media-url-input\"\n [value]=\"getBlockPropertyValue(prop.key)\"\n [placeholder]=\"prop.schema.placeholder ?? 'Paste image URL...'\"\n (input)=\"updateBlockProperty(prop.key, $event)\"\n />\n </div>\n }\n @case ('video') {\n <div class=\"media-field\">\n @if (getBlockPropertyValue(prop.key)) {\n <div class=\"media-preview video-preview\">\n <div class=\"video-indicator\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M8 5v14l11-7z\"/>\n </svg>\n </div>\n <span class=\"video-url-text\">{{ getBlockPropertyValue(prop.key) }}</span>\n <button\n class=\"media-remove-btn\"\n (click)=\"clearBlockProperty(prop.key)\"\n aria-label=\"Remove video\"\n >×</button>\n </div>\n }\n <button class=\"media-browse-btn\" (click)=\"openFilePicker('VIDEO', prop.key, 'block')\">\n Browse videos\n </button>\n <input\n type=\"text\"\n class=\"property-input media-url-input\"\n [value]=\"getBlockPropertyValue(prop.key)\"\n [placeholder]=\"prop.schema.placeholder ?? 'Paste video URL...'\"\n (input)=\"updateBlockProperty(prop.key, $event)\"\n />\n </div>\n }\n @case ('select') {\n <select\n class=\"property-select\"\n [value]=\"getBlockPropertyValue(prop.key)\"\n (change)=\"updateBlockProperty(prop.key, $event)\"\n >\n @for (option of prop.schema.options ?? []; track option.value) {\n <option [value]=\"option.value\">{{ option.label }}</option>\n }\n </select>\n }\n @default {\n <input\n type=\"text\"\n class=\"property-input\"\n [value]=\"getBlockPropertyValue(prop.key)\"\n (input)=\"updateBlockProperty(prop.key, $event)\"\n />\n }\n }\n </div>\n }\n }\n </div>\n }\n <button class=\"delete-block-btn\" (click)=\"deleteSelectedBlock()\">\n Remove block\n </button>\n } @else {\n <!-- Section Properties -->\n @let sectionId = facade.selectedSection()?.id ?? '';\n @for (group of getPropertyGroups(def); track group) {\n <div class=\"property-group\">\n <button\n class=\"group-title\"\n type=\"button\"\n [attr.aria-expanded]=\"!isGroupCollapsed(sectionId, group)\"\n (click)=\"toggleGroup(sectionId, group)\"\n >\n <span class=\"group-title-text\">{{ group }}</span>\n <span class=\"group-toggle-icon\" [class.collapsed]=\"isGroupCollapsed(sectionId, group)\">&#9660;</span>\n </button>\n @if (!isGroupCollapsed(sectionId, group)) {\n @for (prop of getPropsForGroup(def, group); track prop.key) {\n <div class=\"property-field\">\n <label class=\"property-label\">{{ prop.schema.label }}</label>\n @switch (prop.schema.type) {\n @case ('string') {\n <input\n type=\"text\"\n class=\"property-input\"\n [value]=\"getPropertyValue(prop.key)\"\n [placeholder]=\"prop.schema.placeholder ?? ''\"\n (input)=\"updateProperty(prop.key, $event)\"\n />\n }\n @case ('url') {\n <input\n type=\"url\"\n class=\"property-input\"\n [value]=\"getPropertyValue(prop.key)\"\n [placeholder]=\"prop.schema.placeholder ?? ''\"\n (input)=\"updateProperty(prop.key, $event)\"\n />\n }\n @case ('image') {\n <div class=\"media-field\">\n @if (getPropertyValue(prop.key)) {\n <div class=\"media-preview\">\n <img\n class=\"media-thumbnail\"\n [src]=\"getPropertyValue(prop.key)\"\n [alt]=\"prop.schema.label\"\n />\n <button\n class=\"media-remove-btn\"\n (click)=\"clearSectionProperty(prop.key)\"\n aria-label=\"Remove image\"\n >×</button>\n </div>\n }\n <button class=\"media-browse-btn\" (click)=\"openFilePicker('IMAGE', prop.key, 'section')\">\n Browse images\n </button>\n <input\n type=\"text\"\n class=\"property-input media-url-input\"\n [value]=\"getPropertyValue(prop.key)\"\n [placeholder]=\"prop.schema.placeholder ?? 'Paste image URL...'\"\n (input)=\"updateProperty(prop.key, $event)\"\n />\n </div>\n }\n @case ('video') {\n <div class=\"media-field\">\n @if (getPropertyValue(prop.key)) {\n <div class=\"media-preview video-preview\">\n <div class=\"video-indicator\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M8 5v14l11-7z\"/>\n </svg>\n </div>\n <span class=\"video-url-text\">{{ getPropertyValue(prop.key) }}</span>\n <button\n class=\"media-remove-btn\"\n (click)=\"clearSectionProperty(prop.key)\"\n aria-label=\"Remove video\"\n >×</button>\n </div>\n }\n <button class=\"media-browse-btn\" (click)=\"openFilePicker('VIDEO', prop.key, 'section')\">\n Browse videos\n </button>\n <input\n type=\"text\"\n class=\"property-input media-url-input\"\n [value]=\"getPropertyValue(prop.key)\"\n [placeholder]=\"prop.schema.placeholder ?? 'Paste video URL...'\"\n (input)=\"updateProperty(prop.key, $event)\"\n />\n </div>\n }\n @case ('color') {\n <div class=\"color-field\">\n <input\n type=\"color\"\n class=\"color-picker\"\n [value]=\"getPropertyValue(prop.key)\"\n (input)=\"updateProperty(prop.key, $event)\"\n />\n <input\n type=\"text\"\n class=\"property-input color-text\"\n [value]=\"getPropertyValue(prop.key)\"\n (input)=\"updateProperty(prop.key, $event)\"\n />\n </div>\n }\n @case ('select') {\n <select\n class=\"property-select\"\n [value]=\"getPropertyValue(prop.key)\"\n (change)=\"updateProperty(prop.key, $event)\"\n >\n @for (option of prop.schema.options ?? []; track option.value) {\n <option [value]=\"option.value\">{{ option.label }}</option>\n }\n </select>\n }\n @case ('json') {\n <textarea\n class=\"property-textarea\"\n [value]=\"getPropertyValue(prop.key)\"\n (input)=\"updateProperty(prop.key, $event)\"\n rows=\"4\"\n ></textarea>\n }\n @default {\n <input\n type=\"text\"\n class=\"property-input\"\n [value]=\"getPropertyValue(prop.key)\"\n (input)=\"updateProperty(prop.key, $event)\"\n />\n }\n }\n </div>\n }\n }\n </div>\n }\n }\n </div>\n } @else {\n <!-- Blocks List -->\n <div class=\"properties-header\">\n <h3>Blocks in Section</h3>\n </div>\n <div class=\"blocks-list\">\n @for (slot of getSectionSlots(); track slot.name) {\n <div class=\"slot-group\">\n <h4 class=\"slot-title\">{{ slot.label }}</h4>\n @for (block of getBlocksForSlot(slot.name); track block.id; let idx = $index) {\n <div\n class=\"block-item\"\n [class.selected]=\"facade.selectedBlock()?.id === block.id\"\n (click)=\"selectBlock(block)\"\n >\n <span class=\"block-icon\">{{ getBlockIconByType(block.type) }}</span>\n <span class=\"block-name\">{{ getBlockName(block) }}</span>\n <div class=\"block-actions\">\n @if (idx > 0) {\n<!-- <button class=\"mini-btn\" (click)=\"moveBlockUp(block, slot.name, idx, $event)\">↑</button>-->\n }\n @if (idx < getBlocksForSlot(slot.name).length - 1) {\n<!-- <button class=\"mini-btn\" (click)=\"moveBlockDown(block, slot.name, idx, $event)\">↓</button>-->\n }\n @if (facade.isBlockDuplicable(block.type)) {\n <button class=\"mini-btn\" (click)=\"duplicateBlock(block, $event)\" title=\"Duplicate\">\n <span class=\"material-icon\">content_copy</span>\n </button>\n }\n <button class=\"mini-btn delete\" (click)=\"deleteBlock(block, $event)\">×</button>\n </div>\n </div>\n }\n @if (getBlocksForSlot(slot.name).length === 0) {\n <div class=\"empty-slot\">{{ slot.emptyPlaceholder ?? 'No blocks' }}</div>\n }\n </div>\n }\n @if (getSectionSlots().length === 0) {\n <div class=\"no-slots\">\n <p>This section doesn't have any slots for blocks</p>\n </div>\n }\n </div>\n }\n } @else {\n <div class=\"no-selection\">\n <p>Select a section to edit its properties</p>\n </div>\n }\n </aside>\n }\n\n @if (filePickerOpen()) {\n <lib-shopify-file-picker\n [mediaType]=\"filePickerMediaType()\"\n [currentValue]=\"filePickerCurrentValue()\"\n (fileSelected)=\"onFileSelected($event)\"\n (closed)=\"closeFilePicker()\"\n />\n }\n </div>\n `,\n styles: `\n :host {\n display: block;\n height: 100vh;\n overflow: hidden;\n }\n\n .editor-layout {\n display: grid;\n grid-template-columns: 280px 1fr 300px;\n height: 100%;\n background: #f0f2f5;\n }\n\n /* Sidebar */\n .sidebar {\n background: #fff;\n border-right: 1px solid #e0e0e0;\n display: flex;\n flex-direction: column;\n }\n\n .sidebar-header {\n padding: 1rem;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .sidebar-header h2 {\n margin: 0;\n font-size: 0.875rem;\n font-weight: 600;\n color: #333;\n }\n\n /* Search Box */\n .search-box {\n display: none;\n }\n\n .search-box:focus-within {\n border-color: #005bd3;\n background: #fff;\n }\n\n .search-icon {\n font-size: 0.875rem;\n opacity: 0.6;\n }\n\n .search-input {\n flex: 1;\n border: none;\n background: transparent;\n font-size: 0.8125rem;\n color: #333;\n outline: none;\n }\n\n .search-input::placeholder {\n color: #999;\n }\n\n .search-clear {\n padding: 0.125rem 0.375rem;\n border: none;\n background: #ddd;\n border-radius: 3px;\n cursor: pointer;\n font-size: 0.75rem;\n color: #666;\n line-height: 1;\n }\n\n .search-clear:hover {\n background: #ccc;\n }\n\n .search-no-results {\n padding: 2rem 1rem;\n text-align: center;\n color: #888;\n }\n\n .search-no-results p {\n margin: 0;\n font-size: 0.875rem;\n }\n\n /* Picker Search */\n .picker-search {\n padding: 0.5rem;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .picker-search-input {\n width: 87%;\n padding: 0.5rem 0.75rem;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n font-size: 0.8125rem;\n outline: none;\n transition: border-color 0.2s;\n }\n\n .picker-search-input:focus {\n border-color: #005bd3;\n }\n\n .picker-search-input::placeholder {\n color: #999;\n }\n\n /* Section Tree */\n .section-tree {\n flex: 1;\n overflow-y: auto;\n padding: 0.25rem 0;\n }\n\n .tree-section {\n border-bottom: none;\n }\n\n .tree-section.selected > .tree-section-header {\n background: #005bd3;\n color: #fff;\n border-radius: 8px;\n margin: 0 0.375rem;\n }\n\n .tree-section.selected > .tree-section-header .section-name,\n .tree-section.selected > .tree-section-header .expand-btn,\n .tree-section.selected > .tree-section-header .section-icon,\n .tree-section.selected > .tree-section-header .drag-handle,\n .tree-section.selected > .tree-section-header .tree-btn {\n color: inherit;\n }\n\n .tree-section-header {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.5rem;\n cursor: pointer;\n transition: background 0.2s;\n }\n\n .tree-section-header:hover {\n background: #f5f5f5;\n border-radius: 8px;\n margin: 0 0.375rem;\n }\n\n .expand-btn {\n width: 16px;\n height: 16px;\n padding: 0;\n border: none;\n background: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #666;\n transition: transform 0.2s;\n flex-shrink: 0;\n }\n\n .expand-btn.expanded .expand-icon {\n transform: rotate(90deg);\n }\n\n .expand-icon {\n font-size: 0.625rem;\n transition: transform 0.2s;\n }\n\n .icon-drag-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .icon-drag-wrapper .drag-handle {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .tree-section-header:hover .icon-drag-wrapper .section-icon,\n .icon-drag-wrapper:has(.drag-handle:focus-visible) .section-icon {\n visibility: hidden;\n }\n\n .section-icon {\n font-size: 1rem;\n }\n\n .section-name {\n flex: 1;\n font-size: 0.8125rem;\n font-weight: 500;\n color: #333;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .tree-actions {\n display: flex;\n gap: 0.125rem;\n opacity: 0;\n transition: opacity 0.2s;\n }\n\n .tree-section-header:hover .tree-actions,\n .tree-block:hover .tree-actions {\n opacity: 1;\n }\n\n .tree-btn {\n padding: 0.125rem 0.375rem;\n border: none;\n border-radius: 3px;\n background: #e0e0e0;\n cursor: pointer;\n font-size: 0.6875rem;\n color: #666;\n }\n\n .tree-btn:hover {\n background: #d0d0d0;\n }\n\n .tree-btn.delete:hover {\n background: #e74c3c;\n color: #fff;\n }\n\n .tree-section.drag-over-before > .tree-section-header {\n box-shadow: inset 0 2px 0 0 #4a90d9;\n }\n\n .tree-section.drag-over-after > .tree-section-header {\n box-shadow: inset 0 -2px 0 0 #4a90d9;\n }\n\n .tree-section.is-section-dragging {\n opacity: 0.4;\n }\n\n .tree-section.is-section-dragging > .tree-section-header {\n cursor: grabbing;\n }\n\n .drag-handle {\n cursor: grab;\n color: #999;\n opacity: 0;\n transition: opacity 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n padding: 0.125rem;\n border: none;\n background: none;\n border-radius: 2px;\n }\n\n .drag-handle:hover {\n color: #666;\n background: #e0e0e0;\n }\n\n .drag-handle:focus-visible {\n opacity: 1;\n outline: 2px solid #4a90d9;\n outline-offset: 1px;\n }\n\n .tree-section-header:hover .drag-handle {\n opacity: 1;\n }\n\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .tree-section,\n .drag-handle,\n .tree-actions {\n transition: none;\n }\n }\n\n .tree-section-content {\n padding-left: 0.5rem;\n }\n\n .tree-block {\n display: flex;\n align-items: center;\n gap: 0.375rem;\n padding: 0.5rem 0.75rem;\n cursor: pointer;\n transition: background 0.2s;\n }\n\n .tree-block:hover {\n background: #f5f5f5;\n border-radius: 8px;\n margin: 0 0.375rem;\n }\n\n .tree-block.selected {\n background: #005bd3;\n color: #fff;\n border-radius: 8px;\n margin: 0 0.375rem;\n }\n\n .tree-block.selected .block-icon,\n .tree-block.selected .block-name {\n color: inherit;\n }\n\n .block-indent {\n width: 20px;\n height: 1px;\n background: #ddd;\n margin-left: 10px;\n }\n\n .block-icon {\n font-size: 0.875rem;\n }\n\n .block-name {\n flex: 1;\n font-size: 0.75rem;\n color: #555;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .add-block-btn {\n display: flex;\n align-items: center;\n gap: 0.375rem;\n width: calc(100% - 1.5rem);\n margin: 0.375rem 0.75rem 0.5rem 2rem;\n padding: 0.375rem 0.5rem;\n border: none;\n border-radius: 4px;\n background: transparent;\n cursor: pointer;\n font-size: 0.75rem;\n color: #005bd3;\n transition: all 0.2s;\n }\n\n .add-block-btn:hover {\n background: #f0f5ff;\n color: #004299;\n }\n\n .add-icon {\n font-size: 0.875rem;\n font-weight: 600;\n }\n\n .add-icon-circle {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n /* Add Section Area */\n .add-section-area {\n padding: 0.75rem;\n border-top: 1px solid #e0e0e0;\n position: relative;\n }\n\n .add-section-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.375rem;\n width: 100%;\n padding: 0.625rem;\n border: none;\n border-radius: 6px;\n background: transparent;\n cursor: pointer;\n font-size: 0.8125rem;\n font-weight: 500;\n color: #005bd3;\n transition: all 0.2s;\n }\n\n .add-section-btn:hover {\n background: #f0f5ff;\n }\n\n .section-picker {\n position: absolute;\n bottom: 100%;\n left: 0.75rem;\n right: 0.75rem;\n background: #fff;\n border: 1px solid #e0e0e0;\n border-radius: 6px;\n box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);\n max-height: 300px;\n overflow-y: auto;\n z-index: 100;\n }\n\n .picker-item {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n width: 100%;\n padding: 0.75rem;\n border: none;\n border-bottom: 1px solid #f0f0f0;\n background: #fff;\n cursor: pointer;\n text-align: left;\n transition: background 0.2s;\n }\n\n .picker-item:last-child {\n border-bottom: none;\n }\n\n .picker-item:hover {\n background: #f5f5f5;\n }\n\n .picker-icon {\n font-family: 'Material Icons', sans-serif;\n font-size: 1.5rem;\n font-weight: normal;\n font-style: normal;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n white-space: nowrap;\n word-wrap: normal;\n direction: ltr;\n -webkit-font-smoothing: antialiased;\n text-rendering: optimizeLegibility;\n }\n\n .picker-info {\n display: flex;\n flex-direction: column;\n gap: 0.125rem;\n }\n\n .picker-name {\n font-size: 0.8125rem;\n font-weight: 500;\n color: #333;\n }\n\n .picker-desc {\n font-size: 0.6875rem;\n color: #888;\n }\n\n /* Block Picker Modal */\n .block-picker-overlay {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.4);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n }\n\n .block-picker {\n background: #fff;\n border-radius: 8px;\n width: 320px;\n max-height: 400px;\n display: flex;\n flex-direction: column;\n box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);\n }\n\n .picker-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 1rem;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .picker-header h3 {\n margin: 0;\n font-size: 0.9375rem;\n font-weight: 600;\n }\n\n .picker-content {\n flex: 1;\n overflow-y: auto;\n padding: 0.5rem;\n }\n\n .picker-content .picker-item {\n border: 1px solid #e0e0e0;\n border-radius: 6px;\n margin-bottom: 0.5rem;\n }\n\n .picker-content .picker-item:hover {\n border-color: #005bd3;\n }\n\n .picker-category {\n border-bottom: 1px solid #f0f0f0;\n }\n\n .picker-category:last-child {\n border-bottom: none;\n }\n\n .picker-category-label {\n padding: 0.5rem 0.75rem 0.25rem;\n font-size: 0.6875rem;\n font-weight: 600;\n color: #888;\n }\n\n .picker-empty {\n padding: 2rem;\n text-align: center;\n color: #888;\n font-size: 0.875rem;\n }\n\n /* Canvas Area */\n .canvas-area {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .toolbar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.5rem 1rem;\n background: #fff;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .toolbar-left, .toolbar-right {\n display: flex;\n gap: 0.5rem;\n }\n\n .toolbar-btn {\n padding: 0.375rem 0.75rem;\n border: 1px solid #e0e0e0;\n border-radius: 8px;\n background: #fff;\n cursor: pointer;\n font-size: 0.8125rem;\n transition: all 0.2s;\n }\n\n .toolbar-btn:hover:not(:disabled) {\n background: #f0f2f5;\n }\n\n .toolbar-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .preview-btn,\n .publish-btn {\n background: #303030;\n color: #fff;\n border-color: #303030;\n border-radius: 8px;\n }\n\n .preview-btn:hover,\n .publish-btn:hover:not(:disabled) {\n background: #1a1a1a !important;\n }\n\n .back-btn {\n border-color: transparent;\n background: transparent;\n }\n\n .section-count {\n font-size: 0.875rem;\n color: #666;\n }\n\n .page-title {\n font-size: 0.9375rem;\n font-weight: 600;\n color: #333;\n margin-right: 0.75rem;\n }\n\n .page-title-link {\n text-decoration: none;\n color: inherit;\n }\n\n .page-title-link:hover {\n text-decoration: underline;\n }\n\n .status-badge {\n display: inline-block;\n padding: 0.125rem 0.5rem;\n border-radius: 10px;\n font-size: 0.6875rem;\n font-weight: 500;\n text-transform: capitalize;\n background: #ffeaa7;\n color: #856404;\n }\n\n .status-badge.published {\n background: #b4fed3;\n color: #0d542b;\n }\n\n .dirty-indicator {\n margin-left: 0.75rem;\n font-size: 0.8125rem;\n color: #e67e22;\n font-weight: 500;\n }\n\n .canvas {\n flex: 1;\n overflow-y: auto;\n padding: 2rem;\n position: relative;\n }\n\n .canvas.preview-mode {\n padding: 0;\n background: #fff;\n }\n\n .preview-iframe {\n width: 100%;\n height: 100%;\n border: none;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n\n .canvas.preview-mode .section-outer {\n margin: 0;\n }\n\n .canvas.preview-mode .section-wrapper {\n border: none;\n border-radius: 0;\n }\n\n .empty-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: #666;\n text-align: center;\n }\n\n .empty-icon {\n font-size: 4rem;\n margin-bottom: 1rem;\n }\n\n .empty-state h3 {\n margin: 0 0 0.5rem;\n color: #333;\n }\n\n .empty-state p {\n margin: 0;\n font-size: 0.875rem;\n }\n\n .section-outer {\n position: relative;\n margin-bottom: 0;\n }\n\n .section-wrapper {\n border: 1px solid transparent;\n border-radius: 0;\n overflow: hidden;\n transition: border-color 0.2s;\n background: #fff;\n }\n\n .section-outer:hover .section-wrapper {\n border-color: rgba(0, 91, 211, 0.4);\n }\n\n .section-outer.selected .section-wrapper {\n border-color: rgba(0, 91, 211, 0.4);\n }\n\n .section-controls {\n position: absolute;\n top: -20px;\n left: 0;\n right: 0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: .14rem .75rem;\n background: #005BD3;\n color: #fff;\n font-size: 0.75rem;\n border-radius: 8px 8px 0 0;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s;\n z-index: 10;\n }\n\n .section-outer:hover .section-controls,\n .section-outer.selected .section-controls {\n opacity: 1;\n pointer-events: auto;\n }\n\n .section-outer:hover .section-wrapper,\n .section-outer.selected .section-wrapper {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n\n .section-label {\n font-weight: 500;\n }\n\n .section-actions {\n display: flex;\n gap: 0.25rem;\n }\n\n .action-btn {\n padding: .15rem .5rem;\n border: none;\n border-radius: 4px;\n background: #ffffff26;\n color: #fff;\n cursor: pointer;\n font-size: .6rem;\n }\n\n .action-btn:hover {\n background: rgba(255, 255, 255, 0.3);\n }\n\n .action-btn.delete:hover {\n background: #e74c3c;\n }\n\n .material-icon {\n font-family: 'Material Icons', sans-serif;\n font-size: 0.75rem;\n font-weight: normal;\n font-style: normal;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n white-space: nowrap;\n word-wrap: normal;\n direction: ltr;\n -webkit-font-smoothing: antialiased;\n text-rendering: optimizeLegibility;\n }\n\n /* Properties Panel */\n .properties-panel {\n background: #fff;\n border-left: 1px solid #e0e0e0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .properties-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 1rem;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .properties-header h3 {\n margin: 0;\n font-size: 1rem;\n font-weight: 600;\n }\n\n .editable-name {\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 0.375rem;\n border-radius: 4px;\n padding: 0.125rem 0.25rem;\n margin: -0.125rem -0.25rem;\n transition: background 0.2s;\n }\n\n .editable-name:hover {\n background: #f0f2f5;\n }\n\n .edit-icon {\n opacity: 0;\n color: #999;\n transition: opacity 0.2s;\n display: flex;\n flex-shrink: 0;\n }\n\n .editable-name:hover .edit-icon {\n opacity: 1;\n }\n\n .name-edit-input {\n flex: 1;\n padding: 0.375rem 0.5rem;\n border: 1px solid #005bd3;\n border-radius: 8px;\n font-size: 1rem;\n font-weight: 600;\n outline: none;\n }\n\n .close-btn {\n border: none;\n background: none;\n font-size: 1.25rem;\n cursor: pointer;\n color: #666;\n }\n\n .more-menu-btn {\n border: none;\n background: none;\n cursor: pointer;\n color: #616161;\n padding: 0.25rem;\n border-radius: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background 0.2s;\n }\n\n .more-menu-btn:hover {\n background: #f0f2f5;\n color: #303030;\n }\n\n .properties-content {\n flex: 1;\n overflow-y: auto;\n padding: 1rem;\n }\n\n .property-group {\n margin-bottom: 0;\n padding: 1rem 0;\n border-top: 1px solid #e0e0e0;\n }\n\n .property-group:first-child {\n border-top: none;\n }\n\n .group-title {\n display: flex;\n align-items: center;\n gap: 0.375rem;\n width: 100%;\n padding: 0;\n margin: 0 0 0.75rem;\n border: none;\n background: none;\n font-size: 0.8125rem;\n font-weight: 600;\n color: #303030;\n cursor: pointer;\n }\n\n .group-title:hover {\n color: #333;\n }\n\n .group-title:focus-visible {\n outline: 2px solid #4a90d9;\n outline-offset: 2px;\n border-radius: 2px;\n }\n\n .group-title-text {\n flex: 1;\n text-align: left;\n }\n\n .group-toggle-icon {\n font-size: 0.5rem;\n transition: transform 0.2s;\n display: inline-block;\n }\n\n .group-toggle-icon.collapsed {\n transform: rotate(-90deg);\n }\n\n .property-field {\n margin-bottom: 1rem;\n }\n\n .property-label {\n display: block;\n font-size: 0.875rem;\n font-weight: 500;\n margin-bottom: 0.375rem;\n color: #616161;\n }\n\n .property-input,\n .property-select,\n .property-textarea {\n width: 100%;\n padding: 0.5rem 0.75rem;\n border: 1px solid #c9cccf;\n border-radius: 8px;\n font-size: 0.875rem;\n transition: border-color 0.2s, box-shadow 0.2s;\n }\n\n .property-input:focus,\n .property-select:focus,\n .property-textarea:focus {\n outline: none;\n border-color: #005bd3;\n box-shadow: 0 0 0 1px #005bd3;\n }\n\n .property-textarea {\n resize: vertical;\n font-family: monospace;\n font-size: 0.75rem;\n }\n\n .color-field {\n display: flex;\n gap: 0.5rem;\n }\n\n .color-picker {\n width: 40px;\n height: 36px;\n padding: 2px;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n cursor: pointer;\n }\n\n .color-text {\n flex: 1;\n }\n\n .no-selection {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: #666;\n text-align: center;\n padding: 2rem;\n }\n\n .no-selection p {\n margin: 0;\n font-size: 0.875rem;\n }\n\n /* Panel Tabs */\n .panel-tabs {\n display: flex;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .panel-tab {\n flex: 1;\n padding: 0.75rem;\n border: none;\n border-bottom: 2px solid transparent;\n background: #fff;\n cursor: pointer;\n font-size: 0.75rem;\n font-weight: 500;\n color: #666;\n transition: all 0.2s;\n }\n\n .panel-tab:hover {\n background: #f8f9fa;\n color: #303030;\n }\n\n .panel-tab.active {\n background: #fff;\n color: #303030;\n border-bottom: 2px solid #005bd3;\n }\n\n /* Blocks List */\n .blocks-list {\n flex: 1;\n overflow-y: auto;\n padding: 1rem;\n }\n\n .slot-group {\n margin-bottom: 1.5rem;\n }\n\n .slot-title {\n font-size: 0.75rem;\n font-weight: 600;\n color: #616161;\n margin: 0 0 0.5rem;\n }\n\n .block-item {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.5rem;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n margin-bottom: 0.375rem;\n cursor: pointer;\n transition: all 0.2s;\n }\n\n .block-item:hover {\n border-color: #005bd3;\n background: #f8f9fa;\n }\n\n .block-item.selected {\n border-color: #005bd3;\n background: #005bd3;\n color: #fff;\n }\n\n .block-item.selected .block-icon,\n .block-item.selected .block-name {\n color: inherit;\n }\n\n .block-icon {\n font-size: 1rem;\n }\n\n .block-name {\n flex: 1;\n font-size: 0.8rem;\n font-weight: 500;\n color: #333;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .block-actions {\n display: flex;\n gap: 0.125rem;\n opacity: 0;\n transition: opacity 0.2s;\n }\n\n .block-item:hover .block-actions {\n opacity: 1;\n }\n\n .mini-btn {\n padding: 0.125rem 0.375rem;\n border: none;\n border-radius: 3px;\n background: #e0e0e0;\n cursor: pointer;\n font-size: 0.75rem;\n color: #666;\n }\n\n .mini-btn:hover {\n background: #d0d0d0;\n }\n\n .mini-btn.delete:hover {\n background: #e74c3c;\n color: #fff;\n }\n\n .empty-slot {\n padding: 0.75rem;\n text-align: center;\n color: #999;\n font-size: 0.75rem;\n background: #f8f9fa;\n border: 1px dashed #ddd;\n border-radius: 4px;\n }\n\n .no-slots {\n padding: 2rem;\n text-align: center;\n color: #666;\n }\n\n .no-slots p {\n margin: 0;\n font-size: 0.875rem;\n }\n\n .delete-block-btn {\n width: auto;\n padding: 0;\n margin-top: 1rem;\n border: none;\n border-radius: 0;\n background: transparent;\n color: #d72c0d;\n cursor: pointer;\n font-size: 0.875rem;\n font-weight: 500;\n transition: color 0.2s;\n }\n\n .delete-block-btn:hover {\n background: transparent;\n color: #bc2200;\n text-decoration: underline;\n }\n\n .toggle-field {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .toggle-label {\n font-size: 0.875rem;\n color: #303030;\n }\n\n .toggle-switch {\n position: relative;\n display: inline-flex;\n cursor: pointer;\n }\n\n .toggle-input {\n position: absolute;\n opacity: 0;\n width: 0;\n height: 0;\n }\n\n .toggle-track {\n width: 36px;\n height: 20px;\n background: #b5b5b5;\n border-radius: 10px;\n position: relative;\n transition: background 0.2s;\n }\n\n .toggle-thumb {\n position: absolute;\n top: 2px;\n left: 2px;\n width: 16px;\n height: 16px;\n background: #fff;\n border-radius: 50%;\n transition: transform 0.2s;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);\n }\n\n .toggle-input:checked + .toggle-track {\n background: #008060;\n }\n\n .toggle-input:checked + .toggle-track .toggle-thumb {\n transform: translateX(16px);\n }\n\n .toggle-input:focus-visible + .toggle-track {\n outline: 2px solid #005bd3;\n outline-offset: 2px;\n }\n\n .toggle-description {\n display: block;\n font-size: 0.75rem;\n color: #616161;\n margin-top: 0.25rem;\n }\n\n /* Media Field (image/video picker) */\n .media-field {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n }\n\n .media-preview {\n position: relative;\n border: 1px solid #e0e0e0;\n border-radius: 8px;\n overflow: hidden;\n }\n\n .media-thumbnail {\n display: block;\n width: 100%;\n max-height: 160px;\n object-fit: cover;\n background: #f0f2f5;\n }\n\n .media-remove-btn {\n position: absolute;\n top: 0.25rem;\n right: 0.25rem;\n width: 22px;\n height: 22px;\n border: none;\n border-radius: 50%;\n background: rgba(0, 0, 0, 0.6);\n color: #fff;\n cursor: pointer;\n font-size: 0.875rem;\n line-height: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .media-remove-btn:hover {\n background: #d72c0d;\n }\n\n .media-browse-btn {\n padding: 0.5rem 0.75rem;\n border: 1px solid #c9cccf;\n border-radius: 8px;\n background: #fff;\n cursor: pointer;\n font-size: 0.8125rem;\n color: #303030;\n transition: all 0.15s;\n }\n\n .media-browse-btn:hover {\n background: #f0f2f5;\n border-color: #999;\n }\n\n .media-url-input {\n font-size: 0.75rem;\n color: #616161;\n }\n\n .video-preview {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.5rem 0.75rem;\n background: #1a1a1a;\n }\n\n .video-indicator {\n color: #fff;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .video-url-text {\n flex: 1;\n color: #ccc;\n font-size: 0.6875rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .video-preview .media-remove-btn {\n position: static;\n flex-shrink: 0;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class VisualEditorComponent implements OnInit, OnDestroy {\n readonly facade = inject(VisualEditorFacade);\n private readonly registry = inject(ComponentRegistryService);\n private readonly navigation = inject(VisualEditorNavigation);\n private readonly loadingStrategy = inject(PageLoadingStrategy);\n private readonly config = inject(VISUAL_EDITOR_CONFIG);\n private readonly dndService = inject(DragDropService);\n private readonly iframeBridge = inject(IframeBridgeService);\n private readonly storefrontUrl = inject(STOREFRONT_URL);\n private readonly sanitizer = inject(DomSanitizer);\n private readonly destroy$ = new Subject<void>();\n\n // Configuration-driven UI options\n readonly showBackButton = computed(() => this.config.ui?.showBackButton ?? true);\n readonly showPublishButtons = computed(() => this.config.ui?.showPublishButtons ?? true);\n readonly showSaveButton = computed(() => this.config.ui?.showSaveButton ?? true);\n\n readonly isPreviewMode = signal(false);\n readonly editorContext = computed(() => ({ isEditor: !this.isPreviewMode() }));\n private readonly canvasEl = viewChild<ElementRef<HTMLElement>>('canvasEl');\n\n // Iframe preview\n private readonly previewFrame = viewChild<ElementRef<HTMLIFrameElement>>('previewFrame');\n readonly previewUrl = computed<SafeResourceUrl | null>(() => {\n if (!this.storefrontUrl) return null;\n return this.sanitizer.bypassSecurityTrustResourceUrl(\n `${this.storefrontUrl}/kustomizer/editor`\n );\n });\n private iframeReady = false;\n readonly propertiesTab = signal<'props' | 'blocks'>('props');\n readonly expandedGroups = signal(new Set<string>());\n readonly expandedSections = signal<Set<string>>(new Set());\n readonly allBlocksExpanded = signal(new Set<string>());\n readonly showSectionPicker = signal(false);\n readonly blockPickerSection = signal<EditorSection | null>(null);\n readonly nestedBlockPickerTarget = signal<BlockPickerTarget | null>(null);\n\n // File picker state\n readonly filePickerOpen = signal(false);\n readonly filePickerMediaType = signal<'IMAGE' | 'VIDEO'>('IMAGE');\n readonly filePickerTargetKey = signal('');\n readonly filePickerContext = signal<'block' | 'section'>('block');\n readonly filePickerCurrentValue = computed(() => {\n const key = this.filePickerTargetKey();\n if (!key) return '';\n return this.filePickerContext() === 'block'\n ? this.getBlockPropertyValue(key)\n : this.getPropertyValue(key);\n });\n\n // Page state\n readonly isSaving = signal(false);\n readonly isPublishing = signal(false);\n readonly isLoading = signal(false);\n\n // Search signals\n readonly searchQuery = signal('');\n readonly sectionPickerSearch = signal('');\n readonly blockPickerSearch = signal('');\n readonly nestedBlockPickerSearch = signal('');\n\n // DnD signals\n readonly sectionDropZone = signal<string | null>(null);\n readonly dndAnnouncement = signal('');\n private sectionAutoExpandTimer: ReturnType<typeof setTimeout> | null = null;\n\n // Filtered lists\n readonly filteredSections = computed(() => {\n const query = this.searchQuery().toLowerCase().trim();\n const sections = this.facade.sections();\n\n if (!query) return sections;\n\n return sections.filter((section) => {\n const sectionName = this.getSectionName(section).toLowerCase();\n const sectionType = section.type.toLowerCase();\n\n // Match section name or type\n if (sectionName.includes(query) || sectionType.includes(query)) {\n return true;\n }\n\n // Match any block inside the section\n const blocks = section.elements ?? [];\n return blocks.some((block) => {\n const blockName = this.getBlockName(block).toLowerCase();\n const blockType = block.type.toLowerCase();\n return blockName.includes(query) || blockType.includes(query);\n });\n });\n });\n\n readonly filteredAvailableSectionPresets = computed(() => {\n const query = this.sectionPickerSearch().toLowerCase().trim();\n const presets = this.facade.availableSectionPresets();\n\n if (!query) return presets;\n\n return presets.filter((rp) => {\n const name = rp.displayName.toLowerCase();\n const type = rp.definition.type.toLowerCase();\n const desc = (rp.displayDescription ?? '').toLowerCase();\n const tags = (rp.definition.tags ?? []).join(' ').toLowerCase();\n\n return name.includes(query) || type.includes(query) || desc.includes(query) || tags.includes(query);\n });\n });\n\n readonly groupedSectionPresets = computed(() => {\n const presets = this.filteredAvailableSectionPresets();\n const groups = new Map<string, ResolvedPreset[]>();\n\n for (const rp of presets) {\n const category = rp.displayCategory;\n const list = groups.get(category);\n if (list) {\n list.push(rp);\n } else {\n groups.set(category, [rp]);\n }\n }\n\n return Array.from(groups.entries()).map(([category, items]) => ({\n category,\n presets: items,\n }));\n });\n\n readonly filteredBlockPresetsForSection = computed(() => {\n const section = this.blockPickerSection();\n if (!section) return [];\n\n const query = this.blockPickerSearch().toLowerCase().trim();\n const presets = this.registry.getBlockPresetsForSectionType(section.type);\n\n if (!query) return presets;\n\n return presets.filter((rp) => {\n const name = rp.displayName.toLowerCase();\n const type = rp.definition.type.toLowerCase();\n const desc = (rp.displayDescription ?? '').toLowerCase();\n const tags = (rp.definition.tags ?? []).join(' ').toLowerCase();\n\n return name.includes(query) || type.includes(query) || desc.includes(query) || tags.includes(query);\n });\n });\n\n readonly filteredBlockPresetsForNestedSlot = computed(() => {\n const target = this.nestedBlockPickerTarget();\n if (!target) return [];\n\n const query = this.nestedBlockPickerSearch().toLowerCase().trim();\n const firstSlot = target.slots[0];\n\n // Get allowed block definitions, then resolve presets\n const blockDefs = firstSlot\n ? this.facade.getAllowedBlocksForNestedSlot(target.parentType, firstSlot.name)\n : this.facade.availableBlocks();\n\n const presets = blockDefs.flatMap((def) => this.registry.resolvePresets(def));\n\n if (!query) return presets;\n\n return presets.filter((rp) => {\n const name = rp.displayName.toLowerCase();\n const type = rp.definition.type.toLowerCase();\n const desc = (rp.displayDescription ?? '').toLowerCase();\n const tags = (rp.definition.tags ?? []).join(' ').toLowerCase();\n\n return name.includes(query) || type.includes(query) || desc.includes(query) || tags.includes(query);\n });\n });\n\n private readonly sectionIconMap: Record<string, string> = {\n 'hero-section': '🎯',\n 'features-grid': '⚡',\n 'testimonials': '💬',\n 'cta-section': '📢',\n 'footer-section': '📋',\n };\n\n private readonly blockIconMap: Record<string, string> = {\n 'text-block': '📝',\n 'button-block': '🔘',\n 'image-block': '🖼️',\n 'icon-block': '⭐',\n 'feature-item': '⭐',\n 'card-block': '🃏',\n };\n\n readonly selectedBlockDefinition = computed(() => this.facade.selectedBlockDefinition());\n\n // Inline name editing\n private readonly nameInput = viewChild<ElementRef<HTMLInputElement>>('nameInput');\n readonly isEditingName = signal(false);\n readonly editingNameValue = signal('');\n\n getSelectedDisplayName(def: ComponentDefinition): string {\n const block = this.facade.selectedBlock();\n if (block) {\n return block.adminLabel || this.facade.selectedBlockDefinition()?.name || block.type;\n }\n const section = this.facade.selectedSection();\n return section?.adminLabel || def.name;\n }\n\n getSelectedDefaultName(def: ComponentDefinition): string {\n const block = this.facade.selectedBlock();\n if (block) {\n return this.facade.selectedBlockDefinition()?.name || block.type;\n }\n return def.name;\n }\n\n startEditingName(): void {\n const block = this.facade.selectedBlock();\n if (block) {\n this.editingNameValue.set(block.adminLabel ?? '');\n } else {\n const section = this.facade.selectedSection();\n this.editingNameValue.set(section?.adminLabel ?? '');\n }\n this.isEditingName.set(true);\n requestAnimationFrame(() => {\n const input = this.nameInput()?.nativeElement;\n if (input) {\n input.focus();\n input.select();\n }\n });\n }\n\n saveEditingName(event: Event): void {\n if (!this.isEditingName()) return;\n const input = event.target as HTMLInputElement;\n const value = input.value.trim();\n const section = this.facade.selectedSection();\n if (!section) return;\n\n const block = this.facade.selectedBlock();\n if (block) {\n this.facade.renameBlock(section.id, block.id, value);\n } else {\n this.facade.renameSection(section.id, value);\n }\n this.isEditingName.set(false);\n }\n\n cancelEditingName(): void {\n this.isEditingName.set(false);\n }\n\n constructor() {\n // Sync sections to iframe whenever they change\n effect(() => {\n const sections = this.facade.sections();\n if (this.iframeReady && this.previewUrl()) {\n this.iframeBridge.sendPageUpdate(sections);\n }\n });\n\n // Sync selection to iframe\n effect(() => {\n const selected = this.facade.selectedElement()?.id ?? null;\n if (!this.iframeReady || !this.previewUrl()) return;\n if (selected) {\n this.iframeBridge.sendSelectElement(selected);\n } else {\n this.iframeBridge.sendDeselect();\n }\n });\n }\n\n ngOnInit(): void {\n // Load page using the configured loading strategy\n this.loadingStrategy\n .getPageIdToLoad()\n .pipe(\n takeUntil(this.destroy$),\n filter((pageId): pageId is string => pageId !== null),\n switchMap((pageId) => {\n this.isLoading.set(true);\n return this.loadingStrategy.loadPage(pageId);\n })\n )\n .subscribe({\n next: (page) => {\n this.facade.loadPage(page);\n this.isLoading.set(false);\n },\n error: (err) => {\n console.error('Failed to load page:', err);\n this.isLoading.set(false);\n this.navigation.navigate({ type: 'page-list' });\n },\n });\n\n // Listen for iframe events\n if (this.previewUrl()) {\n this.iframeBridge\n .onReady()\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => {\n this.iframeReady = true;\n // Send initial page state\n this.iframeBridge.sendPageUpdate(this.facade.sections());\n });\n\n this.iframeBridge\n .onElementClicked()\n .pipe(takeUntil(this.destroy$))\n .subscribe(({ elementId, sectionId }) => {\n this.facade.selectElement(sectionId, elementId);\n });\n }\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n this.iframeBridge.disconnect();\n // Clear page from store when leaving editor\n this.facade.clearPage();\n }\n\n onIframeLoad(): void {\n const iframe = this.previewFrame()?.nativeElement;\n if (iframe) {\n const origin = this.storefrontUrl ? new URL(this.storefrontUrl).origin : '*';\n this.iframeBridge.connect(iframe, origin);\n }\n }\n\n goBack(): void {\n if (this.facade.isDirty()) {\n this.navigation\n .confirm({\n title: 'Unsaved Changes',\n message: 'You have unsaved changes. Are you sure you want to leave?',\n confirmText: 'Leave',\n cancelText: 'Stay',\n })\n .subscribe((confirmed) => {\n if (confirmed) {\n this.navigation.navigate({ type: 'page-list' });\n }\n });\n } else {\n this.navigation.navigate({ type: 'page-list' });\n }\n }\n\n savePage(): void {\n const pageId = this.facade.currentPageId();\n if (!pageId) return;\n\n this.isSaving.set(true);\n this.facade.savePage(pageId).subscribe({\n next: () => {\n this.isSaving.set(false);\n },\n error: (err) => {\n console.error('Failed to save page:', err);\n this.isSaving.set(false);\n },\n });\n }\n\n publishPage(): void {\n const pageId = this.facade.currentPageId();\n if (!pageId) return;\n\n this.isPublishing.set(true);\n this.facade.publishPage(pageId).subscribe({\n next: () => {\n this.isPublishing.set(false);\n },\n error: (err) => {\n console.error('Failed to publish page:', err);\n this.isPublishing.set(false);\n },\n });\n }\n\n unpublishPage(): void {\n const pageId = this.facade.currentPageId();\n if (!pageId) return;\n\n this.isPublishing.set(true);\n this.facade.unpublishPage(pageId).subscribe({\n next: () => {\n this.isPublishing.set(false);\n },\n error: (err) => {\n console.error('Failed to unpublish page:', err);\n this.isPublishing.set(false);\n },\n });\n }\n\n getIcon(def: ComponentDefinition): string {\n return this.sectionIconMap[def.type] ?? '📦';\n }\n\n getBlockIcon(def: ComponentDefinition): string {\n return this.blockIconMap[def.type] ?? '🧩';\n }\n\n getBlockIconByType(type: string): string {\n return this.blockIconMap[type] ?? '🧩';\n }\n\n getSectionIcon(type: string): string {\n return this.sectionIconMap[type] ?? '📦';\n }\n\n // Tree expansion\n isSectionExpanded(sectionId: string): boolean {\n return this.expandedSections().has(sectionId);\n }\n\n isAllBlocksExpanded(sectionId: string): boolean {\n return this.allBlocksExpanded().has(sectionId);\n }\n\n toggleSectionExpand(sectionId: string, event: Event): void {\n event.stopPropagation();\n const wasExpanded = this.expandedSections().has(sectionId);\n this.expandedSections.update((set) => {\n const newSet = new Set(set);\n if (wasExpanded) {\n newSet.delete(sectionId);\n } else {\n newSet.add(sectionId);\n }\n return newSet;\n });\n if (wasExpanded) {\n this.allBlocksExpanded.update((set) => {\n const newSet = new Set(set);\n newSet.delete(sectionId);\n return newSet;\n });\n }\n }\n\n toggleGroup(entityId: string, group: string): void {\n const key = `${entityId}:${group}`;\n this.expandedGroups.update((set) => {\n const newSet = new Set(set);\n if (newSet.has(key)) {\n newSet.delete(key);\n } else {\n newSet.add(key);\n }\n return newSet;\n });\n }\n\n isGroupCollapsed(entityId: string, group: string): boolean {\n return !this.expandedGroups().has(`${entityId}:${group}`);\n }\n\n getSectionBlocks(section: EditorSection): EditorElement[] {\n return section.elements ?? [];\n }\n\n private readonly rootBlockContextCache = new Map<string, BlockTreeContext>();\n private readonly emptyPath: string[] = [];\n\n getRootBlockContext(sectionId: string): BlockTreeContext {\n let ctx = this.rootBlockContextCache.get(sectionId);\n if (!ctx) {\n ctx = { sectionId, parentPath: this.emptyPath, depth: 0 };\n this.rootBlockContextCache.set(sectionId, ctx);\n }\n return ctx;\n }\n\n // Search handlers\n onSearchInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.searchQuery.set(input.value);\n\n // Auto-expand sections that match when searching\n if (input.value.trim()) {\n const matchingSectionIds = this.filteredSections().map((s) => s.id);\n this.expandedSections.update((set) => {\n const newSet = new Set(set);\n matchingSectionIds.forEach((id) => newSet.add(id));\n return newSet;\n });\n }\n }\n\n clearSearch(): void {\n this.searchQuery.set('');\n }\n\n // ========== Section Drag & Drop ==========\n\n isSectionDragSource(sectionId: string): boolean {\n const dragItem = this.dndService.dragItem();\n return dragItem !== null && dragItem.kind === 'section' && dragItem.elementId === sectionId;\n }\n\n onSectionDragStart(section: EditorSection, index: number, event: DragEvent): void {\n event.stopPropagation();\n const item: DragItem = {\n kind: 'section',\n elementId: section.id,\n elementType: section.type,\n sectionId: section.id,\n parentPath: [],\n sourceIndex: index,\n };\n this.dndService.startDrag(item, event);\n this.dndAnnouncement.set(`Grabbed ${this.getSectionName(section)}, position ${index + 1} of ${this.facade.sections().length}`);\n }\n\n onSectionDragEnd(event: DragEvent): void {\n event.stopPropagation();\n this.dndService.endDrag();\n this.sectionDropZone.set(null);\n this.clearAutoExpandTimer();\n this.dndAnnouncement.set('');\n }\n\n onSectionDragOver(section: EditorSection, index: number, event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n\n const dragItem = this.dndService.dragItem();\n if (!dragItem) return;\n\n if (dragItem.kind === 'section') {\n // Section reordering\n const el = event.currentTarget as HTMLElement;\n const rect = el.getBoundingClientRect();\n const y = event.clientY - rect.top;\n const zone: DropZone = y / rect.height < 0.5 ? 'before' : 'after';\n\n const targetIndex = zone === 'before' ? index : index + 1;\n const target = {\n kind: 'section' as const,\n sectionId: section.id,\n parentPath: [] as string[],\n slotName: 'default',\n index: targetIndex,\n depth: 0,\n zone,\n };\n\n if (this.dndService.validateDrop(dragItem, target)) {\n event.dataTransfer!.dropEffect = 'move';\n this.sectionDropZone.set(`${section.id}:${zone}`);\n this.dndService.updateDropTarget(target);\n } else {\n event.dataTransfer!.dropEffect = 'none';\n this.sectionDropZone.set(null);\n }\n } else if (dragItem.kind === 'block') {\n // Block dragged over collapsed section - auto-expand\n if (!this.isSectionExpanded(section.id)) {\n this.startAutoExpandTimer(section.id);\n }\n }\n }\n\n onSectionDragLeave(event: DragEvent): void {\n const el = event.currentTarget as HTMLElement;\n const relatedTarget = event.relatedTarget as Node | null;\n if (relatedTarget && el.contains(relatedTarget)) return;\n\n this.sectionDropZone.set(null);\n this.clearAutoExpandTimer();\n }\n\n onSectionDrop(event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.sectionDropZone.set(null);\n this.clearAutoExpandTimer();\n\n const dragItem = this.dndService.dragItem();\n if (dragItem?.kind === 'section') {\n this.dndService.executeDrop();\n this.dndAnnouncement.set('Section dropped');\n }\n }\n\n onSectionDragHandleKeydown(sectionId: string, index: number, event: KeyboardEvent): void {\n if (event.key === 'ArrowUp' && index > 0) {\n event.preventDefault();\n this.facade.moveSection(sectionId, index - 1);\n } else if (event.key === 'ArrowDown' && index < this.facade.sections().length - 1) {\n event.preventDefault();\n this.facade.moveSection(sectionId, index + 1);\n }\n }\n\n onSectionContentDragOver(section: EditorSection, event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n\n const dragItem = this.dndService.dragItem();\n if (!dragItem || dragItem.kind !== 'block') return;\n\n // Allow dropping blocks into section content area (appends to end)\n const sectionDef = this.facade.getDefinition(section.type);\n const slotName = sectionDef?.slots?.[0]?.name ?? 'default';\n const blocks = this.getSectionBlocks(section);\n\n const target = {\n kind: 'block' as const,\n sectionId: section.id,\n parentPath: [] as string[],\n slotName,\n index: blocks.length,\n depth: 0,\n zone: 'after' as DropZone,\n };\n\n if (this.dndService.validateDrop(dragItem, target)) {\n event.dataTransfer!.dropEffect = 'move';\n this.dndService.updateDropTarget(target);\n } else {\n event.dataTransfer!.dropEffect = 'none';\n }\n }\n\n onSectionContentDragLeave(event: DragEvent): void {\n const el = event.currentTarget as HTMLElement;\n const relatedTarget = event.relatedTarget as Node | null;\n if (relatedTarget && el.contains(relatedTarget)) return;\n }\n\n onSectionContentDrop(event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n\n const dragItem = this.dndService.dragItem();\n if (dragItem?.kind === 'block') {\n this.dndService.executeDrop();\n this.dndAnnouncement.set('Block moved');\n }\n }\n\n private startAutoExpandTimer(sectionId: string): void {\n this.clearAutoExpandTimer();\n this.sectionAutoExpandTimer = setTimeout(() => {\n this.expandedSections.update((set) => {\n const newSet = new Set(set);\n newSet.add(sectionId);\n return newSet;\n });\n }, 500);\n }\n\n private clearAutoExpandTimer(): void {\n if (this.sectionAutoExpandTimer !== null) {\n clearTimeout(this.sectionAutoExpandTimer);\n this.sectionAutoExpandTimer = null;\n }\n }\n\n // ========== Scroll to Element ==========\n\n private scrollToCanvasElement(elementId: string, fallbackSectionId?: string): void {\n const canvas = this.canvasEl()?.nativeElement;\n if (!canvas) return;\n\n requestAnimationFrame(() => {\n const el = canvas.querySelector<HTMLElement>(`[data-element-id=\"${elementId}\"]`);\n // Block component hosts use `display: contents` so they have no bounding box.\n // Resolve the first child that generates a CSS box for scrollIntoView to work.\n const target = this.resolveScrollTarget(el)\n ?? this.resolveScrollTarget(\n fallbackSectionId ? canvas.querySelector<HTMLElement>(`[data-section-id=\"${fallbackSectionId}\"]`) : null\n );\n target?.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n });\n }\n\n /** Return the element itself if it has a box, otherwise its first laid-out child. */\n private resolveScrollTarget(el: HTMLElement | null): HTMLElement | null {\n if (!el) return null;\n // Elements with `display: contents` report a zero-area bounding rect.\n const rect = el.getBoundingClientRect();\n if (rect.width > 0 && rect.height > 0) return el;\n // Walk into children to find one that paints.\n return (el.firstElementChild as HTMLElement) ?? el;\n }\n\n private scrollToCanvasSection(sectionId: string): void {\n const canvas = this.canvasEl()?.nativeElement;\n if (!canvas) return;\n\n requestAnimationFrame(() => {\n const target = canvas.querySelector<HTMLElement>(`[data-section-id=\"${sectionId}\"]`);\n target?.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n });\n }\n\n onSectionPickerSearch(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.sectionPickerSearch.set(input.value);\n }\n\n onBlockPickerSearch(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.blockPickerSearch.set(input.value);\n }\n\n // Section picker\n toggleSectionPicker(): void {\n this.showSectionPicker.update((v) => !v);\n // Clear search when toggling\n if (!this.showSectionPicker()) {\n this.sectionPickerSearch.set('');\n }\n }\n\n // Block picker\n openBlockPicker(section: EditorSection, event: Event): void {\n event.stopPropagation();\n this.blockPickerSection.set(section);\n this.blockPickerSearch.set(''); // Clear search when opening\n }\n\n closeBlockPicker(): void {\n this.blockPickerSection.set(null);\n this.blockPickerSearch.set('');\n }\n\n // Nested block picker (for blocks with slots)\n onOpenNestedBlockPicker(target: BlockPickerTarget): void {\n this.nestedBlockPickerTarget.set(target);\n this.nestedBlockPickerSearch.set('');\n }\n\n closeNestedBlockPicker(): void {\n this.nestedBlockPickerTarget.set(null);\n this.nestedBlockPickerSearch.set('');\n }\n\n onNestedBlockPickerSearch(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.nestedBlockPickerSearch.set(input.value);\n }\n\n addNestedBlock(blockType: string): void {\n const target = this.nestedBlockPickerTarget();\n if (!target) return;\n\n const slotName = target.slots[0]?.name ?? 'default';\n this.facade.addNestedBlock(target.sectionId, target.parentPath, slotName, blockType);\n this.closeNestedBlockPicker();\n }\n\n // Block tree item handlers\n onBlockSelect(event: { block: EditorElement; context: BlockTreeContext }): void {\n this.isEditingName.set(false);\n this.facade.selectElement(event.context.sectionId, event.block.id);\n this.propertiesTab.set('props');\n this.scrollToCanvasElement(event.block.id, event.context.sectionId);\n }\n\n onBlockDelete(event: { block: EditorElement; context: BlockTreeContext }): void {\n if (event.context.parentPath.length === 0) {\n // Direct child of section\n this.facade.removeBlock(event.context.sectionId, event.block.id);\n } else {\n // Nested block\n this.facade.removeNestedBlock(event.context.sectionId, event.context.parentPath, event.block.id);\n }\n }\n\n onBlockMove(event: { block: EditorElement; context: BlockTreeContext; newIndex: number }): void {\n const slotName = event.block.slotName ?? 'default';\n if (event.context.parentPath.length === 0) {\n // Direct child of section\n this.facade.moveBlock(event.context.sectionId, event.block.id, slotName, event.newIndex);\n } else {\n // Nested block\n this.facade.moveNestedBlock(\n event.context.sectionId,\n event.context.parentPath,\n event.block.id,\n slotName,\n event.newIndex\n );\n }\n }\n\n onBlockDuplicate(event: { block: EditorElement; context: BlockTreeContext }): void {\n if (event.context.parentPath.length === 0) {\n this.facade.duplicateBlock(event.context.sectionId, event.block.id);\n } else {\n this.facade.duplicateNestedBlock(event.context.sectionId, event.context.parentPath, event.block.id);\n }\n }\n\n duplicateSection(sectionId: string, event: Event): void {\n event.stopPropagation();\n this.facade.duplicateSection(sectionId);\n }\n\n duplicateBlock(block: EditorElement, event: Event): void {\n event.stopPropagation();\n const section = this.facade.selectedSection();\n if (!section) return;\n this.facade.duplicateBlock(section.id, block.id);\n }\n\n addBlockToSection(section: EditorSection, blockType: string): void {\n const sectionDef = this.facade.getDefinition(section.type);\n const slotName = sectionDef?.slots?.[0]?.name ?? 'default';\n this.facade.addBlock(section.id, slotName, blockType);\n this.closeBlockPicker();\n // Ensure section is expanded to show new block\n this.expandedSections.update((set) => {\n const newSet = new Set(set);\n newSet.add(section.id);\n return newSet;\n });\n }\n\n getSectionName(section: EditorSection): string {\n return section.adminLabel || this.facade.getDefinition(section.type)?.name || section.type;\n }\n\n getBlockName(block: EditorElement): string {\n if (block.adminLabel) return block.adminLabel;\n const def = this.facade.getDefinition(block.type);\n const preview = String(block.props['content'] ?? block.props['label'] ?? block.props['text'] ?? '');\n if (preview && preview.length > 20) {\n return preview.substring(0, 20) + '...';\n }\n return preview || def?.name || block.type;\n }\n\n addSection(type: string): void {\n this.facade.addSection(type);\n this.showSectionPicker.set(false);\n }\n\n addSectionFromPreset(rp: ResolvedPreset): void {\n this.facade.addSectionFromPreset(rp);\n this.showSectionPicker.set(false);\n this.sectionPickerSearch.set('');\n }\n\n addBlockToSectionFromPreset(section: EditorSection, rp: ResolvedPreset): void {\n const sectionDef = this.facade.getDefinition(section.type);\n const slotName = sectionDef?.slots?.[0]?.name ?? 'default';\n this.facade.addBlockFromPreset(section.id, slotName, rp);\n this.closeBlockPicker();\n this.expandedSections.update((set) => {\n const newSet = new Set(set);\n newSet.add(section.id);\n return newSet;\n });\n }\n\n addNestedBlockFromPreset(rp: ResolvedPreset): void {\n const target = this.nestedBlockPickerTarget();\n if (!target) return;\n\n const slotName = target.slots[0]?.name ?? 'default';\n\n // For nested blocks without preset settings, use existing method\n if (!rp.preset?.settings) {\n this.facade.addNestedBlock(target.sectionId, target.parentPath, slotName, rp.definition.type);\n } else {\n // Create the block element with preset props, then dispatch via addNestedBlock\n this.facade.addNestedBlock(target.sectionId, target.parentPath, slotName, rp.definition.type);\n\n // Apply preset settings to the newly added block\n const section = this.facade.sections().find((s) => s.id === target.sectionId);\n if (section) {\n // Find the last element in the slot — it's the one just added\n const children = section.elements.filter((e) => e.slotName === slotName);\n const lastChild = children[children.length - 1];\n if (lastChild) {\n this.facade.updateBlockProps(target.sectionId, lastChild.id, rp.preset.settings);\n }\n }\n }\n\n this.closeNestedBlockPicker();\n }\n\n getSectionPresetIcon(rp: ResolvedPreset): string {\n return rp.displayIcon ?? this.sectionIconMap[rp.definition.type] ?? '📦';\n }\n\n getBlockPresetIcon(rp: ResolvedPreset): string {\n return rp.displayIcon ?? this.blockIconMap[rp.definition.type] ?? '🧩';\n }\n\n selectSection(section: EditorSection, event: Event): void {\n event.stopPropagation();\n this.isEditingName.set(false);\n\n const isAlreadySelected = this.facade.selectedSection()?.id === section.id && !this.facade.selectedBlock();\n\n if (isAlreadySelected) {\n const wasExpanded = this.expandedSections().has(section.id);\n this.expandedSections.update((set) => {\n const newSet = new Set(set);\n if (wasExpanded) {\n newSet.delete(section.id);\n } else {\n newSet.add(section.id);\n }\n return newSet;\n });\n this.allBlocksExpanded.update((set) => {\n const newSet = new Set(set);\n if (wasExpanded) {\n newSet.delete(section.id);\n } else {\n newSet.add(section.id);\n }\n return newSet;\n });\n } else {\n this.facade.selectElement(section.id, null);\n this.expandedSections.update((set) => {\n const newSet = new Set(set);\n newSet.add(section.id);\n return newSet;\n });\n this.allBlocksExpanded.update((set) => {\n const newSet = new Set(set);\n newSet.add(section.id);\n return newSet;\n });\n this.scrollToCanvasSection(section.id);\n }\n }\n\n selectBlock(block: EditorElement): void {\n const section = this.facade.selectedSection();\n if (!section) return;\n this.isEditingName.set(false);\n this.facade.selectElement(section.id, block.id);\n this.propertiesTab.set('props');\n }\n\n deleteSection(sectionId: string, event: Event): void {\n event.stopPropagation();\n this.facade.removeSection(sectionId);\n }\n\n deleteBlock(block: EditorElement, event: Event): void {\n event.stopPropagation();\n const section = this.facade.selectedSection();\n if (!section) return;\n this.facade.removeBlock(section.id, block.id);\n }\n\n deleteSelectedBlock(): void {\n const section = this.facade.selectedSection();\n const block = this.facade.selectedBlock();\n if (!section || !block) return;\n this.facade.removeBlock(section.id, block.id);\n }\n\n moveUp(sectionId: string, currentIndex: number, event: Event): void {\n event.stopPropagation();\n this.facade.moveSection(sectionId, currentIndex - 1);\n }\n\n moveDown(sectionId: string, currentIndex: number, event: Event): void {\n event.stopPropagation();\n this.facade.moveSection(sectionId, currentIndex + 1);\n }\n\n moveBlockUp(block: EditorElement, slotName: string, currentIndex: number, event: Event): void {\n event.stopPropagation();\n const section = this.facade.selectedSection();\n if (!section) return;\n this.facade.moveBlock(section.id, block.id, slotName, currentIndex - 1);\n }\n\n moveBlockDown(block: EditorElement, slotName: string, currentIndex: number, event: Event): void {\n event.stopPropagation();\n const section = this.facade.selectedSection();\n if (!section) return;\n this.facade.moveBlock(section.id, block.id, slotName, currentIndex + 1);\n }\n\n togglePreview(): void {\n this.isPreviewMode.update((v) => !v);\n if (this.isPreviewMode()) {\n this.facade.clearSelection();\n }\n }\n\n // Section slots and blocks\n getSectionSlots() {\n const section = this.facade.selectedSection();\n if (!section) return [];\n const def = this.facade.getDefinition(section.type);\n return def?.slots ?? [];\n }\n\n getBlocksForSlot(slotName: string): EditorElement[] {\n const section = this.facade.selectedSection();\n if (!section) return [];\n return this.facade.getBlocksForSlot(section.id, slotName);\n }\n\n getBlockCount(): number {\n const section = this.facade.selectedSection();\n if (!section) return 0;\n return section.elements.length;\n }\n\n // Section property methods\n getPropertyGroups(def: ComponentDefinition): string[] {\n const groups = new Set<string>();\n Object.values(def.props).forEach((prop) => {\n groups.add(prop.group ?? 'General');\n });\n return Array.from(groups);\n }\n\n getPropsForGroup(\n def: ComponentDefinition,\n group: string\n ): Array<{ key: string; schema: (typeof def.props)[string] }> {\n return Object.entries(def.props)\n .filter(([, schema]) => (schema.group ?? 'General') === group)\n .sort((a, b) => (a[1].order ?? 999) - (b[1].order ?? 999))\n .map(([key, schema]) => ({ key, schema }));\n }\n\n getPropertyValue(key: string): string {\n const section = this.facade.selectedSection();\n if (!section) return '';\n const value = section.props[key];\n if (value === undefined || value === null) {\n const def = this.facade.selectedSectionDefinition();\n return String(def?.props[key]?.defaultValue ?? '');\n }\n return String(value);\n }\n\n updateProperty(key: string, event: Event): void {\n const section = this.facade.selectedSection();\n if (!section) return;\n\n const target = event.target as HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;\n this.facade.updateSectionProps(section.id, { [key]: target.value });\n }\n\n // Block property methods\n getBlockPropertyGroups(): string[] {\n const def = this.selectedBlockDefinition();\n if (!def) return [];\n const groups = new Set<string>();\n Object.values(def.props).forEach((prop) => {\n groups.add(prop.group ?? 'General');\n });\n return Array.from(groups);\n }\n\n getBlockPropsForGroup(group: string): Array<{ key: string; schema: ComponentDefinition['props'][string] }> {\n const def = this.selectedBlockDefinition();\n if (!def) return [];\n return Object.entries(def.props)\n .filter(([, schema]) => (schema.group ?? 'General') === group)\n .sort((a, b) => (a[1].order ?? 999) - (b[1].order ?? 999))\n .map(([key, schema]) => ({ key, schema }));\n }\n\n getBlockPropertyValue(key: string): string {\n const block = this.facade.selectedBlock();\n if (!block) return '';\n const value = block.props[key];\n if (value === undefined || value === null) {\n const def = this.selectedBlockDefinition();\n return String(def?.props[key]?.defaultValue ?? '');\n }\n return String(value);\n }\n\n updateBlockProperty(key: string, event: Event): void {\n const section = this.facade.selectedSection();\n const block = this.facade.selectedBlock();\n if (!section || !block) return;\n\n const target = event.target as HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;\n let value: unknown = target.value;\n\n const def = this.selectedBlockDefinition();\n if (def?.props[key]?.type === 'number') {\n value = parseFloat(target.value) || 0;\n }\n\n this.facade.updateBlockProps(section.id, block.id, { [key]: value });\n }\n\n updateBlockBooleanProperty(key: string, event: Event): void {\n const section = this.facade.selectedSection();\n const block = this.facade.selectedBlock();\n if (!section || !block) return;\n\n const target = event.target as HTMLInputElement;\n this.facade.updateBlockProps(section.id, block.id, { [key]: target.checked });\n }\n\n // File picker methods\n openFilePicker(mediaType: 'IMAGE' | 'VIDEO', key: string, context: 'block' | 'section'): void {\n this.filePickerMediaType.set(mediaType);\n this.filePickerTargetKey.set(key);\n this.filePickerContext.set(context);\n this.filePickerOpen.set(true);\n }\n\n closeFilePicker(): void {\n this.filePickerOpen.set(false);\n }\n\n onFileSelected(url: string): void {\n const key = this.filePickerTargetKey();\n if (!key) return;\n\n if (this.filePickerContext() === 'block') {\n const section = this.facade.selectedSection();\n const block = this.facade.selectedBlock();\n if (section && block) {\n this.facade.updateBlockProps(section.id, block.id, { [key]: url });\n }\n } else {\n const section = this.facade.selectedSection();\n if (section) {\n this.facade.updateSectionProps(section.id, { [key]: url });\n }\n }\n\n this.closeFilePicker();\n }\n\n clearBlockProperty(key: string): void {\n const section = this.facade.selectedSection();\n const block = this.facade.selectedBlock();\n if (!section || !block) return;\n this.facade.updateBlockProps(section.id, block.id, { [key]: '' });\n }\n\n clearSectionProperty(key: string): void {\n const section = this.facade.selectedSection();\n if (!section) return;\n this.facade.updateSectionProps(section.id, { [key]: '' });\n }\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n inject,\n signal,\n OnInit,\n} from '@angular/core';\nimport { VisualEditorFacade } from '../../services/visual-editor-facade.service';\nimport { PageSummary } from '../../models/page.model';\nimport { VisualEditorNavigation } from '../../navigation/visual-editor-navigation.types';\n\n/**\n * Page manager component for listing, creating, and managing pages\n */\n@Component({\n selector: 'lib-page-manager',\n template: `\n <div class=\"page-manager\">\n <header class=\"manager-header\">\n <h1>Pages</h1>\n <div class=\"header-actions\">\n <button class=\"btn-secondary\" (click)=\"openSetup()\">\n Setup\n </button>\n <button class=\"btn-primary\" (click)=\"openCreateDialog()\">\n + New Page\n </button>\n </div>\n </header>\n\n @if (isLoading()) {\n <div class=\"loading-state\">\n <p>Loading pages...</p>\n </div>\n } @else if (error()) {\n <div class=\"error-state\">\n <p>{{ error() }}</p>\n <button class=\"btn-secondary\" (click)=\"loadPages()\">Retry</button>\n </div>\n } @else if (pages().length === 0) {\n <div class=\"empty-state\">\n <div class=\"empty-icon\">📄</div>\n <h2>No pages yet</h2>\n <p>Create your first page to get started</p>\n <button class=\"btn-primary\" (click)=\"openCreateDialog()\">\n Create Page\n </button>\n </div>\n } @else {\n <div class=\"pages-table\">\n <div class=\"table-header\">\n <span class=\"col-title\">Title</span>\n <span class=\"col-slug\">Slug</span>\n <span class=\"col-status\">Status</span>\n <span class=\"col-updated\">Updated</span>\n <span class=\"col-actions\">Actions</span>\n </div>\n @for (page of pages(); track page.id) {\n <div class=\"table-row\" (click)=\"editPage(page.id)\">\n <span class=\"col-title\">{{ page.title }}</span>\n <span class=\"col-slug\">/pages/{{ page.slug }}</span>\n <span class=\"col-status\">\n <span class=\"status-badge\" [class.published]=\"page.status === 'published'\">\n {{ page.status }}\n </span>\n </span>\n <span class=\"col-updated\">{{ formatDate(page.updatedAt) }}</span>\n <span class=\"col-actions\">\n <button\n class=\"action-btn\"\n (click)=\"editPage(page.id); $event.stopPropagation()\"\n title=\"Edit\"\n >\n ✏️\n </button>\n <button\n class=\"action-btn\"\n (click)=\"duplicatePage(page.id, $event)\"\n title=\"Duplicate\"\n >\n 📋\n </button>\n <button\n class=\"action-btn delete\"\n (click)=\"confirmDelete(page, $event)\"\n title=\"Delete\"\n >\n 🗑️\n </button>\n </span>\n </div>\n }\n </div>\n }\n\n <!-- Create Page Dialog -->\n @if (showCreateDialog()) {\n <div class=\"dialog-overlay\" (click)=\"closeCreateDialog()\">\n <div class=\"dialog\" (click)=\"$event.stopPropagation()\">\n <div class=\"dialog-header\">\n <h2>Create New Page</h2>\n <button class=\"close-btn\" (click)=\"closeCreateDialog()\">×</button>\n </div>\n <form class=\"dialog-content\" (submit)=\"createPage($event)\">\n <div class=\"form-field\">\n <label for=\"pageTitle\">Title</label>\n <input\n id=\"pageTitle\"\n type=\"text\"\n [value]=\"newPageTitle()\"\n (input)=\"onTitleInput($event)\"\n placeholder=\"My New Page\"\n required\n />\n </div>\n <div class=\"form-field\">\n <label for=\"pageSlug\">Slug</label>\n <div class=\"slug-field\">\n <span class=\"slug-prefix\">/pages/</span>\n <input\n id=\"pageSlug\"\n type=\"text\"\n [value]=\"newPageSlug()\"\n (input)=\"onSlugInput($event)\"\n placeholder=\"my-new-page\"\n required\n pattern=\"[-a-z0-9]+\"\n />\n </div>\n </div>\n @if (createError()) {\n <div class=\"form-error\">{{ createError() }}</div>\n }\n <div class=\"dialog-actions\">\n <button type=\"button\" class=\"btn-secondary\" (click)=\"closeCreateDialog()\">\n Cancel\n </button>\n <button type=\"submit\" class=\"btn-primary\" [disabled]=\"isCreating()\">\n {{ isCreating() ? 'Creating...' : 'Create Page' }}\n </button>\n </div>\n </form>\n </div>\n </div>\n }\n\n <!-- Delete Confirmation Dialog -->\n @if (pageToDelete()) {\n <div class=\"dialog-overlay\" (click)=\"cancelDelete()\">\n <div class=\"dialog dialog-small\" (click)=\"$event.stopPropagation()\">\n <div class=\"dialog-header\">\n <h2>Delete Page</h2>\n <button class=\"close-btn\" (click)=\"cancelDelete()\">×</button>\n </div>\n <div class=\"dialog-content\">\n <p>Are you sure you want to delete \"{{ pageToDelete()!.title }}\"?</p>\n <p class=\"warning\">This action cannot be undone.</p>\n </div>\n <div class=\"dialog-actions\">\n <button class=\"btn-secondary\" (click)=\"cancelDelete()\">Cancel</button>\n <button class=\"btn-danger\" (click)=\"deletePage()\" [disabled]=\"isDeleting()\">\n {{ isDeleting() ? 'Deleting...' : 'Delete' }}\n </button>\n </div>\n </div>\n </div>\n }\n </div>\n `,\n styles: `\n :host {\n display: block;\n min-height: 100vh;\n background: #f0f2f5;\n }\n\n .page-manager {\n max-width: 1200px;\n margin: 0 auto;\n padding: 2rem;\n }\n\n .manager-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 2rem;\n }\n\n .header-actions {\n display: flex;\n gap: 0.75rem;\n align-items: center;\n }\n\n .manager-header h1 {\n margin: 0;\n font-size: 1.75rem;\n font-weight: 600;\n color: #1a1a2e;\n }\n\n .btn-primary {\n padding: 0.75rem 1.5rem;\n border: none;\n border-radius: 6px;\n background: #1a1a2e;\n color: #fff;\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s;\n }\n\n .btn-primary:hover {\n background: #2a2a3e;\n }\n\n .btn-primary:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n }\n\n .btn-secondary {\n padding: 0.75rem 1.5rem;\n border: 1px solid #e0e0e0;\n border-radius: 6px;\n background: #fff;\n color: #333;\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n }\n\n .btn-secondary:hover {\n background: #f5f5f5;\n }\n\n .btn-danger {\n padding: 0.75rem 1.5rem;\n border: none;\n border-radius: 6px;\n background: #e74c3c;\n color: #fff;\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s;\n }\n\n .btn-danger:hover {\n background: #c0392b;\n }\n\n .btn-danger:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n }\n\n /* States */\n .loading-state,\n .error-state,\n .empty-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 4rem 2rem;\n background: #fff;\n border-radius: 8px;\n text-align: center;\n }\n\n .empty-icon {\n font-size: 4rem;\n margin-bottom: 1rem;\n }\n\n .empty-state h2 {\n margin: 0 0 0.5rem;\n color: #333;\n }\n\n .empty-state p {\n margin: 0 0 1.5rem;\n color: #666;\n }\n\n .error-state {\n color: #e74c3c;\n }\n\n /* Table */\n .pages-table {\n background: #fff;\n border-radius: 8px;\n overflow: hidden;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n }\n\n .table-header,\n .table-row {\n display: grid;\n grid-template-columns: 1fr 150px 100px 150px 120px;\n gap: 1rem;\n padding: 1rem 1.5rem;\n align-items: center;\n }\n\n .table-header {\n background: #f8f9fa;\n font-size: 0.75rem;\n font-weight: 600;\n text-transform: uppercase;\n color: #666;\n letter-spacing: 0.5px;\n }\n\n .table-row {\n border-top: 1px solid #e0e0e0;\n cursor: pointer;\n transition: background 0.2s;\n }\n\n .table-row:hover {\n background: #f8f9fa;\n }\n\n .col-title {\n font-weight: 500;\n color: #333;\n }\n\n .col-slug {\n font-size: 0.8125rem;\n color: #666;\n font-family: monospace;\n }\n\n .status-badge {\n display: inline-block;\n padding: 0.25rem 0.5rem;\n border-radius: 4px;\n font-size: 0.75rem;\n font-weight: 500;\n text-transform: capitalize;\n background: #ffeaa7;\n color: #856404;\n }\n\n .status-badge.published {\n background: #d4edda;\n color: #155724;\n }\n\n .col-updated {\n font-size: 0.8125rem;\n color: #666;\n }\n\n .col-actions {\n display: flex;\n gap: 0.5rem;\n }\n\n .action-btn {\n padding: 0.375rem;\n border: none;\n border-radius: 4px;\n background: transparent;\n cursor: pointer;\n font-size: 1rem;\n transition: background 0.2s;\n }\n\n .action-btn:hover {\n background: #e0e0e0;\n }\n\n .action-btn.delete:hover {\n background: #fde2e2;\n }\n\n /* Dialog */\n .dialog-overlay {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n }\n\n .dialog {\n background: #fff;\n border-radius: 8px;\n width: 100%;\n max-width: 480px;\n box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);\n }\n\n .dialog-small {\n max-width: 400px;\n }\n\n .dialog-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 1.5rem;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .dialog-header h2 {\n margin: 0;\n font-size: 1.25rem;\n font-weight: 600;\n }\n\n .close-btn {\n border: none;\n background: none;\n font-size: 1.5rem;\n cursor: pointer;\n color: #666;\n padding: 0;\n line-height: 1;\n }\n\n .close-btn:hover {\n color: #333;\n }\n\n .dialog-content {\n padding: 1.5rem;\n }\n\n .dialog-content p {\n margin: 0 0 0.5rem;\n color: #333;\n }\n\n .dialog-content .warning {\n color: #e74c3c;\n font-size: 0.875rem;\n }\n\n .form-field {\n margin-bottom: 1.25rem;\n }\n\n .form-field label {\n display: block;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n font-weight: 500;\n color: #333;\n }\n\n .form-field input {\n width: 100%;\n padding: 0.75rem;\n border: 1px solid #e0e0e0;\n border-radius: 6px;\n font-size: 0.875rem;\n transition: border-color 0.2s;\n }\n\n .form-field input:focus {\n outline: none;\n border-color: #1a1a2e;\n }\n\n .slug-field {\n display: flex;\n align-items: center;\n border: 1px solid #e0e0e0;\n border-radius: 6px;\n overflow: hidden;\n }\n\n .slug-field:focus-within {\n border-color: #1a1a2e;\n }\n\n .slug-prefix {\n padding: 0.75rem;\n background: #f5f5f5;\n color: #666;\n font-size: 0.875rem;\n font-family: monospace;\n }\n\n .slug-field input {\n border: none;\n border-radius: 0;\n }\n\n .slug-field input:focus {\n border-color: transparent;\n }\n\n .form-error {\n margin-bottom: 1rem;\n padding: 0.75rem;\n background: #fde2e2;\n border-radius: 6px;\n color: #e74c3c;\n font-size: 0.875rem;\n }\n\n .dialog-actions {\n display: flex;\n justify-content: flex-end;\n gap: 0.75rem;\n padding: 1.5rem;\n border-top: 1px solid #e0e0e0;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PageManagerComponent implements OnInit {\n private readonly facade = inject(VisualEditorFacade);\n private readonly navigation = inject(VisualEditorNavigation);\n\n // State\n readonly pages = signal<PageSummary[]>([]);\n readonly isLoading = signal(false);\n readonly error = signal<string | null>(null);\n\n // Create dialog\n readonly showCreateDialog = signal(false);\n readonly newPageTitle = signal('');\n readonly newPageSlug = signal('');\n readonly isCreating = signal(false);\n readonly createError = signal<string | null>(null);\n\n // Delete dialog\n readonly pageToDelete = signal<PageSummary | null>(null);\n readonly isDeleting = signal(false);\n\n ngOnInit(): void {\n this.loadPages();\n }\n\n loadPages(): void {\n this.isLoading.set(true);\n this.error.set(null);\n\n this.facade.getPages().subscribe({\n next: (pages) => {\n this.pages.set(pages);\n this.isLoading.set(false);\n },\n error: (err) => {\n this.error.set(err.message || 'Failed to load pages');\n this.isLoading.set(false);\n },\n });\n }\n\n openSetup(): void {\n this.navigation.navigate({ type: 'setup' });\n }\n\n openCreateDialog(): void {\n this.showCreateDialog.set(true);\n this.newPageTitle.set('');\n this.newPageSlug.set('');\n this.createError.set(null);\n }\n\n closeCreateDialog(): void {\n this.showCreateDialog.set(false);\n }\n\n onTitleInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.newPageTitle.set(input.value);\n\n // Auto-generate slug from title\n const slug = input.value\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-|-$/g, '');\n this.newPageSlug.set(slug);\n }\n\n onSlugInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.newPageSlug.set(input.value);\n }\n\n createPage(event: Event): void {\n event.preventDefault();\n\n const title = this.newPageTitle().trim();\n const slug = this.newPageSlug().trim();\n\n if (!title || !slug) {\n this.createError.set('Title and slug are required');\n return;\n }\n\n this.isCreating.set(true);\n this.createError.set(null);\n\n this.facade.createPage({ title, slug }).subscribe({\n next: (page) => {\n this.isCreating.set(false);\n this.closeCreateDialog();\n this.navigation.navigate({ type: 'page-edit', pageId: page.id });\n },\n error: (err) => {\n this.createError.set(err.message || 'Failed to create page');\n this.isCreating.set(false);\n },\n });\n }\n\n editPage(pageId: string): void {\n this.navigation.navigate({ type: 'page-edit', pageId });\n }\n\n duplicatePage(pageId: string, event: Event): void {\n event.stopPropagation();\n\n this.facade.duplicatePage(pageId).subscribe({\n next: () => {\n this.loadPages();\n },\n error: (err) => {\n console.error('Failed to duplicate page:', err);\n },\n });\n }\n\n confirmDelete(page: PageSummary, event: Event): void {\n event.stopPropagation();\n this.pageToDelete.set(page);\n }\n\n cancelDelete(): void {\n this.pageToDelete.set(null);\n }\n\n deletePage(): void {\n const page = this.pageToDelete();\n if (!page) return;\n\n this.isDeleting.set(true);\n\n this.facade.deletePage(page.id).subscribe({\n next: () => {\n this.isDeleting.set(false);\n this.pageToDelete.set(null);\n this.loadPages();\n },\n error: (err) => {\n console.error('Failed to delete page:', err);\n this.isDeleting.set(false);\n },\n });\n }\n\n formatDate(dateString: string): string {\n const date = new Date(dateString);\n return date.toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n });\n }\n}\n","import { HttpClient, HttpErrorResponse } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { Observable, throwError } from 'rxjs';\nimport { catchError, map } from 'rxjs/operators';\nimport { STOREFRONT_CONFIG, StorefrontConfig } from '../models/page.model';\n\ninterface GraphQLRequest {\n query: string;\n variables?: Record<string, any>;\n}\n\ninterface GraphQLResponse<T = any> {\n data?: T;\n errors?: Array<{\n message: string;\n locations?: Array<{ line: number; column: number }>;\n path?: string[];\n extensions?: Record<string, any>;\n }>;\n}\n\n/**\n * Read-only GraphQL client for the Shopify Storefront API.\n * Uses a Storefront Access Token (public, non-secret) instead of Admin API credentials.\n */\n@Injectable({ providedIn: 'root' })\nexport class StorefrontGraphQLClient {\n private readonly http = inject(HttpClient);\n private readonly config = inject(STOREFRONT_CONFIG);\n\n query<T>(query: string, variables?: Record<string, any>): Observable<T> {\n const url = this.config.proxyUrl\n ? this.config.proxyUrl\n : `https://${this.config.shopDomain}/api/${this.config.apiVersion}/graphql.json`;\n\n const request: GraphQLRequest = { query, variables };\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n };\n\n if (!this.config.proxyUrl) {\n headers['X-Shopify-Storefront-Access-Token'] = this.config.storefrontAccessToken;\n }\n\n return this.http.post<GraphQLResponse<T>>(url, request, { headers }).pipe(\n map(response => this.handleResponse<T>(response)),\n catchError(error => this.handleError(error))\n );\n }\n\n private handleResponse<T>(response: GraphQLResponse<T>): T {\n if (response.errors && response.errors.length > 0) {\n throw {\n code: 'GRAPHQL_ERROR',\n message: response.errors[0].message,\n errors: response.errors,\n };\n }\n\n if (!response.data) {\n throw {\n code: 'EMPTY_RESPONSE',\n message: 'GraphQL response contains no data',\n };\n }\n\n return response.data;\n }\n\n private handleError(error: HttpErrorResponse): Observable<never> {\n let errorCode = 'UNKNOWN_ERROR';\n let errorMessage = 'An unknown error occurred';\n\n if (typeof ErrorEvent !== 'undefined' && error.error instanceof ErrorEvent) {\n errorCode = 'NETWORK_ERROR';\n errorMessage = error.error.message;\n } else {\n switch (error.status) {\n case 401:\n errorCode = 'UNAUTHORIZED';\n errorMessage = 'Invalid or expired storefront access token';\n break;\n case 402:\n errorCode = 'PAYMENT_REQUIRED';\n errorMessage = 'Storefront API access requires a Shopify plan';\n break;\n case 429:\n errorCode = 'RATE_LIMIT';\n errorMessage = 'Rate limit exceeded';\n break;\n case 500:\n case 502:\n case 503:\n case 504:\n errorCode = 'SERVER_ERROR';\n errorMessage = 'Shopify server error';\n break;\n default:\n errorCode = 'HTTP_ERROR';\n errorMessage = `HTTP ${error.status}: ${error.statusText}`;\n }\n }\n\n return throwError(() => ({\n code: errorCode,\n message: errorMessage,\n status: error.status,\n original: error,\n }));\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { Page, PagesIndex } from '../models/page.model';\nimport { StorefrontGraphQLClient } from './storefront-graphql-client.service';\n\nconst NAMESPACE = 'kustomizer';\nconst INDEX_KEY = 'pages_index';\n\n/**\n * Storefront API query for reading shop metafields.\n * Uses `shop.metafield(namespace, key)` — the Storefront API equivalent\n * of the Admin API's shop metafield query.\n */\nconst GET_SHOP_METAFIELD_QUERY = `\n query GetShopMetafield($namespace: String!, $key: String!) {\n shop {\n metafield(namespace: $namespace, key: $key) {\n value\n type\n }\n }\n }\n`;\n\ninterface StorefrontMetafieldResponse {\n shop: {\n metafield: {\n value: string;\n type: string;\n } | null;\n };\n}\n\n/**\n * Read-only metafield repository using the Shopify Storefront API.\n * Only works for metafields with MetafieldDefinitions that have `access.storefront: PUBLIC_READ`.\n */\n@Injectable({ providedIn: 'root' })\nexport class StorefrontMetafieldRepository {\n private readonly client = inject(StorefrontGraphQLClient);\n\n getMetafield(namespace: string, key: string): Observable<{ value: string; type: string } | null> {\n return this.client.query<StorefrontMetafieldResponse>(GET_SHOP_METAFIELD_QUERY, { namespace, key }).pipe(\n map(response => response.shop.metafield),\n );\n }\n\n getPageIndex(): Observable<PagesIndex> {\n return this.getMetafield(NAMESPACE, INDEX_KEY).pipe(\n map(metafield => {\n if (!metafield) {\n return this.getDefaultIndex();\n }\n\n try {\n const parsed = JSON.parse(metafield.value);\n if (!parsed.pages || !Array.isArray(parsed.pages)) {\n throw new Error('Invalid index structure');\n }\n return parsed as PagesIndex;\n } catch (error) {\n throw {\n code: 'INDEX_PARSE_ERROR',\n message: 'Stored index data is corrupted',\n original: error,\n };\n }\n }),\n );\n }\n\n getPageMetafield(pageId: string): Observable<Page | null> {\n const key = `page_${pageId}`;\n return this.getMetafield(NAMESPACE, key).pipe(\n map(metafield => {\n if (!metafield) {\n return null;\n }\n\n try {\n return JSON.parse(metafield.value) as Page;\n } catch (error) {\n throw {\n code: 'PAGE_PARSE_ERROR',\n message: 'Stored page data is corrupted',\n original: error,\n };\n }\n }),\n );\n }\n\n private getDefaultIndex(): PagesIndex {\n return {\n version: 0,\n lastUpdated: new Date().toISOString(),\n pages: [],\n };\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { Observable, throwError } from 'rxjs';\nimport { map, switchMap } from 'rxjs/operators';\nimport { Page, PageSummary, PagesIndex } from '../models/page.model';\nimport { StorefrontMetafieldRepository } from './storefront-metafield-repository.service';\n\n/**\n * Read-only page repository using the Shopify Storefront API.\n * Used by the public-storefront to read published pages without Admin API access.\n */\n@Injectable({ providedIn: 'root' })\nexport class PageStorefrontRepository {\n private readonly metafieldRepo = inject(StorefrontMetafieldRepository);\n\n getPages(): Observable<PageSummary[]> {\n return this.metafieldRepo.getPageIndex().pipe(\n map(index =>\n index.pages\n .map(entry => ({\n id: entry.id,\n slug: entry.slug,\n title: entry.title,\n status: entry.status,\n updatedAt: entry.updatedAt,\n publishedAt: entry.publishedAt,\n }))\n .sort((a, b) => b.updatedAt.localeCompare(a.updatedAt))\n ),\n );\n }\n\n getPublishedPages(): Observable<PageSummary[]> {\n return this.getPages().pipe(\n map(pages => pages.filter(p => p.status === 'published')),\n );\n }\n\n getPage(id: string): Observable<Page> {\n return this.metafieldRepo.getPageMetafield(id).pipe(\n map(page => {\n if (!page) {\n throw {\n code: 'PAGE_NOT_FOUND',\n message: `Page with id ${id} not found`,\n };\n }\n return page;\n }),\n );\n }\n\n getPublishedPageBySlug(slug: string): Observable<Page> {\n return this.metafieldRepo.getPageIndex().pipe(\n switchMap(index => {\n const entry = index.pages.find(\n p => p.slug === slug && p.status === 'published',\n );\n\n if (!entry) {\n return throwError(() => ({\n code: 'PAGE_NOT_FOUND',\n message: `Published page with slug '${slug}' not found`,\n }));\n }\n\n return this.getPage(entry.id);\n }),\n );\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { Observable, tap } from 'rxjs';\nimport { ComponentManifest, ComponentManifestEntry } from '../models/component-manifest.model';\nimport { ComponentRegistryService } from '../registry/component-registry.service';\nimport { ComponentDefinition } from '../registry/component-definition.types';\n\n/**\n * Loads a component manifest from a remote storefront URL and registers\n * the entries in the ComponentRegistryService as \"virtual\" definitions\n * (no Angular component class — only metadata for palette and property panel).\n */\n@Injectable({ providedIn: 'root' })\nexport class ManifestLoaderService {\n private readonly http = inject(HttpClient);\n private readonly registry = inject(ComponentRegistryService);\n\n /**\n * Fetch the manifest from the given URL and register all components.\n */\n loadManifest(url: string): Observable<ComponentManifest> {\n return this.http.get<ComponentManifest>(url).pipe(\n tap((manifest) => this.registerManifestComponents(manifest)),\n );\n }\n\n /**\n * Register manifest entries in the ComponentRegistryService.\n * Each entry becomes a ComponentDefinition without a `component` field.\n */\n registerManifestComponents(manifest: ComponentManifest): void {\n for (const entry of manifest.components) {\n const definition = this.manifestEntryToDefinition(entry);\n this.registry.register(definition);\n }\n }\n\n private manifestEntryToDefinition(entry: ComponentManifestEntry): ComponentDefinition {\n return {\n type: entry.type,\n name: entry.name,\n description: entry.description,\n category: entry.category,\n icon: entry.icon,\n props: entry.props,\n slots: entry.slots,\n isSection: entry.isSection,\n isBlock: entry.isBlock,\n blockScope: entry.blockScope,\n sectionTypes: entry.sectionTypes,\n draggable: entry.draggable,\n deletable: entry.deletable,\n duplicable: entry.duplicable,\n tags: entry.tags,\n order: entry.order,\n // No `component` — rendering happens in the iframe\n };\n }\n}\n","import { Component } from '@angular/core';\n\n@Component({\n selector: 'lib-visual-editor',\n imports: [],\n template: `\n <p>\n visual-editor works!\n </p>\n `,\n styles: ``,\n})\nexport class VisualEditor {\n\n}\n","/*\n * Public API Surface of visual-editor\n */\n\n// Main provider function\nexport { provideVisualEditor } from './lib/provide-visual-editor';\n\n// Store (state, actions, reducer, selectors)\nexport * from './lib/store';\n\n// Registry (component definitions, providers)\nexport * from './lib/registry';\n\n// Components (VisualEditor, PageManager, DynamicRenderer, etc.)\nexport * from './lib/components';\n\n// Services (VisualEditorFacade, PageService)\nexport * from './lib/services';\n\n// Models (Page types, injection tokens)\nexport * from './lib/models';\n\n// Navigation (abstract service, default implementation)\nexport * from './lib/navigation';\n\n// Page Loading (strategies for loading pages)\nexport * from './lib/page-loading';\n\n// Configuration (types, injection tokens)\nexport * from './lib/config';\n\n// Drag & Drop (service, types)\nexport * from './lib/dnd';\n\n// Legacy export for backwards compatibility\nexport * from './lib/visual-editor';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["map","NAMESPACE","INDEX_KEY","GET_SHOP_METAFIELD_QUERY","findElementRecursive","switchMap"],"mappings":";;;;;;;;;;AAqBA;;;AAGG;MACmB,sBAAsB,CAAA;AAiB3C;;ACnBD;;AAEG;AACI,MAAM,gCAAgC,GAA2B;AACtE,IAAA,YAAY,EAAE,QAAQ;AACtB,IAAA,YAAY,EAAE,sBAAsB;AACpC,IAAA,WAAW,EAAE,QAAQ;;AAGvB;;AAEG;MACU,wBAAwB,GAAG,IAAI,cAAc,CACxD,0BAA0B,EAC1B;AACE,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,gCAAgC;AAChD,CAAA;AAGH;;AAEG;AAEG,MAAO,8BAA+B,SAAQ,sBAAsB,CAAA;AACvD,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,IAAA,MAAM,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAE1D,IAAA,QAAQ,CAAC,MAAoC,EAAA;AAC3C,QAAA,QAAQ,MAAM,CAAC,IAAI;AACjB,YAAA,KAAK,WAAW;AACd,gBAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,CA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AA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAGU,YAAY,EAAA,UAAA,EAAA,CAAA;kBAVxB,SAAS;+BACE,mBAAmB,EAAA,OAAA,EACpB,EAAE,EAAA,QAAA,EACD;;;;AAIT,EAAA,CAAA,EAAA;;;ACTH;;AAEG;AAEH;;ACJA;;AAEG;;;;"}
1
+ {"version":3,"file":"kustomizer-visual-editor.mjs","sources":["../../../projects/visual-editor/src/lib/navigation/visual-editor-navigation.types.ts","../../../projects/visual-editor/src/lib/navigation/default-router-navigation.service.ts","../../../projects/visual-editor/src/lib/services/page-memory.repository.ts","../../../projects/visual-editor/src/lib/models/page.model.ts","../../../projects/visual-editor/src/lib/services/shopify-graphql-client.service.ts","../../../projects/visual-editor/src/lib/services/shopify-metafield-repository.service.ts","../../../projects/visual-editor/src/lib/services/page-shopify-repository.service.ts","../../../projects/visual-editor/src/lib/services/page.service.ts","../../../projects/visual-editor/src/lib/page-loading/page-loading-strategy.types.ts","../../../projects/visual-editor/src/lib/config/visual-editor-config.types.ts","../../../projects/visual-editor/src/lib/provide-visual-editor.ts","../../../projects/visual-editor/src/lib/store/visual-editor.state.ts","../../../projects/visual-editor/src/lib/store/visual-editor.actions.ts","../../../projects/visual-editor/src/lib/store/visual-editor.reducer.ts","../../../projects/visual-editor/src/lib/store/visual-editor.selectors.ts","../../../projects/visual-editor/src/lib/store/provide-visual-editor-store.ts","../../../projects/visual-editor/src/lib/registry/provide-editor-components.ts","../../../projects/visual-editor/src/lib/registry/component-registry.service.ts","../../../projects/visual-editor/src/lib/components/dynamic-renderer.component.ts","../../../projects/visual-editor/src/lib/components/slot-renderer.component.ts","../../../projects/visual-editor/src/lib/services/visual-editor-facade.service.ts","../../../projects/visual-editor/src/lib/services/iframe-bridge.service.ts","../../../projects/visual-editor/src/lib/services/storefront-url.service.ts","../../../projects/visual-editor/src/lib/dnd/drag-drop.service.ts","../../../projects/visual-editor/src/lib/components/editor/block-tree-item.component.ts","../../../projects/visual-editor/src/lib/services/shopify-files.service.ts","../../../projects/visual-editor/src/lib/components/editor/shopify-file-picker.component.ts","../../../projects/visual-editor/src/lib/components/editor/visual-editor.component.ts","../../../projects/visual-editor/src/lib/components/page-manager/page-manager.component.ts","../../../projects/visual-editor/src/lib/services/storefront-graphql-client.service.ts","../../../projects/visual-editor/src/lib/services/storefront-metafield-repository.service.ts","../../../projects/visual-editor/src/lib/services/page-storefront-repository.service.ts","../../../projects/visual-editor/src/lib/services/manifest-loader.service.ts","../../../projects/visual-editor/src/lib/visual-editor.ts","../../../projects/visual-editor/src/public-api.ts","../../../projects/visual-editor/src/kustomizer-visual-editor.ts"],"sourcesContent":["import { Observable } from 'rxjs';\n\n/**\n * Navigation target for the visual editor\n */\nexport type VisualEditorNavigationTarget =\n | { type: 'page-list' }\n | { type: 'page-edit'; pageId: string }\n | { type: 'page-preview'; pageId: string }\n | { type: 'setup' };\n\n/**\n * Confirmation dialog options\n */\nexport interface ConfirmDialogOptions {\n title: string;\n message: string;\n confirmText?: string;\n cancelText?: string;\n}\n\n/**\n * Abstract navigation service that consumers can implement\n * to customize how the visual editor navigates between views\n */\nexport abstract class VisualEditorNavigation {\n /**\n * Navigate to a target within the editor context\n */\n abstract navigate(target: VisualEditorNavigationTarget): void;\n\n /**\n * Show a confirmation dialog\n * Returns Observable<boolean> to support async dialogs (e.g., Material Dialog)\n */\n abstract confirm(options: ConfirmDialogOptions): Observable<boolean>;\n\n /**\n * Get the current page ID from the navigation context\n * Returns null if not on a page edit route\n */\n abstract getCurrentPageId(): Observable<string | null>;\n}\n","import { inject, Injectable, InjectionToken } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { map, Observable, of, startWith } from 'rxjs';\nimport {\n ConfirmDialogOptions,\n VisualEditorNavigation,\n VisualEditorNavigationTarget,\n} from './visual-editor-navigation.types';\n\n/**\n * Configuration for the default router navigation\n */\nexport interface RouterNavigationConfig {\n /** Route path for page list (default: '/admin') */\n pageListPath: string;\n /** Route path pattern for page edit (default: '/admin/pages/:pageId') */\n pageEditPath: string;\n /** Route path pattern for preview (optional) */\n pagePreviewPath?: string;\n /** Route param name for page ID (default: 'pageId') */\n pageIdParam: string;\n}\n\n/**\n * Default router navigation configuration\n */\nexport const DEFAULT_ROUTER_NAVIGATION_CONFIG: RouterNavigationConfig = {\n pageListPath: '/admin',\n pageEditPath: '/admin/pages/:pageId',\n pageIdParam: 'pageId',\n};\n\n/**\n * Injection token for router navigation configuration\n */\nexport const ROUTER_NAVIGATION_CONFIG = new InjectionToken<RouterNavigationConfig>(\n 'ROUTER_NAVIGATION_CONFIG',\n {\n providedIn: 'root',\n factory: () => DEFAULT_ROUTER_NAVIGATION_CONFIG,\n }\n);\n\n/**\n * Default navigation service implementation using Angular Router\n */\n@Injectable()\nexport class DefaultRouterNavigationService extends VisualEditorNavigation {\n private readonly router = inject(Router);\n private readonly route = inject(ActivatedRoute);\n private readonly config = inject(ROUTER_NAVIGATION_CONFIG);\n\n navigate(target: VisualEditorNavigationTarget): void {\n switch (target.type) {\n case 'page-list':\n this.router.navigate([this.config.pageListPath]);\n break;\n case 'page-edit': {\n const editPath = this.config.pageEditPath.replace(\n `:${this.config.pageIdParam}`,\n target.pageId\n );\n this.router.navigate([editPath]);\n break;\n }\n case 'page-preview':\n if (this.config.pagePreviewPath) {\n const previewPath = this.config.pagePreviewPath.replace(\n `:${this.config.pageIdParam}`,\n target.pageId\n );\n this.router.navigate([previewPath]);\n }\n break;\n case 'setup':\n this.router.navigate(['/setup']);\n break;\n }\n }\n\n confirm(options: ConfirmDialogOptions): Observable<boolean> {\n // Default to window.confirm - consumers can override with custom dialogs\n // eslint-disable-next-line no-restricted-globals\n return of(confirm(options.message));\n }\n\n getCurrentPageId(): Observable<string | null> {\n // Extract pageId from URL using the configured path pattern\n const extractPageIdFromUrl = (): string | null => {\n const url = this.router.url;\n // Convert pageEditPath pattern to regex\n // e.g., '/admin/pages/:pageId' -> /\\/admin\\/pages\\/([^\\/]+)/\n const paramPlaceholder = `:${this.config.pageIdParam}`;\n const pattern = this.config.pageEditPath\n .replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&') // Escape regex special chars\n .replace(paramPlaceholder.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), '([^/]+)');\n\n const regex = new RegExp(pattern);\n const match = url.match(regex);\n return match ? match[1] : null;\n };\n\n // Emit initial value immediately, then on each navigation event\n return this.router.events.pipe(\n startWith(null), // Trigger initial emission\n map(() => extractPageIdFromUrl())\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport { Observable, of, delay, throwError } from 'rxjs';\nimport {\n CreatePageRequest,\n Page,\n PageSummary,\n PublishPageRequest,\n UpdatePageRequest,\n} from '../models/page.model';\n\n/**\n * In-memory page repository for development/testing.\n * Simulates backend API with artificial delay.\n */\n@Injectable({ providedIn: 'root' })\nexport class PageMemoryRepository {\n private pages: Map<string, Page> = new Map();\n private readonly DELAY_MS = 300;\n\n constructor() {\n this.seedData();\n }\n\n private seedData(): void {\n const samplePages: Page[] = [\n {\n id: 'page-1',\n slug: 'home',\n title: 'Home Page',\n description: 'The main landing page',\n sections: [\n {\n id: 'section-1',\n type: 'hero-section',\n props: {\n title: 'Welcome to Our Store',\n subtitle: 'Discover amazing products',\n ctaText: 'Shop Now',\n ctaUrl: '/products',\n backgroundImage: '',\n backgroundColor: '#1a1a2e',\n },\n elements: [],\n },\n ],\n status: 'published',\n createdAt: '2024-01-15T10:00:00Z',\n updatedAt: '2024-01-20T14:30:00Z',\n publishedAt: '2024-01-20T14:30:00Z',\n version: 3,\n },\n {\n id: 'page-2',\n slug: 'about',\n title: 'About Us',\n description: 'Learn more about our company',\n sections: [\n {\n id: 'section-2',\n type: 'hero-section',\n props: {\n title: 'About Our Company',\n subtitle: 'Building the future, one product at a time',\n ctaText: 'Contact Us',\n ctaUrl: '/contact',\n backgroundColor: '#2d3436',\n },\n elements: [],\n },\n {\n id: 'section-3',\n type: 'features-grid',\n props: {\n title: 'Our Values',\n columns: 3,\n },\n elements: [\n {\n id: 'feature-1',\n type: 'feature-item',\n slotName: 'features',\n props: {\n icon: '🎯',\n title: 'Quality First',\n description: 'We never compromise on quality',\n },\n },\n {\n id: 'feature-2',\n type: 'feature-item',\n slotName: 'features',\n props: {\n icon: '💡',\n title: 'Innovation',\n description: 'Always pushing boundaries',\n },\n },\n {\n id: 'feature-3',\n type: 'feature-item',\n slotName: 'features',\n props: {\n icon: '🤝',\n title: 'Trust',\n description: 'Building lasting relationships',\n },\n },\n ],\n },\n ],\n status: 'draft',\n createdAt: '2024-02-01T09:00:00Z',\n updatedAt: '2024-02-05T11:00:00Z',\n version: 2,\n },\n {\n id: 'page-3',\n slug: 'contact',\n title: 'Contact Us',\n description: 'Get in touch with our team',\n sections: [],\n status: 'draft',\n createdAt: '2024-02-10T08:00:00Z',\n updatedAt: '2024-02-10T08:00:00Z',\n version: 1,\n },\n ];\n\n samplePages.forEach((page) => this.pages.set(page.id, page));\n }\n\n private generateId(): string {\n return `page-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;\n }\n\n private toSummary(page: Page): PageSummary {\n return {\n id: page.id,\n slug: page.slug,\n title: page.title,\n status: page.status,\n updatedAt: page.updatedAt,\n publishedAt: page.publishedAt,\n };\n }\n\n getPages(): Observable<PageSummary[]> {\n const summaries = Array.from(this.pages.values())\n .map((p) => this.toSummary(p))\n .sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime());\n return of(summaries).pipe(delay(this.DELAY_MS));\n }\n\n getPage(id: string): Observable<Page> {\n const page = this.pages.get(id);\n if (!page) {\n return throwError(() => new Error(`Page not found: ${id}`)).pipe(delay(this.DELAY_MS));\n }\n return of(structuredClone(page)).pipe(delay(this.DELAY_MS));\n }\n\n getPublishedPageBySlug(slug: string): Observable<Page> {\n const page = Array.from(this.pages.values()).find(\n (p) => p.slug === slug && p.status === 'published'\n );\n if (!page) {\n return throwError(() => new Error(`Published page not found: ${slug}`)).pipe(\n delay(this.DELAY_MS)\n );\n }\n return of(structuredClone(page)).pipe(delay(this.DELAY_MS));\n }\n\n createPage(request: CreatePageRequest): Observable<Page> {\n // Check for duplicate slug\n const existingSlug = Array.from(this.pages.values()).find((p) => p.slug === request.slug);\n if (existingSlug) {\n return throwError(() => new Error(`Slug already exists: ${request.slug}`)).pipe(\n delay(this.DELAY_MS)\n );\n }\n\n const now = new Date().toISOString();\n const page: Page = {\n id: this.generateId(),\n slug: request.slug,\n title: request.title,\n description: request.description,\n sections: [],\n status: 'draft',\n createdAt: now,\n updatedAt: now,\n version: 1,\n };\n\n this.pages.set(page.id, page);\n console.log('[PageMemoryRepository] Created page:', page.id, page.title);\n return of(structuredClone(page)).pipe(delay(this.DELAY_MS));\n }\n\n updatePage(id: string, request: UpdatePageRequest): Observable<Page> {\n const page = this.pages.get(id);\n if (!page) {\n return throwError(() => new Error(`Page not found: ${id}`)).pipe(delay(this.DELAY_MS));\n }\n\n // Optimistic locking check\n if (request.version !== page.version) {\n return throwError(\n () => new Error(`Version conflict. Expected ${page.version}, got ${request.version}`)\n ).pipe(delay(this.DELAY_MS));\n }\n\n // Check for duplicate slug if changing\n if (request.slug && request.slug !== page.slug) {\n const existingSlug = Array.from(this.pages.values()).find(\n (p) => p.slug === request.slug && p.id !== id\n );\n if (existingSlug) {\n return throwError(() => new Error(`Slug already exists: ${request.slug}`)).pipe(\n delay(this.DELAY_MS)\n );\n }\n }\n\n const updatedPage: Page = {\n ...page,\n title: request.title ?? page.title,\n slug: request.slug ?? page.slug,\n description: request.description ?? page.description,\n sections: request.sections ?? page.sections,\n updatedAt: new Date().toISOString(),\n version: page.version + 1,\n };\n\n this.pages.set(id, updatedPage);\n console.log('[PageMemoryRepository] Updated page:', id, 'v' + updatedPage.version);\n console.log('[PageMemoryRepository] Sections JSON:', JSON.stringify(updatedPage.sections, null, 2));\n return of(structuredClone(updatedPage)).pipe(delay(this.DELAY_MS));\n }\n\n deletePage(id: string): Observable<void> {\n if (!this.pages.has(id)) {\n return throwError(() => new Error(`Page not found: ${id}`)).pipe(delay(this.DELAY_MS));\n }\n\n this.pages.delete(id);\n console.log('[PageMemoryRepository] Deleted page:', id);\n return of(undefined).pipe(delay(this.DELAY_MS));\n }\n\n publishPage(id: string, request: PublishPageRequest): Observable<Page> {\n const page = this.pages.get(id);\n if (!page) {\n return throwError(() => new Error(`Page not found: ${id}`)).pipe(delay(this.DELAY_MS));\n }\n\n if (request.version !== page.version) {\n return throwError(\n () => new Error(`Version conflict. Expected ${page.version}, got ${request.version}`)\n ).pipe(delay(this.DELAY_MS));\n }\n\n const now = new Date().toISOString();\n const updatedPage: Page = {\n ...page,\n status: 'published',\n publishedAt: now,\n updatedAt: now,\n version: page.version + 1,\n };\n\n this.pages.set(id, updatedPage);\n console.log('[PageMemoryRepository] Published page:', id);\n return of(structuredClone(updatedPage)).pipe(delay(this.DELAY_MS));\n }\n\n unpublishPage(id: string, request: PublishPageRequest): Observable<Page> {\n const page = this.pages.get(id);\n if (!page) {\n return throwError(() => new Error(`Page not found: ${id}`)).pipe(delay(this.DELAY_MS));\n }\n\n if (request.version !== page.version) {\n return throwError(\n () => new Error(`Version conflict. Expected ${page.version}, got ${request.version}`)\n ).pipe(delay(this.DELAY_MS));\n }\n\n const updatedPage: Page = {\n ...page,\n status: 'draft',\n updatedAt: new Date().toISOString(),\n version: page.version + 1,\n };\n\n this.pages.set(id, updatedPage);\n console.log('[PageMemoryRepository] Unpublished page:', id);\n return of(structuredClone(updatedPage)).pipe(delay(this.DELAY_MS));\n }\n\n duplicatePage(id: string): Observable<Page> {\n const page = this.pages.get(id);\n if (!page) {\n return throwError(() => new Error(`Page not found: ${id}`)).pipe(delay(this.DELAY_MS));\n }\n\n const now = new Date().toISOString();\n const newPage: Page = {\n ...structuredClone(page),\n id: this.generateId(),\n slug: `${page.slug}-copy-${Date.now()}`,\n title: `${page.title} (Copy)`,\n status: 'draft',\n createdAt: now,\n updatedAt: now,\n publishedAt: undefined,\n version: 1,\n };\n\n this.pages.set(newPage.id, newPage);\n console.log('[PageMemoryRepository] Duplicated page:', id, '->', newPage.id);\n return of(structuredClone(newPage)).pipe(delay(this.DELAY_MS));\n }\n\n // Utility method to reset to initial state (useful for testing)\n reset(): void {\n this.pages.clear();\n this.seedData();\n console.log('[PageMemoryRepository] Reset to initial state');\n }\n\n // Utility method to get all pages (useful for debugging)\n getAllPages(): Page[] {\n return Array.from(this.pages.values());\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { EditorSection } from '../store/visual-editor.state';\n\n/**\n * Shopify configuration for GraphQL API access\n */\nexport interface ShopifyConfig {\n shopDomain: string;\n accessToken: string;\n apiVersion: string;\n /** Optional proxy URL for development (bypasses CORS) */\n proxyUrl?: string;\n}\n\n/**\n * Injection token for Shopify configuration\n * Can be provided as a static object or as an Observable for dynamic config\n */\nexport const SHOPIFY_CONFIG = new InjectionToken<ShopifyConfig | Observable<ShopifyConfig>>('SHOPIFY_CONFIG', {\n providedIn: 'root',\n factory: () => ({\n shopDomain: '',\n accessToken: '',\n apiVersion: '2026-01',\n proxyUrl: '/shopify-api/graphql.json',\n }),\n});\n\n/**\n * Metafield representation from Shopify\n */\nexport interface Metafield {\n id: string;\n namespace: string;\n key: string;\n value: string;\n type: string;\n createdAt?: string;\n updatedAt?: string;\n}\n\n/**\n * Page status - draft pages are only visible in admin, published pages are public\n */\nexport type PageStatus = 'draft' | 'published';\n\n/**\n * Entry in the pages index (lightweight reference)\n */\nexport interface PageIndexEntry {\n id: string;\n slug: string;\n title: string;\n status: PageStatus;\n updatedAt: string;\n publishedAt?: string;\n size: number;\n /** MetafieldDefinition ID for this page's metafield (enables Storefront API access) */\n definitionId?: string;\n}\n\n/**\n * Index of all pages stored in a single metafield\n */\nexport interface PagesIndex {\n version: number;\n lastUpdated: string;\n pages: PageIndexEntry[];\n}\n\n/**\n * Full page model with all content\n */\nexport interface Page {\n id: string;\n slug: string;\n title: string;\n description?: string;\n sections: EditorSection[];\n status: PageStatus;\n createdAt: string;\n updatedAt: string;\n publishedAt?: string;\n version: number;\n}\n\n/**\n * Lightweight page summary for listing\n */\nexport interface PageSummary {\n id: string;\n slug: string;\n title: string;\n status: PageStatus;\n updatedAt: string;\n publishedAt?: string;\n}\n\n/**\n * Page context stored in editor state (minimal info needed while editing)\n */\nexport interface PageContext {\n id: string;\n slug: string;\n title: string;\n status: PageStatus;\n version: number;\n}\n\n/**\n * Request payload for creating a new page\n */\nexport interface CreatePageRequest {\n title: string;\n slug: string;\n description?: string;\n}\n\n/**\n * Request payload for updating an existing page\n */\nexport interface UpdatePageRequest {\n title?: string;\n slug?: string;\n description?: string;\n sections?: EditorSection[];\n version: number;\n}\n\n/**\n * Request payload for publishing/unpublishing\n */\nexport interface PublishPageRequest {\n version: number;\n}\n\n/**\n * Shopify Storefront API configuration (read-only, public access)\n */\nexport interface StorefrontConfig {\n shopDomain: string;\n storefrontAccessToken: string;\n apiVersion: string;\n /** Optional proxy URL for SSR (avoids CORS) */\n proxyUrl?: string;\n}\n\n/**\n * Injection token for Storefront API configuration.\n * Used by the public-storefront to read metafields via the Storefront API.\n */\nexport const STOREFRONT_CONFIG = new InjectionToken<StorefrontConfig>('STOREFRONT_CONFIG');\n\n/**\n * Injection token for the client storefront URL.\n * The editor uses this to:\n * 1. Fetch the component manifest (`{url}/kustomizer/manifest.json`)\n * 2. Embed the live preview iframe (`{url}/kustomizer/editor`)\n */\nexport const STOREFRONT_URL = new InjectionToken<string>('STOREFRONT_URL', {\n providedIn: 'root',\n factory: () => '',\n});\n","import { HttpClient, HttpErrorResponse } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { Observable, throwError, isObservable } from 'rxjs';\nimport { catchError, map, switchMap } from 'rxjs/operators';\nimport { SHOPIFY_CONFIG, ShopifyConfig } from '../models/page.model';\n\ninterface GraphQLRequest {\n query: string;\n variables?: Record<string, any>;\n}\n\ninterface GraphQLResponse<T = any> {\n data?: T;\n errors?: Array<{\n message: string;\n locations?: Array<{ line: number; column: number }>;\n path?: string[];\n extensions?: Record<string, any>;\n }>;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ShopifyGraphQLClient {\n private readonly http = inject(HttpClient);\n private readonly config = inject(SHOPIFY_CONFIG);\n\n query<T>(query: string, variables?: Record<string, any>): Observable<T> {\n return this.executeOperation<T>(query, variables);\n }\n\n mutate<T>(mutation: string, variables?: Record<string, any>): Observable<T> {\n return this.executeOperation<T>(mutation, variables);\n }\n\n private executeOperation<T>(operation: string, variables?: Record<string, any>): Observable<T> {\n const config$ = isObservable(this.config)\n ? this.config as Observable<ShopifyConfig>\n : new Observable<ShopifyConfig>(subscriber => {\n subscriber.next(this.config as ShopifyConfig);\n subscriber.complete();\n });\n\n return config$.pipe(\n switchMap((config: ShopifyConfig) => {\n // Use proxy URL if available (for development), otherwise direct Shopify URL\n const url = config.proxyUrl\n ? config.proxyUrl\n : `https://${config.shopDomain}/admin/api/${config.apiVersion}/graphql.json`;\n\n const request: GraphQLRequest = {\n query: operation,\n variables,\n };\n\n // When using proxy, headers are set by the proxy config\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n };\n\n // Only add access token header when not using proxy\n if (!config.proxyUrl) {\n headers['X-Shopify-Access-Token'] = config.accessToken;\n }\n\n return this.http.post<GraphQLResponse<T>>(url, request, { headers }).pipe(\n map(response => this.handleResponse<T>(response)),\n catchError(error => this.handleError(error))\n );\n })\n );\n }\n\n private handleResponse<T>(response: GraphQLResponse<T>): T {\n if (response.errors && response.errors.length > 0) {\n throw {\n code: 'GRAPHQL_ERROR',\n message: response.errors[0].message,\n errors: response.errors,\n };\n }\n\n if (!response.data) {\n throw {\n code: 'EMPTY_RESPONSE',\n message: 'GraphQL response contains no data',\n };\n }\n\n return response.data;\n }\n\n private handleError(error: HttpErrorResponse): Observable<never> {\n let errorCode = 'UNKNOWN_ERROR';\n let errorMessage = 'An unknown error occurred';\n\n if (typeof ErrorEvent !== 'undefined' && error.error instanceof ErrorEvent) {\n errorCode = 'NETWORK_ERROR';\n errorMessage = error.error.message;\n } else {\n switch (error.status) {\n case 401:\n errorCode = 'UNAUTHORIZED';\n errorMessage = 'Invalid or expired access token';\n break;\n case 403:\n errorCode = 'FORBIDDEN';\n errorMessage = 'Insufficient permissions';\n break;\n case 429:\n errorCode = 'RATE_LIMIT';\n errorMessage = 'Rate limit exceeded';\n break;\n case 500:\n case 502:\n case 503:\n case 504:\n errorCode = 'SERVER_ERROR';\n errorMessage = 'Shopify server error';\n break;\n default:\n errorCode = 'HTTP_ERROR';\n errorMessage = `HTTP ${error.status}: ${error.statusText}`;\n }\n }\n\n return throwError(() => ({\n code: errorCode,\n message: errorMessage,\n status: error.status,\n original: error,\n }));\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { Observable, of, throwError } from 'rxjs';\nimport { map, switchMap } from 'rxjs/operators';\nimport { Metafield, Page, PagesIndex } from '../models/page.model';\nimport { ShopifyGraphQLClient } from './shopify-graphql-client.service';\n\nexport const NAMESPACE = 'kustomizer';\nexport const INDEX_KEY = 'pages_index';\nexport const MAX_METAFIELD_SIZE = 64 * 1024;\n\nexport const GET_SHOP_METAFIELD_QUERY = `\n query GetShopMetafield($namespace: String!, $key: String!) {\n shop {\n id\n metafield(namespace: $namespace, key: $key) {\n id\n value\n createdAt\n updatedAt\n }\n }\n }\n`;\n\nexport const SET_METAFIELD_MUTATION = `\n mutation SetMetafield($metafields: [MetafieldsSetInput!]!) {\n metafieldsSet(metafields: $metafields) {\n metafields {\n id\n namespace\n key\n value\n }\n userErrors {\n field\n message\n }\n }\n }\n`;\n\nexport const DELETE_METAFIELDS_MUTATION = `\n mutation DeleteMetafields($metafields: [MetafieldIdentifierInput!]!) {\n metafieldsDelete(metafields: $metafields) {\n deletedMetafields {\n key\n namespace\n }\n userErrors {\n field\n message\n }\n }\n }\n`;\n\nexport const CREATE_METAFIELD_DEFINITION_MUTATION = `\n mutation CreateMetafieldDefinition($definition: MetafieldDefinitionInput!) {\n metafieldDefinitionCreate(definition: $definition) {\n createdDefinition {\n id\n }\n userErrors {\n field\n message\n code\n }\n }\n }\n`;\n\nexport const DELETE_METAFIELD_DEFINITION_MUTATION = `\n mutation DeleteMetafieldDefinition($id: ID!) {\n metafieldDefinitionDelete(id: $id) {\n deletedDefinitionId\n userErrors {\n field\n message\n code\n }\n }\n }\n`;\n\nexport const GET_METAFIELD_DEFINITION_QUERY = `\n query GetMetafieldDefinition($ownerType: MetafieldOwnerType!, $namespace: String, $key: String!) {\n metafieldDefinition(identifier: { ownerType: $ownerType, namespace: $namespace, key: $key }) {\n id\n }\n }\n`;\n\nexport const GET_SHOP_ID_QUERY = `\n query GetShopId {\n shop {\n id\n }\n }\n`;\n\ninterface GetMetafieldResponse {\n shop: {\n id: string;\n metafield: {\n id: string;\n value: string;\n createdAt?: string;\n updatedAt?: string;\n } | null;\n };\n}\n\ninterface SetMetafieldResponse {\n metafieldsSet: {\n metafields: Array<{\n id: string;\n namespace: string;\n key: string;\n value: string;\n }>;\n userErrors: Array<{\n field: string;\n message: string;\n }>;\n };\n}\n\ninterface DeleteMetafieldsResponse {\n metafieldsDelete: {\n deletedMetafields: Array<{\n key: string;\n namespace: string;\n }>;\n userErrors: Array<{\n field: string;\n message: string;\n }>;\n };\n}\n\ninterface CreateMetafieldDefinitionResponse {\n metafieldDefinitionCreate: {\n createdDefinition: { id: string } | null;\n userErrors: Array<{\n field: string;\n message: string;\n code: string;\n }>;\n };\n}\n\ninterface DeleteMetafieldDefinitionResponse {\n metafieldDefinitionDelete: {\n deletedDefinitionId: string | null;\n userErrors: Array<{\n field: string;\n message: string;\n code: string;\n }>;\n };\n}\n\ninterface GetMetafieldDefinitionResponse {\n metafieldDefinition: { id: string } | null;\n}\n\ninterface GetShopIdResponse {\n shop: {\n id: string;\n };\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ShopifyMetafieldRepository {\n private readonly client = inject(ShopifyGraphQLClient);\n\n getMetafield(namespace: string, key: string): Observable<Metafield | null> {\n return this.client.query<GetMetafieldResponse>(GET_SHOP_METAFIELD_QUERY, { namespace, key }).pipe(\n map(response => {\n if (!response.shop.metafield) {\n return null;\n }\n\n return {\n id: response.shop.metafield.id,\n namespace,\n key,\n value: response.shop.metafield.value,\n type: 'json',\n createdAt: response.shop.metafield.createdAt,\n updatedAt: response.shop.metafield.updatedAt,\n };\n })\n );\n }\n\n setMetafield(namespace: string, key: string, value: any, ownerId: string): Observable<Metafield> {\n const valueString = typeof value === 'string' ? value : JSON.stringify(value);\n\n const validation = this.validateSize(value);\n if (!validation.valid) {\n return throwError(() => ({\n code: 'SIZE_EXCEEDED',\n message: `Metafield size exceeds ${MAX_METAFIELD_SIZE} bytes limit`,\n size: validation.size,\n maxSize: MAX_METAFIELD_SIZE,\n percentUsed: validation.percentUsed,\n }));\n }\n\n const metafields = [{\n namespace,\n key,\n value: valueString,\n type: 'json',\n ownerId,\n }];\n\n return this.client.mutate<SetMetafieldResponse>(SET_METAFIELD_MUTATION, { metafields }).pipe(\n map(response => {\n if (response.metafieldsSet.userErrors.length > 0) {\n throw {\n code: 'SHOPIFY_METAFIELD_ERROR',\n message: response.metafieldsSet.userErrors[0].message,\n errors: response.metafieldsSet.userErrors,\n };\n }\n\n const metafield = response.metafieldsSet.metafields[0];\n return {\n id: metafield.id,\n namespace: metafield.namespace,\n key: metafield.key,\n value: metafield.value,\n type: 'json',\n };\n })\n );\n }\n\n deleteMetafield(namespace: string, key: string): Observable<void> {\n return this.getShopId().pipe(\n switchMap(shopId => {\n const metafields = [{\n ownerId: shopId,\n namespace,\n key,\n }];\n\n return this.client.mutate<DeleteMetafieldsResponse>(DELETE_METAFIELDS_MUTATION, { metafields }).pipe(\n map(response => {\n if (response.metafieldsDelete.userErrors.length > 0) {\n throw {\n code: 'SHOPIFY_METAFIELD_ERROR',\n message: response.metafieldsDelete.userErrors[0].message,\n errors: response.metafieldsDelete.userErrors,\n };\n }\n })\n );\n })\n );\n }\n\n getShopId(): Observable<string> {\n return this.client.query<GetShopIdResponse>(GET_SHOP_ID_QUERY).pipe(\n map(response => response.shop.id)\n );\n }\n\n getPageIndex(): Observable<PagesIndex> {\n return this.getMetafield(NAMESPACE, INDEX_KEY).pipe(\n map(metafield => {\n if (!metafield) {\n return this.getDefaultIndex();\n }\n\n try {\n const parsed = JSON.parse(metafield.value);\n if (!parsed.pages || !Array.isArray(parsed.pages)) {\n throw new Error('Invalid index structure');\n }\n return parsed as PagesIndex;\n } catch (error) {\n throw {\n code: 'INDEX_PARSE_ERROR',\n message: 'Stored index data is corrupted',\n original: error,\n };\n }\n })\n );\n }\n\n updatePageIndex(index: PagesIndex): Observable<PagesIndex> {\n return this.getShopId().pipe(\n switchMap(shopId => {\n const updatedIndex: PagesIndex = {\n ...index,\n version: index.version + 1,\n lastUpdated: new Date().toISOString(),\n };\n\n return this.setMetafield(NAMESPACE, INDEX_KEY, updatedIndex, shopId).pipe(\n map(() => updatedIndex)\n );\n })\n );\n }\n\n getPageMetafield(pageId: string): Observable<Page | null> {\n const key = `page_${pageId}`;\n return this.getMetafield(NAMESPACE, key).pipe(\n map(metafield => {\n if (!metafield) {\n return null;\n }\n\n try {\n return JSON.parse(metafield.value) as Page;\n } catch (error) {\n throw {\n code: 'PAGE_PARSE_ERROR',\n message: 'Stored page data is corrupted',\n original: error,\n };\n }\n })\n );\n }\n\n setPageMetafield(pageId: string, page: Page): Observable<Page> {\n const key = `page_${pageId}`;\n return this.getShopId().pipe(\n switchMap(shopId => {\n return this.setMetafield(NAMESPACE, key, page, shopId).pipe(\n map(() => page)\n );\n })\n );\n }\n\n deletePageMetafield(pageId: string): Observable<void> {\n const key = `page_${pageId}`;\n return this.deleteMetafield(NAMESPACE, key);\n }\n\n /**\n * Create a MetafieldDefinition with PUBLIC_READ storefront access.\n * Idempotent: if definition already exists, returns the existing ID.\n */\n createMetafieldDefinition(namespace: string, key: string, name: string): Observable<string> {\n return this.client.mutate<CreateMetafieldDefinitionResponse>(CREATE_METAFIELD_DEFINITION_MUTATION, {\n definition: {\n namespace,\n key,\n name,\n ownerType: 'SHOP',\n type: 'json',\n access: {\n storefront: 'PUBLIC_READ',\n },\n },\n }).pipe(\n switchMap(response => {\n const { createdDefinition, userErrors } = response.metafieldDefinitionCreate;\n if (createdDefinition) {\n return of(createdDefinition.id);\n }\n // If definition already exists, look it up instead of failing\n const alreadyExists = userErrors.some(e => e.code === 'TAKEN' || e.code === 'ALREADY_EXISTS');\n if (alreadyExists) {\n return this.getMetafieldDefinitionId(namespace, key);\n }\n throw {\n code: 'METAFIELD_DEFINITION_ERROR',\n message: userErrors[0]?.message || 'Failed to create metafield definition',\n errors: userErrors,\n };\n })\n );\n }\n\n /**\n * Delete a MetafieldDefinition by ID. Does not delete associated metafields.\n */\n deleteMetafieldDefinition(definitionId: string): Observable<void> {\n return this.client.mutate<DeleteMetafieldDefinitionResponse>(DELETE_METAFIELD_DEFINITION_MUTATION, {\n id: definitionId,\n }).pipe(\n map(response => {\n if (response.metafieldDefinitionDelete.userErrors.length > 0) {\n throw {\n code: 'METAFIELD_DEFINITION_ERROR',\n message: response.metafieldDefinitionDelete.userErrors[0].message,\n errors: response.metafieldDefinitionDelete.userErrors,\n };\n }\n })\n );\n }\n\n /**\n * Look up a MetafieldDefinition ID by namespace and key.\n */\n getMetafieldDefinitionId(namespace: string, key: string): Observable<string> {\n return this.client.query<GetMetafieldDefinitionResponse>(GET_METAFIELD_DEFINITION_QUERY, {\n ownerType: 'SHOP',\n namespace,\n key,\n }).pipe(\n map(response => {\n if (!response.metafieldDefinition) {\n throw {\n code: 'DEFINITION_NOT_FOUND',\n message: `MetafieldDefinition not found for ${namespace}.${key}`,\n };\n }\n return response.metafieldDefinition.id;\n })\n );\n }\n\n validateSize(data: any): { valid: boolean; size: number; percentUsed: number } {\n const json = JSON.stringify(data);\n const size = new Blob([json]).size;\n const percentUsed = (size / MAX_METAFIELD_SIZE) * 100;\n\n return {\n valid: size <= MAX_METAFIELD_SIZE,\n size,\n percentUsed: parseFloat(percentUsed.toFixed(2)),\n };\n }\n\n private getDefaultIndex(): PagesIndex {\n return {\n version: 0,\n lastUpdated: new Date().toISOString(),\n pages: [],\n };\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { Observable, of, throwError } from 'rxjs';\nimport { catchError, map, switchMap } from 'rxjs/operators';\nimport {\n CreatePageRequest,\n Page,\n PageIndexEntry,\n PageSummary,\n PagesIndex,\n PublishPageRequest,\n UpdatePageRequest,\n} from '../models/page.model';\nimport { ShopifyMetafieldRepository } from './shopify-metafield-repository.service';\n\n@Injectable({ providedIn: 'root' })\nexport class PageShopifyRepository {\n private readonly metafieldRepo = inject(ShopifyMetafieldRepository);\n\n getPages(): Observable<PageSummary[]> {\n return this.metafieldRepo.getPageIndex().pipe(\n map(index => {\n return index.pages\n .map(entry => this.mapIndexEntryToSummary(entry))\n .sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));\n })\n );\n }\n\n getPage(id: string): Observable<Page> {\n return this.metafieldRepo.getPageMetafield(id).pipe(\n map(page => {\n if (!page) {\n throw {\n code: 'PAGE_NOT_FOUND',\n message: `Page with id ${id} not found`,\n };\n }\n return page;\n })\n );\n }\n\n getPublishedPageBySlug(slug: string): Observable<Page> {\n return this.metafieldRepo.getPageIndex().pipe(\n switchMap(index => {\n const entry = index.pages.find(\n p => p.slug === slug && p.status === 'published'\n );\n\n if (!entry) {\n return throwError(() => ({\n code: 'PAGE_NOT_FOUND',\n message: `Published page with slug '${slug}' not found`,\n }));\n }\n\n return this.getPage(entry.id);\n })\n );\n }\n\n createPage(request: CreatePageRequest): Observable<Page> {\n return this.metafieldRepo.getPageIndex().pipe(\n switchMap(index => {\n this.validateUniqueSlug(request.slug, index);\n\n const newPage: Page = {\n id: crypto.randomUUID(),\n slug: request.slug,\n title: request.title,\n description: request.description,\n sections: [],\n status: 'draft',\n version: 1,\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n };\n\n const validation = this.metafieldRepo.validateSize(newPage);\n if (!validation.valid) {\n return throwError(() => ({\n code: 'SIZE_EXCEEDED',\n message: 'Page content exceeds 64KB limit',\n size: validation.size,\n maxSize: 64 * 1024,\n percentUsed: validation.percentUsed,\n }));\n }\n\n return this.metafieldRepo.setPageMetafield(newPage.id, newPage).pipe(\n switchMap(() => {\n // Create MetafieldDefinition with PUBLIC_READ for Storefront API access\n return this.metafieldRepo.createMetafieldDefinition(\n 'kustomizer',\n `page_${newPage.id}`,\n `Kustomizer Page: ${newPage.title}`,\n ).pipe(\n catchError(() => of(null as string | null)),\n );\n }),\n switchMap((definitionId) => {\n const updatedIndex = this.addPageToIndex(index, newPage, validation.size, definitionId ?? undefined);\n return this.metafieldRepo.updatePageIndex(updatedIndex);\n }),\n map(() => newPage)\n );\n })\n );\n }\n\n updatePage(id: string, request: UpdatePageRequest): Observable<Page> {\n return this.getPage(id).pipe(\n switchMap(currentPage => {\n if (currentPage.version !== request.version) {\n return throwError(() => ({\n code: 'VERSION_CONFLICT',\n message: `Version mismatch: expected ${request.version}, got ${currentPage.version}`,\n currentVersion: currentPage.version,\n }));\n }\n\n return this.metafieldRepo.getPageIndex().pipe(\n switchMap(index => {\n if (request.slug && request.slug !== currentPage.slug) {\n this.validateUniqueSlug(request.slug, index, id);\n }\n\n const updatedPage: Page = {\n ...currentPage,\n title: request.title !== undefined ? request.title : currentPage.title,\n slug: request.slug !== undefined ? request.slug : currentPage.slug,\n description: request.description !== undefined ? request.description : currentPage.description,\n sections: request.sections !== undefined ? request.sections : currentPage.sections,\n version: currentPage.version + 1,\n updatedAt: new Date().toISOString(),\n };\n\n const validation = this.metafieldRepo.validateSize(updatedPage);\n if (!validation.valid) {\n return throwError(() => ({\n code: 'SIZE_EXCEEDED',\n message: 'Page content exceeds 64KB limit',\n size: validation.size,\n maxSize: 64 * 1024,\n percentUsed: validation.percentUsed,\n }));\n }\n\n return this.metafieldRepo.setPageMetafield(id, updatedPage).pipe(\n switchMap(() => {\n const updatedIndex = this.updatePageInIndex(index, updatedPage, validation.size);\n return this.metafieldRepo.updatePageIndex(updatedIndex);\n }),\n map(() => updatedPage)\n );\n })\n );\n })\n );\n }\n\n deletePage(id: string): Observable<void> {\n return this.metafieldRepo.getPageIndex().pipe(\n switchMap(index => {\n const entry = index.pages.find(p => p.id === id);\n return this.metafieldRepo.deletePageMetafield(id).pipe(\n switchMap(() => {\n // Delete the MetafieldDefinition if we have its ID\n if (entry?.definitionId) {\n return this.metafieldRepo.deleteMetafieldDefinition(entry.definitionId).pipe(\n catchError(() => of(undefined)),\n );\n }\n return of(undefined);\n }),\n switchMap(() => {\n const updatedIndex = this.removePageFromIndex(index, id);\n return this.metafieldRepo.updatePageIndex(updatedIndex);\n }),\n map(() => undefined)\n );\n })\n );\n }\n\n publishPage(id: string, request: PublishPageRequest): Observable<Page> {\n return this.getPage(id).pipe(\n switchMap(currentPage => {\n if (currentPage.version !== request.version) {\n return throwError(() => ({\n code: 'VERSION_CONFLICT',\n message: `Version mismatch: expected ${request.version}, got ${currentPage.version}`,\n currentVersion: currentPage.version,\n }));\n }\n\n const publishedPage: Page = {\n ...currentPage,\n status: 'published',\n publishedAt: new Date().toISOString(),\n version: currentPage.version + 1,\n updatedAt: new Date().toISOString(),\n };\n\n const validation = this.metafieldRepo.validateSize(publishedPage);\n\n return this.metafieldRepo.setPageMetafield(id, publishedPage).pipe(\n switchMap(() => this.metafieldRepo.getPageIndex()),\n switchMap(index => {\n const updatedIndex = this.updatePageInIndex(index, publishedPage, validation.size);\n return this.metafieldRepo.updatePageIndex(updatedIndex);\n }),\n map(() => publishedPage)\n );\n })\n );\n }\n\n unpublishPage(id: string, request: PublishPageRequest): Observable<Page> {\n return this.getPage(id).pipe(\n switchMap(currentPage => {\n if (currentPage.version !== request.version) {\n return throwError(() => ({\n code: 'VERSION_CONFLICT',\n message: `Version mismatch: expected ${request.version}, got ${currentPage.version}`,\n currentVersion: currentPage.version,\n }));\n }\n\n if (currentPage.status !== 'published') {\n return throwError(() => ({\n code: 'PAGE_NOT_PUBLISHED',\n message: 'Page is not published',\n }));\n }\n\n const unpublishedPage: Page = {\n ...currentPage,\n status: 'draft',\n publishedAt: undefined,\n version: currentPage.version + 1,\n updatedAt: new Date().toISOString(),\n };\n\n const validation = this.metafieldRepo.validateSize(unpublishedPage);\n\n return this.metafieldRepo.setPageMetafield(id, unpublishedPage).pipe(\n switchMap(() => this.metafieldRepo.getPageIndex()),\n switchMap(index => {\n const updatedIndex = this.updatePageInIndex(index, unpublishedPage, validation.size);\n return this.metafieldRepo.updatePageIndex(updatedIndex);\n }),\n map(() => unpublishedPage)\n );\n })\n );\n }\n\n duplicatePage(id: string): Observable<Page> {\n return this.getPage(id).pipe(\n switchMap(sourcePage => {\n return this.metafieldRepo.getPageIndex().pipe(\n switchMap(index => {\n const newSlug = this.generateUniqueSlug(sourcePage.slug, index);\n\n const duplicatedPage: Page = {\n ...sourcePage,\n id: crypto.randomUUID(),\n slug: newSlug,\n title: `${sourcePage.title} (Copy)`,\n status: 'draft',\n version: 1,\n publishedAt: undefined,\n createdAt: new Date().toISOString(),\n updatedAt: new Date().toISOString(),\n };\n\n const validation = this.metafieldRepo.validateSize(duplicatedPage);\n if (!validation.valid) {\n return throwError(() => ({\n code: 'SIZE_EXCEEDED',\n message: 'Duplicated page content exceeds 64KB limit',\n size: validation.size,\n maxSize: 64 * 1024,\n percentUsed: validation.percentUsed,\n }));\n }\n\n return this.metafieldRepo.setPageMetafield(duplicatedPage.id, duplicatedPage).pipe(\n switchMap(() => {\n return this.metafieldRepo.createMetafieldDefinition(\n 'kustomizer',\n `page_${duplicatedPage.id}`,\n `Kustomizer Page: ${duplicatedPage.title}`,\n ).pipe(\n catchError(() => of(null as string | null)),\n );\n }),\n switchMap((definitionId) => {\n const updatedIndex = this.addPageToIndex(index, duplicatedPage, validation.size, definitionId ?? undefined);\n return this.metafieldRepo.updatePageIndex(updatedIndex);\n }),\n map(() => duplicatedPage)\n );\n })\n );\n })\n );\n }\n\n /**\n * Backfill MetafieldDefinitions for existing pages that don't have one.\n * Creates definitions with PUBLIC_READ storefront access.\n */\n ensureDefinitionsExist(): Observable<{ created: number; skipped: number }> {\n // Ensure the pages_index definition exists with PUBLIC_READ\n return this.metafieldRepo.createMetafieldDefinition(\n 'kustomizer',\n 'pages_index',\n 'Kustomizer Pages Index',\n ).pipe(\n catchError(() => of(null)),\n switchMap(() => this.metafieldRepo.getPageIndex()),\n switchMap(index => {\n const pagesWithoutDefinition = index.pages.filter(p => !p.definitionId);\n if (pagesWithoutDefinition.length === 0) {\n return of({ created: 0, skipped: index.pages.length, index: null });\n }\n\n // Create definitions sequentially to avoid rate limits\n let chain$ = of({ created: 0, skipped: 0, updatedPages: [...index.pages] });\n\n for (const page of pagesWithoutDefinition) {\n chain$ = chain$.pipe(\n switchMap(acc => {\n return this.metafieldRepo.createMetafieldDefinition(\n 'kustomizer',\n `page_${page.id}`,\n `Kustomizer Page: ${page.title}`,\n ).pipe(\n map(definitionId => {\n const updatedPages = acc.updatedPages.map(p =>\n p.id === page.id ? { ...p, definitionId } : p\n );\n return { created: acc.created + 1, skipped: acc.skipped, updatedPages };\n }),\n catchError(() => of({ ...acc, skipped: acc.skipped + 1 })),\n );\n }),\n );\n }\n\n return chain$.pipe(\n switchMap(result => {\n const updatedIndex: PagesIndex = { ...index, pages: result.updatedPages };\n if (result.created > 0) {\n return this.metafieldRepo.updatePageIndex(updatedIndex).pipe(\n map(() => ({ created: result.created, skipped: result.skipped })),\n );\n }\n return of({ created: result.created, skipped: result.skipped });\n }),\n );\n }),\n );\n }\n\n private validateUniqueSlug(slug: string, index: PagesIndex, excludeId?: string): void {\n const existingPage = index.pages.find(p => p.slug === slug && p.id !== excludeId);\n\n if (existingPage) {\n throw {\n code: 'DUPLICATE_SLUG',\n message: `Page with slug '${slug}' already exists`,\n };\n }\n }\n\n private generateUniqueSlug(baseSlug: string, index: PagesIndex): string {\n let counter = 1;\n let newSlug = `${baseSlug}-copy`;\n\n while (index.pages.some(p => p.slug === newSlug)) {\n counter++;\n newSlug = `${baseSlug}-copy-${counter}`;\n }\n\n return newSlug;\n }\n\n private addPageToIndex(index: PagesIndex, page: Page, size: number, definitionId?: string): PagesIndex {\n const entry: PageIndexEntry = {\n id: page.id,\n slug: page.slug,\n title: page.title,\n status: page.status,\n updatedAt: page.updatedAt,\n publishedAt: page.publishedAt,\n size,\n ...(definitionId ? { definitionId } : {}),\n };\n\n return {\n ...index,\n pages: [...index.pages, entry],\n };\n }\n\n private updatePageInIndex(index: PagesIndex, page: Page, size: number): PagesIndex {\n const updatedPages = index.pages.map(entry => {\n if (entry.id === page.id) {\n return {\n id: page.id,\n slug: page.slug,\n title: page.title,\n status: page.status,\n updatedAt: page.updatedAt,\n publishedAt: page.publishedAt,\n size,\n };\n }\n return entry;\n });\n\n return {\n ...index,\n pages: updatedPages,\n };\n }\n\n private removePageFromIndex(index: PagesIndex, pageId: string): PagesIndex {\n return {\n ...index,\n pages: index.pages.filter(entry => entry.id !== pageId),\n };\n }\n\n private mapIndexEntryToSummary(entry: PageIndexEntry): PageSummary {\n return {\n id: entry.id,\n slug: entry.slug,\n title: entry.title,\n status: entry.status,\n updatedAt: entry.updatedAt,\n publishedAt: entry.publishedAt,\n };\n }\n}\n","import { inject, Injectable, InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport {\n CreatePageRequest,\n Page,\n PageSummary,\n PublishPageRequest,\n UpdatePageRequest,\n} from '../models/page.model';\nimport { PageMemoryRepository } from './page-memory.repository';\nimport { PageShopifyRepository } from './page-shopify-repository.service';\n\n/**\n * Injection token to enable in-memory page storage (for development)\n * When false (default), uses Shopify metafields via GraphQL API\n */\nexport const USE_IN_MEMORY_PAGES = new InjectionToken<boolean>('USE_IN_MEMORY_PAGES', {\n providedIn: 'root',\n factory: () => false,\n});\n\n@Injectable({ providedIn: 'root' })\nexport class PageService {\n private readonly useInMemory = inject(USE_IN_MEMORY_PAGES);\n private readonly memoryRepo = inject(PageMemoryRepository);\n private readonly shopifyRepo = inject(PageShopifyRepository);\n\n /**\n * Get all pages (summaries only for listing)\n */\n getPages(): Observable<PageSummary[]> {\n if (this.useInMemory) {\n return this.memoryRepo.getPages();\n }\n return this.shopifyRepo.getPages();\n }\n\n /**\n * Get a single page by ID (full content)\n */\n getPage(id: string): Observable<Page> {\n if (this.useInMemory) {\n return this.memoryRepo.getPage(id);\n }\n return this.shopifyRepo.getPage(id);\n }\n\n /**\n * Get a published page by slug (for public rendering)\n */\n getPublishedPageBySlug(slug: string): Observable<Page> {\n if (this.useInMemory) {\n return this.memoryRepo.getPublishedPageBySlug(slug);\n }\n return this.shopifyRepo.getPublishedPageBySlug(slug);\n }\n\n /**\n * Create a new page\n */\n createPage(request: CreatePageRequest): Observable<Page> {\n if (this.useInMemory) {\n return this.memoryRepo.createPage(request);\n }\n return this.shopifyRepo.createPage(request);\n }\n\n /**\n * Update an existing page\n */\n updatePage(id: string, request: UpdatePageRequest): Observable<Page> {\n if (this.useInMemory) {\n return this.memoryRepo.updatePage(id, request);\n }\n return this.shopifyRepo.updatePage(id, request);\n }\n\n /**\n * Delete a page\n */\n deletePage(id: string): Observable<void> {\n if (this.useInMemory) {\n return this.memoryRepo.deletePage(id);\n }\n return this.shopifyRepo.deletePage(id);\n }\n\n /**\n * Publish a page (changes status to 'published')\n */\n publishPage(id: string, request: PublishPageRequest): Observable<Page> {\n if (this.useInMemory) {\n return this.memoryRepo.publishPage(id, request);\n }\n return this.shopifyRepo.publishPage(id, request);\n }\n\n /**\n * Unpublish a page (changes status to 'draft')\n */\n unpublishPage(id: string, request: PublishPageRequest): Observable<Page> {\n if (this.useInMemory) {\n return this.memoryRepo.unpublishPage(id, request);\n }\n return this.shopifyRepo.unpublishPage(id, request);\n }\n\n /**\n * Duplicate an existing page\n */\n duplicatePage(id: string): Observable<Page> {\n if (this.useInMemory) {\n return this.memoryRepo.duplicatePage(id);\n }\n return this.shopifyRepo.duplicatePage(id);\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { Page } from '../models/page.model';\nimport { PageService } from '../services/page.service';\nimport { VisualEditorNavigation } from '../navigation/visual-editor-navigation.types';\n\n/**\n * Abstract strategy for loading pages into the editor\n * Consumers can implement custom strategies for different use cases\n */\nexport abstract class PageLoadingStrategy {\n /**\n * Load a page by ID\n */\n abstract loadPage(pageId: string): Observable<Page>;\n\n /**\n * Get the current page ID to load\n * This abstracts the source of the page ID (route, input, etc.)\n */\n abstract getPageIdToLoad(): Observable<string | null>;\n}\n\n/**\n * Default strategy that uses route params via the navigation service\n */\n@Injectable()\nexport class RoutePageLoadingStrategy extends PageLoadingStrategy {\n private readonly pageService = inject(PageService);\n private readonly navigation = inject(VisualEditorNavigation);\n\n loadPage(pageId: string): Observable<Page> {\n return this.pageService.getPage(pageId);\n }\n\n getPageIdToLoad(): Observable<string | null> {\n return this.navigation.getCurrentPageId();\n }\n}\n\n/**\n * Input-based strategy for when page is passed via component input\n * Useful for embedding the editor in modals or custom layouts\n */\n@Injectable()\nexport class InputPageLoadingStrategy extends PageLoadingStrategy {\n private readonly pageService = inject(PageService);\n private readonly pageId$ = new BehaviorSubject<string | null>(null);\n\n /**\n * Set the page ID to load\n * Call this when the input changes\n */\n setPageId(pageId: string | null): void {\n this.pageId$.next(pageId);\n }\n\n loadPage(pageId: string): Observable<Page> {\n return this.pageService.getPage(pageId);\n }\n\n getPageIdToLoad(): Observable<string | null> {\n return this.pageId$.asObservable();\n }\n}\n","import { InjectionToken, Type } from '@angular/core';\nimport { VisualEditorNavigation } from '../navigation/visual-editor-navigation.types';\nimport { PageLoadingStrategy } from '../page-loading/page-loading-strategy.types';\nimport { RouterNavigationConfig } from '../navigation/default-router-navigation.service';\n\n/**\n * Main configuration interface for the Visual Editor library\n */\nexport interface VisualEditorConfig {\n /**\n * Navigation configuration\n */\n navigation?: {\n /**\n * Custom navigation service class\n * If provided, routerConfig is ignored\n */\n navigationService?: Type<VisualEditorNavigation>;\n\n /**\n * Router-based config (used with DefaultRouterNavigationService)\n * Only used if navigationService is not provided\n */\n routerConfig?: Partial<RouterNavigationConfig>;\n };\n\n /**\n * Page loading configuration\n */\n pageLoading?: {\n /**\n * Custom page loading strategy\n * Defaults to RoutePageLoadingStrategy\n */\n strategy?: Type<PageLoadingStrategy>;\n };\n\n /**\n * Page service configuration\n */\n pages?: {\n /**\n * Use in-memory storage instead of Shopify\n * Useful for development and demos\n * Defaults to false (uses Shopify)\n */\n useInMemory?: boolean;\n };\n\n /**\n * UI configuration\n */\n ui?: {\n /**\n * Show back button in editor toolbar\n * Defaults to true\n */\n showBackButton?: boolean;\n\n /**\n * Show publish/unpublish buttons\n * Defaults to true\n */\n showPublishButtons?: boolean;\n\n /**\n * Show save button\n * Defaults to true\n */\n showSaveButton?: boolean;\n };\n}\n\n/**\n * Injection token for the Visual Editor configuration\n */\nexport const VISUAL_EDITOR_CONFIG = new InjectionToken<VisualEditorConfig>(\n 'VISUAL_EDITOR_CONFIG',\n {\n providedIn: 'root',\n factory: () => ({}),\n }\n);\n\n/**\n * Default configuration values\n */\nexport const DEFAULT_VISUAL_EDITOR_CONFIG: Required<VisualEditorConfig> = {\n navigation: {},\n pageLoading: {},\n pages: {\n useInMemory: false,\n },\n ui: {\n showBackButton: true,\n showPublishButtons: true,\n showSaveButton: true,\n },\n};\n","import { EnvironmentProviders, makeEnvironmentProviders, Provider } from '@angular/core';\n\n// Note: NgRx store should be provided by the consumer app via provideStore()\n// We only provide our feature state through provideVisualEditorStore()\n\n// Navigation\nimport { VisualEditorNavigation } from './navigation/visual-editor-navigation.types';\nimport {\n DefaultRouterNavigationService,\n DEFAULT_ROUTER_NAVIGATION_CONFIG,\n ROUTER_NAVIGATION_CONFIG,\n} from './navigation/default-router-navigation.service';\n\n// Page Loading\nimport { PageLoadingStrategy, RoutePageLoadingStrategy } from './page-loading/page-loading-strategy.types';\n\n// Config\nimport { VisualEditorConfig, VISUAL_EDITOR_CONFIG } from './config/visual-editor-config.types';\n\n// Services\nimport { USE_IN_MEMORY_PAGES } from './services/page.service';\n\n/**\n * Provides all necessary services and configuration for the Visual Editor\n *\n * Note: You must also call provideVisualEditorStore() to set up the NgRx state.\n *\n * @example\n * ```typescript\n * // Minimal setup (uses Shopify by default)\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideStore(),\n * provideVisualEditorStore(), // Required: sets up NgRx state\n * provideVisualEditor(), // Sets up services and config\n * provideEditorComponents(myComponents),\n * ],\n * };\n *\n * // With custom configuration\n * provideVisualEditor({\n * navigation: {\n * routerConfig: {\n * pageListPath: '/cms',\n * pageEditPath: '/cms/editor/:id',\n * pageIdParam: 'id',\n * }\n * },\n * pages: {\n * useInMemory: true // Use in-memory storage for development\n * }\n * })\n * ```\n */\nexport function provideVisualEditor(config: VisualEditorConfig = {}): EnvironmentProviders {\n const providers: Provider[] = [\n // Configuration\n { provide: VISUAL_EDITOR_CONFIG, useValue: config },\n\n // Page storage configuration\n {\n provide: USE_IN_MEMORY_PAGES,\n useValue: config.pages?.useInMemory ?? false,\n },\n ];\n\n // Navigation provider\n if (config.navigation?.navigationService) {\n // Custom navigation service provided\n providers.push({\n provide: VisualEditorNavigation,\n useClass: config.navigation.navigationService,\n });\n } else {\n // Use default router-based navigation\n providers.push(\n {\n provide: ROUTER_NAVIGATION_CONFIG,\n useValue: {\n ...DEFAULT_ROUTER_NAVIGATION_CONFIG,\n ...config.navigation?.routerConfig,\n },\n },\n {\n provide: VisualEditorNavigation,\n useClass: DefaultRouterNavigationService,\n }\n );\n }\n\n // Page loading strategy\n if (config.pageLoading?.strategy) {\n providers.push({\n provide: PageLoadingStrategy,\n useClass: config.pageLoading.strategy,\n });\n } else {\n providers.push({\n provide: PageLoadingStrategy,\n useClass: RoutePageLoadingStrategy,\n });\n }\n\n return makeEnvironmentProviders(providers);\n}\n","import { PageContext } from '../models/page.model';\n\nexport interface EditorElement {\n id: string;\n type: string;\n props: Record<string, unknown>;\n slotName?: string;\n children?: EditorElement[];\n adminLabel?: string;\n}\n\nexport interface EditorSection {\n id: string;\n type: string;\n props: Record<string, unknown>;\n elements: EditorElement[];\n adminLabel?: string;\n}\n\nexport interface HistoryEntry {\n sections: EditorSection[];\n timestamp: number;\n actionType: string;\n}\n\nexport interface VisualEditorState {\n sections: EditorSection[];\n selectedElementId: string | null;\n selectedSectionId: string | null;\n isDragging: boolean;\n draggedElementId: string | null;\n history: HistoryEntry[];\n historyIndex: number;\n maxHistorySize: number;\n // Page management\n currentPage: PageContext | null;\n isDirty: boolean;\n}\n\nexport const initialVisualEditorState: VisualEditorState = {\n sections: [],\n selectedElementId: null,\n selectedSectionId: null,\n isDragging: false,\n draggedElementId: null,\n history: [],\n historyIndex: -1,\n maxHistorySize: 50,\n currentPage: null,\n isDirty: false,\n};\n\nexport const VISUAL_EDITOR_FEATURE_KEY = 'visualEditor';","import { createActionGroup, emptyProps, props } from '@ngrx/store';\nimport { EditorElement, EditorSection } from './visual-editor.state';\nimport { Page, PageContext } from '../models/page.model';\n\nexport const VisualEditorActions = createActionGroup({\n source: 'Visual Editor',\n events: {\n // Section actions\n 'Add Section': props<{ section: EditorSection; index?: number }>(),\n 'Remove Section': props<{ sectionId: string }>(),\n 'Move Section': props<{ sectionId: string; newIndex: number }>(),\n 'Update Section': props<{ sectionId: string; changes: Partial<EditorSection> }>(),\n 'Update Section Props': props<{ sectionId: string; props: Record<string, unknown> }>(),\n\n // Element actions\n 'Add Element': props<{ sectionId: string; element: EditorElement; index?: number }>(),\n 'Remove Element': props<{ sectionId: string; elementId: string }>(),\n 'Move Element': props<{\n sourceSectionId: string;\n targetSectionId: string;\n elementId: string;\n newIndex: number;\n }>(),\n 'Update Element': props<{\n sectionId: string;\n elementId: string;\n changes: Partial<EditorElement>;\n }>(),\n 'Update Element Props': props<{\n sectionId: string;\n elementId: string;\n props: Record<string, unknown>;\n }>(),\n\n // Block actions (elements within section slots)\n 'Add Block': props<{\n sectionId: string;\n slotName: string;\n element: EditorElement;\n index?: number;\n }>(),\n 'Remove Block': props<{ sectionId: string; elementId: string }>(),\n 'Move Block': props<{\n sectionId: string;\n elementId: string;\n targetSlotName: string;\n newIndex: number;\n }>(),\n 'Update Block Props': props<{\n sectionId: string;\n elementId: string;\n props: Record<string, unknown>;\n }>(),\n\n // Rename actions\n 'Rename Section': props<{ sectionId: string; adminLabel: string }>(),\n 'Rename Block': props<{ sectionId: string; elementId: string; adminLabel: string }>(),\n\n // Duplicate actions\n 'Duplicate Section': props<{ sectionId: string }>(),\n 'Duplicate Block': props<{ sectionId: string; elementId: string }>(),\n 'Duplicate Nested Block': props<{ sectionId: string; parentPath: string[]; elementId: string }>(),\n\n // Nested block actions (blocks within blocks)\n 'Add Nested Block': props<{\n sectionId: string;\n parentPath: string[]; // IDs from section to parent element\n slotName: string;\n element: EditorElement;\n index?: number;\n }>(),\n 'Remove Nested Block': props<{\n sectionId: string;\n parentPath: string[];\n elementId: string;\n }>(),\n 'Update Nested Block Props': props<{\n sectionId: string;\n parentPath: string[];\n elementId: string;\n props: Record<string, unknown>;\n }>(),\n 'Move Nested Block': props<{\n sectionId: string;\n parentPath: string[];\n elementId: string;\n targetSlotName: string;\n newIndex: number;\n }>(),\n 'Reparent Block': props<{\n sourceSectionId: string;\n sourceParentPath: string[];\n elementId: string;\n targetSectionId: string;\n targetParentPath: string[];\n targetSlotName: string;\n targetIndex: number;\n }>(),\n\n // Selection actions\n 'Select Element': props<{ sectionId: string | null; elementId: string | null }>(),\n 'Clear Selection': emptyProps(),\n\n // Drag actions\n 'Start Drag': props<{ elementId: string }>(),\n 'End Drag': emptyProps(),\n\n // History actions\n 'Undo': emptyProps(),\n 'Redo': emptyProps(),\n 'Clear History': emptyProps(),\n\n // Bulk actions\n 'Load Sections': props<{ sections: EditorSection[] }>(),\n 'Reset Editor': emptyProps(),\n\n // Page actions\n 'Load Page': props<{ page: Page }>(),\n 'Update Page Context': props<{ context: Partial<PageContext> }>(),\n 'Mark Dirty': emptyProps(),\n 'Mark Clean': emptyProps(),\n 'Clear Page': emptyProps(),\n },\n});","import { createReducer, on } from '@ngrx/store';\nimport { VisualEditorActions } from './visual-editor.actions';\nimport {\n EditorElement,\n EditorSection,\n HistoryEntry,\n initialVisualEditorState,\n VisualEditorState,\n} from './visual-editor.state';\n\nfunction pushToHistory(\n state: VisualEditorState,\n actionType: string\n): Pick<VisualEditorState, 'history' | 'historyIndex' | 'isDirty'> {\n const entry: HistoryEntry = {\n sections: structuredClone(state.sections),\n timestamp: Date.now(),\n actionType,\n };\n\n const newHistory = state.history.slice(0, state.historyIndex + 1);\n newHistory.push(entry);\n\n if (newHistory.length > state.maxHistorySize) {\n newHistory.shift();\n }\n\n return {\n history: newHistory,\n historyIndex: newHistory.length - 1,\n isDirty: true,\n };\n}\n\nfunction updateSection(\n sections: EditorSection[],\n sectionId: string,\n updater: (section: EditorSection) => EditorSection\n): EditorSection[] {\n return sections.map((section) => (section.id === sectionId ? updater(section) : section));\n}\n\nfunction deepCloneElement(element: EditorElement): EditorElement {\n return {\n ...element,\n id: crypto.randomUUID(),\n props: { ...element.props },\n children: element.children?.map((child) => deepCloneElement(child)),\n };\n}\n\n/**\n * Recursively find and update an element by following a path of IDs\n * @param elements - Array of elements to search in\n * @param path - Array of element IDs to follow (excluding the target)\n * @param updater - Function to update the parent element's children\n */\nfunction updateNestedElements(\n elements: EditorElement[],\n path: string[],\n updater: (children: EditorElement[]) => EditorElement[]\n): EditorElement[] {\n if (path.length === 0) {\n return updater(elements);\n }\n\n const [currentId, ...remainingPath] = path;\n\n return elements.map((element) => {\n if (element.id !== currentId) {\n return element;\n }\n\n if (remainingPath.length === 0) {\n // We've reached the parent, update its children\n return {\n ...element,\n children: updater(element.children ?? []),\n };\n }\n\n // Continue down the path\n return {\n ...element,\n children: updateNestedElements(element.children ?? [], remainingPath, updater),\n };\n });\n}\n\n/**\n * Add a child element to a nested parent\n */\nfunction addNestedChild(\n elements: EditorElement[],\n path: string[],\n child: EditorElement,\n slotName: string,\n index?: number\n): EditorElement[] {\n const childWithSlot = { ...child, slotName };\n\n return updateNestedElements(elements, path, (children) => {\n const slotChildren = children.filter((c) => c.slotName === slotName);\n const otherChildren = children.filter((c) => c.slotName !== slotName);\n const insertIndex = index !== undefined ? index : slotChildren.length;\n\n const newSlotChildren = [\n ...slotChildren.slice(0, insertIndex),\n childWithSlot,\n ...slotChildren.slice(insertIndex),\n ];\n\n return [...otherChildren, ...newSlotChildren];\n });\n}\n\n/**\n * Remove a child element from a nested parent\n */\nfunction removeNestedChild(\n elements: EditorElement[],\n path: string[],\n childId: string\n): EditorElement[] {\n return updateNestedElements(elements, path, (children) =>\n children.filter((c) => c.id !== childId)\n );\n}\n\n/**\n * Update props of a nested child element\n */\nfunction updateNestedChildProps(\n elements: EditorElement[],\n path: string[],\n childId: string,\n props: Record<string, unknown>\n): EditorElement[] {\n return updateNestedElements(elements, path, (children) =>\n children.map((c) =>\n c.id === childId ? { ...c, props: { ...c.props, ...props } } : c\n )\n );\n}\n\n/**\n * Recursively update adminLabel of an element by ID anywhere in the tree\n */\nfunction updateElementAdminLabelRecursive(\n elements: EditorElement[],\n elementId: string,\n adminLabel: string\n): EditorElement[] {\n return elements.map((element) => {\n if (element.id === elementId) {\n return { ...element, adminLabel: adminLabel || undefined };\n }\n if (element.children && element.children.length > 0) {\n return {\n ...element,\n children: updateElementAdminLabelRecursive(element.children, elementId, adminLabel),\n };\n }\n return element;\n });\n}\n\n/**\n * Recursively update props of an element by ID anywhere in the tree\n */\nfunction updateElementPropsRecursive(\n elements: EditorElement[],\n elementId: string,\n props: Record<string, unknown>\n): EditorElement[] {\n return elements.map((element) => {\n if (element.id === elementId) {\n return { ...element, props: { ...element.props, ...props } };\n }\n if (element.children && element.children.length > 0) {\n return {\n ...element,\n children: updateElementPropsRecursive(element.children, elementId, props),\n };\n }\n return element;\n });\n}\n\n/**\n * Move a nested child within its parent (can change slots)\n */\nfunction moveNestedChild(\n elements: EditorElement[],\n path: string[],\n childId: string,\n targetSlotName: string,\n newIndex: number\n): EditorElement[] {\n return updateNestedElements(elements, path, (children) => {\n const child = children.find((c) => c.id === childId);\n if (!child) return children;\n\n const updatedChild = { ...child, slotName: targetSlotName };\n const childrenWithoutTarget = children.filter((c) => c.id !== childId);\n const targetSlotChildren = childrenWithoutTarget.filter((c) => c.slotName === targetSlotName);\n const otherChildren = childrenWithoutTarget.filter((c) => c.slotName !== targetSlotName);\n\n const newTargetChildren = [\n ...targetSlotChildren.slice(0, newIndex),\n updatedChild,\n ...targetSlotChildren.slice(newIndex),\n ];\n\n return [...otherChildren, ...newTargetChildren];\n });\n}\n\n/**\n * Find an element by ID anywhere in the tree and return it\n */\nfunction findNestedElement(elements: EditorElement[], elementId: string): EditorElement | null {\n for (const el of elements) {\n if (el.id === elementId) return el;\n if (el.children?.length) {\n const found = findNestedElement(el.children, elementId);\n if (found) return found;\n }\n }\n return null;\n}\n\nexport const visualEditorReducer = createReducer(\n initialVisualEditorState,\n\n // Section actions\n on(VisualEditorActions.addSection, (state, { section, index }) => {\n const sections =\n index !== undefined\n ? [...state.sections.slice(0, index), section, ...state.sections.slice(index)]\n : [...state.sections, section];\n\n return {\n ...state,\n sections,\n ...pushToHistory(state, 'Add Section'),\n };\n }),\n\n on(VisualEditorActions.removeSection, (state, { sectionId }) => ({\n ...state,\n sections: state.sections.filter((s) => s.id !== sectionId),\n selectedSectionId: state.selectedSectionId === sectionId ? null : state.selectedSectionId,\n selectedElementId:\n state.sections.find((s) => s.id === sectionId)?.elements.some((e) => e.id === state.selectedElementId)\n ? null\n : state.selectedElementId,\n ...pushToHistory(state, 'Remove Section'),\n })),\n\n on(VisualEditorActions.moveSection, (state, { sectionId, newIndex }) => {\n const currentIndex = state.sections.findIndex((s) => s.id === sectionId);\n if (currentIndex === -1 || currentIndex === newIndex) return state;\n\n const sections = [...state.sections];\n const [removed] = sections.splice(currentIndex, 1);\n sections.splice(newIndex, 0, removed);\n\n return {\n ...state,\n sections,\n ...pushToHistory(state, 'Move Section'),\n };\n }),\n\n on(VisualEditorActions.updateSection, (state, { sectionId, changes }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n ...changes,\n })),\n ...pushToHistory(state, 'Update Section'),\n })),\n\n on(VisualEditorActions.updateSectionProps, (state, { sectionId, props }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n props: { ...section.props, ...props },\n })),\n ...pushToHistory(state, 'Update Section Props'),\n })),\n\n // Rename actions\n on(VisualEditorActions.renameSection, (state, { sectionId, adminLabel }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n adminLabel: adminLabel || undefined,\n })),\n ...pushToHistory(state, 'Rename Section'),\n })),\n\n on(VisualEditorActions.renameBlock, (state, { sectionId, elementId, adminLabel }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: updateElementAdminLabelRecursive(section.elements, elementId, adminLabel),\n })),\n ...pushToHistory(state, 'Rename Block'),\n })),\n\n // Element actions\n on(VisualEditorActions.addElement, (state, { sectionId, element, index }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements:\n index !== undefined\n ? [...section.elements.slice(0, index), element, ...section.elements.slice(index)]\n : [...section.elements, element],\n })),\n ...pushToHistory(state, 'Add Element'),\n })),\n\n on(VisualEditorActions.removeElement, (state, { sectionId, elementId }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: section.elements.filter((e) => e.id !== elementId),\n })),\n selectedElementId: state.selectedElementId === elementId ? null : state.selectedElementId,\n ...pushToHistory(state, 'Remove Element'),\n })),\n\n on(VisualEditorActions.moveElement, (state, { sourceSectionId, targetSectionId, elementId, newIndex }) => {\n const sourceSection = state.sections.find((s) => s.id === sourceSectionId);\n const element = sourceSection?.elements.find((e) => e.id === elementId);\n if (!element) return state;\n\n let sections = updateSection(state.sections, sourceSectionId, (section) => ({\n ...section,\n elements: section.elements.filter((e) => e.id !== elementId),\n }));\n\n sections = updateSection(sections, targetSectionId, (section) => ({\n ...section,\n elements: [...section.elements.slice(0, newIndex), element, ...section.elements.slice(newIndex)],\n }));\n\n return {\n ...state,\n sections,\n ...pushToHistory(state, 'Move Element'),\n };\n }),\n\n on(VisualEditorActions.updateElement, (state, { sectionId, elementId, changes }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: section.elements.map((e) => (e.id === elementId ? { ...e, ...changes } : e)),\n })),\n ...pushToHistory(state, 'Update Element'),\n })),\n\n on(VisualEditorActions.updateElementProps, (state, { sectionId, elementId, props }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: section.elements.map((e) =>\n e.id === elementId ? { ...e, props: { ...e.props, ...props } } : e\n ),\n })),\n ...pushToHistory(state, 'Update Element Props'),\n })),\n\n // Block actions (elements within section slots)\n on(VisualEditorActions.addBlock, (state, { sectionId, slotName, element, index }) => {\n const blockWithSlot = { ...element, slotName };\n return {\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => {\n const slotBlocks = section.elements.filter((e) => e.slotName === slotName);\n const otherBlocks = section.elements.filter((e) => e.slotName !== slotName);\n const insertIndex = index !== undefined ? index : slotBlocks.length;\n const newSlotBlocks = [\n ...slotBlocks.slice(0, insertIndex),\n blockWithSlot,\n ...slotBlocks.slice(insertIndex),\n ];\n return {\n ...section,\n elements: [...otherBlocks, ...newSlotBlocks],\n };\n }),\n ...pushToHistory(state, 'Add Block'),\n };\n }),\n\n on(VisualEditorActions.removeBlock, (state, { sectionId, elementId }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: section.elements.filter((e) => e.id !== elementId),\n })),\n selectedElementId: state.selectedElementId === elementId ? null : state.selectedElementId,\n ...pushToHistory(state, 'Remove Block'),\n })),\n\n on(VisualEditorActions.moveBlock, (state, { sectionId, elementId, targetSlotName, newIndex }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => {\n const block = section.elements.find((e) => e.id === elementId);\n if (!block) return section;\n\n const updatedBlock = { ...block, slotName: targetSlotName };\n const elementsWithoutBlock = section.elements.filter((e) => e.id !== elementId);\n const targetSlotBlocks = elementsWithoutBlock.filter((e) => e.slotName === targetSlotName);\n const otherBlocks = elementsWithoutBlock.filter((e) => e.slotName !== targetSlotName);\n\n const newTargetBlocks = [\n ...targetSlotBlocks.slice(0, newIndex),\n updatedBlock,\n ...targetSlotBlocks.slice(newIndex),\n ];\n\n return {\n ...section,\n elements: [...otherBlocks, ...newTargetBlocks],\n };\n }),\n ...pushToHistory(state, 'Move Block'),\n })),\n\n // Duplicate actions\n on(VisualEditorActions.duplicateSection, (state, { sectionId }) => {\n const index = state.sections.findIndex((s) => s.id === sectionId);\n if (index === -1) return state;\n\n const original = state.sections[index];\n const clone: EditorSection = {\n ...original,\n id: crypto.randomUUID(),\n props: { ...original.props },\n elements: original.elements.map((el) => deepCloneElement(el)),\n };\n\n const sections = [\n ...state.sections.slice(0, index + 1),\n clone,\n ...state.sections.slice(index + 1),\n ];\n\n return {\n ...state,\n sections,\n ...pushToHistory(state, 'Duplicate Section'),\n };\n }),\n\n on(VisualEditorActions.duplicateBlock, (state, { sectionId, elementId }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => {\n const index = section.elements.findIndex((e) => e.id === elementId);\n if (index === -1) return section;\n\n const clone = deepCloneElement(section.elements[index]);\n return {\n ...section,\n elements: [\n ...section.elements.slice(0, index + 1),\n clone,\n ...section.elements.slice(index + 1),\n ],\n };\n }),\n ...pushToHistory(state, 'Duplicate Block'),\n })),\n\n on(VisualEditorActions.duplicateNestedBlock, (state, { sectionId, parentPath, elementId }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: updateNestedElements(section.elements, parentPath, (children) => {\n const index = children.findIndex((c) => c.id === elementId);\n if (index === -1) return children;\n\n const clone = deepCloneElement(children[index]);\n return [\n ...children.slice(0, index + 1),\n clone,\n ...children.slice(index + 1),\n ];\n }),\n })),\n ...pushToHistory(state, 'Duplicate Nested Block'),\n })),\n\n on(VisualEditorActions.updateBlockProps, (state, { sectionId, elementId, props }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n // Use recursive function to find and update nested blocks\n elements: updateElementPropsRecursive(section.elements, elementId, props),\n })),\n ...pushToHistory(state, 'Update Block Props'),\n })),\n\n // Nested block actions (blocks within blocks, up to 12 levels deep)\n on(VisualEditorActions.addNestedBlock, (state, { sectionId, parentPath, slotName, element, index }) => {\n // Validate max depth (12 levels)\n if (parentPath.length >= 12) {\n console.warn('Maximum nesting depth (12) reached');\n return state;\n }\n\n return {\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: addNestedChild(section.elements, parentPath, element, slotName, index),\n })),\n ...pushToHistory(state, 'Add Nested Block'),\n };\n }),\n\n on(VisualEditorActions.removeNestedBlock, (state, { sectionId, parentPath, elementId }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: removeNestedChild(section.elements, parentPath, elementId),\n })),\n selectedElementId: state.selectedElementId === elementId ? null : state.selectedElementId,\n ...pushToHistory(state, 'Remove Nested Block'),\n })),\n\n on(VisualEditorActions.updateNestedBlockProps, (state, { sectionId, parentPath, elementId, props }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: updateNestedChildProps(section.elements, parentPath, elementId, props),\n })),\n ...pushToHistory(state, 'Update Nested Block Props'),\n })),\n\n on(VisualEditorActions.moveNestedBlock, (state, { sectionId, parentPath, elementId, targetSlotName, newIndex }) => ({\n ...state,\n sections: updateSection(state.sections, sectionId, (section) => ({\n ...section,\n elements: moveNestedChild(section.elements, parentPath, elementId, targetSlotName, newIndex),\n })),\n ...pushToHistory(state, 'Move Nested Block'),\n })),\n\n on(VisualEditorActions.reparentBlock, (state, {\n sourceSectionId, sourceParentPath, elementId,\n targetSectionId, targetParentPath, targetSlotName, targetIndex,\n }) => {\n // 1. Find the element in its source location\n const sourceSection = state.sections.find((s) => s.id === sourceSectionId);\n if (!sourceSection) return state;\n\n let element: EditorElement | null = null;\n if (sourceParentPath.length === 0) {\n element = sourceSection.elements.find((e) => e.id === elementId) ?? null;\n } else {\n element = findNestedElement(sourceSection.elements, elementId);\n }\n if (!element) return state;\n\n // 2. Remove from source\n let sections = state.sections;\n if (sourceParentPath.length === 0) {\n sections = updateSection(sections, sourceSectionId, (section) => ({\n ...section,\n elements: section.elements.filter((e) => e.id !== elementId),\n }));\n } else {\n sections = updateSection(sections, sourceSectionId, (section) => ({\n ...section,\n elements: removeNestedChild(section.elements, sourceParentPath, elementId),\n }));\n }\n\n // 3. Update slotName and insert at target\n const reparentedElement = { ...element, slotName: targetSlotName };\n\n if (targetParentPath.length === 0) {\n sections = updateSection(sections, targetSectionId, (section) => {\n const slotChildren = section.elements.filter((e) => e.slotName === targetSlotName);\n const otherChildren = section.elements.filter((e) => e.slotName !== targetSlotName);\n const insertIdx = Math.min(targetIndex, slotChildren.length);\n const newSlotChildren = [\n ...slotChildren.slice(0, insertIdx),\n reparentedElement,\n ...slotChildren.slice(insertIdx),\n ];\n return {\n ...section,\n elements: [...otherChildren, ...newSlotChildren],\n };\n });\n } else {\n sections = updateSection(sections, targetSectionId, (section) => ({\n ...section,\n elements: addNestedChild(section.elements, targetParentPath, reparentedElement, targetSlotName, targetIndex),\n }));\n }\n\n return {\n ...state,\n sections,\n ...pushToHistory(state, 'Reparent Block'),\n };\n }),\n\n // Selection actions\n on(VisualEditorActions.selectElement, (state, { sectionId, elementId }) => ({\n ...state,\n selectedSectionId: sectionId,\n selectedElementId: elementId,\n })),\n\n on(VisualEditorActions.clearSelection, (state) => ({\n ...state,\n selectedSectionId: null,\n selectedElementId: null,\n })),\n\n // Drag actions\n on(VisualEditorActions.startDrag, (state, { elementId }) => ({\n ...state,\n isDragging: true,\n draggedElementId: elementId,\n })),\n\n on(VisualEditorActions.endDrag, (state) => ({\n ...state,\n isDragging: false,\n draggedElementId: null,\n })),\n\n // History actions\n on(VisualEditorActions.undo, (state) => {\n if (state.historyIndex <= 0) return state;\n\n const newIndex = state.historyIndex - 1;\n const entry = state.history[newIndex];\n\n return {\n ...state,\n sections: structuredClone(entry.sections),\n historyIndex: newIndex,\n };\n }),\n\n on(VisualEditorActions.redo, (state) => {\n if (state.historyIndex >= state.history.length - 1) return state;\n\n const newIndex = state.historyIndex + 1;\n const entry = state.history[newIndex];\n\n return {\n ...state,\n sections: structuredClone(entry.sections),\n historyIndex: newIndex,\n };\n }),\n\n on(VisualEditorActions.clearHistory, (state) => ({\n ...state,\n history: [],\n historyIndex: -1,\n })),\n\n // Bulk actions\n on(VisualEditorActions.loadSections, (state, { sections }) => ({\n ...state,\n sections,\n ...pushToHistory(state, 'Load Sections'),\n })),\n\n on(VisualEditorActions.resetEditor, () => initialVisualEditorState),\n\n // Page actions\n on(VisualEditorActions.loadPage, (state, { page }) => ({\n ...initialVisualEditorState,\n sections: page.sections,\n currentPage: {\n id: page.id,\n slug: page.slug,\n title: page.title,\n status: page.status,\n version: page.version,\n },\n isDirty: false,\n })),\n\n on(VisualEditorActions.updatePageContext, (state, { context }) => ({\n ...state,\n currentPage: state.currentPage ? { ...state.currentPage, ...context } : null,\n })),\n\n on(VisualEditorActions.markDirty, (state) => ({\n ...state,\n isDirty: true,\n })),\n\n on(VisualEditorActions.markClean, (state) => ({\n ...state,\n isDirty: false,\n })),\n\n on(VisualEditorActions.clearPage, () => initialVisualEditorState)\n);","import { createFeatureSelector, createSelector } from '@ngrx/store';\nimport { EditorElement, VISUAL_EDITOR_FEATURE_KEY, VisualEditorState } from './visual-editor.state';\n\n/**\n * Recursively find an element by ID in a tree of elements\n */\nfunction findElementRecursive(elements: EditorElement[], elementId: string): EditorElement | null {\n for (const element of elements) {\n if (element.id === elementId) {\n return element;\n }\n if (element.children && element.children.length > 0) {\n const found = findElementRecursive(element.children, elementId);\n if (found) {\n return found;\n }\n }\n }\n return null;\n}\n\nexport const selectVisualEditorState =\n createFeatureSelector<VisualEditorState>(VISUAL_EDITOR_FEATURE_KEY);\n\nexport const selectSections = createSelector(selectVisualEditorState, (state) => state.sections);\n\nexport const selectSelectedElementId = createSelector(\n selectVisualEditorState,\n (state) => state.selectedElementId\n);\n\nexport const selectSelectedSectionId = createSelector(\n selectVisualEditorState,\n (state) => state.selectedSectionId\n);\n\nexport const selectIsDragging = createSelector(selectVisualEditorState, (state) => state.isDragging);\n\nexport const selectDraggedElementId = createSelector(\n selectVisualEditorState,\n (state) => state.draggedElementId\n);\n\nexport const selectHistoryIndex = createSelector(\n selectVisualEditorState,\n (state) => state.historyIndex\n);\n\nexport const selectHistoryLength = createSelector(\n selectVisualEditorState,\n (state) => state.history.length\n);\n\nexport const selectCanUndo = createSelector(selectVisualEditorState, (state) => state.historyIndex > 0);\n\nexport const selectCanRedo = createSelector(\n selectVisualEditorState,\n (state) => state.historyIndex < state.history.length - 1\n);\n\nexport const selectSelectedSection = createSelector(\n selectSections,\n selectSelectedSectionId,\n (sections, sectionId) => sections.find((s) => s.id === sectionId) ?? null\n);\n\nexport const selectSelectedElement = createSelector(\n selectSelectedSection,\n selectSelectedElementId,\n (section, elementId) => {\n if (!section || !elementId) return null;\n // Search recursively to find nested elements\n return findElementRecursive(section.elements, elementId);\n }\n);\n\nexport const selectSectionById = (sectionId: string) =>\n createSelector(selectSections, (sections) => sections.find((s) => s.id === sectionId) ?? null);\n\nexport const selectElementById = (sectionId: string, elementId: string) =>\n createSelector(selectSectionById(sectionId), (section) => {\n if (!section) return null;\n // Search recursively to find nested elements\n return findElementRecursive(section.elements, elementId);\n });\n\nexport const selectHistory = createSelector(selectVisualEditorState, (state) => state.history);\n\nexport const selectLastAction = createSelector(selectHistory, selectHistoryIndex, (history, index) =>\n index >= 0 && index < history.length ? history[index].actionType : null\n);\n\nexport const selectSelectedElementType = createSelector(\n selectSelectedElement,\n (element) => element?.type ?? null\n);\n\nexport const selectSelectedSectionType = createSelector(\n selectSelectedSection,\n (section) => section?.type ?? null\n);\n\n// Block selectors\nexport const selectBlocksForSection = (sectionId: string) =>\n createSelector(selectSectionById(sectionId), (section) => section?.elements ?? []);\n\nexport const selectBlocksForSlot = (sectionId: string, slotName: string) =>\n createSelector(selectBlocksForSection(sectionId), (elements) =>\n elements.filter((e) => e.slotName === slotName)\n );\n\nexport const selectSelectedBlock = createSelector(\n selectSelectedSection,\n selectSelectedElementId,\n (section, elementId) => {\n if (!section || !elementId) return null;\n // Search recursively to find nested blocks\n return findElementRecursive(section.elements, elementId);\n }\n);\n\nexport const selectSelectedBlockSlotName = createSelector(\n selectSelectedBlock,\n (block) => block?.slotName ?? null\n);\n\n// Page selectors\nexport const selectCurrentPage = createSelector(\n selectVisualEditorState,\n (state) => state.currentPage\n);\n\nexport const selectCurrentPageId = createSelector(\n selectCurrentPage,\n (page) => page?.id ?? null\n);\n\nexport const selectCurrentPageSlug = createSelector(\n selectCurrentPage,\n (page) => page?.slug ?? null\n);\n\nexport const selectCurrentPageTitle = createSelector(\n selectCurrentPage,\n (page) => page?.title ?? null\n);\n\nexport const selectCurrentPageStatus = createSelector(\n selectCurrentPage,\n (page) => page?.status ?? null\n);\n\nexport const selectCurrentPageVersion = createSelector(\n selectCurrentPage,\n (page) => page?.version ?? null\n);\n\nexport const selectIsDirty = createSelector(selectVisualEditorState, (state) => state.isDirty);\n\nexport const selectIsPageLoaded = createSelector(selectCurrentPage, (page) => page !== null);","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { provideState } from '@ngrx/store';\nimport { VISUAL_EDITOR_FEATURE_KEY } from './visual-editor.state';\nimport { visualEditorReducer } from './visual-editor.reducer';\n\nexport function provideVisualEditorStore(): EnvironmentProviders {\n return makeEnvironmentProviders([provideState(VISUAL_EDITOR_FEATURE_KEY, visualEditorReducer)]);\n}","import { EnvironmentProviders, inject, InjectionToken, makeEnvironmentProviders, provideEnvironmentInitializer } from '@angular/core';\nimport { ComponentDefinition } from './component-definition.types';\nimport { ComponentRegistryService } from './component-registry.service';\n\n/**\n * Injection token for editor component definitions\n */\nexport const EDITOR_COMPONENT_DEFINITIONS = new InjectionToken<ComponentDefinition[][]>(\n 'EDITOR_COMPONENT_DEFINITIONS'\n);\n\n/**\n * Provider function to register editor components.\n *\n * @example\n * ```typescript\n * // app.config.ts\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * provideStore(),\n * provideVisualEditorStore(),\n * provideEditorComponents([\n * heroSectionDefinition,\n * textBlockDefinition,\n * ]),\n * ],\n * };\n * ```\n */\nexport function provideEditorComponents(\n definitions: ComponentDefinition[]\n): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: EDITOR_COMPONENT_DEFINITIONS,\n useValue: definitions,\n multi: true,\n },\n // Fallback: directly register definitions via environment initializer.\n // This ensures registration works even when the InjectionToken doesn't\n // match between pre-bundled library code and app code (e.g. ng serve with Vite).\n provideEnvironmentInitializer(() => {\n const registry = inject(ComponentRegistryService);\n for (const def of definitions) {\n if (!registry.has(def.type)) {\n registry.register(def);\n }\n }\n }),\n ]);\n}\n","import { Injectable, Type, inject, signal } from '@angular/core';\nimport { ComponentDefinition, ComponentCategory, ComponentPreset } from './component-definition.types';\nimport { PropSchemaMap } from './prop-schema.types';\nimport { SlotDefinition } from './slot.types';\nimport { EDITOR_COMPONENT_DEFINITIONS } from './provide-editor-components';\n\n/**\n * A resolved preset entry for use in pickers.\n * If the component has no presets, preset is null and display fields come from the definition.\n */\nexport interface ResolvedPreset {\n definition: ComponentDefinition;\n preset: ComponentPreset | null;\n displayName: string;\n displayCategory: string;\n displayIcon: string | undefined;\n displayDescription: string | undefined;\n}\n\n/**\n * Central service for registering and querying editor components\n */\n@Injectable({ providedIn: 'root' })\nexport class ComponentRegistryService {\n private readonly definitions = new Map<string, ComponentDefinition>();\n private readonly _version = signal(0);\n private readonly injectedDefinitions = inject(EDITOR_COMPONENT_DEFINITIONS, { optional: true }) ?? [];\n\n constructor() {\n this.injectedDefinitions.flat().forEach((def) => this.register(def));\n }\n\n /**\n * Clear all registered definitions\n */\n clear(): void {\n this.definitions.clear();\n this._version.update(v => v + 1);\n }\n\n /**\n * Unregister a single component definition by type\n */\n unregister(type: string): boolean {\n const deleted = this.definitions.delete(type);\n if (deleted) {\n this._version.update(v => v + 1);\n }\n return deleted;\n }\n\n /**\n * Register a component definition\n */\n register(definition: ComponentDefinition): void {\n if (this.definitions.has(definition.type)) {\n console.warn(\n `ComponentRegistry: Component type \"${definition.type}\" is already registered. Overwriting.`\n );\n }\n this.definitions.set(definition.type, definition);\n this._version.update(v => v + 1);\n }\n\n /**\n * Register multiple definitions\n */\n registerAll(definitions: ComponentDefinition[]): void {\n definitions.forEach((def) => this.register(def));\n }\n\n /**\n * Get a definition by type\n */\n get(type: string): ComponentDefinition | undefined {\n return this.definitions.get(type);\n }\n\n /**\n * Check if a type is registered\n */\n has(type: string): boolean {\n return this.definitions.has(type);\n }\n\n /**\n * Get the Angular component for a type\n */\n getComponent(type: string): Type<unknown> | undefined {\n return this.definitions.get(type)?.component;\n }\n\n /**\n * Get the props schema for a type\n */\n getPropsSchema(type: string): PropSchemaMap | undefined {\n return this.definitions.get(type)?.props;\n }\n\n /**\n * Get the slots for a type\n */\n getSlots(type: string): SlotDefinition[] {\n return this.definitions.get(type)?.slots ?? [];\n }\n\n /**\n * Check if a component type has slots (can contain nested blocks)\n */\n hasSlots(type: string): boolean {\n const slots = this.getSlots(type);\n return slots.length > 0;\n }\n\n /**\n * Get all definitions\n */\n getAll(): ComponentDefinition[] {\n this._version(); // reactive dependency for signal consumers\n return Array.from(this.definitions.values());\n }\n\n /**\n * Get definitions filtered by category\n */\n getByCategory(category: ComponentCategory): ComponentDefinition[] {\n return this.getAll()\n .filter((def) => def.category === category)\n .sort((a, b) => (a.order ?? 999) - (b.order ?? 999));\n }\n\n /**\n * Get only section components\n */\n getSections(): ComponentDefinition[] {\n return this.getAll()\n .filter((def) => def.isSection === true)\n .sort((a, b) => (a.order ?? 999) - (b.order ?? 999));\n }\n\n /**\n * Get only element components (non-sections, non-blocks)\n */\n getElements(): ComponentDefinition[] {\n return this.getAll()\n .filter((def) => def.isSection !== true && def.isBlock !== true)\n .sort((a, b) => (a.order ?? 999) - (b.order ?? 999));\n }\n\n /**\n * Get only block components (elements that live inside section slots)\n */\n getBlocks(): ComponentDefinition[] {\n return this.getAll()\n .filter((def) => def.isBlock === true)\n .sort((a, b) => (a.order ?? 999) - (b.order ?? 999));\n }\n\n /**\n * Get blocks available for a specific section type\n * Returns theme blocks (global) + section blocks specific to this section type\n */\n getBlocksForSectionType(sectionType: string): ComponentDefinition[] {\n return this.getBlocks().filter((def) => {\n // Theme blocks (or no scope specified) are available everywhere\n if (!def.blockScope || def.blockScope === 'theme') {\n return true;\n }\n // Section blocks are only available in their specified sections\n if (def.blockScope === 'section') {\n return def.sectionTypes?.includes(sectionType) ?? false;\n }\n return false;\n });\n }\n\n /**\n * Search components by name or tags\n */\n search(query: string): ComponentDefinition[] {\n const normalizedQuery = query.toLowerCase().trim();\n if (!normalizedQuery) return this.getAll();\n\n return this.getAll().filter((def) => {\n const nameMatch = def.name.toLowerCase().includes(normalizedQuery);\n const tagMatch = def.tags?.some((tag) => tag.toLowerCase().includes(normalizedQuery));\n const descMatch = def.description?.toLowerCase().includes(normalizedQuery);\n return nameMatch || tagMatch || descMatch;\n });\n }\n\n /**\n * Generate default props for a type\n */\n getDefaultProps(type: string): Record<string, unknown> {\n const schema = this.getPropsSchema(type);\n if (!schema) return {};\n\n const defaults: Record<string, unknown> = {};\n for (const [key, propSchema] of Object.entries(schema)) {\n defaults[key] = propSchema.defaultValue;\n }\n return defaults;\n }\n\n /**\n * Resolve a definition into ResolvedPreset entries.\n * If it has presets, returns one entry per preset; otherwise one entry for the definition itself.\n */\n resolvePresets(definition: ComponentDefinition): ResolvedPreset[] {\n if (definition.presets && definition.presets.length > 0) {\n return definition.presets.map((preset) => ({\n definition,\n preset,\n displayName: preset.name,\n displayCategory: preset.category ?? definition.category,\n displayIcon: preset.icon ?? definition.icon,\n displayDescription: preset.description ?? definition.description,\n }));\n }\n\n return [\n {\n definition,\n preset: null,\n displayName: definition.name,\n displayCategory: definition.category,\n displayIcon: definition.icon,\n displayDescription: definition.description,\n },\n ];\n }\n\n /**\n * Get all section definitions expanded into presets\n */\n getSectionPresets(): ResolvedPreset[] {\n return this.getSections().flatMap((def) => this.resolvePresets(def));\n }\n\n /**\n * Get all block definitions expanded into presets\n */\n getBlockPresets(): ResolvedPreset[] {\n return this.getBlocks().flatMap((def) => this.resolvePresets(def));\n }\n\n /**\n * Get block presets available for a specific section type\n */\n getBlockPresetsForSectionType(sectionType: string): ResolvedPreset[] {\n return this.getBlocksForSectionType(sectionType).flatMap((def) => this.resolvePresets(def));\n }\n\n /**\n * Merge schema defaults with preset settings to produce final props\n */\n getPresetProps(type: string, preset: ComponentPreset | null): Record<string, unknown> {\n const defaults = this.getDefaultProps(type);\n if (!preset?.settings) return defaults;\n return { ...defaults, ...preset.settings };\n }\n\n /**\n * Validate props against the schema\n */\n validateProps(type: string, props: Record<string, unknown>): Map<string, string> {\n const errors = new Map<string, string>();\n const schema = this.getPropsSchema(type);\n if (!schema) return errors;\n\n for (const [key, propSchema] of Object.entries(schema)) {\n const value = props[key];\n const validation = propSchema.validation;\n\n if (!validation) continue;\n\n if (validation.required && (value === undefined || value === null || value === '')) {\n errors.set(key, `${propSchema.label} is required`);\n continue;\n }\n\n if (value === undefined || value === null) continue;\n\n if (typeof value === 'number') {\n if (validation.min !== undefined && value < validation.min) {\n errors.set(key, `${propSchema.label} must be at least ${validation.min}`);\n }\n if (validation.max !== undefined && value > validation.max) {\n errors.set(key, `${propSchema.label} must be at most ${validation.max}`);\n }\n }\n\n if (typeof value === 'string') {\n if (validation.minLength !== undefined && value.length < validation.minLength) {\n errors.set(key, `${propSchema.label} must be at least ${validation.minLength} characters`);\n }\n if (validation.maxLength !== undefined && value.length > validation.maxLength) {\n errors.set(key, `${propSchema.label} must be at most ${validation.maxLength} characters`);\n }\n if (validation.pattern && !new RegExp(validation.pattern).test(value)) {\n errors.set(key, `${propSchema.label} format is invalid`);\n }\n }\n }\n\n return errors;\n }\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n input,\n inject,\n ViewContainerRef,\n effect,\n ComponentRef,\n DestroyRef,\n reflectComponentType,\n Type,\n signal,\n} from '@angular/core';\nimport { ComponentRegistryService } from '../registry/component-registry.service';\nimport { EditorElement } from '../store/visual-editor.state';\n\n/**\n * Component that dynamically renders an EditorElement\n * based on its type registered in the ComponentRegistry\n */\n@Component({\n selector: 'lib-dynamic-renderer',\n template: `\n @if (error()) {\n <div class=\"dynamic-renderer-error\">\n <span>Unknown component type: {{ element().type }}</span>\n </div>\n }\n `,\n styles: `\n :host {\n display: contents;\n }\n .dynamic-renderer-error {\n padding: 1rem;\n background: #fee2e2;\n border: 1px dashed #ef4444;\n color: #dc2626;\n border-radius: 4px;\n font-size: 0.875rem;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DynamicRendererComponent {\n private readonly registry = inject(ComponentRegistryService);\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly destroyRef = inject(DestroyRef);\n\n /** Element to render */\n readonly element = input.required<EditorElement>();\n\n /** Additional context (sectionId, index, etc.) */\n readonly context = input<Record<string, unknown>>({});\n\n /** Error state signal */\n readonly error = signal(false);\n\n private componentRef: ComponentRef<unknown> | null = null;\n private currentType: string | null = null;\n private currentAvailableInputs: Set<string> | null = null;\n private previousInputs = new Map<string, unknown>();\n\n constructor() {\n effect(() => {\n const el = this.element();\n const ctx = this.context();\n\n if (this.componentRef && this.currentType === el.type) {\n // Same type: update only inputs that changed\n this.updateInputs(el, ctx);\n } else {\n // Different type or first render: full create\n this.renderComponent(el, ctx);\n }\n });\n\n this.destroyRef.onDestroy(() => {\n this.cleanup();\n });\n }\n\n private renderComponent(element: EditorElement, context: Record<string, unknown>): void {\n this.cleanup();\n\n const componentType = this.registry.getComponent(element.type);\n if (!componentType) {\n this.error.set(true);\n this.currentType = null;\n this.currentAvailableInputs = null;\n const all = this.registry.getAll();\n const hasType = this.registry.has(element.type);\n console.warn(\n `DynamicRenderer: No component registered for type \"${element.type}\".`,\n hasType\n ? `Definition exists but has no \"component\" class (manifest-only).`\n : `Registry has ${all.length} definition(s): [${all.map(d => d.type).join(', ')}]`,\n );\n return;\n }\n\n this.error.set(false);\n this.currentType = element.type;\n this.previousInputs.clear();\n this.componentRef = this.viewContainerRef.createComponent(componentType);\n this.currentAvailableInputs = this.getComponentInputs(componentType);\n\n // Stamp the host element so canvas elements are discoverable by ID\n const hostEl = this.componentRef.location.nativeElement as HTMLElement;\n if (hostEl?.setAttribute) {\n hostEl.setAttribute('data-element-id', element.id);\n }\n\n this.updateInputs(element, context);\n }\n\n private updateInputs(element: EditorElement, context: Record<string, unknown>): void {\n if (!this.componentRef || !this.currentAvailableInputs) return;\n\n const availableInputs = this.currentAvailableInputs;\n\n // Pass props — only call setInput when the value actually changed\n for (const [key, value] of Object.entries(element.props)) {\n if (availableInputs.has(key)) {\n this.setInputIfChanged(key, value);\n }\n }\n\n // Pass special editor props (only if the component declares them)\n if (availableInputs.has('_elementId')) {\n this.setInputIfChanged('_elementId', element.id);\n }\n\n // Pass children: for sections use 'elements', for elements use 'children'\n if (availableInputs.has('_children')) {\n const children = (element as unknown as { elements?: unknown[] }).elements ?? element.children;\n this.setInputIfChanged('_children', children ?? []);\n }\n\n if (availableInputs.has('_context')) {\n this.setInputIfChanged('_context', context);\n }\n }\n\n private setInputIfChanged(key: string, value: unknown): void {\n if (this.previousInputs.get(key) !== value) {\n this.previousInputs.set(key, value);\n this.componentRef!.setInput(key, value);\n }\n }\n\n private getComponentInputs(componentType: Type<unknown>): Set<string> {\n const mirror = reflectComponentType(componentType);\n if (!mirror) {\n return new Set();\n }\n return new Set(mirror.inputs.map(i => i.propName));\n }\n\n private cleanup(): void {\n if (this.componentRef) {\n this.componentRef.destroy();\n this.componentRef = null;\n }\n this.viewContainerRef.clear();\n }\n}\n","import { Component, ChangeDetectionStrategy, input, computed, inject } from '@angular/core';\nimport { ComponentRegistryService } from '../registry/component-registry.service';\nimport { EditorElement } from '../store/visual-editor.state';\nimport { SlotDefinition } from '../registry/slot.types';\nimport { DynamicRendererComponent } from './dynamic-renderer.component';\n\n/**\n * Renders child elements within a specific slot\n */\n@Component({\n selector: 'lib-slot-renderer',\n imports: [DynamicRendererComponent],\n template: `\n @if (filteredChildren().length === 0 && slot().emptyPlaceholder) {\n <div class=\"slot-empty\" [attr.data-slot]=\"slot().name\">\n {{ slot().emptyPlaceholder }}\n </div>\n } @else {\n @for (child of filteredChildren(); track child.id; let idx = $index) {\n <lib-dynamic-renderer\n [element]=\"child\"\n [context]=\"{ slotName: slot().name, index: idx, parentId: parentElementId() }\"\n />\n }\n }\n `,\n styles: `\n :host {\n display: contents;\n }\n .slot-empty {\n padding: 2rem;\n border: 2px dashed #d1d5db;\n color: #9ca3af;\n text-align: center;\n border-radius: 4px;\n font-size: 0.875rem;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SlotRendererComponent {\n private readonly registry = inject(ComponentRegistryService);\n\n /** Slot definition */\n readonly slot = input.required<SlotDefinition>();\n\n /** All children of the parent element */\n readonly children = input.required<EditorElement[]>();\n\n /** Parent element ID */\n readonly parentElementId = input.required<string>();\n\n /** Children filtered by slot name and constraints */\n readonly filteredChildren = computed(() => {\n const slotDef = this.slot();\n const allChildren = this.children() ?? [];\n\n return allChildren.filter((child) => {\n // Filter by slot name - children must match the slot they belong to\n // Children without slotName go to the 'default' slot (or first slot)\n const childSlot = child.slotName ?? 'default';\n if (childSlot !== slotDef.name && slotDef.name !== 'default') {\n return false;\n }\n\n // Check allowed types\n if (slotDef.constraints?.allowedTypes?.length) {\n if (!slotDef.constraints.allowedTypes.includes(child.type)) {\n return false;\n }\n }\n\n // Check disallowed types\n if (slotDef.constraints?.disallowedTypes?.length) {\n if (slotDef.constraints.disallowedTypes.includes(child.type)) {\n return false;\n }\n }\n\n return true;\n });\n });\n}\n","import { Injectable, computed, inject } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { Observable, tap } from 'rxjs';\nimport { ComponentRegistryService } from '../registry/component-registry.service';\nimport { ComponentDefinition, ComponentPreset, PresetBlockConfig } from '../registry/component-definition.types';\nimport { ResolvedPreset } from '../registry/component-registry.service';\nimport { SlotDefinition } from '../registry/slot.types';\nimport { VisualEditorActions } from '../store/visual-editor.actions';\nimport {\n selectSelectedElement,\n selectSelectedSection,\n selectSections,\n selectCanUndo,\n selectCanRedo,\n selectIsDragging,\n selectSelectedBlock,\n selectSelectedBlockSlotName,\n selectCurrentPage,\n selectCurrentPageId,\n selectIsDirty,\n selectIsPageLoaded,\n} from '../store/visual-editor.selectors';\nimport { EditorElement, EditorSection } from '../store/visual-editor.state';\nimport { PageService } from './page.service';\nimport {\n CreatePageRequest,\n Page,\n PageContext,\n PageSummary,\n UpdatePageRequest,\n} from '../models/page.model';\n\n/**\n * Recursively find an element by ID in a tree of elements\n */\nfunction findElementRecursive(elements: EditorElement[], elementId: string): EditorElement | null {\n for (const element of elements) {\n if (element.id === elementId) {\n return element;\n }\n if (element.children && element.children.length > 0) {\n const found = findElementRecursive(element.children, elementId);\n if (found) {\n return found;\n }\n }\n }\n return null;\n}\n\n/**\n * Facade service that combines Store operations with ComponentRegistry\n */\n@Injectable({ providedIn: 'root' })\nexport class VisualEditorFacade {\n private readonly store = inject(Store);\n private readonly registry = inject(ComponentRegistryService);\n private readonly pageService = inject(PageService);\n\n // State signals\n readonly sections = toSignal(this.store.select(selectSections), { initialValue: [] });\n readonly selectedElement = toSignal(this.store.select(selectSelectedElement), {\n initialValue: null,\n });\n readonly selectedSection = toSignal(this.store.select(selectSelectedSection), {\n initialValue: null,\n });\n readonly canUndo = toSignal(this.store.select(selectCanUndo), { initialValue: false });\n readonly canRedo = toSignal(this.store.select(selectCanRedo), { initialValue: false });\n readonly isDragging = toSignal(this.store.select(selectIsDragging), { initialValue: false });\n readonly selectedBlock = toSignal(this.store.select(selectSelectedBlock), { initialValue: null });\n readonly selectedBlockSlotName = toSignal(this.store.select(selectSelectedBlockSlotName), {\n initialValue: null,\n });\n\n // Page state signals\n readonly currentPage = toSignal(this.store.select(selectCurrentPage), { initialValue: null });\n readonly currentPageId = toSignal(this.store.select(selectCurrentPageId), { initialValue: null });\n readonly isDirty = toSignal(this.store.select(selectIsDirty), { initialValue: false });\n readonly isPageLoaded = toSignal(this.store.select(selectIsPageLoaded), { initialValue: false });\n\n // Computed: definition of selected element\n readonly selectedElementDefinition = computed<ComponentDefinition | null>(() => {\n const element = this.selectedElement();\n if (!element) return null;\n return this.registry.get(element.type) ?? null;\n });\n\n // Computed: definition of selected section\n readonly selectedSectionDefinition = computed<ComponentDefinition | null>(() => {\n const section = this.selectedSection();\n if (!section) return null;\n return this.registry.get(section.type) ?? null;\n });\n\n // Computed: definition of selected block\n readonly selectedBlockDefinition = computed<ComponentDefinition | null>(() => {\n const block = this.selectedBlock();\n if (!block) return null;\n return this.registry.get(block.type) ?? null;\n });\n\n // Registry access\n readonly availableSections = computed(() => this.registry.getSections());\n readonly availableElements = computed(() => this.registry.getElements());\n readonly availableBlocks = computed(() => this.registry.getBlocks());\n\n // Preset-aware computed signals\n readonly availableSectionPresets = computed(() => this.registry.getSectionPresets());\n readonly availableBlockPresets = computed(() => this.registry.getBlockPresets());\n\n /**\n * Create a new element with default props from registry\n */\n createElementWithDefaults(type: string, overrides?: Partial<EditorElement>): EditorElement {\n const defaultProps = this.registry.getDefaultProps(type);\n return {\n id: crypto.randomUUID(),\n type,\n props: { ...defaultProps, ...overrides?.props },\n children: overrides?.children,\n };\n }\n\n /**\n * Create a new section with default props from registry\n */\n createSectionWithDefaults(type: string, overrides?: Partial<EditorSection>): EditorSection {\n const defaultProps = this.registry.getDefaultProps(type);\n return {\n id: crypto.randomUUID(),\n type,\n props: { ...defaultProps, ...overrides?.props },\n elements: overrides?.elements ?? [],\n };\n }\n\n /**\n * Add a section to the editor\n */\n addSection(type: string, index?: number): void {\n const section = this.createSectionWithDefaults(type);\n this.store.dispatch(VisualEditorActions.addSection({ section, index }));\n }\n\n /**\n * Add an element to a section\n */\n addElement(sectionId: string, type: string, index?: number): void {\n const element = this.createElementWithDefaults(type);\n this.store.dispatch(VisualEditorActions.addElement({ sectionId, element, index }));\n }\n\n /**\n * Remove a section\n */\n removeSection(sectionId: string): void {\n this.store.dispatch(VisualEditorActions.removeSection({ sectionId }));\n }\n\n /**\n * Remove an element\n */\n removeElement(sectionId: string, elementId: string): void {\n this.store.dispatch(VisualEditorActions.removeElement({ sectionId, elementId }));\n }\n\n /**\n * Move a section to a new index\n */\n moveSection(sectionId: string, newIndex: number): void {\n this.store.dispatch(VisualEditorActions.moveSection({ sectionId, newIndex }));\n }\n\n /**\n * Move an element within or between sections\n */\n moveElement(\n sourceSectionId: string,\n targetSectionId: string,\n elementId: string,\n newIndex: number\n ): void {\n this.store.dispatch(\n VisualEditorActions.moveElement({ sourceSectionId, targetSectionId, elementId, newIndex })\n );\n }\n\n // ========== Rename Operations ==========\n\n /**\n * Rename a section (set adminLabel)\n */\n renameSection(sectionId: string, adminLabel: string): void {\n this.store.dispatch(VisualEditorActions.renameSection({ sectionId, adminLabel }));\n }\n\n /**\n * Rename a block (set adminLabel)\n */\n renameBlock(sectionId: string, elementId: string, adminLabel: string): void {\n this.store.dispatch(VisualEditorActions.renameBlock({ sectionId, elementId, adminLabel }));\n }\n\n // ========== Block Operations ==========\n\n /**\n * Create a block element with default props and slotName\n */\n createBlockWithDefaults(\n type: string,\n slotName: string,\n overrides?: Partial<EditorElement>\n ): EditorElement {\n const defaultProps = this.registry.getDefaultProps(type);\n // Initialize children array if the block type has slots\n const hasSlots = this.registry.hasSlots(type);\n return {\n id: crypto.randomUUID(),\n type,\n props: { ...defaultProps, ...overrides?.props },\n slotName,\n children: overrides?.children ?? (hasSlots ? [] : undefined),\n };\n }\n\n /**\n * Add a block to a section's slot\n */\n addBlock(sectionId: string, slotName: string, type: string, index?: number): void {\n const element = this.createBlockWithDefaults(type, slotName);\n this.store.dispatch(VisualEditorActions.addBlock({ sectionId, slotName, element, index }));\n }\n\n // ========== Preset Operations ==========\n\n /**\n * Add a section from a resolved preset.\n * Merges preset settings into default props and creates pre-configured blocks.\n */\n addSectionFromPreset(resolvedPreset: ResolvedPreset, index?: number): void {\n const { definition, preset } = resolvedPreset;\n const props = this.registry.getPresetProps(definition.type, preset);\n const elements = this.createPresetBlocks(definition, preset);\n\n const section: EditorSection = {\n id: crypto.randomUUID(),\n type: definition.type,\n props,\n elements,\n };\n\n this.store.dispatch(VisualEditorActions.addSection({ section, index }));\n }\n\n /**\n * Add a block from a resolved preset to a section's slot.\n */\n addBlockFromPreset(\n sectionId: string,\n slotName: string,\n resolvedPreset: ResolvedPreset,\n index?: number\n ): void {\n const { definition, preset } = resolvedPreset;\n const props = this.registry.getPresetProps(definition.type, preset);\n const hasSlots = this.registry.hasSlots(definition.type);\n\n const element: EditorElement = {\n id: crypto.randomUUID(),\n type: definition.type,\n props,\n slotName,\n children: hasSlots ? this.createPresetBlockChildren(preset?.blocks) : undefined,\n };\n\n this.store.dispatch(VisualEditorActions.addBlock({ sectionId, slotName, element, index }));\n }\n\n /**\n * Generate EditorElement[] from a preset's blocks configuration\n */\n private createPresetBlocks(\n definition: ComponentDefinition,\n preset: ComponentPreset | null\n ): EditorElement[] {\n if (!preset?.blocks || preset.blocks.length === 0) return [];\n\n const defaultSlotName = definition.slots?.[0]?.name ?? 'default';\n\n return preset.blocks.map((blockConfig) => {\n const blockProps = this.registry.getPresetProps(blockConfig.type, {\n name: blockConfig.type,\n settings: blockConfig.settings,\n });\n const hasSlots = this.registry.hasSlots(blockConfig.type);\n\n return {\n id: crypto.randomUUID(),\n type: blockConfig.type,\n props: blockProps,\n slotName: blockConfig.slotName ?? defaultSlotName,\n children: hasSlots ? this.createPresetBlockChildren(blockConfig.blocks) : undefined,\n };\n });\n }\n\n /**\n * Generate children for blocks that have slots, from preset block configs\n */\n private createPresetBlockChildren(blockConfigs?: PresetBlockConfig[]): EditorElement[] {\n if (!blockConfigs || blockConfigs.length === 0) return [];\n\n return blockConfigs.map((blockConfig) => {\n const blockProps = this.registry.getPresetProps(blockConfig.type, {\n name: blockConfig.type,\n settings: blockConfig.settings,\n });\n const hasSlots = this.registry.hasSlots(blockConfig.type);\n\n return {\n id: crypto.randomUUID(),\n type: blockConfig.type,\n props: blockProps,\n slotName: blockConfig.slotName ?? 'default',\n children: hasSlots ? this.createPresetBlockChildren(blockConfig.blocks) : undefined,\n };\n });\n }\n\n /**\n * Remove a block from a section\n */\n removeBlock(sectionId: string, elementId: string): void {\n this.store.dispatch(VisualEditorActions.removeBlock({ sectionId, elementId }));\n }\n\n /**\n * Move a block within a section (can change slots)\n */\n moveBlock(sectionId: string, elementId: string, targetSlotName: string, newIndex: number): void {\n this.store.dispatch(\n VisualEditorActions.moveBlock({ sectionId, elementId, targetSlotName, newIndex })\n );\n }\n\n // ========== Duplicate Operations ==========\n\n /**\n * Check if a section type can be duplicated\n */\n isSectionDuplicable(type: string): boolean {\n const def = this.registry.get(type);\n return def?.duplicable !== false;\n }\n\n /**\n * Check if a block type can be duplicated\n */\n isBlockDuplicable(type: string): boolean {\n const def = this.registry.get(type);\n return def?.duplicable !== false;\n }\n\n /**\n * Duplicate a section (deep clone with new IDs)\n */\n duplicateSection(sectionId: string): void {\n this.store.dispatch(VisualEditorActions.duplicateSection({ sectionId }));\n }\n\n /**\n * Duplicate a block within a section\n */\n duplicateBlock(sectionId: string, elementId: string): void {\n this.store.dispatch(VisualEditorActions.duplicateBlock({ sectionId, elementId }));\n }\n\n /**\n * Duplicate a nested block\n */\n duplicateNestedBlock(sectionId: string, parentPath: string[], elementId: string): void {\n this.store.dispatch(\n VisualEditorActions.duplicateNestedBlock({ sectionId, parentPath, elementId })\n );\n }\n\n /**\n * Update block props with validation (works for both direct and nested blocks)\n */\n updateBlockProps(sectionId: string, elementId: string, props: Record<string, unknown>): void {\n const section = this.sections().find((s) => s.id === sectionId);\n if (!section) return;\n\n // Search recursively for the block (may be nested)\n const block = findElementRecursive(section.elements, elementId);\n\n if (block) {\n const errors = this.registry.validateProps(block.type, { ...block.props, ...props });\n if (errors.size === 0) {\n this.store.dispatch(VisualEditorActions.updateBlockProps({ sectionId, elementId, props }));\n } else {\n console.warn('Validation errors:', Object.fromEntries(errors));\n }\n }\n }\n\n /**\n * Get blocks for a specific slot in a section\n */\n getBlocksForSlot(sectionId: string, slotName: string): EditorElement[] {\n const section = this.sections().find((s) => s.id === sectionId);\n if (!section) return [];\n return section.elements.filter((e) => e.slotName === slotName);\n }\n\n /**\n * Get allowed block types for a slot\n */\n getAllowedBlocksForSlot(sectionType: string, slotName: string): ComponentDefinition[] {\n const slots = this.registry.getSlots(sectionType);\n const slot = slots.find((s) => s.name === slotName);\n const allowedTypes = slot?.constraints?.allowedTypes;\n\n if (!allowedTypes || allowedTypes.length === 0) {\n return this.availableBlocks();\n }\n\n return this.availableBlocks().filter((block) => allowedTypes.includes(block.type));\n }\n\n // ========== Nested Block Operations ==========\n\n /**\n * Check if a component type has slots (can contain nested blocks)\n */\n hasSlots(type: string): boolean {\n return this.registry.hasSlots(type);\n }\n\n /**\n * Get slots for a block type\n */\n getBlockSlots(type: string): SlotDefinition[] {\n return this.registry.getSlots(type);\n }\n\n /**\n * Check if adding a nested block is allowed (max 12 levels)\n */\n canAddNestedBlock(parentPath: string[]): boolean {\n return parentPath.length < 12;\n }\n\n /**\n * Add a nested block to a parent element\n */\n addNestedBlock(\n sectionId: string,\n parentPath: string[],\n slotName: string,\n type: string,\n index?: number\n ): void {\n if (!this.canAddNestedBlock(parentPath)) {\n console.warn('Maximum nesting depth (12) reached');\n return;\n }\n\n const element = this.createBlockWithDefaults(type, slotName);\n this.store.dispatch(\n VisualEditorActions.addNestedBlock({ sectionId, parentPath, slotName, element, index })\n );\n }\n\n /**\n * Remove a nested block from a parent element\n */\n removeNestedBlock(sectionId: string, parentPath: string[], elementId: string): void {\n this.store.dispatch(\n VisualEditorActions.removeNestedBlock({ sectionId, parentPath, elementId })\n );\n }\n\n /**\n * Update nested block props\n */\n updateNestedBlockProps(\n sectionId: string,\n parentPath: string[],\n elementId: string,\n props: Record<string, unknown>\n ): void {\n this.store.dispatch(\n VisualEditorActions.updateNestedBlockProps({ sectionId, parentPath, elementId, props })\n );\n }\n\n /**\n * Move a nested block within its parent\n */\n moveNestedBlock(\n sectionId: string,\n parentPath: string[],\n elementId: string,\n targetSlotName: string,\n newIndex: number\n ): void {\n this.store.dispatch(\n VisualEditorActions.moveNestedBlock({ sectionId, parentPath, elementId, targetSlotName, newIndex })\n );\n }\n\n /**\n * Reparent a block: move it from one parent/section to another\n */\n reparentBlock(\n sourceSectionId: string,\n sourceParentPath: string[],\n elementId: string,\n targetSectionId: string,\n targetParentPath: string[],\n targetSlotName: string,\n targetIndex: number\n ): void {\n this.store.dispatch(\n VisualEditorActions.reparentBlock({\n sourceSectionId,\n sourceParentPath,\n elementId,\n targetSectionId,\n targetParentPath,\n targetSlotName,\n targetIndex,\n })\n );\n }\n\n /**\n * Get children of an element filtered by slot\n */\n getElementChildren(element: EditorElement, slotName?: string): EditorElement[] {\n const children = element.children ?? [];\n if (!slotName) return children;\n return children.filter((c) => c.slotName === slotName);\n }\n\n /**\n * Get allowed blocks for a nested slot\n */\n getAllowedBlocksForNestedSlot(parentType: string, slotName: string): ComponentDefinition[] {\n const slots = this.registry.getSlots(parentType);\n const slot = slots.find((s) => s.name === slotName);\n const allowedTypes = slot?.constraints?.allowedTypes;\n\n if (!allowedTypes || allowedTypes.length === 0) {\n return this.availableBlocks();\n }\n\n return this.availableBlocks().filter((block) => allowedTypes.includes(block.type));\n }\n\n /**\n * Select an element\n */\n selectElement(sectionId: string | null, elementId: string | null): void {\n this.store.dispatch(VisualEditorActions.selectElement({ sectionId, elementId }));\n }\n\n /**\n * Clear selection\n */\n clearSelection(): void {\n this.store.dispatch(VisualEditorActions.clearSelection());\n }\n\n /**\n * Update element props with validation\n */\n updateElementProps(sectionId: string, elementId: string, props: Record<string, unknown>): void {\n const element = this.sections()\n .find((s) => s.id === sectionId)\n ?.elements.find((e) => e.id === elementId);\n\n if (element) {\n const errors = this.registry.validateProps(element.type, { ...element.props, ...props });\n if (errors.size === 0) {\n this.store.dispatch(VisualEditorActions.updateElementProps({ sectionId, elementId, props }));\n } else {\n console.warn('Validation errors:', Object.fromEntries(errors));\n }\n }\n }\n\n /**\n * Update section props with validation\n */\n updateSectionProps(sectionId: string, props: Record<string, unknown>): void {\n const section = this.sections().find((s) => s.id === sectionId);\n\n if (section) {\n const errors = this.registry.validateProps(section.type, { ...section.props, ...props });\n if (errors.size === 0) {\n this.store.dispatch(VisualEditorActions.updateSectionProps({ sectionId, props }));\n } else {\n console.warn('Validation errors:', Object.fromEntries(errors));\n }\n }\n }\n\n /**\n * Undo last action\n */\n undo(): void {\n this.store.dispatch(VisualEditorActions.undo());\n }\n\n /**\n * Redo last undone action\n */\n redo(): void {\n this.store.dispatch(VisualEditorActions.redo());\n }\n\n /**\n * Load sections into the editor\n */\n loadSections(sections: EditorSection[]): void {\n this.store.dispatch(VisualEditorActions.loadSections({ sections }));\n }\n\n /**\n * Reset editor to initial state\n */\n resetEditor(): void {\n this.store.dispatch(VisualEditorActions.resetEditor());\n }\n\n /**\n * Get component definition by type\n */\n getDefinition(type: string): ComponentDefinition | undefined {\n return this.registry.get(type);\n }\n\n /**\n * Search components\n */\n searchComponents(query: string): ComponentDefinition[] {\n return this.registry.search(query);\n }\n\n // ========== Page Operations ==========\n\n /**\n * Get all pages (summaries)\n */\n getPages(): Observable<PageSummary[]> {\n return this.pageService.getPages();\n }\n\n /**\n * Get a page by ID and load it into the editor\n */\n getPage(id: string): Observable<Page> {\n return this.pageService.getPage(id);\n }\n\n /**\n * Get a published page by slug (for public rendering)\n */\n getPublishedPageBySlug(slug: string): Observable<Page> {\n return this.pageService.getPublishedPageBySlug(slug);\n }\n\n /**\n * Load a page into the editor\n */\n loadPage(page: Page): void {\n this.store.dispatch(VisualEditorActions.loadPage({ page }));\n }\n\n /**\n * Create a new page\n */\n createPage(request: CreatePageRequest): Observable<Page> {\n return this.pageService.createPage(request);\n }\n\n /**\n * Save current editor state to a page\n */\n savePage(pageId: string): Observable<Page> {\n const currentPage = this.currentPage();\n if (!currentPage) {\n throw new Error('No page loaded in editor');\n }\n\n const request: UpdatePageRequest = {\n sections: this.sections(),\n version: currentPage.version,\n };\n\n console.log('Saving page:', request);\n\n return this.pageService.updatePage(pageId, request).pipe(\n tap((page) => {\n this.store.dispatch(\n VisualEditorActions.updatePageContext({\n context: { version: page.version },\n })\n );\n this.store.dispatch(VisualEditorActions.markClean());\n })\n );\n }\n\n /**\n * Update page metadata (title, slug, etc.)\n */\n updatePageMetadata(pageId: string, metadata: Partial<PageContext>): Observable<Page> {\n const currentPage = this.currentPage();\n if (!currentPage) {\n throw new Error('No page loaded in editor');\n }\n\n const request: UpdatePageRequest = {\n ...metadata,\n version: currentPage.version,\n };\n\n return this.pageService.updatePage(pageId, request).pipe(\n tap((page) => {\n this.store.dispatch(\n VisualEditorActions.updatePageContext({\n context: {\n title: page.title,\n slug: page.slug,\n version: page.version,\n },\n })\n );\n })\n );\n }\n\n /**\n * Delete a page\n */\n deletePage(id: string): Observable<void> {\n return this.pageService.deletePage(id);\n }\n\n /**\n * Publish a page\n */\n publishPage(pageId: string): Observable<Page> {\n const currentPage = this.currentPage();\n if (!currentPage) {\n throw new Error('No page loaded in editor');\n }\n\n return this.pageService.publishPage(pageId, { version: currentPage.version }).pipe(\n tap((page) => {\n this.store.dispatch(\n VisualEditorActions.updatePageContext({\n context: { status: page.status, version: page.version },\n })\n );\n })\n );\n }\n\n /**\n * Unpublish a page\n */\n unpublishPage(pageId: string): Observable<Page> {\n const currentPage = this.currentPage();\n if (!currentPage) {\n throw new Error('No page loaded in editor');\n }\n\n return this.pageService.unpublishPage(pageId, { version: currentPage.version }).pipe(\n tap((page) => {\n this.store.dispatch(\n VisualEditorActions.updatePageContext({\n context: { status: page.status, version: page.version },\n })\n );\n })\n );\n }\n\n /**\n * Duplicate a page\n */\n duplicatePage(id: string): Observable<Page> {\n return this.pageService.duplicatePage(id);\n }\n\n /**\n * Clear the current page from editor\n */\n clearPage(): void {\n this.store.dispatch(VisualEditorActions.clearPage());\n }\n\n /**\n * Mark editor as dirty (has unsaved changes)\n */\n markDirty(): void {\n this.store.dispatch(VisualEditorActions.markDirty());\n }\n\n /**\n * Mark editor as clean (no unsaved changes)\n */\n markClean(): void {\n this.store.dispatch(VisualEditorActions.markClean());\n }\n}\n","import { Injectable, NgZone, inject, OnDestroy } from '@angular/core';\nimport { Observable, Subject, filter, map } from 'rxjs';\nimport { EditorSection } from '../store/visual-editor.state';\n\n// ─── Message Protocol ───────────────────────────────────────────────────────\n\n/** Parent → Iframe */\nexport interface PageUpdateMessage {\n type: 'kustomizer:page-update';\n sections: EditorSection[];\n}\n\nexport interface SelectElementMessage {\n type: 'kustomizer:select-element';\n elementId: string;\n}\n\nexport interface DeselectMessage {\n type: 'kustomizer:deselect';\n}\n\n/** Iframe → Parent */\nexport interface ReadyMessage {\n type: 'kustomizer:ready';\n}\n\nexport interface ElementClickedMessage {\n type: 'kustomizer:element-clicked';\n elementId: string;\n sectionId: string;\n}\n\nexport interface ElementHoverMessage {\n type: 'kustomizer:element-hover';\n elementId: string | null;\n}\n\nexport interface ElementMovedMessage {\n type: 'kustomizer:element-moved';\n elementId: string;\n newIndex: number;\n targetSectionId?: string;\n}\n\ntype OutboundMessage = PageUpdateMessage | SelectElementMessage | DeselectMessage;\ntype InboundMessage =\n | ReadyMessage\n | ElementClickedMessage\n | ElementHoverMessage\n | ElementMovedMessage;\n\n/**\n * Manages postMessage communication between the editor (parent) and the\n * storefront preview (iframe).\n */\n@Injectable()\nexport class IframeBridgeService implements OnDestroy {\n private readonly zone = inject(NgZone);\n private iframe: HTMLIFrameElement | null = null;\n private origin = '*';\n private readonly messages$ = new Subject<InboundMessage>();\n private readonly messageHandler = (event: MessageEvent) => this.handleMessage(event);\n\n constructor() {\n this.zone.runOutsideAngular(() => {\n window.addEventListener('message', this.messageHandler);\n });\n }\n\n ngOnDestroy(): void {\n window.removeEventListener('message', this.messageHandler);\n this.messages$.complete();\n }\n\n /**\n * Connect to an iframe element. Must be called after the iframe loads.\n */\n connect(iframe: HTMLIFrameElement, origin: string): void {\n this.iframe = iframe;\n this.origin = origin || '*';\n }\n\n /**\n * Disconnect from the current iframe.\n */\n disconnect(): void {\n this.iframe = null;\n }\n\n // ─── Outbound (Parent → Iframe) ──────────────────────────────────────────\n\n sendPageUpdate(sections: EditorSection[]): void {\n this.send({ type: 'kustomizer:page-update', sections });\n }\n\n sendSelectElement(elementId: string): void {\n this.send({ type: 'kustomizer:select-element', elementId });\n }\n\n sendDeselect(): void {\n this.send({ type: 'kustomizer:deselect' });\n }\n\n // ─── Inbound (Iframe → Parent) ───────────────────────────────────────────\n\n onReady(): Observable<void> {\n return this.messages$.pipe(\n filter((msg): msg is ReadyMessage => msg.type === 'kustomizer:ready'),\n map(() => undefined),\n );\n }\n\n onElementClicked(): Observable<{ elementId: string; sectionId: string }> {\n return this.messages$.pipe(\n filter(\n (msg): msg is ElementClickedMessage =>\n msg.type === 'kustomizer:element-clicked',\n ),\n map(({ elementId, sectionId }) => ({ elementId, sectionId })),\n );\n }\n\n onElementHover(): Observable<string | null> {\n return this.messages$.pipe(\n filter(\n (msg): msg is ElementHoverMessage =>\n msg.type === 'kustomizer:element-hover',\n ),\n map(({ elementId }) => elementId),\n );\n }\n\n onElementMoved(): Observable<{\n elementId: string;\n newIndex: number;\n targetSectionId?: string;\n }> {\n return this.messages$.pipe(\n filter(\n (msg): msg is ElementMovedMessage =>\n msg.type === 'kustomizer:element-moved',\n ),\n map(({ elementId, newIndex, targetSectionId }) => ({\n elementId,\n newIndex,\n targetSectionId,\n })),\n );\n }\n\n // ─── Private ─────────────────────────────────────────────────────────────\n\n private send(message: OutboundMessage): void {\n if (!this.iframe?.contentWindow) return;\n this.iframe.contentWindow.postMessage(message, this.origin);\n }\n\n private handleMessage(event: MessageEvent): void {\n const data = event.data as InboundMessage | null;\n if (!data?.type?.startsWith('kustomizer:')) return;\n\n // Only accept messages from the connected iframe's origin\n if (this.origin !== '*' && event.origin !== this.origin) return;\n\n this.zone.run(() => {\n this.messages$.next(data);\n });\n }\n}\n","import { Injectable, inject, signal } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { firstValueFrom } from 'rxjs';\nimport { STOREFRONT_URL } from '../models/page.model';\n\n/**\n * Service that holds and dynamically loads the per-merchant storefront URL.\n *\n * Resolution order:\n * 1. Metafield value loaded from GET /api/storefront-url (per-shop)\n * 2. Static STOREFRONT_URL injection token (env var / window global fallback)\n * 3. Empty string (editor works with local components only)\n */\n@Injectable({ providedIn: 'root' })\nexport class StorefrontUrlService {\n private readonly http = inject(HttpClient);\n private readonly staticUrl = inject(STOREFRONT_URL);\n\n /** Current storefront URL — reactive signal used by the editor and iframe. */\n readonly url = signal('');\n\n /**\n * Load the storefront URL from the backend metafield.\n * Falls back to the static STOREFRONT_URL token if the endpoint\n * returns no value or fails.\n *\n * Called during APP_INITIALIZER.\n */\n async load(): Promise<void> {\n try {\n const res = await firstValueFrom(\n this.http.get<{ url: string }>('/api/storefront-url'),\n );\n if (res.url) {\n this.url.set(res.url);\n return;\n }\n } catch {\n // Non-fatal — fall back to static token\n }\n\n // Fallback: use the static injection token (env var / window global)\n if (this.staticUrl) {\n this.url.set(this.staticUrl);\n }\n }\n}\n","import { Injectable, inject, signal, computed } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { DragItem, DropTarget, DropZone } from './drag-drop.types';\nimport { VisualEditorActions } from '../store/visual-editor.actions';\nimport { selectSections } from '../store/visual-editor.selectors';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { EditorElement } from '../store/visual-editor.state';\nimport { ComponentRegistryService } from '../registry/component-registry.service';\n\nconst MAX_DEPTH = 12;\n\n@Injectable({ providedIn: 'root' })\nexport class DragDropService {\n private readonly store = inject(Store);\n private readonly registry = inject(ComponentRegistryService);\n private readonly sections = toSignal(this.store.select(selectSections), { initialValue: [] });\n\n readonly dragItem = signal<DragItem | null>(null);\n readonly dropTarget = signal<DropTarget | null>(null);\n readonly isDragging = computed(() => this.dragItem() !== null);\n\n startDrag(item: DragItem, event: DragEvent): void {\n this.dragItem.set(item);\n this.store.dispatch(VisualEditorActions.startDrag({ elementId: item.elementId }));\n\n if (event.dataTransfer) {\n event.dataTransfer.effectAllowed = 'move';\n event.dataTransfer.setData('text/plain', item.elementId);\n }\n }\n\n endDrag(): void {\n this.dragItem.set(null);\n this.dropTarget.set(null);\n this.store.dispatch(VisualEditorActions.endDrag());\n }\n\n updateDropTarget(target: DropTarget | null): void {\n this.dropTarget.set(target);\n }\n\n computeDropZone(event: DragEvent, element: HTMLElement, canDropInside: boolean): DropZone {\n const rect = element.getBoundingClientRect();\n const y = event.clientY - rect.top;\n const ratio = y / rect.height;\n\n if (canDropInside) {\n if (ratio < 0.25) return 'before';\n if (ratio > 0.75) return 'after';\n return 'inside';\n }\n\n return ratio < 0.5 ? 'before' : 'after';\n }\n\n validateDrop(item: DragItem, target: DropTarget): boolean {\n // Rule 1: Cannot drop on itself\n if (item.elementId === target.sectionId && target.parentPath.length === 0 && item.kind === 'section') {\n return false;\n }\n\n // Rule 2: Sections only reorder among sections\n if (item.kind === 'section' && target.kind !== 'section') {\n return false;\n }\n if (item.kind !== 'section' && target.kind === 'section') {\n return false;\n }\n\n // For blocks:\n if (item.kind === 'block') {\n // Rule 1 for blocks: cannot drop on itself\n if (target.zone === 'inside' && this.isDropOnSelf(item, target)) {\n return false;\n }\n\n // Rule 3: Cannot create circular reference\n if (target.zone === 'inside' && this.wouldCreateCircular(item, target)) {\n return false;\n }\n\n // Rule 4: Respect slot type constraints\n if (!this.isTypeAllowedInSlot(item, target)) {\n return false;\n }\n\n // Rule 5: Max depth\n if (target.zone === 'inside' && target.depth + 1 >= MAX_DEPTH) {\n return false;\n }\n }\n\n return true;\n }\n\n executeDrop(): void {\n const item = this.dragItem();\n const target = this.dropTarget();\n if (!item || !target) return;\n\n if (!this.validateDrop(item, target)) {\n this.endDrag();\n return;\n }\n\n if (item.kind === 'section') {\n this.executeSectionDrop(item, target);\n } else {\n this.executeBlockDrop(item, target);\n }\n\n this.endDrag();\n }\n\n private executeSectionDrop(item: DragItem, target: DropTarget): void {\n const sections = this.sections();\n const currentIndex = sections.findIndex((s) => s.id === item.elementId);\n if (currentIndex === -1) return;\n\n let newIndex = target.index;\n if (currentIndex < newIndex) {\n newIndex--;\n }\n\n this.store.dispatch(VisualEditorActions.moveSection({ sectionId: item.elementId, newIndex }));\n }\n\n private executeBlockDrop(item: DragItem, target: DropTarget): void {\n const isSameParent =\n item.sectionId === target.sectionId &&\n this.pathsEqual(item.parentPath, target.parentPath);\n\n if (isSameParent && target.zone !== 'inside') {\n // Same parent - reorder\n const slotName = target.slotName;\n let newIndex = target.index;\n\n // Adjust index if moving within same slot\n if (item.slotName === slotName && item.sourceIndex < newIndex) {\n newIndex--;\n }\n\n if (item.parentPath.length === 0) {\n this.store.dispatch(VisualEditorActions.moveBlock({\n sectionId: item.sectionId,\n elementId: item.elementId,\n targetSlotName: slotName,\n newIndex,\n }));\n } else {\n this.store.dispatch(VisualEditorActions.moveNestedBlock({\n sectionId: item.sectionId,\n parentPath: item.parentPath,\n elementId: item.elementId,\n targetSlotName: slotName,\n newIndex,\n }));\n }\n } else {\n // Different parent or drop inside - reparent\n let targetParentPath: string[];\n let targetSlotName: string;\n let targetIndex: number;\n\n if (target.zone === 'inside') {\n // Dropping inside a block - the target block becomes the parent\n targetParentPath = target.parentPath;\n targetSlotName = target.slotName;\n targetIndex = target.index;\n } else {\n targetParentPath = target.parentPath;\n targetSlotName = target.slotName;\n targetIndex = target.index;\n }\n\n this.store.dispatch(VisualEditorActions.reparentBlock({\n sourceSectionId: item.sectionId,\n sourceParentPath: item.parentPath,\n elementId: item.elementId,\n targetSectionId: target.sectionId,\n targetParentPath,\n targetSlotName,\n targetIndex,\n }));\n }\n }\n\n private isDropOnSelf(item: DragItem, target: DropTarget): boolean {\n // Check if we're trying to drop an element inside itself\n return target.parentPath.includes(item.elementId);\n }\n\n private wouldCreateCircular(item: DragItem, target: DropTarget): boolean {\n // Cannot drop a parent inside its own descendant\n if (target.parentPath.includes(item.elementId)) {\n return true;\n }\n\n // If the target's parentPath ends with the dragged element, it would be circular\n const lastPathId = target.parentPath[target.parentPath.length - 1];\n if (lastPathId === item.elementId) {\n return true;\n }\n\n // Check if any element in the dragged subtree contains the target parent\n const sections = this.sections();\n const section = sections.find((s) => s.id === item.sectionId);\n if (!section) return false;\n\n const draggedElement = this.findElementInTree(section.elements, item.elementId);\n if (!draggedElement) return false;\n\n // Check if the target element is a descendant of the dragged element\n const targetParentId = target.parentPath[target.parentPath.length - 1];\n if (targetParentId && this.isDescendant(draggedElement, targetParentId)) {\n return true;\n }\n\n return false;\n }\n\n private isTypeAllowedInSlot(item: DragItem, target: DropTarget): boolean {\n // Find the parent element to check its slot constraints\n if (target.parentPath.length === 0) {\n // Dropping at section level\n const section = this.sections().find((s) => s.id === target.sectionId);\n if (!section) return true;\n\n const sectionDef = this.registry.get(section.type);\n if (!sectionDef?.slots) return true;\n\n const slot = sectionDef.slots.find((s) => s.name === target.slotName);\n if (!slot?.constraints?.allowedTypes) return true;\n\n return slot.constraints.allowedTypes.includes(item.elementType);\n }\n\n // Dropping inside a nested block\n const parentId = target.parentPath[target.parentPath.length - 1];\n const section = this.sections().find((s) => s.id === target.sectionId);\n if (!section) return true;\n\n const parentElement = this.findElementInTree(section.elements, parentId);\n if (!parentElement) return true;\n\n const parentDef = this.registry.get(parentElement.type);\n if (!parentDef?.slots) return true;\n\n const slot = parentDef.slots.find((s) => s.name === target.slotName);\n if (!slot?.constraints?.allowedTypes) return true;\n\n return slot.constraints.allowedTypes.includes(item.elementType);\n }\n\n private findElementInTree(elements: EditorElement[], elementId: string): EditorElement | null {\n for (const el of elements) {\n if (el.id === elementId) return el;\n if (el.children?.length) {\n const found = this.findElementInTree(el.children, elementId);\n if (found) return found;\n }\n }\n return null;\n }\n\n private isDescendant(parent: EditorElement, targetId: string): boolean {\n if (!parent.children) return false;\n for (const child of parent.children) {\n if (child.id === targetId) return true;\n if (this.isDescendant(child, targetId)) return true;\n }\n return false;\n }\n\n private pathsEqual(a: string[], b: string[]): boolean {\n if (a.length !== b.length) return false;\n return a.every((id, i) => id === b[i]);\n }\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n input,\n output,\n inject,\n signal,\n computed,\n ElementRef,\n viewChild,\n} from '@angular/core';\nimport { VisualEditorFacade } from '../../services/visual-editor-facade.service';\nimport { DragDropService } from '../../dnd/drag-drop.service';\nimport type { DragItem, DropTarget, DropZone } from '../../dnd/drag-drop.types';\nimport { EditorElement } from '../../store/visual-editor.state';\nimport { SlotDefinition } from '../../registry/slot.types';\n\n/**\n * Context for a block in the tree hierarchy\n */\nexport interface BlockTreeContext {\n sectionId: string;\n parentPath: string[];\n depth: number;\n}\n\n/**\n * Target information for opening the block picker\n */\nexport interface BlockPickerTarget {\n sectionId: string;\n parentPath: string[];\n parentType: string;\n slots: SlotDefinition[];\n}\n\n/**\n * Recursive component for rendering a block in the sidebar tree\n * Supports nested blocks with expand/collapse functionality\n */\n@Component({\n selector: 'lib-block-tree-item',\n imports: [BlockTreeItemComponent],\n template: `\n <div\n class=\"tree-block\"\n #treeBlock\n draggable=\"true\"\n [class.selected]=\"facade.selectedBlock()?.id === block().id\"\n [class.has-children]=\"blockHasSlots()\"\n [class.drag-over-before]=\"dropZone() === 'before'\"\n [class.drag-over-inside]=\"dropZone() === 'inside'\"\n [class.drag-over-after]=\"dropZone() === 'after'\"\n [class.is-dragging]=\"isDragSource()\"\n [style.paddingLeft.rem]=\"0.75 + context().depth * 0.75\"\n [attr.data-drag-id]=\"block().id\"\n (click)=\"onSelect($event)\"\n (dragstart)=\"onDragStart($event)\"\n (dragend)=\"onDragEnd($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n (drop)=\"onDrop($event)\"\n >\n @if (blockHasSlots()) {\n <button\n class=\"expand-btn\"\n [class.expanded]=\"isExpanded()\"\n (click)=\"toggleExpand($event)\"\n [attr.aria-expanded]=\"isExpanded()\"\n [attr.aria-label]=\"isExpanded() ? 'Collapse' : 'Expand'\"\n >\n <span class=\"expand-icon\">&#9654;</span>\n </button>\n } @else {\n <span class=\"block-indent\"></span>\n }\n <span class=\"icon-drag-wrapper\">\n <span class=\"block-icon\">{{ blockIcon() }}</span>\n <span\n class=\"drag-handle\"\n role=\"button\"\n [attr.aria-label]=\"'Drag ' + blockName() + ' to reorder'\"\n [attr.aria-roledescription]=\"'draggable'\"\n tabindex=\"0\"\n (keydown)=\"onDragHandleKeydown($event)\"\n >\n <svg width=\"10\" height=\"16\" viewBox=\"0 0 10 16\" fill=\"currentColor\" aria-hidden=\"true\">\n <circle cx=\"3\" cy=\"2\" r=\"1.5\"/>\n <circle cx=\"7\" cy=\"2\" r=\"1.5\"/>\n <circle cx=\"3\" cy=\"8\" r=\"1.5\"/>\n <circle cx=\"7\" cy=\"8\" r=\"1.5\"/>\n <circle cx=\"3\" cy=\"14\" r=\"1.5\"/>\n <circle cx=\"7\" cy=\"14\" r=\"1.5\"/>\n </svg>\n </span>\n </span>\n <span class=\"block-name\">{{ blockName() }}</span>\n <div class=\"tree-actions\">\n @if (index() > 0) {\n <button class=\"tree-btn\" (click)=\"onMoveUp($event)\" title=\"Move up\">&#8593;</button>\n }\n @if (index() < totalSiblings() - 1) {\n <button class=\"tree-btn\" (click)=\"onMoveDown($event)\" title=\"Move down\">&#8595;</button>\n }\n @if (duplicable()) {\n <button class=\"tree-btn\" (click)=\"onDuplicate($event)\" title=\"Duplicate\">\n <span class=\"material-icon\">content_copy</span>\n </button>\n }\n <button class=\"tree-btn delete\" (click)=\"onDelete($event)\" title=\"Delete\">&times;</button>\n </div>\n </div>\n\n @if (isExpanded() && blockHasSlots()) {\n <div class=\"nested-content\">\n @for (child of children(); track child.id; let childIdx = $index) {\n <lib-block-tree-item\n [block]=\"child\"\n [context]=\"childContext()\"\n [index]=\"childIdx\"\n [totalSiblings]=\"children().length\"\n [expandAll]=\"expandAll()\"\n (selectBlock)=\"selectBlock.emit($event)\"\n (deleteBlock)=\"deleteBlock.emit($event)\"\n (duplicateBlock)=\"duplicateBlock.emit($event)\"\n (moveBlock)=\"moveBlock.emit($event)\"\n (openBlockPicker)=\"openBlockPicker.emit($event)\"\n />\n }\n @if (canAddMore()) {\n <button\n class=\"add-block-btn nested\"\n [style.marginLeft.rem]=\"0.75 + (context().depth + 1) * 0.75\"\n (click)=\"onAddBlock($event)\"\n >\n <span class=\"add-icon-circle\">\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" aria-hidden=\"true\">\n <circle cx=\"10\" cy=\"10\" r=\"9\"/>\n <line x1=\"10\" y1=\"6\" x2=\"10\" y2=\"14\"/>\n <line x1=\"6\" y1=\"10\" x2=\"14\" y2=\"10\"/>\n </svg>\n </span> Add block\n </button>\n }\n </div>\n }\n `,\n styles: `\n :host {\n display: block;\n }\n\n .tree-block {\n display: flex;\n align-items: center;\n gap: 0.375rem;\n padding: 0.5rem;\n padding-right: 0.75rem;\n cursor: pointer;\n transition: background 0.2s;\n position: relative;\n }\n\n .tree-block:hover {\n background: #f5f5f5;\n border-radius: 8px;\n margin-right: 0.375rem;\n }\n\n .tree-block.selected {\n background: #005bd3;\n color: #fff;\n border-radius: 8px;\n margin-right: 0.375rem;\n }\n\n .tree-block.selected .block-icon,\n .tree-block.selected .block-name,\n .tree-block.selected .expand-btn,\n .tree-block.selected .drag-handle,\n .tree-block.selected .tree-btn {\n color: inherit;\n }\n\n .tree-block.drag-over-before {\n box-shadow: inset 0 2px 0 0 #4a90d9;\n }\n\n .tree-block.drag-over-inside {\n background: rgba(74, 144, 217, 0.1);\n box-shadow: inset 0 0 0 2px #4a90d9;\n }\n\n .tree-block.drag-over-after {\n box-shadow: inset 0 -2px 0 0 #4a90d9;\n }\n\n .tree-block.is-dragging {\n opacity: 0.4;\n cursor: grabbing;\n }\n\n .drag-handle {\n cursor: grab;\n color: #999;\n opacity: 0;\n transition: opacity 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n padding: 0.125rem;\n border: none;\n background: none;\n border-radius: 2px;\n }\n\n .drag-handle:hover {\n color: #666;\n background: #e0e0e0;\n }\n\n .drag-handle:focus-visible {\n opacity: 1;\n outline: 2px solid #4a90d9;\n outline-offset: 1px;\n }\n\n .tree-block:hover .drag-handle {\n opacity: 1;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .tree-block,\n .drag-handle,\n .tree-actions,\n .expand-icon {\n transition: none;\n }\n }\n\n .expand-btn {\n width: 16px;\n height: 16px;\n padding: 0;\n border: none;\n background: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #666;\n flex-shrink: 0;\n }\n\n .expand-btn.expanded .expand-icon {\n transform: rotate(90deg);\n }\n\n .expand-icon {\n font-size: 0.5rem;\n transition: transform 0.2s;\n }\n\n .block-indent {\n width: 18px;\n height: 1px;\n background: #ddd;\n flex-shrink: 0;\n }\n\n .icon-drag-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .icon-drag-wrapper .drag-handle {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .tree-block:hover .icon-drag-wrapper .block-icon,\n .icon-drag-wrapper:has(.drag-handle:focus-visible) .block-icon {\n visibility: hidden;\n }\n\n .block-icon {\n font-size: 0.875rem;\n flex-shrink: 0;\n }\n\n .block-name {\n flex: 1;\n font-size: 0.75rem;\n color: #555;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .tree-actions {\n display: flex;\n gap: 0.125rem;\n opacity: 0;\n transition: opacity 0.2s;\n }\n\n .tree-block:hover .tree-actions {\n opacity: 1;\n }\n\n .tree-btn {\n padding: 0.125rem 0.375rem;\n border: none;\n border-radius: 3px;\n background: #e0e0e0;\n cursor: pointer;\n font-size: 0.6875rem;\n color: #666;\n }\n\n .tree-btn:hover {\n background: #d0d0d0;\n }\n\n .tree-btn.delete:hover {\n background: #e74c3c;\n color: #fff;\n }\n\n .material-icon {\n font-family: 'Material Icons', sans-serif;\n font-size: 0.75rem;\n font-weight: normal;\n font-style: normal;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n white-space: nowrap;\n word-wrap: normal;\n direction: ltr;\n -webkit-font-smoothing: antialiased;\n text-rendering: optimizeLegibility;\n }\n\n .nested-content {\n border-left: 1px solid #e0e0e0;\n margin-left: 1.25rem;\n }\n\n .add-block-btn {\n display: flex;\n align-items: center;\n gap: 0.375rem;\n width: calc(100% - 1rem);\n margin: 0.375rem 0.5rem;\n padding: 0.375rem 0.5rem;\n border: none;\n border-radius: 4px;\n background: transparent;\n cursor: pointer;\n font-size: 0.6875rem;\n color: #005bd3;\n transition: all 0.2s;\n }\n\n .add-block-btn:hover {\n background: #f0f5ff;\n color: #004299;\n }\n\n .add-icon {\n font-size: 0.75rem;\n font-weight: 600;\n }\n\n .add-icon-circle {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BlockTreeItemComponent {\n readonly facade = inject(VisualEditorFacade);\n private readonly dndService = inject(DragDropService);\n\n private readonly treeBlock = viewChild<ElementRef<HTMLElement>>('treeBlock');\n\n readonly block = input.required<EditorElement>();\n readonly context = input.required<BlockTreeContext>();\n readonly index = input.required<number>();\n readonly totalSiblings = input.required<number>();\n readonly expandAll = input(false);\n\n readonly selectBlock = output<{ block: EditorElement; context: BlockTreeContext }>();\n readonly deleteBlock = output<{ block: EditorElement; context: BlockTreeContext }>();\n readonly duplicateBlock = output<{ block: EditorElement; context: BlockTreeContext }>();\n readonly moveBlock = output<{ block: EditorElement; context: BlockTreeContext; newIndex: number }>();\n readonly openBlockPicker = output<BlockPickerTarget>();\n\n private readonly expanded = signal(false);\n readonly dropZone = signal<DropZone | null>(null);\n\n readonly isDragSource = computed(() => {\n const dragItem = this.dndService.dragItem();\n return dragItem !== null && dragItem.elementId === this.block().id;\n });\n\n readonly blockHasSlots = computed(() => this.facade.hasSlots(this.block().type));\n readonly blockSlots = computed(() => this.facade.getBlockSlots(this.block().type));\n readonly children = computed(() => this.block().children ?? []);\n readonly childContext = computed<BlockTreeContext>(() => ({\n sectionId: this.context().sectionId,\n parentPath: [...this.context().parentPath, this.block().id],\n depth: this.context().depth + 1,\n }));\n readonly blockIcon = computed(() => {\n const iconMap: Record<string, string> = {\n 'text-block': '📝',\n 'button-block': '🔘',\n 'image-block': '🖼️',\n 'icon-block': '⭐',\n 'feature-item': '⭐',\n 'card-block': '🃏',\n };\n return iconMap[this.block().type] ?? '🧩';\n });\n readonly blockName = computed(() => {\n const block = this.block();\n if (block.adminLabel) return block.adminLabel;\n const def = this.facade.getDefinition(block.type);\n const preview = String(block.props['content'] ?? block.props['label'] ?? block.props['text'] ?? '');\n if (preview && preview.length > 20) {\n return preview.substring(0, 20) + '...';\n }\n return preview || def?.name || block.type;\n });\n readonly duplicable = computed(() => this.facade.isBlockDuplicable(this.block().type));\n readonly canAddMore = computed(() => {\n const newDepth = this.context().depth + 1;\n return this.facade.canAddNestedBlock([...this.context().parentPath, this.block().id]) && newDepth < 12;\n });\n\n isExpanded(): boolean {\n return this.expandAll() || this.expanded();\n }\n\n toggleExpand(event: Event): void {\n event.stopPropagation();\n this.expanded.update((v) => !v);\n }\n\n hasSlots(): boolean {\n return this.blockHasSlots();\n }\n\n getBlockSlots(): SlotDefinition[] {\n return this.blockSlots();\n }\n\n onDuplicate(event: Event): void {\n event.stopPropagation();\n this.duplicateBlock.emit({ block: this.block(), context: this.context() });\n }\n\n onSelect(event: Event): void {\n event.stopPropagation();\n this.selectBlock.emit({ block: this.block(), context: this.context() });\n }\n\n onDelete(event: Event): void {\n event.stopPropagation();\n this.deleteBlock.emit({ block: this.block(), context: this.context() });\n }\n\n onMoveUp(event: Event): void {\n event.stopPropagation();\n this.moveBlock.emit({ block: this.block(), context: this.context(), newIndex: this.index() - 1 });\n }\n\n onMoveDown(event: Event): void {\n event.stopPropagation();\n this.moveBlock.emit({ block: this.block(), context: this.context(), newIndex: this.index() + 1 });\n }\n\n onAddBlock(event: Event): void {\n event.stopPropagation();\n const slots = this.getBlockSlots();\n this.openBlockPicker.emit({\n sectionId: this.context().sectionId,\n parentPath: [...this.context().parentPath, this.block().id],\n parentType: this.block().type,\n slots,\n });\n this.expanded.set(true);\n }\n\n // Drag & Drop handlers\n\n onDragStart(event: DragEvent): void {\n event.stopPropagation();\n const block = this.block();\n const ctx = this.context();\n const item: DragItem = {\n kind: 'block',\n elementId: block.id,\n elementType: block.type,\n sectionId: ctx.sectionId,\n parentPath: ctx.parentPath,\n slotName: block.slotName,\n sourceIndex: this.index(),\n };\n this.dndService.startDrag(item, event);\n }\n\n onDragEnd(event: DragEvent): void {\n event.stopPropagation();\n this.dndService.endDrag();\n this.dropZone.set(null);\n }\n\n onDragOver(event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n\n const dragItem = this.dndService.dragItem();\n if (!dragItem || dragItem.kind !== 'block') return;\n\n const el = this.treeBlock()?.nativeElement;\n if (!el) return;\n\n const canDropInside = this.hasSlots();\n const zone = this.dndService.computeDropZone(event, el, canDropInside);\n const target = this.buildDropTarget(zone);\n\n if (this.dndService.validateDrop(dragItem, target)) {\n event.dataTransfer!.dropEffect = 'move';\n this.dropZone.set(zone);\n this.dndService.updateDropTarget(target);\n } else {\n event.dataTransfer!.dropEffect = 'none';\n this.dropZone.set(null);\n this.dndService.updateDropTarget(null);\n }\n }\n\n onDragLeave(event: DragEvent): void {\n const el = this.treeBlock()?.nativeElement;\n if (!el) return;\n\n // Only clear if we're actually leaving this element (not entering a child)\n const relatedTarget = event.relatedTarget as Node | null;\n if (relatedTarget && el.contains(relatedTarget)) {\n return;\n }\n\n this.dropZone.set(null);\n }\n\n onDrop(event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.dropZone.set(null);\n this.dndService.executeDrop();\n }\n\n onDragHandleKeydown(event: KeyboardEvent): void {\n if (event.key === 'ArrowUp' && this.index() > 0) {\n event.preventDefault();\n this.moveBlock.emit({ block: this.block(), context: this.context(), newIndex: this.index() - 1 });\n } else if (event.key === 'ArrowDown' && this.index() < this.totalSiblings() - 1) {\n event.preventDefault();\n this.moveBlock.emit({ block: this.block(), context: this.context(), newIndex: this.index() + 1 });\n }\n }\n\n private buildDropTarget(zone: DropZone): DropTarget {\n const ctx = this.context();\n const block = this.block();\n\n if (zone === 'inside') {\n // Dropping inside this block: becomes a child\n const slots = this.blockSlots();\n const slotName = slots[0]?.name ?? 'default';\n return {\n kind: 'block',\n sectionId: ctx.sectionId,\n parentPath: [...ctx.parentPath, block.id],\n slotName,\n index: this.children().length,\n depth: ctx.depth + 1,\n zone,\n };\n }\n\n // Dropping before/after this block: sibling position\n const slotName = block.slotName ?? 'default';\n return {\n kind: 'block',\n sectionId: ctx.sectionId,\n parentPath: ctx.parentPath,\n slotName,\n index: zone === 'before' ? this.index() : this.index() + 1,\n depth: ctx.depth,\n zone,\n };\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { ShopifyGraphQLClient } from './shopify-graphql-client.service';\n\nexport interface ShopifyFile {\n id: string;\n alt: string;\n url: string;\n filename: string;\n mediaType: 'IMAGE' | 'VIDEO';\n mimeType: string;\n width?: number;\n height?: number;\n createdAt: string;\n}\n\nexport interface ShopifyFilesPage {\n files: ShopifyFile[];\n pageInfo: {\n hasNextPage: boolean;\n endCursor: string | null;\n };\n}\n\nexport const FILES_QUERY = `\n query GetFiles($first: Int!, $after: String, $query: String) {\n files(first: $first, after: $after, query: $query) {\n edges {\n node {\n ... on MediaImage {\n id\n alt\n createdAt\n mimeType\n image {\n url\n width\n height\n }\n originalSource {\n fileSize\n }\n }\n ... on Video {\n id\n alt\n createdAt\n filename\n originalSource {\n mimeType\n url\n }\n sources {\n url\n mimeType\n width\n height\n }\n }\n }\n cursor\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n`;\n\ninterface MediaImageNode {\n id: string;\n alt: string;\n createdAt: string;\n mimeType: string;\n image: {\n url: string;\n width: number;\n height: number;\n };\n originalSource?: {\n fileSize?: number;\n };\n}\n\ninterface VideoNode {\n id: string;\n alt: string;\n createdAt: string;\n filename: string;\n originalSource?: {\n mimeType?: string;\n url?: string;\n };\n sources: Array<{\n url: string;\n mimeType: string;\n width: number;\n height: number;\n }>;\n}\n\ninterface FilesResponse {\n files: {\n edges: Array<{\n node: MediaImageNode | VideoNode;\n cursor: string;\n }>;\n pageInfo: {\n hasNextPage: boolean;\n endCursor: string | null;\n };\n };\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ShopifyFilesService {\n private readonly client = inject(ShopifyGraphQLClient);\n\n getFiles(\n mediaType: 'IMAGE' | 'VIDEO',\n search?: string,\n first = 24,\n after?: string\n ): Observable<ShopifyFilesPage> {\n const queryParts = [`media_type:${mediaType}`];\n if (search?.trim()) {\n queryParts.push(search.trim());\n }\n\n const variables: Record<string, unknown> = {\n first,\n query: queryParts.join(' '),\n };\n if (after) {\n variables['after'] = after;\n }\n\n return this.client.query<FilesResponse>(FILES_QUERY, variables).pipe(\n map(response => ({\n files: response.files.edges\n .map(edge => this.mapNode(edge.node, mediaType))\n .filter((f): f is ShopifyFile => f !== null),\n pageInfo: response.files.pageInfo,\n }))\n );\n }\n\n private mapNode(node: MediaImageNode | VideoNode, mediaType: 'IMAGE' | 'VIDEO'): ShopifyFile | null {\n if (mediaType === 'IMAGE' && 'image' in node) {\n const img = node as MediaImageNode;\n if (!img.image?.url) return null;\n return {\n id: img.id,\n alt: img.alt ?? '',\n url: img.image.url,\n filename: this.extractFilename(img.image.url),\n mediaType: 'IMAGE',\n mimeType: img.mimeType ?? 'image/jpeg',\n width: img.image.width,\n height: img.image.height,\n createdAt: img.createdAt,\n };\n }\n\n if (mediaType === 'VIDEO' && 'sources' in node) {\n const vid = node as VideoNode;\n const source = vid.sources[0];\n const url = source?.url ?? vid.originalSource?.url ?? '';\n if (!url) return null;\n return {\n id: vid.id,\n alt: vid.alt ?? '',\n url,\n filename: vid.filename ?? this.extractFilename(url),\n mediaType: 'VIDEO',\n mimeType: source?.mimeType ?? vid.originalSource?.mimeType ?? 'video/mp4',\n width: source?.width,\n height: source?.height,\n createdAt: vid.createdAt,\n };\n }\n\n return null;\n }\n\n private extractFilename(url: string): string {\n try {\n const pathname = new URL(url).pathname;\n return pathname.split('/').pop() ?? 'unknown';\n } catch {\n return 'unknown';\n }\n }\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n input,\n output,\n signal,\n inject,\n OnInit,\n OnDestroy,\n ElementRef,\n viewChild,\n} from '@angular/core';\nimport { Subject, takeUntil, debounceTime, switchMap, tap } from 'rxjs';\nimport { ShopifyFilesService, ShopifyFile } from '../../services/shopify-files.service';\n\n@Component({\n selector: 'lib-shopify-file-picker',\n template: `\n <div\n class=\"file-picker-overlay\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"mediaType() === 'IMAGE' ? 'Select Image' : 'Select Video'\"\n (click)=\"onBackdropClick($event)\"\n (keydown.escape)=\"close()\"\n >\n <div class=\"file-picker\" (click)=\"$event.stopPropagation()\">\n <div class=\"picker-header\">\n <h3>{{ mediaType() === 'IMAGE' ? 'Select Image' : 'Select Video' }}</h3>\n <button class=\"close-btn\" (click)=\"close()\" aria-label=\"Close\">×</button>\n </div>\n\n <div class=\"picker-search\">\n <input\n #searchInput\n type=\"text\"\n class=\"picker-search-input\"\n placeholder=\"Search files...\"\n [value]=\"searchTerm()\"\n (input)=\"onSearchInput($event)\"\n aria-label=\"Search files\"\n />\n </div>\n\n <div\n class=\"picker-content\"\n role=\"listbox\"\n [attr.aria-label]=\"mediaType() === 'IMAGE' ? 'Images' : 'Videos'\"\n #scrollContainer\n (scroll)=\"onScroll()\"\n >\n @if (isLoading() && files().length === 0) {\n <div class=\"picker-loading\">Loading...</div>\n } @else if (error()) {\n <div class=\"picker-error\" role=\"alert\">\n <p>Failed to load files</p>\n <button class=\"retry-btn\" (click)=\"loadFiles()\">Retry</button>\n </div>\n } @else if (files().length === 0 && !isLoading()) {\n <div class=\"picker-empty\">No files found</div>\n } @else {\n <div class=\"file-grid\">\n @for (file of files(); track file.id) {\n <button\n class=\"file-card\"\n role=\"option\"\n [attr.aria-selected]=\"selectedFile()?.id === file.id\"\n [class.selected]=\"selectedFile()?.id === file.id\"\n [class.current]=\"file.url === currentValue()\"\n (click)=\"selectFile(file)\"\n (dblclick)=\"confirmSelection()\"\n (keydown.enter)=\"selectAndConfirm(file)\"\n >\n @if (mediaType() === 'IMAGE') {\n <img\n class=\"file-thumbnail\"\n [src]=\"getThumbnailUrl(file.url)\"\n [alt]=\"file.alt || file.filename\"\n loading=\"lazy\"\n />\n } @else {\n <div class=\"video-thumbnail\">\n <svg class=\"video-icon\" width=\"32\" height=\"32\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M8 5v14l11-7z\"/>\n </svg>\n </div>\n }\n <span class=\"file-name\">{{ file.filename }}</span>\n @if (file.url === currentValue()) {\n <span class=\"current-badge\">Current</span>\n }\n </button>\n }\n </div>\n @if (isLoading() && files().length > 0) {\n <div class=\"picker-loading\">Loading more...</div>\n }\n }\n </div>\n\n <div class=\"picker-footer\">\n <button class=\"cancel-btn\" (click)=\"close()\">Cancel</button>\n <button\n class=\"select-btn\"\n [disabled]=\"!selectedFile()\"\n (click)=\"confirmSelection()\"\n >\n Select\n </button>\n </div>\n </div>\n </div>\n `,\n styles: `\n .file-picker-overlay {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1100;\n }\n\n .file-picker {\n background: #fff;\n border-radius: 12px;\n width: 560px;\n max-height: 70vh;\n display: flex;\n flex-direction: column;\n box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);\n }\n\n .picker-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 1rem 1.25rem;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .picker-header h3 {\n margin: 0;\n font-size: 1rem;\n font-weight: 600;\n color: #303030;\n }\n\n .close-btn {\n border: none;\n background: none;\n font-size: 1.5rem;\n cursor: pointer;\n color: #666;\n line-height: 1;\n padding: 0.25rem;\n border-radius: 4px;\n }\n\n .close-btn:hover {\n background: #f0f2f5;\n color: #303030;\n }\n\n .picker-search {\n padding: 0.75rem 1.25rem;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .picker-search-input {\n width: 100%;\n padding: 0.5rem 0.75rem;\n border: 1px solid #c9cccf;\n border-radius: 8px;\n font-size: 0.875rem;\n outline: none;\n transition: border-color 0.2s;\n box-sizing: border-box;\n }\n\n .picker-search-input:focus {\n border-color: #005bd3;\n box-shadow: 0 0 0 1px #005bd3;\n }\n\n .picker-content {\n flex: 1;\n overflow-y: auto;\n padding: 1rem 1.25rem;\n min-height: 200px;\n }\n\n .file-grid {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: 0.75rem;\n }\n\n .file-card {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 0.5rem;\n border: 2px solid #e0e0e0;\n border-radius: 8px;\n background: #fff;\n cursor: pointer;\n transition: all 0.15s;\n position: relative;\n text-align: center;\n }\n\n .file-card:hover {\n border-color: #005bd3;\n background: #f8fafe;\n }\n\n .file-card:focus-visible {\n outline: 2px solid #005bd3;\n outline-offset: 2px;\n }\n\n .file-card.selected {\n border-color: #005bd3;\n background: #f0f5ff;\n box-shadow: 0 0 0 1px #005bd3;\n }\n\n .file-card.current {\n border-color: #008060;\n }\n\n .file-thumbnail {\n width: 100%;\n aspect-ratio: 1;\n object-fit: cover;\n border-radius: 4px;\n background: #f0f2f5;\n }\n\n .video-thumbnail {\n width: 100%;\n aspect-ratio: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n background: #1a1a1a;\n border-radius: 4px;\n color: #fff;\n }\n\n .video-icon {\n opacity: 0.8;\n }\n\n .file-name {\n display: block;\n margin-top: 0.375rem;\n font-size: 0.6875rem;\n color: #616161;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 100%;\n }\n\n .current-badge {\n position: absolute;\n top: 0.25rem;\n right: 0.25rem;\n padding: 0.125rem 0.375rem;\n background: #008060;\n color: #fff;\n font-size: 0.625rem;\n font-weight: 600;\n border-radius: 4px;\n }\n\n .picker-loading {\n padding: 2rem;\n text-align: center;\n color: #616161;\n font-size: 0.875rem;\n }\n\n .picker-error {\n padding: 2rem;\n text-align: center;\n color: #d72c0d;\n }\n\n .picker-error p {\n margin: 0 0 0.75rem;\n font-size: 0.875rem;\n }\n\n .retry-btn {\n padding: 0.375rem 0.75rem;\n border: 1px solid #d72c0d;\n border-radius: 6px;\n background: #fff;\n color: #d72c0d;\n cursor: pointer;\n font-size: 0.8125rem;\n }\n\n .retry-btn:hover {\n background: #fef2f0;\n }\n\n .picker-empty {\n padding: 2rem;\n text-align: center;\n color: #616161;\n font-size: 0.875rem;\n }\n\n .picker-footer {\n display: flex;\n justify-content: flex-end;\n gap: 0.5rem;\n padding: 0.75rem 1.25rem;\n border-top: 1px solid #e0e0e0;\n }\n\n .cancel-btn {\n padding: 0.5rem 1rem;\n border: 1px solid #c9cccf;\n border-radius: 8px;\n background: #fff;\n cursor: pointer;\n font-size: 0.8125rem;\n color: #303030;\n }\n\n .cancel-btn:hover {\n background: #f0f2f5;\n }\n\n .select-btn {\n padding: 0.5rem 1rem;\n border: none;\n border-radius: 8px;\n background: #005bd3;\n color: #fff;\n cursor: pointer;\n font-size: 0.8125rem;\n font-weight: 500;\n }\n\n .select-btn:hover:not(:disabled) {\n background: #004299;\n }\n\n .select-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ShopifyFilePickerComponent implements OnInit, OnDestroy {\n readonly mediaType = input.required<'IMAGE' | 'VIDEO'>();\n readonly currentValue = input<string>('');\n readonly fileSelected = output<string>();\n readonly closed = output<void>();\n\n private readonly filesService = inject(ShopifyFilesService);\n private readonly destroy$ = new Subject<void>();\n private readonly searchSubject = new Subject<string>();\n private readonly searchInput = viewChild<ElementRef<HTMLInputElement>>('searchInput');\n private readonly scrollContainer = viewChild<ElementRef<HTMLElement>>('scrollContainer');\n\n readonly files = signal<ShopifyFile[]>([]);\n readonly selectedFile = signal<ShopifyFile | null>(null);\n readonly isLoading = signal(false);\n readonly error = signal<string | null>(null);\n readonly searchTerm = signal('');\n\n private endCursor: string | null = null;\n private hasNextPage = false;\n\n ngOnInit(): void {\n this.searchSubject.pipe(\n debounceTime(300),\n tap(() => {\n this.files.set([]);\n this.endCursor = null;\n this.hasNextPage = false;\n this.selectedFile.set(null);\n }),\n switchMap(term => {\n this.searchTerm.set(term);\n this.isLoading.set(true);\n this.error.set(null);\n return this.filesService.getFiles(this.mediaType(), term || undefined);\n }),\n takeUntil(this.destroy$)\n ).subscribe({\n next: page => {\n this.files.set(page.files);\n this.endCursor = page.pageInfo.endCursor;\n this.hasNextPage = page.pageInfo.hasNextPage;\n this.isLoading.set(false);\n },\n error: () => {\n this.error.set('Failed to load files');\n this.isLoading.set(false);\n },\n });\n\n this.loadFiles();\n\n // Focus search input on open\n requestAnimationFrame(() => {\n this.searchInput()?.nativeElement.focus();\n });\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n loadFiles(): void {\n this.isLoading.set(true);\n this.error.set(null);\n\n this.filesService\n .getFiles(this.mediaType(), this.searchTerm() || undefined)\n .pipe(takeUntil(this.destroy$))\n .subscribe({\n next: page => {\n this.files.set(page.files);\n this.endCursor = page.pageInfo.endCursor;\n this.hasNextPage = page.pageInfo.hasNextPage;\n this.isLoading.set(false);\n },\n error: () => {\n this.error.set('Failed to load files');\n this.isLoading.set(false);\n },\n });\n }\n\n onSearchInput(event: Event): void {\n const value = (event.target as HTMLInputElement).value;\n this.searchSubject.next(value);\n }\n\n onScroll(): void {\n if (!this.hasNextPage || this.isLoading()) return;\n\n const el = this.scrollContainer()?.nativeElement;\n if (!el) return;\n\n const nearBottom = el.scrollHeight - el.scrollTop - el.clientHeight < 100;\n if (nearBottom) {\n this.loadMore();\n }\n }\n\n selectFile(file: ShopifyFile): void {\n this.selectedFile.set(file);\n }\n\n selectAndConfirm(file: ShopifyFile): void {\n this.selectedFile.set(file);\n this.confirmSelection();\n }\n\n confirmSelection(): void {\n const file = this.selectedFile();\n if (file) {\n this.fileSelected.emit(file.url);\n }\n }\n\n close(): void {\n this.closed.emit();\n }\n\n onBackdropClick(event: Event): void {\n if (event.target === event.currentTarget) {\n this.close();\n }\n }\n\n getThumbnailUrl(url: string): string {\n // Shopify CDN supports image transforms via URL params\n if (url.includes('cdn.shopify.com')) {\n return url + (url.includes('?') ? '&' : '?') + 'width=300';\n }\n return url;\n }\n\n private loadMore(): void {\n if (!this.endCursor || this.isLoading()) return;\n\n this.isLoading.set(true);\n\n this.filesService\n .getFiles(this.mediaType(), this.searchTerm() || undefined, 24, this.endCursor)\n .pipe(takeUntil(this.destroy$))\n .subscribe({\n next: page => {\n this.files.update(current => [...current, ...page.files]);\n this.endCursor = page.pageInfo.endCursor;\n this.hasNextPage = page.pageInfo.hasNextPage;\n this.isLoading.set(false);\n },\n error: () => {\n this.isLoading.set(false);\n },\n });\n }\n}\n","import { Component, ChangeDetectionStrategy, inject, signal, computed, OnInit, OnDestroy, ElementRef, viewChild, effect } from '@angular/core';\nimport { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';\nimport { Subject, takeUntil, switchMap, filter } from 'rxjs';\nimport { VisualEditorFacade } from '../../services/visual-editor-facade.service';\nimport { IframeBridgeService } from '../../services/iframe-bridge.service';\nimport { ComponentRegistryService } from '../../registry/component-registry.service';\nimport { ComponentDefinition } from '../../registry/component-definition.types';\nimport { ResolvedPreset } from '../../registry/component-registry.service';\nimport { SlotDefinition } from '../../registry/slot.types';\nimport { EditorSection, EditorElement } from '../../store/visual-editor.state';\nimport { DynamicRendererComponent } from '../dynamic-renderer.component';\nimport { VisualEditorNavigation } from '../../navigation/visual-editor-navigation.types';\nimport { PageLoadingStrategy } from '../../page-loading/page-loading-strategy.types';\nimport { VISUAL_EDITOR_CONFIG, VisualEditorConfig } from '../../config/visual-editor-config.types';\nimport { StorefrontUrlService } from '../../services/storefront-url.service';\nimport { BlockTreeItemComponent, BlockTreeContext, BlockPickerTarget } from './block-tree-item.component';\nimport { ShopifyFilePickerComponent } from './shopify-file-picker.component';\nimport { DragDropService } from '../../dnd/drag-drop.service';\nimport type { DragItem, DropZone } from '../../dnd/drag-drop.types';\n\n/**\n * Main Visual Editor component\n * Provides a complete editing interface with:\n * - Sidebar with hierarchical tree view\n * - Canvas with live preview\n * - Properties panel for editing section/block properties\n */\n@Component({\n selector: 'lib-visual-editor',\n imports: [DynamicRendererComponent, BlockTreeItemComponent, ShopifyFilePickerComponent],\n providers: [IframeBridgeService],\n template: `\n <div class=\"editor-layout\">\n <!-- Sidebar: Hierarchical Tree -->\n <aside class=\"sidebar\">\n <div class=\"sidebar-header\">\n <h2>Page Structure</h2>\n <div class=\"search-box\">\n <span class=\"search-icon\">🔍</span>\n <input\n type=\"text\"\n class=\"search-input\"\n placeholder=\"Search sections & blocks...\"\n [value]=\"searchQuery()\"\n (input)=\"onSearchInput($event)\"\n aria-label=\"Search sections and blocks\"\n />\n @if (searchQuery()) {\n <button class=\"search-clear\" (click)=\"clearSearch()\" aria-label=\"Clear search\">×</button>\n }\n </div>\n </div>\n <div class=\"section-tree\">\n @if (searchQuery() && filteredSections().length === 0) {\n <div class=\"search-no-results\">\n <p>No results for \"{{ searchQuery() }}\"</p>\n </div>\n }\n @for (section of filteredSections(); track section.id; let idx = $index) {\n <div\n class=\"tree-section\"\n [class.selected]=\"facade.selectedSection()?.id === section.id && !facade.selectedBlock()\"\n [class.drag-over-before]=\"sectionDropZone() === section.id + ':before'\"\n [class.drag-over-after]=\"sectionDropZone() === section.id + ':after'\"\n [class.is-section-dragging]=\"isSectionDragSource(section.id)\"\n >\n <div\n class=\"tree-section-header\"\n draggable=\"true\"\n (click)=\"selectSection(section, $event)\"\n (dragstart)=\"onSectionDragStart(section, idx, $event)\"\n (dragend)=\"onSectionDragEnd($event)\"\n (dragover)=\"onSectionDragOver(section, idx, $event)\"\n (dragleave)=\"onSectionDragLeave($event)\"\n (drop)=\"onSectionDrop($event)\"\n >\n <button\n class=\"expand-btn\"\n [class.expanded]=\"isSectionExpanded(section.id)\"\n (click)=\"toggleSectionExpand(section.id, $event)\"\n [attr.aria-expanded]=\"isSectionExpanded(section.id)\"\n [attr.aria-label]=\"isSectionExpanded(section.id) ? 'Collapse' : 'Expand'\"\n >\n <span class=\"expand-icon\">&#9654;</span>\n </button>\n <span class=\"icon-drag-wrapper\">\n <span class=\"section-icon\">{{ getSectionIcon(section.type) }}</span>\n <span\n class=\"drag-handle section-drag-handle\"\n role=\"button\"\n [attr.aria-label]=\"'Drag ' + getSectionName(section) + ' to reorder'\"\n [attr.aria-roledescription]=\"'draggable'\"\n tabindex=\"0\"\n (keydown)=\"onSectionDragHandleKeydown(section.id, idx, $event)\"\n >\n <svg width=\"10\" height=\"16\" viewBox=\"0 0 10 16\" fill=\"currentColor\" aria-hidden=\"true\">\n <circle cx=\"3\" cy=\"2\" r=\"1.5\"/>\n <circle cx=\"7\" cy=\"2\" r=\"1.5\"/>\n <circle cx=\"3\" cy=\"8\" r=\"1.5\"/>\n <circle cx=\"7\" cy=\"8\" r=\"1.5\"/>\n <circle cx=\"3\" cy=\"14\" r=\"1.5\"/>\n <circle cx=\"7\" cy=\"14\" r=\"1.5\"/>\n </svg>\n </span>\n </span>\n <span class=\"section-name\">{{ getSectionName(section) }}</span>\n <div class=\"tree-actions\">\n @if (idx > 0) {\n<!-- <button class=\"tree-btn\" (click)=\"moveUp(section.id, idx, $event)\" title=\"Move up\">&#8593;</button>-->\n }\n @if (idx < facade.sections().length - 1) {\n<!-- <button class=\"tree-btn\" (click)=\"moveDown(section.id, idx, $event)\" title=\"Move down\">&#8595;</button>-->\n }\n @if (facade.isSectionDuplicable(section.type)) {\n <button class=\"tree-btn\" (click)=\"duplicateSection(section.id, $event)\" title=\"Duplicate\">\n <span class=\"material-icon\">content_copy</span>\n </button>\n }\n <button class=\"tree-btn delete\" (click)=\"deleteSection(section.id, $event)\" title=\"Delete\">&times;</button>\n </div>\n </div>\n @if (isSectionExpanded(section.id)) {\n <div\n class=\"tree-section-content\"\n (dragover)=\"onSectionContentDragOver(section, $event)\"\n (dragleave)=\"onSectionContentDragLeave($event)\"\n (drop)=\"onSectionContentDrop($event)\"\n >\n @let sectionBlocks = getSectionBlocks(section);\n @for (block of sectionBlocks; track block.id; let blockIdx = $index) {\n <lib-block-tree-item\n [block]=\"block\"\n [context]=\"getRootBlockContext(section.id)\"\n [index]=\"blockIdx\"\n [totalSiblings]=\"sectionBlocks.length\"\n [expandAll]=\"isAllBlocksExpanded(section.id)\"\n (selectBlock)=\"onBlockSelect($event)\"\n (deleteBlock)=\"onBlockDelete($event)\"\n (duplicateBlock)=\"onBlockDuplicate($event)\"\n (moveBlock)=\"onBlockMove($event)\"\n (openBlockPicker)=\"onOpenNestedBlockPicker($event)\"\n />\n }\n <button class=\"add-block-btn\" (click)=\"openBlockPicker(section, $event)\">\n <span class=\"add-icon-circle\">\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" aria-hidden=\"true\">\n <circle cx=\"10\" cy=\"10\" r=\"9\"/>\n <line x1=\"10\" y1=\"6\" x2=\"10\" y2=\"14\"/>\n <line x1=\"6\" y1=\"10\" x2=\"14\" y2=\"10\"/>\n </svg>\n </span> Add block\n </button>\n </div>\n }\n </div>\n }\n <div class=\"sr-only\" aria-live=\"polite\" role=\"status\">{{ dndAnnouncement() }}</div>\n </div>\n <!-- Add Section Button -->\n <div class=\"add-section-area\">\n <button class=\"add-section-btn\" (click)=\"toggleSectionPicker()\">\n <span class=\"add-icon-circle\">\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" aria-hidden=\"true\">\n <circle cx=\"10\" cy=\"10\" r=\"9\"/>\n <line x1=\"10\" y1=\"6\" x2=\"10\" y2=\"14\"/>\n <line x1=\"6\" y1=\"10\" x2=\"14\" y2=\"10\"/>\n </svg>\n </span> Add section\n </button>\n @if (showSectionPicker()) {\n <div class=\"section-picker\">\n <div class=\"picker-search\">\n <input\n type=\"text\"\n class=\"picker-search-input\"\n placeholder=\"Search sections...\"\n [value]=\"sectionPickerSearch()\"\n (input)=\"onSectionPickerSearch($event)\"\n aria-label=\"Search available sections\"\n />\n </div>\n @for (group of groupedSectionPresets(); track group.category) {\n <div class=\"picker-category\">\n @if (groupedSectionPresets().length > 1) {\n <div class=\"picker-category-label\">{{ group.category }}</div>\n }\n @for (rp of group.presets; track rp.displayName + '-' + rp.definition.type) {\n <button class=\"picker-item\" (click)=\"addSectionFromPreset(rp)\">\n <span class=\"picker-icon\">{{ getSectionPresetIcon(rp) }}</span>\n <div class=\"picker-info\">\n <span class=\"picker-name\">{{ rp.displayName }}</span>\n @if (rp.displayDescription) {\n <span class=\"picker-desc\">{{ rp.displayDescription }}</span>\n }\n </div>\n </button>\n }\n </div>\n }\n @if (filteredAvailableSectionPresets().length === 0) {\n <div class=\"picker-empty\">No sections match your search</div>\n }\n </div>\n }\n </div>\n <!-- Block Picker Modal (for sections) -->\n @if (blockPickerSection()) {\n <div class=\"block-picker-overlay\" (click)=\"closeBlockPicker()\">\n <div class=\"block-picker\" (click)=\"$event.stopPropagation()\">\n <div class=\"picker-header\">\n <h3>Add block to {{ getSectionName(blockPickerSection()!) }}</h3>\n <button class=\"close-btn\" (click)=\"closeBlockPicker()\">×</button>\n </div>\n <div class=\"picker-search\">\n <input\n type=\"text\"\n class=\"picker-search-input\"\n placeholder=\"Search blocks...\"\n [value]=\"blockPickerSearch()\"\n (input)=\"onBlockPickerSearch($event)\"\n aria-label=\"Search available blocks\"\n />\n </div>\n <div class=\"picker-content\">\n @for (rp of filteredBlockPresetsForSection(); track rp.displayName + '-' + rp.definition.type) {\n <button class=\"picker-item\" (click)=\"addBlockToSectionFromPreset(blockPickerSection()!, rp)\">\n <span class=\"picker-icon\">{{ getBlockPresetIcon(rp) }}</span>\n <div class=\"picker-info\">\n <span class=\"picker-name\">{{ rp.displayName }}</span>\n @if (rp.displayDescription) {\n <span class=\"picker-desc\">{{ rp.displayDescription }}</span>\n }\n </div>\n </button>\n }\n @if (filteredBlockPresetsForSection().length === 0) {\n <div class=\"picker-empty\">\n @if (blockPickerSearch()) {\n No blocks match \"{{ blockPickerSearch() }}\"\n } @else {\n No blocks available for this section\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n <!-- Nested Block Picker Modal (for blocks with slots) -->\n @if (nestedBlockPickerTarget()) {\n <div class=\"block-picker-overlay\" (click)=\"closeNestedBlockPicker()\">\n <div class=\"block-picker\" (click)=\"$event.stopPropagation()\">\n <div class=\"picker-header\">\n <h3>Add nested block</h3>\n <button class=\"close-btn\" (click)=\"closeNestedBlockPicker()\">×</button>\n </div>\n <div class=\"picker-search\">\n <input\n type=\"text\"\n class=\"picker-search-input\"\n placeholder=\"Search blocks...\"\n [value]=\"nestedBlockPickerSearch()\"\n (input)=\"onNestedBlockPickerSearch($event)\"\n aria-label=\"Search available blocks\"\n />\n </div>\n <div class=\"picker-content\">\n @for (rp of filteredBlockPresetsForNestedSlot(); track rp.displayName + '-' + rp.definition.type) {\n <button class=\"picker-item\" (click)=\"addNestedBlockFromPreset(rp)\">\n <span class=\"picker-icon\">{{ getBlockPresetIcon(rp) }}</span>\n <div class=\"picker-info\">\n <span class=\"picker-name\">{{ rp.displayName }}</span>\n @if (rp.displayDescription) {\n <span class=\"picker-desc\">{{ rp.displayDescription }}</span>\n }\n </div>\n </button>\n }\n @if (filteredBlockPresetsForNestedSlot().length === 0) {\n <div class=\"picker-empty\">\n @if (nestedBlockPickerSearch()) {\n No blocks match \"{{ nestedBlockPickerSearch() }}\"\n } @else {\n No blocks available\n }\n </div>\n }\n </div>\n </div>\n </div>\n }\n </aside>\n\n <!-- Main: Canvas -->\n <main class=\"canvas-area\">\n <!-- Toolbar -->\n <div class=\"toolbar\">\n <div class=\"toolbar-left\">\n <button class=\"toolbar-btn back-btn\" (click)=\"goBack()\" title=\"Back to pages\">\n ← Back\n </button>\n <button\n class=\"toolbar-btn\"\n [disabled]=\"!facade.canUndo()\"\n (click)=\"facade.undo()\"\n title=\"Undo\"\n >\n ↩ Undo\n </button>\n <button\n class=\"toolbar-btn\"\n [disabled]=\"!facade.canRedo()\"\n (click)=\"facade.redo()\"\n title=\"Redo\"\n >\n ↪ Redo\n </button>\n </div>\n <div class=\"toolbar-center\">\n @if (facade.currentPage(); as page) {\n @if (page.status === 'published') {\n <a\n class=\"page-title page-title-link\"\n [href]=\"'/pages/' + page.slug\"\n target=\"_blank\"\n rel=\"noopener\"\n >{{ page.title }}</a>\n } @else {\n <span class=\"page-title\">{{ page.title }}</span>\n }\n <span class=\"status-badge\" [class.published]=\"page.status === 'published'\">\n {{ page.status }}\n </span>\n @if (facade.isDirty()) {\n <span class=\"dirty-indicator\">• Unsaved changes</span>\n }\n } @else {\n <span class=\"section-count\">{{ facade.sections().length }} sections</span>\n }\n </div>\n <div class=\"toolbar-right\">\n @if (facade.currentPage() && showSaveButton()) {\n <button\n class=\"toolbar-btn\"\n [disabled]=\"!facade.isDirty() || isSaving()\"\n (click)=\"savePage()\"\n title=\"Save changes\"\n >\n {{ isSaving() ? 'Saving...' : '💾 Save' }}\n </button>\n }\n @if (facade.currentPage() && showPublishButtons()) {\n @if (facade.currentPage()?.status === 'draft') {\n <button\n class=\"toolbar-btn publish-btn\"\n [disabled]=\"facade.isDirty() || isPublishing()\"\n (click)=\"publishPage()\"\n title=\"Publish page\"\n >\n {{ isPublishing() ? 'Publishing...' : '🚀 Publish' }}\n </button>\n } @else {\n <button\n class=\"toolbar-btn\"\n [disabled]=\"isPublishing()\"\n (click)=\"unpublishPage()\"\n title=\"Unpublish page\"\n >\n {{ isPublishing() ? 'Unpublishing...' : '📥 Unpublish' }}\n </button>\n }\n }\n <button class=\"toolbar-btn preview-btn\" (click)=\"togglePreview()\">\n {{ isPreviewMode() ? '✏️ Edit' : '👁 Preview' }}\n </button>\n </div>\n </div>\n\n <!-- Canvas Content -->\n <div class=\"canvas\" #canvasEl [class.preview-mode]=\"isPreviewMode()\">\n @if (previewUrl()) {\n <iframe\n #previewFrame\n class=\"preview-iframe\"\n [src]=\"previewUrl()!\"\n (load)=\"onIframeLoad()\"\n allow=\"clipboard-read; clipboard-write\"\n ></iframe>\n } @else {\n <!-- Fallback: direct rendering when no storefront URL configured -->\n @if (facade.sections().length === 0) {\n <div class=\"empty-state\">\n <div class=\"empty-icon\">📄</div>\n <h3>Start Building</h3>\n <p>Click on a component from the sidebar to add it to your page</p>\n </div>\n } @else {\n @for (section of facade.sections(); track section.id; let idx = $index) {\n <div\n class=\"section-outer\"\n [class.selected]=\"facade.selectedSection()?.id === section.id\"\n >\n @if (!isPreviewMode()) {\n <div class=\"section-controls\">\n <span class=\"section-label\">{{ getSectionName(section) }}</span>\n <div class=\"section-actions\">\n @if (idx > 0) {\n <button class=\"action-btn\" (click)=\"moveUp(section.id, idx, $event)\" title=\"Move up\">↑</button>\n }\n @if (idx < facade.sections().length - 1) {\n <button class=\"action-btn\" (click)=\"moveDown(section.id, idx, $event)\" title=\"Move down\">↓</button>\n }\n @if (facade.isSectionDuplicable(section.type)) {\n <button class=\"action-btn\" (click)=\"duplicateSection(section.id, $event)\" title=\"Duplicate\">\n <span class=\"material-icon\">content_copy</span>\n </button>\n }\n <button class=\"action-btn delete\" (click)=\"deleteSection(section.id, $event)\" title=\"Delete\">×</button>\n </div>\n </div>\n }\n <div\n class=\"section-wrapper\"\n [attr.data-section-id]=\"section.id\"\n (click)=\"selectSection(section, $event)\"\n >\n <lib-dynamic-renderer [element]=\"section\" [context]=\"editorContext()\" />\n </div>\n </div>\n }\n }\n }\n </div>\n </main>\n\n <!-- Right Panel: Properties -->\n @if (!isPreviewMode()) {\n <aside class=\"properties-panel\" [class.has-selection]=\"facade.selectedSection()\">\n @if (facade.selectedSectionDefinition(); as def) {\n <!-- Tabs for Section Props / Blocks -->\n <div class=\"panel-tabs\">\n <button\n class=\"panel-tab\"\n [class.active]=\"propertiesTab() === 'props'\"\n (click)=\"propertiesTab.set('props')\"\n >\n Properties\n </button>\n <button\n class=\"panel-tab\"\n [class.active]=\"propertiesTab() === 'blocks'\"\n (click)=\"propertiesTab.set('blocks')\"\n >\n Blocks ({{ getBlockCount() }})\n </button>\n </div>\n\n @if (propertiesTab() === 'props') {\n <!-- Section Properties -->\n <div class=\"properties-header\">\n @if (isEditingName()) {\n <input\n #nameInput\n type=\"text\"\n class=\"name-edit-input\"\n [value]=\"editingNameValue()\"\n [placeholder]=\"getSelectedDefaultName(def)\"\n (keydown.enter)=\"saveEditingName($event)\"\n (keydown.escape)=\"cancelEditingName()\"\n (blur)=\"saveEditingName($event)\"\n aria-label=\"Rename\"\n />\n } @else {\n <h3\n class=\"editable-name\"\n (click)=\"startEditingName()\"\n title=\"Click to rename\"\n >\n {{ getSelectedDisplayName(def) }}\n <span class=\"edit-icon\" aria-hidden=\"true\">\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"currentColor\">\n <path d=\"M9.1 1.2L10.8 2.9 3.6 10.1 1.2 10.8 1.9 8.4z\"/>\n </svg>\n </span>\n </h3>\n }\n <button class=\"more-menu-btn\" (click)=\"facade.clearSelection()\" aria-label=\"Close\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\">\n <circle cx=\"4\" cy=\"8\" r=\"1.5\"/>\n <circle cx=\"8\" cy=\"8\" r=\"1.5\"/>\n <circle cx=\"12\" cy=\"8\" r=\"1.5\"/>\n </svg>\n </button>\n </div>\n <div class=\"properties-content\">\n @if (facade.selectedBlock(); as block) {\n <!-- Block Properties -->\n @for (group of getBlockPropertyGroups(); track group) {\n <div class=\"property-group\">\n <button\n class=\"group-title\"\n type=\"button\"\n [attr.aria-expanded]=\"!isGroupCollapsed(block.id, group)\"\n (click)=\"toggleGroup(block.id, group)\"\n >\n <span class=\"group-title-text\">{{ group }}</span>\n <span class=\"group-toggle-icon\" [class.collapsed]=\"isGroupCollapsed(block.id, group)\">&#9660;</span>\n </button>\n @if (!isGroupCollapsed(block.id, group)) {\n @for (prop of getBlockPropsForGroup(group); track prop.key) {\n <div class=\"property-field\">\n <label class=\"property-label\">{{ prop.schema.label }}</label>\n @switch (prop.schema.type) {\n @case ('string') {\n <input\n type=\"text\"\n class=\"property-input\"\n [value]=\"getBlockPropertyValue(prop.key)\"\n [placeholder]=\"prop.schema.placeholder ?? ''\"\n (input)=\"updateBlockProperty(prop.key, $event)\"\n />\n }\n @case ('textarea') {\n <textarea\n class=\"property-textarea\"\n [value]=\"getBlockPropertyValue(prop.key)\"\n [placeholder]=\"prop.schema.placeholder ?? ''\"\n (input)=\"updateBlockProperty(prop.key, $event)\"\n rows=\"3\"\n ></textarea>\n }\n @case ('number') {\n <input\n type=\"number\"\n class=\"property-input\"\n [value]=\"getBlockPropertyValue(prop.key)\"\n (input)=\"updateBlockProperty(prop.key, $event)\"\n />\n }\n @case ('boolean') {\n <div class=\"toggle-field\">\n <span class=\"toggle-label\">{{ prop.schema.label }}</span>\n <label class=\"toggle-switch\">\n <input\n type=\"checkbox\"\n class=\"toggle-input\"\n [checked]=\"getBlockPropertyValue(prop.key) === 'true'\"\n (change)=\"updateBlockBooleanProperty(prop.key, $event)\"\n />\n <span class=\"toggle-track\">\n <span class=\"toggle-thumb\"></span>\n </span>\n </label>\n </div>\n @if (prop.schema.description) {\n <span class=\"toggle-description\">{{ prop.schema.description }}</span>\n }\n }\n @case ('color') {\n <div class=\"color-field\">\n <input\n type=\"color\"\n class=\"color-picker\"\n [value]=\"getBlockPropertyValue(prop.key)\"\n (input)=\"updateBlockProperty(prop.key, $event)\"\n />\n <input\n type=\"text\"\n class=\"property-input color-text\"\n [value]=\"getBlockPropertyValue(prop.key)\"\n (input)=\"updateBlockProperty(prop.key, $event)\"\n />\n </div>\n }\n @case ('image') {\n <div class=\"media-field\">\n @if (getBlockPropertyValue(prop.key)) {\n <div class=\"media-preview\">\n <img\n class=\"media-thumbnail\"\n [src]=\"getBlockPropertyValue(prop.key)\"\n [alt]=\"prop.schema.label\"\n />\n <button\n class=\"media-remove-btn\"\n (click)=\"clearBlockProperty(prop.key)\"\n aria-label=\"Remove image\"\n >×</button>\n </div>\n }\n <button class=\"media-browse-btn\" (click)=\"openFilePicker('IMAGE', prop.key, 'block')\">\n Browse images\n </button>\n <input\n type=\"text\"\n class=\"property-input media-url-input\"\n [value]=\"getBlockPropertyValue(prop.key)\"\n [placeholder]=\"prop.schema.placeholder ?? 'Paste image URL...'\"\n (input)=\"updateBlockProperty(prop.key, $event)\"\n />\n </div>\n }\n @case ('video') {\n <div class=\"media-field\">\n @if (getBlockPropertyValue(prop.key)) {\n <div class=\"media-preview video-preview\">\n <div class=\"video-indicator\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M8 5v14l11-7z\"/>\n </svg>\n </div>\n <span class=\"video-url-text\">{{ getBlockPropertyValue(prop.key) }}</span>\n <button\n class=\"media-remove-btn\"\n (click)=\"clearBlockProperty(prop.key)\"\n aria-label=\"Remove video\"\n >×</button>\n </div>\n }\n <button class=\"media-browse-btn\" (click)=\"openFilePicker('VIDEO', prop.key, 'block')\">\n Browse videos\n </button>\n <input\n type=\"text\"\n class=\"property-input media-url-input\"\n [value]=\"getBlockPropertyValue(prop.key)\"\n [placeholder]=\"prop.schema.placeholder ?? 'Paste video URL...'\"\n (input)=\"updateBlockProperty(prop.key, $event)\"\n />\n </div>\n }\n @case ('select') {\n <select\n class=\"property-select\"\n [value]=\"getBlockPropertyValue(prop.key)\"\n (change)=\"updateBlockProperty(prop.key, $event)\"\n >\n @for (option of prop.schema.options ?? []; track option.value) {\n <option [value]=\"option.value\">{{ option.label }}</option>\n }\n </select>\n }\n @default {\n <input\n type=\"text\"\n class=\"property-input\"\n [value]=\"getBlockPropertyValue(prop.key)\"\n (input)=\"updateBlockProperty(prop.key, $event)\"\n />\n }\n }\n </div>\n }\n }\n </div>\n }\n <button class=\"delete-block-btn\" (click)=\"deleteSelectedBlock()\">\n Remove block\n </button>\n } @else {\n <!-- Section Properties -->\n @let sectionId = facade.selectedSection()?.id ?? '';\n @for (group of getPropertyGroups(def); track group) {\n <div class=\"property-group\">\n <button\n class=\"group-title\"\n type=\"button\"\n [attr.aria-expanded]=\"!isGroupCollapsed(sectionId, group)\"\n (click)=\"toggleGroup(sectionId, group)\"\n >\n <span class=\"group-title-text\">{{ group }}</span>\n <span class=\"group-toggle-icon\" [class.collapsed]=\"isGroupCollapsed(sectionId, group)\">&#9660;</span>\n </button>\n @if (!isGroupCollapsed(sectionId, group)) {\n @for (prop of getPropsForGroup(def, group); track prop.key) {\n <div class=\"property-field\">\n <label class=\"property-label\">{{ prop.schema.label }}</label>\n @switch (prop.schema.type) {\n @case ('string') {\n <input\n type=\"text\"\n class=\"property-input\"\n [value]=\"getPropertyValue(prop.key)\"\n [placeholder]=\"prop.schema.placeholder ?? ''\"\n (input)=\"updateProperty(prop.key, $event)\"\n />\n }\n @case ('url') {\n <input\n type=\"url\"\n class=\"property-input\"\n [value]=\"getPropertyValue(prop.key)\"\n [placeholder]=\"prop.schema.placeholder ?? ''\"\n (input)=\"updateProperty(prop.key, $event)\"\n />\n }\n @case ('image') {\n <div class=\"media-field\">\n @if (getPropertyValue(prop.key)) {\n <div class=\"media-preview\">\n <img\n class=\"media-thumbnail\"\n [src]=\"getPropertyValue(prop.key)\"\n [alt]=\"prop.schema.label\"\n />\n <button\n class=\"media-remove-btn\"\n (click)=\"clearSectionProperty(prop.key)\"\n aria-label=\"Remove image\"\n >×</button>\n </div>\n }\n <button class=\"media-browse-btn\" (click)=\"openFilePicker('IMAGE', prop.key, 'section')\">\n Browse images\n </button>\n <input\n type=\"text\"\n class=\"property-input media-url-input\"\n [value]=\"getPropertyValue(prop.key)\"\n [placeholder]=\"prop.schema.placeholder ?? 'Paste image URL...'\"\n (input)=\"updateProperty(prop.key, $event)\"\n />\n </div>\n }\n @case ('video') {\n <div class=\"media-field\">\n @if (getPropertyValue(prop.key)) {\n <div class=\"media-preview video-preview\">\n <div class=\"video-indicator\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M8 5v14l11-7z\"/>\n </svg>\n </div>\n <span class=\"video-url-text\">{{ getPropertyValue(prop.key) }}</span>\n <button\n class=\"media-remove-btn\"\n (click)=\"clearSectionProperty(prop.key)\"\n aria-label=\"Remove video\"\n >×</button>\n </div>\n }\n <button class=\"media-browse-btn\" (click)=\"openFilePicker('VIDEO', prop.key, 'section')\">\n Browse videos\n </button>\n <input\n type=\"text\"\n class=\"property-input media-url-input\"\n [value]=\"getPropertyValue(prop.key)\"\n [placeholder]=\"prop.schema.placeholder ?? 'Paste video URL...'\"\n (input)=\"updateProperty(prop.key, $event)\"\n />\n </div>\n }\n @case ('color') {\n <div class=\"color-field\">\n <input\n type=\"color\"\n class=\"color-picker\"\n [value]=\"getPropertyValue(prop.key)\"\n (input)=\"updateProperty(prop.key, $event)\"\n />\n <input\n type=\"text\"\n class=\"property-input color-text\"\n [value]=\"getPropertyValue(prop.key)\"\n (input)=\"updateProperty(prop.key, $event)\"\n />\n </div>\n }\n @case ('select') {\n <select\n class=\"property-select\"\n [value]=\"getPropertyValue(prop.key)\"\n (change)=\"updateProperty(prop.key, $event)\"\n >\n @for (option of prop.schema.options ?? []; track option.value) {\n <option [value]=\"option.value\">{{ option.label }}</option>\n }\n </select>\n }\n @case ('json') {\n <textarea\n class=\"property-textarea\"\n [value]=\"getPropertyValue(prop.key)\"\n (input)=\"updateProperty(prop.key, $event)\"\n rows=\"4\"\n ></textarea>\n }\n @default {\n <input\n type=\"text\"\n class=\"property-input\"\n [value]=\"getPropertyValue(prop.key)\"\n (input)=\"updateProperty(prop.key, $event)\"\n />\n }\n }\n </div>\n }\n }\n </div>\n }\n }\n </div>\n } @else {\n <!-- Blocks List -->\n <div class=\"properties-header\">\n <h3>Blocks in Section</h3>\n </div>\n <div class=\"blocks-list\">\n @for (slot of getSectionSlots(); track slot.name) {\n <div class=\"slot-group\">\n <h4 class=\"slot-title\">{{ slot.label }}</h4>\n @for (block of getBlocksForSlot(slot.name); track block.id; let idx = $index) {\n <div\n class=\"block-item\"\n [class.selected]=\"facade.selectedBlock()?.id === block.id\"\n (click)=\"selectBlock(block)\"\n >\n <span class=\"block-icon\">{{ getBlockIconByType(block.type) }}</span>\n <span class=\"block-name\">{{ getBlockName(block) }}</span>\n <div class=\"block-actions\">\n @if (idx > 0) {\n<!-- <button class=\"mini-btn\" (click)=\"moveBlockUp(block, slot.name, idx, $event)\">↑</button>-->\n }\n @if (idx < getBlocksForSlot(slot.name).length - 1) {\n<!-- <button class=\"mini-btn\" (click)=\"moveBlockDown(block, slot.name, idx, $event)\">↓</button>-->\n }\n @if (facade.isBlockDuplicable(block.type)) {\n <button class=\"mini-btn\" (click)=\"duplicateBlock(block, $event)\" title=\"Duplicate\">\n <span class=\"material-icon\">content_copy</span>\n </button>\n }\n <button class=\"mini-btn delete\" (click)=\"deleteBlock(block, $event)\">×</button>\n </div>\n </div>\n }\n @if (getBlocksForSlot(slot.name).length === 0) {\n <div class=\"empty-slot\">{{ slot.emptyPlaceholder ?? 'No blocks' }}</div>\n }\n </div>\n }\n @if (getSectionSlots().length === 0) {\n <div class=\"no-slots\">\n <p>This section doesn't have any slots for blocks</p>\n </div>\n }\n </div>\n }\n } @else {\n <div class=\"no-selection\">\n <p>Select a section to edit its properties</p>\n </div>\n }\n </aside>\n }\n\n @if (filePickerOpen()) {\n <lib-shopify-file-picker\n [mediaType]=\"filePickerMediaType()\"\n [currentValue]=\"filePickerCurrentValue()\"\n (fileSelected)=\"onFileSelected($event)\"\n (closed)=\"closeFilePicker()\"\n />\n }\n </div>\n `,\n styles: `\n :host {\n display: block;\n height: 100vh;\n overflow: hidden;\n }\n\n .editor-layout {\n display: grid;\n grid-template-columns: 280px 1fr 300px;\n height: 100%;\n background: #f0f2f5;\n }\n\n /* Sidebar */\n .sidebar {\n background: #fff;\n border-right: 1px solid #e0e0e0;\n display: flex;\n flex-direction: column;\n }\n\n .sidebar-header {\n padding: 1rem;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .sidebar-header h2 {\n margin: 0;\n font-size: 0.875rem;\n font-weight: 600;\n color: #333;\n }\n\n /* Search Box */\n .search-box {\n display: none;\n }\n\n .search-box:focus-within {\n border-color: #005bd3;\n background: #fff;\n }\n\n .search-icon {\n font-size: 0.875rem;\n opacity: 0.6;\n }\n\n .search-input {\n flex: 1;\n border: none;\n background: transparent;\n font-size: 0.8125rem;\n color: #333;\n outline: none;\n }\n\n .search-input::placeholder {\n color: #999;\n }\n\n .search-clear {\n padding: 0.125rem 0.375rem;\n border: none;\n background: #ddd;\n border-radius: 3px;\n cursor: pointer;\n font-size: 0.75rem;\n color: #666;\n line-height: 1;\n }\n\n .search-clear:hover {\n background: #ccc;\n }\n\n .search-no-results {\n padding: 2rem 1rem;\n text-align: center;\n color: #888;\n }\n\n .search-no-results p {\n margin: 0;\n font-size: 0.875rem;\n }\n\n /* Picker Search */\n .picker-search {\n padding: 0.5rem;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .picker-search-input {\n width: 87%;\n padding: 0.5rem 0.75rem;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n font-size: 0.8125rem;\n outline: none;\n transition: border-color 0.2s;\n }\n\n .picker-search-input:focus {\n border-color: #005bd3;\n }\n\n .picker-search-input::placeholder {\n color: #999;\n }\n\n /* Section Tree */\n .section-tree {\n flex: 1;\n overflow-y: auto;\n padding: 0.25rem 0;\n }\n\n .tree-section {\n border-bottom: none;\n }\n\n .tree-section.selected > .tree-section-header {\n background: #005bd3;\n color: #fff;\n border-radius: 8px;\n margin: 0 0.375rem;\n }\n\n .tree-section.selected > .tree-section-header .section-name,\n .tree-section.selected > .tree-section-header .expand-btn,\n .tree-section.selected > .tree-section-header .section-icon,\n .tree-section.selected > .tree-section-header .drag-handle,\n .tree-section.selected > .tree-section-header .tree-btn {\n color: inherit;\n }\n\n .tree-section-header {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.5rem;\n cursor: pointer;\n transition: background 0.2s;\n }\n\n .tree-section-header:hover {\n background: #f5f5f5;\n border-radius: 8px;\n margin: 0 0.375rem;\n }\n\n .expand-btn {\n width: 16px;\n height: 16px;\n padding: 0;\n border: none;\n background: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n color: #666;\n transition: transform 0.2s;\n flex-shrink: 0;\n }\n\n .expand-btn.expanded .expand-icon {\n transform: rotate(90deg);\n }\n\n .expand-icon {\n font-size: 0.625rem;\n transition: transform 0.2s;\n }\n\n .icon-drag-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .icon-drag-wrapper .drag-handle {\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .tree-section-header:hover .icon-drag-wrapper .section-icon,\n .icon-drag-wrapper:has(.drag-handle:focus-visible) .section-icon {\n visibility: hidden;\n }\n\n .section-icon {\n font-size: 1rem;\n }\n\n .section-name {\n flex: 1;\n font-size: 0.8125rem;\n font-weight: 500;\n color: #333;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .tree-actions {\n display: flex;\n gap: 0.125rem;\n opacity: 0;\n transition: opacity 0.2s;\n }\n\n .tree-section-header:hover .tree-actions,\n .tree-block:hover .tree-actions {\n opacity: 1;\n }\n\n .tree-btn {\n padding: 0.125rem 0.375rem;\n border: none;\n border-radius: 3px;\n background: #e0e0e0;\n cursor: pointer;\n font-size: 0.6875rem;\n color: #666;\n }\n\n .tree-btn:hover {\n background: #d0d0d0;\n }\n\n .tree-btn.delete:hover {\n background: #e74c3c;\n color: #fff;\n }\n\n .tree-section.drag-over-before > .tree-section-header {\n box-shadow: inset 0 2px 0 0 #4a90d9;\n }\n\n .tree-section.drag-over-after > .tree-section-header {\n box-shadow: inset 0 -2px 0 0 #4a90d9;\n }\n\n .tree-section.is-section-dragging {\n opacity: 0.4;\n }\n\n .tree-section.is-section-dragging > .tree-section-header {\n cursor: grabbing;\n }\n\n .drag-handle {\n cursor: grab;\n color: #999;\n opacity: 0;\n transition: opacity 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n padding: 0.125rem;\n border: none;\n background: none;\n border-radius: 2px;\n }\n\n .drag-handle:hover {\n color: #666;\n background: #e0e0e0;\n }\n\n .drag-handle:focus-visible {\n opacity: 1;\n outline: 2px solid #4a90d9;\n outline-offset: 1px;\n }\n\n .tree-section-header:hover .drag-handle {\n opacity: 1;\n }\n\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .tree-section,\n .drag-handle,\n .tree-actions {\n transition: none;\n }\n }\n\n .tree-section-content {\n padding-left: 0.5rem;\n }\n\n .tree-block {\n display: flex;\n align-items: center;\n gap: 0.375rem;\n padding: 0.5rem 0.75rem;\n cursor: pointer;\n transition: background 0.2s;\n }\n\n .tree-block:hover {\n background: #f5f5f5;\n border-radius: 8px;\n margin: 0 0.375rem;\n }\n\n .tree-block.selected {\n background: #005bd3;\n color: #fff;\n border-radius: 8px;\n margin: 0 0.375rem;\n }\n\n .tree-block.selected .block-icon,\n .tree-block.selected .block-name {\n color: inherit;\n }\n\n .block-indent {\n width: 20px;\n height: 1px;\n background: #ddd;\n margin-left: 10px;\n }\n\n .block-icon {\n font-size: 0.875rem;\n }\n\n .block-name {\n flex: 1;\n font-size: 0.75rem;\n color: #555;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .add-block-btn {\n display: flex;\n align-items: center;\n gap: 0.375rem;\n width: calc(100% - 1.5rem);\n margin: 0.375rem 0.75rem 0.5rem 2rem;\n padding: 0.375rem 0.5rem;\n border: none;\n border-radius: 4px;\n background: transparent;\n cursor: pointer;\n font-size: 0.75rem;\n color: #005bd3;\n transition: all 0.2s;\n }\n\n .add-block-btn:hover {\n background: #f0f5ff;\n color: #004299;\n }\n\n .add-icon {\n font-size: 0.875rem;\n font-weight: 600;\n }\n\n .add-icon-circle {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n /* Add Section Area */\n .add-section-area {\n padding: 0.75rem;\n border-top: 1px solid #e0e0e0;\n position: relative;\n }\n\n .add-section-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.375rem;\n width: 100%;\n padding: 0.625rem;\n border: none;\n border-radius: 6px;\n background: transparent;\n cursor: pointer;\n font-size: 0.8125rem;\n font-weight: 500;\n color: #005bd3;\n transition: all 0.2s;\n }\n\n .add-section-btn:hover {\n background: #f0f5ff;\n }\n\n .section-picker {\n position: absolute;\n bottom: 100%;\n left: 0.75rem;\n right: 0.75rem;\n background: #fff;\n border: 1px solid #e0e0e0;\n border-radius: 6px;\n box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);\n max-height: 300px;\n overflow-y: auto;\n z-index: 100;\n }\n\n .picker-item {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n width: 100%;\n padding: 0.75rem;\n border: none;\n border-bottom: 1px solid #f0f0f0;\n background: #fff;\n cursor: pointer;\n text-align: left;\n transition: background 0.2s;\n }\n\n .picker-item:last-child {\n border-bottom: none;\n }\n\n .picker-item:hover {\n background: #f5f5f5;\n }\n\n .picker-icon {\n font-family: 'Material Icons', sans-serif;\n font-size: 1.5rem;\n font-weight: normal;\n font-style: normal;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n white-space: nowrap;\n word-wrap: normal;\n direction: ltr;\n -webkit-font-smoothing: antialiased;\n text-rendering: optimizeLegibility;\n }\n\n .picker-info {\n display: flex;\n flex-direction: column;\n gap: 0.125rem;\n }\n\n .picker-name {\n font-size: 0.8125rem;\n font-weight: 500;\n color: #333;\n }\n\n .picker-desc {\n font-size: 0.6875rem;\n color: #888;\n }\n\n /* Block Picker Modal */\n .block-picker-overlay {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.4);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n }\n\n .block-picker {\n background: #fff;\n border-radius: 8px;\n width: 320px;\n max-height: 400px;\n display: flex;\n flex-direction: column;\n box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);\n }\n\n .picker-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 1rem;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .picker-header h3 {\n margin: 0;\n font-size: 0.9375rem;\n font-weight: 600;\n }\n\n .picker-content {\n flex: 1;\n overflow-y: auto;\n padding: 0.5rem;\n }\n\n .picker-content .picker-item {\n border: 1px solid #e0e0e0;\n border-radius: 6px;\n margin-bottom: 0.5rem;\n }\n\n .picker-content .picker-item:hover {\n border-color: #005bd3;\n }\n\n .picker-category {\n border-bottom: 1px solid #f0f0f0;\n }\n\n .picker-category:last-child {\n border-bottom: none;\n }\n\n .picker-category-label {\n padding: 0.5rem 0.75rem 0.25rem;\n font-size: 0.6875rem;\n font-weight: 600;\n color: #888;\n }\n\n .picker-empty {\n padding: 2rem;\n text-align: center;\n color: #888;\n font-size: 0.875rem;\n }\n\n /* Canvas Area */\n .canvas-area {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .toolbar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.5rem 1rem;\n background: #fff;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .toolbar-left, .toolbar-right {\n display: flex;\n gap: 0.5rem;\n }\n\n .toolbar-btn {\n padding: 0.375rem 0.75rem;\n border: 1px solid #e0e0e0;\n border-radius: 8px;\n background: #fff;\n cursor: pointer;\n font-size: 0.8125rem;\n transition: all 0.2s;\n }\n\n .toolbar-btn:hover:not(:disabled) {\n background: #f0f2f5;\n }\n\n .toolbar-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .preview-btn,\n .publish-btn {\n background: #303030;\n color: #fff;\n border-color: #303030;\n border-radius: 8px;\n }\n\n .preview-btn:hover,\n .publish-btn:hover:not(:disabled) {\n background: #1a1a1a !important;\n }\n\n .back-btn {\n border-color: transparent;\n background: transparent;\n }\n\n .section-count {\n font-size: 0.875rem;\n color: #666;\n }\n\n .page-title {\n font-size: 0.9375rem;\n font-weight: 600;\n color: #333;\n margin-right: 0.75rem;\n }\n\n .page-title-link {\n text-decoration: none;\n color: inherit;\n }\n\n .page-title-link:hover {\n text-decoration: underline;\n }\n\n .status-badge {\n display: inline-block;\n padding: 0.125rem 0.5rem;\n border-radius: 10px;\n font-size: 0.6875rem;\n font-weight: 500;\n text-transform: capitalize;\n background: #ffeaa7;\n color: #856404;\n }\n\n .status-badge.published {\n background: #b4fed3;\n color: #0d542b;\n }\n\n .dirty-indicator {\n margin-left: 0.75rem;\n font-size: 0.8125rem;\n color: #e67e22;\n font-weight: 500;\n }\n\n .canvas {\n flex: 1;\n overflow-y: auto;\n padding: 2rem;\n position: relative;\n }\n\n .canvas.preview-mode {\n padding: 0;\n background: #fff;\n }\n\n .preview-iframe {\n width: 100%;\n height: 100%;\n border: none;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n\n .canvas.preview-mode .section-outer {\n margin: 0;\n }\n\n .canvas.preview-mode .section-wrapper {\n border: none;\n border-radius: 0;\n }\n\n .empty-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: #666;\n text-align: center;\n }\n\n .empty-icon {\n font-size: 4rem;\n margin-bottom: 1rem;\n }\n\n .empty-state h3 {\n margin: 0 0 0.5rem;\n color: #333;\n }\n\n .empty-state p {\n margin: 0;\n font-size: 0.875rem;\n }\n\n .section-outer {\n position: relative;\n margin-bottom: 0;\n }\n\n .section-wrapper {\n border: 1px solid transparent;\n border-radius: 0;\n overflow: hidden;\n transition: border-color 0.2s;\n background: #fff;\n }\n\n .section-outer:hover .section-wrapper {\n border-color: rgba(0, 91, 211, 0.4);\n }\n\n .section-outer.selected .section-wrapper {\n border-color: rgba(0, 91, 211, 0.4);\n }\n\n .section-controls {\n position: absolute;\n top: -20px;\n left: 0;\n right: 0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: .14rem .75rem;\n background: #005BD3;\n color: #fff;\n font-size: 0.75rem;\n border-radius: 8px 8px 0 0;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.2s;\n z-index: 10;\n }\n\n .section-outer:hover .section-controls,\n .section-outer.selected .section-controls {\n opacity: 1;\n pointer-events: auto;\n }\n\n .section-outer:hover .section-wrapper,\n .section-outer.selected .section-wrapper {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n\n .section-label {\n font-weight: 500;\n }\n\n .section-actions {\n display: flex;\n gap: 0.25rem;\n }\n\n .action-btn {\n padding: .15rem .5rem;\n border: none;\n border-radius: 4px;\n background: #ffffff26;\n color: #fff;\n cursor: pointer;\n font-size: .6rem;\n }\n\n .action-btn:hover {\n background: rgba(255, 255, 255, 0.3);\n }\n\n .action-btn.delete:hover {\n background: #e74c3c;\n }\n\n .material-icon {\n font-family: 'Material Icons', sans-serif;\n font-size: 0.75rem;\n font-weight: normal;\n font-style: normal;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n white-space: nowrap;\n word-wrap: normal;\n direction: ltr;\n -webkit-font-smoothing: antialiased;\n text-rendering: optimizeLegibility;\n }\n\n /* Properties Panel */\n .properties-panel {\n background: #fff;\n border-left: 1px solid #e0e0e0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n\n .properties-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 1rem;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .properties-header h3 {\n margin: 0;\n font-size: 1rem;\n font-weight: 600;\n }\n\n .editable-name {\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 0.375rem;\n border-radius: 4px;\n padding: 0.125rem 0.25rem;\n margin: -0.125rem -0.25rem;\n transition: background 0.2s;\n }\n\n .editable-name:hover {\n background: #f0f2f5;\n }\n\n .edit-icon {\n opacity: 0;\n color: #999;\n transition: opacity 0.2s;\n display: flex;\n flex-shrink: 0;\n }\n\n .editable-name:hover .edit-icon {\n opacity: 1;\n }\n\n .name-edit-input {\n flex: 1;\n padding: 0.375rem 0.5rem;\n border: 1px solid #005bd3;\n border-radius: 8px;\n font-size: 1rem;\n font-weight: 600;\n outline: none;\n }\n\n .close-btn {\n border: none;\n background: none;\n font-size: 1.25rem;\n cursor: pointer;\n color: #666;\n }\n\n .more-menu-btn {\n border: none;\n background: none;\n cursor: pointer;\n color: #616161;\n padding: 0.25rem;\n border-radius: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background 0.2s;\n }\n\n .more-menu-btn:hover {\n background: #f0f2f5;\n color: #303030;\n }\n\n .properties-content {\n flex: 1;\n overflow-y: auto;\n padding: 1rem;\n }\n\n .property-group {\n margin-bottom: 0;\n padding: 1rem 0;\n border-top: 1px solid #e0e0e0;\n }\n\n .property-group:first-child {\n border-top: none;\n }\n\n .group-title {\n display: flex;\n align-items: center;\n gap: 0.375rem;\n width: 100%;\n padding: 0;\n margin: 0 0 0.75rem;\n border: none;\n background: none;\n font-size: 0.8125rem;\n font-weight: 600;\n color: #303030;\n cursor: pointer;\n }\n\n .group-title:hover {\n color: #333;\n }\n\n .group-title:focus-visible {\n outline: 2px solid #4a90d9;\n outline-offset: 2px;\n border-radius: 2px;\n }\n\n .group-title-text {\n flex: 1;\n text-align: left;\n }\n\n .group-toggle-icon {\n font-size: 0.5rem;\n transition: transform 0.2s;\n display: inline-block;\n }\n\n .group-toggle-icon.collapsed {\n transform: rotate(-90deg);\n }\n\n .property-field {\n margin-bottom: 1rem;\n }\n\n .property-label {\n display: block;\n font-size: 0.875rem;\n font-weight: 500;\n margin-bottom: 0.375rem;\n color: #616161;\n }\n\n .property-input,\n .property-select,\n .property-textarea {\n width: 100%;\n padding: 0.5rem 0.75rem;\n border: 1px solid #c9cccf;\n border-radius: 8px;\n font-size: 0.875rem;\n transition: border-color 0.2s, box-shadow 0.2s;\n }\n\n .property-input:focus,\n .property-select:focus,\n .property-textarea:focus {\n outline: none;\n border-color: #005bd3;\n box-shadow: 0 0 0 1px #005bd3;\n }\n\n .property-textarea {\n resize: vertical;\n font-family: monospace;\n font-size: 0.75rem;\n }\n\n .color-field {\n display: flex;\n gap: 0.5rem;\n }\n\n .color-picker {\n width: 40px;\n height: 36px;\n padding: 2px;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n cursor: pointer;\n }\n\n .color-text {\n flex: 1;\n }\n\n .no-selection {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: #666;\n text-align: center;\n padding: 2rem;\n }\n\n .no-selection p {\n margin: 0;\n font-size: 0.875rem;\n }\n\n /* Panel Tabs */\n .panel-tabs {\n display: flex;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .panel-tab {\n flex: 1;\n padding: 0.75rem;\n border: none;\n border-bottom: 2px solid transparent;\n background: #fff;\n cursor: pointer;\n font-size: 0.75rem;\n font-weight: 500;\n color: #666;\n transition: all 0.2s;\n }\n\n .panel-tab:hover {\n background: #f8f9fa;\n color: #303030;\n }\n\n .panel-tab.active {\n background: #fff;\n color: #303030;\n border-bottom: 2px solid #005bd3;\n }\n\n /* Blocks List */\n .blocks-list {\n flex: 1;\n overflow-y: auto;\n padding: 1rem;\n }\n\n .slot-group {\n margin-bottom: 1.5rem;\n }\n\n .slot-title {\n font-size: 0.75rem;\n font-weight: 600;\n color: #616161;\n margin: 0 0 0.5rem;\n }\n\n .block-item {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.5rem;\n border: 1px solid #e0e0e0;\n border-radius: 4px;\n margin-bottom: 0.375rem;\n cursor: pointer;\n transition: all 0.2s;\n }\n\n .block-item:hover {\n border-color: #005bd3;\n background: #f8f9fa;\n }\n\n .block-item.selected {\n border-color: #005bd3;\n background: #005bd3;\n color: #fff;\n }\n\n .block-item.selected .block-icon,\n .block-item.selected .block-name {\n color: inherit;\n }\n\n .block-icon {\n font-size: 1rem;\n }\n\n .block-name {\n flex: 1;\n font-size: 0.8rem;\n font-weight: 500;\n color: #333;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .block-actions {\n display: flex;\n gap: 0.125rem;\n opacity: 0;\n transition: opacity 0.2s;\n }\n\n .block-item:hover .block-actions {\n opacity: 1;\n }\n\n .mini-btn {\n padding: 0.125rem 0.375rem;\n border: none;\n border-radius: 3px;\n background: #e0e0e0;\n cursor: pointer;\n font-size: 0.75rem;\n color: #666;\n }\n\n .mini-btn:hover {\n background: #d0d0d0;\n }\n\n .mini-btn.delete:hover {\n background: #e74c3c;\n color: #fff;\n }\n\n .empty-slot {\n padding: 0.75rem;\n text-align: center;\n color: #999;\n font-size: 0.75rem;\n background: #f8f9fa;\n border: 1px dashed #ddd;\n border-radius: 4px;\n }\n\n .no-slots {\n padding: 2rem;\n text-align: center;\n color: #666;\n }\n\n .no-slots p {\n margin: 0;\n font-size: 0.875rem;\n }\n\n .delete-block-btn {\n width: auto;\n padding: 0;\n margin-top: 1rem;\n border: none;\n border-radius: 0;\n background: transparent;\n color: #d72c0d;\n cursor: pointer;\n font-size: 0.875rem;\n font-weight: 500;\n transition: color 0.2s;\n }\n\n .delete-block-btn:hover {\n background: transparent;\n color: #bc2200;\n text-decoration: underline;\n }\n\n .toggle-field {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .toggle-label {\n font-size: 0.875rem;\n color: #303030;\n }\n\n .toggle-switch {\n position: relative;\n display: inline-flex;\n cursor: pointer;\n }\n\n .toggle-input {\n position: absolute;\n opacity: 0;\n width: 0;\n height: 0;\n }\n\n .toggle-track {\n width: 36px;\n height: 20px;\n background: #b5b5b5;\n border-radius: 10px;\n position: relative;\n transition: background 0.2s;\n }\n\n .toggle-thumb {\n position: absolute;\n top: 2px;\n left: 2px;\n width: 16px;\n height: 16px;\n background: #fff;\n border-radius: 50%;\n transition: transform 0.2s;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);\n }\n\n .toggle-input:checked + .toggle-track {\n background: #008060;\n }\n\n .toggle-input:checked + .toggle-track .toggle-thumb {\n transform: translateX(16px);\n }\n\n .toggle-input:focus-visible + .toggle-track {\n outline: 2px solid #005bd3;\n outline-offset: 2px;\n }\n\n .toggle-description {\n display: block;\n font-size: 0.75rem;\n color: #616161;\n margin-top: 0.25rem;\n }\n\n /* Media Field (image/video picker) */\n .media-field {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n }\n\n .media-preview {\n position: relative;\n border: 1px solid #e0e0e0;\n border-radius: 8px;\n overflow: hidden;\n }\n\n .media-thumbnail {\n display: block;\n width: 100%;\n max-height: 160px;\n object-fit: cover;\n background: #f0f2f5;\n }\n\n .media-remove-btn {\n position: absolute;\n top: 0.25rem;\n right: 0.25rem;\n width: 22px;\n height: 22px;\n border: none;\n border-radius: 50%;\n background: rgba(0, 0, 0, 0.6);\n color: #fff;\n cursor: pointer;\n font-size: 0.875rem;\n line-height: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .media-remove-btn:hover {\n background: #d72c0d;\n }\n\n .media-browse-btn {\n padding: 0.5rem 0.75rem;\n border: 1px solid #c9cccf;\n border-radius: 8px;\n background: #fff;\n cursor: pointer;\n font-size: 0.8125rem;\n color: #303030;\n transition: all 0.15s;\n }\n\n .media-browse-btn:hover {\n background: #f0f2f5;\n border-color: #999;\n }\n\n .media-url-input {\n font-size: 0.75rem;\n color: #616161;\n }\n\n .video-preview {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.5rem 0.75rem;\n background: #1a1a1a;\n }\n\n .video-indicator {\n color: #fff;\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n .video-url-text {\n flex: 1;\n color: #ccc;\n font-size: 0.6875rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .video-preview .media-remove-btn {\n position: static;\n flex-shrink: 0;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class VisualEditorComponent implements OnInit, OnDestroy {\n readonly facade = inject(VisualEditorFacade);\n private readonly registry = inject(ComponentRegistryService);\n private readonly navigation = inject(VisualEditorNavigation);\n private readonly loadingStrategy = inject(PageLoadingStrategy);\n private readonly config = inject(VISUAL_EDITOR_CONFIG);\n private readonly dndService = inject(DragDropService);\n private readonly iframeBridge = inject(IframeBridgeService);\n private readonly storefrontUrlService = inject(StorefrontUrlService);\n private readonly sanitizer = inject(DomSanitizer);\n private readonly destroy$ = new Subject<void>();\n\n // Configuration-driven UI options\n readonly showBackButton = computed(() => this.config.ui?.showBackButton ?? true);\n readonly showPublishButtons = computed(() => this.config.ui?.showPublishButtons ?? true);\n readonly showSaveButton = computed(() => this.config.ui?.showSaveButton ?? true);\n\n readonly isPreviewMode = signal(false);\n readonly editorContext = computed(() => ({ isEditor: !this.isPreviewMode() }));\n private readonly canvasEl = viewChild<ElementRef<HTMLElement>>('canvasEl');\n\n // Iframe preview\n private readonly previewFrame = viewChild<ElementRef<HTMLIFrameElement>>('previewFrame');\n readonly previewUrl = computed<SafeResourceUrl | null>(() => {\n const url = this.storefrontUrlService.url();\n if (!url) return null;\n return this.sanitizer.bypassSecurityTrustResourceUrl(\n `${url}/kustomizer/editor`\n );\n });\n private iframeReady = false;\n readonly propertiesTab = signal<'props' | 'blocks'>('props');\n readonly expandedGroups = signal(new Set<string>());\n readonly expandedSections = signal<Set<string>>(new Set());\n readonly allBlocksExpanded = signal(new Set<string>());\n readonly showSectionPicker = signal(false);\n readonly blockPickerSection = signal<EditorSection | null>(null);\n readonly nestedBlockPickerTarget = signal<BlockPickerTarget | null>(null);\n\n // File picker state\n readonly filePickerOpen = signal(false);\n readonly filePickerMediaType = signal<'IMAGE' | 'VIDEO'>('IMAGE');\n readonly filePickerTargetKey = signal('');\n readonly filePickerContext = signal<'block' | 'section'>('block');\n readonly filePickerCurrentValue = computed(() => {\n const key = this.filePickerTargetKey();\n if (!key) return '';\n return this.filePickerContext() === 'block'\n ? this.getBlockPropertyValue(key)\n : this.getPropertyValue(key);\n });\n\n // Page state\n readonly isSaving = signal(false);\n readonly isPublishing = signal(false);\n readonly isLoading = signal(false);\n\n // Search signals\n readonly searchQuery = signal('');\n readonly sectionPickerSearch = signal('');\n readonly blockPickerSearch = signal('');\n readonly nestedBlockPickerSearch = signal('');\n\n // DnD signals\n readonly sectionDropZone = signal<string | null>(null);\n readonly dndAnnouncement = signal('');\n private sectionAutoExpandTimer: ReturnType<typeof setTimeout> | null = null;\n\n // Filtered lists\n readonly filteredSections = computed(() => {\n const query = this.searchQuery().toLowerCase().trim();\n const sections = this.facade.sections();\n\n if (!query) return sections;\n\n return sections.filter((section) => {\n const sectionName = this.getSectionName(section).toLowerCase();\n const sectionType = section.type.toLowerCase();\n\n // Match section name or type\n if (sectionName.includes(query) || sectionType.includes(query)) {\n return true;\n }\n\n // Match any block inside the section\n const blocks = section.elements ?? [];\n return blocks.some((block) => {\n const blockName = this.getBlockName(block).toLowerCase();\n const blockType = block.type.toLowerCase();\n return blockName.includes(query) || blockType.includes(query);\n });\n });\n });\n\n readonly filteredAvailableSectionPresets = computed(() => {\n const query = this.sectionPickerSearch().toLowerCase().trim();\n const presets = this.facade.availableSectionPresets();\n\n if (!query) return presets;\n\n return presets.filter((rp) => {\n const name = rp.displayName.toLowerCase();\n const type = rp.definition.type.toLowerCase();\n const desc = (rp.displayDescription ?? '').toLowerCase();\n const tags = (rp.definition.tags ?? []).join(' ').toLowerCase();\n\n return name.includes(query) || type.includes(query) || desc.includes(query) || tags.includes(query);\n });\n });\n\n readonly groupedSectionPresets = computed(() => {\n const presets = this.filteredAvailableSectionPresets();\n const groups = new Map<string, ResolvedPreset[]>();\n\n for (const rp of presets) {\n const category = rp.displayCategory;\n const list = groups.get(category);\n if (list) {\n list.push(rp);\n } else {\n groups.set(category, [rp]);\n }\n }\n\n return Array.from(groups.entries()).map(([category, items]) => ({\n category,\n presets: items,\n }));\n });\n\n readonly filteredBlockPresetsForSection = computed(() => {\n const section = this.blockPickerSection();\n if (!section) return [];\n\n const query = this.blockPickerSearch().toLowerCase().trim();\n const presets = this.registry.getBlockPresetsForSectionType(section.type);\n\n if (!query) return presets;\n\n return presets.filter((rp) => {\n const name = rp.displayName.toLowerCase();\n const type = rp.definition.type.toLowerCase();\n const desc = (rp.displayDescription ?? '').toLowerCase();\n const tags = (rp.definition.tags ?? []).join(' ').toLowerCase();\n\n return name.includes(query) || type.includes(query) || desc.includes(query) || tags.includes(query);\n });\n });\n\n readonly filteredBlockPresetsForNestedSlot = computed(() => {\n const target = this.nestedBlockPickerTarget();\n if (!target) return [];\n\n const query = this.nestedBlockPickerSearch().toLowerCase().trim();\n const firstSlot = target.slots[0];\n\n // Get allowed block definitions, then resolve presets\n const blockDefs = firstSlot\n ? this.facade.getAllowedBlocksForNestedSlot(target.parentType, firstSlot.name)\n : this.facade.availableBlocks();\n\n const presets = blockDefs.flatMap((def) => this.registry.resolvePresets(def));\n\n if (!query) return presets;\n\n return presets.filter((rp) => {\n const name = rp.displayName.toLowerCase();\n const type = rp.definition.type.toLowerCase();\n const desc = (rp.displayDescription ?? '').toLowerCase();\n const tags = (rp.definition.tags ?? []).join(' ').toLowerCase();\n\n return name.includes(query) || type.includes(query) || desc.includes(query) || tags.includes(query);\n });\n });\n\n private readonly sectionIconMap: Record<string, string> = {\n 'hero-section': '🎯',\n 'features-grid': '⚡',\n 'testimonials': '💬',\n 'cta-section': '📢',\n 'footer-section': '📋',\n };\n\n private readonly blockIconMap: Record<string, string> = {\n 'text-block': '📝',\n 'button-block': '🔘',\n 'image-block': '🖼️',\n 'icon-block': '⭐',\n 'feature-item': '⭐',\n 'card-block': '🃏',\n };\n\n readonly selectedBlockDefinition = computed(() => this.facade.selectedBlockDefinition());\n\n // Inline name editing\n private readonly nameInput = viewChild<ElementRef<HTMLInputElement>>('nameInput');\n readonly isEditingName = signal(false);\n readonly editingNameValue = signal('');\n\n getSelectedDisplayName(def: ComponentDefinition): string {\n const block = this.facade.selectedBlock();\n if (block) {\n return block.adminLabel || this.facade.selectedBlockDefinition()?.name || block.type;\n }\n const section = this.facade.selectedSection();\n return section?.adminLabel || def.name;\n }\n\n getSelectedDefaultName(def: ComponentDefinition): string {\n const block = this.facade.selectedBlock();\n if (block) {\n return this.facade.selectedBlockDefinition()?.name || block.type;\n }\n return def.name;\n }\n\n startEditingName(): void {\n const block = this.facade.selectedBlock();\n if (block) {\n this.editingNameValue.set(block.adminLabel ?? '');\n } else {\n const section = this.facade.selectedSection();\n this.editingNameValue.set(section?.adminLabel ?? '');\n }\n this.isEditingName.set(true);\n requestAnimationFrame(() => {\n const input = this.nameInput()?.nativeElement;\n if (input) {\n input.focus();\n input.select();\n }\n });\n }\n\n saveEditingName(event: Event): void {\n if (!this.isEditingName()) return;\n const input = event.target as HTMLInputElement;\n const value = input.value.trim();\n const section = this.facade.selectedSection();\n if (!section) return;\n\n const block = this.facade.selectedBlock();\n if (block) {\n this.facade.renameBlock(section.id, block.id, value);\n } else {\n this.facade.renameSection(section.id, value);\n }\n this.isEditingName.set(false);\n }\n\n cancelEditingName(): void {\n this.isEditingName.set(false);\n }\n\n constructor() {\n // Sync sections to iframe whenever they change\n effect(() => {\n const sections = this.facade.sections();\n if (this.iframeReady && this.previewUrl()) {\n this.iframeBridge.sendPageUpdate(sections);\n }\n });\n\n // Sync selection to iframe\n effect(() => {\n const selected = this.facade.selectedElement()?.id ?? null;\n if (!this.iframeReady || !this.previewUrl()) return;\n if (selected) {\n this.iframeBridge.sendSelectElement(selected);\n } else {\n this.iframeBridge.sendDeselect();\n }\n });\n }\n\n ngOnInit(): void {\n // Load page using the configured loading strategy\n this.loadingStrategy\n .getPageIdToLoad()\n .pipe(\n takeUntil(this.destroy$),\n filter((pageId): pageId is string => pageId !== null),\n switchMap((pageId) => {\n this.isLoading.set(true);\n return this.loadingStrategy.loadPage(pageId);\n })\n )\n .subscribe({\n next: (page) => {\n this.facade.loadPage(page);\n this.isLoading.set(false);\n },\n error: (err) => {\n console.error('Failed to load page:', err);\n this.isLoading.set(false);\n this.navigation.navigate({ type: 'page-list' });\n },\n });\n\n // Listen for iframe events\n if (this.previewUrl()) {\n this.iframeBridge\n .onReady()\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => {\n this.iframeReady = true;\n // Send initial page state\n this.iframeBridge.sendPageUpdate(this.facade.sections());\n });\n\n this.iframeBridge\n .onElementClicked()\n .pipe(takeUntil(this.destroy$))\n .subscribe(({ elementId, sectionId }) => {\n this.facade.selectElement(sectionId, elementId);\n });\n }\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n this.iframeBridge.disconnect();\n // Clear page from store when leaving editor\n this.facade.clearPage();\n }\n\n onIframeLoad(): void {\n const iframe = this.previewFrame()?.nativeElement;\n if (iframe) {\n const sfUrl = this.storefrontUrlService.url();\n const origin = sfUrl ? new URL(sfUrl).origin : '*';\n this.iframeBridge.connect(iframe, origin);\n }\n }\n\n goBack(): void {\n if (this.facade.isDirty()) {\n this.navigation\n .confirm({\n title: 'Unsaved Changes',\n message: 'You have unsaved changes. Are you sure you want to leave?',\n confirmText: 'Leave',\n cancelText: 'Stay',\n })\n .subscribe((confirmed) => {\n if (confirmed) {\n this.navigation.navigate({ type: 'page-list' });\n }\n });\n } else {\n this.navigation.navigate({ type: 'page-list' });\n }\n }\n\n savePage(): void {\n const pageId = this.facade.currentPageId();\n if (!pageId) return;\n\n this.isSaving.set(true);\n this.facade.savePage(pageId).subscribe({\n next: () => {\n this.isSaving.set(false);\n },\n error: (err) => {\n console.error('Failed to save page:', err);\n this.isSaving.set(false);\n },\n });\n }\n\n publishPage(): void {\n const pageId = this.facade.currentPageId();\n if (!pageId) return;\n\n this.isPublishing.set(true);\n this.facade.publishPage(pageId).subscribe({\n next: () => {\n this.isPublishing.set(false);\n },\n error: (err) => {\n console.error('Failed to publish page:', err);\n this.isPublishing.set(false);\n },\n });\n }\n\n unpublishPage(): void {\n const pageId = this.facade.currentPageId();\n if (!pageId) return;\n\n this.isPublishing.set(true);\n this.facade.unpublishPage(pageId).subscribe({\n next: () => {\n this.isPublishing.set(false);\n },\n error: (err) => {\n console.error('Failed to unpublish page:', err);\n this.isPublishing.set(false);\n },\n });\n }\n\n getIcon(def: ComponentDefinition): string {\n return this.sectionIconMap[def.type] ?? '📦';\n }\n\n getBlockIcon(def: ComponentDefinition): string {\n return this.blockIconMap[def.type] ?? '🧩';\n }\n\n getBlockIconByType(type: string): string {\n return this.blockIconMap[type] ?? '🧩';\n }\n\n getSectionIcon(type: string): string {\n return this.sectionIconMap[type] ?? '📦';\n }\n\n // Tree expansion\n isSectionExpanded(sectionId: string): boolean {\n return this.expandedSections().has(sectionId);\n }\n\n isAllBlocksExpanded(sectionId: string): boolean {\n return this.allBlocksExpanded().has(sectionId);\n }\n\n toggleSectionExpand(sectionId: string, event: Event): void {\n event.stopPropagation();\n const wasExpanded = this.expandedSections().has(sectionId);\n this.expandedSections.update((set) => {\n const newSet = new Set(set);\n if (wasExpanded) {\n newSet.delete(sectionId);\n } else {\n newSet.add(sectionId);\n }\n return newSet;\n });\n if (wasExpanded) {\n this.allBlocksExpanded.update((set) => {\n const newSet = new Set(set);\n newSet.delete(sectionId);\n return newSet;\n });\n }\n }\n\n toggleGroup(entityId: string, group: string): void {\n const key = `${entityId}:${group}`;\n this.expandedGroups.update((set) => {\n const newSet = new Set(set);\n if (newSet.has(key)) {\n newSet.delete(key);\n } else {\n newSet.add(key);\n }\n return newSet;\n });\n }\n\n isGroupCollapsed(entityId: string, group: string): boolean {\n return !this.expandedGroups().has(`${entityId}:${group}`);\n }\n\n getSectionBlocks(section: EditorSection): EditorElement[] {\n return section.elements ?? [];\n }\n\n private readonly rootBlockContextCache = new Map<string, BlockTreeContext>();\n private readonly emptyPath: string[] = [];\n\n getRootBlockContext(sectionId: string): BlockTreeContext {\n let ctx = this.rootBlockContextCache.get(sectionId);\n if (!ctx) {\n ctx = { sectionId, parentPath: this.emptyPath, depth: 0 };\n this.rootBlockContextCache.set(sectionId, ctx);\n }\n return ctx;\n }\n\n // Search handlers\n onSearchInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.searchQuery.set(input.value);\n\n // Auto-expand sections that match when searching\n if (input.value.trim()) {\n const matchingSectionIds = this.filteredSections().map((s) => s.id);\n this.expandedSections.update((set) => {\n const newSet = new Set(set);\n matchingSectionIds.forEach((id) => newSet.add(id));\n return newSet;\n });\n }\n }\n\n clearSearch(): void {\n this.searchQuery.set('');\n }\n\n // ========== Section Drag & Drop ==========\n\n isSectionDragSource(sectionId: string): boolean {\n const dragItem = this.dndService.dragItem();\n return dragItem !== null && dragItem.kind === 'section' && dragItem.elementId === sectionId;\n }\n\n onSectionDragStart(section: EditorSection, index: number, event: DragEvent): void {\n event.stopPropagation();\n const item: DragItem = {\n kind: 'section',\n elementId: section.id,\n elementType: section.type,\n sectionId: section.id,\n parentPath: [],\n sourceIndex: index,\n };\n this.dndService.startDrag(item, event);\n this.dndAnnouncement.set(`Grabbed ${this.getSectionName(section)}, position ${index + 1} of ${this.facade.sections().length}`);\n }\n\n onSectionDragEnd(event: DragEvent): void {\n event.stopPropagation();\n this.dndService.endDrag();\n this.sectionDropZone.set(null);\n this.clearAutoExpandTimer();\n this.dndAnnouncement.set('');\n }\n\n onSectionDragOver(section: EditorSection, index: number, event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n\n const dragItem = this.dndService.dragItem();\n if (!dragItem) return;\n\n if (dragItem.kind === 'section') {\n // Section reordering\n const el = event.currentTarget as HTMLElement;\n const rect = el.getBoundingClientRect();\n const y = event.clientY - rect.top;\n const zone: DropZone = y / rect.height < 0.5 ? 'before' : 'after';\n\n const targetIndex = zone === 'before' ? index : index + 1;\n const target = {\n kind: 'section' as const,\n sectionId: section.id,\n parentPath: [] as string[],\n slotName: 'default',\n index: targetIndex,\n depth: 0,\n zone,\n };\n\n if (this.dndService.validateDrop(dragItem, target)) {\n event.dataTransfer!.dropEffect = 'move';\n this.sectionDropZone.set(`${section.id}:${zone}`);\n this.dndService.updateDropTarget(target);\n } else {\n event.dataTransfer!.dropEffect = 'none';\n this.sectionDropZone.set(null);\n }\n } else if (dragItem.kind === 'block') {\n // Block dragged over collapsed section - auto-expand\n if (!this.isSectionExpanded(section.id)) {\n this.startAutoExpandTimer(section.id);\n }\n }\n }\n\n onSectionDragLeave(event: DragEvent): void {\n const el = event.currentTarget as HTMLElement;\n const relatedTarget = event.relatedTarget as Node | null;\n if (relatedTarget && el.contains(relatedTarget)) return;\n\n this.sectionDropZone.set(null);\n this.clearAutoExpandTimer();\n }\n\n onSectionDrop(event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n this.sectionDropZone.set(null);\n this.clearAutoExpandTimer();\n\n const dragItem = this.dndService.dragItem();\n if (dragItem?.kind === 'section') {\n this.dndService.executeDrop();\n this.dndAnnouncement.set('Section dropped');\n }\n }\n\n onSectionDragHandleKeydown(sectionId: string, index: number, event: KeyboardEvent): void {\n if (event.key === 'ArrowUp' && index > 0) {\n event.preventDefault();\n this.facade.moveSection(sectionId, index - 1);\n } else if (event.key === 'ArrowDown' && index < this.facade.sections().length - 1) {\n event.preventDefault();\n this.facade.moveSection(sectionId, index + 1);\n }\n }\n\n onSectionContentDragOver(section: EditorSection, event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n\n const dragItem = this.dndService.dragItem();\n if (!dragItem || dragItem.kind !== 'block') return;\n\n // Allow dropping blocks into section content area (appends to end)\n const sectionDef = this.facade.getDefinition(section.type);\n const slotName = sectionDef?.slots?.[0]?.name ?? 'default';\n const blocks = this.getSectionBlocks(section);\n\n const target = {\n kind: 'block' as const,\n sectionId: section.id,\n parentPath: [] as string[],\n slotName,\n index: blocks.length,\n depth: 0,\n zone: 'after' as DropZone,\n };\n\n if (this.dndService.validateDrop(dragItem, target)) {\n event.dataTransfer!.dropEffect = 'move';\n this.dndService.updateDropTarget(target);\n } else {\n event.dataTransfer!.dropEffect = 'none';\n }\n }\n\n onSectionContentDragLeave(event: DragEvent): void {\n const el = event.currentTarget as HTMLElement;\n const relatedTarget = event.relatedTarget as Node | null;\n if (relatedTarget && el.contains(relatedTarget)) return;\n }\n\n onSectionContentDrop(event: DragEvent): void {\n event.preventDefault();\n event.stopPropagation();\n\n const dragItem = this.dndService.dragItem();\n if (dragItem?.kind === 'block') {\n this.dndService.executeDrop();\n this.dndAnnouncement.set('Block moved');\n }\n }\n\n private startAutoExpandTimer(sectionId: string): void {\n this.clearAutoExpandTimer();\n this.sectionAutoExpandTimer = setTimeout(() => {\n this.expandedSections.update((set) => {\n const newSet = new Set(set);\n newSet.add(sectionId);\n return newSet;\n });\n }, 500);\n }\n\n private clearAutoExpandTimer(): void {\n if (this.sectionAutoExpandTimer !== null) {\n clearTimeout(this.sectionAutoExpandTimer);\n this.sectionAutoExpandTimer = null;\n }\n }\n\n // ========== Scroll to Element ==========\n\n private scrollToCanvasElement(elementId: string, fallbackSectionId?: string): void {\n const canvas = this.canvasEl()?.nativeElement;\n if (!canvas) return;\n\n requestAnimationFrame(() => {\n const el = canvas.querySelector<HTMLElement>(`[data-element-id=\"${elementId}\"]`);\n // Block component hosts use `display: contents` so they have no bounding box.\n // Resolve the first child that generates a CSS box for scrollIntoView to work.\n const target = this.resolveScrollTarget(el)\n ?? this.resolveScrollTarget(\n fallbackSectionId ? canvas.querySelector<HTMLElement>(`[data-section-id=\"${fallbackSectionId}\"]`) : null\n );\n target?.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n });\n }\n\n /** Return the element itself if it has a box, otherwise its first laid-out child. */\n private resolveScrollTarget(el: HTMLElement | null): HTMLElement | null {\n if (!el) return null;\n // Elements with `display: contents` report a zero-area bounding rect.\n const rect = el.getBoundingClientRect();\n if (rect.width > 0 && rect.height > 0) return el;\n // Walk into children to find one that paints.\n return (el.firstElementChild as HTMLElement) ?? el;\n }\n\n private scrollToCanvasSection(sectionId: string): void {\n const canvas = this.canvasEl()?.nativeElement;\n if (!canvas) return;\n\n requestAnimationFrame(() => {\n const target = canvas.querySelector<HTMLElement>(`[data-section-id=\"${sectionId}\"]`);\n target?.scrollIntoView({ behavior: 'smooth', block: 'nearest' });\n });\n }\n\n onSectionPickerSearch(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.sectionPickerSearch.set(input.value);\n }\n\n onBlockPickerSearch(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.blockPickerSearch.set(input.value);\n }\n\n // Section picker\n toggleSectionPicker(): void {\n this.showSectionPicker.update((v) => !v);\n // Clear search when toggling\n if (!this.showSectionPicker()) {\n this.sectionPickerSearch.set('');\n }\n }\n\n // Block picker\n openBlockPicker(section: EditorSection, event: Event): void {\n event.stopPropagation();\n this.blockPickerSection.set(section);\n this.blockPickerSearch.set(''); // Clear search when opening\n }\n\n closeBlockPicker(): void {\n this.blockPickerSection.set(null);\n this.blockPickerSearch.set('');\n }\n\n // Nested block picker (for blocks with slots)\n onOpenNestedBlockPicker(target: BlockPickerTarget): void {\n this.nestedBlockPickerTarget.set(target);\n this.nestedBlockPickerSearch.set('');\n }\n\n closeNestedBlockPicker(): void {\n this.nestedBlockPickerTarget.set(null);\n this.nestedBlockPickerSearch.set('');\n }\n\n onNestedBlockPickerSearch(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.nestedBlockPickerSearch.set(input.value);\n }\n\n addNestedBlock(blockType: string): void {\n const target = this.nestedBlockPickerTarget();\n if (!target) return;\n\n const slotName = target.slots[0]?.name ?? 'default';\n this.facade.addNestedBlock(target.sectionId, target.parentPath, slotName, blockType);\n this.closeNestedBlockPicker();\n }\n\n // Block tree item handlers\n onBlockSelect(event: { block: EditorElement; context: BlockTreeContext }): void {\n this.isEditingName.set(false);\n this.facade.selectElement(event.context.sectionId, event.block.id);\n this.propertiesTab.set('props');\n this.scrollToCanvasElement(event.block.id, event.context.sectionId);\n }\n\n onBlockDelete(event: { block: EditorElement; context: BlockTreeContext }): void {\n if (event.context.parentPath.length === 0) {\n // Direct child of section\n this.facade.removeBlock(event.context.sectionId, event.block.id);\n } else {\n // Nested block\n this.facade.removeNestedBlock(event.context.sectionId, event.context.parentPath, event.block.id);\n }\n }\n\n onBlockMove(event: { block: EditorElement; context: BlockTreeContext; newIndex: number }): void {\n const slotName = event.block.slotName ?? 'default';\n if (event.context.parentPath.length === 0) {\n // Direct child of section\n this.facade.moveBlock(event.context.sectionId, event.block.id, slotName, event.newIndex);\n } else {\n // Nested block\n this.facade.moveNestedBlock(\n event.context.sectionId,\n event.context.parentPath,\n event.block.id,\n slotName,\n event.newIndex\n );\n }\n }\n\n onBlockDuplicate(event: { block: EditorElement; context: BlockTreeContext }): void {\n if (event.context.parentPath.length === 0) {\n this.facade.duplicateBlock(event.context.sectionId, event.block.id);\n } else {\n this.facade.duplicateNestedBlock(event.context.sectionId, event.context.parentPath, event.block.id);\n }\n }\n\n duplicateSection(sectionId: string, event: Event): void {\n event.stopPropagation();\n this.facade.duplicateSection(sectionId);\n }\n\n duplicateBlock(block: EditorElement, event: Event): void {\n event.stopPropagation();\n const section = this.facade.selectedSection();\n if (!section) return;\n this.facade.duplicateBlock(section.id, block.id);\n }\n\n addBlockToSection(section: EditorSection, blockType: string): void {\n const sectionDef = this.facade.getDefinition(section.type);\n const slotName = sectionDef?.slots?.[0]?.name ?? 'default';\n this.facade.addBlock(section.id, slotName, blockType);\n this.closeBlockPicker();\n // Ensure section is expanded to show new block\n this.expandedSections.update((set) => {\n const newSet = new Set(set);\n newSet.add(section.id);\n return newSet;\n });\n }\n\n getSectionName(section: EditorSection): string {\n return section.adminLabel || this.facade.getDefinition(section.type)?.name || section.type;\n }\n\n getBlockName(block: EditorElement): string {\n if (block.adminLabel) return block.adminLabel;\n const def = this.facade.getDefinition(block.type);\n const preview = String(block.props['content'] ?? block.props['label'] ?? block.props['text'] ?? '');\n if (preview && preview.length > 20) {\n return preview.substring(0, 20) + '...';\n }\n return preview || def?.name || block.type;\n }\n\n addSection(type: string): void {\n this.facade.addSection(type);\n this.showSectionPicker.set(false);\n }\n\n addSectionFromPreset(rp: ResolvedPreset): void {\n this.facade.addSectionFromPreset(rp);\n this.showSectionPicker.set(false);\n this.sectionPickerSearch.set('');\n }\n\n addBlockToSectionFromPreset(section: EditorSection, rp: ResolvedPreset): void {\n const sectionDef = this.facade.getDefinition(section.type);\n const slotName = sectionDef?.slots?.[0]?.name ?? 'default';\n this.facade.addBlockFromPreset(section.id, slotName, rp);\n this.closeBlockPicker();\n this.expandedSections.update((set) => {\n const newSet = new Set(set);\n newSet.add(section.id);\n return newSet;\n });\n }\n\n addNestedBlockFromPreset(rp: ResolvedPreset): void {\n const target = this.nestedBlockPickerTarget();\n if (!target) return;\n\n const slotName = target.slots[0]?.name ?? 'default';\n\n // For nested blocks without preset settings, use existing method\n if (!rp.preset?.settings) {\n this.facade.addNestedBlock(target.sectionId, target.parentPath, slotName, rp.definition.type);\n } else {\n // Create the block element with preset props, then dispatch via addNestedBlock\n this.facade.addNestedBlock(target.sectionId, target.parentPath, slotName, rp.definition.type);\n\n // Apply preset settings to the newly added block\n const section = this.facade.sections().find((s) => s.id === target.sectionId);\n if (section) {\n // Find the last element in the slot — it's the one just added\n const children = section.elements.filter((e) => e.slotName === slotName);\n const lastChild = children[children.length - 1];\n if (lastChild) {\n this.facade.updateBlockProps(target.sectionId, lastChild.id, rp.preset.settings);\n }\n }\n }\n\n this.closeNestedBlockPicker();\n }\n\n getSectionPresetIcon(rp: ResolvedPreset): string {\n return rp.displayIcon ?? this.sectionIconMap[rp.definition.type] ?? '📦';\n }\n\n getBlockPresetIcon(rp: ResolvedPreset): string {\n return rp.displayIcon ?? this.blockIconMap[rp.definition.type] ?? '🧩';\n }\n\n selectSection(section: EditorSection, event: Event): void {\n event.stopPropagation();\n this.isEditingName.set(false);\n\n const isAlreadySelected = this.facade.selectedSection()?.id === section.id && !this.facade.selectedBlock();\n\n if (isAlreadySelected) {\n const wasExpanded = this.expandedSections().has(section.id);\n this.expandedSections.update((set) => {\n const newSet = new Set(set);\n if (wasExpanded) {\n newSet.delete(section.id);\n } else {\n newSet.add(section.id);\n }\n return newSet;\n });\n this.allBlocksExpanded.update((set) => {\n const newSet = new Set(set);\n if (wasExpanded) {\n newSet.delete(section.id);\n } else {\n newSet.add(section.id);\n }\n return newSet;\n });\n } else {\n this.facade.selectElement(section.id, null);\n this.expandedSections.update((set) => {\n const newSet = new Set(set);\n newSet.add(section.id);\n return newSet;\n });\n this.allBlocksExpanded.update((set) => {\n const newSet = new Set(set);\n newSet.add(section.id);\n return newSet;\n });\n this.scrollToCanvasSection(section.id);\n }\n }\n\n selectBlock(block: EditorElement): void {\n const section = this.facade.selectedSection();\n if (!section) return;\n this.isEditingName.set(false);\n this.facade.selectElement(section.id, block.id);\n this.propertiesTab.set('props');\n }\n\n deleteSection(sectionId: string, event: Event): void {\n event.stopPropagation();\n this.facade.removeSection(sectionId);\n }\n\n deleteBlock(block: EditorElement, event: Event): void {\n event.stopPropagation();\n const section = this.facade.selectedSection();\n if (!section) return;\n this.facade.removeBlock(section.id, block.id);\n }\n\n deleteSelectedBlock(): void {\n const section = this.facade.selectedSection();\n const block = this.facade.selectedBlock();\n if (!section || !block) return;\n this.facade.removeBlock(section.id, block.id);\n }\n\n moveUp(sectionId: string, currentIndex: number, event: Event): void {\n event.stopPropagation();\n this.facade.moveSection(sectionId, currentIndex - 1);\n }\n\n moveDown(sectionId: string, currentIndex: number, event: Event): void {\n event.stopPropagation();\n this.facade.moveSection(sectionId, currentIndex + 1);\n }\n\n moveBlockUp(block: EditorElement, slotName: string, currentIndex: number, event: Event): void {\n event.stopPropagation();\n const section = this.facade.selectedSection();\n if (!section) return;\n this.facade.moveBlock(section.id, block.id, slotName, currentIndex - 1);\n }\n\n moveBlockDown(block: EditorElement, slotName: string, currentIndex: number, event: Event): void {\n event.stopPropagation();\n const section = this.facade.selectedSection();\n if (!section) return;\n this.facade.moveBlock(section.id, block.id, slotName, currentIndex + 1);\n }\n\n togglePreview(): void {\n this.isPreviewMode.update((v) => !v);\n if (this.isPreviewMode()) {\n this.facade.clearSelection();\n }\n }\n\n // Section slots and blocks\n getSectionSlots() {\n const section = this.facade.selectedSection();\n if (!section) return [];\n const def = this.facade.getDefinition(section.type);\n return def?.slots ?? [];\n }\n\n getBlocksForSlot(slotName: string): EditorElement[] {\n const section = this.facade.selectedSection();\n if (!section) return [];\n return this.facade.getBlocksForSlot(section.id, slotName);\n }\n\n getBlockCount(): number {\n const section = this.facade.selectedSection();\n if (!section) return 0;\n return section.elements.length;\n }\n\n // Section property methods\n getPropertyGroups(def: ComponentDefinition): string[] {\n const groups = new Set<string>();\n Object.values(def.props).forEach((prop) => {\n groups.add(prop.group ?? 'General');\n });\n return Array.from(groups);\n }\n\n getPropsForGroup(\n def: ComponentDefinition,\n group: string\n ): Array<{ key: string; schema: (typeof def.props)[string] }> {\n return Object.entries(def.props)\n .filter(([, schema]) => (schema.group ?? 'General') === group)\n .sort((a, b) => (a[1].order ?? 999) - (b[1].order ?? 999))\n .map(([key, schema]) => ({ key, schema }));\n }\n\n getPropertyValue(key: string): string {\n const section = this.facade.selectedSection();\n if (!section) return '';\n const value = section.props[key];\n if (value === undefined || value === null) {\n const def = this.facade.selectedSectionDefinition();\n return String(def?.props[key]?.defaultValue ?? '');\n }\n return String(value);\n }\n\n updateProperty(key: string, event: Event): void {\n const section = this.facade.selectedSection();\n if (!section) return;\n\n const target = event.target as HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;\n this.facade.updateSectionProps(section.id, { [key]: target.value });\n }\n\n // Block property methods\n getBlockPropertyGroups(): string[] {\n const def = this.selectedBlockDefinition();\n if (!def) return [];\n const groups = new Set<string>();\n Object.values(def.props).forEach((prop) => {\n groups.add(prop.group ?? 'General');\n });\n return Array.from(groups);\n }\n\n getBlockPropsForGroup(group: string): Array<{ key: string; schema: ComponentDefinition['props'][string] }> {\n const def = this.selectedBlockDefinition();\n if (!def) return [];\n return Object.entries(def.props)\n .filter(([, schema]) => (schema.group ?? 'General') === group)\n .sort((a, b) => (a[1].order ?? 999) - (b[1].order ?? 999))\n .map(([key, schema]) => ({ key, schema }));\n }\n\n getBlockPropertyValue(key: string): string {\n const block = this.facade.selectedBlock();\n if (!block) return '';\n const value = block.props[key];\n if (value === undefined || value === null) {\n const def = this.selectedBlockDefinition();\n return String(def?.props[key]?.defaultValue ?? '');\n }\n return String(value);\n }\n\n updateBlockProperty(key: string, event: Event): void {\n const section = this.facade.selectedSection();\n const block = this.facade.selectedBlock();\n if (!section || !block) return;\n\n const target = event.target as HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;\n let value: unknown = target.value;\n\n const def = this.selectedBlockDefinition();\n if (def?.props[key]?.type === 'number') {\n value = parseFloat(target.value) || 0;\n }\n\n this.facade.updateBlockProps(section.id, block.id, { [key]: value });\n }\n\n updateBlockBooleanProperty(key: string, event: Event): void {\n const section = this.facade.selectedSection();\n const block = this.facade.selectedBlock();\n if (!section || !block) return;\n\n const target = event.target as HTMLInputElement;\n this.facade.updateBlockProps(section.id, block.id, { [key]: target.checked });\n }\n\n // File picker methods\n openFilePicker(mediaType: 'IMAGE' | 'VIDEO', key: string, context: 'block' | 'section'): void {\n this.filePickerMediaType.set(mediaType);\n this.filePickerTargetKey.set(key);\n this.filePickerContext.set(context);\n this.filePickerOpen.set(true);\n }\n\n closeFilePicker(): void {\n this.filePickerOpen.set(false);\n }\n\n onFileSelected(url: string): void {\n const key = this.filePickerTargetKey();\n if (!key) return;\n\n if (this.filePickerContext() === 'block') {\n const section = this.facade.selectedSection();\n const block = this.facade.selectedBlock();\n if (section && block) {\n this.facade.updateBlockProps(section.id, block.id, { [key]: url });\n }\n } else {\n const section = this.facade.selectedSection();\n if (section) {\n this.facade.updateSectionProps(section.id, { [key]: url });\n }\n }\n\n this.closeFilePicker();\n }\n\n clearBlockProperty(key: string): void {\n const section = this.facade.selectedSection();\n const block = this.facade.selectedBlock();\n if (!section || !block) return;\n this.facade.updateBlockProps(section.id, block.id, { [key]: '' });\n }\n\n clearSectionProperty(key: string): void {\n const section = this.facade.selectedSection();\n if (!section) return;\n this.facade.updateSectionProps(section.id, { [key]: '' });\n }\n}\n","import {\n Component,\n ChangeDetectionStrategy,\n inject,\n signal,\n OnInit,\n} from '@angular/core';\nimport { VisualEditorFacade } from '../../services/visual-editor-facade.service';\nimport { PageSummary } from '../../models/page.model';\nimport { VisualEditorNavigation } from '../../navigation/visual-editor-navigation.types';\n\n/**\n * Page manager component for listing, creating, and managing pages\n */\n@Component({\n selector: 'lib-page-manager',\n template: `\n <div class=\"page-manager\">\n <header class=\"manager-header\">\n <h1>Pages</h1>\n <div class=\"header-actions\">\n <button class=\"btn-secondary\" (click)=\"openSetup()\">\n Setup\n </button>\n <button class=\"btn-primary\" (click)=\"openCreateDialog()\">\n + New Page\n </button>\n </div>\n </header>\n\n @if (isLoading()) {\n <div class=\"loading-state\">\n <p>Loading pages...</p>\n </div>\n } @else if (error()) {\n <div class=\"error-state\">\n <p>{{ error() }}</p>\n <button class=\"btn-secondary\" (click)=\"loadPages()\">Retry</button>\n </div>\n } @else if (pages().length === 0) {\n <div class=\"empty-state\">\n <div class=\"empty-icon\">📄</div>\n <h2>No pages yet</h2>\n <p>Create your first page to get started</p>\n <button class=\"btn-primary\" (click)=\"openCreateDialog()\">\n Create Page\n </button>\n </div>\n } @else {\n <div class=\"pages-table\">\n <div class=\"table-header\">\n <span class=\"col-title\">Title</span>\n <span class=\"col-slug\">Slug</span>\n <span class=\"col-status\">Status</span>\n <span class=\"col-updated\">Updated</span>\n <span class=\"col-actions\">Actions</span>\n </div>\n @for (page of pages(); track page.id) {\n <div class=\"table-row\" (click)=\"editPage(page.id)\">\n <span class=\"col-title\">{{ page.title }}</span>\n <span class=\"col-slug\">/pages/{{ page.slug }}</span>\n <span class=\"col-status\">\n <span class=\"status-badge\" [class.published]=\"page.status === 'published'\">\n {{ page.status }}\n </span>\n </span>\n <span class=\"col-updated\">{{ formatDate(page.updatedAt) }}</span>\n <span class=\"col-actions\">\n <button\n class=\"action-btn\"\n (click)=\"editPage(page.id); $event.stopPropagation()\"\n title=\"Edit\"\n >\n ✏️\n </button>\n <button\n class=\"action-btn\"\n (click)=\"duplicatePage(page.id, $event)\"\n title=\"Duplicate\"\n >\n 📋\n </button>\n <button\n class=\"action-btn delete\"\n (click)=\"confirmDelete(page, $event)\"\n title=\"Delete\"\n >\n 🗑️\n </button>\n </span>\n </div>\n }\n </div>\n }\n\n <!-- Create Page Dialog -->\n @if (showCreateDialog()) {\n <div class=\"dialog-overlay\" (click)=\"closeCreateDialog()\">\n <div class=\"dialog\" (click)=\"$event.stopPropagation()\">\n <div class=\"dialog-header\">\n <h2>Create New Page</h2>\n <button class=\"close-btn\" (click)=\"closeCreateDialog()\">×</button>\n </div>\n <form class=\"dialog-content\" (submit)=\"createPage($event)\">\n <div class=\"form-field\">\n <label for=\"pageTitle\">Title</label>\n <input\n id=\"pageTitle\"\n type=\"text\"\n [value]=\"newPageTitle()\"\n (input)=\"onTitleInput($event)\"\n placeholder=\"My New Page\"\n required\n />\n </div>\n <div class=\"form-field\">\n <label for=\"pageSlug\">Slug</label>\n <div class=\"slug-field\">\n <span class=\"slug-prefix\">/pages/</span>\n <input\n id=\"pageSlug\"\n type=\"text\"\n [value]=\"newPageSlug()\"\n (input)=\"onSlugInput($event)\"\n placeholder=\"my-new-page\"\n required\n pattern=\"[-a-z0-9]+\"\n />\n </div>\n </div>\n @if (createError()) {\n <div class=\"form-error\">{{ createError() }}</div>\n }\n <div class=\"dialog-actions\">\n <button type=\"button\" class=\"btn-secondary\" (click)=\"closeCreateDialog()\">\n Cancel\n </button>\n <button type=\"submit\" class=\"btn-primary\" [disabled]=\"isCreating()\">\n {{ isCreating() ? 'Creating...' : 'Create Page' }}\n </button>\n </div>\n </form>\n </div>\n </div>\n }\n\n <!-- Delete Confirmation Dialog -->\n @if (pageToDelete()) {\n <div class=\"dialog-overlay\" (click)=\"cancelDelete()\">\n <div class=\"dialog dialog-small\" (click)=\"$event.stopPropagation()\">\n <div class=\"dialog-header\">\n <h2>Delete Page</h2>\n <button class=\"close-btn\" (click)=\"cancelDelete()\">×</button>\n </div>\n <div class=\"dialog-content\">\n <p>Are you sure you want to delete \"{{ pageToDelete()!.title }}\"?</p>\n <p class=\"warning\">This action cannot be undone.</p>\n </div>\n <div class=\"dialog-actions\">\n <button class=\"btn-secondary\" (click)=\"cancelDelete()\">Cancel</button>\n <button class=\"btn-danger\" (click)=\"deletePage()\" [disabled]=\"isDeleting()\">\n {{ isDeleting() ? 'Deleting...' : 'Delete' }}\n </button>\n </div>\n </div>\n </div>\n }\n </div>\n `,\n styles: `\n :host {\n display: block;\n min-height: 100vh;\n background: #f0f2f5;\n }\n\n .page-manager {\n max-width: 1200px;\n margin: 0 auto;\n padding: 2rem;\n }\n\n .manager-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 2rem;\n }\n\n .header-actions {\n display: flex;\n gap: 0.75rem;\n align-items: center;\n }\n\n .manager-header h1 {\n margin: 0;\n font-size: 1.75rem;\n font-weight: 600;\n color: #1a1a2e;\n }\n\n .btn-primary {\n padding: 0.75rem 1.5rem;\n border: none;\n border-radius: 6px;\n background: #1a1a2e;\n color: #fff;\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s;\n }\n\n .btn-primary:hover {\n background: #2a2a3e;\n }\n\n .btn-primary:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n }\n\n .btn-secondary {\n padding: 0.75rem 1.5rem;\n border: 1px solid #e0e0e0;\n border-radius: 6px;\n background: #fff;\n color: #333;\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n }\n\n .btn-secondary:hover {\n background: #f5f5f5;\n }\n\n .btn-danger {\n padding: 0.75rem 1.5rem;\n border: none;\n border-radius: 6px;\n background: #e74c3c;\n color: #fff;\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s;\n }\n\n .btn-danger:hover {\n background: #c0392b;\n }\n\n .btn-danger:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n }\n\n /* States */\n .loading-state,\n .error-state,\n .empty-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 4rem 2rem;\n background: #fff;\n border-radius: 8px;\n text-align: center;\n }\n\n .empty-icon {\n font-size: 4rem;\n margin-bottom: 1rem;\n }\n\n .empty-state h2 {\n margin: 0 0 0.5rem;\n color: #333;\n }\n\n .empty-state p {\n margin: 0 0 1.5rem;\n color: #666;\n }\n\n .error-state {\n color: #e74c3c;\n }\n\n /* Table */\n .pages-table {\n background: #fff;\n border-radius: 8px;\n overflow: hidden;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\n }\n\n .table-header,\n .table-row {\n display: grid;\n grid-template-columns: 1fr 150px 100px 150px 120px;\n gap: 1rem;\n padding: 1rem 1.5rem;\n align-items: center;\n }\n\n .table-header {\n background: #f8f9fa;\n font-size: 0.75rem;\n font-weight: 600;\n text-transform: uppercase;\n color: #666;\n letter-spacing: 0.5px;\n }\n\n .table-row {\n border-top: 1px solid #e0e0e0;\n cursor: pointer;\n transition: background 0.2s;\n }\n\n .table-row:hover {\n background: #f8f9fa;\n }\n\n .col-title {\n font-weight: 500;\n color: #333;\n }\n\n .col-slug {\n font-size: 0.8125rem;\n color: #666;\n font-family: monospace;\n }\n\n .status-badge {\n display: inline-block;\n padding: 0.25rem 0.5rem;\n border-radius: 4px;\n font-size: 0.75rem;\n font-weight: 500;\n text-transform: capitalize;\n background: #ffeaa7;\n color: #856404;\n }\n\n .status-badge.published {\n background: #d4edda;\n color: #155724;\n }\n\n .col-updated {\n font-size: 0.8125rem;\n color: #666;\n }\n\n .col-actions {\n display: flex;\n gap: 0.5rem;\n }\n\n .action-btn {\n padding: 0.375rem;\n border: none;\n border-radius: 4px;\n background: transparent;\n cursor: pointer;\n font-size: 1rem;\n transition: background 0.2s;\n }\n\n .action-btn:hover {\n background: #e0e0e0;\n }\n\n .action-btn.delete:hover {\n background: #fde2e2;\n }\n\n /* Dialog */\n .dialog-overlay {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n }\n\n .dialog {\n background: #fff;\n border-radius: 8px;\n width: 100%;\n max-width: 480px;\n box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);\n }\n\n .dialog-small {\n max-width: 400px;\n }\n\n .dialog-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 1.5rem;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .dialog-header h2 {\n margin: 0;\n font-size: 1.25rem;\n font-weight: 600;\n }\n\n .close-btn {\n border: none;\n background: none;\n font-size: 1.5rem;\n cursor: pointer;\n color: #666;\n padding: 0;\n line-height: 1;\n }\n\n .close-btn:hover {\n color: #333;\n }\n\n .dialog-content {\n padding: 1.5rem;\n }\n\n .dialog-content p {\n margin: 0 0 0.5rem;\n color: #333;\n }\n\n .dialog-content .warning {\n color: #e74c3c;\n font-size: 0.875rem;\n }\n\n .form-field {\n margin-bottom: 1.25rem;\n }\n\n .form-field label {\n display: block;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n font-weight: 500;\n color: #333;\n }\n\n .form-field input {\n width: 100%;\n padding: 0.75rem;\n border: 1px solid #e0e0e0;\n border-radius: 6px;\n font-size: 0.875rem;\n transition: border-color 0.2s;\n }\n\n .form-field input:focus {\n outline: none;\n border-color: #1a1a2e;\n }\n\n .slug-field {\n display: flex;\n align-items: center;\n border: 1px solid #e0e0e0;\n border-radius: 6px;\n overflow: hidden;\n }\n\n .slug-field:focus-within {\n border-color: #1a1a2e;\n }\n\n .slug-prefix {\n padding: 0.75rem;\n background: #f5f5f5;\n color: #666;\n font-size: 0.875rem;\n font-family: monospace;\n }\n\n .slug-field input {\n border: none;\n border-radius: 0;\n }\n\n .slug-field input:focus {\n border-color: transparent;\n }\n\n .form-error {\n margin-bottom: 1rem;\n padding: 0.75rem;\n background: #fde2e2;\n border-radius: 6px;\n color: #e74c3c;\n font-size: 0.875rem;\n }\n\n .dialog-actions {\n display: flex;\n justify-content: flex-end;\n gap: 0.75rem;\n padding: 1.5rem;\n border-top: 1px solid #e0e0e0;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class PageManagerComponent implements OnInit {\n private readonly facade = inject(VisualEditorFacade);\n private readonly navigation = inject(VisualEditorNavigation);\n\n // State\n readonly pages = signal<PageSummary[]>([]);\n readonly isLoading = signal(false);\n readonly error = signal<string | null>(null);\n\n // Create dialog\n readonly showCreateDialog = signal(false);\n readonly newPageTitle = signal('');\n readonly newPageSlug = signal('');\n readonly isCreating = signal(false);\n readonly createError = signal<string | null>(null);\n\n // Delete dialog\n readonly pageToDelete = signal<PageSummary | null>(null);\n readonly isDeleting = signal(false);\n\n ngOnInit(): void {\n this.loadPages();\n }\n\n loadPages(): void {\n this.isLoading.set(true);\n this.error.set(null);\n\n this.facade.getPages().subscribe({\n next: (pages) => {\n this.pages.set(pages);\n this.isLoading.set(false);\n },\n error: (err) => {\n this.error.set(err.message || 'Failed to load pages');\n this.isLoading.set(false);\n },\n });\n }\n\n openSetup(): void {\n this.navigation.navigate({ type: 'setup' });\n }\n\n openCreateDialog(): void {\n this.showCreateDialog.set(true);\n this.newPageTitle.set('');\n this.newPageSlug.set('');\n this.createError.set(null);\n }\n\n closeCreateDialog(): void {\n this.showCreateDialog.set(false);\n }\n\n onTitleInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.newPageTitle.set(input.value);\n\n // Auto-generate slug from title\n const slug = input.value\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-|-$/g, '');\n this.newPageSlug.set(slug);\n }\n\n onSlugInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n this.newPageSlug.set(input.value);\n }\n\n createPage(event: Event): void {\n event.preventDefault();\n\n const title = this.newPageTitle().trim();\n const slug = this.newPageSlug().trim();\n\n if (!title || !slug) {\n this.createError.set('Title and slug are required');\n return;\n }\n\n this.isCreating.set(true);\n this.createError.set(null);\n\n this.facade.createPage({ title, slug }).subscribe({\n next: (page) => {\n this.isCreating.set(false);\n this.closeCreateDialog();\n this.navigation.navigate({ type: 'page-edit', pageId: page.id });\n },\n error: (err) => {\n this.createError.set(err.message || 'Failed to create page');\n this.isCreating.set(false);\n },\n });\n }\n\n editPage(pageId: string): void {\n this.navigation.navigate({ type: 'page-edit', pageId });\n }\n\n duplicatePage(pageId: string, event: Event): void {\n event.stopPropagation();\n\n this.facade.duplicatePage(pageId).subscribe({\n next: () => {\n this.loadPages();\n },\n error: (err) => {\n console.error('Failed to duplicate page:', err);\n },\n });\n }\n\n confirmDelete(page: PageSummary, event: Event): void {\n event.stopPropagation();\n this.pageToDelete.set(page);\n }\n\n cancelDelete(): void {\n this.pageToDelete.set(null);\n }\n\n deletePage(): void {\n const page = this.pageToDelete();\n if (!page) return;\n\n this.isDeleting.set(true);\n\n this.facade.deletePage(page.id).subscribe({\n next: () => {\n this.isDeleting.set(false);\n this.pageToDelete.set(null);\n this.loadPages();\n },\n error: (err) => {\n console.error('Failed to delete page:', err);\n this.isDeleting.set(false);\n },\n });\n }\n\n formatDate(dateString: string): string {\n const date = new Date(dateString);\n return date.toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n });\n }\n}\n","import { HttpClient, HttpErrorResponse } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { Observable, throwError } from 'rxjs';\nimport { catchError, map } from 'rxjs/operators';\nimport { STOREFRONT_CONFIG, StorefrontConfig } from '../models/page.model';\n\ninterface GraphQLRequest {\n query: string;\n variables?: Record<string, any>;\n}\n\ninterface GraphQLResponse<T = any> {\n data?: T;\n errors?: Array<{\n message: string;\n locations?: Array<{ line: number; column: number }>;\n path?: string[];\n extensions?: Record<string, any>;\n }>;\n}\n\n/**\n * Read-only GraphQL client for the Shopify Storefront API.\n * Uses a Storefront Access Token (public, non-secret) instead of Admin API credentials.\n */\n@Injectable({ providedIn: 'root' })\nexport class StorefrontGraphQLClient {\n private readonly http = inject(HttpClient);\n private readonly config = inject(STOREFRONT_CONFIG);\n\n query<T>(query: string, variables?: Record<string, any>): Observable<T> {\n const url = this.config.proxyUrl\n ? this.config.proxyUrl\n : `https://${this.config.shopDomain}/api/${this.config.apiVersion}/graphql.json`;\n\n const request: GraphQLRequest = { query, variables };\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n };\n\n if (!this.config.proxyUrl) {\n headers['X-Shopify-Storefront-Access-Token'] = this.config.storefrontAccessToken;\n }\n\n return this.http.post<GraphQLResponse<T>>(url, request, { headers }).pipe(\n map(response => this.handleResponse<T>(response)),\n catchError(error => this.handleError(error))\n );\n }\n\n private handleResponse<T>(response: GraphQLResponse<T>): T {\n if (response.errors && response.errors.length > 0) {\n throw {\n code: 'GRAPHQL_ERROR',\n message: response.errors[0].message,\n errors: response.errors,\n };\n }\n\n if (!response.data) {\n throw {\n code: 'EMPTY_RESPONSE',\n message: 'GraphQL response contains no data',\n };\n }\n\n return response.data;\n }\n\n private handleError(error: HttpErrorResponse): Observable<never> {\n let errorCode = 'UNKNOWN_ERROR';\n let errorMessage = 'An unknown error occurred';\n\n if (typeof ErrorEvent !== 'undefined' && error.error instanceof ErrorEvent) {\n errorCode = 'NETWORK_ERROR';\n errorMessage = error.error.message;\n } else {\n switch (error.status) {\n case 401:\n errorCode = 'UNAUTHORIZED';\n errorMessage = 'Invalid or expired storefront access token';\n break;\n case 402:\n errorCode = 'PAYMENT_REQUIRED';\n errorMessage = 'Storefront API access requires a Shopify plan';\n break;\n case 429:\n errorCode = 'RATE_LIMIT';\n errorMessage = 'Rate limit exceeded';\n break;\n case 500:\n case 502:\n case 503:\n case 504:\n errorCode = 'SERVER_ERROR';\n errorMessage = 'Shopify server error';\n break;\n default:\n errorCode = 'HTTP_ERROR';\n errorMessage = `HTTP ${error.status}: ${error.statusText}`;\n }\n }\n\n return throwError(() => ({\n code: errorCode,\n message: errorMessage,\n status: error.status,\n original: error,\n }));\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { Page, PagesIndex } from '../models/page.model';\nimport { StorefrontGraphQLClient } from './storefront-graphql-client.service';\n\nconst NAMESPACE = 'kustomizer';\nconst INDEX_KEY = 'pages_index';\n\n/**\n * Storefront API query for reading shop metafields.\n * Uses `shop.metafield(namespace, key)` — the Storefront API equivalent\n * of the Admin API's shop metafield query.\n */\nconst GET_SHOP_METAFIELD_QUERY = `\n query GetShopMetafield($namespace: String!, $key: String!) {\n shop {\n metafield(namespace: $namespace, key: $key) {\n value\n type\n }\n }\n }\n`;\n\ninterface StorefrontMetafieldResponse {\n shop: {\n metafield: {\n value: string;\n type: string;\n } | null;\n };\n}\n\n/**\n * Read-only metafield repository using the Shopify Storefront API.\n * Only works for metafields with MetafieldDefinitions that have `access.storefront: PUBLIC_READ`.\n */\n@Injectable({ providedIn: 'root' })\nexport class StorefrontMetafieldRepository {\n private readonly client = inject(StorefrontGraphQLClient);\n\n getMetafield(namespace: string, key: string): Observable<{ value: string; type: string } | null> {\n return this.client.query<StorefrontMetafieldResponse>(GET_SHOP_METAFIELD_QUERY, { namespace, key }).pipe(\n map(response => response.shop.metafield),\n );\n }\n\n getPageIndex(): Observable<PagesIndex> {\n return this.getMetafield(NAMESPACE, INDEX_KEY).pipe(\n map(metafield => {\n if (!metafield) {\n return this.getDefaultIndex();\n }\n\n try {\n const parsed = JSON.parse(metafield.value);\n if (!parsed.pages || !Array.isArray(parsed.pages)) {\n throw new Error('Invalid index structure');\n }\n return parsed as PagesIndex;\n } catch (error) {\n throw {\n code: 'INDEX_PARSE_ERROR',\n message: 'Stored index data is corrupted',\n original: error,\n };\n }\n }),\n );\n }\n\n getPageMetafield(pageId: string): Observable<Page | null> {\n const key = `page_${pageId}`;\n return this.getMetafield(NAMESPACE, key).pipe(\n map(metafield => {\n if (!metafield) {\n return null;\n }\n\n try {\n return JSON.parse(metafield.value) as Page;\n } catch (error) {\n throw {\n code: 'PAGE_PARSE_ERROR',\n message: 'Stored page data is corrupted',\n original: error,\n };\n }\n }),\n );\n }\n\n private getDefaultIndex(): PagesIndex {\n return {\n version: 0,\n lastUpdated: new Date().toISOString(),\n pages: [],\n };\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { Observable, throwError } from 'rxjs';\nimport { map, switchMap } from 'rxjs/operators';\nimport { Page, PageSummary, PagesIndex } from '../models/page.model';\nimport { StorefrontMetafieldRepository } from './storefront-metafield-repository.service';\n\n/**\n * Read-only page repository using the Shopify Storefront API.\n * Used by the public-storefront to read published pages without Admin API access.\n */\n@Injectable({ providedIn: 'root' })\nexport class PageStorefrontRepository {\n private readonly metafieldRepo = inject(StorefrontMetafieldRepository);\n\n getPages(): Observable<PageSummary[]> {\n return this.metafieldRepo.getPageIndex().pipe(\n map(index =>\n index.pages\n .map(entry => ({\n id: entry.id,\n slug: entry.slug,\n title: entry.title,\n status: entry.status,\n updatedAt: entry.updatedAt,\n publishedAt: entry.publishedAt,\n }))\n .sort((a, b) => b.updatedAt.localeCompare(a.updatedAt))\n ),\n );\n }\n\n getPublishedPages(): Observable<PageSummary[]> {\n return this.getPages().pipe(\n map(pages => pages.filter(p => p.status === 'published')),\n );\n }\n\n getPage(id: string): Observable<Page> {\n return this.metafieldRepo.getPageMetafield(id).pipe(\n map(page => {\n if (!page) {\n throw {\n code: 'PAGE_NOT_FOUND',\n message: `Page with id ${id} not found`,\n };\n }\n return page;\n }),\n );\n }\n\n getPublishedPageBySlug(slug: string): Observable<Page> {\n return this.metafieldRepo.getPageIndex().pipe(\n switchMap(index => {\n const entry = index.pages.find(\n p => p.slug === slug && p.status === 'published',\n );\n\n if (!entry) {\n return throwError(() => ({\n code: 'PAGE_NOT_FOUND',\n message: `Published page with slug '${slug}' not found`,\n }));\n }\n\n return this.getPage(entry.id);\n }),\n );\n }\n}\n","import { Injectable, inject, isDevMode, OnDestroy } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { Observable, tap } from 'rxjs';\nimport { ComponentManifest, ComponentManifestEntry } from '../models/component-manifest.model';\nimport { ComponentRegistryService } from '../registry/component-registry.service';\nimport { ComponentDefinition } from '../registry/component-definition.types';\n\n/**\n * Loads a component manifest from a remote storefront URL and registers\n * the entries in the ComponentRegistryService as \"virtual\" definitions\n * (no Angular component class — only metadata for palette and property panel).\n */\n@Injectable({ providedIn: 'root' })\nexport class ManifestLoaderService implements OnDestroy {\n private readonly http = inject(HttpClient);\n private readonly registry = inject(ComponentRegistryService);\n\n private watchInterval: ReturnType<typeof setInterval> | null = null;\n private lastManifestHash = '';\n private manifestTypes = new Set<string>();\n\n /**\n * Fetch the manifest from the given URL and register all components.\n */\n loadManifest(url: string): Observable<ComponentManifest> {\n return this.http.get<ComponentManifest>(url).pipe(\n tap((manifest) => {\n this.registerManifestComponents(manifest);\n this.lastManifestHash = this.hashManifest(manifest);\n }),\n );\n }\n\n /**\n * Poll the manifest URL for changes and re-register components when the\n * content hash differs. Only active in dev mode. No-op in production.\n */\n startWatching(manifestUrl: string, intervalMs = 2000): void {\n if (!isDevMode() || this.watchInterval) return;\n\n this.watchInterval = setInterval(() => {\n this.http.get<ComponentManifest>(manifestUrl).subscribe({\n next: (manifest) => {\n const hash = this.hashManifest(manifest);\n if (hash !== this.lastManifestHash) {\n console.log('[Kustomizer] Manifest changed, reloading components…');\n this.lastManifestHash = hash;\n this.registerManifestComponents(manifest);\n }\n },\n error: () => {}, // silently ignore polling errors\n });\n }, intervalMs);\n }\n\n ngOnDestroy(): void {\n if (this.watchInterval) {\n clearInterval(this.watchInterval);\n this.watchInterval = null;\n }\n }\n\n /**\n * Register manifest entries in the ComponentRegistryService.\n * Each entry becomes a ComponentDefinition without a `component` field.\n */\n registerManifestComponents(manifest: ComponentManifest): void {\n // Remove only previously manifest-loaded definitions, preserving local components\n for (const type of this.manifestTypes) {\n this.registry.unregister(type);\n }\n this.manifestTypes.clear();\n\n for (const entry of manifest.components) {\n const definition = this.manifestEntryToDefinition(entry);\n this.registry.register(definition);\n this.manifestTypes.add(definition.type);\n }\n }\n\n private hashManifest(manifest: ComponentManifest): string {\n return JSON.stringify(\n manifest.components.map(\n c => c.type + c.name + JSON.stringify(c.props ?? {}) + JSON.stringify(c.slots ?? []),\n ),\n );\n }\n\n private manifestEntryToDefinition(entry: ComponentManifestEntry): ComponentDefinition {\n return {\n type: entry.type,\n name: entry.name,\n description: entry.description,\n category: entry.category,\n icon: entry.icon,\n props: entry.props,\n slots: entry.slots,\n isSection: entry.isSection,\n isBlock: entry.isBlock,\n blockScope: entry.blockScope,\n sectionTypes: entry.sectionTypes,\n draggable: entry.draggable,\n deletable: entry.deletable,\n duplicable: entry.duplicable,\n tags: entry.tags,\n order: entry.order,\n // No `component` — rendering happens in the iframe\n };\n }\n}\n","import { Component } from '@angular/core';\n\n@Component({\n selector: 'lib-visual-editor',\n imports: [],\n template: `\n <p>\n visual-editor works!\n </p>\n `,\n styles: ``,\n})\nexport class VisualEditor {\n\n}\n","/*\n * Public API Surface of visual-editor\n */\n\n// Main provider function\nexport { provideVisualEditor } from './lib/provide-visual-editor';\n\n// Store (state, actions, reducer, selectors)\nexport * from './lib/store';\n\n// Registry (component definitions, providers)\nexport * from './lib/registry';\n\n// Components (VisualEditor, PageManager, DynamicRenderer, etc.)\nexport * from './lib/components';\n\n// Services (VisualEditorFacade, PageService)\nexport * from './lib/services';\n\n// Models (Page types, injection tokens)\nexport * from './lib/models';\n\n// Navigation (abstract service, default implementation)\nexport * from './lib/navigation';\n\n// Page Loading (strategies for loading pages)\nexport * from './lib/page-loading';\n\n// Configuration (types, injection tokens)\nexport * from './lib/config';\n\n// Drag & Drop (service, types)\nexport * from './lib/dnd';\n\n// Legacy export for backwards compatibility\nexport * from './lib/visual-editor';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["map","NAMESPACE","INDEX_KEY","GET_SHOP_METAFIELD_QUERY","findElementRecursive","switchMap"],"mappings":";;;;;;;;;;AAqBA;;;AAGG;MACmB,sBAAsB,CAAA;AAiB3C;;ACnBD;;AAEG;AACI,MAAM,gCAAgC,GAA2B;AACtE,IAAA,YAAY,EAAE,QAAQ;AACtB,IAAA,YAAY,EAAE,sBAAsB;AACpC,IAAA,WAAW,EAAE,QAAQ;;AAGvB;;AAEG;MACU,wBAAwB,GAAG,IAAI,cAAc,CACxD,0BAA0B,EAC1B;AACE,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,gCAAgC;AAChD,CAAA;AAGH;;AAEG;AAEG,MAAO,8BAA+B,SAAQ,sBAAsB,CAAA;AACvD,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,IAAA,MAAM,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAE1D,IAAA,QAAQ,CAAC,MAAoC,EAAA;AAC3C,QAAA,QAAQ,MAAM,CAAC,IAAI;AACjB,YAAA,KAAK,WAAW;AACd,gBAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;gBAChD;YACF,KAAK,WAAW,EAAE;gBAChB,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,CAC/C,CA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