diff --git a/frontend/src/components/Constructor/ConstructorToolbar.tsx b/frontend/src/components/Constructor/ConstructorToolbar.tsx index 25f3a28..b305881 100644 --- a/frontend/src/components/Constructor/ConstructorToolbar.tsx +++ b/frontend/src/components/Constructor/ConstructorToolbar.tsx @@ -20,6 +20,7 @@ import { mdiChevronRight, mdiChevronUp, mdiContentDuplicate, + mdiContentPaste, mdiMusicNote, mdiVideo, mdiInformationOutline, @@ -54,6 +55,10 @@ const ConstructorToolbar = forwardRef( onSelectMenuItem, allowedNavigationTypes, onAddElement, + onCopyElement, + onPasteElement, + canCopyElement = false, + canPasteElement = false, onCreatePage, isCreatingPage, onSave, @@ -111,6 +116,8 @@ const ConstructorToolbar = forwardRef( !isDeletingPage && !isReorderingPages && activePageIndex >= 0; + const canCopyCurrentElement = Boolean(onCopyElement) && canCopyElement; + const canPasteCurrentElement = Boolean(onPasteElement) && canPasteElement; // Keyboard handling (Escape closes dropdown) useEffect(() => { @@ -137,7 +144,13 @@ const ConstructorToolbar = forwardRef( // Shared button styles const triggerBtnClass = - 'flex items-center gap-1.5 px-3 py-2 rounded text-sm font-medium text-white/90 hover:bg-white/20 transition-colors'; + 'flex h-10 items-center gap-1.5 rounded px-3 text-sm font-medium text-white/90 transition-colors hover:bg-white/20'; + const iconBtnClass = + 'flex h-10 w-10 items-center justify-center rounded border border-white/20 bg-white/10 text-white/70 transition-colors hover:bg-white/20 hover:text-white disabled:cursor-not-allowed disabled:opacity-35'; + const sectionClass = + 'flex h-[58px] flex-col justify-center gap-1 border-x border-white/15 px-3'; + const sectionLabelClass = + 'text-center text-[9px] font-semibold uppercase leading-none tracking-wide text-white/50'; const dropdownPanelClass = 'absolute top-full left-0 mt-1 min-w-[180px] py-1 rounded-lg bg-white/50 backdrop-blur-xl border border-white/30 shadow-lg z-10 flex flex-col items-start'; @@ -173,7 +186,7 @@ const ConstructorToolbar = forwardRef( return (
{/* Drag Handle */} @@ -184,253 +197,288 @@ const ConstructorToolbar = forwardRef(
- {/* Page Selector - reuse existing component */} - - -
- - - - +
+
- {/* Mode Toggle - reuse with compact=true */} - - - {/* Divider */} -
- - {/* Backgrounds Dropdown */} -
- - {activeDropdown === 'bg' && ( - + + Page actions + +
+ +
+ + +
+
- - {/* Elements Dropdown */} -
- - {activeDropdown === 'elements' && ( - + {isCreatingPage ? 'Creating...' : 'Page'} + + + +
+ + {activeDropdown === 'bg' && ( + +
+ + handleMenuAction(() => + onSelectMenuItem('background_image'), + ) + } + /> + + handleMenuAction(() => + onSelectMenuItem('background_video'), + ) + } + /> + + handleMenuAction(() => + onSelectMenuItem('background_embed'), + ) + } + /> + + handleMenuAction(() => + onSelectMenuItem('background_audio'), + ) + } + /> +
+
+ )} +
+
- {/* Divider */} -
+
+ + Elements actions + +
+
+ + {activeDropdown === 'elements' && ( + +
+ + handleMenuAction(() => + onAddElement(allowedNavigationTypes[0]), + ) + } + /> + + handleMenuAction(() => onAddElement('gallery')) + } + /> + + handleMenuAction(() => onAddElement('carousel')) + } + /> + + handleMenuAction(() => onAddElement('description')) + } + /> + + handleMenuAction(() => onAddElement('video_player')) + } + /> + + handleMenuAction(() => onAddElement('audio_player')) + } + /> + + handleMenuAction(() => onAddElement('info_panel')) + } + /> +
+
+ )} +
+
+ + +
+
+
- {/* Create Page Button */} - +
+ {/* Save Button - reuse BaseButton with subtitle */} + - {/* Save Button - reuse BaseButton with subtitle */} - + {/* Save to Stage Button */} + - {/* Save to Stage Button */} - + {/* Exit Button */} + - {/* Exit Button */} - - - {/* Collapse Toggle */} - + {/* Collapse Toggle */} + +
); }, diff --git a/frontend/src/components/Constructor/ElementEditorHeader.tsx b/frontend/src/components/Constructor/ElementEditorHeader.tsx index 67b1ee9..e561521 100644 --- a/frontend/src/components/Constructor/ElementEditorHeader.tsx +++ b/frontend/src/components/Constructor/ElementEditorHeader.tsx @@ -36,6 +36,7 @@ const ElementEditorHeader: React.FC = ({