@statewalker/fsm-charts 0.2.5 → 0.2.6
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 +206 -1
- package/dist/StateChart-cXyVRcs-.d.ts +94 -0
- package/dist/StateChart-cXyVRcs-.d.ts.map +1 -0
- package/dist/StateChartIndex-BK2315qj.d.ts +142 -0
- package/dist/StateChartIndex-BK2315qj.d.ts.map +1 -0
- package/dist/StateChartIndex-BOIrc_nq.js +355 -0
- package/dist/StateChartIndex-BOIrc_nq.js.map +1 -0
- package/dist/buildStatechartsPanel-CxQlIwTh.js +494 -0
- package/dist/buildStatechartsPanel-CxQlIwTh.js.map +1 -0
- package/dist/buildStatechartsPanel-hCtZbdiF.d.ts +79 -0
- package/dist/buildStatechartsPanel-hCtZbdiF.d.ts.map +1 -0
- package/dist/defineProperty-C0rC37pP.js +39 -0
- package/dist/description-panels-DI2MNlbK.js +184 -0
- package/dist/description-panels-DI2MNlbK.js.map +1 -0
- package/dist/getLabelDimensions-BY0q7j3D.d.ts +79 -0
- package/dist/getLabelDimensions-BY0q7j3D.d.ts.map +1 -0
- package/dist/getPadding-Cw0e7G2v.js +25 -0
- package/dist/getPadding-Cw0e7G2v.js.map +1 -0
- package/dist/index-config.d.ts +3 -12
- package/dist/index-config.js +2 -2
- package/dist/index-dom.d.ts +2 -49
- package/dist/index-dom.js +2 -2
- package/dist/index-html.d.ts +3 -2
- package/dist/index-html.js +2 -3
- package/dist/index-layout.d.ts +3 -77
- package/dist/index-layout.js +2 -3
- package/dist/index-runtime.d.ts +3 -141
- package/dist/index-runtime.js +2 -2
- package/dist/index.d.ts +11 -10
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -7
- package/dist/layout-Dp671N6q.js +2465 -0
- package/dist/layout-Dp671N6q.js.map +1 -0
- package/dist/newTreeBuilder-CvtLDjGj.d.ts +54 -0
- package/dist/newTreeBuilder-CvtLDjGj.d.ts.map +1 -0
- package/dist/toFsmStateConfig-DlJkyZni.js +135 -0
- package/dist/toFsmStateConfig-DlJkyZni.js.map +1 -0
- package/dist/toFsmStateConfig-DmOlTRjv.d.ts +15 -0
- package/dist/toFsmStateConfig-DmOlTRjv.d.ts.map +1 -0
- package/package.json +53 -25
- package/src/config/concatTransitionsToString.ts +2 -2
- package/src/config/splitTransitionString.ts +1 -3
- package/src/config/toFsmStateConfig.ts +2 -9
- package/src/dom/buildSections.ts +3 -11
- package/src/dom/description-panels.ts +2 -4
- package/src/dom/getStatesDescriptions.ts +3 -9
- package/src/full/toFsmStateCharts.ts +1 -1
- package/src/html/buildStatechartStyles.ts +4 -14
- package/src/html/buildStatechartSvg.ts +2 -14
- package/src/html/buildStatechartsPanel.ts +1 -3
- package/src/layout/buildCharts.ts +1 -2
- package/src/layout/buildFlatCharts.ts +6 -8
- package/src/layout/getGraphParamsProvider.ts +3 -12
- package/src/runtime/RuntimeStatechartApi.ts +10 -32
- package/src/runtime/StateChartIndex.ts +6 -23
- package/src/types/GraphParamsProvider.ts +1 -4
- package/src/utils/BasisCurve.ts +5 -14
- package/src/utils/domToText.ts +2 -6
- package/src/utils/getPadding.ts +1 -2
- package/src/utils/newId.ts +2 -1
- package/src/utils/newRegistry.ts +12 -12
- package/src/utils/serializeAttrs.ts +3 -11
- package/src/utils/serializeCss.ts +1 -5
- package/src/utils/serializeStyle.ts +1 -4
- package/src/utils/toKebabCase.ts +1 -4
- package/dist/StateChart-BYBjTmC2.d.ts +0 -82
- package/dist/chunk-2LFUT2C6.js +0 -2691
- package/dist/chunk-ARZYBFNA.js +0 -133
- package/dist/chunk-CR2M4445.js +0 -608
- package/dist/chunk-FIQDLBWD.js +0 -9
- package/dist/chunk-GW2Z65BN.js +0 -429
- package/dist/chunk-PKBMQBKP.js +0 -5
- package/dist/chunk-RZ4FP6JB.js +0 -233
- package/dist/index-html-BBQqYoST.d.ts +0 -75
package/dist/index-runtime.d.ts
CHANGED
|
@@ -1,141 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type RuntimeListener = (id: string) => void;
|
|
5
|
-
declare class RuntimeStatechartApi {
|
|
6
|
-
element: HTMLElement;
|
|
7
|
-
statechart: StateChart;
|
|
8
|
-
_listenersCounter: number;
|
|
9
|
-
_transitionsClickListeners: Record<number, RuntimeListener>;
|
|
10
|
-
_statesClickListeners: Record<number, RuntimeListener>;
|
|
11
|
-
_registry: Record<number, () => void>;
|
|
12
|
-
constructor({ element, statechart, }: {
|
|
13
|
-
element: HTMLElement;
|
|
14
|
-
statechart: StateChart;
|
|
15
|
-
});
|
|
16
|
-
close(): void;
|
|
17
|
-
onStateClick(listener: RuntimeListener): () => void;
|
|
18
|
-
onTransitionClick(listener: RuntimeListener): () => void;
|
|
19
|
-
openStatePanels(): void;
|
|
20
|
-
closeStatePanels(): void;
|
|
21
|
-
isStatePanelOpen(stateId: string): boolean;
|
|
22
|
-
toggleState(...stateIds: string[]): boolean;
|
|
23
|
-
activateStates(...stateIds: string[]): void;
|
|
24
|
-
focusStates(...stateIds: string[]): void;
|
|
25
|
-
setStateDescription(stateId: string, description: Node | string | undefined): void;
|
|
26
|
-
closeStatePanel(stateId: string): void;
|
|
27
|
-
openStatePanel(stateId: string): void;
|
|
28
|
-
deselectTransitions(modifier?: string): void;
|
|
29
|
-
deselectTransition(id: string, modifier?: string): void;
|
|
30
|
-
selectTransition(id: string, modifier?: string): void;
|
|
31
|
-
toggleTransition(id: string, modifier?: string): void;
|
|
32
|
-
isTransitionSelected(id: string, modifier?: string): boolean;
|
|
33
|
-
deselectStates(modifier?: string): void;
|
|
34
|
-
isStateSelected(id: string, modifier?: string): boolean;
|
|
35
|
-
deselectState(id: string, modifier?: string): void;
|
|
36
|
-
selectState(id: string, modifier?: string): void;
|
|
37
|
-
_addListener<T = Function>(index: Record<string, T>, listener: T): () => void;
|
|
38
|
-
_bindListeners(): void;
|
|
39
|
-
_setStatePanelStatus(selector: string, open: boolean): void;
|
|
40
|
-
_addStateModifier(cssSelector: string, modifier?: string): void;
|
|
41
|
-
_removeStateModifier(cssSelector: string, modifier?: string): void;
|
|
42
|
-
_applyStateModifier(cssSelector: string, modifier: string | undefined, apply: (elm: Element | null, className: string) => void): void;
|
|
43
|
-
_addTransitionsModifier(cssSelector: string, modifier?: string): void;
|
|
44
|
-
_removeTransitionsModifier(cssSelector: string, modifier?: string): void;
|
|
45
|
-
_applyTransitionsModifier(cssSelector: string, modifier: string | undefined, apply: (elm: Element | null, className: string) => void): void;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
declare class StateChartIndex {
|
|
49
|
-
statechart: StateChart;
|
|
50
|
-
_chartsIndex: Record<string, StateChart>;
|
|
51
|
-
_nodesIndex: Record<string, StateGraphNode>;
|
|
52
|
-
_nodesParentsIndex: Record<string, string>;
|
|
53
|
-
_edgeIndex: Record<string, StateGraphEdge>;
|
|
54
|
-
_edgesParentsIndex: Record<string, string>;
|
|
55
|
-
initialStateKey: string;
|
|
56
|
-
finalStateKey: string;
|
|
57
|
-
constructor({ statechart, initialStateKey, finalStateKey, }: {
|
|
58
|
-
statechart: StateChart;
|
|
59
|
-
initialStateKey?: string;
|
|
60
|
-
finalStateKey?: string;
|
|
61
|
-
});
|
|
62
|
-
/**
|
|
63
|
-
* Returns a state node or a chart by the specified identifier.
|
|
64
|
-
* @param id the id of a state node or a chart
|
|
65
|
-
* @returns a state node or a chart
|
|
66
|
-
*/
|
|
67
|
-
getNodeById(id: string): StateGraphNode | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* Returns a chart by the specified identifier.
|
|
70
|
-
* @param id the id of a state node or a chart
|
|
71
|
-
* @returns a state node or a chart
|
|
72
|
-
*/
|
|
73
|
-
getChartById(id: string): StateChart | undefined;
|
|
74
|
-
/**
|
|
75
|
-
* Returns an edge by the specified identifier.
|
|
76
|
-
* @param id the id of a graph edge
|
|
77
|
-
* @returns a graph edge
|
|
78
|
-
*/
|
|
79
|
-
getEdgeById(id: string): StateGraphEdge | undefined;
|
|
80
|
-
/**
|
|
81
|
-
* Returns a list of all nodes in this chart.
|
|
82
|
-
* @return a list of all nodes
|
|
83
|
-
*/
|
|
84
|
-
getAllNodes(): StateGraphNode[];
|
|
85
|
-
/**
|
|
86
|
-
* Returns a list of all non-empty state nodes in this chart.
|
|
87
|
-
* The result excludes nodes for initial and fina states.
|
|
88
|
-
* @return a list of all non-empty state nodes
|
|
89
|
-
*/
|
|
90
|
-
getStateNodes(): StateGraphNode[];
|
|
91
|
-
/**
|
|
92
|
-
* Transforms a stack of state keys to the corresponding identifiers.
|
|
93
|
-
* If a key in the stack was not found then this method returns
|
|
94
|
-
* an empty stack.
|
|
95
|
-
* @param stack a stack of state keys
|
|
96
|
-
* @returns a stack of state identifiers for the given states
|
|
97
|
-
*/
|
|
98
|
-
getStatesIds(...stack: string[]): string[];
|
|
99
|
-
/**
|
|
100
|
-
* Returns graph nodes for the specified identifier.
|
|
101
|
-
* @param id the id of a node
|
|
102
|
-
* @returns a stack of nodes
|
|
103
|
-
*/
|
|
104
|
-
getStackByStateId(id?: string): StateGraphNode[];
|
|
105
|
-
/**
|
|
106
|
-
* Returns an edge object corresponding to the transition from the state
|
|
107
|
-
* @param stateId identifier of the source state
|
|
108
|
-
* @param event an event triggering the transition
|
|
109
|
-
* @returns graph edge
|
|
110
|
-
*/
|
|
111
|
-
getTransition(stateId?: string, event?: string): StateGraphEdge | undefined;
|
|
112
|
-
/**
|
|
113
|
-
* Returns a list of edge objects corresponding to all transitions from the state
|
|
114
|
-
* @param stateId identifier of the source state
|
|
115
|
-
* @returns a list of graph edges
|
|
116
|
-
*/
|
|
117
|
-
getTransitions(stateId?: string): StateGraphEdge[];
|
|
118
|
-
/**
|
|
119
|
-
* Returns a graph node corresponding to the specified state id.
|
|
120
|
-
* @param stateId identifier of the state
|
|
121
|
-
* @returns graph node
|
|
122
|
-
* @see getStateChart
|
|
123
|
-
*/
|
|
124
|
-
getStateNode(stateId?: string): StateGraphNode | undefined;
|
|
125
|
-
/**
|
|
126
|
-
* Returns a chart corresponding to the specified state id.
|
|
127
|
-
* @param stateId identifier of the state
|
|
128
|
-
* @returns graph node
|
|
129
|
-
* @see getStateNode
|
|
130
|
-
*/
|
|
131
|
-
getStateChart(stateId?: string): StateChart | undefined;
|
|
132
|
-
/**
|
|
133
|
-
* Returns ids of the previous and next state for the specified transition
|
|
134
|
-
* @param transition a graph edge instance defining transition
|
|
135
|
-
* @returns an array with two identifiers - [sourceStateId, targetStateId] - the source state id and target state id
|
|
136
|
-
*/
|
|
137
|
-
getTransitionStateIds(transition?: StateGraphEdge): [string | undefined, string | undefined];
|
|
138
|
-
_buildIndexes(): void;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export { type RuntimeListener, RuntimeStatechartApi, StateChart, StateChartIndex, StateGraphEdge, StateGraphNode };
|
|
1
|
+
import { a as Position, c as Label, d as Dimensions, i as StateGraphNode, l as FsmStateConfig, n as TransitionsGraph, o as Padding, r as StateGraphEdge, s as GraphParamsProvider, t as StateChart, u as Transition } from "./StateChart-cXyVRcs-.js";
|
|
2
|
+
import { n as RuntimeListener, r as RuntimeStatechartApi, t as StateChartIndex } from "./StateChartIndex-BK2315qj.js";
|
|
3
|
+
export { type Dimensions, type FsmStateConfig, type GraphParamsProvider, type Label, type Padding, type Position, RuntimeListener, RuntimeStatechartApi, type StateChart, StateChartIndex, type StateGraphEdge, type StateGraphNode, type Transition, type TransitionsGraph };
|
package/dist/index-runtime.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { n as RuntimeStatechartApi, t as StateChartIndex } from "./StateChartIndex-BOIrc_nq.js";
|
|
2
|
+
export { RuntimeStatechartApi, StateChartIndex };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
declare function toKebabCase(str?: string): string;
|
|
9
|
-
|
|
10
|
-
export {
|
|
1
|
+
import { a as Position, c as Label, d as Dimensions, i as StateGraphNode, l as FsmStateConfig, n as TransitionsGraph, o as Padding, r as StateGraphEdge, s as GraphParamsProvider, t as StateChart, u as Transition } from "./StateChart-cXyVRcs-.js";
|
|
2
|
+
import { i as concatTransitionsToString, n as splitTransitionString, r as serializeProcessConfig, t as toFsmStateConfig } from "./toFsmStateConfig-DmOlTRjv.js";
|
|
3
|
+
import { a as getStateDescriptionRenderer, c as buildSections, d as toDomNodesIterator, f as visitDom, i as visitStateDescriptions, l as findSection, m as vistSections, n as StateDescriptionSection, o as renderSections, p as visitSectionNodes, r as getStatesDescriptions, s as DomSection, t as newTreeBuilder, u as isDomElement } from "./newTreeBuilder-CvtLDjGj.js";
|
|
4
|
+
import { a as buildStateDetailsStyle, c as buildStatechartStylesWithModifier, d as CssTree, f as serializeCss, i as activeTransitionsStyle, l as selectedStatesStyle, n as buildStatechartSvg, o as buildStateDetailsStyleWithModifier, p as buildStatechartCss, r as activeStatesStyle, s as buildStatechartStyles, t as buildStatechartsPanel, u as selectedTransitionsStyle } from "./buildStatechartsPanel-hCtZbdiF.js";
|
|
5
|
+
import { i as buildCharts, n as getGraphParamsProvider, r as buildFlatCharts, t as getLabelDimensions } from "./getLabelDimensions-BY0q7j3D.js";
|
|
6
|
+
import { n as RuntimeListener, r as RuntimeStatechartApi, t as StateChartIndex } from "./StateChartIndex-BK2315qj.js";
|
|
7
|
+
//#region src/utils/toKebabCase.d.ts
|
|
8
|
+
export declare function toKebabCase(str?: string): string;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { CssTree, type Dimensions, DomSection, type FsmStateConfig, type GraphParamsProvider, type Label, type Padding, type Position, RuntimeListener, RuntimeStatechartApi, type StateChart, StateChartIndex, StateDescriptionSection, type StateGraphEdge, type StateGraphNode, type Transition, type TransitionsGraph, activeStatesStyle, activeTransitionsStyle, buildCharts, buildFlatCharts, buildSections, buildStateDetailsStyle, buildStateDetailsStyleWithModifier, buildStatechartCss, buildStatechartStyles, buildStatechartStylesWithModifier, buildStatechartSvg, buildStatechartsPanel, concatTransitionsToString, findSection, getGraphParamsProvider, getLabelDimensions, getStateDescriptionRenderer, getStatesDescriptions, isDomElement, newTreeBuilder, renderSections, selectedStatesStyle, selectedTransitionsStyle, serializeCss, serializeProcessConfig, splitTransitionString, toDomNodesIterator, toFsmStateConfig, visitDom, visitSectionNodes, visitStateDescriptions, vistSections };
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/utils/toKebabCase.ts"],"mappings":";;;;;;;wBAAgB,YAAY"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
export { RuntimeStatechartApi, StateChartIndex
|
|
7
|
-
import './chunk-PKBMQBKP.js';
|
|
1
|
+
import { i as concatTransitionsToString, n as splitTransitionString, r as serializeProcessConfig, t as toFsmStateConfig } from "./toFsmStateConfig-DlJkyZni.js";
|
|
2
|
+
import { a as buildSections, c as toDomNodesIterator, d as vistSections, f as newTreeBuilder, i as visitStateDescriptions, l as visitDom, n as renderSections, o as findSection, r as getStatesDescriptions, s as isDomElement, t as getStateDescriptionRenderer, u as visitSectionNodes } from "./description-panels-DI2MNlbK.js";
|
|
3
|
+
import { a as activeTransitionsStyle, c as buildStatechartStyles, d as selectedTransitionsStyle, f as serializeCss, i as activeStatesStyle, l as buildStatechartStylesWithModifier, n as buildStatechartSvg, o as buildStateDetailsStyle, p as toKebabCase, r as buildStatechartCss, s as buildStateDetailsStyleWithModifier, t as buildStatechartsPanel, u as selectedStatesStyle } from "./buildStatechartsPanel-CxQlIwTh.js";
|
|
4
|
+
import { i as buildFlatCharts, n as getLabelDimensions, r as buildCharts, t as getGraphParamsProvider } from "./layout-Dp671N6q.js";
|
|
5
|
+
import { n as RuntimeStatechartApi, t as StateChartIndex } from "./StateChartIndex-BOIrc_nq.js";
|
|
6
|
+
export { RuntimeStatechartApi, StateChartIndex, activeStatesStyle, activeTransitionsStyle, buildCharts, buildFlatCharts, buildSections, buildStateDetailsStyle, buildStateDetailsStyleWithModifier, buildStatechartCss, buildStatechartStyles, buildStatechartStylesWithModifier, buildStatechartSvg, buildStatechartsPanel, concatTransitionsToString, findSection, getGraphParamsProvider, getLabelDimensions, getStateDescriptionRenderer, getStatesDescriptions, isDomElement, newTreeBuilder, renderSections, selectedStatesStyle, selectedTransitionsStyle, serializeCss, serializeProcessConfig, splitTransitionString, toDomNodesIterator, toFsmStateConfig, toKebabCase, visitDom, visitSectionNodes, visitStateDescriptions, vistSections };
|