exodeui-vanilla 0.0.0-stage → 1.0.0

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 CHANGED
@@ -1,3 +1,199 @@
1
- # Temporary Holding Version
1
+ # ExodeUI Vanilla
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ **Framework-free JavaScript runtime for the [ExodeUI](https://exodeui.com/?utm_source=npm&utm_medium=readme&utm_campaign=exodeui-vanilla) motion engine.** Render interactive, physics-driven UI animations exported from the ExodeUI Motion Development Environment on any web page — no React, Vue, Svelte or Angular required.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/exodeui-vanilla.svg)](https://www.npmjs.com/package/exodeui-vanilla)
6
+ [![license](https://img.shields.io/npm/l/exodeui-vanilla.svg)](https://www.npmjs.com/package/exodeui-vanilla)
7
+ [![website](https://img.shields.io/badge/docs-exodeui.com-0f172a)](https://exodeui.com/docs?utm_source=npm&utm_medium=readme&utm_campaign=exodeui-vanilla)
8
+
9
+ ExodeUI is an AI-native **motion design environment (MDE)** for building animated interfaces, micro-interactions, prototypes and interactive data visualisations on a single canvas, then shipping them as data. This package is the dependency-free player for that data: a Canvas 2D renderer with a state machine, 2D physics, gesture handling and chart support built in.
10
+
11
+ ---
12
+
13
+ ## Why ExodeUI Vanilla
14
+
15
+ - **Zero framework lock-in.** Drop one class into any page, CMS, Webflow/WordPress build, Electron shell, Chrome extension or game HUD.
16
+ - **Design once, run everywhere.** The same `.exode` artboard runs here and in the [React](https://www.npmjs.com/package/exodeui), [Vue](https://www.npmjs.com/package/exodeui-vue), [Svelte](https://www.npmjs.com/package/exodeui-svelte), [Solid](https://www.npmjs.com/package/exodeui-solid) and [Angular](https://www.npmjs.com/package/exodeui-angular) runtimes, with identical behaviour.
17
+ - **Interactive by default.** Pointer, touch, wheel, keyboard and gamepad sensors are wired in.
18
+ - **Real state machines.** Boolean, number, text, trigger, array and random inputs drive transitions declaratively.
19
+ - **Physics you can feel.** Rapier-backed 2D rigid bodies, joints, gravity, wind and material properties.
20
+ - **Tiny integration surface.** `new ExodeUICanvas({ element, artboard })` and you are running.
21
+
22
+ ## Installation
23
+
24
+ ```bash
25
+ npm install exodeui-vanilla
26
+ # or
27
+ pnpm add exodeui-vanilla
28
+ # or use it straight from a CDN
29
+ ```
30
+
31
+ ```html
32
+ <script type="module">
33
+ import { ExodeUICanvas } from 'https://esm.sh/exodeui-vanilla';
34
+ </script>
35
+ ```
36
+
37
+ ## Quick start
38
+
39
+ ```html
40
+ <canvas id="hero" style="width: 800px; height: 600px;"></canvas>
41
+
42
+ <script type="module">
43
+ import { ExodeUICanvas } from 'exodeui-vanilla';
44
+
45
+ const player = new ExodeUICanvas({
46
+ element: '#hero',
47
+ fit: 'Contain',
48
+ alignment: 'Center',
49
+ onReady: (engine) => engine.setInputBool('isPlaying', true),
50
+ onTrigger: (name, animation) => console.log('trigger', name, animation),
51
+ onNavigation: ({ type, value }) => {
52
+ if (type === 'url') window.location.href = value;
53
+ },
54
+ });
55
+
56
+ // JSON, .exode URL, or a pre-fetched .bexode buffer
57
+ await player.load('/animations/hero.exode');
58
+ player.play();
59
+ </script>
60
+ ```
61
+
62
+ ### Drive it from existing UI
63
+
64
+ ```js
65
+ const player = new ExodeUICanvas({ element: '#menu' });
66
+
67
+ document.querySelector('#open-menu').addEventListener('click', () => {
68
+ player.fireTrigger('OpenMenu');
69
+ player.updateInput('activeTab', 2);
70
+ });
71
+ ```
72
+
73
+ ### Render into your own loop
74
+
75
+ `ExodeUICanvas` owns the RAF loop, but the engine is public when you need full control:
76
+
77
+ ```js
78
+ import { ExodeUIEngine } from 'exodeui-vanilla';
79
+
80
+ const engine = new ExodeUIEngine();
81
+ engine.load(artboardJSON);
82
+ engine.setLayout('Contain', 'Center');
83
+
84
+ const ctx = canvas.getContext('2d');
85
+ let last = 0;
86
+ requestAnimationFrame(function loop(t) {
87
+ const dt = Math.min((t - last) / 1000, 0.05);
88
+ last = t;
89
+ engine.advance(dt);
90
+ engine.render(ctx, canvas.width, canvas.height);
91
+ requestAnimationFrame(loop);
92
+ });
93
+ ```
94
+
95
+ ## Supported features
96
+
97
+ | Capability | Included |
98
+ | --- | --- |
99
+ | Canvas 2D renderer with DPR-aware scaling | ✅ |
100
+ | State machine + logic nodes (AND / OR / XOR / NOT) | ✅ |
101
+ | Boolean, number, text, trigger, array, random inputs | ✅ |
102
+ | 2D physics (Rapier): dynamic, static, kinematic bodies | ✅ |
103
+ | Spring, drag, joystick, pointer and keyboard sensors | ✅ |
104
+ | Responsive layouts, breakpoints and spatial constraints | ✅ |
105
+ | Line graphs, bar charts and pie charts with live data | ✅ |
106
+ | Text inputs, toggles, dropdowns, sliders and list views | ✅ |
107
+ | Scroll-linked and viewport-driven animation | ✅ |
108
+ | `.exode` JSON and compressed `.bexode` loading | ✅ |
109
+ | Inner/outer glow, light trails, pattern grids, masks | ✅ |
110
+ | Custom effect scripts with `update(env, dt)` hooks | ✅ |
111
+
112
+ ## API
113
+
114
+ ### `new ExodeUICanvas(options)`
115
+
116
+ | Option | Type | Default | Description |
117
+ | --- | --- | --- | --- |
118
+ | `element` | `string \| HTMLCanvasElement` | required | Selector or canvas element |
119
+ | `artboard` | `Artboard` | — | Already parsed artboard JSON |
120
+ | `src` | `string` | — | `.exode` / `.bexode` URL or JSON string |
121
+ | `buffer` | `ArrayBuffer \| Uint8Array` | — | Pre-read `.bexode` buffer |
122
+ | `revision` | `number` | `0` | Bump to force a reload |
123
+ | `fit` | `Fit` | `'Contain'` | Layout fit mode |
124
+ | `alignment` | `Alignment` | `'Center'` | Layout alignment |
125
+ | `layoutScaleFactor` | `number` | — | Extra scale for `Fit: 'Layout'` |
126
+ | `autoPlay` | `boolean` | `true` | Auto-start the loop |
127
+ | `interactive` | `boolean` | `true` | Enable pointer/keyboard input |
128
+ | `preventScroll` | `boolean` | `true` | Block page scroll on wheel/touch |
129
+ | `highRefreshRate` | `boolean` | `true` | Pump sub-frames on 120Hz displays |
130
+ | `scrollX/Y`, `viewportScrollX/Y` | `number` | — | External scroll sensors |
131
+ | `mouseX/Y`, `isMouseDown` | `number \| boolean` | — | External pointer sensors |
132
+ | `inputs` | `Record<string, any>` | — | Inputs applied on load |
133
+ | `callbacks` | `Record<string, Function>` | — | Named listeners from the editor |
134
+ | `onReady` | `(engine) => void` | — | Artboard loaded |
135
+ | `onTrigger` | `(name, anim) => void` | — | Trigger fired |
136
+ | `onInputUpdate` | `(id, value) => void` | — | Input changed |
137
+ | `onComponentChange` | `(event) => void` | — | Component event |
138
+ | `onToggle` / `onInputChange` | `(id, value) => void` | — | Toggle / text input |
139
+ | `onInputFocus` / `onInputBlur` | `(id) => void` | — | Field focus |
140
+ | `onButtonClick` | `(name, objectId) => void` | — | Button pressed |
141
+ | `onGraphPointClick` | `(graphId, point) => void` | — | Chart point clicked |
142
+ | `onLogicUpdate` | `(state) => void` | — | Logic values changed |
143
+ | `onFPSUpdate` | `(fps) => void` | — | ~every 400ms |
144
+ | `onLog` | `(message) => void` | — | Engine logs and errors |
145
+ | `onNavigation` | `({ type, value }) => void` | — | Navigation action |
146
+
147
+ ### Methods
148
+
149
+ | Method | Description |
150
+ | --- | --- |
151
+ | `load(data)` | Load JSON, a URL, or a `.bexode` buffer |
152
+ | `setOptions(options)` | Update any runtime option |
153
+ | `play()` / `pause()` | Control the animation loop |
154
+ | `seek(time)` | Jump to a time in seconds |
155
+ | `resize()` | Re-measure the canvas and redraw |
156
+ | `setLayout(fit, alignment?, scale?)` | Change layout at runtime |
157
+ | `setInputBool / setInputNumber / setInputText` | Set scalar inputs |
158
+ | `setInputNumberArray / setInputStringArray` | Set array inputs |
159
+ | `updateInput(nameOrId, value)` | Set any input by name or id |
160
+ | `fireTrigger(name)` | Fire a trigger input |
161
+ | `updateObjectOptions(id, opts)` | Replace dropdown / list options |
162
+ | `updateGraphData / updateBarChartData / updatePieChartData` | Live chart data |
163
+ | `updateConstraint(id, index, props)` | Change a spatial constraint |
164
+ | `handleScroll(x, y)` / `setViewportScroll(x, y)` | Feed scroll offset |
165
+ | `getInputValue(nameOrId)` | Read a resolved input |
166
+ | `getArtboard()` | The loaded artboard |
167
+ | `destroy()` | Remove every listener |
168
+
169
+ ## FAQ
170
+
171
+ **What is ExodeUI?** An AI-native motion development environment for designing, animating and shipping interactive vector interfaces, plus the runtimes that play the exported artboards. Start at [exodeui.com](https://exodeui.com/?utm_source=npm&utm_medium=readme&utm_campaign=exodeui-vanilla).
172
+
173
+ **Is ExodeUI a Lottie or Rive alternative?** It overlaps with both but targets interactive UI: state machines, physics and real component behaviour rather than linear playback. See the [Rive comparison](https://exodeui.com/alternatives/rive/?utm_source=npm&utm_medium=readme&utm_campaign=exodeui-vanilla).
174
+
175
+ **Does it need a build step?** No. Load the ESM/CJS bundle or the IIFE build (`dist/index.iife.js`) and go.
176
+
177
+ **Can it run offline?** Yes. No network access is required after the artboard is loaded, and `.bexode` files can be bundled with your app.
178
+
179
+ **How big is it?** The engine bundles the renderer, physics and chart code into one file; the gzipped ESM build is roughly 750 kB.
180
+
181
+ ## Related packages
182
+
183
+ - [exodeui](https://www.npmjs.com/package/exodeui) — React runtime and Vite plugin
184
+ - [exodeui-vue](https://www.npmjs.com/package/exodeui-vue) — Vue 3 runtime
185
+ - [exodeui-svelte](https://www.npmjs.com/package/exodeui-svelte) — Svelte 5 runtime
186
+ - [exodeui-solid](https://www.npmjs.com/package/exodeui-solid) — SolidJS runtime
187
+ - [exodeui-angular](https://www.npmjs.com/package/exodeui-angular) — Angular 17+ runtime
188
+
189
+ ## Learn more
190
+
191
+ - [Documentation](https://exodeui.com/docs?utm_source=npm&utm_medium=readme&utm_campaign=exodeui-vanilla)
192
+ - [Examples and templates](https://exodeui.com/examples?utm_source=npm&utm_medium=readme&utm_campaign=exodeui-vanilla)
193
+ - [Component gallery](https://exodeui.com/components?utm_source=npm&utm_medium=readme&utm_campaign=exodeui-vanilla)
194
+ - [Motion UI use cases](https://exodeui.com/motion-ui?utm_source=npm&utm_medium=readme&utm_campaign=exodeui-vanilla)
195
+ - [Glossary of motion terms](https://exodeui.com/glossary?utm_source=npm&utm_medium=readme&utm_campaign=exodeui-vanilla)
196
+
197
+ ## License
198
+
199
+ MIT © ExodeUI