@digitalcanopy/assets 1.0.0 → 1.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 (43) hide show
  1. package/README.md +55 -0
  2. package/dist/catalog/index.d.mts +94 -0
  3. package/dist/catalog/index.d.ts +94 -0
  4. package/dist/catalog/index.js +540 -0
  5. package/dist/catalog/index.mjs +30 -0
  6. package/dist/chunk-BUUV7WRE.mjs +502 -0
  7. package/dist/chunk-CIMJYYCP.mjs +3612 -0
  8. package/dist/chunk-FECYZWQ6.mjs +278 -0
  9. package/dist/chunk-MFWLT2XV.mjs +47 -0
  10. package/dist/index.d.mts +5 -0
  11. package/dist/index.d.ts +5 -0
  12. package/dist/index.js +4483 -0
  13. package/dist/index.mjs +74 -0
  14. package/dist/manifests/index.d.mts +79 -0
  15. package/dist/manifests/index.d.ts +79 -0
  16. package/dist/manifests/index.js +3647 -0
  17. package/dist/manifests/index.mjs +24 -0
  18. package/dist/registry/index.d.mts +98 -0
  19. package/dist/registry/index.d.ts +98 -0
  20. package/dist/registry/index.js +321 -0
  21. package/dist/registry/index.mjs +12 -0
  22. package/dist/resolvers/cdn.d.mts +16 -0
  23. package/dist/resolvers/cdn.d.ts +16 -0
  24. package/dist/resolvers/cdn.js +76 -0
  25. package/dist/resolvers/cdn.mjs +16 -0
  26. package/dist/types-Cy3PZIX4.d.mts +52 -0
  27. package/dist/types-_dmvJ9qx.d.ts +52 -0
  28. package/package.json +19 -3
  29. package/scripts/generate-manifests.mjs +0 -409
  30. package/src/__tests__/manifests.test.ts +0 -129
  31. package/src/__tests__/resolvers.test.ts +0 -83
  32. package/src/__tests__/sync-r2.test.ts +0 -82
  33. package/src/index.ts +0 -2
  34. package/src/manifests/index.ts +0 -81
  35. package/src/manifests/isometric-tiles.atlas.json +0 -592
  36. package/src/manifests/keys.ts +0 -160
  37. package/src/manifests/modular-characters.atlas.json +0 -856
  38. package/src/manifests/playing-cards.atlas.json +0 -1408
  39. package/src/manifests/ui-sprites.atlas.json +0 -568
  40. package/src/resolvers/cdn.ts +0 -52
  41. package/src/resolvers/index.ts +0 -1
  42. package/tsconfig.build.json +0 -12
  43. package/tsconfig.json +0 -20
