jssm 5.135.0 → 5.136.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 +7 -7
- package/custom-elements.json +188 -0
- package/dist/cdn/instance.js +25361 -0
- package/dist/cdn/viz.js +1 -1
- package/dist/cli/fsl-render.cjs +1 -1
- package/dist/cli/fsl.cjs +1 -1
- package/dist/deno/README.md +7 -7
- package/dist/deno/jssm.js +1 -1
- 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/dist/wc/instance.define.js +6 -0
- package/dist/wc/instance.js +288 -0
- package/package.json +16 -2
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.136.0 at 5/27/2026, 10:35:53 PM
|
|
22
22
|
|
|
23
23
|
-->
|
|
24
|
-
# jssm 5.
|
|
24
|
+
# jssm 5.136.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,277 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,277 tests***, run 57,064 times.
|
|
418
418
|
|
|
419
|
-
- 5,
|
|
420
|
-
- 513 fuzz tests with
|
|
421
|
-
-
|
|
419
|
+
- 5,764 specs with 100.0% coverage
|
|
420
|
+
- 513 fuzz tests with 3.8% coverage
|
|
421
|
+
- 5,014 TypeScript lines - 1.3 tests per line, 11.4 generated tests per line
|
|
422
422
|
|
|
423
423
|
[](https://github.com/StoneCypher/jssm/actions)
|
|
424
424
|
[](https://www.npmjs.com/package/jssm)
|
package/custom-elements.json
CHANGED
|
@@ -2,6 +2,194 @@
|
|
|
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:\nthe `fsl=\"\"` attribute, a child `<script type=\"text/fsl\">`, and the\nelement's own text content (after stripping the script and any\n`<jssm-*>` companion tags). Exactly one channel may be used; using\nnone or more than one is an error.\n\nPulled out as a pure function so it's testable without spinning up a\nLit element.\n\n```typescript\nconst div = document.createElement('div');\ndiv.setAttribute('fsl', 'Off -> On;');\nresolve_fsl_source(div as HTMLElement, 'Off -> On;');\n// => { fsl: 'Off -> On;', provided_count: 1, error: undefined }\n```"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"kind": "class",
|
|
37
|
+
"description": "Web component that owns a single `Machine<unknown>` constructed from an\nFSL source supplied via one of three mutually exclusive channels:\n\n 1. The `fsl=\"\"` attribute,\n 2. A child `<script type=\"text/fsl\">`,\n 3. The element's own text content (companion `<jssm-*>` children and\n any `<script type=\"text/fsl\">` are excluded from this channel).\n\nSupplying zero or more than one channel is a thrown error.\n\nOn every transition the component reflects machine state to its own\nattributes (`current-state`, `legal-actions`, `terminal`, `complete`)\nand sets a `--current-state` CSS custom property so consumer CSS can\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\nsupplying the machine's source. Setting both this and a child\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`.\nExposed raw (not proxied) per the #639/#648 design decision so that\nconsumers can use the full Machine API directly.\n\nMarked optional because Lit will instantiate the element before\n`connectedCallback` runs; the instance is guaranteed present after\nconnection."
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"kind": "field",
|
|
99
|
+
"name": "machine",
|
|
100
|
+
"type": {
|
|
101
|
+
"text": "Machine<unknown>"
|
|
102
|
+
},
|
|
103
|
+
"description": "Raw machine accessor. Returns the owned Machine instance.",
|
|
104
|
+
"readonly": true
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"kind": "method",
|
|
108
|
+
"name": "do",
|
|
109
|
+
"return": {
|
|
110
|
+
"type": {
|
|
111
|
+
"text": ""
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"parameters": [
|
|
115
|
+
{
|
|
116
|
+
"name": "action",
|
|
117
|
+
"type": {
|
|
118
|
+
"text": "string"
|
|
119
|
+
},
|
|
120
|
+
"description": "The action name to dispatch."
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "data",
|
|
124
|
+
"optional": true,
|
|
125
|
+
"type": {
|
|
126
|
+
"text": "unknown"
|
|
127
|
+
},
|
|
128
|
+
"description": "Optional data payload to pass to the action."
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"description": "Convenience wrapper for `machine.action(action, data)`.\nAfter the action, reflects updated state to host attributes and the\n`--current-state` CSS custom property, and requests a Lit update so\nthe state-specific `<slot name=\"state-...\">` can re-pick."
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"kind": "method",
|
|
135
|
+
"name": "state",
|
|
136
|
+
"return": {
|
|
137
|
+
"type": {
|
|
138
|
+
"text": "string"
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"description": "Convenience wrapper for `machine.state()`. Returns the current\nstate's name."
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"kind": "method",
|
|
145
|
+
"name": "_paint_state_reflection",
|
|
146
|
+
"privacy": "private",
|
|
147
|
+
"return": {
|
|
148
|
+
"type": {
|
|
149
|
+
"text": "void"
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"description": "Reflect machine state onto host attributes and CSS custom properties.\nCalled after every transition and once during `connectedCallback`.\n\nMechanism 1 (#639): writes to host attributes.\nMechanism 3 (#639): writes to host inline-style custom properties."
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
"attributes": [
|
|
156
|
+
{
|
|
157
|
+
"name": "fsl",
|
|
158
|
+
"type": {
|
|
159
|
+
"text": "string"
|
|
160
|
+
},
|
|
161
|
+
"default": "''",
|
|
162
|
+
"description": "FSL source attribute. When non-empty, this is the sole channel\nsupplying the machine's source. Setting both this and a child\n`<script type=\"text/fsl\">` (or non-empty text content) is an error.",
|
|
163
|
+
"fieldName": "fsl"
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
"superclass": {
|
|
167
|
+
"name": "LitElement",
|
|
168
|
+
"package": "lit"
|
|
169
|
+
},
|
|
170
|
+
"tagName": "jssm-instance",
|
|
171
|
+
"customElement": true
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
"exports": [
|
|
175
|
+
{
|
|
176
|
+
"kind": "js",
|
|
177
|
+
"name": "resolve_fsl_source",
|
|
178
|
+
"declaration": {
|
|
179
|
+
"name": "resolve_fsl_source",
|
|
180
|
+
"module": "src/ts/wc/jssm_instance_wc.ts"
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"kind": "js",
|
|
185
|
+
"name": "JssmInstance",
|
|
186
|
+
"declaration": {
|
|
187
|
+
"name": "JssmInstance",
|
|
188
|
+
"module": "src/ts/wc/jssm_instance_wc.ts"
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
]
|
|
192
|
+
},
|
|
5
193
|
{
|
|
6
194
|
"kind": "javascript-module",
|
|
7
195
|
"path": "src/ts/wc/jssm_viz_wc.ts",
|