@triniwiz/nativescript-masonkit 1.0.0-beta.66 → 1.0.0-beta.68

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.
Files changed (86) hide show
  1. package/DOCS.md +46 -0
  2. package/button/index.android.js +0 -1
  3. package/button/index.android.js.map +1 -1
  4. package/button/index.ios.js +6 -3
  5. package/button/index.ios.js.map +1 -1
  6. package/common.d.ts +40 -2
  7. package/common.js +173 -25
  8. package/common.js.map +1 -1
  9. package/index.android.d.ts +1 -0
  10. package/index.android.js +1 -0
  11. package/index.android.js.map +1 -1
  12. package/index.d.ts +29 -1
  13. package/index.ios.d.ts +1 -0
  14. package/index.ios.js +1 -0
  15. package/index.ios.js.map +1 -1
  16. package/input/common.js +1 -0
  17. package/input/common.js.map +1 -1
  18. package/li/index.ios.js +7 -4
  19. package/li/index.ios.js.map +1 -1
  20. package/package.json +6 -1
  21. package/platforms/android/masonkit-release.aar +0 -0
  22. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +97 -12
  23. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/mason_native.h +46 -0
  24. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
  25. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  26. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +17963 -13015
  27. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +544 -358
  28. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  29. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftinterface +544 -358
  30. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  31. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +8589 -8290
  32. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +194 -24
  33. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/mason_native.h +46 -0
  34. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
  35. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  36. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  37. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +17963 -13015
  38. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +544 -358
  39. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  40. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftinterface +544 -358
  41. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +17963 -13015
  42. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +544 -358
  43. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  44. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +544 -358
  45. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +28 -28
  46. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  47. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +8584 -8285
  48. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +8236 -7949
  49. package/properties.d.ts +13 -1
  50. package/properties.js +66 -1
  51. package/properties.js.map +1 -1
  52. package/pseudo.d.ts +9 -0
  53. package/pseudo.js +58 -0
  54. package/pseudo.js.map +1 -0
  55. package/scroll/index.ios.d.ts +5 -3
  56. package/scroll/index.ios.js +53 -19
  57. package/scroll/index.ios.js.map +1 -1
  58. package/style.d.ts +138 -8
  59. package/style.js +619 -538
  60. package/style.js.map +1 -1
  61. package/symbols.d.ts +1 -0
  62. package/symbols.js +1 -0
  63. package/symbols.js.map +1 -1
  64. package/text/index.android.js +3 -2
  65. package/text/index.android.js.map +1 -1
  66. package/text/index.ios.d.ts +2 -1
  67. package/text/index.ios.js +36 -14
  68. package/text/index.ios.js.map +1 -1
  69. package/textarea/common.d.ts +8 -0
  70. package/textarea/common.js +28 -0
  71. package/textarea/common.js.map +1 -0
  72. package/textarea/index.android.d.ts +15 -0
  73. package/textarea/index.android.js +71 -0
  74. package/textarea/index.android.js.map +1 -0
  75. package/textarea/index.ios.d.ts +18 -0
  76. package/textarea/index.ios.js +134 -0
  77. package/textarea/index.ios.js.map +1 -0
  78. package/tree/index.android.d.ts +3 -0
  79. package/tree/index.android.js +10 -0
  80. package/tree/index.android.js.map +1 -1
  81. package/tree/index.ios.d.ts +19 -1
  82. package/tree/index.ios.js +25 -0
  83. package/tree/index.ios.js.map +1 -1
  84. package/view/index.ios.d.ts +1 -0
  85. package/view/index.ios.js +44 -21
  86. package/view/index.ios.js.map +1 -1
@@ -399,6 +399,9 @@ SWIFT_CLASS_NAMED("Button")
399
399
  - (void)requestLayout;
400
400
  - (void)addView:(UIView * _Nonnull)view;
401
401
  - (void)addView:(UIView * _Nonnull)view at:(NSInteger)at;
402
+ - (void)removeView:(UIView * _Nonnull)view;
403
+ - (void)removeViewAt:(NSInteger)index;
404
+ - (void)removeAllViews;
402
405
  - (void)layoutSubviews;
403
406
  - (void)drawRect:(CGRect)rect;
404
407
  @property (nonatomic, readonly, strong) NSMutableData * _Nonnull textValues;
@@ -409,11 +412,13 @@ SWIFT_CLASS_NAMED("Button")
409
412
 
410
413
  @class UITouch;
411
414
  @class UIEvent;
415
+ @class UIWindow;
412
416
  @interface MasonButton (SWIFT_EXTENSION(Mason))
413
417
  - (void)touchesBegan:(NSSet<UITouch *> * _Nonnull)touches withEvent:(UIEvent * _Nullable)event;
414
418
  - (void)touchesEnded:(NSSet<UITouch *> * _Nonnull)touches withEvent:(UIEvent * _Nullable)event;
415
419
  - (void)touchesCancelled:(NSSet<UITouch *> * _Nonnull)touches withEvent:(UIEvent * _Nullable)event;
416
420
  - (void)touchesMoved:(NSSet<UITouch *> * _Nonnull)touches withEvent:(UIEvent * _Nullable)event;
421
+ - (void)willMoveToWindow:(UIWindow * _Nullable)newWindow;
417
422
  @end
418
423
 
