@journey-to-code/symbology 0.0.0-stage → 0.3.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 +101 -2
- package/ai.d.ts +56 -0
- package/ai.js +252 -0
- package/bin/symbology-mcp.js +5 -0
- package/components/symbology-code.zb +297 -0
- package/dist/symbology-code.d.ts +51 -0
- package/dist/symbology-code.js +837 -0
- package/mcp.js +191 -0
- package/package.json +73 -4
- package/qr.d.ts +136 -0
- package/qr.js +271 -0
- package/schema.js +131 -0
- package/style.d.ts +91 -0
- package/style.js +771 -0
- package/style.schema.json +305 -0
- package/symbology.wasm +0 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/journey-to-code-org/symbology/style.schema.json",
|
|
4
|
+
"title": "Symbology QR style",
|
|
5
|
+
"description": "How to draw a QR code for a URL. Scanning comes first: foreground colours must be clearly darker than a light background, and a logo is only allowed where error correction can recover what it hides. Anything outside these limits is refused.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {
|
|
9
|
+
"preset": {
|
|
10
|
+
"enum": [
|
|
11
|
+
"classic",
|
|
12
|
+
"corporate",
|
|
13
|
+
"minimal-dots",
|
|
14
|
+
"liquid",
|
|
15
|
+
"monochrome-print",
|
|
16
|
+
"bars"
|
|
17
|
+
],
|
|
18
|
+
"description": "A starting point; other fields override it."
|
|
19
|
+
},
|
|
20
|
+
"modules": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"additionalProperties": false,
|
|
23
|
+
"description": "The small squares that carry the data.",
|
|
24
|
+
"properties": {
|
|
25
|
+
"shape": {
|
|
26
|
+
"enum": [
|
|
27
|
+
"square",
|
|
28
|
+
"dot",
|
|
29
|
+
"rounded",
|
|
30
|
+
"diamond",
|
|
31
|
+
"squircle",
|
|
32
|
+
"liquid",
|
|
33
|
+
"bars-vertical",
|
|
34
|
+
"bars-horizontal"
|
|
35
|
+
],
|
|
36
|
+
"description": "square is crispest; dot and rounded are friendly; diamond is sharp; squircle is soft; liquid merges neighbours into flowing blobs; bars-vertical and bars-horizontal join runs into pills."
|
|
37
|
+
},
|
|
38
|
+
"scale": {
|
|
39
|
+
"type": "number",
|
|
40
|
+
"minimum": 0.7,
|
|
41
|
+
"maximum": 1,
|
|
42
|
+
"description": "Size of each shape within its cell. Smaller looks airy but prints fainter; 0.85 to 1 is safest."
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"eyes": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"additionalProperties": false,
|
|
49
|
+
"description": "The three large corner squares (finder patterns) scanners lock on to.",
|
|
50
|
+
"properties": {
|
|
51
|
+
"frame": {
|
|
52
|
+
"enum": [
|
|
53
|
+
"square",
|
|
54
|
+
"rounded",
|
|
55
|
+
"circle",
|
|
56
|
+
"leaf"
|
|
57
|
+
],
|
|
58
|
+
"description": "Outer ring shape."
|
|
59
|
+
},
|
|
60
|
+
"ball": {
|
|
61
|
+
"enum": [
|
|
62
|
+
"square",
|
|
63
|
+
"rounded",
|
|
64
|
+
"circle",
|
|
65
|
+
"diamond",
|
|
66
|
+
"leaf"
|
|
67
|
+
],
|
|
68
|
+
"description": "Inner square shape."
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"colors": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"additionalProperties": false,
|
|
75
|
+
"properties": {
|
|
76
|
+
"foreground": {
|
|
77
|
+
"description": "A solid colour, or a gradient whose every stop is dark enough to contrast with the background.",
|
|
78
|
+
"anyOf": [
|
|
79
|
+
{
|
|
80
|
+
"type": "string",
|
|
81
|
+
"pattern": "^(#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6}|rgb\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\))$",
|
|
82
|
+
"description": "A solid colour: #rgb, #rrggbb, or rgb(r, g, b). No transparency."
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"type": "object",
|
|
86
|
+
"additionalProperties": false,
|
|
87
|
+
"required": [
|
|
88
|
+
"type",
|
|
89
|
+
"stops"
|
|
90
|
+
],
|
|
91
|
+
"properties": {
|
|
92
|
+
"type": {
|
|
93
|
+
"enum": [
|
|
94
|
+
"linear",
|
|
95
|
+
"radial"
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
"angle": {
|
|
99
|
+
"type": "number",
|
|
100
|
+
"minimum": 0,
|
|
101
|
+
"maximum": 360,
|
|
102
|
+
"description": "Linear only: degrees, 0 left to right, 90 top to bottom."
|
|
103
|
+
},
|
|
104
|
+
"stops": {
|
|
105
|
+
"type": "array",
|
|
106
|
+
"minItems": 2,
|
|
107
|
+
"maxItems": 4,
|
|
108
|
+
"items": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"pattern": "^(#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6}|rgb\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\))$",
|
|
111
|
+
"description": "A solid colour: #rgb, #rrggbb, or rgb(r, g, b). No transparency."
|
|
112
|
+
},
|
|
113
|
+
"description": "Colours from start to end."
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
"background": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"pattern": "^(#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6}|rgb\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\))$",
|
|
122
|
+
"description": "Solid and light. Keep it the lightest colour in the design."
|
|
123
|
+
},
|
|
124
|
+
"eyeFrame": {
|
|
125
|
+
"description": "Optional accent for the eye rings; defaults to the foreground.",
|
|
126
|
+
"anyOf": [
|
|
127
|
+
{
|
|
128
|
+
"type": "string",
|
|
129
|
+
"pattern": "^(#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6}|rgb\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\))$",
|
|
130
|
+
"description": "A solid colour: #rgb, #rrggbb, or rgb(r, g, b). No transparency."
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"type": "object",
|
|
134
|
+
"additionalProperties": false,
|
|
135
|
+
"required": [
|
|
136
|
+
"type",
|
|
137
|
+
"stops"
|
|
138
|
+
],
|
|
139
|
+
"properties": {
|
|
140
|
+
"type": {
|
|
141
|
+
"enum": [
|
|
142
|
+
"linear",
|
|
143
|
+
"radial"
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
"angle": {
|
|
147
|
+
"type": "number",
|
|
148
|
+
"minimum": 0,
|
|
149
|
+
"maximum": 360,
|
|
150
|
+
"description": "Linear only: degrees, 0 left to right, 90 top to bottom."
|
|
151
|
+
},
|
|
152
|
+
"stops": {
|
|
153
|
+
"type": "array",
|
|
154
|
+
"minItems": 2,
|
|
155
|
+
"maxItems": 4,
|
|
156
|
+
"items": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"pattern": "^(#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6}|rgb\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\))$",
|
|
159
|
+
"description": "A solid colour: #rgb, #rrggbb, or rgb(r, g, b). No transparency."
|
|
160
|
+
},
|
|
161
|
+
"description": "Colours from start to end."
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
"eyeBall": {
|
|
168
|
+
"description": "Optional accent for the eye centres; defaults to the eye frame colour.",
|
|
169
|
+
"anyOf": [
|
|
170
|
+
{
|
|
171
|
+
"type": "string",
|
|
172
|
+
"pattern": "^(#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6}|rgb\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\))$",
|
|
173
|
+
"description": "A solid colour: #rgb, #rrggbb, or rgb(r, g, b). No transparency."
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"type": "object",
|
|
177
|
+
"additionalProperties": false,
|
|
178
|
+
"required": [
|
|
179
|
+
"type",
|
|
180
|
+
"stops"
|
|
181
|
+
],
|
|
182
|
+
"properties": {
|
|
183
|
+
"type": {
|
|
184
|
+
"enum": [
|
|
185
|
+
"linear",
|
|
186
|
+
"radial"
|
|
187
|
+
]
|
|
188
|
+
},
|
|
189
|
+
"angle": {
|
|
190
|
+
"type": "number",
|
|
191
|
+
"minimum": 0,
|
|
192
|
+
"maximum": 360,
|
|
193
|
+
"description": "Linear only: degrees, 0 left to right, 90 top to bottom."
|
|
194
|
+
},
|
|
195
|
+
"stops": {
|
|
196
|
+
"type": "array",
|
|
197
|
+
"minItems": 2,
|
|
198
|
+
"maxItems": 4,
|
|
199
|
+
"items": {
|
|
200
|
+
"type": "string",
|
|
201
|
+
"pattern": "^(#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6}|rgb\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\))$",
|
|
202
|
+
"description": "A solid colour: #rgb, #rrggbb, or rgb(r, g, b). No transparency."
|
|
203
|
+
},
|
|
204
|
+
"description": "Colours from start to end."
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"logo": {
|
|
213
|
+
"type": "object",
|
|
214
|
+
"additionalProperties": false,
|
|
215
|
+
"description": "Placement of the centred logo. The image itself is supplied by the application.",
|
|
216
|
+
"properties": {
|
|
217
|
+
"size": {
|
|
218
|
+
"type": "number",
|
|
219
|
+
"minimum": 0.05,
|
|
220
|
+
"maximum": 0.4,
|
|
221
|
+
"description": "Logo width as a fraction of the code. 0.18 to 0.25 suits most URLs; larger needs a shorter URL."
|
|
222
|
+
},
|
|
223
|
+
"shape": {
|
|
224
|
+
"enum": [
|
|
225
|
+
"circle",
|
|
226
|
+
"square"
|
|
227
|
+
],
|
|
228
|
+
"description": "Shape of the clear area behind the logo."
|
|
229
|
+
},
|
|
230
|
+
"padding": {
|
|
231
|
+
"type": "number",
|
|
232
|
+
"minimum": 0,
|
|
233
|
+
"maximum": 2,
|
|
234
|
+
"description": "Clear space around the logo, in modules."
|
|
235
|
+
},
|
|
236
|
+
"plate": {
|
|
237
|
+
"type": "string",
|
|
238
|
+
"pattern": "^(#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6}|rgb\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\))$",
|
|
239
|
+
"description": "Colour behind the logo; defaults to the background. Keep it light."
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"frame": {
|
|
244
|
+
"type": "object",
|
|
245
|
+
"additionalProperties": false,
|
|
246
|
+
"description": "An optional border with a call to action below the code.",
|
|
247
|
+
"properties": {
|
|
248
|
+
"text": {
|
|
249
|
+
"type": "string",
|
|
250
|
+
"maxLength": 32,
|
|
251
|
+
"description": "Short call to action, for example SCAN ME or VIEW MY PORTFOLIO."
|
|
252
|
+
},
|
|
253
|
+
"color": {
|
|
254
|
+
"type": "string",
|
|
255
|
+
"pattern": "^(#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6}|rgb\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\))$",
|
|
256
|
+
"description": "A solid colour: #rgb, #rrggbb, or rgb(r, g, b). No transparency."
|
|
257
|
+
},
|
|
258
|
+
"textColor": {
|
|
259
|
+
"type": "string",
|
|
260
|
+
"pattern": "^(#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6}|rgb\\(\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*,\\s*\\d{1,3}\\s*\\))$",
|
|
261
|
+
"description": "A solid colour: #rgb, #rrggbb, or rgb(r, g, b). No transparency."
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
"margin": {
|
|
266
|
+
"type": "integer",
|
|
267
|
+
"minimum": 4,
|
|
268
|
+
"maximum": 8,
|
|
269
|
+
"description": "Quiet zone around the code, in modules. 4 is the standard minimum."
|
|
270
|
+
},
|
|
271
|
+
"level": {
|
|
272
|
+
"enum": [
|
|
273
|
+
"auto",
|
|
274
|
+
"L",
|
|
275
|
+
"M",
|
|
276
|
+
"Q",
|
|
277
|
+
"H"
|
|
278
|
+
],
|
|
279
|
+
"description": "Error correction. auto picks the strongest that fits; leave it on auto."
|
|
280
|
+
},
|
|
281
|
+
"maxVersion": {
|
|
282
|
+
"type": "integer",
|
|
283
|
+
"minimum": 1,
|
|
284
|
+
"maximum": 10,
|
|
285
|
+
"description": "Largest symbol version allowed. Lower keeps modules bigger on small cards."
|
|
286
|
+
},
|
|
287
|
+
"safety": {
|
|
288
|
+
"type": "number",
|
|
289
|
+
"minimum": 0.1,
|
|
290
|
+
"maximum": 0.8,
|
|
291
|
+
"description": "Share of the error-correction budget a logo may use; the rest is kept for wear and glare. 0.5 is a good default."
|
|
292
|
+
},
|
|
293
|
+
"minContrast": {
|
|
294
|
+
"type": "number",
|
|
295
|
+
"minimum": 3,
|
|
296
|
+
"maximum": 21,
|
|
297
|
+
"description": "Least contrast ratio allowed between any foreground colour and the background. Default 4."
|
|
298
|
+
},
|
|
299
|
+
"title": {
|
|
300
|
+
"type": "string",
|
|
301
|
+
"maxLength": 200,
|
|
302
|
+
"description": "Accessible name, for example \"QR code for Jane Doe's portfolio\"."
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
package/symbology.wasm
ADDED
|
Binary file
|