targetj 1.0.255 → 1.0.257

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/Export.js CHANGED
@@ -1,26 +1,4 @@
1
- export {
2
- App,
3
- tApp,
4
- tRoot,
5
- isRunning,
6
- getEvents,
7
- getPager,
8
- getLoader,
9
- fetch,
10
- fetchImage,
11
- getManager,
12
- getTargetManager,
13
- getAnimationManager,
14
- getRunScheduler,
15
- getLocationManager,
16
- getScreenWidth,
17
- getScreenHeight,
18
- getVisibles,
19
- getResizeLastUpdate,
20
- getTModelById,
21
- getDomTModelById
22
- } from "./build/App.js";
23
-
1
+ export * from "./build/App.js";
24
2
  export * from "./build/TModel.js";
25
3
  export * from "./build/Moves.js";
26
4
  export * from "./build/SearchUtil.js";
@@ -40,53 +18,56 @@ export * from "./build/AnimationManager.js";
40
18
  export * from "./build/AnimationUtil.js";
41
19
  export * from "./build/VisibilityUtil.js";
42
20
  export * from "./build/ScheduleUtil.js";
21
+ export * from "./build/StateUtil.js";
43
22
 
44
- import * as AppModule from './build/App.js';
45
- import * as TModel from './build/TModel.js';
46
- import * as Moves from './build/Moves.js';
47
- import * as SearchUtil from './build/SearchUtil.js';
48
- import * as TargetData from './build/TargetData.js';
49
- import * as TargetUtil from './build/TargetUtil.js';
50
- import * as TargetParser from './build/TargetParser.js';
51
- import * as TModelUtil from './build/TModelUtil.js';
52
- import * as TUtil from './build/TUtil.js';
53
- import * as DomInit from './build/DomInit.js';
54
- import * as Dom from './build/$Dom.js';
55
- import * as Bracket from './build/Bracket.js';
56
- import * as BracketGenerator from './build/BracketGenerator.js';
57
- import * as ColorUtil from './build/ColorUtil.js';
58
- import * as Easing from './build/Easing.js';
59
- import * as TargetExecutor from './build/TargetExecutor.js';
60
- import * as AnimationManager from './build/AnimationManager.js';
61
- import * as AnimationUtil from './build/AnimationUtil.js';
62
- import * as VisibilityUtil from './build/VisibilityUtil.js';
63
- import * as ScheduleUtil from './build/ScheduleUtil.js';
23
+ import * as AppModule from "./build/App.js";
24
+ import * as TModelModule from "./build/TModel.js";
25
+ import * as MovesModule from "./build/Moves.js";
26
+ import * as SearchUtilModule from "./build/SearchUtil.js";
27
+ import * as TargetDataModule from "./build/TargetData.js";
28
+ import * as TargetUtilModule from "./build/TargetUtil.js";
29
+ import * as TargetParserModule from "./build/TargetParser.js";
30
+ import * as TModelUtilModule from "./build/TModelUtil.js";
31
+ import * as TUtilModule from "./build/TUtil.js";
32
+ import * as DomInitModule from "./build/DomInit.js";
33
+ import * as DomModule from "./build/$Dom.js";
34
+ import * as BracketModule from "./build/Bracket.js";
35
+ import * as BracketGeneratorModule from "./build/BracketGenerator.js";
36
+ import * as ColorUtilModule from "./build/ColorUtil.js";
37
+ import * as EasingModule from "./build/Easing.js";
38
+ import * as TargetExecutorModule from "./build/TargetExecutor.js";
39
+ import * as AnimationManagerModule from "./build/AnimationManager.js";
40
+ import * as AnimationUtilModule from "./build/AnimationUtil.js";
41
+ import * as VisibilityUtilModule from "./build/VisibilityUtil.js";
42
+ import * as ScheduleUtilModule from "./build/ScheduleUtil.js";
43
+ import * as StateUtilModule from "./build/StateUtil.js";
64
44
 
65
45
  const TargetJS = {
66
- ...AppModule,
67
- ...TModel,
68
- ...Moves,
69
- ...SearchUtil,
70
- ...TargetData,
71
- ...TargetUtil,
72
- ...TargetParser,
73
- ...TModelUtil,
74
- ...TUtil,
75
- ...DomInit,
76
- ...Dom,
77
- ...Bracket,
78
- ...BracketGenerator,
79
- ...ColorUtil,
80
- ...Easing,
81
- ...TargetExecutor,
82
- ...AnimationManager,
83
- ...AnimationUtil,
84
- ...VisibilityUtil,
85
- ...ScheduleUtil
46
+ ...AppModule,
47
+ ...TModelModule,
48
+ ...MovesModule,
49
+ ...SearchUtilModule,
50
+ ...TargetDataModule,
51
+ ...TargetUtilModule,
52
+ ...TargetParserModule,
53
+ ...TModelUtilModule,
54
+ ...TUtilModule,
55
+ ...DomInitModule,
56
+ ...DomModule,
57
+ ...BracketModule,
58
+ ...BracketGeneratorModule,
59
+ ...ColorUtilModule,
60
+ ...EasingModule,
61
+ ...TargetExecutorModule,
62
+ ...AnimationManagerModule,
63
+ ...AnimationUtilModule,
64
+ ...VisibilityUtilModule,
65
+ ...ScheduleUtilModule,
66
+ ...StateUtilModule
86
67
  };
