@getcortexlabs/mavis-core 0.1.0-alpha.5 → 0.1.0-alpha.7

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 (127) hide show
  1. package/dist/app-icons.d.ts +27 -0
  2. package/dist/app-icons.d.ts.map +1 -0
  3. package/dist/app-icons.js +42 -0
  4. package/dist/app-icons.js.map +1 -0
  5. package/dist/capabilities.d.ts +7 -7
  6. package/dist/capabilities.d.ts.map +1 -1
  7. package/dist/capabilities.js +9 -4
  8. package/dist/capabilities.js.map +1 -1
  9. package/dist/choice-motion.d.ts +14 -0
  10. package/dist/choice-motion.d.ts.map +1 -0
  11. package/dist/choice-motion.js +5 -0
  12. package/dist/choice-motion.js.map +1 -0
  13. package/dist/contracts.d.ts +61 -1
  14. package/dist/contracts.d.ts.map +1 -1
  15. package/dist/contracts.js +8 -1
  16. package/dist/contracts.js.map +1 -1
  17. package/dist/experimental-playback.d.ts +63 -0
  18. package/dist/experimental-playback.d.ts.map +1 -0
  19. package/dist/experimental-playback.js +46 -0
  20. package/dist/experimental-playback.js.map +1 -0
  21. package/dist/experimental-regions.d.ts +12 -0
  22. package/dist/experimental-regions.d.ts.map +1 -1
  23. package/dist/experimental-regions.js +125 -0
  24. package/dist/experimental-regions.js.map +1 -1
  25. package/dist/experimental.d.ts +38 -4
  26. package/dist/experimental.d.ts.map +1 -1
  27. package/dist/experimental.js +70 -11
  28. package/dist/experimental.js.map +1 -1
  29. package/dist/index.d.ts +8 -2
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +7 -1
  32. package/dist/index.js.map +1 -1
  33. package/dist/link.d.ts +12 -0
  34. package/dist/link.d.ts.map +1 -0
  35. package/dist/link.js +19 -0
  36. package/dist/link.js.map +1 -0
  37. package/dist/motion.d.ts +29 -4
  38. package/dist/motion.d.ts.map +1 -1
  39. package/dist/motion.js +55 -3
  40. package/dist/motion.js.map +1 -1
  41. package/dist/multi-select.d.ts +4 -0
  42. package/dist/multi-select.d.ts.map +1 -0
  43. package/dist/multi-select.js +23 -0
  44. package/dist/multi-select.js.map +1 -0
  45. package/dist/number-input.d.ts +21 -0
  46. package/dist/number-input.d.ts.map +1 -0
  47. package/dist/number-input.js +63 -0
  48. package/dist/number-input.js.map +1 -0
  49. package/dist/responsive.d.ts +18 -0
  50. package/dist/responsive.d.ts.map +1 -0
  51. package/dist/responsive.js +35 -0
  52. package/dist/responsive.js.map +1 -0
  53. package/dist/theme/themes.js +3 -3
  54. package/dist/theme/themes.js.map +1 -1
  55. package/dist/theme/types.d.ts +12 -3
  56. package/dist/theme/types.d.ts.map +1 -1
  57. package/dist/vue/component-props.d.ts +434 -0
  58. package/dist/vue/component-props.d.ts.map +1 -1
  59. package/dist/vue/component-props.js +4 -0
  60. package/dist/vue/component-props.js.map +1 -1
  61. package/dist/vue/configurator-props.d.ts +251 -0
  62. package/dist/vue/configurator-props.d.ts.map +1 -0
  63. package/dist/vue/configurator-props.js +56 -0
  64. package/dist/vue/configurator-props.js.map +1 -0
  65. package/dist/vue/configurator.d.ts +403 -0
  66. package/dist/vue/configurator.d.ts.map +1 -0
  67. package/dist/vue/configurator.js +287 -0
  68. package/dist/vue/configurator.js.map +1 -0
  69. package/dist/vue/contracts.d.ts.map +1 -1
  70. package/dist/vue/contracts.js +7 -1
  71. package/dist/vue/contracts.js.map +1 -1
  72. package/dist/vue/date-picker.d.ts +50 -12
  73. package/dist/vue/date-picker.d.ts.map +1 -1
  74. package/dist/vue/date-picker.js +28 -6
  75. package/dist/vue/date-picker.js.map +1 -1
  76. package/dist/vue/date-props.d.ts +9 -0
  77. package/dist/vue/date-props.d.ts.map +1 -1
  78. package/dist/vue/date-props.js +3 -0
  79. package/dist/vue/date-props.js.map +1 -1
  80. package/dist/vue/global-components.d.ts +19 -0
  81. package/dist/vue/global-components.d.ts.map +1 -1
  82. package/dist/vue/index.d.ts +6 -2
  83. package/dist/vue/index.d.ts.map +1 -1
  84. package/dist/vue/index.js +5 -2
  85. package/dist/vue/index.js.map +1 -1
  86. package/dist/vue/layout-context.d.ts +4 -2
  87. package/dist/vue/layout-context.d.ts.map +1 -1
  88. package/dist/vue/layout-context.js +7 -2
  89. package/dist/vue/layout-context.js.map +1 -1
  90. package/dist/vue/props.d.ts +365 -0
  91. package/dist/vue/props.d.ts.map +1 -1
  92. package/dist/vue/props.js +25 -1
  93. package/dist/vue/props.js.map +1 -1
  94. package/dist/vue/reveal-state.d.ts +18 -0
  95. package/dist/vue/reveal-state.d.ts.map +1 -0
  96. package/dist/vue/reveal-state.js +76 -0
  97. package/dist/vue/reveal-state.js.map +1 -0
  98. package/dist/vue/theme.d.ts +42 -0
  99. package/dist/vue/theme.d.ts.map +1 -1
  100. package/dist/vue/workflows.d.ts +1 -1
  101. package/package.json +1 -1
  102. package/src/app-icons.ts +57 -0
  103. package/src/capabilities.ts +9 -4
  104. package/src/choice-motion.ts +12 -0
  105. package/src/contracts.ts +12 -2
  106. package/src/experimental-playback.ts +115 -0
  107. package/src/experimental-regions.ts +151 -0
  108. package/src/experimental.ts +139 -21
  109. package/src/index.ts +10 -1
  110. package/src/link.ts +28 -0
  111. package/src/motion.ts +61 -3
  112. package/src/multi-select.ts +30 -0
  113. package/src/number-input.ts +80 -0
  114. package/src/responsive.ts +61 -0
  115. package/src/theme/themes.ts +3 -3
  116. package/src/theme/types.ts +13 -1
  117. package/src/vue/component-props.ts +4 -0
  118. package/src/vue/configurator-props.ts +59 -0
  119. package/src/vue/configurator.ts +350 -0
  120. package/src/vue/contracts.ts +7 -1
  121. package/src/vue/date-picker.ts +33 -6
  122. package/src/vue/date-props.ts +3 -0
  123. package/src/vue/global-components.ts +21 -1
  124. package/src/vue/index.ts +9 -1
  125. package/src/vue/layout-context.ts +10 -3
  126. package/src/vue/props.ts +27 -1
  127. package/src/vue/reveal-state.ts +83 -0
