@triniwiz/nativescript-masonkit 1.0.0-beta.6 → 1.0.0-beta.61

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 (118) hide show
  1. package/DOCS.md +884 -0
  2. package/br/index.android.d.ts +10 -0
  3. package/br/index.android.js +31 -0
  4. package/br/index.android.js.map +1 -0
  5. package/br/index.ios.d.ts +11 -0
  6. package/br/index.ios.js +30 -0
  7. package/br/index.ios.js.map +1 -0
  8. package/button/index.android.d.ts +4 -2
  9. package/button/index.android.js +9 -4
  10. package/button/index.android.js.map +1 -1
  11. package/button/index.ios.d.ts +4 -5
  12. package/button/index.ios.js +9 -66
  13. package/button/index.ios.js.map +1 -1
  14. package/common.d.ts +135 -70
  15. package/common.js +775 -1337
  16. package/common.js.map +1 -1
  17. package/img/index.android.d.ts +5 -4
  18. package/img/index.android.js +18 -6
  19. package/img/index.android.js.map +1 -1
  20. package/img/index.ios.d.ts +3 -2
  21. package/img/index.ios.js +23 -19
  22. package/img/index.ios.js.map +1 -1
  23. package/index.android.d.ts +4 -1
  24. package/index.android.js +4 -1
  25. package/index.android.js.map +1 -1
  26. package/index.d.ts +21 -1
  27. package/index.ios.d.ts +4 -1
  28. package/index.ios.js +4 -1
  29. package/index.ios.js.map +1 -1
  30. package/input/common.d.ts +20 -0
  31. package/input/common.js +64 -0
  32. package/input/common.js.map +1 -0
  33. package/input/index.android.d.ts +20 -0
  34. package/input/index.android.js +118 -0
  35. package/input/index.android.js.map +1 -0
  36. package/input/index.ios.d.ts +23 -0
  37. package/input/index.ios.js +163 -0
  38. package/input/index.ios.js.map +1 -0
  39. package/package.json +3 -2
  40. package/platforms/android/masonkit-release.aar +0 -0
  41. package/platforms/ios/Mason.xcframework/Info.plist +5 -5
  42. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +281 -51
  43. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/mason_native.h +70 -42
  44. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Info.plist +0 -0
  45. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
  46. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  47. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +39728 -27944
  48. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +876 -247
  49. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  50. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftinterface +876 -247
  51. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  52. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +7413 -4294
  53. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +562 -102
  54. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/mason_native.h +70 -42
  55. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Info.plist +0 -0
  56. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
  57. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  58. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  59. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +34845 -23061
  60. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +975 -346
  61. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  62. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftinterface +975 -346
  63. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +34845 -23061
  64. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +975 -346
  65. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  66. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +975 -346
  67. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +29 -29
  68. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  69. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +7408 -4287
  70. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +7103 -4165
  71. package/properties.d.ts +49 -0
  72. package/properties.js +1147 -0
  73. package/properties.js.map +1 -0
  74. package/scroll/index.android.d.ts +3 -2
  75. package/scroll/index.android.js +16 -4
  76. package/scroll/index.android.js.map +1 -1
  77. package/scroll/index.ios.d.ts +3 -2
  78. package/scroll/index.ios.js +18 -5
  79. package/scroll/index.ios.js.map +1 -1
  80. package/style.d.ts +9 -5
  81. package/style.js +622 -367
  82. package/style.js.map +1 -1
  83. package/symbols.d.ts +10 -0
  84. package/symbols.js +11 -0
  85. package/symbols.js.map +1 -0
  86. package/text/index.android.d.ts +11 -5
  87. package/text/index.android.js +72 -103
  88. package/text/index.android.js.map +1 -1
  89. package/text/index.ios.d.ts +12 -10
  90. package/text/index.ios.js +69 -168
  91. package/text/index.ios.js.map +1 -1
  92. package/text-node/index.android.d.ts +13 -0
  93. package/text-node/index.android.js +35 -0
  94. package/text-node/index.android.js.map +1 -0
  95. package/text-node/index.ios.d.ts +13 -0
  96. package/text-node/index.ios.js +35 -0
  97. package/text-node/index.ios.js.map +1 -0
  98. package/tree/index.android.d.ts +10 -2
  99. package/tree/index.android.js +62 -1
  100. package/tree/index.android.js.map +1 -1
  101. package/tree/index.ios.d.ts +4 -1
  102. package/tree/index.ios.js +36 -1
  103. package/tree/index.ios.js.map +1 -1
  104. package/utils/index.android.d.ts +2 -1
  105. package/utils/index.android.js +1 -1
  106. package/utils/index.android.js.map +1 -1
  107. package/utils/index.ios.d.ts +2 -1
  108. package/utils/index.ios.js +1 -1
  109. package/utils/index.ios.js.map +1 -1
  110. package/view/index.android.d.ts +3 -2
  111. package/view/index.android.js +18 -4
  112. package/view/index.android.js.map +1 -1
  113. package/view/index.ios.d.ts +3 -2
  114. package/view/index.ios.js +18 -5
  115. package/view/index.ios.js.map +1 -1
  116. package/web.d.ts +6 -0
  117. package/web.js +22 -0
  118. package/web.js.map +1 -1
