jssm 5.147.10 → 5.148.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 +7 -7
- package/custom-elements.json +2618 -617
- package/dist/cdn/instance.js +1526 -921
- package/dist/cdn/viz.js +990 -872
- package/dist/cli/fsl-export-system-prompt.cjs +1 -1
- package/dist/cli/fsl-render.cjs +1 -1
- package/dist/cli/fsl.cjs +1 -1
- package/dist/cli/lib.cjs +1 -1
- package/dist/cli/lib.mjs +1 -1
- package/dist/cm6/fsl_language.js +15 -2
- package/dist/deno/README.md +7 -7
- package/dist/deno/jssm.d.ts +1 -0
- 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/editor.define.js +52 -0
- package/dist/wc/editor.js +397 -0
- package/dist/wc/instance.js +589 -56
- package/dist/wc/viz.js +87 -5
- package/dist/wc/widgets.define.js +65 -0
- package/dist/wc/widgets.js +1113 -0
- package/jssm.es5.d.cts +90 -1
- package/jssm.es6.d.ts +90 -1
- package/package.json +30 -4
package/jssm.es5.d.cts
CHANGED
|
@@ -1783,6 +1783,95 @@ declare namespace jssm_constants_d {
|
|
|
1783
1783
|
};
|
|
1784
1784
|
}
|
|
1785
1785
|
|
|
1786
|
+
/**
|
|
1787
|
+
* Editor-agnostic data types for the FSL language service.
|
|
1788
|
+
*
|
|
1789
|
+
* These are the neutral contract every editor adapter (CodeMirror, VS Code, a
|
|
1790
|
+
* future LSP server) converts to/from. Shapes are kept aligned with LSP types so
|
|
1791
|
+
* an LSP wrapper is a near-mechanical mapping.
|
|
1792
|
+
*/
|
|
1793
|
+
/** A character-offset range in the FSL source. */
|
|
1794
|
+
interface Range {
|
|
1795
|
+
from: number;
|
|
1796
|
+
to: number;
|
|
1797
|
+
}
|
|
1798
|
+
/** Diagnostic severity, aligned with LSP severities. */
|
|
1799
|
+
declare type DiagnosticSeverity = 'error' | 'warning' | 'info' | 'hint';
|
|
1800
|
+
/** An editor-agnostic diagnostic (one parse/compile problem). */
|
|
1801
|
+
interface Diagnostic {
|
|
1802
|
+
range: Range;
|
|
1803
|
+
severity: DiagnosticSeverity;
|
|
1804
|
+
message: string;
|
|
1805
|
+
}
|
|
1806
|
+
/** What a completion item suggests, so adapters can pick an icon. */
|
|
1807
|
+
declare type CompletionKind = 'key' | 'value-color' | 'value-shape' | 'value-enum';
|
|
1808
|
+
/** An editor-agnostic completion suggestion. */
|
|
1809
|
+
interface CompletionItem {
|
|
1810
|
+
label: string;
|
|
1811
|
+
kind: CompletionKind;
|
|
1812
|
+
detail?: string;
|
|
1813
|
+
}
|
|
1814
|
+
/** Parser-derived semantic role of a source span. */
|
|
1815
|
+
declare type SemanticSpanKind = 'color' | 'state' | 'enum';
|
|
1816
|
+
/** An editor-agnostic semantic span (for decorations / semantic tokens). */
|
|
1817
|
+
interface SemanticSpan extends Range {
|
|
1818
|
+
kind: SemanticSpanKind;
|
|
1819
|
+
value?: string;
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
/**
|
|
1823
|
+
* Editor-agnostic FSL diagnostics: parse then compile, reporting problems as
|
|
1824
|
+
* neutral {@link Diagnostic}s. Adapters map these to CodeMirror lint diagnostics,
|
|
1825
|
+
* VS Code markers, or LSP `Diagnostic`s.
|
|
1826
|
+
*
|
|
1827
|
+
* Parse errors (peg.js) carry `.location`; compile errors carry
|
|
1828
|
+
* `.source_location` *when they reference a parsed node* — but machine-level
|
|
1829
|
+
* compile errors (e.g. an empty machine, an unknown machine rule) have none, so
|
|
1830
|
+
* the location is treated as optional and falls back to the whole document.
|
|
1831
|
+
*/
|
|
1832
|
+
|
|
1833
|
+
/**
|
|
1834
|
+
* Parse then compile `text`, returning a list of diagnostics — empty when the
|
|
1835
|
+
* machine parses and compiles cleanly.
|
|
1836
|
+
*
|
|
1837
|
+
* @example
|
|
1838
|
+
* fslDiagnostics('a -> b;'); // => []
|
|
1839
|
+
* fslDiagnostics('a -> ;')[0].severity; // => 'error'
|
|
1840
|
+
*/
|
|
1841
|
+
declare function fslDiagnostics(text: string): Diagnostic[];
|
|
1842
|
+
|
|
1843
|
+
/**
|
|
1844
|
+
* Context-aware, editor-agnostic FSL completions. Value suggestions after a
|
|
1845
|
+
* `key:`, key suggestions at a statement start (top-level vs inside a `{ }`
|
|
1846
|
+
* block, by brace depth). Adapters convert {@link CompletionItem}s to their own
|
|
1847
|
+
* completion type. Value vocab is jssm's own (`gviz_shapes`, `named_colors`,
|
|
1848
|
+
* `FslDirections`), so it cannot drift from the renderer.
|
|
1849
|
+
*/
|
|
1850
|
+
|
|
1851
|
+
/**
|
|
1852
|
+
* Completions for the caret at `offset` in `text`.
|
|
1853
|
+
*
|
|
1854
|
+
* @example
|
|
1855
|
+
* fslCompletions('state x : { color: ', 19)[0].kind; // => 'value-color'
|
|
1856
|
+
*/
|
|
1857
|
+
declare function fslCompletions(text: string, offset: number): CompletionItem[];
|
|
1858
|
+
|
|
1859
|
+
/**
|
|
1860
|
+
* Parser-derived semantic spans for FSL: color values (with resolved hex),
|
|
1861
|
+
* state names, and shape-enum values. Returns `[]` if the document does not
|
|
1862
|
+
* parse. Editor-agnostic — adapters map spans to decorations or semantic
|
|
1863
|
+
* tokens. Logic is a verified port of the sketch's `semantic_overlay.mjs`.
|
|
1864
|
+
*/
|
|
1865
|
+
|
|
1866
|
+
/**
|
|
1867
|
+
* Collect color / state / shape-enum semantic spans from `text`.
|
|
1868
|
+
*
|
|
1869
|
+
* @example
|
|
1870
|
+
* fslSemanticSpans('state s : { color: crimson; };')
|
|
1871
|
+
* .find(s => s.kind === 'color')?.value; // => '#dc143cff'
|
|
1872
|
+
*/
|
|
1873
|
+
declare function fslSemanticSpans(text: string): SemanticSpan[];
|
|
1874
|
+
|
|
1786
1875
|
/**
|
|
1787
1876
|
* The published semantic version of the jssm package this build was cut from.
|
|
1788
1877
|
* Mirrored from `package.json` by `src/buildjs/makever.cjs` at build time.
|
|
@@ -4566,4 +4655,4 @@ declare function compareVersions(v1: string, v2: string): number;
|
|
|
4566
4655
|
*/
|
|
4567
4656
|
declare function deserialize<mDT>(machine_string: string, ser: JssmSerialization<mDT>): Machine<mDT>;
|
|
4568
4657
|
|
|
4569
|
-
export { FslDirections, Machine, abstract_everything_hook_step, abstract_hook_step, action_label_chars, arrow_direction, arrow_left_kind, arrow_right_kind, build_time, compareVersions, compile, jssm_constants_d as constants, deserialize, find_repeated, from, gen_splitmix32, gviz_shapes, histograph, is_hook_complex_result, is_hook_rejection, make, named_colors, wrap_parse as parse, seq, shapes, sleep, sm, state_name_chars, state_name_first_chars, state_style_condense, transfer_state_properties, unique, version, weighted_histo_key, weighted_rand_select, weighted_sample_select };
|
|
4658
|
+
export { FslDirections, Machine, abstract_everything_hook_step, abstract_hook_step, action_label_chars, arrow_direction, arrow_left_kind, arrow_right_kind, build_time, compareVersions, compile, jssm_constants_d as constants, deserialize, find_repeated, from, fslCompletions, fslDiagnostics, fslSemanticSpans, gen_splitmix32, gviz_shapes, histograph, is_hook_complex_result, is_hook_rejection, make, named_colors, wrap_parse as parse, seq, shapes, sleep, sm, state_name_chars, state_name_first_chars, state_style_condense, transfer_state_properties, unique, version, weighted_histo_key, weighted_rand_select, weighted_sample_select };
|
package/jssm.es6.d.ts
CHANGED
|
@@ -1783,6 +1783,95 @@ declare namespace jssm_constants_d {
|
|
|
1783
1783
|
};
|
|
1784
1784
|
}
|
|
1785
1785
|
|
|
1786
|
+
/**
|
|
1787
|
+
* Editor-agnostic data types for the FSL language service.
|
|
1788
|
+
*
|
|
1789
|
+
* These are the neutral contract every editor adapter (CodeMirror, VS Code, a
|
|
1790
|
+
* future LSP server) converts to/from. Shapes are kept aligned with LSP types so
|
|
1791
|
+
* an LSP wrapper is a near-mechanical mapping.
|
|
1792
|
+
*/
|
|
1793
|
+
/** A character-offset range in the FSL source. */
|
|
1794
|
+
interface Range {
|
|
1795
|
+
from: number;
|
|
1796
|
+
to: number;
|
|
1797
|
+
}
|
|
1798
|
+
/** Diagnostic severity, aligned with LSP severities. */
|
|
1799
|
+
declare type DiagnosticSeverity = 'error' | 'warning' | 'info' | 'hint';
|
|
1800
|
+
/** An editor-agnostic diagnostic (one parse/compile problem). */
|
|
1801
|
+
interface Diagnostic {
|
|
1802
|
+
range: Range;
|
|
1803
|
+
severity: DiagnosticSeverity;
|
|
1804
|
+
message: string;
|
|
1805
|
+
}
|
|
1806
|
+
/** What a completion item suggests, so adapters can pick an icon. */
|
|
1807
|
+
declare type CompletionKind = 'key' | 'value-color' | 'value-shape' | 'value-enum';
|
|
1808
|
+
/** An editor-agnostic completion suggestion. */
|
|
1809
|
+
interface CompletionItem {
|
|
1810
|
+
label: string;
|
|
1811
|
+
kind: CompletionKind;
|
|
1812
|
+
detail?: string;
|
|
1813
|
+
}
|
|
1814
|
+
/** Parser-derived semantic role of a source span. */
|
|
1815
|
+
declare type SemanticSpanKind = 'color' | 'state' | 'enum';
|
|
1816
|
+
/** An editor-agnostic semantic span (for decorations / semantic tokens). */
|
|
1817
|
+
interface SemanticSpan extends Range {
|
|
1818
|
+
kind: SemanticSpanKind;
|
|
1819
|
+
value?: string;
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
/**
|
|
1823
|
+
* Editor-agnostic FSL diagnostics: parse then compile, reporting problems as
|
|
1824
|
+
* neutral {@link Diagnostic}s. Adapters map these to CodeMirror lint diagnostics,
|
|
1825
|
+
* VS Code markers, or LSP `Diagnostic`s.
|
|
1826
|
+
*
|
|
1827
|
+
* Parse errors (peg.js) carry `.location`; compile errors carry
|
|
1828
|
+
* `.source_location` *when they reference a parsed node* — but machine-level
|
|
1829
|
+
* compile errors (e.g. an empty machine, an unknown machine rule) have none, so
|
|
1830
|
+
* the location is treated as optional and falls back to the whole document.
|
|
1831
|
+
*/
|
|
1832
|
+
|
|
1833
|
+
/**
|
|
1834
|
+
* Parse then compile `text`, returning a list of diagnostics — empty when the
|
|
1835
|
+
* machine parses and compiles cleanly.
|
|
1836
|
+
*
|
|
1837
|
+
* @example
|
|
1838
|
+
* fslDiagnostics('a -> b;'); // => []
|
|
1839
|
+
* fslDiagnostics('a -> ;')[0].severity; // => 'error'
|
|
1840
|
+
*/
|
|
1841
|
+
declare function fslDiagnostics(text: string): Diagnostic[];
|
|
1842
|
+
|
|
1843
|
+
/**
|
|
1844
|
+
* Context-aware, editor-agnostic FSL completions. Value suggestions after a
|
|
1845
|
+
* `key:`, key suggestions at a statement start (top-level vs inside a `{ }`
|
|
1846
|
+
* block, by brace depth). Adapters convert {@link CompletionItem}s to their own
|
|
1847
|
+
* completion type. Value vocab is jssm's own (`gviz_shapes`, `named_colors`,
|
|
1848
|
+
* `FslDirections`), so it cannot drift from the renderer.
|
|
1849
|
+
*/
|
|
1850
|
+
|
|
1851
|
+
/**
|
|
1852
|
+
* Completions for the caret at `offset` in `text`.
|
|
1853
|
+
*
|
|
1854
|
+
* @example
|
|
1855
|
+
* fslCompletions('state x : { color: ', 19)[0].kind; // => 'value-color'
|
|
1856
|
+
*/
|
|
1857
|
+
declare function fslCompletions(text: string, offset: number): CompletionItem[];
|
|
1858
|
+
|
|
1859
|
+
/**
|
|
1860
|
+
* Parser-derived semantic spans for FSL: color values (with resolved hex),
|
|
1861
|
+
* state names, and shape-enum values. Returns `[]` if the document does not
|
|
1862
|
+
* parse. Editor-agnostic — adapters map spans to decorations or semantic
|
|
1863
|
+
* tokens. Logic is a verified port of the sketch's `semantic_overlay.mjs`.
|
|
1864
|
+
*/
|
|
1865
|
+
|
|
1866
|
+
/**
|
|
1867
|
+
* Collect color / state / shape-enum semantic spans from `text`.
|
|
1868
|
+
*
|
|
1869
|
+
* @example
|
|
1870
|
+
* fslSemanticSpans('state s : { color: crimson; };')
|
|
1871
|
+
* .find(s => s.kind === 'color')?.value; // => '#dc143cff'
|
|
1872
|
+
*/
|
|
1873
|
+
declare function fslSemanticSpans(text: string): SemanticSpan[];
|
|
1874
|
+
|
|
1786
1875
|
/**
|
|
1787
1876
|
* The published semantic version of the jssm package this build was cut from.
|
|
1788
1877
|
* Mirrored from `package.json` by `src/buildjs/makever.cjs` at build time.
|
|
@@ -4566,4 +4655,4 @@ declare function compareVersions(v1: string, v2: string): number;
|
|
|
4566
4655
|
*/
|
|
4567
4656
|
declare function deserialize<mDT>(machine_string: string, ser: JssmSerialization<mDT>): Machine<mDT>;
|
|
4568
4657
|
|
|
4569
|
-
export { FslDirections, Machine, abstract_everything_hook_step, abstract_hook_step, action_label_chars, arrow_direction, arrow_left_kind, arrow_right_kind, build_time, compareVersions, compile, jssm_constants_d as constants, deserialize, find_repeated, from, gen_splitmix32, gviz_shapes, histograph, is_hook_complex_result, is_hook_rejection, make, named_colors, wrap_parse as parse, seq, shapes, sleep, sm, state_name_chars, state_name_first_chars, state_style_condense, transfer_state_properties, unique, version, weighted_histo_key, weighted_rand_select, weighted_sample_select };
|
|
4658
|
+
export { FslDirections, Machine, abstract_everything_hook_step, abstract_hook_step, action_label_chars, arrow_direction, arrow_left_kind, arrow_right_kind, build_time, compareVersions, compile, jssm_constants_d as constants, deserialize, find_repeated, from, fslCompletions, fslDiagnostics, fslSemanticSpans, gen_splitmix32, gviz_shapes, histograph, is_hook_complex_result, is_hook_rejection, make, named_colors, wrap_parse as parse, seq, shapes, sleep, sm, state_name_chars, state_name_first_chars, state_style_condense, transfer_state_properties, unique, version, weighted_histo_key, weighted_rand_select, weighted_sample_select };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jssm",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.148.1",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=10.0.0"
|
|
6
6
|
},
|
|
@@ -66,6 +66,22 @@
|
|
|
66
66
|
"import": "./dist/wc/instance.define.js",
|
|
67
67
|
"default": "./dist/wc/instance.define.js"
|
|
68
68
|
},
|
|
69
|
+
"./wc/editor": {
|
|
70
|
+
"import": "./dist/wc/editor.js",
|
|
71
|
+
"default": "./dist/wc/editor.js"
|
|
72
|
+
},
|
|
73
|
+
"./wc/editor/define": {
|
|
74
|
+
"import": "./dist/wc/editor.define.js",
|
|
75
|
+
"default": "./dist/wc/editor.define.js"
|
|
76
|
+
},
|
|
77
|
+
"./wc/widgets": {
|
|
78
|
+
"import": "./dist/wc/widgets.js",
|
|
79
|
+
"default": "./dist/wc/widgets.js"
|
|
80
|
+
},
|
|
81
|
+
"./wc/widgets/define": {
|
|
82
|
+
"import": "./dist/wc/widgets.define.js",
|
|
83
|
+
"default": "./dist/wc/widgets.define.js"
|
|
84
|
+
},
|
|
69
85
|
"./cm6": {
|
|
70
86
|
"types": "./dist/es6/cm6/fsl_language.d.ts",
|
|
71
87
|
"import": "./dist/cm6/fsl_language.js",
|
|
@@ -103,6 +119,10 @@
|
|
|
103
119
|
"dist/wc/viz.define.js",
|
|
104
120
|
"dist/wc/instance.js",
|
|
105
121
|
"dist/wc/instance.define.js",
|
|
122
|
+
"dist/wc/editor.js",
|
|
123
|
+
"dist/wc/editor.define.js",
|
|
124
|
+
"dist/wc/widgets.js",
|
|
125
|
+
"dist/wc/widgets.define.js",
|
|
106
126
|
"dist/cm6/fsl_language.js",
|
|
107
127
|
"dist/es6/cm6/fsl_language.d.ts",
|
|
108
128
|
"dist/cdn/viz.js",
|
|
@@ -165,13 +185,15 @@
|
|
|
165
185
|
"make_wc_viz_cdn": "rollup -c rollup.config.wc.viz.cdn.js",
|
|
166
186
|
"make_wc_instance_es6": "rollup -c rollup.config.wc.instance.es6.js",
|
|
167
187
|
"make_wc_instance_cdn": "rollup -c rollup.config.wc.instance.cdn.js",
|
|
188
|
+
"make_wc_editor_es6": "rollup -c rollup.config.wc.editor.es6.js",
|
|
189
|
+
"make_wc_widgets_es6": "rollup -c rollup.config.wc.widgets.es6.js",
|
|
168
190
|
"make_cm6": "rollup -c rollup.config.cm6.es6.js",
|
|
169
191
|
"typescript": "tsc --build tsconfig.json",
|
|
170
192
|
"makever": "node src/buildjs/makever.cjs",
|
|
171
193
|
"make_doctests": "node src/buildjs/extract_examples.cjs",
|
|
172
194
|
"prep": "npm run makever && npm run peg",
|
|
173
195
|
"make": "node src/buildjs/run_build.cjs --profile=fast",
|
|
174
|
-
"make_ci": "npm run clean && npm run makever && npm run peg && npm run build:cem && npm run typescript && npm run make_doctests && npm run make_wc_viz_es6 && npm run make_wc_viz_cdn && npm run make_wc_instance_es6 && npm run make_wc_instance_cdn && npm run make_cm6 && npm run typecheck_cli && npm run make_cli",
|
|
196
|
+
"make_ci": "npm run clean && npm run makever && npm run peg && npm run build:cem && npm run typescript && npm run make_doctests && npm run make_wc_viz_es6 && npm run make_wc_viz_cdn && npm run make_wc_instance_es6 && npm run make_wc_instance_cdn && npm run make_wc_editor_es6 && npm run make_wc_widgets_es6 && npm run make_cm6 && npm run typecheck_cli && npm run make_cli",
|
|
175
197
|
"eslint": "eslint --color src/ts/jssm.ts src/ts/jssm_types.ts src/ts/tests/*.ts",
|
|
176
198
|
"audit": "text_audit -r -t major MAJOR wasteful WASTEFUL any mixed fixme FIXME checkme CHECKME testme TESTME stochable STOCHABLE todo TODO comeback COMEBACK whargarbl WHARGARBL -g ./src/ts/**/*.{js,ts}",
|
|
177
199
|
"vet": "npm run eslint && npm run audit",
|
|
@@ -250,8 +272,12 @@
|
|
|
250
272
|
},
|
|
251
273
|
"homepage": "https://stonecypher.github.io/jssm/",
|
|
252
274
|
"devDependencies": {
|
|
275
|
+
"@codemirror/autocomplete": "^6.20.3",
|
|
276
|
+
"@codemirror/commands": "^6.10.4",
|
|
253
277
|
"@codemirror/language": "^6.12.3",
|
|
278
|
+
"@codemirror/lint": "^6.9.7",
|
|
254
279
|
"@codemirror/state": "^6.6.0",
|
|
280
|
+
"@codemirror/view": "^6.43.2",
|
|
255
281
|
"@custom-elements-manifest/analyzer": "^0.10.4",
|
|
256
282
|
"@knodes/typedoc-plugin-pages": "^0.22.5",
|
|
257
283
|
"@lezer/highlight": "^1.2.3",
|
|
@@ -304,10 +330,10 @@
|
|
|
304
330
|
"reduce-to-639-1": "^1.1.0"
|
|
305
331
|
},
|
|
306
332
|
"peerDependencies": {
|
|
307
|
-
"lit": ">=3",
|
|
308
333
|
"@codemirror/language": ">=6",
|
|
309
334
|
"@codemirror/state": ">=6",
|
|
310
|
-
"@lezer/highlight": ">=1"
|
|
335
|
+
"@lezer/highlight": ">=1",
|
|
336
|
+
"lit": ">=3"
|
|
311
337
|
},
|
|
312
338
|
"peerDependenciesMeta": {
|
|
313
339
|
"lit": {
|