Closed yaodingyd closed 5 years ago
I agree that UX features like presenter mode and zoom could be in their own extension. I don't see the advantage of widgets like codeblocks as plugins though, they would rather be classical Vue components (possibly provided by a library external to Vue).
Widget behavior stays the same and they are not plugins. I added the extension wrapper to make the interface identical so user can use a widget/plugin the same way as how the user could use a Vue plugin. If you feel like this is redundant then I think just splitting out plugins is a good start.
Sorry never got back to this. I'm fine with PR this if you want to merge.
@Zulko Thanks! I'll add more documentation and merge ASAP.
The PR aims to help solve the issue of unnecessary to core yet useful addition to Eagle.js ecosystem.
Here I propose a new concept: extensitions. It includes two categories, namely widgets and plugins.
Both widgets and plugins have the same interface to use, just like how Vue uses plugins, for example
To do this I have extract the two main plugins (presenter mode and zoom) into their own files.
Plugin
Plugins are used mostly by "config", like how we "use" Eagle.js. A plugin has three common properties:
init
,destroy
andisPlugin
. For each plugin,init
is called after slideshow is mounted, anddestroy
is called before slideshow destroys.Widget
We can still use widget like the old way:
The new
Eagle.use
is just a wrapper of the above call.I really appreciate if @Zulko can take a look!