craft-native 0.0.231 → 0.0.232

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -3424,7 +3424,7 @@ function pinCraftNativeDependency(packagePath, craftVersion) {
3424
3424
  `);
3425
3425
  }
3426
3426
  // package.json
3427
- var version = "0.0.231";
3427
+ var version = "0.0.232";
3428
3428
 
3429
3429
  // bin/cli.ts
3430
3430
  var spawnedFrom = process6.env[CRAFT_CLI_SPAWN_MARKER];
package/dist/index.cjs CHANGED
@@ -309,7 +309,7 @@ function craftBinaryNotFoundMessage(triedPath) {
309
309
  `);
310
310
  }
311
311
  // package.json
312
- var version = "0.0.231";
312
+ var version = "0.0.232";
313
313
 
314
314
  // src/sdk-version.ts
315
315
  var SDK_VERSION = version;
package/dist/index.js CHANGED
@@ -57,7 +57,7 @@ function craftBinaryNotFoundMessage(triedPath) {
57
57
  `);
58
58
  }
59
59
  // package.json
60
- var version = "0.0.231";
60
+ var version = "0.0.232";
61
61
 
62
62
  // src/sdk-version.ts
63
63
  var SDK_VERSION = version;
@@ -6837,17 +6837,21 @@ final class CraftNativeScreenController: UIViewController, UIScrollViewDelegate,
6837
6837
  ) {
6838
6838
  let id = ObjectIdentifier(textView)
6839
6839
  textView.delegate = self
6840
- textView.textColor = color(style["color"]) ?? .label
6841
- textView.font = textFont(style, default: .systemFont(ofSize: 16))
6842
- textView.textAlignment = textAlignment(style["textAlign"])
6843
- textView.tintColor = color(props["selectionColor"])
6844
- textView.keyboardType = keyboardType(props["keyboardType"])
6845
- textView.returnKeyType = returnKeyType(props["returnKeyType"])
6846
- textView.autocorrectionType = props["autoCorrect"] as? Bool == false ? .no : .default
6847
- textView.autocapitalizationType = capitalizationType(props["autoCapitalize"])
6848
- textView.isSecureTextEntry = props["secureTextEntry"] as? Bool == true
6840
+ // UIKit owns marked text until the keyboard commits it. Reapplying
6841
+ // typography or input traits during composition can commit that draft.
6842
+ if textView.markedTextRange == nil {
6843
+ textView.textColor = color(style["color"]) ?? .label
6844
+ textView.font = textFont(style, default: .systemFont(ofSize: 16))
6845
+ textView.textAlignment = textAlignment(style["textAlign"])
6846
+ textView.tintColor = color(props["selectionColor"])
6847
+ textView.keyboardType = keyboardType(props["keyboardType"])
6848
+ textView.returnKeyType = returnKeyType(props["returnKeyType"])
6849
+ textView.autocorrectionType = props["autoCorrect"] as? Bool == false ? .no : .default
6850
+ textView.autocapitalizationType = capitalizationType(props["autoCapitalize"])
6851
+ textView.isSecureTextEntry = props["secureTextEntry"] as? Bool == true
6852
+ applyAutofill(to: textView, props: props)
6853
+ }
6849
6854
  textView.isEditable = props["editable"] as? Bool != false
6850
- applyAutofill(to: textView, props: props)
6851
6855
  // The style's padding is where the text starts, as in a web textarea.
6852
6856
  let padding = paddingInsets(style)
6853
6857
  if let craftTextView = textView as? CraftNativeTextView {
@@ -6875,12 +6879,17 @@ final class CraftNativeScreenController: UIViewController, UIScrollViewDelegate,
6875
6879
  craftTextView.placeholderFont = textView.font
6876
6880
  }
6877
6881
  updateTextView(textView, value: (props["value"] as? String) ?? defaultValue)
6878
- let selectedRange = textView.selectedRange
6879
- let attributes = inputTextAttributes(style, font: textView.font ?? .systemFont(ofSize: 16), alignment: textView.textAlignment)
6880
- textView.typingAttributes = attributes
6881
- if !textView.text.isEmpty {
6882
- textView.attributedText = NSAttributedString(string: textView.text, attributes: attributes)
6883
- textView.selectedRange = selectedRange
6882
+ if textView.markedTextRange == nil {
6883
+ let attributes = inputTextAttributes(style, font: textView.font ?? .systemFont(ofSize: 16), alignment: textView.textAlignment)
6884
+ let styled = NSAttributedString(string: textView.text ?? "", attributes: attributes)
6885
+ if !textView.text.isEmpty, textView.attributedText?.isEqual(to: styled) != true {
6886
+ let selectedRange = textView.selectedRange
6887
+ textView.attributedText = styled
6888
+ textView.selectedRange = selectedRange
6889
+ }
6890
+ if !(textView.typingAttributes as NSDictionary).isEqual(attributes as NSDictionary) {
6891
+ textView.typingAttributes = attributes
6892
+ }
6884
6893
  }
6885
6894
  (textView as? CraftNativeTextView)?.refreshPlaceholder()
6886
6895
  updateHandler(nonEmptyHandler(events["onChange"]) ?? nonEmptyHandler(events["onChangeText"]), for: textView)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "craft-native",
3
- "version": "0.0.231",
3
+ "version": "0.0.232",
4
4
  "type": "module",
5
5
  "description": "Build desktop apps with web languages - TypeScript SDK for Craft",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",