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
+ 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,45 @@
1
+ {
2
+ "$schema": "./ketatlas.schema.json",
3
+ "version": 1,
4
+ "title": "My first atlas",
5
+ "viewport": {
6
+ "width": 390,
7
+ "height": 844
8
+ },
9
+ "screens": [
10
+ {
11
+ "id": "welcome",
12
+ "title": "Welcome",
13
+ "url": "./screens/welcome.html"
14
+ },
15
+ {
16
+ "id": "done",
17
+ "title": "Ready to go",
18
+ "url": "./screens/done.html"
19
+ }
20
+ ],
21
+ "flows": [
22
+ {
23
+ "id": "getting-started",
24
+ "title": "Get started",
25
+ "description": "A real HTML journey. Edit atlas.json to add your own screens and branches.",
26
+ "nodes": [
27
+ {
28
+ "id": "welcome",
29
+ "screen": "welcome"
30
+ },
31
+ {
32
+ "id": "done",
33
+ "screen": "done"
34
+ }
35
+ ],
36
+ "edges": [
37
+ {
38
+ "from": "welcome",
39
+ "to": "done",
40
+ "label": "Continue"
41
+ }
42
+ ]
43
+ }
44
+ ]
45
+ }
@@ -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,18 @@
1
+ <!doctype html>
2
+ <html lang="en" data-theme="light">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width,initial-scale=1" />
6
+ <title>Your first flow is ready.</title>
7
+ <link rel="stylesheet" href="screen.css" />
8
+ </head>
9
+ <body data-kv-design-system>
10
+ <header>Your project</header>
11
+ <main>
12
+ <small>MADE WITH KETATLAS</small>
13
+ <h1>Your first flow is ready.</h1>
14
+ <p>Add screens, connect decisions, and share the entire folder with your team.</p>
15
+ </main>
16
+ <footer><a href="welcome.html" data-ui="action" data-variant="primary">Start again</a></footer>
17
+ </body>
18
+ </html>
@@ -0,0 +1,48 @@
1
+ @import url("../styles/design-system.css");
2
+ * {
3
+ box-sizing: border-box;
4
+ }
5
+ html,
6
+ body {
7
+ margin: 0;
8
+ height: 100%;
9
+ font-family: var(--kv-font-sans);
10
+ color: var(--kv-text-main);
11
+ background: var(--kv-panel-bg);
12
+ }
13
+ body {
14
+ display: flex;
15
+ flex-direction: column;
16
+ }
17
+ header {
18
+ padding: 24px;
19
+ border-bottom: 1px solid var(--kv-panel-border);
20
+ font-weight: 600;
21
+ }
22
+ main {
23
+ flex: 1;
24
+ padding: 48px 28px;
25
+ }
26
+ h1 {
27
+ font-size: 34px;
28
+ letter-spacing: -0.04em;
29
+ line-height: 1.15;
30
+ margin: 0 0 20px;
31
+ }
32
+ p {
33
+ line-height: 1.7;
34
+ color: var(--kv-text-secondary);
35
+ }
36
+ footer {
37
+ padding: 20px;
38
+ border-top: 1px solid var(--kv-panel-border);
39
+ }
40
+ a[data-ui] {
41
+ width: 100%;
42
+ text-decoration: none;
43
+ }
44
+ small {
45
+ color: var(--kv-accent);
46
+ display: block;
47
+ margin-bottom: 20px;
48
+ }
@@ -0,0 +1,21 @@
1
+ <!doctype html>
2
+ <html lang="en" data-theme="light">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width,initial-scale=1" />
6
+ <title>Make the journey visible.</title>
7
+ <link rel="stylesheet" href="screen.css" />
8
+ </head>
9
+ <body data-kv-design-system>
10
+ <header>Your project</header>
11
+ <main>
12
+ <small>MADE WITH KETATLAS</small>
13
+ <h1>Make the journey visible.</h1>
14
+ <p>
15
+ This is a real HTML page. Replace it with your own prototype, then connect the next step in
16
+ atlas.json.
17
+ </p>
18
+ </main>
19
+ <footer><a href="done.html" data-ui="action" data-variant="primary">Continue</a></footer>
20
+ </body>
21
+ </html>
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 KETVIET JSC, Vietnam
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.