@getcortexlabs/mavis 0.1.0-alpha.1 → 0.1.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/ChoiceControl.d.ts +111 -0
- package/dist/vue/components/ChoiceControl.d.ts.map +1 -0
- package/dist/vue/components/ChoiceControl.js +211 -0
- package/dist/vue/components/ChoiceControl.js.map +1 -0
- package/dist/vue/components/DateCalendar.d.ts +94 -0
- package/dist/vue/components/DateCalendar.d.ts.map +1 -0
- package/dist/vue/components/DateCalendar.js +96 -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/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/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/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/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 +50 -9
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +89 -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/ChoiceControl.ts +258 -0
- package/src/vue/components/DateCalendar.ts +117 -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/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/MVirtualList.ts +120 -0
- package/src/vue/components/configurator.ts +27 -0
- package/src/vue/components/layout.ts +24 -9
- package/src/vue/components/navigation.ts +19 -0
- package/src/vue/components/workflows.ts +38 -0
- package/src/vue/index.ts +183 -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,95 @@
|
|
|
1
|
+
import { Application } from '@nativescript/core'
|
|
2
|
+
import { SDK_VERSION } from '@nativescript/core/utils/constants'
|
|
3
|
+
import { AppIconError, type AppIconAdapter } from '@getcortexlabs/mavis-core'
|
|
4
|
+
import type { AppIconsOptions } from '../app-icons.js'
|
|
5
|
+
|
|
6
|
+
type Component = object
|
|
7
|
+
interface PackageManager {
|
|
8
|
+
getActivityInfo(
|
|
9
|
+
component: Component,
|
|
10
|
+
flags: number,
|
|
11
|
+
): { enabled: boolean; targetActivity: string | null }
|
|
12
|
+
getComponentEnabledSetting(component: Component): number
|
|
13
|
+
setComponentEnabledSetting(component: Component, state: number, flags: number): void
|
|
14
|
+
setComponentEnabledSettings(settings: object): void
|
|
15
|
+
}
|
|
16
|
+
declare const android: {
|
|
17
|
+
content: {
|
|
18
|
+
ComponentName: new (context: object, name: string) => Component
|
|
19
|
+
pm: {
|
|
20
|
+
PackageManager: {
|
|
21
|
+
ComponentEnabledSetting: new (component: Component, state: number, flags: number) => object
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
declare const java: { util: { ArrayList: new () => { add(value: object): void } } }
|
|
27
|
+
|
|
28
|
+
export function nativeAppIcons(options: AppIconsOptions): AppIconAdapter {
|
|
29
|
+
const aliases = new Set<string>()
|
|
30
|
+
for (const icon of options.icons) {
|
|
31
|
+
if (!/^[\w]+(?:\.[\w$]+)+$/.test(icon.androidAlias) || aliases.has(icon.androidAlias))
|
|
32
|
+
throw new AppIconError(
|
|
33
|
+
'configuration',
|
|
34
|
+
'Android needs unique fully qualified activity-alias names.',
|
|
35
|
+
)
|
|
36
|
+
aliases.add(icon.androidAlias)
|
|
37
|
+
}
|
|
38
|
+
const runtime = () => {
|
|
39
|
+
const context = Application.android.context
|
|
40
|
+
const manager = context.getPackageManager() as PackageManager
|
|
41
|
+
const choices = options.icons.map((icon) => {
|
|
42
|
+
const component = new android.content.ComponentName(context, icon.androidAlias)
|
|
43
|
+
const info = manager.getActivityInfo(component, 512) // MATCH_DISABLED_COMPONENTS
|
|
44
|
+
if (!info.targetActivity)
|
|
45
|
+
throw new AppIconError('configuration', `${icon.androidAlias} must be an activity-alias.`)
|
|
46
|
+
const state = manager.getComponentEnabledSetting(component)
|
|
47
|
+
return { ...icon, component, state, enabled: state === 1 || (state === 0 && info.enabled) }
|
|
48
|
+
})
|
|
49
|
+
return { manager, choices }
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
supported: () => Boolean(Application.android.context),
|
|
53
|
+
current() {
|
|
54
|
+
const enabled = runtime().choices.filter((icon) => icon.enabled)
|
|
55
|
+
return enabled.length === 1 ? enabled[0]!.id : undefined
|
|
56
|
+
},
|
|
57
|
+
async select(id) {
|
|
58
|
+
const { manager, choices } = runtime()
|
|
59
|
+
const next = choices.find((icon) => icon.id === id)!
|
|
60
|
+
try {
|
|
61
|
+
if (SDK_VERSION >= 33) {
|
|
62
|
+
const settings = new java.util.ArrayList()
|
|
63
|
+
for (const icon of choices)
|
|
64
|
+
settings.add(
|
|
65
|
+
new android.content.pm.PackageManager.ComponentEnabledSetting(
|
|
66
|
+
icon.component,
|
|
67
|
+
icon.id === id ? 1 : 2,
|
|
68
|
+
1,
|
|
69
|
+
),
|
|
70
|
+
)
|
|
71
|
+
manager.setComponentEnabledSettings(settings)
|
|
72
|
+
} else {
|
|
73
|
+
// Keep at least one launcher entry enabled throughout the non-atomic fallback.
|
|
74
|
+
manager.setComponentEnabledSetting(next.component, 1, 1) // ENABLED, DONT_KILL_APP
|
|
75
|
+
for (const icon of choices)
|
|
76
|
+
if (icon.id !== id) manager.setComponentEnabledSetting(icon.component, 2, 1)
|
|
77
|
+
}
|
|
78
|
+
} catch (cause) {
|
|
79
|
+
const rollback: unknown[] = []
|
|
80
|
+
for (const icon of [...choices].sort((a, b) => Number(b.enabled) - Number(a.enabled))) {
|
|
81
|
+
try {
|
|
82
|
+
manager.setComponentEnabledSetting(icon.component, icon.state, 1)
|
|
83
|
+
} catch (error) {
|
|
84
|
+
rollback.push(error)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
throw new AppIconError('platform', 'Android could not update launcher aliases.', {
|
|
88
|
+
cause: rollback.length
|
|
89
|
+
? new AggregateError([cause, ...rollback], 'Launcher rollback failed')
|
|
90
|
+
: cause,
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Utils } from '@nativescript/core'
|
|
2
|
+
import { AppIconError, type AppIconAdapter } from '@getcortexlabs/mavis-core'
|
|
3
|
+
import type { AppIconsOptions } from '../app-icons.js'
|
|
4
|
+
|
|
5
|
+
declare const UIApplication: {
|
|
6
|
+
sharedApplication: {
|
|
7
|
+
supportsAlternateIcons: boolean
|
|
8
|
+
alternateIconName: string | null
|
|
9
|
+
setAlternateIconNameCompletionHandler(
|
|
10
|
+
name: string | null,
|
|
11
|
+
complete: (error: { localizedDescription: string } | null) => void,
|
|
12
|
+
): void
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
interface Dictionary {
|
|
16
|
+
objectForKey(key: string): Dictionary | undefined
|
|
17
|
+
}
|
|
18
|
+
declare const NSBundle: {
|
|
19
|
+
mainBundle: { objectForInfoDictionaryKey(key: string): Dictionary | undefined }
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function nativeAppIcons(options: AppIconsOptions): AppIconAdapter {
|
|
23
|
+
const names = new Set<string | null>()
|
|
24
|
+
for (const icon of options.icons) {
|
|
25
|
+
if (
|
|
26
|
+
(icon.iosName !== null && typeof icon.iosName !== 'string') ||
|
|
27
|
+
(icon.id === options.primary) !== (icon.iosName === null) ||
|
|
28
|
+
names.has(icon.iosName) ||
|
|
29
|
+
icon.iosName === ''
|
|
30
|
+
)
|
|
31
|
+
throw new AppIconError(
|
|
32
|
+
'configuration',
|
|
33
|
+
'iOS needs one primary icon and unique alternate names.',
|
|
34
|
+
)
|
|
35
|
+
names.add(icon.iosName)
|
|
36
|
+
}
|
|
37
|
+
const application = () => UIApplication.sharedApplication
|
|
38
|
+
return {
|
|
39
|
+
supported: () => Boolean(application().supportsAlternateIcons),
|
|
40
|
+
current: () =>
|
|
41
|
+
options.icons.find((icon) => icon.iosName === (application().alternateIconName ?? null))?.id,
|
|
42
|
+
select(id) {
|
|
43
|
+
const icon = options.icons.find((choice) => choice.id === id)!
|
|
44
|
+
if (icon.iosName !== null) {
|
|
45
|
+
const declared = ['CFBundleIcons', 'CFBundleIcons~ipad'].some((key) =>
|
|
46
|
+
NSBundle.mainBundle
|
|
47
|
+
.objectForInfoDictionaryKey(key)
|
|
48
|
+
?.objectForKey('CFBundleAlternateIcons')
|
|
49
|
+
?.objectForKey(icon.iosName!),
|
|
50
|
+
)
|
|
51
|
+
if (!declared)
|
|
52
|
+
return Promise.reject(
|
|
53
|
+
new AppIconError('configuration', `Missing bundled alternate icon: ${icon.iosName}`),
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
return new Promise((resolve, reject) => {
|
|
57
|
+
Utils.executeOnMainThread(() => {
|
|
58
|
+
try {
|
|
59
|
+
application().setAlternateIconNameCompletionHandler(icon.iosName, (error) => {
|
|
60
|
+
// UIKit may invoke completion away from its main queue.
|
|
61
|
+
Utils.executeOnMainThread(() =>
|
|
62
|
+
error
|
|
63
|
+
? reject(new AppIconError('platform', error.localizedDescription))
|
|
64
|
+
: resolve(),
|
|
65
|
+
)
|
|
66
|
+
})
|
|
67
|
+
} catch (cause) {
|
|
68
|
+
reject(new AppIconError('platform', 'iOS could not change the app icon.', { cause }))
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
})
|
|
72
|
+
},
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AppIconAdapter } from '@getcortexlabs/mavis-core'
|
|
2
|
+
import { AppIconError } from '@getcortexlabs/mavis-core'
|
|
3
|
+
import type { AppIconsOptions } from '../app-icons.js'
|
|
4
|
+
|
|
5
|
+
export function nativeAppIcons(_options: AppIconsOptions): AppIconAdapter {
|
|
6
|
+
return {
|
|
7
|
+
supported: () => false,
|
|
8
|
+
current: () => undefined,
|
|
9
|
+
select: () =>
|
|
10
|
+
Promise.reject(new AppIconError('unsupported', 'App icons require iOS or Android.')),
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Application, Utils } from '@nativescript/core'
|
|
2
|
+
import type { Appearance, AppearanceSource } from '@getcortexlabs/mavis-core/vue'
|
|
3
|
+
|
|
4
|
+
interface Configuration {
|
|
5
|
+
uiMode: number
|
|
6
|
+
}
|
|
7
|
+
interface Context {
|
|
8
|
+
getResources(): { getConfiguration(): Configuration }
|
|
9
|
+
registerComponentCallbacks(callbacks: object): void
|
|
10
|
+
unregisterComponentCallbacks(callbacks: object): void
|
|
11
|
+
}
|
|
12
|
+
declare const android: {
|
|
13
|
+
content: {
|
|
14
|
+
ComponentCallbacks2: new (implementation: {
|
|
15
|
+
onConfigurationChanged(configuration: Configuration): void
|
|
16
|
+
onLowMemory(): void
|
|
17
|
+
onTrimMemory(level: number): void
|
|
18
|
+
}) => object
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// android.content.res.Configuration.UI_MODE_NIGHT_MASK and UI_MODE_NIGHT_YES.
|
|
23
|
+
const NIGHT_MASK = 0x30
|
|
24
|
+
const NIGHT_YES = 0x20
|
|
25
|
+
|
|
26
|
+
function context(): Context | undefined {
|
|
27
|
+
try {
|
|
28
|
+
return Utils.android.getApplicationContext() as Context
|
|
29
|
+
} catch {
|
|
30
|
+
// The application context does not exist before launch.
|
|
31
|
+
return undefined
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const appearanceOf = (configuration: Configuration): Appearance =>
|
|
36
|
+
(configuration.uiMode & NIGHT_MASK) === NIGHT_YES ? 'dark' : 'light'
|
|
37
|
+
|
|
38
|
+
/** Reads `uiMode` from the application configuration directly; Core's window cache can lag on older devices. */
|
|
39
|
+
export function systemAppearance(): AppearanceSource {
|
|
40
|
+
return {
|
|
41
|
+
current() {
|
|
42
|
+
const app = context()
|
|
43
|
+
return app ? appearanceOf(app.getResources().getConfiguration()) : undefined
|
|
44
|
+
},
|
|
45
|
+
observe(listener) {
|
|
46
|
+
let registered: { app: Context; callbacks: object } | undefined
|
|
47
|
+
const register = () => {
|
|
48
|
+
const app = context()
|
|
49
|
+
if (!app || registered) return
|
|
50
|
+
const callbacks = new android.content.ComponentCallbacks2({
|
|
51
|
+
onConfigurationChanged: (configuration) => listener(appearanceOf(configuration)),
|
|
52
|
+
onLowMemory() {},
|
|
53
|
+
onTrimMemory() {},
|
|
54
|
+
})
|
|
55
|
+
app.registerComponentCallbacks(callbacks)
|
|
56
|
+
registered = { app, callbacks }
|
|
57
|
+
listener(appearanceOf(app.getResources().getConfiguration()))
|
|
58
|
+
}
|
|
59
|
+
// An Android 8 phone skipped one of four configuration deliveries; resuming re-reads it.
|
|
60
|
+
const resumed = () => {
|
|
61
|
+
const app = context()
|
|
62
|
+
if (app) listener(appearanceOf(app.getResources().getConfiguration()))
|
|
63
|
+
}
|
|
64
|
+
register()
|
|
65
|
+
Application.on(Application.launchEvent, register)
|
|
66
|
+
Application.on(Application.resumeEvent, resumed)
|
|
67
|
+
return () => {
|
|
68
|
+
Application.off(Application.launchEvent, register)
|
|
69
|
+
Application.off(Application.resumeEvent, resumed)
|
|
70
|
+
registered?.app.unregisterComponentCallbacks(registered.callbacks)
|
|
71
|
+
registered = undefined
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Application } from '@nativescript/core'
|
|
2
|
+
import type { Appearance, AppearanceSource } from '@getcortexlabs/mavis-core/vue'
|
|
3
|
+
|
|
4
|
+
function read(): Appearance | undefined {
|
|
5
|
+
try {
|
|
6
|
+
return (
|
|
7
|
+
Application.primaryWindow?.systemAppearance() ?? Application.systemAppearance() ?? undefined
|
|
8
|
+
)
|
|
9
|
+
} catch {
|
|
10
|
+
// Android has no application context before launch; the launch event resolves it below.
|
|
11
|
+
return undefined
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Core reports the primary window's appearance and raises `systemAppearanceChanged` on changes. */
|
|
16
|
+
export function systemAppearance(): AppearanceSource {
|
|
17
|
+
return {
|
|
18
|
+
current: read,
|
|
19
|
+
observe(listener) {
|
|
20
|
+
const changed = (args: { newValue: Appearance }) => listener(args.newValue)
|
|
21
|
+
const launched = () => {
|
|
22
|
+
const value = read()
|
|
23
|
+
if (value) listener(value)
|
|
24
|
+
}
|
|
25
|
+
Application.on(Application.systemAppearanceChangedEvent, changed)
|
|
26
|
+
Application.on(Application.launchEvent, launched)
|
|
27
|
+
return () => {
|
|
28
|
+
Application.off(Application.systemAppearanceChangedEvent, changed)
|
|
29
|
+
Application.off(Application.launchEvent, launched)
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ImageSource, Utils } from '@nativescript/core'
|
|
2
|
+
|
|
3
|
+
/** Use Core decoding without leaving rejected local-image promises unhandled. */
|
|
4
|
+
export function loadAvatarImage(src: string): Promise<ImageSource | null> {
|
|
5
|
+
if (Utils.isDataURI(src)) return ImageSource.fromBase64(src.slice(src.indexOf(',') + 1))
|
|
6
|
+
if (src.startsWith('res://')) return ImageSource.fromResource(src.slice(6))
|
|
7
|
+
if (Utils.isFileOrResourcePath(src)) return ImageSource.fromFile(src)
|
|
8
|
+
return ImageSource.fromUrl(src)
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Label, Utils } from '@nativescript/core'
|
|
2
|
+
import { fontSizeProperty } from '@nativescript/core/ui/styling/style-properties'
|
|
3
|
+
|
|
4
|
+
declare const android: { util: { TypedValue: { COMPLEX_UNIT_PX: number } } }
|
|
5
|
+
|
|
6
|
+
/** Initials are a fixed visual mark; the adjacent name remains scalable text. */
|
|
7
|
+
export class MavisAvatarLabel extends Label {
|
|
8
|
+
[fontSizeProperty.setNative](value: number | { nativeSize: number }) {
|
|
9
|
+
this.nativeTextViewProtected.setTextSize(
|
|
10
|
+
android.util.TypedValue.COMPLEX_UNIT_PX,
|
|
11
|
+
typeof value === 'number' ? Utils.layout.toDevicePixels(value) : value.nativeSize,
|
|
12
|
+
)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MavisLabel as MavisAvatarLabel } from './label'
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GridLayout } from '@nativescript/core'
|
|
2
|
+
|
|
3
|
+
declare const com: {
|
|
4
|
+
mavis: { ui: { Box: new (context: unknown) => object } }
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export class MavisBox extends GridLayout {
|
|
8
|
+
createNativeView() {
|
|
9
|
+
return new com.mavis.ui.Box(this._context)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { GridLayout, Utils } from '@nativescript/core'
|
|
2
|
+
import {
|
|
3
|
+
filledLimit,
|
|
4
|
+
layoutChildren,
|
|
5
|
+
recordMeasurement,
|
|
6
|
+
reuseMeasurement,
|
|
7
|
+
type MeasureRecord,
|
|
8
|
+
} from './measure-memo'
|
|
9
|
+
|
|
10
|
+
const { layout } = Utils
|
|
11
|
+
|
|
12
|
+
/** An auto-height Box takes its content height when the parent only limits the available space. */
|
|
13
|
+
export class MavisBox extends GridLayout {
|
|
14
|
+
measureRecord?: MeasureRecord
|
|
15
|
+
|
|
16
|
+
measure(widthSpec: number, heightSpec: number) {
|
|
17
|
+
if (reuseMeasurement(this, widthSpec, heightSpec)) return
|
|
18
|
+
super.measure(widthSpec, heightSpec)
|
|
19
|
+
const measured = this as unknown as { _measuredWidth: number; _measuredHeight: number }
|
|
20
|
+
recordMeasurement(
|
|
21
|
+
this,
|
|
22
|
+
widthSpec,
|
|
23
|
+
heightSpec,
|
|
24
|
+
layoutChildren(this),
|
|
25
|
+
filledLimit(widthSpec, heightSpec, measured._measuredWidth, measured._measuredHeight),
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
requestLayout() {
|
|
30
|
+
this.measureRecord = undefined
|
|
31
|
+
super.requestLayout()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
onMeasure(widthSpec: number, heightSpec: number) {
|
|
35
|
+
const relaxed =
|
|
36
|
+
this.effectiveHeight < 0 && layout.getMeasureSpecMode(heightSpec) === layout.AT_MOST
|
|
37
|
+
? layout.makeMeasureSpec(0, layout.UNSPECIFIED)
|
|
38
|
+
: heightSpec
|
|
39
|
+
// Grid calculates cell sizes from the arguments, but View.measureChild resolves a
|
|
40
|
+
// percentage from the parent's stored spec. Supply the content width for that lookup.
|
|
41
|
+
const measurement = this as unknown as { _currentWidthMeasureSpec: number }
|
|
42
|
+
const original = measurement._currentWidthMeasureSpec
|
|
43
|
+
const contentWidth = Math.max(
|
|
44
|
+
0,
|
|
45
|
+
layout.getMeasureSpecSize(widthSpec) -
|
|
46
|
+
this.effectivePaddingLeft -
|
|
47
|
+
this.effectivePaddingRight -
|
|
48
|
+
this.effectiveBorderLeftWidth -
|
|
49
|
+
this.effectiveBorderRightWidth,
|
|
50
|
+
)
|
|
51
|
+
measurement._currentWidthMeasureSpec = layout.makeMeasureSpec(
|
|
52
|
+
contentWidth,
|
|
53
|
+
layout.getMeasureSpecMode(widthSpec),
|
|
54
|
+
)
|
|
55
|
+
try {
|
|
56
|
+
super.onMeasure(widthSpec, relaxed)
|
|
57
|
+
} finally {
|
|
58
|
+
measurement._currentWidthMeasureSpec = original
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Button, type FormattedString } from '@nativescript/core'
|
|
2
|
+
import { formattedTextProperty } from '@nativescript/core/ui/text-base'
|
|
3
|
+
import {
|
|
4
|
+
accessibilityLabelProperty,
|
|
5
|
+
accessibilityValueProperty,
|
|
6
|
+
} from '@nativescript/core/accessibility/accessibility-properties'
|
|
7
|
+
|
|
8
|
+
type Setter = (this: Button, value: unknown) => void
|
|
9
|
+
const base = Button.prototype as unknown as Record<symbol, Setter>
|
|
10
|
+
const setLabel = base[accessibilityLabelProperty.setNative]!
|
|
11
|
+
const setValue = base[accessibilityValueProperty.setNative]!
|
|
12
|
+
const setFormatted = base[formattedTextProperty.setNative]!
|
|
13
|
+
|
|
14
|
+
/** Core copies formatted text into `text`, so its description would repeat the label after icon glyphs. */
|
|
15
|
+
export class MavisButton extends Button {
|
|
16
|
+
[accessibilityLabelProperty.setNative](value: string) {
|
|
17
|
+
setLabel.call(this, value)
|
|
18
|
+
this.describe()
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
[accessibilityValueProperty.setNative](value: string) {
|
|
22
|
+
setValue.call(this, value)
|
|
23
|
+
this.describe()
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[formattedTextProperty.setNative](value: FormattedString) {
|
|
27
|
+
setFormatted.call(this, value)
|
|
28
|
+
this.describe()
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
private describe() {
|
|
32
|
+
if (!this.formattedText) return
|
|
33
|
+
const description = [this.accessibilityLabel, this.accessibilityValue]
|
|
34
|
+
.filter(Boolean)
|
|
35
|
+
.join('. ')
|
|
36
|
+
this.nativeViewProtected?.setContentDescription(description)
|
|
37
|
+
}
|
|
38
|
+
}
|
package/src/native/button.ios.ts
CHANGED
|
@@ -1,6 +1,58 @@
|
|
|
1
|
-
import { Button } from '@nativescript/core'
|
|
1
|
+
import { Button, Font, type Span } from '@nativescript/core'
|
|
2
|
+
import { fontScaleInternalProperty } from '@nativescript/core/ui/styling/style-properties'
|
|
3
|
+
import { recordMeasurement, reuseMeasurement, type MeasureRecord } from './measure-memo'
|
|
4
|
+
import { applyDynamicType, dynamicTypeScale } from './dynamic-type'
|
|
5
|
+
|
|
6
|
+
interface SpanDetails {
|
|
7
|
+
iosFont: unknown
|
|
8
|
+
baselineOffset: number
|
|
9
|
+
}
|
|
10
|
+
interface FormattedText {
|
|
11
|
+
createMutableStringDetails(span: Span, text: string, index?: number): SpanDetails
|
|
12
|
+
getBaselineOffset(font: unknown, align: unknown): number
|
|
13
|
+
}
|
|
14
|
+
const formatted = Button.prototype as unknown as FormattedText
|
|
2
15
|
|
|
3
16
|
export class MavisButton extends Button {
|
|
17
|
+
measureRecord?: MeasureRecord;
|
|
18
|
+
|
|
19
|
+
[fontScaleInternalProperty.setNative]() {
|
|
20
|
+
applyDynamicType(this)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Icon buttons render their label as spans, which Core scales with its own table too.
|
|
24
|
+
createMutableStringDetails(span: Span, text: string, index?: number) {
|
|
25
|
+
const details = formatted.createMutableStringDetails.call(this, span, text, index)
|
|
26
|
+
const { style } = span
|
|
27
|
+
const size = style.fontSize ?? this.style.fontSize
|
|
28
|
+
const font = new Font(
|
|
29
|
+
style.fontFamily,
|
|
30
|
+
style.fontSize,
|
|
31
|
+
style.fontStyle,
|
|
32
|
+
style.fontWeight,
|
|
33
|
+
dynamicTypeScale(this, size),
|
|
34
|
+
style.fontVariationSettings,
|
|
35
|
+
)
|
|
36
|
+
details.iosFont = font.getUIFont(this.nativeTextViewProtected.font)
|
|
37
|
+
details.baselineOffset = formatted.getBaselineOffset.call(
|
|
38
|
+
this,
|
|
39
|
+
details.iosFont,
|
|
40
|
+
style.verticalAlignment,
|
|
41
|
+
)
|
|
42
|
+
return details
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
measure(widthSpec: number, heightSpec: number) {
|
|
46
|
+
if (reuseMeasurement(this, widthSpec, heightSpec)) return
|
|
47
|
+
super.measure(widthSpec, heightSpec)
|
|
48
|
+
recordMeasurement(this, widthSpec, heightSpec)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
requestLayout() {
|
|
52
|
+
this.measureRecord = undefined
|
|
53
|
+
super.requestLayout()
|
|
54
|
+
}
|
|
55
|
+
|
|
4
56
|
onMeasure(widthSpec: number, heightSpec: number) {
|
|
5
57
|
const button = this.ios
|
|
6
58
|
// UIButton updates titleLabel during its layout pass. Wrapped measurement needs the
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { View } from '@nativescript/core'
|
|
2
|
+
import { SDK_VERSION } from '@nativescript/core/utils/constants'
|
|
3
|
+
|
|
4
|
+
declare const android: {
|
|
5
|
+
view: {
|
|
6
|
+
View: {
|
|
7
|
+
OnFocusChangeListener: new (listener: {
|
|
8
|
+
onFocusChange(view: unknown, focused: boolean): void
|
|
9
|
+
}) => object
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function mixedValue(indeterminate: boolean, label: string) {
|
|
15
|
+
return indeterminate && SDK_VERSION < 30 ? label : ''
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function observeCheckbox(view: View, focus: (focused: boolean) => void) {
|
|
19
|
+
const button = view.android
|
|
20
|
+
const listener = new android.view.View.OnFocusChangeListener({
|
|
21
|
+
onFocusChange: (_view: unknown, focused: boolean) => focus(focused),
|
|
22
|
+
})
|
|
23
|
+
button.setOnFocusChangeListener(listener)
|
|
24
|
+
focus(button.hasFocus())
|
|
25
|
+
return {
|
|
26
|
+
setMixed(label: string | undefined) {
|
|
27
|
+
if (SDK_VERSION >= 30) button.setStateDescription(label ?? null)
|
|
28
|
+
},
|
|
29
|
+
dispose() {
|
|
30
|
+
if (button.getOnFocusChangeListener() === listener) button.setOnFocusChangeListener(null)
|
|
31
|
+
if (SDK_VERSION >= 30) button.setStateDescription(null)
|
|
32
|
+
focus(false)
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { View } from '@nativescript/core'
|
|
2
|
+
|
|
3
|
+
export function mixedValue(indeterminate: boolean, label: string) {
|
|
4
|
+
return indeterminate ? label : ''
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function observeCheckbox(_view: View, _focus: (focused: boolean) => void) {
|
|
8
|
+
return { setMixed(_label: string | undefined) {}, dispose() {} }
|
|
9
|
+
}
|