@getcortexlabs/mavis 0.1.0-alpha.1 → 0.1.0-alpha.10

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 (671) hide show
  1. package/README.md +9 -5
  2. package/dist/app-icons.d.ts +26 -0
  3. package/dist/app-icons.d.ts.map +1 -0
  4. package/dist/app-icons.js +9 -0
  5. package/dist/app-icons.js.map +1 -0
  6. package/dist/date-format.d.ts +3 -0
  7. package/dist/date-format.d.ts.map +1 -0
  8. package/dist/date-format.js +2 -0
  9. package/dist/date-format.js.map +1 -0
  10. package/dist/files.d.ts +4 -0
  11. package/dist/files.d.ts.map +1 -0
  12. package/dist/files.js +3 -0
  13. package/dist/files.js.map +1 -0
  14. package/dist/native/app-icons.android.d.ts +4 -0
  15. package/dist/native/app-icons.android.d.ts.map +1 -0
  16. package/dist/native/app-icons.android.js +67 -0
  17. package/dist/native/app-icons.android.js.map +1 -0
  18. package/dist/native/app-icons.d.ts +4 -0
  19. package/dist/native/app-icons.d.ts.map +1 -0
  20. package/dist/native/app-icons.ios.d.ts +4 -0
  21. package/dist/native/app-icons.ios.d.ts.map +1 -0
  22. package/dist/native/app-icons.ios.js +45 -0
  23. package/dist/native/app-icons.ios.js.map +1 -0
  24. package/dist/native/app-icons.js +9 -0
  25. package/dist/native/app-icons.js.map +1 -0
  26. package/dist/native/appearance.android.d.ts +4 -0
  27. package/dist/native/appearance.android.d.ts.map +1 -0
  28. package/dist/native/appearance.android.js +55 -0
  29. package/dist/native/appearance.android.js.map +1 -0
  30. package/dist/native/appearance.d.ts +4 -0
  31. package/dist/native/appearance.d.ts.map +1 -0
  32. package/dist/native/appearance.js +31 -0
  33. package/dist/native/appearance.js.map +1 -0
  34. package/dist/native/avatar-image.d.ts +4 -0
  35. package/dist/native/avatar-image.d.ts.map +1 -0
  36. package/dist/native/avatar-image.js +12 -0
  37. package/dist/native/avatar-image.js.map +1 -0
  38. package/dist/native/avatar-label.android.d.ts +9 -0
  39. package/dist/native/avatar-label.android.d.ts.map +1 -0
  40. package/dist/native/avatar-label.android.js +9 -0
  41. package/dist/native/avatar-label.android.js.map +1 -0
  42. package/dist/native/avatar-label.d.ts +2 -0
  43. package/dist/native/avatar-label.d.ts.map +1 -0
  44. package/dist/native/avatar-label.js +2 -0
  45. package/dist/native/avatar-label.js.map +1 -0
  46. package/dist/native/box.android.d.ts +5 -0
  47. package/dist/native/box.android.d.ts.map +1 -0
  48. package/dist/native/box.android.js +7 -0
  49. package/dist/native/box.android.js.map +1 -0
  50. package/dist/native/box.d.ts +2 -0
  51. package/dist/native/box.d.ts.map +1 -0
  52. package/dist/native/box.ios.d.ts +10 -0
  53. package/dist/native/box.ios.d.ts.map +1 -0
  54. package/dist/native/box.ios.js +40 -0
  55. package/dist/native/box.ios.js.map +1 -0
  56. package/dist/native/box.js +3 -0
  57. package/dist/native/box.js.map +1 -0
  58. package/dist/native/button.android.d.ts +11 -0
  59. package/dist/native/button.android.d.ts.map +1 -0
  60. package/dist/native/button.android.js +31 -0
  61. package/dist/native/button.android.js.map +1 -0
  62. package/dist/native/button.ios.d.ts +13 -1
  63. package/dist/native/button.ios.d.ts.map +1 -1
  64. package/dist/native/button.ios.js +29 -1
  65. package/dist/native/button.ios.js.map +1 -1
  66. package/dist/native/checkbox.android.d.ts +7 -0
  67. package/dist/native/checkbox.android.d.ts.map +1 -0
  68. package/dist/native/checkbox.android.js +26 -0
  69. package/dist/native/checkbox.android.js.map +1 -0
  70. package/dist/native/checkbox.d.ts +7 -0
  71. package/dist/native/checkbox.d.ts.map +1 -0
  72. package/dist/native/checkbox.js +7 -0
  73. package/dist/native/checkbox.js.map +1 -0
  74. package/dist/native/collection-motion.d.ts +5 -0
  75. package/dist/native/collection-motion.d.ts.map +1 -0
  76. package/dist/native/collection-motion.js +157 -0
  77. package/dist/native/collection-motion.js.map +1 -0
  78. package/dist/native/combobox-editor.android.d.ts +3 -0
  79. package/dist/native/combobox-editor.android.d.ts.map +1 -0
  80. package/dist/native/combobox-editor.android.js +5 -0
  81. package/dist/native/combobox-editor.android.js.map +1 -0
  82. package/dist/native/combobox-editor.d.ts +4 -0
  83. package/dist/native/combobox-editor.d.ts.map +1 -0
  84. package/dist/native/combobox-editor.js +5 -0
  85. package/dist/native/combobox-editor.js.map +1 -0
  86. package/dist/native/composed-button.android.d.ts +4 -0
  87. package/dist/native/composed-button.android.d.ts.map +1 -0
  88. package/dist/native/composed-button.android.js +53 -0
  89. package/dist/native/composed-button.android.js.map +1 -0
  90. package/dist/native/composed-button.d.ts +3 -0
  91. package/dist/native/composed-button.d.ts.map +1 -0
  92. package/dist/native/composed-button.js +4 -0
  93. package/dist/native/composed-button.js.map +1 -0
  94. package/dist/native/date-format.android.d.ts +5 -0
  95. package/dist/native/date-format.android.d.ts.map +1 -0
  96. package/dist/native/date-format.android.js +39 -0
  97. package/dist/native/date-format.android.js.map +1 -0
  98. package/dist/native/date-format.d.ts +6 -0
  99. package/dist/native/date-format.d.ts.map +1 -0
  100. package/dist/native/date-format.ios.d.ts +5 -0
  101. package/dist/native/date-format.ios.d.ts.map +1 -0
  102. package/dist/native/date-format.ios.js +29 -0
  103. package/dist/native/date-format.ios.js.map +1 -0
  104. package/dist/native/date-format.js +8 -0
  105. package/dist/native/date-format.js.map +1 -0
  106. package/dist/native/dialog.android.d.ts +12 -0
  107. package/dist/native/dialog.android.d.ts.map +1 -0
  108. package/dist/native/dialog.android.js +46 -0
  109. package/dist/native/dialog.android.js.map +1 -0
  110. package/dist/native/dialog.d.ts +12 -0
  111. package/dist/native/dialog.d.ts.map +1 -0
  112. package/dist/native/dialog.ios.d.ts +12 -0
  113. package/dist/native/dialog.ios.d.ts.map +1 -0
  114. package/dist/native/dialog.ios.js +13 -0
  115. package/dist/native/dialog.ios.js.map +1 -0
  116. package/dist/native/dialog.js +4 -0
  117. package/dist/native/dialog.js.map +1 -0
  118. package/dist/native/dynamic-type.d.ts +15 -0
  119. package/dist/native/dynamic-type.d.ts.map +1 -0
  120. package/dist/native/dynamic-type.js +47 -0
  121. package/dist/native/dynamic-type.js.map +1 -0
  122. package/dist/native/file-access.d.ts +23 -0
  123. package/dist/native/file-access.d.ts.map +1 -0
  124. package/dist/native/file-access.js +55 -0
  125. package/dist/native/file-access.js.map +1 -0
  126. package/dist/native/file-picker.android.d.ts +3 -0
  127. package/dist/native/file-picker.android.d.ts.map +1 -0
  128. package/dist/native/file-picker.android.js +147 -0
  129. package/dist/native/file-picker.android.js.map +1 -0
  130. package/dist/native/file-picker.d.ts +4 -0
  131. package/dist/native/file-picker.d.ts.map +1 -0
  132. package/dist/native/file-picker.ios.d.ts +3 -0
  133. package/dist/native/file-picker.ios.d.ts.map +1 -0
  134. package/dist/native/file-picker.ios.js +152 -0
  135. package/dist/native/file-picker.ios.js.map +1 -0
  136. package/dist/native/file-picker.js +7 -0
  137. package/dist/native/file-picker.js.map +1 -0
  138. package/dist/native/flex-children.d.ts +4 -0
  139. package/dist/native/flex-children.d.ts.map +1 -0
  140. package/dist/native/flex-children.js +12 -0
  141. package/dist/native/flex-children.js.map +1 -0
  142. package/dist/native/flex-layout.android.d.ts +3 -1
  143. package/dist/native/flex-layout.android.d.ts.map +1 -1
  144. package/dist/native/flex-layout.android.js +9 -0
  145. package/dist/native/flex-layout.android.js.map +1 -1
  146. package/dist/native/flex-layout.ios.d.ts +14 -1
  147. package/dist/native/flex-layout.ios.d.ts.map +1 -1
  148. package/dist/native/flex-layout.ios.js +113 -0
  149. package/dist/native/flex-layout.ios.js.map +1 -1
  150. package/dist/native/image-effects.d.ts +11 -0
  151. package/dist/native/image-effects.d.ts.map +1 -0
  152. package/dist/native/image-effects.js +61 -0
  153. package/dist/native/image-effects.js.map +1 -0
  154. package/dist/native/input-action.d.ts +5 -0
  155. package/dist/native/input-action.d.ts.map +1 -0
  156. package/dist/native/input-action.js +13 -0
  157. package/dist/native/input-action.js.map +1 -0
  158. package/dist/native/keyboard-dismiss.android.d.ts +8 -0
  159. package/dist/native/keyboard-dismiss.android.d.ts.map +1 -0
  160. package/dist/native/keyboard-dismiss.android.js +9 -0
  161. package/dist/native/keyboard-dismiss.android.js.map +1 -0
  162. package/dist/native/keyboard-dismiss.d.ts +10 -0
  163. package/dist/native/keyboard-dismiss.d.ts.map +1 -0
  164. package/dist/native/keyboard-dismiss.ios.d.ts +8 -0
  165. package/dist/native/keyboard-dismiss.ios.d.ts.map +1 -0
  166. package/dist/native/keyboard-dismiss.ios.js +91 -0
  167. package/dist/native/keyboard-dismiss.ios.js.map +1 -0
  168. package/dist/native/keyboard-dismiss.js +6 -0
  169. package/dist/native/keyboard-dismiss.js.map +1 -0
  170. package/dist/native/label.android.d.ts +12 -0
  171. package/dist/native/label.android.d.ts.map +1 -0
  172. package/dist/native/label.android.js +19 -0
  173. package/dist/native/label.android.js.map +1 -0
  174. package/dist/native/label.ios.d.ts +14 -1
  175. package/dist/native/label.ios.d.ts.map +1 -1
  176. package/dist/native/label.ios.js +37 -1
  177. package/dist/native/label.ios.js.map +1 -1
  178. package/dist/native/measure-memo.d.ts +37 -0
  179. package/dist/native/measure-memo.d.ts.map +1 -0
  180. package/dist/native/measure-memo.js +82 -0
  181. package/dist/native/measure-memo.js.map +1 -0
  182. package/dist/native/motion-owner.d.ts +5 -0
  183. package/dist/native/motion-owner.d.ts.map +1 -0
  184. package/dist/native/motion-owner.js +58 -0
  185. package/dist/native/motion-owner.js.map +1 -0
  186. package/dist/native/motion-region.d.ts +7 -0
  187. package/dist/native/motion-region.d.ts.map +1 -0
  188. package/dist/native/motion-region.js +249 -0
  189. package/dist/native/motion-region.js.map +1 -0
  190. package/dist/native/motion-surface.d.ts +9 -0
  191. package/dist/native/motion-surface.d.ts.map +1 -0
  192. package/dist/native/motion-surface.js +229 -0
  193. package/dist/native/motion-surface.js.map +1 -0
  194. package/dist/native/platform-motion.d.ts +5 -0
  195. package/dist/native/platform-motion.d.ts.map +1 -0
  196. package/dist/native/platform-motion.js +90 -0
  197. package/dist/native/platform-motion.js.map +1 -0
  198. package/dist/native/press.d.ts +8 -2
  199. package/dist/native/press.d.ts.map +1 -1
  200. package/dist/native/press.js +58 -8
  201. package/dist/native/press.js.map +1 -1
  202. package/dist/native/progress.d.ts +7 -0
  203. package/dist/native/progress.d.ts.map +1 -0
  204. package/dist/native/progress.js +77 -0
  205. package/dist/native/progress.js.map +1 -0
  206. package/dist/native/screen.android.d.ts +6 -0
  207. package/dist/native/screen.android.d.ts.map +1 -0
  208. package/dist/native/screen.android.js +8 -0
  209. package/dist/native/screen.android.js.map +1 -0
  210. package/dist/native/screen.d.ts +2 -0
  211. package/dist/native/screen.d.ts.map +1 -0
  212. package/dist/native/screen.js +3 -0
  213. package/dist/native/screen.js.map +1 -0
  214. package/dist/native/scroll-motion.d.ts +12 -0
  215. package/dist/native/scroll-motion.d.ts.map +1 -0
  216. package/dist/native/scroll-motion.js +100 -0
  217. package/dist/native/scroll-motion.js.map +1 -0
  218. package/dist/native/section-scroll.d.ts +9 -0
  219. package/dist/native/section-scroll.d.ts.map +1 -0
  220. package/dist/native/section-scroll.js +69 -0
  221. package/dist/native/section-scroll.js.map +1 -0
  222. package/dist/native/segmented.d.ts +14 -0
  223. package/dist/native/segmented.d.ts.map +1 -0
  224. package/dist/native/segmented.js +86 -0
  225. package/dist/native/segmented.js.map +1 -0
  226. package/dist/native/sheet.android.d.ts +18 -0
  227. package/dist/native/sheet.android.d.ts.map +1 -0
  228. package/dist/native/sheet.android.js +16 -0
  229. package/dist/native/sheet.android.js.map +1 -0
  230. package/dist/native/sheet.d.ts +21 -0
  231. package/dist/native/sheet.d.ts.map +1 -0
  232. package/dist/native/sheet.ios.d.ts +19 -0
  233. package/dist/native/sheet.ios.d.ts.map +1 -0
  234. package/dist/native/sheet.ios.js +41 -0
  235. package/dist/native/sheet.ios.js.map +1 -0
  236. package/dist/native/sheet.js +17 -0
  237. package/dist/native/sheet.js.map +1 -0
  238. package/dist/native/surface-effects.d.ts +4 -0
  239. package/dist/native/surface-effects.d.ts.map +1 -0
  240. package/dist/native/surface-effects.js +31 -0
  241. package/dist/native/surface-effects.js.map +1 -0
  242. package/dist/native/tabs.android.d.ts +3 -0
  243. package/dist/native/tabs.android.d.ts.map +1 -0
  244. package/dist/native/tabs.android.js +29 -0
  245. package/dist/native/tabs.android.js.map +1 -0
  246. package/dist/native/tabs.d.ts +3 -0
  247. package/dist/native/tabs.d.ts.map +1 -0
  248. package/dist/native/tabs.js +4 -0
  249. package/dist/native/tabs.js.map +1 -0
  250. package/dist/native/text-field.android.d.ts +1 -0
  251. package/dist/native/text-field.android.d.ts.map +1 -1
  252. package/dist/native/text-field.android.js +13 -0
  253. package/dist/native/text-field.android.js.map +1 -1
  254. package/dist/native/text-field.ios.d.ts +9 -0
  255. package/dist/native/text-field.ios.d.ts.map +1 -0
  256. package/dist/native/text-field.ios.js +52 -0
  257. package/dist/native/text-field.ios.js.map +1 -0
  258. package/dist/native/text-view.ios.d.ts +7 -0
  259. package/dist/native/text-view.ios.d.ts.map +1 -0
  260. package/dist/native/text-view.ios.js +10 -0
  261. package/dist/native/text-view.ios.js.map +1 -0
  262. package/dist/native/toast.android.d.ts +4 -0
  263. package/dist/native/toast.android.d.ts.map +1 -0
  264. package/dist/native/toast.android.js +10 -0
  265. package/dist/native/toast.android.js.map +1 -0
  266. package/dist/native/toast.d.ts +4 -0
  267. package/dist/native/toast.d.ts.map +1 -0
  268. package/dist/native/toast.ios.d.ts +4 -0
  269. package/dist/native/toast.ios.d.ts.map +1 -0
  270. package/dist/native/toast.ios.js +8 -0
  271. package/dist/native/toast.ios.js.map +1 -0
  272. package/dist/native/toast.js +5 -0
  273. package/dist/native/toast.js.map +1 -0
  274. package/dist/native/visual-effects.d.ts +5 -0
  275. package/dist/native/visual-effects.d.ts.map +1 -0
  276. package/dist/native/visual-effects.js +126 -0
  277. package/dist/native/visual-effects.js.map +1 -0
  278. package/dist/vue/components/ChoiceControl.d.ts +111 -0
  279. package/dist/vue/components/ChoiceControl.d.ts.map +1 -0
  280. package/dist/vue/components/ChoiceControl.js +211 -0
  281. package/dist/vue/components/ChoiceControl.js.map +1 -0
  282. package/dist/vue/components/DateCalendar.d.ts +94 -0
  283. package/dist/vue/components/DateCalendar.d.ts.map +1 -0
  284. package/dist/vue/components/DateCalendar.js +96 -0
  285. package/dist/vue/components/DateCalendar.js.map +1 -0
  286. package/dist/vue/components/LoadingDecoration.d.ts +116 -0
  287. package/dist/vue/components/LoadingDecoration.d.ts.map +1 -0
  288. package/dist/vue/components/LoadingDecoration.js +34 -0
  289. package/dist/vue/components/LoadingDecoration.js.map +1 -0
  290. package/dist/vue/components/MAccordion.d.ts +119 -0
  291. package/dist/vue/components/MAccordion.d.ts.map +1 -0
  292. package/dist/vue/components/MAccordion.js +83 -0
  293. package/dist/vue/components/MAccordion.js.map +1 -0
  294. package/dist/vue/components/MAlert.d.ts +109 -0
  295. package/dist/vue/components/MAlert.d.ts.map +1 -0
  296. package/dist/vue/components/MAlert.js +126 -0
  297. package/dist/vue/components/MAlert.js.map +1 -0
  298. package/dist/vue/components/MAvatar.d.ts +80 -0
  299. package/dist/vue/components/MAvatar.d.ts.map +1 -0
  300. package/dist/vue/components/MAvatar.js +86 -0
  301. package/dist/vue/components/MAvatar.js.map +1 -0
  302. package/dist/vue/components/MBadge.d.ts +70 -0
  303. package/dist/vue/components/MBadge.d.ts.map +1 -0
  304. package/dist/vue/components/MBadge.js +30 -0
  305. package/dist/vue/components/MBadge.js.map +1 -0
  306. package/dist/vue/components/MButton.d.ts +212 -32
  307. package/dist/vue/components/MButton.d.ts.map +1 -1
  308. package/dist/vue/components/MButton.js +192 -20
  309. package/dist/vue/components/MButton.js.map +1 -1
  310. package/dist/vue/components/MCard.d.ts +113 -21
  311. package/dist/vue/components/MCard.d.ts.map +1 -1
  312. package/dist/vue/components/MCard.js +24 -6
  313. package/dist/vue/components/MCard.js.map +1 -1
  314. package/dist/vue/components/MCheckbox.d.ts +103 -0
  315. package/dist/vue/components/MCheckbox.d.ts.map +1 -0
  316. package/dist/vue/components/MCheckbox.js +26 -0
  317. package/dist/vue/components/MCheckbox.js.map +1 -0
  318. package/dist/vue/components/MChip.d.ts +117 -0
  319. package/dist/vue/components/MChip.d.ts.map +1 -0
  320. package/dist/vue/components/MChip.js +120 -0
  321. package/dist/vue/components/MChip.js.map +1 -0
  322. package/dist/vue/components/MCombobox.d.ts +279 -0
  323. package/dist/vue/components/MCombobox.d.ts.map +1 -0
  324. package/dist/vue/components/MCombobox.js +234 -0
  325. package/dist/vue/components/MCombobox.js.map +1 -0
  326. package/dist/vue/components/MDatePicker.d.ts +1350 -0
  327. package/dist/vue/components/MDatePicker.d.ts.map +1 -0
  328. package/dist/vue/components/MDatePicker.js +25 -0
  329. package/dist/vue/components/MDatePicker.js.map +1 -0
  330. package/dist/vue/components/MDialog.d.ts +100 -0
  331. package/dist/vue/components/MDialog.d.ts.map +1 -0
  332. package/dist/vue/components/MDialog.js +245 -0
  333. package/dist/vue/components/MDialog.js.map +1 -0
  334. package/dist/vue/components/MEmptyState.d.ts +117 -0
  335. package/dist/vue/components/MEmptyState.d.ts.map +1 -0
  336. package/dist/vue/components/MEmptyState.js +79 -0
  337. package/dist/vue/components/MEmptyState.js.map +1 -0
  338. package/dist/vue/components/MFilePicker.d.ts +112 -0
  339. package/dist/vue/components/MFilePicker.d.ts.map +1 -0
  340. package/dist/vue/components/MFilePicker.js +196 -0
  341. package/dist/vue/components/MFilePicker.js.map +1 -0
  342. package/dist/vue/components/MGrid.d.ts +165 -0
  343. package/dist/vue/components/MGrid.d.ts.map +1 -0
  344. package/dist/vue/components/MGrid.js +52 -0
  345. package/dist/vue/components/MGrid.js.map +1 -0
  346. package/dist/vue/components/MIcon.d.ts +75 -0
  347. package/dist/vue/components/MIcon.d.ts.map +1 -0
  348. package/dist/vue/components/MIcon.js +45 -0
  349. package/dist/vue/components/MIcon.js.map +1 -0
  350. package/dist/vue/components/MImage.d.ts +248 -0
  351. package/dist/vue/components/MImage.d.ts.map +1 -0
  352. package/dist/vue/components/MImage.js +157 -0
  353. package/dist/vue/components/MImage.js.map +1 -0
  354. package/dist/vue/components/MInput.d.ts +195 -50
  355. package/dist/vue/components/MInput.d.ts.map +1 -1
  356. package/dist/vue/components/MInput.js +134 -20
  357. package/dist/vue/components/MInput.js.map +1 -1
  358. package/dist/vue/components/MLink.d.ts +120 -0
  359. package/dist/vue/components/MLink.d.ts.map +1 -0
  360. package/dist/vue/components/MLink.js +76 -0
  361. package/dist/vue/components/MLink.js.map +1 -0
  362. package/dist/vue/components/MListItem.d.ts +106 -0
  363. package/dist/vue/components/MListItem.d.ts.map +1 -0
  364. package/dist/vue/components/MListItem.js +53 -0
  365. package/dist/vue/components/MListItem.js.map +1 -0
  366. package/dist/vue/components/MPopover.d.ts +106 -0
  367. package/dist/vue/components/MPopover.d.ts.map +1 -0
  368. package/dist/vue/components/MPopover.js +209 -0
  369. package/dist/vue/components/MPopover.js.map +1 -0
  370. package/dist/vue/components/MProgress.d.ts +122 -0
  371. package/dist/vue/components/MProgress.d.ts.map +1 -0
  372. package/dist/vue/components/MProgress.js +75 -0
  373. package/dist/vue/components/MProgress.js.map +1 -0
  374. package/dist/vue/components/MRadioGroup.d.ts +103 -0
  375. package/dist/vue/components/MRadioGroup.d.ts.map +1 -0
  376. package/dist/vue/components/MRadioGroup.js +57 -0
  377. package/dist/vue/components/MRadioGroup.js.map +1 -0
  378. package/dist/vue/components/MReveal.d.ts +73 -37
  379. package/dist/vue/components/MReveal.d.ts.map +1 -1
  380. package/dist/vue/components/MReveal.js +80 -37
  381. package/dist/vue/components/MReveal.js.map +1 -1
  382. package/dist/vue/components/MScreen.d.ts +42 -8
  383. package/dist/vue/components/MScreen.d.ts.map +1 -1
  384. package/dist/vue/components/MScreen.js +91 -6
  385. package/dist/vue/components/MScreen.js.map +1 -1
  386. package/dist/vue/components/MSegmentedControl.d.ts +95 -0
  387. package/dist/vue/components/MSegmentedControl.d.ts.map +1 -0
  388. package/dist/vue/components/MSegmentedControl.js +172 -0
  389. package/dist/vue/components/MSegmentedControl.js.map +1 -0
  390. package/dist/vue/components/MSelect.d.ts +140 -0
  391. package/dist/vue/components/MSelect.d.ts.map +1 -0
  392. package/dist/vue/components/MSelect.js +158 -0
  393. package/dist/vue/components/MSelect.js.map +1 -0
  394. package/dist/vue/components/MSeparator.d.ts +56 -0
  395. package/dist/vue/components/MSeparator.d.ts.map +1 -0
  396. package/dist/vue/components/MSeparator.js +36 -0
  397. package/dist/vue/components/MSeparator.js.map +1 -0
  398. package/dist/vue/components/MSheet.d.ts +116 -0
  399. package/dist/vue/components/MSheet.d.ts.map +1 -0
  400. package/dist/vue/components/MSheet.js +313 -0
  401. package/dist/vue/components/MSheet.js.map +1 -0
  402. package/dist/vue/components/MSkeleton.d.ts +89 -0
  403. package/dist/vue/components/MSkeleton.d.ts.map +1 -0
  404. package/dist/vue/components/MSkeleton.js +89 -0
  405. package/dist/vue/components/MSkeleton.js.map +1 -0
  406. package/dist/vue/components/MSlider.d.ts +8 -4
  407. package/dist/vue/components/MSlider.d.ts.map +1 -1
  408. package/dist/vue/components/MSlider.js +3 -2
  409. package/dist/vue/components/MSlider.js.map +1 -1
  410. package/dist/vue/components/MStack.d.ts +199 -0
  411. package/dist/vue/components/MStack.d.ts.map +1 -0
  412. package/dist/vue/components/MStack.js +62 -0
  413. package/dist/vue/components/MStack.js.map +1 -0
  414. package/dist/vue/components/MSwitch.d.ts +89 -0
  415. package/dist/vue/components/MSwitch.d.ts.map +1 -0
  416. package/dist/vue/components/MSwitch.js +173 -0
  417. package/dist/vue/components/MSwitch.js.map +1 -0
  418. package/dist/vue/components/MTabs.d.ts +101 -0
  419. package/dist/vue/components/MTabs.d.ts.map +1 -0
  420. package/dist/vue/components/MTabs.js +245 -0
  421. package/dist/vue/components/MTabs.js.map +1 -0
  422. package/dist/vue/components/MText.d.ts +61 -25
  423. package/dist/vue/components/MText.d.ts.map +1 -1
  424. package/dist/vue/components/MText.js +47 -19
  425. package/dist/vue/components/MText.js.map +1 -1
  426. package/dist/vue/components/MTimePicker.d.ts +655 -0
  427. package/dist/vue/components/MTimePicker.d.ts.map +1 -0
  428. package/dist/vue/components/MTimePicker.js +50 -0
  429. package/dist/vue/components/MTimePicker.js.map +1 -0
  430. package/dist/vue/components/MToast.d.ts +23 -0
  431. package/dist/vue/components/MToast.d.ts.map +1 -0
  432. package/dist/vue/components/MToast.js +242 -0
  433. package/dist/vue/components/MToast.js.map +1 -0
  434. package/dist/vue/components/MVirtualList.d.ts +3 -0
  435. package/dist/vue/components/MVirtualList.d.ts.map +1 -0
  436. package/dist/vue/components/MVirtualList.js +88 -0
  437. package/dist/vue/components/MVirtualList.js.map +1 -0
  438. package/dist/vue/components/configurator.d.ts +541 -0
  439. package/dist/vue/components/configurator.d.ts.map +1 -0
  440. package/dist/vue/components/configurator.js +24 -0
  441. package/dist/vue/components/configurator.js.map +1 -0
  442. package/dist/vue/components/layout.d.ts +230 -88
  443. package/dist/vue/components/layout.d.ts.map +1 -1
  444. package/dist/vue/components/layout.js +16 -9
  445. package/dist/vue/components/layout.js.map +1 -1
  446. package/dist/vue/components/navigation.d.ts +225 -0
  447. package/dist/vue/components/navigation.d.ts.map +1 -0
  448. package/dist/vue/components/navigation.js +16 -0
  449. package/dist/vue/components/navigation.js.map +1 -0
  450. package/dist/vue/components/workflows.d.ts +251 -0
  451. package/dist/vue/components/workflows.d.ts.map +1 -0
  452. package/dist/vue/components/workflows.js +35 -0
  453. package/dist/vue/components/workflows.js.map +1 -0
  454. package/dist/vue/index.d.ts +50 -9
  455. package/dist/vue/index.d.ts.map +1 -1
  456. package/dist/vue/index.js +89 -7
  457. package/dist/vue/index.js.map +1 -1
  458. package/dist/vue/layers.d.ts +19 -0
  459. package/dist/vue/layers.d.ts.map +1 -0
  460. package/dist/vue/layers.js +26 -0
  461. package/dist/vue/layers.js.map +1 -0
  462. package/dist/vue/native-view.d.ts +6 -0
  463. package/dist/vue/native-view.d.ts.map +1 -0
  464. package/dist/vue/native-view.js +5 -0
  465. package/dist/vue/native-view.js.map +1 -0
  466. package/dist/vue/navigation.d.ts +4 -0
  467. package/dist/vue/navigation.d.ts.map +1 -0
  468. package/dist/vue/navigation.js +16 -0
  469. package/dist/vue/navigation.js.map +1 -0
  470. package/dist/vue/props.d.ts +12 -11
  471. package/dist/vue/props.d.ts.map +1 -1
  472. package/dist/vue/props.js +25 -10
  473. package/dist/vue/props.js.map +1 -1
  474. package/dist/vue/router-navigation.d.ts +25 -0
  475. package/dist/vue/router-navigation.d.ts.map +1 -0
  476. package/dist/vue/router-navigation.js +15 -0
  477. package/dist/vue/router-navigation.js.map +1 -0
  478. package/dist/vue/services.d.ts +16 -0
  479. package/dist/vue/services.d.ts.map +1 -0
  480. package/dist/vue/services.js +23 -0
  481. package/dist/vue/services.js.map +1 -0
  482. package/dist/vue/system-back.d.ts +11 -0
  483. package/dist/vue/system-back.d.ts.map +1 -0
  484. package/dist/vue/system-back.js +2 -0
  485. package/dist/vue/system-back.js.map +1 -0
  486. package/dist/vue/use-choice-paint.d.ts +9 -0
  487. package/dist/vue/use-choice-paint.d.ts.map +1 -0
  488. package/dist/vue/use-choice-paint.js +32 -0
  489. package/dist/vue/use-choice-paint.js.map +1 -0
  490. package/dist/vue/use-motion-region.d.ts +7 -0
  491. package/dist/vue/use-motion-region.d.ts.map +1 -0
  492. package/dist/vue/use-motion-region.js +28 -0
  493. package/dist/vue/use-motion-region.js.map +1 -0
  494. package/dist/vue/use-motion-surface.d.ts +8 -0
  495. package/dist/vue/use-motion-surface.d.ts.map +1 -0
  496. package/dist/vue/use-motion-surface.js +105 -0
  497. package/dist/vue/use-motion-surface.js.map +1 -0
  498. package/dist/vue/use-press.d.ts +1 -1
  499. package/dist/vue/use-press.d.ts.map +1 -1
  500. package/dist/vue/use-press.js +13 -5
  501. package/dist/vue/use-press.js.map +1 -1
  502. package/dist/vue/use-scroll-motion.d.ts +7 -0
  503. package/dist/vue/use-scroll-motion.d.ts.map +1 -0
  504. package/dist/vue/use-scroll-motion.js +30 -0
  505. package/dist/vue/use-scroll-motion.js.map +1 -0
  506. package/fonts/LICENSE +45 -0
  507. package/fonts/lucide.ttf +0 -0
  508. package/package.json +20 -4
  509. package/platforms/android/java/com/mavis/ui/Box.java +65 -0
  510. package/platforms/android/java/com/mavis/ui/ContentWidth.java +77 -0
  511. package/platforms/android/java/com/mavis/ui/FlexLayout.java +101 -4
  512. package/platforms/android/java/com/mavis/ui/MeasureMemo.java +145 -0
  513. package/platforms/android/java/com/mavis/ui/Screen.java +108 -0
  514. package/src/app-icons.ts +21 -0
  515. package/src/date-format.ts +2 -0
  516. package/src/files.ts +3 -0
  517. package/src/native/app-icons.android.ts +95 -0
  518. package/src/native/app-icons.ios.ts +74 -0
  519. package/src/native/app-icons.ts +12 -0
  520. package/src/native/appearance.android.ts +75 -0
  521. package/src/native/appearance.ts +33 -0
  522. package/src/native/avatar-image.ts +9 -0
  523. package/src/native/avatar-label.android.ts +14 -0
  524. package/src/native/avatar-label.ts +1 -0
  525. package/src/native/box.android.ts +11 -0
  526. package/src/native/box.ios.ts +61 -0
  527. package/src/native/box.ts +2 -0
  528. package/src/native/button.android.ts +38 -0
  529. package/src/native/button.ios.ts +53 -1
  530. package/src/native/checkbox.android.ts +35 -0
  531. package/src/native/checkbox.ts +9 -0
  532. package/src/native/collection-motion.ts +166 -0
  533. package/src/native/combobox-editor.android.ts +11 -0
  534. package/src/native/combobox-editor.ts +6 -0
  535. package/src/native/composed-button.android.ts +74 -0
  536. package/src/native/composed-button.ts +9 -0
  537. package/src/native/date-format.android.ts +72 -0
  538. package/src/native/date-format.ios.ts +54 -0
  539. package/src/native/date-format.ts +17 -0
  540. package/src/native/dialog.android.ts +56 -0
  541. package/src/native/dialog.ios.ts +23 -0
  542. package/src/native/dialog.ts +10 -0
  543. package/src/native/dynamic-type.ts +71 -0
  544. package/src/native/file-access.ts +71 -0
  545. package/src/native/file-picker.android.ts +191 -0
  546. package/src/native/file-picker.ios.ts +230 -0
  547. package/src/native/file-picker.ts +8 -0
  548. package/src/native/flex-children.ts +12 -0
  549. package/src/native/flex-layout.android.ts +12 -1
  550. package/src/native/flex-layout.ios.ts +148 -1
  551. package/src/native/image-effects.ts +71 -0
  552. package/src/native/input-action.ts +15 -0
  553. package/src/native/keyboard-dismiss.android.ts +17 -0
  554. package/src/native/keyboard-dismiss.ios.ts +124 -0
  555. package/src/native/keyboard-dismiss.ts +14 -0
  556. package/src/native/label.android.ts +27 -0
  557. package/src/native/label.ios.ts +54 -1
  558. package/src/native/measure-memo.ts +116 -0
  559. package/src/native/motion-owner.ts +66 -0
  560. package/src/native/motion-region.ts +293 -0
  561. package/src/native/motion-surface.ts +273 -0
  562. package/src/native/platform-motion.ts +103 -0
  563. package/src/native/press.ts +58 -10
  564. package/src/native/progress.ts +78 -0
  565. package/src/native/screen.android.ts +12 -0
  566. package/src/native/screen.ts +2 -0
  567. package/src/native/scroll-motion.ts +106 -0
  568. package/src/native/section-scroll.ts +81 -0
  569. package/src/native/segmented.ts +95 -0
  570. package/src/native/sheet.android.ts +24 -0
  571. package/src/native/sheet.ios.ts +52 -0
  572. package/src/native/sheet.ts +26 -0
  573. package/src/native/surface-effects.ts +33 -0
  574. package/src/native/tabs.android.ts +58 -0
  575. package/src/native/tabs.ts +8 -0
  576. package/src/native/text-field.android.ts +19 -0
  577. package/src/native/text-field.ios.ts +53 -0
  578. package/src/native/text-view.ios.ts +10 -0
  579. package/src/native/toast.android.ts +9 -0
  580. package/src/native/toast.ios.ts +13 -0
  581. package/src/native/toast.ts +6 -0
  582. package/src/native/visual-effects.ts +147 -0
  583. package/src/vue/components/ChoiceControl.ts +258 -0
  584. package/src/vue/components/DateCalendar.ts +117 -0
  585. package/src/vue/components/LoadingDecoration.ts +38 -0
  586. package/src/vue/components/MAccordion.ts +123 -0
  587. package/src/vue/components/MAlert.ts +156 -0
  588. package/src/vue/components/MAvatar.ts +103 -0
  589. package/src/vue/components/MBadge.ts +34 -0
  590. package/src/vue/components/MButton.ts +255 -18
  591. package/src/vue/components/MCard.ts +44 -5
  592. package/src/vue/components/MCheckbox.ts +25 -0
  593. package/src/vue/components/MChip.ts +134 -0
  594. package/src/vue/components/MCombobox.ts +257 -0
  595. package/src/vue/components/MDatePicker.ts +25 -0
  596. package/src/vue/components/MDialog.ts +312 -0
  597. package/src/vue/components/MEmptyState.ts +96 -0
  598. package/src/vue/components/MFilePicker.ts +226 -0
  599. package/src/vue/components/MGrid.ts +86 -0
  600. package/src/vue/components/MIcon.ts +53 -0
  601. package/src/vue/components/MImage.ts +181 -0
  602. package/src/vue/components/MInput.ts +143 -21
  603. package/src/vue/components/MLink.ts +99 -0
  604. package/src/vue/components/MListItem.ts +66 -0
  605. package/src/vue/components/MPopover.ts +254 -0
  606. package/src/vue/components/MProgress.ts +94 -0
  607. package/src/vue/components/MRadioGroup.ts +64 -0
  608. package/src/vue/components/MReveal.ts +89 -48
  609. package/src/vue/components/MScreen.ts +122 -6
  610. package/src/vue/components/MSegmentedControl.ts +214 -0
  611. package/src/vue/components/MSelect.ts +185 -0
  612. package/src/vue/components/MSeparator.ts +40 -0
  613. package/src/vue/components/MSheet.ts +375 -0
  614. package/src/vue/components/MSkeleton.ts +102 -0
  615. package/src/vue/components/MSlider.ts +8 -2
  616. package/src/vue/components/MStack.ts +83 -0
  617. package/src/vue/components/MSwitch.ts +200 -0
  618. package/src/vue/components/MTabs.ts +302 -0
  619. package/src/vue/components/MText.ts +48 -10
  620. package/src/vue/components/MTimePicker.ts +57 -0
  621. package/src/vue/components/MToast.ts +289 -0
  622. package/src/vue/components/MVirtualList.ts +120 -0
  623. package/src/vue/components/configurator.ts +27 -0
  624. package/src/vue/components/layout.ts +24 -9
  625. package/src/vue/components/navigation.ts +19 -0
  626. package/src/vue/components/workflows.ts +38 -0
  627. package/src/vue/index.ts +183 -22
  628. package/src/vue/layers.ts +48 -0
  629. package/src/vue/native-view.ts +6 -0
  630. package/src/vue/navigation.ts +15 -0
  631. package/src/vue/props.ts +37 -12
  632. package/src/vue/router-navigation.ts +39 -0
  633. package/src/vue/services.ts +39 -0
  634. package/src/vue/system-back.ts +12 -0
  635. package/src/vue/use-choice-paint.ts +39 -0
  636. package/src/vue/use-motion-region.ts +29 -0
  637. package/src/vue/use-motion-surface.ts +115 -0
  638. package/src/vue/use-press.ts +13 -5
  639. package/src/vue/use-scroll-motion.ts +31 -0
  640. package/dist/native/input-description.android.d.ts +0 -4
  641. package/dist/native/input-description.android.d.ts.map +0 -1
  642. package/dist/native/input-description.android.js +0 -18
  643. package/dist/native/input-description.android.js.map +0 -1
  644. package/dist/theme/resolve.d.ts +0 -3
  645. package/dist/theme/resolve.d.ts.map +0 -1
  646. package/dist/theme/resolve.js +0 -8
  647. package/dist/theme/resolve.js.map +0 -1
  648. package/dist/theme/themes.d.ts +0 -6
  649. package/dist/theme/themes.d.ts.map +0 -1
  650. package/dist/theme/themes.js +0 -83
  651. package/dist/theme/themes.js.map +0 -1
  652. package/dist/theme/types.d.ts +0 -50
  653. package/dist/theme/types.d.ts.map +0 -1
  654. package/dist/theme/types.js +0 -2
  655. package/dist/theme/types.js.map +0 -1
  656. package/dist/vue/global-components.d.ts +0 -21
  657. package/dist/vue/global-components.d.ts.map +0 -1
  658. package/dist/vue/global-components.js +0 -2
  659. package/dist/vue/global-components.js.map +0 -1
  660. package/dist/vue/layout-context.d.ts +0 -5
  661. package/dist/vue/layout-context.d.ts.map +0 -1
  662. package/dist/vue/layout-context.js +0 -7
  663. package/dist/vue/layout-context.js.map +0 -1
  664. package/dist/vue/text-content.d.ts +0 -4
  665. package/dist/vue/text-content.d.ts.map +0 -1
  666. package/dist/vue/text-content.js +0 -17
  667. package/dist/vue/text-content.js.map +0 -1
  668. package/dist/vue/theme.d.ts +0 -177
  669. package/dist/vue/theme.d.ts.map +0 -1
  670. package/dist/vue/theme.js +0 -17
  671. package/dist/vue/theme.js.map +0 -1
