@ultrst-armada/frnlts 0.0.0-stage → 0.2.2
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 +101 -2
- package/dist/chunk-FGHXAN4Q.js +1125 -0
- package/dist/chunk-LG2AFOLX.js +239 -0
- package/dist/events-C5ocSAHh.d.ts +687 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +134 -0
- package/dist/react/index.d.ts +24 -0
- package/dist/react/index.js +97 -0
- package/dist/runtime/index.d.ts +272 -0
- package/dist/runtime/index.js +134 -0
- package/package.json +70 -4
package/README.md
CHANGED
|
@@ -1,3 +1,102 @@
|
|
|
1
|
-
#
|
|
1
|
+
# FrnlTS (@dinilmusick/frnlts)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> A semantic frontend runtime for ordinary React components.
|
|
4
|
+
|
|
5
|
+
FrnlTS does not wrap React components in semantic classes, renderer classes, or adapter component hierarchies. The React component is the component. FrnlTS attaches state, state-resolved events, visual definitions, themes, flows, and runtime lifecycle machinery to that component.
|
|
6
|
+
|
|
7
|
+
## Architectural role
|
|
8
|
+
|
|
9
|
+
FrnlTS supplies frontend semantics and runtime machinery. Floks supplies concrete React UI components. Applications compose those ordinary React components.
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
React component
|
|
13
|
+
│
|
|
14
|
+
├── normal React props/rendering
|
|
15
|
+
├── useFrnlComponent()
|
|
16
|
+
│ ├── Frnl state
|
|
17
|
+
│ ├── state-resolved events
|
|
18
|
+
│ ├── visual parameters
|
|
19
|
+
│ └── component scope
|
|
20
|
+
└── normal React composition
|
|
21
|
+
│
|
|
22
|
+
▼
|
|
23
|
+
Zustand-backed runtime
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
There is one component model. A component may render children, participate in flows, or be nested in another component without acquiring a second runtime class.
|
|
27
|
+
|
|
28
|
+
## Core semantic model
|
|
29
|
+
|
|
30
|
+
- **React components** are the concrete UI entities.
|
|
31
|
+
- **States** own state-local events, visual parameters, and Attack/Sustain/Release definitions.
|
|
32
|
+
- **Events** resolve against the component's current state before invoking the registered handler.
|
|
33
|
+
- **Flows** coordinate events, state changes, slot changes, data, and external functions.
|
|
34
|
+
- **Themes** provide optional visual parameter overrides for named components and states.
|
|
35
|
+
- **Libraries** provide centrally addressable component/application functions and data.
|
|
36
|
+
|
|
37
|
+
## Direct React integration
|
|
38
|
+
|
|
39
|
+
Use `useFrnlComponent()` inside the actual React component:
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
const frnl = useFrnlComponent({
|
|
43
|
+
id,
|
|
44
|
+
definition,
|
|
45
|
+
store,
|
|
46
|
+
state: 'idle',
|
|
47
|
+
handlers,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
return <button onClick={() => frnl.events.click()}>{children}</button>;
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
The hook registers the component with the Frnl runtime and cleans it up when the React component unmounts. No Frnl wrapper object or rendering class is required.
|
|
54
|
+
|
|
55
|
+
## Event resolution
|
|
56
|
+
|
|
57
|
+
Every input path should converge on the same semantic event:
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
React input / keyboard / application code / another component
|
|
61
|
+
↓
|
|
62
|
+
component event
|
|
63
|
+
↓
|
|
64
|
+
current state
|
|
65
|
+
↓
|
|
66
|
+
state.events[event]
|
|
67
|
+
↓
|
|
68
|
+
functionId
|
|
69
|
+
↓
|
|
70
|
+
handler
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The input source does not directly own the handler implementation.
|
|
74
|
+
|
|
75
|
+
## Slots
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## Themes
|
|
79
|
+
|
|
80
|
+
Theme values are resolved in this order:
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
State visual parameters
|
|
84
|
+
↓
|
|
85
|
+
Theme visual parameters
|
|
86
|
+
↓
|
|
87
|
+
Surgical instance overrides
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Applying a theme and changing state clear surgical overrides while preserving the selected theme.
|
|
91
|
+
|
|
92
|
+
## Runtime validation
|
|
93
|
+
|
|
94
|
+
External semantic inputs and runtime mutations cross Zod validation boundaries before entering the Zustand runtime.
|
|
95
|
+
|
|
96
|
+
## Package exports
|
|
97
|
+
|
|
98
|
+
- `@dinilmusick/frnlts` — semantic runtime and component contracts.
|
|
99
|
+
- `@dinilmusick/frnlts/runtime` — headless runtime.
|
|
100
|
+
- `@dinilmusick/frnlts/react` — `useFrnlComponent` and direct React integration.
|
|
101
|
+
|
|
102
|
+
Concrete UI remains ordinary React code.
|