From 1958b8e0b5d47dd67ece8a74dcf1c8f7c9ec842a Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Sun, 12 Jul 2026 14:59:39 -0700 Subject: [PATCH] chore(builder): remove GuidedStyles classification cruft Drop the computed-but-unused resolvedName/resolverMap, anchor the hero regex (/^hero/i) so it stops matching any type name containing "hero", and remove the isContainer alternations for the now-deleted HeaderZone/FooterZone components. Co-Authored-By: Claude Opus 4.8 (1M context) --- craft/src/panels/right/GuidedStyles.tsx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/craft/src/panels/right/GuidedStyles.tsx b/craft/src/panels/right/GuidedStyles.tsx index 15b64dd..59e0ff2 100644 --- a/craft/src/panels/right/GuidedStyles.tsx +++ b/craft/src/panels/right/GuidedStyles.tsx @@ -1,6 +1,5 @@ import React from 'react'; import { useEditor } from '@craftjs/core'; -import { componentResolver } from '../../components/resolver'; import { SiteDesignPanel } from './SiteDesignPanel'; import { useSitesmithModal } from '../../state/SitesmithContext'; import { buildSitesmithTarget } from '../../utils/sitesmith-target'; @@ -31,27 +30,21 @@ import { ================================================================ */ export const GuidedStyles: React.FC = () => { - const resolverMap = componentResolver as Record; const { open: openSitesmith } = useSitesmithModal(); const { query } = useEditor(); - const { selected, selectedType, nodeProps, resolvedName } = useEditor((state) => { + const { selected, selectedType, nodeProps } = useEditor((state) => { const currentNodeId = state.events.selected ? Array.from(state.events.selected)[0] : undefined; let selectedType: string | null = null; let nodeProps: Record = {}; - let resolvedName: string | null = null; if (currentNodeId) { const node = state.nodes[currentNodeId]; if (node) { selectedType = node.data.displayName || node.data.name || null; nodeProps = node.data.props || {}; - const nodeType = node.data.type as any; - if (nodeType && typeof nodeType === 'object' && nodeType.resolvedName) { - resolvedName = nodeType.resolvedName; - } } } @@ -59,7 +52,6 @@ export const GuidedStyles: React.FC = () => { selected: currentNodeId || null, selectedType, nodeProps, - resolvedName, }; }); @@ -75,8 +67,8 @@ export const GuidedStyles: React.FC = () => { const isButton = /^button$/i.test(typeName); const isImage = /^image$/i.test(typeName); const isBgSection = /^background section$/i.test(typeName); - const isContainer = /^container$|^section$|^columns$|^header zone$|^footer zone$/i.test(typeName); - const isHero = /hero/i.test(typeName); + const isContainer = /^container$|^section$|^columns$/i.test(typeName); + const isHero = /^hero/i.test(typeName); const isNav = /^menu$|^logo$|^navbar$|^footer$/i.test(typeName); const isMedia = /^video$|^gallery$|^map$|^content slider$/i.test(typeName); const isForm = /^form$|^input$|^textarea$|^subscribe|^contact form$|^submit button$|^search bar$/i.test(typeName);