route-graphics 0.0.30 → 0.0.32
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 +41 -10
- package/dist/RouteGraphics.js +35 -35
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Route Graphics is a declarative UI system that enables developers to create rich
|
|
|
14
14
|
|
|
15
15
|
Route Graphics follows a **render cycle** where:
|
|
16
16
|
|
|
17
|
-
1. **Parser Functions** convert your JSON input into
|
|
17
|
+
1. **Parser Functions** convert your JSON input into Computed Nodes
|
|
18
18
|
2. **Element Functions** handle the lifecycle:
|
|
19
19
|
- **Add Functions**: Create new visual elements when they appear in the state
|
|
20
20
|
- **Update Functions**: Modify existing elements when their properties change
|
|
@@ -90,7 +90,7 @@ Parse elements from state object using registered parser plugins (without render
|
|
|
90
90
|
**Parameters:**
|
|
91
91
|
- `state` (RouteGraphicsState) - State object containing element definitions
|
|
92
92
|
|
|
93
|
-
**Returns:** `RouteGraphicsState` - Parsed state with
|
|
93
|
+
**Returns:** `RouteGraphicsState` - Parsed state with computed elements
|
|
94
94
|
|
|
95
95
|
---
|
|
96
96
|
|
|
@@ -303,7 +303,7 @@ app.render({
|
|
|
303
303
|
|
|
304
304
|
Route Graphics follows a modular plugin architecture with three main plugin categories:
|
|
305
305
|
|
|
306
|
-
1. **Parser Plugins** - Convert JSON to
|
|
306
|
+
1. **Parser Plugins** - Convert JSON to Computed Nodes
|
|
307
307
|
2. **Element Plugins** - Render visual elements (add/update/delete)
|
|
308
308
|
3. **Audio & Animation Plugins** - Handle dynamic content
|
|
309
309
|
|
|
@@ -849,9 +849,9 @@ const customPlugin = createElementPlugin({
|
|
|
849
849
|
displayObject.destroy();
|
|
850
850
|
}
|
|
851
851
|
},
|
|
852
|
-
// Optional: Parse function for JSON to
|
|
852
|
+
// Optional: Parse function for JSON to computed conversion
|
|
853
853
|
parse: (element) => {
|
|
854
|
-
// Parse JSON element to
|
|
854
|
+
// Parse JSON element to computed format
|
|
855
855
|
return {
|
|
856
856
|
...element,
|
|
857
857
|
parsed: true
|
|
@@ -934,7 +934,7 @@ const customAudioPlugin = createAudioPlugin({
|
|
|
934
934
|
|
|
935
935
|
## Parser System
|
|
936
936
|
|
|
937
|
-
The parser system transforms your JSON input into
|
|
937
|
+
The parser system transforms your JSON input into Computed Nodes that the rendering engine can process. Each element plugin includes its own parser function that converts JSON definitions into the internal computed format.
|
|
938
938
|
|
|
939
939
|
### parseElements Function
|
|
940
940
|
|
|
@@ -962,7 +962,7 @@ const parsedElements = parseElements({
|
|
|
962
962
|
- `parserPlugins`: Array of available parser plugins (useful for nested elements like containers)
|
|
963
963
|
|
|
964
964
|
**Returns:**
|
|
965
|
-
-
|
|
965
|
+
- Computed node with processed properties ready for rendering
|
|
966
966
|
|
|
967
967
|
### Parser Function Example
|
|
968
968
|
|
|
@@ -1055,12 +1055,45 @@ src: hero-sprite
|
|
|
1055
1055
|
# Run all tests
|
|
1056
1056
|
bun run test
|
|
1057
1057
|
```
|
|
1058
|
+
|
|
1059
|
+
### Playground (Rettangoli Sites)
|
|
1060
|
+
|
|
1061
|
+
The playground is managed as its own local Sites project in `playground/`.
|
|
1062
|
+
|
|
1063
|
+
```bash
|
|
1064
|
+
# Install playground deps
|
|
1065
|
+
cd playground
|
|
1066
|
+
bun install
|
|
1067
|
+
|
|
1068
|
+
# Start watch/dev server (default port 3001)
|
|
1069
|
+
bun run watch
|
|
1070
|
+
|
|
1071
|
+
# Build static output
|
|
1072
|
+
bun run build
|
|
1073
|
+
```
|
|
1074
|
+
|
|
1075
|
+
Notes:
|
|
1076
|
+
|
|
1077
|
+
- Sites config is YAML-only: `playground/sites.config.yaml`
|
|
1078
|
+
- Playground scripts live in `playground/package.json`
|
|
1079
|
+
- Template source of truth: `playground/data/templates.yaml`
|
|
1080
|
+
- Runtime template catalog: `playground/static/public/playground/templates.yaml`
|
|
1081
|
+
|
|
1058
1082
|
### Code Quality
|
|
1059
1083
|
|
|
1060
1084
|
```bash
|
|
1061
|
-
# Build
|
|
1085
|
+
# Build VT pages
|
|
1062
1086
|
bun run vt:generate
|
|
1063
1087
|
|
|
1088
|
+
# Capture screenshots with Docker
|
|
1089
|
+
bun run vt:screenshot
|
|
1090
|
+
|
|
1091
|
+
# Generate visual diff report
|
|
1092
|
+
bun run vt:report
|
|
1093
|
+
|
|
1094
|
+
# Accept expected diffs
|
|
1095
|
+
bun run vt:accept
|
|
1096
|
+
|
|
1064
1097
|
|
|
1065
1098
|
# Fix linting issues
|
|
1066
1099
|
bun run lint:fix
|
|
@@ -1146,5 +1179,3 @@ Join us on [Discord](https://discord.gg/8J9dyZSu9C) to ask questions, report bug
|
|
|
1146
1179
|
## License
|
|
1147
1180
|
|
|
1148
1181
|
This project is licensed under the [MIT License](LICENSE).
|
|
1149
|
-
|
|
1150
|
-
|