contentoh-components-library 21.6.50 → 21.6.52

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 (90) 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/organisms/PropagateChangesModal/index.js +6 -1
  15. package/dist/components/pages/ProviderProductEdition/context/provider-product-edition.context.js +10 -8
  16. package/dist/components/pages/ProviderProductEdition/index.js +189 -72
  17. package/dist/components/pages/RetailerProductEdition/context/provider-product-edition.context.js +25 -338
  18. package/dist/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +2 -12
  19. package/dist/components/pages/RetailerProductEdition/index.js +579 -631
  20. package/dist/components/pages/RetailerProductEdition/stories/ImageEditor.stories.js +0 -1
  21. package/dist/components/pages/RetailerProductEdition/stories/TextEditor.stories.js +145 -45
  22. package/dist/global-files/data.js +3 -16
  23. package/dist/index.js +90 -142
  24. package/package.json +1 -1
  25. package/src/components/atoms/IconFile/index.js +1 -28
  26. package/src/components/atoms/IconFile/styles.js +0 -8
  27. package/src/components/atoms/ProductImage/ProductImage.stories.js +0 -38
  28. package/src/components/atoms/ProductImage/index.js +20 -95
  29. package/src/components/atoms/ProductImage/styles.js +7 -92
  30. package/src/components/molecules/EditionActiveImage/index.js +2 -2
  31. package/src/components/molecules/GalleryElement/index.js +0 -9
  32. package/src/components/molecules/GalleryHeader/index.js +13 -65
  33. package/src/components/molecules/GalleryHeader/styles.js +1 -2
  34. package/src/components/molecules/ImageSelector/index.js +0 -1
  35. package/src/components/organisms/ImagePreviewer/index.js +0 -1
  36. package/src/components/organisms/ProductImageModal/index.js +0 -1
  37. package/src/components/organisms/PropagateChangesModal/index.js +10 -3
  38. package/src/components/pages/ProviderProductEdition/context/provider-product-edition.context.jsx +2 -1
  39. package/src/components/pages/ProviderProductEdition/index.js +111 -6
  40. package/src/components/pages/RetailerProductEdition/context/provider-product-edition.context.jsx +2 -202
  41. package/src/components/pages/RetailerProductEdition/context/provider-product-edition.reducer.js +0 -12
  42. package/src/components/pages/RetailerProductEdition/index.js +258 -363
  43. package/src/components/pages/RetailerProductEdition/stories/ImageEditor.stories.js +0 -1
  44. package/src/components/pages/RetailerProductEdition/stories/TextEditor.stories.js +104 -51
  45. package/src/global-files/data.js +2 -17
  46. package/src/index.js +0 -4
  47. package/.claude/launch.json +0 -14
  48. package/dist/ai/prompts/attribute.prompt.js +0 -28
  49. package/dist/ai/prompts/description.prompt.js +0 -33
  50. package/dist/ai/schemas/attribute.schema.js +0 -35
  51. package/dist/ai/schemas/description.schema.js +0 -27
  52. package/dist/components/atoms/AssetPreview/AssetPreview.stories.js +0 -118
  53. package/dist/components/atoms/AssetPreview/index.js +0 -150
  54. package/dist/components/atoms/AssetPreview/styles.js +0 -28
  55. package/dist/components/molecules/GalleryAssetElement/GalleryAssetElement.stories.js +0 -147
  56. package/dist/components/molecules/GalleryAssetElement/index.js +0 -178
  57. package/dist/components/molecules/GalleryAssetElement/styles.js +0 -26
  58. package/dist/components/molecules/GalleryTrayTabs/GalleryTrayTabs.stories.js +0 -56
  59. package/dist/components/molecules/GalleryTrayTabs/index.js +0 -60
  60. package/dist/components/molecules/GalleryTrayTabs/styles.js +0 -20
  61. package/dist/components/organisms/DigitalAssetsTray/DigitalAssetsTray.stories.js +0 -171
  62. package/dist/components/organisms/DigitalAssetsTray/index.js +0 -211
  63. package/dist/components/organisms/DigitalAssetsTray/styles.js +0 -22
  64. package/dist/global-files/digital-assets/assetTypes.js +0 -480
  65. package/dist/global-files/digital-assets/assets.actions.js +0 -64
  66. package/dist/global-files/digital-assets/assets.adapter.js +0 -304
  67. package/dist/global-files/digital-assets/assets.mock.js +0 -136
  68. package/dist/global-files/digital-assets/assets.reducer.js +0 -220
  69. package/dist/global-files/digital-assets/uploadAssets.js +0 -179
  70. package/dist/global-files/digital-assets/useDigitalAssets.js +0 -522
  71. package/docs/activos-digitales.md +0 -273
  72. package/src/components/atoms/AssetPreview/AssetPreview.stories.js +0 -78
  73. package/src/components/atoms/AssetPreview/index.js +0 -119
  74. package/src/components/atoms/AssetPreview/styles.js +0 -190
  75. package/src/components/molecules/GalleryAssetElement/GalleryAssetElement.stories.js +0 -102
  76. package/src/components/molecules/GalleryAssetElement/index.js +0 -162
  77. package/src/components/molecules/GalleryAssetElement/styles.js +0 -159
  78. package/src/components/molecules/GalleryTrayTabs/GalleryTrayTabs.stories.js +0 -32
  79. package/src/components/molecules/GalleryTrayTabs/index.js +0 -41
  80. package/src/components/molecules/GalleryTrayTabs/styles.js +0 -52
  81. package/src/components/organisms/DigitalAssetsTray/DigitalAssetsTray.stories.js +0 -101
  82. package/src/components/organisms/DigitalAssetsTray/index.js +0 -189
  83. package/src/components/organisms/DigitalAssetsTray/styles.js +0 -183
  84. package/src/global-files/digital-assets/assetTypes.js +0 -419
  85. package/src/global-files/digital-assets/assets.actions.js +0 -50
  86. package/src/global-files/digital-assets/assets.adapter.js +0 -229
  87. package/src/global-files/digital-assets/assets.mock.js +0 -122
  88. package/src/global-files/digital-assets/assets.reducer.js +0 -197
  89. package/src/global-files/digital-assets/uploadAssets.js +0 -109
  90. package/src/global-files/digital-assets/useDigitalAssets.js +0 -329
