@tinyactors/scxmljs 0.2.0-dev.0 → 0.2.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 (51) hide show
  1. package/README.md +9 -9
  2. package/dist/explorer/element.d.ts +5 -3
  3. package/dist/explorer/element.js +523 -262
  4. package/dist/explorer/element.js.map +1 -1
  5. package/dist/explorer/strings.d.ts +41 -23
  6. package/dist/explorer/strings.js +24 -15
  7. package/dist/explorer/strings.js.map +1 -1
  8. package/dist/explorer/styles.d.ts +9 -1
  9. package/dist/explorer/styles.js +291 -150
  10. package/dist/explorer/styles.js.map +1 -1
  11. package/dist/explorer.d.ts +1 -0
  12. package/dist/index.d.ts +1 -0
  13. package/dist/model.d.ts +4 -1
  14. package/dist/model.js +7 -1
  15. package/dist/model.js.map +1 -1
  16. package/dist/session.d.ts +22 -9
  17. package/dist/session.js +53 -13
  18. package/dist/session.js.map +1 -1
  19. package/dist/themes/tinyactors.css +1 -0
  20. package/dist/trusted.d.ts +1 -0
  21. package/dist/ui/icons.d.ts +31 -0
  22. package/dist/ui/icons.js +186 -0
  23. package/dist/ui/icons.js.map +1 -0
  24. package/dist/ui/notation.d.ts +53 -0
  25. package/dist/ui/notation.js +117 -0
  26. package/dist/ui/notation.js.map +1 -0
  27. package/dist/ui/svg.d.ts +4 -0
  28. package/dist/ui/svg.js +26 -0
  29. package/dist/ui/svg.js.map +1 -1
  30. package/dist/ui/theme.d.ts +1 -1
  31. package/dist/ui/theme.js +6 -0
  32. package/dist/ui/theme.js.map +1 -1
  33. package/dist/view/describe.d.ts +17 -0
  34. package/dist/view/describe.js +49 -0
  35. package/dist/view/describe.js.map +1 -0
  36. package/dist/view/element.d.ts +39 -9
  37. package/dist/view/element.js +723 -86
  38. package/dist/view/element.js.map +1 -1
  39. package/dist/view/layout.d.ts +20 -0
  40. package/dist/view/layout.js +205 -29
  41. package/dist/view/layout.js.map +1 -1
  42. package/dist/view/strings.d.ts +34 -8
  43. package/dist/view/strings.js +19 -6
  44. package/dist/view/strings.js.map +1 -1
  45. package/dist/view/styles.d.ts +1 -1
  46. package/dist/view/styles.js +107 -21
  47. package/dist/view/styles.js.map +1 -1
  48. package/dist/view.d.ts +8 -4
  49. package/dist/view.js +6 -3
  50. package/dist/view.js.map +1 -1
  51. package/package.json +2 -2