@@ -1,568 +0,0 @@
1
- {
2
- "meta": {
3
- "app": "sunshade-atlas-pipeline",
4
- "version": "1.0.0",
5
- "image": "https://cdn.sunshade.icu/assets/kenney/ui-pack/ui-sprites-atlas.png",
6
- "format": "RGBA8888",
7
- "size": {
8
- "w": 2048,
9
- "h": 256
10
- },
11
- "scale": "1",
12
- "pack": "ui-sprites"
13
- },
14
- "frames": {
15
- "button-default": {
16
- "frame": {
17
- "x": 0,
18
- "y": 0,
19
- "w": 128,
20
- "h": 128
21
- },
22
- "rotated": false,
23
- "trimmed": false,
24
- "spriteSourceSize": {
25
- "x": 0,
26
- "y": 0,
27
- "w": 128,
28
- "h": 128
29
- },
30
- "sourceSize": {
31
- "w": 128,
32
- "h": 128
33
- },
34
- "anchor": {
35
- "ax": 0.5,
36
- "ay": 0.5
37
- }
38
- },
39
- "button-hover": {
40
- "frame": {
41
- "x": 128,
42
- "y": 0,
43
- "w": 128,
44
- "h": 128
45
- },
46
- "rotated": false,
47
- "trimmed": false,
48
- "spriteSourceSize": {
49
- "x": 0,
50
- "y": 0,
51
- "w": 128,
52
- "h": 128
53
- },
54
- "sourceSize": {
55
- "w": 128,
56
- "h": 128
57
- },
58
- "anchor": {
59
- "ax": 0.5,
60
- "ay": 0.5
61
- }
62
- },
63
- "button-pressed": {
64
- "frame": {
65
- "x": 256,
66
- "y": 0,
67
- "w": 128,
68
- "h": 128
69
- },
70
- "rotated": false,
71
- "trimmed": false,
72
- "spriteSourceSize": {
73
- "x": 0,
74
- "y": 0,
75
- "w": 128,
76
- "h": 128
77
- },
78
- "sourceSize": {
79
- "w": 128,
80
- "h": 128
81
- },
82
- "anchor": {
83
- "ax": 0.5,
84
- "ay": 0.5
85
- }
86
- },
87
- "button-disabled": {
88
- "frame": {
89
- "x": 384,
90
- "y": 0,
91
- "w": 128,
92
- "h": 128
93
- },
94
- "rotated": false,
95
- "trimmed": false,
96
- "spriteSourceSize": {
97
- "x": 0,
98
- "y": 0,
99
- "w": 128,
100
- "h": 128
101
- },
102
- "sourceSize": {
103
- "w": 128,
104
- "h": 128
105
- },
106
- "anchor": {
107
- "ax": 0.5,
108
- "ay": 0.5
109
- }
110
- },
111
- "button-round-blue": {
112
- "frame": {
113
- "x": 512,
114
- "y": 0,
115
- "w": 128,
116
- "h": 128
117
- },
118
- "rotated": false,
119
- "trimmed": false,
120
- "spriteSourceSize": {
121
- "x": 0,
122
- "y": 0,
123
- "w": 128,
124
- "h": 128
125
- },
126
- "sourceSize": {
127
- "w": 128,
128
- "h": 128
129
- },
130
- "anchor": {
131
- "ax": 0.5,
132
- "ay": 0.5
133
- }
134
- },
135
- "button-round-green": {
136
- "frame": {
137
- "x": 640,
138
- "y": 0,
139
- "w": 128,
140
- "h": 128
141
- },
142
- "rotated": false,
143
- "trimmed": false,
144
- "spriteSourceSize": {
145
- "x": 0,
146
- "y": 0,
147
- "w": 128,
148
- "h": 128
149
- },
150
- "sourceSize": {
151
- "w": 128,
152
- "h": 128
153
- },
154
- "anchor": {
155
- "ax": 0.5,
156
- "ay": 0.5
157
- }
158
- },
159
- "button-round-red": {
160
- "frame": {
161
- "x": 768,
162
- "y": 0,
163
- "w": 128,
164
- "h": 128
165
- },
166
- "rotated": false,
167
- "trimmed": false,
168
- "spriteSourceSize": {
169
- "x": 0,
170
- "y": 0,
171
- "w": 128,
172
- "h": 128
173
- },
174
- "sourceSize": {
175
- "w": 128,
176
- "h": 128
177
- },
178
- "anchor": {
179
- "ax": 0.5,
180
- "ay": 0.5
181
- }
182
- },
183
- "button-round-yellow": {
184
- "frame": {
185
- "x": 896,
186
- "y": 0,
187
- "w": 128,
188
- "h": 128
189
- },
190
- "rotated": false,
191
- "trimmed": false,
192
- "spriteSourceSize": {
193
- "x": 0,
194
- "y": 0,
195
- "w": 128,
196
- "h": 128
197
- },
198
- "sourceSize": {
199
- "w": 128,
200
- "h": 128
201
- },
202
- "anchor": {
203
- "ax": 0.5,
204
- "ay": 0.5
205
- }
206
- },
207
- "panel-wooden": {
208
- "frame": {
209
- "x": 1024,
210
- "y": 0,
211
- "w": 128,
212
- "h": 128
213
- },
214
- "rotated": false,
215
- "trimmed": false,
216
- "spriteSourceSize": {
217
- "x": 0,
218
- "y": 0,
219
- "w": 128,
220
- "h": 128
221
- },
222
- "sourceSize": {
223
- "w": 128,
224
- "h": 128
225
- },
226
- "anchor": {
227
- "ax": 0.5,
228
- "ay": 0.5
229
- }
230
- },
231
- "panel-metal": {
232
- "frame": {
233
- "x": 1152,
234
- "y": 0,
235
- "w": 128,
236
- "h": 128
237
- },
238
- "rotated": false,
239
- "trimmed": false,
240
- "spriteSourceSize": {
241
- "x": 0,
242
- "y": 0,
243
- "w": 128,
244
- "h": 128
245
- },
246
- "sourceSize": {
247
- "w": 128,
248
- "h": 128
249
- },
250
- "anchor": {
251
- "ax": 0.5,
252
- "ay": 0.5
253
- }
254
- },
255
- "panel-glass": {
256
- "frame": {
257
- "x": 1280,
258
- "y": 0,
259
- "w": 128,
260
- "h": 128
261
- },
262
- "rotated": false,
263
- "trimmed": false,
264
- "spriteSourceSize": {
265
- "x": 0,
266
- "y": 0,
267
- "w": 128,
268
- "h": 128
269
- },
270
- "sourceSize": {
271
- "w": 128,
272
- "h": 128
273
- },
274
- "anchor": {
275
- "ax": 0.5,
276
- "ay": 0.5
277
- }
278
- },
279
- "icon-checkmark": {
280
- "frame": {
281
- "x": 1408,
282
- "y": 0,
283
- "w": 128,
284
- "h": 128
285
- },
286
- "rotated": false,
287
- "trimmed": false,
288
- "spriteSourceSize": {
289
- "x": 0,
290
- "y": 0,
291
- "w": 128,
292
- "h": 128
293
- },
294
- "sourceSize": {
295
- "w": 128,
296
- "h": 128
297
- },
298
- "anchor": {
299
- "ax": 0.5,
300
- "ay": 0.5
301
- }
302
- },
303
- "icon-cross": {
304
- "frame": {
305
- "x": 1536,
306
- "y": 0,
307
- "w": 128,
308
- "h": 128
309
- },
310
- "rotated": false,
311
- "trimmed": false,
312
- "spriteSourceSize": {
313
- "x": 0,
314
- "y": 0,
315
- "w": 128,
316
- "h": 128
317
- },
318
- "sourceSize": {
319
- "w": 128,
320
- "h": 128
321
- },
322
- "anchor": {
323
- "ax": 0.5,
324
- "ay": 0.5
325
- }
326
- },
327
- "icon-arrow-up": {
328
- "frame": {
329
- "x": 1664,
330
- "y": 0,
331
- "w": 128,
332
- "h": 128
333
- },
334
- "rotated": false,
335
- "trimmed": false,
336
- "spriteSourceSize": {
337
- "x": 0,
338
- "y": 0,
339
- "w": 128,
340
- "h": 128
341
- },
342
- "sourceSize": {
343
- "w": 128,
344
- "h": 128
345
- },
346
- "anchor": {
347
- "ax": 0.5,
348
- "ay": 0.5
349
- }
350
- },
351
- "icon-arrow-down": {
352
- "frame": {
353
- "x": 1792,
354
- "y": 0,
355
- "w": 128,
356
- "h": 128
357
- },
358
- "rotated": false,
359
- "trimmed": false,
360
- "spriteSourceSize": {
361
- "x": 0,
362
- "y": 0,
363
- "w": 128,
364
- "h": 128
365
- },
366
- "sourceSize": {
367
- "w": 128,
368
- "h": 128
369
- },
370
- "anchor": {
371
- "ax": 0.5,
372
- "ay": 0.5
373
- }
374
- },
375
- "icon-arrow-left": {
376
- "frame": {
377
- "x": 1920,
378
- "y": 0,
379
- "w": 128,
380
- "h": 128
381
- },
382
- "rotated": false,
383
- "trimmed": false,
384
- "spriteSourceSize": {
385
- "x": 0,
386
- "y": 0,
387
- "w": 128,
388
- "h": 128
389
- },
390
- "sourceSize": {
391
- "w": 128,
392
- "h": 128
393
- },
394
- "anchor": {
395
- "ax": 0.5,
396
- "ay": 0.5
397
- }
398
- },
399
- "icon-arrow-right": {
400
- "frame": {
401
- "x": 0,
402
- "y": 128,
403
- "w": 128,
404
- "h": 128
405
- },
406
- "rotated": false,
407
- "trimmed": false,
408
- "spriteSourceSize": {
409
- "x": 0,
410
- "y": 0,
411
- "w": 128,
412
- "h": 128
413
- },
414
- "sourceSize": {
415
- "w": 128,
416
- "h": 128
417
- },
418
- "anchor": {
419
- "ax": 0.5,
420
- "ay": 0.5
421
- }
422
- },
423
- "icon-settings": {
424
- "frame": {
425
- "x": 128,
426
- "y": 128,
427
- "w": 128,
428
- "h": 128
429
- },
430
- "rotated": false,
431
- "trimmed": false,
432
- "spriteSourceSize": {
433
- "x": 0,
434
- "y": 0,
435
- "w": 128,
436
- "h": 128
437
- },
438
- "sourceSize": {
439
- "w": 128,
440
- "h": 128
441
- },
442
- "anchor": {
443
- "ax": 0.5,
444
- "ay": 0.5
445
- }
446
- },
447
- "icon-star": {
448
- "frame": {
449
- "x": 256,
450
- "y": 128,
451
- "w": 128,
452
- "h": 128
453
- },
454
- "rotated": false,
455
- "trimmed": false,
456
- "spriteSourceSize": {
457
- "x": 0,
458
- "y": 0,
459
- "w": 128,
460
- "h": 128
461
- },
462
- "sourceSize": {
463
- "w": 128,
464
- "h": 128
465
- },
466
- "anchor": {
467
- "ax": 0.5,
468
- "ay": 0.5
469
- }
470
- },
471
- "slider-bar": {
472
- "frame": {
473
- "x": 384,
474
- "y": 128,
475
- "w": 128,
476
- "h": 128
477
- },
478
- "rotated": false,
479
- "trimmed": false,
480
- "spriteSourceSize": {
481
- "x": 0,
482
- "y": 0,
483
- "w": 128,
484
- "h": 128
485
- },
486
- "sourceSize": {
487
- "w": 128,
488
- "h": 128
489
- },
490
- "anchor": {
491
- "ax": 0.5,
492
- "ay": 0.5
493
- }
494
- },
495
- "slider-knob": {
496
- "frame": {
497
- "x": 512,
498
- "y": 128,
499
- "w": 128,
500
- "h": 128
501
- },
502
- "rotated": false,
503
- "trimmed": false,
504
- "spriteSourceSize": {
505
- "x": 0,
506
- "y": 0,
507
- "w": 128,
508
- "h": 128
509
- },
510
- "sourceSize": {
511
- "w": 128,
512
- "h": 128
513
- },
514
- "anchor": {
515
- "ax": 0.5,
516
- "ay": 0.5
517
- }
518
- },
519
- "bar-progress-bg": {
520
- "frame": {
521
- "x": 640,
522
- "y": 128,
523
- "w": 128,
524
- "h": 128
525
- },
526
- "rotated": false,
527
- "trimmed": false,
528
- "spriteSourceSize": {
529
- "x": 0,
530
- "y": 0,
531
- "w": 128,
532
- "h": 128
533
- },
534
- "sourceSize": {
535
- "w": 128,
536
- "h": 128
537
- },
538
- "anchor": {
539
- "ax": 0.5,
540
- "ay": 0.5
541
- }
542
- },
543
- "bar-progress-fill": {
544
- "frame": {
545
- "x": 768,
546
- "y": 128,
547
- "w": 128,
548
- "h": 128
549
- },
550
- "rotated": false,
551
- "trimmed": false,
552
- "spriteSourceSize": {
553
- "x": 0,
554
- "y": 0,
555
- "w": 128,
556
- "h": 128
557
- },
558
- "sourceSize": {
559
- "w": 128,
560
- "h": 128
561
- },
562
- "anchor": {
563
- "ax": 0.5,
564
- "ay": 0.5
565
- }
566
- }
567
- }
568
- }
@@ -1,52 +0,0 @@
1
- export const CDN_BASE_URL = 'https://cdn.sunshade.icu/assets/kenney';
2
- export const KENNEY_CDN_BASE = CDN_BASE_URL;
3
-
4
- /**
5
- * Resolves a Kenney asset pack and asset path to a Cloudflare R2 CDN URL.
6
- * Handles both full relative paths (e.g. 'base_01.png') and bare keys with optional extensions.
7
- *
8
- * @param pack - Asset pack slug (e.g. 'modular-characters', 'cards', 'ui-pack')
9
- * @param assetPath - Relative file path or bare asset key
10
- * @param ext - Optional extension override (e.g. 'png', 'svg', '.svg')
11
- */
12
- export function getKenneyAssetUrl(pack: string, assetPath: string, ext?: string): string {
13
- const cleanPack = pack.replace(/^\/+|\/+$/g, '');
14
- let cleanPath = assetPath.replace(/^\/+/, '');
15
-
16
- if (ext) {
17
- const cleanExt = ext.startsWith('.') ? ext.slice(1) : ext;
18
- if (cleanPath.toLowerCase().endsWith(`.${cleanExt.toLowerCase()}`)) {
19
- return `${CDN_BASE_URL}/${cleanPack}/${cleanPath}`;
20
- }
21
- return `${CDN_BASE_URL}/${cleanPack}/${cleanPath}.${cleanExt}`;
22
- }
23
-
24
- const hasExt = /\.[a-zA-Z0-9]+$/.test(cleanPath);
25
- const finalPath = hasExt ? cleanPath : `${cleanPath}.png`;
26
- return `${CDN_BASE_URL}/${cleanPack}/${finalPath}`;
27
- }
28
-
29
- export function getKenneyAudioUrl(
30
- soundName: string,
31
- ext: 'ogg' | 'wav' | 'mp3' | string = 'ogg'
32
- ): string {
33
- const cleanName = soundName.replace(/^\/+|\/+$/g, '').replace(/\.[a-zA-Z0-9]+$/, '');
34
- const cleanExt = ext.startsWith('.') ? ext.slice(1) : ext;
35
- return `${CDN_BASE_URL}/ui-pack/sounds/${cleanName}.${cleanExt}`;
36
- }
37
-
38
- export function getKenneyCardUrl(cardKey: string, ext: string = 'png'): string {
39
- const cleanKey = cardKey.replace(/^\/+|\/+$/g, '').replace(/\.[a-zA-Z0-9]+$/, '');
40
- const cleanExt = ext.startsWith('.') ? ext.slice(1) : ext;
41
- return `${CDN_BASE_URL}/cards/${cleanKey}.${cleanExt}`;
42
- }
43
-
44
- export function getKenneyCharacterUrl(
45
- category: 'face' | 'hair' | 'pants' | 'shirts' | 'shoes' | 'skin' | string,
46
- itemKey: string,
47
- ext: string = 'png'
48
- ): string {
49
- const cleanKey = itemKey.replace(/^\/+|\/+$/g, '').replace(/\.[a-zA-Z0-9]+$/, '');
50
- const cleanExt = ext.startsWith('.') ? ext.slice(1) : ext;
51
- return `${CDN_BASE_URL}/modular-characters/${category}/${cleanKey}.${cleanExt}`;
52
- }
@@ -1 +0,0 @@
1
- export * from './cdn';
@@ -1,12 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "noEmit": false,
5
- "emitDeclarationOnly": true,
6
- "declaration": true,
7
- "declarationMap": true,
8
- "outDir": "./dist"
9
- },
10
- "include": ["src/**/*"],
11
- "exclude": ["node_modules", "dist", "src/__tests__"]
12
- }
package/tsconfig.json DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2020",
4
- "lib": ["esnext", "dom"],
5
- "allowJs": true,
6
- "skipLibCheck": true,
7
- "strict": true,
8
- "forceConsistentCasingInFileNames": true,
9
- "noEmit": true,
10
- "esModuleInterop": true,
11
- "module": "esnext",
12
- "moduleResolution": "bundler",
13
- "resolveJsonModule": true,
14
- "isolatedModules": true,
15
- "declaration": true,
16
- "declarationMap": true
17
- },
18
- "include": ["src/**/*"],
19
- "exclude": ["node_modules", "dist"]
20
- }