Problem
I'm not using overtype's built-in toolbar, and instead building my own, so I can use the same icons I'm using elsewhere in the app, use the same UX conventions, etc.
To show toolbar buttons as active based on the current cursor position (for example, highlighting the Bold button when the cursor is inside bold text), I need to use the getActiveFormats utility from the markdown-actions module.
I can just install the module and use it from there, but the module is already bundled in the overtype distribution bundle, so it'd end up duplicated in my app's bundle.
Proposed solution
Re-export markdown-actions in src/overtype.js, so I can use it from there.
Alternatives
- Add an
onActiveFormatsChange callback to the overtype instance options. (Con: more narrow in scope just to cover my usecase. Pro: doesn't expose internal APIs.)
- Ship a non-bundled version of overtype. (Cons: more work; might not be possible to ship both the unbundled and the bundled versions at the same time.)
Problem
I'm not using overtype's built-in toolbar, and instead building my own, so I can use the same icons I'm using elsewhere in the app, use the same UX conventions, etc.
To show toolbar buttons as active based on the current cursor position (for example, highlighting the Bold button when the cursor is inside bold text), I need to use the
getActiveFormatsutility from themarkdown-actionsmodule.I can just install the module and use it from there, but the module is already bundled in the overtype distribution bundle, so it'd end up duplicated in my app's bundle.
Proposed solution
Re-export
markdown-actionsinsrc/overtype.js, so I can use it from there.Alternatives
onActiveFormatsChangecallback to the overtype instance options. (Con: more narrow in scope just to cover my usecase. Pro: doesn't expose internal APIs.)