Skip to content

Commit

Permalink
Release 30.22.0
Browse files Browse the repository at this point in the history
commit_hash:673433a23714466a914a6ce468276cbf08d778f2
  • Loading branch information
robot-divkit committed Oct 14, 2024
1 parent 3389d29 commit 82752ce
Show file tree
Hide file tree
Showing 202 changed files with 21,190 additions and 11,266 deletions.
27 changes: 26 additions & 1 deletion .mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
"DivKit/Fonts/DivFontProvider.swift":"divkit/public-ios/DivKit/Fonts/DivFontProvider.swift",
"DivKit/Fonts/DivFontWeightExtensions.swift":"divkit/public-ios/DivKit/Fonts/DivFontWeightExtensions.swift",
"DivKit/Fonts/FontParams.swift":"divkit/public-ios/DivKit/Fonts/FontParams.swift",
"DivKit/IdToPath.swift":"divkit/public-ios/DivKit/IdToPath.swift",
"DivKit/LayoutProvider/DivLayoutProviderHandler.swift":"divkit/public-ios/DivKit/LayoutProvider/DivLayoutProviderHandler.swift",
"DivKit/LayoutProvider/SizeProviderBlock+UIViewRenderable.swift":"divkit/public-ios/DivKit/LayoutProvider/SizeProviderBlock+UIViewRenderable.swift",
"DivKit/LayoutProvider/SizeProviderBlock.swift":"divkit/public-ios/DivKit/LayoutProvider/SizeProviderBlock.swift",
Expand Down Expand Up @@ -219,16 +220,28 @@
"DivKit/generated_sources/DivActionCopyToClipboardTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivActionCopyToClipboardTemplate.swift",
"DivKit/generated_sources/DivActionDictSetValue.swift":"divkit/public-ios/DivKit/generated_sources/DivActionDictSetValue.swift",
"DivKit/generated_sources/DivActionDictSetValueTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivActionDictSetValueTemplate.swift",
"DivKit/generated_sources/DivActionDownload.swift":"divkit/public-ios/DivKit/generated_sources/DivActionDownload.swift",
"DivKit/generated_sources/DivActionDownloadTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivActionDownloadTemplate.swift",
"DivKit/generated_sources/DivActionFocusElement.swift":"divkit/public-ios/DivKit/generated_sources/DivActionFocusElement.swift",
"DivKit/generated_sources/DivActionFocusElementTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivActionFocusElementTemplate.swift",
"DivKit/generated_sources/DivActionHideTooltip.swift":"divkit/public-ios/DivKit/generated_sources/DivActionHideTooltip.swift",
"DivKit/generated_sources/DivActionHideTooltipTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivActionHideTooltipTemplate.swift",
"DivKit/generated_sources/DivActionScrollBy.swift":"divkit/public-ios/DivKit/generated_sources/DivActionScrollBy.swift",
"DivKit/generated_sources/DivActionScrollByTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivActionScrollByTemplate.swift",
"DivKit/generated_sources/DivActionScrollDestination.swift":"divkit/public-ios/DivKit/generated_sources/DivActionScrollDestination.swift",
"DivKit/generated_sources/DivActionScrollDestinationTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivActionScrollDestinationTemplate.swift",
"DivKit/generated_sources/DivActionScrollTo.swift":"divkit/public-ios/DivKit/generated_sources/DivActionScrollTo.swift",
"DivKit/generated_sources/DivActionScrollToTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivActionScrollToTemplate.swift",
"DivKit/generated_sources/DivActionSetState.swift":"divkit/public-ios/DivKit/generated_sources/DivActionSetState.swift",
"DivKit/generated_sources/DivActionSetStateTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivActionSetStateTemplate.swift",
"DivKit/generated_sources/DivActionSetStoredValue.swift":"divkit/public-ios/DivKit/generated_sources/DivActionSetStoredValue.swift",
"DivKit/generated_sources/DivActionSetStoredValueTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivActionSetStoredValueTemplate.swift",
"DivKit/generated_sources/DivActionSetVariable.swift":"divkit/public-ios/DivKit/generated_sources/DivActionSetVariable.swift",
"DivKit/generated_sources/DivActionSetVariableTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivActionSetVariableTemplate.swift",
"DivKit/generated_sources/DivActionShowTooltip.swift":"divkit/public-ios/DivKit/generated_sources/DivActionShowTooltip.swift",
"DivKit/generated_sources/DivActionShowTooltipTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivActionShowTooltipTemplate.swift",
"DivKit/generated_sources/DivActionSubmit.swift":"divkit/public-ios/DivKit/generated_sources/DivActionSubmit.swift",
"DivKit/generated_sources/DivActionSubmitTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivActionSubmitTemplate.swift",
"DivKit/generated_sources/DivActionTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivActionTemplate.swift",
"DivKit/generated_sources/DivActionTimer.swift":"divkit/public-ios/DivKit/generated_sources/DivActionTimer.swift",
"DivKit/generated_sources/DivActionTimerTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivActionTimerTemplate.swift",
Expand All @@ -244,7 +257,6 @@
"DivKit/generated_sources/DivAnimationTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivAnimationTemplate.swift",
"DivKit/generated_sources/DivAnimator.swift":"divkit/public-ios/DivKit/generated_sources/DivAnimator.swift",
"DivKit/generated_sources/DivAnimatorBase.swift":"divkit/public-ios/DivKit/generated_sources/DivAnimatorBase.swift",
"DivKit/generated_sources/DivAnimatorBaseTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivAnimatorBaseTemplate.swift",
"DivKit/generated_sources/DivAnimatorTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivAnimatorTemplate.swift",
"DivKit/generated_sources/DivAppearanceSetTransition.swift":"divkit/public-ios/DivKit/generated_sources/DivAppearanceSetTransition.swift",
"DivKit/generated_sources/DivAppearanceSetTransitionTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivAppearanceSetTransitionTemplate.swift",
Expand Down Expand Up @@ -474,6 +486,10 @@
"DivKit/generated_sources/DivVisibilityActionTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivVisibilityActionTemplate.swift",
"DivKit/generated_sources/DivWrapContentSize.swift":"divkit/public-ios/DivKit/generated_sources/DivWrapContentSize.swift",
"DivKit/generated_sources/DivWrapContentSizeTemplate.swift":"divkit/public-ios/DivKit/generated_sources/DivWrapContentSizeTemplate.swift",
"DivKit/generated_sources/EndDestination.swift":"divkit/public-ios/DivKit/generated_sources/EndDestination.swift",
"DivKit/generated_sources/EndDestinationTemplate.swift":"divkit/public-ios/DivKit/generated_sources/EndDestinationTemplate.swift",
"DivKit/generated_sources/IndexDestination.swift":"divkit/public-ios/DivKit/generated_sources/IndexDestination.swift",
"DivKit/generated_sources/IndexDestinationTemplate.swift":"divkit/public-ios/DivKit/generated_sources/IndexDestinationTemplate.swift",
"DivKit/generated_sources/IntegerValue.swift":"divkit/public-ios/DivKit/generated_sources/IntegerValue.swift",
"DivKit/generated_sources/IntegerValueTemplate.swift":"divkit/public-ios/DivKit/generated_sources/IntegerValueTemplate.swift",
"DivKit/generated_sources/IntegerVariable.swift":"divkit/public-ios/DivKit/generated_sources/IntegerVariable.swift",
Expand All @@ -482,6 +498,10 @@
"DivKit/generated_sources/NumberValueTemplate.swift":"divkit/public-ios/DivKit/generated_sources/NumberValueTemplate.swift",
"DivKit/generated_sources/NumberVariable.swift":"divkit/public-ios/DivKit/generated_sources/NumberVariable.swift",
"DivKit/generated_sources/NumberVariableTemplate.swift":"divkit/public-ios/DivKit/generated_sources/NumberVariableTemplate.swift",
"DivKit/generated_sources/OffsetDestination.swift":"divkit/public-ios/DivKit/generated_sources/OffsetDestination.swift",
"DivKit/generated_sources/OffsetDestinationTemplate.swift":"divkit/public-ios/DivKit/generated_sources/OffsetDestinationTemplate.swift",
"DivKit/generated_sources/StartDestination.swift":"divkit/public-ios/DivKit/generated_sources/StartDestination.swift",
"DivKit/generated_sources/StartDestinationTemplate.swift":"divkit/public-ios/DivKit/generated_sources/StartDestinationTemplate.swift",
"DivKit/generated_sources/StringValue.swift":"divkit/public-ios/DivKit/generated_sources/StringValue.swift",
"DivKit/generated_sources/StringValueTemplate.swift":"divkit/public-ios/DivKit/generated_sources/StringValueTemplate.swift",
"DivKit/generated_sources/StringVariable.swift":"divkit/public-ios/DivKit/generated_sources/StringVariable.swift",
Expand Down Expand Up @@ -947,6 +967,7 @@
"Specs/DivKit/30.2.0/DivKit.podspec":"divkit/public-ios/Specs/DivKit/30.2.0/DivKit.podspec",
"Specs/DivKit/30.20.0/DivKit.podspec":"divkit/public-ios/Specs/DivKit/30.20.0/DivKit.podspec",
"Specs/DivKit/30.21.0/DivKit.podspec":"divkit/public-ios/Specs/DivKit/30.21.0/DivKit.podspec",
"Specs/DivKit/30.22.0/DivKit.podspec":"divkit/public-ios/Specs/DivKit/30.22.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 @@ -1020,6 +1041,7 @@
"Specs/DivKitExtensions/30.2.0/DivKitExtensions.podspec":"divkit/public-ios/Specs/DivKitExtensions/30.2.0/DivKitExtensions.podspec",
"Specs/DivKitExtensions/30.20.0/DivKitExtensions.podspec":"divkit/public-ios/Specs/DivKitExtensions/30.20.0/DivKitExtensions.podspec",
"Specs/DivKitExtensions/30.21.0/DivKitExtensions.podspec":"divkit/public-ios/Specs/DivKitExtensions/30.21.0/DivKitExtensions.podspec",
"Specs/DivKitExtensions/30.22.0/DivKitExtensions.podspec":"divkit/public-ios/Specs/DivKitExtensions/30.22.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 @@ -1075,6 +1097,7 @@
"Specs/DivKit_LayoutKit/30.2.0/DivKit_LayoutKit.podspec":"divkit/public-ios/Specs/DivKit_LayoutKit/30.2.0/DivKit_LayoutKit.podspec",
"Specs/DivKit_LayoutKit/30.20.0/DivKit_LayoutKit.podspec":"divkit/public-ios/Specs/DivKit_LayoutKit/30.20.0/DivKit_LayoutKit.podspec",
"Specs/DivKit_LayoutKit/30.21.0/DivKit_LayoutKit.podspec":"divkit/public-ios/Specs/DivKit_LayoutKit/30.21.0/DivKit_LayoutKit.podspec",
"Specs/DivKit_LayoutKit/30.22.0/DivKit_LayoutKit.podspec":"divkit/public-ios/Specs/DivKit_LayoutKit/30.22.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 @@ -1130,6 +1153,7 @@
"Specs/DivKit_LayoutKitInterface/30.2.0/DivKit_LayoutKitInterface.podspec":"divkit/public-ios/Specs/DivKit_LayoutKitInterface/30.2.0/DivKit_LayoutKitInterface.podspec",
"Specs/DivKit_LayoutKitInterface/30.20.0/DivKit_LayoutKitInterface.podspec":"divkit/public-ios/Specs/DivKit_LayoutKitInterface/30.20.0/DivKit_LayoutKitInterface.podspec",
"Specs/DivKit_LayoutKitInterface/30.21.0/DivKit_LayoutKitInterface.podspec":"divkit/public-ios/Specs/DivKit_LayoutKitInterface/30.21.0/DivKit_LayoutKitInterface.podspec",
"Specs/DivKit_LayoutKitInterface/30.22.0/DivKit_LayoutKitInterface.podspec":"divkit/public-ios/Specs/DivKit_LayoutKitInterface/30.22.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 @@ -1185,6 +1209,7 @@
"Specs/DivKit_Serialization/30.2.0/DivKit_Serialization.podspec":"divkit/public-ios/Specs/DivKit_Serialization/30.2.0/DivKit_Serialization.podspec",
"Specs/DivKit_Serialization/30.20.0/DivKit_Serialization.podspec":"divkit/public-ios/Specs/DivKit_Serialization/30.20.0/DivKit_Serialization.podspec",
"Specs/DivKit_Serialization/30.21.0/DivKit_Serialization.podspec":"divkit/public-ios/Specs/DivKit_Serialization/30.21.0/DivKit_Serialization.podspec",
"Specs/DivKit_Serialization/30.22.0/DivKit_Serialization.podspec":"divkit/public-ios/Specs/DivKit_Serialization/30.22.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
56 changes: 51 additions & 5 deletions DivKit/Actions/DivActionHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public final class DivActionHandler {
private let blockStateStorage: DivBlockStateStorage
private let updateCard: DivActionURLHandler.UpdateCardAction
private let reporter: DivReporter
private let idToPath: IdToPath

private let arrayActionsHandler = ArrayActionsHandler()
private let dictSetValueActionHandler = DictSetValueActionHandler()
Expand All @@ -29,7 +30,7 @@ public final class DivActionHandler {
private let videoActionHandler = VideoActionHandler()

/// Deprecated. Do not create `DivActionHandler`. Use the instance from `DivKitComponents`.
public init(
public convenience init(
stateUpdater: DivStateUpdater,
blockStateStorage: DivBlockStateStorage = DivBlockStateStorage(),
patchProvider: DivPatchProvider,
Expand All @@ -45,6 +46,44 @@ public final class DivActionHandler {
urlHandler: DivUrlHandler,
persistentValuesStorage: DivPersistentValuesStorage = DivPersistentValuesStorage(),
reporter: DivReporter? = nil
) {
self.init(
stateUpdater: stateUpdater,
blockStateStorage: blockStateStorage,
patchProvider: patchProvider,
variablesStorage: variablesStorage,
functionsStorage: functionsStorage,
updateCard: updateCard,
showTooltip: showTooltip,
tooltipActionPerformer: tooltipActionPerformer,
logger: logger ?? EmptyDivActionLogger(),
trackVisibility: trackVisibility,
trackDisappear: trackDisappear,
performTimerAction: performTimerAction,
urlHandler: urlHandler,
persistentValuesStorage: persistentValuesStorage,
reporter: reporter ?? DefaultDivReporter(),
idToPath: IdToPath()
)
}

init(
stateUpdater: DivStateUpdater,
blockStateStorage: DivBlockStateStorage,
patchProvider: DivPatchProvider,
variablesStorage: DivVariablesStorage,
functionsStorage: DivFunctionsStorage?,
updateCard: @escaping DivActionURLHandler.UpdateCardAction,
showTooltip: DivActionURLHandler.ShowTooltipAction?,
tooltipActionPerformer: TooltipActionPerformer?,
logger: DivActionLogger,
trackVisibility: @escaping TrackVisibility,
trackDisappear: @escaping TrackVisibility,
performTimerAction: @escaping DivActionURLHandler.PerformTimerAction,
urlHandler: DivUrlHandler,
persistentValuesStorage: DivPersistentValuesStorage,
reporter: DivReporter,
idToPath: IdToPath
) {
self.divActionURLHandler = DivActionURLHandler(
stateUpdater: stateUpdater,
Expand All @@ -58,16 +97,17 @@ public final class DivActionHandler {
persistentValuesStorage: persistentValuesStorage
)
self.urlHandler = urlHandler
self.logger = logger ?? EmptyDivActionLogger()
self.logger = logger
self.trackVisibility = trackVisibility
self.trackDisappear = trackDisappear
self.variablesStorage = variablesStorage
self.functionsStorage = functionsStorage
self.persistentValuesStorage = persistentValuesStorage
self.blockStateStorage = blockStateStorage
self.updateCard = updateCard
self.reporter = reporter ?? DefaultDivReporter()
self.reporter = reporter
self.timerActionHandler = TimerActionHandler(performer: performTimerAction)
self.idToPath = idToPath
}

public func handle(
Expand Down Expand Up @@ -124,6 +164,11 @@ public final class DivActionHandler {
},
errorTracker: reporter.asExpressionErrorTracker(cardId: cardId)
)
let path = if let scopeId = action.scopeId {
idToPath[path.cardId.path + scopeId] ?? path
} else {
path
}
let context = DivActionHandlingContext(
path: path,
expressionResolver: expressionResolver,
Expand Down Expand Up @@ -154,8 +199,9 @@ public final class DivActionHandler {
timerActionHandler.handle(action, context: context)
case let .divActionVideo(action):
videoActionHandler.handle(action, context: context)
case .divActionAnimatorStart, .divActionAnimatorStop,
.divActionShowTooltip, .divActionSetState, .divActionHideTooltip:
case .divActionAnimatorStart, .divActionAnimatorStop, .divActionSubmit,
.divActionShowTooltip, .divActionHideTooltip, .divActionDownload,
.divActionSetState, .divActionSetStoredValue, .divActionScrollBy, .divActionScrollTo:
break
case .none:
isHandled = false
Expand Down
7 changes: 1 addition & 6 deletions DivKit/Debug/DebugParams.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,11 @@ public struct DebugParams {
#if os(iOS)
extension DebugParams {
public static func showDebugInfo(_ view: ViewType) {
let window: UIWindow? = if #available(iOS 13.0, *) {
(UIApplication.shared.connectedScenes.first as? UIWindowScene)?.windows.first
} else {
UIApplication.shared.windows.first
}
let window = (UIApplication.shared.connectedScenes.first as? UIWindowScene)?.windows.first
view.frame.center = window?.center ?? .zero
window?.addSubview(view)
}
}

#elseif os(macOS)
extension DebugParams {
public static func showDebugInfo(_: ViewType) {}
Expand Down
Loading

0 comments on commit 82752ce

Please sign in to comment.