@tinyactors/scxmljs 0.1.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.
Files changed (89) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +174 -0
  3. package/THIRD_PARTY_NOTICES +63 -0
  4. package/dist/bridge.d.ts +44 -0
  5. package/dist/bridge.js +254 -0
  6. package/dist/bridge.js.map +1 -0
  7. package/dist/clock.d.ts +113 -0
  8. package/dist/clock.js +310 -0
  9. package/dist/clock.js.map +1 -0
  10. package/dist/common.d.ts +15 -0
  11. package/dist/common.js +14 -0
  12. package/dist/common.js.map +1 -0
  13. package/dist/datamodel-base.d.ts +122 -0
  14. package/dist/datamodel-base.js +268 -0
  15. package/dist/datamodel-base.js.map +1 -0
  16. package/dist/datamodel-quickjs.d.ts +21 -0
  17. package/dist/datamodel-quickjs.js +286 -0
  18. package/dist/datamodel-quickjs.js.map +1 -0
  19. package/dist/datamodel-trusted.d.ts +1 -0
  20. package/dist/datamodel-trusted.js +149 -0
  21. package/dist/datamodel-trusted.js.map +1 -0
  22. package/dist/diagnostics.d.ts +39 -0
  23. package/dist/diagnostics.js +154 -0
  24. package/dist/diagnostics.js.map +1 -0
  25. package/dist/element-events.d.ts +85 -0
  26. package/dist/element-events.js +129 -0
  27. package/dist/element-events.js.map +1 -0
  28. package/dist/events.d.ts +31 -0
  29. package/dist/events.js +33 -0
  30. package/dist/events.js.map +1 -0
  31. package/dist/explorer/element.d.ts +150 -0
  32. package/dist/explorer/element.js +1791 -0
  33. package/dist/explorer/element.js.map +1 -0
  34. package/dist/explorer/layout.d.ts +43 -0
  35. package/dist/explorer/layout.js +50 -0
  36. package/dist/explorer/layout.js.map +1 -0
  37. package/dist/explorer/strings.d.ts +275 -0
  38. package/dist/explorer/strings.js +135 -0
  39. package/dist/explorer/strings.js.map +1 -0
  40. package/dist/explorer/styles.d.ts +10 -0
  41. package/dist/explorer/styles.js +265 -0
  42. package/dist/explorer/styles.js.map +1 -0
  43. package/dist/explorer/viewmodel.d.ts +284 -0
  44. package/dist/explorer/viewmodel.js +481 -0
  45. package/dist/explorer/viewmodel.js.map +1 -0
  46. package/dist/explorer.d.ts +21 -0
  47. package/dist/explorer.js +22 -0
  48. package/dist/explorer.js.map +1 -0
  49. package/dist/index.d.ts +34 -0
  50. package/dist/index.js +39 -0
  51. package/dist/index.js.map +1 -0
  52. package/dist/model.d.ts +157 -0
  53. package/dist/model.js +485 -0
  54. package/dist/model.js.map +1 -0
  55. package/dist/session-events.d.ts +136 -0
  56. package/dist/session-events.js +114 -0
  57. package/dist/session-events.js.map +1 -0
  58. package/dist/session.d.ts +412 -0
  59. package/dist/session.js +1399 -0
  60. package/dist/session.js.map +1 -0
  61. package/dist/themes/tinyactors.css +44 -0
  62. package/dist/trusted.d.ts +15 -0
  63. package/dist/trusted.js +30 -0
  64. package/dist/trusted.js.map +1 -0
  65. package/dist/ui/announcer.d.ts +22 -0
  66. package/dist/ui/announcer.js +31 -0
  67. package/dist/ui/announcer.js.map +1 -0
  68. package/dist/ui/svg.d.ts +8 -0
  69. package/dist/ui/svg.js +29 -0
  70. package/dist/ui/svg.js.map +1 -0
  71. package/dist/ui/theme.d.ts +34 -0
  72. package/dist/ui/theme.js +151 -0
  73. package/dist/ui/theme.js.map +1 -0
  74. package/dist/view/element.d.ts +172 -0
  75. package/dist/view/element.js +1045 -0
  76. package/dist/view/element.js.map +1 -0
  77. package/dist/view/layout.d.ts +154 -0
  78. package/dist/view/layout.js +1122 -0
  79. package/dist/view/layout.js.map +1 -0
  80. package/dist/view/strings.d.ts +72 -0
  81. package/dist/view/strings.js +48 -0
  82. package/dist/view/strings.js.map +1 -0
  83. package/dist/view/styles.d.ts +1 -0
  84. package/dist/view/styles.js +115 -0
  85. package/dist/view/styles.js.map +1 -0
  86. package/dist/view.d.ts +20 -0
  87. package/dist/view.js +21 -0
  88. package/dist/view.js.map +1 -0
  89. package/package.json +87 -0