419
424
  typedef SWIFT_ENUM_NAMED(NSInteger, MasonClear, "Clear", open) {
@@ -1044,6 +1049,7 @@ SWIFT_CLASS_NAMED("MasonMouseEventOptions")
1044
1049
  - (nonnull instancetype)initWithIsComposing:(BOOL)isComposing OBJC_DESIGNATED_INITIALIZER;
1045
1050
  @end
1046
1051
 
1052
+ enum PseudoState : uint16_t;
1047
1053
  enum MasonNodeType : int32_t;
1048
1054
  SWIFT_CLASS_NAMED("MasonNode")
1049
1055
  @interface MasonNode : NSObject
@@ -1052,10 +1058,22 @@ SWIFT_CLASS_NAMED("MasonNode")
1052
1058
  @property (nonatomic, copy) void (^ _Nullable onNodeDetached)(void);
1053
1059
  @property (nonatomic, readonly) void * _Nullable nativePtr;
1054
1060
  @property (nonatomic, readonly, strong) MasonLayout * _Nonnull computedLayout;
1061
+ /// Set to true by applyToView after Mason has applied layout to this node’s view.
1062
+ /// NativeScript can read this to skip redundant layout passes for Mason-managed children.
1063
+ @property (nonatomic) BOOL isLayoutValid;
1055
1064
  @property (nonatomic, readonly, strong) MasonDocument * _Nullable document;
1056
- - (void)setPseudoString:(uint16_t)pseudoState key:(NSString * _Nonnull)key value:(NSString * _Nonnull)value;
1057
- - (NSString * _Nullable)getPseudoString:(uint16_t)pseudoState key:(NSString * _Nonnull)key SWIFT_WARN_UNUSED_RESULT;
1058
- - (void)clearPseudoString:(uint16_t)pseudoState key:(NSString * _Nonnull)key;
1065
+ - (void)setPseudoString:(uint16_t)pseudoState :(NSString * _Nonnull)key :(NSString * _Nonnull)value;
1066
+ - (NSString * _Nullable)getPseudoString:(uint16_t)pseudoState :(NSString * _Nonnull)key SWIFT_WARN_UNUSED_RESULT;
1067
+ - (void)clearPseudoString:(uint16_t)pseudoState :(NSString * _Nonnull)key;
1068
+ /// Current active pseudo state bitmask read from the native state buffer.
1069
+ @property (nonatomic, readonly) uint16_t pseudoMask;
1070
+ - (BOOL)hasPseudo:(enum PseudoState)state SWIFT_WARN_UNUSED_RESULT;
1071
+ - (void)setPseudo:(enum PseudoState)state :(BOOL)enabled autoDirty:(BOOL)autoDirty;
1072
+ /// Get existing pseudo style buffer (read-only).
1073
+ - (NSMutableData * _Nullable)getPseudoBuffer:(uint16_t)flags SWIFT_WARN_UNUSED_RESULT;
1074
+ /// Prepare (create if needed) a mutable pseudo style buffer.
1075
+ /// Clones from base style on first call for a given state.
1076
+ - (NSMutableData * _Nonnull)preparePseudoBuffer:(uint16_t)flags SWIFT_WARN_UNUSED_RESULT;
1059
1077
  - (MasonNode * _Nonnull)getRootNode SWIFT_WARN_UNUSED_RESULT;
1060
1078
  @property (nonatomic, readonly, strong) MasonNode * _Nullable parent;
1061
1079
  @property (nonatomic, readonly, strong) MasonNode * _Nullable parentNode;
@@ -1079,14 +1097,6 @@ SWIFT_CLASS_NAMED("MasonNode")
1079
1097
  - (void)removeAllChildren;
1080
1098
  @end
1081
1099
 
1082
- enum PseudoState : uint16_t;
1083
- @interface MasonNode (SWIFT_EXTENSION(Mason))
1084
- /// Current active pseudo state bitmask read from the native state buffer.
1085
- @property (nonatomic, readonly) uint16_t pseudoMask;
1086
- - (BOOL)hasPseudo:(enum PseudoState)state SWIFT_WARN_UNUSED_RESULT;
1087
- - (void)setPseudo:(enum PseudoState)state :(BOOL)enabled autoDirty:(BOOL)autoDirty;
1088
- @end
1089
-
1090
1100
  typedef SWIFT_ENUM_NAMED(int32_t, MasonNodeType, "MasonNodeType", open) {
1091
1101
  MasonNodeTypeElement = 0,
1092
1102
  MasonNodeTypeText = 1,
@@ -1219,6 +1229,13 @@ SWIFT_CLASS_NAMED("MasonStyle")
1219
1229
  @property (nonatomic, copy) NSString * _Nonnull cornerShapeBottomRight;
1220
1230
  @property (nonatomic, copy) NSString * _Nonnull cornerShapeBottomLeft;
1221
1231
  @property (nonatomic, copy) NSString * _Nonnull border;
1232
+ @property (nonatomic, copy) NSString * _Nonnull paddingCss;
1233
+ @property (nonatomic, copy) NSString * _Nonnull marginCss;
1234
+ @property (nonatomic, copy) NSString * _Nonnull insetCss;
1235
+ @property (nonatomic, copy) NSString * _Nonnull borderLeft;
1236
+ @property (nonatomic, copy) NSString * _Nonnull borderTop;
1237
+ @property (nonatomic, copy) NSString * _Nonnull borderRight;
1238
+ @property (nonatomic, copy) NSString * _Nonnull borderBottom;
1222
1239
  @property (nonatomic, strong) MasonLengthPercentageRectCompat * _Nonnull borderWidthCompat;
1223
1240
  - (void)setBorderLeftWidth:(float)value :(NSInteger)type;
1224
1241
  - (void)setBorderRightWidth:(float)value :(NSInteger)type;
@@ -1242,6 +1259,7 @@ SWIFT_CLASS_NAMED("MasonStyle")
1242
1259
  - (void)setSizeWidth:(float)value :(NSInteger)type;
1243
1260
  - (void)setSizeHeight:(float)value :(NSInteger)type;
1244
1261
  - (void)setSizeWidthHeight:(float)value :(NSInteger)type;
1262
+ - (void)setSizePoints:(float)width :(float)height;
1245
1263
  @property (nonatomic, strong) MasonDimensionSizeCompat * _Nonnull maxSizeCompat;
1246
1264
  - (void)setMaxSizeWidth:(float)value :(NSInteger)type;
1247
1265
  - (void)setMaxSizeHeight:(float)value :(NSInteger)type;
@@ -1253,6 +1271,7 @@ SWIFT_CLASS_NAMED("MasonStyle")
1253
1271
  - (void)setColumnGap:(float)value :(NSInteger)type;
1254
1272
  @property (nonatomic, copy) NSString * _Nonnull gridArea;
1255
1273
  @property (nonatomic, copy) NSString * _Nonnull gridTemplateAreas;
1274
+ @property (nonatomic, copy) NSString * _Nonnull transform;
1256
1275
  @property (nonatomic, copy) NSString * _Nonnull gridAutoRows;
1257
1276
  @property (nonatomic, copy) NSString * _Nonnull gridAutoColumns;
1258
1277
  @property (nonatomic) enum MasonGridAutoFlowWrap gridAutoFlow;
@@ -1289,6 +1308,9 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly) Class _Nonnull layer
1289
1308
  - (void)layoutSubviews;
1290
1309
  - (void)addView:(UIView * _Nonnull)view;
1291
1310
  - (void)addView:(UIView * _Nonnull)view at:(NSInteger)at;
1311
+ - (void)removeView:(UIView * _Nonnull)view;
1312
+ - (void)removeViewAt:(NSInteger)index;
1313
+ - (void)removeAllViews;
1292
1314
  - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
1293
1315
  @property (nonatomic, strong) MasonTextOverflowCompat * _Nonnull textOverflowCompat;
1294
1316
  @property (nonatomic) uint32_t color;
@@ -1320,6 +1342,49 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly) Class _Nonnull layer
1320
1342
  - (MasonNode * _Nullable)removeChild:(MasonNode * _Nonnull)child;