@@ -33,6 +33,26 @@ export interface ViewStrings {
33
33
  expand: string;
34
34
  /** Button that folds an expanded container again. */
35
35
  collapse: string;
36
+ /** Accessible name of the help button on a state (`name` is the state's id or kind). */
37
+ helpLabel: (name: string) => string;
38
+ /** The help popover of a state with no description (no comments in the source, none set with `descriptions`). */
39
+ noDescription: string;
40
+ /** Heading of the list of a state's transitions in its help popover. */
41
+ helpTransitions: string;
42
+ /** Button that zooms in. */
43
+ zoomIn: string;
44
+ /** Button that zooms out. */
45
+ zoomOut: string;
46
+ /** Button that goes back to the automatic size (fitted to the element's width). */
47
+ zoomReset: string;
48
+ /** The zoom level readout, e.g. "80%"; it's a button that sets 100%. */
49
+ zoomLevel: (percent: number) => string;
50
+ /** Tooltip and accessible name of the zoom level button. */
51
+ zoomActual: string;
52
+ /** The text of the button that goes back to the automatic view (shown once you've zoomed or scrolled away). */
53
+ fit: string;
54
+ /** Accessible name of the zoom toolbar (mentions the shortcuts). */
55
+ zoomToolbar: string;
36
56
  /** Notice when a large chart was folded to fit `max-states`. */
37
57
  foldedNotice: (hiddenStates: number, groups: number) => string;
38
58
  /** Button in the folded-chart notice that unfolds everything. */
@@ -49,24 +69,30 @@ export interface ViewStrings {
49
69
  warningsSummary: (n: number) => string;
50
70
  /** Tooltip of a warning that focuses its state when clicked. */
51
71
  showWarningState: string;
52
- /** Play button (while paused). */
72
+ /** Accessible name of the playback controls. */
73
+ playbackLabel: string;
74
+ /** Play button's accessible name (while paused). */
53
75
  play: string;
54
- /** Pause button (while playing). */
76
+ /** Pause button's accessible name (while playing). */
55
77
  pause: string;
56
- /** Tooltip of the play/pause button (mentions the Space shortcut). */
57
- playHint: string;
58
- /** Step button. */
59
- step: string;
60
- /** Tooltip of the step button (mentions the `.` shortcut). */
78
+ /** The play/pause shortcut, shown in its tooltip. */
79
+ playKey: string;
80
+ /** Step button's accessible name and tooltip (mentions the `.` shortcut). */
61
81
  stepHint: string;
62
- /** Accessible name of the speed buttons. */
82
+ /** Tooltip of the speed button (it cycles through the speeds). */
63
83
  speedLabel: string;
84
+ /** Accessible name of the speed button, with the current speed. */
85
+ speedButton: (speed: string) => string;
64
86
  /** The virtual time readout. */
65
87
  clockTime: (time: string) => string;
66
88
  /** Live-region text for a step: the triggering event (if any) and the entered states. */
67
89
  announceStep: (event: string | undefined, entered: string[]) => string;
68
90
  /** Live-region text when a label sends an event. */
69
91
  announceSent: (name: string) => string;
92
+ /** A clicked event took no transition. */
93
+ sentNothing: (name: string) => string;
94
+ /** Evaluating a clicked event raised an error (e.g. a condition that throws). */
95
+ sentError: (name: string, message: string) => string;
70
96
  }
71
97
  /** The English defaults of `ViewStrings`; unset keys of `view.strings` fall back to these. */
72
98
  export declare const defaultViewStrings: ViewStrings;
@@ -27,6 +27,16 @@ export const defaultViewStrings = {
27
27
  statesInside: (n) => `${n} ${plural.select(n) === "one" ? "state" : "states"}`,
28
28
  expand: "Expand",
29
29
  collapse: "Collapse",
30
+ helpLabel: (name) => `About ${name}`,
31
+ noDescription: "No description: document a state with an XML comment right before it, or set the view's descriptions property.",
32
+ helpTransitions: "Transitions",
33
+ zoomIn: "Zoom in (+)",
34
+ zoomOut: "Zoom out (−)",
35
+ zoomReset: "Fit to width (0)",
36
+ zoomLevel: (p) => `${p}%`,
37
+ fit: "Fit",
38
+ zoomActual: "Actual size (100%)",
39
+ zoomToolbar: "Zoom (also Ctrl or ⌘ + scroll wheel, pinch, double tap, or + and −; drag to pan)",
30
40
  foldedNotice: (hidden, groups) => `Large chart: ${hidden} ${plural.select(hidden) === "one" ? "state is" : "states are"} folded into ${groups} ${plural.select(groups) === "one" ? "group" : "groups"}. Expand a group to see inside, or explore the chart level by level with <scxml-explorer>.`,
31
41
  expandAll: "Expand all",
32
42
  loading: "Loading chart…",
@@ -35,14 +45,17 @@ export const defaultViewStrings = {
35
45
  terminated: "The machine has terminated.",
36
46
  warningsSummary: (n) => `⚠ ${n} ${plural.select(n) === "one" ? "warning" : "warnings"} about this chart`,
37
47
  showWarningState: "Show the state",
38
- play: "▶ Play",
39
- pause: "⏸ Pause",
40
- playHint: "Play / pause (Space)",
41
- step: "Step ⏭",
42
- stepHint: "Run until the next step (.)",
43
- speedLabel: "Speed",
48
+ playbackLabel: "Playback",
49
+ play: "Play",
50
+ pause: "Pause",
51
+ playKey: "Space",
52
+ stepHint: "Step: run until the next step (.)",
53
+ speedLabel: "Speed: click for the next one",
54
+ speedButton: (speed) => `Speed ${speed}`,
44
55
  clockTime: (t) => `t = ${t}`,
45
56
  announceStep: (event, entered) => `${event ?? "Started"}: ${entered.length ? `now in ${entered.join(", ")}` : "no change"}`,
46
57
  announceSent: (name) => `Sent ${name}`,
58
+ sentNothing: (name) => `${name} changed nothing: no active state takes it right now, or its condition was false.`,
59
+ sentError: (name, message) => `${name} raised an error, so nothing changed: ${message}`,
47
60
  };
48
61
  //# sourceMappingURL=strings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"strings.js","sourceRoot":"","sources":["../../src/view/strings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAkEH,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAE1C,8FAA8F;AAC9F,MAAM,CAAC,MAAM,kBAAkB,GAAgB;IAC7C,YAAY,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,KAAK,EAAE;IAC9C,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE;IAClH,KAAK,EAAE;QACL,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,gBAAgB;QAC1B,QAAQ,EAAE,gBAAgB;QAC1B,KAAK,EAAE,aAAa;QACpB,OAAO,EAAE,SAAS;KACnB;IACD,eAAe,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;IAClF,kBAAkB,EAAE,mCAAmC;IACvD,SAAS,EAAE,GAAG;IACd,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO;IACjC,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC9E,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAC/B,gBAAgB,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,gBAAgB,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,4FAA4F;IACjQ,SAAS,EAAE,YAAY;IACvB,OAAO,EAAE,gBAAgB;IACzB,QAAQ,EAAE,4HAA4H;IACtI,UAAU,EAAE,2BAA2B;IACvC,UAAU,EAAE,6BAA6B;IACzC,eAAe,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,mBAAmB;IACxG,gBAAgB,EAAE,gBAAgB;IAClC,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,SAAS;IAChB,QAAQ,EAAE,sBAAsB;IAChC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,6BAA6B;IACvC,UAAU,EAAE,OAAO;IACnB,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE;IAC5B,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,SAAS,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE;IAC3H,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,IAAI,EAAE;CACvC,CAAC","sourcesContent":["/**\n * Every user-visible string of `<scxml-view>`, with English defaults.\n *\n * Hosts translate by setting a partial override:\n *\n * view.strings = { expand: \"Aufklappen\", statesInside: (n) => `${n} Zustände` };\n *\n * Keys that interpolate values or counts are functions, so a translation\n * controls word order and plural forms.\n */\n\n/** The kinds of state the view names. */\nexport type ViewStateKind = \"atomic\" | \"compound\" | \"parallel\" | \"final\" | \"history\";\n\n/** Every user-visible string of `<scxml-view>`. Set `view.strings` to a partial object to translate. */\nexport interface ViewStrings {\n /** Accessible name of the diagram. */\n diagramLabel: (chart: string) => string;\n /** Accessible name of a state box (`kind` is the translated kind name from `kinds`). */\n /** Accessible name of a state box; `reached`: where a terminated session ended. */\n stateLabel: (name: string, kind: string, active: boolean, reached?: boolean) => string;\n /** Kind names, as used in accessible names. */\n kinds: Record<ViewStateKind, string>;\n /** Accessible name of a transition button. */\n transitionLabel: (events: string, targets: string) => string;\n /** Tooltip of a transition whose source isn't active (its event would do nothing now). */\n transitionInactive: string;\n /** Label of an eventless transition. */\n eventless: string;\n /** More internal transitions than a box shows. */\n moreInternal: (n: number) => string;\n /** Badge on a folded container. */\n statesInside: (n: number) => string;\n /** Button that unfolds a folded container. */\n expand: string;\n /** Button that folds an expanded container again. */\n collapse: string;\n /** Notice when a large chart was folded to fit `max-states`. */\n foldedNotice: (hiddenStates: number, groups: number) => string;\n /** Button in the folded-chart notice that unfolds everything. */\n expandAll: string;\n /** Shown while the chart source is fetched and compiled. */\n loading: string;\n /** No src and no inline source. */\n noSource: string;\n /** Heading of the error panel. */\n errorTitle: string;\n /** The machine reached a top-level final state (or was cancelled). */\n terminated: string;\n /** Summary of the authoring-warnings list (`model.warnings`). */\n warningsSummary: (n: number) => string;\n /** Tooltip of a warning that focuses its state when clicked. */\n showWarningState: string;\n // playback (with a PlaybackClock)\n /** Play button (while paused). */\n play: string;\n /** Pause button (while playing). */\n pause: string;\n /** Tooltip of the play/pause button (mentions the Space shortcut). */\n playHint: string;\n /** Step button. */\n step: string;\n /** Tooltip of the step button (mentions the `.` shortcut). */\n stepHint: string;\n /** Accessible name of the speed buttons. */\n speedLabel: string;\n /** The virtual time readout. */\n clockTime: (time: string) => string;\n // live region\n /** Live-region text for a step: the triggering event (if any) and the entered states. */\n announceStep: (event: string | undefined, entered: string[]) => string;\n /** Live-region text when a label sends an event. */\n announceSent: (name: string) => string;\n}\n\nconst plural = new Intl.PluralRules(\"en\");\n\n/** The English defaults of `ViewStrings`; unset keys of `view.strings` fall back to these. */\nexport const defaultViewStrings: ViewStrings = {\n diagramLabel: (chart) => `Statechart ${chart}`,\n stateLabel: (name, kind, active, reached) => `${name}, ${kind}${active ? \", active\" : reached ? \", reached\" : \"\"}`,\n kinds: {\n atomic: \"state\",\n compound: \"compound state\",\n parallel: \"parallel state\",\n final: \"final state\",\n history: \"history\",\n },\n transitionLabel: (events, targets) => `${events}${targets ? ` → ${targets}` : \"\"}`,\n transitionInactive: \"Not accepted in the current state\",\n eventless: \"ε\",\n moreInternal: (n) => `+${n} more`,\n statesInside: (n) => `${n} ${plural.select(n) === \"one\" ? \"state\" : \"states\"}`,\n expand: \"Expand\",\n collapse: \"Collapse\",\n foldedNotice: (hidden, groups) =>\n `Large chart: ${hidden} ${plural.select(hidden) === \"one\" ? \"state is\" : \"states are\"} folded into ${groups} ${plural.select(groups) === \"one\" ? \"group\" : \"groups\"}. Expand a group to see inside, or explore the chart level by level with <scxml-explorer>.`,\n expandAll: \"Expand all\",\n loading: \"Loading chart…\",\n noSource: 'No SCXML to show: set the src attribute, add an inline <script type=\"application/scxml+xml\">, or set the session property.',\n errorTitle: \"This chart can't be shown\",\n terminated: \"The machine has terminated.\",\n warningsSummary: (n) => `⚠ ${n} ${plural.select(n) === \"one\" ? \"warning\" : \"warnings\"} about this chart`,\n showWarningState: \"Show the state\",\n play: \"▶ Play\",\n pause: \"⏸ Pause\",\n playHint: \"Play / pause (Space)\",\n step: \"Step ⏭\",\n stepHint: \"Run until the next step (.)\",\n speedLabel: \"Speed\",\n clockTime: (t) => `t = ${t}`,\n announceStep: (event, entered) => `${event ?? \"Started\"}: ${entered.length ? `now in ${entered.join(\", \")}` : \"no change\"}`,\n announceSent: (name) => `Sent ${name}`,\n};\n"]}
1
+ {"version":3,"file":"strings.js","sourceRoot":"","sources":["../../src/view/strings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA4FH,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAE1C,8FAA8F;AAC9F,MAAM,CAAC,MAAM,kBAAkB,GAAgB;IAC7C,YAAY,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,KAAK,EAAE;IAC9C,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE;IAClH,KAAK,EAAE;QACL,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,gBAAgB;QAC1B,QAAQ,EAAE,gBAAgB;QAC1B,KAAK,EAAE,aAAa;QACpB,OAAO,EAAE,SAAS;KACnB;IACD,eAAe,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;IAClF,kBAAkB,EAAE,mCAAmC;IACvD,SAAS,EAAE,GAAG;IACd,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO;IACjC,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC9E,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,IAAI,EAAE;IACpC,aAAa,EAAE,gHAAgH;IAC/H,eAAe,EAAE,aAAa;IAC9B,MAAM,EAAE,aAAa;IACrB,OAAO,EAAE,cAAc;IACvB,SAAS,EAAE,kBAAkB;IAC7B,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG;IACzB,GAAG,EAAE,KAAK;IACV,UAAU,EAAE,oBAAoB;IAChC,WAAW,EAAE,kFAAkF;IAC/F,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAC/B,gBAAgB,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,gBAAgB,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,4FAA4F;IACjQ,SAAS,EAAE,YAAY;IACvB,OAAO,EAAE,gBAAgB;IACzB,QAAQ,EAAE,4HAA4H;IACtI,UAAU,EAAE,2BAA2B;IACvC,UAAU,EAAE,6BAA6B;IACzC,eAAe,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,mBAAmB;IACxG,gBAAgB,EAAE,gBAAgB;IAClC,aAAa,EAAE,UAAU;IACzB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,mCAAmC;IAC7C,UAAU,EAAE,+BAA+B;IAC3C,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,KAAK,EAAE;IACxC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE;IAC5B,YAAY,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,SAAS,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE;IAC3H,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,IAAI,EAAE;IACtC,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,mFAAmF;IACjH,SAAS,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,GAAG,IAAI,yCAAyC,OAAO,EAAE;CACxF,CAAC","sourcesContent":["/**\n * Every user-visible string of `<scxml-view>`, with English defaults.\n *\n * Hosts translate by setting a partial override:\n *\n * view.strings = { expand: \"Aufklappen\", statesInside: (n) => `${n} Zustände` };\n *\n * Keys that interpolate values or counts are functions, so a translation\n * controls word order and plural forms.\n */\n\n/** The kinds of state the view names. */\nexport type ViewStateKind = \"atomic\" | \"compound\" | \"parallel\" | \"final\" | \"history\";\n\n/** Every user-visible string of `<scxml-view>`. Set `view.strings` to a partial object to translate. */\nexport interface ViewStrings {\n /** Accessible name of the diagram. */\n diagramLabel: (chart: string) => string;\n /** Accessible name of a state box (`kind` is the translated kind name from `kinds`). */\n /** Accessible name of a state box; `reached`: where a terminated session ended. */\n stateLabel: (name: string, kind: string, active: boolean, reached?: boolean) => string;\n /** Kind names, as used in accessible names. */\n kinds: Record<ViewStateKind, string>;\n /** Accessible name of a transition button. */\n transitionLabel: (events: string, targets: string) => string;\n /** Tooltip of a transition whose source isn't active (its event would do nothing now). */\n transitionInactive: string;\n /** Label of an eventless transition. */\n eventless: string;\n /** More internal transitions than a box shows. */\n moreInternal: (n: number) => string;\n /** Badge on a folded container. */\n statesInside: (n: number) => string;\n /** Button that unfolds a folded container. */\n expand: string;\n /** Button that folds an expanded container again. */\n collapse: string;\n /** Accessible name of the help button on a state (`name` is the state's id or kind). */\n helpLabel: (name: string) => string;\n /** The help popover of a state with no description (no comments in the source, none set with `descriptions`). */\n noDescription: string;\n /** Heading of the list of a state's transitions in its help popover. */\n helpTransitions: string;\n /** Button that zooms in. */\n zoomIn: string;\n /** Button that zooms out. */\n zoomOut: string;\n /** Button that goes back to the automatic size (fitted to the element's width). */\n zoomReset: string;\n /** The zoom level readout, e.g. \"80%\"; it's a button that sets 100%. */\n zoomLevel: (percent: number) => string;\n /** Tooltip and accessible name of the zoom level button. */\n zoomActual: string;\n /** The text of the button that goes back to the automatic view (shown once you've zoomed or scrolled away). */\n fit: string;\n /** Accessible name of the zoom toolbar (mentions the shortcuts). */\n zoomToolbar: string;\n /** Notice when a large chart was folded to fit `max-states`. */\n foldedNotice: (hiddenStates: number, groups: number) => string;\n /** Button in the folded-chart notice that unfolds everything. */\n expandAll: string;\n /** Shown while the chart source is fetched and compiled. */\n loading: string;\n /** No src and no inline source. */\n noSource: string;\n /** Heading of the error panel. */\n errorTitle: string;\n /** The machine reached a top-level final state (or was cancelled). */\n terminated: string;\n /** Summary of the authoring-warnings list (`model.warnings`). */\n warningsSummary: (n: number) => string;\n /** Tooltip of a warning that focuses its state when clicked. */\n showWarningState: string;\n // playback (with a PlaybackClock)\n /** Accessible name of the playback controls. */\n playbackLabel: string;\n /** Play button's accessible name (while paused). */\n play: string;\n /** Pause button's accessible name (while playing). */\n pause: string;\n /** The play/pause shortcut, shown in its tooltip. */\n playKey: string;\n /** Step button's accessible name and tooltip (mentions the `.` shortcut). */\n stepHint: string;\n /** Tooltip of the speed button (it cycles through the speeds). */\n speedLabel: string;\n /** Accessible name of the speed button, with the current speed. */\n speedButton: (speed: string) => string;\n /** The virtual time readout. */\n clockTime: (time: string) => string;\n // live region\n /** Live-region text for a step: the triggering event (if any) and the entered states. */\n announceStep: (event: string | undefined, entered: string[]) => string;\n /** Live-region text when a label sends an event. */\n announceSent: (name: string) => string;\n /** A clicked event took no transition. */\n sentNothing: (name: string) => string;\n /** Evaluating a clicked event raised an error (e.g. a condition that throws). */\n sentError: (name: string, message: string) => string;\n}\n\nconst plural = new Intl.PluralRules(\"en\");\n\n/** The English defaults of `ViewStrings`; unset keys of `view.strings` fall back to these. */\nexport const defaultViewStrings: ViewStrings = {\n diagramLabel: (chart) => `Statechart ${chart}`,\n stateLabel: (name, kind, active, reached) => `${name}, ${kind}${active ? \", active\" : reached ? \", reached\" : \"\"}`,\n kinds: {\n atomic: \"state\",\n compound: \"compound state\",\n parallel: \"parallel state\",\n final: \"final state\",\n history: \"history\",\n },\n transitionLabel: (events, targets) => `${events}${targets ? ` → ${targets}` : \"\"}`,\n transitionInactive: \"Not accepted in the current state\",\n eventless: \"ε\",\n moreInternal: (n) => `+${n} more`,\n statesInside: (n) => `${n} ${plural.select(n) === \"one\" ? \"state\" : \"states\"}`,\n expand: \"Expand\",\n collapse: \"Collapse\",\n helpLabel: (name) => `About ${name}`,\n noDescription: \"No description: document a state with an XML comment right before it, or set the view's descriptions property.\",\n helpTransitions: \"Transitions\",\n zoomIn: \"Zoom in (+)\",\n zoomOut: \"Zoom out (−)\",\n zoomReset: \"Fit to width (0)\",\n zoomLevel: (p) => `${p}%`,\n fit: \"Fit\",\n zoomActual: \"Actual size (100%)\",\n zoomToolbar: \"Zoom (also Ctrl or ⌘ + scroll wheel, pinch, double tap, or + and −; drag to pan)\",\n foldedNotice: (hidden, groups) =>\n `Large chart: ${hidden} ${plural.select(hidden) === \"one\" ? \"state is\" : \"states are\"} folded into ${groups} ${plural.select(groups) === \"one\" ? \"group\" : \"groups\"}. Expand a group to see inside, or explore the chart level by level with <scxml-explorer>.`,\n expandAll: \"Expand all\",\n loading: \"Loading chart…\",\n noSource: 'No SCXML to show: set the src attribute, add an inline <script type=\"application/scxml+xml\">, or set the session property.',\n errorTitle: \"This chart can't be shown\",\n terminated: \"The machine has terminated.\",\n warningsSummary: (n) => `⚠ ${n} ${plural.select(n) === \"one\" ? \"warning\" : \"warnings\"} about this chart`,\n showWarningState: \"Show the state\",\n playbackLabel: \"Playback\",\n play: \"Play\",\n pause: \"Pause\",\n playKey: \"Space\",\n stepHint: \"Step: run until the next step (.)\",\n speedLabel: \"Speed: click for the next one\",\n speedButton: (speed) => `Speed ${speed}`,\n clockTime: (t) => `t = ${t}`,\n announceStep: (event, entered) => `${event ?? \"Started\"}: ${entered.length ? `now in ${entered.join(\", \")}` : \"no change\"}`,\n announceSent: (name) => `Sent ${name}`,\n sentNothing: (name) => `${name} changed nothing: no active state takes it right now, or its condition was false.`,\n sentError: (name, message) => `${name} raised an error, so nothing changed: ${message}`,\n};\n"]}
@@ -1 +1 @@
1
- export declare const VIEW_CSS = "\n:host {\n display: block; position: relative; overflow: hidden;\n background: var(--x-bg); border: 1px solid var(--x-b2); border-radius: var(--x-r);\n}\n:host([hidden]) { display: none; }\n.frame { display: flex; flex-direction: column; max-height: var(--scxml-height, none); min-height: 0; }\n.canvas:focus-visible { outline: 2px solid var(--x-accent); outline-offset: -2px; }\n.canvas { overflow: auto; min-height: 0; flex: 1; overscroll-behavior: contain; }\n.diagram { position: relative; margin: 12px; }\n:host([fit]) .canvas { overflow: hidden; }\n:host([fit]) .diagram { transform-origin: 0 0; }\n\n/* \u2500\u2500 boxes \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.box { position: absolute; box-sizing: border-box; border-radius: calc(var(--x-r) + 3px); transition: background var(--x-dur), border-color var(--x-dur), box-shadow var(--x-dur); }\n.box.container { background: color-mix(in srgb, var(--x-s2) 55%, transparent); border: 1px solid var(--x-b2); }\n.box.container.depth-even { background: color-mix(in srgb, var(--x-s1) 70%, transparent); }\n.box.region { border-style: dashed; border-radius: var(--x-r); background: transparent; }\n.box.leaf { background: var(--x-s1); border: 1px solid var(--x-strong); padding: 8px 11px; display: flex; flex-direction: column; gap: 5px; box-shadow: 0 1px 0 color-mix(in srgb, var(--x-strong) 25%, transparent); }\n.box.final { border: 3px double var(--x-strong); border-radius: 999px; padding: 6px 16px; align-items: center; justify-content: center; }\n.box.history { border-radius: 50%; padding: 0; display: grid; place-items: center; font: 600 11px var(--x-mono); color: var(--x-fg2); }\n.box.collapsed { border-style: solid; border-width: 1px; background: var(--x-s1); box-shadow: 3px 3px 0 -1px var(--x-s1), 3px 3px 0 0 var(--x-b2); }\n.head { position: absolute; left: 0; right: 0; top: 0; padding: 7px 11px 0; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }\n.head > * { pointer-events: auto; }\n.name { font-weight: 600; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }\n.name .kind { font: 600 14px/1 var(--x-sans); color: var(--x-fg3); }\n.name .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--x-run); flex: none; display: none; }\n\n/* live state: text and shape, never colour alone */\n.box.active { border-color: var(--x-run); box-shadow: inset 0 0 0 1px var(--x-run); }\n.box.leaf.active { background: var(--x-run-bg); }\n.box.active > .name, .box.active > .head .name { color: var(--x-run); }\n.box.active > .name .dot, .box.active > .head .name .dot { display: inline-block; }\n.box.final.active { border-color: var(--x-done); box-shadow: none; background: var(--x-done-bg); }\n.box.final.active > .name { color: var(--x-done); }\n.box.region.active { box-shadow: none; }\n/* a terminated session: where it ended */\n.box.reached { border-color: var(--x-done); box-shadow: inset 0 0 0 1px var(--x-done); }\n.box.leaf.reached, .box.final.reached { background: var(--x-done-bg); }\n.box.reached > .name, .box.reached > .head .name { color: var(--x-done); }\n.box.region.reached { box-shadow: none; }\n.empty { margin: 0; padding: 16px; color: var(--x-fg3); }\n\n/* internal (targetless) transitions listed in a box */\n.internal { display: flex; flex-wrap: wrap; gap: 4px; }\n.internal .more { font: 500 11px var(--x-mono); color: var(--x-fg3); }\n\n/* \u2500\u2500 transitions: labels are the buttons \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.label, .chip {\n position: absolute; display: inline-flex; align-items: center; gap: 5px; box-sizing: border-box;\n height: 20px; padding: 0 8px; border-radius: 999px; white-space: nowrap; overflow: hidden;\n font: 500 11px/1 var(--x-mono); color: var(--x-fg2);\n background: var(--x-bg); border: 1px solid var(--x-b2);\n}\n.chip { position: static; }\n.label .cond, .chip .cond { color: var(--x-wait); font-weight: 400; }\nbutton.label, button.chip { cursor: pointer; }\n.label.live, .chip.live { color: var(--x-accent-fg); border-color: color-mix(in srgb, var(--x-accent) 45%, transparent); background: var(--x-s1); }\nbutton.label.live:hover, button.chip.live:hover { background: var(--x-accent-subtle); border-color: var(--x-accent); }\nbutton.label:disabled, button.chip:disabled { cursor: default; }\n.label.fired, .chip.fired { color: var(--x-on-accent); background: var(--x-accent); border-color: var(--x-accent); }\n.label.fired .cond, .chip.fired .cond { color: inherit; }\n\n.edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }\n.edges path.edge { fill: none; stroke: var(--x-fg4); stroke-width: 1.25; stroke-linejoin: round; transition: stroke var(--x-dur); }\n.edges path.edge.live { stroke: var(--x-accent); }\n.edges path.edge.fired { stroke: var(--x-accent); stroke-width: 2.25; }\n.edges .initial { fill: var(--x-fg1); }\n.edges path.initial-line { fill: none; stroke: var(--x-fg1); stroke-width: 1.25; }\n.edges marker path { fill: context-stroke; stroke: none; }\n\n/* \u2500\u2500 folded groups \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.badge-count { font: 500 11px var(--x-mono); color: var(--x-fg3); }\n.expand { align-self: flex-start; border: 1px solid var(--x-b2); background: var(--x-s1); border-radius: var(--x-r); height: 22px; padding: 0 8px; cursor: pointer; font: 500 11.5px var(--x-sans); color: var(--x-accent-fg); }\n.expand:hover { border-color: var(--x-accent); }\n.collapse { position: absolute; top: 5px; right: 6px; border: 0; background: none; padding: 1px 4px; cursor: pointer; font: 500 11px var(--x-sans); color: var(--x-fg3); border-radius: var(--x-r); }\n.collapse:hover { color: var(--x-accent-fg); background: var(--x-accent-subtle); }\n\n/* \u2500\u2500 notices, errors, controls \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.notice { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 7px 12px; font: 12px var(--x-sans); color: var(--x-fg2); background: var(--x-s2); border-bottom: 1px solid var(--x-b1); }\n.notice[hidden], .controls[hidden], .error[hidden], .warnings[hidden] { display: none; }\n.warnings { padding: 6px 12px; font: 12px var(--x-sans); color: var(--x-fg2); background: var(--x-wait-bg); border-bottom: 1px solid var(--x-b1); }\n.warnings summary { cursor: pointer; color: var(--x-wait); font-weight: 500; }\n.warnings ul { margin: 6px 0 2px; padding-left: 18px; display: grid; gap: 4px; }\n.warnings button { all: unset; cursor: pointer; line-height: 1.4; }\n.warnings button:hover { text-decoration: underline; }\n.warnings button:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 2px; border-radius: 2px; }\n.notice button { border: 1px solid var(--x-b2); background: var(--x-s1); border-radius: var(--x-r); height: 24px; padding: 0 9px; cursor: pointer; font: 500 12px var(--x-sans); color: var(--x-fg1); }\n.error { padding: 16px 18px; color: var(--x-fg1); }\n.error h2 { font: var(--x-display-weight) 16px/1.2 var(--x-serif); margin: 0 0 8px; color: var(--x-err); }\n.error ul { margin: 0; padding-left: 18px; font: 12px/1.5 var(--x-mono); color: var(--x-fg2); }\n.error p { margin: 0; font: 12.5px/1.5 var(--x-mono); color: var(--x-fg2); white-space: pre-wrap; }\n.loading { padding: 16px 18px; color: var(--x-fg3); font-style: italic; }\n.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; background: var(--x-s1); border-bottom: 1px solid var(--x-b2); font: 12px var(--x-sans); }\n.controls button { height: 26px; padding: 0 10px; border-radius: var(--x-r); border: 1px solid var(--x-b2); background: var(--x-s1); color: var(--x-fg1); cursor: pointer; font: 500 12px var(--x-sans); }\n.controls .play { min-width: 80px; background: var(--x-accent); border-color: var(--x-accent); color: var(--x-on-accent); }\n.controls .play[aria-pressed=\"true\"] { background: var(--x-s1); color: var(--x-fg1); border-color: var(--x-b2); }\n.controls .step:disabled { opacity: .5; cursor: default; }\n.controls .speeds { display: inline-flex; border: 1px solid var(--x-b2); border-radius: var(--x-r); overflow: hidden; }\n.controls .speeds button { border: 0; border-radius: 0; height: 24px; padding: 0 7px; background: none; color: var(--x-fg3); min-width: 0; }\n.controls .speeds button[aria-pressed=\"true\"] { background: var(--x-s3); color: var(--x-fg1); }\n.controls .clock { font: 500 12px var(--x-mono); color: var(--x-fg2); font-variant-numeric: tabular-nums; }\n.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }\n\n/* the diagram's geometry is left-to-right; keep it anchored at the start of the canvas in RTL pages */\n.canvas { direction: ltr; }\n.canvas .box, .canvas .label, .canvas .chip { direction: inherit; unicode-bidi: plaintext; }\n";
1
+ export declare const VIEW_CSS = "\n:host {\n display: block; position: relative; overflow: hidden;\n background: var(--x-bg); border: 1px solid var(--x-b2); border-radius: var(--x-r);\n}\n:host([hidden]) { display: none; }\n.frame { display: flex; flex-direction: column; max-height: var(--scxml-height, none); min-height: 0; }\n.canvas:focus-visible { outline: 2px solid var(--x-accent); outline-offset: -2px; }\n.viewport { position: relative; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }\n.canvas { overflow: auto; min-height: 0; flex: 1 1 auto; overscroll-behavior: contain; cursor: grab; }\n/* one finger scrolls; two pinch-zoom the diagram (handled by the element), not the page */\n.canvas { touch-action: pan-x pan-y; }\n.canvas.panning { cursor: grabbing; user-select: none; -webkit-user-select: none; }\n.canvas.panning * { cursor: grabbing !important; }\n.diagram { position: relative; margin: 12px; }\n:host([fit]) .canvas:not(.zoomed) { overflow: hidden; }\n:host([fit]) .diagram { transform-origin: 0 0; }\n\n/* \u2500\u2500 boxes \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.box { position: absolute; box-sizing: border-box; border-radius: calc(var(--x-r) + 3px); transition: background var(--x-dur), border-color var(--x-dur), box-shadow var(--x-dur); }\n.box.container { background: color-mix(in srgb, var(--x-s2) 55%, transparent); border: 1px solid var(--x-b2); }\n.box.container.depth-even { background: color-mix(in srgb, var(--x-s1) 70%, transparent); }\n.box.region { border-style: dashed; border-radius: var(--x-r); background: transparent; }\n.box.leaf { background: var(--x-s1); border: 1px solid var(--x-strong); padding: 8px 11px; display: flex; flex-direction: column; gap: 5px; box-shadow: 0 1px 0 color-mix(in srgb, var(--x-strong) 25%, transparent); }\n.box.final { border: 3px double var(--x-strong); border-radius: 999px; padding: 6px 16px; align-items: center; justify-content: center; }\n.box.history { border-radius: 50%; padding: 0; display: grid; place-items: center; font: 600 11px var(--x-mono); color: var(--x-fg2); }\n.box.collapsed { border-style: solid; border-width: 1px; background: var(--x-s1); box-shadow: 3px 3px 0 -1px var(--x-s1), 3px 3px 0 0 var(--x-b2); }\n.head { position: absolute; left: 0; right: 0; top: 0; padding: 7px 11px 0; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }\n.head > * { pointer-events: auto; }\n.title { display: flex; align-items: center; gap: 4px; min-width: 0; }\n.box.final > .title { justify-content: center; }\n.title .name { flex: 0 1 auto; min-width: 0; }\n.name { font-weight: 600; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }\n.name .kind { font: 600 14px/1 var(--x-sans); color: var(--x-fg3); }\n.name .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--x-run); flex: none; display: none; }\n\n/* live state: text and shape, never colour alone */\n.box.active { border-color: var(--x-run); box-shadow: inset 0 0 0 1px var(--x-run); }\n.box.leaf.active { background: var(--x-run-bg); }\n.box.active > .title .name, .box.active > .head .name { color: var(--x-run); }\n.box.active > .title .name .dot, .box.active > .head .name .dot { display: inline-block; }\n.box.final.active { border-color: var(--x-done); box-shadow: none; background: var(--x-done-bg); }\n.box.final.active > .title .name { color: var(--x-done); }\n.box.region.active { box-shadow: none; }\n/* a terminated session: where it ended */\n.box.reached { border-color: var(--x-done); box-shadow: inset 0 0 0 1px var(--x-done); }\n.box.leaf.reached, .box.final.reached { background: var(--x-done-bg); }\n.box.reached > .title .name, .box.reached > .head .name { color: var(--x-done); }\n.box.region.reached { box-shadow: none; }\n.empty { margin: 0; padding: 16px; color: var(--x-fg3); }\n\n/* internal (targetless) transitions listed in a box */\n.internal { display: flex; flex-wrap: wrap; gap: 4px; max-width: 360px; }\n.internal .more { font: 500 11px var(--x-mono); color: var(--x-fg3); }\n\n/* \u2500\u2500 transitions: labels are the buttons \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.label, .chip {\n position: absolute; display: inline-flex; align-items: center; gap: 5px; box-sizing: border-box;\n height: 20px; padding: 0 8px; border-radius: 999px; white-space: nowrap; overflow: hidden;\n font: 500 11px/1 var(--x-mono); color: var(--x-fg2);\n background: var(--x-bg); border: 1px solid var(--x-b2);\n}\n.chip { position: static; }\n.label .cond, .chip .cond { color: var(--x-wait); font-weight: 400; }\nbutton.label, button.chip { cursor: pointer; }\n.label.live, .chip.live { color: var(--x-accent-fg); border-color: color-mix(in srgb, var(--x-accent) 45%, transparent); background: var(--x-s1); }\nbutton.label.live:hover, button.chip.live:hover { background: var(--x-accent-subtle); border-color: var(--x-accent); }\nbutton.label:disabled, button.chip:disabled { cursor: default; }\n.label.fired, .chip.fired { color: var(--x-on-accent); background: var(--x-accent); border-color: var(--x-accent); }\n.label.fired .cond, .chip.fired .cond { color: inherit; }\n/* a long-distance transition listed in its source's box, and its target while it's hovered */\n.chip.portal .to { color: var(--x-fg3); font-weight: 400; }\n.chip.portal.live .to { color: inherit; opacity: .75; }\n.chip.portal.fired .to { color: inherit; }\n.box.portal-target { outline: 2px dashed var(--x-accent); outline-offset: 2px; }\n\n.edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }\n.edges path.edge { fill: none; stroke: var(--x-fg4); stroke-width: 1.25; stroke-linejoin: round; transition: stroke var(--x-dur); }\n.edges path.edge.live { stroke: var(--x-accent); }\n.edges path.edge.fired { stroke: var(--x-accent); stroke-width: 2.25; }\n.edges .initial { fill: var(--x-fg1); }\n.edges path.initial-line { fill: none; stroke: var(--x-fg1); stroke-width: 1.25; }\n.edges marker path { fill: context-stroke; stroke: none; }\n\n/* \u2500\u2500 folded groups \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.badge-count { font: 500 11px var(--x-mono); color: var(--x-fg3); }\n\n/* \u2500\u2500 icon buttons in a state's title: fold toggle and help \u2500\u2500 */\n.toggle, .help {\n flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; margin: -2px 0;\n border: 0; border-radius: var(--x-r); background: none; color: var(--x-fg3); cursor: pointer;\n}\n.toggle { margin-left: -4px; }\n.help { color: var(--x-fg4); }\n.toggle:hover, .help:hover, .help[aria-expanded=\"true\"] { color: var(--x-accent-fg); background: var(--x-accent-subtle); }\n.toggle:focus-visible, .help:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 0; }\n.toggle.expand { color: var(--x-accent-fg); }\n.icon { display: block; pointer-events: none; }\n/* fingers: the same small icons, with a hit area of about 34px */\n@media (pointer: coarse) {\n .toggle, .help { position: relative; }\n .toggle::after, .help::after { content: \"\"; position: absolute; inset: -8px; }\n}\n\n/* \u2500\u2500 help popover \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.help-popover {\n position: absolute; z-index: 3; box-sizing: border-box; width: max-content; max-width: min(340px, calc(100% - 8px));\n padding: 10px 12px; border: 1px solid var(--x-b2); border-radius: calc(var(--x-r) + 2px);\n background: var(--x-bg); color: var(--x-fg1); font: 12.5px/1.45 var(--x-sans);\n box-shadow: 0 6px 24px -8px color-mix(in srgb, var(--x-fg1) 35%, transparent);\n}\n.help-popover[hidden] { display: none; }\n.help-popover:focus { outline: none; }\n.help-popover:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 1px; }\n.help-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }\n.help-head strong { font: 600 13px var(--x-mono); overflow-wrap: anywhere; }\n.help-kind { font-size: 11.5px; color: var(--x-fg3); }\n.help-text p { margin: 0 0 6px; white-space: pre-wrap; }\n.help-text p:last-child { margin-bottom: 0; }\n.help-none { margin: 0; color: var(--x-fg3); font-style: italic; }\n.help-sub { margin-top: 8px; font-size: 11px; font-weight: 600; color: var(--x-fg3); text-transform: uppercase; letter-spacing: .04em; }\n.help-transitions { margin: 3px 0 0; padding-left: 16px; font: 11.5px/1.5 var(--x-mono); color: var(--x-fg2); }\n\n\n/* \u2500\u2500 notices, errors, controls \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.notice { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 7px 12px; font: 12px var(--x-sans); color: var(--x-fg2); background: var(--x-s2); border-bottom: 1px solid var(--x-b1); }\n.notice[hidden], .error[hidden], .warnings[hidden] { display: none; }\n.send-status { color: var(--x-fg1); border-left: 3px solid var(--x-wait); }\n.warnings { padding: 6px 12px; font: 12px var(--x-sans); color: var(--x-fg2); background: var(--x-wait-bg); border-bottom: 1px solid var(--x-b1); }\n.warnings summary { cursor: pointer; color: var(--x-wait); font-weight: 500; }\n.warnings ul { margin: 6px 0 2px; padding-left: 18px; display: grid; gap: 4px; }\n.warnings button { all: unset; cursor: pointer; line-height: 1.4; }\n.warnings button:hover { text-decoration: underline; }\n.warnings button:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 2px; border-radius: 2px; }\n.notice button { border: 1px solid var(--x-b2); background: var(--x-s1); border-radius: var(--x-r); height: 24px; padding: 0 9px; cursor: pointer; font: 500 12px var(--x-sans); color: var(--x-fg1); }\n.error { padding: 16px 18px; color: var(--x-fg1); }\n.error h2 { font: var(--x-display-weight) 16px/1.2 var(--x-serif); margin: 0 0 8px; color: var(--x-err); }\n.error ul { margin: 0; padding-left: 18px; font: 12px/1.5 var(--x-mono); color: var(--x-fg2); }\n.error p { margin: 0; font: 12.5px/1.5 var(--x-mono); color: var(--x-fg2); white-space: pre-wrap; }\n.loading { padding: 16px 18px; color: var(--x-fg3); font-style: italic; }\n/* \u2500\u2500 controls over the diagram's bottom edge \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n Playback bottom-left, zoom bottom-right: one line, the same height, inset like the diagram\n (12px). Solid surfaces with a hairline, like the boxes. */\n.controls, .nav { position: absolute; bottom: 12px; z-index: 2; display: flex; align-items: center; gap: 6px; }\n.controls { left: 12px; }\n.nav { right: 12px; }\n.controls[hidden], .nav[hidden], .controls .step[hidden], .zoom-reset[hidden] { display: none; }\n.controls, .zoom, .zoom-reset {\n box-sizing: border-box; height: 36px; border: 1px solid var(--x-b2); border-radius: 999px; background: var(--x-s1);\n box-shadow: 0 1px 2px color-mix(in srgb, var(--x-fg1) 12%, transparent);\n}\n.controls { gap: 0; padding: 0 2px; }\n.zoom { display: flex; align-items: center; padding: 0 2px; }\n.controls button, .zoom button, .zoom-reset {\n display: inline-grid; place-items: center; height: 30px; min-width: 30px; padding: 0 6px; box-sizing: border-box;\n border: 0; border-radius: 999px; background: none; color: var(--x-fg2); cursor: pointer;\n font: 500 12px var(--x-mono); font-variant-numeric: tabular-nums;\n}\n.controls button:hover:not(:disabled), .zoom button:hover, .zoom-reset:hover { color: var(--x-fg1); background: var(--x-s2); }\n.controls button:focus-visible, .zoom button:focus-visible, .zoom-reset:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 1px; }\n.controls .play { color: var(--x-accent-fg); }\n.controls .step:disabled { opacity: .45; cursor: default; }\n.controls .speeds { min-width: 40px; }\n.controls .clock { padding: 0 10px 0 4px; font: 500 12px var(--x-mono); color: var(--x-fg2); font-variant-numeric: tabular-nums; white-space: nowrap; }\n/* playing untouched: just the play button (a circle the height of the others) */\n.controls.idle { padding: 0 2px; }\n.controls.idle > :not(.play) { display: none; }\n.zoom .zoom-level { min-width: 52px; }\n.zoom-reset { display: inline-flex; gap: 5px; height: 36px; padding: 0 12px 0 10px; color: var(--x-accent-fg); font-family: var(--x-sans); }\n.viewport[data-narrow] .zoom-reset span { display: none; }\n.viewport[data-narrow] .zoom-reset { width: 36px; padding: 0; justify-content: center; }\n\n/* \u2212, level, + beside Fit: on hover, keyboard focus, or while zooming */\n.zoom { visibility: hidden; }\n@media (hover: hover) { .viewport:hover .zoom { visibility: visible; } }\n.viewport:has(:focus-visible) .zoom, .viewport[data-zooming] .zoom { visibility: visible; }\n\n/* room under the diagram, so its last row can scroll clear of the controls */\n.viewport.has-controls .canvas { padding-bottom: 56px; }\n\n/* fingers: bigger targets; \u2212/+ give way to pinch and double tap */\n@media (pointer: coarse) {\n .controls, .zoom, .zoom-reset { height: 44px; }\n .controls button, .zoom button { height: 40px; min-width: 40px; }\n .zoom .zoom-in, .zoom .zoom-out { display: none; }\n .viewport[data-narrow] .zoom-reset { width: 44px; }\n .viewport.has-controls .canvas { padding-bottom: 64px; }\n}\n.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }\n\n/* the diagram's geometry is left-to-right; keep it anchored at the start of the canvas in RTL pages */\n.canvas { direction: ltr; }\n.canvas .box, .canvas .label, .canvas .chip { direction: inherit; unicode-bidi: plaintext; }\n";
@@ -12,9 +12,14 @@ export const VIEW_CSS = /* css */ `
12
12
  :host([hidden]) { display: none; }
13
13
  .frame { display: flex; flex-direction: column; max-height: var(--scxml-height, none); min-height: 0; }
14
14
  .canvas:focus-visible { outline: 2px solid var(--x-accent); outline-offset: -2px; }
15
- .canvas { overflow: auto; min-height: 0; flex: 1; overscroll-behavior: contain; }
15
+ .viewport { position: relative; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
16
+ .canvas { overflow: auto; min-height: 0; flex: 1 1 auto; overscroll-behavior: contain; cursor: grab; }
17
+ /* one finger scrolls; two pinch-zoom the diagram (handled by the element), not the page */
18
+ .canvas { touch-action: pan-x pan-y; }
19
+ .canvas.panning { cursor: grabbing; user-select: none; -webkit-user-select: none; }
20
+ .canvas.panning * { cursor: grabbing !important; }
16
21
  .diagram { position: relative; margin: 12px; }
17
- :host([fit]) .canvas { overflow: hidden; }
22
+ :host([fit]) .canvas:not(.zoomed) { overflow: hidden; }
18
23
  :host([fit]) .diagram { transform-origin: 0 0; }
19
24
 
20
25
  /* ── boxes ─────────────────────────────────────────────── */
@@ -28,6 +33,9 @@ export const VIEW_CSS = /* css */ `
28
33
  .box.collapsed { border-style: solid; border-width: 1px; background: var(--x-s1); box-shadow: 3px 3px 0 -1px var(--x-s1), 3px 3px 0 0 var(--x-b2); }
29
34
  .head { position: absolute; left: 0; right: 0; top: 0; padding: 7px 11px 0; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
30
35
  .head > * { pointer-events: auto; }
36
+ .title { display: flex; align-items: center; gap: 4px; min-width: 0; }
37
+ .box.final > .title { justify-content: center; }
38
+ .title .name { flex: 0 1 auto; min-width: 0; }
31
39
  .name { font-weight: 600; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
32
40
  .name .kind { font: 600 14px/1 var(--x-sans); color: var(--x-fg3); }
33
41
  .name .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--x-run); flex: none; display: none; }
@@ -35,20 +43,20 @@ export const VIEW_CSS = /* css */ `
35
43
  /* live state: text and shape, never colour alone */
36
44
  .box.active { border-color: var(--x-run); box-shadow: inset 0 0 0 1px var(--x-run); }
37
45
  .box.leaf.active { background: var(--x-run-bg); }
38
- .box.active > .name, .box.active > .head .name { color: var(--x-run); }
39
- .box.active > .name .dot, .box.active > .head .name .dot { display: inline-block; }
46
+ .box.active > .title .name, .box.active > .head .name { color: var(--x-run); }
47
+ .box.active > .title .name .dot, .box.active > .head .name .dot { display: inline-block; }
40
48
  .box.final.active { border-color: var(--x-done); box-shadow: none; background: var(--x-done-bg); }
41
- .box.final.active > .name { color: var(--x-done); }
49
+ .box.final.active > .title .name { color: var(--x-done); }
42
50
  .box.region.active { box-shadow: none; }
43
51
  /* a terminated session: where it ended */
44
52
  .box.reached { border-color: var(--x-done); box-shadow: inset 0 0 0 1px var(--x-done); }
45
53
  .box.leaf.reached, .box.final.reached { background: var(--x-done-bg); }
46
- .box.reached > .name, .box.reached > .head .name { color: var(--x-done); }
54
+ .box.reached > .title .name, .box.reached > .head .name { color: var(--x-done); }
47
55
  .box.region.reached { box-shadow: none; }
48
56
  .empty { margin: 0; padding: 16px; color: var(--x-fg3); }
49
57
 
50
58
  /* internal (targetless) transitions listed in a box */
51
- .internal { display: flex; flex-wrap: wrap; gap: 4px; }
59
+ .internal { display: flex; flex-wrap: wrap; gap: 4px; max-width: 360px; }
52
60
  .internal .more { font: 500 11px var(--x-mono); color: var(--x-fg3); }
53
61
 
54
62
  /* ── transitions: labels are the buttons ───────────────── */
@@ -66,6 +74,11 @@ button.label.live:hover, button.chip.live:hover { background: var(--x-accent-sub
66
74
  button.label:disabled, button.chip:disabled { cursor: default; }
67
75
  .label.fired, .chip.fired { color: var(--x-on-accent); background: var(--x-accent); border-color: var(--x-accent); }
68
76
  .label.fired .cond, .chip.fired .cond { color: inherit; }
77
+ /* a long-distance transition listed in its source's box, and its target while it's hovered */
78
+ .chip.portal .to { color: var(--x-fg3); font-weight: 400; }
79
+ .chip.portal.live .to { color: inherit; opacity: .75; }
80
+ .chip.portal.fired .to { color: inherit; }
81
+ .box.portal-target { outline: 2px dashed var(--x-accent); outline-offset: 2px; }
69
82
 
70
83
  .edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
71
84
  .edges path.edge { fill: none; stroke: var(--x-fg4); stroke-width: 1.25; stroke-linejoin: round; transition: stroke var(--x-dur); }
@@ -77,14 +90,48 @@ button.label:disabled, button.chip:disabled { cursor: default; }
77
90
 
78
91
  /* ── folded groups ─────────────────────────────────────── */
79
92
  .badge-count { font: 500 11px var(--x-mono); color: var(--x-fg3); }
80
- .expand { align-self: flex-start; border: 1px solid var(--x-b2); background: var(--x-s1); border-radius: var(--x-r); height: 22px; padding: 0 8px; cursor: pointer; font: 500 11.5px var(--x-sans); color: var(--x-accent-fg); }
81
- .expand:hover { border-color: var(--x-accent); }
82
- .collapse { position: absolute; top: 5px; right: 6px; border: 0; background: none; padding: 1px 4px; cursor: pointer; font: 500 11px var(--x-sans); color: var(--x-fg3); border-radius: var(--x-r); }
83
- .collapse:hover { color: var(--x-accent-fg); background: var(--x-accent-subtle); }
93
+
94
+ /* ── icon buttons in a state's title: fold toggle and help ── */
95
+ .toggle, .help {
96
+ flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; margin: -2px 0;
97
+ border: 0; border-radius: var(--x-r); background: none; color: var(--x-fg3); cursor: pointer;
98
+ }
99
+ .toggle { margin-left: -4px; }
100
+ .help { color: var(--x-fg4); }
101
+ .toggle:hover, .help:hover, .help[aria-expanded="true"] { color: var(--x-accent-fg); background: var(--x-accent-subtle); }
102
+ .toggle:focus-visible, .help:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 0; }
103
+ .toggle.expand { color: var(--x-accent-fg); }
104
+ .icon { display: block; pointer-events: none; }
105
+ /* fingers: the same small icons, with a hit area of about 34px */
106
+ @media (pointer: coarse) {
107
+ .toggle, .help { position: relative; }
108
+ .toggle::after, .help::after { content: ""; position: absolute; inset: -8px; }
109
+ }
110
+
111
+ /* ── help popover ──────────────────────────────────────── */
112
+ .help-popover {
113
+ position: absolute; z-index: 3; box-sizing: border-box; width: max-content; max-width: min(340px, calc(100% - 8px));
114
+ padding: 10px 12px; border: 1px solid var(--x-b2); border-radius: calc(var(--x-r) + 2px);
115
+ background: var(--x-bg); color: var(--x-fg1); font: 12.5px/1.45 var(--x-sans);
116
+ box-shadow: 0 6px 24px -8px color-mix(in srgb, var(--x-fg1) 35%, transparent);
117
+ }
118
+ .help-popover[hidden] { display: none; }
119
+ .help-popover:focus { outline: none; }
120
+ .help-popover:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 1px; }
121
+ .help-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
122
+ .help-head strong { font: 600 13px var(--x-mono); overflow-wrap: anywhere; }
123
+ .help-kind { font-size: 11.5px; color: var(--x-fg3); }
124
+ .help-text p { margin: 0 0 6px; white-space: pre-wrap; }
125
+ .help-text p:last-child { margin-bottom: 0; }
126
+ .help-none { margin: 0; color: var(--x-fg3); font-style: italic; }
127
+ .help-sub { margin-top: 8px; font-size: 11px; font-weight: 600; color: var(--x-fg3); text-transform: uppercase; letter-spacing: .04em; }
128
+ .help-transitions { margin: 3px 0 0; padding-left: 16px; font: 11.5px/1.5 var(--x-mono); color: var(--x-fg2); }
129
+
84
130
 
85
131
  /* ── notices, errors, controls ─────────────────────────── */
86
132
  .notice { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 7px 12px; font: 12px var(--x-sans); color: var(--x-fg2); background: var(--x-s2); border-bottom: 1px solid var(--x-b1); }
87
- .notice[hidden], .controls[hidden], .error[hidden], .warnings[hidden] { display: none; }
133
+ .notice[hidden], .error[hidden], .warnings[hidden] { display: none; }
134
+ .send-status { color: var(--x-fg1); border-left: 3px solid var(--x-wait); }
88
135
  .warnings { padding: 6px 12px; font: 12px var(--x-sans); color: var(--x-fg2); background: var(--x-wait-bg); border-bottom: 1px solid var(--x-b1); }
89
136
  .warnings summary { cursor: pointer; color: var(--x-wait); font-weight: 500; }
90
137
  .warnings ul { margin: 6px 0 2px; padding-left: 18px; display: grid; gap: 4px; }
@@ -97,15 +144,54 @@ button.label:disabled, button.chip:disabled { cursor: default; }
97
144
  .error ul { margin: 0; padding-left: 18px; font: 12px/1.5 var(--x-mono); color: var(--x-fg2); }
98
145
  .error p { margin: 0; font: 12.5px/1.5 var(--x-mono); color: var(--x-fg2); white-space: pre-wrap; }
99
146
  .loading { padding: 16px 18px; color: var(--x-fg3); font-style: italic; }
100
- .controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; background: var(--x-s1); border-bottom: 1px solid var(--x-b2); font: 12px var(--x-sans); }
101
- .controls button { height: 26px; padding: 0 10px; border-radius: var(--x-r); border: 1px solid var(--x-b2); background: var(--x-s1); color: var(--x-fg1); cursor: pointer; font: 500 12px var(--x-sans); }
102
- .controls .play { min-width: 80px; background: var(--x-accent); border-color: var(--x-accent); color: var(--x-on-accent); }
103
- .controls .play[aria-pressed="true"] { background: var(--x-s1); color: var(--x-fg1); border-color: var(--x-b2); }
104
- .controls .step:disabled { opacity: .5; cursor: default; }
105
- .controls .speeds { display: inline-flex; border: 1px solid var(--x-b2); border-radius: var(--x-r); overflow: hidden; }
106
- .controls .speeds button { border: 0; border-radius: 0; height: 24px; padding: 0 7px; background: none; color: var(--x-fg3); min-width: 0; }
107
- .controls .speeds button[aria-pressed="true"] { background: var(--x-s3); color: var(--x-fg1); }
108
- .controls .clock { font: 500 12px var(--x-mono); color: var(--x-fg2); font-variant-numeric: tabular-nums; }
147
+ /* ── controls over the diagram's bottom edge ─────────────
148
+ Playback bottom-left, zoom bottom-right: one line, the same height, inset like the diagram
149
+ (12px). Solid surfaces with a hairline, like the boxes. */
150
+ .controls, .nav { position: absolute; bottom: 12px; z-index: 2; display: flex; align-items: center; gap: 6px; }
151
+ .controls { left: 12px; }
152
+ .nav { right: 12px; }
153
+ .controls[hidden], .nav[hidden], .controls .step[hidden], .zoom-reset[hidden] { display: none; }
154
+ .controls, .zoom, .zoom-reset {
155
+ box-sizing: border-box; height: 36px; border: 1px solid var(--x-b2); border-radius: 999px; background: var(--x-s1);
156
+ box-shadow: 0 1px 2px color-mix(in srgb, var(--x-fg1) 12%, transparent);
157
+ }
158
+ .controls { gap: 0; padding: 0 2px; }
159
+ .zoom { display: flex; align-items: center; padding: 0 2px; }
160
+ .controls button, .zoom button, .zoom-reset {
161
+ display: inline-grid; place-items: center; height: 30px; min-width: 30px; padding: 0 6px; box-sizing: border-box;
162
+ border: 0; border-radius: 999px; background: none; color: var(--x-fg2); cursor: pointer;
163
+ font: 500 12px var(--x-mono); font-variant-numeric: tabular-nums;
164
+ }
165
+ .controls button:hover:not(:disabled), .zoom button:hover, .zoom-reset:hover { color: var(--x-fg1); background: var(--x-s2); }
166
+ .controls button:focus-visible, .zoom button:focus-visible, .zoom-reset:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 1px; }
167
+ .controls .play { color: var(--x-accent-fg); }
168
+ .controls .step:disabled { opacity: .45; cursor: default; }
169
+ .controls .speeds { min-width: 40px; }
170
+ .controls .clock { padding: 0 10px 0 4px; font: 500 12px var(--x-mono); color: var(--x-fg2); font-variant-numeric: tabular-nums; white-space: nowrap; }
171
+ /* playing untouched: just the play button (a circle the height of the others) */
172
+ .controls.idle { padding: 0 2px; }
173
+ .controls.idle > :not(.play) { display: none; }
174
+ .zoom .zoom-level { min-width: 52px; }
175
+ .zoom-reset { display: inline-flex; gap: 5px; height: 36px; padding: 0 12px 0 10px; color: var(--x-accent-fg); font-family: var(--x-sans); }
176
+ .viewport[data-narrow] .zoom-reset span { display: none; }
177
+ .viewport[data-narrow] .zoom-reset { width: 36px; padding: 0; justify-content: center; }
178
+
179
+ /* −, level, + beside Fit: on hover, keyboard focus, or while zooming */
180
+ .zoom { visibility: hidden; }
181
+ @media (hover: hover) { .viewport:hover .zoom { visibility: visible; } }
182
+ .viewport:has(:focus-visible) .zoom, .viewport[data-zooming] .zoom { visibility: visible; }
183
+
184
+ /* room under the diagram, so its last row can scroll clear of the controls */
185
+ .viewport.has-controls .canvas { padding-bottom: 56px; }
186
+
187
+ /* fingers: bigger targets; −/+ give way to pinch and double tap */
188
+ @media (pointer: coarse) {
189
+ .controls, .zoom, .zoom-reset { height: 44px; }
190
+ .controls button, .zoom button { height: 40px; min-width: 40px; }
191
+ .zoom .zoom-in, .zoom .zoom-out { display: none; }
192
+ .viewport[data-narrow] .zoom-reset { width: 44px; }
193
+ .viewport.has-controls .canvas { padding-bottom: 64px; }
194
+ }
109
195
  ${SR_ONLY_CSS}
110
196
 
111
197
  /* the diagram's geometry is left-to-right; keep it anchored at the start of the canvas in RTL pages */
@@ -1 +1 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/view/styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsGhC,WAAW;;;;;CAKZ,CAAC","sourcesContent":["/**\n * Styles of `<scxml-view>`. Colours, fonts and shapes come from the shared\n * theme's private aliases (`--x-*`, sourced from the public `--scxml-*`\n * tokens in src/ui/theme.ts), so both elements theme the same way.\n */\nimport { SR_ONLY_CSS } from \"../ui/announcer.ts\";\n\nexport const VIEW_CSS = /* css */ `\n:host {\n display: block; position: relative; overflow: hidden;\n background: var(--x-bg); border: 1px solid var(--x-b2); border-radius: var(--x-r);\n}\n:host([hidden]) { display: none; }\n.frame { display: flex; flex-direction: column; max-height: var(--scxml-height, none); min-height: 0; }\n.canvas:focus-visible { outline: 2px solid var(--x-accent); outline-offset: -2px; }\n.canvas { overflow: auto; min-height: 0; flex: 1; overscroll-behavior: contain; }\n.diagram { position: relative; margin: 12px; }\n:host([fit]) .canvas { overflow: hidden; }\n:host([fit]) .diagram { transform-origin: 0 0; }\n\n/* ── boxes ─────────────────────────────────────────────── */\n.box { position: absolute; box-sizing: border-box; border-radius: calc(var(--x-r) + 3px); transition: background var(--x-dur), border-color var(--x-dur), box-shadow var(--x-dur); }\n.box.container { background: color-mix(in srgb, var(--x-s2) 55%, transparent); border: 1px solid var(--x-b2); }\n.box.container.depth-even { background: color-mix(in srgb, var(--x-s1) 70%, transparent); }\n.box.region { border-style: dashed; border-radius: var(--x-r); background: transparent; }\n.box.leaf { background: var(--x-s1); border: 1px solid var(--x-strong); padding: 8px 11px; display: flex; flex-direction: column; gap: 5px; box-shadow: 0 1px 0 color-mix(in srgb, var(--x-strong) 25%, transparent); }\n.box.final { border: 3px double var(--x-strong); border-radius: 999px; padding: 6px 16px; align-items: center; justify-content: center; }\n.box.history { border-radius: 50%; padding: 0; display: grid; place-items: center; font: 600 11px var(--x-mono); color: var(--x-fg2); }\n.box.collapsed { border-style: solid; border-width: 1px; background: var(--x-s1); box-shadow: 3px 3px 0 -1px var(--x-s1), 3px 3px 0 0 var(--x-b2); }\n.head { position: absolute; left: 0; right: 0; top: 0; padding: 7px 11px 0; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }\n.head > * { pointer-events: auto; }\n.name { font-weight: 600; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }\n.name .kind { font: 600 14px/1 var(--x-sans); color: var(--x-fg3); }\n.name .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--x-run); flex: none; display: none; }\n\n/* live state: text and shape, never colour alone */\n.box.active { border-color: var(--x-run); box-shadow: inset 0 0 0 1px var(--x-run); }\n.box.leaf.active { background: var(--x-run-bg); }\n.box.active > .name, .box.active > .head .name { color: var(--x-run); }\n.box.active > .name .dot, .box.active > .head .name .dot { display: inline-block; }\n.box.final.active { border-color: var(--x-done); box-shadow: none; background: var(--x-done-bg); }\n.box.final.active > .name { color: var(--x-done); }\n.box.region.active { box-shadow: none; }\n/* a terminated session: where it ended */\n.box.reached { border-color: var(--x-done); box-shadow: inset 0 0 0 1px var(--x-done); }\n.box.leaf.reached, .box.final.reached { background: var(--x-done-bg); }\n.box.reached > .name, .box.reached > .head .name { color: var(--x-done); }\n.box.region.reached { box-shadow: none; }\n.empty { margin: 0; padding: 16px; color: var(--x-fg3); }\n\n/* internal (targetless) transitions listed in a box */\n.internal { display: flex; flex-wrap: wrap; gap: 4px; }\n.internal .more { font: 500 11px var(--x-mono); color: var(--x-fg3); }\n\n/* ── transitions: labels are the buttons ───────────────── */\n.label, .chip {\n position: absolute; display: inline-flex; align-items: center; gap: 5px; box-sizing: border-box;\n height: 20px; padding: 0 8px; border-radius: 999px; white-space: nowrap; overflow: hidden;\n font: 500 11px/1 var(--x-mono); color: var(--x-fg2);\n background: var(--x-bg); border: 1px solid var(--x-b2);\n}\n.chip { position: static; }\n.label .cond, .chip .cond { color: var(--x-wait); font-weight: 400; }\nbutton.label, button.chip { cursor: pointer; }\n.label.live, .chip.live { color: var(--x-accent-fg); border-color: color-mix(in srgb, var(--x-accent) 45%, transparent); background: var(--x-s1); }\nbutton.label.live:hover, button.chip.live:hover { background: var(--x-accent-subtle); border-color: var(--x-accent); }\nbutton.label:disabled, button.chip:disabled { cursor: default; }\n.label.fired, .chip.fired { color: var(--x-on-accent); background: var(--x-accent); border-color: var(--x-accent); }\n.label.fired .cond, .chip.fired .cond { color: inherit; }\n\n.edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }\n.edges path.edge { fill: none; stroke: var(--x-fg4); stroke-width: 1.25; stroke-linejoin: round; transition: stroke var(--x-dur); }\n.edges path.edge.live { stroke: var(--x-accent); }\n.edges path.edge.fired { stroke: var(--x-accent); stroke-width: 2.25; }\n.edges .initial { fill: var(--x-fg1); }\n.edges path.initial-line { fill: none; stroke: var(--x-fg1); stroke-width: 1.25; }\n.edges marker path { fill: context-stroke; stroke: none; }\n\n/* ── folded groups ─────────────────────────────────────── */\n.badge-count { font: 500 11px var(--x-mono); color: var(--x-fg3); }\n.expand { align-self: flex-start; border: 1px solid var(--x-b2); background: var(--x-s1); border-radius: var(--x-r); height: 22px; padding: 0 8px; cursor: pointer; font: 500 11.5px var(--x-sans); color: var(--x-accent-fg); }\n.expand:hover { border-color: var(--x-accent); }\n.collapse { position: absolute; top: 5px; right: 6px; border: 0; background: none; padding: 1px 4px; cursor: pointer; font: 500 11px var(--x-sans); color: var(--x-fg3); border-radius: var(--x-r); }\n.collapse:hover { color: var(--x-accent-fg); background: var(--x-accent-subtle); }\n\n/* ── notices, errors, controls ─────────────────────────── */\n.notice { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 7px 12px; font: 12px var(--x-sans); color: var(--x-fg2); background: var(--x-s2); border-bottom: 1px solid var(--x-b1); }\n.notice[hidden], .controls[hidden], .error[hidden], .warnings[hidden] { display: none; }\n.warnings { padding: 6px 12px; font: 12px var(--x-sans); color: var(--x-fg2); background: var(--x-wait-bg); border-bottom: 1px solid var(--x-b1); }\n.warnings summary { cursor: pointer; color: var(--x-wait); font-weight: 500; }\n.warnings ul { margin: 6px 0 2px; padding-left: 18px; display: grid; gap: 4px; }\n.warnings button { all: unset; cursor: pointer; line-height: 1.4; }\n.warnings button:hover { text-decoration: underline; }\n.warnings button:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 2px; border-radius: 2px; }\n.notice button { border: 1px solid var(--x-b2); background: var(--x-s1); border-radius: var(--x-r); height: 24px; padding: 0 9px; cursor: pointer; font: 500 12px var(--x-sans); color: var(--x-fg1); }\n.error { padding: 16px 18px; color: var(--x-fg1); }\n.error h2 { font: var(--x-display-weight) 16px/1.2 var(--x-serif); margin: 0 0 8px; color: var(--x-err); }\n.error ul { margin: 0; padding-left: 18px; font: 12px/1.5 var(--x-mono); color: var(--x-fg2); }\n.error p { margin: 0; font: 12.5px/1.5 var(--x-mono); color: var(--x-fg2); white-space: pre-wrap; }\n.loading { padding: 16px 18px; color: var(--x-fg3); font-style: italic; }\n.controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; background: var(--x-s1); border-bottom: 1px solid var(--x-b2); font: 12px var(--x-sans); }\n.controls button { height: 26px; padding: 0 10px; border-radius: var(--x-r); border: 1px solid var(--x-b2); background: var(--x-s1); color: var(--x-fg1); cursor: pointer; font: 500 12px var(--x-sans); }\n.controls .play { min-width: 80px; background: var(--x-accent); border-color: var(--x-accent); color: var(--x-on-accent); }\n.controls .play[aria-pressed=\"true\"] { background: var(--x-s1); color: var(--x-fg1); border-color: var(--x-b2); }\n.controls .step:disabled { opacity: .5; cursor: default; }\n.controls .speeds { display: inline-flex; border: 1px solid var(--x-b2); border-radius: var(--x-r); overflow: hidden; }\n.controls .speeds button { border: 0; border-radius: 0; height: 24px; padding: 0 7px; background: none; color: var(--x-fg3); min-width: 0; }\n.controls .speeds button[aria-pressed=\"true\"] { background: var(--x-s3); color: var(--x-fg1); }\n.controls .clock { font: 500 12px var(--x-mono); color: var(--x-fg2); font-variant-numeric: tabular-nums; }\n${SR_ONLY_CSS}\n\n/* the diagram's geometry is left-to-right; keep it anchored at the start of the canvas in RTL pages */\n.canvas { direction: ltr; }\n.canvas .box, .canvas .label, .canvas .chip { direction: inherit; unicode-bidi: plaintext; }\n`;\n"]}
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../src/view/styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4LhC,WAAW;;;;;CAKZ,CAAC","sourcesContent":["/**\n * Styles of `<scxml-view>`. Colours, fonts and shapes come from the shared\n * theme's private aliases (`--x-*`, sourced from the public `--scxml-*`\n * tokens in src/ui/theme.ts), so both elements theme the same way.\n */\nimport { SR_ONLY_CSS } from \"../ui/announcer.ts\";\n\nexport const VIEW_CSS = /* css */ `\n:host {\n display: block; position: relative; overflow: hidden;\n background: var(--x-bg); border: 1px solid var(--x-b2); border-radius: var(--x-r);\n}\n:host([hidden]) { display: none; }\n.frame { display: flex; flex-direction: column; max-height: var(--scxml-height, none); min-height: 0; }\n.canvas:focus-visible { outline: 2px solid var(--x-accent); outline-offset: -2px; }\n.viewport { position: relative; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }\n.canvas { overflow: auto; min-height: 0; flex: 1 1 auto; overscroll-behavior: contain; cursor: grab; }\n/* one finger scrolls; two pinch-zoom the diagram (handled by the element), not the page */\n.canvas { touch-action: pan-x pan-y; }\n.canvas.panning { cursor: grabbing; user-select: none; -webkit-user-select: none; }\n.canvas.panning * { cursor: grabbing !important; }\n.diagram { position: relative; margin: 12px; }\n:host([fit]) .canvas:not(.zoomed) { overflow: hidden; }\n:host([fit]) .diagram { transform-origin: 0 0; }\n\n/* ── boxes ─────────────────────────────────────────────── */\n.box { position: absolute; box-sizing: border-box; border-radius: calc(var(--x-r) + 3px); transition: background var(--x-dur), border-color var(--x-dur), box-shadow var(--x-dur); }\n.box.container { background: color-mix(in srgb, var(--x-s2) 55%, transparent); border: 1px solid var(--x-b2); }\n.box.container.depth-even { background: color-mix(in srgb, var(--x-s1) 70%, transparent); }\n.box.region { border-style: dashed; border-radius: var(--x-r); background: transparent; }\n.box.leaf { background: var(--x-s1); border: 1px solid var(--x-strong); padding: 8px 11px; display: flex; flex-direction: column; gap: 5px; box-shadow: 0 1px 0 color-mix(in srgb, var(--x-strong) 25%, transparent); }\n.box.final { border: 3px double var(--x-strong); border-radius: 999px; padding: 6px 16px; align-items: center; justify-content: center; }\n.box.history { border-radius: 50%; padding: 0; display: grid; place-items: center; font: 600 11px var(--x-mono); color: var(--x-fg2); }\n.box.collapsed { border-style: solid; border-width: 1px; background: var(--x-s1); box-shadow: 3px 3px 0 -1px var(--x-s1), 3px 3px 0 0 var(--x-b2); }\n.head { position: absolute; left: 0; right: 0; top: 0; padding: 7px 11px 0; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }\n.head > * { pointer-events: auto; }\n.title { display: flex; align-items: center; gap: 4px; min-width: 0; }\n.box.final > .title { justify-content: center; }\n.title .name { flex: 0 1 auto; min-width: 0; }\n.name { font-weight: 600; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }\n.name .kind { font: 600 14px/1 var(--x-sans); color: var(--x-fg3); }\n.name .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--x-run); flex: none; display: none; }\n\n/* live state: text and shape, never colour alone */\n.box.active { border-color: var(--x-run); box-shadow: inset 0 0 0 1px var(--x-run); }\n.box.leaf.active { background: var(--x-run-bg); }\n.box.active > .title .name, .box.active > .head .name { color: var(--x-run); }\n.box.active > .title .name .dot, .box.active > .head .name .dot { display: inline-block; }\n.box.final.active { border-color: var(--x-done); box-shadow: none; background: var(--x-done-bg); }\n.box.final.active > .title .name { color: var(--x-done); }\n.box.region.active { box-shadow: none; }\n/* a terminated session: where it ended */\n.box.reached { border-color: var(--x-done); box-shadow: inset 0 0 0 1px var(--x-done); }\n.box.leaf.reached, .box.final.reached { background: var(--x-done-bg); }\n.box.reached > .title .name, .box.reached > .head .name { color: var(--x-done); }\n.box.region.reached { box-shadow: none; }\n.empty { margin: 0; padding: 16px; color: var(--x-fg3); }\n\n/* internal (targetless) transitions listed in a box */\n.internal { display: flex; flex-wrap: wrap; gap: 4px; max-width: 360px; }\n.internal .more { font: 500 11px var(--x-mono); color: var(--x-fg3); }\n\n/* ── transitions: labels are the buttons ───────────────── */\n.label, .chip {\n position: absolute; display: inline-flex; align-items: center; gap: 5px; box-sizing: border-box;\n height: 20px; padding: 0 8px; border-radius: 999px; white-space: nowrap; overflow: hidden;\n font: 500 11px/1 var(--x-mono); color: var(--x-fg2);\n background: var(--x-bg); border: 1px solid var(--x-b2);\n}\n.chip { position: static; }\n.label .cond, .chip .cond { color: var(--x-wait); font-weight: 400; }\nbutton.label, button.chip { cursor: pointer; }\n.label.live, .chip.live { color: var(--x-accent-fg); border-color: color-mix(in srgb, var(--x-accent) 45%, transparent); background: var(--x-s1); }\nbutton.label.live:hover, button.chip.live:hover { background: var(--x-accent-subtle); border-color: var(--x-accent); }\nbutton.label:disabled, button.chip:disabled { cursor: default; }\n.label.fired, .chip.fired { color: var(--x-on-accent); background: var(--x-accent); border-color: var(--x-accent); }\n.label.fired .cond, .chip.fired .cond { color: inherit; }\n/* a long-distance transition listed in its source's box, and its target while it's hovered */\n.chip.portal .to { color: var(--x-fg3); font-weight: 400; }\n.chip.portal.live .to { color: inherit; opacity: .75; }\n.chip.portal.fired .to { color: inherit; }\n.box.portal-target { outline: 2px dashed var(--x-accent); outline-offset: 2px; }\n\n.edges { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }\n.edges path.edge { fill: none; stroke: var(--x-fg4); stroke-width: 1.25; stroke-linejoin: round; transition: stroke var(--x-dur); }\n.edges path.edge.live { stroke: var(--x-accent); }\n.edges path.edge.fired { stroke: var(--x-accent); stroke-width: 2.25; }\n.edges .initial { fill: var(--x-fg1); }\n.edges path.initial-line { fill: none; stroke: var(--x-fg1); stroke-width: 1.25; }\n.edges marker path { fill: context-stroke; stroke: none; }\n\n/* ── folded groups ─────────────────────────────────────── */\n.badge-count { font: 500 11px var(--x-mono); color: var(--x-fg3); }\n\n/* ── icon buttons in a state's title: fold toggle and help ── */\n.toggle, .help {\n flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; margin: -2px 0;\n border: 0; border-radius: var(--x-r); background: none; color: var(--x-fg3); cursor: pointer;\n}\n.toggle { margin-left: -4px; }\n.help { color: var(--x-fg4); }\n.toggle:hover, .help:hover, .help[aria-expanded=\"true\"] { color: var(--x-accent-fg); background: var(--x-accent-subtle); }\n.toggle:focus-visible, .help:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 0; }\n.toggle.expand { color: var(--x-accent-fg); }\n.icon { display: block; pointer-events: none; }\n/* fingers: the same small icons, with a hit area of about 34px */\n@media (pointer: coarse) {\n .toggle, .help { position: relative; }\n .toggle::after, .help::after { content: \"\"; position: absolute; inset: -8px; }\n}\n\n/* ── help popover ──────────────────────────────────────── */\n.help-popover {\n position: absolute; z-index: 3; box-sizing: border-box; width: max-content; max-width: min(340px, calc(100% - 8px));\n padding: 10px 12px; border: 1px solid var(--x-b2); border-radius: calc(var(--x-r) + 2px);\n background: var(--x-bg); color: var(--x-fg1); font: 12.5px/1.45 var(--x-sans);\n box-shadow: 0 6px 24px -8px color-mix(in srgb, var(--x-fg1) 35%, transparent);\n}\n.help-popover[hidden] { display: none; }\n.help-popover:focus { outline: none; }\n.help-popover:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 1px; }\n.help-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }\n.help-head strong { font: 600 13px var(--x-mono); overflow-wrap: anywhere; }\n.help-kind { font-size: 11.5px; color: var(--x-fg3); }\n.help-text p { margin: 0 0 6px; white-space: pre-wrap; }\n.help-text p:last-child { margin-bottom: 0; }\n.help-none { margin: 0; color: var(--x-fg3); font-style: italic; }\n.help-sub { margin-top: 8px; font-size: 11px; font-weight: 600; color: var(--x-fg3); text-transform: uppercase; letter-spacing: .04em; }\n.help-transitions { margin: 3px 0 0; padding-left: 16px; font: 11.5px/1.5 var(--x-mono); color: var(--x-fg2); }\n\n\n/* ── notices, errors, controls ─────────────────────────── */\n.notice { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 7px 12px; font: 12px var(--x-sans); color: var(--x-fg2); background: var(--x-s2); border-bottom: 1px solid var(--x-b1); }\n.notice[hidden], .error[hidden], .warnings[hidden] { display: none; }\n.send-status { color: var(--x-fg1); border-left: 3px solid var(--x-wait); }\n.warnings { padding: 6px 12px; font: 12px var(--x-sans); color: var(--x-fg2); background: var(--x-wait-bg); border-bottom: 1px solid var(--x-b1); }\n.warnings summary { cursor: pointer; color: var(--x-wait); font-weight: 500; }\n.warnings ul { margin: 6px 0 2px; padding-left: 18px; display: grid; gap: 4px; }\n.warnings button { all: unset; cursor: pointer; line-height: 1.4; }\n.warnings button:hover { text-decoration: underline; }\n.warnings button:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 2px; border-radius: 2px; }\n.notice button { border: 1px solid var(--x-b2); background: var(--x-s1); border-radius: var(--x-r); height: 24px; padding: 0 9px; cursor: pointer; font: 500 12px var(--x-sans); color: var(--x-fg1); }\n.error { padding: 16px 18px; color: var(--x-fg1); }\n.error h2 { font: var(--x-display-weight) 16px/1.2 var(--x-serif); margin: 0 0 8px; color: var(--x-err); }\n.error ul { margin: 0; padding-left: 18px; font: 12px/1.5 var(--x-mono); color: var(--x-fg2); }\n.error p { margin: 0; font: 12.5px/1.5 var(--x-mono); color: var(--x-fg2); white-space: pre-wrap; }\n.loading { padding: 16px 18px; color: var(--x-fg3); font-style: italic; }\n/* ── controls over the diagram's bottom edge ─────────────\n Playback bottom-left, zoom bottom-right: one line, the same height, inset like the diagram\n (12px). Solid surfaces with a hairline, like the boxes. */\n.controls, .nav { position: absolute; bottom: 12px; z-index: 2; display: flex; align-items: center; gap: 6px; }\n.controls { left: 12px; }\n.nav { right: 12px; }\n.controls[hidden], .nav[hidden], .controls .step[hidden], .zoom-reset[hidden] { display: none; }\n.controls, .zoom, .zoom-reset {\n box-sizing: border-box; height: 36px; border: 1px solid var(--x-b2); border-radius: 999px; background: var(--x-s1);\n box-shadow: 0 1px 2px color-mix(in srgb, var(--x-fg1) 12%, transparent);\n}\n.controls { gap: 0; padding: 0 2px; }\n.zoom { display: flex; align-items: center; padding: 0 2px; }\n.controls button, .zoom button, .zoom-reset {\n display: inline-grid; place-items: center; height: 30px; min-width: 30px; padding: 0 6px; box-sizing: border-box;\n border: 0; border-radius: 999px; background: none; color: var(--x-fg2); cursor: pointer;\n font: 500 12px var(--x-mono); font-variant-numeric: tabular-nums;\n}\n.controls button:hover:not(:disabled), .zoom button:hover, .zoom-reset:hover { color: var(--x-fg1); background: var(--x-s2); }\n.controls button:focus-visible, .zoom button:focus-visible, .zoom-reset:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 1px; }\n.controls .play { color: var(--x-accent-fg); }\n.controls .step:disabled { opacity: .45; cursor: default; }\n.controls .speeds { min-width: 40px; }\n.controls .clock { padding: 0 10px 0 4px; font: 500 12px var(--x-mono); color: var(--x-fg2); font-variant-numeric: tabular-nums; white-space: nowrap; }\n/* playing untouched: just the play button (a circle the height of the others) */\n.controls.idle { padding: 0 2px; }\n.controls.idle > :not(.play) { display: none; }\n.zoom .zoom-level { min-width: 52px; }\n.zoom-reset { display: inline-flex; gap: 5px; height: 36px; padding: 0 12px 0 10px; color: var(--x-accent-fg); font-family: var(--x-sans); }\n.viewport[data-narrow] .zoom-reset span { display: none; }\n.viewport[data-narrow] .zoom-reset { width: 36px; padding: 0; justify-content: center; }\n\n/* −, level, + beside Fit: on hover, keyboard focus, or while zooming */\n.zoom { visibility: hidden; }\n@media (hover: hover) { .viewport:hover .zoom { visibility: visible; } }\n.viewport:has(:focus-visible) .zoom, .viewport[data-zooming] .zoom { visibility: visible; }\n\n/* room under the diagram, so its last row can scroll clear of the controls */\n.viewport.has-controls .canvas { padding-bottom: 56px; }\n\n/* fingers: bigger targets; −/+ give way to pinch and double tap */\n@media (pointer: coarse) {\n .controls, .zoom, .zoom-reset { height: 44px; }\n .controls button, .zoom button { height: 40px; min-width: 40px; }\n .zoom .zoom-in, .zoom .zoom-out { display: none; }\n .viewport[data-narrow] .zoom-reset { width: 44px; }\n .viewport.has-controls .canvas { padding-bottom: 64px; }\n}\n${SR_ONLY_CSS}\n\n/* the diagram's geometry is left-to-right; keep it anchored at the start of the canvas in RTL pages */\n.canvas { direction: ltr; }\n.canvas .box, .canvas .label, .canvas .chip { direction: inherit; unicode-bidi: plaintext; }\n`;\n"]}
package/dist/view.d.ts CHANGED
@@ -1,9 +1,12 @@
1
+ /// <reference lib="dom" />
1
2
  /**
2
3
  * @tinyactors/scxmljs/view — the `<scxml-view>` custom element: a whole
3
4
  * statechart, drawn and running, with no JavaScript of your own.
4
5
  *
5
- * <script type="module">import "@tinyactors/scxmljs/view";</script>
6
- * <scxml-view src="traffic-light.scxml"></scxml-view>
6
+ * ```html
7
+ * <script type="module">import "@tinyactors/scxmljs/view";</script>
8
+ * <scxml-view src="traffic-light.scxml"></scxml-view>
9
+ * ```
7
10
  *
8
11
  * Importing this module registers `<scxml-view>`. The data model engine is
9
12
  * loaded on demand: the QuickJS sandbox by default, the host's engine with
@@ -15,6 +18,7 @@
15
18
  *
16
19
  * @packageDocumentation
17
20
  */