package/dist/view.js ADDED
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @tinyactors/scxmljs/view — the `<scxml-view>` custom element: a whole
3
+ * statechart, drawn and running, with no JavaScript of your own.
4
+ *
5
+ * <script type="module">import "@tinyactors/scxmljs/view";</script>
6
+ * <scxml-view src="traffic-light.scxml"></scxml-view>
7
+ *
8
+ * Importing this module registers `<scxml-view>`. The data model engine is
9
+ * loaded on demand: the QuickJS sandbox by default, the host's engine with
10
+ * the `trusted` attribute, and neither when you set the `session` property
11
+ * to a session of your own.
12
+ *
13
+ * The layout is exported too (`layoutChart`, `autoCollapse`), for hosts that
14
+ * draw charts themselves.
15
+ *
16
+ * @packageDocumentation
17
+ */
18
+ export { ScxmlView, ViewSourceError, } from "./view/element.js";
19
+ export { autoCollapse, layoutChart, } from "./view/layout.js";
20
+ export { defaultViewStrings } from "./view/strings.js";
21
+ //# sourceMappingURL=view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"view.js","sourceRoot":"","sources":["../src/view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACL,SAAS,EAOT,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,YAAY,EASZ,WAAW,GAKZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAwC,MAAM,mBAAmB,CAAC","sourcesContent":["/**\n * @tinyactors/scxmljs/view — the `<scxml-view>` custom element: a whole\n * statechart, drawn and running, with no JavaScript of your own.\n *\n * <script type=\"module\">import \"@tinyactors/scxmljs/view\";</script>\n * <scxml-view src=\"traffic-light.scxml\"></scxml-view>\n *\n * Importing this module registers `<scxml-view>`. The data model engine is\n * loaded on demand: the QuickJS sandbox by default, the host's engine with\n * the `trusted` attribute, and neither when you set the `session` property\n * to a session of your own.\n *\n * The layout is exported too (`layoutChart`, `autoCollapse`), for hosts that\n * draw charts themselves.\n *\n * @packageDocumentation\n */\nexport {\n ScxmlView,\n type ViewAnnounce,\n type ViewDirection,\n type ViewErrorDetail,\n type ViewLoadDetail,\n type ViewOptions,\n type ViewSendDetail,\n ViewSourceError,\n} from \"./view/element.ts\";\nexport {\n autoCollapse,\n type BoxKind,\n type BoxLayout,\n type ChartLayout,\n type Direction,\n type EdgeKind,\n type EdgeLayout,\n type InitialMarker,\n type LayoutOptions,\n layoutChart,\n type Point,\n type Rect,\n type Size,\n type Spacing,\n} from \"./view/layout.ts\";\nexport { defaultViewStrings, type ViewStateKind, type ViewStrings } from \"./view/strings.ts\";\n"]}
package/package.json ADDED
@@ -0,0 +1,87 @@
1
+ {
2
+ "name": "@tinyactors/scxmljs",
3
+ "version": "0.1.0",
4
+ "description": "A correctness-first SCXML 1.0 interpreter (ECMAScript data model) for the browser and Node, with custom elements for interactive statechart diagrams.",
5
+ "keywords": [
6
+ "scxml",
7
+ "statechart",
8
+ "statecharts",
9
+ "state-machine",
10
+ "harel",
11
+ "w3c",
12
+ "interpreter",
13
+ "quickjs",
14
+ "sandbox",
15
+ "custom-elements"
16
+ ],
17
+ "author": "Dario Hamidi <dario.hamidi@gmail.com>",
18
+ "license": "MIT",
19
+ "homepage": "https://github.com/tinyactors-dev/scxmljs#readme",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/tinyactors-dev/scxmljs.git",
23
+ "directory": "packages/scxmljs"
24
+ },
25
+ "bugs": {
26
+ "url": "https://github.com/tinyactors-dev/scxmljs/issues"
27
+ },
28
+ "type": "module",
29
+ "sideEffects": [
30
+ "./dist/explorer.js",
31
+ "./dist/explorer/element.js",
32
+ "./dist/view.js",
33
+ "./dist/view/element.js",
34
+ "./src/explorer.ts",
35
+ "./src/explorer/element.ts",
36
+ "./src/view.ts",
37
+ "./src/view/element.ts",
38
+ "*.css"
39
+ ],
40
+ "exports": {
41
+ ".": {
42
+ "types": "./dist/index.d.ts",
43
+ "import": "./dist/index.js",
44
+ "default": "./dist/index.js"
45
+ },
46
+ "./trusted": {
47
+ "types": "./dist/trusted.d.ts",
48
+ "import": "./dist/trusted.js",
49
+ "default": "./dist/trusted.js"
50
+ },
51
+ "./explorer": {
52
+ "types": "./dist/explorer.d.ts",
53
+ "import": "./dist/explorer.js",
54
+ "default": "./dist/explorer.js"
55
+ },
56
+ "./view": {
57
+ "types": "./dist/view.d.ts",
58
+ "import": "./dist/view.js",
59
+ "default": "./dist/view.js"
60
+ },
61
+ "./themes/tinyactors.css": "./dist/themes/tinyactors.css",
62
+ "./package.json": "./package.json"
63
+ },
64
+ "types": "./dist/index.d.ts",
65
+ "files": [
66
+ "dist",
67
+ "THIRD_PARTY_NOTICES"
68
+ ],
69
+ "engines": {
70
+ "node": ">=22.3"
71
+ },
72
+ "scripts": {
73
+ "build": "bun scripts/build.ts",
74
+ "prepack": "bun run build",
75
+ "smoke": "node scripts/smoke-node.mjs"
76
+ },
77
+ "dependencies": {
78
+ "@jitl/quickjs-singlefile-browser-release-sync": "0.32.0",
79
+ "quickjs-emscripten-core": "0.32.0"
80
+ },
81
+ "devDependencies": {
82
+ "happy-dom": "20.14.5"
83
+ },
84
+ "publishConfig": {
85
+ "access": "public"
86
+ }
87
+ }