MAXWELL + LibraryContentProvider + SPM Modifiers Configuration

Hey Hello,

We are thrilled to integrate LibraryContentProvider protocols with MAXWELL LUX (the first UI Look Development SDK for iOS https://apps.apple.com/us/app/id1511215075).

Version 12.0 beta (12A6159)
We imported the LUX framework as an SPM package:
https://github.com/maxwelldesign/lux

Next we created an APP template and modified the ContentView with the following implementation.

Expectation.
The Views and Modifiers would should in the Lirbary

Result
The following implementations failed:

Simple Passthrough
LibraryItem(base,title: "PASSTHROUGH", category: .other),

AnyView transform
LibraryItem(AnyView(base),title: "ANYVIEW TEST", category: .other),

Using modifier defined in SPM Framework
LibraryItem(base.lux.style(.buttonLarge),title: "LUX BUTTON LARGE", category: .other)

We are very interested in learning the correct way to configure for Using modifier defined in SPM Framework.



Code Block swift
import SwiftUI
import Lux
struct ContentView: View {
  var body: some View {
    Text("LibraryContentProvider Test").padding()
  }
}
struct ContentView_Previews: PreviewProvider {
  static var previews: some View {
    ContentView()
  }
}
extension View{
  func localModifier()->AnyView{
    AnyView(self)
  }
}
struct LibraryViewContent: LibraryContentProvider {
  @LibraryContentBuilder
  var views: [LibraryItem] {
     
   
    LibraryItem(ContentView().lux.view,title: "LUX VIEW TEST")
  }
   
   
  func modifiers(base: AnyView) -> [LibraryItem] {
    [
      LibraryItem(base.blur(radius: 1),title: "BLUR OK", category: .other),
      
      
      LibraryItem(base.localModifier(),title: "LOCAL MOD", category: .other),
      LibraryItem(base,title: "PASSTHROUGH", category: .other),
      LibraryItem(AnyView(base),title: "ANYVIEW TEST", category: .other),
      LibraryItem(base.lux.style(.buttonLarge),title: "LUX BUTTON LARGE", category: .other)
    ]
  }
}


PD. Thanks for making this wonderful tech possible. You are truly light wizards!


We did more testing and perhaps this is not related to the nature of SPM import.

It seems that the issue is related to returning a new instance using the AnyView( ) operator:

Code Block swift
struct LibraryViewContent: LibraryContentProvider {
   
  func modifiers(base: AnyView) -> [LibraryItem] {
    [
      LibraryItem(base.blur(radius: 1),title: "BLUR OK", category: .other),
      LibraryItem(AnyView(base.blur(radius: 1)),title: "BLUR FAIL", category: .other),
      
    ]
  }
}


It would be great if someone can confirm and propose a workaround.
MAXWELL + LibraryContentProvider + SPM Modifiers Configuration
 
 
Q