@getcortexlabs/mavis-web 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.
Files changed (104) hide show
  1. package/README.md +4 -4
  2. package/dist/components/LoadingDecoration.d.ts +1 -1
  3. package/dist/components/MAccordion.d.ts +1 -1
  4. package/dist/components/MAlert.d.ts +1 -1
  5. package/dist/components/MButton.d.ts +7 -7
  6. package/dist/components/MCard.d.ts +16 -5
  7. package/dist/components/MCard.d.ts.map +1 -1
  8. package/dist/components/MCard.js +4 -2
  9. package/dist/components/MCard.js.map +1 -1
  10. package/dist/components/MCheckbox.d.ts +1 -1
  11. package/dist/components/MChip.d.ts +2 -2
  12. package/dist/components/MCombobox.d.ts +1 -1
  13. package/dist/components/MDatePicker.d.ts +104 -104
  14. package/dist/components/MDatePicker.d.ts.map +1 -1
  15. package/dist/components/MEmptyState.d.ts +2 -2
  16. package/dist/components/MFilePicker.d.ts +1 -1
  17. package/dist/components/MGrid.d.ts +1 -1
  18. package/dist/components/MImage.d.ts +1 -1
  19. package/dist/components/MImageViewer.d.ts.map +1 -1
  20. package/dist/components/MImageViewer.js +11 -2
  21. package/dist/components/MImageViewer.js.map +1 -1
  22. package/dist/components/MInput.d.ts +8 -8
  23. package/dist/components/MLink.d.ts +1 -1
  24. package/dist/components/MListItem.d.ts +1 -1
  25. package/dist/components/MPopover.d.ts +1 -1
  26. package/dist/components/MProgress.d.ts +1 -1
  27. package/dist/components/MRadioGroup.d.ts +1 -1
  28. package/dist/components/MReveal.d.ts +11 -11
  29. package/dist/components/MScreen.d.ts.map +1 -1
  30. package/dist/components/MScreen.js +2 -1
  31. package/dist/components/MScreen.js.map +1 -1
  32. package/dist/components/MSegmentedControl.d.ts +1 -1
  33. package/dist/components/MSelect.d.ts +1 -1
  34. package/dist/components/MSheet.d.ts +6 -6
  35. package/dist/components/MSheet.d.ts.map +1 -1
  36. package/dist/components/MSheet.js +2 -0
  37. package/dist/components/MSheet.js.map +1 -1
  38. package/dist/components/MSkeleton.d.ts +1 -1
  39. package/dist/components/MSkeleton.js +7 -7
  40. package/dist/components/MSkeleton.js.map +1 -1
  41. package/dist/components/MStack.d.ts +11 -11
  42. package/dist/components/MSwitch.d.ts +1 -1
  43. package/dist/components/MTabs.d.ts +1 -1
  44. package/dist/components/MText.d.ts +4 -4
  45. package/dist/components/MTimePicker.d.ts +40 -40
  46. package/dist/components/MTimePicker.d.ts.map +1 -1
  47. package/dist/components/MTooltip.d.ts +1 -1
  48. package/dist/components/advanced.d.ts +34 -34
  49. package/dist/components/configurator.d.ts +36 -36
  50. package/dist/components/creative.d.ts +21 -21
  51. package/dist/components/dashboard.d.ts +13 -13
  52. package/dist/components/dashboard.d.ts.map +1 -1
  53. package/dist/components/dashboard.js +19 -5
  54. package/dist/components/dashboard.js.map +1 -1
  55. package/dist/components/discovery.d.ts +11 -11
  56. package/dist/components/interactive.d.ts +6 -6
  57. package/dist/components/layout.d.ts +34 -34
  58. package/dist/components/navigation.d.ts +4 -4
  59. package/dist/components/screen-components.d.ts +192 -21
  60. package/dist/components/screen-components.d.ts.map +1 -1
  61. package/dist/components/screen-components.js +3 -1
  62. package/dist/components/screen-components.js.map +1 -1
  63. package/dist/components/wayfinding.d.ts +10 -10
  64. package/dist/components/workflows.d.ts +3 -3
  65. package/dist/experimental.d.ts +1 -0
  66. package/dist/experimental.d.ts.map +1 -1
  67. package/dist/experimental.js +1 -0
  68. package/dist/experimental.js.map +1 -1
  69. package/dist/index.d.ts +3 -3
  70. package/dist/index.d.ts.map +1 -1
  71. package/dist/index.js +5 -2
  72. package/dist/index.js.map +1 -1
  73. package/dist/motion-surface.d.ts.map +1 -1
  74. package/dist/motion-surface.js +24 -7
  75. package/dist/motion-surface.js.map +1 -1
  76. package/dist/pointer-availability.d.ts +6 -0
  77. package/dist/pointer-availability.d.ts.map +1 -0
  78. package/dist/pointer-availability.js +49 -0
  79. package/dist/pointer-availability.js.map +1 -0
  80. package/dist/semantic-content.d.ts +206 -0
  81. package/dist/semantic-content.d.ts.map +1 -0
  82. package/dist/semantic-content.js +134 -0
  83. package/dist/semantic-content.js.map +1 -0
  84. package/dist/sheet-motion.d.ts.map +1 -1
  85. package/dist/sheet-motion.js +4 -3
  86. package/dist/sheet-motion.js.map +1 -1
  87. package/dist/visual-effects.d.ts.map +1 -1
  88. package/dist/visual-effects.js +7 -1
  89. package/dist/visual-effects.js.map +1 -1
  90. package/package.json +3 -3
  91. package/src/components/MCard.ts +14 -2
  92. package/src/components/MImageViewer.ts +10 -2
  93. package/src/components/MScreen.ts +2 -0
  94. package/src/components/MSheet.ts +2 -0
  95. package/src/components/MSkeleton.ts +7 -7
  96. package/src/components/dashboard.ts +21 -5
  97. package/src/components/screen-components.ts +6 -0
  98. package/src/experimental.ts +2 -0
  99. package/src/index.ts +10 -0
  100. package/src/motion-surface.ts +23 -7
  101. package/src/pointer-availability.ts +54 -0
  102. package/src/semantic-content.ts +159 -0
  103. package/src/sheet-motion.ts +3 -2
  104. package/src/visual-effects.ts +6 -2