1321
1343
  @end
1322
1344
 
1345
+ @class NSTextContainer;
1346
+ @class NSAttributedString;
1347
+ @class UIFont;
1348
+ @class UITextPosition;
1349
+ SWIFT_CLASS_NAMED("MasonTextInput")
1350
+ @interface MasonTextInput : UITextView <UITextViewDelegate>
1351
+ - (nonnull instancetype)initWithFrame:(CGRect)frame textContainer:(NSTextContainer * _Nullable)textContainer SWIFT_UNAVAILABLE;
1352
+ - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
1353
+ @property (nonatomic, copy) NSString * _Nullable placeholder;
1354
+ @property (nonatomic, copy) NSString * _Null_unspecified text;
1355
+ @property (nonatomic, strong) NSAttributedString * _Null_unspecified attributedText;
1356
+ @property (nonatomic, strong) UIFont * _Nullable font;
1357
+ @property (nonatomic) NSTextAlignment textAlignment;
1358
+ - (void)layoutSubviews;
1359
+ - (void)textViewDidChange:(UITextView * _Nonnull)textView;
1360
+ - (void)textViewDidBeginEditing:(UITextView * _Nonnull)textView;
1361
+ - (void)textViewDidEndEditing:(UITextView * _Nonnull)textView;
1362
+ - (void)paste:(id _Nullable)sender;
1363
+ - (void)cut:(id _Nullable)sender;
1364
+ - (BOOL)textView:(UITextView * _Nonnull)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString * _Nonnull)text SWIFT_WARN_UNUSED_RESULT;
1365
+ - (CGRect)caretRectForPosition:(UITextPosition * _Nonnull)position SWIFT_WARN_UNUSED_RESULT;
1366
+ @end
1367
+
1368
+ SWIFT_CLASS_NAMED("MasonTextArea")
1369
+ @interface MasonTextArea : MasonTextInput <MasonElementObjc>
1370
+ @property (nonatomic, readonly, strong) MasonNode * _Nonnull node;
1371
+ @property (nonatomic, readonly, strong) NSCMason * _Nonnull mason;
1372
+ @property (nonatomic, readonly, strong) UIView * _Nonnull uiView;
1373
+ @property (nonatomic, readonly, strong) MasonStyle * _Nonnull style;
1374
+ @property (nonatomic) NSInteger rows;
1375
+ @property (nonatomic) NSInteger cols;
1376
+ @property (nonatomic, copy) NSString * _Nonnull name;
1377
+ @property (nonatomic) NSInteger maxLength;
1378
+ @property (nonatomic, copy) NSString * _Nonnull value;
1379
+ - (nonnull instancetype)initWithMason:(NSCMason * _Nonnull)doc OBJC_DESIGNATED_INITIALIZER;
1380
+ - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER;
1381
+ - (void)drawRect:(CGRect)rect;
1382
+ - (void)layoutSubviews;
1383
+ - (void)textViewDidChange:(UITextView * _Nonnull)textView;
1384
+ - (void)onStyleChange:(uint64_t)low :(uint64_t)high;
1385
+ - (BOOL)textView:(UITextView * _Nonnull)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString * _Nonnull)text SWIFT_WARN_UNUSED_RESULT;
1386
+ @end
1387
+
1323
1388
  SWIFT_CLASS("_TtC5Mason14MasonTextLayer")
