@statewalker/fsm-charts 0.2.3 → 0.2.5

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.
Files changed (123) hide show
  1. package/dist/{chunk-AZBRQNTU.js → chunk-2LFUT2C6.js} +1062 -1110
  2. package/dist/{chunk-SVKVQY7B.js → chunk-ARZYBFNA.js} +4 -4
  3. package/dist/{chunk-36ZLXJVD.js → chunk-CR2M4445.js} +35 -33
  4. package/dist/{chunk-TZHCBZVP.js → chunk-GW2Z65BN.js} +22 -15
  5. package/dist/chunk-PKBMQBKP.js +5 -0
  6. package/dist/{chunk-VILLJJJD.js → chunk-RZ4FP6JB.js} +11 -9
  7. package/dist/index-config.js +2 -1
  8. package/dist/index-dom.js +2 -1
  9. package/dist/{index-html-DgSCNHkR.d.ts → index-html-BBQqYoST.d.ts} +10 -10
  10. package/dist/index-html.d.ts +1 -1
  11. package/dist/index-html.js +2 -1
  12. package/dist/index-layout.d.ts +15 -15
  13. package/dist/index-layout.js +2 -1
  14. package/dist/index-runtime.js +2 -1
  15. package/dist/index.d.ts +3 -3
  16. package/dist/index.js +6 -5
  17. package/package.json +16 -18
  18. package/src/config/concatTransitionsToString.ts +2 -2
  19. package/src/config/index.ts +4 -4
  20. package/src/config/serializeProcessConfig.ts +3 -3
  21. package/src/config/splitTransitionString.ts +2 -2
  22. package/src/config/toFsmStateConfig.ts +3 -3
  23. package/src/dagre/acyclic.js +9 -10
  24. package/src/dagre/add-border-segments.js +11 -7
  25. package/src/dagre/coordinate-system.js +12 -12
  26. package/src/dagre/data/list.js +2 -2
  27. package/src/dagre/debug.d.ts +1 -1
  28. package/src/dagre/debug.js +11 -11
  29. package/src/dagre/greedy-fas.js +17 -21
  30. package/src/dagre/index.d.ts +4 -4
  31. package/src/dagre/index.js +4 -4
  32. package/src/dagre/layout.js +107 -96
  33. package/src/dagre/nesting-graph.js +13 -19
  34. package/src/dagre/normalize.js +7 -7
  35. package/src/dagre/order/add-subgraph-constraints.js +2 -2
  36. package/src/dagre/order/barycenter.d.ts +1 -1
  37. package/src/dagre/order/barycenter.js +4 -4
  38. package/src/dagre/order/build-layer-graph.d.ts +1 -1
  39. package/src/dagre/order/build-layer-graph.js +7 -9
  40. package/src/dagre/order/cross-count.js +14 -17
  41. package/src/dagre/order/index.js +19 -17
  42. package/src/dagre/order/init-order.js +5 -15
  43. package/src/dagre/order/resolve-conflicts.js +10 -14
  44. package/src/dagre/order/sort-subgraph.d.ts +1 -1
  45. package/src/dagre/order/sort-subgraph.js +13 -14
  46. package/src/dagre/order/sort.d.ts +1 -1
  47. package/src/dagre/order/sort.js +6 -10
  48. package/src/dagre/parent-dummy-chains.js +10 -4
  49. package/src/dagre/position/bk.d.ts +3 -3
  50. package/src/dagre/position/bk.js +84 -65
  51. package/src/dagre/position/index.js +7 -11
  52. package/src/dagre/rank/feasible-tree.d.ts +1 -1
  53. package/src/dagre/rank/feasible-tree.js +6 -6
  54. package/src/dagre/rank/index.js +6 -6
  55. package/src/dagre/rank/network-simplex.d.ts +0 -1
  56. package/src/dagre/rank/network-simplex.js +20 -25
  57. package/src/dagre/rank/util.js +2 -6
  58. package/src/dagre/util.d.ts +12 -6
  59. package/src/dagre/util.js +31 -37
  60. package/src/dom/buildSections.ts +16 -12
  61. package/src/dom/description-panels.ts +3 -3
  62. package/src/dom/getStatesDescriptions.ts +1 -1
  63. package/src/full/index.ts +1 -1
  64. package/src/full/toFsmStateCharts.ts +11 -11
  65. package/src/graphlib/alg/components.js +2 -2
  66. package/src/graphlib/alg/dfs.js +5 -5
  67. package/src/graphlib/alg/dijkstra-all.js +4 -4
  68. package/src/graphlib/alg/dijkstra.js +9 -12
  69. package/src/graphlib/alg/find-cycles.js +7 -5
  70. package/src/graphlib/alg/floyd-warshall.js +8 -11
  71. package/src/graphlib/alg/index.d.ts +11 -11
  72. package/src/graphlib/alg/index.js +11 -11
  73. package/src/graphlib/alg/is-acyclic.js +1 -1
  74. package/src/graphlib/alg/postorder.js +2 -2
  75. package/src/graphlib/alg/preorder.js +2 -2
  76. package/src/graphlib/alg/prim.d.ts +1 -1
  77. package/src/graphlib/alg/prim.js +5 -5
  78. package/src/graphlib/alg/tarjan.js +3 -3
  79. package/src/graphlib/alg/topsort.js +1 -1
  80. package/src/graphlib/data/priority-queue.js +8 -10
  81. package/src/graphlib/graph.js +53 -52
  82. package/src/graphlib/index.d.ts +2 -2
  83. package/src/graphlib/index.js +2 -2
  84. package/src/graphlib/json.d.ts +1 -1
  85. package/src/graphlib/json.js +6 -6
  86. package/src/html/buildStatechartCss.ts +2 -2
  87. package/src/html/buildStatechartStyles.ts +1 -1
  88. package/src/html/buildStatechartSvg.ts +7 -7
  89. package/src/html/buildStatechartsPanel.ts +2 -2
  90. package/src/html/index.ts +4 -4
  91. package/src/index-config.ts +2 -2
  92. package/src/index-dom.ts +1 -1
  93. package/src/index-html.ts +2 -2
  94. package/src/index-layout.ts +2 -2
  95. package/src/index-runtime.ts +2 -2
  96. package/src/index.ts +8 -8
  97. package/src/layout/buildCharts.ts +5 -5
  98. package/src/layout/buildFlatCharts.ts +11 -13
  99. package/src/layout/getGraphParamsProvider.ts +5 -8
  100. package/src/layout/getLabelDimensions.ts +5 -5
  101. package/src/layout/index.ts +5 -4
  102. package/src/lodash-es/index.ts +2 -2
  103. package/src/lodash-es/types.ts +37 -35
  104. package/src/runtime/RuntimeStatechartApi.ts +12 -23
  105. package/src/runtime/StateChartIndex.ts +3 -3
  106. package/src/runtime/index.ts +2 -2
  107. package/src/types/FsmStateConfig.ts +1 -1
  108. package/src/types/GraphParamsProvider.ts +2 -2
  109. package/src/types/Position.ts +1 -1
  110. package/src/types/StateChart.ts +2 -2
  111. package/src/types/StateGraphEdge.ts +2 -2
  112. package/src/types/StateGraphNode.ts +2 -2
  113. package/src/types/TransitionsGraph.ts +4 -4
  114. package/src/types/index.ts +11 -11
  115. package/src/utils/BasisCurve.ts +3 -3
  116. package/src/utils/domToText.ts +1 -1
  117. package/src/utils/getPadding.ts +1 -1
  118. package/src/utils/newRegistry.ts +1 -1
  119. package/src/utils/serializeAttrs.ts +6 -6
  120. package/src/utils/serializeCss.ts +3 -3
  121. package/src/utils/serializeStyle.ts +2 -2
  122. package/src/utils/toKebabCase.ts +1 -1
  123. package/CHANGELOG.md +0 -1
