contentoh-components-library 21.6.19 → 21.6.21

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 (28) hide show
  1. package/.env.test +2 -1
  2. package/dist/components/atoms/InheritanceTag/index.js +8 -0
  3. package/dist/components/molecules/TagAndInput/index.js +1 -0
  4. package/dist/components/molecules/TagAndInputv2/index.js +1 -0
  5. package/dist/components/organisms/LinkVariantsModal/api.js +102 -0
  6. package/dist/components/organisms/LinkVariantsModal/index.js +620 -0
  7. package/dist/components/organisms/LinkVariantsModal/styles.js +60 -0
  8. package/dist/components/pages/ProviderProductEdition/context/reducers/inputs.js +8 -2
  9. package/dist/components/pages/ProviderProductEdition/index.js +198 -89
  10. package/dist/components/pages/ProviderProductEdition/styles.js +2 -2
  11. package/dist/components/pages/ProviderProductEdition/utils.js +8 -0
  12. package/dist/index.js +25 -12
  13. package/package.json +1 -1
  14. package/src/components/atoms/InheritanceTag/index.js +7 -0
  15. package/src/components/molecules/TagAndInput/index.js +1 -0
  16. package/src/components/molecules/TagAndInputv2/index.js +1 -0
  17. package/src/components/organisms/LinkVariantsModal/api.js +61 -0
  18. package/src/components/organisms/LinkVariantsModal/index.js +479 -0
  19. package/src/components/organisms/LinkVariantsModal/styles.js +264 -0
  20. package/src/components/pages/ProviderProductEdition/context/reducers/inputs.js +21 -13
  21. package/src/components/pages/ProviderProductEdition/index.js +76 -0
  22. package/src/components/pages/ProviderProductEdition/styles.js +23 -0
  23. package/src/components/pages/ProviderProductEdition/utils.js +8 -0
  24. package/src/index.js +1 -0
  25. package/dist/ai/prompts/attribute.prompt.js +0 -28
  26. package/dist/ai/prompts/description.prompt.js +0 -33
  27. package/dist/ai/schemas/attribute.schema.js +0 -35
  28. package/dist/ai/schemas/description.schema.js +0 -27