1324
1389
  @interface MasonTextLayer : CALayer
1325
1390
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@@ -1344,7 +1409,6 @@ SWIFT_CLASS_NAMED("MasonTextNode")
1344
1409
  - (nonnull instancetype)initWithMason:(NSCMason * _Nonnull)doc children:(NSArray<MasonNode *> * _Nonnull)nodes SWIFT_UNAVAILABLE;
1345
1410
  @end
1346
1411
 
1347
- @class NSAttributedString;
1348
1412
  @interface MasonTextNode (SWIFT_EXTENSION(Mason))
1349
1413
  /// Get attributed string representation of this text node
1350
1414
  - (NSAttributedString * _Nonnull)attributed SWIFT_WARN_UNUSED_RESULT;
@@ -1377,10 +1441,13 @@ SWIFT_CLASS_NAMED("MasonUIView")
1377
1441
  @property (nonatomic, readonly, strong) MasonNode * _Nonnull node;
1378
1442
  @property (nonatomic, readonly, strong) NSCMason * _Nonnull mason;
1379
1443
  @property (nonatomic, readonly, strong) UIView * _Nonnull uiView;
1444
+ @property (nonatomic) CGSize contentSize;
1445
+ @property (nonatomic) CGPoint contentOffset;
1380
1446
  @property (nonatomic, readonly, strong) MasonStyle * _Nonnull style;
1381
1447
  - (void)markNodeDirty;
1382
1448
  - (BOOL)isNodeDirty SWIFT_WARN_UNUSED_RESULT;
1383
1449
  - (void)layoutSubviews;
1450
+ - (void)willMoveToWindow:(UIWindow * _Nullable)newWindow;
1384
1451
  - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
1385
1452
  + (MasonUIView * _Nonnull)createGridView:(NSCMason * _Nonnull)mason SWIFT_WARN_UNUSED_RESULT;
1386
1453
  + (MasonUIView * _Nonnull)createFlexView:(NSCMason * _Nonnull)mason SWIFT_WARN_UNUSED_RESULT;
@@ -1686,10 +1753,15 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, strong) NSCMason * _Nonnull sh
1686
1753
  - (void)printTree:(MasonNode * _Nonnull)node;
1687
1754
  - (MasonNode * _Nonnull)createTextNode SWIFT_WARN_UNUSED_RESULT;
1688
1755
  - (MasonNode * _Nonnull)createImageNode SWIFT_WARN_UNUSED_RESULT;
1756
+ - (MasonNode * _Nonnull)createButtonNode SWIFT_WARN_UNUSED_RESULT;
1689
1757
  - (MasonNode * _Nonnull)createLineBreakNode SWIFT_WARN_UNUSED_RESULT;
1690
1758
  - (MasonList * _Nonnull)createListViewWithIsOrdered:(BOOL)isOrdered SWIFT_WARN_UNUSED_RESULT;
1691
1759
  - (MasonNode * _Nonnull)createListItemNode SWIFT_WARN_UNUSED_RESULT;
1692
1760
  - (MasonLi * _Nonnull)createListItem SWIFT_WARN_UNUSED_RESULT;
1761
+ - (MasonTextArea * _Nonnull)createTextArea SWIFT_WARN_UNUSED_RESULT;
1762
+ @property (nonatomic) BOOL preflight;
1763
+ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly) float scale;)
1764
+ + (float)scale SWIFT_WARN_UNUSED_RESULT;
1693
1765
  @end
1694
1766
 
1695
1767
  @interface NSObject (SWIFT_EXTENSION(Mason))
@@ -1884,6 +1956,19 @@ SWIFT_CLASS_NAMED("TrackSizingFunction")
1884
1956
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
1885
1957
  @end
1886
1958
 
