@triniwiz/nativescript-masonkit 1.0.0-beta.87 → 1.0.0-beta.89

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 (113) hide show
  1. package/DOCS.md +16 -4
  2. package/angular/README.md +204 -0
  3. package/angular/fesm2022/triniwiz-nativescript-masonkit-angular.mjs +496 -0
  4. package/angular/fesm2022/triniwiz-nativescript-masonkit-angular.mjs.map +1 -0
  5. package/angular/package.json +19 -0
  6. package/angular/types/triniwiz-nativescript-masonkit-angular.d.ts +181 -0
  7. package/button/index.android.d.ts +2 -1
  8. package/button/index.ios.d.ts +2 -1
  9. package/button/index.windows.d.ts +2 -1
  10. package/common.d.ts +102 -1
  11. package/common.js +93 -2
  12. package/common.js.map +1 -1
  13. package/img/index.android.d.ts +2 -1
  14. package/img/index.ios.d.ts +2 -1
  15. package/img/index.windows.d.ts +2 -1
  16. package/index.d.ts +21 -10
  17. package/input/index.android.d.ts +5 -1
  18. package/input/index.android.js +12 -1
  19. package/input/index.android.js.map +1 -1
  20. package/input/index.ios.d.ts +7 -1
  21. package/input/index.ios.js +12 -1
  22. package/input/index.ios.js.map +1 -1
  23. package/input/index.windows.d.ts +6 -1
  24. package/package.json +3 -1
  25. package/platforms/android/masonkit-release.aar +0 -0
  26. package/platforms/ios/Mason.xcframework/Info.plist +0 -34
  27. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +32 -0
  28. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/mason_native.h +27 -2
  29. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
  30. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  31. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +2837 -826
  32. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +43 -1
  33. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  34. package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftinterface +43 -1
  35. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  36. package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +8477 -8378
  37. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +64 -0
  38. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/mason_native.h +27 -2
  39. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
  40. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  41. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  42. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +2837 -826
  43. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +43 -1
  44. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  45. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftinterface +43 -1
  46. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +2837 -826
  47. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +43 -1
  48. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  49. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +43 -1
  50. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +28 -28
  51. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  52. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +8472 -8373
  53. package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +8110 -8017
  54. package/platforms/windows/arm64/NativeScript.Mason.dll +0 -0
  55. package/platforms/windows/arm64/NativeScript.Mason.winmd +0 -0
  56. package/platforms/windows/x64/NativeScript.Mason.dll +0 -0
  57. package/platforms/windows/x64/NativeScript.Mason.winmd +0 -0
  58. package/properties.d.ts +4 -0
  59. package/properties.js +58 -15
  60. package/properties.js.map +1 -1
  61. package/style.d.ts +38 -37
  62. package/style.js +333 -110
  63. package/style.js.map +1 -1
  64. package/text/index.android.d.ts +3 -1
  65. package/text/index.ios.d.ts +3 -1
  66. package/text/index.windows.d.ts +2 -1
  67. package/textarea/index.android.d.ts +6 -2
  68. package/textarea/index.ios.d.ts +6 -2
  69. package/textarea/index.windows.d.ts +6 -2
  70. package/tree/index.android.js +8 -4
  71. package/tree/index.android.js.map +1 -1
  72. package/tree/index.ios.js +11 -0
  73. package/tree/index.ios.js.map +1 -1
  74. package/utils/index.android.d.ts +15 -6
  75. package/utils/index.android.js +83 -2
  76. package/utils/index.android.js.map +1 -1
  77. package/utils/index.ios.d.ts +15 -6
  78. package/utils/index.ios.js +83 -2
  79. package/utils/index.ios.js.map +1 -1
  80. package/utils/index.windows.d.ts +11 -2
  81. package/utils/index.windows.js +9 -0
  82. package/utils/index.windows.js.map +1 -1
  83. package/view/index.ios.js +14 -1
  84. package/view/index.ios.js.map +1 -1
  85. package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Headers/Mason-Swift.h +0 -1982
  86. package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Headers/Mason.h +0 -25
  87. package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Headers/mason_native.h +0 -499
  88. package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Info.plist +0 -0
  89. package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Mason +0 -0
  90. package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-xros.swiftsourceinfo +0 -0
  91. package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.abi.json +0 -98937
  92. package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.private.swiftinterface +0 -3475
  93. package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.swiftdoc +0 -0
  94. package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.swiftinterface +0 -3475
  95. package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/module.modulemap +0 -10
  96. package/platforms/ios/Mason.xcframework/xros-arm64/dSYMs/Mason.framework.dSYM/Contents/Info.plist +0 -20
  97. package/platforms/ios/Mason.xcframework/xros-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  98. package/platforms/ios/Mason.xcframework/xros-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +0 -2134
  99. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Headers/Mason-Swift.h +0 -1982
  100. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Headers/Mason.h +0 -25
  101. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Headers/mason_native.h +0 -499
  102. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Info.plist +0 -0
  103. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Mason +0 -0
  104. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-xros-simulator.swiftsourceinfo +0 -0
  105. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.abi.json +0 -98937
  106. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.private.swiftinterface +0 -3475
  107. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.swiftdoc +0 -0
  108. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.swiftinterface +0 -3475
  109. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/module.modulemap +0 -10
  110. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/_CodeSignature/CodeResources +0 -212
  111. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/dSYMs/Mason.framework.dSYM/Contents/Info.plist +0 -20
  112. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
  113. package/platforms/ios/Mason.xcframework/xros-arm64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +0 -2134
