state-machine-cat 11.1.5 → 12.0.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/README.md CHANGED
@@ -52,17 +52,6 @@ To enable me to make state charts ...
52
52
 
53
53
  A no-frills interpreter on line: [state-machine-cat.js.org](https://state-machine-cat.js.org).
54
54
 
55
- ### Within the Atom editor
56
-
57
- There's an [Atom package](https://atom.io/packages/state-machine-cat-preview)
58
- with syntax highlighting, a previewer and some export options. You can install
59
- it from within Atom (search for _state machine cat_ in the _install_ section
60
- of the settings screen) or use `apm i state-machine-cat-preview`
61
- if you're a command line person.
62
-
63
- OTOH. if you're a command line person the _command line interface_ might be
64
- something for you too:
65
-
66
55
  ### Command line interface
67
56
 
68
57
  Just `npm install --global state-machine-cat` and run `smcat`
@@ -124,8 +113,7 @@ bin/smcat --dot-graph-attrs "bgcolor=transparent splines=line" docs/sample.smcat
124
113
 
125
114
  ### Syntax highlighting
126
115
 
127
- - For editors supporting tree sitter (like atom): there's [tree-sitter-smcat](https://github.com/sverweij/tree-sitter-smcat)
128
- - The [atom-state-machine-cat-preview](https://github.com/sverweij/atom-state-machine-cat-preview) plugin includes syntax highlighting for atom as well.
116
+ - For editors supporting tree sitter (like the now defunct atom): there's [tree-sitter-smcat](https://github.com/sverweij/tree-sitter-smcat)
129
117
  - For vim there's [ambagasdowa/vim-syntax-smcat](https://github.com/ambagasdowa/vim-syntax-smcat/)
130
118
 
131
119
  ### State chart XML (SCXML)
@@ -207,7 +195,7 @@ off => on: switch flicked/
207
195
 
208
196
  > You note that smcat rendered the states in this chart _top down_ instead of
209
197
  > _left to right_. It did that because we told it so. You can do that too
210
- > with `--direction` on the command line, or in atom by `direction -> left to right` or `direction -> top down` from the chart's submenu.
198
+ > with `--direction` on the command line
211
199
 
212
200
  #### notes
213
201
 
@@ -1,4 +1,3 @@
1
- import { cloneDeep } from "../../utl.mjs";
2
1
  import options from "../../options.mjs";
3
2
  import StateMachineModel from "../../state-machine-model.mjs";
4
3
  import attributebuilder from "./attributebuilder.mjs";
@@ -94,7 +93,7 @@ function transformTransitions(pStateMachineModel, pDirection, pCounter) {
94
93
  }
95
94
  export default (pStateMachine, pOptions) => {
96
95
  pOptions = pOptions || {};
97
- let lStateMachine = cloneDeep(pStateMachine);
96
+ let lStateMachine = structuredClone(pStateMachine);
98
97
  const lStateMachineModel = new StateMachineModel(lStateMachine);
99
98
  lStateMachine.transitions = transformTransitions(lStateMachineModel, pOptions.direction, new Counter());
100
99
  lStateMachine.states = transformStates(lStateMachine.states, pOptions.direction, pOptions.dotNodeAttrs, lStateMachineModel);
@@ -1,4 +1,3 @@
1
- import { cloneDeep } from "../../utl.mjs";
2
1
  import utl from "./utl.mjs";
3
2
  function isType(pString) {
4
3
  return (pState) => pState.type === pString;
@@ -7,7 +6,7 @@ function isOneOfTypes(pStringArray) {
7
6
  return (pState) => pStringArray.includes(pState.type);
8
7
  }
9
8
  function setLabel(pState) {
10
- const lState = cloneDeep(pState);
9
+ const lState = structuredClone(pState);
11
10
  lState.label = pState.label || pState.name;
12
11
  return lState;
13
12
  }
@@ -1,5 +1,4 @@
1
1
  import Handlebars from "handlebars/dist/handlebars.runtime.js";
2
- import { cloneDeep } from "../../utl.mjs";
3
2
  await import("./smcat.template.js");
4
3
  const NAME_QUOTABLE = /;|,|{| |\[/;
5
4
  const ACTIONS_QUOTABLE = /;|,|{/;
@@ -55,7 +54,7 @@ Handlebars.registerHelper("quotifyActions", (pItem) => quoteIfNecessary(ACTIONS_
55
54
  export default function renderSmcat(pStateMachine) {
56
55
  return Handlebars.templates["smcat.template.hbs"]({
57
56
  ...pStateMachine,
58
- states: transformStates(cloneDeep(pStateMachine.states)),
59
- transitions: transformTransitions(cloneDeep(pStateMachine.transitions || [])),
57
+ states: transformStates(structuredClone(pStateMachine.states)),
58
+ transitions: transformTransitions(structuredClone(pStateMachine.transitions || [])),
60
59
  });
61
60
  }
@@ -1,4 +1,3 @@
1
- import { cloneDeep } from "../utl.mjs";
2
1
  import StateMachineModel from "../state-machine-model.mjs";
3
2
  import utl from "./utl.mjs";
4
3
  function fuseTransitionAttribute(pIncomingThing, pOutgoingThing, pJoinChar) {
@@ -36,7 +35,7 @@ function fuseTransitions(pTransitions, pPseudoStateNames, pOutgoingTransitionMap
36
35
  }, []);
37
36
  }
38
37
  function deSugarPseudoStates(pMachine, pPseudoStateNames, pOutgoingTransitionMap) {
39
- const lMachine = cloneDeep(pMachine);
38
+ const lMachine = structuredClone(pMachine);
40
39
  if (lMachine.transitions && pPseudoStateNames.length > 0) {
41
40
  lMachine.transitions = fuseTransitions(lMachine.transitions, pPseudoStateNames, pOutgoingTransitionMap);
42
41
  }
@@ -49,7 +48,7 @@ function deSugarPseudoStates(pMachine, pPseudoStateNames, pOutgoingTransitionMap
49
48
  return lMachine;
50
49
  }
51
50
  function removeStatesCascading(pMachine, pStateNames) {
52
- const lMachine = cloneDeep(pMachine);
51
+ const lMachine = structuredClone(pMachine);
53
52
  if (lMachine.transitions) {
54
53
  lMachine.transitions = lMachine.transitions.filter((pTransition) => !pStateNames.some((pJunctionStateName) => pJunctionStateName === pTransition.from ||
55
54
  pJunctionStateName === pTransition.to));
package/dist/version.mjs CHANGED
@@ -1 +1 @@
1
- export const version = "11.1.5";
1
+ export const version = "12.0.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "state-machine-cat",
3
- "version": "11.1.5",
3
+ "version": "12.0.1",
4
4
  "description": "write beautiful state charts",
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.mjs",
@@ -90,30 +90,30 @@
90
90
  "state-machine-cat": "bin/smcat.mjs"
91
91
  },
92
92
  "dependencies": {
93
- "@hpcc-js/wasm": "2.13.1",
93
+ "@hpcc-js/wasm": "2.14.0",
94
94
  "ajv": "8.12.0",
95
95
  "commander": "11.0.0",
96
- "fast-xml-parser": "4.2.7",
96
+ "fast-xml-parser": "4.3.2",
97
97
  "handlebars": "4.7.8",
98
98
  "he": "1.2.0",
99
99
  "semver": "^7.5.4",
100
100
  "traverse": "0.6.7"
101
101
  },
102
102
  "devDependencies": {
103
- "@types/he": "1.2.0",
104
- "@types/mocha": "10.0.1",
105
- "@typescript-eslint/eslint-plugin": "6.4.1",
106
- "@typescript-eslint/parser": "6.4.1",
103
+ "@types/he": "1.2.1",
104
+ "@types/mocha": "10.0.2",
105
+ "@typescript-eslint/eslint-plugin": "6.7.4",
106
+ "@typescript-eslint/parser": "6.7.4",
107
107
  "c8": "8.0.1",
108
- "dependency-cruiser": "13.1.4",
109
- "esbuild": "0.19.2",
110
- "eslint": "8.48.0",
108
+ "dependency-cruiser": "14.1.0",
109
+ "esbuild": "0.19.4",
110
+ "eslint": "8.51.0",
111
111
  "eslint-config-moving-meadow": "4.0.2",
112
112
  "eslint-config-prettier": "9.0.0",
113
113
  "eslint-plugin-budapestian": "5.0.1",
114
114
  "eslint-plugin-eslint-comments": "3.2.0",
115
115
  "eslint-plugin-import": "2.28.1",
116
- "eslint-plugin-mocha": "10.1.0",
116
+ "eslint-plugin-mocha": "10.2.0",
117
117
  "eslint-plugin-node": "11.1.0",
118
118
  "eslint-plugin-security": "1.7.1",
119
119
  "eslint-plugin-unicorn": "48.0.1",
@@ -124,16 +124,16 @@
124
124
  "mocha": "10.2.0",
125
125
  "npm-run-all": "4.1.5",
126
126
  "peggy": "3.0.2",
127
- "prettier": "3.0.2",
127
+ "prettier": "3.0.3",
128
128
  "query-string": "8.1.0",
129
129
  "ts-node": "10.9.1",
130
130
  "typescript": "5.2.2",
131
- "upem": "8.0.0",
132
- "watskeburt": "1.0.1",
131
+ "upem": "9.0.2",
132
+ "watskeburt": "2.0.0",
133
133
  "xml-name-validator": "4.0.0"
134
134
  },
135
135
  "engines": {
136
- "node": "^16.14||>=18"
136
+ "node": "^18.17||>=20"
137
137
  },
138
138
  "types": "types/state-machine-cat.d.ts",
139
139
  "browserslist": [
package/dist/utl.mjs DELETED
@@ -1,3 +0,0 @@
1
- export function cloneDeep(pObject) {
2
- return JSON.parse(JSON.stringify(pObject));
3
- }