@jjlmoya/utils-textiles 1.11.0 → 1.12.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 (26) hide show
  1. package/package.json +5 -3
  2. package/scripts/postinstall.mjs +27 -0
  3. package/src/tool/burnTest/component.astro +0 -380
  4. package/src/tool/burnTest/textile-burn-test.css +378 -0
  5. package/src/tool/clothingSizeConverter/clothing-size-converter.css +717 -0
  6. package/src/tool/clothingSizeConverter/component.astro +0 -719
  7. package/src/tool/fabricProjectCalculator/component.astro +0 -540
  8. package/src/tool/fabricProjectCalculator/fabric-project-calculator.css +538 -0
  9. package/src/tool/fabricTruth/component.astro +0 -428
  10. package/src/tool/fabricTruth/fabric-truthfulness.css +426 -0
  11. package/src/tool/fiberPrep/component.astro +0 -652
  12. package/src/tool/fiberPrep/fiber-preparation-natural-dyeing.css +650 -0
  13. package/src/tool/knittingGauge/component.astro +0 -458
  14. package/src/tool/knittingGauge/knitting-gauge-calculator.css +456 -0
  15. package/src/tool/laundryGuide/component.astro +0 -317
  16. package/src/tool/laundryGuide/laundry-guide.css +315 -0
  17. package/src/tool/needleConverter/component.astro +0 -344
  18. package/src/tool/needleConverter/knitting-needle-converter.css +342 -0
  19. package/src/tool/sewingPatternScaler/component.astro +0 -314
  20. package/src/tool/sewingPatternScaler/sewing-pattern-scaler.css +313 -0
  21. package/src/tool/shoeSizeConverter/component.astro +0 -255
  22. package/src/tool/shoeSizeConverter/shoe-size-converter.css +253 -0
  23. package/src/tool/stainChemistry/component.astro +0 -479
  24. package/src/tool/stainChemistry/stain-chemical-protocol.css +477 -0
  25. package/src/tool/yarnCalculator/component.astro +0 -446
  26. package/src/tool/yarnCalculator/yarn-calculator.css +444 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jjlmoya/utils-textiles",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -10,7 +10,8 @@
10
10
  "./entries": "./src/entries.ts"
11
11
  },
12
12
  "files": [
13
- "src"
13
+ "src",
14
+ "scripts"
14
15
  ],
15
16
  "publishConfig": {
16
17
  "access": "public"
@@ -29,7 +30,8 @@
29
30
  "postversion": "git push && git push --tags",
30
31
  "patch": "npm version patch",
31
32
  "minor": "npm version minor",
32
- "major": "npm version major"
33
+ "major": "npm version major",
34
+ "postinstall": "node scripts/postinstall.mjs"
33
35
  },
