Refactor: remove AGPL imgly dependency and migrate background removal to python backend
This commit is contained in:
@@ -29,7 +29,7 @@ import { RenderProps, TimelineElement } from '../../types';
|
||||
* StudioEditor: The main editing view.
|
||||
* Reads all state from EditorContext — no prop drilling needed.
|
||||
*/
|
||||
export const StudioEditor: React.FC = () => {
|
||||
export const StudioEditor: React.FC<{ onAssetSaved?: (url: string) => void }> = ({ onAssetSaved }) => {
|
||||
const {
|
||||
timelineElements, setTimelineElements,
|
||||
layers, setLayers,
|
||||
@@ -50,6 +50,7 @@ export const StudioEditor: React.FC = () => {
|
||||
brandVisibility, setBrandVisibility,
|
||||
activeAction, setActiveAction,
|
||||
selectedElementIds, toggleElementSelection, clearSelection,
|
||||
editingBrandAsset,
|
||||
} = useEditor();
|
||||
|
||||
// Panel state (replaces old activeTool for toolbar)
|
||||
@@ -70,6 +71,7 @@ export const StudioEditor: React.FC = () => {
|
||||
|
||||
// Auto-save after 2s of inactivity
|
||||
useEffect(() => {
|
||||
if (editingBrandAsset) return; // Disable autosave in brand asset mode
|
||||
if (autoSaveTimer.current) clearTimeout(autoSaveTimer.current);
|
||||
autoSaveTimer.current = setTimeout(() => {
|
||||
try {
|
||||
@@ -88,6 +90,7 @@ export const StudioEditor: React.FC = () => {
|
||||
|
||||
// Auto-load on mount (only if no elements exist)
|
||||
useEffect(() => {
|
||||
if (editingBrandAsset) return; // Disable autoload in brand asset mode
|
||||
try {
|
||||
const saved = localStorage.getItem(AUTOSAVE_KEY);
|
||||
if (!saved) return;
|
||||
@@ -236,9 +239,9 @@ export const StudioEditor: React.FC = () => {
|
||||
onElementDelete: handleDelete,
|
||||
onElementLock: handleLock,
|
||||
activeAction,
|
||||
brandVisibility,
|
||||
brandVisibility: editingBrandAsset ? { logo: false, frame: false, background: false } : brandVisibility,
|
||||
outputFormat,
|
||||
}), [designMD, textOverlay, layers, timelineElements, selectedElementId, activeLayerId, activeAction, brandVisibility, outputFormat, handleElementClick, handlePositionChange, handleTransformChange, handleDuplicate, handleDelete, handleLock]);
|
||||
}), [designMD, textOverlay, layers, timelineElements, selectedElementId, activeLayerId, activeAction, brandVisibility, outputFormat, handleElementClick, handlePositionChange, handleTransformChange, handleDuplicate, handleDelete, handleLock, editingBrandAsset]);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -408,8 +411,10 @@ export const StudioEditor: React.FC = () => {
|
||||
timelineElements={timelineElements}
|
||||
layers={layers}
|
||||
durationInFrames={durationInFrames}
|
||||
brandVisibility={brandVisibility}
|
||||
brandVisibility={editingBrandAsset ? { logo: false, frame: false, background: false } : brandVisibility}
|
||||
outputFormat={outputFormat}
|
||||
aspectRatio={aspectRatio}
|
||||
onAssetSaved={onAssetSaved}
|
||||
/>
|
||||
|
||||
{/* Shortcuts Overlay */}
|
||||
|
||||
Reference in New Issue
Block a user