package/DOCS.md ADDED
@@ -0,0 +1,884 @@
1
+ # @triniwiz/nativescript-masonkit
2
+
3
+ **Web-Inspired Layout System for NativeScript**
4
+
5
+ A layout engine that brings familiar web layout paradigms (Flexbox, CSS Grid) and semantic HTML elements to NativeScript, powered by a high-performance Rust core. Write layouts the way you would on the web, but running natively on iOS and Android.
6
+
7
+ **Version:** 1.0.0-beta.60
8
+ **License:** Apache-2.0
9
+ **Platforms:** iOS 8.0+, Android 8.0+
10
+
11
+ ---
12
+
13
+ ## Table of Contents
14
+
15
+ - [Installation](#installation)
16
+ - [Quick Start](#quick-start)
17
+ - [Components](#components)
18
+ - [View](#view)
19
+ - [Text](#text)
20
+ - [Img](#img)
21
+ - [Scroll](#scroll)
22
+ - [Button](#button)
23
+ - [Input](#input)
24
+ - [Br](#br)
25
+ - [TextNode](#textnode)
26
+ - [Semantic HTML Components](#semantic-html-components)
27
+ - [Layout Properties](#layout-properties)
28
+ - [Display](#display)
29
+ - [Box Model](#box-model)
30
+ - [Sizing](#sizing)
31
+ - [Positioning](#positioning)
32
+ - [Flexbox](#flexbox)
33
+ - [CSS Grid](#css-grid)
34
+ - [Gap & Spacing](#gap--spacing)
35
+ - [Overflow & Scrolling](#overflow--scrolling)
36
+ - [Text & Typography](#text--typography)
37
+ - [Visual Styling](#visual-styling)
38
+ - [Events](#events)
39
+ - [Types Reference](#types-reference)
40
+ - [Framework Support](#framework-support)
41
+
42
+ ---
43
+
44
+ ## Installation
45
+
46
+ ```bash
47
+ ns plugin add @triniwiz/nativescript-masonkit
48
+ ```
49
+
50
+ ---
51
+
52
+ ## Quick Start
53
+
54
+ ### XML (NativeScript Core)
55
+
56
+ ```xml
57
+ <Page xmlns:mason="@triniwiz/nativescript-masonkit">
58
+ <mason:View display="flex" flexDirection="column" padding="16" gap="8">
59
+ <mason:Text textContent="Hello MasonKit!" fontSize="24" fontWeight="bold" />
60
+ <mason:View display="grid" gridTemplateColumns="1fr 1fr" gap="12">
61
+ <mason:View background="#e0e0e0" padding="8">
62
+ <mason:Text textContent="Column 1" />
63
+ </mason:View>
64
+ <mason:View background="#f0f0f0" padding="8">
65
+ <mason:Text textContent="Column 2" />
66
+ </mason:View>
67
+ </mason:View>
68
+ </mason:View>
69
+ </Page>
70
+ ```
71
+
72
+ ### Using Semantic HTML Components
73
+
74
+ ```xml
75
+ <Page xmlns:mason="@triniwiz/nativescript-masonkit">
76
+ <mason:Div display="flex" flexDirection="column">
77
+ <mason:Header padding="16" background="#333">
78
+ <mason:H1 textContent="My App" color="#fff" />
79
+ </mason:Header>
80
+ <mason:Main display="flex" flex="1" padding="16">
81
+ <mason:Nav width="200" padding="8">
82
+ <mason:Ul>
83
+ <mason:Li textContent="Home" />
84
+ <mason:Li textContent="About" />
85
+ </mason:Ul>
86
+ </mason:Nav>
87
+ <mason:Article flex="1" padding="8">
88
+ <mason:P textContent="Welcome to the app!" />
89
+ </mason:Article>
90
+ </mason:Main>
91
+ <mason:Footer padding="16" background="#333">
92
+ <mason:Span textContent="Footer content" color="#fff" />
93
+ </mason:Footer>
94
+ </mason:Div>
95
+ </Page>
96
+ ```
97
+
98
+ ---
99
+
100
+ ## Components
101
+
102
+ ### View
103
+
104
+ The base container component. Use it as a general-purpose layout wrapper, similar to a `<div>` without built-in scrolling.
105
+
106
+ ```typescript
107
+ import { View } from '@triniwiz/nativescript-masonkit';
108
+ ```
109
+
110
+ ```xml
111
+ <mason:View display="flex" flexDirection="row" gap="8" padding="16">
112
+ <!-- children -->
113
+ </mason:View>
114
+ ```
115
+
116
+ **Methods:**
117
+
118
+ | Method | Signature | Description |
119
+ |--------|-----------|-------------|
120
+ | `addChild` | `(child: any): void` | Appends a child to the view |
121
+ | `insertChild` | `(child: any, atIndex: number): void` | Inserts a child at a specific index |
122
+ | `replaceChild` | `(child: any, atIndex: number): void` | Replaces the child at a specific index |
123
+ | `removeChild` | `(child: any): void` | Removes a child from the view |
124
+ | `removeChildren` | `(): void` | Removes all children |
125
+ | `getChildrenCount` | `(): number` | Returns the number of children |
126
+ | `getChildAt` | `(index: number): View` | Returns the child at the specified index |
127
+ | `getChildIndex` | `(child: View): number` | Returns the index of the specified child |
128
+ | `getChildById` | `(id: string): any` | Finds a child by its id |
129
+ | `forceStyleUpdate` | `(): void` | Forces a recalculation of the layout |
130
+
131
+ ---
132
+
133
+ ### Text
134
+
135
+ A text display component. Renders styled text content.
136
+
137
+ ```typescript
138
+ import { Text } from '@triniwiz/nativescript-masonkit';
139
+ ```
140
+
141
+ ```xml
142
+ <mason:Text textContent="Hello World" fontSize="18" fontWeight="bold" color="#333" />
143
+ ```
144
+
145
+ **Properties:**
146
+
147
+ | Property | Type | Description |
148
+ |----------|------|-------------|
149
+ | `textContent` | `string` | The text content to display |
150
+
151
+ Inherits all layout and styling properties from [View](#view).
152
+
153
+ ---
154
+
155
+ ### Img
156
+
157
+ An image component for displaying images from local or remote sources.
158
+
159
+ ```typescript
160
+ import { Img } from '@triniwiz/nativescript-masonkit';
161
+ ```
162
+
163
+ ```xml
164
+ <mason:Img src="~/assets/logo.png" width="100" height="100" />
165
+ <mason:Img src="https://example.com/image.jpg" aspectRatio="1.5" />
166
+ ```
167
+
168
+ **Properties:**
169
+
170
+ | Property | Type | Description |
171
+ |----------|------|-------------|
172
+ | `src` | `string` | The image source — a local path (`~/...`) or a URL |
173
+
174
+ ---
175
+
176
+ ### Scroll
177
+
178
+ A scrollable container. Wraps children in a scrollable region.
179
+
180
+ ```typescript
181
+ import { Scroll } from '@triniwiz/nativescript-masonkit';
182
+ ```
183
+
184
+ ```xml
185
+ <mason:Scroll overflow="scroll" height="300">
186
+ <!-- Scrollable content -->
187
+ </mason:Scroll>
188
+ ```
189
+
190
+ ---
191
+
192
+ ### Button
193
+
194
+ A clickable button with text content.
195
+
196
+ ```typescript
197
+ import { Button } from '@triniwiz/nativescript-masonkit';
198
+ ```
199
+
200
+ ```xml
201
+ <mason:Button textContent="Click Me" padding="12 24" background="#007AFF" color="#fff" borderRadius="8" />
202
+ ```
203
+
204
+ **Properties:**
205
+
206
+ | Property | Type | Description |
207
+ |----------|------|-------------|
208
+ | `textContent` | `string` | The button label text |
209
+
210
+ ---
211
+
212
+ ### Input
213
+
214
+ A form input component supporting various input types.
215
+
216
+ ```typescript
217
+ import { Input } from '@triniwiz/nativescript-masonkit';
218
+ ```
219
+
220
+ ```xml
221
+ <mason:Input type="text" placeholder="Enter your name" />
222
+ <mason:Input type="email" placeholder="you@example.com" />
223
+ <mason:Input type="password" />
224
+ <mason:Input type="file" accept="image/*" multiple="true" />
225
+ <mason:Input type="checkbox" />
226
+ <mason:Input type="range" />
227
+ ```
228
+
229
+ **Properties:**
230
+
231
+ | Property | Type | Description |
232
+ |----------|------|-------------|
233
+ | `type` | `InputType` | The input type (see [InputType](#inputtype)) |
234
+ | `value` | `string` | The current input value |
235
+ | `valueAsNumber` | `number` | The value as a number (for numeric types) |
236
+ | `valueAsDate` | `Date \| null` | The value as a Date (for date types) |
237
+ | `placeholder` | `string` | Placeholder text |
238
+ | `multiple` | `boolean` | Allow multiple values (e.g., file input) |
239
+ | `accept` | `string` | Accepted file types (for file inputs) |
240
+
241
+ ---
242
+
243
+ ### Br
244
+
245
+ A line break element for use inside text components.
246
+
247
+ ```typescript
248
+ import { Br } from '@triniwiz/nativescript-masonkit';
249
+ ```
250
+
251
+ ```xml
252
+ <mason:Text>
253
+ <mason:Span textContent="Line one" />
254
+ <mason:Br />
255
+ <mason:Span textContent="Line two" />
256
+ </mason:Text>
257
+ ```
258
+
259
+ ---
260
+
261
+ ### TextNode
262
+
263
+ A low-level text node for programmatic text manipulation.
264
+
265
+ ```typescript
266
+ import { TextNode } from '@triniwiz/nativescript-masonkit';
267
+ ```
268
+
269
+ **Properties:**
270
+
271
+ | Property | Type | Description |
272
+ |----------|------|-------------|
273
+ | `data` | `string` | The text data |
274
+ | `length` | `number` (readonly) | Length of the text data |
275
+
276
+ **Methods:**
277
+
278
+ | Method | Signature | Description |
279
+ |--------|-----------|-------------|
280
+ | `appendData` | `(s: string): this` | Appends text to the end |
281
+ | `deleteData` | `(offset: number, count: number): this` | Deletes text at offset |
282
+ | `insertData` | `(s: string, offset: number): this` | Inserts text at offset |
283
+ | `substringData` | `(offset: number, count: number): string` | Extracts a substring |
284
+
285
+ ---
286
+
287
+ ## Semantic HTML Components
288
+
289
+ MasonKit provides web-inspired semantic components that map directly to familiar HTML elements. They are styled via CSS using their lowercase tag names.
290
+
291
+ ```typescript
292
+ import { Div, Section, Header, Footer, Article, Main, Nav, Aside,
293
+ Span, Code, H1, H2, H3, H4, H5, H6, P, B, Strong,
294
+ A, Blockquote, Li, Ul } from '@triniwiz/nativescript-masonkit';
295
+ ```
296
+
297
+ ### Container Components
298
+
299
+ | Component | CSS Selector | Extends | Description |
300
+ |-----------|-------------|---------|-------------|
301
+ | `Div` | `div` | `Scroll` | General-purpose scrollable container |
302
+ | `Section` | `section` | `View` | Thematic grouping of content |
303
+ | `Header` | `header` | `View` | Introductory or navigational content |
304
+ | `Footer` | `footer` | `View` | Footer content |
305
+ | `Article` | `article` | `View` | Self-contained content |
306
+ | `Main` | `main` | `View` | Dominant content of the page |
307
+ | `Nav` | `nav` | `View` | Navigation links |
308
+ | `Aside` | `aside` | `View` | Tangentially related content |
309
+ | `Ul` | `ul` | `View` | Unordered list container |
310
+
311
+ ### Text Components
312
+
313
+ | Component | CSS Selector | Description |
314
+ |-----------|-------------|-------------|
315
+ | `Span` | `span` | Inline text |
316
+ | `Code` | `code` | Code/monospace text |
317
+ | `H1` - `H6` | `h1` - `h6` | Heading levels 1 through 6 |
318
+ | `P` | `p` | Paragraph text |
319
+ | `B` | `b` | Bold text |
320
+ | `Strong` | `strong` | Strong emphasis text |
321
+ | `A` | `a` | Anchor/link text |
322
+ | `Blockquote` | `blockquote` | Block quotation |
323
+ | `Li` | `li` | List item |
324
+
325
+ ### Example: CSS Styling
326
+
327
+ ```css
328
+ /* App styles */
329
+ h1 {
330
+ font-size: 32;
331
+ font-weight: bold;
332
+ margin-bottom: 16;
333
+ }
334
+
335
+ p {
336
+ font-size: 16;
337
+ line-height: 1.5;
338
+ color: #333;
339
+ }
340
+
341
+ header {
342
+ background: #1a1a2e;
343
+ padding: 16;
344
+ }
345
+
346
+ nav {
347
+ display: flex;
348
+ flex-direction: column;
349
+ gap: 8;
350
+ }
351
+ ```
352
+
353
+ ---
354
+
355
+ ## Layout Properties
356
+
357
+ All components that extend `View` support the following layout properties, settable as XML attributes, via CSS, or programmatically in TypeScript/JavaScript.
358
+
359
+ ### Display
360
+
361
+ | Property | Type | Default | Description |
362
+ |----------|------|---------|-------------|
363
+ | `display` | `Display` | `'flex'` | Layout mode |
364
+ | `boxSizing` | `BoxSizing` | — | Box model calculation |
365
+
366
+ **Display values:** `'none'` | `'flex'` | `'grid'` | `'block'` | `'inline'` | `'inline-block'` | `'inline-flex'` | `'inline-grid'`
367
+
368
+ **BoxSizing values:** `'border-box'` | `'content-box'`
369
+
370
+ ---
371
+
372
+ ### Box Model
373
+
374
+ | Property | Type | Description |
375
+ |----------|------|-------------|
376
+ | `margin` | `string` | Shorthand margin (all sides) |
377
+ | `marginLeft` | `Length` | Left margin |
378
+ | `marginRight` | `Length` | Right margin |
379
+ | `marginTop` | `Length` | Top margin |
380
+ | `marginBottom` | `Length` | Bottom margin |
381
+ | `padding` | `string` | Shorthand padding (all sides) |
382
+ | `paddingLeft` | `Length` | Left padding |
383
+ | `paddingRight` | `Length` | Right padding |
384
+ | `paddingTop` | `Length` | Top padding |
385
+ | `paddingBottom` | `Length` | Bottom padding |
386
+
387
+ Length values support `px`, `%`, `dip`, and `auto` (for margins).
388
+
389
+ ---
390
+
391
+ ### Sizing
392
+
393
+ | Property | Type | Description |
394
+ |----------|------|-------------|
395
+ | `width` | `LengthAuto` | Element width |
396
+ | `height` | `LengthAuto` | Element height |
397
+ | `minWidth` | `LengthAuto` | Minimum width |
398
+ | `minHeight` | `LengthAuto` | Minimum height |
399
+ | `maxWidth` | `LengthAuto` | Maximum width |
400
+ | `maxHeight` | `LengthAuto` | Maximum height |
401
+ | `aspectRatio` | `number` | Width-to-height ratio |
402
+
403
+ ```xml
404
+ <mason:View width="50%" height="200" maxWidth="400" aspectRatio="1.5" />
405
+ ```
406
+
407
+ ---
408
+
409
+ ### Positioning
410
+
411
+ | Property | Type | Description |
412
+ |----------|------|-------------|
413
+ | `position` | `Position` | `'relative'` or `'absolute'` |
414
+ | `left` | `LengthAuto` | Left offset |
415
+ | `right` | `LengthAuto` | Right offset |
416
+ | `top` | `LengthAuto` | Top offset |
417
+ | `bottom` | `LengthAuto` | Bottom offset |
418
+ | `inset` | `LengthAuto` | Shorthand for all four offsets |
419
+ | `zIndex` | `number` | Stacking order |
420
+
421
+ ```xml
422
+ <mason:View position="absolute" top="10" right="10" zIndex="1">
423
+ <mason:Text textContent="Floating badge" />
424
+ </mason:View>
425
+ ```
426
+
427
+ ---
428
+
429
+ ### Flexbox
430
+
431
+ | Property | Type | Description |
432
+ |----------|------|-------------|
433
+ | `flexDirection` | `FlexDirection` | Direction of the main axis |
434
+ | `flexWrap` | `FlexWrap` | Whether items wrap |
435
+ | `flex` | `string \| number` | Shorthand for grow, shrink, and basis |
436
+ | `flexFlow` | `string` | Shorthand for direction + wrap |
437
+ | `flexGrow` | `number` | Grow factor |
438
+ | `flexShrink` | `number` | Shrink factor |
439
+ | `flexBasis` | `Length` | Initial main-axis size |
440
+ | `alignItems` | `AlignItems` | Cross-axis alignment of children |
441
+ | `alignSelf` | `AlignSelf` | Cross-axis alignment of this element |
442
+ | `alignContent` | `AlignContent` | Alignment of wrapped lines |
443
+ | `justifyContent` | `JustifyContent` | Main-axis alignment |
444
+ | `justifyItems` | `JustifyItems` | Default justify for children |
445
+ | `justifySelf` | `JustifySelf` | Justify alignment for this element |
446
+
447
+ **FlexDirection values:** `'row'` | `'column'` | `'row-reverse'` | `'column-reverse'`
448
+
449
+ **FlexWrap values:** `'no-wrap'` | `'wrap'` | `'wrap-reverse'`
450
+
451
+ **Alignment values:** `'normal'` | `'flex-start'` | `'flex-end'` | `'start'` | `'end'` | `'center'` | `'baseline'` | `'stretch'`
452
+
453
+ **JustifyContent/AlignContent also accept:** `'space-between'` | `'space-around'` | `'space-evenly'`
454
+
455
+ #### Example: Flexbox Layout
456
+
457
+ ```xml
458
+ <mason:View display="flex" flexDirection="row" justifyContent="space-between" alignItems="center" padding="16">
459
+ <mason:Text textContent="Left" />
460
+ <mason:Text textContent="Center" />
461
+ <mason:Text textContent="Right" />
462
+ </mason:View>
463
+ ```
464
+
465
+ #### Example: Flex Shorthand
466
+
467
+ ```xml
468
+ <!-- flex: 1 (grow to fill available space) -->
469
+ <mason:View flex="1" />
470
+
471
+ <!-- flex: none (don't grow or shrink) -->
472
+ <mason:View flex="none" />
473
+
474
+ <!-- flex: auto -->
475
+ <mason:View flex="auto" />
476
+ ```
477
+
478
+ ---
479
+
480
+ ### CSS Grid
481
+
482
+ | Property | Type | Description |
483
+ |----------|------|-------------|
484
+ | `gridTemplateColumns` | `string` | Column track definitions |
485
+ | `gridTemplateRows` | `string` | Row track definitions |
486
+ | `gridTemplateAreas` | `string` | Named grid areas |
487
+ | `gridAutoColumns` | `string` | Size of implicit columns |
488
+ | `gridAutoRows` | `string` | Size of implicit rows |
489
+ | `gridAutoFlow` | `GridAutoFlow` | Auto-placement algorithm |
490
+ | `gridColumn` | `string` | Shorthand for column start/end |
491
+ | `gridColumnStart` | `string` | Column start line |
492
+ | `gridColumnEnd` | `string` | Column end line |
493
+ | `gridRow` | `string` | Shorthand for row start/end |
494
+ | `gridRowStart` | `string` | Row start line |
495
+ | `gridRowEnd` | `string` | Row end line |
496
+ | `gridArea` | `string` | Shorthand for row/column start/end or named area |
497
+
498
+ **GridAutoFlow values:** `'row'` | `'column'` | `'row dense'` | `'column dense'` | `'dense'`
499
+
500
+ #### Example: Grid Layout
501
+
502
+ ```xml
503
+ <mason:View display="grid" gridTemplateColumns="1fr 2fr 1fr" gridTemplateRows="auto 1fr auto" gap="8" padding="16">
504
+ <mason:View gridColumn="1 / -1" background="#eee" padding="8">
505
+ <mason:Text textContent="Full-width header" />
506
+ </mason:View>
507
+ <mason:View background="#ddd" padding="8">
508
+ <mason:Text textContent="Sidebar" />
509
+ </mason:View>
510
+ <mason:View background="#ccc" padding="8">
511
+ <mason:Text textContent="Main Content" />
512
+ </mason:View>
513
+ <mason:View background="#ddd" padding="8">
514
+ <mason:Text textContent="Right Panel" />
515
+ </mason:View>
516
+ </mason:View>
517
+ ```
518
+
519
+ #### Example: Grid Template Areas
520
+
521
+ ```xml
522
+ <mason:View
523
+ display="grid"
524
+ gridTemplateColumns="200 1fr"
525
+ gridTemplateRows="auto 1fr auto"
526
+ gridTemplateAreas="'header header' 'sidebar content' 'footer footer'"
527
+ gap="8">
528
+ <mason:View gridArea="header"><mason:Text textContent="Header" /></mason:View>
529
+ <mason:View gridArea="sidebar"><mason:Text textContent="Sidebar" /></mason:View>
530
+ <mason:View gridArea="content"><mason:Text textContent="Content" /></mason:View>
531
+ <mason:View gridArea="footer"><mason:Text textContent="Footer" /></mason:View>
532
+ </mason:View>
533
+ ```
534
+
535
+ #### Example: Auto-fill / minmax
536
+
537
+ ```xml
538
+ <mason:View display="grid" gridTemplateColumns="repeat(auto-fill, minmax(150, 1fr))" gap="12">
539
+ <mason:View background="#eee" padding="12">
540
+ <mason:Text textContent="Card 1" />
541
+ </mason:View>
542
+ <mason:View background="#eee" padding="12">
543
+ <mason:Text textContent="Card 2" />
544
+ </mason:View>
545
+ <mason:View background="#eee" padding="12">
546
+ <mason:Text textContent="Card 3" />
547
+ </mason:View>
548
+ </mason:View>
549
+ ```
550
+
551
+ ---
552
+
553
+ ### Gap & Spacing
554
+
555
+ | Property | Type | Description |
556
+ |----------|------|-------------|
557
+ | `gap` | `Gap` | Shorthand for row and column gap |
558
+ | `rowGap` | `Length` | Gap between rows |
559
+ | `columnGap` | `Length` | Gap between columns |
560
+ | `gridGap` | `Gap` | Alias for `gap` |
561
+ | `gridRowGap` | `Gap` | Alias for `rowGap` |
562
+ | `gridColumnGap` | `Gap` | Alias for `columnGap` |
563
+
564
+ ```xml
565
+ <!-- Uniform gap -->
566
+ <mason:View display="flex" gap="16">...</mason:View>
567
+
568
+ <!-- Different row and column gaps -->
569
+ <mason:View display="grid" rowGap="8" columnGap="16">...</mason:View>
570
+ ```
571
+
572
+ ---
573
+
574
+ ### Overflow & Scrolling
575
+
576
+ | Property | Type | Description |
577
+ |----------|------|-------------|
578
+ | `overflow` | `Overflow` | Overflow behavior (both axes) |
579
+ | `overflowX` | `Overflow` | Horizontal overflow |
580
+ | `overflowY` | `Overflow` | Vertical overflow |
581
+ | `scrollBarWidth` | `Length` | Width of the scrollbar |
582
+
583
+ **Overflow values:** `'visible'` | `'hidden'` | `'scroll'` | `'clip'` | `'auto'`
584
+
585
+ ```xml
586
+ <mason:View overflow="hidden" height="200">
587
+ <!-- Content that may exceed 200 height will be clipped -->
588
+ </mason:View>
589
+
590
+ <mason:Scroll overflowY="scroll" height="400">
591
+ <!-- Vertically scrollable content -->
592
+ </mason:Scroll>
593
+ ```
594
+
595
+ ---
596
+
597
+ ### Text & Typography
598
+
599
+ | Property | Type | Description |
600
+ |----------|------|-------------|
601
+ | `textContent` | `string` | The text to display |
602
+ | `color` | `Color` | Text color |
603
+ | `fontSize` | `number` | Font size |
604
+ | `fontWeight` | `string` | Font weight (e.g., `'bold'`, `'400'`) |
605
+ | `fontStyle` | `string` | Font style (`'normal'`, `'italic'`) |
606
+ | `lineHeight` | `number` | Line height |
607
+ | `letterSpacing` | `number` | Spacing between characters |
608
+ | `textAlignment` | `string` | Text alignment |
609
+ | `textWrap` | `TextWrap` | Text wrapping behavior |
610
+ | `textOverFlow` | `TextOverflow` | Text overflow behavior |
611
+ | `verticalAlign` | `VerticalAlign` | Vertical alignment |
612
+
613
+ **TextWrap values:** `'nowrap'` | `'wrap'` | `'balance'`
614
+
615
+ **TextOverflow values:** `'clip'` | `'ellipsis'`
616
+
617
+ ```xml
618
+ <mason:Text
619
+ textContent="This is a long text that will be truncated with an ellipsis if it overflows"
620
+ textWrap="nowrap"
621
+ textOverFlow="ellipsis"
622
+ maxWidth="200"
623
+ fontSize="16"
624
+ lineHeight="1.4"
625
+ color="#333" />
626
+ ```
627
+
628
+ ---
629
+
630
+ ### Visual Styling
631
+
632
+ | Property | Type | Description |
633
+ |----------|------|-------------|
634
+ | `background` | `string` | Background (color, gradient, etc.) |
635
+ | `backgroundColor` | `Color` | Background color |
636
+ | `border` | `string` | Shorthand border |
637
+ | `borderRadius` | `string` | Corner rounding |
638
+ | `borderLeftWidth` | `Length` | Left border width |
639
+ | `borderRightWidth` | `Length` | Right border width |
640
+ | `borderTopWidth` | `Length` | Top border width |
641
+ | `borderBottomWidth` | `Length` | Bottom border width |
642
+ | `filter` | `string` | CSS filter effects |
643
+
644
+ ```xml
645
+ <mason:View
646
+ background="#f5f5f5"
647
+ border="1 solid #ccc"
648
+ borderRadius="12"
649
+ padding="16">
650
+ <mason:Text textContent="Styled card" />
651
+ </mason:View>
652
+ ```
653
+
654
+ ---
655
+
656
+ ## Events
657
+
658
+ MasonKit components support DOM-like event handling.
659
+
660
+ ### Supported Events
661
+
662
+ | Event | Fires On | Description |
663
+ |-------|----------|-------------|
664
+ | `input` | `Input` | When the input value changes |
665
+ | `change` | `Input` | When the input value is committed |
666
+
667
+ ### Event Class
668
+
669
+ | Property | Type | Description |
670
+ |----------|------|-------------|
671
+ | `type` | `string` (readonly) | Event type name |
672
+ | `target` | `any` (readonly) | The element that fired the event |
673
+ | `currentTarget` | `any` (readonly) | The element the listener is attached to |
674
+ | `bubbles` | `boolean` (readonly) | Whether the event bubbles |
675
+ | `cancelable` | `boolean` (readonly) | Whether the event is cancelable |
676
+ | `isComposing` | `boolean` (readonly) | Whether the event is part of a composition |
677
+ | `timeStamp` | `number` (readonly) | Time at which the event was created |
678
+ | `defaultPrevented` | `boolean` (readonly) | Whether `preventDefault()` was called |
679
+
680
+ | Method | Description |
681
+ |--------|-------------|
682
+ | `stopPropagation()` | Stops further propagation |
683
+ | `stopImmediatePropagation()` | Stops immediate propagation |
684
+ | `preventDefault()` | Prevents the default action |
685
+
686
+ ### InputEvent Class (extends Event)
687
+
688
+ | Property | Type | Description |
689
+ |----------|------|-------------|
690
+ | `data` | `any` (readonly) | The input data (string for text, array for file inputs) |
691
+ | `inputType` | `string` (readonly) | The type of input change |
692
+
693
+ ### Example: Listening to Events
694
+
695
+ ```xml
696
+ <mason:Input type="text" input="{{ onInput }}" />
697
+ ```
698
+
699
+ ```typescript
700
+ onInput(event: InputEvent) {
701
+ console.log('Input data:', event.data);
702
+ console.log('Input type:', event.inputType);
703
+ console.log('Target value:', event.target.value);
704
+ }
705
+ ```
706
+
707
+ ```typescript
708
+ // Programmatic event listeners
709
+ const input = page.getViewById('myInput');
710
+ input.addEventListener('input', (event) => {
711
+ console.log('Value changed:', event.data);
712
+ });
713
+ ```
714
+
715
+ ---
716
+
717
+ ## Types Reference
718
+
719
+ ### InputType
720
+
721
+ ```typescript
722
+ type InputType =
723
+ | 'text' | 'password' | 'email' | 'number' | 'tel' | 'url'
724
+ | 'search' | 'date' | 'time' | 'datetime-local' | 'month'
725
+ | 'week' | 'color' | 'checkbox' | 'radio' | 'button'
726
+ | 'submit' | 'reset' | 'file' | 'range';
727
+ ```
728
+
729
+ ### Length
730
+
731
+ ```typescript
732
+ // A numeric length value — supports px, %, and dip units
733
+ type Length =
734
+ | CoreTypes.dip
735
+ | CoreTypes.LengthDipUnit
736
+ | CoreTypes.LengthPxUnit
737
+ | CoreTypes.LengthPercentUnit
738
+ | `${number}px`
739
+ | `${number}%`
740
+ | `${number}dip`;
741
+ ```
742
+
743
+ ### LengthAuto
744
+
745
+ ```typescript
746
+ // Same as Length, but also accepts 'auto'
747
+ type LengthAuto = Length | 'auto';
748
+ ```
749
+
750
+ ### Display
751
+
752
+ ```typescript
753
+ type Display = 'none' | 'flex' | 'grid' | 'block' | 'inline'
754
+ | 'inline-block' | 'inline-flex' | 'inline-grid';
755
+ ```
756
+
757
+ ### Position
758
+
759
+ ```typescript
760
+ type Position = 'absolute' | 'relative';
761
+ ```
762
+
763
+ ### BoxSizing
764
+
765
+ ```typescript
766
+ type BoxSizing = 'border-box' | 'content-box';
767
+ ```
768
+
769
+ ### Overflow
770
+
771
+ ```typescript
772
+ type Overflow = 'visible' | 'hidden' | 'scroll' | 'clip' | 'auto';
773
+ ```
774
+
775
+ ### FlexDirection
776
+
777
+ ```typescript
778
+ type FlexDirection = 'column' | 'row' | 'column-reverse' | 'row-reverse';
779
+ ```
780
+
781
+ ### FlexWrap
782
+
783
+ ```typescript
784
+ type FlexWrap = 'no-wrap' | 'wrap' | 'wrap-reverse';
785
+ ```
786
+
787
+ ### AlignItems / AlignSelf
788
+
789
+ ```typescript
790
+ type AlignItems = 'normal' | 'flex-start' | 'flex-end' | 'start'
791
+ | 'end' | 'center' | 'baseline' | 'stretch';
792
+ type AlignSelf = AlignItems;
793
+ ```
794
+
795
+ ### AlignContent / JustifyContent
796
+
797
+ ```typescript
798
+ type AlignContent = 'normal' | 'flex-start' | 'flex-end' | 'start'
799
+ | 'end' | 'center' | 'stretch' | 'space-between'
800
+ | 'space-around' | 'space-evenly';
801
+ type JustifyContent = AlignContent;
802
+ ```
803
+
804
+ ### JustifyItems / JustifySelf
805
+
806
+ ```typescript
807
+ type JustifyItems = AlignItems;
808
+ type JustifySelf = AlignSelf;
809
+ ```
810
+
811
+ ### GridAutoFlow
812
+
813
+ ```typescript
814
+ type GridAutoFlow = 'row' | 'column' | 'row dense' | 'column dense' | 'dense';
815
+ ```
816
+
817
+ ### Gap
818
+
819
+ ```typescript
820
+ type GapTypeUnit = 'px' | 'dip' | '%';
821
+ type Gap = `${string}${GapTypeUnit} ${string}${GapTypeUnit}` | SizeLengthType;
822
+ ```
823
+
824
+ ### VerticalAlign
825
+
826
+ ```typescript
827
+ type VerticalAlign = 'baseline' | 'sub' | 'super' | 'text-top'
828
+ | 'text-bottom' | 'middle' | 'top' | 'bottom'
829
+ | Length | number;
830
+ ```
831
+
832
+ ---
833
+
834
+ ## Framework Support
835
+
836
+ MasonKit supports multiple NativeScript frameworks:
837
+
838
+ | Framework | Status |
839
+ |-----------|--------|
840
+ | NativeScript Core (XML) | Supported |
841
+ | Angular | Supported |
842
+ | Vue 3 (`nativescript-vue`) | Supported |
843
+ | React (`react-nativescript`) | Supported |
844
+ | Svelte | Supported |
845
+
846
+ Framework detection is automatic. MasonKit detects which framework is in use and adapts its internal child management accordingly.
847
+
848
+ ### Vue 3 Example
849
+
850
+ ```vue
851
+ <template>
852
+ <Div display="flex" flexDirection="column" padding="16">
853
+ <H1 textContent="Hello from Vue!" />
854
+ <P textContent="MasonKit works with NativeScript Vue." />
855
+ <Button textContent="Click Me" @tap="onTap" />
856
+ </Div>
857
+ </template>
858
+
859
+ <script setup>
860
+ function onTap() {
861
+ console.log('Button tapped!');
862
+ }
863
+ </script>
864
+ ```
865
+
866
+ ### Angular Example
867
+
868
+ ```typescript
869
+ import { registerElement } from '@nativescript/angular';
870
+ import { View, Text, Div, H1, P } from '@triniwiz/nativescript-masonkit';
871
+
872
+ registerElement('MasonView', () => View);
873
+ registerElement('MasonText', () => Text);
874
+ registerElement('MasonDiv', () => Div);
875
+ registerElement('MasonH1', () => H1);
876
+ registerElement('MasonP', () => P);
877
+ ```
878
+
879
+ ```html
880
+ <MasonDiv display="flex" flexDirection="column" padding="16">
881
+ <MasonH1 textContent="Hello from Angular!"></MasonH1>
882
+ <MasonP textContent="MasonKit works with NativeScript Angular."></MasonP>
883
+ </MasonDiv>
884
+ ```