ketatlas 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE +21 -0
  3. package/NOTICE.md +10 -0
  4. package/README.md +130 -0
  5. package/assets/INTER-LICENSE +93 -0
  6. package/assets/KETJS-LICENSE +21 -0
  7. package/assets/LUCIDE-LICENSE +43 -0
  8. package/assets/design-system.lock.json +56 -0
  9. package/assets/inter-latin-wght-normal.woff2 +0 -0
  10. package/assets/inter-vietnamese-wght-normal.woff2 +0 -0
  11. package/bin/audit.js +116 -0
  12. package/bin/ketatlas.js +148 -0
  13. package/bin/server.js +93 -0
  14. package/bin/viewer.js +20 -0
  15. package/docs/architecture.md +57 -0
  16. package/docs/authoring.md +49 -0
  17. package/docs/cli.md +70 -0
  18. package/docs/configuration.md +65 -0
  19. package/docs/integration.md +108 -0
  20. package/docs/migration.md +35 -0
  21. package/docs/releasing.md +40 -0
  22. package/package.json +59 -0
  23. package/schema.json +187 -0
  24. package/src/config.js +196 -0
  25. package/src/icons.js +23 -0
  26. package/src/index.d.ts +106 -0
  27. package/src/index.js +679 -0
  28. package/src/layout.js +103 -0
  29. package/src/template.js +38 -0
  30. package/styles/design-system.css +2838 -0
  31. package/styles/design-system.document.css +2838 -0
  32. package/styles/fonts.css +17 -0
  33. package/styles/ketatlas.css +992 -0
  34. package/templates/basic/README.md +14 -0
  35. package/templates/basic/atlas.json +45 -0
  36. package/templates/basic/ketatlas.schema.json +187 -0
  37. package/templates/basic/screens/done.html +18 -0
  38. package/templates/basic/screens/screen.css +48 -0
  39. package/templates/basic/screens/welcome.html +21 -0
  40. package/templates/basic/styles/LICENSE +21 -0
  41. package/templates/basic/styles/design-system.css +2838 -0
  42. package/templates/process/README.md +14 -0
  43. package/templates/process/atlas.json +83 -0
  44. package/templates/process/ketatlas.schema.json +187 -0
  45. package/templates/web/README.md +14 -0
  46. package/templates/web/atlas.json +77 -0
  47. package/templates/web/ketatlas.schema.json +187 -0
  48. package/templates/web/screens/demo.css +255 -0
  49. package/templates/web/screens/portal.html +41 -0
  50. package/templates/web/styles/LICENSE +21 -0
  51. package/templates/web/styles/design-system.css +2838 -0
