Used version 1.2021.01
@startumlpackage P { class A $shared class B}remove *restore $shared@enduml
Same thing goes to show/hide as well.
(--------)