@getcortexlabs/mavis 0.1.0-alpha.8 → 0.1.0-rc.11.1
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 +8 -6
- 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/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/motion-region.d.ts +1 -0
- package/dist/native/motion-region.d.ts.map +1 -1
- package/dist/native/motion-region.js +8 -1
- package/dist/native/motion-region.js.map +1 -1
- package/dist/native/motion-surface.d.ts +1 -1
- package/dist/native/motion-surface.d.ts.map +1 -1
- package/dist/native/motion-surface.js +17 -1
- package/dist/native/motion-surface.js.map +1 -1
- package/dist/native/number-flow-format.android.d.ts +3 -0
- package/dist/native/number-flow-format.android.d.ts.map +1 -0
- package/dist/native/number-flow-format.android.js +27 -0
- package/dist/native/number-flow-format.android.js.map +1 -0
- package/dist/native/number-flow-format.d.ts +4 -0
- package/dist/native/number-flow-format.d.ts.map +1 -0
- package/dist/native/number-flow-format.ios.d.ts +3 -0
- package/dist/native/number-flow-format.ios.d.ts.map +1 -0
- package/dist/native/number-flow-format.ios.js +24 -0
- package/dist/native/number-flow-format.ios.js.map +1 -0
- package/dist/native/number-flow-format.js +5 -0
- package/dist/native/number-flow-format.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.map +1 -1
- package/dist/native/segmented.js +4 -3
- package/dist/native/segmented.js.map +1 -1
- package/dist/vue/animated-number.d.ts +6 -0
- package/dist/vue/animated-number.d.ts.map +1 -0
- package/dist/vue/animated-number.js +52 -0
- package/dist/vue/animated-number.js.map +1 -0
- package/dist/vue/component-width.d.ts +7 -0
- package/dist/vue/component-width.d.ts.map +1 -0
- package/dist/vue/component-width.js +29 -0
- package/dist/vue/component-width.js.map +1 -0
- package/dist/vue/components/ChartPlot.d.ts +66 -0
- package/dist/vue/components/ChartPlot.d.ts.map +1 -0
- package/dist/vue/components/ChartPlot.js +236 -0
- package/dist/vue/components/ChartPlot.js.map +1 -0
- package/dist/vue/components/ChoiceControl.d.ts +3 -0
- package/dist/vue/components/ChoiceControl.d.ts.map +1 -1
- package/dist/vue/components/ChoiceControl.js +29 -22
- package/dist/vue/components/ChoiceControl.js.map +1 -1
- package/dist/vue/components/DateCalendar.d.ts +17 -2
- package/dist/vue/components/DateCalendar.d.ts.map +1 -1
- package/dist/vue/components/DateCalendar.js +45 -10
- package/dist/vue/components/DateCalendar.js.map +1 -1
- package/dist/vue/components/LoadingDecoration.d.ts +1 -1
- package/dist/vue/components/MAccordion.d.ts +1 -1
- package/dist/vue/components/MAlert.d.ts +3 -3
- package/dist/vue/components/MAlert.d.ts.map +1 -1
- package/dist/vue/components/MAlert.js +3 -0
- package/dist/vue/components/MAlert.js.map +1 -1
- package/dist/vue/components/MAvatar.d.ts +1 -1
- package/dist/vue/components/MAvatar.d.ts.map +1 -1
- package/dist/vue/components/MAvatar.js +5 -1
- package/dist/vue/components/MAvatar.js.map +1 -1
- package/dist/vue/components/MBadge.d.ts +1 -1
- package/dist/vue/components/MBadge.d.ts.map +1 -1
- package/dist/vue/components/MBadge.js +3 -1
- package/dist/vue/components/MBadge.js.map +1 -1
- package/dist/vue/components/MButton.d.ts +6 -6
- package/dist/vue/components/MButton.d.ts.map +1 -1
- package/dist/vue/components/MButton.js +4 -3
- package/dist/vue/components/MButton.js.map +1 -1
- package/dist/vue/components/MCard.d.ts +3 -3
- package/dist/vue/components/MCard.d.ts.map +1 -1
- package/dist/vue/components/MCard.js +4 -3
- package/dist/vue/components/MCard.js.map +1 -1
- package/dist/vue/components/MChip.d.ts +2 -2
- package/dist/vue/components/MCombobox.d.ts +3 -3
- package/dist/vue/components/MCombobox.d.ts.map +1 -1
- package/dist/vue/components/MCombobox.js +3 -1
- package/dist/vue/components/MCombobox.js.map +1 -1
- package/dist/vue/components/MDatePicker.d.ts +72 -24
- package/dist/vue/components/MDatePicker.d.ts.map +1 -1
- package/dist/vue/components/MDatePicker.js +4 -14
- package/dist/vue/components/MDatePicker.js.map +1 -1
- package/dist/vue/components/MDialog.d.ts +3 -3
- package/dist/vue/components/MEmptyState.d.ts +2 -2
- package/dist/vue/components/MEmptyState.d.ts.map +1 -1
- package/dist/vue/components/MEmptyState.js +3 -0
- package/dist/vue/components/MEmptyState.js.map +1 -1
- package/dist/vue/components/MFilePicker.d.ts +4 -4
- package/dist/vue/components/MFilePicker.d.ts.map +1 -1
- package/dist/vue/components/MFilePicker.js +3 -0
- package/dist/vue/components/MFilePicker.js.map +1 -1
- package/dist/vue/components/MGrid.d.ts +176 -0
- package/dist/vue/components/MGrid.d.ts.map +1 -0
- package/dist/vue/components/MGrid.js +56 -0
- package/dist/vue/components/MGrid.js.map +1 -0
- package/dist/vue/components/MIcon.d.ts +3 -3
- package/dist/vue/components/MImage.d.ts +47 -2
- package/dist/vue/components/MImage.d.ts.map +1 -1
- package/dist/vue/components/MImage.js +8 -1
- package/dist/vue/components/MImage.js.map +1 -1
- package/dist/vue/components/MImageCompare.d.ts +92 -0
- package/dist/vue/components/MImageCompare.d.ts.map +1 -0
- package/dist/vue/components/MImageCompare.js +138 -0
- package/dist/vue/components/MImageCompare.js.map +1 -0
- package/dist/vue/components/MImageViewer.d.ts +121 -0
- package/dist/vue/components/MImageViewer.d.ts.map +1 -0
- package/dist/vue/components/MImageViewer.js +444 -0
- package/dist/vue/components/MImageViewer.js.map +1 -0
- package/dist/vue/components/MInput.d.ts +6 -6
- package/dist/vue/components/MInput.d.ts.map +1 -1
- package/dist/vue/components/MInput.js +18 -0
- package/dist/vue/components/MInput.js.map +1 -1
- package/dist/vue/components/MLink.d.ts.map +1 -1
- package/dist/vue/components/MLink.js +6 -11
- package/dist/vue/components/MLink.js.map +1 -1
- package/dist/vue/components/MListItem.d.ts +1 -1
- 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 +247 -0
- package/dist/vue/components/MPopover.js.map +1 -0
- package/dist/vue/components/MProgress.d.ts +3 -3
- package/dist/vue/components/MProgress.d.ts.map +1 -1
- package/dist/vue/components/MProgress.js +5 -2
- package/dist/vue/components/MProgress.js.map +1 -1
- 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 +134 -0
- package/dist/vue/components/MRangeSlider.js.map +1 -0
- package/dist/vue/components/MResizablePanels.d.ts +137 -0
- package/dist/vue/components/MResizablePanels.d.ts.map +1 -0
- package/dist/vue/components/MResizablePanels.js +148 -0
- package/dist/vue/components/MResizablePanels.js.map +1 -0
- package/dist/vue/components/MReveal.d.ts +11 -11
- package/dist/vue/components/MSelect.d.ts +1 -1
- package/dist/vue/components/MSheet.d.ts +14 -5
- package/dist/vue/components/MSheet.d.ts.map +1 -1
- package/dist/vue/components/MStack.d.ts +22 -11
- package/dist/vue/components/MStack.d.ts.map +1 -1
- package/dist/vue/components/MStack.js +6 -1
- package/dist/vue/components/MStack.js.map +1 -1
- package/dist/vue/components/MTabs.d.ts.map +1 -1
- package/dist/vue/components/MTabs.js +6 -5
- package/dist/vue/components/MTabs.js.map +1 -1
- package/dist/vue/components/MText.d.ts +4 -4
- 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/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 +106 -0
- package/dist/vue/components/MVirtualList.js.map +1 -0
- package/dist/vue/components/MotionRows.d.ts +15 -0
- package/dist/vue/components/MotionRows.d.ts.map +1 -0
- package/dist/vue/components/MotionRows.js +12 -0
- package/dist/vue/components/MotionRows.js.map +1 -0
- package/dist/vue/components/configurator.d.ts +5 -5
- 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 +65 -0
- package/dist/vue/components/discovery.js.map +1 -0
- package/dist/vue/components/interactive.d.ts +164 -0
- package/dist/vue/components/interactive.d.ts.map +1 -0
- package/dist/vue/components/interactive.js +33 -0
- package/dist/vue/components/interactive.js.map +1 -0
- package/dist/vue/components/layout.d.ts +47 -25
- package/dist/vue/components/layout.d.ts.map +1 -1
- package/dist/vue/components/layout.js +2 -1
- 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 +39 -0
- package/dist/vue/components/wayfinding.js.map +1 -0
- package/dist/vue/components/workflows.d.ts +2 -2
- package/dist/vue/index.d.ts +22 -12
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +47 -12
- package/dist/vue/index.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/package.json +16 -5
- package/src/date-format.ts +2 -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/motion-region.ts +14 -1
- package/src/native/motion-surface.ts +24 -1
- package/src/native/number-flow-format.android.ts +61 -0
- package/src/native/number-flow-format.ios.ts +40 -0
- package/src/native/number-flow-format.ts +9 -0
- package/src/native/section-scroll.ts +81 -0
- package/src/native/segmented.ts +4 -3
- package/src/vue/animated-number.ts +57 -0
- package/src/vue/component-width.ts +34 -0
- package/src/vue/components/ChartPlot.ts +267 -0
- package/src/vue/components/ChoiceControl.ts +32 -25
- package/src/vue/components/DateCalendar.ts +50 -9
- package/src/vue/components/MAlert.ts +3 -0
- package/src/vue/components/MAvatar.ts +5 -1
- package/src/vue/components/MBadge.ts +3 -1
- package/src/vue/components/MButton.ts +4 -2
- package/src/vue/components/MCard.ts +4 -2
- package/src/vue/components/MCombobox.ts +6 -1
- package/src/vue/components/MDatePicker.ts +3 -11
- package/src/vue/components/MEmptyState.ts +3 -0
- package/src/vue/components/MFilePicker.ts +3 -0
- package/src/vue/components/MGrid.ts +100 -0
- package/src/vue/components/MImage.ts +10 -1
- package/src/vue/components/MImageCompare.ts +162 -0
- package/src/vue/components/MImageViewer.ts +489 -0
- package/src/vue/components/MInput.ts +17 -3
- package/src/vue/components/MLink.ts +12 -9
- package/src/vue/components/MPopover.ts +305 -0
- package/src/vue/components/MProgress.ts +8 -2
- package/src/vue/components/MRangeSlider.ts +157 -0
- package/src/vue/components/MResizablePanels.ts +180 -0
- package/src/vue/components/MStack.ts +6 -0
- package/src/vue/components/MTabs.ts +10 -4
- package/src/vue/components/MTimePicker.ts +57 -0
- package/src/vue/components/MTooltip.ts +39 -0
- package/src/vue/components/MVirtualList.ts +140 -0
- package/src/vue/components/MotionRows.ts +17 -0
- package/src/vue/components/discovery.ts +91 -0
- package/src/vue/components/interactive.ts +43 -0
- package/src/vue/components/layout.ts +2 -0
- package/src/vue/components/navigation.ts +19 -0
- package/src/vue/components/wayfinding.ts +48 -0
- package/src/vue/index.ts +142 -69
- package/src/vue/router-navigation.ts +39 -0
- package/src/vue/services.ts +39 -0
package/src/vue/index.ts
CHANGED
|
@@ -1,6 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MImageViewer,
|
|
3
|
+
MNumberFlow,
|
|
4
|
+
MSortableList,
|
|
5
|
+
MSwipeActions,
|
|
6
|
+
MResizablePanels,
|
|
7
|
+
MImageCompare,
|
|
8
|
+
} from './components/interactive.js'
|
|
9
|
+
import {
|
|
10
|
+
MCommandPalette,
|
|
11
|
+
MNavigationRail,
|
|
12
|
+
MBreadcrumb,
|
|
13
|
+
MTimeline,
|
|
14
|
+
MChart,
|
|
15
|
+
} from './components/wayfinding.js'
|
|
16
|
+
import { MTooltip } from './components/MTooltip.js'
|
|
17
|
+
import { MDataTable, MCarousel, MCalendar, MRating, MTreeView } from './components/discovery.js'
|
|
18
|
+
import { MRangeSlider } from './components/MRangeSlider.js'
|
|
19
|
+
import { MPopover } from './components/MPopover.js'
|
|
20
|
+
import { MMenu, MAppBar, MTabBar } from './components/navigation.js'
|
|
21
|
+
import { MTimePicker } from './components/MTimePicker.js'
|
|
22
|
+
import { MVirtualList } from './components/MVirtualList.js'
|
|
1
23
|
import { MNumberInput, MMultiSelect } from './components/configurator.js'
|
|
2
24
|
import { MImage } from './components/MImage.js'
|
|
3
25
|
import { MStack } from './components/MStack.js'
|
|
26
|
+
import { MGrid } from './components/MGrid.js'
|
|
4
27
|
import { MLink } from './components/MLink.js'
|
|
5
28
|
import { MDatePicker, MDateRangePicker } from './components/MDatePicker.js'
|
|
6
29
|
import { MCombobox } from './components/MCombobox.js'
|
|
@@ -8,16 +31,11 @@ import { MFilePicker } from './components/MFilePicker.js'
|
|
|
8
31
|
import { MFormGroup, MFormErrors, MSteps, MPagination } from './components/workflows.js'
|
|
9
32
|
import { MChip } from './components/MChip.js'
|
|
10
33
|
import { MEmptyState } from './components/MEmptyState.js'
|
|
11
|
-
import type { App } from 'nativescript-vue'
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
installAppToast,
|
|
17
|
-
themeKey,
|
|
18
|
-
type ThemeContextOptions,
|
|
19
|
-
} from '@getcortexlabs/mavis-core/vue'
|
|
20
|
-
import { systemAppearance } from '../native/appearance'
|
|
34
|
+
import type { App, Component } from 'nativescript-vue'
|
|
35
|
+
import { createMavisServices, type MavisServiceOptions } from './services.js'
|
|
36
|
+
export { createMavisServices } from './services.js'
|
|
37
|
+
export type { MavisServiceOptions } from './services.js'
|
|
38
|
+
import { MThemeProvider, MSpan, MPlatform } from '@getcortexlabs/mavis-core/vue'
|
|
21
39
|
import { MScreen } from './components/MScreen.js'
|
|
22
40
|
import { MBox, MRow, MColumn } from './components/layout.js'
|
|
23
41
|
import { MCard } from './components/MCard.js'
|
|
@@ -44,16 +62,24 @@ import { MInput } from './components/MInput.js'
|
|
|
44
62
|
import { MIcon } from './components/MIcon.js'
|
|
45
63
|
import { MReveal } from './components/MReveal.js'
|
|
46
64
|
import { MSheet } from './components/MSheet.js'
|
|
47
|
-
import {
|
|
65
|
+
import type { ClaimSystemBack, SystemBackClaimant } from './system-back.js'
|
|
48
66
|
|
|
49
67
|
export {
|
|
68
|
+
MImageViewer,
|
|
69
|
+
MNumberFlow,
|
|
70
|
+
MSortableList,
|
|
71
|
+
MSwipeActions,
|
|
72
|
+
MResizablePanels,
|
|
73
|
+
MImageCompare,
|
|
50
74
|
MThemeProvider,
|
|
75
|
+
MPlatform,
|
|
51
76
|
MSpan,
|
|
52
77
|
MScreen,
|
|
53
78
|
MBox,
|
|
54
79
|
MRow,
|
|
55
80
|
MColumn,
|
|
56
81
|
MStack,
|
|
82
|
+
MGrid,
|
|
57
83
|
MLink,
|
|
58
84
|
MCard,
|
|
59
85
|
MText,
|
|
@@ -92,16 +118,40 @@ export {
|
|
|
92
118
|
MFormErrors,
|
|
93
119
|
MSteps,
|
|
94
120
|
MPagination,
|
|
121
|
+
MPopover,
|
|
122
|
+
MMenu,
|
|
123
|
+
MAppBar,
|
|
124
|
+
MTabBar,
|
|
125
|
+
MTimePicker,
|
|
126
|
+
MVirtualList,
|
|
127
|
+
MDataTable,
|
|
128
|
+
MCarousel,
|
|
129
|
+
MRangeSlider,
|
|
130
|
+
MCalendar,
|
|
131
|
+
MRating,
|
|
132
|
+
MTreeView,
|
|
133
|
+
MCommandPalette,
|
|
134
|
+
MNavigationRail,
|
|
135
|
+
MBreadcrumb,
|
|
136
|
+
MTooltip,
|
|
137
|
+
MTimeline,
|
|
138
|
+
MChart,
|
|
95
139
|
}
|
|
96
140
|
export {
|
|
97
141
|
useMavisTheme,
|
|
142
|
+
useMavisPlatform,
|
|
143
|
+
useMavisListMotion,
|
|
98
144
|
useToast,
|
|
99
145
|
useFormController,
|
|
100
146
|
useFormField,
|
|
101
147
|
useFileSelection,
|
|
148
|
+
useMavisNavigation,
|
|
102
149
|
} from '@getcortexlabs/mavis-core/vue'
|
|
103
150
|
export type {
|
|
104
151
|
MavisThemeContext,
|
|
152
|
+
MavisPlatform,
|
|
153
|
+
MavisPlatformTarget,
|
|
154
|
+
MavisPlatformContext,
|
|
105
155
|
Appearance,
|
|
106
156
|
AppearanceMode,
|
|
107
157
|
AppearanceSource,
|
|
@@ -111,69 +161,90 @@ export type {} from '@getcortexlabs/mavis-core/vue'
|
|
|
111
161
|
|
|
112
162
|
export type { SystemBackClaimant, ClaimSystemBack }
|
|
113
163
|
|
|
114
|
-
export type MavisOptions =
|
|
115
|
-
toast?: { closeLabel?: string }
|
|
116
|
-
/** Lets a router hand the Android back press to an open sheet first, e.g. vue-router-ns `claimSystemBack`. */
|
|
117
|
-
claimSystemBack?: ClaimSystemBack
|
|
118
|
-
}
|
|
164
|
+
export type MavisOptions = MavisServiceOptions & { components?: false | Record<string, Component> }
|
|
119
165
|
|
|
120
166
|
/** Create one plugin per application; `system` appearance follows the device. Vue also resolves MButton as <m-button>. */
|
|
121
167
|
export function createMavis(options: MavisOptions = {}) {
|
|
122
168
|
return {
|
|
123
169
|
install(app: App) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
170
|
+
const { components, ...services } = options
|
|
171
|
+
createMavisServices(services).install(app)
|
|
172
|
+
if (components === false) return
|
|
173
|
+
for (const [name, component] of Object.entries(
|
|
174
|
+
components ?? {
|
|
175
|
+
MImageViewer,
|
|
176
|
+
MNumberFlow,
|
|
177
|
+
MSortableList,
|
|
178
|
+
MSwipeActions,
|
|
179
|
+
MResizablePanels,
|
|
180
|
+
MImageCompare,
|
|
181
|
+
MThemeProvider,
|
|
182
|
+
MPlatform,
|
|
183
|
+
MSpan,
|
|
184
|
+
MScreen,
|
|
185
|
+
MBox,
|
|
186
|
+
MRow,
|
|
187
|
+
MColumn,
|
|
188
|
+
MStack,
|
|
189
|
+
MGrid,
|
|
190
|
+
MLink,
|
|
191
|
+
MCard,
|
|
192
|
+
MText,
|
|
193
|
+
MButton,
|
|
194
|
+
MSlider,
|
|
195
|
+
MSwitch,
|
|
196
|
+
MCheckbox,
|
|
197
|
+
MRadioGroup,
|
|
198
|
+
MSelect,
|
|
199
|
+
MToast,
|
|
200
|
+
MDialog,
|
|
201
|
+
MTabs,
|
|
202
|
+
MSkeleton,
|
|
203
|
+
MChip,
|
|
204
|
+
MEmptyState,
|
|
205
|
+
MProgress,
|
|
206
|
+
MAccordion,
|
|
207
|
+
MSegmentedControl,
|
|
208
|
+
MAlert,
|
|
209
|
+
MListItem,
|
|
210
|
+
MSeparator,
|
|
211
|
+
MAvatar,
|
|
212
|
+
MBadge,
|
|
213
|
+
MInput,
|
|
214
|
+
MIcon,
|
|
215
|
+
MReveal,
|
|
216
|
+
MSheet,
|
|
217
|
+
MDatePicker,
|
|
218
|
+
MDateRangePicker,
|
|
219
|
+
MNumberInput,
|
|
220
|
+
MMultiSelect,
|
|
221
|
+
MImage,
|
|
222
|
+
MCombobox,
|
|
223
|
+
MFilePicker,
|
|
224
|
+
MFormGroup,
|
|
225
|
+
MFormErrors,
|
|
226
|
+
MSteps,
|
|
227
|
+
MPagination,
|
|
228
|
+
MPopover,
|
|
229
|
+
MMenu,
|
|
230
|
+
MAppBar,
|
|
231
|
+
MTabBar,
|
|
232
|
+
MTimePicker,
|
|
233
|
+
MVirtualList,
|
|
234
|
+
MDataTable,
|
|
235
|
+
MCarousel,
|
|
236
|
+
MRangeSlider,
|
|
237
|
+
MCalendar,
|
|
238
|
+
MRating,
|
|
239
|
+
MTreeView,
|
|
240
|
+
MCommandPalette,
|
|
241
|
+
MNavigationRail,
|
|
242
|
+
MBreadcrumb,
|
|
243
|
+
MTooltip,
|
|
244
|
+
MTimeline,
|
|
245
|
+
MChart,
|
|
246
|
+
},
|
|
247
|
+
)) {
|
|
177
248
|
app.component(name, component)
|
|
178
249
|
}
|
|
179
250
|
},
|
|
@@ -181,3 +252,5 @@ export function createMavis(options: MavisOptions = {}) {
|
|
|
181
252
|
}
|
|
182
253
|
|
|
183
254
|
export * from '../files.js'
|
|
255
|
+
|
|
256
|
+
export { createMavisNavigation } from './router-navigation.js'
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createRouterNavigation,
|
|
3
|
+
defineNavigationTransition,
|
|
4
|
+
type MavisRouter,
|
|
5
|
+
type NavigationTransition,
|
|
6
|
+
} from '@getcortexlabs/mavis-core'
|
|
7
|
+
|
|
8
|
+
export interface NativeNavigationRouter extends MavisRouter {
|
|
9
|
+
push(
|
|
10
|
+
href: string,
|
|
11
|
+
options?: { animated?: boolean; transition?: { name: string; duration: number } },
|
|
12
|
+
): unknown
|
|
13
|
+
replace(
|
|
14
|
+
href: string,
|
|
15
|
+
options?: { animated?: boolean; transition?: { name: string; duration: number } },
|
|
16
|
+
): unknown
|
|
17
|
+
back(options?: { animated?: boolean }): unknown
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** vue-router-ns owns native transitions, reduced motion, interactive back and focus. */
|
|
21
|
+
export function createMavisNavigation(
|
|
22
|
+
router: NativeNavigationRouter,
|
|
23
|
+
options: { transition?: NavigationTransition } = {},
|
|
24
|
+
) {
|
|
25
|
+
const policy = defineNavigationTransition(options.transition)
|
|
26
|
+
const native =
|
|
27
|
+
policy.name === 'none' || policy.duration === 0
|
|
28
|
+
? { animated: false }
|
|
29
|
+
: { transition: { name: policy.name, duration: policy.duration } }
|
|
30
|
+
return createRouterNavigation({
|
|
31
|
+
resolve: (href) => router.resolve(href),
|
|
32
|
+
push: (href) => router.push(href, native),
|
|
33
|
+
replace: (href) => router.replace(href, native),
|
|
34
|
+
back: () =>
|
|
35
|
+
router.back(
|
|
36
|
+
policy.name === 'none' || policy.duration === 0 ? { animated: false } : undefined,
|
|
37
|
+
),
|
|
38
|
+
})
|
|
39
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { App } from 'nativescript-vue'
|
|
2
|
+
import { isIOS } from '@nativescript/core'
|
|
3
|
+
import type { MavisNavigation } from '@getcortexlabs/mavis-core'
|
|
4
|
+
import {
|
|
5
|
+
createThemeContext,
|
|
6
|
+
installAppToast,
|
|
7
|
+
themeKey,
|
|
8
|
+
navigationKey,
|
|
9
|
+
platformKey,
|
|
10
|
+
createPlatformContext,
|
|
11
|
+
type ThemeContextOptions,
|
|
12
|
+
} from '@getcortexlabs/mavis-core/vue'
|
|
13
|
+
import { systemAppearance } from '../native/appearance'
|
|
14
|
+
import { systemBackKey, type ClaimSystemBack } from './system-back.js'
|
|
15
|
+
|
|
16
|
+
export type MavisServiceOptions = Omit<ThemeContextOptions, 'source'> & {
|
|
17
|
+
toast?: { closeLabel?: string }
|
|
18
|
+
claimSystemBack?: ClaimSystemBack
|
|
19
|
+
navigation?: MavisNavigation
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Application-owned services without global component registration. */
|
|
23
|
+
export function createMavisServices(options: MavisServiceOptions = {}) {
|
|
24
|
+
return {
|
|
25
|
+
install(app: App) {
|
|
26
|
+
app.provide(platformKey, createPlatformContext(isIOS ? 'ios' : 'android'))
|
|
27
|
+
installAppToast(app, options.toast)
|
|
28
|
+
const { toast: _toast, claimSystemBack, navigation, ...theme } = options
|
|
29
|
+
const context = createThemeContext({ ...theme, source: systemAppearance() })
|
|
30
|
+
app.provide(themeKey, context)
|
|
31
|
+
app.provide(systemBackKey, claimSystemBack)
|
|
32
|
+
app.provide(navigationKey, navigation)
|
|
33
|
+
app.onUnmount(() => {
|
|
34
|
+
context.dispose()
|
|
35
|
+
navigation?.dispose?.()
|
|
36
|
+
})
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
}
|