34
36
  "lint-staged": {
35
37
  "*.{ts,tsx,astro}": [
@@ -0,0 +1,27 @@
1
+ import { readFileSync, writeFileSync, mkdirSync, readdirSync } from 'fs';
2
+ import { join, dirname } from 'path';
3
+ import { fileURLToPath } from 'url';
4
+
5
+ const libDir = dirname(fileURLToPath(import.meta.url));
6
+ const toolsDir = join(libDir, '../src/tool');
7
+
8
+ const inNodeModules = libDir.includes('node_modules');
9
+ if (!inNodeModules) process.exit(0);
10
+
11
+ const projectRoot = join(libDir, '../../../..');
12
+ const categoryKey = JSON.parse(readFileSync(join(libDir, '../package.json'), 'utf8')).name.replace('@jjlmoya/utils-', '');
13
+ const destDir = join(projectRoot, `public/styles/lib/${categoryKey}`);
14
+
15
+ mkdirSync(destDir, { recursive: true });
16
+
17
+ const tools = readdirSync(toolsDir, { withFileTypes: true }).filter(d => d.isDirectory());
18
+ for (const tool of tools) {
19
+ const toolDir = join(toolsDir, tool.name);
20
+ let files;
21
+ try { files = readdirSync(toolDir).filter(f => f.endsWith('.css')); }
22
+ catch { continue; }
23
+ for (const file of files) {
24
+ writeFileSync(join(destDir, file), readFileSync(join(toolDir, file)));
25
+ console.log(`[@jjlmoya/utils-${categoryKey}] copied ${file}`);
26
+ }
27
+ }
@@ -220,383 +220,3 @@ const fibers = Object.entries(burnUI.fiberData ?? {});
220
220
  startInit();
221
221
  </script>
222
222
 
223
- <style>
224
- .burn-wizard {
225
- width: 100%;
226
- padding: 1rem;
227
- }
228
-
229
- .icon-cache {
230
- display: none;
231
- }
232
-
233
- .wizard-card {
234
- background: var(--bg-surface);
235
- border: 1px solid var(--border-color);
236
- border-radius: 1.5rem;
237
- overflow: hidden;
238
- min-height: 400px;
239
- display: flex;
240
- flex-direction: column;
241
- box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
242
- }
243
-
244
- .theme-dark .wizard-card {
245
- box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
246
- }
247
-
248
- .wizard-header {
249
- display: flex;
250
- justify-content: space-between;
251
- align-items: center;
252
- padding: 1rem 1.5rem;
253
- background: var(--bg-page);
254
- border-bottom: 1px solid var(--border-color);
255
- }
256
-
257
- .header-left {
258
- display: flex;
259
- align-items: center;
260
- gap: 0.75rem;
261
- }
262
-
263
- .header-badge {
264
- width: 2rem;
265
- height: 2rem;
266
- background: linear-gradient(135deg, #6366f1, #7c3aed);
267
- border-radius: 0.5rem;
268
- display: flex;
269
- align-items: center;
270
- justify-content: center;
271
- color: white;
272
- box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
273
- }
274
-
275
- .header-badge svg {
276
- width: 1rem;
277
- height: 1rem;
278
- }
279
-
280
- .header-info {
281
- display: flex;
282
- flex-direction: column;
283
- }
284
-
285
- .investigation-label {
286
- font-size: 0.55rem;
287
- font-weight: 900;
288
- text-transform: uppercase;
289
- letter-spacing: 0.15em;
290
- color: var(--text-muted);
291
- }
292
-
293
- .step-indicator {
294
- font-size: 0.625rem;
295
- font-weight: 700;
296
- color: var(--text-main);
297
- }
298
-
299
- .reset-btn {
300
- display: flex;
301
- align-items: center;
302
- gap: 0.5rem;
303
- padding: 0.375rem 0.75rem;
304
- border-radius: 9999px;
305
- background: var(--bg-surface);
306
- border: 1px solid var(--border-color);
307
- color: var(--text-muted);
308
- font-size: 0.625rem;
309
- font-weight: 700;
310
- cursor: pointer;
311
- transition: all 0.2s;
312
- }
313
-
314
- .reset-btn:hover {
315
- background: rgba(249, 115, 22, 0.05);
316
- color: #f97316;
317
- border-color: #f97316;
318
- }
319
-
320
- .reset-btn svg {
321
- width: 1rem;
322
- height: 1rem;
323
- transition: transform 0.5s;
324
- }
325
-
326
- .reset-btn:hover svg {
327
- transform: rotate(180deg);
328
- }
329
-
330
- .reset-btn.hidden {
331
- display: none;
332
- }
333
-
334
- .wizard-content {
335
- flex: 1;
336
- padding: 1.5rem;
337
- display: flex;
338
- align-items: center;
339
- justify-content: center;
340
- }
341
-
342
- .question-view {
343
- width: 100%;
344
- }
345
-
346
- .question-view.hidden {
347
- display: none;
348
- }
349
-
350
- .question-title {
351
- font-size: 1.5rem;
352
- font-weight: 900;
353
- color: var(--text-main);
354
- margin: 0 0 1.5rem;
355
- transition: opacity 0.3s ease;
356
- }
357
-
358
- .options-grid {
359
- display: grid;
360
- grid-template-columns: 1fr 1fr;
361
- gap: 0.75rem;
362
- }
363
-
364
- :global(.option-btn) {
365
- text-align: left;
366
- padding: 1rem;
367
- background: var(--bg-page);
368
- border: 1px solid var(--border-color);
369
- border-radius: 0.75rem;
370
- color: var(--text-muted);
371
- font-size: 0.875rem;
372
- font-weight: 500;
373
- cursor: pointer;
374
- transition: all 0.3s;
375
- animation: fade-in-up 0.5s ease-out forwards;
376
- opacity: 0;
377
- line-height: 1.4;
378
- }
379
-
380
- :global(.option-btn:hover) {
381
- border-color: #6366f1;
382
- background: rgba(99, 102, 241, 0.05);
383
- color: var(--text-main);
384
- transform: translateY(-2px);
385
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
386
- }
387
-
388
- .result-view {
389
- width: 100%;
390
- max-width: 520px;
391
- text-align: center;
392
- display: flex;
393
- flex-direction: column;
394
- align-items: center;
395
- gap: 1.5rem;
396
- animation: fade-in 0.5s ease;
397
- }
398
-
399
- .result-view.hidden {
400
- display: none;
401
- }
402
-
403
- .result-icon-wrap {
404
- position: relative;
405
- }
406
-
407
- .result-icon-container {
408
- width: 6rem;
409
- height: 6rem;
410
- background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
411
- border-radius: 1.5rem;
412
- display: flex;
413
- align-items: center;
414
- justify-content: center;
415
- font-size: 2.5rem;
416
- color: white;
417
- box-shadow: 0 25px 50px rgba(99, 102, 241, 0.4);
418
- position: relative;
419
- z-index: 1;
420
- }
421
-
422
- .result-meta {
423
- display: flex;
424
- flex-direction: column;
425
- gap: 0.5rem;
426
- align-items: center;
427
- }
428
-
429
- .positive-id {
430
- display: inline-block;
431
- padding: 0.25rem 0.75rem;
432
- border-radius: 9999px;
433
- background: rgba(16, 185, 129, 0.08);
434
- color: #10b981;
435
- font-size: 0.55rem;
436
- font-weight: 900;
437
- text-transform: uppercase;
438
- letter-spacing: 0.2em;
439
- border: 1px solid rgba(16, 185, 129, 0.2);
440
- }
441
-
442
- .result-name {
443
- font-size: 2.5rem;
444
- font-weight: 900;
445
- color: var(--text-main);
446
- margin: 0;
447
- }
448
-
449
- .result-desc {
450
- background: var(--bg-page);
451
- border: 1px solid var(--border-color);
452
- border-radius: 1rem;
453
- padding: 1.5rem;
454
- width: 100%;
455
- text-align: left;
456
- }
457
-
458
- :global(.result-details) {
459
- display: flex;
460
- flex-direction: column;
461
- gap: 1rem;
462
- }
463
-
464
- :global(.result-id-text) {
465
- font-size: 0.875rem;
466
- font-weight: 500;
467
- color: var(--text-muted);
468
- border-bottom: 1px solid var(--border-color);
469
- padding-bottom: 1rem;
470
- margin: 0;
471
- }
472
-
473
- :global(.result-attrs) {
474
- display: flex;
475
- flex-direction: column;
476
- gap: 0.75rem;
477
- }
478
-
479
- :global(.attr-row) {
480
- display: flex;
481
- flex-direction: column;
482
- padding-left: 1rem;
483
- border-left: 2px solid var(--border-color);
484
- }
485
-
486
- :global(.attr-flame) {
487
- border-left-color: #f97316;
488
- }
489
-
490
- :global(.attr-odor) {
491
- border-left-color: #6366f1;
492
- }
493
-
494
- :global(.attr-residue) {
495
- border-left-color: #94a3b8;
496
- }
497
-
498
- :global(.attr-label) {
499
- font-size: 0.6rem;
500
- font-weight: 900;
501
- text-transform: uppercase;
502
- letter-spacing: 0.05em;
503
- color: var(--text-muted);
504
- margin-bottom: 0.2rem;
505
- }
506
-
507
- :global(.attr-value) {
508
- font-size: 0.875rem;
509
- font-weight: 600;
510
- color: var(--text-main);
511
- }
512
-
513
- .progress-track {
514
- height: 0.25rem;
515
- background: var(--bg-page);
516
- }
517
-
518
- .progress-fill {
519
- height: 100%;
520
- background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
521
- transition: width 0.7s ease-out;
522
- box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
523
- }
524
-
525
- .safety-note {
526
- margin-top: 1.5rem;
527
- padding: 1rem 1.5rem;
528
- background: var(--bg-surface);
529
- border: 1px solid var(--border-color);
530
- border-left: 4px solid #ef4444;
531
- border-radius: 0.75rem;
532
- display: flex;
533
- gap: 1rem;
534
- align-items: center;
535
- }
536
-
537
- .safety-icon {
538
- background: rgba(239, 68, 68, 0.08);
539
- color: #ef4444;
540
- padding: 0.5rem;
541
- border-radius: 0.5rem;
542
- flex-shrink: 0;
543
- display: flex;
544
- align-items: center;
545
- justify-content: center;
546
- }
547
-
548
- .safety-icon svg {
549
- width: 1.25rem;
550
- height: 1.25rem;
551
- }
552
-
553
- .safety-title {
554
- font-size: 0.625rem;
555
- font-weight: 900;
556
- text-transform: uppercase;
557
- letter-spacing: 0.1em;
558
- color: #ef4444;
559
- margin: 0 0 0.25rem;
560
- }
561
-
562
- .safety-text p {
563
- margin: 0;
564
- font-size: 0.75rem;
565
- color: var(--text-muted);
566
- line-height: 1.5;
567
- }
568
-
569
- @keyframes fade-in-up {
570
- from {
571
- opacity: 0;
572
- transform: translateY(10px);
573
- }
574
- to {
575
- opacity: 1;
576
- transform: translateY(0);
577
- }
578
- }
579
-
580
- @keyframes fade-in {
581
- from {
582
- opacity: 0;
583
- }
584
- to {
585
- opacity: 1;
586
- }
587
- }
588
-
589
- @media (max-width: 640px) {
590
- .options-grid {
591
- grid-template-columns: 1fr;
592
- }
593
-
594
- .result-name {
595
- font-size: 1.75rem;
596
- }
597
-
598
- .wizard-content {
599
- padding: 1rem;
600
- }
601
- }
602
- </style>