contentoh-components-library 21.6.50 → 21.6.51

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 (86) hide show
  1. package/.env.test +0 -1
  2. package/dist/components/atoms/IconFile/index.js +2 -85
  3. package/dist/components/atoms/IconFile/styles.js +1 -1
  4. package/dist/components/atoms/ProductImage/ProductImage.stories.js +2 -70
  5. package/dist/components/atoms/ProductImage/index.js +27 -100
  6. package/dist/components/atoms/ProductImage/styles.js +1 -3
  7. package/dist/components/molecules/EditionActiveImage/index.js +2 -4
  8. package/dist/components/molecules/GalleryElement/index.js +4 -13
  9. package/dist/components/molecules/GalleryHeader/index.js +24 -96
  10. package/dist/components/molecules/GalleryHeader/styles.js +1 -4
  11. package/dist/components/molecules/ImageSelector/index.js +0 -1
  12. package/dist/components/organisms/ImagePreviewer/index.js +0 -1
  13. package/dist/components/organisms/ProductImageModal/index.js +2 -3
  14. package/dist/components/pages/ProviderProductEdition/index.js +78 -53
  15. package/dist/components/pages/RetailerProductEdition/context/provider-product-edition.context.js +15 -330
  16. package/dist/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +2 -12
  17. package/dist/components/pages/RetailerProductEdition/index.js +445 -603
  18. package/dist/components/pages/RetailerProductEdition/stories/ImageEditor.stories.js +0 -1
  19. package/dist/components/pages/RetailerProductEdition/stories/TextEditor.stories.js +145 -45
  20. package/dist/global-files/data.js +3 -16
  21. package/dist/index.js +90 -142
  22. package/package.json +1 -1
  23. package/src/components/atoms/IconFile/index.js +1 -28
  24. package/src/components/atoms/IconFile/styles.js +0 -8
  25. package/src/components/atoms/ProductImage/ProductImage.stories.js +0 -38
  26. package/src/components/atoms/ProductImage/index.js +20 -95
  27. package/src/components/atoms/ProductImage/styles.js +7 -92
  28. package/src/components/molecules/EditionActiveImage/index.js +2 -2
  29. package/src/components/molecules/GalleryElement/index.js +0 -9
  30. package/src/components/molecules/GalleryHeader/index.js +13 -65
  31. package/src/components/molecules/GalleryHeader/styles.js +1 -2
  32. package/src/components/molecules/ImageSelector/index.js +0 -1
  33. package/src/components/organisms/ImagePreviewer/index.js +0 -1
  34. package/src/components/organisms/ProductImageModal/index.js +0 -1
  35. package/src/components/pages/ProviderProductEdition/index.js +36 -3
  36. package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +0 -201
  37. package/src/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +0 -12
  38. package/src/components/pages/RetailerProductEdition/index.js +179 -360
  39. package/src/components/pages/RetailerProductEdition/stories/ImageEditor.stories.js +0 -1
  40. package/src/components/pages/RetailerProductEdition/stories/TextEditor.stories.js +104 -51
  41. package/src/global-files/data.js +2 -17
  42. package/src/index.js +0 -4
  43. package/.claude/launch.json +0 -14
  44. package/dist/ai/prompts/attribute.prompt.js +0 -28
  45. package/dist/ai/prompts/description.prompt.js +0 -33
  46. package/dist/ai/schemas/attribute.schema.js +0 -35
  47. package/dist/ai/schemas/description.schema.js +0 -27
  48. package/dist/components/atoms/AssetPreview/AssetPreview.stories.js +0 -118
  49. package/dist/components/atoms/AssetPreview/index.js +0 -150
  50. package/dist/components/atoms/AssetPreview/styles.js +0 -28
  51. package/dist/components/molecules/GalleryAssetElement/GalleryAssetElement.stories.js +0 -147
  52. package/dist/components/molecules/GalleryAssetElement/index.js +0 -178
  53. package/dist/components/molecules/GalleryAssetElement/styles.js +0 -26
  54. package/dist/components/molecules/GalleryTrayTabs/GalleryTrayTabs.stories.js +0 -56
  55. package/dist/components/molecules/GalleryTrayTabs/index.js +0 -60
  56. package/dist/components/molecules/GalleryTrayTabs/styles.js +0 -20
  57. package/dist/components/organisms/DigitalAssetsTray/DigitalAssetsTray.stories.js +0 -171
  58. package/dist/components/organisms/DigitalAssetsTray/index.js +0 -211
  59. package/dist/components/organisms/DigitalAssetsTray/styles.js +0 -22
  60. package/dist/global-files/digital-assets/assetTypes.js +0 -480
  61. package/dist/global-files/digital-assets/assets.actions.js +0 -64
  62. package/dist/global-files/digital-assets/assets.adapter.js +0 -304
  63. package/dist/global-files/digital-assets/assets.mock.js +0 -136
  64. package/dist/global-files/digital-assets/assets.reducer.js +0 -220
  65. package/dist/global-files/digital-assets/uploadAssets.js +0 -179
  66. package/dist/global-files/digital-assets/useDigitalAssets.js +0 -522
  67. package/docs/activos-digitales.md +0 -273
  68. package/src/components/atoms/AssetPreview/AssetPreview.stories.js +0 -78
  69. package/src/components/atoms/AssetPreview/index.js +0 -119
  70. package/src/components/atoms/AssetPreview/styles.js +0 -190
  71. package/src/components/molecules/GalleryAssetElement/GalleryAssetElement.stories.js +0 -102
  72. package/src/components/molecules/GalleryAssetElement/index.js +0 -162
  73. package/src/components/molecules/GalleryAssetElement/styles.js +0 -159
  74. package/src/components/molecules/GalleryTrayTabs/GalleryTrayTabs.stories.js +0 -32
  75. package/src/components/molecules/GalleryTrayTabs/index.js +0 -41
  76. package/src/components/molecules/GalleryTrayTabs/styles.js +0 -52
  77. package/src/components/organisms/DigitalAssetsTray/DigitalAssetsTray.stories.js +0 -101
  78. package/src/components/organisms/DigitalAssetsTray/index.js +0 -189
  79. package/src/components/organisms/DigitalAssetsTray/styles.js +0 -183
  80. package/src/global-files/digital-assets/assetTypes.js +0 -419
  81. package/src/global-files/digital-assets/assets.actions.js +0 -50
  82. package/src/global-files/digital-assets/assets.adapter.js +0 -229
  83. package/src/global-files/digital-assets/assets.mock.js +0 -122
  84. package/src/global-files/digital-assets/assets.reducer.js +0 -197
  85. package/src/global-files/digital-assets/uploadAssets.js +0 -109
  86. package/src/global-files/digital-assets/useDigitalAssets.js +0 -329
