feat: make tryIt presets, limits, badges and buttons completely dynamic from JSON configs

This commit is contained in:
2026-11-04 15:36:30 +05:30
parent de20dd4c7e
commit e5c318099d
21 changed files with 881 additions and 250 deletions
+23
View File
@@ -0,0 +1,23 @@
'use client';
import React, { createContext, useContext } from 'react';
export interface EditorContextType {
isEditor: boolean;
openInspector: (sectionId?: string, tab?: 'content' | 'items' | 'media' | 'settings') => void;
openToolModal: () => void;
openShowcaseModal: () => void;
updateSectionProps: (sectionId: string, newProps: Record<string, any>) => void;
availableTools: any[];
}
export const EditorContext = createContext<EditorContextType>({
isEditor: false,
openInspector: () => {},
openToolModal: () => {},
openShowcaseModal: () => {},
updateSectionProps: () => {},
availableTools: [],
});
export const useEditor = () => useContext(EditorContext);