| 4 | const EditorOptionsContext = createContext<EditorOptionsState | null>(null); |
| 5 | |
| 6 | export interface EditorOptionsState { |
| 7 | refCanvas?: HTMLElement; |
| 8 | customModal?: boolean; |
| 9 | customAssets?: boolean; |
| 10 | customStyles?: boolean; |
| 11 | customBlocks?: boolean; |
| 12 | customLayers?: boolean; |
| 13 | customSelectors?: boolean; |
| 14 | customTraits?: boolean; |
| 15 | customRte?: boolean; |
| 16 | ready?: boolean; |
| 17 | setRefCanvas: (ref: HTMLElement) => void; |
| 18 | setCustomModal: (value: boolean) => void; |
| 19 | setCustomAssets: (value: boolean) => void; |
| 20 | setCustomBlocks: (value: boolean) => void; |
| 21 | setCustomRte: (value: boolean) => void; |
| 22 | setCustomStyles: (value: boolean) => void; |
| 23 | setCustomLayers: (value: boolean) => void; |
| 24 | setCustomSelectors: (value: boolean) => void; |
| 25 | setCustomTraits: (value: boolean) => void; |
| 26 | setReady: (value: boolean) => void; |
| 27 | } |
| 28 | |
| 29 | export const EditorOptionsProvider = ({ children }: { children?: ReactNode }) => { |
| 30 | const [state, setState] = useState<EditorOptionsState>(() => ({ |
nothing calls this directly
no outgoing calls
no test coverage detected