@@ -0,0 +1,76 @@
1
+ import { onBeforeUnmount, ref, watch } from '@vue/runtime-core';
2
+ /** Presence outlives a closing animation. Reversal updates the same mounted subtree. */
3
+ export function useRevealState(show) {
4
+ const present = ref(show());
5
+ const phase = ref(show() ? 'open' : 'closed');
6
+ let host;
7
+ let playback;
8
+ let revision = 0;
9
+ let fresh = false;
10
+ const settle = (open) => {
11
+ phase.value = open ? 'open' : 'closed';
12
+ present.value = open;
13
+ };
14
+ function run(open) {
15
+ if (!host)
16
+ return;
17
+ const current = ++revision;
18
+ if (open)
19
+ host.captureFocus();
20
+ else
21
+ host.restoreFocus();
22
+ host.interactive(open);
23
+ // Starting a new Jolt operation hands the current trajectory to its successor.
24
+ playback = host.animate(open, fresh);
25
+ fresh = false;
26
+ return playback.finished.then(() => {
27
+ if (current === revision) {
28
+ playback = undefined;
29
+ settle(open);
30
+ }
31
+ }, (error) => {
32
+ if (current === revision) {
33
+ playback = undefined;
34
+ settle(open);
35
+ }
36
+ throw error;
37
+ });
38
+ }
39
+ watch(show, (open) => {
40
+ const wasPresent = present.value;
41
+ fresh = open && !wasPresent;
42
+ if (open)
43
+ present.value = true;
44
+ phase.value = open ? 'opening' : 'closing';
45
+ if (host)
46
+ return run(open);
47
+ else if (!open)
48
+ settle(false);
49
+ }, { flush: 'pre' });
50
+ const detach = () => {
51
+ revision++;
52
+ playback?.stop();
53
+ playback = undefined;
54
+ host?.release();
55
+ host = undefined;
56
+ settle(show());
57
+ };
58
+ onBeforeUnmount(detach);
59
+ return {
60
+ present,
61
+ phase,
62
+ detach,
63
+ attach(next) {
64
+ revision++;
65
+ playback?.stop();
66
+ playback = undefined;
67
+ host?.release();
68
+ host = next;
69
+ if (phase.value === 'opening' || phase.value === 'closing')
70
+ return run(show());
71
+ else
72
+ host.interactive(show());
73
+ },
74
+ };
75
+ }
76
+ //# sourceMappingURL=reveal-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reveal-state.js","sourceRoot":"","sources":["../../src/vue/reveal-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,mBAAm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I,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAA;QAC/B,CAAC;KACF,CAAA;AACH,CAAC"}
@@ -199,6 +199,13 @@ export declare function createThemeContext(options?: MavisTheme | ThemeContextOp
199
199
  };