1959
+ typedef SWIFT_ENUM(uint8_t, TransformOpType, open) {
1960
+ TransformOpTypeNone = 0,
1961
+ TransformOpTypeTranslate = 1,
1962
+ TransformOpTypeTranslateX = 2,
1963
+ TransformOpTypeTranslateY = 3,
1964
+ TransformOpTypeScale = 4,
1965
+ TransformOpTypeScaleX = 5,
1966
+ TransformOpTypeScaleY = 6,
1967
+ TransformOpTypeRotate = 7,
1968
+ TransformOpTypeSkewX = 8,
1969
+ TransformOpTypeSkewY = 9,
1970
+ };
1971
+
1887
1972
  typedef SWIFT_ENUM_NAMED(NSInteger, MasonWhiteSpace, "WhiteSpace", open) {
1888
1973
  MasonWhiteSpaceNormal = 0,
1889
1974
  MasonWhiteSpacePre = 1,
@@ -2302,6 +2387,9 @@ SWIFT_CLASS_NAMED("Button")
2302
2387
  - (void)requestLayout;
2303
2388
  - (void)addView:(UIView * _Nonnull)view;
2304
2389
  - (void)addView:(UIView * _Nonnull)view at:(NSInteger)at;
2390
+ - (void)removeView:(UIView * _Nonnull)view;
2391
+ - (void)removeViewAt:(NSInteger)index;
2392
+ - (void)removeAllViews;
2305
2393
  - (void)layoutSubviews;
2306
2394
  - (void)drawRect:(CGRect)rect;
2307
2395
  @property (nonatomic, readonly, strong) NSMutableData * _Nonnull textValues;
@@ -2312,11 +2400,13 @@ SWIFT_CLASS_NAMED("Button")
2312
2400
 
2313
2401
  @class UITouch;
2314
2402
  @class UIEvent;
2403
+ @class UIWindow;
2315
2404
  @interface MasonButton (SWIFT_EXTENSION(Mason))
2316
2405
  - (void)touchesBegan:(NSSet<UITouch *> * _Nonnull)touches withEvent:(UIEvent * _Nullable)event;
2317
2406
  - (void)touchesEnded:(NSSet<UITouch *> * _Nonnull)touches withEvent:(UIEvent * _Nullable)event;
2318
2407
  - (void)touchesCancelled:(NSSet<UITouch *> * _Nonnull)touches withEvent:(UIEvent * _Nullable)event;
2319
2408
  - (void)touchesMoved:(NSSet<UITouch *> * _Nonnull)touches withEvent:(UIEvent * _Nullable)event;
2409
+ - (void)willMoveToWindow:(UIWindow * _Nullable)newWindow;
2320
2410
  @end
2321
2411
 
2322
2412
  typedef SWIFT_ENUM_NAMED(NSInteger, MasonClear, "Clear", open) {
@@ -2947,6 +3037,7 @@ SWIFT_CLASS_NAMED("MasonMouseEventOptions")
2947
3037
  - (nonnull instancetype)initWithIsComposing:(BOOL)isComposing OBJC_DESIGNATED_INITIALIZER;
2948
3038
  @end
2949
3039
 
3040
+ enum PseudoState : uint16_t;
2950
3041
  enum MasonNodeType : int32_t;
2951
3042
  SWIFT_CLASS_NAMED("MasonNode")
2952
3043
  @interface MasonNode : NSObject
@@ -2955,10 +3046,22 @@ SWIFT_CLASS_NAMED("MasonNode")
2955
3046
  @property (nonatomic, copy) void (^ _Nullable onNodeDetached)(void);
2956
3047
  @property (nonatomic, readonly) void * _Nullable nativePtr;
2957
3048
  @property (nonatomic, readonly, strong) MasonLayout * _Nonnull computedLayout;
3049
+ /// Set to true by applyToView after Mason has applied layout to this node’s view.
3050
+ /// NativeScript can read this to skip redundant layout passes for Mason-managed children.
3051
+ @property (nonatomic) BOOL isLayoutValid;
2958
3052
  @property (nonatomic, readonly, strong) MasonDocument * _Nullable document;
2959
- - (void)setPseudoString:(uint16_t)pseudoState key:(NSString * _Nonnull)key value:(NSString * _Nonnull)value;
2960
- - (NSString * _Nullable)getPseudoString:(uint16_t)pseudoState key:(NSString * _Nonnull)key SWIFT_WARN_UNUSED_RESULT;
2961
- - (void)clearPseudoString:(uint16_t)pseudoState key:(NSString * _Nonnull)key;
3053
+ - (void)setPseudoString:(uint16_t)pseudoState :(NSString * _Nonnull)key :(NSString * _Nonnull)value;
3054
+ - (NSString * _Nullable)getPseudoString:(uint16_t)pseudoState :(NSString * _Nonnull)key SWIFT_WARN_UNUSED_RESULT;
3055
+ - (void)clearPseudoString:(uint16_t)pseudoState :(NSString * _Nonnull)key;
3056
+ /// Current active pseudo state bitmask read from the native state buffer.
3057
+ @property (nonatomic, readonly) uint16_t pseudoMask;
3058
+ - (BOOL)hasPseudo:(enum PseudoState)state SWIFT_WARN_UNUSED_RESULT;
3059
+ - (void)setPseudo:(enum PseudoState)state :(BOOL)enabled autoDirty:(BOOL)autoDirty;
3060
+ /// Get existing pseudo style buffer (read-only).
3061
+ - (NSMutableData * _Nullable)getPseudoBuffer:(uint16_t)flags SWIFT_WARN_UNUSED_RESULT;
3062
+ /// Prepare (create if needed) a mutable pseudo style buffer.
3063
+ /// Clones from base style on first call for a given state.
3064
+ - (NSMutableData * _Nonnull)preparePseudoBuffer:(uint16_t)flags SWIFT_WARN_UNUSED_RESULT;
2962
3065
  - (MasonNode * _Nonnull)getRootNode SWIFT_WARN_UNUSED_RESULT;
2963
3066
  @property (nonatomic, readonly, strong) MasonNode * _Nullable parent;
2964
3067
  @property (nonatomic, readonly, strong) MasonNode * _Nullable parentNode;
@@ -2982,14 +3085,6 @@ SWIFT_CLASS_NAMED("MasonNode")
2982
3085
  - (void)removeAllChildren;
2983
3086
  @end
2984
3087
 
2985
- enum PseudoState : uint16_t;
2986
- @interface MasonNode (SWIFT_EXTENSION(Mason))
2987
- /// Current active pseudo state bitmask read from the native state buffer.
2988
- @property (nonatomic, readonly) uint16_t pseudoMask;
2989
- - (BOOL)hasPseudo:(enum PseudoState)state SWIFT_WARN_UNUSED_RESULT;
2990
- - (void)setPseudo:(enum PseudoState)state :(BOOL)enabled autoDirty:(BOOL)autoDirty;
2991
- @end
2992
-
2993
3088
  typedef SWIFT_ENUM_NAMED(int32_t, MasonNodeType, "MasonNodeType", open) {
2994
3089
  MasonNodeTypeElement = 0,
2995
3090
  MasonNodeTypeText = 1,
@@ -3122,6 +3217,13 @@ SWIFT_CLASS_NAMED("MasonStyle")
3122
3217
  @property (nonatomic, copy) NSString * _Nonnull cornerShapeBottomRight;
3123
3218
  @property (nonatomic, copy) NSString * _Nonnull cornerShapeBottomLeft;
3124
3219
  @property (nonatomic, copy) NSString * _Nonnull border;
3220
+ @property (nonatomic, copy) NSString * _Nonnull paddingCss;
3221
+ @property (nonatomic, copy) NSString * _Nonnull marginCss;
3222
+ @property (nonatomic, copy) NSString * _Nonnull insetCss;
3223
+ @property (nonatomic, copy) NSString * _Nonnull borderLeft;
3224
+ @property (nonatomic, copy) NSString * _Nonnull borderTop;
3225
+ @property (nonatomic, copy) NSString * _Nonnull borderRight;
3226
+ @property (nonatomic, copy) NSString * _Nonnull borderBottom;
3125
3227
  @property (nonatomic, strong) MasonLengthPercentageRectCompat * _Nonnull borderWidthCompat;
3126
3228
  - (void)setBorderLeftWidth:(float)value :(NSInteger)type;
3127
3229
  - (void)setBorderRightWidth:(float)value :(NSInteger)type;
@@ -3145,6 +3247,7 @@ SWIFT_CLASS_NAMED("MasonStyle")
3145
3247
  - (void)setSizeWidth:(float)value :(NSInteger)type;
3146
3248
  - (void)setSizeHeight:(float)value :(NSInteger)type;
3147
3249
  - (void)setSizeWidthHeight:(float)value :(NSInteger)type;
3250
+ - (void)setSizePoints:(float)width :(float)height;
3148
3251
  @property (nonatomic, strong) MasonDimensionSizeCompat * _Nonnull maxSizeCompat;
3149
3252
  - (void)setMaxSizeWidth:(float)value :(NSInteger)type;
3150
3253
  - (void)setMaxSizeHeight:(float)value :(NSInteger)type;
@@ -3156,6 +3259,7 @@ SWIFT_CLASS_NAMED("MasonStyle")
3156
3259
  - (void)setColumnGap:(float)value :(NSInteger)type;
3157
3260
  @property (nonatomic, copy) NSString * _Nonnull gridArea;
3158
3261
  @property (nonatomic, copy) NSString * _Nonnull gridTemplateAreas;
3262
+ @property (nonatomic, copy) NSString * _Nonnull transform;
3159
3263
  @property (nonatomic, copy) NSString * _Nonnull gridAutoRows;
3160
3264
  @property (nonatomic, copy) NSString * _Nonnull gridAutoColumns;
3161
3265
  @property (nonatomic) enum MasonGridAutoFlowWrap gridAutoFlow;
@@ -3192,6 +3296,9 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly) Class _Nonnull layer
3192
3296
  - (void)layoutSubviews;
3193
3297
  - (void)addView:(UIView * _Nonnull)view;
3194
3298
  - (void)addView:(UIView * _Nonnull)view at:(NSInteger)at;
3299
+ - (void)removeView:(UIView * _Nonnull)view;
3300
+ - (void)removeViewAt:(NSInteger)index;
3301
+ - (void)removeAllViews;
3195
3302
  - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
3196
3303
  @property (nonatomic, strong) MasonTextOverflowCompat * _Nonnull textOverflowCompat;
3197
3304
  @property (nonatomic) uint32_t color;
@@ -3223,6 +3330,49 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly) Class _Nonnull layer
3223
3330
  - (MasonNode * _Nullable)removeChild:(MasonNode * _Nonnull)child;
3224
3331
  @end
3225
3332
 
3333
+ @class NSTextContainer;
3334
+ @class NSAttributedString;
3335
+ @class UIFont;
3336
+ @class UITextPosition;
3337
+ SWIFT_CLASS_NAMED("MasonTextInput")
3338
+ @interface MasonTextInput : UITextView <UITextViewDelegate>
3339
+ - (nonnull instancetype)initWithFrame:(CGRect)frame textContainer:(NSTextContainer * _Nullable)textContainer SWIFT_UNAVAILABLE;
3340
+ - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
3341
+ @property (nonatomic, copy) NSString * _Nullable placeholder;
3342
+ @property (nonatomic, copy) NSString * _Null_unspecified text;
3343
+ @property (nonatomic, strong) NSAttributedString * _Null_unspecified attributedText;
3344
+ @property (nonatomic, strong) UIFont * _Nullable font;
3345
+ @property (nonatomic) NSTextAlignment textAlignment;
3346
+ - (void)layoutSubviews;
3347
+ - (void)textViewDidChange:(UITextView * _Nonnull)textView;
3348
+ - (void)textViewDidBeginEditing:(UITextView * _Nonnull)textView;
3349
+ - (void)textViewDidEndEditing:(UITextView * _Nonnull)textView;
3350
+ - (void)paste:(id _Nullable)sender;
3351
+ - (void)cut:(id _Nullable)sender;
3352
+ - (BOOL)textView:(UITextView * _Nonnull)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString * _Nonnull)text SWIFT_WARN_UNUSED_RESULT;
3353
+ - (CGRect)caretRectForPosition:(UITextPosition * _Nonnull)position SWIFT_WARN_UNUSED_RESULT;
3354
+ @end
3355
+
3356
+ SWIFT_CLASS_NAMED("MasonTextArea")
3357
+ @interface MasonTextArea : MasonTextInput <MasonElementObjc>
3358
+ @property (nonatomic, readonly, strong) MasonNode * _Nonnull node;
3359
+ @property (nonatomic, readonly, strong) NSCMason * _Nonnull mason;
3360
+ @property (nonatomic, readonly, strong) UIView * _Nonnull uiView;
3361
+ @property (nonatomic, readonly, strong) MasonStyle * _Nonnull style;
3362
+ @property (nonatomic) NSInteger rows;
3363
+ @property (nonatomic) NSInteger cols;
3364
+ @property (nonatomic, copy) NSString * _Nonnull name;
3365
+ @property (nonatomic) NSInteger maxLength;
3366
+ @property (nonatomic, copy) NSString * _Nonnull value;
3367
+ - (nonnull instancetype)initWithMason:(NSCMason * _Nonnull)doc OBJC_DESIGNATED_INITIALIZER;
3368
+ - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder OBJC_DESIGNATED_INITIALIZER;
3369
+ - (void)drawRect:(CGRect)rect;
3370
+ - (void)layoutSubviews;
3371
+ - (void)textViewDidChange:(UITextView * _Nonnull)textView;
3372
+ - (void)onStyleChange:(uint64_t)low :(uint64_t)high;
3373
+ - (BOOL)textView:(UITextView * _Nonnull)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString * _Nonnull)text SWIFT_WARN_UNUSED_RESULT;
3374
+ @end
3375
+
3226
3376
  SWIFT_CLASS("_TtC5Mason14MasonTextLayer")
