@getcortexlabs/mavis 0.0.0-stage → 0.1.0-alpha.2

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 (246) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +38 -2
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +2 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/native/accessibility-layout.d.ts +3 -0
  8. package/dist/native/accessibility-layout.d.ts.map +1 -0
  9. package/dist/native/accessibility-layout.ios.d.ts +3 -0
  10. package/dist/native/accessibility-layout.ios.d.ts.map +1 -0
  11. package/dist/native/accessibility-layout.ios.js +5 -0
  12. package/dist/native/accessibility-layout.ios.js.map +1 -0
  13. package/dist/native/accessibility-layout.js +2 -0
  14. package/dist/native/accessibility-layout.js.map +1 -0
  15. package/dist/native/appearance.android.d.ts +4 -0
  16. package/dist/native/appearance.android.d.ts.map +1 -0
  17. package/dist/native/appearance.android.js +55 -0
  18. package/dist/native/appearance.android.js.map +1 -0
  19. package/dist/native/appearance.d.ts +4 -0
  20. package/dist/native/appearance.d.ts.map +1 -0
  21. package/dist/native/appearance.js +31 -0
  22. package/dist/native/appearance.js.map +1 -0
  23. package/dist/native/box.android.d.ts +5 -0
  24. package/dist/native/box.android.d.ts.map +1 -0
  25. package/dist/native/box.android.js +7 -0
  26. package/dist/native/box.android.js.map +1 -0
  27. package/dist/native/box.d.ts +2 -0
  28. package/dist/native/box.d.ts.map +1 -0
  29. package/dist/native/box.ios.d.ts +6 -0
  30. package/dist/native/box.ios.d.ts.map +1 -0
  31. package/dist/native/box.ios.js +12 -0
  32. package/dist/native/box.ios.js.map +1 -0
  33. package/dist/native/box.js +3 -0
  34. package/dist/native/box.js.map +1 -0
  35. package/dist/native/button.android.d.ts +11 -0
  36. package/dist/native/button.android.d.ts.map +1 -0
  37. package/dist/native/button.android.js +31 -0
  38. package/dist/native/button.android.js.map +1 -0
  39. package/dist/native/button.d.ts +2 -0
  40. package/dist/native/button.d.ts.map +1 -0
  41. package/dist/native/button.ios.d.ts +5 -0
  42. package/dist/native/button.ios.d.ts.map +1 -0
  43. package/dist/native/button.ios.js +16 -0
  44. package/dist/native/button.ios.js.map +1 -0
  45. package/dist/native/button.js +2 -0
  46. package/dist/native/button.js.map +1 -0
  47. package/dist/native/flex-children.d.ts +4 -0
  48. package/dist/native/flex-children.d.ts.map +1 -0
  49. package/dist/native/flex-children.js +12 -0
  50. package/dist/native/flex-children.js.map +1 -0
  51. package/dist/native/flex-layout.android.d.ts +7 -0
  52. package/dist/native/flex-layout.android.d.ts.map +1 -0
  53. package/dist/native/flex-layout.android.js +16 -0
  54. package/dist/native/flex-layout.android.js.map +1 -0
  55. package/dist/native/flex-layout.d.ts +2 -0
  56. package/dist/native/flex-layout.d.ts.map +1 -0
  57. package/dist/native/flex-layout.ios.d.ts +9 -0
  58. package/dist/native/flex-layout.ios.d.ts.map +1 -0
  59. package/dist/native/flex-layout.ios.js +87 -0
  60. package/dist/native/flex-layout.ios.js.map +1 -0
  61. package/dist/native/flex-layout.js +3 -0
  62. package/dist/native/flex-layout.js.map +1 -0
  63. package/dist/native/input-description.android.d.ts +4 -0
  64. package/dist/native/input-description.android.d.ts.map +1 -0
  65. package/dist/native/input-description.android.js +18 -0
  66. package/dist/native/input-description.android.js.map +1 -0
  67. package/dist/native/input.android.d.ts +5 -0
  68. package/dist/native/input.android.d.ts.map +1 -0
  69. package/dist/native/input.android.js +28 -0
  70. package/dist/native/input.android.js.map +1 -0
  71. package/dist/native/label.d.ts +2 -0
  72. package/dist/native/label.d.ts.map +1 -0
  73. package/dist/native/label.ios.d.ts +6 -0
  74. package/dist/native/label.ios.d.ts.map +1 -0
  75. package/dist/native/label.ios.js +16 -0
  76. package/dist/native/label.ios.js.map +1 -0
  77. package/dist/native/label.js +2 -0
  78. package/dist/native/label.js.map +1 -0
  79. package/dist/native/press.d.ts +4 -0
  80. package/dist/native/press.d.ts.map +1 -0
  81. package/dist/native/press.js +12 -0
  82. package/dist/native/press.js.map +1 -0
  83. package/dist/native/screen-scroll.d.ts +2 -0
  84. package/dist/native/screen-scroll.d.ts.map +1 -0
  85. package/dist/native/screen-scroll.ios.d.ts +16 -0
  86. package/dist/native/screen-scroll.ios.d.ts.map +1 -0
  87. package/dist/native/screen-scroll.ios.js +116 -0
  88. package/dist/native/screen-scroll.ios.js.map +1 -0
  89. package/dist/native/screen-scroll.js +2 -0
  90. package/dist/native/screen-scroll.js.map +1 -0
  91. package/dist/native/slider.android.d.ts +18 -0
  92. package/dist/native/slider.android.d.ts.map +1 -0
  93. package/dist/native/slider.android.js +18 -0
  94. package/dist/native/slider.android.js.map +1 -0
  95. package/dist/native/slider.d.ts +2 -0
  96. package/dist/native/slider.d.ts.map +1 -0
  97. package/dist/native/slider.ios.d.ts +8 -0
  98. package/dist/native/slider.ios.d.ts.map +1 -0
  99. package/dist/native/slider.ios.js +24 -0
  100. package/dist/native/slider.ios.js.map +1 -0
  101. package/dist/native/slider.js +2 -0
  102. package/dist/native/slider.js.map +1 -0
  103. package/dist/native/text-field.android.d.ts +18 -0
  104. package/dist/native/text-field.android.d.ts.map +1 -0
  105. package/dist/native/text-field.android.js +43 -0
  106. package/dist/native/text-field.android.js.map +1 -0
  107. package/dist/native/text-field.d.ts +2 -0
  108. package/dist/native/text-field.d.ts.map +1 -0
  109. package/dist/native/text-field.js +2 -0
  110. package/dist/native/text-field.js.map +1 -0
  111. package/dist/native/text-view.android.d.ts +10 -0
  112. package/dist/native/text-view.android.d.ts.map +1 -0
  113. package/dist/native/text-view.android.js +22 -0
  114. package/dist/native/text-view.android.js.map +1 -0
  115. package/dist/native/text-view.d.ts +2 -0
  116. package/dist/native/text-view.d.ts.map +1 -0
  117. package/dist/native/text-view.js +2 -0
  118. package/dist/native/text-view.js.map +1 -0
  119. package/dist/theme/resolve.d.ts +3 -0
  120. package/dist/theme/resolve.d.ts.map +1 -0
  121. package/dist/theme/resolve.js +8 -0
  122. package/dist/theme/resolve.js.map +1 -0
  123. package/dist/theme/themes.d.ts +6 -0
  124. package/dist/theme/themes.d.ts.map +1 -0
  125. package/dist/theme/themes.js +83 -0
  126. package/dist/theme/themes.js.map +1 -0
  127. package/dist/theme/types.d.ts +50 -0
  128. package/dist/theme/types.d.ts.map +1 -0
  129. package/dist/theme/types.js +2 -0
  130. package/dist/theme/types.js.map +1 -0
  131. package/dist/vue/accessibility.d.ts +23 -0
  132. package/dist/vue/accessibility.d.ts.map +1 -0
  133. package/dist/vue/accessibility.js +33 -0
  134. package/dist/vue/accessibility.js.map +1 -0
  135. package/dist/vue/components/MButton.d.ts +120 -0
  136. package/dist/vue/components/MButton.d.ts.map +1 -0
  137. package/dist/vue/components/MButton.js +92 -0
  138. package/dist/vue/components/MButton.js.map +1 -0
  139. package/dist/vue/components/MCard.d.ts +127 -0
  140. package/dist/vue/components/MCard.d.ts.map +1 -0
  141. package/dist/vue/components/MCard.js +40 -0
  142. package/dist/vue/components/MCard.js.map +1 -0
  143. package/dist/vue/components/MIcon.d.ts +55 -0
  144. package/dist/vue/components/MIcon.d.ts.map +1 -0
  145. package/dist/vue/components/MIcon.js +34 -0
  146. package/dist/vue/components/MIcon.js.map +1 -0
  147. package/dist/vue/components/MInput.d.ts +193 -0
  148. package/dist/vue/components/MInput.d.ts.map +1 -0
  149. package/dist/vue/components/MInput.js +164 -0
  150. package/dist/vue/components/MInput.js.map +1 -0
  151. package/dist/vue/components/MReveal.d.ts +145 -0
  152. package/dist/vue/components/MReveal.d.ts.map +1 -0
  153. package/dist/vue/components/MReveal.js +61 -0
  154. package/dist/vue/components/MReveal.js.map +1 -0
  155. package/dist/vue/components/MScreen.d.ts +37 -0
  156. package/dist/vue/components/MScreen.d.ts.map +1 -0
  157. package/dist/vue/components/MScreen.js +34 -0
  158. package/dist/vue/components/MScreen.js.map +1 -0
  159. package/dist/vue/components/MSlider.d.ts +76 -0
  160. package/dist/vue/components/MSlider.d.ts.map +1 -0
  161. package/dist/vue/components/MSlider.js +63 -0
  162. package/dist/vue/components/MSlider.js.map +1 -0
  163. package/dist/vue/components/MText.d.ts +114 -0
  164. package/dist/vue/components/MText.d.ts.map +1 -0
  165. package/dist/vue/components/MText.js +32 -0
  166. package/dist/vue/components/MText.js.map +1 -0
  167. package/dist/vue/components/layout.d.ts +392 -0
  168. package/dist/vue/components/layout.d.ts.map +1 -0
  169. package/dist/vue/components/layout.js +63 -0
  170. package/dist/vue/components/layout.js.map +1 -0
  171. package/dist/vue/global-components.d.ts +21 -0
  172. package/dist/vue/global-components.d.ts.map +1 -0
  173. package/dist/vue/global-components.js +2 -0
  174. package/dist/vue/global-components.js.map +1 -0
  175. package/dist/vue/index.d.ts +22 -0
  176. package/dist/vue/index.d.ts.map +1 -0
  177. package/dist/vue/index.js +39 -0
  178. package/dist/vue/index.js.map +1 -0
  179. package/dist/vue/layout-context.d.ts +5 -0
  180. package/dist/vue/layout-context.d.ts.map +1 -0
  181. package/dist/vue/layout-context.js +7 -0
  182. package/dist/vue/layout-context.js.map +1 -0
  183. package/dist/vue/props.d.ts +17 -0
  184. package/dist/vue/props.d.ts.map +1 -0
  185. package/dist/vue/props.js +19 -0
  186. package/dist/vue/props.js.map +1 -0
  187. package/dist/vue/text-content.d.ts +4 -0
  188. package/dist/vue/text-content.d.ts.map +1 -0
  189. package/dist/vue/text-content.js +17 -0
  190. package/dist/vue/text-content.js.map +1 -0
  191. package/dist/vue/theme.d.ts +177 -0
  192. package/dist/vue/theme.d.ts.map +1 -0
  193. package/dist/vue/theme.js +17 -0
  194. package/dist/vue/theme.js.map +1 -0
  195. package/dist/vue/use-press.d.ts +8 -0
  196. package/dist/vue/use-press.d.ts.map +1 -0
  197. package/dist/vue/use-press.js +29 -0
  198. package/dist/vue/use-press.js.map +1 -0
  199. package/fonts/LICENSE +45 -0
  200. package/fonts/lucide.ttf +0 -0
  201. package/package.json +69 -4
  202. package/platforms/android/include.gradle +6 -0
  203. package/platforms/android/java/com/mavis/ui/AccessibleSlider.java +86 -0
  204. package/platforms/android/java/com/mavis/ui/Box.java +30 -0
  205. package/platforms/android/java/com/mavis/ui/FlexLayout.java +81 -0
  206. package/src/index.ts +1 -0
  207. package/src/native/accessibility-layout.ios.ts +9 -0
  208. package/src/native/accessibility-layout.ts +3 -0
  209. package/src/native/appearance.android.ts +75 -0
  210. package/src/native/appearance.ts +33 -0
  211. package/src/native/box.android.ts +11 -0
  212. package/src/native/box.ios.ts +14 -0
  213. package/src/native/box.ts +2 -0
  214. package/src/native/button.android.ts +38 -0
  215. package/src/native/button.ios.ts +15 -0
  216. package/src/native/button.ts +1 -0
  217. package/src/native/flex-children.ts +12 -0
  218. package/src/native/flex-layout.android.ts +22 -0
  219. package/src/native/flex-layout.ios.ts +113 -0
  220. package/src/native/flex-layout.ts +2 -0
  221. package/src/native/input.android.ts +39 -0
  222. package/src/native/label.ios.ts +16 -0
  223. package/src/native/label.ts +1 -0
  224. package/src/native/press.ts +13 -0
  225. package/src/native/screen-scroll.ios.ts +140 -0
  226. package/src/native/screen-scroll.ts +1 -0
  227. package/src/native/slider.android.ts +52 -0
  228. package/src/native/slider.ios.ts +26 -0
  229. package/src/native/slider.ts +1 -0
  230. package/src/native/text-field.android.ts +61 -0
  231. package/src/native/text-field.ts +1 -0
  232. package/src/native/text-view.android.ts +28 -0
  233. package/src/native/text-view.ts +1 -0
  234. package/src/vue/accessibility.ts +50 -0
  235. package/src/vue/components/MButton.ts +116 -0
  236. package/src/vue/components/MCard.ts +50 -0
  237. package/src/vue/components/MIcon.ts +41 -0
  238. package/src/vue/components/MInput.ts +198 -0
  239. package/src/vue/components/MReveal.ts +62 -0
  240. package/src/vue/components/MScreen.ts +43 -0
  241. package/src/vue/components/MSlider.ts +70 -0
  242. package/src/vue/components/MText.ts +46 -0
  243. package/src/vue/components/layout.ts +89 -0
  244. package/src/vue/index.ts +55 -0
  245. package/src/vue/props.ts +26 -0
  246. package/src/vue/use-press.ts +32 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Rafael Augusto
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,39 @@
1
- # Temporary Holding Version
1
+ # Mavis UI for NativeScript
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ NativeScript components and themes for Mavis UI `0.1.0-alpha.2`, starting with Vue. Experimental prerelease for testing in real apps; the API can change between alpha versions. Licensed under MIT.
4
+
5
+ In an existing NativeScript-Vue application:
6
+
7
+ ```sh
8
+ npm install @getcortexlabs/mavis@0.1.0-alpha.2 @rafaelaugusto/jolt@0.1.0-rc.1
9
+ ```
10
+
11
+ ```ts
12
+ import { createApp, h } from 'nativescript-vue'
13
+ import { createMavis } from '@getcortexlabs/mavis/vue'
14
+ import App from './App.vue'
15
+
16
+ // App.vue has one MScreen at its root.
17
+ createApp({ render: () => h('Frame', {}, [h(App)]) })
18
+ .use(createMavis())
19
+ .start()
20
+ ```
21
+
22
+ Use the existing navigation host when your app already has one. MScreen represents a native Page; do not nest Screens. Android keyboard avoidance requires `adjustResize` on the Activity.
23
+
24
+ The plugin registers Screen, Row, Column, Box, Card, Text, Icon, Button, Input, Slider and Reveal. Icons use the bundled Lucide font: copy `fonts/lucide.ttf` from this package into the app's `fonts` folder. Use `MButton` or `m-button` in Vue templates; with `@nativescript/vite`, use `MButton`, because that integration compiles hyphenated tags as native elements. Both `@nativescript/webpack` and `@nativescript/vite` pick up the Mavis iOS and Android files. Themes are exported from `@getcortexlabs/mavis`; components and theme context are available from `/vue`.
25
+
26
+ - `@getcortexlabs/mavis-core`: shared themes, spacing, slider step conversion and Vue context.
27
+ - `src/native/`: NativeScript behavior, including owned Jolt press effects.
28
+ - `platforms/android/java/`: the native flex measurement adapter, compiled by NativeScript.
29
+ - `src/vue/`: Vue components, reactive theme context, and optional global registration.
30
+
31
+ The root entry exports themes and their types. The `/vue` entry exports components, `createMavis`, and `useMavisTheme`. `createMavis({ theme, darkTheme })` follows the device appearance and `setAppearance` overrides it. NativeScript Core 9.1.3+, Jolt 0.1.0-rc.1+, and NativeScript-Vue 3.1.3+ are the initial baseline. The consuming Vue app installs all three; Vue is optional on the package metadata so importing theme values does not require a Vue renderer.
32
+
33
+ Tested package-consumer baseline: NativeScript Core 9.1.3, NativeScript-Vue 3.1.3, Jolt 0.1.0-rc.1, Android runtime 9.1.1 and iOS runtime 9.1.0. See [Getting started](https://mavis-ui.getcortexlabs.com/guide/foundation) for setup.
34
+
35
+ Changes to the Android adapter require a native build. If an existing checkout reports a missing `com.mavis.ui.FlexLayout` after upgrading, run `ns clean` in the app directory and rebuild to regenerate native metadata.
36
+
37
+ Other NativeScript frameworks come after the Vue implementation. No adapters for React Native, Flutter, or direct native use are implemented here.
38
+
39
+ Deep native layouts can be expensive ([#56](https://github.com/getcortexlabs/mavis-ui/issues/56)); VoiceOver can skip a newly inserted offscreen status ([#54](https://github.com/getcortexlabs/mavis-ui/issues/54)). Physical Android and full keyboard coverage remain pending. Read the [release notes](https://github.com/getcortexlabs/mavis-ui/blob/main/CHANGELOG.md) before adopting the alpha.
@@ -0,0 +1,2 @@
1
+ export * from '@getcortexlabs/mavis-core';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from '@getcortexlabs/mavis-core';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { View } from '@nativescript/core';
2
+ export declare function notifyAccessibilityLayout(_focused?: View): void;
3
+ //# sourceMappingURL=accessibility-layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessibility-layout.d.ts","sourceRoot":"","sources":["../../src/native/accessibility-layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAE9C,wBAAgB,yBAAyB,CAAC,QAAQ,CAAC,EAAE,IAAI,QAAI"}
@@ -0,0 +1,3 @@
1
+ import type { View } from '@nativescript/core';
2
+ export declare function notifyAccessibilityLayout(focused?: View): void;
3
+ //# sourceMappingURL=accessibility-layout.ios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessibility-layout.ios.d.ts","sourceRoot":"","sources":["../../src/native/accessibility-layout.ios.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAK9C,wBAAgB,yBAAyB,CAAC,OAAO,CAAC,EAAE,IAAI,QAGvD"}
@@ -0,0 +1,5 @@
1
+ export function notifyAccessibilityLayout(focused) {
2
+ // Preserve the current focus while VoiceOver refreshes its reading order.
3
+ UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, focused?.ios ?? null);
4
+ }
5
+ //# sourceMappingURL=accessibility-layout.ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessibility-layout.ios.js","sourceRoot":"","sources":["../../src/native/accessibility-layout.ios.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,yBAAyB,CAAC,OAAc;IACtD,0EAA0E;IAC1E,+BAA+B,CAAC,wCAAwC,EAAE,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,CAAA;AACjG,CAAC"}
@@ -0,0 +1,2 @@
1
+ export function notifyAccessibilityLayout(_focused) { }
2
+ //# sourceMappingURL=accessibility-layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessibility-layout.js","sourceRoot":"","sources":["../../src/native/accessibility-layout.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,yBAAyB,CAAC,QAAe,IAAG,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { AppearanceSource } from '@getcortexlabs/mavis-core/vue';
2
+ /** Reads `uiMode` from the application configuration directly; Core's window cache can lag on older devices. */
3
+ export declare function systemAppearance(): AppearanceSource;
4
+ //# sourceMappingURL=appearance.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appearance.android.d.ts","sourceRoot":"","sources":["../../src/native/appearance.android.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAoCjF,gHAAgH;AAChH,wBAAgB,gBAAgB,IAAI,gBAAgB,CAoCnD"}
@@ -0,0 +1,55 @@
1
+ import { Application, Utils } from '@nativescript/core';
2
+ // android.content.res.Configuration.UI_MODE_NIGHT_MASK and UI_MODE_NIGHT_YES.
3
+ const NIGHT_MASK = 0x30;
4
+ const NIGHT_YES = 0x20;
5
+ function context() {
6
+ try {
7
+ return Utils.android.getApplicationContext();
8
+ }
9
+ catch {
10
+ // The application context does not exist before launch.
11
+ return undefined;
12
+ }
13
+ }
14
+ const appearanceOf = (configuration) => (configuration.uiMode & NIGHT_MASK) === NIGHT_YES ? 'dark' : 'light';
15
+ /** Reads `uiMode` from the application configuration directly; Core's window cache can lag on older devices. */
16
+ export function systemAppearance() {
17
+ return {
18
+ current() {
19
+ const app = context();
20
+ return app ? appearanceOf(app.getResources().getConfiguration()) : undefined;
21
+ },
22
+ observe(listener) {
23
+ let registered;
24
+ const register = () => {
25
+ const app = context();
26
+ if (!app || registered)
27
+ return;
28
+ const callbacks = new android.content.ComponentCallbacks2({
29
+ onConfigurationChanged: (configuration) => listener(appearanceOf(configuration)),
30
+ onLowMemory() { },
31
+ onTrimMemory() { },
32
+ });
33
+ app.registerComponentCallbacks(callbacks);
34
+ registered = { app, callbacks };
35
+ listener(appearanceOf(app.getResources().getConfiguration()));
36
+ };
37
+ // An Android 8 phone skipped one of four configuration deliveries; resuming re-reads it.
38
+ const resumed = () => {
39
+ const app = context();
40
+ if (app)
41
+ listener(appearanceOf(app.getResources().getConfiguration()));
42
+ };
43
+ register();
44
+ Application.on(Application.launchEvent, register);
45
+ Application.on(Application.resumeEvent, resumed);
46
+ return () => {
47
+ Application.off(Application.launchEvent, register);
48
+ Application.off(Application.resumeEvent, resumed);
49
+ registered?.app.unregisterComponentCallbacks(registered.callbacks);
50
+ registered = undefined;
51
+ };
52
+ },
53
+ };
54
+ }
55
+ //# sourceMappingURL=appearance.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appearance.android.js","sourceRoot":"","sources":["../../src/native/appearance.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAqBvD,8EAA8E;AAC9E,MAAM,UAAU,GAAG,IAAI,CAAA;AACvB,MAAM,SAAS,GAAG,IAAI,CAAA;AAEtB,SAAS,OAAO;IACd,IAAI,CAAC;QACH,OAAO,KAAK,CAAC,OAAO,CAAC,qBAAqB,EA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AE,CAAA;gBACrB,IAAI,GAAG;oBAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAA;YACxE,CAAC,CAAA;YACD,QAAQ,EAAE,CAAA;YACV,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAA;YACjD,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA;YAChD,OAAO,GAAG,EAAE;gBACV,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAA;gBAClD,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA;gBACjD,UAAU,EAAE,GAAG,CAAC,4BAA4B,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;gBAClE,UAAU,GAAG,SAAS,CAAA;YACxB,CAAC,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { AppearanceSource } from '@getcortexlabs/mavis-core/vue';
2
+ /** Core reports the primary window's appearance and raises `systemAppearanceChanged` on changes. */
3
+ export declare function systemAppearance(): AppearanceSource;
4
+ //# sourceMappingURL=appearance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appearance.d.ts","sourceRoot":"","sources":["../../src/native/appearance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAc,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAajF,oGAAoG;AACpG,wBAAgB,gBAAgB,IAAI,gBAAgB,CAiBnD"}
@@ -0,0 +1,31 @@
1
+ import { Application } from '@nativescript/core';
2
+ function read() {
3
+ try {
4
+ return (Application.primaryWindow?.systemAppearance() ?? Application.systemAppearance() ?? undefined);
5
+ }
6
+ catch {
7
+ // Android has no application context before launch; the launch event resolves it below.
8
+ return undefined;
9
+ }
10
+ }
11
+ /** Core reports the primary window's appearance and raises `systemAppearanceChanged` on changes. */
12
+ export function systemAppearance() {
13
+ return {
14
+ current: read,
15
+ observe(listener) {
16
+ const changed = (args) => listener(args.newValue);
17
+ const launched = () => {
18
+ const value = read();
19
+ if (value)
20
+ listener(value);
21
+ };
22
+ Application.on(Application.systemAppearanceChangedEvent, changed);
23
+ Application.on(Application.launchEvent, launched);
24
+ return () => {
25
+ Application.off(Application.systemAppearanceChangedEvent, changed);
26
+ Application.off(Application.launchEvent, launched);
27
+ };
28
+ },
29
+ };
30
+ }
31
+ //# sourceMappingURL=appearance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appearance.js","sourceRoot":"","sources":["../../src/native/appearance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAGhD,SAAS,IAAI;IACX,IAAI,CAAC;QACH,OAAO,CACL,WAAW,CAAC,aAAa,EAAE,gBAAgB,EAAE,IAAI,WAAW,CAAC,gBAAgB,EAAE,IAAI,SAAS,CAC7F,CAAA;IACH,CAAC;IAAC,MAAM,CAAC;QACP,wFAAwF;QACxF,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC;AAED,oGAAoG;AACpG,MAAM,UAAU,gBAAgB;IAC9B,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,CAAC,QAAQ;YACd,MAAM,OAAO,GAAG,CAAC,IAA8B,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;YAC3E,MAAM,QAAQ,GAAG,GAAG,EAAE;gBACpB,MAAM,KAAK,GAAG,IAAI,EAAE,CAAA;gBACpB,IAAI,KAAK;oBAAE,QAAQ,CAAC,KAAK,CAAC,CAAA;YAC5B,CAAC,CAAA;YACD,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAA;YACjE,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAA;YACjD,OAAO,GAAG,EAAE;gBACV,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,4BAA4B,EAAE,OAAO,CAAC,CAAA;gBAClE,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAA;YACpD,CAAC,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { GridLayout } from '@nativescript/core';
2
+ export declare class MavisBox extends GridLayout {
3
+ createNativeView(): object;
4
+ }
5
+ //# sourceMappingURL=box.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"box.android.d.ts","sourceRoot":"","sources":["../../src/native/box.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAM/C,qBAAa,QAAS,SAAQ,UAAU;IACtC,gBAAgB;CAGjB"}
@@ -0,0 +1,7 @@
1
+ import { GridLayout } from '@nativescript/core';
2
+ export class MavisBox extends GridLayout {
3
+ createNativeView() {
4
+ return new com.mavis.ui.Box(this._context);
5
+ }
6
+ }
7
+ //# sourceMappingURL=box.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"box.android.js","sourceRoot":"","sources":["../../src/native/box.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAM/C,MAAM,OAAO,QAAS,SAAQ,UAAU;IACtC,gBAAgB;QACd,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC5C,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export { GridLayout as MavisBox } from '@nativescript/core';
2
+ //# sourceMappingURL=box.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../src/native/box.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,IAAI,QAAQ,EAAE,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { GridLayout } from '@nativescript/core';
2
+ /** An auto-height Box takes its content height when the parent only limits the available space. */
3
+ export declare class MavisBox extends GridLayout {
4
+ onMeasure(widthSpec: number, heightSpec: number): void;
5
+ }
6
+ //# sourceMappingURL=box.ios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"box.ios.d.ts","sourceRoot":"","sources":["../../src/native/box.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAS,MAAM,oBAAoB,CAAA;AAItD,mGAAmG;AACnG,qBAAa,QAAS,SAAQ,UAAU;IACtC,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;CAOhD"}
@@ -0,0 +1,12 @@
1
+ import { GridLayout, Utils } from '@nativescript/core';
2
+ const { layout } = Utils;
3
+ /** An auto-height Box takes its content height when the parent only limits the available space. */
4
+ export class MavisBox extends GridLayout {
5
+ onMeasure(widthSpec, heightSpec) {
6
+ const relaxed = this.effectiveHeight < 0 && layout.getMeasureSpecMode(heightSpec) === layout.AT_MOST
7
+ ? layout.makeMeasureSpec(0, layout.UNSPECIFIED)
8
+ : heightSpec;
9
+ super.onMeasure(widthSpec, relaxed);
10
+ }
11
+ }
12
+ //# sourceMappingURL=box.ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"box.ios.js","sourceRoot":"","sources":["../../src/native/box.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAEtD,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAA;AAExB,mGAAmG;AACnG,MAAM,OAAO,QAAS,SAAQ,UAAU;IACtC,SAAS,CAAC,SAAiB,EAAE,UAAkB;QAC7C,MAAM,OAAO,GACX,IAAI,CAAC,eAAe,GAAG,CAAC,IAAI,MAAM,CAAC,kBAAkB,CAAC,UAAU,CAAC,KAAK,MAAM,CAAC,OAAO;YAClF,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC;YAC/C,CAAC,CAAC,UAAU,CAAA;QAChB,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IACrC,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ // NativeScript resolves the platform implementation before loading this module.
2
+ export { GridLayout as MavisBox } from '@nativescript/core';
3
+ //# sourceMappingURL=box.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"box.js","sourceRoot":"","sources":["../../src/native/box.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,OAAO,EAAE,UAAU,IAAI,QAAQ,EAAE,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,11 @@
1
+ import { Button, type FormattedString } from '@nativescript/core';
2
+ import { formattedTextProperty } from '@nativescript/core/ui/text-base';
3
+ import { accessibilityLabelProperty, accessibilityValueProperty } from '@nativescript/core/accessibility/accessibility-properties';
4
+ /** Core copies formatted text into `text`, so its description would repeat the label after icon glyphs. */
5
+ export declare class MavisButton extends Button {
6
+ [accessibilityLabelProperty.setNative]: (value: string) => void;
7
+ [accessibilityValueProperty.setNative]: (value: string) => void;
8
+ [formattedTextProperty.setNative]: (value: FormattedString) => void;
9
+ private describe;
10
+ }
11
+ //# sourceMappingURL=button.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.android.d.ts","sourceRoot":"","sources":["../../src/native/button.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;AACvE,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,2DAA2D,CAAA;AAQlE,2GAA2G;AAC3G,qBAAa,WAAY,SAAQ,MAAM;IACrC,CAAC,0BAA0B,CAAC,SAAS,CAAC,UAAQ,MAAM;IAKpD,CAAC,0BAA0B,CAAC,SAAS,CAAC,UAAQ,MAAM;IAKpD,CAAC,qBAAqB,CAAC,SAAS,CAAC,UAAQ,eAAe;IAKxD,OAAO,CAAC,QAAQ;CAOjB"}
@@ -0,0 +1,31 @@
1
+ import { Button } from '@nativescript/core';
2
+ import { formattedTextProperty } from '@nativescript/core/ui/text-base';
3
+ import { accessibilityLabelProperty, accessibilityValueProperty, } from '@nativescript/core/accessibility/accessibility-properties';
4
+ const base = Button.prototype;
5
+ const setLabel = base[accessibilityLabelProperty.setNative];
6
+ const setValue = base[accessibilityValueProperty.setNative];
7
+ const setFormatted = base[formattedTextProperty.setNative];
8
+ /** Core copies formatted text into `text`, so its description would repeat the label after icon glyphs. */
9
+ export class MavisButton extends Button {
10
+ [accessibilityLabelProperty.setNative](value) {
11
+ setLabel.call(this, value);
12
+ this.describe();
13
+ }
14
+ [accessibilityValueProperty.setNative](value) {
15
+ setValue.call(this, value);
16
+ this.describe();
17
+ }
18
+ [formattedTextProperty.setNative](value) {
19
+ setFormatted.call(this, value);
20
+ this.describe();
21
+ }
22
+ describe() {
23
+ if (!this.formattedText)
24
+ return;
25
+ const description = [this.accessibilityLabel, this.accessibilityValue]
26
+ .filter(Boolean)
27
+ .join('. ');
28
+ this.nativeViewProtected?.setContentDescription(description);
29
+ }
30
+ }
31
+ //# sourceMappingURL=button.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.android.js","sourceRoot":"","sources":["../../src/native/button.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAwB,MAAM,oBAAoB,CAAA;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;AACvE,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,2DAA2D,CAAA;AAGlE,MAAM,IAAI,GAAG,MAAM,CAAC,SAA8C,CAAA;AAClE,MAAM,QAAQ,GAAG,IAAI,CAAC,0BAA0B,CAAC,SAAS,CAAE,CAAA;AAC5D,MAAM,QAAQ,GAAG,IAAI,CAAC,0BAA0B,CAAC,SAAS,CAAE,CAAA;AAC5D,MAAM,YAAY,GAAG,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAE,CAAA;AAE3D,2GAA2G;AAC3G,MAAM,OAAO,WAAY,SAAQ,MAAM;IACrC,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC,KAAa;QAClD,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QAC1B,IAAI,CAAC,QAAQ,EAAE,CAAA;IACjB,CAAC;IAED,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC,KAAa;QAClD,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QAC1B,IAAI,CAAC,QAAQ,EAAE,CAAA;IACjB,CAAC;IAED,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC,KAAsB;QACtD,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QAC9B,IAAI,CAAC,QAAQ,EAAE,CAAA;IACjB,CAAC;IAEO,QAAQ;QACd,IAAI,CAAC,IAAI,CAAC,aAAa;YAAE,OAAM;QAC/B,MAAM,WAAW,GAAG,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,CAAC;aACnE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,IAAI,CAAC,CAAA;QACb,IAAI,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAA;IAC9D,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export { Button as MavisButton } from '@nativescript/core';
2
+ //# sourceMappingURL=button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/native/button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { Button } from '@nativescript/core';
2
+ export declare class MavisButton extends Button {
3
+ onMeasure(widthSpec: number, heightSpec: number): void;
4
+ }
5
+ //# sourceMappingURL=button.ios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.ios.d.ts","sourceRoot":"","sources":["../../src/native/button.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAE3C,qBAAa,WAAY,SAAQ,MAAM;IACrC,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;CAWhD"}
@@ -0,0 +1,16 @@
1
+ import { Button } from '@nativescript/core';
2
+ export class MavisButton extends Button {
3
+ onMeasure(widthSpec, heightSpec) {
4
+ const button = this.ios;
5
+ // UIButton updates titleLabel during its layout pass. Wrapped measurement needs the
6
+ // current title now, otherwise it measures the previous label after a text change.
7
+ if (button.currentAttributedTitle) {
8
+ button.titleLabel.attributedText = button.currentAttributedTitle;
9
+ }
10
+ else {
11
+ button.titleLabel.text = button.currentTitle;
12
+ }
13
+ super.onMeasure(widthSpec, heightSpec);
14
+ }
15
+ }
16
+ //# sourceMappingURL=button.ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.ios.js","sourceRoot":"","sources":["../../src/native/button.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAE3C,MAAM,OAAO,WAAY,SAAQ,MAAM;IACrC,SAAS,CAAC,SAAiB,EAAE,UAAkB;QAC7C,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAA;QACvB,oFAAoF;QACpF,mFAAmF;QACnF,IAAI,MAAM,CAAC,sBAAsB,EAAE,CAAC;YAClC,MAAM,CAAC,UAAU,CAAC,cAAc,GAAG,MAAM,CAAC,sBAAsB,CAAA;QAClE,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,UAAU,CAAC,IAAI,GAAG,MAAM,CAAC,YAAY,CAAA;QAC9C,CAAC;QACD,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;IACxC,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export { Button as MavisButton } from '@nativescript/core';
2
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/native/button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { FlexboxLayout, View } from '@nativescript/core';
2
+ /** Children without their own shrink keep their natural height in a column, like Mavis children. */
3
+ export declare function applyColumnShrink(layout: FlexboxLayout, child: View): void;
4
+ //# sourceMappingURL=flex-children.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flex-children.d.ts","sourceRoot":"","sources":["../../src/native/flex-children.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAK7D,oGAAoG;AACpG,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,QAKnE"}
@@ -0,0 +1,12 @@
1
+ import { flexShrinkProperty } from '@nativescript/core/ui/layouts/flexbox-layout';
2
+ const source = flexShrinkProperty.sourceKey;
3
+ /** Children without their own shrink keep their natural height in a column, like Mavis children. */
4
+ export function applyColumnShrink(layout, child) {
5
+ if (!layout.flexDirection.startsWith('column'))
6
+ return;
7
+ // Core records the value source even when a local value equals the default, unlike isSet.
8
+ const declared = child.style[source];
9
+ if (!declared)
10
+ child.style.flexShrink = 0;
11
+ }
12
+ //# sourceMappingURL=flex-children.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flex-children.js","sourceRoot":"","sources":["../../src/native/flex-children.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAA;AAEjF,MAAM,MAAM,GAAG,kBAAkB,CAAC,SAAS,CAAA;AAE3C,oGAAoG;AACpG,MAAM,UAAU,iBAAiB,CAAC,MAAqB,EAAE,KAAW;IAClE,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,OAAM;IACtD,0FAA0F;IAC1F,MAAM,QAAQ,GAAI,KAAK,CAAC,KAAuD,CAAC,MAAM,CAAC,CAAA;IACvF,IAAI,CAAC,QAAQ;QAAE,KAAK,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,CAAA;AAC3C,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { FlexboxLayout, type View } from '@nativescript/core';
2
+ export declare class MavisFlexLayout extends FlexboxLayout {
3
+ createNativeView(): object;
4
+ _registerLayoutChild(child: View): void;
5
+ onLoaded(): void;
6
+ }
7
+ //# sourceMappingURL=flex-layout.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flex-layout.android.d.ts","sourceRoot":"","sources":["../../src/native/flex-layout.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAO7D,qBAAa,eAAgB,SAAQ,aAAa;IAChD,gBAAgB;IAIhB,oBAAoB,CAAC,KAAK,EAAE,IAAI;IAKhC,QAAQ;CAIT"}
@@ -0,0 +1,16 @@
1
+ import { FlexboxLayout } from '@nativescript/core';
2
+ import { applyColumnShrink } from './flex-children';
3
+ export class MavisFlexLayout extends FlexboxLayout {
4
+ createNativeView() {
5
+ return new com.mavis.ui.FlexLayout(this._context);
6
+ }
7
+ _registerLayoutChild(child) {
8
+ super._registerLayoutChild(child);
9
+ applyColumnShrink(this, child);
10
+ }
11
+ onLoaded() {
12
+ super.onLoaded();
13
+ this.eachLayoutChild((child) => applyColumnShrink(this, child));
14
+ }
15
+ }
16
+ //# sourceMappingURL=flex-layout.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flex-layout.android.js","sourceRoot":"","sources":["../../src/native/flex-layout.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAa,MAAM,oBAAoB,CAAA;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAMnD,MAAM,OAAO,eAAgB,SAAQ,aAAa;IAChD,gBAAgB;QACd,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACnD,CAAC;IAED,oBAAoB,CAAC,KAAW;QAC9B,KAAK,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAA;QACjC,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IAChC,CAAC;IAED,QAAQ;QACN,KAAK,CAAC,QAAQ,EAAE,CAAA;QAChB,IAAI,CAAC,eAAe,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAA;IACjE,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export { FlexboxLayout as MavisFlexLayout } from '@nativescript/core';
2
+ //# sourceMappingURL=flex-layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flex-layout.d.ts","sourceRoot":"","sources":["../../src/native/flex-layout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,9 @@
1
+ import { FlexboxLayout, type View } from '@nativescript/core';
2
+ export declare class MavisFlexLayout extends FlexboxLayout {
3
+ _registerLayoutChild(child: View): void;
4
+ onLoaded(): void;
5
+ _determineMainSize(direction: string, widthSpec: number, heightSpec: number): void;
6
+ private keepRowGaps;
7
+ private measureAtWidth;
8
+ }
9
+ //# sourceMappingURL=flex-layout.ios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flex-layout.ios.d.ts","sourceRoot":"","sources":["../../src/native/flex-layout.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAS,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAoBpE,qBAAa,eAAgB,SAAQ,aAAa;IAChD,oBAAoB,CAAC,KAAK,EAAE,IAAI;IAKhC,QAAQ;IAKR,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IA+C3E,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,cAAc;CAoBvB"}
@@ -0,0 +1,87 @@
1
+ import { FlexboxLayout, Utils } from '@nativescript/core';
2
+ import { applyColumnShrink } from './flex-children';
3
+ const { layout } = Utils;
4
+ const base = FlexboxLayout.prototype;
5
+ export class MavisFlexLayout extends FlexboxLayout {
6
+ _registerLayoutChild(child) {
7
+ super._registerLayoutChild(child);
8
+ applyColumnShrink(this, child);
9
+ }
10
+ onLoaded() {
11
+ super.onLoaded();
12
+ this.eachLayoutChild((child) => applyColumnShrink(this, child));
13
+ }
14
+ _determineMainSize(direction, widthSpec, heightSpec) {
15
+ if (direction === 'column' || direction === 'column-reverse')
16
+ this.keepRowGaps();
17
+ if (direction === 'column' && this.alignItems === 'stretch' && this.flexWrap === 'nowrap') {
18
+ const measurement = this;
19
+ const width = layout.getMeasureSpecSize(widthSpec) -
20
+ this.effectivePaddingLeft -
21
+ this.effectivePaddingRight;
22
+ let index = 0;
23
+ for (const line of measurement._flexLines) {
24
+ for (let i = 0; i < line._itemCount; i++, index++) {
25
+ const child = measurement._getReorderedChildAt(index);
26
+ if (!child || child.isCollapsed)
27
+ continue;
28
+ const alignSelf = FlexboxLayout.getAlignSelf(child);
29
+ if (alignSelf !== 'auto' && alignSelf !== 'stretch')
30
+ continue;
31
+ const oldHeight = child.getMeasuredHeight();
32
+ const cross = layout.getMeasureSpecMode(widthSpec) === layout.EXACTLY ? width : line._crossSize;
33
+ this.measureAtWidth(child, Math.max(0, cross - child.effectiveMarginLeft - child.effectiveMarginRight), heightSpec);
34
+ line._mainSize += child.getMeasuredHeight() - oldHeight;
35
+ }
36
+ }
37
+ }
38
+ base._determineMainSize.call(this, direction, widthSpec, heightSpec);
39
+ if (direction !== 'row' && direction !== 'row-reverse')
40
+ return;
41
+ const measurement = this;
42
+ let index = 0;
43
+ for (const line of measurement._flexLines) {
44
+ let height = 0;
45
+ for (let i = 0; i < line._itemCount; i++, index++) {
46
+ const child = measurement._getReorderedChildAt(index);
47
+ if (!child || child.isCollapsed)
48
+ continue;
49
+ const margins = child.effectiveMarginTop + child.effectiveMarginBottom;
50
+ this.measureAtWidth(child, child.getMeasuredWidth(), heightSpec);
51
+ height = Math.max(height, child.getMeasuredHeight() + margins);
52
+ }
53
+ line._crossSize = height;
54
+ }
55
+ }
56
+ // Core 9.1.3 adds row gaps to a column's main size but not to its gap total, so the growth and
57
+ // shrink passes measured the column shorter by every gap and squeezed shrinking children.
58
+ keepRowGaps() {
59
+ const measurement = this;
60
+ if (!(measurement.effectiveRowGap > 0))
61
+ return;
62
+ let index = 0;
63
+ for (const line of measurement._flexLines) {
64
+ let visible = 0;
65
+ for (let i = 0; i < line._itemCount; i++, index++) {
66
+ const child = measurement._getReorderedChildAt(index);
67
+ if (child && !child.isCollapsed)
68
+ visible++;
69
+ }
70
+ line._gapLengthInMainSize = measurement.effectiveRowGap * Math.max(0, visible - 1);
71
+ }
72
+ }
73
+ measureAtWidth(child, width, heightSpec) {
74
+ const available = Math.max(0, layout.getMeasureSpecSize(heightSpec) -
75
+ this.effectivePaddingTop -
76
+ this.effectivePaddingBottom -
77
+ child.effectiveMarginTop -
78
+ child.effectiveMarginBottom);
79
+ const mode = layout.getMeasureSpecMode(heightSpec) === layout.UNSPECIFIED
80
+ ? layout.UNSPECIFIED
81
+ : layout.AT_MOST;
82
+ child.measure(layout.makeMeasureSpec(width, layout.EXACTLY), child.effectiveHeight >= 0
83
+ ? layout.makeMeasureSpec(child.effectiveHeight, layout.EXACTLY)
84
+ : layout.makeMeasureSpec(available, mode));
85
+ }
86
+ }
87
+ //# s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AAG,CAAC,CAAC,CAAA;QACpF,CAAC;IACH,CAAC;IAEO,cAAc,CAAC,KAAW,EAAE,KAAa,EAAE,UAAkB;QACnE,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CACxB,CAAC,EACD,MAAM,CAAC,kBAAkB,CAAC,UAAU,CAAC;YACnC,IAAI,CAAC,mBAAmB;YACxB,IAAI,CAAC,sBAAsB;YAC3B,KAAK,CAAC,kBAAkB;YACxB,KAAK,CAAC,qBAAqB,CAC9B,CAAA;QACD,MAAM,IAAI,GACR,MAAM,CAAC,kBAAkB,CAAC,UAAU,CAAC,KAAK,MAAM,CAAC,WAAW;YAC1D,CAAC,CAAC,MAAM,CAAC,WAAW;YACpB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAA;QACpB,KAAK,CAAC,OAAO,CACX,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EAC7C,KAAK,CAAC,eAAe,IAAI,CAAC;YACxB,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,eAAe,EAAE,MAAM,CAAC,OAAO,CAAC;YAC/D,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC,CAC5C,CAAA;IACH,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ // NativeScript resolves the platform implementation before loading this module.
2
+ export { FlexboxLayout as MavisFlexLayout } from '@nativescript/core';
3
+ //# sourceMappingURL=flex-layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flex-layout.js","sourceRoot":"","sources":["../../src/native/flex-layout.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,OAAO,EAAE,aAAa,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { TextField, TextView } from '@nativescript/core';
2
+ export declare function updateInputDescription(view: TextField | TextView): void;
3
+ export declare function writeInputText(view: TextField | TextView, write: () => void): void;
4
+ //# sourceMappingURL=input-description.android.d.ts.map