-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Much like I introduced KeyMapper (change to KeyboardHandler? or KeydownHandler) Svedit should have just a single handler to mange selection changes or clipboard events (copy, cut, paste), this handler must be aware of the current context, so just like the KeyMapper track a scope_stack, so we have an app on top level and once we focus a Svedit instance it registers a new svedit-aware scope to take over the handling.
In other words I should get rid of these global event handlers in Svedit.svelte:
<svelte:document {onselectionchange} {oncut} {oncopy} {onpaste} />Example scenario:
You have an app, that has some selection & copy&paste handling on app level, when no svedit instance is active. E.g. think of a side-panel that manages website design parameters, e.g. Fonts. And then when when you paste a font into that area, you should be able to hook into that paste handler, while any Svedit instance's handler should do nothing (as they are not in focus).