diff --git a/craft/src/components/basic/ButtonLink.tsx b/craft/src/components/basic/ButtonLink.tsx index a6e255c..893485f 100644 --- a/craft/src/components/basic/ButtonLink.tsx +++ b/craft/src/components/basic/ButtonLink.tsx @@ -45,150 +45,6 @@ export const ButtonLink: UserComponent = ({ ); }; -/* ---------- Settings panel ---------- */ - -const ButtonLinkSettings: React.FC = () => { - const { actions: { setProp }, props } = useNode((node) => ({ - props: node.data.props as ButtonLinkProps, - })); - - const colorPresets = [ - { bg: '#3b82f6', color: '#ffffff', label: 'Blue' }, - { bg: '#10b981', color: '#ffffff', label: 'Green' }, - { bg: '#ef4444', color: '#ffffff', label: 'Red' }, - { bg: '#f59e0b', color: '#18181b', label: 'Amber' }, - { bg: '#8b5cf6', color: '#ffffff', label: 'Purple' }, - { bg: '#18181b', color: '#ffffff', label: 'Dark' }, - { bg: '#ffffff', color: '#18181b', label: 'White' }, - { bg: 'transparent', color: '#3b82f6', label: 'Ghost' }, - ]; - const radiusPresets = ['0px', '4px', '8px', '12px', '9999px']; - const paddingPresets = ['8px 16px', '10px 20px', '12px 24px', '14px 32px', '16px 40px']; - - return ( -
-
- - setProp((p: ButtonLinkProps) => { p.text = e.target.value; })} - style={{ width: '100%', padding: '4px 8px', background: '#27272a', color: '#e4e4e7', border: '1px solid #3f3f46', borderRadius: 4, fontSize: 12 }} - /> -
- -
- - setProp((p: ButtonLinkProps) => { p.href = e.target.value; })} - placeholder="https://..." - style={{ width: '100%', padding: '4px 8px', background: '#27272a', color: '#e4e4e7', border: '1px solid #3f3f46', borderRadius: 4, fontSize: 12 }} - /> -
- -
- -
- {(['_self', '_blank'] as const).map((t) => ( - - ))} -
-
- -
- -
- {colorPresets.map((preset) => ( -
-
- -
- -
- {radiusPresets.map((r) => ( - - ))} -
-
- -
- -
- {paddingPresets.map((p) => ( - - ))} -
-
- -
- - setProp((p: ButtonLinkProps) => { p.style = { ...p.style, fontSize: e.target.value }; })} - style={{ width: '100%', padding: '4px 8px', background: '#27272a', color: '#e4e4e7', border: '1px solid #3f3f46', borderRadius: 4, fontSize: 11 }} - /> -
-
- ); -}; - /* ---------- Craft config ---------- */ ButtonLink.craft = { @@ -212,9 +68,6 @@ ButtonLink.craft = { canMoveIn: () => false, canMoveOut: () => true, }, - related: { - settings: ButtonLinkSettings, - }, }; /* ---------- HTML export ---------- */ diff --git a/craft/src/components/basic/Divider.tsx b/craft/src/components/basic/Divider.tsx index aa349f5..707c07d 100644 --- a/craft/src/components/basic/Divider.tsx +++ b/craft/src/components/basic/Divider.tsx @@ -34,59 +34,6 @@ export const Divider: UserComponent = ({ ); }; -/* ---------- Settings panel ---------- */ - -const DividerSettings: React.FC = () => { - const { actions: { setProp }, props } = useNode((node) => ({ - props: node.data.props as DividerProps, - })); - - const colorPresets = ['#e4e4e7', '#d4d4d8', '#a1a1aa', '#3f3f46', '#18181b', '#3b82f6', '#ef4444', '#10b981']; - const thicknessPresets = ['1px', '2px', '3px', '4px', '6px']; - - return ( -
-
- -
- {colorPresets.map((c) => ( -
-
- -
- -
- {thicknessPresets.map((t) => ( - - ))} -
-
-
- ); -}; - /* ---------- Craft config ---------- */ Divider.craft = { @@ -101,9 +48,6 @@ Divider.craft = { canMoveIn: () => false, canMoveOut: () => true, }, - related: { - settings: DividerSettings, - }, }; /* ---------- HTML export ---------- */ diff --git a/craft/src/components/basic/Footer.tsx b/craft/src/components/basic/Footer.tsx index 4b75040..7d542ec 100644 --- a/craft/src/components/basic/Footer.tsx +++ b/craft/src/components/basic/Footer.tsx @@ -56,67 +56,6 @@ export const Footer: UserComponent = ({ ); }; -/* ---------- Settings panel ---------- */ - -const FooterSettings: React.FC = () => { - const { actions: { setProp }, props } = useNode((node) => ({ - props: node.data.props as FooterProps, - })); - - const bgPresets = ['#ffffff', '#f8fafc', '#18181b', '#0f172a', '#1e293b']; - const colorPresets = ['#18181b', '#3f3f46', '#71717a', '#a1a1aa', '#e4e4e7', '#ffffff']; - - return ( -
-
- - setProp((p: FooterProps) => { p.text = e.target.value; })} - style={{ width: '100%', padding: '4px 8px', background: '#27272a', color: '#e4e4e7', border: '1px solid #3f3f46', borderRadius: 4, fontSize: 12 }} - /> -
- -
- -
- {bgPresets.map((c) => ( -
-
- -
- -
- {colorPresets.map((c) => ( -
-
-
- ); -}; - /* ---------- Craft config ---------- */ Footer.craft = { @@ -135,9 +74,6 @@ Footer.craft = { canMoveIn: () => false, canMoveOut: () => true, }, - related: { - settings: FooterSettings, - }, }; /* ---------- HTML export ---------- */ diff --git a/craft/src/components/basic/Heading.tsx b/craft/src/components/basic/Heading.tsx index 3131596..158f911 100644 --- a/craft/src/components/basic/Heading.tsx +++ b/craft/src/components/basic/Heading.tsx @@ -1,9 +1,6 @@ import React, { CSSProperties, useCallback, useRef, useEffect } from 'react'; import { useNode, UserComponent } from '@craftjs/core'; import { cssPropsToString } from '../../utils/style-helpers'; -import { SettingsTabs } from '../../ui/SettingsTabs'; -import { TypographyControl } from '../../ui/TypographyControl'; -import { AdvancedTab } from '../../ui/AdvancedTab'; type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'; @@ -80,76 +77,6 @@ export const Heading: UserComponent = ({ }); }; -/* ---------- Settings panel ---------- */ - -const HeadingSettings: React.FC = () => { - const { actions: { setProp }, props } = useNode((node) => ({ - props: node.data.props as HeadingProps, - })); - - const levels: HeadingLevel[] = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; - - return ( - -
- -
- {levels.map((l) => ( - - ))} -
-
-
- - setProp((p: HeadingProps) => { p.text = e.target.value; })} - style={{ width: '100%', padding: '6px 8px', background: '#27272a', color: '#e4e4e7', border: '1px solid #3f3f46', borderRadius: 4, fontSize: 13 }} - /> -
- - } - style={ - setProp((p: HeadingProps) => { p.style = { ...p.style, ...updates }; })} - /> - } - advanced={ - setProp((p: HeadingProps) => { p.style = { ...p.style, ...updates }; })} - cssId={props.cssId || ''} - onCssIdChange={(id) => setProp((p: HeadingProps) => { p.cssId = id; })} - cssClass={props.cssClass || ''} - onCssClassChange={(cls) => setProp((p: HeadingProps) => { p.cssClass = cls; })} - hideOnDesktop={props.hideOnDesktop} - onHideOnDesktopChange={(v) => setProp((p: HeadingProps) => { p.hideOnDesktop = v; })} - hideOnTablet={props.hideOnTablet} - onHideOnTabletChange={(v) => setProp((p: HeadingProps) => { p.hideOnTablet = v; })} - hideOnMobile={props.hideOnMobile} - onHideOnMobileChange={(v) => setProp((p: HeadingProps) => { p.hideOnMobile = v; })} - animation={props.animation} - onAnimationChange={(v) => setProp((p: HeadingProps) => { p.animation = v; })} - animationDelay={props.animationDelay} - onAnimationDelayChange={(v) => setProp((p: HeadingProps) => { p.animationDelay = v; })} - /> - } - /> - ); -}; - Heading.craft = { displayName: 'Heading', props: { @@ -168,9 +95,6 @@ Heading.craft = { canMoveIn: () => false, canMoveOut: () => true, }, - related: { - settings: HeadingSettings, - }, }; (Heading as any).toHtml = (props: HeadingProps, _childrenHtml: string) => { diff --git a/craft/src/components/basic/HtmlBlock.tsx b/craft/src/components/basic/HtmlBlock.tsx index a5b05df..4fa7f8a 100644 --- a/craft/src/components/basic/HtmlBlock.tsx +++ b/craft/src/components/basic/HtmlBlock.tsx @@ -49,76 +49,6 @@ export const HtmlBlock: UserComponent = ({ code = '', style = {} }); }; -/* ---------- Settings panel ---------- */ - -const HtmlBlockSettings: React.FC = () => { - const { actions: { setProp }, props } = useNode((node) => ({ - props: node.data.props as HtmlBlockProps, - })); - - return ( -
-
- This block renders raw HTML. Use with caution. -
- -
- -