jssm 5.62.0 → 5.64.1
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/dist/es6/jssm.d.ts +2 -1
- package/dist/es6/jssm.js +36 -37
- package/dist/es6/jssm_constants.d.ts +4 -0
- package/dist/es6/jssm_constants.js +93 -0
- package/dist/es6/jssm_error.d.ts +8 -0
- package/dist/es6/jssm_error.js +28 -0
- package/dist/es6/jssm_types.d.ts +4 -1
- package/dist/es6/version.js +1 -1
- package/dist/jssm.es5.cjs.js +1 -1
- package/dist/jssm.es5.iife.js +1 -1
- package/jssm.d.ts +2 -1
- package/jssm_constants.d.ts +4 -0
- package/jssm_error.d.ts +8 -0
- package/jssm_types.d.ts +4 -1
- package/package.json +2 -1
package/dist/es6/jssm.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ declare type StateType = string;
|
|
|
2
2
|
import { JssmGenericState, JssmGenericConfig, JssmTransition, JssmTransitionList, // JssmTransitionRule,
|
|
3
3
|
JssmMachineInternalState, JssmParseTree, JssmStateDeclaration, JssmArrow, JssmArrowDirection, JssmArrowKind, JssmLayout, FslDirection, FslTheme, HookDescription, HookHandler } from './jssm_types';
|
|
4
4
|
import { seq, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key } from './jssm_util';
|
|
5
|
+
import { shapes, gviz_shapes, named_colors } from './jssm_constants';
|
|
5
6
|
import { version } from './version';
|
|
6
7
|
declare function arrow_direction(arrow: JssmArrow): JssmArrowDirection;
|
|
7
8
|
declare function arrow_left_kind(arrow: JssmArrow): JssmArrowKind;
|
|
@@ -130,4 +131,4 @@ declare class Machine<mDT> {
|
|
|
130
131
|
}
|
|
131
132
|
declare function sm<mDT>(template_strings: TemplateStringsArray, ...remainder: any[]): Machine<mDT>;
|
|
132
133
|
declare function from<mDT>(MachineAsString: string, ExtraConstructorFields?: Partial<JssmGenericConfig<mDT>> | undefined): Machine<mDT>;
|
|
133
|
-
export { version, transfer_state_properties, Machine, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key };
|
|
134
|
+
export { version, transfer_state_properties, Machine, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind, seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, shapes, gviz_shapes, named_colors };
|
package/dist/es6/jssm.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// whargarbl lots of these return arrays could/should be sets
|
|
2
2
|
import { reduce as reduce_to_639 } from 'reduce-to-639-1';
|
|
3
3
|
import { seq, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key, array_box_if_string, hook_name, named_hook_name } from './jssm_util';
|
|
4
|
-
import {
|
|
4
|
+
import { shapes, gviz_shapes, named_colors } from './jssm_constants';
|
|
5
|
+
import { parse } from './jssm-dot';
|
|
5
6
|
import { version } from './version'; // replaced from package.js in build
|
|
6
|
-
|
|
7
|
-
throw new Error(`${(machine.instance_name !== undefined) ? `[[${machine.instance_name}]]: ` : ''}${message}${machine.state !== undefined ? ` (at ${machine.state})` : ''}`);
|
|
8
|
-
}
|
|
7
|
+
import { JssmError } from './jssm_error';
|
|
9
8
|
/* eslint-disable complexity */
|
|
10
9
|
function arrow_direction(arrow) {
|
|
11
10
|
switch (String(arrow)) {
|
|
@@ -55,7 +54,7 @@ function arrow_direction(arrow) {
|
|
|
55
54
|
case '<~⇒':
|
|
56
55
|
return 'both';
|
|
57
56
|
default:
|
|
58
|
-
|
|
57
|
+
throw new JssmError(undefined, `arrow_direction: unknown arrow type ${arrow}`);
|
|
59
58
|
}
|
|
60
59
|
}
|
|
61
60
|
/* eslint-enable complexity */
|
|
@@ -97,7 +96,7 @@ function arrow_left_kind(arrow) {
|
|
|
97
96
|
case '↚⇒':
|
|
98
97
|
return 'forced';
|
|
99
98
|
default:
|
|
100
|
-
|
|
99
|
+
throw new JssmError(undefined, `arrow_direction: unknown arrow type ${arrow}`);
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
102
|
/* eslint-enable complexity */
|
|
@@ -139,7 +138,7 @@ function arrow_right_kind(arrow) {
|
|
|
139
138
|
case '⇐↛':
|
|
140
139
|
return 'forced';
|
|
141
140
|
default:
|
|
142
|
-
|
|
141
|
+
throw new JssmError(undefined, `arrow_direction: unknown arrow type ${arrow}`);
|
|
143
142
|
}
|
|
144
143
|
}
|
|
145
144
|
/* eslint-enable complexity */
|
|
@@ -151,13 +150,13 @@ function makeTransition(this_se, from, to, isRight, _wasList, _wasIndex) {
|
|
|
151
150
|
forced_only: kind === 'forced',
|
|
152
151
|
main_path: kind === 'main'
|
|
153
152
|
};
|
|
154
|
-
// if ((wasList !== undefined) && (wasIndex === undefined)) {
|
|
155
|
-
// if ((wasIndex !== undefined) && (wasList === undefined)) {
|
|
153
|
+
// if ((wasList !== undefined) && (wasIndex === undefined)) { throw new JssmError(undefined, `Must have an index if transition was in a list"); }
|
|
154
|
+
// if ((wasIndex !== undefined) && (wasList === undefined)) { throw new JssmError(undefined, `Must be in a list if transition has an index"); }
|
|
156
155
|
/*
|
|
157
156
|
if (typeof edge.to === 'object') {
|
|
158
157
|
|
|
159
158
|
if (edge.to.key === 'cycle') {
|
|
160
|
-
if (wasList === undefined) {
|
|
159
|
+
if (wasList === undefined) { throw new JssmError(undefined, "Must have a waslist if a to is type cycle"); }
|
|
161
160
|
const nextIndex = wrapBy(wasIndex, edge.to.value, wasList.length);
|
|
162
161
|
edge.to = wasList[nextIndex];
|
|
163
162
|
}
|
|
@@ -211,7 +210,7 @@ function compile_rule_handler(rule) {
|
|
|
211
210
|
}
|
|
212
211
|
if (rule.key === 'state_declaration') {
|
|
213
212
|
if (!rule.name) {
|
|
214
|
-
|
|
213
|
+
throw new JssmError(undefined, 'State declarations must have a name');
|
|
215
214
|
}
|
|
216
215
|
return { agg_as: 'state_declaration', val: { state: rule.name, declarations: rule.value } };
|
|
217
216
|
}
|
|
@@ -228,7 +227,7 @@ function compile_rule_handler(rule) {
|
|
|
228
227
|
if (tautologies.includes(rule.key)) {
|
|
229
228
|
return { agg_as: rule.key, val: rule.value };
|
|
230
229
|
}
|
|
231
|
-
|
|
230
|
+
throw new JssmError(undefined, `compile_rule_handler: Unknown rule: ${JSON.stringify(rule)}`);
|
|
232
231
|
}
|
|
233
232
|
function compile(tree) {
|
|
234
233
|
const results = {
|
|
@@ -271,7 +270,7 @@ function compile(tree) {
|
|
|
271
270
|
];
|
|
272
271
|
oneOnlyKeys.map((oneOnlyKey) => {
|
|
273
272
|
if (results[oneOnlyKey].length > 1) {
|
|
274
|
-
|
|
273
|
+
throw new JssmError(undefined, `May only have one ${oneOnlyKey} statement maximum: ${JSON.stringify(results[oneOnlyKey])}`);
|
|
275
274
|
}
|
|
276
275
|
else {
|
|
277
276
|
if (results[oneOnlyKey].length) {
|
|
@@ -314,7 +313,7 @@ function transfer_state_properties(state_decl) {
|
|
|
314
313
|
case 'border-color':
|
|
315
314
|
state_decl.borderColor = d.value;
|
|
316
315
|
break;
|
|
317
|
-
default:
|
|
316
|
+
default: throw new JssmError(undefined, `Unknown state property: '${JSON.stringify(d)}'`);
|
|
318
317
|
}
|
|
319
318
|
});
|
|
320
319
|
return state_decl;
|
|
@@ -371,17 +370,17 @@ class Machine {
|
|
|
371
370
|
if (state_declaration) {
|
|
372
371
|
state_declaration.map((state_decl) => {
|
|
373
372
|
if (this._state_declarations.has(state_decl.state)) { // no repeats
|
|
374
|
-
|
|
373
|
+
throw new JssmError(this, `Added the same state declaration twice: ${JSON.stringify(state_decl.state)}`);
|
|
375
374
|
}
|
|
376
375
|
this._state_declarations.set(state_decl.state, transfer_state_properties(state_decl));
|
|
377
376
|
});
|
|
378
377
|
}
|
|
379
378
|
transitions.map((tr) => {
|
|
380
379
|
if (tr.from === undefined) {
|
|
381
|
-
|
|
380
|
+
throw new JssmError(this, `transition must define 'from': ${JSON.stringify(tr)}`);
|
|
382
381
|
}
|
|
383
382
|
if (tr.to === undefined) {
|
|
384
|
-
|
|
383
|
+
throw new JssmError(this, `transition must define 'to': ${JSON.stringify(tr)}`);
|
|
385
384
|
}
|
|
386
385
|
// get the cursors. what a mess
|
|
387
386
|
const cursor_from = this._states.get(tr.from)
|
|
@@ -396,7 +395,7 @@ class Machine {
|
|
|
396
395
|
}
|
|
397
396
|
// guard against existing connections being re-added
|
|
398
397
|
if (cursor_from.to.includes(tr.to)) {
|
|
399
|
-
|
|
398
|
+
throw new JssmError(this, `already has ${JSON.stringify(tr.from)} to ${JSON.stringify(tr.to)}`);
|
|
400
399
|
}
|
|
401
400
|
else {
|
|
402
401
|
cursor_from.to.push(tr.to);
|
|
@@ -408,7 +407,7 @@ class Machine {
|
|
|
408
407
|
// guard against repeating a transition name
|
|
409
408
|
if (tr.name) {
|
|
410
409
|
if (this._named_transitions.has(tr.name)) {
|
|
411
|
-
|
|
410
|
+
throw new JssmError(this, `named transition "${JSON.stringify(tr.name)}" already created`);
|
|
412
411
|
}
|
|
413
412
|
else {
|
|
414
413
|
this._named_transitions.set(tr.name, thisEdgeId);
|
|
@@ -430,7 +429,7 @@ class Machine {
|
|
|
430
429
|
this._actions.set(tr.action, actionMap);
|
|
431
430
|
}
|
|
432
431
|
if (actionMap.has(tr.from)) {
|
|
433
|
-
|
|
432
|
+
throw new JssmError(this, `action ${JSON.stringify(tr.action)} already attached to origin ${JSON.stringify(tr.from)}`);
|
|
434
433
|
}
|
|
435
434
|
else {
|
|
436
435
|
actionMap.set(tr.from, thisEdgeId);
|
|
@@ -453,12 +452,12 @@ class Machine {
|
|
|
453
452
|
const roActionMap = this._reverse_action_targets.get(tr.to); // wasteful - already did has - refactor
|
|
454
453
|
if (roActionMap) {
|
|
455
454
|
if (roActionMap.has(tr.action)) {
|
|
456
|
-
|
|
455
|
+
throw new JssmError(this, `ro-action ${tr.to} already attached to action ${tr.action}`);
|
|
457
456
|
} else {
|
|
458
457
|
roActionMap.set(tr.action, thisEdgeId);
|
|
459
458
|
}
|
|
460
459
|
} else {
|
|
461
|
-
|
|
460
|
+
throw new JssmError(this, `should be impossible - flow doesn\'t know .set precedes .get yet again. severe error?');
|
|
462
461
|
}
|
|
463
462
|
*/
|
|
464
463
|
}
|
|
@@ -466,7 +465,7 @@ class Machine {
|
|
|
466
465
|
}
|
|
467
466
|
_new_state(state_config) {
|
|
468
467
|
if (this._states.has(state_config.name)) {
|
|
469
|
-
|
|
468
|
+
throw new JssmError(this, `state ${JSON.stringify(state_config.name)} already exists`);
|
|
470
469
|
}
|
|
471
470
|
this._states.set(state_config.name, state_config);
|
|
472
471
|
return state_config.name;
|
|
@@ -538,7 +537,7 @@ class Machine {
|
|
|
538
537
|
edges: this._edges,
|
|
539
538
|
named_transitions: this._named_transitions,
|
|
540
539
|
reverse_actions: this._reverse_actions,
|
|
541
|
-
//
|
|
540
|
+
// reverse_action_targets : this._reverse_action_targets,
|
|
542
541
|
state: this._state,
|
|
543
542
|
states: this._states
|
|
544
543
|
};
|
|
@@ -557,7 +556,7 @@ class Machine {
|
|
|
557
556
|
return state;
|
|
558
557
|
}
|
|
559
558
|
else {
|
|
560
|
-
|
|
559
|
+
throw new JssmError(this, 'No such state', { requested_state: whichState });
|
|
561
560
|
}
|
|
562
561
|
}
|
|
563
562
|
has_state(whichState) {
|
|
@@ -607,7 +606,7 @@ class Machine {
|
|
|
607
606
|
probable_exits_for(whichState) {
|
|
608
607
|
const wstate = this._states.get(whichState);
|
|
609
608
|
if (!(wstate)) {
|
|
610
|
-
|
|
609
|
+
throw new JssmError(this, `No such state ${JSON.stringify(whichState)} in probable_exits_for`);
|
|
611
610
|
}
|
|
612
611
|
const wstate_to = wstate.to, wtf = wstate_to
|
|
613
612
|
.map((ws) => this.lookup_transition_for(this.state(), ws))
|
|
@@ -636,7 +635,7 @@ class Machine {
|
|
|
636
635
|
return Array.from(wstate.keys());
|
|
637
636
|
}
|
|
638
637
|
else {
|
|
639
|
-
|
|
638
|
+
throw new JssmError(this, `No such state ${JSON.stringify(whichState)}`);
|
|
640
639
|
}
|
|
641
640
|
}
|
|
642
641
|
list_states_having_action(whichState) {
|
|
@@ -645,7 +644,7 @@ class Machine {
|
|
|
645
644
|
return Array.from(wstate.keys());
|
|
646
645
|
}
|
|
647
646
|
else {
|
|
648
|
-
|
|
647
|
+
throw new JssmError(this, `No such state ${JSON.stringify(whichState)}`);
|
|
649
648
|
}
|
|
650
649
|
}
|
|
651
650
|
// comeback
|
|
@@ -660,7 +659,7 @@ class Machine {
|
|
|
660
659
|
list_exit_actions(whichState = this.state()) {
|
|
661
660
|
const ra_base = this._reverse_actions.get(whichState);
|
|
662
661
|
if (!(ra_base)) {
|
|
663
|
-
|
|
662
|
+
throw new JssmError(this, `No such state ${JSON.stringify(whichState)}`);
|
|
664
663
|
}
|
|
665
664
|
return Array.from(ra_base.values())
|
|
666
665
|
.map((edgeId) => this._edges[edgeId])
|
|
@@ -670,7 +669,7 @@ class Machine {
|
|
|
670
669
|
probable_action_exits(whichState = this.state()) {
|
|
671
670
|
const ra_base = this._reverse_actions.get(whichState);
|
|
672
671
|
if (!(ra_base)) {
|
|
673
|
-
|
|
672
|
+
throw new JssmError(this, `No such state ${JSON.stringify(whichState)}`);
|
|
674
673
|
}
|
|
675
674
|
return Array.from(ra_base.values())
|
|
676
675
|
.map((edgeId) => this._edges[edgeId])
|
|
@@ -683,7 +682,7 @@ class Machine {
|
|
|
683
682
|
// TODO FIXME test that is_unenterable on non-state throws
|
|
684
683
|
is_unenterable(whichState) {
|
|
685
684
|
if (!(this.has_state(whichState))) {
|
|
686
|
-
|
|
685
|
+
throw new JssmError(this, `No such state ${whichState}`);
|
|
687
686
|
}
|
|
688
687
|
return this.list_entrances(whichState).length === 0;
|
|
689
688
|
}
|
|
@@ -696,7 +695,7 @@ class Machine {
|
|
|
696
695
|
// TODO FIXME test that state_is_terminal on non-state throws
|
|
697
696
|
state_is_terminal(whichState) {
|
|
698
697
|
if (!(this.has_state(whichState))) {
|
|
699
|
-
|
|
698
|
+
throw new JssmError(this, `No such state ${whichState}`);
|
|
700
699
|
}
|
|
701
700
|
return this.list_exits(whichState).length === 0;
|
|
702
701
|
}
|
|
@@ -712,7 +711,7 @@ class Machine {
|
|
|
712
711
|
return wstate.complete;
|
|
713
712
|
}
|
|
714
713
|
else {
|
|
715
|
-
|
|
714
|
+
throw new JssmError(this, `No such state ${JSON.stringify(whichState)}`);
|
|
716
715
|
}
|
|
717
716
|
}
|
|
718
717
|
has_completes() {
|
|
@@ -771,7 +770,7 @@ class Machine {
|
|
|
771
770
|
this._has_exit_hooks = true;
|
|
772
771
|
break;
|
|
773
772
|
default:
|
|
774
|
-
|
|
773
|
+
throw new JssmError(this, `Unknown hook type ${HookDesc.kind}, should be impossible`);
|
|
775
774
|
}
|
|
776
775
|
}
|
|
777
776
|
hook(from, to, handler) {
|
|
@@ -825,7 +824,7 @@ class Machine {
|
|
|
825
824
|
return this;
|
|
826
825
|
}
|
|
827
826
|
// remove_hook(HookDesc: HookDescription) {
|
|
828
|
-
//
|
|
827
|
+
// throw new JssmError(this, 'TODO: Should remove hook here');
|
|
829
828
|
// }
|
|
830
829
|
edges_between(from, to) {
|
|
831
830
|
return this._edges.filter(edge => ((edge.from === from) && (edge.to === to)));
|
|
@@ -985,7 +984,7 @@ class Machine {
|
|
|
985
984
|
current_action_edge_for(action) {
|
|
986
985
|
const idx = this.current_action_for(action);
|
|
987
986
|
if ((idx === undefined) || (idx === null)) {
|
|
988
|
-
|
|
987
|
+
throw new JssmError(this, `No such action ${JSON.stringify(action)}`);
|
|
989
988
|
}
|
|
990
989
|
return this._edges[idx];
|
|
991
990
|
}
|
|
@@ -1042,4 +1041,4 @@ function from(MachineAsString, ExtraConstructorFields) {
|
|
|
1042
1041
|
}
|
|
1043
1042
|
export { version, transfer_state_properties, Machine, make, wrap_parse as parse, compile, sm, from, arrow_direction, arrow_left_kind, arrow_right_kind,
|
|
1044
1043
|
// WHARGARBL TODO these should be exported to a utility library
|
|
1045
|
-
seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key };
|
|
1044
|
+
seq, weighted_rand_select, histograph, weighted_sample_select, weighted_histo_key, shapes, gviz_shapes, named_colors };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const gviz_shapes = [
|
|
2
|
+
"box3d",
|
|
3
|
+
"polygon",
|
|
4
|
+
"ellipse",
|
|
5
|
+
"oval",
|
|
6
|
+
"circle",
|
|
7
|
+
"point",
|
|
8
|
+
"egg",
|
|
9
|
+
"triangle",
|
|
10
|
+
"plaintext",
|
|
11
|
+
"plain",
|
|
12
|
+
"diamond",
|
|
13
|
+
"trapezium",
|
|
14
|
+
"parallelogram",
|
|
15
|
+
"house",
|
|
16
|
+
"pentagon",
|
|
17
|
+
"hexagon",
|
|
18
|
+
"septagon",
|
|
19
|
+
"octagon",
|
|
20
|
+
"doublecircle",
|
|
21
|
+
"doubleoctagon",
|
|
22
|
+
"tripleoctagon",
|
|
23
|
+
"invtriangle",
|
|
24
|
+
"invtrapezium",
|
|
25
|
+
"invhouse",
|
|
26
|
+
"Mdiamond",
|
|
27
|
+
"Msquare",
|
|
28
|
+
"Mcircle",
|
|
29
|
+
"rectangle",
|
|
30
|
+
"rect",
|
|
31
|
+
"square",
|
|
32
|
+
"star",
|
|
33
|
+
"none",
|
|
34
|
+
"underline",
|
|
35
|
+
"cylinder",
|
|
36
|
+
"note",
|
|
37
|
+
"tab",
|
|
38
|
+
"folder",
|
|
39
|
+
"box",
|
|
40
|
+
"component",
|
|
41
|
+
"promoter",
|
|
42
|
+
"cds",
|
|
43
|
+
"terminator",
|
|
44
|
+
"utr",
|
|
45
|
+
"primersite",
|
|
46
|
+
"restrictionsite",
|
|
47
|
+
"fivepoverhang",
|
|
48
|
+
"threepoverhang",
|
|
49
|
+
"noverhang",
|
|
50
|
+
"assembly",
|
|
51
|
+
"signature",
|
|
52
|
+
"insulator",
|
|
53
|
+
"ribosite",
|
|
54
|
+
"rnastab",
|
|
55
|
+
"proteasesite",
|
|
56
|
+
"proteinstab",
|
|
57
|
+
"rpromoter",
|
|
58
|
+
"rarrow",
|
|
59
|
+
"larrow",
|
|
60
|
+
"lpromoter",
|
|
61
|
+
"record"
|
|
62
|
+
];
|
|
63
|
+
const shapes = gviz_shapes;
|
|
64
|
+
const named_colors = [
|
|
65
|
+
"AliceBlue", "AntiqueWhite", "Aqua", "Aquamarine", "Azure", "Beige",
|
|
66
|
+
"Bisque", "Black", "BlanchedAlmond", "Blue", "BlueViolet", "Brown",
|
|
67
|
+
"BurlyWood", "CadetBlue", "Chartreuse", "Chocolate", "Coral",
|
|
68
|
+
"CornflowerBlue", "Cornsilk", "Crimson", "Cyan", "DarkBlue", "DarkCyan",
|
|
69
|
+
"DarkGoldenRod", "DarkGray", "DarkGrey", "DarkGreen", "DarkKhaki",
|
|
70
|
+
"DarkMagenta", "DarkOliveGreen", "Darkorange", "DarkOrchid", "DarkRed",
|
|
71
|
+
"DarkSalmon", "DarkSeaGreen", "DarkSlateBlue", "DarkSlateGray",
|
|
72
|
+
"DarkSlateGrey", "DarkTurquoise", "DarkViolet", "DeepPink", "DeepSkyBlue",
|
|
73
|
+
"DimGray", "DimGrey", "DodgerBlue", "FireBrick", "FloralWhite", "ForestGreen",
|
|
74
|
+
"Fuchsia", "Gainsboro", "GhostWhite", "Gold", "GoldenRod", "Gray", "Grey",
|
|
75
|
+
"Green", "GreenYellow", "HoneyDew", "HotPink", "IndianRed", "Indigo", "Ivory",
|
|
76
|
+
"Khaki", "Lavender", "LavenderBlush", "LawnGreen", "LemonChiffon",
|
|
77
|
+
"LightBlue", "LightCoral", "LightCyan", "LightGoldenRodYellow", "LightGray",
|
|
78
|
+
"LightGrey", "LightGreen", "LightPink", "LightSalmon", "LightSeaGreen",
|
|
79
|
+
"LightSkyBlue", "LightSlateGray", "LightSlateGrey", "LightSteelBlue",
|
|
80
|
+
"LightYellow", "Lime", "LimeGreen", "Linen", "Magenta", "Maroon",
|
|
81
|
+
"MediumAquaMarine", "MediumBlue", "MediumOrchid", "MediumPurple",
|
|
82
|
+
"MediumSeaGreen", "MediumSlateBlue", "MediumSpringGreen", "MediumTurquoise",
|
|
83
|
+
"MediumVioletRed", "MidnightBlue", "MintCream", "MistyRose", "Moccasin",
|
|
84
|
+
"NavajoWhite", "Navy", "OldLace", "Olive", "OliveDrab", "Orange", "OrangeRed",
|
|
85
|
+
"Orchid", "PaleGoldenRod", "PaleGreen", "PaleTurquoise", "PaleVioletRed",
|
|
86
|
+
"PapayaWhip", "PeachPuff", "Peru", "Pink", "Plum", "PowderBlue", "Purple",
|
|
87
|
+
"Red", "RosyBrown", "RoyalBlue", "SaddleBrown", "Salmon", "SandyBrown",
|
|
88
|
+
"SeaGreen", "SeaShell", "Sienna", "Silver", "SkyBlue", "SlateBlue",
|
|
89
|
+
"SlateGray", "SlateGrey", "Snow", "SpringGreen", "SteelBlue", "Tan", "Teal",
|
|
90
|
+
"Thistle", "Tomato", "Turquoise", "Violet", "Wheat", "White", "WhiteSmoke",
|
|
91
|
+
"Yellow", "YellowGreen"
|
|
92
|
+
];
|
|
93
|
+
export { gviz_shapes, shapes, named_colors };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { JssmErrorExtendedInfo } from './jssm_types';
|
|
2
|
+
declare class JssmError extends Error {
|
|
3
|
+
message: string;
|
|
4
|
+
base_message: string;
|
|
5
|
+
requested_state: string | undefined;
|
|
6
|
+
constructor(machine: any, message: string, JEEI?: JssmErrorExtendedInfo);
|
|
7
|
+
}
|
|
8
|
+
export { JssmError };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
class JssmError extends Error {
|
|
2
|
+
constructor(machine, message, JEEI) {
|
|
3
|
+
const { requested_state } = (JEEI === undefined)
|
|
4
|
+
? { requested_state: undefined }
|
|
5
|
+
: JEEI;
|
|
6
|
+
const follow_ups = [];
|
|
7
|
+
if (machine) {
|
|
8
|
+
if (machine.state() !== undefined) {
|
|
9
|
+
follow_ups.push(`at "${machine.state()}"`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
if (requested_state !== undefined) {
|
|
13
|
+
follow_ups.push(`requested "${requested_state}"`);
|
|
14
|
+
}
|
|
15
|
+
const complex_msg = `${((machine === null || machine === void 0 ? void 0 : machine.instance_name()) !== undefined)
|
|
16
|
+
? `[[${machine.instance_name()}]]: `
|
|
17
|
+
: ''}${message}${follow_ups.length
|
|
18
|
+
? ` (${follow_ups.join(', ')})`
|
|
19
|
+
: ''}`;
|
|
20
|
+
super(complex_msg);
|
|
21
|
+
this.name = 'JssmError';
|
|
22
|
+
this.message = complex_msg;
|
|
23
|
+
this.base_message = message;
|
|
24
|
+
this.requested_state = requested_state;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
;
|
|
28
|
+
export { JssmError };
|
package/dist/es6/jssm_types.d.ts
CHANGED
|
@@ -199,4 +199,7 @@ declare type ExitHook = {
|
|
|
199
199
|
handler: HookHandler;
|
|
200
200
|
};
|
|
201
201
|
declare type HookDescription = BasicHookDescription | HookDescriptionWithAction | GlobalActionHook | AnyActionHook | StandardTransitionHook | MainTransitionHook | ForcedTransitionHook | AnyTransitionHook | EntryHook | ExitHook;
|
|
202
|
-
|
|
202
|
+
declare type JssmErrorExtendedInfo = {
|
|
203
|
+
requested_state?: StateType | undefined;
|
|
204
|
+
};
|
|
205
|
+
export { JssmColor, JssmTransition, JssmTransitions, JssmTransitionList, JssmTransitionRule, JssmArrow, JssmArrowKind, JssmArrowDirection, JssmGenericConfig, JssmGenericState, JssmGenericMachine, JssmParseTree, JssmCompileSe, JssmCompileSeStart, JssmCompileRule, JssmPermitted, JssmPermittedOpt, JssmResult, JssmStateDeclaration, JssmStateDeclarationRule, JssmLayout, JssmParseFunctionType, JssmMachineInternalState, JssmErrorExtendedInfo, FslDirection, FslTheme, HookDescription, HookHandler };
|
package/dist/es6/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const version = "5.
|
|
1
|
+
const version = "5.64.1";
|
|
2
2
|
export { version };
|