package/DOCS.md CHANGED
@@ -392,8 +392,8 @@ Length values support `px`, `%`, `dip`, and `auto` (for margins).
392
392
 
393
393
  | Property | Type | Description |
394
394
  |----------|------|-------------|
395
- | `width` | `LengthAuto` | Element width |
396
- | `height` | `LengthAuto` | Element height |
395
+ | `width` | `DimensionLength` | Element width |
396
+ | `height` | `DimensionLength` | Element height |
397
397
  | `minWidth` | `LengthAuto` | Minimum width |
398
398
  | `minHeight` | `LengthAuto` | Minimum height |
399
399
  | `maxWidth` | `LengthAuto` | Maximum width |
@@ -492,7 +492,7 @@ If you want transforms to be driven from the native style buffer (Rust) and casc
492
492
 
493
493
  **FlexDirection values:** `'row'` | `'column'` | `'row-reverse'` | `'column-reverse'`
494
494
 
495
- **FlexWrap values:** `'no-wrap'` | `'wrap'` | `'wrap-reverse'`
495
+ **FlexWrap values:** `'no-wrap'` | `'wrap'` | `'wrap-reverse'` | `'balance'` | `'balance-reverse'`
496
496
 
497
497
  **Alignment values:** `'normal'` | `'flex-start'` | `'flex-end'` | `'start'` | `'end'` | `'center'` | `'baseline'` | `'stretch'`
498
498
 
@@ -793,6 +793,18 @@ type Length =
793
793
  type LengthAuto = Length | 'auto';
794
794
  ```
795
795
 
796
+ ### DimensionLength
797
+
798
+ ```typescript
799
+ type DimensionLength = LengthAuto
800
+ | 'min-content'
801
+ | 'max-content'
802
+ | 'fit-content'
803
+ | `fit-content(${string})`
804
+ | 'stretch'
805
+ | 'content';
806
+ ```
807
+
796
808
  ### Display
797
809
 
798
810
  ```typescript
@@ -827,7 +839,7 @@ type FlexDirection = 'column' | 'row' | 'column-reverse' | 'row-reverse';
827
839
  ### FlexWrap
828
840
 
829
841
  ```typescript
830
- type FlexWrap = 'no-wrap' | 'wrap' | 'wrap-reverse';
842
+ type FlexWrap = 'no-wrap' | 'wrap' | 'wrap-reverse' | 'balance' | 'balance-reverse';
831
843
  ```
832
844
 
833
845
  ### AlignItems / AlignSelf
