@jjlmoya/utils-cooking 1.10.0 → 1.11.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.
@@ -227,7 +227,7 @@ export const content: ToolLocaleContent = {
227
227
  type: 'diagnostic',
228
228
  variant: 'warning',
229
229
  title: '¿Salsa con Grumaje o Sabor a Harina?',
230
- html: 'Si la salsa tiene grumos, probablemente añadiste líquido caliente a un roux caliente. Aplica el choque térmico (líquido frío sobre roux caliente). Si sabe a harina, aumenta el tiempo de cocción inicial antes de añadir el líquido para gelatinizar el almidón correctamente.',
230
+ html: 'Si la salsa tiene grumos, probablemente añadiste líquido caliente a un roux caliente. Aplica el choque térmico (liquide frío sobre roux caliente). Si sabe a harina, aumenta el tiempo de cocción inicial antes de añadir el líquido para gelatinizar el almidón correctamente.',
231
231
  },
232
232
  {
233
233
  type: 'title',
@@ -284,13 +284,30 @@ export const content: ToolLocaleContent = {
284
284
  butter: 'Mantequilla',
285
285
  flour: 'Harina',
286
286
  instructions: 'Instrucciones',
287
- sauceName: 'Tipo de Salsa',
287
+ sauceName: 'Tipo de Sauce',
288
288
  ratio: 'Ratio',
289
289
  chefTip: 'Tip del Chef',
290
290
  white: 'Blanco',
291
291
  blond: 'Rubio',
292
292
  brown: 'Oscuro',
293
293
  beurreManied: 'Beurre Manié (Si necesitas ajustar al final)',
294
+ recipeBechamel: "Bechamel",
295
+ recipeVeloute: "Velouté",
296
+ recipeEspagnole: "Española",
297
+ recipeTomato: "Salsa de Tomate",
298
+ tipBechamel: "Usa leche fría. Añádela gradualmente al principio o de golpe si bates fuerte.",
299
+ tipVeloute: "Usa fondo de ave o pescado. Deja que el roux huela a galleta antes de ligar.",
300
+ tipEspagnole: "Para salsas oscuras potentes. El roux debe estar color chocolate, pero sin quemarse.",
301
+ tipTomato: "El roux ayudará a dar cuerpo y suavidad a la textura final del tomate.",
302
+ rouxWhiteLabel: "Roux Blanco",
303
+ rouxBlondLabel: "Roux Rubio",
304
+ rouxBrownLabel: "Roux Oscuro",
305
+ descWhite: "Cocina solo hasta perder el olor a harina cruda. Sin color.",
306
+ descBlond: "Busca un color de mantequilla tostada y un aroma a nueces.",
307
+ descBrown: "Fuego muy suave. Color chocolate. Nota: requiere un 10% más de peso.",
308
+ timeWhite: "2-3 min",
309
+ timeBlond: "5-8 min",
310
+ timeBrown: "15-20 min",
294
311
  },
295
- schemas: [faqSchema, howToSchema, appSchema],
312
+ schemas: [faqSchema as any, howToSchema as any, appSchema as any],
296
313
  };
@@ -101,6 +101,23 @@ export const content: ToolLocaleContent = {
101
101
  blond: "Blond",
102
102
  brown: "Brun",
103
103
  beurreManied: "Beurre Manié (Pour ajuster à la fin)",
104
+ recipeBechamel: "Béchamel",
105
+ recipeVeloute: "Velouté",
106
+ recipeEspagnole: "Espagnole",
107
+ recipeTomato: "Sauce Tomate",
108
+ tipBechamel: "Utilisez du lait froid. Ajoutez-le progressivement au début ou d'un coup si vous fouettez vigoureusement.",
109
+ tipVeloute: "Utilisez un fond blanc. Le roux doit sentir le biscuit avant de lier au liquide.",
110
+ tipEspagnole: "Idéal pour les sauces brunes puissantes. Le roux doit être couleur chocolat, sans brûler.",
111
+ tipTomato: "Le roux aidera à donner du corps et de l'onctuosité à la texture finale de la tomate.",
112
+ rouxWhiteLabel: "Roux Blanc",
113
+ rouxBlondLabel: "Roux Blond",
114
+ rouxBrownLabel: "Roux Brun",
115
+ descWhite: "Cuire juste assez pour faire perdre l'odeur de farine crue. Sans coloration.",
116
+ descBlond: "Recherchez une couleur beurre noisette et un léger arôme de noix.",
117
+ descBrown: "Feu très doux. Couleur chocolate. Note : nécessite +10% de poids.",
118
+ timeWhite: "2-3 min",
119
+ timeBlond: "5-8 min",
120
+ timeBrown: "15-20 min",
104
121
  },