@@ -0,0 +1,264 @@
1
+ import styled from "styled-components";
2
+ import "../../../global-files/global-styles.css";
3
+ import { GlobalColors, FontFamily } from "../../../global-files/variables";
4
+
5
+ export const Overlay = styled.div`
6
+ position: fixed;
7
+ inset: 0;
8
+ z-index: 100;
9
+ display: flex;
10
+ align-items: center;
11
+ justify-content: center;
12
+ background-color: rgba(40, 31, 51, 0.45);
13
+ `;
14
+
15
+ export const Panel = styled.div`
16
+ display: flex;
17
+ flex-direction: column;
18
+ width: min(680px, 92vw);
19
+ max-height: 86vh;
20
+ border-radius: 10px;
21
+ background-color: ${GlobalColors.white};
22
+ font-family: ${FontFamily.Raleway};
23
+ overflow: hidden;
24
+ `;
25
+
26
+ export const Header = styled.div`
27
+ display: flex;
28
+ align-items: flex-start;
29
+ justify-content: space-between;
30
+ gap: 16px;
31
+ padding: 20px 24px 12px;
32
+
33
+ h2 {
34
+ margin: 0;
35
+ font-family: ${FontFamily.Raleway_700};
36
+ font-size: 16px;
37
+ color: ${GlobalColors.deep_gray};
38
+ }
39
+
40
+ p {
41
+ margin: 4px 0 0;
42
+ font-size: 12px;
43
+ color: ${GlobalColors.gray};
44
+ }
45
+
46
+ .close {
47
+ border: none;
48
+ background: none;
49
+ cursor: pointer;
50
+ font-size: 20px;
51
+ line-height: 1;
52
+ color: ${GlobalColors.gray};
53
+ }
54
+ `;
55
+
56
+ export const ModeSwitch = styled.div`
57
+ display: flex;
58
+ gap: 8px;
59
+ padding: 0 24px 16px;
60
+
61
+ button {
62
+ flex: 1;
63
+ padding: 10px 12px;
64
+ border-radius: 6px;
65
+ border: 1px solid ${GlobalColors.s2};
66
+ background-color: ${GlobalColors.white};
67
+ font-family: ${FontFamily.Raleway_600};
68
+ font-size: 12px;
69
+ color: ${GlobalColors.gray};
70
+ cursor: pointer;
71
+ text-align: left;
72
+ }
73
+
74
+ button.active {
75
+ border-color: ${GlobalColors.original_magenta};
76
+ color: ${GlobalColors.original_magenta};
77
+ background-color: rgba(${GlobalColors.rgb_color_pink}, 0.08);
78
+ }
79
+ `;
80
+
81
+ export const Body = styled.div`
82
+ flex: 1;
83
+ overflow-y: auto;
84
+ padding: 0 24px;
85
+ `;
86
+
87
+ export const SearchRow = styled.form`
88
+ display: flex;
89
+ gap: 8px;
90
+ margin-bottom: 12px;
91
+
92
+ input {
93
+ flex: 1;
94
+ height: 36px;
95
+ padding: 0 12px;
96
+ border: 1px solid ${GlobalColors.s2};
97
+ border-radius: 6px;
98
+ font-family: ${FontFamily.Raleway};
99
+ font-size: 12px;
100
+ color: ${GlobalColors.deep_gray};
101
+ }
102
+
103
+ button {
104
+ height: 36px;
105
+ padding: 0 18px;
106
+ border: none;
107
+ border-radius: 6px;
108
+ background-color: ${GlobalColors.original_magenta};
109
+ color: ${GlobalColors.white};
110
+ font-family: ${FontFamily.Raleway_600};
111
+ font-size: 12px;
112
+ cursor: pointer;
113
+ }
114
+
115
+ button:disabled {
116
+ opacity: 0.5;
117
+ cursor: default;
118
+ }
119
+ `;
120
+
121
+ export const List = styled.ul`
122
+ list-style: none;
123
+ margin: 0 0 16px;
124
+ padding: 0;
125
+ border: 1px solid ${GlobalColors.s2};
126
+ border-radius: 6px;
127
+
128
+ li + li {
129
+ border-top: 1px solid ${GlobalColors.s2};
130
+ }
131
+
132
+ label {
133
+ display: flex;
134
+ align-items: center;
135
+ gap: 10px;
136
+ padding: 10px 12px;
137
+ cursor: pointer;
138
+ font-size: 12px;
139
+ color: ${GlobalColors.deep_gray};
140
+ }
141
+
142
+ .meta {
143
+ display: block;
144
+ font-size: 11px;
145
+ color: ${GlobalColors.gray};
146
+ }
147
+
148
+ .count {
149
+ margin-left: auto;
150
+ font-size: 11px;
151
+ color: ${GlobalColors.original_magenta};
152
+ white-space: nowrap;
153
+ }
154
+ `;
155
+
156
+ export const AttributeList = styled(List)`
157
+ max-height: 220px;
158
+ overflow-y: auto;
159
+
160
+ .note {
161
+ display: block;
162
+ font-size: 10px;
163
+ font-style: italic;
164
+ color: ${GlobalColors.gray};
165
+ }
166
+
167
+ .value {
168
+ margin-left: auto;
169
+ max-width: 45%;
170
+ font-size: 11px;
171
+ color: ${GlobalColors.gray};
172
+ overflow: hidden;
173
+ text-overflow: ellipsis;
174
+ white-space: nowrap;
175
+ }
176
+ `;
177
+
178
+ export const Section = styled.div`
179
+ margin-bottom: 16px;
180
+
181
+ h3 {
182
+ margin: 0 0 8px;
183
+ font-family: ${FontFamily.Raleway_600};
184
+ font-size: 13px;
185
+ color: ${GlobalColors.deep_gray};
186
+ }
187
+
188
+ label.choice {
189
+ display: flex;
190
+ align-items: flex-start;
191
+ gap: 8px;
192
+ padding: 6px 0;
193
+ font-size: 12px;
194
+ color: ${GlobalColors.deep_gray};
195
+ cursor: pointer;
196
+ }
197
+
198
+ label.choice span.hint {
199
+ display: block;
200
+ font-size: 11px;
201
+ color: ${GlobalColors.gray};
202
+ }
203
+ `;
204
+
205
+ export const Message = styled.p`
206
+ margin: 0 0 12px;
207
+ padding: 10px 12px;
208
+ border-radius: 6px;
209
+ font-size: 12px;
210
+ line-height: 1.4;
211
+ background-color: ${GlobalColors.s2};
212
+ color: ${GlobalColors.deep_gray};
213
+
214
+ &.error {
215
+ background-color: rgba(${GlobalColors.rgb_color_pink}, 0.1);
216
+ color: ${GlobalColors.original_magenta};
217
+ }
218
+ `;
219
+
220
+ export const Footer = styled.div`
221
+ display: flex;
222
+ align-items: center;
223
+ justify-content: space-between;
224
+ gap: 12px;
225
+ padding: 16px 24px;
226
+ border-top: 1px solid ${GlobalColors.s2};
227
+
228
+ .summary {
229
+ font-size: 12px;
230
+ color: ${GlobalColors.gray};
231
+ }
232
+
233
+ .actions {
234
+ display: flex;
235
+ gap: 8px;
236
+ margin-left: auto;
237
+ }
238
+
239
+ button {
240
+ height: 36px;
241
+ padding: 0 18px;
242
+ border-radius: 6px;
243
+ font-family: ${FontFamily.Raleway_600};
244
+ font-size: 12px;
245
+ cursor: pointer;
246
+ }
247
+
248
+ button.secondary {
249
+ border: 1px solid ${GlobalColors.s2};
250
+ background-color: ${GlobalColors.white};
251
+ color: ${GlobalColors.gray};
252
+ }
253
+
254
+ button.primary {
255
+ border: none;
256
+ background-color: ${GlobalColors.original_magenta};
257
+ color: ${GlobalColors.white};
258
+ }
259
+
260
+ button:disabled {
261
+ opacity: 0.5;
262
+ cursor: default;
263
+ }
264
+ `;
@@ -92,7 +92,7 @@ export const inputsReducer = (state, action) => {
92
92
  ...state.services.datasheets.inputs,
93
93
  };
