Files
divkit/schema/div-text.json
T
man-y 7f00e3b5aa Mark supported features of Flutter
e5a6a0f23d3e399f39c492c585359ca1666ccddf
2024-05-14 11:19:28 +03:00

402 lines
11 KiB
JSON

{
"java_extends": "DivBlockWithId",
"$description": "translations.json#/div_text",
"codegen": {
"divan": {
"forced_properties_order": [
"text"
]
}
},
"definitions": {
"range": {
"type": "object",
"platforms": [
"android",
"ios",
"web"
],
"properties": {
"start": {
"$ref": "common.json#/non_negative_integer",
"$description": "translations.json#/div_text_range_start"
},
"end": {
"$ref": "common.json#/positive_integer",
"$description": "translations.json#/div_text_range_end"
},
"font_size": {
"$ref": "common.json#/non_negative_integer",
"$description": "translations.json#/div_font_size"
},
"font_family": {
"type": "string",
"$description": "translations.json#/div_font_family"
},
"font_size_unit": {
"$ref": "div-size-unit.json",
"default_value": "sp",
"$description": "translations.json#/div_font_size_unit",
"platforms": [
"android",
"ios"
]
},
"letter_spacing": {
"type": "number",
"$description": "translations.json#/div_text_range_letter_spacing"
},
"font_weight": {
"$ref": "div-font-weight.json",
"$description": "translations.json#/div_font_weight"
},
"text_color": {
"$ref": "common.json#/color",
"$description": "translations.json#/div_text_color"
},
"underline": {
"$ref": "div-line-style.json",
"$description": "translations.json#/div_text_range_underline"
},
"strike": {
"$ref": "div-line-style.json",
"$description": "translations.json#/div_text_range_strike"
},
"actions": {
"type": "array",
"items": {
"$ref": "div-action.json"
},
"$description": "translations.json#/div_text_range_actions"
},
"line_height": {
"$ref": "common.json#/non_negative_integer",
"$description": "translations.json#/div_text_range_line_height"
},
"top_offset": {
"$ref": "common.json#/non_negative_integer",
"$description": "translations.json#/div_text_range_top_offset"
},
"border": {
"$ref": "div-text-range-border.json",
"$description": "translations.json#/div_text_range_border"
},
"background": {
"$ref": "div-text-range-background.json",
"$description": "translations.json#/div_text_range_background"
},
"text_shadow": {
"$ref": "div-shadow.json",
"$description": "translations.json#/div_text_range_shadow",
"platforms": [
"android",
"web"
]
}
},
"required": [
"start",
"end"
],
"$description": "translations.json#/div_text_range"
},
"image": {
"type": "object",
"platforms": [
"android",
"ios",
"web"
],
"properties": {
"start": {
"$ref": "common.json#/non_negative_integer",
"$description": "translations.json#/div_text_image_start"
},
"url": {
"$ref": "common.json#/url",
"$description": "translations.json#/div_text_image_url"
},
"width": {
"$ref": "div-fixed-size.json",
"default_value": "{\"type\": \"fixed\",\"value\":20}",
"$description": "translations.json#/div_text_image_width"
},
"height": {
"$ref": "div-fixed-size.json",
"default_value": "{\"type\": \"fixed\",\"value\":20}",
"$description": "translations.json#/div_text_image_height"
},
"tint_color": {
"$ref": "common.json#/color",
"$description": "translations.json#/div_text_image_tint_color"
},
"tint_mode": {
"$ref": "div-blend-mode.json",
"default_value": "source_in",
"$description": "translations.json#/div_text_image_tint_mode",
"platforms": [
"android",
"web"
]
},
"preload_required": {
"$ref": "common.json#/boolean_int",
"default_value": "false",
"$description": "translations.json#/div_image_base_preload_required",
"platforms": [
"web"
]
}
},
"required": [
"url",
"start"
],
"$description": "translations.json#/div_text_image"
},
"ellipsis": {
"type": "object",
"properties": {
"text": {
"type": "string",
"$description": "translations.json#/div_text_ellipsis_text"
},
"actions": {
"type": "array",
"items": {
"$ref": "div-action.json"
},
"$description": "translations.json#/div_text_ellipsis_actions",
"platforms": [
"android",
"ios",
"web"
]
},
"ranges": {
"type": "array",
"items": {
"$ref": "#/definitions/range"
},
"$description": "translations.json#/div_text_ellipsis_ranges",
"platforms": [
"android",
"ios",
"web"
]
},
"images": {
"type": "array",
"items": {
"$ref": "#/definitions/image"
},
"$description": "translations.json#/div_text_ellipsis_images",
"platforms": [
"android",
"ios",
"web"
]
}
},
"required": [
"text"
],
"$description": "translations.json#/div_text_ellipsis",
"platforms": [
"android",
"ios"
]
}
},
"allOf": [
{
"$ref": "div-base.json"
},
{
"$ref": "div-actionable.json"
},
{
"properties": {
"type": {
"type": "string",
"enum": [
"text"
]
},
"font_size": {
"$ref": "common.json#/non_negative_integer",
"default_value": "12",
"$description": "translations.json#/div_font_size"
},
"font_family": {
"type": "string",
"$description": "translations.json#/div_font_family",
"platforms": [
"android",
"ios",
"web"
]
},
"font_size_unit": {
"$ref": "div-size-unit.json",
"default_value": "sp",
"platforms": [
"android",
"ios"
]
},
"line_height": {
"$ref": "common.json#/non_negative_integer",
"$description": "translations.json#/div_text_line_height"
},
"max_lines": {
"$ref": "common.json#/non_negative_integer",
"$description": "translations.json#/div_text_max_lines"
},
"min_hidden_lines": {
"$ref": "common.json#/non_negative_integer",
"$description": "translations.json#/div_text_min_hidden_lines",
"platforms": [
"android",
"ios"
]
},
"auto_ellipsize": {
"$ref": "common.json#/boolean_int",
"$description": "translations.json#/div_text_auto_ellipsize",
"platforms": [
"android",
"web",
"flutter"
]
},
"letter_spacing": {
"type": "number",
"default_value": "0",
"$description": "translations.json#/div_text_letter_spacing",
"platforms": [
"android",
"ios",
"web"
]
},
"font_weight": {
"$ref": "div-font-weight.json",
"default_value": "regular",
"$description": "translations.json#/div_font_weight"
},
"text_alignment_horizontal": {
"$ref": "div-alignment-horizontal.json",
"default_value": "start",
"$description": "translations.json#/div_text_text_alignment_horizontal"
},
"text_alignment_vertical": {
"$ref": "div-alignment-vertical.json",
"default_value": "top",
"$description": "translations.json#/div_text_text_alignment_vertical"
},
"text_color": {
"$ref": "common.json#/color",
"default_value": "#FF000000",
"$description": "translations.json#/div_text_text_color"
},
"focused_text_color": {
"$ref": "common.json#/color",
"$description": "translations.json#/div_text_focused_text_color",
"platforms": [
"android",
"web"
]
},
"text_gradient": {
"$ref": "div-text-gradient.json",
"$description": "translations.json#/div_text_text_gradient",
"platforms": [
"android",
"ios",
"web"
]
},
"text": {
"type": "string",
"$description": "translations.json#/div_text_text"
},
"underline": {
"$ref": "div-line-style.json",
"default_value": "none",
"$description": "translations.json#/div_text_underline"
},
"strike": {
"$ref": "div-line-style.json",
"default_value": "none",
"$description": "translations.json#/div_text_strike"
},
"ranges": {
"type": "array",
"items": {
"$ref": "#/definitions/range"
},
"$description": "translations.json#/div_text_ranges",
"platforms": [
"android",
"ios",
"web"
]
},
"images": {
"type": "array",
"items": {
"$ref": "#/definitions/image"
},
"$description": "translations.json#/div_text_images",
"platforms": [
"android",
"ios",
"web"
]
},
"ellipsis": {
"$ref": "#/definitions/ellipsis"
},
"selectable": {
"$ref": "common.json#/boolean_int",
"default_value": "false",
"$description": "translations.json#/div_text_selectable",
"platforms": [
"android",
"ios",
"web"
]
},
"truncate": {
"type": "string",
"enum": [
"none", "start", "end", "middle"
],
"default_value": "end",
"$description": "translations.json#/div_text_truncate",
"deprecated": true,
"code_generation_disabled_kotlin": true,
"code_generation_disabled_swift": true,
"platforms": [
"android",
"ios"
]
},
"text_shadow": {
"$ref": "div-shadow.json",
"$description": "translations.json#/div_text_shadow",
"platforms": [
"android",
"web"
]
}
}
}
],
"required": [
"type",
"text"
]
}