jssm 5.97.1 → 5.98.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 +35 -50
- package/README.md +6 -6
- package/dist/es6/jssm.d.ts +1 -1
- package/dist/es6/jssm.js +14 -2
- package/dist/es6/jssm_types.d.ts +2 -0
- 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 +15 -3
- package/dist/jssm.es5.nonmin.cjs +15 -3
- package/dist/jssm.es6.mjs +1 -1
- package/dist/jssm.es6.nonmin.cjs +15 -3
- package/jssm.d.ts +1 -1
- package/jssm_types.d.ts +2 -0
- package/package.json +1 -1
package/dist/jssm.es6.nonmin.cjs
CHANGED
|
@@ -20651,7 +20651,7 @@ var constants = /*#__PURE__*/Object.freeze({
|
|
|
20651
20651
|
named_colors: named_colors$1
|
|
20652
20652
|
});
|
|
20653
20653
|
|
|
20654
|
-
const version = "5.
|
|
20654
|
+
const version = "5.98.0", build_time = 1711419354245;
|
|
20655
20655
|
|
|
20656
20656
|
// whargarbl lots of these return arrays could/should be sets
|
|
20657
20657
|
const { shapes, gviz_shapes, named_colors } = constants;
|
|
@@ -20770,11 +20770,10 @@ function state_style_condense(jssk) {
|
|
|
20770
20770
|
// TODO add a lotta docblock here
|
|
20771
20771
|
class Machine {
|
|
20772
20772
|
// whargarbl this badly needs to be broken up, monolith master
|
|
20773
|
-
constructor({ start_states, end_states = [], complete = [], transitions, machine_author, machine_comment, machine_contributor, machine_definition, machine_language, machine_license, machine_name, machine_version, state_declaration, property_definition, state_property, fsl_version, dot_preamble = undefined, arrange_declaration = [], arrange_start_declaration = [], arrange_end_declaration = [], theme = ['default'], flow = 'down', graph_layout = 'dot', instance_name, history, data, default_state_config, default_active_state_config, default_hooked_state_config, default_terminal_state_config, default_start_state_config, default_end_state_config, allows_override, config_allows_override, rng_seed, time_source, timeout_source, clear_timeout_source }) {
|
|
20773
|
+
constructor({ start_states, end_states = [], initial_state, start_states_no_enforce, complete = [], transitions, machine_author, machine_comment, machine_contributor, machine_definition, machine_language, machine_license, machine_name, machine_version, state_declaration, property_definition, state_property, fsl_version, dot_preamble = undefined, arrange_declaration = [], arrange_start_declaration = [], arrange_end_declaration = [], theme = ['default'], flow = 'down', graph_layout = 'dot', instance_name, history, data, default_state_config, default_active_state_config, default_hooked_state_config, default_terminal_state_config, default_start_state_config, default_end_state_config, allows_override, config_allows_override, rng_seed, time_source, timeout_source, clear_timeout_source }) {
|
|
20774
20774
|
this._time_source = () => new Date().getTime();
|
|
20775
20775
|
this._create_started = this._time_source();
|
|
20776
20776
|
this._instance_name = instance_name;
|
|
20777
|
-
this._state = start_states[0];
|
|
20778
20777
|
this._states = new Map();
|
|
20779
20778
|
this._state_declarations = new Map();
|
|
20780
20779
|
this._edges = [];
|
|
@@ -20996,6 +20995,19 @@ class Machine {
|
|
|
20996
20995
|
this._state_properties.set(sp.name, sp.default_value);
|
|
20997
20996
|
});
|
|
20998
20997
|
}
|
|
20998
|
+
// set initial state either from the specified or the start state list. validate admission behavior.
|
|
20999
|
+
if (initial_state) {
|
|
21000
|
+
if (!(this._states.has(initial_state))) {
|
|
21001
|
+
throw new JssmError(this, `requested start state ${initial_state} does not exist`);
|
|
21002
|
+
}
|
|
21003
|
+
if ((!(start_states_no_enforce)) && (!(start_states.includes(initial_state)))) {
|
|
21004
|
+
throw new JssmError(this, `requested start state ${initial_state} is not in start state list; add {start_states_no_enforce:true} to constructor options if desired`);
|
|
21005
|
+
}
|
|
21006
|
+
this._state = initial_state;
|
|
21007
|
+
}
|
|
21008
|
+
else {
|
|
21009
|
+
this._state = start_states[0];
|
|
21010
|
+
}
|
|
20999
21011
|
// done building, do checks
|
|
21000
21012
|
// assert all props are valid
|
|
21001
21013
|
this._state_properties.forEach((_value, key) => {
|
package/jssm.d.ts
CHANGED
|
@@ -110,7 +110,7 @@ declare class Machine<mDT> {
|
|
|
110
110
|
_timeout_handle: number | undefined;
|
|
111
111
|
_timeout_target: string | undefined;
|
|
112
112
|
_timeout_target_time: number | undefined;
|
|
113
|
-
constructor({ start_states, end_states, complete, transitions, machine_author, machine_comment, machine_contributor, machine_definition, machine_language, machine_license, machine_name, machine_version, state_declaration, property_definition, state_property, fsl_version, dot_preamble, arrange_declaration, arrange_start_declaration, arrange_end_declaration, theme, flow, graph_layout, instance_name, history, data, default_state_config, default_active_state_config, default_hooked_state_config, default_terminal_state_config, default_start_state_config, default_end_state_config, allows_override, config_allows_override, rng_seed, time_source, timeout_source, clear_timeout_source }: JssmGenericConfig<StateType, mDT>);
|
|
113
|
+
constructor({ start_states, end_states, initial_state, start_states_no_enforce, complete, transitions, machine_author, machine_comment, machine_contributor, machine_definition, machine_language, machine_license, machine_name, machine_version, state_declaration, property_definition, state_property, fsl_version, dot_preamble, arrange_declaration, arrange_start_declaration, arrange_end_declaration, theme, flow, graph_layout, instance_name, history, data, default_state_config, default_active_state_config, default_hooked_state_config, default_terminal_state_config, default_start_state_config, default_end_state_config, allows_override, config_allows_override, rng_seed, time_source, timeout_source, clear_timeout_source }: JssmGenericConfig<StateType, mDT>);
|
|
114
114
|
/********
|
|
115
115
|
*
|
|
116
116
|
* Internal method for fabricating states. Not meant for external use.
|
package/jssm_types.d.ts
CHANGED
|
@@ -198,6 +198,8 @@ declare type JssmGenericConfig<StateType, DataType> = {
|
|
|
198
198
|
dot_preamble?: string;
|
|
199
199
|
start_states: Array<StateType>;
|
|
200
200
|
end_states?: Array<StateType>;
|
|
201
|
+
initial_state?: StateType;
|
|
202
|
+
start_states_no_enforce?: boolean;
|
|
201
203
|
state_declaration?: Object[];
|
|
202
204
|
property_definition?: JssmPropertyDefinition[];
|
|
203
205
|
state_property?: JssmPropertyDefinition[];
|