Skip to content

Commit

Permalink
Release 30.28.0
Browse files Browse the repository at this point in the history
commit_hash:ca3a1af8da93357f37c2e9cc851385359816f32a
  • Loading branch information
robot-divkit committed Nov 25, 2024
1 parent 8c5d43e commit 8e5f700
Show file tree
Hide file tree
Showing 11 changed files with 155 additions and 19 deletions.
5 changes: 5 additions & 0 deletions .mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,7 @@
"Specs/DivKit/30.25.0/DivKit.podspec":"divkit/public-ios/Specs/DivKit/30.25.0/DivKit.podspec",
"Specs/DivKit/30.26.0/DivKit.podspec":"divkit/public-ios/Specs/DivKit/30.26.0/DivKit.podspec",
"Specs/DivKit/30.27.0/DivKit.podspec":"divkit/public-ios/Specs/DivKit/30.27.0/DivKit.podspec",
"Specs/DivKit/30.28.0/DivKit.podspec":"divkit/public-ios/Specs/DivKit/30.28.0/DivKit.podspec",
"Specs/DivKit/30.3.0/DivKit.podspec":"divkit/public-ios/Specs/DivKit/30.3.0/DivKit.podspec",
"Specs/DivKit/30.4.0/DivKit.podspec":"divkit/public-ios/Specs/DivKit/30.4.0/DivKit.podspec",
"Specs/DivKit/30.5.0/DivKit.podspec":"divkit/public-ios/Specs/DivKit/30.5.0/DivKit.podspec",
Expand Down Expand Up @@ -1071,6 +1072,7 @@
"Specs/DivKitExtensions/30.25.0/DivKitExtensions.podspec":"divkit/public-ios/Specs/DivKitExtensions/30.25.0/DivKitExtensions.podspec",
"Specs/DivKitExtensions/30.26.0/DivKitExtensions.podspec":"divkit/public-ios/Specs/DivKitExtensions/30.26.0/DivKitExtensions.podspec",
"Specs/DivKitExtensions/30.27.0/DivKitExtensions.podspec":"divkit/public-ios/Specs/DivKitExtensions/30.27.0/DivKitExtensions.podspec",
"Specs/DivKitExtensions/30.28.0/DivKitExtensions.podspec":"divkit/public-ios/Specs/DivKitExtensions/30.28.0/DivKitExtensions.podspec",
"Specs/DivKitExtensions/30.3.0/DivKitExtensions.podspec":"divkit/public-ios/Specs/DivKitExtensions/30.3.0/DivKitExtensions.podspec",
"Specs/DivKitExtensions/30.4.0/DivKitExtensions.podspec":"divkit/public-ios/Specs/DivKitExtensions/30.4.0/DivKitExtensions.podspec",
"Specs/DivKitExtensions/30.5.0/DivKitExtensions.podspec":"divkit/public-ios/Specs/DivKitExtensions/30.5.0/DivKitExtensions.podspec",
Expand Down Expand Up @@ -1132,6 +1134,7 @@
"Specs/DivKit_LayoutKit/30.25.0/DivKit_LayoutKit.podspec":"divkit/public-ios/Specs/DivKit_LayoutKit/30.25.0/DivKit_LayoutKit.podspec",
"Specs/DivKit_LayoutKit/30.26.0/DivKit_LayoutKit.podspec":"divkit/public-ios/Specs/DivKit_LayoutKit/30.26.0/DivKit_LayoutKit.podspec",
"Specs/DivKit_LayoutKit/30.27.0/DivKit_LayoutKit.podspec":"divkit/public-ios/Specs/DivKit_LayoutKit/30.27.0/DivKit_LayoutKit.podspec",
"Specs/DivKit_LayoutKit/30.28.0/DivKit_LayoutKit.podspec":"divkit/public-ios/Specs/DivKit_LayoutKit/30.28.0/DivKit_LayoutKit.podspec",
"Specs/DivKit_LayoutKit/30.3.0/DivKit_LayoutKit.podspec":"divkit/public-ios/Specs/DivKit_LayoutKit/30.3.0/DivKit_LayoutKit.podspec",
"Specs/DivKit_LayoutKit/30.4.0/DivKit_LayoutKit.podspec":"divkit/public-ios/Specs/DivKit_LayoutKit/30.4.0/DivKit_LayoutKit.podspec",
"Specs/DivKit_LayoutKit/30.5.0/DivKit_LayoutKit.podspec":"divkit/public-ios/Specs/DivKit_LayoutKit/30.5.0/DivKit_LayoutKit.podspec",
Expand Down Expand Up @@ -1193,6 +1196,7 @@
"Specs/DivKit_LayoutKitInterface/30.25.0/DivKit_LayoutKitInterface.podspec":"divkit/public-ios/Specs/DivKit_LayoutKitInterface/30.25.0/DivKit_LayoutKitInterface.podspec",
"Specs/DivKit_LayoutKitInterface/30.26.0/DivKit_LayoutKitInterface.podspec":"divkit/public-ios/Specs/DivKit_LayoutKitInterface/30.26.0/DivKit_LayoutKitInterface.podspec",
"Specs/DivKit_LayoutKitInterface/30.27.0/DivKit_LayoutKitInterface.podspec":"divkit/public-ios/Specs/DivKit_LayoutKitInterface/30.27.0/DivKit_LayoutKitInterface.podspec",
"Specs/DivKit_LayoutKitInterface/30.28.0/DivKit_LayoutKitInterface.podspec":"divkit/public-ios/Specs/DivKit_LayoutKitInterface/30.28.0/DivKit_LayoutKitInterface.podspec",
"Specs/DivKit_LayoutKitInterface/30.3.0/DivKit_LayoutKitInterface.podspec":"divkit/public-ios/Specs/DivKit_LayoutKitInterface/30.3.0/DivKit_LayoutKitInterface.podspec",
"Specs/DivKit_LayoutKitInterface/30.4.0/DivKit_LayoutKitInterface.podspec":"divkit/public-ios/Specs/DivKit_LayoutKitInterface/30.4.0/DivKit_LayoutKitInterface.podspec",
"Specs/DivKit_LayoutKitInterface/30.5.0/DivKit_LayoutKitInterface.podspec":"divkit/public-ios/Specs/DivKit_LayoutKitInterface/30.5.0/DivKit_LayoutKitInterface.podspec",
Expand Down Expand Up @@ -1254,6 +1258,7 @@
"Specs/DivKit_Serialization/30.25.0/DivKit_Serialization.podspec":"divkit/public-ios/Specs/DivKit_Serialization/30.25.0/DivKit_Serialization.podspec",
"Specs/DivKit_Serialization/30.26.0/DivKit_Serialization.podspec":"divkit/public-ios/Specs/DivKit_Serialization/30.26.0/DivKit_Serialization.podspec",
"Specs/DivKit_Serialization/30.27.0/DivKit_Serialization.podspec":"divkit/public-ios/Specs/DivKit_Serialization/30.27.0/DivKit_Serialization.podspec",
"Specs/DivKit_Serialization/30.28.0/DivKit_Serialization.podspec":"divkit/public-ios/Specs/DivKit_Serialization/30.28.0/DivKit_Serialization.podspec",
"Specs/DivKit_Serialization/30.3.0/DivKit_Serialization.podspec":"divkit/public-ios/Specs/DivKit_Serialization/30.3.0/DivKit_Serialization.podspec",
"Specs/DivKit_Serialization/30.4.0/DivKit_Serialization.podspec":"divkit/public-ios/Specs/DivKit_Serialization/30.4.0/DivKit_Serialization.podspec",
"Specs/DivKit_Serialization/30.5.0/DivKit_Serialization.podspec":"divkit/public-ios/Specs/DivKit_Serialization/30.5.0/DivKit_Serialization.podspec",
Expand Down
2 changes: 1 addition & 1 deletion DivKit/DivKitInfo.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
public enum DivKitInfo {
public static let version = "30.27.0"
public static let version = "30.28.0"
}
18 changes: 9 additions & 9 deletions DivKit/Expressions/FunctionsProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ final class FunctionsProvider {
self.persistentValuesStorage = persistentValuesStorage
}