@@ -31,7 +31,6 @@ ImageEditor.args = {
31
31
  "Ficha técnica": false,
32
32
  Imágenes: true
33
33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ZF1002JsdMaoFg2UP3H5gzcbcuxgtjNuyhqaXGnoCBsPhu6SOAwWLEu1pZMty88OFteEWEdxJxCbzKaj8IomT8U4Tjiti4tshMkXRnxHBqAkGzLDu3ypbG4S31CR7RgDxRIVqntw",
35
35
  productSelected: {
36
- articleId: 140554,
36
+ orderId: 10424,
37
+ status: "CA",
38
+ datasheet_status: "CA",
39
+ prio: "none",
40
+ version: 3,
41
+ description_status: "CA",
42
+ images_status: "CA",
43
+ brand: "Marca",
44
+ retailerOrder: 0,
45
+ missing: {
46
+ datasheet: null,
47
+ descriptions: null,
48
+ images: null
49
+ },
37
50
  services: {
38
- datasheets: 0,
39
- descriptions: 0,
51
+ datasheets: 1,
52
+ descriptions: 1,
40
53
  images: 1
41
54
  },
42
- orderId: 9981,
43
- city: "CDMX",
44
- status: "AA",
45
- datasheet_status: "NS",
46
- prio: "none",
47
- version: 5,
48
- description_status: "NS",
49
- images_status: "AA",
50
- statusByRetailer: [{
51
- status: "AA",
52
- service: "images",
53
- retailer_id: 17,
54
- task_user_group_id: 5
55
- }],
56
55
  article: {
57
- id_article: 140554,
58
- id_category: 264,
59
- brand: null,
60
- name: "AOX RI Suplemento alimenticio 30 caps de 600 mg c/u",
61
- upc: "123456789",
62
- sku: "123456789",
63
- timestamp: "2025-06-12T00:02:27.000Z",
64
- active: 1,
65
- company_id: 1541,
66
- company_name: "Uniq Balance",
56
+ category: "Categoría Genérica Rappi|Categoría Genérica|Categoría Genérica",
57
+ company_name: "Walmart SA de CV",
67
58
  country: "México",
68
- id_order: 9981,
69
- id_datasheet_especialist: null,
59
+ id_category: "4911",
60
+ id_datasheet_especialist: 426,
70
61
  id_datasheet_facilitator: null,
71
- id_description_especialist: null,
62
+ id_description_especialist: 426,
72
63
  id_description_facilitator: null,
73
- id_images_especialist: null,
64
+ id_images_especialist: 427,
74
65
  id_images_facilitator: null,
75
- id_auditor: null,
76
- id_recepcionist: null,
77
- category: "Farmacia|Farmacia OTC|Suplementos Alimenticios",
66
+ id_order: 10424,
67
+ id_article: 144832,
68
+ id_auditor: 425,
69
+ name: "Copia prod cadenas 1",
70
+ timestamp: "2025-11-16T00:32:13.000Z",
71
+ upc: "100023",
72
+ sku: "900006",
78
73
  categoryRetailer: [{
79
- id_category: 264,
80
- id_retailer: 17,
81
- category_name: "Farmacia|Farmacia OTC|Suplementos Alimenticios",
82
- retailer_name: "Genérico"
74
+ id_category: 3431,
75
+ id_retailer: 24,
76
+ category_name: "Abarrotes Básicos Alsuper|Abarrotes Básicos|Abarrotes Básicos",
77
+ retailer_name: "Alsuper"
78
+ }, {
79
+ id_category: 3435,
80
+ id_retailer: 21,
81
+ category_name: "Bebés Cuidado e Higiene|Bebés Cuidado e Higiene|Bebés Cuidado e Higiene",
82
+ retailer_name: "Anicetos"
83
+ }, {
84
+ id_category: 3438,
85
+ id_retailer: 1008,
86
+ category_name: "Categoría Genérica App Olímpica|Categoría Genérica|Categoría Genérica",
87
+ retailer_name: "App Olímpica"
88
+ }, {
89
+ id_category: 3439,
90
+ id_retailer: 2004,
91
+ category_name: "Categoría Genérica Automercado|Categoría Genérica Automercado|Categoría Genérica Automercado",
92
+ retailer_name: "Automercado"
93
+ }, {
94
+ id_category: 4774,
95
+ id_retailer: 1032,
96
+ category_name: "Categoría Genérica IMPIRA Colombia|Categoría Genérica|Categoría Genérica",
97
+ retailer_name: "IMPIRA Colombia"
98
+ }, {
99
+ id_category: 4911,
100
+ id_retailer: 16,
101
+ category_name: "Categoría Genérica Rappi|Categoría Genérica|Categoría Genérica",
102
+ retailer_name: "Rappi"
103
+ }, {
104
+ id_category: 6103,
105
+ id_retailer: 9,
106
+ category_name: "Alimentos y Bebidas|Amazon Súper|Abarrotes",
107
+ retailer_name: "Amazon"
108
+ }, {
109
+ id_category: 6792,
110
+ id_retailer: 32,
111
+ category_name: "Categoría Salud y Belleza Coppel|Categoría Salud y Belleza|Categoría Salud y Belleza",
112
+ retailer_name: "Coppel"
113
+ }, {
114
+ id_category: 7008,
115
+ id_retailer: 3,
116
+ category_name: "Bebés|Accesorios para Bebés|Accesorios para Bebés",
117
+ retailer_name: "Sam´s Club"
83
118
  }]
84
119
  },
85
120
  retailers: [{
86
- id: 17,
87
- name: "Genérico"
121
+ id: 3,
122
+ name: "Sam´s Club"
123
+ }, {
124
+ id: 16,
125
+ name: "Rappi"
126
+ }, {
127
+ id: 32,
128
+ name: "Coppel"
129
+ }, {
130
+ id: 1008,
131
+ name: "App Olímpica"
88
132
  }],
89
- variantsCount: 0,
90
- parent: null,
91
- parentArticleId: null,
92
- country: "México",
93
- upc: "123456789"
133
+ statusByRetailer: [{
134
+ status: "RA/AS",
135
+ service: "datasheet",
136
+ retailer_id: 3
137
+ }, {
138
+ status: "RA/AS",
139
+ service: "description",
140
+ retailer_id: 3
141
+ }, {
142
+ status: "AA",
143
+ service: "images",
144
+ retailer_id: 3
145
+ }, {
146
+ status: "AC",
147
+ service: "datasheet",
148
+ retailer_id: 16
149
+ }, {
150
+ status: "AC",
151
+ service: "description",
152
+ retailer_id: 16
153
+ }, {
154
+ status: "AC",
155
+ service: "images",
156
+ retailer_id: 16
157
+ }, {
158
+ status: "AC",
159
+ service: "datasheet",
160
+ retailer_id: 32
161
+ }, {
162
+ status: "AC",
163
+ service: "description",
164
+ retailer_id: 32
165
+ }, {
166
+ status: "AC",
167
+ service: "images",
168
+ retailer_id: 32
169
+ }, {
170
+ status: "PA",
171
+ service: "datasheet",
172
+ retailer_id: 1032
173
+ }, {
174
+ status: "PA",
175
+ service: "description",
176
+ retailer_id: 1032
177
+ }, {
178
+ status: "PA",
179
+ service: "images",
180
+ retailer_id: 1032
181
+ }, {
182
+ status: "PA",
183
+ service: "datasheet",
184
+ retailer_id: 2004
185
+ }, {
186
+ status: "PA",
187
+ service: "description",
188
+ retailer_id: 2004
189
+ }, {
190
+ status: "PA",
191
+ service: "images",
192
+ retailer_id: 2004
193
+ }]
94
194
  },
95
195
  user: {
96
196
  id_user: 426,
@@ -107,7 +107,7 @@ var getImage = function getImage(imageGeneral) {
107
107
  var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 250;
108
108
 
109
109
  try {
110
- var _imageGeneral$image_i, _ext;
110
+ var _imageGeneral$image_i;
111
111
 
112
112
  // `id_image` es el nombre de la columna en base de datos; `image_id` el que
113
113
  // usa el front. Se acepta cualquiera de los dos para que la URL se arme
@@ -117,27 +117,14 @@ var getImage = function getImage(imageGeneral) {
117
117
  });
118
118
  var ext = image.src.split(".");
119
119
  var uuid = ext[0].split("-");
120
- var extension = (_ext = ext[ext.length - 1]) === null || _ext === void 0 ? void 0 : _ext.toLowerCase();
121
- /*
122
- El redimensionador de CloudFront reprocesa el archivo con sharp: sirve
123
- para una foto de producto y destruye todo lo demás. Un mp4 devuelve un
124
- error que la etiqueta <video> no puede reproducir, y un gif animado sale
125
- aplanado a un solo fotograma.
126
- Por eso solo los formatos que sharp sabe redimensionar pasan por el
127
- resizer; el resto se queda con la URL directa a S3, que es la misma que
128
- usa la descarga de imágenes. Sin esto hacía falta bajar cada video
129
- completo a base64 solo para generarle una miniatura.
130
- */
131
-
132
- var isResizable = ["jpg", "jpeg", "png", "webp", "tiff", "avif"].includes(extension);
133
120
  return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, image), {}, {
134
121
  version: image.id_version,
135
- ext: extension,
122
+ ext: ext[ext.length - 1],
136
123
  uuid: uuid.reduce(function (prevVal, currVal, idx) {
137
124
  if (idx < 2) return "";else return idx === 2 ? currVal : prevVal + "-" + currVal;
138
125
  }, "") || (0, _uuid.v4)(),
139
126
  srcDB: image.src,
140
- src: image.image_id && !isResizable ? "https://".concat(process.env.REACT_APP_IMAGES_BUCKET, ".s3.amazonaws.com/").concat(image.src) : image.image_id ? "https://d24s337exbt5zr.cloudfront.net/" + _jsBase.Base64.encode(JSON.stringify({
127
+ src: image.image_id ? "https://d24s337exbt5zr.cloudfront.net/" + _jsBase.Base64.encode(JSON.stringify({
141
128
  bucket: process.env.REACT_APP_IMAGES_BUCKET,
142
129
  key: image.src,
143
130
  edits: {