@getcortexlabs/mavis 0.1.0-alpha.1 → 0.1.0-alpha.11
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.
- package/README.md +9 -5
- package/dist/app-icons.d.ts +26 -0
- package/dist/app-icons.d.ts.map +1 -0
- package/dist/app-icons.js +9 -0
- package/dist/app-icons.js.map +1 -0
- package/dist/date-format.d.ts +3 -0
- package/dist/date-format.d.ts.map +1 -0
- package/dist/date-format.js +2 -0
- package/dist/date-format.js.map +1 -0
- package/dist/files.d.ts +4 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +3 -0
- package/dist/files.js.map +1 -0
- package/dist/native/app-icons.android.d.ts +4 -0
- package/dist/native/app-icons.android.d.ts.map +1 -0
- package/dist/native/app-icons.android.js +67 -0
- package/dist/native/app-icons.android.js.map +1 -0
- package/dist/native/app-icons.d.ts +4 -0
- package/dist/native/app-icons.d.ts.map +1 -0
- package/dist/native/app-icons.ios.d.ts +4 -0
- package/dist/native/app-icons.ios.d.ts.map +1 -0
- package/dist/native/app-icons.ios.js +45 -0
- package/dist/native/app-icons.ios.js.map +1 -0
- package/dist/native/app-icons.js +9 -0
- package/dist/native/app-icons.js.map +1 -0
- package/dist/native/appearance.android.d.ts +4 -0
- package/dist/native/appearance.android.d.ts.map +1 -0
- package/dist/native/appearance.android.js +55 -0
- package/dist/native/appearance.android.js.map +1 -0
- package/dist/native/appearance.d.ts +4 -0
- package/dist/native/appearance.d.ts.map +1 -0
- package/dist/native/appearance.js +31 -0
- package/dist/native/appearance.js.map +1 -0
- package/dist/native/avatar-image.d.ts +4 -0
- package/dist/native/avatar-image.d.ts.map +1 -0
- package/dist/native/avatar-image.js +12 -0
- package/dist/native/avatar-image.js.map +1 -0
- package/dist/native/avatar-label.android.d.ts +9 -0
- package/dist/native/avatar-label.android.d.ts.map +1 -0
- package/dist/native/avatar-label.android.js +9 -0
- package/dist/native/avatar-label.android.js.map +1 -0
- package/dist/native/avatar-label.d.ts +2 -0
- package/dist/native/avatar-label.d.ts.map +1 -0
- package/dist/native/avatar-label.js +2 -0
- package/dist/native/avatar-label.js.map +1 -0
- package/dist/native/box.android.d.ts +5 -0
- package/dist/native/box.android.d.ts.map +1 -0
- package/dist/native/box.android.js +7 -0
- package/dist/native/box.android.js.map +1 -0
- package/dist/native/box.d.ts +2 -0
- package/dist/native/box.d.ts.map +1 -0
- package/dist/native/box.ios.d.ts +10 -0
- package/dist/native/box.ios.d.ts.map +1 -0
- package/dist/native/box.ios.js +40 -0
- package/dist/native/box.ios.js.map +1 -0
- package/dist/native/box.js +3 -0
- package/dist/native/box.js.map +1 -0
- package/dist/native/button.android.d.ts +11 -0
- package/dist/native/button.android.d.ts.map +1 -0
- package/dist/native/button.android.js +31 -0
- package/dist/native/button.android.js.map +1 -0
- package/dist/native/button.ios.d.ts +13 -1
- package/dist/native/button.ios.d.ts.map +1 -1
- package/dist/native/button.ios.js +29 -1
- package/dist/native/button.ios.js.map +1 -1
- package/dist/native/checkbox.android.d.ts +7 -0
- package/dist/native/checkbox.android.d.ts.map +1 -0
- package/dist/native/checkbox.android.js +26 -0
- package/dist/native/checkbox.android.js.map +1 -0
- package/dist/native/checkbox.d.ts +7 -0
- package/dist/native/checkbox.d.ts.map +1 -0
- package/dist/native/checkbox.js +7 -0
- package/dist/native/checkbox.js.map +1 -0
- package/dist/native/collection-motion.d.ts +5 -0
- package/dist/native/collection-motion.d.ts.map +1 -0
- package/dist/native/collection-motion.js +157 -0
- package/dist/native/collection-motion.js.map +1 -0
- package/dist/native/combobox-editor.android.d.ts +3 -0
- package/dist/native/combobox-editor.android.d.ts.map +1 -0
- package/dist/native/combobox-editor.android.js +5 -0
- package/dist/native/combobox-editor.android.js.map +1 -0
- package/dist/native/combobox-editor.d.ts +4 -0
- package/dist/native/combobox-editor.d.ts.map +1 -0
- package/dist/native/combobox-editor.js +5 -0
- package/dist/native/combobox-editor.js.map +1 -0
- package/dist/native/composed-button.android.d.ts +4 -0
- package/dist/native/composed-button.android.d.ts.map +1 -0
- package/dist/native/composed-button.android.js +53 -0
- package/dist/native/composed-button.android.js.map +1 -0
- package/dist/native/composed-button.d.ts +3 -0
- package/dist/native/composed-button.d.ts.map +1 -0
- package/dist/native/composed-button.js +4 -0
- package/dist/native/composed-button.js.map +1 -0
- package/dist/native/date-format.android.d.ts +5 -0
- package/dist/native/date-format.android.d.ts.map +1 -0
- package/dist/native/date-format.android.js +39 -0
- package/dist/native/date-format.android.js.map +1 -0
- package/dist/native/date-format.d.ts +6 -0
- package/dist/native/date-format.d.ts.map +1 -0
- package/dist/native/date-format.ios.d.ts +5 -0
- package/dist/native/date-format.ios.d.ts.map +1 -0
- package/dist/native/date-format.ios.js +29 -0
- package/dist/native/date-format.ios.js.map +1 -0
- package/dist/native/date-format.js +8 -0
- package/dist/native/date-format.js.map +1 -0
- package/dist/native/dialog.android.d.ts +12 -0
- package/dist/native/dialog.android.d.ts.map +1 -0
- package/dist/native/dialog.android.js +46 -0
- package/dist/native/dialog.android.js.map +1 -0
- package/dist/native/dialog.d.ts +12 -0
- package/dist/native/dialog.d.ts.map +1 -0
- package/dist/native/dialog.ios.d.ts +12 -0
- package/dist/native/dialog.ios.d.ts.map +1 -0
- package/dist/native/dialog.ios.js +13 -0
- package/dist/native/dialog.ios.js.map +1 -0
- package/dist/native/dialog.js +4 -0
- package/dist/native/dialog.js.map +1 -0
- package/dist/native/dynamic-type.d.ts +15 -0
- package/dist/native/dynamic-type.d.ts.map +1 -0
- package/dist/native/dynamic-type.js +47 -0
- package/dist/native/dynamic-type.js.map +1 -0
- package/dist/native/file-access.d.ts +23 -0
- package/dist/native/file-access.d.ts.map +1 -0
- package/dist/native/file-access.js +55 -0
- package/dist/native/file-access.js.map +1 -0
- package/dist/native/file-picker.android.d.ts +3 -0
- package/dist/native/file-picker.android.d.ts.map +1 -0
- package/dist/native/file-picker.android.js +147 -0
- package/dist/native/file-picker.android.js.map +1 -0
- package/dist/native/file-picker.d.ts +4 -0
- package/dist/native/file-picker.d.ts.map +1 -0
- package/dist/native/file-picker.ios.d.ts +3 -0
- package/dist/native/file-picker.ios.d.ts.map +1 -0
- package/dist/native/file-picker.ios.js +152 -0
- package/dist/native/file-picker.ios.js.map +1 -0
- package/dist/native/file-picker.js +7 -0
- package/dist/native/file-picker.js.map +1 -0
- package/dist/native/flex-children.d.ts +4 -0
- package/dist/native/flex-children.d.ts.map +1 -0
- package/dist/native/flex-children.js +12 -0
- package/dist/native/flex-children.js.map +1 -0
- package/dist/native/flex-layout.android.d.ts +3 -1
- package/dist/native/flex-layout.android.d.ts.map +1 -1
- package/dist/native/flex-layout.android.js +9 -0
- package/dist/native/flex-layout.android.js.map +1 -1
- package/dist/native/flex-layout.ios.d.ts +14 -1
- package/dist/native/flex-layout.ios.d.ts.map +1 -1
- package/dist/native/flex-layout.ios.js +113 -0
- package/dist/native/flex-layout.ios.js.map +1 -1
- package/dist/native/image-effects.d.ts +11 -0
- package/dist/native/image-effects.d.ts.map +1 -0
- package/dist/native/image-effects.js +61 -0
- package/dist/native/image-effects.js.map +1 -0
- package/dist/native/input-action.d.ts +5 -0
- package/dist/native/input-action.d.ts.map +1 -0
- package/dist/native/input-action.js +13 -0
- package/dist/native/input-action.js.map +1 -0
- package/dist/native/keyboard-dismiss.android.d.ts +8 -0
- package/dist/native/keyboard-dismiss.android.d.ts.map +1 -0
- package/dist/native/keyboard-dismiss.android.js +9 -0
- package/dist/native/keyboard-dismiss.android.js.map +1 -0
- package/dist/native/keyboard-dismiss.d.ts +10 -0
- package/dist/native/keyboard-dismiss.d.ts.map +1 -0
- package/dist/native/keyboard-dismiss.ios.d.ts +8 -0
- package/dist/native/keyboard-dismiss.ios.d.ts.map +1 -0
- package/dist/native/keyboard-dismiss.ios.js +91 -0
- package/dist/native/keyboard-dismiss.ios.js.map +1 -0
- package/dist/native/keyboard-dismiss.js +6 -0
- package/dist/native/keyboard-dismiss.js.map +1 -0
- package/dist/native/label.android.d.ts +12 -0
- package/dist/native/label.android.d.ts.map +1 -0
- package/dist/native/label.android.js +19 -0
- package/dist/native/label.android.js.map +1 -0
- package/dist/native/label.ios.d.ts +14 -1
- package/dist/native/label.ios.d.ts.map +1 -1
- package/dist/native/label.ios.js +37 -1
- package/dist/native/label.ios.js.map +1 -1
- package/dist/native/measure-memo.d.ts +37 -0
- package/dist/native/measure-memo.d.ts.map +1 -0
- package/dist/native/measure-memo.js +82 -0
- package/dist/native/measure-memo.js.map +1 -0
- package/dist/native/motion-owner.d.ts +5 -0
- package/dist/native/motion-owner.d.ts.map +1 -0
- package/dist/native/motion-owner.js +58 -0
- package/dist/native/motion-owner.js.map +1 -0
- package/dist/native/motion-region.d.ts +7 -0
- package/dist/native/motion-region.d.ts.map +1 -0
- package/dist/native/motion-region.js +249 -0
- package/dist/native/motion-region.js.map +1 -0
- package/dist/native/motion-surface.d.ts +9 -0
- package/dist/native/motion-surface.d.ts.map +1 -0
- package/dist/native/motion-surface.js +229 -0
- package/dist/native/motion-surface.js.map +1 -0
- package/dist/native/platform-motion.d.ts +5 -0
- package/dist/native/platform-motion.d.ts.map +1 -0
- package/dist/native/platform-motion.js +90 -0
- package/dist/native/platform-motion.js.map +1 -0
- package/dist/native/press.d.ts +8 -2
- package/dist/native/press.d.ts.map +1 -1
- package/dist/native/press.js +58 -8
- package/dist/native/press.js.map +1 -1
- package/dist/native/progress.d.ts +7 -0
- package/dist/native/progress.d.ts.map +1 -0
- package/dist/native/progress.js +77 -0
- package/dist/native/progress.js.map +1 -0
- package/dist/native/screen.android.d.ts +6 -0
- package/dist/native/screen.android.d.ts.map +1 -0
- package/dist/native/screen.android.js +8 -0
- package/dist/native/screen.android.js.map +1 -0
- package/dist/native/screen.d.ts +2 -0
- package/dist/native/screen.d.ts.map +1 -0
- package/dist/native/screen.js +3 -0
- package/dist/native/screen.js.map +1 -0
- package/dist/native/scroll-motion.d.ts +12 -0
- package/dist/native/scroll-motion.d.ts.map +1 -0
- package/dist/native/scroll-motion.js +100 -0
- package/dist/native/scroll-motion.js.map +1 -0
- package/dist/native/section-scroll.d.ts +9 -0
- package/dist/native/section-scroll.d.ts.map +1 -0
- package/dist/native/section-scroll.js +69 -0
- package/dist/native/section-scroll.js.map +1 -0
- package/dist/native/segmented.d.ts +14 -0
- package/dist/native/segmented.d.ts.map +1 -0
- package/dist/native/segmented.js +86 -0
- package/dist/native/segmented.js.map +1 -0
- package/dist/native/sheet.android.d.ts +18 -0
- package/dist/native/sheet.android.d.ts.map +1 -0
- package/dist/native/sheet.android.js +16 -0
- package/dist/native/sheet.android.js.map +1 -0
- package/dist/native/sheet.d.ts +21 -0
- package/dist/native/sheet.d.ts.map +1 -0
- package/dist/native/sheet.ios.d.ts +19 -0
- package/dist/native/sheet.ios.d.ts.map +1 -0
- package/dist/native/sheet.ios.js +41 -0
- package/dist/native/sheet.ios.js.map +1 -0
- package/dist/native/sheet.js +17 -0
- package/dist/native/sheet.js.map +1 -0
- package/dist/native/surface-effects.d.ts +4 -0
- package/dist/native/surface-effects.d.ts.map +1 -0
- package/dist/native/surface-effects.js +31 -0
- package/dist/native/surface-effects.js.map +1 -0
- package/dist/native/tabs.android.d.ts +3 -0
- package/dist/native/tabs.android.d.ts.map +1 -0
- package/dist/native/tabs.android.js +29 -0
- package/dist/native/tabs.android.js.map +1 -0
- package/dist/native/tabs.d.ts +3 -0
- package/dist/native/tabs.d.ts.map +1 -0
- package/dist/native/tabs.js +4 -0
- package/dist/native/tabs.js.map +1 -0
- package/dist/native/text-field.android.d.ts +1 -0
- package/dist/native/text-field.android.d.ts.map +1 -1
- package/dist/native/text-field.android.js +13 -0
- package/dist/native/text-field.android.js.map +1 -1
- package/dist/native/text-field.ios.d.ts +9 -0
- package/dist/native/text-field.ios.d.ts.map +1 -0
- package/dist/native/text-field.ios.js +52 -0
- package/dist/native/text-field.ios.js.map +1 -0
- package/dist/native/text-view.ios.d.ts +7 -0
- package/dist/native/text-view.ios.d.ts.map +1 -0
- package/dist/native/text-view.ios.js +10 -0
- package/dist/native/text-view.ios.js.map +1 -0
- package/dist/native/toast.android.d.ts +4 -0
- package/dist/native/toast.android.d.ts.map +1 -0
- package/dist/native/toast.android.js +10 -0
- package/dist/native/toast.android.js.map +1 -0
- package/dist/native/toast.d.ts +4 -0
- package/dist/native/toast.d.ts.map +1 -0
- package/dist/native/toast.ios.d.ts +4 -0
- package/dist/native/toast.ios.d.ts.map +1 -0
- package/dist/native/toast.ios.js +8 -0
- package/dist/native/toast.ios.js.map +1 -0
- package/dist/native/toast.js +5 -0
- package/dist/native/toast.js.map +1 -0
- package/dist/native/visual-effects.d.ts +5 -0
- package/dist/native/visual-effects.d.ts.map +1 -0
- package/dist/native/visual-effects.js +126 -0
- package/dist/native/visual-effects.js.map +1 -0
- package/dist/vue/components/ChartPlot.d.ts +65 -0
- package/dist/vue/components/ChartPlot.d.ts.map +1 -0
- package/dist/vue/components/ChartPlot.js +100 -0
- package/dist/vue/components/ChartPlot.js.map +1 -0
- package/dist/vue/components/ChoiceControl.d.ts +114 -0
- package/dist/vue/components/ChoiceControl.d.ts.map +1 -0
- package/dist/vue/components/ChoiceControl.js +218 -0
- package/dist/vue/components/ChoiceControl.js.map +1 -0
- package/dist/vue/components/DateCalendar.d.ts +109 -0
- package/dist/vue/components/DateCalendar.d.ts.map +1 -0
- package/dist/vue/components/DateCalendar.js +98 -0
- package/dist/vue/components/DateCalendar.js.map +1 -0
- package/dist/vue/components/LoadingDecoration.d.ts +116 -0
- package/dist/vue/components/LoadingDecoration.d.ts.map +1 -0
- package/dist/vue/components/LoadingDecoration.js +34 -0
- package/dist/vue/components/LoadingDecoration.js.map +1 -0
- package/dist/vue/components/MAccordion.d.ts +119 -0
- package/dist/vue/components/MAccordion.d.ts.map +1 -0
- package/dist/vue/components/MAccordion.js +83 -0
- package/dist/vue/components/MAccordion.js.map +1 -0
- package/dist/vue/components/MAlert.d.ts +109 -0
- package/dist/vue/components/MAlert.d.ts.map +1 -0
- package/dist/vue/components/MAlert.js +126 -0
- package/dist/vue/components/MAlert.js.map +1 -0
- package/dist/vue/components/MAvatar.d.ts +80 -0
- package/dist/vue/components/MAvatar.d.ts.map +1 -0
- package/dist/vue/components/MAvatar.js +86 -0
- package/dist/vue/components/MAvatar.js.map +1 -0
- package/dist/vue/components/MBadge.d.ts +70 -0
- package/dist/vue/components/MBadge.d.ts.map +1 -0
- package/dist/vue/components/MBadge.js +30 -0
- package/dist/vue/components/MBadge.js.map +1 -0
- package/dist/vue/components/MButton.d.ts +212 -32
- package/dist/vue/components/MButton.d.ts.map +1 -1
- package/dist/vue/components/MButton.js +192 -20
- package/dist/vue/components/MButton.js.map +1 -1
- package/dist/vue/components/MCard.d.ts +113 -21
- package/dist/vue/components/MCard.d.ts.map +1 -1
- package/dist/vue/components/MCard.js +24 -6
- package/dist/vue/components/MCard.js.map +1 -1
- package/dist/vue/components/MCheckbox.d.ts +103 -0
- package/dist/vue/components/MCheckbox.d.ts.map +1 -0
- package/dist/vue/components/MCheckbox.js +26 -0
- package/dist/vue/components/MCheckbox.js.map +1 -0
- package/dist/vue/components/MChip.d.ts +117 -0
- package/dist/vue/components/MChip.d.ts.map +1 -0
- package/dist/vue/components/MChip.js +120 -0
- package/dist/vue/components/MChip.js.map +1 -0
- package/dist/vue/components/MCombobox.d.ts +279 -0
- package/dist/vue/components/MCombobox.d.ts.map +1 -0
- package/dist/vue/components/MCombobox.js +234 -0
- package/dist/vue/components/MCombobox.js.map +1 -0
- package/dist/vue/components/MDatePicker.d.ts +1350 -0
- package/dist/vue/components/MDatePicker.d.ts.map +1 -0
- package/dist/vue/components/MDatePicker.js +25 -0
- package/dist/vue/components/MDatePicker.js.map +1 -0
- package/dist/vue/components/MDialog.d.ts +100 -0
- package/dist/vue/components/MDialog.d.ts.map +1 -0
- package/dist/vue/components/MDialog.js +245 -0
- package/dist/vue/components/MDialog.js.map +1 -0
- package/dist/vue/components/MEmptyState.d.ts +117 -0
- package/dist/vue/components/MEmptyState.d.ts.map +1 -0
- package/dist/vue/components/MEmptyState.js +79 -0
- package/dist/vue/components/MEmptyState.js.map +1 -0
- package/dist/vue/components/MFilePicker.d.ts +112 -0
- package/dist/vue/components/MFilePicker.d.ts.map +1 -0
- package/dist/vue/components/MFilePicker.js +196 -0
- package/dist/vue/components/MFilePicker.js.map +1 -0
- package/dist/vue/components/MGrid.d.ts +165 -0
- package/dist/vue/components/MGrid.d.ts.map +1 -0
- package/dist/vue/components/MGrid.js +52 -0
- package/dist/vue/components/MGrid.js.map +1 -0
- package/dist/vue/components/MIcon.d.ts +75 -0
- package/dist/vue/components/MIcon.d.ts.map +1 -0
- package/dist/vue/components/MIcon.js +45 -0
- package/dist/vue/components/MIcon.js.map +1 -0
- package/dist/vue/components/MImage.d.ts +248 -0
- package/dist/vue/components/MImage.d.ts.map +1 -0
- package/dist/vue/components/MImage.js +157 -0
- package/dist/vue/components/MImage.js.map +1 -0
- package/dist/vue/components/MInput.d.ts +195 -50
- package/dist/vue/components/MInput.d.ts.map +1 -1
- package/dist/vue/components/MInput.js +134 -20
- package/dist/vue/components/MInput.js.map +1 -1
- package/dist/vue/components/MLink.d.ts +120 -0
- package/dist/vue/components/MLink.d.ts.map +1 -0
- package/dist/vue/components/MLink.js +76 -0
- package/dist/vue/components/MLink.js.map +1 -0
- package/dist/vue/components/MListItem.d.ts +106 -0
- package/dist/vue/components/MListItem.d.ts.map +1 -0
- package/dist/vue/components/MListItem.js +53 -0
- package/dist/vue/components/MListItem.js.map +1 -0
- package/dist/vue/components/MPopover.d.ts +106 -0
- package/dist/vue/components/MPopover.d.ts.map +1 -0
- package/dist/vue/components/MPopover.js +209 -0
- package/dist/vue/components/MPopover.js.map +1 -0
- package/dist/vue/components/MProgress.d.ts +122 -0
- package/dist/vue/components/MProgress.d.ts.map +1 -0
- package/dist/vue/components/MProgress.js +75 -0
- package/dist/vue/components/MProgress.js.map +1 -0
- package/dist/vue/components/MRadioGroup.d.ts +103 -0
- package/dist/vue/components/MRadioGroup.d.ts.map +1 -0
- package/dist/vue/components/MRadioGroup.js +57 -0
- package/dist/vue/components/MRadioGroup.js.map +1 -0
- package/dist/vue/components/MRangeSlider.d.ts +105 -0
- package/dist/vue/components/MRangeSlider.d.ts.map +1 -0
- package/dist/vue/components/MRangeSlider.js +107 -0
- package/dist/vue/components/MRangeSlider.js.map +1 -0
- package/dist/vue/components/MReveal.d.ts +73 -37
- package/dist/vue/components/MReveal.d.ts.map +1 -1
- package/dist/vue/components/MReveal.js +80 -37
- package/dist/vue/components/MReveal.js.map +1 -1
- package/dist/vue/components/MScreen.d.ts +42 -8
- package/dist/vue/components/MScreen.d.ts.map +1 -1
- package/dist/vue/components/MScreen.js +91 -6
- package/dist/vue/components/MScreen.js.map +1 -1
- package/dist/vue/components/MSegmentedControl.d.ts +95 -0
- package/dist/vue/components/MSegmentedControl.d.ts.map +1 -0
- package/dist/vue/components/MSegmentedControl.js +172 -0
- package/dist/vue/components/MSegmentedControl.js.map +1 -0
- package/dist/vue/components/MSelect.d.ts +140 -0
- package/dist/vue/components/MSelect.d.ts.map +1 -0
- package/dist/vue/components/MSelect.js +158 -0
- package/dist/vue/components/MSelect.js.map +1 -0
- package/dist/vue/components/MSeparator.d.ts +56 -0
- package/dist/vue/components/MSeparator.d.ts.map +1 -0
- package/dist/vue/components/MSeparator.js +36 -0
- package/dist/vue/components/MSeparator.js.map +1 -0
- package/dist/vue/components/MSheet.d.ts +116 -0
- package/dist/vue/components/MSheet.d.ts.map +1 -0
- package/dist/vue/components/MSheet.js +313 -0
- package/dist/vue/components/MSheet.js.map +1 -0
- package/dist/vue/components/MSkeleton.d.ts +89 -0
- package/dist/vue/components/MSkeleton.d.ts.map +1 -0
- package/dist/vue/components/MSkeleton.js +89 -0
- package/dist/vue/components/MSkeleton.js.map +1 -0
- package/dist/vue/components/MSlider.d.ts +8 -4
- package/dist/vue/components/MSlider.d.ts.map +1 -1
- package/dist/vue/components/MSlider.js +3 -2
- package/dist/vue/components/MSlider.js.map +1 -1
- package/dist/vue/components/MStack.d.ts +199 -0
- package/dist/vue/components/MStack.d.ts.map +1 -0
- package/dist/vue/components/MStack.js +62 -0
- package/dist/vue/components/MStack.js.map +1 -0
- package/dist/vue/components/MSwitch.d.ts +89 -0
- package/dist/vue/components/MSwitch.d.ts.map +1 -0
- package/dist/vue/components/MSwitch.js +173 -0
- package/dist/vue/components/MSwitch.js.map +1 -0
- package/dist/vue/components/MTabs.d.ts +101 -0
- package/dist/vue/components/MTabs.d.ts.map +1 -0
- package/dist/vue/components/MTabs.js +245 -0
- package/dist/vue/components/MTabs.js.map +1 -0
- package/dist/vue/components/MText.d.ts +61 -25
- package/dist/vue/components/MText.d.ts.map +1 -1
- package/dist/vue/components/MText.js +47 -19
- package/dist/vue/components/MText.js.map +1 -1
- package/dist/vue/components/MTimePicker.d.ts +655 -0
- package/dist/vue/components/MTimePicker.d.ts.map +1 -0
- package/dist/vue/components/MTimePicker.js +50 -0
- package/dist/vue/components/MTimePicker.js.map +1 -0
- package/dist/vue/components/MToast.d.ts +23 -0
- package/dist/vue/components/MToast.d.ts.map +1 -0
- package/dist/vue/components/MToast.js +242 -0
- package/dist/vue/components/MToast.js.map +1 -0
- package/dist/vue/components/MTooltip.d.ts +65 -0
- package/dist/vue/components/MTooltip.d.ts.map +1 -0
- package/dist/vue/components/MTooltip.js +35 -0
- package/dist/vue/components/MTooltip.js.map +1 -0
- package/dist/vue/components/MVirtualList.d.ts +3 -0
- package/dist/vue/components/MVirtualList.d.ts.map +1 -0
- package/dist/vue/components/MVirtualList.js +88 -0
- package/dist/vue/components/MVirtualList.js.map +1 -0
- package/dist/vue/components/configurator.d.ts +541 -0
- package/dist/vue/components/configurator.d.ts.map +1 -0
- package/dist/vue/components/configurator.js +24 -0
- package/dist/vue/components/configurator.js.map +1 -0
- package/dist/vue/components/discovery.d.ts +282 -0
- package/dist/vue/components/discovery.d.ts.map +1 -0
- package/dist/vue/components/discovery.js +67 -0
- package/dist/vue/components/discovery.js.map +1 -0
- package/dist/vue/components/layout.d.ts +230 -88
- package/dist/vue/components/layout.d.ts.map +1 -1
- package/dist/vue/components/layout.js +16 -9
- package/dist/vue/components/layout.js.map +1 -1
- package/dist/vue/components/navigation.d.ts +225 -0
- package/dist/vue/components/navigation.d.ts.map +1 -0
- package/dist/vue/components/navigation.js +16 -0
- package/dist/vue/components/navigation.js.map +1 -0
- package/dist/vue/components/wayfinding.d.ts +441 -0
- package/dist/vue/components/wayfinding.d.ts.map +1 -0
- package/dist/vue/components/wayfinding.js +37 -0
- package/dist/vue/components/wayfinding.js.map +1 -0
- package/dist/vue/components/workflows.d.ts +251 -0
- package/dist/vue/components/workflows.d.ts.map +1 -0
- package/dist/vue/components/workflows.js +35 -0
- package/dist/vue/components/workflows.js.map +1 -0
- package/dist/vue/index.d.ts +54 -9
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +105 -7
- package/dist/vue/index.js.map +1 -1
- package/dist/vue/layers.d.ts +19 -0
- package/dist/vue/layers.d.ts.map +1 -0
- package/dist/vue/layers.js +26 -0
- package/dist/vue/layers.js.map +1 -0
- package/dist/vue/native-view.d.ts +6 -0
- package/dist/vue/native-view.d.ts.map +1 -0
- package/dist/vue/native-view.js +5 -0
- package/dist/vue/native-view.js.map +1 -0
- package/dist/vue/navigation.d.ts +4 -0
- package/dist/vue/navigation.d.ts.map +1 -0
- package/dist/vue/navigation.js +16 -0
- package/dist/vue/navigation.js.map +1 -0
- package/dist/vue/props.d.ts +12 -11
- package/dist/vue/props.d.ts.map +1 -1
- package/dist/vue/props.js +25 -10
- package/dist/vue/props.js.map +1 -1
- package/dist/vue/router-navigation.d.ts +25 -0
- package/dist/vue/router-navigation.d.ts.map +1 -0
- package/dist/vue/router-navigation.js +15 -0
- package/dist/vue/router-navigation.js.map +1 -0
- package/dist/vue/services.d.ts +16 -0
- package/dist/vue/services.d.ts.map +1 -0
- package/dist/vue/services.js +23 -0
- package/dist/vue/services.js.map +1 -0
- package/dist/vue/system-back.d.ts +11 -0
- package/dist/vue/system-back.d.ts.map +1 -0
- package/dist/vue/system-back.js +2 -0
- package/dist/vue/system-back.js.map +1 -0
- package/dist/vue/use-choice-paint.d.ts +9 -0
- package/dist/vue/use-choice-paint.d.ts.map +1 -0
- package/dist/vue/use-choice-paint.js +32 -0
- package/dist/vue/use-choice-paint.js.map +1 -0
- package/dist/vue/use-motion-region.d.ts +7 -0
- package/dist/vue/use-motion-region.d.ts.map +1 -0
- package/dist/vue/use-motion-region.js +28 -0
- package/dist/vue/use-motion-region.js.map +1 -0
- package/dist/vue/use-motion-surface.d.ts +8 -0
- package/dist/vue/use-motion-surface.d.ts.map +1 -0
- package/dist/vue/use-motion-surface.js +105 -0
- package/dist/vue/use-motion-surface.js.map +1 -0
- package/dist/vue/use-press.d.ts +1 -1
- package/dist/vue/use-press.d.ts.map +1 -1
- package/dist/vue/use-press.js +13 -5
- package/dist/vue/use-press.js.map +1 -1
- package/dist/vue/use-scroll-motion.d.ts +7 -0
- package/dist/vue/use-scroll-motion.d.ts.map +1 -0
- package/dist/vue/use-scroll-motion.js +30 -0
- package/dist/vue/use-scroll-motion.js.map +1 -0
- package/fonts/LICENSE +45 -0
- package/fonts/lucide.ttf +0 -0
- package/package.json +20 -4
- package/platforms/android/java/com/mavis/ui/Box.java +65 -0
- package/platforms/android/java/com/mavis/ui/ContentWidth.java +77 -0
- package/platforms/android/java/com/mavis/ui/FlexLayout.java +101 -4
- package/platforms/android/java/com/mavis/ui/MeasureMemo.java +145 -0
- package/platforms/android/java/com/mavis/ui/Screen.java +108 -0
- package/src/app-icons.ts +21 -0
- package/src/date-format.ts +2 -0
- package/src/files.ts +3 -0
- package/src/native/app-icons.android.ts +95 -0
- package/src/native/app-icons.ios.ts +74 -0
- package/src/native/app-icons.ts +12 -0
- package/src/native/appearance.android.ts +75 -0
- package/src/native/appearance.ts +33 -0
- package/src/native/avatar-image.ts +9 -0
- package/src/native/avatar-label.android.ts +14 -0
- package/src/native/avatar-label.ts +1 -0
- package/src/native/box.android.ts +11 -0
- package/src/native/box.ios.ts +61 -0
- package/src/native/box.ts +2 -0
- package/src/native/button.android.ts +38 -0
- package/src/native/button.ios.ts +53 -1
- package/src/native/checkbox.android.ts +35 -0
- package/src/native/checkbox.ts +9 -0
- package/src/native/collection-motion.ts +166 -0
- package/src/native/combobox-editor.android.ts +11 -0
- package/src/native/combobox-editor.ts +6 -0
- package/src/native/composed-button.android.ts +74 -0
- package/src/native/composed-button.ts +9 -0
- package/src/native/date-format.android.ts +72 -0
- package/src/native/date-format.ios.ts +54 -0
- package/src/native/date-format.ts +17 -0
- package/src/native/dialog.android.ts +56 -0
- package/src/native/dialog.ios.ts +23 -0
- package/src/native/dialog.ts +10 -0
- package/src/native/dynamic-type.ts +71 -0
- package/src/native/file-access.ts +71 -0
- package/src/native/file-picker.android.ts +191 -0
- package/src/native/file-picker.ios.ts +230 -0
- package/src/native/file-picker.ts +8 -0
- package/src/native/flex-children.ts +12 -0
- package/src/native/flex-layout.android.ts +12 -1
- package/src/native/flex-layout.ios.ts +148 -1
- package/src/native/image-effects.ts +71 -0
- package/src/native/input-action.ts +15 -0
- package/src/native/keyboard-dismiss.android.ts +17 -0
- package/src/native/keyboard-dismiss.ios.ts +124 -0
- package/src/native/keyboard-dismiss.ts +14 -0
- package/src/native/label.android.ts +27 -0
- package/src/native/label.ios.ts +54 -1
- package/src/native/measure-memo.ts +116 -0
- package/src/native/motion-owner.ts +66 -0
- package/src/native/motion-region.ts +293 -0
- package/src/native/motion-surface.ts +273 -0
- package/src/native/platform-motion.ts +103 -0
- package/src/native/press.ts +58 -10
- package/src/native/progress.ts +78 -0
- package/src/native/screen.android.ts +12 -0
- package/src/native/screen.ts +2 -0
- package/src/native/scroll-motion.ts +106 -0
- package/src/native/section-scroll.ts +81 -0
- package/src/native/segmented.ts +95 -0
- package/src/native/sheet.android.ts +24 -0
- package/src/native/sheet.ios.ts +52 -0
- package/src/native/sheet.ts +26 -0
- package/src/native/surface-effects.ts +33 -0
- package/src/native/tabs.android.ts +58 -0
- package/src/native/tabs.ts +8 -0
- package/src/native/text-field.android.ts +19 -0
- package/src/native/text-field.ios.ts +53 -0
- package/src/native/text-view.ios.ts +10 -0
- package/src/native/toast.android.ts +9 -0
- package/src/native/toast.ios.ts +13 -0
- package/src/native/toast.ts +6 -0
- package/src/native/visual-effects.ts +147 -0
- package/src/vue/components/ChartPlot.ts +114 -0
- package/src/vue/components/ChoiceControl.ts +265 -0
- package/src/vue/components/DateCalendar.ts +121 -0
- package/src/vue/components/LoadingDecoration.ts +38 -0
- package/src/vue/components/MAccordion.ts +123 -0
- package/src/vue/components/MAlert.ts +156 -0
- package/src/vue/components/MAvatar.ts +103 -0
- package/src/vue/components/MBadge.ts +34 -0
- package/src/vue/components/MButton.ts +255 -18
- package/src/vue/components/MCard.ts +44 -5
- package/src/vue/components/MCheckbox.ts +25 -0
- package/src/vue/components/MChip.ts +134 -0
- package/src/vue/components/MCombobox.ts +257 -0
- package/src/vue/components/MDatePicker.ts +25 -0
- package/src/vue/components/MDialog.ts +312 -0
- package/src/vue/components/MEmptyState.ts +96 -0
- package/src/vue/components/MFilePicker.ts +226 -0
- package/src/vue/components/MGrid.ts +86 -0
- package/src/vue/components/MIcon.ts +53 -0
- package/src/vue/components/MImage.ts +181 -0
- package/src/vue/components/MInput.ts +143 -21
- package/src/vue/components/MLink.ts +99 -0
- package/src/vue/components/MListItem.ts +66 -0
- package/src/vue/components/MPopover.ts +254 -0
- package/src/vue/components/MProgress.ts +94 -0
- package/src/vue/components/MRadioGroup.ts +64 -0
- package/src/vue/components/MRangeSlider.ts +125 -0
- package/src/vue/components/MReveal.ts +89 -48
- package/src/vue/components/MScreen.ts +122 -6
- package/src/vue/components/MSegmentedControl.ts +214 -0
- package/src/vue/components/MSelect.ts +185 -0
- package/src/vue/components/MSeparator.ts +40 -0
- package/src/vue/components/MSheet.ts +375 -0
- package/src/vue/components/MSkeleton.ts +102 -0
- package/src/vue/components/MSlider.ts +8 -2
- package/src/vue/components/MStack.ts +83 -0
- package/src/vue/components/MSwitch.ts +200 -0
- package/src/vue/components/MTabs.ts +302 -0
- package/src/vue/components/MText.ts +48 -10
- package/src/vue/components/MTimePicker.ts +57 -0
- package/src/vue/components/MToast.ts +289 -0
- package/src/vue/components/MTooltip.ts +39 -0
- package/src/vue/components/MVirtualList.ts +120 -0
- package/src/vue/components/configurator.ts +27 -0
- package/src/vue/components/discovery.ts +92 -0
- package/src/vue/components/layout.ts +24 -9
- package/src/vue/components/navigation.ts +19 -0
- package/src/vue/components/wayfinding.ts +46 -0
- package/src/vue/components/workflows.ts +38 -0
- package/src/vue/index.ts +217 -22
- package/src/vue/layers.ts +48 -0
- package/src/vue/native-view.ts +6 -0
- package/src/vue/navigation.ts +15 -0
- package/src/vue/props.ts +37 -12
- package/src/vue/router-navigation.ts +39 -0
- package/src/vue/services.ts +39 -0
- package/src/vue/system-back.ts +12 -0
- package/src/vue/use-choice-paint.ts +39 -0
- package/src/vue/use-motion-region.ts +29 -0
- package/src/vue/use-motion-surface.ts +115 -0
- package/src/vue/use-press.ts +13 -5
- package/src/vue/use-scroll-motion.ts +31 -0
- package/dist/native/input-description.android.d.ts +0 -4
- package/dist/native/input-description.android.d.ts.map +0 -1
- package/dist/native/input-description.android.js +0 -18
- package/dist/native/input-description.android.js.map +0 -1
- package/dist/theme/resolve.d.ts +0 -3
- package/dist/theme/resolve.d.ts.map +0 -1
- package/dist/theme/resolve.js +0 -8
- package/dist/theme/resolve.js.map +0 -1
- package/dist/theme/themes.d.ts +0 -6
- package/dist/theme/themes.d.ts.map +0 -1
- package/dist/theme/themes.js +0 -83
- package/dist/theme/themes.js.map +0 -1
- package/dist/theme/types.d.ts +0 -50
- package/dist/theme/types.d.ts.map +0 -1
- package/dist/theme/types.js +0 -2
- package/dist/theme/types.js.map +0 -1
- package/dist/vue/global-components.d.ts +0 -21
- package/dist/vue/global-components.d.ts.map +0 -1
- package/dist/vue/global-components.js +0 -2
- package/dist/vue/global-components.js.map +0 -1
- package/dist/vue/layout-context.d.ts +0 -5
- package/dist/vue/layout-context.d.ts.map +0 -1
- package/dist/vue/layout-context.js +0 -7
- package/dist/vue/layout-context.js.map +0 -1
- package/dist/vue/text-content.d.ts +0 -4
- package/dist/vue/text-content.d.ts.map +0 -1
- package/dist/vue/text-content.js +0 -17
- package/dist/vue/text-content.js.map +0 -1
- package/dist/vue/theme.d.ts +0 -177
- package/dist/vue/theme.d.ts.map +0 -1
- package/dist/vue/theme.js +0 -17
- package/dist/vue/theme.js.map +0 -1
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineComponent,
|
|
3
|
+
h,
|
|
4
|
+
mergeProps,
|
|
5
|
+
nextTick,
|
|
6
|
+
onBeforeUnmount,
|
|
7
|
+
onDeactivated,
|
|
8
|
+
shallowRef,
|
|
9
|
+
watch,
|
|
10
|
+
} from 'nativescript-vue'
|
|
11
|
+
import { filePickerProps, fileStatusText, useButtonAction } from '@getcortexlabs/mavis-core/vue'
|
|
12
|
+
import type { InputHandle } from '@getcortexlabs/mavis-core'
|
|
13
|
+
import { createNativeFilePicker } from '../../native/file-picker'
|
|
14
|
+
import { MColumn, MRow } from './layout.js'
|
|
15
|
+
import { MText } from './MText.js'
|
|
16
|
+
import { MButton } from './MButton.js'
|
|
17
|
+
import { MProgress } from './MProgress.js'
|
|
18
|
+
import { MCard } from './MCard.js'
|
|
19
|
+
import { Application, isAndroid, type EventData, type View } from '@nativescript/core'
|
|
20
|
+
|
|
21
|
+
const FilePicker = defineComponent({
|
|
22
|
+
name: 'MFilePicker',
|
|
23
|
+
inheritAttrs: false,
|
|
24
|
+
props: filePickerProps,
|
|
25
|
+
setup(props, { attrs, expose }) {
|
|
26
|
+
useButtonAction()
|
|
27
|
+
const state = shallowRef(props.selection.state)
|
|
28
|
+
const picker = createNativeFilePicker()
|
|
29
|
+
let chooseView: View | undefined
|
|
30
|
+
let loaded = false
|
|
31
|
+
let unsubscribe = () => {}
|
|
32
|
+
watch(
|
|
33
|
+
() => props.selection,
|
|
34
|
+
(selection, previous) => {
|
|
35
|
+
previous?.pause()
|
|
36
|
+
unsubscribe()
|
|
37
|
+
state.value = selection.state
|
|
38
|
+
unsubscribe = selection.subscribe((value) => {
|
|
39
|
+
state.value = value
|
|
40
|
+
})
|
|
41
|
+
},
|
|
42
|
+
{ immediate: true, flush: 'sync' },
|
|
43
|
+
)
|
|
44
|
+
watch(
|
|
45
|
+
() => props.disabled,
|
|
46
|
+
(disabled) => {
|
|
47
|
+
if (disabled) props.selection.pause()
|
|
48
|
+
},
|
|
49
|
+
)
|
|
50
|
+
function unload() {
|
|
51
|
+
loaded = false
|
|
52
|
+
// Android stops/unloads the owner Activity when its system document picker opens.
|
|
53
|
+
// Keep that intentional handoff alive; route unloads and component disposal still cancel.
|
|
54
|
+
if (isAndroid && Application.android.paused && props.selection.state.picking) {
|
|
55
|
+
for (const item of props.selection.state.items) props.selection.cancel(item.id)
|
|
56
|
+
} else props.selection.pause()
|
|
57
|
+
chooseView = undefined
|
|
58
|
+
}
|
|
59
|
+
onDeactivated(() => props.selection.pause())
|
|
60
|
+
onBeforeUnmount(() => {
|
|
61
|
+
unsubscribe()
|
|
62
|
+
props.selection.pause()
|
|
63
|
+
unload()
|
|
64
|
+
})
|
|
65
|
+
function focusChoose() {
|
|
66
|
+
if (loaded && !props.disabled && !state.value.picking) chooseView?.focus()
|
|
67
|
+
}
|
|
68
|
+
expose({
|
|
69
|
+
focus: focusChoose,
|
|
70
|
+
blur: () => {
|
|
71
|
+
chooseView?.android?.clearFocus()
|
|
72
|
+
chooseView?.ios?.resignFirstResponder()
|
|
73
|
+
},
|
|
74
|
+
} satisfies InputHandle)
|
|
75
|
+
function choose() {
|
|
76
|
+
if (!loaded || props.disabled || state.value.picking) return
|
|
77
|
+
const selection = props.selection
|
|
78
|
+
void selection.select(picker).finally(async () => {
|
|
79
|
+
await nextTick()
|
|
80
|
+
if (props.selection === selection) focusChoose()
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
return () => {
|
|
84
|
+
if (!props.label.trim()) throw new TypeError('FilePicker needs a non-empty label')
|
|
85
|
+
const selection = props.selection
|
|
86
|
+
return h(
|
|
87
|
+
MColumn,
|
|
88
|
+
mergeProps(attrs, {
|
|
89
|
+
gap: 'md',
|
|
90
|
+
onLoaded: () => {
|
|
91
|
+
loaded = true
|
|
92
|
+
},
|
|
93
|
+
onUnloaded: unload,
|
|
94
|
+
}),
|
|
95
|
+
{
|
|
96
|
+
default: () => [
|
|
97
|
+
h(MText, { text: props.label, weight: '600' }),
|
|
98
|
+
h(
|
|
99
|
+
MRow,
|
|
100
|
+
{ gap: 'sm', wrap: true },
|
|
101
|
+
{
|
|
102
|
+
default: () => [
|
|
103
|
+
h(MButton, {
|
|
104
|
+
text: props.chooseLabel,
|
|
105
|
+
variant: 'secondary',
|
|
106
|
+
disabled: props.disabled || state.value.picking,
|
|
107
|
+
accessibilityLabel: `${props.chooseLabel}: ${props.label}`,
|
|
108
|
+
onClick: choose,
|
|
109
|
+
onLoaded: (event: EventData) => {
|
|
110
|
+
chooseView = event.object as View
|
|
111
|
+
},
|
|
112
|
+
}),
|
|
113
|
+
state.value.picking
|
|
114
|
+
? h(MButton, {
|
|
115
|
+
text: props.cancelLabel,
|
|
116
|
+
variant: 'ghost',
|
|
117
|
+
onClick: () => {
|
|
118
|
+
selection.cancelSelection()
|
|
119
|
+
focusChoose()
|
|
120
|
+
},
|
|
121
|
+
})
|
|
122
|
+
: null,
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
),
|
|
126
|
+
state.value.error
|
|
127
|
+
? h(MText, {
|
|
128
|
+
text: props.errorLabels[state.value.error.code] ?? state.value.error.message,
|
|
129
|
+
tone: 'danger',
|
|
130
|
+
})
|
|
131
|
+
: null,
|
|
132
|
+
!state.value.items.length ? h(MText, { text: props.emptyLabel, tone: 'muted' }) : null,
|
|
133
|
+
...state.value.items.map((item) => {
|
|
134
|
+
const preview = selection.preview(item.id)
|
|
135
|
+
const status = fileStatusText(item, props.statusLabels)
|
|
136
|
+
return h(
|
|
137
|
+
MCard,
|
|
138
|
+
{ key: item.id, gap: 'sm' },
|
|
139
|
+
{
|
|
140
|
+
default: () => [
|
|
141
|
+
preview
|
|
142
|
+
? h('Image', {
|
|
143
|
+
src: preview,
|
|
144
|
+
width: 80,
|
|
145
|
+
height: 80,
|
|
146
|
+
stretch: 'aspectFit',
|
|
147
|
+
horizontalAlignment: 'left',
|
|
148
|
+
accessible: false,
|
|
149
|
+
accessibilityHidden: true,
|
|
150
|
+
})
|
|
151
|
+
: null,
|
|
152
|
+
h(MText, { text: item.name, weight: '600' }),
|
|
153
|
+
h(MText, {
|
|
154
|
+
text: `${status}${item.size === undefined ? '' : ` · ${item.size} B`}`,
|
|
155
|
+
variant: 'caption',
|
|
156
|
+
tone:
|
|
157
|
+
item.status === 'failed'
|
|
158
|
+
? 'danger'
|
|
159
|
+
: item.status === 'uploaded'
|
|
160
|
+
? 'success'
|
|
161
|
+
: 'muted',
|
|
162
|
+
}),
|
|
163
|
+
item.status === 'uploading'
|
|
164
|
+
? h(MProgress, {
|
|
165
|
+
value: (item.progress ?? 0) * 100,
|
|
166
|
+
indeterminate: item.progress === undefined,
|
|
167
|
+
label: `${props.uploadLabel}: ${item.name}`,
|
|
168
|
+
indeterminateLabel: props.pendingLabel,
|
|
169
|
+
})
|
|
170
|
+
: null,
|
|
171
|
+
item.error
|
|
172
|
+
? h(MText, { text: item.error, tone: 'danger', variant: 'caption' })
|
|
173
|
+
: null,
|
|
174
|
+
h(
|
|
175
|
+
MRow,
|
|
176
|
+
{ gap: 'sm', wrap: true },
|
|
177
|
+
{
|
|
178
|
+
default: () => [
|
|
179
|
+
item.status === 'uploading'
|
|
180
|
+
? h(MButton, {
|
|
181
|
+
text: props.cancelLabel,
|
|
182
|
+
accessibilityLabel: `${props.cancelLabel}: ${item.name}`,
|
|
183
|
+
variant: 'secondary',
|
|
184
|
+
disabled: props.disabled,
|
|
185
|
+
onClick: () => selection.cancel(item.id),
|
|
186
|
+
})
|
|
187
|
+
: selection.canUpload && item.status !== 'uploaded'
|
|
188
|
+
? h(MButton, {
|
|
189
|
+
text:
|
|
190
|
+
item.status === 'failed' || item.status === 'cancelled'
|
|
191
|
+
? props.retryLabel
|
|
192
|
+
: props.uploadLabel,
|
|
193
|
+
accessibilityLabel: `${item.status === 'failed' || item.status === 'cancelled' ? props.retryLabel : props.uploadLabel}: ${item.name}`,
|
|
194
|
+
disabled: props.disabled || !selection.hasFile(item.id),
|
|
195
|
+
onClick: () => {
|
|
196
|
+
void selection.upload(item.id)
|
|
197
|
+
},
|
|
198
|
+
})
|
|
199
|
+
: null,
|
|
200
|
+
h(MButton, {
|
|
201
|
+
text: props.removeLabel,
|
|
202
|
+
accessibilityLabel: `${props.removeLabel}: ${item.name}`,
|
|
203
|
+
variant: 'ghost',
|
|
204
|
+
disabled: props.disabled,
|
|
205
|
+
onClick: () => {
|
|
206
|
+
focusChoose()
|
|
207
|
+
selection.remove(item.id)
|
|
208
|
+
},
|
|
209
|
+
}),
|
|
210
|
+
],
|
|
211
|
+
},
|
|
212
|
+
),
|
|
213
|
+
],
|
|
214
|
+
},
|
|
215
|
+
)
|
|
216
|
+
}),
|
|
217
|
+
],
|
|
218
|
+
},
|
|
219
|
+
)
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
})
|
|
223
|
+
|
|
224
|
+
export const MFilePicker = FilePicker as typeof FilePicker & {
|
|
225
|
+
new (): InstanceType<typeof FilePicker> & InputHandle
|
|
226
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Comment,
|
|
3
|
+
Fragment,
|
|
4
|
+
Text,
|
|
5
|
+
createVNode,
|
|
6
|
+
defineComponent,
|
|
7
|
+
h,
|
|
8
|
+
mergeProps,
|
|
9
|
+
provide,
|
|
10
|
+
shallowRef,
|
|
11
|
+
type VNode,
|
|
12
|
+
} from 'nativescript-vue'
|
|
13
|
+
import type { EventData, View } from '@nativescript/core'
|
|
14
|
+
import { gridColumns, resolveSpace } from '@getcortexlabs/mavis-core'
|
|
15
|
+
import {
|
|
16
|
+
gridProps,
|
|
17
|
+
layoutDirection,
|
|
18
|
+
useLayoutShrink,
|
|
19
|
+
useMavisTheme,
|
|
20
|
+
} from '@getcortexlabs/mavis-core/vue'
|
|
21
|
+
import { boxStyle } from '../props.js'
|
|
22
|
+
import { useNativeViewAttrs } from '../accessibility.js'
|
|
23
|
+
import './layout.js'
|
|
24
|
+
|
|
25
|
+
export const MGrid = defineComponent({
|
|
26
|
+
name: 'MGrid',
|
|
27
|
+
inheritAttrs: false,
|
|
28
|
+
props: gridProps,
|
|
29
|
+
setup(props, { attrs, slots }) {
|
|
30
|
+
const { theme } = useMavisTheme()
|
|
31
|
+
const shrink = useLayoutShrink()
|
|
32
|
+
const nativeAttrs = useNativeViewAttrs(props)
|
|
33
|
+
provide(layoutDirection, 'column')
|
|
34
|
+
const width = shallowRef<number>()
|
|
35
|
+
return () => {
|
|
36
|
+
const gap = resolveSpace(theme.value, props.gap ?? 'none')
|
|
37
|
+
const count = gridColumns(props.columns, props.minColumnWidth, gap, width.value)
|
|
38
|
+
let index = 0
|
|
39
|
+
// Keep fragment boundaries so independently keyed slot groups retain their identity.
|
|
40
|
+
const place = (nodes: VNode[]): VNode[] =>
|
|
41
|
+
nodes.flatMap((child) => {
|
|
42
|
+
if (child.type === Fragment)
|
|
43
|
+
return [
|
|
44
|
+
createVNode(
|
|
45
|
+
Fragment,
|
|
46
|
+
{ key: child.key ?? undefined },
|
|
47
|
+
place(child.children as VNode[]),
|
|
48
|
+
),
|
|
49
|
+
]
|
|
50
|
+
if (child.type === Comment || (child.type === Text && !String(child.children).trim()))
|
|
51
|
+
return []
|
|
52
|
+
const cell = index++
|
|
53
|
+
return [
|
|
54
|
+
h(
|
|
55
|
+
'MavisBox',
|
|
56
|
+
{
|
|
57
|
+
key: child.key ?? cell,
|
|
58
|
+
col: (cell % count) * 2,
|
|
59
|
+
row: Math.floor(cell / count) * 2,
|
|
60
|
+
},
|
|
61
|
+
[child],
|
|
62
|
+
),
|
|
63
|
+
]
|
|
64
|
+
})
|
|
65
|
+
const children = place(slots.default?.() ?? [])
|
|
66
|
+
const rows = Math.ceil(index / count)
|
|
67
|
+
return h(
|
|
68
|
+
'MavisBox',
|
|
69
|
+
mergeProps({ style: boxStyle(theme.value, props, shrink.value) }, nativeAttrs(), attrs),
|
|
70
|
+
[
|
|
71
|
+
h(
|
|
72
|
+
'GridLayout',
|
|
73
|
+
{
|
|
74
|
+
columns: Array.from({ length: count }, () => '*').join(`,${gap},`),
|
|
75
|
+
rows: Array.from({ length: rows }, () => 'auto').join(`,${gap},`),
|
|
76
|
+
onLayoutChanged: (event: EventData) => {
|
|
77
|
+
width.value = (event.object as View).getActualSize().width
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
children,
|
|
81
|
+
),
|
|
82
|
+
],
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
})
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { defineComponent, h, mergeProps, registerElement } from 'nativescript-vue'
|
|
2
|
+
import { iconProps, useMavisTheme } from '@getcortexlabs/mavis-core/vue'
|
|
3
|
+
import { iconFontFamily, iconGlyph, resolveIconSize } from '@getcortexlabs/mavis-core'
|
|
4
|
+
import { MavisLabel } from '../../native/label'
|
|
5
|
+
import { isIOS } from '@nativescript/core'
|
|
6
|
+
import { useMotionSurface } from '../use-motion-surface.js'
|
|
7
|
+
|
|
8
|
+
registerElement('MavisIcon', () => MavisLabel)
|
|
9
|
+
|
|
10
|
+
export const MIcon = defineComponent({
|
|
11
|
+
name: 'MIcon',
|
|
12
|
+
inheritAttrs: false,
|
|
13
|
+
props: iconProps,
|
|
14
|
+
setup(props, { attrs }) {
|
|
15
|
+
const { theme } = useMavisTheme()
|
|
16
|
+
const motion = useMotionSurface(() => props.motionSurface)
|
|
17
|
+
return () => {
|
|
18
|
+
const size = resolveIconSize(props.size)
|
|
19
|
+
return h(
|
|
20
|
+
props.systemName && isIOS ? 'Image' : 'MavisIcon',
|
|
21
|
+
mergeProps(
|
|
22
|
+
{ onLoaded: motion.onLoaded, onUnloaded: motion.onUnloaded },
|
|
23
|
+
{
|
|
24
|
+
id: props.id,
|
|
25
|
+
key: props.systemName && isIOS ? props.systemName : 'glyph',
|
|
26
|
+
...(props.systemName && isIOS
|
|
27
|
+
? {
|
|
28
|
+
src: `sys://${props.systemName}`,
|
|
29
|
+
width: size,
|
|
30
|
+
height: size,
|
|
31
|
+
tintColor: theme.value.colors[props.tone],
|
|
32
|
+
}
|
|
33
|
+
: { text: iconGlyph(props.name) }),
|
|
34
|
+
textWrap: false,
|
|
35
|
+
accessible: Boolean(props.label),
|
|
36
|
+
accessibilityHidden: !props.label,
|
|
37
|
+
accessibilityRole: 'image',
|
|
38
|
+
accessibilityLabel: props.label,
|
|
39
|
+
style: {
|
|
40
|
+
fontFamily: iconFontFamily,
|
|
41
|
+
fontSize: size,
|
|
42
|
+
color: theme.value.colors[props.tone],
|
|
43
|
+
textAlignment: 'center',
|
|
44
|
+
verticalAlignment: 'middle',
|
|
45
|
+
flexShrink: 0,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
attrs,
|
|
49
|
+
),
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
})
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineComponent,
|
|
3
|
+
h,
|
|
4
|
+
mergeProps,
|
|
5
|
+
nextTick,
|
|
6
|
+
onBeforeUnmount,
|
|
7
|
+
ref,
|
|
8
|
+
shallowRef,
|
|
9
|
+
watch,
|
|
10
|
+
} from 'nativescript-vue'
|
|
11
|
+
import type { EventData, View, ImageSource, Image } from '@nativescript/core'
|
|
12
|
+
import { imageProps, useMavisTheme } from '@getcortexlabs/mavis-core/vue'
|
|
13
|
+
import { resolveRadius } from '@getcortexlabs/mavis-core'
|
|
14
|
+
import { loadAvatarImage } from '../../native/avatar-image'
|
|
15
|
+
import { MBox } from './layout.js'
|
|
16
|
+
import { MText } from './MText.js'
|
|
17
|
+
import { useMotionSurface } from '../use-motion-surface.js'
|
|
18
|
+
import { registerMotionImage } from '../../native/image-effects.js'
|
|
19
|
+
|
|
20
|
+
export const MImage = defineComponent({
|
|
21
|
+
name: 'MImage',
|
|
22
|
+
inheritAttrs: false,
|
|
23
|
+
props: imageProps,
|
|
24
|
+
emits: {
|
|
25
|
+
load: (_src: string) => true,
|
|
26
|
+
error: (_src: string) => true,
|
|
27
|
+
'update:src': (_src: string) => true,
|
|
28
|
+
},
|
|
29
|
+
setup(props, { attrs, emit }) {
|
|
30
|
+
const { theme } = useMavisTheme()
|
|
31
|
+
const image = shallowRef<ImageSource | null>(null)
|
|
32
|
+
const status = ref<'loading' | 'ready' | 'error'>('loading')
|
|
33
|
+
const width = ref(typeof props.width === 'number' ? props.width : 0)
|
|
34
|
+
let generation = 0,
|
|
35
|
+
loaded = false
|
|
36
|
+
let releaseImage: (() => void) | undefined,
|
|
37
|
+
committing: string | undefined,
|
|
38
|
+
currentImage: Image | undefined
|
|
39
|
+
const motion = useMotionSurface(
|
|
40
|
+
() => props.motionSurface,
|
|
41
|
+
() => true,
|
|
42
|
+
() => false,
|
|
43
|
+
true,
|
|
44
|
+
)
|
|
45
|
+
async function load() {
|
|
46
|
+
const current = ++generation,
|
|
47
|
+
src = props.src
|
|
48
|
+
image.value = null
|
|
49
|
+
status.value = src.trim() ? 'loading' : 'error'
|
|
50
|
+
if (!loaded || !src.trim()) return
|
|
51
|
+
try {
|
|
52
|
+
const result = await loadAvatarImage(src.trim())
|
|
53
|
+
if (current !== generation || !loaded) return
|
|
54
|
+
if (!result || result.width <= 0 || result.height <= 0)
|
|
55
|
+
throw new Error('Image could not be decoded.')
|
|
56
|
+
image.value = result
|
|
57
|
+
status.value = 'ready'
|
|
58
|
+
emit('load', src)
|
|
59
|
+
} catch {
|
|
60
|
+
if (current !== generation || !loaded) return
|
|
61
|
+
status.value = 'error'
|
|
62
|
+
emit('error', src)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function unload() {
|
|
66
|
+
motion.onUnloaded()
|
|
67
|
+
releaseImage?.()
|
|
68
|
+
releaseImage = undefined
|
|
69
|
+
currentImage = undefined
|
|
70
|
+
loaded = false
|
|
71
|
+
generation++
|
|
72
|
+
image.value = null
|
|
73
|
+
}
|
|
74
|
+
watch(
|
|
75
|
+
() => props.src,
|
|
76
|
+
() => {
|
|
77
|
+
if (props.src === committing) {
|
|
78
|
+
committing = undefined
|
|
79
|
+
return
|
|
80
|
+
}
|
|
81
|
+
void load()
|
|
82
|
+
},
|
|
83
|
+
{ flush: 'sync' },
|
|
84
|
+
)
|
|
85
|
+
onBeforeUnmount(unload)
|
|
86
|
+
return () => {
|
|
87
|
+
if (!Number.isFinite(props.aspectRatio) || props.aspectRatio <= 0)
|
|
88
|
+
throw new RangeError('aspectRatio must be finite and positive.')
|
|
89
|
+
const radius = resolveRadius(theme.value, props.radius)
|
|
90
|
+
return h(
|
|
91
|
+
MBox,
|
|
92
|
+
mergeProps(attrs, {
|
|
93
|
+
...props,
|
|
94
|
+
motionSurface: undefined,
|
|
95
|
+
width: props.width ?? '100%',
|
|
96
|
+
height: props.height ?? width.value / props.aspectRatio,
|
|
97
|
+
backgroundColor: props.backgroundColor || theme.value.colors.elevated,
|
|
98
|
+
accessible: Boolean(props.alt),
|
|
99
|
+
accessibilityRole: 'image',
|
|
100
|
+
accessibilityLabel: props.alt,
|
|
101
|
+
accessibilityHint:
|
|
102
|
+
status.value === 'ready'
|
|
103
|
+
? ''
|
|
104
|
+
: status.value === 'error'
|
|
105
|
+
? props.errorLabel
|
|
106
|
+
: props.loadingLabel,
|
|
107
|
+
accessibilityHidden: props.accessibilityHidden || !props.alt,
|
|
108
|
+
onLoaded: () => {
|
|
109
|
+
loaded = true
|
|
110
|
+
void load()
|
|
111
|
+
},
|
|
112
|
+
onUnloaded: unload,
|
|
113
|
+
onLayoutChanged: (event: EventData) => {
|
|
114
|
+
const next = (event.object as View).getActualSize().width
|
|
115
|
+
if (next > 0 && Math.abs(next - width.value) > 0.1) width.value = next
|
|
116
|
+
},
|
|
117
|
+
}),
|
|
118
|
+
() =>
|
|
119
|
+
image.value
|
|
120
|
+
? [
|
|
121
|
+
h('Image', {
|
|
122
|
+
key: generation,
|
|
123
|
+
imageSource: image.value,
|
|
124
|
+
width: '100%',
|
|
125
|
+
height: '100%',
|
|
126
|
+
stretch: props.fit === 'cover' ? 'aspectFill' : 'aspectFit',
|
|
127
|
+
borderRadius: radius,
|
|
128
|
+
accessible: false,
|
|
129
|
+
accessibilityHidden: true,
|
|
130
|
+
onLoaded(event: EventData) {
|
|
131
|
+
const target = event.object as Image,
|
|
132
|
+
current = generation
|
|
133
|
+
currentImage = target
|
|
134
|
+
releaseImage?.()
|
|
135
|
+
releaseImage = registerMotionImage(target, {
|
|
136
|
+
current: () =>
|
|
137
|
+
loaded &&
|
|
138
|
+
current === generation &&
|
|
139
|
+
currentImage === target &&
|
|
140
|
+
target.isLoaded,
|
|
141
|
+
async commit(destination, prepared) {
|
|
142
|
+
if (!loaded || current !== generation) return false
|
|
143
|
+
const previous = image.value
|
|
144
|
+
image.value = prepared ?? null
|
|
145
|
+
committing = destination
|
|
146
|
+
emit('update:src', destination)
|
|
147
|
+
await nextTick()
|
|
148
|
+
const accepted =
|
|
149
|
+
loaded && current === generation && props.src === destination
|
|
150
|
+
committing = undefined
|
|
151
|
+
if (!accepted && current === generation) {
|
|
152
|
+
image.value = previous
|
|
153
|
+
if (previous) target.imageSource = previous
|
|
154
|
+
}
|
|
155
|
+
return accepted
|
|
156
|
+
},
|
|
157
|
+
})
|
|
158
|
+
motion.onLoaded(event)
|
|
159
|
+
},
|
|
160
|
+
onUnloaded(event: EventData) {
|
|
161
|
+
if (event.object !== currentImage) return
|
|
162
|
+
motion.onUnloaded()
|
|
163
|
+
releaseImage?.()
|
|
164
|
+
releaseImage = undefined
|
|
165
|
+
currentImage = undefined
|
|
166
|
+
},
|
|
167
|
+
}),
|
|
168
|
+
]
|
|
169
|
+
: [
|
|
170
|
+
h(MText, {
|
|
171
|
+
text: status.value === 'error' ? props.errorLabel : props.loadingLabel,
|
|
172
|
+
tone: 'muted',
|
|
173
|
+
variant: 'caption',
|
|
174
|
+
accessibilityHidden: true,
|
|
175
|
+
style: { textAlignment: 'center', verticalAlignment: 'middle', padding: 16 },
|
|
176
|
+
}),
|
|
177
|
+
],
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
})
|