200
200
  readonly motion: {
201
201
  readonly pressScale: number;
202
+ readonly pressDuration: number;
203
+ readonly releaseDuration: number;
204
+ readonly releaseBounce: number;
205
+ readonly enterDuration: number;
206
+ readonly exitDuration: number;
207
+ readonly enterOffset: number;
208
+ readonly ease: import("../index.js").MotionEase;
202
209
  };
203
210
  }, {
204
211
  readonly name: string;
@@ -385,6 +392,13 @@ export declare function createThemeContext(options?: MavisTheme | ThemeContextOp
385
392
  };
386
393
  readonly motion: {
387
394
  readonly pressScale: number;
395
+ readonly pressDuration: number;
396
+ readonly releaseDuration: number;
397
+ readonly releaseBounce: number;
398
+ readonly enterDuration: number;
399
+ readonly exitDuration: number;
400
+ readonly enterOffset: number;
401
+ readonly ease: import("../index.js").MotionEase;
388
402
  };
389
403
  }>>;
390
404
  themes: Readonly<import("@vue/reactivity").Ref<{
@@ -573,6 +587,13 @@ export declare function createThemeContext(options?: MavisTheme | ThemeContextOp
573
587
  };
574
588
  readonly motion: {
575
589
  readonly pressScale: number;
590
+ readonly pressDuration: number;
591
+ readonly releaseDuration: number;
592
+ readonly releaseBounce: number;
593
+ readonly enterDuration: number;
594
+ readonly exitDuration: number;
595
+ readonly enterOffset: number;
596
+ readonly ease: import("../index.js").MotionEase;
576
597
  };
577
598
  } | undefined;
578
599
  readonly dark?: {
@@ -760,6 +781,13 @@ export declare function createThemeContext(options?: MavisTheme | ThemeContextOp
760
781
  };
761
782
  readonly motion: {
762
783
  readonly pressScale: number;
784
+ readonly pressDuration: number;
785
+ readonly releaseDuration: number;
786
+ readonly releaseBounce: number;
787
+ readonly enterDuration: number;
788
+ readonly exitDuration: number;
789
+ readonly enterOffset: number;
790
+ readonly ease: import("../index.js").MotionEase;
763
791
  };
764
792
  } | undefined;
765
793
  }, {
@@ -948,6 +976,13 @@ export declare function createThemeContext(options?: MavisTheme | ThemeContextOp
948
976
  };
949
977
  readonly motion: {
950
978
  readonly pressScale: number;
979
+ readonly pressDuration: number;
980
+ readonly releaseDuration: number;
981
+ readonly releaseBounce: number;
982
+ readonly enterDuration: number;
983
+ readonly exitDuration: number;
984
+ readonly enterOffset: number;
985
+ readonly ease: import("../index.js").MotionEase;
951
986
  };
952
987
  } | undefined;
