@getcortexlabs/mavis 0.1.0-alpha.1 → 0.1.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -5
- package/dist/app-icons.d.ts +26 -0
- package/dist/app-icons.d.ts.map +1 -0
- package/dist/app-icons.js +9 -0
- package/dist/app-icons.js.map +1 -0
- package/dist/date-format.d.ts +3 -0
- package/dist/date-format.d.ts.map +1 -0
- package/dist/date-format.js +2 -0
- package/dist/date-format.js.map +1 -0
- package/dist/files.d.ts +4 -0
- package/dist/files.d.ts.map +1 -0
- package/dist/files.js +3 -0
- package/dist/files.js.map +1 -0
- package/dist/native/app-icons.android.d.ts +4 -0
- package/dist/native/app-icons.android.d.ts.map +1 -0
- package/dist/native/app-icons.android.js +67 -0
- package/dist/native/app-icons.android.js.map +1 -0
- package/dist/native/app-icons.d.ts +4 -0
- package/dist/native/app-icons.d.ts.map +1 -0
- package/dist/native/app-icons.ios.d.ts +4 -0
- package/dist/native/app-icons.ios.d.ts.map +1 -0
- package/dist/native/app-icons.ios.js +45 -0
- package/dist/native/app-icons.ios.js.map +1 -0
- package/dist/native/app-icons.js +9 -0
- package/dist/native/app-icons.js.map +1 -0
- package/dist/native/appearance.android.d.ts +4 -0
- package/dist/native/appearance.android.d.ts.map +1 -0
- package/dist/native/appearance.android.js +55 -0
- package/dist/native/appearance.android.js.map +1 -0
- package/dist/native/appearance.d.ts +4 -0
- package/dist/native/appearance.d.ts.map +1 -0
- package/dist/native/appearance.js +31 -0
- package/dist/native/appearance.js.map +1 -0
- package/dist/native/avatar-image.d.ts +4 -0
- package/dist/native/avatar-image.d.ts.map +1 -0
- package/dist/native/avatar-image.js +12 -0
- package/dist/native/avatar-image.js.map +1 -0
- package/dist/native/avatar-label.android.d.ts +9 -0
- package/dist/native/avatar-label.android.d.ts.map +1 -0
- package/dist/native/avatar-label.android.js +9 -0
- package/dist/native/avatar-label.android.js.map +1 -0
- package/dist/native/avatar-label.d.ts +2 -0
- package/dist/native/avatar-label.d.ts.map +1 -0
- package/dist/native/avatar-label.js +2 -0
- package/dist/native/avatar-label.js.map +1 -0
- package/dist/native/box.android.d.ts +5 -0
- package/dist/native/box.android.d.ts.map +1 -0
- package/dist/native/box.android.js +7 -0
- package/dist/native/box.android.js.map +1 -0
- package/dist/native/box.d.ts +2 -0
- package/dist/native/box.d.ts.map +1 -0
- package/dist/native/box.ios.d.ts +10 -0
- package/dist/native/box.ios.d.ts.map +1 -0
- package/dist/native/box.ios.js +40 -0
- package/dist/native/box.ios.js.map +1 -0
- package/dist/native/box.js +3 -0
- package/dist/native/box.js.map +1 -0
- package/dist/native/button.android.d.ts +11 -0
- package/dist/native/button.android.d.ts.map +1 -0
- package/dist/native/button.android.js +31 -0
- package/dist/native/button.android.js.map +1 -0
- package/dist/native/button.ios.d.ts +13 -1
- package/dist/native/button.ios.d.ts.map +1 -1
- package/dist/native/button.ios.js +29 -1
- package/dist/native/button.ios.js.map +1 -1
- package/dist/native/checkbox.android.d.ts +7 -0
- package/dist/native/checkbox.android.d.ts.map +1 -0
- package/dist/native/checkbox.android.js +26 -0
- package/dist/native/checkbox.android.js.map +1 -0
- package/dist/native/checkbox.d.ts +7 -0
- package/dist/native/checkbox.d.ts.map +1 -0
- package/dist/native/checkbox.js +7 -0
- package/dist/native/checkbox.js.map +1 -0
- package/dist/native/collection-motion.d.ts +5 -0
- package/dist/native/collection-motion.d.ts.map +1 -0
- package/dist/native/collection-motion.js +157 -0
- package/dist/native/collection-motion.js.map +1 -0
- package/dist/native/combobox-editor.android.d.ts +3 -0
- package/dist/native/combobox-editor.android.d.ts.map +1 -0
- package/dist/native/combobox-editor.android.js +5 -0
- package/dist/native/combobox-editor.android.js.map +1 -0
- package/dist/native/combobox-editor.d.ts +4 -0
- package/dist/native/combobox-editor.d.ts.map +1 -0
- package/dist/native/combobox-editor.js +5 -0
- package/dist/native/combobox-editor.js.map +1 -0
- package/dist/native/composed-button.android.d.ts +4 -0
- package/dist/native/composed-button.android.d.ts.map +1 -0
- package/dist/native/composed-button.android.js +53 -0
- package/dist/native/composed-button.android.js.map +1 -0
- package/dist/native/composed-button.d.ts +3 -0
- package/dist/native/composed-button.d.ts.map +1 -0
- package/dist/native/composed-button.js +4 -0
- package/dist/native/composed-button.js.map +1 -0
- package/dist/native/date-format.android.d.ts +5 -0
- package/dist/native/date-format.android.d.ts.map +1 -0
- package/dist/native/date-format.android.js +39 -0
- package/dist/native/date-format.android.js.map +1 -0
- package/dist/native/date-format.d.ts +6 -0
- package/dist/native/date-format.d.ts.map +1 -0
- package/dist/native/date-format.ios.d.ts +5 -0
- package/dist/native/date-format.ios.d.ts.map +1 -0
- package/dist/native/date-format.ios.js +29 -0
- package/dist/native/date-format.ios.js.map +1 -0
- package/dist/native/date-format.js +8 -0
- package/dist/native/date-format.js.map +1 -0
- package/dist/native/dialog.android.d.ts +12 -0
- package/dist/native/dialog.android.d.ts.map +1 -0
- package/dist/native/dialog.android.js +46 -0
- package/dist/native/dialog.android.js.map +1 -0
- package/dist/native/dialog.d.ts +12 -0
- package/dist/native/dialog.d.ts.map +1 -0
- package/dist/native/dialog.ios.d.ts +12 -0
- package/dist/native/dialog.ios.d.ts.map +1 -0
- package/dist/native/dialog.ios.js +13 -0
- package/dist/native/dialog.ios.js.map +1 -0
- package/dist/native/dialog.js +4 -0
- package/dist/native/dialog.js.map +1 -0
- package/dist/native/dynamic-type.d.ts +15 -0
- package/dist/native/dynamic-type.d.ts.map +1 -0
- package/dist/native/dynamic-type.js +47 -0
- package/dist/native/dynamic-type.js.map +1 -0
- package/dist/native/file-access.d.ts +23 -0
- package/dist/native/file-access.d.ts.map +1 -0
- package/dist/native/file-access.js +55 -0
- package/dist/native/file-access.js.map +1 -0
- package/dist/native/file-picker.android.d.ts +3 -0
- package/dist/native/file-picker.android.d.ts.map +1 -0
- package/dist/native/file-picker.android.js +147 -0
- package/dist/native/file-picker.android.js.map +1 -0
- package/dist/native/file-picker.d.ts +4 -0
- package/dist/native/file-picker.d.ts.map +1 -0
- package/dist/native/file-picker.ios.d.ts +3 -0
- package/dist/native/file-picker.ios.d.ts.map +1 -0
- package/dist/native/file-picker.ios.js +152 -0
- package/dist/native/file-picker.ios.js.map +1 -0
- package/dist/native/file-picker.js +7 -0
- package/dist/native/file-picker.js.map +1 -0
- package/dist/native/flex-children.d.ts +4 -0
- package/dist/native/flex-children.d.ts.map +1 -0
- package/dist/native/flex-children.js +12 -0
- package/dist/native/flex-children.js.map +1 -0
- package/dist/native/flex-layout.android.d.ts +3 -1
- package/dist/native/flex-layout.android.d.ts.map +1 -1
- package/dist/native/flex-layout.android.js +9 -0
- package/dist/native/flex-layout.android.js.map +1 -1
- package/dist/native/flex-layout.ios.d.ts +14 -1
- package/dist/native/flex-layout.ios.d.ts.map +1 -1
- package/dist/native/flex-layout.ios.js +113 -0
- package/dist/native/flex-layout.ios.js.map +1 -1
- package/dist/native/image-effects.d.ts +11 -0
- package/dist/native/image-effects.d.ts.map +1 -0
- package/dist/native/image-effects.js +61 -0
- package/dist/native/image-effects.js.map +1 -0
- package/dist/native/input-action.d.ts +5 -0
- package/dist/native/input-action.d.ts.map +1 -0
- package/dist/native/input-action.js +13 -0
- package/dist/native/input-action.js.map +1 -0
- package/dist/native/keyboard-dismiss.android.d.ts +8 -0
- package/dist/native/keyboard-dismiss.android.d.ts.map +1 -0
- package/dist/native/keyboard-dismiss.android.js +9 -0
- package/dist/native/keyboard-dismiss.android.js.map +1 -0
- package/dist/native/keyboard-dismiss.d.ts +10 -0
- package/dist/native/keyboard-dismiss.d.ts.map +1 -0
- package/dist/native/keyboard-dismiss.ios.d.ts +8 -0
- package/dist/native/keyboard-dismiss.ios.d.ts.map +1 -0
- package/dist/native/keyboard-dismiss.ios.js +91 -0
- package/dist/native/keyboard-dismiss.ios.js.map +1 -0
- package/dist/native/keyboard-dismiss.js +6 -0
- package/dist/native/keyboard-dismiss.js.map +1 -0
- package/dist/native/label.android.d.ts +12 -0
- package/dist/native/label.android.d.ts.map +1 -0
- package/dist/native/label.android.js +19 -0
- package/dist/native/label.android.js.map +1 -0
- package/dist/native/label.ios.d.ts +14 -1
- package/dist/native/label.ios.d.ts.map +1 -1
- package/dist/native/label.ios.js +37 -1
- package/dist/native/label.ios.js.map +1 -1
- package/dist/native/measure-memo.d.ts +37 -0
- package/dist/native/measure-memo.d.ts.map +1 -0
- package/dist/native/measure-memo.js +82 -0
- package/dist/native/measure-memo.js.map +1 -0
- package/dist/native/motion-owner.d.ts +5 -0
- package/dist/native/motion-owner.d.ts.map +1 -0
- package/dist/native/motion-owner.js +58 -0
- package/dist/native/motion-owner.js.map +1 -0
- package/dist/native/motion-region.d.ts +7 -0
- package/dist/native/motion-region.d.ts.map +1 -0
- package/dist/native/motion-region.js +249 -0
- package/dist/native/motion-region.js.map +1 -0
- package/dist/native/motion-surface.d.ts +9 -0
- package/dist/native/motion-surface.d.ts.map +1 -0
- package/dist/native/motion-surface.js +229 -0
- package/dist/native/motion-surface.js.map +1 -0
- package/dist/native/platform-motion.d.ts +5 -0
- package/dist/native/platform-motion.d.ts.map +1 -0
- package/dist/native/platform-motion.js +90 -0
- package/dist/native/platform-motion.js.map +1 -0
- package/dist/native/press.d.ts +8 -2
- package/dist/native/press.d.ts.map +1 -1
- package/dist/native/press.js +58 -8
- package/dist/native/press.js.map +1 -1
- package/dist/native/progress.d.ts +7 -0
- package/dist/native/progress.d.ts.map +1 -0
- package/dist/native/progress.js +77 -0
- package/dist/native/progress.js.map +1 -0
- package/dist/native/screen.android.d.ts +6 -0
- package/dist/native/screen.android.d.ts.map +1 -0
- package/dist/native/screen.android.js +8 -0
- package/dist/native/screen.android.js.map +1 -0
- package/dist/native/screen.d.ts +2 -0
- package/dist/native/screen.d.ts.map +1 -0
- package/dist/native/screen.js +3 -0
- package/dist/native/screen.js.map +1 -0
- package/dist/native/scroll-motion.d.ts +12 -0
- package/dist/native/scroll-motion.d.ts.map +1 -0
- package/dist/native/scroll-motion.js +100 -0
- package/dist/native/scroll-motion.js.map +1 -0
- package/dist/native/section-scroll.d.ts +9 -0
- package/dist/native/section-scroll.d.ts.map +1 -0
- package/dist/native/section-scroll.js +69 -0
- package/dist/native/section-scroll.js.map +1 -0
- package/dist/native/segmented.d.ts +14 -0
- package/dist/native/segmented.d.ts.map +1 -0
- package/dist/native/segmented.js +86 -0
- package/dist/native/segmented.js.map +1 -0
- package/dist/native/sheet.android.d.ts +18 -0
- package/dist/native/sheet.android.d.ts.map +1 -0
- package/dist/native/sheet.android.js +16 -0
- package/dist/native/sheet.android.js.map +1 -0
- package/dist/native/sheet.d.ts +21 -0
- package/dist/native/sheet.d.ts.map +1 -0
- package/dist/native/sheet.ios.d.ts +19 -0
- package/dist/native/sheet.ios.d.ts.map +1 -0
- package/dist/native/sheet.ios.js +41 -0
- package/dist/native/sheet.ios.js.map +1 -0
- package/dist/native/sheet.js +17 -0
- package/dist/native/sheet.js.map +1 -0
- package/dist/native/surface-effects.d.ts +4 -0
- package/dist/native/surface-effects.d.ts.map +1 -0
- package/dist/native/surface-effects.js +31 -0
- package/dist/native/surface-effects.js.map +1 -0
- package/dist/native/tabs.android.d.ts +3 -0
- package/dist/native/tabs.android.d.ts.map +1 -0
- package/dist/native/tabs.android.js +29 -0
- package/dist/native/tabs.android.js.map +1 -0
- package/dist/native/tabs.d.ts +3 -0
- package/dist/native/tabs.d.ts.map +1 -0
- package/dist/native/tabs.js +4 -0
- package/dist/native/tabs.js.map +1 -0
- package/dist/native/text-field.android.d.ts +1 -0
- package/dist/native/text-field.android.d.ts.map +1 -1
- package/dist/native/text-field.android.js +13 -0
- package/dist/native/text-field.android.js.map +1 -1
- package/dist/native/text-field.ios.d.ts +9 -0
- package/dist/native/text-field.ios.d.ts.map +1 -0
- package/dist/native/text-field.ios.js +52 -0
- package/dist/native/text-field.ios.js.map +1 -0
- package/dist/native/text-view.ios.d.ts +7 -0
- package/dist/native/text-view.ios.d.ts.map +1 -0
- package/dist/native/text-view.ios.js +10 -0
- package/dist/native/text-view.ios.js.map +1 -0
- package/dist/native/toast.android.d.ts +4 -0
- package/dist/native/toast.android.d.ts.map +1 -0
- package/dist/native/toast.android.js +10 -0
- package/dist/native/toast.android.js.map +1 -0
- package/dist/native/toast.d.ts +4 -0
- package/dist/native/toast.d.ts.map +1 -0
- package/dist/native/toast.ios.d.ts +4 -0
- package/dist/native/toast.ios.d.ts.map +1 -0
- package/dist/native/toast.ios.js +8 -0
- package/dist/native/toast.ios.js.map +1 -0
- package/dist/native/toast.js +5 -0
- package/dist/native/toast.js.map +1 -0
- package/dist/native/visual-effects.d.ts +5 -0
- package/dist/native/visual-effects.d.ts.map +1 -0
- package/dist/native/visual-effects.js +126 -0
- package/dist/native/visual-effects.js.map +1 -0
- package/dist/vue/components/ChartPlot.d.ts +65 -0
- package/dist/vue/components/ChartPlot.d.ts.map +1 -0
- package/dist/vue/components/ChartPlot.js +100 -0
- package/dist/vue/components/ChartPlot.js.map +1 -0
- package/dist/vue/components/ChoiceControl.d.ts +114 -0
- package/dist/vue/components/ChoiceControl.d.ts.map +1 -0
- package/dist/vue/components/ChoiceControl.js +218 -0
- package/dist/vue/components/ChoiceControl.js.map +1 -0
- package/dist/vue/components/DateCalendar.d.ts +109 -0
- package/dist/vue/components/DateCalendar.d.ts.map +1 -0
- package/dist/vue/components/DateCalendar.js +98 -0
- package/dist/vue/components/DateCalendar.js.map +1 -0
- package/dist/vue/components/LoadingDecoration.d.ts +116 -0
- package/dist/vue/components/LoadingDecoration.d.ts.map +1 -0
- package/dist/vue/components/LoadingDecoration.js +34 -0
- package/dist/vue/components/LoadingDecoration.js.map +1 -0
- package/dist/vue/components/MAccordion.d.ts +119 -0
- package/dist/vue/components/MAccordion.d.ts.map +1 -0
- package/dist/vue/components/MAccordion.js +83 -0
- package/dist/vue/components/MAccordion.js.map +1 -0
- package/dist/vue/components/MAlert.d.ts +109 -0
- package/dist/vue/components/MAlert.d.ts.map +1 -0
- package/dist/vue/components/MAlert.js +126 -0
- package/dist/vue/components/MAlert.js.map +1 -0
- package/dist/vue/components/MAvatar.d.ts +80 -0
- package/dist/vue/components/MAvatar.d.ts.map +1 -0
- package/dist/vue/components/MAvatar.js +86 -0
- package/dist/vue/components/MAvatar.js.map +1 -0
- package/dist/vue/components/MBadge.d.ts +70 -0
- package/dist/vue/components/MBadge.d.ts.map +1 -0
- package/dist/vue/components/MBadge.js +30 -0
- package/dist/vue/components/MBadge.js.map +1 -0
- package/dist/vue/components/MButton.d.ts +212 -32
- package/dist/vue/components/MButton.d.ts.map +1 -1
- package/dist/vue/components/MButton.js +192 -20
- package/dist/vue/components/MButton.js.map +1 -1
- package/dist/vue/components/MCard.d.ts +113 -21
- package/dist/vue/components/MCard.d.ts.map +1 -1
- package/dist/vue/components/MCard.js +24 -6
- package/dist/vue/components/MCard.js.map +1 -1
- package/dist/vue/components/MCheckbox.d.ts +103 -0
- package/dist/vue/components/MCheckbox.d.ts.map +1 -0
- package/dist/vue/components/MCheckbox.js +26 -0
- package/dist/vue/components/MCheckbox.js.map +1 -0
- package/dist/vue/components/MChip.d.ts +117 -0
- package/dist/vue/components/MChip.d.ts.map +1 -0
- package/dist/vue/components/MChip.js +120 -0
- package/dist/vue/components/MChip.js.map +1 -0
- package/dist/vue/components/MCombobox.d.ts +279 -0
- package/dist/vue/components/MCombobox.d.ts.map +1 -0
- package/dist/vue/components/MCombobox.js +234 -0
- package/dist/vue/components/MCombobox.js.map +1 -0
- package/dist/vue/components/MDatePicker.d.ts +1350 -0
- package/dist/vue/components/MDatePicker.d.ts.map +1 -0
- package/dist/vue/components/MDatePicker.js +25 -0
- package/dist/vue/components/MDatePicker.js.map +1 -0
- package/dist/vue/components/MDialog.d.ts +100 -0
- package/dist/vue/components/MDialog.d.ts.map +1 -0
- package/dist/vue/components/MDialog.js +245 -0
- package/dist/vue/components/MDialog.js.map +1 -0
- package/dist/vue/components/MEmptyState.d.ts +117 -0
- package/dist/vue/components/MEmptyState.d.ts.map +1 -0
- package/dist/vue/components/MEmptyState.js +79 -0
- package/dist/vue/components/MEmptyState.js.map +1 -0
- package/dist/vue/components/MFilePicker.d.ts +112 -0
- package/dist/vue/components/MFilePicker.d.ts.map +1 -0
- package/dist/vue/components/MFilePicker.js +196 -0
- package/dist/vue/components/MFilePicker.js.map +1 -0
- package/dist/vue/components/MGrid.d.ts +165 -0
- package/dist/vue/components/MGrid.d.ts.map +1 -0
- package/dist/vue/components/MGrid.js +52 -0
- package/dist/vue/components/MGrid.js.map +1 -0
- package/dist/vue/components/MIcon.d.ts +75 -0
- package/dist/vue/components/MIcon.d.ts.map +1 -0
- package/dist/vue/components/MIcon.js +45 -0
- package/dist/vue/components/MIcon.js.map +1 -0
- package/dist/vue/components/MImage.d.ts +248 -0
- package/dist/vue/components/MImage.d.ts.map +1 -0
- package/dist/vue/components/MImage.js +157 -0
- package/dist/vue/components/MImage.js.map +1 -0
- package/dist/vue/components/MInput.d.ts +195 -50
- package/dist/vue/components/MInput.d.ts.map +1 -1
- package/dist/vue/components/MInput.js +134 -20
- package/dist/vue/components/MInput.js.map +1 -1
- package/dist/vue/components/MLink.d.ts +120 -0
- package/dist/vue/components/MLink.d.ts.map +1 -0
- package/dist/vue/components/MLink.js +76 -0
- package/dist/vue/components/MLink.js.map +1 -0
- package/dist/vue/components/MListItem.d.ts +106 -0
- package/dist/vue/components/MListItem.d.ts.map +1 -0
- package/dist/vue/components/MListItem.js +53 -0
- package/dist/vue/components/MListItem.js.map +1 -0
- package/dist/vue/components/MPopover.d.ts +106 -0
- package/dist/vue/components/MPopover.d.ts.map +1 -0
- package/dist/vue/components/MPopover.js +209 -0
- package/dist/vue/components/MPopover.js.map +1 -0
- package/dist/vue/components/MProgress.d.ts +122 -0
- package/dist/vue/components/MProgress.d.ts.map +1 -0
- package/dist/vue/components/MProgress.js +75 -0
- package/dist/vue/components/MProgress.js.map +1 -0
- package/dist/vue/components/MRadioGroup.d.ts +103 -0
- package/dist/vue/components/MRadioGroup.d.ts.map +1 -0
- package/dist/vue/components/MRadioGroup.js +57 -0
- package/dist/vue/components/MRadioGroup.js.map +1 -0
- package/dist/vue/components/MRangeSlider.d.ts +105 -0
- package/dist/vue/components/MRangeSlider.d.ts.map +1 -0
- package/dist/vue/components/MRangeSlider.js +107 -0
- package/dist/vue/components/MRangeSlider.js.map +1 -0
- package/dist/vue/components/MReveal.d.ts +73 -37
- package/dist/vue/components/MReveal.d.ts.map +1 -1
- package/dist/vue/components/MReveal.js +80 -37
- package/dist/vue/components/MReveal.js.map +1 -1
- package/dist/vue/components/MScreen.d.ts +42 -8
- package/dist/vue/components/MScreen.d.ts.map +1 -1
- package/dist/vue/components/MScreen.js +91 -6
- package/dist/vue/components/MScreen.js.map +1 -1
- package/dist/vue/components/MSegmentedControl.d.ts +95 -0
- package/dist/vue/components/MSegmentedControl.d.ts.map +1 -0
- package/dist/vue/components/MSegmentedControl.js +172 -0
- package/dist/vue/components/MSegmentedControl.js.map +1 -0
- package/dist/vue/components/MSelect.d.ts +140 -0
- package/dist/vue/components/MSelect.d.ts.map +1 -0
- package/dist/vue/components/MSelect.js +158 -0
- package/dist/vue/components/MSelect.js.map +1 -0
- package/dist/vue/components/MSeparator.d.ts +56 -0
- package/dist/vue/components/MSeparator.d.ts.map +1 -0
- package/dist/vue/components/MSeparator.js +36 -0
- package/dist/vue/components/MSeparator.js.map +1 -0
- package/dist/vue/components/MSheet.d.ts +116 -0
- package/dist/vue/components/MSheet.d.ts.map +1 -0
- package/dist/vue/components/MSheet.js +313 -0
- package/dist/vue/components/MSheet.js.map +1 -0
- package/dist/vue/components/MSkeleton.d.ts +89 -0
- package/dist/vue/components/MSkeleton.d.ts.map +1 -0
- package/dist/vue/components/MSkeleton.js +89 -0
- package/dist/vue/components/MSkeleton.js.map +1 -0
- package/dist/vue/components/MSlider.d.ts +8 -4
- package/dist/vue/components/MSlider.d.ts.map +1 -1
- package/dist/vue/components/MSlider.js +3 -2
- package/dist/vue/components/MSlider.js.map +1 -1
- package/dist/vue/components/MStack.d.ts +199 -0
- package/dist/vue/components/MStack.d.ts.map +1 -0
- package/dist/vue/components/MStack.js +62 -0
- package/dist/vue/components/MStack.js.map +1 -0
- package/dist/vue/components/MSwitch.d.ts +89 -0
- package/dist/vue/components/MSwitch.d.ts.map +1 -0
- package/dist/vue/components/MSwitch.js +173 -0
- package/dist/vue/components/MSwitch.js.map +1 -0
- package/dist/vue/components/MTabs.d.ts +101 -0
- package/dist/vue/components/MTabs.d.ts.map +1 -0
- package/dist/vue/components/MTabs.js +245 -0
- package/dist/vue/components/MTabs.js.map +1 -0
- package/dist/vue/components/MText.d.ts +61 -25
- package/dist/vue/components/MText.d.ts.map +1 -1
- package/dist/vue/components/MText.js +47 -19
- package/dist/vue/components/MText.js.map +1 -1
- package/dist/vue/components/MTimePicker.d.ts +655 -0
- package/dist/vue/components/MTimePicker.d.ts.map +1 -0
- package/dist/vue/components/MTimePicker.js +50 -0
- package/dist/vue/components/MTimePicker.js.map +1 -0
- package/dist/vue/components/MToast.d.ts +23 -0
- package/dist/vue/components/MToast.d.ts.map +1 -0
- package/dist/vue/components/MToast.js +242 -0
- package/dist/vue/components/MToast.js.map +1 -0
- package/dist/vue/components/MTooltip.d.ts +65 -0
- package/dist/vue/components/MTooltip.d.ts.map +1 -0
- package/dist/vue/components/MTooltip.js +35 -0
- package/dist/vue/components/MTooltip.js.map +1 -0
- package/dist/vue/components/MVirtualList.d.ts +3 -0
- package/dist/vue/components/MVirtualList.d.ts.map +1 -0
- package/dist/vue/components/MVirtualList.js +88 -0
- package/dist/vue/components/MVirtualList.js.map +1 -0
- package/dist/vue/components/configurator.d.ts +541 -0
- package/dist/vue/components/configurator.d.ts.map +1 -0
- package/dist/vue/components/configurator.js +24 -0
- package/dist/vue/components/configurator.js.map +1 -0
- package/dist/vue/components/discovery.d.ts +282 -0
- package/dist/vue/components/discovery.d.ts.map +1 -0
- package/dist/vue/components/discovery.js +67 -0
- package/dist/vue/components/discovery.js.map +1 -0
- package/dist/vue/components/layout.d.ts +230 -88
- package/dist/vue/components/layout.d.ts.map +1 -1
- package/dist/vue/components/layout.js +16 -9
- package/dist/vue/components/layout.js.map +1 -1
- package/dist/vue/components/navigation.d.ts +225 -0
- package/dist/vue/components/navigation.d.ts.map +1 -0
- package/dist/vue/components/navigation.js +16 -0
- package/dist/vue/components/navigation.js.map +1 -0
- package/dist/vue/components/wayfinding.d.ts +441 -0
- package/dist/vue/components/wayfinding.d.ts.map +1 -0
- package/dist/vue/components/wayfinding.js +37 -0
- package/dist/vue/components/wayfinding.js.map +1 -0
- package/dist/vue/components/workflows.d.ts +251 -0
- package/dist/vue/components/workflows.d.ts.map +1 -0
- package/dist/vue/components/workflows.js +35 -0
- package/dist/vue/components/workflows.js.map +1 -0
- package/dist/vue/index.d.ts +54 -9
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +105 -7
- package/dist/vue/index.js.map +1 -1
- package/dist/vue/layers.d.ts +19 -0
- package/dist/vue/layers.d.ts.map +1 -0
- package/dist/vue/layers.js +26 -0
- package/dist/vue/layers.js.map +1 -0
- package/dist/vue/native-view.d.ts +6 -0
- package/dist/vue/native-view.d.ts.map +1 -0
- package/dist/vue/native-view.js +5 -0
- package/dist/vue/native-view.js.map +1 -0
- package/dist/vue/navigation.d.ts +4 -0
- package/dist/vue/navigation.d.ts.map +1 -0
- package/dist/vue/navigation.js +16 -0
- package/dist/vue/navigation.js.map +1 -0
- package/dist/vue/props.d.ts +12 -11
- package/dist/vue/props.d.ts.map +1 -1
- package/dist/vue/props.js +25 -10
- package/dist/vue/props.js.map +1 -1
- package/dist/vue/router-navigation.d.ts +25 -0
- package/dist/vue/router-navigation.d.ts.map +1 -0
- package/dist/vue/router-navigation.js +15 -0
- package/dist/vue/router-navigation.js.map +1 -0
- package/dist/vue/services.d.ts +16 -0
- package/dist/vue/services.d.ts.map +1 -0
- package/dist/vue/services.js +23 -0
- package/dist/vue/services.js.map +1 -0
- package/dist/vue/system-back.d.ts +11 -0
- package/dist/vue/system-back.d.ts.map +1 -0
- package/dist/vue/system-back.js +2 -0
- package/dist/vue/system-back.js.map +1 -0
- package/dist/vue/use-choice-paint.d.ts +9 -0
- package/dist/vue/use-choice-paint.d.ts.map +1 -0
- package/dist/vue/use-choice-paint.js +32 -0
- package/dist/vue/use-choice-paint.js.map +1 -0
- package/dist/vue/use-motion-region.d.ts +7 -0
- package/dist/vue/use-motion-region.d.ts.map +1 -0
- package/dist/vue/use-motion-region.js +28 -0
- package/dist/vue/use-motion-region.js.map +1 -0
- package/dist/vue/use-motion-surface.d.ts +8 -0
- package/dist/vue/use-motion-surface.d.ts.map +1 -0
- package/dist/vue/use-motion-surface.js +105 -0
- package/dist/vue/use-motion-surface.js.map +1 -0
- package/dist/vue/use-press.d.ts +1 -1
- package/dist/vue/use-press.d.ts.map +1 -1
- package/dist/vue/use-press.js +13 -5
- package/dist/vue/use-press.js.map +1 -1
- package/dist/vue/use-scroll-motion.d.ts +7 -0
- package/dist/vue/use-scroll-motion.d.ts.map +1 -0
- package/dist/vue/use-scroll-motion.js +30 -0
- package/dist/vue/use-scroll-motion.js.map +1 -0
- package/fonts/LICENSE +45 -0
- package/fonts/lucide.ttf +0 -0
- package/package.json +20 -4
- package/platforms/android/java/com/mavis/ui/Box.java +65 -0
- package/platforms/android/java/com/mavis/ui/ContentWidth.java +77 -0
- package/platforms/android/java/com/mavis/ui/FlexLayout.java +101 -4
- package/platforms/android/java/com/mavis/ui/MeasureMemo.java +145 -0
- package/platforms/android/java/com/mavis/ui/Screen.java +108 -0
- package/src/app-icons.ts +21 -0
- package/src/date-format.ts +2 -0
- package/src/files.ts +3 -0
- package/src/native/app-icons.android.ts +95 -0
- package/src/native/app-icons.ios.ts +74 -0
- package/src/native/app-icons.ts +12 -0
- package/src/native/appearance.android.ts +75 -0
- package/src/native/appearance.ts +33 -0
- package/src/native/avatar-image.ts +9 -0
- package/src/native/avatar-label.android.ts +14 -0
- package/src/native/avatar-label.ts +1 -0
- package/src/native/box.android.ts +11 -0
- package/src/native/box.ios.ts +61 -0
- package/src/native/box.ts +2 -0
- package/src/native/button.android.ts +38 -0
- package/src/native/button.ios.ts +53 -1
- package/src/native/checkbox.android.ts +35 -0
- package/src/native/checkbox.ts +9 -0
- package/src/native/collection-motion.ts +166 -0
- package/src/native/combobox-editor.android.ts +11 -0
- package/src/native/combobox-editor.ts +6 -0
- package/src/native/composed-button.android.ts +74 -0
- package/src/native/composed-button.ts +9 -0
- package/src/native/date-format.android.ts +72 -0
- package/src/native/date-format.ios.ts +54 -0
- package/src/native/date-format.ts +17 -0
- package/src/native/dialog.android.ts +56 -0
- package/src/native/dialog.ios.ts +23 -0
- package/src/native/dialog.ts +10 -0
- package/src/native/dynamic-type.ts +71 -0
- package/src/native/file-access.ts +71 -0
- package/src/native/file-picker.android.ts +191 -0
- package/src/native/file-picker.ios.ts +230 -0
- package/src/native/file-picker.ts +8 -0
- package/src/native/flex-children.ts +12 -0
- package/src/native/flex-layout.android.ts +12 -1
- package/src/native/flex-layout.ios.ts +148 -1
- package/src/native/image-effects.ts +71 -0
- package/src/native/input-action.ts +15 -0
- package/src/native/keyboard-dismiss.android.ts +17 -0
- package/src/native/keyboard-dismiss.ios.ts +124 -0
- package/src/native/keyboard-dismiss.ts +14 -0
- package/src/native/label.android.ts +27 -0
- package/src/native/label.ios.ts +54 -1
- package/src/native/measure-memo.ts +116 -0
- package/src/native/motion-owner.ts +66 -0
- package/src/native/motion-region.ts +293 -0
- package/src/native/motion-surface.ts +273 -0
- package/src/native/platform-motion.ts +103 -0
- package/src/native/press.ts +58 -10
- package/src/native/progress.ts +78 -0
- package/src/native/screen.android.ts +12 -0
- package/src/native/screen.ts +2 -0
- package/src/native/scroll-motion.ts +106 -0
- package/src/native/section-scroll.ts +81 -0
- package/src/native/segmented.ts +95 -0
- package/src/native/sheet.android.ts +24 -0
- package/src/native/sheet.ios.ts +52 -0
- package/src/native/sheet.ts +26 -0
- package/src/native/surface-effects.ts +33 -0
- package/src/native/tabs.android.ts +58 -0
- package/src/native/tabs.ts +8 -0
- package/src/native/text-field.android.ts +19 -0
- package/src/native/text-field.ios.ts +53 -0
- package/src/native/text-view.ios.ts +10 -0
- package/src/native/toast.android.ts +9 -0
- package/src/native/toast.ios.ts +13 -0
- package/src/native/toast.ts +6 -0
- package/src/native/visual-effects.ts +147 -0
- package/src/vue/components/ChartPlot.ts +114 -0
- package/src/vue/components/ChoiceControl.ts +265 -0
- package/src/vue/components/DateCalendar.ts +121 -0
- package/src/vue/components/LoadingDecoration.ts +38 -0
- package/src/vue/components/MAccordion.ts +123 -0
- package/src/vue/components/MAlert.ts +156 -0
- package/src/vue/components/MAvatar.ts +103 -0
- package/src/vue/components/MBadge.ts +34 -0
- package/src/vue/components/MButton.ts +255 -18
- package/src/vue/components/MCard.ts +44 -5
- package/src/vue/components/MCheckbox.ts +25 -0
- package/src/vue/components/MChip.ts +134 -0
- package/src/vue/components/MCombobox.ts +257 -0
- package/src/vue/components/MDatePicker.ts +25 -0
- package/src/vue/components/MDialog.ts +312 -0
- package/src/vue/components/MEmptyState.ts +96 -0
- package/src/vue/components/MFilePicker.ts +226 -0
- package/src/vue/components/MGrid.ts +86 -0
- package/src/vue/components/MIcon.ts +53 -0
- package/src/vue/components/MImage.ts +181 -0
- package/src/vue/components/MInput.ts +143 -21
- package/src/vue/components/MLink.ts +99 -0
- package/src/vue/components/MListItem.ts +66 -0
- package/src/vue/components/MPopover.ts +254 -0
- package/src/vue/components/MProgress.ts +94 -0
- package/src/vue/components/MRadioGroup.ts +64 -0
- package/src/vue/components/MRangeSlider.ts +125 -0
- package/src/vue/components/MReveal.ts +89 -48
- package/src/vue/components/MScreen.ts +122 -6
- package/src/vue/components/MSegmentedControl.ts +214 -0
- package/src/vue/components/MSelect.ts +185 -0
- package/src/vue/components/MSeparator.ts +40 -0
- package/src/vue/components/MSheet.ts +375 -0
- package/src/vue/components/MSkeleton.ts +102 -0
- package/src/vue/components/MSlider.ts +8 -2
- package/src/vue/components/MStack.ts +83 -0
- package/src/vue/components/MSwitch.ts +200 -0
- package/src/vue/components/MTabs.ts +302 -0
- package/src/vue/components/MText.ts +48 -10
- package/src/vue/components/MTimePicker.ts +57 -0
- package/src/vue/components/MToast.ts +289 -0
- package/src/vue/components/MTooltip.ts +39 -0
- package/src/vue/components/MVirtualList.ts +120 -0
- package/src/vue/components/configurator.ts +27 -0
- package/src/vue/components/discovery.ts +92 -0
- package/src/vue/components/layout.ts +24 -9
- package/src/vue/components/navigation.ts +19 -0
- package/src/vue/components/wayfinding.ts +46 -0
- package/src/vue/components/workflows.ts +38 -0
- package/src/vue/index.ts +217 -22
- package/src/vue/layers.ts +48 -0
- package/src/vue/native-view.ts +6 -0
- package/src/vue/navigation.ts +15 -0
- package/src/vue/props.ts +37 -12
- package/src/vue/router-navigation.ts +39 -0
- package/src/vue/services.ts +39 -0
- package/src/vue/system-back.ts +12 -0
- package/src/vue/use-choice-paint.ts +39 -0
- package/src/vue/use-motion-region.ts +29 -0
- package/src/vue/use-motion-surface.ts +115 -0
- package/src/vue/use-press.ts +13 -5
- package/src/vue/use-scroll-motion.ts +31 -0
- package/dist/native/input-description.android.d.ts +0 -4
- package/dist/native/input-description.android.d.ts.map +0 -1
- package/dist/native/input-description.android.js +0 -18
- package/dist/native/input-description.android.js.map +0 -1
- package/dist/theme/resolve.d.ts +0 -3
- package/dist/theme/resolve.d.ts.map +0 -1
- package/dist/theme/resolve.js +0 -8
- package/dist/theme/resolve.js.map +0 -1
- package/dist/theme/themes.d.ts +0 -6
- package/dist/theme/themes.d.ts.map +0 -1
- package/dist/theme/themes.js +0 -83
- package/dist/theme/themes.js.map +0 -1
- package/dist/theme/types.d.ts +0 -50
- package/dist/theme/types.d.ts.map +0 -1
- package/dist/theme/types.js +0 -2
- package/dist/theme/types.js.map +0 -1
- package/dist/vue/global-components.d.ts +0 -21
- package/dist/vue/global-components.d.ts.map +0 -1
- package/dist/vue/global-components.js +0 -2
- package/dist/vue/global-components.js.map +0 -1
- package/dist/vue/layout-context.d.ts +0 -5
- package/dist/vue/layout-context.d.ts.map +0 -1
- package/dist/vue/layout-context.js +0 -7
- package/dist/vue/layout-context.js.map +0 -1
- package/dist/vue/text-content.d.ts +0 -4
- package/dist/vue/text-content.d.ts.map +0 -1
- package/dist/vue/text-content.js +0 -17
- package/dist/vue/text-content.js.map +0 -1
- package/dist/vue/theme.d.ts +0 -177
- package/dist/vue/theme.d.ts.map +0 -1
- package/dist/vue/theme.js +0 -17
- package/dist/vue/theme.js.map +0 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Image, type View } from '@nativescript/core'
|
|
2
|
+
import { imageEffect } from '@rafaelaugusto/jolt'
|
|
3
|
+
import type {
|
|
4
|
+
MotionImageEffectName,
|
|
5
|
+
MotionImageEffectOptions,
|
|
6
|
+
MotionPlayback,
|
|
7
|
+
} from '@getcortexlabs/mavis-core/experimental'
|
|
8
|
+
import { loadAvatarImage } from './avatar-image.js'
|
|
9
|
+
|
|
10
|
+
type Presentation = {
|
|
11
|
+
current(): boolean
|
|
12
|
+
commit(src: string, image: Image['imageSource']): Promise<boolean>
|
|
13
|
+
}
|
|
14
|
+
const images = new WeakMap<Image, Presentation>()
|
|
15
|
+
const preparations = new WeakMap<Image, object>()
|
|
16
|
+
export function registerMotionImage(target: Image, presentation: Presentation) {
|
|
17
|
+
images.set(target, presentation)
|
|
18
|
+
return () => {
|
|
19
|
+
if (images.get(target) === presentation) images.delete(target)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function loadedMotionImage(target: View): Image {
|
|
23
|
+
if (!(target instanceof Image) || !images.has(target) || !target.imageSource)
|
|
24
|
+
throw new TypeError('Use the ready motionSurface of MImage for pixel effects.')
|
|
25
|
+
return target
|
|
26
|
+
}
|
|
27
|
+
export async function nativeImageEffect(
|
|
28
|
+
target: View,
|
|
29
|
+
name: MotionImageEffectName,
|
|
30
|
+
options: MotionImageEffectOptions = {},
|
|
31
|
+
live: () => boolean = () => true,
|
|
32
|
+
) {
|
|
33
|
+
const image = loadedMotionImage(target),
|
|
34
|
+
presentation = images.get(image)!
|
|
35
|
+
const { to, ...rest } = options
|
|
36
|
+
if (to !== undefined && (name !== 'dissolve' || !to.trim()))
|
|
37
|
+
throw new TypeError('Only dissolve accepts a nonempty destination source.')
|
|
38
|
+
const preparation = {}
|
|
39
|
+
preparations.set(image, preparation)
|
|
40
|
+
const destination = to === undefined ? undefined : await loadAvatarImage(to)
|
|
41
|
+
if (to !== undefined && !destination) throw new Error('Destination image could not be decoded.')
|
|
42
|
+
if (
|
|
43
|
+
!live() ||
|
|
44
|
+
preparations.get(image) !== preparation ||
|
|
45
|
+
!presentation.current() ||
|
|
46
|
+
images.get(image) !== presentation ||
|
|
47
|
+
!image.isLoaded
|
|
48
|
+
)
|
|
49
|
+
throw new Error('Image presentation changed while preparing the effect.')
|
|
50
|
+
const previous = image.imageSource
|
|
51
|
+
const raw = imageEffect(image, name, { ...rest, ...(destination ? { to: destination } : {}) })
|
|
52
|
+
const finished = raw.finished.then(async (success) => {
|
|
53
|
+
if (!success || !to || raw.progress !== 1) return success
|
|
54
|
+
if (!presentation.current() || images.get(image) !== presentation) return false
|
|
55
|
+
if (!live()) {
|
|
56
|
+
if (image.imageSource === destination) image.imageSource = previous
|
|
57
|
+
return false
|
|
58
|
+
}
|
|
59
|
+
return presentation.commit(to, destination!)
|
|
60
|
+
})
|
|
61
|
+
return new Proxy(raw as MotionPlayback, {
|
|
62
|
+
get(target, key) {
|
|
63
|
+
// Native animations are thenable; returning one from an async factory would await completion.
|
|
64
|
+
if (key === 'then') return undefined
|
|
65
|
+
if (key === 'finished') return finished
|
|
66
|
+
const value = Reflect.get(target, key, target)
|
|
67
|
+
return typeof value === 'function' ? value.bind(target) : value
|
|
68
|
+
},
|
|
69
|
+
set: (target, key, value) => Reflect.set(target, key, value, target),
|
|
70
|
+
})
|
|
71
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { View } from '@nativescript/core'
|
|
2
|
+
|
|
3
|
+
const actions = new WeakMap<object, () => boolean>()
|
|
4
|
+
|
|
5
|
+
/** An input's own action is part of the active edit, not a tap outside it. */
|
|
6
|
+
export function keepEditingOn(action: View, editor: () => View | undefined): () => void {
|
|
7
|
+
const native = action.ios as object | undefined
|
|
8
|
+
if (!native) return () => {}
|
|
9
|
+
actions.set(native, () => editor()?.ios?.isFirstResponder === true)
|
|
10
|
+
return () => actions.delete(native)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function isEditingAction(native: object) {
|
|
14
|
+
return actions.get(native)?.() ?? false
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { View } from '@nativescript/core'
|
|
2
|
+
|
|
3
|
+
export interface KeyboardDismissal {
|
|
4
|
+
tap: boolean
|
|
5
|
+
drag: boolean
|
|
6
|
+
}
|
|
7
|
+
interface ScreenView {
|
|
8
|
+
setKeyboardDismissal(onTap: boolean, onDrag: boolean): void
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** The container is a `com.mavis.ui.Screen`, which watches every touch of the page. */
|
|
12
|
+
export function dismissKeyboardOn(container: View, options: KeyboardDismissal): () => void {
|
|
13
|
+
const screen = container.android as Partial<ScreenView> | undefined
|
|
14
|
+
if (!screen?.setKeyboardDismissal) return () => {}
|
|
15
|
+
screen.setKeyboardDismissal(options.tap, options.drag)
|
|
16
|
+
return () => screen.setKeyboardDismissal?.(false, false)
|
|
17
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { ScrollView, type View } from '@nativescript/core'
|
|
2
|
+
import { isEditingAction } from './input-action'
|
|
3
|
+
|
|
4
|
+
export interface KeyboardDismissal {
|
|
5
|
+
tap: boolean
|
|
6
|
+
drag: boolean
|
|
7
|
+
}
|
|
8
|
+
interface NativeView {
|
|
9
|
+
superview: NativeView | null
|
|
10
|
+
subviews: { count: number; objectAtIndex(index: number): NativeView }
|
|
11
|
+
isFirstResponder: boolean
|
|
12
|
+
isEqual(other: NativeView): boolean
|
|
13
|
+
endEditing(force: boolean): boolean
|
|
14
|
+
addGestureRecognizer(recognizer: Recognizer): void
|
|
15
|
+
removeGestureRecognizer(recognizer: Recognizer): void
|
|
16
|
+
}
|
|
17
|
+
interface Recognizer {
|
|
18
|
+
view: NativeView
|
|
19
|
+
delegate: unknown
|
|
20
|
+
cancelsTouchesInView: boolean
|
|
21
|
+
delaysTouchesEnded: boolean
|
|
22
|
+
}
|
|
23
|
+
interface NativeClass {
|
|
24
|
+
extend(members: object, options: object): { new (): object }
|
|
25
|
+
}
|
|
26
|
+
declare const NSObject: NativeClass
|
|
27
|
+
declare const UITapGestureRecognizer: {
|
|
28
|
+
alloc(): { initWithTargetAction(target: object, action: string): Recognizer }
|
|
29
|
+
}
|
|
30
|
+
declare const UIGestureRecognizerDelegate: unknown
|
|
31
|
+
declare const UITextField: unknown
|
|
32
|
+
declare const UITextView: unknown
|
|
33
|
+
declare const UIGestureRecognizer: unknown
|
|
34
|
+
declare const interop: { types: { void: unknown } }
|
|
35
|
+
|
|
36
|
+
const editor = (view: NativeView | null) => {
|
|
37
|
+
for (let current = view; current; current = current.superview) {
|
|
38
|
+
if (isEditingAction(current)) return true
|
|
39
|
+
if (current instanceof (UITextField as never) || current instanceof (UITextView as never))
|
|
40
|
+
return true
|
|
41
|
+
}
|
|
42
|
+
return false
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const firstResponder = (view: NativeView): NativeView | null => {
|
|
46
|
+
if (view.isFirstResponder) return view
|
|
47
|
+
const subviews = view.subviews
|
|
48
|
+
for (let index = 0; index < subviews.count; index++) {
|
|
49
|
+
const found = firstResponder(subviews.objectAtIndex(index))
|
|
50
|
+
if (found) return found
|
|
51
|
+
}
|
|
52
|
+
return null
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// The recognizer only observes: it never cancels or delays the touches of the controls below
|
|
56
|
+
// it, and it recognizes together with the gesture recognizers of Core and Jolt. It takes a
|
|
57
|
+
// touch only while an editor is active and the touch is not on an editor. UIKit runs the tap
|
|
58
|
+
// action after the control's own action, so a control that focused another editor meanwhile
|
|
59
|
+
// keeps that focus.
|
|
60
|
+
let editing: NativeView | null = null
|
|
61
|
+
let Delegate: { new (): object } | undefined
|
|
62
|
+
let Target: { new (): object } | undefined
|
|
63
|
+
function classes() {
|
|
64
|
+
Delegate ??= NSObject.extend(
|
|
65
|
+
{
|
|
66
|
+
gestureRecognizerShouldReceiveTouch(recognizer: Recognizer, touch: { view: NativeView }) {
|
|
67
|
+
editing = editor(touch.view) ? null : firstResponder(recognizer.view)
|
|
68
|
+
return editing !== null
|
|
69
|
+
},
|
|
70
|
+
gestureRecognizerShouldRecognizeSimultaneouslyWithGestureRecognizer() {
|
|
71
|
+
return true
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{ protocols: [UIGestureRecognizerDelegate] },
|
|
75
|
+
)
|
|
76
|
+
Target ??= NSObject.extend(
|
|
77
|
+
{
|
|
78
|
+
dismiss(recognizer: Recognizer) {
|
|
79
|
+
const current = firstResponder(recognizer.view)
|
|
80
|
+
if (editing && current?.isEqual(editing)) recognizer.view.endEditing(true)
|
|
81
|
+
editing = null
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
{ exposedMethods: { dismiss: { returns: interop.types.void, params: [UIGestureRecognizer] } } },
|
|
85
|
+
)
|
|
86
|
+
return { Delegate, Target }
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** A tap recognizer on the page container; the scroll view follows the drag with the keyboard. */
|
|
90
|
+
export function dismissKeyboardOn(container: View, options: KeyboardDismissal): () => void {
|
|
91
|
+
const native = container.ios as NativeView | undefined
|
|
92
|
+
if (!native) return () => {}
|
|
93
|
+
let recognizer: Recognizer | undefined
|
|
94
|
+
// The recognizer keeps neither object alive for the runtime: hold both until release.
|
|
95
|
+
let delegate: object | undefined
|
|
96
|
+
let target: object | undefined
|
|
97
|
+
if (options.tap) {
|
|
98
|
+
const { Delegate, Target } = classes()
|
|
99
|
+
delegate = new Delegate()
|
|
100
|
+
target = new Target()
|
|
101
|
+
recognizer = UITapGestureRecognizer.alloc().initWithTargetAction(target, 'dismiss')
|
|
102
|
+
recognizer.cancelsTouchesInView = false
|
|
103
|
+
recognizer.delaysTouchesEnded = false
|
|
104
|
+
recognizer.delegate = delegate
|
|
105
|
+
native.addGestureRecognizer(recognizer)
|
|
106
|
+
}
|
|
107
|
+
let scroll: ScrollView | undefined
|
|
108
|
+
container.eachChildView((child) => {
|
|
109
|
+
if (child instanceof ScrollView) scroll = child
|
|
110
|
+
return !scroll
|
|
111
|
+
})
|
|
112
|
+
// UIScrollViewKeyboardDismissMode: none (0) or interactive (2).
|
|
113
|
+
if (scroll?.ios) scroll.ios.keyboardDismissMode = options.drag ? 2 : 0
|
|
114
|
+
return () => {
|
|
115
|
+
if (recognizer) {
|
|
116
|
+
native.removeGestureRecognizer(recognizer)
|
|
117
|
+
recognizer.delegate = null
|
|
118
|
+
}
|
|
119
|
+
recognizer = undefined
|
|
120
|
+
delegate = undefined
|
|
121
|
+
target = undefined
|
|
122
|
+
if (scroll?.ios) scroll.ios.keyboardDismissMode = 0
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { View } from '@nativescript/core'
|
|
2
|
+
|
|
3
|
+
export interface KeyboardDismissal {
|
|
4
|
+
/** A tap anywhere on the page that is not an editor. */
|
|
5
|
+
tap: boolean
|
|
6
|
+
/** A drag of the scrolling content. */
|
|
7
|
+
drag: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// NativeScript resolves the platform implementation before loading this module.
|
|
11
|
+
/** Puts the software keyboard away for the given gestures until the returned function runs. */
|
|
12
|
+
export function dismissKeyboardOn(_container: View, _options: KeyboardDismissal): () => void {
|
|
13
|
+
return () => {}
|
|
14
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Label, type FormattedString } from '@nativescript/core'
|
|
2
|
+
|
|
3
|
+
declare const android: { text: { style: { AbsoluteSizeSpan: { class: unknown } } } }
|
|
4
|
+
interface StyledText {
|
|
5
|
+
length(): number
|
|
6
|
+
getSpans(start: number, end: number, type: unknown): ArrayLike<unknown>
|
|
7
|
+
removeSpan(span: unknown): void
|
|
8
|
+
}
|
|
9
|
+
const format = (
|
|
10
|
+
Label.prototype as unknown as {
|
|
11
|
+
createFormattedTextNative(value: FormattedString): StyledText
|
|
12
|
+
}
|
|
13
|
+
).createFormattedTextNative
|
|
14
|
+
|
|
15
|
+
/** MSpan inherits one label size; keep Android's scaled text size instead of Core's fixed-size spans. */
|
|
16
|
+
export class MavisLabel extends Label {
|
|
17
|
+
createFormattedTextNative(value: FormattedString) {
|
|
18
|
+
const text = format.call(this, value)
|
|
19
|
+
if (!text) return text
|
|
20
|
+
// Core skips the TextView size setter for formatted text. Use sp here so the
|
|
21
|
+
// same inherited size reaches every run and Android applies system scaling.
|
|
22
|
+
if (this.fontSize > 0) this.nativeTextViewProtected.setTextSize(this.fontSize)
|
|
23
|
+
const sizes = text.getSpans(0, text.length(), android.text.style.AbsoluteSizeSpan.class)
|
|
24
|
+
for (let index = 0; index < sizes.length; index++) text.removeSpan(sizes[index])
|
|
25
|
+
return text
|
|
26
|
+
}
|
|
27
|
+
}
|
package/src/native/label.ios.ts
CHANGED
|
@@ -1,6 +1,59 @@
|
|
|
1
|
-
import { Label, Utils } from '@nativescript/core'
|
|
1
|
+
import { Label, Utils, Font, type Span } from '@nativescript/core'
|
|
2
|
+
import { fontScaleInternalProperty } from '@nativescript/core/ui/styling/style-properties'
|
|
3
|
+
import type { TextVariant } from '@getcortexlabs/mavis-core'
|
|
4
|
+
import { recordMeasurement, reuseMeasurement, type MeasureRecord } from './measure-memo'
|
|
5
|
+
import { applyDynamicType, dynamicTypeScale } from './dynamic-type'
|
|
6
|
+
|
|
7
|
+
const spanDetails = (
|
|
8
|
+
Label.prototype as unknown as {
|
|
9
|
+
createMutableStringDetails(span: Span, text: string, index: number): { iosFont: unknown }
|
|
10
|
+
}
|
|
11
|
+
).createMutableStringDetails
|
|
2
12
|
|
|
3
13
|
export class MavisLabel extends Label {
|
|
14
|
+
createMutableStringDetails(span: Span, text: string, index: number) {
|
|
15
|
+
const details = spanDetails.call(this, span, text, index)
|
|
16
|
+
const style = span.style
|
|
17
|
+
const size = style.fontSize || this.fontSize
|
|
18
|
+
const font = new Font(
|
|
19
|
+
style.fontFamily,
|
|
20
|
+
size,
|
|
21
|
+
style.fontStyle,
|
|
22
|
+
style.fontWeight,
|
|
23
|
+
dynamicTypeScale(this, size),
|
|
24
|
+
)
|
|
25
|
+
details.iosFont = font.getUIFont(this.ios.font)
|
|
26
|
+
return details
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
measureRecord?: MeasureRecord
|
|
30
|
+
private textStyle: TextVariant = 'body'
|
|
31
|
+
|
|
32
|
+
get dynamicTypeStyle() {
|
|
33
|
+
return this.textStyle
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
set dynamicTypeStyle(value: TextVariant) {
|
|
37
|
+
if (value === this.textStyle) return
|
|
38
|
+
this.textStyle = value
|
|
39
|
+
applyDynamicType(this)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
[fontScaleInternalProperty.setNative]() {
|
|
43
|
+
applyDynamicType(this)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
measure(widthSpec: number, heightSpec: number) {
|
|
47
|
+
if (reuseMeasurement(this, widthSpec, heightSpec)) return
|
|
48
|
+
super.measure(widthSpec, heightSpec)
|
|
49
|
+
recordMeasurement(this, widthSpec, heightSpec)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
requestLayout() {
|
|
53
|
+
this.measureRecord = undefined
|
|
54
|
+
super.requestLayout()
|
|
55
|
+
}
|
|
56
|
+
|
|
4
57
|
disposeNativeView() {
|
|
5
58
|
const native = this.nativeViewProtected
|
|
6
59
|
super.disposeNativeView()
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { Utils, type View } from '@nativescript/core'
|
|
2
|
+
|
|
3
|
+
const { layout } = Utils
|
|
4
|
+
|
|
5
|
+
interface ChildRecord {
|
|
6
|
+
view: View
|
|
7
|
+
widthSpec: number
|
|
8
|
+
heightSpec: number
|
|
9
|
+
width: number
|
|
10
|
+
height: number
|
|
11
|
+
}
|
|
12
|
+
export interface MeasureRecord {
|
|
13
|
+
widthSpec: number
|
|
14
|
+
heightSpec: number
|
|
15
|
+
width: number
|
|
16
|
+
height: number
|
|
17
|
+
percent: boolean
|
|
18
|
+
/** The looser request clamped content that wanted more room; an exact size would shrink it. */
|
|
19
|
+
clamped: boolean
|
|
20
|
+
children: ChildRecord[]
|
|
21
|
+
}
|
|
22
|
+
interface Internals {
|
|
23
|
+
_currentWidthMeasureSpec: number
|
|
24
|
+
_currentHeightMeasureSpec: number
|
|
25
|
+
_measuredWidth: number
|
|
26
|
+
_measuredHeight: number
|
|
27
|
+
_setCurrentMeasureSpecs(widthSpec: number, heightSpec: number): boolean
|
|
28
|
+
isLayoutRequested: boolean
|
|
29
|
+
}
|
|
30
|
+
export interface Memoized extends View {
|
|
31
|
+
measureRecord?: MeasureRecord
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const isPercent = (value: unknown) =>
|
|
35
|
+
typeof value === 'object' && value !== null && (value as { unit?: string }).unit === '%'
|
|
36
|
+
|
|
37
|
+
// An exact request for the size a looser request produced is the same measurement, unless a
|
|
38
|
+
// child resolves a percentage against the request itself or the looser request clamped content
|
|
39
|
+
// that wanted more room: an exact size would then shrink the children instead. Core keeps the
|
|
40
|
+
// too-small state only for widths, so layouts report clamping themselves.
|
|
41
|
+
function matches(spec: number, record: MeasureRecord, recordedSpec: number, sizeAndState: number) {
|
|
42
|
+
if (spec === recordedSpec) return true
|
|
43
|
+
if (record.percent || record.clamped) return false
|
|
44
|
+
if (layout.getMeasureSpecMode(spec) !== layout.EXACTLY) return false
|
|
45
|
+
if (layout.getMeasureSpecMode(recordedSpec) === layout.EXACTLY) return false
|
|
46
|
+
if (sizeAndState & layout.MEASURED_STATE_TOO_SMALL) return false
|
|
47
|
+
return layout.getMeasureSpecSize(spec) === (sizeAndState & layout.MEASURED_SIZE_MASK)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Whether a looser request on either axis returned its whole limit; for layouts that cannot tell. */
|
|
51
|
+
export function filledLimit(widthSpec: number, heightSpec: number, width: number, height: number) {
|
|
52
|
+
const filled = (spec: number, size: number) =>
|
|
53
|
+
layout.getMeasureSpecMode(spec) === layout.AT_MOST &&
|
|
54
|
+
(size & layout.MEASURED_SIZE_MASK) >= layout.getMeasureSpecSize(spec)
|
|
55
|
+
return filled(widthSpec, width) || filled(heightSpec, height)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Core measures a view again whenever its parent asks while a layout request is pending, and
|
|
60
|
+
* flex containers ask several times per pass, so nested containers measure their leaves an
|
|
61
|
+
* exponential number of times. While nothing in the subtree asked for layout, the recorded
|
|
62
|
+
* measurement answers a repeated request and the children are measured again from their records.
|
|
63
|
+
*/
|
|
64
|
+
export function reuseMeasurement(view: Memoized, widthSpec: number, heightSpec: number) {
|
|
65
|
+
const record = view.measureRecord
|
|
66
|
+
const internals = view as unknown as Internals
|
|
67
|
+
if (!record || !internals.isLayoutRequested) return false
|
|
68
|
+
if (!matches(widthSpec, record, record.widthSpec, record.width)) return false
|
|
69
|
+
if (!matches(heightSpec, record, record.heightSpec, record.height)) return false
|
|
70
|
+
internals._setCurrentMeasureSpecs(widthSpec, heightSpec)
|
|
71
|
+
for (const child of record.children) {
|
|
72
|
+
const current = child.view as unknown as Internals
|
|
73
|
+
// A child still holding the recorded result was measured by this record's pass.
|
|
74
|
+
if (current._measuredWidth === child.width && current._measuredHeight === child.height) continue
|
|
75
|
+
child.view.measure(child.widthSpec, child.heightSpec)
|
|
76
|
+
}
|
|
77
|
+
view.setMeasuredDimension(record.width, record.height)
|
|
78
|
+
return true
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Stores the measurement that just completed with the specs every child last received. */
|
|
82
|
+
export function recordMeasurement(
|
|
83
|
+
view: Memoized,
|
|
84
|
+
widthSpec: number,
|
|
85
|
+
heightSpec: number,
|
|
86
|
+
children: readonly View[] = [],
|
|
87
|
+
clamped = false,
|
|
88
|
+
) {
|
|
89
|
+
const internals = view as unknown as Internals
|
|
90
|
+
view.measureRecord = {
|
|
91
|
+
widthSpec,
|
|
92
|
+
heightSpec,
|
|
93
|
+
width: internals._measuredWidth,
|
|
94
|
+
height: internals._measuredHeight,
|
|
95
|
+
percent: children.some((child) => isPercent(child.width) || isPercent(child.height)),
|
|
96
|
+
clamped,
|
|
97
|
+
children: children.map((child) => {
|
|
98
|
+
const specs = child as unknown as Internals
|
|
99
|
+
return {
|
|
100
|
+
view: child,
|
|
101
|
+
widthSpec: specs._currentWidthMeasureSpec,
|
|
102
|
+
heightSpec: specs._currentHeightMeasureSpec,
|
|
103
|
+
width: specs._measuredWidth,
|
|
104
|
+
height: specs._measuredHeight,
|
|
105
|
+
}
|
|
106
|
+
}),
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function layoutChildren(view: { eachLayoutChild(callback: (child: View) => void): void }) {
|
|
111
|
+
const children: View[] = []
|
|
112
|
+
view.eachLayoutChild((child) => {
|
|
113
|
+
children.push(child)
|
|
114
|
+
})
|
|
115
|
+
return children
|
|
116
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { motionScope } from '@rafaelaugusto/jolt'
|
|
2
|
+
import type { MotionSurfaceAdapter } from '@getcortexlabs/mavis-core/experimental'
|
|
3
|
+
import type { View } from '@nativescript/core'
|
|
4
|
+
import { registerNativeSurface } from './motion-region.js'
|
|
5
|
+
|
|
6
|
+
/** Native scopes also recreate subscriptions after application suspension. */
|
|
7
|
+
export function nativeMotionOwner(
|
|
8
|
+
adapter: MotionSurfaceAdapter,
|
|
9
|
+
target: View,
|
|
10
|
+
): MotionSurfaceAdapter {
|
|
11
|
+
const result: MotionSurfaceAdapter = {
|
|
12
|
+
...adapter,
|
|
13
|
+
use(setup) {
|
|
14
|
+
const parent = motionScope()
|
|
15
|
+
try {
|
|
16
|
+
parent.use(() => {
|
|
17
|
+
const child = motionScope()
|
|
18
|
+
const owned: MotionSurfaceAdapter = {
|
|
19
|
+
...result,
|
|
20
|
+
animate: (...args) => child.add(result.animate(...args)),
|
|
21
|
+
animateValue:
|
|
22
|
+
result.animateValue && ((...args) => child.add(result.animateValue!(...args))),
|
|
23
|
+
playbackProgress:
|
|
24
|
+
result.playbackProgress &&
|
|
25
|
+
((...args) => child.add(result.playbackProgress!(...args))),
|
|
26
|
+
decay: result.decay && ((...args) => child.add(result.decay!(...args))),
|
|
27
|
+
set: (...args) => child.add(result.set(...args)),
|
|
28
|
+
motionValue:
|
|
29
|
+
result.motionValue && ((...args) => child.add(result.motionValue!(...args))),
|
|
30
|
+
springValue:
|
|
31
|
+
result.springValue && ((...args) => child.add(result.springValue!(...args))),
|
|
32
|
+
mapColor: result.mapColor && ((...args) => child.add(result.mapColor!(...args))),
|
|
33
|
+
map: result.map && ((...args) => child.add(result.map!(...args))),
|
|
34
|
+
bind: result.bind && ((...args) => child.add(result.bind!(...args))),
|
|
35
|
+
drag: result.drag && ((...args) => child.add(result.drag!(...args))),
|
|
36
|
+
pointerFollow:
|
|
37
|
+
result.pointerFollow && ((...args) => child.add(result.pointerFollow!(...args))),
|
|
38
|
+
scrollLinked:
|
|
39
|
+
result.scrollLinked && ((...args) => child.add(result.scrollLinked!(...args))),
|
|
40
|
+
}
|
|
41
|
+
registerNativeSurface(owned, target)
|
|
42
|
+
let cleanup: () => void
|
|
43
|
+
try {
|
|
44
|
+
cleanup = setup(owned)
|
|
45
|
+
} catch (error) {
|
|
46
|
+
child.dispose()
|
|
47
|
+
throw error
|
|
48
|
+
}
|
|
49
|
+
return () => {
|
|
50
|
+
try {
|
|
51
|
+
cleanup()
|
|
52
|
+
} finally {
|
|
53
|
+
child.dispose()
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
} catch (error) {
|
|
58
|
+
parent.dispose()
|
|
59
|
+
throw error
|
|
60
|
+
}
|
|
61
|
+
return () => parent.dispose()
|
|
62
|
+
},
|
|
63
|
+
}
|
|
64
|
+
registerNativeSurface(result, target)
|
|
65
|
+
return result
|
|
66
|
+
}
|