docs/solutions/best-practices/input-rules-should-expose-enabled-in-core-instead-of-helper-local-blockers.md
Input-rule gating was drifting into helper-local APIs.
createBlockFenceInputRule carried isBlockedcreateTextSubstitutionInputRule carried isBlockedisEquationInputBlocked check inside resolveThat was the wrong layer. Apps do not want ten different blocker escape hatches. They want one obvious override point.
isBlocked(editor) options.resolve, where app code cannot override
them without replacing the whole rule.Make enabled(context) part of the core input-rule contract and let the runtime
evaluate it before resolve.
defineInputRule({
enabled: ({ editor }) => !editor.api.some(...),
target: 'insertText',
trigger: '$',
resolve,
apply,
});
Then helpers just forward enabled:
createBlockFenceInputRule({
enabled: ({ editor }) => !isCodeBlockInputBlocked(editor),
fence: '```',
on: 'match',
apply,
});
Package surfaces can keep ergonomic app-facing options:
MathRules.markdown({
variant: '$',
enabled: (editor) => true,
});
resolve goes back to matching instead of mixed matching-plus-policy logic.enabled in core.