Closed jacobwegner closed 3 years ago
I'm having a little trouble following the code. I don't see what calls the callable in the scaifeConfig: displayName
setting.
I'm also generally opposed to passing $root
around, or even the $store
for that matter around, or exporting any non-default from a single-file-component. It all just feels like a lot of mixing responsibilities.
All that critique aside, I don't have a good answer right now for a better way to accomplish what it is I think is being done here (but I don't see how it works either as both the method on SidebarLayout
and the callable in the scaifeConfig
of the widget seem disconnected from one another.
Oh, I see what calls the scaifeConfig.displayName
now
@paltman wrote:
I'm also generally opposed to passing $root around, or even the $store for that matter around, or exporting any non-default from a single-file-component. It all just feels like a lot of mixing responsibilities.
Yep; my goal wasn't to be manipulating $root, but really just access the getters / config like I would within our usual components. I've pushed ed0fce8 which just passes getters and $scaife to the callback.
In Digital Sira, we ended up passing a callable that had access to to the localization information via the Vue instance. I think what I've done here gives us similar flexibility. I think getters + $scaife.config can take us a long way...eventually we might want to have something like a $scaife.config.widgetLabels
lookup to support "simple" overrides at the project level too.
Adds a widget that displays the highest-citable nodes for a passage.
Adds hooks for integrating the widget in both SV 1 and SV 2 readers.