exodeui-svelte 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,172 @@
1
- # Temporary Holding Version
1
+ # ExodeUI Svelte
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
+ **Svelte 5 runtime for the [ExodeUI](https://exodeui.com/?utm_source=npm&utm_medium=readme&utm_campaign=exodeui-svelte) motion engine.** Drop interactive, physics-driven animation designed in the ExodeUI motion design environment into any Svelte app — with runes-friendly props, callbacks and a store-style helper.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/exodeui-svelte.svg)](https://www.npmjs.com/package/exodeui-svelte)
6
+ [![license](https://img.shields.io/npm/l/exodeui-svelte.svg)](https://www.npmjs.com/package/exodeui-svelte)
7
+ [![website](https://img.shields.io/badge/docs-exodeui.com-0f172a)](https://exodeui.com/docs?utm_source=npm&utm_medium=readme&utm_campaign=exodeui-svelte)
8
+
9
+ ExodeUI is an AI-native **motion development environment (MDE)** for interactive vector UI: one canvas for design, a timeline for motion, Rapier physics for feel, and a state machine for logic. Artboards export as portable `.exode` data and play here through the same Canvas 2D engine used by every other ExodeUI runtime.
10
+
11
+ ---
12
+
13
+ ## Highlights
14
+
15
+ - **Runes-native component.** `<ExodeUICanvas>` uses `$props`, `$state` and `$effect`, so reactive updates go straight into the engine with no extra plumbing.
16
+ - **Interactive, not linear.** Triggers, toggles, drag, hover states, joysticks, keyboard and gamepad bindings all work out of the box.
17
+ - **Virtual D-pads included.** Joysticks configured for keyboard input render on-canvas touch pads automatically for mobile.
18
+ - **Consistent across frameworks.** Behaviour matches the [React](https://www.npmjs.com/package/exodeui), [Vue](https://www.npmjs.com/package/exodeui-vue), [Solid](https://www.npmjs.com/package/exodeui-solid), [Angular](https://www.npmjs.com/package/exodeui-angular) and [vanilla](https://www.npmjs.com/package/exodeui-vanilla) runtimes.
19
+ - **Clean teardown.** Loops, observers and global listeners are removed on destroy.
20
+
21
+ ## Installation
22
+
23
+ ```bash
24
+ npm install exodeui-svelte
25
+ # or
26
+ pnpm add exodeui-svelte
27
+ # or
28
+ yarn add exodeui-svelte
29
+ ```
30
+
31
+ Requires Svelte `>= 4` (Svelte 5 recommended).
32
+
33
+ ## Quick start
34
+
35
+ ```svelte
36
+ <script lang="ts">
37
+ import { ExodeUICanvas, createExodeUI } from 'exodeui-svelte';
38
+ import artboard from './hero.exode?raw';
39
+
40
+ const exo = createExodeUI();
41
+
42
+ function onReady(engine: any) {
43
+ exo.setEngine(engine);
44
+ exo.setInputBool('isPlaying', true);
45
+ }
46
+ </script>
47
+
48
+ <div style="width: 800px; height: 600px">
49
+ <ExodeUICanvas
50
+ artboard={JSON.parse(artboard)}
51
+ fit="Contain"
52
+ alignment="Center"
53
+ onready={onReady}
54
+ ontrigger={(name, anim) => console.log('trigger', name, anim)}
55
+ onnavigation={({ type, value }) => {
56
+ if (type === 'url') window.location.href = value;
57
+ }}
58
+ />
59
+ </div>
60
+ ```
61
+
62
+ ### Control it from your own markup
63
+
64
+ ```svelte
65
+ <script lang="ts">
66
+ import { ExodeUICanvas } from 'exodeui-svelte';
67
+
68
+ let canvas: any;
69
+ let activeTab = 0;
70
+
71
+ function selectTab(index: number) {
72
+ activeTab = index;
73
+ canvas.getEngine()?.updateInput('activeTab', index);
74
+ canvas.fireTrigger('TabChange');
75
+ }
76
+ </script>
77
+
78
+ <ExodeUICanvas bind:this={canvas} src="/animations/tabs.exode" />
79
+ <button onclick={() => selectTab(0)}>Overview</button>
80
+ <button onclick={() => selectTab(1)}>Motion</button>
81
+ <button onclick={() => selectTab(2)}>Physics</button>
82
+ ```
83
+
84
+ ### Scrubbing a fixed frame
85
+
86
+ ```svelte
87
+ <ExodeUICanvas {artboard} autoPlay={false} currentTime={1.25} />
88
+ ```
89
+
90
+ ## Supported features
91
+
92
+ | Capability | Included |
93
+ | --- | --- |
94
+ | Canvas 2D renderer with DPR-aware scaling | ✅ |
95
+ | State machine + logic nodes (AND / OR / XOR / NOT) | ✅ |
96
+ | Boolean, number, text, trigger, array, random inputs | ✅ |
97
+ | 2D physics (Rapier): dynamic, static, kinematic bodies | ✅ |
98
+ | Spring, drag, joystick, pointer and keyboard sensors | ✅ |
99
+ | Responsive layouts, breakpoints and spatial constraints | ✅ |
100
+ | Line graphs, bar charts and pie charts with live data | ✅ |
101
+ | Text inputs, toggles, dropdowns, sliders and list views | ✅ |
102
+ | Scroll-linked and viewport-driven animation | ✅ |
103
+ | `.exode` JSON and compressed `.bexode` loading | ✅ |
104
+ | Glow, light trails, pattern grids, masks | ✅ |
105
+ | Custom effect scripts with `update(env, dt)` hooks | ✅ |
106
+
107
+ ## API
108
+
109
+ ### `<ExodeUICanvas>` props
110
+
111
+ | Prop | Type | Default | Description |
112
+ | --- | --- | --- | --- |
113
+ | `artboard` | `Artboard` | — | Parsed artboard JSON |
114
+ | `src` | `string` | — | `.exode` / `.bexode` URL or JSON string |
115
+ | `buffer` | `ArrayBuffer \| Uint8Array` | — | Pre-read `.bexode` buffer |
116
+ | `revision` | `number` | `0` | Bump to force a reload |
117
+ | `fit` | `Fit` | `'Contain'` | Fit mode |
118
+ | `alignment` | `Alignment` | `'Center'` | Alignment |
119
+ | `layoutScaleFactor` | `number` | — | Extra scale for `Fit: 'Layout'` |
120
+ | `autoPlay` | `boolean` | `true` | Auto-start the loop |
121
+ | `interactive` | `boolean` | `true` | Enable input handling |
122
+ | `preventScroll` | `boolean` | `true` | Block page scroll on wheel/touch |
123
+ | `highRefreshRate` | `boolean` | `true` | Sub-frame pacing on 120Hz displays |
124
+ | `currentTime` | `number` | — | Render a fixed time when `autoPlay` is false |
125
+ | `scrollX/Y`, `viewportScrollX/Y` | `number` | — | External scroll sensors |
126
+ | `mouseX/Y`, `isMouseDown` | `number \| boolean` | — | External pointer sensors |
127
+ | `inputs` | `Record<string, any>` | — | Inputs applied on load |
128
+ | `callbacks` | `Record<string, Function>` | — | Named listeners from the editor |
129
+
130
+ ### Callback props
131
+
132
+ `onready`, `ontrigger`, `oninputupdate`, `oncomponentchange`, `ontoggle`, `oninputchange`, `oninputfocus`, `oninputblur`, `onbuttonclick`, `onnavigation`, `ongraphpointclick`, `onlog`, `onlogicupdate`, `onfpsupdate`
133
+
134
+ ### Exported component functions
135
+
136
+ `getEngine()`, `play()`, `pause()`, `seek(time)`, `resize()`, `setOptions(options)`
137
+
138
+ ### `createExodeUI()`
139
+
140
+ Returns a store with `engine`, `setEngine`, `updateInput`, `setInputBool`, `setInputNumber`, `setInputText`, `setInputNumberArray`, `setInputStringArray`, `fireTrigger`, `updateObjectOptions`, `updateConstraint`, `updateGraphData`, `updateBarChartData`, `updatePieChartData`, `setDropdownOptions` and `getInputValue`.
141
+
142
+ ## FAQ
143
+
144
+ **Does it work in SvelteKit with SSR?** Yes — the canvas is created on mount, so nothing touches the DOM during server rendering.
145
+
146
+ **Can I import `.exode` files directly?** Yes, with `?raw` (or the Exode Vite plugin in the React package) — or fetch the file from `src`.
147
+
148
+ **Is ExodeUI a Rive or Lottie alternative?** It is built for interactive UI rather than linear playback. See the [comparison](https://exodeui.com/alternatives/rive/?utm_source=npm&utm_medium=readme&utm_campaign=exodeui-svelte).
149
+
150
+ **Will it hurt my Lighthouse score?** The engine renders to a canvas and only redraws while the loop is running; use `autoPlay={false}` with `currentTime` for static hero artboards.
151
+
152
+ **What is the ExodeUI MDE?** A single-surface motion development environment where design, animation and logic converge. Learn more in the [motion development environment guide](https://exodeui.com/mde?utm_source=npm&utm_medium=readme&utm_campaign=exodeui-svelte).
153
+
154
+ ## Related packages
155
+
156
+ - [exodeui](https://www.npmjs.com/package/exodeui) — React runtime and Vite plugin
157
+ - [exodeui-vanilla](https://www.npmjs.com/package/exodeui-vanilla) — framework-free runtime
158
+ - [exodeui-vue](https://www.npmjs.com/package/exodeui-vue) — Vue 3 runtime
159
+ - [exodeui-solid](https://www.npmjs.com/package/exodeui-solid) — SolidJS runtime
160
+ - [exodeui-angular](https://www.npmjs.com/package/exodeui-angular) — Angular 17+ runtime
161
+
162
+ ## Learn more
163
+
164
+ - [Documentation](https://exodeui.com/docs?utm_source=npm&utm_medium=readme&utm_campaign=exodeui-svelte)
165
+ - [Examples and templates](https://exodeui.com/examples?utm_source=npm&utm_medium=readme&utm_campaign=exodeui-svelte)
166
+ - [Component gallery](https://exodeui.com/components?utm_source=npm&utm_medium=readme&utm_campaign=exodeui-svelte)
167
+ - [Motion UI use cases](https://exodeui.com/motion-ui?utm_source=npm&utm_medium=readme&utm_campaign=exodeui-svelte)
168
+ - [Academy](https://exodeui.com/academy?utm_source=npm&utm_medium=readme&utm_campaign=exodeui-svelte)
169
+
170
+ ## License
171
+
172
+ MIT © ExodeUI