@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,293 @@
|
|
|
1
|
+
import { Application, ScrollView, type View } from '@nativescript/core'
|
|
2
|
+
import {
|
|
3
|
+
animate,
|
|
4
|
+
animateLayout,
|
|
5
|
+
motionScope,
|
|
6
|
+
reducedMotion,
|
|
7
|
+
onReducedMotion,
|
|
8
|
+
} from '@rafaelaugusto/jolt'
|
|
9
|
+
import { sharedLayout } from '@rafaelaugusto/jolt/shared-layout'
|
|
10
|
+
import {
|
|
11
|
+
bindMotionRegion,
|
|
12
|
+
type MotionRegion,
|
|
13
|
+
type MotionRegionAdapter,
|
|
14
|
+
type MotionSurfaceAdapter,
|
|
15
|
+
} from '@getcortexlabs/mavis-core/experimental'
|
|
16
|
+
import { nativeScrollElement } from './scroll-motion.js'
|
|
17
|
+
import { nativeCollectionMotion } from './collection-motion.js'
|
|
18
|
+
import { nativePlatformMotion } from './platform-motion.js'
|
|
19
|
+
|
|
20
|
+
const targets = new WeakMap<MotionSurfaceAdapter, View>()
|
|
21
|
+
const regions = new WeakMap<MotionRegionAdapter, View>()
|
|
22
|
+
export function nativeRegionTarget(adapter: MotionRegionAdapter) {
|
|
23
|
+
const target = regions.get(adapter)
|
|
24
|
+
if (!target?.isLoaded) throw new Error('Use a loaded native motion region.')
|
|
25
|
+
return target
|
|
26
|
+
}
|
|
27
|
+
export function assertNativeRegion(adapter: MotionRegionAdapter, target: View) {
|
|
28
|
+
const region = regions.get(adapter)
|
|
29
|
+
if (!region || region === target || !inside(target, region))
|
|
30
|
+
throw new TypeError('Use a separate enclosing native motion region.')
|
|
31
|
+
}
|
|
32
|
+
export function registerNativeSurface(adapter: MotionSurfaceAdapter, target: View) {
|
|
33
|
+
targets.set(adapter, target)
|
|
34
|
+
}
|
|
35
|
+
function resolve(adapter: MotionSurfaceAdapter) {
|
|
36
|
+
const target = targets.get(adapter)
|
|
37
|
+
if (!target?.isLoaded) throw new Error('Use a loaded native motion surface.')
|
|
38
|
+
return target
|
|
39
|
+
}
|
|
40
|
+
function inside(view: View, container: View) {
|
|
41
|
+
for (let current: View | undefined = view; current; current = current.parent as View | undefined)
|
|
42
|
+
if (current === container) return true
|
|
43
|
+
return false
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Native observation is event-driven geometry; Jolt remains the only playback clock. */
|
|
47
|
+
function viewportEnter(
|
|
48
|
+
container: View,
|
|
49
|
+
surfaces: readonly MotionSurfaceAdapter[],
|
|
50
|
+
options: Parameters<MotionRegionAdapter['viewportEnter']>[1],
|
|
51
|
+
) {
|
|
52
|
+
const targets = surfaces.map(resolve)
|
|
53
|
+
let root: View = options.root ? nativeScrollElement(options.root) : container
|
|
54
|
+
if (!options.root) {
|
|
55
|
+
for (
|
|
56
|
+
let parent = container.parent as View | undefined;
|
|
57
|
+
parent;
|
|
58
|
+
parent = parent.parent as View | undefined
|
|
59
|
+
)
|
|
60
|
+
if (parent instanceof ScrollView) {
|
|
61
|
+
root = parent
|
|
62
|
+
break
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const states = targets.map((target, index) => ({
|
|
66
|
+
target,
|
|
67
|
+
index,
|
|
68
|
+
visible: false,
|
|
69
|
+
completed: false,
|
|
70
|
+
animation: undefined as ReturnType<typeof animate> | undefined,
|
|
71
|
+
}))
|
|
72
|
+
let disposed = false,
|
|
73
|
+
disabled = options.disabled ?? false,
|
|
74
|
+
observing = false
|
|
75
|
+
const stop = (state: (typeof states)[number]) => {
|
|
76
|
+
const handle = state.animation
|
|
77
|
+
state.animation = undefined
|
|
78
|
+
if (handle) {
|
|
79
|
+
handle.progress = 1
|
|
80
|
+
handle.stop()
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const detach = () => {
|
|
84
|
+
if (!observing) return
|
|
85
|
+
observing = false
|
|
86
|
+
root.off('scroll', refresh)
|
|
87
|
+
root.off('layoutChanged', refresh)
|
|
88
|
+
for (const state of states) state.target.off('layoutChanged', refresh)
|
|
89
|
+
}
|
|
90
|
+
const refresh = () => {
|
|
91
|
+
if (disposed || disabled || Application.suspended || reducedMotion()) {
|
|
92
|
+
for (const state of states) {
|
|
93
|
+
stop(state)
|
|
94
|
+
state.visible = false
|
|
95
|
+
}
|
|
96
|
+
return
|
|
97
|
+
}
|
|
98
|
+
const size = root.getActualSize(),
|
|
99
|
+
margin = options.margin ?? 0
|
|
100
|
+
for (const state of states) {
|
|
101
|
+
if (!state.target.isLoaded || (options.once !== false && state.completed)) continue
|
|
102
|
+
const point = state.target.getLocationRelativeTo(root),
|
|
103
|
+
bounds = state.target.getActualSize()
|
|
104
|
+
const area = bounds.width * bounds.height
|
|
105
|
+
const overlap = point
|
|
106
|
+
? Math.max(
|
|
107
|
+
0,
|
|
108
|
+
Math.min(point.x + bounds.width, size.width + margin) - Math.max(point.x, -margin),
|
|
109
|
+
) *
|
|
110
|
+
Math.max(
|
|
111
|
+
0,
|
|
112
|
+
Math.min(point.y + bounds.height, size.height + margin) - Math.max(point.y, -margin),
|
|
113
|
+
)
|
|
114
|
+
: 0
|
|
115
|
+
const visible = area > 0 && overlap > 0 && overlap / area >= (options.threshold ?? 0)
|
|
116
|
+
if (!visible) stop(state)
|
|
117
|
+
if (visible && !state.visible && !state.animation) {
|
|
118
|
+
const animation = animate(state.target, options.frames ?? { opacity: [0, 1], y: [20, 0] }, {
|
|
119
|
+
...(options.transition?.type === 'gravity'
|
|
120
|
+
? options.transition
|
|
121
|
+
: { duration: 450, ...options.transition }),
|
|
122
|
+
delay: (options.transition?.delay ?? 0) + state.index * (options.stagger ?? 70),
|
|
123
|
+
})
|
|
124
|
+
state.animation = animation
|
|
125
|
+
void animation.finished.then((completed) => {
|
|
126
|
+
if (disposed || state.animation !== animation) return
|
|
127
|
+
state.animation = undefined
|
|
128
|
+
if (completed) state.completed = true
|
|
129
|
+
if (
|
|
130
|
+
options.once !== false &&
|
|
131
|
+
states.every((entry) => entry.completed || !entry.target.isLoaded)
|
|
132
|
+
)
|
|
133
|
+
detach()
|
|
134
|
+
})
|
|
135
|
+
}
|
|
136
|
+
state.visible = visible
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const attach = () => {
|
|
140
|
+
if (
|
|
141
|
+
observing ||
|
|
142
|
+
disposed ||
|
|
143
|
+
disabled ||
|
|
144
|
+
(options.once !== false && states.every((state) => state.completed))
|
|
145
|
+
)
|
|
146
|
+
return
|
|
147
|
+
observing = true
|
|
148
|
+
root.on('scroll', refresh)
|
|
149
|
+
root.on('layoutChanged', refresh)
|
|
150
|
+
for (const state of states) state.target.on('layoutChanged', refresh)
|
|
151
|
+
}
|
|
152
|
+
const preference = onReducedMotion(() => {
|
|
153
|
+
attach()
|
|
154
|
+
refresh()
|
|
155
|
+
})
|
|
156
|
+
Application.on(Application.suspendEvent, refresh)
|
|
157
|
+
Application.on(Application.resumeEvent, refresh)
|
|
158
|
+
attach()
|
|
159
|
+
refresh()
|
|
160
|
+
return {
|
|
161
|
+
execution: 'native-layout' as const,
|
|
162
|
+
get pending() {
|
|
163
|
+
return states.filter((state) => state.animation).length
|
|
164
|
+
},
|
|
165
|
+
get completed() {
|
|
166
|
+
return states.filter((state) => state.completed).length
|
|
167
|
+
},
|
|
168
|
+
update(state: { disabled: boolean }) {
|
|
169
|
+
disabled = state.disabled
|
|
170
|
+
if (disabled) detach()
|
|
171
|
+
else attach()
|
|
172
|
+
refresh()
|
|
173
|
+
},
|
|
174
|
+
refresh,
|
|
175
|
+
dispose() {
|
|
176
|
+
if (disposed) return
|
|
177
|
+
disposed = true
|
|
178
|
+
detach()
|
|
179
|
+
preference()
|
|
180
|
+
Application.off(Application.suspendEvent, refresh)
|
|
181
|
+
Application.off(Application.resumeEvent, refresh)
|
|
182
|
+
for (const state of states) stop(state)
|
|
183
|
+
},
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export function attachNativeMotionRegion(reference: MotionRegion, target: View) {
|
|
188
|
+
const resolveChild = (adapter: MotionSurfaceAdapter) => {
|
|
189
|
+
const child = resolve(adapter)
|
|
190
|
+
if (!inside(child, target) || child === target)
|
|
191
|
+
throw new Error('Declare each surface inside this motion region.')
|
|
192
|
+
return child
|
|
193
|
+
}
|
|
194
|
+
const scope = motionScope()
|
|
195
|
+
const steps = (
|
|
196
|
+
items: readonly (
|
|
197
|
+
| import('@getcortexlabs/mavis-core/experimental').MotionStep<MotionSurfaceAdapter>
|
|
198
|
+
| import('@getcortexlabs/mavis-core/experimental').MotionTimelineStep<MotionSurfaceAdapter>
|
|
199
|
+
)[],
|
|
200
|
+
) =>
|
|
201
|
+
items.map((step) =>
|
|
202
|
+
typeof step === 'function' || 'run' in step
|
|
203
|
+
? step
|
|
204
|
+
: ([resolveChild(step[0]), step[1], step[2]] as const),
|
|
205
|
+
)
|
|
206
|
+
const adapter: MotionRegionAdapter = {
|
|
207
|
+
animateLayout: (change, { transition, ...options }) =>
|
|
208
|
+
animateLayout(target, change, { ...transition, ...options }),
|
|
209
|
+
...nativePlatformMotion(target, resolveChild, scope),
|
|
210
|
+
...nativeCollectionMotion(target, resolveChild, scope),
|
|
211
|
+
sequence: (items) =>
|
|
212
|
+
scope.sequence(steps(items) as unknown as Parameters<typeof scope.sequence>[0]),
|
|
213
|
+
timeline: (items) =>
|
|
214
|
+
scope.timeline(steps(items) as unknown as Parameters<typeof scope.timeline>[0]),
|
|
215
|
+
states(targets, definitions, options) {
|
|
216
|
+
const timing = (
|
|
217
|
+
input: import('@getcortexlabs/mavis-core/experimental').MotionStateTransition | undefined,
|
|
218
|
+
) => {
|
|
219
|
+
const { targets, ...transition } = input ?? {}
|
|
220
|
+
return { ...transition, ...targets }
|
|
221
|
+
}
|
|
222
|
+
const control = scope.states(
|
|
223
|
+
Object.fromEntries(
|
|
224
|
+
Object.entries(targets).map(([name, surface]) => [
|
|
225
|
+
name,
|
|
226
|
+
surface && resolveChild(surface),
|
|
227
|
+
]),
|
|
228
|
+
),
|
|
229
|
+
Object.fromEntries(
|
|
230
|
+
Object.entries(definitions).map(([name, frames]) => [
|
|
231
|
+
name,
|
|
232
|
+
Object.fromEntries(
|
|
233
|
+
Object.entries(frames).filter(
|
|
234
|
+
(row): row is [string, NonNullable<(typeof row)[1]>] => row[1] !== undefined,
|
|
235
|
+
),
|
|
236
|
+
),
|
|
237
|
+
]),
|
|
238
|
+
),
|
|
239
|
+
{ transition: timing(options?.transition) },
|
|
240
|
+
)
|
|
241
|
+
return {
|
|
242
|
+
get current() {
|
|
243
|
+
return control.current
|
|
244
|
+
},
|
|
245
|
+
get settled() {
|
|
246
|
+
return control.settled
|
|
247
|
+
},
|
|
248
|
+
get paused() {
|
|
249
|
+
return control.paused
|
|
250
|
+
},
|
|
251
|
+
to: (name, transition) => control.to(name, timing(transition)),
|
|
252
|
+
attach: (name, surface) => control.attach(name, surface && resolveChild(surface)),
|
|
253
|
+
pause: () => control.pause(),
|
|
254
|
+
play: () => control.play(),
|
|
255
|
+
stop: () => control.stop(),
|
|
256
|
+
dispose: () => control.dispose(),
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
kind: 'native',
|
|
260
|
+
viewportEnter(surfaces, options) {
|
|
261
|
+
surfaces.forEach(resolveChild)
|
|
262
|
+
return viewportEnter(target, surfaces, options)
|
|
263
|
+
},
|
|
264
|
+
sharedLayout(options) {
|
|
265
|
+
const control = sharedLayout(target, options)
|
|
266
|
+
return {
|
|
267
|
+
get active() {
|
|
268
|
+
return control.active
|
|
269
|
+
},
|
|
270
|
+
attach: (surface, identity) => control.attach(resolveChild(surface), identity),
|
|
271
|
+
transition: (change, options) => control.transition(change, options),
|
|
272
|
+
cancel: () => control.cancel(),
|
|
273
|
+
dispose: () => control.dispose(),
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
}
|
|
277
|
+
regions.set(adapter, target)
|
|
278
|
+
try {
|
|
279
|
+
const release = bindMotionRegion(reference, adapter)
|
|
280
|
+
return () => {
|
|
281
|
+
try {
|
|
282
|
+
release()
|
|
283
|
+
} finally {
|
|
284
|
+
regions.delete(adapter)
|
|
285
|
+
scope.dispose()
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
} catch (error) {
|
|
289
|
+
regions.delete(adapter)
|
|
290
|
+
scope.dispose()
|
|
291
|
+
throw error
|
|
292
|
+
}
|
|
293
|
+
}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { nativeScrollMotion } from './scroll-motion.js'
|
|
2
|
+
import { assertNativeRegion, nativeRegionTarget } from './motion-region.js'
|
|
3
|
+
import { nativeSectionScroll } from './section-scroll.js'
|
|
4
|
+
import { nativeVisualEffects } from './visual-effects.js'
|
|
5
|
+
import { sensor } from '@rafaelaugusto/jolt/sensors'
|
|
6
|
+
import type { View, EventData, TouchGestureEventData } from '@nativescript/core'
|
|
7
|
+
import {
|
|
8
|
+
animate,
|
|
9
|
+
decay,
|
|
10
|
+
playbackProgress,
|
|
11
|
+
bind,
|
|
12
|
+
motionValue,
|
|
13
|
+
springValue,
|
|
14
|
+
set,
|
|
15
|
+
stop,
|
|
16
|
+
drag,
|
|
17
|
+
type DerivedValue,
|
|
18
|
+
} from '@rafaelaugusto/jolt'
|
|
19
|
+
import type {
|
|
20
|
+
MotionSurfaceAdapter,
|
|
21
|
+
MotionValueAdapter,
|
|
22
|
+
} from '@getcortexlabs/mavis-core/experimental'
|
|
23
|
+
|
|
24
|
+
export function nativeContinuousSurface(
|
|
25
|
+
target: View,
|
|
26
|
+
enabled: () => boolean,
|
|
27
|
+
plainText: () => boolean = () => false,
|
|
28
|
+
) {
|
|
29
|
+
const sources = new WeakMap<object, DerivedValue>()
|
|
30
|
+
const colorSources = new WeakMap<object, import('@rafaelaugusto/jolt').DerivedColor>()
|
|
31
|
+
const refreshes = new Set<() => void>()
|
|
32
|
+
const scrolls = new Set<ReturnType<typeof nativeScrollMotion>>()
|
|
33
|
+
const interrupt = (properties: readonly string[]) => {
|
|
34
|
+
for (const scroll of scrolls) scroll.interrupt(properties)
|
|
35
|
+
}
|
|
36
|
+
let suppressUntil = 0
|
|
37
|
+
const adapter: Pick<
|
|
38
|
+
MotionSurfaceAdapter,
|
|
39
|
+
| 'animateValue'
|
|
40
|
+
| 'stopValue'
|
|
41
|
+
| 'playbackProgress'
|
|
42
|
+
| 'decay'
|
|
43
|
+
| 'motionValue'
|
|
44
|
+
| 'springValue'
|
|
45
|
+
| 'bind'
|
|
46
|
+
| 'drag'
|
|
47
|
+
| 'map'
|
|
48
|
+
| 'mapColor'
|
|
49
|
+
| 'refresh'
|
|
50
|
+
| 'scrollLinked'
|
|
51
|
+
| 'scrollSection'
|
|
52
|
+
| 'pointerFollow'
|
|
53
|
+
| 'sensor'
|
|
54
|
+
> &
|
|
55
|
+
import('@getcortexlabs/mavis-core/experimental').MotionVisualAdapter = {
|
|
56
|
+
...nativeVisualEffects(target, sources, colorSources, plainText),
|
|
57
|
+
sensor(kind, options) {
|
|
58
|
+
const input = sensor(kind, options)
|
|
59
|
+
const wrap = (source: DerivedValue) => {
|
|
60
|
+
const value = { get: () => source.get(), dispose() {} }
|
|
61
|
+
sources.set(value, source)
|
|
62
|
+
return value
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
kind,
|
|
66
|
+
x: wrap(input.x),
|
|
67
|
+
y: wrap(input.y),
|
|
68
|
+
z: wrap(input.z),
|
|
69
|
+
quaternion:
|
|
70
|
+
input.kind === 'rotation'
|
|
71
|
+
? {
|
|
72
|
+
x: wrap(input.quaternion.x),
|
|
73
|
+
y: wrap(input.quaternion.y),
|
|
74
|
+
z: wrap(input.quaternion.z),
|
|
75
|
+
w: wrap(input.quaternion.w),
|
|
76
|
+
}
|
|
77
|
+
: undefined,
|
|
78
|
+
get status() {
|
|
79
|
+
return input.status
|
|
80
|
+
},
|
|
81
|
+
get available() {
|
|
82
|
+
return input.available
|
|
83
|
+
},
|
|
84
|
+
get paused() {
|
|
85
|
+
return input.paused
|
|
86
|
+
},
|
|
87
|
+
pause: () => input.pause(),
|
|
88
|
+
resume: () => input.play(),
|
|
89
|
+
recenter: () => {
|
|
90
|
+
if (input.kind === 'rotation') input.recenter()
|
|
91
|
+
},
|
|
92
|
+
requestPermission: async () => 'not-required' as const,
|
|
93
|
+
snapshot: () => ({ ...input.snapshot(), backend: 'native' as const }),
|
|
94
|
+
dispose: () => input.dispose(),
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
pointerFollow(region, options) {
|
|
98
|
+
assertNativeRegion(region, target)
|
|
99
|
+
const x = adapter.motionValue!(options.rest?.x ?? 0)
|
|
100
|
+
const y = adapter.motionValue!(options.rest?.y ?? 0)
|
|
101
|
+
return {
|
|
102
|
+
x,
|
|
103
|
+
y,
|
|
104
|
+
execution: 'static',
|
|
105
|
+
active: false,
|
|
106
|
+
update() {},
|
|
107
|
+
refresh() {},
|
|
108
|
+
dispose() {
|
|
109
|
+
x.dispose()
|
|
110
|
+
y.dispose()
|
|
111
|
+
},
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
scrollSection(source, section, frames, options) {
|
|
115
|
+
interrupt(Object.keys(frames))
|
|
116
|
+
const scroll = nativeSectionScroll(
|
|
117
|
+
source,
|
|
118
|
+
nativeRegionTarget(section),
|
|
119
|
+
target,
|
|
120
|
+
frames,
|
|
121
|
+
options,
|
|
122
|
+
)
|
|
123
|
+
scrolls.add(scroll)
|
|
124
|
+
return {
|
|
125
|
+
get execution() {
|
|
126
|
+
return scroll.execution
|
|
127
|
+
},
|
|
128
|
+
refresh: () => scroll.refresh(),
|
|
129
|
+
dispose() {
|
|
130
|
+
scrolls.delete(scroll)
|
|
131
|
+
scroll.dispose()
|
|
132
|
+
},
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
scrollLinked(source, frames, options) {
|
|
136
|
+
interrupt(Object.keys(frames))
|
|
137
|
+
const scroll = nativeScrollMotion(source, target, frames, options)
|
|
138
|
+
scrolls.add(scroll)
|
|
139
|
+
return {
|
|
140
|
+
get execution() {
|
|
141
|
+
return scroll.execution
|
|
142
|
+
},
|
|
143
|
+
refresh: () => scroll.refresh(),
|
|
144
|
+
dispose() {
|
|
145
|
+
scrolls.delete(scroll)
|
|
146
|
+
scroll.dispose()
|
|
147
|
+
},
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
// Native views keep their fractional pivot through layout; no surface recreation.
|
|
151
|
+
refresh: () => target.requestLayout(),
|
|
152
|
+
map(source, input, output, options) {
|
|
153
|
+
const mapped = sources.get(source)!.to(input, output, options)
|
|
154
|
+
const value = { get: () => mapped.get(), dispose() {} }
|
|
155
|
+
sources.set(value, mapped)
|
|
156
|
+
return value
|
|
157
|
+
},
|
|
158
|
+
mapColor(source, input, output) {
|
|
159
|
+
const mapped = sources.get(source)!.to(input, output)
|
|
160
|
+
const value = { get: () => mapped.get().hex, dispose() {} }
|
|
161
|
+
colorSources.set(value, mapped)
|
|
162
|
+
return value
|
|
163
|
+
},
|
|
164
|
+
animateValue(value, frames, options) {
|
|
165
|
+
const source = sources.get(value)
|
|
166
|
+
if (!source) throw new TypeError('Use a mutable native motion value.')
|
|
167
|
+
return animate(source as ReturnType<typeof motionValue>, frames, options)
|
|
168
|
+
},
|
|
169
|
+
stopValue(value, options) {
|
|
170
|
+
const source = sources.get(value)
|
|
171
|
+
if (!source) throw new TypeError('Use a native motion value.')
|
|
172
|
+
stop(source as ReturnType<typeof motionValue>, options)
|
|
173
|
+
},
|
|
174
|
+
playbackProgress(handle) {
|
|
175
|
+
const progress = playbackProgress(handle as Parameters<typeof playbackProgress>[0])
|
|
176
|
+
const value = { get: () => progress.get(), dispose() {} }
|
|
177
|
+
sources.set(value, progress)
|
|
178
|
+
return value
|
|
179
|
+
},
|
|
180
|
+
decay(velocity, options) {
|
|
181
|
+
interrupt(Object.keys(velocity))
|
|
182
|
+
return decay(target, velocity, options)
|
|
183
|
+
},
|
|
184
|
+
motionValue(initial) {
|
|
185
|
+
const source = motionValue(initial)
|
|
186
|
+
const value: MotionValueAdapter = {
|
|
187
|
+
get: () => source.get(),
|
|
188
|
+
set: (value) => set(source, value),
|
|
189
|
+
dispose: () => stop(source),
|
|
190
|
+
}
|
|
191
|
+
sources.set(value, source)
|
|
192
|
+
return value
|
|
193
|
+
},
|
|
194
|
+
springValue(input, options) {
|
|
195
|
+
const spring = springValue(sources.get(input)!, options)
|
|
196
|
+
const value = {
|
|
197
|
+
get: () => spring.get(),
|
|
198
|
+
getVelocity: () => spring.getVelocity(),
|
|
199
|
+
get moving() {
|
|
200
|
+
return spring.moving
|
|
201
|
+
},
|
|
202
|
+
get paused() {
|
|
203
|
+
return spring.paused
|
|
204
|
+
},
|
|
205
|
+
pause: () => spring.pause(),
|
|
206
|
+
resume: () => spring.play(),
|
|
207
|
+
dispose: () => spring.dispose(),
|
|
208
|
+
}
|
|
209
|
+
sources.set(value, spring)
|
|
210
|
+
return value
|
|
211
|
+
},
|
|
212
|
+
bind(values) {
|
|
213
|
+
interrupt(Object.keys(values))
|
|
214
|
+
const dispose = bind(
|
|
215
|
+
target,
|
|
216
|
+
Object.fromEntries(
|
|
217
|
+
Object.entries(values).map(([key, value]) => [
|
|
218
|
+
key,
|
|
219
|
+
colorSources.get(value) ?? sources.get(value)!,
|
|
220
|
+
]),
|
|
221
|
+
),
|
|
222
|
+
)
|
|
223
|
+
return { dispose }
|
|
224
|
+
},
|
|
225
|
+
drag(options) {
|
|
226
|
+
let paused = false
|
|
227
|
+
const gesture = drag(target, {
|
|
228
|
+
...options,
|
|
229
|
+
onMove: () => {
|
|
230
|
+
suppressUntil = Date.now() + 500
|
|
231
|
+
},
|
|
232
|
+
onRelease: (event) => {
|
|
233
|
+
suppressUntil = Date.now() + 500
|
|
234
|
+
options.onRelease?.(event)
|
|
235
|
+
},
|
|
236
|
+
})
|
|
237
|
+
const refresh = () => (paused || !enabled() ? gesture.pause() : gesture.play())
|
|
238
|
+
refreshes.add(refresh)
|
|
239
|
+
refresh()
|
|
240
|
+
const touch = (event: EventData) => {
|
|
241
|
+
if ((event as TouchGestureEventData).action === 'down') suppressUntil = 0
|
|
242
|
+
}
|
|
243
|
+
target.on('touch', touch)
|
|
244
|
+
return {
|
|
245
|
+
get dragging() {
|
|
246
|
+
return gesture.dragging
|
|
247
|
+
},
|
|
248
|
+
pause() {
|
|
249
|
+
paused = true
|
|
250
|
+
refresh()
|
|
251
|
+
},
|
|
252
|
+
resume() {
|
|
253
|
+
paused = false
|
|
254
|
+
refresh()
|
|
255
|
+
},
|
|
256
|
+
cancel: () => gesture.cancel(),
|
|
257
|
+
dispose() {
|
|
258
|
+
refreshes.delete(refresh)
|
|
259
|
+
target.off('touch', touch)
|
|
260
|
+
gesture.dispose()
|
|
261
|
+
},
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
}
|
|
265
|
+
return {
|
|
266
|
+
adapter,
|
|
267
|
+
interrupt,
|
|
268
|
+
refresh() {
|
|
269
|
+
for (const refresh of refreshes) refresh()
|
|
270
|
+
},
|
|
271
|
+
allowsActivation: () => Date.now() >= suppressUntil,
|
|
272
|
+
}
|
|
273
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { View } from '@nativescript/core'
|
|
2
|
+
import { onKeyboard, type MotionScope } from '@rafaelaugusto/jolt'
|
|
3
|
+
import { physicsWorld } from '@rafaelaugusto/jolt/physics'
|
|
4
|
+
import type {
|
|
5
|
+
MotionRegionAdapter,
|
|
6
|
+
MotionSurfaceAdapter,
|
|
7
|
+
MotionKeyboardState,
|
|
8
|
+
} from '@getcortexlabs/mavis-core/experimental'
|
|
9
|
+
|
|
10
|
+
function afterLayout(targets: readonly View[], scope: MotionScope): Promise<void> {
|
|
11
|
+
return new Promise((resolve, reject) => {
|
|
12
|
+
let settled = false,
|
|
13
|
+
release: (() => void) | undefined
|
|
14
|
+
const clear = () => {
|
|
15
|
+
settled = true
|
|
16
|
+
for (const target of targets) {
|
|
17
|
+
target.off('layoutChanged', changed)
|
|
18
|
+
target.off('unloaded', unloaded)
|
|
19
|
+
}
|
|
20
|
+
release?.()
|
|
21
|
+
}
|
|
22
|
+
const check = () => {
|
|
23
|
+
if (settled) return
|
|
24
|
+
if (
|
|
25
|
+
targets.every(
|
|
26
|
+
(target) =>
|
|
27
|
+
target.isLoaded &&
|
|
28
|
+
target.isLayoutValid &&
|
|
29
|
+
target.getActualSize().width > 0 &&
|
|
30
|
+
target.getActualSize().height > 0,
|
|
31
|
+
)
|
|
32
|
+
) {
|
|
33
|
+
clear()
|
|
34
|
+
resolve()
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const changed = () => {
|
|
38
|
+
void Promise.resolve().then(check)
|
|
39
|
+
}
|
|
40
|
+
const unloaded = () => {
|
|
41
|
+
if (settled) return
|
|
42
|
+
clear()
|
|
43
|
+
reject(new Error('Physics presentation released before layout.'))
|
|
44
|
+
}
|
|
45
|
+
if (scope.disposed || scope.suspended) {
|
|
46
|
+
unloaded()
|
|
47
|
+
return
|
|
48
|
+
}
|
|
49
|
+
for (const target of targets) {
|
|
50
|
+
target.on('layoutChanged', changed)
|
|
51
|
+
target.on('unloaded', unloaded)
|
|
52
|
+
}
|
|
53
|
+
release = scope.use(() => unloaded)
|
|
54
|
+
check()
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
export function nativePlatformMotion(
|
|
58
|
+
target: View,
|
|
59
|
+
resolve: (surface: MotionSurfaceAdapter) => View,
|
|
60
|
+
scope: MotionScope,
|
|
61
|
+
): Pick<MotionRegionAdapter, 'onKeyboard' | 'physicsWorld'> {
|
|
62
|
+
return {
|
|
63
|
+
onKeyboard(callback) {
|
|
64
|
+
let state: MotionKeyboardState = {
|
|
65
|
+
visible: false,
|
|
66
|
+
height: 0,
|
|
67
|
+
duration: 0,
|
|
68
|
+
backend: 'native',
|
|
69
|
+
accuracy: 'unavailable',
|
|
70
|
+
}
|
|
71
|
+
const read = () => state
|
|
72
|
+
const release = scope.use(() => {
|
|
73
|
+
const off = onKeyboard((value) => {
|
|
74
|
+
state = { ...value, backend: 'native', accuracy: 'native' }
|
|
75
|
+
callback(state)
|
|
76
|
+
})
|
|
77
|
+
callback(read())
|
|
78
|
+
return off
|
|
79
|
+
})
|
|
80
|
+
return { snapshot: read, dispose: release }
|
|
81
|
+
},
|
|
82
|
+
async physicsWorld(bodies, options) {
|
|
83
|
+
const mapped = bodies.map(({ target, ...body }) => ({ ...body, view: resolve(target) }))
|
|
84
|
+
await afterLayout([target, ...mapped.map((body) => body.view)], scope)
|
|
85
|
+
if (scope.disposed || scope.suspended) throw new Error('Physics presentation is inactive.')
|
|
86
|
+
const world = physicsWorld(target, mapped, { ...options, scope })
|
|
87
|
+
return {
|
|
88
|
+
get paused() {
|
|
89
|
+
return world.paused
|
|
90
|
+
},
|
|
91
|
+
pause: () => world.pause(),
|
|
92
|
+
resume: () => world.play(),
|
|
93
|
+
reset: () => world.reset(),
|
|
94
|
+
impulse: (id, value) => world.impulse(id, value),
|
|
95
|
+
attach: (id, value) => world.attach(id, value),
|
|
96
|
+
spring: (id, value) => world.spring(id, value),
|
|
97
|
+
snapTo: (id, index) => world.snapTo(id, index),
|
|
98
|
+
snapshot: () => world.snapshot(),
|
|
99
|
+
dispose: () => world.dispose(),
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
}
|
|
103
|
+
}
|