953
988
  readonly dark?: {
@@ -1135,6 +1170,13 @@ export declare function createThemeContext(options?: MavisTheme | ThemeContextOp
1135
1170
  };
1136
1171
  readonly motion: {
1137
1172
  readonly pressScale: number;
1173
+ readonly pressDuration: number;
1174
+ readonly releaseDuration: number;
1175
+ readonly releaseBounce: number;
1176
+ readonly enterDuration: number;
1177
+ readonly exitDuration: number;
1178
+ readonly enterOffset: number;
1179
+ readonly ease: import("../index.js").MotionEase;
1138
1180
  };
1139
1181
  } | undefined;
1140
1182
  }>>;
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/vue/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,YAAY,CAAC,CAAA;AACjD,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,QAAQ,CAAA;AAElD,gHAAgH;AAChH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,IAAI,UAAU,GAAG,SAAS,CAAA;IACjC,OAAO,CAAC,QAAQ,EAAE,CAAC,UAAU,EAAE,UAAU,KAAK,IAAI,GAAG,MAAM,IAAI,CAAA;CAChE;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,UAAU,CAAC,EAAE,cAAc,CAAA;IAC3B,MAAM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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+B7E,6FAA6F;;wBAEzE,cAAc;IAIlC,2EAA2E;mBAC5D,UAAU;;EAS5B;AACD,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAErE,eAAO,MAAM,QAAQ,EAAE,YAAY,CAAC,iBAAiB,CAAyB,CAAA;AAE9E,kFAAkF;AAClF,wBAAgB,aAAa,IAAI,iBAAiB,CAEjD"}
@@ -135,9 +135,9 @@ export declare function createWorkflows(ui: Primitives, platform: 'web' | 'nativ
135
135
  loading: boolean;
136
136
  disabled: boolean;
137
137
  modelValue: ChoiceValue | null;
138
+ errorLabel: string;
138
139
  currentLabel: string;
139
140
  completeLabel: string;
140
- errorLabel: string;
141
141
  }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
142
142
  MPagination: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
143
143
  modelValue: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getcortexlabs/mavis-core",
