@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.
- package/README.md +9 -9
- package/dist/explorer/element.d.ts +5 -3
- package/dist/explorer/element.js +523 -262
- package/dist/explorer/element.js.map +1 -1
- package/dist/explorer/strings.d.ts +41 -23
- package/dist/explorer/strings.js +24 -15
- package/dist/explorer/strings.js.map +1 -1
- package/dist/explorer/styles.d.ts +9 -1
- package/dist/explorer/styles.js +291 -150
- package/dist/explorer/styles.js.map +1 -1
- package/dist/explorer.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/model.d.ts +4 -1
- package/dist/model.js +7 -1
- package/dist/model.js.map +1 -1
- package/dist/session.d.ts +22 -9
- package/dist/session.js +53 -13
- package/dist/session.js.map +1 -1
- package/dist/themes/tinyactors.css +1 -0
- package/dist/trusted.d.ts +1 -0
- package/dist/ui/icons.d.ts +31 -0
- package/dist/ui/icons.js +186 -0
- package/dist/ui/icons.js.map +1 -0
- package/dist/ui/notation.d.ts +53 -0
- package/dist/ui/notation.js +117 -0
- package/dist/ui/notation.js.map +1 -0
- package/dist/ui/svg.d.ts +4 -0
- package/dist/ui/svg.js +26 -0
- package/dist/ui/svg.js.map +1 -1
- package/dist/ui/theme.d.ts +1 -1
- package/dist/ui/theme.js +6 -0
- package/dist/ui/theme.js.map +1 -1
- package/dist/view/describe.d.ts +17 -0
- package/dist/view/describe.js +49 -0
- package/dist/view/describe.js.map +1 -0
- package/dist/view/element.d.ts +39 -9
- package/dist/view/element.js +723 -86
- package/dist/view/element.js.map +1 -1
- package/dist/view/layout.d.ts +20 -0
- package/dist/view/layout.js +205 -29
- package/dist/view/layout.js.map +1 -1
- package/dist/view/strings.d.ts +34 -8
- package/dist/view/strings.js +19 -6
- package/dist/view/strings.js.map +1 -1
- package/dist/view/styles.d.ts +1 -1
- package/dist/view/styles.js +107 -21
- package/dist/view/styles.js.map +1 -1
- package/dist/view.d.ts +8 -4
- package/dist/view.js +6 -3
- package/dist/view.js.map +1 -1
- package/package.json +2 -2
package/dist/trusted.d.ts
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The glyphs of the elements' visual language (docs/design-principles.md: that table is the only
|
|
3
|
+
* list, one meaning per glyph). Lucide icons (https://lucide.dev, ISC licence), copied from
|
|
4
|
+
* lucide-static 0.460.0 (`funnel` from 0.500.0) as element/attribute pairs on a 24×24 grid,
|
|
5
|
+
* drawn with `icon()` (./svg.ts) as DOM nodes: no asset files, nothing parsed from markup.
|
|
6
|
+
* One export per icon, so a bundle carries only the icons its element draws.
|
|
7
|
+
*/
|
|
8
|
+
import type { IconDef } from "./svg.js";
|
|
9
|
+
export declare const logIn: IconDef;
|
|
10
|
+
export declare const logOut: IconDef;
|
|
11
|
+
export declare const send: IconDef;
|
|
12
|
+
export declare const logs: IconDef;
|
|
13
|
+
export declare const workflow: IconDef;
|
|
14
|
+
export declare const diamond: IconDef;
|
|
15
|
+
export declare const layers: IconDef;
|
|
16
|
+
export declare const doorOpen: IconDef;
|
|
17
|
+
export declare const cornerDownRight: IconDef;
|
|
18
|
+
export declare const chevronDown: IconDef;
|
|
19
|
+
export declare const chevronRight: IconDef;
|
|
20
|
+
export declare const circleHelp: IconDef;
|
|
21
|
+
export declare const list: IconDef;
|
|
22
|
+
export declare const network: IconDef;
|
|
23
|
+
export declare const funnel: IconDef;
|
|
24
|
+
export declare const locate: IconDef;
|
|
25
|
+
export declare const locateFixed: IconDef;
|
|
26
|
+
export declare const play: IconDef;
|
|
27
|
+
export declare const pause: IconDef;
|
|
28
|
+
export declare const stepForward: IconDef;
|
|
29
|
+
export declare const scan: IconDef;
|
|
30
|
+
export declare const minus: IconDef;
|
|
31
|
+
export declare const plus: IconDef;
|
package/dist/ui/icons.js
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
// what a state does
|
|
2
|
+
export const logIn = [
|
|
3
|
+
"log-in",
|
|
4
|
+
[
|
|
5
|
+
["path", { d: "M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4" }],
|
|
6
|
+
["polyline", { points: "10 17 15 12 10 7" }],
|
|
7
|
+
["line", { x1: "15", x2: "3", y1: "12", y2: "12" }],
|
|
8
|
+
],
|
|
9
|
+
];
|
|
10
|
+
export const logOut = [
|
|
11
|
+
"log-out",
|
|
12
|
+
[
|
|
13
|
+
["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }],
|
|
14
|
+
["polyline", { points: "16 17 21 12 16 7" }],
|
|
15
|
+
["line", { x1: "21", x2: "9", y1: "12", y2: "12" }],
|
|
16
|
+
],
|
|
17
|
+
];
|
|
18
|
+
export const send = [
|
|
19
|
+
"send",
|
|
20
|
+
[
|
|
21
|
+
[
|
|
22
|
+
"path",
|
|
23
|
+
{
|
|
24
|
+
d: "M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
["path", { d: "m21.854 2.147-10.94 10.939" }],
|
|
28
|
+
],
|
|
29
|
+
];
|
|
30
|
+
export const logs = [
|
|
31
|
+
"logs",
|
|
32
|
+
[
|
|
33
|
+
["path", { d: "M13 12h8" }],
|
|
34
|
+
["path", { d: "M13 18h8" }],
|
|
35
|
+
["path", { d: "M13 6h8" }],
|
|
36
|
+
["path", { d: "M3 12h1" }],
|
|
37
|
+
["path", { d: "M3 18h1" }],
|
|
38
|
+
["path", { d: "M3 6h1" }],
|
|
39
|
+
["path", { d: "M8 12h1" }],
|
|
40
|
+
["path", { d: "M8 18h1" }],
|
|
41
|
+
["path", { d: "M8 6h1" }],
|
|
42
|
+
],
|
|
43
|
+
];
|
|
44
|
+
export const workflow = [
|
|
45
|
+
"workflow",
|
|
46
|
+
[
|
|
47
|
+
["rect", { width: "8", height: "8", x: "3", y: "3", rx: "2" }],
|
|
48
|
+
["path", { d: "M7 11v4a2 2 0 0 0 2 2h4" }],
|
|
49
|
+
["rect", { width: "8", height: "8", x: "13", y: "13", rx: "2" }],
|
|
50
|
+
],
|
|
51
|
+
];
|
|
52
|
+
// transitions
|
|
53
|
+
export const diamond = [
|
|
54
|
+
"diamond",
|
|
55
|
+
[
|
|
56
|
+
[
|
|
57
|
+
"path",
|
|
58
|
+
{
|
|
59
|
+
d: "M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z",
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
],
|
|
63
|
+
];
|
|
64
|
+
// structure and navigation
|
|
65
|
+
export const layers = [
|
|
66
|
+
"layers",
|
|
67
|
+
[
|
|
68
|
+
["path", { d: "m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z" }],
|
|
69
|
+
["path", { d: "m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65" }],
|
|
70
|
+
["path", { d: "m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65" }],
|
|
71
|
+
],
|
|
72
|
+
];
|
|
73
|
+
export const doorOpen = [
|
|
74
|
+
"door-open",
|
|
75
|
+
[
|
|
76
|
+
["path", { d: "M13 4h3a2 2 0 0 1 2 2v14" }],
|
|
77
|
+
["path", { d: "M2 20h3" }],
|
|
78
|
+
["path", { d: "M13 20h9" }],
|
|
79
|
+
["path", { d: "M10 12v.01" }],
|
|
80
|
+
["path", { d: "M13 4.562v16.157a1 1 0 0 1-1.242.97L5 20V5.562a2 2 0 0 1 1.515-1.94l4-1A2 2 0 0 1 13 4.561Z" }],
|
|
81
|
+
],
|
|
82
|
+
];
|
|
83
|
+
export const cornerDownRight = [
|
|
84
|
+
"corner-down-right",
|
|
85
|
+
[
|
|
86
|
+
["polyline", { points: "15 10 20 15 15 20" }],
|
|
87
|
+
["path", { d: "M4 4v7a4 4 0 0 0 4 4h12" }],
|
|
88
|
+
],
|
|
89
|
+
];
|
|
90
|
+
export const chevronDown = ["chevron-down", [["path", { d: "m6 9 6 6 6-6" }]]];
|
|
91
|
+
export const chevronRight = ["chevron-right", [["path", { d: "m9 18 6-6-6-6" }]]];
|
|
92
|
+
export const circleHelp = [
|
|
93
|
+
"circle-help",
|
|
94
|
+
[
|
|
95
|
+
["circle", { cx: "12", cy: "12", r: "10" }],
|
|
96
|
+
["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }],
|
|
97
|
+
["path", { d: "M12 17h.01" }],
|
|
98
|
+
],
|
|
99
|
+
];
|
|
100
|
+
// view controls
|
|
101
|
+
export const list = [
|
|
102
|
+
"list",
|
|
103
|
+
[
|
|
104
|
+
["path", { d: "M3 12h.01" }],
|
|
105
|
+
["path", { d: "M3 18h.01" }],
|
|
106
|
+
["path", { d: "M3 6h.01" }],
|
|
107
|
+
["path", { d: "M8 12h13" }],
|
|
108
|
+
["path", { d: "M8 18h13" }],
|
|
109
|
+
["path", { d: "M8 6h13" }],
|
|
110
|
+
],
|
|
111
|
+
];
|
|
112
|
+
export const network = [
|
|
113
|
+
"network",
|
|
114
|
+
[
|
|
115
|
+
["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1" }],
|
|
116
|
+
["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1" }],
|
|
117
|
+
["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1" }],
|
|
118
|
+
["path", { d: "M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3" }],
|
|
119
|
+
["path", { d: "M12 12V8" }],
|
|
120
|
+
],
|
|
121
|
+
];
|
|
122
|
+
export const funnel = [
|
|
123
|
+
"funnel",
|
|
124
|
+
[
|
|
125
|
+
[
|
|
126
|
+
"path",
|
|
127
|
+
{
|
|
128
|
+
d: "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
],
|
|
132
|
+
];
|
|
133
|
+
export const locate = [
|
|
134
|
+
"locate",
|
|
135
|
+
[
|
|
136
|
+
["line", { x1: "2", x2: "5", y1: "12", y2: "12" }],
|
|
137
|
+
["line", { x1: "19", x2: "22", y1: "12", y2: "12" }],
|
|
138
|
+
["line", { x1: "12", x2: "12", y1: "2", y2: "5" }],
|
|
139
|
+
["line", { x1: "12", x2: "12", y1: "19", y2: "22" }],
|
|
140
|
+
["circle", { cx: "12", cy: "12", r: "7" }],
|
|
141
|
+
],
|
|
142
|
+
];
|
|
143
|
+
export const locateFixed = [
|
|
144
|
+
"locate-fixed",
|
|
145
|
+
[
|
|
146
|
+
["line", { x1: "2", x2: "5", y1: "12", y2: "12" }],
|
|
147
|
+
["line", { x1: "19", x2: "22", y1: "12", y2: "12" }],
|
|
148
|
+
["line", { x1: "12", x2: "12", y1: "2", y2: "5" }],
|
|
149
|
+
["line", { x1: "12", x2: "12", y1: "19", y2: "22" }],
|
|
150
|
+
["circle", { cx: "12", cy: "12", r: "7" }],
|
|
151
|
+
["circle", { cx: "12", cy: "12", r: "3" }],
|
|
152
|
+
],
|
|
153
|
+
];
|
|
154
|
+
export const play = ["play", [["polygon", { points: "6 3 20 12 6 21 6 3" }]]];
|
|
155
|
+
export const pause = [
|
|
156
|
+
"pause",
|
|
157
|
+
[
|
|
158
|
+
["rect", { x: "14", y: "4", width: "4", height: "16", rx: "1" }],
|
|
159
|
+
["rect", { x: "6", y: "4", width: "4", height: "16", rx: "1" }],
|
|
160
|
+
],
|
|
161
|
+
];
|
|
162
|
+
export const stepForward = [
|
|
163
|
+
"step-forward",
|
|
164
|
+
[
|
|
165
|
+
["line", { x1: "6", x2: "6", y1: "4", y2: "20" }],
|
|
166
|
+
["polygon", { points: "10,4 20,12 10,20" }],
|
|
167
|
+
],
|
|
168
|
+
];
|
|
169
|
+
export const scan = [
|
|
170
|
+
"scan",
|
|
171
|
+
[
|
|
172
|
+
["path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }],
|
|
173
|
+
["path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }],
|
|
174
|
+
["path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }],
|
|
175
|
+
["path", { d: "M7 21H5a2 2 0 0 1-2-2v-2" }],
|
|
176
|
+
],
|
|
177
|
+
];
|
|
178
|
+
export const minus = ["minus", [["path", { d: "M5 12h14" }]]];
|
|
179
|
+
export const plus = [
|
|
180
|
+
"plus",
|
|
181
|
+
[
|
|
182
|
+
["path", { d: "M5 12h14" }],
|
|
183
|
+
["path", { d: "M12 5v14" }],
|
|
184
|
+
],
|
|
185
|
+
];
|
|
186
|
+
//# sourceMappingURL=icons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.js","sourceRoot":"","sources":["../../src/ui/icons.ts"],"names":[],"mappings":"AASA,oBAAoB;AACpB,MAAM,CAAC,MAAM,KAAK,GAAY;IAC5B,QAAQ;IACR;QACE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,2CAA2C,EAAE,CAAC;QAC5D,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;QAC5C,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;KACpD;CACF,CAAC;AACF,MAAM,CAAC,MAAM,MAAM,GAAY;IAC7B,SAAS;IACT;QACE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,yCAAyC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AE,CAAC;QAChE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC;KAChE;CACF,CAAC;AACF,MAAM,CAAC,MAAM,WAAW,GAAY;IAClC,cAAc;IACd;QACE,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;QACjD,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;KAC5C;CACF,CAAC;AACF,MAAM,CAAC,MAAM,IAAI,GAAY;IAC3B,MAAM;IACN;QACE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,wBAAwB,EAAE,CAAC;QACzC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,yBAAyB,EAAE,CAAC;QAC1C,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,2BAA2B,EAAE,CAAC;QAC5C,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,0BAA0B,EAAE,CAAC;KAC5C;CACF,CAAC;AACF,MAAM,CAAC,MAAM,KAAK,GAAY,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;AACvE,MAAM,CAAC,MAAM,IAAI,GAAY;IAC3B,MAAM;IACN;QACE,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC;QAC3B,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC;KAC5B;CACF,CAAC","sourcesContent":["/**\n * The glyphs of the elements' visual language (docs/design-principles.md: that table is the only\n * list, one meaning per glyph). Lucide icons (https://lucide.dev, ISC licence), copied from\n * lucide-static 0.460.0 (`funnel` from 0.500.0) as element/attribute pairs on a 24×24 grid,\n * drawn with `icon()` (./svg.ts) as DOM nodes: no asset files, nothing parsed from markup.\n * One export per icon, so a bundle carries only the icons its element draws.\n */\nimport type { IconDef } from \"./svg.ts\";\n\n// what a state does\nexport const logIn: IconDef = [\n \"log-in\",\n [\n [\"path\", { d: \"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4\" }],\n [\"polyline\", { points: \"10 17 15 12 10 7\" }],\n [\"line\", { x1: \"15\", x2: \"3\", y1: \"12\", y2: \"12\" }],\n ],\n];\nexport const logOut: IconDef = [\n \"log-out\",\n [\n [\"path\", { d: \"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\" }],\n [\"polyline\", { points: \"16 17 21 12 16 7\" }],\n [\"line\", { x1: \"21\", x2: \"9\", y1: \"12\", y2: \"12\" }],\n ],\n];\nexport const send: IconDef = [\n \"send\",\n [\n [\n \"path\",\n {\n d: \"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\",\n },\n ],\n [\"path\", { d: \"m21.854 2.147-10.94 10.939\" }],\n ],\n];\nexport const logs: IconDef = [\n \"logs\",\n [\n [\"path\", { d: \"M13 12h8\" }],\n [\"path\", { d: \"M13 18h8\" }],\n [\"path\", { d: \"M13 6h8\" }],\n [\"path\", { d: \"M3 12h1\" }],\n [\"path\", { d: \"M3 18h1\" }],\n [\"path\", { d: \"M3 6h1\" }],\n [\"path\", { d: \"M8 12h1\" }],\n [\"path\", { d: \"M8 18h1\" }],\n [\"path\", { d: \"M8 6h1\" }],\n ],\n];\nexport const workflow: IconDef = [\n \"workflow\",\n [\n [\"rect\", { width: \"8\", height: \"8\", x: \"3\", y: \"3\", rx: \"2\" }],\n [\"path\", { d: \"M7 11v4a2 2 0 0 0 2 2h4\" }],\n [\"rect\", { width: \"8\", height: \"8\", x: \"13\", y: \"13\", rx: \"2\" }],\n ],\n];\n\n// transitions\nexport const diamond: IconDef = [\n \"diamond\",\n [\n [\n \"path\",\n {\n d: \"M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z\",\n },\n ],\n ],\n];\n\n// structure and navigation\nexport const layers: IconDef = [\n \"layers\",\n [\n [\"path\", { d: \"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z\" }],\n [\"path\", { d: \"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65\" }],\n [\"path\", { d: \"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65\" }],\n ],\n];\nexport const doorOpen: IconDef = [\n \"door-open\",\n [\n [\"path\", { d: \"M13 4h3a2 2 0 0 1 2 2v14\" }],\n [\"path\", { d: \"M2 20h3\" }],\n [\"path\", { d: \"M13 20h9\" }],\n [\"path\", { d: \"M10 12v.01\" }],\n [\"path\", { d: \"M13 4.562v16.157a1 1 0 0 1-1.242.97L5 20V5.562a2 2 0 0 1 1.515-1.94l4-1A2 2 0 0 1 13 4.561Z\" }],\n ],\n];\nexport const cornerDownRight: IconDef = [\n \"corner-down-right\",\n [\n [\"polyline\", { points: \"15 10 20 15 15 20\" }],\n [\"path\", { d: \"M4 4v7a4 4 0 0 0 4 4h12\" }],\n ],\n];\nexport const chevronDown: IconDef = [\"chevron-down\", [[\"path\", { d: \"m6 9 6 6 6-6\" }]]];\nexport const chevronRight: IconDef = [\"chevron-right\", [[\"path\", { d: \"m9 18 6-6-6-6\" }]]];\nexport const circleHelp: IconDef = [\n \"circle-help\",\n [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\" }],\n [\"path\", { d: \"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\" }],\n [\"path\", { d: \"M12 17h.01\" }],\n ],\n];\n\n// view controls\nexport const list: IconDef = [\n \"list\",\n [\n [\"path\", { d: \"M3 12h.01\" }],\n [\"path\", { d: \"M3 18h.01\" }],\n [\"path\", { d: \"M3 6h.01\" }],\n [\"path\", { d: \"M8 12h13\" }],\n [\"path\", { d: \"M8 18h13\" }],\n [\"path\", { d: \"M8 6h13\" }],\n ],\n];\nexport const network: IconDef = [\n \"network\",\n [\n [\"rect\", { x: \"16\", y: \"16\", width: \"6\", height: \"6\", rx: \"1\" }],\n [\"rect\", { x: \"2\", y: \"16\", width: \"6\", height: \"6\", rx: \"1\" }],\n [\"rect\", { x: \"9\", y: \"2\", width: \"6\", height: \"6\", rx: \"1\" }],\n [\"path\", { d: \"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3\" }],\n [\"path\", { d: \"M12 12V8\" }],\n ],\n];\nexport const funnel: IconDef = [\n \"funnel\",\n [\n [\n \"path\",\n {\n d: \"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z\",\n },\n ],\n ],\n];\nexport const locate: IconDef = [\n \"locate\",\n [\n [\"line\", { x1: \"2\", x2: \"5\", y1: \"12\", y2: \"12\" }],\n [\"line\", { x1: \"19\", x2: \"22\", y1: \"12\", y2: \"12\" }],\n [\"line\", { x1: \"12\", x2: \"12\", y1: \"2\", y2: \"5\" }],\n [\"line\", { x1: \"12\", x2: \"12\", y1: \"19\", y2: \"22\" }],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"7\" }],\n ],\n];\nexport const locateFixed: IconDef = [\n \"locate-fixed\",\n [\n [\"line\", { x1: \"2\", x2: \"5\", y1: \"12\", y2: \"12\" }],\n [\"line\", { x1: \"19\", x2: \"22\", y1: \"12\", y2: \"12\" }],\n [\"line\", { x1: \"12\", x2: \"12\", y1: \"2\", y2: \"5\" }],\n [\"line\", { x1: \"12\", x2: \"12\", y1: \"19\", y2: \"22\" }],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"7\" }],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\" }],\n ],\n];\nexport const play: IconDef = [\"play\", [[\"polygon\", { points: \"6 3 20 12 6 21 6 3\" }]]];\nexport const pause: IconDef = [\n \"pause\",\n [\n [\"rect\", { x: \"14\", y: \"4\", width: \"4\", height: \"16\", rx: \"1\" }],\n [\"rect\", { x: \"6\", y: \"4\", width: \"4\", height: \"16\", rx: \"1\" }],\n ],\n];\nexport const stepForward: IconDef = [\n \"step-forward\",\n [\n [\"line\", { x1: \"6\", x2: \"6\", y1: \"4\", y2: \"20\" }],\n [\"polygon\", { points: \"10,4 20,12 10,20\" }],\n ],\n];\nexport const scan: IconDef = [\n \"scan\",\n [\n [\"path\", { d: \"M3 7V5a2 2 0 0 1 2-2h2\" }],\n [\"path\", { d: \"M17 3h2a2 2 0 0 1 2 2v2\" }],\n [\"path\", { d: \"M21 17v2a2 2 0 0 1-2 2h-2\" }],\n [\"path\", { d: \"M7 21H5a2 2 0 0 1-2-2v-2\" }],\n ],\n];\nexport const minus: IconDef = [\"minus\", [[\"path\", { d: \"M5 12h14\" }]]];\nexport const plus: IconDef = [\n \"plus\",\n [\n [\"path\", { d: \"M5 12h14\" }],\n [\"path\", { d: \"M12 5v14\" }],\n ],\n];\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The elements' notation (docs/design-principles.md: notation over narration). Builders for the
|
|
3
|
+
* things both elements show again and again, as DOM nodes with their text names kept for
|
|
4
|
+
* tooltips and screen readers:
|
|
5
|
+
*
|
|
6
|
+
* eventName(descriptor) an event's name as written: the namespace quieter (cut from the left
|
|
7
|
+
* when there's no room), the last part in full; its kind (completion,
|
|
8
|
+
* error, wildcard) a class that colours it and the chip around it
|
|
9
|
+
* glyph(name, label) one glyph of the table, with its name
|
|
10
|
+
* actionGlyphs(state) what a state does on entry / exit and what it invokes, as glyphs
|
|
11
|
+
*/
|
|
12
|
+
import type { StateNode } from "../model.js";
|
|
13
|
+
import { type IconDef } from "./svg.js";
|
|
14
|
+
/** One glyph, 14px, named: `label` is its tooltip and (unless `decorative`) its accessible name. */
|
|
15
|
+
export declare function glyph(def: IconDef, label: string, decorative?: boolean): HTMLElement;
|
|
16
|
+
/** What kind of event a name is: a completion, an error, a wildcard, or an ordinary event. */
|
|
17
|
+
export type EventKind = "done" | "error" | "wildcard" | "event";
|
|
18
|
+
/**
|
|
19
|
+
* The kind of an event name: `done.state.*`, `done.invoke.*` and any name whose last part is
|
|
20
|
+
* `done` are completions; `error`, `error.*` and any name whose last part is `error` are errors;
|
|
21
|
+
* a name with `*` is a wildcard (a descriptor that matches many events).
|
|
22
|
+
*/
|
|
23
|
+
export declare function eventKind(descriptor: string): EventKind;
|
|
24
|
+
/**
|
|
25
|
+
* An event's name, exactly as written, in the system's monospace: the namespace quieter, the last
|
|
26
|
+
* part at full strength. When there isn't room the namespace is cut from the left
|
|
27
|
+
* (`…Failed.done`), never the last part. Its kind is a class (`kind-done`, `kind-error`,
|
|
28
|
+
* `kind-wildcard`) that colours it, and that a chip around it takes too (see `EVENT_CHIP`): no
|
|
29
|
+
* glyph ever replaces a part of the name.
|
|
30
|
+
*/
|
|
31
|
+
export declare function eventName(descriptor: string): HTMLElement;
|
|
32
|
+
/** Words for what a state does (translations pass their own). */
|
|
33
|
+
export interface ActionWords {
|
|
34
|
+
/** Before the entry actions in the accessible name. English: "on entry". */
|
|
35
|
+
onEntry: string;
|
|
36
|
+
/** Before the exit actions. English: "on exit". */
|
|
37
|
+
onExit: string;
|
|
38
|
+
/** Before the invokes. English: "invokes". */
|
|
39
|
+
invokes: string;
|
|
40
|
+
/** A glyph's name: sends an event or message. */
|
|
41
|
+
sends: string;
|
|
42
|
+
/** A glyph's name: logs. */
|
|
43
|
+
logs: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* What a state does, as glyphs: `log-in` then the kinds of its entry actions (send, log), `log-out`
|
|
47
|
+
* then its exit actions', `workflow` (with a count above one) for its invokes. One accessible
|
|
48
|
+
* name for the lot, from `describe` (one phrase per action); the same text, a line each, is
|
|
49
|
+
* the tooltip. `undefined` when the state does nothing.
|
|
50
|
+
*/
|
|
51
|
+
export declare function actionGlyphs(s: StateNode, words: ActionWords, describe: (action: Element) => string): HTMLElement | undefined;
|
|
52
|
+
/** Styles for the notation: the same in both elements' sheets. */
|
|
53
|
+
export declare const NOTATION_CSS = "\n.glyph { display: inline-grid; place-items: center; flex: none; vertical-align: -2px; }\n.glyph .icon { display: block; }\n/* an event's name: the system's monospace, as written; the namespace quieter, cut from the left */\n.ev-name { display: inline-flex; align-items: baseline; min-width: 0; max-width: 100%; font-family: var(--x-mono); white-space: nowrap; }\n.ev-name .ns { flex: 0 1 auto; min-width: 1.5em; overflow: hidden; text-overflow: ellipsis; direction: rtl; color: var(--x-fg2); }\n.ev-name .ns > span { direction: ltr; unicode-bidi: embed; }\n.ev-name .leaf { flex: none; }\n/* its kind, as the state colours: plain text takes the colour; a chip takes the tinted pill */\n.ev-name.kind-done, .ev-name.kind-done .ns { color: var(--x-done); }\n.ev-name.kind-error, .ev-name.kind-error .ns { color: var(--x-err); }\n.ev-name.kind-wildcard .leaf { color: var(--x-fg2); }\n.ev-chip:has(> .ev-name.kind-done), .ev-chip:has(> * > .ev-name.kind-done) { background: var(--x-done-bg); border-color: color-mix(in srgb, var(--x-done) 35%, var(--x-b2)); }\n.ev-chip:has(> .ev-name.kind-error), .ev-chip:has(> * > .ev-name.kind-error) { background: var(--x-err-bg); border-color: color-mix(in srgb, var(--x-err) 35%, var(--x-b2)); }\n.does-glyphs { display: inline-flex; align-items: center; gap: 10px; color: var(--x-fg3); }\n.does-group { display: inline-flex; align-items: center; gap: 3px; }\n.does-glyphs .n { font: 11px var(--x-sans); }\n";
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import * as icons from "./icons.js";
|
|
2
|
+
import { icon } from "./svg.js";
|
|
3
|
+
const h = (tag, attrs = {}, ...children) => {
|
|
4
|
+
const el = document.createElement(tag);
|
|
5
|
+
for (const [k, v] of Object.entries(attrs))
|
|
6
|
+
el.setAttribute(k, v);
|
|
7
|
+
el.append(...children);
|
|
8
|
+
return el;
|
|
9
|
+
};
|
|
10
|
+
/** One glyph, 14px, named: `label` is its tooltip and (unless `decorative`) its accessible name. */
|
|
11
|
+
export function glyph(def, label, decorative = false) {
|
|
12
|
+
const g = h("span", { class: `glyph glyph-${def[0]}`, title: label }, icon(def, 14));
|
|
13
|
+
if (decorative)
|
|
14
|
+
g.setAttribute("aria-hidden", "true");
|
|
15
|
+
else {
|
|
16
|
+
g.setAttribute("role", "img");
|
|
17
|
+
g.setAttribute("aria-label", label);
|
|
18
|
+
}
|
|
19
|
+
return g;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The kind of an event name: `done.state.*`, `done.invoke.*` and any name whose last part is
|
|
23
|
+
* `done` are completions; `error`, `error.*` and any name whose last part is `error` are errors;
|
|
24
|
+
* a name with `*` is a wildcard (a descriptor that matches many events).
|
|
25
|
+
*/
|
|
26
|
+
export function eventKind(descriptor) {
|
|
27
|
+
const parts = descriptor.split(".");
|
|
28
|
+
if (descriptor.includes("*"))
|
|
29
|
+
return "wildcard";
|
|
30
|
+
if (parts[0] === "done" || parts.at(-1) === "done")
|
|
31
|
+
return "done";
|
|
32
|
+
if (parts[0] === "error" || parts.at(-1) === "error")
|
|
33
|
+
return "error";
|
|
34
|
+
return "event";
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* An event's name, exactly as written, in the system's monospace: the namespace quieter, the last
|
|
38
|
+
* part at full strength. When there isn't room the namespace is cut from the left
|
|
39
|
+
* (`…Failed.done`), never the last part. Its kind is a class (`kind-done`, `kind-error`,
|
|
40
|
+
* `kind-wildcard`) that colours it, and that a chip around it takes too (see `EVENT_CHIP`): no
|
|
41
|
+
* glyph ever replaces a part of the name.
|
|
42
|
+
*/
|
|
43
|
+
export function eventName(descriptor) {
|
|
44
|
+
const kind = eventKind(descriptor);
|
|
45
|
+
const el = h("span", { class: `ev-name kind-${kind}`, title: descriptor });
|
|
46
|
+
const at = descriptor.lastIndexOf(".");
|
|
47
|
+
// a trailing ".*" belongs with what it matches: carrier.* reads "carrier." + "*"
|
|
48
|
+
if (at > 0)
|
|
49
|
+
el.append(h("span", { class: "ns" }, h("span", {}, descriptor.slice(0, at + 1))));
|
|
50
|
+
el.append(h("span", { class: "leaf" }, at > 0 ? descriptor.slice(at + 1) : descriptor));
|
|
51
|
+
return el;
|
|
52
|
+
}
|
|
53
|
+
/** The glyph of an executable content element, when it has one (send / raise: sends; log: logs). */
|
|
54
|
+
const ACTION_GLYPH = {
|
|
55
|
+
send: [icons.send, "sends"],
|
|
56
|
+
raise: [icons.send, "sends"],
|
|
57
|
+
log: [icons.logs, "logs"],
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* What a state does, as glyphs: `log-in` then the kinds of its entry actions (send, log), `log-out`
|
|
61
|
+
* then its exit actions', `workflow` (with a count above one) for its invokes. One accessible
|
|
62
|
+
* name for the lot, from `describe` (one phrase per action); the same text, a line each, is
|
|
63
|
+
* the tooltip. `undefined` when the state does nothing.
|
|
64
|
+
*/
|
|
65
|
+
export function actionGlyphs(s, words, describe) {
|
|
66
|
+
const entry = s.onentry.flatMap((b) => Array.from(b.children));
|
|
67
|
+
const exit = s.onexit.flatMap((b) => Array.from(b.children));
|
|
68
|
+
if (!entry.length && !exit.length && !s.invokes.length)
|
|
69
|
+
return undefined;
|
|
70
|
+
const el = h("span", { class: "does-glyphs", role: "img" });
|
|
71
|
+
const lines = [];
|
|
72
|
+
const group = (lead, word, actions) => {
|
|
73
|
+
if (!actions.length)
|
|
74
|
+
return;
|
|
75
|
+
const g = h("span", { class: "does-group" }, glyph(lead, word, true));
|
|
76
|
+
const seen = new Set();
|
|
77
|
+
for (const a of actions) {
|
|
78
|
+
const kind = ACTION_GLYPH[a.localName];
|
|
79
|
+
if (!kind || seen.has(kind[0]))
|
|
80
|
+
continue;
|
|
81
|
+
seen.add(kind[0]);
|
|
82
|
+
g.append(glyph(kind[0], words[kind[1]], true));
|
|
83
|
+
}
|
|
84
|
+
el.append(g);
|
|
85
|
+
lines.push(`${word}: ${actions.map(describe).join(", ")}`);
|
|
86
|
+
};
|
|
87
|
+
group(icons.logIn, words.onEntry, entry);
|
|
88
|
+
group(icons.logOut, words.onExit, exit);
|
|
89
|
+
if (s.invokes.length) {
|
|
90
|
+
el.append(h("span", { class: "does-group" }, glyph(icons.workflow, words.invokes, true), s.invokes.length > 1 ? h("span", { class: "n" }, String(s.invokes.length)) : ""));
|
|
91
|
+
const ids = s.invokes.map((i) => i.element.getAttribute("id") ?? i.element.getAttribute("src") ?? i.element.getAttribute("type") ?? "");
|
|
92
|
+
lines.push(`${words.invokes}: ${ids.filter(Boolean).join(", ") || s.invokes.length}`);
|
|
93
|
+
}
|
|
94
|
+
el.setAttribute("aria-label", lines.join("; "));
|
|
95
|
+
el.title = lines.join("\n");
|
|
96
|
+
return el;
|
|
97
|
+
}
|
|
98
|
+
/** Styles for the notation: the same in both elements' sheets. */
|
|
99
|
+
export const NOTATION_CSS = /* css */ `
|
|
100
|
+
.glyph { display: inline-grid; place-items: center; flex: none; vertical-align: -2px; }
|
|
101
|
+
.glyph .icon { display: block; }
|
|
102
|
+
/* an event's name: the system's monospace, as written; the namespace quieter, cut from the left */
|
|
103
|
+
.ev-name { display: inline-flex; align-items: baseline; min-width: 0; max-width: 100%; font-family: var(--x-mono); white-space: nowrap; }
|
|
104
|
+
.ev-name .ns { flex: 0 1 auto; min-width: 1.5em; overflow: hidden; text-overflow: ellipsis; direction: rtl; color: var(--x-fg2); }
|
|
105
|
+
.ev-name .ns > span { direction: ltr; unicode-bidi: embed; }
|
|
106
|
+
.ev-name .leaf { flex: none; }
|
|
107
|
+
/* its kind, as the state colours: plain text takes the colour; a chip takes the tinted pill */
|
|
108
|
+
.ev-name.kind-done, .ev-name.kind-done .ns { color: var(--x-done); }
|
|
109
|
+
.ev-name.kind-error, .ev-name.kind-error .ns { color: var(--x-err); }
|
|
110
|
+
.ev-name.kind-wildcard .leaf { color: var(--x-fg2); }
|
|
111
|
+
.ev-chip:has(> .ev-name.kind-done), .ev-chip:has(> * > .ev-name.kind-done) { background: var(--x-done-bg); border-color: color-mix(in srgb, var(--x-done) 35%, var(--x-b2)); }
|
|
112
|
+
.ev-chip:has(> .ev-name.kind-error), .ev-chip:has(> * > .ev-name.kind-error) { background: var(--x-err-bg); border-color: color-mix(in srgb, var(--x-err) 35%, var(--x-b2)); }
|
|
113
|
+
.does-glyphs { display: inline-flex; align-items: center; gap: 10px; color: var(--x-fg3); }
|
|
114
|
+
.does-group { display: inline-flex; align-items: center; gap: 3px; }
|
|
115
|
+
.does-glyphs .n { font: 11px var(--x-sans); }
|
|
116
|
+
`;
|
|
117
|
+
//# sourceMappingURL=notation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notation.js","sourceRoot":"","sources":["../../src/ui/notation.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,EAAgB,IAAI,EAAE,MAAM,UAAU,CAAC;AAE9C,MAAM,CAAC,GAAG,CAAC,GAAW,EAAE,KAAK,GAA2B,EAAE,EAAE,GAAG,QAA2B,EAAE,EAAE;IAC5F,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IACvC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,EAAE,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAClE,EAAE,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC;IACvB,OAAO,EAAE,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I,CAAC,CAAC;IAC5B,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,kEAAkE;AAClE,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC;;;;;;;;;;;;;;;;;CAiBrC,CAAC","sourcesContent":["/**\n * The elements' notation (docs/design-principles.md: notation over narration). Builders for the\n * things both elements show again and again, as DOM nodes with their text names kept for\n * tooltips and screen readers:\n *\n * eventName(descriptor) an event's name as written: the namespace quieter (cut from the left\n * when there's no room), the last part in full; its kind (completion,\n * error, wildcard) a class that colours it and the chip around it\n * glyph(name, label) one glyph of the table, with its name\n * actionGlyphs(state) what a state does on entry / exit and what it invokes, as glyphs\n */\nimport type { StateNode } from \"../model.ts\";\nimport * as icons from \"./icons.ts\";\nimport { type IconDef, icon } from \"./svg.ts\";\n\nconst h = (tag: string, attrs: Record<string, string> = {}, ...children: (Node | string)[]) => {\n const el = document.createElement(tag);\n for (const [k, v] of Object.entries(attrs)) el.setAttribute(k, v);\n el.append(...children);\n return el;\n};\n\n/** One glyph, 14px, named: `label` is its tooltip and (unless `decorative`) its accessible name. */\nexport function glyph(def: IconDef, label: string, decorative = false): HTMLElement {\n const g = h(\"span\", { class: `glyph glyph-${def[0]}`, title: label }, icon(def, 14));\n if (decorative) g.setAttribute(\"aria-hidden\", \"true\");\n else {\n g.setAttribute(\"role\", \"img\");\n g.setAttribute(\"aria-label\", label);\n }\n return g;\n}\n\n/** What kind of event a name is: a completion, an error, a wildcard, or an ordinary event. */\nexport type EventKind = \"done\" | \"error\" | \"wildcard\" | \"event\";\n\n/**\n * The kind of an event name: `done.state.*`, `done.invoke.*` and any name whose last part is\n * `done` are completions; `error`, `error.*` and any name whose last part is `error` are errors;\n * a name with `*` is a wildcard (a descriptor that matches many events).\n */\nexport function eventKind(descriptor: string): EventKind {\n const parts = descriptor.split(\".\");\n if (descriptor.includes(\"*\")) return \"wildcard\";\n if (parts[0] === \"done\" || parts.at(-1) === \"done\") return \"done\";\n if (parts[0] === \"error\" || parts.at(-1) === \"error\") return \"error\";\n return \"event\";\n}\n\n/**\n * An event's name, exactly as written, in the system's monospace: the namespace quieter, the last\n * part at full strength. When there isn't room the namespace is cut from the left\n * (`…Failed.done`), never the last part. Its kind is a class (`kind-done`, `kind-error`,\n * `kind-wildcard`) that colours it, and that a chip around it takes too (see `EVENT_CHIP`): no\n * glyph ever replaces a part of the name.\n */\nexport function eventName(descriptor: string): HTMLElement {\n const kind = eventKind(descriptor);\n const el = h(\"span\", { class: `ev-name kind-${kind}`, title: descriptor });\n const at = descriptor.lastIndexOf(\".\");\n // a trailing \".*\" belongs with what it matches: carrier.* reads \"carrier.\" + \"*\"\n if (at > 0) el.append(h(\"span\", { class: \"ns\" }, h(\"span\", {}, descriptor.slice(0, at + 1))));\n el.append(h(\"span\", { class: \"leaf\" }, at > 0 ? descriptor.slice(at + 1) : descriptor));\n return el;\n}\n\n/** Words for what a state does (translations pass their own). */\nexport interface ActionWords {\n /** Before the entry actions in the accessible name. English: \"on entry\". */\n onEntry: string;\n /** Before the exit actions. English: \"on exit\". */\n onExit: string;\n /** Before the invokes. English: \"invokes\". */\n invokes: string;\n /** A glyph's name: sends an event or message. */\n sends: string;\n /** A glyph's name: logs. */\n logs: string;\n}\n\n/** The glyph of an executable content element, when it has one (send / raise: sends; log: logs). */\nconst ACTION_GLYPH: Record<string, [IconDef, keyof ActionWords]> = {\n send: [icons.send, \"sends\"],\n raise: [icons.send, \"sends\"],\n log: [icons.logs, \"logs\"],\n};\n\n/**\n * What a state does, as glyphs: `log-in` then the kinds of its entry actions (send, log), `log-out`\n * then its exit actions', `workflow` (with a count above one) for its invokes. One accessible\n * name for the lot, from `describe` (one phrase per action); the same text, a line each, is\n * the tooltip. `undefined` when the state does nothing.\n */\nexport function actionGlyphs(s: StateNode, words: ActionWords, describe: (action: Element) => string): HTMLElement | undefined {\n const entry = s.onentry.flatMap((b) => Array.from(b.children));\n const exit = s.onexit.flatMap((b) => Array.from(b.children));\n if (!entry.length && !exit.length && !s.invokes.length) return undefined;\n const el = h(\"span\", { class: \"does-glyphs\", role: \"img\" });\n const lines: string[] = [];\n const group = (lead: IconDef, word: string, actions: Element[]) => {\n if (!actions.length) return;\n const g = h(\"span\", { class: \"does-group\" }, glyph(lead, word, true));\n const seen = new Set<IconDef>();\n for (const a of actions) {\n const kind = ACTION_GLYPH[a.localName];\n if (!kind || seen.has(kind[0])) continue;\n seen.add(kind[0]);\n g.append(glyph(kind[0], words[kind[1]], true));\n }\n el.append(g);\n lines.push(`${word}: ${actions.map(describe).join(\", \")}`);\n };\n group(icons.logIn, words.onEntry, entry);\n group(icons.logOut, words.onExit, exit);\n if (s.invokes.length) {\n el.append(\n h(\n \"span\",\n { class: \"does-group\" },\n glyph(icons.workflow, words.invokes, true),\n s.invokes.length > 1 ? h(\"span\", { class: \"n\" }, String(s.invokes.length)) : \"\",\n ),\n );\n const ids = s.invokes.map((i) => i.element.getAttribute(\"id\") ?? i.element.getAttribute(\"src\") ?? i.element.getAttribute(\"type\") ?? \"\");\n lines.push(`${words.invokes}: ${ids.filter(Boolean).join(\", \") || s.invokes.length}`);\n }\n el.setAttribute(\"aria-label\", lines.join(\"; \"));\n el.title = lines.join(\"\\n\");\n return el;\n}\n\n/** Styles for the notation: the same in both elements' sheets. */\nexport const NOTATION_CSS = /* css */ `\n.glyph { display: inline-grid; place-items: center; flex: none; vertical-align: -2px; }\n.glyph .icon { display: block; }\n/* an event's name: the system's monospace, as written; the namespace quieter, cut from the left */\n.ev-name { display: inline-flex; align-items: baseline; min-width: 0; max-width: 100%; font-family: var(--x-mono); white-space: nowrap; }\n.ev-name .ns { flex: 0 1 auto; min-width: 1.5em; overflow: hidden; text-overflow: ellipsis; direction: rtl; color: var(--x-fg2); }\n.ev-name .ns > span { direction: ltr; unicode-bidi: embed; }\n.ev-name .leaf { flex: none; }\n/* its kind, as the state colours: plain text takes the colour; a chip takes the tinted pill */\n.ev-name.kind-done, .ev-name.kind-done .ns { color: var(--x-done); }\n.ev-name.kind-error, .ev-name.kind-error .ns { color: var(--x-err); }\n.ev-name.kind-wildcard .leaf { color: var(--x-fg2); }\n.ev-chip:has(> .ev-name.kind-done), .ev-chip:has(> * > .ev-name.kind-done) { background: var(--x-done-bg); border-color: color-mix(in srgb, var(--x-done) 35%, var(--x-b2)); }\n.ev-chip:has(> .ev-name.kind-error), .ev-chip:has(> * > .ev-name.kind-error) { background: var(--x-err-bg); border-color: color-mix(in srgb, var(--x-err) 35%, var(--x-b2)); }\n.does-glyphs { display: inline-flex; align-items: center; gap: 10px; color: var(--x-fg3); }\n.does-group { display: inline-flex; align-items: center; gap: 3px; }\n.does-glyphs .n { font: 11px var(--x-sans); }\n`;\n"]}
|
package/dist/ui/svg.d.ts
CHANGED
|
@@ -6,3 +6,7 @@
|
|
|
6
6
|
export declare const SVG_NS = "http://www.w3.org/2000/svg";
|
|
7
7
|
/** `<defs><marker id>` holding a triangular arrowhead `w` wide and `h` high, its tip at `refX`. */
|
|
8
8
|
export declare function arrowMarker(id: string, w: number, h: number, refX: number): SVGDefsElement;
|
|
9
|
+
/** An icon: its name (the `icon-<name>` class) and its elements, Lucide-style on a 24×24 grid (see ./icons.ts). */
|
|
10
|
+
export type IconDef = readonly [name: string, nodes: readonly (readonly [tag: string, attrs: Readonly<Record<string, string>>])[]];
|
|
11
|
+
/** A Lucide-style stroke icon (`currentColor`, decorative: `aria-hidden`), `size` px square. */
|
|
12
|
+
export declare function icon([name, nodes]: IconDef, size?: number): SVGSVGElement;
|
package/dist/ui/svg.js
CHANGED
|
@@ -26,4 +26,30 @@ export function arrowMarker(id, w, h, refX) {
|
|
|
26
26
|
defs.append(marker);
|
|
27
27
|
return defs;
|
|
28
28
|
}
|
|
29
|
+
/** A Lucide-style stroke icon (`currentColor`, decorative: `aria-hidden`), `size` px square. */
|
|
30
|
+
export function icon([name, nodes], size = 14) {
|
|
31
|
+
const svg = document.createElementNS(SVG_NS, "svg");
|
|
32
|
+
const attrs = {
|
|
33
|
+
class: `icon icon-${name}`,
|
|
34
|
+
width: String(size),
|
|
35
|
+
height: String(size),
|
|
36
|
+
viewBox: "0 0 24 24",
|
|
37
|
+
fill: "none",
|
|
38
|
+
stroke: "currentColor",
|
|
39
|
+
"stroke-width": "2",
|
|
40
|
+
"stroke-linecap": "round",
|
|
41
|
+
"stroke-linejoin": "round",
|
|
42
|
+
"aria-hidden": "true",
|
|
43
|
+
focusable: "false",
|
|
44
|
+
};
|
|
45
|
+
for (const [k, v] of Object.entries(attrs))
|
|
46
|
+
svg.setAttribute(k, v);
|
|
47
|
+
for (const [tag, a] of nodes) {
|
|
48
|
+
const child = document.createElementNS(SVG_NS, tag);
|
|
49
|
+
for (const [k, v] of Object.entries(a))
|
|
50
|
+
child.setAttribute(k, v);
|
|
51
|
+
svg.append(child);
|
|
52
|
+
}
|
|
53
|
+
return svg;
|
|
54
|
+
}
|
|
29
55
|
//# sourceMappingURL=svg.js.map
|
package/dist/ui/svg.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svg.js","sourceRoot":"","sources":["../../src/ui/svg.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,4BAA4B,CAAC;AAEnD,mGAAmG;AACnG,MAAM,UAAU,WAAW,CAAC,EAAU,EAAE,CAAS,EAAE,CAAS,EAAE,IAAY;IACxE,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,QAAQ,CAAC,eAAe,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC1D,MAAM,KAAK,GAA2B;QACpC,EAAE;QACF,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE;QACxB,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;QACnB,WAAW,EAAE,gBAAgB;QAC7B,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;QACtB,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC;QACvB,MAAM,EAAE,MAAM;KACf,CAAC;IACF,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACtE,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtD,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACpB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACpB,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/**\n * SVG helpers shared by the elements. Everything is built with\n * `createElementNS`, never parsed from markup, so the elements work on pages\n * that enforce Trusted Types (`require-trusted-types-for 'script'`).\n */\nexport const SVG_NS = \"http://www.w3.org/2000/svg\";\n\n/** `<defs><marker id>` holding a triangular arrowhead `w` wide and `h` high, its tip at `refX`. */\nexport function arrowMarker(id: string, w: number, h: number, refX: number): SVGDefsElement {\n const defs = document.createElementNS(SVG_NS, \"defs\");\n const marker = document.createElementNS(SVG_NS, \"marker\");\n const attrs: Record<string, string> = {\n id,\n viewBox: `0 0 ${w} ${h}`,\n refX: String(refX),\n refY: String(h / 2),\n markerUnits: \"userSpaceOnUse\",\n markerWidth: String(w),\n markerHeight: String(h),\n orient: \"auto\",\n };\n for (const [k, v] of Object.entries(attrs)) marker.setAttribute(k, v);\n const path = document.createElementNS(SVG_NS, \"path\");\n path.setAttribute(\"d\", `M0 0 L${w} ${h / 2} L0 ${h} z`);\n marker.append(path);\n defs.append(marker);\n return defs;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"svg.js","sourceRoot":"","sources":["../../src/ui/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pD,MAAM,GAAG,GAAG,QAAQ,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACpD,MAAM,KAAK,GAA2B;QACpC,KAAK,EAAE,aAAa,IAAI,EAAE;QAC1B,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC;QACpB,OAAO,EAAE,WAAW;QACpB,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,cAAc;QACtB,cAAc,EAAE,GAAG;QACnB,gBAAgB,EAAE,OAAO;QACzB,iBAAiB,EAAE,OAAO;QAC1B,aAAa,EAAE,MAAM;QACrB,SAAS,EAAE,OAAO;KACnB,CAAC;IACF,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,GAAG,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACnE,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC;QAC7B,MAAM,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACpD,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;YAAE,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACjE,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["/**\n * SVG helpers shared by the elements. Everything is built with\n * `createElementNS`, never parsed from markup, so the elements work on pages\n * that enforce Trusted Types (`require-trusted-types-for 'script'`).\n */\nexport const SVG_NS = \"http://www.w3.org/2000/svg\";\n\n/** `<defs><marker id>` holding a triangular arrowhead `w` wide and `h` high, its tip at `refX`. */\nexport function arrowMarker(id: string, w: number, h: number, refX: number): SVGDefsElement {\n const defs = document.createElementNS(SVG_NS, \"defs\");\n const marker = document.createElementNS(SVG_NS, \"marker\");\n const attrs: Record<string, string> = {\n id,\n viewBox: `0 0 ${w} ${h}`,\n refX: String(refX),\n refY: String(h / 2),\n markerUnits: \"userSpaceOnUse\",\n markerWidth: String(w),\n markerHeight: String(h),\n orient: \"auto\",\n };\n for (const [k, v] of Object.entries(attrs)) marker.setAttribute(k, v);\n const path = document.createElementNS(SVG_NS, \"path\");\n path.setAttribute(\"d\", `M0 0 L${w} ${h / 2} L0 ${h} z`);\n marker.append(path);\n defs.append(marker);\n return defs;\n}\n\n/** An icon: its name (the `icon-<name>` class) and its elements, Lucide-style on a 24×24 grid (see ./icons.ts). */\nexport type IconDef = readonly [name: string, nodes: readonly (readonly [tag: string, attrs: Readonly<Record<string, string>>])[]];\n\n/** A Lucide-style stroke icon (`currentColor`, decorative: `aria-hidden`), `size` px square. */\nexport function icon([name, nodes]: IconDef, size = 14): SVGSVGElement {\n const svg = document.createElementNS(SVG_NS, \"svg\");\n const attrs: Record<string, string> = {\n class: `icon icon-${name}`,\n width: String(size),\n height: String(size),\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\",\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n };\n for (const [k, v] of Object.entries(attrs)) svg.setAttribute(k, v);\n for (const [tag, a] of nodes) {\n const child = document.createElementNS(SVG_NS, tag);\n for (const [k, v] of Object.entries(a)) child.setAttribute(k, v);\n svg.append(child);\n }\n return svg;\n}\n"]}
|
package/dist/ui/theme.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
/** One breakpoint for every element: at or below this width (px) the elements switch to their narrow layout. */
|
|
14
14
|
export declare const NARROW_WIDTH = 760;
|
|
15
|
-
export declare const THEME_CSS = "\n:host {\n /* follow the page: while --scxml-color-scheme is unset this is invalid, so color-scheme\n inherits and light-dark() below matches the page. Set it to \"light dark\" to follow the OS. */\n color-scheme: var(--scxml-color-scheme);\n /* text */\n --x-fg1: var(--scxml-fg, light-dark(#1c1c21, #ececf1));\n --x-fg2: var(--scxml-fg-muted, light-dark(#484852, #bcbcc6));\n --x-fg3: var(--scxml-fg-subtle, light-dark(#6a6a75, #90909b));\n --x-fg4: var(--scxml-fg-faint, light-dark(#85858f, #777781)); /* graphics only (\u22653:1), never text */\n /* surfaces */\n --x-bg: var(--scxml-bg, light-dark(#f6f6f8, #141417));\n --x-s1: var(--scxml-surface, light-dark(#ffffff, #1c1c20));\n --x-s2: var(--scxml-surface-2, light-dark(#f0f0f3, #242429));\n --x-s3: var(--scxml-surface-3, light-dark(#e5e5ea, #2e2e34));\n /* lines */\n --x-b1: var(--scxml-border, light-dark(#e6e6eb, #2a2a30));\n --x-b2: var(--scxml-border-2, light-dark(#d3d3da, #393940));\n --x-strong: var(--scxml-border-strong, light-dark(#8b8b96, #6c6c77));\n /* the one accent */\n --x-accent: var(--scxml-accent, light-dark(#3d5bd9, #8fa3ff));\n --x-accent-fg: var(--scxml-accent-text, light-dark(#2f49b8, #aebcff));\n --x-accent-subtle: var(--scxml-accent-subtle, light-dark(#e9edfc, #252c4c));\n --x-on-accent: var(--scxml-on-accent, light-dark(#ffffff, #10132b));\n /* lifecycle */\n --x-run: var(--scxml-running, light-dark(#26733a, #6fd48a));\n --x-run-bg: var(--scxml-running-bg, light-dark(#e5f3e9, #1a3123));\n --x-wait: var(--scxml-waiting, light-dark(#a8560a, #ffb46b));\n --x-wait-bg: var(--scxml-waiting-bg, light-dark(#fdf0e1, #382815));\n --x-done: var(--scxml-done, light-dark(#48566b, #a7b5c9));\n --x-done-bg: var(--scxml-done-bg, light-dark(#e9edf3, #242b35));\n --x-err: var(--scxml-error, light-dark(#c2332f, #ff8a84));\n /* type */\n --x-sans: var(--scxml-font-sans, system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif);\n --x-mono: var(--scxml-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);\n --x-serif: var(--scxml-font-display, var(--x-sans));\n --x-display-weight: var(--scxml-display-weight, 600);\n /* shape and motion */\n --x-r: var(--scxml-radius, 4px);\n --x-dur: var(--scxml-duration, 140ms);\n --x-row: var(--scxml-row-height, 30px);\n color: var(--x-fg1); font: 400 13px/1.4 var(--x-sans);\n}\n* { box-sizing: border-box; }\nbutton { font: inherit; color: inherit; }\n:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 1px; }\n\n/* \u2500\u2500 primitives shared by the elements \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.search { display: flex; gap: 6px; padding: 0 12px 8px; flex: none; }\n.search input[type=\"search\"] {\n flex: 1; min-width: 0; height: 28px; padding: 0 8px; font: 12px var(--x-mono); color: var(--x-fg1);\n background: var(--x-s1); border: 1px solid var(--x-b2); border-radius: var(--x-r);\n}\n.search input[type=\"search\"]:focus { border-color: var(--x-accent); }\n.toggle { display: inline-flex; align-items: center; gap: 4px; font: 11px var(--x-sans); color: var(--x-fg3); white-space: nowrap; cursor: pointer; }\n.badge { display: inline-block; font: 500 10px/1 var(--x-mono); letter-spacing: .06em; text-transform: uppercase; padding: 3px 5px; border-radius: var(--x-r); white-space: nowrap; }\n.badge.run { color: var(--x-run); background: var(--x-run-bg); }\n.badge.wait { color: var(--x-wait); background: var(--x-wait-bg); }\n.badge.done { color: var(--x-done); background: var(--x-done-bg); }\n.badge.muted { color: var(--x-fg3); background: var(--x-s2); }\n.count { font: 500 11px var(--x-mono); color: var(--x-fg3); font-variant-numeric: tabular-nums; }\n.chip {\n display: inline-flex; align-items: center; gap: 4px; max-width: 100%; border: 1px solid var(--x-b2); background: var(--x-s1);\n border-radius: 999px; padding: 2px 8px; font: 11.5px/1.4 var(--x-mono); color: var(--x-accent-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;\n}\n.chip:hover { border-color: var(--x-accent); background: var(--x-accent-subtle); }\n.chip.muted { color: var(--x-fg3); cursor: default; }\n.chip.muted:hover { border-color: var(--x-b2); background: var(--x-s1); }\n.more { border: 0; background: none; padding: 2px 4px; font: 500 11px var(--x-mono); color: var(--x-fg3); cursor: pointer; }\n.more:hover { color: var(--x-accent-fg); }\n.kind { display: inline-grid; place-items: center; width: 16px; height: 16px; flex: none; font: 11px/1 var(--x-mono); color: var(--x-fg3); }\n.empty { color: var(--x-fg3); padding: 16px 12px; font-style: italic; }\nh2.title { font: var(--x-display-weight) 24px/1.15 var(--x-serif); letter-spacing: -.01em; margin: 6px 0 2px; }\n.subtitle { color: var(--x-fg3); font: 12px var(--x-sans); margin: 0 0 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }\n.section-title { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font: 500 10.5px var(--x-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--x-fg3); }\n.section-title::after { content: \"\"; flex: 1; border-top: 1px solid var(--x-b1); }\n\n@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }\n";
|
|
15
|
+
export declare const THEME_CSS = "\n:host {\n /* follow the page: while --scxml-color-scheme is unset this is invalid, so color-scheme\n inherits and light-dark() below matches the page. Set it to \"light dark\" to follow the OS. */\n color-scheme: var(--scxml-color-scheme);\n /* text */\n --x-fg1: var(--scxml-fg, light-dark(#1c1c21, #ececf1));\n --x-fg2: var(--scxml-fg-muted, light-dark(#484852, #bcbcc6));\n --x-fg3: var(--scxml-fg-subtle, light-dark(#6a6a75, #90909b));\n --x-fg4: var(--scxml-fg-faint, light-dark(#85858f, #777781)); /* graphics only (\u22653:1), never text */\n /* surfaces */\n --x-bg: var(--scxml-bg, light-dark(#f6f6f8, #141417));\n --x-s1: var(--scxml-surface, light-dark(#ffffff, #1c1c20));\n --x-s2: var(--scxml-surface-2, light-dark(#f0f0f3, #242429));\n --x-s3: var(--scxml-surface-3, light-dark(#e5e5ea, #2e2e34));\n /* lines */\n --x-b1: var(--scxml-border, light-dark(#e6e6eb, #2a2a30));\n --x-b2: var(--scxml-border-2, light-dark(#d3d3da, #393940));\n --x-strong: var(--scxml-border-strong, light-dark(#8b8b96, #6c6c77));\n /* the one accent */\n --x-accent: var(--scxml-accent, light-dark(#3d5bd9, #8fa3ff));\n --x-accent-fg: var(--scxml-accent-text, light-dark(#2f49b8, #aebcff));\n --x-accent-subtle: var(--scxml-accent-subtle, light-dark(#e9edfc, #252c4c));\n --x-on-accent: var(--scxml-on-accent, light-dark(#ffffff, #10132b));\n /* lifecycle */\n --x-run: var(--scxml-running, light-dark(#26733a, #6fd48a));\n --x-run-bg: var(--scxml-running-bg, light-dark(#e5f3e9, #1a3123));\n --x-wait: var(--scxml-waiting, light-dark(#a8560a, #ffb46b));\n --x-wait-bg: var(--scxml-waiting-bg, light-dark(#fdf0e1, #382815));\n --x-done: var(--scxml-done, light-dark(#48566b, #a7b5c9));\n --x-done-bg: var(--scxml-done-bg, light-dark(#e9edf3, #242b35));\n --x-err: var(--scxml-error, light-dark(#c2332f, #ff8a84));\n --x-err-bg: var(--scxml-error-bg, light-dark(#fbeceb, #3a1c1b));\n /* type */\n --x-sans: var(--scxml-font-sans, system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif);\n --x-mono: var(--scxml-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);\n --x-serif: var(--scxml-font-display, var(--x-sans));\n --x-display-weight: var(--scxml-display-weight, 600);\n /* shape and motion */\n --x-r: var(--scxml-radius, 4px);\n --x-dur: var(--scxml-duration, 140ms);\n --x-row: var(--scxml-row-height, 30px);\n color: var(--x-fg1); font: 400 13px/1.4 var(--x-sans);\n}\n* { box-sizing: border-box; }\nbutton { font: inherit; color: inherit; }\n:focus-visible { outline: 2px solid var(--x-accent); outline-offset: 1px; }\n\n/* \u2500\u2500 primitives shared by the elements \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n.search { display: flex; gap: 6px; padding: 0 12px 8px; flex: none; }\n.search input[type=\"search\"] {\n flex: 1; min-width: 0; height: 28px; padding: 0 8px; font: 12px var(--x-mono); color: var(--x-fg1);\n background: var(--x-s1); border: 1px solid var(--x-b2); border-radius: var(--x-r);\n}\n.search input[type=\"search\"]:focus { border-color: var(--x-accent); }\n.toggle { display: inline-flex; align-items: center; gap: 4px; font: 11px var(--x-sans); color: var(--x-fg3); white-space: nowrap; cursor: pointer; }\n.badge { display: inline-block; font: 500 10px/1 var(--x-mono); letter-spacing: .06em; text-transform: uppercase; padding: 3px 5px; border-radius: var(--x-r); white-space: nowrap; }\n.badge.run { color: var(--x-run); background: var(--x-run-bg); }\n.badge.wait { color: var(--x-wait); background: var(--x-wait-bg); }\n.badge.done { color: var(--x-done); background: var(--x-done-bg); }\n.badge.muted { color: var(--x-fg3); background: var(--x-s2); }\n.count { font: 500 11px var(--x-mono); color: var(--x-fg3); font-variant-numeric: tabular-nums; }\n.chip {\n display: inline-flex; align-items: center; gap: 4px; max-width: 100%; border: 1px solid var(--x-b2); background: var(--x-s1);\n border-radius: 999px; padding: 2px 8px; font: 11.5px/1.4 var(--x-mono); color: var(--x-accent-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;\n}\n.chip:hover { border-color: var(--x-accent); background: var(--x-accent-subtle); }\n.chip.muted { color: var(--x-fg3); cursor: default; }\n.chip.muted:hover { border-color: var(--x-b2); background: var(--x-s1); }\n.more { border: 0; background: none; padding: 2px 4px; font: 500 11px var(--x-mono); color: var(--x-fg3); cursor: pointer; }\n.more:hover { color: var(--x-accent-fg); }\n.kind { display: inline-grid; place-items: center; width: 16px; height: 16px; flex: none; font: 11px/1 var(--x-mono); color: var(--x-fg3); }\n.empty { color: var(--x-fg3); padding: 16px 12px; font-style: italic; }\nh2.title { font: var(--x-display-weight) 24px/1.15 var(--x-serif); letter-spacing: -.01em; margin: 6px 0 2px; }\n.subtitle { color: var(--x-fg3); font: 12px var(--x-sans); margin: 0 0 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }\n.section-title { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font: 500 10.5px var(--x-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--x-fg3); }\n.section-title::after { content: \"\"; flex: 1; border-top: 1px solid var(--x-b1); }\n\n@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }\n";
|
|
16
16
|
/**
|
|
17
17
|
* A constructable stylesheet, created on first use (so modules can be
|
|
18
18
|
* imported where there is no DOM) and shared by every shadow root that
|
package/dist/ui/theme.js
CHANGED
|
@@ -44,6 +44,7 @@ export const THEME_CSS = /* css */ `
|
|
|
44
44
|
--x-done: var(--scxml-done, light-dark(#48566b, #a7b5c9));
|
|
45
45
|
--x-done-bg: var(--scxml-done-bg, light-dark(#e9edf3, #242b35));
|
|
46
46
|
--x-err: var(--scxml-error, light-dark(#c2332f, #ff8a84));
|
|
47
|
+
--x-err-bg: var(--scxml-error-bg, light-dark(#fbeceb, #3a1c1b));
|
|
47
48
|
/* type */
|
|
48
49
|
--x-sans: var(--scxml-font-sans, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
|
|
49
50
|
--x-mono: var(--scxml-font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
@@ -136,7 +137,12 @@ export const CONTRAST_PAIRS = [
|
|
|
136
137
|
["--scxml-waiting", "--scxml-surface", 4.5],
|
|
137
138
|
["--scxml-waiting", "--scxml-waiting-bg", 4.5],
|
|
138
139
|
["--scxml-done", "--scxml-done-bg", 4.5],
|
|
140
|
+
// event names: a completion or an error in plain text, or on its tinted chip
|
|
141
|
+
["--scxml-done", "--scxml-bg", 4.5],
|
|
142
|
+
["--scxml-done", "--scxml-surface", 4.5],
|
|
139
143
|
["--scxml-error", "--scxml-surface", 4.5],
|
|
144
|
+
["--scxml-error", "--scxml-bg", 4.5],
|
|
145
|
+
["--scxml-error", "--scxml-error-bg", 4.5],
|
|
140
146
|
["--scxml-fg-faint", "--scxml-surface", 3],
|
|
141
147
|
["--scxml-fg-faint", "--scxml-surface-2", 3],
|
|
142
148
|
["--scxml-border-strong", "--scxml-surface", 3],
|