static let methods: [String: Function] = {
var methods: [String: Function] = [:]
methods.addArrayMethods()
methods.addDictMethods()
methods.addToStringFunctions()
return methods
}()

lazy var functions: [String: Function] =
lock.withLock {
var functions = staticFunctions
Expand Down Expand Up @@ -50,7 +58,7 @@ final class FunctionsProvider {
)
)
case let .method(name):
return FunctionEvaluator(symbol, functions: methods)
return FunctionEvaluator(symbol, functions: FunctionsProvider.methods)
case .postfix:
return nil
}
Expand Down Expand Up @@ -168,14 +176,6 @@ private let operators: [CalcExpression.Symbol: Function] = {
return operators
}()

private let methods: [String: Function] = {
var methods: [String: Function] = [:]
methods.addArrayMethods()
methods.addDictMethods()
methods.addToStringFunctions()
return methods
}()

extension [String: Function] {
mutating func addFunction(_ name: String, _ function: Function) {
var functions: [SimpleFunction] = []
Expand Down
3 changes: 3 additions & 0 deletions DivKit/Form/DivNetworkSubmitter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ final public class DivNetworkSubmitter: DivSubmitter {
urlRequest.setValue(header.value, forHTTPHeaderField: header.key)
}
urlRequest.httpMethod = request.method
if let body = try? JSONSerialization.data(withJSONObject: data) {
urlRequest.httpBody = body
}

var task: NetworkTask?
task = requestPerformer.performRequest(urlRequest) { [weak self] in
Expand Down
25 changes: 17 additions & 8 deletions LayoutKit/LayoutKit/Tooltips/TooltipManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class DefaultTooltipManager: TooltipManager {
private var handleAction: (UIActionEvent) -> Void
private var existingAnchorViews = WeakCollection<TooltipAnchorView>()
private var showingTooltips = [String: TooltipContainerView]()
private var tooltipWindow: UIWindow?
private(set) var tooltipWindow: UIWindow?
private var previousOrientation = UIDevice.current.orientation

public init(
Expand All @@ -99,7 +99,7 @@ public class DefaultTooltipManager: TooltipManager {

let windowBounds = tooltipWindow.bounds.inset(by: tooltipWindow.safeAreaInsets)
guard !showingTooltips.keys.contains(info.id),
let tooltip = existingAnchorViews.compactMap({
let tooltip = existingAnchorViews.compactMap({
$0?.makeTooltip(id: info.id, in: windowBounds)
}).first
else { return }
Expand All @@ -115,7 +115,8 @@ public class DefaultTooltipManager: TooltipManager {
)
// Passing the statusBarStyle control to `rootViewController` of the main window
let vc = ProxyViewController(
viewController: UIApplication.shared.delegate?.window??.rootViewController ?? UIViewController()
viewController: UIApplication.shared.delegate?.window??
.rootViewController ?? UIViewController()
)
vc.view = view
// Window won't rotate if `rootViewController` is not set
Expand Down Expand Up @@ -159,7 +160,7 @@ public class DefaultTooltipManager: TooltipManager {
)
}

@objc func orientationDidChange(_ notification: Notification) {
@objc func orientationDidChange(_: Notification) {
let orientation = UIDevice.current.orientation
guard orientation != previousOrientation, !orientation.isFlat else { return }
if !(orientation.isPortrait && previousOrientation.isPortrait) {
Expand All @@ -181,18 +182,25 @@ public class DefaultTooltipManager: TooltipManager {
}

extension TooltipAnchorView {
fileprivate func makeTooltip(id: String, in constraint: CGRect) -> DefaultTooltipManager.Tooltip? {
fileprivate func makeTooltip(
id: String,
in constraint: CGRect
) -> DefaultTooltipManager.Tooltip? {
tooltips
.first { $0.id == id }
.flatMap {
let tooltip = $0
let targetRect = window != nil ?
convert(bounds, to: nil) :
frame

return DefaultTooltipManager.Tooltip(
id: tooltip.id,
duration: tooltip.duration,
view: {
let tooltipView = tooltip.tooltipViewFactory?.value ?? tooltip.block.makeBlockView()
tooltipView.frame = tooltip.calculateFrame(
targeting: convert(bounds, to: nil),
targeting: targetRect,
constrainedBy: constraint
)
return tooltipView
Expand All @@ -210,10 +218,11 @@ private final class ProxyViewController: UIViewController {
super.init(nibName: nil, bundle: nil)
}

required init?(coder: NSCoder) {
@available(*, unavailable)
required init?(coder _: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override var preferredStatusBarStyle: UIStatusBarStyle {
viewController.preferredStatusBarStyle
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,10 @@ private final class TextInputBlockView: BlockView, VisibleBoundsTrackingLeaf {
guard let typo else { return }
let attributedText = text.with(typo: typo)
multiLineInput.attributedText = attributedText
singleLineInput.attributedText = attributedText
if let selectedRange = singleLineInput.selectedTextRange {
singleLineInput.attributedText = attributedText
singleLineInput.selectedTextRange = selectedRange
}
multiLineInput.typingAttributes = typo.attributes
singleLineInput.defaultTextAttributes = typo.attributes
}
Expand Down
24 changes: 24 additions & 0 deletions Specs/DivKit/30.28.0/DivKit.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Pod::Spec.new do |s|
s.name = 'DivKit'
s.version = '30.28.0'
s.summary = 'DivKit framework'
s.description = 'DivKit is a backend-driven UI framework'
s.homepage = 'https://divkit.tech'

s.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE' }
s.author = { 'divkit' => '[email protected]' }
s.source = { :git => 'https://github.com/divkit/divkit-ios.git', :tag => s.version.to_s }

s.swift_version = '5.9'
s.requires_arc = true
s.prefix_header_file = false
s.platforms = { :ios => '13.0' }

s.dependency 'DivKit_LayoutKit', s.version.to_s
s.dependency 'DivKit_Serialization', s.version.to_s
s.dependency 'VGSL', '~> 6.0'

s.source_files = [
'DivKit/**/*'
]
end
22 changes: 22 additions & 0 deletions Specs/DivKitExtensions/30.28.0/DivKitExtensions.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Pod::Spec.new do |s|
s.name = 'DivKitExtensions'
s.version = '30.28.0'
s.summary = 'DivKit framework extensions'
s.description = 'Part of DivKit framework'
s.homepage = 'https://divkit.tech'

s.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE' }
s.author = { 'divkit' => '[email protected]' }
s.source = { :git => 'https://github.com/divkit/divkit-ios.git', :tag => s.version.to_s }

s.swift_version = '5.9'
s.requires_arc = true
s.prefix_header_file = false
s.platforms = { :ios => '13.0' }

s.dependency 'DivKit', s.version.to_s

s.source_files = [
'DivKitExtensions/**/*'
]
end
24 changes: 24 additions & 0 deletions Specs/DivKit_LayoutKit/30.28.0/DivKit_LayoutKit.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Pod::Spec.new do |s|
s.name = 'DivKit_LayoutKit'
s.module_name = 'LayoutKit'
s.version = '30.28.0'
s.summary = 'Part of DivKit framework'
s.description = 'Part of DivKit framework'
s.homepage = 'https://divkit.tech'

s.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE' }
s.author = { 'divkit' => '[email protected]' }
s.source = { :git => 'https://github.com/divkit/divkit-ios.git', :tag => s.version.to_s }

s.swift_version = '5.9'
s.requires_arc = true
s.prefix_header_file = false
s.platforms = { :ios => '13.0' }

s.dependency 'DivKit_LayoutKitInterface', s.version.to_s
s.dependency 'VGSL', '~> 6.0'

s.source_files = [
'LayoutKit/LayoutKit/**/*'
]
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Pod::Spec.new do |s|
s.name = 'DivKit_LayoutKitInterface'
s.module_name = 'LayoutKitInterface'
s.version = '30.28.0'
s.summary = 'Part of DivKit framework'
s.description = 'Part of DivKit framework'
s.homepage = 'https://divkit.tech'

s.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE' }
s.author = { 'divkit' => '[email protected]' }
s.source = { :git => 'https://github.com/divkit/divkit-ios.git', :tag => s.version.to_s }

s.swift_version = '5.9'
s.requires_arc = true
s.prefix_header_file = false
s.platforms = { :ios => '13.0' }

s.dependency 'VGSL', '~> 6.0'

s.source_files = [
'LayoutKit/Interface/**/*'
]
end
23 changes: 23 additions & 0 deletions Specs/DivKit_Serialization/30.28.0/DivKit_Serialization.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Pod::Spec.new do |s|
s.name = 'DivKit_Serialization'
s.module_name = 'Serialization'
s.version = '30.28.0'
s.summary = 'Part of DivKit framework'
s.description = 'Part of DivKit framework'
s.homepage = 'https://divkit.tech'

s.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE' }
s.author = { 'divkit' => '[email protected]' }
s.source = { :git => 'https://github.com/divkit/divkit-ios.git', :tag => s.version.to_s }

s.swift_version = '5.9'
s.requires_arc = true
s.prefix_header_file = false
s.platforms = { :ios => '13.0' }

s.dependency 'VGSL', '~> 6.0'

s.source_files = [
'Serialization/**/*'
]
end

0 comments on commit 8e5f700

Please sign in to comment.