@@ -1 +1 @@
1
- {"version":3,"file":"sheet-motion.js","sourceRoot":"","sources":["../src/sheet-motion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAuB,MAAM,yBAAyB,CAAA;AAE/E,uFAAuF;AACvF,MAAM,UAAU,WAAW,CACzB,MAAyB,EACzB,KAAkB,EAClB,MAAmB,EACnB,OAA2E,EAC3E,MAAkB,EAClB,MAAkB;IAElB,MAAM,OAAO,GAAG,gBAAgB,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;IACrD,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,CAAc,kBAAkB,CAAE,CAAA;IACrE,MAAM,UAAU,GAAG,KAAK,CAAC,aAAa,CAAc,eAAe,CAAE,CAAA;IACrE,IAAI,KAAiC,EACnC,QAAQ,GAAG,KAAK,EAChB,IAAI,GAAG,IAAI,EACX,aAAa,GAAG,KAAK,CAAA;IACvB,I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CAAA;AAEhC,OAAO,EAEL,KAAK,mBAAmB,EAGzB,MAAM,wCAAwC,CAAA;AAY/C,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,UAAU,GAAG,cAAc,EAClC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAC1C,SAAS,EAAE,MAAM,OAAO,GACvB,mBAAmB,CAwHrB"}
1
+ {"version":3,"file":"visual-effects.d.ts","sourceRoot":"","sources":["../src/visual-effects.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAEjB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAEL,KAAK,mBAAmB,EAGzB,MAAM,wCAAwC,CAAA;AAY/C,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,UAAU,GAAG,cAAc,EAClC,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAC1C,SAAS,EAAE,MAAM,OAAO,GACvB,mBAAmB,CA4HrB"}
@@ -58,7 +58,7 @@ export function webVisualEffects(owner, target, sources, plainText) {
58
58
  rollTo: (value, options) => owner.rollTo(text(), value, options),
59
59
  circular() {
60
60
  circles.get(target)?.dispose();
61
- const inert = target.getAttribute('inert'), hidden = target.getAttribute('aria-hidden');
61
+ let inert, hidden;
62
62
  const visibility = target.style.visibility;
63
63
  let locked = false, active, generation = 0, disposed = false;
64
64
  let writtenVisibility;
@@ -80,6 +80,8 @@ export function webVisualEffects(owner, target, sources, plainText) {
80
80
  }
81
81
  };
82
82
  const run = (open, options = {}) => {
83
+ if (disposed)
84
+ throw new Error('The circular control was disposed or replaced.');
83
85
  if (!open && target.contains(target.ownerDocument.activeElement))
84
86
  throw new Error('Move focus outside the circular surface before conceal().');
85
87
  // Jolt validates options before replacing the active circle.
@@ -92,6 +94,10 @@ export function webVisualEffects(owner, target, sources, plainText) {
92
94
  if (open)
93
95
  unlock();
94
96
  else {
97
+ if (!locked) {
98
+ inert = target.getAttribute('inert');
99
+ hidden = target.getAttribute('aria-hidden');
100
+ }
95
101
  locked = true;
96
102
  target.setAttribute('inert', '');
97
103
  target.setAttribute('aria-hidden', 'true');
@@ -1 +1 @@
1
- {"version":3,"file":"visual-effects.js","sourceRoot":"","sources":["../src/visual-effects.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EACL,mBAAmB,GAIpB,MAAM,wCAAwC,CAAA;AAE/C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAoC,CAAA;AAC/D,gFAAgF;AAChF,SAAS,YAAY,CAAC,MAAmB;IACvC,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,WAAY,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,SAAS,CAAA;IACnF,IAAI,CAAC,MAAM,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,IAAI,CAAA;IAC7C,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAA;IAC7C,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAA;IAC9D,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,CAAA;IAC/C,OAAO,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAA;AAC1F,CAAC;AACD,MAAM,UAAU,gBAAgB,CAC9B,KAAkC,EAClC,MAAmB,EACnB,OAA0C,EAC1C,SAAwB;IAExB,MAAM,IAAI,GAAG,GAAG,EAAE;QAChB,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,IAAI,S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oBACf,UAAU,EAAE,CAAA;oBACZ,MAAM,EAAE,IAAI,EAAE,CAAA;oBACd,MAAM,EAAE,CAAA;oBACR,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,OAAO,EAAE,CAAC;wBACpC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;wBACtB,IAAI,iBAAiB,KAAK,SAAS,IAAI,MAAM,CAAC,KAAK,CAAC,UAAU,KAAK,iBAAiB;4BAClF,MAAM,CAAC,KAAK,CAAC,UAAU,GAAG,UAAU,CAAA;oBACxC,CAAC;gBACH,CAAC;aACF,CAAA;YACD,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;YAC5B,OAAO,OAAO,CAAA;QAChB,CAAC;KACF,CAAA;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getcortexlabs/mavis-web",
3
- "version": "0.1.0-rc.14",
3
+ "version": "0.1.0-rc.16",
4
4
  "description": "Mavis components for Vue Web.",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -48,11 +48,11 @@
48
48
  "build": "tsc -p tsconfig.build.json"
49
49
  },
50
50
  "dependencies": {
51
- "@getcortexlabs/mavis-core": "0.1.0-rc.14"
51
+ "@getcortexlabs/mavis-core": "0.1.0-rc.16"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "vue": "^3.5.42",
55
- "@rafaelaugusto/jolt": "^0.1.0-rc.15"
55
+ "@rafaelaugusto/jolt": "^0.1.0-rc.18"
56
56
  },
57
57
  "license": "MIT",
58
58
  "author": "Rafael Augusto",
@@ -7,6 +7,7 @@ import {
7
7
  shallowRef,
8
8
  useId,
9
9
  type VNode,
10
+ type AriaAttributes,
10
11
  } from 'vue'
11
12
  import { preserveBoundPaint } from '../motion-surface.js'
12
13
  import {
@@ -20,6 +21,12 @@ import { MColumn, createLayout } from './layout.js'
20
21
  import { navigationAttrs } from '../navigation.js'
21
22
  import { usePressFeedback } from '../motion.js'
22
23
 
24
+ type CardActionAttributes = Pick<AriaAttributes, 'aria-label' | 'aria-pressed'>
25
+
26
+ declare module '@getcortexlabs/mavis-core/vue' {
27
+ interface CardPlatformAttributes extends CardActionAttributes {}
28
+ }
29
+
23
30
  const LinkColumn = createLayout('MCardLink', 'column', 'a')
24
31
 
25
32
  /** A control owns clicks from its descendants; the surrounding card owns the remaining surface. */
@@ -42,7 +49,7 @@ function ownsClick(event?: MouseEvent) {
42
49
  return false
43
50
  }
44
51
 
45
- export const MCard = defineComponent({
52
+ const Card = defineComponent({
46
53
  name: 'MCard',
47
54
  inheritAttrs: false,
48
55
  props: cardProps,
@@ -76,7 +83,7 @@ export const MCard = defineComponent({
76
83
  ...layout
77
84
  } = props
78
85
  const separateAction = interactive && href === undefined
79
- const { 'aria-label': explicitLabel, ...cardAttrs } = attrs
86
+ const { 'aria-label': explicitLabel, 'aria-pressed': pressed, ...cardAttrs } = attrs
80
87
  const label = props.accessibilityLabel ?? (explicitLabel as string | undefined)
81
88
  if (separateAction) layout.accessibilityLabel = undefined
82
89
  const tokens = theme.value.components.card
@@ -161,6 +168,7 @@ export const MCard = defineComponent({
161
168
  disabled,
162
169
  'aria-disabled': disabled || undefined,
163
170
  'aria-label': label,
171
+ 'aria-pressed': pressed,
164
172
  'aria-labelledby': label ? undefined : contentId,
165
173
  onClick: activate,
166
174
  })
@@ -181,3 +189,7 @@ export const MCard = defineComponent({
181
189
  }
182
190
  },
183
191
  })
192
+
193
+ export const MCard = Card as typeof Card & {
194
+ new (): InstanceType<typeof Card> & { $props: CardActionAttributes }
195
+ }
@@ -69,7 +69,9 @@ export const MImageViewer = defineComponent({
69
69
  detachPhoto = () => {}
70
70
  if (element && shared) detachPhoto = shared.attach(element, 'photo')
71
71
  }
72
+ let zoomRevision = 0
72
73
  function releaseZoom() {
74
+ ++zoomRevision
73
75
  zoom?.dispose()
74
76
  zoom = undefined
75
77
  zoomReady.value = false
@@ -87,23 +89,29 @@ export const MImageViewer = defineComponent({
87
89
  zoom
88
90
  )
89
91
  return
92
+ const owner = ++zoomRevision
90
93
  zoom = lease.runtime.zoomable(photo.value, {
91
94
  viewport: viewport.value,
92
95
  scale: [1, Math.max(1, props.maxZoom)],
93
96
  doubleTap: Math.min(2.5, props.maxZoom),
94
97
  dismiss: 'vertical',
95
98
  onSettled(state) {
99
+ if (owner !== zoomRevision) return
96
100
  scale.value = state.scale
97
101
  if (pendingClose && state.scale <= 1.001) finishClose()
98
102
  },
99
103
  onDismiss(intent) {
104
+ if (owner !== zoomRevision || !requested.value || intent.state.scale > 1.001) {
105
+ intent.cancel()
106
+ return
107
+ }
100
108
  request('gesture')
101
109
  void nextTick(() => {
102
- if (requested.value) intent.cancel()
110
+ if (owner === zoomRevision && requested.value) intent.cancel()
103
111
  })
104
112
  },
105
113
  onError() {
106
- if (displayed.value) emit('error', displayed.value)
114
+ if (owner === zoomRevision && displayed.value) emit('error', displayed.value)
107
115
  },
108
116
  })
109
117
  zoomReady.value = zoom.ready
@@ -5,6 +5,7 @@ import { fontFamily } from '@getcortexlabs/mavis-core'
5
5
  import { defineComponent, h, mergeProps, provide } from 'vue'
6
6
  import {
7
7
  screenProps,
8
+ keyboardViewportOwner,
8
9
  useMavisTheme,
9
10
  layoutDirection,
10
11
  viewAttrs,
@@ -21,6 +22,7 @@ export const MScreen = defineComponent({
21
22
  const region = useMotionRegion(() => props.motionRegion)
22
23
  const { theme } = useMavisTheme()
23
24
  const appToast = useAppToastHost()
25
+ provide(keyboardViewportOwner, () => props.scroll)
24
26
  const element = useScreenViewport(() => props.scroll)
25
27
  useScrollMotion(
26
28
  element,
@@ -1,3 +1,4 @@
1
+ import { keyboardViewportOwner } from '@getcortexlabs/mavis-core/vue'
1
2
  import {
2
3
  defineComponent,
3
4
  h,
@@ -41,6 +42,7 @@ const Sheet = defineComponent({
41
42
  const { theme } = useMavisTheme()
42
43
  const active = useCachedActivity()
43
44
  provide(layoutDirection, 'column')
45
+ provide(keyboardViewportOwner, () => true)
44
46
  const titleId = `m-sheet-${useId()}`
45
47
  const dialog = ref<HTMLDialogElement>()
46
48
  const panel = ref<HTMLElement>()
@@ -1,4 +1,4 @@
1
- import { defineComponent, h, mergeProps, onBeforeUnmount, onMounted, ref, watch } from 'vue'
1
+ import { defineComponent, h, mergeProps, onMounted, ref, watch } from 'vue'
2
2
  import { skeletonProps, useMavisTheme } from '@getcortexlabs/mavis-core/vue'
3
3
  import { MBox } from './layout.js'
4
4
  import { LoadingDecoration } from './LoadingDecoration.js'
@@ -14,17 +14,17 @@ export const MSkeleton = defineComponent({
14
14
  hidden.value = document.hidden
15
15
  }
16
16
  onMounted(() => {
17
- visibility()
18
17
  watch(
19
- () => props.effect,
20
- (effect) => {
21
- document.removeEventListener('visibilitychange', visibility)
22
- if (effect === 'pulse') document.addEventListener('visibilitychange', visibility)
18
+ () => props.effect === 'pulse' && props.animated,
19
+ (pulse, _, onCleanup) => {
20
+ if (!pulse) return
21
+ visibility()
22
+ document.addEventListener('visibilitychange', visibility)
23
+ onCleanup(() => document.removeEventListener('visibilitychange', visibility))
23
24
  },
24
25
  { immediate: true },
25
26
  )
26
27
  })
27
- onBeforeUnmount(() => document.removeEventListener('visibilitychange', visibility))
28
28
  return () =>
29
29
  h(
30
30
  props.effect === 'shimmer' ? LoadingDecoration : MBox,
@@ -142,7 +142,11 @@ const Zone = defineComponent({
142
142
  return () =>
143
143
  h(
144
144
  'div',
145
- mergeProps(attrs, { ref: root, 'data-kanban-column': props.column }),
145
+ mergeProps(attrs, {
146
+ ref: root,
147
+ 'data-kanban-column': props.column,
148
+ style: { position: 'relative', zIndex: props.raised ? 20 : undefined },
149
+ }),
146
150
  slots.default?.(),
147
151
  )
148
152
  },
@@ -188,11 +192,17 @@ const Drag = defineComponent({
188
192
  else surface.set({ x: 0, y: 0, scale: 1 })
189
193
  }
190
194
  function cancel() {
195
+ end(true)
196
+ }
197
+ function cancelImmediately() {
198
+ end(false)
199
+ }
200
+ function end(animated: boolean) {
191
201
  const was = live
192
202
  settle()
193
203
  zones?.cancel()
194
204
  if (!was) return
195
- rest(true)
205
+ rest(animated)
196
206
  registry.finish(props.cardId)
197
207
  }
198
208
  function release() {
@@ -257,7 +267,7 @@ const Drag = defineComponent({
257
267
  useConnectedMotion(root, useMotionContext(), (owner) => {
258
268
  runtime = owner
259
269
  return () => {
260
- cancel()
270
+ cancelImmediately()
261
271
  release()
262
272
  runtime = undefined
263
273
  }
@@ -271,11 +281,17 @@ const Drag = defineComponent({
271
281
  )
272
282
  })
273
283
  onBeforeUnmount(() => {
274
- cancel()
284
+ cancelImmediately()
275
285
  registry.cards.delete(props.cardId)
276
286
  registry.focus.delete(props.cardId)
277
287
  })
278
- onDeactivated(cancel)
288
+ onDeactivated(cancelImmediately)
289
+ onScopeDispose(
290
+ surface.use(() => {
291
+ rest(false)
292
+ return cancelImmediately
293
+ }),
294
+ )
279
295
  watch(
280
296
  () => props.disabled,
281
297
  (value) => {
@@ -2,6 +2,7 @@ import { defineComponent, h, mergeProps, ref } from 'vue'
2
2
  import {
3
3
  createAnimatedText,
4
4
  createComposer,
5
+ createEditorControls,
5
6
  createSpeedDial,
6
7
  createScrollComponents,
7
8
  scrollFrameHostProps,
@@ -13,6 +14,7 @@ import { MCard } from './MCard.js'
13
14
  import { MText } from './MText.js'
14
15
  import { MInput } from './MInput.js'
15
16
  import { MImage } from './MImage.js'
17
+ import { MAvatar } from './MAvatar.js'
16
18
  import { MButton } from './MButton.js'
17
19
  import { MChip } from './MChip.js'
18
20
  import { MPopover } from './MPopover.js'
@@ -80,6 +82,10 @@ const ui = {
80
82
  Frame,
81
83
  }
82
84
  export const MAnimatedText = createAnimatedText(MText)
85
+ export const { MTagInput, MAvatarGroup, MSearchBar } = createEditorControls(
86
+ { ...ui, Avatar: MAvatar },
87
+ 'web',
88
+ )
83
89
  export const MComposer = createComposer(ui, 'web')
84
90
  export const MSpeedDial = createSpeedDial(ui)
85
91
  export const { MCollapsibleHeader, MRefreshControl } = createScrollComponents(ui, 'web')
@@ -55,3 +55,5 @@ export function configureMavisWebMotion(
55
55
  if (getCurrentScope()) onScopeDispose(stop)
56
56
  return stop
57
57
  }
58
+
59
+ export { MWebElement, MWebButton, MWebLink } from './semantic-content.js'
package/src/index.ts CHANGED
@@ -26,6 +26,9 @@ import {
26
26
  import {
27
27
  MCollapsibleHeader,
28
28
  MRefreshControl,
29
+ MTagInput,
30
+ MAvatarGroup,
31
+ MSearchBar,
29
32
  MComposer,
30
33
  MSpeedDial,
31
34
  MPinInput,
@@ -119,6 +122,9 @@ export {
119
122
  MMarquee,
120
123
  MCollapsibleHeader,
121
124
  MRefreshControl,
125
+ MTagInput,
126
+ MAvatarGroup,
127
+ MSearchBar,
122
128
  MComposer,
123
129
  MSpeedDial,
124
130
  MPinInput,
@@ -207,6 +213,7 @@ export {
207
213
  } from '@getcortexlabs/mavis-core/vue'
208
214
  export type {
209
215
  MavisThemeContext,
216
+ ThemePair,
210
217
  MavisPlatform,
211
218
  MavisPlatformTarget,
212
219
  MavisPlatformContext,
@@ -249,6 +256,9 @@ export function createMavis(options: MavisOptions = {}) {
249
256
  MMarquee,
250
257
  MCollapsibleHeader,
251
258
  MRefreshControl,
259
+ MTagInput,
260
+ MAvatarGroup,
261
+ MSearchBar,
252
262
  MComposer,
253
263
  MSpeedDial,
254
264
  MPinInput,
@@ -9,6 +9,7 @@ import type {
9
9
  import { motionKeyframes, type MotionSurfaceAdapter } from '@getcortexlabs/mavis-core/experimental'
10
10
  import { webRegion } from './motion-region.js'
11
11
  import { webVisualEffects } from './visual-effects.js'
12
+ import { watchPointerAvailability } from './pointer-availability.js'
12
13
 
13
14
  const boundPaint = new WeakMap<HTMLElement, Map<string, number>>()
14
15
  const paintKeys = new Set([
@@ -136,12 +137,17 @@ export function webMotionSurface(
136
137
  const input = webRegion(region)
137
138
  if (input.runtime !== runtime || input.target === target || !input.target.contains(target))
138
139
  throw new TypeError('Use a separate enclosing motion region for pointer input.')
140
+ const { onAvailabilityChange, ...inputOptions } = options
139
141
  const pointer = owner.pointerFollow(input.target, {
140
- ...options,
142
+ ...inputOptions,
141
143
  disabled: options.disabled || !enabled(),
142
144
  })
143
145
  let disabled = options.disabled ?? false
144
- const refresh = () => pointer.update({ disabled: disabled || !enabled() })
146
+ const unwatch = watchPointerAvailability(pointer, input.target, runtime, onAvailabilityChange)
147
+ const refresh = () => {
148
+ pointer.update({ disabled: disabled || !enabled() })
149
+ unwatch.notify()
150
+ }
145
151
  refreshes.set(pointer, refresh)
146
152
  // The pointer owns its values; wrappers are borrowed by Mavis bindings.
147
153
  const wrap = (value: WebReadableValue) => {
@@ -153,9 +159,12 @@ export function webMotionSurface(
153
159
  x: wrap(pointer.x),
154
160
  y: wrap(pointer.y),
155
161
  presence: wrap(pointer.presence),
156
- execution: 'hover',
157
- // Pointer events exist in every browser; whether a mouse is connected is not known.
158
- available: true,
162
+ get execution() {
163
+ return pointer.available ? ('hover' as const) : ('static' as const)
164
+ },
165
+ get available() {
166
+ return pointer.available
167
+ },
159
168
  get active() {
160
169
  return pointer.active
161
170
  },
@@ -163,10 +172,17 @@ export function webMotionSurface(
163
172
  disabled = state.disabled
164
173
  refresh()
165
174
  },
166
- refresh: () => pointer.refresh(),
175
+ refresh: () => {
176
+ pointer.refresh()
177
+ unwatch.notify()
178
+ },
167
179
  dispose() {
168
180
  refreshes.delete(pointer)
169
- pointer.dispose()
181
+ try {
182
+ unwatch()
183
+ } finally {
184
+ pointer.dispose()
185
+ }
170
186
  },
171
187
  }
172
188
  },
@@ -0,0 +1,54 @@
1
+ import type { WebPointerFollow, WebRuntime } from '@rafaelaugusto/jolt/web'
2
+
3
+ /** Observe inputs that can change Jolt's getter; Jolt alone decides availability and resets motion. */
4
+ export function watchPointerAvailability(
5
+ pointer: WebPointerFollow,
6
+ region: HTMLElement,
7
+ runtime: WebRuntime,
8
+ changed?: (available: boolean) => void,
9
+ ) {
10
+ if (!changed) return Object.assign(() => {}, { notify() {} })
11
+ const document = region.ownerDocument
12
+ const view = document.defaultView!
13
+ let stopped = false,
14
+ queued = false,
15
+ previous: boolean | undefined
16
+ const notify = () => {
17
+ if (stopped || queued) return
18
+ queued = true
19
+ // Let Jolt process the same event first, including reduced-motion preferences.
20
+ queueMicrotask(() => {
21
+ queued = false
22
+ if (stopped) return
23
+ const available = pointer.available
24
+ if (available !== previous) changed((previous = available))
25
+ })
26
+ }
27
+ const hover = view.matchMedia('(any-hover: hover)')
28
+ hover.addEventListener('change', notify)
29
+ document.addEventListener('visibilitychange', notify)
30
+ const offReduced = runtime.onReducedMotion(notify)
31
+ const observer = new MutationObserver(notify)
32
+ observer.observe(document, { childList: true, subtree: true })
33
+ let ancestor: Element | null = region
34
+ while (ancestor) {
35
+ observer.observe(ancestor, {
36
+ attributes: true,
37
+ attributeFilter: ['disabled', 'aria-disabled', 'aria-busy', 'inert'],
38
+ })
39
+ ancestor = ancestor.parentElement ?? (ancestor.getRootNode() as ShadowRoot).host ?? null
40
+ }
41
+ notify()
42
+ return Object.assign(
43
+ () => {
44
+ if (stopped) return
45
+ stopped = true
46
+ observer.disconnect()
47
+ hover.removeEventListener('change', notify)
48
+ document.removeEventListener('visibilitychange', notify)
49
+ offReduced()
50
+ if (previous !== false) changed(false)
51
+ },
52
+ { notify },
53
+ )
54
+ }
@@ -0,0 +1,159 @@
1
+ import { defineComponent, h, mergeProps, type PropType } from 'vue'
2
+ import {
3
+ actionEmits,
4
+ buttonProps,
5
+ linkEmits,
6
+ linkProps,
7
+ useButtonAction,
8
+ useNavigationOptions,
9
+ motionBoxProps,
10
+ } from '@getcortexlabs/mavis-core/vue'
11
+ import { useMotionRegion } from './motion-region.js'
12
+ import { useMotionSurface } from './use-motion-surface.js'
13
+ import { navigationAttrs } from './navigation.js'
14
+ import { webAttrs } from './style.js'
15
+
16
+ // Limit hosts to document structure. Actions and links own their interaction contracts.
17
+ const tags = [
18
+ 'div',
19
+ 'span',
20
+ 'section',
21
+ 'article',
22
+ 'header',
23
+ 'footer',
24
+ 'aside',
25
+ 'main',
26
+ 'nav',
27
+ 'h1',
28
+ 'h2',
29
+ 'h3',
30
+ 'h4',
31
+ 'h5',
32
+ 'h6',
33
+ 'p',
34
+ 'strong',
35
+ 'b',
36
+ 'em',
37
+ 'i',
38
+ 'small',
39
+ 'code',
40
+ 'pre',
41
+ 'blockquote',
42
+ 'ol',
43
+ 'ul',
44
+ 'li',
45
+ 'dl',
46
+ 'dt',
47
+ 'dd',
48
+ 'figure',
49
+ 'figcaption',
50
+ 'form',
51
+ 'table',
52
+ 'caption',
53
+ 'thead',
54
+ 'tbody',
55
+ 'tfoot',
56
+ 'tr',
57
+ 'th',
58
+ 'td',
59
+ 'br',
60
+ 'hr',
61
+ 'sup',
62
+ 'sub',
63
+ 'time',
64
+ 'address',
65
+ 'label',
66
+ 'mark',
67
+ 'cite',
68
+ ] as const
69
+ type ContentTag = (typeof tags)[number]
70
+
71
+ /** A semantic host inside a Web motion region. Site CSS controls the formatting context. */
72
+ export const MWebElement = defineComponent({
73
+ name: 'MWebElement',
74
+ inheritAttrs: false,
75
+ props: {
76
+ as: { type: String as PropType<ContentTag>, default: 'div' },
77
+ motionRegion: motionBoxProps.motionRegion,
78
+ motionSurface: motionBoxProps.motionSurface,
79
+ },
80
+ setup(props, { attrs, slots }) {
81
+ const region = useMotionRegion(() => props.motionRegion)
82
+ const surface = useMotionSurface(() => props.motionSurface)
83
+ return () => {
84
+ if (!tags.includes(props.as)) throw new TypeError('Unsupported MWebElement tag')
85
+ return h(props.as, mergeProps(webAttrs(attrs), region, surface), slots.default?.())
86
+ }
87
+ },
88
+ })
89
+
90
+ /** CSS-styled form action with a rich visual label and an optional declared motion surface. */
91
+ export const MWebButton = defineComponent({
92
+ name: 'MWebButton',
93
+ inheritAttrs: false,
94
+ props: {
95
+ type: buttonProps.type,
96
+ name: buttonProps.name,
97
+ value: buttonProps.value,
98
+ form: buttonProps.form,
99
+ disabled: buttonProps.disabled,
100
+ loading: buttonProps.loading,
101
+ motionSurface: buttonProps.motionSurface,
102
+ accessibilityLabel: buttonProps.accessibilityLabel,
103
+ },
104
+ emits: { click: actionEmits.click },
105
+ setup(props, { attrs, slots, emit }) {
106
+ useButtonAction()
107
+ const enabled = () => !props.disabled && !props.loading
108
+ const surface = useMotionSurface(() => props.motionSurface)
109
+ return () =>
110
+ h(
111
+ 'button',
112
+ mergeProps(surface, webAttrs(attrs), {
113
+ type: props.type,
114
+ name: props.name,
115
+ value: props.value,
116
+ form: props.form,
117
+ disabled: !enabled(),
118
+ 'aria-label': props.accessibilityLabel ?? attrs['aria-label'],
119
+ 'aria-busy': props.loading || undefined,
120
+ onClick: (event: MouseEvent) => {
121
+ if (enabled() && !event.defaultPrevented) emit('click')
122
+ },
123
+ }),
124
+ slots.default?.(),
125
+ )
126
+ },
127
+ })
128
+
129
+ /** One real anchor, with the same destination, modifier and navigation rules as MLink. */
130
+ export const MWebLink = defineComponent({
131
+ name: 'MWebLink',
132
+ inheritAttrs: false,
133
+ props: {
134
+ href: linkProps.href,
135
+ target: linkProps.target,
136
+ rel: linkProps.rel,
137
+ navigate: linkProps.navigate,
138
+ disabled: linkProps.disabled,
139
+ accessibilityLabel: linkProps.accessibilityLabel,
140
+ },
141
+ emits: linkEmits,
142
+ setup(props, { attrs, slots, emit }) {
143
+ const navigation = useNavigationOptions(props)
144
+ return () =>
145
+ h(
146
+ 'a',
147
+ mergeProps(webAttrs(attrs), {
148
+ 'aria-label': props.accessibilityLabel ?? attrs['aria-label'],
149
+ ...navigationAttrs(
150
+ navigation(),
151
+ props.disabled,
152
+ () => emit('click'),
153
+ (error) => emit('error', error),
154
+ ),
155
+ }),
156
+ slots.default?.(),
157
+ )
158
+ },
159
+ })