@@ -0,0 +1,204 @@
1
+ # @triniwiz/nativescript-masonkit/angular
2
+
3
+ Angular support for MasonKit. Registers every MasonKit element with
4
+ `@nativescript/angular`, and makes your Angular components lay out like they do
5
+ on the web.
6
+
7
+ ## Setup
8
+
9
+ MasonKit ships this entry point, so there is nothing extra to install. Call
10
+ `installMasonKit()` in `main.ts`, before the bootstrap:
11
+
12
+ ```ts
13
+ // main.ts
14
+ import { bootstrapApplication, provideNativeScriptRouter, runNativeScriptAngularApp } from '@nativescript/angular';
15
+ import { installMasonKit } from '@triniwiz/nativescript-masonkit/angular';
16
+
17
+ import { AppComponent } from './app.component';
18
+ import { routes } from './app.routes';
19
+
20
+ installMasonKit();
21
+
22
+ runNativeScriptAngularApp({
23
+ appModuleBootstrap: () =>
24
+ bootstrapApplication(AppComponent, {
25
+ providers: [provideNativeScriptRouter(routes)],
26
+ }),
27
+ });
28
+ ```
29
+
30
+ It must run before Angular bootstraps, so an `NgModule` import or an
31
+ `APP_INITIALIZER` is too late. Calling it again is safe.
32
+
33
+ Requires `@nativescript/angular` 19 or later. Works with both NgModule and
34
+ standalone apps.
35
+
36
+ ## Using the elements
37
+
38
+ Everything is registered for you - no `registerElement` calls, no `imports`
39
+ entry. Add `NO_ERRORS_SCHEMA` to your component as you would for any
40
+ NativeScript element:
41
+
42
+ ```ts
43
+ @Component({
44
+ selector: 'app-story',
45
+ schemas: [NO_ERRORS_SCHEMA],
46
+ template: `
47
+ <div class="card">
48
+ <h3 class="title">{{ story.title }}</h3>
49
+ <span class="domain">{{ story.domain }}</span>
50
+ </div>
51
+ `,
52
+ })
53
+ export class StoryComponent {}
54
+ ```
55
+
56
+ ```scss
57
+ .card {
58
+ display: flex;
59
+ flex-direction: column;
60
+ gap: 4;
61
+ padding: 10;
62
+ }
63
+ ```
64
+
65
+ > **Lengths:** use unitless values. In NativeScript `px` means _physical device
66
+ > pixels_, so `padding: 12px` lands at ~4 on a 3x screen. Unitless is the dip
67
+ > value, which is what matches a CSS pixel in a browser.
68
+
69
+ ### Available elements
70
+
71
+ | From | Elements |
72
+ | ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
73
+ | `@triniwiz/nativescript-masonkit` | `View`, `Text`, `Scroll`, `Img`, `Button`, `Input`, `TextArea`, `Br`, `Ul`, `Ol`, `Li` |
74
+ | `@triniwiz/nativescript-masonkit/web` | `div`, `section`, `header`, `footer`, `article`, `main`, `nav`, `aside`, `span`, `code`, `h1`-`h6`, `p`, `ul`, `li`, `blockquote`, `b`, `strong`, `a` |
75
+
76
+ Each name works in its original, lowercase and kebab-case spelling, so `<View>`,
77
+ `<view>` and `<text-area>` all resolve.
78
+
79
+ Note that these **replace** some core elements in Angular templates: `<Button>`,
80
+ `<img>` and `<Span>` resolve to MasonKit's versions rather than core's `Button`,
81
+ `Image` and `Span`. Turn off either set if you would rather keep the classic
82
+ widgets:
83
+
84
+ ```ts
85
+ installMasonKit({ web: false }); // MasonKit elements only
86
+ installMasonKit({ mason: false }); // HTML-shaped elements only
87
+ ```
88
+
89
+ ## Component hosts
90
+
91
+ By default, your component's own element is a real MasonKit box. That means
92
+ styling a component from the outside works the way it does on the web:
93
+
94
+ ```html
95
+ <app-story class="card"></app-story>
96
+ ```
97
+
98
+ ```scss
99
+ app-story,
100
+ .card {
101
+ display: flex;
102
+ flex-direction: column;
103
+ background-color: #fff;
104
+ border-radius: 8;
105
+ padding: 10;
106
+ }
107
+ ```
108
+
109
+ Without this, Angular component elements produce no native view at all, so
110
+ `class`, `backgroundColor`, `margin` and host bindings on them are silently
111
+ dropped and the component is invisible to layout. Nesting components then gives
112
+ you a layout that doesn't match your template.
113
+
114
+ Turn it off if you want stock `@nativescript/angular` behaviour and only the
115
+ element registrations:
116
+
117
+ ```ts
118
+ installMasonKit({ componentHosts: false });
119
+ ```
120
+
121
+ ### Page-level components
122
+
123
+ Components that a router outlet loads are page roots - their template is an
124
+ `<ActionBar>` plus content that fills the `Page`. Those need to stay transparent,
125
+ and they are detected automatically, but detection can only correct things from
126
+ the second render onwards. List them to get the first render right too:
127
+
128
+ ```ts
129
+ installMasonKit({
130
+ componentHosts: {
131
+ passthrough: ['app-feed', 'app-detail', /-page$/],
132
+ },
133
+ });
134
+ ```
135
+
136
+ Components _below_ a page root are unaffected and stay real MasonKit boxes.
137
+
138
+ ## Options
139
+
140
+ `installMasonKit(options?)`
141
+
142
+ | Option | Type | Default | Description |
143
+ | ---------------- | --------------------------------- | ------- | --------------------------------------------- |
144
+ | `mason` | `boolean` | `true` | Register MasonKit's own elements |
145
+ | `web` | `boolean` | `true` | Register the HTML-shaped elements from `/web` |
146
+ | `componentHosts` | `boolean \| ComponentHostOptions` | `true` | Make component elements real MasonKit boxes |
147
+
148
+ `componentHosts` options
149
+
150
+ | Option | Type | Default | Description |
151
+ | ----------------------- | ---------------------- | ------- | ------------------------------------------------------------------------- |
152
+ | `enabled` | `boolean` | `true` | Turn host mode off, keeping element registration |
153
+ | `passthrough` | `PassthroughMatcher[]` | `[]` | Elements to keep transparent. Strings, regexes or predicates |
154
+ | `autoDetectPassthrough` | `boolean` | `true` | Recognise page roots automatically |
155
+ | `rootAsPassthrough` | `boolean` | `true` | Keep the app's root component transparent so the tree gets a sized parent |
156
+
157
+ Router outlets (`page-router-outlet`, `ns-empty-outlet`, `router-outlet`) are
158
+ always transparent; your `passthrough` entries are added to that list.
159
+
160
+ ## API
161
+
162
+ | Export | Purpose |
163
+ | ------------------------------------- | ---------------------------------------------------------- |
164
+ | `installMasonKit(options?)` | The whole integration. Call before bootstrap |
165
+ | `registerMasonKitElements(options?)` | Element registration only |
166
+ | `enableMasonComponentHosts(options?)` | Component-host mode only |
167
+ | `masonMeta` | `ViewClassMeta` for registering your own MasonKit subclass |
168
+
169
+ Registering your own MasonKit subclass:
170
+
171
+ ```ts
172
+ import { registerElement } from '@nativescript/angular';
173
+ import { masonMeta } from '@triniwiz/nativescript-masonkit/angular';
174
+
175
+ registerElement('MyBox', () => MyBox, masonMeta);
176
+ ```
177
+
178
+ `masonMeta` is what keeps Angular's view updates (`@if`, `@for`, router changes)
179
+ in step with MasonKit's own child tracking. Without it, children are appended
180
+ rather than inserted in position, and removals leave stale entries behind.
181
+
182
+ ## Troubleshooting
183
+
184
+ **A routed screen shows only its ActionBar, everything else is blank.**
185
+ That component is a page root whose host box collapsed. Add its selector to
186
+ `passthrough`. Check the console - auto-detection logs the name.
187
+
188
+ **Everything looks cramped, but the text size is right.**
189
+ Lengths are in `px`. In NativeScript that means physical pixels. Drop the unit.
190
+
191
+ **A component's `class` or `backgroundColor` does nothing.**
192
+ Component host mode is off, or that element is in `passthrough`.
193
+
194
+ **`No known component for element X`.**
195
+ With host mode on this error can't occur - unknown names silently become boxes,
196
+ so a typo'd element renders as an empty box instead of throwing.
197
+
198
+ ## See also
199
+
200
+ - [`apps/demo-angular`](../../../apps/demo-angular) - a small Hacker News client
201
+ plus a layout stress screen covering insertion order, conditional siblings and
202
+ nested hosts
203
+ - [`apps/hn-reference.html`](../../../apps/hn-reference.html) - the same screens
204
+ in a browser, for side-by-side comparison