3227
3377
  @interface MasonTextLayer : CALayer
3228
3378
  - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@@ -3247,7 +3397,6 @@ SWIFT_CLASS_NAMED("MasonTextNode")
3247
3397
  - (nonnull instancetype)initWithMason:(NSCMason * _Nonnull)doc children:(NSArray<MasonNode *> * _Nonnull)nodes SWIFT_UNAVAILABLE;
3248
3398
  @end
3249
3399
 
3250
- @class NSAttributedString;
3251
3400
  @interface MasonTextNode (SWIFT_EXTENSION(Mason))
3252
3401
  /// Get attributed string representation of this text node
3253
3402
  - (NSAttributedString * _Nonnull)attributed SWIFT_WARN_UNUSED_RESULT;
@@ -3280,10 +3429,13 @@ SWIFT_CLASS_NAMED("MasonUIView")
3280
3429
  @property (nonatomic, readonly, strong) MasonNode * _Nonnull node;
3281
3430
  @property (nonatomic, readonly, strong) NSCMason * _Nonnull mason;
3282
3431
  @property (nonatomic, readonly, strong) UIView * _Nonnull uiView;
3432
+ @property (nonatomic) CGSize contentSize;
3433
+ @property (nonatomic) CGPoint contentOffset;
3283
3434
  @property (nonatomic, readonly, strong) MasonStyle * _Nonnull style;
