Files
bsky-social-app/modules/expo-selectable-text/ios/TextStyle.swift
T
Hailey aa96bba066 merge main in
what are you doing there? go away

fix recognizer to clear selected text on tap

remove jank/hacks

update readme

remove android stuff

(?) don't remove clipped subview on android for selection
enable selection of alt text

add numberOfLines
properly apply container styles

handle both selection and expand press events in alt text

far better implementation

revert link changes

revert lightbox changes for now

fix file name
2024-01-15 03:12:43 -08:00

73 lines
1.3 KiB
Swift

import ExpoModulesCore
struct TextStyle: Record {
@Field
var color: String? = "black"
@Field
var fontSize: CGFloat? = 12
@Field
var fontStyle: String? = "normal"
@Field
var fontWeight: FontWeight?
@Field
var letterSpacing: Double?
@Field
var textAlign: String? = "auto"
@Field
var lineHeight: Double?
@Field
var textDecorationLine: TextDecorationLine?
@Field
var flex: Int?
@Field
var pointerEvents: String?
}
enum FontWeight: String, Enumerable {
case bold
case normal
case one = "100"
case two = "200"
case three = "300"
case four = "400"
case five = "500"
case six = "600"
case seven = "700"
case eight = "800"
case nine = "900"
func toFontWeight() -> UIFont.Weight {
switch self {
case .bold:
return .bold
case .normal:
return .regular
case .one:
return .ultraLight
case .two:
return .ultraLight
case .three:
return .light
case .four:
return .regular
case .five:
return .medium
case .six:
return .semibold
case .seven:
return .semibold
case .eight:
return .bold
case .nine:
return .heavy
}
}
}
enum TextDecorationLine: String, Enumerable {
case underline
case lineThrough = "line-through"
case underlineLineThrough = "underline line-through"
case normal
}