Add Craft.js site builder (v2) - complete rebuild from GrapesJS
Rebuilt the visual site builder from scratch using Craft.js, React 18, and TypeScript. The new editor renders directly in the DOM (no iframe), supports 40+ components, multi-page with shared header/footer, 16 templates, full-spectrum color/gradient controls, custom head code injection, save/publish workflow, and auto-save. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import React, { createContext, useContext, ReactNode } from 'react';
|
||||
import { WhpConfig } from '../types';
|
||||
|
||||
interface EditorConfigContextValue {
|
||||
whpConfig: WhpConfig | null;
|
||||
isWHP: boolean;
|
||||
}
|
||||
|
||||
const EditorConfigContext = createContext<EditorConfigContextValue>({
|
||||
whpConfig: null,
|
||||
isWHP: false,
|
||||
});
|
||||
|
||||
export const useEditorConfig = () => useContext(EditorConfigContext);
|
||||
|
||||
export const EditorConfigProvider: React.FC<{ config: WhpConfig | null; children: ReactNode }> = ({ config, children }) => {
|
||||
return (
|
||||
<EditorConfigContext.Provider value={{ whpConfig: config, isWHP: !!config }}>
|
||||
{children}
|
||||
</EditorConfigContext.Provider>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user