@@ -15,7 +15,6 @@ ImageEditor.args = {
15
15
  "Ficha técnica": false,
16
16
  Imágenes: true,
17
17
  },
18
- enableDigitalAssets: true,
19
18
  token:
20
19
  "eyJraWQiOiJEV3owZnNieXg2MXNFcVduN3RCXC81bVhod3ZNbFZIOTgwUnZcL3RjT0lKdEk9IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJjN2U1YTZhNC0yY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{
23
- datasheets: 0,
24
- descriptions: 0,
25
- images: 1,
26
- },
27
- orderId: 9981,
28
- city: "CDMX",
29
- status: "AA",
30
- datasheet_status: "NS",
21
+ orderId: 10424,
22
+ status: "CA",
23
+ datasheet_status: "CA",
31
24
  prio: "none",
32
- version: 5,
33
- description_status: "NS",
34
- images_status: "AA",
35
- statusByRetailer: [
36
- {
37
- status: "AA",
38
- service: "images",
39
- retailer_id: 17,
40
- task_user_group_id: 5,
41
- },
42
- ],
25
+ version: 3,
26
+ description_status: "CA",
27
+ images_status: "CA",
28
+ brand: "Marca",
29
+ retailerOrder: 0,
30
+ missing: { datasheet: null, descriptions: null, images: null },
31
+ services: { datasheets: 1, descriptions: 1, images: 1 },
43
32
  article: {
44
- id_article: 140554,
45
- id_category: 264,
46
- brand: null,
47
- name: "AOX RI Suplemento alimenticio 30 caps de 600 mg c/u",
48
- upc: "123456789",
49
- sku: "123456789",
50
- timestamp: "2025-06-12T00:02:27.000Z",
51
- active: 1,
52
- company_id: 1541,
53
- company_name: "Uniq Balance",
33
+ category:
34
+ "Categoría Genérica Rappi|Categoría Genérica|Categoría Genérica",
35
+ company_name: "Walmart SA de CV",
54
36
  country: "México",
55
- id_order: 9981,
56
- id_datasheet_especialist: null,
37
+ id_category: "4911",
38
+ id_datasheet_especialist: 426,
57
39
  id_datasheet_facilitator: null,
58
- id_description_especialist: null,
40
+ id_description_especialist: 426,
59
41
  id_description_facilitator: null,
60
- id_images_especialist: null,
42
+ id_images_especialist: 427,
61
43
  id_images_facilitator: null,
62
- id_auditor: null,
63
- id_recepcionist: null,
64
- category: "Farmacia|Farmacia OTC|Suplementos Alimenticios",
44
+ id_order: 10424,
45
+ id_article: 144832,
46
+ id_auditor: 425,
47
+ name: "Copia prod cadenas 1",
48
+ timestamp: "2025-11-16T00:32:13.000Z",
49
+ upc: "100023",
50
+ sku: "900006",
65
51
  categoryRetailer: [
66
52
  {
67
- id_category: 264,
68
- id_retailer: 17,
69
- category_name: "Farmacia|Farmacia OTC|Suplementos Alimenticios",
70
- retailer_name: "Genérico",
53
+ id_category: 3431,
54
+ id_retailer: 24,
55
+ category_name:
56
+ "Abarrotes Básicos Alsuper|Abarrotes Básicos|Abarrotes Básicos",
57
+ retailer_name: "Alsuper",
58
+ },
59
+ {
60
+ id_category: 3435,
61
+ id_retailer: 21,
62
+ category_name:
63
+ "Bebés Cuidado e Higiene|Bebés Cuidado e Higiene|Bebés Cuidado e Higiene",
64
+ retailer_name: "Anicetos",
65
+ },
66
+ {
67
+ id_category: 3438,
68
+ id_retailer: 1008,
69
+ category_name:
70
+ "Categoría Genérica App Olímpica|Categoría Genérica|Categoría Genérica",
71
+ retailer_name: "App Olímpica",
72
+ },
73
+ {
74
+ id_category: 3439,
75
+ id_retailer: 2004,
76
+ category_name:
77
+ "Categoría Genérica Automercado|Categoría Genérica Automercado|Categoría Genérica Automercado",
78
+ retailer_name: "Automercado",
79
+ },
80
+ {
81
+ id_category: 4774,
82
+ id_retailer: 1032,
83
+ category_name:
84
+ "Categoría Genérica IMPIRA Colombia|Categoría Genérica|Categoría Genérica",
85
+ retailer_name: "IMPIRA Colombia",
86
+ },
87
+ {
88
+ id_category: 4911,
89
+ id_retailer: 16,
90
+ category_name:
91
+ "Categoría Genérica Rappi|Categoría Genérica|Categoría Genérica",
92
+ retailer_name: "Rappi",
93
+ },
94
+ {
95
+ id_category: 6103,
96
+ id_retailer: 9,
97
+ category_name: "Alimentos y Bebidas|Amazon Súper|Abarrotes",
98
+ retailer_name: "Amazon",
99
+ },
100
+ {
101
+ id_category: 6792,
102
+ id_retailer: 32,
103
+ category_name:
104
+ "Categoría Salud y Belleza Coppel|Categoría Salud y Belleza|Categoría Salud y Belleza",
105
+ retailer_name: "Coppel",
106
+ },
107
+ {
108
+ id_category: 7008,
109
+ id_retailer: 3,
110
+ category_name: "Bebés|Accesorios para Bebés|Accesorios para Bebés",
111
+ retailer_name: "Sam´s Club",
71
112
  },
72
113
  ],
73
114
  },
