jssm 5.81.0 → 5.82.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/CHANGELOG.md +38 -43
- package/README.md +2 -2
- package/dist/es6/jssm-dot.js +1 -1
- package/dist/es6/jssm.d.ts +7 -5
- package/dist/es6/jssm.js +84 -27
- package/dist/es6/jssm_types.d.ts +25 -4
- package/dist/es6/jssm_types.js +3 -1
- package/dist/es6/{jssm_base_stylesheet.d.ts → themes/jssm_base_stylesheet.d.ts} +3 -2
- package/dist/es6/{jssm_base_stylesheet.js → themes/jssm_base_stylesheet.js} +25 -1
- package/dist/es6/themes/jssm_theme_default.d.ts +11 -0
- package/dist/es6/themes/jssm_theme_default.js +57 -0
- package/dist/es6/themes/jssm_theme_modern.d.ts +11 -0
- package/dist/es6/themes/jssm_theme_modern.js +57 -0
- package/{jssm_base_stylesheet.d.ts → dist/es6/themes/jssm_theme_ocean.d.ts} +3 -2
- package/dist/es6/themes/jssm_theme_ocean.js +55 -0
- package/dist/es6/themes/jssm_theme_plain.d.ts +11 -0
- package/dist/es6/themes/jssm_theme_plain.js +69 -0
- 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 +7 -5
- package/jssm_types.d.ts +25 -4
- package/package.json +1 -1
package/jssm.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare type StateType = string;
|
|
2
2
|
import { JssmGenericState, JssmGenericConfig, JssmStateConfig, JssmTransition, JssmTransitionList, // JssmTransitionRule,
|
|
3
|
-
JssmMachineInternalState, JssmParseTree, JssmStateDeclaration, JssmStateStyleKeyList, JssmArrow, JssmArrowDirection, JssmArrowKind, JssmLayout, JssmHistory, JssmSerialization, FslDirection, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult } from './jssm_types';
|
|
3
|
+
JssmMachineInternalState, JssmParseTree, JssmStateDeclaration, JssmStateStyleKeyList, JssmArrow, JssmArrowDirection, JssmArrowKind, JssmLayout, JssmHistory, JssmSerialization, FslDirection, FslDirections, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult } from './jssm_types';
|
|
4
4
|
import { seq, unique, find_repeated, weighted_rand_select, weighted_sample_select, histograph, weighted_histo_key } from './jssm_util';
|
|
5
5
|
import * as constants from './jssm_constants';
|
|
6
6
|
declare const shapes: string[], gviz_shapes: string[], named_colors: string[];
|
|
@@ -218,7 +218,7 @@ declare class Machine<mDT> {
|
|
|
218
218
|
_arrange_declaration: Array<Array<StateType>>;
|
|
219
219
|
_arrange_start_declaration: Array<Array<StateType>>;
|
|
220
220
|
_arrange_end_declaration: Array<Array<StateType>>;
|
|
221
|
-
|
|
221
|
+
_themes: FslTheme[];
|
|
222
222
|
_flow: FslDirection;
|
|
223
223
|
_has_hooks: boolean;
|
|
224
224
|
_has_basic_hooks: boolean;
|
|
@@ -625,7 +625,9 @@ declare class Machine<mDT> {
|
|
|
625
625
|
list_edges(): Array<JssmTransition<mDT>>;
|
|
626
626
|
list_named_transitions(): Map<StateType, number>;
|
|
627
627
|
list_actions(): Array<StateType>;
|
|
628
|
-
|
|
628
|
+
all_themes(): FslTheme[];
|
|
629
|
+
get themes(): FslTheme[];
|
|
630
|
+
set themes(to: FslTheme | FslTheme[]);
|
|
629
631
|
flow(): FslDirection;
|
|
630
632
|
get_transition_by_state_names(from: StateType, to: StateType): number;
|
|
631
633
|
lookup_transition_for(from: StateType, to: StateType): JssmTransition<mDT>;
|
|
@@ -1070,7 +1072,7 @@ declare class Machine<mDT> {
|
|
|
1070
1072
|
* ```
|
|
1071
1073
|
*
|
|
1072
1074
|
* @typeparam mDT The type of the machine data member; usually omitted
|
|
1073
|
-
|
|
1075
|
+
*
|
|
1074
1076
|
* @param actionName The action to engage
|
|
1075
1077
|
*
|
|
1076
1078
|
* @param newData The data change to insert during the action
|
|
@@ -1209,4 +1211,4 @@ declare function is_hook_complex_result<mDT>(hr: unknown): hr is HookComplexResu
|
|
|
1209
1211
|
declare function is_hook_rejection<mDT>(hr: HookResult<mDT>): boolean;
|
|
1210
1212
|
declare function abstract_hook_step<mDT>(maybe_hook: HookHandler<mDT> | undefined, hook_args: HookContext<mDT>): HookComplexResult<mDT>;
|
|
1211
1213
|
declare function deserialize<mDT>(machine_string: string, ser: JssmSerialization<mDT>): Machine<mDT>;
|
|
1212
|
-
export { version, 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 };
|
|
1214
|
+
export { version, 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 };
|
package/jssm_types.d.ts
CHANGED
|
@@ -24,8 +24,10 @@ declare type JssmArrowKind = 'none' | 'legal' | 'main' | 'forced';
|
|
|
24
24
|
declare type JssmLayout = 'dot' | 'circo' | 'twopi' | 'fdp';
|
|
25
25
|
declare type JssmCorner = 'regular' | 'rounded' | 'lined';
|
|
26
26
|
declare type JssmLineStyle = 'solid' | 'dashed' | 'dotted';
|
|
27
|
-
declare
|
|
28
|
-
declare type
|
|
27
|
+
declare const FslDirections: readonly ["up", "right", "down", "left"];
|
|
28
|
+
declare type FslDirection = typeof FslDirections[number];
|
|
29
|
+
declare const FslThemes: readonly ["default", "ocean", "modern", "plain"];
|
|
30
|
+
declare type FslTheme = typeof FslThemes[number];
|
|
29
31
|
declare type JssmSerialization<DataType> = {
|
|
30
32
|
jssm_version: string;
|
|
31
33
|
timestamp: number;
|
|
@@ -151,11 +153,30 @@ declare type JssmStateStyleBorderColor = {
|
|
|
151
153
|
};
|
|
152
154
|
declare type JssmStateStyleKey = JssmStateStyleShape | JssmStateStyleColor | JssmStateStyleTextColor | JssmStateStyleCorners | JssmStateStyleLineStyle | JssmStateStyleBackgroundColor | JssmStateStyleStateLabel | JssmStateStyleBorderColor;
|
|
153
155
|
declare type JssmStateStyleKeyList = JssmStateStyleKey[];
|
|
156
|
+
declare type JssmBaseTheme = {
|
|
157
|
+
state: JssmStateConfig;
|
|
158
|
+
hooked: JssmStateConfig;
|
|
159
|
+
start: JssmStateConfig;
|
|
160
|
+
end: JssmStateConfig;
|
|
161
|
+
terminal: JssmStateConfig;
|
|
162
|
+
active: JssmStateConfig;
|
|
163
|
+
active_hooked: JssmStateConfig;
|
|
164
|
+
active_start: JssmStateConfig;
|
|
165
|
+
active_end: JssmStateConfig;
|
|
166
|
+
active_terminal: JssmStateConfig;
|
|
167
|
+
graph: undefined;
|
|
168
|
+
legal: undefined;
|
|
169
|
+
main: undefined;
|
|
170
|
+
forced: undefined;
|
|
171
|
+
action: undefined;
|
|
172
|
+
title: undefined;
|
|
173
|
+
};
|
|
174
|
+
declare type JssmTheme = Partial<JssmBaseTheme>;
|
|
154
175
|
declare type JssmGenericConfig<DataType> = {
|
|
155
176
|
graph_layout?: JssmLayout;
|
|
156
177
|
complete?: Array<StateType>;
|
|
157
178
|
transitions: JssmTransitions<DataType>;
|
|
158
|
-
theme?: FslTheme;
|
|
179
|
+
theme?: FslTheme[];
|
|
159
180
|
flow?: FslDirection;
|
|
160
181
|
name?: string;
|
|
161
182
|
data?: DataType;
|
|
@@ -332,4 +353,4 @@ declare type JssmErrorExtendedInfo = {
|
|
|
332
353
|
requested_state?: StateType | undefined;
|
|
333
354
|
};
|
|
334
355
|
declare type JssmHistory<mDT> = circular_buffer<[StateType, mDT]>;
|
|
335
|
-
export { JssmColor, JssmShape, JssmTransition, JssmTransitions, JssmTransitionList, JssmTransitionRule, JssmArrow, JssmArrowKind, JssmArrowDirection, JssmGenericConfig, JssmGenericState, JssmGenericMachine, JssmParseTree, JssmCompileSe, JssmCompileSeStart, JssmCompileRule, JssmPermitted, JssmPermittedOpt, JssmResult, JssmStateDeclaration, JssmStateDeclarationRule, JssmStateConfig, JssmStateStyleKey, JssmStateStyleKeyList, JssmLayout, JssmHistory, JssmSerialization, JssmPropertyDefinition, JssmParseFunctionType, JssmMachineInternalState, JssmErrorExtendedInfo, FslDirection, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult };
|
|
356
|
+
export { JssmColor, JssmShape, JssmTransition, JssmTransitions, JssmTransitionList, JssmTransitionRule, JssmArrow, JssmArrowKind, JssmArrowDirection, JssmGenericConfig, JssmGenericState, JssmGenericMachine, JssmParseTree, JssmCompileSe, JssmCompileSeStart, JssmCompileRule, JssmPermitted, JssmPermittedOpt, JssmResult, JssmStateDeclaration, JssmStateDeclarationRule, JssmStateConfig, JssmStateStyleKey, JssmStateStyleKeyList, JssmBaseTheme, JssmTheme, JssmLayout, JssmHistory, JssmSerialization, JssmPropertyDefinition, JssmParseFunctionType, JssmMachineInternalState, JssmErrorExtendedInfo, FslDirections, FslDirection, FslThemes, FslTheme, HookDescription, HookHandler, HookContext, HookResult, HookComplexResult };
|