@getcortexlabs/mavis 0.1.0-alpha.3 → 0.1.0-alpha.5

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 (451) hide show
  1. package/README.md +9 -5
  2. package/dist/files.d.ts +4 -0
  3. package/dist/files.d.ts.map +1 -0
  4. package/dist/files.js +3 -0
  5. package/dist/files.js.map +1 -0
  6. package/dist/native/avatar-image.d.ts +4 -0
  7. package/dist/native/avatar-image.d.ts.map +1 -0
  8. package/dist/native/avatar-image.js +12 -0
  9. package/dist/native/avatar-image.js.map +1 -0
  10. package/dist/native/avatar-label.android.d.ts +9 -0
  11. package/dist/native/avatar-label.android.d.ts.map +1 -0
  12. package/dist/native/avatar-label.android.js +9 -0
  13. package/dist/native/avatar-label.android.js.map +1 -0
  14. package/dist/native/avatar-label.d.ts +2 -0
  15. package/dist/native/avatar-label.d.ts.map +1 -0
  16. package/dist/native/avatar-label.js +2 -0
  17. package/dist/native/avatar-label.js.map +1 -0
  18. package/dist/native/box.ios.d.ts.map +1 -1
  19. package/dist/native/box.ios.js +16 -1
  20. package/dist/native/box.ios.js.map +1 -1
  21. package/dist/native/button.ios.d.ts +9 -1
  22. package/dist/native/button.ios.d.ts.map +1 -1
  23. package/dist/native/button.ios.js +17 -1
  24. package/dist/native/button.ios.js.map +1 -1
  25. package/dist/native/checkbox.android.d.ts +7 -0
  26. package/dist/native/checkbox.android.d.ts.map +1 -0
  27. package/dist/native/checkbox.android.js +26 -0
  28. package/dist/native/checkbox.android.js.map +1 -0
  29. package/dist/native/checkbox.d.ts +7 -0
  30. package/dist/native/checkbox.d.ts.map +1 -0
  31. package/dist/native/checkbox.js +7 -0
  32. package/dist/native/checkbox.js.map +1 -0
  33. package/dist/native/combobox-editor.android.d.ts +3 -0
  34. package/dist/native/combobox-editor.android.d.ts.map +1 -0
  35. package/dist/native/combobox-editor.android.js +5 -0
  36. package/dist/native/combobox-editor.android.js.map +1 -0
  37. package/dist/native/combobox-editor.d.ts +4 -0
  38. package/dist/native/combobox-editor.d.ts.map +1 -0
  39. package/dist/native/combobox-editor.js +5 -0
  40. package/dist/native/combobox-editor.js.map +1 -0
  41. package/dist/native/composed-button.android.d.ts +4 -0
  42. package/dist/native/composed-button.android.d.ts.map +1 -0
  43. package/dist/native/composed-button.android.js +53 -0
  44. package/dist/native/composed-button.android.js.map +1 -0
  45. package/dist/native/composed-button.d.ts +3 -0
  46. package/dist/native/composed-button.d.ts.map +1 -0
  47. package/dist/native/composed-button.js +4 -0
  48. package/dist/native/composed-button.js.map +1 -0
  49. package/dist/native/dialog.android.d.ts +12 -0
  50. package/dist/native/dialog.android.d.ts.map +1 -0
  51. package/dist/native/dialog.android.js +46 -0
  52. package/dist/native/dialog.android.js.map +1 -0
  53. package/dist/native/dialog.d.ts +12 -0
  54. package/dist/native/dialog.d.ts.map +1 -0
  55. package/dist/native/dialog.ios.d.ts +12 -0
  56. package/dist/native/dialog.ios.d.ts.map +1 -0
  57. package/dist/native/dialog.ios.js +13 -0
  58. package/dist/native/dialog.ios.js.map +1 -0
  59. package/dist/native/dialog.js +4 -0
  60. package/dist/native/dialog.js.map +1 -0
  61. package/dist/native/dynamic-type.d.ts +15 -0
  62. package/dist/native/dynamic-type.d.ts.map +1 -0
  63. package/dist/native/dynamic-type.js +47 -0
  64. package/dist/native/dynamic-type.js.map +1 -0
  65. package/dist/native/file-access.d.ts +23 -0
  66. package/dist/native/file-access.d.ts.map +1 -0
  67. package/dist/native/file-access.js +55 -0
  68. package/dist/native/file-access.js.map +1 -0
  69. package/dist/native/file-picker.android.d.ts +3 -0
  70. package/dist/native/file-picker.android.d.ts.map +1 -0
  71. package/dist/native/file-picker.android.js +147 -0
  72. package/dist/native/file-picker.android.js.map +1 -0
  73. package/dist/native/file-picker.d.ts +4 -0
  74. package/dist/native/file-picker.d.ts.map +1 -0
  75. package/dist/native/file-picker.ios.d.ts +3 -0
  76. package/dist/native/file-picker.ios.d.ts.map +1 -0
  77. package/dist/native/file-picker.ios.js +152 -0
  78. package/dist/native/file-picker.ios.js.map +1 -0
  79. package/dist/native/file-picker.js +7 -0
  80. package/dist/native/file-picker.js.map +1 -0
  81. package/dist/native/flex-layout.ios.d.ts +5 -0
  82. package/dist/native/flex-layout.ios.d.ts.map +1 -1
  83. package/dist/native/flex-layout.ios.js +63 -2
  84. package/dist/native/flex-layout.ios.js.map +1 -1
  85. package/dist/native/input-action.d.ts +5 -0
  86. package/dist/native/input-action.d.ts.map +1 -0
  87. package/dist/native/input-action.js +13 -0
  88. package/dist/native/input-action.js.map +1 -0
  89. package/dist/native/keyboard-dismiss.ios.d.ts.map +1 -1
  90. package/dist/native/keyboard-dismiss.ios.js +3 -0
  91. package/dist/native/keyboard-dismiss.ios.js.map +1 -1
  92. package/dist/native/label.android.d.ts +12 -0
  93. package/dist/native/label.android.d.ts.map +1 -0
  94. package/dist/native/label.android.js +19 -0
  95. package/dist/native/label.android.js.map +1 -0
  96. package/dist/native/label.ios.d.ts +10 -1
  97. package/dist/native/label.ios.d.ts.map +1 -1
  98. package/dist/native/label.ios.js +25 -1
  99. package/dist/native/label.ios.js.map +1 -1
  100. package/dist/native/motion-owner.d.ts +5 -0
  101. package/dist/native/motion-owner.d.ts.map +1 -0
  102. package/dist/native/motion-owner.js +53 -0
  103. package/dist/native/motion-owner.js.map +1 -0
  104. package/dist/native/motion-region.d.ts +6 -0
  105. package/dist/native/motion-region.d.ts.map +1 -0
  106. package/dist/native/motion-region.js +199 -0
  107. package/dist/native/motion-region.js.map +1 -0
  108. package/dist/native/motion-surface.d.ts +9 -0
  109. package/dist/native/motion-surface.d.ts.map +1 -0
  110. package/dist/native/motion-surface.js +137 -0
  111. package/dist/native/motion-surface.js.map +1 -0
  112. package/dist/native/press.d.ts +5 -2
  113. package/dist/native/press.d.ts.map +1 -1
  114. package/dist/native/press.js +52 -8
  115. package/dist/native/press.js.map +1 -1
  116. package/dist/native/progress.d.ts +7 -0
  117. package/dist/native/progress.d.ts.map +1 -0
  118. package/dist/native/progress.js +77 -0
  119. package/dist/native/progress.js.map +1 -0
  120. package/dist/native/scroll-motion.d.ts +12 -0
  121. package/dist/native/scroll-motion.d.ts.map +1 -0
  122. package/dist/native/scroll-motion.js +100 -0
  123. package/dist/native/scroll-motion.js.map +1 -0
  124. package/dist/native/segmented.d.ts +14 -0
  125. package/dist/native/segmented.d.ts.map +1 -0
  126. package/dist/native/segmented.js +86 -0
  127. package/dist/native/segmented.js.map +1 -0
  128. package/dist/native/sheet.android.d.ts +5 -1
  129. package/dist/native/sheet.android.d.ts.map +1 -1
  130. package/dist/native/sheet.android.js +2 -2
  131. package/dist/native/sheet.android.js.map +1 -1
  132. package/dist/native/sheet.d.ts +5 -1
  133. package/dist/native/sheet.d.ts.map +1 -1
  134. package/dist/native/sheet.ios.d.ts +5 -1
  135. package/dist/native/sheet.ios.d.ts.map +1 -1
  136. package/dist/native/sheet.ios.js +12 -3
  137. package/dist/native/sheet.ios.js.map +1 -1
  138. package/dist/native/sheet.js +2 -2
  139. package/dist/native/sheet.js.map +1 -1
  140. package/dist/native/tabs.android.d.ts +3 -0
  141. package/dist/native/tabs.android.d.ts.map +1 -0
  142. package/dist/native/tabs.android.js +29 -0
  143. package/dist/native/tabs.android.js.map +1 -0
  144. package/dist/native/tabs.d.ts +3 -0
  145. package/dist/native/tabs.d.ts.map +1 -0
  146. package/dist/native/tabs.js +4 -0
  147. package/dist/native/tabs.js.map +1 -0
  148. package/dist/native/text-field.android.d.ts +1 -0
  149. package/dist/native/text-field.android.d.ts.map +1 -1
  150. package/dist/native/text-field.android.js +13 -0
  151. package/dist/native/text-field.android.js.map +1 -1
  152. package/dist/native/text-field.ios.d.ts +9 -0
  153. package/dist/native/text-field.ios.d.ts.map +1 -0
  154. package/dist/native/text-field.ios.js +52 -0
  155. package/dist/native/text-field.ios.js.map +1 -0
  156. package/dist/native/text-view.ios.d.ts +7 -0
  157. package/dist/native/text-view.ios.d.ts.map +1 -0
  158. package/dist/native/text-view.ios.js +10 -0
  159. package/dist/native/text-view.ios.js.map +1 -0
  160. package/dist/native/toast.android.d.ts +4 -0
  161. package/dist/native/toast.android.d.ts.map +1 -0
  162. package/dist/native/toast.android.js +10 -0
  163. package/dist/native/toast.android.js.map +1 -0
  164. package/dist/native/toast.d.ts +4 -0
  165. package/dist/native/toast.d.ts.map +1 -0
  166. package/dist/native/toast.ios.d.ts +4 -0
  167. package/dist/native/toast.ios.d.ts.map +1 -0
  168. package/dist/native/toast.ios.js +8 -0
  169. package/dist/native/toast.ios.js.map +1 -0
  170. package/dist/native/toast.js +5 -0
  171. package/dist/native/toast.js.map +1 -0
  172. package/dist/vue/components/ChoiceControl.d.ts +111 -0
  173. package/dist/vue/components/ChoiceControl.d.ts.map +1 -0
  174. package/dist/vue/components/ChoiceControl.js +196 -0
  175. package/dist/vue/components/ChoiceControl.js.map +1 -0
  176. package/dist/vue/components/DateCalendar.d.ts +94 -0
  177. package/dist/vue/components/DateCalendar.d.ts.map +1 -0
  178. package/dist/vue/components/DateCalendar.js +96 -0
  179. package/dist/vue/components/DateCalendar.js.map +1 -0
  180. package/dist/vue/components/MAccordion.d.ts +119 -0
  181. package/dist/vue/components/MAccordion.d.ts.map +1 -0
  182. package/dist/vue/components/MAccordion.js +83 -0
  183. package/dist/vue/components/MAccordion.js.map +1 -0
  184. package/dist/vue/components/MAlert.d.ts +109 -0
  185. package/dist/vue/components/MAlert.d.ts.map +1 -0
  186. package/dist/vue/components/MAlert.js +126 -0
  187. package/dist/vue/components/MAlert.js.map +1 -0
  188. package/dist/vue/components/MAvatar.d.ts +80 -0
  189. package/dist/vue/components/MAvatar.d.ts.map +1 -0
  190. package/dist/vue/components/MAvatar.js +86 -0
  191. package/dist/vue/components/MAvatar.js.map +1 -0
  192. package/dist/vue/components/MBadge.d.ts +70 -0
  193. package/dist/vue/components/MBadge.d.ts.map +1 -0
  194. package/dist/vue/components/MBadge.js +30 -0
  195. package/dist/vue/components/MBadge.js.map +1 -0
  196. package/dist/vue/components/MButton.d.ts +126 -32
  197. package/dist/vue/components/MButton.d.ts.map +1 -1
  198. package/dist/vue/components/MButton.js +129 -11
  199. package/dist/vue/components/MButton.js.map +1 -1
  200. package/dist/vue/components/MCard.d.ts +70 -24
  201. package/dist/vue/components/MCard.d.ts.map +1 -1
  202. package/dist/vue/components/MCard.js +14 -4
  203. package/dist/vue/components/MCard.js.map +1 -1
  204. package/dist/vue/components/MCheckbox.d.ts +103 -0
  205. package/dist/vue/components/MCheckbox.d.ts.map +1 -0
  206. package/dist/vue/components/MCheckbox.js +26 -0
  207. package/dist/vue/components/MCheckbox.js.map +1 -0
  208. package/dist/vue/components/MChip.d.ts +117 -0
  209. package/dist/vue/components/MChip.d.ts.map +1 -0
  210. package/dist/vue/components/MChip.js +120 -0
  211. package/dist/vue/components/MChip.js.map +1 -0
  212. package/dist/vue/components/MCombobox.d.ts +279 -0
  213. package/dist/vue/components/MCombobox.d.ts.map +1 -0
  214. package/dist/vue/components/MCombobox.js +234 -0
  215. package/dist/vue/components/MCombobox.js.map +1 -0
  216. package/dist/vue/components/MDatePicker.d.ts +1254 -0
  217. package/dist/vue/components/MDatePicker.d.ts.map +1 -0
  218. package/dist/vue/components/MDatePicker.js +35 -0
  219. package/dist/vue/components/MDatePicker.js.map +1 -0
  220. package/dist/vue/components/MDialog.d.ts +97 -0
  221. package/dist/vue/components/MDialog.d.ts.map +1 -0
  222. package/dist/vue/components/MDialog.js +245 -0
  223. package/dist/vue/components/MDialog.js.map +1 -0
  224. package/dist/vue/components/MEmptyState.d.ts +117 -0
  225. package/dist/vue/components/MEmptyState.d.ts.map +1 -0
  226. package/dist/vue/components/MEmptyState.js +79 -0
  227. package/dist/vue/components/MEmptyState.js.map +1 -0
  228. package/dist/vue/components/MFilePicker.d.ts +112 -0
  229. package/dist/vue/components/MFilePicker.d.ts.map +1 -0
  230. package/dist/vue/components/MFilePicker.js +196 -0
  231. package/dist/vue/components/MFilePicker.js.map +1 -0
  232. package/dist/vue/components/MIcon.d.ts +5 -3
  233. package/dist/vue/components/MIcon.d.ts.map +1 -1
  234. package/dist/vue/components/MInput.d.ts +178 -51
  235. package/dist/vue/components/MInput.d.ts.map +1 -1
  236. package/dist/vue/components/MInput.js +88 -14
  237. package/dist/vue/components/MInput.js.map +1 -1
  238. package/dist/vue/components/MListItem.d.ts +104 -0
  239. package/dist/vue/components/MListItem.d.ts.map +1 -0
  240. package/dist/vue/components/MListItem.js +53 -0
  241. package/dist/vue/components/MListItem.js.map +1 -0
  242. package/dist/vue/components/MProgress.d.ts +122 -0
  243. package/dist/vue/components/MProgress.d.ts.map +1 -0
  244. package/dist/vue/components/MProgress.js +75 -0
  245. package/dist/vue/components/MProgress.js.map +1 -0
  246. package/dist/vue/components/MRadioGroup.d.ts +103 -0
  247. package/dist/vue/components/MRadioGroup.d.ts.map +1 -0
  248. package/dist/vue/components/MRadioGroup.js +57 -0
  249. package/dist/vue/components/MRadioGroup.js.map +1 -0
  250. package/dist/vue/components/MReveal.d.ts +75 -39
  251. package/dist/vue/components/MReveal.d.ts.map +1 -1
  252. package/dist/vue/components/MReveal.js +5 -7
  253. package/dist/vue/components/MReveal.js.map +1 -1
  254. package/dist/vue/components/MScreen.d.ts +21 -6
  255. package/dist/vue/components/MScreen.d.ts.map +1 -1
  256. package/dist/vue/components/MScreen.js +19 -4
  257. package/dist/vue/components/MScreen.js.map +1 -1
  258. package/dist/vue/components/MSegmentedControl.d.ts +95 -0
  259. package/dist/vue/components/MSegmentedControl.d.ts.map +1 -0
  260. package/dist/vue/components/MSegmentedControl.js +172 -0
  261. package/dist/vue/components/MSegmentedControl.js.map +1 -0
  262. package/dist/vue/components/MSelect.d.ts +140 -0
  263. package/dist/vue/components/MSelect.d.ts.map +1 -0
  264. package/dist/vue/components/MSelect.js +158 -0
  265. package/dist/vue/components/MSelect.js.map +1 -0
  266. package/dist/vue/components/MSeparator.d.ts +56 -0
  267. package/dist/vue/components/MSeparator.d.ts.map +1 -0
  268. package/dist/vue/components/MSeparator.js +36 -0
  269. package/dist/vue/components/MSeparator.js.map +1 -0
  270. package/dist/vue/components/MSheet.d.ts +26 -14
  271. package/dist/vue/components/MSheet.d.ts.map +1 -1
  272. package/dist/vue/components/MSheet.js +66 -34
  273. package/dist/vue/components/MSheet.js.map +1 -1
  274. package/dist/vue/components/MSkeleton.d.ts +78 -0
  275. package/dist/vue/components/MSkeleton.d.ts.map +1 -0
  276. package/dist/vue/components/MSkeleton.js +87 -0
  277. package/dist/vue/components/MSkeleton.js.map +1 -0
  278. package/dist/vue/components/MSlider.d.ts +8 -4
  279. package/dist/vue/components/MSlider.d.ts.map +1 -1
  280. package/dist/vue/components/MSlider.js +2 -1
  281. package/dist/vue/components/MSlider.js.map +1 -1
  282. package/dist/vue/components/MSwitch.d.ts +89 -0
  283. package/dist/vue/components/MSwitch.d.ts.map +1 -0
  284. package/dist/vue/components/MSwitch.js +163 -0
  285. package/dist/vue/components/MSwitch.js.map +1 -0
  286. package/dist/vue/components/MTabs.d.ts +101 -0
  287. package/dist/vue/components/MTabs.d.ts.map +1 -0
  288. package/dist/vue/components/MTabs.js +245 -0
  289. package/dist/vue/components/MTabs.js.map +1 -0
  290. package/dist/vue/components/MText.d.ts +51 -26
  291. package/dist/vue/components/MText.d.ts.map +1 -1
  292. package/dist/vue/components/MText.js +43 -17
  293. package/dist/vue/components/MText.js.map +1 -1
  294. package/dist/vue/components/MToast.d.ts +23 -0
  295. package/dist/vue/components/MToast.d.ts.map +1 -0
  296. package/dist/vue/components/MToast.js +242 -0
  297. package/dist/vue/components/MToast.js.map +1 -0
  298. package/dist/vue/components/layout.d.ts +206 -97
  299. package/dist/vue/components/layout.d.ts.map +1 -1
  300. package/dist/vue/components/layout.js +6 -4
  301. package/dist/vue/components/layout.js.map +1 -1
  302. package/dist/vue/components/workflows.d.ts +251 -0
  303. package/dist/vue/components/workflows.d.ts.map +1 -0
  304. package/dist/vue/components/workflows.js +35 -0
  305. package/dist/vue/components/workflows.js.map +1 -0
  306. package/dist/vue/index.d.ts +29 -3
  307. package/dist/vue/index.d.ts.map +1 -1
  308. package/dist/vue/index.js +56 -4
  309. package/dist/vue/index.js.map +1 -1
  310. package/dist/vue/layers.d.ts +2 -0
  311. package/dist/vue/layers.d.ts.map +1 -1
  312. package/dist/vue/layers.js.map +1 -1
  313. package/dist/vue/reveal-motion.d.ts +13 -0
  314. package/dist/vue/reveal-motion.d.ts.map +1 -0
  315. package/dist/vue/reveal-motion.js +55 -0
  316. package/dist/vue/reveal-motion.js.map +1 -0
  317. package/dist/vue/use-motion-region.d.ts +7 -0
  318. package/dist/vue/use-motion-region.d.ts.map +1 -0
  319. package/dist/vue/use-motion-region.js +28 -0
  320. package/dist/vue/use-motion-region.js.map +1 -0
  321. package/dist/vue/use-motion-surface.d.ts +8 -0
  322. package/dist/vue/use-motion-surface.d.ts.map +1 -0
  323. package/dist/vue/use-motion-surface.js +76 -0
  324. package/dist/vue/use-motion-surface.js.map +1 -0
  325. package/dist/vue/use-press.d.ts +1 -1
  326. package/dist/vue/use-press.d.ts.map +1 -1
  327. package/dist/vue/use-press.js +12 -4
  328. package/dist/vue/use-press.js.map +1 -1
  329. package/dist/vue/use-scroll-motion.d.ts +7 -0
  330. package/dist/vue/use-scroll-motion.d.ts.map +1 -0
  331. package/dist/vue/use-scroll-motion.js +30 -0
  332. package/dist/vue/use-scroll-motion.js.map +1 -0
  333. package/package.json +3 -3
  334. package/platforms/android/java/com/mavis/ui/Box.java +3 -1
  335. package/platforms/android/java/com/mavis/ui/ContentWidth.java +77 -0
  336. package/platforms/android/java/com/mavis/ui/FlexLayout.java +5 -1
  337. package/src/files.ts +3 -0
  338. package/src/native/avatar-image.ts +9 -0
  339. package/src/native/avatar-label.android.ts +14 -0
  340. package/src/native/avatar-label.ts +1 -0
  341. package/src/native/box.ios.ts +21 -1
  342. package/src/native/button.ios.ts +40 -2
  343. package/src/native/checkbox.android.ts +35 -0
  344. package/src/native/checkbox.ts +9 -0
  345. package/src/native/combobox-editor.android.ts +11 -0
  346. package/src/native/combobox-editor.ts +6 -0
  347. package/src/native/composed-button.android.ts +74 -0
  348. package/src/native/composed-button.ts +9 -0
  349. package/src/native/dialog.android.ts +56 -0
  350. package/src/native/dialog.ios.ts +23 -0
  351. package/src/native/dialog.ts +10 -0
  352. package/src/native/dynamic-type.ts +71 -0
  353. package/src/native/file-access.ts +71 -0
  354. package/src/native/file-picker.android.ts +191 -0
  355. package/src/native/file-picker.ios.ts +230 -0
  356. package/src/native/file-picker.ts +8 -0
  357. package/src/native/flex-layout.ios.ts +74 -2
  358. package/src/native/input-action.ts +15 -0
  359. package/src/native/keyboard-dismiss.ios.ts +2 -0
  360. package/src/native/label.android.ts +27 -0
  361. package/src/native/label.ios.ts +40 -1
  362. package/src/native/motion-owner.ts +59 -0
  363. package/src/native/motion-region.ts +213 -0
  364. package/src/native/motion-surface.ts +162 -0
  365. package/src/native/press.ts +52 -10
  366. package/src/native/progress.ts +78 -0
  367. package/src/native/scroll-motion.ts +106 -0
  368. package/src/native/segmented.ts +95 -0
  369. package/src/native/sheet.android.ts +2 -2
  370. package/src/native/sheet.ios.ts +12 -3
  371. package/src/native/sheet.ts +2 -2
  372. package/src/native/tabs.android.ts +58 -0
  373. package/src/native/tabs.ts +8 -0
  374. package/src/native/text-field.android.ts +19 -0
  375. package/src/native/text-field.ios.ts +53 -0
  376. package/src/native/text-view.ios.ts +10 -0
  377. package/src/native/toast.android.ts +9 -0
  378. package/src/native/toast.ios.ts +13 -0
  379. package/src/native/toast.ts +6 -0
  380. package/src/vue/components/ChoiceControl.ts +238 -0
  381. package/src/vue/components/DateCalendar.ts +117 -0
  382. package/src/vue/components/MAccordion.ts +123 -0
  383. package/src/vue/components/MAlert.ts +156 -0
  384. package/src/vue/components/MAvatar.ts +103 -0
  385. package/src/vue/components/MBadge.ts +34 -0
  386. package/src/vue/components/MButton.ts +176 -9
  387. package/src/vue/components/MCard.ts +23 -3
  388. package/src/vue/components/MCheckbox.ts +25 -0
  389. package/src/vue/components/MChip.ts +134 -0
  390. package/src/vue/components/MCombobox.ts +257 -0
  391. package/src/vue/components/MDatePicker.ts +33 -0
  392. package/src/vue/components/MDialog.ts +312 -0
  393. package/src/vue/components/MEmptyState.ts +96 -0
  394. package/src/vue/components/MFilePicker.ts +226 -0
  395. package/src/vue/components/MInput.ts +96 -12
  396. package/src/vue/components/MListItem.ts +66 -0
  397. package/src/vue/components/MProgress.ts +94 -0
  398. package/src/vue/components/MRadioGroup.ts +64 -0
  399. package/src/vue/components/MReveal.ts +6 -7
  400. package/src/vue/components/MScreen.ts +21 -6
  401. package/src/vue/components/MSegmentedControl.ts +214 -0
  402. package/src/vue/components/MSelect.ts +185 -0
  403. package/src/vue/components/MSeparator.ts +40 -0
  404. package/src/vue/components/MSheet.ts +83 -43
  405. package/src/vue/components/MSkeleton.ts +100 -0
  406. package/src/vue/components/MSlider.ts +7 -1
  407. package/src/vue/components/MSwitch.ts +187 -0
  408. package/src/vue/components/MTabs.ts +302 -0
  409. package/src/vue/components/MText.ts +37 -6
  410. package/src/vue/components/MToast.ts +289 -0
  411. package/src/vue/components/layout.ts +6 -3
  412. package/src/vue/components/workflows.ts +38 -0
  413. package/src/vue/index.ts +93 -2
  414. package/src/vue/layers.ts +2 -0
  415. package/src/vue/reveal-motion.ts +61 -0
  416. package/src/vue/use-motion-region.ts +29 -0
  417. package/src/vue/use-motion-surface.ts +84 -0
  418. package/src/vue/use-press.ts +12 -4
  419. package/src/vue/use-scroll-motion.ts +31 -0
  420. package/dist/native/input-description.android.d.ts +0 -4
  421. package/dist/native/input-description.android.d.ts.map +0 -1
  422. package/dist/native/input-description.android.js +0 -18
  423. package/dist/native/input-description.android.js.map +0 -1
  424. package/dist/theme/resolve.d.ts +0 -3
  425. package/dist/theme/resolve.d.ts.map +0 -1
  426. package/dist/theme/resolve.js +0 -8
  427. package/dist/theme/resolve.js.map +0 -1
  428. package/dist/theme/themes.d.ts +0 -6
  429. package/dist/theme/themes.d.ts.map +0 -1
  430. package/dist/theme/themes.js +0 -83
  431. package/dist/theme/themes.js.map +0 -1
  432. package/dist/theme/types.d.ts +0 -50
  433. package/dist/theme/types.d.ts.map +0 -1
  434. package/dist/theme/types.js +0 -2
  435. package/dist/theme/types.js.map +0 -1
  436. package/dist/vue/global-components.d.ts +0 -21
  437. package/dist/vue/global-components.d.ts.map +0 -1
  438. package/dist/vue/global-components.js +0 -2
  439. package/dist/vue/global-components.js.map +0 -1
  440. package/dist/vue/layout-context.d.ts +0 -5
  441. package/dist/vue/layout-context.d.ts.map +0 -1
  442. package/dist/vue/layout-context.js +0 -7
  443. package/dist/vue/layout-context.js.map +0 -1
  444. package/dist/vue/text-content.d.ts +0 -4
  445. package/dist/vue/text-content.d.ts.map +0 -1
  446. package/dist/vue/text-content.js +0 -17
  447. package/dist/vue/text-content.js.map +0 -1
  448. package/dist/vue/theme.d.ts +0 -177
  449. package/dist/vue/theme.d.ts.map +0 -1
  450. package/dist/vue/theme.js +0 -17
  451. package/dist/vue/theme.js.map +0 -1