3284
3435
  - (void)markNodeDirty;
3285
3436
  - (BOOL)isNodeDirty SWIFT_WARN_UNUSED_RESULT;
3286
3437
  - (void)layoutSubviews;
3438
+ - (void)willMoveToWindow:(UIWindow * _Nullable)newWindow;
3287
3439
  - (nullable instancetype)initWithCoder:(NSCoder * _Nonnull)coder SWIFT_UNAVAILABLE;
3288
3440
  + (MasonUIView * _Nonnull)createGridView:(NSCMason * _Nonnull)mason SWIFT_WARN_UNUSED_RESULT;
3289
3441
  + (MasonUIView * _Nonnull)createFlexView:(NSCMason * _Nonnull)mason SWIFT_WARN_UNUSED_RESULT;
@@ -3589,10 +3741,15 @@ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, strong) NSCMason * _Nonnull sh
3589
3741
  - (void)printTree:(MasonNode * _Nonnull)node;
3590
3742
  - (MasonNode * _Nonnull)createTextNode SWIFT_WARN_UNUSED_RESULT;
3591
3743
  - (MasonNode * _Nonnull)createImageNode SWIFT_WARN_UNUSED_RESULT;
3744
+ - (MasonNode * _Nonnull)createButtonNode SWIFT_WARN_UNUSED_RESULT;
3592
3745
  - (MasonNode * _Nonnull)createLineBreakNode SWIFT_WARN_UNUSED_RESULT;
3593
3746
  - (MasonList * _Nonnull)createListViewWithIsOrdered:(BOOL)isOrdered SWIFT_WARN_UNUSED_RESULT;
