Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -1246,11 +1246,14 @@
"client/android/div/src/main/res/drawable/tabs_default_indicator.xml":"divkit/public/client/android/div/src/main/res/drawable/tabs_default_indicator.xml",
"client/android/div/src/main/res/drawable/warning_counter_background.xml":"divkit/public/client/android/div/src/main/res/drawable/warning_counter_background.xml",
"client/android/div/src/main/res/drawable/warning_error_counter_background.xml":"divkit/public/client/android/div/src/main/res/drawable/warning_error_counter_background.xml",
"client/android/div/src/main/res/values-en/strings.xml":"divkit/public/client/android/div/src/main/res/values-en/strings.xml",
"client/android/div/src/main/res/values-ru/strings.xml":"divkit/public/client/android/div/src/main/res/values-ru/strings.xml",
"client/android/div/src/main/res/values/attrs.xml":"divkit/public/client/android/div/src/main/res/values/attrs.xml",
"client/android/div/src/main/res/values/colors.xml":"divkit/public/client/android/div/src/main/res/values/colors.xml",
"client/android/div/src/main/res/values/dimens.xml":"divkit/public/client/android/div/src/main/res/values/dimens.xml",
"client/android/div/src/main/res/values/ids.xml":"divkit/public/client/android/div/src/main/res/values/ids.xml",
"client/android/div/src/main/res/values/integer.xml":"divkit/public/client/android/div/src/main/res/values/integer.xml",
"client/android/div/src/main/res/values/strings.xml":"divkit/public/client/android/div/src/main/res/values/strings.xml",
"client/android/div/src/main/res/values/styles.xml":"divkit/public/client/android/div/src/main/res/values/styles.xml",
"client/android/div/src/test/java/com/yandex/div/core/DivActionHandlerTest.kt":"divkit/public/client/android/div/src/test/java/com/yandex/div/core/DivActionHandlerTest.kt",
"client/android/div/src/test/java/com/yandex/div/core/DivCreationTrackerTest.kt":"divkit/public/client/android/div/src/test/java/com/yandex/div/core/DivCreationTrackerTest.kt",
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
## 29.5.0

# Android Client:
* Supported functions `getArrayFromDict`, `getDictFromDict`, `getOptArrayFromDict`, `getOptDictFromDict`.
* Supported accessibility for `slider`.
* Added type `auto` for accessibility.
* Fixed visibility actions not working for items children inside `div-pager` and `div-tabs`.

# iOS Client:
* Fixed cursor position in the text with emoji.
* Improved `DivData` parsing.

# Web Client:
* Fixed several input issues in the `slider` with two thumbs.
* Fixed `gallery` markup in several cases.
* Fixed `input` focus outlines in several cases.
* Fixed a processing error when setting an incorrect value for the `integer` variable.
* Fixed an issue with the `state` patches.


## 29.4.0

# Android Client:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def resolve_value_declaration(self) -> Text:
result += f' case parent?.{prop.declaration_name}?.link:'
local_var_name = prop.value_resolving_local_var_name
deserialize = cast(SwiftProperty, prop).deserialize_from_value_expression
result += f' {local_var_name} = {local_var_name}.merged(with: {deserialize})'
result += f' {local_var_name} = {local_var_name}.merged(with: {{ {deserialize} }})'
result += ' default: break'
result += ' }'
result += ' }'
Expand All @@ -285,7 +285,7 @@ def resolve_value_declaration(self) -> Text:
for prop in templateable_props:
local_var_name = prop.value_resolving_local_var_name
merged_with = f'parent.{prop.declaration_name}?.{prop.resolve_value_expression}'
result += f' {local_var_name} = {local_var_name}.merged(with: {merged_with})'
result += f' {local_var_name} = {local_var_name}.merged(with: {{ {merged_with} }})'
result += ' }'