@@ -0,0 +1,14 @@
1
+ # My KetAtlas project
2
+
3
+ Run with Node.js 22 or newer:
4
+
5
+ ```sh
6
+ npx ketatlas serve atlas.json
7
+ npx ketatlas audit atlas.json --strict
8
+ ```
9
+
10
+ Edit `atlas.json` to change nodes, edges, and screen URLs. Screen URLs are relative to that file. Refresh the browser after editing. No wrapper HTML or build step is needed.
11
+
12
+ This template models a process without HTML screens. Add a screen registry and screen nodes when needed.
13
+
14
+ Keep this directory in your own project repository. The schema provides editor completion. See https://github.com/ketvietlab/ketatlas for the full API, CLI, and configuration reference.
@@ -0,0 +1,83 @@
1
+ {
2
+ "$schema": "./ketatlas.schema.json",
3
+ "version": 1,
4
+ "title": "Order fulfilment",
5
+ "screens": [],
6
+ "flows": [
7
+ {
8
+ "id": "fulfilment",
9
+ "title": "From request to delivery",
10
+ "group": "Operations",
11
+ "description": "A process can be mapped without any screens. Connect people, decisions, and external handoffs with the same viewer.",
12
+ "start": "received",
13
+ "ends": ["delivered"],
14
+ "nodes": [
15
+ {
16
+ "id": "received",
17
+ "type": "note",
18
+ "title": "Request received",
19
+ "description": "Operations checks the delivery address and confirms the requested items.",
20
+ "column": 0
21
+ },
22
+ {
23
+ "id": "ready",
24
+ "type": "note",
25
+ "title": "Ready to ship",
26
+ "description": "The warehouse packs the order and records the parcel weight.",
27
+ "column": 1
28
+ },
29
+ {
30
+ "id": "carrier",
31
+ "type": "external",
32
+ "title": "Carrier handoff",
33
+ "description": "A delivery partner accepts the parcel. This step happens outside the product.",
34
+ "column": 2
35
+ },
36
+ {
37
+ "id": "delivered",
38
+ "type": "note",
39
+ "title": "Delivery confirmed",
40
+ "description": "The recipient confirms delivery. Operations closes the request.",
41
+ "column": 3
42
+ },
43
+ {
44
+ "id": "restock",
45
+ "type": "note",
46
+ "title": "Wait for replenishment",
47
+ "description": "Purchasing requests the missing stock and notifies operations when it arrives.",
48
+ "column": 1,
49
+ "row": 1
50
+ }
51
+ ],
52
+ "edges": [
53
+ {
54
+ "from": "received",
55
+ "to": "ready",
56
+ "label": "Items available"
57
+ },
58
+ {
59
+ "from": "ready",
60
+ "to": "carrier",
61
+ "label": "Parcel collected"
62
+ },
63
+ {
64
+ "from": "carrier",
65
+ "to": "delivered",
66
+ "label": "Proof of delivery"
67
+ },
68
+ {
69
+ "from": "received",
70
+ "to": "restock",
71
+ "label": "Stock unavailable",
72
+ "kind": "conditional"
73
+ },
74
+ {
75
+ "from": "restock",
76
+ "to": "ready",
77
+ "label": "Stock received",
78
+ "kind": "recovery"
79
+ }
80
+ ]
81
+ }
82
+ ]
83
+ }
@@ -0,0 +1,187 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "KetAtlas configuration",
4
+ "type": "object",
5
+ "properties": {
6
+ "$schema": {
7
+ "type": "string"
8
+ },
9
+ "version": {
10
+ "const": 1
11
+ },
12
+ "title": {
13
+ "type": "string",
14
+ "pattern": "\\S"
15
+ },
16
+ "description": {
17
+ "type": "string"
18
+ },
19
+ "viewport": {
20
+ "type": "object",
21
+ "properties": {
22
+ "width": {
23
+ "type": "integer",
24
+ "minimum": 160,
25
+ "maximum": 4096
26
+ },
27
+ "height": {
28
+ "type": "integer",
29
+ "minimum": 160,
30
+ "maximum": 4096
31
+ }
32
+ },
33
+ "required": ["width", "height"],
34
+ "additionalProperties": false
35
+ },
36
+ "screens": {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "object",
40
+ "properties": {
41
+ "id": {
42
+ "type": "string",
43
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"
44
+ },
45
+ "title": {
46
+ "type": "string",
47
+ "pattern": "\\S"
48
+ },
49
+ "url": {
50
+ "type": "string",
51
+ "pattern": "\\S"
52
+ },
53
+ "viewport": {
54
+ "type": "object",
55
+ "properties": {
56
+ "width": {
57
+ "type": "integer",
58
+ "minimum": 160,
59
+ "maximum": 4096
60
+ },
61
+ "height": {
62
+ "type": "integer",
63
+ "minimum": 160,
64
+ "maximum": 4096
65
+ }
66
+ },
67
+ "required": ["width", "height"],
68
+ "additionalProperties": false
69
+ },
70
+ "description": {
71
+ "type": "string"
72
+ },
73
+ "badge": {
74
+ "type": "string"
75
+ }
76
+ },
77
+ "required": ["id", "title", "url"],
78
+ "additionalProperties": false
79
+ }
80
+ },
81
+ "flows": {
82
+ "type": "array",
83
+ "minItems": 1,
84
+ "items": {
85
+ "type": "object",
86
+ "properties": {
87
+ "id": {
88
+ "type": "string",
89
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"
90
+ },
91
+ "title": {
92
+ "type": "string",
93
+ "pattern": "\\S"
94
+ },
95
+ "group": {
96
+ "type": "string"
97
+ },
98
+ "description": {
99
+ "type": "string"
100
+ },
101
+ "start": {
102
+ "type": "string",
103
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"
104
+ },
105
+ "ends": {
106
+ "type": "array",
107
+ "items": {
108
+ "type": "string",
109
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"
110
+ }
111
+ },
112
+ "nodes": {
113
+ "type": "array",
114
+ "minItems": 1,
115
+ "items": {
116
+ "type": "object",
117
+ "properties": {
118
+ "id": {
119
+ "type": "string",
120
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"
121
+ },
122
+ "screen": {
123
+ "type": "string",
124
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"
125
+ },
126
+ "type": {
127
+ "enum": ["screen", "note", "external"]
128
+ },
129
+ "title": {
130
+ "type": "string"
131
+ },
132
+ "description": {
133
+ "type": "string"
134
+ },
135
+ "url": {
136
+ "type": "string",
137
+ "pattern": "\\S"
138
+ },
139
+ "column": {
140
+ "type": "integer",
141
+ "minimum": 0,
142
+ "maximum": 100
143
+ },
144
+ "row": {
145
+ "type": "integer",
146
+ "minimum": 0,
147
+ "maximum": 100
148
+ }
149
+ },
150
+ "required": ["id"],
151
+ "additionalProperties": false
152
+ }
153
+ },
154
+ "edges": {
155
+ "type": "array",
156
+ "items": {
157
+ "type": "object",
158
+ "properties": {
159
+ "from": {
160
+ "type": "string",
161
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"
162
+ },
163
+ "to": {
164
+ "type": "string",
165
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"
166
+ },
167
+ "label": {
168
+ "type": "string",
169
+ "pattern": "\\S"
170
+ },
171
+ "kind": {
172
+ "enum": ["primary", "conditional", "recovery"]
173
+ }
174
+ },
175
+ "required": ["from", "to", "label"],
176
+ "additionalProperties": false
177
+ }
178
+ }
179
+ },
180
+ "required": ["id", "title", "nodes", "edges"],
181
+ "additionalProperties": false
182
+ }
183
+ }
184
+ },
185
+ "required": ["version", "title", "flows"],
186
+ "additionalProperties": false
187
+ }
@@ -0,0 +1,14 @@
1
+ # My KetAtlas project
2
+
3
+ Run with Node.js 22 or newer:
4
+
5
+ ```sh
6
+ npx ketatlas serve atlas.json
7
+ npx ketatlas audit atlas.json --strict
8
+ ```
9
+
10
+ Edit `atlas.json` to change nodes, edges, and screen URLs. Screen URLs are relative to that file. Refresh the browser after editing. No wrapper HTML or build step is needed.
11
+
12
+ Edit the HTML files in screens/ to replace the sample product. styles/design-system.css is generated from the pinned KetJS design system; do not manually fork its tokens.
13
+
14
+ Keep this directory in your own project repository. The schema provides editor completion. See https://github.com/ketvietlab/ketatlas for the full API, CLI, and configuration reference.
@@ -0,0 +1,77 @@
1
+ {
2
+ "$schema": "./ketatlas.schema.json",
3
+ "version": 1,
4
+ "title": "Purchase approval",
5
+ "screens": [
6
+ {
7
+ "id": "request-list",
8
+ "title": "Purchase requests",
9
+ "url": "./screens/portal.html?screen=list",
10
+ "viewport": {
11
+ "width": 1280,
12
+ "height": 800
13
+ },
14
+ "badge": "Web"
15
+ },
16
+ {
17
+ "id": "request-review",
18
+ "title": "Review purchase request",
19
+ "url": "./screens/portal.html?screen=review",
20
+ "viewport": {
21
+ "width": 1280,
22
+ "height": 800
23
+ },
24
+ "badge": "Web"
25
+ },
26
+ {
27
+ "id": "approved",
28
+ "title": "Approval recorded",
29
+ "url": "./screens/portal.html?screen=approved",
30
+ "viewport": {
31
+ "width": 1280,
32
+ "height": 800
33
+ },
34
+ "badge": "Web"
35
+ }
36
+ ],
37
+ "flows": [
38
+ {
39
+ "id": "purchase",
40
+ "title": "Review a purchase request",
41
+ "group": "Web portal",
42
+ "description": "Open a pending request, review its items, and approve it. Web screens retain their 1280 × 800 layout.",
43
+ "nodes": [
44
+ {
45
+ "id": "inbox",
46
+ "screen": "request-list"
47
+ },
48
+ {
49
+ "id": "review",
50
+ "screen": "request-review"
51
+ },
52
+ {
53
+ "id": "approved",
54
+ "screen": "approved"
55
+ }
56
+ ],
57
+ "edges": [
58
+ {
59
+ "from": "inbox",
60
+ "to": "review",
61
+ "label": "Open request"
62
+ },
63
+ {
64
+ "from": "review",
65
+ "to": "approved",
66
+ "label": "Approve request"
67
+ },
68
+ {
69
+ "from": "review",
70
+ "to": "inbox",
71
+ "label": "Return to inbox",
72
+ "kind": "recovery"
73
+ }
74
+ ]
75
+ }
76
+ ]
77
+ }
@@ -0,0 +1,187 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "KetAtlas configuration",
4
+ "type": "object",
5
+ "properties": {
6
+ "$schema": {
7
+ "type": "string"
8
+ },
9
+ "version": {
10
+ "const": 1
11
+ },
12
+ "title": {
13
+ "type": "string",
14
+ "pattern": "\\S"
15
+ },
16
+ "description": {
17
+ "type": "string"
18
+ },
19
+ "viewport": {
20
+ "type": "object",
21
+ "properties": {
22
+ "width": {
23
+ "type": "integer",
24
+ "minimum": 160,
25
+ "maximum": 4096
26
+ },
27
+ "height": {
28
+ "type": "integer",
29
+ "minimum": 160,
30
+ "maximum": 4096
31
+ }
32
+ },
33
+ "required": ["width", "height"],
34
+ "additionalProperties": false
35
+ },
36
+ "screens": {
37
+ "type": "array",
38
+ "items": {
39
+ "type": "object",
40
+ "properties": {
41
+ "id": {
42
+ "type": "string",
43
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"
44
+ },
45
+ "title": {
46
+ "type": "string",
47
+ "pattern": "\\S"
48
+ },
49
+ "url": {
50
+ "type": "string",
51
+ "pattern": "\\S"
52
+ },
53
+ "viewport": {
54
+ "type": "object",
55
+ "properties": {
56
+ "width": {
57
+ "type": "integer",
58
+ "minimum": 160,
59
+ "maximum": 4096
60
+ },
61
+ "height": {
62
+ "type": "integer",
63
+ "minimum": 160,
64
+ "maximum": 4096
65
+ }
66
+ },
67
+ "required": ["width", "height"],
68
+ "additionalProperties": false
69
+ },
70
+ "description": {
71
+ "type": "string"
72
+ },
73
+ "badge": {
74
+ "type": "string"
75
+ }
76
+ },
77
+ "required": ["id", "title", "url"],
78
+ "additionalProperties": false
79
+ }
80
+ },
81
+ "flows": {
82
+ "type": "array",
83
+ "minItems": 1,
84
+ "items": {
85
+ "type": "object",
86
+ "properties": {
87
+ "id": {
88
+ "type": "string",
89
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"
90
+ },
91
+ "title": {
92
+ "type": "string",
93
+ "pattern": "\\S"
94
+ },
95
+ "group": {
96
+ "type": "string"
97
+ },
98
+ "description": {
99
+ "type": "string"
100
+ },
101
+ "start": {
102
+ "type": "string",
103
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"
104
+ },
105
+ "ends": {
106
+ "type": "array",
107
+ "items": {
108
+ "type": "string",
109
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"
110
+ }
111
+ },
112
+ "nodes": {
113
+ "type": "array",
114
+ "minItems": 1,
115
+ "items": {
116
+ "type": "object",
117
+ "properties": {
118
+ "id": {
119
+ "type": "string",
120
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"
121
+ },
122
+ "screen": {
123
+ "type": "string",
124
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"
125
+ },
126
+ "type": {
127
+ "enum": ["screen", "note", "external"]
128
+ },
129
+ "title": {
130
+ "type": "string"
131
+ },
132
+ "description": {
133
+ "type": "string"
134
+ },
135
+ "url": {
136
+ "type": "string",
137
+ "pattern": "\\S"
138
+ },
139
+ "column": {
140
+ "type": "integer",
141
+ "minimum": 0,
142
+ "maximum": 100
143
+ },
144
+ "row": {
145
+ "type": "integer",
146
+ "minimum": 0,
147
+ "maximum": 100
148
+ }
149
+ },
150
+ "required": ["id"],
151
+ "additionalProperties": false
152
+ }
153
+ },
154
+ "edges": {
155
+ "type": "array",
156
+ "items": {
157
+ "type": "object",
158
+ "properties": {
159
+ "from": {
160
+ "type": "string",
161
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"
162
+ },
163
+ "to": {
164
+ "type": "string",
165
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9_.-]*$"
166
+ },
167
+ "label": {
168
+ "type": "string",
169
+ "pattern": "\\S"
170
+ },
171
+ "kind": {
172
+ "enum": ["primary", "conditional", "recovery"]
173
+ }
174
+ },
175
+ "required": ["from", "to", "label"],
176
+ "additionalProperties": false
177
+ }
178
+ }
179
+ },
180
+ "required": ["id", "title", "nodes", "edges"],
181
+ "additionalProperties": false
182
+ }
183
+ }
184
+ },
185
+ "required": ["version", "title", "flows"],
186
+ "additionalProperties": false
187
+ }