74
115
  retailers: [
75
- {
76
- id: 17,
77
- name: "Genérico",
78
- },
116
+ { id: 3, name: "Sam´s Club" },
117
+ { id: 16, name: "Rappi" },
118
+ { id: 32, name: "Coppel" },
119
+ { id: 1008, name: "App Olímpica" },
120
+ ],
121
+ statusByRetailer: [
122
+ { status: "RA/AS", service: "datasheet", retailer_id: 3 },
123
+ { status: "RA/AS", service: "description", retailer_id: 3 },
124
+ { status: "AA", service: "images", retailer_id: 3 },
125
+ { status: "AC", service: "datasheet", retailer_id: 16 },
126
+ { status: "AC", service: "description", retailer_id: 16 },
127
+ { status: "AC", service: "images", retailer_id: 16 },
128
+ { status: "AC", service: "datasheet", retailer_id: 32 },
129
+ { status: "AC", service: "description", retailer_id: 32 },
130
+ { status: "AC", service: "images", retailer_id: 32 },
131
+ { status: "PA", service: "datasheet", retailer_id: 1032 },
132
+ { status: "PA", service: "description", retailer_id: 1032 },
133
+ { status: "PA", service: "images", retailer_id: 1032 },
134
+ { status: "PA", service: "datasheet", retailer_id: 2004 },
135
+ { status: "PA", service: "description", retailer_id: 2004 },
136
+ { status: "PA", service: "images", retailer_id: 2004 },
79
137
  ],
