@jjlmoya/utils-textiles 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 (134) hide show
  1. package/package.json +60 -0
  2. package/src/category/i18n/en.ts +76 -0
  3. package/src/category/i18n/es.ts +76 -0
  4. package/src/category/i18n/fr.ts +73 -0
  5. package/src/category/index.ts +17 -0
  6. package/src/category/seo.astro +15 -0
  7. package/src/components/PreviewNavSidebar.astro +116 -0
  8. package/src/components/PreviewToolbar.astro +143 -0
  9. package/src/data.ts +11 -0
  10. package/src/env.d.ts +5 -0
  11. package/src/index.ts +32 -0
  12. package/src/layouts/PreviewLayout.astro +117 -0
  13. package/src/pages/[locale]/[slug].astro +146 -0
  14. package/src/pages/[locale].astro +253 -0
  15. package/src/pages/index.astro +4 -0
  16. package/src/tests/faq_count.test.ts +19 -0
  17. package/src/tests/locale_completeness.test.ts +42 -0
  18. package/src/tests/mocks/astro_mock.js +2 -0
  19. package/src/tests/no_h1_in_components.test.ts +48 -0
  20. package/src/tests/seo_length.test.ts +22 -0
  21. package/src/tests/title_separators.test.ts +40 -0
  22. package/src/tests/tool_validation.test.ts +17 -0
  23. package/src/tool/burnTest/bibliography.astro +34 -0
  24. package/src/tool/burnTest/component.astro +602 -0
  25. package/src/tool/burnTest/i18n/en.ts +225 -0
  26. package/src/tool/burnTest/i18n/es.ts +225 -0
  27. package/src/tool/burnTest/i18n/fr.ts +225 -0
  28. package/src/tool/burnTest/index.ts +34 -0
  29. package/src/tool/burnTest/logic.ts +3 -0
  30. package/src/tool/burnTest/seo.astro +40 -0
  31. package/src/tool/burnTest/ui.ts +36 -0
  32. package/src/tool/clothingSizeConverter/bibliography.astro +34 -0
  33. package/src/tool/clothingSizeConverter/component.astro +1226 -0
  34. package/src/tool/clothingSizeConverter/i18n/en.ts +356 -0
  35. package/src/tool/clothingSizeConverter/i18n/es.ts +356 -0
  36. package/src/tool/clothingSizeConverter/i18n/fr.ts +356 -0
  37. package/src/tool/clothingSizeConverter/index.ts +34 -0
  38. package/src/tool/clothingSizeConverter/logic.ts +30 -0
  39. package/src/tool/clothingSizeConverter/seo.astro +40 -0
  40. package/src/tool/clothingSizeConverter/ui.ts +70 -0
  41. package/src/tool/fabricProjectCalculator/bibliography.astro +19 -0
  42. package/src/tool/fabricProjectCalculator/component.astro +914 -0
  43. package/src/tool/fabricProjectCalculator/i18n/en.ts +250 -0
  44. package/src/tool/fabricProjectCalculator/i18n/es.ts +250 -0
  45. package/src/tool/fabricProjectCalculator/i18n/fr.ts +250 -0
  46. package/src/tool/fabricProjectCalculator/index.ts +34 -0
  47. package/src/tool/fabricProjectCalculator/logic.ts +89 -0
  48. package/src/tool/fabricProjectCalculator/seo.astro +40 -0
  49. package/src/tool/fabricProjectCalculator/ui.ts +57 -0
  50. package/src/tool/fabricTruth/bibliography.astro +40 -0
  51. package/src/tool/fabricTruth/component.astro +708 -0
  52. package/src/tool/fabricTruth/i18n/en.ts +282 -0
  53. package/src/tool/fabricTruth/i18n/es.ts +316 -0
  54. package/src/tool/fabricTruth/i18n/fr.ts +282 -0
  55. package/src/tool/fabricTruth/index.ts +34 -0
  56. package/src/tool/fabricTruth/logic.ts +91 -0
  57. package/src/tool/fabricTruth/seo.astro +40 -0
  58. package/src/tool/fabricTruth/ui.ts +28 -0
  59. package/src/tool/fiberPrep/bibliography.astro +33 -0
  60. package/src/tool/fiberPrep/component.astro +987 -0
  61. package/src/tool/fiberPrep/i18n/en.ts +225 -0
  62. package/src/tool/fiberPrep/i18n/es.ts +225 -0
  63. package/src/tool/fiberPrep/i18n/fr.ts +225 -0
  64. package/src/tool/fiberPrep/index.ts +34 -0
  65. package/src/tool/fiberPrep/logic.ts +36 -0
  66. package/src/tool/fiberPrep/seo.astro +40 -0
  67. package/src/tool/fiberPrep/ui.ts +38 -0
  68. package/src/tool/knittingGauge/bibliography.astro +14 -0
  69. package/src/tool/knittingGauge/component.astro +828 -0
  70. package/src/tool/knittingGauge/i18n/en.ts +234 -0
  71. package/src/tool/knittingGauge/i18n/es.ts +234 -0
  72. package/src/tool/knittingGauge/i18n/fr.ts +234 -0
  73. package/src/tool/knittingGauge/index.ts +34 -0
  74. package/src/tool/knittingGauge/logic.ts +28 -0
  75. package/src/tool/knittingGauge/seo.astro +40 -0
  76. package/src/tool/knittingGauge/ui.ts +41 -0
  77. package/src/tool/laundryGuide/bibliography.astro +33 -0
  78. package/src/tool/laundryGuide/component.astro +486 -0
  79. package/src/tool/laundryGuide/data-en.ts +166 -0
  80. package/src/tool/laundryGuide/data-es.ts +166 -0
  81. package/src/tool/laundryGuide/data-fr.ts +103 -0
  82. package/src/tool/laundryGuide/i18n/en.ts +275 -0
  83. package/src/tool/laundryGuide/i18n/es.ts +275 -0
  84. package/src/tool/laundryGuide/i18n/fr.ts +291 -0
  85. package/src/tool/laundryGuide/index.ts +29 -0
  86. package/src/tool/laundryGuide/logic.ts +19 -0
  87. package/src/tool/laundryGuide/seo.astro +40 -0
  88. package/src/tool/needleConverter/bibliography.astro +14 -0
  89. package/src/tool/needleConverter/component.astro +518 -0
  90. package/src/tool/needleConverter/i18n/en.ts +217 -0
  91. package/src/tool/needleConverter/i18n/es.ts +217 -0
  92. package/src/tool/needleConverter/i18n/fr.ts +217 -0
  93. package/src/tool/needleConverter/index.ts +34 -0
  94. package/src/tool/needleConverter/logic.ts +31 -0
  95. package/src/tool/needleConverter/seo.astro +15 -0
  96. package/src/tool/needleConverter/ui.ts +17 -0
  97. package/src/tool/sewingPatternScaler/bibliography.astro +14 -0
  98. package/src/tool/sewingPatternScaler/component.astro +550 -0
  99. package/src/tool/sewingPatternScaler/i18n/en.ts +196 -0
  100. package/src/tool/sewingPatternScaler/i18n/es.ts +231 -0
  101. package/src/tool/sewingPatternScaler/i18n/fr.ts +187 -0
  102. package/src/tool/sewingPatternScaler/index.ts +34 -0
  103. package/src/tool/sewingPatternScaler/logic.ts +35 -0
  104. package/src/tool/sewingPatternScaler/seo.astro +49 -0
  105. package/src/tool/sewingPatternScaler/ui.ts +29 -0
  106. package/src/tool/shoeSizeConverter/bibliography.astro +34 -0
  107. package/src/tool/shoeSizeConverter/component.astro +437 -0
  108. package/src/tool/shoeSizeConverter/i18n/en.ts +188 -0
  109. package/src/tool/shoeSizeConverter/i18n/es.ts +188 -0
  110. package/src/tool/shoeSizeConverter/i18n/fr.ts +188 -0
  111. package/src/tool/shoeSizeConverter/index.ts +34 -0
  112. package/src/tool/shoeSizeConverter/logic.ts +8 -0
  113. package/src/tool/shoeSizeConverter/seo.astro +40 -0
  114. package/src/tool/shoeSizeConverter/ui.ts +21 -0
  115. package/src/tool/stainChemistry/bibliography.astro +40 -0
  116. package/src/tool/stainChemistry/component.astro +717 -0
  117. package/src/tool/stainChemistry/i18n/en.ts +303 -0
  118. package/src/tool/stainChemistry/i18n/es.ts +300 -0
  119. package/src/tool/stainChemistry/i18n/fr.ts +310 -0
  120. package/src/tool/stainChemistry/index.ts +34 -0
  121. package/src/tool/stainChemistry/logic.ts +11 -0
  122. package/src/tool/stainChemistry/seo.astro +40 -0
  123. package/src/tool/stainChemistry/ui.ts +51 -0
  124. package/src/tool/yarnCalculator/bibliography.astro +19 -0
  125. package/src/tool/yarnCalculator/component.astro +792 -0
  126. package/src/tool/yarnCalculator/i18n/en.ts +310 -0
  127. package/src/tool/yarnCalculator/i18n/es.ts +310 -0
  128. package/src/tool/yarnCalculator/i18n/fr.ts +310 -0
  129. package/src/tool/yarnCalculator/index.ts +34 -0
  130. package/src/tool/yarnCalculator/logic.ts +84 -0
  131. package/src/tool/yarnCalculator/seo.astro +14 -0
  132. package/src/tool/yarnCalculator/ui.ts +42 -0
  133. package/src/tools.ts +16 -0
  134. package/src/types.ts +72 -0
