Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/editor/src/ui/inspector/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,18 @@ export function useInspector() {
export function InspectorProvider({ children }: RootProps) {
const { editor } = useCurrentEditor();

if (editor) {
const hasEmailTheming = editor.extensionManager.extensions.some(
(extension) => extension.name === 'theming',
);
if (!hasEmailTheming) {
throw new Error(
'Inspector.Provider requires the EmailTheming extension to be added to your editor. ' +
'Please add EmailTheming (or EmailTheming.configure({ ... })) to your editor extensions.',
);
}
}

const target = useEditorState({
editor,
selector(context): InspectorTarget {
Expand Down
Loading