3
- "version": "0.1.0-alpha.5",
3
+ "version": "0.1.0-alpha.7",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "description": "Shared Mavis themes and component contracts.",
@@ -0,0 +1,57 @@
1
+ export interface AppIconChoice {
2
+ id: string
3
+ label: string
4
+ }
5
+ export interface AppIconAdapter {
6
+ supported(): boolean
7
+ current(): string | undefined
8
+ select(id: string): Promise<void>
9
+ }
10
+ export class AppIconError extends Error {
11
+ constructor(
12
+ public readonly code: 'unsupported' | 'configuration' | 'unknown-icon' | 'platform',
13
+ message: string,
14
+ options?: ErrorOptions,
15
+ ) {
16
+ super(message, options)
17
+ this.name = 'AppIconError'
18
+ }
19
+ }
20
+
21
+ /** The OS stores selection. Requests are serialized; a rejected request does not block later ones. */
22
+ export function createAppIconController(
23
+ choices: readonly AppIconChoice[],
24
+ primary: string,
25
+ adapter: AppIconAdapter,
26
+ ) {
27
+ const ids = new Set<string>()
28
+ for (const choice of choices) {
29
+ if (!choice.id.trim() || !choice.label.trim() || ids.has(choice.id))
30
+ throw new AppIconError('configuration', 'App icons need unique IDs and visible labels.')
31
+ ids.add(choice.id)
32
+ }
33
+ if (!ids.has(primary))
34
+ throw new AppIconError('configuration', 'The primary icon must be configured.')
35
+ let pending = Promise.resolve()
36
+ const select = (id: string): Promise<void> => {
37
+ if (!ids.has(id))
38
+ return Promise.reject(new AppIconError('unknown-icon', `Unknown app icon: ${id}`))
39
+ const task = pending.then(async () => {
40
+ if (!adapter.supported())
41
+ throw new AppIconError('unsupported', 'This runtime cannot change its launcher icon.')
42
+ if (adapter.current() === id) return
43
+ await adapter.select(id)
44
+ })
45
+ pending = task.catch(() => {})
46
+ return task
47
+ }
48
+ return {
49
+ choices: Object.freeze(choices.map((choice) => Object.freeze({ ...choice }))),
50
+ primary,
51
+ supported: () => adapter.supported(),
52
+ current: () => adapter.current(),
53
+ select,
54
+ reset: () => select(primary),
55
+ }
56
+ }
57
+ export type AppIconController = ReturnType<typeof createAppIconController>
@@ -3,6 +3,8 @@ export const componentNames = [
3
3
  'MScreen',
4
4
  'MRow',
5
5
  'MColumn',
6
+ 'MStack',
7
+ 'MLink',
6
8
  'MBox',
7
9
  'MCard',
8
10
  'MText',
@@ -34,6 +36,9 @@ export const componentNames = [
34
36
  'MReveal',
35
37
  'MDatePicker',
36
38
  'MDateRangePicker',
39
+ 'MNumberInput',
40
+ 'MMultiSelect',
41
+ 'MImage',
37
42
  'MCombobox',
38
43
  'MFilePicker',
39
44
  'MFormGroup',
@@ -47,7 +52,7 @@ export type CapabilityStatus = 'experimental' | 'planned' | 'unsupported' | 'unv
47
52
  export const targetCapabilities = {
48
53
  version: 1,
49
54
  source: 'repository',
50
- publishedBaseline: '0.1.0-alpha.4',
55
+ publishedBaseline: '0.1.0-alpha.5',
51
56
  targets: [
52
57
  {
53
58
  id: 'vue-web',
@@ -64,9 +69,9 @@ export const targetCapabilities = {
64
69
  streaming: 'unverified',
65
70
  rsc: 'unsupported',
66
71
  },
67
- motion: { engine: 'jolt', minimum: '0.1.0-rc.6', start: 'client-mount' },
72
+ motion: { engine: 'jolt', minimum: '0.1.0-rc.9', start: 'client-mount' },
68
73
  ssr: {
69
- availability: 'unreleased',
74
+ availability: '0.1.0-alpha.5',
70
75
  host: 'nuxt',
71
76
  hostVersion: '4.6.3',
72
77
  vueVersion: '3.5.44',
@@ -107,7 +112,7 @@ export const targetCapabilities = {
107
112
  streaming: 'unsupported',
108
113
  rsc: 'unsupported',
109
114
  },
110
- motion: { engine: 'jolt', minimum: '0.1.0-rc.6', start: 'native-loaded' },
115
+ motion: { engine: 'jolt', minimum: '0.1.0-rc.9', start: 'native-loaded' },
111
116
  },
112
117
  ],
113
118
  planned: [
@@ -0,0 +1,12 @@
1
+ import type { MavisTheme } from './theme/types.js'
2
+
3
+ /** Paint uses the theme's interaction timing; adapters own surfaces and disposal. */
4
+ export function choiceMotion(theme: Readonly<MavisTheme>) {
5
+ return { type: 'tween' as const, duration: theme.motion.enterDuration, ease: theme.motion.ease }
6
+ }
7
+ export interface ChoicePaint {
8
+ backgroundColor?: string
9
+ borderColor?: string
10
+ color?: string
11
+ borderRadius?: number
12
+ }
package/src/contracts.ts CHANGED
@@ -2,9 +2,10 @@ import type { MotionSurface, MotionRegion } from './experimental.js'
2
2
  import type { Dimension } from './layout.js'
3
3
  import type { InputAction, InputHandle } from './input.js'
4
4
  import type { IconName } from './icon.js'
5
+ import type { LinkNavigate, LinkTarget } from './link.js'
5
6
  import type { FontWeight, Palette, Radius, Spacing } from './theme/types.js'
6
7
 
7
- type PropertyKind = 'string' | 'number' | 'boolean' | 'object'
8
+ type PropertyKind = 'string' | 'number' | 'boolean' | 'object' | 'function'
8
9
  declare const propertyValue: unique symbol
9
10
 
10
11
  /** Plain metadata; the symbol carries a TypeScript type and is never emitted. */
@@ -113,7 +114,15 @@ export const columnContract = {
113
114
  }),
114
115
  }
115
116
 
117
+ export const navigationContract = {
118
+ href: optionalText,
119
+ target: property<LinkTarget>()({ kind: 'string', values: ['_self', '_blank'], default: '_self' }),
120
+ rel: optionalText,
121
+ navigate: property<LinkNavigate>()({ kind: 'function', default: undefined, runtimeOnly: true }),
122
+ }
123
+
116
124
  export const buttonContract = {
125
+ ...navigationContract,
117
126
  motionSurface: property<MotionSurface>()({
118
127
  kind: 'object',
119
128
  default: undefined,
@@ -245,6 +254,7 @@ export interface InputEvents {
245
254
  }
246
255
  export interface ButtonEvents {
247
256
  activate(): void
257
+ error(error: unknown): void
248
258
  }
249
259
  export type TextInputHandle = InputHandle
250
260
 
@@ -257,7 +267,7 @@ export const componentContracts = {
257
267
  version: 1,
258
268
  props: buttonContract,
259
269
  slots: ['text', 'leading-decoration', 'trailing-decoration'],
260
- events: { activate: 'none' },
270
+ events: { activate: 'none', error: 'unknown' },
261
271
  },
262
272
  MInput: {
263
273
  version: 1,
@@ -0,0 +1,115 @@
1
+ import type {
2
+ MotionPlayback,
3
+ MotionFrames,
4
+ MotionOptions,
5
+ MotionSurface,
6
+ MotionSurfaceAdapter,
7
+ MotionValues,
8
+ MotionBinding,
9
+ } from './experimental.js'
10
+
11
+ /** Controls share the engine clock. resume() continues; it never restarts playback. */
12
+ export interface MotionControlledPlayback extends MotionPlayback {
13
+ readonly paused: boolean
14
+ readonly duration: number
15
+ progress: number
16
+ pause(): void
17
+ resume(): void
18
+ }
19
+ export interface MotionTimeline extends MotionPlayback {
20
+ readonly paused: boolean
21
+ readonly duration: number | undefined
22
+ pause(): void
23
+ resume(): void
24
+ }
25
+ export interface MotionValueOptions extends MotionOptions {
26
+ layer?: string
27
+ }
28
+ export interface MotionDecayOptions {
29
+ friction?: number
30
+ snap?: readonly number[] | { x?: readonly number[]; y?: readonly number[] }
31
+ }
32
+ export type MotionPosition = number | '<' | `${'+' | '-'}${number}`
33
+ export type MotionStep<T = MotionSurface> =
34
+ readonly [T, MotionFrames, (MotionOptions & { at?: MotionPosition })?] | (() => MotionPlayback)
35
+ export type MotionTimelineStep<T = MotionSurface> =
36
+ | readonly [T, MotionFrames, (MotionOptions & { at?: MotionPosition })?]
37
+ | (() => MotionControlledPlayback)
38
+ | { at?: MotionPosition; run: () => MotionControlledPlayback }
39
+ export type MotionStateDefinitions<K extends string = string> = Record<
40
+ string,
41
+ Partial<Record<K, MotionValues>>
42
+ >
43
+ export type MotionStateTransition = MotionOptions & { targets?: Record<string, MotionOptions> }
44
+ export interface MotionStates<S extends string = string> extends MotionBinding {
45
+ readonly current: S | undefined
46
+ readonly settled: S | undefined
47
+ readonly paused: boolean
48
+ to(state: S, transition?: MotionStateTransition): MotionPlayback
49
+ pause(): void
50
+ resume(): void
51
+ stop(): void
52
+ }
53
+ export interface MotionStatesAdapter {
54
+ readonly current: string | undefined
55
+ readonly settled: string | undefined
56
+ readonly paused: boolean
57
+ to(state: string, transition?: MotionStateTransition): MotionPlayback
58
+ attach(name: string, surface: MotionSurfaceAdapter | null): void
59
+ pause(): void
60
+ play(): void
61
+ stop(): void
62
+ dispose(): void
63
+ }
64
+
65
+ const originals = new WeakMap<MotionPlayback, MotionPlayback>()
66
+ /** Renderer bridge. Returning the actual handle preserves Jolt's clock and arrival metadata. */
67
+ export function motionPlaybackAdapter(handle: MotionPlayback): MotionPlayback {
68
+ const raw = originals.get(handle)
69
+ if (!raw) throw new TypeError('Use playback returned by a Mavis motion surface or region.')
70
+ return raw
71
+ }
72
+ export function controlledMotionPlayback(
73
+ raw: MotionPlayback,
74
+ live: () => boolean,
75
+ ): MotionControlledPlayback {
76
+ const control = raw as MotionPlayback & {
77
+ pause(): void
78
+ play(): void
79
+ paused: boolean
80
+ duration: number
81
+ progress: number
82
+ }
83
+ const assert = () => {
84
+ if (!live()) throw new Error('This motion presentation is disposed.')
85
+ }
86
+ const result: MotionControlledPlayback = {
87
+ finished: raw.finished,
88
+ stop() {
89
+ if (live()) raw.stop()
90
+ },
91
+ pause() {
92
+ assert()
93
+ control.pause()
94
+ },
95
+ resume() {
96
+ assert()
97
+ control.play()
98
+ },
99
+ get paused() {
100
+ return control.paused
101
+ },
102
+ get duration() {
103
+ return control.duration
104
+ },
105
+ get progress() {
106
+ return control.progress
107
+ },
108
+ set progress(value) {
109
+ assert()
110
+ control.progress = value
111
+ },
112
+ }
113
+ originals.set(result, raw)
114
+ return result
115
+ }
@@ -1,3 +1,15 @@
1
+ import {
2
+ controlledMotionPlayback,
3
+ motionPlaybackAdapter,
4
+ type MotionStep,
5
+ type MotionTimelineStep,
6
+ type MotionTimeline,
7
+ type MotionStateDefinitions,
8
+ type MotionStates,
9
+ type MotionStateTransition,
10
+ type MotionStatesAdapter,
11
+ } from './experimental-playback.js'
12
+ import type { MotionPlayback } from './experimental.js'
1
13
  import {
2
14
  motionSurfaceAdapter,
3
15
  motionScrollAdapter,
@@ -122,12 +134,26 @@ type Available = {
122
134
  onAvailable(setup: () => void | (() => void)): () => void
123
135
  }
124
136
  export interface MotionRegion extends Available {
137
+ sequence(steps: readonly MotionStep[]): MotionPlayback
138
+ timeline(steps: readonly MotionTimelineStep[]): MotionTimeline
139
+ states<const S extends MotionStateDefinitions>(
140
+ targets: Record<string, MotionSurface>,
141
+ definitions: S,
142
+ options?: { transition?: MotionStateTransition },
143
+ ): MotionStates<Extract<keyof S, string>>
125
144
  viewportEnter(surfaces: readonly MotionSurface[], options?: MotionViewportOptions): MotionViewport
126
145
  sharedLayout(options?: MotionSharedOptions): MotionSharedLayout
127
146
  diagnostics(options: MotionDiagnosticsOptions): MotionDiagnostics
128
147
  }
129
148
  export interface MotionRegionAdapter {
130
149
  readonly kind: 'web' | 'native'
150
+ sequence?(steps: readonly MotionStep<MotionSurfaceAdapter>[]): MotionPlayback
151
+ timeline?(steps: readonly MotionTimelineStep<MotionSurfaceAdapter>[]): MotionPlayback
152
+ states?(
153
+ targets: Record<string, MotionSurfaceAdapter | null>,
154
+ definitions: MotionStateDefinitions,
155
+ options?: { transition?: MotionStateTransition },
156
+ ): MotionStatesAdapter
131
157
  viewportEnter(
132
158
  surfaces: readonly MotionSurfaceAdapter[],
133
159
  options: Omit<MotionViewportOptions, 'root'> & {
@@ -267,6 +293,69 @@ function diagnosticsHandle(
267
293
  return handle
268
294
  }
269
295
 
296
+ /** Translate targets and factories only; all timing belongs to Jolt. */
297
+ function group(
298
+ region: MotionRegion,
299
+ steps: readonly (MotionStep | MotionTimelineStep)[],
300
+ controlled: boolean,
301
+ ) {
302
+ const state = regionState(region)
303
+ const surfaces = new Set<MotionSurface>()
304
+ const factory = (run: () => MotionPlayback) => () => {
305
+ if (!state.valid) throw new Error('This motion region is disposed.')
306
+ return motionPlaybackAdapter(run())
307
+ }
308
+ const mapped = steps.map((step) => {
309
+ if (typeof step === 'function') return factory(step)
310
+ if ('run' in step) return { ...step, run: factory(step.run) }
311
+ const [surface, frames, options] = step
312
+ surfaces.add(surface)
313
+ return [motionSurfaceAdapter(surface), frames, options] as const
314
+ })
315
+ const create = controlled ? state.adapter.timeline : state.adapter.sequence
316
+ if (!create) throw new Error('Motion orchestration is unavailable.')
317
+ const raw = controlled
318
+ ? state.adapter.timeline!(mapped as readonly MotionTimelineStep<MotionSurfaceAdapter>[])
319
+ : state.adapter.sequence!(mapped as readonly MotionStep<MotionSurfaceAdapter>[])
320
+ const releases: (() => void)[] = []
321
+ let ended = false
322
+ const dispose = () => {
323
+ if (ended) return
324
+ ended = true
325
+ raw.stop()
326
+ for (const release of releases) release()
327
+ state.resources.delete(resource)
328
+ }
329
+ const resource = { dispose }
330
+ state.resources.add(resource)
331
+ try {
332
+ for (const surface of surfaces)
333
+ releases.push(
334
+ surface.onAvailable(() => () => {
335
+ if (!ended) raw.stop()
336
+ }),
337
+ )
338
+ } catch (error) {
339
+ dispose()
340
+ throw error
341
+ }
342
+ const forget = () => {
343
+ ended = true
344
+ for (const release of releases) release()
345
+ state.resources.delete(resource)
346
+ }
347
+ void raw.finished.then(forget, forget)
348
+ const playback = controlledMotionPlayback(raw, () => state.valid)
349
+ return controlled
350
+ ? playback
351
+ : {
352
+ finished: raw.finished,
353
+ stop: () => {
354
+ if (state.valid) raw.stop()
355
+ },
356
+ }
357
+ }
358
+
270
359
  export function createMotionRegion(): MotionRegion {
271
360
  const entry: { state?: RegionState; setups: Set<() => () => void> } = { setups: new Set() }
272
361
  const region: MotionRegion = {
@@ -319,6 +408,68 @@ export function createMotionRegion(): MotionRegion {
319
408
  cleanup?.()
320
409
  }
321
410
  },
411
+ sequence: (steps) => group(region, steps, false),
412
+ timeline: (steps) => group(region, steps, true) as MotionTimeline,
413
+ states(targets, definitions, options) {
414
+ const state = regionState(region)
415
+ if (!state.adapter.states) throw new Error('Named motion states are unavailable.')
416
+ const entries = Object.entries(targets)
417
+ if (
418
+ !entries.length ||
419
+ entries.length > 64 ||
420
+ new Set(entries.map(([, surface]) => surface)).size !== entries.length
421
+ )
422
+ throw new TypeError('Use 1–64 distinct named surfaces.')
423
+ const raw = state.adapter.states(
424
+ Object.fromEntries(
425
+ entries.map(([name, surface]) => [
426
+ name,
427
+ surface.available ? motionSurfaceAdapter(surface) : null,
428
+ ]),
429
+ ),
430
+ definitions,
431
+ options,
432
+ )
433
+ const releases: (() => void)[] = []
434
+ let disposed = false
435
+ try {
436
+ for (const [name, surface] of entries)
437
+ releases.push(
438
+ surface.onAvailable(() => {
439
+ if (disposed) return
440
+ raw.attach(name, motionSurfaceAdapter(surface))
441
+ return () => {
442
+ if (!disposed) raw.attach(name, null)
443
+ }
444
+ }),
445
+ )
446
+ } catch (error) {
447
+ disposed = true
448
+ for (const release of releases) release()
449
+ raw.dispose()
450
+ throw error
451
+ }
452
+ return owned(state, {
453
+ get current() {
454
+ return raw.current
455
+ },
456
+ get settled() {
457
+ return raw.settled
458
+ },
459
+ get paused() {
460
+ return raw.paused
461
+ },
462
+ to: (name: string, transition?: MotionStateTransition) => raw.to(name, transition),
463
+ pause: () => raw.pause(),
464
+ resume: () => raw.play(),
465
+ stop: () => raw.stop(),
466
+ dispose() {
467
+ disposed = true
468
+ for (const release of releases) release()
469
+ raw.dispose()
470
+ },
471
+ }) as MotionStates<Extract<keyof typeof definitions, string>>
472
+ },
322
473
  viewportEnter(surfaces, options = {}) {
323
474
  const state = regionState(region)
324
475
  if (!surfaces.length || surfaces.length > 64 || new Set(surfaces).size !== surfaces.length)