@@ -0,0 +1,191 @@
1
+ import { Application, ImageSource } from '@nativescript/core'
2
+ import { SDK_VERSION } from '@nativescript/core/utils/constants'
3
+ import type { FilePickerAdapter, SelectedFile } from '@getcortexlabs/mavis-core'
4
+ import { ownNativeFile } from './file-access.js'
5
+
6
+ interface Uri {
7
+ toString(): string
8
+ getLastPathSegment(): string
9
+ }
10
+ interface Stream {
11
+ close(): void
12
+ }
13
+ interface Cursor {
14
+ moveToFirst(): boolean
15
+ getColumnIndex(name: string): number
16
+ isNull(index: number): boolean
17
+ getString(index: number): string
18
+ getLong(index: number): number
19
+ close(): void
20
+ }
21
+ interface Resolver {
22
+ getType(uri: Uri): string | null
23
+ query(uri: Uri, projection: null, selection: null, args: null, order: null): Cursor | null
24
+ openInputStream(uri: Uri): Stream | null
25
+ loadThumbnail(uri: Uri, size: unknown, cancellation: null): unknown
26
+ }
27
+ interface Intent {
28
+ addCategory(value: string): Intent
29
+ setType(type: string): Intent
30
+ putExtra(name: string, value: unknown): Intent
31
+ addFlags(flags: number): Intent
32
+ getData(): Uri | null
33
+ getClipData(): { getItemCount(): number; getItemAt(index: number): { getUri(): Uri } } | null
34
+ }
35
+ declare const android: {
36
+ content: {
37
+ Intent: {
38
+ new (action: string): Intent
39
+ ACTION_OPEN_DOCUMENT: string
40
+ CATEGORY_OPENABLE: string
41
+ EXTRA_ALLOW_MULTIPLE: string
42
+ EXTRA_MIME_TYPES: string
43
+ FLAG_GRANT_READ_URI_PERMISSION: number
44
+ }
45
+ }
46
+ util: { Size: new (width: number, height: number) => unknown }
47
+ webkit: {
48
+ MimeTypeMap: { getSingleton(): { getMimeTypeFromExtension(extension: string): string | null } }
49
+ }
50
+ }
51
+
52
+ // One active system picker per adapter; unique codes prevent cross-delivery between owners.
53
+ let requestSequence = 0x4d00
54
+ export function createNativeFilePicker(): FilePickerAdapter {
55
+ return {
56
+ pick(request, cancellation) {
57
+ if (cancellation.cancelled) return Promise.resolve(null)
58
+ const app = Application.android
59
+ const activity = app.foregroundActivity ?? app.startActivity
60
+ if (!activity)
61
+ return Promise.reject(new Error('File selection requires a foreground Activity'))
62
+ const resolver = activity.getContentResolver() as Resolver
63
+ const requestCode = requestSequence++
64
+ if (requestSequence > 0x5d00) requestSequence = 0x4d00
65
+ return new Promise((resolve, reject) => {
66
+ let done = false
67
+ let unsubscribe = () => {}
68
+ function finish(files: readonly SelectedFile[] | null, error?: unknown) {
69
+ if (done) {
70
+ for (const file of files ?? []) file.release()
71
+ return
72
+ }
73
+ done = true
74
+ unsubscribe()
75
+ app.off('activityResult', result)
76
+ if (error) reject(error)
77
+ else resolve(files)
78
+ }
79
+ function result(event: { requestCode: number; resultCode: number; intent?: Intent }) {
80
+ if (event.requestCode !== requestCode) return
81
+ if (event.resultCode !== -1 || !event.intent) {
82
+ finish(null)
83
+ return
84
+ }
85
+ const files: SelectedFile[] = []
86
+ try {
87
+ const uris: Uri[] = []
88
+ const clip = event.intent.getClipData()
89
+ if (clip)
90
+ for (let index = 0; index < clip.getItemCount(); index++)
91
+ uris.push(clip.getItemAt(index).getUri())
92
+ else {
93
+ const uri = event.intent.getData()
94
+ if (uri) uris.push(uri)
95
+ }
96
+ const unique = new Set<string>()
97
+ for (const uri of uris) {
98
+ if (unique.has(uri.toString())) continue
99
+ unique.add(uri.toString())
100
+ let name = uri.getLastPathSegment()?.split('/').at(-1) || 'Document'
101
+ let size: number | undefined
102
+ const cursor = resolver.query(uri, null, null, null, null)
103
+ try {
104
+ if (cursor?.moveToFirst()) {
105
+ const nameColumn = cursor.getColumnIndex('_display_name')
106
+ const sizeColumn = cursor.getColumnIndex('_size')
107
+ if (nameColumn >= 0 && !cursor.isNull(nameColumn))
108
+ name = cursor.getString(nameColumn)
109
+ if (sizeColumn >= 0 && !cursor.isNull(sizeColumn))
110
+ size = Number(cursor.getLong(sizeColumn))
111
+ }
112
+ } finally {
113
+ cursor?.close()
114
+ }
115
+ let released = false
116
+ const owner = ownNativeFile(
117
+ 'android',
118
+ uri,
119
+ () => {
120
+ const stream = resolver.openInputStream(uri)
121
+ if (!stream) throw new Error('The document provider did not open this file')
122
+ return { native: stream, close: () => stream.close() }
123
+ },
124
+ () => {
125
+ released = true
126
+ },
127
+ )
128
+ files.push({
129
+ name,
130
+ size,
131
+ type: resolver.getType(uri) ?? undefined,
132
+ ...owner,
133
+ async preview() {
134
+ if (released || SDK_VERSION < 29) return
135
+ // The provider creates a bounded thumbnail; failures retain the file.
136
+ const bitmap = resolver.loadThumbnail(uri, new android.util.Size(160, 160), null)
137
+ if (released || !bitmap) return
138
+ return new ImageSource(bitmap)
139
+ },
140
+ })
141
+ }
142
+ finish(files)
143
+ } catch (error) {
144
+ for (const file of files) file.release()
145
+ finish(null, error)
146
+ }
147
+ }
148
+ app.on('activityResult', result)
149
+ unsubscribe = cancellation.onCancel(() => {
150
+ // finishActivity only dismisses the child Activity launched by this request.
151
+ try {
152
+ activity.finishActivity(requestCode)
153
+ } finally {
154
+ finish(null)
155
+ }
156
+ })
157
+ try {
158
+ const intent = new android.content.Intent(android.content.Intent.ACTION_OPEN_DOCUMENT)
159
+ intent.addCategory(android.content.Intent.CATEGORY_OPENABLE)
160
+ const hints = request.accept.map((hint) =>
161
+ hint.startsWith('.')
162
+ ? android.webkit.MimeTypeMap.getSingleton().getMimeTypeFromExtension(
163
+ hint.slice(1).toLowerCase(),
164
+ )
165
+ : hint,
166
+ )
167
+ const types = hints.filter((hint): hint is string => Boolean(hint))
168
+ // Unknown extensions widen the platform hint; core checks names after selection.
169
+ intent.setType(types.length === 1 && types.length === hints.length ? types[0]! : '*/*')
170
+ if (types.length > 1 && types.length === hints.length) {
171
+ // A JS array selects the Bundle overload in the NativeScript bridge.
172
+ const nativeTypes = (
173
+ Array as ArrayConstructor & {
174
+ create(type: string, length: number): string[]
175
+ }
176
+ ).create('java.lang.String', types.length)
177
+ types.forEach((type, index) => {
178
+ nativeTypes[index] = type
179
+ })
180
+ intent.putExtra(android.content.Intent.EXTRA_MIME_TYPES, nativeTypes)
181
+ }
182
+ intent.putExtra(android.content.Intent.EXTRA_ALLOW_MULTIPLE, request.multiple)
183
+ intent.addFlags(android.content.Intent.FLAG_GRANT_READ_URI_PERMISSION)
184
+ activity.startActivityForResult(intent, requestCode)
185
+ } catch (error) {
186
+ finish(null, error)
187
+ }
188
+ })
189
+ },
190
+ }
191
+ }
@@ -0,0 +1,230 @@
1
+ import { Application, ImageSource } from '@nativescript/core'
2
+ import type { FilePickerAdapter, SelectedFile } from '@getcortexlabs/mavis-core'
3
+ import { ownNativeFile } from './file-access.js'
4
+
5
+ interface URLValue {
6
+ path: string
7
+ lastPathComponent: string
8
+ pathExtension: string
9
+ }
10
+ interface ContentType {
11
+ identifier: string
12
+ preferredMIMEType?: string
13
+ }
14
+ interface Controller {
15
+ presentedViewController?: Controller
16
+ presentViewControllerAnimatedCompletion(
17
+ controller: Controller,
18
+ animated: boolean,
19
+ completion: (() => void) | null,
20
+ ): void
21
+ dismissViewControllerAnimatedCompletion(animated: boolean, completion: (() => void) | null): void
22
+ }
23
+ interface Picker extends Controller {
24
+ delegate: object | null
25
+ allowsMultipleSelection: boolean
26
+ presentationController?: { delegate: object | null }
27
+ }
28
+ interface ThumbnailRequest {}
29
+ interface ThumbnailGenerator {
30
+ generateBestRepresentationForRequestCompletionHandler(
31
+ request: ThumbnailRequest,
32
+ completion: (representation: { UIImage: unknown } | null, error: unknown) => void,
33
+ ): void
34
+ cancelRequest(request: ThumbnailRequest): void
35
+ }
36
+ declare const NSObject: { extend(members: object, options: object): { new (): object } }
37
+ declare const UIDocumentPickerDelegate: unknown
38
+ declare const UIAdaptivePresentationControllerDelegate: unknown
39
+ declare const UIDocumentPickerViewController: {
40
+ alloc(): { initForOpeningContentTypesAsCopy(types: ContentType[], asCopy: boolean): Picker }
41
+ }
42
+ declare const UTType: {
43
+ typeWithMIMEType(type: string): ContentType | null
44
+ typeWithFilenameExtension(extension: string): ContentType | null
45
+ typeWithIdentifier(identifier: string): ContentType
46
+ }
47
+ declare const NSFileManager: {
48
+ defaultManager: {
49
+ attributesOfItemAtPathError(path: string): { objectForKey(name: string): unknown }
50
+ removeItemAtURLError(url: URLValue): boolean
51
+ }
52
+ }
53
+ declare const NSInputStream: { inputStreamWithURL(url: URLValue): { open(): void; close(): void } }
54
+ declare const QLThumbnailGenerationRequest: {
55
+ alloc(): {
56
+ initWithFileAtURLSizeScaleRepresentationTypes(
57
+ url: URLValue,
58
+ size: { width: number; height: number },
59
+ scale: number,
60
+ types: number,
61
+ ): ThumbnailRequest
62
+ }
63
+ }
64
+ declare const QLThumbnailGenerator: { sharedGenerator: ThumbnailGenerator }
65
+
66
+ const families: Readonly<Record<string, string>> = {
67
+ 'image/*': 'public.image',
68
+ 'video/*': 'public.movie',
69
+ 'audio/*': 'public.audio',
70
+ 'text/*': 'public.text',
71
+ }
72
+ interface PickerCallbacks {
73
+ cancel(): void
74
+ selected(urls: { count: number; objectAtIndex(index: number): URLValue }): void
75
+ }
76
+ const delegates = new WeakMap<object, PickerCallbacks>()
77
+ let Delegate: { new (): object } | undefined
78
+ function delegateClass() {
79
+ Delegate ??= NSObject.extend(
80
+ {
81
+ documentPickerWasCancelled(this: object) {
82
+ delegates.get(this)?.cancel()
83
+ },
84
+ presentationControllerDidDismiss(this: object) {
85
+ delegates.get(this)?.cancel()
86
+ },
87
+ documentPickerDidPickDocumentsAtURLs(
88
+ this: object,
89
+ _controller: Picker,
90
+ urls: { count: number; objectAtIndex(index: number): URLValue },
91
+ ) {
92
+ delegates.get(this)?.selected(urls)
93
+ },
94
+ },
95
+ { protocols: [UIDocumentPickerDelegate, UIAdaptivePresentationControllerDelegate] },
96
+ )
97
+ return Delegate
98
+ }
99
+
100
+ export function createNativeFilePicker(): FilePickerAdapter {
101
+ return {
102
+ pick(request, cancellation) {
103
+ if (cancellation.cancelled) return Promise.resolve(null)
104
+ let presenter = Application.ios.rootController as Controller | undefined
105
+ while (presenter?.presentedViewController) presenter = presenter.presentedViewController
106
+ if (!presenter)
107
+ return Promise.reject(new Error('File selection requires a mounted iOS view controller'))
108
+ return new Promise((resolve, reject) => {
109
+ let done = false
110
+ let unsubscribe = () => {}
111
+ let picker: Picker | undefined
112
+ // UIKit delegates are weak. Keep this reference until the picker has finished.
113
+ let delegate: object | undefined
114
+ const finish = (files: readonly SelectedFile[] | null, error?: unknown) => {
115
+ if (done) {
116
+ for (const file of files ?? []) file.release()
117
+ return
118
+ }
119
+ done = true
120
+ unsubscribe()
121
+ if (picker) {
122
+ picker.delegate = null
123
+ if (picker.presentationController) picker.presentationController.delegate = null
124
+ }
125
+ if (delegate) delegates.delete(delegate)
126
+ delegate = undefined
127
+ if (error) reject(error)
128
+ else resolve(files)
129
+ }
130
+ try {
131
+ const types = request.accept.map((hint) => {
132
+ if (hint.startsWith('.')) return UTType.typeWithFilenameExtension(hint.slice(1))
133
+ if (hint.endsWith('/*'))
134
+ return families[hint] ? UTType.typeWithIdentifier(families[hint]) : null
135
+ return UTType.typeWithMIMEType(hint)
136
+ })
137
+ const effective =
138
+ !types.length || types.some((type) => !type)
139
+ ? [UTType.typeWithIdentifier('public.data')]
140
+ : (types as ContentType[])
141
+ // Import a private temporary copy: no security-scoped bookmark or broad permission.
142
+ picker = UIDocumentPickerViewController.alloc().initForOpeningContentTypesAsCopy(
143
+ effective,
144
+ true,
145
+ )
146
+ picker.allowsMultipleSelection = request.multiple
147
+ const PickerDelegate = delegateClass()
148
+ delegate = new PickerDelegate()
149
+ delegates.set(delegate, {
150
+ cancel() {
151
+ finish(null)
152
+ },
153
+ selected(urls) {
154
+ const files: SelectedFile[] = []
155
+ try {
156
+ for (let index = 0; index < urls.count; index++) {
157
+ const url = urls.objectAtIndex(index)
158
+ const attributes = NSFileManager.defaultManager.attributesOfItemAtPathError(
159
+ url.path,
160
+ )
161
+ const size = attributes?.objectForKey('NSFileSize')
162
+ let thumbnail: ThumbnailRequest | undefined
163
+ let released = false
164
+ const owner = ownNativeFile(
165
+ 'ios',
166
+ url,
167
+ () => {
168
+ const stream = NSInputStream.inputStreamWithURL(url)
169
+ stream.open()
170
+ return { native: stream, close: () => stream.close() }
171
+ },
172
+ () => {
173
+ released = true
174
+ if (thumbnail) QLThumbnailGenerator.sharedGenerator.cancelRequest(thumbnail)
175
+ // asCopy=true guarantees that this is the imported sandbox copy.
176
+ NSFileManager.defaultManager.removeItemAtURLError(url)
177
+ },
178
+ )
179
+ files.push({
180
+ name: url.lastPathComponent,
181
+ size: size == null ? undefined : Number(size),
182
+ type:
183
+ UTType.typeWithFilenameExtension(url.pathExtension)?.preferredMIMEType ||
184
+ undefined,
185
+ ...owner,
186
+ preview() {
187
+ if (released) return Promise.resolve(undefined)
188
+ return new Promise((previewResolve, previewReject) => {
189
+ thumbnail =
190
+ QLThumbnailGenerationRequest.alloc().initWithFileAtURLSizeScaleRepresentationTypes(
191
+ url,
192
+ { width: 160, height: 160 },
193
+ 1,
194
+ 4,
195
+ )
196
+ QLThumbnailGenerator.sharedGenerator.generateBestRepresentationForRequestCompletionHandler(
197
+ thumbnail,
198
+ (representation, error) => {
199
+ thumbnail = undefined
200
+ if (released) previewResolve(undefined)
201
+ else if (representation)
202
+ previewResolve(new ImageSource(representation.UIImage))
203
+ else previewReject(error ?? new Error('Preview unavailable'))
204
+ },
205
+ )
206
+ })
207
+ },
208
+ })
209
+ }
210
+ finish(files)
211
+ } catch (error) {
212
+ for (const file of files) file.release()
213
+ finish(null, error)
214
+ }
215
+ },
216
+ })
217
+ picker.delegate = delegate
218
+ if (picker.presentationController) picker.presentationController.delegate = delegate
219
+ unsubscribe = cancellation.onCancel(() => {
220
+ picker?.dismissViewControllerAnimatedCompletion(true, null)
221
+ finish(null)
222
+ })
223
+ presenter!.presentViewControllerAnimatedCompletion(picker, true, null)
224
+ } catch (error) {
225
+ finish(null, error)
226
+ }
227
+ })
228
+ },
229
+ }
230
+ }
@@ -0,0 +1,8 @@
1
+ import type { FilePickerAdapter } from '@getcortexlabs/mavis-core'
2
+
3
+ /** NativeScript resolves this module to the .ios/.android implementation at bundle time. */
4
+ export function createNativeFilePicker(): FilePickerAdapter {
5
+ return {
6
+ pick: () => Promise.reject(new Error('File picking requires the iOS or Android runtime')),
7
+ }
8
+ }
@@ -0,0 +1,12 @@
1
+ import type { FlexboxLayout, View } from '@nativescript/core'
2
+ import { flexShrinkProperty } from '@nativescript/core/ui/layouts/flexbox-layout'
3
+
4
+ const source = flexShrinkProperty.sourceKey
5
+
6
+ /** Children without their own shrink keep their natural height in a column, like Mavis children. */
7
+ export function applyColumnShrink(layout: FlexboxLayout, child: View) {
8
+ if (!layout.flexDirection.startsWith('column')) return
9
+ // Core records the value source even when a local value equals the default, unlike isSet.
10
+ const declared = (child.style as unknown as Record<symbol, number | undefined>)[source]
11
+ if (!declared) child.style.flexShrink = 0
12
+ }
@@ -1,4 +1,5 @@
1
- import { FlexboxLayout } from '@nativescript/core'
1
+ import { FlexboxLayout, type View } from '@nativescript/core'
2
+ import { applyColumnShrink } from './flex-children'
2
3
 