87
68
 
88
- if (typeof window !== 'undefined') {
89
- window.TargetJS = TargetJS;
69
+ if (typeof window !== "undefined") {
70
+ window.TargetJS = TargetJS;
90
71
  }
91
72
 
92
73
  export default TargetJS;
package/README.md CHANGED
@@ -7,7 +7,9 @@
7
7
  [![Stars](https://img.shields.io/github/stars/livetrails/targetjs.svg)](https://github.com/livetrails/targetjs/stargazers)
8
8
  [![npm version](https://img.shields.io/npm/v/targetj.svg)](https://www.npmjs.com/package/targetj)
9
9
 
10
- TargetJS is a JavaScript UI framework that replaces the "State → Render" model with "State → Transition → Render". It also lets code order directly define the UI sequence. It unifies UI, animations, API calls, event handling, and state into self-contained "Targets" that stack together like Lego pieces using Code-Ordered Reactivity.
10
+ TargetJS is a JavaScript UI framework that replaces the "State → Render" model with "State → Transition → Render". Transitions are part of state, which means they can adapt dynamically, be serialized mid-transition, and resume when the UI is restored.
11
+
12
+ TargetJS also lets code order directly define the UI sequence. UI, transitions, API calls, event handling, and state are unified into self-contained Targets that chain together through Code-Ordered Reactivity.
11
13
 
12
14
  It can be used as a full-featured framework or as a lightweight library alongside other frameworks. It is also a highly performant web framework, as shown in the [framework benchmark](https://krausest.github.io/js-framework-benchmark/current.html).
13
15
 
@@ -20,6 +22,10 @@ Traditional frameworks model the UI as a function of state: change state, re-ren
20
22
 
21
23
  TargetJS treats state as a destination. Values are not only assigned. They can be approached over time through configurable steps. This makes transitions a native part of state change. TargetJS also delivers CSS-level transition efficiency.
22
24
 
25
+ More importantly, it unlocks a new level of flexibility. Because a target has its own lifecycle, its transitions can adapt dynamically. For example, pausing when an element leaves the screen or changing speed on scroll.
26
+
27
+ And since the transition is part of the state, it can be serialized. This means a transition can survive a page flip and resume when the UI is restored.
28
+
23
29
  **Fragmentation across multiple mental models**
24
30
 
25
31
  In many applications, state, animation, events, loading, timing, and callbacks are all handled through separate concepts or APIs. This creates glue code and a mental split between them.
@@ -41,6 +47,7 @@ With its compact style, TargetJS makes the journey from A → B explicit and eff
41
47
  ## 🚀 Why TargetJS?
42
48
 
43
49
  1. Unified State: One single state. Transitions are state too.
50
+ 1. Adaptive Transitions: Transitions can pause, resume, change speed, and respond to input. They can also be serialized and continue, for instance, after a page flip.
44
51
  1. UI as Sequence: Code describes the UI story from top to bottom, just like the user experiences the interaction: "When this finishes, do that."
45
52
  1. Ultra-Compact: Minimal code, with no coordination variables.
46
53
  1. Zero Boilerplate Async: Targets handle waiting for nested asynchronous operations automatically.
@@ -56,7 +63,15 @@ npm install targetj
56
63
 
57
64
  **2. Example**
58
65
 
59
- This creates the following sequence: bounce → move → turn red → log. Notice how the code read like the UI sequence. The `$$` suffix makes each step wait for the preceding ones. There is only one state. The transitions are part of that state.
66
+ This creates the following sequence:
67
+
68
+ ```text
69
+ bounce → move → turn red → log
70
+ ```
71
+
72
+ Notice how the code reads in the same order as the UI sequence. The `$$` suffix makes each target wait for all preceding targets to complete.
73
+
74
+ There is only one state, and transitions are part of that state. Although not shown here, the state can also be serialized mid-transition, for example, during a page flip and restored when the UI remounts.
60
75
 
61
76
  ```javascript
62
77
  import { App } from "targetj";