required_props = list(filter(lambda p: not p.parsed_value_is_optional, template_props))
Expand Down Expand Up @@ -783,7 +783,7 @@ def internal_declaration(self, default_value: str) -> Optional[str]:
args = ', '.join(args)
return f'{entity.declaration_prefix}{utils.capitalize_camel_case(entity.original_name)}({args})'
elif isinstance(self, Dictionary):
return f'try! JSONSerialization.jsonObject(jsonString: """\n{default_value}\n""") as! [String: Any]'
return f'(try! JSONSerialization.jsonObject(jsonString: """\n{default_value}\n""") as! [String: Any])'
else:
return None

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ public final class EntityWithJsonProperty {
init(
jsonProperty: [String: Any]? = nil
) {
self.jsonProperty = jsonProperty ?? try! JSONSerialization.jsonObject(jsonString: """
self.jsonProperty = jsonProperty ?? (try! JSONSerialization.jsonObject(jsonString: """
{
"key": "value",
"items": [
"value"
]
}
""") as! [String: Any]
""") as! [String: Any])
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ public final class EntityWithJsonProperty {
init(
jsonProperty: [String: Any]? = nil
) {
self.jsonProperty = jsonProperty ?? try! JSONSerialization.jsonObject(jsonString: """
self.jsonProperty = jsonProperty ?? (try! JSONSerialization.jsonObject(jsonString: """
{
"key": "value",
"items": [
"value"
]
}
""") as! [String: Any]
""") as! [String: Any])
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public final class EntityWithArrayOfEnumsTemplate: TemplateValue {
case "items":
itemsValue = deserialize(__dictValue, validator: ResolvedValue.itemsValidator).merged(with: itemsValue)
case parent?.items?.link:
itemsValue = itemsValue.merged(with: deserialize(__dictValue, validator: ResolvedValue.itemsValidator))
itemsValue = itemsValue.merged(with: { deserialize(__dictValue, validator: ResolvedValue.itemsValidator) })
default: break
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public final class EntityWithArrayOfExpressionsTemplate: TemplateValue {
case "items":
itemsValue = deserialize(__dictValue, validator: ResolvedValue.itemsValidator).merged(with: itemsValue)
case parent?.items?.link:
itemsValue = itemsValue.merged(with: deserialize(__dictValue, validator: ResolvedValue.itemsValidator))
itemsValue = itemsValue.merged(with: { deserialize(__dictValue, validator: ResolvedValue.itemsValidator) })
default: break
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ public final class EntityWithArrayOfNestedItemsTemplate: TemplateValue {
case "property":
propertyValue = deserialize(__dictValue).merged(with: propertyValue)
case parent?.entity?.link:
entityValue = entityValue.merged(with: deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, type: EntityTemplate.self))
entityValue = entityValue.merged(with: { deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, type: EntityTemplate.self) })
case parent?.property?.link:
propertyValue = propertyValue.merged(with: deserialize(__dictValue))
propertyValue = propertyValue.merged(with: { deserialize(__dictValue) })
default: break
}
}
if let parent = parent {
entityValue = entityValue.merged(with: parent.entity?.resolveValue(context: context, useOnlyLinks: true))
entityValue = entityValue.merged(with: { parent.entity?.resolveValue(context: context, useOnlyLinks: true) })
}
var errors = mergeErrors(
entityValue.errorsOrWarnings?.map { .nestedObjectError(field: "entity", error: $0) },
Expand Down Expand Up @@ -157,12 +157,12 @@ public final class EntityWithArrayOfNestedItemsTemplate: TemplateValue {
case "items":
itemsValue = deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, validator: ResolvedValue.itemsValidator, type: EntityWithArrayOfNestedItemsTemplate.ItemTemplate.self).merged(with: itemsValue)
case parent?.items?.link:
itemsValue = itemsValue.merged(with: deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, validator: ResolvedValue.itemsValidator, type: EntityWithArrayOfNestedItemsTemplate.ItemTemplate.self))
itemsValue = itemsValue.merged(with: { deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, validator: ResolvedValue.itemsValidator, type: EntityWithArrayOfNestedItemsTemplate.ItemTemplate.self) })
default: break
}
}
if let parent = parent {
itemsValue = itemsValue.merged(with: parent.items?.resolveValue(context: context, validator: ResolvedValue.itemsValidator, useOnlyLinks: true))
itemsValue = itemsValue.merged(with: { parent.items?.resolveValue(context: context, validator: ResolvedValue.itemsValidator, useOnlyLinks: true) })
}
var errors = mergeErrors(
itemsValue.errorsOrWarnings?.map { .nestedObjectError(field: "items", error: $0) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ public final class EntityWithArrayTemplate: TemplateValue {
case "array":
arrayValue = deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, validator: ResolvedValue.arrayValidator, type: EntityTemplate.self).merged(with: arrayValue)
case parent?.array?.link:
arrayValue = arrayValue.merged(with: deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, validator: ResolvedValue.arrayValidator, type: EntityTemplate.self))
arrayValue = arrayValue.merged(with: { deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, validator: ResolvedValue.arrayValidator, type: EntityTemplate.self) })
default: break
}
}
if let parent = parent {
arrayValue = arrayValue.merged(with: parent.array?.resolveValue(context: context, validator: ResolvedValue.arrayValidator, useOnlyLinks: true))
arrayValue = arrayValue.merged(with: { parent.array?.resolveValue(context: context, validator: ResolvedValue.arrayValidator, useOnlyLinks: true) })
}
var errors = mergeErrors(
arrayValue.errorsOrWarnings?.map { .nestedObjectError(field: "array", error: $0) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public final class EntityWithArrayWithTransformTemplate: TemplateValue {
case "array":
arrayValue = deserialize(__dictValue, transform: Color.color(withHexString:), validator: ResolvedValue.arrayValidator).merged(with: arrayValue)
case parent?.array?.link:
arrayValue = arrayValue.merged(with: deserialize(__dictValue, transform: Color.color(withHexString:), validator: ResolvedValue.arrayValidator))
arrayValue = arrayValue.merged(with: { deserialize(__dictValue, transform: Color.color(withHexString:), validator: ResolvedValue.arrayValidator) })
default: break
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public final class EntityWithComplexPropertyTemplate: TemplateValue {
case "value":
valueValue = deserialize(__dictValue, transform: URL.init(string:)).merged(with: valueValue)
case parent?.value?.link:
valueValue = valueValue.merged(with: deserialize(__dictValue, transform: URL.init(string:)))
valueValue = valueValue.merged(with: { deserialize(__dictValue, transform: URL.init(string:)) })
default: break
}
}
Expand Down Expand Up @@ -127,12 +127,12 @@ public final class EntityWithComplexPropertyTemplate: TemplateValue {
case "property":
propertyValue = deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, type: EntityWithComplexPropertyTemplate.PropertyTemplate.self).merged(with: propertyValue)
case parent?.property?.link:
propertyValue = propertyValue.merged(with: deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, type: EntityWithComplexPropertyTemplate.PropertyTemplate.self))
propertyValue = propertyValue.merged(with: { deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, type: EntityWithComplexPropertyTemplate.PropertyTemplate.self) })
default: break
}
}
if let parent = parent {
propertyValue = propertyValue.merged(with: parent.property?.resolveValue(context: context, useOnlyLinks: true))
propertyValue = propertyValue.merged(with: { parent.property?.resolveValue(context: context, useOnlyLinks: true) })
}
var errors = mergeErrors(
propertyValue.errorsOrWarnings?.map { .nestedObjectError(field: "property", error: $0) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public final class EntityWithComplexPropertyWithDefaultValueTemplate: TemplateVa
case "value":
valueValue = deserialize(__dictValue).merged(with: valueValue)
case parent?.value?.link:
valueValue = valueValue.merged(with: deserialize(__dictValue))
valueValue = valueValue.merged(with: { deserialize(__dictValue) })
default: break
}
}
Expand Down Expand Up @@ -119,12 +119,12 @@ public final class EntityWithComplexPropertyWithDefaultValueTemplate: TemplateVa
case "property":
propertyValue = deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, type: EntityWithComplexPropertyWithDefaultValueTemplate.PropertyTemplate.self).merged(with: propertyValue)
case parent?.property?.link:
propertyValue = propertyValue.merged(with: deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, type: EntityWithComplexPropertyWithDefaultValueTemplate.PropertyTemplate.self))
propertyValue = propertyValue.merged(with: { deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, type: EntityWithComplexPropertyWithDefaultValueTemplate.PropertyTemplate.self) })
default: break
}
}
if let parent = parent {
propertyValue = propertyValue.merged(with: parent.property?.resolveOptionalValue(context: context, useOnlyLinks: true))
propertyValue = propertyValue.merged(with: { parent.property?.resolveOptionalValue(context: context, useOnlyLinks: true) })
}
let errors = mergeErrors(
propertyValue.errorsOrWarnings?.map { .nestedObjectError(field: "property", error: $0) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ public final class EntityWithEntityPropertyTemplate: TemplateValue {
case "entity":
entityValue = deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, type: EntityTemplate.self).merged(with: entityValue)
case parent?.entity?.link:
entityValue = entityValue.merged(with: deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, type: EntityTemplate.self))
entityValue = entityValue.merged(with: { deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, type: EntityTemplate.self) })
default: break
}
}
if let parent = parent {
entityValue = entityValue.merged(with: parent.entity?.resolveOptionalValue(context: context, useOnlyLinks: true))
entityValue = entityValue.merged(with: { parent.entity?.resolveOptionalValue(context: context, useOnlyLinks: true) })
}
let errors = mergeErrors(
entityValue.errorsOrWarnings?.map { .nestedObjectError(field: "entity", error: $0) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ public final class EntityWithJsonProperty {
init(
jsonProperty: [String: Any]? = nil
) {
self.jsonProperty = jsonProperty ?? try! JSONSerialization.jsonObject(jsonString: """
self.jsonProperty = jsonProperty ?? (try! JSONSerialization.jsonObject(jsonString: """
{
"key": "value",
"items": [
"value"
]
}
""") as! [String: Any]
""") as! [String: Any])
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public final class EntityWithJsonPropertyTemplate: TemplateValue {
case "json_property":
jsonPropertyValue = deserialize(__dictValue).merged(with: jsonPropertyValue)
case parent?.jsonProperty?.link:
jsonPropertyValue = jsonPropertyValue.merged(with: deserialize(__dictValue))
jsonPropertyValue = jsonPropertyValue.merged(with: { deserialize(__dictValue) })
default: break
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public final class EntityWithOptionalComplexPropertyTemplate: TemplateValue {
case "value":
valueValue = deserialize(__dictValue, transform: URL.init(string:)).merged(with: valueValue)
case parent?.value?.link:
valueValue = valueValue.merged(with: deserialize(__dictValue, transform: URL.init(string:)))
valueValue = valueValue.merged(with: { deserialize(__dictValue, transform: URL.init(string:)) })
default: break
}
}
Expand Down Expand Up @@ -119,12 +119,12 @@ public final class EntityWithOptionalComplexPropertyTemplate: TemplateValue {
case "property":
propertyValue = deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, type: EntityWithOptionalComplexPropertyTemplate.PropertyTemplate.self).merged(with: propertyValue)
case parent?.property?.link:
propertyValue = propertyValue.merged(with: deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, type: EntityWithOptionalComplexPropertyTemplate.PropertyTemplate.self))
propertyValue = propertyValue.merged(with: { deserialize(__dictValue, templates: context.templates, templateToType: context.templateToType, type: EntityWithOptionalComplexPropertyTemplate.PropertyTemplate.self) })
default: break
}
}
if let parent = parent {
propertyValue = propertyValue.merged(with: parent.property?.resolveOptionalValue(context: context, useOnlyLinks: true))
propertyValue = propertyValue.merged(with: { parent.property?.resolveOptionalValue(context: context, useOnlyLinks: true) })
}
let errors = mergeErrors(
propertyValue.errorsOrWarnings?.map { .nestedObjectError(field: "property", error: $0) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public final class EntityWithOptionalPropertyTemplate: TemplateValue {
case "property":
propertyValue = deserialize(__dictValue).merged(with: propertyValue)
case parent?.property?.link:
propertyValue = propertyValue.merged(with: deserialize(__dictValue))
propertyValue = propertyValue.merged(with: { deserialize(__dictValue) })
default: break
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public final class EntityWithOptionalStringEnumPropertyTemplate: TemplateValue {
case "property":
propertyValue = deserialize(__dictValue).merged(with: propertyValue)
case parent?.property?.link:
propertyValue = propertyValue.merged(with: deserialize(__dictValue))
propertyValue = propertyValue.merged(with: { deserialize(__dictValue) })
default: break
}
}
Expand Down
Loading