@explita/editor
Version:
`@explita/editor` is a versatile, modern rich-text editor built on TipTap for seamless integration into React applications. It provides extensive customization options and advanced features to cater to diverse content creation needs.
13 lines (12 loc) • 431 B
JavaScript
import { create } from "zustand";
import { defaultEditorOpts, initializeEditor } from "../lib/utils";
export const useEditorStore = create((set) => ({
editor: null,
setEditor: (editor) => set({ editor }),
editorOpts: defaultEditorOpts,
setEditorOpts: (opts) => set((state) => ({
editorOpts: typeof opts === "function"
? opts(state.editorOpts)
: initializeEditor(opts),
})),
}));