-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* show remote image link * fix: added and fixed ui test * fix: pr reviews * temp: added web node * Revert "temp: added web node" This reverts commit bfd9a69. * fix: clean up * fix: web node * fix: remove time delay when calculating web view height * fix: keep style attributes * ui test * fix: unit test * feat: added ability to inspect web view * fix: pr reviews * fix: pr reviews * fix: pr reviews
- Loading branch information
Showing
23 changed files
with
485 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
// | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
public extension String { | ||
var hasContent: Bool { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// | ||
// ThreadDetailWebNode.swift | ||
// FlowCryptUI | ||
// | ||
// Created by Ioan Moldoan on 11/16/23 | ||
// Copyright © 2017-present FlowCrypt a. s. All rights reserved. | ||
// | ||
|
||
import AsyncDisplayKit | ||
|
||
public final class ThreadDetailWebNode: CellNode { | ||
public struct Input { | ||
let message: String? | ||
let index: Int | ||
|
||
public init(message: String?, index: Int) { | ||
self.message = message | ||
self.index = index | ||
} | ||
} | ||
|
||
private let input: ThreadDetailWebNode.Input | ||
|
||
private lazy var webViewNode: CustomWebViewNode = { | ||
let node = CustomWebViewNode() | ||
node.setAccessibilityIdentifier(accessibilityIdentifier: "aid-message-\(input.index)") | ||
node.setHtml(""" | ||
<header> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no"> | ||
<style> | ||
* { font-family: -apple-system, "Helvetica Neue", sans-serif; } | ||
:root { color-scheme: light dark; supported-color-schemes: light dark; } | ||
@media (prefers-color-scheme: dark) { | ||
:root { | ||
background-color: #2D2C2E; | ||
color: white; | ||
} | ||
a { | ||
color: #1783FD; | ||
} | ||
} | ||
html, body { padding: 0 !important; margin: 0 !important; } | ||
</style> | ||
</header> | ||
\(input.message ?? "") | ||
""") | ||
node.style.flexGrow = 1.0 | ||
return node | ||
}() | ||
|
||
public init(input: ThreadDetailWebNode.Input) { | ||
self.input = input | ||
|
||
super.init() | ||
addLeftBorder(width: .threadLeftBorderWidth, color: .plainTextBorder) | ||
} | ||
|
||
override public func layoutSpecThatFits(_: ASSizeRange) -> ASLayoutSpec { | ||
let specChild: ASLayoutElement | ||
|
||
specChild = webViewNode | ||
|
||
return ASInsetLayoutSpec( | ||
insets: .threadMessageInsets, | ||
child: specChild | ||
) | ||
} | ||
} |
Oops, something went wrong.