jssm 5.135.0 → 5.137.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 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.135.0 at 5/27/2026, 10:29:45 PM
21
+ * Generated for version 5.137.0 at 5/27/2026, 11:01:17 PM
22
22
 
23
23
  -->
24
- # jssm 5.135.0
24
+ # jssm 5.137.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,230 tests at 100.0% line coverage
284
+ library.** 6,293 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,230 tests***, run 57,017 times.
417
+ ***6,293 tests***, run 57,080 times.
418
418
 
419
- - 5,717 specs with 100.0% coverage
420
- - 513 fuzz tests with 4.0% coverage
421
- - 4,865 TypeScript lines - 1.3 tests per line, 11.7 generated tests per line
419
+ - 5,780 specs with 100.0% coverage
420
+ - 513 fuzz tests with 3.8% coverage
421
+ - 5,092 TypeScript lines - 1.2 tests per line, 11.2 generated tests per line
422
422
 
423
423
  [![Actions Status](https://github.com/StoneCypher/jssm/workflows/Node%20CI/badge.svg)](https://github.com/StoneCypher/jssm/actions)
424
424
  [![NPM version](https://img.shields.io/npm/v/jssm.svg)](https://www.npmjs.com/package/jssm)
@@ -2,6 +2,263 @@
2
2
  "schemaVersion": "1.0.0",
3
3
  "readme": "",
4
4
  "modules": [
5
+ {
6
+ "kind": "javascript-module",
7
+ "path": "src/ts/wc/jssm_instance_wc.ts",
8
+ "declarations": [
9
+ {
10
+ "kind": "function",
11
+ "name": "resolve_fsl_source",
12
+ "return": {
13
+ "type": {
14
+ "text": ""
15
+ }
16
+ },
17
+ "parameters": [
18
+ {
19
+ "name": "host",
20
+ "type": {
21
+ "text": "HTMLElement"
22
+ },
23
+ "description": "The `<jssm-instance>` element being resolved."
24
+ },
25
+ {
26
+ "name": "fsl_attr",
27
+ "type": {
28
+ "text": "string"
29
+ },
30
+ "description": "The current value of the host's `fsl` attribute (or property), or empty string."
31
+ }
32
+ ],
33
+ "description": "Resolve a `<jssm-instance>`'s FSL source from the three legal channels:\r\nthe `fsl=\"\"` attribute, a child `<script type=\"text/fsl\">`, and the\r\nelement's own text content (after stripping the script and any\r\n`<jssm-*>` companion tags). Exactly one channel may be used; using\r\nnone or more than one is an error.\r\n\r\nPulled out as a pure function so it's testable without spinning up a\r\nLit element.\r\n\r\n```typescript\r\nconst div = document.createElement('div');\r\ndiv.setAttribute('fsl', 'Off -> On;');\r\nresolve_fsl_source(div as HTMLElement, 'Off -> On;');\r\n// => { fsl: 'Off -> On;', provided_count: 1, error: undefined }\r\n```"
34
+ },
35
+ {
36
+ "kind": "class",
37
+ "description": "Web component that owns a single `Machine<unknown>` constructed from an\r\nFSL source supplied via one of three mutually exclusive channels:\r\n\r\n 1. The `fsl=\"\"` attribute,\r\n 2. A child `<script type=\"text/fsl\">`,\r\n 3. The element's own text content (companion `<jssm-*>` children and\r\n any `<script type=\"text/fsl\">` are excluded from this channel).\r\n\r\nSupplying zero or more than one channel is a thrown error.\r\n\r\nOn every transition the component reflects machine state to its own\r\nattributes (`current-state`, `legal-actions`, `terminal`, `complete`)\r\nand sets a `--current-state` CSS custom property so consumer CSS can\r\nstyle by state without subclassing.",
38
+ "name": "JssmInstance",
39
+ "cssProperties": [
40
+ {
41
+ "description": "The machine's current state name as a CSS string token.",
42
+ "name": "--current-state"
43
+ }
44
+ ],
45
+ "slots": [
46
+ {
47
+ "description": "Heading area for the instance.",
48
+ "name": "title"
49
+ },
50
+ {
51
+ "description": "Visualization slot; fallback is a placeholder string.",
52
+ "name": "viz"
53
+ },
54
+ {
55
+ "description": "Editor surface slot.",
56
+ "name": "editor"
57
+ },
58
+ {
59
+ "description": "Slot for action buttons / UI.",
60
+ "name": "actions"
61
+ },
62
+ {
63
+ "description": "Slot for toolbar UI.",
64
+ "name": "toolbar"
65
+ },
66
+ {
67
+ "description": "Slot for an info / status panel.",
68
+ "name": "info-panel"
69
+ },
70
+ {
71
+ "description": "Footer slot.",
72
+ "name": "footer"
73
+ }
74
+ ],
75
+ "members": [
76
+ {
77
+ "kind": "field",
78
+ "name": "fsl",
79
+ "privacy": "public",
80
+ "type": {
81
+ "text": "string"
82
+ },
83
+ "default": "''",
84
+ "description": "FSL source attribute. When non-empty, this is the sole channel\r\nsupplying the machine's source. Setting both this and a child\r\n`<script type=\"text/fsl\">` (or non-empty text content) is an error.",
85
+ "attribute": "fsl"
86
+ },
87
+ {
88
+ "kind": "field",
89
+ "name": "_machine",
90
+ "type": {
91
+ "text": "Machine<unknown> | undefined"
92
+ },
93
+ "privacy": "private",
94
+ "default": "undefined",
95
+ "description": "The underlying machine instance, constructed at `connectedCallback`.\r\nExposed raw (not proxied) per the #639/#648 design decision so that\r\nconsumers can use the full Machine API directly.\r\n\r\nMarked optional because Lit will instantiate the element before\r\n`connectedCallback` runs; the instance is guaranteed present after\r\nconnection."
96
+ },
97
+ {
98
+ "kind": "field",
99
+ "name": "_action_listeners",
100
+ "type": {
101
+ "text": "Array<{\r\n target : EventTarget;\r\n event : string;\r\n handler : EventListener;\r\n }>"
102
+ },
103
+ "privacy": "private",
104
+ "default": "[]",
105
+ "description": "Records every DOM listener installed by `<jssm-action>` / `data-jssm-action`\r\ndiscovery so disconnectedCallback can remove each one with the\r\nsame handler reference originally passed to `addEventListener`.\r\n\r\nListeners installed via the dedicated `<jssm-action>` tag form may target\r\nelements outside the host (its `selector` is resolved against the host,\r\nbut matching elements live in the document tree), so cleanup must be\r\nexplicit — relying on the host's GC is not sufficient."
106
+ },
107
+ {
108
+ "kind": "field",
109
+ "name": "machine",
110
+ "type": {
111
+ "text": "Machine<unknown>"
112
+ },
113
+ "description": "Raw machine accessor. Returns the owned Machine instance.",
114
+ "readonly": true
115
+ },
116
+ {
117
+ "kind": "method",
118
+ "name": "do",
119
+ "return": {
120
+ "type": {
121
+ "text": ""
122
+ }
123
+ },
124
+ "parameters": [
125
+ {
126
+ "name": "action",
127
+ "type": {
128
+ "text": "string"
129
+ },
130
+ "description": "The action name to dispatch."
131
+ },
132
+ {
133
+ "name": "data",
134
+ "optional": true,
135
+ "type": {
136
+ "text": "unknown"
137
+ },
138
+ "description": "Optional data payload to pass to the action."
139
+ }
140
+ ],
141
+ "description": "Convenience wrapper for `machine.action(action, data)`.\r\nAfter the action, reflects updated state to host attributes and the\r\n`--current-state` CSS custom property, and requests a Lit update so\r\nthe state-specific `<slot name=\"state-...\">` can re-pick."
142
+ },
143
+ {
144
+ "kind": "method",
145
+ "name": "state",
146
+ "return": {
147
+ "type": {
148
+ "text": "string"
149
+ }
150
+ },
151
+ "description": "Convenience wrapper for `machine.state()`. Returns the current\r\nstate's name."
152
+ },
153
+ {
154
+ "kind": "method",
155
+ "name": "_discover_jssm_actions",
156
+ "privacy": "private",
157
+ "return": {
158
+ "type": {
159
+ "text": "void"
160
+ }
161
+ },
162
+ "description": "Wire DOM events to machine actions, using the two declarative forms from\r\nissue #640:\r\n\r\n 1. Inline attribute form: every descendant of the host carrying a\r\n `data-jssm-action=\"<name>\"` attribute receives a listener on the\r\n event named by `data-jssm-event` (default `click`).\r\n 2. Dedicated tag form: each direct `<jssm-action>` child of the host\r\n supplies a CSS `selector` (scoped to the host), an `action`, and an\r\n optional `event` (default `click`); every matching descendant\r\n receives a listener configured by the tag's attributes.\r\n\r\nBoth forms support optional `from-state` guards (dispatch only when the\r\nmachine's current state matches), `from-property` data extraction (pass\r\nthe source element's named property as the action's data argument), and\r\n`prevent-default` / `stop-propagation` modifiers.\r\n\r\nEvery installed listener is recorded in _action_listeners so\r\ndisconnectedCallback can detach them cleanly."
163
+ },
164
+ {
165
+ "kind": "method",
166
+ "name": "_install_action_listener",
167
+ "privacy": "private",
168
+ "return": {
169
+ "type": {
170
+ "text": "void"
171
+ }
172
+ },
173
+ "parameters": [
174
+ {
175
+ "name": "config",
176
+ "type": {
177
+ "text": "{\r\n source : HTMLElement;\r\n event_name : string;\r\n action_name : string;\r\n from_state : string | undefined;\r\n from_property : string | undefined;\r\n prevent_default : boolean;\r\n stop_propagation : boolean;\r\n }"
178
+ },
179
+ "description": "Listener configuration."
180
+ },
181
+ {
182
+ "description": "Element to attach the listener to.",
183
+ "name": "config.source"
184
+ },
185
+ {
186
+ "description": "DOM event to listen for.",
187
+ "name": "config.event_name"
188
+ },
189
+ {
190
+ "description": "Action to dispatch on the machine.",
191
+ "name": "config.action_name"
192
+ },
193
+ {
194
+ "description": "If set, only fire when `machine.state() === from_state`.",
195
+ "name": "config.from_state"
196
+ },
197
+ {
198
+ "description": "If set, pass `source[from_property]` as the action's data argument.",
199
+ "name": "config.from_property"
200
+ },
201
+ {
202
+ "description": "If true, call `e.preventDefault()` before checking the guard.",
203
+ "name": "config.prevent_default"
204
+ },
205
+ {
206
+ "description": "If true, call `e.stopPropagation()` before checking the guard.",
207
+ "name": "config.stop_propagation"
208
+ }
209
+ ],
210
+ "description": "Attach one DOM listener that translates a DOM event into a\r\n`machine.action(...)` call, honoring the configured modifiers. The\r\nlistener is recorded in _action_listeners so it can be removed\r\non disconnect."
211
+ },
212
+ {
213
+ "kind": "method",
214
+ "name": "_paint_state_reflection",
215
+ "privacy": "private",
216
+ "return": {
217
+ "type": {
218
+ "text": "void"
219
+ }
220
+ },
221
+ "description": "Reflect machine state onto host attributes and CSS custom properties.\r\nCalled after every transition and once during `connectedCallback`.\r\n\r\nMechanism 1 (#639): writes to host attributes.\r\nMechanism 3 (#639): writes to host inline-style custom properties."
222
+ }
223
+ ],
224
+ "attributes": [
225
+ {
226
+ "name": "fsl",
227
+ "type": {
228
+ "text": "string"
229
+ },
230
+ "default": "''",
231
+ "description": "FSL source attribute. When non-empty, this is the sole channel\r\nsupplying the machine's source. Setting both this and a child\r\n`<script type=\"text/fsl\">` (or non-empty text content) is an error.",
232
+ "fieldName": "fsl"
233
+ }
234
+ ],
235
+ "superclass": {
236
+ "name": "LitElement",
237
+ "package": "lit"
238
+ },
239
+ "tagName": "jssm-instance",
240
+ "customElement": true
241
+ }
242
+ ],
243
+ "exports": [
244
+ {
245
+ "kind": "js",
246
+ "name": "resolve_fsl_source",
247
+ "declaration": {
248
+ "name": "resolve_fsl_source",
249
+ "module": "src/ts/wc/jssm_instance_wc.ts"
250
+ }
251
+ },
252
+ {
253
+ "kind": "js",
254
+ "name": "JssmInstance",
255
+ "declaration": {
256
+ "name": "JssmInstance",
257
+ "module": "src/ts/wc/jssm_instance_wc.ts"
258
+ }
259
+ }
260
+ ]
261
+ },
5
262
  {
6
263
  "kind": "javascript-module",
7
264
  "path": "src/ts/wc/jssm_viz_wc.ts",