@getcortexlabs/mavis-core 0.1.0-rc.14 → 0.1.0-rc.16
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/avatar.d.ts +5 -0
- package/dist/avatar.d.ts.map +1 -1
- package/dist/capabilities.d.ts +454 -1777
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/capabilities.js +143 -82
- package/dist/capabilities.js.map +1 -1
- package/dist/contracts.d.ts +4 -4
- package/dist/experimental-regions.d.ts +5 -2
- package/dist/experimental-regions.d.ts.map +1 -1
- package/dist/experimental-regions.js +3 -0
- package/dist/experimental-regions.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/vue/advanced-collections.d.ts +16 -16
- package/dist/vue/animated-text.d.ts +4 -4
- package/dist/vue/chart.d.ts +5 -5
- package/dist/vue/command-palette.d.ts +4 -4
- package/dist/vue/component-props.d.ts +92 -22
- package/dist/vue/component-props.d.ts.map +1 -1
- package/dist/vue/component-props.js +4 -0
- package/dist/vue/component-props.js.map +1 -1
- package/dist/vue/composer.d.ts +11 -9
- package/dist/vue/composer.d.ts.map +1 -1
- package/dist/vue/composer.js +12 -16
- package/dist/vue/composer.js.map +1 -1
- package/dist/vue/configurator.d.ts +16 -16
- package/dist/vue/creative-controls.d.ts +11 -11
- package/dist/vue/dashboard-charts.d.ts +6 -6
- package/dist/vue/dashboard-effects.d.ts +7 -7
- package/dist/vue/date-picker.d.ts +52 -52
- package/dist/vue/discovery-controls.d.ts +8 -8
- package/dist/vue/editor-controls.d.ts +223 -0
- package/dist/vue/editor-controls.d.ts.map +1 -0
- package/dist/vue/editor-controls.js +323 -0
- package/dist/vue/editor-controls.js.map +1 -0
- package/dist/vue/global-components.d.ts +22 -1
- package/dist/vue/global-components.d.ts.map +1 -1
- package/dist/vue/image-cropper.d.ts +8 -8
- package/dist/vue/image-cropper.d.ts.map +1 -1
- package/dist/vue/index.d.ts +3 -2
- package/dist/vue/index.d.ts.map +1 -1
- package/dist/vue/index.js +1 -0
- package/dist/vue/index.js.map +1 -1
- package/dist/vue/kanban.d.ts +2 -2
- package/dist/vue/marquee.d.ts +4 -4
- package/dist/vue/menu.d.ts +4 -4
- package/dist/vue/number-flow.d.ts +3 -3
- package/dist/vue/platform.d.ts +1 -2
- package/dist/vue/platform.d.ts.map +1 -1
- package/dist/vue/platform.js.map +1 -1
- package/dist/vue/props.d.ts +44 -44
- package/dist/vue/reveal-state.d.ts +1 -1
- package/dist/vue/scheduler.d.ts +10 -10
- package/dist/vue/screen-component-props.d.ts +10 -0
- package/dist/vue/screen-component-props.d.ts.map +1 -1
- package/dist/vue/screen-component-props.js +6 -0
- package/dist/vue/screen-component-props.js.map +1 -1
- package/dist/vue/scroll-frame.d.ts +29 -6
- package/dist/vue/scroll-frame.d.ts.map +1 -1
- package/dist/vue/scroll-frame.js +106 -43
- package/dist/vue/scroll-frame.js.map +1 -1
- package/dist/vue/speed-dial.d.ts +3 -3
- package/dist/vue/swipe-actions.d.ts +3 -3
- package/dist/vue/swipe-deck.d.ts +3 -3
- package/dist/vue/theme-provider.d.ts +17 -2
- package/dist/vue/theme-provider.d.ts.map +1 -1
- package/dist/vue/theme-provider.js +7 -1
- package/dist/vue/theme-provider.js.map +1 -1
- package/dist/vue/theme.d.ts +7 -0
- package/dist/vue/theme.d.ts.map +1 -1
- package/dist/vue/theme.js +23 -19
- package/dist/vue/theme.js.map +1 -1
- package/dist/vue/time-picker.d.ts +20 -20
- package/dist/vue/tour.d.ts +3 -3
- package/dist/vue/tree-view.d.ts +3 -3
- package/dist/vue/wayfinding-controls.d.ts +1 -1
- package/dist/vue/workflows.d.ts +3 -3
- package/package.json +1 -1
- package/src/avatar.ts +6 -0
- package/src/capabilities.ts +148 -82
- package/src/experimental-regions.ts +10 -2
- package/src/index.ts +2 -7
- package/src/vue/component-props.ts +4 -0
- package/src/vue/composer.ts +22 -16
- package/src/vue/editor-controls.ts +370 -0
- package/src/vue/global-components.ts +21 -1
- package/src/vue/index.ts +3 -1
- package/src/vue/platform.ts +1 -2
- package/src/vue/screen-component-props.ts +6 -0
- package/src/vue/scroll-frame.ts +140 -54
- package/src/vue/theme-provider.ts +14 -1
- package/src/vue/theme.ts +31 -18
- package/dist/macos-capabilities.generated.d.ts +0 -1738
- package/dist/macos-capabilities.generated.d.ts.map +0 -1
- package/dist/macos-capabilities.generated.js +0 -4191
- package/dist/macos-capabilities.generated.js.map +0 -1
- package/src/macos-capabilities.generated.ts +0 -4190
package/src/capabilities.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { macosCapabilities } from './macos-capabilities.generated.js'
|
|
1
|
+
import { componentContracts } from './contracts.js'
|
|
3
2
|
|
|
4
3
|
/** Source capabilities, not a promise that every feature is in the last npm release. */
|
|
5
4
|
export const componentNames = [
|
|
@@ -24,6 +23,9 @@ export const componentNames = [
|
|
|
24
23
|
'MMarquee',
|
|
25
24
|
'MCollapsibleHeader',
|
|
26
25
|
'MRefreshControl',
|
|
26
|
+
'MTagInput',
|
|
27
|
+
'MAvatarGroup',
|
|
28
|
+
'MSearchBar',
|
|
27
29
|
'MComposer',
|
|
28
30
|
'MSpeedDial',
|
|
29
31
|
'MPinInput',
|
|
@@ -105,72 +107,73 @@ export const componentNames = [
|
|
|
105
107
|
export type ComponentName = (typeof componentNames)[number]
|
|
106
108
|
export type CapabilityStatus = 'experimental' | 'partial' | 'planned' | 'unsupported' | 'unverified'
|
|
107
109
|
|
|
110
|
+
/** Direct adapters share this native foundation and an experimental mobile creator preset. */
|
|
111
|
+
const nativeFoundation = {
|
|
112
|
+
renderer: 'nativescript',
|
|
113
|
+
status: 'experimental',
|
|
114
|
+
availability: '0.1.0-rc.15',
|
|
115
|
+
authoring: 'direct',
|
|
116
|
+
generator: 'unsupported',
|
|
117
|
+
scaffold: 'experimental',
|
|
118
|
+
creator: { targets: ['native'], workflow: '.github/workflows/native-creator.yml' },
|
|
119
|
+
components: Object.keys(componentContracts) as (keyof typeof componentContracts)[],
|
|
120
|
+
componentCapabilities: {
|
|
121
|
+
MBox: { status: 'experimental', composition: 'native-children', motion: 'surface-and-region' },
|
|
122
|
+
MRow: { status: 'experimental', composition: 'native-children', motion: 'region' },
|
|
123
|
+
MColumn: { status: 'experimental', composition: 'native-children', motion: 'region' },
|
|
124
|
+
MText: {
|
|
125
|
+
status: 'partial',
|
|
126
|
+
composition: 'plain-text',
|
|
127
|
+
spans: 'unsupported',
|
|
128
|
+
motion: 'surface',
|
|
129
|
+
},
|
|
130
|
+
MButton: {
|
|
131
|
+
status: 'partial',
|
|
132
|
+
composition: 'plain-text-and-icon-props',
|
|
133
|
+
decorations: 'unsupported',
|
|
134
|
+
loadingIndicator: ['none'],
|
|
135
|
+
reorderHandle: [false],
|
|
136
|
+
motion: 'surface-and-press',
|
|
137
|
+
},
|
|
138
|
+
MInput: { status: 'experimental', composition: 'controlled-editor', motion: 'press-and-focus' },
|
|
139
|
+
},
|
|
140
|
+
rendering: {
|
|
141
|
+
client: 'experimental',
|
|
142
|
+
serverImport: 'unsupported',
|
|
143
|
+
serverHTML: 'unsupported',
|
|
144
|
+
hydration: 'unsupported',
|
|
145
|
+
ssg: 'unsupported',
|
|
146
|
+
streaming: 'unsupported',
|
|
147
|
+
rsc: 'unsupported',
|
|
148
|
+
},
|
|
149
|
+
motion: { engine: 'jolt', minimum: '0.1.0-rc.18', start: 'native-loaded' },
|
|
150
|
+
lifecycle: { unload: 'release-native-resources', reload: 'reattach', dispose: 'final' },
|
|
151
|
+
compatibility: {
|
|
152
|
+
node: '22.23.3',
|
|
153
|
+
typescript: '6.0.3',
|
|
154
|
+
nativeCore: '9.1.4',
|
|
155
|
+
ios: '9.1.0',
|
|
156
|
+
android: '9.1.1',
|
|
157
|
+
jolt: '0.1.0-rc.18',
|
|
158
|
+
peerOverrides: 'examples/native-adapters/package.json',
|
|
159
|
+
upstreamIssue: 'https://github.com/rafaelaugustos/jolt/issues/517',
|
|
160
|
+
},
|
|
161
|
+
validation: {
|
|
162
|
+
example: 'examples/native-adapters',
|
|
163
|
+
workflow: '.github/workflows/native-adapters.yml',
|
|
164
|
+
behavior: 'scripts/check-native-adapters.mjs',
|
|
165
|
+
platforms: ['ios', 'android'],
|
|
166
|
+
},
|
|
167
|
+
} as const
|
|
168
|
+
|
|
108
169
|
export const targetCapabilities = {
|
|
109
170
|
version: 1,
|
|
110
171
|
source: 'repository',
|
|
111
|
-
publishedBaseline: '0.1.0-rc.
|
|
172
|
+
publishedBaseline: '0.1.0-rc.16',
|
|
112
173
|
developmentMotion: {
|
|
113
174
|
availability: 'published',
|
|
114
175
|
joltCommit: null,
|
|
115
|
-
publishedJoltRelease: '0.1.0-rc.
|
|
116
|
-
macos: {
|
|
117
|
-
availability: 'published',
|
|
118
|
-
joltSwiftRelease: '0.1.0-rc.15',
|
|
119
|
-
reveal: 'experimental',
|
|
120
|
-
textEffects: { status: 'experimental', minimumOS: 15, macOS14: 'static' },
|
|
121
|
-
numberFlow: { status: 'experimental', minimumOS: 15, macOS14: 'static' },
|
|
122
|
-
confetti: 'experimental',
|
|
123
|
-
marquee: 'experimental',
|
|
124
|
-
surface: {
|
|
125
|
-
status: 'partial',
|
|
126
|
-
targets: ['MBox', 'MIcon', 'MImage:loaded-artwork'],
|
|
127
|
-
methods: ['available', 'onAvailable', 'use', 'set', 'animate', 'refresh'],
|
|
128
|
-
playback: ['finished', 'stop', 'pause', 'resume', 'paused', 'duration', 'progress:read'],
|
|
129
|
-
channels: [
|
|
130
|
-
'x',
|
|
131
|
-
'y',
|
|
132
|
-
'scale',
|
|
133
|
-
'scaleX',
|
|
134
|
-
'scaleY',
|
|
135
|
-
'rotate',
|
|
136
|
-
'rotateX',
|
|
137
|
-
'rotateY',
|
|
138
|
-
'opacity',
|
|
139
|
-
],
|
|
140
|
-
timing: ['spring', 'tween'],
|
|
141
|
-
interruptedSpringVelocity: {
|
|
142
|
-
status: 'not-inherited',
|
|
143
|
-
upstreamIssue: 'https://github.com/rafaelaugustos/jolt/issues/505',
|
|
144
|
-
},
|
|
145
|
-
maximumFrames: 2,
|
|
146
|
-
cleanupCallbacks: 'definite-cleanup-or-void',
|
|
147
|
-
whenMotionAvailable: ['surfaces', 'regions'],
|
|
148
|
-
trackingIssue: 354,
|
|
149
|
-
},
|
|
150
|
-
region: {
|
|
151
|
-
status: 'partial',
|
|
152
|
-
targets: ['MBox'],
|
|
153
|
-
methods: ['available', 'onAvailable', 'timeline', 'sequence'],
|
|
154
|
-
steps: 'surface-tuples',
|
|
155
|
-
positions: ['next', 'previous-start', 'absolute-forward', 'relative-forward'],
|
|
156
|
-
callbackSteps: 'unsupported',
|
|
157
|
-
durationRead: 'unsupported',
|
|
158
|
-
trackingIssue: 354,
|
|
159
|
-
},
|
|
160
|
-
shapes: {
|
|
161
|
-
status: 'unsupported',
|
|
162
|
-
upstreamIssue: 'https://github.com/rafaelaugustos/jolt/issues/504',
|
|
163
|
-
trackingIssue: 354,
|
|
164
|
-
},
|
|
165
|
-
particles: {
|
|
166
|
-
status: 'partial',
|
|
167
|
-
finite: true,
|
|
168
|
-
continuous: 'unsupported',
|
|
169
|
-
maximumDurationIncludingLifetime: 60000,
|
|
170
|
-
upstreamIssue: 'https://github.com/rafaelaugustos/jolt/issues/503',
|
|
171
|
-
trackingIssue: 354,
|
|
172
|
-
},
|
|
173
|
-
},
|
|
176
|
+
publishedJoltRelease: '0.1.0-rc.18',
|
|
174
177
|
features: {
|
|
175
178
|
gradient: ['web', 'ios', 'android'],
|
|
176
179
|
loadingEffects: ['web', 'ios'],
|
|
@@ -196,7 +199,7 @@ export const targetCapabilities = {
|
|
|
196
199
|
streaming: 'unverified',
|
|
197
200
|
rsc: 'unsupported',
|
|
198
201
|
},
|
|
199
|
-
motion: { engine: 'jolt', minimum: '0.1.0-rc.
|
|
202
|
+
motion: { engine: 'jolt', minimum: '0.1.0-rc.18', start: 'client-mount' },
|
|
200
203
|
ssr: {
|
|
201
204
|
availability: '0.1.0-alpha.5',
|
|
202
205
|
host: 'nuxt',
|
|
@@ -239,20 +242,51 @@ export const targetCapabilities = {
|
|
|
239
242
|
streaming: 'unsupported',
|
|
240
243
|
rsc: 'unsupported',
|
|
241
244
|
},
|
|
242
|
-
motion: { engine: 'jolt', minimum: '0.1.0-rc.
|
|
245
|
+
motion: { engine: 'jolt', minimum: '0.1.0-rc.18', start: 'native-loaded' },
|
|
243
246
|
},
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
...(
|
|
248
|
+
[
|
|
249
|
+
{
|
|
250
|
+
id: 'vue-appkit',
|
|
251
|
+
platform: 'macos',
|
|
252
|
+
renderer: 'nativescript-appkit',
|
|
253
|
+
runtime: '@nativescript/macos-node-api',
|
|
254
|
+
version: '0.5.0-beta.0',
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
id: 'vue-windows',
|
|
258
|
+
platform: 'windows',
|
|
259
|
+
renderer: 'nativescript-xaml',
|
|
260
|
+
runtime: '@nativescript/windows-napi',
|
|
261
|
+
version: '1.0.0-beta.20',
|
|
262
|
+
},
|
|
263
|
+
] as const
|
|
264
|
+
).map((host) => ({
|
|
265
|
+
...host,
|
|
266
|
+
framework: 'vue',
|
|
249
267
|
status: 'experimental',
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
components:
|
|
254
|
-
|
|
255
|
-
|
|
268
|
+
availability: '0.1.0-rc.15',
|
|
269
|
+
distribution: 'generated-host',
|
|
270
|
+
scaffold: 'experimental',
|
|
271
|
+
components: [
|
|
272
|
+
'MScreen',
|
|
273
|
+
'MColumn',
|
|
274
|
+
'MRow',
|
|
275
|
+
'MGrid',
|
|
276
|
+
'MText',
|
|
277
|
+
'MInput',
|
|
278
|
+
'MButton',
|
|
279
|
+
'MLink',
|
|
280
|
+
'MCard',
|
|
281
|
+
'MAlert',
|
|
282
|
+
'MEmptyState',
|
|
283
|
+
'MReveal',
|
|
284
|
+
],
|
|
285
|
+
contract: 'packages/create-mavis/templates/desktop/common/src/contract.mjs',
|
|
286
|
+
validation: {
|
|
287
|
+
workflow: '.github/workflows/desktop-creator.yml',
|
|
288
|
+
behavior: 'scripts/check-desktop-created.mjs',
|
|
289
|
+
},
|
|
256
290
|
rendering: {
|
|
257
291
|
client: 'experimental',
|
|
258
292
|
serverImport: 'unsupported',
|
|
@@ -262,8 +296,45 @@ export const targetCapabilities = {
|
|
|
262
296
|
streaming: 'unsupported',
|
|
263
297
|
rsc: 'unsupported',
|
|
264
298
|
},
|
|
265
|
-
|
|
266
|
-
|
|
299
|
+
})),
|
|
300
|
+
...(
|
|
301
|
+
[
|
|
302
|
+
{
|
|
303
|
+
id: 'react-nativescript',
|
|
304
|
+
framework: 'react',
|
|
305
|
+
entrypoint: '@getcortexlabs/mavis-react-nativescript',
|
|
306
|
+
versions: { react: '18.3.1', 'react-nativescript': '5.0.0' },
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
id: 'angular-nativescript',
|
|
310
|
+
framework: 'angular',
|
|
311
|
+
entrypoint: '@getcortexlabs/mavis-angular-nativescript',
|
|
312
|
+
versions: { '@angular/core': '22.3.0', '@nativescript/angular': '22.0.2' },
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
id: 'svelte-nativescript',
|
|
316
|
+
framework: 'svelte',
|
|
317
|
+
entrypoint: '@getcortexlabs/mavis-svelte-nativescript',
|
|
318
|
+
versions: { svelte: '4.2.20', '@nativescript-community/svelte-native': '1.0.32' },
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
id: 'solid-nativescript',
|
|
322
|
+
framework: 'solid',
|
|
323
|
+
entrypoint: '@getcortexlabs/mavis-solid-nativescript',
|
|
324
|
+
versions: {
|
|
325
|
+
'solid-js': '2.0.0',
|
|
326
|
+
'@nativescript-community/solid-js': '2.0.1',
|
|
327
|
+
dominative: '0.1.3',
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
id: 'typescript-nativescript',
|
|
332
|
+
framework: 'typescript',
|
|
333
|
+
entrypoint: '@getcortexlabs/mavis/native',
|
|
334
|
+
versions: {},
|
|
335
|
+
},
|
|
336
|
+
] as const
|
|
337
|
+
).map((adapter) => ({ ...nativeFoundation, ...adapter })),
|
|
267
338
|
],
|
|
268
339
|
planned: [
|
|
269
340
|
{ id: 'react-web', issue: 145 },
|
|
@@ -271,11 +342,6 @@ export const targetCapabilities = {
|
|
|
271
342
|
{ id: 'angular-web', issue: 152 },
|
|
272
343
|
{ id: 'svelte-web', issue: 153 },
|
|
273
344
|
{ id: 'solid-web', issue: 154 },
|
|
274
|
-
{ id: 'react-nativescript', issue: 35 },
|
|
275
|
-
{ id: 'angular-nativescript', issue: 36 },
|
|
276
|
-
{ id: 'svelte-nativescript', issue: 37 },
|
|
277
|
-
{ id: 'solid-nativescript', issue: 38 },
|
|
278
|
-
{ id: 'typescript-nativescript', issue: 39 },
|
|
279
345
|
],
|
|
280
346
|
research: [
|
|
281
347
|
{ id: 'react-native', issue: 40 },
|
|
@@ -39,6 +39,8 @@ import {
|
|
|
39
39
|
} from './experimental.js'
|
|
40
40
|
|
|
41
41
|
export interface MotionPointerOptions {
|
|
42
|
+
/** Initial availability and later changes; use this to update hover-only application UI. */
|
|
43
|
+
onAvailabilityChange?: (available: boolean) => void
|
|
42
44
|
axis?: 'x' | 'y' | 'both'
|
|
43
45
|
coordinates?: 'normalized' | 'pixels'
|
|
44
46
|
range?: { x?: readonly [number, number]; y?: readonly [number, number] }
|
|
@@ -54,8 +56,9 @@ export interface MotionPointer extends MotionBinding {
|
|
|
54
56
|
readonly presence: MotionReadable
|
|
55
57
|
readonly active: boolean
|
|
56
58
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
+
* Jolt's live input availability. Web requires Pointer Events and `(any-hover: hover)` while
|
|
60
|
+
* listening. NativeScript reports the loaded view's supported hover API, not a connected mouse:
|
|
61
|
+
* an iPad without a pointer can be available and stay at rest; an iPhone is not available.
|
|
59
62
|
*/
|
|
60
63
|
readonly available: boolean
|
|
61
64
|
/** `hover` while input can arrive; `static` when the values only ever hold their resting state. */
|
|
@@ -804,6 +807,11 @@ export function bindMotionRegion(region: MotionRegion, adapter: MotionRegionAdap
|
|
|
804
807
|
}
|
|
805
808
|
|
|
806
809
|
export function validatePointer(options: MotionPointerOptions) {
|
|
810
|
+
if (
|
|
811
|
+
options.onAvailabilityChange !== undefined &&
|
|
812
|
+
typeof options.onAvailabilityChange !== 'function'
|
|
813
|
+
)
|
|
814
|
+
throw new TypeError('onAvailabilityChange must be a function.')
|
|
807
815
|
if (options.axis !== undefined && !['x', 'y', 'both'].includes(options.axis))
|
|
808
816
|
throw new TypeError('Unknown pointer axis.')
|
|
809
817
|
if (options.coordinates !== undefined && !['normalized', 'pixels'].includes(options.coordinates))
|
package/src/index.ts
CHANGED
|
@@ -23,7 +23,7 @@ export type {
|
|
|
23
23
|
} from './theme/types.js'
|
|
24
24
|
export { listItemLabel } from './list-item.js'
|
|
25
25
|
export { avatarSizes, avatarInitials } from './avatar.js'
|
|
26
|
-
export type { AvatarSize } from './avatar.js'
|
|
26
|
+
export type { AvatarSize, AvatarMember } from './avatar.js'
|
|
27
27
|
export { badgeColors } from './badge.js'
|
|
28
28
|
export type { BadgeTone } from './badge.js'
|
|
29
29
|
export { sliderScale } from './slider.js'
|
|
@@ -78,12 +78,7 @@ export type {
|
|
|
78
78
|
ButtonEvents,
|
|
79
79
|
TextInputHandle,
|
|
80
80
|
} from './contracts.js'
|
|
81
|
-
export {
|
|
82
|
-
targetCapabilities,
|
|
83
|
-
componentNames,
|
|
84
|
-
themeContract,
|
|
85
|
-
macosCapabilities,
|
|
86
|
-
} from './capabilities.js'
|
|
81
|
+
export { targetCapabilities, componentNames, themeContract } from './capabilities.js'
|
|
87
82
|
export type { ComponentName, CapabilityStatus } from './capabilities.js'
|
|
88
83
|
|
|
89
84
|
export * from './date.js'
|
|
@@ -64,6 +64,7 @@ import {
|
|
|
64
64
|
virtualListProps,
|
|
65
65
|
} from './navigation-props.js'
|
|
66
66
|
import { numberInputProps, multiSelectProps, imageProps } from './configurator-props.js'
|
|
67
|
+
import { avatarGroupProps, tagInputProps, searchBarProps } from './editor-controls.js'
|
|
67
68
|
import type { ExtractPublicPropTypes } from '@vue/runtime-core'
|
|
68
69
|
import type { SheetName } from '../sheet.js'
|
|
69
70
|
import { componentProps as foundationProps } from './props.js'
|
|
@@ -98,6 +99,9 @@ export const componentProps = {
|
|
|
98
99
|
|
|
99
100
|
MCollapsibleHeader: collapsibleHeaderProps,
|
|
100
101
|
MRefreshControl: refreshControlProps,
|
|
102
|
+
MAvatarGroup: avatarGroupProps,
|
|
103
|
+
MSearchBar: searchBarProps,
|
|
104
|
+
MTagInput: tagInputProps,
|
|
101
105
|
MComposer: composerProps,
|
|
102
106
|
MSpeedDial: speedDialProps,
|
|
103
107
|
MPinInput: pinInputProps,
|
package/src/vue/composer.ts
CHANGED
|
@@ -2,6 +2,8 @@ import {
|
|
|
2
2
|
computed,
|
|
3
3
|
defineComponent,
|
|
4
4
|
h,
|
|
5
|
+
inject,
|
|
6
|
+
type InjectionKey,
|
|
5
7
|
markRaw,
|
|
6
8
|
mergeProps,
|
|
7
9
|
onScopeDispose,
|
|
@@ -9,11 +11,16 @@ import {
|
|
|
9
11
|
watch,
|
|
10
12
|
type Component,
|
|
11
13
|
} from '@vue/runtime-core'
|
|
12
|
-
import { createMotionSurface
|
|
14
|
+
import { createMotionSurface } from '../experimental.js'
|
|
13
15
|
import type { ComposerMessage } from '../screen-components.js'
|
|
14
16
|
import { composerProps } from './screen-component-props.js'
|
|
15
17
|
import { useComponentLayout } from './component-motion.js'
|
|
16
18
|
|
|
19
|
+
import { useCachedActivity } from './cached-activity.js'
|
|
20
|
+
|
|
21
|
+
/** Whether the enclosing layout already fits the software keyboard. */
|
|
22
|
+
export const keyboardViewportOwner: InjectionKey<() => boolean> = Symbol('mavis-keyboard-viewport')
|
|
23
|
+
|
|
17
24
|
export function createComposer(
|
|
18
25
|
ui: {
|
|
19
26
|
Box: Component
|
|
@@ -47,23 +54,22 @@ export function createComposer(
|
|
|
47
54
|
const canSend = computed(
|
|
48
55
|
() => !blocked.value && Boolean(props.modelValue.trim() || props.attachments.length),
|
|
49
56
|
)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
follow?.dispose()
|
|
53
|
-
follow = undefined
|
|
54
|
-
if (props.followKeyboard && surface.available)
|
|
55
|
-
follow = surface.followKeyboard({ offset: props.keyboardOffset })
|
|
56
|
-
}
|
|
57
|
+
const active = useCachedActivity()
|
|
58
|
+
const viewportOwned = inject(keyboardViewportOwner, () => false)
|
|
57
59
|
onScopeDispose(
|
|
58
|
-
surface.use(() =>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
surface.use(() =>
|
|
61
|
+
watch(
|
|
62
|
+
() => [props.followKeyboard, props.keyboardOffset, viewportOwned(), active.value],
|
|
63
|
+
(_, __, cleanup) => {
|
|
64
|
+
if (props.followKeyboard && active.value && !viewportOwned()) {
|
|
65
|
+
const follow = surface.followKeyboard({ offset: props.keyboardOffset })
|
|
66
|
+
cleanup(() => follow.dispose())
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{ immediate: true, flush: 'post' },
|
|
70
|
+
),
|
|
71
|
+
),
|
|
65
72
|
)
|
|
66
|
-
watch(() => [props.followKeyboard, props.keyboardOffset], followKeyboard, { flush: 'post' })
|
|
67
73
|
const submit = () => {
|
|
68
74
|
if (canSend.value)
|
|
69
75
|
emit('submit', {
|