Skip to content

Releases: NuPlay/RichText

2.4.1

20 Apr 07:16
8abbc59
Compare
Choose a tag to compare

⭐ What's Changed

  • feat: Add PrivacyInfo.xcprivacy file for issue #50 by @NuPlay in #51

Full Changelog: 2.4.0...2.4.1

2.4.0

01 Apr 14:29
d7eaa4f
Compare
Choose a tag to compare

⭐ What's Changed

  • #46 LinkOpenType Custom Handling for All URL Schemes by @NuPlay in #47
  • Allow setting the WebKit baseURL for requests to something other than the Bundle by @ohmantics in #48

🐛 Bug fix

👍 New Contributors

Full Changelog: 2.3.1...2.4.0

V.2.3.1

21 Jan 11:58
63cb8b2
Compare
Choose a tag to compare

⭐ What's Changed

✨ [Feature]: Add custom type to LinkOpenType by @vidalhara in #42

public enum LinkOpenType {
   #if canImport(UIKit)
   case SFSafariView(configuration: SFSafariViewController.Configuration = .init(), isReaderActivated: Bool? = nil, isAnimated: Bool = true)
   #endif
   case Safari
   case custom((URL) -> Void)
   case none
}

🐛 [Fix] Always call decisionHandler on webview navigationAction by @filip-zielinski in #43

👍 New Contributors

Full Changelog: 2.3.0...2.3.1

v2.3.0

16 Jul 14:34
ff468d1
Compare
Choose a tag to compare

✨ Support macOS

Now available for iOS 13 and macOS 10.15 and later.

let package = Package(
    name: "RichText",
    platforms: [
        .iOS("13.0"),
        .macOS("10.15")
    ],
...
)

This update resolves the issue mentioned in #34 and has been implemented through PR #36

♻️ linkOpenType Default Value is Changed

  • Default value for linkOpenType is changed to .Safari.
    • Previous: .SFSafariView()
    • Reason: SFSafariView is not possible on macOS.
//previous
linkOpenType: LinkOpenType = .SFSafariView()

//now
linkOpenType: LinkOpenType = .Safari
public enum LinkOpenType {
    #if canImport(UIKit)
    case SFSafariView(configuration: SFSafariViewController.Configuration = .init(), isReaderActivated: Bool? = nil, isAnimated: Bool = true)
    #endif
    case Safari
    case none
}

👍 Contributors

Thanks to @studiogaram

v2.2.1

02 May 16:39
6e14ec7
Compare
Choose a tag to compare

✨ Improvements

Safely handle nil value in dynamic height update for WKWebView

  • Updated webView(_:didFinish:navigation:) method to use optional binding for safely extracting height value.
  • Set dynamicHeight to 0 if height is nil.
 public func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
    webView.evaluateJavaScript("document.getElementById(\"NuPlay_RichText\").offsetHeight", completionHandler: { (height, _) in
        DispatchQueue.main.async {
            if let height = height as? CGFloat {
                withAnimation(self.parent.conf.transition) {
                    self.parent.dynamicHeight = height
                }
            } else {
                self.parent.dynamicHeight = 0
            }
        }
    })
}

This update resolves the issue mentioned in #32 and has been implemented through PR #33.

v2.2.0

08 Mar 13:14
b104bcf
Compare
Choose a tag to compare

✨ Dynamic height evaluation

struct MyHtmlView: View {
    let longHTML: String = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed est est, mattis vel ante sit amet, porttitor interdum dui. Nunc cursus lobortis ex, ut faucibus felis malesuada id. Vivamus in risus nec dolor ullamcorper tincidunt in at velit. Vestibulum nec mollis ipsum. Phasellus volutpat augue odio, ultricies accumsan magna eleifend tristique. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Pellentesque efficitur sem non dui ultricies sollicitudin eu eu sapien."
    let shortHTML: String = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed est est, mattis vel ante sit amet, porttitor interdum dui. Nunc cursus lobortis ex, ut faucibus felis malesuada id."
    
    @State private var isExpanded: Bool = false
    
    var body: some View {
        VStack {
            RichText(html: isExpanded ? longHTML : shortHTML)
                .lineHeight(120)
                .colorScheme(.auto)
                .transition(.easeOut)
                .background(Color.red)
            
            Button {
                isExpanded.toggle()
            } label: {
                Text("Show more/less")
            }
        }
    }
}

📝 Reanme of id

 <div id ="element">\(html)</div> // before
 <div id="NuPlay_RichText">\(html)</div> // after

Contributors

Thanks to @mirko-milovanovic-vidiemme

V2.1.3

07 Feb 17:07
6bd367c
Compare
Choose a tag to compare

🐛 Deep linking bug and crash fix

  • Change to open links(Deeplink) that don't start with http or https
    Also, fix a bug that caused a crash when trying to open a deep link
  • #25

V2.1.2

07 Feb 16:35
26bd7fa
Compare
Choose a tag to compare

✨ Add placeholder transition option

  • Now you can add a transition between placeholder and contents
  • #26

V2.1.1

06 Oct 02:28
48b840c
Compare
Choose a tag to compare

🐛 Custom fonts bug fix

V2.1.0

11 Sep 14:48
247a88b
Compare
Choose a tag to compare

✨ New Functions:

  • Handle mailto: and tel:
  • Make configuration public

📝 Update README

  • Modified to match the changed code
  • Add modifier description

Contributors

Thanks to @ChaosCoder #20