@@ -1,4 +1,4 @@
1
- import { _ } from '../../lodash-es/index.ts';
1
+ import { _ } from "../../lodash-es/index.ts";
2
2
 
3
3
  export { PriorityQueue };
4
4
 
@@ -24,9 +24,7 @@ class PriorityQueue {
24
24
  * Returns the keys that are in the queue. Takes `O(n)` time.
25
25
  */
26
26
  keys() {
27
- return this._arr.map(function (x) {
28
- return x.key;
29
- });
27
+ return this._arr.map((x) => x.key);
30
28
  }
31
29
  /**
32
30
  * Returns `true` if **key** is in the queue and `false` if not.
@@ -52,7 +50,7 @@ class PriorityQueue {
52
50
  */
53
51
  min() {
54
52
  if (this.size() === 0) {
55
- throw new Error('Queue underflow');
53
+ throw new Error("Queue underflow");
56
54
  }
57
55
  return this._arr[0].key;
58
56
  }
@@ -98,13 +96,13 @@ class PriorityQueue {
98
96
  var index = this._keyIndices[key];
99
97
  if (priority > this._arr[index].priority) {
100
98
  throw new Error(
101
- 'New priority is greater than current priority. ' +
102
- 'Key: ' +
99
+ "New priority is greater than current priority. " +
100
+ "Key: " +
103
101
  key +
104
- ' Old: ' +
102
+ " Old: " +
105
103
  this._arr[index].priority +
106
- ' New: ' +
107
- priority
104
+ " New: " +
105
+ priority,
108
106
  );
109
107
  }
110
108
  this._arr[index].priority = priority;
@@ -1,8 +1,8 @@
1
- import { _ } from '../lodash-es/index.ts';
1
+ import { _ } from "../lodash-es/index.ts";
2
2
 
3
- var DEFAULT_EDGE_NAME = '\x00';
4
- var GRAPH_NODE = '\x00';
5
- var EDGE_KEY_DELIM = '\x01';
3
+ var DEFAULT_EDGE_NAME = "\x00";
4
+ var GRAPH_NODE = "\x00";
5
+ var EDGE_KEY_DELIM = "\x01";
6
6
 
7
7
  // Implementation notes:
8
8
  //
@@ -25,9 +25,9 @@ var EDGE_KEY_DELIM = '\x01';
25
25
  // we're going to get to a performant hashtable in JavaScript.
26
26
  export class Graph {
27
27
  constructor(opts = {}) {
28
- this._isDirected = _.has(opts, 'directed') ? opts.directed : true;
29
- this._isMultigraph = _.has(opts, 'multigraph') ? opts.multigraph : false;
30
- this._isCompound = _.has(opts, 'compound') ? opts.compound : false;
28
+ this._isDirected = _.has(opts, "directed") ? opts.directed : true;
29
+ this._isMultigraph = _.has(opts, "multigraph") ? opts.multigraph : false;
30
+ this._isCompound = _.has(opts, "compound") ? opts.compound : false;
31
31
 
32
32
  // Label for the graph itself
33
33
  this._label = undefined;
@@ -100,25 +100,18 @@ export class Graph {
100
100
  return _.keys(this._nodes);
101
101
  }
102
102
  sources() {
103
- var self = this;
104
- return _.filter(this.nodes(), function (v) {
105
- return _.isEmpty(self._in[v]);
106
- });
103
+ return _.filter(this.nodes(), (v) => _.isEmpty(this._in[v]));
107
104
  }
108
105
  sinks() {
109
- var self = this;
110
- return _.filter(this.nodes(), function (v) {
111
- return _.isEmpty(self._out[v]);
112
- });
106
+ return _.filter(this.nodes(), (v) => _.isEmpty(this._out[v]));
113
107
  }
114
108
  setNodes(vs, value) {
115
109
  var args = arguments;
116
- var self = this;
117
- _.each(vs, function (v) {
110
+ _.each(vs, (v) => {
118
111
  if (args.length > 1) {
119
- self.setNode(v, value);
112
+ this.setNode(v, value);
120
113
  } else {
121
- self.setNode(v);
114
+ this.setNode(v);
122
115
  }
123
116
  });
124
117
  return this;
@@ -152,17 +145,16 @@ export class Graph {
152
145
  return _.has(this._nodes, v);
153
146
  }
154
147
  removeNode(v) {
155
- var self = this;
156
148
  if (_.has(this._nodes, v)) {
157
- var removeEdge = function (e) {
158
- self.removeEdge(self._edgeObjs[e]);
149
+ var removeEdge = (e) => {
150
+ this.removeEdge(this._edgeObjs[e]);
159
151
  };
160
152
  delete this._nodes[v];
161
153
  if (this._isCompound) {
162
154
  this._removeFromParentsChildList(v);
163
155
  delete this._parent[v];
164
- _.each(this.children(v), function (child) {
165
- self.setParent(child);
156
+ _.each(this.children(v), (child) => {
157
+ this.setParent(child);
166
158
  });
167
159
  delete this._children[v];
168
160
  }
@@ -178,17 +170,23 @@ export class Graph {
178
170
  }
179
171
  setParent(v, parent) {
180
172
  if (!this._isCompound) {
181
- throw new Error('Cannot set parent in a non-compound graph');
173
+ throw new Error("Cannot set parent in a non-compound graph");
182
174
  }
183
175
 
184
176
  if (_.isUndefined(parent)) {
185
177
  parent = GRAPH_NODE;
186
178
  } else {
187
179
  // Coerce parent to string
188
- parent += '';
189
- for (var ancestor = parent; !_.isUndefined(ancestor); ancestor = this.parent(ancestor)) {
180
+ parent += "";
181
+ for (
182
+ var ancestor = parent;
183
+ !_.isUndefined(ancestor);
184
+ ancestor = this.parent(ancestor)
185
+ ) {
190
186
  if (ancestor === v) {
191
- throw new Error('Setting ' + parent + ' as parent of ' + v + ' would create a cycle');
187
+ throw new Error(
188
+ `Setting ${parent} as parent of ${v} would create a cycle`,
189
+ );
192
190
  }
193
191
  }
194
192
 
@@ -266,13 +264,13 @@ export class Graph {
266
264
  copy.setGraph(this.graph());
267
265
 
268
266
  var self = this;
269
- _.each(this._nodes, function (value, v) {
267
+ _.each(this._nodes, (value, v) => {
270
268
  if (filter(v)) {
271
269
  copy.setNode(v, value);
272
270
  }
273
271
  });
274
272
 
275
- _.each(this._edgeObjs, function (e) {
273
+ _.each(this._edgeObjs, (e) => {
276
274
  // @ts-expect-error
277
275
  if (copy.hasNode(e.v) && copy.hasNode(e.w)) {
278
276
  copy.setEdge(e, self.edge(e));
@@ -293,7 +291,7 @@ export class Graph {
293
291
  }
294
292
 
295
293
  if (this._isCompound) {
296
- _.each(copy.nodes(), function (v) {
294
+ _.each(copy.nodes(), (v) => {
297
295
  copy.setParent(v, findParent(v));
298
296
  });
299
297
  }
@@ -315,13 +313,12 @@ export class Graph {
315
313
  return _.values(this._edgeObjs);
316
314
  }
317
315
  setPath(vs, value) {
318
- var self = this;
319
316
  var args = arguments;
320
- _.reduce(vs, function (v, w) {
317
+ _.reduce(vs, (v, w) => {
321
318
  if (args.length > 1) {
322
- self.setEdge(v, w, value);
319
+ this.setEdge(v, w, value);
323
320
  } else {
324
- self.setEdge(v, w);
321
+ this.setEdge(v, w);
325
322
  }
326
323
  return w;
327
324
  });
@@ -336,7 +333,7 @@ export class Graph {
336
333
  var valueSpecified = false;
337
334
  var arg0 = arguments[0];
338
335
 
339
- if (typeof arg0 === 'object' && arg0 !== null && 'v' in arg0) {
336
+ if (typeof arg0 === "object" && arg0 !== null && "v" in arg0) {
340
337
  v = arg0.v;
341
338
  w = arg0.w;
342
339
  name = arg0.name;
@@ -354,10 +351,10 @@ export class Graph {
354
351
  }
355
352
  }
356
353
 
357
- v = '' + v;
358
- w = '' + w;
354
+ v = `${v}`;
355
+ w = `${w}`;
359
356
  if (!_.isUndefined(name)) {
360
- name = '' + name;
357
+ name = `${name}`;
361
358
  }
362
359
 
363
360
  var e = edgeArgsToId(this._isDirected, v, w, name);
@@ -369,7 +366,7 @@ export class Graph {
369
366
  }
370
367
 
371
368
  if (!_.isUndefined(name) && !this._isMultigraph) {
372
- throw new Error('Cannot set a named edge when isMultigraph = false');
369
+ throw new Error("Cannot set a named edge when isMultigraph = false");
373
370
  }
374
371
 
375
372
  // It didn't exist, so we need to create it.
@@ -378,7 +375,9 @@ export class Graph {
378
375
  this.setNode(w);
379
376
 
380
377
  // @ts-expect-error
381
- this._edgeLabels[e] = valueSpecified ? value : this._defaultEdgeLabelFn(v, w, name);
378
+ this._edgeLabels[e] = valueSpecified
379
+ ? value
380
+ : this._defaultEdgeLabelFn(v, w, name);
382
381
 
383
382
  var edgeObj = edgeArgsToObj(this._isDirected, v, w, name);
384
383
  // Ensure we add undirected edges in a consistent way.
@@ -434,9 +433,7 @@ export class Graph {
434
433
  if (!u) {
435
434
  return edges;
436
435
  }
437
- return _.filter(edges, function (edge) {
438
- return edge.v === u;
439
- });
436
+ return _.filter(edges, (edge) => edge.v === u);
440
437
  }
441
438
  }
442
439
  outEdges(v, w) {
@@ -446,9 +443,7 @@ export class Graph {
446
443
  if (!w) {
447
444
  return edges;
448
445
  }
449
- return _.filter(edges, function (edge) {
450
- return edge.w === w;
451
- });
446
+ return _.filter(edges, (edge) => edge.w === w);
452
447
  }
453
448
  }
454
449
  nodeEdges(v, w) {
@@ -480,19 +475,25 @@ function decrementOrRemoveEntry(map, k) {
480
475
  }
481
476
 
482
477
  function edgeArgsToId(isDirected, v_, w_, name) {
483
- var v = '' + v_;
484
- var w = '' + w_;
478
+ var v = `${v_}`;
479
+ var w = `${w_}`;
485
480
  if (!isDirected && v > w) {
486
481
  var tmp = v;
487
482
  v = w;
488
483
  w = tmp;
489
484
  }
490
- return v + EDGE_KEY_DELIM + w + EDGE_KEY_DELIM + (_.isUndefined(name) ? DEFAULT_EDGE_NAME : name);
485
+ return (
486
+ v +
487
+ EDGE_KEY_DELIM +
488
+ w +
489
+ EDGE_KEY_DELIM +
490
+ (_.isUndefined(name) ? DEFAULT_EDGE_NAME : name)
491
+ );
491
492
  }
492
493
 
493
494
  function edgeArgsToObj(isDirected, v_, w_, name) {
494
- var v = '' + v_;
495
- var w = '' + w_;
495
+ var v = `${v_}`;
496
+ var w = `${w_}`;
496
497
  if (!isDirected && v > w) {
497
498
  var tmp = v;
498
499
  v = w;
@@ -1,3 +1,3 @@
1
- import { Graph } from './graph.js';
2
- export const version: '2.1.9-pre';
1
+ import { Graph } from "./graph.js";
2
+ export const version: "2.1.9-pre";
3
3
  export { Graph };
@@ -1,7 +1,7 @@
1
1
  // Includes only the "core" of graphlib
2
2
 
3
- import { Graph } from './graph.js';
3
+ import { Graph } from "./graph.js";
4
4
 
5
- const version = '2.1.9-pre';
5
+ const version = "2.1.9-pre";
6
6
 
7
7
  export { Graph, version };
@@ -13,4 +13,4 @@ export function write(g: any): {
13
13
  }[];
14
14
  };
15
15
  export function read(json: any): Graph;
16
- import { Graph } from './graph.js';
16
+ import { Graph } from "./graph.js";
@@ -1,5 +1,5 @@
1
- import { _ } from '../lodash-es/index.ts';
2
- import { Graph } from './graph.js';
1
+ import { _ } from "../lodash-es/index.ts";
2
+ import { Graph } from "./graph.js";
3
3
 
4
4
  export { write, read };
5
5
 
@@ -20,7 +20,7 @@ function write(g) {
20
20
  }
21
21
 
22
22
  function writeNodes(g) {
23
- return _.map(g.nodes(), function (v) {
23
+ return _.map(g.nodes(), (v) => {
24
24
  var nodeValue = g.node(v);
25
25
  var parent = g.parent(v);
26
26
  var node = { v: v };
@@ -35,7 +35,7 @@ function writeNodes(g) {
35
35
  }
36
36
 
37
37
  function writeEdges(g) {
38
- return _.map(g.edges(), function (e) {
38
+ return _.map(g.edges(), (e) => {
39
39
  var edgeValue = g.edge(e);
40
40
  var edge = { v: e.v, w: e.w };
41
41
  if (!_.isUndefined(e.name)) {
@@ -50,13 +50,13 @@ function writeEdges(g) {
50
50
 
51
51
  function read(json) {
52
52
  var g = new Graph(json.options).setGraph(json.value);
53
- _.each(json.nodes, function (entry) {
53
+ _.each(json.nodes, (entry) => {
54
54
  g.setNode(entry.v, entry.value);
55
55
  if (entry.parent) {
56
56
  g.setParent(entry.v, entry.parent);
57
57
  }
58
58
  });
59
- _.each(json.edges, function (entry) {
59
+ _.each(json.edges, (entry) => {
60
60
  g.setEdge({ v: entry.v, w: entry.w, name: entry.name }, entry.value);
61
61
  });
62
62
  return g;
@@ -1,4 +1,4 @@
1
- import { serializeCss } from "../utils/serializeCss.ts";
1
+ import { serializeCss } from "../utils/serializeCss.js";
2
2
  import {
3
3
  activeStatesStyle,
4
4
  activeTransitionsStyle,
@@ -8,7 +8,7 @@ import {
8
8
  buildStateDetailsStyleWithModifier,
9
9
  selectedStatesStyle,
10
10
  selectedTransitionsStyle,
11
- } from "./buildStatechartStyles.ts";
11
+ } from "./buildStatechartStyles.js";
12
12
 
13
13
  export function buildStatechartCss({ prefix = "" } = {}): string {
14
14
  const root = prefix || ":root";
@@ -1,4 +1,4 @@
1
- import type { CssTree } from "../utils/serializeCss.ts";
1
+ import type { CssTree } from "../utils/serializeCss.js";
2
2
 
3
3
  export const activeStatesStyle = {
4
4
  backgroundColor: "white",
@@ -3,10 +3,10 @@ import type {
3
3
  Padding,
4
4
  Position,
5
5
  TransitionsGraph,
6
- } from "../types/index.ts";
7
- import { getPadding } from "../utils/getPadding.ts";
8
- import { serializeAttrs } from "../utils/serializeAttrs.ts";
9
- import { BasisCurve } from "../utils/BasisCurve.ts";
6
+ } from "../types/index.js";
7
+ import { BasisCurve } from "../utils/BasisCurve.js";
8
+ import { getPadding } from "../utils/getPadding.js";
9
+ import { serializeAttrs } from "../utils/serializeAttrs.js";
10
10
 
11
11
  function getBoxParams({
12
12
  x,
@@ -101,13 +101,13 @@ export function buildStatechartSvg({
101
101
  x2: number,
102
102
  y2: number,
103
103
  ) {
104
- path.push("C" + round(x0, y0, x1, y1, x2, y2).join(","));
104
+ path.push(`C${round(x0, y0, x1, y1, x2, y2).join(",")}`);
105
105
  },
106
106
  moveTo(x: number, y: number) {
107
- path.push("M" + round(x, y).join(","));
107
+ path.push(`M${round(x, y).join(",")}`);
108
108
  },
109
109
  lineTo(x: number, y: number) {
110
- path.push("L" + round(x, y).join(","));
110
+ path.push(`L${round(x, y).join(",")}`);
111
111
  },
112
112
  closePath() {
113
113
  path.push("Z");
@@ -1,5 +1,5 @@
1
- import type { StateChart } from "../types/StateChart.ts";
2
- import { buildStatechartSvg } from "./buildStatechartSvg.ts";
1
+ import type { StateChart } from "../types/StateChart.js";
2
+ import { buildStatechartSvg } from "./buildStatechartSvg.js";
3
3
 
4
4
  export function buildStatechartsPanel({
5
5
  statechart,
package/src/html/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from "./buildStatechartCss.ts";
2
- export * from "./buildStatechartsPanel.ts";
3
- export * from "./buildStatechartStyles.ts";
4
- export * from "./buildStatechartSvg.ts";
1
+ export * from "./buildStatechartCss.js";
2
+ export * from "./buildStatechartStyles.js";
3
+ export * from "./buildStatechartSvg.js";
4
+ export * from "./buildStatechartsPanel.js";
@@ -1,2 +1,2 @@
1
- export type * from "./types/index.ts";
2
- export * from "./config/index.ts";
1
+ export * from "./config/index.js";
2
+ export type * from "./types/index.js";
package/src/index-dom.ts CHANGED
@@ -1 +1 @@
1
- export * from "./dom/index.ts";
1
+ export * from "./dom/index.js";
package/src/index-html.ts CHANGED
@@ -1,2 +1,2 @@
1
- export type * from "./types/index.ts";
2
- export * from "./html/index.ts";
1
+ export * from "./html/index.js";
2
+ export type * from "./types/index.js";
@@ -1,2 +1,2 @@
1
- export type * from "./types/index.ts";
2
- export * from "./layout/index.ts";
1
+ export * from "./layout/index.js";
2
+ export type * from "./types/index.js";
@@ -1,2 +1,2 @@
1
- export type * from "./types/index.ts";
2
- export * from "./runtime/index.ts";
1
+ export * from "./runtime/index.js";
2
+ export type * from "./types/index.js";
package/src/index.ts CHANGED
@@ -1,8 +1,8 @@
1
- export type * from "./types/index.ts";
2
- export * from "./dom/index.ts";
3
- export * from "./config/index.ts";
4
- export * from "./layout/index.ts";
5
- export * from "./html/index.ts";
6
- export * from "./runtime/index.ts";
7
- export * from "./utils/toKebabCase.ts";
8
- export * from "./utils/serializeCss.ts";
1
+ export * from "./config/index.js";
2
+ export * from "./dom/index.js";
3
+ export * from "./html/index.js";
4
+ export * from "./layout/index.js";
5
+ export * from "./runtime/index.js";
6
+ export type * from "./types/index.js";
7
+ export * from "./utils/serializeCss.js";
8
+ export * from "./utils/toKebabCase.js";
@@ -1,9 +1,9 @@
1
- import type { GraphParamsProvider } from "../types/GraphParamsProvider.ts";
2
- import type { Padding } from "../types/Padding.ts";
3
- import type { FsmStateConfig } from "../types/FsmStateConfig.ts";
4
- import type { StateChart } from "../types/StateChart.ts";
1
+ import type { FsmStateConfig } from "../types/FsmStateConfig.js";
2
+ import type { GraphParamsProvider } from "../types/GraphParamsProvider.js";
3
+ import type { Padding } from "../types/Padding.js";
4
+ import type { StateChart } from "../types/StateChart.js";
5
5
 
6
- import { buildFlatCharts } from "./buildFlatCharts.ts";
6
+ import { buildFlatCharts } from "./buildFlatCharts.js";
7
7
  /**
8
8
  * Build graphs corresponding to the specified transitions.
9
9
  * @param config - State configuration with transitions and sub-states.
@@ -1,17 +1,15 @@
1
1
  import { layout } from "../dagre/layout.js";
2
2
  import { Graph } from "../graphlib/graph.js";
3
-
4
- import type { GraphParamsProvider } from "../types/GraphParamsProvider.ts";
5
- import type { Transition } from "../types/Transition.ts";
6
- import type { TransitionsGraph } from "../types/TransitionsGraph.ts";
7
- import type { StateGraphNode } from "../types/StateGraphNode.ts";
8
- import type { StateGraphEdge } from "../types/StateGraphEdge.ts";
9
- import type { Padding } from "../types/Padding.ts";
10
- import type { Position } from "../types/Position.ts";
11
- import type { Dimensions } from "../types/Dimensions.ts";
12
-
13
- import { getPadding } from "../utils/getPadding.ts";
14
- import { getLodash, setLodash } from "../lodash-es/index.ts";
3
+ import { getLodash, setLodash } from "../lodash-es/index.js";
4
+ import type { Dimensions } from "../types/Dimensions.js";
5
+ import type { GraphParamsProvider } from "../types/GraphParamsProvider.js";
6
+ import type { Padding } from "../types/Padding.js";
7
+ import type { Position } from "../types/Position.js";
8
+ import type { StateGraphEdge } from "../types/StateGraphEdge.js";
9
+ import type { StateGraphNode } from "../types/StateGraphNode.js";
10
+ import type { Transition } from "../types/Transition.js";
11
+ import type { TransitionsGraph } from "../types/TransitionsGraph.js";
12
+ import { getPadding } from "../utils/getPadding.js";
15
13
 
16
14
  /**
17
15
  * Build graphs corresponding to the specified transitions.
@@ -46,7 +44,7 @@ export function buildFlatCharts({
46
44
  padding?: Padding;
47
45
  direction?: "tb" | "bt" | "lr" | "rl";
48
46
  } & GraphParamsProvider): TransitionsGraph {
49
- let prevLodash = getLodash();
47
+ const prevLodash = getLodash();
50
48
  try {
51
49
  setLodash(lodash);
52
50
  const rankdir = direction || (vertical ? "tb" : "lr");
@@ -1,10 +1,7 @@
1
- import type { Dimensions } from "../types/Dimensions.ts";
2
- import type { GraphParamsProvider } from "../types/GraphParamsProvider.ts";
3
- import type { Padding } from "../types/Padding.ts";
4
-
5
- import { getLabelDimensions } from "./getLabelDimensions.ts";
6
- import { getPadding } from "../utils/getPadding.ts";
7
- import { Label } from "../types/Label.ts";
1
+ import type { GraphParamsProvider } from "../types/GraphParamsProvider.js";
2
+ import type { Padding } from "../types/Padding.js";
3
+ import { getPadding } from "../utils/getPadding.js";
4
+ import { getLabelDimensions } from "./getLabelDimensions.js";
8
5
 
9
6
  /**
10
7
  * Provides default functions measuring dimensions for state nodes and transition edges in the graph.
@@ -21,7 +18,7 @@ export function getGraphParamsProvider({
21
18
  transitionsFontSize = fontSize,
22
19
  transitionsTextPadding = 0,
23
20
  getStateLabel = (state: string) => state,
24
- getTransitionLabel = (fromState: string, event: string, toState: string) =>
21
+ getTransitionLabel = (_fromState: string, event: string, _toState: string) =>
25
22
  event,
26
23
  }: {
27
24
  fontSize?: number;
@@ -1,6 +1,6 @@
1
- import type { Dimensions } from "../types/Dimensions.ts";
2
- import type { Padding } from "../types/Padding.ts";
3
- import { getPadding } from "../utils/getPadding.ts";
1
+ import type { Dimensions } from "../types/Dimensions.js";
2
+ import type { Padding } from "../types/Padding.js";
3
+ import { getPadding } from "../utils/getPadding.js";
4
4
 
5
5
  export function getLabelDimensions(
6
6
  label: string,
@@ -14,7 +14,7 @@ export function getLabelDimensions(
14
14
  fontSize?: number;
15
15
  getCharWidth?: (char: string) => number;
16
16
  lineGap?: number;
17
- } = {}
17
+ } = {},
18
18
  ) {
19
19
  const lines = [label]; // label.split("\n");
20
20
  let dimensions: Dimensions = { width: 0, height: 0 };
@@ -27,7 +27,7 @@ export function getLabelDimensions(
27
27
  line,
28
28
  fontSize,
29
29
  getCharWidth,
30
- })
30
+ }),
31
31
  );
32
32
  }
33
33
  const [top, right, bottom, left] = getPadding(padding);
@@ -1,5 +1,6 @@
1
1
  // Methods
2
- export * from "./buildFlatCharts.ts";
3
- export * from "./buildCharts.ts";
4
- export * from "./getGraphParamsProvider.ts";
5
- export * from "./getLabelDimensions.ts";
2
+
3
+ export * from "./buildCharts.js";
4
+ export * from "./buildFlatCharts.js";
5
+ export * from "./getGraphParamsProvider.js";
6
+ export * from "./getLabelDimensions.js";
@@ -2,8 +2,8 @@ export let _: any = {
2
2
  constant: (value: any) => () => value,
3
3
  };
4
4
  export function setLodash(lib: any) {
5
- _ = lib;
5
+ _ = lib;
6
6
  }
7
- export function getLodash() {
7
+ export function getLodash() {
8
8
  return _;
9
9
  }