@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
package/fonts/LICENSE
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Lucide icon font 1.65.0
|
|
2
|
+
|
|
3
|
+
ISC License
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026 Lucide Icons and Contributors
|
|
6
|
+
|
|
7
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
8
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
9
|
+
copyright notice and this permission notice appear in all copies.
|
|
10
|
+
|
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
12
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
13
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
14
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
15
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
16
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
17
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
The following Lucide icons are derived from the Feather project:
|
|
22
|
+
|
|
23
|
+
airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
|
|
24
|
+
|
|
25
|
+
The MIT License (MIT) (for the icons listed above)
|
|
26
|
+
|
|
27
|
+
Copyright (c) 2013-present Cole Bemis
|
|
28
|
+
|
|
29
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
30
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
31
|
+
in the Software without restriction, including without limitation the rights
|
|
32
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
33
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
34
|
+
furnished to do so, subject to the following conditions:
|
|
35
|
+
|
|
36
|
+
The above copyright notice and this permission notice shall be included in all
|
|
37
|
+
copies or substantial portions of the Software.
|
|
38
|
+
|
|
39
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
40
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
41
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
42
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
43
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
44
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
45
|
+
SOFTWARE.
|
package/fonts/lucide.ttf
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getcortexlabs/mavis",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.11",
|
|
4
4
|
"description": "Mavis UI foundations for NativeScript, with a Vue integration.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"sideEffects":
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"./dist/vue/components/layout.js",
|
|
8
|
+
"./src/vue/components/layout.ts"
|
|
9
|
+
],
|
|
7
10
|
"exports": {
|
|
11
|
+
"./app-icons": {
|
|
12
|
+
"types": "./dist/app-icons.d.ts",
|
|
13
|
+
"default": "./dist/app-icons.js"
|
|
14
|
+
},
|
|
8
15
|
".": {
|
|
9
16
|
"types": "./dist/index.d.ts",
|
|
10
17
|
"default": "./dist/index.js"
|
|
@@ -12,10 +19,19 @@
|
|
|
12
19
|
"./vue": {
|
|
13
20
|
"types": "./dist/vue/index.d.ts",
|
|
14
21
|
"default": "./dist/vue/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./vue/services": {
|
|
24
|
+
"types": "./dist/vue/services.d.ts",
|
|
25
|
+
"default": "./dist/vue/services.js"
|
|
26
|
+
},
|
|
27
|
+
"./date-format": {
|
|
28
|
+
"types": "./dist/date-format.d.ts",
|
|
29
|
+
"default": "./dist/date-format.js"
|
|
15
30
|
}
|
|
16
31
|
},
|
|
17
32
|
"files": [
|
|
18
33
|
"dist",
|
|
34
|
+
"fonts",
|
|
19
35
|
"platforms/android/include.gradle",
|
|
20
36
|
"platforms/android/java",
|
|
21
37
|
"src",
|
|
@@ -27,7 +43,7 @@
|
|
|
27
43
|
},
|
|
28
44
|
"peerDependencies": {
|
|
29
45
|
"@nativescript/core": "^9.1.3",
|
|
30
|
-
"@rafaelaugusto/jolt": "^0.1.0-rc.
|
|
46
|
+
"@rafaelaugusto/jolt": "^0.1.0-rc.11",
|
|
31
47
|
"nativescript-vue": "^3.1.3"
|
|
32
48
|
},
|
|
33
49
|
"peerDependenciesMeta": {
|
|
@@ -36,7 +52,7 @@
|
|
|
36
52
|
}
|
|
37
53
|
},
|
|
38
54
|
"dependencies": {
|
|
39
|
-
"@getcortexlabs/mavis-core": "0.1.0-alpha.
|
|
55
|
+
"@getcortexlabs/mavis-core": "0.1.0-alpha.11"
|
|
40
56
|
},
|
|
41
57
|
"nativescript": {
|
|
42
58
|
"platforms": {
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
package com.mavis.ui;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
import android.view.ViewGroup;
|
|
5
|
+
import org.nativescript.widgets.CommonLayoutParams;
|
|
6
|
+
import org.nativescript.widgets.GridLayout;
|
|
7
|
+
|
|
8
|
+
/** An auto-height Box takes its content height when the parent only limits the available space. */
|
|
9
|
+
public class Box extends GridLayout implements MeasureMemo.Owner {
|
|
10
|
+
private final MeasureMemo memo = new MeasureMemo();
|
|
11
|
+
|
|
12
|
+
public Box(Context context) {
|
|
13
|
+
super(context);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@Override
|
|
17
|
+
public int memoWidthSpec() {
|
|
18
|
+
return memo.receivedWidthSpec();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@Override
|
|
22
|
+
public int memoHeightSpec() {
|
|
23
|
+
return memo.receivedHeightSpec();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Android's view constructors already request layout, before this field exists.
|
|
27
|
+
@Override
|
|
28
|
+
public void requestLayout() {
|
|
29
|
+
if (memo != null) memo.invalidate();
|
|
30
|
+
super.requestLayout();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@Override
|
|
34
|
+
public void forceLayout() {
|
|
35
|
+
if (memo != null) memo.invalidate();
|
|
36
|
+
super.forceLayout();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@Override
|
|
40
|
+
protected void onMeasure(int widthSpec, int heightSpec) {
|
|
41
|
+
memo.receive(widthSpec, heightSpec);
|
|
42
|
+
if (memo.restore(this, widthSpec, heightSpec)) {
|
|
43
|
+
setMeasuredDimension(memo.widthAndState(), memo.heightAndState());
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
int contentHeightSpec = heightSpec;
|
|
47
|
+
if (MeasureSpec.getMode(heightSpec) == MeasureSpec.AT_MOST && isAutoHeight()) {
|
|
48
|
+
contentHeightSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
|
|
49
|
+
}
|
|
50
|
+
try (ContentWidth widths = ContentWidth.resolve(this, widthSpec, false)) {
|
|
51
|
+
super.onMeasure(widthSpec, contentHeightSpec);
|
|
52
|
+
}
|
|
53
|
+
memo.record(this, widthSpec, heightSpec,
|
|
54
|
+
MeasureMemo.filledLimit(widthSpec, heightSpec, getMeasuredWidthAndState(), getMeasuredHeightAndState()));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
private boolean isAutoHeight() {
|
|
58
|
+
ViewGroup.LayoutParams params = getLayoutParams();
|
|
59
|
+
if (params instanceof CommonLayoutParams) {
|
|
60
|
+
CommonLayoutParams common = (CommonLayoutParams) params;
|
|
61
|
+
return common.height < 0 && common.heightPercent <= 0;
|
|
62
|
+
}
|
|
63
|
+
return params == null || params.height < 0;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
package com.mavis.ui;
|
|
2
|
+
|
|
3
|
+
import android.view.View;
|
|
4
|
+
import android.view.ViewGroup;
|
|
5
|
+
import org.nativescript.widgets.CommonLayoutParams;
|
|
6
|
+
import org.nativescript.widgets.FlexboxLayout;
|
|
7
|
+
import java.util.ArrayList;
|
|
8
|
+
|
|
9
|
+
/** Resolves widths during measurement without changing the app's declared styles. */
|
|
10
|
+
final class ContentWidth implements AutoCloseable {
|
|
11
|
+
private final ArrayList<Saved> changed = new ArrayList<>();
|
|
12
|
+
|
|
13
|
+
private ContentWidth() {}
|
|
14
|
+
|
|
15
|
+
static ContentWidth resolve(ViewGroup parent, int widthSpec, boolean column) {
|
|
16
|
+
ContentWidth result = null;
|
|
17
|
+
boolean bounded = View.MeasureSpec.getMode(widthSpec) != View.MeasureSpec.UNSPECIFIED;
|
|
18
|
+
boolean parentStretch = column
|
|
19
|
+
&& ((FlexboxLayout) parent).getAlignItems() == FlexboxLayout.ALIGN_ITEMS_STRETCH;
|
|
20
|
+
int available = Math.max(0, View.MeasureSpec.getSize(widthSpec)
|
|
21
|
+
- parent.getPaddingLeft() - parent.getPaddingRight());
|
|
22
|
+
for (int i = 0; i < parent.getChildCount(); i++) {
|
|
23
|
+
View child = parent.getChildAt(i);
|
|
24
|
+
if (child.getVisibility() == View.GONE) continue;
|
|
25
|
+
CommonLayoutParams params = (CommonLayoutParams) child.getLayoutParams();
|
|
26
|
+
// Core uses zero for an unset percentage.
|
|
27
|
+
boolean percent = bounded && params.widthPercent > 0;
|
|
28
|
+
FlexboxLayout.LayoutParams flex = params instanceof FlexboxLayout.LayoutParams
|
|
29
|
+
? (FlexboxLayout.LayoutParams) params : null;
|
|
30
|
+
boolean fixed = params.width >= 0 || percent;
|
|
31
|
+
boolean preventStretch = fixed && flex != null && column
|
|
32
|
+
&& ((flex.alignSelf == -1 && parentStretch)
|
|
33
|
+
|| flex.alignSelf == FlexboxLayout.ALIGN_ITEMS_STRETCH);
|
|
34
|
+
if (!percent && !preventStretch) continue;
|
|
35
|
+
if (result == null) result = new ContentWidth();
|
|
36
|
+
result.changed.add(new Saved(params, flex));
|
|
37
|
+
if (percent) {
|
|
38
|
+
params.width = Math.round(available * params.widthPercent);
|
|
39
|
+
params.widthPercent = -1;
|
|
40
|
+
}
|
|
41
|
+
if (preventStretch) flex.alignSelf = FlexboxLayout.ALIGN_ITEMS_FLEX_START;
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@Override
|
|
47
|
+
public void close() {
|
|
48
|
+
for (Saved saved : changed) saved.restore();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
private static final class Saved {
|
|
52
|
+
final CommonLayoutParams params;
|
|
53
|
+
final FlexboxLayout.LayoutParams flex;
|
|
54
|
+
final int width;
|
|
55
|
+
final int original;
|
|
56
|
+
final float percent;
|
|
57
|
+
final int align;
|
|
58
|
+
|
|
59
|
+
Saved(CommonLayoutParams params, FlexboxLayout.LayoutParams flex) {
|
|
60
|
+
this.params = params;
|
|
61
|
+
this.flex = flex;
|
|
62
|
+
width = params.width;
|
|
63
|
+
original = params.widthOriginal;
|
|
64
|
+
percent = params.widthPercent;
|
|
65
|
+
align = flex == null ? -1 : flex.alignSelf;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
void restore() {
|
|
69
|
+
params.width = width;
|
|
70
|
+
// Core restores percent widths again in onLayout. Seed that restoration when
|
|
71
|
+
// our measurement resolved the percentage before Core had a chance to do so.
|
|
72
|
+
params.widthOriginal = percent > 0 && original == Integer.MIN_VALUE ? width : original;
|
|
73
|
+
params.widthPercent = percent;
|
|
74
|
+
if (flex != null) flex.alignSelf = align;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -2,23 +2,99 @@ package com.mavis.ui;
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context;
|
|
4
4
|
import android.view.View;
|
|
5
|
+
import android.view.View.MeasureSpec;
|
|
5
6
|
import org.nativescript.widgets.FlexboxLayout;
|
|
6
7
|
|
|
7
8
|
/** Keeps the cross-axis measurement in sync with the final width of flexible children. */
|
|
8
|
-
public class FlexLayout extends FlexboxLayout {
|
|
9
|
+
public class FlexLayout extends FlexboxLayout implements MeasureMemo.Owner {
|
|
10
|
+
private final MeasureMemo memo = new MeasureMemo();
|
|
11
|
+
|
|
9
12
|
public FlexLayout(Context context) {
|
|
10
13
|
super(context);
|
|
11
14
|
}
|
|
12
15
|
|
|
16
|
+
@Override
|
|
17
|
+
public int memoWidthSpec() {
|
|
18
|
+
return memo.receivedWidthSpec();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@Override
|
|
22
|
+
public int memoHeightSpec() {
|
|
23
|
+
return memo.receivedHeightSpec();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Android's view constructors already request layout, before this field exists.
|
|
27
|
+
@Override
|
|
28
|
+
public void requestLayout() {
|
|
29
|
+
if (memo != null) memo.invalidate();
|
|
30
|
+
super.requestLayout();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@Override
|
|
34
|
+
public void forceLayout() {
|
|
35
|
+
if (memo != null) memo.invalidate();
|
|
36
|
+
super.forceLayout();
|
|
37
|
+
}
|
|
38
|
+
|
|
13
39
|
@Override
|
|
14
40
|
protected void onMeasure(int widthSpec, int heightSpec) {
|
|
41
|
+
memo.receive(widthSpec, heightSpec);
|
|
42
|
+
if (memo.restore(this, widthSpec, heightSpec)) {
|
|
43
|
+
setMeasuredDimension(memo.widthAndState(), memo.heightAndState());
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
boolean column = getFlexDirection() == FLEX_DIRECTION_COLUMN
|
|
47
|
+
|| getFlexDirection() == FLEX_DIRECTION_COLUMN_REVERSE;
|
|
48
|
+
try (ContentWidth widths = ContentWidth.resolve(this, widthSpec, column)) {
|
|
49
|
+
measureContent(widthSpec, heightSpec);
|
|
50
|
+
}
|
|
51
|
+
memo.record(this, widthSpec, heightSpec, contentExceeds(widthSpec, heightSpec));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Core measures a looser request without shrinking, so the children's sizes tell whether the
|
|
55
|
+
// content wanted more room than the request allowed. Wrapping lines are not summed here.
|
|
56
|
+
private boolean contentExceeds(int widthSpec, int heightSpec) {
|
|
57
|
+
if (getFlexWrap() != FLEX_WRAP_NOWRAP) {
|
|
58
|
+
return MeasureSpec.getMode(widthSpec) == MeasureSpec.AT_MOST
|
|
59
|
+
|| MeasureSpec.getMode(heightSpec) == MeasureSpec.AT_MOST;
|
|
60
|
+
}
|
|
61
|
+
boolean horizontal = getFlexDirection() == FLEX_DIRECTION_ROW
|
|
62
|
+
|| getFlexDirection() == FLEX_DIRECTION_ROW_REVERSE;
|
|
63
|
+
int main = 0;
|
|
64
|
+
int cross = 0;
|
|
65
|
+
int visible = 0;
|
|
66
|
+
for (int i = 0, count = getChildCount(); i < count; i++) {
|
|
67
|
+
View child = getChildAt(i);
|
|
68
|
+
if (child.getVisibility() == View.GONE) continue;
|
|
69
|
+
LayoutParams params = (LayoutParams) child.getLayoutParams();
|
|
70
|
+
int width = child.getMeasuredWidth() + params.leftMargin + params.rightMargin;
|
|
71
|
+
int height = child.getMeasuredHeight() + params.topMargin + params.bottomMargin;
|
|
72
|
+
main += horizontal ? width : height;
|
|
73
|
+
cross = Math.max(cross, horizontal ? height : width);
|
|
74
|
+
visible++;
|
|
75
|
+
}
|
|
76
|
+
main += (horizontal ? getColumnGap() : getRowGap()) * Math.max(0, visible - 1);
|
|
77
|
+
int contentWidth = (horizontal ? main : cross) + getPaddingLeft() + getPaddingRight();
|
|
78
|
+
int contentHeight = (horizontal ? cross : main) + getPaddingTop() + getPaddingBottom();
|
|
79
|
+
return exceeds(widthSpec, contentWidth) || exceeds(heightSpec, contentHeight);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
private static boolean exceeds(int spec, int size) {
|
|
83
|
+
return MeasureSpec.getMode(spec) == MeasureSpec.AT_MOST && MeasureSpec.getSize(spec) < size;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
private void measureContent(int widthSpec, int heightSpec) {
|
|
15
87
|
boolean horizontal = getFlexDirection() == FLEX_DIRECTION_ROW
|
|
16
88
|
|| getFlexDirection() == FLEX_DIRECTION_ROW_REVERSE;
|
|
17
89
|
|
|
18
90
|
int count = getChildCount();
|
|
19
91
|
// Core restores percentage LayoutParams after layout. Android's measure cache can then
|
|
20
|
-
// return a result from an earlier pass with different resolved LayoutParams.
|
|
21
|
-
|
|
92
|
+
// return a result from an earlier pass with different resolved LayoutParams. Mavis
|
|
93
|
+
// layouts key their own memo on the specs, so only other views need the forced pass.
|
|
94
|
+
for (int i = 0; i < count; i++) {
|
|
95
|
+
View child = getChildAt(i);
|
|
96
|
+
if (!(child instanceof MeasureMemo.Owner)) child.forceLayout();
|
|
97
|
+
}
|
|
22
98
|
super.onMeasure(widthSpec, heightSpec);
|
|
23
99
|
|
|
24
100
|
int[] widths = new int[count];
|
|
@@ -40,7 +116,7 @@ public class FlexLayout extends FlexboxLayout {
|
|
|
40
116
|
params.flexGrow = 0;
|
|
41
117
|
params.flexShrink = 0;
|
|
42
118
|
}
|
|
43
|
-
child.forceLayout();
|
|
119
|
+
if (!(child instanceof MeasureMemo.Owner)) child.forceLayout();
|
|
44
120
|
}
|
|
45
121
|
try {
|
|
46
122
|
// Core's growth pass fixes the old height even when the new width unwraps text.
|
|
@@ -56,5 +132,26 @@ public class FlexLayout extends FlexboxLayout {
|
|
|
56
132
|
params.flexShrink = shrinks[i];
|
|
57
133
|
}
|
|
58
134
|
}
|
|
135
|
+
if (!horizontal && getFlexWrap() == FLEX_WRAP_NOWRAP && getRowGap() > 0) {
|
|
136
|
+
keepRowGaps(heightSpec);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Core adds row gaps to a column's main size but not to its gap total, so its growth and shrink
|
|
141
|
+
// passes report the column shorter by every gap. Measure the single line again with the gaps.
|
|
142
|
+
private void keepRowGaps(int heightSpec) {
|
|
143
|
+
int content = getPaddingTop() + getPaddingBottom();
|
|
144
|
+
int visible = 0;
|
|
145
|
+
for (int i = 0, count = getChildCount(); i < count; i++) {
|
|
146
|
+
View child = getChildAt(i);
|
|
147
|
+
if (child.getVisibility() == View.GONE) continue;
|
|
148
|
+
LayoutParams params = (LayoutParams) child.getLayoutParams();
|
|
149
|
+
content += child.getMeasuredHeight() + params.topMargin + params.bottomMargin;
|
|
150
|
+
visible++;
|
|
151
|
+
}
|
|
152
|
+
content += getRowGap() * Math.max(0, visible - 1);
|
|
153
|
+
content = Math.max(content, getSuggestedMinimumHeight());
|
|
154
|
+
int state = getMeasuredHeightAndState() & View.MEASURED_STATE_MASK;
|
|
155
|
+
setMeasuredDimension(getMeasuredWidthAndState(), resolveSizeAndState(content, heightSpec, state));
|
|
59
156
|
}
|
|
60
157
|
}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
package com.mavis.ui;
|
|
2
|
+
|
|
3
|
+
import android.view.View;
|
|
4
|
+
import android.view.View.MeasureSpec;
|
|
5
|
+
import android.view.ViewGroup;
|
|
6
|
+
import org.nativescript.widgets.CommonLayoutParams;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Remembers the last measurement of a layout while nothing in its subtree asked for layout.
|
|
10
|
+
*
|
|
11
|
+
* Android measures every view again whenever its parent asks while a layout request is pending,
|
|
12
|
+
* and flex containers ask several times per pass, so nested containers measure their leaves an
|
|
13
|
+
* exponential number of times. The memo answers a repeated request from the recorded result and
|
|
14
|
+
* measures again only the children that no longer hold that result.
|
|
15
|
+
*/
|
|
16
|
+
final class MeasureMemo {
|
|
17
|
+
/** Layouts that own a memo report the specs their latest measurement received. */
|
|
18
|
+
interface Owner {
|
|
19
|
+
int memoWidthSpec();
|
|
20
|
+
|
|
21
|
+
int memoHeightSpec();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
private boolean valid;
|
|
25
|
+
private boolean percentChildren;
|
|
26
|
+
private boolean clamped;
|
|
27
|
+
private int widthSpec;
|
|
28
|
+
private int heightSpec;
|
|
29
|
+
private int widthAndState;
|
|
30
|
+
private int heightAndState;
|
|
31
|
+
private int receivedWidthSpec;
|
|
32
|
+
private int receivedHeightSpec;
|
|
33
|
+
private int[] childWidthSpecs = new int[0];
|
|
34
|
+
private int[] childHeightSpecs = new int[0];
|
|
35
|
+
private int[] childWidths = new int[0];
|
|
36
|
+
private int[] childHeights = new int[0];
|
|
37
|
+
|
|
38
|
+
void invalidate() {
|
|
39
|
+
valid = false;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
int receivedWidthSpec() {
|
|
43
|
+
return receivedWidthSpec;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
int receivedHeightSpec() {
|
|
47
|
+
return receivedHeightSpec;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Records the specs of the measurement that is starting, memoized or not. */
|
|
51
|
+
void receive(int widthSpec, int heightSpec) {
|
|
52
|
+
receivedWidthSpec = widthSpec;
|
|
53
|
+
receivedHeightSpec = heightSpec;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** True when the recorded measurement answers these specs; children that changed are measured again. */
|
|
57
|
+
boolean restore(ViewGroup owner, int widthSpec, int heightSpec) {
|
|
58
|
+
if (!valid) return false;
|
|
59
|
+
if (!matches(widthSpec, this.widthSpec, widthAndState)) return false;
|
|
60
|
+
if (!matches(heightSpec, this.heightSpec, heightAndState)) return false;
|
|
61
|
+
int count = owner.getChildCount();
|
|
62
|
+
if (count != childWidthSpecs.length) {
|
|
63
|
+
valid = false;
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
for (int i = 0; i < count; i++) {
|
|
67
|
+
View child = owner.getChildAt(i);
|
|
68
|
+
if (child.getVisibility() == View.GONE) continue;
|
|
69
|
+
// A child still holding the recorded result was measured by this record's pass.
|
|
70
|
+
if (child.getMeasuredWidthAndState() == childWidths[i]
|
|
71
|
+
&& child.getMeasuredHeightAndState() == childHeights[i]) continue;
|
|
72
|
+
child.measure(childWidthSpecs[i], childHeightSpecs[i]);
|
|
73
|
+
}
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
int widthAndState() {
|
|
78
|
+
return widthAndState;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
int heightAndState() {
|
|
82
|
+
return heightAndState;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Stores the measurement that just completed with the result and specs every child last
|
|
87
|
+
* received. A clamped looser request is never reused for an exact size, which would shrink
|
|
88
|
+
* the children; Android keeps the too-small state only for widths.
|
|
89
|
+
*/
|
|
90
|
+
void record(ViewGroup owner, int widthSpec, int heightSpec, boolean clamped) {
|
|
91
|
+
this.widthSpec = widthSpec;
|
|
92
|
+
this.heightSpec = heightSpec;
|
|
93
|
+
this.clamped = clamped;
|
|
94
|
+
widthAndState = owner.getMeasuredWidthAndState();
|
|
95
|
+
heightAndState = owner.getMeasuredHeightAndState();
|
|
96
|
+
int count = owner.getChildCount();
|
|
97
|
+
if (childWidthSpecs.length != count) {
|
|
98
|
+
childWidthSpecs = new int[count];
|
|
99
|
+
childHeightSpecs = new int[count];
|
|
100
|
+
childWidths = new int[count];
|
|
101
|
+
childHeights = new int[count];
|
|
102
|
+
}
|
|
103
|
+
percentChildren = false;
|
|
104
|
+
for (int i = 0; i < count; i++) {
|
|
105
|
+
View child = owner.getChildAt(i);
|
|
106
|
+
ViewGroup.LayoutParams params = child.getLayoutParams();
|
|
107
|
+
if (params instanceof CommonLayoutParams) {
|
|
108
|
+
CommonLayoutParams common = (CommonLayoutParams) params;
|
|
109
|
+
if (common.widthPercent > 0 || common.heightPercent > 0) percentChildren = true;
|
|
110
|
+
}
|
|
111
|
+
childWidths[i] = child.getMeasuredWidthAndState();
|
|
112
|
+
childHeights[i] = child.getMeasuredHeightAndState();
|
|
113
|
+
if (child instanceof Owner) {
|
|
114
|
+
childWidthSpecs[i] = ((Owner) child).memoWidthSpec();
|
|
115
|
+
childHeightSpecs[i] = ((Owner) child).memoHeightSpec();
|
|
116
|
+
} else {
|
|
117
|
+
childWidthSpecs[i] = MeasureSpec.makeMeasureSpec(child.getMeasuredWidth(), MeasureSpec.EXACTLY);
|
|
118
|
+
childHeightSpecs[i] = MeasureSpec.makeMeasureSpec(child.getMeasuredHeight(), MeasureSpec.EXACTLY);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
valid = true;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** Whether a looser request on either axis returned its whole limit; for layouts that cannot tell. */
|
|
125
|
+
static boolean filledLimit(int widthSpec, int heightSpec, int widthAndState, int heightAndState) {
|
|
126
|
+
return filled(widthSpec, widthAndState) || filled(heightSpec, heightAndState);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
private static boolean filled(int spec, int sizeAndState) {
|
|
130
|
+
return MeasureSpec.getMode(spec) == MeasureSpec.AT_MOST
|
|
131
|
+
&& (sizeAndState & View.MEASURED_SIZE_MASK) >= MeasureSpec.getSize(spec);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// An exact request for the size a looser request produced is the same measurement, unless a
|
|
135
|
+
// child resolves a percentage against the request itself or the looser request clamped content
|
|
136
|
+
// that wanted more room: an exact size would then shrink the children instead.
|
|
137
|
+
private boolean matches(int spec, int recordedSpec, int recordedSizeAndState) {
|
|
138
|
+
if (spec == recordedSpec) return true;
|
|
139
|
+
if (percentChildren || clamped) return false;
|
|
140
|
+
if (MeasureSpec.getMode(spec) != MeasureSpec.EXACTLY) return false;
|
|
141
|
+
if (MeasureSpec.getMode(recordedSpec) == MeasureSpec.EXACTLY) return false;
|
|
142
|
+
if ((recordedSizeAndState & View.MEASURED_STATE_TOO_SMALL) != 0) return false;
|
|
143
|
+
return MeasureSpec.getSize(spec) == (recordedSizeAndState & View.MEASURED_SIZE_MASK);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
package com.mavis.ui;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
import android.view.MotionEvent;
|
|
5
|
+
import android.view.View;
|
|
6
|
+
import android.view.ViewConfiguration;
|
|
7
|
+
import android.view.ViewGroup;
|
|
8
|
+
import android.view.inputmethod.InputMethodManager;
|
|
9
|
+
import android.widget.EditText;
|
|
10
|
+
import org.nativescript.widgets.GridLayout;
|
|
11
|
+
|
|
12
|
+
/** The page container: puts the soft keyboard away on a tap outside the editor or on a drag. */
|
|
13
|
+
public class Screen extends GridLayout {
|
|
14
|
+
private final int slop;
|
|
15
|
+
private boolean dismissOnTap;
|
|
16
|
+
private boolean dismissOnDrag;
|
|
17
|
+
private boolean tracking;
|
|
18
|
+
private View editing;
|
|
19
|
+
private float downX;
|
|
20
|
+
private float downY;
|
|
21
|
+
|
|
22
|
+
public Screen(Context context) {
|
|
23
|
+
super(context);
|
|
24
|
+
slop = ViewConfiguration.get(context).getScaledTouchSlop();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
public void setKeyboardDismissal(boolean onTap, boolean onDrag) {
|
|
28
|
+
dismissOnTap = onTap;
|
|
29
|
+
dismissOnDrag = onDrag;
|
|
30
|
+
if (!onTap && !onDrag) tracking = false;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Every touch of the page passes here, so a tap on a button or a drag that the scroll view
|
|
34
|
+
// takes over still counts. The event itself is never consumed. Clicks run from the queue
|
|
35
|
+
// after the up event, so the tap waits its turn: a control that focused another editor
|
|
36
|
+
// meanwhile keeps that focus.
|
|
37
|
+
@Override
|
|
38
|
+
public boolean dispatchTouchEvent(MotionEvent event) {
|
|
39
|
+
switch (event.getActionMasked()) {
|
|
40
|
+
case MotionEvent.ACTION_DOWN:
|
|
41
|
+
downX = event.getRawX();
|
|
42
|
+
downY = event.getRawY();
|
|
43
|
+
editing = findFocus();
|
|
44
|
+
tracking = (dismissOnTap || dismissOnDrag)
|
|
45
|
+
&& editing instanceof EditText
|
|
46
|
+
&& !touchesEditor(this, downX, downY);
|
|
47
|
+
break;
|
|
48
|
+
case MotionEvent.ACTION_MOVE:
|
|
49
|
+
// Like the interactive mode on iOS, only a drag towards the keyboard puts it
|
|
50
|
+
// away; dragging the other way still scrolls the form while typing.
|
|
51
|
+
if (tracking && dismissOnDrag && event.getRawY() - downY > slop) {
|
|
52
|
+
tracking = false;
|
|
53
|
+
dismiss();
|
|
54
|
+
} else if (tracking && moved(event)) {
|
|
55
|
+
tracking = false;
|
|
56
|
+
}
|
|
57
|
+
break;
|
|
58
|
+
case MotionEvent.ACTION_UP:
|
|
59
|
+
if (tracking && dismissOnTap && !moved(event)) {
|
|
60
|
+
final View before = editing;
|
|
61
|
+
post(() -> {
|
|
62
|
+
if (findFocus() == before) dismiss();
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
tracking = false;
|
|
66
|
+
break;
|
|
67
|
+
case MotionEvent.ACTION_CANCEL:
|
|
68
|
+
tracking = false;
|
|
69
|
+
break;
|
|
70
|
+
default:
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
return super.dispatchTouchEvent(event);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private boolean moved(MotionEvent event) {
|
|
77
|
+
return Math.abs(event.getRawX() - downX) > slop || Math.abs(event.getRawY() - downY) > slop;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// A touch that starts on any editor keeps the keyboard: it focuses that editor or edits it.
|
|
81
|
+
private static boolean touchesEditor(View view, float x, float y) {
|
|
82
|
+
if (view.getVisibility() != View.VISIBLE) return false;
|
|
83
|
+
if (view instanceof EditText) {
|
|
84
|
+
int[] origin = new int[2];
|
|
85
|
+
view.getLocationOnScreen(origin);
|
|
86
|
+
return x >= origin[0] && x <= origin[0] + view.getWidth()
|
|
87
|
+
&& y >= origin[1] && y <= origin[1] + view.getHeight();
|
|
88
|
+
}
|
|
89
|
+
if (view instanceof ViewGroup) {
|
|
90
|
+
ViewGroup group = (ViewGroup) view;
|
|
91
|
+
for (int i = 0, count = group.getChildCount(); i < count; i++) {
|
|
92
|
+
if (touchesEditor(group.getChildAt(i), x, y)) return true;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Clearing the focus makes Core report blur and hide the keyboard; hiding it here as well
|
|
99
|
+
// covers editors that are not Core views.
|
|
100
|
+
private void dismiss() {
|
|
101
|
+
View focused = findFocus();
|
|
102
|
+
if (!(focused instanceof EditText)) return;
|
|
103
|
+
InputMethodManager manager =
|
|
104
|
+
(InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
|
105
|
+
if (manager != null) manager.hideSoftInputFromWindow(focused.getWindowToken(), 0);
|
|
106
|
+
focused.clearFocus();
|
|
107
|
+
}
|
|
108
|
+
}
|
package/src/app-icons.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createAppIconController, type AppIconChoice } from '@getcortexlabs/mavis-core'
|
|
2
|
+
import { nativeAppIcons } from './native/app-icons'
|
|
3
|
+
|
|
4
|
+
export interface NativeAppIcon extends AppIconChoice {
|
|
5
|
+
/** null for the primary icon; alternate names must appear in CFBundleAlternateIcons. */
|
|
6
|
+
iosName: string | null
|
|
7
|
+
/** Fully qualified activity-alias name, including the primary launcher alias. */
|
|
8
|
+
androidAlias: string
|
|
9
|
+
}
|
|
10
|
+
export interface AppIconsOptions {
|
|
11
|
+
primary: string
|
|
12
|
+
icons: readonly NativeAppIcon[]
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Optional integration: importing Mavis components never changes launcher configuration. */
|
|
16
|
+
export function createAppIcons(options: AppIconsOptions) {
|
|
17
|
+
const config = { primary: options.primary, icons: options.icons.map((icon) => ({ ...icon })) }
|
|
18
|
+
return createAppIconController(config.icons, config.primary, nativeAppIcons(config))
|
|
19
|
+
}
|
|
20
|
+
export { AppIconError } from '@getcortexlabs/mavis-core'
|
|
21
|
+
export type { AppIconController, AppIconChoice } from '@getcortexlabs/mavis-core'
|
package/src/files.ts
ADDED