@@ -1,13 +1,55 @@
1
- import type { View } from '@nativescript/core'
2
- import { press } from '@rafaelaugusto/jolt'
1
+ import type { EventData, TouchGestureEventData, View } from '@nativescript/core'
2
+ import { animate, stop, onReducedMotion } from '@rafaelaugusto/jolt'
3
+ import { pressMotion } from '@getcortexlabs/mavis-core'
3
4
 
4
- /** Own the effect so disabling or unloading a pressed control restores its scale. */
5
- export function attachPressFeedback(view: View, scale: number): () => void {
6
- const { scaleX, scaleY } = view
7
- const remove = press(view, { scaleX: scaleX * scale, scaleY: scaleY * scale })
8
- return () => {
9
- remove()
10
- view.scaleX = scaleX
11
- view.scaleY = scaleY
5
+ let nextLayer = 0
6
+
7
+ /** Press multiplies the app's scale; releasing it removes only that contribution. */
8
+ export function attachPressFeedback(view: View, scale: number) {
9
+ let motion = pressMotion(scale)
10
+ // Each attachment owns its channel, including after a theme change or reload.
11
+ const layer = `mavis-press-${++nextLayer}`
12
+ let pressed = false
13
+ let used = false
14
+ let disposed = false
15
+
16
+ const onTouch = (event: EventData) => {
17
+ if (disposed) return
18
+ const { action } = event as TouchGestureEventData
19
+ if (action === 'down' && !pressed && view.isEnabled !== false) {
20
+ pressed = true
21
+ used = true
22
+ animate(view, motion.pressed[0], { ...motion.pressed[1], layer })
23
+ } else if ((action === 'up' || action === 'cancel') && pressed) {
24
+ pressed = false
25
+ animate(view, motion.released[0], { ...motion.released[1], layer })
26
+ }
27
+ }
28
+ const remove = () => {
29
+ if (disposed) return
30
+ disposed = true
31
+ offPreference()
32
+ view.off('touch', onTouch)
33
+ view.off('unloaded', remove)
34
+ // A finished press can still hold its multiplier. stop(layer) also removes that rest.
35
+ if (used) {
36
+ stop(view, ['scale'], { layer })
37
+ }
12
38
  }
39
+ const offPreference = onReducedMotion((reduced) => {
40
+ if (reduced && used && !disposed) {
41
+ animate(view, motion[pressed ? 'pressed' : 'released'][0], { duration: 0, layer })
42
+ }
43
+ })
44
+ view.on('touch', onTouch)
45
+ view.on('unloaded', remove)
46
+ return Object.assign(remove, {
47
+ press(pressed: boolean) {
48
+ onTouch({ action: pressed ? 'down' : 'cancel' } as TouchGestureEventData)
49
+ },
50
+ update(scale: number) {
51
+ motion = pressMotion(scale)
52
+ if (pressed && !disposed) animate(view, motion.pressed[0], { ...motion.pressed[1], layer })
53
+ },
54
+ })
13
55
  }
@@ -0,0 +1,78 @@
1
+ import { Application, type View } from '@nativescript/core'
2
+ import { animate, set, onReducedMotion, reducedMotion } from '@rafaelaugusto/jolt'
3
+ import { progressMotion } from '@getcortexlabs/mavis-core'
4
+
5
+ /** The fill is private to Progress; only its translation is animated. */
6
+ export function attachProgressMotion(track: View, fill: View, indeterminate: boolean) {
7
+ let motion: ReturnType<typeof animate> | undefined
8
+ let pending: ReturnType<typeof setTimeout> | undefined
9
+ let suspended = Application.suspended
10
+ let disposed = false
11
+ let previous = ''
12
+
13
+ function stop() {
14
+ motion?.stop()
15
+ motion = undefined
16
+ }
17
+ function apply() {
18
+ pending = undefined
19
+ if (disposed) return
20
+ const measured = track.getActualSize().width
21
+ const width = Number.isFinite(measured) ? measured : 0
22
+ const reduced = reducedMotion()
23
+ const key = `${indeterminate}/${width}/${reduced}/${suspended}`
24
+ if (key === previous) return
25
+ previous = key
26
+ stop()
27
+ const travel = Math.max(0, width * (1 - progressMotion.segment))
28
+ set(fill, { x: indeterminate && reduced ? travel / 2 : 0 })
29
+ if (indeterminate && !reduced && !suspended && width > 0) {
30
+ motion = animate(
31
+ fill,
32
+ { x: [0, travel, 0] },
33
+ {
34
+ duration: progressMotion.duration,
35
+ ease: 'easeInOut',
36
+ repeat: Infinity,
37
+ },
38
+ )
39
+ }
40
+ }
41
+ function schedule() {
42
+ if (disposed) return
43
+ clearTimeout(pending)
44
+ // Native styles finish syncing after loaded and after a mode change.
45
+ pending = setTimeout(apply, 0)
46
+ }
47
+ function suspend() {
48
+ suspended = true
49
+ clearTimeout(pending)
50
+ apply()
51
+ }
52
+ function resume() {
53
+ suspended = false
54
+ schedule()
55
+ }
56
+ const offMotion = onReducedMotion(schedule)
57
+ track.on('layoutChanged', schedule)
58
+ Application.on(Application.suspendEvent, suspend)
59
+ Application.on(Application.resumeEvent, resume)
60
+ schedule()
61
+ return {
62
+ update(value: boolean) {
63
+ indeterminate = value
64
+ schedule()
65
+ },
66
+ dispose() {
67
+ if (disposed) return
68
+ disposed = true
69
+ clearTimeout(pending)
70
+ stop()
71
+ set(fill, { x: 0 })
72
+ offMotion()
73
+ track.off('layoutChanged', schedule)
74
+ Application.off(Application.suspendEvent, suspend)
75
+ Application.off(Application.resumeEvent, resume)
76
+ },
77
+ }
78
+ }
@@ -0,0 +1,106 @@
1
+ import type { EventData, ScrollView, View } from '@nativescript/core'
2
+ import { bind, scrollValue, onReducedMotion, reducedMotion } from '@rafaelaugusto/jolt'
3
+ import {
4
+ bindMotionScrollSource,
5
+ type MotionScrollAdapter,
6
+ type MotionScrollSource,
7
+ type MotionScrollFrames,
8
+ type MotionScrollOptions,
9
+ } from '@getcortexlabs/mavis-core/experimental'
10
+
11
+ const sources = new WeakMap<MotionScrollAdapter, ScrollView>()
12
+ export function nativeScrollElement(adapter: MotionScrollAdapter) {
13
+ const source = sources.get(adapter)
14
+ if (!source) throw new TypeError('Use a scrolling native MScreen.')
15
+ return source
16
+ }
17
+ export function attachNativeScrollSource(reference: MotionScrollSource, source: ScrollView) {
18
+ const adapter: MotionScrollAdapter = { kind: 'native' }
19
+ sources.set(adapter, source)
20
+ const unbind = bindMotionScrollSource(reference, adapter)
21
+ return () => {
22
+ unbind()
23
+ sources.delete(adapter)
24
+ }
25
+ }
26
+
27
+ /** Jolt owns numeric mappings and the application channels; Mavis resolves Screen/layout. */
28
+ export function nativeScrollMotion(
29
+ adapter: MotionScrollAdapter,
30
+ target: View,
31
+ frames: MotionScrollFrames,
32
+ options: MotionScrollOptions,
33
+ ) {
34
+ const source = sources.get(adapter)
35
+ if (!source) throw new TypeError('Use a scrolling MScreen in this renderer.')
36
+ const offset = scrollValue(source)
37
+ const active = new Map<string, readonly number[]>()
38
+ for (const [key, values] of Object.entries(frames)) {
39
+ if (key === 'scale') {
40
+ if (!frames.scaleX) active.set('scaleX', values)
41
+ if (!frames.scaleY) active.set('scaleY', values)
42
+ } else active.set(key, values)
43
+ }
44
+ const bindings = new Map<string, () => void>()
45
+ let disposed = false
46
+ let maximum = -1
47
+ let content: View | undefined
48
+ const apply = () => {
49
+ if (disposed) return
50
+ const bounded = offset.to([0, Math.max(1, maximum)], [0, Math.max(0, maximum)])
51
+ for (const [key, output] of active) {
52
+ bindings.get(key)?.()
53
+ const input = output.map(
54
+ (_, index) =>
55
+ options.range[0] + (index * (options.range[1] - options.range[0])) / (output.length - 1),
56
+ )
57
+ const values =
58
+ reducedMotion() && key !== 'opacity' ? output.map(() => output.at(-1)!) : output
59
+ bindings.set(key, bind(target, { [key]: bounded.to(input, values) }))
60
+ }
61
+ }
62
+ const refresh = () => {
63
+ if (disposed) return
64
+ const next = Math.max(0, source.scrollableHeight)
65
+ const changed = maximum !== next
66
+ maximum = next
67
+ if (content !== source.content) {
68
+ content?.off('layoutChanged', layout)
69
+ content = source.content
70
+ content?.on('layoutChanged', layout)
71
+ }
72
+ if (changed) apply()
73
+ // Re-read the actual bounded offset without a Vue update or an additional clock.
74
+ offset.ref(null)
75
+ offset.ref(source)
76
+ }
77
+ const layout = (_event: EventData) => refresh()
78
+ source.on('layoutChanged', layout)
79
+ const offReduced = onReducedMotion(apply)
80
+ refresh()
81
+ return {
82
+ get execution() {
83
+ return disposed || !active.size ? ('released' as const) : ('native' as const)
84
+ },
85
+ refresh,
86
+ interrupt(properties: readonly string[]) {
87
+ for (const property of properties)
88
+ for (const key of property === 'scale' ? ['scaleX', 'scaleY'] : [property]) {
89
+ active.delete(key)
90
+ bindings.get(key)?.()
91
+ bindings.delete(key)
92
+ }
93
+ },
94
+ dispose() {
95
+ if (disposed) return
96
+ disposed = true
97
+ source.off('layoutChanged', layout)
98
+ content?.off('layoutChanged', layout)
99
+ offReduced()
100
+ for (const release of bindings.values()) release()
101
+ bindings.clear()
102
+ active.clear()
103
+ offset.dispose()
104
+ },
105
+ }
106
+ }
@@ -0,0 +1,95 @@
1
+ import { Application, type View } from '@nativescript/core'
2
+ import { animate, set, onReducedMotion, reducedMotion } from '@rafaelaugusto/jolt'
3
+ import { segmentedMotion } from '@getcortexlabs/mavis-core'
4
+
5
+ interface SegmentBounds {
6
+ key: string
7
+ x: number
8
+ width: number
9
+ height: number
10
+ }
11
+
12
+ /** The marker belongs to the control; application transforms are never animated. */
13
+ export function attachSegmentedIndicator(indicator: View, read: () => SegmentBounds | undefined) {
14
+ let motion: ReturnType<typeof animate> | undefined
15
+ let pending: ReturnType<typeof setTimeout> | undefined
16
+ let previous: SegmentBounds | undefined
17
+ let animateNext = false
18
+ let suspended = Application.suspended
19
+ let disposed = false
20
+ function stop() {
21
+ motion?.stop()
22
+ motion = undefined
23
+ }
24
+ function apply() {
25
+ pending = undefined
26
+ if (disposed) return
27
+ const next = read()
28
+ if (
29
+ !next ||
30
+ ![next.x, next.width, next.height].every(Number.isFinite) ||
31
+ next.width <= 0 ||
32
+ next.height <= 0
33
+ ) {
34
+ stop()
35
+ indicator.opacity = 0
36
+ previous = undefined
37
+ animateNext = false
38
+ return
39
+ }
40
+ const changed =
41
+ !previous ||
42
+ next.x !== previous.x ||
43
+ next.width !== previous.width ||
44
+ next.height !== previous.height
45
+ if (changed || suspended || reducedMotion()) {
46
+ stop()
47
+ indicator.width = next.width
48
+ indicator.height = next.height
49
+ indicator.opacity = 1
50
+ if (previous && previous.key !== next.key && animateNext && !suspended && !reducedMotion())
51
+ motion = animate(
52
+ indicator,
53
+ { x: next.x },
54
+ { duration: segmentedMotion.duration, ease: segmentedMotion.ease },
55
+ )
56
+ else set(indicator, { x: next.x })
57
+ }
58
+ previous = next
59
+ animateNext = false
60
+ }
61
+ function update(animated = false) {
62
+ if (disposed) return
63
+ animateNext ||= animated
64
+ if (pending === undefined) pending = setTimeout(apply, 0)
65
+ }
66
+ function suspend() {
67
+ suspended = true
68
+ clearTimeout(pending)
69
+ apply()
70
+ }
71
+ function resume() {
72
+ suspended = false
73
+ update()
74
+ }
75
+ const offMotion = onReducedMotion(() => {
76
+ stop()
77
+ previous = undefined
78
+ update()
79
+ })
80
+ Application.on(Application.suspendEvent, suspend)
81
+ Application.on(Application.resumeEvent, resume)
82
+ update()
83
+ return {
84
+ update,
85
+ dispose() {
86
+ if (disposed) return
87
+ disposed = true
88
+ clearTimeout(pending)
89
+ stop()
90
+ offMotion()
91
+ Application.off(Application.suspendEvent, suspend)
92
+ Application.off(Application.resumeEvent, resume)
93
+ },
94
+ }
95
+ }
@@ -19,6 +19,6 @@ export function safeAreaOf(_host: View): { readonly top: number; readonly bottom
19
19
 
20
20
  export function expandLayerHost(_host: View) {}
21
21
 
22
- export function bottomInset(_host: View): number {
23
- return 0
22
+ export function contentInsets(_host: View): { left: number; right: number; bottom: number } {
23
+ return { left: 0, right: 0, bottom: 0 }
24
24
  }
@@ -15,17 +15,21 @@ export function setModal(panel: View, modal: boolean) {
15
15
 
16
16
  interface Insets {
17
17
  top: number
18
+ right: number
18
19
  bottom: number
20
+ left: number
19
21
  }
20
22
  const windowInsets = (view: View): Insets | undefined =>
21
- (view.page?.ios as { safeAreaInsets?: Insets } | undefined)?.safeAreaInsets
23
+ (view.page?.ios as { view?: { safeAreaInsets?: Insets } } | undefined)?.view?.safeAreaInsets
22
24
 
23
25
  /** The page lays its content inside the safe area; the host grows back over it with negative margins. */
24
26
  export function expandLayerHost(host: View) {
25
27
  const insets = windowInsets(host)
26
28
  if (!insets) return
27
29
  if (host.marginTop !== -insets.top) host.marginTop = -insets.top
30
+ if (host.marginRight !== -insets.right) host.marginRight = -insets.right
28
31
  if (host.marginBottom !== -insets.bottom) host.marginBottom = -insets.bottom
32
+ if (host.marginLeft !== -insets.left) host.marginLeft = -insets.left
29
33
  }
30
34
 
31
35
  /** Keeps the panel below the status bar; the panel itself pads its content above the home indicator. */
@@ -38,6 +42,11 @@ export function safeAreaOf(host: View): { readonly top: number; readonly bottom:
38
42
  }
39
43
  }
40
44
 
41
- export function bottomInset(host: View): number {
42
- return windowInsets(host)?.bottom ?? 0
45
+ export function contentInsets(host: View): { left: number; right: number; bottom: number } {
46
+ const insets = windowInsets(host)
47
+ return {
48
+ left: insets?.left ?? 0,
49
+ right: insets?.right ?? 0,
50
+ bottom: insets?.bottom ?? 0,
51
+ }
43
52
  }
@@ -21,6 +21,6 @@ export function safeAreaOf(_host: View): { readonly top: number; readonly bottom
21
21
  /** Lets the layer host cover the whole window; only iOS insets it by default. */
22
22
  export function expandLayerHost(_host: View) {}
23
23
 
24
- export function bottomInset(_host: View): number {
25
- return 0
24
+ export function contentInsets(_host: View): { left: number; right: number; bottom: number } {
25
+ return { left: 0, right: 0, bottom: 0 }
26
26
  }
@@ -0,0 +1,58 @@
1
+ import type { View } from '@nativescript/core'
2
+
3
+ declare const android: {
4
+ view: {
5
+ View: {
6
+ OnFocusChangeListener: new (listener: {
7
+ onFocusChange(view: unknown, focused: boolean): void
8
+ }) => unknown
9
+ OnKeyListener: new (listener: {
10
+ onKey(
11
+ view: unknown,
12
+ key: number,
13
+ event: {
14
+ getAction(): number
15
+ isAltPressed(): boolean
16
+ isCtrlPressed(): boolean
17
+ isMetaPressed(): boolean
18
+ },
19
+ ): boolean
20
+ }) => unknown
21
+ }
22
+ }
23
+ }
24
+
25
+ export function observeTab(
26
+ view: View,
27
+ focus: (focused: boolean) => void,
28
+ navigate: (key: string) => void,
29
+ ) {
30
+ const button = view.android
31
+ const focused = new android.view.View.OnFocusChangeListener({
32
+ onFocusChange: (_view, value) => focus(value),
33
+ })
34
+ const keys = new android.view.View.OnKeyListener({
35
+ onKey(_view, key, event) {
36
+ if (
37
+ event.getAction() !== 0 ||
38
+ event.isAltPressed() ||
39
+ event.isCtrlPressed() ||
40
+ event.isMetaPressed()
41
+ )
42
+ return false
43
+ const name = (
44
+ { 21: 'ArrowLeft', 22: 'ArrowRight', 122: 'Home', 123: 'End' } as Record<number, string>
45
+ )[key]
46
+ if (!name) return false
47
+ navigate(name)
48
+ return true
49
+ },
50
+ })
51
+ button.setOnFocusChangeListener(focused)
52
+ button.setOnKeyListener(keys)
53
+ // Preserve Android's default touch focus: forcing it would consume the first tap.
54
+ return () => {
55
+ if (button.getOnFocusChangeListener() === focused) button.setOnFocusChangeListener(null)
56
+ button.setOnKeyListener(null)
57
+ }
58
+ }
@@ -0,0 +1,8 @@
1
+ import type { View } from '@nativescript/core'
2
+ export function observeTab(
3
+ _view: View,
4
+ _focus: (focused: boolean) => void,
5
+ _navigate: (key: string) => void,
6
+ ) {
7
+ return () => {}
8
+ }
@@ -12,6 +12,11 @@ const NO_EXTRACT_UI = 0x10000000
12
12
  const setReturnKey = (TextField.prototype as unknown as Record<symbol, (value: string) => void>)[
13
13
  returnKeyTypeProperty.setNative
14
14
  ]!
15
+ const setInputType = (
16
+ TextField.prototype as unknown as {
17
+ _setInputType(this: TextField, value: number): void
18
+ }
19
+ )._setInputType
15
20
  interface KeyEvent {
16
21
  getKeyCode(): number
17
22
  getAction(): number
@@ -19,6 +24,20 @@ interface KeyEvent {
19
24
 
20
25
  /** Keep editing in the screen and let the application own focus after submit. */
21
26
  export class MavisTextField extends TextField {
27
+ _setInputType(value: number) {
28
+ const field = this.android
29
+ const start = field.getSelectionStart(),
30
+ end = field.getSelectionEnd()
31
+ const typeface = field.getTypeface()
32
+ setInputType.call(this, value)
33
+ // Android resets selection and may substitute a monospace face for passwords.
34
+ field.setTypeface(typeface)
35
+ if (start >= 0 && end >= 0) {
36
+ const length = field.getText().length()
37
+ field.setSelection(Math.min(start, length), Math.min(end, length))
38
+ }
39
+ }
40
+
22
41
  [editableProperty.setNative](value: boolean) {
23
42
  setInputEditable(this, value)
24
43
  }
@@ -0,0 +1,53 @@
1
+ import { TextField } from '@nativescript/core'
2
+ import { secureProperty } from '@nativescript/core/ui/text-field/text-field-common'
3
+ import { fontScaleInternalProperty } from '@nativescript/core/ui/styling/style-properties'
4
+ import { applyDynamicType } from './dynamic-type'
5
+
6
+ const setSecure = (TextField.prototype as unknown as Record<symbol, (value: boolean) => void>)[
7
+ secureProperty.setNative
8
+ ]!
9
+
10
+ /** Follows the system text size with the iOS body curve instead of Core's table. */
11
+ export class MavisTextField extends TextField {
12
+ [secureProperty.setNative](value: boolean) {
13
+ const field = this.ios
14
+ const text = field.text
15
+ const selection = field.selectedTextRange
16
+ const start = selection
17
+ ? field.offsetFromPositionToPosition(field.beginningOfDocument, selection.start)
18
+ : null
19
+ const end = selection
20
+ ? field.offsetFromPositionToPosition(field.beginningOfDocument, selection.end)
21
+ : null
22
+ setSecure.call(this, value)
23
+ if (field.isFirstResponder) {
24
+ // Core treats the first secure keystroke as replacing the whole value. This is
25
+ // an existing edit switching visibility, so its next keystroke must use the selection.
26
+ const state = this as unknown as { _firstEdit: boolean }
27
+ state._firstEdit = false
28
+ }
29
+ if (field.isFirstResponder && value && text) {
30
+ // UIKit otherwise clears the secure buffer on the next insertion. Reinsert
31
+ // the existing value without treating it as a new edit in Core's delegate.
32
+ const delegate = field.delegate
33
+ try {
34
+ field.delegate = null
35
+ field.text = ''
36
+ field.insertText(text)
37
+ } finally {
38
+ field.delegate = delegate
39
+ }
40
+ } else {
41
+ field.text = text
42
+ }
43
+ if (start !== null && end !== null) {
44
+ const from = field.positionFromPositionOffset(field.beginningOfDocument, start)
45
+ const to = field.positionFromPositionOffset(field.beginningOfDocument, end)
46
+ if (from && to) field.selectedTextRange = field.textRangeFromPositionToPosition(from, to)
47
+ }
48
+ }
49
+
50
+ [fontScaleInternalProperty.setNative]() {
51
+ applyDynamicType(this)
52
+ }
53
+ }
@@ -0,0 +1,10 @@
1
+ import { TextView } from '@nativescript/core'
2
+ import { fontScaleInternalProperty } from '@nativescript/core/ui/styling/style-properties'
3
+ import { applyDynamicType } from './dynamic-type'
4
+
5
+ /** Follows the system text size with the iOS body curve instead of Core's table. */
6
+ export class MavisTextView extends TextView {
7
+ [fontScaleInternalProperty.setNative]() {
8
+ applyDynamicType(this)
9
+ }
10
+ }
@@ -0,0 +1,9 @@
1
+ import { Application, type View } from '@nativescript/core'
2
+
3
+ export function toastReaderActive(): boolean {
4
+ const manager = Application.android.context?.getSystemService('accessibility')
5
+ return Boolean(manager?.isTouchExplorationEnabled())
6
+ }
7
+ export function announceToast(view: View, message: string) {
8
+ if (view.isLoaded && toastReaderActive()) view.android?.announceForAccessibility(message)
9
+ }
@@ -0,0 +1,13 @@
1
+ import type { View } from '@nativescript/core'
2
+
3
+ declare function UIAccessibilityIsVoiceOverRunning(): boolean
4
+ declare const UIAccessibilityAnnouncementNotification: number
5
+ declare function UIAccessibilityPostNotification(notification: number, argument: unknown): void
6
+
7
+ export function toastReaderActive() {
8
+ return UIAccessibilityIsVoiceOverRunning()
9
+ }
10
+ export function announceToast(view: View, message: string) {
11
+ if (view.isLoaded && toastReaderActive())
12
+ UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, message)
13
+ }
@@ -0,0 +1,6 @@
1
+ import type { View } from '@nativescript/core'
2
+
3
+ export function announceToast(_view: View, _message: string) {}
4
+ export function toastReaderActive(): boolean {
5
+ return false
6
+ }