contentoh-components-library 21.6.59 → 21.6.61
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/components/organisms/ServicesNavigation/ServiceToolbar.js +210 -0
- package/dist/components/organisms/ServicesNavigation/ServicesNavigation.stories.js +138 -0
- package/dist/components/organisms/ServicesNavigation/ServicesRail.js +705 -0
- package/dist/components/organisms/ServicesNavigation/catalog.js +505 -0
- package/dist/components/organisms/ServicesNavigation/index.js +337 -0
- package/dist/components/organisms/ServicesNavigation/model.js +167 -0
- package/dist/components/organisms/ServicesNavigation/ui.js +371 -0
- package/dist/components/organisms/ServicesNavigation/views.js +1237 -0
- package/dist/components/organisms/ServicesWorkspace/AssigneePicker.js +459 -0
- package/dist/components/organisms/ServicesWorkspace/ServicesWorkspace.stories.js +119 -0
- package/dist/components/organisms/ServicesWorkspace/demo.js +137 -0
- package/dist/components/organisms/ServicesWorkspace/index.js +813 -0
- package/dist/components/organisms/ServicesWorkspace/servicesModel.js +351 -0
- package/dist/components/organisms/ServicesWorkspace/tooltipStyles.js +37 -0
- package/dist/components/pages/CreatorsProductEdition/mocks/mockApi.js +40 -0
- package/dist/components/pages/CreatorsProductEdition/mocks/productServices.fixtures.js +387 -0
- package/dist/components/pages/CreatorsProductEdition/sections/StatusChip.js +13 -4
- package/dist/components/pages/ProductEdition/ProductEdition.stories.js +148 -0
- package/dist/components/pages/ProductEdition/ProductEditionView.js +1355 -0
- package/dist/components/pages/ProductEdition/ServiceHeader.js +142 -0
- package/dist/components/pages/ProductEdition/api.js +256 -0
- package/dist/components/pages/ProductEdition/index.js +37 -0
- package/dist/components/pages/ProductEdition/permissions.js +200 -0
- package/dist/components/pages/ProductEdition/permissions.test.js +320 -0
- package/dist/components/pages/ProductEdition/sections/CatalogServicePanel.js +237 -0
- package/dist/components/pages/ProductEdition/sections/EditionTopBar.js +174 -0
- package/dist/components/pages/ProductEdition/sections/ImagePanel.js +440 -0
- package/dist/components/pages/ProductEdition/sections/ServiceTeam.js +275 -0
- package/dist/components/pages/ProductEdition/sections/ServiceTools.js +186 -0
- package/dist/components/pages/ProductEdition/services.js +233 -0
- package/dist/components/pages/ProductEdition/services.test.js +195 -0
- package/dist/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +15 -2
- package/dist/components/pages/RetailerProductEdition/context/provider-product-edition.context.js +2 -2
- package/dist/components/pages/RetailerProductEdition/index.js +57 -40
- package/dist/components/pages/RetailerProductEdition/utils.js +6 -2
- package/dist/index.js +13 -0
- package/package.json +1 -1
- package/src/components/organisms/ServicesNavigation/ServiceToolbar.jsx +143 -0
- package/src/components/organisms/ServicesNavigation/ServicesNavigation.stories.js +101 -0
- package/src/components/organisms/ServicesNavigation/ServicesRail.jsx +591 -0
- package/src/components/organisms/ServicesNavigation/catalog.js +180 -0
- package/src/components/organisms/ServicesNavigation/index.jsx +232 -0
- package/src/components/organisms/ServicesNavigation/model.js +85 -0
- package/src/components/organisms/ServicesNavigation/ui.jsx +229 -0
- package/src/components/organisms/ServicesNavigation/views.jsx +705 -0
- package/src/components/organisms/ServicesWorkspace/AssigneePicker.js +348 -0
- package/src/components/organisms/ServicesWorkspace/ServicesWorkspace.stories.js +61 -0
- package/src/components/organisms/ServicesWorkspace/demo.js +58 -0
- package/src/components/organisms/ServicesWorkspace/index.js +556 -0
- package/src/components/organisms/ServicesWorkspace/servicesModel.js +203 -0
- package/src/components/organisms/ServicesWorkspace/tooltipStyles.js +27 -0
- package/src/components/pages/CreatorsProductEdition/mocks/mockApi.js +17 -0
- package/src/components/pages/CreatorsProductEdition/mocks/productServices.fixtures.js +175 -0
- package/src/components/pages/CreatorsProductEdition/sections/StatusChip.jsx +8 -4
- package/src/components/pages/ProductEdition/ProductEdition.stories.js +106 -0
- package/src/components/pages/ProductEdition/ProductEditionView.jsx +1142 -0
- package/src/components/pages/ProductEdition/ServiceHeader.jsx +104 -0
- package/src/components/pages/ProductEdition/api.js +84 -0
- package/src/components/pages/ProductEdition/index.js +21 -0
- package/src/components/pages/ProductEdition/permissions.js +128 -0
- package/src/components/pages/ProductEdition/permissions.test.js +249 -0
- package/src/components/pages/ProductEdition/sections/CatalogServicePanel.jsx +123 -0
- package/src/components/pages/ProductEdition/sections/EditionTopBar.jsx +134 -0
- package/src/components/pages/ProductEdition/sections/ImagePanel.jsx +342 -0
- package/src/components/pages/ProductEdition/sections/ServiceTeam.jsx +184 -0
- package/src/components/pages/ProductEdition/sections/ServiceTools.jsx +134 -0
- package/src/components/pages/ProductEdition/services.js +187 -0
- package/src/components/pages/ProductEdition/services.test.js +88 -0
- package/src/components/pages/RetailerProductEdition/RetailerProductEdition.stories.js +12 -0
- package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +6 -2
- package/src/components/pages/RetailerProductEdition/index.js +28 -3
- package/src/components/pages/RetailerProductEdition/utils.js +5 -0
- package/src/index.js +1 -0
- package/.claude/settings.local.json +0 -7
- package/dist/ai/prompts/attribute.prompt.js +0 -28
- package/dist/ai/prompts/description.prompt.js +0 -33
- package/dist/ai/schemas/attribute.schema.js +0 -35
- package/dist/ai/schemas/description.schema.js +0 -27
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from "react";
|
|
1
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
|
|
3
3
|
import axios from "axios";
|
|
4
4
|
import { useDropzone } from "react-dropzone";
|
|
@@ -74,6 +74,7 @@ import generateThumbnail from "./generateThumnail";
|
|
|
74
74
|
|
|
75
75
|
import { AiProductEditionProvider } from "../../../contexts/AiProductEdition";
|
|
76
76
|
import ChangeStatusModal from "../../organisms/ChangeStatusModal";
|
|
77
|
+
import ServicesWorkspace from "../../organisms/ServicesWorkspace";
|
|
77
78
|
|
|
78
79
|
import { Skeleton, Box, Stack } from "@mui/material";
|
|
79
80
|
|
|
@@ -105,8 +106,14 @@ function obtenerDuracionVideoBase64(base64Data) {
|
|
|
105
106
|
});
|
|
106
107
|
}
|
|
107
108
|
|
|
109
|
+
/** Pestaña con todos los servicios del producto (ver organisms/ServicesWorkspace). */
|
|
110
|
+
const SERVICES_TAB = "Servicios";
|
|
111
|
+
|
|
108
112
|
const RetailerProductEditionView = ({
|
|
109
113
|
tabsSections,
|
|
114
|
+
// Opcional para no cambiar la edición de quien no la pida (aplicación de
|
|
115
|
+
// proveedores). Creators la activa.
|
|
116
|
+
showServicesTab = false,
|
|
110
117
|
productSelected = {},
|
|
111
118
|
user = {},
|
|
112
119
|
token,
|
|
@@ -134,6 +141,13 @@ const RetailerProductEditionView = ({
|
|
|
134
141
|
|
|
135
142
|
const isRetailer = user?.is_retailer;
|
|
136
143
|
|
|
144
|
+
const tabs = useMemo(
|
|
145
|
+
() =>
|
|
146
|
+
showServicesTab ? { ...tabsSections, [SERVICES_TAB]: false } : tabsSections,
|
|
147
|
+
[tabsSections, showServicesTab],
|
|
148
|
+
);
|
|
149
|
+
const isServicesTab = state.active_tab === SERVICES_TAB;
|
|
150
|
+
|
|
137
151
|
const [showVersionSelector, setShowVersionSelector] =
|
|
138
152
|
useCloseModal("version-selector");
|
|
139
153
|
const [auditableVersion, setAuditableVersion] = useState(null);
|
|
@@ -2928,7 +2942,7 @@ const RetailerProductEditionView = ({
|
|
|
2928
2942
|
}
|
|
2929
2943
|
/>
|
|
2930
2944
|
<FullTabsMenu
|
|
2931
|
-
tabsSections={
|
|
2945
|
+
tabsSections={tabs}
|
|
2932
2946
|
status={getStatusByCurrentServiceAndRetailer()}
|
|
2933
2947
|
activeTab={state.active_tab}
|
|
2934
2948
|
isRetailer={isRetailer}
|
|
@@ -2975,6 +2989,14 @@ const RetailerProductEditionView = ({
|
|
|
2975
2989
|
<Loading />
|
|
2976
2990
|
) : (
|
|
2977
2991
|
<>
|
|
2992
|
+
{isServicesTab && (
|
|
2993
|
+
<ServicesWorkspace
|
|
2994
|
+
product={state.product}
|
|
2995
|
+
retailers={state.product?.categoryRetailerInOrder ?? []}
|
|
2996
|
+
canAssign={![7, 8].includes(user.id_role)}
|
|
2997
|
+
onOpenEditor={handleOnChangeActiveTab}
|
|
2998
|
+
/>
|
|
2999
|
+
)}
|
|
2978
3000
|
{state.active_tab === "Descripción" &&
|
|
2979
3001
|
(state.product?.description_status !== "NS" ? (
|
|
2980
3002
|
<InputGroup
|
|
@@ -3150,7 +3172,10 @@ const RetailerProductEditionView = ({
|
|
|
3150
3172
|
</>
|
|
3151
3173
|
)}
|
|
3152
3174
|
</div>
|
|
3153
|
-
{
|
|
3175
|
+
{/* Comentario y cambio de estatus son de un servicio con editor;
|
|
3176
|
+
en la pestaña Servicios cada servicio lleva su propio detalle. */}
|
|
3177
|
+
{!isServicesTab &&
|
|
3178
|
+
(isUserAssignedToService(state.active_tab) ||
|
|
3154
3179
|
isAuditorAssigned()) &&
|
|
3155
3180
|
state.product[`${getConceptByTab(state.active_tab)}_status`] !==
|
|
3156
3181
|
"NS" && (
|
|
@@ -148,6 +148,11 @@ export const normalizeProduct = (product) => {
|
|
|
148
148
|
id_auditor: article.id_auditor || 0,
|
|
149
149
|
statusByRetailer: productData.statusByRetailer || null,
|
|
150
150
|
categoryRetailerInOrder: categoryRetailerInOrder || null,
|
|
151
|
+
|
|
152
|
+
// Servicios para la pestaña "Servicios": estatus por servicio del listado
|
|
153
|
+
// ligero de Creators (view=summary) y, en modo demo, los de ejemplo.
|
|
154
|
+
serviceStatuses: productData.serviceStatuses ?? null,
|
|
155
|
+
demo_services: productData.demo_services ?? null,
|
|
151
156
|
};
|
|
152
157
|
};
|
|
153
158
|
|
package/src/index.js
CHANGED
|
@@ -116,6 +116,7 @@ export * from "./components/pages/RegistrationLoginSecondStep";
|
|
|
116
116
|
export * from "./components/pages/RegistrationLoginThirdStep";
|
|
117
117
|
export * from "./components/pages/RetailerProductEdition";
|
|
118
118
|
export * from "./components/pages/CreatorsProductEdition";
|
|
119
|
+
export * from "./components/pages/ProductEdition";
|
|
119
120
|
export * from "./components/pages/ProviderProductEdition";
|
|
120
121
|
export * from "./components/pages/VerificationCodeResetPassword";
|
|
121
122
|
export * from "./components/pages/MultipleEdition";
|
|
@@ -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;
|