@getcortexlabs/mavis-core 0.1.0-alpha.9 → 0.1.0-rc.12
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 +2 -2
- package/dist/capabilities.d.ts +7 -7
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +48 -4
- package/dist/capabilities.js.map +1 -1
- package/dist/chart.d.ts +43 -0
- package/dist/chart.d.ts.map +1 -0
- package/dist/chart.js +105 -0
- package/dist/chart.js.map +1 -0
- package/dist/collections.d.ts +46 -0
- package/dist/collections.d.ts.map +1 -0
- package/dist/collections.js +48 -0
- package/dist/collections.js.map +1 -0
- package/dist/contracts.d.ts +20 -0
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +2 -0
- package/dist/contracts.js.map +1 -1
- package/dist/creative-controls.d.ts +47 -0
- package/dist/creative-controls.d.ts.map +1 -0
- package/dist/creative-controls.js +112 -0
- package/dist/creative-controls.js.map +1 -0
- package/dist/dashboard.d.ts +72 -0
- package/dist/dashboard.d.ts.map +1 -0
- package/dist/dashboard.js +115 -0
- package/dist/dashboard.js.map +1 -0
- package/dist/discovery.d.ts +49 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +80 -0
- package/dist/discovery.js.map +1 -0
- package/dist/experimental-regions.d.ts +10 -0
- package/dist/experimental-regions.d.ts.map +1 -1
- package/dist/experimental-regions.js +23 -0
- package/dist/experimental-regions.js.map +1 -1
- package/dist/experimental.d.ts +5 -0
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.js +29 -0
- package/dist/experimental.js.map +1 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/interactive.d.ts +36 -0
- package/dist/interactive.d.ts.map +1 -0
- package/dist/interactive.js +61 -0
- package/dist/interactive.js.map +1 -0
- package/dist/link.d.ts +2 -0
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js.map +1 -1
- package/dist/motion.d.ts +8 -0
- package/dist/motion.d.ts.map +1 -1
- package/dist/motion.js +11 -0
- package/dist/motion.js.map +1 -1
- package/dist/navigation-transition.d.ts +10 -0
- package/dist/navigation-transition.d.ts.map +1 -0
- package/dist/navigation-transition.js +10 -0
- package/dist/navigation-transition.js.map +1 -0
- package/dist/number-flow-format.d.ts +16 -0
- package/dist/number-flow-format.d.ts.map +1 -0
- package/dist/number-flow-format.js +49 -0
- package/dist/number-flow-format.js.map +1 -0
- package/dist/popover.d.ts +17 -0
- package/dist/popover.d.ts.map +1 -0
- package/dist/popover.js +19 -0
- package/dist/popover.js.map +1 -0
- package/dist/screen-components.d.ts +45 -0
- package/dist/screen-components.d.ts.map +1 -0
- package/dist/screen-components.js +23 -0
- package/dist/screen-components.js.map +1 -0
- package/dist/section-scroll.d.ts +14 -0
- package/dist/section-scroll.d.ts.map +1 -0
- package/dist/section-scroll.js +28 -0
- package/dist/section-scroll.js.map +1 -0
- package/dist/time.d.ts +34 -0
- package/dist/time.d.ts.map +1 -0
- package/dist/time.js +78 -0
- package/dist/time.js.map +1 -0
- package/dist/vue/animated-text.d.ts +101 -0
- package/dist/vue/animated-text.d.ts.map +1 -0
- package/dist/vue/animated-text.js +56 -0
- package/dist/vue/animated-text.js.map +1 -0
- package/dist/vue/carousel.d.ts +13 -0
- package/dist/vue/carousel.d.ts.map +1 -0
- package/dist/vue/carousel.js +136 -0
- package/dist/vue/carousel.js.map +1 -0
- package/dist/vue/chart.d.ts +194 -0
- package/dist/vue/chart.d.ts.map +1 -0
- package/dist/vue/chart.js +245 -0
- package/dist/vue/chart.js.map +1 -0
- package/dist/vue/command-palette.d.ts +129 -0
- package/dist/vue/command-palette.d.ts.map +1 -0
- package/dist/vue/command-palette.js +190 -0
- package/dist/vue/command-palette.js.map +1 -0
- package/dist/vue/component-motion.d.ts +17 -0
- package/dist/vue/component-motion.d.ts.map +1 -0
- package/dist/vue/component-motion.js +83 -0
- package/dist/vue/component-motion.js.map +1 -0
- package/dist/vue/component-props.d.ts +1708 -21
- package/dist/vue/component-props.d.ts.map +1 -1
- package/dist/vue/component-props.js +50 -0
- package/dist/vue/component-props.js.map +1 -1
- package/dist/vue/composer.d.ts +159 -0
- package/dist/vue/composer.d.ts.map +1 -0
- package/dist/vue/composer.js +142 -0
- package/dist/vue/composer.js.map +1 -0
- package/dist/vue/configurator.d.ts +2 -2
- package/dist/vue/configurator.d.ts.map +1 -1
- package/dist/vue/configurator.js +3 -1
- package/dist/vue/configurator.js.map +1 -1
- package/dist/vue/creative-controls.d.ts +328 -0
- package/dist/vue/creative-controls.d.ts.map +1 -0
- package/dist/vue/creative-controls.js +396 -0
- package/dist/vue/creative-controls.js.map +1 -0
- package/dist/vue/creative-props.d.ts +260 -0
- package/dist/vue/creative-props.d.ts.map +1 -0
- package/dist/vue/creative-props.js +92 -0
- package/dist/vue/creative-props.js.map +1 -0
- package/dist/vue/dashboard-charts.d.ts +240 -0
- package/dist/vue/dashboard-charts.d.ts.map +1 -0
- package/dist/vue/dashboard-charts.js +263 -0
- package/dist/vue/dashboard-charts.js.map +1 -0
- package/dist/vue/dashboard-effects.d.ts +211 -0
- package/dist/vue/dashboard-effects.d.ts.map +1 -0
- package/dist/vue/dashboard-effects.js +235 -0
- package/dist/vue/dashboard-effects.js.map +1 -0
- package/dist/vue/dashboard-props.d.ts +244 -0
- package/dist/vue/dashboard-props.d.ts.map +1 -0
- package/dist/vue/dashboard-props.js +94 -0
- package/dist/vue/dashboard-props.js.map +1 -0
- package/dist/vue/data-table.d.ts +17 -0
- package/dist/vue/data-table.d.ts.map +1 -0
- package/dist/vue/data-table.js +133 -0
- package/dist/vue/data-table.js.map +1 -0
- package/dist/vue/date-calendar.d.ts +2 -0
- package/dist/vue/date-calendar.d.ts.map +1 -1
- package/dist/vue/date-calendar.js +20 -1
- package/dist/vue/date-calendar.js.map +1 -1
- package/dist/vue/date-picker.d.ts +8 -8
- package/dist/vue/date-props.d.ts +6 -0
- package/dist/vue/date-props.d.ts.map +1 -1
- package/dist/vue/date-props.js +3 -0
- package/dist/vue/date-props.js.map +1 -1
- package/dist/vue/discovery-components.d.ts +50 -0
- package/dist/vue/discovery-components.d.ts.map +1 -0
- package/dist/vue/discovery-components.js +2 -0
- package/dist/vue/discovery-components.js.map +1 -0
- package/dist/vue/discovery-controls.d.ts +197 -0
- package/dist/vue/discovery-controls.d.ts.map +1 -0
- package/dist/vue/discovery-controls.js +185 -0
- package/dist/vue/discovery-controls.js.map +1 -0
- package/dist/vue/discovery-props.d.ts +249 -0
- package/dist/vue/discovery-props.d.ts.map +1 -0
- package/dist/vue/discovery-props.js +87 -0
- package/dist/vue/discovery-props.js.map +1 -0
- package/dist/vue/global-components.d.ts +237 -0
- package/dist/vue/global-components.d.ts.map +1 -1
- package/dist/vue/index.d.ts +41 -0
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +37 -0
- package/dist/vue/index.js.map +1 -1
- package/dist/vue/interactive-components.d.ts +31 -0
- package/dist/vue/interactive-components.d.ts.map +1 -0
- package/dist/vue/interactive-components.js +2 -0
- package/dist/vue/interactive-components.js.map +1 -0
- package/dist/vue/interactive-props.d.ts +254 -0
- package/dist/vue/interactive-props.d.ts.map +1 -0
- package/dist/vue/interactive-props.js +85 -0
- package/dist/vue/interactive-props.js.map +1 -0
- package/dist/vue/kanban.d.ts +150 -0
- package/dist/vue/kanban.d.ts.map +1 -0
- package/dist/vue/kanban.js +267 -0
- package/dist/vue/kanban.js.map +1 -0
- package/dist/vue/list-motion.d.ts +7 -0
- package/dist/vue/list-motion.d.ts.map +1 -0
- package/dist/vue/list-motion.js +28 -0
- package/dist/vue/list-motion.js.map +1 -0
- package/dist/vue/marquee.d.ts +96 -0
- package/dist/vue/marquee.d.ts.map +1 -0
- package/dist/vue/marquee.js +186 -0
- package/dist/vue/marquee.js.map +1 -0
- package/dist/vue/menu.d.ts +122 -0
- package/dist/vue/menu.d.ts.map +1 -0
- package/dist/vue/menu.js +79 -0
- package/dist/vue/menu.js.map +1 -0
- package/dist/vue/navigation-controls.d.ts +125 -0
- package/dist/vue/navigation-controls.d.ts.map +1 -0
- package/dist/vue/navigation-controls.js +130 -0
- package/dist/vue/navigation-controls.js.map +1 -0
- package/dist/vue/navigation-props.d.ts +283 -0
- package/dist/vue/navigation-props.d.ts.map +1 -0
- package/dist/vue/navigation-props.js +82 -0
- package/dist/vue/navigation-props.js.map +1 -0
- package/dist/vue/number-flow.d.ts +75 -0
- package/dist/vue/number-flow.d.ts.map +1 -0
- package/dist/vue/number-flow.js +57 -0
- package/dist/vue/number-flow.js.map +1 -0
- package/dist/vue/partition.d.ts +15 -0
- package/dist/vue/partition.d.ts.map +1 -0
- package/dist/vue/partition.js +42 -0
- package/dist/vue/partition.js.map +1 -0
- package/dist/vue/pin-cell.d.ts +14 -0
- package/dist/vue/pin-cell.d.ts.map +1 -0
- package/dist/vue/pin-cell.js +19 -0
- package/dist/vue/pin-cell.js.map +1 -0
- package/dist/vue/pin-input.d.ts +14 -0
- package/dist/vue/pin-input.d.ts.map +1 -0
- package/dist/vue/pin-input.js +23 -0
- package/dist/vue/pin-input.js.map +1 -0
- package/dist/vue/platform.d.ts +37 -0
- package/dist/vue/platform.d.ts.map +1 -0
- package/dist/vue/platform.js +46 -0
- package/dist/vue/platform.js.map +1 -0
- package/dist/vue/props.d.ts +82 -42
- package/dist/vue/props.d.ts.map +1 -1
- package/dist/vue/props.js +3 -1
- package/dist/vue/props.js.map +1 -1
- package/dist/vue/screen-component-props.d.ts +236 -0
- package/dist/vue/screen-component-props.d.ts.map +1 -0
- package/dist/vue/screen-component-props.js +90 -0
- package/dist/vue/screen-component-props.js.map +1 -0
- package/dist/vue/scroll-frame.d.ts +223 -0
- package/dist/vue/scroll-frame.d.ts.map +1 -0
- package/dist/vue/scroll-frame.js +346 -0
- package/dist/vue/scroll-frame.js.map +1 -0
- package/dist/vue/sortable-list.d.ts +24 -0
- package/dist/vue/sortable-list.d.ts.map +1 -0
- package/dist/vue/sortable-list.js +251 -0
- package/dist/vue/sortable-list.js.map +1 -0
- package/dist/vue/speed-dial.d.ts +73 -0
- package/dist/vue/speed-dial.d.ts.map +1 -0
- package/dist/vue/speed-dial.js +78 -0
- package/dist/vue/speed-dial.js.map +1 -0
- package/dist/vue/swipe-actions.d.ts +96 -0
- package/dist/vue/swipe-actions.d.ts.map +1 -0
- package/dist/vue/swipe-actions.js +174 -0
- package/dist/vue/swipe-actions.js.map +1 -0
- package/dist/vue/swipe-deck.d.ts +120 -0
- package/dist/vue/swipe-deck.d.ts.map +1 -0
- package/dist/vue/swipe-deck.js +229 -0
- package/dist/vue/swipe-deck.js.map +1 -0
- package/dist/vue/time-picker.d.ts +488 -0
- package/dist/vue/time-picker.d.ts.map +1 -0
- package/dist/vue/time-picker.js +190 -0
- package/dist/vue/time-picker.js.map +1 -0
- package/dist/vue/tour.d.ts +120 -0
- package/dist/vue/tour.d.ts.map +1 -0
- package/dist/vue/tour.js +165 -0
- package/dist/vue/tour.js.map +1 -0
- package/dist/vue/tree-view.d.ts +111 -0
- package/dist/vue/tree-view.d.ts.map +1 -0
- package/dist/vue/tree-view.js +204 -0
- package/dist/vue/tree-view.js.map +1 -0
- package/dist/vue/virtual-list.d.ts +26 -0
- package/dist/vue/virtual-list.d.ts.map +1 -0
- package/dist/vue/virtual-list.js +2 -0
- package/dist/vue/virtual-list.js.map +1 -0
- package/dist/vue/wayfinding-controls.d.ts +199 -0
- package/dist/vue/wayfinding-controls.d.ts.map +1 -0
- package/dist/vue/wayfinding-controls.js +330 -0
- package/dist/vue/wayfinding-controls.js.map +1 -0
- package/dist/vue/wayfinding-props.d.ts +221 -0
- package/dist/vue/wayfinding-props.d.ts.map +1 -0
- package/dist/vue/wayfinding-props.js +86 -0
- package/dist/vue/wayfinding-props.js.map +1 -0
- package/dist/vue/workflows.d.ts +2 -2
- package/dist/vue/workflows.d.ts.map +1 -1
- package/dist/vue/workflows.js +17 -4
- package/dist/vue/workflows.js.map +1 -1
- package/dist/wayfinding.d.ts +50 -0
- package/dist/wayfinding.d.ts.map +1 -0
- package/dist/wayfinding.js +54 -0
- package/dist/wayfinding.js.map +1 -0
- package/package.json +2 -2
- package/src/capabilities.ts +50 -4
- package/src/chart.ts +151 -0
- package/src/collections.ts +87 -0
- package/src/contracts.ts +2 -0
- package/src/creative-controls.ts +169 -0
- package/src/dashboard.ts +164 -0
- package/src/discovery.ts +139 -0
- package/src/experimental-regions.ts +29 -0
- package/src/experimental.ts +40 -0
- package/src/index.ts +23 -1
- package/src/interactive.ts +91 -0
- package/src/link.ts +2 -0
- package/src/motion.ts +14 -0
- package/src/navigation-transition.ts +14 -0
- package/src/number-flow-format.ts +68 -0
- package/src/popover.ts +38 -0
- package/src/screen-components.ts +59 -0
- package/src/section-scroll.ts +46 -0
- package/src/time.ts +83 -0
- package/src/vue/animated-text.ts +72 -0
- package/src/vue/carousel.ts +198 -0
- package/src/vue/chart.ts +337 -0
- package/src/vue/command-palette.ts +235 -0
- package/src/vue/component-motion.ts +109 -0
- package/src/vue/component-props.ts +104 -0
- package/src/vue/composer.ts +192 -0
- package/src/vue/configurator.ts +3 -1
- package/src/vue/creative-controls.ts +524 -0
- package/src/vue/creative-props.ts +94 -0
- package/src/vue/dashboard-charts.ts +346 -0
- package/src/vue/dashboard-effects.ts +304 -0
- package/src/vue/dashboard-props.ts +95 -0
- package/src/vue/data-table.ts +190 -0
- package/src/vue/date-calendar.ts +30 -1
- package/src/vue/date-props.ts +3 -0
- package/src/vue/discovery-components.ts +60 -0
- package/src/vue/discovery-controls.ts +241 -0
- package/src/vue/discovery-props.ts +92 -0
- package/src/vue/global-components.ts +237 -0
- package/src/vue/index.ts +64 -0
- package/src/vue/interactive-components.ts +29 -0
- package/src/vue/interactive-props.ts +90 -0
- package/src/vue/kanban.ts +360 -0
- package/src/vue/list-motion.ts +31 -0
- package/src/vue/marquee.ts +248 -0
- package/src/vue/menu.ts +100 -0
- package/src/vue/navigation-controls.ts +159 -0
- package/src/vue/navigation-props.ts +87 -0
- package/src/vue/number-flow.ts +83 -0
- package/src/vue/partition.ts +49 -0
- package/src/vue/pin-cell.ts +26 -0
- package/src/vue/pin-input.ts +31 -0
- package/src/vue/platform.ts +73 -0
- package/src/vue/props.ts +3 -1
- package/src/vue/screen-component-props.ts +92 -0
- package/src/vue/scroll-frame.ts +429 -0
- package/src/vue/sortable-list.ts +308 -0
- package/src/vue/speed-dial.ts +108 -0
- package/src/vue/swipe-actions.ts +226 -0
- package/src/vue/swipe-deck.ts +277 -0
- package/src/vue/time-picker.ts +227 -0
- package/src/vue/tour.ts +239 -0
- package/src/vue/tree-view.ts +259 -0
- package/src/vue/virtual-list.ts +28 -0
- package/src/vue/wayfinding-controls.ts +430 -0
- package/src/vue/wayfinding-props.ts +97 -0
- package/src/vue/workflows.ts +17 -4
- package/src/wayfinding.ts +85 -0
|
@@ -1,3 +1,60 @@
|
|
|
1
|
+
import {
|
|
2
|
+
kanbanProps,
|
|
3
|
+
donutChartProps,
|
|
4
|
+
sparklineProps,
|
|
5
|
+
gradientBackgroundProps,
|
|
6
|
+
particleFieldProps,
|
|
7
|
+
confettiProps,
|
|
8
|
+
} from './dashboard-props.js'
|
|
9
|
+
import {
|
|
10
|
+
colorPickerProps,
|
|
11
|
+
swipeDeckProps,
|
|
12
|
+
gaugeProps,
|
|
13
|
+
tourProps,
|
|
14
|
+
tourTargetProps,
|
|
15
|
+
transferListProps,
|
|
16
|
+
marqueeProps,
|
|
17
|
+
} from './creative-props.js'
|
|
18
|
+
import {
|
|
19
|
+
collapsibleHeaderProps,
|
|
20
|
+
refreshControlProps,
|
|
21
|
+
composerProps,
|
|
22
|
+
speedDialProps,
|
|
23
|
+
pinInputProps,
|
|
24
|
+
animatedTextProps,
|
|
25
|
+
} from './screen-component-props.js'
|
|
26
|
+
import {
|
|
27
|
+
sortableListProps,
|
|
28
|
+
swipeActionsProps,
|
|
29
|
+
numberFlowProps,
|
|
30
|
+
resizablePanelsProps,
|
|
31
|
+
imageCompareProps,
|
|
32
|
+
imageViewerProps,
|
|
33
|
+
} from './interactive-props.js'
|
|
34
|
+
import {
|
|
35
|
+
commandPaletteProps,
|
|
36
|
+
navigationRailProps,
|
|
37
|
+
breadcrumbProps,
|
|
38
|
+
tooltipProps,
|
|
39
|
+
timelineProps,
|
|
40
|
+
chartProps,
|
|
41
|
+
} from './wayfinding-props.js'
|
|
42
|
+
import {
|
|
43
|
+
dataTableProps,
|
|
44
|
+
carouselProps,
|
|
45
|
+
rangeSliderProps,
|
|
46
|
+
calendarProps,
|
|
47
|
+
ratingProps,
|
|
48
|
+
treeViewProps,
|
|
49
|
+
} from './discovery-props.js'
|
|
50
|
+
import {
|
|
51
|
+
popoverProps,
|
|
52
|
+
menuProps,
|
|
53
|
+
appBarProps,
|
|
54
|
+
tabBarProps,
|
|
55
|
+
timePickerProps,
|
|
56
|
+
virtualListProps,
|
|
57
|
+
} from './navigation-props.js'
|
|
1
58
|
import { numberInputProps, multiSelectProps, imageProps } from './configurator-props.js'
|
|
2
59
|
import type { ExtractPublicPropTypes } from '@vue/runtime-core'
|
|
3
60
|
import type { SheetName } from '../sheet.js'
|
|
@@ -10,6 +67,47 @@ import { formGroupProps, formErrorsProps, stepsProps, paginationProps } from './
|
|
|
10
67
|
/** Complete registry, kept separate from the primitives used to compose controls. */
|
|
11
68
|
export const componentProps = {
|
|
12
69
|
...foundationProps,
|
|
70
|
+
MKanban: kanbanProps,
|
|
71
|
+
MDonutChart: donutChartProps,
|
|
72
|
+
MSparkline: sparklineProps,
|
|
73
|
+
MGradientBackground: gradientBackgroundProps,
|
|
74
|
+
MParticleField: particleFieldProps,
|
|
75
|
+
MConfetti: confettiProps,
|
|
76
|
+
|
|
77
|
+
MColorPicker: colorPickerProps,
|
|
78
|
+
MSwipeDeck: swipeDeckProps,
|
|
79
|
+
MGauge: gaugeProps,
|
|
80
|
+
MTour: tourProps,
|
|
81
|
+
MTourTarget: tourTargetProps,
|
|
82
|
+
MTransferList: transferListProps,
|
|
83
|
+
MMarquee: marqueeProps,
|
|
84
|
+
|
|
85
|
+
MCollapsibleHeader: collapsibleHeaderProps,
|
|
86
|
+
MRefreshControl: refreshControlProps,
|
|
87
|
+
MComposer: composerProps,
|
|
88
|
+
MSpeedDial: speedDialProps,
|
|
89
|
+
MPinInput: pinInputProps,
|
|
90
|
+
MAnimatedText: animatedTextProps,
|
|
91
|
+
|
|
92
|
+
MSortableList: sortableListProps,
|
|
93
|
+
MSwipeActions: swipeActionsProps,
|
|
94
|
+
MNumberFlow: numberFlowProps,
|
|
95
|
+
MResizablePanels: resizablePanelsProps,
|
|
96
|
+
MImageCompare: imageCompareProps,
|
|
97
|
+
MImageViewer: imageViewerProps,
|
|
98
|
+
|
|
99
|
+
MCommandPalette: commandPaletteProps,
|
|
100
|
+
MNavigationRail: navigationRailProps,
|
|
101
|
+
MBreadcrumb: breadcrumbProps,
|
|
102
|
+
MTooltip: tooltipProps,
|
|
103
|
+
MTimeline: timelineProps,
|
|
104
|
+
MChart: chartProps,
|
|
105
|
+
MDataTable: dataTableProps,
|
|
106
|
+
MCarousel: carouselProps,
|
|
107
|
+
MRangeSlider: rangeSliderProps,
|
|
108
|
+
MCalendar: calendarProps,
|
|
109
|
+
MRating: ratingProps,
|
|
110
|
+
MTreeView: treeViewProps,
|
|
13
111
|
MNumberInput: numberInputProps,
|
|
14
112
|
MMultiSelect: multiSelectProps,
|
|
15
113
|
MImage: imageProps,
|
|
@@ -21,6 +119,12 @@ export const componentProps = {
|
|
|
21
119
|
MFormErrors: formErrorsProps,
|
|
22
120
|
MSteps: stepsProps,
|
|
23
121
|
MPagination: paginationProps,
|
|
122
|
+
MPopover: popoverProps,
|
|
123
|
+
MMenu: menuProps,
|
|
124
|
+
MAppBar: appBarProps,
|
|
125
|
+
MTabBar: tabBarProps,
|
|
126
|
+
MTimePicker: timePickerProps,
|
|
127
|
+
MVirtualList: virtualListProps,
|
|
24
128
|
}
|
|
25
129
|
export type ComponentProps = {
|
|
26
130
|
[Name in keyof typeof componentProps]: ExtractPublicPropTypes<(typeof componentProps)[Name]> &
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
defineComponent,
|
|
4
|
+
h,
|
|
5
|
+
markRaw,
|
|
6
|
+
mergeProps,
|
|
7
|
+
onScopeDispose,
|
|
8
|
+
ref,
|
|
9
|
+
watch,
|
|
10
|
+
type Component,
|
|
11
|
+
} from '@vue/runtime-core'
|
|
12
|
+
import { createMotionSurface, type MotionBinding } from '../experimental.js'
|
|
13
|
+
import type { ComposerMessage } from '../screen-components.js'
|
|
14
|
+
import { composerProps } from './screen-component-props.js'
|
|
15
|
+
import { useComponentLayout } from './component-motion.js'
|
|
16
|
+
|
|
17
|
+
export function createComposer(
|
|
18
|
+
ui: {
|
|
19
|
+
Box: Component
|
|
20
|
+
Card: Component
|
|
21
|
+
Row: Component
|
|
22
|
+
Column: Component
|
|
23
|
+
Input: Component
|
|
24
|
+
Button: Component
|
|
25
|
+
Chip: Component
|
|
26
|
+
Text: Component
|
|
27
|
+
},
|
|
28
|
+
platform: 'web' | 'native',
|
|
29
|
+
) {
|
|
30
|
+
return defineComponent({
|
|
31
|
+
name: 'MComposer',
|
|
32
|
+
inheritAttrs: false,
|
|
33
|
+
props: composerProps,
|
|
34
|
+
emits: {
|
|
35
|
+
'update:modelValue': (_v: string) => true,
|
|
36
|
+
'update:attachments': (_v: unknown[]) => true,
|
|
37
|
+
submit: (_message: ComposerMessage) => true,
|
|
38
|
+
attach: () => true,
|
|
39
|
+
focus: () => true,
|
|
40
|
+
blur: () => true,
|
|
41
|
+
},
|
|
42
|
+
setup(props, { attrs, emit, expose, slots }) {
|
|
43
|
+
const editor = ref<{ focus(): void; blur(): void }>()
|
|
44
|
+
const surface = markRaw(createMotionSurface())
|
|
45
|
+
const layout = useComponentLayout(() => props.attachments.map((a) => a.id))
|
|
46
|
+
const blocked = computed(() => props.disabled || props.readonly || props.loading)
|
|
47
|
+
const canSend = computed(
|
|
48
|
+
() => !blocked.value && Boolean(props.modelValue.trim() || props.attachments.length),
|
|
49
|
+
)
|
|
50
|
+
let follow: MotionBinding | undefined
|
|
51
|
+
function followKeyboard() {
|
|
52
|
+
follow?.dispose()
|
|
53
|
+
follow = undefined
|
|
54
|
+
if (props.followKeyboard && surface.available)
|
|
55
|
+
follow = surface.followKeyboard({ offset: props.keyboardOffset })
|
|
56
|
+
}
|
|
57
|
+
onScopeDispose(
|
|
58
|
+
surface.use(() => {
|
|
59
|
+
followKeyboard()
|
|
60
|
+
return () => {
|
|
61
|
+
follow?.dispose()
|
|
62
|
+
follow = undefined
|
|
63
|
+
}
|
|
64
|
+
}),
|
|
65
|
+
)
|
|
66
|
+
watch(() => [props.followKeyboard, props.keyboardOffset], followKeyboard, { flush: 'post' })
|
|
67
|
+
const submit = () => {
|
|
68
|
+
if (canSend.value)
|
|
69
|
+
emit('submit', {
|
|
70
|
+
text: props.modelValue,
|
|
71
|
+
attachments: props.attachments.map((a) => ({ ...a })),
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
expose({ focus: () => editor.value?.focus(), blur: () => editor.value?.blur() })
|
|
75
|
+
return () => {
|
|
76
|
+
const ids = new Set(props.attachments.map((a) => a.id))
|
|
77
|
+
if (ids.size !== props.attachments.length)
|
|
78
|
+
throw new TypeError('Composer attachments require unique ids.')
|
|
79
|
+
return h(
|
|
80
|
+
ui.Box,
|
|
81
|
+
mergeProps(attrs, {
|
|
82
|
+
motionSurface: surface,
|
|
83
|
+
...(platform === 'web'
|
|
84
|
+
? {
|
|
85
|
+
class: 'm-composer',
|
|
86
|
+
role: 'group',
|
|
87
|
+
'aria-label': props.label,
|
|
88
|
+
onKeydown: (e: KeyboardEvent) => {
|
|
89
|
+
if (
|
|
90
|
+
props.shortcut &&
|
|
91
|
+
e.key === 'Enter' &&
|
|
92
|
+
(e.ctrlKey || e.metaKey) &&
|
|
93
|
+
!e.isComposing &&
|
|
94
|
+
e.keyCode !== 229 &&
|
|
95
|
+
!e.defaultPrevented
|
|
96
|
+
) {
|
|
97
|
+
e.preventDefault()
|
|
98
|
+
submit()
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
}
|
|
102
|
+
: {}),
|
|
103
|
+
}),
|
|
104
|
+
{
|
|
105
|
+
default: () =>
|
|
106
|
+
h(
|
|
107
|
+
ui.Card,
|
|
108
|
+
{ padding: 'md', gap: 'sm', motionRegion: layout },
|
|
109
|
+
{
|
|
110
|
+
default: () => [
|
|
111
|
+
h(ui.Input, {
|
|
112
|
+
ref: editor,
|
|
113
|
+
id: props.id,
|
|
114
|
+
label: props.label,
|
|
115
|
+
modelValue: props.modelValue,
|
|
116
|
+
multiline: true,
|
|
117
|
+
rows: props.rows,
|
|
118
|
+
maxLength: props.maxLength,
|
|
119
|
+
placeholder: props.placeholder,
|
|
120
|
+
error: props.error,
|
|
121
|
+
disabled: props.disabled,
|
|
122
|
+
readonly: props.readonly || props.loading,
|
|
123
|
+
'onUpdate:modelValue': (value: string) => {
|
|
124
|
+
if (!blocked.value) emit('update:modelValue', value)
|
|
125
|
+
},
|
|
126
|
+
onFocus: () => emit('focus'),
|
|
127
|
+
onBlur: () => emit('blur'),
|
|
128
|
+
}),
|
|
129
|
+
props.attachments.length
|
|
130
|
+
? h(
|
|
131
|
+
ui.Row,
|
|
132
|
+
{ gap: 'xs', wrap: true },
|
|
133
|
+
{
|
|
134
|
+
default: () =>
|
|
135
|
+
props.attachments.map((a) =>
|
|
136
|
+
h(ui.Chip, {
|
|
137
|
+
key: a.id,
|
|
138
|
+
label: a.name,
|
|
139
|
+
removable: true,
|
|
140
|
+
removeLabel: `${props.removeLabel}: ${a.name}`,
|
|
141
|
+
disabled: blocked.value,
|
|
142
|
+
onRemove: () => {
|
|
143
|
+
if (!blocked.value)
|
|
144
|
+
emit(
|
|
145
|
+
'update:attachments',
|
|
146
|
+
props.attachments.filter((item) => item.id !== a.id),
|
|
147
|
+
)
|
|
148
|
+
},
|
|
149
|
+
}),
|
|
150
|
+
),
|
|
151
|
+
},
|
|
152
|
+
)
|
|
153
|
+
: null,
|
|
154
|
+
slots.default?.(),
|
|
155
|
+
h(
|
|
156
|
+
ui.Row,
|
|
157
|
+
{ gap: 'sm', align: 'center', justify: 'between', wrap: true },
|
|
158
|
+
{
|
|
159
|
+
default: () => [
|
|
160
|
+
props.attachable
|
|
161
|
+
? h(ui.Button, {
|
|
162
|
+
text: props.attachLabel,
|
|
163
|
+
icon: 'paperclip',
|
|
164
|
+
variant: 'ghost',
|
|
165
|
+
size: 'sm',
|
|
166
|
+
disabled: blocked.value,
|
|
167
|
+
onClick: () => {
|
|
168
|
+
if (!blocked.value) emit('attach')
|
|
169
|
+
},
|
|
170
|
+
})
|
|
171
|
+
: null,
|
|
172
|
+
h(ui.Button, {
|
|
173
|
+
text: props.sendLabel,
|
|
174
|
+
icon: 'arrow-up',
|
|
175
|
+
size: 'sm',
|
|
176
|
+
disabled: !canSend.value && !props.loading,
|
|
177
|
+
loading: props.loading,
|
|
178
|
+
loadingText: props.sendingLabel,
|
|
179
|
+
onClick: submit,
|
|
180
|
+
}),
|
|
181
|
+
],
|
|
182
|
+
},
|
|
183
|
+
),
|
|
184
|
+
],
|
|
185
|
+
},
|
|
186
|
+
),
|
|
187
|
+
},
|
|
188
|
+
)
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
})
|
|
192
|
+
}
|
package/src/vue/configurator.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useComponentLayout } from './component-motion.js'
|
|
1
2
|
import {
|
|
2
3
|
computed,
|
|
3
4
|
onBeforeUnmount,
|
|
@@ -206,6 +207,7 @@ export function createConfiguratorControls(ui: Primitives, platform: 'web' | 'na
|
|
|
206
207
|
props: multiSelectProps,
|
|
207
208
|
emits: { 'update:modelValue': (_values: ChoiceValue[]) => true },
|
|
208
209
|
setup(props, { attrs, emit }) {
|
|
210
|
+
const selectedMotion = useComponentLayout(() => props.modelValue)
|
|
209
211
|
useButtonAction()
|
|
210
212
|
const open = ref(false),
|
|
211
213
|
query = ref('')
|
|
@@ -268,7 +270,7 @@ export function createConfiguratorControls(ui: Primitives, platform: 'web' | 'na
|
|
|
268
270
|
},
|
|
269
271
|
}),
|
|
270
272
|
selected.length
|
|
271
|
-
? h(ui.Row, { gap: 'sm', wrap: true }, () =>
|
|
273
|
+
? h(ui.Row, { gap: 'sm', wrap: true, motionRegion: selectedMotion }, () =>
|
|
272
274
|
selected.map((option) =>
|
|
273
275
|
h(ui.Chip, {
|
|
274
276
|
key: choiceKey(option.value),
|