80
- variantsCount: 0,
81
- parent: null,
82
- parentArticleId: null,
83
- country: "México",
84
- upc: "123456789",
85
138
  },
86
139
  user: {
87
140
  id_user: 426,
@@ -78,32 +78,17 @@ export const getImage = (imageGeneral, width = 250, height = 250) => {
78
78
  };
79
79
  const ext = image.src.split(".");
80
80
  const uuid = ext[0].split("-");
81
- const extension = ext[ext.length - 1]?.toLowerCase();
82
- /*
83
- El redimensionador de CloudFront reprocesa el archivo con sharp: sirve
84
- para una foto de producto y destruye todo lo demás. Un mp4 devuelve un
85
- error que la etiqueta <video> no puede reproducir, y un gif animado sale
86
- aplanado a un solo fotograma.
87
-
88
- Por eso solo los formatos que sharp sabe redimensionar pasan por el
89
- resizer; el resto se queda con la URL directa a S3, que es la misma que
90
- usa la descarga de imágenes. Sin esto hacía falta bajar cada video
91
- completo a base64 solo para generarle una miniatura.
92
- */
93
- const isResizable = ["jpg", "jpeg", "png", "webp", "tiff", "avif"].includes(extension);
94
81
  return {
95
82
  ...image,
96
83
  version: image.id_version,
97
- ext: extension,
84
+ ext: ext[ext.length - 1],
98
85
  uuid:
99
86
  uuid.reduce((prevVal, currVal, idx) => {
100
87
  if (idx < 2) return "";
101
88
  else return idx === 2 ? currVal : prevVal + "-" + currVal;
102
89
  }, "") || uuidv4(),
103
90
  srcDB: image.src,
104
- src: image.image_id && !isResizable
105
- ? `https://${process.env.REACT_APP_IMAGES_BUCKET}.s3.amazonaws.com/${image.src}`
106
- : image.image_id
91
+ src: image.image_id
107
92
  ? "https://d24s337exbt5zr.cloudfront.net/" +
108
93
  Base64.encode(
109
94
  JSON.stringify({
package/src/index.js CHANGED
@@ -15,7 +15,6 @@ export * from "./components/atoms/InheritanceTag/index";
15
15
  export * from "./components/atoms/Loading/index";
16
16
  export * from "./components/atoms/LogoImage/index";
17
17
  export * from "./components/atoms/PriorityFlag/index";
18
- export * from "./components/atoms/AssetPreview/index";
19
18
  export * from "./components/atoms/ProductImage/index";
20
19
  export * from "./components/atoms/ProgressBar/index";
21
20
  export * from "./components/atoms/ScreenHeader/index";
@@ -49,8 +48,6 @@ export * from "./components/molecules/CarouselImagesLogin";
49
48
  export * from "./components/molecules/EditionActiveImage/index";
50
49
  export * from "./components/molecules/EmailResetPasswordLogin/index";
51
50
  export * from "./components/molecules/FeaturesBar/index";
52
- export * from "./components/molecules/GalleryTrayTabs/index";
53
- export * from "./components/molecules/GalleryAssetElement/index";
54
51
  export * from "./components/molecules/GalleryElement/index";
55
52
  export * from "./components/molecules/HeaderTop/index";
56
53
  export * from "./components/molecules/ImageSelector/index";
@@ -82,7 +79,6 @@ export * from "./components/molecules/HeaderItem/index";
82
79
  export * from "./components/molecules/RowItem/index";
83
80
 
84
81
  //organisms
85
- export * from "./components/organisms/DigitalAssetsTray/index";
86
82
  export * from "./components/organisms/ChangePassword/index";
87
83
  export * from "./components/organisms/Fullplan/index";
88
84
  export * from "./components/organisms/FullProductNameHeader/index";
@@ -1,14 +0,0 @@
1
- {
2
- "version": "0.0.1",
3
- "configurations": [
4
- {
5
- "name": "start",
6
- "runtimeExecutable": "npm",
7
- "runtimeArgs": [
8
- "run",
9
- "start"
10
- ],
11
- "port": 3000
12
- }
13
- ]
14
- }
@@ -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;
@@ -1,118 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = exports.VideoConControles = exports.Video360 = exports.SinFuente = exports.Pdf = exports.Gif360 = exports.Bandeja = void 0;
9
-
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
11
-
12
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
13
-
14
- var _index = require("./index");
15
-
16
- var _assets = require("../../../global-files/digital-assets/assets.adapter");
17
-
18
- var _assets2 = require("../../../global-files/digital-assets/assets.mock");
19
-
20
- var _jsxRuntime = require("react/jsx-runtime");
21
-
22
- /*
23
- Los activos del mock apuntan a claves de S3 que no existen todavía. Para poder
24
- ver el componente antes de que haya backend, se sustituyen las URLs por
25
- archivos públicos de ejemplo; el resto del objeto (tipo, nombre, peso,
26
- duración) es el que devolvería el adaptador.
27
- */
28
- var SAMPLES = {
29
- mp4: "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4",
30
- gif: "https://upload.wikimedia.org/wikipedia/commons/2/2c/Rotating_earth_%28large%29.gif"
31
- };
32
-
33
- var _fromBackendList$map = (0, _assets.fromBackendList)(_assets2.backendAssetsMock).map(function (asset) {
34
- return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, asset), {}, {
35
- url: asset.ext === "mp4" ? SAMPLES.mp4 : asset.ext === "gif" ? SAMPLES.gif : "",
36
- poster: ""
37
- });
38
- }),
39
- _fromBackendList$map2 = (0, _slicedToArray2.default)(_fromBackendList$map, 4),
40
- giro360 = _fromBackendList$map2[0],
41
- gif360 = _fromBackendList$map2[1],
42
- video = _fromBackendList$map2[2],
43
- pdf = _fromBackendList$map2[3];
44
-
45
- var _default = {
46
- title: "Components/atoms/AssetPreview",
47
- component: _index.AssetPreview,
48
- argTypes: {
49
- size: {
50
- options: ["catalogue-image-small-size", "catalogue-image-big-size", "carousel-image", "catalogue-modal-image", "main-image"],
51
- control: {
52
- type: "select"
53
- }
54
- }
55
- }
56
- };
57
- exports.default = _default;
58
-
59
- var Template = function Template(args) {
60
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.AssetPreview, (0, _objectSpread2.default)({}, args));
61
- };
62
-
63
- var Video360 = Template.bind({});
64
- exports.Video360 = Video360;
65
- Video360.args = {
66
- asset: giro360,
67
- size: "catalogue-image-big-size"
68
- };
69
- var Gif360 = Template.bind({});
70
- exports.Gif360 = Gif360;
71
- Gif360.args = {
72
- asset: gif360,
73
- size: "catalogue-image-big-size"
74
- };
75
- var VideoConControles = Template.bind({});
76
- exports.VideoConControles = VideoConControles;
77
- VideoConControles.args = {
78
- asset: video,
79
- size: "main-image",
80
- controls: true
81
- };
82
- var Pdf = Template.bind({});
83
- exports.Pdf = Pdf;
84
- Pdf.args = {
85
- asset: pdf,
86
- size: "catalogue-image-big-size"
87
- };
88
- /** Un activo sin URL todavía —recién soltado en la bandeja— no debe romper. */
89
-
90
- var SinFuente = Template.bind({});
91
- exports.SinFuente = SinFuente;
92
- SinFuente.args = {
93
- asset: {
94
- name: "manual_sin_subir.pdf",
95
- ext: "pdf",
96
- assetType: "pdf"
97
- },
98
- size: "catalogue-image-big-size"
99
- };
100
- /** Cómo se ve la bandeja completa, que es el uso real. */
101
-
102
- var Bandeja = function Bandeja() {
103
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
104
- style: {
105
- display: "flex",
106
- gap: 12,
107
- flexWrap: "wrap"
108
- },
109
- children: [giro360, gif360, video, pdf].map(function (asset) {
110
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.AssetPreview, {
111
- asset: asset,
112
- size: "catalogue-image-big-size"
113
- }, asset.id);
114
- })
115
- });
116
- };
117
-
118
- exports.Bandeja = Bandeja;
@@ -1,150 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.AssetPreview = void 0;
9
-
10
- var _reactImageFallback = _interopRequireDefault(require("react-image-fallback"));
11
-
12
- var _styles = require("./styles");
13
-
14
- var _IconFile = require("../IconFile");
15
-
16
- var _assetTypes = require("../../../global-files/digital-assets/assetTypes");
17
-
18
- var _defaultProductImage = _interopRequireDefault(require("../../../assets/images/defaultImages/defaultProductImage.png"));
19
-
20
- var _jsxRuntime = require("react/jsx-runtime");
21
-
22
- var PlayBadge = function PlayBadge() {
23
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
24
- className: "play-badge",
25
- "aria-hidden": "true",
26
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("svg", {
27
- viewBox: "0 0 24 24",
28
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("circle", {
29
- cx: "12",
30
- cy: "12",
31
- r: "11"
32
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("polygon", {
33
- points: "9.5,7.5 17,12 9.5,16.5"
34
- })]
35
- })
36
- });
37
- };
38
- /**
39
- * Previsualización de un activo digital o de una imagen de producto.
40
- *
41
- * Acepta el modelo de `assets.adapter` y también un objeto suelto
42
- * (`{ url, mime, ext, name }`), para poder usarse donde todavía no hay activos
43
- * adaptados.
44
- *
45
- * `controls` distingue los dos usos: en la bandeja se quieren miniaturas
46
- * quietas; en el visor grande, un reproductor.
47
- */
48
-
49
-
50
- var AssetPreview = function AssetPreview(_ref) {
51
- var _ref$asset = _ref.asset,
52
- asset = _ref$asset === void 0 ? {} : _ref$asset,
53
- _ref$size = _ref.size,
54
- size = _ref$size === void 0 ? "catalogue-image-small-size" : _ref$size,
55
- _ref$controls = _ref.controls,
56
- controls = _ref$controls === void 0 ? false : _ref$controls,
57
- _ref$showBadge = _ref.showBadge,
58
- showBadge = _ref$showBadge === void 0 ? true : _ref$showBadge,
59
- _ref$showDuration = _ref.showDuration,
60
- showDuration = _ref$showDuration === void 0 ? true : _ref$showDuration,
61
- onClick = _ref.onClick,
62
- _ref$className = _ref.className,
63
- className = _ref$className === void 0 ? "" : _ref$className;
64
- var url = asset.url,
65
- src = asset.src,
66
- poster = asset.poster,
67
- mime = asset.mime,
68
- ext = asset.ext,
69
- name = asset.name,
70
- assetType = asset.assetType,
71
- duration = asset.duration;
72
- var source = url || src || "";
73
- var kind = (0, _assetTypes.resolvePreviewKind)({
74
- mime: mime,
75
- ext: ext,
76
- name: name
77
- });
78
- var extension = (ext || (0, _assetTypes.getExtension)(name) || "").toLowerCase();
79
- var label = assetType ? (0, _assetTypes.getAssetType)(assetType).label : extension.toUpperCase();
80
- var badge = showBadge && label ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
81
- className: "asset-badge",
82
- children: label
83
- }) : null;
84
- var durationTag = showDuration && duration ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
85
- className: "asset-duration",
86
- children: (0, _assetTypes.formatDuration)(duration)
87
- }) : null;
88
-
89
- var body = function body() {
90
- if (!source) {
91
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
92
- className: "asset-fallback",
93
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_IconFile.IconFile, {
94
- ext: extension,
95
- size: "34"
96
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
97
- title: name,
98
- children: name
99
- })]
100
- });
101
- }
102
-
103
- if (kind === _assetTypes.ASSET_PREVIEW.VIDEO) {
104
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
105
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("video", {
106
- // `#t=0.5` pide al navegador el fotograma del medio segundo en vez
107
- // de una pantalla negra. Resuelve la miniatura sin descargar el
108
- // archivo entero ni convertirlo a base64, que es lo que hacía el
109
- // parche que este componente reemplaza.
110
- src: poster ? source : "".concat(source, "#t=0.5"),
111
- poster: poster || undefined,
112
- controls: controls,
113
- muted: !controls,
114
- playsInline: true,
115
- preload: "metadata"
116
- }), !controls && /*#__PURE__*/(0, _jsxRuntime.jsx)(PlayBadge, {})]
117
- });
118
- }
119
-
120
- if (kind === _assetTypes.ASSET_PREVIEW.IMAGE) {
121
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactImageFallback.default, {
122
- src: source,
123
- fallbackImage: _defaultProductImage.default,
124
- alt: name,
125
- onClick: onClick
126
- });
127
- }
128
-
129
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
130
- className: "asset-fallback",
131
- onClick: onClick,
132
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_IconFile.IconFile, {
133
- ext: extension,
134
- size: "34"
135
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
136
- title: name,
137
- children: name
138
- })]
139
- });
140
- };
141
-
142
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.Container, {
143
- className: "".concat(size, " ").concat(className).trim(),
144
- onClick: controls ? undefined : onClick,
145
- $clickable: Boolean(onClick) && !controls,
146
- children: [body(), badge, durationTag]
147
- });
148
- };
149
-
150
- exports.AssetPreview = AssetPreview;