18
- export { ScxmlView, type ViewAnnounce, type ViewDirection, type ViewErrorDetail, type ViewLoadDetail, type ViewOptions, type ViewSendDetail, ViewSourceError, } from "./view/element.js";
19
- export { autoCollapse, type BoxKind, type BoxLayout, type ChartLayout, type Direction, type EdgeKind, type EdgeLayout, type InitialMarker, type LayoutOptions, layoutChart, type Point, type Rect, type Size, type Spacing, } from "./view/layout.js";
21
+ export { sourceDescription } from "./view/describe.js";
22
+ export { ScxmlView, type ViewAnnounce, type ViewDescriptions, type ViewDirection, type ViewErrorDetail, type ViewLoadDetail, type ViewOptions, type ViewSendDetail, ViewSourceError, } from "./view/element.js";
23
+ export { autoCollapse, type BoxKind, type BoxLayout, type ChartLayout, type Direction, type EdgeKind, type EdgeLayout, type InitialMarker, type LayoutOptions, layoutChart, PORTAL_BORDERS, type Point, portalTransitions, type Rect, type Size, type Spacing, } from "./view/layout.js";
20
24
  export { defaultViewStrings, type ViewStateKind, type ViewStrings } from "./view/strings.js";
package/dist/view.js CHANGED
@@ -2,8 +2,10 @@
2
2
  * @tinyactors/scxmljs/view — the `<scxml-view>` custom element: a whole