94
94
 
95
- action.payload.forEach(({ attributeId, value }) => {
95
+ action.payload.forEach(({ attributeId, value, isOverridden }) => {
96
96
  const key = `${attributeId}_${retailerId}`;
97
97
 
98
98
  if (!updatedServiceInputs[key]) return;
@@ -100,6 +100,10 @@ export const inputsReducer = (state, action) => {
100
100
  updatedServiceInputs[key] = {
101
101
  ...updatedServiceInputs[key],
102
102
  value,
103
+ // Opcional a propósito: quien solo cambia el valor no toca la marca de
104
+ // herencia. La usa "Volver a heredar", que sí necesita devolver el
105
+ // atributo a heredado para que el chip deje de decir "Propio".
106
+ ...(isOverridden === undefined ? {} : { isOverridden }),
103
107
  };
104
108
  });
105
109
 
@@ -110,18 +114,22 @@ export const inputsReducer = (state, action) => {
110
114
 
111
115
  return {
112
116
  ...group,
113
- ...action.payload.reduce((acc, { attributeId, value }) => {
114
- const key = `${attributeId}_${retailerId}`;
115
-
116
- if (!group[key]) return acc;
117
-
118
- acc[key] = {
119
- ...group[key],
120
- value,
121
- };
122
-
123
- return acc;
124
- }, {}),
117
+ ...action.payload.reduce(
118
+ (acc, { attributeId, value, isOverridden }) => {
119
+ const key = `${attributeId}_${retailerId}`;
120
+
121
+ if (!group[key]) return acc;
122
+
123
+ acc[key] = {
124
+ ...group[key],
125
+ value,
126
+ ...(isOverridden === undefined ? {} : { isOverridden }),
127
+ };
128
+
129
+ return acc;
130
+ },
131
+ {}
132
+ ),
125
133
  };
126
134
  }
127
135
  );
@@ -34,6 +34,8 @@ import { FullTabsMenu } from "../../organisms/FullTabsMenu";
34
34
  import { ImageDataTable } from "../../organisms/ImageDataTable";
35
35
  import { ImagePreviewer } from "../../organisms/ImagePreviewer";
36
36
  import { InputGroup } from "../../organisms/InputGroup";
37
+ import { LinkVariantsModal } from "../../organisms/LinkVariantsModal";
38
+ import { readPayload } from "../../organisms/LinkVariantsModal/api";
37
39
  import { ProductImageModal } from "../../organisms/ProductImageModal";
38
40
  import { VersionSelector } from "../../organisms/VersionSelector";
39
41
  import { Modal } from "../../organisms/Modal";
@@ -73,6 +75,7 @@ const ProviderProductEditionView = ({
73
75
 
74
76
  const [boxData, setBoxData] = useState(null);
75
77
  const [showModal, setShowModal] = useState(false);
78
+ const [showLinkVariants, setShowLinkVariants] = useState(false);
76
79
  const [showRejectModal, setShowRejectModal] = useState(false);
77
80
  const [headerTop, setHeaderTop] = useState(0);
78
81
  const [assig, setAssig] = useState({});
@@ -694,6 +697,44 @@ const ProviderProductEditionView = ({
694
697
  });
695
698
  };
696
699
 
700
+ /*
701
+ Acción "Volver a heredar del producto" de los chips de herencia.
702
+
703
+ La inicia la variante, no el padre, y descarta un valor capturado a mano: por
704
+ eso el endpoint exige la lista explícita de atributos y no acepta un "todos"
705
+ implícito.
706
+
707
+ El repintado es en sitio, con lo que devuelve el propio endpoint. La
708
+ alternativa —recargar la ficha— se llevaría por delante lo que el usuario
709
+ tenga sin guardar en las otras pestañas.
710
+ */
711
+ const handleOnRestoreInheritance = async (attributeId) => {
712
+ if (!attributeId || !state.product?.id_article) return;
713
+
714
+ try {
715
+ const res = await axios.post(
716
+ `${process.env.REACT_APP_VARIANTS_ENDPOINT}/restore`,
717
+ { articleId: state.product.id_article, attributes: [Number(attributeId)] },
718
+ { headers: { Authorization: token } }
719
+ );
720
+
721
+ // El API responde 200 aunque la lambda haya devuelto 400: el resultado
722
+ // real viaja en el cuerpo y readPayload lo convierte en excepción.
723
+ const data = readPayload(res);
724
+
725
+ dispatch({
726
+ type: "UPDATE_DATASHEETS_INPUTS",
727
+ payload: (data.values || []).map((item) => ({
728
+ attributeId: item.id,
729
+ value: item.value,
730
+ isOverridden: 0,
731
+ })),
732
+ });
733
+ } catch (error) {
734
+ console.error("restoreInheritance: ", error);
735
+ }
736
+ };
737
+
697
738
  const handleOnSetSelectedImages = () => {
698
739
  /*
699
740
  Esta función no se utiliza actualmente.
@@ -1143,6 +1184,17 @@ const ProviderProductEditionView = ({
1143
1184
  jwt={token}
1144
1185
  />
1145
1186
  )}
1187
+ {showLinkVariants && (
1188
+ <LinkVariantsModal
1189
+ articleId={state.product?.id_article}
1190
+ articleName={state.product?.name}
1191
+ articleUpc={state.product?.upc}
1192
+ activeRetailerId={state.active_retailer?.id_retailer}
1193
+ token={token}
1194
+ onClose={() => setShowLinkVariants(false)}
1195
+ onLinked={() => window.location.reload()}
1196
+ />
1197
+ )}
1146
1198
  {showModal && (
1147
1199
  <ProductImageModal
1148
1200
  images={state.images_values}
@@ -1329,6 +1381,27 @@ const ProviderProductEditionView = ({
1329
1381
  </div>
1330
1382
  <div className="product-information">
1331
1383
  <div className="product-information">
1384
+ {/* Solo cuando el producto NO es ya variante de alguien: ligarlo
1385
+ otra vez devolvería VARIANT_ALREADY_LINKED sin excepción, y un
1386
+ botón que siempre falla es peor que no tenerlo. Para salir de
1387
+ una familia está la desvinculación, no este botón. */}
1388
+ {!state.product?.parentArticleId && (
1389
+ <div className="variants-actions">
1390
+ <button
1391
+ type="button"
1392
+ className="link-variants"
1393
+ onClick={() => setShowLinkVariants(true)}
1394
+ >
1395
+ Ligar productos
1396
+ </button>
1397
+ {state.product?.variantsCount > 0 && (
1398
+ <span className="variants-count">
1399
+ {state.product.variantsCount} variante
1400
+ {state.product.variantsCount === 1 ? "" : "s"}
1401
+ </span>
1402
+ )}
1403
+ </div>
1404
+ )}
1332
1405
  <FullProductNameHeader
1333
1406
  headerData={state.product}
1334
1407
  percent={state.active_percentage?.percentagesGeneral?.required}
@@ -1434,6 +1507,9 @@ const ProviderProductEditionView = ({
1434
1507
  inputGroup={dataGroup}
1435
1508
  dataInputs={state.datasheets_inputs[1] ?? []}
1436
1509
  variant={state.services?.datasheets?.variant}
1510
+ onRestoreInheritance={
1511
+ handleOnRestoreInheritance
1512
+ }
1437
1513
  activeRetailer={
1438
1514
  state.services.datasheets[
1439
1515
  state.active_retailer.id_retailer
@@ -160,4 +160,27 @@ export const Container = styled.div`
160
160
  }
161
161
  }
162
162
  }
163
+ .variants-actions {
164
+ display: flex;
165
+ align-items: center;
166
+ gap: 10px;
167
+ margin-bottom: 8px;
168
+
169
+ .link-variants {
170
+ border: 1px solid ${GlobalColors.original_magenta};
171
+ border-radius: 6px;
172
+ background: none;
173
+ padding: 6px 12px;
174
+ font-family: ${FontFamily.Raleway_600};
175
+ font-size: 11px;
176
+ color: ${GlobalColors.original_magenta};
177
+ cursor: pointer;
178
+ }
179
+
180
+ .variants-count {
181
+ font-family: ${FontFamily.Raleway_500};
182
+ font-size: 11px;
183
+ color: ${GlobalColors.gray};
184
+ }
185
+ }
163
186
  `;
@@ -48,6 +48,14 @@ export const normalizeProduct = (product) => {
48
48
  summary: productData.summary || null,
49
49
  version: productData.version || 0,
50
50
 
51
+ // Parentesco. read-articles-v2 ya lo devuelve; sin arrastrarlo hasta aquí la
52
+ // pantalla de edición no puede saber si el producto pertenece a una familia.
53
+ // Ojo con `?? null` en vez de `|| null`: variantsCount 0 es un dato válido.
54
+ parentArticleId:
55
+ productData.parentArticleId ?? article.parentArticleId ?? null,
56
+ parent: productData.parent ?? article.parent ?? null,
57
+ variantsCount: productData.variantsCount ?? article.variantsCount ?? 0,
58
+
51
59
  // from tasks
52
60
  id_order: productData.orderId || null,
53
61
  status: productData.statusByRetailer
package/src/index.js CHANGED
@@ -86,6 +86,7 @@ export * from "./components/organisms/ImageDataTable/index";
86
86
  export * from "./components/organisms/ImagePreviewer/index";
87
87
  export * from "./components/organisms/ImagesGroup/index";
88
88
  export * from "./components/organisms/InputGroup/index";
89
+ export * from "./components/organisms/LinkVariantsModal/index";
89
90
  export * from "./components/organisms/ProductImageModal/index";
90
91
  export * from "./components/organisms/Chat/index";
91
92
  export * from "./components/organisms/Modal/index";
@@ -1,28 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.generateAttributePrompt = void 0;
7
-
8
- var generateAttributePrompt = function generateAttributePrompt(_ref) {
9
- var _ref$upc = _ref.upc,
10
- upc = _ref$upc === void 0 ? 0 : _ref$upc,
11
- _ref$inputName = _ref.inputName,
12
- inputName = _ref$inputName === void 0 ? "" : _ref$inputName,
13
- _ref$description = _ref.description,
14
- description = _ref$description === void 0 ? "" : _ref$description,
15
- _ref$currentValue = _ref.currentValue,
16
- currentValue = _ref$currentValue === void 0 ? "" : _ref$currentValue,
17
- _ref$name = _ref.name,
18
- name = _ref$name === void 0 ? "" : _ref$name,
19
- _ref$category = _ref.category,
20
- category = _ref$category === void 0 ? "" : _ref$category,
21
- _ref$retailer = _ref.retailer,
22
- retailer = _ref$retailer === void 0 ? "" : _ref$retailer,
23
- _ref$maxChar = _ref.maxChar,
24
- maxChar = _ref$maxChar === void 0 ? 100 : _ref$maxChar;
25
- return "\n Eres un especialista en la generaci\xF3n, optimizaci\xF3n, mejora y captura de atributos de la ficha t\xE9cnica de productos para cat\xE1logos en l\xEDnea.\n Tu tarea es crear atributos claros, concisos y relevantes que resalten las caracter\xEDsticas y beneficios del producto, utilizando un lenguaje preciso y adaptado al p\xFAblico objetivo.\n\n Datos del producto:\n - UPC: ".concat(upc, "\n - Nombre del producto: ").concat(name, "\n - Categor\xEDa: ").concat(category, "\n - Nombre del atributo: ").concat(inputName, "\n - Requerimiento del atributo: ").concat(description, "\n - Valor actual del atributo: ").concat(currentValue, "\n - Cadena comercial dirigida: ").concat(retailer, "\n\n Instrucciones:\n 1. Analiza el nombre del producto y la categor\xEDa para entender su contexto.\n 2. Analiza la descripci\xF3n del atributo actual del producto.\n 3. Identifica la informaci\xF3n clave del atributo que sean relevantes y \xFAtiles para los clientes potenciales.\n 4. Genera una lista de atributos que:\n - Cumplan con la descripcion del atributo proporcionada, no inventes datos o cambies el contexto de lo que pide la descripci\xF3n del atributo.\n - Sean claros y f\xE1ciles de entender.\n - Destaquen las caracter\xEDsticas y beneficios clave del producto.\n - Utilicen un lenguaje preciso y adaptado al p\xFAblico objetivo.\n - Mantengan un tono profesional y coherente con la marca.\n - Aumenten la probabilidad de compra del producto.\n - No excedan los ").concat(maxChar, " caracteres en total.\n - Si existe ejemplo en la descripci\xF3n del atributo, sigue el mismo formato para generar los atributos.\n 5. No incluyas emojis ni signos especiales (*/+\xB4!\xA1?\xBF)\n 6. No repitas el encabezado: ").concat(inputName, "\n 7. No incluyas call to action, ejemplo: \"!Compra ya!\" \"!Da click!\" \"!Apurate!\"\n\n Aseg\xFArate de que los atributos generados cumplan con todas las instrucciones proporcionadas.\n\n No lo olvides, el objetivo principal es mejorar la captura de atributos para la ficha t\xE9cnica del producto para atraer, convencer y dar la informaci\xF3n completa a los clientes potenciales que puedan realizar una compra.\n ");
26
- };
27
-
28
- exports.generateAttributePrompt = generateAttributePrompt;
@@ -1,33 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.generateDescriptionPrompt = void 0;
7
-
8
- // Cadena y Proveedor
9
-
10
- /**
11
- * La cadena ${cadena} tiene estas reglas ${reglas} para el tipo de descripcion que es: ${descripcion}
12
- */
13
- var generateDescriptionPrompt = function generateDescriptionPrompt(_ref) {
14
- var _ref$upc = _ref.upc,
15
- upc = _ref$upc === void 0 ? 0 : _ref$upc,
16
- _ref$inputName = _ref.inputName,
17
- inputName = _ref$inputName === void 0 ? "" : _ref$inputName,
18
- _ref$description = _ref.description,
19
- description = _ref$description === void 0 ? "" : _ref$description,
20
- _ref$currentValue = _ref.currentValue,
21
- currentValue = _ref$currentValue === void 0 ? "" : _ref$currentValue,
22
- _ref$name = _ref.name,
23
- name = _ref$name === void 0 ? "" : _ref$name,
24
- _ref$category = _ref.category,
25
- category = _ref$category === void 0 ? "" : _ref$category,
26
- _ref$retailer = _ref.retailer,
27
- retailer = _ref$retailer === void 0 ? "" : _ref$retailer,
28
- _ref$maxChar = _ref.maxChar,
29
- maxChar = _ref$maxChar === void 0 ? 100 : _ref$maxChar;
30
- return "\n Eres un especialista en la generaci\xF3n, optimizaci\xF3n y mejora de descripciones de productos para cat\xE1logos en l\xEDnea.\n Tu tarea es crear descripciones claras, concisas y atractivas que resalten las caracter\xEDsticas y beneficios del producto, utilizando un lenguaje persuasivo y adaptado al p\xFAblico objetivo.\n\n Datos del producto:\n - UPC: ".concat(upc, "\n - Nombre del producto: ").concat(name, "\n - Categor\xEDa: ").concat(category, "\n - Encabezado de la descripci\xF3n: ").concat(inputName, "\n - Requerimiento de la descripcion: ").concat(description, "\n - Descripcion actual del producto: ").concat(currentValue, "\n - Cadena comercial dirigida: ").concat(retailer, "\n\n Instrucciones:\n 1. Analiza la descripci\xF3n actual del producto en caso de tenerla.\n 2. Identifica \xE1reas de mejora, como claridad, concisi\xF3n, atractivo y relevancia.\n 3. Genera una descripci\xF3n que:\n - Sea clara y f\xE1cil de entender.\n - Destaque las caracter\xEDsticas y beneficios clave del producto.\n - Utilice un lenguaje persuasivo y adaptado al p\xFAblico objetivo.\n - Mantenga un tono profesional y coherente con la marca.\n - No exceda los ").concat(maxChar, " caracteres.\n - Aumente la probabilidad de compra del producto, utilizando persuasi\xF3n en la necesidad de compra del producto.\n 4. No incluyas emojis ni signos especiales (*/+\xB4!\xA1?\xBF)\n 5. No repitas el encabezado: ").concat(inputName, "\n 6. No incluyas call to action, ejemplo: \"!Compra ya!\" \"!Da click!\" \"!Apurate!\"\n\n\n Aseg\xFArate de que la descripci\xF3n generada cumpla con todas las instrucciones proporcionadas.\n\n No lo olvides, el objetivo principal es mejorar la descripci\xF3n del producto para atraer y convencer a los clientes potenciales de realizar una compra. Eres un experto en marketing y redacci\xF3n persuasiva.\n\n Nota: No estas hablando con los clientes, estas descripciones ir\xE1n en la tienda de E-commerce de la cadena comercial. No realices saludos, despedidas, sugerencias\n ");
31
- };
32
-
33
- exports.generateDescriptionPrompt = generateDescriptionPrompt;
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var schema = {
8
- type: "object",
9
- properties: {
10
- results: {
11
- type: "array",
12
- items: {
13
- type: "object",
14
- properties: {
15
- label: {
16
- type: "string"
17
- },
18
- value: {
19
- type: "string"
20
- }
21
- }
22
- },
23
- maxItems: 3
24
- },
25
- compliance_warnings: {
26
- type: "array",
27
- items: {
28
- type: "string"
29
- }
30
- }
31
- },
32
- required: ["results"]
33
- };
34
- var _default = schema;
35
- exports.default = _default;
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var schema = {
8
- type: "object",
9
- properties: {
10
- results: {
11
- type: "array",
12
- items: {
13
- type: "object",
14
- properties: {
15
- value: {
16
- type: "string"
17
- }
18
- }
19
- },
20
- minItems: 1,
21
- maxItems: 3
22
- }
23
- },
24
- required: ["results"]
25
- };
26
- var _default = schema;
27
- exports.default = _default;