Skip to content

Commit

Permalink
Release 28.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
robot-divkit committed Nov 13, 2023
1 parent ba65588 commit 210aef7
Show file tree
Hide file tree
Showing 15 changed files with 158 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,7 @@
"Specs/DivKit/28.0.0/DivKit.podspec":"divkit/public-ios/Specs/DivKit/28.0.0/DivKit.podspec",
"Specs/DivKit/28.0.1/DivKit.podspec":"divkit/public-ios/Specs/DivKit/28.0.1/DivKit.podspec",
"Specs/DivKit/28.1.0/DivKit.podspec":"divkit/public-ios/Specs/DivKit/28.1.0/DivKit.podspec",
"Specs/DivKit/28.10.0/DivKit.podspec":"divkit/public-ios/Specs/DivKit/28.10.0/DivKit.podspec",
"Specs/DivKit/28.2.0/DivKit.podspec":"divkit/public-ios/Specs/DivKit/28.2.0/DivKit.podspec",
"Specs/DivKit/28.3.0/DivKit.podspec":"divkit/public-ios/Specs/DivKit/28.3.0/DivKit.podspec",
"Specs/DivKit/28.4.0/DivKit.podspec":"divkit/public-ios/Specs/DivKit/28.4.0/DivKit.podspec",
Expand Down Expand Up @@ -842,6 +843,7 @@
"Specs/DivKitExtensions/28.0.0/DivKitExtensions.podspec":"divkit/public-ios/Specs/DivKitExtensions/28.0.0/DivKitExtensions.podspec",
"Specs/DivKitExtensions/28.0.1/DivKitExtensions.podspec":"divkit/public-ios/Specs/DivKitExtensions/28.0.1/DivKitExtensions.podspec",
"Specs/DivKitExtensions/28.1.0/DivKitExtensions.podspec":"divkit/public-ios/Specs/DivKitExtensions/28.1.0/DivKitExtensions.podspec",
"Specs/DivKitExtensions/28.10.0/DivKitExtensions.podspec":"divkit/public-ios/Specs/DivKitExtensions/28.10.0/DivKitExtensions.podspec",
"Specs/DivKitExtensions/28.2.0/DivKitExtensions.podspec":"divkit/public-ios/Specs/DivKitExtensions/28.2.0/DivKitExtensions.podspec",
"Specs/DivKitExtensions/28.3.0/DivKitExtensions.podspec":"divkit/public-ios/Specs/DivKitExtensions/28.3.0/DivKitExtensions.podspec",
"Specs/DivKitExtensions/28.4.0/DivKitExtensions.podspec":"divkit/public-ios/Specs/DivKitExtensions/28.4.0/DivKitExtensions.podspec",
Expand All @@ -852,6 +854,7 @@
"Specs/DivKitExtensions/28.9.0/DivKitExtensions.podspec":"divkit/public-ios/Specs/DivKitExtensions/28.9.0/DivKitExtensions.podspec",
"Specs/DivKit_LayoutKit/28.0.1/DivKit_LayoutKit.podspec":"divkit/public-ios/Specs/DivKit_LayoutKit/28.0.1/DivKit_LayoutKit.podspec",
"Specs/DivKit_LayoutKit/28.1.0/DivKit_LayoutKit.podspec":"divkit/public-ios/Specs/DivKit_LayoutKit/28.1.0/DivKit_LayoutKit.podspec",
"Specs/DivKit_LayoutKit/28.10.0/DivKit_LayoutKit.podspec":"divkit/public-ios/Specs/DivKit_LayoutKit/28.10.0/DivKit_LayoutKit.podspec",
"Specs/DivKit_LayoutKit/28.2.0/DivKit_LayoutKit.podspec":"divkit/public-ios/Specs/DivKit_LayoutKit/28.2.0/DivKit_LayoutKit.podspec",
"Specs/DivKit_LayoutKit/28.3.0/DivKit_LayoutKit.podspec":"divkit/public-ios/Specs/DivKit_LayoutKit/28.3.0/DivKit_LayoutKit.podspec",
"Specs/DivKit_LayoutKit/28.4.0/DivKit_LayoutKit.podspec":"divkit/public-ios/Specs/DivKit_LayoutKit/28.4.0/DivKit_LayoutKit.podspec",
Expand All @@ -862,6 +865,7 @@
"Specs/DivKit_LayoutKit/28.9.0/DivKit_LayoutKit.podspec":"divkit/public-ios/Specs/DivKit_LayoutKit/28.9.0/DivKit_LayoutKit.podspec",
"Specs/DivKit_LayoutKitInterface/28.0.1/DivKit_LayoutKitInterface.podspec":"divkit/public-ios/Specs/DivKit_LayoutKitInterface/28.0.1/DivKit_LayoutKitInterface.podspec",
"Specs/DivKit_LayoutKitInterface/28.1.0/DivKit_LayoutKitInterface.podspec":"divkit/public-ios/Specs/DivKit_LayoutKitInterface/28.1.0/DivKit_LayoutKitInterface.podspec",
"Specs/DivKit_LayoutKitInterface/28.10.0/DivKit_LayoutKitInterface.podspec":"divkit/public-ios/Specs/DivKit_LayoutKitInterface/28.10.0/DivKit_LayoutKitInterface.podspec",
"Specs/DivKit_LayoutKitInterface/28.2.0/DivKit_LayoutKitInterface.podspec":"divkit/public-ios/Specs/DivKit_LayoutKitInterface/28.2.0/DivKit_LayoutKitInterface.podspec",
"Specs/DivKit_LayoutKitInterface/28.3.0/DivKit_LayoutKitInterface.podspec":"divkit/public-ios/Specs/DivKit_LayoutKitInterface/28.3.0/DivKit_LayoutKitInterface.podspec",
"Specs/DivKit_LayoutKitInterface/28.4.0/DivKit_LayoutKitInterface.podspec":"divkit/public-ios/Specs/DivKit_LayoutKitInterface/28.4.0/DivKit_LayoutKitInterface.podspec",
Expand All @@ -872,6 +876,7 @@
"Specs/DivKit_LayoutKitInterface/28.9.0/DivKit_LayoutKitInterface.podspec":"divkit/public-ios/Specs/DivKit_LayoutKitInterface/28.9.0/DivKit_LayoutKitInterface.podspec",
"Specs/DivKit_Serialization/28.0.1/DivKit_Serialization.podspec":"divkit/public-ios/Specs/DivKit_Serialization/28.0.1/DivKit_Serialization.podspec",
"Specs/DivKit_Serialization/28.1.0/DivKit_Serialization.podspec":"divkit/public-ios/Specs/DivKit_Serialization/28.1.0/DivKit_Serialization.podspec",
"Specs/DivKit_Serialization/28.10.0/DivKit_Serialization.podspec":"divkit/public-ios/Specs/DivKit_Serialization/28.10.0/DivKit_Serialization.podspec",
"Specs/DivKit_Serialization/28.2.0/DivKit_Serialization.podspec":"divkit/public-ios/Specs/DivKit_Serialization/28.2.0/DivKit_Serialization.podspec",
"Specs/DivKit_Serialization/28.3.0/DivKit_Serialization.podspec":"divkit/public-ios/Specs/DivKit_Serialization/28.3.0/DivKit_Serialization.podspec",
"Specs/DivKit_Serialization/28.4.0/DivKit_Serialization.podspec":"divkit/public-ios/Specs/DivKit_Serialization/28.4.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 = "28.9.0"
public static let version = "28.10.0"
}
1 change: 1 addition & 0 deletions DivKit/Extensions/DivBase/DivBaseExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ extension DivBase {
)
.addingEdgeInsets(externalInsets, clipsToBounds: false)
.addingDecorations(
boundary: transform.resolveRotation(expressionResolver).flatMap { _ in .noClip },
alpha: CGFloat(resolveAlpha(expressionResolver)),
accessibilityElement: customA11yElement ?? makeAccessibilityElement(
accessibility,
Expand Down
10 changes: 9 additions & 1 deletion DivKit/Extensions/DivInputExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ extension DivInput {
return TextInputValidator(
isValid: context.makeBinding(variableName: regexValidator.variable, defaultValue: false),
allowEmpty: regexValidator.resolveAllowEmpty(expressionResolver),
validator: { $0.matchesRegex(regex) },
validator: { $0.fullMatchesRegex(regex) },
message: makeMessage(
from: regexValidator.resolveLabelId(expressionResolver),
storage: context.blockStateStorage,
Expand Down Expand Up @@ -231,3 +231,11 @@ extension DivFixedLengthInputMask.PatternElement {
)
}
}

extension String {
fileprivate func fullMatchesRegex(_ regex: NSRegularExpression) -> Bool {
let range = stringRangeAsNSRange(wholeStringRange, inString: self)
return regex.matches(in: self, options: [], range: range)
.contains { $0.range == range }
}
}
6 changes: 5 additions & 1 deletion DivKit/Variables/DivVariablesStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ public final class DivVariablesStorage {
)
}

public init(outerStorage: DivVariableStorage? = nil) {
public convenience init() {
self.init(outerStorage: nil)
}

public init(outerStorage: DivVariableStorage?) {
globalStorage = DivVariableStorage(outerStorage: outerStorage)

weak var weakSelf: DivVariablesStorage?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ extension Block {
heightTrait: isVerticallyResizable ? .resizable : .intrinsic,
children: [self],
anchorPoint: anchorPoint,
childrenTransform: transform
childrenTransform: transform,
clipContent: false
)
}

Expand Down
1 change: 1 addition & 0 deletions LayoutKit/LayoutKit/Blocks/TextInputBlock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ extension TextInputBlock {
&& lhs.heightTrait == rhs.heightTrait
&& lhs.hint == rhs.hint
&& lhs.textValue.value == rhs.textValue.value
&& lhs.rawTextValue?.value == rhs.rawTextValue?.value
&& lhs.multiLineMode == rhs.multiLineMode
&& lhs.maxVisibleLines == rhs.maxVisibleLines
&& lhs.inputType == rhs.inputType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private final class ContainerBlockView: UIView, BlockViewProtocol, VisibleBounds
y: frame.origin.y + model.anchorPoint.y.value(for: frame.height) * frame.height
)
view.transform = model.childrenTransform
view.layer.anchorPoint = model.anchorPoint.calculateCGPoint(for: view.frame)
view.layer.anchorPoint = model.anchorPoint.calculateCGPoint(for: view.bounds)
}

modelAndLastLayoutSize = (model: model, lastLayoutSize: bounds.size)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,31 +81,33 @@ private final class PagerView: BlockView {
renderingDelegate: renderingDelegate
)

let oldModel = self.model
let isNewModel = model != self.model
self.model = model
self.selectedActions = selectedActions

onMainThreadAsync {
if model != oldModel {
self.setState(state.synchronized(with: model), path: model.path, notifyingObservers: true)
if isNewModel {
onMainThreadAsync {
// do not update state if model has been changed already
if model == self.model {
self.setState(state.synchronized(with: model))
}
}
}
}

private func setState(_ state: PagerViewState, path: UIElementPath, notifyingObservers: Bool) {
private func setState(_ state: PagerViewState) {
let currentPage = state.currentPage
let path = model.path
currentPageIndex = FractionalPageIndex(rawValue: CGFloat(currentPage))
if lastState?.0 != path || lastState?.1 != state {
lastState = (model.path, state)
lastState = (path, state)

if notifyingObservers {
observer?.elementStateChanged(state, forPath: model.path)
}
observer?.elementStateChanged(state, forPath: path)

let pageIndex = Int(round(currentPage))

PagerSelectedPageChangedEvent(
path: model.path,
path: path,
selectedPageIndex: pageIndex
).sendFrom(self)

Expand Down Expand Up @@ -143,8 +145,7 @@ extension PagerView: ElementStateObserver {
PagerViewState(
numberOfPages: model.items.count,
currentPage: Int(pageIndex.rounded())
), path: model.path,
notifyingObservers: true
)
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PackageDescription
let vgsl = (
url: "https://github.com/yandex/vgsl.git",
packageName: "vgsl",
version: Version("2.3.0")
version: Version("2.3.3")
)

let package = Package(
Expand Down
25 changes: 25 additions & 0 deletions Specs/DivKit/28.10.0/DivKit.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Pod::Spec.new do |s|
s.name = 'DivKit'
s.version = '28.10.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' => 'divkit@yandex-team.ru' }
s.source = { :git => 'https://github.com/divkit/divkit-ios.git', :tag => s.version.to_s }

s.swift_version = '5.7'
s.requires_arc = true
s.prefix_header_file = false
s.platforms = { :ios => '11.0' }

s.dependency 'DivKit_LayoutKit', s.version.to_s
s.dependency 'DivKit_Serialization', s.version.to_s
s.dependency 'VGSLCommonCore', '~> 2.3'
s.dependency 'VGSLNetworking', '~> 2.3'

s.source_files = [
'DivKit/**/*'
]
end
22 changes: 22 additions & 0 deletions Specs/DivKitExtensions/28.10.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 = '28.10.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' => 'divkit@yandex-team.ru' }
s.source = { :git => 'https://github.com/divkit/divkit-ios.git', :tag => s.version.to_s }

s.swift_version = '5.7'
s.requires_arc = true
s.prefix_header_file = false
s.platforms = { :ios => '11.0' }

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

s.source_files = [
'DivKitExtensions/**/*'
]
end
24 changes: 24 additions & 0 deletions Specs/DivKit_LayoutKit/28.10.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 = '28.10.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' => 'divkit@yandex-team.ru' }
s.source = { :git => 'https://github.com/divkit/divkit-ios.git', :tag => s.version.to_s }

s.swift_version = '5.7'
s.requires_arc = true
s.prefix_header_file = false
s.platforms = { :ios => '11.0' }

s.dependency 'DivKit_LayoutKitInterface', s.version.to_s
s.dependency 'VGSLCommonCore', '~> 2.3'

s.source_files = [
'LayoutKit/LayoutKit/**/*'
]
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Pod::Spec.new do |s|
s.name = 'DivKit_LayoutKitInterface'
s.module_name = 'LayoutKitInterface'
s.version = '28.10.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' => 'divkit@yandex-team.ru' }
s.source = { :git => 'https://github.com/divkit/divkit-ios.git', :tag => s.version.to_s }

s.swift_version = '5.7'
s.requires_arc = true
s.prefix_header_file = false
s.platforms = { :ios => '11.0' }

s.dependency 'VGSLBase', '~> 2.3'
s.dependency 'VGSLBaseTiny', '~> 2.3'
s.dependency 'VGSLBaseUI', '~> 2.3'

s.source_files = [
'LayoutKit/Interface/**/*'
]
end
23 changes: 23 additions & 0 deletions Specs/DivKit_Serialization/28.10.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 = '28.10.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' => 'divkit@yandex-team.ru' }
s.source = { :git => 'https://github.com/divkit/divkit-ios.git', :tag => s.version.to_s }

s.swift_version = '5.7'
s.requires_arc = true
s.prefix_header_file = false
s.platforms = { :ios => '11.0' }

s.dependency 'VGSLCommonCore', '~> 2.3'

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

0 comments on commit 210aef7

Please sign in to comment.