3594
3747
  - (MasonNode * _Nonnull)createListItemNode SWIFT_WARN_UNUSED_RESULT;
3595
3748
  - (MasonLi * _Nonnull)createListItem SWIFT_WARN_UNUSED_RESULT;
3749
+ - (MasonTextArea * _Nonnull)createTextArea SWIFT_WARN_UNUSED_RESULT;
3750
+ @property (nonatomic) BOOL preflight;
3751
+ SWIFT_CLASS_PROPERTY(@property (nonatomic, class, readonly) float scale;)
3752
+ + (float)scale SWIFT_WARN_UNUSED_RESULT;
3596
3753
  @end
3597
3754
 
3598
3755
  @interface NSObject (SWIFT_EXTENSION(Mason))
@@ -3787,6 +3944,19 @@ SWIFT_CLASS_NAMED("TrackSizingFunction")
3787
3944
  + (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
3788
3945
  @end
3789
3946
 
3947
+ typedef SWIFT_ENUM(uint8_t, TransformOpType, open) {
3948
+ TransformOpTypeNone = 0,
3949
+ TransformOpTypeTranslate = 1,
3950
+ TransformOpTypeTranslateX = 2,
3951
+ TransformOpTypeTranslateY = 3,
3952
+ TransformOpTypeScale = 4,
3953
+ TransformOpTypeScaleX = 5,
3954
+ TransformOpTypeScaleY = 6,
3955
+ TransformOpTypeRotate = 7,
3956
+ TransformOpTypeSkewX = 8,
3957
+ TransformOpTypeSkewY = 9,
3958
+ };
3959
+
3790
3960
  typedef SWIFT_ENUM_NAMED(NSInteger, MasonWhiteSpace, "WhiteSpace", open) {
3791
3961
  MasonWhiteSpaceNormal = 0,
3792
3962
  MasonWhiteSpacePre = 1,
@@ -84,6 +84,32 @@ void mason_print_tree(struct CMason *mason, struct CMasonNode *node);
84
84
 
85
85
  void mason_set_device_scale(struct CMason *mason, float scale);
86
86
 
87
+ /**
88
+ * Enable or disable CSS Preflight (normalize/web-like) defaults globally.
89
+ *
90
+ * When `enabled` is `true` the underlying `StyleArena` will use web-normalised
91
+ * defaults for every element type:
92
+ * • `box-sizing: border-box` on all elements
93
+ * • `margin: 0`, `padding: 0`, `border-width: 0` on all elements
94
+ * • `background: transparent` on all elements
95
+ * • `list-style: none` on `<ul>` / `<ol>`
96
+ * • `display: block` on `<img>`
97
+ *
98
+ * The flag is stored in a global `AtomicBool` so it must be set **before**
99
+ * creating Mason instances for the cleanest effect. Calling this on an
100
+ * existing `mason` pointer also re-seeds that instance's arena so that
101
+ * unstyled (default-handle) nodes pick up the new defaults immediately.
102
+ *
103
+ * # Safety
104
+ * `mason` must be a valid, non-null pointer returned by `mason_init`.
105
+ */
106
+ void mason_set_preflight(struct CMason *mason, bool enabled);
107
+
108
+ /**
109
+ * Returns `true` if CSS Preflight defaults are currently enabled.
110
+ */
111
+ bool mason_get_preflight(void);
112
+
87
113
  void *mason_get_buffer(struct CMason *mason, int handle);
88
114
 
89
115
  void mason_node_set_segments(struct CMason *mason,
@@ -101,6 +127,18 @@ void mason_node_destroy(struct CMasonNode *node);
101
127
 
102
128
  struct CMasonNode *mason_node_new_image_node(struct CMason *mason);
103
129
 
130
+ struct CMasonNode *mason_node_new_button_node(struct CMason *mason);
131
+
132
+ #if !defined(TARGET_OS_ANDROID)
133
+ struct CMasonNode *mason_node_new_button_node_with_context(struct CMason *mason,
134
+ void *measure_data,
135
+ long long (*measure)(const void*,
136
+ float,
137
+ float,
138
+ float,
139
+ float));
140
+ #endif
141
+
104
142
  struct CMasonNode *mason_node_new_node(struct CMason *mason, bool anonymous);
105
143
 
106
144
  #if !defined(TARGET_OS_ANDROID)
@@ -262,6 +300,10 @@ const uint8_t *mason_node_get_pseudo_style_buffer(struct CMason *mason,
262
300
  uint16_t flags,
263
301
  uintptr_t *out_len);
264
302
 
303
+ void *mason_node_get_pseudo_style_buffer_apple(struct CMason *mason,
304
+ struct CMasonNode *node,
305
+ uint16_t flags);
306
+
265
307
  /**
266
308
  * Prepare (create if needed) and return a mutable pseudo style buffer.
267
309
  * Clones from the base style if this is the first call for the given pseudo state.
@@ -272,6 +314,10 @@ uint8_t *mason_node_prepare_pseudo_style_buffer(struct CMason *mason,
272
314
  uint16_t flags,
273
315
  uintptr_t *out_len);
274
316
 
317
+ void *mason_node_prepare_pseudo_style_buffer_apple(struct CMason *mason,
318
+ struct CMasonNode *node,
319
+ uint16_t flags);
320
+
275
321
  bool mason_node_is_children_same(struct CMason *mason,
276
322
  struct CMasonNode *node,
277
323
  struct CMasonNode *const *children,