@@ -0,0 +1,250 @@
1
+ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+ import type { FabricProjectCalculatorUI } from '../ui';
4
+
5
+ const slug = 'calculateur-tissu-projet';
6
+ const title = 'Calculateur de Consommation de Tissu par Vêtement';
7
+ const description =
8
+ 'Calculez facilement la quantité de tissu nécessaire pour coudre une jupe, un pantalon, une robe ou une chemise. Ajustez selon la largeur du tissu et la taille pour une coupe professionnelle.';
9
+
10
+ const faqData = [
11
+ {
12
+ question: 'Quelle quantité de tissu faut-il pour une jupe?',
13
+ answer:
14
+ 'Cela dépend de la largeur du tissu. Pour une jupe droite en tissu de 140-150 cm, 1,20 mètre suffit généralement. Si le tissu fait 90-110 cm de large, vous aurez besoin de 2,00 mètres.',
15
+ },
16
+ {
17
+ question: 'Comment la largeur du tissu affecte-t-elle la consommation?',
18
+ answer:
19
+ 'Plus le tissu est étroit, moins les pièces du patron peuvent être placées côte à côte (en parallèle), ce qui double souvent la consommation car les pièces doivent être placées l\'une sous l\'autre.',
20
+ },
21
+ {
22
+ question: 'Vaut-il mieux acheter plus de tissu?',
23
+ answer:
24
+ 'Oui, une marge de 10% (environ 20 cm) est recommandée pour compenser le rétrécissement, les défauts du tissu ou les imprévus de couture.',
25
+ },
26
+ {
27
+ question: 'Qu\'est-ce que le droit fil et comment influence-t-il la coupe?',
28
+ answer:
29
+ 'C\'est la direction parallèle aux lisières du tissu. Les patrons doivent être alignés avec ce fil pour que le vêtement ne se déforme pas à l\'usage.',
30
+ },
31
+ ];
32
+
33
+ const howToData = [
34
+ {
35
+ name: 'Choisir le type de vêtement',
36
+ text: 'Sélectionnez le modèle que vous allez confectionner (jupe, pantalon, etc.) pour charger son tableau de consommation de base.',
37
+ },
38
+ {
39
+ name: 'Entrer la largeur du tissu',
40
+ text: 'Mesurez la largeur de lisière en lisière du tissu que vous prévoyez d\'acheter (90, 115, 140 ou 150 cm).',
41
+ },
42
+ {
43
+ name: 'Sélectionner la taille',
44
+ text: 'Ajustez le volume du vêtement selon la taille (XS-S, M-L, XL-XXL) pour recalculer le facteur multiplicatif.',
45
+ },
46
+ {
47
+ name: 'Obtenir les mètres totaux',
48
+ text: 'Vérifiez le résultat final avec et sans marge de couture pour savoir exactement combien commander en magasin.',
49
+ },
50
+ ];
51
+
52
+ const faqSchema: WithContext<FAQPage> = {
53
+ '@context': 'https://schema.org',
54
+ '@type': 'FAQPage',
55
+ mainEntity: faqData.map((item) => ({
56
+ '@type': 'Question',
57
+ name: item.question,
58
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
59
+ })),
60
+ };
61
+
62
+ const howToSchema: WithContext<HowTo> = {
63
+ '@context': 'https://schema.org',
64
+ '@type': 'HowTo',
65
+ name: title,
66
+ description,
67
+ step: howToData.map((step) => ({
68
+ '@type': 'HowToStep',
69
+ name: step.name,
70
+ text: step.text,
71
+ })),
72
+ };
73
+
74
+ const appSchema: WithContext<SoftwareApplication> = {
75
+ '@context': 'https://schema.org',
76
+ '@type': 'SoftwareApplication',
77
+ name: title,
78
+ description,
79
+ applicationCategory: 'UtilityApplication',
80
+ operatingSystem: 'All',
81
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
82
+ inLanguage: 'fr',
83
+ };
84
+
85
+ export const content: ToolLocaleContent<FabricProjectCalculatorUI> = {
86
+ slug,
87
+ title,
88
+ description,
89
+ faqTitle: 'Questions Fréquentes',
90
+ faq: faqData,
91
+ bibliographyTitle: 'Bibliographie',
92
+ bibliography: [
93
+ {
94
+ name: 'Fabric Estimation Guide - Threads Magazine',
95
+ url: 'https://www.threadsmagazine.com/forum/measuring-fabric',
96
+ },
97
+ {
98
+ name: 'How much fabric do I need? - Seamwork',
99
+ url: 'https://www.seamwork.com/sewing-tutorials/the-anatomy-of-a-sewing-pattern',
100
+ },
101
+ {
102
+ name: 'Standard Fabric Consumption Charts - Textile School',
103
+ url: 'https://www.textileschool.com/209/fabric-consumption-in-garment-making/',
104
+ },
105
+ ],
106
+ howTo: howToData,
107
+ schemas: [faqSchema, howToSchema, appSchema],
108
+ seo: [
109
+ {
110
+ type: 'title',
111
+ text: 'Calculateur de Mètres de Tissu pour la Couture: Guide de Consommation',
112
+ level: 2,
113
+ },
114
+ {
115
+ type: 'paragraph',
116
+ html: 'L\'une des questions les plus fréquentes dans l\'atelier de couture est de déterminer la quantité de tissu à acheter pour un projet spécifique. La consommation de tissu dépend radicalement de trois facteurs: le modèle du vêtement, la taille de la personne et surtout la largeur du tissu (qui oscille généralement entre 90 cm et 150 cm). Ce calculateur technique systématise le calcul pour que vous n\'achetiez ni trop ni trop peu.',
117
+ },
118
+ {
119
+ type: 'title',
120
+ text: 'Quelle quantité de tissu pour une robe ou un pantalon?',
121
+ level: 3,
122
+ },
123
+ {
124
+ type: 'paragraph',
125
+ html: 'Le calcul traditionnel est basé sur la longueur du vêtement plus la longueur des manches, avec une marge pour les parements et l\'ourlet. Cependant, avec un tissu étroit (90-110 cm), les pièces ne peuvent souvent pas se placer côte à côte, obligeant à acheter le double de longueur. Notre outil tient compte de ces variations automatiquement selon les normes de l\'industrie textile.',
126
+ },
127
+ {
128
+ type: 'title',
129
+ text: 'Consommation Estimée selon la Largeur du Tissu (taille M-L)',
130
+ level: 3,
131
+ },
132
+ {
133
+ type: 'list',
134
+ items: [
135
+ '<strong>Jupe Droite:</strong> 2,00 m en tissu de 90 cm · 1,20 m en tissu de 140/150 cm.',
136
+ '<strong>Pantalon Long:</strong> 2,50 m en tissu de 90 cm · 1,50 m en tissu de 140/150 cm.',
137
+ '<strong>Chemise Manches Longues:</strong> 2,20 m en tissu de 90 cm · 1,40 m en tissu de 140/150 cm.',
138
+ '<strong>Robe Basique:</strong> 3,50 m en tissu de 90 cm · 2,20 m en tissu de 140/150 cm.',
139
+ ],
140
+ },
141
+ {
142
+ type: 'title',
143
+ text: 'Facteurs qui Modifient la Consommation de Tissu',
144
+ level: 3,
145
+ },
146
+ {
147
+ type: 'list',
148
+ items: [
149
+ '<strong>Direction du motif (Raccord):</strong> Si le tissu a un motif directionnel ou des carreaux à faire correspondre, vous aurez besoin de 15 à 20% de matière supplémentaire.',
150
+ '<strong>Coupe en biais:</strong> Les coupes circulaires (comme les jupes cercle) consomment beaucoup plus de tissu à cause des pertes aux angles.',
151
+ '<strong>Sens du poil:</strong> Dans les tissus à poils comme le velours ou le velours côtelé, toutes les pièces doivent être coupées dans le même sens.',
152
+ '<strong>Rétrécissement:</strong> De nombreuses fibres naturelles (coton, lin, laine) rétrécissent après le premier lavage. Il est essentiel de pré-laver le tissu avant de couper.',
153
+ ],
154
+ },
155
+ {
156
+ type: 'tip',
157
+ title: 'Conseil du Couturier',
158
+ html: '<p>Si vous utilisez un tissu à grand motif ou à carreaux, ne vous fiez pas uniquement à la mesure standard. Ajoutez toujours une répétition complète du motif (le raccord) au total de mètres calculé pour garantir que les motifs correspondent aux coutures latérales.</p>',
159
+ },
160
+ {
161
+ type: 'title',
162
+ text: 'Avantages et Limites de ce Calculateur',
163
+ level: 3,
164
+ },
165
+ {
166
+ type: 'list',
167
+ items: [
168
+ 'Calcul instantané pour plusieurs largeurs de tissu avec ajustement de taille.',
169
+ 'Inclut une estimation de marge de couture personnalisable.',
170
+ 'Guide visuel de disposition des pièces sur le tissu.',
171
+ 'Ne remplace pas une disposition de patron réelle (marquage). Les grandes tailles peuvent nécessiter des ajustements manuels supplémentaires.',
172
+ ],
173
+ },
174
+ {
175
+ type: 'card',
176
+ title: 'Largeur du tissu',
177
+ icon: 'mdi:arrow-expand-horizontal',
178
+ html: 'La mesure transversale du tissu de <strong>lisière en lisière</strong>. Détermine si les pièces du patron peuvent être placées en parallèle ou doivent être disposées en série.',
179
+ },
180
+ {
181
+ type: 'card',
182
+ title: 'Marge de couture',
183
+ icon: 'mdi:tape-measure',
184
+ html: 'La distance entre le bord du patron et la <strong>ligne de couture finale</strong>. Une valeur standard est de 1,5 cm pour les coutures de vêtements.',
185
+ },
186
+ {
187
+ type: 'card',
188
+ title: 'Lisière',
189
+ icon: 'mdi:content-cut',
190
+ html: 'Les bords latéraux renforcés du tissu qui <strong>ne s\'effilochent pas</strong>. Ils indiquent la direction du fil et servent de référence pour la coupe.',
191
+ },
192
+ ],
193
+ ui: {
194
+ sectionProject: 'Projet',
195
+ sectionMaterial: 'Matière',
196
+ labelGarmentType: 'Type de vêtement',
197
+ labelSize: 'Taille',
198
+ labelFabricWidth: 'Largeur du tissu (cm)',
199
+ labelSeamAllowance: 'Marge de couture (cm)',
200
+ garmentSkirt: 'Jupe (Droite/Évasée)',
201
+ garmentPants: 'Pantalon',
202
+ garmentDress: 'Robe',
203
+ garmentShirt: 'Chemise / Blouse',
204
+ garmentCoat: 'Manteau / Veste',
205
+ garmentTote: 'Tote Bag',
206
+ garmentMerceria: {
207
+ skirt: '1 fermeture 20cm, 1 bouton',
208
+ pants: '1 fermeture 20cm, 1 bouton, 30cm entoilage',
209
+ dress: '1 fermeture 60cm, 50cm entoilage',
210
+ shirt: '7 boutons, 1m entoilage léger',
211
+ coat: '3 grands boutons, 1,5m entoilage, doublure',
212
+ tote: '2m sangle pour anses',
213
+ },
214
+ sizeXS: 'XS-S',
215
+ sizeM: 'M-L',
216
+ sizeXL: 'XL-XXL',
217
+ width90: '90 cm (Étroit)',
218
+ width115: '115 cm (Patchwork)',
219
+ width140: '140 cm (Standard EU)',
220
+ width150: '150 cm (Ameublement)',
221
+ btnClear: 'Effacer',
222
+ btnShare: 'Partager',
223
+ btnCopied: 'Copié!',
224
+ btnCopyList: 'Copier la liste',
225
+ resultLabel: 'Il vous faut:',
226
+ resultUnit: 'Mètres',
227
+ shopAdviceFormat: 'Commandez {m}m en magasin',
228
+ boardEmpty: 'Sélectionnez un projet pour voir la disposition',
229
+ boardDescFormat: 'Largeur: {w}cm | Longueur: {m}m',
230
+ merchTitle: 'Mercerie et Matériaux',
231
+ checklistThread: 'Fil assorti',
232
+ warningSerialFormat: 'En tissu de {w}cm, les pièces de votre taille ne tiennent pas en parallèle. Consommation ajustée pour la coupe en série.',
233
+ foldLabel: '⊟ pli',
234
+ pieceNames: {
235
+ front: 'Devant',
236
+ back: 'Dos',
237
+ waistband: 'Ceinture',
238
+ waistbelt: 'Ceinture',
239
+ sleeve: 'Manche',
240
+ collar: 'Col',
241
+ cuffs: 'Poignets',
242
+ facings: 'Parements',
243
+ lapels: 'Revers',
244
+ pocket: 'Poche',
245
+ body: 'Corps',
246
+ handleA: 'Anse A',
247
+ handleB: 'Anse B',
248
+ },
249
+ },
250
+ };
@@ -0,0 +1,34 @@
1
+ import type { TextilesToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
+ import FabricProjectCalculatorComponent from './component.astro';
3
+ import FabricProjectCalculatorSEO from './seo.astro';
4
+ import FabricProjectCalculatorBibliography from './bibliography.astro';
5
+
6
+ import type { FabricProjectCalculatorUI } from './ui';
7
+
8
+ export type FabricProjectCalculatorLocaleContent = ToolLocaleContent<FabricProjectCalculatorUI>;
9
+
10
+ import { content as es } from './i18n/es';
11
+ import { content as en } from './i18n/en';
12
+ import { content as fr } from './i18n/fr';
13
+
14
+ export const fabricProjectCalculator: TextilesToolEntry<FabricProjectCalculatorUI> = {
15
+ id: 'fabric-project-calculator',
16
+ icons: {
17
+ bg: 'mdi:content-cut',
18
+ fg: 'mdi:tape-measure',
19
+ },
20
+ i18n: {
21
+ es: async () => es,
22
+ en: async () => en,
23
+ fr: async () => fr,
24
+ },
25
+ };
26
+
27
+ export { FabricProjectCalculatorComponent, FabricProjectCalculatorSEO, FabricProjectCalculatorBibliography };
28
+
29
+ export const FABRIC_PROJECT_CALCULATOR_TOOL: ToolDefinition = {
30
+ entry: fabricProjectCalculator,
31
+ Component: FabricProjectCalculatorComponent,
32
+ SEOComponent: FabricProjectCalculatorSEO,
33
+ BibliographyComponent: FabricProjectCalculatorBibliography,
34
+ };
@@ -0,0 +1,89 @@
1
+ export interface PieceSpec {
2
+ nameKey: string;
3
+ w: number;
4
+ fold?: boolean;
5
+ col: number;
6
+ }
7
+
8
+ export interface PieceRow {
9
+ h: number;
10
+ pieces: PieceSpec[];
11
+ }
12
+
13
+ export const PIECE_ROWS: Record<string, PieceRow[]> = {
14
+ skirt: [
15
+ { h: 0.38, pieces: [{ nameKey: 'front', w: 0.88, fold: true, col: 0 }] },
16
+ { h: 0.33, pieces: [{ nameKey: 'back', w: 0.44, col: 1 }, { nameKey: 'back', w: 0.44, col: 1 }] },
17
+ { h: 0.12, pieces: [{ nameKey: 'waistband', w: 0.88, col: 2 }] },
18
+ ],
19
+ pants: [
20
+ { h: 0.32, pieces: [{ nameKey: 'front', w: 0.44, col: 0 }, { nameKey: 'front', w: 0.44, col: 0 }] },
21
+ { h: 0.30, pieces: [{ nameKey: 'back', w: 0.44, col: 1 }, { nameKey: 'back', w: 0.44, col: 1 }] },
22
+ { h: 0.09, pieces: [{ nameKey: 'waistbelt', w: 0.88, fold: true, col: 2 }] },
23
+ { h: 0.12, pieces: [{ nameKey: 'pocket', w: 0.22, col: 5 }, { nameKey: 'pocket', w: 0.22, col: 5 }] },
24
+ ],
25
+ dress: [
26
+ { h: 0.36, pieces: [{ nameKey: 'front', w: 0.88, fold: true, col: 0 }] },
27
+ { h: 0.27, pieces: [{ nameKey: 'back', w: 0.44, col: 1 }, { nameKey: 'back', w: 0.44, col: 1 }] },
28
+ { h: 0.22, pieces: [{ nameKey: 'sleeve', w: 0.44, col: 3 }, { nameKey: 'sleeve', w: 0.44, col: 3 }] },
29
+ { h: 0.08, pieces: [{ nameKey: 'facings', w: 0.88, col: 4 }] },
30
+ ],
31
+ shirt: [
32
+ { h: 0.35, pieces: [{ nameKey: 'front', w: 0.44, col: 0 }, { nameKey: 'front', w: 0.44, col: 0 }] },
33
+ { h: 0.28, pieces: [{ nameKey: 'back', w: 0.88, fold: true, col: 1 }] },
34
+ { h: 0.20, pieces: [{ nameKey: 'sleeve', w: 0.44, col: 3 }, { nameKey: 'sleeve', w: 0.44, col: 3 }] },
35
+ { h: 0.08, pieces: [{ nameKey: 'collar', w: 0.40, col: 2 }, { nameKey: 'collar', w: 0.40, col: 2 }] },
36
+ { h: 0.06, pieces: [{ nameKey: 'cuffs', w: 0.35, col: 4 }, { nameKey: 'cuffs', w: 0.35, col: 4 }] },
37
+ ],
38
+ coat: [
39
+ { h: 0.32, pieces: [{ nameKey: 'front', w: 0.44, col: 0 }, { nameKey: 'front', w: 0.44, col: 0 }] },
40
+ { h: 0.30, pieces: [{ nameKey: 'back', w: 0.88, fold: true, col: 1 }] },
41
+ { h: 0.20, pieces: [{ nameKey: 'sleeve', w: 0.44, col: 3 }, { nameKey: 'sleeve', w: 0.44, col: 3 }] },
42
+ { h: 0.08, pieces: [{ nameKey: 'collar', w: 0.78, col: 2 }] },
43
+ { h: 0.06, pieces: [{ nameKey: 'lapels', w: 0.55, col: 4 }] },
44
+ ],
45
+ tote: [
46
+ { h: 0.62, pieces: [{ nameKey: 'body', w: 0.44, col: 0 }, { nameKey: 'body', w: 0.44, col: 0 }] },
47
+ { h: 0.20, pieces: [{ nameKey: 'handleA', w: 0.15, col: 5 }, { nameKey: 'handleB', w: 0.15, col: 5 }] },
48
+ ],
49
+ };
50
+
51
+ export const CONSUMPTION_MATRIX: Record<string, Record<string, number>> = {
52
+ skirt: { '90': 2.0, '115': 1.5, '140': 1.2, '150': 1.1 },
53
+ pants: { '90': 2.5, '115': 2.2, '140': 1.6, '150': 1.5 },
54
+ dress: { '90': 3.5, '115': 3.0, '140': 2.5, '150': 2.2 },
55
+ shirt: { '90': 2.2, '115': 1.8, '140': 1.4, '150': 1.2 },
56
+ coat: { '90': 4.5, '115': 3.8, '140': 3.0, '150': 2.8 },
57
+ tote: { '90': 1.2, '115': 1.0, '140': 0.8, '150': 0.7 },
58
+ };
59
+
60
+ export const SIZE_MULTS: Record<string, number> = {
61
+ xs_core: 0.88,
62
+ m_core: 1.0,
63
+ xl_core: 1.25,
64
+ };
65
+
66
+ export const SIZE_MIN_WIDTHS: Record<string, number> = {
67
+ xs_core: 40,
68
+ m_core: 55,
69
+ xl_core: 70,
70
+ };
71
+
72
+ export function isSerialCut(minWidth: number, fabricWidth: number, garment: string): boolean {
73
+ return garment !== 'tote' && minWidth * 2 > fabricWidth;
74
+ }
75
+
76
+ export function computeMeters(base: number, mult: number, serial: boolean, allowCm: number): number {
77
+ return parseFloat(((base * mult * (serial ? 1.4 : 1)) + allowCm * 0.1).toFixed(2));
78
+ }
79
+
80
+ export function shopAdviceMeters(meters: number): number {
81
+ const rounded = Math.ceil(meters * 4) / 4;
82
+ return rounded < meters + 0.1 ? rounded + 0.25 : rounded;
83
+ }
84
+
85
+ export function getRulerStep(totalMeters: number): number {
86
+ if (totalMeters <= 1.5) return 0.25;
87
+ if (totalMeters <= 3) return 0.5;
88
+ return 1;
89
+ }
@@ -0,0 +1,40 @@
1
+ ---
2
+ import {
3
+ SEOTitle,
4
+ SEOCard,
5
+ SEOTip,
6
+ SEOList,
7
+ SEOArticle
8
+ } from '@jjlmoya/utils-shared';
9
+ import { fabricProjectCalculator } from './index';
10
+ import type { KnownLocale } from '../../types';
11
+
12
+ interface Props {
13
+ locale?: KnownLocale;
14
+ }
15
+
16
+ const { locale = 'es' } = Astro.props;
17
+ const content = await fabricProjectCalculator.i18n[locale]?.();
18
+ if (!content) return null;
19
+
20
+ const { seo } = content;
21
+ ---
22
+
23
+ <SEOArticle>
24
+ {seo.map((section: any) => {
25
+ switch (section.type) {
26
+ case 'title':
27
+ return <SEOTitle title={section.text} level={section.level || 2} />;
28
+ case 'paragraph':
29
+ return <p set:html={section.html} />;
30
+ case 'list':
31
+ return <SEOList items={section.items} />;
32
+ case 'card':
33
+ return <SEOCard title={section.title} icon={section.icon}><Fragment set:html={section.html} /></SEOCard>;
34
+ case 'tip':
35
+ return <SEOTip title={section.title}><Fragment set:html={section.html} /></SEOTip>;
36
+ default:
37
+ return null;
38
+ }
39
+ })}
40
+ </SEOArticle>
@@ -0,0 +1,57 @@
1
+ export interface FabricProjectCalculatorUI {
2
+ sectionProject: string;
3
+ sectionMaterial: string;
4
+ labelGarmentType: string;
5
+ labelSize: string;
6
+ labelFabricWidth: string;
7
+ labelSeamAllowance: string;
8
+ garmentSkirt: string;
9
+ garmentPants: string;
10
+ garmentDress: string;
11
+ garmentShirt: string;
12
+ garmentCoat: string;
13
+ garmentTote: string;
14
+ garmentMerceria: {
15
+ skirt: string;
16
+ pants: string;
17
+ dress: string;
18
+ shirt: string;
19
+ coat: string;
20
+ tote: string;
21
+ };
22
+ sizeXS: string;
23
+ sizeM: string;
24
+ sizeXL: string;
25
+ width90: string;
26
+ width115: string;
27
+ width140: string;
28
+ width150: string;
29
+ btnClear: string;
30
+ btnShare: string;
31
+ btnCopied: string;
32
+ btnCopyList: string;
33
+ resultLabel: string;
34
+ resultUnit: string;
35
+ shopAdviceFormat: string;
36
+ boardEmpty: string;
37
+ boardDescFormat: string;
38
+ merchTitle: string;
39
+ checklistThread: string;
40
+ warningSerialFormat: string;
41
+ foldLabel: string;
42
+ pieceNames: {
43
+ front: string;
44
+ back: string;
45
+ waistband: string;
46
+ waistbelt: string;
47
+ sleeve: string;
48
+ collar: string;
49
+ cuffs: string;
50
+ facings: string;
51
+ lapels: string;
52
+ pocket: string;
53
+ body: string;
54
+ handleA: string;
55
+ handleB: string;
56
+ };
57
+ }
@@ -0,0 +1,40 @@
1
+ ---
2
+ ---
3
+
4
+ <div class="space-y-4">
5
+ <a
6
+ href="https://www.ftc.gov/business-guidance/resources/textile-fiber-products-guides"
7
+ target="_blank"
8
+ rel="noopener noreferrer"
9
+ class="block p-4 bg-white dark:bg-slate-800 rounded-lg border border-slate-200 dark:border-slate-700 hover:border-indigo-500 dark:hover:border-indigo-400 transition-colors"
10
+ >
11
+ <p class="font-semibold text-slate-900 dark:text-white">FTC - Guía de Etiquetado Textil</p>
12
+ <p class="text-sm text-slate-600 dark:text-slate-400">
13
+ Regulaciones oficiales sobre etiquetado de fibras textiles en EE.UU.
14
+ </p>
15
+ </a>
16
+
17
+ <a
18
+ href="https://ec.europa.eu/growth/tools-databases/nando/"
19
+ target="_blank"
20
+ rel="noopener noreferrer"
21
+ class="block p-4 bg-white dark:bg-slate-800 rounded-lg border border-slate-200 dark:border-slate-700 hover:border-indigo-500 dark:hover:border-indigo-400 transition-colors"
22
+ >
23
+ <p class="font-semibold text-slate-900 dark:text-white">Comisión Europea - Regulación Textil</p>
24
+ <p class="text-sm text-slate-600 dark:text-slate-400">
25
+ Base de datos de regulaciones textiles de la UE
26
+ </p>
27
+ </a>
28
+
29
+ <a
30
+ href="https://www.iso.org/standard/60465.html"
31
+ target="_blank"
32
+ rel="noopener noreferrer"
33
+ class="block p-4 bg-white dark:bg-slate-800 rounded-lg border border-slate-200 dark:border-slate-700 hover:border-indigo-500 dark:hover:border-indigo-400 transition-colors"
34
+ >
35
+ <p class="font-semibold text-slate-900 dark:text-white">ISO 3758:2012 - Símbolos de Cuidado Textil</p>
36
+ <p class="text-sm text-slate-600 dark:text-slate-400">
37
+ Estándar internacional para símbolos de mantenimiento textil
38
+ </p>
39
+ </a>
40
+ </div>