@lyfie/luthor uses feature flags to control what each preset can do, without forking runtime logic.
Canonical keys are defined in packages/luthor/src/presets/extensive/extensions.tsx as EXTENSIVE_FEATURE_KEYS.
type FeatureFlag =
| 'bold'
| 'italic'
| 'underline'
| 'strikethrough'
| 'fontFamily'
| 'fontSize'
| 'lineHeight'
| 'textColor'
| 'textHighlight'
| 'subscript'
| 'superscript'
| 'link'
| 'horizontalRule'
| 'table'
| 'list'
| 'history'
| 'image'
| 'blockFormat'
| 'code'
| 'codeIntelligence'
| 'codeFormat'
| 'tabIndent'
| 'enterKeyBehavior'
| 'iframeEmbed'
| 'youTubeEmbed'
| 'floatingToolbar'
| 'contextMenu'
| 'commandPalette'
| 'slashCommand'
| 'emoji'
| 'draggableBlock'
| 'customNode'
| 'themeToggle';ExtensiveEditor starts with all feature flags enabled (DEFAULT_FEATURE_FLAGS).
Disable selectively:
<ExtensiveEditor
featureFlags={{
image: false,
table: false,
customNode: false,
commandPalette: false,
}}
/>Some presets enforce specific flags to protect preset contracts:
LegacyRichEditor: keeps metadata-heavy features off (table, image, embeds, custom nodes, draggable, palette/slash, emoji, theme toggle).SlashEditor: enforces slashCommand: true and commandPalette: false.HeadlessEditorPreset: keeps a lightweight metadata-friendly profile.SimpleEditor: hardcodes a minimal visual-only chat input profile.Preset contracts must stay stable. If a preset promises markdown/html-native behavior or slash-first behavior, enforced flags prevent accidental drift.
fontFamily, fontSize, lineHeightbold, italic, underline, strikethrough, subscript, superscript, codeFormat, textColor, textHighlightblockFormat, list, horizontalRule, table, tabIndent, enterKeyBehaviorimage, iframeEmbed, youTubeEmbed, customNodehistory, commandPalette, slashCommand, floatingToolbar, contextMenu, draggableBlock, themeToggle, emojicode, codeIntelligence| Flag | What it controls |
|---|---|
bold / italic / underline / strikethrough | Core inline formatting toggles |
fontFamily / fontSize / lineHeight | Typography selectors and commands |
textColor / textHighlight | Text color + highlight tools |
subscript / superscript | Script formatting |
link | Link insertion/edit/remove features |
horizontalRule | Divider insertion |
table | Table insertion/editing controls |
list | Ordered/unordered/checklist features |
history | Undo/redo support |
image | Image insertion and image controls |
blockFormat | Paragraph/headings/quote/alignment |
code | Code block features |
codeIntelligence | Code language detect/select/copy tools |
codeFormat | Inline code format command |
tabIndent | Tab/shift-tab list indentation control |
enterKeyBehavior | Hard-break and enter behavior features |
iframeEmbed | iframe embedding tools |
youTubeEmbed | YouTube embedding tools |
floatingToolbar | Floating contextual toolbar |
contextMenu | Context menu workflows |
commandPalette | Command palette overlay |
slashCommand | Slash command menu |
emoji | Emoji insertion/suggestions |
draggableBlock | Drag handles and block moving |
customNode | Custom node insertion support |
themeToggle | Built-in theme toggle control |
EXTENSIVE_FEATURE_KEYS.DEFAULT_FEATURE_FLAGS.buildExtensiveExtensions(...).