3
3
  * statechart, drawn and running, with no JavaScript of your own.
4
4
  *
5
- * <script type="module">import "@tinyactors/scxmljs/view";</script>
6
- * <scxml-view src="traffic-light.scxml"></scxml-view>
5
+ * ```html
6
+ * <script type="module">import "@tinyactors/scxmljs/view";</script>
7
+ * <scxml-view src="traffic-light.scxml"></scxml-view>
8
+ * ```
7
9
  *
8
10
  * Importing this module registers `<scxml-view>`. The data model engine is
9
11
  * loaded on demand: the QuickJS sandbox by default, the host's engine with
@@ -15,7 +17,8 @@
15
17
  *
16
18
  * @packageDocumentation
17
19
  */
20
+ export { sourceDescription } from "./view/describe.js";
18
21
  export { ScxmlView, ViewSourceError, } from "./view/element.js";
19
- export { autoCollapse, layoutChart, } from "./view/layout.js";
22
+ export { autoCollapse, layoutChart, PORTAL_BORDERS, portalTransitions, } from "./view/layout.js";
20
23
  export { defaultViewStrings } from "./view/strings.js";
21
24
  //# sourceMappingURL=view.js.map
package/dist/view.js.map CHANGED
@@ -1 +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"]}
1
+ {"version":3,"file":"view.js","sourceRoot":"","sources":["../src/view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EACL,SAAS,EAQT,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,YAAY,EASZ,WAAW,EACX,cAAc,EAEd,iBAAiB,GAIlB,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 * ```html\n * <script type=\"module\">import \"@tinyactors/scxmljs/view\";</script>\n * <scxml-view src=\"traffic-light.scxml\"></scxml-view>\n * ```\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 */\n\nexport { sourceDescription } from \"./view/describe.ts\";\nexport {\n ScxmlView,\n type ViewAnnounce,\n type ViewDescriptions,\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 PORTAL_BORDERS,\n type Point,\n portalTransitions,\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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinyactors/scxmljs",
3
- "version": "0.2.0-dev.0",
3
+ "version": "0.2.0",
4
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
5
  "keywords": [
6
6
  "scxml",
@@ -16,7 +16,7 @@
16
16
  ],
17
17
  "author": "Dario Hamidi <dario.hamidi@gmail.com>",
18
18
  "license": "MIT",
19
- "homepage": "https://github.com/tinyactors-dev/scxmljs#readme",
19
+ "homepage": "https://scxmljs.tinyactors.dev",
20
20
  "repository": {
21
21
  "type": "git",
22
22
  "url": "git+https://github.com/tinyactors-dev/scxmljs.git",