3
4
  declare const com: {
4
5
  mavis: { ui: { FlexLayout: new (context: unknown) => object } }
@@ -8,4 +9,14 @@ export class MavisFlexLayout extends FlexboxLayout {
8
9
  createNativeView() {
9
10
  return new com.mavis.ui.FlexLayout(this._context)
10
11
  }
12
+
13
+ _registerLayoutChild(child: View) {
14
+ super._registerLayoutChild(child)
15
+ applyColumnShrink(this, child)
16
+ }
17
+
18
+ onLoaded() {
19
+ super.onLoaded()
20
+ this.eachLayoutChild((child) => applyColumnShrink(this, child))
21
+ }
11
22
  }
@@ -1,18 +1,148 @@
1
1
  import { FlexboxLayout, Utils, type View } from '@nativescript/core'
2
+ import { applyColumnShrink } from './flex-children'
3
+ import {
4
+ layoutChildren,
5
+ recordMeasurement,
6
+ reuseMeasurement,
7
+ type MeasureRecord,
8
+ } from './measure-memo'
2
9
 
3
10
  // Core 9.1.3 computes row heights before growing children. This adapter runs after width
4
11
  // allocation and before cross-axis alignment; no global prototype or consumer styles change.
5
12
  interface FlexMeasurement {
13
+ _checkSizeConstraints(child: View): void
14
+ _stretchViewHorizontally(child: View, crossSize: number): void
15
+ _currentWidthMeasureSpec: number
16
+ _currentHeightMeasureSpec: number
6
17
  _determineMainSize(direction: string, widthSpec: number, heightSpec: number): void
7
- _flexLines: { _itemCount: number; _crossSize: number; _mainSize: number }[]
18
+ _flexLines: {
19
+ _itemCount: number
20
+ _crossSize: number
21
+ _mainSize: number
22
+ _gapLengthInMainSize: number
23
+ }[]
8
24
  _getReorderedChildAt(index: number): View
25
+ _getLargestMainSize(): number
26
+ _getSumOfCrossSize(): number
27
+ effectiveRowGap: number
9
28
  }
10
29
 
11
30
  const { layout } = Utils
12
31
  const base = FlexboxLayout.prototype as unknown as FlexMeasurement
13
32
 
14
33
  export class MavisFlexLayout extends FlexboxLayout {
34
+ measureRecord?: MeasureRecord
35
+
36
+ // Core's iOS Flexbox omits borders from its content insets. Keep the adjustment local
37
+ // to measurement/layout and leave the declared padding and derived values intact afterwards.
38
+ private withBorderPadding(run: () => void) {
39
+ const left = this.effectivePaddingLeft
40
+ const right = this.effectivePaddingRight
41
+ const top = this.effectivePaddingTop
42
+ const bottom = this.effectivePaddingBottom
43
+ this.effectivePaddingLeft += this.effectiveBorderLeftWidth
44
+ this.effectivePaddingRight += this.effectiveBorderRightWidth
45
+ this.effectivePaddingTop += this.effectiveBorderTopWidth
46
+ this.effectivePaddingBottom += this.effectiveBorderBottomWidth
47
+ try {
48
+ run()
49
+ } finally {
50
+ this.effectivePaddingLeft = left
51
+ this.effectivePaddingRight = right
52
+ this.effectivePaddingTop = top
53
+ this.effectivePaddingBottom = bottom
54
+ }
55
+ }
56
+
57
+ onMeasure(widthSpec: number, heightSpec: number) {
58
+ this.withBorderPadding(() => super.onMeasure(widthSpec, heightSpec))
59
+ }
60
+
61
+ onLayout(left: number, top: number, right: number, bottom: number) {
62
+ this.withBorderPadding(() => super.onLayout(left, top, right, bottom))
63
+ }
64
+
65
+ _checkSizeConstraints(child: View) {
66
+ const measurement = this as unknown as FlexMeasurement
67
+ const width = child.width
68
+ const spec = measurement._currentWidthMeasureSpec
69
+ if (
70
+ typeof width === 'object' &&
71
+ width.unit === '%' &&
72
+ layout.getMeasureSpecMode(spec) !== layout.UNSPECIFIED
73
+ ) {
74
+ // Core initially resolves percentages against the outer request. Correct the derived
75
+ // size before it forms flex lines, so wrapping/growth/shrink use the content-box basis.
76
+ child.effectiveWidth =
77
+ Math.max(
78
+ 0,
79
+ layout.getMeasureSpecSize(spec) - this.effectivePaddingLeft - this.effectivePaddingRight,
80
+ ) * width.value
81
+ this.measureAtWidth(child, child.effectiveWidth, measurement._currentHeightMeasureSpec)
82
+ }
83
+ base._checkSizeConstraints.call(this, child)
84
+ }
85
+
86
+ _stretchViewHorizontally(child: View, crossSize: number) {
87
+ // A declared width wins over alignItems=stretch, as it does in CSS flex layout.
88
+ if (child.effectiveWidth < 0) base._stretchViewHorizontally.call(this, child, crossSize)
89
+ }
90
+
91
+ measure(widthSpec: number, heightSpec: number) {
92
+ if (reuseMeasurement(this, widthSpec, heightSpec)) return
93
+ super.measure(widthSpec, heightSpec)
94
+ recordMeasurement(
95
+ this,
96
+ widthSpec,
97
+ heightSpec,
98
+ layoutChildren(this),
99
+ this.contentExceeds(widthSpec, heightSpec),
100
+ )
101
+ }
102
+
103
+ // Core measures a looser request without shrinking, so its lines tell whether the content
104
+ // wanted more room than the request allowed.
105
+ private contentExceeds(widthSpec: number, heightSpec: number) {
106
+ const measurement = this as unknown as FlexMeasurement
107
+ const column = this.flexDirection.startsWith('column')
108
+ const main = measurement._getLargestMainSize()
109
+ const cross = measurement._getSumOfCrossSize()
110
+ const maxHeight = column
111
+ ? main
112
+ : cross +
113
+ this.effectivePaddingTop +
114
+ this.effectivePaddingBottom +
115
+ this.effectiveBorderTopWidth +
116
+ this.effectiveBorderBottomWidth
117
+ const maxWidth = column
118
+ ? cross +
119
+ this.effectivePaddingLeft +
120
+ this.effectivePaddingRight +
121
+ this.effectiveBorderLeftWidth +
122
+ this.effectiveBorderRightWidth
123
+ : main
124
+ const exceeds = (spec: number, size: number) =>
125
+ layout.getMeasureSpecMode(spec) === layout.AT_MOST && layout.getMeasureSpecSize(spec) < size
126
+ return exceeds(heightSpec, maxHeight) || exceeds(widthSpec, maxWidth)
127
+ }
128
+
129
+ requestLayout() {
130
+ this.measureRecord = undefined
131
+ super.requestLayout()
132
+ }
133
+
134
+ _registerLayoutChild(child: View) {
135
+ super._registerLayoutChild(child)
136
+ applyColumnShrink(this, child)
137
+ }
138
+
139
+ onLoaded() {
140
+ super.onLoaded()
141
+ this.eachLayoutChild((child) => applyColumnShrink(this, child))
142
+ }
143
+
15
144
  _determineMainSize(direction: string, widthSpec: number, heightSpec: number) {
145
+ if (direction === 'column' || direction === 'column-reverse') this.keepRowGaps()
16
146
  if (direction === 'column' && this.alignItems === 'stretch' && this.flexWrap === 'nowrap') {
17
147
  const measurement = this as unknown as FlexMeasurement
18
148
  const width =
@@ -24,6 +154,7 @@ export class MavisFlexLayout extends FlexboxLayout {
24
154
  for (let i = 0; i < line._itemCount; i++, index++) {
25
155
  const child = measurement._getReorderedChildAt(index)
26
156
  if (!child || child.isCollapsed) continue
157
+ if (child.effectiveWidth >= 0) continue
27
158
  const alignSelf = FlexboxLayout.getAlignSelf(child)
28
159
  if (alignSelf !== 'auto' && alignSelf !== 'stretch') continue
29
160
  const oldHeight = child.getMeasuredHeight()
@@ -56,6 +187,22 @@ export class MavisFlexLayout extends FlexboxLayout {
56
187
  }
57
188
  }
58
189
 
190
+ // Core 9.1.3 adds row gaps to a column's main size but not to its gap total, so the growth and
191
+ // shrink passes measured the column shorter by every gap and squeezed shrinking children.
192
+ private keepRowGaps() {
193
+ const measurement = this as unknown as FlexMeasurement
194
+ if (!(measurement.effectiveRowGap > 0)) return
195
+ let index = 0
196
+ for (const line of measurement._flexLines) {
197
+ let visible = 0
198
+ for (let i = 0; i < line._itemCount; i++, index++) {
199
+ const child = measurement._getReorderedChildAt(index)
200
+ if (child && !child.isCollapsed) visible++
201
+ }
202
+ line._gapLengthInMainSize = measurement.effectiveRowGap * Math.max(0, visible - 1)
203
+ }
204
+ }
205
+
59
206
  private measureAtWidth(child: View, width: number, heightSpec: number) {
60
207
  const available = Math.max(
61
208
  0,