jssm 5.122.4 → 5.124.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/README.md +6 -6
- package/dist/cdn/viz.js +22 -15
- package/dist/cli/fsl-render.cjs +1 -1
- package/dist/cli/fsl.cjs +1 -1
- package/dist/deno/README.md +6 -6
- package/dist/deno/jssm.js +1 -1
- package/dist/deno/jssm_viz.d.ts +37 -33
- package/dist/jssm.es5.cjs +1 -1
- package/dist/jssm.es5.iife.js +1 -1
- package/dist/jssm.es6.mjs +1 -1
- package/dist/jssm_viz.cjs +1 -1
- package/dist/jssm_viz.iife.cjs +1 -1
- package/dist/jssm_viz.mjs +1 -1
- package/jssm_viz.es5.d.cts +37 -33
- package/jssm_viz.es6.d.ts +37 -33
- package/package.json +1 -1
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.124.0 at 5/19/2026, 9:06:59 AM
|
|
22
22
|
|
|
23
23
|
-->
|
|
24
|
-
# jssm 5.
|
|
24
|
+
# jssm 5.124.0
|
|
25
25
|
|
|
26
26
|
[**Try the live editor**](https://stonecypher.github.io/jssm-viz-demo/graph_explorer.html) ·
|
|
27
27
|
[Documentation](https://stonecypher.github.io/jssm/docs/) ·
|
|
@@ -281,7 +281,7 @@ That decision shows up everywhere downstream:
|
|
|
281
281
|
or run `npm run benny` against your own machine.
|
|
282
282
|
|
|
283
283
|
- **More thoroughly tested than any other JavaScript state-machine
|
|
284
|
-
library.** 6,
|
|
284
|
+
library.** 6,064 tests at 100.0% line coverage
|
|
285
285
|
([report](https://coveralls.io/github/StoneCypher/jssm)), plus
|
|
286
286
|
fuzz testing via `fast-check`, with parser test data across ten natural
|
|
287
287
|
languages and Emoji.
|
|
@@ -414,11 +414,11 @@ If your contribution is missing here, please open an issue.
|
|
|
414
414
|
|
|
415
415
|
<br/>
|
|
416
416
|
|
|
417
|
-
***6,
|
|
417
|
+
***6,064 tests***, run 56,851 times.
|
|
418
418
|
|
|
419
|
-
- 5,
|
|
419
|
+
- 5,551 specs with 100.0% coverage
|
|
420
420
|
- 513 fuzz tests with 4.5% coverage
|
|
421
|
-
- 4,
|
|
421
|
+
- 4,331 TypeScript lines - 1.4 tests per line, 13.1 generated tests per line
|
|
422
422
|
|
|
423
423
|
[](https://github.com/StoneCypher/jssm/actions)
|
|
424
424
|
[](https://www.npmjs.com/package/jssm)
|
package/dist/cdn/viz.js
CHANGED
|
@@ -21041,7 +21041,7 @@ var constants = /*#__PURE__*/Object.freeze({
|
|
|
21041
21041
|
* Useful for runtime diagnostics and for embedding in serialized machine
|
|
21042
21042
|
* snapshots so that deserializers can detect version-skew.
|
|
21043
21043
|
*/
|
|
21044
|
-
const version = "5.
|
|
21044
|
+
const version = "5.124.0";
|
|
21045
21045
|
|
|
21046
21046
|
// whargarbl lots of these return arrays could/should be sets
|
|
21047
21047
|
const { state_name_chars, state_name_first_chars, action_label_chars } = constants;
|
|
@@ -24504,15 +24504,21 @@ function default_fillcolor_for(kind) {
|
|
|
24504
24504
|
* honoured uniformly. A single `style_for` call per state — downstream
|
|
24505
24505
|
* helpers operate on the cached result rather than re-querying.
|
|
24506
24506
|
*
|
|
24507
|
+
* When `hide_state_labels` is true, the `label=` attribute is omitted from
|
|
24508
|
+
* every state's node line; Graphviz then renders the node box without any
|
|
24509
|
+
* text inside. Useful for diagrams where the state shape carries meaning
|
|
24510
|
+
* on its own (e.g. a tutorial graphic, an icon-only diagram, or a
|
|
24511
|
+
* presentation slide).
|
|
24512
|
+
*
|
|
24507
24513
|
* @internal
|
|
24508
24514
|
*/
|
|
24509
|
-
function states_to_nodes_string(u_jssm, l_states, state_index, state_kinds) {
|
|
24515
|
+
function states_to_nodes_string(u_jssm, l_states, state_index, state_kinds, hide_state_labels = false) {
|
|
24510
24516
|
return l_states.map((s) => {
|
|
24511
24517
|
var _a;
|
|
24512
24518
|
const style = u_jssm.style_for(s);
|
|
24513
24519
|
const fillcolor = style.backgroundColor || default_fillcolor_for((_a = state_kinds.get(s)) !== null && _a !== void 0 ? _a : 'base');
|
|
24514
24520
|
const features = [
|
|
24515
|
-
['label', u_jssm.display_text(s)],
|
|
24521
|
+
['label', hide_state_labels ? '' : u_jssm.display_text(s)],
|
|
24516
24522
|
['shape', style.shape || ''],
|
|
24517
24523
|
['color', style.borderColor || ''],
|
|
24518
24524
|
['style', compose_style_string(style)],
|
|
@@ -24686,21 +24692,23 @@ function arranges_for(u_jssm, state_index) {
|
|
|
24686
24692
|
* const dot = machine_to_dot(sm`a -> b;`);
|
|
24687
24693
|
* // 'digraph G { ... }'
|
|
24688
24694
|
*
|
|
24695
|
+
* // suppress state-name labels (boxes only, no text inside)
|
|
24696
|
+
* const dot2 = machine_to_dot(sm`a -> b;`, { hide_state_labels: true });
|
|
24697
|
+
*
|
|
24689
24698
|
* const dot_with_footer = machine_to_dot(sm`a -> b;`, { footer: 'labelloc="b"; label="caption";' });
|
|
24690
24699
|
* // 'digraph G { ... labelloc="b"; label="caption"; }'
|
|
24691
24700
|
* ```
|
|
24692
24701
|
*
|
|
24693
24702
|
* @param u_jssm The machine to render.
|
|
24694
|
-
* @param opts Optional
|
|
24695
|
-
* @param opts.footer Optional verbatim dot source inserted just before the closing `}`.
|
|
24703
|
+
* @param opts Optional render flags. See {@link VizRenderOpts}.
|
|
24696
24704
|
* @returns A complete graphviz dot source string.
|
|
24697
24705
|
*/
|
|
24698
|
-
function machine_to_dot(u_jssm, opts) {
|
|
24706
|
+
function machine_to_dot(u_jssm, opts = {}) {
|
|
24699
24707
|
var _a;
|
|
24700
24708
|
const l_states = u_jssm.states();
|
|
24701
24709
|
const state_index = new Map(l_states.map((s, i) => [s, i]));
|
|
24702
24710
|
const state_kinds = classify_states(u_jssm, l_states);
|
|
24703
|
-
const nodes = states_to_nodes_string(u_jssm, l_states, state_index, state_kinds);
|
|
24711
|
+
const nodes = states_to_nodes_string(u_jssm, l_states, state_index, state_kinds, opts.hide_state_labels === true);
|
|
24704
24712
|
const edges = states_to_edges_string(u_jssm, l_states, state_index, state_kinds);
|
|
24705
24713
|
const arranges = arranges_for(u_jssm, state_index);
|
|
24706
24714
|
const rank_dir = flow_direction_to_rankdir(u_jssm.flow() || 'down');
|
|
@@ -24715,16 +24723,18 @@ function machine_to_dot(u_jssm, opts) {
|
|
|
24715
24723
|
* import { fsl_to_dot } from 'jssm/viz';
|
|
24716
24724
|
* const dot = fsl_to_dot('a -> b;');
|
|
24717
24725
|
*
|
|
24726
|
+
* // suppress state-name labels
|
|
24727
|
+
* const dot2 = fsl_to_dot('a -> b;', { hide_state_labels: true });
|
|
24728
|
+
*
|
|
24718
24729
|
* const dot_with_footer = fsl_to_dot('a -> b;', { footer: 'label="caption";' });
|
|
24719
24730
|
* // 'digraph G { ... label="caption"; }'
|
|
24720
24731
|
* ```
|
|
24721
24732
|
*
|
|
24722
24733
|
* @param fsl The FSL source.
|
|
24723
|
-
* @param opts Optional
|
|
24724
|
-
* @param opts.footer Optional verbatim dot source inserted just before the closing `}`.
|
|
24734
|
+
* @param opts Optional render flags. See {@link VizRenderOpts}.
|
|
24725
24735
|
* @returns A complete graphviz dot source string.
|
|
24726
24736
|
*/
|
|
24727
|
-
function fsl_to_dot(fsl, opts) {
|
|
24737
|
+
function fsl_to_dot(fsl, opts = {}) {
|
|
24728
24738
|
return machine_to_dot(sm `${fsl}`, opts);
|
|
24729
24739
|
}
|
|
24730
24740
|
/**
|
|
@@ -24757,13 +24767,10 @@ async function dot_to_svg(dot, options) {
|
|
|
24757
24767
|
* ```
|
|
24758
24768
|
*
|
|
24759
24769
|
* @param fsl The FSL source.
|
|
24760
|
-
* @param opts Optional
|
|
24761
|
-
* @param opts.footer Optional verbatim dot source inserted just before the closing `}` of the intermediate dot source.
|
|
24762
|
-
* @param opts.engine Graphviz layout engine to use (e.g. `'dot'`, `'neato'`, `'circo'`).
|
|
24763
|
-
* Unrecognized engine names cause `@viz-js/viz` to throw at render time.
|
|
24770
|
+
* @param opts Optional render flags. See {@link VizRenderOpts}.
|
|
24764
24771
|
* @returns A promise resolving to an SVG XML string.
|
|
24765
24772
|
*/
|
|
24766
|
-
async function fsl_to_svg_string(fsl, opts) {
|
|
24773
|
+
async function fsl_to_svg_string(fsl, opts = {}) {
|
|
24767
24774
|
return dot_to_svg(fsl_to_dot(fsl, opts), opts);
|
|
24768
24775
|
}
|
|
24769
24776
|
|