rotor-framework 0.3.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.
Files changed (39) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +120 -0
  3. package/package.json +59 -0
  4. package/src/source/RotorFramework.bs +654 -0
  5. package/src/source/RotorFrameworkTask.bs +278 -0
  6. package/src/source/base/BaseModel.bs +52 -0
  7. package/src/source/base/BasePlugin.bs +48 -0
  8. package/src/source/base/BaseReducer.bs +184 -0
  9. package/src/source/base/BaseStack.bs +92 -0
  10. package/src/source/base/BaseViewModel.bs +124 -0
  11. package/src/source/base/BaseWidget.bs +104 -0
  12. package/src/source/base/DispatcherCreator.bs +193 -0
  13. package/src/source/base/DispatcherExternal.bs +260 -0
  14. package/src/source/base/ListenerForDispatchers.bs +246 -0
  15. package/src/source/engine/Constants.bs +74 -0
  16. package/src/source/engine/animator/Animator.bs +334 -0
  17. package/src/source/engine/builder/Builder.bs +213 -0
  18. package/src/source/engine/builder/NodePool.bs +236 -0
  19. package/src/source/engine/builder/PluginAdapter.bs +139 -0
  20. package/src/source/engine/builder/PostProcessor.bs +331 -0
  21. package/src/source/engine/builder/Processor.bs +156 -0
  22. package/src/source/engine/builder/Tree.bs +278 -0
  23. package/src/source/engine/builder/TreeBase.bs +313 -0
  24. package/src/source/engine/builder/WidgetCreate.bs +322 -0
  25. package/src/source/engine/builder/WidgetRemove.bs +72 -0
  26. package/src/source/engine/builder/WidgetUpdate.bs +113 -0
  27. package/src/source/engine/providers/Dispatcher.bs +72 -0
  28. package/src/source/engine/providers/DispatcherProvider.bs +95 -0
  29. package/src/source/engine/services/I18n.bs +169 -0
  30. package/src/source/libs/animate/Animate.bs +753 -0
  31. package/src/source/libs/animate/LICENSE.txt +21 -0
  32. package/src/source/plugins/DispatcherProviderPlugin.bs +127 -0
  33. package/src/source/plugins/FieldsPlugin.bs +180 -0
  34. package/src/source/plugins/FocusPlugin.bs +1522 -0
  35. package/src/source/plugins/FontStylePlugin.bs +159 -0
  36. package/src/source/plugins/ObserverPlugin.bs +548 -0
  37. package/src/source/utils/ArrayUtils.bs +495 -0
  38. package/src/source/utils/GeneralUtils.bs +181 -0
  39. package/src/source/utils/NodeUtils.bs +180 -0
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Balázs Molnár
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,120 @@
1
+ # Rotor Framework
2
+ [![Coverage Status](https://coveralls.io/repos/github/mobalazs/rotor-framework/badge.svg?branch=main&v=2)](https://coveralls.io/github/mobalazs/rotor-framework?branch=main)
3
+ [![GitHub package.json version](https://img.shields.io/github/package-json/v/mobalazs/rotor-framework)](https://github.com/mobalazs/rotor-framework/packages)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![Slack](https://img.shields.io/badge/Slack-RokuDevelopers-4A154B?logo=slack)](https://rokudevelopers.slack.com)
6
+
7
+ **Rotor** is a modular, ViewModel-first UI framework for Roku applications built with BrighterScript and SceneGraph. It is lightweight and designed to intuitively speed up development time while simplifying both the implementation and long-term maintenance process. It features a rich ViewBuilder system and a Roku-friendly implementation of the MVI (Model-View-Intent) design pattern. It helps developers structure large-scale apps with reusable components, state-driven logic, and optimized rendering.
8
+
9
+ [🌱](#token-efficient-documentation-for-ai)
10
+
11
+ ---
12
+
13
+ ## 🚀 Key Features
14
+
15
+ - **ViewBuilder system**: Declarative and extensible view construction with a flexible, code-based template system, automatic full lifecycle management, and a virtual node tree abstraction.
16
+ - **Roku-friendly MVI design pattern**: Predictable state, clear separation of concerns, and cross-thread compatibility.
17
+ - **Component-based UI**: Isolated, reusable UI widgets and view models.
18
+ - **i18n support**: Locale-aware interface with flexible language resource injection.
19
+ - **Integrated** [Animate](https://github.com/haystacknews/animate) Library
20
+
21
+
22
+ ---
23
+
24
+ ## 📦 Installation
25
+
26
+ ### Prerequisites
27
+
28
+ Rotor Framework requires BrighterScript v1. Install the latest version:
29
+
30
+ ```bash
31
+ npm install --save-dev brighterscript@next @rokucommunity/bslint@next
32
+ ```
33
+
34
+ ### Install Rotor Framework
35
+
36
+ 1. Download the latest `rotor-framework.zip` from [GitHub Releases](https://github.com/mobalazs/rotor-framework/releases)
37
+ 2. Extract the ZIP into your project's `source/` directory (this will create a `rotor-framework/` folder)
38
+ 3. Import Rotor in your main file:
39
+
40
+ ```vb
41
+ import "pkg:/source/RotorFramework.bs"
42
+ ```
43
+
44
+ ---
45
+
46
+ ## ⚡ Quick Start
47
+
48
+ ```vb
49
+
50
+ frameworkInstance = new Rotor.Framework()
51
+
52
+ frameworkInstance.render([
53
+ {
54
+ id: "helloLabel", ' optional
55
+ nodeType: "Label",
56
+ fields: {
57
+ text: "Hello World!",
58
+ color: "#CCCCCC"
59
+ }
60
+ }
61
+ ])
62
+
63
+ ```
64
+
65
+ ---
66
+
67
+ <a id="token-efficient-documentation"></a>
68
+ ## Token-efficient documentation for AI
69
+
70
+ You can find [🌱](./docs/ai/readme.opt.yaml) symbols in all documentation pages. These symbols link to AI-optimized summaries of the respective documentation.
71
+
72
+ **📖 [Read more about token savings](./docs/token-efficient-docs.md)**
73
+
74
+
75
+ ---
76
+
77
+ ## 📚 Learn More
78
+ ![Version](https://img.shields.io/badge/version-v0.3.2-blue?label=Documents%20TAG)
79
+
80
+ ### Framework Core
81
+
82
+ - [Framework Initialization](./docs/framework-initialization.md) - Configuration, task synchronization
83
+
84
+ ### ViewBuilder Reference
85
+
86
+ - [ViewBuilder Overview](./docs/view-builder-overview.md) - High-level architecture and core concepts
87
+ - [Widget Reference](./docs/view-builder-widget-reference.md) - Complete Widget properties, methods, and usage patterns
88
+ - [ViewModel Reference](./docs/view-builder-viewmodel-reference.md) - Complete ViewModel structure, lifecycle, and state management
89
+
90
+ ### ViewBuilder Plugins
91
+
92
+ - [ViewBuilder Fields Plugin](./docs/view-builder-fields-plugin.md) - Field management and binding
93
+ - [ViewBuilder FontStyle Plugin](./docs/view-builder-fontstyle-plugin.md) - Typography and styling
94
+ - [ViewBuilder Observer Plugin](./docs/view-builder-observer-plugin.md) - State observation patterns
95
+ - [ViewBuilder Focus Plugin](./docs/view-builder-focus-plugin.md) - Focus management system
96
+
97
+ ### MVI Documentation
98
+
99
+ - [Cross-Thread MVI design pattern](./docs/cross-thread-mvi.md) - State management across threads
100
+
101
+ ### i18N Documentation
102
+
103
+ - [Internationalization support](./docs/i18n-support.md) - Locale-aware interface implementation
104
+
105
+ ---
106
+
107
+ ## 🔧 Requirements
108
+
109
+ - Roku SceneGraph (firmware 10.5+ recommended)
110
+ - BrighterScript V1
111
+
112
+ ---
113
+
114
+ ## 📄 License
115
+
116
+ Rotor is MIT licensed. See [LICENSE.md](./LICENSE.md) file for details.
117
+
118
+ ---
119
+
120
+ © 2025 Rotor Molnar Balazs
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "rotor-framework",
3
+ "version": "0.3.2",
4
+ "description": "A Roku toolkit library providing a ViewBuilder, full UI lifecycle with focus handling and many core features, plus MVI-based state management.",
5
+ "author": "Balázs Molnár",
6
+ "license": "MIT",
7
+ "scripts": {
8
+ "build": "bsc --project bsconfig.json --createPackage=false",
9
+ "build-tests": "bsc --project bsconfig-tests.json --createPackage=false",
10
+ "coverage": "npm run collect-coverage && npm run fix-coverage",
11
+ "collect-coverage": "node scripts/collect-coverage.js",
12
+ "fix-coverage": "node scripts/fix-coverage-paths.js",
13
+ "lint": "npx bslint --project bsconfig.json --lintConfig bslint.json",
14
+ "linter": "bsc --create-package --copy-to-staging false",
15
+ "update-version": "node scripts/update-version.js"
16
+ },
17
+ "files": [
18
+ "src/source/base/**/*",
19
+ "src/source/engine/**/*",
20
+ "src/source/libs/**/*",
21
+ "src/source/plugins/**/*",
22
+ "src/source/utils/**/*",
23
+ "src/source/RotorFramework.bs",
24
+ "src/source/RotorFrameworkTask.bs",
25
+ "README.md",
26
+ "LICENSE.md",
27
+ "!src/source/**/*.spec.bs"
28
+ ],
29
+ "publishConfig": {
30
+ "registry": "https://registry.npmjs.org/"
31
+ },
32
+ "ropm": {
33
+ "packageRootDir": "src"
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "git+https://github.com/mobalazs/rotor-framework.git"
38
+ },
39
+ "keywords": [
40
+ "roku",
41
+ "brightscript",
42
+ "brighterscript",
43
+ "framework",
44
+ "mvi",
45
+ "state-management",
46
+ "ui-framework",
47
+ "view-builder",
48
+ "ropm"
49
+ ],
50
+ "bugs": {
51
+ "url": "https://github.com/mobalazs/rotor-framework/issues"
52
+ },
53
+ "homepage": "https://github.com/mobalazs/rotor-framework#readme",
54
+ "devDependencies": {
55
+ "@rokucommunity/bslint": "^1.0.0-alpha.48",
56
+ "brighterscript": "^1.0.0-alpha.48",
57
+ "rooibos-roku": "file:./vendor/rooibos-roku-6.0.0-alpha.48-fixed354.tgz"
58
+ }
59
+ }