@open-slot-ui/core 0.0.1
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/LICENSE +21 -0
- package/README.md +43 -0
- package/dist/index.cjs +2343 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1813 -0
- package/dist/index.d.ts +1813 -0
- package/dist/index.js +2271 -0
- package/dist/index.js.map +1 -0
- package/package.json +64 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 schmooky and the open-ui contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# @open-slot-ui/core
|
|
2
|
+
|
|
3
|
+
The **headless core** of [open-ui](https://github.com/schmooky/open-ui) — a biased,
|
|
4
|
+
themeable UI library for slot games. This package is the **M + C**: all state, logic,
|
|
5
|
+
layout and theming, with **zero runtime dependencies**. It renders nothing on its own;
|
|
6
|
+
pair it with a view binding such as [`@open-slot-ui/pixi`](https://www.npmjs.com/package/@open-slot-ui/pixi).
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
pnpm add @open-slot-ui/core
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## What's inside
|
|
13
|
+
|
|
14
|
+
- **`Signal`** — a tiny observable value (the reactive primitive everything is built on).
|
|
15
|
+
- **`Control` state-machines** — every button/toggle/value is an FSM; interactability is
|
|
16
|
+
*derived* from state, never a stored boolean.
|
|
17
|
+
- **`OpenUI` façade** — the narrow, typed surface a host talks to (`ui.spin.busy()`,
|
|
18
|
+
`ui.balance.set(…)`, `ui.bus.on(…)`, `ui.setLocale(…)`).
|
|
19
|
+
- **Theme tokens** — semantic design tokens with safe fallbacks (`default`, `midnight`,
|
|
20
|
+
`neon`, `light`). A bad token degrades, never throws.
|
|
21
|
+
- **Layout** — anchor + offset + scale (+ rotation) resolved against a reference
|
|
22
|
+
resolution, with per-device responsive overrides.
|
|
23
|
+
- **`UISpec`** — one typed, string-literal config object validated without ever throwing
|
|
24
|
+
(a bad value is reported and ignored — see the never-reject boundary in the Charter).
|
|
25
|
+
- **Introspection** — `window.__OPENUI__` reports every control's state, interactability
|
|
26
|
+
and bounds, so end-to-end tests never read a pixel.
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
You normally don't construct core directly — a renderer like `@open-slot-ui/pixi` builds it
|
|
31
|
+
from your `UISpec` via `mountHud`. Reach for `@open-slot-ui/core` directly when you're writing
|
|
32
|
+
your **own** renderer (DOM, Canvas, another engine) against the same headless model.
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import { OpenUI, defaultTheme } from '@open-slot-ui/core';
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
See the [main README](https://github.com/schmooky/open-ui#readme) and the
|
|
39
|
+
[Charter](https://github.com/schmooky/open-ui/blob/main/CHARTER.md) for the full doctrine.
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
[MIT](./LICENSE) © schmooky and the open-ui contributors.
|