jssm 5.98.7 → 5.99.0
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/CHANGELOG.md +45 -59
- package/README.md +5 -5
- package/dist/es6/jssm.d.ts +5 -2
- package/dist/es6/jssm.js +35 -4
- package/dist/es6/jssm_types.d.ts +6 -1
- package/dist/es6/jssm_util.d.ts +2 -1
- package/dist/es6/jssm_util.js +4 -1
- package/dist/es6/version.js +1 -1
- package/dist/jssm.es5.cjs +1 -1
- package/dist/jssm.es5.iife.cjs +1 -1
- package/dist/jssm.es5.iife.nonmin.cjs +38 -3
- package/dist/jssm.es5.nonmin.cjs +38 -3
- package/dist/jssm.es6.mjs +1 -1
- package/dist/jssm.es6.nonmin.cjs +38 -4
- package/jssm.d.ts +5 -2
- package/jssm_types.d.ts +6 -1
- package/jssm_util.d.ts +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
1162 merges; 201 releases; Changlogging the last 10 commits; Full changelog at [CHANGELOG.long.md](CHANGELOG.long.md)
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -22,13 +22,15 @@ Published tags:
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
## [Untagged] - 7/6/2024
|
|
25
|
+
## [Untagged] - 7/6/2024 5:46:50 PM
|
|
26
26
|
|
|
27
|
-
Commit [
|
|
27
|
+
Commit [9767e2c04a34d2d02bc8541daa6eb701dea15b70](https://github.com/StoneCypher/jssm/commit/9767e2c04a34d2d02bc8541daa6eb701dea15b70)
|
|
28
28
|
|
|
29
29
|
Author: `John Haugeland <stonecypher@gmail.com>`
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Merges [f820f8d, 54f0f4f]
|
|
32
|
+
|
|
33
|
+
* WIP on AddAfterAnyHook: f820f8d After hook for single node, fixes StoneCypher/fsl#698
|
|
32
34
|
|
|
33
35
|
|
|
34
36
|
|
|
@@ -37,13 +39,13 @@ Author: `John Haugeland <stonecypher@gmail.com>`
|
|
|
37
39
|
|
|
38
40
|
|
|
39
41
|
|
|
40
|
-
## [Untagged] - 7/6/2024
|
|
42
|
+
## [Untagged] - 7/6/2024 5:46:50 PM
|
|
41
43
|
|
|
42
|
-
Commit [
|
|
44
|
+
Commit [54f0f4f72ca63de414e1362471377494492ca101](https://github.com/StoneCypher/jssm/commit/54f0f4f72ca63de414e1362471377494492ca101)
|
|
43
45
|
|
|
44
46
|
Author: `John Haugeland <stonecypher@gmail.com>`
|
|
45
47
|
|
|
46
|
-
*
|
|
48
|
+
* index on AddAfterAnyHook: f820f8d After hook for single node, fixes StoneCypher/fsl#698
|
|
47
49
|
|
|
48
50
|
|
|
49
51
|
|
|
@@ -52,13 +54,13 @@ Author: `John Haugeland <stonecypher@gmail.com>`
|
|
|
52
54
|
|
|
53
55
|
|
|
54
56
|
|
|
55
|
-
## [Untagged] - 7/6/2024
|
|
57
|
+
## [Untagged] - 7/6/2024 5:43:39 PM
|
|
56
58
|
|
|
57
|
-
Commit [
|
|
59
|
+
Commit [f820f8d0dcc226a6cbe227e16d6e250a3c298be8](https://github.com/StoneCypher/jssm/commit/f820f8d0dcc226a6cbe227e16d6e250a3c298be8)
|
|
58
60
|
|
|
59
61
|
Author: `John Haugeland <stonecypher@gmail.com>`
|
|
60
62
|
|
|
61
|
-
*
|
|
63
|
+
* After hook for single node, fixes StoneCypher/fsl#698
|
|
62
64
|
|
|
63
65
|
|
|
64
66
|
|
|
@@ -67,13 +69,13 @@ Author: `John Haugeland <stonecypher@gmail.com>`
|
|
|
67
69
|
|
|
68
70
|
|
|
69
71
|
|
|
70
|
-
## [Untagged] - 7/6/2024
|
|
72
|
+
## [Untagged] - 7/6/2024 12:45:09 PM
|
|
71
73
|
|
|
72
|
-
Commit [
|
|
74
|
+
Commit [76daa940129b760f10032250ac482974ce1a9339](https://github.com/StoneCypher/jssm/commit/76daa940129b760f10032250ac482974ce1a9339)
|
|
73
75
|
|
|
74
76
|
Author: `John Haugeland <stonecypher@gmail.com>`
|
|
75
77
|
|
|
76
|
-
*
|
|
78
|
+
* suppressing tweet since that hasn't worked since elon anyway
|
|
77
79
|
|
|
78
80
|
|
|
79
81
|
|
|
@@ -82,22 +84,13 @@ Author: `John Haugeland <stonecypher@gmail.com>`
|
|
|
82
84
|
|
|
83
85
|
|
|
84
86
|
|
|
85
|
-
## [Untagged] - 6/
|
|
87
|
+
## [Untagged] - 7/6/2024 12:35:59 PM
|
|
86
88
|
|
|
87
|
-
Commit [
|
|
89
|
+
Commit [6fe0e82f5d442504e97061e739bbacc1e110740a](https://github.com/StoneCypher/jssm/commit/6fe0e82f5d442504e97061e739bbacc1e110740a)
|
|
88
90
|
|
|
89
|
-
Author: `
|
|
91
|
+
Author: `John Haugeland <stonecypher@gmail.com>`
|
|
90
92
|
|
|
91
|
-
*
|
|
92
|
-
* Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
|
|
93
|
-
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
|
|
94
|
-
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)
|
|
95
|
-
* ---
|
|
96
|
-
updated-dependencies:
|
|
97
|
-
- dependency-name: braces
|
|
98
|
-
dependency-type: indirect
|
|
99
|
-
...
|
|
100
|
-
* Signed-off-by: dependabot[bot] <support@github.com>
|
|
93
|
+
* jest bugs forced upgrade to jest which starts at node 14. since 14's two years out of service, i guess i'm okay with no longer testing 11-13.
|
|
101
94
|
|
|
102
95
|
|
|
103
96
|
|
|
@@ -106,22 +99,13 @@ updated-dependencies:
|
|
|
106
99
|
|
|
107
100
|
|
|
108
101
|
|
|
109
|
-
## [Untagged] - 6/
|
|
102
|
+
## [Untagged] - 7/6/2024 12:29:29 PM
|
|
110
103
|
|
|
111
|
-
Commit [
|
|
104
|
+
Commit [79624fe28c4096a3fa1b97e01829a949e3c26b6b](https://github.com/StoneCypher/jssm/commit/79624fe28c4096a3fa1b97e01829a949e3c26b6b)
|
|
112
105
|
|
|
113
|
-
Author: `
|
|
106
|
+
Author: `John Haugeland <stonecypher@gmail.com>`
|
|
114
107
|
|
|
115
|
-
*
|
|
116
|
-
* Bumps [ws](https://github.com/websockets/ws) from 7.5.9 to 7.5.10.
|
|
117
|
-
- [Release notes](https://github.com/websockets/ws/releases)
|
|
118
|
-
- [Commits](https://github.com/websockets/ws/compare/7.5.9...7.5.10)
|
|
119
|
-
* ---
|
|
120
|
-
updated-dependencies:
|
|
121
|
-
- dependency-name: ws
|
|
122
|
-
dependency-type: indirect
|
|
123
|
-
...
|
|
124
|
-
* Signed-off-by: dependabot[bot] <support@github.com>
|
|
108
|
+
* remove other spurious gating comparison
|
|
125
109
|
|
|
126
110
|
|
|
127
111
|
|
|
@@ -130,15 +114,13 @@ updated-dependencies:
|
|
|
130
114
|
|
|
131
115
|
|
|
132
116
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
## [5.98.2] - 4/25/2024 11:44:27 AM
|
|
117
|
+
## [Untagged] - 7/6/2024 12:23:37 PM
|
|
136
118
|
|
|
137
|
-
Commit [
|
|
119
|
+
Commit [ad22d350f0b2e431d8e1ecf9c5a7ccf942b4eb3f](https://github.com/StoneCypher/jssm/commit/ad22d350f0b2e431d8e1ecf9c5a7ccf942b4eb3f)
|
|
138
120
|
|
|
139
121
|
Author: `John Haugeland <stonecypher@gmail.com>`
|
|
140
122
|
|
|
141
|
-
*
|
|
123
|
+
* remove spurious gating comparison
|
|
142
124
|
|
|
143
125
|
|
|
144
126
|
|
|
@@ -147,13 +129,13 @@ Author: `John Haugeland <stonecypher@gmail.com>`
|
|
|
147
129
|
|
|
148
130
|
|
|
149
131
|
|
|
150
|
-
## [Untagged] -
|
|
132
|
+
## [Untagged] - 7/6/2024 12:00:00 PM
|
|
151
133
|
|
|
152
|
-
Commit [
|
|
134
|
+
Commit [84fb0da36c3cb4c7b6aaab527a3a38cb37ba5bc5](https://github.com/StoneCypher/jssm/commit/84fb0da36c3cb4c7b6aaab527a3a38cb37ba5bc5)
|
|
153
135
|
|
|
154
136
|
Author: `John Haugeland <stonecypher@gmail.com>`
|
|
155
137
|
|
|
156
|
-
*
|
|
138
|
+
* clean up dep vulns
|
|
157
139
|
|
|
158
140
|
|
|
159
141
|
|
|
@@ -162,13 +144,13 @@ Author: `John Haugeland <stonecypher@gmail.com>`
|
|
|
162
144
|
|
|
163
145
|
|
|
164
146
|
|
|
165
|
-
## [Untagged] -
|
|
147
|
+
## [Untagged] - 7/6/2024 11:48:48 AM
|
|
166
148
|
|
|
167
|
-
Commit [
|
|
149
|
+
Commit [e0fb09207dbeb470471adcfc2cec6c228c3338a7](https://github.com/StoneCypher/jssm/commit/e0fb09207dbeb470471adcfc2cec6c228c3338a7)
|
|
168
150
|
|
|
169
151
|
Author: `John Haugeland <stonecypher@gmail.com>`
|
|
170
152
|
|
|
171
|
-
*
|
|
153
|
+
* Tidy up alternative graphing in viz. Fixes StoneCypher/fsl#374, fixes StoneCypher/fsl#1296
|
|
172
154
|
|
|
173
155
|
|
|
174
156
|
|
|
@@ -177,15 +159,19 @@ Author: `John Haugeland <stonecypher@gmail.com>`
|
|
|
177
159
|
|
|
178
160
|
|
|
179
161
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
## [5.98.0] - 3/26/2024 8:24:29 PM
|
|
183
|
-
|
|
184
|
-
Commit [b2d953d915b12e5831a3d1ad87c5e09747787997](https://github.com/StoneCypher/jssm/commit/b2d953d915b12e5831a3d1ad87c5e09747787997)
|
|
162
|
+
## [Untagged] - 6/18/2024 5:23:32 PM
|
|
185
163
|
|
|
186
|
-
|
|
164
|
+
Commit [8bf562699ded4ffec21e50551b4a354c00daa12b](https://github.com/StoneCypher/jssm/commit/8bf562699ded4ffec21e50551b4a354c00daa12b)
|
|
187
165
|
|
|
188
|
-
|
|
166
|
+
Author: `dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>`
|
|
189
167
|
|
|
190
|
-
*
|
|
191
|
-
*
|
|
168
|
+
* Bump braces from 3.0.2 to 3.0.3
|
|
169
|
+
* Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
|
|
170
|
+
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
|
|
171
|
+
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)
|
|
172
|
+
* ---
|
|
173
|
+
updated-dependencies:
|
|
174
|
+
- dependency-name: braces
|
|
175
|
+
dependency-type: indirect
|
|
176
|
+
...
|
|
177
|
+
* Signed-off-by: dependabot[bot] <support@github.com>
|
package/README.md
CHANGED
|
@@ -18,10 +18,10 @@ Please edit the file it's derived from, instead: `./src/md/readme_base.md`
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
* Generated for version 5.
|
|
21
|
+
* Generated for version 5.99.0 at 7/6/2024, 6:09:45 PM
|
|
22
22
|
|
|
23
23
|
-->
|
|
24
|
-
# jssm 5.
|
|
24
|
+
# jssm 5.99.0
|
|
25
25
|
|
|
26
26
|
Easy. Small. Fast. TS, es6, es5. Node, Browser. 100% coverage. Property
|
|
27
27
|
tests. Fuzz tests. Language tests for a dozen languages and emoji. Easy to
|
|
@@ -29,12 +29,12 @@ share online. Easy to embed.
|
|
|
29
29
|
|
|
30
30
|
Readable, useful state machines as one-liner strings.
|
|
31
31
|
|
|
32
|
-
***5,
|
|
32
|
+
***5,071 tests***, run 5,962 times.
|
|
33
33
|
|
|
34
|
-
* 5,
|
|
34
|
+
* 5,062 specs with 100.0% coverage.
|
|
35
35
|
* 9 fuzz tests with 12.4% coverage.
|
|
36
36
|
|
|
37
|
-
With
|
|
37
|
+
With 3,007 lines, that's about 1.7 tests per line, or 2.0 generated tests per line.
|
|
38
38
|
|
|
39
39
|
***Meet your new state machine library.***
|
|
40
40
|
|
package/dist/es6/jssm.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { JssmGenericState, JssmGenericConfig, JssmStateConfig, JssmTransition, J
|
|
|
3
3
|
JssmMachineInternalState, JssmAllowsOverride, JssmStateDeclaration, JssmStateStyleKeyList, JssmLayout, JssmHistory, JssmSerialization, FslDirection, FslDirections, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult, JssmRng } from './jssm_types';
|
|
4
4
|
import { arrow_direction, arrow_left_kind, arrow_right_kind } from './jssm_arrow';
|
|
5
5
|
import { compile, make, wrap_parse } from './jssm_compiler';
|
|
6
|
-
import { seq, unique, find_repeated, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key } from './jssm_util';
|
|
6
|
+
import { seq, unique, find_repeated, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key, sleep } from './jssm_util';
|
|
7
7
|
import * as constants from './jssm_constants';
|
|
8
8
|
declare const shapes: string[], gviz_shapes: string[], named_colors: string[];
|
|
9
9
|
import { version, build_time } from './version';
|
|
@@ -56,6 +56,7 @@ declare class Machine<mDT> {
|
|
|
56
56
|
_has_named_hooks: boolean;
|
|
57
57
|
_has_entry_hooks: boolean;
|
|
58
58
|
_has_exit_hooks: boolean;
|
|
59
|
+
_has_after_hooks: boolean;
|
|
59
60
|
_has_global_action_hooks: boolean;
|
|
60
61
|
_has_transition_hooks: boolean;
|
|
61
62
|
_has_forced_transitions: boolean;
|
|
@@ -63,6 +64,7 @@ declare class Machine<mDT> {
|
|
|
63
64
|
_named_hooks: Map<string, HookHandler<mDT>>;
|
|
64
65
|
_entry_hooks: Map<string, HookHandler<mDT>>;
|
|
65
66
|
_exit_hooks: Map<string, HookHandler<mDT>>;
|
|
67
|
+
_after_hooks: Map<string, HookHandler<mDT>>;
|
|
66
68
|
_global_action_hooks: Map<string, HookHandler<mDT>>;
|
|
67
69
|
_any_action_hook: HookHandler<mDT> | undefined;
|
|
68
70
|
_standard_transition_hook: HookHandler<mDT> | undefined;
|
|
@@ -669,6 +671,7 @@ declare class Machine<mDT> {
|
|
|
669
671
|
hook_any_transition(handler: HookHandler<mDT>): Machine<mDT>;
|
|
670
672
|
hook_entry(to: string, handler: HookHandler<mDT>): Machine<mDT>;
|
|
671
673
|
hook_exit(from: string, handler: HookHandler<mDT>): Machine<mDT>;
|
|
674
|
+
hook_after(from: string, handler: HookHandler<mDT>): Machine<mDT>;
|
|
672
675
|
post_hook(from: string, to: string, handler: HookHandler<mDT>): Machine<mDT>;
|
|
673
676
|
post_hook_action(from: string, to: string, action: string, handler: HookHandler<mDT>): Machine<mDT>;
|
|
674
677
|
post_hook_global_action(action: string, handler: HookHandler<mDT>): Machine<mDT>;
|
|
@@ -1135,4 +1138,4 @@ declare function is_hook_complex_result<mDT>(hr: unknown): hr is HookComplexResu
|
|
|
1135
1138
|
declare function is_hook_rejection<mDT>(hr: HookResult<mDT>): boolean;
|
|
1136
1139
|
declare function abstract_hook_step<mDT>(maybe_hook: HookHandler<mDT> | undefined, hook_args: HookContext<mDT>): HookComplexResult<mDT>;
|
|
1137
1140
|
declare function deserialize<mDT>(machine_string: string, ser: JssmSerialization<mDT>): Machine<mDT>;
|
|
1138
|
-
export { version, build_time, transfer_state_properties, Machine, deserialize, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, unique, find_repeated, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, constants, shapes, gviz_shapes, named_colors, is_hook_rejection, is_hook_complex_result, abstract_hook_step, state_style_condense, FslDirections };
|
|
1141
|
+
export { version, build_time, transfer_state_properties, Machine, deserialize, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, unique, find_repeated, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, sleep, constants, shapes, gviz_shapes, named_colors, is_hook_rejection, is_hook_complex_result, abstract_hook_step, state_style_condense, FslDirections };
|
package/dist/es6/jssm.js
CHANGED
|
@@ -4,7 +4,7 @@ import { FslDirections } from './jssm_types';
|
|
|
4
4
|
import { arrow_direction, arrow_left_kind, arrow_right_kind } from './jssm_arrow';
|
|
5
5
|
import { compile, make, wrap_parse } from './jssm_compiler';
|
|
6
6
|
import { theme_mapping, base_theme } from './jssm_theme';
|
|
7
|
-
import { seq, unique, find_repeated, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key, array_box_if_string, name_bind_prop_and_state, hook_name, named_hook_name, gen_splitmix32 } from './jssm_util';
|
|
7
|
+
import { seq, unique, find_repeated, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key, array_box_if_string, name_bind_prop_and_state, hook_name, named_hook_name, gen_splitmix32, sleep } from './jssm_util';
|
|
8
8
|
import * as constants from './jssm_constants';
|
|
9
9
|
const { shapes, gviz_shapes, named_colors } = constants;
|
|
10
10
|
import { version, build_time } from './version'; // replaced from package.js in build
|
|
@@ -162,6 +162,7 @@ class Machine {
|
|
|
162
162
|
this._has_named_hooks = false;
|
|
163
163
|
this._has_entry_hooks = false;
|
|
164
164
|
this._has_exit_hooks = false;
|
|
165
|
+
this._has_after_hooks = false;
|
|
165
166
|
this._has_global_action_hooks = false;
|
|
166
167
|
this._has_transition_hooks = true;
|
|
167
168
|
// no need for a boolean for single hooks, just test for undefinedness
|
|
@@ -170,6 +171,7 @@ class Machine {
|
|
|
170
171
|
this._named_hooks = new Map();
|
|
171
172
|
this._entry_hooks = new Map();
|
|
172
173
|
this._exit_hooks = new Map();
|
|
174
|
+
this._after_hooks = new Map();
|
|
173
175
|
this._global_action_hooks = new Map();
|
|
174
176
|
this._any_action_hook = undefined;
|
|
175
177
|
this._standard_transition_hook = undefined;
|
|
@@ -1325,6 +1327,11 @@ class Machine {
|
|
|
1325
1327
|
this._has_hooks = true;
|
|
1326
1328
|
this._has_exit_hooks = true;
|
|
1327
1329
|
break;
|
|
1330
|
+
case 'after':
|
|
1331
|
+
this._after_hooks.set(HookDesc.from, HookDesc.handler);
|
|
1332
|
+
this._has_hooks = true;
|
|
1333
|
+
this._has_after_hooks = true;
|
|
1334
|
+
break;
|
|
1328
1335
|
case 'post hook':
|
|
1329
1336
|
this._post_hooks.set(hook_name(HookDesc.from, HookDesc.to), HookDesc.handler);
|
|
1330
1337
|
this._has_post_hooks = true;
|
|
@@ -1417,6 +1424,10 @@ class Machine {
|
|
|
1417
1424
|
this.set_hook({ kind: 'exit', from, handler });
|
|
1418
1425
|
return this;
|
|
1419
1426
|
}
|
|
1427
|
+
hook_after(from, handler) {
|
|
1428
|
+
this.set_hook({ kind: 'after', from, handler });
|
|
1429
|
+
return this;
|
|
1430
|
+
}
|
|
1420
1431
|
post_hook(from, to, handler) {
|
|
1421
1432
|
this.set_hook({ kind: 'post hook', from, to, handler });
|
|
1422
1433
|
return this;
|
|
@@ -1558,19 +1569,33 @@ class Machine {
|
|
|
1558
1569
|
}
|
|
1559
1570
|
let data_changed = false;
|
|
1560
1571
|
if (wasAction) {
|
|
1561
|
-
//
|
|
1572
|
+
// 1a. any action hook
|
|
1562
1573
|
const outcome = abstract_hook_step(this._any_action_hook, hook_args);
|
|
1563
1574
|
if (outcome.pass === false) {
|
|
1564
1575
|
return false;
|
|
1565
1576
|
}
|
|
1566
1577
|
update_fields(outcome);
|
|
1567
|
-
//
|
|
1578
|
+
// 1b. global specific action hook
|
|
1568
1579
|
const outcome2 = abstract_hook_step(this._global_action_hooks.get(newStateOrAction), hook_args);
|
|
1569
1580
|
if (outcome2.pass === false) {
|
|
1570
1581
|
return false;
|
|
1571
1582
|
}
|
|
1572
1583
|
update_fields(outcome2);
|
|
1573
1584
|
}
|
|
1585
|
+
// 2. after hook
|
|
1586
|
+
if (this._has_after_hooks) {
|
|
1587
|
+
const ah = this._after_hooks.get(newStateOrAction);
|
|
1588
|
+
const outcome = abstract_hook_step(ah, hook_args);
|
|
1589
|
+
// there's no such thing as after not passing, so, omit the result pass check
|
|
1590
|
+
/* istanbul can't trace this through the timer */
|
|
1591
|
+
/* istanbul ignore next */
|
|
1592
|
+
if (ah !== undefined) {
|
|
1593
|
+
/* istanbul can't trace this through the timer */
|
|
1594
|
+
/* istanbul ignore next */
|
|
1595
|
+
ah({ data: outcome.data, next_data: outcome.next_data });
|
|
1596
|
+
}
|
|
1597
|
+
update_fields(outcome);
|
|
1598
|
+
}
|
|
1574
1599
|
// 3. any transition hook
|
|
1575
1600
|
if (this._any_transition_hook !== undefined) {
|
|
1576
1601
|
const outcome = abstract_hook_step(this._any_transition_hook, hook_args);
|
|
@@ -2300,6 +2325,12 @@ class Machine {
|
|
|
2300
2325
|
/* istanbul ignore next */
|
|
2301
2326
|
() => {
|
|
2302
2327
|
this.clear_state_timeout();
|
|
2328
|
+
if (this._has_after_hooks) {
|
|
2329
|
+
const ah = this._after_hooks.get(this.state());
|
|
2330
|
+
if (ah !== undefined) {
|
|
2331
|
+
ah({ data: this._data, next_data: this._data });
|
|
2332
|
+
}
|
|
2333
|
+
}
|
|
2303
2334
|
this.go(next_state);
|
|
2304
2335
|
}, after_time);
|
|
2305
2336
|
this._timeout_target = next_state;
|
|
@@ -2452,6 +2483,6 @@ function deserialize(machine_string, ser) {
|
|
|
2452
2483
|
}
|
|
2453
2484
|
export { version, build_time, transfer_state_properties, Machine, deserialize, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind,
|
|
2454
2485
|
// WHARGARBL TODO these should be exported to a utility library
|
|
2455
|
-
seq, unique, find_repeated, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, constants, shapes, gviz_shapes, named_colors, is_hook_rejection, is_hook_complex_result, abstract_hook_step, state_style_condense, FslDirections
|
|
2486
|
+
seq, unique, find_repeated, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, sleep, constants, shapes, gviz_shapes, named_colors, is_hook_rejection, is_hook_complex_result, abstract_hook_step, state_style_condense, FslDirections
|
|
2456
2487
|
// FslThemes
|
|
2457
2488
|
};
|
package/dist/es6/jssm_types.d.ts
CHANGED
|
@@ -303,6 +303,11 @@ declare type ExitHook<mDT> = {
|
|
|
303
303
|
from: string;
|
|
304
304
|
handler: HookHandler<mDT>;
|
|
305
305
|
};
|
|
306
|
+
declare type AfterHook<mDT> = {
|
|
307
|
+
kind: 'after';
|
|
308
|
+
from: string;
|
|
309
|
+
handler: HookHandler<mDT>;
|
|
310
|
+
};
|
|
306
311
|
declare type PostBasicHookDescription<mDT> = {
|
|
307
312
|
kind: 'post hook';
|
|
308
313
|
from: string;
|
|
@@ -351,7 +356,7 @@ declare type PostExitHook<mDT> = {
|
|
|
351
356
|
from: string;
|
|
352
357
|
handler: PostHookHandler<mDT>;
|
|
353
358
|
};
|
|
354
|
-
declare type HookDescription<mDT> = BasicHookDescription<mDT> | HookDescriptionWithAction<mDT> | GlobalActionHook<mDT> | AnyActionHook<mDT> | StandardTransitionHook<mDT> | MainTransitionHook<mDT> | ForcedTransitionHook<mDT> | AnyTransitionHook<mDT> | EntryHook<mDT> | ExitHook<mDT> | PostBasicHookDescription<mDT> | PostHookDescriptionWithAction<mDT> | PostGlobalActionHook<mDT> | PostAnyActionHook<mDT> | PostStandardTransitionHook<mDT> | PostMainTransitionHook<mDT> | PostForcedTransitionHook<mDT> | PostAnyTransitionHook<mDT> | PostEntryHook<mDT> | PostExitHook<mDT>;
|
|
359
|
+
declare type HookDescription<mDT> = BasicHookDescription<mDT> | HookDescriptionWithAction<mDT> | GlobalActionHook<mDT> | AnyActionHook<mDT> | StandardTransitionHook<mDT> | MainTransitionHook<mDT> | ForcedTransitionHook<mDT> | AnyTransitionHook<mDT> | EntryHook<mDT> | ExitHook<mDT> | AfterHook<mDT> | PostBasicHookDescription<mDT> | PostHookDescriptionWithAction<mDT> | PostGlobalActionHook<mDT> | PostAnyActionHook<mDT> | PostStandardTransitionHook<mDT> | PostMainTransitionHook<mDT> | PostForcedTransitionHook<mDT> | PostAnyTransitionHook<mDT> | PostEntryHook<mDT> | PostExitHook<mDT>;
|
|
355
360
|
declare type HookComplexResult<mDT> = {
|
|
356
361
|
pass: boolean;
|
|
357
362
|
state?: StateType;
|
package/dist/es6/jssm_util.d.ts
CHANGED
|
@@ -102,4 +102,5 @@ declare const unique: <T>(arr?: T[]) => T[];
|
|
|
102
102
|
*
|
|
103
103
|
*/
|
|
104
104
|
declare function find_repeated<T>(arr: T[]): [T, number][];
|
|
105
|
-
|
|
105
|
+
declare function sleep(ms: number): Promise<unknown>;
|
|
106
|
+
export { seq, unique, find_repeated, arr_uniq_p, histograph, weighted_histo_key, weighted_rand_select, weighted_sample_select, array_box_if_string, name_bind_prop_and_state, hook_name, named_hook_name, gen_splitmix32, sleep };
|
package/dist/es6/jssm_util.js
CHANGED
|
@@ -174,4 +174,7 @@ function find_repeated(arr) {
|
|
|
174
174
|
return [];
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
|
|
177
|
+
function sleep(ms) {
|
|
178
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
179
|
+
}
|
|
180
|
+
export { seq, unique, find_repeated, arr_uniq_p, histograph, weighted_histo_key, weighted_rand_select, weighted_sample_select, array_box_if_string, name_bind_prop_and_state, hook_name, named_hook_name, gen_splitmix32, sleep };
|
package/dist/es6/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const version = "5.
|
|
1
|
+
const version = "5.99.0", build_time = 1720314479976;
|
|
2
2
|
export { version, build_time };
|