protected function resolveViewedUIComponent(AbstractTemplate $component, $keyname = 'ui-components.viewed')
    {
        $viewed = $component->views();
        if (empty($viewed)) {
            return false;
        }
        $classname = get_class($component);
        view()->composer($viewed, function() use($keyname, $classname) {
            $collection = !Registry::isRegistered($keyname) ? new Collection() : Registry::get($keyname);
            if (!$collection->contains($classname)) {
                $collection->push($classname);
            }
            Registry::set($keyname, $collection);
        });
    }