contentoh-components-library 21.6.32 → 21.6.33
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.
- package/dist/ai/prompts/attribute.prompt.js +28 -0
- package/dist/ai/prompts/description.prompt.js +33 -0
- package/dist/ai/schemas/attribute.schema.js +35 -0
- package/dist/ai/schemas/description.schema.js +27 -0
- package/dist/components/atoms/InheritanceTag/InheritanceTag.stories.js +5 -5
- package/dist/components/atoms/InheritanceTag/index.js +6 -6
- package/dist/components/organisms/InputGroup/index.js +12 -1
- package/dist/components/organisms/LinkVariantsModal/index.js +269 -356
- package/dist/components/organisms/LinkVariantsModal/styles.js +14 -5
- package/dist/components/organisms/PropagateChangesModal/index.js +12 -13
- package/dist/components/pages/ProviderProductEdition/context/provider-product-edition.context.js +5 -5
- package/dist/components/pages/ProviderProductEdition/context/reducers/inputs.js +5 -2
- package/dist/components/pages/ProviderProductEdition/index.js +76 -33
- package/dist/components/pages/RetailerProductEdition/context/provider-product-edition.context.js +5 -5
- package/dist/components/pages/RetailerProductEdition/context/reducers/inputs.js +5 -2
- package/dist/components/pages/RetailerProductEdition/index.js +75 -35
- package/package.json +1 -1
- package/src/components/atoms/InheritanceTag/InheritanceTag.stories.js +3 -3
- package/src/components/atoms/InheritanceTag/index.js +6 -6
- package/src/components/organisms/InputGroup/index.js +12 -0
- package/src/components/organisms/LinkVariantsModal/index.js +260 -287
- package/src/components/organisms/LinkVariantsModal/styles.js +65 -32
- package/src/components/organisms/PropagateChangesModal/index.js +19 -17
- package/src/components/pages/ProviderProductEdition/context/provider-product-edition.context.jsx +4 -4
- package/src/components/pages/ProviderProductEdition/context/reducers/inputs.js +13 -1
- package/src/components/pages/ProviderProductEdition/index.js +48 -20
- package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +4 -4
- package/src/components/pages/RetailerProductEdition/context/reducers/inputs.js +13 -1
- package/src/components/pages/RetailerProductEdition/index.js +48 -20
|
@@ -0,0 +1,28 @@
|
|
|
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;
|
|
@@ -0,0 +1,33 @@
|
|
|
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;
|
|
@@ -0,0 +1,35 @@
|
|
|
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;
|
|
@@ -0,0 +1,27 @@
|
|
|
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;
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default = exports.PropioSinAccion = exports.Propio = exports.
|
|
8
|
+
exports.default = exports.PropioSinAccion = exports.Propio = exports.NoEsHijo = exports.Heredado = void 0;
|
|
9
9
|
|
|
10
10
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
11
11
|
|
|
@@ -46,11 +46,11 @@ exports.PropioSinAccion = PropioSinAccion;
|
|
|
46
46
|
PropioSinAccion.args = {
|
|
47
47
|
isVariant: true,
|
|
48
48
|
isOverridden: true
|
|
49
|
-
}; // En un producto que no es
|
|
49
|
+
}; // En un producto que no es hijo de nadie no se pinta nada.
|
|
50
50
|
|
|
51
|
-
var
|
|
52
|
-
exports.
|
|
53
|
-
|
|
51
|
+
var NoEsHijo = Template.bind({});
|
|
52
|
+
exports.NoEsHijo = NoEsHijo;
|
|
53
|
+
NoEsHijo.args = {
|
|
54
54
|
isVariant: false,
|
|
55
55
|
isOverridden: true
|
|
56
56
|
};
|
|
@@ -10,9 +10,9 @@ var _styles = require("./styles");
|
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* Marca si el valor de un atributo viene del producto padre o es propio
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* Marca si el valor de un atributo viene del producto padre o es propio del
|
|
14
|
+
* hijo. Solo tiene sentido dentro de un producto hijo: en uno sin padre no se
|
|
15
|
+
* pinta nada, porque no hay de quién heredar.
|
|
16
16
|
*
|
|
17
17
|
* El estado "propio" es el que carga información —ese campo se separó del padre—
|
|
18
18
|
* así que es el que lleva acento y el que ofrece la acción de volver a heredar.
|
|
@@ -20,8 +20,8 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
20
20
|
* la ficha entera se volvería ruido.
|
|
21
21
|
*
|
|
22
22
|
* Un campo VACÍO no lleva marca: no heredó nada y tampoco tiene valor propio, así
|
|
23
|
-
* que llamarlo "Heredado" es falso además de ruidoso. Sin esto la ficha de
|
|
24
|
-
*
|
|
23
|
+
* que llamarlo "Heredado" es falso además de ruidoso. Sin esto la ficha de un
|
|
24
|
+
* hijo sale con el chip repetido en cada campo, incluidos los obligatorios en
|
|
25
25
|
* rojo que están sin capturar, y la marca deja de distinguir nada.
|
|
26
26
|
*
|
|
27
27
|
* Tampoco la lleva un atributo NO heredable. El UPC y el SKU son la identidad del
|
|
@@ -51,7 +51,7 @@ var InheritanceTag = function InheritanceTag(_ref) {
|
|
|
51
51
|
className: "inheritance-tag ".concat(state, " ").concat(className),
|
|
52
52
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
53
53
|
className: "tag-label",
|
|
54
|
-
title: isOverridden ? "Valor propio de
|
|
54
|
+
title: isOverridden ? "Valor propio de este producto hijo. La propagación del padre no lo modifica." : "Valor heredado".concat(parentUpc ? " del producto ".concat(parentUpc) : " del producto padre", "."),
|
|
55
55
|
children: isOverridden ? "Propio" : "Heredado"
|
|
56
56
|
}), isOverridden && onRestore && /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
57
57
|
type: "button",
|
|
@@ -185,7 +185,7 @@ var InputGroup = function InputGroup(_ref) {
|
|
|
185
185
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
186
186
|
className: "inputs-container",
|
|
187
187
|
children: inputGroup === null || inputGroup === void 0 ? void 0 : (_inputGroup$inputs = inputGroup.inputs) === null || _inputGroup$inputs === void 0 ? void 0 : _inputGroup$inputs.map(function (input, index) {
|
|
188
|
-
var _dataInputs$input, _dataInputs$input2, _dataInputs$input3, _dataInputs$input4, _dataInputs$input5, _dataInputs$input6, _dataInputs$input7, _dataInputs$input8, _dataInputs$input9, _dataInputs$input10, _dataInputs$input11, _dataInputs$input12, _dataInputs$input13, _dataInputs$input14, _dataInputs$input15, _dataInputs$input16, _auditInputs$input, _dataInputs$input17, _dataInputs$input18, _dataInputs$input19, _dataInputs$input20, _dataInputs$input21, _dataInputs$input22, _dataInputs$input23, _dataInputs$input24, _dataInputs$input25, _variant$parent, _auditInputGroup$inpu, _auditInputGroup$inpu2;
|
|
188
|
+
var _dataInputs$input, _dataInputs$input2, _dataInputs$input3, _dataInputs$input4, _dataInputs$input5, _dataInputs$input6, _dataInputs$input7, _dataInputs$input8, _dataInputs$input9, _dataInputs$input10, _dataInputs$input11, _dataInputs$input12, _dataInputs$input13, _dataInputs$input14, _dataInputs$input15, _dataInputs$input16, _auditInputs$input, _dataInputs$input17, _dataInputs$input18, _dataInputs$input19, _dataInputs$input20, _dataInputs$input21, _dataInputs$input22, _dataInputs$input23, _dataInputs$input24, _dataInputs$input25, _variant$parent, _auditInputGroup$inpu, _variant$parent2, _auditInputGroup$inpu2;
|
|
189
189
|
|
|
190
190
|
return activeSection === "Ficha técnica" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
191
191
|
className: ((_dataInputs$input = dataInputs[input]) === null || _dataInputs$input === void 0 ? void 0 : _dataInputs$input.id) === 6700 || ((_dataInputs$input2 = dataInputs[input]) === null || _dataInputs$input2 === void 0 ? void 0 : _dataInputs$input2.id) === 6701 ? "inputs-validation-onboarding" : "inputs-validation",
|
|
@@ -249,6 +249,17 @@ var InputGroup = function InputGroup(_ref) {
|
|
|
249
249
|
dinamicHeight: dinamicHeight,
|
|
250
250
|
description: input === null || input === void 0 ? void 0 : input.description,
|
|
251
251
|
showTooltip: true,
|
|
252
|
+
isVariant: variant === null || variant === void 0 ? void 0 : variant.isVariant,
|
|
253
|
+
isOverridden: input === null || input === void 0 ? void 0 : input.isOverridden,
|
|
254
|
+
inheritable: input === null || input === void 0 ? void 0 : input.inheritable,
|
|
255
|
+
parentUpc: variant === null || variant === void 0 ? void 0 : (_variant$parent2 = variant.parent) === null || _variant$parent2 === void 0 ? void 0 : _variant$parent2.upc
|
|
256
|
+
/* Las descripciones viven en otra tabla que la ficha
|
|
257
|
+
técnica, así que restore necesita saber cuál de las dos
|
|
258
|
+
listas está recibiendo. */
|
|
259
|
+
,
|
|
260
|
+
onRestoreInheritance: onRestoreInheritance ? function (id) {
|
|
261
|
+
return onRestoreInheritance(id, "description");
|
|
262
|
+
} : undefined,
|
|
252
263
|
auditClass: compare && !isEquals(input === null || input === void 0 ? void 0 : input.value, auditInputGroup === null || auditInputGroup === void 0 ? void 0 : (_auditInputGroup$inpu2 = auditInputGroup.inputs[index]) === null || _auditInputGroup$inpu2 === void 0 ? void 0 : _auditInputGroup$inpu2.value) ? "audit-class" : ""
|
|
253
264
|
}, index + "-" + (input === null || input === void 0 ? void 0 : input.value) + "-" + compare)]
|
|
254
265
|
});
|