-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit_hash:2cbd79544fc83fb38eb3318636dd527e0909f66e
- Loading branch information
robot-divkit
committed
Nov 5, 2024
1 parent
f49cec4
commit 0620280
Showing
39 changed files
with
1,975 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import LayoutKit | ||
|
||
final class HideTooltipActionHandler { | ||
private let performer: TooltipActionPerformer? | ||
private let showTooltip: DivActionURLHandler.ShowTooltipAction? | ||
|
||
init (performer: TooltipActionPerformer?, showTooltip: DivActionURLHandler.ShowTooltipAction?) { | ||
self.performer = performer | ||
self.showTooltip = showTooltip | ||
} | ||
|
||
func handle(_ action: DivActionHideTooltip, context: DivActionHandlingContext) { | ||
guard let cardId = action.resolveId(context.expressionResolver) else { | ||
return | ||
} | ||
|
||
guard showTooltip == nil else { | ||
return | ||
} | ||
|
||
performer?.hideTooltip(id: cardId) | ||
} | ||
} |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
public enum DivKitInfo { | ||
public static let version = "30.24.0" | ||
public static let version = "30.25.0" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ extension Div { | |
.divSelect, | ||
.divSeparator, | ||
.divSlider, | ||
.divSwitch, | ||
.divVideo, | ||
.divText: | ||
[] | ||
|
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,29 @@ | ||
import LayoutKit | ||
|
||
extension DivSwitch: DivBlockModeling { | ||
public func makeBlock(context: DivBlockModelingContext) throws -> Block { | ||
let resolver = context.expressionResolver | ||
let switchVariable = context.makeBinding( | ||
variableName: isOnVariable, | ||
defaultValue: false | ||
) | ||
|
||
return try applyBaseProperties( | ||
to: { | ||
SwitchBlock( | ||
on: switchVariable, | ||
enabled: resolveIsEnabled(resolver), | ||
action: nil, | ||
onTintColor: resolveOnColor(resolver) | ||
) | ||
}, | ||
context: context, | ||
actionsHolder: nil, | ||
customAccessibilityParams: CustomAccessibilityParams( | ||
defaultTraits: .switchButton | ||
) { [unowned self] in | ||
accessibility?.resolveDescription(resolver) | ||
} | ||
) | ||
} | ||
} |
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
Oops, something went wrong.