105
122
  faqTitle: "Questions Fréquentes sur le Roux",
106
123
  faq: [
@@ -292,5 +309,5 @@ export const content: ToolLocaleContent = {
292
309
  html: "Notre calculateur de roux garantit une consistance technique parfaite pour toutes vos créations culinaires.",
293
310
  },
294
311
  ],
295
- schemas: [faqSchema, howToSchema, appSchema],
312
+ schemas: [faqSchema as any, howToSchema as any, appSchema as any],
296
313
  };
@@ -26,47 +26,6 @@ const VISCOSITY_RATIOS: Record<TextureLevel, number> = {
26
26
  4: 185,
27
27
  };
28
28
 
29
- const LIQUID_CONFIG: Record<LiquidType, LiquidConfig> = {
30
- milk: {
31
- name: 'Béchamel',
32
- rouxType: 'white',
33
- tip: 'Usa leche fría. Añádela gradualmente al principio o de golpe si bates fuerte.',
34
- },
35
- lightStock: {
36
- name: 'Velouté',
37
- rouxType: 'blond',
38
- tip: 'Usa fondo de ave o pescado. Deja que el roux huela a galleta antes de ligar.',
39
- },
40
- darkStock: {
41
- name: 'Espagnole',
42
- rouxType: 'brown',
43
- tip: 'Para salsas oscuras potentes. El roux debe estar color chocolate, pero sin quemarse.',
44
- },
45
- tomato: {
46
- name: 'Salsa de Tomate',
47
- rouxType: 'blond',
48
- tip: 'El roux ayudará a dar cuerpo y suavidad a la textura final del tomate.',
49
- },
50
- };
51
-
52
- const ROUX_INFO: Record<'white' | 'blond' | 'brown', RouxInfo> = {
53
- white: {
54
- label: 'Blanco',
55
- time: '2-3 min',
56
- description: 'Cocina solo hasta perder el olor a harina cruda. Sin color.',
57
- },
58
- blond: {
59
- label: 'Rubio',
60
- time: '5-8 min',
61
- description: 'Busca un color de mantequilla tostada y un aroma a nueces.',
62
- },
63
- brown: {
64
- label: 'Oscuro',
65
- time: '15-20 min',
66
- description: 'Fuego muy suave. Color chocolate. Nota: requiere un 10% más de peso.',
67
- },
68
- };
69
-
70
29
  interface RouxElements {
71
30
  volumeInput: HTMLInputElement;
72
31
  liquidBtns: NodeListOf<Element>;
@@ -124,9 +83,9 @@ function setupLiquidButtons(els: RouxElements, state: State, updateCalculations:
124
83
  els.liquidBtns.forEach((btn) => {
125
84
  btn.addEventListener('click', () => {
126
85
  els.liquidBtns.forEach((b) => {
127
- b.classList.remove('active', 'bg-white', 'dark:bg-slate-700', 'shadow-md', 'ring-2', 'ring-indigo-500/20');
86
+ b.classList.remove('active');
128
87
  });
129
- btn.classList.add('active', 'bg-white', 'dark:bg-slate-700', 'shadow-md', 'ring-2', 'ring-indigo-500/20');
88
+ btn.classList.add('active');
130
89
  state.liquid = (btn as HTMLElement).dataset.type as LiquidType || 'milk';
131
90
  updateCalculations();
132
91
  });
@@ -137,19 +96,16 @@ function setupTextureButtons(els: RouxElements, state: State, updateCalculations
137
96
  els.textureBtns.forEach((btn) => {
138
97
  btn.addEventListener('click', () => {
139
98
  els.textureBtns.forEach((b) => {
140
- b.classList.remove('active', 'border-amber-500/50', 'bg-amber-50', 'dark:bg-amber-900/10');
141
- b.classList.add('border-slate-100', 'dark:border-slate-800', 'bg-white', 'dark:bg-slate-900');
99
+ b.classList.remove('active');
142
100
  });
143
-
144
- btn.classList.remove('border-slate-100', 'dark:border-slate-800', 'bg-white', 'dark:bg-slate-900');
145
- btn.classList.add('active', 'border-amber-500/50', 'bg-amber-50', 'dark:bg-amber-900/10');
101
+ btn.classList.add('active');
146
102
  state.level = parseInt((btn as HTMLElement).dataset.level || '2') as TextureLevel;
147
103
  updateCalculations();
148
104
  });
149
105
  });
150
106
  }
151
107
 
152
- function updateDisplay(els: RouxElements, state: State): void {
108
+ function updateDisplay(els: RouxElements, state: State, LIQUID_CONFIG: Record<LiquidType, LiquidConfig>, ROUX_INFO: Record<'white' | 'blond' | 'brown', RouxInfo>): void {
153
109
  const config = LIQUID_CONFIG[state.liquid];
154
110
  const baseRatio = VISCOSITY_RATIOS[state.level];
155
111
  const liters = state.volume / 1000;
@@ -169,14 +125,61 @@ function updateDisplay(els: RouxElements, state: State): void {
169
125
  els.progressBar.style.width = `${(state.level / 4) * 100}%`;
170
126
  }
171
127
 
172
- export function initRouxGuide(): void {
128
+ function getLiquidConfig(ui: Record<string, string>): Record<LiquidType, LiquidConfig> {
129
+ return {
130
+ milk: {
131
+ name: ui.recipeBechamel as string,
132
+ rouxType: 'white',
133
+ tip: ui.tipBechamel as string,
134
+ },
135
+ lightStock: {
136
+ name: ui.recipeVeloute as string,
137
+ rouxType: 'blond',
138
+ tip: ui.tipVeloute as string,
139
+ },
140
+ darkStock: {
141
+ name: ui.recipeEspagnole as string,
142
+ rouxType: 'brown',
143
+ tip: ui.tipEspagnole as string,
144
+ },
145
+ tomato: {
146
+ name: ui.recipeTomato as string,
147
+ rouxType: 'blond',
148
+ tip: ui.tipTomato as string,
149
+ },
150
+ };
151
+ }
152
+
153
+ function getRouxInfo(ui: Record<string, string>): Record<'white' | 'blond' | 'brown', RouxInfo> {
154
+ return {
155
+ white: {
156
+ label: ui.rouxWhiteLabel as string,
157
+ time: ui.timeWhite as string,
158
+ description: ui.descWhite as string,
159
+ },
160
+ blond: {
161
+ label: ui.rouxBlondLabel as string,
162
+ time: ui.timeBlond as string,
163
+ description: ui.descBlond as string,
164
+ },
165
+ brown: {
166
+ label: ui.rouxBrownLabel as string,
167
+ time: ui.timeBrown as string,
168
+ description: ui.descBrown as string,
169
+ },
170
+ };
171
+ }
172
+
173
+ export function initRouxGuide(ui: Record<string, string>): void {
173
174
  const els = setupElements();
174
175
  if (!els) return;
175
176
 
177
+ const LIQUID_CONFIG = getLiquidConfig(ui);
178
+ const ROUX_INFO = getRouxInfo(ui);
176
179
  const state: State = { volume: 1000, liquid: 'milk', level: 2 };
177
- const updateCalculations = () => updateDisplay(els, state);
180
+ const updateCalculations = () => updateDisplay(els, state, LIQUID_CONFIG, ROUX_INFO);
178
181
 
179
- els.volumeInput.addEventListener('input', (e) => {
182
+ els.volumeInput.addEventListener('input', (e: Event) => {
180
183
  state.volume = parseInt((e.target as HTMLInputElement).value) || 0;
181
184
  updateCalculations();
182
185
  });